diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..e1357fb7c --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,46 @@ +# Documentation is here: https://www.appveyor.com/docs/appveyor-yml/ +# You can validate ymls here: https://ci.appveyor.com/tools/validate-yaml + +skip_commits: + files: + - doc/* + - doc/*/* + - .github/* + - .github/*/* + - .azure-pipelines.yml + - .travis.yml + - CONTRIBUTORS + - COPYING + - README.md + - gen-msvc-project.bat + - setup.bat + +init: + - ps: Update-AppveyorBuild -Version "$env:appveyor_repo_commit" + +image: # If this is modified, please also update the build script + - Visual Studio 2019 + +configuration: # The builds will be run in this order + - Release + - Debug + +before_build: + - |- + git submodule update --init --recursive + mkdir build + cd build + cmake .. -G "Visual Studio 16 2019" -A Win32 + +build_script: + - cmake --build . --config %configuration% + +on_success: + - ps: |- + If ($env:configuration -eq 'Release') { + cd bin\$env:configuration + 7z u "$env:configuration.zip" ..\..\..\COPYING ..\..\..\README.md + 7z u "$env:configuration.zip" Cxbx.exe glew32.dll subhook.dll SDL2.dll + 7z u "$env:configuration.zip" cxbxr-debugger.exe capstone.dll cs_x86.dll + Get-ChildItem .\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + } diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml new file mode 100644 index 000000000..b93884965 --- /dev/null +++ b/.azure-pipelines.yml @@ -0,0 +1,82 @@ +trigger: + branches: + include: + - '*' + paths: + exclude: + - doc/* + - doc/*/* + - .github/* + - .github/*/* + - .appveyor.yml + - .travis.yml + - CONTRIBUTORS + - COPYING + - README.md + - gen-msvc-project.bat + - setup.bat + +pr: + branches: + include: + - '*' + paths: + exclude: + - doc/* + - doc/*/* + - .github/* + - .github/*/* + - .appveyor.yml + - .travis.yml + - CONTRIBUTORS + - COPYING + - README.md + - gen-msvc-project.bat + - setup.bat + +jobs: +- job: + pool: + vmImage: windows-latest + strategy: + matrix: + Release: + configuration: Release + Debug: + configuration: Debug + + steps: + - checkout: self + submodules: recursive + + - script: | + mkdir build + cd build + cmake .. -G "Visual Studio 16 2019" -A Win32 + displayName: 'Before build' + + - script: cmake --build . --config %configuration% + workingDirectory: build + displayName: 'Build' + + - task: CopyFiles@2 + displayName: 'Copy files to $(Build.ArtifactStagingDirectory)' + condition: and(succeeded(), eq(variables['Agent.JobName'], 'Release')) + inputs: + Contents: | + COPYING + README.md + build\bin\$(configuration)\Cxbx.exe + build\bin\$(configuration)\glew32.dll + build\bin\$(configuration)\subhook.dll + build\bin\$(configuration)\SDL2.dll + build\bin\$(configuration)\cxbxr-debugger.exe + build\bin\$(configuration)\capstone.dll + build\bin\$(configuration)\cx_x86.dll + TargetFolder: '$(Build.ArtifactStagingDirectory)' + flattenFolders: true + + - publish: $(Build.ArtifactStagingDirectory) + artifact: $(configuration) + condition: and(succeeded(), eq(variables['Agent.JobName'], 'Release')) + displayName: Publish artifact(s) diff --git a/.gitattributes b/.gitattributes index cfd07fbb0..e42ecabd6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,3 +17,6 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + +[Cc][Mm]ake[Ll]ists.txt text=lf +*.bat text=lf diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..cc130119e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Cxbx-Reloaded Discord server + url: https://discord.gg/26Xjx23 + about: You can ask questions here. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/issue-template.md similarity index 63% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/issue-template.md index eef0507f2..7eb3f7443 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -1,5 +1,14 @@ +--- +name: Issue template +about: Issue template. +title: '' +labels: '' +assignees: '' + +--- + diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..ac7d109a9 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,119 @@ +name: GitHub CI + +on: + push: + paths-ignore: + - '.github/CONTRIBUTING.md' + - '.github/FUNDING.md' + - '.github/ISSUE_TEMPLATE/*' + - 'doc/*' + - 'doc/*/*' + - '.appveyor.yml' + - '.azure-pipelines.yml' + - '.travis.yml' + - 'gen-msvc-project.bat' + - 'setup.bat' + pull_request: + paths-ignore: + - '.github/CONTRIBUTING.md' + - '.github/FUNDING.md' + - '.github/ISSUE_TEMPLATE/*' + - 'doc/*' + - 'doc/*/*' + - '.appveyor.yml' + - '.azure-pipelines.yml' + - '.travis.yml' + - 'gen-msvc-project.bat' + - 'setup.bat' + +jobs: + build-windows: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + configuration: [Release, Debug] + vsver: [VS2019, VS2017] + include: + - vsver: VS2019 + os: windows-latest + - vsver: VS2017 # TODO: Remove VS2017 once WINE supports VS2019 runtimes; + os: windows-2016 # https://github.com/actions/virtual-environments/issues/68#issuecomment-602652021 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Generate cmake files + run: | + mkdir build && cd build + cmake .. -A Win32 + - name: Build + working-directory: build + run: cmake --build . --config ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS + - name: Prepare artifacts + if: matrix.configuration == 'Release' + run: | + robocopy . artifacts COPYING README.md /r:0 /w:0 + robocopy build\bin\${{ matrix.configuration }} artifacts ` + Cxbx.exe glew32.dll subhook.dll SDL2.dll ` + cxbxr-debugger.exe capstone.dll cs_x86.dll /r:0 /w:0 + If ($LastExitCode -le 7) { $LastExitCode = 0 } + - uses: actions/upload-artifact@v1 + if: matrix.configuration == 'Release' + with: + name: CxbxReloaded-${{ matrix.configuration }}-${{ matrix.vsver }} + path: artifacts + + release: + if: | # TODO: Remove develop once rebased + github.event.action != 'pull_request' && + (github.ref == 'refs/heads/develop' || + github.ref == 'refs/heads/master') && + github.repository == 'Cxbx-Reloaded/Cxbx-Reloaded' + needs: build-windows + env: + artifact_1: CxbxReloaded-Release-VS2019 + artifact_2: CxbxReloaded-Release-VS2017 + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Download artifacts (1) + uses: actions/download-artifact@v1 + with: + name: ${{ env.artifact_1 }} + - name: Download artifacts (2) + uses: actions/download-artifact@v1 + with: + name: ${{ env.artifact_2 }} + - name: Prepare artifacts for release + run: | # download-artifact doesn't download a zip, so rezip it + echo "::set-env name=short_commit_sha::$(git rev-parse --short HEAD)" + 7z a -mx1 "$env:artifact_1.zip" ".\$env:artifact_1\*" + 7z a -mx1 "$env:artifact_2.zip" ".\$env:artifact_2\*" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: CI-${{ env.short_commit_sha }} + release_name: CI-${{ env.short_commit_sha }} + prerelease: true + - name: Upload Release Asset (1) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.artifact_1 }}.zip + asset_name: ${{ env.artifact_1 }}.zip + asset_content_type: application/zip + - name: Upload Release Asset (2) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.artifact_2 }}.zip + asset_name: ${{ env.artifact_2 }}.zip + asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index 0fb3ab4f6..d81b16c69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,115 +1,16 @@ -# Compiled Object files -*.slo -*.lo -*.o +# Build folders +[Bb]uild/ +[Bb]uild-*/ -# Compiled Dynamic libraries -*.so -*.dylib - -# Compiled Static libraries -*.lai -*.la -*.a - -#OS junk files -[Tt]humbs.db -*.DS_Store - -#Documentation output -doc/doxygen/html - -#Export -export - -#Visual Studio files -*.[Oo]bj -*.user -*.aps -*.pch -*.vspscc -*.vssscc -*_i.c -*_p.c -*.ncb -*.suo -*.tlb -*.tlh -*.bak -*.ilk -*.log -*.sbr -*.sdf -*.opensdf -*.unsuccessfulbuild -obj/ -[Bb]in -build/win32/[Dd]ebug*/ -build/win32/[Rr]elease*/ -build/win32/Win32/ -build/win32/Cxbx.ChildProcessDbgSettings -Build/win32/ipch/ -Ankh.NoLoad -*.ChildProcessDbgSettings - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Visual Studio 2015/2017 cache files +# Visual Studio Cache .vs/ -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -#MonoDevelop -*.pidb -*.userprefs - -#Tooling -_ReSharper*/ -*.resharper -[Tt]est[Rr]esult* -*.sass-cache - -#Subversion files -.svn - -# Office Temp Files -~$* - -#NuGet -packages/ - -#ncrunch -*ncrunch* -*crunch*.local.xml - -# visual studio database projects -*.dbmdl +# Generated files +*.aps #Test files -*.testsettings -src/Version.h -*.opendb -*.db +src/[Vv]ersion.h *.xbe -*.ipch -*.db-shm -*.db-wal # Last known git hash LAST_GIT_VERSION diff --git a/.gitmodules b/.gitmodules index bfb466842..bfa6e6884 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,23 @@ [submodule "import/subhook"] path = import/subhook - url = https://github.com/Cxbx-Reloaded/subhook + url = https://github.com/Zeex/subhook.git [submodule "import/cs_x86"] path = import/cs_x86 url = https://github.com/x1nixmzeng/cs_x86 -[submodule "import/d3d8to9"] - path = import/d3d8to9 - url = https://github.com/Cxbx-Reloaded/d3d8to9 [submodule "import/XbSymbolDatabase"] path = import/XbSymbolDatabase - url = https://github.com/Cxbx-Reloaded/XbSymbolDatabase.git + url = https://github.com/Cxbx-Reloaded/XbSymbolDatabase +[submodule "import/simpleini"] + path = import/simpleini + url = https://github.com/brofield/simpleini +[submodule "import/libtommath"] + path = import/libtommath + url = https://github.com/libtom/libtommath + branch = master +[submodule "import/libtomcrypt"] + path = import/libtomcrypt + url = https://github.com/libtom/libtomcrypt + branch = master +[submodule "import/SDL2"] + path = import/SDL2 + url = https://github.com/SDL-mirror/SDL diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..60ac30959 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: cpp + +matrix: + include: + - os: windows + env: configuration=Debug + - os: windows + env: configuration=Release + +before_script: + - if [ $TRAVIS_OS_NAME == 'windows' ]; then + mkdir build; + cd build; + cmake .. -G "Visual Studio 15 2017" -A Win32; + fi + +script: + - if [ $TRAVIS_OS_NAME == 'windows' ]; then + cmake --build . --config $configuration; + fi diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..030b1c5df --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,400 @@ +cmake_minimum_required (VERSION 3.8) + +project(Cxbx-Reloaded) + +# Allow devs to disable regeneration option. +# Suppress extra stuff from generated solution +#set(CMAKE_SUPPRESS_REGENERATION true) + +# Output all binary files into one folder +if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Cxbx-Reloaded_BINARY_DIR}/bin") +endif() + +set(SUBHOOK_TESTS OFF) +set(SUBHOOK_INSTALL OFF) +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/subhook") + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/XbSymbolDatabase") + +# Not require since only include a header file +#add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/simpleini") + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/SDL2") + +if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/cs_x86") +endif() + +# Cxbx-Reloaded projects +set(CXBXR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}) + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/libtom") + +find_package(Git) + +if(Git_FOUND) + message("Git found: ${GIT_EXECUTABLE}") + + execute_process( + COMMAND git describe --always --tags --first-parent + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE _GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + message("Git version: " ${_GIT_VERSION}) +else() + set(_GIT_VERSION "unknown") +endif() + +# Appears to update whenever define has changed. +configure_file( + "${CXBXR_ROOT_DIR}/src/version.h.in" "${CXBXR_ROOT_DIR}/src/version.h" @ONLY + NEWLINE_STYLE LF +) + +#add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/vsbc") + +# Split the files into group for which project is likely +# going to be used for both header and source files. +# Then move only specific project files into their +# cmakelist file in finalize stage. +# Any of files being shared between two projects need to +# leave in parent cmakelist (here) for better sync across +# child projects. + +# Common (GUI and Emulator) +file (GLOB CXBXR_HEADER_COMMON + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuDes.h" + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuRsa.h" + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuSha.h" + "${CXBXR_ROOT_DIR}/src/common/crypto/LibRc4.h" + "${CXBXR_ROOT_DIR}/src/common/CxbxDebugger.h" + "${CXBXR_ROOT_DIR}/src/common/EmuEEPROM.h" + "${CXBXR_ROOT_DIR}/src/common/Error.h" + "${CXBXR_ROOT_DIR}/src/common/input/DInputKeyboardCodes.h" + "${CXBXR_ROOT_DIR}/src/common/input/DInputKeyboardMouse.h" + "${CXBXR_ROOT_DIR}/src/common/input/layout_xbox_controller.h" + "${CXBXR_ROOT_DIR}/src/common/input/InputDevice.h" + "${CXBXR_ROOT_DIR}/src/common/input/InputManager.h" + "${CXBXR_ROOT_DIR}/src/common/input/SdlJoystick.h" + "${CXBXR_ROOT_DIR}/src/common/input/XInputPad.h" + "${CXBXR_ROOT_DIR}/src/common/IPCHybrid.hpp" + "${CXBXR_ROOT_DIR}/src/common/Logging.h" + "${CXBXR_ROOT_DIR}/src/common/ReservedMemory.h" + "${CXBXR_ROOT_DIR}/src/common/Settings.hpp" + "${CXBXR_ROOT_DIR}/src/common/Timer.h" + "${CXBXR_ROOT_DIR}/src/common/util/CPUID.h" + "${CXBXR_ROOT_DIR}/src/common/util/crc32c.h" + "${CXBXR_ROOT_DIR}/src/common/util/CxbxUtil.h" + "${CXBXR_ROOT_DIR}/src/common/util/strConverter.hpp" + "${CXBXR_ROOT_DIR}/src/common/win32/AlignPosfix1.h" + "${CXBXR_ROOT_DIR}/src/common/win32/AlignPrefix1.h" + "${CXBXR_ROOT_DIR}/src/common/win32/EmuShared.h" + "${CXBXR_ROOT_DIR}/src/common/win32/Mutex.h" + "${CXBXR_ROOT_DIR}/src/common/win32/Threads.h" + "${CXBXR_ROOT_DIR}/src/common/xbdm/CxbxXbdm.h" + "${CXBXR_ROOT_DIR}/src/common/xbe/Xbe.h" + "${CXBXR_ROOT_DIR}/src/common/xbe/XbePrinter.h" + "${CXBXR_ROOT_DIR}/src/common/xdvdfs-tools/buffered_io.h" + "${CXBXR_ROOT_DIR}/src/common/xdvdfs-tools/xdvdfs.h" + "${CXBXR_ROOT_DIR}/src/Cxbx.h" + "${CXBXR_ROOT_DIR}/src/CxbxVersion.h" + "${CXBXR_ROOT_DIR}/src/version.h" +) + +# GUI v1 +file (GLOB CXBXR_HEADER_GUIv1 + "${CXBXR_ROOT_DIR}/src/common/input/Button.h" + "${CXBXR_ROOT_DIR}/src/common/input/EmuDevice.h" + "${CXBXR_ROOT_DIR}/src/common/input/InputWindow.h" + "${CXBXR_ROOT_DIR}/src/gui/DbgConsole.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgAbout.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgAudioConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgInputConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgDukeControllerConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgEepromConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgLoggingConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgNetworkConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/DlgVideoConfig.h" + "${CXBXR_ROOT_DIR}/src/gui/ResCxbx.h" + "${CXBXR_ROOT_DIR}/src/gui/Wnd.h" + "${CXBXR_ROOT_DIR}/src/gui/WndMain.h" +) + +# Emulator (module) +file (GLOB CXBXR_HEADER_EMU + "${CXBXR_ROOT_DIR}/src/common/util/gloffscreen/glextensions.h" + "${CXBXR_ROOT_DIR}/src/common/util/gloffscreen/gloffscreen.h" + "${CXBXR_ROOT_DIR}/src/common/XADPCM.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/Direct3D9.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/VertexShader.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/VertexShaderSource.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/ResourceTracker.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbConvert.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbD3D8Logging.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbD3D8Types.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbPixelShader.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbPushBuffer.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbState.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexBuffer.h" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexShader.h" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/common/windows/WFXformat.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundInline.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/XbDSoundLogging.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/XbDSoundTypes.h" + "${CXBXR_ROOT_DIR}/src/core/hle/Intercept.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/Patches.hpp" + "${CXBXR_ROOT_DIR}/src/core/hle/XACTENG/XactEng.h" + "${CXBXR_ROOT_DIR}/src/core/hle/XAPI/Xapi.h" + "${CXBXR_ROOT_DIR}/src/core/hle/XAPI/XapiCxbxr.h" + "${CXBXR_ROOT_DIR}/src/core/hle/XGRAPHIC/XGraphic.h" + "${CXBXR_ROOT_DIR}/src/core/hle/XONLINE/XOnline.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/common/strings.hpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlAvModes.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlKe.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlKi.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlLogging.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/init/CxbxKrnl.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/PhysicalMemory.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/PoolManager.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/VMManager.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/Emu.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuFile.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuFS.h" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuNtDll.h" + "${CXBXR_ROOT_DIR}/src/devices/ADM1032Device.h" + "${CXBXR_ROOT_DIR}/src/devices/EEPROMDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/EmuNVNet.h" + "${CXBXR_ROOT_DIR}/src/devices/LED.h" + "${CXBXR_ROOT_DIR}/src/devices/MCPXDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/PCIBus.h" + "${CXBXR_ROOT_DIR}/src/devices/PCIDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/SMBus.h" + "${CXBXR_ROOT_DIR}/src/devices/SMCDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/SMDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/usb/Hub.h" + "${CXBXR_ROOT_DIR}/src/devices/usb/OHCI.h" + "${CXBXR_ROOT_DIR}/src/devices/usb/UsbCommon.h" + "${CXBXR_ROOT_DIR}/src/devices/usb/USBDevice.h" + "${CXBXR_ROOT_DIR}/src/devices/usb/XidGamepad.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_debug.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_int.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_psh.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_regs.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_shaders.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_shaders_common.h" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_vsh.h" + "${CXBXR_ROOT_DIR}/src/devices/video/qemu-thread.h" + "${CXBXR_ROOT_DIR}/src/devices/video/queue.h" + "${CXBXR_ROOT_DIR}/src/devices/video/swizzle.h" + "${CXBXR_ROOT_DIR}/src/devices/video/vga.h" + "${CXBXR_ROOT_DIR}/src/devices/x86/EmuX86.h" + "${CXBXR_ROOT_DIR}/src/devices/Xbox.h" +) + +# Common (GUI and Emulator) +file (GLOB CXBXR_SOURCE_COMMON + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuDes.cpp" + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuRsa.cpp" + "${CXBXR_ROOT_DIR}/src/common/crypto/EmuSha.cpp" + "${CXBXR_ROOT_DIR}/src/common/crypto/LibRc4.cpp" + "${CXBXR_ROOT_DIR}/src/common/CxbxDebugger.cpp" + "${CXBXR_ROOT_DIR}/src/common/EmuEEPROM.cpp" + "${CXBXR_ROOT_DIR}/src/common/Error.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/DInputKeyboardMouse.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/InputDevice.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/InputManager.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/SdlJoystick.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/XInputPad.cpp" + "${CXBXR_ROOT_DIR}/src/common/Logging.cpp" + "${CXBXR_ROOT_DIR}/src/common/Settings.cpp" + "${CXBXR_ROOT_DIR}/src/common/Timer.cpp" + "${CXBXR_ROOT_DIR}/src/common/util/crc32c.cpp" + "${CXBXR_ROOT_DIR}/src/common/util/CxbxUtil.cpp" + "${CXBXR_ROOT_DIR}/src/common/util/hasher.cpp" + "${CXBXR_ROOT_DIR}/src/common/win32/EmuShared.cpp" + "${CXBXR_ROOT_DIR}/src/common/win32/InlineFunc.cpp" + "${CXBXR_ROOT_DIR}/src/common/win32/IPCWindows.cpp" + "${CXBXR_ROOT_DIR}/src/common/win32/Mutex.cpp" + "${CXBXR_ROOT_DIR}/src/common/win32/Threads.cpp" + "${CXBXR_ROOT_DIR}/src/common/xbdm/CxbxXbdm.cpp" + "${CXBXR_ROOT_DIR}/src/common/xbe/Xbe.cpp" + "${CXBXR_ROOT_DIR}/src/common/xbe/XbePrinter.cpp" + "${CXBXR_ROOT_DIR}/src/common/xdvdfs-tools/buffered_io.cpp" + "${CXBXR_ROOT_DIR}/src/common/xdvdfs-tools/xdvdfs.cpp" + "${CXBXR_ROOT_DIR}/src/CxbxVersion.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DbgConsole.cpp" + "${CXBXR_ROOT_DIR}/src/HighPerformanceGraphicsEnabler.c" +) + +# GUI v1 +file (GLOB CXBXR_SOURCE_GUIv1 + "${CXBXR_ROOT_DIR}/src/common/input/Button.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/EmuDevice.cpp" + "${CXBXR_ROOT_DIR}/src/common/input/InputWindow.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgAbout.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgAudioConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgInputConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgDukeControllerConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgEepromConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgLoggingConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgNetworkConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/DlgVideoConfig.cpp" + "${CXBXR_ROOT_DIR}/src/gui/WinMain.cpp" + "${CXBXR_ROOT_DIR}/src/gui/Wnd.cpp" + "${CXBXR_ROOT_DIR}/src/gui/WndMain.cpp" +) + +# Emulator (module) +# TODO: Merge CXBXR_KRNL_CPP into CXBXR_SOURCE_EMU once cxbx project is removed. +file (GLOB CXBXR_KRNL_CPP + "${CXBXR_ROOT_DIR}/src/core/kernel/init/CxbxKrnl.cpp" +) +file (GLOB CXBXR_SOURCE_EMU + "${CXBXR_KRNL_CPP}" + "${CXBXR_ROOT_DIR}/HighPerformanceGraphicsEnabler.c" + "${CXBXR_ROOT_DIR}/src/common/util/gloffscreen/glextensions.cpp" + "${CXBXR_ROOT_DIR}/src/common/util/gloffscreen/gloffscreen_common.cpp" + "${CXBXR_ROOT_DIR}/src/common/util/gloffscreen/gloffscreen_wgl.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/RenderStates.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/TextureStates.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/VertexShader.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/VertexShaderSource.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/ResourceTracker.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbConvert.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbD3D8Logging.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbPixelShader.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbPushBuffer.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexBuffer.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexShader.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound3DCalculator.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundBuffer.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundStream.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/XFileMediaObject.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/XbDSoundLogging.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/Intercept.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/Patches.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/XACTENG/XactEng.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/XAPI/Xapi.cpp" + "${CXBXR_ROOT_DIR}/src/core/hle/XGRAPHIC/XGraphic.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnl.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlAv.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlDbg.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlEx.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlFs.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlHal.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlIo.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlKd.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlKe.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlKi.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlLogging.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlMm.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlNt.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlOb.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlPhy.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlPs.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlRtl.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlXbox.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlXc.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/EmuKrnlXe.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/exports/KernelThunk.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/PhysicalMemory.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/PoolManager.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/memory-manager/VMManager.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/Emu.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuFile.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuFS.cpp" + "${CXBXR_ROOT_DIR}/src/core/kernel/support/EmuNtDll.cpp" + "${CXBXR_ROOT_DIR}/src/devices/ADM1032Device.cpp" + "${CXBXR_ROOT_DIR}/src/devices/EEPROMDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/EmuNVNet.cpp" + "${CXBXR_ROOT_DIR}/src/devices/MCPXDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/PCIBus.cpp" + "${CXBXR_ROOT_DIR}/src/devices/PCIDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/SMBus.cpp" + "${CXBXR_ROOT_DIR}/src/devices/SMCDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/SMDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/usb/Hub.cpp" + "${CXBXR_ROOT_DIR}/src/devices/usb/OHCI.cpp" + "${CXBXR_ROOT_DIR}/src/devices/usb/USBDevice.cpp" + "${CXBXR_ROOT_DIR}/src/devices/usb/XidGamepad.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_DEBUG.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PBUS.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PCOUNTER.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PCRTC.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PFB.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PFIFO.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PGRAPH.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PMC.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRAMDAC.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRAMIN.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRMA.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRMCIO.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRMDIO.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRMFB.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PRMVIO.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PSTRAPS.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PTIMER.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PTV.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PVIDEO.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_PVPE.cpp" + #"${CXBXR_ROOT_DIR}/src/devices/video/EmuNV2A_USER.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_debug.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_psh.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_shaders.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/nv2a_vsh.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/qemu-thread-win32.cpp" + "${CXBXR_ROOT_DIR}/src/devices/video/swizzle.cpp" + "${CXBXR_ROOT_DIR}/src/devices/x86/EmuX86.cpp" + "${CXBXR_ROOT_DIR}/src/devices/Xbox.cpp" +) + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbx") + +# Issues with compile (the same with develop branch) and +# for some reason did not put the files into virtual folder? +# Might need to put the list in the source folder for workaround fix. +if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") + #add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/debugger") + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src/CxbxDebugger") +endif() + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # Configure startup project + set_property(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY VS_STARTUP_PROJECT cxbx) +endif() + +if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") + # Refuse to exclude due to install is not set to optional + #set_target_properties(cstool + # PROPERTIES EXCLUDE_FROM_ALL TRUE + #) + set_target_properties(Tests_cs_x86 + PROPERTIES EXCLUDE_FROM_ALL TRUE + ) + + # Cxbx-Debugger project with third-party libraries + set_target_properties(cxbxr-debugger cs_x86 Tests_cs_x86 capstone-shared cstool + PROPERTIES FOLDER Cxbx-Reloaded/debugger + ) +endif() + +# Cxbx-Reloaded project with third-party libraries +set_target_properties(cxbx subhook XbSymbolDatabase libtommath libtomcrypt + PROPERTIES FOLDER Cxbx-Reloaded +) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 000000000..1428f3052 --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,28 @@ +{ + "configurations": [ + { + "name": "x86-Release", + "configurationType": "Release", + "inheritEnvironments": [ + "msvc_x86" + ], + "buildRoot": "${workspaceRoot}\\build\\${name}", + "installRoot": "${workspaceRoot}\\bin\\Release", + "cmakeCommandArgs": "", + "buildCommandArgs": "/v:m", + "ctestCommandArgs": "" + }, + { + "name": "x86-Debug", + "configurationType": "Debug", + "inheritEnvironments": [ + "msvc_x86" + ], + "buildRoot": "${workspaceRoot}\\build\\${name}", + "installRoot": "${workspaceRoot}\\bin\\Debug", + "cmakeCommandArgs": "", + "buildCommandArgs": "/v:m", + "ctestCommandArgs": "" + } + ] +} diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 50d577767..43e98770b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,19 +1,65 @@ -Developers: -Luke Usher [SoullessSentinel] -PatrickvL -StrikerX3 -blueshogun96 -donwayo -hrydgard -jagotu -jarupxx -phire -x1nixmzeng -RadWolfie -Luca D'Amico (Luca1991/Luca91) -ergo720 +Contributors +------------ + +Cxbx-Reloaded has a rich history, with lots of contributors in it's various stages of life. +Cxbx-Reloaded was initiated by Luke Usher, as a fork of the then-dormant Cxbx, and inspired by Dxbx. +Cxbx was initiated by Caustik. Dxbx was initiated by shadowtj. + +The following contributors are grouped per project and listed in alphabetical order, +based on sources like https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/graphs/contributors , +http://www.caustik.com/cxbx/about.htm , http://emulation.gametechwiki.com/index.php/Cxbx , +and https://github.com/PatrickvL/Dxbx/graphs/contributors . + + +Cxbx-Reloaded Current Development Team: + +ergo720 +LukeUsher (Luke Usher) [SoullessSentinel] +NZJenkins +PatrickvL (Patrick van Logchem) +RadWolfie + + +Cxbx-Reloaded All-Time Contributors: + +aav7fl (Kyle Niewiada) +anita999 +BenNottelling (Benjamin Aerni) +blueshogun96 +CakeLancelot +darrena092 (Darren Anderson) +DiscoStarslayer (Darren Thompson) +donwayo (Wayo) +Ernegien (Mike Davis) +ergo720 +faha223 (Fred Hallock) +Fisherman166 +gandalfthewhite19890404 +gellis713 +ggKismet +GXTX (wutno) +hrydgard (Henrik Hydgard) +jackchentwkh +jagotu (JaGoTu) +jarupxx +JayFoxRox (Jannik Vogel) +literalmente-game +Luca1991 (Luca D'Amico) [Luca91] +LukeUsher (Luke Usher) [SoullessSentinel] +Margen67 +NZJenkins +PatrickvL (Patrick van Logchem) +phire (Scott Mansell) +RadWolfie +revel8n +StrikerX3 (Ivan Roberto de Oliveira) +TotalCaesar659 +Voxel9 (Voxel) +x1nixmzeng + + +Cxbx-Reloaded Supporters: -Supporters: Cedric Wilson Cisco Martinez Cody Dale Barton @@ -33,5 +79,30 @@ Taylor Stock Yldri Yuri Kunde Schlesner -Special Thanks: + +Cxbx-Reloaded Special Thanks: + All contributors to the original Cxbx and Dxbx projects, without which Cxbx-Reloaded would not exist. + + +Cxbx contributors: + +_SF_ +blueshogun96 +Caustic (Aaron Robinson) +donwayo (Wayo) +dstien (Daniel Stien) +Echelon9 (Rhys Kidd) +Kingofc +Koitsu +martin_sw (Martin) +sopskrutt (Sop Skrutt) +Zomby + + +Dxbx contributors: + +donwayo (Wayo) +PatrickvL (Patrick van Logchem) +revel8n +shadowtj (Shadow_tj) diff --git a/COPYING b/COPYING index b8306825e..960fe7469 100644 --- a/COPYING +++ b/COPYING @@ -278,64 +278,3 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - diff --git a/README.md b/README.md index a406e3485..058912b48 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,105 @@ -# Cxbx-Reloaded - Original Xbox Emulator +# Cxbx-Reloaded - Original Xbox Emulator [![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://img.shields.io/badge/License-GPL%20v2-blue.svg) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/iao43irxl3umbp33?svg=true)](https://ci.appveyor.com/project/SoullessSentinel/cxbx-reloaded) -[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/Cxbx-Reloaded/Lobby) -or [Discord](https://discord.gg/26Xjx23) +[![GitHub Actions](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/workflows/GitHub%20CI/badge.svg)](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/actions?query=workflow%3A%22GitHub+CI%22) +[![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?logo=discord)](https://discord.gg/26Xjx23) Cxbx-Reloaded is an emulator for running Microsoft Xbox (and eventually, Chihiro) games on Microsoft Windows. ## System Requirements ### Minimum - * OS: Windows 7+ x64. 32-bit installations are not supported. - * GPU: Anything that supports Direct3D 8 (HLE) and OpenGL 3.3 (LLE). - * Due to poor driver support for Direct3D8 on modern cards, some users may see better results when using a wrapper, such as [D3D8to9](https://github.com/crosire/d3d8to9/) + * OS: Windows 7+ x64. 32-bit is not supported. + * GPU: Direct3D 9.0c with Pixel Shader Model 2.x, and Vertex Shader Model 3.0. + ### Prerequisites - * Visual C++ 2015 and 2017 redistributables may be required. Download them [here](https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads). - + * [32-bit (x86) Visual C++ 2019 Redistributable](https://aka.ms/vs/16/release/vc_redist.x86.exe) + * [Npcap *(used for network emulation)*](https://nmap.org/npcap/#download) + * Make sure to enable winpcap compatibility mode! + ## Automated Builds -Cxbx-Reloaded is not yet ready for general release, but the latest development builds can be downloaded using the links below: +Cxbx-Reloaded doesn't currently have stable builds, but you can obtain pre-release builds from the Releases tab, or the links below: - - - -### Upcoming Release (Alpha Status) -Grab these builds if you wish to preview/alpha test an upcoming release -* [Latest v0.1 Alpha Build (Release)](https://ci.appveyor.com/api/projects/SoullessSentinel/cxbx-reloaded/artifacts/export/Release.zip?branch=v0.1&job=Configuration:%20Release&pr=false) -* [Latest v0.1 Alpha Build (Debug)](https://ci.appveyor.com/api/projects/SoullessSentinel/cxbx-reloaded/artifacts/export/Debug.zip?branch=v0.1&job=Configuration:%20Debug&pr=false) - -### Development Builds -Grab these builds if you want to test the latest and greatest features. These builds are likely to be more unstable than release builds, and are not recommended for just playing games. -* [Latest Development Build (Release)](https://ci.appveyor.com/api/projects/SoullessSentinel/cxbx-reloaded/artifacts/export/Release.zip?branch=develop&job=Configuration:%20Release&pr=false) -* [Latest Development Build (Debug)](https://ci.appveyor.com/api/projects/SoullessSentinel/cxbx-reloaded/artifacts/export/Debug.zip?branch=develop&job=Configuration:%20Debug&pr=false) - -* [Full build history](https://ci.appveyor.com/project/SoullessSentinel/cxbx-reloaded/history) + * **[Release Builds](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/releases)** + * **WINE users will need to use `CxbxReloaded-Release-VS2017.zip` for it to run correctly.** + * *[Full build history](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/actions?query=workflow%3A%22GitHub+CI%22)* ## Compatibility -Cxbx-Reloaded has a [compatibility list](https://github.com/Cxbx-Reloaded/game-compatibility/issues). +Cxbx-Reloaded has a [compatibility list](https://github.com/Cxbx-Reloaded/game-compatibility#cxbx-reloaded-game-compatibility-project). If you have something to report on a title, please create or update the issue for it there. Please read the [Readme file](https://github.com/Cxbx-Reloaded/game-compatibility/blob/master/README.md) first! ## Bug Reports -Game or software specific issues can be reported in the [compatibility list](https://github.com/Cxbx-Reloaded/game-compatibility/issues). +Game or software specific issues can be reported in the [compatibility list](https://github.com/Cxbx-Reloaded/game-compatibility#cxbx-reloaded-game-compatibility-project). For emulation issues that are not specific to any single piece of software, a bug report can be submitted at [the Cxbx-Reloaded issue tracker](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues). Make sure bug reports contain: -* The build tested with, error message displayed (if any) -* Screenshots -* Xbe dump (created via [Edit > Dump Xbe Info To > File]) -* Kernel Debug log (created when running a game with [View > Debug Output (Kernel) > File] selected). + * The build tested with, error message displayed (if any) + * Screenshots + * Xbe dump (created via `Edit > Dump Xbe Info To > File`) + * Kernel Debug log (created when running a game with `View > Debug Output (Kernel) > File` selected). ## Additional information Cxbx-Reloaded has a [wiki](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/wiki) containing various subjects and background information. -Chat on [Gitter](https://gitter.im/Cxbx-Reloaded/Lobby), or [Discord](https://discord.gg/26Xjx23). + +Chat on [Discord](https://discord.gg/26Xjx23). ## Contributing We welcome contributions, large and small. If you want to do some coding, be sure to read the [Developer notes](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/wiki/Developer-notes). +**IMPORTANT: Pull-Requests containing code derived from XQEMU will _not_ be approved until an agreement is reached to make work mutually beneficial. this includes updates to existing XQEMU derived code. We should not/will not become a hostile fork.** + Please contact us before you start working on something, so we can make sure your work is going to be accepted once finished. -### Prerequisites -1. [Git for Windows](https://git-scm.com/) -2. [Visual Studio 2017](https://www.visualstudio.com/downloads/) (2015 might work, but is not officially supported) -3. Windows 8.1 SDK (Should be included with Visual Studio) -4. [Microsoft Child Process Debugging Power Tool](https://marketplace.visualstudio.com/items?itemName=GreggMiskelly.MicrosoftChildProcessDebuggingPowerTool) +### Main Prerequisites +1. [Git for Windows](https://git-scm.com) +2. [CMake](https://cmake.org) + * Some IDEs already have CMake support, so this is optional. ### Fetching the code -Run the following command on the command line: -`git clone --recurse-submodules https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/` +1. Run the following command in the command line: -Please note the `--recurse-submodules` parameter. This is required to fetch sub-modules. + `git clone --recurse-submodules https://github.com/Cxbx-Reloaded/Cxbx-Reloaded.git` + * Please note the `--recurse-submodules` parameter. This is required to fetch submodules. + * If Cxbx-Reloaded was checked out without submodules, they can be updated/fetched with the following command: -Without this, Cxbx-Reloaded will fail to build. - -If Cxbx-Reloaded was previously checked out without the submodules, they can be updated/fetched with the following command: -`git submodule update --recurse-submodules` + `git submodule update --init --recursive` ### Compiling -Simply open `build/Win32/Cxbx.sln` within Visual Studio, select your configuration (Release or Debug) and hit Build. -Please note that Debug builds are significantly slower, but include much more detailed kernel logging, and may help diagnose a problematic title. +#### Windows +**NOTE:** Don't open `CMakeLists.txt` from Visual Studio, as it won't generate files in the `build` directory. + +##### Prerequisites +1. [Visual Studio](https://visualstudio.microsoft.com/downloads/) 2017 or later + * C++ and C# desktop development + * Windows Universal CRT SDK + * C++ CMake tools for Windows + * *Optional if CMake is installed* + * [Microsoft Child Process Debugging Power Tool](https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool) + +##### Generate Visual Studio files +1. If you don't have CMake installed, open `___ Native Tools Command Prompt for VS 20##`. +2. `cd` to the Cxbx-Reloaded directory. +3. Run these commands. + 1. `mkdir build & cd build` + 2. `cmake .. -G "Visual Studio 16 2019" -A Win32` + * Visual Studio 2019 16.1 or later has CMake 3.14 bundled, and is required for the Visual Studio 2019 generator. + * Use `cmake .. -G "Visual Studio 15 2017" -A Win32` for Visual Studio 2017. +4. Open `Cxbx-Reloaded.sln` from the `build` directory. +5. Select the Release configuration, then click Build. + * Debug builds are **significantly slower, and only for developers**. + +#### Linux / macOS +Currently not supported. ## Support You can support [Luke Usher](https://github.com/LukeUsher), initiator of Cxbx-Reloaded, on [Patreon](https://www.patreon.com/LukeUsher). ## Special Thanks -All contributors to the original Cxbx and Dxbx projects. Without them Cxbx-Reloaded would not exist at all. +* All contributors to the original Cxbx and [Dxbx](https://github.com/PatrickvL/Dxbx) projects. Without them Cxbx-Reloaded would not exist at all. +* [XQEMU](https://github.com/xqemu/xqemu) - While the majority of Cxbx-R is our own work (Kernel, HLE, etc), the NV2A LLE and NVNet implementation are primarily the work of the XQEMU developers. +* [XboxDev](https://github.com/xboxdev) - Providing Xbox hardware research & useful tooling. diff --git a/appveyor-build.bat b/appveyor-build.bat deleted file mode 100644 index aff520930..000000000 --- a/appveyor-build.bat +++ /dev/null @@ -1,42 +0,0 @@ -:: Cxbx-Reloaded build script - -@if "%1"=="" goto show_usage - -@set SLN="%cd%\build\win32\Cxbx.sln" -@set VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat" - -:: Setup build environment -@if not exist %VS_ENV% goto missing_env - -@call %VS_ENV% - -:: Build managed projects (debugger) -@call MSBuild.exe %SLN% /p:Platform="Any CPU" /p:Configuration=%1% /m -@if %errorlevel% neq 0 goto failure - -:: Build native projects (emulator, debugger dlls) -@call MSBuild.exe %SLN% /p:Platform="Win32" /p:Configuration=%1% /m -@if %errorlevel% neq 0 goto failure - -@goto success - -:missing_env -@echo Unable to locate MSBuild environment command -@set ERRORLEVEL=1 -@goto eof - -:show_usage -@echo Usage: %~0% build_config -@set ERRORLEVEL=1 -@goto eof - -:failure -@echo Failed to build at least one configuration, exiting... -@goto eof - -:success -@echo All builds finished successfully -@goto eof - -:eof - diff --git a/appveyor-gather.bat b/appveyor-gather.bat deleted file mode 100644 index 3ad225402..000000000 --- a/appveyor-gather.bat +++ /dev/null @@ -1,36 +0,0 @@ -:: Cxbx-Reloaded gather script - -@if "%1"=="" goto show_usage - -@set ZIP_APP="%cd%\import\7za\7za.exe" -@set BUILD_PATH="%cd%\build\win32\%1\" -@set ARTIFACT_PATH="%cd%\export\%1.zip" - -:: Add generic resources -@call %ZIP_APP% u %ARTIFACT_PATH% COPYING README.md - -:: Check for build resources -@if not exist %BUILD_PATH% goto missing_build -@pushd %BUILD_PATH% - -:: Add Cxbx binaries -@call %ZIP_APP% u %ARTIFACT_PATH% Cxbx.exe glew32.dll subhook.dll d3d8.dll CxbxVSBC.dll - -:: Add debugger binaries -@call %ZIP_APP% u %ARTIFACT_PATH% CxbxDebugger.exe capstone.dll cs_x86.dll - -@popd -@goto eof - -:missing_build -@echo Missing build directory %BUILD_PATH% -@set ERRORLEVEL=1 -@goto eof - -:show_usage -@echo Usage: %~0% build_config -@goto eof - -:eof -@echo Gather complete - diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 14f0326d9..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Documentation is here: https://www.appveyor.com/docs/appveyor-yml/ - -init: - - ps: Update-AppveyorBuild -Version "$env:appveyor_repo_commit" - -image: - # If this is modified, please also update the build script - - Visual Studio 2017 - -configuration: - # The builds will be run in this order - - Release - - Debug - -build_script: - - cmd: appveyor-build.bat %CONFIGURATION% - -after_build: - - cmd: appveyor-gather.bat %CONFIGURATION% - -artifacts: - - path: export/*.zip - -install: - # Git clone happens between init and install - - cmd: git submodule update --init --recursive diff --git a/build/win32/Cxbx.sln b/build/win32/Cxbx.sln deleted file mode 100644 index 76af6839a..000000000 --- a/build/win32/Cxbx.sln +++ /dev/null @@ -1,154 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2026 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcxproj", "{E7A72D3D-5810-4078-A243-348B59726365}" - ProjectSection(ProjectDependencies) = postProject - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF} = {EFA81330-D410-4232-9A0C-1D8B91B6FFFF} - {B8D9AFC2-B38F-4714-846D-8A2754F076C9} = {B8D9AFC2-B38F-4714-846D-8A2754F076C9} - {2171C0E8-4915-49B9-AC23-A484FA08C126} = {2171C0E8-4915-49B9-AC23-A484FA08C126} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subhook", "subhook.vcxproj", "{CD2DDE93-B45E-4D11-876D-D0056C3DD407}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CxbxDebugger", "..\..\src\CxbxDebugger\CxbxDebugger.csproj", "{4A68E962-3805-4376-99D3-0AC59E9BEE69}" - ProjectSection(ProjectDependencies) = postProject - {9131B025-5019-4DEE-84A3-86D2703A81C0} = {9131B025-5019-4DEE-84A3-86D2703A81C0} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs_x86", "..\..\import\cs_x86\cs_x86\cs_x86.csproj", "{9131B025-5019-4DEE-84A3-86D2703A81C0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capstone_dll_2015", "..\..\import\cs_x86\capstone_2015\capstone_dll_2015.vcxproj", "{2171C0E8-4915-49B9-AC23-A484FA08C126}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugger", "Debugger", "{174CB14E-34E3-422F-9A99-DBE88FF0EFBB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XbSymbolDatabase", "..\..\import\XbSymbolDatabase\xbSymbolDatabase.vcxproj", "{B8D9AFC2-B38F-4714-846D-8A2754F076C9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxVSBC", "CxbxVSBC.vcxproj", "{EFA81330-D410-4232-9A0C-1D8B91B6FFFF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_Direct3D9|Any CPU = Debug_Direct3D9|Any CPU - Debug_Direct3D9|Win32 = Debug_Direct3D9|Win32 - Debug_Direct3D9|x64 = Debug_Direct3D9|x64 - Debug|Any CPU = Debug|Any CPU - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E7A72D3D-5810-4078-A243-348B59726365}.Debug_Direct3D9|Any CPU.ActiveCfg = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug_Direct3D9|Win32.ActiveCfg = Debug_Direct3D9|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug_Direct3D9|Win32.Build.0 = Debug_Direct3D9|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug_Direct3D9|x64.ActiveCfg = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug|Win32.ActiveCfg = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug|Win32.Build.0 = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Debug|x64.ActiveCfg = Debug|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Release|Any CPU.ActiveCfg = Release|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Release|Win32.ActiveCfg = Release|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Release|Win32.Build.0 = Release|Win32 - {E7A72D3D-5810-4078-A243-348B59726365}.Release|x64.ActiveCfg = Release|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug_Direct3D9|Any CPU.ActiveCfg = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug_Direct3D9|Win32.Build.0 = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug_Direct3D9|x64.ActiveCfg = Debug|x64 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug_Direct3D9|x64.Build.0 = Debug|x64 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug|Win32.ActiveCfg = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug|Win32.Build.0 = Debug|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug|x64.ActiveCfg = Debug|x64 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Debug|x64.Build.0 = Debug|x64 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Release|Any CPU.ActiveCfg = Release|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Release|Win32.ActiveCfg = Release|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Release|Win32.Build.0 = Release|Win32 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Release|x64.ActiveCfg = Release|x64 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407}.Release|x64.Build.0 = Release|x64 - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug_Direct3D9|Any CPU.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug_Direct3D9|Any CPU.Build.0 = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug_Direct3D9|x64.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug_Direct3D9|x64.Build.0 = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug|Win32.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Debug|x64.Build.0 = Debug|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Release|Any CPU.Build.0 = Release|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Release|Win32.ActiveCfg = Release|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Release|x64.ActiveCfg = Release|Any CPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69}.Release|x64.Build.0 = Release|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug_Direct3D9|Any CPU.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug_Direct3D9|Any CPU.Build.0 = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug_Direct3D9|x64.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug_Direct3D9|x64.Build.0 = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug|Win32.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug|x64.ActiveCfg = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Debug|x64.Build.0 = Debug|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Release|Any CPU.Build.0 = Release|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Release|Win32.ActiveCfg = Release|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Release|x64.ActiveCfg = Release|Any CPU - {9131B025-5019-4DEE-84A3-86D2703A81C0}.Release|x64.Build.0 = Release|Any CPU - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug_Direct3D9|Any CPU.ActiveCfg = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug_Direct3D9|Win32.Build.0 = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug_Direct3D9|x64.ActiveCfg = Release|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug_Direct3D9|x64.Build.0 = Release|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|Win32.ActiveCfg = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|Win32.Build.0 = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|x64.ActiveCfg = Debug|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|Any CPU.ActiveCfg = Release|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|Win32.ActiveCfg = Release|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|Win32.Build.0 = Release|Win32 - {2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|x64.ActiveCfg = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug_Direct3D9|Any CPU.ActiveCfg = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug_Direct3D9|Any CPU.Build.0 = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug_Direct3D9|Win32.Build.0 = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug_Direct3D9|x64.ActiveCfg = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug|Win32.ActiveCfg = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug|Win32.Build.0 = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Debug|x64.ActiveCfg = Debug|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Release|Any CPU.ActiveCfg = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Release|Win32.ActiveCfg = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Release|Win32.Build.0 = Release|Win32 - {B8D9AFC2-B38F-4714-846D-8A2754F076C9}.Release|x64.ActiveCfg = Release|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|Any CPU.ActiveCfg = Release|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|Any CPU.Build.0 = Release|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|Win32.ActiveCfg = Debug|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|Win32.Build.0 = Debug|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|x64.ActiveCfg = Debug|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug_Direct3D9|x64.Build.0 = Debug|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug|Win32.ActiveCfg = Debug|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug|Win32.Build.0 = Debug|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug|x64.ActiveCfg = Debug|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Debug|x64.Build.0 = Debug|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|Any CPU.ActiveCfg = Release|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|Win32.ActiveCfg = Release|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|Win32.Build.0 = Release|Win32 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|x64.ActiveCfg = Release|x64 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4A68E962-3805-4376-99D3-0AC59E9BEE69} = {174CB14E-34E3-422F-9A99-DBE88FF0EFBB} - {9131B025-5019-4DEE-84A3-86D2703A81C0} = {174CB14E-34E3-422F-9A99-DBE88FF0EFBB} - {2171C0E8-4915-49B9-AC23-A484FA08C126} = {174CB14E-34E3-422F-9A99-DBE88FF0EFBB} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B5EC6A8A-FBC4-456F-B41D-F0D1E9719E25} - EndGlobalSection -EndGlobal diff --git a/build/win32/Cxbx.vcxproj b/build/win32/Cxbx.vcxproj deleted file mode 100644 index 322a89925..000000000 --- a/build/win32/Cxbx.vcxproj +++ /dev/null @@ -1,754 +0,0 @@ - - - - - Debug_Direct3D9 - Win32 - - - Debug - Win32 - - - Release - Win32 - - - - Cxbx - {E7A72D3D-5810-4078-A243-348B59726365} - 8.1 - - - - Application - false - MultiByte - $(DefaultPlatformToolset) - - - Application - false - MultiByte - $(DefaultPlatformToolset) - - - Application - false - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - false - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - - - ..\..\import\DirectX8\include;$(IncludePath) - ..\..\import\DirectX9\include;$(IncludePath) - ..\..\import\DirectX8\lib;$(LibraryPath) - $(LibraryPath) - ..\..\import\DirectX8\include;$(IncludePath) - ..\..\import\DirectX8\lib;$(LibraryPath) - - - Build - - $(Configuration)\$(ProjectName)\ - - - Build - - $(Configuration)\$(ProjectName)\ - - - Build - - $(Configuration)\$(ProjectName)\ - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\bin\debug/Cxbx.tlb - - - - - Disabled - ..\..\src\Common;..\..\src;..\..\src\Common\Win32;%(AdditionalIncludeDirectories);..\..\import\OpenXDK\include;..\..\import\distorm\include;..\..\import\glew-2.0.0\include;..\..\import\subhook\ - NOMINMAX;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - false - Level3 - true - ProgramDatabase - true - StreamingSIMDExtensions2 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - Include\Win32\Cxbx;%(AdditionalIncludeDirectories) - - - legacy_stdio_definitions.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr8.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies) - true - $(Configuration)\;..\..\import\distorm\lib\Win32\;..\..\import\glew-2.0.0\lib\Release\Win32\;%(AdditionalLibraryDirectories) - libcmt;%(IgnoreSpecificDefaultLibraries) - true - true - Windows - false - - - MachineX86 - false - 0x10000 - true - true - - - true - - - copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) - - - - - - - CALL "$(SolutionDir)Version.bat" "$(SolutionDir)..\..\src\Version.h" - Generate version header - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\bin\debug/Cxbx.tlb - - - - - Disabled - ..\..\src\Common;..\..\src;..\..\src\Common\Win32;%(AdditionalIncludeDirectories);..\..\import\OpenXDK\include;..\..\import\distorm\include;..\..\import\glew-2.0.0\include;..\..\import\subhook\ - CXBX_USE_D3D9;NOMINMAX;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - false - Level3 - true - ProgramDatabase - true - StreamingSIMDExtensions2 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - Include\Win32\Cxbx;%(AdditionalIncludeDirectories) - - - legacy_stdio_definitions.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr8.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies) - true - $(Configuration)\;..\..\import\distorm\lib\Win32\;..\..\import\glew-2.0.0\lib\Release\Win32\;%(AdditionalLibraryDirectories) - libcmt;%(IgnoreSpecificDefaultLibraries) - true - true - Windows - false - - - MachineX86 - false - 0x10000 - true - true - - - true - - - copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) - - - - - - - CALL "$(SolutionDir)Version.bat" "$(SolutionDir)..\..\src\Version.h" - Generate version header - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\bin\release/Cxbx.tlb - - - - - MaxSpeed - AnySuitable - ..\..\src;..\..\src\Common;..\..\src\Common\Win32\;%(AdditionalIncludeDirectories);..\..\import\OpenXDK\include;..\..\import\distorm\include;..\..\import\glew-2.0.0\include;..\..\src\Common\Win32;..\..\import\subhook\ - NOMINMAX;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - false - Level3 - true - ProgramDatabase - true - StreamingSIMDExtensions2 - SyncCThrow - false - false - true - Speed - Precise - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - Include\Win32\Cxbx;%(AdditionalIncludeDirectories) - - - legacy_stdio_definitions.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;dxerr8.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;dbghelp.lib;comctl32.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies) - true - $(Configuration)\;..\..\import\distorm\lib\Win32\;..\..\import\glew-2.0.0\lib\Release\Win32\;%(AdditionalLibraryDirectories) - libcmt;%(IgnoreSpecificDefaultLibraries) - Windows - false - - - MachineX86 - false - 0x10000 - true - true - 65536 - 65536 - UseLinkTimeCodeGeneration - - - true - - - copy $(SolutionDir)..\..\import\glew-2.0.0\bin\Release\Win32\glew32.dll $(TargetDir) - - - - - - - CALL "$(SolutionDir)Version.bat" "$(SolutionDir)..\..\src\Version.h" - Generate version header - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - \cxbx\git\cxbx-ds\resource;%(AdditionalIncludeDirectories) - \cxbx\git\cxbx-ds\resource;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \cxbx\git\cxbx-ds\resource;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - false - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - {cd2dde93-b45e-4d11-876d-d0056c3dd407} - - - - - - - - - - \ No newline at end of file diff --git a/build/win32/Cxbx.vcxproj.filters b/build/win32/Cxbx.vcxproj.filters deleted file mode 100644 index 7c335b606..000000000 --- a/build/win32/Cxbx.vcxproj.filters +++ /dev/null @@ -1,712 +0,0 @@ - - - - - GUI - - - GUI - - - GUI - - - GUI - - - GUI - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Kernel - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Kernel - - - Emulator - - - Emulator - - - Emulator - - - Shared - - - Shared - - - Shared - - - GUI - - - Emulator - - - GUI - - - Shared - - - Emulator - - - Emulator - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Shared - - - Hardware - - - Shared - - - Shared - - - Hardware - - - Shared - - - Kernel - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - - Hardware - - - Hardware\Video\gloffscreen - - - Hardware\Video\gloffscreen - - - Hardware\Video\gloffscreen - - - Hardware\Video - - - Hardware\Video - - - Hardware\X86 - - - Emulator - - - GUI - - - Emulator - - - GUI - - - Emulator - - - Kernel - - - Cross Platform\Win32 - - - - - GUI - - - GUI - - - GUI - - - GUI - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - EmuD3D8 - - - Kernel - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Emulator - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - Shared - - - GUI - - - Emulator - - - Shared - - - Emulator - - - GUI - - - Shared - - - Emulator - - - Emulator - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Hardware - - - Shared - - - Shared - - - Shared - - - Hardware - - - Shared - - - Kernel - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Kernel - - - Kernel - - - Hardware\Video\gloffscreen - - - Hardware\Video\gloffscreen - - - Hardware\Video - - - Hardware - - - Hardware\X86 - - - Emulator - - - GUI - - - Emulator - - - GUI - - - Emulator - - - - - - GUI - - - Shared - - - - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Hardware\Video - - - Code Format\src - - - Code Format\resource - - - - - {445ff8dc-8414-41ad-8681-01243121d574} - - - {4ee1fc9a-ee21-4764-b96f-1caf41881bab} - - - {0187aa1f-d227-4dd5-b9ae-a336795923c7} - - - {a5334d93-a02d-41f6-8c3b-fa6e8e3c3be0} - - - {d8ef7ef5-cbb9-4dba-9cab-585519a9756b} - - - {922ab09b-aa8e-41bb-b781-58654160ee3d} - - - {deba5d3e-9a1a-4099-bc91-12737a48272e} - - - {5532aa9d-9e81-4f24-afb1-27e3ce626b6d} - - - {9efb9cfc-2731-4edb-8dd0-36950b0263df} - - - {0e125cbe-fb2e-41ef-a381-6effd9fabd35} - - - {26a58e10-09ca-4605-86f8-552e5a9aa2e3} - - - {6bbc2463-25dc-4f07-bf9e-38d6216d036a} - - - {a097bca1-9b9f-4f35-8e77-fdd0a01b2d8e} - - - {c242189e-0079-4c32-b561-2871cb561688} - - - {3d3739b8-aeee-4bf1-ac1b-8623e7288dda} - - - - - Shared - - - - - - - \ No newline at end of file diff --git a/build/win32/CxbxVSBC.def b/build/win32/CxbxVSBC.def deleted file mode 100644 index 84e5b85e4..000000000 --- a/build/win32/CxbxVSBC.def +++ /dev/null @@ -1,12 +0,0 @@ -LIBRARY CxbxVSBC -DESCRIPTION 'CxbxVSBC DLL module definition - -EXPORTS -VSBCGetState -VSBCSetState -VSBCOpen -VSBCShow -VSBCHide - - - diff --git a/build/win32/CxbxVSBC.vcxproj b/build/win32/CxbxVSBC.vcxproj deleted file mode 100644 index 83ed0da12..000000000 --- a/build/win32/CxbxVSBC.vcxproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {EFA81330-D410-4232-9A0C-1D8B91B6FFFF} - Win32Proj - CxbxVSBC - 8.1 - - - - DynamicLibrary - true - $(DefaultPlatformToolset) - MultiByte - - - DynamicLibrary - false - $(DefaultPlatformToolset) - true - MultiByte - - - DynamicLibrary - true - $(DefaultPlatformToolset) - Unicode - - - DynamicLibrary - false - $(DefaultPlatformToolset) - true - Unicode - - - - - - - - - - - - - - - - - - - - - false - - - true - - - true - - - false - - - - Level3 - Full - true - true - true - WIN32;NDEBUG;CXBXVSBC_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - CxbxVSBC.def - - - - - Level3 - Disabled - true - WIN32;_DEBUG;CXBXVSBC_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - Windows - true - CxbxVSBC.def - - - - - Use - Level3 - Disabled - true - _DEBUG;CXBXVSBC_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - Windows - true - Source.def - - - - - Use - Level3 - MaxSpeed - true - true - true - NDEBUG;CXBXVSBC_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - Source.def - - - - - - - - - - - - - - - - - - - - - diff --git a/build/win32/CxbxVSBC.vcxproj.filters b/build/win32/CxbxVSBC.vcxproj.filters deleted file mode 100644 index 1a6d0e7f2..000000000 --- a/build/win32/CxbxVSBC.vcxproj.filters +++ /dev/null @@ -1,50 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/build/win32/Version.bat b/build/win32/Version.bat deleted file mode 100644 index 0b8c9aa87..000000000 --- a/build/win32/Version.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off - -git describe --always --tags --first-parent > GIT_VERSION -@if not exist %~1 ( -@goto update -) - -@if exist LAST_GIT_VERSION ( -fc GIT_VERSION LAST_GIT_VERSION > nul -@if errorlevel 1 goto update -@del GIT_VERSION -@goto eof -) - -:update -@for /f "delims=" %%x in (GIT_VERSION) do set GIT_VERSION=%%x -@echo #define _GIT_VERSION "%GIT_VERSION%" > "%~1" -echo Updated %~1 with latest git revision number -@move /Y GIT_VERSION LAST_GIT_VERSION > nul - -:eof diff --git a/build/win32/subhook.vcxproj b/build/win32/subhook.vcxproj deleted file mode 100644 index d6b4a29b8..000000000 --- a/build/win32/subhook.vcxproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {CD2DDE93-B45E-4D11-876D-D0056C3DD407} - subhook - 8.1 - - - - DynamicLibrary - true - $(DefaultPlatformToolset) - MultiByte - - - DynamicLibrary - false - $(DefaultPlatformToolset) - true - MultiByte - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - $(Configuration)\$(ProjectName) - - - $(Configuration)\$(ProjectName) - - - - Level3 - MaxSpeed - true - true - true - _WINDLL;SUBHOOK_IMPLEMENTATION;%(PreprocessorDefinitions) - - - true - true - - - - - Level3 - Disabled - true - _WINDLL;SUBHOOK_IMPLEMENTATION;%(PreprocessorDefinitions) - - - - - Level3 - Disabled - true - - - - - Level3 - MaxSpeed - true - true - true - - - true - true - - - - - - true - true - - - true - true - - - - - - - - - - \ No newline at end of file diff --git a/build/win32/subhook.vcxproj.filters b/build/win32/subhook.vcxproj.filters deleted file mode 100644 index e8cddc5fd..000000000 --- a/build/win32/subhook.vcxproj.filters +++ /dev/null @@ -1,36 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/gen-msvc-project.bat b/gen-msvc-project.bat new file mode 100644 index 000000000..b55a38f4b --- /dev/null +++ b/gen-msvc-project.bat @@ -0,0 +1,110 @@ +@ECHO off + +:: LICENSE: Public Domain +:: MADE BY: RadWolfie (2019) + +SETLOCAL + +:: Check if arg is none/help +IF "%1"=="" ( +SET x86=1 +SET cpu_arch=1 +) +IF /I "%1"=="-h" ( +GOTO :helpInfo +) +IF /I "%1"=="-help" ( +GOTO :helpInfo +) + +:: Check first arg (CPU cpu_architecture) +IF /I "%1"=="all" ( +SET x86=1 +SET x64=1 +SET ARM=1 +SET ARM64=1 +SET cpu_arch=1 +ECHO Generating all available projects... +) +IF /I "%1"=="x86" ( +SET x86=1 +SET cpu_arch=1 +) +IF /I "%1"=="x64" ( +SET x64=1 +SET cpu_arch=1 +) +IF /I "%1"=="ARM" ( +SET ARM=1 +SET cpu_arch=1 +) +IF /I "%1"=="ARM64" ( +SET ARM64=1 +SET cpu_arch=1 +) +IF NOT DEFINED cpu_arch ( +GOTO :helpInfo +) + +:: Check second arg (Visual Studio version) +IF "%2"=="2019" ( +SET msvc_compiler=Visual Studio 16 2019 +) +IF "%2"=="2017" ( +SET msvc_compiler=Visual Studio 15 2017 +) +IF "%2"=="" ( +SET msvc_compiler=Visual Studio 15 2017 +) +IF NOT DEFINED msvc_compiler ( +GOTO :helpInfo +) + +IF DEFINED x86 ( +ECHO Generating x86 project... +mkdir build-x86 & pushd build-x86 +cmake .. -G "%msvc_compiler%" -A Win32 +popd +) + +IF DEFINED x64 ( +ECHO Generating x64 project... +mkdir build-x64 & pushd build-x64 +cmake .. -G "%msvc_compiler%" -A x64 +popd +) + +IF DEFINED ARM ( +ECHO Generating ARM project... +mkdir build-arm & pushd build-arm +cmake .. -G "%msvc_compiler%" -A ARM +popd +) + +IF DEFINED ARM64 ( +ECHO Generating ARM64 project... +mkdir build-arm64 & pushd build-arm64 +cmake .. -G "%msvc_compiler%" -A ARM64 +popd +) + +GOTO :end + +:helpInfo +ECHO Available options are: +ECHO arg1 +ECHO - all +ECHO - x86 +ECHO - x64 +ECHO - ARM +ECHO - ARM64 +ECHO --- +ECHO arg2 +ECHO - 2017 +ECHO - 2019 +PAUSE +GOTO :end + +:end +:: Clear local variables. +ENDLOCAL diff --git a/import/7za/7za.exe b/import/7za/7za.exe deleted file mode 100644 index 8a5459808..000000000 Binary files a/import/7za/7za.exe and /dev/null differ diff --git a/import/DirectX8/DXReadme.txt b/import/DirectX8/DXReadme.txt deleted file mode 100644 index 9625ca232..000000000 --- a/import/DirectX8/DXReadme.txt +++ /dev/null @@ -1,1036 +0,0 @@ -Microsoft(R) DirectX (R) 8.1 SDK - Final Release - -This is the Final Release of Microsoft's DirectX 8.1 Software Development -Kit (SDK). It contains all DirectX software required to create -DirectX 8.1 compliant applications. Following the Final Release, -parts of this SDK will also be made available for download at the -Microsoft DirectX developer webpage . - -Major components include: DirectX 8.1 system components (runtimes); -DirectX 8.1 Application Programming Interface (API) Documentation -for each of the DirectX core areas (written for C++ or Visual Basic -developers); DirectX 8.1 headers & libraries; Sample applications -and source code; miscellaneous tools and utilities. - -After installing, those new to DirectX should start with the -DirectX 8.1 documentation. More seasoned developers may also -want to view the "WHAT'S NEW" section. Professional DirectX -developers should refer to the "KNOWN ISSUES" section prior to -raising concerns - - -__________________________________________________________________ - - - -Contents: - -- INSTALLATION -- WHAT'S NEW -- CD LAYOUT -- DIRECTX 8.1 SDK RELEASE NOTES AND KNOWN ISSUES -- COMPILER SUPPORT - - -__________________________________________________________________ - - - -INSTALLATION: - -- ALWAYS UNINSTALL PREVIOUS RELEASES of the DirectX SDK prior to - installing DirectX 8.1 SDK Release (see UNINSTALL). Installing - on top of a previous installation will cause you problems. - -- In addition, you should uninstall any DirectX SDK installations - that may be part of a Microsoft Platform SDK installation prior - to installing the DirectX 8.1 SDK. - -- DirectX 8.1 SDK does not support pre-release versions of Windows XP, - Windows 95, Windows NT, or NEC PC98 systems. Installations on - these systems have been blocked. - -- On Windows 2000 or Windows XP, You must be logged on as an - administrator before installing the DirectX 8.1 SDK, installing - the runtime, using any of SDK tools, or running any of the SDK samples. - -- Running the DirectX 8.1 SDK install on Windows XP and later checked - builds may result in assertions from inside the install package. - We have found no cases where continuing on past the assert dialog - boxes results in improper installation of the DirectX 8.1 SDK, so - it is safe to continue past these asserts. - -- An Internal error can occur after the NTFS permissions for the - Administrators group or the System account have been removed from - the %SystemRoot%\Installer folder. To resolve this issue, reset - the NTFS permissions for the %SystemRoot%\Installer folder so - that it includes both the Administrators group and the System - account. Search the Microsoft knowledge base article for more - information. - -- Please be alerted to the fact that using the "subst" command can - result in path names that are too long for the installer to operate - correctly. Please do not use this command for determining target drives - of the DirectX SDK installer prior to invoking the installer. This is - also liable to cause the SDK uninstaller to fail. - -- The DirectX 8.1 runtime installer should not be run in Compatibility Mode. - -- The DirectX 8.1 runtime requires a Pentium compatible CPU for operation. - Setup will not install on processors that do not report Pentium - compatibility. Some older Cyrix processors, while compatible with - the Pentium instruction set, report as x486 processors, and thus do not - support installation of the DirectX 8.1 runtime. - -- When installing the DirectX 8.1 developer runtime from the DirectX 8.1 SDK - you will notice that the size requirements are calculated incorrectly. - Please allow an extra 80 MB free above the calculated disk space when installing - the developer runtimes. The extra free space is required for uncompression - and installation of the developer runtimes. Only 40 MB is actually - needed once the developer runtime installation is complete. The DirectX - Setup API will check for and display error messages when these requirements - are not met. - - -UNINSTALL: - -To uninstall, use "Add/Remove Programs" from the Control Panel to -uninstall the InstallShield installations. - - - -__________________________________________________________________ - - - -WHAT'S NEW: - -DirectX 8.1 shipped as an integral part of Windows XP and is available -for all versions of Windows 98, Windows ME and Windows 2000. Developers -choosing to support Windows 95 should continue to use DirectX 8.0a. - -DirectX 8.1 includes all of the previous DirectX 8.0 functionality as -well as new DirectX graphics features and new DirectShow features specific to -Windows XP. - -DirectX 8.1 graphics supports the following new features: - - - new pixel shader models 1.2, 1.3, and 1.4 - - new high precision texture formats - - new nPatch quadratic interpolation order - - new dynamic texture support - - new D3DX methods - - updated DirectX graphics documentation - -There have been considerable improvements made to the DirectShow content -for the DirectX 8.1 SDK. These improvements include updating existing samples, -adding many new samples (including Windows XP samples), providing modified -source code for the sampleGrabber, and improving documentation. See the -DirectShow section below for more specific information. - -The SDK contains several new tools, they include: - - screensaver framework - - AppWizard support - - DX error lookup tool, - - MView mesh viewer - - DP8sim network simulator - -This DirectX 8.1 version of DirectMusic Producer sports a number of new features to streamline the authoring process for composers and sound designers. Some of these features include low enough software synthesizer latency to input musical performances from a keyboard in real time (WDM driver required), easier wave capture, and improved DLS/wave editing features like one-click stereo wave insert, insert silence and a resample wave option. Segment Designer features include multiple wave insert as segments, the ability to edit segment length based on clocktime, and ability to start and stop segments while editing DMO effects. Other improvements include many bug fixes, an improved look to segment strips and customizable wallpaper. Documentation has been thoroughly revamped and a new tutorial with a sample game is also available. - - -__________________________________________________________________ - - - -CD LAYOUT: - - -The following is a brief description of the directories found with a complete -DirectX 8.1 SDK download. Depending on options specified during -installation, some of these directories can be installed on your hard drive. - -\Bin - \DXUtils - High level DirectX applications & tools. - All can be accessed from the Start menu if "Utilities" are installed. - - Note: Japanese systems will require Internet Explorer 5.0 (IE5) for - the DirectX Control Panel to display properly. IE5 can be found at - http://www.microsoft.com/windows/ie/default.htm. - - \AppWizard - - This is the DirectX 8.1 application Wizard that can be plugged - into Microsoft Visual C++ 6.0. The AppWizard creates a minimal C++ - template application that optionally integrates Direct3D, - DirectInput, DirectMusic, DirectSound, and DirectPlay to work - together in conjunction. It creates basic-- yet easy to build - upon-- functionality, demonstrating the use of each of these - components right from the start. - - To install: - 1. Go to \Bin\DXutils\AppWizard\ directory. - 2. copy DxAppWiz.awx to C:\Program Files\Microsoft - Visual Studio\Common\MSDev98\Template - To use: - 1. run VC6 - 2. Click "New", under the "New Projects" tab, click the "DirectX - AppWizard" wizard. - 3. Type a project name and click OK. - 4. Choose wizard options, and click finish when done. - 5. Build and run the new project. - -\Doc - Contains reference documentation for the DirectX 8.1 APIs. - This Documentation must be viewed with Windows HTMLHelp. - - Note: The HTMLHelp viewer requires a minimum installation of - Internet Explorer 5.0 (IE5). IE5 can be found at - http://www.microsoft.com/windows/ie/default.htm. - -\Essentls - \DMusProd (DirectMusic Producer) - - DirectMusic Producer is the authoring tool for DirectMusic. It - allows composers and sound designers to use the interactive and - variable resources of DirectMusic along with the consistent sound - performance of DLS. DirectX Audio Scripting can also be authored - and tested within Producer. The DirectMusic Producer setup program - and all files are located here. - -\Extras - \Direct3D - - Skinning exporter tools - \DirectShow - - Contains the DVDBoilerplate. See readme.txt within the directory - for more information. - - Contains additional media that can be used with DirectShow and the - DirectShow Editing Services (DES) interfaces. - \Documentation - - Contains DirectX 7 HTMLHelp Documentation for English and Japanese. - - Also contains DirectX 7 Documentation in Microsoft Word format - (English only). - - Contains DirectX 8 HTMLHelp Documentation for Japanese. - \Symbols - - Contains directories of DirectX 8.1 symbol files for - Win9x, Win2000 and WinXP (retail and debug for each). -\Include - contains DirectX 8.1 include files for DirectX core components. - -\Lib - contains DirectX 8.1 library files for DirectX core components. - -\License - Text versions of the DirectX SDK and End User License Agreements and - the Redistributable License Agreement. - -\Redist - Redistributable versions of the DirectX 8.1 Runtime. - -\Samples - Contains all sample code and sample binaries. Most samples can be - accessed from the Start menu when installed via the downloaded - InstallShield setup. - -\SDKDev - This directory contains the runtime installs that are installed with - the SDK. They are English only and contain both debug and retail - DirectX 8.1 system components that can be "switched" between retail - and debug without re-installing. For the DirectX 8.1 components, - retail or debug can be switched via the DirectX Control Panel. - - The \retail folder contains the setup that will install non-DirectX 8.1 - retail components while the \debug folder will install all debug - components. Both install DX8.1 retail and debug components; These are - the only components that can be "switched". The \window XP folder - contains the Windows XP version of these files. - -\Suppport - This folder contains support tools required for the SDK installation. - It can be deleted following installation. - -\System32 - This folder contains support tools required for the SDK installation. - It can be deleted following installation. - - -__________________________________________________________________ - - - -========================================= -DIRECTX 8.1 SDK NOTES -========================================= -New features: - -Direct3D SDK graphics support includes - -Added new Direct3D samples, - (cull, lighting, volume fog, self-shadowing bumpmapping ) - - -enhanced usage of D3DX in the samples, - - -continued improvement of the D3Dx documentations, - - -the SDK now contains a graphics screensaver framework - - -MView mesh utility, useful for previewing meshes, normals, etc. - -- The SDK screensaver framework is modeled after the graphics sample framework. The - screeensaver sample framework provides multi-monitor support; something the standard - graphics sample framework does not. There is one simple screensaver sample - provided, "Moire", that uses the screensaver framework. The DirectPlay Maze Client - also uses this screensaver framework, but is not intended as a screensaver framework - sample. You can find the screensaver framework with the common sample classes - (d3dsaver.cpp & d3dsaver.h), the Moire screensaver sample with the Direct3D samples - and the Maze Client with the DirectPlay samples. - -- DirectX AppWizard for Visual C++ v6.0. A DirectX AppWizard is included in the - DirectX 8.1 release. See "What's New" or "CD Layout"-"Extras"-"AppWizard" - for more information - -- DirectX error lookup tool providing error lookup for Directx 8.x interfaces only. There is - also an error lookup function you may use in your application. - -Issues: - - -- Be sure to set the paths to the DirectX 8.1 lib and headers within Visual - Studio. They must be listed first. Otherwise you may experience compiler - errors. - -- You must regserve the VB OCX before running the VB samples if you install the - DirectX 8.1 SDK before Visual Studio. The easiest way is to open visual Studio, - which registers the ocx for you. - -- The DirectDraw "Debug Level" slider in DirectX Control Panel Applet does - not function. Instead use the "Debug Output Level" slider on the Direct3D - tab, this will effect both DDraw and D3D8. Also note that DirectDraw labels - it's debug spew as coming from "Direct3D8". - -- Netmeeting and WindowsWP remoting disables graphic hardware acceleration. - - -========================================= -Documentation -========================================= -Issues: - -- The links to the DirectX 8.1 documentation files from the start menu do not - work on Windows 98 SE. On all supported versions of Windows proper icons - are not displayed for the start mention documentation links. - -- For proper viewing of the DirectX Documentation, install the docs from - the DirectX 8.1 SDK CD. Specify a full installation, or if you chose a - Custom install, ensure that you've selected Documentation. - -- The known issues with the DirectX 8.1 Documentation are written up in a - separate file. You will find these issues listed in the - DirectX8_Doc_Readme.txt file found in the \dxf\dxsdk\doc\DirectX8 - folder. This file is also installed into the \doc\DirectX8 - when Documentation is installed. - -- See \dxf\dxsdk\extras\documentation for other related - documentation from previous versions of DirectX. The Japanese version of - DirectX 8.0 help files have been added. - - -========================================= -DirectX for Visual Basic Samples: -========================================= -Issues: - -- DBMON.exe is a console application which allows the Visual Basic DirectX - developer to take advantage of extended output that debug installs of - DirectX provide. This application works only under Windows 2000. - To use, execute the application. All debug output will be captured and sent - to the console window. If you are not seeing debug output, ensure that - you have installed the debug version of DirectX, that you are logged on to an - account with admin priviledges, and that you are running Windows 2000. - -- If you are experiencing problems searching for and connecting to sessions - using DirectPlay for VisualBasic, you may need to update your system. - To update, install DCOM98 from: - http://download.microsoft.com/msdownload/dcom/98/x86/en/dcom98.exe - - -========================================= -DirectX Audio (DirectSound & DirectMusic) -========================================= -Issues: - -- ParamEQ and Distortion effects have parameters that are sampling rate - dependent. - Setting these params to a value that is out of range for that sampling - rate will result in: - Distortion: Parameters are 'clipped' at the valid range for the - sampling rate - ParamEQ: If the frequency is greater than can be supported by the - sampling rate, the effect is disabled- In the DirectMusic - 3DAudio sample, there may be some breakup if Doppler is set > 4 -- DirectSound buffers that are created with DSBCAPS_CTRLFX must be at - least 100ms in length. - - -========================================= -Direct3D -========================================= -New features: - -- new pixel shader models 1.2, 1.3, and 1.4 -- new high precision texture formats -- new nPatch quadratic interpolation order -- new dynamic texture support -- new D3DX methods - -New for DirectX 8.1 are pixel shader versions 1.2, 1.3, and 1.4. Information -on the new instructions is integrated into the pixel shader reference. - -Dynamic textures are a new Microsoft DirectX 8.1 feature. To find out if -the driver supports dynamic textures, check the D3DCAPS2_DYNAMICTEXTURES -flag of the D3DCAPS8 structure. See SDK Documentation section -"Using Dynamic Textures". - -Higher precision texture formats. - -New npatch quadratic interpolation order. - -In D3DX there have been a number of updates. See the D3DX section below. - -New exporter support, in the extras folder. Includes 3DSmax4 and Maya4 support. - -General Issues include: - -- Alt-enter in the samples results in texture corruption for some drivers. - Workaround: Get newer drivers. -- The value for MaxPrimitiveCount defines the max number of vertices - as well as the max number of primitives that can be sent to a - DrawIndexedPrimitive or DrawPrimitive call. -- A bug in the Windows2000 kernel causes an issue upon mode-switches for - AGP surfaces locked with the NOSYSLOCK flag. The contents of any such - surface may become inaccessible for the duration of the NOSYSLOCK lock - if a mode-switch happens after the Lock and before the Unlock. This happens - for both DX7 and DX8 applications. The most likely scenario is a DX8 - application running on a driver that supports hardware vertex buffers, - but using software vertex processing (fixed or shader). Under these - scenarios, Direct3D might keep a NOSYSLOCK lock on an AGP vertex buffer. - If the user alt-tabs out of the application or does anything else to cause - a mode-change, the thread writing into the vertex buffer may fault. There - is no known workaround. -- When using the function ValidateDevice on Win9x the return value will be - DD_OK if it is successful. - -Point Sprite issues: - -- When using the Direct3D software T&L pipeline (device created with - D3DCREATE_SOFTWARE_VERTEXPROCESSING flag set or with - D3DCREATE_MIXED_VERTEXPROCESSING flag and software vertex processing - toggled on), then point sprite support is guaranteed. When using - hardware vertex processing, some older drivers may not support point - sprites, indicated by d3dcaps->MaxPointSize = 0. Upgrading to a DX8 - driver for these parts will enable them. - - To ensure consistent behavior for point sprite support, set - D3DRS_CULLMODE = D3DCULL_NONE - D3DRS_FILLMODE = D3DFILL_SOLID - when rendering point sprites. - -Vertex Shader issues: - -- Two vertex shader instructions may produce implementation-specific - results for out-of-range inputs, such as the log of a negative number. - The log, logp and y- component of the lit instruction macro should not - be passed negative values for this reason. - -Driver/Device Specific Issues: - -- The Windows Millennium driver for the ATI Rage 128 fails (draws nothing) - when using vertex shaders which output more than two texture coordinates - per texture coordinate set when the D3DTTFF_PROJECTED bit is not set. - - -Direct3D Sample issues: - - -- There are miscellaneous issues with some display hardware & drivers. - Please let us know of any problems you encounter and specify whether you - believe it is sample or driver related. - - -========================================= -D3DX -========================================= -New features: - --D3DX math function CPU-specific optimizations, --new methods on PMesh, --loading volumes and cube textures from resources, --new functions, including - -D3DXMatrixMultiplyTranspose(), - -D3DXQuaternionSquadSetup(), - -D3DXSplitMesh(), - -D3DXIntersectTri(), - -D3DXComputeNormalMap(). - -Issues: - -- This product includes software developed by the University of California, - Berkeley and its contributors D3DX Mesh APIs. - -- SetLOD and/or UpdateTextures (when updating between dissimilar miplevels) - will produce an AV with mipvolumes in Refrast and potentially some drivers. - -- If you create vertex shaders with constants in the declarator, please verify - that every vertex shader that has the shader constants in the declaration is - created with the correct usage flag. Always use: - D3DUSAGE_SOFTWAREPROCESSING for software vertex processing, - 0 for hardware vertex processing. - - Failure to do so may result in your vertex shaders not validating on the - DirectX 8.1 runtime. This behavior will only be different from DirectX 8.0 - on devices which are created with D3DCREATE_SOFTWARE_VERTEXPROCESSING flag. - -========================================= -DirectInput -========================================= -New features: - --Action Mapper sample - a single player version of multimapper. - -Issues: - -- There are some know issues that can cause mouse behavior to be very sluggish - when debugging using DirectInput on Windows 2000 (Windows XP does not - exhibit this behavior at all). The DirectX control panel has options to - select input device emulation for mouse and keyboard which makes the devices - perform properly inside the debugger. - These settings are global so effect all DirectInput clients. They only - improve performance when using the debug binaries, and only for applications - that employ foreground exclusive device access. Some features, such as - masking the Windows keys, are not available when devices are emulated so - emulation is only recommended for debugging. - -- On Windows 98, 98 Second Edition and Millennium Edition, the Gravis GrIP gamepad may not report data after a reboot. - To fix this you need to run the Game Controller tool from the Control Panel and click Refresh. - - If the Game Controllers tool is missing from Control Panel, you need to restore a backup copy of the Joy.cpl file. To do this: - - 1. Close the Control Panel, if it is open. - 2. Click Start, point to Find, and then click Files Or Folders. - 3. In the Named box, type joy.bak. - 4. In the Look In box, click My Computer, and then click Find Now. - 5. In the list of found files, right-click Joy.bak, and then click Rename. - 6. Type joy.cpl, and then press ENTER. - 7. Close the Find: Files Named Joy.bak window. - 8. Open the Control Panel - -- The following devices are supported with device images in this release. - + ACT LABS RS - + ACT LABS Force RS - + Gravis Xterminator Dual Control - + Gravis Gamepad Pro - + Gravis Eliminator Gamepad Pro - + Gravis Xterminator Digital GamePad - + Guillemot Dual Analog Gamepad - + Guillemot Digital Gamepad - + InterAct/3dfx SV-262A HammerHead Fx - + InterAct Axispad - + InterAct SV-251 Raider Digital - + Logitech WingMan Formula (Yellow) - + Logitech WingMan Extreme Digital 3D - + Logitech WingMan Gamepad Black (USB) - + Logitech Wingman Rally Force USB - + Logitech Wingman Rumblepad - + Microsoft Sidewinder Gamepad Pro - + Microsoft SideWinder Force Feedback Wheel - + Microsoft SideWinder Force Feedback Pro - + Microsoft Sidewinder FF 2 - + Microsoft Sidewinder Dual Strike - + Microsoft Sidewinder Precision 2 - + Microsoft Sidewinder Plug and Play - + Microsoft SideWinder Game Pad - + Microsoft SideWinder Precision Racing Wheel - + Microsoft SideWinder Precision Pro - + Microsoft SideWinder Freestyle Pro - + Microsoft SideWinder 3D Pro - - -========================================= -DirectPlay -========================================= -New features: - -- You can test your application under a variety of network conditions - with the new DP8Sim tool. -- SDK documentation now contains DirectPlay tutorials - -Issues: - -- To use DirectPlay Voice in full duplex mode, we recommend that you update - to the latest drivers for your audio device. Some older drivers do not - provide reliable full duplex performance. -- If you successfully connect to a location with any asynchronous - enumerations still active, the enumerations will be canceled automatically - for you. The DPN_MSGID_ASYNC_OP_COMPLETE messages for the enumerations - will list DPNERR_CONNECTING as the result code. As with all asynchronous - operations, if you attempt to call CancelAsyncOperation on the handle - after you have received its DPN_MSGID_ASYNC_OP_COMPLETE message, you - will get back the DPNERR_INVALIDHANDLE error code. Be aware that this - is the expected behavior and that you should not exit with an error - condition. - -Notes on NATs (Network Address Translators): - -- There are many different NAT solutions available, some of which are - different from others. We have attempted to document some of the issues - with various NAT solutions, but is not comprehensive. Please refer to - the DirectX Developer Page at for - further information on these issues. -- When performing the first operation over the TCP/IP service provider, - DirectPlay attempts to detect a Network Address Translator (NAT) or - firewall. This increases the time that the Connect, Host, or EnumHosts - calls take. If you are sure that your machine is not behind a NAT or - firewall, you can set the following registry key values to 0 to disable - the detection: - - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectPlayNATHelp\DPNHPAST\DirectPlay8Priority - - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectPlayNATHelp\DPNHUPnP\DirectPlay8Priority - - As with all registry modifications, only perform them if you are comfortable - doing so, and have a back up. - - DirectPlay Voice codecs via Windows ACM (Audio Compression Manager): - -- DirectPlay Voice uses the following codecs via the Windows ACM: - - Microsoft ADPCM - - Microsoft GSM - - DSP Group Truespeech - -- Installation of these codecs with Windows is optional. If they - are not installed, then one or more of the compression types in - DirectPlay Voice will not function. If the application attempts - to use a compression type that is not functional due to a missing - ACM codec, it will receive the DVERR_COMPRESSIONNOTSUPPORTED - return code. - -- On Windows 2000, the user can install these codecs through the - Add/Remove Hardware wizard. The user should select - "Add/Troubleshoot a device". When a list of hardware is presented, - the user should select "Add a new device", then on the next - page select "No, I want to select the hardware from a list". - This will bring up a list of hardware. Select "Sound, video, and - game controllers". The "Audio Codecs" item is listed under - "(Standard system devices)". - -- On Windows 9x, the user can install these codecs through the - Add New Hardware wizard. When prompted, the user should select - "No, I want to select the hardware from a list". In the list of - device types, codecs are listed under "Sound video and game - controllers". The codecs are listed under two manufacturers. - The ADPCM and GSM codecs are listed under "Microsoft Audio - Codecs" and the Truespeech codec is listed under "DSP Group". - - -========================================= -Broadcast Driver Architecture -========================================= - -Known issues with Broadcast IP Data Reception under Windows 2000: - -- After rebooting a Windows 2000 system with a BDA receiver card installed, - the BDA NDIS IP NIC is not immediately active. It becomes active only - when an application inserts the BDA IPSink filter into a graph and connects - its input pin. Once activated by connecting the IPSink filter's input pin, - it takes 20 to 30 seconds for the BDA NDIS IP NIC to be assigned an IP - address. The address assigned will be a Net 10 address. Once activated, - the BDA NDIS IP NIC will remain active until the system is rebooted. - -- There may be some applications that use the BDA NDIS IP NIC as the default - LAN adapter. These apps will fail if the BDA NDIS IP NIC is active. To - de-activate the BDA NDIS IP NIC, reboot the system and do not run a TV graph - or application. - -- When viewing a BDA Network provider property page with GraphEdit, you cannot - enter a -1 value. As a workaround, enter 0 and click the down arrow to set - the value to -1. - -- Pin connections with mpe/slip with ipsink may fail if NO tuner is - installed post - DX8.1 installation. This behavior is exactly as seen - in Windows XP. This may be due to the TV tuner driver not being - properly installed. Automatic loading of BDA NDIS miniport is restricted - by design. The solution is to right click and install the bda.inf, followed by - a machine reboot. - - -========================================= -DirectShow -========================================= - -What's New in DirectShow for DirectX 8.1: -There have been considerable improvements made to the DirectShow content -for the DirectX 8.1 SDK. Below is a brief summary of the updates. - -Improvements to existing samples -------------------------------------- -There have been many enhancements and refinements to the existing -DirectX 8.1 samples for this release, including: - -- New features and functionality -- Numerous bug fixes, including Windows XP support issues -- UNICODE and IA64 support -- ASF-enabled versions of the PlayWnd and MFC Jukebox samples -- Clean compilation with Warning Level 4 -- Improved video window repainting for Jukebox-style applications -- Updated resource files and version information blocks -- Digital Video sample (Capture\DVApp) was rewritten to take - advantage of the ICaptureGraphBuilder2 interface to build its graphs. -- Sample XTL files have been updated in 8.1 to reflect a change in the - DES XML parser on Windows XP. XML attributes must now be specified - in *lowercase*. Mixed-case attributes will fail on Windows XP. - -New DirectShow samples -------------------------------------- -- Audio Capture (Capture\AudioCap) -- DMO-enabled Player (Players\PlayDMO) -- DMO Enumerator (Misc\DMOEnum) -- Filter Mapper (Misc\Mapper) -- Grabber Sample Filter (Filters\Grabber) (modified from DX8 SampleGrabber) -- JukeboxASF (Players\JukeboxASF) -- PlayCap with Moniker (Capture\PlayCapMoniker) -- PlayWndASF (Players\PlayWndASF) -- Still Image Viewer (Players\StillView) -- Utility source code and routines in the DirectShow\Common directory - -New DirectShow samples for Windows XP -------------------------------------- -Windows XP provides new functionality that is not present in downlevel -operating systems (Windows 9x, Windows 2000). The DirectShow_WinXP -directory provides samples to demonstrate using the new Video Mixing -Renderer and the new Microsoft Video Control (for use with the Windows -Driver Model and Broadcast Driver Architecture). - -The new samples include: - -- Video Control - C++, Visual Basic, and HTML samples of rendering - ATSC, DVB, and Analog television in a Windows application. The - new Video Control encapsulates much of the new functionality and - aids developers in creating television-enabled applications. - -- Video Mixing Renderer (VMR) - - Cube - - Renderless - - Text Player - - VMR Mix - - VMR Player - - VMR Exclusive Mode (VMRXcl) - -See the DirectShow_WinXP directory for more detailed information -about these new samples. - - -Updated Documentation -------------------------------------- -The DirectShow documentation has been significantly enhanced for -DirectX 8.1. It adds information for the new features available in -Windows XP and expands on previously presented material for the -Microsoft TV Technologies. - - -Modified SampleGrabber filter source code -------------------------------------- -There have been several requests for Microsoft to publish the source -code for the popular SampleGrabber filter. To that end, we now provide -a modified (simpler) version of the sample grabber filter, which uses -a new GUID and new CLSID to prevent collisions with the original -DirectX 8.0 filter. You can review and modify the source code for this -filter and use it in your own applications. See the Filters\Grabber -directory for more information. - - -Windows XP support in header files -------------------------------------- -DirectX 8.1 provides support for the following Windows platforms: - - Windows 98, Windows 98 Second Edition, Windows Millennium Edition - - Windows 2000 - - Windows XP - -Because Windows XP adds new functionality which is not present on -downlevel systems, many of the headers in the \DXSDK\include directory -have been revised to allow developers to use new Windows XP functionality -when desired, with full downlevel compatibility. This is achieved by -adding the following conditionally compiled sections to the relevant -header files: - - #if (WINVER >= 0x501) - // Windows XP content - #else - // Downlevel content - #endif - -To enable Windows XP features and to utilize the new portions of the -affected headers, set the Windows version to 0x501 (the Windows XP -version) in your Visual C++ project files. If the Windows version is -less than 0x501, the original DirectX 8.0 content will be used to allow -full backward compatibility with the DirectX 8.0 SDK. Similar -improvements were also made to the Interface Definition Files (IDLs) -in the \DXSDK\include\DShowIDL directory. - -See the Samples\DirectShow and Samples\DirectShow_WinXP directories -for more information. - - -Runtime improvements -------------------------------------- -The DirectX 8.1 binaries and redist files have received various improvements -since the DirectX 8.0 release, including a large subset of the modifications -that were made for Windows XP. - - -Revised GraphEdit application -------------------------------------- -The GraphEdit utility benefits from several improvements, particularly -with respect to its user interface, menus, and toolbar. Additionally, - -- Graph resizing code (View->xxx %) handles all sizes correctly, and - you can resize your graphs using the menu, keyboard +/- keys, and - Ctrl+MouseWheel. - -- You can optionally disable the seek bar (and its timed updates), which - has been known to cause difficulty when debugging filters with GraphEdit. - -- To preserve screen real estate, source and file writer filters displayed - in GraphEdit will now only display their corresponding filenames as the - filter name, instead of displaying the fully qualified path name. - For example, a file source for the file - "C:\DXSDK\samples\Multimedia\Media\lake.mpg" would display "lake.mpg". - - -DirectShow Samples: -------------------------------------- -- DirectX 8.1 contains several new DirectShow samples and many updates - to existing samples. New C++ samples include: - - Capture\AudioCap, Capture\PlayCapMoniker - - Misc\DMOEnum, Misc\Mapper - - Players\JukeboxASF, Players\PlayWndASF, Players\PlayDMO, Players\StillView - -- In order to launch GraphEdit from the StillView or Jukebox applications, - GraphEdt.exe must be installed with the DirectX SDK or exist on your path - -- There are several .XTL sample files in the \media folder. These files - demonstrate some of the functionality available in the DirectShow Editing - Services. You can render these files using the XTLTest C++ sample and - the XTLTestVB and DexterVB VisualBasic samples. All provided XTL files - refer to media that ships in the SDK's media directory. Rendering XTL - files is a great way to get an idea of what the new DirectShow Editing - Services APIs make possible. For a simple demo, drag a few of the SDK - media directory's sample .XTL files onto the XTLTestVB sample's client area. - -- The DirectShow Visual Basic samples demonstrate more of the DES functionality - than the C++ samples. Be sure to run SlideShowVB and TrimmerVB if you are - interested in DES. You can also use the DexterVB ("Dexter Explorer") - application as an XTL development/test tool. - -- The Texture3D sample is known to fail on some systems (referencing - invalid memory), for which you may see an error message. We recommend - updating your video card drivers to the most current revision, as that - usually resolves the problem. - -- The DirectShow IDL files are currently located in the - \include\DShowIDL directory of the SDK for your convenience. - -- You will be required to build the \BaseClasses libraries before any sample - that depends on them can be built or executed. Please review the Readme.Txt - file in the DirectShow samples root directory for more information on - building the samples. - -- If you select the Debug runtime when installing the SDK, then the video renderer - will display frame counters on DirectShow video windows. These frame counters - will appear on all DirectShow applications, whether built as Debug or Release versions. - To disable the frame counters, switch to DirectX Release binaries by running "Install Retail" - from the DirectX SDK's "Runtime Installs" Start Menu item. Note that you must have - enabled the capability to switch between Debug and Release binaries when you installed - the SDK, by checking the "Copy DirectX Setup Files" option on the install options page. - This is not an issue on Windows XP, however, because the Video Mixing Renderer does - not display these frame counters by default. - - - -DirectShow 8.0 release notes: -------------------------------------- - -- Application development using the DirectShow base classes libraries requires - installation of the DirectShow samples. The source code for the base classes - is now included as a sample project, rather than as a separate Classes\Base - directory. You must compile these base classes to generate strmbase.lib and - strmbasd.lib, which are no longer installed as binary files. If you are - linking with strmbase.lib or strmbasd.lib with your own application, be sure - to build and link with the updated DirectX 8 libraries (instead of the older - libraries that are may be installed with Visual C++ or the Microsoft Platform SDK). - -- The samples included with the SDK are configured to compile and link with - the updated libraries, which are generated by building the BaseClasses project. - Further build instructions are provided in: - \samples\Multimedia\DirectShow\readme.txt. - -- The header file, along with many other DirectShow-specific header - files, is now located in the DirectShow samples BaseClasses directory, - which includes the BaseClasses source code and header files. You must add - the BaseClasses directory to the beginning of your project's include path - settings in order for Visual C++ to find all of the updated header files. - -- To use the Teletext Decoder Fonts that are shipped with DX8, make sure that - the WST_* fonts are installed by examining the \windows\fonts directory. - -- There is a known problem with the MP3 decoder filter when used with - Audio Effects DMOs. If you add an audio effect DMO (like WavesReverb, Echo, - or Flange) to an existing MP3 filter graph, the audio could be played back - at double speed. The problem would occur whenever the MP3 decoder is connected - to a downstream audio effect dmo (via the dmo filter wrapper) that offers a - default audio input type which doesn't match the native format of the - uncompressed MP3 stream. For example, if you render a 22kHz MP3 file and - add a DMO Audio effect, the MP3 filter could misinterpret the input type as - being 44kHz when it is actually 22kHz. This would not be a problem for 44kHz - MP3 files. This issue will be fixed in a future release. - -- If you have the SDK on CD-ROM, the Extras\DirectShow\Media directory - contains additional media that can be used with DirectShow and the DirectShow - Editing Services (DES) interfaces. We have included DV-encoded AVI videos, - larger MPEG videos, and higher-quality JPEG images. Since the DV files are - very large, you should copy them to your hard disk before playing them to - ensure the best performance. - -- Remote graph spying with GraphEdit works only on Windows 2000. - -- The DirectShow Editing Services (DES) Color Generator source filter may - generate blue or green components incorrectly if they have small values. - For best results, use solid primary colors or set Blue and Green - components to values of either 0xFF or 0x00. - -- For this release, the WavesReverb DMO will only accept 16-bit audio input. - If you attempt to connect the WavesReverb DMO to an 8-bit audio source, - the connection will fail. - -- The sample XTL files have been updated in 8.1 to reflect a change in the - DES XML parser on Windows XP. XML attributes must now be specified - in *lowercase*. Mixed-case attributes will fail on Windows XP. - -- GraphEdit has been revised for 8.1 to improve its user interface and to - correct problems with zoom levels. - -- The IRenderEngine::SetRenderRange method does not work if there is an - effect on a source clip, where the source clip does not start at time - zero. - -__________________________________________________________________ - - -COMPILER SUPPORT - -- All DirectX 8.1 SDK samples are developed and compiled with Visual Studio 6.0. - The DirectX 8.1 SDK samples are optimized to compile with Visual Studio 6.0, - and we have provided Visual Studio 6.0 DSP files for your convenience. - -- All DirectX 8.1 SDK samples have been compiled with Visual Studio 7.0, and - that development environment is supported, even though no explicit project - files are provided. - -- The DirectX SDK no longer supports using Visual Studio 5.0. While this may - work, any issues with using Visual Studio 5.0 and the DirectX 8.1 SDK will - not be addressed in this release or future releases. The DirectX 8.0a SDK supports - VC 5.0 ( with the SP3 linker fix ) and Windows 95, so this may be an option for some - developers. - - -__________________________________________________________________ - - -SPECIAL THANKS - -Marlin Studios - -Textures used in the Billboard sample, tree02S.tga, tree01S.tga & tree35S.tga, -are provided courtesy of Marlin Studios (http://www.marlinstudios.com). -They are provided for use with this sample only and cannot be distributed -with any application without prior written consent. - -Viewpoint Digital, Inc. - -The model used by the Visual Basic AutoParts sample, engine1.x, is provided -courtesy of Viewpoint Digital, Inc. (http://www.viewpoint.com). It is provided -for use with this sample only and cannot be distributed with any application -without prior written consent. V6 Engine Model copyright 1999 Viewpoint -Digital, Inc.. - -3DCAFE and Platinum Pictures - -The model in the Dolphin samples, Dolphin.x, is derived from the model files -(dolphins.zip) provided courtesy of 3DCAFE and Platinum Pictures -(http://www.3dcafe.com/). It is provided for use with this sample only. -For further terms of use please visit the 3DCAFE site or contact 3DCAFE. - - -__________________________________________________________________ - - -ROLAND SOUNDCANVAS SOUND SET FOR GENERAL MIDI AND GS FORMAT - -The Roland SoundCanvas Sound Set includes the necessary sounds to make a -complete General MIDI compatible sound set. It also includes additional -sounds necessary to make a complete GS Format compatible sound set. - -WHAT IS THE GS FORMAT? - -The GS Format is a standardized set of specifications for sound sources -that defines the manner in which multitimbral sound generating devices -will respond to MIDI messages. The GS Format also complies with General -MIDI System Level 1. - -The GS Format also defines a number of other details over and above the -features of General MIDI. These include unique specifications for sound -and functions available for tone editing, effects, and other specifications -concerning the manner in which sound sources will respond to MIDI messages. -Any device that is equipped with GS Format sound sources can faithfully -reproduce both General MIDI sound recordings and GS Format MIDI sound -recordings. - -HOW TO CONTACT ROLAND: - -For more information, please contact: - -Roland Corporation U.S. -7200 Dominion Circle -Los Angeles, CA 90040-3696 - -Phone: 323-685-5141 -Fax: 323-722-7408 - -COPYRIGHT NOTICE AND LICENSE LIMITATIONS - -Roland GS Sound Set/Microsoft (P) 1996 Roland Corporation U.S. - -The Roland GS Sound Set/Microsoft, the "Sample Set", incorporates the -Roland SoundCanvas Sound Set. Roland Corporation U.S. owns the Sample Set -and all copyrights pertaining thereto and has licensed the Sample Set for -use solely on Microsoft operating system products and Microsoft Application -Products. - -Roland reserves all rights to the Sample Set not expressly granted by Roland -Corporation U.S. or by Microsoft under the terms of Microsoft's End User -License Agreement. - -The Sample Set may only be redistributed with your software application as a -part of a Microsoft operating system product installation and under the terms -of Microsoft's End User License Agreement. The Sample Set may not be -separated from the Microsoft operating system product; the Sample Set may -only be installed by the Microsoft installation procedure for the associated -Microsoft operating system product or for an associated software development -kit. All other uses of the Sample Set require a separate written license -from Roland Corporation U.S. - -The Sample Set may not be used, copied or redistributed in hardware ROM or -similar technology of any device without prior express written permission -from an authorized representative of Roland Corporation U.S. The Sample -Set may not be redistributed with any Musical Instrument . A "Musical -Instrument" is any device that is capable of generating musical sounds -without being directly connected to a computer with a licensed Microsoft -operating system product. You may not modify the Sample Set under any -circumstances. - diff --git a/import/DirectX8/bin/DXUtils/DXCapsViewer.exe b/import/DirectX8/bin/DXUtils/DXCapsViewer.exe deleted file mode 100644 index 6513bd15a..000000000 Binary files a/import/DirectX8/bin/DXUtils/DXCapsViewer.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/DxTex.exe b/import/DirectX8/bin/DXUtils/DxTex.exe deleted file mode 100644 index 0e94c56a7..000000000 Binary files a/import/DirectX8/bin/DXUtils/DxTex.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/KillHelp.exe b/import/DirectX8/bin/DXUtils/KillHelp.exe deleted file mode 100644 index c367270d5..000000000 Binary files a/import/DirectX8/bin/DXUtils/KillHelp.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/XFiles/conv3ds.exe b/import/DirectX8/bin/DXUtils/XFiles/conv3ds.exe deleted file mode 100644 index 8b5edbe56..000000000 Binary files a/import/DirectX8/bin/DXUtils/XFiles/conv3ds.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/XFiles/conv3ds.txt b/import/DirectX8/bin/DXUtils/XFiles/conv3ds.txt deleted file mode 100644 index 91e14d6c6..000000000 --- a/import/DirectX8/bin/DXUtils/XFiles/conv3ds.txt +++ /dev/null @@ -1,170 +0,0 @@ -conv3ds -------- - -conv3ds converts 3ds models produced by Autodesk 3D Studio and other -modelling packages into X Files. By default it produces binary X files -with no templates. - - -How to use it -------------- - -At its simplest you can run it with no options and it will (endeavour) to -produce an X file containing a hiearchy of frames. For example: - -conv3ds file.3ds - -will produce an X File file.x. Use Frame::Load to load the frame. - -If the 3ds file contains key frame data then you can produce an X file -which contains an animation set using the -A option. For example: - -conv3ds -A file.3ds - -Use AnimationSet::Load to load the animation. - -If you want to make an X file containing a single mesh made from all the -objects in the 3ds file then use the -m option. - -conv3ds -m file.3ds - -Use MeshBuilder::Load to load the mesh. - - -Other useful options --------------------- - -* The -T option will wrap all the objects and frame hierarchies in a single -"toplevel" frame. This enables you to load all the frames and objects in -the 3ds file with a single call to Frame::Load, using the default options -(ie. Load the first toplevel frame hiearchy in the X file). The frame -containing all the other frames and meshes is called "x3ds_filename" -(without the .3ds extension). When used with the -m option this option has -no affect. - - -* The -s option allows you to specify a scale factor for all the objects -converted in the 3ds file. For example - -conv3ds -s10 file.3ds - -will make all the objects 10 times bigger, and - -conv3ds -s0.1 file.3ds - -will make all the objects 10 times smaller - - -* The -r option reverses the winding order of the faces when the 3ds file is -converted. If after converting the 3ds file and viewing it in D3D, the object -appears "inside-out" try converting it with the -r option. All Lightwave -models (see notes below) exported as 3ds files will need this option. - - -* The -v option turns on verbose output mode. Specifiy an integer with it. -The only useful (currently) integers are: - -v1, print out warnings about bad objects and general information - about what the converter is doing - -v2, print out basic keyframe information, objects being included in the - conversion process, and information about the objects while being saved. - -v3, very verbose (mostly useful for debugging) information. - -The default is -v0. - - -* The -e option allows you to change the extension for texture map files. For -example: - -conv3ds -e"ppm" file.3ds - -and file.3ds contains objects which reference the texture map file brick.gif, -the X file will reference the texture map file brick.ppm. The converter does -not convert the texture map file. The texture map files must also be in the -D3DPATH when the resulting X File is loaded. - -* The -x option forces conv3ds to produce a text X file, not a binary -X file. Text files are larger but can be hand edited easily. - -* The -X option forces conv3ds to include the D3DRM X File templates in -the file. By default the templates are not included. - - -Other options -------------- - -* The -t option specifies that the X File produced will not contain texture -information. - -* The -N option specifies that the X file produced will not contain Normal -information. All the D3DRM Load calls will generate normals for objects -with no normals in the X file. - -* The -c option specifies that the X file produced should not contain -texture coordinates. By default if you use the -m option the outputted mesh -will contain 0,0 uv texture coordinates if the 3ds object had no texture -coordinates. - -* The -f option specifies that the X file produced should not contain any -FrameTransformMatrix. - -* The -z and -Z options allow you to adjust the alpha face color value of -all the materials referenced by objects in the X File. -This is best illustrated with an example: - -conv3ds -z0.1 -Z0.2 file.3ds - -says add 0.1 to all alpha values under 0.2. And - -conv3ds-z"-0.2" -z1 file.3ds - -says subtract 0.2 from the alpha values for all alphas. - -* The -o option allows you to specify the filename for the .X File produced. - -* The -h option tells the converter not to try to resolve any hiearchy -information in the 3ds file (usually produced by the keyframer). Instead all -the objects (when the converter is not used with the -m option) are outputted -in toplevel frames. - - -3ds file produced from lightwave objects ----------------------------------------- - -There are a number of issues with 3ds files exported by the trans3d -plugin for lightwave. These are best handled using the following -options to conv3ds. - -conv3ds -r -N -f -h -T|m trans3dfile.3ds - -All the 3ds objects which we've come across produced by trans3d and the -lightwave object editor need their winding order reversing (otherwise they -appear "inside-out" when displayed) and contain no normal information. - - -Hints and Tips --------------- - -Some of these are pretty obvious but are probably worth saying anyway. - -If, after loading an object produced by conv3ds into the D3DRM viewer, -you can't see the object then try using the -s object -with an integer of say, 100, to increase the X file objects scale. - - -If, after loading the object into the viewer and switching from flat -shading into Gourard shading the object turns dark grey try converting -with the -N option. - -Textures can be the biggest problem. If after converting the object the -textures don't get loaded then make sure that the object is referencing -either .ppm or .bmp files (using the -e option), make sure the textures -width and height is a power of 2, and make sure the textures are stored -in one of the directories in your D3DPATH. - - -Known bugs and problems ------------------------ - -Currently conv3ds can't handle dummy frames used in 3ds animations. -It just ignores them (but will convert any child objects). - diff --git a/import/DirectX8/bin/DXUtils/XFiles/convx.exe b/import/DirectX8/bin/DXUtils/XFiles/convx.exe deleted file mode 100644 index 3987468f1..000000000 Binary files a/import/DirectX8/bin/DXUtils/XFiles/convx.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/XFiles/convxof.exe b/import/DirectX8/bin/DXUtils/XFiles/convxof.exe deleted file mode 100644 index 14ab41634..000000000 Binary files a/import/DirectX8/bin/DXUtils/XFiles/convxof.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dbmon.exe b/import/DirectX8/bin/DXUtils/dbmon.exe deleted file mode 100644 index 1638ea642..000000000 Binary files a/import/DirectX8/bin/DXUtils/dbmon.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/directx.cpl b/import/DirectX8/bin/DXUtils/directx.cpl deleted file mode 100644 index f278af4cf..000000000 Binary files a/import/DirectX8/bin/DXUtils/directx.cpl and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dmodump.dll b/import/DirectX8/bin/DXUtils/dmodump.dll deleted file mode 100644 index 0e24f397a..000000000 Binary files a/import/DirectX8/bin/DXUtils/dmodump.dll and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dmotest.chm b/import/DirectX8/bin/DXUtils/dmotest.chm deleted file mode 100644 index c9daebb6d..000000000 Binary files a/import/DirectX8/bin/DXUtils/dmotest.chm and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dmotest.exe b/import/DirectX8/bin/DXUtils/dmotest.exe deleted file mode 100644 index ef4570f00..000000000 Binary files a/import/DirectX8/bin/DXUtils/dmotest.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dp8log.exe b/import/DirectX8/bin/DXUtils/dp8log.exe deleted file mode 100644 index f8f3e388e..000000000 Binary files a/import/DirectX8/bin/DXUtils/dp8log.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dp8log.txt b/import/DirectX8/bin/DXUtils/dp8log.txt deleted file mode 100644 index 027eaff04..000000000 --- a/import/DirectX8/bin/DXUtils/dp8log.txt +++ /dev/null @@ -1,115 +0,0 @@ -DIRECTPLAY 8 LOGGING UTILITY (DP8LOG.EXE) - -Like many parts of DirectX, the debug version of DirectPlay 8 sends -debugging messages meant to aid you in development to a debug program. -DirectPlay is also able to send this debugging information to a region -of shared memory. The purpose of the dp8log.exe utility is to read and -display the contents of that region of memory. This allows you to obtain -the debug information on machines that do not have a debugger and also -gives you a convenient way to save the debugging information to a file -by redirecting the output from dp8log.exe to a file. - -To display the contents of shared memory simply run dp8log.exe from the -command prompt. The contents of the shared memory will be output to the -standard output device (the screen). If you want to save the debug -output to a file, simply redirect standard output to a file. For example, -the command: - -dp8log > debug.txt - -Will save the debug output in a file called debug.txt in the current -directory. - -Note that the shared memory region only exists while a DirectPlay 8 -application is running and has loaded one or more of the DirectPlay 8 -dlls. When all DirectPlay applications exit or unload the DirectPlay 8 -dlls, the shared memory region is deallocated. This means that you can -only get output from dp8log.exe while one or more of the DirectPlay 8 -dlls are loaded (i.e. the application using DirectPlay 8 is running). - -Also note that all DirectPlay 8 applications share the same area of -shared memory. This means that the debug output will contain output -from all processes using DirectPlay 8. - -You can change the behavior of the DirectPlay 8 debug output by adding -entries to win.ini in the windows directory. - -DirectPlay 8 looks for the [DirectPlay8] section in win.ini, and it -recognizes the following attributes: - -debug=x -log=x -debug.=x -log.=x -verbose=x - -These attributes are described below: - -debug - determines how much information is sent to the debug log, 0 is -the least amount (critical errors only), 9 is the most (practically -everything that DirectPlay does). Note that setting "debug" to a high -level takes a fair amount of CPU time and will lower the performance -of your application. - -DirectPlay is subdivided into a number of components. It is possible to -control the debug level of individual components. The following -compoenents are available: - -core - session layer protocol (e.g. player and group management) -addr - DirectPlay addressing (i.e. IDirectPlay8Address) -lobby - lobby client and lobbied application -protocol - transport protocol (i.e. retries, acks, etc.) -voice - DirectPlay Voice -dpnsvr - the enumeration server/redirector (dpnsvr.exe) -wsock - winsock (IP/IPX) service provider -modem - serial and modem service provider -shared - shared untility functions in DirectPlay - -The "debug" setting sets the default debug level. You can override this -with specific component levels, e.g. - -debug=1 ; sets the default level to 1 -debug.voice=5 ; set voice related debug level to 5 -debug.wsock=0 ; set the winsock service provider debug level to 0 - -The "log" attribute determines where the debug information is sent. -The following values are valid: - -log=0 ; send no debug information -log=1 ; send debug info to debug console (i.e vc++ debug window) -log=2 ; send debug info to shared memory -log=3 ; send debug info to both console and shared memory - -As with the "debug" attribute, you can specify components for the -log attribute. For example: - -log=1 ; default to sending debug information to the debug console -log.voice=3 ; send voice debug information to console and memory -log.wsock=0 ; send winsock service provider debug information to nowhere - -The "verbose" attribute determines how much information is contained -in each debug message. There are two verbosity levels, "0" and "1". -"0" is the default. Example: - -verbose=1 ; sent the verbosity level to 1 - -Experiment with the different verbosity levels and decide which one -serves your purposes best. - -Here is a complete example win.ini section: - -[DirectPlay8] -debug=1 ; set the default debug level to 1 -debug.core=5 ; set the core debug level to 5 -log=1 ; default to sending debug output to console only -log.core=3 ; send the core debug output to both console and memory -verbose=1 ; use verbosity level 1 - -If no [DirectPlay8] section is found in win.ini, DirectPlay defaults -to the following settings: - -[DirectPlay8] -log=1 -debug=0 - -Therefore you will always see critical errors in the debug console. \ No newline at end of file diff --git a/import/DirectX8/bin/DXUtils/dp8parse.dll b/import/DirectX8/bin/DXUtils/dp8parse.dll deleted file mode 100644 index a181b9f1e..000000000 Binary files a/import/DirectX8/bin/DXUtils/dp8parse.dll and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/dxtex.txt b/import/DirectX8/bin/DXUtils/dxtex.txt deleted file mode 100644 index f9629b823..000000000 --- a/import/DirectX8/bin/DXUtils/dxtex.txt +++ /dev/null @@ -1,176 +0,0 @@ -Readme for the DirectX Texture Tool - - -Purpose and Audience --------------------- -The purpose of this tool is to allow DirectX SDK users to easily create texture -maps that use the DXTn compression formats. Creating a DXTn-compressed -texture is actually not that difficult to do: DirectDraw's Blt function can -do the conversion for you. Advanced developers will probably want to write -their own tools that meet their specific needs. But this tool provides useful -basic functionality. - - -DxTex Functionality -------------------- -Opens BMP and DDS files (See below for a description of the DDS file format) -Opens BMP files as alpha channel, either explicitly or implicitly (via -foo_a.bmp naming) -Saves textures in DDS format -Supports conversion to all five DXTn compression formats -Supports generation of mip maps (using a box filter) -Supports visualization of alpha channel as a greyscale image or via a user- -selectable background color -Supports easy visual comparison of image quality between formats - -Note: DxTex does not currently support textures with surface formats that -do not contain at least an R, G, and B texture (such as D3DFMT_G16R16 and -D3DFMT_A8), although D3DX can load and save such textures in DDS format. - - -User Interface --------------- -DxTex uses a pretty traditional user interface. Each texture map is a -document, and several documents can be open at a time. The one thing that -is a bit unusual about the UI is that each document can hold the texture -in either one or two formats at once while the document is open in DxTex. -For instance, one could import a BMP file, which would automatically create -a 32-bit ARGB texture. One could then choose to convert the texture to -DXT1 format. The document now remembers the image in *both* formats, and -the user can flip between the formats by clicking in the window or by -choosing "Original" and "New" in the View menu. This makes it easy for -the user to observe any artifacts introduced by image compression, and to -try several different compression formats without progressive degradation -of the image For instance, if this technique were not used and the user -converted an image from ARGB to DXT1, all but one bit of alpha would be lost. -If the user then decided to convert to DXT2, there would still be only two -alpha levels. With DxTex's system, the second conversion is done from the -original ARGB format, and the DXT2 image will contain all 16 levels of alpha -supported by DXT2. When the image is saved, the "original" format is -discarded, and only the "new" format is stored. - -There are a few consequences of this system that one must remember: -- If no format conversion has been requested since the document was opened, - the one format is the "original" format and that is the format in which - the image will be written when the document is saved. -- If format conversion has been requested since the document was opened, the - converted format is the "new" format and that is the format in which the - image will be written when the document is saved. -- If a second format conversion is requested, the "new" format from the first - conversion is replaced with the second format. The "original" format will - be unchanged. -- Generating of mip maps applies to both formats simultaneously. -- If the original format has multiple mip maps, and conversion to a new format - is requested, the new format will automatically have multiple mip maps as - well. -It's not as complicated as it sounds: with time, this two-format system -becomes natural and efficient to use. - - -DxTex Performance ------------------ -DxTex uses the Direct3D Reference Rasterizer to draw the textures, -regardless of what 3D hardware is available. So with larger textures -(greater than 256x256), the program may be somewhat slow, depending on your -CPU speed. - - -DDS File Format ---------------- -DxTex's native file format is called "DDS" file format, because it -encapsulates the information in a DirectDrawSurface. It has the following -format: - - DWORD dwMagic (0x20534444, or "DDS ") - DDSURFACEDESC2 ddsd (this provides information about the surface format) - BYTE bData1[] (this is the surface data for the main surface) - [BYTE bData2[]...] (surface data for attached surfaces, if any, follow) - -This format is easy to read and write, and supports features such as alpha -and multiple mip levels, as well as DXTn compression. The "Compress" sample -application on the DirectX SDK demonstrates how to properly import a DDS file. - -The user should note that it is not necessary to use the DDS format in order -to use DXTn-compressed textures, or vice-versa. But the two work well -together. - - -Mip Maps --------- -Mip mapping is a technique that improves image quality and reduces texture -memory bandwidth by providing prefiltered versions of the texture image at -multiple resolutions. - -To generate mip maps in DxTex, the width and height of the source image must -both be powers of 2. Choose "Generate Mip Maps" from the Format menu. -Filtering is done via a simple box filter, i.e., the four nearest pixels are -averaged to produce each destination pixel. More sophisticated filtering can -be found in other image processing programs. - - -Alpha ------ -Many texture formats include an alpha channel, which provides opacity -information at each pixel. DxTex fully supports alpha in textures. When -importing a BMP file, if a file exists of the same size with "_a" at the end -(e.g., foo.bmp and foo_a.bmp), the second file will be loaded as an alpha -channel. The blue channel of the second BMP is stored in the alpha channel. -Once a document is open, the user can explicitly load a BMP file as the alpha -channel via the "Open As Alpha Channel" command on the File menu. - -To view the alpha channel directly without the RGB channels, choose "Alpha -Channel Only" from the View menu. The alpha channel will appear as a -greyscale image. Note that if no alpha channel has been loaded, the alpha -channel will be 100% everywhere and the image will appear solid white when -viewing "Alpha Channel Only". To turn off "Alpha Channel Only", just choose -that menu item a second time. - -In the usual view, the effect of the alpha channel is visible because the -window has a solid background color which shows through the texture where the -alpha channel is less than 100%. The user can change this background color -by choosing "Change Background Color" from the View menu. This choice does -not affect the texture itself or the data that is written when the file is -saved. - -The DXT2 and DXT4 formats use premultiplied alpha, which means that the -red, green, and blue values stored in the surface are already multiplied -by the corresponding alpha value. DirectDraw cannot blit from a surface -containing premultiplied alpha to one containing non-premultiplied alpha, -so some DxTex operations (Open as Alpha Channel, conversion to DXT3, and -conversion to DXT5) are not possible on DXT2 and DXT4 formats. Supporting -textures using these formats is difficult on Direct3D devices which do -not support DXTn textures, because DirectDraw cannot handle blitting them -to a traditional ARGB surface either (unless that ARGB surface uses -premultiplied alpha as well, which is rare). So you may find it easier to -use DXT3 rather than DXT2 and DXT5 rather than DXT4 when possible. - - -Command-Line Options --------------------- -Command-line options can be used to pass input files, an output file name, and -processing options to DxTex. If an output file name is specified, the program -exits automatically after writing the output file, and no user interface is -presented. - -dxtex [infilename] [-a alphaname] [-m] [DXT1|DXT2|DXT3|DXT4|DXT5] [outfilename] - -infilename: The name of the file to load. This can be a BMP or - DDS file. - --a alphaname: If "-a" is specified, the next parameter is the name - of a BMP file to load as the alpha channel. Note: - if no alpha filename is specified, DxTex will still - look for a file named infilename_a.bmp and, if it - exists, use that as the alpha channel. - --m: If this option is specified, mipmaps are generated. - -DXT1|DXT2|DXT3|DXT4|DXT5: Specifies compression format. If no format is - specified, the image will be in ARGB-8888. - -outfilename: Specifies the name of the destination file. If this - is not specified, the user interface will show the - current file and all requested operations. If an - outfilename is specified, the app will exit after - saving the processed file without presenting a user - interface. diff --git a/import/DirectX8/bin/DXUtils/fedit.chm b/import/DirectX8/bin/DXUtils/fedit.chm deleted file mode 100644 index 10ad972c9..000000000 Binary files a/import/DirectX8/bin/DXUtils/fedit.chm and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/fedit.exe b/import/DirectX8/bin/DXUtils/fedit.exe deleted file mode 100644 index 937b5d883..000000000 Binary files a/import/DirectX8/bin/DXUtils/fedit.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/graphedit.chm b/import/DirectX8/bin/DXUtils/graphedit.chm deleted file mode 100644 index e5616acda..000000000 Binary files a/import/DirectX8/bin/DXUtils/graphedit.chm and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/graphedt.exe b/import/DirectX8/bin/DXUtils/graphedt.exe deleted file mode 100644 index e24cfa208..000000000 Binary files a/import/DirectX8/bin/DXUtils/graphedt.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/proppage.dll b/import/DirectX8/bin/DXUtils/proppage.dll deleted file mode 100644 index abbc1b1c9..000000000 Binary files a/import/DirectX8/bin/DXUtils/proppage.dll and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/psa.exe b/import/DirectX8/bin/DXUtils/psa.exe deleted file mode 100644 index 6016ad2b8..000000000 Binary files a/import/DirectX8/bin/DXUtils/psa.exe and /dev/null differ diff --git a/import/DirectX8/bin/DXUtils/vsa.exe b/import/DirectX8/bin/DXUtils/vsa.exe deleted file mode 100644 index 048bbbf68..000000000 Binary files a/import/DirectX8/bin/DXUtils/vsa.exe and /dev/null differ diff --git a/import/DirectX8/doc/DirectXEULAs/DirectX End User EULA.txt b/import/DirectX8/doc/DirectXEULAs/DirectX End User EULA.txt deleted file mode 100644 index 0b00fe66b..000000000 --- a/import/DirectX8/doc/DirectXEULAs/DirectX End User EULA.txt +++ /dev/null @@ -1,24 +0,0 @@ -SUPPLEMENTAL END USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE - -IMPORTANT: READ CAREFULLY - The Microsoft Corporation ("Microsoft") operating system components which you are about to install, including any "online" or electronic documentation ("OS COMPONENTS"), are subject to the terms and conditions of the agreement under which you have validly licensed the applicable Microsoft operating system product identified below (each an "End User License Agreement" or "EULA") and the terms and conditions of this Supplemental EULA. BY INSTALLING, COPYING OR OTHERWISE USING THE OS COMPONENTS, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THE EULA FOR THE APPLICABLE OPERATING SYSTEM PRODUCT IDENTIFIED BELOW AND THIS SUPPLEMENTAL EULA. IF YOU DO NOT AGREE TO THESE TERMS AND CONDITIONS, DO NOT INSTALL, COPY OR USE THE OS COMPONENTS. - -NOTE: IF YOU DO NOT HAVE A VALID EULA FOR EITHER MICROSOFT WINDOWS 95, WINDOWS 98, WINDOWS ME, OR WINDOWS 2000, (each an "OS Product"), YOU ARE NOT AUTHORIZED TO INSTALL, COPY OR OTHERWISE USE THE OS COMPONENTS AND YOU HAVE NO RIGHTS UNDER THIS SUPPLEMENTAL EULA. - -Capitalized terms used in this Supplemental EULA and not otherwise defined herein shall have the meanings assigned to them in the applicable OS Product EULA. - -General. The OS COMPONENTS are provided to you by Microsoft to update, supplement, or replace existing functionality of the applicable OS Product. Microsoft grants you a license to use the OS COMPONENTS under the terms and conditions of the EULA for the applicable OS Product (which is hereby incorporated by reference) and the terms and conditions set forth in this Supplemental EULA, provided that you comply with all such terms and conditions. To the extent that any terms in this Supplemental EULA conflict with terms in the applicable OS Product EULA, the terms of this Supplemental EULA control solely with respect to the OS COMPONENTS. - -Additional Rights and Limitations. - -* If you have multiple validly licensed copies of the applicable OS Product(s), you may reproduce, install and use one copy of the OS COMPONENTS as part of such OS Product on each of your computers running validly licensed copies of such OS Product(s) provided that you use such additional copies of the OS COMPONENTS in accordance with the terms and conditions above. For each validly licensed copy of an applicable OS Product, you also may reproduce one additional copy of the OS COMPONENTS solely for archival purposes or reinstallation of the OS COMPONENTS on the same computer as the OS COMPONENTS were previously installed. Microsoft retains all right, title and interest in and to the OS COMPONENTS. All rights not expressly granted are reserved by Microsoft. - -IF THE OS PRODUCT WAS LICENSED TO YOU BY MICROSOFT OR ANY OF ITS WHOLLY OWNED SUBSIDIARIES, THE LIMITED WARRANTY (IF ANY) INCLUDED IN THE OS PRODUCT EULA APPLIES TO THE OS COMPONENTS PROVIDED THE OS COMPONENTS HAVE BEEN LICENSED BY YOU WITHIN THE TERM OF THE LIMITED WARRANTY IN THE OS PRODUCT EULA. HOWEVER, THIS SUPPLEMENTAL EULA DOES NOT EXTEND THE TIME PERIOD FOR WHICH THE LIMITED WARRANTY IS PROVIDED. - -IF THE OS PRODUCT WAS LICENSED TO YOU BY AN ENTITY OTHER THAN MICROSOFT OR ANY OF ITS WHOLLY OWNED SUBSIDIARIES, MICROSOFT DISCLAIMS ALL WARRANTIES WITH RESPECT TO THE OS COMPONENTS AS FOLLOWS: - -DISCLAIMER OF WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND ITS SUPPLIERS PROVIDE TO YOU THE OS COMPONENTS, AND ANY (IF ANY) SUPPORT SERVICES RELATED TO THE OS COMPONENTS ("SUPPORT SERVICES") AS IS AND WITH ALL FAULTS; AND MICROSOFT AND ITS SUPPLIERS HEREBY DISCLAIM WITH RESPECT TO THE OS COMPONENTS AND SUPPORT SERVICES ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) WARRANTIES OR CONDITIONS OF OR RELATED TO: TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS OF RESPONSES, RESULTS, LACK OF NEGLIGENCE OR LACK OF WORKMANLIKE EFFORT, QUIET ENJOYMENT, QUIET POSSESSION, AND CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE OS COMPONENTS AND ANY SUPPORT SERVICES REMAINS WITH YOU. - -EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR: LOSS OF PROFITS, LOSS OF CONFIDENTIAL OR OTHER INFORMATION, BUSINESS INTERRUPTION, PERSONAL INJURY, LOSS OF PRIVACY, FAILURE TO MEET ANY DUTY (INCLUDING OF GOOD FAITH OR OF REASONABLE CARE), NEGLIGENCE, AND ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE OS COMPONENTS OR THE SUPPORT SERVICES, OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THIS SUPPLEMENTAL EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, BREACH OF CONTRACT OR BREACH OF WARRANTY OF MICROSOFT OR ANY SUPPLIER, AND EVEN IF MICROSOFT OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -LIMITATION OF LIABILITY AND REMEDIES. NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER (INCLUDING, WITHOUT LIMITATION, ALL DAMAGES REFERENCED ABOVE AND ALL DIRECT OR GENERAL DAMAGES), THE ENTIRE LIABILITY OF MICROSOFT AND ANY OF ITS SUPPLIERS UNDER ANY PROVISION OF THIS SUPPLEMENTAL EULA AND YOUR EXCLUSIVE REMEDY FOR ALL OF THE FOREGOING SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE OS COMPONENTS OR U.S.$5.00. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS ITS ESSENTIAL PURPOSE. - diff --git a/import/DirectX8/doc/DirectXEULAs/DirectX SDK EULA.txt b/import/DirectX8/doc/DirectXEULAs/DirectX SDK EULA.txt deleted file mode 100644 index 871450e0d..000000000 --- a/import/DirectX8/doc/DirectXEULAs/DirectX SDK EULA.txt +++ /dev/null @@ -1,59 +0,0 @@ - -Microsoft DirectX 8.0 Software Development Kit -END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE - -IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft") for the Microsoft software product identified above, which includes computer software and may include associated media and printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT). The SOFTWARE PRODUCT provided to you by Microsoft. Any software provided along with the SOFTWARE PRODUCT that is associated with a separate end-user license agreement is licensed to you under the terms of that license agreement. You agree to be bound by the terms of this EULA by installing, copying, downloading, accessing or otherwise using the SOFTWARE PRODUCT. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT. - -SOFTWARE PRODUCT LICENSE - -The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold. - -1.GRANT OF LICENSE. - -Microsoft grants you the following rights provided that you comply with all the terms and conditions of this EULA: - -SOFTWARE PRODUCT. You may install and use the SOFTWARE PRODUCT on up to ten (10) computers, including workstations, terminals or other digital electronic devices ("COMPUTERS"), provided that you are the only individual using the SOFTWARE PRODUCT on each COMPUTER, to design, develop, and test software application products for use with Microsoft operating system products including Windows 2000, Windows 95, Windows 98 and Windows Me and subsequent releases thereto ("Application"). If you are an entity, Microsoft grants you the right to designate one individual within your organization to have the right to use the SOFTWARE PRODUCT in the manner provided above. - -SAMPLE CODE. You may modify the sample source code located in the SOFTWARE PRODUCT's root directory "\DXF\Samples\Multimedia"("Sample Code") to design, develop and test your Application. You may also reproduce and distribute the Sample Code in object code form along with any modifications you make to the Sample Code, provided that you comply with the Distribution Requirements described below. For purposes of this Section, "modifications" shall mean enhancements to the functionality of the Sample Code. - -REDISTRIBUTABLE CODE. Portions of the SOFTWARE PRODUCT are designated as "Redistributable Code". If you choose to distribute the Redistributable Code, you must include the files as specified listed in the SOFTWARE PRODUCTS root directory "\DXF\doc\directxeulas\directx redist.txt". No other modifications, additions, or deletions to the Redistributable Code are permitted without written permission from Microsoft Corporation. Your rights to distribute the Redistributable Code are subject to the Distribution Requirements described below. - -DISTRIBUTION REQUIREMENTS. You may reproduce and distribute an unlimited number of copies of the Sample Code and/or Redistributable Code, (collectively "REDISTRIBUTABLE COMPONENTS")as described above, provided that (a) you distribute the REDISTRIBUTABLE COMPONENTS only as part of, or for use in conjunction with your Application; (b) your Application adds significant and primary functionality to the REDISTRIBUTABLE COMPONENTS; (c) the REDISTRIBUTABLE COMPONENTS only operate in conjunction with Microsoft Windows operating system products including Windows 2000, Windows 95, Windows 98, Windows Me, and subsequent versions thereof, (d) you distribute your Application containing the REDISTRIBUTABLE COMPONENTS pursuant to an End-User License Agreement (which may be "break-the-seal", "click-wrap", or signed), with terms no less protective than those contained herein; (e) you do not permit further redistribution of the REDISTRIBUTABLE COMPONENTS by your end-user customers; (f) you must use the setup utility included with the REDISTRIBUTABLE COMPONENTS to install the Redistributable Code; (g) you do not use Microsoft's name, logo, or trademarks to market your Application; (h) you include all copyright and trademark notices contained in the REDISTRIBUTABLE COMPONENTS; (i) you include a valid copyright notice on your Application; and (j) you agree to indemnify, hold harmless, and defend Microsoft from any against any claims or lawsuits, including attorneys' feeds, that arise or result from the use or distribution of your Application. - -If you distribute the Redistributable Code separately for use with your Application (such as on your web site or as part of an update to your Application), you must include an end user license agreement in the install program for the Redistributable Code in the form of \license\directx end user eula.txt. Contact Microsoft for the applicable royalties due and other licensing terms for all other uses and/or distribution of the REDISTRIBUTABLE COMPONENTS. - -2. COPYRIGHT. - -All title and intellectual property rights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text and "applets," incorporated into the SOFTWARE PRODUCT), any accompanying printed materials, and any copies of the SOFTWARE PRODUCT, are owned by Microsoft or its suppliers. All title and intellectual property rights in and to the content which may by accessed through use of the SOFTWARE PRODUCT is the property of the respective content owner and may be protected by applicable copyright or other intellectual property laws and treaties . This EULA grants you no rights to use such content. If this SOFTWARE PRODUCT contains documentation which is provided only in electronic form, you may print one copy of such electronic documentation. You may not copy the printed materials accompanying the SOFTWARE PRODUCT. All rights not expressly granted are reserved by Microsoft. - -3. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. - -a. Limitations on Reverse Engineering, Decompilation and Disassembly. You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. - -b. Rental. You may not rent, lease or lend the SOFTWARE PRODUCT. - -c. Support Services. Microsoft may provide you with support services related to the SOFTWARE PRODUCT ("Support Services"). Use of the Support Services is governed by the Microsoft policies and programs described in the user manual, in "on line" documentation and/or other Microsoft-provided materials. Any supplemental software code provided to you as part of the Support Services shall be considered part of the SOFTWARE PRODUCT and subject to the terms and conditions of this EULA. With respect to technical information you provide to Microsoft as part of the Support Services, Microsoft may use such information for its business purposes, including for product support and development. Microsoft will not utilize such technical information in a form that personally identifies you. - -d. Software Transfer. The initial user of the SOFTWARE PRODUCT may make a one-time permanent transfer of this EULA and SOFTWARE PRODUCT only directly to an end-user. This transfer must include all of the SOFTWARE PRODUCT (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity). Such transfer may not be by way of consignment or any other indirect transfer. The transferee of such one-time transfer must agree to comply with the terms of this EULA, including the obligation not to further transfer this EULA and SOFTWARE PRODUCT. - -e. Termination. Without prejudice to any other rights, Microsoft may cancel this EULA if you do not abide with the terms and conditions of this EULA, in which case, you must cease all use or distribution and destroy all copies of the SOFTWARE PRODUCT and all of its component parts. - -4. U.S. GOVERNMENT RESTRICTED RIGHTS. -All SOFTWARE PRODUCT provided to the U.S. Government pursuant to solicitations issued on or after December 1, 1995 is provided with the commercial license rights and restrictions described elsewhere herein. All SOFTWARE PRODUCT provided to the U.S. Government pursuant to solicitations issued prior to December 1, 1995 is provided with "Restricted Rights" as provided for in FAR, 48 CFR 52.227-14 (JUNE 1987) or DFAR, 48 CFR 252.227-7013 (OCT 1988), as applicable. The reseller is responsible for ensuring SOFTWARE PRODUCT is marked with the "Restricted Rights Notice" or "Restricted Rights Legend", as required. All rights not expressly granted are reserved. - -5. EXPORT RESTRICTIONS. - You acknowledge that the SOFTWARE PRODUCT is of U.S.-origin. You agree to comply with all applicable international and national laws that apply to these products, including the U.S. Export Administration Regulations, as well as end-user, end-use and country destination restrictions issued by U.S. and other governments. For additional information see http://www.microsoft.com/exporting/. -6. DISCLAIMER OF WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND ITS SUPPLIERS PROVIDE TO YOU THE SOFTWARE PRODUCT AND SUPPORT SERVICES (IF ANY) AS IS AND WITH ALL FAULTS; AND HEREBY DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) WARRANTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF LACK OF VIRUSES, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, AND OF LACK OF NEGLIGENCE OR LACK OF WORKMANLIKE EFFORT, ALL WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, AND CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SOFTWARE PRODUCT. - -7. EXCULSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY (INCLUDING OF GOOD FAITH OR OF REASONABLE CARE), FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT, THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THIS EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, BREACH OF CONTRACT OR BREACH OF WARRANTY OF MICROSOFT OR ANY SUPPLIER, AND EVEN IF MICROSOFT OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -8. LIMITATION OF LIABILITY AND REMEDIES. NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER (INCLUDING, WITHOUT LIMITATION, ALL DAMAGES REFERENCED ABOVE AND ALL DIRECT OR GENERAL DAMAGES), THE ENTIRE LIABILITY OF MICROSOFT AND ANY OF ITS SUPPLIERS UNDER ANY PROVISION OF THIS EULA AND YOUR EXCLUSIVE REMEDY FOR ALL OF THE FOREGOING SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE PRODUCT OR U.S.$5.00. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS DESCRIBED ABOVE SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS ITS ESSENTIAL PURPOSE. - -9. APPLICABLE LAW. If you acquired this SOFTWARE PRODCUT in the United States, this EULA is governed by the laws of the State of Washington. - -If you acquired this SOFTWARE PRODUCT in Canada, this EULA is governed by the laws of the Province of Ontario, Canada. Each of the parties hereto irrevocably attorns to the jurisdiction of the courts of the Province of Ontario and further agrees to commence any litigation which may arise hereunder in the courts located in the Judicial District of York, Province of Ontario. - -If this product was acquired outside the United States, then local law may apply. -10. QUESTIONS? Should you have any questions concerning this Agreement, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399. - - diff --git a/import/DirectX8/doc/DirectXEULAs/directx redist.txt b/import/DirectX8/doc/DirectXEULAs/directx redist.txt deleted file mode 100644 index 489c14a9c..000000000 --- a/import/DirectX8/doc/DirectXEULAs/directx redist.txt +++ /dev/null @@ -1,19 +0,0 @@ -DirectX Software Development Kit Redistributable Code -------------------------------------------------------------- -Redistributable Code is identified as all of the files in the following -directory on the DirectX 8.0 SDK CD: - - redist/directx8/ - -All files in the above directory must be included in any distribution of -the DirectX 8.0 Redistributable Code with the exception of the Broadcast -Driver Architecture cab files: - - bda.cab - bdant.cab - -Both of which are considered optional DirectX 8.0 redistributable -components and can be removed from your distribution of the DirectX -8.0 redistributable components. - - diff --git a/import/DirectX8/include/DShow.h b/import/DirectX8/include/DShow.h deleted file mode 100644 index 54b6fbfb2..000000000 --- a/import/DirectX8/include/DShow.h +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DShow.h -// -// Desc: DirectShow top-level include file -// -// Copyright (c) 2000-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - -#ifndef __DSHOW_INCLUDED__ -#define __DSHOW_INCLUDED__ - -/////////////////////////////////////////////////////////////////////////// -// Set up constants & pragmas for the compiler -/////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// disable some level-4 warnings, use #pragma warning(default:###) to re-enable -#pragma warning(disable:4100) // warning C4100: unreferenced formal parameter -#pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union -#pragma warning(disable:4511) // warning C4511: copy constructor could not be generated -#pragma warning(disable:4512) // warning C4512: assignment operator could not be generated -#pragma warning(disable:4514) // warning C4514: "unreferenced inline function has been removed" - -#if _MSC_VER>=1100 -#define AM_NOVTABLE __declspec(novtable) -#else -#define AM_NOVTABLE -#endif -#endif // MSC_VER - -/////////////////////////////////////////////////////////////////////////// -// Include standard Windows files -/////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include - -#ifndef NUMELMS - #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) -#endif - -/////////////////////////////////////////////////////////////////////////// -// Include DirectShow include files -/////////////////////////////////////////////////////////////////////////// -#include // Generated IDL header file for streams interfaces -#include // ActiveMovie video interfaces and definitions -#include // ActiveMovie audio interfaces and definitions -#include // generated from control.odl -#include // event code definitions -#include // declaration of type GUIDs and well-known clsids -#include // HRESULT status and error definitions -#include // External device control interface defines -#include // audio filter device error event codes -#include // DVD error event codes - -/////////////////////////////////////////////////////////////////////////// -// Define OLE Automation constants -/////////////////////////////////////////////////////////////////////////// -#ifndef OATRUE -#define OATRUE (-1) -#endif // OATRUE -#ifndef OAFALSE -#define OAFALSE (0) -#endif // OAFALSE - -/////////////////////////////////////////////////////////////////////////// -// Define Win64 interfaces if not already defined -/////////////////////////////////////////////////////////////////////////// - -// InterlockedExchangePointer -#ifndef InterlockedExchangePointer -#define InterlockedExchangePointer(Target, Value) \ - (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) -#endif - - -#endif // __DSHOW_INCLUDED__ diff --git a/import/DirectX8/include/DShowIDL/amstream.idl b/import/DirectX8/include/DShowIDL/amstream.idl deleted file mode 100644 index 2d3bec9f8..000000000 --- a/import/DirectX8/include/DShowIDL/amstream.idl +++ /dev/null @@ -1,336 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMStream.idl -// -// Desc: -// -// Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "mmstream.idl"; -import "strmif.idl"; - -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") - - - -interface IAMMultiMediaStream; -interface IAMMediaStream; -interface IMediaStreamFilter; -interface IDirectDraw; -interface IDirectDrawSurface; -interface IAMMediaTypeStream; -interface IAMMediaTypeSample; - -// Flags definitions for IAMMultiMediaStream::Initialize -enum { - AMMSF_NOGRAPHTHREAD = 0x00000001 -}; - -// Flags definitions for AddMediaStream and IAMMediaStream::Initialize -enum { - // Don't add a stream - create a default renderer instead - // for the supplied purpose id - AMMSF_ADDDEFAULTRENDERER = 0x00000001, - AMMSF_CREATEPEER = 0x00000002, - - // If no samples are created when we run or the last sample - // is deleted then terminate this stream - AMMSF_STOPIFNOSAMPLES = 0x00000004, - - // If Update is not called keep going - AMMSF_NOSTALL = 0x00000008 -}; - - -// Flag definitions for OpenFile and OpenMoniker -enum { - AMMSF_RENDERTYPEMASK = 0x00000003, - AMMSF_RENDERTOEXISTING = 0x00000000, - AMMSF_RENDERALLSTREAMS = 0x00000001, - AMMSF_NORENDER = 0x00000002, - - AMMSF_NOCLOCK = 0x00000004, - AMMSF_RUN = 0x00000008 -}; - - -typedef [v1_enum] enum { - Disabled = 0, - ReadData = 1, - RenderData = 2 -} OUTPUT_STATE; - - -[ -object, -uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D), -dual, -helpstring("IDirectShowStream Interface"), -pointer_default(unique) -] -interface IDirectShowStream : IDispatch -{ - [propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal); - [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal); - [propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal); - [propput, id(2), helpstring("propetry Video")] HRESULT Video([in] OUTPUT_STATE newVal); - [propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal); - [propput, id(3), helpstring("propetry Audio")] HRESULT Audio([in] OUTPUT_STATE newVal); -}; - - -// IAMMultiMediaStream interface -[ -object, -uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IAMMultiMediaStream : IMultiMediaStream -{ - HRESULT Initialize( - [in] STREAM_TYPE StreamType, - [in] DWORD dwFlags, - [in] IGraphBuilder *pFilterGraph); - - HRESULT GetFilterGraph( - [out] IGraphBuilder **ppGraphBuilder); - - HRESULT GetFilter( - [out] IMediaStreamFilter **ppFilter); - - HRESULT AddMediaStream( - [in] IUnknown *pStreamObject, - [in] const MSPID *PurposeId, - [in] DWORD dwFlags, - [out] IMediaStream **ppNewStream); - - HRESULT OpenFile( - [in] LPCWSTR pszFileName, - [in] DWORD dwFlags); - - HRESULT OpenMoniker( - [in] IBindCtx *pCtx, - [in] IMoniker *pMoniker, - [in] DWORD dwFlags); - - HRESULT Render( - [in] DWORD dwFlags); -} - - -// IAMMediaStream interface -[ -object, -uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IAMMediaStream : IMediaStream -{ - HRESULT Initialize( - [in] IUnknown *pSourceObject, - [in] DWORD dwFlags, - [in] REFMSPID PurposeId, - [in] const STREAM_TYPE StreamType); - - HRESULT SetState( - [in] FILTER_STATE State); - - HRESULT JoinAMMultiMediaStream( - [in] IAMMultiMediaStream *pAMMultiMediaStream); - - HRESULT JoinFilter( - [in] IMediaStreamFilter *pMediaStreamFilter); - - HRESULT JoinFilterGraph( - [in] IFilterGraph *pFilterGraph); -}; - - - - -// IMediaStreamFilter interface -[ -object, -local, -uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IMediaStreamFilter : IBaseFilter -{ - HRESULT AddMediaStream( - [in] IAMMediaStream *pAMMediaStream); - - HRESULT GetMediaStream( - [in] REFMSPID idPurpose, - [out] IMediaStream **ppMediaStream); - - HRESULT EnumMediaStreams( - [in] long Index, - [out] IMediaStream **ppMediaStream); - - HRESULT SupportSeeking( - [in] BOOL bRenderer); - - HRESULT ReferenceTimeToStreamTime( - [in] [out] REFERENCE_TIME *pTime); - - HRESULT GetCurrentStreamTime( - [out] REFERENCE_TIME *pCurrentStreamTime); - - HRESULT WaitUntil( - [in] REFERENCE_TIME WaitStreamTime); - - HRESULT Flush( - [in] BOOL bCancelEOS); - - HRESULT EndOfStream(); -}; - - - -[ -object, -local, -uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D), -pointer_default(unique) -] -interface IDirectDrawMediaSampleAllocator : IUnknown -{ - HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw); -}; - - -[ -object, -local, -uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D), -pointer_default(unique) -] -interface IDirectDrawMediaSample : IUnknown -{ - HRESULT GetSurfaceAndReleaseLock( - [out] IDirectDrawSurface **ppDirectDrawSurface, - [out] RECT * pRect); - HRESULT LockMediaSamplePointer(void); -}; - - - - - -[ -object, -local, -uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D), -pointer_default(unique) -] - -interface IAMMediaTypeStream : IMediaStream -{ - HRESULT GetFormat( - [out] AM_MEDIA_TYPE * pMediaType, - [in] DWORD dwFlags); - - HRESULT SetFormat( - [in] AM_MEDIA_TYPE * pMediaType, - [in] DWORD dwFlags); - - HRESULT CreateSample( - [in] long lSampleSize, - [in] BYTE * pbBuffer, - [in] DWORD dwFlags, - [in] IUnknown *pUnkOuter, - [out] IAMMediaTypeSample ** ppAMMediaTypeSample); - - HRESULT GetStreamAllocatorRequirements( - [out] ALLOCATOR_PROPERTIES *pProps); - - HRESULT SetStreamAllocatorRequirements( - [in] ALLOCATOR_PROPERTIES *pProps); -}; - - -[ -object, -local, -uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D), -pointer_default(unique) -] -interface IAMMediaTypeSample : IStreamSample -{ - // - // Unique methods for IAMMediaTypeSample - // - HRESULT SetPointer([in] BYTE *pBuffer, [in] long lSize); - - // - // Mirror of IMediaSample - // - HRESULT GetPointer([out] BYTE ** ppBuffer); - long GetSize(void); - HRESULT GetTime([out] REFERENCE_TIME * pTimeStart, [out] REFERENCE_TIME * pTimeEnd); - HRESULT SetTime([in] REFERENCE_TIME * pTimeStart, [in] REFERENCE_TIME * pTimeEnd); - HRESULT IsSyncPoint(void); - HRESULT SetSyncPoint(BOOL bIsSyncPoint); - HRESULT IsPreroll(void); - HRESULT SetPreroll(BOOL bIsPreroll); - long GetActualDataLength(void); - HRESULT SetActualDataLength(long); - HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType); - HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType); - HRESULT IsDiscontinuity(void); - HRESULT SetDiscontinuity(BOOL bDiscontinuity); - HRESULT GetMediaTime([out] LONGLONG * pTimeStart, [out] LONGLONG * pTimeEnd); - HRESULT SetMediaTime([in] LONGLONG * pTimeStart, [in] LONGLONG * pTimeEnd); -}; - - -[ - uuid(4E6CDE29-C0C4-11d0-8FF1-00C04FD9189D), - version(1.0), - helpstring("DirectShowStream 1.0 Type Library") -] - -library DirectShowStreamLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(49c47ce5-9ba4-11d0-8212-00c04fc32c45), - helpstring("DirectShow Multi Media Stream") - ] - coclass AMMultiMediaStream - { - [default] dispinterface IDirectShowStream; - }; -}; - - - -// -// The MIDL compiler wants to produce a CLSID for everything defined in -// our type library, but it also wants to generate huge proxy code, -// so we use DEFINE_GUID for all other classes. It has another interesting -// bug in that it defines CLSID_AMMultiMediaStream within a #ifdef __cplusplus -// block, so we need to define it outside of that scope. -// - -cpp_quote("#ifndef __cplusplus") -cpp_quote("EXTERN_C const CLSID CLSID_AMMultiMediaStream;") -cpp_quote("#endif") - -cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream, /* 49c47ce4-9ba4-11d0-8212-00c04fc32c45 */") -cpp_quote("0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);") -cpp_quote("DEFINE_GUID(CLSID_AMAudioStream, /* 8496e040-af4c-11d0-8212-00c04fc32c45 */") -cpp_quote("0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);") -cpp_quote("DEFINE_GUID(CLSID_AMAudioData, /* f2468580-af8a-11d0-8212-00c04fc32c45 */") -cpp_quote("0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);") -cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream, /* CF0F2F7C-F7BF-11d0-900D-00C04FD9189D */") -cpp_quote("0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0xd, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);") diff --git a/import/DirectX8/include/DShowIDL/amvpe.idl b/import/DirectX8/include/DShowIDL/amvpe.idl deleted file mode 100644 index 95e77c429..000000000 --- a/import/DirectX8/include/DShowIDL/amvpe.idl +++ /dev/null @@ -1,170 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMVPE.idl -// -// Desc: -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "objidl.idl"; // for IPersist (IFilter's root) - - -/* - * VIDOESIGNALINFO - */ -typedef struct _VIDEOSIGNALINFO -{ - DWORD dwSize; // Size of the structure - DWORD dwVREFHeight; // Specifies the number of lines of data in the vref - BOOL bDoubleClock; // videoport should enable double clocking - BOOL bVACT; // videoport should use an external VACT signal - BOOL bInterlaced; // Indicates that the signal is interlaced - BOOL bHalfline; // Device will write half lines into the frame buffer - BOOL bInvertedPolarity; // Devoce inverts the polarity by default -} AMVIDEOSIGNALINFO; - -typedef struct AMVIDEOSIGNALINFO *LPAMVIDEOSIGNALINFO; - - -interface IVPEConfig; -interface IVPE; - - -/* - * DDVIDEOPORTCONNECT - */ -typedef struct _DDVIDEOPORTCONNECT -{ - DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure - GUID guidTypeID; // Description of video port connection - DWORD dwPortWidth; // Width of the video port - DWORD dwFlags; // Connection flags -} DDVIDEOPORTCONNECT; - -typedef DDVIDEOPORTCONNECT *LPDDVIDEOPORTCONNECT; - - - -/* - * DDPIXELFORMAT - */ -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel (BD_1,2,4,8,16,24,32) - DWORD dwYUVBitCount; // how many bits per pixel (BD_4,8,16,24,32) - DWORD dwZBufferBitDepth; // how many bits for z buffers (BD_8,16,24,32) - DWORD dwAlphaBitDepth; // how many bits for alpha channels (BD_1,2,4,8) - }; - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - }; - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - }; - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - }; - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - }; -} DDPIXELFORMAT; - -typedef DDPIXELFORMAT * LPDDPIXELFORMAT; - - -[ -object, -uuid(BC29A660-30E3-11d0-9E69-00C04FD7C15B), -pointer_default(unique) -] - -interface IVPEConfig : IUnknown { - - // gets the various connection information structures (guid, portwidth) - // in an array of structures. If the pointer to the array is NULL, first - // parameter returns the total number of formats supported. - HRESULT GetConnectInfo( - [in,out] LPDWORD lpNumConnectInfo, - [out] LPDDVIDEOPORTCONNECT lpddvpConnectInfo - ); - - HRESULT SetConnectInfo( - [in] DDVIDEOPORTCONNECT ddvpConnectInfo - ); - - // gets the various formats supported by the decoder in an array - // of structures. If the pointer to the array is NULL, first parameter - // returns the total number of formats supported. - HRESULT GetVideoFormats( - [in,out] LPDWORD lpNumFormats, - [out] LPDDPIXELFORMAT lpddpfFormats - ); - - // retrives maximum pixels per second rate expected for a given - // format and a given scaling factor. If decoder does not support - // those scaling factors, then it gives the rate and the nearest - // scaling factors. - HRESULT GetMaxPixelRate( - [in] DDPIXELFORMAT ddpfFormat, - [in,out] LPDWORD lpdwZoomHeight, - [in,out] LPDWORD lpdwZoomWidth, - [out] LPDWORD lpdwMaxPixelsPerSecond - ); - - // retrives various properties of the decoder for a given format - HRESULT GetVideoSignalInfo( - [in] DDPIXELFORMAT ddpfFormat, - [out] LPAMVIDEOSIGNALINFO lpAMVideoSignalInfo - ); - - // asks the decoder to ouput in this format. Return value should give - // appropriate error code - HRESULT SetVideoFormat( - [in] DDPIXELFORMAT ddpfFormat - ); - - // asks the decoder to treat even fields like odd fields and visa versa - HRESULT SetInvertPolarity( - ); - - // sets the scaling factors. If decoder does not support these, - // then it sets the values to the nearest factors it can support - HRESULT SetScalingFactors( - [in,out] LPDWORD lpdwZoomHeight, - [in,out] LPDWORD lpdwZoomWidth - ); - - } - - - -[ -object, -uuid(BC29A661-30E3-11d0-9E69-00C04FD7C15B), -pointer_default(unique) -] - -interface IVPE : IUnknown { - HRESULT SetOverlaySurface( - [in] LPUNKNOWN lpOverlaySurface, - [in] INT iNumBackBuffers - ); - -} diff --git a/import/DirectX8/include/DShowIDL/austream.idl b/import/DirectX8/include/DShowIDL/austream.idl deleted file mode 100644 index 008853901..000000000 --- a/import/DirectX8/include/DShowIDL/austream.idl +++ /dev/null @@ -1,106 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AuStream.idl -// -// Desc: Used by MIDL tool to generate austream.h -// -// Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "mmstream.idl"; - -cpp_quote("//") -cpp_quote("// The following declarations within the 'if 0' block are dummy typedefs used to make") -cpp_quote("// the ddstream.idl file build. The actual definitions are contained in DDRAW.H") -cpp_quote("//") -cpp_quote("#if 0") -typedef struct tWAVEFORMATEX WAVEFORMATEX; -cpp_quote ("#endif") - -interface IAudioMediaStream; -interface IAudioStreamSample; -interface IMemoryData; -interface IAudioData; - -// IAudioMediaStream - - -[ -object, -local, -uuid(f7537560-a3be-11d0-8212-00c04fc32c45), -pointer_default(unique) -] -interface IAudioMediaStream : IMediaStream -{ - - HRESULT GetFormat( - [out] WAVEFORMATEX *pWaveFormatCurrent - ); - - HRESULT SetFormat( - [in] const WAVEFORMATEX *lpWaveFormat); - - HRESULT CreateSample( - [in] IAudioData *pAudioData, - [in] DWORD dwFlags, - [out] IAudioStreamSample **ppSample - ); -} - -[ -object, -local, -uuid(345fee00-aba5-11d0-8212-00c04fc32c45), -pointer_default(unique) -] -interface IAudioStreamSample : IStreamSample -{ - HRESULT GetAudioData( - [out] IAudioData **ppAudio - ); -} - - -[ -object, -local, -uuid(327fc560-af60-11d0-8212-00c04fc32c45), -pointer_default(unique) -] -interface IMemoryData : IUnknown -{ - HRESULT SetBuffer( - [in] DWORD cbSize, - [in] BYTE *pbData, - [in] DWORD dwFlags - ); - - HRESULT GetInfo( - [out] DWORD *pdwLength, - [out] BYTE **ppbData, - [out] DWORD *pcbActualData - ); - HRESULT SetActual( - [in] DWORD cbDataValid - ); -} - -[ -object, -local, -uuid(54c719c0-af60-11d0-8212-00c04fc32c45), -pointer_default(unique) -] -interface IAudioData : IMemoryData -{ - HRESULT GetFormat( - [out] WAVEFORMATEX *pWaveFormatCurrent - ); - - HRESULT SetFormat( - [in] const WAVEFORMATEX *lpWaveFormat - ); -} - diff --git a/import/DirectX8/include/DShowIDL/axcore.idl b/import/DirectX8/include/DShowIDL/axcore.idl deleted file mode 100644 index bb8e1a261..000000000 --- a/import/DirectX8/include/DShowIDL/axcore.idl +++ /dev/null @@ -1,1284 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AXCore.idl -// -// Desc: Core streaming interfaces. Other ActiveMovie-only interfaces -// are in AXExtend.idl. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// include unknwn.idl and objidl.idl first - -#define CHARS_IN_GUID 39 // 128 bits, plus { - } punctuation and terminal null - // chars NOT BYTES in the standard representation - // e.g. {D3588AB0-0781-11ce-B03A-0020AF0BA770} + null - -cpp_quote("#define CHARS_IN_GUID 39") - - -//===================================================================== -//===================================================================== -// media types & formats -//===================================================================== -//===================================================================== - -// There is a high-level media type (audio, compressed video, -// mpeg video, midi). Within each type, there is a subtype (cinepak, pcm) -// and a length+untyped data block defining the format in a -// type-specific manner. EG for video/cinepak, the data block would be -// a bitmapinfo. -// The contents of the format block are defined by the formattype GUID. -// For example, FORMAT_VideoInfo, FORMAT_WaveFormatEx. In the future, this -// may be a pointer to an object supporting property style interfaces -// in which case the GUID may be something like FORMAT_IUnknown. When -// you are passed a media type you should check the format type, if -// it isn't a type you recognize, then don't touch the format block - -typedef struct _AMMediaType { - GUID majortype; - GUID subtype; - BOOL bFixedSizeSamples; - BOOL bTemporalCompression; - ULONG lSampleSize; - GUID formattype; - IUnknown *pUnk; - ULONG cbFormat; - [size_is(cbFormat)] BYTE * pbFormat; -} AM_MEDIA_TYPE; - -//===================================================================== -//===================================================================== -// pin information -//===================================================================== -//===================================================================== - -// is this an input or output pin -typedef enum _PinDirection { - PINDIR_INPUT, - PINDIR_OUTPUT -} PIN_DIRECTION; - -// other types that need defining -#define MAX_PIN_NAME 128 -cpp_quote("#define MAX_PIN_NAME 128") -cpp_quote("#define MAX_FILTER_NAME 128") -#define MAX_FILTER_NAME 128 - - -//===================================================================== -//===================================================================== -// time information -// -// This represents a time (either reference or stream) in 100ns units. -// The class library contains a CRefTime helper class -// that supports simple comparison and arithmetic operations -//===================================================================== -//===================================================================== - -typedef LONGLONG REFERENCE_TIME; -typedef double REFTIME; - -// Win32 HANDLEs have to be cast to these as the MIDL compiler doesn't -// like the HANDLE type or in fact anything remotely associated with -// them. If this ever gets ported to a MAC environment then these will -// have to become an alertable synchronisation object that it supports - -typedef DWORD_PTR HSEMAPHORE; -typedef DWORD_PTR HEVENT; - -//===================================================================== -//===================================================================== -// Allocator properties -// -// Used to describe the actual properties of an allocator, -// and used to request properties from an allocator or from an upstream -// filter that could create an allocator. See IMemAllocator and -// IMemInputPin. -//===================================================================== -//===================================================================== -typedef struct _AllocatorProperties { - long cBuffers; // count of buffers at this allocator - long cbBuffer; // size of each buffer, excluding any prefix - - // alignment of the buffer - buffer start will be aligned on a multiple of - // this amount - long cbAlign; - - // prefix amount. Each buffer is immediately preceeded by cbPrefix bytes. - // note that GetPointer points to the beginning of the buffer proper. - // the prefix is aligned, i.e. (GetPointer() - cbPrefix) is aligned on cbAlign. - long cbPrefix; -} ALLOCATOR_PROPERTIES; - - - - - -// forward declarations (in alphabetical order - we were getting duplicates) -interface IAMovieSetup; -interface IEnumFilters; -interface IEnumMediaTypes; -interface IEnumPins; -interface IBaseFilter; -interface IFilterGraph; -interface IMediaFilter; -interface IMediaSample; -interface IMemAllocator; -interface IMemAllocatorCallbackTemp; -interface IMemAllocatorNotifyCallbackTemp; -interface IMemInputPin; -interface IPin; -interface IReferenceClock; - - - -//===================================================================== -//===================================================================== -// Defines IPin interface -// -// interface representing a single, unidirection connection point on a -// filter. A Pin will connect to exactly one other pin on another filter. -// This interface represents the interface other objects can call on -// this pin. The interface between the filter and the pin is private to -// the implementation of a specific filter. -// -// During the connection process, one pin will be instructed to take -// the lead: the connect interface on this pin will be calling, passing -// the IPin* for the other pin. This connecting pin will call the -// ReceiveConnection member function on the other pin, as well as presumably -// other format-enumeration and queryinterface calls to establish whether -// the connection is possible. -//===================================================================== -//===================================================================== - -[ -object, -uuid(56a86891-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IPin : IUnknown { - - // initiate a connection to another pin. calls ReceiveConnection on the - // other pin. Verifies that the connection is possible and may reject - // it. - // The mediatype parameter is optional. If it is not null, the pin must - // connect using that media type if possible. The subtype and/or format - // type can be GUID_NULL, meaning that the pin can fill them in as desired. - // This allows an application to partially specify the media type to be - // used for the connection, insisting on eg YUV 422 but leaving details - // (such as the image size) to be negotiated between the pins. - HRESULT Connect( - [in] IPin * pReceivePin, // connect yourself to this pin - [in] const AM_MEDIA_TYPE * pmt // (optional) connect using this type - ); - - // called by a connecting pin to make a connection - HRESULT ReceiveConnection( - [in] IPin * pConnector, - [in] const AM_MEDIA_TYPE *pmt // this is the media type we will exchange - ); - - // break a connection - no params since there is only one connection - // possible on this pin - HRESULT Disconnect(void); - - // Find the pin this pin is connected to (if any) - // The pointer returned is AddRef()d - // Fails if the pin is not connected - HRESULT ConnectedTo( - [out] IPin **pPin - ); - - // Return the media type of a connection if the pin is connected - HRESULT ConnectionMediaType( - [out] AM_MEDIA_TYPE *pmt - ); - - // get information about the pin itself - typedef struct _PinInfo { - IBaseFilter *pFilter; // the filter this pin is on - PIN_DIRECTION dir; // am I an input or output pin? - WCHAR achName[MAX_PIN_NAME]; // the name of this pin within this filter - } PIN_INFO; - - HRESULT QueryPinInfo( - [out] PIN_INFO * pInfo - ); - - // We often want to know the direction. Rather than use the - // relatively expensive QueryPinInfo, use this - HRESULT QueryDirection( - [out] PIN_DIRECTION *pPinDir - ); - - // Get an identifier for the pin (allows connections to be saved). - // The storage will be allocated by the filter using CoTaskMemAlloc - // The caller should free it using CoTaskMemFree - HRESULT QueryId( - [out] LPWSTR * Id - ); - - // will the pin accept the format type, S_OK yes, S_FALSE no - HRESULT QueryAccept( - [in] const AM_MEDIA_TYPE *pmt - ); - - // return an enumerator for this pin's preferred media types - HRESULT EnumMediaTypes( - [out] IEnumMediaTypes **ppEnum - ); - - // return an array of IPin* - the pins that this pin internally connects to - // All pins put in the array must be AddReffed (but no others) - // Errors: "Can't say" - FAIL; not enough slots - return S_FALSE - // Default: return E_NOTIMPL - // The filter graph will interpret E_NOTIMPL as any input pin connects to - // all visible output pins and vise versa. - // apPin can be NULL if nPin==0 (not otherwise). - HRESULT QueryInternalConnections( - [out] IPin* *apPin, // array of IPin* - [in, out] ULONG *nPin // on input, the number of slots - // on output the number of pins - ); - - // notify the pin that no more data is expected until a new run - // command is issued. End of stream should be queued and delivered after - // all queued data is delivered. Pass through if there is no queued data. - // Flush should flush any queued EOS. - // returns S_OK unless there is some error. - // input pins only: output pins will normally return E_UNEXPECTED. - HRESULT EndOfStream(void); - - // Flush - - // Enter flush state: do the following steps (in order) - // -- prevent any more Receives succeeding (set a flushing flag) - // -- discard any queued data - // -- free anyone blocked on Receive in your filter - // -- pass BeginFlush to any downstream pins - HRESULT BeginFlush(void); - - // End flush state: do the following steps in order - // -- ensure no more data will be pushed by your filter - // (sync with thread if you have one, stop it pushing and - // discard any queued data) - // -- re-enable Receive (clear internal flushing flag) - // -- pass EndFlush to any downstream pins - HRESULT EndFlush(void); - - // informational: all data arriving after this call is part of a segment - // from StartTime to StopTime, played at rate. This allows filters that - // process buffers containing more than one sample to clip the rendering - // to within the start and stop times. - // - // A source pin will call a destination pin on this method after completing - // delivery of any previous data, and before any Receive calls for the - // new data - HRESULT NewSegment( - [in] REFERENCE_TIME tStart, - [in] REFERENCE_TIME tStop, - [in] double dRate); -} - -typedef IPin *PPIN; - - -//===================================================================== -//===================================================================== -// Defines IEnumPins interface -// -// interface returned from IBaseFilter::EnumPins(). based on IEnumXXXX -//===================================================================== -//===================================================================== - -[ -object, -uuid(56a86892-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IEnumPins : IUnknown { - - HRESULT Next( - [in] ULONG cPins, // place this many pins... - [out, size_is(cPins)] IPin ** ppPins, // ...in this array - [out] ULONG * pcFetched // actual count passed - ); - - HRESULT Skip( - [in] ULONG cPins); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumPins **ppEnum - ); -} - -typedef IEnumPins *PENUMPINS; - - -//===================================================================== -//===================================================================== -// Defines IEnumMediaTypes interface -// -// Enumerates the preferred formats for a pin -//===================================================================== -//===================================================================== - -[ -object, -uuid(89c31040-846b-11ce-97d3-00aa0055595a), -pointer_default(unique) -] -interface IEnumMediaTypes : IUnknown { - - // to call this member function pass in the address of a pointer to a - // media type. The interface will allocate the necessary AM_MEDIA_TYPE - // structures and initialise them with the variable format block - - HRESULT Next( - [in] ULONG cMediaTypes, // place this many types... - [out, size_is(cMediaTypes)] - AM_MEDIA_TYPE ** ppMediaTypes, // ...in this array - [out] ULONG * pcFetched // actual count passed - ); - - HRESULT Skip( - [in] ULONG cMediaTypes); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumMediaTypes **ppEnum - ); -} - -typedef IEnumMediaTypes *PENUMMEDIATYPES; - - - -//======================================================================== -//======================================================================== -// Defines IFilterGraph interface -// -// abstraction representing a graph of filters -// This allows filters to be joined into a graph and operated as a unit. -//======================================================================== -//======================================================================== - -[ -object, -uuid(56a8689f-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IFilterGraph : IUnknown { - - //========================================================================== - // Low level filter functions - //========================================================================== - - // Add a filter to the graph and name it with *pName. - // If the name is not unique, The request will fail. - // The Filter graph will call the JoinFilterGraph - // member function of the filter to inform it. - // This must be called before attempting Connect, ConnectDirect or Render - // for pins of the filter. - - HRESULT AddFilter - ( [in] IBaseFilter * pFilter, - [in, string] LPCWSTR pName - ); - - - // Remove a filter from the graph. The filter graph implementation - // will inform the filter that it is being removed. - - HRESULT RemoveFilter - ( [in] IBaseFilter * pFilter - ); - - - // Set *ppEnum to be an enumerator for all filters in the graph. - - HRESULT EnumFilters - ( [out] IEnumFilters **ppEnum - ); - - - // Set *ppFilter to be the filter which was added with the name *pName - // Will fail and set *ppFilter to NULL if the name is not in this graph. - - HRESULT FindFilterByName - ( [in, string] LPCWSTR pName, - [out] IBaseFilter ** ppFilter - ); - - //========================================================================== - // Low level connection functions - //========================================================================== - - // Connect these two pins directly (i.e. without intervening filters) - // the media type is optional, and may be partially specified (that is - // the subtype and/or format type may be GUID_NULL). See IPin::Connect - // for details of the media type parameter. - HRESULT ConnectDirect - ( [in] IPin * ppinOut, // the output pin - [in] IPin * ppinIn, // the input pin - [in, unique] const AM_MEDIA_TYPE* pmt // optional mediatype - ); - - // Break the connection that this pin has and reconnect it to the - // same other pin. - - HRESULT Reconnect - ( [in] IPin * ppin // the pin to disconnect and reconnect - ); - - - - // Disconnect this pin, if connected. Successful no-op if not connected. - - HRESULT Disconnect - ( [in] IPin * ppin - ); - - //========================================================================== - // intelligent connectivity - now in IGraphBuilder, axextend.idl - //========================================================================== - - //========================================================================== - // Whole graph functions - //========================================================================== - - // Once a graph is built, it can behave as a (composite) filter. - // To control this filter, QueryInterface for IMediaFilter. - - // The filtergraph will by default ensure that the graph has a sync source - // when it is made to Run. SetSyncSource(NULL) will prevent that and allow - // all the filters to run unsynchronised until further notice. - // SetDefaultSyncSource will set the default sync source (the same as would - // have been set by default on the first call to Run). - HRESULT SetDefaultSyncSource(void); - -} - -typedef IFilterGraph *PFILTERGRAPH; - - - -//========================================================================== -//========================================================================== -// Defines IEnumFilters interface -// -// enumerator interface returned from IFilterGraph::EnumFilters(). -// based on IEnum pseudo-template -//========================================================================== -//========================================================================== - -[ -object, -uuid(56a86893-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IEnumFilters : IUnknown { - - HRESULT Next - ( [in] ULONG cFilters, // place this many filters... - [out] IBaseFilter ** ppFilter, // ...in this array of IBaseFilter* - [out] ULONG * pcFetched // actual count passed returned here - ); - - - HRESULT Skip - ( [in] ULONG cFilters - ); - - - HRESULT Reset(void); - - - HRESULT Clone - ( [out] IEnumFilters **ppEnum - ); -} - -typedef IEnumFilters *PENUMFILTERS; - - -//===================================================================== -//===================================================================== -// Defines IMediaFilter interface -// -// multimedia components that provide time-based data will expose this. -// this interface abstracts an object that processes time-based data streams -// and represents a multimedia device (possibly implemented in software). -// it controls the active/running state of the object and its synchronization -// to other objects in the system. -// -// derived from IPersist so that all filter-type objects in a graph -// can have their class id serialised. -//===================================================================== -//===================================================================== - -[ -object, -uuid(56a86899-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IMediaFilter : IPersist { - - // tell the filter to transition to the new state. The state transition - // may not be instantaneous (external mechanical activity may be involved, - // for example). The state functions may return before the state - // transition has completed - - // these functions will return S_OK if the transition is complete, S_FALSE if - // the transition is not complete but no error has occurred, or some error value - // if the transition failed. - HRESULT Stop(void); - HRESULT Pause(void); - - // in order to synchronise independent streams, you must pass a time - // value with the Run command. This is the difference between stream - // time and reference time. That is, it is the amount to be added to - // the IMediaSample timestamp to get the time at which that sample - // should be rendered according to the reference clock. - // If we are starting at the beginning of the stream, it will thus be - // simply the time at which the first sample should appear. If we are - // restarting from Paused mode in midstream, then it will be the total - // time we have been paused added to the initial start time. - - // the filtergraph will provide this information to its filters. If you - // are an app calling the filtergraph, it's ok to pass a start time of - // 0, in which case the filter graph will calculate a soon-as-possible - // time. FilterGraphs will accept 0 meaning ASAP; most filters will not. - - HRESULT Run(REFERENCE_TIME tStart); - - - // possible states that the filter could be in - typedef enum _FilterState { - State_Stopped, // not in use - State_Paused, // holding resources, ready to go - State_Running // actively processing media stream - } FILTER_STATE; - - // find out what state the filter is in. - // If timeout is 0, will return immediately - if a state transition is - // not complete, it will return the state being transitioned into, and - // the return code will be VFW_S_STATE_INTERMEDIATE. if no state - // transition is in progress the state will be returned and the return - // code will be S_OK. - // - // If timeout is non-zero, GetState will not return until the state - // transition is complete, or the timeout expires. - // The timeout is in milliseconds. - // You can also pass in INFINITE as a special value for the timeout, in - // which case it will block indefinitely waiting for the state transition - // to complete. If the timeout expires, the state returned is the - // state we are trying to reach, and the return code will be - // VFW_S_STATE_INTERMEDIATE. If no state transition is in progress - // the routine returns immediately with return code S_OK. - - // - // return State is State_Running, State_Paused or State_Stopped. - // return code is S_OK, or VFW_S_STATE_INTERMEDIATE if state - // transition is not complete or an error value if the method failed. - HRESULT GetState( - [in] DWORD dwMilliSecsTimeout, - [out] FILTER_STATE *State); - - - // tell the filter the reference clock to which it should synchronize - // activity. This is most important to rendering filters and may not - // be of any interest to other filters. - HRESULT SetSyncSource( - [in] IReferenceClock * pClock); - - // get the reference clock currently in use (it may be NULL) - HRESULT GetSyncSource( - [out] IReferenceClock ** pClock); -} - -typedef IMediaFilter *PMEDIAFILTER; - - -//===================================================================== -//===================================================================== -// Defines IBaseFilter interface -// -// all multimedia components will expose this interface -// this interface abstracts an object that has typed input and output -// connections and can be dynamically aggregated. -// -// IMediaFilter supports synchronisation and activity state: IBaseFilter -// is derived from that since all filters need to support IMediaFilter, -// whereas a few objects (plug-in control distributors for example) will -// support IMediaFilter but not IBaseFilter. -// -// IMediaFilter is itself derived from IPersist so that every filter -//supports GetClassID() -//===================================================================== -//===================================================================== - -[ -object, -uuid(56a86895-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IBaseFilter : IMediaFilter { - - // enumerate all the pins available on this filter - // allows enumeration of all pins only. - // - HRESULT EnumPins( - [out] IEnumPins ** ppEnum // enum interface returned here - ); - - // Convert the external identifier of a pin to an IPin * - // This pin id is quite different from the pin Name in CreatePin. - // In CreatePin the Name is invented by the caller. In FindPin the Id - // must have come from a previous call to IPin::QueryId. Whether or not - // this operation would cause a pin to be created depends on the filter - // design, but if called twice with the same id it should certainly - // return the same pin both times. - HRESULT FindPin( - [in, string] LPCWSTR Id, - [out] IPin ** ppPin - ); - - // find out information about this filter - typedef struct _FilterInfo { - WCHAR achName[MAX_FILTER_NAME]; // maybe null if not part of graph - IFilterGraph * pGraph; // null if not part of graph - } FILTER_INFO; - - HRESULT QueryFilterInfo( - [out] FILTER_INFO * pInfo - ); - - // notify a filter that it has joined a filter graph. It is permitted to - // refuse. The filter should addref and store this interface for later use - // since it may need to notify events to this interface. A null pointer indicates - // that the filter is no longer part of a graph. - HRESULT JoinFilterGraph( - [in] IFilterGraph * pGraph, - [in, string] LPCWSTR pName - ); - - // return a Vendor information string. Optional - may return E_NOTIMPL. - // memory returned should be freed using CoTaskMemFree - HRESULT QueryVendorInfo( - [out, string] LPWSTR* pVendorInfo - ); -} - -typedef IBaseFilter *PFILTER; - - -//===================================================================== -//===================================================================== -// sync and state management -//===================================================================== -//===================================================================== - - -//===================================================================== -//===================================================================== -// Defines IReferenceClock interface -//===================================================================== -//===================================================================== - -[ - object, - uuid(56a86897-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IReferenceClock : IUnknown { - - // get the time now - HRESULT GetTime( - [out] REFERENCE_TIME *pTime - ); - - // ask for an async notification that a time has elapsed - HRESULT AdviseTime( - [in] REFERENCE_TIME baseTime, // base reference time - [in] REFERENCE_TIME streamTime, // stream offset time - [in] HEVENT hEvent, // advise via this event - [out] DWORD_PTR * pdwAdviseCookie // where your cookie goes - ); - - // ask for an async periodic notification that a time has elapsed - HRESULT AdvisePeriodic( - [in] REFERENCE_TIME startTime, // starting at this time - [in] REFERENCE_TIME periodTime, // time between notifications - [in] HSEMAPHORE hSemaphore, // advise via a semaphore - [out] DWORD_PTR * pdwAdviseCookie // where your cookie goes - ); - - // cancel a request for notification - HRESULT Unadvise( - [in] DWORD_PTR dwAdviseCookie); -} - -typedef IReferenceClock *PREFERENCECLOCK; - -//===================================================================== -//===================================================================== -// Defines IReferenceClock2 interface -//===================================================================== -//===================================================================== - -[ - object, - uuid(36b73885-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface IReferenceClock2 : IReferenceClock { -} - -typedef IReferenceClock2 *PREFERENCECLOCK2; - - -//===================================================================== -//===================================================================== -// Data transport interfaces -//===================================================================== -//===================================================================== - - -//===================================================================== -//===================================================================== -// Defines IMediaSample interface -//===================================================================== -//===================================================================== - -[ - local, - object, - uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IMediaSample : IUnknown { - - // get me a read/write pointer to this buffer's memory. I will actually - // want to use sizeUsed bytes. - HRESULT GetPointer([out] BYTE ** ppBuffer); - - // return the size in bytes of the buffer data area - long GetSize(void); - - // get the stream time at which this sample should start and finish. - HRESULT GetTime( - [out] REFERENCE_TIME * pTimeStart, // put time here - [out] REFERENCE_TIME * pTimeEnd - ); - - // Set the stream time at which this sample should start and finish. - // pTimeStart==pTimeEnd==NULL will invalidate the time stamps in - // this sample - HRESULT SetTime( - [in] REFERENCE_TIME * pTimeStart, // put time here - [in] REFERENCE_TIME * pTimeEnd - ); - - // sync-point property. If true, then the beginning of this - // sample is a sync-point. (note that if AM_MEDIA_TYPE.bTemporalCompression - // is false then all samples are sync points). A filter can start - // a stream at any sync point. S_FALSE if not sync-point, S_OK if true. - - HRESULT IsSyncPoint(void); - HRESULT SetSyncPoint(BOOL bIsSyncPoint); - - // preroll property. If true, this sample is for preroll only and - // shouldn't be displayed. - HRESULT IsPreroll(void); - HRESULT SetPreroll(BOOL bIsPreroll); - - long GetActualDataLength(void); - HRESULT SetActualDataLength(long); - - // these allow for limited format changes in band - if no format change - // has been made when you receive a sample GetMediaType will return S_FALSE - - HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType); - HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType); - - // returns S_OK if there is a discontinuity in the data (this frame is - // not a continuation of the previous stream of data - // - there has been a seek or some dropped samples). - HRESULT IsDiscontinuity(void); - // set the discontinuity property - TRUE if this sample is not a - // continuation, but a new sample after a seek or a dropped sample. - HRESULT SetDiscontinuity(BOOL bDiscontinuity); - - // get the media times for this sample - HRESULT GetMediaTime( - [out] LONGLONG * pTimeStart, - [out] LONGLONG * pTimeEnd - ); - - // Set the media times for this sample - // pTimeStart==pTimeEnd==NULL will invalidate the media time stamps in - // this sample - HRESULT SetMediaTime( - [in] LONGLONG * pTimeStart, - [in] LONGLONG * pTimeEnd - ); -} - -typedef IMediaSample *PMEDIASAMPLE; - -// Values for dwFlags for AM_SAMPLE_PROPERTIES -enum tagAM_SAMPLE_PROPERTY_FLAGS - { AM_SAMPLE_SPLICEPOINT = 0x01, /* Is this a splice point - IE can it be decoded - without reference to - previous data */ - AM_SAMPLE_PREROLL = 0x02, /* Is this a preroll sample */ - AM_SAMPLE_DATADISCONTINUITY = 0x04, /* Set if start of new segment */ - AM_SAMPLE_TYPECHANGED = 0x08, /* Has the type changed */ - AM_SAMPLE_TIMEVALID = 0x10, /* Set if time is valid */ - AM_SAMPLE_TIMEDISCONTINUITY = 0x40, /* time gap in data starts after - this sample - pbBuffer can - be NULL - */ - AM_SAMPLE_FLUSH_ON_PAUSE = 0x80, /* For live data - discard - in paused state - */ - AM_SAMPLE_STOPVALID = 0x100, /* Stop time is valid */ - AM_SAMPLE_ENDOFSTREAM = 0x200, /* End of stream after - this data - This is reserved for - kernel streaming and is - not currently used by - ActiveMovie - */ - AM_STREAM_MEDIA = 0, /* Normal data stream id */ - AM_STREAM_CONTROL = 1 /* Control stream id */ - /* > 7FFFFFFF is application - defined stream - */ - }; - -// Media sample generic properties structure -typedef struct tagAM_SAMPLE2_PROPERTIES { - DWORD cbData; // Length of generic data for extensiblity - // Number of bytes INCLUDING this field - DWORD dwTypeSpecificFlags; // Type specific flag data - DWORD dwSampleFlags; // Flags bits defined by AM_SAMPLE_xxx flags - // All undefined bits RESERVED (set to 0, - // leave on copy) - LONG lActual; // Length of data in buffer - REFERENCE_TIME tStart; // Start time if valid - REFERENCE_TIME tStop; // Stop time if valid - DWORD dwStreamId; // Stream 0 is normal media transport - // Stream 1 is control - AM_MEDIA_TYPE *pMediaType; // Copy of media type - INVALID after Release() - BYTE *pbBuffer; // Pointer to buffer - INVALID after Release() - LONG cbBuffer; // Length of buffer -} AM_SAMPLE2_PROPERTIES; - -//===================================================================== -//===================================================================== -// Defines IMediaSample2 interface -//===================================================================== -//===================================================================== - -[ - local, - object, - uuid(36b73884-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface IMediaSample2 : IMediaSample { - - // Get sample properties - // - // cbProperties - length of generic data to retrieve - // pbProperties - pointer to generic data buffer - can - // be NULL if cbProperties is NULL - // data conforms to AM_SAMPLE_PROPERTIES - // - HRESULT GetProperties( - [in] DWORD cbProperties, - [out, size_is(cbProperties)] BYTE * pbProperties - ); - // Set sample properties - // - // cbProperties - length of generic data to set - // pbProperties - pointer to generic data buffer - can - // be NULL if cbProperties is NULL - // data conforms to AM_SAMPLE_PROPERTIES - // - // - HRESULT SetProperties( - [in] DWORD cbProperties, - [in, size_is(cbProperties)] const BYTE * pbProperties - ); - - - // // Get the clock associated with the sample - // HRESULT GetClock( - // [out] IReferenceClock2 **ppClock - // ); - - // // Get a pointer to the object containing the data - // // - // // riid - IID of interface required on object - // // ppvobject - Pointer to object containing the data - // // - // // Returns - // // S_OK - Got the object - // // E_NOINTERFACE - object does not support this interface - // // if IUnknown is not supported - // // there is no backing object - // // E_NOTIMPL - samples don't have backing objects - // // - // // - // HRESULT GetBackingObject( - // [in] REFIID riid, - // [out] void **ppvObject - // ); -} - -typedef IMediaSample2 *PMEDIASAMPLE2; - - -// flags for dwFlags in IMemAllocator::GetBuffer -// AM_GBF_PREVFRAMESKIPPED is only significant when asking for a buffer from the -// video renderer. It should be TRUE if and only if the previous frame -// was skipped. It affects quality management. -// AM_GBF_NOTASYNCPOINT indicates to the downstream filter (most likely the -// video renderer) that you are not going to fill this buffer with a sync point -// (keyframe) so now would be a bad time to return a buffer with a dynamic -// format change, because you will be unable to switch to the new format without -// waiting for the next sync point, causing some frames to be dropped. -#define AM_GBF_PREVFRAMESKIPPED 1 -#define AM_GBF_NOTASYNCPOINT 2 -cpp_quote("#define AM_GBF_PREVFRAMESKIPPED 1") -cpp_quote("#define AM_GBF_NOTASYNCPOINT 2") - -// This may not be supported by allocators -cpp_quote("#define AM_GBF_NOWAIT 4") - -// This flag is supported by the VMR's surface allocator -// When set the DDraw surface used for the media sample -// is returned is an un-locked state. Calls the GetPointer on -// the returned media sample will fail and return a NULL pointer -// -cpp_quote("#define AM_GBF_NODDSURFACELOCK 8") - -//===================================================================== -//===================================================================== -// Defines IMemAllocator interface -// -// an allocator of IMediaSample blocks to be used for data transfer between -// pins. Can be provided by input, output or a third party. Release -// the IMediaSample object obtained back to the pool by calling -// IMediaSample::Release. -//===================================================================== -//===================================================================== - -[ - object, - uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IMemAllocator : IUnknown { - - // negotiate buffer sizes, buffer count and alignment. pRequest is filled - // in by the caller with the requested values. pActual will be returned - // by the allocator with the closest that the allocator can come to this. - // Cannot be called unless the allocator is decommitted. - // Calls to GetBuffer need not succeed until Commit is called. - HRESULT SetProperties( - [in] ALLOCATOR_PROPERTIES* pRequest, - [out] ALLOCATOR_PROPERTIES* pActual); - - // return the properties actually being used on this allocator - HRESULT GetProperties( - [out] ALLOCATOR_PROPERTIES* pProps); - - - // commit the memory for the agreed buffers - HRESULT Commit(void); - - // release the memory for the agreed buffers. Any threads waiting in - // GetBuffer will return with an error. GetBuffer calls will always fail - // if called before Commit or after Decommit. - HRESULT Decommit(void); - - // get container for a sample. Blocking, synchronous call to get the - // next free buffer (as represented by an IMediaSample interface). - // on return, the time etc properties will be invalid, but the buffer - // pointer and size will be correct. - // Will only succeed if memory is committed. If GetBuffer is blocked - // waiting for a buffer and Decommit is called on another thread, - // GetBuffer will return with an error. - HRESULT GetBuffer( - [out] IMediaSample **ppBuffer, - [in] REFERENCE_TIME * pStartTime, - [in] REFERENCE_TIME * pEndTime, - [in] DWORD dwFlags - ); - - // put a buffer back on the allocators free list. - // this is typically called by the Release() method of the media - // sample when the reference count goes to 0 - // - HRESULT ReleaseBuffer( - [in] IMediaSample *pBuffer - ); -} - -typedef IMemAllocator *PMEMALLOCATOR; - -//===================================================================== -//===================================================================== -// Defines IMemAllocatorCallbackTemp interface -// -// If the allocator supports IMemAllocator2 then callbacks are -// available -// -//===================================================================== -//===================================================================== -[ - object, - uuid(379a0cf0-c1de-11d2-abf5-00a0c905f375), - pointer_default(unique) -] -interface IMemAllocatorCallbackTemp : IMemAllocator { - - // Set notification interface. pNotify can be NULL - HRESULT SetNotify( - [in] IMemAllocatorNotifyCallbackTemp *pNotify); - - // Get current stats - HRESULT GetFreeCount( - [out] LONG *plBuffersFree); -} - -//===================================================================== -//===================================================================== -// Defines IMemAllocatorNotify interface -// -//===================================================================== -//===================================================================== -[ - object, - uuid(92980b30-c1de-11d2-abf5-00a0c905f375), - pointer_default(unique) -] -interface IMemAllocatorNotifyCallbackTemp : IUnknown { - - // Called whenever ReleaseBuffer is called in the allocator - // Note the caller may have acquired locks and this call may - // occur in any context so generally the implementor of this - // call will just set an event or post a message for another - // thread to take action. - HRESULT NotifyRelease(); -} - -//===================================================================== -//===================================================================== -// Defines IMemInputPin interface -// -// basic shared memory transport interface. -//===================================================================== -//===================================================================== - -[ - object, - uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IMemInputPin : IUnknown { - - // return the allocator interface that this input pin - // would like the output pin to use - HRESULT GetAllocator( - [out] IMemAllocator ** ppAllocator); - - // tell the input pin which allocator the output pin is actually - // going to use. - // If the readonly flag is set, then all samples from this allocator are - // to be treated as read-only, and should be copied before being modified. - HRESULT NotifyAllocator( - [in] IMemAllocator * pAllocator, - [in] BOOL bReadOnly - ); - - // this method is optional (can return E_NOTIMPL). Output pins are not obliged to call - // this method, nor are they obliged to fulfil the request. Input pins making such a - // request should check the allocator in NotifyAllocator to see if it meets their needs. If - // not, the input pin is responsible for any necessary data copy. - // Zero values will be treated as don't care: so a pin can return an alignment value - // and leave the other values 0. - HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps); - - // here's the next block of data from the stream. AddRef it if - // you need to hold it beyond the end of the Receive call. - // call pSample->Release when done with it. - // - // This is a blocking synchronous call. Usually no blocking - // will occur but if a filter cannot process the sample immediately - // it may use the caller's thread to wait until it can. - HRESULT Receive( - [in] IMediaSample * pSample); - - // Same as Receive but with multiple samples. Useful for - // fragmented streams - HRESULT ReceiveMultiple( - [in, size_is(nSamples)] IMediaSample **pSamples, - [in] long nSamples, - [out] long *nSamplesProcessed); - - // See if Receive might block - // Returns S_OK if it can block, S_FALSE if it can't or some - // failure code (assume it can in this case) - HRESULT ReceiveCanBlock(); -} - -typedef IMemInputPin *PMEMINPUTPIN; - - -//===================================================================== -//===================================================================== -// Defines IAMovieSetup interface -// -// exported by filter to allow it to be self-registering -//===================================================================== -//===================================================================== - -[ -object, -uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20), -pointer_default(unique) -] -interface IAMovieSetup : IUnknown { - - // methods to register and unregister filter, etc. - - HRESULT Register( ); - HRESULT Unregister( ); -} - -typedef IAMovieSetup *PAMOVIESETUP; - - -//===================================================================== -//===================================================================== -// Defines IMediaSeeking interface -// -// Controls seeking (time, bytes, frames, fields and samples) -//===================================================================== -//===================================================================== - -typedef enum AM_SEEKING_SeekingFlags -{ - AM_SEEKING_NoPositioning = 0x00, // No change - AM_SEEKING_AbsolutePositioning = 0x01, // Position is supplied and is absolute - AM_SEEKING_RelativePositioning = 0x02, // Position is supplied and is relative - AM_SEEKING_IncrementalPositioning = 0x03, // (Stop) position relative to current - // Useful for seeking when paused (use +1) - AM_SEEKING_PositioningBitsMask = 0x03, // Useful mask - AM_SEEKING_SeekToKeyFrame = 0x04, // Just seek to key frame (performance gain) - AM_SEEKING_ReturnTime = 0x08, // Plug the media time equivalents back into the supplied LONGLONGs - - AM_SEEKING_Segment = 0x10, // At end just do EC_ENDOFSEGMENT, - // don't do EndOfStream - AM_SEEKING_NoFlush = 0x20 // Don't flush -} AM_SEEKING_SEEKING_FLAGS; - -typedef enum AM_SEEKING_SeekingCapabilities -{ - AM_SEEKING_CanSeekAbsolute = 0x001, - AM_SEEKING_CanSeekForwards = 0x002, - AM_SEEKING_CanSeekBackwards = 0x004, - AM_SEEKING_CanGetCurrentPos = 0x008, - AM_SEEKING_CanGetStopPos = 0x010, - AM_SEEKING_CanGetDuration = 0x020, - AM_SEEKING_CanPlayBackwards = 0x040, - AM_SEEKING_CanDoSegments = 0x080, - AM_SEEKING_Source = 0x100 // Doesn't pass thru used to - // count segment ends -} AM_SEEKING_SEEKING_CAPABILITIES; - -[ - object, - uuid(36b73880-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface IMediaSeeking : IUnknown { - - // Returns the capability flags - HRESULT GetCapabilities( [out] DWORD * pCapabilities ); - - // And's the capabilities flag with the capabilities requested. - // Returns S_OK if all are present, S_FALSE if some are present, E_FAIL if none. - // *pCababilities is always updated with the result of the 'and'ing and can be - // checked in the case of an S_FALSE return code. - HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities ); - - // returns S_OK if mode is supported, S_FALSE otherwise - HRESULT IsFormatSupported([in] const GUID * pFormat); - HRESULT QueryPreferredFormat([out] GUID * pFormat); - - HRESULT GetTimeFormat([out] GUID *pFormat); - // Returns S_OK if *pFormat is the current time format, otherwise S_FALSE - // This may be used instead of the above and will save the copying of the GUID - HRESULT IsUsingTimeFormat([in] const GUID * pFormat); - - // (may return VFE_E_WRONG_STATE if graph is stopped) - HRESULT SetTimeFormat([in] const GUID * pFormat); - - // return current properties - HRESULT GetDuration([out] LONGLONG *pDuration); - HRESULT GetStopPosition([out] LONGLONG *pStop); - HRESULT GetCurrentPosition([out] LONGLONG *pCurrent); - - // Convert time from one format to another. - // We must be able to convert between all of the formats that we say we support. - // (However, we can use intermediate formats (e.g. MEDIA_TIME).) - // If a pointer to a format is null, it implies the currently selected format. - HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat, - [in] LONGLONG Source, [in] const GUID * pSourceFormat ); - - - // Set current and end positions in one operation - // Either pointer may be null, implying no change - HRESULT SetPositions( [in,out] LONGLONG * pCurrent, [in] DWORD dwCurrentFlags - , [in,out] LONGLONG * pStop, [in] DWORD dwStopFlags ); - - // Get CurrentPosition & StopTime - // Either pointer may be null, implying not interested - HRESULT GetPositions( [out] LONGLONG * pCurrent, - [out] LONGLONG * pStop ); - - // Get earliest / latest times to which we can currently seek "efficiently". - // This method is intended to help with graphs where the source filter has - // a very high latency. Seeking within the returned limits should just - // result in a re-pushing of already cached data. Seeking beyond these - // limits may result in extended delays while the data is fetched (e.g. - // across a slow network). - // (NULL pointer is OK, means caller isn't interested.) - HRESULT GetAvailable( [out] LONGLONG * pEarliest, [out] LONGLONG * pLatest ); - - // Rate stuff - HRESULT SetRate([in] double dRate); - HRESULT GetRate([out] double * pdRate); - - // Preroll - HRESULT GetPreroll([out] LONGLONG * pllPreroll); -} - -typedef IMediaSeeking *PMEDIASEEKING; - -// Flags for IMediaEventEx -cpp_quote("enum tagAM_MEDIAEVENT_FLAGS") -cpp_quote("{") -cpp_quote(" AM_MEDIAEVENT_NONOTIFY = 0x01") -cpp_quote("};") diff --git a/import/DirectX8/include/DShowIDL/axextend.idl b/import/DirectX8/include/DShowIDL/axextend.idl deleted file mode 100644 index f12295f61..000000000 --- a/import/DirectX8/include/DShowIDL/axextend.idl +++ /dev/null @@ -1,9423 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AXExtend.idl -// -// Desc: Extended streaming interface definitions for the ActiveMovie -// streaming and synchronization architecture. Core streaming -// interfaces are in AXCore.idl, and control interfaces for the -// type library are in Control.odl. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// include after unknwn.idl, objidl.idl and axcore.idl - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - -// forward declarations - these are the interfaces declared in this file - -interface IEnumRegFilters; -interface IFileSourceFilter; -interface IFileSinkFilter; -interface IFileSinkFilter2; -interface IGraphBuilder; -interface ICaptureGraphBuilder; -interface ICaptureGraphBuilder2; -interface IAMCopyCaptureFileProgress; -interface IFilterMapper; -interface IFilterMapper2; -interface IMediaEventSink; -interface IOverlay; -interface IOverlayNotify; -interface IOverlayNotify2; -interface IQualityControl; -interface ISeekingPassThru; -interface IAMStreamConfig; -interface IAMDevMemoryAllocator; -interface IAMDevMemoryControl; -interface IConfigInterleaving; -interface IConfigAviMux; -interface IAMVideoCompression; -interface IAMVfwCaptureDialogs; -interface IAMVfwCompressDialogs; -interface IAMDroppedFrames; -interface IAMAudioInputMixer; -interface IAMBufferNegotiation; -interface IAMAnalogVideoDecoder; -interface IAMVideoProcAmp; -interface IAMAnalogVideoEncoder; -interface IAMCameraControl; -interface IAMCrossbar; -interface IAMTVTuner; -interface IKsPropertySet; -interface IAMPhysicalPinInfo; -interface IAMExtDevice; -interface IAMExtTransport; -interface IAMTimecodeReader; -interface IAMTimecodeGenerator; -interface IAMTimecodeDisplay; -interface IDrawVideoImage; -interface IDecimateVideoImage; -interface IAMVideoDecimationProperties; -interface IAMPushSource; -interface IAMAudioRendererStats; -interface IAMLatency; -interface IAMGraphStreams; -interface IAMOverlayFX; -interface IAMOpenProgress; -interface IMpeg2Demultiplexer ; -interface IMPEG2StreamIdMap ; -interface IEnumStreamIdMap ; -interface IAMClockSlave ; - -//========================================================================== -//========================================================================== -// IEnumRegFilters interface -- enumerates registered filters. -// enumerator interface returned from IFilterMapper::EnumMatchingFilters(). -// based on IEnum pseudo-template -//========================================================================== -//========================================================================== - -typedef struct { - CLSID Clsid; // class id of the filter - LPWSTR Name; // name of filter -} REGFILTER; - -[ -object, -uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] - -// The point of the mapper is to avoid loading filters. By looking in the -// registry we can reduce the number of filters which must be loaded and tried. -// This enumerator returns descriptors of filters (including the GUIDs that -// CoCreateInstance can instantiate). The filters themselves are not loaded. - -interface IEnumRegFilters : IUnknown { - import "unknwn.idl"; - - // The caller must use CoTaskMemFree to free each REGFILTER* returned - // in the array. - HRESULT Next - ( [in] ULONG cFilters, // place this many filters... - [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER* - [out] ULONG * pcFetched // actual count passed returned here - ); - - // I can't think why anyone would want to skip, so it's not implemented. - // (anyone who thinks they know what they would be skipping over is probably - // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL. - - HRESULT Skip( - [in] ULONG cFilters - ); - - HRESULT Reset(void); - - // No cloning either - also ALWAYS returns E_NOTIMPL. - - HRESULT Clone( - [out] IEnumRegFilters **ppEnum - ); -} - - -typedef IEnumRegFilters *PENUMREGFILTERS; - -//======================================================================== -//======================================================================== -// abstraction representing the registered information about filters. -// This allows properties of filters to be looked up without loading them. -//======================================================================== -//======================================================================== - -[ -object, -uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IFilterMapper : IUnknown { - import "unknwn.idl"; - - //========================================================================== - // Registration functions. - // A filter should be registered before any other use. - // The registration can be NON_VOLATILE (i.e. permanent, do once ever) - // or VOLATILE (once per boot of the system). - // UnregisterFilter (obviously) removes the registration. - // The action of any of the other calls on unregistered filters is undefined. - // it will either work or you'll get an error, but I'm not saying which. - //========================================================================== - - // Four predefined values controling the order in which filters are tried - // for intelligent graph building. Intermediate values are legal. - // Any value <=MERIT_DO_NOT_USE will mean that the filter will never - // be tried by the filtergrah to automatically complete a connection. - - enum { MERIT_PREFERRED = 0x800000, - MERIT_NORMAL = 0x600000, - MERIT_UNLIKELY = 0x400000, - MERIT_DO_NOT_USE = 0x200000, - MERIT_SW_COMPRESSOR = 0x100000, - MERIT_HW_COMPRESSOR = 0x100050 - }; - - // Register a filter - - HRESULT RegisterFilter - ( [in] CLSID clsid, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name for the filter - [in] DWORD dwMerit // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED. - ); - - - // Register an identifiable instance of a filter. This deals with cases - // such as two similar sound cards which are driven by the same driver, - // but we want to choose which oif these cards the sound will come out of. - // This is not needed if there is only one instance of the filter - // (e.g. there is only one sound card in the machine) or if all instances - // of the filter are equivalent. - - // The filter itself must have already been registered // ??? Is that true? - HRESULT RegisterFilterInstance - ( [in] CLSID clsid, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name of instance. - [out] CLSID *MRId // Returned Media Resource Id. A - // locally unique id for this instance - // of this filter - ); - - - HRESULT RegisterPin - ( [in] CLSID Filter, // GUID of filter - [in] LPCWSTR Name, // Name of the pin - [in] BOOL bRendered, // The filter renders this input - [in] BOOL bOutput, // TRUE if this is an Output pin - [in] BOOL bZero, // TRUE if OK for zero instances of pin - // In this case you will have to Create - // a pin to have even one instance - [in] BOOL bMany, // TRUE if OK for many instances of pin - [in] CLSID ConnectsToFilter, // Filter it connects to if it has - // subterranean connection, else NULL - [in] LPCWSTR ConnectsToPin // Name of pin it connects to - // NULL for output pins - ); - - HRESULT RegisterPinType - ( [in] CLSID clsFilter, // GUID of filter - [in] LPCWSTR strName, // Descriptive name of the pin - [in] CLSID clsMajorType, // Major type of the data stream - [in] CLSID clsSubType // Sub type of the data stream - ); - - - HRESULT UnregisterFilter - ( [in] CLSID Filter // GUID of filter - ); - - - HRESULT UnregisterFilterInstance - ( [in] CLSID MRId // Media Resource Id of this instance - ); - - - HRESULT UnregisterPin - ( [in] CLSID Filter, // GUID of filter - [in] LPCWSTR Name // Name of the pin - ); - - - // Set *ppEnum to be an enumerator for filters matching the requirements. - - HRESULT EnumMatchingFilters - ( [out] IEnumRegFilters **ppEnum // enumerator returned - , [in] DWORD dwMerit // at least this merit needed - , [in] BOOL bInputNeeded // need at least one input pin - , [in] CLSID clsInMaj // input major type - , [in] CLSID clsInSub // input sub type - , [in] BOOL bRender // must the input be rendered? - , [in] BOOL bOututNeeded // need at least one output pin - , [in] CLSID clsOutMaj // output major type - , [in] CLSID clsOutSub // output sub type - ); - -} - -// structure used to identify media types a pin handles. Used for -// registration through IFilterMapper and IFilterMapper2 -// -typedef struct -{ - const CLSID * clsMajorType; - const CLSID * clsMinorType; -} REGPINTYPES; - -// describes pin for filter registration. Used for registration -// through IFilterMapper and IFilterMapper2 -// -typedef struct -{ - LPWSTR strName; - - // The filter renders this input - BOOL bRendered; - - // This is an Output pin - BOOL bOutput; - - // OK to have zero instances of pin In this case you will have to - // Create a pin to have even one instance - BOOL bZero; - - // OK to create many instance of pin - BOOL bMany; - - const CLSID * clsConnectsToFilter; - const WCHAR * strConnectsToPin; - - UINT nMediaTypes; - const REGPINTYPES * lpMediaType; -} REGFILTERPINS; - -// mediums (as defined in the Windows NT DDK) for registration with -// IFilterMapper2 -// -typedef struct -{ - CLSID clsMedium; - DWORD dw1; - DWORD dw2; -} REGPINMEDIUM; - -// flags for dwFlags in REFILTERPINS2 -enum -{ - // OK to have zero instances of pin In this case you will have to - // Create a pin to have even one instance - REG_PINFLAG_B_ZERO = 0x1, - - // The filter renders this input - REG_PINFLAG_B_RENDERER = 0x2, - - // OK to create many instance of pin - REG_PINFLAG_B_MANY = 0x4, - - // This is an Output pin - REG_PINFLAG_B_OUTPUT = 0x8 -}; - - -// describes pin for filter registration through IFilterMapper2 -typedef struct -{ - // combination of REG_PINFLAG flags - DWORD dwFlags; - - // number of instances of the pin if known - UINT cInstances; - - UINT nMediaTypes; - [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType; - - UINT nMediums; - [size_is(nMediums)] const REGPINMEDIUM *lpMedium; - - // pin category (for Kernel Streaming pins) as defined in the - // Windows NT DDK - const CLSID *clsPinCategory; - -} REGFILTERPINS2; - -// describes filter for registration through IFilterMapper2 -typedef struct -{ - DWORD dwVersion; // 1 or 2 - DWORD dwMerit; - - /* unnamed union */ - [switch_is(dwVersion)] [switch_type(DWORD)] union - { - [case(1)] - - struct - { - ULONG cPins; - [size_is(cPins)] const REGFILTERPINS *rgPins; - }; - - [case(2)] - - struct - { - ULONG cPins2; - [size_is(cPins2)] const REGFILTERPINS2 *rgPins2; - }; - - [default] - ; - } ; - -} REGFILTER2; - - - -[ -object, -uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375), -pointer_default(unique) -] -interface IFilterMapper2 : IUnknown { - import "unknwn.idl"; - - // create or rename ActiveMovie category - HRESULT CreateCategory - ( [in] REFCLSID clsidCategory, - [in] DWORD dwCategoryMerit, - [in] LPCWSTR Description - ); - - HRESULT UnregisterFilter - ( [in] const CLSID *pclsidCategory, - [in] const OLECHAR *szInstance, - [in] REFCLSID Filter // GUID of filter - ); - - // Register a filter, pins, and media types under a category. - HRESULT RegisterFilter - ( [in] REFCLSID clsidFilter, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name for the filter - - // ppMoniker can be null. or *ppMoniker can contain the - // moniker where this filter data will be written; - // *ppMoniker will be set to null on return. or *ppMoniker - // can be null in which case the moniker will be returned - // with refcount. - [in, out] IMoniker **ppMoniker, - - // can be null - [in] const CLSID *pclsidCategory, - - // cannot be null - [in] const OLECHAR *szInstance, - - // rest of filter and pin registration - [in] const REGFILTER2 *prf2 - ); - - // Set *ppEnum to be an enumerator for filters matching the - // requirements. - HRESULT EnumMatchingFilters - ( [out] IEnumMoniker **ppEnum // enumerator returned - , [in] DWORD dwFlags // 0 - , [in] BOOL bExactMatch // don't match wildcards - , [in] DWORD dwMerit // at least this merit needed - , [in] BOOL bInputNeeded // need at least one input pin - , [in] DWORD cInputTypes // Number of input types to match - // Any match is OK - , [size_is(cInputTypes*2)] const GUID *pInputTypes // input major+subtype pair array - , [in] const REGPINMEDIUM *pMedIn // input medium - , [in] const CLSID *pPinCategoryIn // input pin category - , [in] BOOL bRender // must the input be rendered? - , [in] BOOL bOutputNeeded // need at least one output pin - , [in] DWORD cOutputTypes // Number of output types to match - // Any match is OK - , [size_is(cOutputTypes*2)] const GUID *pOutputTypes // output major+subtype pair array - , [in] const REGPINMEDIUM *pMedOut // output medium - , [in] const CLSID *pPinCategoryOut // output pin category - ); -} - -[ -object, -uuid(b79bb0b1-33c1-11d1-abe1-00a0c905f375), -pointer_default(unique) -] -interface IFilterMapper3 : IFilterMapper2 { - // new interface to allow creating filters using the mapper's devenum instance - // primarily needed for out-of-proc access to a graph - HRESULT GetICreateDevEnum( [out] ICreateDevEnum **ppEnum ); -} - -//======================================================================== -//======================================================================== -// Defines IQualityControl interface -// -// Defines quality messages and allows a quality manager to install itself -// as the sink for quality messages. -//======================================================================== -//======================================================================== - -typedef enum tagQualityMessageType { - Famine, - Flood -} QualityMessageType; - -typedef struct tagQuality { - QualityMessageType Type; - long Proportion; // milli-units. 1000 = no change - // for Flood: - // What proportion of the media samples currently - // coming through are required in the future. - // 800 means please drop another 20% - // For Famine: - // How much to "keep in" e.g. 800 means send me - // 20% less e.g. by dropping 20% of the samples. - // 1100 would mean "I'm coping, send me more". - REFERENCE_TIME Late; - // How much you need to catch up by - REFERENCE_TIME TimeStamp; - // The stream time when this was generated (probably - // corresponds to the start time on some sample). -} Quality; - -typedef IQualityControl *PQUALITYCONTROL; - - -[ -object, -uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IQualityControl : IUnknown { - - // Notify the recipient that a quality change is requested. - // pSelf is the IBaseFilter* of the sender. - // this is sent from a filter - // to (the quality manager or) an upstream peer. - HRESULT Notify - ( [in] IBaseFilter * pSelf, - [in] Quality q - ); - - // Notify the recipient that future quality messages are to be sent - // to iqc. If piqc is NULL then quality messages are to default back to - // the upstream peer. - // This is sent from the quality manager to a filter. - // The recipient should hold piqc as a WEAK reference, - // i.e. do not AddRef it, do not Release it. - HRESULT SetSink - ( [in] IQualityControl * piqc - ); -} - -//===================================================================== -//===================================================================== -// Definitions required for overlay transport -//===================================================================== -//===================================================================== - - -// Used to communicate the colour that the IOverlay client wants the window -// painted in so that it can draw directly to the correct clipping region -// A colour key can be described in two alternate ways, the first is by a -// range of one or more (system) palette indices. The second is by defining -// a colour cube with two RGB values, any of which would be acceptable. -// -// The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros - - -enum { CK_NOCOLORKEY = 0x0, // No color key is required - CK_INDEX = 0x1, // Index into the current system palette - CK_RGB = 0x2 }; // Color key is an RGB value (or range) - -typedef struct tagCOLORKEY { - - DWORD KeyType; // Explains meaning of the structure - DWORD PaletteIndex; // Palette index if available - COLORREF LowColorValue; // Low colour space RGB value - COLORREF HighColorValue; // Defines the high RGB value - -} COLORKEY; - -// When a filter sets up an advise link it can ask that only certain types -// of notifications be sent, for example just palette changes. While this -// doesn't mean that the other notification call backs won't ever be called -// the IOverlay implementation may use this as an efficiency optimisation - -enum { ADVISE_NONE = 0x0, // No notifications required - ADVISE_CLIPPING = 0x1, // Synchronous clip information - ADVISE_PALETTE = 0x2, // Palette change notifications - ADVISE_COLORKEY = 0x4, // Called when colour key changes - ADVISE_POSITION = 0x8, // Likewise when window moves etc - ADVISE_DISPLAY_CHANGE = 0x10 // Called on WM_DISPLAYCHANGE - }; - -const DWORD ADVISE_ALL = ADVISE_CLIPPING | - ADVISE_PALETTE | - ADVISE_COLORKEY | - ADVISE_POSITION; - -const DWORD ADVISE_ALL2 = ADVISE_ALL | - ADVISE_DISPLAY_CHANGE; - -// This isn't defined when you run IDL - -cpp_quote("#ifndef _WINGDI_") - -typedef struct _RGNDATAHEADER { - DWORD dwSize; - DWORD iType; - DWORD nCount; - DWORD nRgnSize; - RECT rcBound; -} RGNDATAHEADER; - -typedef struct _RGNDATA { - RGNDATAHEADER rdh; - char Buffer[1]; -} RGNDATA; - -cpp_quote("#endif") - - -//===================================================================== -//===================================================================== -// Defines IOverlayNotify interface -// -// This interface gives asynchronous notifications of changes to the -// rendering window - such as changes to the exposed window area -//===================================================================== -//===================================================================== - -[ -object, -local, -uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IOverlayNotify : IUnknown { - - // IOverlayNotify methods - - // This notifies the filter of palette changes, the filter should copy - // the array of RGBQUADs if it needs to use them after returning. This - // is not called when the palette is actually changed in the display - // but at a short time after (in sync with WM_PALETTECHANGED messages) - - HRESULT OnPaletteChange( - [in] DWORD dwColors, // Number of colours present - [in] const PALETTEENTRY *pPalette); // Array of palette colours - - // This provides synchronous clip changes so that the client is called - // before the window is moved to freeze the video, and then when the - // window has stabilised it is called again to start playback again. - // If the window rect is all zero then the window is invisible, the - // filter must take a copy of the information if it wants to keep it - - HRESULT OnClipChange( - [in] const RECT *pSourceRect, // Region of video to use - [in] const RECT *pDestinationRect, // Where video goes - [in] const RGNDATA *pRgnData); // Defines clipping information - - HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey); - - // The calls to OnClipChange happen in sync with the window. So it is - // called with an empty clip list before the window moves to freeze - // the video, and then when the window has stabilised it is called - // again with the new clip list. The OnPositionChange callback is for - // overlay cards that don't want the expense of synchronous clipping - // updates and just want to know when the source or destination video - // positions change. They will NOT be called in sync with the window - // but at some point after the window has changed (basicly in time - // with WM_SIZE etc messages received). This is therefore suitable - // for overlay cards that don't inlay their data to the frame buffer - // NOTE the destination is NOT clipped to the visible display area - - HRESULT OnPositionChange([in] const RECT *pSourceRect, - [in] const RECT *pDestinationRect); -} - -typedef IOverlayNotify *POVERLAYNOTIFY; - - -//===================================================================== -//===================================================================== -// Defines IOverlayNotify2 interface -// -// This interface gives asynchronous notifications of changes to the -// rendering window - such as changes to the exposed window area -// This is optionally supported by the advise sink for the purposes -// of accepting OnDisplayChange notification. -//===================================================================== -//===================================================================== - -cpp_quote("#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)") -cpp_quote("#define HMONITOR_DECLARED") -cpp_quote("#if 0") -typedef HANDLE HMONITOR; -cpp_quote("#endif") -cpp_quote("DECLARE_HANDLE(HMONITOR);") -cpp_quote("#endif") - -[ -object, -local, -uuid(680EFA10-D535-11D1-87C8-00A0C9223196), -pointer_default(unique) -] -interface IOverlayNotify2 : IOverlayNotify { - - // IOverlayNotify2 methods - - HRESULT OnDisplayChange( // ADVISE_DISPLAY_CHANGE - HMONITOR hMonitor); -} - -typedef IOverlayNotify2 *POVERLAYNOTIFY2; - - -//===================================================================== -//===================================================================== -// Defines IOverlay interface -// -// This interface provides information so that a filter can write direct to -// the frame buffer while placing the video in the correct window position -//===================================================================== -//===================================================================== - -[ -object, -local, -uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770), -pointer_default(unique) -] -interface IOverlay : IUnknown { - - // IOverlay methods - - HRESULT GetPalette( - [out] DWORD *pdwColors, // Number of colours present - [out] PALETTEENTRY **ppPalette); // Where to put palette data - - HRESULT SetPalette( - [in] DWORD dwColors, // Number of colours present - [in] PALETTEENTRY *pPalette); // Colours to use for palette - - // If you change the colour key through SetColorKey then all the advise - // links will receive an OnColorKeyChange callback with the new colour - - HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey); - HRESULT GetColorKey([out] COLORKEY *pColorKey); - HRESULT SetColorKey([in,out] COLORKEY *pColorKey); - HRESULT GetWindowHandle([out] HWND *pHwnd); - - // The IOverlay implementation allocates the memory for the clipping - // rectangles as it can be variable in length. The filter calling - // this method should free the memory when it is finished with it - - HRESULT GetClipList([out] RECT *pSourceRect, - [out] RECT *pDestinationRect, - [out] RGNDATA **ppRgnData); - - // Returns the current video source and destination - - HRESULT GetVideoPosition([out] RECT *pSourceRect, - [out] RECT *pDestinationRect); - - HRESULT Advise( - [in] IOverlayNotify *pOverlayNotify, // Notification interface - [in] DWORD dwInterests); // Callbacks interested in - - HRESULT Unadvise(); // Stop the callbacks now -} - -typedef IOverlay *POVERLAY; - - -//===================================================================== -//===================================================================== -// control related interfaces (others are defined in control.odl) -//===================================================================== -//===================================================================== - - -//===================================================================== -//===================================================================== -// Defines IMediaEventSink interface -// -// Exposed by filtergraph. Called by filters to notify events. Will be -// passed on to application by the IMediaControl event methods. -//===================================================================== -//===================================================================== - -[ - object, - uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IMediaEventSink : IUnknown { - - // notify an event. will be queued, but not delivered to - // the application on this thread. - HRESULT Notify( - [in] long EventCode, - [in] LONG_PTR EventParam1, - [in] LONG_PTR EventParam2 - ); -} - -typedef IMediaEventSink *PMEDIAEVENTSINK; - -//===================================================================== -//===================================================================== -// Defines IFileSourceFilter interface -// -// Exposed by source filters to set the file name and media type. -//===================================================================== -//===================================================================== - -[ - object, - uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IFileSourceFilter : IUnknown { - - // Load a file and assign it the given media type - HRESULT Load( - [in] LPCOLESTR pszFileName, // Pointer to absolute path of file to open - [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL - ); - // Get the currently loaded file name - HRESULT GetCurFile( - [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file - [out] AM_MEDIA_TYPE *pmt // Pointer to the media type - ); -} - -typedef IFileSourceFilter *PFILTERFILESOURCE; - -//===================================================================== -//===================================================================== -// Defines IFileSinkFilter interface -// -// Exposed by renderers to set the output file name. -//===================================================================== -//===================================================================== - -[ - object, - uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6), - pointer_default(unique) -] -interface IFileSinkFilter : IUnknown { - - // Output to this file. default is to open the existing file - HRESULT SetFileName( - [in] LPCOLESTR pszFileName, // Pointer to absolute path of output file - [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL - ); - // Get the current file name - HRESULT GetCurFile( - [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file - [out] AM_MEDIA_TYPE *pmt // Pointer to the media type - ); -} - -typedef IFileSinkFilter *PFILTERFILESINK; - -[ - object, - uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86), - pointer_default(unique) -] -interface IFileSinkFilter2 : IFileSinkFilter { - - HRESULT SetMode( - [in] DWORD dwFlags // AM_FILESINK_FLAGS - ); - - HRESULT GetMode( - [out] DWORD *pdwFlags // AM_FILESINK_FLAGS - ); -} - -typedef IFileSinkFilter2 *PFILESINKFILTER2; - -typedef enum { - - // create a new file - AM_FILE_OVERWRITE = 0x00000001, - -} AM_FILESINK_FLAGS; - - -// -// Intelligent connectivity for filters - an interface supported by -// filter graphs (since it is an extension to IFilterGraph) that supports -// building of graphs by automatic selection and connection of appropriate -// filters - -[ - object, - uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IGraphBuilder : IFilterGraph { - // Connect these two pins directly or indirectly, using transform filters - // if necessary. - - HRESULT Connect - ( [in] IPin * ppinOut, // the output pin - [in] IPin * ppinIn // the input pin - ); - - - // Connect this output pin directly or indirectly, using transform filters - // if necessary to something that will render it. - - HRESULT Render - ( [in] IPin * ppinOut // the output pin - ); - - - // Build a filter graph that will render this file using this play list. - // If lpwstrPlayList is NULL then it will use the default play list - // which will typically render the whole file. - - HRESULT RenderFile - ( [in] LPCWSTR lpcwstrFile, - [in, unique] LPCWSTR lpcwstrPlayList - ); - - - // Add to the filter graph a source filter for this file. This would - // be the same source filter that would be added by calling Render. - // This call gives you more control over building - // the rest of the graph, e.g. AddFilter() - // and then Connect the two. - // The IBaseFilter* interface exposed by the source filter is returned - // in ppFilter, addrefed already for you - // The filter will be known by the name lpcwstrFIlterName - // nn this filter graph, - HRESULT AddSourceFilter - ( [in] LPCWSTR lpcwstrFileName, - [in, unique] LPCWSTR lpcwstrFilterName, - [out] IBaseFilter* *ppFilter - ); - - - // If this call is made then trace information will be written to the - // file showing the actions taken in attempting to perform an operation. - HRESULT SetLogFile - ( [in] DWORD_PTR hFile // open file handle e.g. from CreateFile - ); - - - // Request that the graph builder should return as soon as possible from - // its current task. - // Note that it is possible fot the following to occur in the following - // sequence: - // Operation begins; Abort is requested; Operation completes normally. - // This would be normal whenever the quickest way to finish an operation - // was to simply continue to the end. - HRESULT Abort(); - - // Return S_OK if the curent operation is to continue, - // return S_FALSE if the current operation is to be aborted. - // This method can be called as a callback from a filter which is doing - // some operation at the request of the graph. - HRESULT ShouldOperationContinue(); - -} - - -// -// New capture graph builder - -[ - object, - uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5), - pointer_default(unique) -] -interface ICaptureGraphBuilder : IUnknown { - - // Use this filtergraph - HRESULT SetFiltergraph( - [in] IGraphBuilder *pfg); - - // what filtergraph are you using? - // *ppfg->Release() when you're done with it - HRESULT GetFiltergraph( - [out] IGraphBuilder **ppfg); - - // creates a rendering section in the filtergraph consisting of a MUX - // of some filetype, and a file writer (and connects them together) - // *ppf->Release() when you're done with it - // *ppSink->Release() when you're done with it - HRESULT SetOutputFileName( - [in] const GUID *pType, // type of file to write, eg. MEDIASUBTYPE_Avi - [in] LPCOLESTR lpstrFile, // filename given to file writer - [out] IBaseFilter **ppf, // returns pointer to the MUX - [out] IFileSinkFilter **ppSink);// queried from file writer - - // Looks for an interface on the filter and on the output pin of the given - // category. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or - // NULL for "don't care". - // It will also look upstream and downstream of - // the pin for the interface, to find interfaces on renderers, MUXES, TV - // Tuners, etc. - // Call *ppint->Release() when you're done with it - [local] HRESULT FindInterface( - [in, unique] const GUID *pCategory, // can be NULL for all pins - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] void **ppint); - [call_as(FindInterface)] HRESULT RemoteFindInterface( - [in, unique] const GUID *pCategory, // can be NULL for all pins - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] IUnknown **ppint); - - // Connects the pin of the given category of the source filter to the - // rendering filter, optionally through another filter (compressor?) - // For a non-NULL category, it will instantiate and connect additional - // required filters upstream too, like TV Tuners and Crossbars. - // If there is only one output pin on the source, use a NULL - // category. You can also have pSource be a pin - HRESULT RenderStream( - [in] const GUID *pCategory, // can be NULL if only one output pin - [in] IUnknown *pSource, // filter or pin - [in] IBaseFilter *pfCompressor, - [in] IBaseFilter *pfRenderer); // can be NULL - - // Sends IAMStreamControl messages to the pin of the desired category, eg. - // "capture" or "preview" - // REFERENCE_TIME=NULL means NOW - // REFERENCE_TIME=MAX_TIME means never, or cancel previous request - // NULL controls all capture filters in the graph - you will get one - // notification for each filter with a pin of that category found - // returns S_FALSE if stop will be signalled before last sample is - // rendered. - // return a FAILURE code if the filter does not support IAMStreamControl - HRESULT ControlStream( - [in] const GUID *pCategory, - [in] IBaseFilter *pFilter, - [in] REFERENCE_TIME *pstart, - [in] REFERENCE_TIME *pstop, - [in] WORD wStartCookie, // high word reserved - [in] WORD wStopCookie); // high word reserved - - // creates a pre-allocated file of a given size in bytes - HRESULT AllocCapFile( - [in] LPCOLESTR lpstr, - [in] DWORDLONG dwlSize); - - // Copies the valid file data out of the old, possibly huge old capture - // file into a shorter new file. - // Return S_FALSE from your progress function to abort capture, S_OK to - // continue - HRESULT CopyCaptureFile( - [in] LPOLESTR lpwstrOld, - [in] LPOLESTR lpwstrNew, - [in] int fAllowEscAbort, // pressing ESC will abort? - [in] IAMCopyCaptureFileProgress *pCallback); // implement this to - // get progress -} - - -// -// Capture graph builder "CopyCapturedFile" progress callback - -[ - object, - uuid(670d1d20-a068-11d0-b3f0-00aa003761c5), - pointer_default(unique) -] -interface IAMCopyCaptureFileProgress : IUnknown { - - // If you support this interface somewhere, this function will be called - // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing - // to let you know the progress - // - // Return S_OK from this function to continue. Return S_FALSE to abort the - // copy - HRESULT Progress( - [in] int iProgress); // a number between 0 and 100 (%) -} - - -// -// Capture graph builder that can deal with a single filter having more than -// one pin of each category... some new devices can capture both audio and -// video, for example -// - -[ - object, - uuid(93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D), - pointer_default(unique) -] -interface ICaptureGraphBuilder2 : IUnknown { - - // Use this filtergraph - HRESULT SetFiltergraph( - [in] IGraphBuilder *pfg); - - // what filtergraph are you using? - // *ppfg->Release() when you're done with it - HRESULT GetFiltergraph( - [out] IGraphBuilder **ppfg); - - // creates a rendering section in the filtergraph consisting of a MUX - // of some filetype, and a file writer (and connects them together) - // *ppf->Release() when you're done with it - // *ppSink->Release() when you're done with it - HRESULT SetOutputFileName( - [in] const GUID *pType, // GUID of MUX filter to use - [in] LPCOLESTR lpstrFile, // filename given to file writer - [out] IBaseFilter **ppf, // returns pointer to the MUX - [out] IFileSinkFilter **ppSink);// queried from file writer - - // Looks for an interface on the filter and on the output pin of the given - // category and type. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or - // NULL for "don't care". Type: MAJORTYPE_Video/Audio etc or NULL) - // !!! Will some filters have >1 capture pin? ie RGB and MPEG? - // It will also look upstream and downstream of - // the pin for the interface, to find interfaces on renderers, MUXES, TV - // Tuners, etc. - // Call *ppint->Release() when you're done with it - [local] HRESULT FindInterface( - [in] const GUID *pCategory, // can be NULL for all pins - [in] const GUID *pType, // Audio/Video/??? or NULL (don't care) - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] void **ppint); - [call_as(FindInterface)] HRESULT RemoteFindInterface( - [in] const GUID *pCategory, // can be NULL for all pins - [in] const GUID *pType, // Audio/Video/??? or NULL (don't care) - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] IUnknown **ppint); - - // Connects the pin of the given category and type of the source filter to - // the rendering filter, optionally through another filter (compressor?) - // (Type is a Majortype, like Video or Audio) - // For a non-NULL category, it will instantiate and connect additional - // required filters upstream too, like TV Tuners and Crossbars. - // If there is only one output pin on the source, use a NULL category - // and type. You can also have pSource be a pin - HRESULT RenderStream( - [in] const GUID *pCategory, // can be NULL if only one output pin - [in] const GUID *pType, // Major type (Video/Audio/etc) - [in] IUnknown *pSource, // filter or pin - [in] IBaseFilter *pfCompressor, - [in] IBaseFilter *pfRenderer); // can be NULL - - // Sends IAMStreamControl messages to the pin of the desired category, - // (eg. "capture" or "preview") and of the desired type (eg. VIDEO or AUDIO) - // A category MUST be given. If a filter is given, a type must be too. - // REFERENCE_TIME=NULL means NOW - // REFERENCE_TIME=MAX_TIME means never, or cancel previous request - // NULL controls all capture filters in the graph - you will get one - // notification for each filter with a pin of that category found - // returns S_FALSE if stop will be signalled before last sample is - // rendered. - // return a FAILURE code if the filter does not support IAMStreamControl - HRESULT ControlStream( - [in] const GUID *pCategory, - [in] const GUID *pType, // Major type (Video/Audio/etc) - [in] IBaseFilter *pFilter, - [in] REFERENCE_TIME *pstart, - [in] REFERENCE_TIME *pstop, - [in] WORD wStartCookie, // high word reserved - [in] WORD wStopCookie); // high word reserved - - // creates a pre-allocated file of a given size in bytes - HRESULT AllocCapFile( - [in] LPCOLESTR lpstr, - [in] DWORDLONG dwlSize); - - // Copies the valid file data out of the old, possibly huge old capture - // file into a shorter new file. - // Return S_FALSE from your progress function to abort capture, S_OK to - // continue - HRESULT CopyCaptureFile( - [in] LPOLESTR lpwstrOld, - [in] LPOLESTR lpwstrNew, - [in] int fAllowEscAbort, // pressing ESC will abort? - [in] IAMCopyCaptureFileProgress *pCallback); // implement this to - // get progress - // Helper fn to find a certain pin on a filter. - HRESULT FindPin( - [in] IUnknown *pSource, - [in] PIN_DIRECTION pindir, // input or output? - [in] const GUID *pCategory, // what category? (or NULL) - [in] const GUID *pType, // what Major type (or NULL) - [in] BOOL fUnconnected, // must it be unconnected? - [in] int num, // which pin matching this? (0 based) - [out] IPin **ppPin); -} - -enum _AM_RENSDEREXFLAGS { - AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers -}; - -// -// IFilterGraph2 -// -// New methods on for IFilterGraph and IGraphBuilder will have to go here. -// - -[ - object, - uuid(36b73882-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface IFilterGraph2: IGraphBuilder { - - // Add a Moniker source moniker - HRESULT AddSourceFilterForMoniker( - [in] IMoniker *pMoniker, - [in] IBindCtx *pCtx, - [in, unique] LPCWSTR lpcwstrFilterName, - [out] IBaseFilter **ppFilter - ); - - // Specify the type for a reconnect - // This is better than Reconnect as sometime the parties to a - // reconnection can't remember what type they'd agreed (!) - HRESULT ReconnectEx - ( [in] IPin * ppin, // the pin to disconnect and reconnect - [in, unique] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL - ); - - // Render a pin without adding any new renderers - HRESULT RenderEx( [in] IPin *pPinOut, // Pin to render - [in] DWORD dwFlags, // flags - [in, out] DWORD *pvContext // Unused - set to NULL - ); - -#if 0 - // Method looks for a filter which supports the specified interface. If such - // a filter exists, an AddRef()'ed pointer to the requested interface is placed - // in *ppInterface. - // - // *ppInterface will be NULL on return if such a filter could not be found, and - // the method will return E_NOINTERFACE. - // - // pdwIndex is an internal index that is used for obtaining subsequent interfaces. - // *pdwIndex should be initialized to zero. It is set on return to a value that - // allows the implementation of FindFilterInterface to search for further interfaces - // if called again. If no more such interfaces exist, the method will return E_NOINTERFACE. - // - // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just - // a single filter in the graph that supports the interface. Otherwise it returns - // E_NOINTERFACE. - // - HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex ); - - // Tries to obtain the interface from the filter graph itself. If this fails, - // it attempts to find the unique filter that supports the interface. - // On failure the method will return E_NOINTERFACE. On success, it returns - // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface. - // - HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface ); - -#endif -} - -// -// StreamBuilder -// aka Graph building with constraints -// aka convergent graphs -// aka Closed captioning - -[ - object, - local, - uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IStreamBuilder : IUnknown { - - // Connect this output pin directly or indirectly, using transform filters - // if necessary to thing(s) that will render it, within this graph - // Move from Initial state to Rendered state. - - HRESULT Render - ( [in] IPin * ppinOut, // the output pin - [in] IGraphBuilder * pGraph // the graph - ); - - // Undo what you did in Render. Return to Initial state. - HRESULT Backout - ( [in] IPin * ppinOut, // the output pin - [in] IGraphBuilder * pGraph // the graph - ); -} - - -// async reader interface - supported by file source filters. Allows -// multiple overlapped reads from different positions - - -[ - object, - uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IAsyncReader : IUnknown -{ - // pass in your preferred allocator and your preferred properties. - // method returns the actual allocator to be used. Call GetProperties - // on returned allocator to learn alignment and prefix etc chosen. - // this allocator will be not be committed and decommitted by - // the async reader, only by the consumer. - // Must call this before calling Request. - HRESULT RequestAllocator( - [in] IMemAllocator* pPreferred, - [in] ALLOCATOR_PROPERTIES* pProps, - [out] IMemAllocator ** ppActual); - - // queue a request for data. - // media sample start and stop times contain the requested absolute - // byte position (start inclusive, stop exclusive). - // may fail if sample not obtained from agreed allocator. - // may fail if start/stop position does not match agreed alignment. - // samples allocated from source pin's allocator may fail - // GetPointer until after returning from WaitForNext. - // Stop position must be aligned - this means it may exceed duration. - // on completion, stop position will be corrected to unaligned - // actual data. - HRESULT Request( - [in] IMediaSample* pSample, - [in] DWORD_PTR dwUser); // user context - - // block until the next sample is completed or the timeout occurs. - // timeout (millisecs) may be 0 or INFINITE. Samples may not - // be delivered in order. If there is a read error of any sort, a - // notification will already have been sent by the source filter, - // and HRESULT will be an error. - // If ppSample is not null, then a Request completed with the result - // code returned. - HRESULT WaitForNext( - [in] DWORD dwTimeout, - [out] IMediaSample** ppSample, // completed sample - [out] DWORD_PTR * pdwUser); // user context - - // sync read of data. Sample passed in must have been acquired from - // the agreed allocator. Start and stop position must be aligned. - // equivalent to a Request/WaitForNext pair, but may avoid the - // need for a thread on the source filter. - HRESULT SyncReadAligned( - [in] IMediaSample* pSample); - - - // sync read. works in stopped state as well as run state. - // need not be aligned. Will fail if read is beyond actual total - // length. - HRESULT SyncRead( - [in] LONGLONG llPosition, // absolute file position - [in] LONG lLength, // nr bytes required - [out, size_is(lLength)] - BYTE* pBuffer); // write data here - - // return total length of stream, and currently available length. - // reads for beyond the available length but within the total length will - // normally succeed but may block for a long period. - HRESULT Length( - [out] LONGLONG* pTotal, - [out] LONGLONG* pAvailable); - - // cause all outstanding reads to return, possibly with a failure code - //(VFW_E_TIMEOUT) indicating they were cancelled. - // Between BeginFlush and EndFlush calls, Request calls will fail and - // WaitForNext calls will always complete immediately. - HRESULT BeginFlush(void); - HRESULT EndFlush(void); -} - - -// interface provided by the filtergraph itself to let other objects -// (especially plug-in distributors, but also apps like graphedt) know -// when the graph has changed. -[ - object, - uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IGraphVersion : IUnknown -{ - // returns the current graph version number - // this is incremented every time there is a change in the - // set of filters in the graph or in their connections - // - // if this is changed since your last enumeration, then re-enumerate - // the graph - HRESULT QueryVersion(LONG* pVersion); -} - - - - -// -// interface describing an object that uses resources. -// -// implement if: you request resources using IResourceManager. You will -// need to pass your implementation of this pointer as an in param. -// -// use if: you are a resource manager who implements IResourceManager -[ - object, - uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IResourceConsumer : IUnknown -{ - // you may acquire the resource specified. - // return values: - // S_OK -- I have successfully acquired it - // S_FALSE -- I will acquire it and call NotifyAcquire afterwards - // VFW_S_NOT_NEEDED: I no longer need the resource - // FAILED(hr)-I tried to acquire it and failed. - - HRESULT - AcquireResource( - [in] LONG idResource); - - - - // Please release the resource. - // return values: - // S_OK -- I have released it (and want it again when available) - // S_FALSE -- I will call NotifyRelease when I have released it - // other something went wrong. - HRESULT - ReleaseResource( - [in] LONG idResource); -} - - - -// interface describing a resource manager that will resolve contention for -// named resources. -// -// implement if: you are a resource manager. The filtergraph will be a resource -// manager, internally delegating to the system wide resource manager -// (when there is one) -// -// use if: you need resources that are limited. Use the resource manager to -// resolve contention by registering the resource with this interface, -// and requesting it from this interface whenever needed. -// -// or use if: you detect focus changes which should affect resource usage. -// Notifying change of focus to the resource manager will cause the resource -// manager to switch contended resources to the objects that have the user's -// focus -[ - object, - uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IResourceManager : IUnknown -{ - // tell the manager how many there are of a resource. - // ok if already registered. will take new count. if new count - // is lower, will de-allocate resources to new count. - // - // You get back a token that will be used in further calls. - // - // Passing a count of 0 will eliminate this resource. There is currently - // no defined way to find the id without knowing the count. - // - HRESULT - Register( - [in] LPCWSTR pName, // this named resource - [in] LONG cResource, // has this many instances - [out] LONG* plToken // token placed here on return - ); - - HRESULT - RegisterGroup( - [in] LPCWSTR pName, // this named resource group - [in] LONG cResource, // has this many resources - [in, size_is(cResource)] - LONG* palTokens, // these are the contained resources - [out] LONG* plToken // group resource id put here on return - ); - - // request the use of a given, registered resource. - // possible return values: - // S_OK == yes you can use it now - // S_FALSE == you will be called back when the resource is available - // other - there is an error. - // - // The priority of this request should be affected by the associated - // focus object -- that is, when SetFocus is called for that focus - // object (or a 'related' object) then my request should be put through. - // - // A filter should pass the filter's IUnknown here. The filtergraph - // will match filters to the filtergraph, and will attempt to trace - // filters to common source filters when checking focus objects. - // The Focus object must be valid for the entire lifetime of the request - // -- until you call CancelRequest or NotifyRelease(id, p, FALSE) - HRESULT - RequestResource( - [in] LONG idResource, - [in] IUnknown* pFocusObject, - [in] IResourceConsumer* pConsumer - ); - - - // notify the resource manager that an acquisition attempt completed. - // Call this method after an AcquireResource method returned - // S_FALSE to indicate asynchronous acquisition. - // HR should be S_OK if the resource was successfully acquired, or a - // failure code if the resource could not be acquired. - HRESULT - NotifyAcquire( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer, - [in] HRESULT hr); - - // Notify the resource manager that you have released a resource. Call - // this in response to a ReleaseResource method, or when you have finished - // with the resource. bStillWant should be TRUE if you still want the - // resource when it is next available, or FALSE if you no longer want - // the resource. - HRESULT - NotifyRelease( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer, - [in] BOOL bStillWant); - - // I don't currently have the resource, and I no longer need it. - HRESULT - CancelRequest( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer); - - // Notify the resource manager that a given object has been given the - // user's focus. In ActiveMovie, this will normally be a video renderer - // whose window has received the focus. The filter graph will switch - // contended resources to (in order): - // requests made with this same focus object - // requests whose focus object shares a common source with this - // requests whose focus object shares a common filter graph - // After calling this, you *must* call ReleaseFocus before the IUnknown - // becomes invalid, unless you can guarantee that another SetFocus - // of a different object is done in the meantime. No addref is held. - // - // The resource manager will hold this pointer until replaced or cancelled, - // and will use it to resolve resource contention. It will call - // QueryInterface for IBaseFilter at least and if found will call methods on - // that interface. - HRESULT - SetFocus( - [in] IUnknown* pFocusObject); - - // Sets the focus to NULL if the current focus object is still - // pFocusObject. Call this when - // the focus object is about to be destroyed to ensure that no-one is - // still referencing the object. - HRESULT - ReleaseFocus( - [in] IUnknown* pFocusObject); - - - -// !!! still need -// -- app override (some form of SetPriority) -// -- enumeration and description of resources - -} - - -// -// Interface representing an object that can be notified about state -// and other changes within a filter graph. The filtergraph will call plug-in -// distributors that expose this optional interface so that they can -// respond to appropriate changes. -// -// Implement if: you are a plug-in distributor (your class id is found -// under HKCR\Interface\\Distributor= for some interface). -// -// Use if: you are the filtergraph. -[ - object, - uuid(56a868af-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) -] -interface IDistributorNotify : IUnknown -{ - // called when graph is entering stop state. Called before - // filters are stopped. - HRESULT Stop(void); - - // called when graph is entering paused state, before filters are - // notified - HRESULT Pause(void); - - // called when graph is entering running state, before filters are - // notified. tStart is the stream-time offset parameter that will be - // given to each filter's IBaseFilter::Run method. - HRESULT Run(REFERENCE_TIME tStart); - - // called when the graph's clock is changing, with the new clock. Addref - // the clock if you hold it beyond this method. Called before - // the filters are notified. - HRESULT SetSyncSource( - [in] IReferenceClock * pClock); - - // called when the set of filters or their connections has changed. - // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything - // that will lead to one of these). - // You don't need to rebuild your list of interesting filters at this point - // but you should release any refcounts you hold on any filters that - // have been removed. - HRESULT NotifyGraphChange(void); -} - -typedef enum { - AM_STREAM_INFO_START_DEFINED = 0x00000001, - AM_STREAM_INFO_STOP_DEFINED = 0x00000002, - AM_STREAM_INFO_DISCARDING = 0x00000004, - AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010 -} AM_STREAM_INFO_FLAGS; - -// Stream information -typedef struct { - REFERENCE_TIME tStart; - REFERENCE_TIME tStop; - DWORD dwStartCookie; - DWORD dwStopCookie; - DWORD dwFlags; -} AM_STREAM_INFO; - -// -// IAMStreamControl -// - -[ - object, - uuid(36b73881-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface IAMStreamControl : IUnknown -{ - // The REFERENCE_TIME pointers may be null, which - // indicates immediately. If the pointer is non-NULL - // and dwCookie is non-zero, then pins should send - // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED - // with an IPin pointer and the cookie, thus allowing - // apps to tie the events back to their requests. - // If either dwCookies is zero, or the pointer is null, - // then no event is sent. - - // If you have a capture pin hooked up to a MUX input pin and they - // both support IAMStreamControl, you'll want the MUX to signal the - // stop so you know the last frame was written out. In order for the - // MUX to know it's finished, the capture pin will have to send one - // extra sample after it was supposed to stop, so the MUX can trigger - // off that. So you would set bSendExtra to TRUE for the capture pin - // Leave it FALSE in all other cases. - - HRESULT StartAt( [in] const REFERENCE_TIME * ptStart, - [in] DWORD dwCookie ); - HRESULT StopAt( [in] const REFERENCE_TIME * ptStop, - [in] BOOL bSendExtra, - [in] DWORD dwCookie ); - HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo); -} - - - -// -// ISeekingPassThru -// - -[ - object, - uuid(36b73883-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) -] -interface ISeekingPassThru : IUnknown -{ - HRESULT Init( [in] BOOL bSupportRendering, - [in] IPin *pPin); -} - - - -// -// IAMStreamConfig - pin interface -// - -// A capture filter or compression filter's output pin -// supports this interface - no matter what data type you produce. - -// This interface can be used to set the output format of a pin (as an -// alternative to connecting the pin using a specific media type). -// After setting an output format, the pin will use that format -// the next time it connects to somebody, so you can just Render that -// pin and get a desired format without using Connect(CMediaType) -// Your pin should do that by ONLY OFFERING the media type set in SetFormat -// in its enumeration of media types, and no others. This will ensure that -// that format is indeed used for connection (or at least offer it first). -// An application interested in enumerating accepted mediatypes may have to -// do so BEFORE calling SetFormat. - -// But this interface's GetStreamCaps function can get more information -// about accepted media types than the traditional way of enumerating a pin's -// media types, so it should typically be used instead. -// GetStreamCaps gets information about the kinds of formats allowed... how -// it can stretch and crop, and the frame rate and data rates allowed (for -// video) - -// VIDEO EXAMPLE -// -// GetStreamCaps returns a whole array of {MediaType, Capabilities}. -// Let's say your capture card supports JPEG anywhere between 160x120 and -// 320x240, and also the size 640x480. Also, say it supports RGB24 at -// resolutions between 160x120 and 320x240 but only multiples of 8. You would -// expose these properties by offering a media type of 320 x 240 JPEG -// (if that is your default or preferred size) coupled with -// capabilities saying minimum 160x120 and maximum 320x240 with granularity of -// 1. The next pair you expose is a media type of 640x480 JPEG coupled with -// capabilities of min 640x480 max 640x480. The third pair is media type -// 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8. -// In this way you can expose almost every quirk your card might have. -// An application interested in knowing what compression formats you provide -// can get all the pairs and make a list of all the unique sub types of the -// media types. -// -// If a filter's output pin is connected with a media type that has rcSource -// and rcTarget not empty, it means the filter is being asked to stretch the -// rcSource sub-rectangle of its InputSize (the format of the input pin for -// a compressor, and the largest bitmap a capture filter can generate with -// every pixel unique) into the rcTarget sub-rectangle of its output format. -// For instance, if a video compressor has as input 160x120 RGB, and as output -// 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100) -// this means the compressor is being asked to take a 10x10 piece of the 160x120 -// RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap, -// leaving the rest of the 320x240 bitmap untouched. -// A filter does not have to support this and can fail to connect with a -// media type where rcSource and rcTarget are not empty. -// -// Your output pin is connected to the next filter with a certain media -// type (either directly or using the media type passed by SetFormat), -// and you need to look at the AvgBytesPerSecond field of the format -// of that mediatype to see what data rate you are being asked to compress -// the video to, and use that data rate. Using the number of frames per -// second in AvgTimePerFrame, you can figure out how many bytes each frame -// is supposed to be. You can make it smaller, but NEVER EVER make a bigger -// data rate. For a video compressor, your input pin's media type tells you -// the frame rate (use that AvgTimePerFrame). For a capture filter, the -// output media type tells you, so use that AvgTimePerFrame. -// -// The cropping rectangle described below is the same as the rcSrc of the -// output pin's media type. -// -// The output rectangle described below is the same of the width and height -// of the BITMAPINFOHEADER of the media type of the output pin's media type - - -// AUDIO EXAMPLE -// -// This API can return an array of pairs of (media type, capabilities). -// This can be used to expose all kinds of wierd capabilities. Let's say you -// do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or -// stereo, and you also do 48,000 16bit stereo as a special combination. -// You would expose 3 pairs. The first pair would have Min Freq of 11025 and -// Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the -// capabilites structure, and a media type of anything you like, maybe -// 22kHz, 8bit stereo as a default. -// The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in -// the capabilities structure and the media type could be something like -// 44kHz, 16bit stereo as a default (the media type in the pair should always -// be something legal as described by the capabilities structure... the -// structure tells you how you can change the media type to produce other -// legal media types... for instance changing 44kHz to 29010Hz would be legal, -// but changing bits from 16 to 14 would not be.) -// The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2 -// MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo. -// You can also use the Granularity elements of the structure (like the example -// for video) if you support values that multiples of n, eg. you could say -// minimum bits per sample 8, max 16, and granularity 8 to describe doing -// either 8 or 16 bit all in one structure -// -// If you support non-PCM formats, the media type returned in GetStreamCaps -// can show which non-PCM formats you support (with a default sample rate, -// bit rate and channels) and the capabilities structure going with that -// media type can describe which other sample rates, bit rates and channels -// you support. - -[ - object, - uuid(C6E13340-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) -] -interface IAMStreamConfig : IUnknown -{ - - // this is the structure returned by a VIDEO filter - // - typedef struct _VIDEO_STREAM_CONFIG_CAPS { - - GUID guid; // will be MEDIATYPE_Video - - // the logical or of all the AnalogVideoStandard's supported - // typically zero if not supported - ULONG VideoStandard; - - // the inherent size of the incoming signal... taken from the input - // pin for a compressor, or the largest size a capture filter can - // digitize the signal with every pixel still unique - SIZE InputSize; - - // The input of a compressor filter may have to be connected for these - // to be known - - // smallest rcSrc cropping rect allowed - SIZE MinCroppingSize; - // largest rcSrc cropping rect allowed - SIZE MaxCroppingSize; - // granularity of cropping size - eg only widths a multiple of 4 allowed - int CropGranularityX; - int CropGranularityY; - // alignment of cropping rect - eg rect must start on multiple of 4 - int CropAlignX; - int CropAlignY; - - // The input of a compressor filter may have to be connected for these - // to be known - - // smallest bitmap this pin can produce - SIZE MinOutputSize; - // largest bitmap this pin can produce - SIZE MaxOutputSize; - // granularity of output bitmap size - int OutputGranularityX; - int OutputGranularityY; - // !!! what about alignment of rcTarget inside BIH if different? - - // how well can you stretch in the x direction? 0==not at all - // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation - // etc. - int StretchTapsX; - int StretchTapsY; - // how well can you shrink in the x direction? 0==not at all - // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation - // etc. - int ShrinkTapsX; - int ShrinkTapsY; - - // CAPTURE filter only - what frame rates are allowed? - LONGLONG MinFrameInterval; - LONGLONG MaxFrameInterval; - - // what data rates can this pin produce? - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; - } VIDEO_STREAM_CONFIG_CAPS; - - - // this is the structure returned by an AUDIO filter - // - typedef struct _AUDIO_STREAM_CONFIG_CAPS { - - GUID guid; // will be MEDIATYPE_Audio - ULONG MinimumChannels; - ULONG MaximumChannels; - ULONG ChannelsGranularity; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG BitsPerSampleGranularity; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG SampleFrequencyGranularity; - } AUDIO_STREAM_CONFIG_CAPS; - - // - only allowed when pin is not streaming, else the call will FAIL - // - If your output pin is not yet connected, and you can - // connect your output pin with this media type, you should - // succeed the call, and start offering it first (enumerate as format#0) - // from GetMediaType so that this format will be used to connect with - // when you do connect to somebody - // - if your output pin is already connected, and you can provide this - // type, reconnect your pin. If the other pin can't accept it, FAIL - // this call and leave your connection alone. - HRESULT SetFormat( - [in] AM_MEDIA_TYPE *pmt); - - // the format it's connected with, or will connect with - // the application is responsible for calling DeleteMediaType(*ppmt); - HRESULT GetFormat( - [out] AM_MEDIA_TYPE **ppmt); - - // how many different Stream Caps structures are there? - // also, how big is the stream caps structure? - HRESULT GetNumberOfCapabilities( - [out] int *piCount, - [out] int *piSize); // pSCC of GetStreamCaps needs to be this big - - // - gets one of the pairs of {Mediatype, Caps} - // - return S_FALSE if iIndex is too high - // - the application is responsible for calling DeleteMediaType(*ppmt); - // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video - // or MEDIATYPE_Audio, so you can tell if you have a pointer to a - // VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure - // There could potentially be many more possibilities other than video - // or audio. - HRESULT GetStreamCaps( - [in] int iIndex, // 0 to #caps-1 - [out] AM_MEDIA_TYPE **ppmt, - [out] BYTE *pSCC); - -} - - - -// Interface to control interleaving of different streams in one file -[ -object, -uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86), -pointer_default(unique) -] -interface IConfigInterleaving : IUnknown -{ - import "unknwn.idl"; - - typedef enum - { - // uninterleaved - samples written out in the order they - // arrive. - INTERLEAVE_NONE, - - // approximate interleaving with less overhead for video - // capture - INTERLEAVE_CAPTURE, - - // full, precise interleaving. slower. - INTERLEAVE_FULL, - - // samples written out in the order they arrive. writes are - // buffered - INTERLEAVE_NONE_BUFFERED - - } InterleavingMode; - - HRESULT put_Mode( - [in] InterleavingMode mode - ); - - HRESULT get_Mode( - [out] InterleavingMode *pMode - ); - - HRESULT put_Interleaving( - [in] const REFERENCE_TIME *prtInterleave, - [in] const REFERENCE_TIME *prtPreroll - ); - - HRESULT get_Interleaving( - [out] REFERENCE_TIME *prtInterleave, - [out] REFERENCE_TIME *prtPreroll - ); -} - -// Interface to control the AVI mux -[ -object, -uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6), -pointer_default(unique) -] -interface IConfigAviMux : IUnknown -{ - import "unknwn.idl"; - - // control whether the AVI mux adjusts the frame rate or audio - // sampling rate for drift when the file is closed. -1 to disables - // this behavior. - HRESULT SetMasterStream([in] LONG iStream); - HRESULT GetMasterStream([out] LONG *pStream); - - // control whether the AVI mux writes out an idx1 index chunk for - // compatibility with older AVI players. - HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex); - HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex); -} - - //--------------------------------------------------------------------- - // CompressionCaps enum - //--------------------------------------------------------------------- - - // This tells you which features of IAMVideoCompression are supported - - // CanCrunch means that it can compress video to a specified data rate - // If so, then the output pin's media type will contain that data rate - // in the format's AvgBytesPerSecond field, and that should be used. - - typedef enum - { - CompressionCaps_CanQuality = 0x01, - CompressionCaps_CanCrunch = 0x02, - CompressionCaps_CanKeyFrame = 0x04, - CompressionCaps_CanBFrame = 0x08, - CompressionCaps_CanWindow = 0x10 - } CompressionCaps; - - - - //--------------------------------------------------------------------- - // IAMVideoCompression interface - // - // Control compression parameters - pin interface - //--------------------------------------------------------------------- - - // This interface is implemented by the output pin of a video capture - // filter or video compressor that provides video data - - // You use this interface to control how video is compressed... how - // many keyframes, etc., and to find information like capabilities and - // the description of this compressor - - [ - object, - uuid(C6E13343-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMVideoCompression : IUnknown - { - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanKeyFrame - // - KeyFrameRate < 0 means use the compressor default - // - KeyFrames == 0 means only the first frame is a key - HRESULT put_KeyFrameRate ( - [in] long KeyFrameRate); - - HRESULT get_KeyFrameRate ( - [out] long * pKeyFrameRate); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanBFrame - // - If keyframes are every 10, and there are 3 P Frames per key, - // they will be spaced evenly between the key frames and the other - // 6 frames will be B frames - // - PFramesPerKeyFrame < 0 means use the compressor default - HRESULT put_PFramesPerKeyFrame ( - [in] long PFramesPerKeyFrame); - - HRESULT get_PFramesPerKeyFrame ( - [out] long * pPFramesPerKeyFrame); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanQuality - // - Controls image quality - // - If you are compressing to a fixed data rate, a high quality - // means try and use all of the data rate, and a low quality means - // feel free to use much lower than the data rate if you want to. - // - Quality < 0 means use the compressor default - HRESULT put_Quality ( - [in] double Quality); - - HRESULT get_Quality ( - [out] double * pQuality); - - // If you have set a data rate of 100K/sec on a 10fps movie, that - // will normally mean each frame must be <=10K. But a window size - // means every consecutive n frames must average to the data rate, - // but an individual frame (if n > 1) is allowed to exceed the - // frame size suggested by the data rate - HRESULT put_WindowSize ( - [in] DWORDLONG WindowSize); - - HRESULT get_WindowSize ( - [out] DWORDLONG * pWindowSize); - - // - pszVersion might be "Version 2.1.0" - // - pszDescription might be "Danny's awesome video compressor" - // - pcbVersion and pcbDescription will be filled in with the - // required length if they are too short - // - *pCapabilities is a logical OR of some CompressionCaps flags - HRESULT GetInfo( - [out, size_is(*pcbVersion)] WCHAR * pszVersion, - [in,out] int *pcbVersion, - [out, size_is(*pcbDescription)] LPWSTR pszDescription, - [in,out] int *pcbDescription, - [out] long *pDefaultKeyFrameRate, - [out] long *pDefaultPFramesPerKey, - [out] double *pDefaultQuality, - [out] long *pCapabilities //CompressionCaps - ); - - // - this means when this frame number comes along after the graph - // is running, make it a keyframe even if you weren't going to - HRESULT OverrideKeyFrame( - [in] long FrameNumber - ); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanCrunch - // - this means when this frame number comes along after the graph - // is running, make it this many bytes big instead of whatever size - // you were going to make it. - HRESULT OverrideFrameSize( - [in] long FrameNumber, - [in] long Size - ); - - } - - //--------------------------------------------------------------------- - // VfwCaptureDialogs enum - //--------------------------------------------------------------------- - - typedef enum - { - VfwCaptureDialog_Source = 0x01, - VfwCaptureDialog_Format = 0x02, - VfwCaptureDialog_Display = 0x04 - } VfwCaptureDialogs; - - - //--------------------------------------------------------------------- - // VfwCompressDialogs enum - //--------------------------------------------------------------------- - - typedef enum - { - VfwCompressDialog_Config = 0x01, - VfwCompressDialog_About = 0x02, - // returns S_OK if the dialog exists and can be shown, else S_FALSE - VfwCompressDialog_QueryConfig = 0x04, - VfwCompressDialog_QueryAbout = 0x08 - } VfwCompressDialogs; - - - //--------------------------------------------------------------------- - // IAMVfwCaptureDialogs - filter interface - // - // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY - //--------------------------------------------------------------------- - - // This interface is supported only by Microsoft's Video For Windows - // capture driver Capture Filter. It allows an application to bring up - // one of the 3 driver dialogs that VfW capture drivers have. - - [ - object, - local, - uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMVfwCaptureDialogs : IUnknown - { - HRESULT HasDialog( - [in] int iDialog // VfwCaptureDialogs enum - ); - - HRESULT ShowDialog( - [in] int iDialog, // VfwCaptureDialogs enum - [in] HWND hwnd - ); - - HRESULT SendDriverMessage( - [in] int iDialog, // VfwCaptureDialogs enum - [in] int uMsg, - [in] long dw1, - [in] long dw2 - ); - - // - iDialog can be one of the VfwCaptureDialogs enums - // - HasDialog returns S_OK if it has the dialog, else S_FALSE - // - ShowDialog can only be called when not streaming or when another - // dialog is not already up - // - SendDriverMessage can send a secret message to the capture driver. - // USE IT AT YOUR OWN RISK! - } - - //--------------------------------------------------------------------- - // IAMVfwCompressDialogs - filter interface - // - // Show a VfW codec driver dialog - CONFIG or ABOUT - //--------------------------------------------------------------------- - - // This interface is supported only by Microsoft's ICM Compressor filter - // (Co). It allows an application to bring up either the Configure or - // About dialogs for the ICM codec that it is currently using. - - [ - object, - local, - uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMVfwCompressDialogs : IUnknown - { - - // Bring up a dialog for this codec - HRESULT ShowDialog( - [in] int iDialog, // VfwCompressDialogs enum - [in] HWND hwnd - ); - - // Calls ICGetState and gives you the result - HRESULT GetState( - [out, size_is(*pcbState)] LPVOID pState, - [in, out] int *pcbState - ); - - // Calls ICSetState - HRESULT SetState( - [in, size_is(cbState)] LPVOID pState, - [in] int cbState - ); - - // Send a codec specific message - HRESULT SendDriverMessage( - [in] int uMsg, - [in] long dw1, - [in] long dw2 - ); - - // - iDialog can be one of the VfwCaptureDialogs enums - // - ShowDialog can only be called when not streaming or when no other - // dialog is up already - // - an application can call GetState after ShowDialog(CONFIG) to - // see how the compressor was configured and next time the graph - // is used, it can call SetState with the data it saved to return - // the codec to the state configured by the dialog box from last time - // - GetState with a NULL pointer returns the size needed - // - SendDriverMessage can send a secret message to the codec. - // USE IT AT YOUR OWN RISK! - } - - - //--------------------------------------------------------------------- - // IAMDroppedFrames interface - // - // Report status of capture - pin interface - //--------------------------------------------------------------------- - - // A capture filter's video output pin supports this. It reports - // how many frames were not sent (dropped), etc. - - // Every time your filter goes from STOPPED-->PAUSED, you reset all your - // counts to zero. - - // An app may call this all the time while you are capturing to see how - // capturing is going. MAKE SURE you always return as current information - // as possible while you are running. - - // When your capture filter starts running, it starts by sending frame 0, - // then 1, 2, 3, etc. The time stamp of each frame sent should correspond - // to the graph clock's time when the image was digitized. The end time - // is the start time plus the duration of the video frame. - // You should also set the MediaTime of each sample (SetMediaTime) as well. - // This should be the frame number ie (0,1) (1,2) (2,3). - // If a frame is dropped, a downstream filter will be able to tell easily - // not by looking for gaps in the regular time stamps, but by noticing a - // frame number is missing (eg. (1,2) (2,3) (4,5) (5,6) means frame 3 - // was dropped. - - // Using the info provided by this interface, an application can figure out - // the number of frames dropped, the frame rate achieved (the length of - // time the graph was running divided by the number of frames not dropped), - // and the data rate acheived (the length of time the graph was running - // divided by the average frame size). - - // If your filter is running, then paused, and then run again, you need - // to continue to deliver frames as if it was never paused. The first - // frame after the second RUN cannot be time stamped earlier than the last - // frame sent before the pause. - - // Your filter must always increment the MediaTime of each sample sent. - // Never send the same frame # twice, and never go back in time. The - // regular time stamp of a sample can also never go back in time. - - [ - object, - uuid(C6E13344-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMDroppedFrames : IUnknown - { - // Get the number of dropped frames - HRESULT GetNumDropped( - [out] long * plDropped - - ); - - //Get the number of non-dropped frames - HRESULT GetNumNotDropped( - [out] long * plNotDropped - - ); - - // - plArray points to an array of lSize longs. The filter will - // fill it with the frame number of the first lSize frames dropped. - // A filter may not have bothered to remember as many as you asked - // for, so it will set *plNumCopied to the number of frames it filled - // in. - HRESULT GetDroppedInfo( - [in] long lSize, - [out] long * plArray, - [out] long * plNumCopied - ); - - // - This is the average size of the frames it didn't drop (in bytes) - HRESULT GetAverageFrameSize( - [out] long * plAverageSize - - ); - - } - - - - cpp_quote("#define AMF_AUTOMATICGAIN -1.0") - - //--------------------------------------------------------------------- - // IAMAudioInputMixer interface - // - // Sets the recording levels, pan and EQ for the audio card inputs - //--------------------------------------------------------------------- - - // This interface is implemented by each input pin of an audio capture - // filter, to tell it what level, panning, and EQ to use for each input. - // The name of each pin will reflect the type of input, eg. "Line input 1" - // or "Mic". An application uses the pin names to decide how it wants to - // set the recording levels - - // This interface can also be supported by the audio capture filter itself - // to control to overall record level and panning after the mix - - [ - object, - uuid(54C39221-8380-11d0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMAudioInputMixer : IUnknown - { - // This interface is only supported by the input pins, not the filter - // If disabled, this channel will not be mixed in as part of the - // recorded signal. - HRESULT put_Enable ( - [in] BOOL fEnable); // TRUE=enable FALSE=disable - - //Is this channel enabled? - HRESULT get_Enable ( - [out] BOOL *pfEnable); - - // When set to mono mode, making a stereo recording of this channel - // will have both channels contain the same data... a mixture of the - // left and right signals - HRESULT put_Mono ( - [in] BOOL fMono); // TRUE=mono FALSE=multi channel - - //all channels combined into a mono signal? - HRESULT get_Mono ( - [out] BOOL *pfMono); - - // !!! WILL CARDS BE ABLE TO BOOST THE GAIN? - //Set the record level for this channel - HRESULT put_MixLevel ( - [in] double Level); // 0 = off, 1 = full (unity?) volume - // AMF_AUTOMATICGAIN, if supported, - // means automatic - - //Get the record level for this channel - HRESULT get_MixLevel ( - [out] double *pLevel); - - // For instance, when panned full left, and you make a stereo recording - // of this channel, you will record a silent right channel. - HRESULT put_Pan ( - [in] double Pan); // -1 = full left, 0 = centre, 1 = right - - //Get the pan for this channel - HRESULT get_Pan ( - [out] double *pPan); - - // Boosts the bass of low volume signals before they are recorded - // to compensate for the fact that your ear has trouble hearing quiet - // bass sounds - HRESULT put_Loudness ( - [in] BOOL fLoudness);// TRUE=on FALSE=off - - HRESULT get_Loudness ( - [out] BOOL *pfLoudness); - - // boosts or cuts the treble of the signal before it's recorded by - // a certain amount of dB - HRESULT put_Treble ( - [in] double Treble); // gain in dB (-ve = attenuate) - - //Get the treble EQ for this channel - HRESULT get_Treble ( - [out] double *pTreble); - - // This is the maximum value allowed in put_Treble. ie 6.0 means - // any value between -6.0 and 6.0 is allowed - HRESULT get_TrebleRange ( - [out] double *pRange); // largest value allowed - - // boosts or cuts the bass of the signal before it's recorded by - // a certain amount of dB - HRESULT put_Bass ( - [in] double Bass); // gain in dB (-ve = attenuate) - - // Get the bass EQ for this channel - HRESULT get_Bass ( - [out] double *pBass); - - // This is the maximum value allowed in put_Bass. ie 6.0 means - // any value between -6.0 and 6.0 is allowed - HRESULT get_BassRange ( - [out] double *pRange); // largest value allowed - - } - - - //--------------------------------------------------------------------- - // IAMBufferNegotiation interface - // - // Tells a pin what kinds of buffers to use when connected - //--------------------------------------------------------------------- - - // This interface can be implemented by any pin that will connect to - // another pin using IMemInputPin. All capture filters should support - // this interface. - - // SuggestAllocatorProperties is a way for an application to get - // in on the buffer negotiation process for a pin. This pin will use - // the numbers given to it by the application as its request to the - // allocator. An application can use a negative number for any element - // in the ALLOCATOR_PROPERTIES to mean "don't care". An application must - // call this function before the pin is connected, or it will be too late - // To ensure that an application gets what it wants, it would be wise to - // call this method on both pins being connected together, so the other - // pin doesn't overrule the application's request. - - // GetAllocatorProperties can only be called after a pin is connected and - // it returns the properties of the current allocator being used - - [ - object, - uuid(56ED71A0-AF5F-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMBufferNegotiation : IUnknown - { - HRESULT SuggestAllocatorProperties ( - [in] const ALLOCATOR_PROPERTIES *pprop); - - HRESULT GetAllocatorProperties ( - [out] ALLOCATOR_PROPERTIES *pprop); - - } - - - //--------------------------------------------------------------------- - // AnalogVideoStandard enum - //--------------------------------------------------------------------- - - typedef enum tagAnalogVideoStandard - { - AnalogVideo_None = 0x00000000, // This is a digital sensor - AnalogVideo_NTSC_M = 0x00000001, // 75 IRE Setup - AnalogVideo_NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup - AnalogVideo_NTSC_433 = 0x00000004, - - AnalogVideo_PAL_B = 0x00000010, - AnalogVideo_PAL_D = 0x00000020, - AnalogVideo_PAL_G = 0x00000040, - AnalogVideo_PAL_H = 0x00000080, - AnalogVideo_PAL_I = 0x00000100, - AnalogVideo_PAL_M = 0x00000200, - AnalogVideo_PAL_N = 0x00000400, - - AnalogVideo_PAL_60 = 0x00000800, - - AnalogVideo_SECAM_B = 0x00001000, - AnalogVideo_SECAM_D = 0x00002000, - AnalogVideo_SECAM_G = 0x00004000, - AnalogVideo_SECAM_H = 0x00008000, - AnalogVideo_SECAM_K = 0x00010000, - AnalogVideo_SECAM_K1 = 0x00020000, - AnalogVideo_SECAM_L = 0x00040000, - AnalogVideo_SECAM_L1 = 0x00080000, - - AnalogVideo_PAL_N_COMBO // Argentina - = 0x00100000 - } AnalogVideoStandard; - - cpp_quote("#define AnalogVideo_NTSC_Mask 0x00000007") - cpp_quote("#define AnalogVideo_PAL_Mask 0x00100FF0") - cpp_quote("#define AnalogVideo_SECAM_Mask 0x000FF000") - - - //--------------------------------------------------------------------- - // TunerInputType enum - //--------------------------------------------------------------------- - - typedef enum tagTunerInputType - { - TunerInputCable, - TunerInputAntenna - } TunerInputType; - - //--------------------------------------------------------------------- - // VideoCopyProtectionType enum - //--------------------------------------------------------------------- - - typedef enum - { - VideoCopyProtectionMacrovisionBasic, - VideoCopyProtectionMacrovisionCBI - } VideoCopyProtectionType; - - //--------------------------------------------------------------------- - // PhysicalConnectorType enum - //--------------------------------------------------------------------- - - typedef enum tagPhysicalConnectorType - { - PhysConn_Video_Tuner = 1, - PhysConn_Video_Composite, - PhysConn_Video_SVideo, - PhysConn_Video_RGB, - PhysConn_Video_YRYBY, - PhysConn_Video_SerialDigital, - PhysConn_Video_ParallelDigital, - PhysConn_Video_SCSI, - PhysConn_Video_AUX, - PhysConn_Video_1394, - PhysConn_Video_USB, - PhysConn_Video_VideoDecoder, - PhysConn_Video_VideoEncoder, - PhysConn_Video_SCART, - PhysConn_Video_Black, - - - PhysConn_Audio_Tuner = 0x1000, - PhysConn_Audio_Line, - PhysConn_Audio_Mic, - PhysConn_Audio_AESDigital, - PhysConn_Audio_SPDIFDigital, - PhysConn_Audio_SCSI, - PhysConn_Audio_AUX, - PhysConn_Audio_1394, - PhysConn_Audio_USB, - PhysConn_Audio_AudioDecoder, - } PhysicalConnectorType; - - - - - //--------------------------------------------------------------------- - // IAMAnalogVideoDecoder interface - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13350-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMAnalogVideoDecoder : IUnknown - { - - //Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1... - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - //Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT put_TVFormat( - [in] long lAnalogVideoStandard - ); - - // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // True if horizontal sync is locked - HRESULT get_HorizontalLocked ( - [out] long * plLocked); - - // True if connected to a VCR (changes PLL timing) - HRESULT put_VCRHorizontalLocking ( - [in] long lVCRHorizontalLocking); - - HRESULT get_VCRHorizontalLocking ( - [out] long * plVCRHorizontalLocking); - - // Returns the number of lines in the video signal")] - HRESULT get_NumberOfLines ( - [out] long *plNumberOfLines); - - // Enables or disables the output bus - HRESULT put_OutputEnable ( - [in] long lOutputEnable); - - HRESULT get_OutputEnable ( - [out] long *plOutputEnable); - - } - - - //--------------------------------------------------------------------- - // VideoProcAmp Property enum - //--------------------------------------------------------------------- - - typedef enum tagVideoProcAmpProperty - { - VideoProcAmp_Brightness, - VideoProcAmp_Contrast, - VideoProcAmp_Hue, - VideoProcAmp_Saturation, - VideoProcAmp_Sharpness, - VideoProcAmp_Gamma, - VideoProcAmp_ColorEnable, - VideoProcAmp_WhiteBalance, - VideoProcAmp_BacklightCompensation, - VideoProcAmp_Gain - } VideoProcAmpProperty; - - //--------------------------------------------------------------------- - // VideoProcAmp Flags enum - //--------------------------------------------------------------------- - - typedef enum tagVideoProcAmpFlags - { - VideoProcAmp_Flags_Auto = 0x0001, - VideoProcAmp_Flags_Manual = 0x0002 - } VideoProcAmpFlags; - - //--------------------------------------------------------------------- - // IAMVideoProcAmp interface - // - // Adjusts video quality in either the analog or digital domain. - // - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13360-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMVideoProcAmp : IUnknown - { - // Returns min, max, step size, and default values - HRESULT GetRange( - [in] long Property, // Which property to query - [out] long * pMin, // Range minimum - [out] long * pMax, // Range maxumum - [out] long * pSteppingDelta,// Step size - [out] long * pDefault, // Default value - [out] long * pCapsFlags // VideoProcAmpFlags - - ); - - // Set a VideoProcAmp property - HRESULT Set( - [in] long Property, // VideoProcAmpProperty - [in] long lValue, // Value to set - [in] long Flags // VideoProcAmp_Flags_* - - ); - - // Get a VideoProcAmp property - HRESULT Get( - [in] long Property, // VideoProcAmpProperty - [out] long * lValue, // Current value - [out] long * Flags // VideoProcAmp_Flags_* - ); - } - - - //--------------------------------------------------------------------- - // CameraControl Property enum - //--------------------------------------------------------------------- - - typedef enum tagCameraControlProperty - { - CameraControl_Pan, - CameraControl_Tilt, - CameraControl_Roll, - CameraControl_Zoom, - CameraControl_Exposure, - CameraControl_Iris, - CameraControl_Focus - } CameraControlProperty; - - //--------------------------------------------------------------------- - // CameraControl Flags enum - //--------------------------------------------------------------------- - - typedef enum tagCameraControlFlags - { - CameraControl_Flags_Auto = 0x0001, - CameraControl_Flags_Manual = 0x0002 - } CameraControlFlags; - - //--------------------------------------------------------------------- - // IAMCameraControl interface - // - // Control of local or remote cameras - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13370-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMCameraControl : IUnknown - { - // Returns min, max, step size, and default values - HRESULT GetRange( - [in] long Property, // Which property to query - [out] long * pMin, // Range minimum - [out] long * pMax, // Range maxumum - [out] long * pSteppingDelta,// Step size - [out] long * pDefault, // Default value - [out] long * pCapsFlags // CamaeraControlFlags - - ); - - // Set a CameraControl property - HRESULT Set( - [in] long Property, // CameraControlProperty - [in] long lValue, // Value to set - [in] long Flags // CameraControl_Flags_* - - ); - - // Get a CameraControl property - HRESULT Get( - [in] long Property, // CameraControlProperty - [out] long * lValue, // Current value - [out] long * Flags // CameraControl_Flags_* - ); - } - - //--------------------------------------------------------------------- - // VideoControl Flags enum - //--------------------------------------------------------------------- - - typedef enum tagVideoControlFlags - { - VideoControlFlag_FlipHorizontal = 0x0001, - VideoControlFlag_FlipVertical = 0x0002, - VideoControlFlag_ExternalTriggerEnable = 0x0004, - VideoControlFlag_Trigger = 0x0008 - - } VideoControlFlags; - - //--------------------------------------------------------------------- - // IAMVideoControl interface - // - // Control of horizontal & vertical flip, external trigger, - // and listing available frame rates - //--------------------------------------------------------------------- - - [ - object, - uuid(6a2e0670-28e4-11d0-a18c-00a0c9118956), - pointer_default(unique) - ] - interface IAMVideoControl : IUnknown - { - // What can the underlying hardware do? - HRESULT GetCaps( - [in] IPin * pPin, // the pin to query or control - [out] long * pCapsFlags // VideoControlFlag_* - - ); - - // Set the mode of operation - HRESULT SetMode( - [in] IPin * pPin, // the pin to query or control - [in] long Mode // VideoControlFlag_* - - ); - - // Get the mode of operation - HRESULT GetMode( - [in] IPin * pPin, // the pin to query or control - [out] long * Mode // VideoControlFlag_* - ); - - // Get actual frame rate info for USB and 1394 - // This is only available when streaming - HRESULT GetCurrentActualFrameRate( - [in] IPin * pPin, // the pin to query or control - [out] LONGLONG * ActualFrameRate // 100 nS units - ); - - // Get max available frame rate info for USB and 1394 - // Returns the max frame rate currently available based on bus bandwidth usage - HRESULT GetMaxAvailableFrameRate( - [in] IPin * pPin, // the pin to query or control - [in] long iIndex, // 0 to IAMStreamConfig->GetNumberOfCapabilities-1 - [in] SIZE Dimensions, // width and height - [out] LONGLONG * MaxAvailableFrameRate // 100 nS units - ); - - // Get List of available frame rates - HRESULT GetFrameRateList( - [in] IPin * pPin, // the pin to query or control - [in] long iIndex, // 0 to IAMStreamConfig->GetNumberOfCapabilities-1 - [in] SIZE Dimensions, // width and height - [out] long * ListSize, // Number of elements in the list - [out] LONGLONG ** FrameRates // Array of framerates in 100 nS units - // or NULL to just get ListSize - ); - - } - - - //--------------------------------------------------------------------- - // IAMCrossbar interface - // - // Controls a routing matrix for analog or digital video or audio - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13380-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMCrossbar : IUnknown - { - - // How many pins are there? - HRESULT get_PinCounts( - [out] long * OutputPinCount, // count of output pins - [out] long * InputPinCount); // count of input pins - - // True if routing is possible - HRESULT CanRoute ( - [in] long OutputPinIndex, // the output pin - [in] long InputPinIndex); // the input pin - - // Routes an input pin to an output pin - HRESULT Route ( - [in] long OutputPinIndex, // the output pin - [in] long InputPinIndex); // the input pin - - // Returns the input pin connected to a given output pin - HRESULT get_IsRoutedTo ( - [in] long OutputPinIndex, // the output pin - [out] long * InputPinIndex); // the connected input pin - - // Returns a pin which is related to a given pin - // (ie. this audio pin is related to a video pin) - HRESULT get_CrossbarPinInfo ( - [in] BOOL IsInputPin, // TRUE for input pins - [in] long PinIndex, // a pin - [out] long * PinIndexRelated, // Index of related pin - [out] long * PhysicalType); // Physical type of pin - - } - - - //--------------------------------------------------------------------- - // IAMTuner interface - // - // base tuner device - //--------------------------------------------------------------------- - - // predefined subchannel values - typedef enum tagAMTunerSubChannel - { - AMTUNER_SUBCHAN_NO_TUNE = -2, // don't tune - AMTUNER_SUBCHAN_DEFAULT = -1 // use default sub chan - } AMTunerSubChannel; - - // predefined signal strength values - typedef enum tagAMTunerSignalStrength - { - AMTUNER_HASNOSIGNALSTRENGTH = -1, // cannot indicate signal strength - AMTUNER_NOSIGNAL = 0, // no signal available - AMTUNER_SIGNALPRESENT = 1 // signal present - } AMTunerSignalStrength; - - // specifies the mode of operation of the tuner - typedef enum tagAMTunerModeType - { - AMTUNER_MODE_DEFAULT = 0x0000, // default tuner mode - AMTUNER_MODE_TV = 0x0001, // tv - AMTUNER_MODE_FM_RADIO = 0x0002, // fm radio - AMTUNER_MODE_AM_RADIO = 0x0004, // am radio - AMTUNER_MODE_DSS = 0x0008, // dss - } AMTunerModeType; - - // Events reported by IAMTunerNotification - typedef enum tagAMTunerEventType{ - AMTUNER_EVENT_CHANGED = 0x0001, // status changed - } AMTunerEventType; - - interface IAMTunerNotification; - - [ - object, - uuid(211A8761-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTuner : IUnknown - { - // Sets and gets the Channel - HRESULT put_Channel( - [in] long lChannel, - [in] long lVideoSubChannel, - [in] long lAudioSubChannel - ); - HRESULT get_Channel( - [out] long *plChannel, - [out] long *plVideoSubChannel, - [out] long *plAudioSubChannel - ); - - // Gets the minimum and maximum channel available - HRESULT ChannelMinMax( - [out] long *lChannelMin, - [out] long *lChannelMax - ); - - // CountryCode is the same as the international - // long distance telephone dialing prefix - - HRESULT put_CountryCode( - [in] long lCountryCode - ); - HRESULT get_CountryCode( - [out] long *plCountryCode - ); - - HRESULT put_TuningSpace( - [in] long lTuningSpace - ); - HRESULT get_TuningSpace( - [out] long *plTuningSpace - ); - - [local] HRESULT Logon( - [in] HANDLE hCurrentUser - ); - HRESULT Logout(); - - // Signal status for current channel - // signal strength == TUNER_NOSIGNAL, or strength value - HRESULT SignalPresent( - [out] long * plSignalStrength // AMTunerSignalStrength - ); - - // allow multifunction tuner to be switch between modes - HRESULT put_Mode( - [in] AMTunerModeType lMode // AMTunerModeType - ); - HRESULT get_Mode( - [out] AMTunerModeType *plMode // AMTunerModeType - ); - - // retrieve a bitmask of the possible modes - HRESULT GetAvailableModes( - [out] long *plModes // AMTunerModeType - ); - - // allow IAMTuner clients to receive event notification - HRESULT RegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify, - [in] long lEvents // bitmask from AMTunerEventType enumeration - ); - HRESULT UnRegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify - ); - } - - //--------------------------------------------------------------------- - // IAMTunerNotification interface - // - // Provided to IAMTuner if notification callbacks are desired - //--------------------------------------------------------------------- - - [ - object, - uuid(211A8760-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTunerNotification : IUnknown - { - HRESULT OnEvent([in] AMTunerEventType Event); - } - - - //--------------------------------------------------------------------- - // IAMTVTuner interface - // - // Controls an analog TV tuner device - //--------------------------------------------------------------------- - - [ - object, - uuid(211A8766-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTVTuner : IAMTuner - { - // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - // Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // Scans for a signal on a given channel - // NOTE: this is equivalent to put_Channel(), SignalStrength() - HRESULT AutoTune( - [in] long lChannel, - [out] long * plFoundSignal - ); - - // Saves the fine tuning information for all channels")] - HRESULT StoreAutoTune(); - - // The number of TV sources plugged into the tuner - HRESULT get_NumInputConnections( - [out] long * plNumInputConnections - ); - - // Sets or gets the tuner input type (Cable or Antenna) - HRESULT put_InputType( - [in] long lIndex, - [in] TunerInputType InputType - ); - HRESULT get_InputType( - [in] long lIndex, - [out] TunerInputType * pInputType - ); - - // Sets or gets the tuner input - HRESULT put_ConnectInput( - [in] long lIndex - ); - HRESULT get_ConnectInput( - [out] long *plIndex - ); - - // Gets the video and audio carrier frequencies - HRESULT get_VideoFrequency( - [out] long *lFreq - ); - HRESULT get_AudioFrequency( - [out] long *lFreq - ); - } - - - //--------------------------------------------------------------------- - // IBPCSatelliteTuner interface - // - // An interface supporting Satellite tuning-related functions - //--------------------------------------------------------------------- - [ - object, - local, - uuid(211A8765-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IBPCSatelliteTuner : IAMTuner - { - HRESULT get_DefaultSubChannelTypes( - [out] long *plDefaultVideoType, // Provider-specific service type - [out] long *plDefaultAudioType // Provider-specific service type - ); - - HRESULT put_DefaultSubChannelTypes( - [in] long lDefaultVideoType, // Provider-specific service type - [in] long lDefaultAudioType // Provider-specific service type - ); - - HRESULT IsTapingPermitted(); // S_OK yes, S_FALSE no - } - - - - //--------------------------------------------------------------------- - // IAMTVAudio interface - // - // TV Audio control - //--------------------------------------------------------------------- - - typedef enum tagTVAudioMode - { - AMTVAUDIO_MODE_MONO = 0x0001, // Mono - AMTVAUDIO_MODE_STEREO = 0x0002, // Stereo - AMTVAUDIO_MODE_LANG_A = 0x0010, // Primary language - AMTVAUDIO_MODE_LANG_B = 0x0020, // 2nd avail language - AMTVAUDIO_MODE_LANG_C = 0x0040, // 3rd avail language - } TVAudioMode; - - // Events reported by IAMTVAudioNotification - typedef enum tagAMTVAudioEventType - { - AMTVAUDIO_EVENT_CHANGED = 0x0001, // mode changed - } AMTVAudioEventType; - - interface IAMTVAudioNotification; - - [ - object, - local, - uuid(83EC1C30-23D1-11d1-99E6-00A0C9560266), - pointer_default(unique) - ] - interface IAMTVAudio : IUnknown - { - // retrieve a bitmask of the formats available in the hardware - HRESULT GetHardwareSupportedTVAudioModes( - [out] long *plModes // TVAudioMode - ); - - // retrieve a bitmask of the possible modes - HRESULT GetAvailableTVAudioModes( - [out] long *plModes // TVAudioMode - ); - - HRESULT get_TVAudioMode( - [out] long *plMode // TVAudioMode - ); - HRESULT put_TVAudioMode( - [in] long lMode // TVAudioMode - ); - - // allow IAMTVAudio clients to receive event notification - HRESULT RegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify, - [in] long lEvents // bitmask from AMTVAudioEventType enumeration - ); - HRESULT UnRegisterNotificationCallBack( - IAMTunerNotification *pNotify - ); - } - - //--------------------------------------------------------------------- - // IAMTVAudioNotification interface - // - // Provided to IAMTVAudio clients if notification callbacks are desired - //--------------------------------------------------------------------- - - [ - object, - local, - uuid(83EC1C33-23D1-11d1-99E6-00A0C9560266), - pointer_default(unique) - ] - interface IAMTVAudioNotification : IUnknown - { - HRESULT OnEvent([in] AMTVAudioEventType Event); - } - - - - - //--------------------------------------------------------------------- - // IAMAnalogVideoEncoder interface - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E133B0-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMAnalogVideoEncoder : IUnknown - { - // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT put_TVFormat( - [in] long lAnalogVideoStandard - ); - - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // Sets or gets the copy protection - HRESULT put_CopyProtection ( - [in] long lVideoCopyProtection); // VideoCopyProtectionType - - HRESULT get_CopyProtection ( - [out] long *lVideoCopyProtection); // VideoCopyProtectionType - - - // Enables and disables close captioning - HRESULT put_CCEnable ( - [in] long lCCEnable); - - HRESULT get_CCEnable ( - [out] long *lCCEnable); - - } - - // used by IKsPropertySet set AMPROPSETID_Pin - typedef enum { - AMPROPERTY_PIN_CATEGORY, - AMPROPERTY_PIN_MEDIUM - } AMPROPERTY_PIN; - - //--------------------------------------------------------------------- - // IKsPropertySet interface - // - // Sets or gets a property identified by a property set GUID and a - // property ID. - // - // Return codes for all 3 methods: - // E_PROP_SET_UNSUPPORTED the property set is not supported - // E_PROP_ID_UNSUPPORTED the property ID is not supported - // for the specified property set - //--------------------------------------------------------------------- - -cpp_quote("#ifndef _IKsPropertySet_") -cpp_quote("#define _IKsPropertySet_") - - //--------------------------------------------------------------------- - // #defines for IKsPropertySet::QuerySupported return result in pTypeSupport - //--------------------------------------------------------------------- - -cpp_quote("#define KSPROPERTY_SUPPORT_GET 1") -cpp_quote("#define KSPROPERTY_SUPPORT_SET 2") - - - [ - object, - uuid(31EFAC30-515C-11d0-A9AA-00AA0061BE93), - pointer_default(unique) - ] - interface IKsPropertySet : IUnknown - { - [local] HRESULT Set( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] LPVOID pInstanceData, - [in] DWORD cbInstanceData, - [in, size_is(cbPropData)] LPVOID pPropData, - [in] DWORD cbPropData); - - [call_as(Set)] HRESULT RemoteSet( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] byte * pInstanceData, - [in] DWORD cbInstanceData, - [in, size_is(cbPropData)] byte * pPropData, - [in] DWORD cbPropData); - - // To get a property, the caller allocates a buffer which the called - // function fills in. To determine necessary buffer size, call Get with - // pPropData=NULL and cbPropData=0. - [local] HRESULT Get( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] LPVOID pInstanceData, - [in] DWORD cbInstanceData, - [out, size_is(cbPropData)] LPVOID pPropData, - [in] DWORD cbPropData, - [out] DWORD * pcbReturned); - - [call_as(Get)] HRESULT RemoteGet( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] byte * pInstanceData, - [in] DWORD cbInstanceData, - [out, size_is(cbPropData)] byte * pPropData, - [in] DWORD cbPropData, - [out] DWORD * pcbReturned); - // QuerySupported must either return E_NOTIMPL or correctly indicate - // if getting or setting the property set and property is supported. - // S_OK indicates the property set and property ID combination is - HRESULT QuerySupported( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [out] DWORD *pTypeSupport); - } -cpp_quote("#endif // _IKsPropertySet_") - -[ -object, -uuid(6025A880-C0D5-11d0-BD4E-00A0C911CE86), -pointer_default(unique) -] -interface IMediaPropertyBag : IPropertyBag -{ - import "ocidl.idl"; - - typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG; - - // return the i'th element in the property bag - HRESULT EnumProperty( - [in] ULONG iProperty, - [in, out] VARIANT * pvarPropertyName, - [in, out] VARIANT * pvarPropertyValue - ); - -} - - -[ -object, -uuid(5738E040-B67F-11d0-BD4D-00A0C911CE86), -pointer_default(unique) -] -interface IPersistMediaPropertyBag : IPersist -{ - import "ocidl.idl"; - import "unknwn.idl"; - - HRESULT InitNew( - void - ); - - HRESULT Load( - [in] IMediaPropertyBag * pPropBag, - [in] IErrorLog * pErrorLog - ); - - HRESULT Save( - [in] IMediaPropertyBag * pPropBag, - [in] BOOL fClearDirty, - [in] BOOL fSaveAllProperties - ); - - - typedef IPersistMediaPropertyBag * LPPERSISTMEDIAPROPERTYBAG; -} - - - //--------------------------------------------------------------------- - // - // Defines IAMPhysicalPinInfo Interface - // - // Returns an enum and string that describes an input pin's physical type. - // - // Implement if: you have physical input pins such as video or audio (like - // on a video capture card or a VCR) - // - // Use if: you want to communicate to a user available physical input pins - // and allow them to select the active one if there is more than one - //--------------------------------------------------------------------- - - -[ - object, - uuid(F938C991-3029-11cf-8C44-00AA006B6814), - pointer_default(unique) - ] -interface IAMPhysicalPinInfo : IUnknown { - - // Returns VFW_E_NO_ACCEPTABLE_TYPES if not a physical pin - HRESULT GetPhysicalType( - [out] long *pType, // the enum representing the Physical Type - [out] LPOLESTR *ppszType // a friendly name - ); -} -typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO; - - //--------------------------------------------------------------------- - // Defines IAMExtDevice Interface - // - // Base interface for external professional devices - // - // Implement if: the filter controls an external device such as a VCR, - // timecode reader/generator, etc. The intent is to build a object from - // this implementation plus another that specifically describes the device, - // such as IAMExtTransport. - // - // Use if: you want to control and external device such as a VCR - // - // See edevdefs.h for the enumerated parameter list - //--------------------------------------------------------------------- - [ - object, - uuid(B5730A90-1A2C-11cf-8C23-00AA006B6814), - pointer_default(unique) - ] - interface IAMExtDevice : IUnknown - { - // General device capabilities property. See edevdefs.h for supported - // values - HRESULT GetCapability( - [in] long Capability, // identify the property - [out] long *pValue, // return value - [out] double *pdblValue // return value - ); - - // Get external device identification string. Usually the model # - // of the device - HRESULT get_ExternalDeviceID( - [out] LPOLESTR *ppszData // ID string - ); - - HRESULT get_ExternalDeviceVersion( - [out] LPOLESTR *ppszData // revision string - ); - - // Controls the external device's power mode - HRESULT put_DevicePower([in] long PowerMode - ); - HRESULT get_DevicePower([out] long *pPowerMode - ); - - // Some devices need to be reset in some way, i.e., rewinding a VCR - // to the beginning of the tape and resetting the counter to zero. - HRESULT Calibrate( - [in] HEVENT hEvent, - [in] long Mode, - [out] long *pStatus // OATRUE is active, OAFALSE is inactive - ); - - // Selects the device's communications port, i.e.,COM1, IEEE1394, etc. - // See edevdefs.h for enums - HRESULT put_DevicePort([in] long DevicePort - ); - HRESULT get_DevicePort([out] long *pDevicePort - ); - -} -typedef IAMExtDevice *PEXTDEVICE; - - //--------------------------------------------------------------------- - // Defines IAMExtTransport Interface - // - // Contains properties and methods that control behavior of an external - // transport device such as a VTR - // - // Implement if: you control such a device. Intended to be agregated - // with IAMExtDevice. - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- -[ - object, - uuid(A03CD5F0-3045-11cf-8C44-00AA006B6814), - pointer_default(unique) - ] -interface IAMExtTransport : IUnknown { - - // General transport capabilities property. See edevdefs.h for enums - HRESULT GetCapability( - [in] long Capability, // identify the property - [out] long *pValue, // return value - [out] double *pdblValue // return value - ); - - // For disc-based devices: spinning, or not spinning. - // For tape-based device: threaded, unthreaded or ejected - HRESULT put_MediaState([in] long State - ); - HRESULT get_MediaState([out] long *pState // see edevdefs.h - ); - - // Determines state of unit's front panel - HRESULT put_LocalControl([in] long State - ); - HRESULT get_LocalControl([out] long *pState // OATRUE or OAFALSE - ); - - // Transport status such as Play, Stop, etc. More extensive - // than AM states. - HRESULT GetStatus( - [in] long StatusItem, // see edevdefs.h - [out] long *pValue - ); - - // Parameters such as recording speed, servo reference, ballistics, etc. - HRESULT GetTransportBasicParameters( - [in] long Param, - [out] long *pValue, - [out] LPOLESTR *ppszData - ); - - HRESULT SetTransportBasicParameters( - [in] long Param, - [in] long Value, - [in] LPCOLESTR pszData - ); - - // Parameters such as video output mode - HRESULT GetTransportVideoParameters( - [in] long Param, - [out] long *pValue - ); - - HRESULT SetTransportVideoParameters( - [in] long Param, - [in] long Value - ); - - // Parameters such as audio channel enable - HRESULT GetTransportAudioParameters( - [in] long Param, - [out] long *pValue - ); - - HRESULT SetTransportAudioParameters( - [in] long Param, - [in] long Value - ); - - // Mode is the movement of the transport, i.e., Play, Stop, - // Record, Edit, etc. - HRESULT put_Mode([in] long Mode - ); - HRESULT get_Mode([out] long *pMode - ); - - // Rate is for variable speed control of the the device. This - // can be linked to IMediaControl::Rate() in the implementation - // if desired. - HRESULT put_Rate([in] double dblRate - ); - HRESULT get_Rate([out] double *pdblRate - ); - - // This is a lengthy method, that is, it is in effect until canceled or complete and - // requires housekeeping by the filter. It puts transport in play mode and maintains - // fixed relationship between master time reference and transport position. - HRESULT GetChase( - [out] long *pEnabled, // OATRUE | OAFALSE - [out] long *pOffset, // offset in current time format - [out] HEVENT *phEvent // completion notification - ); - HRESULT SetChase( - [in] long Enable, // OATRUE | OAFALSE - [in] long Offset, // offset in current time format - [in] HEVENT hEvent // completion notification - ); - - // Also a lengthy method: temporarily change transport speed (for synchronizing). - HRESULT GetBump( - [out] long *pSpeed, - [out] long *pDuration // in current time format - ); - HRESULT SetBump( - [in] long Speed, - [in] long Duration // in current time format - ); - - // Enable/Disable transport anti-headclog control. - HRESULT get_AntiClogControl([out] long *pEnabled // OATRUE | OAFALSE - ); - HRESULT put_AntiClogControl([in] long Enable // OATRUE | OAFALSE - ); - - // The following group of properties describes edit events. An edit event can be a - // standard insert or assemble edit or a memorized position called a bookmark. - // A NOTE ABOUT EVENTS: as with all lengthy commands, event objects must be created to - // signal completion or error. - - // Intended usage: an edit event is prepared for use by: - // 1. Registering an edit property set and getting an EditID - // 2. Setting the necessary edit properties - // 3. Setting the edit property set active - - // Please see edevdefs.h for properties and values - - // The reference clock's advance is the mechanism that puts an edit in motion (see - // ED_EDIT_REC_INPOINT). - - // Property set methods - HRESULT GetEditPropertySet( - [in] long EditID, - [out] long *pState // ED_SET_ACTIVE | ED_SET_INACTIVE | ED_SET_INVALID - // | ED_SET_EXECUTING - ); - - HRESULT SetEditPropertySet( - [in, out] long *pEditID, - [in] long State // ED_SET_REGISTER | ED_SET_DELETE | ED_SET_ACTIVE | - ); // ED_SET_INACTIVE - - // the following properties define an edit event such as a bookmark, seek point, or - // actual edit - HRESULT GetEditProperty( - [in] long EditID, - [in] long Param, - [out] long *pValue - ); - HRESULT SetEditProperty( - [in] long EditID, - [in] long Param, - [in] long Value - ); - - // Activates a capable transport's edit control (typically used for "on the fly" editing). - HRESULT get_EditStart([out] long *pValue // OATRUE or OAFALSE - ); - HRESULT put_EditStart([in] long Value // OATRUE or OAFALSE - ); -} -typedef IAMExtTransport *PIAMEXTTRANSPORT; - - //--------------------------------------------------------------------- - // Defines IAMTimecodeReader Interface - // - // Contains properties and methods that define behavior of a - // SMPTE/MIDI Timecode Reader. It is expected that this interface - // will be combined (aggregated) with IAMExtTransport to "build" a pro - // VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //===================================================================== - - -// timecode structures -cpp_quote("#if 0") -cpp_quote("/* the following is what MIDL knows how to remote */") -typedef struct tagTIMECODE { - WORD wFrameRate; // will be replaced by AM defs, but see ED_FORMAT_SMPTE for now - WORD wFrameFract; // fractional frame. full scale is always 0x1000 - DWORD dwFrames; -}TIMECODE; -cpp_quote("#else /* 0 */") -cpp_quote("#ifndef TIMECODE_DEFINED") -cpp_quote("#define TIMECODE_DEFINED") -cpp_quote("typedef union _timecode {") -cpp_quote(" struct {") -cpp_quote(" WORD wFrameRate;") -cpp_quote(" WORD wFrameFract;") -cpp_quote(" DWORD dwFrames;") -cpp_quote(" };") -cpp_quote(" DWORDLONG qw;") -cpp_quote(" } TIMECODE;") -cpp_quote("") -cpp_quote("#endif /* TIMECODE_DEFINED */") -cpp_quote("#endif /* 0 */") - -typedef TIMECODE *PTIMECODE; - -typedef struct tagTIMECODE_SAMPLE { - LONGLONG qwTick; // ActiveMovie 100ns timestamp - TIMECODE timecode; // timecode - DWORD dwUser; // timecode user data (aka user bits) - DWORD dwFlags; // timecode flags - see below -} TIMECODE_SAMPLE; -typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE; - - -[ - object, - uuid(9B496CE1-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) -] -interface IAMTimecodeReader : IUnknown -{ - // Timecode Reader Mode - gets/sets the following properties - // ED_TCR_SOURCE - timecode gen (readback), LTC, VITC, or Control Track - HRESULT GetTCRMode( - [in] long Param, - [out] long *pValue); - HRESULT SetTCRMode( - [in] long Param, - [in] long Value); - - // Select which line of the vertical interval timecode will be read from (if VITC). - // To read VITC on specific multiple lines, the caller would make successive calls to - // put_VITCLine(), once for each line desired. - HRESULT put_VITCLine( - [in] long Line ); // valid lines are 11-20, 0 means autoselect, - // hi bit set means add to list of lines (for - // readers that test across multiple lines) - HRESULT get_VITCLine( - [out] long *pLine ); // hi bit set means multiple lines are used, - // and successive calls will cycle through the - // line numbers (like an enumerator, only simpler) - - // GetTimecode can be used to obtain the most recent timecode value available in the - // stream. The client can use this to monitor the timecode, parse duplicates and - // discontinuities. The source filter supplying the timecode or possibly a down stream - // filter might want to parse for discontinuities or errors since you have to look at - // every sample to do this properly. - // - - HRESULT GetTimecode( - [out] PTIMECODE_SAMPLE pTimecodeSample) ; - -} -typedef IAMTimecodeReader *PIAMTIMECODEREADER; - - //--------------------------------------------------------------------- - //===================================================================== - // Defines IAMTimecodeGenerator Interface - // - // Contains properties and methods that define behavior of an external - // SMPTE/MIDI Timecode Generator. It is expected that this interface - // will be combined (aggregated) with IAMExtTransport to "build" a pro - // VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- -[ - object, - uuid(9B496CE0-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) - ] -interface IAMTimecodeGenerator : IUnknown { - - // Timecode Generator Mode - gets/sets the following properties (see - // vcrdefss.h for detailed values): - // ED_TCG_TIMECODE_TYPE - LTC, VITC, or MIDI - // ED_TCG_FRAMERATE - 24, 25, 30 drop or 30 nondrop - // ED_TCG_SYNC_SOURCE - what is driving the bitclock - // ED_TCG_REFERENCE_SOURCE - what is driving the count value - HRESULT GetTCGMode( - [in] long Param, - [out] long *pValue); - - HRESULT SetTCGMode( - [in] long Param, - [in] long Value); - - // Select into which line(s) of the vertical interval timecode will be inserted (if VITC). - // Hi bit set means add this line to any previously set lines. - // To generate VITC on specific multiple lines, the caller would make successive calls to - // put_VITCLine(), once for each line desired. - HRESULT put_VITCLine( - [in] long Line // valid lines are 11-20, 0 means autoselect(this setting - ); // is for TC readers that decode from multiple lines) - HRESULT get_VITCLine( - [out] long *pLine - ); - - // Sets timecode and/or userbit value. If generator is running, takes effect - // immediately. If caller wants to set only timecode, set userbit value to -1L (and - // same for setting userbits only) - // - - HRESULT SetTimecode( - [in] PTIMECODE_SAMPLE pTimecodeSample) ; - - - // GetTimecode can be used to obtain the most recent timecode value available in the - // stream. The client can use this to monitor the timecode and verify the generator is - // working properly - // - - HRESULT GetTimecode( - [out] PTIMECODE_SAMPLE pTimecodeSample) ; - -} -typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR; - - //--------------------------------------------------------------------- - // Defines IAMTimecodeDisplay Interface - // - // Contains properties and methods that define behavior of an external - // SMPTE/MIDI Timecode Display device (aka "character generator" for - // making "burn-ins" or "window dubs"). It is expected that this interface - // will be combined (aggregated) with IAMExtTransport and the timecode - // interfaces to "build" a pro VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- -[ - object, - uuid(9B496CE2-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) - ] -interface IAMTimecodeDisplay : IUnknown -{ - // Enable/disable external device's timecode reader's character generator output. Some - // readers have this feature - this is not intended for rendering inside the PC! - HRESULT GetTCDisplayEnable( - [out] long *pState); // OATRUE | OAFALSE - HRESULT SetTCDisplayEnable( - [in] long State); // OATRUE | OAFALSE - // Timecode reader's character generator output - // characteristics (size, position, intensity, etc.). - HRESULT GetTCDisplay( - [in] long Param, - [out] long *pValue); - HRESULT SetTCDisplay( - [in] long Param, - [in] long Value); - - /* Allowable params and values (see edevdefs.h for details): - ED_TCD_SOURCE - ED_TCR | ED_TCG - ED_TCD_SIZE - ED_SMALL | ED_MED | ED_LARGE - ED_TCD_POSITION - ED_TOP | ED_MIDDLE | ED_BOTTOM or'd with - ED_LEFT | ED_CENTER | ED_RIGHT - ED_TCD_INTENSITY - ED_HIGH | ED_LOW - ED_TCD_TRANSPARENCY // set from 0 to 4, 0 being completely opaque - ED_TCD_INVERT // white on black or black on white - OATRUE | OAFALSE - ED_TCD_BORDER // white border for black chars, black border for white letters - OATRUE | OAFALSE - */ -} -typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY; - - -[ - object, - uuid(c6545bf0-e76b-11d0-bd52-00a0c911ce86), - pointer_default(unique) -] -interface IAMDevMemoryAllocator : IUnknown -{ - HRESULT GetInfo( - [out] DWORD *pdwcbTotalFree, - [out] DWORD *pdwcbLargestFree, - [out] DWORD *pdwcbTotalMemory, - [out] DWORD *pdwcbMinimumChunk); - - HRESULT CheckMemory( - [in] const BYTE *pBuffer); - - HRESULT Alloc( - [out] BYTE **ppBuffer, - [in, out] DWORD *pdwcbBuffer); - - HRESULT Free( - [in] BYTE *pBuffer); - - HRESULT GetDevMemoryObject( - [out] IUnknown **ppUnkInnner, - [in] IUnknown *pUnkOuter); -} -typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR; - - -[ - object, - uuid(c6545bf1-e76b-11d0-bd52-00a0c911ce86), - pointer_default(unique) -] -interface IAMDevMemoryControl : IUnknown -{ - HRESULT QueryWriteSync(); - - HRESULT WriteSync(); - - HRESULT GetDevId( - [out] DWORD *pdwDevId); - -} -typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL; - -// Flags for IAMStreamSelection::Info -enum _AMSTREAMSELECTINFOFLAGS { - AMSTREAMSELECTINFO_ENABLED = 0x01, // Enable - off for disable - AMSTREAMSELECTINFO_EXCLUSIVE = 0x02 // Turns off the others in the group - // when enabling this one -}; -// Flags for IAMStreamSelection::Enable -enum _AMSTREAMSELECTENABLEFLAGS { - // Currently valid values are : - // 0 - disable all streams in the group containing this stream - // ..._ENABLE - enable only this stream with in the given group - // and disable all others - // ..._ENABLEALL - send out all streams - AMSTREAMSELECTENABLE_ENABLE = 0x01, // Enable - AMSTREAMSELECTENABLE_ENABLEALL = 0x02 // Enable all streams in the group - // containing this stream -}; - -// Control which logical streams are played and find out information about -// them -// Normally supported by a filter -[ - object, - uuid(c1960960-17f5-11d1-abe1-00a0c905f375), - pointer_default(unique) -] -interface IAMStreamSelect : IUnknown -{ - // Returns total count of streams - HRESULT Count( - [out] DWORD *pcStreams); // Count of logical streams - - // Return info for a given stream - S_FALSE if iIndex out of range - // The first steam in each group is the default - HRESULT Info( - [in] long lIndex, // 0-based index - [out] AM_MEDIA_TYPE **ppmt, // Media type - optional - // Use DeleteMediaType to free - [out] DWORD *pdwFlags, // flags - optional - [out] LCID *plcid, // LCID (returns 0 if none) - optional - [out] DWORD *pdwGroup, // Logical group - optional - [out] WCHAR **ppszName, // Name - optional - free with CoTaskMemFree - // optional - [out] IUnknown **ppObject, // Associated object - optional - // Object may change if Enable is - // called on this interface - // - returns NULL if no associated object - // Returns pin or filter for DShow - [out] IUnknown **ppUnk); // Stream specific interface - - // Enable or disable a given stream - HRESULT Enable( - [in] long lIndex, - [in] DWORD dwFlags); -} -typedef IAMStreamSelect *PAMSTREAMSELECT; - -enum _AMRESCTL_RESERVEFLAGS -{ - AMRESCTL_RESERVEFLAGS_RESERVE = 0x00, // Increment reserve count - AMRESCTL_RESERVEFLAGS_UNRESERVE = 0x01 // Decrement reserve count -}; - -// Reserve resources now so that playback can be subsequently -// guaranteed -// -// Normally supported by a filter -// -[ - object, - uuid(8389d2d0-77d7-11d1-abe6-00a0c905f375), - pointer_default(unique), - local -] -interface IAMResourceControl : IUnknown -{ - // The reserve count is incremented/decremented if and only if - // S_OK is returned - // Unreserve once for every Reserve call - HRESULT Reserve( - [in] DWORD dwFlags, // From _AMRESCTL_RESERVEFLAGS enum - [in] PVOID pvReserved // Must be NULL - ); -} - - -// Set clock adjustments - supported by some clocks -[ - object, - uuid(4d5466b0-a49c-11d1-abe8-00a0c905f375), - pointer_default(unique), - local -] -interface IAMClockAdjust : IUnknown -{ - // Set the following delta to clock times - // The clock will add adjust its times by the given delta - HRESULT SetClockDelta( - [in] REFERENCE_TIME rtDelta - ); -}; - -// Filter miscellaneous status flags - -enum _AM_FILTER_MISC_FLAGS { - AM_FILTER_MISC_FLAGS_IS_RENDERER = 0x00000001, /* Will deliver EC_COMPLETE - at end of media */ - AM_FILTER_MISC_FLAGS_IS_SOURCE = 0x00000002 /* Filter sources data */ -}; - -[ - object, - uuid(2dd74950-a890-11d1-abe8-00a0c905f375), - pointer_default(unique), - local -] -interface IAMFilterMiscFlags : IUnknown -{ - // Get miscellaneous property flags - ULONG GetMiscFlags(void); -}; - - -// Video Image drawing interface -[ - object, - local, - uuid(48efb120-ab49-11d2-aed2-00a0c995e8d5), - pointer_default(unique), -] -interface IDrawVideoImage : IUnknown -{ - HRESULT DrawVideoImageBegin(); - - HRESULT DrawVideoImageEnd(); - - HRESULT DrawVideoImageDraw( - [in] HDC hdc, - [in] LPRECT lprcSrc, - [in] LPRECT lprcDst - ); -} - -// -// Video Image decimation interface -// -// The aim of this interface is to enable a video renderer filter to -// control the decimation properties of a video decoder connected to -// the video renderer -// -// This interface should only be supported by decoders that are capable of -// decimating their output image by an arbitary amount. -// -// -[ - object, - local, - uuid(2e5ea3e0-e924-11d2-b6da-00a0c995e8df), - pointer_default(unique), -] -interface IDecimateVideoImage : IUnknown -{ - // - // Informs the decoder that it should decimate its output - // image to the specified width and height. If the decoder can - // decimate to this size it should return S_OK. - // If the decoder can't perform the requested decimation - // or wants to stop performing the decimation that it is - // currently doing it should return E_FAIL. - // - HRESULT SetDecimationImageSize( - [in] long lWidth, - [in] long lHeight); - - // - // Informs the decoder that it should stop decimating its output image - // and resume normal output. - // - HRESULT ResetDecimationImageSize(); -} - -typedef enum _DECIMATION_USAGE { - DECIMATION_LEGACY, // decimate at ovly then video port then crop - DECIMATION_USE_DECODER_ONLY, // decimate image at the decoder only - DECIMATION_USE_VIDEOPORT_ONLY, // decimate at the video port only - DECIMATION_USE_OVERLAY_ONLY, // decimate at the overlay only - DECIMATION_DEFAULT // decimate at decoder then ovly the vide port then crop -} DECIMATION_USAGE; - -[ - object, - local, - uuid(60d32930-13da-11d3-9ec6-c4fcaef5c7be), - pointer_default(unique), -] -interface IAMVideoDecimationProperties: IUnknown -{ - // - // Queries the current usage of the above IDecimateVideoImage - // interface. - // - HRESULT QueryDecimationUsage( - [out] DECIMATION_USAGE* lpUsage); // from DECIMATION_USAGE enum - - // - // Sets the current usage of the above IDecimateVideoImage - // interface. - // - HRESULT SetDecimationUsage( - [in] DECIMATION_USAGE Usage); // from DECIMATION_USAGE enum -} - -//--------------------------------------------------------------------- -// -// IVideoFrameStep interface -// -//--------------------------------------------------------------------- - -[ - object, - uuid(e46a9787-2b71-444d-a4b5-1fab7b708d6a), - pointer_default(unique), -] -interface IVideoFrameStep : IUnknown -{ - // - // Stop(), Pause(), Run() all cancel Step as does any seeking - // request. - // - // The Step() and CancelStep() methods of this interface - // Cancel any previous step. - // - // When stepping is complete EC_STEP_COMPLETE is signalled. - // - // When the filter graph gets EC_STEP_COMPLETE it automatically - // sets the filter graph into paused state and forwards the - // notification to the application - // - // Returns S_OK if stepping initiated. - // - // dwFrames - // 1 means step 1 frame forward - // 0 is invalid - // n (n > 1) means skip n - 1 frames and show the nth - // - // pStepObject - // NULL - default step object (filter) picked - // non-NULL - use this object for stepping - // - HRESULT Step(DWORD dwFrames, [unique] IUnknown *pStepObject); - - // Can step? - // Returns S_OK if it can, S_FALSE if it can't or error code. - // bMultiple - if TRUE return whether can step n > 1 - HRESULT CanStep(long bMultiple, [unique] IUnknown *pStepObject); - - // Cancel stepping - HRESULT CancelStep(); -} - - - - -//--------------------------------------------------------------------- -// -// IAMPushSource interface -// -// Provides a means for source filters to describe information about the -// data that they source, such as whether the data is live or not, and -// what type of clock was used for timestamps. This information may be -// needed by other clocks in the graph in order to provide accurate -// synchronization. Also provides a way to specify an offset value for -// the filter to use when timestamping the streams it sources. Provides -// support for the IAMLatency interface as well. -// -//--------------------------------------------------------------------- - -enum _AM_PUSHSOURCE_FLAGS { - - // - // The default assumption is that the data is from a live source, - // time stamped with the graph clock, and the source does not - // attempt to rate match the data it delivers. - // The following flags can be used to override this assumption. - // - - // capability flags - AM_PUSHSOURCECAPS_INTERNAL_RM = 0x00000001, // source provides internal support for rate matching - AM_PUSHSOURCECAPS_NOT_LIVE = 0x00000002, // don't treat source data as live - AM_PUSHSOURCECAPS_PRIVATE_CLOCK = 0x00000004, // source data timestamped with clock not - // exposed to the graph - - // request flags, set by user via SetPushSourceFlags method - AM_PUSHSOURCEREQS_USE_STREAM_CLOCK = 0x00010000 // source was requested to timestamp - // using a clock that isn't the graph clock -}; - -// -// Used to set a source filter to run in a "live" mode. -// -[ -object, - uuid(F185FE76-E64E-11d2-B76E-00C04FB6BD3D), - pointer_default(unique) -] -interface IAMPushSource : IAMLatency -{ - // used to discover push source's capabilities. - // may be any combination of the AM_PUSHSOURCE_FLAGS flags. - HRESULT GetPushSourceFlags ( - [out] ULONG *pFlags - ); - - // used to set request flags for a push source. - // may be a combination of the AM_PUSHSOURCE_REQS_xxx flags. - HRESULT SetPushSourceFlags ( - [in] ULONG Flags - ); - - // specify an offset for push source time stamps - HRESULT SetStreamOffset ( - [in] REFERENCE_TIME rtOffset - ); - - // retrieve the offset this push source is using - HRESULT GetStreamOffset ( - [out] REFERENCE_TIME *prtOffset - ); - - // retrieve the maximum stream offset this push source thinks it can support - HRESULT GetMaxStreamOffset ( - [out] REFERENCE_TIME *prtMaxOffset - ); - - // allows the filter graph to tell a push source the maximum latency allowed on the graph - // this allows pins like the video capture preview pin to be more efficient with the amount - // of buffering required to support the maximum graph latency - HRESULT SetMaxStreamOffset ( - [in] REFERENCE_TIME rtMaxOffset - ); -}; - - -// ------------------------------------------------------------------------ -// -// IAMDeviceRemoval interface -// -// Implemented by filters to request and receive WM_DEVICECHANGE -// notifications -// -// ------------------------------------------------------------------------ - -[ - object, - uuid(f90a6130-b658-11d2-ae49-0000f8754b99), - pointer_default(unique) -] -interface IAMDeviceRemoval : IUnknown -{ - - HRESULT DeviceInfo( - [out] CLSID *pclsidInterfaceClass, - [out] WCHAR **pwszSymbolicLink); - - HRESULT Reassociate(); - - HRESULT Disassociate(); -} - -// -// for DV -// -typedef struct { - //for 1st 5/6 DIF seq. - DWORD dwDVAAuxSrc; - DWORD dwDVAAuxCtl; - //for 2nd 5/6 DIF seq. - DWORD dwDVAAuxSrc1; - DWORD dwDVAAuxCtl1; - //for video information - DWORD dwDVVAuxSrc; - DWORD dwDVVAuxCtl; - DWORD dwDVReserved[2]; - -} DVINFO, *PDVINFO; - -// ------------------------------------------------------------------------ -// -// IDVEnc interface -// -// Implemented by DV encoder filters to set Encoder format -// -// ------------------------------------------------------------------------ -enum _DVENCODERRESOLUTION { //resolution - DVENCODERRESOLUTION_720x480 = 2012, - DVENCODERRESOLUTION_360x240 = 2013, - DVENCODERRESOLUTION_180x120 = 2014, - DVENCODERRESOLUTION_88x60 = 2015 -}; -enum _DVENCODERVIDEOFORMAT { //PAL/ntsc - DVENCODERVIDEOFORMAT_NTSC = 2000, - DVENCODERVIDEOFORMAT_PAL = 2001 -}; -enum _DVENCODERFORMAT { // dvsd/dvhd/dvsl - DVENCODERFORMAT_DVSD = 2007, - DVENCODERFORMAT_DVHD = 2008, - DVENCODERFORMAT_DVSL = 2009 -}; -[ - object, - uuid(d18e17a0-aacb-11d0-afb0-00aa00b67a42), - pointer_default(unique) -] -interface IDVEnc : IUnknown -{ - - HRESULT get_IFormatResolution ( - [out] int *VideoFormat, //pal or ntsc - [out] int *DVFormat, //dvsd dvhd dvsl - [out] int *Resolution, //720, 360, 180,88 - [in] BYTE fDVInfo, //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO - [out] DVINFO *sDVInfo //NULL if fDVInfo=FALSE, - ); - - HRESULT put_IFormatResolution ( - [in] int VideoFormat, - [in] int DVFormat, - [in] int Resolution, - [in] BYTE fDVInfo, //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO - [in] DVINFO *sDVInfo //NULL if fDVInfo=FALSE, - ); - -} - -// ------------------------------------------------------------------------ -// -// IDVDec interface -// -// Implemented by DV decoder filters to set decoder size -// -// ------------------------------------------------------------------------ -enum _DVDECODERRESOLUTION { - DVDECODERRESOLUTION_720x480 = 1000, - DVDECODERRESOLUTION_360x240 = 1001, - DVDECODERRESOLUTION_180x120 = 1002, - DVDECODERRESOLUTION_88x60 = 1003 -}; -enum _DVRESOLUTION { - DVRESOLUTION_FULL = 1000, - DVRESOLUTION_HALF = 1001, - DVRESOLUTION_QUARTER = 1002, - DVRESOLUTION_DC = 1003 -}; -[ - object, - uuid(b8e8bd60-0bfe-11d0-af91-00aa00b67a42), - pointer_default(unique) -] -interface IIPDVDec : IUnknown -{ - HRESULT get_IPDisplay ( - [out] int *displayPix // The display pixels arrage - ); - - HRESULT put_IPDisplay ( - [in] int displayPix // Change to this display pixel arrage - ) ; -} - -//------------------------------------------------------------------------ -// -// IDVRGB219 interface -// -// Implemented by both the DV encoder and decoder filters -// Used for enabling the 219 mode in which the Range of RGB24 either received -// by the encoder or produced by the decoder becomes (16,16,16)--(235,235,235) -// instead of (0,0,0)--(255,255,255). -// The interface's method has no effect in case of any other color space than -// RGB 24 -// -//------------------------------------------------------------------------ - -[ - object, - uuid(58473A19-2BC8-4663-8012-25F81BABDDD1), - pointer_default(unique) -] -interface IDVRGB219 : IUnknown -{ - HRESULT SetRGB219 ([in] BOOL bState); // State = True Turn 219 mode on else turn it off. -} - - -// ------------------------------------------------------------------------ -// -// IDVSplitter interface -// -// Implemented by DV splitter filters -// -// ------------------------------------------------------------------------ -[ - object, - uuid(92a3a302-da7c-4a1f-ba7e-1802bb5d2d02) -] -interface IDVSplitter : IUnknown -{ - HRESULT DiscardAlternateVideoFrames( - [in] int nDiscard - ) ; -} - -// Audio Renderer statistics params for IAMAudioRendererStats interface -enum _AM_AUDIO_RENDERER_STAT_PARAM { - AM_AUDREND_STAT_PARAM_BREAK_COUNT = 1, // audio breaks - AM_AUDREND_STAT_PARAM_SLAVE_MODE, // current slave mode, see AM_AUDREND_SLAVE_MODEs - AM_AUDREND_STAT_PARAM_SILENCE_DUR, // silence inserted due to gaps (ms) - AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR, // duration of the last buffer received - AM_AUDREND_STAT_PARAM_DISCONTINUITIES, // discontinuities seen since running - AM_AUDREND_STAT_PARAM_SLAVE_RATE, // what rate are we currently slaving at? S_FALSE if not slaving - AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR, // for waveOut slaving - data dropped or added to stay in-sync - // dwParam1 - dropped duration(ms) - // dwParam2 - paused duration(ms) - AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR, // highest & lowest clock differences seen - // dwParam1 - high err - // dwParam2 - low err - AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR, // last high and low errs seen - // dwParam1 - last high err - // dwParam2 - last low err - AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR, // error between master/slave clocks - AM_AUDREND_STAT_PARAM_BUFFERFULLNESS, // percent audio buffer fullness - AM_AUDREND_STAT_PARAM_JITTER // input buffer jitter -}; - -//--------------------------------------------------------------------- -// -// IAMAudioRendererStats interface -// -// Interface to get at statistical information that is optionally stored -// in an audio renderer filter. Supported on the filter interface (although -// this might be better for ksproxy if we define it as a pin interface?) -// -//--------------------------------------------------------------------- - -[ -object, - uuid(22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93), - pointer_default(unique) -] -interface IAMAudioRendererStats : IUnknown -{ - // Get value corresponding to the passed in parameter id - HRESULT GetStatParam( - [in] DWORD dwParam, - [out] DWORD *pdwParam1, - [out] DWORD *pdwParam2 - ); -} - -//--------------------------------------------------------------------- -// -// IAMLatency interface -// -// Allows a filter to report the expected latency associated with a data -// stream flowing from its input to output pin. Supported on output pins. -// -//--------------------------------------------------------------------- - -[ -object, - uuid(62EA93BA-EC62-11d2-B770-00C04FB6BD3D), - pointer_default(unique) -] -interface IAMLatency : IUnknown -{ - HRESULT GetLatency( - [in] REFERENCE_TIME *prtLatency - ); -} - - -enum _AM_INTF_SEARCH_FLAGS { - AM_INTF_SEARCH_INPUT_PIN = 0x00000001, // search input pins - AM_INTF_SEARCH_OUTPUT_PIN = 0x00000002, // search output pins - AM_INTF_SEARCH_FILTER = 0x00000004 // search filters -}; - -//--------------------------------------------------------------------- -// -// IAMGraphStreams interface -// -// Interface used to control or search over connected streams of data -// flow within a filter graph. -// -//--------------------------------------------------------------------- - -[ -object, - uuid(632105FA-072E-11d3-8AF9-00C04FB6BD3D), - pointer_default(unique) -] -interface IAMGraphStreams : IUnknown -{ - // Search upstream from the current pin, for the specified interface. - // dwFlags can be any combination of the AM_INTF_SEARCH_FLAGS, and allows - // control over what objects to search. A value of 0 means to search all. - HRESULT FindUpstreamInterface( - [in] IPin *pPin, - [in] REFIID riid, - [out, iid_is(riid)] void **ppvInterface, - [in] DWORD dwFlags ); - - // Enable or disable the graph's setting of a timestamp offset - // on push sources. - HRESULT SyncUsingStreamOffset( [in] BOOL bUseStreamOffset ); - - // allow an app to set the maximum offset used on push source filters - HRESULT SetMaxGraphLatency( [in] REFERENCE_TIME rtMaxGraphLatency ); -} - - -// -// IAMOverlayFX -// -// This interface is exposed by the overlay mixer filter and allows -// an application to apply various "effects" to the overlay surface -// used by the overlay mixer. -// -// The effects that can be applied are described by the AMOVERLAYFX -// enumeration. -// -enum AMOVERLAYFX { - // Normal (ie. top down, left to right) video - AMOVERFX_NOFX = 0x00000000, - - // Mirror the overlay across the vertical axis - AMOVERFX_MIRRORLEFTRIGHT = 0x00000002, - - // Mirror the overlay across the horizontal axis - AMOVERFX_MIRRORUPDOWN = 0x00000004, - - // Deinterlace the overlay, if possible - AMOVERFX_DEINTERLACE = 0x00000008 -}; - -[ -object, - uuid(62fae250-7e65-4460-bfc9-6398b322073c), - pointer_default(unique) -] -interface IAMOverlayFX : IUnknown -{ - // Use this method to determine what overlay effects are currently available - // for the overlay surface used by the overlay mixer filter. - // - HRESULT QueryOverlayFXCaps( - [out] DWORD *lpdwOverlayFXCaps - ); - - // Use this method to apply a new overlay effect to the overlay surface - // used by the overlay mixer filter. This method can be called while the - // filter graph is running, the effect is applied immediately - // - HRESULT SetOverlayFX( - [in] DWORD dwOverlayFX - ); - - // Use this method to determine what effect (if any) is currently being - // applied to the overlay surface by the overlay mixer filter. - // - HRESULT GetOverlayFX( - [out] DWORD *lpdwOverlayFX - ); -} - - - -// IAMOpenProgress interface provides information about current progress through -// a download - -[ -object, -uuid(8E1C39A1-DE53-11cf-AA63-0080C744528D), -pointer_default(unique) -] - -interface IAMOpenProgress : IUnknown -{ - // QueryProgress can be used to query the source filter which supports this interface - // for progress information during a renderfile operation. - HRESULT QueryProgress( - [out] LONGLONG* pllTotal, - [out] LONGLONG* pllCurrent - ); - - // AbortOperation can be used to request an abort of RenderFile operation - // causing it to stop downloading. This methods instructs the exporter of - // the IAMOpenProgress interface to hold up their internal abort flag until - // further notice. - HRESULT AbortOperation( - ); -} - - -/*++ - IMpeg2Demultiplexer - - This interface is implemented by the MPEG-2 Demultiplexer filter, - irrespective of program vs. transport stream splitting functionality. ---*/ -[ - object, - local, - uuid (436eee9c-264f-4242-90e1-4e330c107512), - pointer_default(unique) -] -interface IMpeg2Demultiplexer : IUnknown -{ - /*++ - ------------------------------------------------------------------------ - purpose: Creates an output pin of the specified media type. - - pMediaType media type specifier for the new pin - pszPinName pin name; cannot be a duplicate of an existing pin - ppIPin IPin interface pointer to the newly created pin - --*/ - HRESULT - CreateOutputPin ( - [in] AM_MEDIA_TYPE * pMediaType, - [in] LPWSTR pszPinName, - [out] IPin ** ppIPin - ) ; - - /*++ - ------------------------------------------------------------------------ - purpose: Updates the media type of the specified output pin. If no - connection exists, the media type is updated always. If - the pin is connected, the success/failure of the call will - depend on downstream input pin's accetance/rejection of - the specified media type, and subsequent success/failure - of a reconnect. - - pszPinName pin name - pMediaType new media type specifier - --*/ - HRESULT - SetOutputPinMediaType ( - [in] LPWSTR pszPinName, - [in] AM_MEDIA_TYPE * pMediaType - ) ; - - /*++ - ------------------------------------------------------------------------ - purpose: Deletes the specified output pin. - - pszPinName pin name - --*/ - HRESULT - DeleteOutputPin ( - [in] LPWSTR pszPinName - ) ; -} ; - -//--------------------------------------------------------------------- -// IEnumStreamIdMap interface -//--------------------------------------------------------------------- - -cpp_quote("#define MPEG2_PROGRAM_STREAM_MAP 0x00000000") -cpp_quote("#define MPEG2_PROGRAM_ELEMENTARY_STREAM 0x00000001") -cpp_quote("#define MPEG2_PROGRAM_DIRECTORY_PES_PACKET 0x00000002") -cpp_quote("#define MPEG2_PROGRAM_PACK_HEADER 0x00000003") -cpp_quote("#define MPEG2_PROGRAM_PES_STREAM 0x00000004") -cpp_quote("#define MPEG2_PROGRAM_SYSTEM_HEADER 0x00000005") - -cpp_quote("#define SUBSTREAM_FILTER_VAL_NONE 0x10000000") - -typedef struct { - ULONG stream_id ; // mpeg-2 stream_id - DWORD dwMediaSampleContent ; // #define'd above - ULONG ulSubstreamFilterValue ; // filtering value - int iDataOffset ; // offset to elementary stream -} STREAM_ID_MAP ; - -/*++ - Enumerates the StreamIds mapped on a pin ---*/ -[ - object, - local, - uuid (945C1566-6202-46fc-96C7-D87F289C6534), - pointer_default(unique) -] -interface IEnumStreamIdMap : IUnknown -{ - HRESULT - Next ( - [in] ULONG cRequest, - [in, out, size_is (cRequest)] STREAM_ID_MAP * pStreamIdMap, - [out] ULONG * pcReceived - ) ; - - HRESULT - Skip ( - [in] ULONG cRecords - ) ; - - HRESULT - Reset ( - ) ; - - HRESULT - Clone ( - [out] IEnumStreamIdMap ** ppIEnumStreamIdMap - ) ; -} ; - -/*++ - Implemented on the output pin. - - Provides the ability to map/unmap a stream_id to/from an output pin. ---*/ -[ - object, - local, - uuid (D0E04C47-25B8-4369-925A-362A01D95444), - pointer_default(unique) -] -interface IMPEG2StreamIdMap : IUnknown -{ - HRESULT - MapStreamId ( - [in] ULONG ulStreamId, // mpeg-2 stream_id - [in] DWORD MediaSampleContent, // #define'd above IEnumStreamIdMap - [in] ULONG ulSubstreamFilterValue, // filter value - [in] int iDataOffset // elementary stream offset - ) ; - - HRESULT - UnmapStreamId ( - [in] ULONG culStreamId, // number of stream_id's in pulStreamId - [in] ULONG * pulStreamId // array of stream_id's to unmap - ) ; - - HRESULT - EnumStreamIdMap ( - [out] IEnumStreamIdMap ** ppIEnumStreamIdMap - ) ; -} ; - - -// Register a service provider with the filter graph -[ - object, - local, - uuid(7B3A2F01-0751-48DD-B556-004785171C54), - pointer_default(unique) -] -interface IRegisterServiceProvider : IUnknown -{ - // registers one service into it's internal table.. Object is refcounted. - // register a NULL value to remove the service - HRESULT RegisterService([in] REFGUID guidService, [in] IUnknown *pUnkObject); -}; - - -cpp_quote("#define AM_GETDECODERCAP_QUERY_VMR_SUPPORT 0x00000001") -cpp_quote("#define VMR_NOTSUPPORTED 0x00000000") -cpp_quote("#define VMR_SUPPORTED 0x00000001") - -cpp_quote("#define AM_QUERY_DECODER_VMR_SUPPORT 0x00000001") -cpp_quote("#define AM_QUERY_DECODER_DXVA_1_SUPPORT 0x00000002") - -cpp_quote("#define AM_QUERY_DECODER_DVD_SUPPORT 0x00000003") -cpp_quote("#define AM_QUERY_DECODER_ATSC_SD_SUPPORT 0x00000004") -cpp_quote("#define AM_QUERY_DECODER_ATSC_HD_SUPPORT 0x00000005") - -cpp_quote("#define DECODER_CAP_NOTSUPPORTED 0x00000000") -cpp_quote("#define DECODER_CAP_SUPPORTED 0x00000001") - - -[ - object, - local, - uuid(c0dff467-d499-4986-972b-e1d9090fa941), - pointer_default(unique) -] -interface IAMDecoderCaps : IUnknown -{ - HRESULT GetDecoderCaps([in] DWORD dwCapIndex, [out] DWORD* lpdwCap); -}; - - - -//--------------------------------------------------------------------- -// -// IAMClockSlave interface -// -// When the audio renderer is slaving to a separate graph clock this -// interface provides a way for an app to specify how closely in sync -// the slaving renderer should try to stay to the graph clock. Note that -// using a larger tolerance for a video & audio playback graph will likely -// result in looser a/v sync, so it recommended not to change this setting -// except under special circumstances. -// -//--------------------------------------------------------------------- - -// -// Used to set/get the error tolerance used by a slaving audio renderer -// -[ -object, - uuid(9FD52741-176D-4b36-8F51-CA8F933223BE), - pointer_default(unique) -] -interface IAMClockSlave : IUnknown -{ - // set millisecond value to use for slaving tolerance - // the allowed range is 1 to 1000ms - HRESULT SetErrorTolerance ( - [in] DWORD dwTolerance - ); - - // get millisecond value currently being used for slaving tolerance - HRESULT GetErrorTolerance ( - [out] DWORD *pdwTolerance - ); -}; - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - // forward declarations - these are the interfaces declared in this file - - interface IEnumRegFilters; - interface IFileSourceFilter; - interface IFileSinkFilter; - interface IFileSinkFilter2; - interface IGraphBuilder; - interface ICaptureGraphBuilder; - interface ICaptureGraphBuilder2; - interface IAMCopyCaptureFileProgress; - interface IFilterMapper; - interface IFilterMapper2; - interface IMediaEventSink; - interface IOverlay; - interface IOverlayNotify; - interface IOverlayNotify2; - interface IQualityControl; - interface ISeekingPassThru; - interface IAMStreamConfig; - interface IAMDevMemoryAllocator; - interface IAMDevMemoryControl; - interface IConfigInterleaving; - interface IConfigAviMux; - interface IAMVideoCompression; - interface IAMVfwCaptureDialogs; - interface IAMVfwCompressDialogs; - interface IAMDroppedFrames; - interface IAMAudioInputMixer; - interface IAMBufferNegotiation; - interface IAMAnalogVideoDecoder; - interface IAMVideoProcAmp; - interface IAMAnalogVideoEncoder; - interface IAMCameraControl; - interface IAMCrossbar; - interface IAMTVTuner; - interface IKsPropertySet; - interface IAMPhysicalPinInfo; - interface IAMExtDevice; - interface IAMExtTransport; - interface IAMTimecodeReader; - interface IAMTimecodeGenerator; - interface IAMTimecodeDisplay; - interface IDrawVideoImage; - interface IDecimateVideoImage; - interface IAMVideoDecimationProperties; - interface IAMPushSource; - interface IAMAudioRendererStats; - interface IAMLatency; - interface IAMGraphStreams; - interface IAMOverlayFX; - interface IAMOpenProgress; - interface IMpeg2Demultiplexer ; - interface IMPEG2StreamIdMap ; - interface IEnumStreamIdMap ; - - //========================================================================== - //========================================================================== - // IEnumRegFilters interface -- enumerates registered filters. - // enumerator interface returned from IFilterMapper::EnumMatchingFilters(). - // based on IEnum pseudo-template - //========================================================================== - //========================================================================== - - typedef struct { - CLSID Clsid; // class id of the filter - LPWSTR Name; // name of filter - } REGFILTER; - - [ - object, - uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - - // The point of the mapper is to avoid loading filters. By looking in the - // registry we can reduce the number of filters which must be loaded and tried. - // This enumerator returns descriptors of filters (including the GUIDs that - // CoCreateInstance can instantiate). The filters themselves are not loaded. - - interface IEnumRegFilters : IUnknown { - import "unknwn.idl"; - - // The caller must use CoTaskMemFree to free each REGFILTER* returned - // in the array. - HRESULT Next - ( [in] ULONG cFilters, // place this many filters... - [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER* - [out] ULONG * pcFetched // actual count passed returned here - ); - - // I can't think why anyone would want to skip, so it's not implemented. - // (anyone who thinks they know what they would be skipping over is probably - // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL. - - HRESULT Skip( - [in] ULONG cFilters - ); - - HRESULT Reset(void); - - // No cloning either - also ALWAYS returns E_NOTIMPL. - - HRESULT Clone( - [out] IEnumRegFilters **ppEnum - ); - } - - - typedef IEnumRegFilters *PENUMREGFILTERS; - - //======================================================================== - //======================================================================== - // abstraction representing the registered information about filters. - // This allows properties of filters to be looked up without loading them. - //======================================================================== - //======================================================================== - - [ - object, - uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IFilterMapper : IUnknown { - import "unknwn.idl"; - - //========================================================================== - // Registration functions. - // A filter should be registered before any other use. - // The registration can be NON_VOLATILE (i.e. permanent, do once ever) - // or VOLATILE (once per boot of the system). - // UnregisterFilter (obviously) removes the registration. - // The action of any of the other calls on unregistered filters is undefined. - // it will either work or you'll get an error, but I'm not saying which. - //========================================================================== - - // Four predefined values controling the order in which filters are tried - // for intelligent graph building. Intermediate values are legal. - // Any value <=MERIT_DO_NOT_USE will mean that the filter will never - // be tried by the filtergrah to automatically complete a connection. - - enum { MERIT_PREFERRED = 0x800000, - MERIT_NORMAL = 0x600000, - MERIT_UNLIKELY = 0x400000, - MERIT_DO_NOT_USE = 0x200000, - MERIT_SW_COMPRESSOR = 0x100000, - MERIT_HW_COMPRESSOR = 0x100050 - }; - - // Register a filter - - HRESULT RegisterFilter - ( [in] CLSID clsid, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name for the filter - [in] DWORD dwMerit // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED. - ); - - - // Register an identifiable instance of a filter. This deals with cases - // such as two similar sound cards which are driven by the same driver, - // but we want to choose which oif these cards the sound will come out of. - // This is not needed if there is only one instance of the filter - // (e.g. there is only one sound card in the machine) or if all instances - // of the filter are equivalent. - - // The filter itself must have already been registered // ??? Is that true? - HRESULT RegisterFilterInstance - ( [in] CLSID clsid, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name of instance. - [out] CLSID *MRId // Returned Media Resource Id. A - // locally unique id for this instance - // of this filter - ); - - - HRESULT RegisterPin - ( [in] CLSID Filter, // GUID of filter - [in] LPCWSTR Name, // Name of the pin - [in] BOOL bRendered, // The filter renders this input - [in] BOOL bOutput, // TRUE if this is an Output pin - [in] BOOL bZero, // TRUE if OK for zero instances of pin - // In this case you will have to Create - // a pin to have even one instance - [in] BOOL bMany, // TRUE if OK for many instances of pin - [in] CLSID ConnectsToFilter, // Filter it connects to if it has - // subterranean connection, else NULL - [in] LPCWSTR ConnectsToPin // Name of pin it connects to - // NULL for output pins - ); - - HRESULT RegisterPinType - ( [in] CLSID clsFilter, // GUID of filter - [in] LPCWSTR strName, // Descriptive name of the pin - [in] CLSID clsMajorType, // Major type of the data stream - [in] CLSID clsSubType // Sub type of the data stream - ); - - - HRESULT UnregisterFilter - ( [in] CLSID Filter // GUID of filter - ); - - - HRESULT UnregisterFilterInstance - ( [in] CLSID MRId // Media Resource Id of this instance - ); - - - HRESULT UnregisterPin - ( [in] CLSID Filter, // GUID of filter - [in] LPCWSTR Name // Name of the pin - ); - - - // Set *ppEnum to be an enumerator for filters matching the requirements. - - HRESULT EnumMatchingFilters - ( [out] IEnumRegFilters **ppEnum // enumerator returned - , [in] DWORD dwMerit // at least this merit needed - , [in] BOOL bInputNeeded // need at least one input pin - , [in] CLSID clsInMaj // input major type - , [in] CLSID clsInSub // input sub type - , [in] BOOL bRender // must the input be rendered? - , [in] BOOL bOututNeeded // need at least one output pin - , [in] CLSID clsOutMaj // output major type - , [in] CLSID clsOutSub // output sub type - ); - - } - - // structure used to identify media types a pin handles. Used for - // registration through IFilterMapper and IFilterMapper2 - // - typedef struct - { - const CLSID * clsMajorType; - const CLSID * clsMinorType; - } REGPINTYPES; - - // describes pin for filter registration. Used for registration - // through IFilterMapper and IFilterMapper2 - // - typedef struct - { - LPWSTR strName; - - // The filter renders this input - BOOL bRendered; - - // This is an Output pin - BOOL bOutput; - - // OK to have zero instances of pin In this case you will have to - // Create a pin to have even one instance - BOOL bZero; - - // OK to create many instance of pin - BOOL bMany; - - const CLSID * clsConnectsToFilter; - const WCHAR * strConnectsToPin; - - UINT nMediaTypes; - const REGPINTYPES * lpMediaType; - } REGFILTERPINS; - - // mediums (as defined in the Windows NT DDK) for registration with - // IFilterMapper2 - // - typedef struct - { - CLSID clsMedium; - DWORD dw1; - DWORD dw2; - } REGPINMEDIUM; - - // flags for dwFlags in REFILTERPINS2 - enum - { - // OK to have zero instances of pin In this case you will have to - // Create a pin to have even one instance - REG_PINFLAG_B_ZERO = 0x1, - - // The filter renders this input - REG_PINFLAG_B_RENDERER = 0x2, - - // OK to create many instance of pin - REG_PINFLAG_B_MANY = 0x4, - - // This is an Output pin - REG_PINFLAG_B_OUTPUT = 0x8 - }; - - - // describes pin for filter registration through IFilterMapper2 - typedef struct - { - // combination of REG_PINFLAG flags - DWORD dwFlags; - - // number of instances of the pin if known - UINT cInstances; - - UINT nMediaTypes; - [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType; - - UINT nMediums; - [size_is(nMediums)] const REGPINMEDIUM *lpMedium; - - // pin category (for Kernel Streaming pins) as defined in the - // Windows NT DDK - const CLSID *clsPinCategory; - - } REGFILTERPINS2; - - // describes filter for registration through IFilterMapper2 - typedef struct - { - DWORD dwVersion; // 1 or 2 - DWORD dwMerit; - - /* unnamed union */ - [switch_is(dwVersion)] [switch_type(DWORD)] union - { - [case(1)] - - struct - { - ULONG cPins; - [size_is(cPins)] const REGFILTERPINS *rgPins; - }; - - [case(2)] - - struct - { - ULONG cPins2; - [size_is(cPins2)] const REGFILTERPINS2 *rgPins2; - }; - - [default] - ; - } ; - - } REGFILTER2; - - - - [ - object, - uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375), - pointer_default(unique) - ] - interface IFilterMapper2 : IUnknown { - import "unknwn.idl"; - - // create or rename ActiveMovie category - HRESULT CreateCategory - ( [in] REFCLSID clsidCategory, - [in] DWORD dwCategoryMerit, - [in] LPCWSTR Description - ); - - HRESULT UnregisterFilter - ( [in] const CLSID *pclsidCategory, - [in] const OLECHAR *szInstance, - [in] REFCLSID Filter // GUID of filter - ); - - // Register a filter, pins, and media types under a category. - HRESULT RegisterFilter - ( [in] REFCLSID clsidFilter, // GUID of the filter - [in] LPCWSTR Name, // Descriptive name for the filter - - // ppMoniker can be null. or *ppMoniker can contain the - // moniker where this filter data will be written; - // *ppMoniker will be set to null on return. or *ppMoniker - // can be null in which case the moniker will be returned - // with refcount. - [in, out] IMoniker **ppMoniker, - - // can be null - [in] const CLSID *pclsidCategory, - - // cannot be null - [in] const OLECHAR *szInstance, - - // rest of filter and pin registration - [in] const REGFILTER2 *prf2 - ); - - // Set *ppEnum to be an enumerator for filters matching the - // requirements. - HRESULT EnumMatchingFilters - ( [out] IEnumMoniker **ppEnum // enumerator returned - , [in] DWORD dwFlags // 0 - , [in] BOOL bExactMatch // don't match wildcards - , [in] DWORD dwMerit // at least this merit needed - , [in] BOOL bInputNeeded // need at least one input pin - , [in] DWORD cInputTypes // Number of input types to match - // Any match is OK - , [size_is(cInputTypes*2)] const GUID *pInputTypes // input major+subtype pair array - , [in] const REGPINMEDIUM *pMedIn // input medium - , [in] const CLSID *pPinCategoryIn // input pin category - , [in] BOOL bRender // must the input be rendered? - , [in] BOOL bOutputNeeded // need at least one output pin - , [in] DWORD cOutputTypes // Number of output types to match - // Any match is OK - , [size_is(cOutputTypes*2)] const GUID *pOutputTypes // output major+subtype pair array - , [in] const REGPINMEDIUM *pMedOut // output medium - , [in] const CLSID *pPinCategoryOut // output pin category - ); - } - - [ - object, - uuid(b79bb0b1-33c1-11d1-abe1-00a0c905f375), - pointer_default(unique) - ] - interface IFilterMapper3 : IFilterMapper2 { - // new interface to allow creating filters using the mapper's devenum instance - // primarily needed for out-of-proc access to a graph - HRESULT GetICreateDevEnum( [out] ICreateDevEnum **ppEnum ); - } - - //======================================================================== - //======================================================================== - // Defines IQualityControl interface - // - // Defines quality messages and allows a quality manager to install itself - // as the sink for quality messages. - //======================================================================== - //======================================================================== - - typedef enum tagQualityMessageType { - Famine, - Flood - } QualityMessageType; - - typedef struct tagQuality { - QualityMessageType Type; - long Proportion; // milli-units. 1000 = no change - // for Flood: - // What proportion of the media samples currently - // coming through are required in the future. - // 800 means please drop another 20% - // For Famine: - // How much to "keep in" e.g. 800 means send me - // 20% less e.g. by dropping 20% of the samples. - // 1100 would mean "I'm coping, send me more". - REFERENCE_TIME Late; - // How much you need to catch up by - REFERENCE_TIME TimeStamp; - // The stream time when this was generated (probably - // corresponds to the start time on some sample). - } Quality; - - typedef IQualityControl *PQUALITYCONTROL; - - - [ - object, - uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IQualityControl : IUnknown { - - // Notify the recipient that a quality change is requested. - // pSelf is the IBaseFilter* of the sender. - // this is sent from a filter - // to (the quality manager or) an upstream peer. - HRESULT Notify - ( [in] IBaseFilter * pSelf, - [in] Quality q - ); - - // Notify the recipient that future quality messages are to be sent - // to iqc. If piqc is NULL then quality messages are to default back to - // the upstream peer. - // This is sent from the quality manager to a filter. - // The recipient should hold piqc as a WEAK reference, - // i.e. do not AddRef it, do not Release it. - HRESULT SetSink - ( [in] IQualityControl * piqc - ); - } - - //===================================================================== - //===================================================================== - // Definitions required for overlay transport - //===================================================================== - //===================================================================== - - - // Used to communicate the colour that the IOverlay client wants the window - // painted in so that it can draw directly to the correct clipping region - // A colour key can be described in two alternate ways, the first is by a - // range of one or more (system) palette indices. The second is by defining - // a colour cube with two RGB values, any of which would be acceptable. - // - // The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros - - - enum { CK_NOCOLORKEY = 0x0, // No color key is required - CK_INDEX = 0x1, // Index into the current system palette - CK_RGB = 0x2 }; // Color key is an RGB value (or range) - - typedef struct tagCOLORKEY { - - DWORD KeyType; // Explains meaning of the structure - DWORD PaletteIndex; // Palette index if available - COLORREF LowColorValue; // Low colour space RGB value - COLORREF HighColorValue; // Defines the high RGB value - - } COLORKEY; - - // When a filter sets up an advise link it can ask that only certain types - // of notifications be sent, for example just palette changes. While this - // doesn't mean that the other notification call backs won't ever be called - // the IOverlay implementation may use this as an efficiency optimisation - - enum { ADVISE_NONE = 0x0, // No notifications required - ADVISE_CLIPPING = 0x1, // Synchronous clip information - ADVISE_PALETTE = 0x2, // Palette change notifications - ADVISE_COLORKEY = 0x4, // Called when colour key changes - ADVISE_POSITION = 0x8, // Likewise when window moves etc - ADVISE_DISPLAY_CHANGE = 0x10 // Called on WM_DISPLAYCHANGE - }; - - const DWORD ADVISE_ALL = ADVISE_CLIPPING | - ADVISE_PALETTE | - ADVISE_COLORKEY | - ADVISE_POSITION; - - const DWORD ADVISE_ALL2 = ADVISE_ALL | - ADVISE_DISPLAY_CHANGE; - - // This isn't defined when you run IDL - - cpp_quote("#ifndef _WINGDI_") - - typedef struct _RGNDATAHEADER { - DWORD dwSize; - DWORD iType; - DWORD nCount; - DWORD nRgnSize; - RECT rcBound; - } RGNDATAHEADER; - - typedef struct _RGNDATA { - RGNDATAHEADER rdh; - char Buffer[1]; - } RGNDATA; - - cpp_quote("#endif") - - - //===================================================================== - //===================================================================== - // Defines IOverlayNotify interface - // - // This interface gives asynchronous notifications of changes to the - // rendering window - such as changes to the exposed window area - //===================================================================== - //===================================================================== - - [ - object, - local, - uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IOverlayNotify : IUnknown { - - // IOverlayNotify methods - - // This notifies the filter of palette changes, the filter should copy - // the array of RGBQUADs if it needs to use them after returning. This - // is not called when the palette is actually changed in the display - // but at a short time after (in sync with WM_PALETTECHANGED messages) - - HRESULT OnPaletteChange( - [in] DWORD dwColors, // Number of colours present - [in] const PALETTEENTRY *pPalette); // Array of palette colours - - // This provides synchronous clip changes so that the client is called - // before the window is moved to freeze the video, and then when the - // window has stabilised it is called again to start playback again. - // If the window rect is all zero then the window is invisible, the - // filter must take a copy of the information if it wants to keep it - - HRESULT OnClipChange( - [in] const RECT *pSourceRect, // Region of video to use - [in] const RECT *pDestinationRect, // Where video goes - [in] const RGNDATA *pRgnData); // Defines clipping information - - HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey); - - // The calls to OnClipChange happen in sync with the window. So it is - // called with an empty clip list before the window moves to freeze - // the video, and then when the window has stabilised it is called - // again with the new clip list. The OnPositionChange callback is for - // overlay cards that don't want the expense of synchronous clipping - // updates and just want to know when the source or destination video - // positions change. They will NOT be called in sync with the window - // but at some point after the window has changed (basicly in time - // with WM_SIZE etc messages received). This is therefore suitable - // for overlay cards that don't inlay their data to the frame buffer - // NOTE the destination is NOT clipped to the visible display area - - HRESULT OnPositionChange([in] const RECT *pSourceRect, - [in] const RECT *pDestinationRect); - } - - typedef IOverlayNotify *POVERLAYNOTIFY; - - - //===================================================================== - //===================================================================== - // Defines IOverlayNotify2 interface - // - // This interface gives asynchronous notifications of changes to the - // rendering window - such as changes to the exposed window area - // This is optionally supported by the advise sink for the purposes - // of accepting OnDisplayChange notification. - //===================================================================== - //===================================================================== - - cpp_quote("#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)") - cpp_quote("#define HMONITOR_DECLARED") - cpp_quote("#if 0") - typedef HANDLE HMONITOR; - cpp_quote("#endif") - cpp_quote("DECLARE_HANDLE(HMONITOR);") - cpp_quote("#endif") - - [ - object, - local, - uuid(680EFA10-D535-11D1-87C8-00A0C9223196), - pointer_default(unique) - ] - interface IOverlayNotify2 : IOverlayNotify { - - // IOverlayNotify2 methods - - HRESULT OnDisplayChange( // ADVISE_DISPLAY_CHANGE - HMONITOR hMonitor); - } - - typedef IOverlayNotify2 *POVERLAYNOTIFY2; - - - //===================================================================== - //===================================================================== - // Defines IOverlay interface - // - // This interface provides information so that a filter can write direct to - // the frame buffer while placing the video in the correct window position - //===================================================================== - //===================================================================== - - [ - object, - local, - uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IOverlay : IUnknown { - - // IOverlay methods - - HRESULT GetPalette( - [out] DWORD *pdwColors, // Number of colours present - [out] PALETTEENTRY **ppPalette); // Where to put palette data - - HRESULT SetPalette( - [in] DWORD dwColors, // Number of colours present - [in] PALETTEENTRY *pPalette); // Colours to use for palette - - // If you change the colour key through SetColorKey then all the advise - // links will receive an OnColorKeyChange callback with the new colour - - HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey); - HRESULT GetColorKey([out] COLORKEY *pColorKey); - HRESULT SetColorKey([in,out] COLORKEY *pColorKey); - HRESULT GetWindowHandle([out] HWND *pHwnd); - - // The IOverlay implementation allocates the memory for the clipping - // rectangles as it can be variable in length. The filter calling - // this method should free the memory when it is finished with it - - HRESULT GetClipList([out] RECT *pSourceRect, - [out] RECT *pDestinationRect, - [out] RGNDATA **ppRgnData); - - // Returns the current video source and destination - - HRESULT GetVideoPosition([out] RECT *pSourceRect, - [out] RECT *pDestinationRect); - - HRESULT Advise( - [in] IOverlayNotify *pOverlayNotify, // Notification interface - [in] DWORD dwInterests); // Callbacks interested in - - HRESULT Unadvise(); // Stop the callbacks now - } - - typedef IOverlay *POVERLAY; - - - //===================================================================== - //===================================================================== - // control related interfaces (others are defined in control.odl) - //===================================================================== - //===================================================================== - - - //===================================================================== - //===================================================================== - // Defines IMediaEventSink interface - // - // Exposed by filtergraph. Called by filters to notify events. Will be - // passed on to application by the IMediaControl event methods. - //===================================================================== - //===================================================================== - - [ - object, - uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IMediaEventSink : IUnknown { - - // notify an event. will be queued, but not delivered to - // the application on this thread. - HRESULT Notify( - [in] long EventCode, - [in] LONG_PTR EventParam1, - [in] LONG_PTR EventParam2 - ); - } - - typedef IMediaEventSink *PMEDIAEVENTSINK; - - //===================================================================== - //===================================================================== - // Defines IFileSourceFilter interface - // - // Exposed by source filters to set the file name and media type. - //===================================================================== - //===================================================================== - - [ - object, - uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IFileSourceFilter : IUnknown { - - // Load a file and assign it the given media type - HRESULT Load( - [in] LPCOLESTR pszFileName, // Pointer to absolute path of file to open - [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL - ); - // Get the currently loaded file name - HRESULT GetCurFile( - [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file - [out] AM_MEDIA_TYPE *pmt // Pointer to the media type - ); - } - - typedef IFileSourceFilter *PFILTERFILESOURCE; - - //===================================================================== - //===================================================================== - // Defines IFileSinkFilter interface - // - // Exposed by renderers to set the output file name. - //===================================================================== - //===================================================================== - - [ - object, - uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6), - pointer_default(unique) - ] - interface IFileSinkFilter : IUnknown { - - // Output to this file. default is to open the existing file - HRESULT SetFileName( - [in] LPCOLESTR pszFileName, // Pointer to absolute path of output file - [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL - ); - // Get the current file name - HRESULT GetCurFile( - [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file - [out] AM_MEDIA_TYPE *pmt // Pointer to the media type - ); - } - - typedef IFileSinkFilter *PFILTERFILESINK; - - [ - object, - uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86), - pointer_default(unique) - ] - interface IFileSinkFilter2 : IFileSinkFilter { - - HRESULT SetMode( - [in] DWORD dwFlags // AM_FILESINK_FLAGS - ); - - HRESULT GetMode( - [out] DWORD *pdwFlags // AM_FILESINK_FLAGS - ); - } - - typedef IFileSinkFilter2 *PFILESINKFILTER2; - - typedef enum { - - // create a new file - AM_FILE_OVERWRITE = 0x00000001, - - } AM_FILESINK_FLAGS; - - - // - // Intelligent connectivity for filters - an interface supported by - // filter graphs (since it is an extension to IFilterGraph) that supports - // building of graphs by automatic selection and connection of appropriate - // filters - - [ - object, - uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IGraphBuilder : IFilterGraph { - // Connect these two pins directly or indirectly, using transform filters - // if necessary. - - HRESULT Connect - ( [in] IPin * ppinOut, // the output pin - [in] IPin * ppinIn // the input pin - ); - - - // Connect this output pin directly or indirectly, using transform filters - // if necessary to something that will render it. - - HRESULT Render - ( [in] IPin * ppinOut // the output pin - ); - - - // Build a filter graph that will render this file using this play list. - // If lpwstrPlayList is NULL then it will use the default play list - // which will typically render the whole file. - - HRESULT RenderFile - ( [in] LPCWSTR lpcwstrFile, - [in, unique] LPCWSTR lpcwstrPlayList - ); - - - // Add to the filter graph a source filter for this file. This would - // be the same source filter that would be added by calling Render. - // This call gives you more control over building - // the rest of the graph, e.g. AddFilter() - // and then Connect the two. - // The IBaseFilter* interface exposed by the source filter is returned - // in ppFilter, addrefed already for you - // The filter will be known by the name lpcwstrFIlterName - // nn this filter graph, - HRESULT AddSourceFilter - ( [in] LPCWSTR lpcwstrFileName, - [in, unique] LPCWSTR lpcwstrFilterName, - [out] IBaseFilter* *ppFilter - ); - - - // If this call is made then trace information will be written to the - // file showing the actions taken in attempting to perform an operation. - HRESULT SetLogFile - ( [in] DWORD_PTR hFile // open file handle e.g. from CreateFile - ); - - - // Request that the graph builder should return as soon as possible from - // its current task. - // Note that it is possible fot the following to occur in the following - // sequence: - // Operation begins; Abort is requested; Operation completes normally. - // This would be normal whenever the quickest way to finish an operation - // was to simply continue to the end. - HRESULT Abort(); - - // Return S_OK if the curent operation is to continue, - // return S_FALSE if the current operation is to be aborted. - // This method can be called as a callback from a filter which is doing - // some operation at the request of the graph. - HRESULT ShouldOperationContinue(); - - } - - - // - // New capture graph builder - - [ - object, - uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5), - pointer_default(unique) - ] - interface ICaptureGraphBuilder : IUnknown { - - // Use this filtergraph - HRESULT SetFiltergraph( - [in] IGraphBuilder *pfg); - - // what filtergraph are you using? - // *ppfg->Release() when you're done with it - HRESULT GetFiltergraph( - [out] IGraphBuilder **ppfg); - - // creates a rendering section in the filtergraph consisting of a MUX - // of some filetype, and a file writer (and connects them together) - // *ppf->Release() when you're done with it - // *ppSink->Release() when you're done with it - HRESULT SetOutputFileName( - [in] const GUID *pType, // type of file to write, eg. MEDIASUBTYPE_Avi - [in] LPCOLESTR lpstrFile, // filename given to file writer - [out] IBaseFilter **ppf, // returns pointer to the MUX - [out] IFileSinkFilter **ppSink);// queried from file writer - - // Looks for an interface on the filter and on the output pin of the given - // category. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or - // NULL for "don't care". - // It will also look upstream and downstream of - // the pin for the interface, to find interfaces on renderers, MUXES, TV - // Tuners, etc. - // Call *ppint->Release() when you're done with it - [local] HRESULT FindInterface( - [in, unique] const GUID *pCategory, // can be NULL for all pins - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] void **ppint); - [call_as(FindInterface)] HRESULT RemoteFindInterface( - [in, unique] const GUID *pCategory, // can be NULL for all pins - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] IUnknown **ppint); - - // Connects the pin of the given category of the source filter to the - // rendering filter, optionally through another filter (compressor?) - // For a non-NULL category, it will instantiate and connect additional - // required filters upstream too, like TV Tuners and Crossbars. - // If there is only one output pin on the source, use a NULL - // category. You can also have pSource be a pin - HRESULT RenderStream( - [in] const GUID *pCategory, // can be NULL if only one output pin - [in] IUnknown *pSource, // filter or pin - [in] IBaseFilter *pfCompressor, - [in] IBaseFilter *pfRenderer); // can be NULL - - // Sends IAMStreamControl messages to the pin of the desired category, eg. - // "capture" or "preview" - // REFERENCE_TIME=NULL means NOW - // REFERENCE_TIME=MAX_TIME means never, or cancel previous request - // NULL controls all capture filters in the graph - you will get one - // notification for each filter with a pin of that category found - // returns S_FALSE if stop will be signalled before last sample is - // rendered. - // return a FAILURE code if the filter does not support IAMStreamControl - HRESULT ControlStream( - [in] const GUID *pCategory, - [in] IBaseFilter *pFilter, - [in] REFERENCE_TIME *pstart, - [in] REFERENCE_TIME *pstop, - [in] WORD wStartCookie, // high word reserved - [in] WORD wStopCookie); // high word reserved - - // creates a pre-allocated file of a given size in bytes - HRESULT AllocCapFile( - [in] LPCOLESTR lpstr, - [in] DWORDLONG dwlSize); - - // Copies the valid file data out of the old, possibly huge old capture - // file into a shorter new file. - // Return S_FALSE from your progress function to abort capture, S_OK to - // continue - HRESULT CopyCaptureFile( - [in] LPOLESTR lpwstrOld, - [in] LPOLESTR lpwstrNew, - [in] int fAllowEscAbort, // pressing ESC will abort? - [in] IAMCopyCaptureFileProgress *pCallback); // implement this to - // get progress - } - - - // - // Capture graph builder "CopyCapturedFile" progress callback - - [ - object, - uuid(670d1d20-a068-11d0-b3f0-00aa003761c5), - pointer_default(unique) - ] - interface IAMCopyCaptureFileProgress : IUnknown { - - // If you support this interface somewhere, this function will be called - // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing - // to let you know the progress - // - // Return S_OK from this function to continue. Return S_FALSE to abort the - // copy - HRESULT Progress( - [in] int iProgress); // a number between 0 and 100 (%) - } - - - // - // Capture graph builder that can deal with a single filter having more than - // one pin of each category... some new devices can capture both audio and - // video, for example - // - - [ - object, - uuid(93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D), - pointer_default(unique) - ] - interface ICaptureGraphBuilder2 : IUnknown { - - // Use this filtergraph - HRESULT SetFiltergraph( - [in] IGraphBuilder *pfg); - - // what filtergraph are you using? - // *ppfg->Release() when you're done with it - HRESULT GetFiltergraph( - [out] IGraphBuilder **ppfg); - - // creates a rendering section in the filtergraph consisting of a MUX - // of some filetype, and a file writer (and connects them together) - // *ppf->Release() when you're done with it - // *ppSink->Release() when you're done with it - HRESULT SetOutputFileName( - [in] const GUID *pType, // GUID of MUX filter to use - [in] LPCOLESTR lpstrFile, // filename given to file writer - [out] IBaseFilter **ppf, // returns pointer to the MUX - [out] IFileSinkFilter **ppSink);// queried from file writer - - // Looks for an interface on the filter and on the output pin of the given - // category and type. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or - // NULL for "don't care". Type: MAJORTYPE_Video/Audio etc or NULL) - // !!! Will some filters have >1 capture pin? ie RGB and MPEG? - // It will also look upstream and downstream of - // the pin for the interface, to find interfaces on renderers, MUXES, TV - // Tuners, etc. - // Call *ppint->Release() when you're done with it - [local] HRESULT FindInterface( - [in] const GUID *pCategory, // can be NULL for all pins - [in] const GUID *pType, // Audio/Video/??? or NULL (don't care) - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] void **ppint); - [call_as(FindInterface)] HRESULT RemoteFindInterface( - [in] const GUID *pCategory, // can be NULL for all pins - [in] const GUID *pType, // Audio/Video/??? or NULL (don't care) - [in] IBaseFilter *pf, - [in] REFIID riid, - [out] IUnknown **ppint); - - // Connects the pin of the given category and type of the source filter to - // the rendering filter, optionally through another filter (compressor?) - // (Type is a Majortype, like Video or Audio) - // For a non-NULL category, it will instantiate and connect additional - // required filters upstream too, like TV Tuners and Crossbars. - // If there is only one output pin on the source, use a NULL category - // and type. You can also have pSource be a pin - HRESULT RenderStream( - [in] const GUID *pCategory, // can be NULL if only one output pin - [in] const GUID *pType, // Major type (Video/Audio/etc) - [in] IUnknown *pSource, // filter or pin - [in] IBaseFilter *pfCompressor, - [in] IBaseFilter *pfRenderer); // can be NULL - - // Sends IAMStreamControl messages to the pin of the desired category, - // (eg. "capture" or "preview") and of the desired type (eg. VIDEO or AUDIO) - // A category MUST be given. If a filter is given, a type must be too. - // REFERENCE_TIME=NULL means NOW - // REFERENCE_TIME=MAX_TIME means never, or cancel previous request - // NULL controls all capture filters in the graph - you will get one - // notification for each filter with a pin of that category found - // returns S_FALSE if stop will be signalled before last sample is - // rendered. - // return a FAILURE code if the filter does not support IAMStreamControl - HRESULT ControlStream( - [in] const GUID *pCategory, - [in] const GUID *pType, // Major type (Video/Audio/etc) - [in] IBaseFilter *pFilter, - [in] REFERENCE_TIME *pstart, - [in] REFERENCE_TIME *pstop, - [in] WORD wStartCookie, // high word reserved - [in] WORD wStopCookie); // high word reserved - - // creates a pre-allocated file of a given size in bytes - HRESULT AllocCapFile( - [in] LPCOLESTR lpstr, - [in] DWORDLONG dwlSize); - - // Copies the valid file data out of the old, possibly huge old capture - // file into a shorter new file. - // Return S_FALSE from your progress function to abort capture, S_OK to - // continue - HRESULT CopyCaptureFile( - [in] LPOLESTR lpwstrOld, - [in] LPOLESTR lpwstrNew, - [in] int fAllowEscAbort, // pressing ESC will abort? - [in] IAMCopyCaptureFileProgress *pCallback); // implement this to - // get progress - // Helper fn to find a certain pin on a filter. - HRESULT FindPin( - [in] IUnknown *pSource, - [in] PIN_DIRECTION pindir, // input or output? - [in] const GUID *pCategory, // what category? (or NULL) - [in] const GUID *pType, // what Major type (or NULL) - [in] BOOL fUnconnected, // must it be unconnected? - [in] int num, // which pin matching this? (0 based) - [out] IPin **ppPin); - } - - enum _AM_RENSDEREXFLAGS { - AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers - }; - - // - // IFilterGraph2 - // - // New methods on for IFilterGraph and IGraphBuilder will have to go here. - // - - [ - object, - uuid(36b73882-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) - ] - interface IFilterGraph2: IGraphBuilder { - - // Add a Moniker source moniker - HRESULT AddSourceFilterForMoniker( - [in] IMoniker *pMoniker, - [in] IBindCtx *pCtx, - [in, unique] LPCWSTR lpcwstrFilterName, - [out] IBaseFilter **ppFilter - ); - - // Specify the type for a reconnect - // This is better than Reconnect as sometime the parties to a - // reconnection can't remember what type they'd agreed (!) - HRESULT ReconnectEx - ( [in] IPin * ppin, // the pin to disconnect and reconnect - [in, unique] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL - ); - - // Render a pin without adding any new renderers - HRESULT RenderEx( [in] IPin *pPinOut, // Pin to render - [in] DWORD dwFlags, // flags - [in, out] DWORD *pvContext // Unused - set to NULL - ); - - #if 0 - // Method looks for a filter which supports the specified interface. If such - // a filter exists, an AddRef()'ed pointer to the requested interface is placed - // in *ppInterface. - // - // *ppInterface will be NULL on return if such a filter could not be found, and - // the method will return E_NOINTERFACE. - // - // pdwIndex is an internal index that is used for obtaining subsequent interfaces. - // *pdwIndex should be initialized to zero. It is set on return to a value that - // allows the implementation of FindFilterInterface to search for further interfaces - // if called again. If no more such interfaces exist, the method will return E_NOINTERFACE. - // - // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just - // a single filter in the graph that supports the interface. Otherwise it returns - // E_NOINTERFACE. - // - HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex ); - - // Tries to obtain the interface from the filter graph itself. If this fails, - // it attempts to find the unique filter that supports the interface. - // On failure the method will return E_NOINTERFACE. On success, it returns - // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface. - // - HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface ); - - #endif - } - - // - // StreamBuilder - // aka Graph building with constraints - // aka convergent graphs - // aka Closed captioning - - [ - object, - local, - uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IStreamBuilder : IUnknown { - - // Connect this output pin directly or indirectly, using transform filters - // if necessary to thing(s) that will render it, within this graph - // Move from Initial state to Rendered state. - - HRESULT Render - ( [in] IPin * ppinOut, // the output pin - [in] IGraphBuilder * pGraph // the graph - ); - - // Undo what you did in Render. Return to Initial state. - HRESULT Backout - ( [in] IPin * ppinOut, // the output pin - [in] IGraphBuilder * pGraph // the graph - ); - } - - - // async reader interface - supported by file source filters. Allows - // multiple overlapped reads from different positions - - - [ - object, - uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IAsyncReader : IUnknown - { - // pass in your preferred allocator and your preferred properties. - // method returns the actual allocator to be used. Call GetProperties - // on returned allocator to learn alignment and prefix etc chosen. - // this allocator will be not be committed and decommitted by - // the async reader, only by the consumer. - // Must call this before calling Request. - HRESULT RequestAllocator( - [in] IMemAllocator* pPreferred, - [in] ALLOCATOR_PROPERTIES* pProps, - [out] IMemAllocator ** ppActual); - - // queue a request for data. - // media sample start and stop times contain the requested absolute - // byte position (start inclusive, stop exclusive). - // may fail if sample not obtained from agreed allocator. - // may fail if start/stop position does not match agreed alignment. - // samples allocated from source pin's allocator may fail - // GetPointer until after returning from WaitForNext. - // Stop position must be aligned - this means it may exceed duration. - // on completion, stop position will be corrected to unaligned - // actual data. - HRESULT Request( - [in] IMediaSample* pSample, - [in] DWORD_PTR dwUser); // user context - - // block until the next sample is completed or the timeout occurs. - // timeout (millisecs) may be 0 or INFINITE. Samples may not - // be delivered in order. If there is a read error of any sort, a - // notification will already have been sent by the source filter, - // and HRESULT will be an error. - // If ppSample is not null, then a Request completed with the result - // code returned. - HRESULT WaitForNext( - [in] DWORD dwTimeout, - [out] IMediaSample** ppSample, // completed sample - [out] DWORD_PTR * pdwUser); // user context - - // sync read of data. Sample passed in must have been acquired from - // the agreed allocator. Start and stop position must be aligned. - // equivalent to a Request/WaitForNext pair, but may avoid the - // need for a thread on the source filter. - HRESULT SyncReadAligned( - [in] IMediaSample* pSample); - - - // sync read. works in stopped state as well as run state. - // need not be aligned. Will fail if read is beyond actual total - // length. - HRESULT SyncRead( - [in] LONGLONG llPosition, // absolute file position - [in] LONG lLength, // nr bytes required - [out, size_is(lLength)] - BYTE* pBuffer); // write data here - - // return total length of stream, and currently available length. - // reads for beyond the available length but within the total length will - // normally succeed but may block for a long period. - HRESULT Length( - [out] LONGLONG* pTotal, - [out] LONGLONG* pAvailable); - - // cause all outstanding reads to return, possibly with a failure code - //(VFW_E_TIMEOUT) indicating they were cancelled. - // Between BeginFlush and EndFlush calls, Request calls will fail and - // WaitForNext calls will always complete immediately. - HRESULT BeginFlush(void); - HRESULT EndFlush(void); - } - - - // interface provided by the filtergraph itself to let other objects - // (especially plug-in distributors, but also apps like graphedt) know - // when the graph has changed. - [ - object, - uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IGraphVersion : IUnknown - { - // returns the current graph version number - // this is incremented every time there is a change in the - // set of filters in the graph or in their connections - // - // if this is changed since your last enumeration, then re-enumerate - // the graph - HRESULT QueryVersion(LONG* pVersion); - } - - - - - // - // interface describing an object that uses resources. - // - // implement if: you request resources using IResourceManager. You will - // need to pass your implementation of this pointer as an in param. - // - // use if: you are a resource manager who implements IResourceManager - [ - object, - uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IResourceConsumer : IUnknown - { - // you may acquire the resource specified. - // return values: - // S_OK -- I have successfully acquired it - // S_FALSE -- I will acquire it and call NotifyAcquire afterwards - // VFW_S_NOT_NEEDED: I no longer need the resource - // FAILED(hr)-I tried to acquire it and failed. - - HRESULT - AcquireResource( - [in] LONG idResource); - - - - // Please release the resource. - // return values: - // S_OK -- I have released it (and want it again when available) - // S_FALSE -- I will call NotifyRelease when I have released it - // other something went wrong. - HRESULT - ReleaseResource( - [in] LONG idResource); - } - - - - // interface describing a resource manager that will resolve contention for - // named resources. - // - // implement if: you are a resource manager. The filtergraph will be a resource - // manager, internally delegating to the system wide resource manager - // (when there is one) - // - // use if: you need resources that are limited. Use the resource manager to - // resolve contention by registering the resource with this interface, - // and requesting it from this interface whenever needed. - // - // or use if: you detect focus changes which should affect resource usage. - // Notifying change of focus to the resource manager will cause the resource - // manager to switch contended resources to the objects that have the user's - // focus - [ - object, - uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IResourceManager : IUnknown - { - // tell the manager how many there are of a resource. - // ok if already registered. will take new count. if new count - // is lower, will de-allocate resources to new count. - // - // You get back a token that will be used in further calls. - // - // Passing a count of 0 will eliminate this resource. There is currently - // no defined way to find the id without knowing the count. - // - HRESULT - Register( - [in] LPCWSTR pName, // this named resource - [in] LONG cResource, // has this many instances - [out] LONG* plToken // token placed here on return - ); - - HRESULT - RegisterGroup( - [in] LPCWSTR pName, // this named resource group - [in] LONG cResource, // has this many resources - [in, size_is(cResource)] - LONG* palTokens, // these are the contained resources - [out] LONG* plToken // group resource id put here on return - ); - - // request the use of a given, registered resource. - // possible return values: - // S_OK == yes you can use it now - // S_FALSE == you will be called back when the resource is available - // other - there is an error. - // - // The priority of this request should be affected by the associated - // focus object -- that is, when SetFocus is called for that focus - // object (or a 'related' object) then my request should be put through. - // - // A filter should pass the filter's IUnknown here. The filtergraph - // will match filters to the filtergraph, and will attempt to trace - // filters to common source filters when checking focus objects. - // The Focus object must be valid for the entire lifetime of the request - // -- until you call CancelRequest or NotifyRelease(id, p, FALSE) - HRESULT - RequestResource( - [in] LONG idResource, - [in] IUnknown* pFocusObject, - [in] IResourceConsumer* pConsumer - ); - - - // notify the resource manager that an acquisition attempt completed. - // Call this method after an AcquireResource method returned - // S_FALSE to indicate asynchronous acquisition. - // HR should be S_OK if the resource was successfully acquired, or a - // failure code if the resource could not be acquired. - HRESULT - NotifyAcquire( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer, - [in] HRESULT hr); - - // Notify the resource manager that you have released a resource. Call - // this in response to a ReleaseResource method, or when you have finished - // with the resource. bStillWant should be TRUE if you still want the - // resource when it is next available, or FALSE if you no longer want - // the resource. - HRESULT - NotifyRelease( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer, - [in] BOOL bStillWant); - - // I don't currently have the resource, and I no longer need it. - HRESULT - CancelRequest( - [in] LONG idResource, - [in] IResourceConsumer* pConsumer); - - // Notify the resource manager that a given object has been given the - // user's focus. In ActiveMovie, this will normally be a video renderer - // whose window has received the focus. The filter graph will switch - // contended resources to (in order): - // requests made with this same focus object - // requests whose focus object shares a common source with this - // requests whose focus object shares a common filter graph - // After calling this, you *must* call ReleaseFocus before the IUnknown - // becomes invalid, unless you can guarantee that another SetFocus - // of a different object is done in the meantime. No addref is held. - // - // The resource manager will hold this pointer until replaced or cancelled, - // and will use it to resolve resource contention. It will call - // QueryInterface for IBaseFilter at least and if found will call methods on - // that interface. - HRESULT - SetFocus( - [in] IUnknown* pFocusObject); - - // Sets the focus to NULL if the current focus object is still - // pFocusObject. Call this when - // the focus object is about to be destroyed to ensure that no-one is - // still referencing the object. - HRESULT - ReleaseFocus( - [in] IUnknown* pFocusObject); - - - - // !!! still need - // -- app override (some form of SetPriority) - // -- enumeration and description of resources - - } - - - // - // Interface representing an object that can be notified about state - // and other changes within a filter graph. The filtergraph will call plug-in - // distributors that expose this optional interface so that they can - // respond to appropriate changes. - // - // Implement if: you are a plug-in distributor (your class id is found - // under HKCR\Interface\\Distributor= for some interface). - // - // Use if: you are the filtergraph. - [ - object, - uuid(56a868af-0ad4-11ce-b03a-0020af0ba770), - pointer_default(unique) - ] - interface IDistributorNotify : IUnknown - { - // called when graph is entering stop state. Called before - // filters are stopped. - HRESULT Stop(void); - - // called when graph is entering paused state, before filters are - // notified - HRESULT Pause(void); - - // called when graph is entering running state, before filters are - // notified. tStart is the stream-time offset parameter that will be - // given to each filter's IBaseFilter::Run method. - HRESULT Run(REFERENCE_TIME tStart); - - // called when the graph's clock is changing, with the new clock. Addref - // the clock if you hold it beyond this method. Called before - // the filters are notified. - HRESULT SetSyncSource( - [in] IReferenceClock * pClock); - - // called when the set of filters or their connections has changed. - // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything - // that will lead to one of these). - // You don't need to rebuild your list of interesting filters at this point - // but you should release any refcounts you hold on any filters that - // have been removed. - HRESULT NotifyGraphChange(void); - } - - typedef enum { - AM_STREAM_INFO_START_DEFINED = 0x00000001, - AM_STREAM_INFO_STOP_DEFINED = 0x00000002, - AM_STREAM_INFO_DISCARDING = 0x00000004, - AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010 - } AM_STREAM_INFO_FLAGS; - - // Stream information - typedef struct { - REFERENCE_TIME tStart; - REFERENCE_TIME tStop; - DWORD dwStartCookie; - DWORD dwStopCookie; - DWORD dwFlags; - } AM_STREAM_INFO; - - // - // IAMStreamControl - // - - [ - object, - uuid(36b73881-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) - ] - interface IAMStreamControl : IUnknown - { - // The REFERENCE_TIME pointers may be null, which - // indicates immediately. If the pointer is non-NULL - // and dwCookie is non-zero, then pins should send - // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED - // with an IPin pointer and the cookie, thus allowing - // apps to tie the events back to their requests. - // If either dwCookies is zero, or the pointer is null, - // then no event is sent. - - // If you have a capture pin hooked up to a MUX input pin and they - // both support IAMStreamControl, you'll want the MUX to signal the - // stop so you know the last frame was written out. In order for the - // MUX to know it's finished, the capture pin will have to send one - // extra sample after it was supposed to stop, so the MUX can trigger - // off that. So you would set bSendExtra to TRUE for the capture pin - // Leave it FALSE in all other cases. - - HRESULT StartAt( [in] const REFERENCE_TIME * ptStart, - [in] DWORD dwCookie ); - HRESULT StopAt( [in] const REFERENCE_TIME * ptStop, - [in] BOOL bSendExtra, - [in] DWORD dwCookie ); - HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo); - } - - - - // - // ISeekingPassThru - // - - [ - object, - uuid(36b73883-c2c8-11cf-8b46-00805f6cef60), - pointer_default(unique) - ] - interface ISeekingPassThru : IUnknown - { - HRESULT Init( [in] BOOL bSupportRendering, - [in] IPin *pPin); - } - - - - // - // IAMStreamConfig - pin interface - // - - // A capture filter or compression filter's output pin - // supports this interface - no matter what data type you produce. - - // This interface can be used to set the output format of a pin (as an - // alternative to connecting the pin using a specific media type). - // After setting an output format, the pin will use that format - // the next time it connects to somebody, so you can just Render that - // pin and get a desired format without using Connect(CMediaType) - // Your pin should do that by ONLY OFFERING the media type set in SetFormat - // in its enumeration of media types, and no others. This will ensure that - // that format is indeed used for connection (or at least offer it first). - // An application interested in enumerating accepted mediatypes may have to - // do so BEFORE calling SetFormat. - - // But this interface's GetStreamCaps function can get more information - // about accepted media types than the traditional way of enumerating a pin's - // media types, so it should typically be used instead. - // GetStreamCaps gets information about the kinds of formats allowed... how - // it can stretch and crop, and the frame rate and data rates allowed (for - // video) - - // VIDEO EXAMPLE - // - // GetStreamCaps returns a whole array of {MediaType, Capabilities}. - // Let's say your capture card supports JPEG anywhere between 160x120 and - // 320x240, and also the size 640x480. Also, say it supports RGB24 at - // resolutions between 160x120 and 320x240 but only multiples of 8. You would - // expose these properties by offering a media type of 320 x 240 JPEG - // (if that is your default or preferred size) coupled with - // capabilities saying minimum 160x120 and maximum 320x240 with granularity of - // 1. The next pair you expose is a media type of 640x480 JPEG coupled with - // capabilities of min 640x480 max 640x480. The third pair is media type - // 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8. - // In this way you can expose almost every quirk your card might have. - // An application interested in knowing what compression formats you provide - // can get all the pairs and make a list of all the unique sub types of the - // media types. - // - // If a filter's output pin is connected with a media type that has rcSource - // and rcTarget not empty, it means the filter is being asked to stretch the - // rcSource sub-rectangle of its InputSize (the format of the input pin for - // a compressor, and the largest bitmap a capture filter can generate with - // every pixel unique) into the rcTarget sub-rectangle of its output format. - // For instance, if a video compressor has as input 160x120 RGB, and as output - // 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100) - // this means the compressor is being asked to take a 10x10 piece of the 160x120 - // RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap, - // leaving the rest of the 320x240 bitmap untouched. - // A filter does not have to support this and can fail to connect with a - // media type where rcSource and rcTarget are not empty. - // - // Your output pin is connected to the next filter with a certain media - // type (either directly or using the media type passed by SetFormat), - // and you need to look at the AvgBytesPerSecond field of the format - // of that mediatype to see what data rate you are being asked to compress - // the video to, and use that data rate. Using the number of frames per - // second in AvgTimePerFrame, you can figure out how many bytes each frame - // is supposed to be. You can make it smaller, but NEVER EVER make a bigger - // data rate. For a video compressor, your input pin's media type tells you - // the frame rate (use that AvgTimePerFrame). For a capture filter, the - // output media type tells you, so use that AvgTimePerFrame. - // - // The cropping rectangle described below is the same as the rcSrc of the - // output pin's media type. - // - // The output rectangle described below is the same of the width and height - // of the BITMAPINFOHEADER of the media type of the output pin's media type - - - // AUDIO EXAMPLE - // - // This API can return an array of pairs of (media type, capabilities). - // This can be used to expose all kinds of wierd capabilities. Let's say you - // do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or - // stereo, and you also do 48,000 16bit stereo as a special combination. - // You would expose 3 pairs. The first pair would have Min Freq of 11025 and - // Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the - // capabilites structure, and a media type of anything you like, maybe - // 22kHz, 8bit stereo as a default. - // The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in - // the capabilities structure and the media type could be something like - // 44kHz, 16bit stereo as a default (the media type in the pair should always - // be something legal as described by the capabilities structure... the - // structure tells you how you can change the media type to produce other - // legal media types... for instance changing 44kHz to 29010Hz would be legal, - // but changing bits from 16 to 14 would not be.) - // The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2 - // MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo. - // You can also use the Granularity elements of the structure (like the example - // for video) if you support values that multiples of n, eg. you could say - // minimum bits per sample 8, max 16, and granularity 8 to describe doing - // either 8 or 16 bit all in one structure - // - // If you support non-PCM formats, the media type returned in GetStreamCaps - // can show which non-PCM formats you support (with a default sample rate, - // bit rate and channels) and the capabilities structure going with that - // media type can describe which other sample rates, bit rates and channels - // you support. - - [ - object, - uuid(C6E13340-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMStreamConfig : IUnknown - { - - // this is the structure returned by a VIDEO filter - // - typedef struct _VIDEO_STREAM_CONFIG_CAPS { - - GUID guid; // will be MEDIATYPE_Video - - // the logical or of all the AnalogVideoStandard's supported - // typically zero if not supported - ULONG VideoStandard; - - // the inherent size of the incoming signal... taken from the input - // pin for a compressor, or the largest size a capture filter can - // digitize the signal with every pixel still unique - SIZE InputSize; - - // The input of a compressor filter may have to be connected for these - // to be known - - // smallest rcSrc cropping rect allowed - SIZE MinCroppingSize; - // largest rcSrc cropping rect allowed - SIZE MaxCroppingSize; - // granularity of cropping size - eg only widths a multiple of 4 allowed - int CropGranularityX; - int CropGranularityY; - // alignment of cropping rect - eg rect must start on multiple of 4 - int CropAlignX; - int CropAlignY; - - // The input of a compressor filter may have to be connected for these - // to be known - - // smallest bitmap this pin can produce - SIZE MinOutputSize; - // largest bitmap this pin can produce - SIZE MaxOutputSize; - // granularity of output bitmap size - int OutputGranularityX; - int OutputGranularityY; - // !!! what about alignment of rcTarget inside BIH if different? - - // how well can you stretch in the x direction? 0==not at all - // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation - // etc. - int StretchTapsX; - int StretchTapsY; - // how well can you shrink in the x direction? 0==not at all - // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation - // etc. - int ShrinkTapsX; - int ShrinkTapsY; - - // CAPTURE filter only - what frame rates are allowed? - LONGLONG MinFrameInterval; - LONGLONG MaxFrameInterval; - - // what data rates can this pin produce? - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; - } VIDEO_STREAM_CONFIG_CAPS; - - - // this is the structure returned by an AUDIO filter - // - typedef struct _AUDIO_STREAM_CONFIG_CAPS { - - GUID guid; // will be MEDIATYPE_Audio - ULONG MinimumChannels; - ULONG MaximumChannels; - ULONG ChannelsGranularity; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG BitsPerSampleGranularity; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG SampleFrequencyGranularity; - } AUDIO_STREAM_CONFIG_CAPS; - - // - only allowed when pin is not streaming, else the call will FAIL - // - If your output pin is not yet connected, and you can - // connect your output pin with this media type, you should - // succeed the call, and start offering it first (enumerate as format#0) - // from GetMediaType so that this format will be used to connect with - // when you do connect to somebody - // - if your output pin is already connected, and you can provide this - // type, reconnect your pin. If the other pin can't accept it, FAIL - // this call and leave your connection alone. - HRESULT SetFormat( - [in] AM_MEDIA_TYPE *pmt); - - // the format it's connected with, or will connect with - // the application is responsible for calling DeleteMediaType(*ppmt); - HRESULT GetFormat( - [out] AM_MEDIA_TYPE **ppmt); - - // how many different Stream Caps structures are there? - // also, how big is the stream caps structure? - HRESULT GetNumberOfCapabilities( - [out] int *piCount, - [out] int *piSize); // pSCC of GetStreamCaps needs to be this big - - // - gets one of the pairs of {Mediatype, Caps} - // - return S_FALSE if iIndex is too high - // - the application is responsible for calling DeleteMediaType(*ppmt); - // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video - // or MEDIATYPE_Audio, so you can tell if you have a pointer to a - // VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure - // There could potentially be many more possibilities other than video - // or audio. - HRESULT GetStreamCaps( - [in] int iIndex, // 0 to #caps-1 - [out] AM_MEDIA_TYPE **ppmt, - [out] BYTE *pSCC); - - } - - - - // Interface to control interleaving of different streams in one file - [ - object, - uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86), - pointer_default(unique) - ] - interface IConfigInterleaving : IUnknown - { - import "unknwn.idl"; - - typedef enum - { - // uninterleaved - samples written out in the order they - // arrive - INTERLEAVE_NONE, - - // approximate interleaving with less overhead for video - // capture - INTERLEAVE_CAPTURE, - - // full, precise interleaving. slower. - INTERLEAVE_FULL - - } InterleavingMode; - - HRESULT put_Mode( - [in] InterleavingMode mode - ); - - HRESULT get_Mode( - [out] InterleavingMode *pMode - ); - - HRESULT put_Interleaving( - [in] const REFERENCE_TIME *prtInterleave, - [in] const REFERENCE_TIME *prtPreroll - ); - - HRESULT get_Interleaving( - [out] REFERENCE_TIME *prtInterleave, - [out] REFERENCE_TIME *prtPreroll - ); - } - - // Interface to control the AVI mux - [ - object, - uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6), - pointer_default(unique) - ] - interface IConfigAviMux : IUnknown - { - import "unknwn.idl"; - - // control whether the AVI mux adjusts the frame rate or audio - // sampling rate for drift when the file is closed. -1 to disables - // this behavior. - HRESULT SetMasterStream([in] LONG iStream); - HRESULT GetMasterStream([out] LONG *pStream); - - // control whether the AVI mux writes out an idx1 index chunk for - // compatibility with older AVI players. - HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex); - HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex); - } - - //--------------------------------------------------------------------- - // CompressionCaps enum - //--------------------------------------------------------------------- - - // This tells you which features of IAMVideoCompression are supported - - // CanCrunch means that it can compress video to a specified data rate - // If so, then the output pin's media type will contain that data rate - // in the format's AvgBytesPerSecond field, and that should be used. - - typedef enum - { - CompressionCaps_CanQuality = 0x01, - CompressionCaps_CanCrunch = 0x02, - CompressionCaps_CanKeyFrame = 0x04, - CompressionCaps_CanBFrame = 0x08, - CompressionCaps_CanWindow = 0x10 - } CompressionCaps; - - - - //--------------------------------------------------------------------- - // IAMVideoCompression interface - // - // Control compression parameters - pin interface - //--------------------------------------------------------------------- - - // This interface is implemented by the output pin of a video capture - // filter or video compressor that provides video data - - // You use this interface to control how video is compressed... how - // many keyframes, etc., and to find information like capabilities and - // the description of this compressor - - [ - object, - uuid(C6E13343-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMVideoCompression : IUnknown - { - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanKeyFrame - // - KeyFrameRate < 0 means use the compressor default - // - KeyFrames == 0 means only the first frame is a key - HRESULT put_KeyFrameRate ( - [in] long KeyFrameRate); - - HRESULT get_KeyFrameRate ( - [out] long * pKeyFrameRate); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanBFrame - // - If keyframes are every 10, and there are 3 P Frames per key, - // they will be spaced evenly between the key frames and the other - // 6 frames will be B frames - // - PFramesPerKeyFrame < 0 means use the compressor default - HRESULT put_PFramesPerKeyFrame ( - [in] long PFramesPerKeyFrame); - - HRESULT get_PFramesPerKeyFrame ( - [out] long * pPFramesPerKeyFrame); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanQuality - // - Controls image quality - // - If you are compressing to a fixed data rate, a high quality - // means try and use all of the data rate, and a low quality means - // feel free to use much lower than the data rate if you want to. - // - Quality < 0 means use the compressor default - HRESULT put_Quality ( - [in] double Quality); - - HRESULT get_Quality ( - [out] double * pQuality); - - // If you have set a data rate of 100K/sec on a 10fps movie, that - // will normally mean each frame must be <=10K. But a window size - // means every consecutive n frames must average to the data rate, - // but an individual frame (if n > 1) is allowed to exceed the - // frame size suggested by the data rate - HRESULT put_WindowSize ( - [in] DWORDLONG WindowSize); - - HRESULT get_WindowSize ( - [out] DWORDLONG * pWindowSize); - - // - pszVersion might be "Version 2.1.0" - // - pszDescription might be "Danny's awesome video compressor" - // - pcbVersion and pcbDescription will be filled in with the - // required length if they are too short - // - *pCapabilities is a logical OR of some CompressionCaps flags - HRESULT GetInfo( - [out, size_is(*pcbVersion)] WCHAR * pszVersion, - [in,out] int *pcbVersion, - [out, size_is(*pcbDescription)] LPWSTR pszDescription, - [in,out] int *pcbDescription, - [out] long *pDefaultKeyFrameRate, - [out] long *pDefaultPFramesPerKey, - [out] double *pDefaultQuality, - [out] long *pCapabilities //CompressionCaps - ); - - // - this means when this frame number comes along after the graph - // is running, make it a keyframe even if you weren't going to - HRESULT OverrideKeyFrame( - [in] long FrameNumber - ); - - // - Only valid if GetInfo's pCapabilities sets - // CompressionCaps_CanCrunch - // - this means when this frame number comes along after the graph - // is running, make it this many bytes big instead of whatever size - // you were going to make it. - HRESULT OverrideFrameSize( - [in] long FrameNumber, - [in] long Size - ); - - } - - //--------------------------------------------------------------------- - // VfwCaptureDialogs enum - //--------------------------------------------------------------------- - - typedef enum - { - VfwCaptureDialog_Source = 0x01, - VfwCaptureDialog_Format = 0x02, - VfwCaptureDialog_Display = 0x04 - } VfwCaptureDialogs; - - - //--------------------------------------------------------------------- - // VfwCompressDialogs enum - //--------------------------------------------------------------------- - - typedef enum - { - VfwCompressDialog_Config = 0x01, - VfwCompressDialog_About = 0x02, - // returns S_OK if the dialog exists and can be shown, else S_FALSE - VfwCompressDialog_QueryConfig = 0x04, - VfwCompressDialog_QueryAbout = 0x08 - } VfwCompressDialogs; - - - //--------------------------------------------------------------------- - // IAMVfwCaptureDialogs - filter interface - // - // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY - //--------------------------------------------------------------------- - - // This interface is supported only by Microsoft's Video For Windows - // capture driver Capture Filter. It allows an application to bring up - // one of the 3 driver dialogs that VfW capture drivers have. - - [ - object, - local, - uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMVfwCaptureDialogs : IUnknown - { - HRESULT HasDialog( - [in] int iDialog // VfwCaptureDialogs enum - ); - - HRESULT ShowDialog( - [in] int iDialog, // VfwCaptureDialogs enum - [in] HWND hwnd - ); - - HRESULT SendDriverMessage( - [in] int iDialog, // VfwCaptureDialogs enum - [in] int uMsg, - [in] long dw1, - [in] long dw2 - ); - - // - iDialog can be one of the VfwCaptureDialogs enums - // - HasDialog returns S_OK if it has the dialog, else S_FALSE - // - ShowDialog can only be called when not streaming or when another - // dialog is not already up - // - SendDriverMessage can send a secret message to the capture driver. - // USE IT AT YOUR OWN RISK! - } - - //--------------------------------------------------------------------- - // IAMVfwCompressDialogs - filter interface - // - // Show a VfW codec driver dialog - CONFIG or ABOUT - //--------------------------------------------------------------------- - - // This interface is supported only by Microsoft's ICM Compressor filter - // (Co). It allows an application to bring up either the Configure or - // About dialogs for the ICM codec that it is currently using. - - [ - object, - local, - uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMVfwCompressDialogs : IUnknown - { - - // Bring up a dialog for this codec - HRESULT ShowDialog( - [in] int iDialog, // VfwCompressDialogs enum - [in] HWND hwnd - ); - - // Calls ICGetState and gives you the result - HRESULT GetState( - [out, size_is(*pcbState)] LPVOID pState, - [in, out] int *pcbState - ); - - // Calls ICSetState - HRESULT SetState( - [in, size_is(cbState)] LPVOID pState, - [in] int cbState - ); - - // Send a codec specific message - HRESULT SendDriverMessage( - [in] int uMsg, - [in] long dw1, - [in] long dw2 - ); - - // - iDialog can be one of the VfwCaptureDialogs enums - // - ShowDialog can only be called when not streaming or when no other - // dialog is up already - // - an application can call GetState after ShowDialog(CONFIG) to - // see how the compressor was configured and next time the graph - // is used, it can call SetState with the data it saved to return - // the codec to the state configured by the dialog box from last time - // - GetState with a NULL pointer returns the size needed - // - SendDriverMessage can send a secret message to the codec. - // USE IT AT YOUR OWN RISK! - } - - - //--------------------------------------------------------------------- - // IAMDroppedFrames interface - // - // Report status of capture - pin interface - //--------------------------------------------------------------------- - - // A capture filter's video output pin supports this. It reports - // how many frames were not sent (dropped), etc. - - // Every time your filter goes from STOPPED-->PAUSED, you reset all your - // counts to zero. - - // An app may call this all the time while you are capturing to see how - // capturing is going. MAKE SURE you always return as current information - // as possible while you are running. - - // When your capture filter starts running, it starts by sending frame 0, - // then 1, 2, 3, etc. The time stamp of each frame sent should correspond - // to the graph clock's time when the image was digitized. The end time - // is the start time plus the duration of the video frame. - // You should also set the MediaTime of each sample (SetMediaTime) as well. - // This should be the frame number ie (0,1) (1,2) (2,3). - // If a frame is dropped, a downstream filter will be able to tell easily - // not by looking for gaps in the regular time stamps, but by noticing a - // frame number is missing (eg. (1,2) (2,3) (4,5) (5,6) means frame 3 - // was dropped. - - // Using the info provided by this interface, an application can figure out - // the number of frames dropped, the frame rate achieved (the length of - // time the graph was running divided by the number of frames not dropped), - // and the data rate acheived (the length of time the graph was running - // divided by the average frame size). - - // If your filter is running, then paused, and then run again, you need - // to continue to deliver frames as if it was never paused. The first - // frame after the second RUN cannot be time stamped earlier than the last - // frame sent before the pause. - - // Your filter must always increment the MediaTime of each sample sent. - // Never send the same frame # twice, and never go back in time. The - // regular time stamp of a sample can also never go back in time. - - [ - object, - uuid(C6E13344-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMDroppedFrames : IUnknown - { - // Get the number of dropped frames - HRESULT GetNumDropped( - [out] long * plDropped - - ); - - //Get the number of non-dropped frames - HRESULT GetNumNotDropped( - [out] long * plNotDropped - - ); - - // - plArray points to an array of lSize longs. The filter will - // fill it with the frame number of the first lSize frames dropped. - // A filter may not have bothered to remember as many as you asked - // for, so it will set *plNumCopied to the number of frames it filled - // in. - HRESULT GetDroppedInfo( - [in] long lSize, - [out] long * plArray, - [out] long * plNumCopied - ); - - // - This is the average size of the frames it didn't drop (in bytes) - HRESULT GetAverageFrameSize( - [out] long * plAverageSize - - ); - - } - - - - cpp_quote("#define AMF_AUTOMATICGAIN -1.0") - - //--------------------------------------------------------------------- - // IAMAudioInputMixer interface - // - // Sets the recording levels, pan and EQ for the audio card inputs - //--------------------------------------------------------------------- - - // This interface is implemented by each input pin of an audio capture - // filter, to tell it what level, panning, and EQ to use for each input. - // The name of each pin will reflect the type of input, eg. "Line input 1" - // or "Mic". An application uses the pin names to decide how it wants to - // set the recording levels - - // This interface can also be supported by the audio capture filter itself - // to control to overall record level and panning after the mix - - [ - object, - uuid(54C39221-8380-11d0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMAudioInputMixer : IUnknown - { - // This interface is only supported by the input pins, not the filter - // If disabled, this channel will not be mixed in as part of the - // recorded signal. - HRESULT put_Enable ( - [in] BOOL fEnable); // TRUE=enable FALSE=disable - - //Is this channel enabled? - HRESULT get_Enable ( - [out] BOOL *pfEnable); - - // When set to mono mode, making a stereo recording of this channel - // will have both channels contain the same data... a mixture of the - // left and right signals - HRESULT put_Mono ( - [in] BOOL fMono); // TRUE=mono FALSE=multi channel - - //all channels combined into a mono signal? - HRESULT get_Mono ( - [out] BOOL *pfMono); - - // !!! WILL CARDS BE ABLE TO BOOST THE GAIN? - //Set the record level for this channel - HRESULT put_MixLevel ( - [in] double Level); // 0 = off, 1 = full (unity?) volume - // AMF_AUTOMATICGAIN, if supported, - // means automatic - - //Get the record level for this channel - HRESULT get_MixLevel ( - [out] double *pLevel); - - // For instance, when panned full left, and you make a stereo recording - // of this channel, you will record a silent right channel. - HRESULT put_Pan ( - [in] double Pan); // -1 = full left, 0 = centre, 1 = right - - //Get the pan for this channel - HRESULT get_Pan ( - [out] double *pPan); - - // Boosts the bass of low volume signals before they are recorded - // to compensate for the fact that your ear has trouble hearing quiet - // bass sounds - HRESULT put_Loudness ( - [in] BOOL fLoudness);// TRUE=on FALSE=off - - HRESULT get_Loudness ( - [out] BOOL *pfLoudness); - - // boosts or cuts the treble of the signal before it's recorded by - // a certain amount of dB - HRESULT put_Treble ( - [in] double Treble); // gain in dB (-ve = attenuate) - - //Get the treble EQ for this channel - HRESULT get_Treble ( - [out] double *pTreble); - - // This is the maximum value allowed in put_Treble. ie 6.0 means - // any value between -6.0 and 6.0 is allowed - HRESULT get_TrebleRange ( - [out] double *pRange); // largest value allowed - - // boosts or cuts the bass of the signal before it's recorded by - // a certain amount of dB - HRESULT put_Bass ( - [in] double Bass); // gain in dB (-ve = attenuate) - - // Get the bass EQ for this channel - HRESULT get_Bass ( - [out] double *pBass); - - // This is the maximum value allowed in put_Bass. ie 6.0 means - // any value between -6.0 and 6.0 is allowed - HRESULT get_BassRange ( - [out] double *pRange); // largest value allowed - - } - - - //--------------------------------------------------------------------- - // IAMBufferNegotiation interface - // - // Tells a pin what kinds of buffers to use when connected - //--------------------------------------------------------------------- - - // This interface can be implemented by any pin that will connect to - // another pin using IMemInputPin. All capture filters should support - // this interface. - - // SuggestAllocatorProperties is a way for an application to get - // in on the buffer negotiation process for a pin. This pin will use - // the numbers given to it by the application as its request to the - // allocator. An application can use a negative number for any element - // in the ALLOCATOR_PROPERTIES to mean "don't care". An application must - // call this function before the pin is connected, or it will be too late - // To ensure that an application gets what it wants, it would be wise to - // call this method on both pins being connected together, so the other - // pin doesn't overrule the application's request. - - // GetAllocatorProperties can only be called after a pin is connected and - // it returns the properties of the current allocator being used - - [ - object, - uuid(56ED71A0-AF5F-11D0-B3F0-00AA003761C5), - pointer_default(unique) - ] - interface IAMBufferNegotiation : IUnknown - { - HRESULT SuggestAllocatorProperties ( - [in] const ALLOCATOR_PROPERTIES *pprop); - - HRESULT GetAllocatorProperties ( - [out] ALLOCATOR_PROPERTIES *pprop); - - } - - - //--------------------------------------------------------------------- - // AnalogVideoStandard enum - //--------------------------------------------------------------------- - - typedef enum tagAnalogVideoStandard - { - AnalogVideo_None = 0x00000000, // This is a digital sensor - AnalogVideo_NTSC_M = 0x00000001, // 75 IRE Setup - AnalogVideo_NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup - AnalogVideo_NTSC_433 = 0x00000004, - - AnalogVideo_PAL_B = 0x00000010, - AnalogVideo_PAL_D = 0x00000020, - AnalogVideo_PAL_G = 0x00000040, - AnalogVideo_PAL_H = 0x00000080, - AnalogVideo_PAL_I = 0x00000100, - AnalogVideo_PAL_M = 0x00000200, - AnalogVideo_PAL_N = 0x00000400, - - AnalogVideo_PAL_60 = 0x00000800, - - AnalogVideo_SECAM_B = 0x00001000, - AnalogVideo_SECAM_D = 0x00002000, - AnalogVideo_SECAM_G = 0x00004000, - AnalogVideo_SECAM_H = 0x00008000, - AnalogVideo_SECAM_K = 0x00010000, - AnalogVideo_SECAM_K1 = 0x00020000, - AnalogVideo_SECAM_L = 0x00040000, - AnalogVideo_SECAM_L1 = 0x00080000, - - AnalogVideo_PAL_N_COMBO // Argentina - = 0x00100000 - } AnalogVideoStandard; - - cpp_quote("#define AnalogVideo_NTSC_Mask 0x00000007") - cpp_quote("#define AnalogVideo_PAL_Mask 0x00100FF0") - cpp_quote("#define AnalogVideo_SECAM_Mask 0x000FF000") - - - //--------------------------------------------------------------------- - // TunerInputType enum - //--------------------------------------------------------------------- - - typedef enum tagTunerInputType - { - TunerInputCable, - TunerInputAntenna - } TunerInputType; - - //--------------------------------------------------------------------- - // VideoCopyProtectionType enum - //--------------------------------------------------------------------- - - typedef enum - { - VideoCopyProtectionMacrovisionBasic, - VideoCopyProtectionMacrovisionCBI - } VideoCopyProtectionType; - - //--------------------------------------------------------------------- - // PhysicalConnectorType enum - //--------------------------------------------------------------------- - - typedef enum tagPhysicalConnectorType - { - PhysConn_Video_Tuner = 1, - PhysConn_Video_Composite, - PhysConn_Video_SVideo, - PhysConn_Video_RGB, - PhysConn_Video_YRYBY, - PhysConn_Video_SerialDigital, - PhysConn_Video_ParallelDigital, - PhysConn_Video_SCSI, - PhysConn_Video_AUX, - PhysConn_Video_1394, - PhysConn_Video_USB, - PhysConn_Video_VideoDecoder, - PhysConn_Video_VideoEncoder, - PhysConn_Video_SCART, - PhysConn_Video_Black, - - - PhysConn_Audio_Tuner = 0x1000, - PhysConn_Audio_Line, - PhysConn_Audio_Mic, - PhysConn_Audio_AESDigital, - PhysConn_Audio_SPDIFDigital, - PhysConn_Audio_SCSI, - PhysConn_Audio_AUX, - PhysConn_Audio_1394, - PhysConn_Audio_USB, - PhysConn_Audio_AudioDecoder, - } PhysicalConnectorType; - - - - - //--------------------------------------------------------------------- - // IAMAnalogVideoDecoder interface - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13350-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMAnalogVideoDecoder : IUnknown - { - - //Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1... - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - //Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT put_TVFormat( - [in] long lAnalogVideoStandard - ); - - // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // True if horizontal sync is locked - HRESULT get_HorizontalLocked ( - [out] long * plLocked); - - // True if connected to a VCR (changes PLL timing) - HRESULT put_VCRHorizontalLocking ( - [in] long lVCRHorizontalLocking); - - HRESULT get_VCRHorizontalLocking ( - [out] long * plVCRHorizontalLocking); - - // Returns the number of lines in the video signal")] - HRESULT get_NumberOfLines ( - [out] long *plNumberOfLines); - - // Enables or disables the output bus - HRESULT put_OutputEnable ( - [in] long lOutputEnable); - - HRESULT get_OutputEnable ( - [out] long *plOutputEnable); - - } - - - //--------------------------------------------------------------------- - // VideoProcAmp Property enum - //--------------------------------------------------------------------- - - typedef enum tagVideoProcAmpProperty - { - VideoProcAmp_Brightness, - VideoProcAmp_Contrast, - VideoProcAmp_Hue, - VideoProcAmp_Saturation, - VideoProcAmp_Sharpness, - VideoProcAmp_Gamma, - VideoProcAmp_ColorEnable, - VideoProcAmp_WhiteBalance, - VideoProcAmp_BacklightCompensation, - VideoProcAmp_Gain - } VideoProcAmpProperty; - - //--------------------------------------------------------------------- - // VideoProcAmp Flags enum - //--------------------------------------------------------------------- - - typedef enum tagVideoProcAmpFlags - { - VideoProcAmp_Flags_Auto = 0x0001, - VideoProcAmp_Flags_Manual = 0x0002 - } VideoProcAmpFlags; - - //--------------------------------------------------------------------- - // IAMVideoProcAmp interface - // - // Adjusts video quality in either the analog or digital domain. - // - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13360-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMVideoProcAmp : IUnknown - { - // Returns min, max, step size, and default values - HRESULT GetRange( - [in] long Property, // Which property to query - [out] long * pMin, // Range minimum - [out] long * pMax, // Range maxumum - [out] long * pSteppingDelta,// Step size - [out] long * pDefault, // Default value - [out] long * pCapsFlags // VideoProcAmpFlags - - ); - - // Set a VideoProcAmp property - HRESULT Set( - [in] long Property, // VideoProcAmpProperty - [in] long lValue, // Value to set - [in] long Flags // VideoProcAmp_Flags_* - - ); - - // Get a VideoProcAmp property - HRESULT Get( - [in] long Property, // VideoProcAmpProperty - [out] long * lValue, // Current value - [out] long * Flags // VideoProcAmp_Flags_* - ); - } - - - //--------------------------------------------------------------------- - // CameraControl Property enum - //--------------------------------------------------------------------- - - typedef enum tagCameraControlProperty - { - CameraControl_Pan, - CameraControl_Tilt, - CameraControl_Roll, - CameraControl_Zoom, - CameraControl_Exposure, - CameraControl_Iris, - CameraControl_Focus - } CameraControlProperty; - - //--------------------------------------------------------------------- - // CameraControl Flags enum - //--------------------------------------------------------------------- - - typedef enum tagCameraControlFlags - { - CameraControl_Flags_Auto = 0x0001, - CameraControl_Flags_Manual = 0x0002 - } CameraControlFlags; - - //--------------------------------------------------------------------- - // IAMCameraControl interface - // - // Control of local or remote cameras - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13370-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMCameraControl : IUnknown - { - // Returns min, max, step size, and default values - HRESULT GetRange( - [in] long Property, // Which property to query - [out] long * pMin, // Range minimum - [out] long * pMax, // Range maxumum - [out] long * pSteppingDelta,// Step size - [out] long * pDefault, // Default value - [out] long * pCapsFlags // CamaeraControlFlags - - ); - - // Set a CameraControl property - HRESULT Set( - [in] long Property, // CameraControlProperty - [in] long lValue, // Value to set - [in] long Flags // CameraControl_Flags_* - - ); - - // Get a CameraControl property - HRESULT Get( - [in] long Property, // CameraControlProperty - [out] long * lValue, // Current value - [out] long * Flags // CameraControl_Flags_* - ); - } - - //--------------------------------------------------------------------- - // VideoControl Flags enum - //--------------------------------------------------------------------- - - typedef enum tagVideoControlFlags - { - VideoControlFlag_FlipHorizontal = 0x0001, - VideoControlFlag_FlipVertical = 0x0002, - VideoControlFlag_ExternalTriggerEnable = 0x0004, - VideoControlFlag_Trigger = 0x0008 - - } VideoControlFlags; - - //--------------------------------------------------------------------- - // IAMVideoControl interface - // - // Control of horizontal & vertical flip, external trigger, - // and listing available frame rates - //--------------------------------------------------------------------- - - [ - object, - uuid(6a2e0670-28e4-11d0-a18c-00a0c9118956), - pointer_default(unique) - ] - interface IAMVideoControl : IUnknown - { - // What can the underlying hardware do? - HRESULT GetCaps( - [in] IPin * pPin, // the pin to query or control - [out] long * pCapsFlags // VideoControlFlag_* - - ); - - // Set the mode of operation - HRESULT SetMode( - [in] IPin * pPin, // the pin to query or control - [in] long Mode // VideoControlFlag_* - - ); - - // Get the mode of operation - HRESULT GetMode( - [in] IPin * pPin, // the pin to query or control - [out] long * Mode // VideoControlFlag_* - ); - - // Get actual frame rate info for USB and 1394 - // This is only available when streaming - HRESULT GetCurrentActualFrameRate( - [in] IPin * pPin, // the pin to query or control - [out] LONGLONG * ActualFrameRate // 100 nS units - ); - - // Get max available frame rate info for USB and 1394 - // Returns the max frame rate currently available based on bus bandwidth usage - HRESULT GetMaxAvailableFrameRate( - [in] IPin * pPin, // the pin to query or control - [in] long iIndex, // 0 to IAMStreamConfig->GetNumberOfCapabilities-1 - [in] SIZE Dimensions, // width and height - [out] LONGLONG * MaxAvailableFrameRate // 100 nS units - ); - - // Get List of available frame rates - HRESULT GetFrameRateList( - [in] IPin * pPin, // the pin to query or control - [in] long iIndex, // 0 to IAMStreamConfig->GetNumberOfCapabilities-1 - [in] SIZE Dimensions, // width and height - [out] long * ListSize, // Number of elements in the list - [out] LONGLONG ** FrameRates // Array of framerates in 100 nS units - // or NULL to just get ListSize - ); - - } - - - //--------------------------------------------------------------------- - // IAMCrossbar interface - // - // Controls a routing matrix for analog or digital video or audio - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E13380-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMCrossbar : IUnknown - { - - // How many pins are there? - HRESULT get_PinCounts( - [out] long * OutputPinCount, // count of output pins - [out] long * InputPinCount); // count of input pins - - // True if routing is possible - HRESULT CanRoute ( - [in] long OutputPinIndex, // the output pin - [in] long InputPinIndex); // the input pin - - // Routes an input pin to an output pin - HRESULT Route ( - [in] long OutputPinIndex, // the output pin - [in] long InputPinIndex); // the input pin - - // Returns the input pin connected to a given output pin - HRESULT get_IsRoutedTo ( - [in] long OutputPinIndex, // the output pin - [out] long * InputPinIndex); // the connected input pin - - // Returns a pin which is related to a given pin - // (ie. this audio pin is related to a video pin) - HRESULT get_CrossbarPinInfo ( - [in] BOOL IsInputPin, // TRUE for input pins - [in] long PinIndex, // a pin - [out] long * PinIndexRelated, // Index of related pin - [out] long * PhysicalType); // Physical type of pin - - } - - - //--------------------------------------------------------------------- - // IAMTuner interface - // - // base tuner device - //--------------------------------------------------------------------- - - // predefined subchannel values - typedef enum tagAMTunerSubChannel - { - AMTUNER_SUBCHAN_NO_TUNE = -2, // don't tune - AMTUNER_SUBCHAN_DEFAULT = -1 // use default sub chan - } AMTunerSubChannel; - - // predefined signal strength values - typedef enum tagAMTunerSignalStrength - { - AMTUNER_HASNOSIGNALSTRENGTH = -1, // cannot indicate signal strength - AMTUNER_NOSIGNAL = 0, // no signal available - AMTUNER_SIGNALPRESENT = 1 // signal present - } AMTunerSignalStrength; - - // specifies the mode of operation of the tuner - typedef enum tagAMTunerModeType - { - AMTUNER_MODE_DEFAULT = 0x0000, // default tuner mode - AMTUNER_MODE_TV = 0x0001, // tv - AMTUNER_MODE_FM_RADIO = 0x0002, // fm radio - AMTUNER_MODE_AM_RADIO = 0x0004, // am radio - AMTUNER_MODE_DSS = 0x0008, // dss - } AMTunerModeType; - - // Events reported by IAMTunerNotification - typedef enum tagAMTunerEventType{ - AMTUNER_EVENT_CHANGED = 0x0001, // status changed - } AMTunerEventType; - - interface IAMTunerNotification; - - [ - object, - uuid(211A8761-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTuner : IUnknown - { - // Sets and gets the Channel - HRESULT put_Channel( - [in] long lChannel, - [in] long lVideoSubChannel, - [in] long lAudioSubChannel - ); - HRESULT get_Channel( - [out] long *plChannel, - [out] long *plVideoSubChannel, - [out] long *plAudioSubChannel - ); - - // Gets the minimum and maximum channel available - HRESULT ChannelMinMax( - [out] long *lChannelMin, - [out] long *lChannelMax - ); - - // CountryCode is the same as the international - // long distance telephone dialing prefix - - HRESULT put_CountryCode( - [in] long lCountryCode - ); - HRESULT get_CountryCode( - [out] long *plCountryCode - ); - - HRESULT put_TuningSpace( - [in] long lTuningSpace - ); - HRESULT get_TuningSpace( - [out] long *plTuningSpace - ); - - [local] HRESULT Logon( - [in] HANDLE hCurrentUser - ); - HRESULT Logout(); - - // Signal status for current channel - // signal strength == TUNER_NOSIGNAL, or strength value - HRESULT SignalPresent( - [out] long * plSignalStrength // AMTunerSignalStrength - ); - - // allow multifunction tuner to be switch between modes - HRESULT put_Mode( - [in] AMTunerModeType lMode // AMTunerModeType - ); - HRESULT get_Mode( - [out] AMTunerModeType *plMode // AMTunerModeType - ); - - // retrieve a bitmask of the possible modes - HRESULT GetAvailableModes( - [out] long *plModes // AMTunerModeType - ); - - // allow IAMTuner clients to receive event notification - HRESULT RegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify, - [in] long lEvents // bitmask from AMTunerEventType enumeration - ); - HRESULT UnRegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify - ); - } - - //--------------------------------------------------------------------- - // IAMTunerNotification interface - // - // Provided to IAMTuner if notification callbacks are desired - //--------------------------------------------------------------------- - - [ - object, - uuid(211A8760-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTunerNotification : IUnknown - { - HRESULT OnEvent([in] AMTunerEventType Event); - } - - - //--------------------------------------------------------------------- - // IAMTVTuner interface - // - // Controls an analog TV tuner device - //--------------------------------------------------------------------- - - [ - object, - uuid(211A8766-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IAMTVTuner : IAMTuner - { - // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ... - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - // Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // Scans for a signal on a given channel - // NOTE: this is equivalent to put_Channel(), SignalStrength() - HRESULT AutoTune( - [in] long lChannel, - [out] long * plFoundSignal - ); - - // Saves the fine tuning information for all channels")] - HRESULT StoreAutoTune(); - - // The number of TV sources plugged into the tuner - HRESULT get_NumInputConnections( - [out] long * plNumInputConnections - ); - - // Sets or gets the tuner input type (Cable or Antenna) - HRESULT put_InputType( - [in] long lIndex, - [in] TunerInputType InputType - ); - HRESULT get_InputType( - [in] long lIndex, - [out] TunerInputType * pInputType - ); - - // Sets or gets the tuner input - HRESULT put_ConnectInput( - [in] long lIndex - ); - HRESULT get_ConnectInput( - [out] long *plIndex - ); - - // Gets the video and audio carrier frequencies - HRESULT get_VideoFrequency( - [out] long *lFreq - ); - HRESULT get_AudioFrequency( - [out] long *lFreq - ); - } - - - //--------------------------------------------------------------------- - // IBPCSatelliteTuner interface - // - // An interface supporting Satellite tuning-related functions - //--------------------------------------------------------------------- - [ - object, - local, - uuid(211A8765-03AC-11d1-8D13-00AA00BD8339), - pointer_default(unique) - ] - interface IBPCSatelliteTuner : IAMTuner - { - HRESULT get_DefaultSubChannelTypes( - [out] long *plDefaultVideoType, // Provider-specific service type - [out] long *plDefaultAudioType // Provider-specific service type - ); - - HRESULT put_DefaultSubChannelTypes( - [in] long lDefaultVideoType, // Provider-specific service type - [in] long lDefaultAudioType // Provider-specific service type - ); - - HRESULT IsTapingPermitted(); // S_OK yes, S_FALSE no - } - - - - //--------------------------------------------------------------------- - // IAMTVAudio interface - // - // TV Audio control - //--------------------------------------------------------------------- - - typedef enum tagTVAudioMode - { - AMTVAUDIO_MODE_MONO = 0x0001, // Mono - AMTVAUDIO_MODE_STEREO = 0x0002, // Stereo - AMTVAUDIO_MODE_LANG_A = 0x0010, // Primary language - AMTVAUDIO_MODE_LANG_B = 0x0020, // 2nd avail language - AMTVAUDIO_MODE_LANG_C = 0x0040, // 3rd avail language - } TVAudioMode; - - // Events reported by IAMTVAudioNotification - typedef enum tagAMTVAudioEventType - { - AMTVAUDIO_EVENT_CHANGED = 0x0001, // mode changed - } AMTVAudioEventType; - - interface IAMTVAudioNotification; - - [ - object, - local, - uuid(83EC1C30-23D1-11d1-99E6-00A0C9560266), - pointer_default(unique) - ] - interface IAMTVAudio : IUnknown - { - // retrieve a bitmask of the formats available in the hardware - HRESULT GetHardwareSupportedTVAudioModes( - [out] long *plModes // TVAudioMode - ); - - // retrieve a bitmask of the possible modes - HRESULT GetAvailableTVAudioModes( - [out] long *plModes // TVAudioMode - ); - - HRESULT get_TVAudioMode( - [out] long *plMode // TVAudioMode - ); - HRESULT put_TVAudioMode( - [in] long lMode // TVAudioMode - ); - - // allow IAMTVAudio clients to receive event notification - HRESULT RegisterNotificationCallBack( - [in] IAMTunerNotification *pNotify, - [in] long lEvents // bitmask from AMTVAudioEventType enumeration - ); - HRESULT UnRegisterNotificationCallBack( - IAMTunerNotification *pNotify - ); - } - - //--------------------------------------------------------------------- - // IAMTVAudioNotification interface - // - // Provided to IAMTVAudio clients if notification callbacks are desired - //--------------------------------------------------------------------- - - [ - object, - local, - uuid(83EC1C33-23D1-11d1-99E6-00A0C9560266), - pointer_default(unique) - ] - interface IAMTVAudioNotification : IUnknown - { - HRESULT OnEvent([in] AMTVAudioEventType Event); - } - - - - - //--------------------------------------------------------------------- - // IAMAnalogVideoEncoder interface - //--------------------------------------------------------------------- - - [ - object, - uuid(C6E133B0-30AC-11d0-A18C-00A0C9118956), - pointer_default(unique) - ] - interface IAMAnalogVideoEncoder : IUnknown - { - // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT get_AvailableTVFormats( - [out] long *lAnalogVideoStandard - ); - - // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...) - HRESULT put_TVFormat( - [in] long lAnalogVideoStandard - ); - - HRESULT get_TVFormat( - [out] long * plAnalogVideoStandard - ); - - // Sets or gets the copy protection - HRESULT put_CopyProtection ( - [in] long lVideoCopyProtection); // VideoCopyProtectionType - - HRESULT get_CopyProtection ( - [out] long *lVideoCopyProtection); // VideoCopyProtectionType - - - // Enables and disables close captioning - HRESULT put_CCEnable ( - [in] long lCCEnable); - - HRESULT get_CCEnable ( - [out] long *lCCEnable); - - } - - // used by IKsPropertySet set AMPROPSETID_Pin - typedef enum { - AMPROPERTY_PIN_CATEGORY, - AMPROPERTY_PIN_MEDIUM - } AMPROPERTY_PIN; - - //--------------------------------------------------------------------- - // IKsPropertySet interface - // - // Sets or gets a property identified by a property set GUID and a - // property ID. - // - // Return codes for all 3 methods: - // E_PROP_SET_UNSUPPORTED the property set is not supported - // E_PROP_ID_UNSUPPORTED the property ID is not supported - // for the specified property set - //--------------------------------------------------------------------- - - cpp_quote("#ifndef _IKsPropertySet_") - cpp_quote("#define _IKsPropertySet_") - - //--------------------------------------------------------------------- - // #defines for IKsPropertySet::QuerySupported return result in pTypeSupport - //--------------------------------------------------------------------- - - cpp_quote("#define KSPROPERTY_SUPPORT_GET 1") - cpp_quote("#define KSPROPERTY_SUPPORT_SET 2") - - - [ - object, - uuid(31EFAC30-515C-11d0-A9AA-00AA0061BE93), - pointer_default(unique) - ] - interface IKsPropertySet : IUnknown - { - [local] HRESULT Set( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] LPVOID pInstanceData, - [in] DWORD cbInstanceData, - [in, size_is(cbPropData)] LPVOID pPropData, - [in] DWORD cbPropData); - - [call_as(Set)] HRESULT RemoteSet( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] byte * pInstanceData, - [in] DWORD cbInstanceData, - [in, size_is(cbPropData)] byte * pPropData, - [in] DWORD cbPropData); - - // To get a property, the caller allocates a buffer which the called - // function fills in. To determine necessary buffer size, call Get with - // pPropData=NULL and cbPropData=0. - [local] HRESULT Get( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] LPVOID pInstanceData, - [in] DWORD cbInstanceData, - [out, size_is(cbPropData)] LPVOID pPropData, - [in] DWORD cbPropData, - [out] DWORD * pcbReturned); - - [call_as(Get)] HRESULT RemoteGet( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [in, size_is(cbInstanceData)] byte * pInstanceData, - [in] DWORD cbInstanceData, - [out, size_is(cbPropData)] byte * pPropData, - [in] DWORD cbPropData, - [out] DWORD * pcbReturned); - - // QuerySupported must either return E_NOTIMPL or correctly indicate - // if getting or setting the property set and property is supported. - // S_OK indicates the property set and property ID combination is - HRESULT QuerySupported( - [in] REFGUID guidPropSet, - [in] DWORD dwPropID, - [out] DWORD *pTypeSupport); - } - cpp_quote("#endif // _IKsPropertySet_") - - [ - object, - uuid(6025A880-C0D5-11d0-BD4E-00A0C911CE86), - pointer_default(unique) - ] - interface IMediaPropertyBag : IPropertyBag - { - import "ocidl.idl"; - - typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG; - - // return the i'th element in the property bag - HRESULT EnumProperty( - [in] ULONG iProperty, - [in, out] VARIANT * pvarPropertyName, - [in, out] VARIANT * pvarPropertyValue - ); - - } - - - [ - object, - uuid(5738E040-B67F-11d0-BD4D-00A0C911CE86), - pointer_default(unique) - ] - interface IPersistMediaPropertyBag : IPersist - { - import "ocidl.idl"; - import "unknwn.idl"; - - HRESULT InitNew( - void - ); - - HRESULT Load( - [in] IMediaPropertyBag * pPropBag, - [in] IErrorLog * pErrorLog - ); - - HRESULT Save( - [in] IMediaPropertyBag * pPropBag, - [in] BOOL fClearDirty, - [in] BOOL fSaveAllProperties - ); - - - typedef IPersistMediaPropertyBag * LPPERSISTMEDIAPROPERTYBAG; - } - - - //--------------------------------------------------------------------- - // - // Defines IAMPhysicalPinInfo Interface - // - // Returns an enum and string that describes an input pin's physical type. - // - // Implement if: you have physical input pins such as video or audio (like - // on a video capture card or a VCR) - // - // Use if: you want to communicate to a user available physical input pins - // and allow them to select the active one if there is more than one - //--------------------------------------------------------------------- - - - [ - object, - uuid(F938C991-3029-11cf-8C44-00AA006B6814), - pointer_default(unique) - ] - interface IAMPhysicalPinInfo : IUnknown { - - // Returns VFW_E_NO_ACCEPTABLE_TYPES if not a physical pin - HRESULT GetPhysicalType( - [out] long *pType, // the enum representing the Physical Type - [out] LPOLESTR *ppszType // a friendly name - ); - } - typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO; - - //--------------------------------------------------------------------- - // Defines IAMExtDevice Interface - // - // Base interface for external professional devices - // - // Implement if: the filter controls an external device such as a VCR, - // timecode reader/generator, etc. The intent is to build a object from - // this implementation plus another that specifically describes the device, - // such as IAMExtTransport. - // - // Use if: you want to control and external device such as a VCR - // - // See edevdefs.h for the enumerated parameter list - //--------------------------------------------------------------------- - [ - object, - uuid(B5730A90-1A2C-11cf-8C23-00AA006B6814), - pointer_default(unique) - ] - interface IAMExtDevice : IUnknown - { - // General device capabilities property. See edevdefs.h for supported - // values - HRESULT GetCapability( - [in] long Capability, // identify the property - [out] long *pValue, // return value - [out] double *pdblValue // return value - ); - - // Get external device identification string. Usually the model # - // of the device - HRESULT get_ExternalDeviceID( - [out] LPOLESTR *ppszData // ID string - ); - - HRESULT get_ExternalDeviceVersion( - [out] LPOLESTR *ppszData // revision string - ); - - // Controls the external device's power mode - HRESULT put_DevicePower([in] long PowerMode - ); - HRESULT get_DevicePower([out] long *pPowerMode - ); - - // Some devices need to be reset in some way, i.e., rewinding a VCR - // to the beginning of the tape and resetting the counter to zero. - HRESULT Calibrate( - [in] HEVENT hEvent, - [in] long Mode, - [out] long *pStatus // OATRUE is active, OAFALSE is inactive - ); - - // Selects the device's communications port, i.e.,COM1, IEEE1394, etc. - // See edevdefs.h for enums - HRESULT put_DevicePort([in] long DevicePort - ); - HRESULT get_DevicePort([out] long *pDevicePort - ); - - } - typedef IAMExtDevice *PEXTDEVICE; - - //--------------------------------------------------------------------- - // Defines IAMExtTransport Interface - // - // Contains properties and methods that control behavior of an external - // transport device such as a VTR - // - // Implement if: you control such a device. Intended to be agregated - // with IAMExtDevice. - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- - [ - object, - uuid(A03CD5F0-3045-11cf-8C44-00AA006B6814), - pointer_default(unique) - ] - interface IAMExtTransport : IUnknown { - - // General transport capabilities property. See edevdefs.h for enums - HRESULT GetCapability( - [in] long Capability, // identify the property - [out] long *pValue, // return value - [out] double *pdblValue // return value - ); - - // For disc-based devices: spinning, or not spinning. - // For tape-based device: threaded, unthreaded or ejected - HRESULT put_MediaState([in] long State - ); - HRESULT get_MediaState([out] long *pState // see edevdefs.h - ); - - // Determines state of unit's front panel - HRESULT put_LocalControl([in] long State - ); - HRESULT get_LocalControl([out] long *pState // OATRUE or OAFALSE - ); - - // Transport status such as Play, Stop, etc. More extensive - // than AM states. - HRESULT GetStatus( - [in] long StatusItem, // see edevdefs.h - [out] long *pValue - ); - - // Parameters such as recording speed, servo reference, ballistics, etc. - HRESULT GetTransportBasicParameters( - [in] long Param, - [out] long *pValue, - [out] LPOLESTR *ppszData - ); - - HRESULT SetTransportBasicParameters( - [in] long Param, - [in] long Value, - [in] LPCOLESTR pszData - ); - - // Parameters such as video output mode - HRESULT GetTransportVideoParameters( - [in] long Param, - [out] long *pValue - ); - - HRESULT SetTransportVideoParameters( - [in] long Param, - [in] long Value - ); - - // Parameters such as audio channel enable - HRESULT GetTransportAudioParameters( - [in] long Param, - [out] long *pValue - ); - - HRESULT SetTransportAudioParameters( - [in] long Param, - [in] long Value - ); - - // Mode is the movement of the transport, i.e., Play, Stop, - // Record, Edit, etc. - HRESULT put_Mode([in] long Mode - ); - HRESULT get_Mode([out] long *pMode - ); - - // Rate is for variable speed control of the the device. This - // can be linked to IMediaControl::Rate() in the implementation - // if desired. - HRESULT put_Rate([in] double dblRate - ); - HRESULT get_Rate([out] double *pdblRate - ); - - // This is a lengthy method, that is, it is in effect until canceled or complete and - // requires housekeeping by the filter. It puts transport in play mode and maintains - // fixed relationship between master time reference and transport position. - HRESULT GetChase( - [out] long *pEnabled, // OATRUE | OAFALSE - [out] long *pOffset, // offset in current time format - [out] HEVENT *phEvent // completion notification - ); - HRESULT SetChase( - [in] long Enable, // OATRUE | OAFALSE - [in] long Offset, // offset in current time format - [in] HEVENT hEvent // completion notification - ); - - // Also a lengthy method: temporarily change transport speed (for synchronizing). - HRESULT GetBump( - [out] long *pSpeed, - [out] long *pDuration // in current time format - ); - HRESULT SetBump( - [in] long Speed, - [in] long Duration // in current time format - ); - - // Enable/Disable transport anti-headclog control. - HRESULT get_AntiClogControl([out] long *pEnabled // OATRUE | OAFALSE - ); - HRESULT put_AntiClogControl([in] long Enable // OATRUE | OAFALSE - ); - - // The following group of properties describes edit events. An edit event can be a - // standard insert or assemble edit or a memorized position called a bookmark. - // A NOTE ABOUT EVENTS: as with all lengthy commands, event objects must be created to - // signal completion or error. - - // Intended usage: an edit event is prepared for use by: - // 1. Registering an edit property set and getting an EditID - // 2. Setting the necessary edit properties - // 3. Setting the edit property set active - - // Please see edevdefs.h for properties and values - - // The reference clock's advance is the mechanism that puts an edit in motion (see - // ED_EDIT_REC_INPOINT). - - // Property set methods - HRESULT GetEditPropertySet( - [in] long EditID, - [out] long *pState // ED_SET_ACTIVE | ED_SET_INACTIVE | ED_SET_INVALID - // | ED_SET_EXECUTING - ); - - HRESULT SetEditPropertySet( - [in, out] long *pEditID, - [in] long State // ED_SET_REGISTER | ED_SET_DELETE | ED_SET_ACTIVE | - ); // ED_SET_INACTIVE - - // the following properties define an edit event such as a bookmark, seek point, or - // actual edit - HRESULT GetEditProperty( - [in] long EditID, - [in] long Param, - [out] long *pValue - ); - HRESULT SetEditProperty( - [in] long EditID, - [in] long Param, - [in] long Value - ); - - // Activates a capable transport's edit control (typically used for "on the fly" editing). - HRESULT get_EditStart([out] long *pValue // OATRUE or OAFALSE - ); - HRESULT put_EditStart([in] long Value // OATRUE or OAFALSE - ); - } - typedef IAMExtTransport *PIAMEXTTRANSPORT; - - //--------------------------------------------------------------------- - // Defines IAMTimecodeReader Interface - // - // Contains properties and methods that define behavior of a - // SMPTE/MIDI Timecode Reader. It is expected that this interface - // will be combined (aggregated) with IAMExtTransport to "build" a pro - // VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //===================================================================== - - - // timecode structures - cpp_quote("#if 0") - cpp_quote("/* the following is what MIDL knows how to remote */") - typedef struct tagTIMECODE { - WORD wFrameRate; // will be replaced by AM defs, but see ED_FORMAT_SMPTE for now - WORD wFrameFract; // fractional frame. full scale is always 0x1000 - DWORD dwFrames; - }TIMECODE; - cpp_quote("#else /* 0 */") - cpp_quote("#ifndef TIMECODE_DEFINED") - cpp_quote("#define TIMECODE_DEFINED") - cpp_quote("typedef union _timecode {") - cpp_quote(" struct {") - cpp_quote(" WORD wFrameRate;") - cpp_quote(" WORD wFrameFract;") - cpp_quote(" DWORD dwFrames;") - cpp_quote(" };") - cpp_quote(" DWORDLONG qw;") - cpp_quote(" } TIMECODE;") - cpp_quote("") - cpp_quote("#endif /* TIMECODE_DEFINED */") - cpp_quote("#endif /* 0 */") - - typedef TIMECODE *PTIMECODE; - - typedef struct tagTIMECODE_SAMPLE { - LONGLONG qwTick; // ActiveMovie 100ns timestamp - TIMECODE timecode; // timecode - DWORD dwUser; // timecode user data (aka user bits) - DWORD dwFlags; // timecode flags - see below - } TIMECODE_SAMPLE; - typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE; - - - [ - object, - uuid(9B496CE1-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) - ] - interface IAMTimecodeReader : IUnknown - { - // Timecode Reader Mode - gets/sets the following properties - // ED_TCR_SOURCE - timecode gen (readback), LTC, VITC, or Control Track - HRESULT GetTCRMode( - [in] long Param, - [out] long *pValue); - HRESULT SetTCRMode( - [in] long Param, - [in] long Value); - - // Select which line of the vertical interval timecode will be read from (if VITC). - // To read VITC on specific multiple lines, the caller would make successive calls to - // put_VITCLine(), once for each line desired. - HRESULT put_VITCLine( - [in] long Line ); // valid lines are 11-20, 0 means autoselect, - // hi bit set means add to list of lines (for - // readers that test across multiple lines) - HRESULT get_VITCLine( - [out] long *pLine ); // hi bit set means multiple lines are used, - // and successive calls will cycle through the - // line numbers (like an enumerator, only simpler) - - // GetTimecode can be used to obtain the most recent timecode value available in the - // stream. The client can use this to monitor the timecode, parse duplicates and - // discontinuities. The source filter supplying the timecode or possibly a down stream - // filter might want to parse for discontinuities or errors since you have to look at - // every sample to do this properly. - // - - HRESULT GetTimecode( - [out] PTIMECODE_SAMPLE pTimecodeSample) ; - - } - typedef IAMTimecodeReader *PIAMTIMECODEREADER; - - //--------------------------------------------------------------------- - //===================================================================== - // Defines IAMTimecodeGenerator Interface - // - // Contains properties and methods that define behavior of an external - // SMPTE/MIDI Timecode Generator. It is expected that this interface - // will be combined (aggregated) with IAMExtTransport to "build" a pro - // VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- - [ - object, - uuid(9B496CE0-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) - ] - interface IAMTimecodeGenerator : IUnknown { - - // Timecode Generator Mode - gets/sets the following properties (see - // vcrdefss.h for detailed values): - // ED_TCG_TIMECODE_TYPE - LTC, VITC, or MIDI - // ED_TCG_FRAMERATE - 24, 25, 30 drop or 30 nondrop - // ED_TCG_SYNC_SOURCE - what is driving the bitclock - // ED_TCG_REFERENCE_SOURCE - what is driving the count value - HRESULT GetTCGMode( - [in] long Param, - [out] long *pValue); - - HRESULT SetTCGMode( - [in] long Param, - [in] long Value); - - // Select into which line(s) of the vertical interval timecode will be inserted (if VITC). - // Hi bit set means add this line to any previously set lines. - // To generate VITC on specific multiple lines, the caller would make successive calls to - // put_VITCLine(), once for each line desired. - HRESULT put_VITCLine( - [in] long Line // valid lines are 11-20, 0 means autoselect(this setting - ); // is for TC readers that decode from multiple lines) - HRESULT get_VITCLine( - [out] long *pLine - ); - - // Sets timecode and/or userbit value. If generator is running, takes effect - // immediately. If caller wants to set only timecode, set userbit value to -1L (and - // same for setting userbits only) - // - - HRESULT SetTimecode( - [in] PTIMECODE_SAMPLE pTimecodeSample) ; - - - // GetTimecode can be used to obtain the most recent timecode value available in the - // stream. The client can use this to monitor the timecode and verify the generator is - // working properly - // - - HRESULT GetTimecode( - [out] PTIMECODE_SAMPLE pTimecodeSample) ; - - } - typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR; - - //--------------------------------------------------------------------- - // Defines IAMTimecodeDisplay Interface - // - // Contains properties and methods that define behavior of an external - // SMPTE/MIDI Timecode Display device (aka "character generator" for - // making "burn-ins" or "window dubs"). It is expected that this interface - // will be combined (aggregated) with IAMExtTransport and the timecode - // interfaces to "build" a pro VCR. - // - // Implement if: you control such a device - // - // Use if: you want to control such a device - // - // See edevdefs.h for the parameter lists - //--------------------------------------------------------------------- - [ - object, - uuid(9B496CE2-811B-11cf-8C77-00AA006B6814), - pointer_default(unique) - ] - interface IAMTimecodeDisplay : IUnknown - { - // Enable/disable external device's timecode reader's character generator output. Some - // readers have this feature - this is not intended for rendering inside the PC! - HRESULT GetTCDisplayEnable( - [out] long *pState); // OATRUE | OAFALSE - HRESULT SetTCDisplayEnable( - [in] long State); // OATRUE | OAFALSE - // Timecode reader's character generator output - // characteristics (size, position, intensity, etc.). - HRESULT GetTCDisplay( - [in] long Param, - [out] long *pValue); - HRESULT SetTCDisplay( - [in] long Param, - [in] long Value); - - /* Allowable params and values (see edevdefs.h for details): - ED_TCD_SOURCE - ED_TCR | ED_TCG - ED_TCD_SIZE - ED_SMALL | ED_MED | ED_LARGE - ED_TCD_POSITION - ED_TOP | ED_MIDDLE | ED_BOTTOM or'd with - ED_LEFT | ED_CENTER | ED_RIGHT - ED_TCD_INTENSITY - ED_HIGH | ED_LOW - ED_TCD_TRANSPARENCY // set from 0 to 4, 0 being completely opaque - ED_TCD_INVERT // white on black or black on white - OATRUE | OAFALSE - ED_TCD_BORDER // white border for black chars, black border for white letters - OATRUE | OAFALSE - */ - } - typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY; - - - [ - object, - uuid(c6545bf0-e76b-11d0-bd52-00a0c911ce86), - pointer_default(unique) - ] - interface IAMDevMemoryAllocator : IUnknown - { - HRESULT GetInfo( - [out] DWORD *pdwcbTotalFree, - [out] DWORD *pdwcbLargestFree, - [out] DWORD *pdwcbTotalMemory, - [out] DWORD *pdwcbMinimumChunk); - - HRESULT CheckMemory( - [in] const BYTE *pBuffer); - - HRESULT Alloc( - [out] BYTE **ppBuffer, - [in, out] DWORD *pdwcbBuffer); - - HRESULT Free( - [in] BYTE *pBuffer); - - HRESULT GetDevMemoryObject( - [out] IUnknown **ppUnkInnner, - [in] IUnknown *pUnkOuter); - } - typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR; - - - [ - object, - uuid(c6545bf1-e76b-11d0-bd52-00a0c911ce86), - pointer_default(unique) - ] - interface IAMDevMemoryControl : IUnknown - { - HRESULT QueryWriteSync(); - - HRESULT WriteSync(); - - HRESULT GetDevId( - [out] DWORD *pdwDevId); - - } - typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL; - - // Flags for IAMStreamSelection::Info - enum _AMSTREAMSELECTINFOFLAGS { - AMSTREAMSELECTINFO_ENABLED = 0x01, // Enable - off for disable - AMSTREAMSELECTINFO_EXCLUSIVE = 0x02 // Turns off the others in the group - // when enabling this one - }; - // Flags for IAMStreamSelection::Enable - enum _AMSTREAMSELECTENABLEFLAGS { - // Currently valid values are : - // 0 - disable all streams in the group containing this stream - // ..._ENABLE - enable only this stream with in the given group - // and disable all others - // ..._ENABLEALL - send out all streams - AMSTREAMSELECTENABLE_ENABLE = 0x01, // Enable - AMSTREAMSELECTENABLE_ENABLEALL = 0x02 // Enable all streams in the group - // containing this stream - }; - - // Control which logical streams are played and find out information about - // them - // Normally supported by a filter - [ - object, - uuid(c1960960-17f5-11d1-abe1-00a0c905f375), - pointer_default(unique) - ] - interface IAMStreamSelect : IUnknown - { - // Returns total count of streams - HRESULT Count( - [out] DWORD *pcStreams); // Count of logical streams - - // Return info for a given stream - S_FALSE if iIndex out of range - // The first steam in each group is the default - HRESULT Info( - [in] long lIndex, // 0-based index - [out] AM_MEDIA_TYPE **ppmt, // Media type - optional - // Use DeleteMediaType to free - [out] DWORD *pdwFlags, // flags - optional - [out] LCID *plcid, // LCID (returns 0 if none) - optional - [out] DWORD *pdwGroup, // Logical group - optional - [out] WCHAR **ppszName, // Name - optional - free with CoTaskMemFree - // optional - [out] IUnknown **ppObject, // Associated object - optional - // Object may change if Enable is - // called on this interface - // - returns NULL if no associated object - // Returns pin or filter for DShow - [out] IUnknown **ppUnk); // Stream specific interface - - // Enable or disable a given stream - HRESULT Enable( - [in] long lIndex, - [in] DWORD dwFlags); - } - typedef IAMStreamSelect *PAMSTREAMSELECT; - - enum _AMRESCTL_RESERVEFLAGS - { - AMRESCTL_RESERVEFLAGS_RESERVE = 0x00, // Increment reserve count - AMRESCTL_RESERVEFLAGS_UNRESERVE = 0x01 // Decrement reserve count - }; - - // Reserve resources now so that playback can be subsequently - // guaranteed - // - // Normally supported by a filter - // - [ - object, - uuid(8389d2d0-77d7-11d1-abe6-00a0c905f375), - pointer_default(unique), - local - ] - interface IAMResourceControl : IUnknown - { - // The reserve count is incremented/decremented if and only if - // S_OK is returned - // Unreserve once for every Reserve call - HRESULT Reserve( - [in] DWORD dwFlags, // From _AMRESCTL_RESERVEFLAGS enum - [in] PVOID pvReserved // Must be NULL - ); - } - - - // Set clock adjustments - supported by some clocks - [ - object, - uuid(4d5466b0-a49c-11d1-abe8-00a0c905f375), - pointer_default(unique), - local - ] - interface IAMClockAdjust : IUnknown - { - // Set the following delta to clock times - // The clock will add adjust its times by the given delta - HRESULT SetClockDelta( - [in] REFERENCE_TIME rtDelta - ); - }; - - // Filter miscellaneous status flags - - enum _AM_FILTER_MISC_FLAGS { - AM_FILTER_MISC_FLAGS_IS_RENDERER = 0x00000001, /* Will deliver EC_COMPLETE - at end of media */ - AM_FILTER_MISC_FLAGS_IS_SOURCE = 0x00000002 /* Filter sources data */ - }; - - [ - object, - uuid(2dd74950-a890-11d1-abe8-00a0c905f375), - pointer_default(unique), - local - ] - interface IAMFilterMiscFlags : IUnknown - { - // Get miscellaneous property flags - ULONG GetMiscFlags(void); - }; - - - // Video Image drawing interface - [ - object, - local, - uuid(48efb120-ab49-11d2-aed2-00a0c995e8d5), - pointer_default(unique), - ] - interface IDrawVideoImage : IUnknown - { - HRESULT DrawVideoImageBegin(); - - HRESULT DrawVideoImageEnd(); - - HRESULT DrawVideoImageDraw( - [in] HDC hdc, - [in] LPRECT lprcSrc, - [in] LPRECT lprcDst - ); - } - - // - // Video Image decimation interface - // - // The aim of this interface is to enable a video renderer filter to - // control the decimation properties of a video decoder connected to - // the video renderer - // - // This interface should only be supported by decoders that are capable of - // decimating their output image by an arbitary amount. - // - // - [ - object, - local, - uuid(2e5ea3e0-e924-11d2-b6da-00a0c995e8df), - pointer_default(unique), - ] - interface IDecimateVideoImage : IUnknown - { - // - // Informs the decoder that it should decimate its output - // image to the specified width and height. If the decoder can - // decimate to this size it should return S_OK. - // If the decoder can't perform the requested decimation - // or wants to stop performing the decimation that it is - // currently doing it should return E_FAIL. - // - HRESULT SetDecimationImageSize( - [in] long lWidth, - [in] long lHeight); - - // - // Informs the decoder that it should stop decimating its output image - // and resume normal output. - // - HRESULT ResetDecimationImageSize(); - } - - typedef enum _DECIMATION_USAGE { - DECIMATION_LEGACY, // decimate at ovly then video port then crop - DECIMATION_USE_DECODER_ONLY, // decimate image at the decoder only - DECIMATION_USE_VIDEOPORT_ONLY, // decimate at the video port only - DECIMATION_USE_OVERLAY_ONLY, // decimate at the overlay only - DECIMATION_DEFAULT // decimate at decoder then ovly the vide port then crop - } DECIMATION_USAGE; - - [ - object, - local, - uuid(60d32930-13da-11d3-9ec6-c4fcaef5c7be), - pointer_default(unique), - ] - interface IAMVideoDecimationProperties: IUnknown - { - // - // Queries the current usage of the above IDecimateVideoImage - // interface. - // - HRESULT QueryDecimationUsage( - [out] DECIMATION_USAGE* lpUsage); // from DECIMATION_USAGE enum - - // - // Sets the current usage of the above IDecimateVideoImage - // interface. - // - HRESULT SetDecimationUsage( - [in] DECIMATION_USAGE Usage); // from DECIMATION_USAGE enum - } - - //--------------------------------------------------------------------- - // - // IVideoFrameStep interface - // - //--------------------------------------------------------------------- - - [ - object, - uuid(e46a9787-2b71-444d-a4b5-1fab7b708d6a), - pointer_default(unique), - ] - interface IVideoFrameStep : IUnknown - { - // - // Stop(), Pause(), Run() all cancel Step as does any seeking - // request. - // - // The Step() and CancelStep() methods of this interface - // Cancel any previous step. - // - // When stepping is complete EC_STEP_COMPLETE is signalled. - // - // When the filter graph gets EC_STEP_COMPLETE it automatically - // sets the filter graph into paused state and forwards the - // notification to the application - // - // Returns S_OK if stepping initiated. - // - // dwFrames - // 1 means step 1 frame forward - // 0 is invalid - // n (n > 1) means skip n - 1 frames and show the nth - // - // pStepObject - // NULL - default step object (filter) picked - // non-NULL - use this object for stepping - // - HRESULT Step(DWORD dwFrames, [unique] IUnknown *pStepObject); - - // Can step? - // Returns S_OK if it can, S_FALSE if it can't or error code. - // bMultiple - if TRUE return whether can step n > 1 - HRESULT CanStep(long bMultiple, [unique] IUnknown *pStepObject); - - // Cancel stepping - HRESULT CancelStep(); - } - - - - - //--------------------------------------------------------------------- - // - // IAMPushSource interface - // - // Provides a means for source filters to describe information about the - // data that they source, such as whether the data is live or not, and - // what type of clock was used for timestamps. This information may be - // needed by other clocks in the graph in order to provide accurate - // synchronization. Also provides a way to specify an offset value for - // the filter to use when timestamping the streams it sources. Provides - // support for the IAMLatency interface as well. - // - //--------------------------------------------------------------------- - - enum _AM_PUSHSOURCE_FLAGS { - - // - // The default assumption is that the data is from a live source, - // time stamped with the graph clock, and the source does not - // attempt to rate match the data it delivers. - // The following flags can be used to override this assumption. - // - - // capability flags - AM_PUSHSOURCECAPS_INTERNAL_RM = 0x00000001, // source provides internal support for rate matching - AM_PUSHSOURCECAPS_NOT_LIVE = 0x00000002, // don't treat source data as live - AM_PUSHSOURCECAPS_PRIVATE_CLOCK = 0x00000004, // source data timestamped with clock not - // exposed to the graph - - // request flags, set by user via SetPushSourceFlags method - AM_PUSHSOURCEREQS_USE_STREAM_CLOCK = 0x00010000 // source was requested to timestamp - // using a clock that isn't the graph clock - }; - - // - // Used to set a source filter to run in a "live" mode. - // - [ - object, - uuid(F185FE76-E64E-11d2-B76E-00C04FB6BD3D), - pointer_default(unique) - ] - interface IAMPushSource : IAMLatency - { - // used to discover push source's capabilities. - // may be any combination of the AM_PUSHSOURCE_FLAGS flags. - HRESULT GetPushSourceFlags ( - [out] ULONG *pFlags - ); - - // used to set request flags for a push source. - // may be a combination of the AM_PUSHSOURCE_REQS_xxx flags. - HRESULT SetPushSourceFlags ( - [in] ULONG Flags - ); - - // specify an offset for push source time stamps - HRESULT SetStreamOffset ( - [in] REFERENCE_TIME rtOffset - ); - - // retrieve the offset this push source is using - HRESULT GetStreamOffset ( - [out] REFERENCE_TIME *prtOffset - ); - - // retrieve the maximum stream offset this push source thinks it can support - HRESULT GetMaxStreamOffset ( - [out] REFERENCE_TIME *prtMaxOffset - ); - - // allows the filter graph to tell a push source the maximum latency allowed on the graph - // this allows pins like the video capture preview pin to be more efficient with the amount - // of buffering required to support the maximum graph latency - HRESULT SetMaxStreamOffset ( - [in] REFERENCE_TIME rtMaxOffset - ); - }; - - - // ------------------------------------------------------------------------ - // - // IAMDeviceRemoval interface - // - // Implemented by filters to request and receive WM_DEVICECHANGE - // notifications - // - // ------------------------------------------------------------------------ - - [ - object, - uuid(f90a6130-b658-11d2-ae49-0000f8754b99), - pointer_default(unique) - ] - interface IAMDeviceRemoval : IUnknown - { - - HRESULT DeviceInfo( - [out] CLSID *pclsidInterfaceClass, - [out] WCHAR **pwszSymbolicLink); - - HRESULT Reassociate(); - - HRESULT Disassociate(); - } - - // - // for DV - // - typedef struct { - //for 1st 5/6 DIF seq. - DWORD dwDVAAuxSrc; - DWORD dwDVAAuxCtl; - //for 2nd 5/6 DIF seq. - DWORD dwDVAAuxSrc1; - DWORD dwDVAAuxCtl1; - //for video information - DWORD dwDVVAuxSrc; - DWORD dwDVVAuxCtl; - DWORD dwDVReserved[2]; - - } DVINFO, *PDVINFO; - - // ------------------------------------------------------------------------ - // - // IDVEnc interface - // - // Implemented by DV encoder filters to set Encoder format - // - // ------------------------------------------------------------------------ - enum _DVENCODERRESOLUTION { //resolution - DVENCODERRESOLUTION_720x480 = 2012, - DVENCODERRESOLUTION_360x240 = 2013, - DVENCODERRESOLUTION_180x120 = 2014, - DVENCODERRESOLUTION_88x60 = 2015 - }; - enum _DVENCODERVIDEOFORMAT { //PAL/ntsc - DVENCODERVIDEOFORMAT_NTSC = 2000, - DVENCODERVIDEOFORMAT_PAL = 2001 - }; - enum _DVENCODERFORMAT { // dvsd/dvhd/dvsl - DVENCODERFORMAT_DVSD = 2007, - DVENCODERFORMAT_DVHD = 2008, - DVENCODERFORMAT_DVSL = 2009 - }; - [ - object, - uuid(d18e17a0-aacb-11d0-afb0-00aa00b67a42), - pointer_default(unique) - ] - interface IDVEnc : IUnknown - { - - HRESULT get_IFormatResolution ( - [out] int *VideoFormat, //pal or ntsc - [out] int *DVFormat, //dvsd dvhd dvsl - [out] int *Resolution, //720, 360, 180,88 - [in] BYTE fDVInfo, //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO - [out] DVINFO *sDVInfo //NULL if fDVInfo=FALSE, - ); - - HRESULT put_IFormatResolution ( - [in] int VideoFormat, - [in] int DVFormat, - [in] int Resolution, - [in] BYTE fDVInfo, //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO - [in] DVINFO *sDVInfo //NULL if fDVInfo=FALSE, - ); - - } - - // ------------------------------------------------------------------------ - // - // IDVDec interface - // - // Implemented by DV decoder filters to set decoder size - // - // ------------------------------------------------------------------------ - enum _DVDECODERRESOLUTION { - DVDECODERRESOLUTION_720x480 = 1000, - DVDECODERRESOLUTION_360x240 = 1001, - DVDECODERRESOLUTION_180x120 = 1002, - DVDECODERRESOLUTION_88x60 = 1003 - }; - enum _DVRESOLUTION { - DVRESOLUTION_FULL = 1000, - DVRESOLUTION_HALF = 1001, - DVRESOLUTION_QUARTER = 1002, - DVRESOLUTION_DC = 1003 - }; - [ - object, - uuid(b8e8bd60-0bfe-11d0-af91-00aa00b67a42), - pointer_default(unique) - ] - interface IIPDVDec : IUnknown - { - HRESULT get_IPDisplay ( - [out] int *displayPix // The display pixels arrage - ); - - HRESULT put_IPDisplay ( - [in] int displayPix // Change to this display pixel arrage - ) ; - } - - // ------------------------------------------------------------------------ - // - // IDVSplitter interface - // - // Implemented by DV splitter filters - // - // ------------------------------------------------------------------------ - [ - object, - uuid(92a3a302-da7c-4a1f-ba7e-1802bb5d2d02) - ] - interface IDVSplitter : IUnknown - { - HRESULT DiscardAlternateVideoFrames( - [in] int nDiscard - ) ; - } - - // Audio Renderer statistics params for IAMAudioRendererStats interface - enum _AM_AUDIO_RENDERER_STAT_PARAM { - AM_AUDREND_STAT_PARAM_BREAK_COUNT = 1, // audio breaks - AM_AUDREND_STAT_PARAM_SLAVE_MODE, // current slave mode, see AM_AUDREND_SLAVE_MODEs - AM_AUDREND_STAT_PARAM_SILENCE_DUR, // silence inserted due to gaps (ms) - AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR, // duration of the last buffer received - AM_AUDREND_STAT_PARAM_DISCONTINUITIES, // discontinuities seen since running - AM_AUDREND_STAT_PARAM_SLAVE_RATE, // what rate are we currently slaving at? S_FALSE if not slaving - AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR, // for waveOut slaving - data dropped or added to stay in-sync - // dwParam1 - dropped duration(ms) - // dwParam2 - paused duration(ms) - AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR, // highest & lowest clock differences seen - // dwParam1 - high err - // dwParam2 - low err - AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR, // last high and low errs seen - // dwParam1 - last high err - // dwParam2 - last low err - AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR, // error between master/slave clocks - AM_AUDREND_STAT_PARAM_BUFFERFULLNESS, // percent audio buffer fullness - AM_AUDREND_STAT_PARAM_JITTER // input buffer jitter - }; - - //--------------------------------------------------------------------- - // - // IAMAudioRendererStats interface - // - // Interface to get at statistical information that is optionally stored - // in an audio renderer filter. Supported on the filter interface (although - // this might be better for ksproxy if we define it as a pin interface?) - // - //--------------------------------------------------------------------- - - [ - object, - uuid(22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93), - pointer_default(unique) - ] - interface IAMAudioRendererStats : IUnknown - { - // Get value corresponding to the passed in parameter id - HRESULT GetStatParam( - [in] DWORD dwParam, - [out] DWORD *pdwParam1, - [out] DWORD *pdwParam2 - ); - } - - //--------------------------------------------------------------------- - // - // IAMLatency interface - // - // Allows a filter to report the expected latency associated with a data - // stream flowing from its input to output pin. Supported on output pins. - // - //--------------------------------------------------------------------- - - [ - object, - uuid(62EA93BA-EC62-11d2-B770-00C04FB6BD3D), - pointer_default(unique) - ] - interface IAMLatency : IUnknown - { - HRESULT GetLatency( - [in] REFERENCE_TIME *prtLatency - ); - } - - - enum _AM_INTF_SEARCH_FLAGS { - AM_INTF_SEARCH_INPUT_PIN = 0x00000001, // search input pins - AM_INTF_SEARCH_OUTPUT_PIN = 0x00000002, // search output pins - AM_INTF_SEARCH_FILTER = 0x00000004 // search filters - }; - - //--------------------------------------------------------------------- - // - // IAMGraphStreams interface - // - // Interface used to control or search over connected streams of data - // flow within a filter graph. - // - //--------------------------------------------------------------------- - - [ - object, - uuid(632105FA-072E-11d3-8AF9-00C04FB6BD3D), - pointer_default(unique) - ] - interface IAMGraphStreams : IUnknown - { - // Search upstream from the current pin, for the specified interface. - // dwFlags can be any combination of the AM_INTF_SEARCH_FLAGS, and allows - // control over what objects to search. A value of 0 means to search all. - HRESULT FindUpstreamInterface( - [in] IPin *pPin, - [in] REFIID riid, - [out, iid_is(riid)] void **ppvInterface, - [in] DWORD dwFlags ); - - // Enable or disable the graph's setting of a timestamp offset - // on push sources. - HRESULT SyncUsingStreamOffset( [in] BOOL bUseStreamOffset ); - - // allow an app to set the maximum offset used on push source filters - HRESULT SetMaxGraphLatency( [in] REFERENCE_TIME rtMaxGraphLatency ); - } - - - // - // IAMOverlayFX - // - // This interface is exposed by the overlay mixer filter and allows - // an application to apply various "effects" to the overlay surface - // used by the overlay mixer. - // - // The effects that can be applied are described by the AMOVERLAYFX - // enumeration. - // - enum AMOVERLAYFX { - // Normal (ie. top down, left to right) video - AMOVERFX_NOFX = 0x00000000, - - // Mirror the overlay across the vertical axis - AMOVERFX_MIRRORLEFTRIGHT = 0x00000002, - - // Mirror the overlay across the horizontal axis - AMOVERFX_MIRRORUPDOWN = 0x00000004, - - // Deinterlace the overlay, if possible - AMOVERFX_DEINTERLACE = 0x00000008 - }; - - [ - object, - uuid(62fae250-7e65-4460-bfc9-6398b322073c), - pointer_default(unique) - ] - interface IAMOverlayFX : IUnknown - { - // Use this method to determine what overlay effects are currently available - // for the overlay surface used by the overlay mixer filter. - // - HRESULT QueryOverlayFXCaps( - [out] DWORD *lpdwOverlayFXCaps - ); - - // Use this method to apply a new overlay effect to the overlay surface - // used by the overlay mixer filter. This method can be called while the - // filter graph is running, the effect is applied immediately - // - HRESULT SetOverlayFX( - [in] DWORD dwOverlayFX - ); - - // Use this method to determine what effect (if any) is currently being - // applied to the overlay surface by the overlay mixer filter. - // - HRESULT GetOverlayFX( - [out] DWORD *lpdwOverlayFX - ); - } - - - - // IAMOpenProgress interface provides information about current progress through - // a download - - // NOTE: The following cpp_quote is there to make sure that we do not break the whistler build when this file is - // updated in Whistler as they are using a private copy of op.h which is removed as a result of moving the IAMOpenProgress - // interface into axextend.idl. Html+time has a private copy of op.h in \\index1\src\newnt\inetcore\mshtml\src\time\include\op.h - // which needs to be removed when integrating into Whistler to avoid any future build breaks. - cpp_quote("#define __OP_H__") - - [ - object, - uuid(8E1C39A1-DE53-11cf-AA63-0080C744528D), - pointer_default(unique) - ] - - interface IAMOpenProgress : IUnknown - { - // QueryProgress can be used to query the source filter which supports this interface - // for progress information during a renderfile operation. - HRESULT QueryProgress( - [out] LONGLONG* pllTotal, - [out] LONGLONG* pllCurrent - ); - - // AbortOperation can be used to request an abort of RenderFile operation - // causing it to stop downloading. This methods instructs the exporter of - // the IAMOpenProgress interface to hold up their internal abort flag until - // further notice. - HRESULT AbortOperation( - ); - } - - /*++ - IMpeg2Demultiplexer - - This interface is implemented by the MPEG-2 Demultiplexer filter, - irrespective of program vs. transport stream splitting functionality. - --*/ - [ - object, - local, - uuid (436eee9c-264f-4242-90e1-4e330c107512), - pointer_default(unique) - ] - interface IMpeg2Demultiplexer : IUnknown - { - /*++ - ------------------------------------------------------------------------ - purpose: Creates an output pin of the specified media type. - - pMediaType media type specifier for the new pin - pszPinName pin name; cannot be a duplicate of an existing pin - ppIPin IPin interface pointer to the newly created pin - --*/ - HRESULT - CreateOutputPin ( - [in] AM_MEDIA_TYPE * pMediaType, - [in] LPWSTR pszPinName, - [out] IPin ** ppIPin - ) ; - - /*++ - ------------------------------------------------------------------------ - purpose: Updates the media type of the specified output pin. If no - connection exists, the media type is updated always. If - the pin is connected, the success/failure of the call will - depend on downstream input pin's accetance/rejection of - the specified media type, and subsequent success/failure - of a reconnect. - - pszPinName pin name - pMediaType new media type specifier - --*/ - HRESULT - SetOutputPinMediaType ( - [in] LPWSTR pszPinName, - [in] AM_MEDIA_TYPE * pMediaType - ) ; - - /*++ - ------------------------------------------------------------------------ - purpose: Deletes the specified output pin. - - pszPinName pin name - --*/ - HRESULT - DeleteOutputPin ( - [in] LPWSTR pszPinName - ) ; - } ; - - //--------------------------------------------------------------------- - // IEnumStreamIdMap interface - //--------------------------------------------------------------------- - - cpp_quote("#define MPEG2_PROGRAM_STREAM_MAP 0x00000000") - cpp_quote("#define MPEG2_PROGRAM_ELEMENTARY_STREAM 0x00000001") - cpp_quote("#define MPEG2_PROGRAM_DIRECTORY_PES_PACKET 0x00000002") - cpp_quote("#define MPEG2_PROGRAM_PACK_HEADER 0x00000003") - cpp_quote("#define MPEG2_PROGRAM_PES_STREAM 0x00000004") - cpp_quote("#define MPEG2_PROGRAM_SYSTEM_HEADER 0x00000005") - - cpp_quote("#define SUBSTREAM_FILTER_VAL_NONE 0x10000000") - - typedef struct { - ULONG stream_id ; // mpeg-2 stream_id - DWORD dwMediaSampleContent ; // #define'd above - ULONG ulSubstreamFilterValue ; // filtering value - int iDataOffset ; // offset to elementary stream - } STREAM_ID_MAP ; - - /*++ - Enumerates the StreamIds mapped on a pin - --*/ - [ - object, - local, - uuid (945C1566-6202-46fc-96C7-D87F289C6534), - pointer_default(unique) - ] - interface IEnumStreamIdMap : IUnknown - { - HRESULT - Next ( - [in] ULONG cRequest, - [in, out, size_is (cRequest)] STREAM_ID_MAP * pStreamIdMap, - [out] ULONG * pcReceived - ) ; - - HRESULT - Skip ( - [in] ULONG cRecords - ) ; - - HRESULT - Reset ( - ) ; - - HRESULT - Clone ( - [out] IEnumStreamIdMap ** ppIEnumStreamIdMap - ) ; - } ; - - /*++ - Implemented on the output pin. - - Provides the ability to map/unmap a stream_id to/from an output pin. - --*/ - [ - object, - local, - uuid (D0E04C47-25B8-4369-925A-362A01D95444), - pointer_default(unique) - ] - interface IMPEG2StreamIdMap : IUnknown - { - HRESULT - MapStreamId ( - [in] ULONG ulStreamId, // mpeg-2 stream_id - [in] DWORD MediaSampleContent, // #define'd above IEnumStreamIdMap - [in] ULONG ulSubstreamFilterValue, // filter value - [in] int iDataOffset // elementary stream offset - ) ; - - HRESULT - UnmapStreamId ( - [in] ULONG culStreamId, // number of stream_id's in pulStreamId - [in] ULONG * pulStreamId // array of stream_id's to unmap - ) ; - - HRESULT - EnumStreamIdMap ( - [out] IEnumStreamIdMap ** ppIEnumStreamIdMap - ) ; - } ; - - -#endif // DirectX 8.0 content diff --git a/import/DirectX8/include/DShowIDL/bdaiface.idl b/import/DirectX8/include/DShowIDL/bdaiface.idl deleted file mode 100644 index 75e7830f5..000000000 --- a/import/DirectX8/include/DShowIDL/bdaiface.idl +++ /dev/null @@ -1,1744 +0,0 @@ -//------------------------------------------------------------------------------ -// File: BDAIface.idl -// -// Desc: This file defines the Ring 3 BDA interfaces that are common to -// all BDA network and device types. -// -// The interfaces specific to a particular Network Type or filter -// implementation are defined in a separate include file for that -// Network Type or filter implementation. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -//--------------------------------------------------------------------- -// IUnknown import idl -//--------------------------------------------------------------------- -#ifndef DO_NO_IMPORTS -import "unknwn.idl"; -import "strmif.idl"; -import "BdaTypes.h"; -#endif - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - -//--------------------------------------------------------------------- -// -// IBDA_NetworkProvider interface -// -// Implemented by a BDA Network Provider -// -// Used by a BDA device filter to register itself with -// a Network Provider and query information about the -// the current tuning request. -// -//--------------------------------------------------------------------- -[ - object, - uuid(fd501041-8ebe-11ce-8183-00aa00577da2), - pointer_default(unique) -] - -interface IBDA_NetworkProvider : IUnknown -{ - - HRESULT - PutSignalSource ( - [in] ULONG ulSignalSource - ); - - - HRESULT - GetSignalSource ( - [in, out] ULONG * pulSignalSource - ); - - HRESULT - GetNetworkType ( - [in, out] GUID * pguidNetworkType - ); - - HRESULT - PutTuningSpace ( - [in] REFGUID guidTuningSpace - ); - - HRESULT - GetTuningSpace ( - [in, out] GUID * pguidTuingSpace - ); - - HRESULT - RegisterDeviceFilter ( - [in] IUnknown * pUnkFilterControl, - [in, out] ULONG * ppvRegisitrationContext - ); - - HRESULT - UnRegisterDeviceFilter ( - [in] ULONG pvRegistrationContext - ); - -} - - -//--------------------------------------------------------------------- -// -// IBDA_EthernetFilter interface -// -// Implemented by a BDA Network Provider -// -// Used by an Ethernet Network Data Sink filter (eg. IPSink) to -// request that the Network Provider make its best effort to tune -// to the stream(s) on which a list of Ethernet multicast addresses -// may be transmitted. -// -// Addresses in the address list are byte aligned in Network order. -// UlcbAddresses will always be an integer multiple of the -// size of an ethernet address. -// -//--------------------------------------------------------------------- -[ - object, - uuid(71985F43-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_EthernetFilter : IUnknown -{ - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG * pulModeMask - ); - -} - - - -//--------------------------------------------------------------------- -// -// IBDA_IPV4Filter interface -// -// Implemented by a BDA Network Provider -// -// Used by an IPv4 Network Data Sink filter to request -// that the Network Provider make its best effort to tune -// to the stream(s) on which a list of IPv4 multicast addresses -// may be transmitted. -// -// Addresses in the address list are byte aligned in Network order. -// UlcbAddresses will always be an integer multiple of the -// size of an IPv4 address. -// -//--------------------------------------------------------------------- -[ - object, - uuid(71985F44-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_IPV4Filter : IUnknown -{ - - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG* pulModeMask - ); -} - - - -//--------------------------------------------------------------------- -// -// IBDA_IPV6Filter interface -// -// Implemented by a BDA Network Provider -// -// Used by an IPv6 Network Data Sink filter to request -// that the Network Provider make its best effort to tune -// to the stream(s) on which a list of IPv6 multicast addresses -// may be transmitted. -// -// Addresses in the address list are byte aligned in Network order. -// UlcbAddresses will always be an integer multiple of the -// size of an IPv6 address. -// -//--------------------------------------------------------------------- -[ - object, - uuid(E1785A74-2A23-4fb3-9245-A8F88017EF33), - pointer_default(unique) -] - -interface IBDA_IPV6Filter : IUnknown -{ - - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG* pulModeMask - ); -} - - - -//--------------------------------------------------------------------- -// -// IBDA_DeviceControl interface -// -// Implemented by a BDA Device Filter -// -// Used by the Network Provider to commit a series of changes -// on a BDA device filter. The device filter validates and -// accumulates all changes requested after StartChanges(). It -// effects the accumulated list of changes when CommitChanges() is -// called. -// -//--------------------------------------------------------------------- -[ - object, - uuid(FD0A5AF3-B41D-11d2-9C95-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_DeviceControl : IUnknown -{ - HRESULT - StartChanges ( - void - ); - - HRESULT - CheckChanges ( - void - ); - - HRESULT - CommitChanges ( - void - ); - - HRESULT - GetChangeState ( - [in, out] ULONG * pState - ); - -} - - - -//--------------------------------------------------------------------- -// -// IBDA_PinControl interface -// -// Implemented by a BDA Device Filter's Pin -// -// Used by the Network Provider to determine the BDA PinID and -// PinType on a BDA Filter's Pin -// -//--------------------------------------------------------------------- -[ - object, - uuid(0DED49D5-A8B7-4d5d-97A1-12B0C195874D), - pointer_default(unique) -] - -interface IBDA_PinControl : IUnknown -{ - HRESULT - GetPinID ( - [in, out] ULONG * pulPinID - ); - - HRESULT - GetPinType ( - [in, out] ULONG * pulPinType - ); - - HRESULT - RegistrationContext ( - [in, out] ULONG * pulRegistrationCtx - ); -} - - - -//--------------------------------------------------------------------- -// -// IBDA_SignalProperties interface -// -// Implemented by a BDA Device Filter -// -// BDA Signal Properties is used by a Network Provider to inform -// a BDA Device Filter about the current tuning request. The -// Network Provider will call the Put functions when the BDA -// device is first registered with the Network Provider and whenever -// the current tuning request is modified. -// -//--------------------------------------------------------------------- -[ - object, - uuid(D2F1644B-B409-11d2-BC69-00A0C9EE9E16), - pointer_default(unique) -] - -interface IBDA_SignalProperties : IUnknown -{ - HRESULT - PutNetworkType ( - [in] REFGUID guidNetworkType - ); - - HRESULT - GetNetworkType ( - [in, out] GUID * pguidNetworkType - ); - - HRESULT - PutSignalSource ( - [in] ULONG ulSignalSource - ); - - HRESULT - GetSignalSource ( - [in, out] ULONG * pulSignalSource - ); - - HRESULT - PutTuningSpace ( - [in] REFGUID guidTuningSpace - ); - - HRESULT - GetTuningSpace ( - [in, out] GUID * pguidTuingSpace - ); -} - - -//--------------------------------------------------------------------- -// -// IBDA_SignalStatistics interface -// -// Implemented by a BDA Control Node -// -// A BDA Control Node may return these properties to describe -// the condition of a signal that is being received. -// -// -// -// -//--------------------------------------------------------------------- -[ - object, - uuid(1347D106-CF3A-428a-A5CB-AC0D9A2A4338), - pointer_default(unique) -] - -interface IBDA_SignalStatistics : IUnknown -{ - HRESULT - put_SignalStrength ( - [in] LONG lDbStrength - ); - - HRESULT - get_SignalStrength ( - [in, out] LONG * plDbStrength - ); - - HRESULT - put_SignalQuality ( - [in] LONG lPercentQuality - ); - - HRESULT - get_SignalQuality ( - [in, out] LONG * plPercentQuality - ); - - HRESULT - put_SignalPresent ( - [in] BOOLEAN fPresent - ); - - HRESULT - get_SignalPresent ( - [in, out] BOOLEAN * pfPresent - ); - - HRESULT - put_SignalLocked ( - [in] BOOLEAN fLocked - ); - - HRESULT - get_SignalLocked ( - [in, out] BOOLEAN * pfLocked - ); - - HRESULT - put_SampleTime ( - [in] LONG lmsSampleTime - ); - - HRESULT - get_SampleTime ( - [in, out] LONG * plmsSampleTime - ); -} - - -//--------------------------------------------------------------------- -// -// IBDA_Topology interface -// -// Implemented by a BDA Device Filter -// -// Used by the Network Provider to query a BDA Device Filter's -// possible topologies (template topology) and to configure -// the device with an appropriate topology for the current -// tuning request. It is also used to get an IUnknown to -// a control node which may be used to set specific tuning -// information. -// -//--------------------------------------------------------------------- -[ - object, - uuid(79B56888-7FEA-4690-B45D-38FD3C7849BE), - pointer_default(unique) -] - -interface IBDA_Topology : IUnknown -{ - HRESULT - GetNodeTypes ( - [in, out] ULONG * pulcNodeTypes, - [in] ULONG ulcNodeTypesMax, - [in, out, size_is (ulcNodeTypesMax)] ULONG rgulNodeTypes[] - ); - - HRESULT - GetNodeDescriptors ( - [in, out] ULONG * ulcNodeDescriptors, - [in] ULONG ulcNodeDescriptorsMax, - [in, out, size_is (ulcNodeDescriptorsMax)] BDANODE_DESCRIPTOR rgNodeDescriptors[] - ); - - HRESULT - GetNodeInterfaces ( - [in] ULONG ulNodeType, - [in, out] ULONG * pulcInterfaces, - [in] ULONG ulcInterfacesMax, - [in, out, size_is (ulcInterfacesMax)] GUID rgguidInterfaces[] - ); - - HRESULT - GetPinTypes ( - [in, out] ULONG * pulcPinTypes, - [in] ULONG ulcPinTypesMax, - [in, out, size_is (ulcPinTypesMax)] ULONG rgulPinTypes[] - ); - - HRESULT - GetTemplateConnections ( - [in, out] ULONG * pulcConnections, - [in] ULONG ulcConnectionsMax, - [in, out, size_is (ulcConnectionsMax)] BDA_TEMPLATE_CONNECTION rgConnections[] - ); - - HRESULT - CreatePin ( - [in] ULONG ulPinType, - [in, out] ULONG * pulPinId - ); - - HRESULT - DeletePin ( - [in] ULONG ulPinId - ); - - HRESULT - SetMediaType ( - [in] ULONG ulPinId, - [in] AM_MEDIA_TYPE * pMediaType - ); - - HRESULT - SetMedium ( - [in] ULONG ulPinId, - [in] REGPINMEDIUM * pMedium - ); - - HRESULT - CreateTopology ( - [in] ULONG ulInputPinId, - [in] ULONG ulOutputPinId - ); - - HRESULT - GetControlNode ( - [in] ULONG ulInputPinId, - [in] ULONG ulOutputPinId, - [in] ULONG ulNodeType, - [in, out] IUnknown ** ppControlNode - ); -} - -//--------------------------------------------------------------------- -// IBDA_VoidTransform interface -//--------------------------------------------------------------------- -[ - object, - uuid(71985F46-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_VoidTransform : IUnknown -{ - HRESULT - Start ( - void - ); - - HRESULT - Stop ( - void - ); - -} - -//--------------------------------------------------------------------- -// IBDA_NullTransform interface -//--------------------------------------------------------------------- -[ - object, - uuid(DDF15B0D-BD25-11d2-9CA0-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_NullTransform : IUnknown -{ - HRESULT - Start ( - void - ); - - HRESULT - Stop ( - void - ); - -} - - -//--------------------------------------------------------------------- -// IBDA_FrequencyFilter interface -//--------------------------------------------------------------------- -[ - object, - uuid(71985F47-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_FrequencyFilter : IUnknown -{ - HRESULT - put_Autotune ( - [in] ULONG ulTransponder - ); - - HRESULT - get_Autotune ( - [in, out] ULONG * pulTransponder - ); - - HRESULT - put_Frequency ( - [in] ULONG ulFrequency - ); - - HRESULT - get_Frequency ( - [in, out] ULONG * pulFrequency - ); - - HRESULT - put_Polarity ( - [in] Polarisation Polarity - ); - - HRESULT - get_Polarity ( - [in, out] Polarisation * pPolarity - ); - - HRESULT - put_Range ( - [in] ULONG ulRange - ); - - HRESULT - get_Range ( - [in, out] ULONG * pulRange - ); - - HRESULT - put_Bandwidth ( - [in] ULONG ulBandwidth - ); - - HRESULT - get_Bandwidth ( - [in, out] ULONG * pulBandwidth - ); - - HRESULT - put_FrequencyMultiplier ( - [in] ULONG ulMultiplier - ); - - HRESULT - get_FrequencyMultiplier ( - [in, out] ULONG * pulMultiplier - ); -} - - -//--------------------------------------------------------------------- -// IBDA_LNBInfo interface -//--------------------------------------------------------------------- -[ - object, - uuid(992CF102-49F9-4719-A664-C4F23E2408F4), - pointer_default(unique) -] - -interface IBDA_LNBInfo : IUnknown -{ - HRESULT - put_LocalOscilatorFrequencyLowBand ( - [in] ULONG ulLOFLow - ); - - HRESULT - get_LocalOscilatorFrequencyLowBand ( - [in, out] ULONG * pulLOFLow - ); - - HRESULT - put_LocalOscilatorFrequencyHighBand ( - [in] ULONG ulLOFHigh - ); - - HRESULT - get_LocalOscilatorFrequencyHighBand ( - [in, out] ULONG * pulLOFHigh - ); - - HRESULT - put_HighLowSwitchFrequency ( - [in] ULONG ulSwitchFrequency - ); - - HRESULT - get_HighLowSwitchFrequency ( - [in, out] ULONG * pulSwitchFrequency - ); -} - - -//--------------------------------------------------------------------- -// IBDA_AutoDemodulate interface -//--------------------------------------------------------------------- -[ - object, - uuid(DDF15B12-BD25-11d2-9CA0-00C04F7971E0), - pointer_default(unique) -] - -interface IBDA_AutoDemodulate : IUnknown -{ - HRESULT - put_AutoDemodulate ( - void - ); -} - -//--------------------------------------------------------------------- -// IBDA_DigitalDemodulator interface -//--------------------------------------------------------------------- -[ - object, - uuid(EF30F379-985B-4d10-B640-A79D5E04E1E0), - pointer_default(unique) -] - -interface IBDA_DigitalDemodulator : IUnknown -{ - HRESULT - put_ModulationType ( - [in] ModulationType * pModulationType - ); - - HRESULT - get_ModulationType ( - [in, out] ModulationType * pModulationType - ); - - HRESULT - put_InnerFECMethod ( - [in] FECMethod * pFECMethod - ); - - HRESULT - get_InnerFECMethod ( - [in, out] FECMethod * pFECMethod - ); - - HRESULT - put_InnerFECRate ( - [in] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - get_InnerFECRate ( - [in, out] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - put_OuterFECMethod ( - [in] FECMethod * pFECMethod - ); - - HRESULT - get_OuterFECMethod ( - [in, out] FECMethod * pFECMethod - ); - - HRESULT - put_OuterFECRate ( - [in] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - get_OuterFECRate ( - [in, out] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - put_SymbolRate ( - [in] ULONG * pSymbolRate - ); - - HRESULT - get_SymbolRate ( - [in, out] ULONG * pSymbolRate - ); - - HRESULT - put_SpectralInversion ( - [in] SpectralInversion * pSpectralInversion - ); - - HRESULT - get_SpectralInversion ( - [in, out] SpectralInversion * pSpectralInversion - ); -} - -typedef enum -{ - KSPROPERTY_IPSINK_MULTICASTLIST, - KSPROPERTY_IPSINK_ADAPTER_DESCRIPTION, - KSPROPERTY_IPSINK_ADAPTER_ADDRESS - -} KSPROPERTY_IPSINK; - - - -//--------------------------------------------------------------------- -// IBDA_IPSinkControl interface (mutlimedia\filters.ks\ipsink) -// IBDA_IPSinkInfo interface -// -// IBDA_IPSinkControl is no longer being supported for Ring3 clients. -// Use the BDA_IPSinkInfo interface instead. -//--------------------------------------------------------------------- - -[ - object, - uuid(3F4DC8E2-4050-11d3-8F4B-00C04F7971E2), - pointer_default(unique), - helpstring("Not supported - Use IBDA_IPSinkInfo instead") -] -interface IBDA_IPSinkControl : IUnknown -{ - HRESULT GetMulticastList ( - [in, out] unsigned long *pulcbSize, - [in, out] BYTE **pbBuffer - ); - - - HRESULT GetAdapterIPAddress ( - [in,out] unsigned long *pulcbSize, - [in,out] BYTE **pbBuffer - ); - -} - -[ - object, - uuid(A750108F-492E-4d51-95F7-649B23FF7AD7), - pointer_default(unique) -] -interface IBDA_IPSinkInfo : IUnknown -{ - HRESULT get_MulticastList ( // returns N 6-byte 802.3 IP addreses. - [in, out] ULONG * pulcbAddresses, // 6*N - [out, size_is(*pulcbAddresses)] BYTE **ppbAddressList // Allocated by caller, must deallocate in callee with CoTaskMemFree() - ); - - HRESULT get_AdapterIPAddress ( - [out] BSTR *pbstrBuffer - ); - - HRESULT get_AdapterDescription ( - [out] BSTR *pbstrBuffer - ); -} -// -// mpeg-2 demultiplexer-specific interfaces follow -// - -//--------------------------------------------------------------------- -// IEnumPIDMap interface -//--------------------------------------------------------------------- - -#ifdef REMOVE_THESE -typedef enum { - MEDIA_TRANSPORT_PACKET, // complete TS packet e.g. pass-through mode - MEDIA_ELEMENTARY_STREAM, // PES payloads; audio/video only - MEDIA_MPEG2_PSI, // PAT, PMT, CAT, Private - MEDIA_TRANSPORT_PAYLOAD // gathered TS packet payloads (PES packets, etc...) -} MEDIA_SAMPLE_CONTENT ; - -typedef struct { - ULONG ulPID ; - MEDIA_SAMPLE_CONTENT MediaSampleContent ; -} PID_MAP ; -#endif // REMOVE_THESE - -[ - object, - uuid (afb6c2a2-2c41-11d3-8a60-0000f81e0e4a), - pointer_default(unique) -] -interface IEnumPIDMap : IUnknown -{ - HRESULT - Next ( - [in] ULONG cRequest, - [in, out, size_is (cRequest)] PID_MAP * pPIDMap, - [out] ULONG * pcReceived - ) ; - - HRESULT - Skip ( - [in] ULONG cRecords - ) ; - - HRESULT - Reset ( - ) ; - - HRESULT - Clone ( - [out] IEnumPIDMap ** ppIEnumPIDMap - ) ; -} ; - -//--------------------------------------------------------------------- -// IMPEG2PIDMap interface -//--------------------------------------------------------------------- - -[ - object, - uuid (afb6c2a1-2c41-11d3-8a60-0000f81e0e4a), - pointer_default(unique) -] -interface IMPEG2PIDMap : IUnknown -{ - HRESULT - MapPID ( - [in] ULONG culPID, - [in] ULONG * pulPID, - [in] MEDIA_SAMPLE_CONTENT MediaSampleContent - ) ; - - HRESULT - UnmapPID ( - [in] ULONG culPID, - [in] ULONG * pulPID - ) ; - - HRESULT - EnumPIDMap ( - [out] IEnumPIDMap ** pIEnumPIDMap - ) ; -} ; - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - //--------------------------------------------------------------------- - // - // IBDA_NetworkProvider interface - // - // Implemented by a BDA Network Provider - // - // Used by a BDA device filter to register itself with - // a Network Provider and query information about the - // the current tuning request. - // - //--------------------------------------------------------------------- - [ - object, - uuid(fd501041-8ebe-11ce-8183-00aa00577da2), - pointer_default(unique) - ] - - interface IBDA_NetworkProvider : IUnknown - { - - HRESULT - PutSignalSource ( - [in] ULONG ulSignalSource - ); - - - HRESULT - GetSignalSource ( - [in, out] ULONG * pulSignalSource - ); - - HRESULT - GetNetworkType ( - [in, out] GUID * pguidNetworkType - ); - - HRESULT - PutTuningSpace ( - [in] REFGUID guidTuningSpace - ); - - HRESULT - GetTuningSpace ( - [in, out] GUID * pguidTuingSpace - ); - - HRESULT - RegisterDeviceFilter ( - [in] IUnknown * pUnkFilterControl, - [in, out] ULONG * ppvRegisitrationContext - ); - - HRESULT - UnRegisterDeviceFilter ( - [in] ULONG pvRegistrationContext - ); - - } - - - //--------------------------------------------------------------------- - // - // IBDA_EthernetFilter interface - // - // Implemented by a BDA Network Provider - // - // Used by an Ethernet Network Data Sink filter (eg. IPSink) to - // request that the Network Provider make its best effort to tune - // to the stream(s) on which a list of Ethernet multicast addresses - // may be transmitted. - // - // Addresses in the address list are byte aligned in Network order. - // UlcbAddresses will always be an integer multiple of the - // size of an ethernet address. - // - //--------------------------------------------------------------------- - [ - object, - uuid(71985F43-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_EthernetFilter : IUnknown - { - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG * pulModeMask - ); - - } - - - - //--------------------------------------------------------------------- - // - // IBDA_IPV4Filter interface - // - // Implemented by a BDA Network Provider - // - // Used by an IPv4 Network Data Sink filter to request - // that the Network Provider make its best effort to tune - // to the stream(s) on which a list of IPv4 multicast addresses - // may be transmitted. - // - // Addresses in the address list are byte aligned in Network order. - // UlcbAddresses will always be an integer multiple of the - // size of an IPv4 address. - // - //--------------------------------------------------------------------- - [ - object, - uuid(71985F44-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_IPV4Filter : IUnknown - { - - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG* pulModeMask - ); - } - - - - //--------------------------------------------------------------------- - // - // IBDA_IPV6Filter interface - // - // Implemented by a BDA Network Provider - // - // Used by an IPv6 Network Data Sink filter to request - // that the Network Provider make its best effort to tune - // to the stream(s) on which a list of IPv6 multicast addresses - // may be transmitted. - // - // Addresses in the address list are byte aligned in Network order. - // UlcbAddresses will always be an integer multiple of the - // size of an IPv6 address. - // - //--------------------------------------------------------------------- - [ - object, - uuid(E1785A74-2A23-4fb3-9245-A8F88017EF33), - pointer_default(unique) - ] - - interface IBDA_IPV6Filter : IUnknown - { - - HRESULT - GetMulticastListSize ( - [in, out] ULONG * pulcbAddresses - ); - - HRESULT - PutMulticastList ( - [in] ULONG ulcbAddresses, - [in, size_is(ulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - GetMulticastList ( - [in, out] ULONG * pulcbAddresses, - [out, size_is(*pulcbAddresses)] BYTE pAddressList [] - ); - - HRESULT - PutMulticastMode ( - [in] ULONG ulModeMask - ); - - HRESULT - GetMulticastMode ( - [out] ULONG* pulModeMask - ); - } - - - - //--------------------------------------------------------------------- - // - // IBDA_DeviceControl interface - // - // Implemented by a BDA Device Filter - // - // Used by the Network Provider to commit a series of changes - // on a BDA device filter. The device filter validates and - // accumulates all changes requested after StartChanges(). It - // effects the accumulated list of changes when CommitChanges() is - // called. - // - //--------------------------------------------------------------------- - [ - object, - uuid(FD0A5AF3-B41D-11d2-9C95-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_DeviceControl : IUnknown - { - HRESULT - StartChanges ( - void - ); - - HRESULT - CheckChanges ( - void - ); - - HRESULT - CommitChanges ( - void - ); - - HRESULT - GetChangeState ( - [in, out] ULONG * pState - ); - - } - - - - //--------------------------------------------------------------------- - // - // IBDA_PinControl interface - // - // Implemented by a BDA Device Filter's Pin - // - // Used by the Network Provider to determine the BDA PinID and - // PinType on a BDA Filter's Pin - // - //--------------------------------------------------------------------- - [ - object, - uuid(0DED49D5-A8B7-4d5d-97A1-12B0C195874D), - pointer_default(unique) - ] - - interface IBDA_PinControl : IUnknown - { - HRESULT - GetPinID ( - [in, out] ULONG * pulPinID - ); - - HRESULT - GetPinType ( - [in, out] ULONG * pulPinType - ); - } - - //--------------------------------------------------------------------- - // - // IBDA_SignalProperties interface - // - // Implemented by a BDA Device Filter - // - // BDA Signal Properties is used by a Network Provider to inform - // a BDA Device Filter about the current tuning request. The - // Network Provider will call the Put functions when the BDA - // device is first registered with the Network Provider and whenever - // the current tuning request is modified. - // - //--------------------------------------------------------------------- - [ - object, - uuid(D2F1644B-B409-11d2-BC69-00A0C9EE9E16), - pointer_default(unique) - ] - - interface IBDA_SignalProperties : IUnknown - { - HRESULT - PutNetworkType ( - [in] REFGUID guidNetworkType - ); - - HRESULT - GetNetworkType ( - [in, out] GUID * pguidNetworkType - ); - - HRESULT - PutSignalSource ( - [in] ULONG ulSignalSource - ); - - HRESULT - GetSignalSource ( - [in, out] ULONG * pulSignalSource - ); - - HRESULT - PutTuningSpace ( - [in] REFGUID guidTuningSpace - ); - - HRESULT - GetTuningSpace ( - [in, out] GUID * pguidTuingSpace - ); - } - - - //--------------------------------------------------------------------- - // - // IBDA_Topology interface - // - // Implemented by a BDA Device Filter - // - // Used by the Network Provider to query a BDA Device Filter's - // possible topologies (template topology) and to configure - // the device with an appropriate topology for the current - // tuning request. It is also used to get an IUnknown to - // a control node which may be used to set specific tuning - // information. - // - //--------------------------------------------------------------------- - [ - object, - uuid(A14EE835-0A23-11d3-9CC7-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_Topology : IUnknown - { - HRESULT - GetNodeTypes ( - [in, out] ULONG * pulcNodeTypes, - [in] ULONG ulcNodeTypesMax, - [in, out, size_is (ulcNodeTypesMax)] ULONG rgulNodeTypes[] - ); - - - HRESULT - GetNodeInterfaces ( - [in] ULONG ulNodeType, - [in, out] ULONG * pulcInterfaces, - [in] ULONG ulcInterfacesMax, - [in, out, size_is (ulcInterfacesMax)] GUID * rgguidInterfaces[] - ); - - HRESULT - GetPinTypes ( - [in, out] ULONG * pulcPinTypes, - [in] ULONG ulcPinTypesMax, - [in, out, size_is (ulcPinTypesMax)] ULONG rgulPinTypes[] - ); - - HRESULT - GetTemplateConnections ( - [in, out] ULONG * pulcConnections, - [in] ULONG ulcConnectionsMax, - [in, out, size_is (ulcConnectionsMax)] BDA_TEMPLATE_CONNECTION rgConnections[] - ); - - HRESULT - CreatePin ( - [in] ULONG ulPinType, - [in, out] ULONG * pulPinId - ); - - HRESULT - DeletePin ( - [in] ULONG ulPinId - ); - - HRESULT - SetMediaType ( - [in] ULONG ulPinId, - [in] AM_MEDIA_TYPE * pMediaType - ); - - HRESULT - SetMedium ( - [in] ULONG ulPinId, - [in] REGPINMEDIUM * pMedium - ); - - HRESULT - CreateTopology ( - [in] ULONG ulInputPinId, - [in] ULONG ulOutputPinId - ); - - HRESULT - GetControlNode ( - [in] ULONG ulInputPinId, - [in] ULONG ulOutputPinId, - [in] ULONG ulNodeType, - [in, out] IUnknown ** ppControlNode - ); - } - - //--------------------------------------------------------------------- - // IBDA_VoidTransform interface - //--------------------------------------------------------------------- - [ - object, - uuid(71985F46-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_VoidTransform : IUnknown - { - HRESULT - Start ( - void - ); - - HRESULT - Stop ( - void - ); - - } - - //--------------------------------------------------------------------- - // IBDA_NullTransform interface - //--------------------------------------------------------------------- - [ - object, - uuid(DDF15B0D-BD25-11d2-9CA0-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_NullTransform : IUnknown - { - HRESULT - Start ( - void - ); - - HRESULT - Stop ( - void - ); - - } - - //--------------------------------------------------------------------- - // IBDA_FrequencyFilter interface - //--------------------------------------------------------------------- - [ - object, - uuid(71985F47-1CA1-11d3-9CC8-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_FrequencyFilter : IUnknown - { - HRESULT - put_Autotune ( - [in] ULONG * pulTransponder - ); - - HRESULT - put_Frequency ( - [in] ULONG * pulFrequency - ); - - HRESULT - get_Frequency ( - [in, out] ULONG * pulFrequency - ); - - HRESULT - put_Polarity ( - [in] ULONG * pulPolarity - ); - - HRESULT - get_Polarity ( - [in, out] ULONG * pulPolarity - ); - - HRESULT - put_Range ( - [in] ULONG * pulRange - ); - - HRESULT - get_Range ( - [in, out] ULONG * pulRange - ); - } - - //--------------------------------------------------------------------- - // IBDA_AutoDemodulate interface - //--------------------------------------------------------------------- - [ - object, - uuid(DDF15B12-BD25-11d2-9CA0-00C04F7971E0), - pointer_default(unique) - ] - - interface IBDA_AutoDemodulate : IUnknown - { - HRESULT - put_AutoDemodulate ( - void - ); - } - - //--------------------------------------------------------------------- - // IBDA_DigitalDemodulator interface - //--------------------------------------------------------------------- - [ - object, - uuid(EF30F379-985B-4d10-B640-A79D5E04E1E0), - pointer_default(unique) - ] - - interface IBDA_DigitalDemodulator : IUnknown - { - HRESULT - put_ModulationType ( - [in] ModulationType * pModulationType - ); - - HRESULT - get_ModulationType ( - [in, out] ModulationType * pModulationType - ); - - HRESULT - put_InnerFECMethod ( - [in] FECMethod * pFECMethod - ); - - HRESULT - get_InnerFECMethod ( - [in, out] FECMethod * pFECMethod - ); - - HRESULT - put_InnerFECRate ( - [in] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - get_InnerFECRate ( - [in, out] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - put_OuterFECMethod ( - [in] FECMethod * pFECMethod - ); - - HRESULT - get_OuterFECMethod ( - [in, out] FECMethod * pFECMethod - ); - - HRESULT - put_OuterFECRate ( - [in] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - get_OuterFECRate ( - [in, out] BinaryConvolutionCodeRate * pFECRate - ); - - HRESULT - put_SymbolRate ( - [in] ULONG * pSymbolRate - ); - - HRESULT - get_SymbolRate ( - [in, out] ULONG * pSymbolRate - ); - - HRESULT - put_SpectralInversion ( - [in] SpectralInversion * pSpectralInversion - ); - - HRESULT - get_SpectralInversion ( - [in, out] SpectralInversion * pSpectralInversion - ); - } - - typedef enum - { - KSPROPERTY_IPSINK_MULTICASTLIST, - KSPROPERTY_IPSINK_ADAPTER_DESCRIPTION, - KSPROPERTY_IPSINK_ADAPTER_ADDRESS - - } KSPROPERTY_IPSINK; - - - - //--------------------------------------------------------------------- - // IBDA_IPSinkControl interface - //--------------------------------------------------------------------- - - [ - object, - uuid(3F4DC8E2-4050-11d3-8F4B-00C04F7971E2), - pointer_default(unique) - ] - - interface IBDA_IPSinkControl : IUnknown - { - HRESULT GetMulticastList ( - [in, out] unsigned long *pulcbSize, - [in, out] BYTE **pbBuffer - ); - - - HRESULT GetAdapterIPAddress ( - [in,out] unsigned long *pulcbSize, - [in,out] BYTE **pbBuffer - ); - - } - - // - // mpeg-2 demultiplexer-specific interfaces follow - // - - //--------------------------------------------------------------------- - // IEnumPIDMap interface - //--------------------------------------------------------------------- - - #ifdef REMOVE_THESE - typedef enum { - MEDIA_TRANSPORT_PACKET, // complete TS packet e.g. pass-through mode - MEDIA_ELEMENTARY_STREAM, // PES payloads; audio/video only - MEDIA_MPEG2_PSI, // PAT, PMT, CAT, Private - MEDIA_TRANSPORT_PAYLOAD // gathered TS packet payloads (PES packets, etc...) - } MEDIA_SAMPLE_CONTENT ; - - typedef struct { - ULONG ulPID ; - MEDIA_SAMPLE_CONTENT MediaSampleContent ; - } PID_MAP ; - #endif // REMOVE_THESE - - [ - object, - uuid (afb6c2a2-2c41-11d3-8a60-0000f81e0e4a), - pointer_default(unique) - ] - interface IEnumPIDMap : IUnknown - { - HRESULT - Next ( - [in] ULONG cRequest, - [in, out, size_is (cRequest)] PID_MAP * pPIDMap, - [out] ULONG * pcReceived - ) ; - - HRESULT - Skip ( - [in] ULONG cRecords - ) ; - - HRESULT - Reset ( - ) ; - - HRESULT - Clone ( - [out] IEnumPIDMap ** ppIEnumPIDMap - ) ; - } ; - - //--------------------------------------------------------------------- - // IMPEG2PIDMap interface - //--------------------------------------------------------------------- - - [ - object, - uuid (afb6c2a1-2c41-11d3-8a60-0000f81e0e4a), - pointer_default(unique) - ] - interface IMPEG2PIDMap : IUnknown - { - HRESULT - MapPID ( - [in] ULONG culPID, - [in] ULONG * pulPID, - [in] MEDIA_SAMPLE_CONTENT MediaSampleContent - ) ; - - HRESULT - UnmapPID ( - [in] ULONG culPID, - [in] ULONG * pulPID - ) ; - - HRESULT - EnumPIDMap ( - [out] IEnumPIDMap ** pIEnumPIDMap - ) ; - } ; - - -#endif // DirectX 8.0 content \ No newline at end of file diff --git a/import/DirectX8/include/DShowIDL/control.odl b/import/DirectX8/include/DShowIDL/control.odl deleted file mode 100644 index d2bd0826e..000000000 --- a/import/DirectX8/include/DShowIDL/control.odl +++ /dev/null @@ -1,909 +0,0 @@ -//------------------------------------------------------------------------------ -// File: Control.odl -// -// Desc: -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - -// Neutral/English language type library for basic Quartz control interfaces - -// the quartz type library defines the basic control interfaces -[ - uuid(56a868b0-0ad4-11ce-b03a-0020af0ba770), - helpstring("ActiveMovie control type library"), - lcid(0x0000), - version(1.0) -] -library QuartzTypeLib -{ - importlib("STDOLE32.TLB"); - - // types are restricted to be automation-compatible - typedef double REFTIME; // ReferenceTime - typedef LONG_PTR OAEVENT; // should be a HANDLE - typedef LONG_PTR OAHWND; // should be an hwnd - - // from strmif.idl - typedef long OAFilterState; - - // collection interface - represents a collection of IUnknowns - // this is used below to collect filter-info objects, registry-filters - // pin-info objects and wrapped media type objects - [ - uuid(56a868b9-0ad4-11ce-b03a-0020af0ba770), - helpstring("Collection"), - odl, - oleautomation, - dual - ] - interface IAMCollection : IDispatch - { - // number of items in collection - [propget] - HRESULT Count( - [out, retval] LONG* plCount); - - // return IUnknown for contained item by index - HRESULT Item( - [in] long lItem, - [out] IUnknown** ppUnk); - - // return IUnknown for an object that implements IEnumVARIANT on - // this collection - [propget] - HRESULT _NewEnum( - [out, retval] IUnknown** ppUnk); - } - - - // core control providing state control - [ - uuid(56a868b1-0ad4-11ce-b03a-0020af0ba770), - helpstring("IMediaControl interface"), - odl, - oleautomation, - dual - ] - interface IMediaControl : IDispatch - { - // methods - HRESULT Run(); - HRESULT Pause(); - HRESULT Stop(); - - //returns the state. same semantics as IMediaFilter::GetState - - HRESULT GetState( - [in] LONG msTimeout, - [out] OAFilterState* pfs); - - // adds and connects filters needed to play the specified file - // (same as IFilterGraph::RenderFile) - HRESULT RenderFile( - [in] BSTR strFilename); - - // adds to the graph the source filter that can read this file, - // and returns an IFilterInfo object for it (actually returns - // an IDispatch for the IFilterInfo object). - HRESULT AddSourceFilter( - [in] BSTR strFilename, - [out] IDispatch**ppUnk); - - // get a collection of IFilterInfo objects representing the - // filters in the graph (returns IDispatch for an object - // that supports IAMCollection - [propget] - HRESULT FilterCollection( - [out, retval] IDispatch** ppUnk); - - // get a collection of IRegFilter objects representing the - // filters available in the registry - [propget] - HRESULT RegFilterCollection( - [out, retval] IDispatch** ppUnk); - - HRESULT StopWhenReady(); - } - - - // provides an event notification scheme passing events - // asynchronously to applications. See also IMediaEventSink in - // strmif.idl and sdk\h\evcodes.h. - // - // this interface behaves as if events are held on a queue. A call to - // IMediaEventSink::Notify will place an event on this queue. Calling - // GetEvent removes the first item off the queue and returns it. Items are - // returned in the order they were queued (there is no priority scheme). - // The event handle is in a signalled state iff the queue is non-empty. - // - // Apps that issue multiple Run calls without always picking up the - // completion events are advised to call GetEvent or WaitForCompletion - // (with a 0 timeout) repeatedly to remove all events from the queue - // when in stopped or paused state before each Run method. - // - // Parameters to events are actually LONG, IUnknown* or BSTR. You need to - // look at evcode.h for details of parameters to a specific event code. - // In order to correctly free resources, always call FreeEventParams - // after receiving an event. - // - - [ - uuid(56a868b6-0ad4-11ce-b03a-0020af0ba770), - helpstring("IMediaEvent interface"), - odl, - oleautomation, - dual - ] - interface IMediaEvent : IDispatch - { - // get back the event handle. This is manual-reset - // (don't - it's reset by the event mechanism) and remains set - // when events are queued, and reset when the queue is empty. - HRESULT GetEventHandle( - [out] OAEVENT * hEvent); - - // remove the next event notification from the head of the queue and - // return it. Waits up to msTimeout millisecs if there are no events. - // if a timeout occurs without any events, this method will return - // E_ABORT, and the value of the event code and other parameters - // is undefined. - // - // If this call returns successfully the caller MUST call - // FreeEventParams(lEventCode, lParam1, lParam2) to release - // resources held inside the event arguments - // - HRESULT GetEvent( - [out] long * lEventCode, - [out] LONG_PTR * lParam1, - [out] LONG_PTR * lParam2, - [in] long msTimeout - ); - - // Calls GetEvent repeatedly discarding events until it finds a - // completion event (EC_COMPLETE, EC_ERRORABORT, or EC_USERABORT). - // The completion event is removed from the queue and returned - // in pEvCode. Note that the object is still in running mode until - // a Pause or Stop call is made. - // If the timeout occurs, *pEvCode will be 0 and E_ABORT will be - // returned. - HRESULT WaitForCompletion( - [in] long msTimeout, - [out] long * pEvCode); - - // cancels any system handling of the specified event code - // and ensures that the events are passed straight to the application - // (via GetEvent) and not handled. A good example of this is - // EC_REPAINT: default handling for this ensures the painting of the - // window and does not get posted to the app. - HRESULT CancelDefaultHandling( - [in] long lEvCode); - - // restore the normal system default handling that may have been - // cancelled by CancelDefaultHandling(). - HRESULT RestoreDefaultHandling( [in] long lEvCode); - - // Free any resources associated with the parameters to an event. - // Event parameters may be LONGs, IUnknown* or BSTR. No action - // is taken with LONGs. IUnknown are passed addrefed and need a - // Release call. BSTR are allocated by the task allocator and will be - // freed by calling the task allocator. - HRESULT FreeEventParams( - [in] long lEvCode, - [in] LONG_PTR lParam1, - [in] LONG_PTR lParam2 - ); - } - - [ - uuid(56a868c0-0ad4-11ce-b03a-0020af0ba770), - helpstring("IMediaEventEx interface"), - odl - ] - interface IMediaEventEx : IMediaEvent - { - - // Register a window to send messages to when events occur - // Parameters: - // - // hwnd - handle of window to notify - - // pass NULL to stop notification - // lMsg - Message id to pass messages with - // lInstanceData - will come back in lParam - // - // The event information must still be retrived by a call - // to GetEvent when the window message is received. - // - // Multiple events may be notified with one window message. - // - HRESULT SetNotifyWindow( - [in] OAHWND hwnd, - [in] long lMsg, - [in] LONG_PTR lInstanceData - ); - - // Turn events notification on or off - // lNoNotify = 0x00 event notification is ON - // lNoNotify = 0x01 event notification is OFF. The - // handle returned by GetEventHandle will be signalled at - // end of stream - HRESULT SetNotifyFlags( - [in] long lNoNotifyFlags - ); - HRESULT GetNotifyFlags( - [out] long *lplNoNotifyFlags - ); - } - - - - - // seek/cueing for positional media - [ - uuid(56a868b2-0ad4-11ce-b03a-0020af0ba770), - helpstring("IMediaPosition interface"), - odl, - oleautomation, - dual - ] - interface IMediaPosition : IDispatch - { - // properties - - [propget] - HRESULT Duration( - [out, retval] REFTIME* plength); - - [propput] - HRESULT CurrentPosition( - [in] REFTIME llTime); - - [propget] - HRESULT CurrentPosition( - [out, retval] REFTIME* pllTime); - - [propget] - HRESULT StopTime( - [out, retval] REFTIME* pllTime); - [propput] - HRESULT StopTime( - [in] REFTIME llTime); - - [propget] - HRESULT PrerollTime( - [out, retval] REFTIME* pllTime); - [propput] - HRESULT PrerollTime( - [in] REFTIME llTime); - - [propput] - HRESULT Rate( - [in] double dRate); - [propget] - HRESULT Rate( - [out, retval] double * pdRate); - - HRESULT CanSeekForward([out, retval] LONG *pCanSeekForward); - HRESULT CanSeekBackward([out, retval] LONG *pCanSeekBackward); - } - - // basic audio-related functionality - [ - uuid(56a868b3-0ad4-11ce-b03a-0020af0ba770), - helpstring("IBasicAudio interface"), - odl, - oleautomation, - dual - ] - interface IBasicAudio : IDispatch - { - // properties - - [propput] - HRESULT Volume( - [in] long lVolume); - [propget] - HRESULT Volume( - [out, retval] long * plVolume); - - [propput] - HRESULT Balance( - [in] long lBalance); - [propget] - HRESULT Balance( - [out, retval] long * plBalance); - } - - // basic window-related functionality - [ - uuid(56a868b4-0ad4-11ce-b03a-0020af0ba770), - helpstring("IVideoWindow interface"), - odl, - oleautomation, - dual - ] - interface IVideoWindow : IDispatch - { - // properties - - // set and get the window title caption - - [propput] - HRESULT Caption([in] BSTR strCaption); - [propget] - HRESULT Caption([out, retval] BSTR *strCaption); - - // change the window styles (as per Win32) - - [propput] - HRESULT WindowStyle([in] long WindowStyle); - [propget] - HRESULT WindowStyle([out, retval] long *WindowStyle); - - // change the extended window styles (as per Win32) - - [propput] - HRESULT WindowStyleEx([in] long WindowStyleEx); - [propget] - HRESULT WindowStyleEx([out, retval] long *WindowStyleEx); - - [propput] - HRESULT AutoShow([in] long AutoShow); - [propget] - HRESULT AutoShow([out, retval] long *AutoShow); - - // change the window state (as per Win32) - - [propput] - HRESULT WindowState([in] long WindowState); - [propget] - HRESULT WindowState([out, retval] long *WindowState); - - // realise the palette in the background - - [propput] - HRESULT BackgroundPalette([in] long BackgroundPalette); - [propget] - HRESULT BackgroundPalette([out, retval] long *pBackgroundPalette); - - // affect the visibility of the window - - [propput] - HRESULT Visible([in] long Visible); - [propget] - HRESULT Visible([out, retval] long *pVisible); - - // change the desktop position of the video window - - [propput] - HRESULT Left([in] long Left); - [propget] - HRESULT Left([out, retval] long *pLeft); - - [propput] - HRESULT Width([in] long Width); - [propget] - HRESULT Width([out, retval] long *pWidth); - - [propput] - HRESULT Top([in] long Top); - [propget] - HRESULT Top([out, retval] long *pTop); - - [propput] - HRESULT Height([in] long Height); - [propget] - HRESULT Height([out, retval] long *pHeight); - - // change the owning window of the video - - [propput] - HRESULT Owner([in] OAHWND Owner); - [propget] - HRESULT Owner([out, retval] OAHWND *Owner); - - // change the window to receive posted messages - - [propput] - HRESULT MessageDrain([in] OAHWND Drain); - [propget] - HRESULT MessageDrain([out, retval] OAHWND *Drain); - - [propget] - HRESULT BorderColor([out, retval] long *Color); - - [propput] - HRESULT BorderColor([in] long Color); - - [propget] - HRESULT FullScreenMode([out, retval] long *FullScreenMode); - - [propput] - HRESULT FullScreenMode([in] long FullScreenMode); - - // methods - - // ask the renderer to grab it's window the foreground - // and optionally also give the window the input focus - HRESULT SetWindowForeground([in] long Focus); - - // owners should pass WM_PALETTECHANGED and WM_SYSCOLORCHANGE - // messages on the filter graph so they can be distributed - // otherwise child renderers never see these messages go by - - HRESULT NotifyOwnerMessage([in] OAHWND hwnd, - [in] long uMsg, - [in] LONG_PTR wParam, - [in] LONG_PTR lParam - ); - - // get and set the window position on the desktop - - HRESULT SetWindowPosition([in] long Left, - [in] long Top, - [in] long Width, - [in] long Height); - - HRESULT GetWindowPosition([out] long *pLeft, - [out] long *pTop, - [out] long *pWidth, - [out] long *pHeight); - - // get the ideal sizes for the video image playback (client) area - - HRESULT GetMinIdealImageSize([out] long *pWidth,[out] long *pHeight); - HRESULT GetMaxIdealImageSize([out] long *pWidth,[out] long *pHeight); - - // get the restored window size when we're maximised or iconic - - HRESULT GetRestorePosition([out] long *pLeft, - [out] long *pTop, - [out] long *pWidth, - [out] long *pHeight); - - // show and hide cursors useful when fullscreen - HRESULT HideCursor([in] long HideCursor); - HRESULT IsCursorHidden([out] long *CursorHidden); - } - - // basic video-related functionality - [ - uuid(56a868b5-0ad4-11ce-b03a-0020af0ba770), - helpstring("IBasicVideo interface"), - odl, - oleautomation, - dual - ] - interface IBasicVideo : IDispatch - { - // properties - - // Video specific (approximate) bit and frame rates - - [propget] - HRESULT AvgTimePerFrame([out, retval] REFTIME *pAvgTimePerFrame); - - [propget] - HRESULT BitRate([out, retval] long *pBitRate); - - [propget] - HRESULT BitErrorRate([out, retval] long *pBitErrorRate); - - // read the native video size - - [propget] - HRESULT VideoWidth([out, retval] long *pVideoWidth); - - [propget] - HRESULT VideoHeight([out, retval] long *pVideoHeight); - - // change the source rectangle for the video - - [propput] - HRESULT SourceLeft([in] long SourceLeft); - [propget] - HRESULT SourceLeft([out, retval] long *pSourceLeft); - - [propput] - HRESULT SourceWidth([in] long SourceWidth); - [propget] - HRESULT SourceWidth([out, retval] long *pSourceWidth); - - [propput] - HRESULT SourceTop([in] long SourceTop); - [propget] - HRESULT SourceTop([out, retval] long *pSourceTop); - - [propput] - HRESULT SourceHeight([in] long SourceHeight); - [propget] - HRESULT SourceHeight([out, retval] long *pSourceHeight); - - // change the destination rectangle for the video - - [propput] - HRESULT DestinationLeft([in] long DestinationLeft); - [propget] - HRESULT DestinationLeft([out, retval] long *pDestinationLeft); - - [propput] - HRESULT DestinationWidth([in] long DestinationWidth); - [propget] - HRESULT DestinationWidth([out, retval] long *pDestinationWidth); - - [propput] - HRESULT DestinationTop([in] long DestinationTop); - [propget] - HRESULT DestinationTop([out, retval] long *pDestinationTop); - - [propput] - HRESULT DestinationHeight([in] long DestinationHeight); - [propget] - HRESULT DestinationHeight([out, retval] long *pDestinationHeight); - - // methods - - // get and set the source rectangle position - - HRESULT SetSourcePosition([in] long Left, - [in] long Top, - [in] long Width, - [in] long Height); - - HRESULT GetSourcePosition([out] long *pLeft, - [out] long *pTop, - [out] long *pWidth, - [out] long *pHeight); - - HRESULT SetDefaultSourcePosition(); - - // get and set the destination rectangle position - - HRESULT SetDestinationPosition([in] long Left, - [in] long Top, - [in] long Width, - [in] long Height); - - HRESULT GetDestinationPosition([out] long *pLeft, - [out] long *pTop, - [out] long *pWidth, - [out] long *pHeight); - - HRESULT SetDefaultDestinationPosition(); - - // get the native video dimensions - - HRESULT GetVideoSize([out] long *pWidth,[out] long *pHeight); - - // get all or some of the current video palette - - HRESULT GetVideoPaletteEntries([in] long StartIndex, - [in] long Entries, - [out] long *pRetrieved, - [out] long *pPalette); - - HRESULT GetCurrentImage([in,out] long *pBufferSize, - [out] long *pDIBImage); - - // are we using a default source or destination - - HRESULT IsUsingDefaultSource(); - HRESULT IsUsingDefaultDestination(); - } - - // interface extension to IBasicVideo to return preferred aspect ratio - [ - uuid(329bb360-f6ea-11d1-9038-00a0c9697298), - helpstring("IBasicVideo2"), - odl - ] - interface IBasicVideo2 : IBasicVideo - { - // This may not match the native video dimensions because of - // non-square pixels or whatever. - // The video may not always be displayed in the preferred - // aspect ratio for performance reasons - - HRESULT GetPreferredAspectRatio([out] long *plAspectX, - [out] long *plAspectY); - } - - // interface returned to a command that has been queued via IQueueCommand - [ - uuid(56a868b8-0ad4-11ce-b03a-0020af0ba770), - helpstring("IDeferredCommand"), - odl - ] - interface IDeferredCommand : IUnknown - { - HRESULT Cancel(); - HRESULT Confidence( - [out] LONG* pConfidence); - HRESULT Postpone( - [in] REFTIME newtime); - // return value is S_OK if completed. phrResult is set to the - // result of the deferred command. - HRESULT GetHResult( - [out] HRESULT* phrResult); - }; - - // queue an IDispatch-based command for execution at a specified time - [ - uuid(56a868b7-0ad4-11ce-b03a-0020af0ba770), - helpstring("IQueueCommand"), - odl - ] - interface IQueueCommand : IUnknown - { - HRESULT InvokeAtStreamTime( - [out] IDeferredCommand** pCmd, - [in] REFTIME time, // at this streamtime - [in] GUID* iid, // call this interface - [in] long dispidMethod, // ..and this method - [in] short wFlags, // method/property - [in] long cArgs, // count of args - [in] VARIANT* pDispParams, // actual args - [in, out] VARIANT* pvarResult, // return value - [out] short* puArgErr // which arg in error - ); - - HRESULT InvokeAtPresentationTime( - [out] IDeferredCommand** pCmd, - [in] REFTIME time, // at this presentation time - [in] GUID* iid, // call this interface - [in] long dispidMethod, // ..and this method - [in] short wFlags, // method/property - [in] long cArgs, // count of args - [in] VARIANT* pDispParams, // actual args - [in, out] VARIANT* pvarResult, // return value - [out] short* puArgErr // which arg in error - ); - - }; - - - - // the filgraph object (CLSID_Filgraph) - [ - uuid(e436ebb3-524f-11ce-9f53-0020af0ba770), - helpstring("Filtergraph type info") - ] - coclass FilgraphManager - { - [default] interface IMediaControl; - interface IMediaEvent; - interface IMediaPosition; - interface IBasicAudio; - interface IBasicVideo; - interface IVideoWindow; - - }; - - - // represents a filter (you can't QI for IBaseFilter from this object) - [ - uuid(56a868ba-0ad4-11ce-b03a-0020af0ba770), - helpstring("FilterInfo"), - odl, - oleautomation, - dual - ] - interface IFilterInfo : IDispatch - { - // find a pin given an id - returns an object supporting - // IPinInfo - HRESULT FindPin( - [in] BSTR strPinID, - [out] IDispatch** ppUnk); - - // filter name - [propget] - HRESULT Name( - [out, retval] BSTR* strName); - - // Vendor info string - [propget] - HRESULT VendorInfo( - [out, retval] BSTR* strVendorInfo); - - // returns the actual filter object (supports IBaseFilter) - [propget] - HRESULT Filter( - [out, retval] IUnknown **ppUnk); - - // returns an IAMCollection object containing the PinInfo objects - // for this filter - [propget] - HRESULT Pins( - [out, retval] IDispatch ** ppUnk); - - // returns -1 if true or 0 if false (OATRUE/FALSE) - [propget] - HRESULT IsFileSource( - [out, retval] LONG * pbIsSource); - - [propget] - HRESULT Filename( - [out, retval] BSTR* pstrFilename); - - [propput] - HRESULT Filename( - [in] BSTR strFilename); - } - - [ - uuid(56a868bb-0ad4-11ce-b03a-0020af0ba770), - helpstring("Registry Filter Info"), - odl, - oleautomation, - dual - ] - interface IRegFilterInfo : IDispatch - { - // get the name of this filter - [propget] - HRESULT Name( - [out, retval] BSTR* strName); - - - // make an instance of this filter, add it to the graph and - // return an IFilterInfo for it. - HRESULT Filter( - [out] IDispatch** ppUnk); - } - - // wrapper for a media type - [ - uuid(56a868bc-0ad4-11ce-b03a-0020af0ba770), - helpstring("Media Type"), - odl, - oleautomation, - dual - ] - interface IMediaTypeInfo : IDispatch - { - // get the major type GUID as a string - [propget] - HRESULT Type( - [out, retval] BSTR* strType); - - // get the subtype GUID as a string - [propget] - HRESULT Subtype( - [out, retval] BSTR* strType); - } - - [ - uuid(56a868bd-0ad4-11ce-b03a-0020af0ba770), - helpstring("Pin Info"), - odl, - oleautomation, - dual - ] - interface IPinInfo : IDispatch - { - // get the pin object (IUnknown for an object that - // supports IPin - [propget] - HRESULT Pin( - [out, retval] IUnknown** ppUnk); - - // get the PinInfo object for the pin we are connected to - [propget] - HRESULT ConnectedTo( - [out, retval] IDispatch** ppUnk); - - // get the media type on this connection - returns an - // object supporting IMediaTypeInfo - [propget] - HRESULT ConnectionMediaType( - [out, retval] IDispatch** ppUnk); - - - // return the FilterInfo object for the filter this pin - // is part of - [propget] - HRESULT FilterInfo( - [out, retval] IDispatch** ppUnk); - - // get the name of this pin - [propget] - HRESULT Name( - [out, retval] BSTR* ppUnk); - - // pin direction - [propget] - HRESULT Direction( - [out, retval] LONG *ppDirection); - - // PinID - can pass to IFilterInfo::FindPin - [propget] - HRESULT PinID( - [out, retval] BSTR* strPinID); - - // collection of preferred media types (IAMCollection) - [propget] - HRESULT MediaTypes( - [out, retval] IDispatch** ppUnk); - - // Connect to the following pin, using other transform - // filters as necessary. pPin can support either IPin or IPinInfo - HRESULT Connect( - [in] IUnknown* pPin); - - // Connect directly to the following pin, not using any intermediate - // filters - HRESULT ConnectDirect( - [in] IUnknown* pPin); - - // Connect directly to the following pin, using the specified - // media type only. pPin is an object that must support either - // IPin or IPinInfo, and pMediaType must support IMediaTypeInfo. - HRESULT ConnectWithType( - [in] IUnknown * pPin, - [in] IDispatch * pMediaType); - - // disconnect this pin and the corresponding connected pin from - // each other. (Calls IPin::Disconnect on both pins). - HRESULT Disconnect(void); - - // render this pin using any necessary transform and rendering filters - HRESULT Render(void); - } - - //-------------------------------------------------------------------- - // - // IAMStats - statistics - // - // Note that the calls using an index are likely to be much faster - //-------------------------------------------------------------------- - - [ - uuid(bc9bcf80-dcd2-11d2-abf6-00a0c905f375), - helpstring("Statistics"), - odl, - oleautomation, - dual - ] - interface IAMStats : IDispatch { - // Reset all stats - HRESULT Reset(); - - // Get number of stats collected - [propget] - HRESULT Count( - [out, retval] LONG* plCount); - - // Pull out a specific value by position - HRESULT GetValueByIndex([in] long lIndex, - [out] BSTR *szName, - [out] long *lCount, - [out] double *dLast, - [out] double *dAverage, - [out] double *dStdDev, - [out] double *dMin, - [out] double *dMax); - - // Pull out a specific value by name - HRESULT GetValueByName([in] BSTR szName, - [out] long *lIndex, - [out] long *lCount, - [out] double *dLast, - [out] double *dAverage, - [out] double *dStdDev, - [out] double *dMin, - [out] double *dMax); - - - // The calls below are for generators of statistics - - // Return the index for a string - optinally create - HRESULT GetIndex([in] BSTR szName, - [in] long lCreate, - [out] long *plIndex); - - // Add a new value - HRESULT AddValue([in] long lIndex, - [in] double dValue); - } -}; diff --git a/import/DirectX8/include/DShowIDL/ddstream.idl b/import/DirectX8/include/DShowIDL/ddstream.idl deleted file mode 100644 index 8b3a51907..000000000 --- a/import/DirectX8/include/DShowIDL/ddstream.idl +++ /dev/null @@ -1,86 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DDStream.idl -// -// Desc: Used by MIDL tool to generate ddstream.h -// -// Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "mmstream.idl"; - -cpp_quote("//") -cpp_quote("// The following declarations within the 'if 0' block are dummy typedefs used to make") -cpp_quote("// the ddstream.idl file build. The actual definitions are contained in DDRAW.H") -cpp_quote("//") -cpp_quote("#if 0") -typedef void * LPDDSURFACEDESC; -typedef struct tDDSURFACEDESC DDSURFACEDESC; -cpp_quote("#endif") -cpp_quote("#include ") - -enum { - DDSFF_PROGRESSIVERENDER = 0x00000001 -}; - -interface IDirectDraw; -interface IDirectDrawSurface; -interface IDirectDrawPalette; - -interface IDirectDrawMediaStream; -interface IDirectDrawStreamSample; - -// IDirectDrawMediaStream -[ -object, -local, -uuid(F4104FCE-9A70-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IDirectDrawMediaStream : IMediaStream -{ - HRESULT GetFormat( - [out] DDSURFACEDESC *pDDSDCurrent, - [out] IDirectDrawPalette **ppDirectDrawPalette, - [out] DDSURFACEDESC *pDDSDDesired, - [out] DWORD *pdwFlags); - - HRESULT SetFormat( - [in] const DDSURFACEDESC *pDDSurfaceDesc, - [in] IDirectDrawPalette *pDirectDrawPalette); - - HRESULT GetDirectDraw( - [out] IDirectDraw **ppDirectDraw); - - HRESULT SetDirectDraw( - [in] IDirectDraw *pDirectDraw); - - HRESULT CreateSample( - [in] IDirectDrawSurface *pSurface, - [in] const RECT *pRect, - [in] DWORD dwFlags, - [out]IDirectDrawStreamSample **ppSample); - - HRESULT GetTimePerFrame( - [out] STREAM_TIME *pFrameTime); -}; - - -// IDirectDrawStreamSample -[ -object, -local, -uuid(F4104FCF-9A70-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IDirectDrawStreamSample : IStreamSample -{ - HRESULT GetSurface( - [out] IDirectDrawSurface ** ppDirectDrawSurface, - [out] RECT * pRect); - - HRESULT SetRect( - [in] const RECT * pRect); - -}; diff --git a/import/DirectX8/include/DShowIDL/devenum.idl b/import/DirectX8/include/DShowIDL/devenum.idl deleted file mode 100644 index f034eb23d..000000000 --- a/import/DirectX8/include/DShowIDL/devenum.idl +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DevEnum.idl -// -// Desc: IDL source for devenum.dll. This file will be processed by the -// MIDL tool to produce the type library (devenum.tlb) and marshalling -// code. -// -// Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -cpp_quote("#define CDEF_CLASS_DEFAULT 0x0001") -cpp_quote("#define CDEF_BYPASS_CLASS_MANAGER 0x0002") -//cpp_quote("#define CDEF_CLASS_LEGACY 0x0004") -cpp_quote("#define CDEF_MERIT_ABOVE_DO_NOT_USE 0x0008") - -// If any of these flags are set, then only the types specified -// by the flags are enumerated -cpp_quote("#define CDEF_DEVMON_CMGR_DEVICE 0x0010") -cpp_quote("#define CDEF_DEVMON_DMO 0x0020") -cpp_quote("#define CDEF_DEVMON_PNP_DEVICE 0x0040") -cpp_quote("#define CDEF_DEVMON_FILTER 0x0080") -cpp_quote("#define CDEF_DEVMON_SELECTIVE_MASK 0x00f0") - -[ - object, - uuid(29840822-5B84-11D0-BD3B-00A0C911CE86), - pointer_default(unique) -] -interface ICreateDevEnum : IUnknown -{ - import "oaidl.idl"; - - HRESULT CreateClassEnumerator( - [in] REFCLSID clsidDeviceClass, - [out] IEnumMoniker ** ppEnumMoniker, - [in] DWORD dwFlags); -} diff --git a/import/DirectX8/include/DShowIDL/dmodshow.idl b/import/DirectX8/include/DShowIDL/dmodshow.idl deleted file mode 100644 index 1a5907c79..000000000 --- a/import/DirectX8/include/DShowIDL/dmodshow.idl +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DMODShow.idl -// -// Desc: This file will be processed by the MIDL tool to -// produce dmodshow.h and proxy-stub code. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "objidl.idl"; -import "mediaobj.idl"; - -// 94297043-bd82-4dfd-b0de-8177739c6d20 -cpp_quote("DEFINE_GUID(CLSID_DMOWrapperFilter, 0x94297043,0xbd82,0x4dfd,0xb0,0xde,0x81,0x77,0x73,0x9c,0x6d,0x20);") - -// bcd5796c-bd52-4d30-ab76-70f975b89199 -cpp_quote("DEFINE_GUID(CLSID_DMOFilterCategory,0xbcd5796c,0xbd52,0x4d30,0xab,0x76,0x70,0xf9,0x75,0xb8,0x91,0x99);") - - -[ - object, - uuid(52d6f586-9f0f-4824-8fc8-e32ca04930c2), -] -interface IDMOWrapperFilter : IUnknown -{ - // Init is passed in the clsid (so it can call CoCreateInstance) - // and the catgory under which the DMO lives. - // Note that catDMO can be CLSID_NULL, in which case no special - // category-specific processing will be invoked in the wrapper filter. - HRESULT Init(REFCLSID clsidDMO, REFCLSID catDMO); -} - diff --git a/import/DirectX8/include/DShowIDL/dshowasf.idl b/import/DirectX8/include/DShowIDL/dshowasf.idl deleted file mode 100644 index c0966560a..000000000 --- a/import/DirectX8/include/DShowIDL/dshowasf.idl +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DShowASF.idl -// -// Desc: -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "objidl.idl"; -import "strmif.idl"; // for media type and time definitions -import "wmsdkidl.idl"; - -cpp_quote( "EXTERN_GUID( IID_IConfigAsfWriter,0x45086030,0xF7E4,0x486a,0xB5,0x04,0x82,0x6B,0xB5,0x79,0x2A,0x3B );" ) - -interface IConfigAsfWriter; -interface IWMProfile; - -// Interface to control the ASF writer -[ -object, -uuid(45086030-F7E4-486a-B504-826BB5792A3B), -pointer_default(unique) -] -interface IConfigAsfWriter : IUnknown -{ - // - // The user is expected to enumerate profiles using the wmsdk IWMProfileManager - // method and then pass the desired profile index to the ASF Writer filter via this - // method. The filter will then try to configure itself for the selected profile. - // - // NOTE: These 2 XXXProfileId methods are now obsolete because they assume - // version 4.0 WMSDK profiles. To configure the filter for later profile - // versions using a profile index, use the XXXProfile methods which take - // the IWMProfile* directly. - // - HRESULT ConfigureFilterUsingProfileId([in] DWORD dwProfileId); - HRESULT GetCurrentProfileId([out] DWORD *pdwProfileId); - - // - // configure using a pre-defined wmsdk profile guid - // - HRESULT ConfigureFilterUsingProfileGuid([in] REFGUID guidProfile); - HRESULT GetCurrentProfileGuid([out] GUID *pProfileGuid); - - // - // Use these methods when a custom profile setup is preferred - // - HRESULT ConfigureFilterUsingProfile([in] IWMProfile * pProfile); - HRESULT GetCurrentProfile([out] IWMProfile **ppProfile); - - // - // allow app to control whether or not to index file - // - HRESULT SetIndexMode( [in] BOOL bIndexFile ); - HRESULT GetIndexMode( [out] BOOL *pbIndexFile ); -} - diff --git a/import/DirectX8/include/DShowIDL/dvdif.idl b/import/DirectX8/include/DShowIDL/dvdif.idl deleted file mode 100644 index 4cf518711..000000000 --- a/import/DirectX8/include/DShowIDL/dvdif.idl +++ /dev/null @@ -1,2324 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DVDIf.idl -// -// Desc: DirectShow interfaces to control playback of a DVD filter graph. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// forward declarations - these are the interfaces declared in this file - -import "unknwn.idl"; -import "objidl.idl"; - -cpp_quote("#include ") - -interface IDvdControl; -interface IDvdInfo; -interface IDirectDraw; -interface IDirectDrawSurface; -interface IDvdGraphBuilder ; -interface IDDrawExclModeVideo; -interface IDDrawExclModeVideoCallback; -interface IDvdCmd; -interface IDvdState; - - -//========================================================================== -//========================================================================== -// -// typedefs used by IDvdControl and IDvdInfo interfaces. -// -//========================================================================== -//========================================================================== - -typedef enum tagDVD_DOMAIN { - // The DVD_DOMAIN is used to indicate the stat of a DVD player. - DVD_DOMAIN_FirstPlay=1, // doing default initialization of a dvd disc - DVD_DOMAIN_VideoManagerMenu, // displaying menus for whole disc - DVD_DOMAIN_VideoTitleSetMenu, // displaying menus for current title set - DVD_DOMAIN_Title, // displaying current title - DVD_DOMAIN_Stop // player is in stopped state -} DVD_DOMAIN; - -typedef enum tagDVD_MENU_ID { - DVD_MENU_Title = 2, // to choose a title from any VTS in a DVD-Video volume - DVD_MENU_Root = 3, // main menu for a specific VTS - DVD_MENU_Subpicture =4, // to choose subpicture stream in a VTS - DVD_MENU_Audio = 5, // to choose audio stream in a VTS - DVD_MENU_Angle = 6, // to choose angle num in a VTS - DVD_MENU_Chapter = 7 // to choose a chapter in a VTS - // the Root menu always provides a means of getting to to Subpicture, Audio, - // Angle and Chapter menus if they exist. -} DVD_MENU_ID; - -typedef enum tagDVD_DISC_SIDE { - DVD_SIDE_A = 1, - DVD_SIDE_B = 2 -} DVD_DISC_SIDE; - - -typedef enum tagDVD_PREFERRED_DISPLAY_MODE -{ - // DVD_PREFERRED_DISPLAY_MODE is used to indicate the user's - // preferred window aspect ratio and preferred method of converion of - // 16*9 content to a 4*3 window aspect ratio. Pan-scan and letterboxing are - // the two conversion methods. This enum is used to indicate only a preference of - // conversion mechinism since some content can only be converted using one - // of these methods. 4*3 content is converted to a 16*9 window always by using - // "reverse" letterboxing where black bars are added to the right and left - // sides of the display instead of the top and bottom of the display as in the 16*9 - // to 4*3 conversion useing letterboxing. - DISPLAY_CONTENT_DEFAULT = 0, // default to content - DISPLAY_16x9 = 1, // 16x9 display - DISPLAY_4x3_PANSCAN_PREFERRED = 2, // 4x3 display with pan-scan preferrence - DISPLAY_4x3_LETTERBOX_PREFERRED = 3 // 4x3 display with letterbox preferrence - -} DVD_PREFERRED_DISPLAY_MODE; - -typedef WORD DVD_REGISTER; -typedef DVD_REGISTER GPRMARRAY[16]; // DVD-Video 1.0 has 16 16-bit General Parameter Registers -typedef DVD_REGISTER SPRMARRAY[24]; // DVD-Video 1.0 has 24 16-bit System Parameter Registers - - - -// these are only for IDVDInfo1 compatibility and require the DVD-Video 1.0 specification -// Please use the IDVDInfo2's DVD_Title/MenuAttributes, DVD_VideoAttributes, DVD_AudioAttributes, and DVD_SubpictureAttributes -typedef struct tagDVD_ATR -{ - // - // Refer to the DVD-Video 1.0 spec to parse these structures. - // - ULONG ulCAT; // VMG_CAT if this is for a volume; or VTS_CAT - // if this is for a Video Title Set (VTS) - BYTE pbATRI[768];// All stream attributes for menu and title from bytes - // 256 to 1023 of VMGI or VTSI. -} DVD_ATR; -typedef BYTE DVD_VideoATR[2]; // video stream attributes. -typedef BYTE DVD_AudioATR[8]; // audio stream attributes. -typedef BYTE DVD_SubpictureATR[6]; // subpicture stream attributes. - -// DVD1.0 Timecode is BCD encoded in this format: 0xHhMmSsFf, where -// H is tens of hours -// h is hours -// M is tens of minutes -// m is minutes -// S is tens of seconds -// s is seconds -// F is tens of frames -// f is frames -// Note that you must know the frame rate to interperate the frame count as time. -typedef enum tagDVD_FRAMERATE -{ - DVD_FPS_25 =1, // 25 frames per second - DVD_FPS_30NonDrop = 3 // exactly 30 frames per second -} DVD_FRAMERATE; - -cpp_quote("typedef struct tagDVD_TIMECODE") -cpp_quote("{") -cpp_quote(" ULONG Hours1 :4; // Hours") -cpp_quote(" ULONG Hours10 :4; // Tens of Hours ") -cpp_quote("") -cpp_quote(" ULONG Minutes1 :4; // Minutes ") -cpp_quote(" ULONG Minutes10:4; // Tens of Minutes ") -cpp_quote("") -cpp_quote(" ULONG Seconds1 :4; // Seconds ") -cpp_quote(" ULONG Seconds10:4; // Tens of Seconds ") -cpp_quote("") -cpp_quote(" ULONG Frames1 :4; // Frames ") -cpp_quote(" ULONG Frames10 :2; // Tens of Frames ") -cpp_quote("") -cpp_quote(" ULONG FrameRateCode: 2; // use DVD_FRAMERATE to indicate frames/sec and drop/non-drop") -cpp_quote("} DVD_TIMECODE;") - -// -// Newer IDVD2 methods can use the HMSF format instead -// Call SetOption( DVD_HMSF_TimeCodeEvents, TRUE) to return EC_DVD_CURRENT_HMSF_TIME -// instead of EC_DVD_CURRENT_TIME events -// -typedef enum tagDVD_TIMECODE_FLAGS -{ - DVD_TC_FLAG_25fps = 0x00000001, // 25 frames per second - DVD_TC_FLAG_30fps = 0x00000002, // 30 frames per second - DVD_TC_FLAG_DropFrame = 0x00000004, // 29.97 instead of 30 fps - DVD_TC_FLAG_Interpolated = 0x00000008, // timecode may be inaccurate - // remainder of bits are reserved and should not be read -} DVD_TIMECODE_FLAGS; - -// this can be cast to/from a ULONG -typedef struct tagDVD_HMSF_TIMECODE -{ - BYTE bHours; - BYTE bMinutes; - BYTE bSeconds; - BYTE bFrames; -} DVD_HMSF_TIMECODE; - -typedef struct tagDVD_PLAYBACK_LOCATION2 -{ - // - // TitleNum & ChapterNum or TitleNum & TimeCode are sufficient to save - // playback location for One_Sequential_PGC_Titles. - // - ULONG TitleNum; // title number for whole disc (TTN not VTS_TTN) - ULONG ChapterNum; // part-of-title number with title. 0xffffffff if not Once_Sequential_PGC_Title - DVD_HMSF_TIMECODE TimeCode; // use DVD_TIMECODE for current playback time. - ULONG TimeCodeFlags; // union of DVD_TIMECODE_EVENT_FLAGS - -} DVD_PLAYBACK_LOCATION2; - -typedef struct tagDVD_PLAYBACK_LOCATION -{ - // - // TitleNum & ChapterNum or TitleNum & TimeCode are sufficient to save - // playback location for One_Sequential_PGC_Titles. - // - ULONG TitleNum; // title number for whole disc (TTN not VTS_TTN) - ULONG ChapterNum; // part-of-title number with title. 0xffffffff if not Once_Sequential_PGC_Title - ULONG TimeCode; // use DVD_TIMECODE for current playback time. 0xffffffff if not Once_Sequential_PGC_Title - -} DVD_PLAYBACK_LOCATION; - -typedef DWORD VALID_UOP_SOMTHING_OR_OTHER; - -typedef enum { - // - // Annex J User Functions --- - // - UOP_FLAG_Play_Title_Or_AtTime = 0x00000001, // Title_Or_Time_Play - UOP_FLAG_Play_Chapter = 0x00000002, // Chapter_Search_Or_Play - UOP_FLAG_Play_Title = 0x00000004, // Title_Play - UOP_FLAG_Stop = 0x00000008, // Stop - UOP_FLAG_ReturnFromSubMenu = 0x00000010, // GoUp - UOP_FLAG_Play_Chapter_Or_AtTime = 0x00000020, // Time_Or_Chapter_Search - UOP_FLAG_PlayPrev_Or_Replay_Chapter = 0x00000040, // Prev_Or_Top_PG_Search - UOP_FLAG_PlayNext_Chapter = 0x00000080, // Next_PG_Search - UOP_FLAG_Play_Forwards = 0x00000100, // Forward_Scan - UOP_FLAG_Play_Backwards = 0x00000200, // Backward_Scan - UOP_FLAG_ShowMenu_Title = 0x00000400, // Title_Menu_Call - UOP_FLAG_ShowMenu_Root = 0x00000800, // Root_Menu_Call - UOP_FLAG_ShowMenu_SubPic = 0x00001000, // SubPic_Menu_Call - UOP_FLAG_ShowMenu_Audio = 0x00002000, // Audio_Menu_Call - UOP_FLAG_ShowMenu_Angle = 0x00004000, // Angle_Menu_Call - UOP_FLAG_ShowMenu_Chapter = 0x00008000, // Chapter_Menu_Call - UOP_FLAG_Resume = 0x00010000, // Resume - UOP_FLAG_Select_Or_Activate_Button = 0x00020000, // Button_Select_Or_Activate - UOP_FLAG_Still_Off = 0x00040000, // Still_Off - UOP_FLAG_Pause_On = 0x00080000, // Pause_On - UOP_FLAG_Select_Audio_Stream = 0x00100000, // Audio_Stream_Change - UOP_FLAG_Select_SubPic_Stream = 0x00200000, // SubPic_Stream_Change - UOP_FLAG_Select_Angle = 0x00400000, // Angle_Change - UOP_FLAG_Select_Karaoke_Audio_Presentation_Mode = 0x00800000, // Karaoke_Audio_Pres_Mode_Change - UOP_FLAG_Select_Video_Mode_Preference = 0x01000000 // Video_Pres_Mode_Change -} VALID_UOP_FLAG ; - -typedef enum { - DVD_CMD_FLAG_None = 0x00000000, - DVD_CMD_FLAG_Flush = 0x00000001, - DVD_CMD_FLAG_SendEvents = 0x00000002, - DVD_CMD_FLAG_Block = 0x00000004, // block end - DVD_CMD_FLAG_StartWhenRendered = 0x00000008, // command "start" when the first frame is rendered - DVD_CMD_FLAG_EndAfterRendered = 0x00000010, // command "ends" after the last frame is rendered -} DVD_CMD_FLAGS; - -// For IDVDControl2::SetOption flags -typedef enum { - DVD_ResetOnStop = 1, // default TRUE - DVD_NotifyParentalLevelChange = 2, // default FALSE - DVD_HMSF_TimeCodeEvents = 3, // default FALSE (send DVD_CURRENT_TIME events) -} DVD_OPTION_FLAG; - -typedef enum { - DVD_Relative_Upper = 1, - DVD_Relative_Lower = 2, - DVD_Relative_Left = 3, - DVD_Relative_Right = 4 -} DVD_RELATIVE_BUTTON; - -// Parental Level Information -typedef enum tagDVD_PARENTAL_LEVEL -{ - DVD_PARENTAL_LEVEL_8 = 0x8000, - DVD_PARENTAL_LEVEL_7 = 0x4000, - DVD_PARENTAL_LEVEL_6 = 0x2000, - DVD_PARENTAL_LEVEL_5 = 0x1000, - DVD_PARENTAL_LEVEL_4 = 0x0800, - DVD_PARENTAL_LEVEL_3 = 0x0400, - DVD_PARENTAL_LEVEL_2 = 0x0200, - DVD_PARENTAL_LEVEL_1 = 0x0100 -} DVD_PARENTAL_LEVEL; - - -typedef enum tagDVD_AUDIO_LANG_EXT -{ - DVD_AUD_EXT_NotSpecified =0, - DVD_AUD_EXT_Captions =1, - DVD_AUD_EXT_VisuallyImpaired =2, - DVD_AUD_EXT_DirectorComments1 =3, - DVD_AUD_EXT_DirectorComments2 =4, -} DVD_AUDIO_LANG_EXT; - -typedef enum tagDVD_SUBPICTURE_LANG_EXT -{ - DVD_SP_EXT_NotSpecified =0, - DVD_SP_EXT_Caption_Normal =1, - DVD_SP_EXT_Caption_Big =2, - DVD_SP_EXT_Caption_Children =3, - DVD_SP_EXT_CC_Normal =5, - DVD_SP_EXT_CC_Big =6, - DVD_SP_EXT_CC_Children =7, - DVD_SP_EXT_Forced =9, - DVD_SP_EXT_DirectorComments_Normal =13, - DVD_SP_EXT_DirectorComments_Big =14, - DVD_SP_EXT_DirectorComments_Children =15, -} DVD_SUBPICTURE_LANG_EXT; - -typedef enum tagDVD_AUDIO_APPMODE -{ - DVD_AudioMode_None = 0, // no special mode - DVD_AudioMode_Karaoke = 1, - DVD_AudioMode_Surround = 2, - DVD_AudioMode_Other = 3, -} DVD_AUDIO_APPMODE; - -typedef enum tagDVD_AUDIO_FORMAT -{ - DVD_AudioFormat_AC3 = 0, - DVD_AudioFormat_MPEG1 = 1, - DVD_AudioFormat_MPEG1_DRC = 2, // MPEG1 with dynamic range control - DVD_AudioFormat_MPEG2 = 3, - DVD_AudioFormat_MPEG2_DRC = 4, // MPEG2 with dynamic range control - DVD_AudioFormat_LPCM = 5, - DVD_AudioFormat_DTS = 6, - DVD_AudioFormat_SDDS = 7, - DVD_AudioFormat_Other = 8 -} DVD_AUDIO_FORMAT; - -// flags for SelectKaraokeAudioPresentationMode -typedef enum tagDVD_KARAOKE_DOWNMIX -{ - DVD_Mix_0to0 = 0x0001, // unused - reserved for future use - DVD_Mix_1to0 = 0x0002, // unused - reserved for future use - DVD_Mix_2to0 = 0x0004, - DVD_Mix_3to0 = 0x0008, - DVD_Mix_4to0 = 0x0010, - DVD_Mix_Lto0 = 0x0020, // mix auxillary L to channel 0 (left speaker) - DVD_Mix_Rto0 = 0x0040, // mix auxillary R to channel 0 (left speaker) - - DVD_Mix_0to1 = 0x0100, // unused - reserved for future use - DVD_Mix_1to1 = 0x0200, // unused - reserved for future use - DVD_Mix_2to1 = 0x0400, - DVD_Mix_3to1 = 0x0800, - DVD_Mix_4to1 = 0x1000, - DVD_Mix_Lto1 = 0x2000, // mix auxillary L to channel 1 (right speaker) - DVD_Mix_Rto1 = 0x4000, // mix auxillary R to channel 1 (right speaker) -} DVD_KARAOKE_DOWNMIX; - - -typedef struct tagDVD_AudioAttributes -{ - DVD_AUDIO_APPMODE AppMode; - BYTE AppModeData; - DVD_AUDIO_FORMAT AudioFormat; // Use GetKaraokeAttributes() - LCID Language; // 0 if no language is present - DVD_AUDIO_LANG_EXT LanguageExtension; // (captions, if for children etc) - BOOL fHasMultichannelInfo; // multichannel attributes are present (Use GetMultiChannelAudioAttributes()) - DWORD dwFrequency; // in hertz (48k, 96k) - BYTE bQuantization; // resolution (16, 20, 24 bits etc), 0 is unknown - BYTE bNumberOfChannels; // 5.1 AC3 has 6 channels - DWORD dwReserved[2]; -} DVD_AudioAttributes; - -typedef struct tagDVD_MUA_MixingInfo -{ - // surround sound mixing information applied when: - // AppMode = DVD_AudioMode_Surround - // AudioFormat = DVD_AudioFormat_LPCM, - // fHasMultichannelInfo=1 modes are all on - // - BOOL fMixTo0; - BOOL fMixTo1; - - // - BOOL fMix0InPhase; - BOOL fMix1InPhase; - - DWORD dwSpeakerPosition; // see ksmedia.h: SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT, etc -} DVD_MUA_MixingInfo; - -// The alpha coeff is used to mix to ACH0 and beta is used to mix to ACH1 -// -// In general: -// ACH0 = coeff[0].alpha * value[0] + coeff[1].alpha * value[1] + ... -// ACH1 = coeff[0].beta * value[0] + coeff[1].beta * value[1] + ... -typedef struct tagDVD_MUA_Coeff -{ - double log2_alpha; // actual coeff = 2^alpha - double log2_beta; // actual coeff = 2^beta -} DVD_MUA_Coeff; - -typedef struct tagDVD_MultichannelAudioAttributes -{ - // actual Data for each data stream - DVD_MUA_MixingInfo Info[8]; - DVD_MUA_Coeff Coeff[8]; -} DVD_MultichannelAudioAttributes; - -// bitwise OR of these flags descript the contents of each channel -typedef enum tagDVD_KARAOKE_CONTENTS -{ - DVD_Karaoke_GuideVocal1 = 0x0001, - DVD_Karaoke_GuideVocal2 = 0x0002, - DVD_Karaoke_GuideMelody1 = 0x0004, - DVD_Karaoke_GuideMelody2 = 0x0008, - DVD_Karaoke_GuideMelodyA = 0x0010, - DVD_Karaoke_GuideMelodyB = 0x0020, - DVD_Karaoke_SoundEffectA = 0x0040, - DVD_Karaoke_SoundEffectB = 0x0080 -} DVD_KARAOKE_CONTENTS; - -typedef enum tagDVD_KARAOKE_ASSIGNMENT -{ - DVD_Assignment_reserved0 = 0, - DVD_Assignment_reserved1 = 1, - DVD_Assignment_LR = 2, // left right - DVD_Assignment_LRM = 3, // left right middle - DVD_Assignment_LR1 = 4, // left right audio1 - DVD_Assignment_LRM1 = 5, // left right middle audio1 - DVD_Assignment_LR12 = 6, // left right audio1 audio2 - DVD_Assignment_LRM12 = 7 // left right middle audio1 audio2 -} DVD_KARAOKE_ASSIGNMENT; - -typedef struct tagDVD_KaraokeAttributes -{ - BYTE bVersion; - BOOL fMasterOfCeremoniesInGuideVocal1; - BOOL fDuet; // false = solo - DVD_KARAOKE_ASSIGNMENT ChannelAssignment; - WORD wChannelContents[8]; // logical OR of DVD_KARAOKE_CONTENTS -} DVD_KaraokeAttributes; - -typedef enum tagDVD_VIDEO_COMPRESSION -{ - DVD_VideoCompression_Other = 0, - DVD_VideoCompression_MPEG1 = 1, - DVD_VideoCompression_MPEG2 = 2, -} DVD_VIDEO_COMPRESSION; - -typedef struct tagDVD_VideoAttributes -{ - BOOL fPanscanPermitted; // if a 4x3 display, can be shown as PanScan - BOOL fLetterboxPermitted; // if a 4x3 display, can be shown as Letterbox - ULONG ulAspectX; // 4x3 or 16x9 - ULONG ulAspectY; - ULONG ulFrameRate; // 50hz or 60hz - ULONG ulFrameHeight; // 525 (60hz) or 625 (50hz) - DVD_VIDEO_COMPRESSION Compression;// MPEG1 or MPEG2 - - BOOL fLine21Field1InGOP; // true if there is user data in field 1 of GOP of video stream - BOOL fLine21Field2InGOP; // true if there is user data in field 1 of GOP of video stream - - ULONG ulSourceResolutionX; // X source resolution (352,704, or 720) - ULONG ulSourceResolutionY; // Y source resolution (240,480, 288 or 576) - - BOOL fIsSourceLetterboxed; // subpictures and highlights (e.g. subtitles or menu buttons) are only - // displayed in the active video area and cannot be displayed in the top/bottom 'black' bars - BOOL fIsFilmMode; // for 625/50hz systems, is film mode (true) or camera mode (false) -} DVD_VideoAttributes; - -typedef enum tagDVD_SUBPICTURE_TYPE -{ - DVD_SPType_NotSpecified = 0, - DVD_SPType_Language = 1, - DVD_SPType_Other = 2, -} DVD_SUBPICTURE_TYPE; - -typedef enum tagDVD_SUBPICTURE_CODING -{ - DVD_SPCoding_RunLength = 0, - DVD_SPCoding_Extended = 1, - DVD_SPCoding_Other = 2, -} DVD_SUBPICTURE_CODING; - -typedef struct tagDVD_SubpictureAttributes -{ - DVD_SUBPICTURE_TYPE Type; - DVD_SUBPICTURE_CODING CodingMode; - LCID Language; - DVD_SUBPICTURE_LANG_EXT LanguageExtension; -} DVD_SubpictureAttributes; - -typedef enum tagDVD_TITLE_APPMODE -{ - DVD_AppMode_Not_Specified = 0, // no special mode - DVD_AppMode_Karaoke = 1, - DVD_AppMode_Other = 3, -} DVD_TITLE_APPMODE; - -typedef struct tagDVD_TitleMainAttributes -{ - // for Titles - DVD_TITLE_APPMODE AppMode; - - // Attributes about the 'main' video of the menu or title - DVD_VideoAttributes VideoAttributes; - - ULONG ulNumberOfAudioStreams; - DVD_AudioAttributes AudioAttributes[8]; - // present if the multichannel bit is set in the corresponding stream's audio attributes - DVD_MultichannelAudioAttributes MultichannelAudioAttributes[8]; - - ULONG ulNumberOfSubpictureStreams; - DVD_SubpictureAttributes SubpictureAttributes[32]; -} DVD_TitleAttributes; - -typedef struct tagDVD_MenuAttributes -{ - // for VMG only - BOOL fCompatibleRegion[8]; // indeces 0..7 correspond to regions 1..8 - - // Attributes about the main menu (VMGM or VTSM) - DVD_VideoAttributes VideoAttributes; - - BOOL fAudioPresent; - DVD_AudioAttributes AudioAttributes; - - BOOL fSubpicturePresent; - DVD_SubpictureAttributes SubpictureAttributes; -} DVD_MenuAttributes; - -//========================================================================== -//========================================================================== -// IDvdControl interface -- Basic DVD-Video playback control. -// This modeled after the app control of a player specified in Annex J -// of the DVD Video spec. IDvdInfo can be used to get information useful -// in using IDvdControl -//========================================================================== -//========================================================================== - -[ -object, -uuid(A70EFE61-E2A3-11d0-A9BE-00AA0061BE93), -pointer_default(unique) -] - -interface IDvdControl : IUnknown { - import "unknwn.idl"; - - // TitlePlay - // Start playing the specified title number. - // Title numbers range between 1 and 99. - HRESULT TitlePlay - ( [in] ULONG ulTitle - ); - - // ChapterPlay - // Start playing at the specified chapter (or part-of-title) - // within the specified title. Chapters range from 1 to 999. - HRESULT ChapterPlay - ( [in] ULONG ulTitle, - [in] ULONG ulChapter - ); - - // TimePlay - // Start playing at the specified time within the specified title. - // NOTE: the actual start time will be the closest sync point before - // or equal to the specified frame number. - HRESULT TimePlay - ( [in] ULONG ulTitle, - [in] ULONG bcdTime // use DVD_TIMECODE. Framerate code is ignored. - ); - - // StopForResume - // Stop playback after saving resume information. DVD Navigator transfers to the DVD "Stop State" and - // (same as DVD_DOMAIN_Stop), but filter graph remains in DirectShow's Run state. - HRESULT StopForResume(); - - // GoUp - // Start playback of the program chain currently authored as the "GoUp_PGCN". - HRESULT GoUp(); - - // TimeSearch - // Start playing at the specified time within the current title. - // NOTE: the actual start time will be the closest sync point before - // or equal to the specified frame number. - HRESULT TimeSearch - ( [in] ULONG bcdTime // use DVD_TIMECODE. Framerate code is ignored. - ); - - // ChapterSearch - // Start playing at the specified chapter (or part-of-title) within - // the current title. - HRESULT ChapterSearch - ( [in] ULONG ulChapter - ); - - // PrevPGSearch - // Start playing at the beginning of the previous DVD "program". - // For One-Sequential_PGC_Titles (which includes most titles) a program - // is equivalent to a chapter, otherwise a program is part of a chapter. - HRESULT PrevPGSearch(); - - // TopPGSearch - // Start playing from the beginning of they current program. - HRESULT TopPGSearch(); - - // NextPGSearch - // Start playing from the beginning of the next program. - HRESULT NextPGSearch(); - - // ForwardScan - // Set forward play at the specified speed. - // dwSpeed == 1 is normal play - // dwSpeed < 1 is slow play - // dwSpeed > 1 is fast play - // For dwSpeed != 1, audio and subpicture is muted. - HRESULT ForwardScan - ( [in] double dwSpeed - ); - - // BackwardScan - // Set reverse play at the specified speed. - // dwSpeed == 1 is normal play speed in reverse - // dwSpeed < 1 is slow play in reverse - // dwSpeed > 1 is fast play in reverse - // For reverse play, audio and subpicture are always muted. - HRESULT BackwardScan - ( [in] double dwSpeed - ); - - // MenuCall - // Start playback of the Menu specified by an enum DVD_MENU_ID. - HRESULT MenuCall - ( [in] DVD_MENU_ID MenuID - ); - - // Resume - // Returns to title playback in DVD_DOMAIN_Title. This is typically - // done after MenuCall which puts the DVD Navigator in - // DVD_DOMAIN_VideoTitleSetMenu or DVD_DOMAIN_VideoManagerMenu. - HRESULT Resume(); - - // UpperButtonSelect - // Selects the button above the current button. - // "Selecting" a DVD button simply highlights the button but does - // not "Activate" the button. Selecting is the Windows equivalent - // to tabbing to a button but not pressing the space bar or enter key. - // Activating is the Windows equivalent of pressing the space bar or - // enter key after tabbing to a button. - HRESULT UpperButtonSelect(); - - // LowerButtonSelect - // Selects the button below the current button. - HRESULT LowerButtonSelect(); - - // LeftButtonSelect - // Selects the button to the left of the current button. - HRESULT LeftButtonSelect(); - - // RightButtonSelect - // Selects the button to the right of the current button. - HRESULT RightButtonSelect(); - - // ButtonActivate - // Activates current button. - HRESULT ButtonActivate(); - - // ButtonSelectAndActivate - // Selects and then activates the button specified by the user. - // ulButton is intended to be a number entered by a user corresponding - // to button numbers currently displayed on screen. - // Button numbers range from 1 to 36. - HRESULT ButtonSelectAndActivate - ( [in] ULONG ulButton - ); - - // StillOff - // Releases any current still if there are no available buttons. - // This includes VOBU stills, Cell stills, and PGC stills, whether the - // still is infinite. When buttons are available, stills are released by - // activating a button. Note this does not release a Pause. - HRESULT StillOff(); - - // PauseOn - // Freezes playback and any internal timers. This is similar to - // IMediaControl::Pause() - HRESULT PauseOn(); - - // PauseOff - // Releases a Pause. - HRESULT PauseOff(); - - // MenuLanguageSelect - // Selects the default language for menus. Languages are specified with - // Windows standard LCIDs. LCIDs can be created from ISO-639 codes with - // MAKELCID( MAKELANGID(wISO639LangID ,SUBLANG_DEFAULT ), SORT_DEFAULT ) - // NOTE: MAKELANGID seems to have a bug so 'jp' may have to be used - // instead of 'ja' for the ISO639 code for Japanese. - // MenuLanguageSelect may only called from the DVD Stop state (DVD_DOMAIN_Stop). - HRESULT MenuLanguageSelect - ( [in] LCID Language - ); - - // AudioStreamChange - // Changes the current audio stream. - HRESULT AudioStreamChange - ( [in] ULONG ulAudio - ); - - // SubpictureStreamChange - // Changes the current subpicture stream number to nSubpic, and toggles - // its display. - HRESULT SubpictureStreamChange - ( [in] ULONG ulSubPicture, - [in] BOOL bDisplay - ); - - // AngleChange - // Changes the current angle number. - HRESULT AngleChange - ( [in] ULONG ulAngle - ); - - // ParentalLevelSelect - // Selects the current player parental level between 1 and 8. The - // defined parental levels are listed below : - // - // Level Rating - // ----- ------ - // - // 1 G - // 3 PG - // 4 PG13 - // 6 R - // 7 NC17 - // Higher levels can play lower level content; lower levels cannot play - // higher level content. The DVD Navigator provides no restriction on - // setting the parental level. DVD player application may enforce - // restriction on parental level setting, such as password protection for - // raising the current parental level. Parental Management is disabled in - // the Navigator by default. - // - // Note : To disable parental management, pass 0xffffffff for ulParentalLevel - // If parental management is disabled, then the player will play the - // first PGC in a parental block regardless of parental IDs. - // - HRESULT ParentalLevelSelect - ( [in] ULONG ulParentalLevel - ); - - // ParentalCountrySelect - // Sets the country in which to interpret the the Parental Level. - // The country specified using the Alpha-2 code of the ISO-3166 standard, - // with the addition of 'ZZ' - HRESULT ParentalCountrySelect - ( [in] WORD wCountry - ); - - // KaraokeAudioPresentationModeChange - // Sets the Karaoke audio mode. - // NOTE: This and all other Karoke support is currently not implemented. - HRESULT KaraokeAudioPresentationModeChange - ( [in] ULONG ulMode - ); - - // VideoModePreferrence - // The user can specify the preferred display mode that should - // be used to display content. The parameter is a ULONG that has - // one of the values defined in DVD_PREFERRED_DISPLAY_MODE - HRESULT VideoModePreferrence - ( [in] ULONG ulPreferredDisplayMode - ); - - // SetRoot - // Sets the root directory containing the DVD-Video volume. - // Can only be called from the DVD Stop State (DVD_DOMAIN_Stop). - // If the root directory is not successfully set before - // IMediaControl::Play is called, the first drive starting from c: - // containing a VIDEO_TS directory in the top level directory - // will be used as the root. - HRESULT SetRoot - ( [in] LPCWSTR pszPath - ); - - // MouseActivate - // This is typically called in response to a mouse click. - // The specified point within the display window is to see if it is - // within a current DVD button's highlight rect. If it is, that - // button is first selected, then activated. - // NOTE: DVD Buttons do not all necessarily have highlight rects, - // button rects can overlap, and button rects do not always - // correspond to the visual representation of DVD buttons. - HRESULT MouseActivate // typically called after a mouse click - ( [in] POINT point - ); - - // MouseSelect - // This is typically called in response to a mouse move within the - // display window. - // The specified point within the display window is to see if it is - // within a current DVD button's highlight rect. If it is, that - // button is selected. - // NOTE: DVD Buttons do not all necessarily have highlight rects, - // button rects can overlap, and button rects do not always - // correspond to the visual representation of DVD buttons. - HRESULT MouseSelect // typically called after a mouse move - ( [in] POINT point - ); - - // ChapterPlayAutoStop - // Start playing at the specified chapter within the specified title - // and play the number of chapters specified by the third parameter. - // Chapters range from 1 to 999. - HRESULT ChapterPlayAutoStop - ( [in] ULONG ulTitle, // title number - [in] ULONG ulChapter, // chapter number to start playback - [in] ULONG ulChaptersToPlay // number of chapters to play from the start chapter - ); -} - - - -//========================================================================== -//========================================================================== -// IDvdInfo interface -- allow an app to query for attributes of available -// DVD titles and DVD player status. Also allow for control of a DVD -// player beyond Annex J in the DVD spec. -//========================================================================== -//========================================================================== - -[ -object, -uuid(A70EFE60-E2A3-11d0-A9BE-00AA0061BE93), -pointer_default(unique) -] - -interface IDvdInfo : IUnknown { - import "unknwn.idl"; - - // GetCurrentDomain - // Returns the current DVD Domain of the DVD player. - HRESULT GetCurrentDomain - ( [out] DVD_DOMAIN *pDomain - ); - - // GetCurrentLocation - // Returns information sufficient to restart playback of a video - // from the current playback location in titles that don't explicitly - // disable seeking to the current location. - HRESULT GetCurrentLocation - ( [out] DVD_PLAYBACK_LOCATION *pLocation - ); - - // GetTotalTitleTime - // Return the total playback time for the current title. Only works - // for One_Sequential_PGC_Titles. - HRESULT GetTotalTitleTime - ( [out] ULONG * pulTotalTime // use DVD_TIMECODE. - ); - - // GetCurrentButton - // Indicates the number of currently available buttons and the current - // selected button number. If buttons are not present it returns 0 for - // both pulButtonsAvailable and pulCurrentButton - HRESULT GetCurrentButton - ( [out] ULONG * pulButtonsAvailable, - [out] ULONG * pulCurrentButton - ); - - // GetCurrentAngle - // Indicates the number of currently available angles and the current - // selected angle number. If *pnAnglesAvailable==1, then the current - // video is not multiangle. - HRESULT GetCurrentAngle - ( [out] ULONG * pulAnglesAvailable, - [out] ULONG * pulCurrentAngle - ); - - // GetCurrentAudio - // Indicates the number of currently available audio streams and - // the current selected audio stream number. - // This only work when in DVD_DOMAIN_Title. - HRESULT GetCurrentAudio - ( [out] ULONG * pulStreamsAvailable, - [out] ULONG * pulCurrentStream - ); - - // GetCurrentSubpicture - // Indicates the number of currently available subpicture streams, - // the current selected subpicture stream number, and if the - // subpicture display is currently disabled. Subpicture streams - // authored as Forcedly Activated stream will be displayed even if - // subpicture display has been disabled by the app with - // IDVDControl::SubpictureChangeStream. - // This only work when in DVD_DOMAIN_Title. - HRESULT GetCurrentSubpicture - ( [out] ULONG * pulStreamsAvailable, - [out] ULONG * pulCurrentStream, - [out] BOOL * pIsDisabled - ); - - // GetCurrentUOPS - // Indicates which IDVDControl methods are currently valid. DVD titles - // can enable or disable individual user operations at almost any point - // during playback. - HRESULT GetCurrentUOPS - ( [out] VALID_UOP_SOMTHING_OR_OTHER * pUOP - ); - - // GetAllSPRMs - // Returns the current contents of all System Parameter Registers. - // See DVD-Video spec for use of individual registers. - HRESULT GetAllSPRMs - ( [out] SPRMARRAY * pRegisterArray - ); - - // GetAllGPRMs - // Returns the current contents of all General Parameter Registers. - // Use of GPRMs is title specific. - HRESULT GetAllGPRMs - ( [out] GPRMARRAY * pRegisterArray - ); - - // GetAudioLanguage - // Returns the language of the specified stream within the current - // title. Does not return languages for menus. Sets *pLanguage=0 if - // if the stream does not include language. - // Use GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize) - // to create a human readable string name from the result LCID. - HRESULT GetAudioLanguage - ( [in] ULONG ulStream, - [out] LCID * pLanguage - ); - - // GetSubpictureLanguage - // Returns the language of the specified stream within the current - // title. Does not return languages for menus. Sets *pLanguage=0 if - // if the stream does not include language. - // Use GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize) - // to create a human readable string name from the result LCID. - HRESULT GetSubpictureLanguage - ( [in] ULONG ulStream, - [out] LCID * pLanguage - ); - - // GetTitleAttributes - // Returns attributes of all video, audio, and subpicture - // streams for the specified title including menus. - // If nTitle == 0xffffffff, attributes for the current title are returned. - HRESULT GetTitleAttributes - ( [in] ULONG ulTitle, // requested title number - [out] DVD_ATR * pATR - ); - - // GetVMGAttributes - // Returns attributes of all video, audio, and subpicture - // streams for Video Manager Menus. Some menus, such as the DVD_MENU_Title - // are in a separate group of streams called the VMG (Video Manager) and - // are not associated with any particular title number. - HRESULT GetVMGAttributes - ( [out] DVD_ATR * pATR - ); - - // GetCurrentVideoAttributes - // Returns the video attributes for the current title or menu. - HRESULT GetCurrentVideoAttributes - ( [out] DVD_VideoATR *pATR - ); - - // GetCurrentAudioAttributes - // Returns the video attributes for the stream in the current - // title or menu. - HRESULT GetCurrentAudioAttributes - ( [out] DVD_AudioATR *pATR - ); - - // GetCurrentSubpictureAttributes - // Returns the video attributes for the stream in the current - // title or menu. - HRESULT GetCurrentSubpictureAttributes - ( [out] DVD_SubpictureATR *pATR - ); - - - // GetCurrentVolumeInfo - // Returns current DVD volume info. - HRESULT GetCurrentVolumeInfo - ( [out] ULONG *pulNumOfVol, // number of volumes (disc sides?) in a volume set - [out] ULONG *pulThisVolNum, // volume number for this root directory - [out] DVD_DISC_SIDE *pSide, // current disc side - [out] ULONG *pulNumOfTitles // number of titles available in this volume - ); - - - // GetDVDTextInfo - // Returns the TXTDT_MG structure, which can contain text descriptions for title - // name, volume name, producer name, vocalist name, etc. in various languages. - // refer to Section 4.1.6 and Annex A of the DVD-Video spec. - // If the buffer size passed in is insufficient (for example if cbBufSize==0), - // then E_OUTOFMEMORY is returned, and *pcbActualSize is set to the required size. - HRESULT GetDVDTextInfo - ( [out, size_is(ulBufSize)] BYTE *pTextManager, - [in] ULONG ulBufSize, // buffer size passed in - [out] ULONG *pulActualSize // amount of actual data return - ); - - // GetPlayerParentalLevel - // Returns the current parental level and the current country code - // that has been set in the system registers in player. - // See Table 3.3.4-1 of the DVD-Video spec for the defined parental levels. - // Valid Parental Levels = 1..8 if parental management is enabled - // 0xffffffff if parental management is disabled - // See ISO3166 : Alpha-2 Code for the country codes. - HRESULT GetPlayerParentalLevel - ( [out] ULONG *pulParentalLevel, // current parental level - [out] ULONG *pulCountryCode // current country code - ); - - // GetNumberOfChapters - // Returns the number of chapters that are defined for a - // given title. - HRESULT GetNumberOfChapters - ( [in] ULONG ulTitle, // Title for which number of chapters is requested - [out] ULONG *pulNumberOfChapters // Number of chapters for the specified title - ); - - // GetTitleParentalLevels - // Returns the parental levels that are defined for a - // particular title. pParentalLevels will be combination - // of DVD_PARENTAL_LEVEL_8, DVD_PARENTAL_LEVEL_6, or - // DVD_PARENTAL_LEVEL_1 "OR"ed together - HRESULT GetTitleParentalLevels - ( [in] ULONG ulTitle, // Title for which parental levels are requested - [out] ULONG *pulParentalLevels // Parental levels defined for the title "OR"ed together - ); - - // GetRoot - // Returns the root directory that is set in the player. If a valid root - // has been found, it returns the root string. Otherwise, it returns 0 for - // pcbActualSize indicating that a valid root directory has not been found - // or initialized. - // - // !!! used to return LPTSTR. interface was changed to return - // LPSTR (ansi) for compatibility. COM APIs should pass with - // UNICODE strings only. - // - HRESULT GetRoot - ( [out, size_is(ulBufSize)] LPSTR pRoot, // pointer to buffer to get root string - [in] ULONG ulBufSize, // size of buffer passed in - [out] ULONG *pulActualSize // size of actual data returned - ); -} - -//========================================================================== -//========================================================================== -// IDvdCmd interface -- the IDVDControl2 command sequencing object. -// -// For the IDVDControl2 interface, the application can track the status of -// commands that have been issued to the navigator. Each command is identified -// by an IDvdCmd object. The IDvdCmd object stores the results of the command -// at both the start (when the command has begun processing) and the end after -// it has completed. It also allows the app to synchronize with the processing -// of the command. -// -// The command object also allows the app to uniquely identify and correlate -// completion events (if it prefers to process events in a message loop instead -// of creating another process). -// -// Allows the app to track the status of an issued command to the nav. -//========================================================================== -//========================================================================== - -[ -object, -uuid(5a4a97e4-94ee-4a55-9751-74b5643aa27d), -pointer_default(unique) -] - -interface IDvdCmd : IUnknown { - import "unknwn.idl"; - - // - // WaitForStart - // - // Blocks the application until the command has begun. - // - HRESULT WaitForStart(); - - // - // WaitForEnd - // - // Blocks until the command has completed or has been cancelled. - HRESULT WaitForEnd(); -} - -//========================================================================== -//========================================================================== -// IDvdState interface -- the State state object. -// -// Whenever the application wishes to save or restore a location on the disc, -// it needs to store the DVD state into an object. -// The State object supports the IPersistStream -// -//========================================================================== -//========================================================================== - -[ -object, -uuid(86303d6d-1c4a-4087-ab42-f711167048ef), -pointer_default(unique) -] - -interface IDvdState : IUnknown -{ - // - // GetDiscID - // - // Returns the disc ID from which the bookmark was made. - // - HRESULT GetDiscID - ( [out] ULONGLONG* pullUniqueID ); // 64-bit unique id for the disc - - // - // GetParentalLevel - // - // Returns the state's parental level - // - HRESULT GetParentalLevel - ( [out] ULONG* pulParentalLevel ); -} - -//========================================================================== -//========================================================================== -// IDvdControl2 interface -- Basic DVD-Video playback control. -// This is modeled after the app control of a player specified in Annex J -// of the DVD Video spec. IDvdInfo2 can be used to get information useful -// in using IDvdControl2 -//========================================================================== -//========================================================================== - -[ -object, -uuid(33BC7430-EEC0-11D2-8201-00A0C9D74842), -pointer_default(unique) -] - -interface IDvdControl2 : IUnknown { - import "unknwn.idl"; - - // PlayTitle - // - // Start playing from the beginning of the specified title number. - // Annex J: Title_Play - // Title numbers range between 1 and 99. - HRESULT PlayTitle - ( [in] ULONG ulTitle, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // PlayChapterInTitle - // - // Start playing from the beginning of the given chapter (or part-of-title) number - // within the specified title number. - // Annex J: PTT_Play - // Title numbers range between 1 and 99. - // Chapters range from 1 to 999. - HRESULT PlayChapterInTitle - ( [in] ULONG ulTitle, - [in] ULONG ulChapter, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // PlayAtTimeInTitle - // - // Start playing from the specified time within the specified title number. - // NOTE: the actual start time will be the closest sync point before - // or equal to the specified frame number. - // Annex J: Time_Play - // Title numbers range between 1 and 99. - HRESULT PlayAtTimeInTitle - ( [in] ULONG ulTitle, - [in] DVD_HMSF_TIMECODE* pStartTime, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // Stop - // Stop playback by transferring DVD Navigator to the DVD "Stop State" (same - // as DVD_DOMAIN_Stop), but filter graph remains in DirectShow's Run state. - // Annex J: Stop - HRESULT Stop(); - - // ReturnFromSubmenu - // - // Stop playback of current program chain (PGC) and start playing the PGC - // specified by "GoUp_PGCN".in the PGCI. - // If the GoUp_PGCN value is 0xFFFF the Resume() operation is carried out. - // Annex J: GoUp - HRESULT ReturnFromSubmenu( - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd ); - - // PlayAtTime - // Start playing at the specified time within the current title. - // NOTE: the actual start time will be the closest sync point before - // or equal to the specified frame number. - // Annex J: Time_Search - // The time is in BCD format, passed in as a ULONG. - HRESULT PlayAtTime - ( [in] DVD_HMSF_TIMECODE* pTime, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // PlayChapter - // Start playing at the specified chapter (or part-of-title) within - // the current title. - // Annex J: PTT_Search - // Chapters range from 1 to 999. - HRESULT PlayChapter - ( [in] ULONG ulChapter, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // PlayPrevChapter - // Start playing at the beginning of the previous DVD "program". - // For One-Sequential_PGC_Titles (which includes most titles) a program - // is equivalent to a chapter, otherwise a program is part of a chapter. - // Annex J: PrevPG_Search - HRESULT PlayPrevChapter( - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd ); - - // ReplayChapter - // Start playing from the beginning of they current program. - // Annex J: TopPG_Search - HRESULT ReplayChapter( - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd ); - - // PlayNextChapter - // Start playing from the beginning of the next program. - // Annex J: NextPG_Search - HRESULT PlayNextChapter( - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd ); - - // PlayForwards - // Set forward play at the specified speed. - // Annex J: Forward_Scan - // dSpeed == 1 is normal play - // dSpeed < 1 is slow play - // dSpeed > 1 is fast play - // For dSpeed != 1, audio and subpicture is muted. - HRESULT PlayForwards - ( [in] double dSpeed, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // PlayBackwards - // Set reverse play at the specified speed. - // Annex J: Backward_Scan - // dSpeed == 1 is normal play speed in reverse - // dSpeed < 1 is slow play in reverse - // dSpeed > 1 is fast play in reverse - // For reverse play, audio and subpicture are always muted. - HRESULT PlayBackwards - ( [in] double dSpeed, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // ShowMenu - // Start playback of the Menu specified by an enum DVD_MENU_ID. - // Annex J: Menu_Call - HRESULT ShowMenu - ( [in] DVD_MENU_ID MenuID, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // Resume - // Returns to title playback in DVD_DOMAIN_Title. This is typically - // done after MenuCall which puts the DVD Navigator in - // DVD_DOMAIN_VideoTitleSetMenu or DVD_DOMAIN_VideoManagerMenu. - // Annex J: Resume - HRESULT Resume( - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd ); - - // SelectRelativeButton - // Moves the selection highlight above, below, to the left of, or to the right of the - // currently selected. - // "Selecting" a DVD button simply highlights the button but does - // not "Activate" the button. Selecting is the Windows equivalent - // to tabbing to a button but not pressing the space bar or enter key. - // Activating is the Windows equivalent of pressing the space bar or - // enter key after tabbing to a button. - // Annex J: Upper_button_Select, Lower_button_Select, Left_button_Select, Right_button_Select - HRESULT SelectRelativeButton( DVD_RELATIVE_BUTTON buttonDir ); - - // ActivateButton - // Activates current button. - // Annex J: Button_Activate - HRESULT ActivateButton(); - - // SelectButton - // Selects a specific button (with the index from 1 to 36). - // ulButton is intended to be a number entered by a user corresponding - // to button numbers currently displayed on screen. - // Button numbers range from 1 to 36. - HRESULT SelectButton - ( [in] ULONG ulButton - ); - - // SelectAndActivateButton - // Selects and then activates the button specified by the user. - // ulButton is intended to be a number entered by a user corresponding - // to button numbers currently displayed on screen. - // Annex J: Button_Select_And_Activate - // Button numbers range from 1 to 36. - HRESULT SelectAndActivateButton - ( [in] ULONG ulButton - ); - - // StillOff - // Releases any current still if there are no available buttons. - // This includes VOBU stills, Cell stills, and PGC stills, whether the - // still is infinite. When buttons are available, stills are released by - // activating a button. Note this does not release a Pause. - // Annex J: Still_Off - HRESULT StillOff(); - - // Pause - // Freezes / unfreezes playback and any internal timers. This is similar to - // IMediaControl::Pause(), but not the same in effect as IMediaControl::Pause - // puts the filter (all filters, if done to the graph) in paused state. - // Annex J: Pause_On and Pause_Off - // bState is TRUE or FALSE to indicate whether to do Puase_on/Pause_Off according - // to Annex J terminology. - HRESULT Pause - ( [in] BOOL bState - ); - - // SelectAudioStream - // Changes the current audio stream to ulAudio. - // Annex J: Audio_Stream_Change - // Audio stream number ranges between 0 and 7 or DEFAULT_AUDIO_STREAM (15 - default based on default language & language extension) - HRESULT SelectAudioStream - ( [in] ULONG ulAudio, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - - ); - - // SelectSubpictureStream - // Changes the current subpicture stream number to ulSubPicture - // Annex J: Sub-picture_Stream_Change (first param) - // Subpicture stream number should be between 0 and 31 or 63. - HRESULT SelectSubpictureStream - ( [in] ULONG ulSubPicture, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - - ); - - // SetSubpictureState - // Turns on/off current subpicture stream display. - // Annex J: Sub-picture_Stream_Change (second param) - // Subpicture state is On or Off (TRUE or FALSE) - HRESULT SetSubpictureState - ( [in] BOOL bState, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // SelectAngle - // Changes the current angle number. - // Annex J: Angle_Change - // Angle number is between 1 and 9. - HRESULT SelectAngle - ( [in] ULONG ulAngle, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // SelectParentalLevel - // Selects the current player parental level. - // Annex J: Parental_Level_Select - // Parental level ranges between 1 and 8. - // The defined parental levels are listed below : - // - // Level Rating - // ----- ------ - // 1 G - // 3 PG - // 4 PG13 - // 6 R - // 7 NC17 - // Higher levels can play lower level content; lower levels cannot play - // higher level content. The DVD Navigator provides no restriction on - // setting the parental level. DVD player application may enforce - // restriction on parental level setting, such as password protection for - // raising the current parental level. Parental Management is disabled in - // the Navigator by default. - // - // Note : To disable parental management, pass 0xffffffff for ulParentalLevel - // If parental management is disabled, then the player will play the - // first PGC in a parental block regardless of parental IDs. - // - HRESULT SelectParentalLevel - ( [in] ULONG ulParentalLevel - ); - - // SelectParentalCountry - // Sets the country in which to interpret the Parental Level. - // Annex J: Parental_Country_Select - // The country specified using the Alpha-2 code of the ISO-3166 standard, - HRESULT SelectParentalCountry - ( [in] BYTE bCountry[2] - ); - - // SelectKaraokeAudioPresentationMode - // Sets the Karaoke audio mode. - // Annex J: Karaoke_Audio_Presentation_Mode_Change - // NOTE: This and all other Karoke support is currently not implemented. - // Mode represents the audio mixing mode for Karaoke (same info as SPRM11). - // Use a bitwise OR of the bits in DVD_KARAOKE_DOWNMIX - HRESULT SelectKaraokeAudioPresentationMode - ( [in] ULONG ulMode - ); - - // SelectVideoModePreference - // The user can specify the (initial) preferred display mode (aspect ratio) - // (wide / letterbox / pan-scan) that should be used to display content - // (16 : 9). - // Annex J: Video_Presentation_Mode_Change - // The parameter is a ULONG that has one of the values defined in - // DVD_PREFERRED_DISPLAY_MODE - HRESULT SelectVideoModePreference - ( [in] ULONG ulPreferredDisplayMode - ); - - // SetDVDDirectory - // Sets the root directory containing the DVD-Video volume. - // Can only be called from the DVD Stop State (DVD_DOMAIN_Stop). - // If the root directory is not successfully set before - // IMediaControl::Play is called, the first drive starting from c: - // containing a VIDEO_TS directory in the top level directory - // will be used as the root. - HRESULT SetDVDDirectory - ( [in] LPCWSTR pszwPath - ); - - // ActivateAtPosition - // This is typically called in response to a mouse click. - // The specified point within the display window is to see if it is - // within a current DVD button's highlight rect. If it is, that - // button is first selected, then activated. - // NOTE: DVD Buttons do not all necessarily have highlight rects, - // button rects can overlap, and button rects do not always - // correspond to the visual representation of DVD buttons. - HRESULT ActivateAtPosition // typically called after a mouse click - ( [in] POINT point - ); - - // SelectAtPosition - // This is typically called in response to a mouse move within the - // display window. - // The specified point within the display window is to see if it is - // within a current DVD button's highlight rect. If it is, that - // button is selected. - // NOTE: DVD Buttons do not all necessarily have highlight rects, - // button rects can overlap, and button rects do not always - // correspond to the visual representation of DVD buttons. - HRESULT SelectAtPosition // typically called after a mouse move - ( [in] POINT point - ); - - // PlayChaptersAutoStop - // Start playing at the specified chapter within the specified title - // and play the number of chapters specified by the third parameter. - // Then the playback stops by sending an event EC_DVD_CHAPTER_AUTOSTOP. - // Title ranges from 1 to 99. - // Chapter (and number of chapters to play) ranges from 1 to 999. - HRESULT PlayChaptersAutoStop - ( [in] ULONG ulTitle, // title number - [in] ULONG ulChapter, // chapter number to start playback - [in] ULONG ulChaptersToPlay, // number of chapters to play from the start chapter - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // AcceptParentalLevelChange - // - // Application's way of informing the Navigator that the required parental - // level change indicated through a previous event was accepted or rejected - // by the app (and unblock the Navigator). - // - // FALSE - reject the disc's request to change the current parental level. - // TRUE - change the parental level as required by the disc. - HRESULT AcceptParentalLevelChange - ( [in] BOOL bAccept - ); - - // SetOption(flag, true/false ) - // Flags: - // - // DVD_ResetOnStop - // Disable reset of the Navigator's internal state on the - // subsequent IMediaControl::Stop() call(s). - // - // FALSE - Navigator does not reset its state on the subsequent Stop calls - // (play from the current location on next Run call). - // TRUE - (default) Navigator resets its state on the subsequent Stop call - // (play from the first play PGC on the Run call after the Stop). - // - // DVD_NotifyParentalLevelChange - // - // Allows the application to indicate to the Navigator that it wants to control - // parent level change (e.g., through a dialog box) and indicate the acceptance - // or rejection of the new parental level to the Navigator through - // AcceptParentalLevelChange(). - // - // FALSE - disable (default). Always reject request by the disc to change parental level. - // TRUE - enable. Navigator will send the app a 'EC_DVD_PARENTAL_LEVEL_CHANGE' event - // and block until AcceptParentalLevelChange() is called by the app. - // - // DVD_HMSF_TimeCodeEvents - // - // Lets the application specify to the Navigator if it wants to get the new time - // event EC_DVD_CURRENT_HMSF_TIME with the HMSF format rather than the older - // EC_DVD_CURRENT_TIME events. - // - // FALSE - disable (default). Older EC_DVD_CURRENT_TIME events are returned. - // TRUE - enable. Navigator will send the app EC_DVD_CURRENT_HMSF_TIME events. - - HRESULT SetOption - ( [in] DVD_OPTION_FLAG flag, - [in] BOOL fState - ); - - // SetState - // - // The navigator will use the location information in the given state object to restore - // the navigator's position to a specific location on the disc. - // A valid state object is returned by either calling GetState(), or by using - // "CoCreateInstance( CLSID_DVDState, NULL, CLSCTX_INPROC_SERVER, IID_IDvdState, (void **) ppState )" - // to create a state object, followed by pState->IPersist::Load() to read it from memory or disk. - // - HRESULT SetState - ( [in] IDvdState* pState, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - - ); - - // PlayPeriodInTitleAutoStop - // - // Start playing from the specified time within the specified title number until the specified end time. - // NOTE: the actual start and end times will be the closest sync points before - // or equal to the specified frame number. - // Annex J: Time_Play for a limited range - // Title numbers range between 1 and 99. - HRESULT PlayPeriodInTitleAutoStop - ( [in] ULONG ulTitle, - [in] DVD_HMSF_TIMECODE* pStartTime, - [in] DVD_HMSF_TIMECODE* pEndTime, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // SetGPRM - // Sets the current contents of a DVD General Parameter Register. - // Use of GPRMs is title specific. - - HRESULT SetGPRM - ( [in] ULONG ulIndex, - [in] WORD wValue, - [in] DWORD dwFlags, - [out] IDvdCmd** ppCmd - ); - - // SelectDefaultMenuLanguage - // Selects the default language for menus. - // Languages are specified with Windows standard LCIDs. LCIDs can be created - // from ISO-639 codes with - // MAKELCID( MAKELANGID(wISO639LangID ,SUBLANG_DEFAULT ), SORT_DEFAULT ). - // SelectMenuLanguage may only called from the DVD Stop state (DVD_DOMAIN_Stop). - // Annex J: Menu_Language_Select - // - // NOT TRUE ANYMORE: - // NOTE: MAKELANGID seems to have a bug so 'jp' may have to be used - // instead of 'ja' for the ISO639 code for Japanese. - HRESULT SelectDefaultMenuLanguage - ( [in] LCID Language - ); - - // SelectDefaultAudioLanguage - // Selects the default audio language. - // Languages are specified with Windows standard LCIDs. - HRESULT SelectDefaultAudioLanguage - ( [in] LCID Language, - [in] DVD_AUDIO_LANG_EXT audioExtension - ); - - // SelectDefaultSubpictureLanguage - // Selects the default subpicture language. - // Languages are specified with Windows standard LCIDs. - HRESULT SelectDefaultSubpictureLanguage - ( [in] LCID Language, - [in] DVD_SUBPICTURE_LANG_EXT subpictureExtension - ); -} - - -//========================================================================== -//========================================================================== -// IDvdInfo2 interface -- allows an app to query for attributes of available -// DVD titles and DVD player status. Also allows for control of a DVD -// player beyond Annex J in the DVD spec. -//========================================================================== -//========================================================================== - -enum DVD_TextStringType { - // disc structure (0x00..0x0f) - DVD_Struct_Volume = 0x01, - DVD_Struct_Title = 0x02, - DVD_Struct_ParentalID = 0x03, - DVD_Struct_PartOfTitle = 0x04, - DVD_Struct_Cell = 0x05, - // stream (0x10..0x1f) - DVD_Stream_Audio = 0x10, - DVD_Stream_Subpicture = 0x11, - DVD_Stream_Angle = 0x12, - // channel in stream (0x20..0x2f) - DVD_Channel_Audio = 0x20, - - // Application information - // General (0x30..0x37) - DVD_General_Name = 0x30, - DVD_General_Comments = 0x31, - - // Title (0x38..0x3f) - DVD_Title_Series = 0x38, - DVD_Title_Movie = 0x39, - DVD_Title_Video = 0x3a, - DVD_Title_Album = 0x3b, - DVD_Title_Song = 0x3c, - DVD_Title_Other = 0x3f, - - // Title (sub) (0x40..0x47) - DVD_Title_Sub_Series = 0x40, - DVD_Title_Sub_Movie = 0x41, - DVD_Title_Sub_Video = 0x42, - DVD_Title_Sub_Album = 0x43, - DVD_Title_Sub_Song = 0x44, - DVD_Title_Sub_Other = 0x47, - - // Title (original) (0x48..0x4f) - DVD_Title_Orig_Series = 0x48, - DVD_Title_Orig_Movie = 0x49, - DVD_Title_Orig_Video = 0x4a, - DVD_Title_Orig_Album = 0x4b, - DVD_Title_Orig_Song = 0x4c, - DVD_Title_Orig_Other = 0x4f, - - // Other info (0x50..0x57) - DVD_Other_Scene = 0x50, - DVD_Other_Cut = 0x51, - DVD_Other_Take = 0x52, - - // Language 0x58..0x5b - // Work 0x5c..0x6b - // Character 0x6c..0x8f - // Data 0x90..0x93 - // Karaoke 0x94..0x9b - // Category 0x9c..0x9f - // Lyrics 0xa0..0xa3 - // Document 0xa4..0xa7 - // Others 0xa8..0xab - // Reserved 0xac..0xaf - // Admin 0xb0..0xb7 - // more admin 0xb8..0xc0 - // Reserved 0xd0..0xdf - // vendor 0xe0..0xef - // extension 0xf0..0xf7 - // reserved 0xf8..0xff -}; - -enum DVD_TextCharSet { - DVD_CharSet_Unicode = 0, - DVD_CharSet_ISO646 = 1, - DVD_CharSet_JIS_Roman_Kanji = 2, - DVD_CharSet_ISO8859_1 = 3, - DVD_CharSet_ShiftJIS_Kanji_Roman_Katakana = 4 -}; - -cpp_quote ("#define DVD_TITLE_MENU 0x000") -cpp_quote ("#define DVD_STREAM_DATA_CURRENT 0x800") -cpp_quote ("#define DVD_STREAM_DATA_VMGM 0x400") -cpp_quote ("#define DVD_STREAM_DATA_VTSM 0x401") -cpp_quote ("#define DVD_DEFAULT_AUDIO_STREAM 0x0f") - -// DVD Decoder Caps data -typedef struct tagDVD_DECODER_CAPS -{ - DWORD dwSize ; // size of this struct - DWORD dwAudioCaps ; // bits indicating audio support (AC3, DTS, SDDS, LPCM etc.) of decoder - double dFwdMaxRateVideo ; // max data rate for video going forward - double dFwdMaxRateAudio ; // ... .. .. ... audio ... ... - double dFwdMaxRateSP ; // ... .. .. ... SP ... ... - double dBwdMaxRateVideo ; // if smooth reverse is not available, this will be set to 0 - double dBwdMaxRateAudio ; // -- ditto -- - double dBwdMaxRateSP ; // -- ditto -- - DWORD dwRes1 ; // reserved for future expansion - DWORD dwRes2 ; // -- ditto -- - DWORD dwRes3 ; // -- ditto -- - DWORD dwRes4 ; // -- ditto -- -} DVD_DECODER_CAPS ; - -// Bits for decoder's audio format support -cpp_quote ("#define DVD_AUDIO_CAPS_AC3 0x00000001") -cpp_quote ("#define DVD_AUDIO_CAPS_MPEG2 0x00000002") -cpp_quote ("#define DVD_AUDIO_CAPS_LPCM 0x00000004") -cpp_quote ("#define DVD_AUDIO_CAPS_DTS 0x00000008") -cpp_quote ("#define DVD_AUDIO_CAPS_SDDS 0x00000010") - - -[ -object, -uuid(34151510-EEC0-11D2-8201-00A0C9D74842), -pointer_default(unique) -] - -interface IDvdInfo2 : IUnknown { - import "unknwn.idl"; - - // GetCurrentDomain - // Returns the current DVD Domain of the DVD player. - HRESULT GetCurrentDomain - ( [out] DVD_DOMAIN *pDomain - ); - - // GetCurrentLocation - // Returns information sufficient to restart playback of a video - // from the current playback location in titles that don't explicitly - // disable seeking to the current location. - HRESULT GetCurrentLocation - ( [out] DVD_PLAYBACK_LOCATION2 *pLocation - ); - - // GetTotalTitleTime - // Returns the total playback time for the current title. Only works - // for One_Sequential_PGC_Titles. - // THIS SHOULD CHANGE, RIGHT? - HRESULT GetTotalTitleTime - ( [out] DVD_HMSF_TIMECODE* pTotalTime, - [out] ULONG* ulTimeCodeFlags // union of DVD_TIMECODE_FLAGS - ); - - // GetCurrentButton - // Indicates the number of currently available buttons and the current - // selected button number. If buttons are not present it returns 0 for - // both pulButtonsAvailable and pulCurrentButton - HRESULT GetCurrentButton - ( [out] ULONG * pulButtonsAvailable, - [out] ULONG * pulCurrentButton - ); - - // GetCurrentAngle - // Indicates the number of currently available angles and the current - // selected angle number. If *pulAnglesAvailable is returned as 1 then - // the current content is not multiangle. - HRESULT GetCurrentAngle - ( [out] ULONG * pulAnglesAvailable, - [out] ULONG * pulCurrentAngle - ); - - // GetCurrentAudio - // Indicates the number of currently available audio streams and - // the currently selected audio stream number. - // This only works inside the Title domain. - HRESULT GetCurrentAudio - ( [out] ULONG * pulStreamsAvailable, - [out] ULONG * pulCurrentStream - ); - - // GetCurrentSubpicture - // Indicates the number of currently available subpicture streams, - // the currently selected subpicture stream number, and if the - // subpicture display is currently disabled. Subpicture streams - // authored as "Forcedly Activated" stream will be displayed even if - // subpicture display has been disabled by the app with - // IDVDControl::SetSubpictureState. - // This only works inside the Title domain. - HRESULT GetCurrentSubpicture - ( [out] ULONG * pulStreamsAvailable, - [out] ULONG * pulCurrentStream, - [out] BOOL * pbIsDisabled - ); - - // GetCurrentUOPS - // Indicates which IDVDControl methods (Annex J user operations) are - // currently valid. DVD titles can enable or disable individual user - // operations at almost any point during playback. - HRESULT GetCurrentUOPS - ( [out] ULONG * pulUOPs - ); - - // GetAllSPRMs - // Returns the current contents of all DVD System Parameter Registers. - // See DVD-Video spec for use of individual registers. - // WE SHOULD DOC THE SPRMs RATHER THAN ASKING TO REFER TO DVD SPEC. - HRESULT GetAllSPRMs - ( [out] SPRMARRAY * pRegisterArray - ); - - // GetAllGPRMs - // Returns the current contents of all DVD General Parameter Registers. - // Use of GPRMs is title specific. - // WE SHOULD DOC THE GPRMs RATHER THAN ASKING TO REFER TO DVD SPEC. - HRESULT GetAllGPRMs - ( [out] GPRMARRAY * pRegisterArray - ); - - // GetAudioLanguage - // Returns the language of the specified stream within the current title. - // Does not return languages for menus. Returns *pLanguage as 0 if the - // stream does not include language. - // Use Win32 API GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize) - // to create a human readable string name from the returned LCID. - HRESULT GetAudioLanguage - ( [in] ULONG ulStream, - [out] LCID * pLanguage - ); - - // GetSubpictureLanguage - // Returns the language of the specified stream within the current title. - // Does not return languages for menus. Returns *pLanguage=0 as 0 if the - // stream does not include language. - // Use Win32 API GetLocaleInfo(*pLanguage, LOCALE_SENGLANGUAGE, pszString, cbSize) - // to create a human readable string name from the returned LCID. - HRESULT GetSubpictureLanguage - ( [in] ULONG ulStream, - [out] LCID * pLanguage - ); - - // GetTitleAttributes - // Returns attributes of all video, audio, and subpicture streams for the - // specified title including menus. - // If 0xffffffff is specified as ulTitle, attributes for the current title - // are returned. - HRESULT GetTitleAttributes - ( [in] ULONG ulTitle, // requested title number - [out] DVD_MenuAttributes * pMenu, - [out] DVD_TitleAttributes * pTitle - ); - - // GetVMGAttributes - // Returns attributes of all video, audio, and subpicture - // streams for Video Manager Menus. This method suppliments GetTitleAttributes() - // for some menus, such as the Title menu, which are in a separate group of - // streams called the VMG (Video Manager) and are not associated with any - // particular title number. - HRESULT GetVMGAttributes - ( [out] DVD_MenuAttributes* pATR - ); - - // GetCurrentVideoAttributes - // Returns the video attributes for the current title or menu. - // - HRESULT GetCurrentVideoAttributes - ( [out] DVD_VideoAttributes * pATR - ); - - // GetAudioAttributes - // Returns the audio attributes for the specified stream in the current title - // or menu. - HRESULT GetAudioAttributes - ( [in] ULONG ulStream, - [out] DVD_AudioAttributes *pATR - ); - - // GetKaraokeChannelContents - // Returns the karaoke contents of each channel of the specified stream in the current title - // or menu. - HRESULT GetKaraokeAttributes - ( [in] ULONG ulStream, - [out] DVD_KaraokeAttributes* pAttributes - ); - - // GetSubpictureAttributes - // Returns the subpicture attributes for the specified stream in the current - // title or menu. - HRESULT GetSubpictureAttributes - ( [in] ULONG ulStream, - [out] DVD_SubpictureAttributes *pATR - ); - - // GetDVDVolumeInfo - // Returns current DVD volume information. - HRESULT GetDVDVolumeInfo - ( [out] ULONG *pulNumOfVolumes, // number of volumes (disc sides?) in a volume set - [out] ULONG *pulVolume, // volume number for current DVD directory - [out] DVD_DISC_SIDE *pSide, // current disc side - [out] ULONG *pulNumOfTitles // number of titles available in this volume - ); - - // GetDVDTextNumberOfLanguages - // Returns the number of text languages for the current DVD directory. - // Should return some error code if no root directory is found. - HRESULT GetDVDTextNumberOfLanguages - ( [out] ULONG * pulNumOfLangs - ); - - // GetDVDTextLanguageInfo - // Returns the text languages information (number of strings, language code, - // char set) for the specified language index. - // Should return some error code if an invalid text index is specified. - HRESULT GetDVDTextLanguageInfo - ( [in] ULONG ulLangIndex, - [out] ULONG* pulNumOfStrings, - [out] LCID* pLangCode, - [out] enum DVD_TextCharSet * pbCharacterSet - ); - - // GetDVDTextStringAsNative - // Returns the text string as an array of bytes for the specified language - // index.and string index. - // Should return some error code if an invalid text or string index is specified. - // It also just returns the length of the string if pchBuffer is specified as NULL. - HRESULT GetDVDTextStringAsNative - ( [in] ULONG ulLangIndex, - [in] ULONG ulStringIndex, - [out] BYTE* pbBuffer, - [in] ULONG ulMaxBufferSize, - [out] ULONG* pulActualSize, - [out] enum DVD_TextStringType* pType - ); - - // GetDVDTextStringAsUnicode - // Returns the text string in Unicode for the specified language index.and string index. - // Should return some error code if an invalid text or string index is specified. - // It also just returns the length of the string if pchBuffer is specified as NULL. - HRESULT GetDVDTextStringAsUnicode - ( [in] ULONG ulLangIndex, - [in] ULONG ulStringIndex, - [out] WCHAR* pchwBuffer, - [in] ULONG ulMaxBufferSize, - [out] ULONG* pulActualSize, - [out] enum DVD_TextStringType* pType - ); - - // GetPlayerParentalLevel - // Returns the current parental level and the current country code that has - // been set in the system registers in player. - // See Table 3.3.4-1 of the DVD-Video spec for the defined parental levels. - // Valid Parental Levels range from 1 to 8 if parental management is enabled. - // Returns 0xffffffff if parental management is disabled - // See ISO3166 : Alpha-2 Code for the country codes. - HRESULT GetPlayerParentalLevel - ( [out] ULONG *pulParentalLevel, // current parental level - [out] BYTE pbCountryCode[2] // current country code - ); - - // GetNumberOfChapters - // Returns the number of chapters that are defined for a - // given title. - HRESULT GetNumberOfChapters - ( [in] ULONG ulTitle, // Title for which number of chapters is requested - [out] ULONG *pulNumOfChapters // Number of chapters for the specified title - ); - - // GetTitleParentalLevels - // Returns the parental levels that are defined for a particular title. - // pulParentalLevels will be combination of DVD_PARENTAL_LEVEL_8, - // DVD_PARENTAL_LEVEL_6, or DVD_PARENTAL_LEVEL_1 OR-ed together - HRESULT GetTitleParentalLevels - ( [in] ULONG ulTitle, // Title for which parental levels are requested - [out] ULONG *pulParentalLevels // Parental levels defined for the title "OR"ed together - ); - - // GetDVDDirectory - // Returns the root directory that is set in the player. If a valid root - // has been found, it returns the root string. Otherwise, it returns 0 for - // pcbActualSize indicating that a valid root directory has not been found - // or initialized. - // - // !!! used to return LPTSTR. interface was changed to return - // LPSTR (ansi) for compatibility. COM APIs should pass with - // UNICODE strings only. - // - HRESULT GetDVDDirectory - ( [out, size_is(ulMaxSize)] LPWSTR pszwPath, // pointer to buffer to get root string - [in] ULONG ulMaxSize, // size of buffer in WCHARs passed in - [out] ULONG *pulActualSize // size of actual data returned (in WCHARs) - ); - - - // IsAudioStreamEnabled - // - // Determines if the specified audio stream is enabled/disabled in the current PGC. - // - // ulStreamNum - audio stream number to test - // pbEnabled - where to place the result - HRESULT IsAudioStreamEnabled - ( [in] ULONG ulStreamNum, // stream number to test - [out] BOOL *pbEnabled // returned state - ); - - // GetDiscID - // - // If pszwPath is specified as NULL, DVD Navigator will use the current path - // that would be returned by GetDVDDirectory() at this point. - // - // Returns a 64-bit identification number for the specified DVD disc. - HRESULT GetDiscID - ( [in] LPCWSTR pszwPath, // root path (should we rather use const WCHAR*?) - [out] ULONGLONG* pullDiscID // 64-bit unique id for the disc - ) ; - - // GetState - // - // The navigator will create a new state object and save the current location into it. - // The state object can be used to restore the navigator the saved location at a later time. - // A new IDvdState object is created (with a single AddRef) and returned in *pStateData. - // The object must be Released() when the application is finished with it. - // - HRESULT GetState - ( [out] IDvdState **pStateData // returned object - ); - - // - // GetMenuLanguages - // - // Navigator gets all of the menu languages for the VMGM and VTSM domains. - // - HRESULT GetMenuLanguages - ( [out] LCID *pLanguages, // data buffer (NULL returns #languages) - [in] ULONG ulMaxLanguages, // maxiumum number of languages to retrieve - [out] ULONG *pulActualLanguages // actual number of languages retrieved - ); - - // - // GetButtonAtPosition - // - // This is typically called in response to a mouse move within the - // display window. - // It returns the button located at the specified point within the display window. - // If no button is present at that position, then VFW_E_DVD_NO_BUTTON is returned. - // Button indices start at 1. - // - // NOTE: DVD Buttons do not all necessarily have highlight rects, - // button rects can overlap, and button rects do not always - // correspond to the visual representation of DVD buttons. - HRESULT GetButtonAtPosition // typically called after a mouse move - ( [in] POINT point, - [out] ULONG *pulButtonIndex - ); - - // - // GetCmdFromEvent - // - // This method maps an EC_DVD_CMD_BEGIN/COMPLETE/CANCEL event's lParam1 into an AddRef'd - // IDvdCmd pointer. You must Release the returned pointer. NULL is returned if the function - // fails. - // - HRESULT GetCmdFromEvent - ( [in] LONG_PTR lParam1, - [out] IDvdCmd **pCmdObj - ); - - // GetDefaultMenuLanguage - // Returns the default language for menus. - HRESULT GetDefaultMenuLanguage - ( [out] LCID * pLanguage - ); - - // GetDefaultAudioLanguage - // Gets the default audio language. - // Languages are specified with Windows standard LCIDs. - HRESULT GetDefaultAudioLanguage - ( [out] LCID* pLanguage, - [out] DVD_AUDIO_LANG_EXT* pAudioExtension - ); - - // GetDefaultSubpictureLanguage - // Gets the default subpicture language. - // Languages are specified with Windows standard LCIDs. - HRESULT GetDefaultSubpictureLanguage - ( [out] LCID* pLanguage, - [out] DVD_SUBPICTURE_LANG_EXT* pSubpictureExtension - ); - - // - // GetDecoderCaps: - // Retrieves the DVD decoder's details about max data rate for video, audio - // and subpicture (going backward and forward) as well as support for various - // types of audio (AC3, MPEG2, DTS, SDDS, LPCM). - // - HRESULT GetDecoderCaps - ( [out] DVD_DECODER_CAPS *pCaps - ) ; - - // - // GetButtonRect: - // Retrieves the coordinates for a given button number - // - HRESULT GetButtonRect - ( [in] ULONG ulButton, - [out] RECT *pRect - ) ; - - // IsSubpictureStreamEnabled - // - // Determines if the specified subpicture stream is enabled/disabled in the current PGC. - // - // ulStreamNum - Subpicture stream number to test - // pbEnabled - where to place the result - HRESULT IsSubpictureStreamEnabled - ( [in] ULONG ulStreamNum, // stream number to test - [out] BOOL *pbEnabled // returned state - ); -} - - - -//========================================================================== -//========================================================================== -// -// typedefs used by IDvdGraphBuilder interface. -// -//========================================================================== -//========================================================================== - -typedef enum _AM_DVD_GRAPH_FLAGS { - AM_DVD_HWDEC_PREFER = 0x01, // default - AM_DVD_HWDEC_ONLY = 0x02, - AM_DVD_SWDEC_PREFER = 0x04, - AM_DVD_SWDEC_ONLY = 0x08, - AM_DVD_NOVPE = 0x100 -} AM_DVD_GRAPH_FLAGS ; - -typedef enum _AM_DVD_STREAM_FLAGS { - AM_DVD_STREAM_VIDEO = 0x01, - AM_DVD_STREAM_AUDIO = 0x02, - AM_DVD_STREAM_SUBPIC = 0x04 -} AM_DVD_STREAM_FLAGS ; - -typedef struct { - HRESULT hrVPEStatus ; // VPE mixing error code (0 => success) - BOOL bDvdVolInvalid ; // Is specified DVD volume invalid? - BOOL bDvdVolUnknown ; // Is DVD volume to be played not specified/not found? - BOOL bNoLine21In ; // video decoder doesn't produce line21 (CC) data - BOOL bNoLine21Out ; // can't show decoded line21 data as CC on video - int iNumStreams ; // number of DVD streams to render - int iNumStreamsFailed ; // number of streams failed to render - DWORD dwFailedStreamsFlag ; // combination of flags to indicate failed streams -} AM_DVD_RENDERSTATUS ; - - -// -// IDvdGraphBuilder interface to build a filter graph for DVD-Video playback. -// - -[ - object, - local, - uuid(FCC152B6-F372-11d0-8E00-00C04FD7C08B), - pointer_default(unique) -] -interface IDvdGraphBuilder : IUnknown { - - // Returns the IGraphBuilder interface for the filtergraph used by the - // CDvdGraphBuilder object. - // Remember to *ppGB->Release() when you're done with it - HRESULT GetFiltergraph - ( [out] IGraphBuilder **ppGB - ) ; - - // Gets specific interface pointers in the DVD-Video playback graph to - // make DVD-Video playback development easier. - // It helps get the following interfaces to control playback/show CC/ - // position window/control volume etc: - // - IDvdControl, IDvdInfo - // - IAMLine21Decoder - // - IVideoWindow, IBasicVideo - // - IBasicAudio - // This method will return - // a) E_INVALIDARG if ppvIF is invalid - // b) E_NOINTERFACE if riid is an IID we don't know about - // c) VFW_E_DVD_GRAPHNOTREADY if the graph has not been built through - // RenderDvdVideoVolume() yet. - // Remember to *ppvIF->Release() when you're done with it - HRESULT GetDvdInterface - ( [in] REFIID riid, // IID of the interface required - [out] void **ppvIF // returns pointer to the required interface - ) ; - - // Builds a filter graph according to user specs for playing back a - // DVD-Video volume. - // This method returns S_FALSE if - // 1. the graph has been either built, but either - // a) VPE mixing doesn't work (app didn't use AM_DVD_NOVPE flag) - // b) video decoder doesn't produce line21 data - // c) line21 data couldn't be rendered (decoding/mixing problem) - // d) the call specified an invalid volume path or DVD Nav couldn't - // locate any DVD-Video volume to be played. - // 2. some streams didn't render (completely), but the others have - // been rendered so that the volume can be partially played back. - // The status is indicated through the fields of the pStatus (out) - // parameter. - // About 1(a), the app will have enough info to tell the user that the - // video won't be visible unless a TV is connected to the NTSC out - // port of the DVD decoder (presumably HW in this case). - // For case 1(b) & (c), the app "can" put up a warning/informative message - // that closed captioning is not available because of the decoder. - // 1(d) helps an app to ask the user to insert a DVD-Video disc if none - // is specified/available in the drive when playback is started. - // This method builds the graph even if - // - an invalid DVD-Video volume is specified - // - the caller uses lpwszPathName = NULL to make the DVD Nav to locate - // the default volume to be played back, but DVD Nav doesn't find a - // default DVD-Video volume to be played back. - // An app can later specify the volume using IDvdControl::SetRoot() - // method. - // #2 will help the app indicate to the user that some of the streams - // can't be played. - // - // The graph is built using filters based on the dwFlags value (to use - // HW decoders or SW decoders or a mix of them). - // The dwFlags value is one of the values in AM_DVD_GRAPH_FLAGS enum - // type. The default value is AM_DVD_HWDEC_PREFER. None of the - // AM_DVD_HWDEC_xxx or AM_DVD_SWDEC_xxx flags can be mixed. However - // AM_DVD_NOVPE can be OR-ed with any of the AM_DVD_HWDEC_xxx flags. - // - // The method returns S_OK if the playback graph is built successfully - // with all the streams completely rendered and a valid DVD-Video volume - // is specified or a default one has been located. - // - // If the dwFlags specify conflicting options, E_INVALIDARG is returned. - // If the graph building fails, the method returns one of the following - // error codes: - // VFW_E_DVD_RENDERFAIL, VFW_E_DVD_DECNOTENOUGH - // - HRESULT RenderDvdVideoVolume - ( [in] LPCWSTR lpcwszPathName, // Can be NULL too - [in] DWORD dwFlags, // 0 is the default (use max HW) - [out] AM_DVD_RENDERSTATUS *pStatus // returns indications of ANY failure - ) ; -} - - -// -// DDraw Exclusive Mode Video standard COM interface for Overlay Mixer -// -[ - object, - local, - uuid(153ACC21-D83B-11d1-82BF-00A0C9696C8F), - pointer_default(unique) -] -interface IDDrawExclModeVideo : IUnknown { - // set a ddraw object to be used by the overlay mixer. If even one of the pins - // of the ovmixer is connected, then it won't start using the new ddraw obect - // immediately but just cache it. It will start using it the next time, all its - // pins are disconnected. - HRESULT SetDDrawObject([in] IDirectDraw *pDDrawObject); - - // gets the ddraw object currently being used by the overlay mixer. If the app has not - // set any ddraw object and the ovmixer has not yet allocated one, then *ppDDrawObject - // will be set to NULL and *pbUsingExternal will be set TO FALSE. Otherwise *pbUsingExternal - // will be set to TRUE if the ovmixer is currently USING an app given ddraw object and FALSE - // othewise - HRESULT GetDDrawObject([out] IDirectDraw **ppDDrawObject, - [out] BOOL *pbUsingExternal); - - // set a primary surface to be used by the overlay mixer. If even one of the pins - // of the ovmixer is connected, then it won't start using the new primary surface - // immediately but just cache it. It will start using it the next time, all its - // pins are disconnected. - // Also when the ovmixer does start using an app given primary surface, it will delete - // its output pin (and not draw its own colorkey) since the app is expected to do the - // window management and drawing colorkey etc on the primary surface - // This function makes sure that the surface provided exposes IDirectDrawSurface3, and - // is consistent with the ddraw object provided. - HRESULT SetDDrawSurface([in] IDirectDrawSurface *pDDrawSurface); - - // gets the ddraw surface currently being used by the overlay mixer. If the app has not - // set any ddraw surface and the ovmixer has not yet allocated one, then *ppDDrawSurface - // will be set to NULL and *pbUsingExternal will be set to FALSE. Otherwise *pbUsingExternal - // will be set to TRUE if the ovmixer is curretnly USING an app given ddraw surface and FALSE - // otherwise - HRESULT GetDDrawSurface([out] IDirectDrawSurface **ppDDrawSurface, - [out] BOOL *pbUsingExternal); - - // set draw paramters on the ovmixer (src and dest rect). Note that if the mode - // of the ovmixer is set to LETTER_BOX, then the ovmixer might show the video in - // only a subrect of *prcTarget (see IMixerPinConfig for details). - HRESULT SetDrawParameters([in] const RECT * prcSource, - [in] const RECT * prcTarget); - - // gets the current video size and picture aspect ratio of the primary stream of the overlay mixer - // The app should look for the evene EC_VIDEO_SIZE_AR_CHANGED and on its receipt - // call this function again - HRESULT GetNativeVideoProps([out] DWORD *pdwVideoWidth, - [out] DWORD *pdwVideoHeight, - [out] DWORD *pdwPictAspectRatioX, - [out] DWORD *pdwPictAspectRatioY); - - // Set the callback interface - the callback interface will be defined in a later release - // Currently returns E_NOTIMPL - HRESULT SetCallbackInterface([in] IDDrawExclModeVideoCallback *pCallback, - [in] DWORD dwFlags); -} - - -// -// DDraw Exclusive Mode Video callbacks -// - -// enum for flags -enum _AM_OVERLAY_NOTIFY_FLAGS { - AM_OVERLAY_NOTIFY_VISIBLE_CHANGE = 0x00000001, - AM_OVERLAY_NOTIFY_SOURCE_CHANGE = 0x00000002, - AM_OVERLAY_NOTIFY_DEST_CHANGE = 0x00000004 -}; -[ - object, - local, - uuid(913c24a0-20ab-11d2-9038-00a0c9697298), - pointer_default(unique) -] -interface IDDrawExclModeVideoCallback : IUnknown { - - // Called once before UpdateOverlay is called with bBefore == TRUE - // and once after it is called with bBefore == FALSE and otherwise - // identical parameters - HRESULT OnUpdateOverlay( - [in] BOOL bBefore, // After UpdateOverlayCalled? - [in] DWORD dwFlags,// _AM_OVERLAY_NOTIFY enum - [in] BOOL bOldVisible, - [in] const RECT *prcOldSrc, - [in] const RECT *prcOldDest, - [in] BOOL bNewVisible, - [in] const RECT *prcNewSrc, - [in] const RECT *prcNewDest); - - // Called when the surface color key is changed - HRESULT OnUpdateColorKey( - [in] const COLORKEY *pKey, - [in] DWORD dwColor); - - // Called when the video size or aspect ratio changes - HRESULT OnUpdateSize( [in] DWORD dwWidth, // Movie pixel width - [in] DWORD dwHeight, // Movie pixel height - [in] DWORD dwARWidth, // Aspect ratio horizontal - [in] DWORD dwARHeight); // Aspect ratio vertical -} diff --git a/import/DirectX8/include/DShowIDL/dxtrans.idl b/import/DirectX8/include/DShowIDL/dxtrans.idl deleted file mode 100644 index dd917f499..000000000 --- a/import/DirectX8/include/DShowIDL/dxtrans.idl +++ /dev/null @@ -1,2322 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright Microsoft Corporation 1997-2001 -// All rights reserved. -// -// File: dxtrans.idl -// -// Overview: -// This is the IDL file for DirectX installable transform coclass, -// interface, and type definitions. -// -//------------------------------------------------------------------------------ - -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") -cpp_quote("#include ") - -//--- Import base idl -import "oaidl.idl"; -import "ocidl.idl"; -import "servprov.idl"; -import "comcat.idl"; - -// -// Since direct draw does not have an IDL, we'll define DDSURFACEDESC to -// be a void, but include ddraw.h in the header file. This makes MIDL happy. -// -#ifndef DDSURFACEDESC -cpp_quote("#if 0") -cpp_quote("// Bogus definition used to make MIDL compiler happy") -typedef void DDSURFACEDESC; -typedef void D3DRMBOX; -typedef void D3DVECTOR; -typedef void D3DRMMATRIX4D; -typedef void* LPSECURITY_ATTRIBUTES; -cpp_quote("#endif") -#endif -//--- Additional includes - -//--- Export -cpp_quote( "#ifdef _DXTRANSIMPL") -cpp_quote( " #define _DXTRANS_IMPL_EXT _declspec(dllexport)") -cpp_quote( "#else") -cpp_quote( " #define _DXTRANS_IMPL_EXT _declspec(dllimport)") -cpp_quote( "#endif") - -//=== Forward References ==================================================== -interface IDXTransformFactory; -interface IDXTransform; -interface IDXTaskManager; -interface IDXSurfaceFactory; -interface IDXSurface; -interface IDXARGBSurfaceInit; -interface IDXRawSurface; -interface IDXARGBReadPtr; -interface IDXARGBReadWritePtr; -interface IDXDCLock; -interface IDXTScale; -interface IDXLookupTable; -interface IDXTBindHost; -interface IBindHost; -interface IDXTScaleOutput; -interface IDXGradient; - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - -//=== Constants ============================================================= - -cpp_quote("//") -cpp_quote("// All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory") -cpp_quote("//") -cpp_quote("EXTERN_C const GUID DDPF_RGB1;") -cpp_quote("EXTERN_C const GUID DDPF_RGB2;") -cpp_quote("EXTERN_C const GUID DDPF_RGB4;") -cpp_quote("EXTERN_C const GUID DDPF_RGB8;") -cpp_quote("EXTERN_C const GUID DDPF_RGB332;") -cpp_quote("EXTERN_C const GUID DDPF_ARGB4444;") -cpp_quote("EXTERN_C const GUID DDPF_RGB565;") -cpp_quote("EXTERN_C const GUID DDPF_BGR565;") -cpp_quote("EXTERN_C const GUID DDPF_RGB555;") -cpp_quote("EXTERN_C const GUID DDPF_ARGB1555;") -cpp_quote("EXTERN_C const GUID DDPF_RGB24;") -cpp_quote("EXTERN_C const GUID DDPF_BGR24;") -cpp_quote("EXTERN_C const GUID DDPF_RGB32;") -cpp_quote("EXTERN_C const GUID DDPF_BGR32;") -cpp_quote("EXTERN_C const GUID DDPF_ABGR32;") -cpp_quote("EXTERN_C const GUID DDPF_ARGB32;") -cpp_quote("EXTERN_C const GUID DDPF_PMARGB32;") -cpp_quote("EXTERN_C const GUID DDPF_A1;") -cpp_quote("EXTERN_C const GUID DDPF_A2;") -cpp_quote("EXTERN_C const GUID DDPF_A4;") -cpp_quote("EXTERN_C const GUID DDPF_A8;") -cpp_quote("EXTERN_C const GUID DDPF_Z8;") -cpp_quote("EXTERN_C const GUID DDPF_Z16;") -cpp_quote("EXTERN_C const GUID DDPF_Z24;") -cpp_quote("EXTERN_C const GUID DDPF_Z32;") -cpp_quote("//") -cpp_quote("// Component categories") -cpp_quote("//") -cpp_quote("EXTERN_C const GUID CATID_DXImageTransform;") -cpp_quote("EXTERN_C const GUID CATID_DX3DTransform;") -cpp_quote("EXTERN_C const GUID CATID_DXAuthoringTransform;") -cpp_quote("EXTERN_C const GUID CATID_DXSurface;") -cpp_quote("//") -cpp_quote("// Service IDs") -cpp_quote("//") -cpp_quote("EXTERN_C const GUID SID_SDirectDraw;") -cpp_quote("EXTERN_C const GUID SID_SDirect3DRM;") -cpp_quote("#define SID_SDXTaskManager CLSID_DXTaskManager") -cpp_quote("#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory") -cpp_quote("#define SID_SDXTransformFactory IID_IDXTransformFactory") -cpp_quote("//") -cpp_quote("// DXTransforms Core Type Library Version Info") -cpp_quote("//") -cpp_quote("#define DXTRANS_TLB_MAJOR_VER 1") -cpp_quote("#define DXTRANS_TLB_MINOR_VER 1") - -//=== Struct & Enum definitions ============================================= - -//=== Interface definitions ================================================= - - -//+----------------------------------------------------------------------------- -// -// IDXBaseObject -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(17B59B2B-9CC8-11d1-9053-00C04FD9189D), - helpstring("IDXBaseObject Interface"), - pointer_default(unique), - local - ] - interface IDXBaseObject : IUnknown - { - HRESULT GetGenerationId( [out]ULONG *pID); - HRESULT IncrementGenerationId([in] BOOL bRefresh); - HRESULT GetObjectSize( [out] ULONG *pcbSize); - }; - - -//+----------------------------------------------------------------------------- -// -// Bounding rectangle and vector structures. -// -//------------------------------------------------------------------------------ - - //--- Dimension identifiers - typedef enum DXBNDID - { - DXB_X = 0, - DXB_Y = 1, - DXB_Z = 2, - DXB_T = 3 - } DXBNDID; - - //--- Bound types - typedef enum DXBNDTYPE - { - DXBT_DISCRETE, - DXBT_DISCRETE64, - DXBT_CONTINUOUS, - DXBT_CONTINUOUS64 - } DXBNDTYPE; - - //--- Discrete bounds (image & sound) - typedef struct DXDBND - { - long Min; - long Max; - } DXDBND; - typedef DXDBND DXDBNDS[4]; - - typedef struct DXDBND64 - { - LONGLONG Min; - LONGLONG Max; - } DXDBND64; - typedef DXDBND64 DXDBNDS64[4]; - - //--- Continuous bounds (geometry) - typedef struct DXCBND - { - float Min; - float Max; - } DXCBND; - typedef DXCBND DXCBNDS[4]; - - typedef struct DXCBND64 - { - double Min; - double Max; - } DXCBND64; - typedef DXCBND64 DXCBNDS64[4]; - - //--- Combined space - typedef union DXBNDS switch( DXBNDTYPE eType ) u - { - case DXBT_DISCRETE: - DXDBND D[4]; - case DXBT_DISCRETE64: - DXDBND64 LD[4]; - case DXBT_CONTINUOUS: - DXCBND C[4]; - case DXBT_CONTINUOUS64: - DXCBND64 LC[4]; - } DXBNDS; - - //--- Discrete 4D vector - typedef long DXDVEC[4]; - typedef LONGLONG DXDVEC64[4]; - - //--- Continous 4D vector - typedef float DXCVEC[4]; - typedef double DXCVEC64[4]; - - //--- Combined space vector - typedef union DXVEC switch( DXBNDTYPE eType ) u - { - case DXBT_DISCRETE: - long D[4]; - case DXBT_DISCRETE64: - LONGLONG LD[4]; - case DXBT_CONTINUOUS: - float C[4]; - case DXBT_CONTINUOUS64: - double LC[4]; - } DXVEC; - - -//+----------------------------------------------------------------------------- -// -// IDXTransformFactory -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(6A950B2B-A971-11d1-81C8-0000F87557DB), - helpstring("IDXTransformFactory Interface"), - pointer_default(unique), - local - ] - interface IDXTransformFactory : IServiceProvider - { - HRESULT SetService( [in]REFGUID guidService, - [in]IUnknown *pUnkService, - [in]BOOL bWeakReference); - - HRESULT CreateTransform( [in, size_is(ulNumInputs)]IUnknown** punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)]IUnknown** punkOutputs, - [in]ULONG ulNumOutputs, - [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog, - [in]REFCLSID TransCLSID, [in]REFIID TransIID, - [out, iid_is(TransIID)]void** ppTransform ); - - HRESULT InitializeTransform( [in]IDXTransform* pTransform, - [in, size_is(ulNumInputs)]IUnknown** punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)]IUnknown** punkOutputs, - [in]ULONG ulNumOutputs, - [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog ); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXTransform -// -//------------------------------------------------------------------------------ - - typedef enum DXTMISCFLAGS - { - DXTMF_BLEND_WITH_OUTPUT = ( 1L << 0 ), - DXTMF_DITHER_OUTPUT = ( 1L << 1 ), - DXTMF_OPTION_MASK = (0x0000FFFF), // Low word is settable options - DXTMF_VALID_OPTIONS = (DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT), - // - // Status flags can not be changed by call to SetMiscFlags - // - DXTMF_BLEND_SUPPORTED = ( 1L << 16 ), - DXTMF_DITHER_SUPPORTED = ( 1L << 17 ), - DXTMF_INPLACE_OPERATION = ( 1L << 24 ), - DXTMF_BOUNDS_SUPPORTED = ( 1L << 25 ), - DXTMF_PLACEMENT_SUPPORTED = ( 1L << 26 ), - DXTMF_QUALITY_SUPPORTED = ( 1L << 27 ), - DXTMF_OPAQUE_RESULT = ( 1L << 28 ) - } DXTMISCFLAGS; - - typedef enum DXINOUTINFOFLAGS - { - DXINOUTF_OPTIONAL = ( 1L << 0) - } DXINOUTINFOFLAGS; - - [ - object, - uuid(30A5FB78-E11F-11d1-9064-00C04FD9189D), - helpstring("IDXTransform Interface"), - pointer_default(unique), - local - ] - interface IDXTransform : IDXBaseObject - { - HRESULT Setup( [in, size_is(ulNumInputs)] IUnknown * const * punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)] IUnknown * const * punkOutputs, - [in]ULONG ulNumOutputs, - [in]DWORD dwFlags ); - - HRESULT Execute( [in]const GUID* pRequestID, [in]const DXBNDS *pClipBnds, - [in]const DXVEC *pPlacement ); - - HRESULT MapBoundsIn2Out( [in] const DXBNDS *pInBounds, - [in]ULONG ulNumInBnds, - [in]ULONG ulOutIndex, - [out]DXBNDS *pOutBounds ); - - HRESULT MapBoundsOut2In( [in] ULONG ulOutIndex, - [in] const DXBNDS *pOutBounds, - [in] ULONG ulInIndex, - [out]DXBNDS *pInBounds ); - - HRESULT SetMiscFlags( [in] DWORD dwMiscFlags); - HRESULT GetMiscFlags( [out]DWORD * pdwMiscFlags ); - HRESULT GetInOutInfo( [in]BOOL bIsOutput, [in]ULONG ulIndex, - [out]DWORD *pdwFlags, [out, size_is(*pcIDs)] GUID *pIDs, - [in, out] ULONG *pcIDs, - [out] IUnknown **ppUnkCurrentObject); - - HRESULT SetQuality( [in] float fQuality ); - HRESULT GetQuality( [out] float * fQuality ); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXSurfacePick -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(30A5FB79-E11F-11d1-9064-00C04FD9189D), - helpstring("IDXSurfacePick Interface"), - pointer_default(unique), - local - ] - interface IDXSurfacePick : IUnknown - { - HRESULT PointPick([in]const DXVEC *pPoint, - [out]ULONG * pulInputSurfaceIndex, - [out]DXVEC *pInputPoint); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXTBindHost -// -// Overview: -// This interface is used to set a site-specific bind host for a transform. -// Only transforms that need access to a bind host need to implement this -// interface. -// -// For some reason, MIDL does not like IBindHost, so we've declared this -// interface local. -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(D26BCE55-E9DC-11d1-9066-00C04FD9189D), - helpstring("IDXTBindHost Interface"), - pointer_default(unique), - local - ] - interface IDXTBindHost : IUnknown - { - HRESULT SetBindHost([in] IBindHost * pBindHost); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXTaskManager -// -// Overview: -// This interface is used to implement a task managment service provider to -// optimize thread usage. -// -//------------------------------------------------------------------------------ - - typedef void (__stdcall DXTASKPROC)(void *pTaskData, BOOL* pbContinueProcessing ); - typedef DXTASKPROC *PFNDXTASKPROC; - - typedef void (__stdcall DXAPCPROC)(DWORD dwData); - typedef DXAPCPROC *PFNDXAPCPROC; - -cpp_quote("#ifdef __cplusplus") - - cpp_quote("typedef struct DXTMTASKINFO" ) - cpp_quote("{") - cpp_quote(" PFNDXTASKPROC pfnTaskProc; // Pointer to function to execute") - cpp_quote(" PVOID pTaskData; // Pointer to argument data") - cpp_quote(" PFNDXAPCPROC pfnCompletionAPC; // Pointer to completion APC proc") - cpp_quote(" DWORD dwCompletionData; // Pointer to APC proc data") - cpp_quote(" const GUID* pRequestID; // Used to identify groups of tasks") - cpp_quote("} DXTMTASKINFO;") - -cpp_quote("#else") - - typedef struct DXTMTASKINFO - { - PVOID pfnTaskProc; // Pointer to function to execute - PVOID pTaskData; // Pointer to argument data - PVOID pfnCompletionAPC; // Pointer to completion APC proc - DWORD dwCompletionData; // Pointer to APC proc data - const GUID* pRequestID; // Used to identify groups of tasks - } DXTMTASKINFO; - -cpp_quote("#endif") - - [ - object, - uuid(254DBBC1-F922-11d0-883A-3C8B00C10000), - helpstring("IDXTaskManager Interface"), - pointer_default(unique), - local - ] - interface IDXTaskManager : IUnknown - { - HRESULT QueryNumProcessors( [out]ULONG* pulNumProc ); - HRESULT SetThreadPoolSize( [in]ULONG ulNumThreads ); - HRESULT GetThreadPoolSize( [out]ULONG* pulNumThreads ); - HRESULT SetConcurrencyLimit( [in]ULONG ulNumThreads ); - HRESULT GetConcurrencyLimit( [out]ULONG* pulNumThreads ); - HRESULT ScheduleTasks( [in]DXTMTASKINFO TaskInfo[], - [in]HANDLE Events[], - [out]DWORD TaskIDs[], - [in]ULONG ulNumTasks, [in]ULONG ulWaitPeriod ); - HRESULT TerminateTasks( [in]DWORD TaskIDs[], [in]ULONG ulCount, - [in]ULONG ulTimeOut ); - HRESULT TerminateRequest( [in]REFIID RequestID, [in]ULONG ulTimeOut ); - }; - - -//+----------------------------------------------------------------------------- -// -// Sample structures (C++) -// -// Overview: -// We want an operator so that we can cast from a DXSAMPLE to a DWORD, so -// for C++ we will define the structure a special way. -// -//------------------------------------------------------------------------------ - -cpp_quote("#ifdef __cplusplus") - - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXBASESAMPLE;") - cpp_quote("class DXSAMPLE;") - cpp_quote("class DXPMSAMPLE;") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" BYTE Blue;") - cpp_quote(" BYTE Green;") - cpp_quote(" BYTE Red;") - cpp_quote(" BYTE Alpha;") - cpp_quote(" DXBASESAMPLE() {}") - cpp_quote(" DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" Alpha(alpha),") - cpp_quote(" Red(red),") - cpp_quote(" Green(green),") - cpp_quote(" Blue(blue) {}") - cpp_quote(" DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); }") - cpp_quote("}; // DXBASESAMPLE") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXSAMPLE : public DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" DXSAMPLE() {}") - cpp_quote(" DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" DXBASESAMPLE(alpha, red, green, blue) {}") - cpp_quote(" DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); }") - cpp_quote(" operator DXPMSAMPLE() const;") - cpp_quote("}; // DXSAMPLE") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXPMSAMPLE : public DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" DXPMSAMPLE() {}") - cpp_quote(" DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" DXBASESAMPLE(alpha, red, green, blue) {}") - cpp_quote(" DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); }") - cpp_quote(" operator DXSAMPLE() const;") - cpp_quote("}; // DXPMSAMPLE") - cpp_quote("") - cpp_quote("//") - cpp_quote("// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE") - cpp_quote("//") - cpp_quote("inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); }") - cpp_quote("inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); }") - - -//+----------------------------------------------------------------------------- -// -// Sample structures (IDL, C) -// -//------------------------------------------------------------------------------ - -cpp_quote("#else // !__cplusplus") - - typedef struct DXBASESAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXBASESAMPLE; - - typedef struct DXSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXSAMPLE; - - typedef struct DXPMSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXPMSAMPLE; - -cpp_quote("#endif // !__cplusplus") - -//+----------------------------------------------------------------------------- -// -// DXRUNINFO structures. -// -//------------------------------------------------------------------------------ - - typedef enum DXRUNTYPE - { - DXRUNTYPE_CLEAR = 0, // The run is zero Alpha - DXRUNTYPE_OPAQUE = 1, // The run is full Alpha (i.e. 255) - DXRUNTYPE_TRANS = 2, // The run is non-zero Alpha - DXRUNTYPE_UNKNOWN= 3 // The run type is unknown. Caller must inspect. - } DXRUNTYPE; - - const ULONG DX_MAX_RUN_INFO_COUNT = 128; // Defines the maximum number of RUNINFOs in a single row - - - cpp_quote("// Ignore the definition used by MIDL for TLB generation") - cpp_quote("#if 0") - - typedef struct DXRUNINFO - { - ULONG Bitfields; - } DXRUNINFO; - - cpp_quote("#endif // 0") - - // Emit the C definition to the H file directly, as bit fields are not - // supported by MIDL. - - cpp_quote("typedef struct DXRUNINFO") - cpp_quote("{") - cpp_quote(" ULONG Type : 2; // Type") - cpp_quote(" ULONG Count : 30; // Number of samples in run") - cpp_quote("} DXRUNINFO;") - - - typedef enum DXSFCREATE - { - DXSF_FORMAT_IS_CLSID = ( 1L << 0 ), - DXSF_NO_LAZY_DDRAW_LOCK = ( 1L << 1 ) - } DXSFCREATE; - - typedef enum DXBLTOPTIONS - { - DXBOF_DO_OVER = (1L << 0), - DXBOF_DITHER = (1L << 1) - } DXBLTOPTIONS; - - -//+----------------------------------------------------------------------------- -// -// IDXSurfaceModifier -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(144946F5-C4D4-11d1-81D1-0000F87557DB), - helpstring("IDXSurfaceFactory Interface"), - pointer_default(unique), - local - ] - interface IDXSurfaceFactory : IUnknown - { - HRESULT CreateSurface([in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID * pFormatID, - [in] const DXBNDS *pBounds, - [in] DWORD dwFlags, - [in] IUnknown *punkOuter, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - HRESULT CreateFromDDSurface([in] IUnknown *pDDrawSurface, - [in] const GUID *pFormatID, - [in] DWORD dwFlags, - [in] IUnknown *punkOuter, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - HRESULT LoadImage( - [in] const LPWSTR pszFileName, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pFormatID, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - HRESULT LoadImageFromStream([in] IStream *pStream, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pFormatID, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - HRESULT CopySurfaceToNewFormat( [in]IDXSurface* pSrc, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pDestFormatID, - [out] IDXSurface** ppNewSurface ); - - HRESULT CreateD3DRMTexture([in] IDXSurface *pSrc, - [in] IUnknown *pDirectDraw, - [in] IUnknown *pD3DRM3, - [in] REFIID riid, - [out, iid_is(riid)] void **ppTexture3); - - HRESULT BitBlt([in] IDXSurface *pDest, - [in] const DXVEC *pPlacement, - [in] IDXSurface *pSrc, - [in] const DXBNDS *pClipBounds, - [in] DWORD dwFlags); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXSurfaceModifier -// -//------------------------------------------------------------------------------ - - typedef enum DXSURFMODCOMPOP - { - DXSURFMOD_COMP_OVER = 0, - DXSURFMOD_COMP_ALPHA_MASK = 1, - DXSURFMOD_COMP_MAX_VALID = 1 - } DXSURFMODCOMPOP; - - [ - object, - uuid(9EA3B637-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXSurfaceModifier Interface"), - pointer_default(unique), - local - ] - interface IDXSurfaceModifier : IUnknown - { - HRESULT SetFillColor([in] DXSAMPLE Color); - HRESULT GetFillColor([out] DXSAMPLE *pColor); - HRESULT SetBounds([in] const DXBNDS *pBounds ); // Get supported though IDXSurface interface - HRESULT SetBackground([in] IDXSurface *pSurface); - HRESULT GetBackground([out] IDXSurface **ppSurface); - HRESULT SetCompositeOperation([in] DXSURFMODCOMPOP CompOp); - HRESULT GetCompositeOperation([out] DXSURFMODCOMPOP *pCompOp); - // - // The following methods only apply to the FOREGROUND surface - // - HRESULT SetForeground([in] IDXSurface *pSurface, [in] BOOL bTile, [in] const POINT * pOrigin); - HRESULT GetForeground([out] IDXSurface **ppSurface, [out] BOOL *pbTile, [out] POINT * pOrigin); - HRESULT SetOpacity([in] float Opacity); - HRESULT GetOpacity([out] float *pOpacity); - HRESULT SetLookup( [in]IDXLookupTable * pLookupTable ); - HRESULT GetLookup( [out]IDXLookupTable ** ppLookupTable ); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXSurface -// -//------------------------------------------------------------------------------ - - typedef enum DXSAMPLEFORMATENUM - { - DXPF_FLAGSMASK = (0xFFFF0000), // Top word is flags, low word is enum - DXPF_NONPREMULT = (0x00010000), // Flags to be OR'd with pixel formats - DXPF_TRANSPARENCY = (0x00020000), // Color key or one-bit alpha (alpha only 0 or 0xFF) - DXPF_TRANSLUCENCY = (0x00040000), // Alpha can be any value from 0->0xFF - // - // This 3-bit field is used to determine what type of dithering to be used - // - DXPF_2BITERROR = (0x00200000), // 2 bits of error term - DXPF_3BITERROR = (0x00300000), // 3 bits of error term for color (16-bit color) - DXPF_4BITERROR = (0x00400000), // 4 bits of error term (ARGB 4444) - DXPF_5BITERROR = (0x00500000), // 5 bits of error term for color (8-bit color) - DXPF_ERRORMASK = (0x00700000), // Mask of bits used for dithering - - DXPF_NONSTANDARD = (0), // To be used for any surface that is not one of the following formats - // This can be combined with DXPFNONPREMULT if the surface can work - // better in non-premultiplied space. - DXPF_PMARGB32 = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_ARGB32 = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_ARGB4444 = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR), - DXPF_A8 = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_RGB32 = (5), - DXPF_RGB24 = (6), - DXPF_RGB565 = (7 | DXPF_3BITERROR), - DXPF_RGB555 = (8 | DXPF_3BITERROR), - DXPF_RGB8 = (9 | DXPF_5BITERROR), - DXPF_ARGB1555 = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR), - DXPF_RGB32_CK = (DXPF_RGB32 | DXPF_TRANSPARENCY), - DXPF_RGB24_CK = (DXPF_RGB24 | DXPF_TRANSPARENCY), - DXPF_RGB555_CK = (DXPF_RGB555 | DXPF_TRANSPARENCY), - DXPF_RGB565_CK = (DXPF_RGB565 | DXPF_TRANSPARENCY), - DXPF_RGB8_CK = (DXPF_RGB8 | DXPF_TRANSPARENCY) - } DXSAMPLEFORMATENUM; - - typedef enum DXLOCKSURF - { - DXLOCKF_READ = 0, - DXLOCKF_READWRITE = (1 << 0), - DXLOCKF_EXISTINGINFOONLY = (1 << 1), // If used in conjunction with WANTRUNINFO will prevent creation of a runmap if one does not exist - DXLOCKF_WANTRUNINFO = (1 << 2), - // - // The flags in the high word should be specific to the type of pointer that - // is requested. These flags define ARGB flags. These flags are advisory and - // are not required to be set for ARGB locks. - // - DXLOCKF_NONPREMULT = (1 << 16), // Caller will request non-premultiplied data - DXLOCKF_VALIDFLAGS = (DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT) - } DXLOCKSURF; - - typedef enum DXSURFSTATUS - { - DXSURF_TRANSIENT = (1 << 0), // Data in this surface changes often. - DXSURF_READONLY = (1 << 1), // Surface is read-only - DXSURF_VALIDFLAGS = (DXSURF_TRANSIENT | DXSURF_READONLY) - } DXSURFSTATUS; - - [ - object, - uuid(B39FD73F-E139-11d1-9065-00C04FD9189D), - helpstring("IDXSurface Interface"), - pointer_default(unique), - local - ] - interface IDXSurface : IDXBaseObject - { - HRESULT GetPixelFormat([out] GUID * pFormatID, [out] DXSAMPLEFORMATENUM *pSampleFormatEnum); - HRESULT GetBounds( [out]DXBNDS *pBounds ); - HRESULT GetStatusFlags([out] DWORD * pdwStatusFlags); - HRESULT SetStatusFlags([in] DWORD dwStatusFlags); - HRESULT LockSurface( [in]const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in]DWORD dwFlags, - [in]REFIID riid, [out, iid_is(riid)] void **ppPointer, - [out]ULONG* pulGenerationId ); - HRESULT GetDirectDrawSurface( [in] REFIID riid, - [out, iid_is(riid)] void ** ppSurface); - HRESULT GetColorKey(DXSAMPLE * pColorKey); // Can return E_NOTIMPL - HRESULT SetColorKey(DXSAMPLE ColorKey); // Set color of 0 to get rid of color key, can return E_NOTIMPL - HRESULT LockSurfaceDC( [in] const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in] DWORD dwFlags, - [out] IDXDCLock **ppDCLock); - HRESULT SetAppData(DWORD_PTR dwAppData); - HRESULT GetAppData(DWORD_PTR *pdwAppData); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXSurfaceInit -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(9EA3B639-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXSurfaceInit Interface"), - pointer_default(unique), - local - ] - interface IDXSurfaceInit : IUnknown - { - HRESULT InitSurface([in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC *pDDSurfaceDesc, - [in] const GUID * pFormatID, - [in] const DXBNDS *pBounds, - [in] DWORD dwFlags); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXARGBSurfaceInit -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(9EA3B63A-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXARGBSurfaceInit Interface"), - pointer_default(unique), - local - ] - interface IDXARGBSurfaceInit : IDXSurfaceInit - { - HRESULT InitFromDDSurface( [in] IUnknown *pDDrawSurface, - [in] const GUID * pFormatID, - [in] DWORD dwFlags); - HRESULT InitFromRawSurface([in] IDXRawSurface *pRawSurface); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXARGBReadPtr -// -//------------------------------------------------------------------------------ - - typedef struct tagDXNATIVETYPEINFO - { - BYTE * pCurrentData; - BYTE * pFirstByte; - long lPitch; - DWORD dwColorKey; - } DXNATIVETYPEINFO; - - typedef struct tagDXPACKEDRECTDESC - { - DXBASESAMPLE *pSamples; - BOOL bPremult; - RECT rect; - long lRowPadding; - } DXPACKEDRECTDESC; - - typedef struct tagDXOVERSAMPLEDESC - { - POINT p; - DXPMSAMPLE Color; - } DXOVERSAMPLEDESC; - - [ - object, - uuid(EAAAC2D6-C290-11d1-905D-00C04FD9189D), - helpstring("IDXARGBReadPtr Interface"), - pointer_default(unique), - local - ] - interface IDXARGBReadPtr : IUnknown - { - HRESULT GetSurface( [in]REFIID riid, [out, iid_is( riid )]void ** ppSurface); - DXSAMPLEFORMATENUM GetNativeType( [out]DXNATIVETYPEINFO *pInfo ); - void Move( [in]long cSamples ); - void MoveToRow( [in]ULONG y ); - void MoveToXY( [in]ULONG x, [in]ULONG y); - ULONG MoveAndGetRunInfo( [in]ULONG Row, [out] const DXRUNINFO** ppInfo ); // Returns count of runs - DXSAMPLE * Unpack( [in]DXSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove ); - DXPMSAMPLE * UnpackPremult( [in]DXPMSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove ); - void UnpackRect([in] const DXPACKEDRECTDESC * pRectDesc); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXARGBReadWritePtr -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(EAAAC2D7-C290-11d1-905D-00C04FD9189D), - helpstring("IDXARGBReadWritePtr Interface"), - pointer_default(unique), - local - ] - interface IDXARGBReadWritePtr : IDXARGBReadPtr - { - void PackAndMove( [in]const DXSAMPLE *pSamples, [in]ULONG cSamples ); - void PackPremultAndMove( [in]const DXPMSAMPLE *pSamples, [in]ULONG cSamples ); - void PackRect([in]const DXPACKEDRECTDESC *pRectDesc); - void CopyAndMoveBoth( [in]DXBASESAMPLE *pScratchBuffer, [in]IDXARGBReadPtr *pSrc, - [in]ULONG cSamples, [in]BOOL bIsOpaque ); - void CopyRect( [in] DXBASESAMPLE *pScratchBuffer, - [in] const RECT *pDestRect, [in]IDXARGBReadPtr *pSrc, - [in] const POINT *pSrcOrigin, [in]BOOL bIsOpaque); - void FillAndMove( [in]DXBASESAMPLE *pScratchBuffer, [in]DXPMSAMPLE SampVal, - [in]ULONG cSamples, [in]BOOL bDoOver ); - void FillRect( [in]const RECT *pRect, [in]DXPMSAMPLE SampVal, [in]BOOL bDoOver ); - void OverSample( [in]const DXOVERSAMPLEDESC * pOverDesc); - void OverArrayAndMove([in]DXBASESAMPLE *pScratchBuffer, - [in] const DXPMSAMPLE *pSrc, - [in] ULONG cSamples); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXDCLock -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(0F619456-CF39-11d1-905E-00C04FD9189D), - helpstring("IDXDCLock Interface"), - pointer_default(unique), - local - ] - interface IDXDCLock : IUnknown - { - HDC GetDC(void); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXTScaleOutput -// -// Overview: -// Generic interface that any transform can support which allows caller to -// specify the desired output bounds. -//------------------------------------------------------------------------------ - - [ - object, - uuid(B2024B50-EE77-11d1-9066-00C04FD9189D), - helpstring("IDXTScaleOutput Interface"), - pointer_default(unique), - local - ] - interface IDXTScaleOutput : IUnknown - { - HRESULT SetOutputSize([in] const SIZE OutSize, [in] BOOL bMaintainAspect); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXGradient -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(B2024B51-EE77-11d1-9066-00C04FD9189D), - helpstring("IDXGradient Interface"), - pointer_default(unique), - local - ] - interface IDXGradient : IDXTScaleOutput - { - HRESULT SetGradient(DXSAMPLE StartColor, DXSAMPLE EndColor, BOOL bHorizontal); - HRESULT GetOutputSize([out] SIZE *pOutSize); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXTScale -// -// Overview: -// This is the control interface for the simple scale transform. -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(B39FD742-E139-11d1-9065-00C04FD9189D), - helpstring("IDXTScale Interface"), - pointer_default(unique), - local - ] - interface IDXTScale : IUnknown - { - HRESULT SetScales( [in]float Scales[2] ); - HRESULT GetScales( [out]float Scales[2] ); - HRESULT ScaleFitToSize( [in,out]DXBNDS* pClipBounds, - [in]SIZE FitToSize, [in]BOOL bMaintainAspect ); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXEffect -// -// Overview: -// This interface is used to generically control transforms that are -// transition effects. -// -//------------------------------------------------------------------------------ - - typedef enum DISPIDDXEFFECT - { - DISPID_DXECAPABILITIES = 10000, // Start at 10000 to avoid conflicts with inhereted interfaces - DISPID_DXEPROGRESS, - DISPID_DXESTEP, - DISPID_DXEDURATION, - DISPID_DXE_NEXT_ID - } DISPIDDXBOUNDEDEFFECT; - - typedef enum DXEFFECTTYPE - { - DXTET_PERIODIC = (1 << 0), // Result at 1 is same as result at 0 - DXTET_MORPH = (1 << 1) // Transition between 2 inputs (input 0 to input 1) - } DXEFFECTTYPE; - - [ - object, - uuid(E31FB81B-1335-11d1-8189-0000F87557DB), - helpstring("IDXEffect Interface"), - pointer_default(unique), - dual - ] - interface IDXEffect : IDispatch - { - [propget, id(DISPID_DXECAPABILITIES)] - HRESULT Capabilities([out, retval] long *pVal); - [propget, id(DISPID_DXEPROGRESS)] - HRESULT Progress([out, retval] float *pVal); - [propput, id(DISPID_DXEPROGRESS)] - HRESULT Progress([in] float newVal); - [propget, id(DISPID_DXESTEP)] - HRESULT StepResolution([out, retval] float *pVal); - [propget, id(DISPID_DXEDURATION)] - HRESULT Duration([out, retval] float *pVal); - [propput, id(DISPID_DXEDURATION)] - HRESULT Duration([in] float newVal); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXLookupTable -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(01BAFC7F-9E63-11d1-9053-00C04FD9189D), - helpstring("IDXLookupTable Interface"), - pointer_default(unique), - local - ] - interface IDXLookupTable : IDXBaseObject - { - HRESULT GetTables( [out]BYTE RedLUT[256], - [out]BYTE GreenLUT[256], - [out]BYTE BlueLUT[256], - [out]BYTE AlphaLUT[256] ); - - HRESULT IsChannelIdentity([out] DXBASESAMPLE * pSampleBools); - HRESULT GetIndexValues([in] ULONG Index, [out] DXBASESAMPLE *pSample); - HRESULT ApplyTables([in, out] DXSAMPLE *pSamples, [in] ULONG cSamples); - }; - - -//+----------------------------------------------------------------------------- -// -// IDXRawSurface -// -// Overview: -// User created objects support IDXRawSurface -// -//------------------------------------------------------------------------------ - - typedef struct DXRAWSURFACEINFO - { - BYTE * pFirstByte; - long lPitch; - ULONG Width; - ULONG Height; - const GUID * pPixelFormat; - HDC hdc; - DWORD dwColorKey; // Note: High byte must == 0xFF for color keyed surface. Low 3 bytes are native data type. - DXBASESAMPLE * pPalette; - } DXRAWSURFACEINFO; - - [ - object, - uuid(09756C8A-D96A-11d1-9062-00C04FD9189D), - helpstring("IDXRawSurface Interface"), - pointer_default(unique), - local - ] - interface IDXRawSurface : IUnknown - { - HRESULT GetSurfaceInfo(DXRAWSURFACEINFO * pSurfaceInfo); - }; - - -//+----------------------------------------------------------------------------- -// -// IHTMLDXTransform -// -//------------------------------------------------------------------------------ - - [ - object, - uuid(30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5), - helpstring("IHTMLDXTransform Interface"), - pointer_default(unique), - local - ] - interface IHTMLDXTransform : IUnknown - { - HRESULT SetHostUrl(BSTR bstrHostUrl); - }; - - -//+----------------------------------------------------------------------------- -// -// ICSSFilterDispatch -// -//------------------------------------------------------------------------------ - - typedef enum DXTFILTER_STATUS - { - DXTFILTER_STATUS_Stopped = 0, - DXTFILTER_STATUS_Applied, - DXTFILTER_STATUS_Playing, - DXTFILTER_STATUS_MAX - } DXTFILTER_STATUS; - - typedef enum DXTFILTER_DISPID - { - DISPID_DXTFilter_Percent = 1, - DISPID_DXTFilter_Duration, - DISPID_DXTFilter_Enabled, - DISPID_DXTFilter_Status, - DISPID_DXTFilter_Apply, - DISPID_DXTFilter_Play, - DISPID_DXTFilter_Stop, - DISPID_DXTFilter_MAX - } DXTFILTER_DISPID; - - [ - object, - uuid(9519152B-9484-4A6C-B6A7-4F25E92D6C6B), - helpstring("ICSSFilterDispatch Interface"), - pointer_default(unique), - dual - ] - interface ICSSFilterDispatch : IDispatch - { - [propget, id(DISPID_DXTFilter_Percent)] HRESULT Percent( [out, retval] float *pVal); - [propput, id(DISPID_DXTFilter_Percent)] HRESULT Percent( [in] float newVal); - [propget, id(DISPID_DXTFilter_Duration)] HRESULT Duration([out, retval] float *pVal); - [propput, id(DISPID_DXTFilter_Duration)] HRESULT Duration([in] float newVal); - [propget, id(DISPID_DXTFilter_Enabled)] HRESULT Enabled( [out, retval] VARIANT_BOOL *pfVal); - [propput, id(DISPID_DXTFilter_Enabled)] HRESULT Enabled( [in] VARIANT_BOOL fVal); - [propget, id(DISPID_DXTFilter_Status)] HRESULT Status( [out, retval] DXTFILTER_STATUS * peVal); - [id(DISPID_DXTFilter_Apply)] HRESULT Apply(); - [id(DISPID_DXTFilter_Play)] HRESULT Play([in, optional] VARIANT varDuration); - [id(DISPID_DXTFilter_Stop)] HRESULT Stop(); - }; - - -//=== CoClass definitions ================================================= - -[ - uuid(54314D1D-35FE-11d1-81A1-0000F87557DB), - version(1.1), - helpstring("Microsoft DirectX Transforms Core Type Library") -] -library DXTRANSLib -{ - importlib("stdole2.tlb"); - - /////////////////////////////// - // DXTransformFactory CoClass - /////////////////////////////// - [ - uuid(D1FE6762-FC48-11D0-883A-3C8B00C10000), - helpstring("DXTransformFactory Class") - ] - coclass DXTransformFactory - { - [default] interface IDXTransformFactory; - interface IDXSurfaceFactory; - }; - - - /////////////////////////////// - // DXTaskManager CoClass - /////////////////////////////// - [ - uuid(4CB26C03-FF93-11d0-817E-0000F87557DB), - helpstring("DXTaskManager Class") - ] - coclass DXTaskManager - { - [default] interface IDXTaskManager; - }; - - - /////////////////////////////// - // DXTScale CoClass - /////////////////////////////// - [ - uuid(555278E2-05DB-11D1-883A-3C8B00C10000), - helpstring("DXTScale Class") - ] - coclass DXTScale - { - [default] interface IDXTScale; - }; - - - /////////////////////////////// - // DXSurface CoClass - /////////////////////////////// - [ - uuid(0E890F83-5F79-11D1-9043-00C04FD9189D), - helpstring("DXSurface Class") - ] - coclass DXSurface - { - [default] interface IDXSurface; - }; - - - /////////////////////////////// - // DXSurfaceModifier CoClass - /////////////////////////////// - [ - uuid(3E669F1D-9C23-11d1-9053-00C04FD9189D), - helpstring("DXSurfaceModifier Class") - ] - coclass DXSurfaceModifier - { - [default] interface IDXSurfaceModifier; - }; - - - /////////////////////////////// - // DXGradient CoClass - /////////////////////////////// - [ - uuid(C6365470-F667-11d1-9067-00C04FD9189D), - helpstring("DXGradient Class") - ] - coclass DXGradient - { - [default] interface IDXGradient; - }; - - - /////////////////////////////// - // DXTFilter CoClass - /////////////////////////////// - [ - uuid(385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD), - helpstring("DXTFilter Class") - ] - coclass DXTFilter - { - [default] interface ICSSFilterDispatch; - }; -}; - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - //=== Constants ============================================================= - - cpp_quote("//") - cpp_quote("// All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory") - cpp_quote("//") - cpp_quote("EXTERN_C const GUID DDPF_RGB1;") - cpp_quote("EXTERN_C const GUID DDPF_RGB2;") - cpp_quote("EXTERN_C const GUID DDPF_RGB4;") - cpp_quote("EXTERN_C const GUID DDPF_RGB8;") - cpp_quote("EXTERN_C const GUID DDPF_RGB332;") - cpp_quote("EXTERN_C const GUID DDPF_ARGB4444;") - cpp_quote("EXTERN_C const GUID DDPF_RGB565;") - cpp_quote("EXTERN_C const GUID DDPF_BGR565;") - cpp_quote("EXTERN_C const GUID DDPF_RGB555;") - cpp_quote("EXTERN_C const GUID DDPF_ARGB1555;") - cpp_quote("EXTERN_C const GUID DDPF_RGB24;") - cpp_quote("EXTERN_C const GUID DDPF_BGR24;") - cpp_quote("EXTERN_C const GUID DDPF_RGB32;") - cpp_quote("EXTERN_C const GUID DDPF_BGR32;") - cpp_quote("EXTERN_C const GUID DDPF_ABGR32;") - cpp_quote("EXTERN_C const GUID DDPF_ARGB32;") - cpp_quote("EXTERN_C const GUID DDPF_PMARGB32;") - cpp_quote("EXTERN_C const GUID DDPF_A1;") - cpp_quote("EXTERN_C const GUID DDPF_A2;") - cpp_quote("EXTERN_C const GUID DDPF_A4;") - cpp_quote("EXTERN_C const GUID DDPF_A8;") - cpp_quote("EXTERN_C const GUID DDPF_Z8;") - cpp_quote("EXTERN_C const GUID DDPF_Z16;") - cpp_quote("EXTERN_C const GUID DDPF_Z24;") - cpp_quote("EXTERN_C const GUID DDPF_Z32;") - cpp_quote("//") - cpp_quote("// Component categories") - cpp_quote("//") - cpp_quote("EXTERN_C const GUID CATID_DXImageTransform;") - cpp_quote("EXTERN_C const GUID CATID_DX3DTransform;") - cpp_quote("EXTERN_C const GUID CATID_DXAuthoringTransform;") - cpp_quote("EXTERN_C const GUID CATID_DXSurface;") - cpp_quote("//") - cpp_quote("// Service IDs") - cpp_quote("//") - cpp_quote("EXTERN_C const GUID SID_SDirectDraw;") - cpp_quote("EXTERN_C const GUID SID_SDirect3DRM;") - cpp_quote("#define SID_SDXTaskManager CLSID_DXTaskManager") - cpp_quote("#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory") - cpp_quote("#define SID_SDXTransformFactory IID_IDXTransformFactory") - - //=== Struct & Enum definitions ============================================= - - //=== Interface definitions ================================================= - - - [ - uuid(17B59B2B-9CC8-11d1-9053-00C04FD9189D), - helpstring("IDXBaseObject Interface"), - pointer_default(unique) - ] - interface IDXBaseObject : IUnknown - { - HRESULT GetGenerationId( [out]ULONG *pID); - HRESULT IncrementGenerationId([in] BOOL bRefresh); - HRESULT GetObjectSize( [out] ULONG *pcbSize); - } - - //--- Dimension identifiers - typedef enum DXBNDID - { - DXB_X = 0, - DXB_Y = 1, - DXB_Z = 2, - DXB_T = 3 - } DXBNDID; - - //--- Bound types - typedef enum DXBNDTYPE - { - DXBT_DISCRETE, - DXBT_DISCRETE64, - DXBT_CONTINUOUS, - DXBT_CONTINUOUS64 - } DXBNDTYPE; - - //--- Discrete bounds (image & sound) - typedef struct DXDBND - { - long Min; - long Max; - } DXDBND; - typedef DXDBND DXDBNDS[4]; - - typedef struct DXDBND64 - { - LONGLONG Min; - LONGLONG Max; - } DXDBND64; - typedef DXDBND64 DXDBNDS64[4]; - - //--- Continuous bounds (geometry) - typedef struct DXCBND - { - float Min; - float Max; - } DXCBND; - typedef DXCBND DXCBNDS[4]; - - typedef struct DXCBND64 - { - double Min; - double Max; - } DXCBND64; - typedef DXCBND64 DXCBNDS64[4]; - - //--- Combined space - typedef union DXBNDS switch( DXBNDTYPE eType ) u - { - case DXBT_DISCRETE: - DXDBND D[4]; - case DXBT_DISCRETE64: - DXDBND64 LD[4]; - case DXBT_CONTINUOUS: - DXCBND C[4]; - case DXBT_CONTINUOUS64: - DXCBND64 LC[4]; - } DXBNDS; - - //--- Discrete 4D vector - typedef long DXDVEC[4]; - typedef LONGLONG DXDVEC64[4]; - - //--- Continous 4D vector - typedef float DXCVEC[4]; - typedef double DXCVEC64[4]; - - //--- Combined space vector - typedef union DXVEC switch( DXBNDTYPE eType ) u - { - case DXBT_DISCRETE: - long D[4]; - case DXBT_DISCRETE64: - LONGLONG LD[4]; - case DXBT_CONTINUOUS: - float C[4]; - case DXBT_CONTINUOUS64: - double LC[4]; - } DXVEC; - - //--- IDXTransformFactory --------------------------------------------------- - [ - uuid(6A950B2B-A971-11d1-81C8-0000F87557DB), - helpstring("IDXTransformFactory Interface"), - pointer_default(unique) - ] - interface IDXTransformFactory : IServiceProvider - { - HRESULT SetService( [in]REFGUID guidService, - [in]IUnknown *pUnkService, - [in]BOOL bWeakReference); - - HRESULT CreateTransform( [in, size_is(ulNumInputs)]IUnknown** punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)]IUnknown** punkOutputs, - [in]ULONG ulNumOutputs, - [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog, - [in]REFCLSID TransCLSID, [in]REFIID TransIID, - [out, iid_is(TransIID)]void** ppTransform ); - - HRESULT InitializeTransform( [in]IDXTransform* pTransform, - [in, size_is(ulNumInputs)]IUnknown** punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)]IUnknown** punkOutputs, - [in]ULONG ulNumOutputs, - [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog ); - }; - - //--- IDXTransform ------------------------------------------------- - - typedef enum DXTMISCFLAGS - { - DXTMF_BLEND_WITH_OUTPUT = ( 1L << 0 ), - DXTMF_DITHER_OUTPUT = ( 1L << 1 ), - DXTMF_OPTION_MASK = (0x0000FFFF), // Low word is settable options - DXTMF_VALID_OPTIONS = (DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT), - // - // Status flags can not be changed by call to SetMiscFlags - // - DXTMF_BLEND_SUPPORTED = ( 1L << 16 ), - DXTMF_DITHER_SUPPORTED = ( 1L << 17 ), - DXTMF_INPLACE_OPERATION = ( 1L << 24 ), - DXTMF_BOUNDS_SUPPORTED = ( 1L << 25 ), - DXTMF_PLACEMENT_SUPPORTED = ( 1L << 26 ), - DXTMF_QUALITY_SUPPORTED = ( 1L << 27 ), - DXTMF_OPAQUE_RESULT = ( 1L << 28 ) - } DXTMISCFLAGS; - - - typedef enum DXINOUTINFOFLAGS - { - DXINOUTF_OPTIONAL = ( 1L << 0) - } DXINOUTINFOFLAGS; - - [ - uuid(30A5FB78-E11F-11d1-9064-00C04FD9189D), - helpstring("IDXTransform Interface"), - pointer_default(unique) - ] - interface IDXTransform : IDXBaseObject - { - HRESULT Setup( [in, size_is(ulNumInputs)] IUnknown * const * punkInputs, - [in]ULONG ulNumInputs, - [in, size_is(ulNumOutputs)] IUnknown * const * punkOutputs, - [in]ULONG ulNumOutputs, - [in]DWORD dwFlags ); - HRESULT Execute( [in]const GUID* pRequestID, [in]const DXBNDS *pClipBnds, - [in]const DXVEC *pPlacement ); - HRESULT MapBoundsIn2Out( [in] const DXBNDS *pInBounds, - [in]ULONG ulNumInBnds, - [in]ULONG ulOutIndex, - [out]DXBNDS *pOutBounds ); - HRESULT MapBoundsOut2In( [in] ULONG ulOutIndex, - [in] const DXBNDS *pOutBounds, - [in] ULONG ulInIndex, - [out]DXBNDS *pInBounds ); - HRESULT SetMiscFlags( [in] DWORD dwMiscFlags); - HRESULT GetMiscFlags( [out]DWORD * pdwMiscFlags ); - HRESULT GetInOutInfo( [in]BOOL bIsOutput, [in]ULONG ulIndex, - [out]DWORD *pdwFlags, [out, size_is(*pcIDs)] GUID *pIDs, - [in, out] ULONG *pcIDs, - [out] IUnknown **ppUnkCurrentObject); - HRESULT SetQuality( [in] float fQuality ); - HRESULT GetQuality( [out] float * fQuality ); - }; - - - [ - uuid(30A5FB79-E11F-11d1-9064-00C04FD9189D), - helpstring("IDXSurfacePick Interface"), - pointer_default(unique) - ] - interface IDXSurfacePick : IUnknown - { - HRESULT PointPick([in]const DXVEC *pPoint, - [out]ULONG * pulInputSurfaceIndex, - [out]DXVEC *pInputPoint); - } - - - //--- IDXTBindHost --------------------------------------------------- - // This interface is used to set a site-specific bind host for a transform. - // Only transforms that need access to a bind host need to implement this interface. - - // - // For some reason, MIDL does not like IBindHost, so we've declared this interface local - // - [ - uuid(D26BCE55-E9DC-11d1-9066-00C04FD9189D), - helpstring("IDXTBindHost Interface"), - pointer_default(unique), - local - ] - interface IDXTBindHost : IUnknown - { - HRESULT SetBindHost([in] IBindHost * pBindHost); - } - - //--- IDXTaskManager --------------------------------------------------- - // This interface is used to implement a task managment service provider - // to optimize thread usage. - - // Function type prototypes - typedef void (__stdcall DXTASKPROC)(void *pTaskData, BOOL* pbContinueProcessing ); - typedef DXTASKPROC *PFNDXTASKPROC; - - typedef void (__stdcall DXAPCPROC)(DWORD dwData); - typedef DXAPCPROC *PFNDXAPCPROC; - - cpp_quote("#ifdef __cplusplus") - cpp_quote("typedef struct DXTMTASKINFO" ) - cpp_quote("{") - cpp_quote(" PFNDXTASKPROC pfnTaskProc; // Pointer to function to execute") - cpp_quote(" PVOID pTaskData; // Pointer to argument data") - cpp_quote(" PFNDXAPCPROC pfnCompletionAPC; // Pointer to completion APC proc") - cpp_quote(" DWORD dwCompletionData; // Pointer to APC proc data") - cpp_quote(" const GUID* pRequestID; // Used to identify groups of tasks") - cpp_quote("} DXTMTASKINFO;") - cpp_quote("#else") - typedef struct DXTMTASKINFO - { - PVOID pfnTaskProc; // Pointer to function to execute - PVOID pTaskData; // Pointer to argument data - PVOID pfnCompletionAPC; // Pointer to completion APC proc - DWORD dwCompletionData; // Pointer to APC proc data - const GUID* pRequestID; // Used to identify groups of tasks - } DXTMTASKINFO; - cpp_quote("#endif") - - [ - local, - uuid(254DBBC1-F922-11d0-883A-3C8B00C10000), - helpstring("IDXTaskManager Interface"), - pointer_default(unique) - ] - interface IDXTaskManager : IUnknown - { - HRESULT QueryNumProcessors( [out]ULONG* pulNumProc ); - HRESULT SetThreadPoolSize( [in]ULONG ulNumThreads ); - HRESULT GetThreadPoolSize( [out]ULONG* pulNumThreads ); - HRESULT SetConcurrencyLimit( [in]ULONG ulNumThreads ); - HRESULT GetConcurrencyLimit( [out]ULONG* pulNumThreads ); - HRESULT ScheduleTasks( [in]DXTMTASKINFO TaskInfo[], - [in]HANDLE Events[], - [out]DWORD TaskIDs[], - [in]ULONG ulNumTasks, [in]ULONG ulWaitPeriod ); - HRESULT TerminateTasks( [in]DWORD TaskIDs[], [in]ULONG ulCount, - [in]ULONG ulTimeOut ); - HRESULT TerminateRequest( [in]REFIID RequestID, [in]ULONG ulTimeOut ); - }; - - //--- IDXSurfaceFactory --------------------------------------------------- - // - // We want an operator so that we can cast from a DXSAMPLE to a DWORD, so for C++ we will - // define the structure a special way. - // - - cpp_quote("#ifdef __cplusplus") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXBASESAMPLE;") - cpp_quote("class DXSAMPLE;") - cpp_quote("class DXPMSAMPLE;") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" BYTE Blue;") - cpp_quote(" BYTE Green;") - cpp_quote(" BYTE Red;") - cpp_quote(" BYTE Alpha;") - cpp_quote(" DXBASESAMPLE() {}") - cpp_quote(" DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" Alpha(alpha),") - cpp_quote(" Red(red),") - cpp_quote(" Green(green),") - cpp_quote(" Blue(blue) {}") - cpp_quote(" DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); }") - cpp_quote("}; // DXBASESAMPLE") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXSAMPLE : public DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" DXSAMPLE() {}") - cpp_quote(" DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" DXBASESAMPLE(alpha, red, green, blue) {}") - cpp_quote(" DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); }") - cpp_quote(" operator DXPMSAMPLE() const;") - cpp_quote("}; // DXSAMPLE") - cpp_quote("") - cpp_quote("/////////////////////////////////////////////////////") - cpp_quote("") - cpp_quote("class DXPMSAMPLE : public DXBASESAMPLE") - cpp_quote("{") - cpp_quote("public:") - cpp_quote(" DXPMSAMPLE() {}") - cpp_quote(" DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :") - cpp_quote(" DXBASESAMPLE(alpha, red, green, blue) {}") - cpp_quote(" DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); }") - cpp_quote(" operator DWORD () const {return *((DWORD *)this); }") - cpp_quote(" DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); }") - cpp_quote(" operator DXSAMPLE() const;") - cpp_quote("}; // DXPMSAMPLE") - cpp_quote("") - cpp_quote("//") - cpp_quote("// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE") - cpp_quote("//") - cpp_quote("inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); }") - cpp_quote("inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); }") - - cpp_quote("#else // !__cplusplus") - typedef struct DXBASESAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXBASESAMPLE; - - typedef struct DXSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXSAMPLE; - - typedef struct DXPMSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXPMSAMPLE; - cpp_quote("#endif // !__cplusplus") - - typedef enum DXRUNTYPE - { - DXRUNTYPE_CLEAR = 0, // The run is zero Alpha - DXRUNTYPE_OPAQUE = 1, // The run is full Alpha (i.e. 255) - DXRUNTYPE_TRANS = 2, // The run is non-zero Alpha - DXRUNTYPE_UNKNOWN= 3 // The run type is unknown. Caller must inspect. - } DXRUNTYPE; - - const ULONG DX_MAX_RUN_INFO_COUNT = 128; // Defines the maximum number of RUNINFOs in a single row - - - cpp_quote("// Ignore the definition used by MIDL for TLB generation") - cpp_quote("#if 0") - - typedef struct DXRUNINFO - { - ULONG Bitfields; - } DXRUNINFO; - - cpp_quote("#endif // 0") - - // Emit the C definition to the H file directly, as bit fields are not - // supported by MIDL. - - cpp_quote("typedef struct DXRUNINFO") - cpp_quote("{") - cpp_quote(" ULONG Type : 2; // Type") - cpp_quote(" ULONG Count : 30; // Number of samples in run") - cpp_quote("} DXRUNINFO;") - - - typedef enum DXSFCREATE - { - DXSF_FORMAT_IS_CLSID = ( 1L << 0 ), - DXSF_NO_LAZY_DDRAW_LOCK = ( 1L << 1 ) - } DXSFCREATE; - - typedef enum DXBLTOPTIONS - { - DXBOF_DO_OVER = (1L << 0), - DXBOF_DITHER = (1L << 1) - } DXBLTOPTIONS; - - - - [ - uuid(144946F5-C4D4-11d1-81D1-0000F87557DB), - helpstring("IDXSurfaceFactory Interface"), - pointer_default(unique) - ] - interface IDXSurfaceFactory : IUnknown - { - [local] HRESULT CreateSurface([in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID * pFormatID, - [in] const DXBNDS *pBounds, - [in] DWORD dwFlags, - [in] IUnknown *punkOuter, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - HRESULT CreateFromDDSurface([in] IUnknown *pDDrawSurface, - [in] const GUID *pFormatID, - [in] DWORD dwFlags, - [in] IUnknown *punkOuter, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - [local] HRESULT LoadImage( - [in] const LPWSTR pszFileName, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pFormatID, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - [local] HRESULT LoadImageFromStream([in] IStream *pStream, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pFormatID, - [in] REFIID riid, - [out, iid_is( riid )] void ** ppDXSurface); - - [local] HRESULT CopySurfaceToNewFormat( [in]IDXSurface* pSrc, - [in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC * pDDSurfaceDesc, - [in] const GUID *pDestFormatID, - [out] IDXSurface** ppNewSurface ); - - [local] HRESULT CreateD3DRMTexture([in] IDXSurface *pSrc, - [in] IUnknown *pDirectDraw, - [in] IUnknown *pD3DRM3, - [in] REFIID riid, - [out, iid_is(riid)] void **ppTexture3); - - HRESULT BitBlt([in] IDXSurface *pDest, - [in] const DXVEC *pPlacement, - [in] IDXSurface *pSrc, - [in] const DXBNDS *pClipBounds, - [in] DWORD dwFlags); - } - - - typedef enum DXSURFMODCOMPOP - { - DXSURFMOD_COMP_OVER = 0, - DXSURFMOD_COMP_ALPHA_MASK = 1, - DXSURFMOD_COMP_MAX_VALID = 1 - } DXSURFMODCOMPOP; - - - [ - uuid(9EA3B637-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXSurfaceModifier Interface"), - pointer_default(unique) - ] - interface IDXSurfaceModifier : IUnknown - { - HRESULT SetFillColor([in] DXSAMPLE Color); - HRESULT GetFillColor([out] DXSAMPLE *pColor); - HRESULT SetBounds([in] const DXBNDS *pBounds ); // Get supported though IDXSurface interface - HRESULT SetBackground([in] IDXSurface *pSurface); - HRESULT GetBackground([out] IDXSurface **ppSurface); - HRESULT SetCompositeOperation([in] DXSURFMODCOMPOP CompOp); - HRESULT GetCompositeOperation([out] DXSURFMODCOMPOP *pCompOp); - // - // The following methods only apply to the FOREGROUND surface - // - HRESULT SetForeground([in] IDXSurface *pSurface, [in] BOOL bTile, [in] const POINT * pOrigin); - HRESULT GetForeground([out] IDXSurface **ppSurface, [out] BOOL *pbTile, [out] POINT * pOrigin); - HRESULT SetOpacity([in] float Opacity); - HRESULT GetOpacity([out] float *pOpacity); - HRESULT SetLookup( [in]IDXLookupTable * pLookupTable ); - HRESULT GetLookup( [out]IDXLookupTable ** ppLookupTable ); - } - - - - //--- IDXSurface --------------------------------------------------- - typedef enum DXSAMPLEFORMATENUM - { - DXPF_FLAGSMASK = (0xFFFF0000), // Top word is flags, low word is enum - DXPF_NONPREMULT = (0x00010000), // Flags to be OR'd with pixel formats - DXPF_TRANSPARENCY = (0x00020000), // Color key or one-bit alpha (alpha only 0 or 0xFF) - DXPF_TRANSLUCENCY = (0x00040000), // Alpha can be any value from 0->0xFF - // - // This 3-bit field is used to determine what type of dithering to be used - // - DXPF_2BITERROR = (0x00200000), // 2 bits of error term - DXPF_3BITERROR = (0x00300000), // 3 bits of error term for color (16-bit color) - DXPF_4BITERROR = (0x00400000), // 4 bits of error term (ARGB 4444) - DXPF_5BITERROR = (0x00500000), // 5 bits of error term for color (8-bit color) - DXPF_ERRORMASK = (0x00700000), // Mask of bits used for dithering - - DXPF_NONSTANDARD = (0), // To be used for any surface that is not one of the following formats - // This can be combined with DXPFNONPREMULT if the surface can work - // better in non-premultiplied space. - DXPF_PMARGB32 = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_ARGB32 = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_ARGB4444 = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR), - DXPF_A8 = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY), - DXPF_RGB32 = (5), - DXPF_RGB24 = (6), - DXPF_RGB565 = (7 | DXPF_3BITERROR), - DXPF_RGB555 = (8 | DXPF_3BITERROR), - DXPF_RGB8 = (9 | DXPF_5BITERROR), - DXPF_ARGB1555 = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR), - DXPF_RGB32_CK = (DXPF_RGB32 | DXPF_TRANSPARENCY), - DXPF_RGB24_CK = (DXPF_RGB24 | DXPF_TRANSPARENCY), - DXPF_RGB555_CK = (DXPF_RGB555 | DXPF_TRANSPARENCY), - DXPF_RGB565_CK = (DXPF_RGB565 | DXPF_TRANSPARENCY), - DXPF_RGB8_CK = (DXPF_RGB8 | DXPF_TRANSPARENCY) - } DXSAMPLEFORMATENUM; - - - - typedef enum DXLOCKSURF - { - DXLOCKF_READ = 0, - DXLOCKF_READWRITE = (1 << 0), - DXLOCKF_EXISTINGINFOONLY = (1 << 1), // If used in conjunction with WANTRUNINFO will prevent creation of a runmap if one does not exist - DXLOCKF_WANTRUNINFO = (1 << 2), - // - // The flags in the high word should be specific to the type of pointer that - // is requested. These flags define ARGB flags. These flags are advisory and - // are not required to be set for ARGB locks. - // - DXLOCKF_NONPREMULT = (1 << 16), // Caller will request non-premultiplied data - DXLOCKF_VALIDFLAGS = (DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT) - } DXLOCKSURF; - - typedef enum DXSURFSTATUS - { - DXSURF_TRANSIENT = (1 << 0), // Data in this surface changes often. - DXSURF_READONLY = (1 << 1), // Surface is read-only - DXSURF_VALIDFLAGS = (DXSURF_TRANSIENT | DXSURF_READONLY) - } DXSURFSTATUS; - - [ - uuid(B39FD73F-E139-11d1-9065-00C04FD9189D), - helpstring("IDXSurface Interface"), - pointer_default(unique) - ] - interface IDXSurface : IDXBaseObject - { - HRESULT GetPixelFormat([out] GUID * pFormatID, [out] DXSAMPLEFORMATENUM *pSampleFormatEnum); - HRESULT GetBounds( [out]DXBNDS *pBounds ); - HRESULT GetStatusFlags([out] DWORD * pdwStatusFlags); - HRESULT SetStatusFlags([in] DWORD dwStatusFlags); - HRESULT LockSurface( [in]const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in]DWORD dwFlags, - [in]REFIID riid, [out, iid_is(riid)] void **ppPointer, - [out]ULONG* pulGenerationId ); - HRESULT GetDirectDrawSurface( [in] REFIID riid, - [out, iid_is(riid)] void ** ppSurface); - HRESULT GetColorKey(DXSAMPLE * pColorKey); // Can return E_NOTIMPL - HRESULT SetColorKey(DXSAMPLE ColorKey); // Set color of 0 to get rid of color key, can return E_NOTIMPL - HRESULT LockSurfaceDC( [in] const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in] DWORD dwFlags, - [out] IDXDCLock **ppDCLock); - HRESULT SetAppData(DWORD_PTR dwAppData); - HRESULT GetAppData(DWORD_PTR *pdwAppData); - } - - //--- IDXSurfaceInit --------------------------------------------------- - [ - uuid(9EA3B639-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXSurfaceInit Interface"), - pointer_default(unique), - local - ] - interface IDXSurfaceInit : IUnknown - { - HRESULT InitSurface([in] IUnknown *pDirectDraw, - [in] const DDSURFACEDESC *pDDSurfaceDesc, - [in] const GUID * pFormatID, - [in] const DXBNDS *pBounds, - [in] DWORD dwFlags); - }; - - - //--- IDXARGBSurfaceInit --------------------------------------------------- - [ - uuid(9EA3B63A-C37D-11d1-905E-00C04FD9189D), - helpstring("IDXARGBSurfaceInit Interface"), - pointer_default(unique), - local - ] - interface IDXARGBSurfaceInit : IDXSurfaceInit - { - HRESULT InitFromDDSurface( [in] IUnknown *pDDrawSurface, - [in] const GUID * pFormatID, - [in] DWORD dwFlags); - HRESULT InitFromRawSurface([in] IDXRawSurface *pRawSurface); - }; - - //--- IDXARGBReadPtr --------------------------------------------------- - typedef struct tagDXNATIVETYPEINFO - { - BYTE * pCurrentData; - BYTE * pFirstByte; - long lPitch; - DWORD dwColorKey; - } DXNATIVETYPEINFO; - - typedef struct tagDXPACKEDRECTDESC - { - DXBASESAMPLE *pSamples; - BOOL bPremult; - RECT rect; - long lRowPadding; - } DXPACKEDRECTDESC; - - typedef struct tagDXOVERSAMPLEDESC - { - POINT p; - DXPMSAMPLE Color; - } DXOVERSAMPLEDESC; - - - [ - uuid(EAAAC2D6-C290-11d1-905D-00C04FD9189D), - helpstring("IDXARGBReadPtr Interface"), - pointer_default(unique), - local - ] - interface IDXARGBReadPtr : IUnknown - { - HRESULT GetSurface( [in]REFIID riid, [out, iid_is( riid )]void ** ppSurface); - DXSAMPLEFORMATENUM GetNativeType( [out]DXNATIVETYPEINFO *pInfo ); - void Move( [in]long cSamples ); - void MoveToRow( [in]ULONG y ); - void MoveToXY( [in]ULONG x, [in]ULONG y); - ULONG MoveAndGetRunInfo( [in]ULONG Row, [out] const DXRUNINFO** ppInfo ); // Returns count of runs - DXSAMPLE * Unpack( [in]DXSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove ); - DXPMSAMPLE * UnpackPremult( [in]DXPMSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove ); - void UnpackRect([in] const DXPACKEDRECTDESC * pRectDesc); - }; - - - //--- IDXARGBReadWritePtr --------------------------------------------------- - [ - uuid(EAAAC2D7-C290-11d1-905D-00C04FD9189D), - helpstring("IDXARGBReadWritePtr Interface"), - pointer_default(unique), - local - ] - interface IDXARGBReadWritePtr : IDXARGBReadPtr - { - void PackAndMove( [in]const DXSAMPLE *pSamples, [in]ULONG cSamples ); - void PackPremultAndMove( [in]const DXPMSAMPLE *pSamples, [in]ULONG cSamples ); - void PackRect([in]const DXPACKEDRECTDESC *pRectDesc); - void CopyAndMoveBoth( [in]DXBASESAMPLE *pScratchBuffer, [in]IDXARGBReadPtr *pSrc, - [in]ULONG cSamples, [in]BOOL bIsOpaque ); - void CopyRect( [in] DXBASESAMPLE *pScratchBuffer, - [in] const RECT *pDestRect, [in]IDXARGBReadPtr *pSrc, - [in] const POINT *pSrcOrigin, [in]BOOL bIsOpaque); - void FillAndMove( [in]DXBASESAMPLE *pScratchBuffer, [in]DXPMSAMPLE SampVal, - [in]ULONG cSamples, [in]BOOL bDoOver ); - void FillRect( [in]const RECT *pRect, [in]DXPMSAMPLE SampVal, [in]BOOL bDoOver ); - void OverSample( [in]const DXOVERSAMPLEDESC * pOverDesc); - void OverArrayAndMove([in]DXBASESAMPLE *pScratchBuffer, - [in] const DXPMSAMPLE *pSrc, - [in] ULONG cSamples); - }; - - - [ - uuid(0F619456-CF39-11d1-905E-00C04FD9189D), - helpstring("IDXDCLock Interface"), - pointer_default(unique), - local - ] - interface IDXDCLock : IUnknown - { - HDC GetDC(void); - } - - // - // Generic interface that any transform can support which allows caller to specify the - // desired output bounds. - // - [ - uuid(B2024B50-EE77-11d1-9066-00C04FD9189D), - helpstring("IDXTScaleOutput Interface"), - pointer_default(unique) - ] - interface IDXTScaleOutput : IUnknown - { - HRESULT SetOutputSize([in] const SIZE OutSize, [in] BOOL bMaintainAspect); - }; - - - // - // Simple gradient - // - [ - uuid(B2024B51-EE77-11d1-9066-00C04FD9189D), - helpstring("IDXGradient Interface"), - pointer_default(unique) - ] - interface IDXGradient : IDXTScaleOutput - { - HRESULT SetGradient(DXSAMPLE StartColor, DXSAMPLE EndColor, BOOL bHorizontal); - HRESULT GetOutputSize([out] SIZE *pOutSize); - }; - - //--- IDXTScale -------------------------------------------------------- - // This is the control interface for the simple scale transform - // - [ - uuid(B39FD742-E139-11d1-9065-00C04FD9189D), - helpstring("IDXTScale Interface"), - pointer_default(unique) - ] - interface IDXTScale : IUnknown - { - HRESULT SetScales( [in]float Scales[2] ); - HRESULT GetScales( [out]float Scales[2] ); - HRESULT ScaleFitToSize( [in,out]DXBNDS* pClipBounds, - [in]SIZE FitToSize, [in]BOOL bMaintainAspect ); - }; - - - - //--- IDXEffect ------------------------------------------------- - // This interface is used to generically control transforms that - // are transition effects. - typedef enum DISPIDDXEFFECT - { - DISPID_DXECAPABILITIES = 10000, // Start at 10000 to avoid conflicts with inhereted interfaces - DISPID_DXEPROGRESS, - DISPID_DXESTEP, - DISPID_DXEDURATION, - DISPID_DXE_NEXT_ID - } DISPIDDXBOUNDEDEFFECT; - - typedef enum DXEFFECTTYPE - { - DXTET_PERIODIC = (1 << 0), // Result at 1 is same as result at 0 - DXTET_MORPH = (1 << 1) // Transition between 2 inputs (input 0 to input 1) - } DXEFFECTTYPE; - - - - - [ - object, - uuid(E31FB81B-1335-11d1-8189-0000F87557DB), - dual, - helpstring("IDXEffect Interface"), - pointer_default(unique) - ] - interface IDXEffect : IDispatch - { - [propget, id(DISPID_DXECAPABILITIES)] - HRESULT Capabilities([out, retval] long *pVal); - [propget, id(DISPID_DXEPROGRESS)] - HRESULT Progress([out, retval] float *pVal); - [propput, id(DISPID_DXEPROGRESS)] - HRESULT Progress([in] float newVal); - [propget, id(DISPID_DXESTEP)] - HRESULT StepResolution([out, retval] float *pVal); - [propget, id(DISPID_DXEDURATION)] - HRESULT Duration([out, retval] float *pVal); - [propput, id(DISPID_DXEDURATION)] - HRESULT Duration([in] float newVal); - }; - - //--- IDXLookupTable --------------------------------------------- - [ - uuid(01BAFC7F-9E63-11d1-9053-00C04FD9189D), - helpstring("IDXLookupTable Interface"), - pointer_default(unique) - ] - interface IDXLookupTable : IDXBaseObject - { - HRESULT GetTables( [out]BYTE RedLUT[256], - [out]BYTE GreenLUT[256], - [out]BYTE BlueLUT[256], - [out]BYTE AlphaLUT[256] ); - - HRESULT IsChannelIdentity([out] DXBASESAMPLE * pSampleBools); - HRESULT GetIndexValues([in] ULONG Index, [out] DXBASESAMPLE *pSample); - HRESULT ApplyTables([in, out] DXSAMPLE *pSamples, [in] ULONG cSamples); - }; - - - - typedef struct DXRAWSURFACEINFO - { - BYTE * pFirstByte; - long lPitch; - ULONG Width; - ULONG Height; - const GUID * pPixelFormat; - HDC hdc; - DWORD dwColorKey; // Note: High byte must == 0xFF for color keyed surface. Low 3 bytes are native data type. - DXBASESAMPLE * pPalette; - } DXRAWSURFACEINFO; - - // - // User created objects support IDXRawSurface - // - - [ - uuid(09756C8A-D96A-11d1-9062-00C04FD9189D), - helpstring("IDXRawSurface Interface"), - pointer_default(unique), - local - ] - interface IDXRawSurface : IUnknown - { - HRESULT GetSurfaceInfo(DXRAWSURFACEINFO * pSurfaceInfo); - } - - - //+----------------------------------------------------------------------------- - // - // IHTMLDXTransform - // - //------------------------------------------------------------------------------ - - [ - uuid(30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5), - helpstring("IHTMLDXTransform Interface"), - pointer_default(unique), - local - ] - interface IHTMLDXTransform : IUnknown - { - HRESULT SetHostUrl(BSTR bstrHostUrl); - } - - - //=== CoClass definitions ================================================= - - [ - uuid(54314D1D-35FE-11d1-81A1-0000F87557DB), - version(1.0), - helpstring("Microsoft DirectX Transform 1.0 Type Library") - ] - library DXTRANSLib - { - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - /////////////////////////////// - // DXTransformFactory CoClass - /////////////////////////////// - [ - uuid(D1FE6762-FC48-11D0-883A-3C8B00C10000), - helpstring("DXTransformFactory Class") - ] - coclass DXTransformFactory - { - [default] interface IDXTransformFactory; - interface IDXSurfaceFactory; - }; - - /////////////////////////////// - // DXTaskManager CoClass - /////////////////////////////// - [ - uuid(4CB26C03-FF93-11d0-817E-0000F87557DB), - helpstring("DXTaskManager Class") - ] - coclass DXTaskManager - { - [default] interface IDXTaskManager; - }; - - /////////////////////////////// - // DXTScale CoClass - /////////////////////////////// - [ - uuid(555278E2-05DB-11D1-883A-3C8B00C10000), - helpstring("DXTScale Class") - ] - coclass DXTScale - { - [default] interface IDXTScale; - }; - - /////////////////////////////// - // DXSurface CoClass - /////////////////////////////// - [ - uuid(0E890F83-5F79-11D1-9043-00C04FD9189D), - helpstring("DXSurface Class") - ] - coclass DXSurface - { - [default] interface IDXSurface; - }; - - /////////////////////////////// - // DXSurfaceModifier CoClass - /////////////////////////////// - [ - uuid(3E669F1D-9C23-11d1-9053-00C04FD9189D), - helpstring("DXSurfaceModifier Class") - ] - coclass DXSurfaceModifier - { - [default] interface IDXSurfaceModifier; - }; - - /////////////////////////////// - // DXGradient CoClass - /////////////////////////////// - [ - uuid(C6365470-F667-11d1-9067-00C04FD9189D), - helpstring("DXGradient Class") - ] - coclass DXGradient - { - [default] interface IDXGradient; - }; - }; - - -#endif // DirectX 8.0 content \ No newline at end of file diff --git a/import/DirectX8/include/DShowIDL/dyngraph.idl b/import/DirectX8/include/DShowIDL/dyngraph.idl deleted file mode 100644 index d8a07169e..000000000 --- a/import/DirectX8/include/DShowIDL/dyngraph.idl +++ /dev/null @@ -1,318 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DynGraph.idl -// -// Desc: Dynamic graph interfaces -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -interface IPinConnection; -interface IPinFlowControl; -interface IGraphConfig; -interface IGraphConfigCallback; - -//-------------------------------------------------------------------- -// -// IPinConnection - supported by input pins -// -//-------------------------------------------------------------------- -[ - local, - object, - uuid(4a9a62d3-27d4-403d-91e9-89f540e55534), - pointer_default(unique) -] -interface IPinConnection : IUnknown { - - // Do you accept this type chane in your current state? - HRESULT DynamicQueryAccept([in] const AM_MEDIA_TYPE *pmt); - - // Set event when EndOfStream receive - do NOT pass it on - // This condition is cancelled by a flush or Stop - HRESULT NotifyEndOfStream([in] HANDLE hNotifyEvent); - - // Are you an 'end pin' - HRESULT IsEndPin(); - - HRESULT DynamicDisconnect(); -}; - -//-------------------------------------------------------------------- -// -// IPinFlowControl - supported by output pins -// -//-------------------------------------------------------------------- -[ - local, - object, - uuid(c56e9858-dbf3-4f6b-8119-384af2060deb), - pointer_default(unique) -] -interface IPinFlowControl : IUnknown { - // Block processing on this pin - HRESULT Block([in] DWORD dwBlockFlags, [in] HANDLE hEvent); -} - -// block flags -enum _AM_PIN_FLOW_CONTROL_BLOCK_FLAGS { - AM_PIN_FLOW_CONTROL_BLOCK = 0x00000001, // 0 means unblock -}; - - -// Reconnect flags -typedef enum _AM_GRAPH_CONFIG_RECONNECT_FLAGS { - AM_GRAPH_CONFIG_RECONNECT_DIRECTCONNECT = 0x00000001, - AM_GRAPH_CONFIG_RECONNECT_CACHE_REMOVED_FILTERS = 0x00000002, - AM_GRAPH_CONFIG_RECONNECT_USE_ONLY_CACHED_FILTERS = 0x00000004 -} AM_GRAPH_CONFIG_RECONNECT_FLAGS; - -// RemoveFilterEx flags -enum _REM_FILTER_FLAGS { - REMFILTERF_LEAVECONNECTED = 0x00000001 -}; - -typedef enum _AM_FILTER_FLAGS { - AM_FILTER_FLAGS_REMOVABLE = 0x00000001 - } AM_FILTER_FLAGS; - - -//-------------------------------------------------------------------- -// -// IGraphConfig -// -//-------------------------------------------------------------------- - -[ - local, - object, - uuid(03A1EB8E-32BF-4245-8502-114D08A9CB88), - pointer_default(unique) -] -interface IGraphConfig : IUnknown { - HRESULT Reconnect([in] IPin *pOutputPin, - [in] IPin *pInputPin, - [in] const AM_MEDIA_TYPE *pmtFirstConnection, - [in] IBaseFilter *pUsingFilter, // can be NULL - [in] HANDLE hAbortEvent, - [in] DWORD dwFlags); - - HRESULT Reconfigure([in] IGraphConfigCallback *pCallback, - [in] PVOID pvContext, - [in] DWORD dwFlags, - [in] HANDLE hAbortEvent); - - - HRESULT AddFilterToCache([in] IBaseFilter *pFilter); - HRESULT EnumCacheFilter([out] IEnumFilters **pEnum); - HRESULT RemoveFilterFromCache([in]IBaseFilter *pFilter); - - // Get the start time associated with the last Run() call - // If the graph is not running returns VFW_E_WRONG_STATE - HRESULT GetStartTime([out] REFERENCE_TIME *prtStart); - - HRESULT PushThroughData( - [in] IPin *pOutputPin, - [in] IPinConnection *pConnection, - [in] HANDLE hEventAbort); - - HRESULT SetFilterFlags([in] IBaseFilter *pFilter, [in] DWORD dwFlags); - HRESULT GetFilterFlags([in] IBaseFilter *pFilter, [out] DWORD *pdwFlags); - - HRESULT RemoveFilterEx( [in] IBaseFilter *pFilter, DWORD Flags ); -} - -//-------------------------------------------------------------------- -// -// IGraphConfigCallback -// -//-------------------------------------------------------------------- - -[ - local, - object, - uuid(ade0fd60-d19d-11d2-abf6-00a0c905f375), - pointer_default(unique) -] -interface IGraphConfigCallback : IUnknown -{ - HRESULT Reconfigure(PVOID pvContext, DWORD dwFlags); -} - -// Filter Chain Definition -// -// Filter chains have the following properties: -// -// - Each filter chain has one or more filters. -// -// - Each filter in a filter chain has at most one connected input pin and one -// connected output pin. For example, filters A, C, D, F, G, H, I, J and K -// (see the diagram below) can be in a filter chain because each one has at -// most one connected input pin and one connected output pin. -// -// - Any filter in a chain is reachable by any other filter in the chain. -// For example, in the filter chain F-G-H, F can reach H by following the F- -// G connection to G and then following the G-H connection to H. Filters F -// and J cannot be in the same filter chain because J is not reachable from -// F. Anotherwords, there no sequence of connected filters between F and J. -// -// - The start filter is the only filter in the filter chain who's input -// pin is not connected to another filter in the chain. For instance, F is -// the start filter in F-G-H because F's input pin is connected to E and E -// is not in the filter chain. G's input pin is connected to F and H's is -// connected to G. Both F and G are in the filter chain. -// -// - The end filter is the only filter in the filter chain who's output pin -// is not connected to another filter in the chain. For example, in the -// filter chain J-K, K is the end filter because K's output pin is -// connected to L. J's output pin is connected to K and K is in the J-K -// filter chain. -// -// -// --->|---| |---|---> -// | C |--->| D | -// |---| |---|--->|---| |---|--->|---| |---| |---| |---| -// | A |--->| B | | E |--->| F |--->| G |--->| H | -// |---| |---|--->|---|------------>|---| |---| |---| |---| -// | I |---> -// --->|---|---> -// -// |---| |---| |---| -// | J |--->| K |--->| L | -// |---| |---| |---| -// -// Example Filter Graph -// -// -// -// IFilterChain Methods Documentation -// -// HRESULT StartChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); -// -// StartChain() switches all the filters in the chain into the running state -// If one of the filters will not switch to the running state, then all the filters -// in the chain are stopped. This method can only be called if the filter graph is -// running. -// -// Parameters: -// - pStartFilter [in] -// The first filter in the filter chain. Note that this can be the same -// filter as pEndFilter . -// -// - pEndFilter [in] -// The last filter in the filter chain. Note that this can be the same -// filter as pStartFilter. If pEndFilter is NULL then the filter chain extends -// from pStartFilter to the last downstream filter which can be in a filter chain. -// For example, IFilterChain::StartChain( A, NULL ) would start filter A. -// IFilterChain::StartChain( G, NULL ) would start filters G and H. -// IFilterChain::StartChain( C, NULL ) would start filters C and D. Finally, -// IFilterChain::StartChain( E, NULL ) would fail because E cannot be in a -// filter chain (see the Filter Chain Definition section for more information). -// -// Return Value: -// An HRESULT. See the Direct Show SDK and COM SDK documentation for more -// information on interpreting HRESULTs. -// -// -// -// -// HRESULT PauseChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); -// -// PauseChain() switches all the filters in a chain to the paused state. If it cannot -// switch one of the filtres into the paused state, all the filters in the chain are -// stopped. This method can only be called if the filter graph is paused. -// -// Parameters: -// - pStartFilter [in] -// The first filter in the filter chain. Note that this can be the same -// filter as pEndFilter . -// -// - pEndFilter [in] -// The last filter in the filter chain. Note that this can be the same -// filter as pStartFilter. If pEndFilter is NULL then the filter chain extends -// from pStartFilter to the last downstream filter which can be in a filter chain. -// For example, IFilterChain::StopChain( A, NULL ) would stop filter A. -// IFilterChain::StopChain( G, NULL ) would stop filters G and H. -// IFilterChain::StopChain( C, NULL ) would stop filters C and D. Finally, -// IFilterChain::StopChain( E, NULL ) would fail because E cannot be in a filter -// chain (see the Filter Chain Definition section for more information). -// -// -// Return Value: -// An HRESULT. See the Direct Show SDK and COM SDK documentation for more -// information on interpreting HRESULTs. -// -// -// -// HRESULT StopChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); -// -// StopChain() switches all the filters in chain to the stopped state. -// -// Parameters: -// - pStartFilter [in] -// The first filter in the filter chain. Note that this can be the same -// filter as pEndFilter . -// -// - pEndFilter [in] -// The last filter in the filter chain. Note that this can be the same -// filter as pStartFilter. If pEndFilter is NULL then the filter chain extends -// from pStartFilter to the last downstream filter which can be in a filter chain. -// For example, IFilterChain::StopChain( A, NULL ) would stop filter A. -// IFilterChain::StopChain( G, NULL ) would stop filters G and H. -// IFilterChain::StopChain( C, NULL ) would stop filters C and D. Finally, -// IFilterChain::StopChain( E, NULL ) would fail because E cannot be in a filter -// chain (see the Filter Chain Definition section for more information). -// -// -// Return Value: -// An HRESULT. See the Direct Show SDK and COM SDK documentation for more -// information on interpreting HRESULTs. -// -// -// -// -// -// HRESULT RemoveChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); -// -// RemoveChain() removes every filter in a chain from the filter graph. -// The filters can be removed while the graph is running. -// -// Parameters: -// - pStartFilter [in] -// The first filter in the filter chain. Note that this can be the same -// filter as pEndFilter . -// -// - pEndFilter [in] -// The last filter in the filter chain. Note that this can be the same -// filter as pStartFilter. If pEndFilter is NULL then the filter chain -// extends from pStartFilter to the last downstream filter which can be in a -// filter chain. For example, IFilterChain::RemoveChain( A, NULL ) would remove -// filter A from the filter graph. IFilterChain::RemoveChain( G, NULL ) would -// remove filters G and H. IFilterChain::RemoveChain( C, NULL ) would remove -// filters C and D. Finally, IFilterChain::RemoveChain( E, NULL ) would fail -// because E cannot be in a filter chain (see the Filter Chain Definition -// section for more information). -// -// -// Return Value: -// An HRESULT. See the Direct Show SDK and COM SDK documentation for more -// information on interpreting HRESULTs. -// -// -[ - local, - object, - uuid(DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29), - pointer_default(unique) -] -interface IFilterChain : IUnknown -{ - HRESULT StartChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); - HRESULT PauseChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); - HRESULT StopChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); - HRESULT RemoveChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter ); -} - - - - diff --git a/import/DirectX8/include/DShowIDL/iamovie.idl b/import/DirectX8/include/DShowIDL/iamovie.idl deleted file mode 100644 index 87d6b389a..000000000 --- a/import/DirectX8/include/DShowIDL/iamovie.idl +++ /dev/null @@ -1,144 +0,0 @@ -//------------------------------------------------------------------------------ -// File: IAMovie.idl -// -// Desc: -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -[ -object, -uuid(359ace10-7688-11cf-8b23-00805f6cef60), -pointer_default(unique) -] -interface IAMovie : IFilterGraph -{ - // IGraphBuilder - // Connect these two pins directly or indirectly, using transform filters - // if necessary. - - HRESULT Connect - ( [in] IPin * ppinOut, // the output pin - [in] IPin * ppinIn // the input pin - ); - - - // Connect this output pin directly or indirectly, using transform filters - // if necessary to something that will render it. - - HRESULT Render - ( [in] IPin * ppinOut // the output pin - ); - - - // IMediaControl methods - HRESULT Run(); - HRESULT Pause(); - HRESULT Stop(); - - //returns the state. same semantics as IMediaFilter::GetState - - HRESULT GetState( - [in] LONG msTimeout, - [out] FILTER_STATE* pfs); - - // adds and connects filters needed to play the specified file - HRESULT RenderFile( - [in] LPCWSTR strFilename); - - // adds to the graph the source filter that can read this file, - // and returns an IFilterInfo object for it - HRESULT AddSourceFilter( - [in] LPCWSTR strFilename, - [out] IBaseFilter ** ppUnk); - - // get back the event handle. This is manual-reset - // (don't - it's reset by the event mechanism) and remains set - // when events are queued, and reset when the queue is empty. - HRESULT GetEventHandle( - [out] HEVENT * hEvent); - - // remove the next event notification from the head of the queue and - // return it. Waits up to msTimeout millisecs if there are no events. - // if a timeout occurs without any events, this method will return - // E_ABORT, and the value of the event code and other parameters - // is undefined. - HRESULT GetEvent( - [out] long * lEventCode, - [out] long * lParam1, - [out] long * lParam2, - [in] long msTimeout - ); - - // Calls GetEvent repeatedly discarding events until it finds a - // completion event (EC_COMPLETE, EC_ERRORABORT, or EC_USERABORT). - // The completion event is removed from the queue and returned - // in pEvCode. Note that the object is still in running mode until - // a Pause or Stop call is made. - // If the timeout occurs, *pEvCode will be 0 and E_ABORT will be - // returned. - HRESULT WaitForCompletion( - [in] long msTimeout, - [out] long * pEvCode); - - // cancels any system handling of the specified event code - // and ensures that the events are passed straight to the application - // (via GetEvent) and not handled. A good example of this is - // EC_REPAINT: default handling for this ensures the painting of the - // window and does not get posted to the app. - HRESULT CancelDefaultHandling( - [in] long lEvCode); - - // restore the normal system default handling that may have been - // cancelled by CancelDefaultHandling(). - HRESULT RestoreDefaultHandling( [in] long lEvCode); - - // properties - HRESULT get_Duration( - [out] REFTIME* plength); - - HRESULT put_CurrentPosition( - [in] REFTIME llTime); - - HRESULT get_CurrentPosition( - [out] REFTIME* pllTime); - - HRESULT get_StopTime( - [out] REFTIME* pllTime); - - HRESULT put_StopTime( - [in] REFTIME llTime); - - HRESULT get_PrerollTime( - [out] REFTIME* pllTime); - HRESULT put_PrerollTime( - [in] REFTIME llTime); - - HRESULT put_Rate( - [in] double dRate); - HRESULT get_Rate( - [out] double * pdRate); - - /* New methods */ - HRESULT RemoveAllFilters(); - HRESULT Play(); - HRESULT PlayFile([in] LPCWSTR strFilename); - HRESULT EnumFiltersByInterface( [in] REFIID riid, [out] IEnumFilters ** ppEnum ); - HRESULT EnumPins( [out] IEnumPins ** ppEnum ); - HRESULT EnumPinsIn( [out] IEnumPins ** ppEnum ); - HRESULT EnumPinsOut( [out] IEnumPins ** ppEnum ); - HRESULT RenderAll(); - HRESULT RenderNewFile( [in] LPCWSTR strFilename); - - // Free any resources associated with the parameters to an event. - // Event parameters may be LONGs, IUnknown* or BSTR. No action - // is taken with LONGs. IUnknown are passed addrefed and need a - // Release call. BSTR are allocated by the task allocator and will be - // freed by calling the task allocator. - HRESULT FreeEventParams( - [in] long lEvCode, - [in] long lParam1, - [in] long lParam2); -} - diff --git a/import/DirectX8/include/DShowIDL/mediaobj.idl b/import/DirectX8/include/DShowIDL/mediaobj.idl deleted file mode 100644 index 08301f6a1..000000000 --- a/import/DirectX8/include/DShowIDL/mediaobj.idl +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MediaObj.idl -// -// Desc: Define the interfaces for DirectX Media Objects. This file will be -// processed by the MIDL tool to produce mediaobj.h and proxy-stub code. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; -import "objidl.idl"; - -// DMO_MEDIA_TYPE structure - -cpp_quote("#ifdef __strmif_h__") -cpp_quote("typedef AM_MEDIA_TYPE DMO_MEDIA_TYPE;") -cpp_quote("#else") -typedef struct _DMOMediaType { - GUID majortype; - GUID subtype; - BOOL bFixedSizeSamples; - BOOL bTemporalCompression; - ULONG lSampleSize; - GUID formattype; - IUnknown *pUnk; - ULONG cbFormat; - [size_is(cbFormat)] BYTE * pbFormat; -} DMO_MEDIA_TYPE; -typedef LONGLONG REFERENCE_TIME; -cpp_quote("#endif") - - -// Per-buffer flags that apply to input buffers -enum _DMO_INPUT_DATA_BUFFER_FLAGS { - DMO_INPUT_DATA_BUFFERF_SYNCPOINT = 0x00000001, - DMO_INPUT_DATA_BUFFERF_TIME = 0x00000002, - DMO_INPUT_DATA_BUFFERF_TIMELENGTH = 0x00000004 -}; - -// Per-buffer flags that apply to output buffers. -enum _DMO_OUTPUT_DATA_BUFFER_FLAGS { - DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT = 0x00000001, - DMO_OUTPUT_DATA_BUFFERF_TIME = 0x00000002, - DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH = 0x00000004, - - // - // This flag means the object could have generated more data for this - // output stream, even with no additional input from any input stream, - // but the output buffer did not have sufficient room. - // - DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE = 0x01000000 -}; - -// Flags returned by GetInputStatus() -enum _DMO_INPUT_STATUS_FLAGS { - // - // ACCEPT_DATA indicates that the input stream is ready to accept - // new data via ProcessInput(). - // - DMO_INPUT_STATUSF_ACCEPT_DATA = 0x00000001 -}; - -// Flags returned by GetInputStreamInfo() -enum _DMO_INPUT_STREAM_INFO_FLAGS { - DMO_INPUT_STREAMF_WHOLE_SAMPLES = 0x00000001, - DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = 0x00000002, - DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE = 0x00000004, - DMO_INPUT_STREAMF_HOLDS_BUFFERS = 0x00000008 -}; - -// Flags returned by GetOutputStreamInfo() -enum _DMO_OUTPUT_STREAM_INFO_FLAGS { - DMO_OUTPUT_STREAMF_WHOLE_SAMPLES = 0x00000001, - DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = 0x00000002, - DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE = 0x00000004, - DMO_OUTPUT_STREAMF_DISCARDABLE = 0x00000008, - DMO_OUTPUT_STREAMF_OPTIONAL = 0x00000010 -}; - -// SetType flags -enum _DMO_SET_TYPE_FLAGS { - DMO_SET_TYPEF_TEST_ONLY = 0x00000001,// check but don't set - DMO_SET_TYPEF_CLEAR = 0x00000002 // unset -}; - -// Process Output Flags -enum _DMO_PROCESS_OUTPUT_FLAGS { - DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER = 0x00000001 // Discard -}; - -// Buffer wrapper interface -[ - object, - uuid(59eff8b9-938c-4a26-82f2-95cb84cdc837) -] -interface IMediaBuffer : IUnknown -{ - HRESULT SetLength( - DWORD cbLength - ); - HRESULT GetMaxLength( - [out] DWORD *pcbMaxLength - ); - HRESULT GetBufferAndLength( - [out] BYTE **ppBuffer, // not filled if NULL - [out] DWORD *pcbLength // not filled if NULL - ); -} - -// -// Output buffer info structure: one of these must be passed in for each -// output stream with every ProcessOutput() call -// All [out] fields should be -// assumed undefined if ProcessOutput() failed -// -typedef struct _DMO_OUTPUT_DATA_BUFFER { - - IMediaBuffer *pBuffer; // [in] can be NULL - - // ProcessOutput() must set any appropriate flags and zero out the rest. - DWORD dwStatus; // [out] DMO_OUTPUT_DATA_BUFFERF_XXX (INCOMPLETE, etc.) - - // - // Each of these is valid if the corresponding flag is set in dwStatus - // - REFERENCE_TIME rtTimestamp; // [out] - REFERENCE_TIME rtTimelength; // [out] -} DMO_OUTPUT_DATA_BUFFER, *PDMO_OUTPUT_DATA_BUFFER; - - -// Interface supported by media objects -[ - object, - uuid(d8ad0f58-5494-4102-97c5-ec798e59bcf4) -] -interface IMediaObject : IUnknown -{ - -// -// Stream enumeration -// - HRESULT GetStreamCount( - [out] DWORD *pcInputStreams, - [out] DWORD *pcOutputStreams - ); - HRESULT GetInputStreamInfo( - DWORD dwInputStreamIndex, // 0-based - [out] DWORD *pdwFlags // HOLDS_BUFFERS - ); - HRESULT GetOutputStreamInfo( - DWORD dwOutputStreamIndex, // 0-based - [out] DWORD *pdwFlags // Media object sets to 0 - ); - -// -// Mediatypes -// - // - // GetType - iterate through media types supported by a stream. - // Returns S_FALSE if the type index is out of range ("no more types"). - // - HRESULT GetInputType( - DWORD dwInputStreamIndex, - DWORD dwTypeIndex, // 0-based - [out] DMO_MEDIA_TYPE *pmt - ); - HRESULT GetOutputType( - DWORD dwOutputStreamIndex, - DWORD dwTypeIndex, // 0-based - [out] DMO_MEDIA_TYPE *pmt - ); - - // - // SetType - tell the object the type of data it will work with. - // - HRESULT SetInputType( - DWORD dwInputStreamIndex, - [in] const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags // test only - ); - HRESULT SetOutputType( - DWORD dwOutputStreamIndex, - [in] const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags // test only - ); - - // - // GetCurrentType - get the last mediatype supplied via SetType. - // Returns S_FALSE if SetType has not been called. - // - HRESULT GetInputCurrentType( - DWORD dwInputStreamIndex, - [out] DMO_MEDIA_TYPE *pmt - ); - HRESULT GetOutputCurrentType( - DWORD dwOutputStreamIndex, - [out] DMO_MEDIA_TYPE *pmt - ); - -// -// SizeInfo -// - // - // GetSizeInfo - Get buffer size requirementes of a stream. - // - // If buffer size depends on the media type used, the object should - // base its response on the most recent media type set for this stream. - // If no mediatype has been set, the object may return an error. - // - HRESULT GetInputSizeInfo( - DWORD dwInputStreamIndex, - [out] DWORD *pcbSize, // size of input 'quantum' - [out] DWORD *pcbMaxLookahead, // max total bytes held - [out] DWORD *pcbAlignment // buffer alignment requirement - ); - HRESULT GetOutputSizeInfo( - DWORD dwOutputStreamIndex, - [out] DWORD *pcbSize, // size of output 'quantum' - [out] DWORD *pcbAlignment // buffer alignment requirement - ); - -// -// Latency methods -// - HRESULT GetInputMaxLatency( - DWORD dwInputStreamIndex, - [out] REFERENCE_TIME *prtMaxLatency - ); - HRESULT SetInputMaxLatency( - DWORD dwInputStreamIndex, - REFERENCE_TIME rtMaxLatency - ); - -// -// Streaming / state methods -// - // - // Flush() - discard any buffered data. - // - HRESULT Flush(); - - // - // Send a discontinuity to an input stream. The object will not - // accept any more data on this input stream until the discontinuity - // has been completely processed, which may involve multiple - // ProcessOutput() calls. - // - HRESULT Discontinuity(DWORD dwInputStreamIndex); - - // - // If a streaming object needs to perform any time consuming - // initialization before it can stream data, it should do it inside - // AllocateStreamingResources() rather than during the first process - // call. - // - // This method is NOT guaranteed to be called before streaming - // starts. If it is not called, the object should perform any - // required initialization during a process call. - // - HRESULT AllocateStreamingResources(); - - // Free anything allocated in AllocateStreamingResources(). - HRESULT FreeStreamingResources(); - - // GetInputStatus - the only flag defined right now is ACCEPT_DATA. - HRESULT GetInputStatus( - DWORD dwInputStreamIndex, - [out] DWORD *dwFlags // ACCEPT_DATA - ); - - // - // Pass one new buffer to an input stream - // - HRESULT ProcessInput( - DWORD dwInputStreamIndex, - IMediaBuffer *pBuffer, // must not be NULL - DWORD dwFlags, // DMO_INPUT_DATA_BUFFERF_XXX (syncpoint, etc.) - REFERENCE_TIME rtTimestamp, // valid if flag set - REFERENCE_TIME rtTimelength // valid if flag set - ); - - // - // ProcessOutput() - generate output for current input buffers - // - // Output stream specific status information is returned in the - // dwStatus member of each buffer wrapper structure. - // - HRESULT ProcessOutput( - DWORD dwFlags, // DMO_PROCESS_OUTPUT_FLAGS - DWORD cOutputBufferCount, // # returned by GetStreamCount() - [in,out,size_is(cOutputBufferCount)] - DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, // one per stream - [out] DWORD *pdwStatus // TBD, must be set to 0 - ); - - // Locking - lock if bLock is TRUE, otherwise unlock - HRESULT Lock(LONG bLock); -}; - - -// -// Interface returned by the DMO enumeration API -// -[ -object, -uuid(2c3cd98a-2bfa-4a53-9c27-5249ba64ba0f) -] -interface IEnumDMO : IUnknown { - HRESULT Next( - DWORD cItemsToFetch, - [out, size_is(cItemsToFetch), length_is(*pcItemsFetched)] CLSID *pCLSID, - [out, size_is(cItemsToFetch), length_is(*pcItemsFetched), string] WCHAR **Names, - [out] DWORD *pcItemsFetched - ); - HRESULT Skip( - DWORD cItemsToSkip - ); - HRESULT Reset(void); - HRESULT Clone( - [out] IEnumDMO **ppEnum - ); -} - - -// Flags for IMediaObjectInPlace::Process -enum _DMO_INPLACE_PROCESS_FLAGS { - DMO_INPLACE_NORMAL = 0x00000000, - DMO_INPLACE_ZERO = 0x00000001 -}; - -[ -object, -uuid(651b9ad0-0fc7-4aa9-9538-d89931010741) -] -interface IMediaObjectInPlace : IUnknown { - - // Proces - Given a buffer of size ulSize, put the output - // of the DMO into the same buffer. - HRESULT Process( - [in] ULONG ulSize, - [in,out,size_is(ulSize)] BYTE* pData, - [in] REFERENCE_TIME refTimeStart, - [in] DWORD dwFlags - ); - - // Create a copy of the In-Place Media Object. This allows - // for very fast initialization of a number of In-Place objects - // in a known state. - HRESULT Clone( - [out] IMediaObjectInPlace **ppMediaObject - ); - - // GetLatency - Returns a REFERENCE_TIME value - // (1 tick = 100ns) which corresponds to the latency time - // processing this effect will add to the graph. This assumes - // the effect cost per buffer is a constant. - HRESULT GetLatency( - [out] REFERENCE_TIME *pLatencyTime - ); -} - -// Quality control status flags -enum _DMO_QUALITY_STATUS_FLAGS { - DMO_QUALITY_STATUS_ENABLED = 0x00000001 -}; - -[ -object, -uuid(65abea96-cf36-453f-af8a-705e98f16260) -] -interface IDMOQualityControl : IUnknown { - HRESULT SetNow( - [in] REFERENCE_TIME rtNow - ); - HRESULT SetStatus( - [in] DWORD dwFlags - ); - HRESULT GetStatus( - [out] DWORD *pdwFlags - ); -} - -// Flags for IVideoOutputOptimizations -enum _DMO_VIDEO_OUTPUT_STREAM_FLAGS { - DMO_VOSF_NEEDS_PREVIOUS_SAMPLE = 0x00000001 -}; - -[ -object, -uuid(be8f4f4e-5b16-4d29-b350-7f6b5d9298ac) -] -interface IDMOVideoOutputOptimizations : IUnknown { - HRESULT QueryOperationModePreferences ( - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedCapabilities - ); - HRESULT SetOperationMode ( - ULONG ulOutputStreamIndex, - DWORD dwEnabledFeatures - ); - HRESULT GetCurrentOperationMode ( - ULONG ulOutputStreamIndex, - DWORD *pdwEnabledFeatures - ); - HRESULT GetCurrentSampleRequirements ( - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedFeatures - ); -} - diff --git a/import/DirectX8/include/DShowIDL/medparam.idl b/import/DirectX8/include/DShowIDL/medparam.idl deleted file mode 100644 index b589922b8..000000000 --- a/import/DirectX8/include/DShowIDL/medparam.idl +++ /dev/null @@ -1,228 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MedParam.idl -// -// Desc: Definition of the IMediaParams and associated interfaces. These -// interfaces are designed to allow communication of curve-following -// behaviors for parameters of objects which require dynamic changes -// to their parameters at run time. All changes are specified by -// timestamp and curve type to ensure the parameters can be set -// at sufficient accuracy with predictable behavior on subsequent -// playback of the same curves. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "oaidl.idl"; -import "ocidl.idl"; -import "strmif.idl"; - - -//------------------------------------------------------------------------------ -// Define the semantic type to be used for each parameter. All values passed -// into this interface are 32-bit floats, but the interface can specify that -// the values must be integer, booleans, or enumerated types -//------------------------------------------------------------------------------ -typedef float MP_DATA; // All data is 32-bit floats - -typedef enum _MP_Type { - MPT_INT, // data is signed 23 bit integer (mantissa) - MPT_FLOAT, // data is 32bit IEEE float - MPT_BOOL, // data is true or false (using ANSI C++ definition) - MPT_ENUM, // data is a set (represented by consecutive integers) - MPT_MAX, -} MP_TYPE; - -const MP_DATA MPBOOL_TRUE = 1.0; // Value of true -const MP_DATA MPBOOL_FALSE = 0.0; // Value of false - - -//------------------------------------------------------------------------------ -// Define the types of curves which are supported -//------------------------------------------------------------------------------ -typedef enum _MP_CURVE_TYPE { - MP_CURVE_JUMP = 0x0001, // No interpolation, just jump to next point - MP_CURVE_LINEAR = 0x0002, // Linear interpolation (y follows x from 0.0 to 1.0) - MP_CURVE_SQUARE = 0x0004, // y follow x^2 from 0.0 to 1.0 - MP_CURVE_INVSQUARE = 0x0008, // y follows 1-(x^2) from 0.0 to 1.0 - MP_CURVE_SINE = 0x0010, // y follows sin(x) from -pi/2 to pi/2 -} MP_CURVE_TYPE; - - -//------------------------------------------------------------------------------ -// Capability bits. Used by the object to specify what capabilities it has. -//------------------------------------------------------------------------------ -typedef DWORD MP_CAPS; -// Curve capabilities - If the cap bit is set, that type of curve is supported -const MP_CAPS MP_CAPS_CURVE_JUMP = MP_CURVE_JUMP; -const MP_CAPS MP_CAPS_CURVE_LINEAR = MP_CURVE_LINEAR; -const MP_CAPS MP_CAPS_CURVE_SQUARE = MP_CURVE_SQUARE; -const MP_CAPS MP_CAPS_CURVE_INVSQUARE = MP_CURVE_INVSQUARE; -const MP_CAPS MP_CAPS_CURVE_SINE = MP_CURVE_SINE; - - -//------------------------------------------------------------------------------ -// Structure used to return information about the type and limits of a parameter -//------------------------------------------------------------------------------ -typedef struct _MP_PARAMINFO { - MP_TYPE mpType; // One of MP_TYPE_xxx codes - MP_CAPS mopCaps; // A collection of MP_CAPS flags - - // Minimum and maximum values - MP_DATA mpdMinValue; // minimum legal value - MP_DATA mpdMaxValue; // maximum legal value - MP_DATA mpdNeutralValue; // default or 'center' value - - // Defualt Unit and Label text. These strings will ALWAYS be English - // strings in the UNICODE character set. For international text - // use the GetParamText member function - WCHAR szUnitText[32]; // units of the parameter - WCHAR szLabel[32]; // name of the parameter - -} MP_PARAMINFO; - - -//------------------------------------------------------------------------------ -// Parameter Index types -//------------------------------------------------------------------------------ -typedef DWORD DWORD; -const DWORD DWORD_ALLPARAMS = -1; // Apply this operation to all params - - -//------------------------------------------------------------------------------ -// Defined list of timestamp types -//------------------------------------------------------------------------------ -typedef DWORD MP_TIMEDATA; // Extra data to further define type - -// REFERENCE_TIME (1 tick = 100 nanoseconds, MP_TIMEDATA ignored) -cpp_quote("DEFINE_GUID(GUID_TIME_REFERENCE,") -cpp_quote("0x93ad712b, 0xdaa0, 0x4ffe, 0xbc, 0x81, 0xb0, 0xce, 0x50, 0xf, 0xcd, 0xd9);") - -// Music Time (MP_TIMEDATA = parts/quarter note) -cpp_quote("DEFINE_GUID(GUID_TIME_MUSIC,") -cpp_quote("0x574c49d, 0x5b04, 0x4b15, 0xa5, 0x42, 0xae, 0x28, 0x20, 0x30, 0x11, 0x7b);") - -// Time is measures in samples. MP_TIMEDATA = Samples/sec) -cpp_quote("DEFINE_GUID(GUID_TIME_SAMPLES,") -cpp_quote("0xa8593d05, 0xc43, 0x4984, 0x9a, 0x63, 0x97, 0xaf, 0x9e, 0x2, 0xc4, 0xc0);") - - -//------------------------------------------------------------------------------ -// The value of a given parameter at a specific point in time -//------------------------------------------------------------------------------ -typedef DWORD MP_FLAGS; -const MP_FLAGS MPF_ENVLP_STANDARD = 0x0000; // Use all data provided -const MP_FLAGS MPF_ENVLP_BEGIN_CURRENTVAL = 0x0001; - // Ignore valStart value, use current value as the staring point -const MP_FLAGS MPF_ENVLP_BEGIN_NEUTRALVAL = 0x0002; - // Ignore valStart value, use neutral value as the staring point - -typedef struct _MP_ENVELOPE_SEGMENT { - REFERENCE_TIME rtStart; // Start time in current time format - REFERENCE_TIME rtEnd; // End time in current time format - MP_DATA valStart; // Initial Value - MP_DATA valEnd; // Final Value - MP_CURVE_TYPE iCurve; // One of MP_CURVE_TYPE codes - MP_FLAGS flags; // Special cases -} MP_ENVELOPE_SEGMENT; - -//------------------------------------------------------------------------------ -// Define flags for Punch-in timing -//------------------------------------------------------------------------------ -const MP_FLAGS MPF_PUNCHIN_REFTIME = 0; // Use the reference time as the PI time -const MP_FLAGS MPF_PUNCHIN_NOW = 0x0001; // Punch in at the current clock time -const MP_FLAGS MPF_PUNCHIN_STOPPED = 0x0002; // Return change notifications during - // author time - -//------------------------------------------------------------------------------ -// IMediaParamInfo - Interface used to determine the names, data types and -// units of the parameters which are exposed by the object. This interface -// is used at discovery time, and is not required during run-time since the -// objects parameters are a fixed set and this data can be cached by the -// calling applicaiton. -//------------------------------------------------------------------------------ -[ -object, -uuid(6d6cbb60-a223-44aa-842f-a2f06750be6d), -version(1.0) -] -interface IMediaParamInfo : IUnknown -{ - HRESULT GetParamCount ( - [out] DWORD * pdwParams - ); - HRESULT GetParamInfo ( - [in] DWORD dwParamIndex, - [out] MP_PARAMINFO * pInfo - ); - // returns a series of null terminated strings. strings are in the - // following order: - // Param Label, Units Text, 1st Enum Text, 2nd Enum Text, etc... - HRESULT GetParamText ( - [in] DWORD dwParamIndex, // which param to get text for - [out] WCHAR **ppwchText // returns ptr to CoTaskMemAlloc'd string - ); - - // Returns the number of diffrent time formats this object understands - HRESULT GetNumTimeFormats ( - [out] DWORD * pdwNumTimeFormats - ); - - // Returns the GUID for the ith supported time format - HRESULT GetSupportedTimeFormat( - [in] DWORD dwFormatIndex, - [out] GUID *pguidTimeFormat - ); - - // Returns the current time format - HRESULT GetCurrentTimeFormat ( - [out] GUID *pguidTimeFormat, - [out] MP_TIMEDATA *pTimeData - ); -} - -//------------------------------------------------------------------------------ -// IMediaParams - Interfaes used to actually set the media params and the -// envelopes to follow -//------------------------------------------------------------------------------ -[ -object, -uuid(6d6cbb61-a223-44aa-842f-a2f06750be6e), -version(1.0) -] -interface IMediaParams : IUnknown -{ - // Single param Get/Set methods - HRESULT GetParam ( - [in] DWORD dwParamIndex, - [out] MP_DATA *pValue - ); - HRESULT SetParam ( - [in] DWORD dwParamIndex, - [in] MP_DATA value - ); - - // Envelope methods (param change over time) - HRESULT AddEnvelope ( - [in] DWORD dwParamIndex, - [in] DWORD cSegments, - [in] MP_ENVELOPE_SEGMENT * pEnvelopeSegments - ); - - // Flush all of the envelope information for the given paramter between - // the timestamps specified - HRESULT FlushEnvelope ( - [in] DWORD dwParamIndex, - [in] REFERENCE_TIME refTimeStart, - [in] REFERENCE_TIME refTimeEnd - ); - - // Change the time format being used by the object - HRESULT SetTimeFormat ( - [in] GUID guidTimeFormat, - [in] MP_TIMEDATA mpTimeData - ); -} - - - diff --git a/import/DirectX8/include/DShowIDL/mmstream.idl b/import/DirectX8/include/DShowIDL/mmstream.idl deleted file mode 100644 index 7a77b8a90..000000000 --- a/import/DirectX8/include/DShowIDL/mmstream.idl +++ /dev/null @@ -1,190 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MMStream.idl -// -// Desc: MultiMedia streaming interface IDL file. Used by MIDL tool -// to generate mmstream.h. -// -// Copyright (c) 1998-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; - -cpp_quote("#define MS_ERROR_CODE(x) MAKE_HRESULT(1, FACILITY_ITF, (x) + 0x400)") -cpp_quote("#define MS_SUCCESS_CODE(x) MAKE_HRESULT(0, FACILITY_ITF, x)") -cpp_quote("#define MS_S_PENDING MS_SUCCESS_CODE(1)") -cpp_quote("#define MS_S_NOUPDATE MS_SUCCESS_CODE(2)") -cpp_quote("#define MS_S_ENDOFSTREAM MS_SUCCESS_CODE(3)") - -cpp_quote("#define MS_E_SAMPLEALLOC MS_ERROR_CODE(1)") -cpp_quote("#define MS_E_PURPOSEID MS_ERROR_CODE(2)") -cpp_quote("#define MS_E_NOSTREAM MS_ERROR_CODE(3)") -cpp_quote("#define MS_E_NOSEEKING MS_ERROR_CODE(4)") -cpp_quote("#define MS_E_INCOMPATIBLE MS_ERROR_CODE(5)") -cpp_quote("#define MS_E_BUSY MS_ERROR_CODE(6)") -cpp_quote("#define MS_E_NOTINIT MS_ERROR_CODE(7)") -cpp_quote("#define MS_E_SOURCEALREADYDEFINED MS_ERROR_CODE(8)") -cpp_quote("#define MS_E_INVALIDSTREAMTYPE MS_ERROR_CODE(9)") -cpp_quote("#define MS_E_NOTRUNNING MS_ERROR_CODE(10)") - -cpp_quote("// {A35FF56A-9FDA-11d0-8FDF-00C04FD9189D}") -cpp_quote("DEFINE_GUID(MSPID_PrimaryVideo, ") -cpp_quote("0xa35ff56a, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);") - -cpp_quote("// {A35FF56B-9FDA-11d0-8FDF-00C04FD9189D}") -cpp_quote("DEFINE_GUID(MSPID_PrimaryAudio,") -cpp_quote("0xa35ff56b, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);") - -cpp_quote("#if(_WIN32_WINNT < 0x0400)") -typedef void (__stdcall * PAPCFUNC)(DWORD_PTR dwParam); -cpp_quote("#endif") - -typedef LONGLONG STREAM_TIME; - -typedef GUID MSPID; -typedef REFGUID REFMSPID; - -typedef enum { - STREAMTYPE_READ = 0, - STREAMTYPE_WRITE = 1, - STREAMTYPE_TRANSFORM= 2 -} STREAM_TYPE; - -typedef enum { - STREAMSTATE_STOP = 0, - STREAMSTATE_RUN = 1 -} STREAM_STATE; - - -typedef enum { - COMPSTAT_NOUPDATEOK = 0x00000001, - COMPSTAT_WAIT = 0x00000002, - COMPSTAT_ABORT = 0x00000004 -} COMPLETION_STATUS_FLAGS; - -// Flags for GetInformation -enum { - MMSSF_HASCLOCK = 0x00000001, - MMSSF_SUPPORTSEEK = 0x00000002, - MMSSF_ASYNCHRONOUS = 0x00000004 -}; - -// Flags for StreamSample::Update -enum { - SSUPDATE_ASYNC = 0x00000001, - SSUPDATE_CONTINUOUS = 0x00000002 -}; - -interface IMultiMediaStream; -interface IMediaStream; -interface IStreamSample; - -// IMultiMediaStream interface -[ -object, -local, -uuid(B502D1BC-9A57-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IMultiMediaStream : IUnknown { - - HRESULT GetInformation( - [out] DWORD *pdwFlags, - [out] STREAM_TYPE *pStreamType); - - HRESULT GetMediaStream( - [in] REFMSPID idPurpose, - [out] IMediaStream **ppMediaStream); - - HRESULT EnumMediaStreams( - [in] long Index, - [out] IMediaStream **ppMediaStream); - - HRESULT GetState( - [out] STREAM_STATE *pCurrentState); - - HRESULT SetState( - [in] STREAM_STATE NewState); - - HRESULT GetTime( - [out] STREAM_TIME *pCurrentTime); - - HRESULT GetDuration( - [out] STREAM_TIME *pDuration); - - HRESULT Seek( - [in] STREAM_TIME SeekTime); - - HRESULT GetEndOfStreamEventHandle( - [out] HANDLE *phEOS); -}; - - -// IMediaStream interface -[ -object, -uuid(B502D1BD-9A57-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IMediaStream : IUnknown { - - HRESULT GetMultiMediaStream( - [out] IMultiMediaStream **ppMultiMediaStream); - - HRESULT GetInformation( - [out] MSPID *pPurposeId, - [out] STREAM_TYPE *pType); - - HRESULT SetSameFormat( - [in] IMediaStream *pStreamThatHasDesiredFormat, - [in] DWORD dwFlags); - - HRESULT AllocateSample( - [in] DWORD dwFlags, - [out] IStreamSample **ppSample); - - - HRESULT CreateSharedSample( - [in] IStreamSample *pExistingSample, - [in] DWORD dwFlags, - [out] IStreamSample **ppNewSample); - - HRESULT SendEndOfStream(DWORD dwFlags); -}; - - -// IStreamSample interface -[ -object, -local, -uuid(B502D1BE-9A57-11d0-8FDE-00C04FD9189D), -pointer_default(unique) -] -interface IStreamSample : IUnknown { - - HRESULT GetMediaStream( - [in] IMediaStream **ppMediaStream); - - HRESULT GetSampleTimes( - [out] STREAM_TIME * pStartTime, - [out] STREAM_TIME * pEndTime, - [out] STREAM_TIME * pCurrentTime); - - HRESULT SetSampleTimes( - [in] const STREAM_TIME *pStartTime, - [in] const STREAM_TIME *pEndTime); - - HRESULT Update( - [in] DWORD dwFlags, - [in] HANDLE hEvent, - [in] PAPCFUNC pfnAPC, - [in] DWORD_PTR dwAPCData); - - HRESULT CompletionStatus( - [in] DWORD dwFlags, - [in] DWORD dwMilliseconds); -}; - - - - diff --git a/import/DirectX8/include/DShowIDL/qedit.idl b/import/DirectX8/include/DShowIDL/qedit.idl deleted file mode 100644 index 48493548f..000000000 --- a/import/DirectX8/include/DShowIDL/qedit.idl +++ /dev/null @@ -1,1702 +0,0 @@ -//------------------------------------------------------------------------------ -// File: QEdit.idl -// -// Desc: -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxtrans.idl"; -import "amstream.idl"; -import "msxml.idl"; - -// -// forward declare -// -interface IAMTimelineGroup; -interface IAMTimelineObj; -interface IAMTimelineEffect; -interface IAMTimelineTrans; -interface IAMTimelineSrc; -interface IAMTimeline; -interface IAMErrorLog; -interface ISampleGrabber; -interface IPropertySetter; - -// used by DEXTER_VALUE's dwInterp var -typedef enum -{ - DEXTERF_JUMP, - DEXTERF_INTERPOLATE -} DEXTERF; - -// used to set values on the property setter -typedef struct -{ - BSTR Name; - DISPID dispID; - LONG nValues; -} DEXTER_PARAM; - -// used to set values on the property setter -typedef struct -{ - VARIANT v; - REFERENCE_TIME rt; - DWORD dwInterp; // one of the DEXTERF_ flags -} DEXTER_VALUE; - -// used by bMethod directly below -enum -{ - DEXTER_AUDIO_JUMP, - DEXTER_AUDIO_INTERPOLATE -}; - -// used to set volumes on the mixer and mixer pins -typedef struct -{ - REFERENCE_TIME rtEnd; //end Time - double dLevel; //end Volume Level - BOOL bMethod; //jump or interpolate -} DEXTER_AUDIO_VOLUMEENVELOPE ; - -// used in IAMTimeline::Get(Set)InsertMode -enum -{ - TIMELINE_INSERT_MODE_INSERT = 1, - TIMELINE_INSERT_MODE_OVERLAY = 2 -}; - -// -// define what main 'things' can be put into the timeline tree. -// these values are used quite a bit with timeline access -// (bitmap mask flags) -typedef enum -{ - TIMELINE_MAJOR_TYPE_COMPOSITE = 1, - TIMELINE_MAJOR_TYPE_TRACK = 2, - TIMELINE_MAJOR_TYPE_SOURCE = 4, - TIMELINE_MAJOR_TYPE_TRANSITION = 8, - TIMELINE_MAJOR_TYPE_EFFECT = 16, - TIMELINE_MAJOR_TYPE_GROUP = 128 -} TIMELINE_MAJOR_TYPE; - -// used in various IAMTimelineXXX "search" functions. Look in this -// file for "SearchDirection" to see where it's used. I didn't want -// to use an enum as an interface param type, so I used a long. Probably -// silly of me. -typedef enum -{ - DEXTERF_BOUNDING = -1, // finds any source whose start <= Time and stop > Time - DEXTERF_EXACTLY_AT = 0, // finds any source that starts exactly at Time - DEXTERF_FORWARDS = 1 // finds any source that starts at or after Time -} DEXTERF_TRACK_SEARCH_FLAGS; - -// right now, the media type in the group contains enough information about -// how we want to recompress. This might not be enough information in the -// future, so we define a structure we can get and set to the group. -// -typedef struct _SCompFmt0 -{ - long nFormatId; - AM_MEDIA_TYPE MediaType; -} SCompFmt0; - -// used in IAMTimelineSrc::Get(Set)StretchMode -// -enum -{ - RESIZEF_STRETCH, - RESIZEF_CROP, - RESIZEF_PRESERVEASPECTRATIO, - RESIZEF_PRESERVEASPECTRATIO_NOLETTERBOX -}; - -// used in IRenderEngine::SetDynamicReconnectLevel -// (bitmap mask flags) -enum -{ - CONNECTF_DYNAMIC_NONE = 0x00000000, - CONNECTF_DYNAMIC_SOURCES = 0x00000001, - CONNECTF_DYNAMIC_EFFECTS = 0x00000002 -}; - -// used in -// IMediaLocator::FindMediaFile -// IRenderEngine::SetSourceNameValidation -// IAMTimeline::ValidateSourceNames -// (bitmap mask flags) -enum -{ - SFN_VALIDATEF_CHECK = 0x00000001, // do a check. Without this set, no check will be done. - SFN_VALIDATEF_POPUP = 0x00000002, // should UI popup show if not found - SFN_VALIDATEF_TELLME = 0x00000004, // warn user about replaced files - SFN_VALIDATEF_REPLACE = 0x00000008, // should it replace names in the tldb if found - SFN_VALIDATEF_USELOCAL = 0x000000010, // use local media preferrably over networked media - SFN_VALIDATEF_NOFIND = 0x000000020, // never find filenames, always use UI popup to find., - // when used, _POPUP must be used as well - SFN_VALIDATEF_IGNOREMUTED = 0x000000040, // ignore muted files in the tldb - SFN_VALIDATEF_END -}; - -// key transitions types -enum -{ - DXTKEY_RGB, - DXTKEY_NONRED, - DXTKEY_LUMINANCE, - DXTKEY_ALPHA, - DXTKEY_HUE -}; - - -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// -// New Property setting Interfaces -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// - -// interface for objects which can save/load IDispatch-able properties -[ - object, - uuid(AE9472BD-B0C3-11D2-8D24-00A0C9441E20), - helpstring("IPropertySetter Interface"), - pointer_default(unique) -] -interface IPropertySetter : IUnknown // IPersist? -{ - // for loading and saving through XML - HRESULT LoadXML([in] IUnknown * pxml); - // !!! doesn't work HRESULT LoadXML([in] IXMLElement * pxml); - HRESULT PrintXML([out] char *pszXML, [in] int cbXML, [out] int *pcbPrinted,[in] int indent); - - // for cloning a portion of the props when splitting the object - //AUTOMATE - HRESULT CloneProps([out] IPropertySetter **ppSetter, - [in] REFERENCE_TIME rtStart, - [in] REFERENCE_TIME rtStop); - - // for loading and saving programmatically - // caller must call this in pre-sorted order, this time must be > all - // previous times - //AUTOMATE - HRESULT AddProp([in] DEXTER_PARAM Param, - [in] DEXTER_VALUE *paValue); - //AUTOMATE - HRESULT GetProps([out] LONG *pcParams, - [out] DEXTER_PARAM **paParam, - [out] DEXTER_VALUE **paValue); - // after calling GetProps, you must call FreeProps to free resources - //AUTOMATE - HRESULT FreeProps([in] LONG cParams, - [in] DEXTER_PARAM *paParam, - [in] DEXTER_VALUE *paValue); - // to empty to property setter, so you can start over again - HRESULT ClearProps(); - - // for persisting - HRESULT SaveToBlob([out] LONG *pcSize, [out] BYTE **ppb); - HRESULT LoadFromBlob([in] LONG cSize, [in] BYTE *pb); - - // to program the object that supports IDispatch with the props - // call with rtNow == -1 to set Static Props when your object instantiates - // errors will be logged, if a log is provided - //AUTOMATE - HRESULT SetProps([in] IUnknown *pTarget, - [in] REFERENCE_TIME rtNow); - -}; - -// supported by our DxtCompositor class, this allows us to draw whatever comes in -// upon only a portion of the output bitmap - -[ - object, - uuid(BB44391E-6ABD-422f-9E2E-385C9DFF51FC), - dual, - helpstring("IDxtCompositor Interface"), - pointer_default(unique) -] -interface IDxtCompositor : IDXEffect -{ - [propget, id(1), helpstring("property OffsetX")] HRESULT OffsetX([out, retval] long *pVal); - [propput, id(1), helpstring("property OffsetX")] HRESULT OffsetX([in] long newVal); - [propget, id(2), helpstring("property OffsetY")] HRESULT OffsetY([out, retval] long *pVal); - [propput, id(2), helpstring("property OffsetY")] HRESULT OffsetY([in] long newVal); - [propget, id(3), helpstring("property Width")] HRESULT Width([out, retval] long *pVal); - [propput, id(3), helpstring("property Width")] HRESULT Width([in] long newVal); - [propget, id(4), helpstring("property Height")] HRESULT Height([out, retval] long *pVal); - [propput, id(4), helpstring("property Height")] HRESULT Height([in] long newVal); - - [propget, id(5), helpstring("property SrcOffsetX")] HRESULT SrcOffsetX([out, retval] long *pVal); - [propput, id(5), helpstring("property SrcOffsetX")] HRESULT SrcOffsetX([in] long newVal); - [propget, id(6), helpstring("property SrcOffsetY")] HRESULT SrcOffsetY([out, retval] long *pVal); - [propput, id(6), helpstring("property SrcOffsetY")] HRESULT SrcOffsetY([in] long newVal); - [propget, id(7), helpstring("property SrcWidth")] HRESULT SrcWidth([out, retval] long *pVal); - [propput, id(7), helpstring("property SrcWidth")] HRESULT SrcWidth([in] long newVal); - [propget, id(8), helpstring("property SrcHeight")] HRESULT SrcHeight([out, retval] long *pVal); - [propput, id(8), helpstring("property SrcHeight")] HRESULT SrcHeight([in] long newVal); -}; - -[ - object, - uuid(4EE9EAD9-DA4D-43d0-9383-06B90C08B12B), - dual, - helpstring("IDxtAlphaSetter Interface"), - pointer_default(unique) -] -interface IDxtAlphaSetter : IDXEffect -{ - // set the alpha to a particular number - [propget, id(1), helpstring("property Alpha")] HRESULT Alpha([out, retval] long *pVal); - [propput, id(1), helpstring("property Alpha")] HRESULT Alpha([in] long newVal); - - // set the alpha to a percentage of it's full value - [propget, id(2), helpstring("property AlphaRamp")] HRESULT AlphaRamp([out, retval] double *pVal); - [propput, id(2), helpstring("property AlphaRamp")] HRESULT AlphaRamp([in] double newVal); -}; - -// Supported by our JPEG DXT, that can do any wipe based on a bitmap -// - -[ - object, - uuid(DE75D011-7A65-11D2-8CEA-00A0C9441E20), - dual, - helpstring("IDxtJpeg Interface"), - pointer_default(unique) -] -interface IDxtJpeg : IDXEffect -{ - [propget, id(1), helpstring("property MaskNum")] HRESULT MaskNum([out, retval] long *); - [propput, id(1), helpstring("property MaskNum")] HRESULT MaskNum([in] long); - [propget, id(2), helpstring("property MaskName")] HRESULT MaskName([out, retval] BSTR *pVal); - [propput, id(2), helpstring("property MaskName")] HRESULT MaskName([in] BSTR newVal); - [propget, id(3), helpstring("property ScaleX")] HRESULT ScaleX([out, retval] double *); - [propput, id(3), helpstring("property ScaleX")] HRESULT ScaleX([in] double); - [propget, id(4), helpstring("property ScaleY")] HRESULT ScaleY([out, retval] double *); - [propput, id(4), helpstring("property ScaleY")] HRESULT ScaleY([in] double); - [propget, id(5), helpstring("property OffsetX")] HRESULT OffsetX([out, retval] long *); - [propput, id(5), helpstring("property OffsetX")] HRESULT OffsetX([in] long); - [propget, id(6), helpstring("property OffsetY")] HRESULT OffsetY([out, retval] long *); - [propput, id(6), helpstring("property OffsetY")] HRESULT OffsetY([in] long); - [propget, id(7), helpstring("property ReplicateX")] HRESULT ReplicateX([out, retval] long *pVal); - [propput, id(7), helpstring("property ReplicateX")] HRESULT ReplicateX([in] long newVal); - [propget, id(8), helpstring("property ReplicateY")] HRESULT ReplicateY([out, retval] long *pVal); - [propput, id(8), helpstring("property ReplicateY")] HRESULT ReplicateY([in] long newVal); - [propget, id(9), helpstring("property BorderColor")] HRESULT BorderColor([out, retval] long *pVal); - [propput, id(9), helpstring("property BorderColor")] HRESULT BorderColor([in] long newVal); - [propget, id(10), helpstring("property BorderWidth")] HRESULT BorderWidth([out, retval] long *pVal); - [propput, id(10), helpstring("property BorderWidth")] HRESULT BorderWidth([in] long newVal); - [propget, id(11), helpstring("property BorderSoftness")] HRESULT BorderSoftness([out, retval] long *pVal); - [propput, id(11), helpstring("property BorderSoftness")] HRESULT BorderSoftness([in] long newVal); - HRESULT ApplyChanges(); - HRESULT LoadDefSettings(); -}; - - // key - [ - object, - uuid(3255de56-38fb-4901-b980-94b438010d7b), - dual, - helpstring("IDxtKey Interface"), - pointer_default(unique) - ] - interface IDxtKey : IDXEffect - { - [propget, id(1), helpstring("property KeyType")] HRESULT KeyType([out, retval] int *); - [propput, id(1), helpstring("property Keytype")] HRESULT KeyType([in] int); - [propget, id(2), helpstring("property Hue")] HRESULT Hue([out, retval] int *); - [propput, id(2), helpstring("property Hue")] HRESULT Hue([in] int ); - [propget, id(3), helpstring("property Luminance")] HRESULT Luminance([out, retval] int *); - [propput, id(3), helpstring("property Luminance")] HRESULT Luminance([in] int ); - [propget, id(4), helpstring("property RGB")] HRESULT RGB([out, retval] DWORD *); - [propput, id(4), helpstring("property RGB")] HRESULT RGB([in] DWORD ); - [propget, id(5), helpstring("property Similarity")] HRESULT Similarity([out,retval] int * ); - [propput, id(5), helpstring("property Similarity")] HRESULT Similarity([in] int ); - [propget, id(6), helpstring("property Invert")] HRESULT Invert([out, retval] BOOL *); - [propput, id(6), helpstring("property Invert")] HRESULT Invert([in] BOOL); - }; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // This little COM interface will look 'around' for the closest - // path match for a given file. If the file already exists, then - // this interface should hardly do anything. If it's not found, - // it will go look for it and if successful, return S_FALSE. If it - // cannot find the file, it will call the hook, if set and return - // it's return code. if the hook is not set, it is in a type of - // error condition. The Dexter-provided MediaLocator will bring up - // a dialog box asking you to browse for your file. Other COM - // objects may do something else. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(288581E0-66CE-11d2-918F-00C0DF10D434), - odl, - helpstring("IMediaLocator Interface"), - pointer_default(unique) -] -interface IMediaLocator : IUnknown -{ - // same flags as used by IRenderEngine's SetSourceNameValidation - HRESULT FindMediaFile( BSTR Input, BSTR FilterString, BSTR * pOutput, long Flags ); - HRESULT AddFoundLocation( BSTR DirectoryName ); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // This object provides caching of duration and stream type - // information for files that would produce a directshow source - // filter. It takes too long to figure this out in DShow right - // now, so this is one way around it. The way it works is that - // you first fill out the Filename property, then call and - // ask how many streams it has, or, set the CurrentStream prop - // and then ask for the per-stream properties, StreamType or - // StreamLength. They both reference the CurrentStream prop that - // you set. I also allowed you (for convenience) to just give - // it a IUnknown Filter that represents an IBaseFilter source - // filter that is NOT currently in a graph. It will use that - // instead. When using this, though, you will not get cached - // values. The cached values are stored in the system's ini file - // called DCBC2A70-70D8-4459-BFFA-E0D61DEA3FDF.INI. Nice, huh? :-) - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA), - odl, - helpstring("IMediaDet Interface"), - pointer_default(unique) -] -interface IMediaDet : IUnknown -{ - [propget, id(1), helpstring("property Filter")] HRESULT Filter([out, retval] IUnknown* *pVal); - [propput, id(1), helpstring("property Filter")] HRESULT Filter([in] IUnknown* newVal); - [propget, id(2), helpstring("property OutputStreams")] HRESULT OutputStreams([out, retval] long *pVal); - [propget, id(3), helpstring("property CurrentStream")] HRESULT CurrentStream([out, retval] long *pVal); - [propput, id(3), helpstring("property CurrentStream")] HRESULT CurrentStream([in] long newVal); - [propget, id(4), helpstring("property StreamType")] HRESULT StreamType([out, retval] GUID *pVal); - [propget, id(5), helpstring("property StreamTypeB")] HRESULT StreamTypeB([out, retval] BSTR *pVal); - [propget, id(6), helpstring("property StreamLength")] HRESULT StreamLength([out, retval] double *pVal); - [propget, id(7), helpstring("property Filename")] HRESULT Filename([out, retval] BSTR *pVal); - [propput, id(7), helpstring("property Filename")] HRESULT Filename([in] BSTR newVal); - [id(8), helpstring("method GetBitmapBits")] HRESULT GetBitmapBits(double StreamTime, long * pBufferSize, char * pBuffer, long Width, long Height); - [id(9), helpstring("method WriteBitmapBits")] HRESULT WriteBitmapBits(double StreamTime, long Width, long Height, BSTR Filename ); - [propget, id(10), helpstring("property StreamMediaType")] HRESULT StreamMediaType([out, retval] AM_MEDIA_TYPE * pVal); - [id(11), helpstring("method GetSampleGrabber")] HRESULT GetSampleGrabber( [out] ISampleGrabber ** ppVal ); - [propget, id(12), helpstring("property FrameRate")] HRESULT FrameRate([out, retval] double *pVal); - [id(13), helpstring("method EnterBitmapGrabMode")] HRESULT EnterBitmapGrabMode( double SeekTime ); -}; - - -// useless interface, don't use it! - -[ - object, - uuid(AE9472BE-B0C3-11D2-8D24-00A0C9441E20), - odl, - helpstring("IGrfCache Interface"), - pointer_default(unique) -] -interface IGrfCache : IDispatch -{ - [id(1), helpstring("method AddFilter")] - HRESULT AddFilter( - IGrfCache * ChainedCache, - LONGLONG ID, - const IBaseFilter * pFilter, - LPCWSTR pName); - - [id(2), helpstring("method ConnectPins")] - HRESULT ConnectPins( - IGrfCache * ChainedCache, - LONGLONG PinID1, - const IPin * pPin1, - LONGLONG PinID2, - const IPin * pPin2); - - [id(3), helpstring("method SetGraph")] - HRESULT SetGraph(const IGraphBuilder * pGraph); - - [id(4), helpstring("method DoConnectionsNow")] - HRESULT DoConnectionsNow(); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // The RenderEngin builds a graph from the timeline and gives - // you some simple positional commands. - // explained methods: - // SetTimelineObject - tell the render engine who to parse - // ConnectEverything - build up a graph based on the timeline - // ScrapIt - throw away graph and everything - // GetFilterGraph - get the graph that's built up, if any - // SetFilterGraph - allows you to preset the graph that's built up. - // cannot call this if there already is a graph. - - // !!! the following methods are unused/not implemented - - // SetInterestRange - discard COM objects and memory outside of this - // range, if possible. Used for scrubbing on a long timeline and - // freeing up resources - // SetRenderRange - pretend like a portion of the timeline IS the timeline - // and don't connect anything in the graph outside of that range. - // Commit - allocate what's necessary and get prepared to run - // Decommit - free anything possible - // GetCaps - find out some info about the render engine - // DoSmartRecompression - connect compressed sources if - // possible - // in the graph, this will RenderPin( ) on every switcher - // rendering pin. - // SetSourceNameValidation - allows you to set some flags which - // determine how source files are found, if they need to be found. - // FilterString is a list of extensions to find for the media - // files (see OPENFILENAME filters) - // pOverride is a media locator you would like to use instead - // of the built in one - // The flags are defined in the struct immediately below. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(6BEE3A81-66C9-11d2-918F-00C0DF10D434), - odl, - helpstring("IRenderEngine Interface"), - pointer_default(unique) -] -interface IRenderEngine : IUnknown -{ - HRESULT SetTimelineObject( IAMTimeline * pTimeline ); - HRESULT GetTimelineObject( [out] IAMTimeline ** ppTimeline ); - HRESULT GetFilterGraph( [out] IGraphBuilder ** ppFG ); - HRESULT SetFilterGraph( IGraphBuilder * pFG ); - HRESULT SetInterestRange( REFERENCE_TIME Start, REFERENCE_TIME Stop ); - HRESULT SetInterestRange2( double Start, double Stop ); - HRESULT SetRenderRange( REFERENCE_TIME Start, REFERENCE_TIME Stop ); - HRESULT SetRenderRange2( double Start, double Stop ); - HRESULT GetGroupOutputPin( long Group, [out] IPin ** ppRenderPin ); - HRESULT ScrapIt( ); - HRESULT RenderOutputPins( ); - HRESULT GetVendorString( [out,retval] BSTR * pVendorID ); - HRESULT ConnectFrontEnd( ); - HRESULT SetSourceConnectCallback( IGrfCache * pCallback ); - HRESULT SetDynamicReconnectLevel( long Level ); - HRESULT DoSmartRecompression( ); - HRESULT UseInSmartRecompressionGraph( ); - - HRESULT SetSourceNameValidation( BSTR FilterString, IMediaLocator * pOverride, LONG Flags ); - - // not implemented yet - HRESULT Commit( ); - HRESULT Decommit( ); - HRESULT GetCaps( long Index, long * pReturn ); -}; - -// used for the smart render engine when it needs to find a compressor -[ - object, - uuid(F03FA8DE-879A-4d59-9B2C-26BB1CF83461), - odl, - helpstring("IFindCompressorCB Interface"), - pointer_default(unique) -] -interface IFindCompressorCB : IUnknown -{ - HRESULT GetCompressor( AM_MEDIA_TYPE * pType, AM_MEDIA_TYPE * pCompType, [out] IBaseFilter ** ppFilter ); -} - -[ - object, - uuid(F03FA8CE-879A-4d59-9B2C-26BB1CF83461), - odl, - helpstring("ISmartRenderEngine Interface"), - pointer_default(unique) -] -interface ISmartRenderEngine : IUnknown -{ - HRESULT SetGroupCompressor( long Group, IBaseFilter * pCompressor ); - HRESULT GetGroupCompressor( long Group, IBaseFilter ** pCompressor ); - HRESULT SetFindCompressorCB( IFindCompressorCB * pCallback ); -} - -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// -// TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Every object on the timeline supports at least this interface. - // explained methods: - // Get/SetStartStop - the timeline times at which this object is - // active. Groups and Tracks have start times of zero. - // FixTimes - used by the render engine. Rounds the input times - // to the nearest FPS of the parent Group, for use in setting - // up the big switch. - // GetSubObject - get the sub-object which is associated with this - // timeline object. Each timeline object can carry around a - // pointer to 'something else'. For our Render Engine, this is - // a pointer to a filter that gets put into a graph. - // NOTE: Getting the subobject will FORCE it to load if it's possible - // to force this. If you don't want it to do this, don't call - // this function. - // SetSubObject - see GetSubObject - // SetSubObjectGUID - instead of giving the node a pointer, you can - // instead give it a GUID and see if this works instead. The - // sub-object will attempt to be instantiated when 'necessary' - // which is really when it's asked for with GetSubObject./ - // !!! a better way to do this perhaps? - // GetSubObjectLoaded - ask if the sub-object pointer is set - // Get/SetTimelineType - return the major type which is stored here, - // used by the API user and the render engine. - // Get/SetTimelineSubType - see above - // Get/SetUserID - get and set a number, any number - // GetGenID - every created object has a unique number to it. Used - // by the render engine. - // Get/SetUserName - a storable name, for users of the API - // Get/SetPropertySetter - the object that will set properties for this - // object (it will support IPropertySetter and it is created by - // CPropertySetter) - // Get/SetUserData - gets the persistant data used by the user of - // the API. - // Get/SetMuted - set whether this object should be active or not. - // Setting a parent of other objects off also turns off the - // sub-objects. - // Get/SetLocked - set whether you can edit this object or not. - // Note: the timeline doesn't enforce this, it just stores - // a value for convenience. - // Get/SetDirtyRange - - // RemoveAll - remove this object, and if in the tree already, all it's - // sub objects, including children - // Remove - remove this object, and if in the tree already, all it's - // sub objects, but not kids - // GetTimelineNoRef - called internally by the timeline. - // GetGroupIBelongTo - called internally by the timeline. - // GetEmbedDepth - find out how many tracks we are a part of - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - local, - uuid(78530B77-61F9-11D2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineObj Interface"), - pointer_default(unique) -] -interface IAMTimelineObj : IUnknown -{ - [helpstring("method GetStartStop")] - HRESULT GetStartStop(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method GetStartStop2")] - HRESULT GetStartStop2(REFTIME * pStart, REFTIME * pStop); - [helpstring("method FixTimes")] - HRESULT FixTimes(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method FixTimes2")] - HRESULT FixTimes2(REFTIME * pStart, REFTIME * pStop); - [helpstring("method SetStartStop")] - HRESULT SetStartStop(REFERENCE_TIME Start, REFERENCE_TIME Stop); - [helpstring("method SetStartStop2")] - HRESULT SetStartStop2(REFTIME Start, REFTIME Stop); - [helpstring("method GetPropertySetter")] - HRESULT GetPropertySetter([out,retval] IPropertySetter* *pVal); - [helpstring("method SetPropertySetter")] - HRESULT SetPropertySetter(IPropertySetter* newVal); - [helpstring("method GetSubObject")] - HRESULT GetSubObject([out,retval] IUnknown* *pVal); - [helpstring("method SetSubObject")] - HRESULT SetSubObject(IUnknown* newVal); - [helpstring("method SetSubObjectGUID")] - HRESULT SetSubObjectGUID(GUID newVal); - [helpstring("method SetSubObjectGUIDByBSTR")] - HRESULT SetSubObjectGUIDB(BSTR newVal); - [helpstring("method GetSubObjectGUID")] - HRESULT GetSubObjectGUID(GUID * pVal); - [helpstring("method GetSubObjectGUIDByBSTR")] - HRESULT GetSubObjectGUIDB([out,retval] BSTR * pVal); - [helpstring("method GetSubObjectLoaded")] - HRESULT GetSubObjectLoaded(BOOL * pVal); - [helpstring("method GetTimelineType")] - HRESULT GetTimelineType(TIMELINE_MAJOR_TYPE * pVal); - [helpstring("method SetTimelineType")] - HRESULT SetTimelineType(TIMELINE_MAJOR_TYPE newVal); - [helpstring("method GetUserID")] - HRESULT GetUserID(long * pVal); - [helpstring("method SetUserID")] - HRESULT SetUserID(long newVal); - [helpstring("method GetGenID")] - HRESULT GetGenID( long * pVal ); - [helpstring("method GetUserName")] - HRESULT GetUserName([out,retval] BSTR * pVal); - [helpstring("method SetUserName")] - HRESULT SetUserName(BSTR newVal); - [helpstring("method GetUserData")] - HRESULT GetUserData(BYTE * pData, long * pSize); - [helpstring("method SetUserData")] - HRESULT SetUserData(BYTE * pData, long Size); - [helpstring("method GetMuted")] - HRESULT GetMuted(BOOL * pVal); - [helpstring("method SetMuted")] - HRESULT SetMuted(BOOL newVal); - [helpstring("method GetLocked")] - HRESULT GetLocked(BOOL * pVal); - [helpstring("method SetLocked")] - HRESULT SetLocked(BOOL newVal); - [helpstring("method GetDirtyRange")] - HRESULT GetDirtyRange(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method GetDirtyRange")] - HRESULT GetDirtyRange2(REFTIME * pStart, REFTIME * pStop); - [helpstring("method SetDirtyRange")] - HRESULT SetDirtyRange(REFERENCE_TIME Start, REFERENCE_TIME Stop); - [helpstring("method SetDirtyRange")] - HRESULT SetDirtyRange2(REFTIME Start, REFTIME Stop); - [helpstring("method ClearDirty")] - HRESULT ClearDirty( ); - [helpstring("method Remove")] - HRESULT Remove(); - [helpstring("method RemoveAll")] - HRESULT RemoveAll(); - HRESULT GetTimelineNoRef( IAMTimeline ** ppResult ); - HRESULT GetGroupIBelongTo( [out] IAMTimelineGroup ** ppGroup ); - HRESULT GetEmbedDepth( long * pVal ); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Any object on the timeline that can have an effect put on it - // implements this interface. This includes sources, tracks, and - // compositions. - // explained methods: - // EffectInsBefore - insert an effect at the given priority onto - // this object. The effect's times will be clipped within - // this object's bounds. Use -1 to specify 'at the end' for priority. - // You cannot have two effects at the same priority. - // EffectSwapPriorities - swaparoo two effects. Makes undo easier to - // implement. - // EffectGetCount - get how many effects are applied to this object. - // GetEffect - get the nth effect applied to this object - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -[ - object, - uuid(EAE58537-622E-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineEffectable Interface"), - pointer_default(unique) -] -interface IAMTimelineEffectable : IUnknown -{ - [helpstring("method EffectInsBefore")] - HRESULT EffectInsBefore(IAMTimelineObj * pFX, long priority); - [helpstring("method EffectSwapPriorities")] - HRESULT EffectSwapPriorities(long PriorityA, long PriorityB); - [helpstring("method EffectGetCount")] - HRESULT EffectGetCount(long * pCount); - [helpstring("method GetEffect")] - HRESULT GetEffect([out] IAMTimelineObj ** ppFx, long Which); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Any effect on the timeline will support at least this interface. - // NOTE: The Start/Stop times on this object are RELATIVE to their - // parent's, as are all start/stop times. - // explained methods: - // EffectGetPriority - finds out this effect's priority related to the others. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(BCE0C264-622D-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineEffect Interface"), - pointer_default(unique) -] -interface IAMTimelineEffect : IUnknown -{ - [helpstring("method EffectGetPriority")] - HRESULT EffectGetPriority(long * pVal); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Any object on the timeline that can have a transition put on it - // implements this interface - // explained methods: - // TransAdd - add a transition on this object. Multiple trans's on - // the same object cannot overlap in time. Transitions' times - // must lie within the bounds of their parent. - // TransGetCount - get how many transitions are applied to this - // object. - // GetNextTrans - given a time, get the next transition that happens - // on this object after that time. On exit, the input time is - // set to the start time of the transition. - // GetTransAtTime - find a transition forwards or backwards from - // a given spot. See DEXTERF_TRACK_SEARCH_FLAGS enum. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(378FA386-622E-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineTransable Interface"), - pointer_default(unique) -] -interface IAMTimelineTransable : IUnknown -{ - [helpstring("method TransAdd")] - HRESULT TransAdd(IAMTimelineObj * pTrans); - [helpstring("method TransGetCount")] - HRESULT TransGetCount(long * pCount); - [helpstring("method GetNextTrans")] - HRESULT GetNextTrans([out] IAMTimelineObj ** ppTrans, REFERENCE_TIME * pInOut); - [helpstring("method GetNextTrans2")] - HRESULT GetNextTrans2([out] IAMTimelineObj ** ppTrans, REFTIME * pInOut); - [helpstring("method GetTransAtTime")] - HRESULT GetTransAtTime( - [out] IAMTimelineObj ** ppObj, - REFERENCE_TIME Time, - long SearchDirection ); - [helpstring("method GetTransAtTime2")] - HRESULT GetTransAtTime2([out] IAMTimelineObj ** ppObj, REFTIME Time, long SearchDirection ); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Any object on the timeline that can be split into two will - // implement this interface. Namely, source, effects, and transitions - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(A0F840A0-D590-11d2-8D55-00A0C9441E20), - odl, - helpstring("IAMTimelineSplittable Interface"), - pointer_default(unique) -] -interface IAMTimelineSplittable : IUnknown -{ - HRESULT SplitAt(REFERENCE_TIME Time); - HRESULT SplitAt2(REFTIME Time); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Any trans on the timeline will support at least this interface. - // NOTE: The Start/Stop times on this object are RELATIVE to their - // parent's, as are all start/stop times. - // explained methods: - // GetCutPoint - get where this transition should cut from A to B - // if the transition were not applied. - // GetA2B - get if this transition is to go from A->B or B->A. - // GetBackwards - get if this transition should run backwards. - // GetCutsOnly - force no transition, force doing a cut - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(BCE0C265-622D-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineTrans Interface"), - pointer_default(unique) -] -interface IAMTimelineTrans : IUnknown -{ - [helpstring("method GetCutPoint")] - HRESULT GetCutPoint(REFERENCE_TIME * pTLTime); - [helpstring("method GetCutPoint2")] - HRESULT GetCutPoint2(REFTIME * pTLTime); - [helpstring("method SetCutPoint")] - HRESULT SetCutPoint(REFERENCE_TIME TLTime); - [helpstring("method SetCutPoint2")] - HRESULT SetCutPoint2(REFTIME TLTime); - [helpstring("method GetSwapInputs")] - HRESULT GetSwapInputs( BOOL * pVal ); - [helpstring("method SetSwapInputs")] - HRESULT SetSwapInputs( BOOL pVal ); - [helpstring("method GetCutsOnly")] - HRESULT GetCutsOnly( BOOL * pVal ); - [helpstring("method SetCutsOnly")] - HRESULT SetCutsOnly( BOOL pVal ); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Sources represent any source media object on the timeline. - // They extend an IAMTimelineObj to include media start and stop - // times, a media name (which could represent darned near anything), - // and a StreamNumber, which defines which stream out of a potential - // many this stream represents from a source clip. - // explained methods: - // ModifyStopTime - like calling SetStartStop, but this method just - // adjusts the tail end of the clip. - // FixMediaTimes - called by the render engine to round times to - // this source clip's parent group's FPS. - // SpliceWithNext - if the next clip after this is the same source - // and this's stop time matches next's start time, the two - // will be joined. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(78530B79-61F9-11D2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineSrc Interface"), - pointer_default(unique) -] -interface IAMTimelineSrc : IUnknown -{ - [helpstring("method GetMediaTimes")] - HRESULT GetMediaTimes(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method GetMediaTimes2")] - HRESULT GetMediaTimes2(REFTIME * pStart, REFTIME * pStop); - [helpstring("method ModifyStopTime")] - HRESULT ModifyStopTime(REFERENCE_TIME Stop); - [helpstring("method ModifyStopTime2")] - HRESULT ModifyStopTime2(REFTIME Stop); - [helpstring("method FixMediaTimes")] - HRESULT FixMediaTimes(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method FixMediaTimes2")] - HRESULT FixMediaTimes2(REFTIME * pStart, REFTIME * pStop); - [helpstring("method SetMediaTimes")] - HRESULT SetMediaTimes(REFERENCE_TIME Start, REFERENCE_TIME Stop); - [helpstring("method SetMediaTimes2")] - HRESULT SetMediaTimes2(REFTIME Start, REFTIME Stop); - [helpstring("method SetMediaLength")] - HRESULT SetMediaLength(REFERENCE_TIME Length); - [helpstring("method SetMediaLength2")] - HRESULT SetMediaLength2(REFTIME Length); - [helpstring("method GetMediaLength")] - HRESULT GetMediaLength(REFERENCE_TIME * pLength); - [helpstring("method GetMediaLength2")] - HRESULT GetMediaLength2(REFTIME * pLength); - [helpstring("method GetMediaName")] - HRESULT GetMediaName([out,retval] BSTR * pVal); - [helpstring("method SetMediaName")] - HRESULT SetMediaName(BSTR newVal); - [helpstring("method SpliceWithNext")] - HRESULT SpliceWithNext(IAMTimelineObj * pNext); - [helpstring("method GetStreamNumber")] - HRESULT GetStreamNumber(long * pVal); - [helpstring("method SetStreamNumber")] - HRESULT SetStreamNumber(long Val); - HRESULT IsNormalRate( BOOL * pVal ); - - // If a source can't figure out its frames per second, this number - // will be used (eg: Dib sequences). AVI, MPEG, etc. will not need this - // Use 0 fps to prevent a filename like "ski4.jpg" from using a dib seq - [helpstring("method GetDefaultFPS")] - HRESULT GetDefaultFPS(double * pFPS); - [helpstring("method SetDefaultFPS")] - HRESULT SetDefaultFPS(double FPS); - - // !!! This is video specific.. new interface? - // what kind of stretching? Stretch, crop, or preserve aspect ratio? - [helpstring("method GetStretchMode")] - HRESULT GetStretchMode(int * pnStretchMode); - [helpstring("method SetStretchMode")] - HRESULT SetStretchMode(int nStretchMode); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Tracks are things that can contain media in them. You can add - // and remove sources, effects, and transitions from them. Sources - // are added according to the current insert mode of the timeline. - // If in OVERLAY mode, moving or adding a source to a time that's - // already occupied by another source will wipe out any overlapping - // portion of the underlying source. In InsertMode, everything at - // the insert point is moved down in time to make room for the - // new source. - // explained methods: - // SrcAdd - add the source to this track. The source's start/stop - // times must be set up first. - // GetNextSrc - pass a time in at which you wish to find a source - // and it will return the first source which occurs after the - // given time. - // MoveAllSources - bump a bunch of sources a certain direction - // on the track by a given time. - // GetSourcesCount - how many sources are on this track? - // AreYouBlank - do you contain anything at all? - // GetSrcAtTime - find a source at a given time. SearchDirection - // is which way to search. -1 = backwards, 1 = forwards - // MakeSpace - !!! what does this do, anyhow? - // RemoveSlice - !!! what does this do, anyhow? - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(EAE58538-622E-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineTrack Interface"), - pointer_default(unique) -] -interface IAMTimelineTrack : IUnknown -{ - [helpstring("method SrcAdd")] - HRESULT SrcAdd(IAMTimelineObj * pSource); - [helpstring("method GetNextSrc")] - HRESULT GetNextSrc([out] IAMTimelineObj ** ppSrc, REFERENCE_TIME * pInOut); - [helpstring("method GetNextSrc2")] - HRESULT GetNextSrc2([out] IAMTimelineObj ** ppSrc, REFTIME * pInOut); - [helpstring("method MoveEverythingBy")] - HRESULT MoveEverythingBy( REFERENCE_TIME Start, REFERENCE_TIME MoveBy ); - [helpstring("method MoveEverythingBy2")] - HRESULT MoveEverythingBy2( REFTIME Start, REFTIME MoveBy ); - [helpstring("method GetSourcesCount")] - HRESULT GetSourcesCount( long * pVal ); - [helpstring("method AreYouBlank")] - HRESULT AreYouBlank( long * pVal ); - [helpstring("method GetSrcAtTime")] - HRESULT GetSrcAtTime( - [out] IAMTimelineObj ** ppSrc, - REFERENCE_TIME Time, - long SearchDirection ); - [helpstring("method GetSrcAtTime2")] - HRESULT GetSrcAtTime2([out] IAMTimelineObj ** ppSrc, REFTIME Time, long SearchDirection ); - HRESULT InsertSpace( REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd ); - HRESULT InsertSpace2( REFTIME rtStart, REFTIME rtEnd ); - HRESULT ZeroBetween( REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd ); - HRESULT ZeroBetween2( REFTIME rtStart, REFTIME rtEnd ); - HRESULT GetNextSrcEx(IAMTimelineObj * pLast, [out] IAMTimelineObj **ppNext); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // This virtual track interface is shared by both the compositions - // and tracks (and groups). - // explained methods: - // TrackGetPriority - used by rendering objects which need to know this. - // SetTrackDirty - !!! not sure if this is useful. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(A8ED5F80-C2C7-11d2-8D39-00A0C9441E20), - odl, - helpstring("IAMTimelineVirtualTrack Interface"), - pointer_default(unique) -] -interface IAMTimelineVirtualTrack : IUnknown -{ - [helpstring("method TrackGetPriority")] - HRESULT TrackGetPriority(long * pPriority); - [helpstring("method SetTrackDirty")] - HRESULT SetTrackDirty( ); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Compositions are like tracks in the sense that they also - // implement IAMVirtualTrack and you can put transitions and effects - // on them, but they really are the SUM of those tracks that they - // contain. They are "embedded" compositions. They should only contain - // media of one particular type (like all video or all audio), but - // this is not enforced. You can add a composition to another - // composition with VTrackInsBefore, just like you can add a track. - // The very top composition to which all other comps and tracks belong - // is a Group, which supports I-AMTimelineGroup as well as I-AMTimelineComp. - // explained methods: - // VTrackInsBefore - does NOT mean VideoTrack. Means Virtual Track. - // Adds a virtual track to a composition at a given priority. - // use -1 to mean "at the end" - // VTrackSwapPriorities - switch two vtracks around. - // VTrackGetCount - get how many vtracks this comp contains. - // GetVTrack - you get the idea - // GetCountOfType - Get the total number of these objects this comp - // and all it's vtracks (recursively) contains. !!! this may be dead. - // GetRecursiveLayerOfType - given a number, returns a given track. This - // is done recursively. You need to pass in a pointer to the number, - // and it will be modified upon exit to an unknown value. DO NOT - // CALL THE VERSION WITH THE POINTER! - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(EAE58536-622E-11d2-8CAD-00A024580902), - odl, - helpstring("IAMTimelineComp Interface"), - pointer_default(unique) -] -interface IAMTimelineComp : IUnknown -{ - [helpstring("method VTrackInsBefore")] - HRESULT VTrackInsBefore(IAMTimelineObj * pVirtualTrack, long Priority); - [helpstring("method VTrackSwapPriorities")] - HRESULT VTrackSwapPriorities(long VirtualTrackA, long VirtualTrackB); - [helpstring("method VTrackGetCount")] - HRESULT VTrackGetCount(long * pVal); - [helpstring("method GetVTrack")] - HRESULT GetVTrack([out] IAMTimelineObj ** ppVirtualTrack, long Which); - [helpstring("method GetCountOfType")] - HRESULT GetCountOfType(long * pVal, long * pValWithComps, TIMELINE_MAJOR_TYPE MajorType ); - [helpstring("method GetRecursiveLayerOfType")] - HRESULT GetRecursiveLayerOfType( - [out] IAMTimelineObj ** ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - [helpstring("method GetRecursiveLayerOfTypeI (do not call)")] - HRESULT GetRecursiveLayerOfTypeI( - [out] IAMTimelineObj ** ppVirtualTrack, - [in,out] long * pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - HRESULT GetNextVTrack(IAMTimelineObj *pVirtualTrack, [out] IAMTimelineObj **ppNextVirtualTrack); -}; - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Groups represent the topmost composition in a timeline. Every - // group should contain media of only one major type (like all video). - // The timeline can contain multiple groups, see it's interface for - // this. Each group has a particular "media type" that you can get/set - // which help identify it. Each group has an associated FPS which - // is used by the render engine in setting up the big switch. All - // cuts on the timeline will happen rounded to this nearest FPS for - // this particular group. Each group has a priority which enables - // writing out multiple-stream files with 1 or more streams of the - // same type. (Like a 2 video stream AVI file). - // explained methods: - // SetTimeline - this is called internally when the group is added. - // Do not call this. - // GetTimeline - get the timeline this group belongs to. - // GetPriority - get this group's priority - // Get/SetOutputFPS - explained above - // SetMediaTypeForVB - method for VB. Pass in 0 for video, 1 for audio - // SetRecompFormatFromSource - set the recompress format based on the - // source that's loaded or set in the IAMTimelineSrc - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(9EED4F00-B8A6-11d2-8023-00C0DF10D434), - odl, - helpstring("IAMTimelineGroup Interface"), - pointer_default(unique) -] -interface IAMTimelineGroup : IUnknown -{ - [helpstring("method SetTimeline")] - HRESULT SetTimeline( IAMTimeline * pTimeline ); - [helpstring("method GetTimeline")] - HRESULT GetTimeline( [out] IAMTimeline ** ppTimeline ); - [helpstring("method GetPriority")] - HRESULT GetPriority( long * pPriority ); - [helpstring("method GetMediaType")] - HRESULT GetMediaType([out] AM_MEDIA_TYPE *); - [helpstring("method SetMediaType")] - HRESULT SetMediaType([in] AM_MEDIA_TYPE *); - [helpstring("method SetOutputFPS")] - HRESULT SetOutputFPS(double FPS); - [helpstring("method GetOutputFPS")] - HRESULT GetOutputFPS(double * pFPS); - [helpstring("method SetGroupName")] - HRESULT SetGroupName( BSTR pGroupName ); - [helpstring("method GetGroupName")] - HRESULT GetGroupName( [out,retval] BSTR * pGroupName ); - // in preview mode, skip frames. In authoring mode, don't - [helpstring("method SetPreviewMode")] - HRESULT SetPreviewMode( BOOL fPreview ); - [helpstring("method GetPreviewMode")] - HRESULT GetPreviewMode( BOOL *pfPreview ); - [helpstring("method SetMediaTypeForVB")] - HRESULT SetMediaTypeForVB([in] long Val ); - // how many frames ahead switch can run - [helpstring("method GetOutputBuffering")] - HRESULT GetOutputBuffering([out] int *pnBuffer ); - [helpstring("method SetOutputBuffering")] - HRESULT SetOutputBuffering([in] int nBuffer ); - - HRESULT SetSmartRecompressFormat( long * pFormat ); - HRESULT GetSmartRecompressFormat( long ** ppFormat ); - HRESULT IsSmartRecompressFormatSet( BOOL * pVal ); - HRESULT IsRecompressFormatDirty( BOOL * pVal ); - HRESULT ClearRecompressFormatDirty( ); - HRESULT SetRecompFormatFromSource( IAMTimelineSrc * pSource ); -}; - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // The main timeline. This is the base object you use to set - // properties of the timeline as a whole, and to create blank - // objects for use within the timeline. You cannot create the - // objects using COM methods, you must go through the timeline to - // create this. That's because certain information is set before - // handing the object back to you. Every object created by the - // timeline will support at LEAST IAMTimelineObj. For any timeline, - // it can have one or more "groups" that it knows about. Each group - // has the capability to hold a complete sub-tree containing media - // that is all of one type. This logical seperation is used for the - // rendering engine, but is not strictly enforced. - // explained methods: - // CreateEmptyNode - pass in a mid type and it will pass back - // an object of the type you requested. - // AddGroup - add a created group to the tree - // RemGroupFromList - make sure timeline no longer knows about this group. - // does NOT do anything to the group itself. Normally the user - // does not want to call this, it's called from the Group's Remove( ) method. - // GetGroup - get a certain group - // GetGroupCount - get how many groups - // ClearAllGroups - clear everything - // GetInsertMode - ask what the insert mode is, overlay or insert - // SetInsertMode - set whether to insert or overlay - // EnableTransitions - turn transitions on or off as a whole - // EnableEffects - same deal. - // SetIntererstRange - discard sub-objects outside of a given - // time range, to save memory/resources - // Get/SetDefaultFPS - set the 'default' FPS for this timeline, - // the RenderEngine reads this information for setting itself up - // by default. - // GetCountOfType - ask for how many of a given thing are in a given - // group. !!! this may be a useless function. - // !!! not implemented - // IsDirty - asks if anything in the timeline needs to be redrawn - // GetDirtyRange - same deal - // ValidateSourceNames - make sure the filenames in the sources - // really exist. Use the same enum flags as the render engine - // uses for SetSourceNameValidation. Source's filenames will be - // changed to those of the found ones in the timeline. - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[ - object, - uuid(78530B74-61F9-11D2-8CAD-00A024580902), - odl, - helpstring("IAMTimeline Interface"), - pointer_default(unique) -] -interface IAMTimeline : IUnknown -{ - [helpstring("method CreateEmptyNode")] - HRESULT CreateEmptyNode([out] IAMTimelineObj ** ppObj, TIMELINE_MAJOR_TYPE Type ); - HRESULT AddGroup( IAMTimelineObj * pGroup ); - HRESULT RemGroupFromList( IAMTimelineObj * pGroup ); - HRESULT GetGroup( [out] IAMTimelineObj ** ppGroup, long WhichGroup ); - HRESULT GetGroupCount( long * pCount ); - HRESULT ClearAllGroups( ); - HRESULT GetInsertMode( long * pMode ); - [helpstring("method SetInsertMode")] - HRESULT SetInsertMode(long Mode); - [helpstring("method EnableTransitions")] - HRESULT EnableTransitions(BOOL fEnabled); - [helpstring("method TransitionsEnabled")] - HRESULT TransitionsEnabled(BOOL * pfEnabled); - [helpstring("method EnableEffects")] - HRESULT EnableEffects(BOOL fEnabled); - [helpstring("method EffectsEnabled")] - HRESULT EffectsEnabled(BOOL * pfEnabled); - [helpstring("method SetInterestRange")] - HRESULT SetInterestRange(REFERENCE_TIME Start, REFERENCE_TIME Stop); - [helpstring("method GetDuration")] - HRESULT GetDuration(REFERENCE_TIME * pDuration); - [helpstring("method GetDuration2")] - HRESULT GetDuration2(double * pDuration); - [helpstring("method SetDefaultFPS")] - HRESULT SetDefaultFPS(double FPS); - [helpstring("method GetDefaultFPS")] - HRESULT GetDefaultFPS(double * pFPS); - [helpstring("method IsDirty")] - HRESULT IsDirty(BOOL * pDirty); - [helpstring("method GetDirtyRange")] - HRESULT GetDirtyRange(REFERENCE_TIME * pStart, REFERENCE_TIME * pStop); - [helpstring("method GetCountOfType")] - HRESULT GetCountOfType(long Group, long * pVal, long * pValWithComps, TIMELINE_MAJOR_TYPE MajorType ); - HRESULT ValidateSourceNames( long ValidateFlags, IMediaLocator * pOverride, LONG_PTR NotifyEventHandle ); - - HRESULT SetDefaultTransition( GUID * pGuid ); - HRESULT GetDefaultTransition( GUID * pGuid ); - HRESULT SetDefaultEffect( GUID * pGuid ); - HRESULT GetDefaultEffect( GUID * pGuid ); - HRESULT SetDefaultTransitionB( BSTR pGuid ); - HRESULT GetDefaultTransitionB( [out,retval] BSTR * pGuid ); - HRESULT SetDefaultEffectB( BSTR pGuid ); - HRESULT GetDefaultEffectB( [out,retval] BSTR * pGuid ); -}; - -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// -// XML STUFF --- XML STUFF --- XML STUFF --- XML STUFF --- XML -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// Xml2Dex - converts back and forth between XML and a dexter project -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -[ - object, - uuid(18C628ED-962A-11D2-8D08-00A0C9441E20), - odl, - helpstring("IXml2Dex Interface"), - pointer_default(unique) -] -interface IXml2Dex : IDispatch -{ - [id(1), helpstring("method CreateGraphFromFile")] - HRESULT CreateGraphFromFile([out] IUnknown ** ppGraph, IUnknown * pTimeline, BSTR Filename); - [id(2), helpstring("method WriteGrfFile")] - HRESULT WriteGrfFile(IUnknown * pGraph, BSTR FileName); - [id(3), helpstring("method WriteXMLFile")] - HRESULT WriteXMLFile(IUnknown * pTimeline, BSTR FileName); - [id(5), helpstring("method ReadXMLFile")] - HRESULT ReadXMLFile(IUnknown *pTimeline, BSTR XMLName); - [id(6), helpstring("method Delete")] - HRESULT Delete(IUnknown *pTimeline, double dStart, double dEnd); - [id(7), helpstring("method WriteXMLPart")] - HRESULT WriteXMLPart(IUnknown * pTimeline, double dStart, double dEnd, BSTR FileName); - [id(8), helpstring("method PasteXMLFile")] - HRESULT PasteXMLFile(IUnknown * pTimeline, double dStart, BSTR FileName); - [id(9), helpstring("method CopyXML")] - HRESULT CopyXML(IUnknown * pTimeline, double dStart, double dEnd); - [id(10), helpstring("method PasteXML")] - HRESULT PasteXML(IUnknown * pTimeline, double dStart); - [id(11), helpstring("method Reset")] - HRESULT Reset( ); - [id(12), helpstring("method ReadXML")] - HRESULT ReadXML(IUnknown *pTimeline, IUnknown *pXML); - [id(13), helpstring("method WriteXML")] - HRESULT WriteXML(IUnknown *pTimeline, BSTR *pbstrXML); -}; - -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// -// USEFUL HELPER INTERFACES -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// IAMErrorLog - an interface that receives error information from -// a timeline or a render engine. -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -[ - object, - uuid(E43E73A2-0EFA-11d3-9601-00A0C9441E20), - odl, - helpstring("IAMErrorLog Interface"), - pointer_default(unique) -] -interface IAMErrorLog : IUnknown -{ - [helpstring("method LogError")] HRESULT LogError(long Severity, BSTR pErrorString, long ErrorCode, long hresult, [in] VARIANT * pExtraInfo ); -}; - -[ - object, - uuid(963566DA-BE21-4eaf-88E9-35704F8F52A1), - odl, - helpstring("IAMSetErrorLog Interface"), - pointer_default(unique) -] -interface IAMSetErrorLog : IUnknown -{ - [propget, helpstring("property ErrorLog")] HRESULT ErrorLog([out, retval] IAMErrorLog * *pVal); - [propput, helpstring("property ErrorLog")] HRESULT ErrorLog([in] IAMErrorLog * newVal); -}; - -[ - object, - uuid(0579154A-2B53-4994-B0D0-E773148EFF85), - local, - helpstring("ISampleGrabberCB Interface"), - pointer_default(unique) -] -interface ISampleGrabberCB : IUnknown -{ - HRESULT SampleCB( double SampleTime, IMediaSample * pSample ); - HRESULT BufferCB( double SampleTime, BYTE * pBuffer, long BufferLen ); -} - -[ - object, - uuid(6B652FFF-11FE-4fce-92AD-0266B5D7C78F), - local, - helpstring("ISampleGrabber Interface"), - pointer_default(unique) -] -interface ISampleGrabber: IUnknown -{ - // set this to have the filter immediate stop after - // garnishing a sample - // - HRESULT SetOneShot( BOOL OneShot ); - - // set what media type we connect to. It can be partially - // specified by setting only the major type, OR the major and - // subtype, OR major, subtype, and the formattype. - // - HRESULT SetMediaType( const AM_MEDIA_TYPE * pType ); - - // after something's connected to this filter, find out - // what it is - // - HRESULT GetConnectedMediaType( AM_MEDIA_TYPE * pType ); - - // call this to buffer incoming samples, so the next two methods will work - // If this is not called, the next two methods will return - // E_INVALIDARG - // - HRESULT SetBufferSamples( BOOL BufferThem ); - - // pass in NULL for pBuffer to get out the buffer size you need to - // allocate. This will NOT return a pointer to a compressed dib - // any longer! It will return the IMediaSample's GetPointer buffer. - // - HRESULT GetCurrentBuffer( [in,out] long * pBufferSize, [out] long * pBuffer ); - - // return the currently buffered sample - // - HRESULT GetCurrentSample( [out,retval] IMediaSample ** ppSample ); - - // if this callback is set, then it will be called for - // every sample passing through the filter. Do not take a long time - // in the callback for smooth playback (obviously!) - // - HRESULT SetCallback( ISampleGrabberCB * pCallback, long WhichMethodToCallback ); -}; - -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// -// THE LIBRARY ITSELF -//////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////// - -[ - uuid(78530B68-61F9-11D2-8CAD-00A024580902), - version(1.0), - helpstring("Dexter 1.0 Type Library") -] -library DexterLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(78530B75-61F9-11D2-8CAD-00A024580902), - helpstring("AMTimeline Class") - ] - coclass AMTimeline - { - [default] interface IAMTimeline; - interface IPersistStream; - interface IAMSetErrorLog; - }; - - [ - uuid(78530B78-61F9-11D2-8CAD-00A024580902), - helpstring("IAMTimelineObj Class") - ] - coclass AMTimelineObj - { - [default] interface IAMTimelineObj; - }; - - [ - uuid(78530B7A-61F9-11D2-8CAD-00A024580902), - helpstring("IAMTimelineSrc Class") - ] - coclass AMTimelineSrc - { - [default] interface IAMTimelineSrc; - interface IAMTimelineObj; - interface IAMTimelineEffectable; - interface IAMTimelineSplittable; - }; - - [ - uuid(8F6C3C50-897B-11d2-8CFB-00A0C9441E20), - ] - coclass AMTimelineTrack - { - [default] interface IAMTimelineTrack; - interface IAMTimelineObj; - interface IAMTimelineEffectable; - interface IAMTimelineTransable; - interface IAMTimelineVirtualTrack; - interface IAMTimelineSplittable; - }; - - [ - uuid(74D2EC80-6233-11d2-8CAD-00A024580902), - ] - coclass AMTimelineComp - { - [default] interface IAMTimelineComp; - interface IAMTimelineObj; - interface IAMTimelineEffectable; - interface IAMTimelineTransable; - interface IAMTimelineVirtualTrack; - }; - - [ - uuid(F6D371E1-B8A6-11d2-8023-00C0DF10D434), - ] - coclass AMTimelineGroup - { - [default] interface IAMTimelineGroup; - interface IAMTimelineComp; - interface IAMTimelineObj; - }; - - [ - uuid(74D2EC81-6233-11d2-8CAD-00A024580902), - ] - coclass AMTimelineTrans - { - [default] interface IAMTimelineTrans; - interface IAMTimelineObj; - interface IAMTimelineSplittable; - }; - - [ - uuid(74D2EC82-6233-11d2-8CAD-00A024580902), - ] - coclass AMTimelineEffect - { - [default] interface IAMTimelineEffect; - interface IAMTimelineObj; - interface IAMTimelineSplittable; - interface IPropertyBag; - }; - - [ - uuid(64D8A8E0-80A2-11d2-8CF3-00A0C9441E20), - ] - coclass RenderEngine - { - [default] interface IRenderEngine; - interface IAMSetErrorLog; - }; - - [ - uuid(498B0949-BBE9-4072-98BE-6CCAEB79DC6F), - ] - coclass SmartRenderEngine - { - [default] interface IRenderEngine; - interface ISmartRenderEngine; - interface IAMSetErrorLog; - }; - - [ - uuid(036A9790-C153-11d2-9EF7-006008039E37), - ] - coclass AudMixer - { - [default] interface IBaseFilter; - }; - - [ - uuid(18C628EE-962A-11D2-8D08-00A0C9441E20), - helpstring("Xml2Dex Class") - ] - coclass Xml2Dex - { - [default] interface IXml2Dex; - }; - - [ - uuid(CC1101F2-79DC-11D2-8CE6-00A0C9441E20), - helpstring("MediaLocator Class") - ] - coclass MediaLocator - { - [default] interface IMediaLocator; - }; - - [ - uuid(ADF95821-DED7-11d2-ACBE-0080C75E246E), - helpstring("Varying Property Holder") - ] - coclass PropertySetter - { - [default] interface IPropertySetter; - interface IAMSetErrorLog; - }; - - [ - uuid(65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA), - helpstring("MediaDet Class") - ] - coclass MediaDet - { - [default] interface IMediaDet; - }; - - [ - uuid(C1F400A0-3F08-11d3-9F0B-006008039E37), - helpstring("MsGrab Class") - ] - coclass SampleGrabber - { - [default] interface ISampleGrabber; - }; - - // useful for movie maker and other people - [ - uuid(C1F400A4-3F08-11d3-9F0B-006008039E37), - helpstring("NullRenderer Class") - ] - coclass NullRenderer - { - [default] interface IBaseFilter; - }; - - [ - uuid(BB44391D-6ABD-422f-9E2E-385C9DFF51FC), - helpstring("DxtCompositor Class") - ] - coclass DxtCompositor - { - [default] interface IDxtCompositor; - }; - - [ - uuid(506D89AE-909A-44f7-9444-ABD575896E35), - helpstring("DxtAlphaSetter Class") - ] - coclass DxtAlphaSetter - { - [default] interface IDxtAlphaSetter; - }; - - [ - uuid(DE75D012-7A65-11D2-8CEA-00A0C9441E20), - helpstring("SMPTE wipe DXT") - ] - coclass DxtJpeg - { - [default] interface IDxtJpeg; - }; - - [ - uuid(0cfdd070-581a-11d2-9ee6-006008039e37), - ] - coclass ColorSource - { - [default] interface IBaseFilter; - }; - - [ - uuid(C5B19592-145E-11d3-9F04-006008039E37), - helpstring("DxtKey Class") - ] - coclass DxtKey - { - [default] interface IDxtKey; - }; -}; - -// these are some error codes that we can/will return -enum -{ - E_NOTINTREE = 0x80040400, - E_RENDER_ENGINE_IS_BROKEN = 0x80040401, - E_MUST_INIT_RENDERER = 0x80040402, - E_NOTDETERMINED = 0x80040403, - E_NO_TIMELINE = 0x80040404, - S_WARN_OUTPUTRESET = 40404 -}; - -// These codes are given to the app in IAMErrorLog to help identify what went wrong - -// Filename doesn't exist, or DShow doesn't recognize the filetype -// EXTRA - filename -cpp_quote("#define DEX_IDS_BAD_SOURCE_NAME 1400") - -// Filename doesn't exist or contains unknown data -// EXTRA - filename (maybe no codec?) -cpp_quote("#define DEX_IDS_BAD_SOURCE_NAME2 1401") - -// filename was required, but wasn't given -cpp_quote("#define DEX_IDS_MISSING_SOURCE_NAME 1402") - -// cannot parse data provided by this source -// !!! what source? -cpp_quote("#define DEX_IDS_UNKNOWN_SOURCE 1403") - -// unexpected error - some DShow component not installed correctly -cpp_quote("#define DEX_IDS_INSTALL_PROBLEM 1404") - -// Source filter does not accept filenames -// !!! What source? -cpp_quote("#define DEX_IDS_NO_SOURCE_NAMES 1405") - -// The group's mediatype is not supported -// EXTRA - gives you an integer group number -cpp_quote("#define DEX_IDS_BAD_MEDIATYPE 1406") - -// Invalid stream number for a source -// EXTRA - gives the stream number !!! should identify which source! -cpp_quote("#define DEX_IDS_STREAM_NUMBER 1407") - -// You ran out of memory -cpp_quote("#define DEX_IDS_OUTOFMEMORY 1408") - -// One bitmap in a sequence was not the same type as the others -// EXTRA - gives the bitmap name -cpp_quote("#define DEX_IDS_DIBSEQ_NOTALLSAME 1409") - -// Clip's mediatimes are invalid, or DibSeq too short, or a previous error caused this -// !!! Needs to give the clip name -cpp_quote("#define DEX_IDS_CLIPTOOSHORT 1410") - -// Clsid of FX/Transition is not a DirectX Transform -// EXTRA - gives the CLSID -cpp_quote("#define DEX_IDS_INVALID_DXT 1411") - -// Default FX/Transition Clsid is not a DirectX Transform" -// EXTRA - gives the CLSID -cpp_quote("#define DEX_IDS_INVALID_DEFAULT_DXT 1412") - -// Your version of DX doesn't support 3D transforms" -// EXTRA - gives the CLSID of the 3D transform you tried to use -cpp_quote("#define DEX_IDS_NO_3D 1413") - -// This DirectX Transform is not the right kind, or is broken -// EXTRA - gives the CLSID of the broken transform -cpp_quote("#define DEX_IDS_BROKEN_DXT 1414") - -// No such property exists on an object -// EXTRA - gives the name of the property (if given as a string) -cpp_quote("#define DEX_IDS_NO_SUCH_PROPERTY 1415") - -// Illegal value for a property -// EXTRA - gives the VARIANT value that was illegal -cpp_quote("#define DEX_IDS_ILLEGAL_PROPERTY_VAL 1416") - -// Syntax error in XML file at line: -// EXTRA - gives I4 line number, if available -cpp_quote("#define DEX_IDS_INVALID_XML 1417") - -// Can't find filter specified in XML by Category and Instance -// EXTRA - gives friendly name (instance) -cpp_quote("#define DEX_IDS_CANT_FIND_FILTER 1418") - -// Disk error writing XML file -cpp_quote("#define DEX_IDS_DISK_WRITE_ERROR 1419") - -// Clsid not a valid DShow audio effect filter -// EXTRA - gives the CLSID -cpp_quote("#define DEX_IDS_INVALID_AUDIO_FX 1420") - -// Cannot find compressor for smart recompression type -cpp_quote("#define DEX_IDS_CANT_FIND_COMPRESSOR 1421") - - - -// !!! Here go problems hooking up sources or finding codecs - - -// THE FOLLOWING SHOULD NEVER HAPPEN - please email directx@microsoft.com if they do - -// Unexpected error in parsing the timeline -cpp_quote("#define DEX_IDS_TIMELINE_PARSE 1426") -// Unexpected error building the filtergraph -cpp_quote("#define DEX_IDS_GRAPH_ERROR 1427") -// Unexpected error with the internal grid -cpp_quote("#define DEX_IDS_GRID_ERROR 1428") -// Unexpected error getting an interface -cpp_quote("#define DEX_IDS_INTERFACE_ERROR 1429") - -// these are the enumeration categories for effects -// -cpp_quote("EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);") -cpp_quote("EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);") -cpp_quote("EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);") -cpp_quote("EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59);") - diff --git a/import/DirectX8/include/DShowIDL/regbag.idl b/import/DirectX8/include/DShowIDL/regbag.idl deleted file mode 100644 index 133ee81bf..000000000 --- a/import/DirectX8/include/DShowIDL/regbag.idl +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// File: RegBag.idl -// -// Desc: IDL source for RegBag.dll. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -cpp_quote("//+-------------------------------------------------------------------------") -cpp_quote("//") -cpp_quote("// Microsoft Windows") -cpp_quote("// Copyright (C) Microsoft Corporation, 1999-2001.") -cpp_quote("//") -cpp_quote("//--------------------------------------------------------------------------") -cpp_quote("#pragma once") - -#ifndef DO_NO_IMPORTS -import "objidl.idl"; -import "oaidl.idl"; -import "ocidl.idl"; -#endif - -//***************************************************************************** -/////////////////////////////////////////////////////////////////////////////// -// -// Custom Factory interface -// since com doesn't support ctors or initialization parameters on std factory interface -// we have a custom creation interface -// -/////////////////////////////////////////////////////////////////////////////// -//***************************************************************************** -/////////////////////////////////////////////////////////////////////////////////////// -[object, - hidden, restricted, - uuid(8A674B48-1F63-11d3-B64C-00C04F79498E), - helpstring("Create property bag backed by registry"), - pointer_default(unique), - local -] -interface ICreatePropBagOnRegKey : IUnknown { - // NOTE: it is up to the caller to set the correct registry access based on the interface - // and methods the caller intends to use - // IPropertyBag2::GetPropertyInfo and CountProperties require both KEY_QUERY_VALUE and KEY_ENUMERATE_SUBKEYS - // IPropertyBagXXX::Read requires KEY_READ - // IPropertyBagXXX::Write requires KEY_WRITE - // also, you must CoTaskMemFree the name string from GetPropertyInfo - // if you write a value of VT_EMPTY or VT_NULL the property will be removed from the bag and the corresponding - // registry info will be deleted. - HRESULT Create([in] HKEY hkey, [in] LPCOLESTR subkey, [in] DWORD ulOptions, [in] DWORD samDesired, REFIID iid, [out] LPVOID *ppBag); -}; - diff --git a/import/DirectX8/include/DShowIDL/strmif.idl b/import/DirectX8/include/DShowIDL/strmif.idl deleted file mode 100644 index 5ea1dd0ec..000000000 --- a/import/DirectX8/include/DShowIDL/strmif.idl +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// File: StrmIf.idl -// -// Desc: ActiveMovie interface definitions. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - -// -// Temporarily disable the /W4 compiler warning C4201, which will be -// reported by all apps which include streams.h or dshow.h, which both -// include the strmif.h generated by this IDL file. -// -cpp_quote("//+-------------------------------------------------------------------------") -cpp_quote("//") -cpp_quote("// Copyright (C) Microsoft Corporation, 1999-2001.") -cpp_quote("//") -cpp_quote("//--------------------------------------------------------------------------") -cpp_quote("// Disable /W4 compiler warning C4201: nameless struct/union") -cpp_quote("#pragma warning(disable:4201) // Disable C4201: nameless struct/union") -cpp_quote(" ") // Blank space - -import "unknwn.idl"; -import "objidl.idl"; // for IPersist (IFilter's root) - -#include "devenum.idl" - -// Core interfaces -#include "axcore.idl" - -// Extended, ActiveMovie-only interfaces -#include "axextend.idl" - -#if (WINVER < 0x501) - #include "IAMovie.idl" -#endif - -// Application interfaces for DVD -#include "dvdif.idl" - -// Dynamic graph stuff -#include "dyngraph.idl" - -// This include is only valid when building for Windows XP -#if (WINVER >= 0x501) - - // Video Mixing Renderer - #include "VMRender.idl" - -#endif - -// -// Restore the previous setting for C4201 compiler warning -// -cpp_quote("// Restore the previous setting for C4201 compiler warning") -cpp_quote("#pragma warning(default:4201)") diff --git a/import/DirectX8/include/DShowIDL/tuner.idl b/import/DirectX8/include/DShowIDL/tuner.idl deleted file mode 100644 index 645546cd2..000000000 --- a/import/DirectX8/include/DShowIDL/tuner.idl +++ /dev/null @@ -1,4225 +0,0 @@ -//------------------------------------------------------------------------------ -// File: Tuner.idl -// -// Desc: -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -cpp_quote("//+-------------------------------------------------------------------------") -cpp_quote("//") -cpp_quote("// Microsoft Windows") -cpp_quote("// Copyright (C) Microsoft Corporation, 1999-2001.") -cpp_quote("//") -cpp_quote("//--------------------------------------------------------------------------") -cpp_quote("#pragma once") - -#include -#ifndef DO_NO_IMPORTS -import "oaidl.idl"; -import "comcat.idl"; -import "strmif.idl"; -import "bdatypes.h"; -import "regbag.idl"; -#endif - -cpp_quote("#include ") - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - -interface ITuningSpaceContainer; -interface ITuningSpace; -interface IEnumTuningSpaces; -interface ITuneRequest; -interface ITuner; -interface IScanningTuner; -interface IEnumComponentTypes; -interface IComponentTypes; -interface IComponentType; -interface ILanguageComponentType; -interface IEnumComponents; -interface IComponents; -interface IComponent; -interface IMPEG2ComponentType; -interface IMPEG2Component; -interface ILocator; -interface IATSCLocator; -interface IDVBSLocator; -interface IDVBTLocator; - -// tuner.idl: -// interface ITuningSpaceContainer : IDispatch -// interface ITuningSpace : IDispatch -// interface ITuneRequest : IDispatch -// interface IComponentType : IDispatch -// interface ILanguageComponentType : IComponentType -// interface IComponentTypes : IDispatch -// interface IComponent : IDispatch -// interface IComponents : IDispatch -// interface ITVTuningSpace : ITuningSpace -// interface IFMRadioTuningSpace : ITuningSpace -// interface IAMRadioTuningSpace : ITuningSpace -// interface IAnalogTVTuningSpace : ITVTuningSpace -// interface IAnalogTVAudioComponent : IComponent -// interface IAnalogTVDataComponent : IComponent -// interface IChannelTuneRequest : ITuneRequest -// interface IDVBComponent : IComponent -// interface IDVBTuneRequest : ITuneRequest - -// DISPIDs for ITuningSpaces interface -// we don't expect to inherit from this interface and consequently there's -// no chance of collision, thus we'll allow midl to auto assign ids for this one - -// DISPIDs for ITuningSpace interface -enum { -DISPID_TUNER_TS_UNIQUENAME = 1, -DISPID_TUNER_TS_FRIENDLYNAME = 2, -DISPID_TUNER_TS_CLSID = 3, -DISPID_TUNER_TS_NETWORKTYPE = 4, -DISPID_TUNER_TS__NETWORKTYPE = 5, -DISPID_TUNER_TS_CREATETUNEREQUEST = 6, -DISPID_TUNER_TS_ENUMCATEGORYGUIDS = 7, -DISPID_TUNER_TS_ENUMDEVICEMONIKERS = 8, -DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES = 9, -DISPID_TUNER_TS_FREQMAP = 10, -DISPID_TUNER_TS_DEFLOCATOR = 11, -DISPID_TUNER_TS_CLONE = 12, - -// DISPIDs for ITuneRequest interface -DISPID_TUNER_TR_TUNINGSPACE = 1, -DISPID_TUNER_TR_COMPONENTS = 2, -DISPID_TUNER_TR_CLONE = 3, -DISPID_TUNER_TR_LOCATOR = 4, - - -// DISPID for IComponentType interface -DISPID_TUNER_CT_CATEGORY = 1, -DISPID_TUNER_CT_MEDIAMAJORTYPE = 2, -DISPID_TUNER_CT__MEDIAMAJORTYPE = 3, -DISPID_TUNER_CT_MEDIASUBTYPE = 4, -DISPID_TUNER_CT__MEDIASUBTYPE = 5, -DISPID_TUNER_CT_MEDIAFORMATTYPE = 6, -DISPID_TUNER_CT__MEDIAFORMATTYPE = 7, -DISPID_TUNER_CT_MEDIATYPE = 8, -DISPID_TUNER_CT_CLONE = 9, - - -// DISPID for ILanguageComponentType interface -DISPID_TUNER_LCT_LANGID = 100, - -// DISPID for IMPEG2ComponentType interface -DISPID_TUNER_MP2CT_TYPE = 200, - -// DISPID for IATSCComponentType interface -DISPID_TUNER_ATSCCT_FLAGS = 300, - -// DISPID for ILocator interface -DISPID_TUNER_L_CARRFREQ = 1, -DISPID_TUNER_L_INNERFECMETHOD = 2, -DISPID_TUNER_L_INNERFECRATE = 3, -DISPID_TUNER_L_OUTERFECMETHOD = 4, -DISPID_TUNER_L_OUTERFECRATE = 5, -DISPID_TUNER_L_MOD = 6, -DISPID_TUNER_L_SYMRATE = 7, -DISPID_TUNER_L_CLONE = 8, - -// DISPID for IATSCLocator interface -DISPID_TUNER_L_ATSC_PHYS_CHANNEL = 201, -DISPID_TUNER_L_ATSC_TSID = 202, - -// DISPID for IDVBTLocator interface -DISPID_TUNER_L_DVBT_BANDWIDTH = 301, -DISPID_TUNER_L_DVBT_LPINNERFECMETHOD = 302, -DISPID_TUNER_L_DVBT_LPINNERFECRATE = 303, -DISPID_TUNER_L_DVBT_GUARDINTERVAL = 304, -DISPID_TUNER_L_DVBT_HALPHA = 305, -DISPID_TUNER_L_DVBT_TRANSMISSIONMODE = 306, -DISPID_TUNER_L_DVBT_INUSE = 307, - -// DISPID for IDVBSLocator interface -DISPID_TUNER_L_DVBS_POLARISATION = 401, -DISPID_TUNER_L_DVBS_WEST = 402, -DISPID_TUNER_L_DVBS_ORBITAL = 403, -DISPID_TUNER_L_DVBS_AZIMUTH = 404, -DISPID_TUNER_L_DVBS_ELEVATION = 405, - -// DISPID for IDVBCLocator interface - -// DISPIDs for IComponent interface -DISPID_TUNER_C_TYPE = 1, -DISPID_TUNER_C_STATUS = 2, -DISPID_TUNER_C_LANGID = 3, -DISPID_TUNER_C_DESCRIPTION = 4, -DISPID_TUNER_C_CLONE = 5, - -// DISPIDs for IMPEG2Component interface -DISPID_TUNER_C_MP2_PID = 101, -DISPID_TUNER_C_MP2_PCRPID = 102, -DISPID_TUNER_C_MP2_PROGNO = 103, - -// DISPIDs for IDVBTuningSpace interface -DISPID_TUNER_TS_DVB_SYSTEMTYPE = 101, -// DISPIDs for IDVBTuningSpace2 interface -DISPID_TUNER_TS_DVB2_NETWORK_ID = 102, -// DISPIDs for IDVBSTuningSpace interface -DISPID_TUNER_TS_DVBS_LOW_OSC_FREQ = 1001, -DISPID_TUNER_TS_DVBS_HI_OSC_FREQ = 1002, -DISPID_TUNER_TS_DVBS_LNB_SWITCH_FREQ = 1003, -DISPID_TUNER_TS_DVBS_INPUT_RANGE = 1004, -DISPID_TUNER_TS_DVBS_SPECTRAL_INVERSION = 1005, - -// DISPIDs for IAnalogRadioTuningSpace interface -DISPID_TUNER_TS_AR_MINFREQUENCY = 101, -DISPID_TUNER_TS_AR_MAXFREQUENCY = 102, -DISPID_TUNER_TS_AR_STEP = 103, - -// DISPIDs for IAnalogTVTuningSpace interface -DISPID_TUNER_TS_ATV_MINCHANNEL = 101, -DISPID_TUNER_TS_ATV_MAXCHANNEL = 102, -DISPID_TUNER_TS_ATV_INPUTTYPE = 103, -DISPID_TUNER_TS_ATV_COUNTRYCODE = 104, - -// DISPIDs for IATSCTuningSpace interface -DISPID_TUNER_TS_ATSC_MINMINORCHANNEL = 201, -DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL = 202, -DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL = 203, -DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL = 204, - -// DISPID for IAnalogTVAudioComponent interface -DISPID_CHTUNER_ATVAC_CHANNEL = 101, - -// DISPIDs for IAnalogTVDataComponent interface -DISPID_CHTUNER_ATVDC_SYSTEM = 101, -DISPID_CHTUNER_ATVDC_CONTENT = 102, - -// DISPID for IChannelTuneRequest interface -DISPID_CHTUNER_CTR_CHANNEL = 101, - -// DISPID IATSCChannelTuneRequest -DISPID_CHTUNER_ACTR_MINOR_CHANNEL = 201, - -// DISPIDs for IDVBComponent interface -DISPID_DVBTUNER_DVBC_ATTRIBUTESVALID = 101, -DISPID_DVBTUNER_DVBC_PID = 102, -DISPID_DVBTUNER_DVBC_TAG = 103, -DISPID_DVBTUNER_DVBC_COMPONENTTYPE = 104, - -// DISPIDs for IDVBTuneRequest interface -DISPID_DVBTUNER_ONID = 101, -DISPID_DVBTUNER_TSID = 102, -DISPID_DVBTUNER_SID = 103, - -// DISPIDs for IMPEG2TuneRequest interface -DISPID_MP2TUNER_TSID = 101, -DISPID_MP2TUNER_PROGNO = 102, - -// DISPIDs for IMPEG2TuneRequestFactory interface -DISPID_MP2TUNERFACTORY_CREATETUNEREQUEST = 1, - -}; - - -////////////////////////////////////////////////////////////////////////////////////// -// Tuning Space Container -////////////////////////////////////////////////////////////////////////////////////// -// simple read-only collection of tuning spaces for enumerating subsets of the total -// set of system tuning spaces - [ - object, - uuid(901284E4-33FE-4b69-8D63-634A596F3756), - dual, - oleautomation, - nonextensible, - helpstring("Tuning Space Collection Interface"), - pointer_default(unique) - ] - interface ITuningSpaces : IDispatch - { - - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT** NewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Find the Tuning Space with the specified Index")] - HRESULT Item( - [in] VARIANT varIndex, - [out, retval] ITuningSpace** TuningSpace - ); - - [propget, hidden, restricted, - helpstring("convenience function so C++ apps don't have to unpack VARIANT")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces** NewEnum - ); - - } - -////////////////////////////////////////////////////////////////////////////////////// -// Tuning Space Container -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - uuid(5B692E84-E2F1-11d2-9493-00C04F72D980), - dual, - oleautomation, - hidden, - nonextensible, - helpstring("Tuning Space Container Interface"), - pointer_default(unique) - ] - interface ITuningSpaceContainer : IDispatch - { - - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT** NewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Find the Tuning Space with the specified Index")] - HRESULT Item( - [in] VARIANT varIndex, - [out, retval] ITuningSpace** TuningSpace - ); - [id(DISPID_VALUE), - propput, - helpstring("Change the Tuning Space with the specified Index")] - HRESULT Item([in] VARIANT varIndex, [in] ITuningSpace *TuningSpace); - - [helpstring("Returns the collection of Tuning Spaces with the same implementation")] - HRESULT TuningSpacesForCLSID( - [in] BSTR SpaceCLSID, - [out, retval] ITuningSpaces** NewColl - ); - - [hidden, restricted, - helpstring("Convenience Function for enumerating from C")] - HRESULT _TuningSpacesForCLSID( - [in] REFCLSID SpaceCLSID, - [out, retval] ITuningSpaces** NewColl - ); - - [helpstring("Returns the collection of Tuning Spaces matching the name")] - HRESULT TuningSpacesForName( - [in] BSTR Name, - [out, retval] ITuningSpaces** NewColl - ); - - [helpstring("Find Local ID Number of the specified Tuning Space")] - HRESULT FindID( - [in] ITuningSpace *TuningSpace, - [out, retval] long *ID - ); - - - [id(DISPID_ADDITEM), - helpstring("Add a new Tuning Space to the collection. This tuning space will be persisted unless removed")] - HRESULT Add( - [in] ITuningSpace* TuningSpace, - [out, retval] VARIANT* NewIndex - ); - - [propget, hidden, restricted, helpstring("Convenience Function for enumerating collection from C")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces **ppEnum - ); - - [id(DISPID_REMOVEITEM), - helpstring("Remove a Tuning Space from the collection. this tuning space will be deleted from the registry")] - HRESULT Remove( - [in] VARIANT Index - ); - - [propget, helpstring("Maximum number of items allowed in the collection")] - HRESULT MaxCount( - [out, retval] long *MaxCount - ); - - // we don't allow script to set this, but we do allow c code to change it. - [propput, hidden, restricted, helpstring("Maximum number of items allowed in the collection")] - HRESULT MaxCount( - [in] long MaxCount - ); - - } - -////////////////////////////////////////////////////////////////////////////////////// -// Tuning Space Interfaces -////////////////////////////////////////////////////////////////////////////////////// - -// note: the network type is the clsid of the tuning space implementation - [ - object, - uuid(061C6E30-E622-11d2-9493-00C04F72D980), - dual, - oleautomation, - nonextensible, - helpstring("Tuning Space Interface"), - pointer_default(unique) - ] - interface ITuningSpace : IDispatch - { - [propget, id(DISPID_TUNER_TS_UNIQUENAME), - helpstring("Unique name of the Tuning Space")] - HRESULT UniqueName( - [out, retval] BSTR *Name - ); - - [propput, id(DISPID_TUNER_TS_UNIQUENAME), - helpstring("Unique name of the Tuning Space")] - HRESULT UniqueName( - [in] BSTR Name - ); - - [propget, id(DISPID_TUNER_TS_FRIENDLYNAME), - helpstring("User-friendly name of the Tuning Space")] - HRESULT FriendlyName( - [out, retval] BSTR *Name - ); - - [propput, id(DISPID_TUNER_TS_FRIENDLYNAME), - helpstring("User-friendly name of the Tuning Space")] - HRESULT FriendlyName( - [in] BSTR Name - ); - - [propget, id(DISPID_TUNER_TS_CLSID), - helpstring("Returns the clsid of the tuning space implementation. provides script access to IPersist:GetClassID")] - HRESULT CLSID( - [out, retval] BSTR* SpaceCLSID - ); - - [propget, id(DISPID_TUNER_TS_NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)")] - HRESULT NetworkType( - [out, retval] BSTR *NetworkTypeGuid - ); - [propput, id(DISPID_TUNER_TS_NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)")] - HRESULT NetworkType( - [in] BSTR NetworkTypeGuid - ); - - [propget, id(DISPID_TUNER_TS__NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)"), hidden, restricted] - HRESULT _NetworkType( - [out, retval] GUID* NetworkTypeGuid - ); - [propput, id(DISPID_TUNER_TS__NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)"), hidden, restricted] - HRESULT _NetworkType( - [in] REFCLSID NetworkTypeGuid - ); - - // this method creates the "best" kind of tune request for this tuning space. - // the tuning space may support other kinds of tune requests created via - // other factory mechanisms(for example, see mpeg2tunerequestfactory). but, - // this method is the preferred way to get a tune request as it always returns - // the optimal type of tune request for this space. - [id(DISPID_TUNER_TS_CREATETUNEREQUEST), - helpstring("Create a Tune Request object")] - HRESULT CreateTuneRequest( - [out, retval] ITuneRequest **TuneRequest - ); - - [id(DISPID_TUNER_TS_ENUMCATEGORYGUIDS), hidden, restricted] - HRESULT EnumCategoryGUIDs( - [out, retval] IEnumGUID **ppEnum - ); - - [id(DISPID_TUNER_TS_ENUMDEVICEMONIKERS), hidden, restricted] - HRESULT EnumDeviceMonikers( - [out, retval] IEnumMoniker **ppEnum - ); - - [propget, id(DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES)] - HRESULT DefaultPreferredComponentTypes( - [out, retval] IComponentTypes** ComponentTypes - ); - [propput, id(DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES)] - HRESULT DefaultPreferredComponentTypes( - [in] IComponentTypes* NewComponentTypes - ); - - // the following property is for the network providers to store frequency/channel maps, frequency/transponder maps - // or whatever other mapping from carrier frequencies to frequency identifiers are appropriate for the tuning space - // in question. the bstr is treated as a binary blob. it is expected to contain embedded nulls, and it may be formatted - // internally in whatever fashion the network provider sees fit. - [propget, id(DISPID_TUNER_TS_FREQMAP), hidden, restricted] - HRESULT FrequencyMapping([out, retval] BSTR *pMapping); - [propput, id(DISPID_TUNER_TS_FREQMAP), hidden, restricted] - HRESULT FrequencyMapping(BSTR Mapping); - - // the following property provides a starting point for the initial IScanningTuner after installation - [propget, id(DISPID_TUNER_TS_DEFLOCATOR)] - HRESULT DefaultLocator([out, retval] ILocator **LocatorVal); - [propput, id(DISPID_TUNER_TS_DEFLOCATOR)] - HRESULT DefaultLocator([in]ILocator *LocatorVal); - - HRESULT Clone([out, retval] ITuningSpace **NewTS); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, - restricted, - object, - uuid(8B8EB248-FC2B-11d2-9D8C-00C04F72D980), - pointer_default(unique) - ] - interface IEnumTuningSpaces : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - ITuningSpace** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumTuningSpaces** ppEnum - ); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(ADA0B268-3B19-4e5b-ACC4-49F852BE13BA), - pointer_default(unique) - ] - interface IDVBTuningSpace : ITuningSpace - { - [propget, id(DISPID_TUNER_TS_DVB_SYSTEMTYPE), - helpstring("Type of DVB System") - ] - HRESULT SystemType( - [out, retval] DVBSystemType *SysType - ); - [propput, id(DISPID_TUNER_TS_DVB_SYSTEMTYPE), - helpstring("Type of DVB System") - ] - HRESULT SystemType( - [in] DVBSystemType SysType - ); - - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(843188B4-CE62-43db-966B-8145A094E040), - pointer_default(unique) - ] - interface IDVBTuningSpace2 : IDVBTuningSpace - { - [propget, id(DISPID_TUNER_TS_DVB2_NETWORK_ID), - helpstring("Network ID of DVB System") - ] - HRESULT NetworkID( - [out, retval] long *NetworkID - ); - [propput, id(DISPID_TUNER_TS_DVB2_NETWORK_ID), - helpstring("Network ID of DVB System") - ] - HRESULT NetworkID( - [in] long NetworkID - ); - - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(CDF7BE60-D954-42fd-A972-78971958E470), - pointer_default(unique) - ] - interface IDVBSTuningSpace : IDVBTuningSpace2 - { - - [propget, id(DISPID_TUNER_TS_DVBS_LOW_OSC_FREQ), - helpstring("Low Oscillator Frequency of DVB System in 10HZ units") - ] - HRESULT LowOscillator( - [out, retval] long *LowOscillator - ); - [propput, id(DISPID_TUNER_TS_DVBS_LOW_OSC_FREQ), - helpstring("Low Oscillator Frequency of DVB System in 10HZ units") - ] - HRESULT LowOscillator( - [in] long LowOscillator - ); - [propget, id(DISPID_TUNER_TS_DVBS_HI_OSC_FREQ), - helpstring("High Oscillator Frequency of DVB System in 10HZ units") - ] - HRESULT HighOscillator( - [out, retval] long *HighOscillator - ); - [propput, id(DISPID_TUNER_TS_DVBS_HI_OSC_FREQ), - helpstring("High Oscillator Frequency of DVB System in 10HZ units") - ] - HRESULT HighOscillator( - [in] long HighOscillator - ); - [propget, id(DISPID_TUNER_TS_DVBS_LNB_SWITCH_FREQ), - helpstring("LNB Switch Frequency of DVB System in 10HZ units") - ] - HRESULT LNBSwitch( - [out, retval] long *LNBSwitch - ); - [propput, id(DISPID_TUNER_TS_DVBS_LNB_SWITCH_FREQ), - helpstring("LNB Switch Frequency of DVB System in 10HZ units") - ] - HRESULT LNBSwitch( - [in] long LNBSwitch - ); - [propget, id(DISPID_TUNER_TS_DVBS_INPUT_RANGE), - helpstring("Which Option/Switch contains the requested signal source") - ] - HRESULT InputRange( - [out, retval] BSTR *InputRange - ); - [propput, id(DISPID_TUNER_TS_DVBS_INPUT_RANGE), - helpstring("Which Option/Switch contains the requested signal source") - ] - HRESULT InputRange( - [in] BSTR InputRange - ); - [propget, id(DISPID_TUNER_TS_DVBS_SPECTRAL_INVERSION), - helpstring("Which Option/Switch contains the requested signal source") - ] - HRESULT SpectralInversion( - [out, retval] SpectralInversion *SpectralInversionVal - ); - [propput, id(DISPID_TUNER_TS_DVBS_SPECTRAL_INVERSION), - helpstring("Which Option/Switch contains the requested signal source") - ] - HRESULT SpectralInversion( - [in] SpectralInversion SpectralInversionVal - ); - - - } - - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2A6E293C-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IAnalogTVTuningSpace : ITuningSpace - { - [propget, id(DISPID_TUNER_TS_ATV_MINCHANNEL), - helpstring("Smallest channel number ever provided by this tuning space") - ] - HRESULT MinChannel( - [out, retval] long *MinChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATV_MINCHANNEL), - helpstring("Smallest channel number ever provided by this tuning space") - ] - HRESULT MinChannel( - [in] long NewMinChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATV_MAXCHANNEL), - helpstring("Largest channel number ever provided by this tuning space") - ] - HRESULT MaxChannel( - [out, retval] long *MaxChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATV_MAXCHANNEL), - helpstring("Largest channel number ever provided by this tuning space") - ] - HRESULT MaxChannel( - [in] long NewMaxChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATV_INPUTTYPE), - helpstring("Input type for this tuning space") - ] - HRESULT InputType([out, retval] TunerInputType *InputTypeVal); - [propput, id(DISPID_TUNER_TS_ATV_INPUTTYPE), - helpstring("Input type for this tuning space") - ] - HRESULT InputType([in] TunerInputType NewInputTypeVal); - [propget, id(DISPID_TUNER_TS_ATV_COUNTRYCODE), - helpstring("International dialing prefix for country of physical broadcast source") - ] - HRESULT CountryCode([out, retval] long *CountryCodeVal); - [propput, id(DISPID_TUNER_TS_ATV_COUNTRYCODE), - helpstring("International dialing prefix for country of physical broadcast source") - ] - HRESULT CountryCode([in] long NewCountryCodeVal); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(0369B4E2-45B6-11d3-B650-00C04F79498E), - pointer_default(unique) - ] -// note: we inherit ATSC from analog because we need the same properties. -// - the definition of channel is overloaded to be the major channel, -// - input type allows us to distinguish between broadcast and cable frequencies -// which allows us to use the atsc tuning space class for "open cable". -// - country code will allow us to redefine physical channel frequencies -// if any other countries adopt ATSC which may happen in Latin America in particular. - interface IATSCTuningSpace : IAnalogTVTuningSpace - { - [propget, id(DISPID_TUNER_TS_ATSC_MINMINORCHANNEL), - helpstring("Smallest minor channel number ever provided by this tuning space") - ] - HRESULT MinMinorChannel( - [out, retval] long *MinMinorChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MINMINORCHANNEL), - helpstring("Smallest minor channel number ever provided by this tuning space") - ] - HRESULT MinMinorChannel( - [in] long NewMinMinorChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL), - helpstring("Largest minor channel number ever provided by this tuning space") - ] - HRESULT MaxMinorChannel( - [out, retval] long *MaxMinorChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL), - helpstring("Largest minor channel number ever provided by this tuning space") - ] - HRESULT MaxMinorChannel( - [in] long NewMaxMinorChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL), - helpstring("Smallest physical channel number ever provided by this tuning space") - ] - HRESULT MinPhysicalChannel( - [out, retval] long *MinPhysicalChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL), - helpstring("Smallest physical channel number ever provided by this tuning space") - ] - HRESULT MinPhysicalChannel( - [in] long NewMinPhysicalChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL), - helpstring("Largest physical channel number ever provided by this tuning space") - ] - HRESULT MaxPhysicalChannel( - [out, retval] long *MaxPhysicalChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL), - helpstring("Largest physical channel number ever provided by this tuning space") - ] - HRESULT MaxPhysicalChannel( - [in] long NewMaxPhysicalChannelVal - ); - - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2A6E293B-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IAnalogRadioTuningSpace : ITuningSpace { - [propget, id(DISPID_TUNER_TS_AR_MINFREQUENCY), - helpstring("Smallest frequency(khz) ever used by this tuning space") - ] - HRESULT MinFrequency( - [out, retval] long *MinFrequencyVal - ); - [propput, id(DISPID_TUNER_TS_AR_MINFREQUENCY), - helpstring("Smallest frequency(khz) ever used by this tuning space") - ] - HRESULT MinFrequency( - [in] long NewMinFrequencyVal - ); - [propget, id(DISPID_TUNER_TS_AR_MAXFREQUENCY), - helpstring("Largest frequency(khz) ever used by this tuning space") - ] - HRESULT MaxFrequency( - [out, retval] long *MaxFrequencyVal - ); - [propput, id(DISPID_TUNER_TS_AR_MAXFREQUENCY), - helpstring("Largest frequency(khz) ever used by this tuning space") - ] - HRESULT MaxFrequency( - [in] long NewMaxFrequencyVal - ); - [propget, id(DISPID_TUNER_TS_AR_STEP), - helpstring("Default step value(khz) to next frequency for this tuning space") - ] - HRESULT Step( - [out, retval] long *StepVal - ); - [propput, id(DISPID_TUNER_TS_AR_STEP), - helpstring("Default step value(khz) to next frequency for this tuning space") - ] - HRESULT Step( - [in] long NewStepVal - ); - } - - -////////////////////////////////////////////////////////////////////////////////////// -// Tune Request Interfaces -////////////////////////////////////////////////////////////////////////////////////// -// tune requests(of any kind) can only be obtained from tune request factories such as -// ITuningSpace::CreateTuneRequest. one reason for this is that we always want to be -// certain that a tune request is bound to the right tuning space. this means we don't -// have to perform consistency checks all over the place. - [ - object, - nonextensible, - uuid(07DDC146-FC3D-11d2-9D8C-00C04F72D980), - dual, - oleautomation, - helpstring("Tune Request Interface"), - pointer_default(unique) - ] - interface ITuneRequest : IDispatch - { - [propget, id(DISPID_TUNER_TR_TUNINGSPACE), - helpstring("Tuning Space object")] - HRESULT TuningSpace( - [out, retval] ITuningSpace **TuningSpace - ); - [propget, id(DISPID_TUNER_TR_COMPONENTS), - helpstring("Components collection")] - HRESULT Components( - [out, retval] IComponents **Components - ); - [id(DISPID_TUNER_TR_CLONE), - helpstring("Create a new copy of this tune request")] - HRESULT Clone( - [out, retval] ITuneRequest **NewTuneRequest - ); - [propget, id(DISPID_TUNER_TR_LOCATOR), - helpstring("Locator Object")] - HRESULT Locator( - [out, retval] ILocator **Locator - ); - [propput, id(DISPID_TUNER_TR_LOCATOR), - helpstring("Locator Object")] - HRESULT Locator( - [in] ILocator *Locator - ); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0369B4E0-45B6-11d3-B650-00C04F79498E), - dual, - oleautomation, - helpstring("Channel Tune Request Interface"), - pointer_default(unique) - ] - interface IChannelTuneRequest : ITuneRequest - { - [propget, id(DISPID_CHTUNER_CTR_CHANNEL), - helpstring("Channel")] - HRESULT Channel( - [out, retval] long *Channel - ); - [propput, id(DISPID_CHTUNER_CTR_CHANNEL), - helpstring("Channel")] - HRESULT Channel( - [in] long Channel - ); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0369B4E1-45B6-11d3-B650-00C04F79498E), - dual, - oleautomation, - helpstring("ATSC Channel Tune Request Interface"), - pointer_default(unique) - ] - interface IATSCChannelTuneRequest : IChannelTuneRequest - { - [propget, id(DISPID_CHTUNER_ACTR_MINOR_CHANNEL), - helpstring("Minor Channel")] - HRESULT MinorChannel( - [out, retval] long *MinorChannel - ); - [propput, id(DISPID_CHTUNER_ACTR_MINOR_CHANNEL), - helpstring("Minor Channel")] - HRESULT MinorChannel( - [in] long MinorChannel - ); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0D6F567E-A636-42bb-83BA-CE4C1704AFA2), - dual, - oleautomation, - helpstring("DVB Tune Request Interface"), - pointer_default(unique) - ] - interface IDVBTuneRequest : ITuneRequest - { - [propget, id(DISPID_DVBTUNER_ONID), - helpstring("Original Network ID")] - HRESULT ONID( - [out, retval] long *ONID - ); - [propput, id(DISPID_DVBTUNER_ONID), - helpstring("Original Network ID")] - HRESULT ONID( - [in] long ONID - ); - [propget, id(DISPID_DVBTUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [out, retval] long *TSID - ); - [propput, id(DISPID_DVBTUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [in] long TSID - ); - [propget, id(DISPID_DVBTUNER_SID), - helpstring("Service ID")] - HRESULT SID( - [out, retval] long *SID - ); - [propput, id(DISPID_DVBTUNER_SID), - helpstring("Service ID")] - HRESULT SID( - [in] long SID - ); - } - -////////////////////////////////////////////////////////////////////////////////////// -/// There are times(for example, reading from a file) when its useful to be able to tune -/// a basic mpeg2 transport stream that contains minimal tables. this requires the least -/// common denominator mpeg2 xport stream id information -/// the following tune request supplies these properties. it can typiclly only be obtained from -/// an mpeg2tunerequestfactory object. no known tune request(at this time) will return this -/// from their createtunerequest() method. in other words, this is not the "best" tune request -/// for any of the current tuning spaces. -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(EB7D987F-8A01-42ad-B8AE-574DEEE44D1A), - dual, - oleautomation, - helpstring("MPEG2 Tune Request Interface"), - pointer_default(unique) - ] - interface IMPEG2TuneRequest : ITuneRequest - { - [propget, id(DISPID_MP2TUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [out, retval] long *TSID - ); - [propput, id(DISPID_MP2TUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [in] long TSID - ); - [propget, id(DISPID_MP2TUNER_PROGNO), - helpstring("Program Number ID")] - HRESULT ProgNo( - [out, retval] long *ProgNo - ); - [propput, id(DISPID_MP2TUNER_PROGNO), - helpstring("Program Number ID")] - HRESULT ProgNo( - [in] long ProgNo - ); - } - - [ - object, - nonextensible, - hidden, - uuid(14E11ABD-EE37-4893-9EA1-6964DE933E39), - dual, - oleautomation, - helpstring("MPEG2 Tune Request Factory Interface"), - pointer_default(unique) - ] - interface IMPEG2TuneRequestFactory : IDispatch - { - [id(DISPID_MP2TUNERFACTORY_CREATETUNEREQUEST), - helpstring("Create MPEG2 Tune Request for specified tuning space(if possible)")] - HRESULT CreateTuneRequest( - [in] ITuningSpace *TuningSpace, - [out, retval] IMPEG2TuneRequest **TuneRequest - ); - } - - [ - object, - hidden, - restricted, - nonextensible, - uuid(1B9D5FC3-5BBC-4b6c-BB18-B9D10E3EEEBF), - helpstring("MPEG2 Tune Request Supported Interface"), - pointer_default(unique) - ] - interface IMPEG2TuneRequestSupport : IUnknown - { - } - - -////////////////////////////////////////////////////////////////////////////////////// -// Tuner Interfaces -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(28C52640-018A-11d3-9D8E-00C04F72D980), - helpstring("Tuner Interface"), - pointer_default(unique) - ] - interface ITuner : IUnknown - { - [propget, helpstring("Tuning Space object")] - HRESULT TuningSpace( - [out, retval] ITuningSpace **TuningSpace - ); - - [propput, helpstring("Tuning Space object")] - HRESULT TuningSpace( - [in] ITuningSpace *TuningSpace - ); - - [hidden, restricted, helpstring("Returns an enumerator for Tuning Spaces accepted by this tuner")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces **ppEnum - ); - - [propget, helpstring("Tune Request object")] - HRESULT TuneRequest( - [out, retval] ITuneRequest **TuneRequest - ); - - [propput, helpstring("Tune Request object")] - HRESULT TuneRequest( - [in] ITuneRequest *TuneRequest - ); - - [helpstring("Validate the tuning request without tuning")] - HRESULT Validate( - [in] ITuneRequest *TuneRequest - ); - - [propget, helpstring("Preferred Component Types collection")] - HRESULT PreferredComponentTypes( - [out, retval] IComponentTypes **ComponentTypes - ); - - [propput, helpstring("Preferred Component Types collection")] - HRESULT PreferredComponentTypes( - [in] IComponentTypes *ComponentTypes - ); - - [propget, helpstring("Signal Strength")] - HRESULT SignalStrength( - [out, retval] long *Strength - ); - - [helpstring("Trigger Signal events (interval in milliseconds; 0 turns off trigger)")] - HRESULT TriggerSignalEvents( - [in] long Interval - ); - } - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(1DFD0A5C-0284-11d3-9D8E-00C04F72D980), - helpstring("Scanning Tuner Interface"), - pointer_default(unique) - ] - interface IScanningTuner : ITuner - { - [helpstring("Seek to the next valid selection")] - HRESULT SeekUp( - ); - - [helpstring("Seek to the previous valid selection")] - HRESULT SeekDown( - ); - - [helpstring("Scan for valid selections upward")] - HRESULT ScanUp( - [in] long MillisecondsPause - ); - - [helpstring("Scan for valid selections downward")] - HRESULT ScanDown( - [in] long MillisecondsPause - ); - - [helpstring("Enter the device's autoprogram mode")] - HRESULT AutoProgram( - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// -// Component Type Interfaces -////////////////////////////////////////////////////////////////////////////////////// - - // Component Category - - [ - object, - hidden, - nonextensible, - uuid(6A340DC0-0311-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Type Interface"), - pointer_default(unique) - ] - interface IComponentType : IDispatch - { - [propget, id(DISPID_TUNER_CT_CATEGORY), - helpstring("General category of component")] - HRESULT Category( - [out, retval] ComponentCategory *Category - ); - [propput, id(DISPID_TUNER_CT_CATEGORY), - helpstring("General category of component")] - HRESULT Category( - [in] ComponentCategory Category - ); - - [propget, id(DISPID_TUNER_CT_MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid")] - HRESULT MediaMajorType( - [out, retval] BSTR *MediaMajorType - ); - [propput, id(DISPID_TUNER_CT_MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid")] - HRESULT MediaMajorType( - [in] BSTR MediaMajorType - ); - [propget, id(DISPID_TUNER_CT__MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid"), hidden, restricted] - HRESULT _MediaMajorType( - [out, retval] GUID* MediaMajorTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid"), hidden, restricted] - HRESULT _MediaMajorType( - [in] REFCLSID MediaMajorTypeGuid - ); - [propget, id(DISPID_TUNER_CT_MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid")] - HRESULT MediaSubType( - [out, retval] BSTR *MediaSubType - ); - [propput, id(DISPID_TUNER_CT_MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid")] - HRESULT MediaSubType( - [in] BSTR MediaSubType - ); - [propget, id(DISPID_TUNER_CT__MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid"), hidden, restricted] - HRESULT _MediaSubType( - [out, retval] GUID* MediaSubTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid"), hidden, restricted] - HRESULT _MediaSubType( - [in] REFCLSID MediaSubTypeGuid - ); - [propget, id(DISPID_TUNER_CT_MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid")] - HRESULT MediaFormatType( - [out, retval] BSTR *MediaFormatType - ); - [propput, id(DISPID_TUNER_CT_MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid")] - HRESULT MediaFormatType( - [in] BSTR MediaFormatType - ); - [propget, id(DISPID_TUNER_CT__MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid"), hidden, restricted] - HRESULT _MediaFormatType( - [out, retval] GUID* MediaFormatTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid"), hidden, restricted] - HRESULT _MediaFormatType( - [in] REFCLSID MediaFormatTypeGuid - ); - - [propget, id(DISPID_TUNER_CT_MEDIATYPE), hidden, restricted, - helpstring("DirectShow MediaType Guid, this only retrieves major, sub, format guids not the entire struct")] - HRESULT MediaType( - [out, retval] AM_MEDIA_TYPE *MediaType - ); - [propput, id(DISPID_TUNER_CT_MEDIATYPE), hidden, restricted, - helpstring("DirectShow MediaType Guid, this only retrieves major, sub, format guids not the entire struct")] - HRESULT MediaType( - [in] AM_MEDIA_TYPE *MediaType - ); - - [id(DISPID_TUNER_CT_CLONE), - helpstring("Create a copy of this component type")] - HRESULT Clone( - [out, retval] IComponentType **NewCT - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(B874C8BA-0FA2-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Language Component Type Interface"), - pointer_default(unique) - ] - interface ILanguageComponentType : IComponentType - { - [propget, id(DISPID_TUNER_LCT_LANGID), - helpstring("Language Identifier for Substream Content Language")] - HRESULT LangID( - [out, retval] long *LangID - ); - - [propput, id(DISPID_TUNER_LCT_LANGID), - helpstring("Language Identifier for Substream Content Language")] - HRESULT LangID( - [in] long LangID - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2C073D84-B51C-48c9-AA9F-68971E1F6E38), - dual, - oleautomation, - helpstring("MPEG2 Component Type Interface"), - pointer_default(unique) - ] - interface IMPEG2ComponentType : ILanguageComponentType - { - [propget, id(DISPID_TUNER_MP2CT_TYPE), - helpstring("MPEG2 Stream Type")] - HRESULT StreamType( - [out, retval] MPEG2StreamType *MP2StreamType - ); - - [propput, id(DISPID_TUNER_MP2CT_TYPE), - helpstring("MPEG2 Stream Type")] - HRESULT StreamType( - [in] MPEG2StreamType MP2StreamType - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(FC189E4D-7BD4-4125-B3B3-3A76A332CC96), - dual, - oleautomation, - helpstring("ATSC Component Type Interface"), - pointer_default(unique) - ] - interface IATSCComponentType : IMPEG2ComponentType - { - [propget, id(DISPID_TUNER_ATSCCT_FLAGS), - helpstring("ATSC Component Type Flags")] - HRESULT Flags( - [out, retval] long *Flags - ); - - [propput, id(DISPID_TUNER_ATSCCT_FLAGS), - helpstring("ATSC Component Type Flags")] - HRESULT Flags( - [in] long flags - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - object, - uuid(8A674B4A-1F63-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IEnumComponentTypes : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - IComponentType** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumComponentTypes** ppEnum - ); - } - - -////////////////////////////////////////////////////////////////////////////////////// -// Component Type Container -////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(0DC13D4A-0313-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("ComponentType Collection Interface"), - pointer_default(unique) - ] - interface IComponentTypes : IDispatch - { - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT **ppNewEnum - ); - - [hidden, restricted, helpstring("Convenience Function for Use with C")] - HRESULT EnumComponentTypes( - [out, retval] IEnumComponentTypes **ppNewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Get the ComponentType at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [out, retval] IComponentType **ComponentType - ); - - [id(DISPID_VALUE), - propput, - helpstring("Get the ComponentType at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [in] IComponentType *ComponentType - ); - - [id(DISPID_ADDITEM), - helpstring("Append the ComponentType to the collection")] - HRESULT Add( - [in] IComponentType *ComponentType, - [out, retval] VARIANT *NewIndex - ); - - [id(DISPID_REMOVEITEM), - helpstring("Clear the collection")] - HRESULT Remove( - [in] VARIANT Index - ); - - [helpstring("Copy the collection")] - HRESULT Clone([out, retval] IComponentTypes **NewList); - }; - -////////////////////////////////////////////////////////////////////////////////////// -// Component Interfaces -////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - nonextensible, - uuid(1A5576FC-0E19-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Interface"), - pointer_default(unique) - ] - interface IComponent : IDispatch - { - [propget, id(DISPID_TUNER_C_TYPE), - helpstring("Component Type")] - HRESULT Type( - [out, retval] IComponentType** CT - ); - - // only loaders initialize components - [hidden, restricted, propput, id(DISPID_TUNER_C_TYPE), - helpstring("Component Type")] - HRESULT Type( - [in] IComponentType* CT - ); - - // NOTE: this langid is *not* the same as the langid - // in the componenttype(if the componenttype is a languagecomponenttype) - // the langid in the component type is the language of the content this - // component is describing. the following langid in the component is the - // language of the descriptive info in the component object. - [propget, id(DISPID_TUNER_C_LANGID), - helpstring("Language Identifier for Description Language")] - HRESULT DescLangID( - [out, retval] long *LangID - ); - - [propput, id(DISPID_TUNER_C_LANGID), - helpstring("Language Identifier for Description Language")] - HRESULT DescLangID( - [in] long LangID - ); - - [propget, id(DISPID_TUNER_C_STATUS), - helpstring("Component Status")] - HRESULT Status( - [out, retval] ComponentStatus *Status - ); - - [propput, id(DISPID_TUNER_C_STATUS), - helpstring("Component Status")] - HRESULT Status( - [in] ComponentStatus Status - ); - - [propget, id(DISPID_TUNER_C_DESCRIPTION), - helpstring("Component Description")] - HRESULT Description( - [out, retval] BSTR *Description - ); - - // restricted: only loaders will initialize components - [hidden, restricted, propput, id(DISPID_TUNER_C_DESCRIPTION), - helpstring("Component Description")] - HRESULT Description( - [in] BSTR Description - ); - - [id(DISPID_TUNER_C_CLONE), - helpstring("Copy Component")] - HRESULT Clone( - [out, retval] IComponent **NewComponent - ); - - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(1493E353-1EB6-473c-802D-8E6B8EC9D2A9), - dual, - oleautomation, - helpstring("MPEG2 Component Interface"), - pointer_default(unique) - ] - interface IMPEG2Component : IComponent - { - [propget, id(DISPID_TUNER_C_MP2_PID), - helpstring("MPEG2 Packet ID for this Substream")] - HRESULT PID( - [out, retval] long *PID - ); - - [propput, id(DISPID_TUNER_C_MP2_PID), - helpstring("MPEG2 Packet ID for this Substream")] - HRESULT PID( - [in] long PID - ); - [propget, id(DISPID_TUNER_C_MP2_PCRPID), - helpstring("MPEG2 Packet ID for this Substream's Timestamps")] - HRESULT PCRPID( - [out, retval] long *PCRPID - ); - - [propput, id(DISPID_TUNER_C_MP2_PCRPID), - helpstring("MPEG2 Packet ID for this Substream's Timestamps")] - HRESULT PCRPID( - [in] long PCRPID - ); - - // program number provides reverse lookup to PAT - [propget, id(DISPID_TUNER_C_MP2_PROGNO), - helpstring("MPEG2 Program Number")] - HRESULT ProgramNumber( - [out, retval] long *ProgramNumber - ); - - [propput, id(DISPID_TUNER_C_MP2_PROGNO), - helpstring("MPEG2 Program Number")] - HRESULT ProgramNumber( - [in] long ProgramNumber - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - object, - uuid(2A6E2939-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IEnumComponents : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - IComponent** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumComponents** ppEnum - ); - } - - -////////////////////////////////////////////////////////////////////////////////////// -// Component Container -////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - nonextensible, - uuid(FCD01846-0E19-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Collection Interface"), - pointer_default(unique) - ] - interface IComponents : IDispatch - { - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT **ppNewEnum - ); - - [hidden, restricted, helpstring("Convenience Function for Use with C")] - HRESULT EnumComponents( - [out, retval] IEnumComponents **ppNewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Get the Component at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [out, retval] IComponent **ppComponent - ); - - [id(DISPID_ADDITEM), - helpstring("Add the Component to the collection")] - HRESULT Add( - [in] IComponent *Component, - [out, retval] VARIANT *NewIndex - ); - - [id(DISPID_REMOVEITEM), - helpstring("Remove the Component at the specified index")] - HRESULT Remove( - [in] VARIANT Index - ); - - [helpstring("Copy the collection")] - HRESULT Clone([out, retval] IComponents **NewList); - }; - -////////////////////////////////////////////////////////////////////////////////////// -// Component Container -////////////////////////////////////////////////////////////////////////////////////// -// this separates the what(general tune request properties) from the where - - - - [ - object, - nonextensible, - uuid(286D7F89-760C-4F89-80C4-66841D2507AA), - dual, - oleautomation, - helpstring("Generic Locator Information"), - pointer_default(unique) - ] - interface ILocator : IDispatch - { - - [propget, id(DISPID_TUNER_L_CARRFREQ), helpstring("Carrier Frequency(DecaHertz)")] - HRESULT CarrierFrequency( - [out, retval] long* Frequency - ); - [propput, id(DISPID_TUNER_L_CARRFREQ), helpstring("Carrier Frequency(DecaHertz)")] - HRESULT CarrierFrequency( - [in] long Frequency - ); - [propget, id(DISPID_TUNER_L_INNERFECMETHOD), helpstring("Inner Fec Type")] - HRESULT InnerFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_INNERFECMETHOD), helpstring("Inner Fec Type")] - HRESULT InnerFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_INNERFECRATE), helpstring("Inner Fec Rate")] - HRESULT InnerFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_INNERFECRATE), helpstring("Inner Fec Rate")] - HRESULT InnerFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_OUTERFECMETHOD), helpstring("Outer Fec Type")] - HRESULT OuterFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_OUTERFECMETHOD), helpstring("Outer Fec Type")] - HRESULT OuterFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_OUTERFECRATE), helpstring("Outer Fec Rate")] - HRESULT OuterFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_OUTERFECRATE), helpstring("Outer Fec Rate")] - HRESULT OuterFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_MOD), helpstring("Modulation Type")] - HRESULT Modulation( - [out, retval] ModulationType* Modulation - ); - [propput, id(DISPID_TUNER_L_MOD), helpstring("Modulation Type")] - HRESULT Modulation( - [in] ModulationType Modulation - ); - [propget, id(DISPID_TUNER_L_SYMRATE), helpstring("Modulation Symbol Rate")] - HRESULT SymbolRate( - [out, retval] long* Rate - ); - [propput, id(DISPID_TUNER_L_SYMRATE), helpstring("Modulation Symbol Rate")] - HRESULT SymbolRate( - [in] long Rate - ); - [id(DISPID_TUNER_L_CLONE), helpstring("Copy the Locator")] - HRESULT Clone([out, retval] ILocator **NewLocator); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(BF8D986F-8C2B-4131-94D7-4D3D9FCC21EF), - dual, - oleautomation, - helpstring("ATSC Locator Information"), - pointer_default(unique) - ] - interface IATSCLocator : ILocator - { - [propget, id(DISPID_TUNER_L_ATSC_PHYS_CHANNEL), - helpstring("Physical Channel")] - HRESULT PhysicalChannel( - [out, retval] long *PhysicalChannel - ); - [propput, id(DISPID_TUNER_L_ATSC_PHYS_CHANNEL), - helpstring("Physical Channel")] - HRESULT PhysicalChannel( - [in] long PhysicalChannel - ); - [propget, id(DISPID_TUNER_L_ATSC_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [out, retval] long *TSID - ); - [propput, id(DISPID_TUNER_L_ATSC_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [in] long TSID - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(8664DA16-DDA2-42ac-926A-C18F9127C302), - dual, - oleautomation, - helpstring("DVB Terrestrial Locator Information"), - pointer_default(unique) - ] - interface IDVBTLocator : ILocator - { - [propget, id(DISPID_TUNER_L_DVBT_BANDWIDTH), helpstring("Bandwidth")] - HRESULT Bandwidth( - [out, retval] long* BandWidthVal - ); - [propput, id(DISPID_TUNER_L_DVBT_BANDWIDTH), helpstring("Bandwidth")] - HRESULT Bandwidth( - [in] long BandwidthVal - ); - - [propget, id(DISPID_TUNER_L_DVBT_LPINNERFECMETHOD), helpstring("Inner Fec Type for Low Priority Stream")] - HRESULT LPInnerFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_DVBT_LPINNERFECMETHOD), helpstring("Inner Fec Type for Low Priority Stream")] - HRESULT LPInnerFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_DVBT_LPINNERFECRATE), helpstring("Inner Fec Rate for Low Priority Stream")] - HRESULT LPInnerFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_DVBT_LPINNERFECRATE), helpstring("Inner Fec Rate for Low Priority Stream")] - HRESULT LPInnerFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_DVBT_HALPHA), helpstring("Hierarchical Alpha")] - HRESULT HAlpha( - [out, retval] HierarchyAlpha* Alpha - ); - [propput, id(DISPID_TUNER_L_DVBT_HALPHA), helpstring("Hierarchical Alpha")] - HRESULT HAlpha( - [in] HierarchyAlpha Alpha - ); - [propget, id(DISPID_TUNER_L_DVBT_GUARDINTERVAL), helpstring("Guard Interval")] - HRESULT Guard( - [out, retval] GuardInterval* GI - ); - [propput, id(DISPID_TUNER_L_DVBT_GUARDINTERVAL), helpstring("Guard Interval")] - HRESULT Guard( - [in] GuardInterval GI - ); - [propget, id(DISPID_TUNER_L_DVBT_TRANSMISSIONMODE), helpstring("Transmission Mode")] - HRESULT Mode( - [out, retval] TransmissionMode* mode - ); - [propput, id(DISPID_TUNER_L_DVBT_TRANSMISSIONMODE), helpstring("Transmission Mode")] - HRESULT Mode( - [in] TransmissionMode mode - ); - [propget, id(DISPID_TUNER_L_DVBT_INUSE), helpstring("Hierarchical Alpha")] - HRESULT OtherFrequencyInUse( - [out, retval] VARIANT_BOOL* OtherFrequencyInUseVal - ); - [propput, id(DISPID_TUNER_L_DVBT_INUSE), helpstring("Hierarchical Alpha")] - HRESULT OtherFrequencyInUse( - [in] VARIANT_BOOL OtherFrequencyInUseVal - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(3D7C353C-0D04-45f1-A742-F97CC1188DC8), - dual, - oleautomation, - helpstring("DVB Satellite Locator Information"), - pointer_default(unique) - ] - interface IDVBSLocator : ILocator - { - - [propget, id(DISPID_TUNER_L_DVBS_POLARISATION), helpstring("Signal Polarisation Type")] - HRESULT SignalPolarisation( - [out, retval] Polarisation* PolarisationVal - ); - [propput, id(DISPID_TUNER_L_DVBS_POLARISATION), helpstring("Signal Polarisation Type")] - HRESULT SignalPolarisation( - [in] Polarisation PolarisationVal - ); - [propget, id(DISPID_TUNER_L_DVBS_WEST), helpstring("VARIANT_TRUE means orbital position specifies west longitude")] - HRESULT WestPosition( - [out, retval] VARIANT_BOOL* WestLongitude - ); - [propput, id(DISPID_TUNER_L_DVBS_WEST), helpstring("VARIANT_TRUE means orbital position specifies west longitude")] - HRESULT WestPosition( - [in] VARIANT_BOOL WestLongitude - ); - [propget, id(DISPID_TUNER_L_DVBS_ORBITAL), helpstring("Longitude in tenths of a degree")] - HRESULT OrbitalPosition( - [out, retval] long* longitude - ); - [propput, id(DISPID_TUNER_L_DVBS_ORBITAL), helpstring("Longitude in tenths of a degree")] - HRESULT OrbitalPosition( - [in] long longitude - ); - [propget, id(DISPID_TUNER_L_DVBS_AZIMUTH), helpstring("Azimuth in tenths of a degree")] - HRESULT Azimuth( - [out, retval] long* Azimuth - ); - [propput, id(DISPID_TUNER_L_DVBS_AZIMUTH), helpstring("Azimuth in tenths of a degree")] - HRESULT Azimuth( - [in] long Azimuth - ); - [propget, id(DISPID_TUNER_L_DVBS_ELEVATION), helpstring("Elevation in tenths of a degree")] - HRESULT Elevation( - [out, retval] long* Elevation - ); - [propput, id(DISPID_TUNER_L_DVBS_ELEVATION), helpstring("Elevation in tenths of a degree")] - HRESULT Elevation( - [in] long Elevation - ); - }; - -////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(6E42F36E-1DD2-43c4-9F78-69D25AE39034), - dual, - oleautomation, - helpstring("DVB Cable Locator Information"), - pointer_default(unique) - ] - interface IDVBCLocator : ILocator - { - }; - -/////////////////////////////////////////////////////////////////////////////////////// -// utility interfaces -/////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(3B21263F-26E8-489d-AAC4-924F7EFD9511), - helpstring("Broadcast Event Service Firing/Reflecting Interface"), - pointer_default(unique) - ] - interface IBroadcastEvent : IUnknown - { - HRESULT Fire(GUID EventID); - }; - - -////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////// -// TYPELIB & CoClasses -////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////// -[ - uuid(9B085638-018E-11d3-9D8E-00C04F72D980), - version(1.0), - helpstring("Microsoft Tuner 1.0 Type Library") -] -library TunerLib -{ - importlib("stdole2.tlb"); - - // SystemTuningSpaces class - [ - uuid(D02AAC50-027E-11d3-9D8E-00C04F72D980), - helpstring("SystemTuningSpace Class") - ] - coclass SystemTuningSpaces - { - [default] interface ITuningSpaceContainer; - }; - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(5FFDC5E6-B83A-4b55-B6E8-C69E765FE9DB), - helpstring("dummy class to expose base tuning space i/f to VB") - ] - coclass TuningSpace - { - [default] interface ITuningSpace; - }; - - - [ - uuid(A2E30750-6C3D-11d3-B653-00C04F79498E), - helpstring("ATSC Digital Broadcast Tuning Space Class") - ] - coclass ATSCTuningSpace - { - [default] interface IATSCTuningSpace; - }; - - [ - uuid(8A674B4C-1F63-11d3-B64C-00C04F79498E), - helpstring("Analog Radio Tuning Space Class") - ] - coclass AnalogRadioTuningSpace - { - [default] interface IAnalogRadioTuningSpace; - }; - - [ - uuid(8A674B4D-1F63-11d3-B64C-00C04F79498E), - helpstring("Analog TV Tuning Space Class") - ] - coclass AnalogTVTuningSpace - { - [default] interface IAnalogTVTuningSpace; - }; - - [ - uuid(C6B14B32-76AA-4a86-A7AC-5C79AAF58DA7), - helpstring("DVB Tuning Space Class") - ] - coclass DVBTuningSpace - { - [default] interface IDVBTuningSpace2; - interface IDVBTuningSpace; - }; - - [ - uuid(B64016F3-C9A2-4066-96F0-BD9563314726), - helpstring("DVB Satellite Tuning Space Class") - ] - coclass DVBSTuningSpace - { - [default] interface IDVBSTuningSpace; - }; - - - // ComponentTypes container class - [ - uuid(A1A2B1C4-0E3A-11d3-9D8E-00C04F72D980), - helpstring("Component Types Collection Class") - ] - coclass ComponentTypes - { - [default] interface IComponentTypes; - }; - - // ComponentType class - [ - uuid(823535A0-0318-11d3-9D8E-00C04F72D980), - helpstring("ComponentType Class") - ] - coclass ComponentType - { - [default] interface IComponentType; - }; - - // Language ComponentType class - [ - uuid(1BE49F30-0E1B-11d3-9D8E-00C04F72D980), - helpstring("LanguageComponentType Class") - ] - coclass LanguageComponentType - { - [default] interface ILanguageComponentType; - }; - - // MPEG2 ComponentType class - [ - uuid(418008F3-CF67-4668-9628-10DC52BE1D08), - helpstring("MPEG2ComponentType Class") - ] - coclass MPEG2ComponentType - { - [default] interface IMPEG2ComponentType; - }; - - // ATSC ComponentType class - [ - uuid(A8DCF3D5-0780-4ef4-8A83-2CFFAACB8ACE), - helpstring("ATSCComponentType Class") - ] - coclass ATSCComponentType - { - [default] interface IATSCComponentType; - }; - - // Components class - [ - hidden, restricted, - uuid(809B6661-94C4-49e6-B6EC-3F0F862215AA), - helpstring("Components Collection Class") - ] - coclass Components - { - [default] interface IComponents; - }; - - // Component class - // the components can only be created by network provider/tif. client apps - // retrieve them from a filled-in tune request by either loading a persisted tune - // request that has been filled in by a proper guide store loader or by re-getting - // the current tune request property which will have this filled in by the network - // provider - [ - hidden, restricted, - uuid(59DC47A8-116C-11d3-9D8E-00C04F72D980), - helpstring("Component Class") - ] - coclass Component - { - [default] interface IComponent; - }; - - // MPEG2 Component class - [ - hidden, restricted, - uuid(055CB2D7-2969-45cd-914B-76890722F112), - helpstring("MPEG2 Component Class") - ] - coclass MPEG2Component - { - [default] interface IMPEG2Component; - }; - - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(B46E0D38-AB35-4a06-A137-70576B01B39F), - helpstring("dummy class to expose base tune request i/f to VB") - ] - coclass TuneRequest - { - [default] interface ITuneRequest; - }; - - - // NOTE: the tuning request factories should not be invoked directly. - // instead apps should use ITuningSpace::CreateTuningRequest to obtain a correctly - // initialized tuning request of the appropriate type for that space. - // the object factories are provided to allow generic code to a load a previously persisted - // tune request object. - [ - hidden, - restricted, - uuid(0369B4E5-45B6-11d3-B650-00C04F79498E), - helpstring("Channel Tune Request") - ] - coclass ChannelTuneRequest - { - [default] interface IChannelTuneRequest; - }; - - [ - hidden, - restricted, - uuid(0369B4E6-45B6-11d3-B650-00C04F79498E), - helpstring("ATSC Channel Tune Request") - ] - coclass ATSCChannelTuneRequest - { - [default] interface IATSCChannelTuneRequest; - }; - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(0955AC62-BF2E-4cba-A2B9-A63F772D46CF), - helpstring("dummy class to expose mpeg2 request i/f to VB") - ] - coclass MPEG2TuneRequest - { - [default] interface IMPEG2TuneRequest; - }; - - [ - uuid(2C63E4EB-4CEA-41b8-919C-E947EA19A77C), - helpstring("Factory for creating IMPEG2TuneRequest") - ] - coclass MPEG2TuneRequestFactory - { - [default] interface IMPEG2TuneRequestFactory; - }; - - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(0888C883-AC4F-4943-B516-2C38D9B34562), - helpstring("dummy class to expose base locator i/f to VB") - ] - coclass Locator - { - [default] interface ILocator; - }; - - // its not intended that client apps actually create locators. the network - // provider in combination with the transport information filter(TIF) are the - // only modules in the system that actually know the correct values for these objects - // however, for testing purposes, its necessary to allow these to be created. - // instead, normally these will simply be passed around opaquely since they're a - // property of the base tune request interface. - [ - uuid(8872FF1B-98FA-4d7a-8D93-C9F1055F85BB), - helpstring("ATSC Locator") - ] - coclass ATSCLocator - { - [default] interface IATSCLocator; - }; - - [ - uuid(9CD64701-BDF3-4d14-8E03-F12983D86664), - helpstring("DVB-Terrestrial Locator") - ] - coclass DVBTLocator - { - [default] interface IDVBTLocator; - }; - - [ - uuid(1DF7D126-4050-47f0-A7CF-4C4CA9241333), - helpstring("DVB-Satellite Locator") - ] - coclass DVBSLocator - { - [default] interface IDVBSLocator; - }; - - [ - uuid(C531D9FD-9685-4028-8B68-6E1232079F1E), - helpstring("DVB-Cable Locator") - ] - coclass DVBCLocator - { - [default] interface ILocator; - }; - - [ - hidden, - restricted, - uuid(15D6504A-5494-499c-886C-973C9E53B9F1), - helpstring("DVB Tune Request") - ] - coclass DVBTuneRequest - { - [default] interface IDVBTuneRequest; - }; - -// Sample tuner class definition: -// -// [ -// uuid(), -// helpstring("My Tuner object") -// ] -// coclass MyTuner -// { -// [default] interface ITuner; -// interface IMyTunerCustomFeatureInterface; -// }; - -/////////////////////////////////////////////////////////////////////////////////////// -// utility objects -/////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - uuid(8A674B49-1F63-11d3-B64C-00C04F79498E), - helpstring("Create property bag backed by registry") - ] - coclass CreatePropBagOnRegKey - { - interface ICreatePropBagOnRegKey; - }; - - [ - hidden, restricted, - uuid(0B3FFB92-0919-4934-9D5B-619C719D0202), - helpstring("DShow Broadcast Event Service Object") - ] - coclass BroadcastEventService - { - interface IBroadcastEvent; - }; - -cpp_quote("#define SID_SBroadcastEventService CLSID_BroadcastEventService") - -} - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - interface ITuningSpaceContainer; - interface ITuningSpace; - interface IEnumTuningSpaces; - interface ITuneRequest; - interface ITuner; - interface IScanningTuner; - interface ITunerEvents; - interface IEnumComponentTypes; - interface IComponentTypes; - interface IComponentType; - interface ILanguageComponentType; - interface IEnumComponents; - interface IComponents; - interface IComponent; - interface IMPEG2ComponentType; - interface IMPEG2Component; - interface ILocator; - interface IATSCLocator; - interface IDVBSLocator; - interface IDVBTLocator; - - // tuner.idl: - // interface ITuningSpaceContainer : IDispatch - // interface ITuningSpace : IDispatch - // interface ITuneRequest : IDispatch - // interface IComponentType : IDispatch - // interface ILanguageComponentType : IComponentType - // interface IComponentTypes : IDispatch - // interface IComponent : IDispatch - // interface IComponents : IDispatch - // interface ITVTuningSpace : ITuningSpace - // interface IFMRadioTuningSpace : ITuningSpace - // interface IAMRadioTuningSpace : ITuningSpace - // interface IAnalogTVTuningSpace : ITVTuningSpace - // interface IAnalogTVAudioComponent : IComponent - // interface IAnalogTVDataComponent : IComponent - // interface IChannelTuneRequest : ITuneRequest - // interface IDVBComponent : IComponent - // interface IDVBTuneRequest : ITuneRequest - - // DISPIDs for ITuningSpaces interface - // we don't expect to inherit from this interface and consequently there's - // no chance of collision, thus we'll allow midl to auto assign ids for this one - - // DISPIDs for ITuningSpace interface - enum { - DISPID_TUNER_TS_UNIQUENAME = 1, - DISPID_TUNER_TS_FRIENDLYNAME = 2, - DISPID_TUNER_TS_CLSID = 3, - DISPID_TUNER_TS_NETWORKTYPE = 4, - DISPID_TUNER_TS__NETWORKTYPE = 5, - DISPID_TUNER_TS_CREATETUNEREQUEST = 6, - DISPID_TUNER_TS_ENUMCATEGORYGUIDS = 7, - DISPID_TUNER_TS_ENUMDEVICEMONIKERS = 8, - DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES = 9, - DISPID_TUNER_TS_FREQMAP = 10, - DISPID_TUNER_TS_DEFLOCATOR = 11, - DISPID_TUNER_TS_CLONE = 12, - - // DISPIDs for ITuneRequest interface - DISPID_TUNER_TR_TUNINGSPACE = 1, - DISPID_TUNER_TR_COMPONENTS = 2, - DISPID_TUNER_TR_CLONE = 3, - DISPID_TUNER_TR_LOCATOR = 4, - - - // DISPID for IComponentType interface - DISPID_TUNER_CT_CATEGORY = 1, - DISPID_TUNER_CT_MEDIAMAJORTYPE = 2, - DISPID_TUNER_CT__MEDIAMAJORTYPE = 3, - DISPID_TUNER_CT_MEDIASUBTYPE = 4, - DISPID_TUNER_CT__MEDIASUBTYPE = 5, - DISPID_TUNER_CT_MEDIAFORMATTYPE = 6, - DISPID_TUNER_CT__MEDIAFORMATTYPE = 7, - DISPID_TUNER_CT_MEDIATYPE = 8, - DISPID_TUNER_CT_CLONE = 9, - - - // DISPID for ILanguageComponentType interface - DISPID_TUNER_LCT_LANGID = 100, - - // DISPID for IMPEG2ComponentType interface - DISPID_TUNER_MP2CT_TYPE = 200, - - // DISPID for IATSCComponentType interface - DISPID_TUNER_ATSCCT_FLAGS = 300, - - // DISPID for ILocator interface - DISPID_TUNER_L_CARRFREQ = 1, - DISPID_TUNER_L_INNERFECMETHOD = 2, - DISPID_TUNER_L_INNERFECRATE = 3, - DISPID_TUNER_L_OUTERFECMETHOD = 4, - DISPID_TUNER_L_OUTERFECRATE = 5, - DISPID_TUNER_L_MOD = 6, - DISPID_TUNER_L_SYMRATE = 7, - DISPID_TUNER_L_CLONE = 8, - - // DISPID for IATSCLocator interface - DISPID_TUNER_L_ATSC_PHYS_CHANNEL = 201, - DISPID_TUNER_L_ATSC_TSID = 202, - - // DISPID for IDVBTLocator interface - DISPID_TUNER_L_DVBT_BANDWIDTH = 301, - DISPID_TUNER_L_DVBT_LPINNERFECMETHOD = 302, - DISPID_TUNER_L_DVBT_LPINNERFECRATE = 303, - DISPID_TUNER_L_DVBT_GUARDINTERVAL = 304, - DISPID_TUNER_L_DVBT_HALPHA = 305, - DISPID_TUNER_L_DVBT_TRANSMISSIONMODE = 306, - DISPID_TUNER_L_DVBT_INUSE = 307, - - // DISPID for IDVBSLocator interface - DISPID_TUNER_L_DVBS_POLARISATION = 401, - DISPID_TUNER_L_DVBS_WEST = 402, - DISPID_TUNER_L_DVBS_ORBITAL = 403, - DISPID_TUNER_L_DVBS_AZIMUTH = 404, - DISPID_TUNER_L_DVBS_ELEVATION = 405, - - // DISPID for IDVBCLocator interface - - // DISPIDs for IComponent interface - DISPID_TUNER_C_TYPE = 1, - DISPID_TUNER_C_STATUS = 2, - DISPID_TUNER_C_LANGID = 3, - DISPID_TUNER_C_DESCRIPTION = 4, - DISPID_TUNER_C_CLONE = 5, - - // DISPIDs for IMPEG2Component interface - DISPID_TUNER_C_MP2_PID = 101, - DISPID_TUNER_C_MP2_PCRPID = 102, - DISPID_TUNER_C_MP2_PROGNO = 103, - - // DISPIDs for IDVBTuningSpace interface - DISPID_TUNER_TS_DVB_SYSTEMTYPE = 101, - - // DISPIDs for IAnalogRadioTuningSpace interface - DISPID_TUNER_TS_AR_MINFREQUENCY = 101, - DISPID_TUNER_TS_AR_MAXFREQUENCY = 102, - DISPID_TUNER_TS_AR_STEP = 103, - - // DISPIDs for IAnalogTVTuningSpace interface - DISPID_TUNER_TS_ATV_MINCHANNEL = 101, - DISPID_TUNER_TS_ATV_MAXCHANNEL = 102, - DISPID_TUNER_TS_ATV_INPUTTYPE = 103, - DISPID_TUNER_TS_ATV_COUNTRYCODE = 104, - - // DISPIDs for IATSCTuningSpace interface - DISPID_TUNER_TS_ATSC_MINMINORCHANNEL = 201, - DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL = 202, - DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL = 203, - DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL = 204, - - // DISPID for IAnalogTVAudioComponent interface - DISPID_CHTUNER_ATVAC_CHANNEL = 101, - - // DISPIDs for IAnalogTVDataComponent interface - DISPID_CHTUNER_ATVDC_SYSTEM = 101, - DISPID_CHTUNER_ATVDC_CONTENT = 102, - - // DISPID for IChannelTuneRequest interface - DISPID_CHTUNER_CTR_CHANNEL = 101, - - // DISPID IATSCChannelTuneRequest - DISPID_CHTUNER_ACTR_MINOR_CHANNEL = 201, - - // DISPIDs for IDVBComponent interface - DISPID_DVBTUNER_DVBC_ATTRIBUTESVALID = 101, - DISPID_DVBTUNER_DVBC_PID = 102, - DISPID_DVBTUNER_DVBC_TAG = 103, - DISPID_DVBTUNER_DVBC_COMPONENTTYPE = 104, - - // DISPIDs for IDVBTuneRequest interface - DISPID_DVBTUNER_ONID = 101, - DISPID_DVBTUNER_TSID = 102, - DISPID_DVBTUNER_SID = 103, - - }; - - - ////////////////////////////////////////////////////////////////////////////////////// - // Tuning Space Container - ////////////////////////////////////////////////////////////////////////////////////// - // simple read-only collection of tuning spaces for enumerating subsets of the total - // set of system tuning spaces - [ - object, - uuid(901284E4-33FE-4b69-8D63-634A596F3756), - dual, - oleautomation, - nonextensible, - helpstring("Tuning Space Collection Interface"), - pointer_default(unique) - ] - interface ITuningSpaces : IDispatch - { - - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT** NewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Find the Tuning Space with the specified Index")] - HRESULT Item( - [in] VARIANT varIndex, - [out, retval] ITuningSpace** TuningSpace - ); - - [propget, hidden, restricted, - helpstring("convenience function so C++ apps don't have to unpack VARIANT")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces** NewEnum - ); - - } - - ////////////////////////////////////////////////////////////////////////////////////// - // Tuning Space Container - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - uuid(5B692E84-E2F1-11d2-9493-00C04F72D980), - dual, - oleautomation, - hidden, - nonextensible, - helpstring("Tuning Space Container Interface"), - pointer_default(unique) - ] - interface ITuningSpaceContainer : IDispatch - { - - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT** NewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Find the Tuning Space with the specified Index")] - HRESULT Item( - [in] VARIANT varIndex, - [out, retval] ITuningSpace** TuningSpace - ); - [id(DISPID_VALUE), - propput, - helpstring("Change the Tuning Space with the specified Index")] - HRESULT Item([in] VARIANT varIndex, [in] ITuningSpace *TuningSpace); - - [helpstring("Returns the collection of Tuning Spaces with the same implementation")] - HRESULT TuningSpacesForCLSID( - [in] BSTR SpaceCLSID, - [out, retval] ITuningSpaces** NewColl - ); - - [hidden, restricted, - helpstring("Convenience Function for enumerating from C")] - HRESULT _TuningSpacesForCLSID( - [in] REFCLSID SpaceCLSID, - [out, retval] ITuningSpaces** NewColl - ); - - [helpstring("Returns the collection of Tuning Spaces matching the name")] - HRESULT TuningSpacesForName( - [in] BSTR Name, - [out, retval] ITuningSpaces** NewColl - ); - - [helpstring("Find Local ID Number of the specified Tuning Space")] - HRESULT FindID( - [in] ITuningSpace *TuningSpace, - [out, retval] long *ID - ); - - - [id(DISPID_ADDITEM), - helpstring("Add a new Tuning Space to the collection. This tuning space will be persisted unless removed")] - HRESULT Add( - [in] ITuningSpace* TuningSpace, - [out, retval] VARIANT* NewIndex - ); - - [propget, hidden, restricted, helpstring("Convenience Function for enumerating collection from C")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces **ppEnum - ); - - [id(DISPID_REMOVEITEM), - helpstring("Remove a Tuning Space from the collection. this tuning space will be deleted from the registry")] - HRESULT Remove( - [in] VARIANT Index - ); - - [propget, helpstring("Maximum number of items allowed in the collection")] - HRESULT MaxCount( - [out, retval] long *MaxCount - ); - - // we don't allow script to set this, but we do allow c code to change it. - [propput, hidden, restricted, helpstring("Maximum number of items allowed in the collection")] - HRESULT MaxCount( - [in] long MaxCount - ); - - } - - ////////////////////////////////////////////////////////////////////////////////////// - // Tuning Space Interfaces - ////////////////////////////////////////////////////////////////////////////////////// - - // note: the network type is the clsid of the tuning space implementation - [ - object, - uuid(061C6E30-E622-11d2-9493-00C04F72D980), - dual, - oleautomation, - nonextensible, - helpstring("Tuning Space Interface"), - pointer_default(unique) - ] - interface ITuningSpace : IDispatch - { - [propget, id(DISPID_TUNER_TS_UNIQUENAME), - helpstring("Unique name of the Tuning Space")] - HRESULT UniqueName( - [out, retval] BSTR *Name - ); - - [propput, id(DISPID_TUNER_TS_UNIQUENAME), - helpstring("Unique name of the Tuning Space")] - HRESULT UniqueName( - [in] BSTR Name - ); - - [propget, id(DISPID_TUNER_TS_FRIENDLYNAME), - helpstring("User-friendly name of the Tuning Space")] - HRESULT FriendlyName( - [out, retval] BSTR *Name - ); - - [propput, id(DISPID_TUNER_TS_FRIENDLYNAME), - helpstring("User-friendly name of the Tuning Space")] - HRESULT FriendlyName( - [in] BSTR Name - ); - - [propget, id(DISPID_TUNER_TS_CLSID), - helpstring("Returns the clsid of the tuning space implementation. provides script access to IPersist:GetClassID")] - HRESULT CLSID( - [out, retval] BSTR* SpaceCLSID - ); - - [propget, id(DISPID_TUNER_TS_NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)")] - HRESULT NetworkType( - [out, retval] BSTR *NetworkTypeGuid - ); - [propput, id(DISPID_TUNER_TS_NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)")] - HRESULT NetworkType( - [in] BSTR NetworkTypeGuid - ); - - [propget, id(DISPID_TUNER_TS__NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)"), hidden, restricted] - HRESULT _NetworkType( - [out, retval] GUID* NetworkTypeGuid - ); - [propput, id(DISPID_TUNER_TS__NETWORKTYPE), - helpstring("Network Type (Network Proivder CLSID)"), hidden, restricted] - HRESULT _NetworkType( - [in] REFCLSID NetworkTypeGuid - ); - - [id(DISPID_TUNER_TS_CREATETUNEREQUEST), - helpstring("Create a Tune Request object")] - HRESULT CreateTuneRequest( - [out, retval] ITuneRequest **TuneRequest - ); - - [id(DISPID_TUNER_TS_ENUMCATEGORYGUIDS), hidden, restricted] - HRESULT EnumCategoryGUIDs( - [out, retval] IEnumGUID **ppEnum - ); - - [id(DISPID_TUNER_TS_ENUMDEVICEMONIKERS), hidden, restricted] - HRESULT EnumDeviceMonikers( - [out, retval] IEnumMoniker **ppEnum - ); - - [propget, id(DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES)] - HRESULT DefaultPreferredComponentTypes( - [out, retval] IComponentTypes** ComponentTypes - ); - [propput, id(DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES)] - HRESULT DefaultPreferredComponentTypes( - [in] IComponentTypes* NewComponentTypes - ); - - // the following property is for the network providers to store frequency/channel maps, frequency/transponder maps - // or whatever other mapping from carrier frequencies to frequency identifiers are appropriate for the tuning space - // in question. the bstr is treated as a binary blob. it is expected to contain embedded nulls, and it may be formatted - // internally in whatever fashion the network provider sees fit. - [propget, id(DISPID_TUNER_TS_FREQMAP), hidden, restricted] - HRESULT FrequencyMapping([out, retval] BSTR *pMapping); - [propput, id(DISPID_TUNER_TS_FREQMAP), hidden, restricted] - HRESULT FrequencyMapping(BSTR Mapping); - - // the following property provides a starting point for the initial IScanningTuner after installation - [propget, id(DISPID_TUNER_TS_DEFLOCATOR)] - HRESULT DefaultLocator([out, retval] ILocator **LocatorVal); - [propput, id(DISPID_TUNER_TS_DEFLOCATOR)] - HRESULT DefaultLocator([in]ILocator *LocatorVal); - - HRESULT Clone([out, retval] ITuningSpace **NewTS); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, - restricted, - object, - uuid(8B8EB248-FC2B-11d2-9D8C-00C04F72D980), - pointer_default(unique) - ] - interface IEnumTuningSpaces : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - ITuningSpace** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumTuningSpaces** ppEnum - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(ADA0B268-3B19-4e5b-ACC4-49F852BE13BA), - pointer_default(unique) - ] - interface IDVBTuningSpace : ITuningSpace - { - [propget, id(DISPID_TUNER_TS_DVB_SYSTEMTYPE), - helpstring("Type of DVB System") - ] - HRESULT SystemType( - [out, retval] DVBSystemType *SysType - ); - [propput, id(DISPID_TUNER_TS_DVB_SYSTEMTYPE), - helpstring("Type of DVB System") - ] - HRESULT SystemType( - [in] DVBSystemType SysType - ); - - } - - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2A6E293C-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IAnalogTVTuningSpace : ITuningSpace - { - [propget, id(DISPID_TUNER_TS_ATV_MINCHANNEL), - helpstring("Smallest channel number ever provided by this tuning space") - ] - HRESULT MinChannel( - [out, retval] long *MinChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATV_MINCHANNEL), - helpstring("Smallest channel number ever provided by this tuning space") - ] - HRESULT MinChannel( - [in] long NewMinChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATV_MAXCHANNEL), - helpstring("Largest channel number ever provided by this tuning space") - ] - HRESULT MaxChannel( - [out, retval] long *MaxChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATV_MAXCHANNEL), - helpstring("Largest channel number ever provided by this tuning space") - ] - HRESULT MaxChannel( - [in] long NewMaxChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATV_INPUTTYPE), - helpstring("Input type for this tuning space") - ] - HRESULT InputType([out, retval] TunerInputType *InputTypeVal); - [propput, id(DISPID_TUNER_TS_ATV_INPUTTYPE), - helpstring("Input type for this tuning space") - ] - HRESULT InputType([in] TunerInputType NewInputTypeVal); - [propget, id(DISPID_TUNER_TS_ATV_COUNTRYCODE), - helpstring("International dialing prefix for country of physical broadcast source") - ] - HRESULT CountryCode([out, retval] long *CountryCodeVal); - [propput, id(DISPID_TUNER_TS_ATV_COUNTRYCODE), - helpstring("International dialing prefix for country of physical broadcast source") - ] - HRESULT CountryCode([in] long NewCountryCodeVal); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(0369B4E2-45B6-11d3-B650-00C04F79498E), - pointer_default(unique) - ] - // note: we inherit ATSC from analog because we need the same properties. - // - the definition of channel is overloaded to be the major channel, - // - input type allows us to distinguish between broadcast and cable frequencies - // which allows us to use the atsc tuning space class for "open cable". - // - country code will allow us to redefine physical channel frequencies - // if any other countries adopt ATSC which may happen in Latin America in particular. - interface IATSCTuningSpace : IAnalogTVTuningSpace - { - [propget, id(DISPID_TUNER_TS_ATSC_MINMINORCHANNEL), - helpstring("Smallest minor channel number ever provided by this tuning space") - ] - HRESULT MinMinorChannel( - [out, retval] long *MinMinorChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MINMINORCHANNEL), - helpstring("Smallest minor channel number ever provided by this tuning space") - ] - HRESULT MinMinorChannel( - [in] long NewMinMinorChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL), - helpstring("Largest minor channel number ever provided by this tuning space") - ] - HRESULT MaxMinorChannel( - [out, retval] long *MaxMinorChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL), - helpstring("Largest minor channel number ever provided by this tuning space") - ] - HRESULT MaxMinorChannel( - [in] long NewMaxMinorChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL), - helpstring("Smallest physical channel number ever provided by this tuning space") - ] - HRESULT MinPhysicalChannel( - [out, retval] long *MinPhysicalChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL), - helpstring("Smallest physical channel number ever provided by this tuning space") - ] - HRESULT MinPhysicalChannel( - [in] long NewMinPhysicalChannelVal - ); - [propget, id(DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL), - helpstring("Largest physical channel number ever provided by this tuning space") - ] - HRESULT MaxPhysicalChannel( - [out, retval] long *MaxPhysicalChannelVal - ); - [propput, id(DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL), - helpstring("Largest physical channel number ever provided by this tuning space") - ] - HRESULT MaxPhysicalChannel( - [in] long NewMaxPhysicalChannelVal - ); - - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2A6E293B-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IAnalogRadioTuningSpace : ITuningSpace { - [propget, id(DISPID_TUNER_TS_AR_MINFREQUENCY), - helpstring("Smallest frequency(khz) ever used by this tuning space") - ] - HRESULT MinFrequency( - [out, retval] long *MinFrequencyVal - ); - [propput, id(DISPID_TUNER_TS_AR_MINFREQUENCY), - helpstring("Smallest frequency(khz) ever used by this tuning space") - ] - HRESULT MinFrequency( - [in] long NewMinFrequencyVal - ); - [propget, id(DISPID_TUNER_TS_AR_MAXFREQUENCY), - helpstring("Largest frequency(khz) ever used by this tuning space") - ] - HRESULT MaxFrequency( - [out, retval] long *MaxFrequencyVal - ); - [propput, id(DISPID_TUNER_TS_AR_MAXFREQUENCY), - helpstring("Largest frequency(khz) ever used by this tuning space") - ] - HRESULT MaxFrequency( - [in] long NewMaxFrequencyVal - ); - [propget, id(DISPID_TUNER_TS_AR_STEP), - helpstring("Default step value(khz) to next frequency for this tuning space") - ] - HRESULT Step( - [out, retval] long *StepVal - ); - [propput, id(DISPID_TUNER_TS_AR_STEP), - helpstring("Default step value(khz) to next frequency for this tuning space") - ] - HRESULT Step( - [in] long NewStepVal - ); - } - - - ////////////////////////////////////////////////////////////////////////////////////// - // Tune Request Interfaces - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(07DDC146-FC3D-11d2-9D8C-00C04F72D980), - dual, - oleautomation, - helpstring("Tune Request Interface"), - pointer_default(unique) - ] - interface ITuneRequest : IDispatch - { - [propget, id(DISPID_TUNER_TR_TUNINGSPACE), - helpstring("Tuning Space object")] - HRESULT TuningSpace( - [out, retval] ITuningSpace **TuningSpace - ); - [propget, id(DISPID_TUNER_TR_COMPONENTS), - helpstring("Components collection")] - HRESULT Components( - [out, retval] IComponents **Components - ); - [id(DISPID_TUNER_TR_CLONE), - helpstring("Create a new copy of this tune request")] - HRESULT Clone( - [out, retval] ITuneRequest **NewTuneRequest - ); - [propget, id(DISPID_TUNER_TR_LOCATOR), - helpstring("Locator Object")] - HRESULT Locator( - [out, retval] ILocator **Locator - ); - [propput, id(DISPID_TUNER_TR_LOCATOR), - helpstring("Locator Object")] - HRESULT Locator( - [in] ILocator *Locator - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0369B4E0-45B6-11d3-B650-00C04F79498E), - dual, - oleautomation, - helpstring("Channel Tune Request Interface"), - pointer_default(unique) - ] - interface IChannelTuneRequest : ITuneRequest - { - [propget, id(DISPID_CHTUNER_CTR_CHANNEL), - helpstring("Channel")] - HRESULT Channel( - [out, retval] long *Channel - ); - [propput, id(DISPID_CHTUNER_CTR_CHANNEL), - helpstring("Channel")] - HRESULT Channel( - [in] long Channel - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0369B4E1-45B6-11d3-B650-00C04F79498E), - dual, - oleautomation, - helpstring("ATSC Channel Tune Request Interface"), - pointer_default(unique) - ] - interface IATSCChannelTuneRequest : IChannelTuneRequest - { - [propget, id(DISPID_CHTUNER_ACTR_MINOR_CHANNEL), - helpstring("Minor Channel")] - HRESULT MinorChannel( - [out, retval] long *MinorChannel - ); - [propput, id(DISPID_CHTUNER_ACTR_MINOR_CHANNEL), - helpstring("Minor Channel")] - HRESULT MinorChannel( - [in] long MinorChannel - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(0D6F567E-A636-42bb-83BA-CE4C1704AFA2), - dual, - oleautomation, - helpstring("DVB Tune Request Interface"), - pointer_default(unique) - ] - interface IDVBTuneRequest : ITuneRequest - { - [propget, id(DISPID_DVBTUNER_ONID), - helpstring("Original Network ID")] - HRESULT ONID( - [out, retval] long *ONID - ); - [propput, id(DISPID_DVBTUNER_ONID), - helpstring("Original Network ID")] - HRESULT ONID( - [in] long ONID - ); - [propget, id(DISPID_DVBTUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [out, retval] long *TSID - ); - [propput, id(DISPID_DVBTUNER_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [in] long TSID - ); - [propget, id(DISPID_DVBTUNER_SID), - helpstring("Service ID")] - HRESULT SID( - [out, retval] long *SID - ); - [propput, id(DISPID_DVBTUNER_SID), - helpstring("Service ID")] - HRESULT SID( - [in] long SID - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - // Tuner Interfaces - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(28C52640-018A-11d3-9D8E-00C04F72D980), - helpstring("Tuner Interface"), - pointer_default(unique) - ] - interface ITuner : IUnknown - { - [propget, helpstring("Tuning Space object")] - HRESULT TuningSpace( - [out, retval] ITuningSpace **TuningSpace - ); - - [propput, helpstring("Tuning Space object")] - HRESULT TuningSpace( - [in] ITuningSpace *TuningSpace - ); - - [hidden, restricted, helpstring("Returns an enumerator for Tuning Spaces accepted by this tuner")] - HRESULT EnumTuningSpaces( - [out, retval] IEnumTuningSpaces **ppEnum - ); - - [propget, helpstring("Tune Request object")] - HRESULT TuneRequest( - [out, retval] ITuneRequest **TuneRequest - ); - - [propput, helpstring("Tune Request object")] - HRESULT TuneRequest( - [in] ITuneRequest *TuneRequest - ); - - [helpstring("Validate the tuning request without tuning")] - HRESULT Validate( - [in] ITuneRequest *TuneRequest - ); - - [propget, helpstring("Preferred Component Types collection")] - HRESULT PreferredComponentTypes( - [out, retval] IComponentTypes **ComponentTypes - ); - - [propput, helpstring("Preferred Component Types collection")] - HRESULT PreferredComponentTypes( - [in] IComponentTypes *ComponentTypes - ); - - [propget, helpstring("Signal Strength")] - HRESULT SignalStrength( - [out, retval] long *Strength - ); - - [helpstring("Trigger Signal events (interval in milliseconds; 0 turns off trigger)")] - HRESULT TriggerSignalEvents( - [in] long Interval - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(1DFD0A5C-0284-11d3-9D8E-00C04F72D980), - helpstring("Scanning Tuner Interface"), - pointer_default(unique) - ] - interface IScanningTuner : ITuner - { - [helpstring("Seek to the next valid selection")] - HRESULT SeekUp( - ); - - [helpstring("Seek to the previous valid selection")] - HRESULT SeekDown( - ); - - [helpstring("Scan for valid selections upward")] - HRESULT ScanUp( - [in] long MillisecondsPause - ); - - [helpstring("Scan for valid selections downward")] - HRESULT ScanDown( - [in] long MillisecondsPause - ); - - [helpstring("Enter the device's autoprogram mode")] - HRESULT AutoProgram( - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(68481420-0280-11d3-9D8E-00C04F72D980), - helpstring("Tuner Events Interface"), - pointer_default(unique) - ] - interface ITunerEvents : IUnknown - { - [helpstring("Reports a completed (or failed) tune operation")] - HRESULT OnTune( - [in] ITuneRequest **Request, - [in] long *Strength - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(85E2439E-0E23-11d3-9D8E-00C04F72D980), - helpstring("Signal Events Interface"), - pointer_default(unique) - ] - interface ISignalEvents : IUnknown - { - [helpstring("Reports the signal strength")] - HRESULT OnSignal( - [out] long *Strength - ); - } - - ////////////////////////////////////////////////////////////////////////////////////// - // Component Type Interfaces - ////////////////////////////////////////////////////////////////////////////////////// - - // Component Category - - [ - object, - hidden, - nonextensible, - uuid(6A340DC0-0311-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Type Interface"), - pointer_default(unique) - ] - interface IComponentType : IDispatch - { - [propget, id(DISPID_TUNER_CT_CATEGORY), - helpstring("General category of component")] - HRESULT Category( - [out, retval] ComponentCategory *Category - ); - [propput, id(DISPID_TUNER_CT_CATEGORY), - helpstring("General category of component")] - HRESULT Category( - [in] ComponentCategory Category - ); - - [propget, id(DISPID_TUNER_CT_MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid")] - HRESULT MediaMajorType( - [out, retval] BSTR *MediaMajorType - ); - [propput, id(DISPID_TUNER_CT_MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid")] - HRESULT MediaMajorType( - [in] BSTR MediaMajorType - ); - [propget, id(DISPID_TUNER_CT__MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid"), hidden, restricted] - HRESULT _MediaMajorType( - [out, retval] GUID* MediaMajorTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIAMAJORTYPE), - helpstring("DirectShow MediaType Major Type Guid"), hidden, restricted] - HRESULT _MediaMajorType( - [in] REFCLSID MediaMajorTypeGuid - ); - [propget, id(DISPID_TUNER_CT_MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid")] - HRESULT MediaSubType( - [out, retval] BSTR *MediaSubType - ); - [propput, id(DISPID_TUNER_CT_MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid")] - HRESULT MediaSubType( - [in] BSTR MediaSubType - ); - [propget, id(DISPID_TUNER_CT__MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid"), hidden, restricted] - HRESULT _MediaSubType( - [out, retval] GUID* MediaSubTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIASUBTYPE), - helpstring("DirectShow MediaType Sub Type Guid"), hidden, restricted] - HRESULT _MediaSubType( - [in] REFCLSID MediaSubTypeGuid - ); - [propget, id(DISPID_TUNER_CT_MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid")] - HRESULT MediaFormatType( - [out, retval] BSTR *MediaFormatType - ); - [propput, id(DISPID_TUNER_CT_MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid")] - HRESULT MediaFormatType( - [in] BSTR MediaFormatType - ); - [propget, id(DISPID_TUNER_CT__MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid"), hidden, restricted] - HRESULT _MediaFormatType( - [out, retval] GUID* MediaFormatTypeGuid - ); - [propput, id(DISPID_TUNER_CT__MEDIAFORMATTYPE), - helpstring("DirectShow MediaType Format Guid"), hidden, restricted] - HRESULT _MediaFormatType( - [in] REFCLSID MediaFormatTypeGuid - ); - - [propget, id(DISPID_TUNER_CT_MEDIATYPE), hidden, restricted, - helpstring("DirectShow MediaType Guid, this only retrieves major, sub, format guids not the entire struct")] - HRESULT MediaType( - [out, retval] AM_MEDIA_TYPE *MediaType - ); - [propput, id(DISPID_TUNER_CT_MEDIATYPE), hidden, restricted, - helpstring("DirectShow MediaType Guid, this only retrieves major, sub, format guids not the entire struct")] - HRESULT MediaType( - [in] AM_MEDIA_TYPE *MediaType - ); - - [id(DISPID_TUNER_CT_CLONE), - helpstring("Create a copy of this component type")] - HRESULT Clone( - [out, retval] IComponentType **NewCT - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(B874C8BA-0FA2-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Language Component Type Interface"), - pointer_default(unique) - ] - interface ILanguageComponentType : IComponentType - { - [propget, id(DISPID_TUNER_LCT_LANGID), - helpstring("Language Identifier for Substream Content Language")] - HRESULT LangID( - [out, retval] long *LangID - ); - - [propput, id(DISPID_TUNER_LCT_LANGID), - helpstring("Language Identifier for Substream Content Language")] - HRESULT LangID( - [in] long LangID - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(2C073D84-B51C-48c9-AA9F-68971E1F6E38), - dual, - oleautomation, - helpstring("MPEG2 Component Type Interface"), - pointer_default(unique) - ] - interface IMPEG2ComponentType : ILanguageComponentType - { - [propget, id(DISPID_TUNER_MP2CT_TYPE), - helpstring("MPEG2 Stream Type")] - HRESULT StreamType( - [out, retval] MPEG2StreamType *MP2StreamType - ); - - [propput, id(DISPID_TUNER_MP2CT_TYPE), - helpstring("MPEG2 Stream Type")] - HRESULT StreamType( - [in] MPEG2StreamType MP2StreamType - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(FC189E4D-7BD4-4125-B3B3-3A76A332CC96), - dual, - oleautomation, - helpstring("ATSC Component Type Interface"), - pointer_default(unique) - ] - interface IATSCComponentType : IMPEG2ComponentType - { - [propget, id(DISPID_TUNER_ATSCCT_FLAGS), - helpstring("ATSC Component Type Flags")] - HRESULT Flags( - [out, retval] long *Flags - ); - - [propput, id(DISPID_TUNER_ATSCCT_FLAGS), - helpstring("ATSC Component Type Flags")] - HRESULT Flags( - [in] long flags - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - object, - uuid(8A674B4A-1F63-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IEnumComponentTypes : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - IComponentType** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumComponentTypes** ppEnum - ); - } - - - ////////////////////////////////////////////////////////////////////////////////////// - // Component Type Container - ////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(0DC13D4A-0313-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("ComponentType Collection Interface"), - pointer_default(unique) - ] - interface IComponentTypes : IDispatch - { - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT **ppNewEnum - ); - - [hidden, restricted, helpstring("Convenience Function for Use with C")] - HRESULT EnumComponentTypes( - [out, retval] IEnumComponentTypes **ppNewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Get the ComponentType at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [out, retval] IComponentType **ComponentType - ); - - [id(DISPID_VALUE), - propput, - helpstring("Get the ComponentType at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [in] IComponentType *ComponentType - ); - - [id(DISPID_ADDITEM), - helpstring("Append the ComponentType to the collection")] - HRESULT Add( - [in] IComponentType *ComponentType, - [out, retval] VARIANT *NewIndex - ); - - [id(DISPID_REMOVEITEM), - helpstring("Clear the collection")] - HRESULT Remove( - [in] VARIANT Index - ); - - [helpstring("Copy the collection")] - HRESULT Clone([out, retval] IComponentTypes **NewList); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - // Component Interfaces - ////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - nonextensible, - uuid(1A5576FC-0E19-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Interface"), - pointer_default(unique) - ] - interface IComponent : IDispatch - { - [propget, id(DISPID_TUNER_C_TYPE), - helpstring("Component Type")] - HRESULT Type( - [out, retval] IComponentType** CT - ); - - // only loaders initialize components - [hidden, restricted, propput, id(DISPID_TUNER_C_TYPE), - helpstring("Component Type")] - HRESULT Type( - [in] IComponentType* CT - ); - - // NOTE: this langid is *not* the same as the langid - // in the componenttype(if the componenttype is a languagecomponenttype) - // the langid in the component type is the language of the content this - // component is describing. the following langid in the component is the - // language of the descriptive info in the component object. - [propget, id(DISPID_TUNER_C_LANGID), - helpstring("Language Identifier for Description Language")] - HRESULT DescLangID( - [out, retval] long *LangID - ); - - [propput, id(DISPID_TUNER_C_LANGID), - helpstring("Language Identifier for Description Language")] - HRESULT DescLangID( - [in] long LangID - ); - - [propget, id(DISPID_TUNER_C_STATUS), - helpstring("Component Status")] - HRESULT Status( - [out, retval] ComponentStatus *Status - ); - - [propput, id(DISPID_TUNER_C_STATUS), - helpstring("Component Status")] - HRESULT Status( - [in] ComponentStatus Status - ); - - [propget, id(DISPID_TUNER_C_DESCRIPTION), - helpstring("Component Description")] - HRESULT Description( - [out, retval] BSTR *Description - ); - - // restricted: only loaders will initialize components - [hidden, restricted, propput, id(DISPID_TUNER_C_DESCRIPTION), - helpstring("Component Description")] - HRESULT Description( - [in] BSTR Description - ); - - [id(DISPID_TUNER_C_CLONE), - helpstring("Copy Component")] - HRESULT Clone( - [out, retval] IComponent **NewComponent - ); - - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - nonextensible, - uuid(1493E353-1EB6-473c-802D-8E6B8EC9D2A9), - dual, - oleautomation, - helpstring("MPEG2 Component Interface"), - pointer_default(unique) - ] - interface IMPEG2Component : IComponent - { - [propget, id(DISPID_TUNER_C_MP2_PID), - helpstring("MPEG2 Packet ID for this Substream")] - HRESULT PID( - [out, retval] long *PID - ); - - [propput, id(DISPID_TUNER_C_MP2_PID), - helpstring("MPEG2 Packet ID for this Substream")] - HRESULT PID( - [in] long PID - ); - [propget, id(DISPID_TUNER_C_MP2_PCRPID), - helpstring("MPEG2 Packet ID for this Substream's Timestamps")] - HRESULT PCRPID( - [out, retval] long *PCRPID - ); - - [propput, id(DISPID_TUNER_C_MP2_PCRPID), - helpstring("MPEG2 Packet ID for this Substream's Timestamps")] - HRESULT PCRPID( - [in] long PCRPID - ); - - // program number provides reverse lookup to PAT - [propget, id(DISPID_TUNER_C_MP2_PROGNO), - helpstring("MPEG2 Program Number")] - HRESULT ProgramNumber( - [out, retval] long *ProgramNumber - ); - - [propput, id(DISPID_TUNER_C_MP2_PROGNO), - helpstring("MPEG2 Program Number")] - HRESULT ProgramNumber( - [in] long ProgramNumber - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - object, - uuid(2A6E2939-2595-11d3-B64C-00C04F79498E), - pointer_default(unique) - ] - interface IEnumComponents : IUnknown - { - HRESULT Next( - [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] - IComponent** rgelt, - [out] ULONG* pceltFetched - ); - - HRESULT Skip( - [in] ULONG celt - ); - - HRESULT Reset(void); - - HRESULT Clone( - [out] IEnumComponents** ppEnum - ); - } - - - ////////////////////////////////////////////////////////////////////////////////////// - // Component Container - ////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - nonextensible, - uuid(FCD01846-0E19-11d3-9D8E-00C04F72D980), - dual, - oleautomation, - helpstring("Component Collection Interface"), - pointer_default(unique) - ] - interface IComponents : IDispatch - { - [propget, helpstring("Number of items in the collection")] - HRESULT Count( - [out, retval] long *Count - ); - - [propget, id(DISPID_NEWENUM), hidden, restricted] - HRESULT _NewEnum( - [out, retval] IEnumVARIANT **ppNewEnum - ); - - [hidden, restricted, helpstring("Convenience Function for Use with C")] - HRESULT EnumComponents( - [out, retval] IEnumComponents **ppNewEnum - ); - - [id(DISPID_VALUE), - propget, - helpstring("Get the Component at the specified index")] - HRESULT Item( - [in] VARIANT Index, - [out, retval] IComponent **ppComponent - ); - - [id(DISPID_ADDITEM), - helpstring("Add the Component to the collection")] - HRESULT Add( - [in] IComponent *Component, - [out, retval] VARIANT *NewIndex - ); - - [id(DISPID_REMOVEITEM), - helpstring("Remove the Component at the specified index")] - HRESULT Remove( - [in] VARIANT Index - ); - - [helpstring("Copy the collection")] - HRESULT Clone([out, retval] IComponents **NewList); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - // Component Container - ////////////////////////////////////////////////////////////////////////////////////// - // this separates the what(general tune request properties) from the where - - - - [ - object, - nonextensible, - uuid(286D7F89-760C-4F89-80C4-66841D2507AA), - dual, - oleautomation, - helpstring("Generic Locator Information"), - pointer_default(unique) - ] - interface ILocator : IDispatch - { - - [propget, id(DISPID_TUNER_L_CARRFREQ), helpstring("Carrier Frequency(DecaHertz)")] - HRESULT CarrierFrequency( - [out, retval] long* Frequency - ); - [propput, id(DISPID_TUNER_L_CARRFREQ), helpstring("Carrier Frequency(DecaHertz)")] - HRESULT CarrierFrequency( - [in] long Frequency - ); - [propget, id(DISPID_TUNER_L_INNERFECMETHOD), helpstring("Inner Fec Type")] - HRESULT InnerFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_INNERFECMETHOD), helpstring("Inner Fec Type")] - HRESULT InnerFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_INNERFECRATE), helpstring("Inner Fec Rate")] - HRESULT InnerFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_INNERFECRATE), helpstring("Inner Fec Rate")] - HRESULT InnerFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_OUTERFECMETHOD), helpstring("Outer Fec Type")] - HRESULT OuterFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_OUTERFECMETHOD), helpstring("Outer Fec Type")] - HRESULT OuterFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_OUTERFECRATE), helpstring("Outer Fec Rate")] - HRESULT OuterFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_OUTERFECRATE), helpstring("Outer Fec Rate")] - HRESULT OuterFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_MOD), helpstring("Modulation Type")] - HRESULT Modulation( - [out, retval] ModulationType* Modulation - ); - [propput, id(DISPID_TUNER_L_MOD), helpstring("Modulation Type")] - HRESULT Modulation( - [in] ModulationType Modulation - ); - [propget, id(DISPID_TUNER_L_SYMRATE), helpstring("Modulation Symbol Rate")] - HRESULT SymbolRate( - [out, retval] long* Rate - ); - [propput, id(DISPID_TUNER_L_SYMRATE), helpstring("Modulation Symbol Rate")] - HRESULT SymbolRate( - [in] long Rate - ); - [id(DISPID_TUNER_L_CLONE), helpstring("Copy the Locator")] - HRESULT Clone([out, retval] ILocator **NewLocator); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(BF8D986F-8C2B-4131-94D7-4D3D9FCC21EF), - dual, - oleautomation, - helpstring("ATSC Locator Information"), - pointer_default(unique) - ] - interface IATSCLocator : ILocator - { - [propget, id(DISPID_TUNER_L_ATSC_PHYS_CHANNEL), - helpstring("Physical Channel")] - HRESULT PhysicalChannel( - [out, retval] long *PhysicalChannel - ); - [propput, id(DISPID_TUNER_L_ATSC_PHYS_CHANNEL), - helpstring("Physical Channel")] - HRESULT PhysicalChannel( - [in] long PhysicalChannel - ); - [propget, id(DISPID_TUNER_L_ATSC_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [out, retval] long *TSID - ); - [propput, id(DISPID_TUNER_L_ATSC_TSID), - helpstring("Transport Stream ID")] - HRESULT TSID( - [in] long TSID - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - - [ - object, - hidden, - nonextensible, - uuid(8664DA16-DDA2-42ac-926A-C18F9127C302), - dual, - oleautomation, - helpstring("DVB Terrestrial Locator Information"), - pointer_default(unique) - ] - interface IDVBTLocator : ILocator - { - [propget, id(DISPID_TUNER_L_DVBT_BANDWIDTH), helpstring("Bandwidth")] - HRESULT Bandwidth( - [out, retval] long* BandWidthVal - ); - [propput, id(DISPID_TUNER_L_DVBT_BANDWIDTH), helpstring("Bandwidth")] - HRESULT Bandwidth( - [in] long BandwidthVal - ); - - [propget, id(DISPID_TUNER_L_DVBT_LPINNERFECMETHOD), helpstring("Inner Fec Type for Low Priority Stream")] - HRESULT LPInnerFEC( - [out, retval] FECMethod* FEC - ); - [propput, id(DISPID_TUNER_L_DVBT_LPINNERFECMETHOD), helpstring("Inner Fec Type for Low Priority Stream")] - HRESULT LPInnerFEC( - [in] FECMethod FEC - ); - [propget, id(DISPID_TUNER_L_DVBT_LPINNERFECRATE), helpstring("Inner Fec Rate for Low Priority Stream")] - HRESULT LPInnerFECRate( - [out, retval] BinaryConvolutionCodeRate* FEC - ); - [propput, id(DISPID_TUNER_L_DVBT_LPINNERFECRATE), helpstring("Inner Fec Rate for Low Priority Stream")] - HRESULT LPInnerFECRate( - [in] BinaryConvolutionCodeRate FEC - ); - [propget, id(DISPID_TUNER_L_DVBT_HALPHA), helpstring("Hierarchical Alpha")] - HRESULT HAlpha( - [out, retval] HierarchyAlpha* Alpha - ); - [propput, id(DISPID_TUNER_L_DVBT_HALPHA), helpstring("Hierarchical Alpha")] - HRESULT HAlpha( - [in] HierarchyAlpha Alpha - ); - [propget, id(DISPID_TUNER_L_DVBT_GUARDINTERVAL), helpstring("Guard Interval")] - HRESULT Guard( - [out, retval] GuardInterval* GI - ); - [propput, id(DISPID_TUNER_L_DVBT_GUARDINTERVAL), helpstring("Guard Interval")] - HRESULT Guard( - [in] GuardInterval GI - ); - [propget, id(DISPID_TUNER_L_DVBT_TRANSMISSIONMODE), helpstring("Transmission Mode")] - HRESULT Mode( - [out, retval] TransmissionMode* mode - ); - [propput, id(DISPID_TUNER_L_DVBT_TRANSMISSIONMODE), helpstring("Transmission Mode")] - HRESULT Mode( - [in] TransmissionMode mode - ); - [propget, id(DISPID_TUNER_L_DVBT_INUSE), helpstring("Hierarchical Alpha")] - HRESULT OtherFrequencyInUse( - [out, retval] VARIANT_BOOL* OtherFrequencyInUseVal - ); - [propput, id(DISPID_TUNER_L_DVBT_INUSE), helpstring("Hierarchical Alpha")] - HRESULT OtherFrequencyInUse( - [in] VARIANT_BOOL OtherFrequencyInUseVal - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(3D7C353C-0D04-45f1-A742-F97CC1188DC8), - dual, - oleautomation, - helpstring("DVB Satellite Locator Information"), - pointer_default(unique) - ] - interface IDVBSLocator : ILocator - { - - [propget, id(DISPID_TUNER_L_DVBS_POLARISATION), helpstring("Signal Polarisation Type")] - HRESULT SignalPolarisation( - [out, retval] Polarisation* PolarisationVal - ); - [propput, id(DISPID_TUNER_L_DVBS_POLARISATION), helpstring("Signal Polarisation Type")] - HRESULT SignalPolarisation( - [in] Polarisation PolarisationVal - ); - [propget, id(DISPID_TUNER_L_DVBS_WEST), helpstring("VARIANT_TRUE means orbital position specifies west longitude")] - HRESULT WestPosition( - [out, retval] VARIANT_BOOL* WestLongitude - ); - [propput, id(DISPID_TUNER_L_DVBS_WEST), helpstring("VARIANT_TRUE means orbital position specifies west longitude")] - HRESULT WestPosition( - [in] VARIANT_BOOL WestLongitude - ); - [propget, id(DISPID_TUNER_L_DVBS_ORBITAL), helpstring("Longitude in tenths of a degree")] - HRESULT OrbitalPosition( - [out, retval] long* longitude - ); - [propput, id(DISPID_TUNER_L_DVBS_ORBITAL), helpstring("Longitude in tenths of a degree")] - HRESULT OrbitalPosition( - [in] long longitude - ); - [propget, id(DISPID_TUNER_L_DVBS_AZIMUTH), helpstring("Azimuth in tenths of a degree")] - HRESULT Azimuth( - [out, retval] long* Azimuth - ); - [propput, id(DISPID_TUNER_L_DVBS_AZIMUTH), helpstring("Azimuth in tenths of a degree")] - HRESULT Azimuth( - [in] long Azimuth - ); - [propget, id(DISPID_TUNER_L_DVBS_ELEVATION), helpstring("Elevation in tenths of a degree")] - HRESULT Elevation( - [out, retval] long* Elevation - ); - [propput, id(DISPID_TUNER_L_DVBS_ELEVATION), helpstring("Elevation in tenths of a degree")] - HRESULT Elevation( - [in] long Elevation - ); - }; - - ////////////////////////////////////////////////////////////////////////////////////// - [ - object, - hidden, - nonextensible, - uuid(6E42F36E-1DD2-43c4-9F78-69D25AE39034), - dual, - oleautomation, - helpstring("DVB Cable Locator Information"), - pointer_default(unique) - ] - interface IDVBCLocator : ILocator - { - }; - - ////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - // TYPELIB & CoClasses - ////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - [ - uuid(9B085638-018E-11d3-9D8E-00C04F72D980), - version(1.0), - helpstring("Microsoft Tuner 1.0 Type Library") - ] - library TunerLib - { - importlib("stdole2.tlb"); - - // SystemTuningSpaces class - [ - uuid(D02AAC50-027E-11d3-9D8E-00C04F72D980), - helpstring("SystemTuningSpace Class") - ] - coclass SystemTuningSpaces - { - [default] interface ITuningSpaceContainer; - }; - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(5FFDC5E6-B83A-4b55-B6E8-C69E765FE9DB), - helpstring("dummy class to expose base tuning space i/f to VB") - ] - coclass TuningSpace - { - [default] interface ITuningSpace; - }; - - - [ - uuid(A2E30750-6C3D-11d3-B653-00C04F79498E), - helpstring("ATSC Digital Broadcast Tuning Space Class") - ] - coclass ATSCTuningSpace - { - [default] interface IATSCTuningSpace; - }; - - [ - uuid(8A674B4C-1F63-11d3-B64C-00C04F79498E), - helpstring("Analog Radio Tuning Space Class") - ] - coclass AnalogRadioTuningSpace - { - [default] interface IAnalogRadioTuningSpace; - }; - - [ - uuid(8A674B4D-1F63-11d3-B64C-00C04F79498E), - helpstring("Analog TV Tuning Space Class") - ] - coclass AnalogTVTuningSpace - { - [default] interface IAnalogTVTuningSpace; - }; - - [ - uuid(C6B14B32-76AA-4a86-A7AC-5C79AAF58DA7), - helpstring("DVB Tuning Space Class") - ] - coclass DVBTuningSpace - { - [default] interface IDVBTuningSpace; - }; - - - - // ComponentTypes container class - [ - uuid(A1A2B1C4-0E3A-11d3-9D8E-00C04F72D980), - helpstring("Component Types Collection Class") - ] - coclass ComponentTypes - { - [default] interface IComponentTypes; - }; - - // ComponentType class - [ - uuid(823535A0-0318-11d3-9D8E-00C04F72D980), - helpstring("ComponentType Class") - ] - coclass ComponentType - { - [default] interface IComponentType; - }; - - // Language ComponentType class - [ - uuid(1BE49F30-0E1B-11d3-9D8E-00C04F72D980), - helpstring("LanguageComponentType Class") - ] - coclass LanguageComponentType - { - [default] interface ILanguageComponentType; - }; - - // MPEG2 ComponentType class - [ - uuid(418008F3-CF67-4668-9628-10DC52BE1D08), - helpstring("MPEG2ComponentType Class") - ] - coclass MPEG2ComponentType - { - [default] interface IMPEG2ComponentType; - }; - - // ATSC ComponentType class - [ - uuid(A8DCF3D5-0780-4ef4-8A83-2CFFAACB8ACE), - helpstring("ATSCComponentType Class") - ] - coclass ATSCComponentType - { - [default] interface IATSCComponentType; - }; - - // Components class - [ - hidden, restricted, - uuid(809B6661-94C4-49e6-B6EC-3F0F862215AA), - helpstring("Components Collection Class") - ] - coclass Components - { - [default] interface IComponents; - }; - - // Component class - // the components can only be created by network provider/tif. client apps - // retrieve them from a filled-in tune request by either loading a persisted tune - // request that has been filled in by a proper guide store loader or by re-getting - // the current tune request property which will have this filled in by the network - // provider - [ - hidden, restricted, - uuid(59DC47A8-116C-11d3-9D8E-00C04F72D980), - helpstring("Component Class") - ] - coclass Component - { - [default] interface IComponent; - }; - - // MPEG2 Component class - [ - hidden, restricted, - uuid(055CB2D7-2969-45cd-914B-76890722F112), - helpstring("MPEG2 Component Class") - ] - coclass MPEG2Component - { - [default] interface IMPEG2Component; - }; - - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(B46E0D38-AB35-4a06-A137-70576B01B39F), - helpstring("dummy class to expose base tune request i/f to VB") - ] - coclass TuneRequest - { - [default] interface ITuneRequest; - }; - - - // NOTE: the tuning request factories should not be invoked directly. - // instead apps should use ITuningSpace::CreateTuningRequest to obtain a correctly - // initialized tuning request of the appropriate type for that space. - // the object factories are provided to allow generic code to a load a previously persisted - // tune request object. - [ - hidden, - restricted, - uuid(0369B4E5-45B6-11d3-B650-00C04F79498E), - helpstring("Channel Tune Request") - ] - coclass ChannelTuneRequest - { - [default] interface IChannelTuneRequest; - }; - - [ - hidden, - restricted, - uuid(0369B4E6-45B6-11d3-B650-00C04F79498E), - helpstring("ATSC Channel Tune Request") - ] - coclass ATSCChannelTuneRequest - { - [default] interface IATSCChannelTuneRequest; - }; - - - // NOTE: there is no object factory for this class. the implementation for the underlying - // code is a c++ abstract base class. this coclass is only provided here to - // force vb to expose the base interface to enable polymorphic access to - // derived objects - [ - hidden, restricted, - uuid(0888C883-AC4F-4943-B516-2C38D9B34562), - helpstring("dummy class to expose base locator i/f to VB") - ] - coclass Locator - { - [default] interface ILocator; - }; - - // its not intended that client apps actually create locators. the network - // provider in combination with the transport information filter(TIF) are the - // only modules in the system that actually know the correct values for these objects - // however, for testing purposes, its necessary to allow these to be created. - // instead, normally these will simply be passed around opaquely since they're a - // property of the base tune request interface. - [ - uuid(8872FF1B-98FA-4d7a-8D93-C9F1055F85BB), - helpstring("ATSC Locator") - ] - coclass ATSCLocator - { - [default] interface IATSCLocator; - }; - - [ - uuid(9CD64701-BDF3-4d14-8E03-F12983D86664), - helpstring("DVB-Terrestrial Locator") - ] - coclass DVBTLocator - { - [default] interface IDVBTLocator; - }; - - [ - uuid(1DF7D126-4050-47f0-A7CF-4C4CA9241333), - helpstring("DVB-Satellite Locator") - ] - coclass DVBSLocator - { - [default] interface IDVBSLocator; - }; - - [ - uuid(C531D9FD-9685-4028-8B68-6E1232079F1E), - helpstring("DVB-Cable Locator") - ] - coclass DVBCLocator - { - [default] interface ILocator; - }; - - [ - hidden, - restricted, - uuid(15D6504A-5494-499c-886C-973C9E53B9F1), - helpstring("DVB Tune Request") - ] - coclass DVBTuneRequest - { - [default] interface IDVBTuneRequest; - }; - - // Sample tuner class definition: - // - // [ - // uuid(), - // helpstring("My Tuner object") - // ] - // coclass MyTuner - // { - // [default] interface ITuner; - // interface IMyTunerCustomFeatureInterface; - // [default, source] interface ITunerEvents; - // [source] interface ISignalEvents; - // }; - - /////////////////////////////////////////////////////////////////////////////////////// - // utility objects - /////////////////////////////////////////////////////////////////////////////////////// - [ - hidden, restricted, - uuid(8A674B49-1F63-11d3-B64C-00C04F79498E), - helpstring("Create property bag backed by registry") - ] - coclass CreatePropBagOnRegKey - { - interface ICreatePropBagOnRegKey; - }; - - } - - -#endif // DirectX 8.0 content - - -// end of file -- tuner.idl diff --git a/import/DirectX8/include/DShowIDL/videoacc.idl b/import/DirectX8/include/DShowIDL/videoacc.idl deleted file mode 100644 index 6a8703058..000000000 --- a/import/DirectX8/include/DShowIDL/videoacc.idl +++ /dev/null @@ -1,172 +0,0 @@ -//------------------------------------------------------------------------------ -// File: VideoAcc.idl -// -// Desc: An interface exposed by the overlay mixer to help decode samples -// using hardware video acceleration. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -import "unknwn.idl"; - -cpp_quote("//") -cpp_quote("// The following declarations within the 'if 0' block are dummy typedefs used to make") -cpp_quote("// the motncomp.idl file build. The actual definitions are contained in ddraw.h and amva.h") -cpp_quote("//") -cpp_quote("#if 0") - -typedef void* LPVOID; -typedef void* LPGUID; -typedef void* LPDIRECTDRAWSURFACE; -typedef void* LPDDPIXELFORMAT; -typedef void* LPAMVAInternalMemInfo; -typedef void AMVAUncompDataInfo; -typedef void* LPAMVACompBufferInfo; -typedef void AMVABUFFERINFO; -typedef void AMVAEndFrameInfo; -typedef void* LPAMVAUncompBufferInfo; -typedef void AMVABeginFrameInfo; -typedef IUnknown* IMediaSample; - -cpp_quote("#endif") -cpp_quote("#include ") -cpp_quote("#include ") - - -[ - local, - object, - uuid(256A6A21-FBAD-11d1-82BF-00A0C9696C8F), - helpstring("IAMVideoAcceleratorNotify Interface"), - pointer_default(unique) -] - -// IAMVideoAcceleratorNotify -interface IAMVideoAcceleratorNotify : IUnknown -{ - // get information necessary to allocate uncompressed data buffers - // which is not part of the mediatype format (like how many buffers to allocate etc) - HRESULT GetUncompSurfacesInfo([in] const GUID *pGuid, [in] [out] LPAMVAUncompBufferInfo pUncompBufferInfo); - - // set information regarding allocated uncompressed data buffers - HRESULT SetUncompSurfacesInfo([in] DWORD dwActualUncompSurfacesAllocated); - - // get information necessary to create video accelerator object. It is the caller's responsibility - // to call CoTaskMemFree() on *ppMiscData - HRESULT GetCreateVideoAcceleratorData([in] const GUID *pGuid, [out] LPDWORD pdwSizeMiscData, [out] LPVOID *ppMiscData); -}; - -[ - local, - object, - uuid(256A6A22-FBAD-11d1-82BF-00A0C9696C8F), - helpstring("IAMVideoAccelerator Interface"), - pointer_default(unique) -] - -// IAMVideoAccelerator -interface IAMVideoAccelerator : IUnknown -{ - // pdwNumGuidsSupported is an IN OUT paramter - // pGuidsSupported is an IN OUT paramter - // if pGuidsSupported is NULL, pdwNumGuidsSupported should return back with the - // number of uncompressed pixel formats supported - // Otherwise pGuidsSupported is an array of *pdwNumGuidsSupported structures - HRESULT GetVideoAcceleratorGUIDs([in] [out] LPDWORD pdwNumGuidsSupported, [in] [out] LPGUID pGuidsSupported); - - // pGuid is an IN parameter - // pdwNumFormatsSupported is an IN OUT paramter - // pFormatsSupported is an IN OUT paramter (caller should make sure to set the size of EACH struct) - // if pFormatsSupported is NULL, pdwNumFormatsSupported should return back with - // the number of uncompressed pixel formats supported - // Otherwise pFormatsSupported is an array of *pdwNumFormatsSupported structures - HRESULT GetUncompFormatsSupported( [in] const GUID *pGuid, [in] [out] LPDWORD pdwNumFormatsSupported, - [in] [out] LPDDPIXELFORMAT pFormatsSupported); - - // pGuid is an IN parameter - // pamvaUncompDataInfo is an IN parameter - // pamvaInternalMemInfo is an IN OUT parameter (caller should make sure to set the size of struct) - // currently only gets info about how much scratch memory will the hal allocate for its private use - HRESULT GetInternalMemInfo([in] const GUID *pGuid, [in] const AMVAUncompDataInfo *pamvaUncompDataInfo, - [in] [out] LPAMVAInternalMemInfo pamvaInternalMemInfo); - - // pGuid is an IN parameter - // pamvaUncompDataInfo is an IN parameter - // pdwNumTypesCompBuffers is an IN OUT paramter - // pamvaCompBufferInfo is an IN OUT paramter (caller should make sure to set the size of EACH struct) - // if pamvaCompBufferInfo is NULL, pdwNumTypesCompBuffers should return back with the number of types of - // compressed buffers - // Otherwise pamvaCompBufferInfo is an array of *pdwNumTypesCompBuffers structures - HRESULT GetCompBufferInfo([in] const GUID *pGuid, [in] const AMVAUncompDataInfo *pamvaUncompDataInfo, - [in] [out] LPDWORD pdwNumTypesCompBuffers, [out] LPAMVACompBufferInfo pamvaCompBufferInfo); - - - // pdwNumTypesCompBuffers is an IN OUT paramter - // pamvaCompBufferInfo is an IN OUT paramter (caller should make sure to set the size of EACH struct) - // if pamvaCompBufferInfo is NULL, pdwNumTypesCompBuffers should return back with the number of types of - // compressed buffers - // Otherwise pamvaCompBufferInfo is an array of *pdwNumTypesCompBuffers structures - // only valid to call this after the pins are connected - HRESULT GetInternalCompBufferInfo([in] [out] LPDWORD pdwNumTypesCompBuffers, [out] LPAMVACompBufferInfo pamvaCompBufferInfo); - - // begin a frame, the pMiscData is passed directly to the hal - // only valid to call this after the pins are connected - // Tells the ovmixer which frame is the destination - // frame. Use indices (valid vales are [0 .. pdwNumSurfacesAllocated-1]) to specify frames - HRESULT BeginFrame([in] const AMVABeginFrameInfo *amvaBeginFrameInfo); - - // end a frame, the pMiscData is passed directly to the hal - // only valid to call this after the pins are connected - HRESULT EndFrame([in] const AMVAEndFrameInfo *pEndFrameInfo); - - // lock and obtain access to a single buffer - // only valid to call this after the pins are connected - // Buffers are identified by type and index within that type - // Specifiying read-only will allow access to busy reference - // frames - // Output (uncompressed) frames use a type index of 0xFFFFFFFF - HRESULT GetBuffer( - [in] DWORD dwTypeIndex, - [in] DWORD dwBufferIndex, - [in] BOOL bReadOnly, - [out] LPVOID *ppBuffer, - [out] LONG *lpStride); - - // unlock a single buffer - // Buffers are identified by type and index within that type - // only valid to call this after the pins are connected - HRESULT ReleaseBuffer([in] DWORD dwTypeIndex, [in] DWORD dwBufferIndex); - - // Perform a decompression operation - // Private data can be passed to and from a driver - // identifiers for the corresponding members of pamvaMacroBlockInfo - // pamvaMacroBlockInfo is an IN parameter which is array (of length dwNumBlocks) of structures - // only valid to call this after the pins are connected - HRESULT Execute( - [in] DWORD dwFunction, - [in] LPVOID lpPrivateInputData, - [in] DWORD cbPrivateInputData, - [in] LPVOID lpPrivateOutputDat, - [in] DWORD cbPrivateOutputData, - [in] DWORD dwNumBuffers, - [in] const AMVABUFFERINFO *pamvaBufferInfo); - - // query the decode status of a particular decompression operation - // dwTypeIndex and dwBufferIndex define the buffer whose status is - // being queried - HRESULT QueryRenderStatus([in] DWORD dwTypeIndex, - [in] DWORD dwBufferIndex, - [in] DWORD dwFlags); - - // display a frame. The mediasample contains the timestamps etc for the frame to be displayed - // this call is a non-blocking call - // only valid to call this after the pins are connected - HRESULT DisplayFrame([in] DWORD dwFlipToIndex, [in] IMediaSample *pMediaSample); -}; - - - - - - diff --git a/import/DirectX8/include/activecf.h b/import/DirectX8/include/activecf.h deleted file mode 100644 index 5efd8cfc2..000000000 --- a/import/DirectX8/include/activecf.h +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// File: ActiveCf.h -// -// Desc: Contains the data formats for the transfer of VfW4 filters via the -// clipboard. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#define CFSTR_VFW_FILTERLIST "Video for Windows 4 Filters" - -typedef struct tagVFW_FILTERLIST{ - UINT cFilters; // number of CLSIDs in aClsId - CLSID aClsId[1]; // ClsId of each filter - -} VFW_FILTERLIST; - - diff --git a/import/DirectX8/include/amaudio.h b/import/DirectX8/include/amaudio.h deleted file mode 100644 index cd6d0532a..000000000 --- a/import/DirectX8/include/amaudio.h +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMAudio.h -// -// Desc: Audio related definitions and interfaces for ActiveMovie. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __AMAUDIO__ -#define __AMAUDIO__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#include -#include - -// This is the interface the audio renderer supports to give the application -// access to the direct sound object and the buffers it is using, to allow the -// application to use things like the 3D features of Direct Sound for the -// soundtrack of a movie being played with Active Movie. - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IAMDirectSound - -DECLARE_INTERFACE_(IAMDirectSound,IUnknown) -{ - /* IUnknown methods */ - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /* IAMDirectSound methods */ - - STDMETHOD(GetDirectSoundInterface)(THIS_ LPDIRECTSOUND *lplpds) PURE; - STDMETHOD(GetPrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; - STDMETHOD(GetSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; - STDMETHOD(ReleaseDirectSoundInterface)(THIS_ LPDIRECTSOUND lpds) PURE; - STDMETHOD(ReleasePrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; - STDMETHOD(ReleaseSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; - STDMETHOD(SetFocusWindow)(THIS_ HWND, BOOL) PURE ; - STDMETHOD(GetFocusWindow)(THIS_ HWND *, BOOL*) PURE ; -}; - - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __AMAUDIO__ - diff --git a/import/DirectX8/include/amparse.h b/import/DirectX8/include/amparse.h deleted file mode 100644 index ce7a388df..000000000 --- a/import/DirectX8/include/amparse.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMParse.h -// -// Desc: Interface to the parser to get current time. This is useful for -// multifile playback. -// -// Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __AMPARSE__ -#define __AMPARSE__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - - -DEFINE_GUID(IID_IAMParse, -0xc47a3420, 0x005c, 0x11d2, 0x90, 0x38, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x98); - -// -// Parser interface - supported by MPEG-2 splitter filter -// -DECLARE_INTERFACE_(IAMParse, IUnknown) { - STDMETHOD(GetParseTime) (THIS_ - REFERENCE_TIME *prtCurrent - ) PURE; - STDMETHOD(SetParseTime) (THIS_ - REFERENCE_TIME rtCurrent - ) PURE; - STDMETHOD(Flush) (THIS) PURE; -}; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __AMPARSE__ diff --git a/import/DirectX8/include/amstream.h b/import/DirectX8/include/amstream.h deleted file mode 100644 index 01ef02ab5..000000000 --- a/import/DirectX8/include/amstream.h +++ /dev/null @@ -1,2295 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for amstream.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __amstream_h__ -#define __amstream_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDirectShowStream_FWD_DEFINED__ -#define __IDirectShowStream_FWD_DEFINED__ -typedef interface IDirectShowStream IDirectShowStream; -#endif /* __IDirectShowStream_FWD_DEFINED__ */ - - -#ifndef __IAMMultiMediaStream_FWD_DEFINED__ -#define __IAMMultiMediaStream_FWD_DEFINED__ -typedef interface IAMMultiMediaStream IAMMultiMediaStream; -#endif /* __IAMMultiMediaStream_FWD_DEFINED__ */ - - -#ifndef __IAMMediaStream_FWD_DEFINED__ -#define __IAMMediaStream_FWD_DEFINED__ -typedef interface IAMMediaStream IAMMediaStream; -#endif /* __IAMMediaStream_FWD_DEFINED__ */ - - -#ifndef __IMediaStreamFilter_FWD_DEFINED__ -#define __IMediaStreamFilter_FWD_DEFINED__ -typedef interface IMediaStreamFilter IMediaStreamFilter; -#endif /* __IMediaStreamFilter_FWD_DEFINED__ */ - - -#ifndef __IDirectDrawMediaSampleAllocator_FWD_DEFINED__ -#define __IDirectDrawMediaSampleAllocator_FWD_DEFINED__ -typedef interface IDirectDrawMediaSampleAllocator IDirectDrawMediaSampleAllocator; -#endif /* __IDirectDrawMediaSampleAllocator_FWD_DEFINED__ */ - - -#ifndef __IDirectDrawMediaSample_FWD_DEFINED__ -#define __IDirectDrawMediaSample_FWD_DEFINED__ -typedef interface IDirectDrawMediaSample IDirectDrawMediaSample; -#endif /* __IDirectDrawMediaSample_FWD_DEFINED__ */ - - -#ifndef __IAMMediaTypeStream_FWD_DEFINED__ -#define __IAMMediaTypeStream_FWD_DEFINED__ -typedef interface IAMMediaTypeStream IAMMediaTypeStream; -#endif /* __IAMMediaTypeStream_FWD_DEFINED__ */ - - -#ifndef __IAMMediaTypeSample_FWD_DEFINED__ -#define __IAMMediaTypeSample_FWD_DEFINED__ -typedef interface IAMMediaTypeSample IAMMediaTypeSample; -#endif /* __IAMMediaTypeSample_FWD_DEFINED__ */ - - -#ifndef __AMMultiMediaStream_FWD_DEFINED__ -#define __AMMultiMediaStream_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMMultiMediaStream AMMultiMediaStream; -#else -typedef struct AMMultiMediaStream AMMultiMediaStream; -#endif /* __cplusplus */ - -#endif /* __AMMultiMediaStream_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "mmstream.h" -#include "strmif.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_amstream_0000 */ -/* [local] */ - -#include -#include -#include -#include -#include - - - - - - - - -enum __MIDL___MIDL_itf_amstream_0000_0001 - { AMMSF_NOGRAPHTHREAD = 0x1 - } ; - -enum __MIDL___MIDL_itf_amstream_0000_0002 - { AMMSF_ADDDEFAULTRENDERER = 0x1, - AMMSF_CREATEPEER = 0x2, - AMMSF_STOPIFNOSAMPLES = 0x4, - AMMSF_NOSTALL = 0x8 - } ; - -enum __MIDL___MIDL_itf_amstream_0000_0003 - { AMMSF_RENDERTYPEMASK = 0x3, - AMMSF_RENDERTOEXISTING = 0, - AMMSF_RENDERALLSTREAMS = 0x1, - AMMSF_NORENDER = 0x2, - AMMSF_NOCLOCK = 0x4, - AMMSF_RUN = 0x8 - } ; -typedef /* [public][public][public][public][public][v1_enum] */ -enum __MIDL___MIDL_itf_amstream_0000_0004 - { Disabled = 0, - ReadData = 1, - RenderData = 2 - } OUTPUT_STATE; - - - -extern RPC_IF_HANDLE __MIDL_itf_amstream_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_amstream_0000_v0_0_s_ifspec; - -#ifndef __IDirectShowStream_INTERFACE_DEFINED__ -#define __IDirectShowStream_INTERFACE_DEFINED__ - -/* interface IDirectShowStream */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDirectShowStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7DB01C96-C0C3-11d0-8FF1-00C04FD9189D") - IDirectShowStream : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FileName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FileName( - /* [in] */ BSTR newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Video( - /* [retval][out] */ OUTPUT_STATE *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Video( - /* [in] */ OUTPUT_STATE newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Audio( - /* [retval][out] */ OUTPUT_STATE *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Audio( - /* [in] */ OUTPUT_STATE newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDirectShowStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDirectShowStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDirectShowStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDirectShowStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDirectShowStream * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDirectShowStream * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDirectShowStream * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDirectShowStream * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FileName )( - IDirectShowStream * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FileName )( - IDirectShowStream * This, - /* [in] */ BSTR newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Video )( - IDirectShowStream * This, - /* [retval][out] */ OUTPUT_STATE *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Video )( - IDirectShowStream * This, - /* [in] */ OUTPUT_STATE newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Audio )( - IDirectShowStream * This, - /* [retval][out] */ OUTPUT_STATE *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Audio )( - IDirectShowStream * This, - /* [in] */ OUTPUT_STATE newVal); - - END_INTERFACE - } IDirectShowStreamVtbl; - - interface IDirectShowStream - { - CONST_VTBL struct IDirectShowStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDirectShowStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDirectShowStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDirectShowStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDirectShowStream_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDirectShowStream_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDirectShowStream_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDirectShowStream_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDirectShowStream_get_FileName(This,pVal) \ - (This)->lpVtbl -> get_FileName(This,pVal) - -#define IDirectShowStream_put_FileName(This,newVal) \ - (This)->lpVtbl -> put_FileName(This,newVal) - -#define IDirectShowStream_get_Video(This,pVal) \ - (This)->lpVtbl -> get_Video(This,pVal) - -#define IDirectShowStream_put_Video(This,newVal) \ - (This)->lpVtbl -> put_Video(This,newVal) - -#define IDirectShowStream_get_Audio(This,pVal) \ - (This)->lpVtbl -> get_Audio(This,pVal) - -#define IDirectShowStream_put_Audio(This,newVal) \ - (This)->lpVtbl -> put_Audio(This,newVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_get_FileName_Proxy( - IDirectShowStream * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IDirectShowStream_get_FileName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_put_FileName_Proxy( - IDirectShowStream * This, - /* [in] */ BSTR newVal); - - -void __RPC_STUB IDirectShowStream_put_FileName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_get_Video_Proxy( - IDirectShowStream * This, - /* [retval][out] */ OUTPUT_STATE *pVal); - - -void __RPC_STUB IDirectShowStream_get_Video_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_put_Video_Proxy( - IDirectShowStream * This, - /* [in] */ OUTPUT_STATE newVal); - - -void __RPC_STUB IDirectShowStream_put_Video_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_get_Audio_Proxy( - IDirectShowStream * This, - /* [retval][out] */ OUTPUT_STATE *pVal); - - -void __RPC_STUB IDirectShowStream_get_Audio_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDirectShowStream_put_Audio_Proxy( - IDirectShowStream * This, - /* [in] */ OUTPUT_STATE newVal); - - -void __RPC_STUB IDirectShowStream_put_Audio_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDirectShowStream_INTERFACE_DEFINED__ */ - - -#ifndef __IAMMultiMediaStream_INTERFACE_DEFINED__ -#define __IAMMultiMediaStream_INTERFACE_DEFINED__ - -/* interface IAMMultiMediaStream */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMMultiMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BEBE595C-9A6F-11d0-8FDE-00C04FD9189D") - IAMMultiMediaStream : public IMultiMediaStream - { - public: - virtual HRESULT STDMETHODCALLTYPE Initialize( - /* [in] */ STREAM_TYPE StreamType, - /* [in] */ DWORD dwFlags, - /* [in] */ IGraphBuilder *pFilterGraph) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilterGraph( - /* [out] */ IGraphBuilder **ppGraphBuilder) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilter( - /* [out] */ IMediaStreamFilter **ppFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddMediaStream( - /* [in] */ IUnknown *pStreamObject, - /* [in] */ const MSPID *PurposeId, - /* [in] */ DWORD dwFlags, - /* [out] */ IMediaStream **ppNewStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE OpenFile( - /* [in] */ LPCWSTR pszFileName, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE OpenMoniker( - /* [in] */ IBindCtx *pCtx, - /* [in] */ IMoniker *pMoniker, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Render( - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMMultiMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMMultiMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMMultiMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMMultiMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IAMMultiMediaStream * This, - /* [out] */ DWORD *pdwFlags, - /* [out] */ STREAM_TYPE *pStreamType); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IAMMultiMediaStream * This, - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *EnumMediaStreams )( - IAMMultiMediaStream * This, - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IAMMultiMediaStream * This, - /* [out] */ STREAM_STATE *pCurrentState); - - HRESULT ( STDMETHODCALLTYPE *SetState )( - IAMMultiMediaStream * This, - /* [in] */ STREAM_STATE NewState); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IAMMultiMediaStream * This, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IAMMultiMediaStream * This, - /* [out] */ STREAM_TIME *pDuration); - - HRESULT ( STDMETHODCALLTYPE *Seek )( - IAMMultiMediaStream * This, - /* [in] */ STREAM_TIME SeekTime); - - HRESULT ( STDMETHODCALLTYPE *GetEndOfStreamEventHandle )( - IAMMultiMediaStream * This, - /* [out] */ HANDLE *phEOS); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - IAMMultiMediaStream * This, - /* [in] */ STREAM_TYPE StreamType, - /* [in] */ DWORD dwFlags, - /* [in] */ IGraphBuilder *pFilterGraph); - - HRESULT ( STDMETHODCALLTYPE *GetFilterGraph )( - IAMMultiMediaStream * This, - /* [out] */ IGraphBuilder **ppGraphBuilder); - - HRESULT ( STDMETHODCALLTYPE *GetFilter )( - IAMMultiMediaStream * This, - /* [out] */ IMediaStreamFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *AddMediaStream )( - IAMMultiMediaStream * This, - /* [in] */ IUnknown *pStreamObject, - /* [in] */ const MSPID *PurposeId, - /* [in] */ DWORD dwFlags, - /* [out] */ IMediaStream **ppNewStream); - - HRESULT ( STDMETHODCALLTYPE *OpenFile )( - IAMMultiMediaStream * This, - /* [in] */ LPCWSTR pszFileName, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *OpenMoniker )( - IAMMultiMediaStream * This, - /* [in] */ IBindCtx *pCtx, - /* [in] */ IMoniker *pMoniker, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *Render )( - IAMMultiMediaStream * This, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } IAMMultiMediaStreamVtbl; - - interface IAMMultiMediaStream - { - CONST_VTBL struct IAMMultiMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMMultiMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMMultiMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMMultiMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMMultiMediaStream_GetInformation(This,pdwFlags,pStreamType) \ - (This)->lpVtbl -> GetInformation(This,pdwFlags,pStreamType) - -#define IAMMultiMediaStream_GetMediaStream(This,idPurpose,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,idPurpose,ppMediaStream) - -#define IAMMultiMediaStream_EnumMediaStreams(This,Index,ppMediaStream) \ - (This)->lpVtbl -> EnumMediaStreams(This,Index,ppMediaStream) - -#define IAMMultiMediaStream_GetState(This,pCurrentState) \ - (This)->lpVtbl -> GetState(This,pCurrentState) - -#define IAMMultiMediaStream_SetState(This,NewState) \ - (This)->lpVtbl -> SetState(This,NewState) - -#define IAMMultiMediaStream_GetTime(This,pCurrentTime) \ - (This)->lpVtbl -> GetTime(This,pCurrentTime) - -#define IAMMultiMediaStream_GetDuration(This,pDuration) \ - (This)->lpVtbl -> GetDuration(This,pDuration) - -#define IAMMultiMediaStream_Seek(This,SeekTime) \ - (This)->lpVtbl -> Seek(This,SeekTime) - -#define IAMMultiMediaStream_GetEndOfStreamEventHandle(This,phEOS) \ - (This)->lpVtbl -> GetEndOfStreamEventHandle(This,phEOS) - - -#define IAMMultiMediaStream_Initialize(This,StreamType,dwFlags,pFilterGraph) \ - (This)->lpVtbl -> Initialize(This,StreamType,dwFlags,pFilterGraph) - -#define IAMMultiMediaStream_GetFilterGraph(This,ppGraphBuilder) \ - (This)->lpVtbl -> GetFilterGraph(This,ppGraphBuilder) - -#define IAMMultiMediaStream_GetFilter(This,ppFilter) \ - (This)->lpVtbl -> GetFilter(This,ppFilter) - -#define IAMMultiMediaStream_AddMediaStream(This,pStreamObject,PurposeId,dwFlags,ppNewStream) \ - (This)->lpVtbl -> AddMediaStream(This,pStreamObject,PurposeId,dwFlags,ppNewStream) - -#define IAMMultiMediaStream_OpenFile(This,pszFileName,dwFlags) \ - (This)->lpVtbl -> OpenFile(This,pszFileName,dwFlags) - -#define IAMMultiMediaStream_OpenMoniker(This,pCtx,pMoniker,dwFlags) \ - (This)->lpVtbl -> OpenMoniker(This,pCtx,pMoniker,dwFlags) - -#define IAMMultiMediaStream_Render(This,dwFlags) \ - (This)->lpVtbl -> Render(This,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_Initialize_Proxy( - IAMMultiMediaStream * This, - /* [in] */ STREAM_TYPE StreamType, - /* [in] */ DWORD dwFlags, - /* [in] */ IGraphBuilder *pFilterGraph); - - -void __RPC_STUB IAMMultiMediaStream_Initialize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_GetFilterGraph_Proxy( - IAMMultiMediaStream * This, - /* [out] */ IGraphBuilder **ppGraphBuilder); - - -void __RPC_STUB IAMMultiMediaStream_GetFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_GetFilter_Proxy( - IAMMultiMediaStream * This, - /* [out] */ IMediaStreamFilter **ppFilter); - - -void __RPC_STUB IAMMultiMediaStream_GetFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_AddMediaStream_Proxy( - IAMMultiMediaStream * This, - /* [in] */ IUnknown *pStreamObject, - /* [in] */ const MSPID *PurposeId, - /* [in] */ DWORD dwFlags, - /* [out] */ IMediaStream **ppNewStream); - - -void __RPC_STUB IAMMultiMediaStream_AddMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_OpenFile_Proxy( - IAMMultiMediaStream * This, - /* [in] */ LPCWSTR pszFileName, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMMultiMediaStream_OpenFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_OpenMoniker_Proxy( - IAMMultiMediaStream * This, - /* [in] */ IBindCtx *pCtx, - /* [in] */ IMoniker *pMoniker, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMMultiMediaStream_OpenMoniker_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMultiMediaStream_Render_Proxy( - IAMMultiMediaStream * This, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMMultiMediaStream_Render_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMMultiMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IAMMediaStream_INTERFACE_DEFINED__ -#define __IAMMediaStream_INTERFACE_DEFINED__ - -/* interface IAMMediaStream */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BEBE595D-9A6F-11d0-8FDE-00C04FD9189D") - IAMMediaStream : public IMediaStream - { - public: - virtual HRESULT STDMETHODCALLTYPE Initialize( - /* [in] */ IUnknown *pSourceObject, - /* [in] */ DWORD dwFlags, - /* [in] */ REFMSPID PurposeId, - /* [in] */ const STREAM_TYPE StreamType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetState( - /* [in] */ FILTER_STATE State) = 0; - - virtual HRESULT STDMETHODCALLTYPE JoinAMMultiMediaStream( - /* [in] */ IAMMultiMediaStream *pAMMultiMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE JoinFilter( - /* [in] */ IMediaStreamFilter *pMediaStreamFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE JoinFilterGraph( - /* [in] */ IFilterGraph *pFilterGraph) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetMultiMediaStream )( - IAMMediaStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IAMMediaStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetSameFormat )( - IAMMediaStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *AllocateSample )( - IAMMediaStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *CreateSharedSample )( - IAMMediaStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - HRESULT ( STDMETHODCALLTYPE *SendEndOfStream )( - IAMMediaStream * This, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - IAMMediaStream * This, - /* [in] */ IUnknown *pSourceObject, - /* [in] */ DWORD dwFlags, - /* [in] */ REFMSPID PurposeId, - /* [in] */ const STREAM_TYPE StreamType); - - HRESULT ( STDMETHODCALLTYPE *SetState )( - IAMMediaStream * This, - /* [in] */ FILTER_STATE State); - - HRESULT ( STDMETHODCALLTYPE *JoinAMMultiMediaStream )( - IAMMediaStream * This, - /* [in] */ IAMMultiMediaStream *pAMMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *JoinFilter )( - IAMMediaStream * This, - /* [in] */ IMediaStreamFilter *pMediaStreamFilter); - - HRESULT ( STDMETHODCALLTYPE *JoinFilterGraph )( - IAMMediaStream * This, - /* [in] */ IFilterGraph *pFilterGraph); - - END_INTERFACE - } IAMMediaStreamVtbl; - - interface IAMMediaStream - { - CONST_VTBL struct IAMMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMMediaStream_GetMultiMediaStream(This,ppMultiMediaStream) \ - (This)->lpVtbl -> GetMultiMediaStream(This,ppMultiMediaStream) - -#define IAMMediaStream_GetInformation(This,pPurposeId,pType) \ - (This)->lpVtbl -> GetInformation(This,pPurposeId,pType) - -#define IAMMediaStream_SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) \ - (This)->lpVtbl -> SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) - -#define IAMMediaStream_AllocateSample(This,dwFlags,ppSample) \ - (This)->lpVtbl -> AllocateSample(This,dwFlags,ppSample) - -#define IAMMediaStream_CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) \ - (This)->lpVtbl -> CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) - -#define IAMMediaStream_SendEndOfStream(This,dwFlags) \ - (This)->lpVtbl -> SendEndOfStream(This,dwFlags) - - -#define IAMMediaStream_Initialize(This,pSourceObject,dwFlags,PurposeId,StreamType) \ - (This)->lpVtbl -> Initialize(This,pSourceObject,dwFlags,PurposeId,StreamType) - -#define IAMMediaStream_SetState(This,State) \ - (This)->lpVtbl -> SetState(This,State) - -#define IAMMediaStream_JoinAMMultiMediaStream(This,pAMMultiMediaStream) \ - (This)->lpVtbl -> JoinAMMultiMediaStream(This,pAMMultiMediaStream) - -#define IAMMediaStream_JoinFilter(This,pMediaStreamFilter) \ - (This)->lpVtbl -> JoinFilter(This,pMediaStreamFilter) - -#define IAMMediaStream_JoinFilterGraph(This,pFilterGraph) \ - (This)->lpVtbl -> JoinFilterGraph(This,pFilterGraph) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMMediaStream_Initialize_Proxy( - IAMMediaStream * This, - /* [in] */ IUnknown *pSourceObject, - /* [in] */ DWORD dwFlags, - /* [in] */ REFMSPID PurposeId, - /* [in] */ const STREAM_TYPE StreamType); - - -void __RPC_STUB IAMMediaStream_Initialize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaStream_SetState_Proxy( - IAMMediaStream * This, - /* [in] */ FILTER_STATE State); - - -void __RPC_STUB IAMMediaStream_SetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaStream_JoinAMMultiMediaStream_Proxy( - IAMMediaStream * This, - /* [in] */ IAMMultiMediaStream *pAMMultiMediaStream); - - -void __RPC_STUB IAMMediaStream_JoinAMMultiMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaStream_JoinFilter_Proxy( - IAMMediaStream * This, - /* [in] */ IMediaStreamFilter *pMediaStreamFilter); - - -void __RPC_STUB IAMMediaStream_JoinFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaStream_JoinFilterGraph_Proxy( - IAMMediaStream * This, - /* [in] */ IFilterGraph *pFilterGraph); - - -void __RPC_STUB IAMMediaStream_JoinFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaStreamFilter_INTERFACE_DEFINED__ -#define __IMediaStreamFilter_INTERFACE_DEFINED__ - -/* interface IMediaStreamFilter */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IMediaStreamFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BEBE595E-9A6F-11d0-8FDE-00C04FD9189D") - IMediaStreamFilter : public IBaseFilter - { - public: - virtual HRESULT STDMETHODCALLTYPE AddMediaStream( - /* [in] */ IAMMediaStream *pAMMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaStream( - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumMediaStreams( - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE SupportSeeking( - /* [in] */ BOOL bRenderer) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReferenceTimeToStreamTime( - /* [out][in] */ REFERENCE_TIME *pTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentStreamTime( - /* [out] */ REFERENCE_TIME *pCurrentStreamTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE WaitUntil( - /* [in] */ REFERENCE_TIME WaitStreamTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE Flush( - /* [in] */ BOOL bCancelEOS) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndOfStream( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaStreamFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaStreamFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaStreamFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaStreamFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetClassID )( - IMediaStreamFilter * This, - /* [out] */ CLSID *pClassID); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IMediaStreamFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IMediaStreamFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Run )( - IMediaStreamFilter * This, - REFERENCE_TIME tStart); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IMediaStreamFilter * This, - /* [in] */ DWORD dwMilliSecsTimeout, - /* [out] */ FILTER_STATE *State); - - HRESULT ( STDMETHODCALLTYPE *SetSyncSource )( - IMediaStreamFilter * This, - /* [in] */ IReferenceClock *pClock); - - HRESULT ( STDMETHODCALLTYPE *GetSyncSource )( - IMediaStreamFilter * This, - /* [out] */ IReferenceClock **pClock); - - HRESULT ( STDMETHODCALLTYPE *EnumPins )( - IMediaStreamFilter * This, - /* [out] */ IEnumPins **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *FindPin )( - IMediaStreamFilter * This, - /* [string][in] */ LPCWSTR Id, - /* [out] */ IPin **ppPin); - - HRESULT ( STDMETHODCALLTYPE *QueryFilterInfo )( - IMediaStreamFilter * This, - /* [out] */ FILTER_INFO *pInfo); - - HRESULT ( STDMETHODCALLTYPE *JoinFilterGraph )( - IMediaStreamFilter * This, - /* [in] */ IFilterGraph *pGraph, - /* [string][in] */ LPCWSTR pName); - - HRESULT ( STDMETHODCALLTYPE *QueryVendorInfo )( - IMediaStreamFilter * This, - /* [string][out] */ LPWSTR *pVendorInfo); - - HRESULT ( STDMETHODCALLTYPE *AddMediaStream )( - IMediaStreamFilter * This, - /* [in] */ IAMMediaStream *pAMMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IMediaStreamFilter * This, - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *EnumMediaStreams )( - IMediaStreamFilter * This, - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *SupportSeeking )( - IMediaStreamFilter * This, - /* [in] */ BOOL bRenderer); - - HRESULT ( STDMETHODCALLTYPE *ReferenceTimeToStreamTime )( - IMediaStreamFilter * This, - /* [out][in] */ REFERENCE_TIME *pTime); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentStreamTime )( - IMediaStreamFilter * This, - /* [out] */ REFERENCE_TIME *pCurrentStreamTime); - - HRESULT ( STDMETHODCALLTYPE *WaitUntil )( - IMediaStreamFilter * This, - /* [in] */ REFERENCE_TIME WaitStreamTime); - - HRESULT ( STDMETHODCALLTYPE *Flush )( - IMediaStreamFilter * This, - /* [in] */ BOOL bCancelEOS); - - HRESULT ( STDMETHODCALLTYPE *EndOfStream )( - IMediaStreamFilter * This); - - END_INTERFACE - } IMediaStreamFilterVtbl; - - interface IMediaStreamFilter - { - CONST_VTBL struct IMediaStreamFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaStreamFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaStreamFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaStreamFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaStreamFilter_GetClassID(This,pClassID) \ - (This)->lpVtbl -> GetClassID(This,pClassID) - - -#define IMediaStreamFilter_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IMediaStreamFilter_Pause(This) \ - (This)->lpVtbl -> Pause(This) - -#define IMediaStreamFilter_Run(This,tStart) \ - (This)->lpVtbl -> Run(This,tStart) - -#define IMediaStreamFilter_GetState(This,dwMilliSecsTimeout,State) \ - (This)->lpVtbl -> GetState(This,dwMilliSecsTimeout,State) - -#define IMediaStreamFilter_SetSyncSource(This,pClock) \ - (This)->lpVtbl -> SetSyncSource(This,pClock) - -#define IMediaStreamFilter_GetSyncSource(This,pClock) \ - (This)->lpVtbl -> GetSyncSource(This,pClock) - - -#define IMediaStreamFilter_EnumPins(This,ppEnum) \ - (This)->lpVtbl -> EnumPins(This,ppEnum) - -#define IMediaStreamFilter_FindPin(This,Id,ppPin) \ - (This)->lpVtbl -> FindPin(This,Id,ppPin) - -#define IMediaStreamFilter_QueryFilterInfo(This,pInfo) \ - (This)->lpVtbl -> QueryFilterInfo(This,pInfo) - -#define IMediaStreamFilter_JoinFilterGraph(This,pGraph,pName) \ - (This)->lpVtbl -> JoinFilterGraph(This,pGraph,pName) - -#define IMediaStreamFilter_QueryVendorInfo(This,pVendorInfo) \ - (This)->lpVtbl -> QueryVendorInfo(This,pVendorInfo) - - -#define IMediaStreamFilter_AddMediaStream(This,pAMMediaStream) \ - (This)->lpVtbl -> AddMediaStream(This,pAMMediaStream) - -#define IMediaStreamFilter_GetMediaStream(This,idPurpose,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,idPurpose,ppMediaStream) - -#define IMediaStreamFilter_EnumMediaStreams(This,Index,ppMediaStream) \ - (This)->lpVtbl -> EnumMediaStreams(This,Index,ppMediaStream) - -#define IMediaStreamFilter_SupportSeeking(This,bRenderer) \ - (This)->lpVtbl -> SupportSeeking(This,bRenderer) - -#define IMediaStreamFilter_ReferenceTimeToStreamTime(This,pTime) \ - (This)->lpVtbl -> ReferenceTimeToStreamTime(This,pTime) - -#define IMediaStreamFilter_GetCurrentStreamTime(This,pCurrentStreamTime) \ - (This)->lpVtbl -> GetCurrentStreamTime(This,pCurrentStreamTime) - -#define IMediaStreamFilter_WaitUntil(This,WaitStreamTime) \ - (This)->lpVtbl -> WaitUntil(This,WaitStreamTime) - -#define IMediaStreamFilter_Flush(This,bCancelEOS) \ - (This)->lpVtbl -> Flush(This,bCancelEOS) - -#define IMediaStreamFilter_EndOfStream(This) \ - (This)->lpVtbl -> EndOfStream(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_AddMediaStream_Proxy( - IMediaStreamFilter * This, - /* [in] */ IAMMediaStream *pAMMediaStream); - - -void __RPC_STUB IMediaStreamFilter_AddMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_GetMediaStream_Proxy( - IMediaStreamFilter * This, - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream); - - -void __RPC_STUB IMediaStreamFilter_GetMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_EnumMediaStreams_Proxy( - IMediaStreamFilter * This, - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream); - - -void __RPC_STUB IMediaStreamFilter_EnumMediaStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_SupportSeeking_Proxy( - IMediaStreamFilter * This, - /* [in] */ BOOL bRenderer); - - -void __RPC_STUB IMediaStreamFilter_SupportSeeking_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_ReferenceTimeToStreamTime_Proxy( - IMediaStreamFilter * This, - /* [out][in] */ REFERENCE_TIME *pTime); - - -void __RPC_STUB IMediaStreamFilter_ReferenceTimeToStreamTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_GetCurrentStreamTime_Proxy( - IMediaStreamFilter * This, - /* [out] */ REFERENCE_TIME *pCurrentStreamTime); - - -void __RPC_STUB IMediaStreamFilter_GetCurrentStreamTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_WaitUntil_Proxy( - IMediaStreamFilter * This, - /* [in] */ REFERENCE_TIME WaitStreamTime); - - -void __RPC_STUB IMediaStreamFilter_WaitUntil_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_Flush_Proxy( - IMediaStreamFilter * This, - /* [in] */ BOOL bCancelEOS); - - -void __RPC_STUB IMediaStreamFilter_Flush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStreamFilter_EndOfStream_Proxy( - IMediaStreamFilter * This); - - -void __RPC_STUB IMediaStreamFilter_EndOfStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaStreamFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IDirectDrawMediaSampleAllocator_INTERFACE_DEFINED__ -#define __IDirectDrawMediaSampleAllocator_INTERFACE_DEFINED__ - -/* interface IDirectDrawMediaSampleAllocator */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDirectDrawMediaSampleAllocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AB6B4AFC-F6E4-11d0-900D-00C04FD9189D") - IDirectDrawMediaSampleAllocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDirectDraw( - IDirectDraw **ppDirectDraw) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDirectDrawMediaSampleAllocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDirectDrawMediaSampleAllocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDirectDrawMediaSampleAllocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDirectDrawMediaSampleAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetDirectDraw )( - IDirectDrawMediaSampleAllocator * This, - IDirectDraw **ppDirectDraw); - - END_INTERFACE - } IDirectDrawMediaSampleAllocatorVtbl; - - interface IDirectDrawMediaSampleAllocator - { - CONST_VTBL struct IDirectDrawMediaSampleAllocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDirectDrawMediaSampleAllocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDirectDrawMediaSampleAllocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDirectDrawMediaSampleAllocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDirectDrawMediaSampleAllocator_GetDirectDraw(This,ppDirectDraw) \ - (This)->lpVtbl -> GetDirectDraw(This,ppDirectDraw) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaSampleAllocator_GetDirectDraw_Proxy( - IDirectDrawMediaSampleAllocator * This, - IDirectDraw **ppDirectDraw); - - -void __RPC_STUB IDirectDrawMediaSampleAllocator_GetDirectDraw_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDirectDrawMediaSampleAllocator_INTERFACE_DEFINED__ */ - - -#ifndef __IDirectDrawMediaSample_INTERFACE_DEFINED__ -#define __IDirectDrawMediaSample_INTERFACE_DEFINED__ - -/* interface IDirectDrawMediaSample */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDirectDrawMediaSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AB6B4AFE-F6E4-11d0-900D-00C04FD9189D") - IDirectDrawMediaSample : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetSurfaceAndReleaseLock( - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE LockMediaSamplePointer( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDirectDrawMediaSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDirectDrawMediaSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDirectDrawMediaSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDirectDrawMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetSurfaceAndReleaseLock )( - IDirectDrawMediaSample * This, - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect); - - HRESULT ( STDMETHODCALLTYPE *LockMediaSamplePointer )( - IDirectDrawMediaSample * This); - - END_INTERFACE - } IDirectDrawMediaSampleVtbl; - - interface IDirectDrawMediaSample - { - CONST_VTBL struct IDirectDrawMediaSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDirectDrawMediaSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDirectDrawMediaSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDirectDrawMediaSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDirectDrawMediaSample_GetSurfaceAndReleaseLock(This,ppDirectDrawSurface,pRect) \ - (This)->lpVtbl -> GetSurfaceAndReleaseLock(This,ppDirectDrawSurface,pRect) - -#define IDirectDrawMediaSample_LockMediaSamplePointer(This) \ - (This)->lpVtbl -> LockMediaSamplePointer(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaSample_GetSurfaceAndReleaseLock_Proxy( - IDirectDrawMediaSample * This, - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect); - - -void __RPC_STUB IDirectDrawMediaSample_GetSurfaceAndReleaseLock_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaSample_LockMediaSamplePointer_Proxy( - IDirectDrawMediaSample * This); - - -void __RPC_STUB IDirectDrawMediaSample_LockMediaSamplePointer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDirectDrawMediaSample_INTERFACE_DEFINED__ */ - - -#ifndef __IAMMediaTypeStream_INTERFACE_DEFINED__ -#define __IAMMediaTypeStream_INTERFACE_DEFINED__ - -/* interface IAMMediaTypeStream */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMMediaTypeStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AB6B4AFA-F6E4-11d0-900D-00C04FD9189D") - IAMMediaTypeStream : public IMediaStream - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFormat( - /* [out] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFormat( - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateSample( - /* [in] */ long lSampleSize, - /* [in] */ BYTE *pbBuffer, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *pUnkOuter, - /* [out] */ IAMMediaTypeSample **ppAMMediaTypeSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStreamAllocatorRequirements( - /* [out] */ ALLOCATOR_PROPERTIES *pProps) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStreamAllocatorRequirements( - /* [in] */ ALLOCATOR_PROPERTIES *pProps) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMMediaTypeStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMMediaTypeStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMMediaTypeStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMMediaTypeStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetMultiMediaStream )( - IAMMediaTypeStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IAMMediaTypeStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetSameFormat )( - IAMMediaTypeStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *AllocateSample )( - IAMMediaTypeStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *CreateSharedSample )( - IAMMediaTypeStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - HRESULT ( STDMETHODCALLTYPE *SendEndOfStream )( - IAMMediaTypeStream * This, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetFormat )( - IAMMediaTypeStream * This, - /* [out] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *SetFormat )( - IAMMediaTypeStream * This, - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *CreateSample )( - IAMMediaTypeStream * This, - /* [in] */ long lSampleSize, - /* [in] */ BYTE *pbBuffer, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *pUnkOuter, - /* [out] */ IAMMediaTypeSample **ppAMMediaTypeSample); - - HRESULT ( STDMETHODCALLTYPE *GetStreamAllocatorRequirements )( - IAMMediaTypeStream * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - HRESULT ( STDMETHODCALLTYPE *SetStreamAllocatorRequirements )( - IAMMediaTypeStream * This, - /* [in] */ ALLOCATOR_PROPERTIES *pProps); - - END_INTERFACE - } IAMMediaTypeStreamVtbl; - - interface IAMMediaTypeStream - { - CONST_VTBL struct IAMMediaTypeStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMMediaTypeStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMMediaTypeStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMMediaTypeStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMMediaTypeStream_GetMultiMediaStream(This,ppMultiMediaStream) \ - (This)->lpVtbl -> GetMultiMediaStream(This,ppMultiMediaStream) - -#define IAMMediaTypeStream_GetInformation(This,pPurposeId,pType) \ - (This)->lpVtbl -> GetInformation(This,pPurposeId,pType) - -#define IAMMediaTypeStream_SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) \ - (This)->lpVtbl -> SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) - -#define IAMMediaTypeStream_AllocateSample(This,dwFlags,ppSample) \ - (This)->lpVtbl -> AllocateSample(This,dwFlags,ppSample) - -#define IAMMediaTypeStream_CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) \ - (This)->lpVtbl -> CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) - -#define IAMMediaTypeStream_SendEndOfStream(This,dwFlags) \ - (This)->lpVtbl -> SendEndOfStream(This,dwFlags) - - -#define IAMMediaTypeStream_GetFormat(This,pMediaType,dwFlags) \ - (This)->lpVtbl -> GetFormat(This,pMediaType,dwFlags) - -#define IAMMediaTypeStream_SetFormat(This,pMediaType,dwFlags) \ - (This)->lpVtbl -> SetFormat(This,pMediaType,dwFlags) - -#define IAMMediaTypeStream_CreateSample(This,lSampleSize,pbBuffer,dwFlags,pUnkOuter,ppAMMediaTypeSample) \ - (This)->lpVtbl -> CreateSample(This,lSampleSize,pbBuffer,dwFlags,pUnkOuter,ppAMMediaTypeSample) - -#define IAMMediaTypeStream_GetStreamAllocatorRequirements(This,pProps) \ - (This)->lpVtbl -> GetStreamAllocatorRequirements(This,pProps) - -#define IAMMediaTypeStream_SetStreamAllocatorRequirements(This,pProps) \ - (This)->lpVtbl -> SetStreamAllocatorRequirements(This,pProps) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeStream_GetFormat_Proxy( - IAMMediaTypeStream * This, - /* [out] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMMediaTypeStream_GetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeStream_SetFormat_Proxy( - IAMMediaTypeStream * This, - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMMediaTypeStream_SetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeStream_CreateSample_Proxy( - IAMMediaTypeStream * This, - /* [in] */ long lSampleSize, - /* [in] */ BYTE *pbBuffer, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *pUnkOuter, - /* [out] */ IAMMediaTypeSample **ppAMMediaTypeSample); - - -void __RPC_STUB IAMMediaTypeStream_CreateSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeStream_GetStreamAllocatorRequirements_Proxy( - IAMMediaTypeStream * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - -void __RPC_STUB IAMMediaTypeStream_GetStreamAllocatorRequirements_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeStream_SetStreamAllocatorRequirements_Proxy( - IAMMediaTypeStream * This, - /* [in] */ ALLOCATOR_PROPERTIES *pProps); - - -void __RPC_STUB IAMMediaTypeStream_SetStreamAllocatorRequirements_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMMediaTypeStream_INTERFACE_DEFINED__ */ - - -#ifndef __IAMMediaTypeSample_INTERFACE_DEFINED__ -#define __IAMMediaTypeSample_INTERFACE_DEFINED__ - -/* interface IAMMediaTypeSample */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMMediaTypeSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AB6B4AFB-F6E4-11d0-900D-00C04FD9189D") - IAMMediaTypeSample : public IStreamSample - { - public: - virtual HRESULT STDMETHODCALLTYPE SetPointer( - /* [in] */ BYTE *pBuffer, - /* [in] */ long lSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPointer( - /* [out] */ BYTE **ppBuffer) = 0; - - virtual long STDMETHODCALLTYPE GetSize( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTime( - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTime( - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSyncPoint( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSyncPoint( - BOOL bIsSyncPoint) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsPreroll( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPreroll( - BOOL bIsPreroll) = 0; - - virtual long STDMETHODCALLTYPE GetActualDataLength( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetActualDataLength( - long __MIDL_0017) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaType( - AM_MEDIA_TYPE **ppMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - AM_MEDIA_TYPE *pMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsDiscontinuity( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDiscontinuity( - BOOL bDiscontinuity) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaTime( - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaTime( - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMMediaTypeSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMMediaTypeSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMMediaTypeSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IAMMediaTypeSample * This, - /* [in] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetSampleTimes )( - IAMMediaTypeSample * This, - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *SetSampleTimes )( - IAMMediaTypeSample * This, - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime); - - HRESULT ( STDMETHODCALLTYPE *Update )( - IAMMediaTypeSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData); - - HRESULT ( STDMETHODCALLTYPE *CompletionStatus )( - IAMMediaTypeSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds); - - HRESULT ( STDMETHODCALLTYPE *SetPointer )( - IAMMediaTypeSample * This, - /* [in] */ BYTE *pBuffer, - /* [in] */ long lSize); - - HRESULT ( STDMETHODCALLTYPE *GetPointer )( - IAMMediaTypeSample * This, - /* [out] */ BYTE **ppBuffer); - - long ( STDMETHODCALLTYPE *GetSize )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IAMMediaTypeSample * This, - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetTime )( - IAMMediaTypeSample * This, - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *IsSyncPoint )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetSyncPoint )( - IAMMediaTypeSample * This, - BOOL bIsSyncPoint); - - HRESULT ( STDMETHODCALLTYPE *IsPreroll )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetPreroll )( - IAMMediaTypeSample * This, - BOOL bIsPreroll); - - long ( STDMETHODCALLTYPE *GetActualDataLength )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetActualDataLength )( - IAMMediaTypeSample * This, - long __MIDL_0017); - - HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IAMMediaTypeSample * This, - AM_MEDIA_TYPE **ppMediaType); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IAMMediaTypeSample * This, - AM_MEDIA_TYPE *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *IsDiscontinuity )( - IAMMediaTypeSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetDiscontinuity )( - IAMMediaTypeSample * This, - BOOL bDiscontinuity); - - HRESULT ( STDMETHODCALLTYPE *GetMediaTime )( - IAMMediaTypeSample * This, - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetMediaTime )( - IAMMediaTypeSample * This, - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd); - - END_INTERFACE - } IAMMediaTypeSampleVtbl; - - interface IAMMediaTypeSample - { - CONST_VTBL struct IAMMediaTypeSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMMediaTypeSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMMediaTypeSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMMediaTypeSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMMediaTypeSample_GetMediaStream(This,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,ppMediaStream) - -#define IAMMediaTypeSample_GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) \ - (This)->lpVtbl -> GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) - -#define IAMMediaTypeSample_SetSampleTimes(This,pStartTime,pEndTime) \ - (This)->lpVtbl -> SetSampleTimes(This,pStartTime,pEndTime) - -#define IAMMediaTypeSample_Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) \ - (This)->lpVtbl -> Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) - -#define IAMMediaTypeSample_CompletionStatus(This,dwFlags,dwMilliseconds) \ - (This)->lpVtbl -> CompletionStatus(This,dwFlags,dwMilliseconds) - - -#define IAMMediaTypeSample_SetPointer(This,pBuffer,lSize) \ - (This)->lpVtbl -> SetPointer(This,pBuffer,lSize) - -#define IAMMediaTypeSample_GetPointer(This,ppBuffer) \ - (This)->lpVtbl -> GetPointer(This,ppBuffer) - -#define IAMMediaTypeSample_GetSize(This) \ - (This)->lpVtbl -> GetSize(This) - -#define IAMMediaTypeSample_GetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetTime(This,pTimeStart,pTimeEnd) - -#define IAMMediaTypeSample_SetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetTime(This,pTimeStart,pTimeEnd) - -#define IAMMediaTypeSample_IsSyncPoint(This) \ - (This)->lpVtbl -> IsSyncPoint(This) - -#define IAMMediaTypeSample_SetSyncPoint(This,bIsSyncPoint) \ - (This)->lpVtbl -> SetSyncPoint(This,bIsSyncPoint) - -#define IAMMediaTypeSample_IsPreroll(This) \ - (This)->lpVtbl -> IsPreroll(This) - -#define IAMMediaTypeSample_SetPreroll(This,bIsPreroll) \ - (This)->lpVtbl -> SetPreroll(This,bIsPreroll) - -#define IAMMediaTypeSample_GetActualDataLength(This) \ - (This)->lpVtbl -> GetActualDataLength(This) - -#define IAMMediaTypeSample_SetActualDataLength(This,__MIDL_0017) \ - (This)->lpVtbl -> SetActualDataLength(This,__MIDL_0017) - -#define IAMMediaTypeSample_GetMediaType(This,ppMediaType) \ - (This)->lpVtbl -> GetMediaType(This,ppMediaType) - -#define IAMMediaTypeSample_SetMediaType(This,pMediaType) \ - (This)->lpVtbl -> SetMediaType(This,pMediaType) - -#define IAMMediaTypeSample_IsDiscontinuity(This) \ - (This)->lpVtbl -> IsDiscontinuity(This) - -#define IAMMediaTypeSample_SetDiscontinuity(This,bDiscontinuity) \ - (This)->lpVtbl -> SetDiscontinuity(This,bDiscontinuity) - -#define IAMMediaTypeSample_GetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetMediaTime(This,pTimeStart,pTimeEnd) - -#define IAMMediaTypeSample_SetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetMediaTime(This,pTimeStart,pTimeEnd) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetPointer_Proxy( - IAMMediaTypeSample * This, - /* [in] */ BYTE *pBuffer, - /* [in] */ long lSize); - - -void __RPC_STUB IAMMediaTypeSample_SetPointer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_GetPointer_Proxy( - IAMMediaTypeSample * This, - /* [out] */ BYTE **ppBuffer); - - -void __RPC_STUB IAMMediaTypeSample_GetPointer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -long STDMETHODCALLTYPE IAMMediaTypeSample_GetSize_Proxy( - IAMMediaTypeSample * This); - - -void __RPC_STUB IAMMediaTypeSample_GetSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_GetTime_Proxy( - IAMMediaTypeSample * This, - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd); - - -void __RPC_STUB IAMMediaTypeSample_GetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetTime_Proxy( - IAMMediaTypeSample * This, - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd); - - -void __RPC_STUB IAMMediaTypeSample_SetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_IsSyncPoint_Proxy( - IAMMediaTypeSample * This); - - -void __RPC_STUB IAMMediaTypeSample_IsSyncPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetSyncPoint_Proxy( - IAMMediaTypeSample * This, - BOOL bIsSyncPoint); - - -void __RPC_STUB IAMMediaTypeSample_SetSyncPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_IsPreroll_Proxy( - IAMMediaTypeSample * This); - - -void __RPC_STUB IAMMediaTypeSample_IsPreroll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetPreroll_Proxy( - IAMMediaTypeSample * This, - BOOL bIsPreroll); - - -void __RPC_STUB IAMMediaTypeSample_SetPreroll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -long STDMETHODCALLTYPE IAMMediaTypeSample_GetActualDataLength_Proxy( - IAMMediaTypeSample * This); - - -void __RPC_STUB IAMMediaTypeSample_GetActualDataLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetActualDataLength_Proxy( - IAMMediaTypeSample * This, - long __MIDL_0017); - - -void __RPC_STUB IAMMediaTypeSample_SetActualDataLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_GetMediaType_Proxy( - IAMMediaTypeSample * This, - AM_MEDIA_TYPE **ppMediaType); - - -void __RPC_STUB IAMMediaTypeSample_GetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetMediaType_Proxy( - IAMMediaTypeSample * This, - AM_MEDIA_TYPE *pMediaType); - - -void __RPC_STUB IAMMediaTypeSample_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_IsDiscontinuity_Proxy( - IAMMediaTypeSample * This); - - -void __RPC_STUB IAMMediaTypeSample_IsDiscontinuity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetDiscontinuity_Proxy( - IAMMediaTypeSample * This, - BOOL bDiscontinuity); - - -void __RPC_STUB IAMMediaTypeSample_SetDiscontinuity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_GetMediaTime_Proxy( - IAMMediaTypeSample * This, - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd); - - -void __RPC_STUB IAMMediaTypeSample_GetMediaTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMMediaTypeSample_SetMediaTime_Proxy( - IAMMediaTypeSample * This, - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd); - - -void __RPC_STUB IAMMediaTypeSample_SetMediaTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMMediaTypeSample_INTERFACE_DEFINED__ */ - - - -#ifndef __DirectShowStreamLib_LIBRARY_DEFINED__ -#define __DirectShowStreamLib_LIBRARY_DEFINED__ - -/* library DirectShowStreamLib */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_DirectShowStreamLib; - -EXTERN_C const CLSID CLSID_AMMultiMediaStream; - -#ifdef __cplusplus - -class DECLSPEC_UUID("49c47ce5-9ba4-11d0-8212-00c04fc32c45") -AMMultiMediaStream; -#endif -#endif /* __DirectShowStreamLib_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_amstream_0410 */ -/* [local] */ - -#ifndef __cplusplus -EXTERN_C const CLSID CLSID_AMMultiMediaStream; -#endif -DEFINE_GUID(CLSID_AMDirectDrawStream, /* 49c47ce4-9ba4-11d0-8212-00c04fc32c45 */ -0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45); -DEFINE_GUID(CLSID_AMAudioStream, /* 8496e040-af4c-11d0-8212-00c04fc32c45 */ -0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45); -DEFINE_GUID(CLSID_AMAudioData, /* f2468580-af8a-11d0-8212-00c04fc32c45 */ -0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45); -DEFINE_GUID(CLSID_AMMediaTypeStream, /* CF0F2F7C-F7BF-11d0-900D-00C04FD9189D */ -0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0xd, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); - - -extern RPC_IF_HANDLE __MIDL_itf_amstream_0410_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_amstream_0410_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/amva.h b/import/DirectX8/include/amva.h deleted file mode 100644 index fd46164fe..000000000 --- a/import/DirectX8/include/amva.h +++ /dev/null @@ -1,85 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMVA.h -// -// Desc: DirectShowMotionComp include file. -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __AMVA_INCLUDED__ -#define __AMVA_INCLUDED__ - -#ifdef __cplusplus -extern "C" { -#endif - - -#define AMVA_TYPEINDEX_OUTPUTFRAME 0xFFFFFFFF - -// Flags for QueryRenderStatus -#define AMVA_QUERYRENDERSTATUSF_READ 0x00000001 // Query for read - // set this bit to 0 - // if query for update - -typedef struct _tag_AMVAUncompBufferInfo -{ - DWORD dwMinNumSurfaces; // IN min number of surfaces to be allocated - DWORD dwMaxNumSurfaces; // IN max number of surfaces to be allocated - DDPIXELFORMAT ddUncompPixelFormat; // IN pixel format of surfaces to be allocated -} AMVAUncompBufferInfo, *LPAMVAUncompBufferInfo; - -typedef struct _tag_AMVAUncompDataInfo -{ - DWORD dwUncompWidth; // [in] width of uncompressed data - DWORD dwUncompHeight; // [in] height of uncompressed data - DDPIXELFORMAT ddUncompPixelFormat; // [in] pixel-format of uncompressed data -} AMVAUncompDataInfo, *LPAMVAUncompDataInfo; - -typedef struct _tag_AMVAInternalMemInfo -{ - DWORD dwScratchMemAlloc; // [out] amount of scratch memory will the hal allocate for its private use -} AMVAInternalMemInfo, *LPAMVAInternalMemInfo; - - -typedef struct _tag_AMVACompBufferInfo -{ - DWORD dwNumCompBuffers; // [out] number of buffers reqd for compressed data - DWORD dwWidthToCreate; // [out] Width of surface to create - DWORD dwHeightToCreate; // [out] Height of surface to create - DWORD dwBytesToAllocate; // [out] Total number of bytes used by each surface - DDSCAPS2 ddCompCaps; // [out] caps to create surfaces to store compressed data - DDPIXELFORMAT ddPixelFormat; // [out] fourcc to create surfaces to store compressed data -} AMVACompBufferInfo, *LPAMVACompBufferInfo; - - -// Note that you are NOT allowed to store any pointer in pMiscData -typedef struct _tag_AMVABeginFrameInfo -{ - DWORD dwDestSurfaceIndex; // IN destination buffer in which to decoding this frame - LPVOID pInputData; // IN pointer to misc data - DWORD dwSizeInputData; // IN size of other misc data to begin frame - LPVOID pOutputData; // OUT pointer to data which the VGA is going to fill - DWORD dwSizeOutputData; // IN size of data which the VGA is going to fill -} AMVABeginFrameInfo, *LPAMVABeginFrameInfo; - -// Note that you are NOT allowed to store any pointer in pMiscData -typedef struct _tag_AMVAEndFrameInfo -{ - DWORD dwSizeMiscData; // [in] size of other misc data to begin frame - LPVOID pMiscData; // [in] pointer to misc data -} AMVAEndFrameInfo, *LPAMVAEndFrameInfo; - -typedef struct _tag_AMVABUFFERINFO -{ - DWORD dwTypeIndex; // [in] Type of buffer - DWORD dwBufferIndex; // [in] Buffer index - DWORD dwDataOffset; // [in] offset of relevant data from the beginning of buffer - DWORD dwDataSize; // [in] size of relevant data -} AMVABUFFERINFO, *LPAMVABUFFERINFO; - -#ifdef __cplusplus -}; -#endif - -#endif // _AMVA_INCLUDED diff --git a/import/DirectX8/include/amvideo.h b/import/DirectX8/include/amvideo.h deleted file mode 100644 index ebdbb70d8..000000000 --- a/import/DirectX8/include/amvideo.h +++ /dev/null @@ -1,433 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AMVideo.h -// -// Desc: Video related definitions and interfaces for ActiveMovie. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __AMVIDEO__ -#define __AMVIDEO__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#include - - -// This is an interface on the video renderer that provides information about -// DirectDraw with respect to its use by the renderer. For example it allows -// an application to get details of the surface and any hardware capabilities -// that are available. It also allows someone to adjust the surfaces that the -// renderer should use and furthermore even set the DirectDraw instance. We -// allow someone to set the DirectDraw instance because DirectDraw can only -// be opened once per process so it helps resolve conflicts. There is some -// duplication in this interface as the hardware/emulated/FOURCCs available -// can all be found through the IDirectDraw interface, this interface allows -// simple access to that information without calling the DirectDraw provider -// itself. The AMDDS prefix is ActiveMovie DirectDraw Switches abbreviated. - -#define AMDDS_NONE 0x00 // No use for DCI/DirectDraw -#define AMDDS_DCIPS 0x01 // Use DCI primary surface -#define AMDDS_PS 0x02 // Use DirectDraw primary -#define AMDDS_RGBOVR 0x04 // RGB overlay surfaces -#define AMDDS_YUVOVR 0x08 // YUV overlay surfaces -#define AMDDS_RGBOFF 0x10 // RGB offscreen surfaces -#define AMDDS_YUVOFF 0x20 // YUV offscreen surfaces -#define AMDDS_RGBFLP 0x40 // RGB flipping surfaces -#define AMDDS_YUVFLP 0x80 // YUV flipping surfaces -#define AMDDS_ALL 0xFF // ALL the previous flags -#define AMDDS_DEFAULT AMDDS_ALL // Use all available surfaces - -#define AMDDS_YUV (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP) -#define AMDDS_RGB (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP) -#define AMDDS_PRIMARY (AMDDS_DCIPS | AMDDS_PS) - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IDirectDrawVideo - -DECLARE_INTERFACE_(IDirectDrawVideo, IUnknown) -{ - // IUnknown methods - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // IDirectDrawVideo methods - - STDMETHOD(GetSwitches)(THIS_ DWORD *pSwitches) PURE; - STDMETHOD(SetSwitches)(THIS_ DWORD Switches) PURE; - STDMETHOD(GetCaps)(THIS_ DDCAPS *pCaps) PURE; - STDMETHOD(GetEmulatedCaps)(THIS_ DDCAPS *pCaps) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ DDSURFACEDESC *pSurfaceDesc) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ DWORD *pCount,DWORD *pCodes) PURE; - STDMETHOD(SetDirectDraw)(THIS_ LPDIRECTDRAW pDirectDraw) PURE; - STDMETHOD(GetDirectDraw)(THIS_ LPDIRECTDRAW *ppDirectDraw) PURE; - STDMETHOD(GetSurfaceType)(THIS_ DWORD *pSurfaceType) PURE; - STDMETHOD(SetDefault)(THIS) PURE; - STDMETHOD(UseScanLine)(THIS_ long UseScanLine) PURE; - STDMETHOD(CanUseScanLine)(THIS_ long *UseScanLine) PURE; - STDMETHOD(UseOverlayStretch)(THIS_ long UseOverlayStretch) PURE; - STDMETHOD(CanUseOverlayStretch)(THIS_ long *UseOverlayStretch) PURE; - STDMETHOD(UseWhenFullScreen)(THIS_ long UseWhenFullScreen) PURE; - STDMETHOD(WillUseFullScreen)(THIS_ long *UseWhenFullScreen) PURE; -}; - - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IQualProp - -DECLARE_INTERFACE_(IQualProp, IUnknown) -{ - // IUnknown methods - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Compare these with the functions in class CGargle in gargle.h - - STDMETHOD(get_FramesDroppedInRenderer)(THIS_ int *pcFrames) PURE; // Out - STDMETHOD(get_FramesDrawn)(THIS_ int *pcFramesDrawn) PURE; // Out - STDMETHOD(get_AvgFrameRate)(THIS_ int *piAvgFrameRate) PURE; // Out - STDMETHOD(get_Jitter)(THIS_ int *iJitter) PURE; // Out - STDMETHOD(get_AvgSyncOffset)(THIS_ int *piAvg) PURE; // Out - STDMETHOD(get_DevSyncOffset)(THIS_ int *piDev) PURE; // Out -}; - - -// This interface allows an application or plug in distributor to control a -// full screen renderer. The Modex renderer supports this interface. When -// connected a renderer should load the display modes it has available -// The number of modes available can be obtained through CountModes. Then -// information on each individual mode is available by calling GetModeInfo -// and IsModeAvailable. An application may enable and disable any modes -// by calling the SetEnabled flag with OATRUE or OAFALSE (not C/C++ TRUE -// and FALSE values) - the current value may be queried by IsModeEnabled - -// A more generic way of setting the modes enabled that is easier to use -// when writing applications is the clip loss factor. This defines the -// amount of video that can be lost when deciding which display mode to -// use. Assuming the decoder cannot compress the video then playing an -// MPEG file (say 352x288) into a 320x200 display will lose about 25% of -// the image. The clip loss factor specifies the upper range permissible. -// To allow typical MPEG video to be played in 320x200 it defaults to 25% - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IFullScreenVideo - -DECLARE_INTERFACE_(IFullScreenVideo, IUnknown) -{ - // IUnknown methods - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // IFullScreenVideo methods - - STDMETHOD(CountModes)(THIS_ long *pModes) PURE; - STDMETHOD(GetModeInfo)(THIS_ long Mode,long *pWidth,long *pHeight,long *pDepth) PURE; - STDMETHOD(GetCurrentMode)(THIS_ long *pMode) PURE; - STDMETHOD(IsModeAvailable)(THIS_ long Mode) PURE; - STDMETHOD(IsModeEnabled)(THIS_ long Mode) PURE; - STDMETHOD(SetEnabled)(THIS_ long Mode,long bEnabled) PURE; - STDMETHOD(GetClipFactor)(THIS_ long *pClipFactor) PURE; - STDMETHOD(SetClipFactor)(THIS_ long ClipFactor) PURE; - STDMETHOD(SetMessageDrain)(THIS_ HWND hwnd) PURE; - STDMETHOD(GetMessageDrain)(THIS_ HWND *hwnd) PURE; - STDMETHOD(SetMonitor)(THIS_ long Monitor) PURE; - STDMETHOD(GetMonitor)(THIS_ long *Monitor) PURE; - STDMETHOD(HideOnDeactivate)(THIS_ long Hide) PURE; - STDMETHOD(IsHideOnDeactivate)(THIS) PURE; - STDMETHOD(SetCaption)(THIS_ BSTR strCaption) PURE; - STDMETHOD(GetCaption)(THIS_ BSTR *pstrCaption) PURE; - STDMETHOD(SetDefault)(THIS) PURE; -}; - - -// This adds the accelerator table capabilities in fullscreen. This is being -// added between the original runtime release and the full SDK release. We -// cannot just add the method to IFullScreenVideo as we don't want to force -// applications to have to ship the ActiveMovie support DLLs - this is very -// important to applications that plan on being downloaded over the Internet - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IFullScreenVideoEx - -DECLARE_INTERFACE_(IFullScreenVideoEx, IFullScreenVideo) -{ - // IUnknown methods - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // IFullScreenVideo methods - - STDMETHOD(CountModes)(THIS_ long *pModes) PURE; - STDMETHOD(GetModeInfo)(THIS_ long Mode,long *pWidth,long *pHeight,long *pDepth) PURE; - STDMETHOD(GetCurrentMode)(THIS_ long *pMode) PURE; - STDMETHOD(IsModeAvailable)(THIS_ long Mode) PURE; - STDMETHOD(IsModeEnabled)(THIS_ long Mode) PURE; - STDMETHOD(SetEnabled)(THIS_ long Mode,long bEnabled) PURE; - STDMETHOD(GetClipFactor)(THIS_ long *pClipFactor) PURE; - STDMETHOD(SetClipFactor)(THIS_ long ClipFactor) PURE; - STDMETHOD(SetMessageDrain)(THIS_ HWND hwnd) PURE; - STDMETHOD(GetMessageDrain)(THIS_ HWND *hwnd) PURE; - STDMETHOD(SetMonitor)(THIS_ long Monitor) PURE; - STDMETHOD(GetMonitor)(THIS_ long *Monitor) PURE; - STDMETHOD(HideOnDeactivate)(THIS_ long Hide) PURE; - STDMETHOD(IsHideOnDeactivate)(THIS) PURE; - STDMETHOD(SetCaption)(THIS_ BSTR strCaption) PURE; - STDMETHOD(GetCaption)(THIS_ BSTR *pstrCaption) PURE; - STDMETHOD(SetDefault)(THIS) PURE; - - // IFullScreenVideoEx - - STDMETHOD(SetAcceleratorTable)(THIS_ HWND hwnd,HACCEL hAccel) PURE; - STDMETHOD(GetAcceleratorTable)(THIS_ HWND *phwnd,HACCEL *phAccel) PURE; - STDMETHOD(KeepPixelAspectRatio)(THIS_ long KeepAspect) PURE; - STDMETHOD(IsKeepPixelAspectRatio)(THIS_ long *pKeepAspect) PURE; -}; - - -// The SDK base classes contain a base video mixer class. Video mixing in a -// software environment is tricky because we typically have multiple streams -// each sending data at unpredictable times. To work with this we defined a -// pin that is the lead pin, when data arrives on this pin we do a mix. As -// an alternative we may not want to have a lead pin but output samples at -// predefined spaces, like one every 1/15 of a second, this interfaces also -// supports that mode of operations (there is a working video mixer sample) - -// be nice to our friends in C -#undef INTERFACE -#define INTERFACE IBaseVideoMixer - -DECLARE_INTERFACE_(IBaseVideoMixer, IUnknown) -{ - STDMETHOD(SetLeadPin)(THIS_ int iPin) PURE; - STDMETHOD(GetLeadPin)(THIS_ int *piPin) PURE; - STDMETHOD(GetInputPinCount)(THIS_ int *piPinCount) PURE; - STDMETHOD(IsUsingClock)(THIS_ int *pbValue) PURE; - STDMETHOD(SetUsingClock)(THIS_ int bValue) PURE; - STDMETHOD(GetClockPeriod)(THIS_ int *pbValue) PURE; - STDMETHOD(SetClockPeriod)(THIS_ int bValue) PURE; -}; - -#define iPALETTE_COLORS 256 // Maximum colours in palette -#define iEGA_COLORS 16 // Number colours in EGA palette -#define iMASK_COLORS 3 // Maximum three components -#define iTRUECOLOR 16 // Minimum true colour device -#define iRED 0 // Index position for RED mask -#define iGREEN 1 // Index position for GREEN mask -#define iBLUE 2 // Index position for BLUE mask -#define iPALETTE 8 // Maximum colour depth using a palette -#define iMAXBITS 8 // Maximum bits per colour component - - -// Used for true colour images that also have a palette - -typedef struct tag_TRUECOLORINFO { - DWORD dwBitMasks[iMASK_COLORS]; - RGBQUAD bmiColors[iPALETTE_COLORS]; -} TRUECOLORINFO; - - -// The BITMAPINFOHEADER contains all the details about the video stream such -// as the actual image dimensions and their pixel depth. A source filter may -// also request that the sink take only a section of the video by providing a -// clipping rectangle in rcSource. In the worst case where the sink filter -// forgets to check this on connection it will simply render the whole thing -// which isn't a disaster. Ideally a sink filter will check the rcSource and -// if it doesn't support image extraction and the rectangle is not empty then -// it will reject the connection. A filter should use SetRectEmpty to reset a -// rectangle to all zeroes (and IsRectEmpty to later check the rectangle). -// The rcTarget specifies the destination rectangle for the video, for most -// source filters they will set this to all zeroes, a downstream filter may -// request that the video be placed in a particular area of the buffers it -// supplies in which case it will call QueryAccept with a non empty target - -typedef struct tagVIDEOINFOHEADER { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - BITMAPINFOHEADER bmiHeader; - -} VIDEOINFOHEADER; - -// make sure the pbmi is initialized before using these macros -#define TRUECOLOR(pbmi) ((TRUECOLORINFO *)(((LPBYTE)&((pbmi)->bmiHeader)) \ - + (pbmi)->bmiHeader.biSize)) -#define COLORS(pbmi) ((RGBQUAD *)(((LPBYTE)&((pbmi)->bmiHeader)) \ - + (pbmi)->bmiHeader.biSize)) -#define BITMASKS(pbmi) ((DWORD *)(((LPBYTE)&((pbmi)->bmiHeader)) \ - + (pbmi)->bmiHeader.biSize)) - -// All the image based filters use this to communicate their media types. It's -// centred principally around the BITMAPINFO. This structure always contains a -// BITMAPINFOHEADER followed by a number of other fields depending on what the -// BITMAPINFOHEADER contains. If it contains details of a palettised format it -// will be followed by one or more RGBQUADs defining the palette. If it holds -// details of a true colour format then it may be followed by a set of three -// DWORD bit masks that specify where the RGB data can be found in the image -// (For more information regarding BITMAPINFOs see the Win32 documentation) - -// The rcSource and rcTarget fields are not for use by filters supplying the -// data. The destination (target) rectangle should be set to all zeroes. The -// source may also be zero filled or set with the dimensions of the video. So -// if the video is 352x288 pixels then set it to (0,0,352,288). These fields -// are mainly used by downstream filters that want to ask the source filter -// to place the image in a different position in an output buffer. So when -// using for example the primary surface the video renderer may ask a filter -// to place the video images in a destination position of (100,100,452,388) -// on the display since that's where the window is positioned on the display - -// !!! WARNING !!! -// DO NOT use this structure unless you are sure that the BITMAPINFOHEADER -// has a normal biSize == sizeof(BITMAPINFOHEADER) ! -// !!! WARNING !!! - -typedef struct tagVIDEOINFO { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - BITMAPINFOHEADER bmiHeader; - - union { - RGBQUAD bmiColors[iPALETTE_COLORS]; // Colour palette - DWORD dwBitMasks[iMASK_COLORS]; // True colour masks - TRUECOLORINFO TrueColorInfo; // Both of the above - }; - -} VIDEOINFO; - -// These macros define some standard bitmap format sizes - -#define SIZE_EGA_PALETTE (iEGA_COLORS * sizeof(RGBQUAD)) -#define SIZE_PALETTE (iPALETTE_COLORS * sizeof(RGBQUAD)) -#define SIZE_MASKS (iMASK_COLORS * sizeof(DWORD)) -#define SIZE_PREHEADER (FIELD_OFFSET(VIDEOINFOHEADER,bmiHeader)) -#define SIZE_VIDEOHEADER (sizeof(BITMAPINFOHEADER) + SIZE_PREHEADER) -// !!! for abnormal biSizes -// #define SIZE_VIDEOHEADER(pbmi) ((pbmi)->bmiHeader.biSize + SIZE_PREHEADER) - -// DIBSIZE calculates the number of bytes required by an image - -#define WIDTHBYTES(bits) ((DWORD)(((bits)+31) & (~31)) / 8) -#define DIBWIDTHBYTES(bi) (DWORD)WIDTHBYTES((DWORD)(bi).biWidth * (DWORD)(bi).biBitCount) -#define _DIBSIZE(bi) (DIBWIDTHBYTES(bi) * (DWORD)(bi).biHeight) -#define DIBSIZE(bi) ((bi).biHeight < 0 ? (-1)*(_DIBSIZE(bi)) : _DIBSIZE(bi)) - -// This compares the bit masks between two VIDEOINFOHEADERs - -#define BIT_MASKS_MATCH(pbmi1,pbmi2) \ - (((pbmi1)->dwBitMasks[iRED] == (pbmi2)->dwBitMasks[iRED]) && \ - ((pbmi1)->dwBitMasks[iGREEN] == (pbmi2)->dwBitMasks[iGREEN]) && \ - ((pbmi1)->dwBitMasks[iBLUE] == (pbmi2)->dwBitMasks[iBLUE])) - -// These zero fill different parts of the VIDEOINFOHEADER structure - -// Only use these macros for pbmi's with a normal BITMAPINFOHEADER biSize -#define RESET_MASKS(pbmi) (ZeroMemory((PVOID)(pbmi)->dwBitFields,SIZE_MASKS)) -#define RESET_HEADER(pbmi) (ZeroMemory((PVOID)(pbmi),SIZE_VIDEOHEADER)) -#define RESET_PALETTE(pbmi) (ZeroMemory((PVOID)(pbmi)->bmiColors,SIZE_PALETTE)); - -#if 0 -// !!! This is the right way to do it, but may break existing code -#define RESET_MASKS(pbmi) (ZeroMemory((PVOID)(((LPBYTE)(pbmi)->bmiHeader) + \ - (pbmi)->bmiHeader.biSize,SIZE_MASKS))) -#define RESET_HEADER(pbmi) (ZeroMemory((PVOID)(pbmi), SIZE_PREHEADER + \ - sizeof(BITMAPINFOHEADER))) -#define RESET_PALETTE(pbmi) (ZeroMemory((PVOID)(((LPBYTE)(pbmi)->bmiHeader) + \ - (pbmi)->bmiHeader.biSize,SIZE_PALETTE)) -#endif - -// Other (hopefully) useful bits and bobs - -#define PALETTISED(pbmi) ((pbmi)->bmiHeader.biBitCount <= iPALETTE) -#define PALETTE_ENTRIES(pbmi) ((DWORD) 1 << (pbmi)->bmiHeader.biBitCount) - -// Returns the address of the BITMAPINFOHEADER from the VIDEOINFOHEADER -#define HEADER(pVideoInfo) (&(((VIDEOINFOHEADER *) (pVideoInfo))->bmiHeader)) - - -// MPEG variant - includes a DWORD length followed by the -// video sequence header after the video header. -// -// The sequence header includes the sequence header start code and the -// quantization matrices associated with the first sequence header in the -// stream so is a maximum of 140 bytes long. - -typedef struct tagMPEG1VIDEOINFO { - - VIDEOINFOHEADER hdr; // Compatible with VIDEOINFO - DWORD dwStartTimeCode; // 25-bit Group of pictures time code - // at start of data - DWORD cbSequenceHeader; // Length in bytes of bSequenceHeader - BYTE bSequenceHeader[1]; // Sequence header including - // quantization matrices if any -} MPEG1VIDEOINFO; - -#define MAX_SIZE_MPEG1_SEQUENCE_INFO 140 -#define SIZE_MPEG1VIDEOINFO(pv) (FIELD_OFFSET(MPEG1VIDEOINFO, bSequenceHeader[0]) + (pv)->cbSequenceHeader) -#define MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - - -// Analog video variant - Use this when the format is FORMAT_AnalogVideo -// -// rcSource defines the portion of the active video signal to use -// rcTarget defines the destination rectangle -// both of the above are relative to the dwActiveWidth and dwActiveHeight fields -// dwActiveWidth is currently set to 720 for all formats (but could change for HDTV) -// dwActiveHeight is 483 for NTSC and 575 for PAL/SECAM (but could change for HDTV) - -typedef struct tagAnalogVideoInfo { - RECT rcSource; // Width max is 720, height varies w/ TransmissionStd - RECT rcTarget; // Where the video should go - DWORD dwActiveWidth; // Always 720 (CCIR-601 active samples per line) - DWORD dwActiveHeight; // 483 for NTSC, 575 for PAL/SECAM - REFERENCE_TIME AvgTimePerFrame; // Normal ActiveMovie units (100 nS) -} ANALOGVIDEOINFO; - -// -// AM_KSPROPSETID_FrameStep property set definitions -// -typedef enum { - // Step - AM_PROPERTY_FRAMESTEP_STEP = 0x01, - AM_PROPERTY_FRAMESTEP_CANCEL = 0x02, - - // S_OK for these 2 means we can - S_FALSE if we can't - AM_PROPERTY_FRAMESTEP_CANSTEP = 0x03, - AM_PROPERTY_FRAMESTEP_CANSTEPMULTIPLE = 0x04 -} AM_PROPERTY_FRAMESTEP; - -typedef struct _AM_FRAMESTEP_STEP -{ - // 1 means step 1 frame forward - // 0 is invalid - // n (n > 1) means skip n - 1 frames and show the nth - DWORD dwFramesToStep; -} AM_FRAMESTEP_STEP; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __AMVIDEO__ - diff --git a/import/DirectX8/include/atsmedia.h b/import/DirectX8/include/atsmedia.h deleted file mode 100644 index 3e268a555..000000000 --- a/import/DirectX8/include/atsmedia.h +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// File: ATSMedia.h -// -// Desc: Broadcast Driver Architecture Media Definitions for ATSC -// -// Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#if !defined(_KSMEDIA_) -#error KSMEDIA.H must be included before BDAMEDIA.H -#endif // !defined(_KSMEDIA_) - -#if !defined(_BDAMEDIA_) -#error BDAMEDIA.H must be included before ATSCMEDIA.H -#endif // !defined(_KSMEDIA_) - -#if !defined(_ATSCMEDIA_) -#define _ATSCMEDIA_ - - -//=========================================================================== -// -// ATSC Network Type -// -//=========================================================================== - -#define STATIC_BDANETWORKTYPE_ATSC\ - 0x71985f51, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F51-1CA1-11d3-9CC8-00C04F7971E0", BDANETWORKTYPE_ATSC); -#define BDANETWORKTYPE_ATSC DEFINE_GUIDNAMED(BDANETWORKTYPE_ATSC) - - -#endif // _ATSCMEDIA_ diff --git a/import/DirectX8/include/audevcod.h b/import/DirectX8/include/audevcod.h deleted file mode 100644 index 98dfbfc28..000000000 --- a/import/DirectX8/include/audevcod.h +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AudEvCod.h -// -// Desc: List of Audio device error event codes and the expected params. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - - -#ifndef __AUDEVCOD__ -#define __AUDEVCOD__ - - -#define EC_SND_DEVICE_ERROR_BASE 0x0200 - -typedef enum _tagSND_DEVICE_ERROR { - - SNDDEV_ERROR_Open=1, - SNDDEV_ERROR_Close=2, - SNDDEV_ERROR_GetCaps=3, - SNDDEV_ERROR_PrepareHeader=4, - SNDDEV_ERROR_UnprepareHeader=5, - SNDDEV_ERROR_Reset=6, - SNDDEV_ERROR_Restart=7, - SNDDEV_ERROR_GetPosition=8, - SNDDEV_ERROR_Write=9, - SNDDEV_ERROR_Pause=10, - SNDDEV_ERROR_Stop=11, - SNDDEV_ERROR_Start=12, - SNDDEV_ERROR_AddBuffer=13, - SNDDEV_ERROR_Query=14, - -} SNDDEV_ERR; - - -// Sound device error event codes -// ============================== -// -// All audio device error events are always passed on to the application, and are -// never processed by the filter graph - - -#define EC_SNDDEV_IN_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x00) -#define EC_SNDDEV_OUT_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x01) -// Parameters: ( DWORD, DWORD) -// lParam1 is an enum SND_DEVICE_ERROR which notifies the app how the device was -// being accessed when the failure occurred. -// -// lParam2 is the error returned from the sound device call. -// - -#endif // __AUDEVCOD__ diff --git a/import/DirectX8/include/austream.h b/import/DirectX8/include/austream.h deleted file mode 100644 index 43f653e50..000000000 --- a/import/DirectX8/include/austream.h +++ /dev/null @@ -1,715 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for austream.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __austream_h__ -#define __austream_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IAudioMediaStream_FWD_DEFINED__ -#define __IAudioMediaStream_FWD_DEFINED__ -typedef interface IAudioMediaStream IAudioMediaStream; -#endif /* __IAudioMediaStream_FWD_DEFINED__ */ - - -#ifndef __IAudioStreamSample_FWD_DEFINED__ -#define __IAudioStreamSample_FWD_DEFINED__ -typedef interface IAudioStreamSample IAudioStreamSample; -#endif /* __IAudioStreamSample_FWD_DEFINED__ */ - - -#ifndef __IMemoryData_FWD_DEFINED__ -#define __IMemoryData_FWD_DEFINED__ -typedef interface IMemoryData IMemoryData; -#endif /* __IMemoryData_FWD_DEFINED__ */ - - -#ifndef __IAudioData_FWD_DEFINED__ -#define __IAudioData_FWD_DEFINED__ -typedef interface IAudioData IAudioData; -#endif /* __IAudioData_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "mmstream.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_austream_0000 */ -/* [local] */ - -// -// The following declarations within the 'if 0' block are dummy typedefs used to make -// the ddstream.idl file build. The actual definitions are contained in DDRAW.H -// -#if 0 -typedef struct tWAVEFORMATEX WAVEFORMATEX; - -#endif - - - - - - -extern RPC_IF_HANDLE __MIDL_itf_austream_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_austream_0000_v0_0_s_ifspec; - -#ifndef __IAudioMediaStream_INTERFACE_DEFINED__ -#define __IAudioMediaStream_INTERFACE_DEFINED__ - -/* interface IAudioMediaStream */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAudioMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("f7537560-a3be-11d0-8212-00c04fc32c45") - IAudioMediaStream : public IMediaStream - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFormat( - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFormat( - /* [in] */ const WAVEFORMATEX *lpWaveFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateSample( - /* [in] */ IAudioData *pAudioData, - /* [in] */ DWORD dwFlags, - /* [out] */ IAudioStreamSample **ppSample) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAudioMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAudioMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAudioMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAudioMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetMultiMediaStream )( - IAudioMediaStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IAudioMediaStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetSameFormat )( - IAudioMediaStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *AllocateSample )( - IAudioMediaStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *CreateSharedSample )( - IAudioMediaStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - HRESULT ( STDMETHODCALLTYPE *SendEndOfStream )( - IAudioMediaStream * This, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetFormat )( - IAudioMediaStream * This, - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent); - - HRESULT ( STDMETHODCALLTYPE *SetFormat )( - IAudioMediaStream * This, - /* [in] */ const WAVEFORMATEX *lpWaveFormat); - - HRESULT ( STDMETHODCALLTYPE *CreateSample )( - IAudioMediaStream * This, - /* [in] */ IAudioData *pAudioData, - /* [in] */ DWORD dwFlags, - /* [out] */ IAudioStreamSample **ppSample); - - END_INTERFACE - } IAudioMediaStreamVtbl; - - interface IAudioMediaStream - { - CONST_VTBL struct IAudioMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAudioMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAudioMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAudioMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAudioMediaStream_GetMultiMediaStream(This,ppMultiMediaStream) \ - (This)->lpVtbl -> GetMultiMediaStream(This,ppMultiMediaStream) - -#define IAudioMediaStream_GetInformation(This,pPurposeId,pType) \ - (This)->lpVtbl -> GetInformation(This,pPurposeId,pType) - -#define IAudioMediaStream_SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) \ - (This)->lpVtbl -> SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) - -#define IAudioMediaStream_AllocateSample(This,dwFlags,ppSample) \ - (This)->lpVtbl -> AllocateSample(This,dwFlags,ppSample) - -#define IAudioMediaStream_CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) \ - (This)->lpVtbl -> CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) - -#define IAudioMediaStream_SendEndOfStream(This,dwFlags) \ - (This)->lpVtbl -> SendEndOfStream(This,dwFlags) - - -#define IAudioMediaStream_GetFormat(This,pWaveFormatCurrent) \ - (This)->lpVtbl -> GetFormat(This,pWaveFormatCurrent) - -#define IAudioMediaStream_SetFormat(This,lpWaveFormat) \ - (This)->lpVtbl -> SetFormat(This,lpWaveFormat) - -#define IAudioMediaStream_CreateSample(This,pAudioData,dwFlags,ppSample) \ - (This)->lpVtbl -> CreateSample(This,pAudioData,dwFlags,ppSample) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAudioMediaStream_GetFormat_Proxy( - IAudioMediaStream * This, - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent); - - -void __RPC_STUB IAudioMediaStream_GetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAudioMediaStream_SetFormat_Proxy( - IAudioMediaStream * This, - /* [in] */ const WAVEFORMATEX *lpWaveFormat); - - -void __RPC_STUB IAudioMediaStream_SetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAudioMediaStream_CreateSample_Proxy( - IAudioMediaStream * This, - /* [in] */ IAudioData *pAudioData, - /* [in] */ DWORD dwFlags, - /* [out] */ IAudioStreamSample **ppSample); - - -void __RPC_STUB IAudioMediaStream_CreateSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAudioMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IAudioStreamSample_INTERFACE_DEFINED__ -#define __IAudioStreamSample_INTERFACE_DEFINED__ - -/* interface IAudioStreamSample */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAudioStreamSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("345fee00-aba5-11d0-8212-00c04fc32c45") - IAudioStreamSample : public IStreamSample - { - public: - virtual HRESULT STDMETHODCALLTYPE GetAudioData( - /* [out] */ IAudioData **ppAudio) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAudioStreamSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAudioStreamSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAudioStreamSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAudioStreamSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IAudioStreamSample * This, - /* [in] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetSampleTimes )( - IAudioStreamSample * This, - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *SetSampleTimes )( - IAudioStreamSample * This, - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime); - - HRESULT ( STDMETHODCALLTYPE *Update )( - IAudioStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData); - - HRESULT ( STDMETHODCALLTYPE *CompletionStatus )( - IAudioStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds); - - HRESULT ( STDMETHODCALLTYPE *GetAudioData )( - IAudioStreamSample * This, - /* [out] */ IAudioData **ppAudio); - - END_INTERFACE - } IAudioStreamSampleVtbl; - - interface IAudioStreamSample - { - CONST_VTBL struct IAudioStreamSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAudioStreamSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAudioStreamSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAudioStreamSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAudioStreamSample_GetMediaStream(This,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,ppMediaStream) - -#define IAudioStreamSample_GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) \ - (This)->lpVtbl -> GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) - -#define IAudioStreamSample_SetSampleTimes(This,pStartTime,pEndTime) \ - (This)->lpVtbl -> SetSampleTimes(This,pStartTime,pEndTime) - -#define IAudioStreamSample_Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) \ - (This)->lpVtbl -> Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) - -#define IAudioStreamSample_CompletionStatus(This,dwFlags,dwMilliseconds) \ - (This)->lpVtbl -> CompletionStatus(This,dwFlags,dwMilliseconds) - - -#define IAudioStreamSample_GetAudioData(This,ppAudio) \ - (This)->lpVtbl -> GetAudioData(This,ppAudio) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAudioStreamSample_GetAudioData_Proxy( - IAudioStreamSample * This, - /* [out] */ IAudioData **ppAudio); - - -void __RPC_STUB IAudioStreamSample_GetAudioData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAudioStreamSample_INTERFACE_DEFINED__ */ - - -#ifndef __IMemoryData_INTERFACE_DEFINED__ -#define __IMemoryData_INTERFACE_DEFINED__ - -/* interface IMemoryData */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IMemoryData; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("327fc560-af60-11d0-8212-00c04fc32c45") - IMemoryData : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetBuffer( - /* [in] */ DWORD cbSize, - /* [in] */ BYTE *pbData, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInfo( - /* [out] */ DWORD *pdwLength, - /* [out] */ BYTE **ppbData, - /* [out] */ DWORD *pcbActualData) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetActual( - /* [in] */ DWORD cbDataValid) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMemoryDataVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMemoryData * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMemoryData * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMemoryData * This); - - HRESULT ( STDMETHODCALLTYPE *SetBuffer )( - IMemoryData * This, - /* [in] */ DWORD cbSize, - /* [in] */ BYTE *pbData, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - IMemoryData * This, - /* [out] */ DWORD *pdwLength, - /* [out] */ BYTE **ppbData, - /* [out] */ DWORD *pcbActualData); - - HRESULT ( STDMETHODCALLTYPE *SetActual )( - IMemoryData * This, - /* [in] */ DWORD cbDataValid); - - END_INTERFACE - } IMemoryDataVtbl; - - interface IMemoryData - { - CONST_VTBL struct IMemoryDataVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMemoryData_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMemoryData_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMemoryData_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMemoryData_SetBuffer(This,cbSize,pbData,dwFlags) \ - (This)->lpVtbl -> SetBuffer(This,cbSize,pbData,dwFlags) - -#define IMemoryData_GetInfo(This,pdwLength,ppbData,pcbActualData) \ - (This)->lpVtbl -> GetInfo(This,pdwLength,ppbData,pcbActualData) - -#define IMemoryData_SetActual(This,cbDataValid) \ - (This)->lpVtbl -> SetActual(This,cbDataValid) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMemoryData_SetBuffer_Proxy( - IMemoryData * This, - /* [in] */ DWORD cbSize, - /* [in] */ BYTE *pbData, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IMemoryData_SetBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemoryData_GetInfo_Proxy( - IMemoryData * This, - /* [out] */ DWORD *pdwLength, - /* [out] */ BYTE **ppbData, - /* [out] */ DWORD *pcbActualData); - - -void __RPC_STUB IMemoryData_GetInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemoryData_SetActual_Proxy( - IMemoryData * This, - /* [in] */ DWORD cbDataValid); - - -void __RPC_STUB IMemoryData_SetActual_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMemoryData_INTERFACE_DEFINED__ */ - - -#ifndef __IAudioData_INTERFACE_DEFINED__ -#define __IAudioData_INTERFACE_DEFINED__ - -/* interface IAudioData */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAudioData; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("54c719c0-af60-11d0-8212-00c04fc32c45") - IAudioData : public IMemoryData - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFormat( - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFormat( - /* [in] */ const WAVEFORMATEX *lpWaveFormat) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAudioDataVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAudioData * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAudioData * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAudioData * This); - - HRESULT ( STDMETHODCALLTYPE *SetBuffer )( - IAudioData * This, - /* [in] */ DWORD cbSize, - /* [in] */ BYTE *pbData, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - IAudioData * This, - /* [out] */ DWORD *pdwLength, - /* [out] */ BYTE **ppbData, - /* [out] */ DWORD *pcbActualData); - - HRESULT ( STDMETHODCALLTYPE *SetActual )( - IAudioData * This, - /* [in] */ DWORD cbDataValid); - - HRESULT ( STDMETHODCALLTYPE *GetFormat )( - IAudioData * This, - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent); - - HRESULT ( STDMETHODCALLTYPE *SetFormat )( - IAudioData * This, - /* [in] */ const WAVEFORMATEX *lpWaveFormat); - - END_INTERFACE - } IAudioDataVtbl; - - interface IAudioData - { - CONST_VTBL struct IAudioDataVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAudioData_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAudioData_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAudioData_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAudioData_SetBuffer(This,cbSize,pbData,dwFlags) \ - (This)->lpVtbl -> SetBuffer(This,cbSize,pbData,dwFlags) - -#define IAudioData_GetInfo(This,pdwLength,ppbData,pcbActualData) \ - (This)->lpVtbl -> GetInfo(This,pdwLength,ppbData,pcbActualData) - -#define IAudioData_SetActual(This,cbDataValid) \ - (This)->lpVtbl -> SetActual(This,cbDataValid) - - -#define IAudioData_GetFormat(This,pWaveFormatCurrent) \ - (This)->lpVtbl -> GetFormat(This,pWaveFormatCurrent) - -#define IAudioData_SetFormat(This,lpWaveFormat) \ - (This)->lpVtbl -> SetFormat(This,lpWaveFormat) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAudioData_GetFormat_Proxy( - IAudioData * This, - /* [out] */ WAVEFORMATEX *pWaveFormatCurrent); - - -void __RPC_STUB IAudioData_GetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAudioData_SetFormat_Proxy( - IAudioData * This, - /* [in] */ const WAVEFORMATEX *lpWaveFormat); - - -void __RPC_STUB IAudioData_SetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAudioData_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/aviriff.h b/import/DirectX8/include/aviriff.h deleted file mode 100644 index 5ba2990cc..000000000 --- a/import/DirectX8/include/aviriff.h +++ /dev/null @@ -1,402 +0,0 @@ -//------------------------------------------------------------------------------ -// File: AVIRIFF.h -// -// Desc: Structures and defines for the RIFF AVI file format extended to -// handle very large/long files. -// -// Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - -// Disable some compiler warnings -#pragma warning(disable: 4097 4511 4512 4514 4705) - - -#if !defined AVIRIFF_H -#define AVIRIFF_H - -#if !defined NUMELMS - #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) -#endif - -// all structures in this file are packed on word boundaries -// -#include - -/* - * heres the general layout of an AVI riff file (new format) - * - * RIFF (3F??????) AVI <- not more than 1 GB in size - * LIST (size) hdrl - * avih (0038) - * LIST (size) strl - * strh (0038) - * strf (????) - * indx (3ff8) <- size may vary, should be sector sized - * LIST (size) strl - * strh (0038) - * strf (????) - * indx (3ff8) <- size may vary, should be sector sized - * LIST (size) odml - * dmlh (????) - * JUNK (size) <- fill to align to sector - 12 - * LIST (7f??????) movi <- aligned on sector - 12 - * 00dc (size) <- sector aligned - * 01wb (size) <- sector aligned - * ix00 (size) <- sector aligned - * idx1 (00??????) <- sector aligned - * RIFF (7F??????) AVIX - * JUNK (size) <- fill to align to sector -12 - * LIST (size) movi - * 00dc (size) <- sector aligned - * RIFF (7F??????) AVIX <- not more than 2GB in size - * JUNK (size) <- fill to align to sector - 12 - * LIST (size) movi - * 00dc (size) <- sector aligned - * - *-===================================================================*/ - -// -// structures for manipulating RIFF headers -// -#define FCC(ch4) ((((DWORD)(ch4) & 0xFF) << 24) | \ - (((DWORD)(ch4) & 0xFF00) << 8) | \ - (((DWORD)(ch4) & 0xFF0000) >> 8) | \ - (((DWORD)(ch4) & 0xFF000000) >> 24)) - -typedef struct _riffchunk { - FOURCC fcc; - DWORD cb; - } RIFFCHUNK, * LPRIFFCHUNK; -typedef struct _rifflist { - FOURCC fcc; - DWORD cb; - FOURCC fccListType; - } RIFFLIST, * LPRIFFLIST; - -#define RIFFROUND(cb) ((cb) + ((cb)&1)) -#define RIFFNEXT(pChunk) (LPRIFFCHUNK)((LPBYTE)(pChunk) \ - + sizeof(RIFFCHUNK) \ - + RIFFROUND(((LPRIFFCHUNK)pChunk)->cb)) - - -// -// ==================== avi header structures =========================== -// - -// main header for the avi file (compatibility header) -// -#define ckidMAINAVIHEADER FCC('avih') -typedef struct _avimainheader { - FOURCC fcc; // 'avih' - DWORD cb; // size of this structure -8 - DWORD dwMicroSecPerFrame; // frame display rate (or 0L) - DWORD dwMaxBytesPerSec; // max. transfer rate - DWORD dwPaddingGranularity; // pad to multiples of this size; normally 2K. - DWORD dwFlags; // the ever-present flags - #define AVIF_HASINDEX 0x00000010 // Index at end of file? - #define AVIF_MUSTUSEINDEX 0x00000020 - #define AVIF_ISINTERLEAVED 0x00000100 - #define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames - #define AVIF_WASCAPTUREFILE 0x00010000 - #define AVIF_COPYRIGHTED 0x00020000 - DWORD dwTotalFrames; // # frames in first movi list - DWORD dwInitialFrames; - DWORD dwStreams; - DWORD dwSuggestedBufferSize; - DWORD dwWidth; - DWORD dwHeight; - DWORD dwReserved[4]; - } AVIMAINHEADER; - -#define ckidODML FCC('odml') -#define ckidAVIEXTHEADER FCC('dmlh') -typedef struct _aviextheader { - FOURCC fcc; // 'dmlh' - DWORD cb; // size of this structure -8 - DWORD dwGrandFrames; // total number of frames in the file - DWORD dwFuture[61]; // to be defined later - } AVIEXTHEADER; - -// -// structure of an AVI stream header riff chunk -// -#define ckidSTREAMLIST FCC('strl') - -#ifndef ckidSTREAMHEADER -#define ckidSTREAMHEADER FCC('strh') -#endif -typedef struct _avistreamheader { - FOURCC fcc; // 'strh' - DWORD cb; // size of this structure - 8 - - FOURCC fccType; // stream type codes - - #ifndef streamtypeVIDEO - #define streamtypeVIDEO FCC('vids') - #define streamtypeAUDIO FCC('auds') - #define streamtypeMIDI FCC('mids') - #define streamtypeTEXT FCC('txts') - #endif - - FOURCC fccHandler; - DWORD dwFlags; - #define AVISF_DISABLED 0x00000001 - #define AVISF_VIDEO_PALCHANGES 0x00010000 - - WORD wPriority; - WORD wLanguage; - DWORD dwInitialFrames; - DWORD dwScale; - DWORD dwRate; // dwRate/dwScale is stream tick rate in ticks/sec - DWORD dwStart; - DWORD dwLength; - DWORD dwSuggestedBufferSize; - DWORD dwQuality; - DWORD dwSampleSize; - struct { - short int left; - short int top; - short int right; - short int bottom; - } rcFrame; - } AVISTREAMHEADER; - - -// -// structure of an AVI stream format chunk -// -#ifndef ckidSTREAMFORMAT -#define ckidSTREAMFORMAT FCC('strf') -#endif -// -// avi stream formats are different for each stream type -// -// BITMAPINFOHEADER for video streams -// WAVEFORMATEX or PCMWAVEFORMAT for audio streams -// nothing for text streams -// nothing for midi streams - - -#pragma warning(disable:4200) -// -// structure of old style AVI index -// -#define ckidAVIOLDINDEX FCC('idx1') -typedef struct _avioldindex { - FOURCC fcc; // 'idx1' - DWORD cb; // size of this structure -8 - struct _avioldindex_entry { - DWORD dwChunkId; - DWORD dwFlags; - - #ifndef AVIIF_LIST - #define AVIIF_LIST 0x00000001 - #define AVIIF_KEYFRAME 0x00000010 - #endif - - #define AVIIF_NO_TIME 0x00000100 - #define AVIIF_COMPRESSOR 0x0FFF0000 // unused? - DWORD dwOffset; // offset of riff chunk header for the data - DWORD dwSize; // size of the data (excluding riff header size) - } aIndex[]; // size of this array - } AVIOLDINDEX; - - -// -// ============ structures for timecode in an AVI file ================= -// - -#ifndef TIMECODE_DEFINED -#define TIMECODE_DEFINED - -// defined -// timecode time structure -// -typedef union _timecode { - struct { - WORD wFrameRate; - WORD wFrameFract; - LONG cFrames; - }; - DWORDLONG qw; - } TIMECODE; - -#endif // TIMECODE_DEFINED - -#define TIMECODE_RATE_30DROP 0 // this MUST be zero - -// struct for all the SMPTE timecode info -// -typedef struct _timecodedata { - TIMECODE time; - DWORD dwSMPTEflags; - DWORD dwUser; - } TIMECODEDATA; - -// dwSMPTEflags masks/values -// -#define TIMECODE_SMPTE_BINARY_GROUP 0x07 -#define TIMECODE_SMPTE_COLOR_FRAME 0x08 - -// -// ============ structures for new style AVI indexes ================= -// - -// index type codes -// -#define AVI_INDEX_OF_INDEXES 0x00 -#define AVI_INDEX_OF_CHUNKS 0x01 -#define AVI_INDEX_OF_TIMED_CHUNKS 0x02 -#define AVI_INDEX_OF_SUB_2FIELD 0x03 -#define AVI_INDEX_IS_DATA 0x80 - -// index subtype codes -// -#define AVI_INDEX_SUB_DEFAULT 0x00 - -// INDEX_OF_CHUNKS subtype codes -// -#define AVI_INDEX_SUB_2FIELD 0x01 - -// meta structure of all avi indexes -// -typedef struct _avimetaindex { - FOURCC fcc; - UINT cb; - WORD wLongsPerEntry; - BYTE bIndexSubType; - BYTE bIndexType; - DWORD nEntriesInUse; - DWORD dwChunkId; - DWORD dwReserved[3]; - DWORD adwIndex[]; - } AVIMETAINDEX; - -#define STDINDEXSIZE 0x4000 -#define NUMINDEX(wLongsPerEntry) ((STDINDEXSIZE-32)/4/(wLongsPerEntry)) -#define NUMINDEXFILL(wLongsPerEntry) ((STDINDEXSIZE/4) - NUMINDEX(wLongsPerEntry)) - -// structure of a super index (INDEX_OF_INDEXES) -// -#define ckidAVISUPERINDEX FCC('indx') -typedef struct _avisuperindex { - FOURCC fcc; // 'indx' - UINT cb; // size of this structure - WORD wLongsPerEntry; // ==4 - BYTE bIndexSubType; // ==0 (frame index) or AVI_INDEX_SUB_2FIELD - BYTE bIndexType; // ==AVI_INDEX_OF_INDEXES - DWORD nEntriesInUse; // offset of next unused entry in aIndex - DWORD dwChunkId; // chunk ID of chunks being indexed, (i.e. RGB8) - DWORD dwReserved[3]; // must be 0 - struct _avisuperindex_entry { - DWORDLONG qwOffset; // 64 bit offset to sub index chunk - DWORD dwSize; // 32 bit size of sub index chunk - DWORD dwDuration; // time span of subindex chunk (in stream ticks) - } aIndex[NUMINDEX(4)]; - } AVISUPERINDEX; -#define Valid_SUPERINDEX(pi) (*(DWORD *)(&((pi)->wLongsPerEntry)) == (4 | (AVI_INDEX_OF_INDEXES << 24))) - -// struct of a standard index (AVI_INDEX_OF_CHUNKS) -// -typedef struct _avistdindex_entry { - DWORD dwOffset; // 32 bit offset to data (points to data, not riff header) - DWORD dwSize; // 31 bit size of data (does not include size of riff header), bit 31 is deltaframe bit - } AVISTDINDEX_ENTRY; -#define AVISTDINDEX_DELTAFRAME ( 0x80000000) // Delta frames have the high bit set -#define AVISTDINDEX_SIZEMASK (~0x80000000) - -typedef struct _avistdindex { - FOURCC fcc; // 'indx' or '##ix' - UINT cb; // size of this structure - WORD wLongsPerEntry; // ==2 - BYTE bIndexSubType; // ==0 - BYTE bIndexType; // ==AVI_INDEX_OF_CHUNKS - DWORD nEntriesInUse; // offset of next unused entry in aIndex - DWORD dwChunkId; // chunk ID of chunks being indexed, (i.e. RGB8) - DWORDLONG qwBaseOffset; // base offset that all index intries are relative to - DWORD dwReserved_3; // must be 0 - AVISTDINDEX_ENTRY aIndex[NUMINDEX(2)]; - } AVISTDINDEX; - -// struct of a time variant standard index (AVI_INDEX_OF_TIMED_CHUNKS) -// -typedef struct _avitimedindex_entry { - DWORD dwOffset; // 32 bit offset to data (points to data, not riff header) - DWORD dwSize; // 31 bit size of data (does not include size of riff header) (high bit is deltaframe bit) - DWORD dwDuration; // how much time the chunk should be played (in stream ticks) - } AVITIMEDINDEX_ENTRY; - -typedef struct _avitimedindex { - FOURCC fcc; // 'indx' or '##ix' - UINT cb; // size of this structure - WORD wLongsPerEntry; // ==3 - BYTE bIndexSubType; // ==0 - BYTE bIndexType; // ==AVI_INDEX_OF_TIMED_CHUNKS - DWORD nEntriesInUse; // offset of next unused entry in aIndex - DWORD dwChunkId; // chunk ID of chunks being indexed, (i.e. RGB8) - DWORDLONG qwBaseOffset; // base offset that all index intries are relative to - DWORD dwReserved_3; // must be 0 - AVITIMEDINDEX_ENTRY aIndex[NUMINDEX(3)]; - DWORD adwTrailingFill[NUMINDEXFILL(3)]; // to align struct to correct size - } AVITIMEDINDEX; - -// structure of a timecode stream -// -typedef struct _avitimecodeindex { - FOURCC fcc; // 'indx' or '##ix' - UINT cb; // size of this structure - WORD wLongsPerEntry; // ==4 - BYTE bIndexSubType; // ==0 - BYTE bIndexType; // ==AVI_INDEX_IS_DATA - DWORD nEntriesInUse; // offset of next unused entry in aIndex - DWORD dwChunkId; // 'time' - DWORD dwReserved[3]; // must be 0 - TIMECODEDATA aIndex[NUMINDEX(sizeof(TIMECODEDATA)/sizeof(LONG))]; - } AVITIMECODEINDEX; - -// structure of a timecode discontinuity list (when wLongsPerEntry == 7) -// -typedef struct _avitcdlindex_entry { - DWORD dwTick; // stream tick time that maps to this timecode value - TIMECODE time; - DWORD dwSMPTEflags; - DWORD dwUser; - TCHAR szReelId[12]; - } AVITCDLINDEX_ENTRY; - -typedef struct _avitcdlindex { - FOURCC fcc; // 'indx' or '##ix' - UINT cb; // size of this structure - WORD wLongsPerEntry; // ==7 (must be 4 or more all 'tcdl' indexes - BYTE bIndexSubType; // ==0 - BYTE bIndexType; // ==AVI_INDEX_IS_DATA - DWORD nEntriesInUse; // offset of next unused entry in aIndex - DWORD dwChunkId; // 'tcdl' - DWORD dwReserved[3]; // must be 0 - AVITCDLINDEX_ENTRY aIndex[NUMINDEX(7)]; - DWORD adwTrailingFill[NUMINDEXFILL(7)]; // to align struct to correct size - } AVITCDLINDEX; - -typedef struct _avifieldindex_chunk { - FOURCC fcc; // 'ix##' - DWORD cb; // size of this structure - WORD wLongsPerEntry; // must be 3 (size of each entry in - // aIndex array) - BYTE bIndexSubType; // AVI_INDEX_2FIELD - BYTE bIndexType; // AVI_INDEX_OF_CHUNKS - DWORD nEntriesInUse; // - DWORD dwChunkId; // '##dc' or '##db' - DWORDLONG qwBaseOffset; // offsets in aIndex array are relative to this - DWORD dwReserved3; // must be 0 - struct _avifieldindex_entry { - DWORD dwOffset; - DWORD dwSize; // size of all fields - // (bit 31 set for NON-keyframes) - DWORD dwOffsetField2; // offset to second field - } aIndex[ ]; -} AVIFIELDINDEX, * PAVIFIELDINDEX; - - -#include - -#endif diff --git a/import/DirectX8/include/basetsd.h.old b/import/DirectX8/include/basetsd.h.old deleted file mode 100644 index c634a5c98..000000000 --- a/import/DirectX8/include/basetsd.h.old +++ /dev/null @@ -1,342 +0,0 @@ -/*++ - -Copyright (c) 1997-1999 Microsoft Corporation - -Module Name: - - basetsd.h - -Abstract: - - Type definitions for the basic sized types. - -Author: - - Jeff Havens (jhavens) 23-Oct-1997 - -Revision History: - ---*/ - -#ifndef _BASETSD_H_ -#define _BASETSD_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef signed char INT8, *PINT8; -typedef signed short INT16, *PINT16; -typedef signed int INT32, *PINT32; -typedef signed __int64 INT64, *PINT64; -typedef unsigned char UINT8, *PUINT8; -typedef unsigned short UINT16, *PUINT16; -typedef unsigned int UINT32, *PUINT32; -typedef unsigned __int64 UINT64, *PUINT64; - -// -// The following types are guaranteed to be signed and 32 bits wide. -// - -typedef signed int LONG32, *PLONG32; - -// -// The following types are guaranteed to be unsigned and 32 bits wide. -// - -typedef unsigned int ULONG32, *PULONG32; -typedef unsigned int DWORD32, *PDWORD32; - -#if !defined(_W64) -#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -#define _W64 __w64 -#else -#define _W64 -#endif -#endif - -// -// The INT_PTR is guaranteed to be the same size as a pointer. Its -// size with change with pointer size (32/64). It should be used -// anywhere that a pointer is cast to an integer type. UINT_PTR is -// the unsigned variation. -// -// __int3264 is intrinsic to 64b MIDL but not to old MIDL or to C compiler. -// -#if ( 501 < __midl ) - - typedef [public] __int3264 INT_PTR, *PINT_PTR; - typedef [public] unsigned __int3264 UINT_PTR, *PUINT_PTR; - - typedef [public] __int3264 LONG_PTR, *PLONG_PTR; - typedef [public] unsigned __int3264 ULONG_PTR, *PULONG_PTR; - -#else // midl64 -// old midl and C++ compiler - -#if defined(_WIN64) - typedef __int64 INT_PTR, *PINT_PTR; - typedef unsigned __int64 UINT_PTR, *PUINT_PTR; - - typedef __int64 LONG_PTR, *PLONG_PTR; - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; - - #define __int3264 __int64 - -#else - typedef _W64 int INT_PTR, *PINT_PTR; - typedef _W64 unsigned int UINT_PTR, *PUINT_PTR; - - typedef _W64 long LONG_PTR, *PLONG_PTR; - typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; - - #define __int3264 __int32 - -#endif -#endif // midl64 - -// -// HALF_PTR is half the size of a pointer it intended for use with -// within strcuture which contain a pointer and two small fields. -// UHALF_PTR is the unsigned variation. -// - -#ifdef _WIN64 - -#define ADDRESS_TAG_BIT 0x40000000000UI64 - -typedef unsigned __int64 HANDLE_PTR; -typedef unsigned int UHALF_PTR, *PUHALF_PTR; -typedef int HALF_PTR, *PHALF_PTR; - -#pragma warning(disable:4311) // type cast truncation -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4305) // type cast truncation - -#if !defined(__midl) -__inline -unsigned long -HandleToULong( - const void *h - ) -{ - return((unsigned long) h ); -} - -__inline -long -HandleToLong( - const void *h - ) -{ - return((long) h ); -} - -__inline -void * -ULongToHandle( - const unsigned long h - ) -{ - return((void *) (UINT_PTR) h ); -} - - -__inline -void * -LongToHandle( - const long h - ) -{ - return((void *) (INT_PTR) h ); -} - - -__inline -unsigned long -PtrToUlong( - const void *p - ) -{ - return((unsigned long) p ); -} - -__inline -unsigned int -PtrToUint( - const void *p - ) -{ - return((unsigned int) p ); -} - -__inline -unsigned short -PtrToUshort( - const void *p - ) -{ - return((unsigned short) p ); -} - -__inline -long -PtrToLong( - const void *p - ) -{ - return((long) p ); -} - -__inline -int -PtrToInt( - const void *p - ) -{ - return((int) p ); -} - -__inline -short -PtrToShort( - const void *p - ) -{ - return((short) p ); -} - -__inline -void * -IntToPtr( - const int i - ) -// Caution: IntToPtr() sign-extends the int value. -{ - return( (void *)(INT_PTR)i ); -} - -__inline -void * -UIntToPtr( - const unsigned int ui - ) -// Caution: UIntToPtr() zero-extends the unsigned int value. -{ - return( (void *)(UINT_PTR)ui ); -} - -__inline -void * -LongToPtr( - const long l - ) -// Caution: LongToPtr() sign-extends the long value. -{ - return( (void *)(LONG_PTR)l ); -} - -__inline -void * -ULongToPtr( - const unsigned long ul - ) -// Caution: ULongToPtr() zero-extends the unsigned long value. -{ - return( (void *)(ULONG_PTR)ul ); -} - -#endif // !_midl -#if _MSC_VER >= 1200 -#pragma warning(pop) // restore 4305 -#endif -#pragma warning(3:4311) // bump 4311 to a level 3 - -#else // !_WIN64 - -#define ADDRESS_TAG_BIT 0x80000000UL - -typedef unsigned short UHALF_PTR, *PUHALF_PTR; -typedef short HALF_PTR, *PHALF_PTR; -typedef _W64 unsigned long HANDLE_PTR; - -#define HandleToULong( h ) ((ULONG)(ULONG_PTR)(h) ) -#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) ) -#define ULongToHandle( ul ) ((HANDLE)(ULONG_PTR) (ul) ) -#define LongToHandle( h ) ((HANDLE)(LONG_PTR) (h) ) -#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) ) -#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) ) -#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) ) -#define PtrToInt( p ) ((INT)(INT_PTR) (p) ) -#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) ) -#define PtrToShort( p ) ((short)(LONG_PTR)(p) ) -#define IntToPtr( i ) ((VOID *)(INT_PTR)((int)i)) -#define UIntToPtr( ui ) ((VOID *)(UINT_PTR)((unsigned int)ui)) -#define LongToPtr( l ) ((VOID *)(LONG_PTR)((long)l)) -#define ULongToPtr( ul ) ((VOID *)(ULONG_PTR)((unsigned long)ul)) - -#endif // !_WIN64 - -#define HandleToUlong(h) HandleToULong(h) -#define UlongToHandle(ul) ULongToHandle(ul) -#define UlongToPtr(ul) ULongToPtr(ul) -#define UintToPtr(ui) UIntToPtr(ui) - -#define MAXUINT_PTR (~((UINT_PTR)0)) -#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1)) -#define MININT_PTR (~MAXINT_PTR) - -#define MAXULONG_PTR (~((ULONG_PTR)0)) -#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1)) -#define MINLONG_PTR (~MAXLONG_PTR) - -#define MAXUHALF_PTR ((UHALF_PTR)~0) -#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1)) -#define MINHALF_PTR (~MAXHALF_PTR) - -// -// SIZE_T used for counts or ranges which need to span the range of -// of a pointer. SSIZE_T is the signed variation. -// - -typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef LONG_PTR SSIZE_T, *PSSIZE_T; - -// -// Add Windows flavor DWORD_PTR types -// - -typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; - -// -// The following types are guaranteed to be signed and 64 bits wide. -// - -typedef __int64 LONG64, *PLONG64; - - -// -// The following types are guaranteed to be unsigned and 64 bits wide. -// - -typedef unsigned __int64 ULONG64, *PULONG64; -typedef unsigned __int64 DWORD64, *PDWORD64; - -// -// Thread affinity. -// - -typedef ULONG_PTR KAFFINITY; -typedef KAFFINITY *PKAFFINITY; - -#ifdef __cplusplus -} -#endif - -#endif // _BASETSD_H_ diff --git a/import/DirectX8/include/bdaiface.h b/import/DirectX8/include/bdaiface.h deleted file mode 100644 index 5f1044c43..000000000 --- a/import/DirectX8/include/bdaiface.h +++ /dev/null @@ -1,3881 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1999-2001. -// -//-------------------------------------------------------------------------- - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for bdaiface.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __bdaiface_h__ -#define __bdaiface_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IBDA_NetworkProvider_FWD_DEFINED__ -#define __IBDA_NetworkProvider_FWD_DEFINED__ -typedef interface IBDA_NetworkProvider IBDA_NetworkProvider; -#endif /* __IBDA_NetworkProvider_FWD_DEFINED__ */ - - -#ifndef __IBDA_EthernetFilter_FWD_DEFINED__ -#define __IBDA_EthernetFilter_FWD_DEFINED__ -typedef interface IBDA_EthernetFilter IBDA_EthernetFilter; -#endif /* __IBDA_EthernetFilter_FWD_DEFINED__ */ - - -#ifndef __IBDA_IPV4Filter_FWD_DEFINED__ -#define __IBDA_IPV4Filter_FWD_DEFINED__ -typedef interface IBDA_IPV4Filter IBDA_IPV4Filter; -#endif /* __IBDA_IPV4Filter_FWD_DEFINED__ */ - - -#ifndef __IBDA_IPV6Filter_FWD_DEFINED__ -#define __IBDA_IPV6Filter_FWD_DEFINED__ -typedef interface IBDA_IPV6Filter IBDA_IPV6Filter; -#endif /* __IBDA_IPV6Filter_FWD_DEFINED__ */ - - -#ifndef __IBDA_DeviceControl_FWD_DEFINED__ -#define __IBDA_DeviceControl_FWD_DEFINED__ -typedef interface IBDA_DeviceControl IBDA_DeviceControl; -#endif /* __IBDA_DeviceControl_FWD_DEFINED__ */ - - -#ifndef __IBDA_PinControl_FWD_DEFINED__ -#define __IBDA_PinControl_FWD_DEFINED__ -typedef interface IBDA_PinControl IBDA_PinControl; -#endif /* __IBDA_PinControl_FWD_DEFINED__ */ - - -#ifndef __IBDA_SignalProperties_FWD_DEFINED__ -#define __IBDA_SignalProperties_FWD_DEFINED__ -typedef interface IBDA_SignalProperties IBDA_SignalProperties; -#endif /* __IBDA_SignalProperties_FWD_DEFINED__ */ - - -#ifndef __IBDA_SignalStatistics_FWD_DEFINED__ -#define __IBDA_SignalStatistics_FWD_DEFINED__ -typedef interface IBDA_SignalStatistics IBDA_SignalStatistics; -#endif /* __IBDA_SignalStatistics_FWD_DEFINED__ */ - - -#ifndef __IBDA_Topology_FWD_DEFINED__ -#define __IBDA_Topology_FWD_DEFINED__ -typedef interface IBDA_Topology IBDA_Topology; -#endif /* __IBDA_Topology_FWD_DEFINED__ */ - - -#ifndef __IBDA_VoidTransform_FWD_DEFINED__ -#define __IBDA_VoidTransform_FWD_DEFINED__ -typedef interface IBDA_VoidTransform IBDA_VoidTransform; -#endif /* __IBDA_VoidTransform_FWD_DEFINED__ */ - - -#ifndef __IBDA_NullTransform_FWD_DEFINED__ -#define __IBDA_NullTransform_FWD_DEFINED__ -typedef interface IBDA_NullTransform IBDA_NullTransform; -#endif /* __IBDA_NullTransform_FWD_DEFINED__ */ - - -#ifndef __IBDA_FrequencyFilter_FWD_DEFINED__ -#define __IBDA_FrequencyFilter_FWD_DEFINED__ -typedef interface IBDA_FrequencyFilter IBDA_FrequencyFilter; -#endif /* __IBDA_FrequencyFilter_FWD_DEFINED__ */ - - -#ifndef __IBDA_LNBInfo_FWD_DEFINED__ -#define __IBDA_LNBInfo_FWD_DEFINED__ -typedef interface IBDA_LNBInfo IBDA_LNBInfo; -#endif /* __IBDA_LNBInfo_FWD_DEFINED__ */ - - -#ifndef __IBDA_AutoDemodulate_FWD_DEFINED__ -#define __IBDA_AutoDemodulate_FWD_DEFINED__ -typedef interface IBDA_AutoDemodulate IBDA_AutoDemodulate; -#endif /* __IBDA_AutoDemodulate_FWD_DEFINED__ */ - - -#ifndef __IBDA_DigitalDemodulator_FWD_DEFINED__ -#define __IBDA_DigitalDemodulator_FWD_DEFINED__ -typedef interface IBDA_DigitalDemodulator IBDA_DigitalDemodulator; -#endif /* __IBDA_DigitalDemodulator_FWD_DEFINED__ */ - - -#ifndef __IBDA_IPSinkControl_FWD_DEFINED__ -#define __IBDA_IPSinkControl_FWD_DEFINED__ -typedef interface IBDA_IPSinkControl IBDA_IPSinkControl; -#endif /* __IBDA_IPSinkControl_FWD_DEFINED__ */ - - -#ifndef __IBDA_IPSinkInfo_FWD_DEFINED__ -#define __IBDA_IPSinkInfo_FWD_DEFINED__ -typedef interface IBDA_IPSinkInfo IBDA_IPSinkInfo; -#endif /* __IBDA_IPSinkInfo_FWD_DEFINED__ */ - - -#ifndef __IEnumPIDMap_FWD_DEFINED__ -#define __IEnumPIDMap_FWD_DEFINED__ -typedef interface IEnumPIDMap IEnumPIDMap; -#endif /* __IEnumPIDMap_FWD_DEFINED__ */ - - -#ifndef __IMPEG2PIDMap_FWD_DEFINED__ -#define __IMPEG2PIDMap_FWD_DEFINED__ -typedef interface IMPEG2PIDMap IMPEG2PIDMap; -#endif /* __IMPEG2PIDMap_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "strmif.h" -#include "BdaTypes.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -#ifndef __IBDA_NetworkProvider_INTERFACE_DEFINED__ -#define __IBDA_NetworkProvider_INTERFACE_DEFINED__ - -/* interface IBDA_NetworkProvider */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_NetworkProvider; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("fd501041-8ebe-11ce-8183-00aa00577da2") - IBDA_NetworkProvider : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE PutSignalSource( - /* [in] */ ULONG ulSignalSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSignalSource( - /* [out][in] */ ULONG *pulSignalSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNetworkType( - /* [out][in] */ GUID *pguidNetworkType) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutTuningSpace( - /* [in] */ REFGUID guidTuningSpace) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTuningSpace( - /* [out][in] */ GUID *pguidTuingSpace) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterDeviceFilter( - /* [in] */ IUnknown *pUnkFilterControl, - /* [out][in] */ ULONG *ppvRegisitrationContext) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnRegisterDeviceFilter( - /* [in] */ ULONG pvRegistrationContext) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_NetworkProviderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_NetworkProvider * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_NetworkProvider * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_NetworkProvider * This); - - HRESULT ( STDMETHODCALLTYPE *PutSignalSource )( - IBDA_NetworkProvider * This, - /* [in] */ ULONG ulSignalSource); - - HRESULT ( STDMETHODCALLTYPE *GetSignalSource )( - IBDA_NetworkProvider * This, - /* [out][in] */ ULONG *pulSignalSource); - - HRESULT ( STDMETHODCALLTYPE *GetNetworkType )( - IBDA_NetworkProvider * This, - /* [out][in] */ GUID *pguidNetworkType); - - HRESULT ( STDMETHODCALLTYPE *PutTuningSpace )( - IBDA_NetworkProvider * This, - /* [in] */ REFGUID guidTuningSpace); - - HRESULT ( STDMETHODCALLTYPE *GetTuningSpace )( - IBDA_NetworkProvider * This, - /* [out][in] */ GUID *pguidTuingSpace); - - HRESULT ( STDMETHODCALLTYPE *RegisterDeviceFilter )( - IBDA_NetworkProvider * This, - /* [in] */ IUnknown *pUnkFilterControl, - /* [out][in] */ ULONG *ppvRegisitrationContext); - - HRESULT ( STDMETHODCALLTYPE *UnRegisterDeviceFilter )( - IBDA_NetworkProvider * This, - /* [in] */ ULONG pvRegistrationContext); - - END_INTERFACE - } IBDA_NetworkProviderVtbl; - - interface IBDA_NetworkProvider - { - CONST_VTBL struct IBDA_NetworkProviderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_NetworkProvider_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_NetworkProvider_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_NetworkProvider_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_NetworkProvider_PutSignalSource(This,ulSignalSource) \ - (This)->lpVtbl -> PutSignalSource(This,ulSignalSource) - -#define IBDA_NetworkProvider_GetSignalSource(This,pulSignalSource) \ - (This)->lpVtbl -> GetSignalSource(This,pulSignalSource) - -#define IBDA_NetworkProvider_GetNetworkType(This,pguidNetworkType) \ - (This)->lpVtbl -> GetNetworkType(This,pguidNetworkType) - -#define IBDA_NetworkProvider_PutTuningSpace(This,guidTuningSpace) \ - (This)->lpVtbl -> PutTuningSpace(This,guidTuningSpace) - -#define IBDA_NetworkProvider_GetTuningSpace(This,pguidTuingSpace) \ - (This)->lpVtbl -> GetTuningSpace(This,pguidTuingSpace) - -#define IBDA_NetworkProvider_RegisterDeviceFilter(This,pUnkFilterControl,ppvRegisitrationContext) \ - (This)->lpVtbl -> RegisterDeviceFilter(This,pUnkFilterControl,ppvRegisitrationContext) - -#define IBDA_NetworkProvider_UnRegisterDeviceFilter(This,pvRegistrationContext) \ - (This)->lpVtbl -> UnRegisterDeviceFilter(This,pvRegistrationContext) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_PutSignalSource_Proxy( - IBDA_NetworkProvider * This, - /* [in] */ ULONG ulSignalSource); - - -void __RPC_STUB IBDA_NetworkProvider_PutSignalSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_GetSignalSource_Proxy( - IBDA_NetworkProvider * This, - /* [out][in] */ ULONG *pulSignalSource); - - -void __RPC_STUB IBDA_NetworkProvider_GetSignalSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_GetNetworkType_Proxy( - IBDA_NetworkProvider * This, - /* [out][in] */ GUID *pguidNetworkType); - - -void __RPC_STUB IBDA_NetworkProvider_GetNetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_PutTuningSpace_Proxy( - IBDA_NetworkProvider * This, - /* [in] */ REFGUID guidTuningSpace); - - -void __RPC_STUB IBDA_NetworkProvider_PutTuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_GetTuningSpace_Proxy( - IBDA_NetworkProvider * This, - /* [out][in] */ GUID *pguidTuingSpace); - - -void __RPC_STUB IBDA_NetworkProvider_GetTuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_RegisterDeviceFilter_Proxy( - IBDA_NetworkProvider * This, - /* [in] */ IUnknown *pUnkFilterControl, - /* [out][in] */ ULONG *ppvRegisitrationContext); - - -void __RPC_STUB IBDA_NetworkProvider_RegisterDeviceFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NetworkProvider_UnRegisterDeviceFilter_Proxy( - IBDA_NetworkProvider * This, - /* [in] */ ULONG pvRegistrationContext); - - -void __RPC_STUB IBDA_NetworkProvider_UnRegisterDeviceFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_NetworkProvider_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_EthernetFilter_INTERFACE_DEFINED__ -#define __IBDA_EthernetFilter_INTERFACE_DEFINED__ - -/* interface IBDA_EthernetFilter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_EthernetFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("71985F43-1CA1-11d3-9CC8-00C04F7971E0") - IBDA_EthernetFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMulticastListSize( - /* [out][in] */ ULONG *pulcbAddresses) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastList( - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastList( - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastMode( - /* [in] */ ULONG ulModeMask) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastMode( - /* [out] */ ULONG *pulModeMask) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_EthernetFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_EthernetFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_EthernetFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_EthernetFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastListSize )( - IBDA_EthernetFilter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastList )( - IBDA_EthernetFilter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastList )( - IBDA_EthernetFilter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastMode )( - IBDA_EthernetFilter * This, - /* [in] */ ULONG ulModeMask); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastMode )( - IBDA_EthernetFilter * This, - /* [out] */ ULONG *pulModeMask); - - END_INTERFACE - } IBDA_EthernetFilterVtbl; - - interface IBDA_EthernetFilter - { - CONST_VTBL struct IBDA_EthernetFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_EthernetFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_EthernetFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_EthernetFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_EthernetFilter_GetMulticastListSize(This,pulcbAddresses) \ - (This)->lpVtbl -> GetMulticastListSize(This,pulcbAddresses) - -#define IBDA_EthernetFilter_PutMulticastList(This,ulcbAddresses,pAddressList) \ - (This)->lpVtbl -> PutMulticastList(This,ulcbAddresses,pAddressList) - -#define IBDA_EthernetFilter_GetMulticastList(This,pulcbAddresses,pAddressList) \ - (This)->lpVtbl -> GetMulticastList(This,pulcbAddresses,pAddressList) - -#define IBDA_EthernetFilter_PutMulticastMode(This,ulModeMask) \ - (This)->lpVtbl -> PutMulticastMode(This,ulModeMask) - -#define IBDA_EthernetFilter_GetMulticastMode(This,pulModeMask) \ - (This)->lpVtbl -> GetMulticastMode(This,pulModeMask) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_EthernetFilter_GetMulticastListSize_Proxy( - IBDA_EthernetFilter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - -void __RPC_STUB IBDA_EthernetFilter_GetMulticastListSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_EthernetFilter_PutMulticastList_Proxy( - IBDA_EthernetFilter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_EthernetFilter_PutMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_EthernetFilter_GetMulticastList_Proxy( - IBDA_EthernetFilter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_EthernetFilter_GetMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_EthernetFilter_PutMulticastMode_Proxy( - IBDA_EthernetFilter * This, - /* [in] */ ULONG ulModeMask); - - -void __RPC_STUB IBDA_EthernetFilter_PutMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_EthernetFilter_GetMulticastMode_Proxy( - IBDA_EthernetFilter * This, - /* [out] */ ULONG *pulModeMask); - - -void __RPC_STUB IBDA_EthernetFilter_GetMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_EthernetFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_IPV4Filter_INTERFACE_DEFINED__ -#define __IBDA_IPV4Filter_INTERFACE_DEFINED__ - -/* interface IBDA_IPV4Filter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_IPV4Filter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("71985F44-1CA1-11d3-9CC8-00C04F7971E0") - IBDA_IPV4Filter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMulticastListSize( - /* [out][in] */ ULONG *pulcbAddresses) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastList( - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastList( - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastMode( - /* [in] */ ULONG ulModeMask) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastMode( - /* [out] */ ULONG *pulModeMask) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_IPV4FilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_IPV4Filter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_IPV4Filter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_IPV4Filter * This); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastListSize )( - IBDA_IPV4Filter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastList )( - IBDA_IPV4Filter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastList )( - IBDA_IPV4Filter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastMode )( - IBDA_IPV4Filter * This, - /* [in] */ ULONG ulModeMask); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastMode )( - IBDA_IPV4Filter * This, - /* [out] */ ULONG *pulModeMask); - - END_INTERFACE - } IBDA_IPV4FilterVtbl; - - interface IBDA_IPV4Filter - { - CONST_VTBL struct IBDA_IPV4FilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_IPV4Filter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_IPV4Filter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_IPV4Filter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_IPV4Filter_GetMulticastListSize(This,pulcbAddresses) \ - (This)->lpVtbl -> GetMulticastListSize(This,pulcbAddresses) - -#define IBDA_IPV4Filter_PutMulticastList(This,ulcbAddresses,pAddressList) \ - (This)->lpVtbl -> PutMulticastList(This,ulcbAddresses,pAddressList) - -#define IBDA_IPV4Filter_GetMulticastList(This,pulcbAddresses,pAddressList) \ - (This)->lpVtbl -> GetMulticastList(This,pulcbAddresses,pAddressList) - -#define IBDA_IPV4Filter_PutMulticastMode(This,ulModeMask) \ - (This)->lpVtbl -> PutMulticastMode(This,ulModeMask) - -#define IBDA_IPV4Filter_GetMulticastMode(This,pulModeMask) \ - (This)->lpVtbl -> GetMulticastMode(This,pulModeMask) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_IPV4Filter_GetMulticastListSize_Proxy( - IBDA_IPV4Filter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - -void __RPC_STUB IBDA_IPV4Filter_GetMulticastListSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV4Filter_PutMulticastList_Proxy( - IBDA_IPV4Filter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_IPV4Filter_PutMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV4Filter_GetMulticastList_Proxy( - IBDA_IPV4Filter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_IPV4Filter_GetMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV4Filter_PutMulticastMode_Proxy( - IBDA_IPV4Filter * This, - /* [in] */ ULONG ulModeMask); - - -void __RPC_STUB IBDA_IPV4Filter_PutMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV4Filter_GetMulticastMode_Proxy( - IBDA_IPV4Filter * This, - /* [out] */ ULONG *pulModeMask); - - -void __RPC_STUB IBDA_IPV4Filter_GetMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_IPV4Filter_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_IPV6Filter_INTERFACE_DEFINED__ -#define __IBDA_IPV6Filter_INTERFACE_DEFINED__ - -/* interface IBDA_IPV6Filter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_IPV6Filter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E1785A74-2A23-4fb3-9245-A8F88017EF33") - IBDA_IPV6Filter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMulticastListSize( - /* [out][in] */ ULONG *pulcbAddresses) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastList( - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastList( - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutMulticastMode( - /* [in] */ ULONG ulModeMask) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMulticastMode( - /* [out] */ ULONG *pulModeMask) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_IPV6FilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_IPV6Filter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_IPV6Filter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_IPV6Filter * This); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastListSize )( - IBDA_IPV6Filter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastList )( - IBDA_IPV6Filter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastList )( - IBDA_IPV6Filter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - HRESULT ( STDMETHODCALLTYPE *PutMulticastMode )( - IBDA_IPV6Filter * This, - /* [in] */ ULONG ulModeMask); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastMode )( - IBDA_IPV6Filter * This, - /* [out] */ ULONG *pulModeMask); - - END_INTERFACE - } IBDA_IPV6FilterVtbl; - - interface IBDA_IPV6Filter - { - CONST_VTBL struct IBDA_IPV6FilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_IPV6Filter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_IPV6Filter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_IPV6Filter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_IPV6Filter_GetMulticastListSize(This,pulcbAddresses) \ - (This)->lpVtbl -> GetMulticastListSize(This,pulcbAddresses) - -#define IBDA_IPV6Filter_PutMulticastList(This,ulcbAddresses,pAddressList) \ - (This)->lpVtbl -> PutMulticastList(This,ulcbAddresses,pAddressList) - -#define IBDA_IPV6Filter_GetMulticastList(This,pulcbAddresses,pAddressList) \ - (This)->lpVtbl -> GetMulticastList(This,pulcbAddresses,pAddressList) - -#define IBDA_IPV6Filter_PutMulticastMode(This,ulModeMask) \ - (This)->lpVtbl -> PutMulticastMode(This,ulModeMask) - -#define IBDA_IPV6Filter_GetMulticastMode(This,pulModeMask) \ - (This)->lpVtbl -> GetMulticastMode(This,pulModeMask) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_IPV6Filter_GetMulticastListSize_Proxy( - IBDA_IPV6Filter * This, - /* [out][in] */ ULONG *pulcbAddresses); - - -void __RPC_STUB IBDA_IPV6Filter_GetMulticastListSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV6Filter_PutMulticastList_Proxy( - IBDA_IPV6Filter * This, - /* [in] */ ULONG ulcbAddresses, - /* [size_is][in] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_IPV6Filter_PutMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV6Filter_GetMulticastList_Proxy( - IBDA_IPV6Filter * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE pAddressList[ ]); - - -void __RPC_STUB IBDA_IPV6Filter_GetMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV6Filter_PutMulticastMode_Proxy( - IBDA_IPV6Filter * This, - /* [in] */ ULONG ulModeMask); - - -void __RPC_STUB IBDA_IPV6Filter_PutMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPV6Filter_GetMulticastMode_Proxy( - IBDA_IPV6Filter * This, - /* [out] */ ULONG *pulModeMask); - - -void __RPC_STUB IBDA_IPV6Filter_GetMulticastMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_IPV6Filter_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_DeviceControl_INTERFACE_DEFINED__ -#define __IBDA_DeviceControl_INTERFACE_DEFINED__ - -/* interface IBDA_DeviceControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_DeviceControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FD0A5AF3-B41D-11d2-9C95-00C04F7971E0") - IBDA_DeviceControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE StartChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE CheckChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE CommitChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetChangeState( - /* [out][in] */ ULONG *pState) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_DeviceControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_DeviceControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_DeviceControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_DeviceControl * This); - - HRESULT ( STDMETHODCALLTYPE *StartChanges )( - IBDA_DeviceControl * This); - - HRESULT ( STDMETHODCALLTYPE *CheckChanges )( - IBDA_DeviceControl * This); - - HRESULT ( STDMETHODCALLTYPE *CommitChanges )( - IBDA_DeviceControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetChangeState )( - IBDA_DeviceControl * This, - /* [out][in] */ ULONG *pState); - - END_INTERFACE - } IBDA_DeviceControlVtbl; - - interface IBDA_DeviceControl - { - CONST_VTBL struct IBDA_DeviceControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_DeviceControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_DeviceControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_DeviceControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_DeviceControl_StartChanges(This) \ - (This)->lpVtbl -> StartChanges(This) - -#define IBDA_DeviceControl_CheckChanges(This) \ - (This)->lpVtbl -> CheckChanges(This) - -#define IBDA_DeviceControl_CommitChanges(This) \ - (This)->lpVtbl -> CommitChanges(This) - -#define IBDA_DeviceControl_GetChangeState(This,pState) \ - (This)->lpVtbl -> GetChangeState(This,pState) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_DeviceControl_StartChanges_Proxy( - IBDA_DeviceControl * This); - - -void __RPC_STUB IBDA_DeviceControl_StartChanges_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DeviceControl_CheckChanges_Proxy( - IBDA_DeviceControl * This); - - -void __RPC_STUB IBDA_DeviceControl_CheckChanges_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DeviceControl_CommitChanges_Proxy( - IBDA_DeviceControl * This); - - -void __RPC_STUB IBDA_DeviceControl_CommitChanges_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DeviceControl_GetChangeState_Proxy( - IBDA_DeviceControl * This, - /* [out][in] */ ULONG *pState); - - -void __RPC_STUB IBDA_DeviceControl_GetChangeState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_DeviceControl_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_PinControl_INTERFACE_DEFINED__ -#define __IBDA_PinControl_INTERFACE_DEFINED__ - -/* interface IBDA_PinControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_PinControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0DED49D5-A8B7-4d5d-97A1-12B0C195874D") - IBDA_PinControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPinID( - /* [out][in] */ ULONG *pulPinID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPinType( - /* [out][in] */ ULONG *pulPinType) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegistrationContext( - /* [out][in] */ ULONG *pulRegistrationCtx) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_PinControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_PinControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_PinControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_PinControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetPinID )( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulPinID); - - HRESULT ( STDMETHODCALLTYPE *GetPinType )( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulPinType); - - HRESULT ( STDMETHODCALLTYPE *RegistrationContext )( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulRegistrationCtx); - - END_INTERFACE - } IBDA_PinControlVtbl; - - interface IBDA_PinControl - { - CONST_VTBL struct IBDA_PinControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_PinControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_PinControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_PinControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_PinControl_GetPinID(This,pulPinID) \ - (This)->lpVtbl -> GetPinID(This,pulPinID) - -#define IBDA_PinControl_GetPinType(This,pulPinType) \ - (This)->lpVtbl -> GetPinType(This,pulPinType) - -#define IBDA_PinControl_RegistrationContext(This,pulRegistrationCtx) \ - (This)->lpVtbl -> RegistrationContext(This,pulRegistrationCtx) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_PinControl_GetPinID_Proxy( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulPinID); - - -void __RPC_STUB IBDA_PinControl_GetPinID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_PinControl_GetPinType_Proxy( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulPinType); - - -void __RPC_STUB IBDA_PinControl_GetPinType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_PinControl_RegistrationContext_Proxy( - IBDA_PinControl * This, - /* [out][in] */ ULONG *pulRegistrationCtx); - - -void __RPC_STUB IBDA_PinControl_RegistrationContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_PinControl_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_SignalProperties_INTERFACE_DEFINED__ -#define __IBDA_SignalProperties_INTERFACE_DEFINED__ - -/* interface IBDA_SignalProperties */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_SignalProperties; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D2F1644B-B409-11d2-BC69-00A0C9EE9E16") - IBDA_SignalProperties : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE PutNetworkType( - /* [in] */ REFGUID guidNetworkType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNetworkType( - /* [out][in] */ GUID *pguidNetworkType) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutSignalSource( - /* [in] */ ULONG ulSignalSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSignalSource( - /* [out][in] */ ULONG *pulSignalSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE PutTuningSpace( - /* [in] */ REFGUID guidTuningSpace) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTuningSpace( - /* [out][in] */ GUID *pguidTuingSpace) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_SignalPropertiesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_SignalProperties * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_SignalProperties * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_SignalProperties * This); - - HRESULT ( STDMETHODCALLTYPE *PutNetworkType )( - IBDA_SignalProperties * This, - /* [in] */ REFGUID guidNetworkType); - - HRESULT ( STDMETHODCALLTYPE *GetNetworkType )( - IBDA_SignalProperties * This, - /* [out][in] */ GUID *pguidNetworkType); - - HRESULT ( STDMETHODCALLTYPE *PutSignalSource )( - IBDA_SignalProperties * This, - /* [in] */ ULONG ulSignalSource); - - HRESULT ( STDMETHODCALLTYPE *GetSignalSource )( - IBDA_SignalProperties * This, - /* [out][in] */ ULONG *pulSignalSource); - - HRESULT ( STDMETHODCALLTYPE *PutTuningSpace )( - IBDA_SignalProperties * This, - /* [in] */ REFGUID guidTuningSpace); - - HRESULT ( STDMETHODCALLTYPE *GetTuningSpace )( - IBDA_SignalProperties * This, - /* [out][in] */ GUID *pguidTuingSpace); - - END_INTERFACE - } IBDA_SignalPropertiesVtbl; - - interface IBDA_SignalProperties - { - CONST_VTBL struct IBDA_SignalPropertiesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_SignalProperties_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_SignalProperties_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_SignalProperties_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_SignalProperties_PutNetworkType(This,guidNetworkType) \ - (This)->lpVtbl -> PutNetworkType(This,guidNetworkType) - -#define IBDA_SignalProperties_GetNetworkType(This,pguidNetworkType) \ - (This)->lpVtbl -> GetNetworkType(This,pguidNetworkType) - -#define IBDA_SignalProperties_PutSignalSource(This,ulSignalSource) \ - (This)->lpVtbl -> PutSignalSource(This,ulSignalSource) - -#define IBDA_SignalProperties_GetSignalSource(This,pulSignalSource) \ - (This)->lpVtbl -> GetSignalSource(This,pulSignalSource) - -#define IBDA_SignalProperties_PutTuningSpace(This,guidTuningSpace) \ - (This)->lpVtbl -> PutTuningSpace(This,guidTuningSpace) - -#define IBDA_SignalProperties_GetTuningSpace(This,pguidTuingSpace) \ - (This)->lpVtbl -> GetTuningSpace(This,pguidTuingSpace) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_PutNetworkType_Proxy( - IBDA_SignalProperties * This, - /* [in] */ REFGUID guidNetworkType); - - -void __RPC_STUB IBDA_SignalProperties_PutNetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_GetNetworkType_Proxy( - IBDA_SignalProperties * This, - /* [out][in] */ GUID *pguidNetworkType); - - -void __RPC_STUB IBDA_SignalProperties_GetNetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_PutSignalSource_Proxy( - IBDA_SignalProperties * This, - /* [in] */ ULONG ulSignalSource); - - -void __RPC_STUB IBDA_SignalProperties_PutSignalSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_GetSignalSource_Proxy( - IBDA_SignalProperties * This, - /* [out][in] */ ULONG *pulSignalSource); - - -void __RPC_STUB IBDA_SignalProperties_GetSignalSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_PutTuningSpace_Proxy( - IBDA_SignalProperties * This, - /* [in] */ REFGUID guidTuningSpace); - - -void __RPC_STUB IBDA_SignalProperties_PutTuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalProperties_GetTuningSpace_Proxy( - IBDA_SignalProperties * This, - /* [out][in] */ GUID *pguidTuingSpace); - - -void __RPC_STUB IBDA_SignalProperties_GetTuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_SignalProperties_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_SignalStatistics_INTERFACE_DEFINED__ -#define __IBDA_SignalStatistics_INTERFACE_DEFINED__ - -/* interface IBDA_SignalStatistics */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_SignalStatistics; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1347D106-CF3A-428a-A5CB-AC0D9A2A4338") - IBDA_SignalStatistics : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_SignalStrength( - /* [in] */ LONG lDbStrength) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SignalStrength( - /* [out][in] */ LONG *plDbStrength) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SignalQuality( - /* [in] */ LONG lPercentQuality) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SignalQuality( - /* [out][in] */ LONG *plPercentQuality) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SignalPresent( - /* [in] */ BOOLEAN fPresent) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SignalPresent( - /* [out][in] */ BOOLEAN *pfPresent) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SignalLocked( - /* [in] */ BOOLEAN fLocked) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SignalLocked( - /* [out][in] */ BOOLEAN *pfLocked) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SampleTime( - /* [in] */ LONG lmsSampleTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SampleTime( - /* [out][in] */ LONG *plmsSampleTime) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_SignalStatisticsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_SignalStatistics * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_SignalStatistics * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_SignalStatistics * This); - - HRESULT ( STDMETHODCALLTYPE *put_SignalStrength )( - IBDA_SignalStatistics * This, - /* [in] */ LONG lDbStrength); - - HRESULT ( STDMETHODCALLTYPE *get_SignalStrength )( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plDbStrength); - - HRESULT ( STDMETHODCALLTYPE *put_SignalQuality )( - IBDA_SignalStatistics * This, - /* [in] */ LONG lPercentQuality); - - HRESULT ( STDMETHODCALLTYPE *get_SignalQuality )( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plPercentQuality); - - HRESULT ( STDMETHODCALLTYPE *put_SignalPresent )( - IBDA_SignalStatistics * This, - /* [in] */ BOOLEAN fPresent); - - HRESULT ( STDMETHODCALLTYPE *get_SignalPresent )( - IBDA_SignalStatistics * This, - /* [out][in] */ BOOLEAN *pfPresent); - - HRESULT ( STDMETHODCALLTYPE *put_SignalLocked )( - IBDA_SignalStatistics * This, - /* [in] */ BOOLEAN fLocked); - - HRESULT ( STDMETHODCALLTYPE *get_SignalLocked )( - IBDA_SignalStatistics * This, - /* [out][in] */ BOOLEAN *pfLocked); - - HRESULT ( STDMETHODCALLTYPE *put_SampleTime )( - IBDA_SignalStatistics * This, - /* [in] */ LONG lmsSampleTime); - - HRESULT ( STDMETHODCALLTYPE *get_SampleTime )( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plmsSampleTime); - - END_INTERFACE - } IBDA_SignalStatisticsVtbl; - - interface IBDA_SignalStatistics - { - CONST_VTBL struct IBDA_SignalStatisticsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_SignalStatistics_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_SignalStatistics_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_SignalStatistics_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_SignalStatistics_put_SignalStrength(This,lDbStrength) \ - (This)->lpVtbl -> put_SignalStrength(This,lDbStrength) - -#define IBDA_SignalStatistics_get_SignalStrength(This,plDbStrength) \ - (This)->lpVtbl -> get_SignalStrength(This,plDbStrength) - -#define IBDA_SignalStatistics_put_SignalQuality(This,lPercentQuality) \ - (This)->lpVtbl -> put_SignalQuality(This,lPercentQuality) - -#define IBDA_SignalStatistics_get_SignalQuality(This,plPercentQuality) \ - (This)->lpVtbl -> get_SignalQuality(This,plPercentQuality) - -#define IBDA_SignalStatistics_put_SignalPresent(This,fPresent) \ - (This)->lpVtbl -> put_SignalPresent(This,fPresent) - -#define IBDA_SignalStatistics_get_SignalPresent(This,pfPresent) \ - (This)->lpVtbl -> get_SignalPresent(This,pfPresent) - -#define IBDA_SignalStatistics_put_SignalLocked(This,fLocked) \ - (This)->lpVtbl -> put_SignalLocked(This,fLocked) - -#define IBDA_SignalStatistics_get_SignalLocked(This,pfLocked) \ - (This)->lpVtbl -> get_SignalLocked(This,pfLocked) - -#define IBDA_SignalStatistics_put_SampleTime(This,lmsSampleTime) \ - (This)->lpVtbl -> put_SampleTime(This,lmsSampleTime) - -#define IBDA_SignalStatistics_get_SampleTime(This,plmsSampleTime) \ - (This)->lpVtbl -> get_SampleTime(This,plmsSampleTime) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_put_SignalStrength_Proxy( - IBDA_SignalStatistics * This, - /* [in] */ LONG lDbStrength); - - -void __RPC_STUB IBDA_SignalStatistics_put_SignalStrength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_get_SignalStrength_Proxy( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plDbStrength); - - -void __RPC_STUB IBDA_SignalStatistics_get_SignalStrength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_put_SignalQuality_Proxy( - IBDA_SignalStatistics * This, - /* [in] */ LONG lPercentQuality); - - -void __RPC_STUB IBDA_SignalStatistics_put_SignalQuality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_get_SignalQuality_Proxy( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plPercentQuality); - - -void __RPC_STUB IBDA_SignalStatistics_get_SignalQuality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_put_SignalPresent_Proxy( - IBDA_SignalStatistics * This, - /* [in] */ BOOLEAN fPresent); - - -void __RPC_STUB IBDA_SignalStatistics_put_SignalPresent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_get_SignalPresent_Proxy( - IBDA_SignalStatistics * This, - /* [out][in] */ BOOLEAN *pfPresent); - - -void __RPC_STUB IBDA_SignalStatistics_get_SignalPresent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_put_SignalLocked_Proxy( - IBDA_SignalStatistics * This, - /* [in] */ BOOLEAN fLocked); - - -void __RPC_STUB IBDA_SignalStatistics_put_SignalLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_get_SignalLocked_Proxy( - IBDA_SignalStatistics * This, - /* [out][in] */ BOOLEAN *pfLocked); - - -void __RPC_STUB IBDA_SignalStatistics_get_SignalLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_put_SampleTime_Proxy( - IBDA_SignalStatistics * This, - /* [in] */ LONG lmsSampleTime); - - -void __RPC_STUB IBDA_SignalStatistics_put_SampleTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_SignalStatistics_get_SampleTime_Proxy( - IBDA_SignalStatistics * This, - /* [out][in] */ LONG *plmsSampleTime); - - -void __RPC_STUB IBDA_SignalStatistics_get_SampleTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_SignalStatistics_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_Topology_INTERFACE_DEFINED__ -#define __IBDA_Topology_INTERFACE_DEFINED__ - -/* interface IBDA_Topology */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_Topology; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("79B56888-7FEA-4690-B45D-38FD3C7849BE") - IBDA_Topology : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetNodeTypes( - /* [out][in] */ ULONG *pulcNodeTypes, - /* [in] */ ULONG ulcNodeTypesMax, - /* [size_is][out][in] */ ULONG rgulNodeTypes[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNodeDescriptors( - /* [out][in] */ ULONG *ulcNodeDescriptors, - /* [in] */ ULONG ulcNodeDescriptorsMax, - /* [size_is][out][in] */ BDANODE_DESCRIPTOR rgNodeDescriptors[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNodeInterfaces( - /* [in] */ ULONG ulNodeType, - /* [out][in] */ ULONG *pulcInterfaces, - /* [in] */ ULONG ulcInterfacesMax, - /* [size_is][out][in] */ GUID rgguidInterfaces[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPinTypes( - /* [out][in] */ ULONG *pulcPinTypes, - /* [in] */ ULONG ulcPinTypesMax, - /* [size_is][out][in] */ ULONG rgulPinTypes[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTemplateConnections( - /* [out][in] */ ULONG *pulcConnections, - /* [in] */ ULONG ulcConnectionsMax, - /* [size_is][out][in] */ BDA_TEMPLATE_CONNECTION rgConnections[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreatePin( - /* [in] */ ULONG ulPinType, - /* [out][in] */ ULONG *pulPinId) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeletePin( - /* [in] */ ULONG ulPinId) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - /* [in] */ ULONG ulPinId, - /* [in] */ AM_MEDIA_TYPE *pMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMedium( - /* [in] */ ULONG ulPinId, - /* [in] */ REGPINMEDIUM *pMedium) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateTopology( - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetControlNode( - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId, - /* [in] */ ULONG ulNodeType, - /* [out][in] */ IUnknown **ppControlNode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_TopologyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_Topology * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_Topology * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_Topology * This); - - HRESULT ( STDMETHODCALLTYPE *GetNodeTypes )( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcNodeTypes, - /* [in] */ ULONG ulcNodeTypesMax, - /* [size_is][out][in] */ ULONG rgulNodeTypes[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetNodeDescriptors )( - IBDA_Topology * This, - /* [out][in] */ ULONG *ulcNodeDescriptors, - /* [in] */ ULONG ulcNodeDescriptorsMax, - /* [size_is][out][in] */ BDANODE_DESCRIPTOR rgNodeDescriptors[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetNodeInterfaces )( - IBDA_Topology * This, - /* [in] */ ULONG ulNodeType, - /* [out][in] */ ULONG *pulcInterfaces, - /* [in] */ ULONG ulcInterfacesMax, - /* [size_is][out][in] */ GUID rgguidInterfaces[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetPinTypes )( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcPinTypes, - /* [in] */ ULONG ulcPinTypesMax, - /* [size_is][out][in] */ ULONG rgulPinTypes[ ]); - - HRESULT ( STDMETHODCALLTYPE *GetTemplateConnections )( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcConnections, - /* [in] */ ULONG ulcConnectionsMax, - /* [size_is][out][in] */ BDA_TEMPLATE_CONNECTION rgConnections[ ]); - - HRESULT ( STDMETHODCALLTYPE *CreatePin )( - IBDA_Topology * This, - /* [in] */ ULONG ulPinType, - /* [out][in] */ ULONG *pulPinId); - - HRESULT ( STDMETHODCALLTYPE *DeletePin )( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId, - /* [in] */ AM_MEDIA_TYPE *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *SetMedium )( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId, - /* [in] */ REGPINMEDIUM *pMedium); - - HRESULT ( STDMETHODCALLTYPE *CreateTopology )( - IBDA_Topology * This, - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId); - - HRESULT ( STDMETHODCALLTYPE *GetControlNode )( - IBDA_Topology * This, - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId, - /* [in] */ ULONG ulNodeType, - /* [out][in] */ IUnknown **ppControlNode); - - END_INTERFACE - } IBDA_TopologyVtbl; - - interface IBDA_Topology - { - CONST_VTBL struct IBDA_TopologyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_Topology_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_Topology_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_Topology_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_Topology_GetNodeTypes(This,pulcNodeTypes,ulcNodeTypesMax,rgulNodeTypes) \ - (This)->lpVtbl -> GetNodeTypes(This,pulcNodeTypes,ulcNodeTypesMax,rgulNodeTypes) - -#define IBDA_Topology_GetNodeDescriptors(This,ulcNodeDescriptors,ulcNodeDescriptorsMax,rgNodeDescriptors) \ - (This)->lpVtbl -> GetNodeDescriptors(This,ulcNodeDescriptors,ulcNodeDescriptorsMax,rgNodeDescriptors) - -#define IBDA_Topology_GetNodeInterfaces(This,ulNodeType,pulcInterfaces,ulcInterfacesMax,rgguidInterfaces) \ - (This)->lpVtbl -> GetNodeInterfaces(This,ulNodeType,pulcInterfaces,ulcInterfacesMax,rgguidInterfaces) - -#define IBDA_Topology_GetPinTypes(This,pulcPinTypes,ulcPinTypesMax,rgulPinTypes) \ - (This)->lpVtbl -> GetPinTypes(This,pulcPinTypes,ulcPinTypesMax,rgulPinTypes) - -#define IBDA_Topology_GetTemplateConnections(This,pulcConnections,ulcConnectionsMax,rgConnections) \ - (This)->lpVtbl -> GetTemplateConnections(This,pulcConnections,ulcConnectionsMax,rgConnections) - -#define IBDA_Topology_CreatePin(This,ulPinType,pulPinId) \ - (This)->lpVtbl -> CreatePin(This,ulPinType,pulPinId) - -#define IBDA_Topology_DeletePin(This,ulPinId) \ - (This)->lpVtbl -> DeletePin(This,ulPinId) - -#define IBDA_Topology_SetMediaType(This,ulPinId,pMediaType) \ - (This)->lpVtbl -> SetMediaType(This,ulPinId,pMediaType) - -#define IBDA_Topology_SetMedium(This,ulPinId,pMedium) \ - (This)->lpVtbl -> SetMedium(This,ulPinId,pMedium) - -#define IBDA_Topology_CreateTopology(This,ulInputPinId,ulOutputPinId) \ - (This)->lpVtbl -> CreateTopology(This,ulInputPinId,ulOutputPinId) - -#define IBDA_Topology_GetControlNode(This,ulInputPinId,ulOutputPinId,ulNodeType,ppControlNode) \ - (This)->lpVtbl -> GetControlNode(This,ulInputPinId,ulOutputPinId,ulNodeType,ppControlNode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetNodeTypes_Proxy( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcNodeTypes, - /* [in] */ ULONG ulcNodeTypesMax, - /* [size_is][out][in] */ ULONG rgulNodeTypes[ ]); - - -void __RPC_STUB IBDA_Topology_GetNodeTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetNodeDescriptors_Proxy( - IBDA_Topology * This, - /* [out][in] */ ULONG *ulcNodeDescriptors, - /* [in] */ ULONG ulcNodeDescriptorsMax, - /* [size_is][out][in] */ BDANODE_DESCRIPTOR rgNodeDescriptors[ ]); - - -void __RPC_STUB IBDA_Topology_GetNodeDescriptors_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetNodeInterfaces_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulNodeType, - /* [out][in] */ ULONG *pulcInterfaces, - /* [in] */ ULONG ulcInterfacesMax, - /* [size_is][out][in] */ GUID rgguidInterfaces[ ]); - - -void __RPC_STUB IBDA_Topology_GetNodeInterfaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetPinTypes_Proxy( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcPinTypes, - /* [in] */ ULONG ulcPinTypesMax, - /* [size_is][out][in] */ ULONG rgulPinTypes[ ]); - - -void __RPC_STUB IBDA_Topology_GetPinTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetTemplateConnections_Proxy( - IBDA_Topology * This, - /* [out][in] */ ULONG *pulcConnections, - /* [in] */ ULONG ulcConnectionsMax, - /* [size_is][out][in] */ BDA_TEMPLATE_CONNECTION rgConnections[ ]); - - -void __RPC_STUB IBDA_Topology_GetTemplateConnections_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_CreatePin_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulPinType, - /* [out][in] */ ULONG *pulPinId); - - -void __RPC_STUB IBDA_Topology_CreatePin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_DeletePin_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId); - - -void __RPC_STUB IBDA_Topology_DeletePin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_SetMediaType_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId, - /* [in] */ AM_MEDIA_TYPE *pMediaType); - - -void __RPC_STUB IBDA_Topology_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_SetMedium_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulPinId, - /* [in] */ REGPINMEDIUM *pMedium); - - -void __RPC_STUB IBDA_Topology_SetMedium_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_CreateTopology_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId); - - -void __RPC_STUB IBDA_Topology_CreateTopology_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_Topology_GetControlNode_Proxy( - IBDA_Topology * This, - /* [in] */ ULONG ulInputPinId, - /* [in] */ ULONG ulOutputPinId, - /* [in] */ ULONG ulNodeType, - /* [out][in] */ IUnknown **ppControlNode); - - -void __RPC_STUB IBDA_Topology_GetControlNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_Topology_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_VoidTransform_INTERFACE_DEFINED__ -#define __IBDA_VoidTransform_INTERFACE_DEFINED__ - -/* interface IBDA_VoidTransform */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_VoidTransform; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("71985F46-1CA1-11d3-9CC8-00C04F7971E0") - IBDA_VoidTransform : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Start( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_VoidTransformVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_VoidTransform * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_VoidTransform * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_VoidTransform * This); - - HRESULT ( STDMETHODCALLTYPE *Start )( - IBDA_VoidTransform * This); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IBDA_VoidTransform * This); - - END_INTERFACE - } IBDA_VoidTransformVtbl; - - interface IBDA_VoidTransform - { - CONST_VTBL struct IBDA_VoidTransformVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_VoidTransform_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_VoidTransform_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_VoidTransform_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_VoidTransform_Start(This) \ - (This)->lpVtbl -> Start(This) - -#define IBDA_VoidTransform_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_VoidTransform_Start_Proxy( - IBDA_VoidTransform * This); - - -void __RPC_STUB IBDA_VoidTransform_Start_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_VoidTransform_Stop_Proxy( - IBDA_VoidTransform * This); - - -void __RPC_STUB IBDA_VoidTransform_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_VoidTransform_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_NullTransform_INTERFACE_DEFINED__ -#define __IBDA_NullTransform_INTERFACE_DEFINED__ - -/* interface IBDA_NullTransform */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_NullTransform; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DDF15B0D-BD25-11d2-9CA0-00C04F7971E0") - IBDA_NullTransform : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Start( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_NullTransformVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_NullTransform * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_NullTransform * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_NullTransform * This); - - HRESULT ( STDMETHODCALLTYPE *Start )( - IBDA_NullTransform * This); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IBDA_NullTransform * This); - - END_INTERFACE - } IBDA_NullTransformVtbl; - - interface IBDA_NullTransform - { - CONST_VTBL struct IBDA_NullTransformVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_NullTransform_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_NullTransform_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_NullTransform_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_NullTransform_Start(This) \ - (This)->lpVtbl -> Start(This) - -#define IBDA_NullTransform_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_NullTransform_Start_Proxy( - IBDA_NullTransform * This); - - -void __RPC_STUB IBDA_NullTransform_Start_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_NullTransform_Stop_Proxy( - IBDA_NullTransform * This); - - -void __RPC_STUB IBDA_NullTransform_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_NullTransform_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_FrequencyFilter_INTERFACE_DEFINED__ -#define __IBDA_FrequencyFilter_INTERFACE_DEFINED__ - -/* interface IBDA_FrequencyFilter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_FrequencyFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("71985F47-1CA1-11d3-9CC8-00C04F7971E0") - IBDA_FrequencyFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_Autotune( - /* [in] */ ULONG ulTransponder) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Autotune( - /* [out][in] */ ULONG *pulTransponder) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Frequency( - /* [in] */ ULONG ulFrequency) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Frequency( - /* [out][in] */ ULONG *pulFrequency) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Polarity( - /* [in] */ Polarisation Polarity) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Polarity( - /* [out][in] */ Polarisation *pPolarity) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Range( - /* [in] */ ULONG ulRange) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Range( - /* [out][in] */ ULONG *pulRange) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Bandwidth( - /* [in] */ ULONG ulBandwidth) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Bandwidth( - /* [out][in] */ ULONG *pulBandwidth) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_FrequencyMultiplier( - /* [in] */ ULONG ulMultiplier) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_FrequencyMultiplier( - /* [out][in] */ ULONG *pulMultiplier) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_FrequencyFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_FrequencyFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_FrequencyFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_FrequencyFilter * This); - - HRESULT ( STDMETHODCALLTYPE *put_Autotune )( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulTransponder); - - HRESULT ( STDMETHODCALLTYPE *get_Autotune )( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulTransponder); - - HRESULT ( STDMETHODCALLTYPE *put_Frequency )( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulFrequency); - - HRESULT ( STDMETHODCALLTYPE *get_Frequency )( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulFrequency); - - HRESULT ( STDMETHODCALLTYPE *put_Polarity )( - IBDA_FrequencyFilter * This, - /* [in] */ Polarisation Polarity); - - HRESULT ( STDMETHODCALLTYPE *get_Polarity )( - IBDA_FrequencyFilter * This, - /* [out][in] */ Polarisation *pPolarity); - - HRESULT ( STDMETHODCALLTYPE *put_Range )( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulRange); - - HRESULT ( STDMETHODCALLTYPE *get_Range )( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulRange); - - HRESULT ( STDMETHODCALLTYPE *put_Bandwidth )( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulBandwidth); - - HRESULT ( STDMETHODCALLTYPE *get_Bandwidth )( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulBandwidth); - - HRESULT ( STDMETHODCALLTYPE *put_FrequencyMultiplier )( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulMultiplier); - - HRESULT ( STDMETHODCALLTYPE *get_FrequencyMultiplier )( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulMultiplier); - - END_INTERFACE - } IBDA_FrequencyFilterVtbl; - - interface IBDA_FrequencyFilter - { - CONST_VTBL struct IBDA_FrequencyFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_FrequencyFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_FrequencyFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_FrequencyFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_FrequencyFilter_put_Autotune(This,ulTransponder) \ - (This)->lpVtbl -> put_Autotune(This,ulTransponder) - -#define IBDA_FrequencyFilter_get_Autotune(This,pulTransponder) \ - (This)->lpVtbl -> get_Autotune(This,pulTransponder) - -#define IBDA_FrequencyFilter_put_Frequency(This,ulFrequency) \ - (This)->lpVtbl -> put_Frequency(This,ulFrequency) - -#define IBDA_FrequencyFilter_get_Frequency(This,pulFrequency) \ - (This)->lpVtbl -> get_Frequency(This,pulFrequency) - -#define IBDA_FrequencyFilter_put_Polarity(This,Polarity) \ - (This)->lpVtbl -> put_Polarity(This,Polarity) - -#define IBDA_FrequencyFilter_get_Polarity(This,pPolarity) \ - (This)->lpVtbl -> get_Polarity(This,pPolarity) - -#define IBDA_FrequencyFilter_put_Range(This,ulRange) \ - (This)->lpVtbl -> put_Range(This,ulRange) - -#define IBDA_FrequencyFilter_get_Range(This,pulRange) \ - (This)->lpVtbl -> get_Range(This,pulRange) - -#define IBDA_FrequencyFilter_put_Bandwidth(This,ulBandwidth) \ - (This)->lpVtbl -> put_Bandwidth(This,ulBandwidth) - -#define IBDA_FrequencyFilter_get_Bandwidth(This,pulBandwidth) \ - (This)->lpVtbl -> get_Bandwidth(This,pulBandwidth) - -#define IBDA_FrequencyFilter_put_FrequencyMultiplier(This,ulMultiplier) \ - (This)->lpVtbl -> put_FrequencyMultiplier(This,ulMultiplier) - -#define IBDA_FrequencyFilter_get_FrequencyMultiplier(This,pulMultiplier) \ - (This)->lpVtbl -> get_FrequencyMultiplier(This,pulMultiplier) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_Autotune_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulTransponder); - - -void __RPC_STUB IBDA_FrequencyFilter_put_Autotune_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_Autotune_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulTransponder); - - -void __RPC_STUB IBDA_FrequencyFilter_get_Autotune_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_Frequency_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulFrequency); - - -void __RPC_STUB IBDA_FrequencyFilter_put_Frequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_Frequency_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulFrequency); - - -void __RPC_STUB IBDA_FrequencyFilter_get_Frequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_Polarity_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ Polarisation Polarity); - - -void __RPC_STUB IBDA_FrequencyFilter_put_Polarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_Polarity_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ Polarisation *pPolarity); - - -void __RPC_STUB IBDA_FrequencyFilter_get_Polarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_Range_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulRange); - - -void __RPC_STUB IBDA_FrequencyFilter_put_Range_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_Range_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulRange); - - -void __RPC_STUB IBDA_FrequencyFilter_get_Range_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_Bandwidth_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulBandwidth); - - -void __RPC_STUB IBDA_FrequencyFilter_put_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_Bandwidth_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulBandwidth); - - -void __RPC_STUB IBDA_FrequencyFilter_get_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_put_FrequencyMultiplier_Proxy( - IBDA_FrequencyFilter * This, - /* [in] */ ULONG ulMultiplier); - - -void __RPC_STUB IBDA_FrequencyFilter_put_FrequencyMultiplier_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_FrequencyFilter_get_FrequencyMultiplier_Proxy( - IBDA_FrequencyFilter * This, - /* [out][in] */ ULONG *pulMultiplier); - - -void __RPC_STUB IBDA_FrequencyFilter_get_FrequencyMultiplier_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_FrequencyFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_LNBInfo_INTERFACE_DEFINED__ -#define __IBDA_LNBInfo_INTERFACE_DEFINED__ - -/* interface IBDA_LNBInfo */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_LNBInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("992CF102-49F9-4719-A664-C4F23E2408F4") - IBDA_LNBInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_LocalOscilatorFrequencyLowBand( - /* [in] */ ULONG ulLOFLow) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_LocalOscilatorFrequencyLowBand( - /* [out][in] */ ULONG *pulLOFLow) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_LocalOscilatorFrequencyHighBand( - /* [in] */ ULONG ulLOFHigh) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_LocalOscilatorFrequencyHighBand( - /* [out][in] */ ULONG *pulLOFHigh) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency( - /* [in] */ ULONG ulSwitchFrequency) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency( - /* [out][in] */ ULONG *pulSwitchFrequency) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_LNBInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_LNBInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_LNBInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_LNBInfo * This); - - HRESULT ( STDMETHODCALLTYPE *put_LocalOscilatorFrequencyLowBand )( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulLOFLow); - - HRESULT ( STDMETHODCALLTYPE *get_LocalOscilatorFrequencyLowBand )( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulLOFLow); - - HRESULT ( STDMETHODCALLTYPE *put_LocalOscilatorFrequencyHighBand )( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulLOFHigh); - - HRESULT ( STDMETHODCALLTYPE *get_LocalOscilatorFrequencyHighBand )( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulLOFHigh); - - HRESULT ( STDMETHODCALLTYPE *put_HighLowSwitchFrequency )( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulSwitchFrequency); - - HRESULT ( STDMETHODCALLTYPE *get_HighLowSwitchFrequency )( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulSwitchFrequency); - - END_INTERFACE - } IBDA_LNBInfoVtbl; - - interface IBDA_LNBInfo - { - CONST_VTBL struct IBDA_LNBInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_LNBInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_LNBInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_LNBInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_LNBInfo_put_LocalOscilatorFrequencyLowBand(This,ulLOFLow) \ - (This)->lpVtbl -> put_LocalOscilatorFrequencyLowBand(This,ulLOFLow) - -#define IBDA_LNBInfo_get_LocalOscilatorFrequencyLowBand(This,pulLOFLow) \ - (This)->lpVtbl -> get_LocalOscilatorFrequencyLowBand(This,pulLOFLow) - -#define IBDA_LNBInfo_put_LocalOscilatorFrequencyHighBand(This,ulLOFHigh) \ - (This)->lpVtbl -> put_LocalOscilatorFrequencyHighBand(This,ulLOFHigh) - -#define IBDA_LNBInfo_get_LocalOscilatorFrequencyHighBand(This,pulLOFHigh) \ - (This)->lpVtbl -> get_LocalOscilatorFrequencyHighBand(This,pulLOFHigh) - -#define IBDA_LNBInfo_put_HighLowSwitchFrequency(This,ulSwitchFrequency) \ - (This)->lpVtbl -> put_HighLowSwitchFrequency(This,ulSwitchFrequency) - -#define IBDA_LNBInfo_get_HighLowSwitchFrequency(This,pulSwitchFrequency) \ - (This)->lpVtbl -> get_HighLowSwitchFrequency(This,pulSwitchFrequency) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_put_LocalOscilatorFrequencyLowBand_Proxy( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulLOFLow); - - -void __RPC_STUB IBDA_LNBInfo_put_LocalOscilatorFrequencyLowBand_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_get_LocalOscilatorFrequencyLowBand_Proxy( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulLOFLow); - - -void __RPC_STUB IBDA_LNBInfo_get_LocalOscilatorFrequencyLowBand_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_put_LocalOscilatorFrequencyHighBand_Proxy( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulLOFHigh); - - -void __RPC_STUB IBDA_LNBInfo_put_LocalOscilatorFrequencyHighBand_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_get_LocalOscilatorFrequencyHighBand_Proxy( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulLOFHigh); - - -void __RPC_STUB IBDA_LNBInfo_get_LocalOscilatorFrequencyHighBand_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_put_HighLowSwitchFrequency_Proxy( - IBDA_LNBInfo * This, - /* [in] */ ULONG ulSwitchFrequency); - - -void __RPC_STUB IBDA_LNBInfo_put_HighLowSwitchFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_LNBInfo_get_HighLowSwitchFrequency_Proxy( - IBDA_LNBInfo * This, - /* [out][in] */ ULONG *pulSwitchFrequency); - - -void __RPC_STUB IBDA_LNBInfo_get_HighLowSwitchFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_LNBInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_AutoDemodulate_INTERFACE_DEFINED__ -#define __IBDA_AutoDemodulate_INTERFACE_DEFINED__ - -/* interface IBDA_AutoDemodulate */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_AutoDemodulate; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DDF15B12-BD25-11d2-9CA0-00C04F7971E0") - IBDA_AutoDemodulate : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_AutoDemodulate( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_AutoDemodulateVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_AutoDemodulate * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_AutoDemodulate * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_AutoDemodulate * This); - - HRESULT ( STDMETHODCALLTYPE *put_AutoDemodulate )( - IBDA_AutoDemodulate * This); - - END_INTERFACE - } IBDA_AutoDemodulateVtbl; - - interface IBDA_AutoDemodulate - { - CONST_VTBL struct IBDA_AutoDemodulateVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_AutoDemodulate_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_AutoDemodulate_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_AutoDemodulate_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_AutoDemodulate_put_AutoDemodulate(This) \ - (This)->lpVtbl -> put_AutoDemodulate(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_AutoDemodulate_put_AutoDemodulate_Proxy( - IBDA_AutoDemodulate * This); - - -void __RPC_STUB IBDA_AutoDemodulate_put_AutoDemodulate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_AutoDemodulate_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_DigitalDemodulator_INTERFACE_DEFINED__ -#define __IBDA_DigitalDemodulator_INTERFACE_DEFINED__ - -/* interface IBDA_DigitalDemodulator */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_DigitalDemodulator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EF30F379-985B-4d10-B640-A79D5E04E1E0") - IBDA_DigitalDemodulator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_ModulationType( - /* [in] */ ModulationType *pModulationType) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_ModulationType( - /* [out][in] */ ModulationType *pModulationType) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_InnerFECMethod( - /* [in] */ FECMethod *pFECMethod) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_InnerFECMethod( - /* [out][in] */ FECMethod *pFECMethod) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_InnerFECRate( - /* [in] */ BinaryConvolutionCodeRate *pFECRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_InnerFECRate( - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_OuterFECMethod( - /* [in] */ FECMethod *pFECMethod) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_OuterFECMethod( - /* [out][in] */ FECMethod *pFECMethod) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_OuterFECRate( - /* [in] */ BinaryConvolutionCodeRate *pFECRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_OuterFECRate( - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SymbolRate( - /* [in] */ ULONG *pSymbolRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SymbolRate( - /* [out][in] */ ULONG *pSymbolRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_SpectralInversion( - /* [in] */ SpectralInversion *pSpectralInversion) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_SpectralInversion( - /* [out][in] */ SpectralInversion *pSpectralInversion) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_DigitalDemodulatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_DigitalDemodulator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_DigitalDemodulator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_DigitalDemodulator * This); - - HRESULT ( STDMETHODCALLTYPE *put_ModulationType )( - IBDA_DigitalDemodulator * This, - /* [in] */ ModulationType *pModulationType); - - HRESULT ( STDMETHODCALLTYPE *get_ModulationType )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ ModulationType *pModulationType); - - HRESULT ( STDMETHODCALLTYPE *put_InnerFECMethod )( - IBDA_DigitalDemodulator * This, - /* [in] */ FECMethod *pFECMethod); - - HRESULT ( STDMETHODCALLTYPE *get_InnerFECMethod )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ FECMethod *pFECMethod); - - HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IBDA_DigitalDemodulator * This, - /* [in] */ BinaryConvolutionCodeRate *pFECRate); - - HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate); - - HRESULT ( STDMETHODCALLTYPE *put_OuterFECMethod )( - IBDA_DigitalDemodulator * This, - /* [in] */ FECMethod *pFECMethod); - - HRESULT ( STDMETHODCALLTYPE *get_OuterFECMethod )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ FECMethod *pFECMethod); - - HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IBDA_DigitalDemodulator * This, - /* [in] */ BinaryConvolutionCodeRate *pFECRate); - - HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate); - - HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IBDA_DigitalDemodulator * This, - /* [in] */ ULONG *pSymbolRate); - - HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ ULONG *pSymbolRate); - - HRESULT ( STDMETHODCALLTYPE *put_SpectralInversion )( - IBDA_DigitalDemodulator * This, - /* [in] */ SpectralInversion *pSpectralInversion); - - HRESULT ( STDMETHODCALLTYPE *get_SpectralInversion )( - IBDA_DigitalDemodulator * This, - /* [out][in] */ SpectralInversion *pSpectralInversion); - - END_INTERFACE - } IBDA_DigitalDemodulatorVtbl; - - interface IBDA_DigitalDemodulator - { - CONST_VTBL struct IBDA_DigitalDemodulatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_DigitalDemodulator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_DigitalDemodulator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_DigitalDemodulator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_DigitalDemodulator_put_ModulationType(This,pModulationType) \ - (This)->lpVtbl -> put_ModulationType(This,pModulationType) - -#define IBDA_DigitalDemodulator_get_ModulationType(This,pModulationType) \ - (This)->lpVtbl -> get_ModulationType(This,pModulationType) - -#define IBDA_DigitalDemodulator_put_InnerFECMethod(This,pFECMethod) \ - (This)->lpVtbl -> put_InnerFECMethod(This,pFECMethod) - -#define IBDA_DigitalDemodulator_get_InnerFECMethod(This,pFECMethod) \ - (This)->lpVtbl -> get_InnerFECMethod(This,pFECMethod) - -#define IBDA_DigitalDemodulator_put_InnerFECRate(This,pFECRate) \ - (This)->lpVtbl -> put_InnerFECRate(This,pFECRate) - -#define IBDA_DigitalDemodulator_get_InnerFECRate(This,pFECRate) \ - (This)->lpVtbl -> get_InnerFECRate(This,pFECRate) - -#define IBDA_DigitalDemodulator_put_OuterFECMethod(This,pFECMethod) \ - (This)->lpVtbl -> put_OuterFECMethod(This,pFECMethod) - -#define IBDA_DigitalDemodulator_get_OuterFECMethod(This,pFECMethod) \ - (This)->lpVtbl -> get_OuterFECMethod(This,pFECMethod) - -#define IBDA_DigitalDemodulator_put_OuterFECRate(This,pFECRate) \ - (This)->lpVtbl -> put_OuterFECRate(This,pFECRate) - -#define IBDA_DigitalDemodulator_get_OuterFECRate(This,pFECRate) \ - (This)->lpVtbl -> get_OuterFECRate(This,pFECRate) - -#define IBDA_DigitalDemodulator_put_SymbolRate(This,pSymbolRate) \ - (This)->lpVtbl -> put_SymbolRate(This,pSymbolRate) - -#define IBDA_DigitalDemodulator_get_SymbolRate(This,pSymbolRate) \ - (This)->lpVtbl -> get_SymbolRate(This,pSymbolRate) - -#define IBDA_DigitalDemodulator_put_SpectralInversion(This,pSpectralInversion) \ - (This)->lpVtbl -> put_SpectralInversion(This,pSpectralInversion) - -#define IBDA_DigitalDemodulator_get_SpectralInversion(This,pSpectralInversion) \ - (This)->lpVtbl -> get_SpectralInversion(This,pSpectralInversion) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_ModulationType_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ ModulationType *pModulationType); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_ModulationType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_ModulationType_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ ModulationType *pModulationType); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_ModulationType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_InnerFECMethod_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ FECMethod *pFECMethod); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_InnerFECMethod_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_InnerFECMethod_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ FECMethod *pFECMethod); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_InnerFECMethod_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_InnerFECRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ BinaryConvolutionCodeRate *pFECRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_InnerFECRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_OuterFECMethod_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ FECMethod *pFECMethod); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_OuterFECMethod_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_OuterFECMethod_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ FECMethod *pFECMethod); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_OuterFECMethod_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_OuterFECRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ BinaryConvolutionCodeRate *pFECRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_OuterFECRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ BinaryConvolutionCodeRate *pFECRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_SymbolRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ ULONG *pSymbolRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_SymbolRate_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ ULONG *pSymbolRate); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_put_SpectralInversion_Proxy( - IBDA_DigitalDemodulator * This, - /* [in] */ SpectralInversion *pSpectralInversion); - - -void __RPC_STUB IBDA_DigitalDemodulator_put_SpectralInversion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_DigitalDemodulator_get_SpectralInversion_Proxy( - IBDA_DigitalDemodulator * This, - /* [out][in] */ SpectralInversion *pSpectralInversion); - - -void __RPC_STUB IBDA_DigitalDemodulator_get_SpectralInversion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_DigitalDemodulator_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_bdaiface_0413 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_bdaiface_0413_0001 - { KSPROPERTY_IPSINK_MULTICASTLIST = 0, - KSPROPERTY_IPSINK_ADAPTER_DESCRIPTION = KSPROPERTY_IPSINK_MULTICASTLIST + 1, - KSPROPERTY_IPSINK_ADAPTER_ADDRESS = KSPROPERTY_IPSINK_ADAPTER_DESCRIPTION + 1 - } KSPROPERTY_IPSINK; - - - -extern RPC_IF_HANDLE __MIDL_itf_bdaiface_0413_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_bdaiface_0413_v0_0_s_ifspec; - -#ifndef __IBDA_IPSinkControl_INTERFACE_DEFINED__ -#define __IBDA_IPSinkControl_INTERFACE_DEFINED__ - -/* interface IBDA_IPSinkControl */ -/* [helpstring][unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_IPSinkControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3F4DC8E2-4050-11d3-8F4B-00C04F7971E2") - IBDA_IPSinkControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMulticastList( - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAdapterIPAddress( - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_IPSinkControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_IPSinkControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_IPSinkControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_IPSinkControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetMulticastList )( - IBDA_IPSinkControl * This, - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer); - - HRESULT ( STDMETHODCALLTYPE *GetAdapterIPAddress )( - IBDA_IPSinkControl * This, - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer); - - END_INTERFACE - } IBDA_IPSinkControlVtbl; - - interface IBDA_IPSinkControl - { - CONST_VTBL struct IBDA_IPSinkControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_IPSinkControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_IPSinkControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_IPSinkControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_IPSinkControl_GetMulticastList(This,pulcbSize,pbBuffer) \ - (This)->lpVtbl -> GetMulticastList(This,pulcbSize,pbBuffer) - -#define IBDA_IPSinkControl_GetAdapterIPAddress(This,pulcbSize,pbBuffer) \ - (This)->lpVtbl -> GetAdapterIPAddress(This,pulcbSize,pbBuffer) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_IPSinkControl_GetMulticastList_Proxy( - IBDA_IPSinkControl * This, - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer); - - -void __RPC_STUB IBDA_IPSinkControl_GetMulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPSinkControl_GetAdapterIPAddress_Proxy( - IBDA_IPSinkControl * This, - /* [out][in] */ unsigned long *pulcbSize, - /* [out][in] */ BYTE **pbBuffer); - - -void __RPC_STUB IBDA_IPSinkControl_GetAdapterIPAddress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_IPSinkControl_INTERFACE_DEFINED__ */ - - -#ifndef __IBDA_IPSinkInfo_INTERFACE_DEFINED__ -#define __IBDA_IPSinkInfo_INTERFACE_DEFINED__ - -/* interface IBDA_IPSinkInfo */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IBDA_IPSinkInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A750108F-492E-4d51-95F7-649B23FF7AD7") - IBDA_IPSinkInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_MulticastList( - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE **ppbAddressList) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_AdapterIPAddress( - /* [out] */ BSTR *pbstrBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_AdapterDescription( - /* [out] */ BSTR *pbstrBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBDA_IPSinkInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBDA_IPSinkInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBDA_IPSinkInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBDA_IPSinkInfo * This); - - HRESULT ( STDMETHODCALLTYPE *get_MulticastList )( - IBDA_IPSinkInfo * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE **ppbAddressList); - - HRESULT ( STDMETHODCALLTYPE *get_AdapterIPAddress )( - IBDA_IPSinkInfo * This, - /* [out] */ BSTR *pbstrBuffer); - - HRESULT ( STDMETHODCALLTYPE *get_AdapterDescription )( - IBDA_IPSinkInfo * This, - /* [out] */ BSTR *pbstrBuffer); - - END_INTERFACE - } IBDA_IPSinkInfoVtbl; - - interface IBDA_IPSinkInfo - { - CONST_VTBL struct IBDA_IPSinkInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBDA_IPSinkInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBDA_IPSinkInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBDA_IPSinkInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBDA_IPSinkInfo_get_MulticastList(This,pulcbAddresses,ppbAddressList) \ - (This)->lpVtbl -> get_MulticastList(This,pulcbAddresses,ppbAddressList) - -#define IBDA_IPSinkInfo_get_AdapterIPAddress(This,pbstrBuffer) \ - (This)->lpVtbl -> get_AdapterIPAddress(This,pbstrBuffer) - -#define IBDA_IPSinkInfo_get_AdapterDescription(This,pbstrBuffer) \ - (This)->lpVtbl -> get_AdapterDescription(This,pbstrBuffer) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBDA_IPSinkInfo_get_MulticastList_Proxy( - IBDA_IPSinkInfo * This, - /* [out][in] */ ULONG *pulcbAddresses, - /* [size_is][out] */ BYTE **ppbAddressList); - - -void __RPC_STUB IBDA_IPSinkInfo_get_MulticastList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPSinkInfo_get_AdapterIPAddress_Proxy( - IBDA_IPSinkInfo * This, - /* [out] */ BSTR *pbstrBuffer); - - -void __RPC_STUB IBDA_IPSinkInfo_get_AdapterIPAddress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBDA_IPSinkInfo_get_AdapterDescription_Proxy( - IBDA_IPSinkInfo * This, - /* [out] */ BSTR *pbstrBuffer); - - -void __RPC_STUB IBDA_IPSinkInfo_get_AdapterDescription_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBDA_IPSinkInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumPIDMap_INTERFACE_DEFINED__ -#define __IEnumPIDMap_INTERFACE_DEFINED__ - -/* interface IEnumPIDMap */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IEnumPIDMap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("afb6c2a2-2c41-11d3-8a60-0000f81e0e4a") - IEnumPIDMap : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ PID_MAP *pPIDMap, - /* [out] */ ULONG *pcReceived) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cRecords) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumPIDMap **ppIEnumPIDMap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumPIDMapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumPIDMap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumPIDMap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumPIDMap * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumPIDMap * This, - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ PID_MAP *pPIDMap, - /* [out] */ ULONG *pcReceived); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumPIDMap * This, - /* [in] */ ULONG cRecords); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumPIDMap * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumPIDMap * This, - /* [out] */ IEnumPIDMap **ppIEnumPIDMap); - - END_INTERFACE - } IEnumPIDMapVtbl; - - interface IEnumPIDMap - { - CONST_VTBL struct IEnumPIDMapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumPIDMap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumPIDMap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumPIDMap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumPIDMap_Next(This,cRequest,pPIDMap,pcReceived) \ - (This)->lpVtbl -> Next(This,cRequest,pPIDMap,pcReceived) - -#define IEnumPIDMap_Skip(This,cRecords) \ - (This)->lpVtbl -> Skip(This,cRecords) - -#define IEnumPIDMap_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumPIDMap_Clone(This,ppIEnumPIDMap) \ - (This)->lpVtbl -> Clone(This,ppIEnumPIDMap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumPIDMap_Next_Proxy( - IEnumPIDMap * This, - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ PID_MAP *pPIDMap, - /* [out] */ ULONG *pcReceived); - - -void __RPC_STUB IEnumPIDMap_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPIDMap_Skip_Proxy( - IEnumPIDMap * This, - /* [in] */ ULONG cRecords); - - -void __RPC_STUB IEnumPIDMap_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPIDMap_Reset_Proxy( - IEnumPIDMap * This); - - -void __RPC_STUB IEnumPIDMap_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPIDMap_Clone_Proxy( - IEnumPIDMap * This, - /* [out] */ IEnumPIDMap **ppIEnumPIDMap); - - -void __RPC_STUB IEnumPIDMap_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumPIDMap_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2PIDMap_INTERFACE_DEFINED__ -#define __IMPEG2PIDMap_INTERFACE_DEFINED__ - -/* interface IMPEG2PIDMap */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMPEG2PIDMap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("afb6c2a1-2c41-11d3-8a60-0000f81e0e4a") - IMPEG2PIDMap : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE MapPID( - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID, - /* [in] */ MEDIA_SAMPLE_CONTENT MediaSampleContent) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnmapPID( - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumPIDMap( - /* [out] */ IEnumPIDMap **pIEnumPIDMap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2PIDMapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2PIDMap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2PIDMap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2PIDMap * This); - - HRESULT ( STDMETHODCALLTYPE *MapPID )( - IMPEG2PIDMap * This, - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID, - /* [in] */ MEDIA_SAMPLE_CONTENT MediaSampleContent); - - HRESULT ( STDMETHODCALLTYPE *UnmapPID )( - IMPEG2PIDMap * This, - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID); - - HRESULT ( STDMETHODCALLTYPE *EnumPIDMap )( - IMPEG2PIDMap * This, - /* [out] */ IEnumPIDMap **pIEnumPIDMap); - - END_INTERFACE - } IMPEG2PIDMapVtbl; - - interface IMPEG2PIDMap - { - CONST_VTBL struct IMPEG2PIDMapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2PIDMap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2PIDMap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2PIDMap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2PIDMap_MapPID(This,culPID,pulPID,MediaSampleContent) \ - (This)->lpVtbl -> MapPID(This,culPID,pulPID,MediaSampleContent) - -#define IMPEG2PIDMap_UnmapPID(This,culPID,pulPID) \ - (This)->lpVtbl -> UnmapPID(This,culPID,pulPID) - -#define IMPEG2PIDMap_EnumPIDMap(This,pIEnumPIDMap) \ - (This)->lpVtbl -> EnumPIDMap(This,pIEnumPIDMap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMPEG2PIDMap_MapPID_Proxy( - IMPEG2PIDMap * This, - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID, - /* [in] */ MEDIA_SAMPLE_CONTENT MediaSampleContent); - - -void __RPC_STUB IMPEG2PIDMap_MapPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMPEG2PIDMap_UnmapPID_Proxy( - IMPEG2PIDMap * This, - /* [in] */ ULONG culPID, - /* [in] */ ULONG *pulPID); - - -void __RPC_STUB IMPEG2PIDMap_UnmapPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMPEG2PIDMap_EnumPIDMap_Proxy( - IMPEG2PIDMap * This, - /* [out] */ IEnumPIDMap **pIEnumPIDMap); - - -void __RPC_STUB IMPEG2PIDMap_EnumPIDMap_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2PIDMap_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/bdamedia.h b/import/DirectX8/include/bdamedia.h deleted file mode 100644 index eb988a96e..000000000 --- a/import/DirectX8/include/bdamedia.h +++ /dev/null @@ -1,2984 +0,0 @@ -//------------------------------------------------------------------------------ -// File: BDAMedia.h -// -// Desc: Broadcast Driver Architecture Multimedia Definitions. -// -// Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#if !defined(_KSMEDIA_) -#error KSMEDIA.H must be included before BDAMEDIA.H -#endif // !defined(_KSMEDIA_) - -#if !defined(_BDATYPES_) -#error BDATYPES.H must be included before BDAMEDIA.H -#endif // !defined(_BDATYPES_) - -#if !defined(_BDAMEDIA_) -#define _BDAMEDIA_ - -#if defined(__cplusplus) -extern "C" { -#endif // defined(__cplusplus) - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - -//=========================================================================== -// -// KSProperty Set Structure Definitions for BDA -// -//=========================================================================== - -typedef struct _KSP_BDA_NODE_PIN { - KSPROPERTY Property; - ULONG ulNodeType; - ULONG ulInputPinId; - ULONG ulOutputPinId; -} KSP_BDA_NODE_PIN, *PKSP_BDA_NODE_PIN; - - -typedef struct _KSM_BDA_PIN -{ - KSMETHOD Method; - union - { - ULONG PinId; - ULONG PinType; - }; - ULONG Reserved; -} KSM_BDA_PIN, * PKSM_BDA_PIN; - - -typedef struct _KSM_BDA_PIN_PAIR -{ - KSMETHOD Method; - union - { - ULONG InputPinId; - ULONG InputPinType; - }; - union - { - ULONG OutputPinId; - ULONG OutputPinType; - }; -} KSM_BDA_PIN_PAIR, * PKSM_BDA_PIN_PAIR; - - -typedef struct { - KSP_NODE Property; - ULONG EsPid; -} KSP_NODE_ESPID, *PKSP_NODE_ESPID; - - - -//=========================================================================== -// -// BDA Data Range definitions. Includes specifier definitions. -// -//=========================================================================== - -// Antenna Signal Formats -// - -typedef struct tagKS_DATARANGE_BDA_ANTENNA { - KSDATARANGE DataRange; - - // Antenna specifier can go here if required - // -} KS_DATARANGE_BDA_ANTENNA, *PKS_DATARANGE_BDA_ANTENNA; - - - -// Transport Formats -// - -typedef struct tagBDA_TRANSPORT_INFO { - ULONG ulcbPhyiscalPacket; // Size, in bytes, of a physical packet - // (e.g. Satellite link payload size. - ULONG ulcbPhyiscalFrame; // Size, in bytes, of each physical frame - // 0 indicates no HW requirement - ULONG ulcbPhyiscalFrameAlignment; // Capture buffer alignment in bytes - // 0 and 1 indicate no alignment requirements - REFERENCE_TIME AvgTimePerFrame; // Normal ActiveMovie units (100 nS) - -} BDA_TRANSPORT_INFO, *PBDA_TRANSPORT_INFO; - -typedef struct tagKS_DATARANGE_BDA_TRANSPORT { - KSDATARANGE DataRange; - BDA_TRANSPORT_INFO BdaTransportInfo; - - // Transport specifier can go here if required - // -} KS_DATARANGE_BDA_TRANSPORT, *PKS_DATARANGE_BDA_TRANSPORT; - - -//=========================================================================== -// BDA Event Guids -// -// These are sent by the IBroadcastEvent service on the graph. -// To receive, -// 0) Implement IBroadcastEvent in your receiving object - this has one Method on it: Fire() -// 1) QI the graphs service provider for SID_SBroadcastEventService -// for the IID_IBroadcastEvent object -// 2) OR create the event service (CLSID_BroadcastEventService) if not already there -// and register it -// 3) QI that object for it's IConnectionPoint interface (*pCP) -// 4) Advise your object on *pCP (e.g. pCP->Advise(static_cast(this), &dwCookie) -// 5) Unadvise when done.. -// 6) Implement IBroadcastEvent::Fire(GUID gEventID) -// Check for relevant event below and deal with it appropriatly... -//=========================================================================== - -// {9D7E6235-4B7D-425d-A6D1-D717C33B9C4C} -#define STATIC_EVENTID_TuningChanged \ - 0x9d7e6235, 0x4b7d, 0x425d, 0xa6, 0xd1, 0xd7, 0x17, 0xc3, 0x3b, 0x9c, 0x4c -DEFINE_GUIDSTRUCT("9D7E6235-4B7D-425d-A6D1-D717C33B9C4C", EVENTID_TuningChanged); -#define EVENTID_TuningChanged DEFINE_GUIDNAMED(EVENTID_TuningChanged) - -// {2A65C528-2249-4070-AC16-00390CDFB2DD} -#define STATIC_EVENTID_CADenialCountChanged \ - 0x2a65c528, 0x2249, 0x4070, 0xac, 0x16, 0x0, 0x39, 0xc, 0xdf, 0xb2, 0xdd -DEFINE_GUIDSTRUCT("2A65C528-2249-4070-AC16-00390CDFB2DD", EVENTID_CADenialCountChanged); -#define EVENTID_CADenialCountChanged DEFINE_GUIDNAMED(EVENTID_CADenialCountChanged) - -// {6D9CFAF2-702D-4b01-8DFF-6892AD20D191} -#define STATIC_EVENTID_SignalStatusChanged \ - 0x6d9cfaf2, 0x702d, 0x4b01, 0x8d, 0xff, 0x68, 0x92, 0xad, 0x20, 0xd1, 0x91 -DEFINE_GUIDSTRUCT("6D9CFAF2-702D-4b01-8DFF-6892AD20D191", EVENTID_SignalStatusChanged); -#define EVENTID_SignalStatusChanged DEFINE_GUIDNAMED(EVENTID_SignalStatusChanged) - - -//=========================================================================== -// -// BDA Stream Format GUIDs -// -//=========================================================================== - -#define STATIC_KSDATAFORMAT_TYPE_BDA_ANTENNA\ - 0x71985f41, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F41-1CA1-11d3-9CC8-00C04F7971E0", KSDATAFORMAT_TYPE_BDA_ANTENNA); -#define KSDATAFORMAT_TYPE_BDA_ANTENNA DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_ANTENNA) - - -#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT\ - 0xf4aeb342, 0x0329, 0x4fdd, 0xa8, 0xfd, 0x4a, 0xff, 0x49, 0x26, 0xc9, 0x78 -DEFINE_GUIDSTRUCT("F4AEB342-0329-4fdd-A8FD-4AFF4926C978", KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT); -#define KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT) - - -#define STATIC_KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT\ - 0x8deda6fd, 0xac5f, 0x4334, 0x8e, 0xcf, 0xa4, 0xba, 0x8f, 0xa7, 0xd0, 0xf0 -DEFINE_GUIDSTRUCT("8DEDA6FD-AC5F-4334-8ECF-A4BA8FA7D0F0", KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT); -#define KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT) - - -#define STATIC_KSDATAFORMAT_TYPE_BDA_IF_SIGNAL\ - 0x61be0b47, 0xa5eb, 0x499b, 0x9a, 0x85, 0x5b, 0x16, 0xc0, 0x7f, 0x12, 0x58 -DEFINE_GUIDSTRUCT("61BE0B47-A5EB-499b-9A85-5B16C07F1258", KSDATAFORMAT_TYPE_BDA_IF_SIGNAL); -#define KSDATAFORMAT_TYPE_BDA_IF_SIGNAL DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IF_SIGNAL) - - -#define STATIC_KSDATAFORMAT_TYPE_MPEG2_SECTIONS\ - 0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5 -DEFINE_GUIDSTRUCT("455F176C-4B06-47CE-9AEF-8CAEF73DF7B5", KSDATAFORMAT_TYPE_MPEG2_SECTIONS); -#define KSDATAFORMAT_TYPE_MPEG2_SECTIONS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_SECTIONS) - - -#define STATIC_KSDATAFORMAT_SUBTYPE_ATSC_SI\ - 0xb3c7397c, 0xd303, 0x414d, 0xb3, 0x3c, 0x4e, 0xd2, 0xc9, 0xd2, 0x97, 0x33 -DEFINE_GUIDSTRUCT("B3C7397C-D303-414D-B33C-4ED2C9D29733", KSDATAFORMAT_SUBTYPE_ATSC_SI); -#define KSDATAFORMAT_SUBTYPE_ATSC_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ATSC_SI) - - -#define STATIC_KSDATAFORMAT_SUBTYPE_DVB_SI\ - 0xe9dd31a3, 0x221d, 0x4adb, 0x85, 0x32, 0x9a, 0xf3, 0x9, 0xc1, 0xa4, 0x8 -DEFINE_GUIDSTRUCT("e9dd31a3-221d-4adb-8532-9af309c1a408", KSDATAFORMAT_SUBTYPE_DVB_SI); -#define KSDATAFORMAT_SUBTYPE_DVB_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVB_SI) - - -#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP\ - 0x762e3f66, 0x336f, 0x48d1, 0xbf, 0x83, 0x2b, 0x0, 0x35, 0x2c, 0x11, 0xf0 -DEFINE_GUIDSTRUCT("762E3F66-336F-48d1-BF83-2B00352C11F0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP); -#define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP) - -#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP\ - 0x951727db, 0xd2ce, 0x4528, 0x96, 0xf6, 0x33, 0x1, 0xfa, 0xbb, 0x2d, 0xe0 -DEFINE_GUIDSTRUCT("951727DB-D2CE-4528-96F6-3301FABB2DE0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP); -#define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP) - -//=========================================================================== -// -// KSPinName Definitions for BDA -// -//=========================================================================== - -// Pin name for a BDA transport pin -// -// {78216A81-CFA8-493e-9711-36A61C08BD9D} -// -#define STATIC_PINNAME_BDA_TRANSPORT \ - 0x78216a81, 0xcfa8, 0x493e, 0x97, 0x11, 0x36, 0xa6, 0x1c, 0x8, 0xbd, 0x9d -DEFINE_GUIDSTRUCT("78216A81-CFA8-493e-9711-36A61C08BD9D", PINNAME_BDA_TRANSPORT); -#define PINNAME_BDA_TRANSPORT DEFINE_GUIDNAMED(PINNAME_BDA_TRANSPORT) - - -// Pin name for a BDA analog video pin -// -// {5C0C8281-5667-486c-8482-63E31F01A6E9} -// -#define STATIC_PINNAME_BDA_ANALOG_VIDEO \ - 0x5c0c8281, 0x5667, 0x486c, 0x84, 0x82, 0x63, 0xe3, 0x1f, 0x1, 0xa6, 0xe9 -DEFINE_GUIDSTRUCT("5C0C8281-5667-486c-8482-63E31F01A6E9", PINNAME_BDA_ANALOG_VIDEO); -#define PINNAME_BDA_ANALOG_VIDEO DEFINE_GUIDNAMED(PINNAME_BDA_ANALOG_VIDEO) - - -// Pin name for a BDA analog audio pin -// -// {D28A580A-9B1F-4b0c-9C33-9BF0A8EA636B} -// -#define STATIC_PINNAME_BDA_ANALOG_AUDIO \ - 0xd28a580a, 0x9b1f, 0x4b0c, 0x9c, 0x33, 0x9b, 0xf0, 0xa8, 0xea, 0x63, 0x6b -DEFINE_GUIDSTRUCT("D28A580A-9B1F-4b0c-9C33-9BF0A8EA636B", PINNAME_BDA_ANALOG_AUDIO); -#define PINNAME_BDA_ANALOG_AUDIO DEFINE_GUIDNAMED(PINNAME_BDA_ANALOG_AUDIO) - - -// Pin name for a BDA FM Radio pin -// -// {D2855FED-B2D3-4eeb-9BD0-193436A2F890} -// -#define STATIC_PINNAME_BDA_FM_RADIO \ - 0xd2855fed, 0xb2d3, 0x4eeb, 0x9b, 0xd0, 0x19, 0x34, 0x36, 0xa2, 0xf8, 0x90 -DEFINE_GUIDSTRUCT("D2855FED-B2D3-4eeb-9BD0-193436A2F890", PINNAME_BDA_FM_RADIO); -#define PINNAME_BDA_FM_RADIO DEFINE_GUIDNAMED(PINNAME_BDA_FM_RADIO) - - -// Pin name for a BDA Intermediate Frequency pin -// -// {1A9D4A42-F3CD-48a1-9AEA-71DE133CBE14} -// -#define STATIC_PINNAME_BDA_IF_PIN \ - 0x1a9d4a42, 0xf3cd, 0x48a1, 0x9a, 0xea, 0x71, 0xde, 0x13, 0x3c, 0xbe, 0x14 -DEFINE_GUIDSTRUCT("1A9D4A42-F3CD-48a1-9AEA-71DE133CBE14", PINNAME_BDA_IF_PIN); -#define PINNAME_BDA_IF_PIN DEFINE_GUIDNAMED(PINNAME_BDA_IF_PIN) - - -// Pin name for a BDA Open Cable PSIP pin -// -// {297BB104-E5C9-4ACE-B123-95C3CBB24D4F} -// -#define STATIC_PINNAME_BDA_OPENCABLE_PSIP_PIN \ - 0x297bb104, 0xe5c9, 0x4ace, 0xb1, 0x23, 0x95, 0xc3, 0xcb, 0xb2, 0x4d, 0x4f -DEFINE_GUIDSTRUCT("297BB104-E5C9-4ACE-B123-95C3CBB24D4F", PINNAME_BDA_OPENCABLE_PSIP_PIN); -#define PINNAME_BDA_OPENCABLE_PSIP_PIN DEFINE_GUIDNAMED(PINNAME_BDA_OPENCABLE_PSIP_PIN) - - -//=========================================================================== -// -// KSProperty Set Definitions for BDA -// -//=========================================================================== - - -//------------------------------------------------------------ -// -// BDA Network Ethernet Filter Property Set -// -// {71985F43-1CA1-11d3-9CC8-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaEthernetFilter \ - 0x71985f43, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F43-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaEthernetFilter); -#define KSPROPSETID_BdaEthernetFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaEthernetFilter) - -typedef enum { - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_MODE -} KSPROPERTY_BDA_ETHERNET_FILTER; - -#define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_ETHERNET_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// BDA Network IPv4 Filter Property Set -// -// {71985F44-1CA1-11d3-9CC8-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaIPv4Filter \ - 0x71985f44, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F44-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaIPv4Filter); -#define KSPROPSETID_BdaIPv4Filter DEFINE_GUIDNAMED(KSPROPSETID_BdaIPv4Filter) - -typedef enum { - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_MODE -} KSPROPERTY_BDA_IPv4_FILTER; - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_IPv4_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// BDA Network IPv6 Filter Property Set -// -// {E1785A74-2A23-4fb3-9245-A8F88017EF33} -// -#define STATIC_KSPROPSETID_BdaIPv6Filter \ - 0xe1785a74, 0x2a23, 0x4fb3, 0x92, 0x45, 0xa8, 0xf8, 0x80, 0x17, 0xef, 0x33 -DEFINE_GUIDSTRUCT("E1785A74-2A23-4fb3-9245-A8F88017EF33", KSPROPSETID_BdaIPv6Filter); -#define KSPROPSETID_BdaIPv6Filter DEFINE_GUIDNAMED(KSPROPSETID_BdaIPv6Filter) - -typedef enum { - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_MODE -} KSPROPERTY_BDA_IPv6_FILTER; - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_IPv6_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - -//------------------------------------------------------------ -// -// -// BDA Signal Statistics Property Set -// -// Used to get signal statistics from a control node or a pin. -// Set NodeId == -1 to get properties from the pin. -// -// {1347D106-CF3A-428a-A5CB-AC0D9A2A4338} -// -#define STATIC_KSPROPSETID_BdaSignalStats \ - 0x1347d106, 0xcf3a, 0x428a, 0xa5, 0xcb, 0xac, 0xd, 0x9a, 0x2a, 0x43, 0x38 -DEFINE_GUIDSTRUCT("1347D106-CF3A-428a-A5CB-AC0D9A2A4338", KSPROPSETID_BdaSignalStats); -#define KSPROPSETID_BdaSignalStats DEFINE_GUIDNAMED(KSPROPSETID_BdaSignalStats) - -typedef enum { - KSPROPERTY_BDA_SIGNAL_STRENGTH = 0, - KSPROPERTY_BDA_SIGNAL_QUALITY, - KSPROPERTY_BDA_SIGNAL_PRESENT, - KSPROPERTY_BDA_SIGNAL_LOCKED, - KSPROPERTY_BDA_SAMPLE_TIME -} KSPROPERTY_BDA_SIGNAL_STATS; - -// OPTIONAL -// Carrier strength in mDb (1/1000 of a DB). -// -// A strength of 0 is nominal strength as expected for the given -// type of broadcast network. -// -// Sub-nominal strengths are reported as positive mDb -// -// Super-nominal strengths are reported as negative mDb -// -#define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_STRENGTH(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_STRENGTH,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(LONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -// OPTIONAL -// Amount of data successfully extracted from the signal as a percent. -// -// Signal Quality is usually reported by the demodulation node and is -// a representation of how much of the original data could be extracted -// from the signal. -// -// In the case of Analog Signals, this percentage can be -// computed by examining the timing of HSync and VSync as will as by -// looking at information contained in HBlanking and VBlanking intervals. -// -// In the case of Digital Signals, this percentage can be -// computed by examining packet CRCs and FEC confidence values. -// -// 100 percent is ideal. -// 95 percent shows very little (almost unnoticable) artifacts when rendered. -// 90 percent contains few enough artifacts as to be easily viewable. -// 80 percent is the minimum level to be viewable. -// 60 percent is the minimum level to expect data services -// (including EPG) to work. -// 20 percent indicates that the demodulator knows that a properly modulated -// signal exists but can't produce enough data to be useful. -// -#define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_QUALITY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_QUALITY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(LONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -// REQUIRED -// True if a signal carrier is present. -// -// Should be returned by the RF tuner node. -// -#define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_PRESENT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_PRESENT,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BOOL),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -// REQUIRED -// True if the signal can be locked. -// -// Ususally represents PLL lock when returned by the RF Tuner Node. -// -// Represents Signal Quality of at least 20% when returned by the -// demodulator node. -// -#define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_LOCKED(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_LOCKED,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BOOL),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -// OPTIONAL -// Indicates the sample time overwhich signal level and quality are -// averaged. -// -// Each time a signal statistics property is requested, the node should -// report the average value for the last n milliseconds where n is the -// value set by this property. If no value is set or if the driver does -// not support this property, the driver should default to -// 100 millisecond sample times. -// -// The driver may report values for the most recently completed sample -// period. -// -#define DEFINE_KSPROPERTY_ITEM_BDA_SAMPLE_TIME(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SAMPLE_TIME,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(LONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Change Sync Method Set -// -// {FD0A5AF3-B41D-11d2-9C95-00C04F7971E0} -// -#define STATIC_KSMETHODSETID_BdaChangeSync \ - 0xfd0a5af3, 0xb41d, 0x11d2, 0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("FD0A5AF3-B41D-11d2-9C95-00C04F7971E0", KSMETHODSETID_BdaChangeSync); -#define KSMETHODSETID_BdaChangeSync DEFINE_GUIDNAMED(KSMETHODSETID_BdaChangeSync) - -typedef enum { - KSMETHOD_BDA_START_CHANGES = 0, - KSMETHOD_BDA_CHECK_CHANGES, - KSMETHOD_BDA_COMMIT_CHANGES, - KSMETHOD_BDA_GET_CHANGE_STATE -} KSMETHOD_BDA_CHANGE_SYNC; - -#define DEFINE_KSMETHOD_ITEM_BDA_START_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_START_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - -#define DEFINE_KSMETHOD_ITEM_BDA_CHECK_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CHECK_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - -#define DEFINE_KSMETHOD_ITEM_BDA_COMMIT_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_COMMIT_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - -#define DEFINE_KSMETHOD_ITEM_BDA_GET_CHANGE_STATE(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_GET_CHANGE_STATE,\ - KSMETHOD_TYPE_READ,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - - - -//------------------------------------------------------------ -// -// -// BDA Device Configuration Method Set -// -// {71985F45-1CA1-11d3-9CC8-00C04F7971E0} -// -#define STATIC_KSMETHODSETID_BdaDeviceConfiguration \ - 0x71985f45, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F45-1CA1-11d3-9CC8-00C04F7971E0", KSMETHODSETID_BdaDeviceConfiguration); -#define KSMETHODSETID_BdaDeviceConfiguration DEFINE_GUIDNAMED(KSMETHODSETID_BdaDeviceConfiguration) - -typedef enum { - KSMETHOD_BDA_CREATE_PIN_FACTORY = 0, - KSMETHOD_BDA_DELETE_PIN_FACTORY, - KSMETHOD_BDA_CREATE_TOPOLOGY -} KSMETHOD_BDA_DEVICE_CONFIGURATION; - -#define DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CREATE_PIN_FACTORY,\ - KSMETHOD_TYPE_READ,\ - (MethodHandler),\ - sizeof(KSM_BDA_PIN),\ - sizeof(ULONG),\ - SupportHandler) - -#define DEFINE_KSMETHOD_ITEM_BDA_DELETE_PIN_FACTORY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_DELETE_PIN_FACTORY,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSM_BDA_PIN),\ - 0,\ - SupportHandler) - -#define DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CREATE_TOPOLOGY,\ - KSMETHOD_TYPE_WRITE,\ - (MethodHandler),\ - sizeof(KSM_BDA_PIN_PAIR),\ - 0,\ - SupportHandler) - - - -//------------------------------------------------------------ -// -// -// BDA Topology Property Set -// -// {A14EE835-0A23-11d3-9CC7-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaTopology \ - 0xa14ee835, 0x0a23, 0x11d3, 0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("A14EE835-0A23-11d3-9CC7-00C04F7971E0", KSPROPSETID_BdaTopology); -#define KSPROPSETID_BdaTopology DEFINE_GUIDNAMED(KSPROPSETID_BdaTopology) - -typedef enum { - KSPROPERTY_BDA_NODE_TYPES, - KSPROPERTY_BDA_PIN_TYPES, - KSPROPERTY_BDA_TEMPLATE_CONNECTIONS, - KSPROPERTY_BDA_NODE_METHODS, - KSPROPERTY_BDA_NODE_PROPERTIES, - KSPROPERTY_BDA_NODE_EVENTS, - KSPROPERTY_BDA_CONTROLLING_PIN_ID, - KSPROPERTY_BDA_NODE_DESCRIPTORS - }KSPROPERTY_BDA_TOPOLOGY; - -#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_TYPES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_TYPES,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_TYPES,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_TEMPLATE_CONNECTIONS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_TEMPLATE_CONNECTIONS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof( BDA_TEMPLATE_CONNECTION),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_METHODS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_METHODS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_PROPERTIES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_PROPERTIES,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_EVENTS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_EVENTS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CONTROLLING_PIN_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CONTROLLING_PIN_ID,\ - (GetHandler),\ - sizeof(KSP_BDA_NODE_PIN),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_DESCRIPTORS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_DESCRIPTORS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Pin Control Property Set -// -// {0DED49D5-A8B7-4d5d-97A1-12B0C195874D} -// -#define STATIC_KSPROPSETID_BdaPinControl \ - 0xded49d5, 0xa8b7, 0x4d5d, 0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d -DEFINE_GUIDSTRUCT("0DED49D5-A8B7-4d5d-97A1-12B0C195874D", KSPROPSETID_BdaPinControl); -#define KSPROPSETID_BdaPinControl DEFINE_GUIDNAMED(KSPROPSETID_BdaPinControl) - -typedef enum { - KSPROPERTY_BDA_PIN_ID = 0, - KSPROPERTY_BDA_PIN_TYPE -} KSPROPERTY_BDA_PIN_CONTROL; - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_ID,\ - (GetHandler),\ - sizeof( KSPROPERTY),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_TYPE,\ - (GetHandler),\ - sizeof( KSPROPERTY),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Pin Event Set -// -// {104781CD-50BD-40d5-95FB-087E0E86A591} -// -#define STATIC_KSEVENTSETID_BdaPinEvent \ - 0x104781cd, 0x50bd, 0x40d5, 0x95, 0xfb, 0x08, 0x7e, 0xe, 0x86, 0xa5, 0x91 -DEFINE_GUIDSTRUCT("104781CD-50BD-40d5-95FB-087E0E86A591", KSEVENTSETID_BdaPinEvent); -#define KSEVENTSETID_BdaPinEvent DEFINE_GUIDNAMED(KSEVENTSETID_BdaPinEvent) - -typedef enum { - KSEVENT_BDA_PIN_CONNECTED = 0, - KSEVENT_BDA_PIN_DISCONNECTED -} KSPROPERTY_BDA_PIN_EVENT; - -#define DEFINE_KSEVENT_ITEM_BDA_PIN_CONNECTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_PIN_CONNECTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - -#define DEFINE_KSEVENT_ITEM_BDA_PIN_DISCONNECTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_PIN_DISCONNECTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - - -//------------------------------------------------------------ -// -// -// BDA Void Transform Property Set -// -// {71985F46-1CA1-11d3-9CC8-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaVoidTransform \ - 0x71985f46, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F46-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaVoidTransform); -#define KSPROPSETID_BdaVoidTransform DEFINE_GUIDNAMED(KSPROPSETID_BdaVoidTransform) - -typedef enum { - KSPROPERTY_BDA_VOID_TRANSFORM_START = 0, - KSPROPERTY_BDA_VOID_TRANSFORM_STOP -} KSPROPERTY_BDA_VOID_TRANSFORM; - -#define DEFINE_KSPROPERTY_ITEM_BDA_VOID_TRANSFORM_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_VOID_TRANSFORM_START,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_VOID_TRANSFORM_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_VOID_TRANSFORM_STOP,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Null Transform Property Set -// -// {DDF15B0D-BD25-11d2-9CA0-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaNullTransform \ - 0xddf15b0d, 0xbd25, 0x11d2, 0x9c, 0xa0, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("DDF15B0D-BD25-11d2-9CA0-00C04F7971E0", KSPROPSETID_BdaNullTransform); -#define KSPROPSETID_BdaNullTransform DEFINE_GUIDNAMED(KSPROPSETID_BdaNullTransform) - -typedef enum { - KSPROPERTY_BDA_NULL_TRANSFORM_START = 0, - KSPROPERTY_BDA_NULL_TRANSFORM_STOP -} KSPROPERTY_BDA_NULL_TRANSFORM; - -#define DEFINE_KSPROPERTY_ITEM_BDA_NULL_TRANSFORM_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NULL_TRANSFORM_START,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_NULL_TRANSFORM_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NULL_TRANSFORM_STOP,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Frequency Filter Property Set -// -// {71985F47-1CA1-11d3-9CC8-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaFrequencyFilter \ - 0x71985f47, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F47-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaFrequencyFilter); -#define KSPROPSETID_BdaFrequencyFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaFrequencyFilter) - -typedef enum { - KSPROPERTY_BDA_RF_TUNER_FREQUENCY = 0, - KSPROPERTY_BDA_RF_TUNER_POLARITY, - KSPROPERTY_BDA_RF_TUNER_RANGE, - KSPROPERTY_BDA_RF_TUNER_TRANSPONDER, - KSPROPERTY_BDA_RF_TUNER_BANDWIDTH, - KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER -} KSPROPERTY_BDA_FREQUENCY_FILTER; - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_FREQUENCY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_FREQUENCY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_POLARITY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_POLARITY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_RANGE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_RANGE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_TRANSPONDER(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_TRANSPONDER,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_BANDWIDTH(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_BANDWIDTH,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_FREQUENCY_MULTIPLIER(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA LNB Info Property Set -// -// {992CF102-49F9-4719-A664-C4F23E2408F4} -// -#define STATIC_KSPROPSETID_BdaLNBInfo \ - 0x992cf102, 0x49f9, 0x4719, 0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4 -DEFINE_GUIDSTRUCT("992CF102-49F9-4719-A664-C4F23E2408F4", KSPROPSETID_BdaLNBInfo); -#define KSPROPSETID_BdaLNBInfo DEFINE_GUIDNAMED(KSPROPSETID_BdaLNBInfo) - -typedef enum { - KSPROPERTY_BDA_LNB_LOF_LOW_BAND = 0, - KSPROPERTY_BDA_LNB_LOF_HIGH_BAND, - KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY -} KSPROPERTY_BDA_LNB_INFO; - -#define DEFINE_KSPROPERTY_ITEM_BDA_LNB_LOF_LOW_BAND(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_LNB_LOF_LOW_BAND,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_LNB_LOF_HIGH_BAND(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_LNB_LOF_HIGH_BAND,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_LNB_SWITCH_FREQUENCY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Digital Demodulator Property Set -// -// {EF30F379-985B-4d10-B640-A79D5E04E1E0} -// -#define STATIC_KSPROPSETID_BdaDigitalDemodulator \ - 0xef30f379, 0x985b, 0x4d10, 0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x4, 0xe1, 0xe0 -DEFINE_GUIDSTRUCT("EF30F379-985B-4d10-B640-A79D5E04E1E0", KSPROPSETID_BdaDigitalDemodulator); -#define KSPROPSETID_BdaDigitalDemodulator DEFINE_GUIDNAMED(KSPROPSETID_BdaDigitalDemodulator) - -typedef enum { - KSPROPERTY_BDA_MODULATION_TYPE = 0, - KSPROPERTY_BDA_INNER_FEC_TYPE, - KSPROPERTY_BDA_INNER_FEC_RATE, - KSPROPERTY_BDA_OUTER_FEC_TYPE, - KSPROPERTY_BDA_OUTER_FEC_RATE, - KSPROPERTY_BDA_SYMBOL_RATE, - KSPROPERTY_BDA_SPECTRAL_INVERSION, - KSPROPERTY_BDA_GUARD_INTERVAL, - KSPROPERTY_BDA_TRANSMISSION_MODE -} KSPROPERTY_BDA_DIGITAL_DEMODULATOR; - -#define DEFINE_KSPROPERTY_ITEM_BDA_MODULATION_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_MODULATION_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ModulationType),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_INNER_FEC_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(FECMethod),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_INNER_FEC_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BinaryConvolutionCodeRate),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_OUTER_FEC_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(FECMethod),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_OUTER_FEC_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BinaryConvolutionCodeRate),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_SYMBOL_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SYMBOL_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_SPECTRAL_INVERSION(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SPECTRAL_INVERSION,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(SpectralInversion),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_GUARD_INTERVAL(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_GUARD_INTERVAL,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(GuardInterval),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_TRANSMISSION_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_TRANSMISSION_MODE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(TransmissionMode),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA Autodemodulate Property Set -// -// {DDF15B12-BD25-11d2-9CA0-00C04F7971E0} -// -#define STATIC_KSPROPSETID_BdaAutodemodulate \ - 0xddf15b12, 0xbd25, 0x11d2, 0x9c, 0xa0, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("DDF15B12-BD25-11d2-9CA0-00C04F7971E0", KSPROPSETID_BdaAutodemodulate); -#define KSPROPSETID_BdaAutodemodulate DEFINE_GUIDNAMED(KSPROPSETID_BdaAutodemodulate) - -typedef enum { - KSPROPERTY_BDA_AUTODEMODULATE_START = 0, - KSPROPERTY_BDA_AUTODEMODULATE_STOP -} KSPROPERTY_BDA_AUTODEMODULATE; - -#define DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_AUTODEMODULATE_START,\ - FALSE,\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_AUTODEMODULATE_STOP,\ - FALSE,\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -//------------------------------------------------------------ -// -// -// BDA Table Section Property Set -// -// {516B99C5-971C-4aaf-B3F3-D9FDA8A15E16} -// - -#define STATIC_KSPROPSETID_BdaTableSection \ - 0x516b99c5, 0x971c, 0x4aaf, 0xb3, 0xf3, 0xd9, 0xfd, 0xa8, 0xa1, 0x5e, 0x16 -DEFINE_GUIDSTRUCT("516B99C5-971C-4aaf-B3F3-D9FDA8A15E16", KSPROPSETID_BdaTableSection); -#define KSPROPSETID_BdaTableSection DEFINE_GUIDNAMED(KSPROPSETID_BdaTableSection) - -typedef enum { - KSPROPERTY_BDA_TABLE_SECTION = 0, -} KSPROPERTY_IDS_BDA_TABLE; - -#define DEFINE_KSPROPERTY_ITEM_BDA_TABLE_SECTION(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_TABLE_SECTION,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_TABLE_SECTION),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA PID Filter Property Set -// -// {D0A67D65-08DF-4fec-8533-E5B550410B85} -// -#define STATIC_KSPROPSETID_BdaPIDFilter \ - 0xd0a67d65, 0x8df, 0x4fec, 0x85, 0x33, 0xe5, 0xb5, 0x50, 0x41, 0xb, 0x85 -DEFINE_GUIDSTRUCT("D0A67D65-08DF-4fec-8533-E5B550410B85", KSPROPSETID_BdaPIDFilter); -#define KSPROPSETID_BdaPIDFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaPIDFilter) - -typedef enum { - KSPROPERTY_BDA_PIDFILTER_MAP_PIDS = 0, - KSPROPERTY_BDA_PIDFILTER_UNMAP_PIDS, - KSPROPERTY_BDA_PIDFILTER_LIST_PIDS -} KSPROPERTY_BDA_PIDFILTER; - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_MAP_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_MAP_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PID_MAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_UNMAP_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_UNMAP_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PID_UNMAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_LIST_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_LIST_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA CA Property Set -// -// {B0693766-5278-4ec6-B9E1-3CE40560EF5A} -// -#define STATIC_KSPROPSETID_BdaCA \ - 0xb0693766, 0x5278, 0x4ec6, 0xb9, 0xe1, 0x3c, 0xe4, 0x5, 0x60, 0xef, 0x5a -DEFINE_GUIDSTRUCT("B0693766-5278-4ec6-B9E1-3CE40560EF5A", KSPROPSETID_BdaCA); -#define KSPROPSETID_BdaCA DEFINE_GUIDNAMED(KSPROPSETID_BdaCA) - -typedef enum { - KSPROPERTY_BDA_ECM_MAP_STATUS = 0, - KSPROPERTY_BDA_CA_MODULE_STATUS, - KSPROPERTY_BDA_CA_SMART_CARD_STATUS, - KSPROPERTY_BDA_CA_MODULE_UI, - KSPROPERTY_BDA_CA_SET_PROGRAM_PIDS, - KSPROPERTY_BDA_CA_REMOVE_PROGRAM -} KSPROPERTY_BDA_CA; - -#define DEFINE_KSPROPERTY_ITEM_BDA_ECM_MAP_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ECM_MAP_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CA_MODULE_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_MODULE_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CA_SMART_CARD_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_SMART_CARD_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CA_MODULE_UI(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_MODULE_UI,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_CA_MODULE_UI),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CA_SET_PROGRAM_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_SET_PROGRAM_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PROGRAM_PID_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_BDA_CA_REMOVE_PROGRAM(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_REMOVE_PROGRAM,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - -//------------------------------------------------------------ -// -// -// BDA CA Event Set -// -// {488C4CCC-B768-4129-8EB1-B00A071F9068} -// -#define STATIC_KSEVENTSETID_BdaCAEvent \ - 0x488c4ccc, 0xb768, 0x4129, 0x8e, 0xb1, 0xb0, 0xa, 0x7, 0x1f, 0x90, 0x68 -DEFINE_GUIDSTRUCT("488C4CCC-B768-4129-8EB1-B00A071F9068", KSEVENTSETID_BdaCAEvent); -#define KSEVENTSETID_BdaCAEvent DEFINE_GUIDNAMED(KSEVENTSETID_BdaCAEvent) - -typedef enum { - KSEVENT_BDA_PROGRAM_FLOW_STATUS_CHANGED = 0, - KSEVENT_BDA_CA_MODULE_STATUS_CHANGED, - KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED, - KSEVENT_BDA_CA_MODULE_UI_REQUESTED -} KSPROPERTY_BDA_CA_EVENT; - -#define DEFINE_KSEVENT_BDA_PROGRAM_FLOW_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_PROGRAM_FLOW_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - -#define DEFINE_KSEVENT_BDA_CA_MODULE_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_MODULE_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - -#define DEFINE_KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - -#define DEFINE_KSEVENT_BDA_CA_MODULE_UI_REQUESTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_MODULE_UI_REQUESTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - -//=========================================================================== -// -// BDA Filter Categories -// -//=========================================================================== - -#define STATIC_KSCATEGORY_BDA_RECEIVER_COMPONENT \ - 0xFD0A5AF4, 0xB41D, 0x11d2, 0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("FD0A5AF4-B41D-11d2-9C95-00C04F7971E0", KSCATEGORY_BDA_RECEIVER_COMPONENT); -#define KSCATEGORY_BDA_RECEIVER_COMPONENT DEFINE_GUIDNAMED(KSCATEGORY_BDA_RECEIVER_COMPONENT) - - -#define STATIC_KSCATEGORY_BDA_NETWORK_TUNER \ - 0x71985f48, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F48-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_TUNER); -#define KSCATEGORY_BDA_NETWORK_TUNER DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_TUNER) - - -#define STATIC_KSCATEGORY_BDA_NETWORK_EPG \ - 0x71985f49, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F49-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_EPG); -#define KSCATEGORY_BDA_NETWORK_EPG DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_EPG) - - -#define STATIC_KSCATEGORY_BDA_IP_SINK \ - 0x71985f4aL, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4A-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_IP_SINK); -#define KSCATEGORY_IP_SINK DEFINE_GUIDNAMED(KSCATEGORY_BDA_IP_SINK) - - -#define STATIC_KSCATEGORY_BDA_NETWORK_PROVIDER \ - 0x71985f4b, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4B-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_PROVIDER); -#define KSCATEGORY_BDA_NETWORK_PROVIDER DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_PROVIDER) - -// {A2E3074F-6C3D-11d3-B653-00C04F79498E} -#define STATIC_KSCATEGORY_BDA_TRANSPORT_INFORMATION \ - 0xa2e3074f, 0x6c3d, 0x11d3, 0xb6, 0x53, 0x0, 0xc0, 0x4f, 0x79, 0x49, 0x8e -DEFINE_GUIDSTRUCT("A2E3074F-6C3D-11d3-B653-00C04F79498E", KSCATEGORY_BDA_TRANSPORT_INFORMATION); -#define KSCATEGORY_BDA_TRANSPORT_INFORMATION DEFINE_GUIDNAMED(KSCATEGORY_BDA_TRANSPORT_INFORMATION) - - -//=========================================================================== -// -// BDA Node Categories -// -//=========================================================================== - - -#define STATIC_KSNODE_BDA_RF_TUNER \ - 0x71985f4c, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4C-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_RF_TUNER); -#define KSNODE_BDA_RF_TUNER DEFINE_GUIDNAMED(KSNODE_BDA_RF_TUNER) - - -#define STATIC_KSNODE_BDA_QAM_DEMODULATOR \ - 0x71985f4d, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4D-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_QAM_DEMODULATOR); -#define KSNODE_BDA_QAM_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_QAM_DEMODULATOR) - - -#define STATIC_KSNODE_BDA_QPSK_DEMODULATOR \ - 0x6390c905, 0x27c1, 0x4d67, 0xbd, 0xb7, 0x77, 0xc5, 0xd, 0x7, 0x93, 0x0 -DEFINE_GUIDSTRUCT("6390C905-27C1-4d67-BDB7-77C50D079300", KSNODE_BDA_QPSK_DEMODULATOR); -#define KSNODE_BDA_QPSK_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_QPSK_DEMODULATOR) - - -#define STATIC_KSNODE_BDA_8VSB_DEMODULATOR \ - 0x71985f4f, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4F-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_8VSB_DEMODULATOR); -#define KSNODE_BDA_8VSB_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_8VSB_DEMODULATOR) - - -#define STATIC_KSNODE_BDA_COFDM_DEMODULATOR \ - 0x2dac6e05, 0xedbe, 0x4b9c, 0xb3, 0x87, 0x1b, 0x6f, 0xad, 0x7d, 0x64, 0x95 -DEFINE_GUIDSTRUCT("2DAC6E05-EDBE-4b9c-B387-1B6FAD7D6495", KSNODE_BDA_COFDM_DEMODULATOR); -#define KSNODE_BDA_COFDM_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_COFDM_DEMODULATOR) - - -#define STATIC_KSNODE_BDA_OPENCABLE_POD \ - 0xd83ef8fc, 0xf3b8, 0x45ab, 0x8b, 0x71, 0xec, 0xf7, 0xc3, 0x39, 0xde, 0xb4 -DEFINE_GUIDSTRUCT("D83EF8FC-F3B8-45ab-8B71-ECF7C339DEB4", KSNODE_BDA_OPENCABLE_POD); -#define KSNODE_BDA_OPENCABLE_POD DEFINE_GUIDNAMED(KSNODE_BDA_OPENCABLE_POD) - - -#define STATIC_KSNODE_BDA_COMMON_CA_POD \ - 0xd83ef8fc, 0xf3b8, 0x45ab, 0x8b, 0x71, 0xec, 0xf7, 0xc3, 0x39, 0xde, 0xb4 -DEFINE_GUIDSTRUCT("D83EF8FC-F3B8-45ab-8B71-ECF7C339DEB4", KSNODE_BDA_COMMON_CA_POD); -#define KSNODE_BDA_COMMON_CA_POD DEFINE_GUIDNAMED(KSNODE_BDA_COMMON_CA_POD) - - -#define STATIC_KSNODE_BDA_PID_FILTER \ - 0xf5412789, 0xb0a0, 0x44e1, 0xae, 0x4f, 0xee, 0x99, 0x9b, 0x1b, 0x7f, 0xbe -DEFINE_GUIDSTRUCT("F5412789-B0A0-44e1-AE4F-EE999B1B7FBE", KSNODE_BDA_PID_FILTER); -#define KSNODE_BDA_PID_FILTER DEFINE_GUIDNAMED(KSNODE_BDA_PID_FILTER) - - -#define STATIC_KSNODE_BDA_IP_SINK \ - 0x71985f4e, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 -DEFINE_GUIDSTRUCT("71985F4E-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_IP_SINK); -#define KSNODE_IP_SINK DEFINE_GUIDNAMED(KSNODE_BDA_IP_SINK) - - -//=========================================================================== -// -// IPSink PINNAME GUID -// -//=========================================================================== - -#define STATIC_PINNAME_IPSINK_INPUT \ - 0x3fdffa70L, 0xac9a, 0x11d2, 0x8f, 0x17, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe2 -DEFINE_GUIDSTRUCT("3fdffa70-ac9a-11d2-8f17-00c04f7971e2", PINNAME_IPSINK_INPUT); -#define PINNAME_IPSINK_INPUT DEFINE_GUIDNAMED(PINNAME_IPSINK_INPUT) - - -//=========================================================================== -// -// BDA IPSink Categories/Types -// -//=========================================================================== - - -#define STATIC_KSDATAFORMAT_TYPE_BDA_IP\ - 0xe25f7b8e, 0xcccc, 0x11d2, 0x8f, 0x25, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 -DEFINE_GUIDSTRUCT("e25f7b8e-cccc-11d2-8f25-00c04f7971e2", KSDATAFORMAT_TYPE_BDA_IP); -#define KSDATAFORMAT_TYPE_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IP) - -#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP\ - 0x5a9a213c, 0xdb08, 0x11d2, 0x8f, 0x32, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 -DEFINE_GUIDSTRUCT("5a9a213c-db08-11d2-8f32-00c04f7971e2", KSDATAFORMAT_SUBTYPE_BDA_IP); -#define KSDATAFORMAT_SUBTYPE_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_IP) - -#define STATIC_KSDATAFORMAT_SPECIFIER_BDA_IP\ - 0x6b891420, 0xdb09, 0x11d2, 0x8f, 0x32, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 -DEFINE_GUIDSTRUCT("6B891420-DB09-11d2-8F32-00C04F7971E2", KSDATAFORMAT_SPECIFIER_BDA_IP); -#define KSDATAFORMAT_SPECIFIER_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_BDA_IP) - - - -#define STATIC_KSDATAFORMAT_TYPE_BDA_IP_CONTROL\ - 0xdadd5799, 0x7d5b, 0x4b63, 0x80, 0xfb, 0xd1, 0x44, 0x2f, 0x26, 0xb6, 0x21 -DEFINE_GUIDSTRUCT("DADD5799-7D5B-4b63-80FB-D1442F26B621", KSDATAFORMAT_TYPE_BDA_IP_CONTROL); -#define KSDATAFORMAT_TYPE_BDA_IP_CONTROL DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IP_CONTROL) - -#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL\ - 0x499856e8, 0xe85b, 0x48ed, 0x9b, 0xea, 0x41, 0xd, 0xd, 0xd4, 0xef, 0x81 -DEFINE_GUIDSTRUCT("499856E8-E85B-48ed-9BEA-410D0DD4EF81", KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL); -#define KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL) - - -//=========================================================================== -// -// MPE PINNAME GUID -// -//=========================================================================== - -#define STATIC_PINNAME_MPE \ - 0xc1b06d73L, 0x1dbb, 0x11d3, 0x8f, 0x46, 0x00, 0xC0, 0x4f, 0x79, 0x71, 0xE2 -DEFINE_GUIDSTRUCT("C1B06D73-1DBB-11d3-8F46-00C04F7971E2", PINNAME_MPE); -#define PINNAME_MPE DEFINE_GUIDNAMED(PINNAME_MPE) - - -///////////////////////////////////////////////////////////// -// -// BDA MPE Categories/Types -// -#define STATIC_KSDATAFORMAT_TYPE_MPE \ - 0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5 -DEFINE_GUIDSTRUCT("455F176C-4B06-47ce-9AEF-8CAEF73DF7B5", KSDATAFORMAT_TYPE_MPE); -#define KSDATAFORMAT_TYPE_MPE DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPE) - - -#if defined(__cplusplus) -} -#endif // defined(__cplusplus) - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - //=========================================================================== - // - // KSProperty Set Structure Definitions for BDA - // - //=========================================================================== - - typedef struct _KSP_BDA_NODE_PIN { - KSPROPERTY Property; - ULONG ulNodeType; - ULONG ulInputPinId; - ULONG ulOutputPinId; - } KSP_BDA_NODE_PIN, *PKSP_BDA_NODE_PIN; - - - typedef struct { - KSP_NODE Property; - ULONG EsPid; - } KSP_NODE_ESPID, *PKSP_NODE_ESPID; - - - - //=========================================================================== - // - // BDA Data Range definitions. Includes specifier definitions. - // - //=========================================================================== - - // Antenna Signal Formats - // - - typedef struct tagKS_DATARANGE_BDA_ANTENNA { - KSDATARANGE DataRange; - - // Antenna specifier can go here if required - // - } KS_DATARANGE_BDA_ANTENNA, *PKS_DATARANGE_BDA_ANTENNA; - - - - // Transport Formats - // - - typedef struct tagBDA_TRANSPORT_INFO { - ULONG ulcbPhyiscalPacket; // Size, in bytes, of a physical packet - // (e.g. Satellite link payload size. - ULONG ulcbPhyiscalFrame; // Size, in bytes, of each physical frame - // 0 indicates no HW requirement - ULONG ulcbPhyiscalFrameAlignment; // Capture buffer alignment in bytes - // 0 and 1 indicate no alignment requirements - REFERENCE_TIME AvgTimePerFrame; // Normal ActiveMovie units (100 nS) - - } BDA_TRANSPORT_INFO, *PBDA_TRANSPORT_INFO; - - typedef struct tagKS_DATARANGE_BDA_TRANSPORT { - KSDATARANGE DataRange; - BDA_TRANSPORT_INFO BdaTransportInfo; - - // Transport specifier can go here if required - // - } KS_DATARANGE_BDA_TRANSPORT, *PKS_DATARANGE_BDA_TRANSPORT; - - - - //=========================================================================== - // - // BDA Stream Format GUIDs - // - //=========================================================================== - - #define STATIC_KSDATAFORMAT_TYPE_BDA_ANTENNA\ - 0x71985f41, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F41-1CA1-11d3-9CC8-00C04F7971E0", KSDATAFORMAT_TYPE_BDA_ANTENNA); - #define KSDATAFORMAT_TYPE_BDA_ANTENNA DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_ANTENNA) - - - #define STATIC_KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT\ - 0xf4aeb342, 0x0329, 0x4fdd, 0xa8, 0xfd, 0x4a, 0xff, 0x49, 0x26, 0xc9, 0x78 - DEFINE_GUIDSTRUCT("F4AEB342-0329-4fdd-A8FD-4AFF4926C978", KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT); - #define KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT) - - - #define STATIC_KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT\ - 0x8deda6fd, 0xac5f, 0x4334, 0x8e, 0xcf, 0xa4, 0xba, 0x8f, 0xa7, 0xd0, 0xf0 - DEFINE_GUIDSTRUCT("8DEDA6FD-AC5F-4334-8ECF-A4BA8FA7D0F0", KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT); - #define KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT) - - - #define STATIC_KSDATAFORMAT_TYPE_BDA_IF_SIGNAL\ - 0x61be0b47, 0xa5eb, 0x499b, 0x9a, 0x85, 0x5b, 0x16, 0xc0, 0x7f, 0x12, 0x58 - DEFINE_GUIDSTRUCT("61BE0B47-A5EB-499b-9A85-5B16C07F1258", KSDATAFORMAT_TYPE_BDA_IF_SIGNAL); - #define KSDATAFORMAT_TYPE_BDA_IF_SIGNAL DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IF_SIGNAL) - - - #define STATIC_KSDATAFORMAT_TYPE_MPEG2_SECTIONS\ - 0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5 - DEFINE_GUIDSTRUCT("455F176C-4B06-47CE-9AEF-8CAEF73DF7B5", KSDATAFORMAT_TYPE_MPEG2_SECTIONS); - #define KSDATAFORMAT_TYPE_MPEG2_SECTIONS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_SECTIONS) - - - #define STATIC_KSDATAFORMAT_SUBTYPE_ATSC_SI\ - 0xb3c7397c, 0xd303, 0x414d, 0xb3, 0x3c, 0x4e, 0xd2, 0xc9, 0xd2, 0x97, 0x33 - DEFINE_GUIDSTRUCT("B3C7397C-D303-414D-B33C-4ED2C9D29733", KSDATAFORMAT_SUBTYPE_ATSC_SI); - #define KSDATAFORMAT_SUBTYPE_SUBTYPE_ATSC_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ATSC_SI) - - - #define STATIC_KSDATAFORMAT_SUBTYPE_DVB_SI\ - 0xe9dd31a3, 0x221d, 0x4adb, 0x85, 0x32, 0x9a, 0xf3, 0x9, 0xc1, 0xa4, 0x8 - DEFINE_GUIDSTRUCT("e9dd31a3-221d-4adb-8532-9af309c1a408", KSDATAFORMAT_SUBTYPE_DVB_SI); - #define KSDATAFORMAT_SUBTYPE_SUBTYPE_DVB_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVB_SI) - - - #define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP\ - 0x762e3f66, 0x336f, 0x48d1, 0xbf, 0x83, 0x2b, 0x0, 0x35, 0x2c, 0x11, 0xf0 - DEFINE_GUIDSTRUCT("762E3F66-336F-48d1-BF83-2B00352C11F0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP); - #define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP) - - #define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP\ - 0x951727db, 0xd2ce, 0x4528, 0x96, 0xf6, 0x33, 0x1, 0xfa, 0xbb, 0x2d, 0xe0 - DEFINE_GUIDSTRUCT("951727DB-D2CE-4528-96F6-3301FABB2DE0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP); - #define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP) - - //=========================================================================== - // - // KSPinName Definitions for BDA - // - //=========================================================================== - - // Pin name for a BDA transport pin - // - // {78216A81-CFA8-493e-9711-36A61C08BD9D} - // - #define STATIC_PINNAME_BDA_TRANSPORT \ - 0x78216a81, 0xcfa8, 0x493e, 0x97, 0x11, 0x36, 0xa6, 0x1c, 0x8, 0xbd, 0x9d - DEFINE_GUIDSTRUCT("78216A81-CFA8-493e-9711-36A61C08BD9D", PINNAME_BDA_TRANSPORT); - #define PINNAME_BDA_TRANSPORT DEFINE_GUIDNAMED(PINNAME_BDA_TRANSPORT) - - - // Pin name for a BDA analog video pin - // - // {5C0C8281-5667-486c-8482-63E31F01A6E9} - // - #define STATIC_PINNAME_BDA_ANALOG_VIDEO \ - 0x5c0c8281, 0x5667, 0x486c, 0x84, 0x82, 0x63, 0xe3, 0x1f, 0x1, 0xa6, 0xe9 - DEFINE_GUIDSTRUCT("5C0C8281-5667-486c-8482-63E31F01A6E9", PINNAME_BDA_ANALOG_VIDEO); - #define PINNAME_BDA_ANALOG_VIDEO DEFINE_GUIDNAMED(PINNAME_BDA_ANALOG_VIDEO) - - - // Pin name for a BDA analog audio pin - // - // {D28A580A-9B1F-4b0c-9C33-9BF0A8EA636B} - // - #define STATIC_PINNAME_BDA_ANALOG_AUDIO \ - 0xd28a580a, 0x9b1f, 0x4b0c, 0x9c, 0x33, 0x9b, 0xf0, 0xa8, 0xea, 0x63, 0x6b - DEFINE_GUIDSTRUCT("D28A580A-9B1F-4b0c-9C33-9BF0A8EA636B", PINNAME_BDA_ANALOG_AUDIO); - #define PINNAME_BDA_ANALOG_AUDIO DEFINE_GUIDNAMED(PINNAME_BDA_ANALOG_AUDIO) - - - // Pin name for a BDA FM Radio pin - // - // {D2855FED-B2D3-4eeb-9BD0-193436A2F890} - // - #define STATIC_PINNAME_BDA_FM_RADIO \ - 0xd2855fed, 0xb2d3, 0x4eeb, 0x9b, 0xd0, 0x19, 0x34, 0x36, 0xa2, 0xf8, 0x90 - DEFINE_GUIDSTRUCT("D2855FED-B2D3-4eeb-9BD0-193436A2F890", PINNAME_BDA_FM_RADIO); - #define PINNAME_BDA_FM_RADIO DEFINE_GUIDNAMED(PINNAME_BDA_FM_RADIO) - - - // Pin name for a BDA Intermediate Frequency pin - // - // {1A9D4A42-F3CD-48a1-9AEA-71DE133CBE14} - // - #define STATIC_PINNAME_BDA_IF_PIN \ - 0x1a9d4a42, 0xf3cd, 0x48a1, 0x9a, 0xea, 0x71, 0xde, 0x13, 0x3c, 0xbe, 0x14 - DEFINE_GUIDSTRUCT("1A9D4A42-F3CD-48a1-9AEA-71DE133CBE14", PINNAME_BDA_IF_PIN); - #define PINNAME_BDA_IF_PIN DEFINE_GUIDNAMED(PINNAME_BDA_IF_PIN) - - - // Pin name for a BDA Open Cable PSIP pin - // - // {297BB104-E5C9-4ACE-B123-95C3CBB24D4F} - // - #define STATIC_PINNAME_BDA_OPENCABLE_PSIP_PIN \ - 0x297bb104, 0xe5c9, 0x4ace, 0xb1, 0x23, 0x95, 0xc3, 0xcb, 0xb2, 0x4d, 0x4f - DEFINE_GUIDSTRUCT("297BB104-E5C9-4ACE-B123-95C3CBB24D4F", PINNAME_BDA_OPENCABLE_PSIP_PIN); - #define PINNAME_BDA_OPENCABLE_PSIP_PIN DEFINE_GUIDNAMED(PINNAME_BDA_OPENCABLE_PSIP_PIN) - - - //=========================================================================== - // - // KSProperty Set Definitions for BDA - // - //=========================================================================== - - - //------------------------------------------------------------ - // - // BDA Network Ethernet Filter Property Set - // - // {71985F43-1CA1-11d3-9CC8-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaEthernetFilter \ - 0x71985f43, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F43-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaEthernetFilter); - #define KSPROPSETID_BdaEthernetFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaEthernetFilter) - - typedef enum { - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_MODE - } KSPROPERTY_BDA_ETHERNET_FILTER; - - #define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_ETHERNET_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ETHERNET_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ETHERNET_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // BDA Network IPv4 Filter Property Set - // - // {71985F44-1CA1-11d3-9CC8-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaIPv4Filter \ - 0x71985f44, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F44-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaIPv4Filter); - #define KSPROPSETID_BdaIPv4Filter DEFINE_GUIDNAMED(KSPROPSETID_BdaIPv4Filter) - - typedef enum { - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_MODE - } KSPROPERTY_BDA_IPv4_FILTER; - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_IPv4_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv4_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv4_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // BDA Network IPv6 Filter Property Set - // - // {E1785A74-2A23-4fb3-9245-A8F88017EF33} - // - #define STATIC_KSPROPSETID_BdaIPv6Filter \ - 0xe1785a74, 0x2a23, 0x4fb3, 0x92, 0x45, 0xa8, 0xf8, 0x80, 0x17, 0xef, 0x33 - DEFINE_GUIDSTRUCT("E1785A74-2A23-4fb3-9245-A8F88017EF33", KSPROPSETID_BdaIPv6Filter); - #define KSPROPSETID_BdaIPv6Filter DEFINE_GUIDNAMED(KSPROPSETID_BdaIPv6Filter) - - typedef enum { - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE = 0, - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST, - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_MODE - } KSPROPERTY_BDA_IPv6_FILTER; - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST_SIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_LIST,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_IPv6_ADDRESS_LIST),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_IPv6_FILTER_MULTICAST_MODE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_IPv6_FILTER_MULTICAST_MODE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_MULTICAST_MODE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Signal Property Set - // - // {D2F1644B-B409-11d2-BC69-00A0C9EE9E16} - // - #define STATIC_KSPROPSETID_BdaSignal \ - 0xd2f1644b, 0xb409, 0x11d2, 0xbc, 0x69, 0x0, 0xa0, 0xc9, 0xee, 0x9e, 0x16 - DEFINE_GUIDSTRUCT("D2F1644B-B409-11d2-BC69-00A0C9EE9E16", KSPROPSETID_BdaSignal); - #define KSPROPSETID_BdaSignal DEFINE_GUIDNAMED(KSPROPSETID_BdaSignal) - - typedef enum { - KSPROPERTY_BDA_SIGNAL_SOURCE = 0, - KSPROPERTY_BDA_SIGNAL_TUNING_SPACE, - KSPROPERTY_BDA_SIGNAL_NETWORK_TYPE, - KSPROPERTY_BDA_SIGNAL_STATE - } KSPROPERTY_BDA_SIGNAL; - - #define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_SOURCE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_SOURCE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_TUNING_SPACE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_TUNING_SPACE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_NETWORK_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_NETWORK_TYPE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_STATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SIGNAL_STATE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(BDA_SIGNAL_STATE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Change Sync Method Set - // - // {FD0A5AF3-B41D-11d2-9C95-00C04F7971E0} - // - #define STATIC_KSMETHODSETID_BdaChangeSync \ - 0xfd0a5af3, 0xb41d, 0x11d2, 0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("FD0A5AF3-B41D-11d2-9C95-00C04F7971E0", KSMETHODSETID_BdaChangeSync); - #define KSMETHODSETID_BdaChangeSync DEFINE_GUIDNAMED(KSMETHODSETID_BdaChangeSync) - - typedef enum { - KSMETHOD_BDA_START_CHANGES = 0, - KSMETHOD_BDA_CHECK_CHANGES, - KSMETHOD_BDA_COMMIT_CHANGES, - KSMETHOD_BDA_GET_CHANGE_STATE - } KSMETHOD_BDA_CHANGE_SYNC; - - #define DEFINE_KSMETHOD_ITEM_BDA_START_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_START_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - - #define DEFINE_KSMETHOD_ITEM_BDA_CHECK_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CHECK_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - - #define DEFINE_KSMETHOD_ITEM_BDA_COMMIT_CHANGES(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_COMMIT_CHANGES,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - - #define DEFINE_KSMETHOD_ITEM_BDA_GET_CHANGE_STATE(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_GET_CHANGE_STATE,\ - KSMETHOD_TYPE_READ,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - 0,\ - SupportHandler) - - - - //------------------------------------------------------------ - // - // - // BDA Device Configuration Method Set - // - // {71985F45-1CA1-11d3-9CC8-00C04F7971E0} - // - #define STATIC_KSMETHODSETID_BdaDeviceConfiguration \ - 0x71985f45, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F45-1CA1-11d3-9CC8-00C04F7971E0", KSMETHODSETID_BdaDeviceConfiguration); - #define KSMETHODSETID_BdaDeviceConfiguration DEFINE_GUIDNAMED(KSMETHODSETID_BdaDeviceConfiguration) - - typedef enum { - KSMETHOD_BDA_CREATE_PIN_FACTORY = 0, - KSMETHOD_BDA_DELETE_PIN_FACTORY, - KSMETHOD_BDA_CREATE_TOPOLOGY - } KSMETHOD_BDA_DEVICE_CONFIGURATION; - - #define DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CREATE_PIN_FACTORY,\ - KSMETHOD_TYPE_READ,\ - (MethodHandler),\ - sizeof(KSM_PIN),\ - sizeof(ULONG),\ - SupportHandler) - - #define DEFINE_KSMETHOD_ITEM_BDA_DELETE_PIN_FACTORY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_DELETE_PIN_FACTORY,\ - KSMETHOD_TYPE_NONE,\ - (MethodHandler),\ - sizeof(KSM_PIN),\ - 0,\ - SupportHandler) - - #define DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(MethodHandler, SupportHandler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_BDA_CREATE_TOPOLOGY,\ - KSMETHOD_TYPE_WRITE,\ - (MethodHandler),\ - sizeof(KSMETHOD),\ - sizeof(KSMULTIPLE_ITEM),\ - SupportHandler) - - - - //------------------------------------------------------------ - // - // - // BDA Topology Property Set - // - // {A14EE835-0A23-11d3-9CC7-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaTopology \ - 0xa14ee835, 0x0a23, 0x11d3, 0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("A14EE835-0A23-11d3-9CC7-00C04F7971E0", KSPROPSETID_BdaTopology); - #define KSPROPSETID_BdaTopology DEFINE_GUIDNAMED(KSPROPSETID_BdaTopology) - - typedef enum { - KSPROPERTY_BDA_NODE_TYPES, - KSPROPERTY_BDA_PIN_TYPES, - KSPROPERTY_BDA_TEMPLATE_CONNECTIONS, - KSPROPERTY_BDA_NODE_METHODS, - KSPROPERTY_BDA_NODE_PROPERTIES, - KSPROPERTY_BDA_NODE_EVENTS, - KSPROPERTY_BDA_CONTROLLING_PIN_ID, - KSPROPERTY_BDA_NODE_DESCRIPTORS - }KSPROPERTY_BDA_TOPOLOGY; - - #define DEFINE_KSPROPERTY_ITEM_BDA_NODE_TYPES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_TYPES,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_TYPES,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_TEMPLATE_CONNECTIONS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_TEMPLATE_CONNECTIONS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof( BDA_TEMPLATE_CONNECTION),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_NODE_METHODS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_METHODS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_NODE_PROPERTIES(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_PROPERTIES,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_NODE_EVENTS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_EVENTS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_CONTROLLING_PIN_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CONTROLLING_PIN_ID,\ - (GetHandler),\ - sizeof(KSP_BDA_NODE_PIN),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_NODE_DESCRIPTORS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NODE_DESCRIPTORS,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Pin Control Property Set - // - // {0DED49D5-A8B7-4d5d-97A1-12B0C195874D} - // - #define STATIC_KSPROPSETID_BdaPinControl \ - 0xded49d5, 0xa8b7, 0x4d5d, 0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d - DEFINE_GUIDSTRUCT("0DED49D5-A8B7-4d5d-97A1-12B0C195874D", KSPROPSETID_BdaPinControl); - #define KSPROPSETID_BdaPinControl DEFINE_GUIDNAMED(KSPROPSETID_BdaPinControl) - - typedef enum { - KSPROPERTY_BDA_PIN_ID = 0, - KSPROPERTY_BDA_PIN_TYPE - } KSPROPERTY_BDA_PIN_CONTROL; - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIN_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_ID,\ - (GetHandler),\ - sizeof( KSPROPERTY),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIN_TYPE,\ - (GetHandler),\ - sizeof( KSPROPERTY),\ - sizeof( ULONG),\ - FALSE,\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Pin Event Set - // - // {104781CD-50BD-40d5-95FB-087E0E86A591} - // - #define STATIC_KSEVENTSETID_BdaPinEvent \ - 0x104781cd, 0x50bd, 0x40d5, 0x95, 0xfb, 0x08, 0x7e, 0xe, 0x86, 0xa5, 0x91 - DEFINE_GUIDSTRUCT("104781CD-50BD-40d5-95FB-087E0E86A591", KSEVENTSETID_BdaPinEvent); - #define KSEVENTSETID_BdaPinEvent DEFINE_GUIDNAMED(KSEVENTSETID_BdaPinEvent) - - typedef enum { - KSEVENT_BDA_PIN_CONNECTED = 0, - KSEVENT_BDA_PIN_DISCONNECTED - } KSPROPERTY_BDA_PIN_EVENT; - - #define DEFINE_KSEVENT_ITEM_BDA_PIN_CONNECTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_PIN_CONNECTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - #define DEFINE_KSEVENT_ITEM_BDA_PIN_DISCONNECTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_PIN_DISCONNECTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - - - //------------------------------------------------------------ - // - // - // BDA Void Transform Property Set - // - // {71985F46-1CA1-11d3-9CC8-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaVoidTransform \ - 0x71985f46, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F46-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaVoidTransform); - #define KSPROPSETID_BdaVoidTransform DEFINE_GUIDNAMED(KSPROPSETID_BdaVoidTransform) - - typedef enum { - KSPROPERTY_BDA_VOID_TRANSFORM_START = 0, - KSPROPERTY_BDA_VOID_TRANSFORM_STOP - } KSPROPERTY_BDA_VOID_TRANSFORM; - - #define DEFINE_KSPROPERTY_ITEM_BDA_VOID_TRANSFORM_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_VOID_TRANSFORM_START,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_VOID_TRANSFORM_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_VOID_TRANSFORM_STOP,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Null Transform Property Set - // - // {DDF15B0D-BD25-11d2-9CA0-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaNullTransform \ - 0xddf15b0d, 0xbd25, 0x11d2, 0x9c, 0xa0, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("DDF15B0D-BD25-11d2-9CA0-00C04F7971E0", KSPROPSETID_BdaNullTransform); - #define KSPROPSETID_BdaNullTransform DEFINE_GUIDNAMED(KSPROPSETID_BdaNullTransform) - - typedef enum { - KSPROPERTY_BDA_NULL_TRANSFORM_START = 0, - KSPROPERTY_BDA_NULL_TRANSFORM_STOP - } KSPROPERTY_BDA_NULL_TRANSFORM; - - #define DEFINE_KSPROPERTY_ITEM_BDA_NULL_TRANSFORM_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NULL_TRANSFORM_START,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_NULL_TRANSFORM_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_NULL_TRANSFORM_STOP,\ - FALSE,\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Frequency Filter Property Set - // - // {71985F47-1CA1-11d3-9CC8-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaFrequencyFilter \ - 0x71985f47, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F47-1CA1-11d3-9CC8-00C04F7971E0", KSPROPSETID_BdaFrequencyFilter); - #define KSPROPSETID_BdaFrequencyFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaFrequencyFilter) - - typedef enum { - KSPROPERTY_BDA_RF_TUNER_FREQUENCY = 0, - KSPROPERTY_BDA_RF_TUNER_POLARITY, - KSPROPERTY_BDA_RF_TUNER_RANGE, - KSPROPERTY_BDA_RF_TUNER_TRANSPONDER - } KSPROPERTY_BDA_FREQUENCY_FILTER; - - #define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_FREQUENCY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_FREQUENCY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_POLARITY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_POLARITY,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_RANGE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_RANGE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_TRANSPONDER(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_RF_TUNER_TRANSPONDER,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Digital Demodulator Property Set - // - // {EF30F379-985B-4d10-B640-A79D5E04E1E0} - // - #define STATIC_KSPROPSETID_BdaDigitalDemodulator \ - 0xef30f379, 0x985b, 0x4d10, 0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x4, 0xe1, 0xe0 - DEFINE_GUIDSTRUCT("EF30F379-985B-4d10-B640-A79D5E04E1E0", KSPROPSETID_BdaDigitalDemodulator); - #define KSPROPSETID_BdaDigitalDemodulator DEFINE_GUIDNAMED(KSPROPSETID_BdaDigitalDemodulator) - - typedef enum { - KSPROPERTY_BDA_MODULATION_TYPE = 0, - KSPROPERTY_BDA_INNER_FEC_TYPE, - KSPROPERTY_BDA_INNER_FEC_RATE, - KSPROPERTY_BDA_OUTER_FEC_TYPE, - KSPROPERTY_BDA_OUTER_FEC_RATE, - KSPROPERTY_BDA_SYMBOL_RATE, - KSPROPERTY_BDA_SPECTRAL_INVERSION, - - } KSPROPERTY_BDA_DIGITAL_DEMODULATOR; - - #define DEFINE_KSPROPERTY_ITEM_BDA_MODULATION_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_MODULATION_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ModulationType),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_INNER_FEC_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(FECMethod),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_INNER_FEC_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BinaryConvolutionCodeRate),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_TYPE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_OUTER_FEC_TYPE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(FECMethod),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_OUTER_FEC_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BinaryConvolutionCodeRate),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_SYMBOL_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SYMBOL_RATE,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_SPECTRAL_INVERSION(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_SPECTRAL_INVERSION,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(SpectralInversion),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA Autodemodulate Property Set - // - // {DDF15B12-BD25-11d2-9CA0-00C04F7971E0} - // - #define STATIC_KSPROPSETID_BdaAutodemodulate \ - 0xddf15b12, 0xbd25, 0x11d2, 0x9c, 0xa0, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("DDF15B12-BD25-11d2-9CA0-00C04F7971E0", KSPROPSETID_BdaAutodemodulate); - #define KSPROPSETID_BdaAutodemodulate DEFINE_GUIDNAMED(KSPROPSETID_BdaAutodemodulate) - - typedef enum { - KSPROPERTY_BDA_AUTODEMODULATE_START = 0, - KSPROPERTY_BDA_AUTODEMODULATE_STOP - } KSPROPERTY_BDA_AUTODEMODULATE; - - #define DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_START(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_AUTODEMODULATE_START,\ - FALSE,\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_STOP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_AUTODEMODULATE_STOP,\ - FALSE,\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - //------------------------------------------------------------ - // - // - // BDA PmtProcessor Property Set - // - // {516B99C5-971C-4aaf-B3F3-D9FDA8A15E16} - // - - #define STATIC_KSPROPSETID_BdaPmtProcessor \ - 0x516b99c5, 0x971c, 0x4aaf, 0xb3, 0xf3, 0xd9, 0xfd, 0xa8, 0xa1, 0x5e, 0x16 - DEFINE_GUIDSTRUCT("516B99C5-971C-4aaf-B3F3-D9FDA8A15E16", KSPROPSETID_BdaPmtProcessor); - #define KSPROPSETID_BdaPmtProcessor DEFINE_GUIDNAMED(KSPROPSETID_BdaPmtProcessor) - - typedef enum { - KSPROPERTY_BDA_PMTPROCESSOR_PMT = 0, - } KSPROPERTY_BDA_PMTPROCESSOR; - - #define DEFINE_KSPROPERTY_ITEM_BDA_PMTPROCESSOR_PMT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PMTPROCESSOR_PMT,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PMT),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - //------------------------------------------------------------ - // - // - // BDA Descriptor Property Set - // - // {DE6A1C9E-87DF-48aa-95AA-289B7AA4F49F} - // - - #define STATIC_KSPROPSETID_BdaDescriptor \ - 0xde6a1c9e, 0x87df, 0x48aa, 0x95, 0xaa, 0x28, 0x9b, 0x7a, 0xa4, 0xf4, 0x9f - DEFINE_GUIDSTRUCT("DE6A1C9E-87DF-48aa-95AA-289B7AA4F49F", KSPROPSETID_BdaDescriptor); - #define KSPROPSETID_BdaDescriptor DEFINE_GUIDNAMED(KSPROPSETID_BdaDescriptor) - - typedef enum { - KSPROPERTY_BDA_DESCRIPTOR_CAT_DESC = 0, - KSPROPERTY_BDA_DESCRIPTOR_ES_DESC, - KSPROPERTY_BDA_DESCRIPTOR_PROGRAM_DESC - } KSPROPERTY_BDA_DESCRIPTOR; - - #define DEFINE_KSPROPERTY_ITEM_BDA_DESCRIPTOR_CAT_DESC(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_DESCRIPTOR_CAT_DESC,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_CAT_DESCRIPTOR),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_DESCRIPTOR_ES_DESC(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_DESCRIPTOR_ES_DESC,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_ES_DESCRIPTOR),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_DESCRIPTOR_PROGRAM_DESC(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_DESCRIPTOR_PROGRAM_DESC,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PROGRAM_DESCRIPTOR),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA EsMap Property Set - // - // {FA14A8B3-6068-48ef-96DD-53010B985A7D} - // - #define STATIC_KSPROPSETID_BdaEsMap \ - 0xfa14a8b3, 0x6068, 0x48ef, 0x96, 0xdd, 0x53, 0x1, 0xb, 0x98, 0x5a, 0x7d - DEFINE_GUIDSTRUCT("FA14A8B3-6068-48ef-96DD-53010B985A7D", KSPROPSETID_BdaEsMap); - #define KSPROPSETID_BdaEsMap DEFINE_GUIDNAMED(KSPROPSETID_BdaEsMap) - - typedef enum { - KSPROPERTY_BDA_ESMAP_EMM_PIDS = 0, - KSPROPERTY_BDA_ESMAP_ECM_PIDS, - KSPROPERTY_BDA_ESMAP_MAP_LIST, - KSPROPERTY_BDA_ESMAP_UPDATE_MAP, - KSPROPERTY_BDA_ESMAP_REMOVE_MAP - } KSPROPERTY_BDA_ESMAP; - - #define DEFINE_KSPROPERTY_ITEM_BDA_ESMAP_EMM_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ESMAP_EMM_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ESMAP_ECM_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ESMAP_ECM_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE_ESPID),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ESMAP_MAP_LIST(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ESMAP_MAP_LIST,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ESMAP_UPDATE_MAP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ESMAP_UPDATE_MAP,\ - FALSE,\ - sizeof(KSP_NODE),\ - sizeof(BDA_ES_MAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_ESMAP_REMOVE_MAP(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ESMAP_REMOVE_MAP,\ - FALSE,\ - sizeof(KSP_NODE),\ - sizeof(BDA_ES_MAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - //------------------------------------------------------------ - // - // - // BDA PID Filter Property Set - // - // {D0A67D65-08DF-4fec-8533-E5B550410B85} - // - #define STATIC_KSPROPSETID_BdaPIDFilter \ - 0xd0a67d65, 0x8df, 0x4fec, 0x85, 0x33, 0xe5, 0xb5, 0x50, 0x41, 0xb, 0x85 - DEFINE_GUIDSTRUCT("D0A67D65-08DF-4fec-8533-E5B550410B85", KSPROPSETID_BdaPIDFilter); - #define KSPROPSETID_BdaPIDFilter DEFINE_GUIDNAMED(KSPROPSETID_BdaPIDFilter) - - typedef enum { - KSPROPERTY_BDA_PIDFILTER_MAP_PIDS = 0, - KSPROPERTY_BDA_PIDFILTER_UNMAP_PIDS, - KSPROPERTY_BDA_PIDFILTER_LIST_PIDS - } KSPROPERTY_BDA_PIDFILTER; - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_MAP_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_MAP_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PID_MAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_UNMAP_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_UNMAP_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_PID_UNMAP),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_PIDFILTER_LIST_PIDS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_PIDFILTER_LIST_PIDS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA CA Property Set - // - // {B0693766-5278-4ec6-B9E1-3CE40560EF5A} - // - #define STATIC_KSPROPSETID_BdaCA \ - 0xb0693766, 0x5278, 0x4ec6, 0xb9, 0xe1, 0x3c, 0xe4, 0x5, 0x60, 0xef, 0x5a - DEFINE_GUIDSTRUCT("B0693766-5278-4ec6-B9E1-3CE40560EF5A", KSPROPSETID_BdaCA); - #define KSPROPSETID_BdaCA DEFINE_GUIDNAMED(KSPROPSETID_BdaCA) - - typedef enum { - KSPROPERTY_BDA_ECM_MAP_STATUS = 0, - KSPROPERTY_BDA_CA_MODULE_STATUS, - KSPROPERTY_BDA_CA_SMART_CARD_STATUS, - KSPROPERTY_BDA_CA_MODULE_UI - } KSPROPERTY_BDA_CA; - - #define DEFINE_KSPROPERTY_ITEM_BDA_ECM_MAP_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_ECM_MAP_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_CA_MODULE_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_MODULE_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_CA_SMART_CARD_STATUS(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_SMART_CARD_STATUS,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(ULONG),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_BDA_CA_MODULE_UI(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_BDA_CA_MODULE_UI,\ - (GetHandler),\ - sizeof(KSP_NODE),\ - sizeof(BDA_CA_MODULE_UI),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - - - //------------------------------------------------------------ - // - // - // BDA CA Event Set - // - // {488C4CCC-B768-4129-8EB1-B00A071F9068} - // - #define STATIC_KSEVENTSETID_BdaCAEvent \ - 0x488c4ccc, 0xb768, 0x4129, 0x8e, 0xb1, 0xb0, 0xa, 0x7, 0x1f, 0x90, 0x68 - DEFINE_GUIDSTRUCT("488C4CCC-B768-4129-8EB1-B00A071F9068", KSEVENTSETID_BdaCAEvent); - #define KSEVENTSETID_BdaCAEvent DEFINE_GUIDNAMED(KSEVENTSETID_BdaCAEvent) - - typedef enum { - KSEVENT_BDA_ECM_MAP_STATUS_CHANGED = 0, - KSEVENT_BDA_CA_MODULE_STATUS_CHANGED, - KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED, - KSEVENT_BDA_CA_MODULE_UI_REQUESTED - } KSPROPERTY_BDA_CA_EVENT; - - #define DEFINE_KSEVENT_BDA_ECM_MAP_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_ECM_MAP_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - #define DEFINE_KSEVENT_BDA_CA_MODULE_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_MODULE_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - #define DEFINE_KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_SMART_CARD_STATUS_CHANGED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - #define DEFINE_KSEVENT_BDA_CA_MODULE_UI_REQUESTED(AddHandler, RemoveHandler, SupportHandler)\ - DEFINE_KSEVENT_ITEM(\ - KSEVENT_BDA_CA_MODULE_UI_REQUESTED,\ - sizeof( KSEVENTDATA), \ - 0, \ - (AddHandler),\ - (RemoveHandler),\ - (SupportHandler)\ - ) - - - //=========================================================================== - // - // BDA Filter Categories - // - //=========================================================================== - - #define STATIC_KSCATEGORY_BDA_RECEIVER_COMPONENT \ - 0xFD0A5AF4, 0xB41D, 0x11d2, 0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("FD0A5AF4-B41D-11d2-9C95-00C04F7971E0", KSCATEGORY_BDA_RECEIVER_COMPONENT); - #define KSCATEGORY_BDA_RECEIVER_COMPONENT DEFINE_GUIDNAMED(KSCATEGORY_BDA_RECEIVER_COMPONENT) - - - #define STATIC_KSCATEGORY_BDA_NETWORK_TUNER \ - 0x71985f48, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F48-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_TUNER); - #define KSCATEGORY_BDA_NETWORK_TUNER DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_TUNER) - - - #define STATIC_KSCATEGORY_BDA_NETWORK_EPG \ - 0x71985f49, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F49-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_EPG); - #define KSCATEGORY_BDA_NETWORK_EPG DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_EPG) - - - #define STATIC_KSCATEGORY_BDA_IP_SINK \ - 0x71985f4aL, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4A-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_IP_SINK); - #define KSCATEGORY_IP_SINK DEFINE_GUIDNAMED(KSCATEGORY_BDA_IP_SINK) - - - #define STATIC_KSCATEGORY_BDA_NETWORK_PROVIDER \ - 0x71985f4b, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4B-1CA1-11d3-9CC8-00C04F7971E0", KSCATEGORY_BDA_NETWORK_PROVIDER); - #define KSCATEGORY_BDA_NETWORK_PROVIDER DEFINE_GUIDNAMED(KSCATEGORY_BDA_NETWORK_PROVIDER) - - // {A2E3074F-6C3D-11d3-B653-00C04F79498E} - #define STATIC_KSCATEGORY_BDA_TRANSPORT_INFORMATION \ - 0xa2e3074f, 0x6c3d, 0x11d3, 0xb6, 0x53, 0x0, 0xc0, 0x4f, 0x79, 0x49, 0x8e - DEFINE_GUIDSTRUCT("A2E3074F-6C3D-11d3-B653-00C04F79498E", KSCATEGORY_BDA_TRANSPORT_INFORMATION); - #define KSCATEGORY_BDA_TRANSPORT_INFORMATION DEFINE_GUIDNAMED(KSCATEGORY_BDA_TRANSPORT_INFORMATION) - - - //=========================================================================== - // - // BDA Node Categories - // - //=========================================================================== - - - #define STATIC_KSNODE_BDA_RF_TUNER \ - 0x71985f4c, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4C-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_RF_TUNER); - #define KSNODE_BDA_RF_TUNER DEFINE_GUIDNAMED(KSNODE_BDA_RF_TUNER) - - - #define STATIC_KSNODE_BDA_QAM_DEMODULATOR \ - 0x71985f4d, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4D-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_QAM_DEMODULATOR); - #define KSNODE_BDA_QAM_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_QAM_DEMODULATOR) - - - #define STATIC_KSNODE_BDA_QPSK_DEMODULATOR \ - 0x6390c905, 0x27c1, 0x4d67, 0xbd, 0xb7, 0x77, 0xc5, 0xd, 0x7, 0x93, 0x0 - DEFINE_GUIDSTRUCT("6390C905-27C1-4d67-BDB7-77C50D079300", KSNODE_BDA_QPSK_DEMODULATOR); - #define KSNODE_BDA_QPSK_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_QPSK_DEMODULATOR) - - - #define STATIC_KSNODE_BDA_8VSB_DEMODULATOR \ - 0x71985f4f, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4F-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_8VSB_DEMODULATOR); - #define KSNODE_BDA_8VSB_DEMODULATOR DEFINE_GUIDNAMED(KSNODE_BDA_8VSB_DEMODULATOR) - - - #define STATIC_KSNODE_BDA_OPENCABLE_POD \ - 0xd83ef8fc, 0xf3b8, 0x45ab, 0x8b, 0x71, 0xec, 0xf7, 0xc3, 0x39, 0xde, 0xb4 - DEFINE_GUIDSTRUCT("D83EF8FC-F3B8-45ab-8B71-ECF7C339DEB4", KSNODE_BDA_OPENCABLE_POD); - #define KSNODE_BDA_OPENCABLE_POD DEFINE_GUIDNAMED(KSNODE_BDA_OPENCABLE_POD) - - - #define STATIC_KSNODE_BDA_PID_FILTER \ - 0xf5412789, 0xb0a0, 0x44e1, 0xae, 0x4f, 0xee, 0x99, 0x9b, 0x1b, 0x7f, 0xbe - DEFINE_GUIDSTRUCT("F5412789-B0A0-44e1-AE4F-EE999B1B7FBE", KSNODE_BDA_PID_FILTER); - #define KSNODE_BDA_PID_FILTER DEFINE_GUIDNAMED(KSNODE_BDA_PID_FILTER) - - - #define STATIC_KSNODE_BDA_IP_SINK \ - 0x71985f4e, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 - DEFINE_GUIDSTRUCT("71985F4E-1CA1-11d3-9CC8-00C04F7971E0", KSNODE_BDA_IP_SINK); - #define KSNODE_IP_SINK DEFINE_GUIDNAMED(KSNODE_BDA_IP_SINK) - - - //=========================================================================== - // - // IPSink PINNAME GUID - // - //=========================================================================== - - #define STATIC_PINNAME_IPSINK_INPUT \ - 0x3fdffa70L, 0xac9a, 0x11d2, 0x8f, 0x17, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe2 - DEFINE_GUIDSTRUCT("3fdffa70-ac9a-11d2-8f17-00c04f7971e2", PINNAME_IPSINK_INPUT); - #define PINNAME_IPSINK_INPUT DEFINE_GUIDNAMED(PINNAME_IPSINK_INPUT) - - - //=========================================================================== - // - // BDA IPSink Categories/Types - // - //=========================================================================== - - - #define STATIC_KSDATAFORMAT_TYPE_BDA_IP\ - 0xe25f7b8e, 0xcccc, 0x11d2, 0x8f, 0x25, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 - DEFINE_GUIDSTRUCT("e25f7b8e-cccc-11d2-8f25-00c04f7971e2", KSDATAFORMAT_TYPE_BDA_IP); - #define KSDATAFORMAT_TYPE_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IP) - - #define STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP\ - 0x5a9a213c, 0xdb08, 0x11d2, 0x8f, 0x32, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 - DEFINE_GUIDSTRUCT("5a9a213c-db08-11d2-8f32-00c04f7971e2", KSDATAFORMAT_SUBTYPE_BDA_IP); - #define KSDATAFORMAT_SUBTYPE_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_IP) - - #define STATIC_KSDATAFORMAT_SPECIFIER_BDA_IP\ - 0x6b891420, 0xdb09, 0x11d2, 0x8f, 0x32, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe2 - DEFINE_GUIDSTRUCT("6B891420-DB09-11d2-8F32-00C04F7971E2", KSDATAFORMAT_SPECIFIER_BDA_IP); - #define KSDATAFORMAT_SPECIFIER_BDA_IP DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_BDA_IP) - - - - #define STATIC_KSDATAFORMAT_TYPE_BDA_IP_CONTROL\ - 0xdadd5799, 0x7d5b, 0x4b63, 0x80, 0xfb, 0xd1, 0x44, 0x2f, 0x26, 0xb6, 0x21 - DEFINE_GUIDSTRUCT("DADD5799-7D5B-4b63-80FB-D1442F26B621", KSDATAFORMAT_TYPE_BDA_IP_CONTROL); - #define KSDATAFORMAT_TYPE_BDA_IP_CONTROL DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IP_CONTROL) - - #define STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL\ - 0x499856e8, 0xe85b, 0x48ed, 0x9b, 0xea, 0x41, 0xd, 0xd, 0xd4, 0xef, 0x81 - DEFINE_GUIDSTRUCT("499856E8-E85B-48ed-9BEA-410D0DD4EF81", KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL); - #define KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL) - - - //=========================================================================== - // - // MPE PINNAME GUID - // - //=========================================================================== - - #define STATIC_PINNAME_MPE \ - 0xc1b06d73L, 0x1dbb, 0x11d3, 0x8f, 0x46, 0x00, 0xC0, 0x4f, 0x79, 0x71, 0xE2 - DEFINE_GUIDSTRUCT("C1B06D73-1DBB-11d3-8F46-00C04F7971E2", PINNAME_MPE); - #define PINNAME_MPE DEFINE_GUIDNAMED(PINNAME_MPE) - - - ///////////////////////////////////////////////////////////// - // - // BDA MPE Categories/Types - // - #define STATIC_KSDATAFORMAT_TYPE_MPE \ - 0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5 - DEFINE_GUIDSTRUCT("455F176C-4B06-47ce-9AEF-8CAEF73DF7B5", KSDATAFORMAT_TYPE_MPE); - #define KSDATAFORMAT_TYPE_MPE DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPE) - - - #if defined(__cplusplus) - } - #endif // defined(__cplusplus) - - -#endif // DirectX 8.0 content - - -#endif // !defined(_BDAMEDIA_) diff --git a/import/DirectX8/include/bdatypes.h b/import/DirectX8/include/bdatypes.h deleted file mode 100644 index 122793d2f..000000000 --- a/import/DirectX8/include/bdatypes.h +++ /dev/null @@ -1,1176 +0,0 @@ -//------------------------------------------------------------------------------ -// File: BDATypes.h -// -// Desc: Typedefs and enums needed by both the WDM drivers and the user mode -// COM interfaces. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _BDATYPES_ - -#define _BDATYPES_ 1 - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - -/* Utility Macros */ - -#define MIN_DIMENSION 1 - - -#ifdef __midl -#define V1_ENUM [v1_enum] -#else -#define V1_ENUM -#endif - -//=========================================================================== -// -// BDA Topology Structures -// -//=========================================================================== - -typedef struct _BDA_TEMPLATE_CONNECTION -{ - ULONG FromNodeType; - ULONG FromNodePinType; - ULONG ToNodeType; - ULONG ToNodePinType; -}BDA_TEMPLATE_CONNECTION, *PBDA_TEMPLATE_CONNECTION; - - -typedef struct _BDA_TEMPLATE_PIN_JOINT -{ - ULONG uliTemplateConnection; - ULONG ulcInstancesMax; -}BDA_TEMPLATE_PIN_JOINT, *PBDA_TEMPLATE_PIN_JOINT; - - - -//=========================================================================== -// -// BDA Events -// -//=========================================================================== - -// In-band Event IDs -// -typedef enum { - BDA_EVENT_SIGNAL_LOSS = 0, - BDA_EVENT_SIGNAL_LOCK, - BDA_EVENT_DATA_START, - BDA_EVENT_DATA_STOP, - BDA_EVENT_CHANNEL_ACQUIRED, - BDA_EVENT_CHANNEL_LOST, - BDA_EVENT_CHANNEL_SOURCE_CHANGED, - BDA_EVENT_CHANNEL_ACTIVATED, - BDA_EVENT_CHANNEL_DEACTIVATED, - BDA_EVENT_SUBCHANNEL_ACQUIRED, - BDA_EVENT_SUBCHANNEL_LOST, - BDA_EVENT_SUBCHANNEL_SOURCE_CHANGED, - BDA_EVENT_SUBCHANNEL_ACTIVATED, - BDA_EVENT_SUBCHANNEL_DEACTIVATED, - BDA_EVENT_ACCESS_GRANTED, - BDA_EVENT_ACCESS_DENIED, - BDA_EVENT_OFFER_EXTENDED, - BDA_EVENT_PURCHASE_COMPLETED, - BDA_EVENT_SMART_CARD_INSERTED, - BDA_EVENT_SMART_CARD_REMOVED -} BDA_EVENT_ID, *PBDA_EVENT_ID; - - - -//=========================================================================== -// -// KSSTREAM_HEADER extensions for BDA -// -//=========================================================================== - -typedef struct tagKS_BDA_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // - ULONG ulEvent; // - ULONG ulChannelNumber; // - ULONG ulSubchannelNumber; // - ULONG ulReason; // -} KS_BDA_FRAME_INFO, *PKS_BDA_FRAME_INFO; - - -//------------------------------------------------------------ -// -// BDA Network Ethernet Filter Property Set -// -// {71985F43-1CA1-11d3-9CC8-00C04F7971E0} -// -typedef struct _BDA_ETHERNET_ADDRESS { - BYTE rgbAddress[6]; -} BDA_ETHERNET_ADDRESS, *PBDA_ETHERNET_ADDRESS; - -typedef struct _BDA_ETHERNET_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_ETHERNET_ADDRESS rgAddressl[MIN_DIMENSION]; -} BDA_ETHERNET_ADDRESS_LIST, * PBDA_ETHERNET_ADDRESS_LIST; - -typedef enum { - BDA_PROMISCUOUS_MULTICAST = 0, - BDA_FILTERED_MULTICAST, - BDA_NO_MULTICAST -} BDA_MULTICAST_MODE, *PBDA_MULTICAST_MODE; - - -//------------------------------------------------------------ -// -// BDA Network IPv4 Filter Property Set -// -// {71985F44-1CA1-11d3-9CC8-00C04F7971E0} -// -typedef struct _BDA_IPv4_ADDRESS { - BYTE rgbAddress[4]; -} BDA_IPv4_ADDRESS, *PBDA_IPv4_ADDRESS; - -typedef struct _BDA_IPv4_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_IPv4_ADDRESS rgAddressl[MIN_DIMENSION]; -} BDA_IPv4_ADDRESS_LIST, * PBDA_IPv4_ADDRESS_LIST; - - -//------------------------------------------------------------ -// -// BDA Network IPv4 Filter Property Set -// -// {E1785A74-2A23-4fb3-9245-A8F88017EF33} -// -typedef struct _BDA_IPv6_ADDRESS { - BYTE rgbAddress[6]; -} BDA_IPv6_ADDRESS, *PBDA_IPv6_ADDRESS; - -typedef struct _BDA_IPv6_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_IPv6_ADDRESS rgAddressl[MIN_DIMENSION]; -} BDA_IPv6_ADDRESS_LIST, * PBDA_IPv6_ADDRESS_LIST; - - -//------------------------------------------------------------ -// -// -// BDA Signal Property Set -// -// {D2F1644B-B409-11d2-BC69-00A0C9EE9E16} -// -typedef enum { - BDA_SIGNAL_UNAVAILABLE = 0, - BDA_SIGNAL_INACTIVE, - BDA_SIGNAL_ACTIVE -} BDA_SIGNAL_STATE, * PBDA_SIGNAL_STATE; - - -//------------------------------------------------------------ -// -// -// BDA Change Sync Method Set -// -// {FD0A5AF3-B41D-11d2-9C95-00C04F7971E0} -// -typedef enum -{ - BDA_CHANGES_COMPLETE = 0, - BDA_CHANGES_PENDING - -} BDA_CHANGE_STATE, * PBDA_CHANGE_STATE; - - -//------------------------------------------------------------ -// -// -// BDA Device Configuration Method Set -// -// {71985F45-1CA1-11d3-9CC8-00C04F7971E0} -// - - -//------------------------------------------------------------ -// -// -// BDA Topology Property Set -// -// {A14EE835-0A23-11d3-9CC7-00C04F7971E0} -// - -typedef struct _BDANODE_DESCRIPTOR -{ - ULONG ulBdaNodeType; // The node type as it is used - // in the BDA template topology - - GUID guidFunction; // GUID from BdaMedia.h describing - // the node's function (e.g. - // KSNODE_BDA_RF_TUNER) - - GUID guidName; // GUID that can be use to look up - // a displayable name for the node. -} BDANODE_DESCRIPTOR, *PBDANODE_DESCRIPTOR; - - -//------------------------------------------------------------ -// -// -// BDA Void Transform Property Set -// -// {71985F46-1CA1-11d3-9CC8-00C04F7971E0} -// - - -//------------------------------------------------------------ -// -// -// BDA Null Transform Property Set -// -// {DDF15B0D-BD25-11d2-9CA0-00C04F7971E0} -// - - -//------------------------------------------------------------ -// -// -// BDA Frequency Filter Property Set -// -// {71985F47-1CA1-11d3-9CC8-00C04F7971E0} -// - - -//------------------------------------------------------------ -// -// -// BDA Autodemodulate Property Set -// -// {DDF15B12-BD25-11d2-9CA0-00C04F7971E0} -// - - -//------------------------------------------------------------ -// -// -// BDA Table Section Property Set -// -// {516B99C5-971C-4aaf-B3F3-D9FDA8A15E16} -// - -typedef struct _BDA_TABLE_SECTION -{ - ULONG ulPrimarySectionId; - ULONG ulSecondarySectionId; - ULONG ulcbSectionLength; - ULONG argbSectionData[MIN_DIMENSION]; -} BDA_TABLE_SECTION, *PBDA_TABLE_SECTION; - - -//------------------------------------------------------------ -// -// -// BDA PID Filter Property Set -// -// {D0A67D65-08DF-4fec-8533-E5B550410B85} -// - -//--------------------------------------------------------------------- -// From IEnumPIDMap interface -//--------------------------------------------------------------------- - -typedef enum { - MEDIA_TRANSPORT_PACKET, // complete TS packet e.g. pass-through mode - MEDIA_ELEMENTARY_STREAM, // PES payloads; audio/video only - MEDIA_MPEG2_PSI, // PAT, PMT, CAT, Private - MEDIA_TRANSPORT_PAYLOAD // gathered TS packet payloads (PES packets, etc...) -} MEDIA_SAMPLE_CONTENT ; - -typedef struct { - ULONG ulPID ; - MEDIA_SAMPLE_CONTENT MediaSampleContent ; -} PID_MAP ; - -typedef struct _BDA_PID_MAP -{ - MEDIA_SAMPLE_CONTENT MediaSampleContent; - ULONG ulcPIDs; - ULONG aulPIDs[MIN_DIMENSION]; -} BDA_PID_MAP, *PBDA_PID_MAP; - -typedef struct _BDA_PID_UNMAP -{ - ULONG ulcPIDs; - ULONG aulPIDs[MIN_DIMENSION]; -} BDA_PID_UNMAP, *PBDA_PID_UNMAP; - - -//------------------------------------------------------------ -// -// -// BDA CA Property Set -// -// {B0693766-5278-4ec6-B9E1-3CE40560EF5A} -// -typedef struct _BDA_CA_MODULE_UI -{ - ULONG ulFormat; - ULONG ulbcDesc; - ULONG ulDesc[MIN_DIMENSION]; -} BDA_CA_MODULE_UI, *PBDA_CA_MODULE_UI; - -typedef struct _BDA_PROGRAM_PID_LIST -{ - ULONG ulProgramNumber; - ULONG ulcPIDs; - ULONG ulPID[MIN_DIMENSION]; -} BDA_PROGRAM_PID_LIST, *PBDA_PROGRAM_PID_LIST; - - -//------------------------------------------------------------ -// -// -// BDA CA Event Set -// -// {488C4CCC-B768-4129-8EB1-B00A071F9068} -// - - - -//============================================================= -// -// -// BDA Tuning Model enumerations -// -// -//============================================================= - -// system type for particular DVB Tuning Space instance -typedef enum DVBSystemType { - DVB_Cable, - DVB_Terrestrial, - DVB_Satellite, -} DVBSystemType; - -//------------------------------------------------------------ -// -// BDA Channel Tune Request - -V1_ENUM enum { - BDA_UNDEFINED_CHANNEL = -1, -}; - - -//------------------------------------------------------------ -// -// BDA Component(substream) -// - -typedef V1_ENUM enum ComponentCategory -{ - CategoryNotSet = -1, - CategoryOther = 0, - CategoryVideo, - CategoryAudio, - CategoryText, - CategoryData, -} ComponentCategory; - -// Component Status -typedef enum ComponentStatus -{ - StatusActive, - StatusInactive, - StatusUnavailable, -} ComponentStatus; - - -//------------------------------------------------------------ -// -// BDA MPEG2 Component Type -// -// from the MPEG2 specification -typedef V1_ENUM enum MPEG2StreamType { - BDA_UNITIALIZED_MPEG2STREAMTYPE = -1, - Reserved1 = 0x0, - ISO_IEC_11172_2_VIDEO = Reserved1 + 1, - ISO_IEC_13818_2_VIDEO = ISO_IEC_11172_2_VIDEO + 1, - ISO_IEC_11172_3_AUDIO = ISO_IEC_13818_2_VIDEO + 1, - ISO_IEC_13818_3_AUDIO = ISO_IEC_11172_3_AUDIO + 1, - ISO_IEC_13818_1_PRIVATE_SECTION = ISO_IEC_13818_3_AUDIO + 1, - ISO_IEC_13818_1_PES = ISO_IEC_13818_1_PRIVATE_SECTION + 1, - ISO_IEC_13522_MHEG = ISO_IEC_13818_1_PES + 1, - ANNEX_A_DSM_CC = ISO_IEC_13522_MHEG + 1, - ITU_T_REC_H_222_1 = ANNEX_A_DSM_CC + 1, - ISO_IEC_13818_6_TYPE_A = ITU_T_REC_H_222_1 + 1, - ISO_IEC_13818_6_TYPE_B = ISO_IEC_13818_6_TYPE_A + 1, - ISO_IEC_13818_6_TYPE_C = ISO_IEC_13818_6_TYPE_B + 1, - ISO_IEC_13818_6_TYPE_D = ISO_IEC_13818_6_TYPE_C + 1, - ISO_IEC_13818_1_AUXILIARY = ISO_IEC_13818_6_TYPE_D + 1, - ISO_IEC_13818_1_RESERVED = ISO_IEC_13818_1_AUXILIARY + 1, - USER_PRIVATE = ISO_IEC_13818_1_RESERVED + 1 -} MPEG2StreamType; - -//------------------------------------------------------------ -// -// mpeg-2 transport stride format block; associated with media -// types MEDIATYPE_Stream/MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE; -// *all* format blocks associated with above media type *must* -// start with the MPEG2_TRANSPORT_STRIDE structure -// - -typedef struct _MPEG2_TRANSPORT_STRIDE { - DWORD dwOffset ; - DWORD dwPacketLength ; - DWORD dwStride ; -} MPEG2_TRANSPORT_STRIDE, *PMPEG2_TRANSPORT_STRIDE ; - -//------------------------------------------------------------ -// -// BDA ATSC Component Type -// -// -// ATSC made AC3 Audio a descriptor instead of -// defining a user private stream type. -typedef enum ATSCComponentTypeFlags { - // bit flags for various component type properties - ATSCCT_AC3 = 0x00000001, -} ATSCComponentTypeFlags; - - -//------------------------------------------------------------ -// -// BDA Locators -// - - -typedef V1_ENUM enum BinaryConvolutionCodeRate { - BDA_BCC_RATE_NOT_SET = -1, - BDA_BCC_RATE_NOT_DEFINED = 0, - BDA_BCC_RATE_1_2 = 1, // 1/2 - BDA_BCC_RATE_2_3, // 2/3 - BDA_BCC_RATE_3_4, // 3/4 - BDA_BCC_RATE_3_5, - BDA_BCC_RATE_4_5, - BDA_BCC_RATE_5_6, // 5/6 - BDA_BCC_RATE_5_11, - BDA_BCC_RATE_7_8, // 7/8 - BDA_BCC_RATE_MAX, -} BinaryConvolutionCodeRate; - -typedef V1_ENUM enum FECMethod { - BDA_FEC_METHOD_NOT_SET = -1, - BDA_FEC_METHOD_NOT_DEFINED = 0, - BDA_FEC_VITERBI = 1, // FEC is a Viterbi Binary Convolution. - BDA_FEC_RS_204_188, // The FEC is Reed-Solomon 204/188 (outer FEC) - BDA_FEC_MAX, -} FECMethod; - -typedef V1_ENUM enum ModulationType { - BDA_MOD_NOT_SET = -1, - BDA_MOD_NOT_DEFINED = 0, - BDA_MOD_16QAM = 1, - BDA_MOD_32QAM, - BDA_MOD_64QAM, - BDA_MOD_80QAM, - BDA_MOD_96QAM, - BDA_MOD_112QAM, - BDA_MOD_128QAM, - BDA_MOD_160QAM, - BDA_MOD_192QAM, - BDA_MOD_224QAM, - BDA_MOD_256QAM, - BDA_MOD_320QAM, - BDA_MOD_384QAM, - BDA_MOD_448QAM, - BDA_MOD_512QAM, - BDA_MOD_640QAM, - BDA_MOD_768QAM, - BDA_MOD_896QAM, - BDA_MOD_1024QAM, - BDA_MOD_QPSK, - BDA_MOD_BPSK, - BDA_MOD_OQPSK, - BDA_MOD_8VSB, - BDA_MOD_16VSB, - BDA_MOD_ANALOG_AMPLITUDE, // std am - BDA_MOD_ANALOG_FREQUENCY, // std fm - BDA_MOD_MAX, -} ModulationType; - -typedef V1_ENUM enum SpectralInversion { - BDA_SPECTRAL_INVERSION_NOT_SET = -1, - BDA_SPECTRAL_INVERSION_NOT_DEFINED = 0, - BDA_SPECTRAL_INVERSION_AUTOMATIC = 1, - BDA_SPECTRAL_INVERSION_NORMAL, - BDA_SPECTRAL_INVERSION_INVERTED, - BDA_SPECTRAL_INVERSION_MAX -} SpectralInversion; - -typedef V1_ENUM enum Polarisation { - BDA_POLARISATION_NOT_SET = -1, - BDA_POLARISATION_NOT_DEFINED = 0, - BDA_POLARISATION_LINEAR_H = 1, // Linear horizontal polarisation - BDA_POLARISATION_LINEAR_V, // Linear vertical polarisation - BDA_POLARISATION_CIRCULAR_L, // Circular left polarisation - BDA_POLARISATION_CIRCULAR_R, // Circular right polarisation - BDA_POLARISATION_MAX, -} Polarisation; - -typedef V1_ENUM enum GuardInterval { - BDA_GUARD_NOT_SET = -1, - BDA_GUARD_NOT_DEFINED = 0, - BDA_GUARD_1_32 = 1, // Guard interval is 1/32 - BDA_GUARD_1_16, // Guard interval is 1/16 - BDA_GUARD_1_8, // Guard interval is 1/8 - BDA_GUARD_1_4, // Guard interval is 1/4 - BDA_GUARD_MAX, -} GuardInterval; - -typedef V1_ENUM enum HierarchyAlpha { - BDA_HALPHA_NOT_SET = -1, - BDA_HALPHA_NOT_DEFINED = 0, - BDA_HALPHA_1 = 1, // Hierarchy alpha is 1. - BDA_HALPHA_2, // Hierarchy alpha is 2. - BDA_HALPHA_4, // Hierarchy alpha is 4. - BDA_HALPHA_MAX, -} HierarchyAlpha; - -typedef V1_ENUM enum TransmissionMode { - BDA_XMIT_MODE_NOT_SET = -1, - BDA_XMIT_MODE_NOT_DEFINED = 0, - BDA_XMIT_MODE_2K = 1, // Transmission uses 1705 carriers (use a 2K FFT) - BDA_XMIT_MODE_8K, // Transmission uses 6817 carriers (use an 8K FFT) - BDA_XMIT_MODE_MAX, -} TransmissionMode; - -// Settings for Tuner Frequency -// -#define BDA_FREQUENCY_NOT_SET -1 -#define BDA_FREQUENCY_NOT_DEFINED 0 - -// Settings for Tuner Range -// -// Tuner range refers to the setting of LNB High/Low as well as the -// selection of a satellite on a multiple satellite switch. -// -#define BDA_RANGE_NOT_SET -1 -#define BDA_RANGE_NOT_DEFINED 0 - -// Settings for Tuner Channel Bandwidth -// -#define BDA_CHAN_BANDWITH_NOT_SET -1 -#define BDA_CHAN_BANDWITH_NOT_DEFINED 0 - -// Settings for Tuner Frequency Multiplier -// -#define BDA_FREQUENCY_MULTIPLIER_NOT_SET -1 -#define BDA_FREQUENCY_MULTIPLIER_NOT_DEFINED 0 - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - /* Utility Macros */ - - #define MIN_DIMENSION 1 - #define NATURAL 4 - #define CACHE_LINE 128 - #define PAGE 4096 - #define ALIGN( pointer, size) (((ULONG)(pointer) + (ULONG)(size) - 1) & ~((ULONG)(size) - 1)) - #define BDA_STRING_CONST(x) {sizeof(L##x)-2, sizeof(L##x), L##x} - - - #ifdef __midl - #define V1_ENUM [v1_enum] - #else - #define V1_ENUM - #endif - - //=========================================================================== - // - // BDA Topology Structures - // - //=========================================================================== - - typedef struct _BDA_TEMPLATE_CONNECTION - { - ULONG FromNodeType; - ULONG FromNodePinType; - ULONG ToNodeType; - ULONG ToNodePinType; - }BDA_TEMPLATE_CONNECTION, *PBDA_TEMPLATE_CONNECTION; - - - typedef struct _BDA_TEMPLATE_PIN_JOINT - { - ULONG uliTemplateConnection; - ULONG ulcInstancesMax; - }BDA_TEMPLATE_PIN_JOINT, *PBDA_TEMPLATE_PIN_JOINT; - - - - //=========================================================================== - // - // BDA Events - // - //=========================================================================== - - // In-band Event IDs - // - typedef enum { - BDA_EVENT_SIGNAL_LOSS = 0, - BDA_EVENT_SIGNAL_LOCK, - BDA_EVENT_DATA_START, - BDA_EVENT_DATA_STOP, - BDA_EVENT_CHANNEL_ACQUIRED, - BDA_EVENT_CHANNEL_LOST, - BDA_EVENT_CHANNEL_SOURCE_CHANGED, - BDA_EVENT_CHANNEL_ACTIVATED, - BDA_EVENT_CHANNEL_DEACTIVATED, - BDA_EVENT_SUBCHANNEL_ACQUIRED, - BDA_EVENT_SUBCHANNEL_LOST, - BDA_EVENT_SUBCHANNEL_SOURCE_CHANGED, - BDA_EVENT_SUBCHANNEL_ACTIVATED, - BDA_EVENT_SUBCHANNEL_DEACTIVATED, - BDA_EVENT_ACCESS_GRANTED, - BDA_EVENT_ACCESS_DENIED, - BDA_EVENT_OFFER_EXTENDED, - BDA_EVENT_PURCHASE_COMPLETED, - BDA_EVENT_SMART_CARD_INSERTED, - BDA_EVENT_SMART_CARD_REMOVED - } BDA_EVENT_ID, *PBDA_EVENT_ID; - - - - //=========================================================================== - // - // KSSTREAM_HEADER extensions for BDA - // - //=========================================================================== - - typedef struct tagKS_BDA_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // - ULONG ulEvent; // - ULONG ulChannelNumber; // - ULONG ulSubchannelNumber; // - ULONG ulReason; // - } KS_BDA_FRAME_INFO, *PKS_BDA_FRAME_INFO; - - - //------------------------------------------------------------ - // - // BDA Network Ethernet Filter Property Set - // - // {71985F43-1CA1-11d3-9CC8-00C04F7971E0} - // - typedef struct _BDA_ETHERNET_ADDRESS { - BYTE rgbAddress[6]; - } BDA_ETHERNET_ADDRESS, *PBDA_ETHERNET_ADDRESS; - - typedef struct _BDA_ETHERNET_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_ETHERNET_ADDRESS rgAddressl[MIN_DIMENSION]; - } BDA_ETHERNET_ADDRESS_LIST, * PBDA_ETHERNET_ADDRESS_LIST; - - typedef enum { - BDA_PROMISCUOUS_MULTICAST = 0, - BDA_FILTERED_MULTICAST, - BDA_NO_MULTICAST - } BDA_MULTICAST_MODE, *PBDA_MULTICAST_MODE; - - - //------------------------------------------------------------ - // - // BDA Network IPv4 Filter Property Set - // - // {71985F44-1CA1-11d3-9CC8-00C04F7971E0} - // - typedef struct _BDA_IPv4_ADDRESS { - BYTE rgbAddress[4]; - } BDA_IPv4_ADDRESS, *PBDA_IPv4_ADDRESS; - - typedef struct _BDA_IPv4_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_IPv4_ADDRESS rgAddressl[MIN_DIMENSION]; - } BDA_IPv4_ADDRESS_LIST, * PBDA_IPv4_ADDRESS_LIST; - - - //------------------------------------------------------------ - // - // BDA Network IPv4 Filter Property Set - // - // {E1785A74-2A23-4fb3-9245-A8F88017EF33} - // - typedef struct _BDA_IPv6_ADDRESS { - BYTE rgbAddress[6]; - } BDA_IPv6_ADDRESS, *PBDA_IPv6_ADDRESS; - - typedef struct _BDA_IPv6_ADDRESS_LIST { - ULONG ulcAddresses; - BDA_IPv6_ADDRESS rgAddressl[MIN_DIMENSION]; - } BDA_IPv6_ADDRESS_LIST, * PBDA_IPv6_ADDRESS_LIST; - - - //------------------------------------------------------------ - // - // - // BDA Signal Property Set - // - // {D2F1644B-B409-11d2-BC69-00A0C9EE9E16} - // - typedef enum { - BDA_SIGNAL_UNAVAILABLE = 0, - BDA_SIGNAL_INACTIVE, - BDA_SIGNAL_ACTIVE - } BDA_SIGNAL_STATE, * PBDA_SIGNAL_STATE; - - - //------------------------------------------------------------ - // - // - // BDA Change Sync Method Set - // - // {FD0A5AF3-B41D-11d2-9C95-00C04F7971E0} - // - typedef enum - { - BDA_CHANGES_COMPLETE = 0, - BDA_CHANGES_PENDING - - } BDA_CHANGE_STATE, * PBDA_CHANGE_STATE; - - - //------------------------------------------------------------ - // - // - // BDA Device Configuration Method Set - // - // {71985F45-1CA1-11d3-9CC8-00C04F7971E0} - // - - - //------------------------------------------------------------ - // - // - // BDA Topology Property Set - // - // {A14EE835-0A23-11d3-9CC7-00C04F7971E0} - // - - typedef struct _BDANODE_DESCRIPTOR - { - ULONG ulBdaNodeType; // The node type as it is used - // in the BDA template topology - - GUID guidFunction; // GUID from BdaMedia.h describing - // the node's function (e.g. - // KSNODE_BDA_RF_TUNER) - - GUID guidName; // GUID that can be use to look up - // a displayable name for the node. - } BDANODE_DESCRIPTOR, *PBDANODE_DESCRIPTOR; - - - //------------------------------------------------------------ - // - // - // BDA Void Transform Property Set - // - // {71985F46-1CA1-11d3-9CC8-00C04F7971E0} - // - - - //------------------------------------------------------------ - // - // - // BDA Null Transform Property Set - // - // {DDF15B0D-BD25-11d2-9CA0-00C04F7971E0} - // - - - //------------------------------------------------------------ - // - // - // BDA Frequency Filter Property Set - // - // {71985F47-1CA1-11d3-9CC8-00C04F7971E0} - // - - - //------------------------------------------------------------ - // - // - // BDA Autodemodulate Property Set - // - // {DDF15B12-BD25-11d2-9CA0-00C04F7971E0} - // - - - //------------------------------------------------------------ - // - // - // BDA PmtProcessor Property Set - // - // {516B99C5-971C-4aaf-B3F3-D9FDA8A15E16} - // - - typedef struct _BDA_PMT - { - ULONG ulTableID; - ULONG ulcbSectionLength; - ULONG argbSectionData[MIN_DIMENSION]; - } BDA_PMT, *PBDA_PMT; - - //------------------------------------------------------------ - // - // - // BDA Descriptor Property Set - // - // {DE6A1C9E-87DF-48aa-95AA-289B7AA4F49F} - // - - typedef struct _BDA_CAT_DESCRIPTOR - { - ULONG ulTag; - ULONG ulcbLength; - ULONG argbData[MIN_DIMENSION]; - } BDA_CAT_DESCRIPTOR, *PBDA_CAT_DESCRIPTOR; - - typedef struct _BDA_ES_DESCRIPTOR - { - ULONG ulProgramNum; - ULONG ulContentPID; - ULONG ulTag; - ULONG ulcbLength; - ULONG argbData[MIN_DIMENSION]; - } BDA_ES_DESCRIPTOR, *PBDA_ES_DESCRIPTOR; - - typedef struct _BDA_PROGRAM_DESCRIPTOR - { - ULONG ulProgramNum; - ULONG ulTag; - ULONG ulcbLength; - ULONG argbData[MIN_DIMENSION]; - } BDA_PROGRAM_DESCRIPTOR, *PBDA_PROGRAM_DESCRIPTOR; - - - //------------------------------------------------------------ - // - // - // BDA EsMap Property Set - // - // {FA14A8B3-6068-48ef-96DD-53010B985A7D} - // - - typedef enum - { - ES_MAP_STATE_GOOD_FLOW = 0, - ES_MAP_STATE_NO_CONTENT, - ES_MAP_STATE_NO_ECM, - ES_MAP_STATE_BAD_MAP - } BDA_ES_MAP_STATE, *PBDA_ES_MAP_STATE; - - typedef struct _BDA_ES_MAP - { - ULONG ulContentPID; - ULONG ulProgramNum; - ULONG ulStreamType; - BDA_ES_MAP_STATE mapState; - } BDA_ES_MAP, *PBDA_ES_MAP; - - - //------------------------------------------------------------ - // - // - // BDA PID Filter Property Set - // - // {D0A67D65-08DF-4fec-8533-E5B550410B85} - // - - //--------------------------------------------------------------------- - // From IEnumPIDMap interface - //--------------------------------------------------------------------- - - typedef enum { - MEDIA_TRANSPORT_PACKET, // complete TS packet e.g. pass-through mode - MEDIA_ELEMENTARY_STREAM, // PES payloads; audio/video only - MEDIA_MPEG2_PSI, // PAT, PMT, CAT, Private - MEDIA_TRANSPORT_PAYLOAD // gathered TS packet payloads (PES packets, etc...) - } MEDIA_SAMPLE_CONTENT ; - - typedef struct { - ULONG ulPID ; - MEDIA_SAMPLE_CONTENT MediaSampleContent ; - } PID_MAP ; - - typedef struct _BDA_PID_MAP - { - MEDIA_SAMPLE_CONTENT MediaSampleContent; - ULONG ulcPIDs; - ULONG aulPIDs[MIN_DIMENSION]; - } BDA_PID_MAP, *PBDA_PID_MAP; - - typedef struct _BDA_PID_UNMAP - { - ULONG ulcPIDs; - ULONG aulPIDs[MIN_DIMENSION]; - } BDA_PID_UNMAP, *PBDA_PID_UNMAP; - - - //------------------------------------------------------------ - // - // - // BDA CA Property Set - // - // {B0693766-5278-4ec6-B9E1-3CE40560EF5A} - // - typedef struct _BDA_CA_MODULE_UI - { - ULONG ulFormat; - ULONG ulbcDesc; - ULONG ulDesc[MIN_DIMENSION]; - } BDA_CA_MODULE_UI, *PBDA_CA_MODULE_UI; - - - //------------------------------------------------------------ - // - // - // BDA CA Event Set - // - // {488C4CCC-B768-4129-8EB1-B00A071F9068} - // - - - - //============================================================= - // - // - // BDA Tuning Model enumerations - // - // - //============================================================= - - // system type for particular DVB Tuning Space instance - typedef enum DVBSystemType { - DVB_Cable, - DVB_Terrestrial, - DVB_Satellite, - } DVBSystemType; - - //------------------------------------------------------------ - // - // BDA Channel Tune Request - - V1_ENUM enum { - BDA_UNDEFINED_CHANNEL = -1, - }; - - - //------------------------------------------------------------ - // - // BDA Component(substream) - // - - typedef V1_ENUM enum ComponentCategory - { - CategoryNotSet = -1, - CategoryOther = 0, - CategoryVideo, - CategoryAudio, - CategoryText, - CategoryData, - } ComponentCategory; - - // Component Status - typedef enum ComponentStatus - { - StatusActive, - StatusInactive, - StatusUnavailable, - } ComponentStatus; - - - //------------------------------------------------------------ - // - // BDA MPEG2 Component Type - // - // from the MPEG2 specification - typedef V1_ENUM enum MPEG2StreamType { - BDA_UNITIALIZED_MPEG2STREAMTYPE = -1, - Reserved1 = 0x0, - ISO_IEC_11172_2_VIDEO = Reserved1 + 1, - ISO_IEC_13818_2_VIDEO = ISO_IEC_11172_2_VIDEO + 1, - ISO_IEC_11172_3_AUDIO = ISO_IEC_13818_2_VIDEO + 1, - ISO_IEC_13818_3_AUDIO = ISO_IEC_11172_3_AUDIO + 1, - ISO_IEC_13818_1_PRIVATE_SECTION = ISO_IEC_13818_3_AUDIO + 1, - ISO_IEC_13818_1_PES = ISO_IEC_13818_1_PRIVATE_SECTION + 1, - ISO_IEC_13522_MHEG = ISO_IEC_13818_1_PES + 1, - ANNEX_A_DSM_CC = ISO_IEC_13522_MHEG + 1, - ITU_T_REC_H_222_1 = ANNEX_A_DSM_CC + 1, - ISO_IEC_13818_6_TYPE_A = ITU_T_REC_H_222_1 + 1, - ISO_IEC_13818_6_TYPE_B = ISO_IEC_13818_6_TYPE_A + 1, - ISO_IEC_13818_6_TYPE_C = ISO_IEC_13818_6_TYPE_B + 1, - ISO_IEC_13818_6_TYPE_D = ISO_IEC_13818_6_TYPE_C + 1, - ISO_IEC_13818_1_AUXILIARY = ISO_IEC_13818_6_TYPE_D + 1, - ISO_IEC_13818_1_RESERVED = ISO_IEC_13818_1_AUXILIARY + 1, - USER_PRIVATE = ISO_IEC_13818_1_RESERVED + 1 - } MPEG2StreamType; - - - //------------------------------------------------------------ - // - // BDA ATSC Component Type - // - // - // ATSC made AC3 Audio a descriptor instead of - // defining a user private stream type. - typedef enum ATSCComponentTypeFlags { - // bit flags for various component type properties - ATSCCT_AC3 = 0x00000001, - } ATSCComponentTypeFlags; - - - //------------------------------------------------------------ - // - // BDA Locators - // - - - typedef V1_ENUM enum BinaryConvolutionCodeRate { - BDA_BCC_RATE_NOT_SET = -1, - BDA_BCC_RATE_NOT_DEFINED = 0, - BDA_BCC_RATE_1_2 = 1, // 1/2 - BDA_BCC_RATE_2_3, // 2/3 - BDA_BCC_RATE_3_4, // 3/4 - BDA_BCC_RATE_3_5, - BDA_BCC_RATE_4_5, - BDA_BCC_RATE_5_6, // 5/6 - BDA_BCC_RATE_5_11, - BDA_BCC_RATE_7_8, // 7/8 - BDA_BCC_RATE_MAX, - } BinaryConvolutionCodeRate; - - typedef V1_ENUM enum FECMethod { - BDA_FEC_METHOD_NOT_SET = -1, - BDA_FEC_METHOD_NOT_DEFINED = 0, - BDA_FEC_VITERBI = 1, // FEC is a Viterbi Binary Convolution. - BDA_FEC_RS_204_188, // The FEC is Reed-Solomon 204/188 (outer FEC) - BDA_FEC_MAX, - } FECMethod; - - typedef V1_ENUM enum ModulationType { - BDA_MOD_NOT_SET = -1, - BDA_MOD_NOT_DEFINED = 0, - BDA_MOD_16QAM = 1, - BDA_MOD_32QAM, - BDA_MOD_64QAM, - BDA_MOD_80QAM, - BDA_MOD_96QAM, - BDA_MOD_112QAM, - BDA_MOD_128QAM, - BDA_MOD_160QAM, - BDA_MOD_192QAM, - BDA_MOD_224QAM, - BDA_MOD_256QAM, - BDA_MOD_320QAM, - BDA_MOD_384QAM, - BDA_MOD_448QAM, - BDA_MOD_512QAM, - BDA_MOD_640QAM, - BDA_MOD_768QAM, - BDA_MOD_896QAM, - BDA_MOD_1024QAM, - BDA_MOD_QPSK, - BDA_MOD_BPSK, - BDA_MOD_OQPSK, - BDA_MOD_8VSB, - BDA_MOD_16VSB, - BDA_MOD_ANALOG_AMPLITUDE, // std am - BDA_MOD_ANALOG_FREQUENCY, // std fm - BDA_MOD_MAX, - } ModulationType; - - typedef V1_ENUM enum SpectralInversion { - BDA_SPECTRAL_INVERSION_NOT_SET = -1, - BDA_SPECTRAL_INVERSION_NOT_DEFINED = 0, - BDA_SPECTRAL_INVERSION_AUTOMATIC = 1, - BDA_SPECTRAL_INVERSION_NORMAL, - BDA_SPECTRAL_INVERSION_INVERTED, - BDA_SPECTRAL_INVERSION_MAX - } SpectralInversion; - - typedef V1_ENUM enum Polarisation { - BDA_POLARISATION_NOT_SET = -1, - BDA_POLARISATION_NOT_DEFINED = 0, - BDA_POLARISATION_LINEAR_H = 1, // Linear horizontal polarisation - BDA_POLARISATION_LINEAR_V, // Linear vertical polarisation - BDA_POLARISATION_CIRCULAR_L, // Circular left polarisation - BDA_POLARISATION_CIRCULAR_R, // Circular right polarisation - BDA_POLARISATION_MAX, - } Polarisation; - - typedef V1_ENUM enum GuardInterval { - BDA_GUARD_NOT_SET = -1, - BDA_GUARD_NOT_DEFINED = 0, - BDA_GUARD_1_32 = 1, // Guard interval is 1/32 - BDA_GUARD_1_16, // Guard interval is 1/16 - BDA_GUARD_1_8, // Guard interval is 1/8 - BDA_GUARD_1_4, // Guard interval is 1/4 - BDA_GUARD_MAX, - } GuardInterval; - - typedef V1_ENUM enum HierarchyAlpha { - BDA_HALPHA_NOT_SET = -1, - BDA_HALPHA_NOT_DEFINED = 0, - BDA_HALPHA_1 = 1, // Hierarchy alpha is 1. - BDA_HALPHA_2, // Hierarchy alpha is 2. - BDA_HALPHA_4, // Hierarchy alpha is 4. - BDA_HALPHA_MAX, - } HierarchyAlpha; - - typedef V1_ENUM enum TransmissionMode { - BDA_XMIT_MODE_NOT_SET = -1, - BDA_XMIT_MODE_NOT_DEFINED = 0, - BDA_XMIT_MODE_2K = 1, // Transmission uses 1705 carriers (use a 2K FFT) - BDA_XMIT_MODE_8K, // Transmission uses 6817 carriers (use an 8K FFT) - BDA_XMIT_MODE_MAX, - } TransmissionMode; - - - -#endif // DirectX 8.0 content - - -#endif // not defined _BDATYPES_ - -// end of file -- bdatypes.h diff --git a/import/DirectX8/include/comlite.h b/import/DirectX8/include/comlite.h deleted file mode 100644 index 5fc919323..000000000 --- a/import/DirectX8/include/comlite.h +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// File: COMLite.h -// -// Desc: This header file is to provide a migration path for users of -// ActiveMovie betas 1 and 2. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _INC_COMLITE_ -#define _INC_COMLITE_ - -#define QzInitialize CoInitialize -#define QzUninitialize CoUninitialize -#define QzFreeUnusedLibraries CoFreeUnusedLibraries - -#define QzGetMalloc CoGetMalloc -#define QzTaskMemAlloc CoTaskMemAlloc -#define QzTaskMemRealloc CoTaskMemRealloc -#define QzTaskMemFree CoTaskMemFree -#define QzCreateFilterObject CoCreateInstance -#define QzCLSIDFromString CLSIDFromString -#define QzStringFromGUID2 StringFromGUID2 - -#endif // _INC_COMLITE_ diff --git a/import/DirectX8/include/control.h b/import/DirectX8/include/control.h deleted file mode 100644 index 6149244df..000000000 --- a/import/DirectX8/include/control.h +++ /dev/null @@ -1,5544 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for control.odl: - Oicf, W0, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __control_h__ -#define __control_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IAMCollection_FWD_DEFINED__ -#define __IAMCollection_FWD_DEFINED__ -typedef interface IAMCollection IAMCollection; -#endif /* __IAMCollection_FWD_DEFINED__ */ - - -#ifndef __IMediaControl_FWD_DEFINED__ -#define __IMediaControl_FWD_DEFINED__ -typedef interface IMediaControl IMediaControl; -#endif /* __IMediaControl_FWD_DEFINED__ */ - - -#ifndef __IMediaEvent_FWD_DEFINED__ -#define __IMediaEvent_FWD_DEFINED__ -typedef interface IMediaEvent IMediaEvent; -#endif /* __IMediaEvent_FWD_DEFINED__ */ - - -#ifndef __IMediaEventEx_FWD_DEFINED__ -#define __IMediaEventEx_FWD_DEFINED__ -typedef interface IMediaEventEx IMediaEventEx; -#endif /* __IMediaEventEx_FWD_DEFINED__ */ - - -#ifndef __IMediaPosition_FWD_DEFINED__ -#define __IMediaPosition_FWD_DEFINED__ -typedef interface IMediaPosition IMediaPosition; -#endif /* __IMediaPosition_FWD_DEFINED__ */ - - -#ifndef __IBasicAudio_FWD_DEFINED__ -#define __IBasicAudio_FWD_DEFINED__ -typedef interface IBasicAudio IBasicAudio; -#endif /* __IBasicAudio_FWD_DEFINED__ */ - - -#ifndef __IVideoWindow_FWD_DEFINED__ -#define __IVideoWindow_FWD_DEFINED__ -typedef interface IVideoWindow IVideoWindow; -#endif /* __IVideoWindow_FWD_DEFINED__ */ - - -#ifndef __IBasicVideo_FWD_DEFINED__ -#define __IBasicVideo_FWD_DEFINED__ -typedef interface IBasicVideo IBasicVideo; -#endif /* __IBasicVideo_FWD_DEFINED__ */ - - -#ifndef __IBasicVideo2_FWD_DEFINED__ -#define __IBasicVideo2_FWD_DEFINED__ -typedef interface IBasicVideo2 IBasicVideo2; -#endif /* __IBasicVideo2_FWD_DEFINED__ */ - - -#ifndef __IDeferredCommand_FWD_DEFINED__ -#define __IDeferredCommand_FWD_DEFINED__ -typedef interface IDeferredCommand IDeferredCommand; -#endif /* __IDeferredCommand_FWD_DEFINED__ */ - - -#ifndef __IQueueCommand_FWD_DEFINED__ -#define __IQueueCommand_FWD_DEFINED__ -typedef interface IQueueCommand IQueueCommand; -#endif /* __IQueueCommand_FWD_DEFINED__ */ - - -#ifndef __FilgraphManager_FWD_DEFINED__ -#define __FilgraphManager_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FilgraphManager FilgraphManager; -#else -typedef struct FilgraphManager FilgraphManager; -#endif /* __cplusplus */ - -#endif /* __FilgraphManager_FWD_DEFINED__ */ - - -#ifndef __IFilterInfo_FWD_DEFINED__ -#define __IFilterInfo_FWD_DEFINED__ -typedef interface IFilterInfo IFilterInfo; -#endif /* __IFilterInfo_FWD_DEFINED__ */ - - -#ifndef __IRegFilterInfo_FWD_DEFINED__ -#define __IRegFilterInfo_FWD_DEFINED__ -typedef interface IRegFilterInfo IRegFilterInfo; -#endif /* __IRegFilterInfo_FWD_DEFINED__ */ - - -#ifndef __IMediaTypeInfo_FWD_DEFINED__ -#define __IMediaTypeInfo_FWD_DEFINED__ -typedef interface IMediaTypeInfo IMediaTypeInfo; -#endif /* __IMediaTypeInfo_FWD_DEFINED__ */ - - -#ifndef __IPinInfo_FWD_DEFINED__ -#define __IPinInfo_FWD_DEFINED__ -typedef interface IPinInfo IPinInfo; -#endif /* __IPinInfo_FWD_DEFINED__ */ - - -#ifndef __IAMStats_FWD_DEFINED__ -#define __IAMStats_FWD_DEFINED__ -typedef interface IAMStats IAMStats; -#endif /* __IAMStats_FWD_DEFINED__ */ - - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - - -#ifndef __QuartzTypeLib_LIBRARY_DEFINED__ -#define __QuartzTypeLib_LIBRARY_DEFINED__ - -/* library QuartzTypeLib */ -/* [version][lcid][helpstring][uuid] */ - -typedef double REFTIME; - -typedef LONG_PTR OAEVENT; - -typedef LONG_PTR OAHWND; - -typedef long OAFilterState; - - -DEFINE_GUID(LIBID_QuartzTypeLib,0x56a868b0,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#ifndef __IAMCollection_INTERFACE_DEFINED__ -#define __IAMCollection_INTERFACE_DEFINED__ - -/* interface IAMCollection */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IAMCollection,0x56a868b9,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b9-0ad4-11ce-b03a-0020af0ba770") - IAMCollection : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ LONG *plCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE Item( - /* [in] */ long lItem, - /* [out] */ IUnknown **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IUnknown **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMCollection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAMCollection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAMCollection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAMCollection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAMCollection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IAMCollection * This, - /* [retval][out] */ LONG *plCount); - - HRESULT ( STDMETHODCALLTYPE *Item )( - IAMCollection * This, - /* [in] */ long lItem, - /* [out] */ IUnknown **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - IAMCollection * This, - /* [retval][out] */ IUnknown **ppUnk); - - END_INTERFACE - } IAMCollectionVtbl; - - interface IAMCollection - { - CONST_VTBL struct IAMCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMCollection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMCollection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMCollection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMCollection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IAMCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IAMCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IAMCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IAMCollection_get_Count(This,plCount) \ - (This)->lpVtbl -> get_Count(This,plCount) - -#define IAMCollection_Item(This,lItem,ppUnk) \ - (This)->lpVtbl -> Item(This,lItem,ppUnk) - -#define IAMCollection_get__NewEnum(This,ppUnk) \ - (This)->lpVtbl -> get__NewEnum(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IAMCollection_get_Count_Proxy( - IAMCollection * This, - /* [retval][out] */ LONG *plCount); - - -void __RPC_STUB IAMCollection_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCollection_Item_Proxy( - IAMCollection * This, - /* [in] */ long lItem, - /* [out] */ IUnknown **ppUnk); - - -void __RPC_STUB IAMCollection_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IAMCollection_get__NewEnum_Proxy( - IAMCollection * This, - /* [retval][out] */ IUnknown **ppUnk); - - -void __RPC_STUB IAMCollection_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMCollection_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaControl_INTERFACE_DEFINED__ -#define __IMediaControl_INTERFACE_DEFINED__ - -/* interface IMediaControl */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IMediaControl,0x56a868b1,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b1-0ad4-11ce-b03a-0020af0ba770") - IMediaControl : public IDispatch - { - public: - virtual HRESULT STDMETHODCALLTYPE Run( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Pause( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetState( - /* [in] */ LONG msTimeout, - /* [out] */ OAFilterState *pfs) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderFile( - /* [in] */ BSTR strFilename) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddSourceFilter( - /* [in] */ BSTR strFilename, - /* [out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_FilterCollection( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RegFilterCollection( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual HRESULT STDMETHODCALLTYPE StopWhenReady( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMediaControl * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMediaControl * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMediaControl * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMediaControl * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *Run )( - IMediaControl * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IMediaControl * This); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IMediaControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IMediaControl * This, - /* [in] */ LONG msTimeout, - /* [out] */ OAFilterState *pfs); - - HRESULT ( STDMETHODCALLTYPE *RenderFile )( - IMediaControl * This, - /* [in] */ BSTR strFilename); - - HRESULT ( STDMETHODCALLTYPE *AddSourceFilter )( - IMediaControl * This, - /* [in] */ BSTR strFilename, - /* [out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_FilterCollection )( - IMediaControl * This, - /* [retval][out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RegFilterCollection )( - IMediaControl * This, - /* [retval][out] */ IDispatch **ppUnk); - - HRESULT ( STDMETHODCALLTYPE *StopWhenReady )( - IMediaControl * This); - - END_INTERFACE - } IMediaControlVtbl; - - interface IMediaControl - { - CONST_VTBL struct IMediaControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaControl_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMediaControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMediaControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMediaControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMediaControl_Run(This) \ - (This)->lpVtbl -> Run(This) - -#define IMediaControl_Pause(This) \ - (This)->lpVtbl -> Pause(This) - -#define IMediaControl_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IMediaControl_GetState(This,msTimeout,pfs) \ - (This)->lpVtbl -> GetState(This,msTimeout,pfs) - -#define IMediaControl_RenderFile(This,strFilename) \ - (This)->lpVtbl -> RenderFile(This,strFilename) - -#define IMediaControl_AddSourceFilter(This,strFilename,ppUnk) \ - (This)->lpVtbl -> AddSourceFilter(This,strFilename,ppUnk) - -#define IMediaControl_get_FilterCollection(This,ppUnk) \ - (This)->lpVtbl -> get_FilterCollection(This,ppUnk) - -#define IMediaControl_get_RegFilterCollection(This,ppUnk) \ - (This)->lpVtbl -> get_RegFilterCollection(This,ppUnk) - -#define IMediaControl_StopWhenReady(This) \ - (This)->lpVtbl -> StopWhenReady(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaControl_Run_Proxy( - IMediaControl * This); - - -void __RPC_STUB IMediaControl_Run_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_Pause_Proxy( - IMediaControl * This); - - -void __RPC_STUB IMediaControl_Pause_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_Stop_Proxy( - IMediaControl * This); - - -void __RPC_STUB IMediaControl_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_GetState_Proxy( - IMediaControl * This, - /* [in] */ LONG msTimeout, - /* [out] */ OAFilterState *pfs); - - -void __RPC_STUB IMediaControl_GetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_RenderFile_Proxy( - IMediaControl * This, - /* [in] */ BSTR strFilename); - - -void __RPC_STUB IMediaControl_RenderFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_AddSourceFilter_Proxy( - IMediaControl * This, - /* [in] */ BSTR strFilename, - /* [out] */ IDispatch **ppUnk); - - -void __RPC_STUB IMediaControl_AddSourceFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaControl_get_FilterCollection_Proxy( - IMediaControl * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IMediaControl_get_FilterCollection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaControl_get_RegFilterCollection_Proxy( - IMediaControl * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IMediaControl_get_RegFilterCollection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaControl_StopWhenReady_Proxy( - IMediaControl * This); - - -void __RPC_STUB IMediaControl_StopWhenReady_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaControl_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaEvent_INTERFACE_DEFINED__ -#define __IMediaEvent_INTERFACE_DEFINED__ - -/* interface IMediaEvent */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IMediaEvent,0x56a868b6,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b6-0ad4-11ce-b03a-0020af0ba770") - IMediaEvent : public IDispatch - { - public: - virtual HRESULT STDMETHODCALLTYPE GetEventHandle( - /* [out] */ OAEVENT *hEvent) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEvent( - /* [out] */ long *lEventCode, - /* [out] */ LONG_PTR *lParam1, - /* [out] */ LONG_PTR *lParam2, - /* [in] */ long msTimeout) = 0; - - virtual HRESULT STDMETHODCALLTYPE WaitForCompletion( - /* [in] */ long msTimeout, - /* [out] */ long *pEvCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE CancelDefaultHandling( - /* [in] */ long lEvCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE RestoreDefaultHandling( - /* [in] */ long lEvCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeEventParams( - /* [in] */ long lEvCode, - /* [in] */ LONG_PTR lParam1, - /* [in] */ LONG_PTR lParam2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaEventVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaEvent * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaEvent * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaEvent * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMediaEvent * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMediaEvent * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMediaEvent * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMediaEvent * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *GetEventHandle )( - IMediaEvent * This, - /* [out] */ OAEVENT *hEvent); - - HRESULT ( STDMETHODCALLTYPE *GetEvent )( - IMediaEvent * This, - /* [out] */ long *lEventCode, - /* [out] */ LONG_PTR *lParam1, - /* [out] */ LONG_PTR *lParam2, - /* [in] */ long msTimeout); - - HRESULT ( STDMETHODCALLTYPE *WaitForCompletion )( - IMediaEvent * This, - /* [in] */ long msTimeout, - /* [out] */ long *pEvCode); - - HRESULT ( STDMETHODCALLTYPE *CancelDefaultHandling )( - IMediaEvent * This, - /* [in] */ long lEvCode); - - HRESULT ( STDMETHODCALLTYPE *RestoreDefaultHandling )( - IMediaEvent * This, - /* [in] */ long lEvCode); - - HRESULT ( STDMETHODCALLTYPE *FreeEventParams )( - IMediaEvent * This, - /* [in] */ long lEvCode, - /* [in] */ LONG_PTR lParam1, - /* [in] */ LONG_PTR lParam2); - - END_INTERFACE - } IMediaEventVtbl; - - interface IMediaEvent - { - CONST_VTBL struct IMediaEventVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaEvent_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaEvent_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaEvent_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaEvent_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMediaEvent_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMediaEvent_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMediaEvent_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMediaEvent_GetEventHandle(This,hEvent) \ - (This)->lpVtbl -> GetEventHandle(This,hEvent) - -#define IMediaEvent_GetEvent(This,lEventCode,lParam1,lParam2,msTimeout) \ - (This)->lpVtbl -> GetEvent(This,lEventCode,lParam1,lParam2,msTimeout) - -#define IMediaEvent_WaitForCompletion(This,msTimeout,pEvCode) \ - (This)->lpVtbl -> WaitForCompletion(This,msTimeout,pEvCode) - -#define IMediaEvent_CancelDefaultHandling(This,lEvCode) \ - (This)->lpVtbl -> CancelDefaultHandling(This,lEvCode) - -#define IMediaEvent_RestoreDefaultHandling(This,lEvCode) \ - (This)->lpVtbl -> RestoreDefaultHandling(This,lEvCode) - -#define IMediaEvent_FreeEventParams(This,lEvCode,lParam1,lParam2) \ - (This)->lpVtbl -> FreeEventParams(This,lEvCode,lParam1,lParam2) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaEvent_GetEventHandle_Proxy( - IMediaEvent * This, - /* [out] */ OAEVENT *hEvent); - - -void __RPC_STUB IMediaEvent_GetEventHandle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEvent_GetEvent_Proxy( - IMediaEvent * This, - /* [out] */ long *lEventCode, - /* [out] */ LONG_PTR *lParam1, - /* [out] */ LONG_PTR *lParam2, - /* [in] */ long msTimeout); - - -void __RPC_STUB IMediaEvent_GetEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEvent_WaitForCompletion_Proxy( - IMediaEvent * This, - /* [in] */ long msTimeout, - /* [out] */ long *pEvCode); - - -void __RPC_STUB IMediaEvent_WaitForCompletion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEvent_CancelDefaultHandling_Proxy( - IMediaEvent * This, - /* [in] */ long lEvCode); - - -void __RPC_STUB IMediaEvent_CancelDefaultHandling_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEvent_RestoreDefaultHandling_Proxy( - IMediaEvent * This, - /* [in] */ long lEvCode); - - -void __RPC_STUB IMediaEvent_RestoreDefaultHandling_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEvent_FreeEventParams_Proxy( - IMediaEvent * This, - /* [in] */ long lEvCode, - /* [in] */ LONG_PTR lParam1, - /* [in] */ LONG_PTR lParam2); - - -void __RPC_STUB IMediaEvent_FreeEventParams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaEvent_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaEventEx_INTERFACE_DEFINED__ -#define __IMediaEventEx_INTERFACE_DEFINED__ - -/* interface IMediaEventEx */ -/* [object][helpstring][uuid] */ - - -DEFINE_GUID(IID_IMediaEventEx,0x56a868c0,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868c0-0ad4-11ce-b03a-0020af0ba770") - IMediaEventEx : public IMediaEvent - { - public: - virtual HRESULT STDMETHODCALLTYPE SetNotifyWindow( - /* [in] */ OAHWND hwnd, - /* [in] */ long lMsg, - /* [in] */ LONG_PTR lInstanceData) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetNotifyFlags( - /* [in] */ long lNoNotifyFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNotifyFlags( - /* [out] */ long *lplNoNotifyFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaEventExVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaEventEx * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaEventEx * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaEventEx * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMediaEventEx * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMediaEventEx * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMediaEventEx * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMediaEventEx * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *GetEventHandle )( - IMediaEventEx * This, - /* [out] */ OAEVENT *hEvent); - - HRESULT ( STDMETHODCALLTYPE *GetEvent )( - IMediaEventEx * This, - /* [out] */ long *lEventCode, - /* [out] */ LONG_PTR *lParam1, - /* [out] */ LONG_PTR *lParam2, - /* [in] */ long msTimeout); - - HRESULT ( STDMETHODCALLTYPE *WaitForCompletion )( - IMediaEventEx * This, - /* [in] */ long msTimeout, - /* [out] */ long *pEvCode); - - HRESULT ( STDMETHODCALLTYPE *CancelDefaultHandling )( - IMediaEventEx * This, - /* [in] */ long lEvCode); - - HRESULT ( STDMETHODCALLTYPE *RestoreDefaultHandling )( - IMediaEventEx * This, - /* [in] */ long lEvCode); - - HRESULT ( STDMETHODCALLTYPE *FreeEventParams )( - IMediaEventEx * This, - /* [in] */ long lEvCode, - /* [in] */ LONG_PTR lParam1, - /* [in] */ LONG_PTR lParam2); - - HRESULT ( STDMETHODCALLTYPE *SetNotifyWindow )( - IMediaEventEx * This, - /* [in] */ OAHWND hwnd, - /* [in] */ long lMsg, - /* [in] */ LONG_PTR lInstanceData); - - HRESULT ( STDMETHODCALLTYPE *SetNotifyFlags )( - IMediaEventEx * This, - /* [in] */ long lNoNotifyFlags); - - HRESULT ( STDMETHODCALLTYPE *GetNotifyFlags )( - IMediaEventEx * This, - /* [out] */ long *lplNoNotifyFlags); - - END_INTERFACE - } IMediaEventExVtbl; - - interface IMediaEventEx - { - CONST_VTBL struct IMediaEventExVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaEventEx_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaEventEx_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaEventEx_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaEventEx_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMediaEventEx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMediaEventEx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMediaEventEx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMediaEventEx_GetEventHandle(This,hEvent) \ - (This)->lpVtbl -> GetEventHandle(This,hEvent) - -#define IMediaEventEx_GetEvent(This,lEventCode,lParam1,lParam2,msTimeout) \ - (This)->lpVtbl -> GetEvent(This,lEventCode,lParam1,lParam2,msTimeout) - -#define IMediaEventEx_WaitForCompletion(This,msTimeout,pEvCode) \ - (This)->lpVtbl -> WaitForCompletion(This,msTimeout,pEvCode) - -#define IMediaEventEx_CancelDefaultHandling(This,lEvCode) \ - (This)->lpVtbl -> CancelDefaultHandling(This,lEvCode) - -#define IMediaEventEx_RestoreDefaultHandling(This,lEvCode) \ - (This)->lpVtbl -> RestoreDefaultHandling(This,lEvCode) - -#define IMediaEventEx_FreeEventParams(This,lEvCode,lParam1,lParam2) \ - (This)->lpVtbl -> FreeEventParams(This,lEvCode,lParam1,lParam2) - - -#define IMediaEventEx_SetNotifyWindow(This,hwnd,lMsg,lInstanceData) \ - (This)->lpVtbl -> SetNotifyWindow(This,hwnd,lMsg,lInstanceData) - -#define IMediaEventEx_SetNotifyFlags(This,lNoNotifyFlags) \ - (This)->lpVtbl -> SetNotifyFlags(This,lNoNotifyFlags) - -#define IMediaEventEx_GetNotifyFlags(This,lplNoNotifyFlags) \ - (This)->lpVtbl -> GetNotifyFlags(This,lplNoNotifyFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaEventEx_SetNotifyWindow_Proxy( - IMediaEventEx * This, - /* [in] */ OAHWND hwnd, - /* [in] */ long lMsg, - /* [in] */ LONG_PTR lInstanceData); - - -void __RPC_STUB IMediaEventEx_SetNotifyWindow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEventEx_SetNotifyFlags_Proxy( - IMediaEventEx * This, - /* [in] */ long lNoNotifyFlags); - - -void __RPC_STUB IMediaEventEx_SetNotifyFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaEventEx_GetNotifyFlags_Proxy( - IMediaEventEx * This, - /* [out] */ long *lplNoNotifyFlags); - - -void __RPC_STUB IMediaEventEx_GetNotifyFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaEventEx_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaPosition_INTERFACE_DEFINED__ -#define __IMediaPosition_INTERFACE_DEFINED__ - -/* interface IMediaPosition */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IMediaPosition,0x56a868b2,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b2-0ad4-11ce-b03a-0020af0ba770") - IMediaPosition : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Duration( - /* [retval][out] */ REFTIME *plength) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_CurrentPosition( - /* [in] */ REFTIME llTime) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CurrentPosition( - /* [retval][out] */ REFTIME *pllTime) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_StopTime( - /* [retval][out] */ REFTIME *pllTime) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_StopTime( - /* [in] */ REFTIME llTime) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PrerollTime( - /* [retval][out] */ REFTIME *pllTime) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PrerollTime( - /* [in] */ REFTIME llTime) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Rate( - /* [in] */ double dRate) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Rate( - /* [retval][out] */ double *pdRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE CanSeekForward( - /* [retval][out] */ LONG *pCanSeekForward) = 0; - - virtual HRESULT STDMETHODCALLTYPE CanSeekBackward( - /* [retval][out] */ LONG *pCanSeekBackward) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaPositionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaPosition * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaPosition * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaPosition * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMediaPosition * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMediaPosition * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMediaPosition * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMediaPosition * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IMediaPosition * This, - /* [retval][out] */ REFTIME *plength); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_CurrentPosition )( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentPosition )( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_StopTime )( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_StopTime )( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrerollTime )( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PrerollTime )( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Rate )( - IMediaPosition * This, - /* [in] */ double dRate); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Rate )( - IMediaPosition * This, - /* [retval][out] */ double *pdRate); - - HRESULT ( STDMETHODCALLTYPE *CanSeekForward )( - IMediaPosition * This, - /* [retval][out] */ LONG *pCanSeekForward); - - HRESULT ( STDMETHODCALLTYPE *CanSeekBackward )( - IMediaPosition * This, - /* [retval][out] */ LONG *pCanSeekBackward); - - END_INTERFACE - } IMediaPositionVtbl; - - interface IMediaPosition - { - CONST_VTBL struct IMediaPositionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaPosition_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaPosition_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaPosition_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaPosition_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMediaPosition_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMediaPosition_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMediaPosition_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMediaPosition_get_Duration(This,plength) \ - (This)->lpVtbl -> get_Duration(This,plength) - -#define IMediaPosition_put_CurrentPosition(This,llTime) \ - (This)->lpVtbl -> put_CurrentPosition(This,llTime) - -#define IMediaPosition_get_CurrentPosition(This,pllTime) \ - (This)->lpVtbl -> get_CurrentPosition(This,pllTime) - -#define IMediaPosition_get_StopTime(This,pllTime) \ - (This)->lpVtbl -> get_StopTime(This,pllTime) - -#define IMediaPosition_put_StopTime(This,llTime) \ - (This)->lpVtbl -> put_StopTime(This,llTime) - -#define IMediaPosition_get_PrerollTime(This,pllTime) \ - (This)->lpVtbl -> get_PrerollTime(This,pllTime) - -#define IMediaPosition_put_PrerollTime(This,llTime) \ - (This)->lpVtbl -> put_PrerollTime(This,llTime) - -#define IMediaPosition_put_Rate(This,dRate) \ - (This)->lpVtbl -> put_Rate(This,dRate) - -#define IMediaPosition_get_Rate(This,pdRate) \ - (This)->lpVtbl -> get_Rate(This,pdRate) - -#define IMediaPosition_CanSeekForward(This,pCanSeekForward) \ - (This)->lpVtbl -> CanSeekForward(This,pCanSeekForward) - -#define IMediaPosition_CanSeekBackward(This,pCanSeekBackward) \ - (This)->lpVtbl -> CanSeekBackward(This,pCanSeekBackward) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaPosition_get_Duration_Proxy( - IMediaPosition * This, - /* [retval][out] */ REFTIME *plength); - - -void __RPC_STUB IMediaPosition_get_Duration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IMediaPosition_put_CurrentPosition_Proxy( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - -void __RPC_STUB IMediaPosition_put_CurrentPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaPosition_get_CurrentPosition_Proxy( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - -void __RPC_STUB IMediaPosition_get_CurrentPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaPosition_get_StopTime_Proxy( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - -void __RPC_STUB IMediaPosition_get_StopTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IMediaPosition_put_StopTime_Proxy( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - -void __RPC_STUB IMediaPosition_put_StopTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaPosition_get_PrerollTime_Proxy( - IMediaPosition * This, - /* [retval][out] */ REFTIME *pllTime); - - -void __RPC_STUB IMediaPosition_get_PrerollTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IMediaPosition_put_PrerollTime_Proxy( - IMediaPosition * This, - /* [in] */ REFTIME llTime); - - -void __RPC_STUB IMediaPosition_put_PrerollTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IMediaPosition_put_Rate_Proxy( - IMediaPosition * This, - /* [in] */ double dRate); - - -void __RPC_STUB IMediaPosition_put_Rate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaPosition_get_Rate_Proxy( - IMediaPosition * This, - /* [retval][out] */ double *pdRate); - - -void __RPC_STUB IMediaPosition_get_Rate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaPosition_CanSeekForward_Proxy( - IMediaPosition * This, - /* [retval][out] */ LONG *pCanSeekForward); - - -void __RPC_STUB IMediaPosition_CanSeekForward_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaPosition_CanSeekBackward_Proxy( - IMediaPosition * This, - /* [retval][out] */ LONG *pCanSeekBackward); - - -void __RPC_STUB IMediaPosition_CanSeekBackward_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaPosition_INTERFACE_DEFINED__ */ - - -#ifndef __IBasicAudio_INTERFACE_DEFINED__ -#define __IBasicAudio_INTERFACE_DEFINED__ - -/* interface IBasicAudio */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IBasicAudio,0x56a868b3,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b3-0ad4-11ce-b03a-0020af0ba770") - IBasicAudio : public IDispatch - { - public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Volume( - /* [in] */ long lVolume) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Volume( - /* [retval][out] */ long *plVolume) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Balance( - /* [in] */ long lBalance) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Balance( - /* [retval][out] */ long *plBalance) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBasicAudioVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBasicAudio * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBasicAudio * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBasicAudio * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IBasicAudio * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IBasicAudio * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IBasicAudio * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IBasicAudio * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Volume )( - IBasicAudio * This, - /* [in] */ long lVolume); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Volume )( - IBasicAudio * This, - /* [retval][out] */ long *plVolume); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Balance )( - IBasicAudio * This, - /* [in] */ long lBalance); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Balance )( - IBasicAudio * This, - /* [retval][out] */ long *plBalance); - - END_INTERFACE - } IBasicAudioVtbl; - - interface IBasicAudio - { - CONST_VTBL struct IBasicAudioVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBasicAudio_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBasicAudio_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBasicAudio_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBasicAudio_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IBasicAudio_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IBasicAudio_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IBasicAudio_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IBasicAudio_put_Volume(This,lVolume) \ - (This)->lpVtbl -> put_Volume(This,lVolume) - -#define IBasicAudio_get_Volume(This,plVolume) \ - (This)->lpVtbl -> get_Volume(This,plVolume) - -#define IBasicAudio_put_Balance(This,lBalance) \ - (This)->lpVtbl -> put_Balance(This,lBalance) - -#define IBasicAudio_get_Balance(This,plBalance) \ - (This)->lpVtbl -> get_Balance(This,plBalance) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicAudio_put_Volume_Proxy( - IBasicAudio * This, - /* [in] */ long lVolume); - - -void __RPC_STUB IBasicAudio_put_Volume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicAudio_get_Volume_Proxy( - IBasicAudio * This, - /* [retval][out] */ long *plVolume); - - -void __RPC_STUB IBasicAudio_get_Volume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicAudio_put_Balance_Proxy( - IBasicAudio * This, - /* [in] */ long lBalance); - - -void __RPC_STUB IBasicAudio_put_Balance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicAudio_get_Balance_Proxy( - IBasicAudio * This, - /* [retval][out] */ long *plBalance); - - -void __RPC_STUB IBasicAudio_get_Balance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBasicAudio_INTERFACE_DEFINED__ */ - - -#ifndef __IVideoWindow_INTERFACE_DEFINED__ -#define __IVideoWindow_INTERFACE_DEFINED__ - -/* interface IVideoWindow */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IVideoWindow,0x56a868b4,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b4-0ad4-11ce-b03a-0020af0ba770") - IVideoWindow : public IDispatch - { - public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Caption( - /* [in] */ BSTR strCaption) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Caption( - /* [retval][out] */ BSTR *strCaption) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_WindowStyle( - /* [in] */ long WindowStyle) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_WindowStyle( - /* [retval][out] */ long *WindowStyle) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_WindowStyleEx( - /* [in] */ long WindowStyleEx) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_WindowStyleEx( - /* [retval][out] */ long *WindowStyleEx) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_AutoShow( - /* [in] */ long AutoShow) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_AutoShow( - /* [retval][out] */ long *AutoShow) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_WindowState( - /* [in] */ long WindowState) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_WindowState( - /* [retval][out] */ long *WindowState) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BackgroundPalette( - /* [in] */ long BackgroundPalette) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BackgroundPalette( - /* [retval][out] */ long *pBackgroundPalette) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Visible( - /* [in] */ long Visible) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Visible( - /* [retval][out] */ long *pVisible) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Left( - /* [in] */ long Left) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Left( - /* [retval][out] */ long *pLeft) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Width( - /* [in] */ long Width) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Width( - /* [retval][out] */ long *pWidth) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Top( - /* [in] */ long Top) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Top( - /* [retval][out] */ long *pTop) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Height( - /* [in] */ long Height) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Height( - /* [retval][out] */ long *pHeight) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Owner( - /* [in] */ OAHWND Owner) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Owner( - /* [retval][out] */ OAHWND *Owner) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_MessageDrain( - /* [in] */ OAHWND Drain) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_MessageDrain( - /* [retval][out] */ OAHWND *Drain) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BorderColor( - /* [retval][out] */ long *Color) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BorderColor( - /* [in] */ long Color) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_FullScreenMode( - /* [retval][out] */ long *FullScreenMode) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_FullScreenMode( - /* [in] */ long FullScreenMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetWindowForeground( - /* [in] */ long Focus) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyOwnerMessage( - /* [in] */ OAHWND hwnd, - /* [in] */ long uMsg, - /* [in] */ LONG_PTR wParam, - /* [in] */ LONG_PTR lParam) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetWindowPosition( - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetWindowPosition( - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMinIdealImageSize( - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMaxIdealImageSize( - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRestorePosition( - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE HideCursor( - /* [in] */ long HideCursor) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsCursorHidden( - /* [out] */ long *CursorHidden) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVideoWindowVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVideoWindow * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVideoWindow * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVideoWindow * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVideoWindow * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVideoWindow * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVideoWindow * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVideoWindow * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Caption )( - IVideoWindow * This, - /* [in] */ BSTR strCaption); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Caption )( - IVideoWindow * This, - /* [retval][out] */ BSTR *strCaption); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_WindowStyle )( - IVideoWindow * This, - /* [in] */ long WindowStyle); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_WindowStyle )( - IVideoWindow * This, - /* [retval][out] */ long *WindowStyle); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_WindowStyleEx )( - IVideoWindow * This, - /* [in] */ long WindowStyleEx); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_WindowStyleEx )( - IVideoWindow * This, - /* [retval][out] */ long *WindowStyleEx); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_AutoShow )( - IVideoWindow * This, - /* [in] */ long AutoShow); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AutoShow )( - IVideoWindow * This, - /* [retval][out] */ long *AutoShow); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_WindowState )( - IVideoWindow * This, - /* [in] */ long WindowState); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_WindowState )( - IVideoWindow * This, - /* [retval][out] */ long *WindowState); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BackgroundPalette )( - IVideoWindow * This, - /* [in] */ long BackgroundPalette); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BackgroundPalette )( - IVideoWindow * This, - /* [retval][out] */ long *pBackgroundPalette); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Visible )( - IVideoWindow * This, - /* [in] */ long Visible); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Visible )( - IVideoWindow * This, - /* [retval][out] */ long *pVisible); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Left )( - IVideoWindow * This, - /* [in] */ long Left); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Left )( - IVideoWindow * This, - /* [retval][out] */ long *pLeft); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Width )( - IVideoWindow * This, - /* [in] */ long Width); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )( - IVideoWindow * This, - /* [retval][out] */ long *pWidth); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Top )( - IVideoWindow * This, - /* [in] */ long Top); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Top )( - IVideoWindow * This, - /* [retval][out] */ long *pTop); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Height )( - IVideoWindow * This, - /* [in] */ long Height); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )( - IVideoWindow * This, - /* [retval][out] */ long *pHeight); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Owner )( - IVideoWindow * This, - /* [in] */ OAHWND Owner); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Owner )( - IVideoWindow * This, - /* [retval][out] */ OAHWND *Owner); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_MessageDrain )( - IVideoWindow * This, - /* [in] */ OAHWND Drain); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_MessageDrain )( - IVideoWindow * This, - /* [retval][out] */ OAHWND *Drain); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderColor )( - IVideoWindow * This, - /* [retval][out] */ long *Color); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderColor )( - IVideoWindow * This, - /* [in] */ long Color); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreenMode )( - IVideoWindow * This, - /* [retval][out] */ long *FullScreenMode); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenMode )( - IVideoWindow * This, - /* [in] */ long FullScreenMode); - - HRESULT ( STDMETHODCALLTYPE *SetWindowForeground )( - IVideoWindow * This, - /* [in] */ long Focus); - - HRESULT ( STDMETHODCALLTYPE *NotifyOwnerMessage )( - IVideoWindow * This, - /* [in] */ OAHWND hwnd, - /* [in] */ long uMsg, - /* [in] */ LONG_PTR wParam, - /* [in] */ LONG_PTR lParam); - - HRESULT ( STDMETHODCALLTYPE *SetWindowPosition )( - IVideoWindow * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - HRESULT ( STDMETHODCALLTYPE *GetWindowPosition )( - IVideoWindow * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *GetMinIdealImageSize )( - IVideoWindow * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *GetMaxIdealImageSize )( - IVideoWindow * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *GetRestorePosition )( - IVideoWindow * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *HideCursor )( - IVideoWindow * This, - /* [in] */ long HideCursor); - - HRESULT ( STDMETHODCALLTYPE *IsCursorHidden )( - IVideoWindow * This, - /* [out] */ long *CursorHidden); - - END_INTERFACE - } IVideoWindowVtbl; - - interface IVideoWindow - { - CONST_VTBL struct IVideoWindowVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVideoWindow_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVideoWindow_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVideoWindow_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVideoWindow_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVideoWindow_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVideoWindow_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVideoWindow_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVideoWindow_put_Caption(This,strCaption) \ - (This)->lpVtbl -> put_Caption(This,strCaption) - -#define IVideoWindow_get_Caption(This,strCaption) \ - (This)->lpVtbl -> get_Caption(This,strCaption) - -#define IVideoWindow_put_WindowStyle(This,WindowStyle) \ - (This)->lpVtbl -> put_WindowStyle(This,WindowStyle) - -#define IVideoWindow_get_WindowStyle(This,WindowStyle) \ - (This)->lpVtbl -> get_WindowStyle(This,WindowStyle) - -#define IVideoWindow_put_WindowStyleEx(This,WindowStyleEx) \ - (This)->lpVtbl -> put_WindowStyleEx(This,WindowStyleEx) - -#define IVideoWindow_get_WindowStyleEx(This,WindowStyleEx) \ - (This)->lpVtbl -> get_WindowStyleEx(This,WindowStyleEx) - -#define IVideoWindow_put_AutoShow(This,AutoShow) \ - (This)->lpVtbl -> put_AutoShow(This,AutoShow) - -#define IVideoWindow_get_AutoShow(This,AutoShow) \ - (This)->lpVtbl -> get_AutoShow(This,AutoShow) - -#define IVideoWindow_put_WindowState(This,WindowState) \ - (This)->lpVtbl -> put_WindowState(This,WindowState) - -#define IVideoWindow_get_WindowState(This,WindowState) \ - (This)->lpVtbl -> get_WindowState(This,WindowState) - -#define IVideoWindow_put_BackgroundPalette(This,BackgroundPalette) \ - (This)->lpVtbl -> put_BackgroundPalette(This,BackgroundPalette) - -#define IVideoWindow_get_BackgroundPalette(This,pBackgroundPalette) \ - (This)->lpVtbl -> get_BackgroundPalette(This,pBackgroundPalette) - -#define IVideoWindow_put_Visible(This,Visible) \ - (This)->lpVtbl -> put_Visible(This,Visible) - -#define IVideoWindow_get_Visible(This,pVisible) \ - (This)->lpVtbl -> get_Visible(This,pVisible) - -#define IVideoWindow_put_Left(This,Left) \ - (This)->lpVtbl -> put_Left(This,Left) - -#define IVideoWindow_get_Left(This,pLeft) \ - (This)->lpVtbl -> get_Left(This,pLeft) - -#define IVideoWindow_put_Width(This,Width) \ - (This)->lpVtbl -> put_Width(This,Width) - -#define IVideoWindow_get_Width(This,pWidth) \ - (This)->lpVtbl -> get_Width(This,pWidth) - -#define IVideoWindow_put_Top(This,Top) \ - (This)->lpVtbl -> put_Top(This,Top) - -#define IVideoWindow_get_Top(This,pTop) \ - (This)->lpVtbl -> get_Top(This,pTop) - -#define IVideoWindow_put_Height(This,Height) \ - (This)->lpVtbl -> put_Height(This,Height) - -#define IVideoWindow_get_Height(This,pHeight) \ - (This)->lpVtbl -> get_Height(This,pHeight) - -#define IVideoWindow_put_Owner(This,Owner) \ - (This)->lpVtbl -> put_Owner(This,Owner) - -#define IVideoWindow_get_Owner(This,Owner) \ - (This)->lpVtbl -> get_Owner(This,Owner) - -#define IVideoWindow_put_MessageDrain(This,Drain) \ - (This)->lpVtbl -> put_MessageDrain(This,Drain) - -#define IVideoWindow_get_MessageDrain(This,Drain) \ - (This)->lpVtbl -> get_MessageDrain(This,Drain) - -#define IVideoWindow_get_BorderColor(This,Color) \ - (This)->lpVtbl -> get_BorderColor(This,Color) - -#define IVideoWindow_put_BorderColor(This,Color) \ - (This)->lpVtbl -> put_BorderColor(This,Color) - -#define IVideoWindow_get_FullScreenMode(This,FullScreenMode) \ - (This)->lpVtbl -> get_FullScreenMode(This,FullScreenMode) - -#define IVideoWindow_put_FullScreenMode(This,FullScreenMode) \ - (This)->lpVtbl -> put_FullScreenMode(This,FullScreenMode) - -#define IVideoWindow_SetWindowForeground(This,Focus) \ - (This)->lpVtbl -> SetWindowForeground(This,Focus) - -#define IVideoWindow_NotifyOwnerMessage(This,hwnd,uMsg,wParam,lParam) \ - (This)->lpVtbl -> NotifyOwnerMessage(This,hwnd,uMsg,wParam,lParam) - -#define IVideoWindow_SetWindowPosition(This,Left,Top,Width,Height) \ - (This)->lpVtbl -> SetWindowPosition(This,Left,Top,Width,Height) - -#define IVideoWindow_GetWindowPosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetWindowPosition(This,pLeft,pTop,pWidth,pHeight) - -#define IVideoWindow_GetMinIdealImageSize(This,pWidth,pHeight) \ - (This)->lpVtbl -> GetMinIdealImageSize(This,pWidth,pHeight) - -#define IVideoWindow_GetMaxIdealImageSize(This,pWidth,pHeight) \ - (This)->lpVtbl -> GetMaxIdealImageSize(This,pWidth,pHeight) - -#define IVideoWindow_GetRestorePosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetRestorePosition(This,pLeft,pTop,pWidth,pHeight) - -#define IVideoWindow_HideCursor(This,HideCursor) \ - (This)->lpVtbl -> HideCursor(This,HideCursor) - -#define IVideoWindow_IsCursorHidden(This,CursorHidden) \ - (This)->lpVtbl -> IsCursorHidden(This,CursorHidden) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Caption_Proxy( - IVideoWindow * This, - /* [in] */ BSTR strCaption); - - -void __RPC_STUB IVideoWindow_put_Caption_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Caption_Proxy( - IVideoWindow * This, - /* [retval][out] */ BSTR *strCaption); - - -void __RPC_STUB IVideoWindow_get_Caption_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_WindowStyle_Proxy( - IVideoWindow * This, - /* [in] */ long WindowStyle); - - -void __RPC_STUB IVideoWindow_put_WindowStyle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_WindowStyle_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *WindowStyle); - - -void __RPC_STUB IVideoWindow_get_WindowStyle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_WindowStyleEx_Proxy( - IVideoWindow * This, - /* [in] */ long WindowStyleEx); - - -void __RPC_STUB IVideoWindow_put_WindowStyleEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_WindowStyleEx_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *WindowStyleEx); - - -void __RPC_STUB IVideoWindow_get_WindowStyleEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_AutoShow_Proxy( - IVideoWindow * This, - /* [in] */ long AutoShow); - - -void __RPC_STUB IVideoWindow_put_AutoShow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_AutoShow_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *AutoShow); - - -void __RPC_STUB IVideoWindow_get_AutoShow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_WindowState_Proxy( - IVideoWindow * This, - /* [in] */ long WindowState); - - -void __RPC_STUB IVideoWindow_put_WindowState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_WindowState_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *WindowState); - - -void __RPC_STUB IVideoWindow_get_WindowState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_BackgroundPalette_Proxy( - IVideoWindow * This, - /* [in] */ long BackgroundPalette); - - -void __RPC_STUB IVideoWindow_put_BackgroundPalette_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_BackgroundPalette_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pBackgroundPalette); - - -void __RPC_STUB IVideoWindow_get_BackgroundPalette_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Visible_Proxy( - IVideoWindow * This, - /* [in] */ long Visible); - - -void __RPC_STUB IVideoWindow_put_Visible_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Visible_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pVisible); - - -void __RPC_STUB IVideoWindow_get_Visible_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Left_Proxy( - IVideoWindow * This, - /* [in] */ long Left); - - -void __RPC_STUB IVideoWindow_put_Left_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Left_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pLeft); - - -void __RPC_STUB IVideoWindow_get_Left_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Width_Proxy( - IVideoWindow * This, - /* [in] */ long Width); - - -void __RPC_STUB IVideoWindow_put_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Width_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pWidth); - - -void __RPC_STUB IVideoWindow_get_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Top_Proxy( - IVideoWindow * This, - /* [in] */ long Top); - - -void __RPC_STUB IVideoWindow_put_Top_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Top_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pTop); - - -void __RPC_STUB IVideoWindow_get_Top_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Height_Proxy( - IVideoWindow * This, - /* [in] */ long Height); - - -void __RPC_STUB IVideoWindow_put_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Height_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *pHeight); - - -void __RPC_STUB IVideoWindow_get_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_Owner_Proxy( - IVideoWindow * This, - /* [in] */ OAHWND Owner); - - -void __RPC_STUB IVideoWindow_put_Owner_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_Owner_Proxy( - IVideoWindow * This, - /* [retval][out] */ OAHWND *Owner); - - -void __RPC_STUB IVideoWindow_get_Owner_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_MessageDrain_Proxy( - IVideoWindow * This, - /* [in] */ OAHWND Drain); - - -void __RPC_STUB IVideoWindow_put_MessageDrain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_MessageDrain_Proxy( - IVideoWindow * This, - /* [retval][out] */ OAHWND *Drain); - - -void __RPC_STUB IVideoWindow_get_MessageDrain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_BorderColor_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *Color); - - -void __RPC_STUB IVideoWindow_get_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_BorderColor_Proxy( - IVideoWindow * This, - /* [in] */ long Color); - - -void __RPC_STUB IVideoWindow_put_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IVideoWindow_get_FullScreenMode_Proxy( - IVideoWindow * This, - /* [retval][out] */ long *FullScreenMode); - - -void __RPC_STUB IVideoWindow_get_FullScreenMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IVideoWindow_put_FullScreenMode_Proxy( - IVideoWindow * This, - /* [in] */ long FullScreenMode); - - -void __RPC_STUB IVideoWindow_put_FullScreenMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_SetWindowForeground_Proxy( - IVideoWindow * This, - /* [in] */ long Focus); - - -void __RPC_STUB IVideoWindow_SetWindowForeground_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_NotifyOwnerMessage_Proxy( - IVideoWindow * This, - /* [in] */ OAHWND hwnd, - /* [in] */ long uMsg, - /* [in] */ LONG_PTR wParam, - /* [in] */ LONG_PTR lParam); - - -void __RPC_STUB IVideoWindow_NotifyOwnerMessage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_SetWindowPosition_Proxy( - IVideoWindow * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - -void __RPC_STUB IVideoWindow_SetWindowPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_GetWindowPosition_Proxy( - IVideoWindow * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IVideoWindow_GetWindowPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_GetMinIdealImageSize_Proxy( - IVideoWindow * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IVideoWindow_GetMinIdealImageSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_GetMaxIdealImageSize_Proxy( - IVideoWindow * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IVideoWindow_GetMaxIdealImageSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_GetRestorePosition_Proxy( - IVideoWindow * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IVideoWindow_GetRestorePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_HideCursor_Proxy( - IVideoWindow * This, - /* [in] */ long HideCursor); - - -void __RPC_STUB IVideoWindow_HideCursor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoWindow_IsCursorHidden_Proxy( - IVideoWindow * This, - /* [out] */ long *CursorHidden); - - -void __RPC_STUB IVideoWindow_IsCursorHidden_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVideoWindow_INTERFACE_DEFINED__ */ - - -#ifndef __IBasicVideo_INTERFACE_DEFINED__ -#define __IBasicVideo_INTERFACE_DEFINED__ - -/* interface IBasicVideo */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IBasicVideo,0x56a868b5,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b5-0ad4-11ce-b03a-0020af0ba770") - IBasicVideo : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_AvgTimePerFrame( - /* [retval][out] */ REFTIME *pAvgTimePerFrame) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BitRate( - /* [retval][out] */ long *pBitRate) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BitErrorRate( - /* [retval][out] */ long *pBitErrorRate) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VideoWidth( - /* [retval][out] */ long *pVideoWidth) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VideoHeight( - /* [retval][out] */ long *pVideoHeight) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_SourceLeft( - /* [in] */ long SourceLeft) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SourceLeft( - /* [retval][out] */ long *pSourceLeft) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_SourceWidth( - /* [in] */ long SourceWidth) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SourceWidth( - /* [retval][out] */ long *pSourceWidth) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_SourceTop( - /* [in] */ long SourceTop) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SourceTop( - /* [retval][out] */ long *pSourceTop) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_SourceHeight( - /* [in] */ long SourceHeight) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SourceHeight( - /* [retval][out] */ long *pSourceHeight) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_DestinationLeft( - /* [in] */ long DestinationLeft) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DestinationLeft( - /* [retval][out] */ long *pDestinationLeft) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_DestinationWidth( - /* [in] */ long DestinationWidth) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DestinationWidth( - /* [retval][out] */ long *pDestinationWidth) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_DestinationTop( - /* [in] */ long DestinationTop) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DestinationTop( - /* [retval][out] */ long *pDestinationTop) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_DestinationHeight( - /* [in] */ long DestinationHeight) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DestinationHeight( - /* [retval][out] */ long *pDestinationHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourcePosition( - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourcePosition( - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultSourcePosition( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDestinationPosition( - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDestinationPosition( - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultDestinationPosition( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVideoSize( - /* [out] */ long *pWidth, - /* [out] */ long *pHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVideoPaletteEntries( - /* [in] */ long StartIndex, - /* [in] */ long Entries, - /* [out] */ long *pRetrieved, - /* [out] */ long *pPalette) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentImage( - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pDIBImage) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsUsingDefaultSource( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsUsingDefaultDestination( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBasicVideoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBasicVideo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBasicVideo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBasicVideo * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IBasicVideo * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IBasicVideo * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IBasicVideo * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IBasicVideo * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AvgTimePerFrame )( - IBasicVideo * This, - /* [retval][out] */ REFTIME *pAvgTimePerFrame); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BitRate )( - IBasicVideo * This, - /* [retval][out] */ long *pBitRate); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BitErrorRate )( - IBasicVideo * This, - /* [retval][out] */ long *pBitErrorRate); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VideoWidth )( - IBasicVideo * This, - /* [retval][out] */ long *pVideoWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VideoHeight )( - IBasicVideo * This, - /* [retval][out] */ long *pVideoHeight); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceLeft )( - IBasicVideo * This, - /* [in] */ long SourceLeft); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceLeft )( - IBasicVideo * This, - /* [retval][out] */ long *pSourceLeft); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceWidth )( - IBasicVideo * This, - /* [in] */ long SourceWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceWidth )( - IBasicVideo * This, - /* [retval][out] */ long *pSourceWidth); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceTop )( - IBasicVideo * This, - /* [in] */ long SourceTop); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceTop )( - IBasicVideo * This, - /* [retval][out] */ long *pSourceTop); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceHeight )( - IBasicVideo * This, - /* [in] */ long SourceHeight); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceHeight )( - IBasicVideo * This, - /* [retval][out] */ long *pSourceHeight); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationLeft )( - IBasicVideo * This, - /* [in] */ long DestinationLeft); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationLeft )( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationLeft); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationWidth )( - IBasicVideo * This, - /* [in] */ long DestinationWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationWidth )( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationWidth); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationTop )( - IBasicVideo * This, - /* [in] */ long DestinationTop); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationTop )( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationTop); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationHeight )( - IBasicVideo * This, - /* [in] */ long DestinationHeight); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationHeight )( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationHeight); - - HRESULT ( STDMETHODCALLTYPE *SetSourcePosition )( - IBasicVideo * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - HRESULT ( STDMETHODCALLTYPE *GetSourcePosition )( - IBasicVideo * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultSourcePosition )( - IBasicVideo * This); - - HRESULT ( STDMETHODCALLTYPE *SetDestinationPosition )( - IBasicVideo * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - HRESULT ( STDMETHODCALLTYPE *GetDestinationPosition )( - IBasicVideo * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultDestinationPosition )( - IBasicVideo * This); - - HRESULT ( STDMETHODCALLTYPE *GetVideoSize )( - IBasicVideo * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *GetVideoPaletteEntries )( - IBasicVideo * This, - /* [in] */ long StartIndex, - /* [in] */ long Entries, - /* [out] */ long *pRetrieved, - /* [out] */ long *pPalette); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentImage )( - IBasicVideo * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pDIBImage); - - HRESULT ( STDMETHODCALLTYPE *IsUsingDefaultSource )( - IBasicVideo * This); - - HRESULT ( STDMETHODCALLTYPE *IsUsingDefaultDestination )( - IBasicVideo * This); - - END_INTERFACE - } IBasicVideoVtbl; - - interface IBasicVideo - { - CONST_VTBL struct IBasicVideoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBasicVideo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBasicVideo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBasicVideo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBasicVideo_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IBasicVideo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IBasicVideo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IBasicVideo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IBasicVideo_get_AvgTimePerFrame(This,pAvgTimePerFrame) \ - (This)->lpVtbl -> get_AvgTimePerFrame(This,pAvgTimePerFrame) - -#define IBasicVideo_get_BitRate(This,pBitRate) \ - (This)->lpVtbl -> get_BitRate(This,pBitRate) - -#define IBasicVideo_get_BitErrorRate(This,pBitErrorRate) \ - (This)->lpVtbl -> get_BitErrorRate(This,pBitErrorRate) - -#define IBasicVideo_get_VideoWidth(This,pVideoWidth) \ - (This)->lpVtbl -> get_VideoWidth(This,pVideoWidth) - -#define IBasicVideo_get_VideoHeight(This,pVideoHeight) \ - (This)->lpVtbl -> get_VideoHeight(This,pVideoHeight) - -#define IBasicVideo_put_SourceLeft(This,SourceLeft) \ - (This)->lpVtbl -> put_SourceLeft(This,SourceLeft) - -#define IBasicVideo_get_SourceLeft(This,pSourceLeft) \ - (This)->lpVtbl -> get_SourceLeft(This,pSourceLeft) - -#define IBasicVideo_put_SourceWidth(This,SourceWidth) \ - (This)->lpVtbl -> put_SourceWidth(This,SourceWidth) - -#define IBasicVideo_get_SourceWidth(This,pSourceWidth) \ - (This)->lpVtbl -> get_SourceWidth(This,pSourceWidth) - -#define IBasicVideo_put_SourceTop(This,SourceTop) \ - (This)->lpVtbl -> put_SourceTop(This,SourceTop) - -#define IBasicVideo_get_SourceTop(This,pSourceTop) \ - (This)->lpVtbl -> get_SourceTop(This,pSourceTop) - -#define IBasicVideo_put_SourceHeight(This,SourceHeight) \ - (This)->lpVtbl -> put_SourceHeight(This,SourceHeight) - -#define IBasicVideo_get_SourceHeight(This,pSourceHeight) \ - (This)->lpVtbl -> get_SourceHeight(This,pSourceHeight) - -#define IBasicVideo_put_DestinationLeft(This,DestinationLeft) \ - (This)->lpVtbl -> put_DestinationLeft(This,DestinationLeft) - -#define IBasicVideo_get_DestinationLeft(This,pDestinationLeft) \ - (This)->lpVtbl -> get_DestinationLeft(This,pDestinationLeft) - -#define IBasicVideo_put_DestinationWidth(This,DestinationWidth) \ - (This)->lpVtbl -> put_DestinationWidth(This,DestinationWidth) - -#define IBasicVideo_get_DestinationWidth(This,pDestinationWidth) \ - (This)->lpVtbl -> get_DestinationWidth(This,pDestinationWidth) - -#define IBasicVideo_put_DestinationTop(This,DestinationTop) \ - (This)->lpVtbl -> put_DestinationTop(This,DestinationTop) - -#define IBasicVideo_get_DestinationTop(This,pDestinationTop) \ - (This)->lpVtbl -> get_DestinationTop(This,pDestinationTop) - -#define IBasicVideo_put_DestinationHeight(This,DestinationHeight) \ - (This)->lpVtbl -> put_DestinationHeight(This,DestinationHeight) - -#define IBasicVideo_get_DestinationHeight(This,pDestinationHeight) \ - (This)->lpVtbl -> get_DestinationHeight(This,pDestinationHeight) - -#define IBasicVideo_SetSourcePosition(This,Left,Top,Width,Height) \ - (This)->lpVtbl -> SetSourcePosition(This,Left,Top,Width,Height) - -#define IBasicVideo_GetSourcePosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetSourcePosition(This,pLeft,pTop,pWidth,pHeight) - -#define IBasicVideo_SetDefaultSourcePosition(This) \ - (This)->lpVtbl -> SetDefaultSourcePosition(This) - -#define IBasicVideo_SetDestinationPosition(This,Left,Top,Width,Height) \ - (This)->lpVtbl -> SetDestinationPosition(This,Left,Top,Width,Height) - -#define IBasicVideo_GetDestinationPosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetDestinationPosition(This,pLeft,pTop,pWidth,pHeight) - -#define IBasicVideo_SetDefaultDestinationPosition(This) \ - (This)->lpVtbl -> SetDefaultDestinationPosition(This) - -#define IBasicVideo_GetVideoSize(This,pWidth,pHeight) \ - (This)->lpVtbl -> GetVideoSize(This,pWidth,pHeight) - -#define IBasicVideo_GetVideoPaletteEntries(This,StartIndex,Entries,pRetrieved,pPalette) \ - (This)->lpVtbl -> GetVideoPaletteEntries(This,StartIndex,Entries,pRetrieved,pPalette) - -#define IBasicVideo_GetCurrentImage(This,pBufferSize,pDIBImage) \ - (This)->lpVtbl -> GetCurrentImage(This,pBufferSize,pDIBImage) - -#define IBasicVideo_IsUsingDefaultSource(This) \ - (This)->lpVtbl -> IsUsingDefaultSource(This) - -#define IBasicVideo_IsUsingDefaultDestination(This) \ - (This)->lpVtbl -> IsUsingDefaultDestination(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_AvgTimePerFrame_Proxy( - IBasicVideo * This, - /* [retval][out] */ REFTIME *pAvgTimePerFrame); - - -void __RPC_STUB IBasicVideo_get_AvgTimePerFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_BitRate_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pBitRate); - - -void __RPC_STUB IBasicVideo_get_BitRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_BitErrorRate_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pBitErrorRate); - - -void __RPC_STUB IBasicVideo_get_BitErrorRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_VideoWidth_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pVideoWidth); - - -void __RPC_STUB IBasicVideo_get_VideoWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_VideoHeight_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pVideoHeight); - - -void __RPC_STUB IBasicVideo_get_VideoHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_SourceLeft_Proxy( - IBasicVideo * This, - /* [in] */ long SourceLeft); - - -void __RPC_STUB IBasicVideo_put_SourceLeft_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_SourceLeft_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pSourceLeft); - - -void __RPC_STUB IBasicVideo_get_SourceLeft_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_SourceWidth_Proxy( - IBasicVideo * This, - /* [in] */ long SourceWidth); - - -void __RPC_STUB IBasicVideo_put_SourceWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_SourceWidth_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pSourceWidth); - - -void __RPC_STUB IBasicVideo_get_SourceWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_SourceTop_Proxy( - IBasicVideo * This, - /* [in] */ long SourceTop); - - -void __RPC_STUB IBasicVideo_put_SourceTop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_SourceTop_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pSourceTop); - - -void __RPC_STUB IBasicVideo_get_SourceTop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_SourceHeight_Proxy( - IBasicVideo * This, - /* [in] */ long SourceHeight); - - -void __RPC_STUB IBasicVideo_put_SourceHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_SourceHeight_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pSourceHeight); - - -void __RPC_STUB IBasicVideo_get_SourceHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_DestinationLeft_Proxy( - IBasicVideo * This, - /* [in] */ long DestinationLeft); - - -void __RPC_STUB IBasicVideo_put_DestinationLeft_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_DestinationLeft_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationLeft); - - -void __RPC_STUB IBasicVideo_get_DestinationLeft_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_DestinationWidth_Proxy( - IBasicVideo * This, - /* [in] */ long DestinationWidth); - - -void __RPC_STUB IBasicVideo_put_DestinationWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_DestinationWidth_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationWidth); - - -void __RPC_STUB IBasicVideo_get_DestinationWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_DestinationTop_Proxy( - IBasicVideo * This, - /* [in] */ long DestinationTop); - - -void __RPC_STUB IBasicVideo_put_DestinationTop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_DestinationTop_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationTop); - - -void __RPC_STUB IBasicVideo_get_DestinationTop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IBasicVideo_put_DestinationHeight_Proxy( - IBasicVideo * This, - /* [in] */ long DestinationHeight); - - -void __RPC_STUB IBasicVideo_put_DestinationHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IBasicVideo_get_DestinationHeight_Proxy( - IBasicVideo * This, - /* [retval][out] */ long *pDestinationHeight); - - -void __RPC_STUB IBasicVideo_get_DestinationHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_SetSourcePosition_Proxy( - IBasicVideo * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - -void __RPC_STUB IBasicVideo_SetSourcePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_GetSourcePosition_Proxy( - IBasicVideo * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IBasicVideo_GetSourcePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_SetDefaultSourcePosition_Proxy( - IBasicVideo * This); - - -void __RPC_STUB IBasicVideo_SetDefaultSourcePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_SetDestinationPosition_Proxy( - IBasicVideo * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - -void __RPC_STUB IBasicVideo_SetDestinationPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_GetDestinationPosition_Proxy( - IBasicVideo * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IBasicVideo_GetDestinationPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_SetDefaultDestinationPosition_Proxy( - IBasicVideo * This); - - -void __RPC_STUB IBasicVideo_SetDefaultDestinationPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_GetVideoSize_Proxy( - IBasicVideo * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - -void __RPC_STUB IBasicVideo_GetVideoSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_GetVideoPaletteEntries_Proxy( - IBasicVideo * This, - /* [in] */ long StartIndex, - /* [in] */ long Entries, - /* [out] */ long *pRetrieved, - /* [out] */ long *pPalette); - - -void __RPC_STUB IBasicVideo_GetVideoPaletteEntries_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_GetCurrentImage_Proxy( - IBasicVideo * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pDIBImage); - - -void __RPC_STUB IBasicVideo_GetCurrentImage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_IsUsingDefaultSource_Proxy( - IBasicVideo * This); - - -void __RPC_STUB IBasicVideo_IsUsingDefaultSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBasicVideo_IsUsingDefaultDestination_Proxy( - IBasicVideo * This); - - -void __RPC_STUB IBasicVideo_IsUsingDefaultDestination_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBasicVideo_INTERFACE_DEFINED__ */ - - -#ifndef __IBasicVideo2_INTERFACE_DEFINED__ -#define __IBasicVideo2_INTERFACE_DEFINED__ - -/* interface IBasicVideo2 */ -/* [object][helpstring][uuid] */ - - -DEFINE_GUID(IID_IBasicVideo2,0x329bb360,0xf6ea,0x11d1,0x90,0x38,0x00,0xa0,0xc9,0x69,0x72,0x98); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("329bb360-f6ea-11d1-9038-00a0c9697298") - IBasicVideo2 : public IBasicVideo - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPreferredAspectRatio( - /* [out] */ long *plAspectX, - /* [out] */ long *plAspectY) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBasicVideo2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBasicVideo2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBasicVideo2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBasicVideo2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IBasicVideo2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IBasicVideo2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IBasicVideo2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IBasicVideo2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AvgTimePerFrame )( - IBasicVideo2 * This, - /* [retval][out] */ REFTIME *pAvgTimePerFrame); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BitRate )( - IBasicVideo2 * This, - /* [retval][out] */ long *pBitRate); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BitErrorRate )( - IBasicVideo2 * This, - /* [retval][out] */ long *pBitErrorRate); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VideoWidth )( - IBasicVideo2 * This, - /* [retval][out] */ long *pVideoWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VideoHeight )( - IBasicVideo2 * This, - /* [retval][out] */ long *pVideoHeight); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceLeft )( - IBasicVideo2 * This, - /* [in] */ long SourceLeft); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceLeft )( - IBasicVideo2 * This, - /* [retval][out] */ long *pSourceLeft); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceWidth )( - IBasicVideo2 * This, - /* [in] */ long SourceWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceWidth )( - IBasicVideo2 * This, - /* [retval][out] */ long *pSourceWidth); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceTop )( - IBasicVideo2 * This, - /* [in] */ long SourceTop); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceTop )( - IBasicVideo2 * This, - /* [retval][out] */ long *pSourceTop); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_SourceHeight )( - IBasicVideo2 * This, - /* [in] */ long SourceHeight); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SourceHeight )( - IBasicVideo2 * This, - /* [retval][out] */ long *pSourceHeight); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationLeft )( - IBasicVideo2 * This, - /* [in] */ long DestinationLeft); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationLeft )( - IBasicVideo2 * This, - /* [retval][out] */ long *pDestinationLeft); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationWidth )( - IBasicVideo2 * This, - /* [in] */ long DestinationWidth); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationWidth )( - IBasicVideo2 * This, - /* [retval][out] */ long *pDestinationWidth); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationTop )( - IBasicVideo2 * This, - /* [in] */ long DestinationTop); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationTop )( - IBasicVideo2 * This, - /* [retval][out] */ long *pDestinationTop); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_DestinationHeight )( - IBasicVideo2 * This, - /* [in] */ long DestinationHeight); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DestinationHeight )( - IBasicVideo2 * This, - /* [retval][out] */ long *pDestinationHeight); - - HRESULT ( STDMETHODCALLTYPE *SetSourcePosition )( - IBasicVideo2 * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - HRESULT ( STDMETHODCALLTYPE *GetSourcePosition )( - IBasicVideo2 * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultSourcePosition )( - IBasicVideo2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetDestinationPosition )( - IBasicVideo2 * This, - /* [in] */ long Left, - /* [in] */ long Top, - /* [in] */ long Width, - /* [in] */ long Height); - - HRESULT ( STDMETHODCALLTYPE *GetDestinationPosition )( - IBasicVideo2 * This, - /* [out] */ long *pLeft, - /* [out] */ long *pTop, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultDestinationPosition )( - IBasicVideo2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetVideoSize )( - IBasicVideo2 * This, - /* [out] */ long *pWidth, - /* [out] */ long *pHeight); - - HRESULT ( STDMETHODCALLTYPE *GetVideoPaletteEntries )( - IBasicVideo2 * This, - /* [in] */ long StartIndex, - /* [in] */ long Entries, - /* [out] */ long *pRetrieved, - /* [out] */ long *pPalette); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentImage )( - IBasicVideo2 * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pDIBImage); - - HRESULT ( STDMETHODCALLTYPE *IsUsingDefaultSource )( - IBasicVideo2 * This); - - HRESULT ( STDMETHODCALLTYPE *IsUsingDefaultDestination )( - IBasicVideo2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetPreferredAspectRatio )( - IBasicVideo2 * This, - /* [out] */ long *plAspectX, - /* [out] */ long *plAspectY); - - END_INTERFACE - } IBasicVideo2Vtbl; - - interface IBasicVideo2 - { - CONST_VTBL struct IBasicVideo2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBasicVideo2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBasicVideo2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBasicVideo2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBasicVideo2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IBasicVideo2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IBasicVideo2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IBasicVideo2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IBasicVideo2_get_AvgTimePerFrame(This,pAvgTimePerFrame) \ - (This)->lpVtbl -> get_AvgTimePerFrame(This,pAvgTimePerFrame) - -#define IBasicVideo2_get_BitRate(This,pBitRate) \ - (This)->lpVtbl -> get_BitRate(This,pBitRate) - -#define IBasicVideo2_get_BitErrorRate(This,pBitErrorRate) \ - (This)->lpVtbl -> get_BitErrorRate(This,pBitErrorRate) - -#define IBasicVideo2_get_VideoWidth(This,pVideoWidth) \ - (This)->lpVtbl -> get_VideoWidth(This,pVideoWidth) - -#define IBasicVideo2_get_VideoHeight(This,pVideoHeight) \ - (This)->lpVtbl -> get_VideoHeight(This,pVideoHeight) - -#define IBasicVideo2_put_SourceLeft(This,SourceLeft) \ - (This)->lpVtbl -> put_SourceLeft(This,SourceLeft) - -#define IBasicVideo2_get_SourceLeft(This,pSourceLeft) \ - (This)->lpVtbl -> get_SourceLeft(This,pSourceLeft) - -#define IBasicVideo2_put_SourceWidth(This,SourceWidth) \ - (This)->lpVtbl -> put_SourceWidth(This,SourceWidth) - -#define IBasicVideo2_get_SourceWidth(This,pSourceWidth) \ - (This)->lpVtbl -> get_SourceWidth(This,pSourceWidth) - -#define IBasicVideo2_put_SourceTop(This,SourceTop) \ - (This)->lpVtbl -> put_SourceTop(This,SourceTop) - -#define IBasicVideo2_get_SourceTop(This,pSourceTop) \ - (This)->lpVtbl -> get_SourceTop(This,pSourceTop) - -#define IBasicVideo2_put_SourceHeight(This,SourceHeight) \ - (This)->lpVtbl -> put_SourceHeight(This,SourceHeight) - -#define IBasicVideo2_get_SourceHeight(This,pSourceHeight) \ - (This)->lpVtbl -> get_SourceHeight(This,pSourceHeight) - -#define IBasicVideo2_put_DestinationLeft(This,DestinationLeft) \ - (This)->lpVtbl -> put_DestinationLeft(This,DestinationLeft) - -#define IBasicVideo2_get_DestinationLeft(This,pDestinationLeft) \ - (This)->lpVtbl -> get_DestinationLeft(This,pDestinationLeft) - -#define IBasicVideo2_put_DestinationWidth(This,DestinationWidth) \ - (This)->lpVtbl -> put_DestinationWidth(This,DestinationWidth) - -#define IBasicVideo2_get_DestinationWidth(This,pDestinationWidth) \ - (This)->lpVtbl -> get_DestinationWidth(This,pDestinationWidth) - -#define IBasicVideo2_put_DestinationTop(This,DestinationTop) \ - (This)->lpVtbl -> put_DestinationTop(This,DestinationTop) - -#define IBasicVideo2_get_DestinationTop(This,pDestinationTop) \ - (This)->lpVtbl -> get_DestinationTop(This,pDestinationTop) - -#define IBasicVideo2_put_DestinationHeight(This,DestinationHeight) \ - (This)->lpVtbl -> put_DestinationHeight(This,DestinationHeight) - -#define IBasicVideo2_get_DestinationHeight(This,pDestinationHeight) \ - (This)->lpVtbl -> get_DestinationHeight(This,pDestinationHeight) - -#define IBasicVideo2_SetSourcePosition(This,Left,Top,Width,Height) \ - (This)->lpVtbl -> SetSourcePosition(This,Left,Top,Width,Height) - -#define IBasicVideo2_GetSourcePosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetSourcePosition(This,pLeft,pTop,pWidth,pHeight) - -#define IBasicVideo2_SetDefaultSourcePosition(This) \ - (This)->lpVtbl -> SetDefaultSourcePosition(This) - -#define IBasicVideo2_SetDestinationPosition(This,Left,Top,Width,Height) \ - (This)->lpVtbl -> SetDestinationPosition(This,Left,Top,Width,Height) - -#define IBasicVideo2_GetDestinationPosition(This,pLeft,pTop,pWidth,pHeight) \ - (This)->lpVtbl -> GetDestinationPosition(This,pLeft,pTop,pWidth,pHeight) - -#define IBasicVideo2_SetDefaultDestinationPosition(This) \ - (This)->lpVtbl -> SetDefaultDestinationPosition(This) - -#define IBasicVideo2_GetVideoSize(This,pWidth,pHeight) \ - (This)->lpVtbl -> GetVideoSize(This,pWidth,pHeight) - -#define IBasicVideo2_GetVideoPaletteEntries(This,StartIndex,Entries,pRetrieved,pPalette) \ - (This)->lpVtbl -> GetVideoPaletteEntries(This,StartIndex,Entries,pRetrieved,pPalette) - -#define IBasicVideo2_GetCurrentImage(This,pBufferSize,pDIBImage) \ - (This)->lpVtbl -> GetCurrentImage(This,pBufferSize,pDIBImage) - -#define IBasicVideo2_IsUsingDefaultSource(This) \ - (This)->lpVtbl -> IsUsingDefaultSource(This) - -#define IBasicVideo2_IsUsingDefaultDestination(This) \ - (This)->lpVtbl -> IsUsingDefaultDestination(This) - - -#define IBasicVideo2_GetPreferredAspectRatio(This,plAspectX,plAspectY) \ - (This)->lpVtbl -> GetPreferredAspectRatio(This,plAspectX,plAspectY) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBasicVideo2_GetPreferredAspectRatio_Proxy( - IBasicVideo2 * This, - /* [out] */ long *plAspectX, - /* [out] */ long *plAspectY); - - -void __RPC_STUB IBasicVideo2_GetPreferredAspectRatio_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBasicVideo2_INTERFACE_DEFINED__ */ - - -#ifndef __IDeferredCommand_INTERFACE_DEFINED__ -#define __IDeferredCommand_INTERFACE_DEFINED__ - -/* interface IDeferredCommand */ -/* [object][helpstring][uuid] */ - - -DEFINE_GUID(IID_IDeferredCommand,0x56a868b8,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b8-0ad4-11ce-b03a-0020af0ba770") - IDeferredCommand : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Cancel( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Confidence( - /* [out] */ LONG *pConfidence) = 0; - - virtual HRESULT STDMETHODCALLTYPE Postpone( - /* [in] */ REFTIME newtime) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetHResult( - /* [out] */ HRESULT *phrResult) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDeferredCommandVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDeferredCommand * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDeferredCommand * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDeferredCommand * This); - - HRESULT ( STDMETHODCALLTYPE *Cancel )( - IDeferredCommand * This); - - HRESULT ( STDMETHODCALLTYPE *Confidence )( - IDeferredCommand * This, - /* [out] */ LONG *pConfidence); - - HRESULT ( STDMETHODCALLTYPE *Postpone )( - IDeferredCommand * This, - /* [in] */ REFTIME newtime); - - HRESULT ( STDMETHODCALLTYPE *GetHResult )( - IDeferredCommand * This, - /* [out] */ HRESULT *phrResult); - - END_INTERFACE - } IDeferredCommandVtbl; - - interface IDeferredCommand - { - CONST_VTBL struct IDeferredCommandVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDeferredCommand_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDeferredCommand_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDeferredCommand_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDeferredCommand_Cancel(This) \ - (This)->lpVtbl -> Cancel(This) - -#define IDeferredCommand_Confidence(This,pConfidence) \ - (This)->lpVtbl -> Confidence(This,pConfidence) - -#define IDeferredCommand_Postpone(This,newtime) \ - (This)->lpVtbl -> Postpone(This,newtime) - -#define IDeferredCommand_GetHResult(This,phrResult) \ - (This)->lpVtbl -> GetHResult(This,phrResult) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDeferredCommand_Cancel_Proxy( - IDeferredCommand * This); - - -void __RPC_STUB IDeferredCommand_Cancel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDeferredCommand_Confidence_Proxy( - IDeferredCommand * This, - /* [out] */ LONG *pConfidence); - - -void __RPC_STUB IDeferredCommand_Confidence_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDeferredCommand_Postpone_Proxy( - IDeferredCommand * This, - /* [in] */ REFTIME newtime); - - -void __RPC_STUB IDeferredCommand_Postpone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDeferredCommand_GetHResult_Proxy( - IDeferredCommand * This, - /* [out] */ HRESULT *phrResult); - - -void __RPC_STUB IDeferredCommand_GetHResult_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDeferredCommand_INTERFACE_DEFINED__ */ - - -#ifndef __IQueueCommand_INTERFACE_DEFINED__ -#define __IQueueCommand_INTERFACE_DEFINED__ - -/* interface IQueueCommand */ -/* [object][helpstring][uuid] */ - - -DEFINE_GUID(IID_IQueueCommand,0x56a868b7,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868b7-0ad4-11ce-b03a-0020af0ba770") - IQueueCommand : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InvokeAtStreamTime( - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr) = 0; - - virtual HRESULT STDMETHODCALLTYPE InvokeAtPresentationTime( - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr) = 0; - - }; - -#else /* C style interface */ - - typedef struct IQueueCommandVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IQueueCommand * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IQueueCommand * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IQueueCommand * This); - - HRESULT ( STDMETHODCALLTYPE *InvokeAtStreamTime )( - IQueueCommand * This, - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *InvokeAtPresentationTime )( - IQueueCommand * This, - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr); - - END_INTERFACE - } IQueueCommandVtbl; - - interface IQueueCommand - { - CONST_VTBL struct IQueueCommandVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IQueueCommand_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IQueueCommand_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IQueueCommand_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IQueueCommand_InvokeAtStreamTime(This,pCmd,time,iid,dispidMethod,wFlags,cArgs,pDispParams,pvarResult,puArgErr) \ - (This)->lpVtbl -> InvokeAtStreamTime(This,pCmd,time,iid,dispidMethod,wFlags,cArgs,pDispParams,pvarResult,puArgErr) - -#define IQueueCommand_InvokeAtPresentationTime(This,pCmd,time,iid,dispidMethod,wFlags,cArgs,pDispParams,pvarResult,puArgErr) \ - (This)->lpVtbl -> InvokeAtPresentationTime(This,pCmd,time,iid,dispidMethod,wFlags,cArgs,pDispParams,pvarResult,puArgErr) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IQueueCommand_InvokeAtStreamTime_Proxy( - IQueueCommand * This, - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr); - - -void __RPC_STUB IQueueCommand_InvokeAtStreamTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IQueueCommand_InvokeAtPresentationTime_Proxy( - IQueueCommand * This, - /* [out] */ IDeferredCommand **pCmd, - /* [in] */ REFTIME time, - /* [in] */ GUID *iid, - /* [in] */ long dispidMethod, - /* [in] */ short wFlags, - /* [in] */ long cArgs, - /* [in] */ VARIANT *pDispParams, - /* [out][in] */ VARIANT *pvarResult, - /* [out] */ short *puArgErr); - - -void __RPC_STUB IQueueCommand_InvokeAtPresentationTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IQueueCommand_INTERFACE_DEFINED__ */ - - -DEFINE_GUID(CLSID_FilgraphManager,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#ifdef __cplusplus - -class DECLSPEC_UUID("e436ebb3-524f-11ce-9f53-0020af0ba770") -FilgraphManager; -#endif - -#ifndef __IFilterInfo_INTERFACE_DEFINED__ -#define __IFilterInfo_INTERFACE_DEFINED__ - -/* interface IFilterInfo */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IFilterInfo,0x56a868ba,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868ba-0ad4-11ce-b03a-0020af0ba770") - IFilterInfo : public IDispatch - { - public: - virtual HRESULT STDMETHODCALLTYPE FindPin( - /* [in] */ BSTR strPinID, - /* [out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Name( - /* [retval][out] */ BSTR *strName) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VendorInfo( - /* [retval][out] */ BSTR *strVendorInfo) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Filter( - /* [retval][out] */ IUnknown **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Pins( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsFileSource( - /* [retval][out] */ LONG *pbIsSource) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Filename( - /* [retval][out] */ BSTR *pstrFilename) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Filename( - /* [in] */ BSTR strFilename) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IFilterInfo * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IFilterInfo * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IFilterInfo * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IFilterInfo * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *FindPin )( - IFilterInfo * This, - /* [in] */ BSTR strPinID, - /* [out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( - IFilterInfo * This, - /* [retval][out] */ BSTR *strName); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VendorInfo )( - IFilterInfo * This, - /* [retval][out] */ BSTR *strVendorInfo); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filter )( - IFilterInfo * This, - /* [retval][out] */ IUnknown **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Pins )( - IFilterInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsFileSource )( - IFilterInfo * This, - /* [retval][out] */ LONG *pbIsSource); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filename )( - IFilterInfo * This, - /* [retval][out] */ BSTR *pstrFilename); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filename )( - IFilterInfo * This, - /* [in] */ BSTR strFilename); - - END_INTERFACE - } IFilterInfoVtbl; - - interface IFilterInfo - { - CONST_VTBL struct IFilterInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterInfo_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IFilterInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IFilterInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IFilterInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IFilterInfo_FindPin(This,strPinID,ppUnk) \ - (This)->lpVtbl -> FindPin(This,strPinID,ppUnk) - -#define IFilterInfo_get_Name(This,strName) \ - (This)->lpVtbl -> get_Name(This,strName) - -#define IFilterInfo_get_VendorInfo(This,strVendorInfo) \ - (This)->lpVtbl -> get_VendorInfo(This,strVendorInfo) - -#define IFilterInfo_get_Filter(This,ppUnk) \ - (This)->lpVtbl -> get_Filter(This,ppUnk) - -#define IFilterInfo_get_Pins(This,ppUnk) \ - (This)->lpVtbl -> get_Pins(This,ppUnk) - -#define IFilterInfo_get_IsFileSource(This,pbIsSource) \ - (This)->lpVtbl -> get_IsFileSource(This,pbIsSource) - -#define IFilterInfo_get_Filename(This,pstrFilename) \ - (This)->lpVtbl -> get_Filename(This,pstrFilename) - -#define IFilterInfo_put_Filename(This,strFilename) \ - (This)->lpVtbl -> put_Filename(This,strFilename) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterInfo_FindPin_Proxy( - IFilterInfo * This, - /* [in] */ BSTR strPinID, - /* [out] */ IDispatch **ppUnk); - - -void __RPC_STUB IFilterInfo_FindPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_Name_Proxy( - IFilterInfo * This, - /* [retval][out] */ BSTR *strName); - - -void __RPC_STUB IFilterInfo_get_Name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_VendorInfo_Proxy( - IFilterInfo * This, - /* [retval][out] */ BSTR *strVendorInfo); - - -void __RPC_STUB IFilterInfo_get_VendorInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_Filter_Proxy( - IFilterInfo * This, - /* [retval][out] */ IUnknown **ppUnk); - - -void __RPC_STUB IFilterInfo_get_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_Pins_Proxy( - IFilterInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IFilterInfo_get_Pins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_IsFileSource_Proxy( - IFilterInfo * This, - /* [retval][out] */ LONG *pbIsSource); - - -void __RPC_STUB IFilterInfo_get_IsFileSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IFilterInfo_get_Filename_Proxy( - IFilterInfo * This, - /* [retval][out] */ BSTR *pstrFilename); - - -void __RPC_STUB IFilterInfo_get_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput] */ HRESULT STDMETHODCALLTYPE IFilterInfo_put_Filename_Proxy( - IFilterInfo * This, - /* [in] */ BSTR strFilename); - - -void __RPC_STUB IFilterInfo_put_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IRegFilterInfo_INTERFACE_DEFINED__ -#define __IRegFilterInfo_INTERFACE_DEFINED__ - -/* interface IRegFilterInfo */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IRegFilterInfo,0x56a868bb,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868bb-0ad4-11ce-b03a-0020af0ba770") - IRegFilterInfo : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Name( - /* [retval][out] */ BSTR *strName) = 0; - - virtual HRESULT STDMETHODCALLTYPE Filter( - /* [out] */ IDispatch **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IRegFilterInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRegFilterInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRegFilterInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRegFilterInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IRegFilterInfo * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IRegFilterInfo * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IRegFilterInfo * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IRegFilterInfo * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( - IRegFilterInfo * This, - /* [retval][out] */ BSTR *strName); - - HRESULT ( STDMETHODCALLTYPE *Filter )( - IRegFilterInfo * This, - /* [out] */ IDispatch **ppUnk); - - END_INTERFACE - } IRegFilterInfoVtbl; - - interface IRegFilterInfo - { - CONST_VTBL struct IRegFilterInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IRegFilterInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IRegFilterInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IRegFilterInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IRegFilterInfo_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IRegFilterInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IRegFilterInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IRegFilterInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IRegFilterInfo_get_Name(This,strName) \ - (This)->lpVtbl -> get_Name(This,strName) - -#define IRegFilterInfo_Filter(This,ppUnk) \ - (This)->lpVtbl -> Filter(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IRegFilterInfo_get_Name_Proxy( - IRegFilterInfo * This, - /* [retval][out] */ BSTR *strName); - - -void __RPC_STUB IRegFilterInfo_get_Name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRegFilterInfo_Filter_Proxy( - IRegFilterInfo * This, - /* [out] */ IDispatch **ppUnk); - - -void __RPC_STUB IRegFilterInfo_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IRegFilterInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaTypeInfo_INTERFACE_DEFINED__ -#define __IMediaTypeInfo_INTERFACE_DEFINED__ - -/* interface IMediaTypeInfo */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IMediaTypeInfo,0x56a868bc,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868bc-0ad4-11ce-b03a-0020af0ba770") - IMediaTypeInfo : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Type( - /* [retval][out] */ BSTR *strType) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Subtype( - /* [retval][out] */ BSTR *strType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaTypeInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaTypeInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaTypeInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaTypeInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMediaTypeInfo * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMediaTypeInfo * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMediaTypeInfo * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMediaTypeInfo * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( - IMediaTypeInfo * This, - /* [retval][out] */ BSTR *strType); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Subtype )( - IMediaTypeInfo * This, - /* [retval][out] */ BSTR *strType); - - END_INTERFACE - } IMediaTypeInfoVtbl; - - interface IMediaTypeInfo - { - CONST_VTBL struct IMediaTypeInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaTypeInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaTypeInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaTypeInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaTypeInfo_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMediaTypeInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMediaTypeInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMediaTypeInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMediaTypeInfo_get_Type(This,strType) \ - (This)->lpVtbl -> get_Type(This,strType) - -#define IMediaTypeInfo_get_Subtype(This,strType) \ - (This)->lpVtbl -> get_Subtype(This,strType) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaTypeInfo_get_Type_Proxy( - IMediaTypeInfo * This, - /* [retval][out] */ BSTR *strType); - - -void __RPC_STUB IMediaTypeInfo_get_Type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IMediaTypeInfo_get_Subtype_Proxy( - IMediaTypeInfo * This, - /* [retval][out] */ BSTR *strType); - - -void __RPC_STUB IMediaTypeInfo_get_Subtype_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaTypeInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IPinInfo_INTERFACE_DEFINED__ -#define __IPinInfo_INTERFACE_DEFINED__ - -/* interface IPinInfo */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IPinInfo,0x56a868bd,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868bd-0ad4-11ce-b03a-0020af0ba770") - IPinInfo : public IDispatch - { - public: - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Pin( - /* [retval][out] */ IUnknown **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ConnectedTo( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ConnectionMediaType( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_FilterInfo( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Name( - /* [retval][out] */ BSTR *ppUnk) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Direction( - /* [retval][out] */ LONG *ppDirection) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PinID( - /* [retval][out] */ BSTR *strPinID) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_MediaTypes( - /* [retval][out] */ IDispatch **ppUnk) = 0; - - virtual HRESULT STDMETHODCALLTYPE Connect( - /* [in] */ IUnknown *pPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectDirect( - /* [in] */ IUnknown *pPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectWithType( - /* [in] */ IUnknown *pPin, - /* [in] */ IDispatch *pMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE Disconnect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Render( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPinInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPinInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPinInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPinInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IPinInfo * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IPinInfo * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IPinInfo * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IPinInfo * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Pin )( - IPinInfo * This, - /* [retval][out] */ IUnknown **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedTo )( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionMediaType )( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_FilterInfo )( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( - IPinInfo * This, - /* [retval][out] */ BSTR *ppUnk); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Direction )( - IPinInfo * This, - /* [retval][out] */ LONG *ppDirection); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PinID )( - IPinInfo * This, - /* [retval][out] */ BSTR *strPinID); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaTypes )( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - HRESULT ( STDMETHODCALLTYPE *Connect )( - IPinInfo * This, - /* [in] */ IUnknown *pPin); - - HRESULT ( STDMETHODCALLTYPE *ConnectDirect )( - IPinInfo * This, - /* [in] */ IUnknown *pPin); - - HRESULT ( STDMETHODCALLTYPE *ConnectWithType )( - IPinInfo * This, - /* [in] */ IUnknown *pPin, - /* [in] */ IDispatch *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *Disconnect )( - IPinInfo * This); - - HRESULT ( STDMETHODCALLTYPE *Render )( - IPinInfo * This); - - END_INTERFACE - } IPinInfoVtbl; - - interface IPinInfo - { - CONST_VTBL struct IPinInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPinInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPinInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPinInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPinInfo_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IPinInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IPinInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IPinInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IPinInfo_get_Pin(This,ppUnk) \ - (This)->lpVtbl -> get_Pin(This,ppUnk) - -#define IPinInfo_get_ConnectedTo(This,ppUnk) \ - (This)->lpVtbl -> get_ConnectedTo(This,ppUnk) - -#define IPinInfo_get_ConnectionMediaType(This,ppUnk) \ - (This)->lpVtbl -> get_ConnectionMediaType(This,ppUnk) - -#define IPinInfo_get_FilterInfo(This,ppUnk) \ - (This)->lpVtbl -> get_FilterInfo(This,ppUnk) - -#define IPinInfo_get_Name(This,ppUnk) \ - (This)->lpVtbl -> get_Name(This,ppUnk) - -#define IPinInfo_get_Direction(This,ppDirection) \ - (This)->lpVtbl -> get_Direction(This,ppDirection) - -#define IPinInfo_get_PinID(This,strPinID) \ - (This)->lpVtbl -> get_PinID(This,strPinID) - -#define IPinInfo_get_MediaTypes(This,ppUnk) \ - (This)->lpVtbl -> get_MediaTypes(This,ppUnk) - -#define IPinInfo_Connect(This,pPin) \ - (This)->lpVtbl -> Connect(This,pPin) - -#define IPinInfo_ConnectDirect(This,pPin) \ - (This)->lpVtbl -> ConnectDirect(This,pPin) - -#define IPinInfo_ConnectWithType(This,pPin,pMediaType) \ - (This)->lpVtbl -> ConnectWithType(This,pPin,pMediaType) - -#define IPinInfo_Disconnect(This) \ - (This)->lpVtbl -> Disconnect(This) - -#define IPinInfo_Render(This) \ - (This)->lpVtbl -> Render(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_Pin_Proxy( - IPinInfo * This, - /* [retval][out] */ IUnknown **ppUnk); - - -void __RPC_STUB IPinInfo_get_Pin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_ConnectedTo_Proxy( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IPinInfo_get_ConnectedTo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_ConnectionMediaType_Proxy( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IPinInfo_get_ConnectionMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_FilterInfo_Proxy( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IPinInfo_get_FilterInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_Name_Proxy( - IPinInfo * This, - /* [retval][out] */ BSTR *ppUnk); - - -void __RPC_STUB IPinInfo_get_Name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_Direction_Proxy( - IPinInfo * This, - /* [retval][out] */ LONG *ppDirection); - - -void __RPC_STUB IPinInfo_get_Direction_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_PinID_Proxy( - IPinInfo * This, - /* [retval][out] */ BSTR *strPinID); - - -void __RPC_STUB IPinInfo_get_PinID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IPinInfo_get_MediaTypes_Proxy( - IPinInfo * This, - /* [retval][out] */ IDispatch **ppUnk); - - -void __RPC_STUB IPinInfo_get_MediaTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinInfo_Connect_Proxy( - IPinInfo * This, - /* [in] */ IUnknown *pPin); - - -void __RPC_STUB IPinInfo_Connect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinInfo_ConnectDirect_Proxy( - IPinInfo * This, - /* [in] */ IUnknown *pPin); - - -void __RPC_STUB IPinInfo_ConnectDirect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinInfo_ConnectWithType_Proxy( - IPinInfo * This, - /* [in] */ IUnknown *pPin, - /* [in] */ IDispatch *pMediaType); - - -void __RPC_STUB IPinInfo_ConnectWithType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinInfo_Disconnect_Proxy( - IPinInfo * This); - - -void __RPC_STUB IPinInfo_Disconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinInfo_Render_Proxy( - IPinInfo * This); - - -void __RPC_STUB IPinInfo_Render_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPinInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IAMStats_INTERFACE_DEFINED__ -#define __IAMStats_INTERFACE_DEFINED__ - -/* interface IAMStats */ -/* [object][dual][oleautomation][helpstring][uuid] */ - - -DEFINE_GUID(IID_IAMStats,0xbc9bcf80,0xdcd2,0x11d2,0xab,0xf6,0x00,0xa0,0xc9,0x05,0xf3,0x75); - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("bc9bcf80-dcd2-11d2-abf6-00a0c905f375") - IAMStats : public IDispatch - { - public: - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ LONG *plCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetValueByIndex( - /* [in] */ long lIndex, - /* [out] */ BSTR *szName, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetValueByName( - /* [in] */ BSTR szName, - /* [out] */ long *lIndex, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIndex( - /* [in] */ BSTR szName, - /* [in] */ long lCreate, - /* [out] */ long *plIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddValue( - /* [in] */ long lIndex, - /* [in] */ double dValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMStatsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMStats * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMStats * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMStats * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAMStats * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAMStats * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAMStats * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAMStats * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IAMStats * This); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IAMStats * This, - /* [retval][out] */ LONG *plCount); - - HRESULT ( STDMETHODCALLTYPE *GetValueByIndex )( - IAMStats * This, - /* [in] */ long lIndex, - /* [out] */ BSTR *szName, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax); - - HRESULT ( STDMETHODCALLTYPE *GetValueByName )( - IAMStats * This, - /* [in] */ BSTR szName, - /* [out] */ long *lIndex, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax); - - HRESULT ( STDMETHODCALLTYPE *GetIndex )( - IAMStats * This, - /* [in] */ BSTR szName, - /* [in] */ long lCreate, - /* [out] */ long *plIndex); - - HRESULT ( STDMETHODCALLTYPE *AddValue )( - IAMStats * This, - /* [in] */ long lIndex, - /* [in] */ double dValue); - - END_INTERFACE - } IAMStatsVtbl; - - interface IAMStats - { - CONST_VTBL struct IAMStatsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMStats_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMStats_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMStats_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMStats_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IAMStats_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IAMStats_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IAMStats_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IAMStats_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IAMStats_get_Count(This,plCount) \ - (This)->lpVtbl -> get_Count(This,plCount) - -#define IAMStats_GetValueByIndex(This,lIndex,szName,lCount,dLast,dAverage,dStdDev,dMin,dMax) \ - (This)->lpVtbl -> GetValueByIndex(This,lIndex,szName,lCount,dLast,dAverage,dStdDev,dMin,dMax) - -#define IAMStats_GetValueByName(This,szName,lIndex,lCount,dLast,dAverage,dStdDev,dMin,dMax) \ - (This)->lpVtbl -> GetValueByName(This,szName,lIndex,lCount,dLast,dAverage,dStdDev,dMin,dMax) - -#define IAMStats_GetIndex(This,szName,lCreate,plIndex) \ - (This)->lpVtbl -> GetIndex(This,szName,lCreate,plIndex) - -#define IAMStats_AddValue(This,lIndex,dValue) \ - (This)->lpVtbl -> AddValue(This,lIndex,dValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMStats_Reset_Proxy( - IAMStats * This); - - -void __RPC_STUB IAMStats_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget] */ HRESULT STDMETHODCALLTYPE IAMStats_get_Count_Proxy( - IAMStats * This, - /* [retval][out] */ LONG *plCount); - - -void __RPC_STUB IAMStats_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStats_GetValueByIndex_Proxy( - IAMStats * This, - /* [in] */ long lIndex, - /* [out] */ BSTR *szName, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax); - - -void __RPC_STUB IAMStats_GetValueByIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStats_GetValueByName_Proxy( - IAMStats * This, - /* [in] */ BSTR szName, - /* [out] */ long *lIndex, - /* [out] */ long *lCount, - /* [out] */ double *dLast, - /* [out] */ double *dAverage, - /* [out] */ double *dStdDev, - /* [out] */ double *dMin, - /* [out] */ double *dMax); - - -void __RPC_STUB IAMStats_GetValueByName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStats_GetIndex_Proxy( - IAMStats * This, - /* [in] */ BSTR szName, - /* [in] */ long lCreate, - /* [out] */ long *plIndex); - - -void __RPC_STUB IAMStats_GetIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStats_AddValue_Proxy( - IAMStats * This, - /* [in] */ long lIndex, - /* [in] */ double dValue); - - -void __RPC_STUB IAMStats_AddValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMStats_INTERFACE_DEFINED__ */ - -#endif /* __QuartzTypeLib_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/d3d.h b/import/DirectX8/include/d3d.h deleted file mode 100644 index eea7dff4f..000000000 --- a/import/DirectX8/include/d3d.h +++ /dev/null @@ -1,1688 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _D3D_H_ -#define _D3D_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -// include this file content only if compiling for <=DX7 interfaces -#if(DIRECT3D_VERSION < 0x0800) - - -#include - -#define COM_NO_WINDOWS_H -#include - -#define D3DAPI WINAPI - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) -DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3D3, 0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3D7, 0xf5049e77,0x4861,0x11d2,0xa4,0x7,0x0,0xa0,0xc9,0x6,0x29,0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DRefDevice, 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -DEFINE_GUID( IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DTnLHalDevice, 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer - */ - -DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DDevice3, 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DDevice7, 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); - -DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DMaterial3, 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x0, 0x60, 0x8, 0x52, 0xb3, 0x12); -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -#if(DIRECT3D_VERSION >= 0x0500) -DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DViewport3, 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0600) -DEFINE_GUID( IID_IDirect3DVertexBuffer, 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x0, 0xa0, 0xc9, 0x3, 0x67, 0xf8); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -DEFINE_GUID( IID_IDirect3DVertexBuffer7, 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#endif - -#ifdef __cplusplus -struct IDirect3D; -struct IDirect3DDevice; -struct IDirect3DLight; -struct IDirect3DMaterial; -struct IDirect3DExecuteBuffer; -struct IDirect3DTexture; -struct IDirect3DViewport; -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -struct IDirect3D2; -struct IDirect3DDevice2; -struct IDirect3DMaterial2; -struct IDirect3DTexture2; -struct IDirect3DViewport2; -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -struct IDirect3D3; -struct IDirect3DDevice3; -struct IDirect3DMaterial3; -struct IDirect3DViewport3; -struct IDirect3DVertexBuffer; -typedef struct IDirect3D3 *LPDIRECT3D3; -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -struct IDirect3D7; -struct IDirect3DDevice7; -struct IDirect3DVertexBuffer7; -typedef struct IDirect3D7 *LPDIRECT3D7; -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#else - -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -typedef struct IDirect3D3 *LPDIRECT3D3; -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct IDirect3D7 *LPDIRECT3D7; -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif - -#include "d3dtypes.h" -#include "d3dcaps.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Direct3D interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3D - -DECLARE_INTERFACE_(IDirect3D, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D methods ***/ - STDMETHOD(Initialize)(THIS_ REFCLSID) PURE; - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*,IUnknown*) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*,IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; -}; - -typedef struct IDirect3D *LPDIRECT3D; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#else -#define IDirect3D_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D_AddRef(p) (p)->AddRef() -#define IDirect3D_Release(p) (p)->Release() -#define IDirect3D_Initialize(p,a) (p)->Initialize(a) -#define IDirect3D_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D_FindDevice(p,a,b) (p)->FindDevice(a,b) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3D2 - -DECLARE_INTERFACE_(IDirect3D2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D2 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL2*,IUnknown*) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT2*,IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE,LPDIRECT3DDEVICE2*) PURE; -}; - -typedef struct IDirect3D2 *LPDIRECT3D2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D2_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D2_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D2_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D2_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#define IDirect3D2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#else -#define IDirect3D2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D2_AddRef(p) (p)->AddRef() -#define IDirect3D2_Release(p) (p)->Release() -#define IDirect3D2_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D2_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D2_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D2_FindDevice(p,a,b) (p)->FindDevice(a,b) -#define IDirect3D2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3D3 - -DECLARE_INTERFACE_(IDirect3D3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D3 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; - STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,LPUNKNOWN) PURE; - STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL3*,LPUNKNOWN) PURE; - STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT3*,LPUNKNOWN) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE4,LPDIRECT3DDEVICE3*,LPUNKNOWN) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER*,DWORD,LPUNKNOWN) PURE; - STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(EvictManagedTextures)(THIS) PURE; -}; - -typedef struct IDirect3D3 *LPDIRECT3D3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D3_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D3_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) -#define IDirect3D3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) -#define IDirect3D3_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) -#define IDirect3D3_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) -#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d) -#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d) -#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) -#define IDirect3D3_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) -#else -#define IDirect3D3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D3_AddRef(p) (p)->AddRef() -#define IDirect3D3_Release(p) (p)->Release() -#define IDirect3D3_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D3_CreateLight(p,a,b) (p)->CreateLight(a,b) -#define IDirect3D3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) -#define IDirect3D3_CreateViewport(p,a,b) (p)->CreateViewport(a,b) -#define IDirect3D3_FindDevice(p,a,b) (p)->FindDevice(a,b) -#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->CreateDevice(a,b,c,d) -#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->CreateVertexBuffer(a,b,c,d) -#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) -#define IDirect3D3_EvictManagedTextures(p) (p)->EvictManagedTextures() -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3D7 - -DECLARE_INTERFACE_(IDirect3D7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D7 methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK7,LPVOID) PURE; - STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE7,LPDIRECT3DDEVICE7*) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER7*,DWORD) PURE; - STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(EvictManagedTextures)(THIS) PURE; -}; - -typedef struct IDirect3D7 *LPDIRECT3D7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D7_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) -#define IDirect3D7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c) -#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) -#define IDirect3D7_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) -#else -#define IDirect3D7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D7_AddRef(p) (p)->AddRef() -#define IDirect3D7_Release(p) (p)->Release() -#define IDirect3D7_EnumDevices(p,a,b) (p)->EnumDevices(a,b) -#define IDirect3D7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->CreateVertexBuffer(a,b,c) -#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) -#define IDirect3D7_EvictManagedTextures(p) (p)->EvictManagedTextures() -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ -/* - * Direct3D Device interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DDevice - -DECLARE_INTERFACE_(IDirect3DDevice, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D,LPGUID,LPD3DDEVICEDESC) PURE; - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE) PURE; - STDMETHOD(CreateExecuteBuffer)(THIS_ LPD3DEXECUTEBUFFERDESC,LPDIRECT3DEXECUTEBUFFER*,IUnknown*) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(Execute)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT,LPDIRECT3DVIEWPORT*,DWORD) PURE; - STDMETHOD(Pick)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT) PURE; - STDMETHOD(GetPickRecords)(THIS_ LPDWORD,LPD3DPICKRECORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(CreateMatrix)(THIS_ LPD3DMATRIXHANDLE) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DMATRIXHANDLE,const LPD3DMATRIX) PURE; - STDMETHOD(GetMatrix)(THIS_ D3DMATRIXHANDLE,LPD3DMATRIX) PURE; - STDMETHOD(DeleteMatrix)(THIS_ D3DMATRIXHANDLE) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D*) PURE; -}; - -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirect3DDevice_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) -#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->lpVtbl->CreateExecuteBuffer(p,a,b,c) -#define IDirect3DDevice_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice_Execute(p,a,b,c) (p)->lpVtbl->Execute(p,a,b,c) -#define IDirect3DDevice_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->lpVtbl->Pick(p,a,b,c,d) -#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->lpVtbl->GetPickRecords(p,a,b) -#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice_CreateMatrix(p,a) (p)->lpVtbl->CreateMatrix(p,a) -#define IDirect3DDevice_SetMatrix(p,a,b) (p)->lpVtbl->SetMatrix(p,a,b) -#define IDirect3DDevice_GetMatrix(p,a,b) (p)->lpVtbl->GetMatrix(p,a,b) -#define IDirect3DDevice_DeleteMatrix(p,a) (p)->lpVtbl->DeleteMatrix(p,a) -#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#else -#define IDirect3DDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice_AddRef(p) (p)->AddRef() -#define IDirect3DDevice_Release(p) (p)->Release() -#define IDirect3DDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirect3DDevice_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) -#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->CreateExecuteBuffer(a,b,c) -#define IDirect3DDevice_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice_Execute(p,a,b,c) (p)->Execute(a,b,c) -#define IDirect3DDevice_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->Pick(a,b,c,d) -#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->GetPickRecords(a,b) -#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice_CreateMatrix(p,a) (p)->CreateMatrix(a) -#define IDirect3DDevice_SetMatrix(p,a,b) (p)->SetMatrix(a,b) -#define IDirect3DDevice_GetMatrix(p,a,b) (p)->GetMatrix(a,b) -#define IDirect3DDevice_DeleteMatrix(p,a) (p)->DeleteMatrix(a) -#define IDirect3DDevice_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice_EndScene(p) (p)->EndScene() -#define IDirect3DDevice_GetDirect3D(p,a) (p)->GetDirect3D(a) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DDevice2 - -DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice2 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE2,LPDIRECT3DTEXTURE2) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT2,LPDIRECT3DVIEWPORT2*,DWORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D2*) PURE; - STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 *) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,DWORD) PURE; - STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(Vertex)(THIS_ LPVOID) PURE; - STDMETHOD(Index)(THIS_ WORD) PURE; - STDMETHOD(End)(THIS_ DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; -}; - -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) -#define IDirect3DDevice2_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice2_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice2_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice2_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) -#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) -#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice2_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) -#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) -#define IDirect3DDevice2_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) -#define IDirect3DDevice2_Index(p,a) (p)->lpVtbl->Index(p,a) -#define IDirect3DDevice2_End(p,a) (p)->lpVtbl->End(p,a) -#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice2_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) -#define IDirect3DDevice2_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) -#define IDirect3DDevice2_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice2_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice2_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice2_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#else -#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice2_AddRef(p) (p)->AddRef() -#define IDirect3DDevice2_Release(p) (p)->Release() -#define IDirect3DDevice2_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) -#define IDirect3DDevice2_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice2_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice2_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice2_EndScene(p) (p)->EndScene() -#define IDirect3DDevice2_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) -#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) -#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice2_Begin(p,a,b,c) (p)->Begin(a,b,c) -#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) -#define IDirect3DDevice2_Vertex(p,a) (p)->Vertex(a) -#define IDirect3DDevice2_Index(p,a) (p)->Index(a) -#define IDirect3DDevice2_End(p,a) (p)->End(a) -#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice2_GetLightState(p,a,b) (p)->GetLightState(a,b) -#define IDirect3DDevice2_SetLightState(p,a,b) (p)->SetLightState(a,b) -#define IDirect3DDevice2_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice2_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice2_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice2_GetClipStatus(p,a) (p)->GetClipStatus(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DDevice3 - -DECLARE_INTERFACE_(IDirect3DDevice3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice3 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; - STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; - STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT3,LPDIRECT3DVIEWPORT3*,DWORD) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D3*) PURE; - STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; - STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 *) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 *) PURE; - STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,DWORD,DWORD) PURE; - STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(Vertex)(THIS_ LPVOID) PURE; - STDMETHOD(Index)(THIS_ WORD) PURE; - STDMETHOD(End)(THIS_ DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; - STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,DWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2 *) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; - STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; -}; - -typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirect3DDevice3_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) -#define IDirect3DDevice3_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) -#define IDirect3DDevice3_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) -#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) -#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice3_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice3_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice3_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) -#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) -#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice3_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) -#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) -#define IDirect3DDevice3_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) -#define IDirect3DDevice3_Index(p,a) (p)->lpVtbl->Index(p,a) -#define IDirect3DDevice3_End(p,a) (p)->lpVtbl->End(p,a) -#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice3_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) -#define IDirect3DDevice3_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) -#define IDirect3DDevice3_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice3_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice3_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice3_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) -#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) -#define IDirect3DDevice3_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice3_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice3_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#else -#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice3_AddRef(p) (p)->AddRef() -#define IDirect3DDevice3_Release(p) (p)->Release() -#define IDirect3DDevice3_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirect3DDevice3_GetStats(p,a) (p)->GetStats(a) -#define IDirect3DDevice3_AddViewport(p,a) (p)->AddViewport(a) -#define IDirect3DDevice3_DeleteViewport(p,a) (p)->DeleteViewport(a) -#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) -#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice3_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice3_EndScene(p) (p)->EndScene() -#define IDirect3DDevice3_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) -#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) -#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice3_Begin(p,a,b,c) (p)->Begin(a,b,c) -#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) -#define IDirect3DDevice3_Vertex(p,a) (p)->Vertex(a) -#define IDirect3DDevice3_Index(p,a) (p)->Index(a) -#define IDirect3DDevice3_End(p,a) (p)->End(a) -#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice3_GetLightState(p,a,b) (p)->GetLightState(a,b) -#define IDirect3DDevice3_SetLightState(p,a,b) (p)->SetLightState(a,b) -#define IDirect3DDevice3_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice3_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice3_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice3_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) -#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) -#define IDirect3DDevice3_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice3_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice3_ValidateDevice(p,a) (p)->ValidateDevice(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3DDevice7 - -DECLARE_INTERFACE_(IDirect3DDevice7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice7 methods ***/ - STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC7) PURE; - STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D7*) PURE; - STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7,DWORD) PURE; - STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT7) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT7) PURE; - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL7) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL7) PURE; - STDMETHOD(SetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; - STDMETHOD(GetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ LPDWORD) PURE; - STDMETHOD(PreLoad)(THIS_ LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,DWORD) PURE; - STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,LPWORD,DWORD,DWORD) PURE; - STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; - STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; - STDMETHOD(ApplyStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(CaptureStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(DeleteStateBlock)(THIS_ DWORD) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE,LPDWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECTDRAWSURFACE7,LPPOINT,LPDIRECTDRAWSURFACE7,LPRECT,DWORD) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD,BOOL) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD,BOOL*) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; - STDMETHOD(GetInfo)(THIS_ DWORD,LPVOID,DWORD) PURE; -}; - -typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice7_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) -#define IDirect3DDevice7_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice7_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice7_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice7_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice7_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice7_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice7_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice7_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice7_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice7_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice7_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice7_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice7_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice7_PreLoad(p,a) (p)->lpVtbl->PreLoad(p,a) -#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice7_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) -#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) -#define IDirect3DDevice7_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice7_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice7_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) -#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) -#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) -#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) -#define IDirect3DDevice7_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) -#else -#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice7_AddRef(p) (p)->AddRef() -#define IDirect3DDevice7_Release(p) (p)->Release() -#define IDirect3DDevice7_GetCaps(p,a) (p)->GetCaps(a) -#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) -#define IDirect3DDevice7_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice7_EndScene(p) (p)->EndScene() -#define IDirect3DDevice7_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice7_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice7_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice7_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice7_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice7_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice7_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice7_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice7_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice7_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice7_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice7_PreLoad(p,a) (p)->PreLoad(a) -#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) -#define IDirect3DDevice7_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice7_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) -#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) -#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e,f,g) -#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) -#define IDirect3DDevice7_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice7_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice7_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) -#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) -#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) -#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) -#define IDirect3DDevice7_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Execute Buffer interface - */ -#undef INTERFACE -#define INTERFACE IDirect3DExecuteBuffer - -DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DExecuteBuffer methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD(Lock)(THIS_ LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(SetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(GetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(Validate)(THIS_ LPDWORD,LPD3DVALIDATECALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(Optimize)(THIS_ DWORD) PURE; -}; - -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirect3DExecuteBuffer_Lock(p,a) (p)->lpVtbl->Lock(p,a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->lpVtbl->SetExecuteData(p,a) -#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->lpVtbl->GetExecuteData(p,a) -#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->lpVtbl->Validate(p,a,b,c,d) -#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->lpVtbl->Optimize(p,a) -#else -#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef() -#define IDirect3DExecuteBuffer_Release(p) (p)->Release() -#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirect3DExecuteBuffer_Lock(p,a) (p)->Lock(a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock() -#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->SetExecuteData(a) -#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->GetExecuteData(a) -#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->Validate(a,b,c,d) -#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->Optimize(a) -#endif - -/* - * Light interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DLight - -DECLARE_INTERFACE_(IDirect3DLight, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DLight methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetLight)(THIS_ LPD3DLIGHT) PURE; - STDMETHOD(GetLight)(THIS_ LPD3DLIGHT) PURE; -}; - -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DLight_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DLight_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DLight_SetLight(p,a) (p)->lpVtbl->SetLight(p,a) -#define IDirect3DLight_GetLight(p,a) (p)->lpVtbl->GetLight(p,a) -#else -#define IDirect3DLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DLight_AddRef(p) (p)->AddRef() -#define IDirect3DLight_Release(p) (p)->Release() -#define IDirect3DLight_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DLight_SetLight(p,a) (p)->SetLight(a) -#define IDirect3DLight_GetLight(p,a) (p)->GetLight(a) -#endif - -/* - * Material interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DMaterial - -DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DMATERIALHANDLE) PURE; - STDMETHOD(Reserve)(THIS) PURE; - STDMETHOD(Unreserve)(THIS) PURE; -}; - -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DMaterial_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p) -#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p) -#else -#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial_Release(p) (p)->Release() -#define IDirect3DMaterial_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DMaterial_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DMaterial_Reserve(p) (p)->Reserve() -#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve() -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DMaterial2 - -DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial2 methods ***/ - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DMATERIALHANDLE) PURE; -}; - -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial2_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#else -#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial2_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial2_Release(p) (p)->Release() -#define IDirect3DMaterial2_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial2_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->GetHandle(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DMaterial3 - -DECLARE_INTERFACE_(IDirect3DMaterial3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DMaterial3 methods ***/ - STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE3,LPD3DMATERIALHANDLE) PURE; -}; - -typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DMaterial3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DMaterial3_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#else -#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DMaterial3_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial3_Release(p) (p)->Release() -#define IDirect3DMaterial3_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DMaterial3_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->GetHandle(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Texture interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DTexture - -DECLARE_INTERFACE_(IDirect3DTexture, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DTexture methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE) PURE; - STDMETHOD(Unload)(THIS) PURE; -}; - -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirect3DTexture_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) -#define IDirect3DTexture_Load(p,a) (p)->lpVtbl->Load(p,a) -#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p) -#else -#define IDirect3DTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture_AddRef(p) (p)->AddRef() -#define IDirect3DTexture_Release(p) (p)->Release() -#define IDirect3DTexture_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirect3DTexture_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) -#define IDirect3DTexture_Load(p,a) (p)->Load(a) -#define IDirect3DTexture_Unload(p) (p)->Unload() -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DTexture2 - -DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DTexture2 methods ***/ - STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE2) PURE; -}; - -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) -#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) -#define IDirect3DTexture2_Load(p,a) (p)->lpVtbl->Load(p,a) -#else -#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture2_AddRef(p) (p)->AddRef() -#define IDirect3DTexture2_Release(p) (p)->Release() -#define IDirect3DTexture2_GetHandle(p,a,b) (p)->GetHandle(a,b) -#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) -#define IDirect3DTexture2_Load(p,a) (p)->Load(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* - * Viewport interfaces - */ -#undef INTERFACE -#define INTERFACE IDirect3DViewport - -DECLARE_INTERFACE_(IDirect3DViewport, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; -}; - -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#else -#define IDirect3DViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport_AddRef(p) (p)->AddRef() -#define IDirect3DViewport_Release(p) (p)->Release() -#define IDirect3DViewport_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#endif - -#if(DIRECT3D_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirect3DViewport2 - -DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; - STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; -}; - -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport2_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport2_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport2_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport2_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport2_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport2_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport2_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport2_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#define IDirect3DViewport2_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) -#define IDirect3DViewport2_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) -#else -#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport2_AddRef(p) (p)->AddRef() -#define IDirect3DViewport2_Release(p) (p)->Release() -#define IDirect3DViewport2_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport2_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport2_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport2_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport2_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport2_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport2_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport2_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport2_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#define IDirect3DViewport2_GetViewport2(p,a) (p)->GetViewport2(a) -#define IDirect3DViewport2_SetViewport2(p,a) (p)->SetViewport2(a) -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -#undef INTERFACE -#define INTERFACE IDirect3DViewport3 - -DECLARE_INTERFACE_(IDirect3DViewport3, IDirect3DViewport2) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DViewport2 methods ***/ - STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; - STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; - STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; - STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(GetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4*,LPBOOL) PURE; - STDMETHOD(Clear2)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; -}; - -typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DViewport3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport3_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirect3DViewport3_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DViewport3_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) -#define IDirect3DViewport3_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) -#define IDirect3DViewport3_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) -#define IDirect3DViewport3_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) -#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) -#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) -#define IDirect3DViewport3_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) -#define IDirect3DViewport3_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) -#define IDirect3DViewport3_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) -#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) -#define IDirect3DViewport3_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) -#define IDirect3DViewport3_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) -#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->lpVtbl->SetBackgroundDepth2(p,a) -#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->lpVtbl->GetBackgroundDepth2(p,a,b) -#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->lpVtbl->Clear2(p,a,b,c,d,e,f) -#else -#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DViewport3_AddRef(p) (p)->AddRef() -#define IDirect3DViewport3_Release(p) (p)->Release() -#define IDirect3DViewport3_Initialize(p,a) (p)->Initialize(a) -#define IDirect3DViewport3_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DViewport3_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) -#define IDirect3DViewport3_LightElements(p,a,b) (p)->LightElements(a,b) -#define IDirect3DViewport3_SetBackground(p,a) (p)->SetBackground(a) -#define IDirect3DViewport3_GetBackground(p,a,b) (p)->GetBackground(a,b) -#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) -#define IDirect3DViewport3_Clear(p,a,b,c) (p)->Clear(a,b,c) -#define IDirect3DViewport3_AddLight(p,a) (p)->AddLight(a) -#define IDirect3DViewport3_DeleteLight(p,a) (p)->DeleteLight(a) -#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->NextLight(a,b,c) -#define IDirect3DViewport3_GetViewport2(p,a) (p)->GetViewport2(a) -#define IDirect3DViewport3_SetViewport2(p,a) (p)->SetViewport2(a) -#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->SetBackgroundDepth2(a) -#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->GetBackgroundDepth2(a,b) -#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->Clear2(a,b,c,d,e,f) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer - -DECLARE_INTERFACE_(IDirect3DVertexBuffer, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexBuffer methods ***/ - STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER,DWORD,LPDIRECT3DDEVICE3,DWORD) PURE; - STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; - STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE3,DWORD) PURE; -}; - -typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) -#define IDirect3DVertexBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) -#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) -#else -#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer_Release(p) (p)->Release() -#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->Lock(a,b,c) -#define IDirect3DVertexBuffer_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) -#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->Optimize(a,b) -#endif -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer7 - -DECLARE_INTERFACE_(IDirect3DVertexBuffer7, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVertexBuffer7 methods ***/ - STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER7,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; - STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; - STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE7,DWORD) PURE; - STDMETHOD(ProcessVerticesStrided)(THIS_ DWORD,DWORD,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; -}; - -typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer7_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) -#define IDirect3DVertexBuffer7_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) -#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) -#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVerticesStrided(p,a,b,c,d,e,f,g) -#else -#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer7_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer7_Release(p) (p)->Release() -#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->Lock(a,b,c) -#define IDirect3DVertexBuffer7_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) -#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) -#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->Optimize(a,b) -#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g) -#endif -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -/**************************************************************************** - * - * Flags for IDirect3DDevice::NextViewport - * - ****************************************************************************/ - -/* - * Return the next viewport - */ -#define D3DNEXT_NEXT 0x00000001l - -/* - * Return the first viewport - */ -#define D3DNEXT_HEAD 0x00000002l - -/* - * Return the last viewport - */ -#define D3DNEXT_TAIL 0x00000004l - - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * Also valid for VertexBuffer::CreateVertexBuffer - ****************************************************************************/ - -/* - * Wait until the device is ready to draw the primitive - * This will cause DP to not return DDERR_WASSTILLDRAWING - */ -#define D3DDP_WAIT 0x00000001l -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if (DIRECT3D_VERSION == 0x0500) -/* - * Hint that it is acceptable to render the primitive out of order. - */ -#define D3DDP_OUTOFORDER 0x00000002l -#endif - - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Hint that the primitives have been clipped by the application. - */ -#define D3DDP_DONOTCLIP 0x00000004l - -/* - * Hint that the extents need not be updated. - */ -#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -/* - * Hint that the lighting should not be applied on vertices. - */ - -#define D3DDP_DONOTLIGHT 0x00000010l - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Direct3D Errors - * DirectDraw error codes are used when errors not specified here. - */ -#define D3D_OK DD_OK -#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700) -#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701) - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * An invalid device was requested by the application. - */ -#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705) -#define D3DERR_INITFAILED MAKE_DDHRESULT(706) - -/* - * SetRenderTarget attempted on a device that was - * QI'd off the render target. - */ -#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710) -#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711) -#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712) -#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713) -#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714) -#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715) - -#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716) -#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717) - -#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720) -#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721) -#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722) -#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723) -#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724) -#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725) -#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726) -#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727) -#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728) -#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729) - -#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730) -#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731) -#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732) -#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733) -#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735) -#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736) -#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737) -#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738) -#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740) -#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741) -#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742) -#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744) - -#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745) -#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746) -#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750) -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751) -#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760) -#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761) -#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762) -#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763) - -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DERR_INBEGIN MAKE_DDHRESULT(770) -#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771) -#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772) -#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773) -#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774) -#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775) -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DERR_INVALIDVERTEXFORMAT MAKE_DDHRESULT(2048) - -/* - * Attempted to CreateTexture on a surface that had a color key - */ -#define D3DERR_COLORKEYATTACHED MAKE_DDHRESULT(2050) - -#define D3DERR_VERTEXBUFFEROPTIMIZED MAKE_DDHRESULT(2060) -#define D3DERR_VBUF_CREATE_FAILED MAKE_DDHRESULT(2061) -#define D3DERR_VERTEXBUFFERLOCKED MAKE_DDHRESULT(2062) -#define D3DERR_VERTEXBUFFERUNLOCKFAILED MAKE_DDHRESULT(2063) - -#define D3DERR_ZBUFFER_NOTPRESENT MAKE_DDHRESULT(2070) -#define D3DERR_STENCILBUFFER_NOTPRESENT MAKE_DDHRESULT(2071) - -#define D3DERR_WRONGTEXTUREFORMAT MAKE_DDHRESULT(2072) -#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_DDHRESULT(2073) -#define D3DERR_UNSUPPORTEDCOLORARG MAKE_DDHRESULT(2074) -#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_DDHRESULT(2075) -#define D3DERR_UNSUPPORTEDALPHAARG MAKE_DDHRESULT(2076) -#define D3DERR_TOOMANYOPERATIONS MAKE_DDHRESULT(2077) -#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_DDHRESULT(2078) -#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_DDHRESULT(2079) -#define D3DERR_CONFLICTINGRENDERSTATE MAKE_DDHRESULT(2081) -#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_DDHRESULT(2082) -#define D3DERR_TOOMANYPRIMITIVES MAKE_DDHRESULT(2083) -#define D3DERR_INVALIDMATRIX MAKE_DDHRESULT(2084) -#define D3DERR_TOOMANYVERTICES MAKE_DDHRESULT(2085) -#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_DDHRESULT(2086) - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DERR_INVALIDSTATEBLOCK MAKE_DDHRESULT(2100) -#define D3DERR_INBEGINSTATEBLOCK MAKE_DDHRESULT(2101) -#define D3DERR_NOTINBEGINSTATEBLOCK MAKE_DDHRESULT(2102) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - - -#ifdef __cplusplus -}; -#endif - -#endif /* (DIRECT3D_VERSION < 0x0800) */ -#endif /* _D3D_H_ */ - diff --git a/import/DirectX8/include/d3d8.h b/import/DirectX8/include/d3d8.h deleted file mode 100644 index 347a86cc1..000000000 --- a/import/DirectX8/include/d3d8.h +++ /dev/null @@ -1,1279 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _D3D8_H_ -#define _D3D8_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - - -/* This identifier is passed to Direct3DCreate8 in order to ensure that an - * application was built against the correct header files. This number is - * incremented whenever a header (or other) change would require applications - * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail. - * (The number itself has no meaning.)*/ - -#define D3D_SDK_VERSION 220 - - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); -#endif - -#define D3DAPI WINAPI - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) - -/* IID_IDirect3D8 */ -/* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */ -DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12); - -/* IID_IDirect3DDevice8 */ -/* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */ -DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf); - -/* IID_IDirect3DResource8 */ -/* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */ -DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f); - -/* IID_IDirect3DBaseTexture8 */ -/* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */ -DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e); - -/* IID_IDirect3DTexture8 */ -/* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */ -DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58); - -/* IID_IDirect3DCubeTexture8 */ -/* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */ -DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50); - -/* IID_IDirect3DVolumeTexture8 */ -/* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */ -DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad); - -/* IID_IDirect3DVertexBuffer8 */ -/* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */ -DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95); - -/* IID_IDirect3DIndexBuffer8 */ -/* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */ -DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86); - -/* IID_IDirect3DSurface8 */ -/* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */ -DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd); - -/* IID_IDirect3DVolume8 */ -/* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */ -DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0); - -/* IID_IDirect3DSwapChain8 */ -/* {928C088B-76B9-4C6B-A536-A590853876CD} */ -DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd); - -#endif - -#ifdef __cplusplus - -interface IDirect3D8; -interface IDirect3DDevice8; - -interface IDirect3DResource8; -interface IDirect3DBaseTexture8; -interface IDirect3DTexture8; -interface IDirect3DVolumeTexture8; -interface IDirect3DCubeTexture8; - -interface IDirect3DVertexBuffer8; -interface IDirect3DIndexBuffer8; - -interface IDirect3DSurface8; -interface IDirect3DVolume8; - -interface IDirect3DSwapChain8; - -#endif - - -typedef interface IDirect3D8 IDirect3D8; -typedef interface IDirect3DDevice8 IDirect3DDevice8; -typedef interface IDirect3DResource8 IDirect3DResource8; -typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8; -typedef interface IDirect3DTexture8 IDirect3DTexture8; -typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8; -typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8; -typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8; -typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8; -typedef interface IDirect3DSurface8 IDirect3DSurface8; -typedef interface IDirect3DVolume8 IDirect3DVolume8; -typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8; - -#include "d3d8types.h" -#include "d3d8caps.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * DLL Function for creating a Direct3D8 object. This object supports - * enumeration and allows the creation of Direct3DDevice8 objects. - * Pass the value of the constant D3D_SDK_VERSION to this function, so - * that the run-time can validate that your application was compiled - * against the right headers. - */ - -IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion); - - -/* - * Direct3D interfaces - */ - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3D8 - -DECLARE_INTERFACE_(IDirect3D8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3D8 methods ***/ - STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; - STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; - STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER8* pIdentifier) PURE; - STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter) PURE; - STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,UINT Mode,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE CheckType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL Windowed) PURE; - STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; - STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType) PURE; - STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS8* pCaps) PURE; - STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; - STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice8** ppReturnedDeviceInterface) PURE; -}; - -typedef struct IDirect3D8 *LPDIRECT3D8, *PDIRECT3D8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3D8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) -#define IDirect3D8_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) -#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) -#define IDirect3D8_GetAdapterModeCount(p,a) (p)->lpVtbl->GetAdapterModeCount(p,a) -#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->lpVtbl->EnumAdapterModes(p,a,b,c) -#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) -#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) -#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) -#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e) -#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) -#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) -#define IDirect3D8_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) -#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) -#else -#define IDirect3D8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3D8_AddRef(p) (p)->AddRef() -#define IDirect3D8_Release(p) (p)->Release() -#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) -#define IDirect3D8_GetAdapterCount(p) (p)->GetAdapterCount() -#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) -#define IDirect3D8_GetAdapterModeCount(p,a) (p)->GetAdapterModeCount(a) -#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->EnumAdapterModes(a,b,c) -#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) -#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) -#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) -#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->CheckDeviceMultiSampleType(a,b,c,d,e) -#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) -#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) -#define IDirect3D8_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) -#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) -#endif - - - - - - - - - - - - - - - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DDevice8 - -DECLARE_INTERFACE_(IDirect3DDevice8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DDevice8 methods ***/ - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; - STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE; - STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE; - STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8* pCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; - STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; - STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface8* pCursorBitmap) PURE; - STDMETHOD_(void, SetCursorPosition)(THIS_ UINT XScreenSpace,UINT YScreenSpace,DWORD Flags) PURE; - STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; - STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain8** pSwapChain) PURE; - STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; - STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; - STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; - STDMETHOD_(void, GetGammaRamp)(THIS_ D3DGAMMARAMP* pRamp) PURE; - STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture) PURE; - STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture) PURE; - STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture) PURE; - STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer) PURE; - STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer) PURE; - STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface) PURE; - STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) PURE; - STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture) PURE; - STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8* pDestSurface) PURE; - STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil) PURE; - STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8** ppRenderTarget) PURE; - STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8** ppZStencilSurface) PURE; - STDMETHOD(BeginScene)(THIS) PURE; - STDMETHOD(EndScene)(THIS) PURE; - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; - STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; - STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; - STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8* pViewport) PURE; - STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8* pViewport) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8* pMaterial) PURE; - STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8* pMaterial) PURE; - STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT8*) PURE; - STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT8*) PURE; - STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; - STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; - STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; - STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; - STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; - STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; - STDMETHOD(BeginStateBlock)(THIS) PURE; - STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE; - STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE; - STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,DWORD* pToken) PURE; - STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8* pClipStatus) PURE; - STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8* pClipStatus) PURE; - STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8** ppTexture) PURE; - STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8* pTexture) PURE; - STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; - STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; - STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; - STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) PURE; - STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; - STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; - STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; - STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; - STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; - STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; - STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; - STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) PURE; - STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) PURE; - STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE; - STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride) PURE; - STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) PURE; - STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) PURE; - STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) PURE; - STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle) PURE; - STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE; - STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE; - STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; - STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; - STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; - STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; -}; - -typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8, *PDIRECT3DDEVICE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) -#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->lpVtbl->ResourceManagerDiscardBytes(p,a) -#define IDirect3DDevice8_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) -#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) -#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) -#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) -#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) -#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) -#define IDirect3DDevice8_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) -#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) -#define IDirect3DDevice8_Reset(p,a) (p)->lpVtbl->Reset(p,a) -#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) -#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b) -#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->lpVtbl->GetGammaRamp(p,a) -#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g) -#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f) -#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f) -#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->lpVtbl->CreateImageSurface(p,a,b,c,d) -#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->lpVtbl->CopyRects(p,a,b,c,d,e) -#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) -#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->lpVtbl->GetFrontBuffer(p,a) -#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) -#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) -#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) -#define IDirect3DDevice8_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice8_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) -#define IDirect3DDevice8_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) -#define IDirect3DDevice8_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) -#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) -#define IDirect3DDevice8_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) -#define IDirect3DDevice8_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) -#define IDirect3DDevice8_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) -#define IDirect3DDevice8_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) -#define IDirect3DDevice8_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) -#define IDirect3DDevice8_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) -#define IDirect3DDevice8_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) -#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) -#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) -#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) -#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) -#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) -#define IDirect3DDevice8_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) -#define IDirect3DDevice8_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) -#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) -#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) -#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) -#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) -#define IDirect3DDevice8_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) -#define IDirect3DDevice8_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) -#define IDirect3DDevice8_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) -#define IDirect3DDevice8_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) -#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) -#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) -#define IDirect3DDevice8_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) -#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) -#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) -#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) -#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) -#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) -#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) -#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e) -#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) -#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e) -#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) -#define IDirect3DDevice8_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) -#define IDirect3DDevice8_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) -#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->lpVtbl->DeleteVertexShader(p,a) -#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c) -#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c) -#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->lpVtbl->SetStreamSource(p,a,b,c) -#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->lpVtbl->GetStreamSource(p,a,b,c) -#define IDirect3DDevice8_SetIndices(p,a,b) (p)->lpVtbl->SetIndices(p,a,b) -#define IDirect3DDevice8_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) -#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) -#define IDirect3DDevice8_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) -#define IDirect3DDevice8_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) -#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->lpVtbl->DeletePixelShader(p,a) -#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c) -#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c) -#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) -#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) -#define IDirect3DDevice8_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) -#else -#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DDevice8_AddRef(p) (p)->AddRef() -#define IDirect3DDevice8_Release(p) (p)->Release() -#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() -#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->ResourceManagerDiscardBytes(a) -#define IDirect3DDevice8_GetDirect3D(p,a) (p)->GetDirect3D(a) -#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) -#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->GetDisplayMode(a) -#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->GetCreationParameters(a) -#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) -#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) -#define IDirect3DDevice8_ShowCursor(p,a) (p)->ShowCursor(a) -#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) -#define IDirect3DDevice8_Reset(p,a) (p)->Reset(a) -#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->GetRasterStatus(a) -#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->SetGammaRamp(a,b) -#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->GetGammaRamp(a) -#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->CreateTexture(a,b,c,d,e,f,g) -#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->CreateCubeTexture(a,b,c,d,e,f) -#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->CreateVertexBuffer(a,b,c,d,e) -#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->CreateIndexBuffer(a,b,c,d,e) -#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->CreateRenderTarget(a,b,c,d,e,f) -#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->CreateDepthStencilSurface(a,b,c,d,e) -#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->CreateImageSurface(a,b,c,d) -#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->CopyRects(a,b,c,d,e) -#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) -#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->GetFrontBuffer(a) -#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) -#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->GetRenderTarget(a) -#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) -#define IDirect3DDevice8_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice8_EndScene(p) (p)->EndScene() -#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) -#define IDirect3DDevice8_SetTransform(p,a,b) (p)->SetTransform(a,b) -#define IDirect3DDevice8_GetTransform(p,a,b) (p)->GetTransform(a,b) -#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) -#define IDirect3DDevice8_SetViewport(p,a) (p)->SetViewport(a) -#define IDirect3DDevice8_GetViewport(p,a) (p)->GetViewport(a) -#define IDirect3DDevice8_SetMaterial(p,a) (p)->SetMaterial(a) -#define IDirect3DDevice8_GetMaterial(p,a) (p)->GetMaterial(a) -#define IDirect3DDevice8_SetLight(p,a,b) (p)->SetLight(a,b) -#define IDirect3DDevice8_GetLight(p,a,b) (p)->GetLight(a,b) -#define IDirect3DDevice8_LightEnable(p,a,b) (p)->LightEnable(a,b) -#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) -#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) -#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) -#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->SetRenderState(a,b) -#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->GetRenderState(a,b) -#define IDirect3DDevice8_BeginStateBlock(p) (p)->BeginStateBlock() -#define IDirect3DDevice8_EndStateBlock(p,a) (p)->EndStateBlock(a) -#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) -#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) -#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) -#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) -#define IDirect3DDevice8_SetClipStatus(p,a) (p)->SetClipStatus(a) -#define IDirect3DDevice8_GetClipStatus(p,a) (p)->GetClipStatus(a) -#define IDirect3DDevice8_GetTexture(p,a,b) (p)->GetTexture(a,b) -#define IDirect3DDevice8_SetTexture(p,a,b) (p)->SetTexture(a,b) -#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) -#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) -#define IDirect3DDevice8_ValidateDevice(p,a) (p)->ValidateDevice(a) -#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) -#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) -#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) -#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) -#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) -#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) -#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->DrawIndexedPrimitive(a,b,c,d,e) -#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) -#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) -#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->ProcessVertices(a,b,c,d,e) -#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->CreateVertexShader(a,b,c,d) -#define IDirect3DDevice8_SetVertexShader(p,a) (p)->SetVertexShader(a) -#define IDirect3DDevice8_GetVertexShader(p,a) (p)->GetVertexShader(a) -#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->DeleteVertexShader(a) -#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->SetVertexShaderConstant(a,b,c) -#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->GetVertexShaderConstant(a,b,c) -#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->GetVertexShaderDeclaration(a,b,c) -#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->GetVertexShaderFunction(a,b,c) -#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->SetStreamSource(a,b,c) -#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->GetStreamSource(a,b,c) -#define IDirect3DDevice8_SetIndices(p,a,b) (p)->SetIndices(a,b) -#define IDirect3DDevice8_GetIndices(p,a,b) (p)->GetIndices(a,b) -#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) -#define IDirect3DDevice8_SetPixelShader(p,a) (p)->SetPixelShader(a) -#define IDirect3DDevice8_GetPixelShader(p,a) (p)->GetPixelShader(a) -#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->DeletePixelShader(a) -#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->SetPixelShaderConstant(a,b,c) -#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->GetPixelShaderConstant(a,b,c) -#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->GetPixelShaderFunction(a,b,c) -#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) -#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) -#define IDirect3DDevice8_DeletePatch(p,a) (p)->DeletePatch(a) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DSwapChain8 - -DECLARE_INTERFACE_(IDirect3DSwapChain8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSwapChain8 methods ***/ - STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; - STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; -}; - -typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSwapChain8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSwapChain8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) -#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#else -#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSwapChain8_AddRef(p) (p)->AddRef() -#define IDirect3DSwapChain8_Release(p) (p)->Release() -#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) -#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) -#endif - - - -#undef INTERFACE -#define INTERFACE IDirect3DResource8 - -DECLARE_INTERFACE_(IDirect3DResource8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; -}; - -typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DResource8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DResource8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DResource8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DResource8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DResource8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DResource8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DResource8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DResource8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DResource8_GetType(p) (p)->lpVtbl->GetType(p) -#else -#define IDirect3DResource8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DResource8_AddRef(p) (p)->AddRef() -#define IDirect3DResource8_Release(p) (p)->Release() -#define IDirect3DResource8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DResource8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DResource8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DResource8_GetPriority(p) (p)->GetPriority() -#define IDirect3DResource8_PreLoad(p) (p)->PreLoad() -#define IDirect3DResource8_GetType(p) (p)->GetType() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DBaseTexture8 - -DECLARE_INTERFACE_(IDirect3DBaseTexture8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; -}; - -typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DBaseTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DBaseTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DBaseTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DBaseTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DBaseTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DBaseTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#else -#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DBaseTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DBaseTexture8_Release(p) (p)->Release() -#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DBaseTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DBaseTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DBaseTexture8_GetType(p) (p)->GetType() -#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DBaseTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->GetLevelCount() -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DTexture8 - -DECLARE_INTERFACE_(IDirect3DTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface8** ppSurfaceLevel) PURE; - STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; -}; - -typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) -#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) -#define IDirect3DTexture8_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) -#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) -#else -#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DTexture8_Release(p) (p)->Release() -#define IDirect3DTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DTexture8_GetType(p) (p)->GetType() -#define IDirect3DTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) -#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) -#define IDirect3DTexture8_UnlockRect(p,a) (p)->UnlockRect(a) -#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->AddDirtyRect(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolumeTexture8 - -DECLARE_INTERFACE_(IDirect3DVolumeTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE; - STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; - STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; -}; - -typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolumeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolumeTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVolumeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVolumeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVolumeTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DVolumeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) -#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) -#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) -#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) -#else -#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolumeTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DVolumeTexture8_Release(p) (p)->Release() -#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVolumeTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DVolumeTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DVolumeTexture8_GetType(p) (p)->GetType() -#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DVolumeTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) -#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) -#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->UnlockBox(a) -#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->AddDirtyBox(a) -#endif - - - - - -#undef INTERFACE -#define INTERFACE IDirect3DCubeTexture8 - -DECLARE_INTERFACE_(IDirect3DCubeTexture8, IDirect3DBaseTexture8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DBaseTexture8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; - STDMETHOD_(DWORD, GetLOD)(THIS) PURE; - STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) PURE; - STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; - STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; -}; - -typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DCubeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DCubeTexture8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DCubeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DCubeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DCubeTexture8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirect3DCubeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) -#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) -#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) -#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) -#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) -#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) -#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) -#else -#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DCubeTexture8_AddRef(p) (p)->AddRef() -#define IDirect3DCubeTexture8_Release(p) (p)->Release() -#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DCubeTexture8_GetPriority(p) (p)->GetPriority() -#define IDirect3DCubeTexture8_PreLoad(p) (p)->PreLoad() -#define IDirect3DCubeTexture8_GetType(p) (p)->GetType() -#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->SetLOD(a) -#define IDirect3DCubeTexture8_GetLOD(p) (p)->GetLOD() -#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->GetLevelCount() -#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) -#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) -#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) -#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->UnlockRect(a,b) -#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVertexBuffer8 - -DECLARE_INTERFACE_(IDirect3DVertexBuffer8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; -}; - -typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVertexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVertexBuffer8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DVertexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DVertexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DVertexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DVertexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVertexBuffer8_AddRef(p) (p)->AddRef() -#define IDirect3DVertexBuffer8_Release(p) (p)->Release() -#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DVertexBuffer8_GetPriority(p) (p)->GetPriority() -#define IDirect3DVertexBuffer8_PreLoad(p) (p)->PreLoad() -#define IDirect3DVertexBuffer8_GetType(p) (p)->GetType() -#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DVertexBuffer8_Unlock(p) (p)->Unlock() -#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DIndexBuffer8 - -DECLARE_INTERFACE_(IDirect3DIndexBuffer8, IDirect3DResource8) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DResource8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; - STDMETHOD_(DWORD, GetPriority)(THIS) PURE; - STDMETHOD_(void, PreLoad)(THIS) PURE; - STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; - STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; - STDMETHOD(Unlock)(THIS) PURE; - STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; -}; - -typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DIndexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DIndexBuffer8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirect3DIndexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) -#define IDirect3DIndexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) -#define IDirect3DIndexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) -#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirect3DIndexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#else -#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DIndexBuffer8_AddRef(p) (p)->AddRef() -#define IDirect3DIndexBuffer8_Release(p) (p)->Release() -#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->SetPriority(a) -#define IDirect3DIndexBuffer8_GetPriority(p) (p)->GetPriority() -#define IDirect3DIndexBuffer8_PreLoad(p) (p)->PreLoad() -#define IDirect3DIndexBuffer8_GetType(p) (p)->GetType() -#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirect3DIndexBuffer8_Unlock(p) (p)->Unlock() -#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->GetDesc(a) -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DSurface8 - -DECLARE_INTERFACE_(IDirect3DSurface8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DSurface8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; - STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; - STDMETHOD(UnlockRect)(THIS) PURE; -}; - -typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DSurface8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DSurface8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DSurface8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DSurface8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DSurface8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DSurface8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) -#define IDirect3DSurface8_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) -#else -#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DSurface8_AddRef(p) (p)->AddRef() -#define IDirect3DSurface8_Release(p) (p)->Release() -#define IDirect3DSurface8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DSurface8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DSurface8_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DSurface8_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->LockRect(a,b,c) -#define IDirect3DSurface8_UnlockRect(p) (p)->UnlockRect() -#endif - - - - -#undef INTERFACE -#define INTERFACE IDirect3DVolume8 - -DECLARE_INTERFACE_(IDirect3DVolume8, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirect3DVolume8 methods ***/ - STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; - STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; - STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; - STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; - STDMETHOD(UnlockBox)(THIS) PURE; -}; - -typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirect3DVolume8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DVolume8_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DVolume8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirect3DVolume8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirect3DVolume8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) -#define IDirect3DVolume8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) -#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) -#define IDirect3DVolume8_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) -#else -#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirect3DVolume8_AddRef(p) (p)->AddRef() -#define IDirect3DVolume8_Release(p) (p)->Release() -#define IDirect3DVolume8_GetDevice(p,a) (p)->GetDevice(a) -#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirect3DVolume8_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirect3DVolume8_GetContainer(p,a,b) (p)->GetContainer(a,b) -#define IDirect3DVolume8_GetDesc(p,a) (p)->GetDesc(a) -#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->LockBox(a,b,c) -#define IDirect3DVolume8_UnlockBox(p) (p)->UnlockBox() -#endif - -/**************************************************************************** - * Flags for SetPrivateData method on all D3D8 interfaces - * - * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData - * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this - * pointer and Release when the private data is destroyed. The data will be - * destroyed when another SetPrivateData with the same GUID is set, when - * FreePrivateData is called, or when the D3D8 object is freed. - ****************************************************************************/ -#define D3DSPD_IUNKNOWN 0x00000001L - -/**************************************************************************** - * - * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for - * the current mode only. - * - ****************************************************************************/ - -#define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL - -/**************************************************************************** - * - * Flags for IDirect3D8::CreateDevice's BehaviorFlags - * - ****************************************************************************/ - -#define D3DCREATE_FPU_PRESERVE 0x00000002L -#define D3DCREATE_MULTITHREADED 0x00000004L - -#define D3DCREATE_PUREDEVICE 0x00000010L -#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L -#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L -#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L - -#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L - - -/**************************************************************************** - * - * Parameter for IDirect3D8::CreateDevice's iAdapter - * - ****************************************************************************/ - -#define D3DADAPTER_DEFAULT 0 - -/**************************************************************************** - * - * Flags for IDirect3D8::EnumAdapters - * - ****************************************************************************/ - -#define D3DENUM_NO_WHQL_LEVEL 0x00000002L - -/**************************************************************************** - * - * Maximum number of back-buffers supported in DX8 - * - ****************************************************************************/ - -#define D3DPRESENT_BACK_BUFFERS_MAX 3L - -/**************************************************************************** - * - * Flags for IDirect3DDevice8::SetGammaRamp - * - ****************************************************************************/ - -#define D3DSGR_NO_CALIBRATION 0x00000000L -#define D3DSGR_CALIBRATE 0x00000001L - -/**************************************************************************** - * - * Flags for IDirect3DDevice8::SetCursorPosition - * - ****************************************************************************/ - -#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * Also valid for VertexBuffer::CreateVertexBuffer - ****************************************************************************/ - - -/* - * DirectDraw error codes - */ -#define _FACD3D 0x876 -#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) - -/* - * Direct3D Errors - */ -#define D3D_OK S_OK - -#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) -#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) -#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) -#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) -#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) -#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) -#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) -#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) -#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) -#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) -#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) -#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) - -#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) -#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) -#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) -#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) -#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) -#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) -#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) -#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) -#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) - -#ifdef __cplusplus -}; -#endif - -#endif /* (DIRECT3D_VERSION >= 0x0800) */ -#endif /* _D3D_H_ */ - diff --git a/import/DirectX8/include/d3d8caps.h b/import/DirectX8/include/d3d8caps.h deleted file mode 100644 index 1cf60e7f8..000000000 --- a/import/DirectX8/include/d3d8caps.h +++ /dev/null @@ -1,362 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8caps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3D8CAPS_H -#define _D3D8CAPS_H - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - -#pragma pack(4) - -typedef struct _D3DCAPS8 -{ - /* Device Info */ - D3DDEVTYPE DeviceType; - UINT AdapterOrdinal; - - /* Caps from DX7 Draw */ - DWORD Caps; - DWORD Caps2; - DWORD Caps3; - DWORD PresentationIntervals; - - /* Cursor Caps */ - DWORD CursorCaps; - - /* 3D Device Caps */ - DWORD DevCaps; - - DWORD PrimitiveMiscCaps; - DWORD RasterCaps; - DWORD ZCmpCaps; - DWORD SrcBlendCaps; - DWORD DestBlendCaps; - DWORD AlphaCmpCaps; - DWORD ShadeCaps; - DWORD TextureCaps; - DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's - DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's - DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's - DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's - DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's - - DWORD LineCaps; // D3DLINECAPS - - DWORD MaxTextureWidth, MaxTextureHeight; - DWORD MaxVolumeExtent; - - DWORD MaxTextureRepeat; - DWORD MaxTextureAspectRatio; - DWORD MaxAnisotropy; - float MaxVertexW; - - float GuardBandLeft; - float GuardBandTop; - float GuardBandRight; - float GuardBandBottom; - - float ExtentsAdjust; - DWORD StencilCaps; - - DWORD FVFCaps; - DWORD TextureOpCaps; - DWORD MaxTextureBlendStages; - DWORD MaxSimultaneousTextures; - - DWORD VertexProcessingCaps; - DWORD MaxActiveLights; - DWORD MaxUserClipPlanes; - DWORD MaxVertexBlendMatrices; - DWORD MaxVertexBlendMatrixIndex; - - float MaxPointSize; - - DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call - DWORD MaxVertexIndex; - DWORD MaxStreams; - DWORD MaxStreamStride; // max stride for SetStreamSource - - DWORD VertexShaderVersion; - DWORD MaxVertexShaderConst; // number of vertex shader constant registers - - DWORD PixelShaderVersion; - float MaxPixelShaderValue; // max value of pixel shader arithmetic component - -} D3DCAPS8; - -// -// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS -// - -// -// Caps -// -#define D3DCAPS_READ_SCANLINE 0x00020000L - -// -// Caps2 -// -#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L -#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L -#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L -#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L -#define D3DCAPS2_RESERVED 0x02000000L -#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L -#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L - -// -// Caps3 -// -#define D3DCAPS3_RESERVED 0x8000001fL - -// Indicates that the device can respect the ALPHABLENDENABLE render state -// when fullscreen while using the FLIP or DISCARD swap effect. -// COPY and COPYVSYNC swap effects work whether or not this flag is set. -#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L - -// -// PresentationIntervals -// -#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L -#define D3DPRESENT_INTERVAL_ONE 0x00000001L -#define D3DPRESENT_INTERVAL_TWO 0x00000002L -#define D3DPRESENT_INTERVAL_THREE 0x00000004L -#define D3DPRESENT_INTERVAL_FOUR 0x00000008L -#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L - -// -// CursorCaps -// -// Driver supports HW color cursor in at least hi-res modes(height >=400) -#define D3DCURSORCAPS_COLOR 0x00000001L -// Driver supports HW cursor also in low-res modes(height < 400) -#define D3DCURSORCAPS_LOWRES 0x00000002L - -// -// DevCaps -// -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ -#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ -#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ -#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ -#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ -#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ -#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ -#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ -#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ -#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ -#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ -#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ - -// -// PrimitiveMiscCaps -// -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L -#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L -#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ -#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ -#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ -#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ -#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ - -// -// LineCaps -// -#define D3DLINECAPS_TEXTURE 0x00000001L -#define D3DLINECAPS_ZTEST 0x00000002L -#define D3DLINECAPS_BLEND 0x00000004L -#define D3DLINECAPS_ALPHACMP 0x00000008L -#define D3DLINECAPS_FOG 0x00000010L - -// -// RasterCaps -// -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_PAT 0x00000008L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBIAS 0x00004000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L -#define D3DPRASTERCAPS_WBUFFER 0x00040000L -#define D3DPRASTERCAPS_WFOG 0x00100000L -#define D3DPRASTERCAPS_ZFOG 0x00200000L -#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ -#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L - -// -// ZCmpCaps, AlphaCmpCaps -// -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -// -// SourceBlendCaps, DestBlendCaps -// -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L - -// -// ShadeCaps -// -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L - -// -// TextureCaps -// -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ -#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ -#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ -#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ -#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ -// Device can use non-POW2 textures if: -// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage -// 2) D3DRS_WRAP(N) is zero for this texture's coordinates -// 3) mip mapping is not enabled (use magnification filter only) -#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L -#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ -#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ -#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ -#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ -#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ -#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ -#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ -#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ - -// -// TextureFilterCaps -// -#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ -#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L -#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L -#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ -#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L -#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ -#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L -#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L -#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L -#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L - -// -// TextureAddressCaps -// -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L -#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L - -// -// StencilCaps -// -#define D3DSTENCILCAPS_KEEP 0x00000001L -#define D3DSTENCILCAPS_ZERO 0x00000002L -#define D3DSTENCILCAPS_REPLACE 0x00000004L -#define D3DSTENCILCAPS_INCRSAT 0x00000008L -#define D3DSTENCILCAPS_DECRSAT 0x00000010L -#define D3DSTENCILCAPS_INVERT 0x00000020L -#define D3DSTENCILCAPS_INCR 0x00000040L -#define D3DSTENCILCAPS_DECR 0x00000080L - -// -// TextureOpCaps -// -#define D3DTEXOPCAPS_DISABLE 0x00000001L -#define D3DTEXOPCAPS_SELECTARG1 0x00000002L -#define D3DTEXOPCAPS_SELECTARG2 0x00000004L -#define D3DTEXOPCAPS_MODULATE 0x00000008L -#define D3DTEXOPCAPS_MODULATE2X 0x00000010L -#define D3DTEXOPCAPS_MODULATE4X 0x00000020L -#define D3DTEXOPCAPS_ADD 0x00000040L -#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L -#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L -#define D3DTEXOPCAPS_SUBTRACT 0x00000200L -#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L -#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L -#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L -#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L -#define D3DTEXOPCAPS_PREMODULATE 0x00010000L -#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L -#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L -#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L -#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L -#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L -#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L -#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L -#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L -#define D3DTEXOPCAPS_LERP 0x02000000L - -// -// FVFCaps -// -#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ -#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ -#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ - -// -// VertexProcessingCaps -// -#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ -#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ -#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ -#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ -#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ -#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ -#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */ - -#pragma pack() - -#endif /* (DIRECT3D_VERSION >= 0x0800) */ -#endif /* _D3D8CAPS_H_ */ - diff --git a/import/DirectX8/include/d3d8types.h b/import/DirectX8/include/d3d8types.h deleted file mode 100644 index ec924f636..000000000 --- a/import/DirectX8/include/d3d8types.h +++ /dev/null @@ -1,1675 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3d8types.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3D8TYPES_H_ -#define _D3D8TYPES_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX8 interfaces -#if(DIRECT3D_VERSION >= 0x0800) - -#include - -#pragma warning(disable:4201) // anonymous unions warning -#pragma pack(4) - -// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif - -// maps unsigned 8 bits/channel to D3DCOLOR -#define D3DCOLOR_ARGB(a,r,g,b) \ - ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) -#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) -#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) - -// maps floating point channels (0.f to 1.f range) to D3DCOLOR -#define D3DCOLOR_COLORVALUE(r,g,b,a) \ - D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) - - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - float x; - float y; - float z; -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif - -#ifndef D3DCOLORVALUE_DEFINED -typedef struct _D3DCOLORVALUE { - float r; - float g; - float b; - float a; -} D3DCOLORVALUE; -#define D3DCOLORVALUE_DEFINED -#endif - -#ifndef D3DRECT_DEFINED -typedef struct _D3DRECT { - LONG x1; - LONG y1; - LONG x2; - LONG y2; -} D3DRECT; -#define D3DRECT_DEFINED -#endif - -#ifndef D3DMATRIX_DEFINED -typedef struct _D3DMATRIX { - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - - }; - float m[4][4]; - }; -} D3DMATRIX; -#define D3DMATRIX_DEFINED -#endif - -typedef struct _D3DVIEWPORT8 { - DWORD X; - DWORD Y; /* Viewport Top left */ - DWORD Width; - DWORD Height; /* Viewport Dimensions */ - float MinZ; /* Min/max of clip Volume */ - float MaxZ; -} D3DVIEWPORT8; - -/* - * Values for clip fields. - */ - -// Max number of user clipping planes, supported in D3D. -#define D3DMAXUSERCLIPPLANES 32 - -// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE -// -#define D3DCLIPPLANE0 (1 << 0) -#define D3DCLIPPLANE1 (1 << 1) -#define D3DCLIPPLANE2 (1 << 2) -#define D3DCLIPPLANE3 (1 << 3) -#define D3DCLIPPLANE4 (1 << 4) -#define D3DCLIPPLANE5 (1 << 5) - -// The following bits are used in the ClipUnion and ClipIntersection -// members of the D3DCLIPSTATUS8 -// - -#define D3DCS_LEFT 0x00000001L -#define D3DCS_RIGHT 0x00000002L -#define D3DCS_TOP 0x00000004L -#define D3DCS_BOTTOM 0x00000008L -#define D3DCS_FRONT 0x00000010L -#define D3DCS_BACK 0x00000020L -#define D3DCS_PLANE0 0x00000040L -#define D3DCS_PLANE1 0x00000080L -#define D3DCS_PLANE2 0x00000100L -#define D3DCS_PLANE3 0x00000200L -#define D3DCS_PLANE4 0x00000400L -#define D3DCS_PLANE5 0x00000800L - -#define D3DCS_ALL (D3DCS_LEFT | \ - D3DCS_RIGHT | \ - D3DCS_TOP | \ - D3DCS_BOTTOM | \ - D3DCS_FRONT | \ - D3DCS_BACK | \ - D3DCS_PLANE0 | \ - D3DCS_PLANE1 | \ - D3DCS_PLANE2 | \ - D3DCS_PLANE3 | \ - D3DCS_PLANE4 | \ - D3DCS_PLANE5) - -typedef struct _D3DCLIPSTATUS8 { - DWORD ClipUnion; - DWORD ClipIntersection; -} D3DCLIPSTATUS8; - -typedef struct _D3DMATERIAL8 { - D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE Ambient; /* Ambient color RGB */ - D3DCOLORVALUE Specular; /* Specular 'shininess' */ - D3DCOLORVALUE Emissive; /* Emissive color RGB */ - float Power; /* Sharpness if specular highlight */ -} D3DMATERIAL8; - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -typedef struct _D3DLIGHT8 { - D3DLIGHTTYPE Type; /* Type of light source */ - D3DCOLORVALUE Diffuse; /* Diffuse color of light */ - D3DCOLORVALUE Specular; /* Specular color of light */ - D3DCOLORVALUE Ambient; /* Ambient color of light */ - D3DVECTOR Position; /* Position in world space */ - D3DVECTOR Direction; /* Direction in world space */ - float Range; /* Cutoff range */ - float Falloff; /* Falloff */ - float Attenuation0; /* Constant attenuation */ - float Attenuation1; /* Linear attenuation */ - float Attenuation2; /* Quadratic attenuation */ - float Theta; /* Inner angle of spotlight cone */ - float Phi; /* Outer angle of spotlight cone */ -} D3DLIGHT8; - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ -#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ - -/* - * The following defines the rendering states - */ - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFILLMODE; - -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLEND; - -typedef enum _D3DBLENDOP { - D3DBLENDOP_ADD = 1, - D3DBLENDOP_SUBTRACT = 2, - D3DBLENDOP_REVSUBTRACT = 3, - D3DBLENDOP_MIN = 4, - D3DBLENDOP_MAX = 5, - D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLENDOP; - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_MIRRORONCE = 5, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCMPFUNC; - -typedef enum _D3DSTENCILOP { - D3DSTENCILOP_KEEP = 1, - D3DSTENCILOP_ZERO = 2, - D3DSTENCILOP_REPLACE = 3, - D3DSTENCILOP_INCRSAT = 4, - D3DSTENCILOP_DECRSAT = 5, - D3DSTENCILOP_INVERT = 6, - D3DSTENCILOP_INCR = 7, - D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSTENCILOP; - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFOGMODE; - -typedef enum _D3DZBUFFERTYPE { - D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DZBUFFERTYPE; - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTS_VIEW = 2, - D3DTS_PROJECTION = 3, - D3DTS_TEXTURE0 = 16, - D3DTS_TEXTURE1 = 17, - D3DTS_TEXTURE2 = 18, - D3DTS_TEXTURE3 = 19, - D3DTS_TEXTURE4 = 20, - D3DTS_TEXTURE5 = 21, - D3DTS_TEXTURE6 = 22, - D3DTS_TEXTURE7 = 23, - D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTRANSFORMSTATETYPE; - -#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) -#define D3DTS_WORLD D3DTS_WORLDMATRIX(0) -#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) -#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) -#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) - -typedef enum _D3DRENDERSTATETYPE { - D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ - D3DRS_FILLMODE = 8, /* D3DFILLMODE */ - D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRS_LINEPATTERN = 10, /* D3DLINEPATTERN */ - D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRS_SRCBLEND = 19, /* D3DBLEND */ - D3DRS_DESTBLEND = 20, /* D3DBLEND */ - D3DRS_CULLMODE = 22, /* D3DCULL */ - D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRS_ALPHAREF = 24, /* D3DFIXED */ - D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ - D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ - D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ - D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRS_ZVISIBLE = 30, /* TRUE to enable z checking */ - D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ - D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ - D3DRS_FOGEND = 37, /* Fog end */ - D3DRS_FOGDENSITY = 38, /* Fog density */ - D3DRS_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ - D3DRS_ZBIAS = 47, /* LONG Z bias */ - D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ - D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ - D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ - D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ - D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ - D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ - D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ - D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ - D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ - D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ - D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ - D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ - D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ - D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ - D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ - D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ - D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ - D3DRS_CLIPPING = 136, - D3DRS_LIGHTING = 137, - D3DRS_AMBIENT = 139, - D3DRS_FOGVERTEXMODE = 140, - D3DRS_COLORVERTEX = 141, - D3DRS_LOCALVIEWER = 142, - D3DRS_NORMALIZENORMALS = 143, - D3DRS_DIFFUSEMATERIALSOURCE = 145, - D3DRS_SPECULARMATERIALSOURCE = 146, - D3DRS_AMBIENTMATERIALSOURCE = 147, - D3DRS_EMISSIVEMATERIALSOURCE = 148, - D3DRS_VERTEXBLEND = 151, - D3DRS_CLIPPLANEENABLE = 152, - D3DRS_SOFTWAREVERTEXPROCESSING = 153, - D3DRS_POINTSIZE = 154, /* float point size */ - D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ - D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ - D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ - D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ - D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ - D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ - D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer - D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable - D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation - D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches - D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor - D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ - D3DRS_INDEXEDVERTEXBLENDENABLE = 167, - D3DRS_COLORWRITEENABLE = 168, // per-channel write enable - D3DRS_TWEENFACTOR = 170, // float tween factor - D3DRS_BLENDOP = 171, // D3DBLENDOP setting - D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) - D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC - - D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DRENDERSTATETYPE; - -// Values for material source -typedef enum _D3DMATERIALCOLORSOURCE -{ - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DMATERIALCOLORSOURCE; - -// Bias to apply to the texture coordinate set to apply a wrap to. -#define D3DRENDERSTATE_WRAPBIAS 128UL - -/* Flags to construct the WRAP render states */ -#define D3DWRAP_U 0x00000001L -#define D3DWRAP_V 0x00000002L -#define D3DWRAP_W 0x00000004L - -/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W -#define D3DWRAPCOORD_3 0x00000008L - -/* Flags to construct D3DRS_COLORWRITEENABLE */ -#define D3DCOLORWRITEENABLE_RED (1L<<0) -#define D3DCOLORWRITEENABLE_GREEN (1L<<1) -#define D3DCOLORWRITEENABLE_BLUE (1L<<2) -#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) - -/* - * State enumerants for per-stage texture processing. - */ -typedef enum _D3DTEXTURESTAGESTATETYPE -{ - D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ - D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ - D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ - D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ - D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ - D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ - D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ - D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ - D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ - D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ - D3DTSS_MAGFILTER = 16, /* D3DTEXTUREFILTER filter to use for magnification */ - D3DTSS_MINFILTER = 17, /* D3DTEXTUREFILTER filter to use for minification */ - D3DTSS_MIPFILTER = 18, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ - D3DTSS_MIPMAPLODBIAS = 19, /* float Mipmap LOD bias */ - D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ - D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ - D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ - D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ - D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ - D3DTSS_ADDRESSW = 25, /* D3DTEXTUREADDRESS for W coordinate */ - D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ - D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ - D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ - D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTURESTAGESTATETYPE; - -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// -#define D3DTSS_TCI_PASSTHRU 0x00000000 -#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 -#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 -#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 - -/* - * Enumerations for COLOROP and ALPHAOP texture blending operations set in - * texture processing stage controls in D3DTSS. - */ -typedef enum _D3DTEXTUREOP -{ - // Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default - D3DTOP_SELECTARG2 = 3, - - // Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits - - // Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 - - // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR - - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color - - // Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only - - // Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel - - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. - D3DTOP_DOTPRODUCT3 = 24, - - // Triadic ops - D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 - D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 - - D3DTOP_FORCE_DWORD = 0x7fffffff, -} D3DTEXTUREOP; - -/* - * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending - * operations set in texture processing stage controls in D3DRENDERSTATE. - */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) -#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) -#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) -#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) -#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) -#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) - -// -// Values for D3DTSS_***FILTER texture stage states -// -typedef enum _D3DTEXTUREFILTERTYPE -{ - D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) - D3DTEXF_POINT = 1, // nearest - D3DTEXF_LINEAR = 2, // linear interpolation - D3DTEXF_ANISOTROPIC = 3, // anisotropic - D3DTEXF_FLATCUBIC = 4, // cubic - D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel - D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREFILTERTYPE; - -/* Bits for Flags in ProcessVertices call */ - -#define D3DPV_DONOTCOPYDATA (1 << 0) - -//------------------------------------------------------------------- - -// Flexible vertex format bits -// -#define D3DFVF_RESERVED0 0x001 -#define D3DFVF_POSITION_MASK 0x00E -#define D3DFVF_XYZ 0x002 -#define D3DFVF_XYZRHW 0x004 -#define D3DFVF_XYZB1 0x006 -#define D3DFVF_XYZB2 0x008 -#define D3DFVF_XYZB3 0x00a -#define D3DFVF_XYZB4 0x00c -#define D3DFVF_XYZB5 0x00e - -#define D3DFVF_NORMAL 0x010 -#define D3DFVF_PSIZE 0x020 -#define D3DFVF_DIFFUSE 0x040 -#define D3DFVF_SPECULAR 0x080 - -#define D3DFVF_TEXCOUNT_MASK 0xf00 -#define D3DFVF_TEXCOUNT_SHIFT 8 -#define D3DFVF_TEX0 0x000 -#define D3DFVF_TEX1 0x100 -#define D3DFVF_TEX2 0x200 -#define D3DFVF_TEX3 0x300 -#define D3DFVF_TEX4 0x400 -#define D3DFVF_TEX5 0x500 -#define D3DFVF_TEX6 0x600 -#define D3DFVF_TEX7 0x700 -#define D3DFVF_TEX8 0x800 - -#define D3DFVF_LASTBETA_UBYTE4 0x1000 - -#define D3DFVF_RESERVED2 0xE000 // 4 reserved bits - -//--------------------------------------------------------------------- -// Vertex Shaders -// - -/* - -Vertex Shader Declaration - -The declaration portion of a vertex shader defines the static external -interface of the shader. The information in the declaration includes: - -- Assignments of vertex shader input registers to data streams. These -assignments bind a specific vertex register to a single component within a -vertex stream. A vertex stream element is identified by a byte offset -within the stream and a type. The type specifies the arithmetic data type -plus the dimensionality (1, 2, 3, or 4 values). Stream data which is -less than 4 values are always expanded out to 4 values with zero or more -0.F values and one 1.F value. - -- Assignment of vertex shader input registers to implicit data from the -primitive tessellator. This controls the loading of vertex data which is -not loaded from a stream, but rather is generated during primitive -tessellation prior to the vertex shader. - -- Loading data into the constant memory at the time a shader is set as the -current shader. Each token specifies values for one or more contiguous 4 -DWORD constant registers. This allows the shader to update an arbitrary -subset of the constant memory, overwriting the device state (which -contains the current values of the constant memory). Note that these -values can be subsequently overwritten (between DrawPrimitive calls) -during the time a shader is bound to a device via the -SetVertexShaderConstant method. - - -Declaration arrays are single-dimensional arrays of DWORDs composed of -multiple tokens each of which is one or more DWORDs. The single-DWORD -token value 0xFFFFFFFF is a special token used to indicate the end of the -declaration array. The single DWORD token value 0x00000000 is a NOP token -with is ignored during the declaration parsing. Note that 0x00000000 is a -valid value for DWORDs following the first DWORD for multiple word tokens. - -[31:29] TokenType - 0x0 - NOP (requires all DWORD bits to be zero) - 0x1 - stream selector - 0x2 - stream data definition (map to vertex input memory) - 0x3 - vertex input memory from tessellator - 0x4 - constant memory from shader - 0x5 - extension - 0x6 - reserved - 0x7 - end-of-array (requires all DWORD bits to be 1) - -NOP Token (single DWORD token) - [31:29] 0x0 - [28:00] 0x0 - -Stream Selector (single DWORD token) - [31:29] 0x1 - [28] indicates whether this is a tessellator stream - [27:04] 0x0 - [03:00] stream selector (0..15) - -Stream Data Definition (single DWORD token) - Vertex Input Register Load - [31:29] 0x2 - [28] 0x0 - [27:20] 0x0 - [19:16] type (dimensionality and data type) - [15:04] 0x0 - [03:00] vertex register address (0..15) - Data Skip (no register load) - [31:29] 0x2 - [28] 0x1 - [27:20] 0x0 - [19:16] count of DWORDS to skip over (0..15) - [15:00] 0x0 - Vertex Input Memory from Tessellator Data (single DWORD token) - [31:29] 0x3 - [28] indicates whether data is normals or u/v - [27:24] 0x0 - [23:20] vertex register address (0..15) - [19:16] type (dimensionality) - [15:04] 0x0 - [03:00] vertex register address (0..15) - -Constant Memory from Shader (multiple DWORD token) - [31:29] 0x4 - [28:25] count of 4*DWORD constants to load (0..15) - [24:07] 0x0 - [06:00] constant memory address (0..95) - -Extension Token (single or multiple DWORD token) - [31:29] 0x5 - [28:24] count of additional DWORDs in token (0..31) - [23:00] extension-specific information - -End-of-array token (single DWORD token) - [31:29] 0x7 - [28:00] 0x1fffffff - -The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element. -Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant. -The token sequence: -Stream Select: stream=0 -Stream Data Definition (Load): type=FLOAT3; register=3 -Stream Data Definition (Load): type=FLOAT3; register=4 -Stream Data Definition (Skip): count=2 -Stream Data Definition (Load): type=FLOAT2; register=7 - -defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data. -Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed. - -*/ - -typedef enum _D3DVSD_TOKENTYPE -{ - D3DVSD_TOKEN_NOP = 0, // NOP or extension - D3DVSD_TOKEN_STREAM, // stream selector - D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) - D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator - D3DVSD_TOKEN_CONSTMEM, // constant memory from shader - D3DVSD_TOKEN_EXT, // extension - D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) - D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum -} D3DVSD_TOKENTYPE; - -#define D3DVSD_TOKENTYPESHIFT 29 -#define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT) - -#define D3DVSD_STREAMNUMBERSHIFT 0 -#define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT) - -#define D3DVSD_DATALOADTYPESHIFT 28 -#define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) - -#define D3DVSD_DATATYPESHIFT 16 -#define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT) - -#define D3DVSD_SKIPCOUNTSHIFT 16 -#define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT) - -#define D3DVSD_VERTEXREGSHIFT 0 -#define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT) - -#define D3DVSD_VERTEXREGINSHIFT 20 -#define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT) - -#define D3DVSD_CONSTCOUNTSHIFT 25 -#define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) - -#define D3DVSD_CONSTADDRESSSHIFT 0 -#define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT) - -#define D3DVSD_CONSTRSSHIFT 16 -#define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT) - -#define D3DVSD_EXTCOUNTSHIFT 24 -#define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT) - -#define D3DVSD_EXTINFOSHIFT 0 -#define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT) - -#define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) - -// macros for generation of CreateVertexShader Declaration token array - -// Set current stream -// _StreamNumber [0..(MaxStreams-1)] stream to get data from -// -#define D3DVSD_STREAM( _StreamNumber ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) - -// Set tessellator stream -// -#define D3DVSD_STREAMTESSSHIFT 28 -#define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) -#define D3DVSD_STREAM_TESS( ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) - -// bind single vertex register to vertex element from vertex stream -// -// _VertexRegister [0..15] address of the vertex register -// _Type [D3DVSDT_*] dimensionality and arithmetic data type - -#define D3DVSD_REG( _VertexRegister, _Type ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ - ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Skip _DWORDCount DWORDs in vertex -// -#define D3DVSD_SKIP( _DWORDCount ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ - ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) - -// load data into vertex shader constant memory -// -// _ConstantAddress [0..95] - address of constant array to begin filling data -// _Count [0..15] - number of constant vectors to load (4 DWORDs each) -// followed by 4*_Count DWORDS of data -// -#define D3DVSD_CONST( _ConstantAddress, _Count ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ - ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) - -// enable tessellator generated normals -// -// _VertexRegisterIn [0..15] address of vertex register whose input stream -// will be used in normal computation -// _VertexRegisterOut [0..15] address of vertex register to output the normal to -// -#define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ - ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ - ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) - -// enable tessellator generated surface parameters -// -// _VertexRegister [0..15] address of vertex register to output parameters -// -#define D3DVSD_TESSUV( _VertexRegister ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ - ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Generates END token -// -#define D3DVSD_END() 0xFFFFFFFF - -// Generates NOP token -#define D3DVSD_NOP() 0x00000000 - -// bit declarations for _Type fields -#define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) -#define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) -#define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) -#define D3DVSDT_FLOAT4 0x03 // 4D float -#define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range - // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) -#define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte -#define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) -#define D3DVSDT_SHORT4 0x07 // 4D signed short - -// assignments of vertex input registers for fixed function vertex shader -// -#define D3DVSDE_POSITION 0 -#define D3DVSDE_BLENDWEIGHT 1 -#define D3DVSDE_BLENDINDICES 2 -#define D3DVSDE_NORMAL 3 -#define D3DVSDE_PSIZE 4 -#define D3DVSDE_DIFFUSE 5 -#define D3DVSDE_SPECULAR 6 -#define D3DVSDE_TEXCOORD0 7 -#define D3DVSDE_TEXCOORD1 8 -#define D3DVSDE_TEXCOORD2 9 -#define D3DVSDE_TEXCOORD3 10 -#define D3DVSDE_TEXCOORD4 11 -#define D3DVSDE_TEXCOORD5 12 -#define D3DVSDE_TEXCOORD6 13 -#define D3DVSDE_TEXCOORD7 14 -#define D3DVSDE_POSITION2 15 -#define D3DVSDE_NORMAL2 16 - -// Maximum supported number of texture coordinate sets -#define D3DDP_MAXTEXCOORD 8 - - -// -// Instruction Token Bit Definitions -// -#define D3DSI_OPCODE_MASK 0x0000FFFF - -typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE -{ - D3DSIO_NOP = 0, // PS/VS - D3DSIO_MOV , // PS/VS - D3DSIO_ADD , // PS/VS - D3DSIO_SUB , // PS - D3DSIO_MAD , // PS/VS - D3DSIO_MUL , // PS/VS - D3DSIO_RCP , // VS - D3DSIO_RSQ , // VS - D3DSIO_DP3 , // PS/VS - D3DSIO_DP4 , // PS/VS - D3DSIO_MIN , // VS - D3DSIO_MAX , // VS - D3DSIO_SLT , // VS - D3DSIO_SGE , // VS - D3DSIO_EXP , // VS - D3DSIO_LOG , // VS - D3DSIO_LIT , // VS - D3DSIO_DST , // VS - D3DSIO_LRP , // PS - D3DSIO_FRC , // VS - D3DSIO_M4x4 , // VS - D3DSIO_M4x3 , // VS - D3DSIO_M3x4 , // VS - D3DSIO_M3x3 , // VS - D3DSIO_M3x2 , // VS - - D3DSIO_TEXCOORD = 64, // PS - D3DSIO_TEXKILL , // PS - D3DSIO_TEX , // PS - D3DSIO_TEXBEM , // PS - D3DSIO_TEXBEML , // PS - D3DSIO_TEXREG2AR , // PS - D3DSIO_TEXREG2GB , // PS - D3DSIO_TEXM3x2PAD , // PS - D3DSIO_TEXM3x2TEX , // PS - D3DSIO_TEXM3x3PAD , // PS - D3DSIO_TEXM3x3TEX , // PS - D3DSIO_TEXM3x3DIFF , // PS - D3DSIO_TEXM3x3SPEC , // PS - D3DSIO_TEXM3x3VSPEC , // PS - D3DSIO_EXPP , // VS - D3DSIO_LOGP , // VS - D3DSIO_CND , // PS - D3DSIO_DEF , // PS - D3DSIO_TEXREG2RGB , // PS - D3DSIO_TEXDP3TEX , // PS - D3DSIO_TEXM3x2DEPTH , // PS - D3DSIO_TEXDP3 , // PS - D3DSIO_TEXM3x3 , // PS - D3DSIO_TEXDEPTH , // PS - D3DSIO_CMP , // PS - D3DSIO_BEM , // PS - - D3DSIO_PHASE = 0xFFFD, - D3DSIO_COMMENT = 0xFFFE, - D3DSIO_END = 0xFFFF, - - D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DSHADER_INSTRUCTION_OPCODE_TYPE; - -// -// Co-Issue Instruction Modifier - if set then this instruction is to be -// issued in parallel with the previous instruction(s) for which this bit -// is not set. -// -#define D3DSI_COISSUE 0x40000000 - -// -// Parameter Token Bit Definitions -// -#define D3DSP_REGNUM_MASK 0x00001FFF - -// destination parameter write mask -#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) -#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) -#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) -#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) -#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components - -// destination parameter modifiers -#define D3DSP_DSTMOD_SHIFT 20 -#define D3DSP_DSTMOD_MASK 0x00F00000 - -typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE -{ - D3DSPDM_NONE = 0<>8)&0xFF) -#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) - -// destination/source parameter register type -#define D3DSI_COMMENTSIZE_SHIFT 16 -#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 -#define D3DSHADER_COMMENT(_DWordSize) \ - ((((_DWordSize)<= 0x0800) */ -#endif /* _D3D8TYPES(P)_H_ */ - diff --git a/import/DirectX8/include/d3dcaps.h b/import/DirectX8/include/d3dcaps.h deleted file mode 100644 index c033c2d86..000000000 --- a/import/DirectX8/include/d3dcaps.h +++ /dev/null @@ -1,599 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3dcaps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3DCAPS_H -#define _D3DCAPS_H - -/* - * Pull in DirectDraw include file automatically: - */ -#include "ddraw.h" - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -#pragma pack(4) - -/* Description of capabilities of transform */ - -typedef struct _D3DTRANSFORMCAPS { - DWORD dwSize; - DWORD dwCaps; -} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS; - -#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */ - -/* Description of capabilities of lighting */ - -typedef struct _D3DLIGHTINGCAPS { - DWORD dwSize; - DWORD dwCaps; /* Lighting caps */ - DWORD dwLightingModel; /* Lighting model - RGB or mono */ - DWORD dwNumLights; /* Number of lights that can be handled */ -} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS; - -#define D3DLIGHTINGMODEL_RGB 0x00000001L -#define D3DLIGHTINGMODEL_MONO 0x00000002L - -#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */ -#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */ -#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */ -#if(DIRECT3D_VERSION < 0x700) -#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */ -#endif -#if(DIRECT3D_VERSION < 0x500) -#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */ -#endif - -/* Description of capabilities for each primitive type */ - -typedef struct _D3DPrimCaps { - DWORD dwSize; - DWORD dwMiscCaps; /* Capability flags */ - DWORD dwRasterCaps; - DWORD dwZCmpCaps; - DWORD dwSrcBlendCaps; - DWORD dwDestBlendCaps; - DWORD dwAlphaCmpCaps; - DWORD dwShadeCaps; - DWORD dwTextureCaps; - DWORD dwTextureFilterCaps; - DWORD dwTextureBlendCaps; - DWORD dwTextureAddressCaps; - DWORD dwStippleWidth; /* maximum width and height of */ - DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */ -} D3DPRIMCAPS, *LPD3DPRIMCAPS; - -/* D3DPRIMCAPS dwMiscCaps */ - -#define D3DPMISCCAPS_MASKPLANES 0x00000001L -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L -#define D3DPMISCCAPS_CONFORMANT 0x00000008L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L - -/* D3DPRIMCAPS dwRasterCaps */ - -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_ROP2 0x00000002L -#define D3DPRASTERCAPS_XOR 0x00000004L -#define D3DPRASTERCAPS_PAT 0x00000008L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L -#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_STIPPLE 0x00000200L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L -#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L -#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBIAS 0x00004000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DPRASTERCAPS_WBUFFER 0x00040000L -#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L -#define D3DPRASTERCAPS_WFOG 0x00100000L -#define D3DPRASTERCAPS_ZFOG 0x00200000L -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */ - -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */ - -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L - -/* D3DPRIMCAPS dwShadeCaps */ - -#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L -#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L -#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L -#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L - -#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L -#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L -#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L -#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L - -#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L -#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L -#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L -#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L - -#define D3DPSHADECAPS_FOGFLAT 0x00040000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L -#define D3DPSHADECAPS_FOGPHONG 0x00100000L - -/* D3DPRIMCAPS dwTextureCaps */ - -/* - * Perspective-correct texturing is supported - */ -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L - -/* - * Power-of-2 texture dimensions are required - */ -#define D3DPTEXTURECAPS_POW2 0x00000002L - -/* - * Alpha in texture pixels is supported - */ -#define D3DPTEXTURECAPS_ALPHA 0x00000004L - -/* - * Color-keyed textures are supported - */ -#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L - -/* - * obsolete, see D3DPTADDRESSCAPS_BORDER - */ -#define D3DPTEXTURECAPS_BORDER 0x00000010L - -/* - * Only square textures are supported - */ -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L - -#if(DIRECT3D_VERSION >= 0x0600) -/* - * Texture indices are not scaled by the texture size prior - * to interpolation. - */ -#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L - -/* - * Device can draw alpha from texture palettes - */ -#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L - -/* - * Device can use non-POW2 textures if: - * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage - * 2) D3DRS_WRAP(N) is zero for this texture's coordinates - * 3) mip mapping is not enabled (use magnification filter only) - */ -#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L - -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) - -// 0x00000200L unused - -/* - * Device can divide transformed texture coordinates by the - * COUNTth texture coordinate (can do D3DTTFF_PROJECTED) - */ -#define D3DPTEXTURECAPS_PROJECTED 0x00000400L - -/* - * Device can do cubemap textures - */ -#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L - -#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* D3DPRIMCAPS dwTextureFilterCaps */ - -#define D3DPTFILTERCAPS_NEAREST 0x00000001L -#define D3DPTFILTERCAPS_LINEAR 0x00000002L -#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L -#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L -#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L -#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L - -#if(DIRECT3D_VERSION >= 0x0600) -/* Device3 Min Filter */ -#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L -#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L -#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L - -/* Device3 Mip Filter */ -#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L -#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L - -/* Device3 Mag Filter */ -#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L -#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L -#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L -#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L -#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* D3DPRIMCAPS dwTextureBlendCaps */ - -#define D3DPTBLENDCAPS_DECAL 0x00000001L -#define D3DPTBLENDCAPS_MODULATE 0x00000002L -#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L -#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L -#define D3DPTBLENDCAPS_DECALMASK 0x00000010L -#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L -#define D3DPTBLENDCAPS_COPY 0x00000040L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPTBLENDCAPS_ADD 0x00000080L -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* D3DPRIMCAPS dwTextureAddressCaps */ -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -/* D3DDEVICEDESC dwStencilCaps */ - -#define D3DSTENCILCAPS_KEEP 0x00000001L -#define D3DSTENCILCAPS_ZERO 0x00000002L -#define D3DSTENCILCAPS_REPLACE 0x00000004L -#define D3DSTENCILCAPS_INCRSAT 0x00000008L -#define D3DSTENCILCAPS_DECRSAT 0x00000010L -#define D3DSTENCILCAPS_INVERT 0x00000020L -#define D3DSTENCILCAPS_INCR 0x00000040L -#define D3DSTENCILCAPS_DECR 0x00000080L - -/* D3DDEVICEDESC dwTextureOpCaps */ - -#define D3DTEXOPCAPS_DISABLE 0x00000001L -#define D3DTEXOPCAPS_SELECTARG1 0x00000002L -#define D3DTEXOPCAPS_SELECTARG2 0x00000004L -#define D3DTEXOPCAPS_MODULATE 0x00000008L -#define D3DTEXOPCAPS_MODULATE2X 0x00000010L -#define D3DTEXOPCAPS_MODULATE4X 0x00000020L -#define D3DTEXOPCAPS_ADD 0x00000040L -#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L -#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L -#define D3DTEXOPCAPS_SUBTRACT 0x00000200L -#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L -#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L -#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L -#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L -#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L -#define D3DTEXOPCAPS_PREMODULATE 0x00010000L -#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L -#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L -#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L -#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L -#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L -#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L -#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L - -/* D3DDEVICEDESC dwFVFCaps flags */ - -#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ -#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Description for a device. - * This is used to describe a device that is to be created or to query - * the current device. - */ -typedef struct _D3DDeviceDesc { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ -#if(DIRECT3D_VERSION >= 0x0500) - // *** New fields for DX5 *** // - - // Width and height caps are 0 for legacy HALs. - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - // New fields for DX6 - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - - // Guard band that the rasterizer can accommodate - // Screen-space vertices inside this space but outside the viewport - // will get clipped properly. - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - - DWORD dwFVFCaps; - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; -#endif /* DIRECT3D_VERSION >= 0x0600 */ -} D3DDEVICEDESC, *LPD3DDEVICEDESC; - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DDeviceDesc7 { - DWORD dwDevCaps; /* Capabilities of device */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - - DWORD dwFVFCaps; - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; - - DWORD dwMaxActiveLights; - D3DVALUE dvMaxVertexW; - GUID deviceGUID; - - WORD wMaxUserClipPlanes; - WORD wMaxVertexBlendMatrices; - - DWORD dwVertexProcessingCaps; - - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwReserved4; -} D3DDEVICEDESC7, *LPD3DDEVICEDESC7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC)) -#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7)) - -typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID); - -#if(DIRECT3D_VERSION >= 0x0700) -typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID); -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* D3DDEVICEDESC dwFlags indicating valid fields */ - -#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */ -#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */ -#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */ -#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */ -#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */ -#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */ -#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */ -#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */ -#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */ -#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */ -#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */ - -/* D3DDEVICEDESC dwDevCaps flags */ - -#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */ - /* for post-transform vertex data */ -#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */ -#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */ -#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */ - -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#if(DIRECT3D_VERSION >= 0x0500) -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ -#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ -#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ -#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ -#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ - -/* - * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field - */ - -/* device can do texgen */ -#define D3DVTXPCAPS_TEXGEN 0x00000001L -/* device can do IDirect3DDevice7 colormaterialsource ops */ -#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L -/* device can do vertex fog */ -#define D3DVTXPCAPS_VERTEXFOG 0x00000004L -/* device can do directional lights */ -#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L -/* device can do positional lights (includes point and spot) */ -#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L -/* device can do local viewer */ -#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */ -#define D3DFDS_GUID 0x00000002L /* Match guid */ -#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */ -#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */ -#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */ -#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */ -#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */ -#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */ -#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */ -#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */ -#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */ -#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */ -#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */ -#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */ -#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */ -#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */ - -/* - * FindDevice arguments - */ -typedef struct _D3DFINDDEVICESEARCH { - DWORD dwSize; - DWORD dwFlags; - BOOL bHardware; - D3DCOLORMODEL dcmColorModel; - GUID guid; - DWORD dwCaps; - D3DPRIMCAPS dpcPrimCaps; -} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH; - -typedef struct _D3DFINDDEVICERESULT { - DWORD dwSize; - GUID guid; /* guid which matched */ - D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */ - D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */ -} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT; - -/* - * Description of execute buffer. - */ -typedef struct _D3DExecuteBufferDesc { - DWORD dwSize; /* size of this structure */ - DWORD dwFlags; /* flags indicating which fields are valid */ - DWORD dwCaps; /* capabilities of execute buffer */ - DWORD dwBufferSize; /* size of execute buffer data */ - LPVOID lpData; /* pointer to actual data */ -} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC; - -/* D3DEXECUTEBUFFER dwFlags indicating valid fields */ - -#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */ -#define D3DDEB_CAPS 0x00000002l /* caps valid */ -#define D3DDEB_LPDATA 0x00000004l /* lpData valid */ - -/* D3DEXECUTEBUFFER dwCaps */ - -#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */ -#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */ -#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY) - -#if(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DDEVINFO_TEXTUREMANAGER { - BOOL bThrashing; /* indicates if thrashing */ - DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */ - DWORD dwNumEvicts; /* number of textures evicted */ - DWORD dwNumVidCreates; /* number of textures created in video memory */ - DWORD dwNumTexturesUsed; /* number of textures used */ - DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */ - DWORD dwWorkingSet; /* number of textures in video memory */ - DWORD dwWorkingSetBytes; /* number of bytes in video memory */ - DWORD dwTotalManaged; /* total number of managed textures */ - DWORD dwTotalBytes; /* total number of bytes of managed textures */ - DWORD dwLastPri; /* priority of last texture evicted */ -} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER; - -typedef struct _D3DDEVINFO_TEXTURING { - DWORD dwNumLoads; /* counts Load() API calls */ - DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */ - DWORD dwNumPreLoads; /* counts PreLoad() API calls */ - DWORD dwNumSet; /* counts SetTexture() API calls */ - DWORD dwNumCreates; /* counts texture creates */ - DWORD dwNumDestroys; /* counts texture destroys */ - DWORD dwNumSetPriorities; /* counts SetPriority() API calls */ - DWORD dwNumSetLODs; /* counts SetLOD() API calls */ - DWORD dwNumLocks; /* counts number of texture locks */ - DWORD dwNumGetDCs; /* counts number of GetDCs to textures */ -} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#pragma pack() - - -#endif /* _D3DCAPS_H_ */ - diff --git a/import/DirectX8/include/d3drm.h b/import/DirectX8/include/d3drm.h deleted file mode 100644 index 2438bfe19..000000000 --- a/import/DirectX8/include/d3drm.h +++ /dev/null @@ -1,342 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRM_H__ -#define __D3DRM_H__ - -#include "ddraw.h" - -#ifdef __cplusplus -struct IDirect3DRM; -#endif - -typedef struct IDirect3DRM *LPDIRECT3DRM; - -#include "d3drmobj.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRM3, 0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -WIN_TYPES(IDirect3DRM, DIRECT3DRM); -WIN_TYPES(IDirect3DRM2, DIRECT3DRM2); -WIN_TYPES(IDirect3DRM3, DIRECT3DRM3); - -/* - * Direct3DRM Object Class (for CoCreateInstance()) - */ -DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); - - -/* Create a Direct3DRM API */ -STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM); - -#undef INTERFACE -#define INTERFACE IDirect3DRM - -DECLARE_INTERFACE_(IDirect3DRM, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD(CreateObject) - (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; - STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; - STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE; - STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; - STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; - STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; - STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateLightRGB) - (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE; - - /* Create a Windows Device using DirectDraw surfaces */ - STDMETHOD(CreateDeviceFromSurface) - ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, - LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE * - ) PURE; - - /* Create a Windows Device using D3D objects */ - STDMETHOD(CreateDeviceFromD3D) - ( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev, - LPDIRECT3DRMDEVICE * - ) PURE; - - STDMETHOD(CreateDeviceFromClipper) - ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, - int width, int height, LPDIRECT3DRMDEVICE *) PURE; - - STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE; - - STDMETHOD(CreateShadow) - ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, - LPDIRECT3DRMVISUAL * - ) PURE; - STDMETHOD(CreateViewport) - ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, - DWORD, DWORD, LPDIRECT3DRMVIEWPORT * - ) PURE; - STDMETHOD(CreateWrap) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv, - LPDIRECT3DRMWRAP * - ) PURE; - STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; - STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE; - - STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; - STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; - STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; - - STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; - STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; - - STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; - - STDMETHOD(Load) - ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, - D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, - LPDIRECT3DRMFRAME - ) PURE; - STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRM2 - -DECLARE_INTERFACE_(IDirect3DRM2, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD(CreateObject) - (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; - STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; - STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE; - STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; - STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; - STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; - STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE; - STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateLightRGB) - (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE; - - /* Create a Windows Device using DirectDraw surfaces */ - STDMETHOD(CreateDeviceFromSurface) - ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, - LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 * - ) PURE; - - /* Create a Windows Device using D3D objects */ - STDMETHOD(CreateDeviceFromD3D) - ( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev, - LPDIRECT3DRMDEVICE2 * - ) PURE; - - STDMETHOD(CreateDeviceFromClipper) - ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, - int width, int height, LPDIRECT3DRMDEVICE2 *) PURE; - - STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE; - - STDMETHOD(CreateShadow) - ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, - LPDIRECT3DRMVISUAL * - ) PURE; - STDMETHOD(CreateViewport) - ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, - DWORD, DWORD, LPDIRECT3DRMVIEWPORT * - ) PURE; - STDMETHOD(CreateWrap) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv, - LPDIRECT3DRMWRAP * - ) PURE; - STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; - STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE; - STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE; - - STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; - STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; - STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; - - STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; - STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; - - STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; - - STDMETHOD(Load) - ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, - D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, - LPDIRECT3DRMFRAME - ) PURE; - STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; - - STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRM3 - -DECLARE_INTERFACE_(IDirect3DRM3, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD(CreateObject) - (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; - STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME3, LPDIRECT3DRMFRAME3 *) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; - STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3 *) PURE; - STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE2 *) PURE; - STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION2 *) PURE; - STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET2 *) PURE; - STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE3 *) PURE; - STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateLightRGB) - (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL2 *) PURE; - STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE3 *) PURE; - - /* Create a Windows Device using DirectDraw surfaces */ - STDMETHOD(CreateDeviceFromSurface) - ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, - LPDIRECTDRAWSURFACE lpDDSBack, DWORD dwFlags, LPDIRECT3DRMDEVICE3 * - ) PURE; - - /* Create a Windows Device using D3D objects */ - STDMETHOD(CreateDeviceFromD3D) - ( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev, - LPDIRECT3DRMDEVICE3 * - ) PURE; - - STDMETHOD(CreateDeviceFromClipper) - ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, - int width, int height, LPDIRECT3DRMDEVICE3 *) PURE; - - STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE3 *) PURE; - - STDMETHOD(CreateShadow) - ( THIS_ LPUNKNOWN, LPDIRECT3DRMLIGHT, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, - LPDIRECT3DRMSHADOW2 * - ) PURE; - STDMETHOD(CreateViewport) - ( THIS_ LPDIRECT3DRMDEVICE3, LPDIRECT3DRMFRAME3, DWORD, DWORD, - DWORD, DWORD, LPDIRECT3DRMVIEWPORT2 * - ) PURE; - STDMETHOD(CreateWrap) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME3, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv, - LPDIRECT3DRMWRAP * - ) PURE; - STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; - STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE3 *) PURE; - STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE3 *) PURE; - - STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; - STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; - STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; - - STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; - STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; - - STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; - - STDMETHOD(Load) - ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, - D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURE3CALLBACK, LPVOID, - LPDIRECT3DRMFRAME3 - ) PURE; - STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; - - STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE; - - /* Used with IDirect3DRMObject2 */ - STDMETHOD(RegisterClient) (THIS_ REFGUID rguid, LPDWORD lpdwID) PURE; - STDMETHOD(UnregisterClient) (THIS_ REFGUID rguid) PURE; - - STDMETHOD(CreateClippedVisual) (THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMCLIPPEDVISUAL *) PURE; - STDMETHOD(SetOptions) (THIS_ DWORD); - STDMETHOD(GetOptions) (THIS_ LPDWORD); -}; - -#define D3DRM_OK DD_OK -#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781) -#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782) -#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783) -#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784) -#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785) -#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786) -#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787) -#define D3DRMERR_BADFILE MAKE_DDHRESULT(788) -#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789) -#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790) -#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791) -#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792) -#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793) -#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794) -#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795) -#define D3DRMERR_PENDING MAKE_DDHRESULT(796) -#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797) -#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798) -#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799) -#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800) -#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801) -#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802) -#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803) -#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804) -#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805) -#define D3DRMERR_CLIENTNOTREGISTERED MAKE_DDHRESULT(806) -#define D3DRMERR_NOTCREATEDFROMDDS MAKE_DDHRESULT(807) -#define D3DRMERR_NOSUCHKEY MAKE_DDHRESULT(808) -#define D3DRMERR_INCOMPATABLEKEY MAKE_DDHRESULT(809) -#define D3DRMERR_ELEMENTINUSE MAKE_DDHRESULT(810) -#define D3DRMERR_TEXTUREFORMATNOTFOUND MAKE_DDHRESULT(811) -#define D3DRMERR_NOTAGGREGATED MAKE_DDHRESULT(812) - -#ifdef __cplusplus -}; -#endif - -#endif /* _D3DRMAPI_H_ */ - - diff --git a/import/DirectX8/include/d3drmdef.h b/import/DirectX8/include/d3drmdef.h deleted file mode 100644 index f3d7048d3..000000000 --- a/import/DirectX8/include/d3drmdef.h +++ /dev/null @@ -1,695 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRMDEFS_H__ -#define __D3DRMDEFS_H__ - -#include -#include "d3dtypes.h" - -#ifdef WIN32 -#define D3DRMAPI __stdcall -#else -#define D3DRMAPI -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef TRUE -#define FALSE 0 -#define TRUE 1 -#endif - -typedef struct _D3DRMVECTOR4D -{ D3DVALUE x, y, z, w; -} D3DRMVECTOR4D, *LPD3DRMVECTOR4D; - -typedef D3DVALUE D3DRMMATRIX4D[4][4]; - -typedef struct _D3DRMQUATERNION -{ D3DVALUE s; - D3DVECTOR v; -} D3DRMQUATERNION, *LPD3DRMQUATERNION; - -typedef struct _D3DRMRAY -{ D3DVECTOR dvDir; - D3DVECTOR dvPos; -} D3DRMRAY, *LPD3DRMRAY; - -typedef struct _D3DRMBOX -{ D3DVECTOR min, max; -} D3DRMBOX, *LPD3DRMBOX; - -typedef void (*D3DRMWRAPCALLBACK) - (LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID); - -typedef enum _D3DRMLIGHTTYPE -{ D3DRMLIGHT_AMBIENT, - D3DRMLIGHT_POINT, - D3DRMLIGHT_SPOT, - D3DRMLIGHT_DIRECTIONAL, - D3DRMLIGHT_PARALLELPOINT -} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE; - -typedef enum _D3DRMSHADEMODE { - D3DRMSHADE_FLAT = 0, - D3DRMSHADE_GOURAUD = 1, - D3DRMSHADE_PHONG = 2, - - D3DRMSHADE_MASK = 7, - D3DRMSHADE_MAX = 8 -} D3DRMSHADEMODE, *LPD3DRMSHADEMODE; - -typedef enum _D3DRMLIGHTMODE { - D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX, - D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX, - - D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX, - D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX -} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE; - -typedef enum _D3DRMFILLMODE { - D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX, - D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX, - D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX, - - D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX, - D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX -} D3DRMFILLMODE, *LPD3DRMFILLMODE; - -typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY; - -#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME) -#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID) -#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID) -#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID) -#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID) - -#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1 -#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2 -#define D3DRMRENDERMODE_LIGHTINMODELSPACE 8 -#define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16 -#define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32 - -typedef enum _D3DRMTEXTUREQUALITY -{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */ - D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */ - D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */ - D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */ - D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */ - D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */ -} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY; - -/* - * Texture flags - */ -#define D3DRMTEXTURE_FORCERESIDENT 0x00000001 /* texture should be kept in video memory */ -#define D3DRMTEXTURE_STATIC 0x00000002 /* texture will not change */ -#define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004 /* point filtering should be used when downsampling */ -#define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008 /* bilinear filtering should be used when downsampling */ -#define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010 /* reduce bit depth when downsampling */ -#define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020 /* texture should never be downsampled */ -#define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040 /* pixels have changed */ -#define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080 /* palette has changed */ -#define D3DRMTEXTURE_INVALIDATEONLY 0x00000100 /* dirty regions are invalid */ - -/* - * Shadow flags - */ -#define D3DRMSHADOW_TRUEALPHA 0x00000001 /* shadow should render without artifacts when true alpha is on */ - -typedef enum _D3DRMCOMBINETYPE -{ D3DRMCOMBINE_REPLACE, - D3DRMCOMBINE_BEFORE, - D3DRMCOMBINE_AFTER -} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE; - -typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL; - -typedef enum _D3DRMPALETTEFLAGS -{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */ - D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */ - D3DRMPALETTE_RESERVED /* may not be used by renderer */ -} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS; - -typedef struct _D3DRMPALETTEENTRY -{ unsigned char red; /* 0 .. 255 */ - unsigned char green; /* 0 .. 255 */ - unsigned char blue; /* 0 .. 255 */ - unsigned char flags; /* one of D3DRMPALETTEFLAGS */ -} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY; - -typedef struct _D3DRMIMAGE -{ int width, height; /* width and height in pixels */ - int aspectx, aspecty; /* aspect ratio for non-square pixels */ - int depth; /* bits per pixel */ - int rgb; /* if false, pixels are indices into a - palette otherwise, pixels encode - RGB values. */ - int bytes_per_line; /* number of bytes of memory for a - scanline. This must be a multiple - of 4. */ - void* buffer1; /* memory to render into (first buffer). */ - void* buffer2; /* second rendering buffer for double - buffering, set to NULL for single - buffering. */ - unsigned long red_mask; - unsigned long green_mask; - unsigned long blue_mask; - unsigned long alpha_mask; /* if rgb is true, these are masks for - the red, green and blue parts of a - pixel. Otherwise, these are masks - for the significant bits of the - red, green and blue elements in the - palette. For instance, most SVGA - displays use 64 intensities of red, - green and blue, so the masks should - all be set to 0xfc. */ - int palette_size; /* number of entries in palette */ - D3DRMPALETTEENTRY* palette; /* description of the palette (only if - rgb is false). Must be (1< /* Use Windows header files */ -#define VIRTUAL -#include "d3drmdef.h" - -#include "d3d.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The methods for IUnknown - */ -#define IUNKNOWN_METHODS(kind) \ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ - STDMETHOD_(ULONG, AddRef) (THIS) kind; \ - STDMETHOD_(ULONG, Release) (THIS) kind - -/* - * The methods for IDirect3DRMObject - */ -#define IDIRECT3DRMOBJECT_METHODS(kind) \ - STDMETHOD(Clone) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) kind; \ - STDMETHOD(AddDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ - STDMETHOD(DeleteDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ - STDMETHOD(SetAppData) (THIS_ DWORD data) kind; \ - STDMETHOD_(DWORD, GetAppData) (THIS) kind; \ - STDMETHOD(SetName) (THIS_ LPCSTR) kind; \ - STDMETHOD(GetName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind; \ - STDMETHOD(GetClassName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind - - -#define WIN_TYPES(itype, ptype) \ - typedef interface itype FAR *LP##ptype, FAR **LPLP##ptype - -WIN_TYPES(IDirect3DRMObject, DIRECT3DRMOBJECT); -WIN_TYPES(IDirect3DRMObject2, DIRECT3DRMOBJECT2); -WIN_TYPES(IDirect3DRMDevice, DIRECT3DRMDEVICE); -WIN_TYPES(IDirect3DRMDevice2, DIRECT3DRMDEVICE2); -WIN_TYPES(IDirect3DRMDevice3, DIRECT3DRMDEVICE3); -WIN_TYPES(IDirect3DRMViewport, DIRECT3DRMVIEWPORT); -WIN_TYPES(IDirect3DRMViewport2, DIRECT3DRMVIEWPORT2); -WIN_TYPES(IDirect3DRMFrame, DIRECT3DRMFRAME); -WIN_TYPES(IDirect3DRMFrame2, DIRECT3DRMFRAME2); -WIN_TYPES(IDirect3DRMFrame3, DIRECT3DRMFRAME3); -WIN_TYPES(IDirect3DRMVisual, DIRECT3DRMVISUAL); -WIN_TYPES(IDirect3DRMMesh, DIRECT3DRMMESH); -WIN_TYPES(IDirect3DRMMeshBuilder, DIRECT3DRMMESHBUILDER); -WIN_TYPES(IDirect3DRMMeshBuilder2, DIRECT3DRMMESHBUILDER2); -WIN_TYPES(IDirect3DRMMeshBuilder3, DIRECT3DRMMESHBUILDER3); -WIN_TYPES(IDirect3DRMFace, DIRECT3DRMFACE); -WIN_TYPES(IDirect3DRMFace2, DIRECT3DRMFACE2); -WIN_TYPES(IDirect3DRMLight, DIRECT3DRMLIGHT); -WIN_TYPES(IDirect3DRMTexture, DIRECT3DRMTEXTURE); -WIN_TYPES(IDirect3DRMTexture2, DIRECT3DRMTEXTURE2); -WIN_TYPES(IDirect3DRMTexture3, DIRECT3DRMTEXTURE3); -WIN_TYPES(IDirect3DRMWrap, DIRECT3DRMWRAP); -WIN_TYPES(IDirect3DRMMaterial, DIRECT3DRMMATERIAL); -WIN_TYPES(IDirect3DRMMaterial2, DIRECT3DRMMATERIAL2); -WIN_TYPES(IDirect3DRMInterpolator, DIRECT3DRMINTERPOLATOR); -WIN_TYPES(IDirect3DRMAnimation, DIRECT3DRMANIMATION); -WIN_TYPES(IDirect3DRMAnimation2, DIRECT3DRMANIMATION2); -WIN_TYPES(IDirect3DRMAnimationSet, DIRECT3DRMANIMATIONSET); -WIN_TYPES(IDirect3DRMAnimationSet2, DIRECT3DRMANIMATIONSET2); -WIN_TYPES(IDirect3DRMUserVisual, DIRECT3DRMUSERVISUAL); -WIN_TYPES(IDirect3DRMShadow, DIRECT3DRMSHADOW); -WIN_TYPES(IDirect3DRMShadow2, DIRECT3DRMSHADOW2); -WIN_TYPES(IDirect3DRMArray, DIRECT3DRMARRAY); -WIN_TYPES(IDirect3DRMObjectArray, DIRECT3DRMOBJECTARRAY); -WIN_TYPES(IDirect3DRMDeviceArray, DIRECT3DRMDEVICEARRAY); -WIN_TYPES(IDirect3DRMFaceArray, DIRECT3DRMFACEARRAY); -WIN_TYPES(IDirect3DRMViewportArray, DIRECT3DRMVIEWPORTARRAY); -WIN_TYPES(IDirect3DRMFrameArray, DIRECT3DRMFRAMEARRAY); -WIN_TYPES(IDirect3DRMAnimationArray, DIRECT3DRMANIMATIONARRAY); -WIN_TYPES(IDirect3DRMVisualArray, DIRECT3DRMVISUALARRAY); -WIN_TYPES(IDirect3DRMPickedArray, DIRECT3DRMPICKEDARRAY); -WIN_TYPES(IDirect3DRMPicked2Array, DIRECT3DRMPICKED2ARRAY); -WIN_TYPES(IDirect3DRMLightArray, DIRECT3DRMLIGHTARRAY); -WIN_TYPES(IDirect3DRMProgressiveMesh, DIRECT3DRMPROGRESSIVEMESH); -WIN_TYPES(IDirect3DRMClippedVisual, DIRECT3DRMCLIPPEDVISUAL); - -/* - * Direct3DRM Object classes - */ -DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMViewportInterpolator, -0xde9eaa1, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMFrameInterpolator, -0xde9eaa2, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMMeshInterpolator, -0xde9eaa3, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMLightInterpolator, -0xde9eaa6, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMMaterialInterpolator, -0xde9eaa7, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMTextureInterpolator, -0xde9eaa8, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMProgressiveMesh, 0x4516ec40, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMClippedVisual, 0x5434e72d, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); - - -/* - * Direct3DRM Object interfaces - */ -DEFINE_GUID(IID_IDirect3DRMObject, 0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMObject2, 0x4516ec7c, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMDevice, 0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMDevice2, 0x4516ec78, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMDevice3, 0x549f498b, 0xbfeb, 0x11d1, 0x8e, 0xd8, 0x0, 0xa0, 0xc9, 0x67, 0xa4, 0x82); -DEFINE_GUID(IID_IDirect3DRMViewport, 0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMViewport2, 0x4a1b1be6, 0xbfed, 0x11d1, 0x8e, 0xd8, 0x0, 0xa0, 0xc9, 0x67, 0xa4, 0x82); -DEFINE_GUID(IID_IDirect3DRMFrame, 0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFrame2, 0xc3dfbd60, 0x3988, 0x11d0, 0x9e, 0xc2, 0x0, 0x0, 0xc0, 0x29, 0x1a, 0xc3); -DEFINE_GUID(IID_IDirect3DRMFrame3, 0xff6b7f70, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); -DEFINE_GUID(IID_IDirect3DRMVisual, 0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMesh, 0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMeshBuilder, 0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMeshBuilder2, 0x4516ec77, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMMeshBuilder3, 0x4516ec82, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMFace, 0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFace2, 0x4516ec81, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMLight, 0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMTexture, 0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMTexture2, 0x120f30c0, 0x1629, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); -DEFINE_GUID(IID_IDirect3DRMTexture3, 0xff6b7f73, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); -DEFINE_GUID(IID_IDirect3DRMWrap, 0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMaterial, 0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMaterial2, 0xff6b7f75, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); -DEFINE_GUID(IID_IDirect3DRMAnimation, 0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMAnimation2, 0xff6b7f77, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); -DEFINE_GUID(IID_IDirect3DRMAnimationSet, 0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMAnimationSet2, 0xff6b7f79, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); -DEFINE_GUID(IID_IDirect3DRMObjectArray, 0x242f6bc2, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMDeviceArray, 0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMViewportArray, 0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFrameArray, 0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMVisualArray, 0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMLightArray, 0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMPickedArray, 0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFaceArray, 0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMAnimationArray, -0xd5f1cae0, 0x4bd7, 0x11d1, 0xb9, 0x74, 0x0, 0x60, 0x8, 0x3e, 0x45, 0xf3); -DEFINE_GUID(IID_IDirect3DRMUserVisual, 0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMShadow, 0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMShadow2, 0x86b44e25, 0x9c82, 0x11d1, 0xbb, 0xb, 0x0, 0xa0, 0xc9, 0x81, 0xa0, 0xa6); -DEFINE_GUID(IID_IDirect3DRMInterpolator, 0x242f6bc1, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMProgressiveMesh, 0x4516ec79, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMPicked2Array, 0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMClippedVisual, 0x5434e733, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); - -typedef void (__cdecl *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); -typedef void (__cdecl *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); -typedef void (__cdecl *D3DRMFRAME3MOVECALLBACK)(LPDIRECT3DRMFRAME3 obj, LPVOID arg, D3DVALUE delta); -typedef void (__cdecl *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); -typedef void (__cdecl *D3DRMDEVICE3UPDATECALLBACK)(LPDIRECT3DRMDEVICE3 obj, LPVOID arg, int, LPD3DRECT); -typedef int (__cdecl *D3DRMUSERVISUALCALLBACK) - ( LPDIRECT3DRMUSERVISUAL obj, LPVOID arg, D3DRMUSERVISUALREASON reason, - LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMVIEWPORT view - ); -typedef HRESULT (__cdecl *D3DRMLOADTEXTURECALLBACK) - (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE *); -typedef HRESULT (__cdecl *D3DRMLOADTEXTURE3CALLBACK) - (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE3 *); -typedef void (__cdecl *D3DRMLOADCALLBACK) - (LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg); - -typedef HRESULT (__cdecl *D3DRMDOWNSAMPLECALLBACK) - (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, - LPDIRECTDRAWSURFACE pDDSSrc, LPDIRECTDRAWSURFACE pDDSDst); -typedef HRESULT (__cdecl *D3DRMVALIDATIONCALLBACK) - (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, - DWORD dwFlags, DWORD dwcRects, LPRECT pRects); - - -typedef struct _D3DRMPICKDESC -{ - ULONG ulFaceIdx; - LONG lGroupIdx; - D3DVECTOR vPosition; - -} D3DRMPICKDESC, *LPD3DRMPICKDESC; - -typedef struct _D3DRMPICKDESC2 -{ - ULONG ulFaceIdx; - LONG lGroupIdx; - D3DVECTOR dvPosition; - D3DVALUE tu; - D3DVALUE tv; - D3DVECTOR dvNormal; - D3DCOLOR dcColor; - -} D3DRMPICKDESC2, *LPD3DRMPICKDESC2; - -#undef INTERFACE -#define INTERFACE IDirect3DRMObject - -/* - * Base class - */ -DECLARE_INTERFACE_(IDirect3DRMObject, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMObject2 - -DECLARE_INTERFACE_(IDirect3DRMObject2, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - /* - * IDirect3DRMObject2 methods - */ - STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK lpFunc, LPVOID pvArg) PURE; - STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE; \ - STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK lpFunc, LPVOID pvArg) PURE; \ - STDMETHOD(GetClientData)(THIS_ DWORD dwID, LPVOID* lplpvData) PURE; - STDMETHOD(GetDirect3DRM)(THIS_ LPDIRECT3DRM* lplpDirect3DRM) PURE; - STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE; - STDMETHOD(SetClientData)(THIS_ DWORD dwID, LPVOID lpvData, DWORD dwFlags) PURE; - STDMETHOD(SetName)(THIS_ LPCSTR lpName) PURE; - STDMETHOD(GetAge)(THIS_ DWORD dwFlags, LPDWORD pdwAge) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMVisual - -DECLARE_INTERFACE_(IDirect3DRMVisual, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDevice - -DECLARE_INTERFACE_(IDirect3DRMDevice, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMDevice methods - */ - STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; - STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; - STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; - - STDMETHOD(Update)(THIS) PURE; - STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; - STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; - - STDMETHOD(SetDither)(THIS_ BOOL) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; - - STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; - - STDMETHOD_(BOOL, GetDither)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; - STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; - STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; - STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDevice2 - -DECLARE_INTERFACE_(IDirect3DRMDevice2, IDirect3DRMDevice) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMDevice methods - */ - STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; - STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; - STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; - - STDMETHOD(Update)(THIS) PURE; - STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; - STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; - - STDMETHOD(SetDither)(THIS_ BOOL) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; - - STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; - - STDMETHOD_(BOOL, GetDither)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; - STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; - STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; - STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; - - /* - * IDirect3DRMDevice2 methods - */ - STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, LPDIRECTDRAWSURFACE lpDDSBack) PURE; - STDMETHOD(SetRenderMode)(THIS_ DWORD dwFlags) PURE; - STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; - STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDevice3 - -DECLARE_INTERFACE_(IDirect3DRMDevice3, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMDevice methods - */ - STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; - STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; - STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; - - STDMETHOD(Update)(THIS) PURE; - STDMETHOD(AddUpdateCallback)(THIS_ D3DRMDEVICE3UPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMDEVICE3UPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; - STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; - - STDMETHOD(SetDither)(THIS_ BOOL) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; - - STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; - - STDMETHOD_(BOOL, GetDither)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; - STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; - STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; - STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; - - /* - * IDirect3DRMDevice2 methods - */ - STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, LPDIRECTDRAWSURFACE lpDDSBack, DWORD dwFlags) PURE; - STDMETHOD(SetRenderMode)(THIS_ DWORD dwFlags) PURE; - STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; - STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE; - - /* - * IDirect3DRMDevice3 methods - */ - STDMETHOD(FindPreferredTextureFormat)(THIS_ DWORD dwBitDepths, DWORD dwFlags, LPDDPIXELFORMAT lpDDPF) PURE; - STDMETHOD(RenderStateChange)(THIS_ D3DRENDERSTATETYPE drsType, DWORD dwVal, DWORD dwFlags) PURE; - STDMETHOD(LightStateChange)(THIS_ D3DLIGHTSTATETYPE drsType, DWORD dwVal, DWORD dwFlags) PURE; - STDMETHOD(GetStateChangeOptions)(THIS_ DWORD dwStateClass, DWORD dwStateNum, LPDWORD pdwFlags) PURE; - STDMETHOD(SetStateChangeOptions)(THIS_ DWORD dwStateClass, DWORD dwStateNum, DWORD dwFlags) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirect3DRMViewport - -DECLARE_INTERFACE_(IDirect3DRMViewport, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMViewport methods - */ - STDMETHOD(Init) - ( THIS_ LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMFRAME camera, - DWORD xpos, DWORD ypos, DWORD width, DWORD height - ) PURE; - STDMETHOD(Clear)(THIS) PURE; - STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME) PURE; - - STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; - STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; - STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; - STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; - STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; - STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; - - STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE *) PURE; - STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; - STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; - - STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; - STDMETHOD_(LONG, GetX)(THIS) PURE; - STDMETHOD_(LONG, GetY)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; - STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; - STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMViewport2 -DECLARE_INTERFACE_(IDirect3DRMViewport2, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMViewport2 methods - */ - STDMETHOD(Init) - ( THIS_ LPDIRECT3DRMDEVICE3 dev, LPDIRECT3DRMFRAME3 camera, - DWORD xpos, DWORD ypos, DWORD width, DWORD height - ) PURE; - STDMETHOD(Clear)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME3) PURE; - - STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; - STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME3) PURE; - STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; - STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; - STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; - STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; - STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; - - STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE3 *) PURE; - STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; - STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; - - STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; - STDMETHOD_(LONG, GetX)(THIS) PURE; - STDMETHOD_(LONG, GetY)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; - STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; - STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; - STDMETHOD(TransformVectors)(THIS_ DWORD dwNumVectors, - LPD3DRMVECTOR4D lpDstVectors, - LPD3DVECTOR lpSrcVectors) PURE; - STDMETHOD(InverseTransformVectors)(THIS_ DWORD dwNumVectors, - LPD3DVECTOR lpDstVectors, - LPD3DRMVECTOR4D lpSrcVectors) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrame - -DECLARE_INTERFACE_(IDirect3DRMFrame, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFrame methods - */ - STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; - STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; - STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; - STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; - STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; - STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; - STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; - STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; - STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; - STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; - STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; - STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; - STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; - STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; - STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; - STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; - STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; - STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; - STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; - STDMETHOD(SetOrientation) - ( THIS_ LPDIRECT3DRMFRAME reference, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz - ) PURE; - STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; - STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; - STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrame2 - -DECLARE_INTERFACE_(IDirect3DRMFrame2, IDirect3DRMFrame) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFrame methods - */ - STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; - STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; - STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; - STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; - STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; - STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; - STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; - STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; - STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; - STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; - STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; - STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; - STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; - STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; - STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; - STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; - STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; - STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; - STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; - STDMETHOD(SetOrientation) - ( THIS_ LPDIRECT3DRMFRAME reference, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz - ) PURE; - STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; - STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; - STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - - /* - * IDirect3DRMFrame2 methods - */ - STDMETHOD(AddMoveCallback2)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg, DWORD dwFlags) PURE; - STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; - STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up); - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD_(BOOL, GetInheritAxes)(THIS); - STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE; - - STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); - STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME reference, D3DRMQUATERNION *q) PURE; - - STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DRMRAY ray, DWORD dwFlags, LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE; - STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, - D3DRMSAVEOPTIONS d3dSaveFlags); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrame3 - -DECLARE_INTERFACE_(IDirect3DRMFrame3, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFrame3 methods - */ - STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME3 child) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg, DWORD dwFlags) PURE; - STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; - STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(AddVisual)(THIS_ LPUNKNOWN) PURE; - STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; - STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; - STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; - STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_position) PURE; - STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; - STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; - STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE; - STDMETHOD(GetTransform)(THIS_ LPDIRECT3DRMFRAME3 reference, - D3DRMMATRIX4D rmMatrix) PURE; - STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; - STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; - STDMETHOD(GetVisuals)(THIS_ LPDWORD lpdwCount, LPUNKNOWN *) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg)PURE; - STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME3 target, LPDIRECT3DRMFRAME3 reference, D3DRMFRAMECONSTRAINT) PURE; - STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; - STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME3) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg) PURE; - STDMETHOD(DeleteVisual)(THIS_ LPUNKNOWN) PURE; - STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; - STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; - STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; - STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; - STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; - STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; - STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; - STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; - STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; - STDMETHOD(SetOrientation) - ( THIS_ LPDIRECT3DRMFRAME3 reference, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz - ) PURE; - STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; - STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; - STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; - STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; - STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up); - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE; - STDMETHOD_(BOOL, GetInheritAxes)(THIS); - STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE; - - STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); - STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; - STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DRMQUATERNION *q) PURE; - - STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DRMRAY ray, DWORD dwFlags, LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE; - STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, - D3DRMSAVEOPTIONS d3dSaveFlags); - STDMETHOD(TransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, - DWORD dwNumVectors, - LPD3DVECTOR lpDstVectors, - LPD3DVECTOR lpSrcVectors) PURE; - STDMETHOD(InverseTransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, - DWORD dwNumVectors, - LPD3DVECTOR lpDstVectors, - LPD3DVECTOR lpSrcVectors) PURE; - STDMETHOD(SetTraversalOptions)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetTraversalOptions)(THIS_ LPDWORD lpdwFlags) PURE; - STDMETHOD(SetSceneFogMethod)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetSceneFogMethod)(THIS_ LPDWORD lpdwFlags) PURE; - STDMETHOD(SetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE; - STDMETHOD(GetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMesh - -DECLARE_INTERFACE_(IDirect3DRMMesh, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMesh methods - */ - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData, D3DRMGROUPINDEX *returnId) PURE; - STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count, D3DRMVERTEX *values) PURE; - STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE; - STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE; - STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE; - STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE; - STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value) PURE; - - STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE; - STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, DWORD *fDataSize, unsigned *fData) PURE; - STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE; - STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE; - STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMProgressiveMesh - -DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMProgressiveMesh methods - */ - STDMETHOD(Load) (THIS_ LPVOID lpObjLocation, LPVOID lpObjId, - D3DRMLOADOPTIONS dloLoadflags, D3DRMLOADTEXTURECALLBACK lpCallback, - LPVOID lpArg) PURE; - STDMETHOD(GetLoadStatus) (THIS_ LPD3DRMPMESHLOADSTATUS lpStatus) PURE; - STDMETHOD(SetMinRenderDetail) (THIS_ D3DVALUE d3dVal) PURE; - STDMETHOD(Abort) (THIS_ DWORD dwFlags) PURE; - - STDMETHOD(GetFaceDetail) (THIS_ LPDWORD lpdwCount) PURE; - STDMETHOD(GetVertexDetail) (THIS_ LPDWORD lpdwCount) PURE; - STDMETHOD(SetFaceDetail) (THIS_ DWORD dwCount) PURE; - STDMETHOD(SetVertexDetail) (THIS_ DWORD dwCount) PURE; - STDMETHOD(GetFaceDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; - STDMETHOD(GetVertexDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; - STDMETHOD(GetDetail) (THIS_ D3DVALUE *lpdvVal) PURE; - STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE; - - STDMETHOD(RegisterEvents) (THIS_ HANDLE hEvent, DWORD dwFlags, DWORD dwReserved) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *lplpD3DRMMesh) PURE; - STDMETHOD(Duplicate) (THIS_ LPDIRECT3DRMPROGRESSIVEMESH *lplpD3DRMPMesh) PURE; - STDMETHOD(GetBox) (THIS_ LPD3DRMBOX lpBBox) PURE; - STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(GetQuality) (THIS_ LPD3DRMRENDERQUALITY lpdwquality) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMShadow - -DECLARE_INTERFACE_(IDirect3DRMShadow, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMShadow methods - */ - STDMETHOD(Init) - ( THIS_ LPDIRECT3DRMVISUAL visual, LPDIRECT3DRMLIGHT light, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz - ) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMShadow2 - -DECLARE_INTERFACE_(IDirect3DRMShadow2, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMShadow methods - */ - STDMETHOD(Init) - ( THIS_ LPUNKNOWN pUNK, LPDIRECT3DRMLIGHT light, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz - ) PURE; - - /* - * IDirect3DRMShadow2 methods - */ - STDMETHOD(GetVisual)(THIS_ LPDIRECT3DRMVISUAL *) PURE; - STDMETHOD(SetVisual)(THIS_ LPUNKNOWN pUNK, DWORD) PURE; - STDMETHOD(GetLight)(THIS_ LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(SetLight)(THIS_ LPDIRECT3DRMLIGHT, DWORD) PURE; - STDMETHOD(GetPlane)(THIS_ LPD3DVALUE px, LPD3DVALUE py, LPD3DVALUE pz, - LPD3DVALUE nx, LPD3DVALUE ny, LPD3DVALUE nz) PURE; - STDMETHOD(SetPlane)(THIS_ D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, DWORD) PURE; - STDMETHOD(GetOptions)(THIS_ LPDWORD) PURE; - STDMETHOD(SetOptions)(THIS_ DWORD) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFace - -DECLARE_INTERFACE_(IDirect3DRMFace, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFace methods - */ - STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - - STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; - STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; - - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFace2 - -DECLARE_INTERFACE_(IDirect3DRMFace2, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFace methods - */ - STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - - STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; - STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE; - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE; - - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMeshBuilder - -DECLARE_INTERFACE_(IDirect3DRMMeshBuilder, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMeshBuilder methods - */ - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; - STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(GenerateNormals)(THIS) PURE; - STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; - - STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; - STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; - STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; - STDMETHOD(AddFaces) - ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, - DWORD *data, LPDIRECT3DRMFACEARRAY* - ) PURE; - STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; - STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; - STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - - STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; - STDMETHOD(GetVertices) - ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data - ) PURE; - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; - - STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; - STDMETHOD_(int, GetFaceCount)(THIS) PURE; - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; - - STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMeshBuilder2 - -DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2, IDirect3DRMMeshBuilder) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMeshBuilder methods - */ - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; - STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(GenerateNormals)(THIS) PURE; - STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; - - STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; - STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; - STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; - STDMETHOD(AddFaces) - ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, - DWORD *data, LPDIRECT3DRMFACEARRAY* - ) PURE; - STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; - STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; - STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - - STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; - STDMETHOD(GetVertices) - ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data - ) PURE; - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; - - STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; - STDMETHOD_(int, GetFaceCount)(THIS) PURE; - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; - - STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; - - /* - * IDirect3DRMMeshBuilder2 methods - */ - STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD dwFlags) PURE; - STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMeshBuilder3 - -DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMeshBuilder3 methods - */ - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg) PURE; - STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(GenerateNormals)(THIS_ D3DVALUE crease, DWORD dwFlags) PURE; - STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; - - STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; - STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3, DWORD dwFlags) PURE; - STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME3) PURE; - STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE2) PURE; - STDMETHOD(AddFaces) - ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, - DWORD *data, LPDIRECT3DRMFACEARRAY* - ) PURE; - STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; - STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; - STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; - STDMETHOD(GetGeometry) - ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data - ) PURE; - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; - STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE2 *) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; - STDMETHOD_(int, GetFaceCount)(THIS) PURE; - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; - STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; - STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE2 *) PURE; - STDMETHOD(GetVertex)(THIS_ DWORD dwIndex, LPD3DVECTOR lpVector) PURE; - STDMETHOD(GetNormal)(THIS_ DWORD dwIndex, LPD3DVECTOR lpVector) PURE; - STDMETHOD(DeleteVertices)(THIS_ DWORD dwIndexFirst, DWORD dwCount) PURE; - STDMETHOD(DeleteNormals)(THIS_ DWORD dwIndexFirst, DWORD dwCount) PURE; - STDMETHOD(DeleteFace)(THIS_ LPDIRECT3DRMFACE2) PURE; - STDMETHOD(Empty)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(Optimize)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(AddFacesIndexed)(THIS_ DWORD dwFlags, DWORD *lpdwvIndices, DWORD *dwIndexFirst, DWORD *dwCount) PURE; - STDMETHOD(CreateSubMesh)(THIS_ LPUNKNOWN *) PURE; - STDMETHOD(GetParentMesh)(THIS_ DWORD, LPUNKNOWN *) PURE; - STDMETHOD(GetSubMeshes)(THIS_ LPDWORD lpdwCount, LPUNKNOWN *) PURE; - STDMETHOD(DeleteSubMesh)(THIS_ LPUNKNOWN) PURE; - STDMETHOD(Enable)(THIS_ DWORD) PURE; - STDMETHOD(GetEnable)(THIS_ DWORD *) PURE; - STDMETHOD(AddTriangles)(THIS_ DWORD dwFlags, DWORD dwFormat, - DWORD dwVertexCount, LPVOID lpvData) PURE; - STDMETHOD(SetVertices)(THIS_ DWORD dwIndexFirst, DWORD dwCount, LPD3DVECTOR) PURE; - STDMETHOD(GetVertices)(THIS_ DWORD dwIndexFirst, LPDWORD lpdwCount, LPD3DVECTOR) PURE; - STDMETHOD(SetNormals)(THIS_ DWORD dwIndexFirst, DWORD dwCount, LPD3DVECTOR) PURE; - STDMETHOD(GetNormals)(THIS_ DWORD dwIndexFirst, LPDWORD lpdwCount, LPD3DVECTOR) PURE; - STDMETHOD_(int, GetNormalCount)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMLight - -DECLARE_INTERFACE_(IDirect3DRMLight, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMLight methods - */ - STDMETHOD(SetType)(THIS_ D3DRMLIGHTTYPE) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetRange)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetUmbra)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetPenumbra)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetConstantAttenuation)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetLinearAttenuation)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetQuadraticAttenuation)(THIS_ D3DVALUE) PURE; - - STDMETHOD_(D3DVALUE, GetRange)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetUmbra)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetPenumbra)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetConstantAttenuation)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetLinearAttenuation)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetQuadraticAttenuation)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD_(D3DRMLIGHTTYPE, GetType)(THIS) PURE; - - STDMETHOD(SetEnableFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(GetEnableFrame)(THIS_ LPDIRECT3DRMFRAME*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMTexture - -DECLARE_INTERFACE_(IDirect3DRMTexture, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMTexture methods - */ - STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; - STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; - STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; - - STDMETHOD(SetColors)(THIS_ DWORD) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; - STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; - STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; - STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; - - STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; - STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; - - STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetColors)(THIS) PURE; - STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; - STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMTexture2 - -DECLARE_INTERFACE_(IDirect3DRMTexture2, IDirect3DRMTexture) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMTexture methods - */ - STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; - STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; - STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; - - STDMETHOD(SetColors)(THIS_ DWORD) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; - STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; - STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; - STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; - - STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; - STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; - - STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetColors)(THIS) PURE; - STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; - STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; - - /* - * IDirect3DRMTexture2 methods - */ - STDMETHOD(InitFromImage)(THIS_ LPD3DRMIMAGE) PURE; - STDMETHOD(InitFromResource2)(THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType) PURE; - STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMTexture3 - -DECLARE_INTERFACE_(IDirect3DRMTexture3, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMTexture3 methods - */ - STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; - STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; - STDMETHOD(Changed)(THIS_ DWORD dwFlags, DWORD dwcRects, LPRECT pRects) PURE; - STDMETHOD(SetColors)(THIS_ DWORD) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; - STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; - STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; - STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; - - STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; - STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; - - STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetColors)(THIS) PURE; - STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; - STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; - STDMETHOD(InitFromImage)(THIS_ LPD3DRMIMAGE) PURE; - STDMETHOD(InitFromResource2)(THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType) PURE; - STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; - STDMETHOD(GetSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE* lplpDDS) PURE; - STDMETHOD(SetCacheOptions)(THIS_ LONG lImportance, DWORD dwFlags) PURE; - STDMETHOD(GetCacheOptions)(THIS_ LPLONG lplImportance, LPDWORD lpdwFlags) PURE; - STDMETHOD(SetDownsampleCallback)(THIS_ D3DRMDOWNSAMPLECALLBACK pCallback, LPVOID pArg) PURE; - STDMETHOD(SetValidationCallback)(THIS_ D3DRMVALIDATIONCALLBACK pCallback, LPVOID pArg) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirect3DRMWrap - -DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMWrap methods - */ - STDMETHOD(Init) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME ref, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv - ) PURE; - STDMETHOD(Apply)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(ApplyRelative)(THIS_ LPDIRECT3DRMFRAME frame, LPDIRECT3DRMOBJECT) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMaterial - -DECLARE_INTERFACE_(IDirect3DRMMaterial, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMaterial methods - */ - STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; - STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - - STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; - STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; - STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirect3DRMMaterial2 - -DECLARE_INTERFACE_(IDirect3DRMMaterial2, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMaterial2 methods - */ - STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; - STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; - STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; - STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; - STDMETHOD(GetAmbient)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; - STDMETHOD(SetAmbient)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimation - -DECLARE_INTERFACE_(IDirect3DRMAnimation, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimation methods - */ - STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; - STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; - STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; - STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME frame) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; - - STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimation2 - -DECLARE_INTERFACE_(IDirect3DRMAnimation2, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimation2 methods - */ - STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; - STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; - STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; - STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME3 frame) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; - - STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; - STDMETHOD(GetFrame)(THIS_ LPDIRECT3DRMFRAME3 *lpD3DFrame) PURE; - STDMETHOD(DeleteKeyByID)(THIS_ DWORD dwID) PURE; - STDMETHOD(AddKey)(THIS_ LPD3DRMANIMATIONKEY lpKey) PURE; - STDMETHOD(ModifyKey)(THIS_ LPD3DRMANIMATIONKEY lpKey) PURE; - STDMETHOD(GetKeys)(THIS_ D3DVALUE dvTimeMin, - D3DVALUE dvTimeMax, LPDWORD lpdwNumKeys, - LPD3DRMANIMATIONKEY lpKey); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimationSet - -DECLARE_INTERFACE_(IDirect3DRMAnimationSet, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimationSet methods - */ - STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME parent)PURE; - STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimationSet2 - -DECLARE_INTERFACE_(IDirect3DRMAnimationSet2, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimationSet2 methods - */ - STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION2 aid) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME3 parent)PURE; - STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION2 aid) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; - STDMETHOD(GetAnimations)(THIS_ LPDIRECT3DRMANIMATIONARRAY *) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirect3DRMUserVisual - -DECLARE_INTERFACE_(IDirect3DRMUserVisual, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMUserVisual methods - */ - STDMETHOD(Init)(THIS_ D3DRMUSERVISUALCALLBACK fn, void *arg) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMArray - -DECLARE_INTERFACE_(IDirect3DRMArray, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - /* No GetElement method as it would get overloaded - * in derived classes, and overloading is - * a no-no in COM - */ -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMObjectArray - -DECLARE_INTERFACE_(IDirect3DRMObjectArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMOBJECT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDeviceArray - -DECLARE_INTERFACE_(IDirect3DRMDeviceArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMDEVICE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrameArray - -DECLARE_INTERFACE_(IDirect3DRMFrameArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFRAME *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMViewportArray - -DECLARE_INTERFACE_(IDirect3DRMViewportArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVIEWPORT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMVisualArray - -DECLARE_INTERFACE_(IDirect3DRMVisualArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimationArray - -DECLARE_INTERFACE_(IDirect3DRMAnimationArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMANIMATION2 *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMPickedArray - -DECLARE_INTERFACE_(IDirect3DRMPickedArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMLightArray - -DECLARE_INTERFACE_(IDirect3DRMLightArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMLIGHT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFaceArray - -DECLARE_INTERFACE_(IDirect3DRMFaceArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFACE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMPicked2Array - -DECLARE_INTERFACE_(IDirect3DRMPicked2Array, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC2) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMInterpolator - -DECLARE_INTERFACE_(IDirect3DRMInterpolator, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMInterpolator methods - */ - STDMETHOD(AttachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(GetAttachedObjects)(THIS_ LPDIRECT3DRMOBJECTARRAY *) PURE; - STDMETHOD(DetachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(SetIndex)(THIS_ D3DVALUE) PURE; - STDMETHOD_(D3DVALUE, GetIndex)(THIS) PURE; - STDMETHOD(Interpolate)(THIS_ D3DVALUE, LPDIRECT3DRMOBJECT, D3DRMINTERPOLATIONOPTIONS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMClippedVisual - -DECLARE_INTERFACE_(IDirect3DRMClippedVisual, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMClippedVisual methods - */ - STDMETHOD(Init) (THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD(AddPlane) (THIS_ LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD, LPDWORD) PURE; - STDMETHOD(DeletePlane)(THIS_ DWORD, DWORD) PURE; - STDMETHOD(GetPlaneIDs)(THIS_ LPDWORD, LPDWORD, DWORD) PURE; - STDMETHOD(GetPlane) (THIS_ DWORD, LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD) PURE; - STDMETHOD(SetPlane) (THIS_ DWORD, LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD) PURE; -}; - -#ifdef __cplusplus -}; -#endif -#endif /* _D3DRMOBJ_H_ */ - diff --git a/import/DirectX8/include/d3drmwin.h b/import/DirectX8/include/d3drmwin.h deleted file mode 100644 index 3ed5c9d0f..000000000 --- a/import/DirectX8/include/d3drmwin.h +++ /dev/null @@ -1,50 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRMWIN_H__ -#define __D3DRMWIN_H__ - -#ifndef WIN32 -#define WIN32 -#endif - -#include "d3drm.h" - -#include "ddraw.h" -#include "d3d.h" - -/* - * GUIDS used by Direct3DRM Windows interface - */ -DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); - -WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); - -#undef INTERFACE -#define INTERFACE IDirect3DRMWinDevice - -DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMWinDevice methods - */ - - /* Repaint the window with the last frame which was rendered. */ - STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; - - /* Respond to a WM_ACTIVATE message. */ - STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; -}; - - -#endif - diff --git a/import/DirectX8/include/d3dtypes.h b/import/DirectX8/include/d3dtypes.h deleted file mode 100644 index 6a664971a..000000000 --- a/import/DirectX8/include/d3dtypes.h +++ /dev/null @@ -1,2117 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3dtypes.h - * Content: Direct3D types include file - * - ***************************************************************************/ - -#ifndef _D3DTYPES_H_ -#define _D3DTYPES_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0700 -#endif - -#if (DIRECT3D_VERSION >= 0x0800) -#pragma message("should not include d3dtypes.h when compiling for DX8 or newer interfaces") -#endif - -#include - -#include -#include "ddraw.h" - -#pragma warning(disable:4201) // anonymous unions warning -#pragma pack(4) - - -/* D3DVALUE is the fundamental Direct3D fractional data type */ - -#define D3DVALP(val, prec) ((float)(val)) -#define D3DVAL(val) ((float)(val)) - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are - * other types in this header that are also shared. The last of these - * shared defines in this file will set DX_SHARED_DEFINES. - */ -typedef float D3DVALUE, *LPD3DVALUE; - -#endif /* DX_SHARED_DEFINES */ - -#define D3DDivide(a, b) (float)((double) (a) / (double) (b)) -#define D3DMultiply(a, b) ((a) * (b)) - -typedef LONG D3DFIXED; - -#ifndef RGB_MAKE -/* - * Format of CI colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | color index | fraction | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define CI_GETALPHA(ci) ((ci) >> 24) -#define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff) -#define CI_GETFRACTION(ci) ((ci) & 0xff) -#define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80) -#define CI_MASKALPHA(ci) ((ci) & 0xffffff) -#define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f)) - -/* - * Format of RGBA colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGBA_GETALPHA(rgb) ((rgb) >> 24) -#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGBA_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))) - -/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs - * The float values must be in the range 0..1 - */ -#define D3DRGB(r, g, b) \ - (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255)) -#define D3DRGBA(r, g, b, a) \ - ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \ - | (((long)((g) * 255)) << 8) | (long)((b) * 255) \ - ) - -/* - * Format of RGB colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ignored | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGB_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff)) -#define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b))) -#define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff)) -#define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000)) - -#endif - -/* - * Flags for Enumerate functions - */ - -/* - * Stop the enumeration - */ -#define D3DENUMRET_CANCEL DDENUMRET_CANCEL - -/* - * Continue the enumeration - */ -#define D3DENUMRET_OK DDENUMRET_OK - -typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset); -typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext); -typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext); - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are - * other types in this header that are also shared. The last of these - * shared defines in this file will set DX_SHARED_DEFINES. - */ -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif -typedef DWORD *LPD3DCOLOR; - -#endif /* DX_SHARED_DEFINES */ - -typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE; -typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE; -typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE; - -#ifndef D3DCOLORVALUE_DEFINED -typedef struct _D3DCOLORVALUE { - union { - D3DVALUE r; - D3DVALUE dvR; - }; - union { - D3DVALUE g; - D3DVALUE dvG; - }; - union { - D3DVALUE b; - D3DVALUE dvB; - }; - union { - D3DVALUE a; - D3DVALUE dvA; - }; -} D3DCOLORVALUE; -#define D3DCOLORVALUE_DEFINED -#endif -typedef struct _D3DCOLORVALUE *LPD3DCOLORVALUE; - -#ifndef D3DRECT_DEFINED -typedef struct _D3DRECT { - union { - LONG x1; - LONG lX1; - }; - union { - LONG y1; - LONG lY1; - }; - union { - LONG x2; - LONG lX2; - }; - union { - LONG y2; - LONG lY2; - }; -} D3DRECT; -#define D3DRECT_DEFINED -#endif -typedef struct _D3DRECT *LPD3DRECT; - -#ifndef DX_SHARED_DEFINES - -/* - * This definition is shared with other DirectX components whose header files - * might already have defined it. Therefore, we don't define this type if - * someone else already has (as indicated by the definition of - * DX_SHARED_DEFINES). - */ - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - union { - D3DVALUE x; - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - -public: - - // ===================================== - // Constructors - // ===================================== - - _D3DVECTOR() { } - _D3DVECTOR(D3DVALUE f); - _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z); - _D3DVECTOR(const D3DVALUE f[3]); - - // ===================================== - // Access grants - // ===================================== - - const D3DVALUE&operator[](int i) const; - D3DVALUE&operator[](int i); - - // ===================================== - // Assignment operators - // ===================================== - - _D3DVECTOR& operator += (const _D3DVECTOR& v); - _D3DVECTOR& operator -= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (const _D3DVECTOR& v); - _D3DVECTOR& operator /= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (D3DVALUE s); - _D3DVECTOR& operator /= (D3DVALUE s); - - // ===================================== - // Unary operators - // ===================================== - - friend _D3DVECTOR operator + (const _D3DVECTOR& v); - friend _D3DVECTOR operator - (const _D3DVECTOR& v); - - - // ===================================== - // Binary operators - // ===================================== - - // Addition and subtraction - friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - // Scalar multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s); - friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v); - friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s); - // Memberwise multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Vector dominance - friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Bitwise equality - friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Length-related functions - friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v); - friend D3DVALUE Magnitude (const _D3DVECTOR& v); - - // Returns vector with same direction and unit length - friend _D3DVECTOR Normalize (const _D3DVECTOR& v); - - // Return min/max component of the input vector - friend D3DVALUE Min (const _D3DVECTOR& v); - friend D3DVALUE Max (const _D3DVECTOR& v); - - // Return memberwise min/max of input vectors - friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Dot and cross product - friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif -typedef struct _D3DVECTOR *LPD3DVECTOR; - -/* - * As this is the last of the shared defines to be defined we now set - * D3D_SHARED_DEFINES to flag that fact that this header has defined these - * types. - */ -#define DX_SHARED_DEFINES - -#endif /* DX_SHARED_DEFINES */ - -/* - * Vertex data types supported in an ExecuteBuffer. - */ - -/* - * Homogeneous vertices - */ - -typedef struct _D3DHVERTEX { - DWORD dwFlags; /* Homogeneous clipping flags */ - union { - D3DVALUE hx; - D3DVALUE dvHX; - }; - union { - D3DVALUE hy; - D3DVALUE dvHY; - }; - union { - D3DVALUE hz; - D3DVALUE dvHZ; - }; -} D3DHVERTEX, *LPD3DHVERTEX; - -/* - * Transformed/lit vertices - */ -typedef struct _D3DTLVERTEX { - union { - D3DVALUE sx; /* Screen coordinates */ - D3DVALUE dvSX; - }; - union { - D3DVALUE sy; - D3DVALUE dvSY; - }; - union { - D3DVALUE sz; - D3DVALUE dvSZ; - }; - union { - D3DVALUE rhw; /* Reciprocal of homogeneous w */ - D3DVALUE dvRHW; - }; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DTLVERTEX() { } - _D3DTLVERTEX(const D3DVECTOR& v, float _rhw, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTLVERTEX, *LPD3DTLVERTEX; - -/* - * Untransformed/lit vertices - */ -typedef struct _D3DLVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - DWORD dwReserved; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DLVERTEX() { } - _D3DLVERTEX(const D3DVECTOR& v, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; dwReserved = 0; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DLVERTEX, *LPD3DLVERTEX; - -/* - * Untransformed/unlit vertices - */ - -typedef struct _D3DVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - union { - D3DVALUE nx; /* Normal */ - D3DVALUE dvNX; - }; - union { - D3DVALUE ny; - D3DVALUE dvNY; - }; - union { - D3DVALUE nz; - D3DVALUE dvNZ; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DVERTEX() { } - _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; - nx = n.x; ny = n.y; nz = n.z; - tu = _tu; tv = _tv; - } -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DVERTEX, *LPD3DVERTEX; - - -/* - * Matrix, viewport, and tranformation structures and definitions. - */ - -#ifndef D3DMATRIX_DEFINED -typedef struct _D3DMATRIX { -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - union { - struct { -#endif - -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DVALUE _11, _12, _13, _14; - D3DVALUE _21, _22, _23, _24; - D3DVALUE _31, _32, _33, _34; - D3DVALUE _41, _42, _43, _44; - -#if(DIRECT3D_VERSION >= 0x0500) -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - }; - D3DVALUE m[4][4]; - }; - _D3DMATRIX() { } - _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03, - D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13, - D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23, - D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33 - ) - { - m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03; - m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13; - m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23; - m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33; - } - - D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; } - const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; } -#if(DIRECT3D_VERSION >= 0x0600) - friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&); -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#endif -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DMATRIX; -#define D3DMATRIX_DEFINED -#endif -typedef struct _D3DMATRIX *LPD3DMATRIX; - -#if (defined __cplusplus) && (defined D3D_OVERLOADS) -#include "d3dvec.inl" -#endif - -typedef struct _D3DVIEWPORT { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Dimensions */ - D3DVALUE dvScaleX; /* Scale homogeneous to screen */ - D3DVALUE dvScaleY; /* Scale homogeneous to screen */ - D3DVALUE dvMaxX; /* Min/max homogeneous x coord */ - D3DVALUE dvMaxY; /* Min/max homogeneous y coord */ - D3DVALUE dvMinZ; - D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */ -} D3DVIEWPORT, *LPD3DVIEWPORT; - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct _D3DVIEWPORT2 { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Viewport Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Viewport Dimensions */ - D3DVALUE dvClipX; /* Top left of clip volume */ - D3DVALUE dvClipY; - D3DVALUE dvClipWidth; /* Clip Volume Dimensions */ - D3DVALUE dvClipHeight; - D3DVALUE dvMinZ; /* Min/max of clip Volume */ - D3DVALUE dvMaxZ; -} D3DVIEWPORT2, *LPD3DVIEWPORT2; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DVIEWPORT7 { - DWORD dwX; - DWORD dwY; /* Viewport Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Viewport Dimensions */ - D3DVALUE dvMinZ; /* Min/max of clip Volume */ - D3DVALUE dvMaxZ; -} D3DVIEWPORT7, *LPD3DVIEWPORT7; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Values for clip fields. - */ - -#if(DIRECT3D_VERSION >= 0x0700) - -// Max number of user clipping planes, supported in D3D. -#define D3DMAXUSERCLIPPLANES 32 - -// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE -// -#define D3DCLIPPLANE0 (1 << 0) -#define D3DCLIPPLANE1 (1 << 1) -#define D3DCLIPPLANE2 (1 << 2) -#define D3DCLIPPLANE3 (1 << 3) -#define D3DCLIPPLANE4 (1 << 4) -#define D3DCLIPPLANE5 (1 << 5) - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#define D3DCLIP_LEFT 0x00000001L -#define D3DCLIP_RIGHT 0x00000002L -#define D3DCLIP_TOP 0x00000004L -#define D3DCLIP_BOTTOM 0x00000008L -#define D3DCLIP_FRONT 0x00000010L -#define D3DCLIP_BACK 0x00000020L -#define D3DCLIP_GEN0 0x00000040L -#define D3DCLIP_GEN1 0x00000080L -#define D3DCLIP_GEN2 0x00000100L -#define D3DCLIP_GEN3 0x00000200L -#define D3DCLIP_GEN4 0x00000400L -#define D3DCLIP_GEN5 0x00000800L - -/* - * Values for d3d status. - */ -#define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT -#define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT -#define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP -#define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM -#define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT -#define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK -#define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0 -#define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1 -#define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2 -#define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3 -#define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4 -#define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5 - -#define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L -#define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L -#define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L -#define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L -#define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L -#define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L -#define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L -#define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L -#define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L -#define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L -#define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L -#define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L -#define D3DSTATUS_ZNOTVISIBLE 0x01000000L -/* Do not use 0x80000000 for any status flags in future as it is reserved */ - -#define D3DSTATUS_CLIPUNIONALL ( \ - D3DSTATUS_CLIPUNIONLEFT | \ - D3DSTATUS_CLIPUNIONRIGHT | \ - D3DSTATUS_CLIPUNIONTOP | \ - D3DSTATUS_CLIPUNIONBOTTOM | \ - D3DSTATUS_CLIPUNIONFRONT | \ - D3DSTATUS_CLIPUNIONBACK | \ - D3DSTATUS_CLIPUNIONGEN0 | \ - D3DSTATUS_CLIPUNIONGEN1 | \ - D3DSTATUS_CLIPUNIONGEN2 | \ - D3DSTATUS_CLIPUNIONGEN3 | \ - D3DSTATUS_CLIPUNIONGEN4 | \ - D3DSTATUS_CLIPUNIONGEN5 \ - ) - -#define D3DSTATUS_CLIPINTERSECTIONALL ( \ - D3DSTATUS_CLIPINTERSECTIONLEFT | \ - D3DSTATUS_CLIPINTERSECTIONRIGHT | \ - D3DSTATUS_CLIPINTERSECTIONTOP | \ - D3DSTATUS_CLIPINTERSECTIONBOTTOM | \ - D3DSTATUS_CLIPINTERSECTIONFRONT | \ - D3DSTATUS_CLIPINTERSECTIONBACK | \ - D3DSTATUS_CLIPINTERSECTIONGEN0 | \ - D3DSTATUS_CLIPINTERSECTIONGEN1 | \ - D3DSTATUS_CLIPINTERSECTIONGEN2 | \ - D3DSTATUS_CLIPINTERSECTIONGEN3 | \ - D3DSTATUS_CLIPINTERSECTIONGEN4 | \ - D3DSTATUS_CLIPINTERSECTIONGEN5 \ - ) - -#define D3DSTATUS_DEFAULT ( \ - D3DSTATUS_CLIPINTERSECTIONALL | \ - D3DSTATUS_ZNOTVISIBLE) - - -/* - * Options for direct transform calls - */ -#define D3DTRANSFORM_CLIPPED 0x00000001l -#define D3DTRANSFORM_UNCLIPPED 0x00000002l - -typedef struct _D3DTRANSFORMDATA { - DWORD dwSize; - LPVOID lpIn; /* Input vertices */ - DWORD dwInSize; /* Stride of input vertices */ - LPVOID lpOut; /* Output vertices */ - DWORD dwOutSize; /* Stride of output vertices */ - LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */ - DWORD dwClip; /* Clipping hint */ - DWORD dwClipIntersection; - DWORD dwClipUnion; /* Union of all clip flags */ - D3DRECT drExtent; /* Extent of transformed vertices */ -} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA; - -/* - * Structure defining position and direction properties for lighting. - */ -typedef struct _D3DLIGHTINGELEMENT { - D3DVECTOR dvPosition; /* Lightable point in model space */ - D3DVECTOR dvNormal; /* Normalised unit vector */ -} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT; - -/* - * Structure defining material properties for lighting. - */ -typedef struct _D3DMATERIAL { - DWORD dwSize; - union { - D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE dcvDiffuse; - }; - union { - D3DCOLORVALUE ambient; /* Ambient color RGB */ - D3DCOLORVALUE dcvAmbient; - }; - union { - D3DCOLORVALUE specular; /* Specular 'shininess' */ - D3DCOLORVALUE dcvSpecular; - }; - union { - D3DCOLORVALUE emissive; /* Emissive color RGB */ - D3DCOLORVALUE dcvEmissive; - }; - union { - D3DVALUE power; /* Sharpness if specular highlight */ - D3DVALUE dvPower; - }; - D3DTEXTUREHANDLE hTexture; /* Handle to texture map */ - DWORD dwRampSize; -} D3DMATERIAL, *LPD3DMATERIAL; - -#if(DIRECT3D_VERSION >= 0x0700) - -typedef struct _D3DMATERIAL7 { - union { - D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE dcvDiffuse; - }; - union { - D3DCOLORVALUE ambient; /* Ambient color RGB */ - D3DCOLORVALUE dcvAmbient; - }; - union { - D3DCOLORVALUE specular; /* Specular 'shininess' */ - D3DCOLORVALUE dcvSpecular; - }; - union { - D3DCOLORVALUE emissive; /* Emissive color RGB */ - D3DCOLORVALUE dcvEmissive; - }; - union { - D3DVALUE power; /* Sharpness if specular highlight */ - D3DVALUE dvPower; - }; -} D3DMATERIAL7, *LPD3DMATERIAL7; - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, -// Note: The following light type (D3DLIGHT_PARALLELPOINT) -// is no longer supported from D3D for DX7 onwards. - D3DLIGHT_PARALLELPOINT = 4, -#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers - D3DLIGHT_GLSPOT = 5, -#endif - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -#else -typedef enum _D3DLIGHTTYPE D3DLIGHTTYPE; -#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4 -#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5 - -#endif //(DIRECT3D_VERSION < 0x0800) - -/* - * Structure defining a light source and its properties. - */ -typedef struct _D3DLIGHT { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ -} D3DLIGHT, *LPD3DLIGHT; - -#if(DIRECT3D_VERSION >= 0x0700) - -typedef struct _D3DLIGHT7 { - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */ - D3DCOLORVALUE dcvSpecular; /* Specular color of light */ - D3DCOLORVALUE dcvAmbient; /* Ambient color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ -} D3DLIGHT7, *LPD3DLIGHT7; - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Structure defining a light source and its properties. - */ - -/* flags bits */ -#define D3DLIGHT_ACTIVE 0x00000001 -#define D3DLIGHT_NO_SPECULAR 0x00000002 -#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) - -/* maximum valid light range */ -#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX)) - -typedef struct _D3DLIGHT2 { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ - DWORD dwFlags; -} D3DLIGHT2, *LPD3DLIGHT2; - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -typedef struct _D3DLIGHTDATA { - DWORD dwSize; - LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */ - DWORD dwInSize; /* Stride of input elements */ - LPD3DTLVERTEX lpOut; /* Output colors */ - DWORD dwOutSize; /* Stride of output colors */ -} D3DLIGHTDATA, *LPD3DLIGHTDATA; - -#if(DIRECT3D_VERSION >= 0x0500) -/* - * Before DX5, these values were in an enum called - * D3DCOLORMODEL. This was not correct, since they are - * bit flags. A driver can surface either or both flags - * in the dcmColorModel member of D3DDEVICEDESC. - */ -#define D3DCOLOR_MONO 1 -#define D3DCOLOR_RGB 2 - -typedef DWORD D3DCOLORMODEL; -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ -#if(DIRECT3D_VERSION >= 0x0600) -#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Execute buffers are allocated via Direct3D. These buffers may then - * be filled by the application with instructions to execute along with - * vertex data. - */ - -/* - * Supported op codes for execute instructions. - */ -typedef enum _D3DOPCODE { - D3DOP_POINT = 1, - D3DOP_LINE = 2, - D3DOP_TRIANGLE = 3, - D3DOP_MATRIXLOAD = 4, - D3DOP_MATRIXMULTIPLY = 5, - D3DOP_STATETRANSFORM = 6, - D3DOP_STATELIGHT = 7, - D3DOP_STATERENDER = 8, - D3DOP_PROCESSVERTICES = 9, - D3DOP_TEXTURELOAD = 10, - D3DOP_EXIT = 11, - D3DOP_BRANCHFORWARD = 12, - D3DOP_SPAN = 13, - D3DOP_SETSTATUS = 14, -#if(DIRECT3D_VERSION >= 0x0500) - D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DOPCODE; - -typedef struct _D3DINSTRUCTION { - BYTE bOpcode; /* Instruction opcode */ - BYTE bSize; /* Size of each instruction data unit */ - WORD wCount; /* Count of instruction data units to follow */ -} D3DINSTRUCTION, *LPD3DINSTRUCTION; - -/* - * Structure for texture loads - */ -typedef struct _D3DTEXTURELOAD { - D3DTEXTUREHANDLE hDestTexture; - D3DTEXTUREHANDLE hSrcTexture; -} D3DTEXTURELOAD, *LPD3DTEXTURELOAD; - -/* - * Structure for picking - */ -typedef struct _D3DPICKRECORD { - BYTE bOpcode; - BYTE bPad; - DWORD dwOffset; - D3DVALUE dvZ; -} D3DPICKRECORD, *LPD3DPICKRECORD; - -/* - * The following defines the rendering states which can be set in the - * execute buffer. - */ - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DFILLMODE; - -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREFILTER { - D3DFILTER_NEAREST = 1, - D3DFILTER_LINEAR = 2, - D3DFILTER_MIPNEAREST = 3, - D3DFILTER_MIPLINEAR = 4, - D3DFILTER_LINEARMIPNEAREST = 5, - D3DFILTER_LINEARMIPLINEAR = 6, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREFILTER; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, -#if(DIRECT3D_VERSION >= 0x0500) - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DBLEND; - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREBLEND { - D3DTBLEND_DECAL = 1, - D3DTBLEND_MODULATE = 2, - D3DTBLEND_DECALALPHA = 3, - D3DTBLEND_MODULATEALPHA = 4, - D3DTBLEND_DECALMASK = 5, - D3DTBLEND_MODULATEMASK = 6, - D3DTBLEND_COPY = 7, -#if(DIRECT3D_VERSION >= 0x0500) - D3DTBLEND_ADD = 8, - D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREBLEND; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, -#if(DIRECT3D_VERSION >= 0x0500) - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, -#if(DIRECT3D_VERSION >= 0x0500) - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DCMPFUNC; - -#if(DIRECT3D_VERSION >= 0x0600) -typedef enum _D3DSTENCILOP { - D3DSTENCILOP_KEEP = 1, - D3DSTENCILOP_ZERO = 2, - D3DSTENCILOP_REPLACE = 3, - D3DSTENCILOP_INCRSAT = 4, - D3DSTENCILOP_DECRSAT = 5, - D3DSTENCILOP_INVERT = 6, - D3DSTENCILOP_INCR = 7, - D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSTENCILOP; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, -#if(DIRECT3D_VERSION >= 0x0500) - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DFOGMODE; - -#if(DIRECT3D_VERSION >= 0x0600) -typedef enum _D3DZBUFFERTYPE { - D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DZBUFFERTYPE; -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0500) -typedef enum _D3DANTIALIASMODE { - D3DANTIALIAS_NONE = 0, - D3DANTIALIAS_SORTDEPENDENT = 1, - D3DANTIALIAS_SORTINDEPENDENT = 2, - D3DANTIALIAS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DANTIALIASMODE; - -// Vertex types supported by Direct3D -typedef enum _D3DVERTEXTYPE { - D3DVT_VERTEX = 1, - D3DVT_LVERTEX = 2, - D3DVT_TLVERTEX = 3, - D3DVT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DVERTEXTYPE; - -#if(DIRECT3D_VERSION < 0x0800) - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -#endif //(DIRECT3D_VERSION < 0x0800) - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -/* - * Amount to add to a state to generate the override for that state. - */ -#define D3DSTATE_OVERRIDE_BIAS 256 - -/* - * A state which sets the override flag for the specified state type. - */ -#define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS)) - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTRANSFORMSTATE_WORLD = 1, - D3DTRANSFORMSTATE_VIEW = 2, - D3DTRANSFORMSTATE_PROJECTION = 3, -#if(DIRECT3D_VERSION >= 0x0700) - D3DTRANSFORMSTATE_WORLD1 = 4, // 2nd matrix to blend - D3DTRANSFORMSTATE_WORLD2 = 5, // 3rd matrix to blend - D3DTRANSFORMSTATE_WORLD3 = 6, // 4th matrix to blend - D3DTRANSFORMSTATE_TEXTURE0 = 16, - D3DTRANSFORMSTATE_TEXTURE1 = 17, - D3DTRANSFORMSTATE_TEXTURE2 = 18, - D3DTRANSFORMSTATE_TEXTURE3 = 19, - D3DTRANSFORMSTATE_TEXTURE4 = 20, - D3DTRANSFORMSTATE_TEXTURE5 = 21, - D3DTRANSFORMSTATE_TEXTURE6 = 22, - D3DTRANSFORMSTATE_TEXTURE7 = 23, -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DTRANSFORMSTATETYPE; - -#else - -// -// legacy transform state names -// -typedef enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE; -#define D3DTRANSFORMSTATE_WORLD (D3DTRANSFORMSTATETYPE)1 -#define D3DTRANSFORMSTATE_VIEW (D3DTRANSFORMSTATETYPE)2 -#define D3DTRANSFORMSTATE_PROJECTION (D3DTRANSFORMSTATETYPE)3 -#define D3DTRANSFORMSTATE_WORLD1 (D3DTRANSFORMSTATETYPE)4 -#define D3DTRANSFORMSTATE_WORLD2 (D3DTRANSFORMSTATETYPE)5 -#define D3DTRANSFORMSTATE_WORLD3 (D3DTRANSFORMSTATETYPE)6 -#define D3DTRANSFORMSTATE_TEXTURE0 (D3DTRANSFORMSTATETYPE)16 -#define D3DTRANSFORMSTATE_TEXTURE1 (D3DTRANSFORMSTATETYPE)17 -#define D3DTRANSFORMSTATE_TEXTURE2 (D3DTRANSFORMSTATETYPE)18 -#define D3DTRANSFORMSTATE_TEXTURE3 (D3DTRANSFORMSTATETYPE)19 -#define D3DTRANSFORMSTATE_TEXTURE4 (D3DTRANSFORMSTATETYPE)20 -#define D3DTRANSFORMSTATE_TEXTURE5 (D3DTRANSFORMSTATETYPE)21 -#define D3DTRANSFORMSTATE_TEXTURE6 (D3DTRANSFORMSTATETYPE)22 -#define D3DTRANSFORMSTATE_TEXTURE7 (D3DTRANSFORMSTATETYPE)23 - -#endif //(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DLIGHTSTATETYPE { - D3DLIGHTSTATE_MATERIAL = 1, - D3DLIGHTSTATE_AMBIENT = 2, - D3DLIGHTSTATE_COLORMODEL = 3, - D3DLIGHTSTATE_FOGMODE = 4, - D3DLIGHTSTATE_FOGSTART = 5, - D3DLIGHTSTATE_FOGEND = 6, - D3DLIGHTSTATE_FOGDENSITY = 7, -#if(DIRECT3D_VERSION >= 0x0600) - D3DLIGHTSTATE_COLORVERTEX = 8, -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DLIGHTSTATETYPE; - -#if(DIRECT3D_VERSION < 0x0800) - -typedef enum _D3DRENDERSTATETYPE { - D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */ - D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */ - D3DRENDERSTATE_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ - D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */ - D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */ - D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */ - D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */ - D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */ - D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */ - D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */ - D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */ - D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */ - D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ - D3DRENDERSTATE_FOGEND = 37, /* Fog end */ - D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */ -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ - D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */ - D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */ - D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ - D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ - D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ - D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ - D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ - D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */ - D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */ - D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ - D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0600) - - /* - * 128 values [128, 255] are reserved for texture coordinate wrap flags. - * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using - * a flags word preserves forward compatibility with texture coordinates - * that are >2D. - */ - D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */ - D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */ - D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */ - D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */ - D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */ - D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */ - D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */ - D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DRENDERSTATE_CLIPPING = 136, - D3DRENDERSTATE_LIGHTING = 137, - D3DRENDERSTATE_EXTENTS = 138, - D3DRENDERSTATE_AMBIENT = 139, - D3DRENDERSTATE_FOGVERTEXMODE = 140, - D3DRENDERSTATE_COLORVERTEX = 141, - D3DRENDERSTATE_LOCALVIEWER = 142, - D3DRENDERSTATE_NORMALIZENORMALS = 143, - D3DRENDERSTATE_COLORKEYBLENDENABLE = 144, - D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145, - D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146, - D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147, - D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148, - D3DRENDERSTATE_VERTEXBLEND = 151, - D3DRENDERSTATE_CLIPPLANEENABLE = 152, - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -// -// retired renderstates - not supported for DX7 interfaces -// - D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */ - D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */ - D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */ - D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */ - D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */ - D3DRENDERSTATE_ROP2 = 12, /* ROP2 */ - D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */ - D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */ - D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */ - D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */ - D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */ -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */ - D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */ - D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */ - D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */ - D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ - D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */ -#if(DIRECT3D_VERSION >= 0x0600) - D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */ -#endif /* DIRECT3D_VERSION >= 0x0600 */ - D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */ - D3DRENDERSTATE_STIPPLEPATTERN01 = 65, - D3DRENDERSTATE_STIPPLEPATTERN02 = 66, - D3DRENDERSTATE_STIPPLEPATTERN03 = 67, - D3DRENDERSTATE_STIPPLEPATTERN04 = 68, - D3DRENDERSTATE_STIPPLEPATTERN05 = 69, - D3DRENDERSTATE_STIPPLEPATTERN06 = 70, - D3DRENDERSTATE_STIPPLEPATTERN07 = 71, - D3DRENDERSTATE_STIPPLEPATTERN08 = 72, - D3DRENDERSTATE_STIPPLEPATTERN09 = 73, - D3DRENDERSTATE_STIPPLEPATTERN10 = 74, - D3DRENDERSTATE_STIPPLEPATTERN11 = 75, - D3DRENDERSTATE_STIPPLEPATTERN12 = 76, - D3DRENDERSTATE_STIPPLEPATTERN13 = 77, - D3DRENDERSTATE_STIPPLEPATTERN14 = 78, - D3DRENDERSTATE_STIPPLEPATTERN15 = 79, - D3DRENDERSTATE_STIPPLEPATTERN16 = 80, - D3DRENDERSTATE_STIPPLEPATTERN17 = 81, - D3DRENDERSTATE_STIPPLEPATTERN18 = 82, - D3DRENDERSTATE_STIPPLEPATTERN19 = 83, - D3DRENDERSTATE_STIPPLEPATTERN20 = 84, - D3DRENDERSTATE_STIPPLEPATTERN21 = 85, - D3DRENDERSTATE_STIPPLEPATTERN22 = 86, - D3DRENDERSTATE_STIPPLEPATTERN23 = 87, - D3DRENDERSTATE_STIPPLEPATTERN24 = 88, - D3DRENDERSTATE_STIPPLEPATTERN25 = 89, - D3DRENDERSTATE_STIPPLEPATTERN26 = 90, - D3DRENDERSTATE_STIPPLEPATTERN27 = 91, - D3DRENDERSTATE_STIPPLEPATTERN28 = 92, - D3DRENDERSTATE_STIPPLEPATTERN29 = 93, - D3DRENDERSTATE_STIPPLEPATTERN30 = 94, - D3DRENDERSTATE_STIPPLEPATTERN31 = 95, - -// -// retired renderstate names - the values are still used under new naming conventions -// - D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */ - D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */ - D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */ - -#if(DIRECT3D_VERSION >= 0x0500) - D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -#endif /* DIRECT3D_VERSION >= 0x0500 */ -} D3DRENDERSTATETYPE; - -#else - -typedef enum _D3DRENDERSTATETYPE D3DRENDERSTATETYPE; - -// -// legacy renderstate names -// -#define D3DRENDERSTATE_TEXTUREPERSPECTIVE (D3DRENDERSTATETYPE)4 -#define D3DRENDERSTATE_ZENABLE (D3DRENDERSTATETYPE)7 -#define D3DRENDERSTATE_FILLMODE (D3DRENDERSTATETYPE)8 -#define D3DRENDERSTATE_SHADEMODE (D3DRENDERSTATETYPE)9 -#define D3DRENDERSTATE_LINEPATTERN (D3DRENDERSTATETYPE)10 -#define D3DRENDERSTATE_ZWRITEENABLE (D3DRENDERSTATETYPE)14 -#define D3DRENDERSTATE_ALPHATESTENABLE (D3DRENDERSTATETYPE)15 -#define D3DRENDERSTATE_LASTPIXEL (D3DRENDERSTATETYPE)16 -#define D3DRENDERSTATE_SRCBLEND (D3DRENDERSTATETYPE)19 -#define D3DRENDERSTATE_DESTBLEND (D3DRENDERSTATETYPE)20 -#define D3DRENDERSTATE_CULLMODE (D3DRENDERSTATETYPE)22 -#define D3DRENDERSTATE_ZFUNC (D3DRENDERSTATETYPE)23 -#define D3DRENDERSTATE_ALPHAREF (D3DRENDERSTATETYPE)24 -#define D3DRENDERSTATE_ALPHAFUNC (D3DRENDERSTATETYPE)25 -#define D3DRENDERSTATE_DITHERENABLE (D3DRENDERSTATETYPE)26 -#define D3DRENDERSTATE_ALPHABLENDENABLE (D3DRENDERSTATETYPE)27 -#define D3DRENDERSTATE_FOGENABLE (D3DRENDERSTATETYPE)28 -#define D3DRENDERSTATE_SPECULARENABLE (D3DRENDERSTATETYPE)29 -#define D3DRENDERSTATE_ZVISIBLE (D3DRENDERSTATETYPE)30 -#define D3DRENDERSTATE_STIPPLEDALPHA (D3DRENDERSTATETYPE)33 -#define D3DRENDERSTATE_FOGCOLOR (D3DRENDERSTATETYPE)34 -#define D3DRENDERSTATE_FOGTABLEMODE (D3DRENDERSTATETYPE)35 -#define D3DRENDERSTATE_FOGSTART (D3DRENDERSTATETYPE)36 -#define D3DRENDERSTATE_FOGEND (D3DRENDERSTATETYPE)37 -#define D3DRENDERSTATE_FOGDENSITY (D3DRENDERSTATETYPE)38 -#define D3DRENDERSTATE_EDGEANTIALIAS (D3DRENDERSTATETYPE)40 -#define D3DRENDERSTATE_ZBIAS (D3DRENDERSTATETYPE)47 -#define D3DRENDERSTATE_RANGEFOGENABLE (D3DRENDERSTATETYPE)48 -#define D3DRENDERSTATE_STENCILENABLE (D3DRENDERSTATETYPE)52 -#define D3DRENDERSTATE_STENCILFAIL (D3DRENDERSTATETYPE)53 -#define D3DRENDERSTATE_STENCILZFAIL (D3DRENDERSTATETYPE)54 -#define D3DRENDERSTATE_STENCILPASS (D3DRENDERSTATETYPE)55 -#define D3DRENDERSTATE_STENCILFUNC (D3DRENDERSTATETYPE)56 -#define D3DRENDERSTATE_STENCILREF (D3DRENDERSTATETYPE)57 -#define D3DRENDERSTATE_STENCILMASK (D3DRENDERSTATETYPE)58 -#define D3DRENDERSTATE_STENCILWRITEMASK (D3DRENDERSTATETYPE)59 -#define D3DRENDERSTATE_TEXTUREFACTOR (D3DRENDERSTATETYPE)60 -#define D3DRENDERSTATE_WRAP0 (D3DRENDERSTATETYPE)128 -#define D3DRENDERSTATE_WRAP1 (D3DRENDERSTATETYPE)129 -#define D3DRENDERSTATE_WRAP2 (D3DRENDERSTATETYPE)130 -#define D3DRENDERSTATE_WRAP3 (D3DRENDERSTATETYPE)131 -#define D3DRENDERSTATE_WRAP4 (D3DRENDERSTATETYPE)132 -#define D3DRENDERSTATE_WRAP5 (D3DRENDERSTATETYPE)133 -#define D3DRENDERSTATE_WRAP6 (D3DRENDERSTATETYPE)134 -#define D3DRENDERSTATE_WRAP7 (D3DRENDERSTATETYPE)135 - -#define D3DRENDERSTATE_CLIPPING (D3DRENDERSTATETYPE)136 -#define D3DRENDERSTATE_LIGHTING (D3DRENDERSTATETYPE)137 -#define D3DRENDERSTATE_EXTENTS (D3DRENDERSTATETYPE)138 -#define D3DRENDERSTATE_AMBIENT (D3DRENDERSTATETYPE)139 -#define D3DRENDERSTATE_FOGVERTEXMODE (D3DRENDERSTATETYPE)140 -#define D3DRENDERSTATE_COLORVERTEX (D3DRENDERSTATETYPE)141 -#define D3DRENDERSTATE_LOCALVIEWER (D3DRENDERSTATETYPE)142 -#define D3DRENDERSTATE_NORMALIZENORMALS (D3DRENDERSTATETYPE)143 -#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 -#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE (D3DRENDERSTATETYPE)145 -#define D3DRENDERSTATE_SPECULARMATERIALSOURCE (D3DRENDERSTATETYPE)146 -#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE (D3DRENDERSTATETYPE)147 -#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE (D3DRENDERSTATETYPE)148 -#define D3DRENDERSTATE_VERTEXBLEND (D3DRENDERSTATETYPE)151 -#define D3DRENDERSTATE_CLIPPLANEENABLE (D3DRENDERSTATETYPE)152 - -// -// retired renderstates - not supported for DX7 interfaces -// -#define D3DRENDERSTATE_TEXTUREHANDLE (D3DRENDERSTATETYPE)1 -#define D3DRENDERSTATE_ANTIALIAS (D3DRENDERSTATETYPE)2 -#define D3DRENDERSTATE_TEXTUREADDRESS (D3DRENDERSTATETYPE)3 -#define D3DRENDERSTATE_WRAPU (D3DRENDERSTATETYPE)5 -#define D3DRENDERSTATE_WRAPV (D3DRENDERSTATETYPE)6 -#define D3DRENDERSTATE_MONOENABLE (D3DRENDERSTATETYPE)11 -#define D3DRENDERSTATE_ROP2 (D3DRENDERSTATETYPE)12 -#define D3DRENDERSTATE_PLANEMASK (D3DRENDERSTATETYPE)13 -#define D3DRENDERSTATE_TEXTUREMAG (D3DRENDERSTATETYPE)17 -#define D3DRENDERSTATE_TEXTUREMIN (D3DRENDERSTATETYPE)18 -#define D3DRENDERSTATE_TEXTUREMAPBLEND (D3DRENDERSTATETYPE)21 -#define D3DRENDERSTATE_SUBPIXEL (D3DRENDERSTATETYPE)31 -#define D3DRENDERSTATE_SUBPIXELX (D3DRENDERSTATETYPE)32 -#define D3DRENDERSTATE_STIPPLEENABLE (D3DRENDERSTATETYPE)39 -#define D3DRENDERSTATE_OLDALPHABLENDENABLE (D3DRENDERSTATETYPE)42 -#define D3DRENDERSTATE_BORDERCOLOR (D3DRENDERSTATETYPE)43 -#define D3DRENDERSTATE_TEXTUREADDRESSU (D3DRENDERSTATETYPE)44 -#define D3DRENDERSTATE_TEXTUREADDRESSV (D3DRENDERSTATETYPE)45 -#define D3DRENDERSTATE_MIPMAPLODBIAS (D3DRENDERSTATETYPE)46 -#define D3DRENDERSTATE_ANISOTROPY (D3DRENDERSTATETYPE)49 -#define D3DRENDERSTATE_FLUSHBATCH (D3DRENDERSTATETYPE)50 -#define D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT (D3DRENDERSTATETYPE)51 -#define D3DRENDERSTATE_STIPPLEPATTERN00 (D3DRENDERSTATETYPE)64 -#define D3DRENDERSTATE_STIPPLEPATTERN01 (D3DRENDERSTATETYPE)65 -#define D3DRENDERSTATE_STIPPLEPATTERN02 (D3DRENDERSTATETYPE)66 -#define D3DRENDERSTATE_STIPPLEPATTERN03 (D3DRENDERSTATETYPE)67 -#define D3DRENDERSTATE_STIPPLEPATTERN04 (D3DRENDERSTATETYPE)68 -#define D3DRENDERSTATE_STIPPLEPATTERN05 (D3DRENDERSTATETYPE)69 -#define D3DRENDERSTATE_STIPPLEPATTERN06 (D3DRENDERSTATETYPE)70 -#define D3DRENDERSTATE_STIPPLEPATTERN07 (D3DRENDERSTATETYPE)71 -#define D3DRENDERSTATE_STIPPLEPATTERN08 (D3DRENDERSTATETYPE)72 -#define D3DRENDERSTATE_STIPPLEPATTERN09 (D3DRENDERSTATETYPE)73 -#define D3DRENDERSTATE_STIPPLEPATTERN10 (D3DRENDERSTATETYPE)74 -#define D3DRENDERSTATE_STIPPLEPATTERN11 (D3DRENDERSTATETYPE)75 -#define D3DRENDERSTATE_STIPPLEPATTERN12 (D3DRENDERSTATETYPE)76 -#define D3DRENDERSTATE_STIPPLEPATTERN13 (D3DRENDERSTATETYPE)77 -#define D3DRENDERSTATE_STIPPLEPATTERN14 (D3DRENDERSTATETYPE)78 -#define D3DRENDERSTATE_STIPPLEPATTERN15 (D3DRENDERSTATETYPE)79 -#define D3DRENDERSTATE_STIPPLEPATTERN16 (D3DRENDERSTATETYPE)80 -#define D3DRENDERSTATE_STIPPLEPATTERN17 (D3DRENDERSTATETYPE)81 -#define D3DRENDERSTATE_STIPPLEPATTERN18 (D3DRENDERSTATETYPE)82 -#define D3DRENDERSTATE_STIPPLEPATTERN19 (D3DRENDERSTATETYPE)83 -#define D3DRENDERSTATE_STIPPLEPATTERN20 (D3DRENDERSTATETYPE)84 -#define D3DRENDERSTATE_STIPPLEPATTERN21 (D3DRENDERSTATETYPE)85 -#define D3DRENDERSTATE_STIPPLEPATTERN22 (D3DRENDERSTATETYPE)86 -#define D3DRENDERSTATE_STIPPLEPATTERN23 (D3DRENDERSTATETYPE)87 -#define D3DRENDERSTATE_STIPPLEPATTERN24 (D3DRENDERSTATETYPE)88 -#define D3DRENDERSTATE_STIPPLEPATTERN25 (D3DRENDERSTATETYPE)89 -#define D3DRENDERSTATE_STIPPLEPATTERN26 (D3DRENDERSTATETYPE)90 -#define D3DRENDERSTATE_STIPPLEPATTERN27 (D3DRENDERSTATETYPE)91 -#define D3DRENDERSTATE_STIPPLEPATTERN28 (D3DRENDERSTATETYPE)92 -#define D3DRENDERSTATE_STIPPLEPATTERN29 (D3DRENDERSTATETYPE)93 -#define D3DRENDERSTATE_STIPPLEPATTERN30 (D3DRENDERSTATETYPE)94 -#define D3DRENDERSTATE_STIPPLEPATTERN31 (D3DRENDERSTATETYPE)95 - -// -// retired renderstates - not supported for DX8 interfaces -// -#define D3DRENDERSTATE_COLORKEYENABLE (D3DRENDERSTATETYPE)41 -#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 - -// -// retired renderstate names - the values are still used under new naming conventions -// -#define D3DRENDERSTATE_BLENDENABLE (D3DRENDERSTATETYPE)27 -#define D3DRENDERSTATE_FOGTABLESTART (D3DRENDERSTATETYPE)36 -#define D3DRENDERSTATE_FOGTABLEEND (D3DRENDERSTATETYPE)37 -#define D3DRENDERSTATE_FOGTABLEDENSITY (D3DRENDERSTATETYPE)38 - -#endif //(DIRECT3D_VERSION < 0x0800) - - -#if(DIRECT3D_VERSION < 0x0800) - -// Values for material source -typedef enum _D3DMATERIALCOLORSOURCE -{ - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DMATERIALCOLORSOURCE; - - -#if(DIRECT3D_VERSION >= 0x0500) -// For back-compatibility with legacy compilations -#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE -#endif /* DIRECT3D_VERSION >= 0x0500 */ - -#if(DIRECT3D_VERSION >= 0x0600) - -// Bias to apply to the texture coordinate set to apply a wrap to. -#define D3DRENDERSTATE_WRAPBIAS 128UL - -/* Flags to construct the WRAP render states */ -#define D3DWRAP_U 0x00000001L -#define D3DWRAP_V 0x00000002L - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION >= 0x0700) - -/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L -#define D3DWRAPCOORD_3 0x00000008L - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y)) - -typedef struct _D3DSTATE { - union { -#if(DIRECT3D_VERSION < 0x0800) - D3DTRANSFORMSTATETYPE dtstTransformStateType; -#endif //(DIRECT3D_VERSION < 0x0800) - D3DLIGHTSTATETYPE dlstLightStateType; - D3DRENDERSTATETYPE drstRenderStateType; - }; - union { - DWORD dwArg[1]; - D3DVALUE dvArg[1]; - }; -} D3DSTATE, *LPD3DSTATE; - - -/* - * Operation used to load matrices - * hDstMat = hSrcMat - */ -typedef struct _D3DMATRIXLOAD { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */ -} D3DMATRIXLOAD, *LPD3DMATRIXLOAD; - -/* - * Operation used to multiply matrices - * hDstMat = hSrcMat1 * hSrcMat2 - */ -typedef struct _D3DMATRIXMULTIPLY { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */ - D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */ -} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY; - -/* - * Operation used to transform and light vertices. - */ -typedef struct _D3DPROCESSVERTICES { - DWORD dwFlags; /* Do we transform or light or just copy? */ - WORD wStart; /* Index to first vertex in source */ - WORD wDest; /* Index to first vertex in local buffer */ - DWORD dwCount; /* Number of vertices to be processed */ - DWORD dwReserved; /* Must be zero */ -} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES; - -#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L -#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L -#define D3DPROCESSVERTICES_COPY 0x00000002L -#define D3DPROCESSVERTICES_OPMASK 0x00000007L - -#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L -#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L - - -#if(DIRECT3D_VERSION >= 0x0600) - - -#if(DIRECT3D_VERSION < 0x0800) - -/* - * State enumerants for per-stage texture processing. - */ -typedef enum _D3DTEXTURESTAGESTATETYPE -{ - D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ - D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ - D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ - D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ - D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ - D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */ - D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ - D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */ - D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ - D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ - D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ - D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */ - D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */ - D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */ - D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */ - D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ - D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ - D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */ - D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */ -#if(DIRECT3D_VERSION >= 0x0700) - D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ -#endif /* DIRECT3D_VERSION >= 0x0700 */ - D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTURESTAGESTATETYPE; - -#if(DIRECT3D_VERSION >= 0x0700) -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// -#define D3DTSS_TCI_PASSTHRU 0x00000000 -#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 -#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 -#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* - * Enumerations for COLOROP and ALPHAOP texture blending operations set in - * texture processing stage controls in D3DRENDERSTATE. - */ -typedef enum _D3DTEXTUREOP -{ -// Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default - D3DTOP_SELECTARG2 = 3, - -// Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits - -// Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 - -// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color - -// Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only - -// Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. - D3DTOP_DOTPRODUCT3 = 24, - - D3DTOP_FORCE_DWORD = 0x7fffffff, -} D3DTEXTUREOP; - -/* - * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations - * set in texture processing stage controls in D3DRENDERSTATE. - */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color -#define D3DTA_CURRENT 0x00000001 // select result of previous stage -#define D3DTA_TEXTURE 0x00000002 // select texture color -#define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DTA_SPECULAR 0x00000004 // select specular color -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components - -#endif //(DIRECT3D_VERSION < 0x0800) - -/* - * IDirect3DTexture2 State Filter Types - */ -typedef enum _D3DTEXTUREMAGFILTER -{ - D3DTFG_POINT = 1, // nearest - D3DTFG_LINEAR = 2, // linear interpolation - D3DTFG_FLATCUBIC = 3, // cubic - D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel - D3DTFG_ANISOTROPIC = 5, // -#if(DIRECT3D_VERSION >= 0x0700) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - D3DTFG_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMAGFILTER; - -typedef enum _D3DTEXTUREMINFILTER -{ - D3DTFN_POINT = 1, // nearest - D3DTFN_LINEAR = 2, // linear interpolation - D3DTFN_ANISOTROPIC = 3, // - D3DTFN_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMINFILTER; - -typedef enum _D3DTEXTUREMIPFILTER -{ - D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter) - D3DTFP_POINT = 2, // nearest - D3DTFP_LINEAR = 3, // linear interpolation - D3DTFP_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum -} D3DTEXTUREMIPFILTER; - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -/* - * Triangle flags - */ - -/* - * Tri strip and fan flags. - * START loads all three vertices - * EVEN and ODD load just v3 with even or odd culling - * START_FLAT contains a count from 0 to 29 that allows the - * whole strip or fan to be culled in one hit. - * e.g. for a quad len = 1 - */ -#define D3DTRIFLAG_START 0x00000000L -#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */ -#define D3DTRIFLAG_ODD 0x0000001eL -#define D3DTRIFLAG_EVEN 0x0000001fL - -/* - * Triangle edge flags - * enable edges for wireframe or antialiasing - */ -#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */ -#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */ -#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */ -#define D3DTRIFLAG_EDGEENABLETRIANGLE \ - (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3) - -/* - * Primitive structures and related defines. Vertex offsets are to types - * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX. - */ - -/* - * Triangle list primitive structure - */ -typedef struct _D3DTRIANGLE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; - union { - WORD v3; - WORD wV3; - }; - WORD wFlags; /* Edge (and other) flags */ -} D3DTRIANGLE, *LPD3DTRIANGLE; - -/* - * Line list structure. - * The instruction count defines the number of line segments. - */ -typedef struct _D3DLINE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; -} D3DLINE, *LPD3DLINE; - -/* - * Span structure - * Spans join a list of points with the same y value. - * If the y value changes, a new span is started. - */ -typedef struct _D3DSPAN { - WORD wCount; /* Number of spans */ - WORD wFirst; /* Index to first vertex */ -} D3DSPAN, *LPD3DSPAN; - -/* - * Point structure - */ -typedef struct _D3DPOINT { - WORD wCount; /* number of points */ - WORD wFirst; /* index to first vertex */ -} D3DPOINT, *LPD3DPOINT; - - -/* - * Forward branch structure. - * Mask is logically anded with the driver status mask - * if the result equals 'value', the branch is taken. - */ -typedef struct _D3DBRANCH { - DWORD dwMask; /* Bitmask against D3D status */ - DWORD dwValue; - BOOL bNegate; /* TRUE to negate comparison */ - DWORD dwOffset; /* How far to branch forward (0 for exit)*/ -} D3DBRANCH, *LPD3DBRANCH; - -/* - * Status used for set status instruction. - * The D3D status is initialised on device creation - * and is modified by all execute calls. - */ -typedef struct _D3DSTATUS { - DWORD dwFlags; /* Do we set extents or status */ - DWORD dwStatus; /* D3D status */ - D3DRECT drExtent; -} D3DSTATUS, *LPD3DSTATUS; - -#define D3DSETSTATUS_STATUS 0x00000001L -#define D3DSETSTATUS_EXTENTS 0x00000002L -#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS) - -#if(DIRECT3D_VERSION >= 0x0500) -typedef struct _D3DCLIPSTATUS { - DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */ - DWORD dwStatus; /* Clip status */ - float minx, maxx; /* X extents */ - float miny, maxy; /* Y extents */ - float minz, maxz; /* Z extents */ -} D3DCLIPSTATUS, *LPD3DCLIPSTATUS; - -#define D3DCLIPSTATUS_STATUS 0x00000001L -#define D3DCLIPSTATUS_EXTENTS2 0x00000002L -#define D3DCLIPSTATUS_EXTENTS3 0x00000004L - -#endif /* DIRECT3D_VERSION >= 0x0500 */ -/* - * Statistics structure - */ -typedef struct _D3DSTATS { - DWORD dwSize; - DWORD dwTrianglesDrawn; - DWORD dwLinesDrawn; - DWORD dwPointsDrawn; - DWORD dwSpansDrawn; - DWORD dwVerticesProcessed; -} D3DSTATS, *LPD3DSTATS; - -/* - * Execute options. - * When calling using D3DEXECUTE_UNCLIPPED all the primitives - * inside the buffer must be contained within the viewport. - */ -#define D3DEXECUTE_CLIPPED 0x00000001l -#define D3DEXECUTE_UNCLIPPED 0x00000002l - -typedef struct _D3DEXECUTEDATA { - DWORD dwSize; - DWORD dwVertexOffset; - DWORD dwVertexCount; - DWORD dwInstructionOffset; - DWORD dwInstructionLength; - DWORD dwHVertexOffset; - D3DSTATUS dsStatus; /* Status after execute */ -} D3DEXECUTEDATA, *LPD3DEXECUTEDATA; - -/* - * Palette flags. - * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw. - */ -#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */ -#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */ -#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */ - - -#if(DIRECT3D_VERSION >= 0x0600) - -typedef struct _D3DVERTEXBUFFERDESC { - DWORD dwSize; - DWORD dwCaps; - DWORD dwFVF; - DWORD dwNumVertices; -} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC; - -#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l -#define D3DVBCAPS_WRITEONLY 0x00010000l -#define D3DVBCAPS_OPTIMIZED 0x80000000l -#define D3DVBCAPS_DONOTCLIP 0x00000001l - -/* Vertex Operations for ProcessVertices */ -#define D3DVOP_LIGHT (1 << 10) -#define D3DVOP_TRANSFORM (1 << 0) -#define D3DVOP_CLIP (1 << 2) -#define D3DVOP_EXTENTS (1 << 3) - - -#if(DIRECT3D_VERSION < 0x0800) - -/* The maximum number of vertices user can pass to any d3d - drawing function or to create vertex buffer with -*/ -#define D3DMAXNUMVERTICES ((1<<16) - 1) -/* The maximum number of primitives user can pass to any d3d - drawing function. -*/ -#define D3DMAXNUMPRIMITIVES ((1<<16) - 1) - -#if(DIRECT3D_VERSION >= 0x0700) - -/* Bits for dwFlags in ProcessVertices call */ -#define D3DPV_DONOTCOPYDATA (1 << 0) - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#endif //(DIRECT3D_VERSION < 0x0800) - -//------------------------------------------------------------------- - -#if(DIRECT3D_VERSION < 0x0800) - -// Flexible vertex format bits -// -#define D3DFVF_RESERVED0 0x001 -#define D3DFVF_POSITION_MASK 0x00E -#define D3DFVF_XYZ 0x002 -#define D3DFVF_XYZRHW 0x004 -#if(DIRECT3D_VERSION >= 0x0700) -#define D3DFVF_XYZB1 0x006 -#define D3DFVF_XYZB2 0x008 -#define D3DFVF_XYZB3 0x00a -#define D3DFVF_XYZB4 0x00c -#define D3DFVF_XYZB5 0x00e - -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#define D3DFVF_NORMAL 0x010 -#define D3DFVF_RESERVED1 0x020 -#define D3DFVF_DIFFUSE 0x040 -#define D3DFVF_SPECULAR 0x080 - -#define D3DFVF_TEXCOUNT_MASK 0xf00 -#define D3DFVF_TEXCOUNT_SHIFT 8 -#define D3DFVF_TEX0 0x000 -#define D3DFVF_TEX1 0x100 -#define D3DFVF_TEX2 0x200 -#define D3DFVF_TEX3 0x300 -#define D3DFVF_TEX4 0x400 -#define D3DFVF_TEX5 0x500 -#define D3DFVF_TEX6 0x600 -#define D3DFVF_TEX7 0x700 -#define D3DFVF_TEX8 0x800 - -#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits - -#else -#define D3DFVF_RESERVED1 0x020 -#endif //(DIRECT3D_VERSION < 0x0800) - -#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 ) -#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \ - D3DFVF_SPECULAR | D3DFVF_TEX1 ) -#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \ - D3DFVF_TEX1 ) - - -typedef struct _D3DDP_PTRSTRIDE -{ - LPVOID lpvData; - DWORD dwStride; -} D3DDP_PTRSTRIDE; - -#define D3DDP_MAXTEXCOORD 8 - -typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA -{ - D3DDP_PTRSTRIDE position; - D3DDP_PTRSTRIDE normal; - D3DDP_PTRSTRIDE diffuse; - D3DDP_PTRSTRIDE specular; - D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD]; -} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA; -//--------------------------------------------------------------------- -// ComputeSphereVisibility return values -// -#define D3DVIS_INSIDE_FRUSTUM 0 -#define D3DVIS_INTERSECT_FRUSTUM 1 -#define D3DVIS_OUTSIDE_FRUSTUM 2 -#define D3DVIS_INSIDE_LEFT 0 -#define D3DVIS_INTERSECT_LEFT (1 << 2) -#define D3DVIS_OUTSIDE_LEFT (2 << 2) -#define D3DVIS_INSIDE_RIGHT 0 -#define D3DVIS_INTERSECT_RIGHT (1 << 4) -#define D3DVIS_OUTSIDE_RIGHT (2 << 4) -#define D3DVIS_INSIDE_TOP 0 -#define D3DVIS_INTERSECT_TOP (1 << 6) -#define D3DVIS_OUTSIDE_TOP (2 << 6) -#define D3DVIS_INSIDE_BOTTOM 0 -#define D3DVIS_INTERSECT_BOTTOM (1 << 8) -#define D3DVIS_OUTSIDE_BOTTOM (2 << 8) -#define D3DVIS_INSIDE_NEAR 0 -#define D3DVIS_INTERSECT_NEAR (1 << 10) -#define D3DVIS_OUTSIDE_NEAR (2 << 10) -#define D3DVIS_INSIDE_FAR 0 -#define D3DVIS_INTERSECT_FAR (1 << 12) -#define D3DVIS_OUTSIDE_FAR (2 << 12) - -#define D3DVIS_MASK_FRUSTUM (3 << 0) -#define D3DVIS_MASK_LEFT (3 << 2) -#define D3DVIS_MASK_RIGHT (3 << 4) -#define D3DVIS_MASK_TOP (3 << 6) -#define D3DVIS_MASK_BOTTOM (3 << 8) -#define D3DVIS_MASK_NEAR (3 << 10) -#define D3DVIS_MASK_FAR (3 << 12) - -#endif /* DIRECT3D_VERSION >= 0x0600 */ - -#if(DIRECT3D_VERSION < 0x0800) - -#if(DIRECT3D_VERSION >= 0x0700) - -// To be used with GetInfo() -#define D3DDEVINFOID_TEXTUREMANAGER 1 -#define D3DDEVINFOID_D3DTEXTUREMANAGER 2 -#define D3DDEVINFOID_TEXTURING 3 - -typedef enum _D3DSTATEBLOCKTYPE -{ - D3DSBT_ALL = 1, // capture all state - D3DSBT_PIXELSTATE = 2, // capture pixel state - D3DSBT_VERTEXSTATE = 3, // capture vertex state - D3DSBT_FORCE_DWORD = 0xffffffff -} D3DSTATEBLOCKTYPE; - -// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state. -// -typedef enum _D3DVERTEXBLENDFLAGS -{ - D3DVBLEND_DISABLE = 0, // Disable vertex blending - D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices - D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices - D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices -} D3DVERTEXBLENDFLAGS; - -typedef enum _D3DTEXTURETRANSFORMFLAGS { - D3DTTFF_DISABLE = 0, // texture coordinates are passed directly - D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords - D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords - D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords - D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords - D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element - D3DTTFF_FORCE_DWORD = 0x7fffffff, -} D3DTEXTURETRANSFORMFLAGS; - -// Macros to set texture coordinate format bits in the FVF id - -#define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values -#define D3DFVF_TEXTUREFORMAT1 3 // One floating point value -#define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values -#define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values - -#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) -#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) -#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)) -#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) - - -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#else -// -// legacy vertex blend names -// -typedef enum _D3DVERTEXBLENDFLAGS D3DVERTEXBLENDFLAGS; -#define D3DVBLEND_DISABLE (D3DVERTEXBLENDFLAGS)0 -#define D3DVBLEND_1WEIGHT (D3DVERTEXBLENDFLAGS)1 -#define D3DVBLEND_2WEIGHTS (D3DVERTEXBLENDFLAGS)2 -#define D3DVBLEND_3WEIGHTS (D3DVERTEXBLENDFLAGS)3 - -#endif //(DIRECT3D_VERSION < 0x0800) - -#pragma pack() -#pragma warning(default:4201) - -#endif /* _D3DTYPES_H_ */ - diff --git a/import/DirectX8/include/d3dvec.inl b/import/DirectX8/include/d3dvec.inl deleted file mode 100644 index ff7fdfeaf..000000000 --- a/import/DirectX8/include/d3dvec.inl +++ /dev/null @@ -1,255 +0,0 @@ - -/****************************************************************** - * * - * D3DVec.inl * - * * - * Float-valued 3D vector class for Direct3D. * - * * - * Copyright (c) Microsoft Corp. All rights reserved. * - * * - ******************************************************************/ - -#include - -// ===================================== -// Constructors -// ===================================== - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE f) -{ - x = y = z = f; -} - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z) -{ - x = _x; y = _y; z = _z; -} - -inline -_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3]) -{ - x = f[0]; y = f[1]; z = f[2]; -} - -// ===================================== -// Access grants -// ===================================== - -inline const D3DVALUE& -_D3DVECTOR::operator[](int i) const -{ - return (&x)[i]; -} - -inline D3DVALUE& -_D3DVECTOR::operator[](int i) -{ - return (&x)[i]; -} - - -// ===================================== -// Assignment operators -// ===================================== - -inline _D3DVECTOR& -_D3DVECTOR::operator += (const _D3DVECTOR& v) -{ - x += v.x; y += v.y; z += v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator -= (const _D3DVECTOR& v) -{ - x -= v.x; y -= v.y; z -= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (const _D3DVECTOR& v) -{ - x *= v.x; y *= v.y; z *= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (const _D3DVECTOR& v) -{ - x /= v.x; y /= v.y; z /= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (D3DVALUE s) -{ - x *= s; y *= s; z *= s; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (D3DVALUE s) -{ - x /= s; y /= s; z /= s; - return *this; -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v) -{ - return v; -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v) -{ - return _D3DVECTOR(-v.x, -v.y, -v.z); -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z); -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z); -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z); -} - -inline int -operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2]; -} - -inline int -operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2]; -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator * (D3DVALUE s, const _D3DVECTOR& v) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(v.x/s, v.y/s, v.z/s); -} - -inline int -operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z; -} - -inline D3DVALUE -Magnitude (const _D3DVECTOR& v) -{ - return (D3DVALUE) sqrt(SquareMagnitude(v)); -} - -inline D3DVALUE -SquareMagnitude (const _D3DVECTOR& v) -{ - return v.x*v.x + v.y*v.y + v.z*v.z; -} - -inline _D3DVECTOR -Normalize (const _D3DVECTOR& v) -{ - return v / Magnitude(v); -} - -inline D3DVALUE -Min (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (v.y < ret) ret = v.y; - if (v.z < ret) ret = v.z; - return ret; -} - -inline D3DVALUE -Max (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (ret < v.y) ret = v.y; - if (ret < v.z) ret = v.z; - return ret; -} - -inline _D3DVECTOR -Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0], - v1[1] < v2[1] ? v1[1] : v2[1], - v1[2] < v2[2] ? v1[2] : v2[2]); -} - -inline _D3DVECTOR -Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0], - v1[1] > v2[1] ? v1[1] : v2[1], - v1[2] > v2[2] ? v1[2] : v2[2]); -} - -inline D3DVALUE -DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z; -} - -inline _D3DVECTOR -CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - _D3DVECTOR result; - - result[0] = v1[1] * v2[2] - v1[2] * v2[1]; - result[1] = v1[2] * v2[0] - v1[0] * v2[2]; - result[2] = v1[0] * v2[1] - v1[1] * v2[0]; - - return result; -} - -inline _D3DMATRIX -operator* (const _D3DMATRIX& a, const _D3DMATRIX& b) -{ - _D3DMATRIX ret; - for (int i=0; i<4; i++) { - for (int j=0; j<4; j++) { - ret(i, j) = 0.0f; - for (int k=0; k<4; k++) { - ret(i, j) += a(i, k) * b(k, j); - } - } - } - return ret; -} - diff --git a/import/DirectX8/include/d3dx.h b/import/DirectX8/include/d3dx.h deleted file mode 100644 index 7a511e3f5..000000000 --- a/import/DirectX8/include/d3dx.h +++ /dev/null @@ -1,26 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx.h -// Content: D3DX utility library -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX_H__ -#define __D3DX_H__ - -#ifndef D3DXINLINE -#ifdef __cplusplus -#define D3DXINLINE inline -#else -#define D3DXINLINE _inline -#endif -#endif - -#include "d3dxcore.h" -#include "d3dxmath.h" -#include "d3dxshapes.h" -#include "d3dxsprite.h" - -#endif //__D3DX_H__ diff --git a/import/DirectX8/include/d3dx8.h b/import/DirectX8/include/d3dx8.h deleted file mode 100644 index 31927a27a..000000000 --- a/import/DirectX8/include/d3dx8.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8.h -// Content: D3DX utility library -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX8_H__ -#define __D3DX8_H__ - -#include "d3d8.h" -#include - -#ifndef D3DXINLINE -#ifdef _MSC_VER - #if (_MSC_VER >= 1200) - #define D3DXINLINE __forceinline - #else - #define D3DXINLINE __inline - #endif -#else - #ifdef __cplusplus - #define D3DXINLINE inline - #else - #define D3DXINLINE - #endif -#endif -#endif - - -#define D3DX_DEFAULT ULONG_MAX -#define D3DX_DEFAULT_FLOAT FLT_MAX - -#include "d3dx8math.h" -#include "d3dx8core.h" -#include "d3dx8tex.h" -#include "d3dx8mesh.h" -#include "d3dx8shape.h" -#include "d3dx8effect.h" - - -#endif //__D3DX8_H__ - diff --git a/import/DirectX8/include/d3dx8core.h b/import/DirectX8/include/d3dx8core.h deleted file mode 100644 index 46552a950..000000000 --- a/import/DirectX8/include/d3dx8core.h +++ /dev/null @@ -1,563 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8core.h -// Content: D3DX core types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8CORE_H__ -#define __D3DX8CORE_H__ - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXBuffer: -// ------------ -// The buffer object is used by D3DX to return arbitrary size data. -// -// GetBufferPointer - -// Returns a pointer to the beginning of the buffer. -// -// GetBufferSize - -// Returns the size of the buffer, in bytes. -/////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXBuffer ID3DXBuffer; -typedef interface ID3DXBuffer *LPD3DXBUFFER; - -// {932E6A7E-C68E-45dd-A7BF-53D19C86DB1F} -DEFINE_GUID(IID_ID3DXBuffer, -0x932e6a7e, 0xc68e, 0x45dd, 0xa7, 0xbf, 0x53, 0xd1, 0x9c, 0x86, 0xdb, 0x1f); - -#undef INTERFACE -#define INTERFACE ID3DXBuffer - -DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBuffer - STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; - STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; -}; - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXFont: -// ---------- -// Font objects contain the textures and resources needed to render -// a specific font on a specific device. -// -// Begin - -// Prepartes device for drawing text. This is optional.. if DrawText -// is called outside of Begin/End, it will call Begin and End for you. -// -// DrawText - -// Draws formatted text on a D3D device. Some parameters are -// surprisingly similar to those of GDI's DrawText function. See GDI -// documentation for a detailed description of these parameters. -// -// End - -// Restores device state to how it was when Begin was called. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -// -/////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXFont ID3DXFont; -typedef interface ID3DXFont *LPD3DXFONT; - - -// {89FAD6A5-024D-49af-8FE7-F51123B85E25} -DEFINE_GUID( IID_ID3DXFont, -0x89fad6a5, 0x24d, 0x49af, 0x8f, 0xe7, 0xf5, 0x11, 0x23, 0xb8, 0x5e, 0x25); - - -#undef INTERFACE -#define INTERFACE ID3DXFont - -DECLARE_INTERFACE_(ID3DXFont, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXFont - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(GetLogFont)(THIS_ LOGFONT* pLogFont) PURE; - - STDMETHOD(Begin)(THIS) PURE; - STDMETHOD_(INT, DrawTextA)(THIS_ LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; - STDMETHOD_(INT, DrawTextW)(THIS_ LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; - STDMETHOD(End)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - -#ifndef DrawText -#ifdef UNICODE -#define DrawText DrawTextW -#else -#define DrawText DrawTextA -#endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateFont( - LPDIRECT3DDEVICE8 pDevice, - HFONT hFont, - LPD3DXFONT* ppFont); - - -HRESULT WINAPI - D3DXCreateFontIndirect( - LPDIRECT3DDEVICE8 pDevice, - CONST LOGFONT* pLogFont, - LPD3DXFONT* ppFont); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXSprite: -// ------------ -// This object intends to provide an easy way to drawing sprites using D3D. -// -// Begin - -// Prepares device for drawing sprites -// -// Draw, DrawAffine, DrawTransform - -// Draws a sprite in screen-space. Before transformation, the sprite is -// the size of SrcRect, with its top-left corner at the origin (0,0). -// The color and alpha channels are modulated by Color. -// -// End - -// Restores device state to how it was when Begin was called. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXSprite ID3DXSprite; -typedef interface ID3DXSprite *LPD3DXSPRITE; - - -// {13D69D15-F9B0-4e0f-B39E-C91EB33F6CE7} -DEFINE_GUID( IID_ID3DXSprite, -0x13d69d15, 0xf9b0, 0x4e0f, 0xb3, 0x9e, 0xc9, 0x1e, 0xb3, 0x3f, 0x6c, 0xe7); - - -#undef INTERFACE -#define INTERFACE ID3DXSprite - -DECLARE_INTERFACE_(ID3DXSprite, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXSprite - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - - STDMETHOD(Begin)(THIS) PURE; - - STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture, - CONST RECT* pSrcRect, CONST D3DXVECTOR2* pScaling, - CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, - CONST D3DXVECTOR2* pTranslation, D3DCOLOR Color) PURE; - - STDMETHOD(DrawTransform)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture, - CONST RECT* pSrcRect, CONST D3DXMATRIX* pTransform, - D3DCOLOR Color) PURE; - - STDMETHOD(End)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -HRESULT WINAPI - D3DXCreateSprite( - LPDIRECT3DDEVICE8 pDevice, - LPD3DXSPRITE* ppSprite); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXRenderToSurface: -// --------------------- -// This object abstracts rendering to surfaces. These surfaces do not -// necessarily need to be render targets. If they are not, a compatible -// render target is used, and the result copied into surface at end scene. -// -// BeginScene, EndScene - -// Call BeginScene() and EndScene() at the beginning and ending of your -// scene. These calls will setup and restore render targets, viewports, -// etc.. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - -typedef struct _D3DXRTS_DESC -{ - UINT Width; - UINT Height; - D3DFORMAT Format; - BOOL DepthStencil; - D3DFORMAT DepthStencilFormat; - -} D3DXRTS_DESC; - - -typedef interface ID3DXRenderToSurface ID3DXRenderToSurface; -typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE; - - -// {82DF5B90-E34E-496e-AC1C-62117A6A5913} -DEFINE_GUID( IID_ID3DXRenderToSurface, -0x82df5b90, 0xe34e, 0x496e, 0xac, 0x1c, 0x62, 0x11, 0x7a, 0x6a, 0x59, 0x13); - - -#undef INTERFACE -#define INTERFACE ID3DXRenderToSurface - -DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXRenderToSurface - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE; - - STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE8 pSurface, CONST D3DVIEWPORT8* pViewport) PURE; - STDMETHOD(EndScene)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateRenderToSurface( - LPDIRECT3DDEVICE8 pDevice, - UINT Width, - UINT Height, - D3DFORMAT Format, - BOOL DepthStencil, - D3DFORMAT DepthStencilFormat, - LPD3DXRENDERTOSURFACE* ppRenderToSurface); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// ID3DXRenderToEnvMap: -// -------------------- -// This object abstracts rendering to environment maps. These surfaces -// do not necessarily need to be render targets. If they are not, a -// compatible render target is used, and the result copied into the -// environment map at end scene. -// -// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic - -// This function initiates the rendering of the environment map. As -// parameters, you pass the textures in which will get filled in with -// the resulting environment map. -// -// Face - -// Call this function to initiate the drawing of each face. For each -// environment map, you will call this six times.. once for each face -// in D3DCUBEMAP_FACES. -// -// End - -// This will restore all render targets, and if needed compose all the -// rendered faces into the environment map surfaces. -// -// OnLostDevice, OnResetDevice - -// Call OnLostDevice() on this object before calling Reset() on the -// device, so that this object can release any stateblocks and video -// memory resources. After Reset(), the call OnResetDevice(). -/////////////////////////////////////////////////////////////////////////// - -typedef struct _D3DXRTE_DESC -{ - UINT Size; - D3DFORMAT Format; - BOOL DepthStencil; - D3DFORMAT DepthStencilFormat; -} D3DXRTE_DESC; - - -typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap; -typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap; - -// {4E42C623-9451-44b7-8C86-ABCCDE5D52C8} -DEFINE_GUID( IID_ID3DXRenderToEnvMap, -0x4e42c623, 0x9451, 0x44b7, 0x8c, 0x86, 0xab, 0xcc, 0xde, 0x5d, 0x52, 0xc8); - - -#undef INTERFACE -#define INTERFACE ID3DXRenderToEnvMap - -DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXRenderToEnvMap - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE; - - STDMETHOD(BeginCube)(THIS_ - LPDIRECT3DCUBETEXTURE8 pCubeTex) PURE; - - STDMETHOD(BeginSphere)(THIS_ - LPDIRECT3DTEXTURE8 pTex) PURE; - - STDMETHOD(BeginHemisphere)(THIS_ - LPDIRECT3DTEXTURE8 pTexZPos, - LPDIRECT3DTEXTURE8 pTexZNeg) PURE; - - STDMETHOD(BeginParabolic)(THIS_ - LPDIRECT3DTEXTURE8 pTexZPos, - LPDIRECT3DTEXTURE8 pTexZNeg) PURE; - - STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face) PURE; - STDMETHOD(End)(THIS) PURE; - - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateRenderToEnvMap( - LPDIRECT3DDEVICE8 pDevice, - UINT Size, - D3DFORMAT Format, - BOOL DepthStencil, - D3DFORMAT DepthStencilFormat, - LPD3DXRenderToEnvMap* ppRenderToEnvMap); - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// Shader assemblers: -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// D3DXASM flags: -// -------------- -// -// D3DXASM_DEBUG -// Generate debug info. -// -// D3DXASM_SKIPVALIDATION -// Do not validate the generated code against known capabilities and -// constraints. This option is only recommended when assembling shaders -// you KNOW will work. (ie. have assembled before without this option.) -//------------------------------------------------------------------------- - -#define D3DXASM_DEBUG (1 << 0) -#define D3DXASM_SKIPVALIDATION (1 << 1) - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//------------------------------------------------------------------------- -// D3DXAssembleShader: -// ------------------- -// Assembles an ascii description of a vertex or pixel shader into -// binary form. -// -// Parameters: -// pSrcFile -// Source file name -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to source code -// SrcDataLen -// Size of source code, in bytes -// Flags -// D3DXASM_xxx flags -// ppConstants -// Returns an ID3DXBuffer object containing constant declarations. -// ppCompiledShader -// Returns an ID3DXBuffer object containing the object code. -// ppCompilationErrors -// Returns an ID3DXBuffer object containing ascii error messages -//------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXAssembleShaderFromFileA( - LPCSTR pSrcFile, - DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXAssembleShaderFromFileW( - LPCWSTR pSrcFile, - DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW -#else -#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA -#endif - -HRESULT WINAPI - D3DXAssembleShaderFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXAssembleShaderFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW -#else -#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA -#endif - -HRESULT WINAPI - D3DXAssembleShader( - LPCVOID pSrcData, - UINT SrcDataLen, - DWORD Flags, - LPD3DXBUFFER* ppConstants, - LPD3DXBUFFER* ppCompiledShader, - LPD3DXBUFFER* ppCompilationErrors); - - -#ifdef __cplusplus -} -#endif //__cplusplus - - - -/////////////////////////////////////////////////////////////////////////// -// Misc APIs: -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//------------------------------------------------------------------------- -// D3DXGetErrorString: -// ------------------ -// Returns the error string for given an hresult. Interprets all D3DX and -// D3D hresults. -// -// Parameters: -// hr -// The error code to be deciphered. -// pBuffer -// Pointer to the buffer to be filled in. -// BufferLen -// Count of characters in buffer. Any error message longer than this -// length will be truncated to fit. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXGetErrorStringA( - HRESULT hr, - LPSTR pBuffer, - UINT BufferLen); - -HRESULT WINAPI - D3DXGetErrorStringW( - HRESULT hr, - LPWSTR pBuffer, - UINT BufferLen); - -#ifdef UNICODE -#define D3DXGetErrorString D3DXGetErrorStringW -#else -#define D3DXGetErrorString D3DXGetErrorStringA -#endif - - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX8CORE_H__ diff --git a/import/DirectX8/include/d3dx8effect.h b/import/DirectX8/include/d3dx8effect.h deleted file mode 100644 index 97c44df9c..000000000 --- a/import/DirectX8/include/d3dx8effect.h +++ /dev/null @@ -1,226 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8effect.h -// Content: D3DX effect types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8EFFECT_H__ -#define __D3DX8EFFECT_H__ - - -#define D3DXFX_DONOTSAVESTATE (1 << 0) - - -typedef enum _D3DXPARAMETERTYPE -{ - D3DXPT_DWORD = 0, - D3DXPT_FLOAT = 1, - D3DXPT_VECTOR = 2, - D3DXPT_MATRIX = 3, - D3DXPT_TEXTURE = 4, - D3DXPT_VERTEXSHADER = 5, - D3DXPT_PIXELSHADER = 6, - D3DXPT_CONSTANT = 7, - D3DXPT_STRING = 8, - D3DXPT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ - -} D3DXPARAMETERTYPE; - - -typedef struct _D3DXEFFECT_DESC -{ - UINT Parameters; - UINT Techniques; - -} D3DXEFFECT_DESC; - - -typedef struct _D3DXPARAMETER_DESC -{ - LPCSTR Name; - LPCSTR Index; - D3DXPARAMETERTYPE Type; - -} D3DXPARAMETER_DESC; - - -typedef struct _D3DXTECHNIQUE_DESC -{ - LPCSTR Name; - LPCSTR Index; - UINT Passes; - -} D3DXTECHNIQUE_DESC; - - -typedef struct _D3DXPASS_DESC -{ - LPCSTR Name; - LPCSTR Index; - -} D3DXPASS_DESC; - - - -////////////////////////////////////////////////////////////////////////////// -// ID3DXEffect /////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -typedef interface ID3DXEffect ID3DXEffect; -typedef interface ID3DXEffect *LPD3DXEFFECT; - -// {648B1CEB-8D4E-4d66-B6FA-E44969E82E89} -DEFINE_GUID( IID_ID3DXEffect, -0x648b1ceb, 0x8d4e, 0x4d66, 0xb6, 0xfa, 0xe4, 0x49, 0x69, 0xe8, 0x2e, 0x89); - - -#undef INTERFACE -#define INTERFACE ID3DXEffect - -DECLARE_INTERFACE_(ID3DXEffect, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXEffect - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; - STDMETHOD(GetParameterDesc)(THIS_ LPCSTR pParameter, D3DXPARAMETER_DESC* pDesc) PURE; - STDMETHOD(GetTechniqueDesc)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; - STDMETHOD(GetPassDesc)(THIS_ LPCSTR pTechnique, LPCSTR pPass, D3DXPASS_DESC* pDesc) PURE; - STDMETHOD(FindNextValidTechnique)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; - STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE8 pDevice, LPD3DXEFFECT* ppEffect) PURE; - STDMETHOD(GetCompiledEffect)(THIS_ LPD3DXBUFFER* ppCompiledEffect) PURE; - - STDMETHOD(SetTechnique)(THIS_ LPCSTR pTechnique) PURE; - STDMETHOD(GetTechnique)(THIS_ LPCSTR* ppTechnique) PURE; - - STDMETHOD(SetDword)(THIS_ LPCSTR pParameter, DWORD dw) PURE; - STDMETHOD(GetDword)(THIS_ LPCSTR pParameter, DWORD* pdw) PURE; - STDMETHOD(SetFloat)(THIS_ LPCSTR pParameter, FLOAT f) PURE; - STDMETHOD(GetFloat)(THIS_ LPCSTR pParameter, FLOAT* pf) PURE; - STDMETHOD(SetVector)(THIS_ LPCSTR pParameter, CONST D3DXVECTOR4* pVector) PURE; - STDMETHOD(GetVector)(THIS_ LPCSTR pParameter, D3DXVECTOR4* pVector) PURE; - STDMETHOD(SetMatrix)(THIS_ LPCSTR pParameter, CONST D3DXMATRIX* pMatrix) PURE; - STDMETHOD(GetMatrix)(THIS_ LPCSTR pParameter, D3DXMATRIX* pMatrix) PURE; - STDMETHOD(SetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 pTexture) PURE; - STDMETHOD(GetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 *ppTexture) PURE; - STDMETHOD(SetVertexShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE; - STDMETHOD(GetVertexShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE; - STDMETHOD(SetPixelShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE; - STDMETHOD(GetPixelShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE; - STDMETHOD(SetString)(THIS_ LPCSTR pParameter, LPCSTR pString) PURE; - STDMETHOD(GetString)(THIS_ LPCSTR pParameter, LPCSTR* ppString) PURE; - STDMETHOD_(BOOL, IsParameterUsed)(THIS_ LPCSTR pParameter) PURE; - - STDMETHOD(Validate)(THIS) PURE; - STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE; - STDMETHOD(Pass)(THIS_ UINT Pass) PURE; - STDMETHOD(End)(THIS) PURE; - STDMETHOD(OnLostDevice)(THIS) PURE; - STDMETHOD(OnResetDevice)(THIS) PURE; -}; - - - -////////////////////////////////////////////////////////////////////////////// -// APIs ////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//---------------------------------------------------------------------------- -// D3DXCreateEffect: -// ----------------- -// Creates an effect from an ascii or binaray effect description. -// -// Parameters: -// pDevice -// Pointer of the device on which to create the effect -// pSrcFile -// Name of the file containing the effect description -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pSrcData -// Pointer to effect description -// SrcDataSize -// Size of the effect description in bytes -// ppEffect -// Returns a buffer containing created effect. -// ppCompilationErrors -// Returns a buffer containing any error messages which occurred during -// compile. Or NULL if you do not care about the error messages. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateEffectFromFileA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromFileW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW -#else -#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateEffectFromResourceA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -HRESULT WINAPI - D3DXCreateEffectFromResourceW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - -#ifdef UNICODE -#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW -#else -#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateEffect( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPD3DXEFFECT* ppEffect, - LPD3DXBUFFER* ppCompilationErrors); - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX8EFFECT_H__ diff --git a/import/DirectX8/include/d3dx8math.h b/import/DirectX8/include/d3dx8math.h deleted file mode 100644 index 9c8f20301..000000000 --- a/import/DirectX8/include/d3dx8math.h +++ /dev/null @@ -1,1215 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8math.h -// Content: D3DX math types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8MATH_H__ -#define __D3DX8MATH_H__ - -#include -#pragma warning(disable:4201) // anonymous unions warning - - - -//=========================================================================== -// -// General purpose utilities -// -//=========================================================================== -#define D3DX_PI ((FLOAT) 3.141592654f) -#define D3DX_1BYPI ((FLOAT) 0.318309886f) - -#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) -#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) - - - -//=========================================================================== -// -// Vectors -// -//=========================================================================== - -//-------------------------- -// 2D Vector -//-------------------------- -typedef struct D3DXVECTOR2 -{ -#ifdef __cplusplus -public: - D3DXVECTOR2() {}; - D3DXVECTOR2( CONST FLOAT * ); - D3DXVECTOR2( FLOAT x, FLOAT y ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); - D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); - D3DXVECTOR2& operator *= ( FLOAT ); - D3DXVECTOR2& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR2 operator + () const; - D3DXVECTOR2 operator - () const; - - // binary operators - D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; - D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; - D3DXVECTOR2 operator * ( FLOAT ) const; - D3DXVECTOR2 operator / ( FLOAT ) const; - - friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); - - BOOL operator == ( CONST D3DXVECTOR2& ) const; - BOOL operator != ( CONST D3DXVECTOR2& ) const; - - -public: -#endif //__cplusplus - FLOAT x, y; -} D3DXVECTOR2, *LPD3DXVECTOR2; - - -//-------------------------- -// 3D Vector -//-------------------------- -#ifdef __cplusplus -typedef struct D3DXVECTOR3 : public D3DVECTOR -{ -public: - D3DXVECTOR3() {}; - D3DXVECTOR3( CONST FLOAT * ); - D3DXVECTOR3( CONST D3DVECTOR& ); - D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); - D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); - D3DXVECTOR3& operator *= ( FLOAT ); - D3DXVECTOR3& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR3 operator + () const; - D3DXVECTOR3 operator - () const; - - // binary operators - D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; - D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; - D3DXVECTOR3 operator * ( FLOAT ) const; - D3DXVECTOR3 operator / ( FLOAT ) const; - - friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); - - BOOL operator == ( CONST D3DXVECTOR3& ) const; - BOOL operator != ( CONST D3DXVECTOR3& ) const; - -} D3DXVECTOR3, *LPD3DXVECTOR3; - -#else //!__cplusplus -typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; -#endif //!__cplusplus - - -//-------------------------- -// 4D Vector -//-------------------------- -typedef struct D3DXVECTOR4 -{ -#ifdef __cplusplus -public: - D3DXVECTOR4() {}; - D3DXVECTOR4( CONST FLOAT* ); - D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); - D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); - D3DXVECTOR4& operator *= ( FLOAT ); - D3DXVECTOR4& operator /= ( FLOAT ); - - // unary operators - D3DXVECTOR4 operator + () const; - D3DXVECTOR4 operator - () const; - - // binary operators - D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; - D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; - D3DXVECTOR4 operator * ( FLOAT ) const; - D3DXVECTOR4 operator / ( FLOAT ) const; - - friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); - - BOOL operator == ( CONST D3DXVECTOR4& ) const; - BOOL operator != ( CONST D3DXVECTOR4& ) const; - -public: -#endif //__cplusplus - FLOAT x, y, z, w; -} D3DXVECTOR4, *LPD3DXVECTOR4; - - -//=========================================================================== -// -// Matrices -// -//=========================================================================== -#ifdef __cplusplus -typedef struct D3DXMATRIX : public D3DMATRIX -{ -public: - D3DXMATRIX() {}; - D3DXMATRIX( CONST FLOAT * ); - D3DXMATRIX( CONST D3DMATRIX& ); - D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, - FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, - FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, - FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); - - - // access grants - FLOAT& operator () ( UINT Row, UINT Col ); - FLOAT operator () ( UINT Row, UINT Col ) const; - - // casting operators - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); - D3DXMATRIX& operator *= ( FLOAT ); - D3DXMATRIX& operator /= ( FLOAT ); - - // unary operators - D3DXMATRIX operator + () const; - D3DXMATRIX operator - () const; - - // binary operators - D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; - D3DXMATRIX operator * ( FLOAT ) const; - D3DXMATRIX operator / ( FLOAT ) const; - - friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); - - BOOL operator == ( CONST D3DXMATRIX& ) const; - BOOL operator != ( CONST D3DXMATRIX& ) const; - -} D3DXMATRIX, *LPD3DXMATRIX; - -#else //!__cplusplus -typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; -#endif //!__cplusplus - -//=========================================================================== -// -// Aligned Matrices -// -// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. -// It aligns matrices on the stack and on the heap or in global scope. -// It does this using __declspec(align(16)) which works on VC7 and on VC 6 -// with the processor pack. Unfortunately there is no way to detect the -// latter so this is turned on only on VC7. On other compilers this is the -// the same as D3DXMATRIX. -// Using this class on a compiler that does not actually do the alignment -// can be dangerous since it will not expose bugs that ignore alignment. -// E.g if an object of this class in inside a struct or class, and some code -// memcopys data in it assuming tight packing. This could break on a compiler -// that eventually start aligning the matrix. -// -//=========================================================================== -#ifdef __cplusplus -typedef struct _D3DXMATRIXA16 : public D3DXMATRIX -{ - _D3DXMATRIXA16() {} - _D3DXMATRIXA16( CONST FLOAT * f): D3DXMATRIX(f) {} - _D3DXMATRIXA16( CONST D3DMATRIX& m): D3DXMATRIX(m) {} - _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, - FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, - FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, - FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : - D3DXMATRIX(_11, _12, _13, _14, - _21, _22, _23, _24, - _31, _32, _33, _34, - _41, _42, _43, _44) {} - void* operator new(size_t s) - { - LPBYTE p = ::new BYTE[s + 16]; - if (p) - { - BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); - p += offset; - p[-1] = offset; - } - return p; - }; - - void* operator new[](size_t s) - { - LPBYTE p = ::new BYTE[s + 16]; - if (p) - { - BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); - p += offset; - p[-1] = offset; - } - return p; - }; - - // This is NOT a virtual operator. If you cast - // to D3DXMATRIX, do not delete using that - void operator delete(void* p) - { - if(p) - { - BYTE* pb = static_cast(p); - pb -= pb[-1]; - ::delete [] pb; - } - }; - - // This is NOT a virtual operator. If you cast - // to D3DXMATRIX, do not delete using that - void operator delete[](void* p) - { - if(p) - { - BYTE* pb = static_cast(p); - pb -= pb[-1]; - ::delete [] pb; - } - }; - - struct _D3DXMATRIXA16& operator=(CONST D3DXMATRIX& rhs) - { - memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); - return *this; - }; -} _D3DXMATRIXA16; - -#else //!__cplusplus -typedef D3DXMATRIX _D3DXMATRIXA16; -#endif //!__cplusplus - -#if _MSC_VER >= 1300 // VC7 -#define _ALIGN_16 __declspec(align(16)) -#else -#define _ALIGN_16 // Earlier compiler may not understand this, do nothing. -#endif - -#define D3DXMATRIXA16 _ALIGN_16 _D3DXMATRIXA16 - -typedef D3DXMATRIXA16 *LPD3DXMATRIXA16; - -//=========================================================================== -// -// Quaternions -// -//=========================================================================== -typedef struct D3DXQUATERNION -{ -#ifdef __cplusplus -public: - D3DXQUATERNION() {} - D3DXQUATERNION( CONST FLOAT * ); - D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // assignment operators - D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( FLOAT ); - D3DXQUATERNION& operator /= ( FLOAT ); - - // unary operators - D3DXQUATERNION operator + () const; - D3DXQUATERNION operator - () const; - - // binary operators - D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( FLOAT ) const; - D3DXQUATERNION operator / ( FLOAT ) const; - - friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); - - BOOL operator == ( CONST D3DXQUATERNION& ) const; - BOOL operator != ( CONST D3DXQUATERNION& ) const; - -#endif //__cplusplus - FLOAT x, y, z, w; -} D3DXQUATERNION, *LPD3DXQUATERNION; - - -//=========================================================================== -// -// Planes -// -//=========================================================================== -typedef struct D3DXPLANE -{ -#ifdef __cplusplus -public: - D3DXPLANE() {} - D3DXPLANE( CONST FLOAT* ); - D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); - - // casting - operator FLOAT* (); - operator CONST FLOAT* () const; - - // unary operators - D3DXPLANE operator + () const; - D3DXPLANE operator - () const; - - // binary operators - BOOL operator == ( CONST D3DXPLANE& ) const; - BOOL operator != ( CONST D3DXPLANE& ) const; - -#endif //__cplusplus - FLOAT a, b, c, d; -} D3DXPLANE, *LPD3DXPLANE; - - -//=========================================================================== -// -// Colors -// -//=========================================================================== - -typedef struct D3DXCOLOR -{ -#ifdef __cplusplus -public: - D3DXCOLOR() {} - D3DXCOLOR( DWORD argb ); - D3DXCOLOR( CONST FLOAT * ); - D3DXCOLOR( CONST D3DCOLORVALUE& ); - D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); - - // casting - operator DWORD () const; - - operator FLOAT* (); - operator CONST FLOAT* () const; - - operator D3DCOLORVALUE* (); - operator CONST D3DCOLORVALUE* () const; - - operator D3DCOLORVALUE& (); - operator CONST D3DCOLORVALUE& () const; - - // assignment operators - D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); - D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); - D3DXCOLOR& operator *= ( FLOAT ); - D3DXCOLOR& operator /= ( FLOAT ); - - // unary operators - D3DXCOLOR operator + () const; - D3DXCOLOR operator - () const; - - // binary operators - D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; - D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; - D3DXCOLOR operator * ( FLOAT ) const; - D3DXCOLOR operator / ( FLOAT ) const; - - friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR& ); - - BOOL operator == ( CONST D3DXCOLOR& ) const; - BOOL operator != ( CONST D3DXCOLOR& ) const; - -#endif //__cplusplus - FLOAT r, g, b, a; -} D3DXCOLOR, *LPD3DXCOLOR; - - - -//=========================================================================== -// -// D3DX math functions: -// -// NOTE: -// * All these functions can take the same object as in and out parameters. -// -// * Out parameters are typically also returned as return values, so that -// the output of one function may be used as a parameter to another. -// -//=========================================================================== - -//-------------------------- -// 2D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec2Length - ( CONST D3DXVECTOR2 *pV ); - -FLOAT D3DXVec2LengthSq - ( CONST D3DXVECTOR2 *pV ); - -FLOAT D3DXVec2Dot - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Z component of ((x1,y1,0) cross (x2,y2,0)) -FLOAT D3DXVec2CCW - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2) -D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2) -D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR2* WINAPI D3DXVec2Normalize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR2* WINAPI D3DXVec2Hermite - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, - CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR2* WINAPI D3DXVec2CatmullRom - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, - CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR2* WINAPI D3DXVec2BaryCentric - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); - -// Transform (x, y, 0, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec2Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, 0, 1) by matrix, project result back into w=1. -D3DXVECTOR2* WINAPI D3DXVec2TransformCoord - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, 0, 0) by matrix. -D3DXVECTOR2* WINAPI D3DXVec2TransformNormal - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 3D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec3Length - ( CONST D3DXVECTOR3 *pV ); - -FLOAT D3DXVec3LengthSq - ( CONST D3DXVECTOR3 *pV ); - -FLOAT D3DXVec3Dot - ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR3* WINAPI D3DXVec3Normalize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR3* WINAPI D3DXVec3Hermite - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, - CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR3* WINAPI D3DXVec3CatmullRom - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, - CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR3* WINAPI D3DXVec3BaryCentric - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); - -// Transform (x, y, z, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec3Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, z, 1) by matrix, project result back into w=1. -D3DXVECTOR3* WINAPI D3DXVec3TransformCoord - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - -// Transform (x, y, z, 0) by matrix. If you transforming a normal by a -// non-affine matrix, the matrix you pass to this function should be the -// transpose of the inverse of the matrix you would use to transform a coord. -D3DXVECTOR3* WINAPI D3DXVec3TransformNormal - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); - -// Project vector from object space into screen space -D3DXVECTOR3* WINAPI D3DXVec3Project - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); - -// Project vector from screen space into object space -D3DXVECTOR3* WINAPI D3DXVec3Unproject - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport, - CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); - -#ifdef __cplusplus -} -#endif - - - -//-------------------------- -// 4D Vector -//-------------------------- - -// inline - -FLOAT D3DXVec4Length - ( CONST D3DXVECTOR4 *pV ); - -FLOAT D3DXVec4LengthSq - ( CONST D3DXVECTOR4 *pV ); - -FLOAT D3DXVec4Dot - ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); - -D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - FLOAT s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Cross-product in 4 dimensions. -D3DXVECTOR4* WINAPI D3DXVec4Cross - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - CONST D3DXVECTOR4 *pV3); - -D3DXVECTOR4* WINAPI D3DXVec4Normalize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR4* WINAPI D3DXVec4Hermite - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, - CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); - -// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) -D3DXVECTOR4* WINAPI D3DXVec4CatmullRom - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, - CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR4* WINAPI D3DXVec4BaryCentric - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); - -// Transform vector by matrix. -D3DXVECTOR4* WINAPI D3DXVec4Transform - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 4D Matrix -//-------------------------- - -// inline - -D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ); - -BOOL D3DXMatrixIsIdentity - ( CONST D3DXMATRIX *pM ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -FLOAT WINAPI D3DXMatrixfDeterminant - ( CONST D3DXMATRIX *pM ); - -D3DXMATRIX* WINAPI D3DXMatrixTranspose - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); - -// Matrix multiplication. The result represents the transformation M2 -// followed by the transformation M1. (Out = M1 * M2) -D3DXMATRIX* WINAPI D3DXMatrixMultiply - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); - -// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) -D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose - ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); - -// Calculate inverse of matrix. Inversion my fail, in which case NULL will -// be returned. The determinant of pM is also returned it pfDeterminant -// is non-NULL. -D3DXMATRIX* WINAPI D3DXMatrixInverse - ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); - -// Build a matrix which scales by (sx, sy, sz) -D3DXMATRIX* WINAPI D3DXMatrixScaling - ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); - -// Build a matrix which translates by (x, y, z) -D3DXMATRIX* WINAPI D3DXMatrixTranslation - ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); - -// Build a matrix which rotates around the X axis -D3DXMATRIX* WINAPI D3DXMatrixRotationX - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around the Y axis -D3DXMATRIX* WINAPI D3DXMatrixRotationY - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around the Z axis -D3DXMATRIX* WINAPI D3DXMatrixRotationZ - ( D3DXMATRIX *pOut, FLOAT Angle ); - -// Build a matrix which rotates around an arbitrary axis -D3DXMATRIX* WINAPI D3DXMatrixRotationAxis - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); - -// Build a matrix from a quaternion -D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion - ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll - ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); - - -// Build transformation matrix. NULL arguments are treated as identity. -// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixTransformation - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, - CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, - CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, - CONST D3DXVECTOR3 *pTranslation); - -// Build affine transformation matrix. NULL arguments are treated as identity. -// Mout = Ms * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation - ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, - CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); - -// Build a lookat matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAtRH - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, - CONST D3DXVECTOR3 *pUp ); - -// Build a lookat matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAtLH - ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, - CONST D3DXVECTOR3 *pUp ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH - ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH - ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoRH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoLH - ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH - ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, - FLOAT zf ); - -// Build a matrix which flattens geometry into a plane, as if casting -// a shadow from a light. -D3DXMATRIX* WINAPI D3DXMatrixShadow - ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, - CONST D3DXPLANE *pPlane ); - -// Build a matrix which reflects the coordinate system about a plane -D3DXMATRIX* WINAPI D3DXMatrixReflect - ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Quaternion -//-------------------------- - -// inline - -FLOAT D3DXQuaternionLength - ( CONST D3DXQUATERNION *pQ ); - -// Length squared, or "norm" -FLOAT D3DXQuaternionLengthSq - ( CONST D3DXQUATERNION *pQ ); - -FLOAT D3DXQuaternionDot - ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); - -// (0, 0, 0, 1) -D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ); - -BOOL D3DXQuaternionIsIdentity - ( CONST D3DXQUATERNION *pQ ); - -// (-x, -y, -z, w) -D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. -void WINAPI D3DXQuaternionToAxisAngle - ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); - -// Build a quaternion from a rotation matrix. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix - ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); - -// Rotation about arbitrary axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis - ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll - ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); - -// Quaternion multiplication. The result represents the rotation Q2 -// followed by the rotation Q1. (Out = Q2 * Q1) -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2 ); - -D3DXQUATERNION* WINAPI D3DXQuaternionNormalize - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Conjugate and re-norm -D3DXQUATERNION* WINAPI D3DXQuaternionInverse - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Expects unit quaternions. -// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) -D3DXQUATERNION* WINAPI D3DXQuaternionLn - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Expects pure quaternions. (w == 0) w is ignored in calculation. -// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) -D3DXQUATERNION* WINAPI D3DXQuaternionExp - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); - -// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). -// Expects unit quaternions. -D3DXQUATERNION* WINAPI D3DXQuaternionSlerp - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, FLOAT t ); - -// Spherical quadrangle interpolation. -// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) -D3DXQUATERNION* WINAPI D3DXQuaternionSquad - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, - CONST D3DXQUATERNION *pC, FLOAT t ); - -// Setup control points for spherical quadrangle interpolation -// from Q1 to Q2. The control points are chosen in such a way -// to ensure the continuity of tangents with adjacent segments. -void WINAPI D3DXQuaternionSquadSetup - ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, - CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); - -// Barycentric interpolation. -// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) -D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, - CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, - FLOAT f, FLOAT g ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Plane -//-------------------------- - -// inline - -// ax + by + cz + dw -FLOAT D3DXPlaneDot - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); - -// ax + by + cz + d -FLOAT D3DXPlaneDotCoord - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); - -// ax + by + cz -FLOAT D3DXPlaneDotNormal - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Normalize plane (so that |a,b,c| == 1) -D3DXPLANE* WINAPI D3DXPlaneNormalize - ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); - -// Find the intersection between a plane and a line. If the line is -// parallel to the plane, NULL is returned. -D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine - ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, - CONST D3DXVECTOR3 *pV2); - -// Construct a plane from a point and a normal -D3DXPLANE* WINAPI D3DXPlaneFromPointNormal - ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); - -// Construct a plane from 3 points -D3DXPLANE* WINAPI D3DXPlaneFromPoints - ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - CONST D3DXVECTOR3 *pV3); - -// Transform a plane by a matrix. The vector (a,b,c) must be normal. -// M should be the inverse transpose of the transformation desired. -D3DXPLANE* WINAPI D3DXPlaneTransform - ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Color -//-------------------------- - -// inline - -// (1-r, 1-g, 1-b, a) -D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); - -D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); - -// (r1*r2, g1*g2, b1*b2, a1*a2) -D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); - -// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) -D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Interpolate r,g,b between desaturated color and color. -// DesaturatedColor + s(Color - DesaturatedColor) -D3DXCOLOR* WINAPI D3DXColorAdjustSaturation - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); - -// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) -D3DXCOLOR* WINAPI D3DXColorAdjustContrast - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); - -#ifdef __cplusplus -} -#endif - - - - -//-------------------------- -// Misc -//-------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -// Calculate Fresnel term given the cosine of theta (likely obtained by -// taking the dot of two normals), and the refraction index of the material. -FLOAT WINAPI D3DXFresnelTerm - (FLOAT CosTheta, FLOAT RefractionIndex); - -#ifdef __cplusplus -} -#endif - - - -//=========================================================================== -// -// Matrix Stack -// -//=========================================================================== - -typedef interface ID3DXMatrixStack ID3DXMatrixStack; -typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; - -// {E3357330-CC5E-11d2-A434-00A0C90629A8} -DEFINE_GUID( IID_ID3DXMatrixStack, -0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); - - -#undef INTERFACE -#define INTERFACE ID3DXMatrixStack - -DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) -{ - // - // IUnknown methods - // - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // - // ID3DXMatrixStack methods - // - - // Pops the top of the stack, returns the current top - // *after* popping the top. - STDMETHOD(Pop)(THIS) PURE; - - // Pushes the stack by one, duplicating the current matrix. - STDMETHOD(Push)(THIS) PURE; - - // Loads identity in the current matrix. - STDMETHOD(LoadIdentity)(THIS) PURE; - - // Loads the given matrix into the current matrix - STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Right-Multiplies the given matrix to the current matrix. - // (transformation is about the current world origin) - STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Left-Multiplies the given matrix to the current matrix - // (transformation is about the local origin of the object) - STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the current world origin) - STDMETHOD(RotateAxis) - (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the local origin of the object) - STDMETHOD(RotateAxisLocal) - (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // current world origin) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRoll) - (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // local origin of the object) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRollLocal) - (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; - - // Right multiply the current matrix with the computed scale - // matrix. (transformation is about the current world origin) - STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Left multiply the current matrix with the computed scale - // matrix. (transformation is about the local origin of the object) - STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Right multiply the current matrix with the computed translation - // matrix. (transformation is about the current world origin) - STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; - - // Left multiply the current matrix with the computed translation - // matrix. (transformation is about the local origin of the object) - STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; - - // Obtain the current matrix at the top of the stack - STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI - D3DXCreateMatrixStack( - DWORD Flags, - LPD3DXMATRIXSTACK* ppStack); - -#ifdef __cplusplus -} -#endif - -#include "d3dx8math.inl" - -#pragma warning(default:4201) - -#endif // __D3DX8MATH_H__ diff --git a/import/DirectX8/include/d3dx8math.inl b/import/DirectX8/include/d3dx8math.inl deleted file mode 100644 index a64e5c540..000000000 --- a/import/DirectX8/include/d3dx8math.inl +++ /dev/null @@ -1,1757 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8math.inl -// Content: D3DX math inline functions -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DX8MATH_INL__ -#define __D3DX8MATH_INL__ - - -//=========================================================================== -// -// Inline Class Methods -// -//=========================================================================== - -#ifdef __cplusplus - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; -} - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) -{ - x = fx; - y = fy; -} - -// casting -D3DXINLINE -D3DXVECTOR2::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR2::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - -// assignment operators -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) -{ - x += v.x; - y += v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) -{ - x -= v.x; - y -= v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - return *this; -} - -// unary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - () const -{ - return D3DXVECTOR2(-x, -y); -} - -// binary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x + v.x, y + v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x - v.x, y - v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator * ( FLOAT f ) const -{ - return D3DXVECTOR2(x * f, y * f); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR2(x * fInv, y * fInv); -} - - -D3DXINLINE D3DXVECTOR2 -operator * ( FLOAT f, CONST D3DXVECTOR2& v ) -{ - return D3DXVECTOR2(f * v.x, f * v.y); -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const -{ - return x == v.x && y == v.y; -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const -{ - return x != v.x || y != v.y; -} - - - - -//-------------------------- -// 3D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) -{ - x = v.x; - y = v.y; - z = v.z; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) -{ - x = fx; - y = fy; - z = fz; -} - - -// casting -D3DXINLINE -D3DXVECTOR3::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR3::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) -{ - x += v.x; - y += v.y; - z += v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - () const -{ - return D3DXVECTOR3(-x, -y, -z); -} - - -// binary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator * ( FLOAT f ) const -{ - return D3DXVECTOR3(x * f, y * f, z * f); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); -} - - -D3DXINLINE D3DXVECTOR3 -operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) -{ - return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); -} - - -D3DXINLINE BOOL -D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const -{ - return x == v.x && y == v.y && z == v.z; -} - -D3DXINLINE BOOL -D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const -{ - return x != v.x || y != v.y || z != v.z; -} - - - -//-------------------------- -// 4D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXVECTOR4::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXVECTOR4::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) -{ - x += v.x; - y += v.y; - z += v.z; - w += v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - w -= v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - () const -{ - return D3DXVECTOR4(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator * ( FLOAT f ) const -{ - return D3DXVECTOR4(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); -} - - -D3DXINLINE D3DXVECTOR4 -operator * ( FLOAT f, CONST D3DXVECTOR4& v ) -{ - return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); -} - - -D3DXINLINE BOOL -D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const -{ - return x == v.x && y == v.y && z == v.z && w == v.w; -} - -D3DXINLINE BOOL -D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const -{ - return x != v.x || y != v.y || z != v.z || w != v.w; -} - - -//-------------------------- -// Matrix -//-------------------------- -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - memcpy(&_11, pf, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) -{ - memcpy(&_11, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, - FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, - FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, - FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) -{ - _11 = f11; _12 = f12; _13 = f13; _14 = f14; - _21 = f21; _22 = f22; _23 = f23; _24 = f24; - _31 = f31; _32 = f32; _33 = f33; _34 = f34; - _41 = f41; _42 = f42; _43 = f43; _44 = f44; -} - - - -// access grants -D3DXINLINE FLOAT& -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) -{ - return m[iRow][iCol]; -} - -D3DXINLINE FLOAT -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const -{ - return m[iRow][iCol]; -} - - -// casting operators -D3DXINLINE -D3DXMATRIX::operator FLOAT* () -{ - return (FLOAT *) &_11; -} - -D3DXINLINE -D3DXMATRIX::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &_11; -} - - -// assignment operators -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) -{ - D3DXMatrixMultiply(this, this, &mat); - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) -{ - _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; - _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; - _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; - _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) -{ - _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; - _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; - _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; - _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( FLOAT f ) -{ - _11 *= f; _12 *= f; _13 *= f; _14 *= f; - _21 *= f; _22 *= f; _23 *= f; _24 *= f; - _31 *= f; _32 *= f; _33 *= f; _34 *= f; - _41 *= f; _42 *= f; _43 *= f; _44 *= f; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; - _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; - _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; - _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - () const -{ - return D3DXMATRIX(-_11, -_12, -_13, -_14, - -_21, -_22, -_23, -_24, - -_31, -_32, -_33, -_34, - -_41, -_42, -_43, -_44); -} - - -// binary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const -{ - D3DXMATRIX matT; - D3DXMatrixMultiply(&matT, this, &mat); - return matT; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, - _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, - _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, - _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, - _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, - _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, - _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( FLOAT f ) const -{ - return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, - _21 * f, _22 * f, _23 * f, _24 * f, - _31 * f, _32 * f, _33 * f, _34 * f, - _41 * f, _42 * f, _43 * f, _44 * f); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, - _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, - _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, - _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); -} - - -D3DXINLINE D3DXMATRIX -operator * ( FLOAT f, CONST D3DXMATRIX& mat ) -{ - return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, - f * mat._21, f * mat._22, f * mat._23, f * mat._24, - f * mat._31, f * mat._32, f * mat._33, f * mat._34, - f * mat._41, f * mat._42, f * mat._43, f * mat._44); -} - - -D3DXINLINE BOOL -D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const -{ - return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE BOOL -D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const -{ - return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXQUATERNION::operator FLOAT* () -{ - return (FLOAT *) &x; -} - -D3DXINLINE -D3DXQUATERNION::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &x; -} - - -// assignment operators -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) -{ - x += q.x; - y += q.y; - z += q.z; - w += q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) -{ - x -= q.x; - y -= q.y; - z -= q.z; - w -= q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) -{ - D3DXQuaternionMultiply(this, this, &q); - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( FLOAT f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - () const -{ - return D3DXQUATERNION(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const -{ - D3DXQUATERNION qT; - D3DXQuaternionMultiply(&qT, this, &q); - return qT; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( FLOAT f ) const -{ - return D3DXQUATERNION(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); -} - - -D3DXINLINE D3DXQUATERNION -operator * (FLOAT f, CONST D3DXQUATERNION& q ) -{ - return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); -} - - -D3DXINLINE BOOL -D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const -{ - return x == q.x && y == q.y && z == q.z && w == q.w; -} - -D3DXINLINE BOOL -D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const -{ - return x != q.x || y != q.y || z != q.z || w != q.w; -} - - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE -D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - a = pf[0]; - b = pf[1]; - c = pf[2]; - d = pf[3]; -} - -D3DXINLINE -D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) -{ - a = fa; - b = fb; - c = fc; - d = fd; -} - - -// casting -D3DXINLINE -D3DXPLANE::operator FLOAT* () -{ - return (FLOAT *) &a; -} - -D3DXINLINE -D3DXPLANE::operator CONST FLOAT* () const -{ - return (CONST FLOAT *) &a; -} - - -// unary operators -D3DXINLINE D3DXPLANE -D3DXPLANE::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXPLANE -D3DXPLANE::operator - () const -{ - return D3DXPLANE(-a, -b, -c, -d); -} - - -// binary operators -D3DXINLINE BOOL -D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const -{ - return a == p.a && b == p.b && c == p.c && d == p.d; -} - -D3DXINLINE BOOL -D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const -{ - return a != p.a || b != p.b || c != p.c || d != p.d; -} - - - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( DWORD dw ) -{ - CONST FLOAT f = 1.0f / 255.0f; - r = f * (FLOAT) (unsigned char) (dw >> 16); - g = f * (FLOAT) (unsigned char) (dw >> 8); - b = f * (FLOAT) (unsigned char) (dw >> 0); - a = f * (FLOAT) (unsigned char) (dw >> 24); -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - r = pf[0]; - g = pf[1]; - b = pf[2]; - a = pf[3]; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( CONST D3DCOLORVALUE& c ) -{ - r = c.r; - g = c.g; - b = c.b; - a = c.a; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) -{ - r = fr; - g = fg; - b = fb; - a = fa; -} - - -// casting -D3DXINLINE -D3DXCOLOR::operator DWORD () const -{ - DWORD dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD) (r * 255.0f + 0.5f); - DWORD dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD) (g * 255.0f + 0.5f); - DWORD dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD) (b * 255.0f + 0.5f); - DWORD dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD) (a * 255.0f + 0.5f); - - return (dwA << 24) | (dwR << 16) | (dwG << 8) | dwB; -} - - -D3DXINLINE -D3DXCOLOR::operator FLOAT * () -{ - return (FLOAT *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator CONST FLOAT * () const -{ - return (CONST FLOAT *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE * () -{ - return (D3DCOLORVALUE *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator CONST D3DCOLORVALUE * () const -{ - return (CONST D3DCOLORVALUE *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE& () -{ - return *((D3DCOLORVALUE *) &r); -} - -D3DXINLINE -D3DXCOLOR::operator CONST D3DCOLORVALUE& () const -{ - return *((CONST D3DCOLORVALUE *) &r); -} - - -// assignment operators -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) -{ - r += c.r; - g += c.g; - b += c.b; - a += c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) -{ - r -= c.r; - g -= c.g; - b -= c.b; - a -= c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator *= ( FLOAT f ) -{ - r *= f; - g *= f; - b *= f; - a *= f; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator /= ( FLOAT f ) -{ - FLOAT fInv = 1.0f / f; - r *= fInv; - g *= fInv; - b *= fInv; - a *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - () const -{ - return D3DXCOLOR(-r, -g, -b, -a); -} - - -// binary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator * ( FLOAT f ) const -{ - return D3DXCOLOR(r * f, g * f, b * f, a * f); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator / ( FLOAT f ) const -{ - FLOAT fInv = 1.0f / f; - return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); -} - - -D3DXINLINE D3DXCOLOR -operator * (FLOAT f, CONST D3DXCOLOR& c ) -{ - return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); -} - - -D3DXINLINE BOOL -D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const -{ - return r == c.r && g == c.g && b == c.b && a == c.a; -} - -D3DXINLINE BOOL -D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const -{ - return r != c.r || g != c.g || b != c.b || a != c.a; -} - - -#endif //__cplusplus - - - -//=========================================================================== -// -// Inline functions -// -//=========================================================================== - - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec2Length - ( CONST D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); -#endif -} - -D3DXINLINE FLOAT D3DXVec2LengthSq - ( CONST D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y; -} - -D3DXINLINE FLOAT D3DXVec2Dot - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y; -} - -D3DXINLINE FLOAT D3DXVec2CCW - ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->y - pV1->y * pV2->x; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - return pOut; -} - - -//-------------------------- -// 3D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec3Length - ( CONST D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#endif -} - -D3DXINLINE FLOAT D3DXVec3LengthSq - ( CONST D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; -} - -D3DXINLINE FLOAT D3DXVec3Dot - ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ - D3DXVECTOR3 v; - -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - v.x = pV1->y * pV2->z - pV1->z * pV2->y; - v.y = pV1->z * pV2->x - pV1->x * pV2->z; - v.z = pV1->x * pV2->y - pV1->y * pV2->x; - - *pOut = v; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - return pOut; -} - - -//-------------------------- -// 4D Vector -//-------------------------- - -D3DXINLINE FLOAT D3DXVec4Length - ( CONST D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#else - return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#endif -} - -D3DXINLINE FLOAT D3DXVec4LengthSq - ( CONST D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; -} - -D3DXINLINE FLOAT D3DXVec4Dot - ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - pOut->w = pV1->w + pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - pOut->w = pV1->w - pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - pOut->w = pV->w * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, - FLOAT s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - pOut->w = pV1->w + s * (pV2->w - pV1->w); - return pOut; -} - - -//-------------------------- -// 4D Matrix -//-------------------------- - -D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = - pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = - pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = - pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; - - pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; - return pOut; -} - - -D3DXINLINE BOOL D3DXMatrixIsIdentity - ( CONST D3DXMATRIX *pM ) -{ -#ifdef D3DX_DEBUG - if(!pM) - return FALSE; -#endif - - return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && - pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && - pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && - pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; -} - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE FLOAT D3DXQuaternionLength - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#else - return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#endif -} - -D3DXINLINE FLOAT D3DXQuaternionLengthSq - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - - return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; -} - -D3DXINLINE FLOAT D3DXQuaternionDot - ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) -{ -#ifdef D3DX_DEBUG - if(!pQ1 || !pQ2) - return 0.0f; -#endif - - return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->x = pOut->y = pOut->z = 0.0f; - pOut->w = 1.0f; - return pOut; -} - -D3DXINLINE BOOL D3DXQuaternionIsIdentity - ( CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return FALSE; -#endif - - return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pQ) - return NULL; -#endif - - pOut->x = -pQ->x; - pOut->y = -pQ->y; - pOut->z = -pQ->z; - pOut->w = pQ->w; - return pOut; -} - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE FLOAT D3DXPlaneDot - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; -} - -D3DXINLINE FLOAT D3DXPlaneDotCoord - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; -} - -D3DXINLINE FLOAT D3DXPlaneDotNormal - ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; -} - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = 1.0f - pC->r; - pOut->g = 1.0f - pC->g; - pOut->b = 1.0f - pC->b; - pOut->a = pC->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + pC2->r; - pOut->g = pC1->g + pC2->g; - pOut->b = pC1->b + pC2->b; - pOut->a = pC1->a + pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r - pC2->r; - pOut->g = pC1->g - pC2->g; - pOut->b = pC1->b - pC2->b; - pOut->a = pC1->a - pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = pC->r * s; - pOut->g = pC->g * s; - pOut->b = pC->b * s; - pOut->a = pC->a * s; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r * pC2->r; - pOut->g = pC1->g * pC2->g; - pOut->b = pC1->b * pC2->b; - pOut->a = pC1->a * pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + s * (pC2->r - pC1->r); - pOut->g = pC1->g + s * (pC2->g - pC1->g); - pOut->b = pC1->b + s * (pC2->b - pC1->b); - pOut->a = pC1->a + s * (pC2->a - pC1->a); - return pOut; -} - - -#endif // __D3DX8MATH_INL__ diff --git a/import/DirectX8/include/d3dx8mesh.h b/import/DirectX8/include/d3dx8mesh.h deleted file mode 100644 index 5408cd312..000000000 --- a/import/DirectX8/include/d3dx8mesh.h +++ /dev/null @@ -1,760 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8mesh.h -// Content: D3DX mesh types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8MESH_H__ -#define __D3DX8MESH_H__ - -#include "dxfile.h" // defines LPDIRECTXFILEDATA - -// {2A835771-BF4D-43f4-8E14-82A809F17D8A} -DEFINE_GUID(IID_ID3DXBaseMesh, -0x2a835771, 0xbf4d, 0x43f4, 0x8e, 0x14, 0x82, 0xa8, 0x9, 0xf1, 0x7d, 0x8a); - -// {CCAE5C3B-4DD1-4d0f-997E-4684CA64557F} -DEFINE_GUID(IID_ID3DXMesh, -0xccae5c3b, 0x4dd1, 0x4d0f, 0x99, 0x7e, 0x46, 0x84, 0xca, 0x64, 0x55, 0x7f); - -// {19FBE386-C282-4659-97BD-CB869B084A6C} -DEFINE_GUID(IID_ID3DXPMesh, -0x19fbe386, 0xc282, 0x4659, 0x97, 0xbd, 0xcb, 0x86, 0x9b, 0x8, 0x4a, 0x6c); - -// {4E3CA05C-D4FF-4d11-8A02-16459E08F6F4} -DEFINE_GUID(IID_ID3DXSPMesh, -0x4e3ca05c, 0xd4ff, 0x4d11, 0x8a, 0x2, 0x16, 0x45, 0x9e, 0x8, 0xf6, 0xf4); - -// {8DB06ECC-EBFC-408a-9404-3074B4773515} -DEFINE_GUID(IID_ID3DXSkinMesh, -0x8db06ecc, 0xebfc, 0x408a, 0x94, 0x4, 0x30, 0x74, 0xb4, 0x77, 0x35, 0x15); - -// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags -enum _D3DXMESH { - D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. - D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB. - D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB. - D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB. - D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB. - D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER - D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB. - D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB. - D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB. - D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB. - D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER - D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB. - D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB. - D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB. - D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB. - - D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer - - D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinMesh::ConvertToBlendedMesh - - // Helper options - D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM - D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED - D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY - D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC - D3DXMESH_SOFTWAREPROCESSING = 0x18000, // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING - -}; - -// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh -enum _D3DXMESHSIMP -{ - D3DXMESHSIMP_VERTEX = 0x1, - D3DXMESHSIMP_FACE = 0x2, - -}; - -enum _MAX_FVF_DECL_SIZE -{ - MAX_FVF_DECL_SIZE = 20 -}; - -typedef struct ID3DXBaseMesh *LPD3DXBASEMESH; -typedef struct ID3DXMesh *LPD3DXMESH; -typedef struct ID3DXPMesh *LPD3DXPMESH; -typedef struct ID3DXSPMesh *LPD3DXSPMESH; -typedef struct ID3DXSkinMesh *LPD3DXSKINMESH; - -typedef struct _D3DXATTRIBUTERANGE -{ - DWORD AttribId; - DWORD FaceStart; - DWORD FaceCount; - DWORD VertexStart; - DWORD VertexCount; -} D3DXATTRIBUTERANGE; - -typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE; - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus -struct D3DXMATERIAL -{ - D3DMATERIAL8 MatD3D; - LPSTR pTextureFilename; -}; -typedef struct D3DXMATERIAL *LPD3DXMATERIAL; -#ifdef __cplusplus -} -#endif //__cplusplus - -typedef struct _D3DXATTRIBUTEWEIGHTS -{ - FLOAT Position; - FLOAT Boundary; - FLOAT Normal; - FLOAT Diffuse; - FLOAT Specular; - FLOAT Tex[8]; -} D3DXATTRIBUTEWEIGHTS; - -typedef D3DXATTRIBUTEWEIGHTS* LPD3DXATTRIBUTEWEIGHTS; - -enum _D3DXWELDEPSILONSFLAGS -{ - D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping - - D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched - // vertices so that both components identical AND if all components "equal" - // remove one of the vertices - D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal - // ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set - // useful to modify vertices to be equal, but not allow vertices to be removed -}; - -typedef struct _D3DXWELDEPSILONS -{ - FLOAT SkinWeights; - FLOAT Normal; - FLOAT Tex[8]; - DWORD Flags; -} D3DXWELDEPSILONS; - -typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS; - - -#undef INTERFACE -#define INTERFACE ID3DXBaseMesh - -DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXMesh - -DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; - - // ID3DXMesh - STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE; - STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; - STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppOptMesh) PURE; - STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE; - -}; - - -#undef INTERFACE -#define INTERFACE ID3DXPMesh - -DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXBaseMesh - STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(GetAttributeTable)( - THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; - - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; - STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; - - // ID3DXPMesh - STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE; - STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE; - STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE; - STDMETHOD(Save)(THIS_ IStream *pStream, LPD3DXMATERIAL pMaterials, DWORD NumMaterials) PURE; - - STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut, - DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppOptMesh) PURE; - - STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE; - STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; - STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; - - STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE; -}; - - -#undef INTERFACE -#define INTERFACE ID3DXSPMesh - -DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXSPMesh - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(CloneMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, - DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ClonePMesh)(THIS_ DWORD Options, - CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE; - STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE; - STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE; - STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; - STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE; - STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE; -}; - -#define UNUSED16 (0xffff) -#define UNUSED32 (0xffffffff) - -// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags -enum _D3DXMESHOPT { - D3DXMESHOPT_COMPACT = 0x01000000, - D3DXMESHOPT_ATTRSORT = 0x02000000, - D3DXMESHOPT_VERTEXCACHE = 0x04000000, - D3DXMESHOPT_STRIPREORDER = 0x08000000, - D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices - D3DXMESHOPT_SHAREVB = 0x1000, // same as D3DXMESH_VB_SHARE -}; - -// Subset of the mesh that has the same attribute and bone combination. -// This subset can be rendered in a single draw call -typedef struct _D3DXBONECOMBINATION -{ - DWORD AttribId; - DWORD FaceStart; - DWORD FaceCount; - DWORD VertexStart; - DWORD VertexCount; - DWORD* BoneId; -} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION; - - -#undef INTERFACE -#define INTERFACE ID3DXSkinMesh - -DECLARE_INTERFACE_(ID3DXSkinMesh, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXMesh - STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; - STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; - STDMETHOD_(DWORD, GetFVF)(THIS) PURE; - STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD_(DWORD, GetOptions)(THIS) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE; - STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE; - STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE; - STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE; - STDMETHOD(UnlockIndexBuffer)(THIS) PURE; - STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE; - STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; - // ID3DXSkinMesh - STDMETHOD_(DWORD, GetNumBones)(THIS) PURE; - STDMETHOD(GetOriginalMesh)(THIS_ LPD3DXMESH* ppMesh) PURE; - STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE; - STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE; - STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE; - STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE; - STDMETHOD(GetMaxFaceInfluences)(THIS_ DWORD* maxFaceInfluences) PURE; - - STDMETHOD(ConvertToBlendedMesh)(THIS_ DWORD Options, - CONST LPDWORD pAdjacencyIn, - LPDWORD pAdjacencyOut, - DWORD* pNumBoneCombinations, - LPD3DXBUFFER* ppBoneCombinationTable, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppMesh) PURE; - - STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ DWORD Options, - CONST LPDWORD pAdjacencyIn, - DWORD paletteSize, - LPDWORD pAdjacencyOut, - DWORD* pNumBoneCombinations, - LPD3DXBUFFER* ppBoneCombinationTable, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppMesh) PURE; - - STDMETHOD(GenerateSkinnedMesh)(THIS_ DWORD Options, - FLOAT minWeight, - CONST LPDWORD pAdjacencyIn, - LPDWORD pAdjacencyOut, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap, - LPD3DXMESH* ppMesh) PURE; - STDMETHOD(UpdateSkinnedMesh)(THIS_ CONST D3DXMATRIX* pBoneTransforms, CONST D3DXMATRIX* pBoneInvTransforms, LPD3DXMESH pMesh) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -HRESULT WINAPI - D3DXCreateMesh( - DWORD NumFaces, - DWORD NumVertices, - DWORD Options, - CONST DWORD *pDeclaration, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXCreateMeshFVF( - DWORD NumFaces, - DWORD NumVertices, - DWORD Options, - DWORD FVF, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXCreateSPMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - LPD3DXSPMESH* ppSMesh); - -// clean a mesh up for simplification, try to make manifold -HRESULT WINAPI - D3DXCleanMesh( - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacencyIn, - LPD3DXMESH* ppMeshOut, - DWORD* pAdjacencyOut, - LPD3DXBUFFER* ppErrorsAndWarnings); - -HRESULT WINAPI - D3DXValidMesh( - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacency, - LPD3DXBUFFER* ppErrorsAndWarnings); - -HRESULT WINAPI - D3DXGeneratePMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - DWORD MinValue, - DWORD Options, - LPD3DXPMESH* ppPMesh); - -HRESULT WINAPI - D3DXSimplifyMesh( - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights, - CONST FLOAT *pVertexWeights, - DWORD MinValue, - DWORD Options, - LPD3DXMESH* ppMesh); - -HRESULT WINAPI - D3DXComputeBoundingSphere( - PVOID pPointsFVF, - DWORD NumVertices, - DWORD FVF, - D3DXVECTOR3 *pCenter, - FLOAT *pRadius); - -HRESULT WINAPI - D3DXComputeBoundingBox( - PVOID pPointsFVF, - DWORD NumVertices, - DWORD FVF, - D3DXVECTOR3 *pMin, - D3DXVECTOR3 *pMax); - -HRESULT WINAPI - D3DXComputeNormals( - LPD3DXBASEMESH pMesh, - CONST DWORD *pAdjacency); - -HRESULT WINAPI - D3DXCreateBuffer( - DWORD NumBytes, - LPD3DXBUFFER *ppBuffer); - - -HRESULT WINAPI - D3DXLoadMeshFromX( - LPSTR pFilename, - DWORD Options, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXLoadMeshFromXInMemory( - PBYTE Memory, - DWORD SizeOfMemory, - DWORD Options, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXLoadMeshFromXResource( - HMODULE Module, - LPCTSTR Name, - LPCTSTR Type, - DWORD Options, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXSaveMeshToX( - LPSTR pFilename, - LPD3DXMESH pMesh, - CONST DWORD* pAdjacency, - CONST LPD3DXMATERIAL pMaterials, - DWORD NumMaterials, - DWORD Format - ); - -HRESULT WINAPI - D3DXCreatePMeshFromStream( - IStream *pStream, - DWORD Options, - LPDIRECT3DDEVICE8 pD3DDevice, - LPD3DXBUFFER *ppMaterials, - DWORD* pNumMaterials, - LPD3DXPMESH *ppPMesh); - -HRESULT WINAPI - D3DXCreateSkinMesh( - DWORD NumFaces, - DWORD NumVertices, - DWORD NumBones, - DWORD Options, - CONST DWORD *pDeclaration, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXSKINMESH* ppSkinMesh); - -HRESULT WINAPI - D3DXCreateSkinMeshFVF( - DWORD NumFaces, - DWORD NumVertices, - DWORD NumBones, - DWORD Options, - DWORD FVF, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXSKINMESH* ppSkinMesh); - -HRESULT WINAPI - D3DXCreateSkinMeshFromMesh( - LPD3DXMESH pMesh, - DWORD numBones, - LPD3DXSKINMESH* ppSkinMesh); - -HRESULT WINAPI - D3DXLoadMeshFromXof( - LPDIRECTXFILEDATA pXofObjMesh, - DWORD Options, - LPDIRECT3DDEVICE8 pD3DDevice, - LPD3DXBUFFER *ppAdjacency, - LPD3DXBUFFER *ppMaterials, - DWORD *pNumMaterials, - LPD3DXMESH *ppMesh); - -HRESULT WINAPI - D3DXLoadSkinMeshFromXof( - LPDIRECTXFILEDATA pxofobjMesh, - DWORD Options, - LPDIRECT3DDEVICE8 pD3D, - LPD3DXBUFFER* ppAdjacency, - LPD3DXBUFFER* ppMaterials, - DWORD *pMatOut, - LPD3DXBUFFER* ppBoneNames, - LPD3DXBUFFER* ppBoneTransforms, - LPD3DXSKINMESH* ppMesh); - -HRESULT WINAPI - D3DXTessellateNPatches( - LPD3DXMESH pMeshIn, - CONST DWORD* pAdjacencyIn, - FLOAT NumSegs, - BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic - LPD3DXMESH *ppMeshOut, - LPD3DXBUFFER *ppAdjacencyOut); - -UINT WINAPI - D3DXGetFVFVertexSize(DWORD FVF); - -HRESULT WINAPI - D3DXDeclaratorFromFVF( - DWORD FVF, - DWORD Declaration[MAX_FVF_DECL_SIZE]); - -HRESULT WINAPI - D3DXFVFFromDeclarator( - CONST DWORD *pDeclarator, - DWORD *pFVF); - -HRESULT WINAPI - D3DXWeldVertices( - CONST LPD3DXMESH pMesh, - LPD3DXWELDEPSILONS pEpsilons, - CONST DWORD *pAdjacencyIn, - DWORD *pAdjacencyOut, - DWORD* pFaceRemap, - LPD3DXBUFFER *ppVertexRemap); - -typedef struct _D3DXINTERSECTINFO -{ - DWORD FaceIndex; // index of face intersected - FLOAT U; // Barycentric Hit Coordinates - FLOAT V; // Barycentric Hit Coordinates - FLOAT Dist; // Ray-Intersection Parameter Distance -} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO; - - -HRESULT WINAPI - D3DXIntersect( - LPD3DXBASEMESH pMesh, - CONST D3DXVECTOR3 *pRayPos, - CONST D3DXVECTOR3 *pRayDir, - BOOL *pHit, // True if any faces were intersected - DWORD *pFaceIndex, // index of closest face intersected - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist, // Ray-Intersection Parameter Distance - LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) - DWORD *pCountOfHits); // Number of entries in AllHits array - -HRESULT WINAPI - D3DXIntersectSubset( - LPD3DXBASEMESH pMesh, - DWORD AttribId, - CONST D3DXVECTOR3 *pRayPos, - CONST D3DXVECTOR3 *pRayDir, - BOOL *pHit, // True if any faces were intersected - DWORD *pFaceIndex, // index of closest face intersected - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist, // Ray-Intersection Parameter Distance - LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) - DWORD *pCountOfHits); // Number of entries in AllHits array - - -HRESULT WINAPI D3DXSplitMesh - ( - CONST LPD3DXMESH pMeshIn, - CONST DWORD *pAdjacencyIn, - CONST DWORD MaxSize, - CONST DWORD Options, - DWORD *pMeshesOut, - LPD3DXBUFFER *ppMeshArrayOut, - LPD3DXBUFFER *ppAdjacencyArrayOut, - LPD3DXBUFFER *ppFaceRemapArrayOut, - LPD3DXBUFFER *ppVertRemapArrayOut - ); - -BOOL D3DXIntersectTri -( - CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position - CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position - CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position - CONST D3DXVECTOR3 *pRayPos, // Ray origin - CONST D3DXVECTOR3 *pRayDir, // Ray direction - FLOAT *pU, // Barycentric Hit Coordinates - FLOAT *pV, // Barycentric Hit Coordinates - FLOAT *pDist); // Ray-Intersection Parameter Distance - -BOOL WINAPI - D3DXSphereBoundProbe( - CONST D3DXVECTOR3 *pCenter, - FLOAT Radius, - CONST D3DXVECTOR3 *pRayPosition, - CONST D3DXVECTOR3 *pRayDirection); - -BOOL WINAPI - D3DXBoxBoundProbe( - CONST D3DXVECTOR3 *pMin, - CONST D3DXVECTOR3 *pMax, - CONST D3DXVECTOR3 *pRayPosition, - CONST D3DXVECTOR3 *pRayDirection); - -enum _D3DXERR { - D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), - D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), - D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), - D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), - D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), - D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), - D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), -}; - - -#define D3DX_COMP_TANGENT_NONE 0xFFFFFFFF - -HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH InMesh, - DWORD TexStage, - LPD3DXMESH OutMesh, - DWORD TexStageUVec, - DWORD TexStageVVec, - DWORD Wrap, - DWORD *Adjacency); - -HRESULT WINAPI -D3DXConvertMeshSubsetToSingleStrip -( - LPD3DXBASEMESH MeshIn, - DWORD AttribId, - DWORD IBOptions, - LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer, - DWORD *pNumIndices -); - -HRESULT WINAPI -D3DXConvertMeshSubsetToStrips -( - LPD3DXBASEMESH MeshIn, - DWORD AttribId, - DWORD IBOptions, - LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer, - DWORD *pNumIndices, - LPD3DXBUFFER *ppStripLengths, - DWORD *pNumStrips -); - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX8MESH_H__ - - diff --git a/import/DirectX8/include/d3dx8shape.h b/import/DirectX8/include/d3dx8shape.h deleted file mode 100644 index b7ab63781..000000000 --- a/import/DirectX8/include/d3dx8shape.h +++ /dev/null @@ -1,220 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8shapes.h -// Content: D3DX simple shapes -// -/////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8SHAPES_H__ -#define __D3DX8SHAPES_H__ - -/////////////////////////////////////////////////////////////////////////// -// Functions: -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//------------------------------------------------------------------------- -// D3DXCreatePolygon: -// ------------------ -// Creates a mesh containing an n-sided polygon. The polygon is centered -// at the origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Length Length of each side. -// Sides Number of sides the polygon has. (Must be >= 3) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreatePolygon( - LPDIRECT3DDEVICE8 pDevice, - FLOAT Length, - UINT Sides, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateBox: -// -------------- -// Creates a mesh containing an axis-aligned box. The box is centered at -// the origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Width Width of box (along X-axis) -// Height Height of box (along Y-axis) -// Depth Depth of box (along Z-axis) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateBox( - LPDIRECT3DDEVICE8 pDevice, - FLOAT Width, - FLOAT Height, - FLOAT Depth, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateCylinder: -// ------------------- -// Creates a mesh containing a cylinder. The generated cylinder is -// centered at the origin, and its axis is aligned with the Z-axis. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Radius1 Radius at -Z end (should be >= 0.0f) -// Radius2 Radius at +Z end (should be >= 0.0f) -// Length Length of cylinder (along Z-axis) -// Slices Number of slices about the main axis -// Stacks Number of stacks along the main axis -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateCylinder( - LPDIRECT3DDEVICE8 pDevice, - FLOAT Radius1, - FLOAT Radius2, - FLOAT Length, - UINT Slices, - UINT Stacks, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateSphere: -// ----------------- -// Creates a mesh containing a sphere. The sphere is centered at the -// origin. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// Radius Radius of the sphere (should be >= 0.0f) -// Slices Number of slices about the main axis -// Stacks Number of stacks along the main axis -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateSphere( - LPDIRECT3DDEVICE8 pDevice, - FLOAT Radius, - UINT Slices, - UINT Stacks, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateTorus: -// ---------------- -// Creates a mesh containing a torus. The generated torus is centered at -// the origin, and its axis is aligned with the Z-axis. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// InnerRadius Inner radius of the torus (should be >= 0.0f) -// OuterRadius Outer radius of the torue (should be >= 0.0f) -// Sides Number of sides in a cross-section (must be >= 3) -// Rings Number of rings making up the torus (must be >= 3) -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTorus( - LPDIRECT3DDEVICE8 pDevice, - FLOAT InnerRadius, - FLOAT OuterRadius, - UINT Sides, - UINT Rings, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateTeapot: -// ----------------- -// Creates a mesh containing a teapot. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// ppMesh The mesh object which will be created -// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTeapot( - LPDIRECT3DDEVICE8 pDevice, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency); - - -//------------------------------------------------------------------------- -// D3DXCreateText: -// --------------- -// Creates a mesh containing the specified text using the font associated -// with the device context. -// -// Parameters: -// -// pDevice The D3D device with which the mesh is going to be used. -// hDC Device context, with desired font selected -// pText Text to generate -// Deviation Maximum chordal deviation from true font outlines -// Extrusion Amount to extrude text in -Z direction -// ppMesh The mesh object which will be created -// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL) -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTextA( - LPDIRECT3DDEVICE8 pDevice, - HDC hDC, - LPCSTR pText, - FLOAT Deviation, - FLOAT Extrusion, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency, - LPGLYPHMETRICSFLOAT pGlyphMetrics); - -HRESULT WINAPI - D3DXCreateTextW( - LPDIRECT3DDEVICE8 pDevice, - HDC hDC, - LPCWSTR pText, - FLOAT Deviation, - FLOAT Extrusion, - LPD3DXMESH* ppMesh, - LPD3DXBUFFER* ppAdjacency, - LPGLYPHMETRICSFLOAT pGlyphMetrics); - -#ifdef UNICODE -#define D3DXCreateText D3DXCreateTextW -#else -#define D3DXCreateText D3DXCreateTextA -#endif - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX8SHAPES_H__ diff --git a/import/DirectX8/include/d3dx8tex.h b/import/DirectX8/include/d3dx8tex.h deleted file mode 100644 index dd9fe9d0e..000000000 --- a/import/DirectX8/include/d3dx8tex.h +++ /dev/null @@ -1,1592 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx8tex.h -// Content: D3DX texturing APIs -// -////////////////////////////////////////////////////////////////////////////// - -#include "d3dx8.h" - -#ifndef __D3DX8TEX_H__ -#define __D3DX8TEX_H__ - - -//---------------------------------------------------------------------------- -// D3DX_FILTER flags: -// ------------------ -// -// A valid filter must contain one of these values: -// -// D3DX_FILTER_NONE -// No scaling or filtering will take place. Pixels outside the bounds -// of the source image are assumed to be transparent black. -// D3DX_FILTER_POINT -// Each destination pixel is computed by sampling the nearest pixel -// from the source image. -// D3DX_FILTER_LINEAR -// Each destination pixel is computed by linearly interpolating between -// the nearest pixels in the source image. This filter works best -// when the scale on each axis is less than 2. -// D3DX_FILTER_TRIANGLE -// Every pixel in the source image contributes equally to the -// destination image. This is the slowest of all the filters. -// D3DX_FILTER_BOX -// Each pixel is computed by averaging a 2x2(x2) box pixels from -// the source image. Only works when the dimensions of the -// destination are half those of the source. (as with mip maps) -// -// And can be OR'd with any of these optional flags: -// -// D3DX_FILTER_MIRROR_U -// Indicates that pixels off the edge of the texture on the U-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR_V -// Indicates that pixels off the edge of the texture on the V-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR_W -// Indicates that pixels off the edge of the texture on the W-axis -// should be mirrored, not wraped. -// D3DX_FILTER_MIRROR -// Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V | -// D3DX_FILTER_MIRROR_V -// D3DX_FILTER_DITHER -// Dithers the resulting image. -// -//---------------------------------------------------------------------------- - -#define D3DX_FILTER_NONE (1 << 0) -#define D3DX_FILTER_POINT (2 << 0) -#define D3DX_FILTER_LINEAR (3 << 0) -#define D3DX_FILTER_TRIANGLE (4 << 0) -#define D3DX_FILTER_BOX (5 << 0) - -#define D3DX_FILTER_MIRROR_U (1 << 16) -#define D3DX_FILTER_MIRROR_V (2 << 16) -#define D3DX_FILTER_MIRROR_W (4 << 16) -#define D3DX_FILTER_MIRROR (7 << 16) -#define D3DX_FILTER_DITHER (8 << 16) - - -//---------------------------------------------------------------------------- -// D3DX_NORMALMAP flags: -// --------------------- -// These flags are used to control how D3DXComputeNormalMap generates normal -// maps. Any number of these flags may be OR'd together in any combination. -// -// D3DX_NORMALMAP_MIRROR_U -// Indicates that pixels off the edge of the texture on the U-axis -// should be mirrored, not wraped. -// D3DX_NORMALMAP_MIRROR_V -// Indicates that pixels off the edge of the texture on the V-axis -// should be mirrored, not wraped. -// D3DX_NORMALMAP_MIRROR -// Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V -// D3DX_NORMALMAP_INVERTSIGN -// Inverts the direction of each normal -// D3DX_NORMALMAP_COMPUTE_OCCLUSION -// Compute the per pixel Occlusion term and encodes it into the alpha. -// An Alpha of 1 means that the pixel is not obscured in anyway, and -// an alpha of 0 would mean that the pixel is completly obscured. -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -#define D3DX_NORMALMAP_MIRROR_U (1 << 16) -#define D3DX_NORMALMAP_MIRROR_V (2 << 16) -#define D3DX_NORMALMAP_MIRROR (3 << 16) -#define D3DX_NORMALMAP_INVERTSIGN (8 << 16) -#define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16) - - - - -//---------------------------------------------------------------------------- -// D3DX_CHANNEL flags: -// ------------------- -// These flags are used by functions which operate on or more channels -// in a texture. -// -// D3DX_CHANNEL_RED -// Indicates the red channel should be used -// D3DX_CHANNEL_BLUE -// Indicates the blue channel should be used -// D3DX_CHANNEL_GREEN -// Indicates the green channel should be used -// D3DX_CHANNEL_ALPHA -// Indicates the alpha channel should be used -// D3DX_CHANNEL_LUMINANCE -// Indicates the luminaces of the red green and blue channels should be -// used. -// -//---------------------------------------------------------------------------- - -#define D3DX_CHANNEL_RED (1 << 0) -#define D3DX_CHANNEL_BLUE (1 << 1) -#define D3DX_CHANNEL_GREEN (1 << 2) -#define D3DX_CHANNEL_ALPHA (1 << 3) -#define D3DX_CHANNEL_LUMINANCE (1 << 4) - - - - -//---------------------------------------------------------------------------- -// D3DXIMAGE_FILEFORMAT: -// --------------------- -// This enum is used to describe supported image file formats. -// -//---------------------------------------------------------------------------- - -typedef enum _D3DXIMAGE_FILEFORMAT -{ - D3DXIFF_BMP = 0, - D3DXIFF_JPG = 1, - D3DXIFF_TGA = 2, - D3DXIFF_PNG = 3, - D3DXIFF_DDS = 4, - D3DXIFF_PPM = 5, - D3DXIFF_DIB = 6, - D3DXIFF_FORCE_DWORD = 0x7fffffff - -} D3DXIMAGE_FILEFORMAT; - - -//---------------------------------------------------------------------------- -// LPD3DXFILL2D and LPD3DXFILL3D: -// ------------------------------ -// Function types used by the texture fill functions. -// -// Parameters: -// pOut -// Pointer to a vector which the function uses to return its result. -// X,Y,Z,W will be mapped to R,G,B,A respectivly. -// pTexCoord -// Pointer to a vector containing the coordinates of the texel currently -// being evaluated. Textures and VolumeTexture texcoord components -// range from 0 to 1. CubeTexture texcoord component range from -1 to 1. -// pTexelSize -// Pointer to a vector containing the dimensions of the current texel. -// pData -// Pointer to user data. -// -//---------------------------------------------------------------------------- - -typedef VOID (*LPD3DXFILL2D)(D3DXVECTOR4 *pOut, D3DXVECTOR2 *pTexCoord, D3DXVECTOR2 *pTexelSize, LPVOID pData); -typedef VOID (*LPD3DXFILL3D)(D3DXVECTOR4 *pOut, D3DXVECTOR3 *pTexCoord, D3DXVECTOR3 *pTexelSize, LPVOID pData); - - - -//---------------------------------------------------------------------------- -// D3DXIMAGE_INFO: -// --------------- -// This structure is used to return a rough description of what the -// the original contents of an image file looked like. -// -// Width -// Width of original image in pixels -// Height -// Height of original image in pixels -// Depth -// Depth of original image in pixels -// MipLevels -// Number of mip levels in original image -// Format -// D3D format which most closely describes the data in original image -// ResourceType -// D3DRESOURCETYPE representing the type of texture stored in the file. -// D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE. -// ImageFileFormat -// D3DXIMAGE_FILEFORMAT representing the format of the image file. -// -//---------------------------------------------------------------------------- - -typedef struct _D3DXIMAGE_INFO -{ - UINT Width; - UINT Height; - UINT Depth; - UINT MipLevels; - D3DFORMAT Format; - D3DRESOURCETYPE ResourceType; - D3DXIMAGE_FILEFORMAT ImageFileFormat; - -} D3DXIMAGE_INFO; - - - - - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - - -////////////////////////////////////////////////////////////////////////////// -// Image File APIs /////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -; -//---------------------------------------------------------------------------- -// GetImageInfoFromFile/Resource: -// ------------------------------ -// Fills in a D3DXIMAGE_INFO struct with information about an image file. -// -// Parameters: -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXGetImageInfoFromFileA( - LPCSTR pSrcFile, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXGetImageInfoFromFileW( - LPCWSTR pSrcFile, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW -#else -#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA -#endif - - -HRESULT WINAPI - D3DXGetImageInfoFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXGetImageInfoFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW -#else -#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA -#endif - - -HRESULT WINAPI - D3DXGetImageInfoFromFileInMemory( - LPCVOID pSrcData, - UINT SrcDataSize, - D3DXIMAGE_INFO* pSrcInfo); - - - - -////////////////////////////////////////////////////////////////////////////// -// Load/Save Surface APIs //////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromFile/Resource: -// --------------------------------- -// Load surface from a file or resource -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcRect -// Source rectangle, or NULL for entire image -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromFileA( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCSTR pSrcFile, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadSurfaceFromFileW( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCWSTR pSrcFile, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW -#else -#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA -#endif - - - -HRESULT WINAPI - D3DXLoadSurfaceFromResourceA( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadSurfaceFromResourceW( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - -#ifdef UNICODE -#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW -#else -#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA -#endif - - - -HRESULT WINAPI - D3DXLoadSurfaceFromFileInMemory( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCVOID pSrcData, - UINT SrcDataSize, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromSurface: -// --------------------------- -// Load surface from another surface (with color conversion) -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcSurface -// Source surface -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle, or NULL for entire surface -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromSurface( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPDIRECT3DSURFACE8 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey); - - -//---------------------------------------------------------------------------- -// D3DXLoadSurfaceFromMemory: -// -------------------------- -// Load surface from memory. -// -// Parameters: -// pDestSurface -// Destination surface, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestRect -// Destination rectangle, or NULL for entire surface -// pSrcMemory -// Pointer to the top-left corner of the source image in memory -// SrcFormat -// Pixel format of the source image. -// SrcPitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the width of one row of cells, in bytes. -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle. -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadSurfaceFromMemory( - LPDIRECT3DSURFACE8 pDestSurface, - CONST PALETTEENTRY* pDestPalette, - CONST RECT* pDestRect, - LPCVOID pSrcMemory, - D3DFORMAT SrcFormat, - UINT SrcPitch, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect, - DWORD Filter, - D3DCOLOR ColorKey); - - -//---------------------------------------------------------------------------- -// D3DXSaveSurfaceToFile: -// ---------------------- -// Save a surface to a image file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcSurface -// Source surface, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcRect -// Source rectangle, or NULL for the entire image -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveSurfaceToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE8 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect); - -HRESULT WINAPI - D3DXSaveSurfaceToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DSURFACE8 pSrcSurface, - CONST PALETTEENTRY* pSrcPalette, - CONST RECT* pSrcRect); - -#ifdef UNICODE -#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW -#else -#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA -#endif - - - - -////////////////////////////////////////////////////////////////////////////// -// Load/Save Volume APIs ///////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromFile/Resource: -// -------------------------------- -// Load volume from a file or resource -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcFile -// File name of the source image. -// pSrcModule -// Module where resource is located, or NULL for module associated -// with image the os used to create the current process. -// pSrcResource -// Resource name -// pSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// pSrcBox -// Source box, or NULL for entire image -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromFileA( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCSTR pSrcFile, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadVolumeFromFileW( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCWSTR pSrcFile, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW -#else -#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA -#endif - - -HRESULT WINAPI - D3DXLoadVolumeFromResourceA( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -HRESULT WINAPI - D3DXLoadVolumeFromResourceW( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - -#ifdef UNICODE -#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW -#else -#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA -#endif - - - -HRESULT WINAPI - D3DXLoadVolumeFromFileInMemory( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCVOID pSrcData, - UINT SrcDataSize, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo); - - - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromVolume: -// ------------------------- -// Load volume from another volume (with color conversion) -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcVolume -// Source volume -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box, or NULL for entire volume -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromVolume( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPDIRECT3DVOLUME8 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey); - - - -//---------------------------------------------------------------------------- -// D3DXLoadVolumeFromMemory: -// ------------------------- -// Load volume from memory. -// -// Parameters: -// pDestVolume -// Destination volume, which will receive the image. -// pDestPalette -// Destination palette of 256 colors, or NULL -// pDestBox -// Destination box, or NULL for entire volume -// pSrcMemory -// Pointer to the top-left corner of the source volume in memory -// SrcFormat -// Pixel format of the source volume. -// SrcRowPitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the size of one row of cells, in bytes. -// SrcSlicePitch -// Pitch of source image, in bytes. For DXT formats, this number -// should represent the size of one slice of cells, in bytes. -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box. -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXLoadVolumeFromMemory( - LPDIRECT3DVOLUME8 pDestVolume, - CONST PALETTEENTRY* pDestPalette, - CONST D3DBOX* pDestBox, - LPCVOID pSrcMemory, - D3DFORMAT SrcFormat, - UINT SrcRowPitch, - UINT SrcSlicePitch, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox, - DWORD Filter, - D3DCOLOR ColorKey); - - - -//---------------------------------------------------------------------------- -// D3DXSaveVolumeToFile: -// --------------------- -// Save a volume to a image file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcVolume -// Source volume, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// pSrcBox -// Source box, or NULL for the entire volume -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXSaveVolumeToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DVOLUME8 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox); - -HRESULT WINAPI - D3DXSaveVolumeToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DVOLUME8 pSrcVolume, - CONST PALETTEENTRY* pSrcPalette, - CONST D3DBOX* pSrcBox); - -#ifdef UNICODE -#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW -#else -#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA -#endif - - - - -////////////////////////////////////////////////////////////////////////////// -// Create/Save Texture APIs ////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXCheckTextureRequirements: -// ----------------------------- -// Checks texture creation parameters. If parameters are invalid, this -// function returns corrected parameters. -// -// Parameters: -// -// pDevice -// The D3D device to be used -// pWidth, pHeight, pDepth, pSize -// Desired size in pixels, or NULL. Returns corrected size. -// pNumMipLevels -// Number of desired mipmap levels, or NULL. Returns corrected number. -// Usage -// Texture usage flags -// pFormat -// Desired pixel format, or NULL. Returns corrected format. -// Pool -// Memory pool to be used to create texture -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCheckTextureRequirements( - LPDIRECT3DDEVICE8 pDevice, - UINT* pWidth, - UINT* pHeight, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - -HRESULT WINAPI - D3DXCheckCubeTextureRequirements( - LPDIRECT3DDEVICE8 pDevice, - UINT* pSize, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - -HRESULT WINAPI - D3DXCheckVolumeTextureRequirements( - LPDIRECT3DDEVICE8 pDevice, - UINT* pWidth, - UINT* pHeight, - UINT* pDepth, - UINT* pNumMipLevels, - DWORD Usage, - D3DFORMAT* pFormat, - D3DPOOL Pool); - - -//---------------------------------------------------------------------------- -// D3DXCreateTexture: -// ------------------ -// Create an empty texture -// -// Parameters: -// -// pDevice -// The D3D device with which the texture is going to be used. -// Width, Height, Depth, Size -// size in pixels; these must be non-zero -// MipLevels -// number of mip levels desired; if zero or D3DX_DEFAULT, a complete -// mipmap chain will be created. -// Usage -// Texture usage flags -// Format -// Pixel format. -// Pool -// Memory pool to be used to create texture -// ppTexture, ppCubeTexture, ppVolumeTexture -// The texture object that will be created -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateTexture( - LPDIRECT3DDEVICE8 pDevice, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTexture( - LPDIRECT3DDEVICE8 pDevice, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTexture( - LPDIRECT3DDEVICE8 pDevice, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - - - -//---------------------------------------------------------------------------- -// D3DXCreateTextureFromFile/Resource: -// ----------------------------------- -// Create a texture object from a file or resource. -// -// Parameters: -// -// pDevice -// The D3D device with which the texture is going to be used. -// pSrcFile -// File name. -// hSrcModule -// Module handle. if NULL, current module will be used. -// pSrcResource -// Resource name in module -// pvSrcData -// Pointer to file in memory. -// SrcDataSize -// Size in bytes of file in memory. -// Width, Height, Depth, Size -// Size in pixels; if zero or D3DX_DEFAULT, the size will be taken -// from the file. -// MipLevels -// Number of mip levels; if zero or D3DX_DEFAULT, a complete mipmap -// chain will be created. -// Usage -// Texture usage flags -// Format -// Desired pixel format. If D3DFMT_UNKNOWN, the format will be -// taken from the file. -// Pool -// Memory pool to be used to create texture -// Filter -// D3DX_FILTER flags controlling how the image is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. -// MipFilter -// D3DX_FILTER flags controlling how each miplevel is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_BOX, -// ColorKey -// Color to replace with transparent black, or 0 to disable colorkey. -// This is always a 32-bit ARGB color, independent of the source image -// format. Alpha is significant, and should usually be set to FF for -// opaque colorkeys. (ex. Opaque black == 0xff000000) -// pSrcInfo -// Pointer to a D3DXIMAGE_INFO structure to be filled in with the -// description of the data in the source image file, or NULL. -// pPalette -// 256 color palette to be filled in, or NULL -// ppTexture, ppCubeTexture, ppVolumeTexture -// The texture object that will be created -// -//---------------------------------------------------------------------------- - - -// FromFile - -HRESULT WINAPI - D3DXCreateTextureFromFileA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromFileW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DTEXTURE8* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW -#else -#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW -#else -#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW -#else -#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA -#endif - - -// FromResource - -HRESULT WINAPI - D3DXCreateTextureFromResourceA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromResourceW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DTEXTURE8* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW -#else -#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW -#else -#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW -#else -#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA -#endif - - -// FromFileEx - -HRESULT WINAPI - D3DXCreateTextureFromFileExA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromFileExW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE8* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW -#else -#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileExA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileExW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW -#else -#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileExA( - LPDIRECT3DDEVICE8 pDevice, - LPCSTR pSrcFile, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileExW( - LPDIRECT3DDEVICE8 pDevice, - LPCWSTR pSrcFile, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW -#else -#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA -#endif - - -// FromResourceEx - -HRESULT WINAPI - D3DXCreateTextureFromResourceExA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateTextureFromResourceExW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE8* ppTexture); - -#ifdef UNICODE -#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW -#else -#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA -#endif - - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceExA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromResourceExW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -#ifdef UNICODE -#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW -#else -#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA -#endif - - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceExA( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCSTR pSrcResource, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromResourceExW( - LPDIRECT3DDEVICE8 pDevice, - HMODULE hSrcModule, - LPCWSTR pSrcResource, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - -#ifdef UNICODE -#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW -#else -#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA -#endif - - -// FromFileInMemory - -HRESULT WINAPI - D3DXCreateTextureFromFileInMemory( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileInMemory( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileInMemory( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - - -// FromFileInMemoryEx - -HRESULT WINAPI - D3DXCreateTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Width, - UINT Height, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DTEXTURE8* ppTexture); - -HRESULT WINAPI - D3DXCreateCubeTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Size, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DCUBETEXTURE8* ppCubeTexture); - -HRESULT WINAPI - D3DXCreateVolumeTextureFromFileInMemoryEx( - LPDIRECT3DDEVICE8 pDevice, - LPCVOID pSrcData, - UINT SrcDataSize, - UINT Width, - UINT Height, - UINT Depth, - UINT MipLevels, - DWORD Usage, - D3DFORMAT Format, - D3DPOOL Pool, - DWORD Filter, - DWORD MipFilter, - D3DCOLOR ColorKey, - D3DXIMAGE_INFO* pSrcInfo, - PALETTEENTRY* pPalette, - LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture); - - - -//---------------------------------------------------------------------------- -// D3DXSaveTextureToFile: -// ---------------------- -// Save a texture to a file. -// -// Parameters: -// pDestFile -// File name of the destination file -// DestFormat -// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. -// pSrcTexture -// Source texture, containing the image to be saved -// pSrcPalette -// Source palette of 256 colors, or NULL -// -//---------------------------------------------------------------------------- - - -HRESULT WINAPI - D3DXSaveTextureToFileA( - LPCSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DBASETEXTURE8 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette); - -HRESULT WINAPI - D3DXSaveTextureToFileW( - LPCWSTR pDestFile, - D3DXIMAGE_FILEFORMAT DestFormat, - LPDIRECT3DBASETEXTURE8 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette); - -#ifdef UNICODE -#define D3DXSaveTextureToFile D3DXSaveTextureToFileW -#else -#define D3DXSaveTextureToFile D3DXSaveTextureToFileA -#endif - - - - -////////////////////////////////////////////////////////////////////////////// -// Misc Texture APIs ///////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// D3DXFilterTexture: -// ------------------ -// Filters mipmaps levels of a texture. -// -// Parameters: -// pBaseTexture -// The texture object to be filtered -// pPalette -// 256 color palette to be used, or NULL for non-palettized formats -// SrcLevel -// The level whose image is used to generate the subsequent levels. -// Filter -// D3DX_FILTER flags controlling how each miplevel is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_BOX, -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFilterTexture( - LPDIRECT3DBASETEXTURE8 pBaseTexture, - CONST PALETTEENTRY* pPalette, - UINT SrcLevel, - DWORD Filter); - -#define D3DXFilterCubeTexture D3DXFilterTexture -#define D3DXFilterVolumeTexture D3DXFilterTexture - - - -//---------------------------------------------------------------------------- -// D3DXFillTexture: -// ---------------- -// Uses a user provided function to fill each texel of each mip level of a -// given texture. -// -// Paramters: -// pTexture, pCubeTexture, pVolumeTexture -// Pointer to the texture to be filled. -// pFunction -// Pointer to user provided evalutor function which will be used to -// compute the value of each texel. -// pData -// Pointer to an arbitrary block of user defined data. This pointer -// will be passed to the function provided in pFunction -//----------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXFillTexture( - LPDIRECT3DTEXTURE8 pTexture, - LPD3DXFILL2D pFunction, - LPVOID pData); - -HRESULT WINAPI - D3DXFillCubeTexture( - LPDIRECT3DCUBETEXTURE8 pCubeTexture, - LPD3DXFILL3D pFunction, - LPVOID pData); - -HRESULT WINAPI - D3DXFillVolumeTexture( - LPDIRECT3DVOLUMETEXTURE8 pVolumeTexture, - LPD3DXFILL3D pFunction, - LPVOID pData); - - - -//---------------------------------------------------------------------------- -// D3DXComputeNormalMap: -// --------------------- -// Converts a height map into a normal map. The (x,y,z) components of each -// normal are mapped to the (r,g,b) channels of the output texture. -// -// Parameters -// pTexture -// Pointer to the destination texture -// pSrcTexture -// Pointer to the source heightmap texture -// pSrcPalette -// Source palette of 256 colors, or NULL -// Flags -// D3DX_NORMALMAP flags -// Channel -// D3DX_CHANNEL specifying source of height information -// Amplitude -// The constant value which the height information is multiplied by. -//--------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXComputeNormalMap( - LPDIRECT3DTEXTURE8 pTexture, - LPDIRECT3DTEXTURE8 pSrcTexture, - CONST PALETTEENTRY* pSrcPalette, - DWORD Flags, - DWORD Channel, - FLOAT Amplitude); - - - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3DX8TEX_H__ diff --git a/import/DirectX8/include/d3dxcore.h b/import/DirectX8/include/d3dxcore.h deleted file mode 100644 index da1e9893f..000000000 --- a/import/DirectX8/include/d3dxcore.h +++ /dev/null @@ -1,1027 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dxcore.h -// Content: D3DX core types and functions -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DXCORE_H__ -#define __D3DXCORE_H__ - -#include -#include -#include "d3dxerr.h" - - -typedef struct ID3DXContext *LPD3DXCONTEXT; - -// {9B74ED7A-BBEF-11d2-9F8E-0000F8080835} -DEFINE_GUID(IID_ID3DXContext, - 0x9b74ed7a, 0xbbef, 0x11d2, 0x9f, 0x8e, 0x0, 0x0, 0xf8, 0x8, 0x8, 0x35); - - -/////////////////////////////////////////////////////////////////////////// -// Defines and Enumerators used below: -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// D3DX_DEFAULT: -// --------- -// A predefined value that could be used for any parameter in D3DX APIs or -// member functions that is an enumerant or a handle. The D3DX -// documentation indicates wherever D3DX_DEFAULT may be used, -// and how it will be interpreted in each situation. -//------------------------------------------------------------------------- -#define D3DX_DEFAULT ULONG_MAX - -//------------------------------------------------------------------------- -// D3DX_DEFAULT_FLOAT: -// ------------------ -// Similar to D3DX_DEFAULT, but used for floating point parameters. -// The D3DX documentation indicates wherever D3DX_DEFAULT_FLOAT may be used, -// and how it will be interpreted in each situation. -//------------------------------------------------------------------------- -#define D3DX_DEFAULT_FLOAT FLT_MAX - -//------------------------------------------------------------------------- -// Hardware Acceleration Level: -// --------------------------- -// These constants represent pre-defined hardware acceleration levels, -// and may be used as a default anywhere a (DWORD) deviceIndex is required. -// Each pre-define indicates a different level of hardware acceleration. -// They are an alternative to using explicit deviceIndices retrieved by -// D3DXGetDeviceDescription(). -// -// The only case these pre-defines should be used as device indices is if -// a particular level of acceleration is required, and given more than -// one capable device on the computer, it does not matter which one -// is used. -// -// The method of selection is as follows: If one of the D3DX devices on -// the primary DDraw device supports a requested hardware acceleration -// level, it will be used. Otherwise, the first matching device discovered -// by D3DX will be used. -// -// Of course, it is possible for no match to exist for any of the -// pre-defines on a particular computer. Passing such a value into the -// D3DX apis will simply cause them to fail, reporting that no match -// is available. -// -// D3DX_HWLEVEL_NULL: Null implementation (draws nothing) -// D3DX_HWLEVEL_REFERENCE: Reference implementation (slowest) -// D3DX_HWLEVEL_2D: 2D acceleration only (RGB rasterizer used) -// D3DX_HWLEVEL_RASTER: Rasterization acceleration (likely most useful) -// D3DX_HWLEVEL_TL: Transform and lighting acceleration -// D3DX_DEFAULT: The highest level of acceleration available -// on the primary DDraw device. -//------------------------------------------------------------------------- -#define D3DX_HWLEVEL_NULL (D3DX_DEFAULT - 1) -#define D3DX_HWLEVEL_REFERENCE (D3DX_DEFAULT - 2) -#define D3DX_HWLEVEL_2D (D3DX_DEFAULT - 3) -#define D3DX_HWLEVEL_RASTER (D3DX_DEFAULT - 4) -#define D3DX_HWLEVEL_TL (D3DX_DEFAULT - 5) - -//------------------------------------------------------------------------- -// Surface Class: -// ------------- -// These are the various types of 2D-surfaces classified according to their -// usage. Note that a number of them overlap. e.g. STENCILBUFFERS and -// DEPTHBUFFERS overlap (since in DX7 implementation the stencil and depth -// bits are part of the same pixel format). -// -// Mapping to the DX7 DDPIXELFORMAT concepts: -// ----------------------------------------- -// D3DX_SC_DEPTHBUFFER: All ddpfs which have the DDPF_ZPIXELS or the -// DDPF_ZBUFFER flags set. -// D3DX_SC_STENCILBUFFER: All ddpfs which have the DDPF_STENCILBUFFER -// flag set. -// D3DX_SC_BUMPMAP: All ddpfs which have the DDPF_BUMPLUMINANCE -// or the DDPF_BUMPDUDV flags set. -// D3DX_SC_LUMINANCEMAP: All ddpfs which have the DDPF_BUMPLUMINANCE -// or the DDPF_LUMINANCE flags set. -// D3DX_SC_COLORTEXTURE: All the surfaces that have color information in -// them and can be used for texturing. -// D3DX_SC_COLORRENDERTGT: All the surfaces that contain color -// information and can be used as render targets. -//------------------------------------------------------------------------- -#define D3DX_SC_DEPTHBUFFER 0x01 -#define D3DX_SC_STENCILBUFFER 0x02 -#define D3DX_SC_COLORTEXTURE 0x04 -#define D3DX_SC_BUMPMAP 0x08 -#define D3DX_SC_LUMINANCEMAP 0x10 -#define D3DX_SC_COLORRENDERTGT 0x20 - -//------------------------------------------------------------------------- -// Surface Formats: -// --------------- -// These are the various types of surface formats that can be enumerated, -// there is no DDPIXELFORMAT structure in D3DX, the enums carry the meaning -// (like FOURCCs). -// -// All the surface classes are represented here. -// -//------------------------------------------------------------------------- -typedef enum _D3DX_SURFACEFORMAT -{ - D3DX_SF_UNKNOWN = 0, - D3DX_SF_R8G8B8 = 1, - D3DX_SF_A8R8G8B8 = 2, - D3DX_SF_X8R8G8B8 = 3, - D3DX_SF_R5G6B5 = 4, - D3DX_SF_R5G5B5 = 5, - D3DX_SF_PALETTE4 = 6, - D3DX_SF_PALETTE8 = 7, - D3DX_SF_A1R5G5B5 = 8, - D3DX_SF_X4R4G4B4 = 9, - D3DX_SF_A4R4G4B4 =10, - D3DX_SF_L8 =11, // 8 bit luminance-only - D3DX_SF_A8L8 =12, // 16 bit alpha-luminance - D3DX_SF_U8V8 =13, // 16 bit bump map format - D3DX_SF_U5V5L6 =14, // 16 bit bump map format with luminance - D3DX_SF_U8V8L8 =15, // 24 bit bump map format with luminance - D3DX_SF_UYVY =16, // UYVY format (PC98 compliance) - D3DX_SF_YUY2 =17, // YUY2 format (PC98 compliance) - D3DX_SF_DXT1 =18, // S3 texture compression technique 1 - D3DX_SF_DXT3 =19, // S3 texture compression technique 3 - D3DX_SF_DXT5 =20, // S3 texture compression technique 5 - D3DX_SF_R3G3B2 =21, // 8 bit RGB texture format - D3DX_SF_A8 =22, // 8 bit alpha-only - D3DX_SF_TEXTUREMAX =23, // Last texture format - - D3DX_SF_Z16S0 =256, - D3DX_SF_Z32S0 =257, - D3DX_SF_Z15S1 =258, - D3DX_SF_Z24S8 =259, - D3DX_SF_S1Z15 =260, - D3DX_SF_S8Z24 =261, - D3DX_SF_DEPTHMAX =262, // Last depth format - - D3DX_SF_FORCEMAX = (DWORD)(-1) -} D3DX_SURFACEFORMAT; - -//------------------------------------------------------------------------- -// Filtering types for Texture APIs -// -// ------------- -// These are the various filter types for generation of mip-maps -// -// D3DX_FILTERTYPE -// ----------------------------------------- -// D3DX_FT_POINT: Point sampling only - no filtering -// D3DX_FT_LINEAR: Bi-linear filtering -// -//------------------------------------------------------------------------- -typedef enum _D3DX_FILTERTYPE -{ - D3DX_FT_POINT = 0x01, - D3DX_FT_LINEAR = 0x02, - D3DX_FT_DEFAULT = D3DX_DEFAULT -} D3DX_FILTERTYPE; - -/////////////////////////////////////////////////////////////////////////// -// Structures used below: -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// D3DX_VIDMODEDESC: Display mode description. -// ---------------- -// width: Screen Width -// height: Screen Height -// bpp: Bits per pixel -// refreshRate: Refresh rate -//------------------------------------------------------------------------- -typedef struct _D3DX_VIDMODEDESC -{ - DWORD width; - DWORD height; - DWORD bpp; - DWORD refreshRate; -} D3DX_VIDMODEDESC; - -//------------------------------------------------------------------------- -// D3DX_DEVICEDESC: Description of a device that can do 3D -// --------------- -// deviceIndex: Unique (DWORD) number for the device. -// hwLevel: Level of acceleration afforded. This is one of the -// predefined Device Indices, and exists in this -// structure for informational purposes only. More than -// one device on the system may have the same hwLevel. -// To refer to a particular device with the D3DX apis, -// use the value in the deviceIndex member instead. -// ddGuid: The ddraw GUID -// d3dDeviceGuid: Direct3D Device GUID -// ddDeviceID: DDraw's GetDeviceIdentifier GUID. This GUID is unique to -// a particular driver revision on a particular video card. -// driverDesc: String describing the driver -// monitor: Handle to the video monitor used by this device (multimon -// specific). Devices that use different monitors on a -// multimon system report different values in this field. -// Therefore, to test for a multimon system, an application -// should look for more than one different monitor handle in -// the list of D3DX devices. -// onPrimary: Indicates if this device is on the primary monitor -// (multimon specific). -//------------------------------------------------------------------------- -#define D3DX_DRIVERDESC_LENGTH 256 - -typedef struct _D3DX_DEVICEDESC -{ - DWORD deviceIndex; - DWORD hwLevel; - GUID ddGuid; - GUID d3dDeviceGuid; - GUID ddDeviceID; - char driverDesc[D3DX_DRIVERDESC_LENGTH]; - HMONITOR monitor; - BOOL onPrimary; -} D3DX_DEVICEDESC; - -/////////////////////////////////////////////////////////////////////////// -// APIs: -/////////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//------------------------------------------------------------------------- -// D3DXInitialize: The very first call a D3DX app must make. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXInitialize(); - -//------------------------------------------------------------------------- -// D3DXUninitialize: The very last call a D3DX app must make. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXUninitialize(); - -//------------------------------------------------------------------------- -// D3DXGetDeviceCount: Returns the maximum number of D3DXdevices -// ------------------ available. -// -// D3DXGetDeviceDescription: Lists the 2D and 3D capabilities of the devices. -// ------------------------ Also, the various guids needed by ddraw and d3d. -// -// Params: -// [in] DWORD deviceIndex: Which device? Starts at 0. -// [in] D3DX_DEVICEDESC* pd3dxDevice: Pointer to the D3DX_DEVICEDESC -// structure to be filled in. -//------------------------------------------------------------------------- -DWORD WINAPI - D3DXGetDeviceCount(); - -HRESULT WINAPI - D3DXGetDeviceDescription(DWORD deviceIndex, - D3DX_DEVICEDESC* pd3dxDeviceDesc); - -//------------------------------------------------------------------------- -// D3DXGetMaxNumVideoModes: Returns the maximum number of video-modes . -// ----------------------- -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [in] DWORD flags: If D3DX_GVM_REFRESHRATE is set, then the refresh -// rates are not ignored. -// -// D3DXGetVideoMode: Describes a particular video mode for this device -// ---------------- -// -// Note: These queries will simply give you a list of modes that the -// display adapter tells DirectX that it supports. -// There is no guarantee that D3DXCreateContext(Ex) will succeed -// with all listed video modes. This is a fundamental limitation -// of the current DirectX architecture which D3DX cannot hide in -// any clean way. -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [in] DWORD flags: If D3DX_GVM_REFRESHRATE is set, then the refresh -// rates are returned -// [in] DWORD which: Which VideoMode ? Starts at 0. -// [out] D3DX_VIDMODEDESC* pModeList: Pointer to the D3DX_VIDMODEDESC -// structure that will be filled in. -//------------------------------------------------------------------------- -DWORD WINAPI - D3DXGetMaxNumVideoModes(DWORD deviceIndex, - DWORD flags); - -HRESULT WINAPI - D3DXGetVideoMode(DWORD deviceIndex, - DWORD flags, - DWORD modeIndex, - D3DX_VIDMODEDESC* pModeDesc); - -#define D3DX_GVM_REFRESHRATE 0x00000001 -//------------------------------------------------------------------------- -// D3DXGetMaxSurfaceFormats: Returns the maximum number of surface -// ------------------------ formats supported by the device at that -// video mode. -// -// D3DXGetSurfaceFormat: Describes one of the supported surface formats. -// --------------------- -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [in] D3DX_VIDMODEDESC* pDesc: The display mode at which the supported -// surface formats are requested. If it is -// NULL, the current display mode is -// assumed. -// [in] DWORD surfClassFlags: Required surface classes. Only surface -// formats which support all specified -// surface classes will be returned. -// (Multiple surface classes may be specified -// using bitwise OR.) -// [in] DWORD which: Which surface formats to retrieve. Starts at 0. -// [out] D3DX_SURFACEFORMAT* pFormat: The surface format -//------------------------------------------------------------------------- -DWORD WINAPI - D3DXGetMaxSurfaceFormats(DWORD deviceIndex, - D3DX_VIDMODEDESC* pDesc, - DWORD surfClassFlags); -HRESULT WINAPI - D3DXGetSurfaceFormat(DWORD deviceIndex, - D3DX_VIDMODEDESC* pDesc, - DWORD surfClassFlags, - DWORD surfaceIndex, - D3DX_SURFACEFORMAT* pFormat); - - -//------------------------------------------------------------------------- -// D3DXGetCurrentVideoMode: Retrieves the current video mode for this device. -// ------------------- -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [out] D3DX_VIDMODEDESC* pVidMode: The current video mode -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXGetCurrentVideoMode(DWORD deviceIndex, - D3DX_VIDMODEDESC* pVidMode); - -//------------------------------------------------------------------------- -// D3DXGetDeviceCaps: Lists all the capabilities of a device at a display -// mode. -// ---------------- -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [in] D3DX_VIDMODEDESC* pDesc: If this is NULL, we will return the -// caps at the current display mode of -// the device. -// [out] D3DDEVICEDESC7* pD3DDeviceDesc7: D3D Caps ( NULL to ignore -// parameter) -// [out] DDCAPS7* pDDHalCaps: DDraw HAL Caps (NULL to ignore parameter) -// [out] DDCAPS7* pDDHelCaps: DDraw HEL Caps (NULL to ignore paramter) -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXGetDeviceCaps(DWORD deviceIndex, - D3DX_VIDMODEDESC* pVidMode, - D3DDEVICEDESC7* pD3DCaps, - DDCAPS* pDDHALCaps, - DDCAPS* pDDHELCaps); - -//------------------------------------------------------------------------- -// D3DXCreateContext: Initializes the chosen device. It is the simplest init -// ----------------- function available. Parameters are treated the same -// as the matching subset of parameters in -// D3DXCreateContextEx, documented below. -// Remaining D3DXCreateContextEx parameters that are -// not present in D3DXCreateContext are treated as -// D3DX_DEFAULT. Note that multimon is not supported -// with D3DXCreateContext. -// -// D3DXCreateContextEx: A more advanced function to initialize the device. -// ------------------- Also accepts D3DX_DEFAULT for most of the parameters -// and then will do what D3DXCreateContext did. -// -// Note: Do not expect D3DXCreateContext(Ex) to be fail-safe (as with any -// API). Supported device capablilites should be used as a guide -// for choosing parameter values. Keep in mind that there will -// inevitably be some combinations of parameters that just do not work. -// -// Params: -// [in] DWORD deviceIndex: The device being referred to. -// [in] DWORD flags: The valid flags are D3DX_CONTEXT_FULLSCREEN, and -// D3DX_CONTEXT_OFFSCREEN. These flags cannot both -// be specified. If no flags are specified, the -// context defaults to windowed mode. -// -// [in] HWND hwnd: Device window. See note. -// [in] HWND hwndFocus: Window which receives keyboard messages from -// the device window. The device window should be -// a child of focus window. Useful for multimon -// applications. See note. -// NOTE: -// windowed: -// hwnd must be a valid window. hwndFocus must be NULL or -// D3DX_DEFAULT. -// -// fullscreen: -// Either hwnd or hwndFocus must be a valid window. (Both cannot -// be NULL or D3DX_DEFAULT). If hwnd is NULL or D3DX_DEFAULT, -// a default device window will be created as a child of hwndFocus. -// -// offscreen: -// Both hwnd and hwndFocus must be NULL or D3DX_DEFAULT -// -// [in] DWORD numColorBits: If D3DX_DEFAULT is passed for windowed mode, -// the current desktop's color depth is chosen. -// For full screen mode, D3DX_DEFAULT causes 16 -// bit color to be used. -// [in] DWORD numAlphaBits: If D3DX_DEFAULT is passed, 0 is chosen. -// [in] DWORD numDepthbits: If D3DX_DEFAULT is passed, -// the highest available number of depth bits -// is chosen. See note. -// [in] DWORD numStencilBits: If D3DX_DEFAULT is passed, the highest -// available number of stencil bits is chosen. -// See note. -// -// NOTE: If both numDepthBits and numStencilBits are D3DX_DEFAULT, -// D3DX first picks the highest available number of stencil -// bits. Then, for the chosen number of stencil bits, -// the highest available number of depth bits is chosen. -// If only one of numStencilBits or numDepthBits -// is D3DX_DEFAULT, the highest number of bits available -// for this parameter is chosen out of only the formats -// that support the number of bits requested for the -// fixed parameter. -// -// [in] DWORD numBackBuffers: Number of back buffers, or D3DX_DEFAULT. -// See note. -// -// NOTE: -// windowed: D3DX_DEFAULT means 1. You must specify one back buffer. -// -// fullscreen: D3DX_DEFAULT means 1. Any number of back buffers can be -// specified. -// -// offscreen: D3DX_DEFAULT means 0. You cannot specify additional back -// buffers. -// -// [in] DWORD width: Width, in pixels, or D3DX_DEFAULT. See note. -// [in] DWORD height: Height, in pixels, or D3DX_DEFAULT. See note. -// -// NOTE: -// windowed: If either width or height is D3DX_DEFAULT, both values -// default to the dimensions of the client area of hwnd. -// -// fullscreen: If either width or height is D3DX_DEFAULT, width -// defaults to 640, and height defaults to 480. -// -// offscreen: An error is returned if either width or height is -// D3DX_DEFAULT. -// -// [in] DWORD refreshRate: D3DX_DEFAULT means we let ddraw choose for -// us. Ignored for windowed and offscreen modes. -// [out] LPD3DXCONTEXT* ppCtx: This is the Context object that is used for -// rendering on that device. -// -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateContext(DWORD deviceIndex, - DWORD flags, - HWND hwnd, - DWORD width, - DWORD height, - LPD3DXCONTEXT* ppCtx); - -HRESULT WINAPI - D3DXCreateContextEx(DWORD deviceIndex, - DWORD flags, - HWND hwnd, - HWND hwndFocus, - DWORD numColorBits, - DWORD numAlphaBits, - DWORD numDepthbits, - DWORD numStencilBits, - DWORD numBackBuffers, - DWORD width, - DWORD height, - DWORD refreshRate, - LPD3DXCONTEXT* ppCtx); - -// The D3DXCreateContext(Ex) flags are: -#define D3DX_CONTEXT_FULLSCREEN 0x00000001 -#define D3DX_CONTEXT_OFFSCREEN 0x00000002 - -//------------------------------------------------------------------------- -// D3DXGetErrorString: Prints out the error string given an hresult. Prints -// ------------------ Win32 as well as DX6 error messages besides the D3DX -// messages. -// -// Params: -// [in] HRESULT hr: The error code to be deciphered. -// [in] DWORD strLength: Length of the string passed in. -// [out] LPSTR pStr: The string output. This string of appropriate -// size needs to be passed in. -//------------------------------------------------------------------------- -void WINAPI - D3DXGetErrorString(HRESULT hr, - DWORD strLength, - LPSTR pStr); - -//------------------------------------------------------------------------- -// D3DXMakeDDPixelFormat: Fills in a DDPIXELFORMAT structure based on the -// --------------------- D3DX surface format requested. -// -// Params: -// [in] D3DX_SURFACEFORMAT d3dxFormat: Surface format. -// [out] DDPIXELFORMAT* pddpf: Pixel format matching the given -// surface format. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXMakeDDPixelFormat(D3DX_SURFACEFORMAT d3dxFormat, - DDPIXELFORMAT* pddpf); - -//------------------------------------------------------------------------- -// D3DXMakeSurfaceFormat: Determines the surface format corresponding to -// --------------------- a given DDPIXELFORMAT. -// -// Params: -// [in] DDPIXELFORMAT* pddpf: Pixel format. -// Return Value: -// D3DX_SURFACEFORMAT: Surface format matching the given pixel format. -// D3DX_SF_UNKNOWN if the format is not supported -//------------------------------------------------------------------------- -D3DX_SURFACEFORMAT WINAPI - D3DXMakeSurfaceFormat(DDPIXELFORMAT* pddpf); - -#ifdef __cplusplus -} -#endif //__cplusplus - -/////////////////////////////////////////////////////////////////////////// -// Interfaces: -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// ID3DXContext interface: -// -// This encapsulates all the stuff that the app might -// want to do at initialization time and any global control over d3d and -// ddraw. -//------------------------------------------------------------------------- - - -DECLARE_INTERFACE_(ID3DXContext, IUnknown) -{ - // - // IUnknown methods - // - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Get the DDraw and Direct3D objects to call DirectDraw or - // Direct3D Immediate Mode functions. - // If the objects don't exist (because they have not - // been created for some reason) NULL is returned. - // All the objects returned in the following Get* functions - // are addref'ed. It is the application's responsibility to - // release them when no longer needed. - STDMETHOD_(LPDIRECTDRAW7,GetDD)(THIS) PURE; - STDMETHOD_(LPDIRECT3D7,GetD3D)(THIS) PURE; - STDMETHOD_(LPDIRECT3DDEVICE7,GetD3DDevice)(THIS) PURE; - - // Get the various buffers that get created at the init time - // These are addref'ed as well. It is the application's responsibility - // to release them before the app quits or when it needs a resize. - STDMETHOD_(LPDIRECTDRAWSURFACE7,GetPrimary)(THIS) PURE; - STDMETHOD_(LPDIRECTDRAWSURFACE7,GetZBuffer)(THIS) PURE; - STDMETHOD_(LPDIRECTDRAWSURFACE7,GetBackBuffer)(THIS_ DWORD which) PURE; - - // Get the associated window handles - STDMETHOD_(HWND,GetWindow)(THIS) PURE; - STDMETHOD_(HWND,GetFocusWindow)(THIS) PURE; - - // - // Various Get methods, in case the user had specified default - // parameters - // - STDMETHOD(GetDeviceIndex)(THIS_ - LPDWORD pDeviceIndex, - LPDWORD pHwLevel) PURE; - - STDMETHOD_(DWORD, GetNumBackBuffers)(THIS) PURE; - - STDMETHOD(GetNumBits)(THIS_ - LPDWORD pColorBits, - LPDWORD pDepthBits, - LPDWORD pAlphaBits, - LPDWORD pStencilBits) PURE; - - STDMETHOD(GetBufferSize)(THIS_ - LPDWORD pWidth, - LPDWORD pHeight) PURE; - - // Get the flags that were used to create this context - STDMETHOD_(DWORD, GetCreationFlags)(THIS) PURE; - STDMETHOD_(DWORD, GetRefreshRate)(THIS) PURE; - - // Restoring surfaces in case stuff is lost - STDMETHOD(RestoreSurfaces)(THIS) PURE; - - // Resize all the buffers to the new width and height - STDMETHOD(Resize)(THIS_ DWORD width, DWORD height) PURE; - - // Update the frame using a flip or a blit, - // If the D3DX_UPDATE_NOVSYNC flag is set, blit is used if the - // driver cannot flip without waiting for vsync in full-screen mode. - STDMETHOD(UpdateFrame)(THIS_ DWORD flags) PURE; - - // Render a string at the specified coordinates, with the specified - // colour. This is only provided as a convenience for - // debugging/information during development. - // topLeftX and topLeftY represent the location of the top left corner - // of the string, on the render target. - // The coordinate and color parameters each have a range of 0.0-1.0 - STDMETHOD(DrawDebugText)(THIS_ - float topLeftX, - float topLeftY, - D3DCOLOR color, - LPSTR pString) PURE; - - // Clears to the current viewport - // The following are the valid flags: - // D3DCLEAR_TARGET (to clear the render target ) - // D3DCLEAR_ZBUFFER (to clear the depth-buffer ) - // D3DCLEAR_STENCIL (to clear the stencil-buffer ) - STDMETHOD(Clear)(THIS_ DWORD ClearFlags) PURE; - - STDMETHOD(SetClearColor)(THIS_ D3DCOLOR color ) PURE; - STDMETHOD(SetClearDepth)(THIS_ float z) PURE; - STDMETHOD(SetClearStencil)(THIS_ DWORD stencil) PURE; -}; - - -//------------------------------------------------------------------------- -// Flags for Update member function: -// - -// Flag to indicate that blit should be used instead of a flip -// for full-screen rendering. -#define D3DX_UPDATE_NOVSYNC (1<<0) - -/////////////////////////////////////////////////////////////////////////// -// Texturing APIs: -/////////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -//------------------------------------------------------------------------- -// D3DXCheckTextureRequirements: Return information about texture creation -// ---------------------------- (used by CreateTexture, CreateTextureFromFile -// and CreateCubeMapTexture) -// -// Parameters: -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pFlags -// allows specification of D3DX_TEXTURE_NOMIPMAP -// D3DX_TEXTURE_NOMIPMAP may be returned in the case where mipmap creation -// is not supported. -// pWidth -// width in pixels or NULL -// returns corrected width -// pHeight -// height in pixels or NULL -// returns corrected height -// pPixelFormat -// surface format -// returns best match to input format -// -// Notes: 1. Unless the flags is set to specifically prevent creating -// mipmaps, mipmaps are generated all the way till 1x1 surface. -// 2. width, height and pixelformat are altered based on available -// hardware. For example: -// a. Texture dimensions may be required to be powers of 2 -// b. We may require width == height for some devices -// c. If PixelFormat is unavailable, a best fit is made -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCheckTextureRequirements( LPDIRECT3DDEVICE7 pd3dDevice, - LPDWORD pFlags, - LPDWORD pWidth, - LPDWORD pHeight, - D3DX_SURFACEFORMAT* pPixelFormat); - -//------------------------------------------------------------------------- -// D3DXCreateTexture: Create an empty texture object -// ----------------- -// -// Parameters: -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pFlags -// allows specification of D3DX_TEXTURE_NOMIPMAP -// D3DX_TEXTURE_NOMIPMAP may be returned in the case where mipmap creation -// is not supported. Additionally, D3DX_TEXTURE_STAGE can be specified -// to indicate which texture stage the texture is for e.g. -// D3D_TEXTURE_STAGE1 indicates that the texture is for use with texture -// stage one. Stage Zero is the default if no TEXTURE_STAGE flags are -// set. -// pWidth -// width in pixels; 0 or NULL is unacceptable -// returns corrected width -// pHeight -// height in pixels; 0 or NULL is unacceptable -// returns corrected height -// pPixelFormat -// surface format. D3DX_DEFAULT is unacceptable. -// returns actual format that was used -// pDDPal -// DDraw palette that is set (if present) on paletted surfaces. -// It is ignored even if it is set, for non-paletted surfaces. -// ppDDSurf -// The ddraw surface that will be created -// pNumMipMaps -// the number of mipmaps actually generated -// -// Notes: See notes for D3DXCheckTextureRequirements. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTexture( LPDIRECT3DDEVICE7 pd3dDevice, - LPDWORD pFlags, - LPDWORD pWidth, - LPDWORD pHeight, - D3DX_SURFACEFORMAT* pPixelFormat, - LPDIRECTDRAWPALETTE pDDPal, - LPDIRECTDRAWSURFACE7* ppDDSurf, - LPDWORD pNumMipMaps); - -//------------------------------------------------------------------------- -// D3DXCreateCubeMapTexture: Create blank cube-map texture -// ------------------------ -// -// Parameters: -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pFlags -// allows specification of D3DX_TEXTURE_NOMIPMAP -// D3DX_TEXTURE_NOMIPMAP may be returned in the case where mipmap creation -// is not supported. Additionally, D3DX_TEXTURE_STAGE can be specified -// to indicate which texture stage the texture is for e.g. -// D3D_TEXTURE_STAGE1 indicates that the texture is for use with texture -// stage one. Stage Zero is the default if no TEXTURE_STAGE flags are -// set. -// cubefaces -// allows specification of which faces of the cube-map to generate. -// D3DX_DEFAULT, 0, and DDSCAPS2_CUBEMAP_ALLFACES all mean -// "create all 6 faces of the cubemap". Any combination of -// DDSCAPS2_CUBEMAP_POSITIVEX, DDSCAPS2_CUBEMAP_NEGATIVEX, -// DDSCAPS2_CUBEMAP_POSITIVEY, DDSCAPS2_CUBEMAP_NEGATIVEY, -// DDSCAPS2_CUBEMAP_POSITIVEZ, or DDSCAPS2_CUBEMAP_NEGATIVEZ, is -// valid. -// colorEmptyFaces -// allows specification of the color to use for the faces that were not -// specified in the cubefaces parameter. -// pWidth -// width in pixels; 0 or NULL is unacceptable -// returns corrected width -// pHeight -// height in pixels; 0 or NULL is unacceptable -// returns corrected height -// pPixelFormat -// surface format. D3DX_DEFAULT is unacceptable. -// returns actual format that was used -// pDDPal -// DDraw palette that is set (if present) on paletted surfaces. -// It is ignored even if it is set, for non-paletted surfaces. -// ppDDSurf -// the ddraw surface that will be created -// pNumMipMaps -// the number of mipmaps generated for a particular face of the -// cubemap. -// -// Notes: See notes for D3DXCheckTextureRequirements. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateCubeMapTexture( LPDIRECT3DDEVICE7 pd3dDevice, - LPDWORD pFlags, - DWORD cubefaces, - D3DCOLOR colorEmptyFaces, - LPDWORD pWidth, - LPDWORD pHeight, - D3DX_SURFACEFORMAT *pPixelFormat, - LPDIRECTDRAWPALETTE pDDPal, - LPDIRECTDRAWSURFACE7* ppDDSurf, - LPDWORD pNumMipMaps); - - -//------------------------------------------------------------------------- -// D3DXCreateTextureFromFile: Create a texture object from a file or from the -// ------------------------- resource. Only BMP and DIB are supported from the -// resource portion of the executable. -// -// Parameters: -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pFlags -// allows specification of D3DX_TEXTURE_NOMIPMAP -// D3DX_TEXTURE_NOMIPMAP may be returned in the case where mipmap creation -// is not supported. Additionally, D3DX_TEXTURE_STAGE can be specified -// to indicate which texture stage the texture is for e.g. -// D3D_TEXTURE_STAGE1 indicates that the texture is for use with texture -// stage one. Stage Zero is the default if no TEXTURE_STAGE flags are -// set. -// pWidth -// Width in pixels. If 0 or D3DX_DEFAULT, the width will be taken -// from the file -// returns corrected width -// pHeight -// Height in pixels. If 0 or D3DX_DEFAULT, the height will be taken -// from the file -// returns corrected height -// pPixelFormat -// If D3DX_SF_UNKNOWN is passed in, pixel format closest to the bitmap -// will be chosen -// returns actual format that was used -// pDDPal -// DDraw palette that is set (if present) on paletted surfaces. -// It is ignored even if it is set, for non-paletted surfaces. -// ppDDSurf -// The ddraw surface that will be created. -// pNumMipMaps -// The number of mipmaps generated. -// pSrcName -// File name. BMP, DIB, DDS, are supported. -// -// TGA is supported for the following cases: 16, 24, 32bpp direct color and 8bpp palettized. -// Also, 8, 16bpp grayscale is supported. RLE versions of the above -// TGA formats are also supported. ColorKey and Premultiplied Alpha -// are not currently supported for TGA files. -// returns created format -// -// Notes: See notes for D3DXCheckTextureRequirements. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTextureFromFile( LPDIRECT3DDEVICE7 pd3dDevice, - LPDWORD pFlags, - LPDWORD pWidth, - LPDWORD pHeight, - D3DX_SURFACEFORMAT* pPixelFormat, - LPDIRECTDRAWPALETTE pDDPal, - LPDIRECTDRAWSURFACE7* ppDDSurf, - LPDWORD pNumMipMaps, - LPSTR pSrcName, - D3DX_FILTERTYPE filterType); - -//------------------------------------------------------------------------- -// D3DXLoadTextureFromFile: Load from a file into a mipmap level. Doing the -// ----------------------- necessary color conversion and rescaling. File -// format support is identical to -// D3DXCreateTextureFromFile's. -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pTexture -// a pointer to a DD7Surface which was created with either -// CreateTextureFromFile or CreateTexture. -// mipMapLevel -// indicates mipmap level -// Note: -// 1. Error if mipmap level doesn't exist -// 2. If D3DX_DEFAULT and equal number of mipmap levels exist -// then all the source mip-levels are loaded -// 3. If the source has mipmaps and the dest doesn't, use the top one -// 4. If the dest has miplevels and source doesn't, we expand -// 5. If there are unequal numbers of miplevels, we expand -// pSrcName -// File name. BMP, DIB, DDS, are supported. -// For details on TGA support, refer to the comments for -// D3DXCreateTextureFromFile -// pSrcRect -// the source rectangle or null (whole surface) -// pDestRect -// the destination rectangle or null (whole surface) -// filterType -// filter used for mipmap generation -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXLoadTextureFromFile( LPDIRECT3DDEVICE7 pd3dDevice, - LPDIRECTDRAWSURFACE7 pTexture, - DWORD mipMapLevel, - LPSTR pSrcName, - RECT* pSrcRect, - RECT* pDestRect, - D3DX_FILTERTYPE filterType); - -//------------------------------------------------------------------------- -// D3DXLoadTextureFromSurface: Load from a DDraw Surface into a mipmap level. -// -------------------------- Doing the necessary color conversion. -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pTexture -// a pointer to a DD7Surface which was created with either -// CreateTextureFromFile or CreateTexture. -// mipMapLevel -// indicates mipmap level -// Note: -// 1. Error if mipmap level doesn't exist -// 2. If D3DX_DEFAULT and equal number of mipmap levels exist -// then all the source mip-levels are loaded -// 3. If the source has mipmaps and the dest doesn't, use the top one -// 4. If the dest has miplevels and source doesn't, we expand -// 5. If there are unequal numbers of miplevels, we expand -// pSurfaceSrc -// the source surface -// pSrcRect -// the source rectangle or null (whole surface) -// pDestRect -// the destination rectangle or null (whole surface) -// filterType -// filter used for mipmap generation -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXLoadTextureFromSurface( LPDIRECT3DDEVICE7 pd3dDevice, - LPDIRECTDRAWSURFACE7 pTexture, - DWORD mipMapLevel, - LPDIRECTDRAWSURFACE7 pSurfaceSrc, - RECT* pSrcRect, - RECT* pDestRect, - D3DX_FILTERTYPE filterType); - -//------------------------------------------------------------------------- -// D3DXLoadTextureFromMemory: Load a mip level from memory. Doing the necessary -// ------------------------- color conversion. -// -// pd3dDevice -// The D3D device with which the texture is going to be used. -// pTexture -// a pointer to a DD7Surface which was created with either -// CreateTextureFromFile or CreateTexture. -// mipMapLevel -// indicates mipmap level -// Note: -// 1. Error if mipmap level doesn't exist -// 2. If D3DX_DEFAULT and equal number of mipmap levels exist -// then all the source mip-levels are loaded -// 3. If the source has mipmaps and the dest doesn't, use the top one -// 4. If the dest has miplevels and source doesn't, we expand -// 5. If there are unequal numbers of miplevels, we expand -// pMemory -// pointer to source memory from which the texture will be loaded -// pDDPal -// DirectDraw Palette, that the app passes in optionally if the memory is -// supposed to be paletteized. -// srcPixelFormat -// PixelFormat of the source. -// srcPitch -// The pitch of the memory or D3DX_DEFAULT (based on srcPixelFormat) -// pDestRect -// The destination rectangle or null (whole surface) -// filterType -// filter used for mipmap generation -// -// Assumptions: The source (memory) is loaded in full -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXLoadTextureFromMemory( LPDIRECT3DDEVICE7 pd3dDevice, - LPDIRECTDRAWSURFACE7 pTexture, - DWORD mipMapLevel, - LPVOID pMemory, - LPDIRECTDRAWPALETTE pDDPal, - D3DX_SURFACEFORMAT srcPixelFormat, - DWORD srcPitch, - RECT* pDestRect, - D3DX_FILTERTYPE filterType); - -#ifdef __cplusplus -} -#endif //__cplusplus - -//------------------------------------------------------------------------- -// Flags for texture create functions; applies to -// D3DXCreateTexture, D3DXCreateCubeMapTexture and D3DXCreateTextureFromFile. -// - -// Flag to indicate that mipmap generation is not desired. -#define D3DX_TEXTURE_NOMIPMAP (1 << 8) - -// Flags to indicate which texture stage the texture is -// intended for use with. Specifying the stage is necessary at -// texture creation time for HW devices that expose the -// D3DDEVCAPS_SEPARATETEXTUREMEMORIES bit in their D3DDEVICEDESC -// structure. -#define D3DX_TEXTURE_STAGE0 (0) -#define D3DX_TEXTURE_STAGE1 (1) -#define D3DX_TEXTURE_STAGE2 (2) -#define D3DX_TEXTURE_STAGE3 (3) -#define D3DX_TEXTURE_STAGE4 (4) -#define D3DX_TEXTURE_STAGE5 (5) -#define D3DX_TEXTURE_STAGE6 (6) -#define D3DX_TEXTURE_STAGE7 (7) - -// Mask to extract the texture stage value out of the flags to -// the texture create functions. -#define D3DX_TEXTURE_STAGE_MASK (0x7) - -#endif //__D3DXCORE_H__ diff --git a/import/DirectX8/include/d3dxerr.h b/import/DirectX8/include/d3dxerr.h deleted file mode 100644 index 155005b70..000000000 --- a/import/DirectX8/include/d3dxerr.h +++ /dev/null @@ -1,407 +0,0 @@ -//---------------------------------------------------------------------- -// -// d3dxerr.h -- 0xC code definitions for the D3DX API -// -// Copyright (c) Microsoft Corp. All rights reserved. -// -//---------------------------------------------------------------------- -#ifndef __D3DXERR_H__ -#define __D3DXERR_H__ - -// -// -// Values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// -#define FACILITY_D3DX 0x877 - - - -// -// MessageId: D3DXERR_NOMEMORY -// -// MessageText: -// -// Out of memory. -// -#define D3DXERR_NOMEMORY ((HRESULT)0xC8770BB8L) - - -// -// MessageId: D3DXERR_NULLPOINTER -// -// MessageText: -// -// A NULL pointer was passed as a parameter. -// -#define D3DXERR_NULLPOINTER ((HRESULT)0xC8770BB9L) - - -// -// MessageId: D3DXERR_INVALIDD3DXDEVICEINDEX -// -// MessageText: -// -// The Device Index passed in is invalid. -// -#define D3DXERR_INVALIDD3DXDEVICEINDEX ((HRESULT)0xC8770BBAL) - - -// -// MessageId: D3DXERR_NODIRECTDRAWAVAILABLE -// -// MessageText: -// -// DirectDraw has not been created. -// -#define D3DXERR_NODIRECTDRAWAVAILABLE ((HRESULT)0xC8770BBBL) - - -// -// MessageId: D3DXERR_NODIRECT3DAVAILABLE -// -// MessageText: -// -// Direct3D has not been created. -// -#define D3DXERR_NODIRECT3DAVAILABLE ((HRESULT)0xC8770BBCL) - - -// -// MessageId: D3DXERR_NODIRECT3DDEVICEAVAILABLE -// -// MessageText: -// -// Direct3D device has not been created. -// -#define D3DXERR_NODIRECT3DDEVICEAVAILABLE ((HRESULT)0xC8770BBDL) - - -// -// MessageId: D3DXERR_NOPRIMARYAVAILABLE -// -// MessageText: -// -// Primary surface has not been created. -// -#define D3DXERR_NOPRIMARYAVAILABLE ((HRESULT)0xC8770BBEL) - - -// -// MessageId: D3DXERR_NOZBUFFERAVAILABLE -// -// MessageText: -// -// Z buffer has not been created. -// -#define D3DXERR_NOZBUFFERAVAILABLE ((HRESULT)0xC8770BBFL) - - -// -// MessageId: D3DXERR_NOBACKBUFFERAVAILABLE -// -// MessageText: -// -// Backbuffer has not been created. -// -#define D3DXERR_NOBACKBUFFERAVAILABLE ((HRESULT)0xC8770BC0L) - - -// -// MessageId: D3DXERR_COULDNTUPDATECAPS -// -// MessageText: -// -// Failed to update caps database after changing display mode. -// -#define D3DXERR_COULDNTUPDATECAPS ((HRESULT)0xC8770BC1L) - - -// -// MessageId: D3DXERR_NOZBUFFER -// -// MessageText: -// -// Could not create Z buffer. -// -#define D3DXERR_NOZBUFFER ((HRESULT)0xC8770BC2L) - - -// -// MessageId: D3DXERR_INVALIDMODE -// -// MessageText: -// -// Display mode is not valid. -// -#define D3DXERR_INVALIDMODE ((HRESULT)0xC8770BC3L) - - -// -// MessageId: D3DXERR_INVALIDPARAMETER -// -// MessageText: -// -// One or more of the parameters passed is invalid. -// -#define D3DXERR_INVALIDPARAMETER ((HRESULT)0xC8770BC4L) - - -// -// MessageId: D3DXERR_INITFAILED -// -// MessageText: -// -// D3DX failed to initialize itself. -// -#define D3DXERR_INITFAILED ((HRESULT)0xC8770BC5L) - - -// -// MessageId: D3DXERR_STARTUPFAILED -// -// MessageText: -// -// D3DX failed to start up. -// -#define D3DXERR_STARTUPFAILED ((HRESULT)0xC8770BC6L) - - -// -// MessageId: D3DXERR_D3DXNOTSTARTEDYET -// -// MessageText: -// -// D3DXInitialize() must be called first. -// -#define D3DXERR_D3DXNOTSTARTEDYET ((HRESULT)0xC8770BC7L) - - -// -// MessageId: D3DXERR_NOTINITIALIZED -// -// MessageText: -// -// D3DX is not initialized yet. -// -#define D3DXERR_NOTINITIALIZED ((HRESULT)0xC8770BC8L) - - -// -// MessageId: D3DXERR_FAILEDDRAWTEXT -// -// MessageText: -// -// Failed to render text to the surface. -// -#define D3DXERR_FAILEDDRAWTEXT ((HRESULT)0xC8770BC9L) - - -// -// MessageId: D3DXERR_BADD3DXCONTEXT -// -// MessageText: -// -// Bad D3DX context. -// -#define D3DXERR_BADD3DXCONTEXT ((HRESULT)0xC8770BCAL) - - -// -// MessageId: D3DXERR_CAPSNOTSUPPORTED -// -// MessageText: -// -// The requested device capabilities are not supported. -// -#define D3DXERR_CAPSNOTSUPPORTED ((HRESULT)0xC8770BCBL) - - -// -// MessageId: D3DXERR_UNSUPPORTEDFILEFORMAT -// -// MessageText: -// -// The image file format is unrecognized. -// -#define D3DXERR_UNSUPPORTEDFILEFORMAT ((HRESULT)0xC8770BCCL) - - -// -// MessageId: D3DXERR_IFLERROR -// -// MessageText: -// -// The image file loading library error. -// -#define D3DXERR_IFLERROR ((HRESULT)0xC8770BCDL) - - -// -// MessageId: D3DXERR_FAILEDGETCAPS -// -// MessageText: -// -// Could not obtain device caps. -// -#define D3DXERR_FAILEDGETCAPS ((HRESULT)0xC8770BCEL) - - -// -// MessageId: D3DXERR_CANNOTRESIZEFULLSCREEN -// -// MessageText: -// -// Resize does not work for full-screen. -// -#define D3DXERR_CANNOTRESIZEFULLSCREEN ((HRESULT)0xC8770BCFL) - - -// -// MessageId: D3DXERR_CANNOTRESIZENONWINDOWED -// -// MessageText: -// -// Resize does not work for non-windowed contexts. -// -#define D3DXERR_CANNOTRESIZENONWINDOWED ((HRESULT)0xC8770BD0L) - - -// -// MessageId: D3DXERR_FRONTBUFFERALREADYEXISTS -// -// MessageText: -// -// Front buffer already exists. -// -#define D3DXERR_FRONTBUFFERALREADYEXISTS ((HRESULT)0xC8770BD1L) - - -// -// MessageId: D3DXERR_FULLSCREENPRIMARYEXISTS -// -// MessageText: -// -// The app is using the primary in full-screen mode. -// -#define D3DXERR_FULLSCREENPRIMARYEXISTS ((HRESULT)0xC8770BD2L) - - -// -// MessageId: D3DXERR_GETDCFAILED -// -// MessageText: -// -// Could not get device context. -// -#define D3DXERR_GETDCFAILED ((HRESULT)0xC8770BD3L) - - -// -// MessageId: D3DXERR_BITBLTFAILED -// -// MessageText: -// -// Could not bitBlt. -// -#define D3DXERR_BITBLTFAILED ((HRESULT)0xC8770BD4L) - - -// -// MessageId: D3DXERR_NOTEXTURE -// -// MessageText: -// -// There is no surface backing up this texture. -// -#define D3DXERR_NOTEXTURE ((HRESULT)0xC8770BD5L) - - -// -// MessageId: D3DXERR_MIPLEVELABSENT -// -// MessageText: -// -// There is no such miplevel for this surface. -// -#define D3DXERR_MIPLEVELABSENT ((HRESULT)0xC8770BD6L) - - -// -// MessageId: D3DXERR_SURFACENOTPALETTED -// -// MessageText: -// -// The surface is not paletted. -// -#define D3DXERR_SURFACENOTPALETTED ((HRESULT)0xC8770BD7L) - - -// -// MessageId: D3DXERR_ENUMFORMATSFAILED -// -// MessageText: -// -// An error occured while enumerating surface formats. -// -#define D3DXERR_ENUMFORMATSFAILED ((HRESULT)0xC8770BD8L) - - -// -// MessageId: D3DXERR_COLORDEPTHTOOLOW -// -// MessageText: -// -// D3DX only supports color depths of 16 bit or greater. -// -#define D3DXERR_COLORDEPTHTOOLOW ((HRESULT)0xC8770BD9L) - - -// -// MessageId: D3DXERR_INVALIDFILEFORMAT -// -// MessageText: -// -// The file format is invalid. -// -#define D3DXERR_INVALIDFILEFORMAT ((HRESULT)0xC8770BDAL) - - -// -// MessageId: D3DXERR_NOMATCHFOUND -// -// MessageText: -// -// No suitable match found. -// -#define D3DXERR_NOMATCHFOUND ((HRESULT)0xC8770BDBL) - - - -#endif //__D3DXERR_H__ - diff --git a/import/DirectX8/include/d3dxmath.h b/import/DirectX8/include/d3dxmath.h deleted file mode 100644 index 685cc3369..000000000 --- a/import/DirectX8/include/d3dxmath.h +++ /dev/null @@ -1,1085 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dxmath.h -// Content: D3DX math types and functions -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DXMATH_H__ -#define __D3DXMATH_H__ - -#include -#include -#include -#include "d3dxerr.h" - -#ifndef D3DXINLINE -#ifdef __cplusplus -#define D3DXINLINE inline -#else -#define D3DXINLINE _inline -#endif -#endif - -#pragma warning(disable:4201) // anonymous unions warning - - - -typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK; - -// {E3357330-CC5E-11d2-A434-00A0C90629A8} -DEFINE_GUID( IID_ID3DXMatrixStack, - 0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); - - -//=========================================================================== -// -// General purpose utilities -// -//=========================================================================== -#define D3DX_PI ((float) 3.141592654f) -#define D3DX_1BYPI ((float) 0.318309886f) - -#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) -#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) - - - -//=========================================================================== -// -// Vectors -// -//=========================================================================== - -//-------------------------- -// 2D Vector -//-------------------------- -typedef struct D3DXVECTOR2 -{ -#ifdef __cplusplus -public: - D3DXVECTOR2() {}; - D3DXVECTOR2( const float * ); - D3DXVECTOR2( float x, float y ); - - // casting - operator float* (); - operator const float* () const; - - // assignment operators - D3DXVECTOR2& operator += ( const D3DXVECTOR2& ); - D3DXVECTOR2& operator -= ( const D3DXVECTOR2& ); - D3DXVECTOR2& operator *= ( float ); - D3DXVECTOR2& operator /= ( float ); - - // unary operators - D3DXVECTOR2 operator + () const; - D3DXVECTOR2 operator - () const; - - // binary operators - D3DXVECTOR2 operator + ( const D3DXVECTOR2& ) const; - D3DXVECTOR2 operator - ( const D3DXVECTOR2& ) const; - D3DXVECTOR2 operator * ( float ) const; - D3DXVECTOR2 operator / ( float ) const; - - friend D3DXVECTOR2 operator * ( float, const D3DXVECTOR2& ); - - BOOL operator == ( const D3DXVECTOR2& ) const; - BOOL operator != ( const D3DXVECTOR2& ) const; - - -public: -#endif //__cplusplus - float x, y; -} D3DXVECTOR2, *LPD3DXVECTOR2; - - -//-------------------------- -// 3D Vector -//-------------------------- -typedef struct D3DXVECTOR3 -{ -#ifdef __cplusplus -public: - D3DXVECTOR3() {}; - D3DXVECTOR3( const float * ); - D3DXVECTOR3( const D3DVECTOR& ); - D3DXVECTOR3( float x, float y, float z ); - - // casting - operator float* (); - operator const float* () const; - - operator D3DVECTOR* (); - operator const D3DVECTOR* () const; - - operator D3DVECTOR& (); - operator const D3DVECTOR& () const; - - // assignment operators - D3DXVECTOR3& operator += ( const D3DXVECTOR3& ); - D3DXVECTOR3& operator -= ( const D3DXVECTOR3& ); - D3DXVECTOR3& operator *= ( float ); - D3DXVECTOR3& operator /= ( float ); - - // unary operators - D3DXVECTOR3 operator + () const; - D3DXVECTOR3 operator - () const; - - // binary operators - D3DXVECTOR3 operator + ( const D3DXVECTOR3& ) const; - D3DXVECTOR3 operator - ( const D3DXVECTOR3& ) const; - D3DXVECTOR3 operator * ( float ) const; - D3DXVECTOR3 operator / ( float ) const; - - friend D3DXVECTOR3 operator * ( float, const struct D3DXVECTOR3& ); - - BOOL operator == ( const D3DXVECTOR3& ) const; - BOOL operator != ( const D3DXVECTOR3& ) const; - -public: -#endif //__cplusplus - float x, y, z; -} D3DXVECTOR3, *LPD3DXVECTOR3; - - -//-------------------------- -// 4D Vector -//-------------------------- -typedef struct D3DXVECTOR4 -{ -#ifdef __cplusplus -public: - D3DXVECTOR4() {}; - D3DXVECTOR4( const float* ); - D3DXVECTOR4( float x, float y, float z, float w ); - - // casting - operator float* (); - operator const float* () const; - - // assignment operators - D3DXVECTOR4& operator += ( const D3DXVECTOR4& ); - D3DXVECTOR4& operator -= ( const D3DXVECTOR4& ); - D3DXVECTOR4& operator *= ( float ); - D3DXVECTOR4& operator /= ( float ); - - // unary operators - D3DXVECTOR4 operator + () const; - D3DXVECTOR4 operator - () const; - - // binary operators - D3DXVECTOR4 operator + ( const D3DXVECTOR4& ) const; - D3DXVECTOR4 operator - ( const D3DXVECTOR4& ) const; - D3DXVECTOR4 operator * ( float ) const; - D3DXVECTOR4 operator / ( float ) const; - - friend D3DXVECTOR4 operator * ( float, const D3DXVECTOR4& ); - - BOOL operator == ( const D3DXVECTOR4& ) const; - BOOL operator != ( const D3DXVECTOR4& ) const; - -public: -#endif //__cplusplus - float x, y, z, w; -} D3DXVECTOR4, *LPD3DXVECTOR4; - - -//=========================================================================== -// -// Matrices -// -//=========================================================================== -typedef struct D3DXMATRIX -{ -#ifdef __cplusplus -public: - D3DXMATRIX() {}; - D3DXMATRIX( const float * ); - D3DXMATRIX( const D3DMATRIX& ); - D3DXMATRIX( float m00, float m01, float m02, float m03, - float m10, float m11, float m12, float m13, - float m20, float m21, float m22, float m23, - float m30, float m31, float m32, float m33 ); - - - // access grants - float& operator () ( UINT iRow, UINT iCol ); - float operator () ( UINT iRow, UINT iCol ) const; - - // casting operators - operator float* (); - operator const float* () const; - - operator D3DMATRIX* (); - operator const D3DMATRIX* () const; - - operator D3DMATRIX& (); - operator const D3DMATRIX& () const; - - // assignment operators - D3DXMATRIX& operator *= ( const D3DXMATRIX& ); - D3DXMATRIX& operator += ( const D3DXMATRIX& ); - D3DXMATRIX& operator -= ( const D3DXMATRIX& ); - D3DXMATRIX& operator *= ( float ); - D3DXMATRIX& operator /= ( float ); - - // unary operators - D3DXMATRIX operator + () const; - D3DXMATRIX operator - () const; - - // binary operators - D3DXMATRIX operator * ( const D3DXMATRIX& ) const; - D3DXMATRIX operator + ( const D3DXMATRIX& ) const; - D3DXMATRIX operator - ( const D3DXMATRIX& ) const; - D3DXMATRIX operator * ( float ) const; - D3DXMATRIX operator / ( float ) const; - - friend D3DXMATRIX operator * ( float, const D3DXMATRIX& ); - - BOOL operator == ( const D3DXMATRIX& ) const; - BOOL operator != ( const D3DXMATRIX& ) const; - - -#endif //__cplusplus - - union - { - float m[4][4]; -#ifdef __cplusplus - struct - { - float m00, m01, m02, m03; - float m10, m11, m12, m13; - float m20, m21, m22, m23; - float m30, m31, m32, m33; - }; -#endif //__cplusplus - }; -} D3DXMATRIX, *LPD3DXMATRIX; - - -//=========================================================================== -// -// Quaternions -// -//=========================================================================== -typedef struct D3DXQUATERNION -{ -#ifdef __cplusplus -public: - D3DXQUATERNION() {} - D3DXQUATERNION( const float * ); - D3DXQUATERNION( float x, float y, float z, float w ); - - // casting - operator float* (); - operator const float* () const; - - // assignment operators - D3DXQUATERNION& operator += ( const D3DXQUATERNION& ); - D3DXQUATERNION& operator -= ( const D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( const D3DXQUATERNION& ); - D3DXQUATERNION& operator *= ( float ); - D3DXQUATERNION& operator /= ( float ); - - // unary operators - D3DXQUATERNION operator + () const; - D3DXQUATERNION operator - () const; - - // binary operators - D3DXQUATERNION operator + ( const D3DXQUATERNION& ) const; - D3DXQUATERNION operator - ( const D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( const D3DXQUATERNION& ) const; - D3DXQUATERNION operator * ( float ) const; - D3DXQUATERNION operator / ( float ) const; - - friend D3DXQUATERNION operator * (float, const D3DXQUATERNION& ); - - BOOL operator == ( const D3DXQUATERNION& ) const; - BOOL operator != ( const D3DXQUATERNION& ) const; - -#endif //__cplusplus - float x, y, z, w; -} D3DXQUATERNION, *LPD3DXQUATERNION; - - -//=========================================================================== -// -// Planes -// -//=========================================================================== -typedef struct D3DXPLANE -{ -#ifdef __cplusplus -public: - D3DXPLANE() {} - D3DXPLANE( const float* ); - D3DXPLANE( float a, float b, float c, float d ); - - // casting - operator float* (); - operator const float* () const; - - // unary operators - D3DXPLANE operator + () const; - D3DXPLANE operator - () const; - - // binary operators - BOOL operator == ( const D3DXPLANE& ) const; - BOOL operator != ( const D3DXPLANE& ) const; - -#endif //__cplusplus - float a, b, c, d; -} D3DXPLANE, *LPD3DXPLANE; - - -//=========================================================================== -// -// Colors -// -//=========================================================================== - -typedef struct D3DXCOLOR -{ -#ifdef __cplusplus -public: - D3DXCOLOR() {} - D3DXCOLOR( DWORD argb ); - D3DXCOLOR( const float * ); - D3DXCOLOR( const D3DCOLORVALUE& ); - D3DXCOLOR( float r, float g, float b, float a ); - - // casting - operator DWORD () const; - - operator float* (); - operator const float* () const; - - operator D3DCOLORVALUE* (); - operator const D3DCOLORVALUE* () const; - - operator D3DCOLORVALUE& (); - operator const D3DCOLORVALUE& () const; - - // assignment operators - D3DXCOLOR& operator += ( const D3DXCOLOR& ); - D3DXCOLOR& operator -= ( const D3DXCOLOR& ); - D3DXCOLOR& operator *= ( float ); - D3DXCOLOR& operator /= ( float ); - - // unary operators - D3DXCOLOR operator + () const; - D3DXCOLOR operator - () const; - - // binary operators - D3DXCOLOR operator + ( const D3DXCOLOR& ) const; - D3DXCOLOR operator - ( const D3DXCOLOR& ) const; - D3DXCOLOR operator * ( float ) const; - D3DXCOLOR operator / ( float ) const; - - friend D3DXCOLOR operator * (float, const D3DXCOLOR& ); - - BOOL operator == ( const D3DXCOLOR& ) const; - BOOL operator != ( const D3DXCOLOR& ) const; - -#endif //__cplusplus - FLOAT r, g, b, a; -} D3DXCOLOR, *LPD3DXCOLOR; - - - -//=========================================================================== -// -// D3DX math functions: -// -// NOTE: -// * All these functions can take the same object as in and out parameters. -// -// * Out parameters are typically also returned as return values, so that -// the output of one function may be used as a parameter to another. -// -//=========================================================================== - -//-------------------------- -// 2D Vector -//-------------------------- - -// inline - -float D3DXVec2Length - ( const D3DXVECTOR2 *pV ); - -float D3DXVec2LengthSq - ( const D3DXVECTOR2 *pV ); - -float D3DXVec2Dot - ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -// Z component of ((x1,y1,0) cross (x2,y2,0)) -float D3DXVec2CCW - ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2) -D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2) -D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ); - -D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, float s ); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2, - float s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR2* WINAPI D3DXVec2Normalize - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR2* WINAPI D3DXVec2Hermite - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pT1, - const D3DXVECTOR2 *pV2, const D3DXVECTOR2 *pT2, float s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR2* WINAPI D3DXVec2BaryCentric - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2, - D3DXVECTOR2 *pV3, float f, float g); - -// Transform (x, y, 0, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec2Transform - ( D3DXVECTOR4 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); - -// Transform (x, y, 0, 1) by matrix, project result back into w=1. -D3DXVECTOR2* WINAPI D3DXVec2TransformCoord - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); - -// Transform (x, y, 0, 0) by matrix. -D3DXVECTOR2* WINAPI D3DXVec2TransformNormal - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, const D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 3D Vector -//-------------------------- - -// inline - -float D3DXVec3Length - ( const D3DXVECTOR3 *pV ); - -float D3DXVec3LengthSq - ( const D3DXVECTOR3 *pV ); - -float D3DXVec3Dot - ( const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ); - -D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, float s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, - float s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -D3DXVECTOR3* WINAPI D3DXVec3Normalize - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR3* WINAPI D3DXVec3Hermite - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pT1, - const D3DXVECTOR3 *pV2, const D3DXVECTOR3 *pT2, float s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR3* WINAPI D3DXVec3BaryCentric - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, - const D3DXVECTOR3 *pV3, float f, float g); - -// Transform (x, y, z, 1) by matrix. -D3DXVECTOR4* WINAPI D3DXVec3Transform - ( D3DXVECTOR4 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); - -// Transform (x, y, z, 1) by matrix, project result back into w=1. -D3DXVECTOR3* WINAPI D3DXVec3TransformCoord - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); - -// Transform (x, y, z, 0) by matrix. -D3DXVECTOR3* WINAPI D3DXVec3TransformNormal - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, const D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - - -//-------------------------- -// 4D Vector -//-------------------------- - -// inline - -float D3DXVec4Length - ( const D3DXVECTOR4 *pV ); - -float D3DXVec4LengthSq - ( const D3DXVECTOR4 *pV ); - -float D3DXVec4Dot - ( const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2 ); - -D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); - -// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... -D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); - -// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... -D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2); - -D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV, float s); - -// Linear interpolation. V1 + s(V2-V1) -D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, - float s ); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Cross-product in 4 dimensions. -D3DXVECTOR4* WINAPI D3DXVec4Cross - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, - const D3DXVECTOR4 *pV3); - -D3DXVECTOR4* WINAPI D3DXVec4Normalize - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV ); - -// Hermite interpolation between position V1, tangent T1 (when s == 0) -// and position V2, tangent T2 (when s == 1). -D3DXVECTOR4* WINAPI D3DXVec4Hermite - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pT1, - const D3DXVECTOR4 *pV2, const D3DXVECTOR4 *pT2, float s ); - -// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) -D3DXVECTOR4* WINAPI D3DXVec4BaryCentric - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, - const D3DXVECTOR4 *pV3, float f, float g); - -// Transform vector by matrix. -D3DXVECTOR4* WINAPI D3DXVec4Transform - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV, const D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// 4D Matrix -//-------------------------- - -// inline - -D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ); - -BOOL D3DXMatrixIsIdentity - ( const D3DXMATRIX *pM ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -float WINAPI D3DXMatrixfDeterminant - ( const D3DXMATRIX *pM ); - -// Matrix multiplication. The result represents the transformation M2 -// followed by the transformation M1. (Out = M1 * M2) -D3DXMATRIX* WINAPI D3DXMatrixMultiply - ( D3DXMATRIX *pOut, const D3DXMATRIX *pM1, const D3DXMATRIX *pM2 ); - -D3DXMATRIX* WINAPI D3DXMatrixTranspose - ( D3DXMATRIX *pOut, const D3DXMATRIX *pM ); - -// Calculate inverse of matrix. Inversion my fail, in which case NULL will -// be returned. The determinant of pM is also returned it pfDeterminant -// is non-NULL. -D3DXMATRIX* WINAPI D3DXMatrixInverse - ( D3DXMATRIX *pOut, float *pfDeterminant, const D3DXMATRIX *pM ); - -// Build a matrix which scales by (sx, sy, sz) -D3DXMATRIX* WINAPI D3DXMatrixScaling - ( D3DXMATRIX *pOut, float sx, float sy, float sz ); - -// Build a matrix which translates by (x, y, z) -D3DXMATRIX* WINAPI D3DXMatrixTranslation - ( D3DXMATRIX *pOut, float x, float y, float z ); - -// Build a matrix which rotates around the X axis -D3DXMATRIX* WINAPI D3DXMatrixRotationX - ( D3DXMATRIX *pOut, float angle ); - -// Build a matrix which rotates around the Y axis -D3DXMATRIX* WINAPI D3DXMatrixRotationY - ( D3DXMATRIX *pOut, float angle ); - -// Build a matrix which rotates around the Z axis -D3DXMATRIX* WINAPI D3DXMatrixRotationZ - ( D3DXMATRIX *pOut, float angle ); - -// Build a matrix which rotates around an arbitrary axis -D3DXMATRIX* WINAPI D3DXMatrixRotationAxis - ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pV, float angle ); - -// Build a matrix from a quaternion -D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion - ( D3DXMATRIX *pOut, const D3DXQUATERNION *pQ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll - ( D3DXMATRIX *pOut, float yaw, float pitch, float roll ); - - -// Build transformation matrix. NULL arguments are treated as identity. -// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixTransformation - ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pScalingCenter, - const D3DXQUATERNION *pScalingRotation, const D3DXVECTOR3 *pScaling, - const D3DXVECTOR3 *pRotationCenter, const D3DXQUATERNION *pRotation, - const D3DXVECTOR3 *pTranslation); - -// Build affine transformation matrix. NULL arguments are treated as identity. -// Mout = Ms * Mrc-1 * Mr * Mrc * Mt -D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation - ( D3DXMATRIX *pOut, float Scaling, const D3DXVECTOR3 *pRotationCenter, - const D3DXQUATERNION *pRotation, const D3DXVECTOR3 *pTranslation); - -// Build a lookat matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAt - ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pEye, const D3DXVECTOR3 *pAt, - const D3DXVECTOR3 *pUp ); - -// Build a lookat matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixLookAtLH - ( D3DXMATRIX *pOut, const D3DXVECTOR3 *pEye, const D3DXVECTOR3 *pAt, - const D3DXVECTOR3 *pUp ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspective - ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH - ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFov - ( D3DXMATRIX *pOut, float fovy, float aspect, float zn, float zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH - ( D3DXMATRIX *pOut, float fovy, float aspect, float zn, float zf ); - -// Build a perspective projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenter - ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, - float zf ); - -// Build a perspective projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH - ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, - float zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrtho - ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoLH - ( D3DXMATRIX *pOut, float w, float h, float zn, float zf ); - -// Build an ortho projection matrix. (right-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenter - ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, - float zf ); - -// Build an ortho projection matrix. (left-handed) -D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH - ( D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, - float zf ); - -// Build a matrix which flattens geometry into a plane, as if casting -// a shadow from a light. -D3DXMATRIX* WINAPI D3DXMatrixShadow - ( D3DXMATRIX *pOut, const D3DXVECTOR4 *pLight, - const D3DXPLANE *pPlane ); - -// Build a matrix which reflects the coordinate system about a plane -D3DXMATRIX* WINAPI D3DXMatrixReflect - ( D3DXMATRIX *pOut, const D3DXPLANE *pPlane ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Quaternion -//-------------------------- - -// inline - -float D3DXQuaternionLength - ( const D3DXQUATERNION *pQ ); - -// Length squared, or "norm" -float D3DXQuaternionLengthSq - ( const D3DXQUATERNION *pQ ); - -float D3DXQuaternionDot - ( const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2 ); - -// (0, 0, 0, 1) -D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ); - -BOOL D3DXQuaternionIsIdentity - ( const D3DXQUATERNION *pQ ); - -// (-x, -y, -z, w) -D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); - - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. -void WINAPI D3DXQuaternionToAxisAngle - ( const D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, float *pAngle ); - -// Build a quaternion from a rotation matrix. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix - ( D3DXQUATERNION *pOut, const D3DXMATRIX *pM); - -// Rotation about arbitrary axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis - ( D3DXQUATERNION *pOut, const D3DXVECTOR3 *pV, float angle ); - -// Yaw around the Y axis, a pitch around the X axis, -// and a roll around the Z axis. -D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll - ( D3DXQUATERNION *pOut, float yaw, float pitch, float roll ); - -// Quaternion multiplication. The result represents the rotation Q2 -// followed by the rotation Q1. (Out = Q2 * Q1) -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, - const D3DXQUATERNION *pQ2 ); - -D3DXQUATERNION* WINAPI D3DXQuaternionNormalize - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); - -// Conjugate and re-norm -D3DXQUATERNION* WINAPI D3DXQuaternionInverse - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); - -// Expects unit quaternions. -// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) -D3DXQUATERNION* WINAPI D3DXQuaternionLn - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); - -// Expects pure quaternions. (w == 0) w is ignored in calculation. -// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) -D3DXQUATERNION* WINAPI D3DXQuaternionExp - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ); - -// Spherical linear interpolation between Q1 (s == 0) and Q2 (s == 1). -// Expects unit quaternions. -D3DXQUATERNION* WINAPI D3DXQuaternionSlerp - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, - const D3DXQUATERNION *pQ2, float t ); - -// Spherical quadrangle interpolation. -// Slerp(Slerp(Q1, Q4, t), Slerp(Q2, Q3, t), 2t(1-t)) -D3DXQUATERNION* WINAPI D3DXQuaternionSquad - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, - const D3DXQUATERNION *pQ2, const D3DXQUATERNION *pQ3, - const D3DXQUATERNION *pQ4, float t ); - -// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) -D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ1, - const D3DXQUATERNION *pQ2, const D3DXQUATERNION *pQ3, - float f, float g ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Plane -//-------------------------- - -// inline - -// ax + by + cz + dw -float D3DXPlaneDot - ( const D3DXPLANE *pP, const D3DXVECTOR4 *pV); - -// ax + by + cz + d -float D3DXPlaneDotCoord - ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV); - -// ax + by + cz -float D3DXPlaneDotNormal - ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Normalize plane (so that |a,b,c| == 1) -D3DXPLANE* WINAPI D3DXPlaneNormalize - ( D3DXPLANE *pOut, const D3DXPLANE *pP); - -// Find the intersection between a plane and a line. If the line is -// parallel to the plane, NULL is returned. -D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine - ( D3DXVECTOR3 *pOut, const D3DXPLANE *pP, const D3DXVECTOR3 *pV1, - const D3DXVECTOR3 *pV2); - -// Construct a plane from a point and a normal -D3DXPLANE* WINAPI D3DXPlaneFromPointNormal - ( D3DXPLANE *pOut, const D3DXVECTOR3 *pPoint, const D3DXVECTOR3 *pNormal); - -// Construct a plane from 3 points -D3DXPLANE* WINAPI D3DXPlaneFromPoints - ( D3DXPLANE *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, - const D3DXVECTOR3 *pV3); - -// Transform a plane by a matrix. The vector (a,b,c) must be normal. -// M must be an affine transform. -D3DXPLANE* WINAPI D3DXPlaneTransform - ( D3DXPLANE *pOut, const D3DXPLANE *pP, const D3DXMATRIX *pM ); - -#ifdef __cplusplus -} -#endif - - -//-------------------------- -// Color -//-------------------------- - -// inline - -// (1-r, 1-g, 1-b, a) -D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, const D3DXCOLOR *pC); - -D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); - -D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float s); - -// (r1*r2, g1*g2, b1*b2, a1*a2) -D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2); - -// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) -D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2, float s); - -// non-inline -#ifdef __cplusplus -extern "C" { -#endif - -// Interpolate r,g,b between desaturated color and color. -// DesaturatedColor + s(Color - DesaturatedColor) -D3DXCOLOR* WINAPI D3DXColorAdjustSaturation - (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float s); - -// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) -D3DXCOLOR* WINAPI D3DXColorAdjustContrast - (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float c); - -#ifdef __cplusplus -} -#endif - - - - - - -//=========================================================================== -// -// Matrix Stack -// -//=========================================================================== - -DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) -{ - // - // IUnknown methods - // - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // - // ID3DXMatrixStack methods - // - - // Pops the top of the stack, returns the current top - // *after* popping the top. - STDMETHOD(Pop)(THIS) PURE; - - // Pushes the stack by one, duplicating the current matrix. - STDMETHOD(Push)(THIS) PURE; - - // Loads identity in the current matrix. - STDMETHOD(LoadIdentity)(THIS) PURE; - - // Loads the given matrix into the current matrix - STDMETHOD(LoadMatrix)(THIS_ const D3DXMATRIX* pM ) PURE; - - // Right-Multiplies the given matrix to the current matrix. - // (transformation is about the current world origin) - STDMETHOD(MultMatrix)(THIS_ const D3DXMATRIX* pM ) PURE; - - // Left-Multiplies the given matrix to the current matrix - // (transformation is about the local origin of the object) - STDMETHOD(MultMatrixLocal)(THIS_ const D3DXMATRIX* pM ) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the current world origin) - STDMETHOD(RotateAxis) - (THIS_ const D3DXVECTOR3* pV, float angle) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix, counterclockwise about the given axis with the given angle. - // (rotation is about the local origin of the object) - STDMETHOD(RotateAxisLocal) - (THIS_ const D3DXVECTOR3* pV, float angle) PURE; - - // Right multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // current world origin) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRoll) - (THIS_ float yaw, float pitch, float roll) PURE; - - // Left multiply the current matrix with the computed rotation - // matrix. All angles are counterclockwise. (rotation is about the - // local origin of the object) - - // The rotation is composed of a yaw around the Y axis, a pitch around - // the X axis, and a roll around the Z axis. - STDMETHOD(RotateYawPitchRollLocal) - (THIS_ float yaw, float pitch, float roll) PURE; - - // Right multiply the current matrix with the computed scale - // matrix. (transformation is about the current world origin) - STDMETHOD(Scale)(THIS_ float x, float y, float z) PURE; - - // Left multiply the current matrix with the computed scale - // matrix. (transformation is about the local origin of the object) - STDMETHOD(ScaleLocal)(THIS_ float x, float y, float z) PURE; - - // Right multiply the current matrix with the computed translation - // matrix. (transformation is about the current world origin) - STDMETHOD(Translate)(THIS_ float x, float y, float z ) PURE; - - // Left multiply the current matrix with the computed translation - // matrix. (transformation is about the local origin of the object) - STDMETHOD(TranslateLocal)(THIS_ float x, float y, float z) PURE; - - // Obtain the current matrix at the top of the stack - STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT WINAPI D3DXCreateMatrixStack( DWORD flags, LPD3DXMATRIXSTACK *ppStack ); - -#ifdef __cplusplus -} -#endif - -#include "d3dxmath.inl" - -#pragma warning(default:4201) - -#endif // __D3DXMATH_H__ diff --git a/import/DirectX8/include/d3dxmath.inl b/import/DirectX8/include/d3dxmath.inl deleted file mode 100644 index 05f043197..000000000 --- a/import/DirectX8/include/d3dxmath.inl +++ /dev/null @@ -1,1809 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dxmath.inl -// Content: D3DX math inline functions -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DXMATH_INL__ -#define __D3DXMATH_INL__ - - -//=========================================================================== -// -// Inline Class Methods -// -//=========================================================================== - -#ifdef __cplusplus - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( const float *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; -} - -D3DXINLINE -D3DXVECTOR2::D3DXVECTOR2( float fx, float fy ) -{ - x = fx; - y = fy; -} - -// casting -D3DXINLINE -D3DXVECTOR2::operator float* () -{ - return (float *) &x; -} - -D3DXINLINE -D3DXVECTOR2::operator const float* () const -{ - return (const float *) &x; -} - -// assignment operators -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator += ( const D3DXVECTOR2& v ) -{ - x += v.x; - y += v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator -= ( const D3DXVECTOR2& v ) -{ - x -= v.x; - y -= v.y; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator *= ( float f ) -{ - x *= f; - y *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR2& -D3DXVECTOR2::operator /= ( float f ) -{ - float fInv = 1.0f / f; - x *= fInv; - y *= fInv; - return *this; -} - -// unary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - () const -{ - return D3DXVECTOR2(-x, -y); -} - -// binary operators -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator + ( const D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x + v.x, y + v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator - ( const D3DXVECTOR2& v ) const -{ - return D3DXVECTOR2(x - v.x, y - v.y); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator * ( float f ) const -{ - return D3DXVECTOR2(x * f, y * f); -} - -D3DXINLINE D3DXVECTOR2 -D3DXVECTOR2::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXVECTOR2(x * fInv, y * fInv); -} - - -D3DXINLINE D3DXVECTOR2 -operator * ( float f, const D3DXVECTOR2& v ) -{ - return D3DXVECTOR2(f * v.x, f * v.y); -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator == ( const D3DXVECTOR2& v ) const -{ - return x == v.x && y == v.y; -} - -D3DXINLINE BOOL -D3DXVECTOR2::operator != ( const D3DXVECTOR2& v ) const -{ - return x != v.x || y != v.y; -} - - - - -//-------------------------- -// 3D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( const float *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( const D3DVECTOR& v ) -{ - x = v.x; - y = v.y; - z = v.z; -} - -D3DXINLINE -D3DXVECTOR3::D3DXVECTOR3( float fx, float fy, float fz ) -{ - x = fx; - y = fy; - z = fz; -} - - -// casting -D3DXINLINE -D3DXVECTOR3::operator float* () -{ - return (float *) &x; -} - -D3DXINLINE -D3DXVECTOR3::operator const float* () const -{ - return (const float *) &x; -} - - -D3DXINLINE -D3DXVECTOR3::operator D3DVECTOR* () -{ - return (D3DVECTOR *) &x; -} - -D3DXINLINE -D3DXVECTOR3::operator const D3DVECTOR* () const -{ - return (const D3DVECTOR *) &x; -} - - -D3DXINLINE -D3DXVECTOR3::operator D3DVECTOR& () -{ - return *((D3DVECTOR *) &x); -} - -D3DXINLINE -D3DXVECTOR3::operator const D3DVECTOR& () const -{ - return *((const D3DVECTOR *) &x); -} - - -// assignment operators -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator += ( const D3DXVECTOR3& v ) -{ - x += v.x; - y += v.y; - z += v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator -= ( const D3DXVECTOR3& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator *= ( float f ) -{ - x *= f; - y *= f; - z *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR3& -D3DXVECTOR3::operator /= ( float f ) -{ - float fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - () const -{ - return D3DXVECTOR3(-x, -y, -z); -} - - -// binary operators -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator + ( const D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator - ( const D3DXVECTOR3& v ) const -{ - return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator * ( float f ) const -{ - return D3DXVECTOR3(x * f, y * f, z * f); -} - -D3DXINLINE D3DXVECTOR3 -D3DXVECTOR3::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); -} - - -D3DXINLINE D3DXVECTOR3 -operator * ( float f, const struct D3DXVECTOR3& v ) -{ - return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); -} - - -D3DXINLINE BOOL -D3DXVECTOR3::operator == ( const D3DXVECTOR3& v ) const -{ - return x == v.x && y == v.y && z == v.z; -} - -D3DXINLINE BOOL -D3DXVECTOR3::operator != ( const D3DXVECTOR3& v ) const -{ - return x != v.x || y != v.y || z != v.z; -} - - - -//-------------------------- -// 4D Vector -//-------------------------- -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( const float *pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXVECTOR4::D3DXVECTOR4( float fx, float fy, float fz, float fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXVECTOR4::operator float* () -{ - return (float *) &x; -} - -D3DXINLINE -D3DXVECTOR4::operator const float* () const -{ - return (const float *) &x; -} - - -// assignment operators -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator += ( const D3DXVECTOR4& v ) -{ - x += v.x; - y += v.y; - z += v.z; - w += v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator -= ( const D3DXVECTOR4& v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; - w -= v.w; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator *= ( float f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXVECTOR4& -D3DXVECTOR4::operator /= ( float f ) -{ - float fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - () const -{ - return D3DXVECTOR4(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator + ( const D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator - ( const D3DXVECTOR4& v ) const -{ - return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator * ( float f ) const -{ - return D3DXVECTOR4(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXVECTOR4 -D3DXVECTOR4::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); -} - - -D3DXINLINE D3DXVECTOR4 -operator * ( float f, const D3DXVECTOR4& v ) -{ - return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); -} - - -D3DXINLINE BOOL -D3DXVECTOR4::operator == ( const D3DXVECTOR4& v ) const -{ - return x == v.x && y == v.y && z == v.z && w == v.w; -} - -D3DXINLINE BOOL -D3DXVECTOR4::operator != ( const D3DXVECTOR4& v ) const -{ - return x != v.x || y != v.y || z != v.z || w != v.w; -} - - -//-------------------------- -// Matrix -//-------------------------- -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( const float* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - memcpy(&m00, pf, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( const D3DMATRIX& mat ) -{ - memcpy(&m00, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE -D3DXMATRIX::D3DXMATRIX( float f00, float f01, float f02, float f03, - float f10, float f11, float f12, float f13, - float f20, float f21, float f22, float f23, - float f30, float f31, float f32, float f33 ) -{ - m00 = f00; m01 = f01; m02 = f02; m03 = f03; - m10 = f10; m11 = f11; m12 = f12; m13 = f13; - m20 = f20; m21 = f21; m22 = f22; m23 = f23; - m30 = f30; m31 = f31; m32 = f32; m33 = f33; -} - - - -// access grants -D3DXINLINE float& -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) -{ - return m[iRow][iCol]; -} - -D3DXINLINE float -D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const -{ - return m[iRow][iCol]; -} - - -// casting operators -D3DXINLINE -D3DXMATRIX::operator float* () -{ - return (float *) &m00; -} - -D3DXINLINE -D3DXMATRIX::operator const float* () const -{ - return (const float *) &m00; -} - - -D3DXINLINE -D3DXMATRIX::operator D3DMATRIX* () -{ - return (D3DMATRIX *) &m00; -} - -D3DXINLINE -D3DXMATRIX::operator const D3DMATRIX* () const -{ - return (const D3DMATRIX *) &m00; -} - - -D3DXINLINE -D3DXMATRIX::operator D3DMATRIX& () -{ - return *((D3DMATRIX *) &m00); -} - -D3DXINLINE -D3DXMATRIX::operator const D3DMATRIX& () const -{ - return *((const D3DMATRIX *) &m00); -} - - -// assignment operators -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( const D3DXMATRIX& mat ) -{ - D3DXMatrixMultiply(this, this, &mat); - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator += ( const D3DXMATRIX& mat ) -{ - m00 += mat.m00; m01 += mat.m01; m02 += mat.m02; m03 += mat.m03; - m10 += mat.m10; m11 += mat.m11; m12 += mat.m12; m13 += mat.m13; - m20 += mat.m20; m21 += mat.m21; m22 += mat.m22; m23 += mat.m23; - m30 += mat.m30; m31 += mat.m31; m32 += mat.m32; m33 += mat.m33; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator -= ( const D3DXMATRIX& mat ) -{ - m00 -= mat.m00; m01 -= mat.m01; m02 -= mat.m02; m03 -= mat.m03; - m10 -= mat.m10; m11 -= mat.m11; m12 -= mat.m12; m13 -= mat.m13; - m20 -= mat.m20; m21 -= mat.m21; m22 -= mat.m22; m23 -= mat.m23; - m30 -= mat.m30; m31 -= mat.m31; m32 -= mat.m32; m33 -= mat.m33; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator *= ( float f ) -{ - m00 *= f; m01 *= f; m02 *= f; m03 *= f; - m10 *= f; m11 *= f; m12 *= f; m13 *= f; - m20 *= f; m21 *= f; m22 *= f; m23 *= f; - m30 *= f; m31 *= f; m32 *= f; m33 *= f; - return *this; -} - -D3DXINLINE D3DXMATRIX& -D3DXMATRIX::operator /= ( float f ) -{ - float fInv = 1.0f / f; - m00 *= fInv; m01 *= fInv; m02 *= fInv; m03 *= fInv; - m10 *= fInv; m11 *= fInv; m12 *= fInv; m13 *= fInv; - m20 *= fInv; m21 *= fInv; m22 *= fInv; m23 *= fInv; - m30 *= fInv; m31 *= fInv; m32 *= fInv; m33 *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - () const -{ - return D3DXMATRIX(-m00, -m01, -m02, -m03, - -m10, -m11, -m12, -m13, - -m20, -m21, -m22, -m23, - -m30, -m31, -m32, -m33); -} - - -// binary operators -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( const D3DXMATRIX& mat ) const -{ - D3DXMATRIX matT; - D3DXMatrixMultiply(&matT, this, &mat); - return matT; -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator + ( const D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(m00 + mat.m00, m01 + mat.m01, m02 + mat.m02, m03 + mat.m03, - m10 + mat.m10, m11 + mat.m11, m12 + mat.m12, m13 + mat.m13, - m20 + mat.m20, m21 + mat.m21, m22 + mat.m22, m23 + mat.m23, - m30 + mat.m30, m31 + mat.m31, m32 + mat.m32, m33 + mat.m33); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator - ( const D3DXMATRIX& mat ) const -{ - return D3DXMATRIX(m00 - mat.m00, m01 - mat.m01, m02 - mat.m02, m03 - mat.m03, - m10 - mat.m10, m11 - mat.m11, m12 - mat.m12, m13 - mat.m13, - m20 - mat.m20, m21 - mat.m21, m22 - mat.m22, m23 - mat.m23, - m30 - mat.m30, m31 - mat.m31, m32 - mat.m32, m33 - mat.m33); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator * ( float f ) const -{ - return D3DXMATRIX(m00 * f, m01 * f, m02 * f, m03 * f, - m10 * f, m11 * f, m12 * f, m13 * f, - m20 * f, m21 * f, m22 * f, m23 * f, - m30 * f, m31 * f, m32 * f, m33 * f); -} - -D3DXINLINE D3DXMATRIX -D3DXMATRIX::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXMATRIX(m00 * fInv, m01 * fInv, m02 * fInv, m03 * fInv, - m10 * fInv, m11 * fInv, m12 * fInv, m13 * fInv, - m20 * fInv, m21 * fInv, m22 * fInv, m23 * fInv, - m30 * fInv, m31 * fInv, m32 * fInv, m33 * fInv); -} - - -D3DXINLINE D3DXMATRIX -operator * ( float f, const D3DXMATRIX& mat ) -{ - return D3DXMATRIX(f * mat.m00, f * mat.m01, f * mat.m02, f * mat.m03, - f * mat.m10, f * mat.m11, f * mat.m12, f * mat.m13, - f * mat.m20, f * mat.m21, f * mat.m22, f * mat.m23, - f * mat.m30, f * mat.m31, f * mat.m32, f * mat.m33); -} - - -D3DXINLINE BOOL -D3DXMATRIX::operator == ( const D3DXMATRIX& mat ) const -{ - return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - -D3DXINLINE BOOL -D3DXMATRIX::operator != ( const D3DXMATRIX& mat ) const -{ - return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); -} - - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( const float* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - x = pf[0]; - y = pf[1]; - z = pf[2]; - w = pf[3]; -} - -D3DXINLINE -D3DXQUATERNION::D3DXQUATERNION( float fx, float fy, float fz, float fw ) -{ - x = fx; - y = fy; - z = fz; - w = fw; -} - - -// casting -D3DXINLINE -D3DXQUATERNION::operator float* () -{ - return (float *) &x; -} - -D3DXINLINE -D3DXQUATERNION::operator const float* () const -{ - return (const float *) &x; -} - - -// assignment operators -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator += ( const D3DXQUATERNION& q ) -{ - x += q.x; - y += q.y; - z += q.z; - w += q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator -= ( const D3DXQUATERNION& q ) -{ - x -= q.x; - y -= q.y; - z -= q.z; - w -= q.w; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( const D3DXQUATERNION& q ) -{ - D3DXQuaternionMultiply(this, this, &q); - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator *= ( float f ) -{ - x *= f; - y *= f; - z *= f; - w *= f; - return *this; -} - -D3DXINLINE D3DXQUATERNION& -D3DXQUATERNION::operator /= ( float f ) -{ - float fInv = 1.0f / f; - x *= fInv; - y *= fInv; - z *= fInv; - w *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - () const -{ - return D3DXQUATERNION(-x, -y, -z, -w); -} - - -// binary operators -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator + ( const D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator - ( const D3DXQUATERNION& q ) const -{ - return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( const D3DXQUATERNION& q ) const -{ - D3DXQUATERNION qT; - D3DXQuaternionMultiply(&qT, this, &q); - return qT; -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator * ( float f ) const -{ - return D3DXQUATERNION(x * f, y * f, z * f, w * f); -} - -D3DXINLINE D3DXQUATERNION -D3DXQUATERNION::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); -} - - -D3DXINLINE D3DXQUATERNION -operator * (float f, const D3DXQUATERNION& q ) -{ - return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); -} - - -D3DXINLINE BOOL -D3DXQUATERNION::operator == ( const D3DXQUATERNION& q ) const -{ - return x == q.x && y == q.y && z == q.z && w == q.w; -} - -D3DXINLINE BOOL -D3DXQUATERNION::operator != ( const D3DXQUATERNION& q ) const -{ - return x != q.x || y != q.y || z != q.z || w != q.w; -} - - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE -D3DXPLANE::D3DXPLANE( const float* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - a = pf[0]; - b = pf[1]; - c = pf[2]; - d = pf[3]; -} - -D3DXINLINE -D3DXPLANE::D3DXPLANE( float fa, float fb, float fc, float fd ) -{ - a = fa; - b = fb; - c = fc; - d = fd; -} - - -// casting -D3DXINLINE -D3DXPLANE::operator float* () -{ - return (float *) &a; -} - -D3DXINLINE -D3DXPLANE::operator const float* () const -{ - return (const float *) &a; -} - - -// unary operators -D3DXINLINE D3DXPLANE -D3DXPLANE::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXPLANE -D3DXPLANE::operator - () const -{ - return D3DXPLANE(-a, -b, -c, -d); -} - - -// binary operators -D3DXINLINE BOOL -D3DXPLANE::operator == ( const D3DXPLANE& p ) const -{ - return a == p.a && b == p.b && c == p.c && d == p.d; -} - -D3DXINLINE BOOL -D3DXPLANE::operator != ( const D3DXPLANE& p ) const -{ - return a != p.a || b != p.b || c != p.c || d != p.d; -} - - - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( DWORD dw ) -{ - const float f = 1.0f / 255.0f; - r = f * (float) (unsigned char) (dw >> 16); - g = f * (float) (unsigned char) (dw >> 8); - b = f * (float) (unsigned char) (dw >> 0); - a = f * (float) (unsigned char) (dw >> 24); -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( const float* pf ) -{ -#ifdef D3DX_DEBUG - if(!pf) - return; -#endif - - r = pf[0]; - g = pf[1]; - b = pf[2]; - a = pf[3]; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( const D3DCOLORVALUE& c ) -{ - r = c.r; - g = c.g; - b = c.b; - a = c.a; -} - -D3DXINLINE -D3DXCOLOR::D3DXCOLOR( float fr, float fg, float fb, float fa ) -{ - r = fr; - g = fg; - b = fb; - a = fa; -} - - -// casting -D3DXINLINE -D3DXCOLOR::operator DWORD () const -{ - DWORD dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD) (r * 255.0f + 0.5f); - DWORD dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD) (g * 255.0f + 0.5f); - DWORD dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD) (b * 255.0f + 0.5f); - DWORD dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD) (a * 255.0f + 0.5f); - - return (dwA << 24) | (dwR << 16) | (dwG << 8) | dwB; -} - - -D3DXINLINE -D3DXCOLOR::operator float * () -{ - return (float *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator const float * () const -{ - return (const float *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE * () -{ - return (D3DCOLORVALUE *) &r; -} - -D3DXINLINE -D3DXCOLOR::operator const D3DCOLORVALUE * () const -{ - return (const D3DCOLORVALUE *) &r; -} - - -D3DXINLINE -D3DXCOLOR::operator D3DCOLORVALUE& () -{ - return *((D3DCOLORVALUE *) &r); -} - -D3DXINLINE -D3DXCOLOR::operator const D3DCOLORVALUE& () const -{ - return *((const D3DCOLORVALUE *) &r); -} - - -// assignment operators -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator += ( const D3DXCOLOR& c ) -{ - r += c.r; - g += c.g; - b += c.b; - a += c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator -= ( const D3DXCOLOR& c ) -{ - r -= c.r; - g -= c.g; - b -= c.b; - a -= c.a; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator *= ( float f ) -{ - r *= f; - g *= f; - b *= f; - a *= f; - return *this; -} - -D3DXINLINE D3DXCOLOR& -D3DXCOLOR::operator /= ( float f ) -{ - float fInv = 1.0f / f; - r *= fInv; - g *= fInv; - b *= fInv; - a *= fInv; - return *this; -} - - -// unary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + () const -{ - return *this; -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - () const -{ - return D3DXCOLOR(-r, -g, -b, -a); -} - - -// binary operators -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator + ( const D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator - ( const D3DXCOLOR& c ) const -{ - return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator * ( float f ) const -{ - return D3DXCOLOR(r * f, g * f, b * f, a * f); -} - -D3DXINLINE D3DXCOLOR -D3DXCOLOR::operator / ( float f ) const -{ - float fInv = 1.0f / f; - return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); -} - - -D3DXINLINE D3DXCOLOR -operator * (float f, const D3DXCOLOR& c ) -{ - return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); -} - - -D3DXINLINE BOOL -D3DXCOLOR::operator == ( const D3DXCOLOR& c ) const -{ - return r == c.r && g == c.g && b == c.b && a == c.a; -} - -D3DXINLINE BOOL -D3DXCOLOR::operator != ( const D3DXCOLOR& c ) const -{ - return r != c.r || g != c.g || b != c.b || a != c.a; -} - - -#endif //__cplusplus - - - -//=========================================================================== -// -// Inline functions -// -//=========================================================================== - - -//-------------------------- -// 2D Vector -//-------------------------- - -D3DXINLINE float D3DXVec2Length - ( const D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y); -#else - return (float) sqrt(pV->x * pV->x + pV->y * pV->y); -#endif -} - -D3DXINLINE float D3DXVec2LengthSq - ( const D3DXVECTOR2 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y; -} - -D3DXINLINE float D3DXVec2Dot - ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y; -} - -D3DXINLINE float D3DXVec2CCW - ( const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->y - pV1->y * pV2->x; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Add - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Scale - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV, float s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp - ( D3DXVECTOR2 *pOut, const D3DXVECTOR2 *pV1, const D3DXVECTOR2 *pV2, - float s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - return pOut; -} - - -//-------------------------- -// 3D Vector -//-------------------------- - -D3DXINLINE float D3DXVec3Length - ( const D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#else - return (float) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); -#endif -} - -D3DXINLINE float D3DXVec3LengthSq - ( const D3DXVECTOR3 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; -} - -D3DXINLINE float D3DXVec3Dot - ( const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Cross - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ - D3DXVECTOR3 v; - -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - v.x = pV1->y * pV2->z - pV1->z * pV2->y; - v.y = pV1->z * pV2->x - pV1->x * pV2->z; - v.z = pV1->x * pV2->y - pV1->y * pV2->x; - - *pOut = v; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Add - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Subtract - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Minimize - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Maximize - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Scale - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV, float s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR3* D3DXVec3Lerp - ( D3DXVECTOR3 *pOut, const D3DXVECTOR3 *pV1, const D3DXVECTOR3 *pV2, - float s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - return pOut; -} - - -//-------------------------- -// 4D Vector -//-------------------------- - -D3DXINLINE float D3DXVec4Length - ( const D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#else - return (float) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); -#endif -} - -D3DXINLINE float D3DXVec4LengthSq - ( const D3DXVECTOR4 *pV ) -{ -#ifdef D3DX_DEBUG - if(!pV) - return 0.0f; -#endif - - return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; -} - -D3DXINLINE float D3DXVec4Dot - ( const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2 ) -{ -#ifdef D3DX_DEBUG - if(!pV1 || !pV2) - return 0.0f; -#endif - - return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Add - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + pV2->x; - pOut->y = pV1->y + pV2->y; - pOut->z = pV1->z + pV2->z; - pOut->w = pV1->w + pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Subtract - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x - pV2->x; - pOut->y = pV1->y - pV2->y; - pOut->z = pV1->z - pV2->z; - pOut->w = pV1->w - pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Minimize - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Maximize - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; - pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; - pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; - pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Scale - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV, float s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV) - return NULL; -#endif - - pOut->x = pV->x * s; - pOut->y = pV->y * s; - pOut->z = pV->z * s; - pOut->w = pV->w * s; - return pOut; -} - -D3DXINLINE D3DXVECTOR4* D3DXVec4Lerp - ( D3DXVECTOR4 *pOut, const D3DXVECTOR4 *pV1, const D3DXVECTOR4 *pV2, - float s ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pV1 || !pV2) - return NULL; -#endif - - pOut->x = pV1->x + s * (pV2->x - pV1->x); - pOut->y = pV1->y + s * (pV2->y - pV1->y); - pOut->z = pV1->z + s * (pV2->z - pV1->z); - pOut->w = pV1->w + s * (pV2->w - pV1->w); - return pOut; -} - - -//-------------------------- -// 4D Matrix -//-------------------------- - -D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity - ( D3DXMATRIX *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = - pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = - pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = - pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; - - pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; - return pOut; -} - - -D3DXINLINE BOOL D3DXMatrixIsIdentity - ( const D3DXMATRIX *pM ) -{ -#ifdef D3DX_DEBUG - if(!pM) - return FALSE; -#endif - - return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && - pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && - pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && - pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; -} - - -//-------------------------- -// Quaternion -//-------------------------- - -D3DXINLINE float D3DXQuaternionLength - ( const D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - -#ifdef __cplusplus - return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#else - return (float) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); -#endif -} - -D3DXINLINE float D3DXQuaternionLengthSq - ( const D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return 0.0f; -#endif - - return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; -} - -D3DXINLINE float D3DXQuaternionDot - ( const D3DXQUATERNION *pQ1, const D3DXQUATERNION *pQ2 ) -{ -#ifdef D3DX_DEBUG - if(!pQ1 || !pQ2) - return 0.0f; -#endif - - return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionIdentity - ( D3DXQUATERNION *pOut ) -{ -#ifdef D3DX_DEBUG - if(!pOut) - return NULL; -#endif - - pOut->x = pOut->y = pOut->z = 0.0f; - pOut->w = 1.0f; - return pOut; -} - -D3DXINLINE BOOL D3DXQuaternionIsIdentity - ( const D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pQ) - return FALSE; -#endif - - return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; -} - - -D3DXINLINE D3DXQUATERNION* D3DXQuaternionConjugate - ( D3DXQUATERNION *pOut, const D3DXQUATERNION *pQ ) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pQ) - return NULL; -#endif - - pOut->x = -pQ->x; - pOut->y = -pQ->y; - pOut->z = -pQ->z; - pOut->w = pQ->w; - return pOut; -} - - -//-------------------------- -// Plane -//-------------------------- - -D3DXINLINE float D3DXPlaneDot - ( const D3DXPLANE *pP, const D3DXVECTOR4 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; -} - -D3DXINLINE float D3DXPlaneDotCoord - ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; -} - -D3DXINLINE float D3DXPlaneDotNormal - ( const D3DXPLANE *pP, const D3DXVECTOR3 *pV) -{ -#ifdef D3DX_DEBUG - if(!pP || !pV) - return 0.0f; -#endif - - return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; -} - - -//-------------------------- -// Color -//-------------------------- - -D3DXINLINE D3DXCOLOR* D3DXColorNegative - (D3DXCOLOR *pOut, const D3DXCOLOR *pC) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = 1.0f - pC->r; - pOut->g = 1.0f - pC->g; - pOut->b = 1.0f - pC->b; - pOut->a = pC->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorAdd - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + pC2->r; - pOut->g = pC1->g + pC2->g; - pOut->b = pC1->b + pC2->b; - pOut->a = pC1->a + pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorSubtract - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r - pC2->r; - pOut->g = pC1->g - pC2->g; - pOut->b = pC1->b - pC2->b; - pOut->a = pC1->a - pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorScale - (D3DXCOLOR *pOut, const D3DXCOLOR *pC, float s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC) - return NULL; -#endif - - pOut->r = pC->r * s; - pOut->g = pC->g * s; - pOut->b = pC->b * s; - pOut->a = pC->a * s; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorModulate - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r * pC2->r; - pOut->g = pC1->g * pC2->g; - pOut->b = pC1->b * pC2->b; - pOut->a = pC1->a * pC2->a; - return pOut; -} - -D3DXINLINE D3DXCOLOR* D3DXColorLerp - (D3DXCOLOR *pOut, const D3DXCOLOR *pC1, const D3DXCOLOR *pC2, float s) -{ -#ifdef D3DX_DEBUG - if(!pOut || !pC1 || !pC2) - return NULL; -#endif - - pOut->r = pC1->r + s * (pC2->r - pC1->r); - pOut->g = pC1->g + s * (pC2->g - pC1->g); - pOut->b = pC1->b + s * (pC2->b - pC1->b); - pOut->a = pC1->a + s * (pC2->a - pC1->a); - return pOut; -} - - -#endif // __D3DXMATH_INL__ diff --git a/import/DirectX8/include/d3dxshapes.h b/import/DirectX8/include/d3dxshapes.h deleted file mode 100644 index 765c59f52..000000000 --- a/import/DirectX8/include/d3dxshapes.h +++ /dev/null @@ -1,209 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dxshapes.h -// Content: D3DX simple shapes -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DXSHAPES_H__ -#define __D3DXSHAPES_H__ - -#include -#include -#include "d3dxerr.h" - - -typedef struct ID3DXSimpleShape *LPD3DXSIMPLESHAPE; - -// {CFCD4602-EB7B-11d2-A440-00A0C90629A8} -DEFINE_GUID( IID_ID3DXSimpleShape, -0xcfcd4602, 0xeb7b, 0x11d2, 0xa4, 0x40, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8 ); - - -/////////////////////////////////////////////////////////////////////////// -// Interfaces: -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// ID3DXSimpleShape interface: -//------------------------------------------------------------------------- - -DECLARE_INTERFACE_(ID3DXSimpleShape, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // ID3DXSimpleShape methods - STDMETHOD_(LPDIRECT3DVERTEXBUFFER7, GetVB)(THIS) PURE; - STDMETHOD_(DWORD, GetIndices)(THIS_ LPWORD *ppIndices) PURE; - STDMETHOD(Draw)(THIS) PURE; -}; - - - -/////////////////////////////////////////////////////////////////////////// -// Functions: -/////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - - -//------------------------------------------------------------------------- -// D3DXCreatePolygon: Creates an 'n' sided polygon using the device -// ---------------- specified. It returns a vertex buffer that can be used -// for drawing or manipulation by the program later on. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] float sideSize: Length of a side. -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. (Default is 1) -// D3DX_DEFAULT is a valid input. -// [out] IDirect3DVertexBuffer7** ppVB: The output shape interface. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreatePolygon(LPDIRECT3DDEVICE7 pDevice, - float sideSize, - DWORD numSides, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape ); - -//------------------------------------------------------------------------- -// D3DXCreateBox: Creates a box (cuboid) of given dimensions using the -// ------------ device. It returns a vertex buffer that can -// be used for drawing or manipulation by the program later on. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] float width: Width of the box (along x-axis) -// [in] float height: Height of the box (along y-axis) -// [in] float depth: Depth of the box (along z-axis) -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. Default is 1. -// D3DX_DEFAULT is a valid input here. -// [out] LPD3DXSIMPLESHAPE* ppShape: The output vertex-buffer. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateBox(LPDIRECT3DDEVICE7 pDevice, - float width, - float height, - float depth, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape ); - -//------------------------------------------------------------------------- -// D3DXCreateCylinder: Creates a cylinder of given dimensions using the -// ----------------- device. It returns a vertex buffer that -// can be used for drawing or manipulation by the program -// later on. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] float baseRadius: Base-radius (default is 1.0f, shd be >= 0.0f) -// [in] float topRadius: Top-radius (default is 1.0f, shd be >= 0.0f) -// [in] float height: Height (default is 1.0f, shd be >= 0.0f) -// [in] DWORD numSlices: Number of slices about the main axis. -// (default is 8) D3DX_DEFAULT is a valid input. -// [in] DWORD numStacks: Number of stacks along the main axis. -// (default is 8) D3DX_DEFAULT is a valid input. -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. Default is 1. -// D3DX_DEFAULT is a valid input here. -// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateCylinder(LPDIRECT3DDEVICE7 pDevice, - float baseRadius, - float topRadius, - float height, - DWORD numSlices, - DWORD numStacks, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape ); - - -//------------------------------------------------------------------------- -// D3DXCreateTorus: Creates a torus of given dimensions using the -// -------------- device specified. It returns a vertex buffer that can -// be used for drawing or manipulation by the program later -// on. It draws a doughnut, centered at (0, 0, 0) whose axis -// is aligned with the z-axis. With the innerRadius used -// as the radius of the cross-section (minor-Radius) and -// the outerRadius used as the radius of the central 'hole'. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] float innerRadius: inner radius (default is 1.0f, shd be >= 0.0f) -// [in] float outerRadius: outer radius (default is 2.0f, shd be >= 0.0f) -// [in] DWORD numSides: Number of sides in the cross-section -// (default is 8). D3DX_DEFAULT is a valid input. -// [in] DWORD numRings: Number of rings making up the torus -// (default is 8) D3DX_DEFAULT is a valid input. -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. Default is 1. -// D3DX_DEFAULT is a valid input here. -// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTorus(LPDIRECT3DDEVICE7 pDevice, - float innerRadius, - float outerRadius, - DWORD numSides, - DWORD numRings, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape ); - -//------------------------------------------------------------------------- -// D3DXCreateTeapot: Creates a teapot using the device specified. -// ---------------- It returns a vertex buffer that can be used for -// drawing or manipulation by the program later on. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. Default is 1. -// D3DX_DEFAULT is a valid input here. -// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateTeapot(LPDIRECT3DDEVICE7 pDevice, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape); - -//------------------------------------------------------------------------- -// D3DXCreateSphere: Creates a cylinder of given dimensions using the -// ---------------- device specified. -// It returns a vertex buffer that can be used for -// drawing or manipulation by the program later on. -// -// Params: -// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off. -// [in] float radius: radius (default is 1.0f, shd be >= 0.0f) -// [in] float height: Height (default is 1.0f, shd be >= 0.0f) -// [in] DWORD numSlices: Number of slices about the main axis -// (default is 8) D3DX_DEFAULT is a valid input. -// [in] DWORD numStacks: Number of stacks along the main axis -// (default is 8) D3DX_DEFAULT is a valid input. -// [in] DWORD numTexCoords: The number of texture coordinates desired -// in the vertex-buffer. Default is 1. -// D3DX_DEFAULT is a valid input here. -// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface. -//------------------------------------------------------------------------- -HRESULT WINAPI - D3DXCreateSphere(LPDIRECT3DDEVICE7 pDevice, - float radius, - DWORD numSlices, - DWORD numStacks, - DWORD numTexCoords, - LPD3DXSIMPLESHAPE* ppShape); - -#ifdef __cplusplus -} -#endif //__cplusplus -#endif //__D3DXSHAPES_H__ diff --git a/import/DirectX8/include/d3dxsprite.h b/import/DirectX8/include/d3dxsprite.h deleted file mode 100644 index a08b4a99c..000000000 --- a/import/DirectX8/include/d3dxsprite.h +++ /dev/null @@ -1,321 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dxsprite.h -// Content: D3DX sprite helper functions -// -// These functions allow you to use sprites with D3DX. A "sprite" is -// loosely defined as a 2D image that you want to transfer to the -// rendering target. The source image can be a texture created -// with the help of the D3DX texture loader; though advanced users may -// want to create their own. A helper function (PrepareDeviceForSprite) -// is provided to make it easy to set up render states on a device. -// (Again, advanced users can use their own created devices.) -// -// There are two general techniques for sprites; the simpler one just -// specifies a destination rectangle and a rotation anlge. A more -// powerful technique supports rendering to non-rectangular quads. -// -// Both techniques support clipping, alpha, and rotation. More -// details are below. -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef __D3DXSPRITE_H__ -#define __D3DXSPRITE_H__ - -#include -#include -#include "d3dxerr.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -//------------------------------------------------------------------------- -// D3DXPrepareDeviceForSprite: -// -// Call this function to set up all the render states necessary for -// BltSprite/WarpSprite to work correctly. (Advanced users may opt to -// not call this function first; in which case Blt/WarpSprite functions -// will use whatever render/texture states were set up on the device when -// they are called.) -// -// Warning: This function modifies render states and may impact performance -// negatively on some 3D hardware if it is called too often per frame. -// -// Warning: If the render state changes (other than through calls to -// BltSprite or WarpSprite), you will need to call this function again before -// calling BltSprite or WarpSprite. -// -// Details: This function modifies the the rendering first texture stage and -// it modifies some renderstates for the entire device. Here is the exact -// list: -// -// SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); -// SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); -// SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); -// SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); -// SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); -// SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_LINEAR); -// SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); -// -// SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); -// SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); -// SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); -// -// Depending on the value of ZEnable parameter, this function will -// will either call -// SetRenderState(D3DRENDERSTATE_ZENABLE, FALSE); -// - or - -// SetRenderState(D3DRENDERSTATE_ZENABLE, TRUE); -// -// Parameters: -// pd3dDevice - a pointer to the d3d device that you wish to prepare -// for use with D3DX Sprite Services -// ZEnable - a flag indicating whether you want the sprites to -// check and update the Z buffer as part of rendering. -// If ZEnable is FALSE, OR you are using -// alpha-blending, then it is necessary to render your -// sprites from back-to-front. -// -//------------------------------------------------------------------------- - -#ifdef __cplusplus -HRESULT WINAPI - D3DXPrepareDeviceForSprite( LPDIRECT3DDEVICE7 pd3dDevice, - BOOL ZEnable = FALSE); -#else -HRESULT WINAPI - D3DXPrepareDeviceForSprite( LPDIRECT3DDEVICE7 pd3dDevice, - BOOL ZEnable); -#endif - - - -//------------------------------------------------------------------------- -// The D3DXDrawBasicSprite() function performs blitting of source images onto -// a 3D rendering device. This function only calls SetTexture on the first -// renderstage with the parameter (pd3dTexture) if that parameter is non-null. -// This function assumes that D3DXPrepareDeviceForSprite has been called on -// the device or that caller has in some other way correctly prepared the -// renderstates. -// -// This function supports scaling, rotations, alpha-blending, and choosing -// a source sub-rect. -// -// Rotation angle is specified in radians. Both rotations and scales -// are applied around the center of the sprite; where the center of the -// sprite is half the width/height of the sprite, plus the offset parameter. -// -// Use the offset parameter if you want the sprite's center to be something -// other than the image center. -// -// The destination point indicates where you would like the center of -// the sprite to draw to. -// -// Parameters: -// pd3dTexture - a pointer to the surface containing the texture -// pd3dDevice - a pointer to the d3d device to render to. It is -// assumed that render states are set up. (See -// D3DXPrepareDeviceForSprite) -// ppointDest - a pointer to the target point for the sprite. The -// components of the vector must be in screen -// space. -// alpha - alpha value to apply to sprite. 1.0 means totally -// opaque; and 0.0 means totally transparent. -// WARNING: If you are using alpha, then you should render -// from back to front in order to avoid rendering -// artifacts. -// angleRad - angle of rotation around the 'center' of the rect -// scale - a uniform scale that is applied to the source rect -// to specify the size of the image that is rendered -// pOffset - offset from the center of the source rect to use as the -// center of rotation -// pSourceRect - a rect that indicates what portion of the source -// source texture to use. If NULL is passed, then the -// entire source is used. If the source texture was -// created via D3DX, then the rect should be specified -// in the coordinates of the original image (so that you -// don't have to worry about stretching/scaling that D3DX -// may have done to make the image work with your current -// 3D Device.) Note that horizontal or vertical mirroring -// may be simply accomplished by swapping the left/right -// or top/bottom fields of this RECT. -//------------------------------------------------------------------------- - -#ifdef __cplusplus -HRESULT WINAPI - D3DXDrawSpriteSimple(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - const D3DXVECTOR3 *ppointDest, - float alpha = 1.0f, - float scale = 1.0f, - float angleRad = 0.0f, - const D3DXVECTOR2 *pOffset = NULL, - const RECT *pSourceRect = NULL); -#else -HRESULT WINAPI - D3DXDrawSpriteSimple(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - D3DXVECTOR3 *ppointDest, - float alpha, - float scale, - float angleRad, - D3DXVECTOR2 *pOffset, - RECT *pSourceRect); -#endif - -//------------------------------------------------------------------------- -// The D3DXDrawSprite() function transforms source images onto a 3D -// rendering device. It takes a general 4x4 matrix which is use to transform -// the points of a default rect: (left=-.5, top=-.5, right=+.5, bottom=+.5). -// (This default rect was chosen so that it was centered around the origin -// to ease setting up rotations. And it was chosen to have a width/height of one -// to ease setting up scales.) -// -// This function only calls SetTexture on the first -// renderstage with the parameter (pd3dTexture) if that parameter is non-null. -// This function assumes that D3DXPrepareDeviceForSprite has been called on -// the device or that caller has in some other way correctly prepared the -// renderstates. -// -// This function supports alpha-blending, and choosing -// a source sub-rect. (A value of NULL for source sub-rect means the entire -// texture is used.) -// -// Note that if the transformed points have a value for w (the homogenous -// coordinate) that is not 1, then this function will invert it and pass -// that value to D3D as the rhw field of a TLVERTEX. If the value for w is -// zero, then it use 1 as the rhw. -// -// Parameters: -// pd3dTexture - a pointer to the surface containing the texture -// pd3dDevice - a pointer to the d3d device to render to. It is -// assumed that render states are set up. (See -// D3DXPrepareDeviceForSprite) -// pMatrixTransform - 4x4 matrix that specifies the transformation -// that will be applied to the default -.5 to +.5 -// rectangle. -// alpha - alpha value to apply to sprite. 1.0 means totally -// opaque; and 0.0 means totally transparent. -// WARNING: If you are using alpha, then you should render -// from back to front in order to avoid rendering -// artifacts.Furthermore, you should avoid scenarios where -// semi-transparent objects intersect. -// pSourceRect - a rect that indicates what portion of the source -// source texture to use. If NULL is passed, then the -// entire source is used. If the source texture was -// created via D3DX, then the rect should be specified -// in the coordinates of the original image (so that you -// don't have to worry about stretching/scaling that D3DX -// may have done to make the image work with your current -// 3D Device.) Note that mirroring may be simply accomplished -// by swapping the left/right or top/bottom fields of -// this RECT. -// -//------------------------------------------------------------------------- - -#ifdef __cplusplus -HRESULT WINAPI - D3DXDrawSpriteTransform(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - const D3DXMATRIX *pMatrixTransform, - float alpha = 1.0f, - const RECT *pSourceRect = NULL); -#else -HRESULT WINAPI - D3DXDrawSpriteTransform(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - D3DXMATRIX *pMatrixTransform, - float alpha, - RECT *pSourceRect); -#endif - -//------------------------------------------------------------------------- -// The D3DXBuildSpriteTransform() function is a helper provided which -// creates a matrix corresponding to simple properties. This matrix is -// set up to pass directly to D3DXTransformSprite. -// -// Parameters: -// pMatrix - a pointer to the result matrix -// prectDest - a pointer to the target rectangle for the sprite -// angleRad - angle of rotation around the 'center' of the rect -// pOffset - offset from the center of the source rect to use as the -// center of rotation -// -//------------------------------------------------------------------------- - -#ifdef __cplusplus -void WINAPI - D3DXBuildSpriteTransform(D3DXMATRIX *pMatrix, - const RECT *prectDest, - float angleRad = 0.0f, - const D3DXVECTOR2 *pOffset = NULL); -#else -void WINAPI - D3DXBuildSpriteTransform(D3DXMATRIX *pMatrix, - RECT *prectDest, - float angleRad, - D3DXVECTOR2 *pOffset); -#endif - - -//------------------------------------------------------------------------- -// The D3DXDrawSprite3D() function renders a texture onto a 3D quad. The -// quad ABCD is broken into two triangles ABC and ACD which are rendered -// via DrawPrim. -// -// Parameters: -// pd3dTexture - a pointer to the surface containing the texture -// pd3dDevice - a pointer to the d3d device to render to. It is -// assumed that render states are set up. (See -// D3DXPrepareDeviceForSprite) -// quad - array of 4 points in the following order: -// upper-left, upper-right, lower-right, lower-left. -// If these vectors contain a W, then this function -// will take the reciprocal of that value to pass as -// as the rhw (i.e. reciprocal homogenous w). -// alpha - alpha value to apply to sprite. 1.0 means totally -// opaque; and 0.0 means totally transparent. -// WARNING: If you are using alpha, then you should render -// from back to front in order to avoid rendering -// artifacts.Furthermore, you should avoid scenarios where -// semi-transparent objects intersect. -// pSourceRect - a rect that indicates what portion of the source -// source texture to use. If NULL is passed, then the -// entire source is used. If the source texture was -// created via D3DX, then the rect should be specified -// in the coordinates of the original image (so that you -// don't have to worry about stretching/scaling that D3DX -// may have done to make the image work with your current -// 3D Device.) Note that mirroring may be simply accomplished -// by swapping the left/right or top/bottom fields of -// this RECT. -//------------------------------------------------------------------------- - -#ifdef __cplusplus -HRESULT WINAPI - D3DXDrawSprite3D(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - const D3DXVECTOR4 quad[4], - float alpha = 1.0f, - const RECT *pSourceRect = NULL); -#else -HRESULT WINAPI - D3DXDrawSprite3D(LPDIRECTDRAWSURFACE7 pd3dTexture, - LPDIRECT3DDEVICE7 pd3dDevice, - D3DXVECTOR4 quad[4], - float alpha, - RECT *pSourceRect); -#endif - - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // __D3DXSPRITE_H__ diff --git a/import/DirectX8/include/ddraw.h b/import/DirectX8/include/ddraw.h deleted file mode 100644 index ff1fbb3a0..000000000 --- a/import/DirectX8/include/ddraw.h +++ /dev/null @@ -1,5703 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: ddraw.h - * Content: DirectDraw include file - * - ***************************************************************************/ - -#ifndef __DDRAW_INCLUDED__ -#define __DDRAW_INCLUDED__ - -//Disable the nameless union warning when building internally -#undef ENABLE_NAMELESS_UNION_PRAGMA -#ifdef DIRECTX_REDIST -#define ENABLE_NAMELESS_UNION_PRAGMA -#endif - -#ifdef ENABLE_NAMELESS_UNION_PRAGMA -#pragma warning(disable:4201) -#endif - -/* - * If you wish an application built against the newest version of DirectDraw - * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION - * to be the earlies version of DirectDraw you wish to run against. For, - * example if you wish an application to run against a DX 3 runtime define - * DIRECTDRAW_VERSION to be 0x0300. - */ -#ifndef DIRECTDRAW_VERSION -#define DIRECTDRAW_VERSION 0x0700 -#endif /* DIRECTDRAW_VERSION */ - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT) - #define CO_E_NOTINITIALIZED 0x800401F0L -#endif -#endif - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// For compilers that don't support nameless unions, do a -// -// #define NONAMELESSUNION -// -// before #include -// -#ifndef DUMMYUNIONNAMEN -#if defined(__cplusplus) || !defined(NONAMELESSUNION) -#define DUMMYUNIONNAMEN(n) -#else -#define DUMMYUNIONNAMEN(n) u##n -#endif -#endif - -#ifndef MAKEFOURCC - #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) -#endif //defined(MAKEFOURCC) - -/* - * FOURCC codes for DX compressed-texture pixel formats - */ -#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1')) -#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2')) -#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3')) -#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4')) -#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5')) - -/* - * GUIDS used by DirectDraw objects - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) - -DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); -DEFINE_GUID( CLSID_DirectDraw7, 0x3c305196,0x50db,0x11d3,0x9c,0xfe,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); -DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); -DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B ); -DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); -DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E ); - -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDirectDraw FAR *LPDIRECTDRAW; -typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2; -typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4; -typedef struct IDirectDraw7 FAR *LPDIRECTDRAW7; -typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2; -typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; -typedef struct IDirectDrawSurface4 FAR *LPDIRECTDRAWSURFACE4; -typedef struct IDirectDrawSurface7 FAR *LPDIRECTDRAWSURFACE7; -typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER; -typedef struct IDirectDrawColorControl FAR *LPDIRECTDRAWCOLORCONTROL; -typedef struct IDirectDrawGammaControl FAR *LPDIRECTDRAWGAMMACONTROL; - -typedef struct _DDFXROP FAR *LPDDFXROP; -typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC; -typedef struct _DDSURFACEDESC2 FAR *LPDDSURFACEDESC2; -typedef struct _DDCOLORCONTROL FAR *LPDDCOLORCONTROL; - -/* - * API's - */ -#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM ) -//#if defined( _WIN32 ) && !defined( _NO_ENUM ) - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID); - extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); - extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); - /* - * Protect against old SDKs - */ - #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); - #endif - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR); - extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); - extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); - typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); - typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); - - #ifdef UNICODE - typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateW - typedef LPDDENUMCALLBACKEXW LPDDENUMCALLBACKEX; - typedef LPDIRECTDRAWENUMERATEEXW LPDIRECTDRAWENUMERATEEX; - #define DirectDrawEnumerateEx DirectDrawEnumerateExW - #else - typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateA - typedef LPDDENUMCALLBACKEXA LPDDENUMCALLBACKEX; - typedef LPDIRECTDRAWENUMERATEEXA LPDIRECTDRAWENUMERATEEX; - #define DirectDrawEnumerateEx DirectDrawEnumerateExA - #endif - extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateEx( GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter ); -#endif -/* - * Flags for DirectDrawEnumerateEx - * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to - * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx. - * By default, only the primary display device is enumerated. - * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES) - */ - -/* - * This flag causes enumeration of any GDI display devices which are part of - * the Windows Desktop - */ -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L - -/* - * This flag causes enumeration of any GDI display devices which are not - * part of the Windows Desktop - */ -#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002L - -/* - * This flag causes enumeration of non-display devices - */ -#define DDENUM_NONDISPLAYDEVICES 0x00000004L - - -#define REGSTR_KEY_DDHW_DESCRIPTION "Description" -#define REGSTR_KEY_DDHW_DRIVERNAME "DriverName" -#define REGSTR_PATH_DDHW "Hardware\\DirectDrawDrivers" - -#define DDCREATE_HARDWAREONLY 0x00000001l -#define DDCREATE_EMULATIONONLY 0x00000002l - -#if defined(WINNT) || !defined(WIN32) -typedef long HRESULT; -#endif - -//#ifndef WINNT -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID); -//#endif - -/* - * Generic pixel format with 8-bit RGB and alpha components - */ -typedef struct _DDARGB -{ - BYTE blue; - BYTE green; - BYTE red; - BYTE alpha; -} DDARGB; - -typedef DDARGB FAR *LPDDARGB; - -/* - * This version of the structure remains for backwards source compatibility. - * The DDARGB structure is the one that should be used for all DirectDraw APIs. - */ -typedef struct _DDRGBA -{ - BYTE red; - BYTE green; - BYTE blue; - BYTE alpha; -} DDRGBA; - -typedef DDRGBA FAR *LPDDRGBA; - - -/* - * DDCOLORKEY - */ -typedef struct _DDCOLORKEY -{ - DWORD dwColorSpaceLowValue; // low boundary of color space that is to - // be treated as Color Key, inclusive - DWORD dwColorSpaceHighValue; // high boundary of color space that is - // to be treated as Color Key, inclusive -} DDCOLORKEY; - -typedef DDCOLORKEY FAR* LPDDCOLORKEY; - -/* - * DDBLTFX - * Used to pass override information to the DIRECTDRAWSURFACE callback Blt. - */ -typedef struct _DDBLTFX -{ - DWORD dwSize; // size of structure - DWORD dwDDFX; // FX operations - DWORD dwROP; // Win32 raster operations - DWORD dwDDROP; // Raster operations new for DirectDraw - DWORD dwRotationAngle; // Rotation angle for blt - DWORD dwZBufferOpCode; // ZBuffer compares - DWORD dwZBufferLow; // Low limit of Z buffer - DWORD dwZBufferHigh; // High limit of Z buffer - DWORD dwZBufferBaseDest; // Destination base value - DWORD dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination - union - { - DWORD dwZDestConst; // Constant to use as Z buffer for dest - LPDIRECTDRAWSURFACE lpDDSZBufferDest; // Surface to use as Z buffer for dest - } DUMMYUNIONNAMEN(1); - DWORD dwZSrcConstBitDepth; // Bit depth used to specify Z constant for source - union - { - DWORD dwZSrcConst; // Constant to use as Z buffer for src - LPDIRECTDRAWSURFACE lpDDSZBufferSrc; // Surface to use as Z buffer for src - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Alpha for edge blending - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as Alpha Channel - } DUMMYUNIONNAMEN(3); - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as Alpha Channel - } DUMMYUNIONNAMEN(4); - union - { - DWORD dwFillColor; // color in RGB or Palettized - DWORD dwFillDepth; // depth value for z-buffer - DWORD dwFillPixel; // pixel value for RGBA or RGBZ - LPDIRECTDRAWSURFACE lpDDSPattern; // Surface to use as pattern - } DUMMYUNIONNAMEN(5); - DDCOLORKEY ddckDestColorkey; // DestColorkey override - DDCOLORKEY ddckSrcColorkey; // SrcColorkey override -} DDBLTFX; - -typedef DDBLTFX FAR* LPDDBLTFX; - - - -/* - * DDSCAPS - */ -typedef struct _DDSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDSCAPS; - -typedef DDSCAPS FAR* LPDDSCAPS; - - -/* - * DDOSCAPS - */ -typedef struct _DDOSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDOSCAPS; - -typedef DDOSCAPS FAR* LPDDOSCAPS; - -/* - * This structure is used internally by DirectDraw. - */ -typedef struct _DDSCAPSEX -{ - DWORD dwCaps2; - DWORD dwCaps3; - union - { - DWORD dwCaps4; - DWORD dwVolumeDepth; - } DUMMYUNIONNAMEN(1); -} DDSCAPSEX, FAR * LPDDSCAPSEX; - -/* - * DDSCAPS2 - */ -typedef struct _DDSCAPS2 -{ - DWORD dwCaps; // capabilities of surface wanted - DWORD dwCaps2; - DWORD dwCaps3; - union - { - DWORD dwCaps4; - DWORD dwVolumeDepth; - } DUMMYUNIONNAMEN(1); -} DDSCAPS2; - -typedef DDSCAPS2 FAR* LPDDSCAPS2; - -/* - * DDCAPS - */ -#define DD_ROP_SPACE (256/32) // space required to store ROP array -/* - * NOTE: Our choosen structure number scheme is to append a single digit to - * the end of the structure giving the version that structure is associated - * with. - */ - -/* - * This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally - * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0. - * New applications should use the DDCAPS structure defined below. - */ -typedef struct _DDCAPS_DX1 -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMaxLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMinHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMaxHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved -} DDCAPS_DX1; - -typedef DDCAPS_DX1 FAR* LPDDCAPS_DX1; - -/* - * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X. - * It is present for back compatability. - */ -typedef struct _DDCAPS_DX3 -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved - DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts - DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts - DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts - DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts - DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts - DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts - DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts - DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts - DWORD dwSSBCaps; // driver specific capabilities for System->System blts - DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts - DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts - DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts - DWORD dwReserved4; // reserved - DWORD dwReserved5; // reserved - DWORD dwReserved6; // reserved -} DDCAPS_DX3; -typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3; - -/* - * This structure is the DDCAPS structure as it was in version 5 of Direct X. - * It is present for back compatability. - */ -typedef struct _DDCAPS_DX5 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -// Members added for DX5: -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -} DDCAPS_DX5; -typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5; - -typedef struct _DDCAPS_DX6 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha caps -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -// Members added for DX6 release -/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps -} DDCAPS_DX6; -typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6; - -typedef struct _DDCAPS_DX7 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -// Members added for DX6 release -/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps -} DDCAPS_DX7; -typedef DDCAPS_DX7 FAR* LPDDCAPS_DX7; - - -#if DIRECTDRAW_VERSION <= 0x300 - typedef DDCAPS_DX3 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x500 - typedef DDCAPS_DX5 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x600 - typedef DDCAPS_DX6 DDCAPS; -#else - typedef DDCAPS_DX7 DDCAPS; -#endif - -typedef DDCAPS FAR* LPDDCAPS; - - - -/* - * DDPIXELFORMAT - */ -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel - DWORD dwYUVBitCount; // how many bits per pixel - DWORD dwZBufferBitDepth; // how many total bits/pixel in z buffer (including any stencil bits) - DWORD dwAlphaBitDepth; // how many bits for alpha channels - DWORD dwLuminanceBitCount; // how many bits per pixel - DWORD dwBumpBitCount; // how many bits per "buxel", total - DWORD dwPrivateFormatBitCount;// Bits per pixel of private driver formats. Only valid in texture - // format list and if DDPF_D3DFORMAT is set - } DUMMYUNIONNAMEN(1); - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - DWORD dwStencilBitDepth; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits) - DWORD dwLuminanceBitMask; // mask for luminance bits - DWORD dwBumpDuBitMask; // mask for bump map U delta bits - DWORD dwOperations; // DDPF_D3DFORMAT Operations - } DUMMYUNIONNAMEN(2); - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - DWORD dwZBitMask; // mask for Z bits - DWORD dwBumpDvBitMask; // mask for bump map V delta bits - struct - { - WORD wFlipMSTypes; // Multisample methods supported via flip for this D3DFORMAT - WORD wBltMSTypes; // Multisample methods supported via blt for this D3DFORMAT - } MultiSampleCaps; - - } DUMMYUNIONNAMEN(3); - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - DWORD dwStencilBitMask; // mask for stencil bits - DWORD dwBumpLuminanceBitMask; // mask for luminance in bump map - } DUMMYUNIONNAMEN(4); - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwLuminanceAlphaBitMask;// mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - } DUMMYUNIONNAMEN(5); -} DDPIXELFORMAT; - -typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT; - -/* - * DDOVERLAYFX - */ -typedef struct _DDOVERLAYFX -{ - DWORD dwSize; // size of structure - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Constant to use as alpha for edge blend - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as alpha channel for dest - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as alpha channel for dest - } DUMMYUNIONNAMEN(1); - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as alpha channel for src - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as alpha channel for src - } DUMMYUNIONNAMEN(2); - DDCOLORKEY dckDestColorkey; // DestColorkey override - DDCOLORKEY dckSrcColorkey; // DestColorkey override - DWORD dwDDFX; // Overlay FX - DWORD dwFlags; // flags -} DDOVERLAYFX; - -typedef DDOVERLAYFX FAR *LPDDOVERLAYFX; - - -/* - * DDBLTBATCH: BltBatch entry structure - */ -typedef struct _DDBLTBATCH -{ - LPRECT lprDest; - LPDIRECTDRAWSURFACE lpDDSSrc; - LPRECT lprSrc; - DWORD dwFlags; - LPDDBLTFX lpDDBltFx; -} DDBLTBATCH; - -typedef DDBLTBATCH FAR * LPDDBLTBATCH; - - -/* - * DDGAMMARAMP - */ -typedef struct _DDGAMMARAMP -{ - WORD red[256]; - WORD green[256]; - WORD blue[256]; -} DDGAMMARAMP; -typedef DDGAMMARAMP FAR * LPDDGAMMARAMP; - -/* - * This is the structure within which DirectDraw returns data about the current graphics driver and chipset - */ - -#define MAX_DDDEVICEID_STRING 512 - -typedef struct tagDDDEVICEIDENTIFIER -{ - /* - * These elements are for presentation to the user only. They should not be used to identify particular - * drivers, since this is unreliable and many different strings may be associated with the same - * device, and the same driver from different vendors. - */ - char szDriver[MAX_DDDEVICEID_STRING]; - char szDescription[MAX_DDDEVICEID_STRING]; - - /* - * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons - * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic - * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. - * - * This version has the form: - * wProduct = HIWORD(liDriverVersion.HighPart) - * wVersion = LOWORD(liDriverVersion.HighPart) - * wSubVersion = HIWORD(liDriverVersion.LowPart) - * wBuild = LOWORD(liDriverVersion.LowPart) - */ -#ifdef _WIN32 - LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ -#else - DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ - DWORD dwDriverVersionHighPart; -#endif - - - /* - * These elements can be used to identify particular chipsets. Use with extreme caution. - * dwVendorId Identifies the manufacturer. May be zero if unknown. - * dwDeviceId Identifies the type of chipset. May be zero if unknown. - * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. - * dwRevision Identifies the revision level of the chipset. May be zero if unknown. - */ - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - - /* - * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the - * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to - * reprofile the graphics subsystem. - * This element can also be used to identify particular problematic drivers. - */ - GUID guidDeviceIdentifier; -} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER; - -typedef struct tagDDDEVICEIDENTIFIER2 -{ - /* - * These elements are for presentation to the user only. They should not be used to identify particular - * drivers, since this is unreliable and many different strings may be associated with the same - * device, and the same driver from different vendors. - */ - char szDriver[MAX_DDDEVICEID_STRING]; - char szDescription[MAX_DDDEVICEID_STRING]; - - /* - * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons - * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic - * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. - * - * This version has the form: - * wProduct = HIWORD(liDriverVersion.HighPart) - * wVersion = LOWORD(liDriverVersion.HighPart) - * wSubVersion = HIWORD(liDriverVersion.LowPart) - * wBuild = LOWORD(liDriverVersion.LowPart) - */ -#ifdef _WIN32 - LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ -#else - DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ - DWORD dwDriverVersionHighPart; -#endif - - - /* - * These elements can be used to identify particular chipsets. Use with extreme caution. - * dwVendorId Identifies the manufacturer. May be zero if unknown. - * dwDeviceId Identifies the type of chipset. May be zero if unknown. - * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. - * dwRevision Identifies the revision level of the chipset. May be zero if unknown. - */ - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - - /* - * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the - * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to - * reprofile the graphics subsystem. - * This element can also be used to identify particular problematic drivers. - */ - GUID guidDeviceIdentifier; - - /* - * This element is used to determine the Windows Hardware Quality Lab (WHQL) - * certification level for this driver/device pair. - */ - DWORD dwWHQLLevel; - -} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2; - -/* - * Flags for the IDirectDraw4::GetDeviceIdentifier method - */ - -/* - * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped - * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the - * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is - * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities - * of the DirectDraw object involved. - */ -#define DDGDI_GETHOSTIDENTIFIER 0x00000001L - -/* - * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel - */ -#define GET_WHQL_YEAR( dwWHQLLevel ) \ - ( (dwWHQLLevel) / 0x10000 ) -#define GET_WHQL_MONTH( dwWHQLLevel ) \ - ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff ) -#define GET_WHQL_DAY( dwWHQLLevel ) \ - ( (dwWHQLLevel) & 0xff ) - - -/* - * callbacks - */ -typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext ); -#ifdef STREAMING -typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD); -#endif - - -/* - * INTERACES FOLLOW: - * IDirectDraw - * IDirectDrawClipper - * IDirectDrawPalette - * IDirectDrawSurface - */ - -/* - * IDirectDraw - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw -DECLARE_INTERFACE_( IDirectDraw, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->lpVtbl->SetDisplayMode(p, a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#else -#define IDirectDraw_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw_AddRef(p) (p)->AddRef() -#define IDirectDraw_Release(p) (p)->Release() -#define IDirectDraw_Compact(p) (p)->Compact() -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->SetDisplayMode(a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw2 -DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw2_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw2_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#else -#define IDirectDraw2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw2_AddRef(p) (p)->AddRef() -#define IDirectDraw2_Release(p) (p)->Release() -#define IDirectDraw2_Compact(p) (p)->Compact() -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw2_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw2_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw2_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw4 -DECLARE_INTERFACE_( IDirectDraw4, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; - /*** Added in the V4 Interface ***/ - STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw4_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw4_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw4_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw4_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw4_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw4_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw4_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw4_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw4_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw4_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw4_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) -#define IDirectDraw4_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) -#define IDirectDraw4_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) -#else -#define IDirectDraw4_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw4_AddRef(p) (p)->AddRef() -#define IDirectDraw4_Release(p) (p)->Release() -#define IDirectDraw4_Compact(p) (p)->Compact() -#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw4_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw4_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw4_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw4_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw4_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw4_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw4_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) -#define IDirectDraw4_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() -#define IDirectDraw4_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw7 -DECLARE_INTERFACE_( IDirectDraw7, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE7 FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE7, LPDIRECTDRAWSURFACE7 FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK7 ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; - /*** Added in the V4 Interface ***/ - STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2, DWORD ) PURE; - STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD ) PURE; - STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD * ) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw7_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw7_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw7_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw7_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw7_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw7_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw7_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw7_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw7_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw7_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) -#define IDirectDraw7_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) -#define IDirectDraw7_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) -#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(p,a,b,c) -#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(p,a,b) -#else -#define IDirectDraw7_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw7_AddRef(p) (p)->AddRef() -#define IDirectDraw7_Release(p) (p)->Release() -#define IDirectDraw7_Compact(p) (p)->Compact() -#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw7_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw7_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw7_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw7_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw7_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw7_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw7_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) -#define IDirectDraw7_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() -#define IDirectDraw7_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) -#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(a,b,c) -#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(a,b) -#endif - -#endif - - -/* - * IDirectDrawPalette - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawPalette -DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawPalette methods ***/ - STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE; - STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE; - STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawPalette_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawPalette_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawPalette_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->lpVtbl->GetEntries(p, a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d) -#else -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawPalette_AddRef(p) (p)->AddRef() -#define IDirectDrawPalette_Release(p) (p)->Release() -#define IDirectDrawPalette_GetCaps(p, a) (p)->GetCaps(a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->GetEntries(a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->Initialize(a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->SetEntries(a, b, c, d) -#endif - -#endif - - -/* - * IDirectDrawClipper - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawClipper -DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawClipper methods ***/ - STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE; - STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE; - STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE; - STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE; - STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawClipper_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawClipper_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->lpVtbl->GetClipList(p, a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->lpVtbl->GetHWnd(p, a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->lpVtbl->IsClipListChanged(p, a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->lpVtbl->SetClipList(p, a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->lpVtbl->SetHWnd(p, a, b) -#else -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawClipper_AddRef(p) (p)->AddRef() -#define IDirectDrawClipper_Release(p) (p)->Release() -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->GetClipList(a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->GetHWnd(a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->Initialize(a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->IsClipListChanged(a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->SetClipList(a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->SetHWnd(a, b) -#endif - -#endif - -/* - * IDirectDrawSurface and related interfaces - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawSurface -DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#else -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface_Release(p) (p)->Release() -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface_Restore(p) (p)->Restore() -#define IDirectDrawSurface_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#endif - -/* - * IDirectDrawSurface2 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface2 -DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface2_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface2_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#else -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface2_Release(p) (p)->Release() -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface2_Restore(p) (p)->Restore() -#define IDirectDrawSurface2_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->PageUnlock(a) -#endif - -/* - * IDirectDrawSurface3 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface3 -DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the V3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface3_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface3_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#else -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface3_Release(p) (p)->Release() -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface3_Restore(p) (p)->Restore() -#define IDirectDrawSurface3_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#endif - -/* - * IDirectDrawSurface4 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface4 -DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the v3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; - /*** Added in the v4 interface ***/ - STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface4_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface4_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface4_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface4_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface4_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface4_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface4_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface4_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface4_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface4_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface4_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface4_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface4_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface4_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface4_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) -#else -#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface4_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface4_Release(p) (p)->Release() -#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface4_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface4_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface4_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface4_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface4_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface4_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface4_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface4_Restore(p) (p)->Restore() -#define IDirectDrawSurface4_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface4_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface4_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface4_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface4_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() -#endif - -/* - * IDirectDrawSurface7 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface7 -DECLARE_INTERFACE_( IDirectDrawSurface7, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE7, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE7, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE7 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the v3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; - /*** Added in the v4 interface ***/ - STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; - /*** Moved Texture7 methods here ***/ - STDMETHOD(SetPriority)(THIS_ DWORD) PURE; - STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE; - STDMETHOD(SetLOD)(THIS_ DWORD) PURE; - STDMETHOD(GetLOD)(THIS_ LPDWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface7_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface7_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface7_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface7_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface7_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface7_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface7_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface7_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface7_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface7_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface7_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface7_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface7_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) -#define IDirectDrawSurface7_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirectDrawSurface7_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a) -#define IDirectDrawSurface7_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirectDrawSurface7_GetLOD(p,a) (p)->lpVtbl->GetLOD(p,a) -#else -#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface7_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface7_Release(p) (p)->Release() -#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface7_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface7_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface7_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface7_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface7_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface7_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface7_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface7_Restore(p) (p)->Restore() -#define IDirectDrawSurface7_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface7_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface7_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface7_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface7_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() -#define IDirectDrawSurface7_SetPriority(p,a) (p)->SetPriority(a) -#define IDirectDrawSurface7_GetPriority(p,a) (p)->GetPriority(a) -#define IDirectDrawSurface7_SetLOD(p,a) (p)->SetLOD(a) -#define IDirectDrawSurface7_GetLOD(p,a) (p)->GetLOD(a) -#endif - - -/* - * IDirectDrawColorControl - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawColorControl -DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawColorControl methods ***/ - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawColorControl_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->lpVtbl->GetColorControls(p, a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->lpVtbl->SetColorControls(p, a) -#else -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->AddRef() -#define IDirectDrawColorControl_Release(p) (p)->Release() -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->GetColorControls(a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->SetColorControls(a) -#endif - -#endif - - -/* - * IDirectDrawGammaControl - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawGammaControl -DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawGammaControl methods ***/ - STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; - STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawGammaControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawGammaControl_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->lpVtbl->GetGammaRamp(p, a, b) -#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->lpVtbl->SetGammaRamp(p, a, b) -#else -#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawGammaControl_AddRef(p) (p)->AddRef() -#define IDirectDrawGammaControl_Release(p) (p)->Release() -#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->GetGammaRamp(a, b) -#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->SetGammaRamp(a, b) -#endif - -#endif - - - -#endif - - -/* - * DDSURFACEDESC - */ -typedef struct _DDSURFACEDESC -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - union - { - LONG lPitch; // distance to start of next line (return value only) - DWORD dwLinearSize; // Formless late-allocated optimized surface size - } DUMMYUNIONNAMEN(1); - DWORD dwBackBufferCount; // number of back buffers requested - union - { - DWORD dwMipMapCount; // number of mip-map levels requested - DWORD dwZBufferBitDepth; // depth of Z buffer requested - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DDSCAPS ddsCaps; // direct draw surface capabilities -} DDSURFACEDESC; - -/* - * DDSURFACEDESC2 - */ -typedef struct _DDSURFACEDESC2 -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - union - { - LONG lPitch; // distance to start of next line (return value only) - DWORD dwLinearSize; // Formless late-allocated optimized surface size - } DUMMYUNIONNAMEN(1); - union - { - DWORD dwBackBufferCount; // number of back buffers requested - DWORD dwDepth; // the depth if this is a volume texture - } DUMMYUNIONNAMEN(5); - union - { - DWORD dwMipMapCount; // number of mip-map levels requestde - // dwZBufferBitDepth removed, use ddpfPixelFormat one instead - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - DWORD dwSrcVBHandle; // The source used in VB::Optimize - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - union - { - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces - } DUMMYUNIONNAMEN(3); - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - union - { - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DWORD dwFVF; // vertex format description of vertex buffers - } DUMMYUNIONNAMEN(4); - DDSCAPS2 ddsCaps; // direct draw surface capabilities - DWORD dwTextureStage; // stage in multitexture cascade -} DDSURFACEDESC2; - -/* - * ddsCaps field is valid. - */ -#define DDSD_CAPS 0x00000001l // default - -/* - * dwHeight field is valid. - */ -#define DDSD_HEIGHT 0x00000002l - -/* - * dwWidth field is valid. - */ -#define DDSD_WIDTH 0x00000004l - -/* - * lPitch is valid. - */ -#define DDSD_PITCH 0x00000008l - -/* - * dwBackBufferCount is valid. - */ -#define DDSD_BACKBUFFERCOUNT 0x00000020l - -/* - * dwZBufferBitDepth is valid. (shouldnt be used in DDSURFACEDESC2) - */ -#define DDSD_ZBUFFERBITDEPTH 0x00000040l - -/* - * dwAlphaBitDepth is valid. - */ -#define DDSD_ALPHABITDEPTH 0x00000080l - - -/* - * lpSurface is valid. - */ -#define DDSD_LPSURFACE 0x00000800l - -/* - * ddpfPixelFormat is valid. - */ -#define DDSD_PIXELFORMAT 0x00001000l - -/* - * ddckCKDestOverlay is valid. - */ -#define DDSD_CKDESTOVERLAY 0x00002000l - -/* - * ddckCKDestBlt is valid. - */ -#define DDSD_CKDESTBLT 0x00004000l - -/* - * ddckCKSrcOverlay is valid. - */ -#define DDSD_CKSRCOVERLAY 0x00008000l - -/* - * ddckCKSrcBlt is valid. - */ -#define DDSD_CKSRCBLT 0x00010000l - -/* - * dwMipMapCount is valid. - */ -#define DDSD_MIPMAPCOUNT 0x00020000l - - /* - * dwRefreshRate is valid - */ -#define DDSD_REFRESHRATE 0x00040000l - -/* - * dwLinearSize is valid - */ -#define DDSD_LINEARSIZE 0x00080000l - -/* - * dwTextureStage is valid - */ -#define DDSD_TEXTURESTAGE 0x00100000l -/* - * dwFVF is valid - */ -#define DDSD_FVF 0x00200000l -/* - * dwSrcVBHandle is valid - */ -#define DDSD_SRCVBHANDLE 0x00400000l - -/* - * dwDepth is valid - */ -#define DDSD_DEPTH 0x00800000l - -/* - * All input fields are valid. - */ -#define DDSD_ALL 0x00fff9eel - -/* - * DDOPTSURFACEDESC - */ -typedef struct _DDOPTSURFACEDESC -{ - DWORD dwSize; // size of the DDOPTSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DDSCAPS2 ddSCaps; // Common caps like: Memory type - DDOSCAPS ddOSCaps; // Common caps like: Memory type - GUID guid; // Compression technique GUID - DWORD dwCompressionRatio; // Compression ratio -} DDOPTSURFACEDESC; - -/* - * guid field is valid. - */ -#define DDOSD_GUID 0x00000001l - -/* - * dwCompressionRatio field is valid. - */ -#define DDOSD_COMPRESSION_RATIO 0x00000002l - -/* - * ddSCaps field is valid. - */ -#define DDOSD_SCAPS 0x00000004l - -/* - * ddOSCaps field is valid. - */ -#define DDOSD_OSCAPS 0x00000008l - -/* - * All input fields are valid. - */ -#define DDOSD_ALL 0x0000000fl - -/* - * The surface's optimized pixelformat is compressed - */ -#define DDOSDCAPS_OPTCOMPRESSED 0x00000001l - -/* - * The surface's optimized pixelformat is reordered - */ -#define DDOSDCAPS_OPTREORDERED 0x00000002l - -/* - * The opt surface is a monolithic mipmap - */ -#define DDOSDCAPS_MONOLITHICMIPMAP 0x00000004l - -/* - * The valid Surf caps: - * #define DDSCAPS_SYSTEMMEMORY 0x00000800l - * #define DDSCAPS_VIDEOMEMORY 0x00004000l - * #define DDSCAPS_LOCALVIDMEM 0x10000000l - * #define DDSCAPS_NONLOCALVIDMEM 0x20000000l - */ -#define DDOSDCAPS_VALIDSCAPS 0x30004800l - -/* - * The valid OptSurf caps - */ -#define DDOSDCAPS_VALIDOSCAPS 0x00000007l - - -/* - * DDCOLORCONTROL - */ -typedef struct _DDCOLORCONTROL -{ - DWORD dwSize; - DWORD dwFlags; - LONG lBrightness; - LONG lContrast; - LONG lHue; - LONG lSaturation; - LONG lSharpness; - LONG lGamma; - LONG lColorEnable; - DWORD dwReserved1; -} DDCOLORCONTROL; - - -/* - * lBrightness field is valid. - */ -#define DDCOLOR_BRIGHTNESS 0x00000001l - -/* - * lContrast field is valid. - */ -#define DDCOLOR_CONTRAST 0x00000002l - -/* - * lHue field is valid. - */ -#define DDCOLOR_HUE 0x00000004l - -/* - * lSaturation field is valid. - */ -#define DDCOLOR_SATURATION 0x00000008l - -/* - * lSharpness field is valid. - */ -#define DDCOLOR_SHARPNESS 0x00000010l - -/* - * lGamma field is valid. - */ -#define DDCOLOR_GAMMA 0x00000020l - -/* - * lColorEnable field is valid. - */ -#define DDCOLOR_COLORENABLE 0x00000040l - - - -/*============================================================================ - * - * Direct Draw Capability Flags - * - * These flags are used to describe the capabilities of a given Surface. - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED1 0x00000001l - -/* - * Indicates that this surface contains alpha-only information. - * (To determine if a surface is RGBA/YUVA, the pixel format must be - * interrogated.) - */ -#define DDSCAPS_ALPHA 0x00000002l - -/* - * Indicates that this surface is a backbuffer. It is generally - * set by CreateSurface when the DDSCAPS_FLIP capability bit is set. - * It indicates that this surface is THE back buffer of a surface - * flipping structure. DirectDraw supports N surfaces in a - * surface flipping structure. Only the surface that immediately - * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set. - * The other surfaces are identified as back buffers by the presence - * of the DDSCAPS_FLIP capability, their attachment order, and the - * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER - * capabilities. The bit is sent to CreateSurface when a standalone - * back buffer is being created. This surface could be attached to - * a front buffer and/or back buffers to form a flipping surface - * structure after the CreateSurface call. See AddAttachments for - * a detailed description of the behaviors in this case. - */ -#define DDSCAPS_BACKBUFFER 0x00000004l - -/* - * Indicates a complex surface structure is being described. A - * complex surface structure results in the creation of more than - * one surface. The additional surfaces are attached to the root - * surface. The complex structure can only be destroyed by - * destroying the root. - */ -#define DDSCAPS_COMPLEX 0x00000008l - -/* - * Indicates that this surface is a part of a surface flipping structure. - * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and - * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface - * on the resulting creations. The dwBackBufferCount field in the - * DDSURFACEDESC structure must be set to at least 1 in order for - * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability - * must always be set with creating multiple surfaces through CreateSurface. - */ -#define DDSCAPS_FLIP 0x00000010l - -/* - * Indicates that this surface is THE front buffer of a surface flipping - * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP - * capability bit is set. - * If this capability is sent to CreateSurface then a standalonw front buffer - * is created. This surface will not have the DDSCAPS_FLIP capability. - * It can be attached to other back buffers to form a flipping structure. - * See AddAttachments for a detailed description of the behaviors in this - * case. - */ -#define DDSCAPS_FRONTBUFFER 0x00000020l - -/* - * Indicates that this surface is any offscreen surface that is not an overlay, - * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used - * to identify plain vanilla surfaces. - */ -#define DDSCAPS_OFFSCREENPLAIN 0x00000040l - -/* - * Indicates that this surface is an overlay. It may or may not be directly visible - * depending on whether or not it is currently being overlayed onto the primary - * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being - * overlayed at the moment. - */ -#define DDSCAPS_OVERLAY 0x00000080l - -/* - * Indicates that unique DirectDrawPalette objects can be created and - * attached to this surface. - */ -#define DDSCAPS_PALETTE 0x00000100l - -/* - * Indicates that this surface is the primary surface. The primary - * surface represents what the user is seeing at the moment. - */ -#define DDSCAPS_PRIMARYSURFACE 0x00000200l - - -/* - * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now - * obsolete. - */ -#define DDSCAPS_RESERVED3 0x00000400l -#define DDSCAPS_PRIMARYSURFACELEFT 0x00000000l - -/* - * Indicates that this surface memory was allocated in system memory - */ -#define DDSCAPS_SYSTEMMEMORY 0x00000800l - -/* - * Indicates that this surface can be used as a 3D texture. It does not - * indicate whether or not the surface is being used for that purpose. - */ -#define DDSCAPS_TEXTURE 0x00001000l - -/* - * Indicates that a surface may be a destination for 3D rendering. This - * bit must be set in order to query for a Direct3D Device Interface - * from this surface. - */ -#define DDSCAPS_3DDEVICE 0x00002000l - -/* - * Indicates that this surface exists in video memory. - */ -#define DDSCAPS_VIDEOMEMORY 0x00004000l - -/* - * Indicates that changes made to this surface are immediately visible. - * It is always set for the primary surface and is set for overlays while - * they are being overlayed and texture maps while they are being textured. - */ -#define DDSCAPS_VISIBLE 0x00008000l - -/* - * Indicates that only writes are permitted to the surface. Read accesses - * from the surface may or may not generate a protection fault, but the - * results of a read from this surface will not be meaningful. READ ONLY. - */ -#define DDSCAPS_WRITEONLY 0x00010000l - -/* - * Indicates that this surface is a z buffer. A z buffer does not contain - * displayable information. Instead it contains bit depth information that is - * used to determine which pixels are visible and which are obscured. - */ -#define DDSCAPS_ZBUFFER 0x00020000l - -/* - * Indicates surface will have a DC associated long term - */ -#define DDSCAPS_OWNDC 0x00040000l - -/* - * Indicates surface should be able to receive live video - */ -#define DDSCAPS_LIVEVIDEO 0x00080000l - -/* - * Indicates surface should be able to have a stream decompressed - * to it by the hardware. - */ -#define DDSCAPS_HWCODEC 0x00100000l - -/* - * Surface is a ModeX surface. - * - */ -#define DDSCAPS_MODEX 0x00200000l - -/* - * Indicates surface is one level of a mip-map. This surface will - * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map. - * This can be done explicitly, by creating a number of surfaces and - * attaching them with AddAttachedSurface or by implicitly by CreateSurface. - * If this bit is set then DDSCAPS_TEXTURE must also be set. - */ -#define DDSCAPS_MIPMAP 0x00400000l - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED2 0x00800000l - - -/* - * Indicates that memory for the surface is not allocated until the surface - * is loaded (via the Direct3D texture Load() function). - */ -#define DDSCAPS_ALLOCONLOAD 0x04000000l - -/* - * Indicates that the surface will recieve data from a video port. - */ -#define DDSCAPS_VIDEOPORT 0x08000000l - -/* - * Indicates that a video memory surface is resident in true, local video - * memory rather than non-local video memory. If this flag is specified then - * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_NONLOCALVIDMEM. - */ -#define DDSCAPS_LOCALVIDMEM 0x10000000l - -/* - * Indicates that a video memory surface is resident in non-local video - * memory rather than true, local video memory. If this flag is specified - * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_LOCALVIDMEM. - */ -#define DDSCAPS_NONLOCALVIDMEM 0x20000000l - -/* - * Indicates that this surface is a standard VGA mode surface, and not a - * ModeX surface. (This flag will never be set in combination with the - * DDSCAPS_MODEX flag). - */ -#define DDSCAPS_STANDARDVGAMODE 0x40000000l - -/* - * Indicates that this surface will be an optimized surface. This flag is - * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface - * will be created without any underlying video memory until loaded. - */ -#define DDSCAPS_OPTIMIZED 0x80000000l - - - -/* - * This bit is reserved - */ -#define DDSCAPS2_RESERVED4 0x00000002L -#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000000L - -/* - * Indicates to the driver that this surface will be locked very frequently - * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap - * set must also have DDSCAPS_TEXTURE. This cap cannot be used with - * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_HINTDYNAMIC 0x00000004L - -/* - * Indicates to the driver that this surface can be re-ordered/retiled on - * load. This operation will not change the size of the texture. It is - * relatively fast and symmetrical, since the application may lock these - * bits (although it will take a performance hit when doing so). Surfaces - * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be - * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_HINTSTATIC 0x00000008L - -/* - * Indicates that the client would like this texture surface to be managed by the - * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have - * DDSCAPS_TEXTURE set. - */ -#define DDSCAPS2_TEXTUREMANAGE 0x00000010L - -/* - * These bits are reserved for internal use */ -#define DDSCAPS2_RESERVED1 0x00000020L -#define DDSCAPS2_RESERVED2 0x00000040L - -/* - * Indicates to the driver that this surface will never be locked again. - * The driver is free to optimize this surface via retiling and actual compression. - * All calls to Lock() or Blts from this surface will fail. Surfaces with this - * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with - * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC. - */ -#define DDSCAPS2_OPAQUE 0x00000080L - -/* - * Applications should set this bit at CreateSurface time to indicate that they - * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set. - */ -#define DDSCAPS2_HINTANTIALIASING 0x00000100L - - -/* - * This flag is used at CreateSurface time to indicate that this set of - * surfaces is a cubic environment map - */ -#define DDSCAPS2_CUBEMAP 0x00000200L - -/* - * These flags preform two functions: - * - At CreateSurface time, they define which of the six cube faces are - * required by the application. - * - After creation, each face in the cubemap will have exactly one of these - * bits set. - */ -#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400L -#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800L -#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000L -#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000L -#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000L -#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000L - -/* - * This macro may be used to specify all faces of a cube map at CreateSurface time - */ -#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\ - DDSCAPS2_CUBEMAP_NEGATIVEX |\ - DDSCAPS2_CUBEMAP_POSITIVEY |\ - DDSCAPS2_CUBEMAP_NEGATIVEY |\ - DDSCAPS2_CUBEMAP_POSITIVEZ |\ - DDSCAPS2_CUBEMAP_NEGATIVEZ ) - - -/* - * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards - * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface - * constructs such as Cube Maps, wherein there are more than one mipmap surface attached - * to the root surface. - * This caps bit is ignored by CreateSurface - */ -#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000L - -/* This flag indicates that the texture should be managed by D3D only */ -#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000L - -/* This flag indicates that the managed surface can be safely lost */ -#define DDSCAPS2_DONOTPERSIST 0x00040000L - -/* indicates that this surface is part of a stereo flipping chain */ -#define DDSCAPS2_STEREOSURFACELEFT 0x00080000L - - -/* - * Indicates that the surface is a volume. - * Can be combined with DDSCAPS_MIPMAP to indicate a multi-level volume - */ -#define DDSCAPS2_VOLUME 0x00200000L - -/* - * Indicates that the surface may be locked multiple times by the application. - * This cap cannot be used with DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_NOTUSERLOCKABLE 0x00400000L - -/* - * Indicates that the vertex buffer data can be used to render points and - * point sprites. - */ -#define DDSCAPS2_POINTS 0x00800000L - -/* - * Indicates that the vertex buffer data can be used to render rt pactches. - */ -#define DDSCAPS2_RTPATCHES 0x01000000L - -/* - * Indicates that the vertex buffer data can be used to render n patches. - */ -#define DDSCAPS2_NPATCHES 0x02000000L - -/* - * This bit is reserved for internal use - */ -#define DDSCAPS2_RESERVED3 0x04000000L - - -/* - * Indicates that the contents of the backbuffer do not have to be preserved - * the contents of the backbuffer after they are presented. - */ -#define DDSCAPS2_DISCARDBACKBUFFER 0x10000000L - -/* - * Indicates that all surfaces in this creation chain should be given an alpha channel. - * This flag will be set on primary surface chains that may have no explicit pixel format - * (and thus take on the format of the current display mode). - * The driver should infer that all these surfaces have a format having an alpha channel. - * (e.g. assume D3DFMT_A8R8G8B8 if the display mode is x888.) - */ -#define DDSCAPS2_ENABLEALPHACHANNEL 0x20000000L - - -/* - * This is a mask that indicates the set of bits that may be set - * at createsurface time to indicate number of samples per pixel - * when multisampling - */ -#define DDSCAPS3_MULTISAMPLE_MASK 0x0000001FL - - - /**************************************************************************** - * - * DIRECTDRAW DRIVER CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Display hardware has 3D acceleration. - */ -#define DDCAPS_3D 0x00000001l - -/* - * Indicates that DirectDraw will support only dest rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZEDEST 0x00000004l -/* - * Indicates that DirectDraw will support only source rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZESRC 0x00000010l - -/* - * Indicates that DirectDraw will create video memory surfaces that have a stride - * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY. - */ -#define DDCAPS_ALIGNSTRIDE 0x00000020l - -/* - * Display hardware is capable of blt operations. - */ -#define DDCAPS_BLT 0x00000040l - -/* - * Display hardware is capable of asynchronous blt operations. - */ -#define DDCAPS_BLTQUEUE 0x00000080l - -/* - * Display hardware is capable of color space conversions during the blt operation. - */ -#define DDCAPS_BLTFOURCC 0x00000100l - -/* - * Display hardware is capable of stretching during blt operations. - */ -#define DDCAPS_BLTSTRETCH 0x00000200l - -/* - * Display hardware is shared with GDI. - */ -#define DDCAPS_GDI 0x00000400l - -/* - * Display hardware can overlay. - */ -#define DDCAPS_OVERLAY 0x00000800l - -/* - * Set if display hardware supports overlays but can not clip them. - */ -#define DDCAPS_OVERLAYCANTCLIP 0x00001000l - -/* - * Indicates that overlay hardware is capable of color space conversions during - * the overlay operation. - */ -#define DDCAPS_OVERLAYFOURCC 0x00002000l - -/* - * Indicates that stretching can be done by the overlay hardware. - */ -#define DDCAPS_OVERLAYSTRETCH 0x00004000l - -/* - * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces - * other than the primary surface. - */ -#define DDCAPS_PALETTE 0x00008000l - -/* - * Indicates that palette changes can be syncd with the veritcal refresh. - */ -#define DDCAPS_PALETTEVSYNC 0x00010000l - -/* - * Display hardware can return the current scan line. - */ -#define DDCAPS_READSCANLINE 0x00020000l - - -/* - * This flag used to bo DDCAPS_STEREOVIEW, which is now obsolete - */ -#define DDCAPS_RESERVED1 0x00040000l - -/* - * Display hardware is capable of generating a vertical blank interrupt. - */ -#define DDCAPS_VBI 0x00080000l - -/* - * Supports the use of z buffers with blt operations. - */ -#define DDCAPS_ZBLTS 0x00100000l - -/* - * Supports Z Ordering of overlays. - */ -#define DDCAPS_ZOVERLAYS 0x00200000l - -/* - * Supports color key - */ -#define DDCAPS_COLORKEY 0x00400000l - -/* - * Supports alpha surfaces - */ -#define DDCAPS_ALPHA 0x00800000l - -/* - * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) - */ -#define DDCAPS_COLORKEYHWASSIST 0x01000000l - -/* - * no hardware support at all - */ -#define DDCAPS_NOHARDWARE 0x02000000l - -/* - * Display hardware is capable of color fill with bltter - */ -#define DDCAPS_BLTCOLORFILL 0x04000000l - -/* - * Display hardware is bank switched, and potentially very slow at - * random access to VRAM. - */ -#define DDCAPS_BANKSWITCHED 0x08000000l - -/* - * Display hardware is capable of depth filling Z-buffers with bltter - */ -#define DDCAPS_BLTDEPTHFILL 0x10000000l - -/* - * Display hardware is capable of clipping while bltting. - */ -#define DDCAPS_CANCLIP 0x20000000l - -/* - * Display hardware is capable of clipping while stretch bltting. - */ -#define DDCAPS_CANCLIPSTRETCHED 0x40000000l - -/* - * Display hardware is capable of bltting to or from system memory - */ -#define DDCAPS_CANBLTSYSMEM 0x80000000l - - - /**************************************************************************** - * - * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2) - * - ****************************************************************************/ - -/* - * Display hardware is certified - */ -#define DDCAPS2_CERTIFIED 0x00000001l - -/* - * Driver cannot interleave 2D operations (lock and blt) to surfaces with - * Direct3D rendering operations between calls to BeginScene() and EndScene() - */ -#define DDCAPS2_NO2DDURING3DSCENE 0x00000002l - -/* - * Display hardware contains a video port - */ -#define DDCAPS2_VIDEOPORT 0x00000004l - -/* - * The overlay can be automatically flipped according to the video port - * VSYNCs, providing automatic doubled buffered display of video port - * data using an overlay - */ -#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008l - -/* - * Overlay can display each field of interlaced data individually while - * it is interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBINTERLEAVED 0x00000010l - -/* - * Overlay can display each field of interlaced data individually while - * it is not interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020l - -/* - * The overlay surface contains color controls (brightness, sharpness, etc.) - */ -#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040l - -/* - * The primary surface contains color controls (gamma, etc.) - */ -#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080l - -/* - * RGBZ -> RGB supported for 16:16 RGB:Z - */ -#define DDCAPS2_CANDROPZ16BIT 0x00000100l - -/* - * Driver supports non-local video memory. - */ -#define DDCAPS2_NONLOCALVIDMEM 0x00000200l - -/* - * Dirver supports non-local video memory but has different capabilities for - * non-local video memory surfaces. If this bit is set then so must - * DDCAPS2_NONLOCALVIDMEM. - */ -#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400l - -/* - * Driver neither requires nor prefers surfaces to be pagelocked when performing - * blts involving system memory surfaces - */ -#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800l - -/* - * Driver can create surfaces which are wider than the primary surface - */ -#define DDCAPS2_WIDESURFACES 0x00001000l - -/* - * Driver supports bob without using a video port by handling the - * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip. - */ -#define DDCAPS2_CANFLIPODDEVEN 0x00002000l - -/* - * Driver supports bob using hardware - */ -#define DDCAPS2_CANBOBHARDWARE 0x00004000l - -/* - * Driver supports bltting any FOURCC surface to another surface of the same FOURCC - */ -#define DDCAPS2_COPYFOURCC 0x00008000l - - -/* - * Driver supports loadable gamma ramps for the primary surface - */ -#define DDCAPS2_PRIMARYGAMMA 0x00020000l - -/* - * Driver can render in windowed mode. - */ -#define DDCAPS2_CANRENDERWINDOWED 0x00080000l - -/* - * A calibrator is available to adjust the gamma ramp according to the - * physical display properties so that the result will be identical on - * all calibrated systems. - */ -#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000l - -/* - * Indicates that the driver will respond to DDFLIP_INTERVALn flags - */ -#define DDCAPS2_FLIPINTERVAL 0x00200000l - -/* - * Indicates that the driver will respond to DDFLIP_NOVSYNC - */ -#define DDCAPS2_FLIPNOVSYNC 0x00400000l - -/* - * Driver supports management of video memory, if this flag is ON, - * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on - * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on - */ -#define DDCAPS2_CANMANAGETEXTURE 0x00800000l - -/* - * The Direct3D texture manager uses this cap to decide whether to put managed - * surfaces in non-local video memory. If the cap is set, the texture manager will - * put managed surfaces in non-local vidmem. Drivers that cannot texture from - * local vidmem SHOULD NOT set this cap. - */ -#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000l - -/* - * Indicates that the driver supports DX7 type of stereo in at least one mode (which may - * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher) - * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of - * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application - * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode. - */ -#define DDCAPS2_STEREO 0x02000000L - -/* - * This caps bit is intended for internal DirectDraw use. - * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set. - * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and - * all the assoicated system memory blt caps must be correct). - * -It implies that the system->video blt caps in DDCAPS also apply to system to - * nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops - * members of DDCAPS (DDCORECAPS) are filled in correctly. - * -Any blt from system to nonlocal memory that matches these caps bits will - * be passed to the driver. - * - * NOTE: This is intended to enable the driver itself to do efficient reordering - * of textures. This is NOT meant to imply that hardware can write into AGP memory. - * This operation is not currently supported. - */ -#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000L - -/* - * was DDCAPS2_PUREHAL - */ -#define DDCAPS2_RESERVED1 0x08000000L - -/* - * Driver supports management of video memory, if this flag is ON, - * driver manages the resource if requested with DDSCAPS2_TEXTUREMANAGE on - * DirectX manages the resource if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on - */ -#define DDCAPS2_CANMANAGERESOURCE 0x10000000L - -/* - * Driver supports dynamic textures. This will allow the application to set - * D3DUSAGE_DYNAMIC (DDSCAPS2_HINTDYNAMIC for drivers) at texture create time. - * Video memory dynamic textures WILL be lockable by applications. It is - * expected that these locks will be very efficient (which implies that the - * driver should always maintain a linear copy, a pointer to which can be - * quickly handed out to the application). - */ -#define DDCAPS2_DYNAMICTEXTURES 0x20000000L - - -/**************************************************************************** - * - * DIRECTDRAW FX ALPHA CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010l - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200l - -#if DIRECTDRAW_VERSION < 0x0600 -#endif //DIRECTDRAW_VERSION - - -/**************************************************************************** - * - * DIRECTDRAW FX CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Uses arithmetic operations to stretch and shrink surfaces during blt - * rather than pixel doubling techniques. Along the Y axis. - */ -#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020l - -/* - * Uses arithmetic operations to stretch during blt - * rather than pixel doubling techniques. Along the Y axis. Only - * works for x1, x2, etc. - */ -#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010l - -/* - * Supports mirroring left to right in blt. - */ -#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040l - -/* - * Supports mirroring top to bottom in blt. - */ -#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080l - -/* - * Supports arbitrary rotation for blts. - */ -#define DDFXCAPS_BLTROTATION 0x00000100l - -/* - * Supports 90 degree rotations for blts. - */ -#define DDFXCAPS_BLTROTATION90 0x00000200l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKX 0x00000400l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKXN 0x00000800l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKY 0x00001000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKYN 0x00002000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHX 0x00004000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHXN 0x00008000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHY 0x00010000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHYN 0x00020000l - -/* - * Uses arithmetic operations to stretch and shrink surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000l - -/* - * Uses arithmetic operations to stretch surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. Only works for x1, x2, etc. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKX 0x00080000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKY 0x00200000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000l - -/* - * DirectDraw supports mirroring of overlays across the vertical axis - */ -#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l - -/* - * DirectDraw supports mirroring of overlays across the horizontal axis - */ -#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000l - -/* - * DirectDraw supports deinterlacing of overlay surfaces - */ -#define DDFXCAPS_OVERLAYDEINTERLACE 0x20000000l - -/* - * Driver can do alpha blending for blits. - */ -#define DDFXCAPS_BLTALPHA 0x00000001l - - -/* - * Driver can do surface-reconstruction filtering for warped blits. - */ -#define DDFXCAPS_BLTFILTER DDFXCAPS_BLTARITHSTRETCHY - -/* - * Driver can do alpha blending for overlays. - */ -#define DDFXCAPS_OVERLAYALPHA 0x00000004l - - -/* - * Driver can do surface-reconstruction filtering for warped overlays. - */ -#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY - -/**************************************************************************** - * - * DIRECTDRAW STEREO VIEW CAPABILITIES - * - ****************************************************************************/ - -/* - * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete - */ - -#define DDSVCAPS_RESERVED1 0x00000001l - -/* - * This flag used to be DDSVCAPS_FLICKER, which is now obsolete - */ -#define DDSVCAPS_RESERVED2 0x00000002l - -/* - * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete - */ -#define DDSVCAPS_RESERVED3 0x00000004l - -/* - * This flag used to be DDSVCAPS_SPLIT, which is now obsolete - */ -#define DDSVCAPS_RESERVED4 0x00000008l - -/* - * The stereo view is accomplished with switching technology - */ - -#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010L - - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE CAPABILITIES - * - ****************************************************************************/ - -/* - * Index is 4 bits. There are sixteen color entries in the palette table. - */ -#define DDPCAPS_4BIT 0x00000001l - -/* - * Index is onto a 8 bit color index. This field is only valid with the - * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target - * surface is in 8bpp. Each color entry is one byte long and is an index - * into destination surface's 8bpp palette. - */ -#define DDPCAPS_8BITENTRIES 0x00000002l - -/* - * Index is 8 bits. There are 256 color entries in the palette table. - */ -#define DDPCAPS_8BIT 0x00000004l - -/* - * Indicates that this DIRECTDRAWPALETTE should use the palette color array - * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE - * object. - * This flag is obsolete. DirectDraw always initializes the color array from - * the lpDDColorArray parameter. The definition remains for source-level - * compatibility. - */ -#define DDPCAPS_INITIALIZE 0x00000000l - -/* - * This palette is the one attached to the primary surface. Changing this - * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified - * and supported. - */ -#define DDPCAPS_PRIMARYSURFACE 0x00000010l - -/* - * This palette is the one attached to the primary surface left. Changing - * this table has immediate effect on the display for the left eye unless - * DDPSETPAL_VSYNC is specified and supported. - */ -#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020l - -/* - * This palette can have all 256 entries defined - */ -#define DDPCAPS_ALLOW256 0x00000040l - -/* - * This palette can have modifications to it synced with the monitors - * refresh rate. - */ -#define DDPCAPS_VSYNC 0x00000080l - -/* - * Index is 1 bit. There are two color entries in the palette table. - */ -#define DDPCAPS_1BIT 0x00000100l - -/* - * Index is 2 bit. There are four color entries in the palette table. - */ -#define DDPCAPS_2BIT 0x00000200l - -/* - * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value - */ -#define DDPCAPS_ALPHA 0x00000400l - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE SETENTRY CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE GETENTRY CONSTANTS - * - ****************************************************************************/ - -/* 0 is the only legal value */ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS - * - ****************************************************************************/ - -/* - * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData - * must be set to sizeof(IUnknown*). DirectDraw will call AddRef through this - * pointer and Release when the private data is destroyed. This includes when - * the surface or palette is destroyed before such priovate data is destroyed. - */ -#define DDSPD_IUNKNOWNPOINTER 0x00000001L - -/* - * Private data is only valid for the current state of the object, - * as determined by the uniqueness value. - */ -#define DDSPD_VOLATILE 0x00000002L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPALETTE CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAW BITDEPTH CONSTANTS - * - * NOTE: These are only used to indicate supported bit depths. These - * are flags only, they are not to be used as an actual bit depth. The - * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual - * bit depths in a surface or for changing the display mode. - * - ****************************************************************************/ - -/* - * 1 bit per pixel. - */ -#define DDBD_1 0x00004000l - -/* - * 2 bits per pixel. - */ -#define DDBD_2 0x00002000l - -/* - * 4 bits per pixel. - */ -#define DDBD_4 0x00001000l - -/* - * 8 bits per pixel. - */ -#define DDBD_8 0x00000800l - -/* - * 16 bits per pixel. - */ -#define DDBD_16 0x00000400l - -/* - * 24 bits per pixel. - */ -#define DDBD_24 0X00000200l - -/* - * 32 bits per pixel. - */ -#define DDBD_32 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS - * - ****************************************************************************/ - -/* - * Set if the structure contains a color space. Not set if the structure - * contains a single color key. - */ -#define DDCKEY_COLORSPACE 0x00000001l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for blt operations. - */ -#define DDCKEY_DESTBLT 0x00000002l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for overlay operations. - */ -#define DDCKEY_DESTOVERLAY 0x00000004l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for blt operations. - */ -#define DDCKEY_SRCBLT 0x00000008l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for overlay operations. - */ -#define DDCKEY_SRCOVERLAY 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW COLOR KEY CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLT 0x00000001l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004l - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTYUV 0x00000008l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the surface - * being overlayed for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAY 0x00000010l - -/* - * Supports a color space as the color key for the destination for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020l - -/* - * Supports a color space as the color key for the destination for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040l - -/* - * Supports only one active destination color key value for visible overlay - * surfaces. - */ -#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the - * surface being overlayed for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100l - -/* - * Supports transparent blting using the color key for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLT 0x00000200l - -/* - * Supports transparent blting using a color space for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400l - -/* - * Supports transparent blting using a color space for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800l - -/* - * Supports transparent blting using the color key for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTYUV 0x00001000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAY 0x00002000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000l - -/* - * Supports only one active source color key value for visible - * overlay surfaces. - */ -#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000l - -/* - * there are no bandwidth trade-offs for using colorkey with an overlay - */ -#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000l - - -/**************************************************************************** - * - * DIRECTDRAW PIXELFORMAT FLAGS - * - ****************************************************************************/ - -/* - * The surface has alpha channel information in the pixel format. - */ -#define DDPF_ALPHAPIXELS 0x00000001l - -/* - * The pixel format contains alpha only information - */ -#define DDPF_ALPHA 0x00000002l - -/* - * The FourCC code is valid. - */ -#define DDPF_FOURCC 0x00000004l - -/* - * The surface is 4-bit color indexed. - */ -#define DDPF_PALETTEINDEXED4 0x00000008l - -/* - * The surface is indexed into a palette which stores indices - * into the destination surface's 8-bit palette. - */ -#define DDPF_PALETTEINDEXEDTO8 0x00000010l - -/* - * The surface is 8-bit color indexed. - */ -#define DDPF_PALETTEINDEXED8 0x00000020l - -/* - * The RGB data in the pixel format structure is valid. - */ -#define DDPF_RGB 0x00000040l - -/* - * The surface will accept pixel data in the format specified - * and compress it during the write. - */ -#define DDPF_COMPRESSED 0x00000080l - -/* - * The surface will accept RGB data and translate it during - * the write to YUV data. The format of the data to be written - * will be contained in the pixel format structure. The DDPF_RGB - * flag will be set. - */ -#define DDPF_RGBTOYUV 0x00000100l - -/* - * pixel format is YUV - YUV data in pixel format struct is valid - */ -#define DDPF_YUV 0x00000200l - -/* - * pixel format is a z buffer only surface - */ -#define DDPF_ZBUFFER 0x00000400l - -/* - * The surface is 1-bit color indexed. - */ -#define DDPF_PALETTEINDEXED1 0x00000800l - -/* - * The surface is 2-bit color indexed. - */ -#define DDPF_PALETTEINDEXED2 0x00001000l - -/* - * The surface contains Z information in the pixels - */ -#define DDPF_ZPIXELS 0x00002000l - -/* - * The surface contains stencil information along with Z - */ -#define DDPF_STENCILBUFFER 0x00004000l - -/* - * Premultiplied alpha format -- the color components have been - * premultiplied by the alpha component. - */ -#define DDPF_ALPHAPREMULT 0x00008000l - - -/* - * Luminance data in the pixel format is valid. - * Use this flag for luminance-only or luminance+alpha surfaces, - * the bit depth is then ddpf.dwLuminanceBitCount. - */ -#define DDPF_LUMINANCE 0x00020000l - -/* - * Luminance data in the pixel format is valid. - * Use this flag when hanging luminance off bumpmap surfaces, - * the bit mask for the luminance portion of the pixel is then - * ddpf.dwBumpLuminanceBitMask - */ -#define DDPF_BUMPLUMINANCE 0x00040000l - -/* - * Bump map dUdV data in the pixel format is valid. - */ -#define DDPF_BUMPDUDV 0x00080000l - - -/*=========================================================================== - * - * - * DIRECTDRAW CALLBACK FLAGS - * - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAW ENUMSURFACES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate all of the surfaces that meet the search criterion. - */ -#define DDENUMSURFACES_ALL 0x00000001l - -/* - * A search hit is a surface that matches the surface description. - */ -#define DDENUMSURFACES_MATCH 0x00000002l - -/* - * A search hit is a surface that does not match the surface description. - */ -#define DDENUMSURFACES_NOMATCH 0x00000004l - -/* - * Enumerate the first surface that can be created which meets the search criterion. - */ -#define DDENUMSURFACES_CANBECREATED 0x00000008l - -/* - * Enumerate the surfaces that already exist that meet the search criterion. - */ -#define DDENUMSURFACES_DOESEXIST 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW SETDISPLAYMODE FLAGS - * - ****************************************************************************/ - -/* - * The desired mode is a standard VGA mode - */ -#define DDSDM_STANDARDVGAMODE 0x00000001l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMDISPLAYMODES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees - * that a particular mode will be enumerated only once. This flag specifies whether - * the refresh rate is taken into account when determining if a mode is unique. - */ -#define DDEDM_REFRESHRATES 0x00000001l - -/* - * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA - * modes such as mode 0x13 in addition to the usual ModeX modes (which are always - * enumerated if the application has previously called SetCooperativeLevel with the - * DDSCL_ALLOWMODEX flag set). - */ -#define DDEDM_STANDARDVGAMODES 0x00000002L - - -/**************************************************************************** - * - * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS - * - ****************************************************************************/ - -/* - * Exclusive mode owner will be responsible for the entire primary surface. - * GDI can be ignored. used with DD - */ -#define DDSCL_FULLSCREEN 0x00000001l - -/* - * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode - */ -#define DDSCL_ALLOWREBOOT 0x00000002l - -/* - * prevents DDRAW from modifying the application window. - * prevents DDRAW from minimize/restore the application window on activation. - */ -#define DDSCL_NOWINDOWCHANGES 0x00000004l - -/* - * app wants to work as a regular Windows application - */ -#define DDSCL_NORMAL 0x00000008l - -/* - * app wants exclusive access - */ -#define DDSCL_EXCLUSIVE 0x00000010l - - -/* - * app can deal with non-windows display modes - */ -#define DDSCL_ALLOWMODEX 0x00000040l - -/* - * this window will receive the focus messages - */ -#define DDSCL_SETFOCUSWINDOW 0x00000080l - -/* - * this window is associated with the DDRAW object and will - * cover the screen in fullscreen mode - */ -#define DDSCL_SETDEVICEWINDOW 0x00000100l - -/* - * app wants DDRAW to create a window to be associated with the - * DDRAW object - */ -#define DDSCL_CREATEDEVICEWINDOW 0x00000200l - -/* - * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D - * take the global crtisec more frequently. - */ -#define DDSCL_MULTITHREADED 0x00000400l - -/* - * App specifies that it would like to keep the FPU set up for optimal Direct3D - * performance (single precision and exceptions disabled) so Direct3D - * does not need to explicitly set the FPU each time. This is assumed by - * default in DirectX 7. See also DDSCL_FPUPRESERVE - */ -#define DDSCL_FPUSETUP 0x00000800l - -/* - * App specifies that it needs either double precision FPU or FPU exceptions - * enabled. This makes Direct3D explicitly set the FPU state eah time it is - * called. Setting the flag will reduce Direct3D performance. The flag is - * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP - */ -#define DDSCL_FPUPRESERVE 0x00001000l - - -/**************************************************************************** - * - * DIRECTDRAW BLT FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel - * for the destination surface for this blt. - */ -#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha - * channel for the destination for this blt. - */ -#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel - * for the edges of the image that border the color key colors. - */ -#define DDBLT_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Do this blt asynchronously through the FIFO in the order received. If - * there is no room in the hardware FIFO fail the call. - */ -#define DDBLT_ASYNC 0x00000200l - -/* - * Uses the dwFillColor field in the DDBLTFX structure as the RGB color - * to fill the destination rectangle on the destination surface with. - */ -#define DDBLT_COLORFILL 0x00000400l - -/* - * Uses the dwDDFX field in the DDBLTFX structure to specify the effects - * to use for the blt. - */ -#define DDBLT_DDFX 0x00000800l - -/* - * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS - * that are not part of the Win32 API. - */ -#define DDBLT_DDROPS 0x00001000l - -/* - * Use the color key associated with the destination surface. - */ -#define DDBLT_KEYDEST 0x00002000l - -/* - * Use the dckDestColorkey field in the DDBLTFX structure as the color key - * for the destination surface. - */ -#define DDBLT_KEYDESTOVERRIDE 0x00004000l - -/* - * Use the color key associated with the source surface. - */ -#define DDBLT_KEYSRC 0x00008000l - -/* - * Use the dckSrcColorkey field in the DDBLTFX structure as the color key - * for the source surface. - */ -#define DDBLT_KEYSRCOVERRIDE 0x00010000l - -/* - * Use the dwROP field in the DDBLTFX structure for the raster operation - * for this blt. These ROPs are the same as the ones defined in the Win32 API. - */ -#define DDBLT_ROP 0x00020000l - -/* - * Use the dwRotationAngle field in the DDBLTFX structure as the angle - * (specified in 1/100th of a degree) to rotate the surface. - */ -#define DDBLT_ROTATIONANGLE 0x00040000l - -/* - * Z-buffered blt using the z-buffers attached to the source and destination - * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the - * z-buffer opcode. - */ -#define DDBLT_ZBUFFER 0x00080000l - -/* - * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the destination. - */ -#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000l - -/* - * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the destination. - */ -#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000l - -/* - * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the source. - */ -#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000l - -/* - * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the source. - */ -#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000l - -/* - * wait until the device is ready to handle the blt - * this will cause blt to not return DDERR_WASSTILLDRAWING - */ -#define DDBLT_WAIT 0x01000000l - -/* - * Uses the dwFillDepth field in the DDBLTFX structure as the depth value - * to fill the destination rectangle on the destination Z-buffer surface - * with. - */ -#define DDBLT_DEPTHFILL 0x02000000l - - -/* - * wait until the device is ready to handle the blt - * this will cause blt to not return DDERR_WASSTILLDRAWING - */ -#define DDBLT_DONOTWAIT 0x08000000l - -/* - * These flags indicate a presentation blt (i.e. a blt - * that moves surface contents from an offscreen back buffer to the primary - * surface). The driver is not allowed to "queue" more than three such blts. - * The "end" of the presentation blt is indicated, since the - * blt may be clipped, in which case the runtime will call the driver with - * several blts. All blts (even if not clipped) are tagged with DDBLT_PRESENTATION - * and the last (even if not clipped) additionally with DDBLT_LAST_PRESENTATION. - * Thus the true rule is that the driver must not schedule a DDBLT_PRESENTATION - * blt if there are 3 or more DDBLT_PRESENTLAST blts in the hardware pipe. - * If there are such blts in the pipe, the driver should return DDERR_WASSTILLDRAWING - * until the oldest queued DDBLT_LAST_PRESENTATION blts has been retired (i.e. the - * pixels have been actually written to the primary surface). Once the oldest blt - * has been retired, the driver is free to schedule the current blt. - * The goal is to provide a mechanism whereby the device's hardware queue never - * gets more than 3 frames ahead of the frames being generated by the application. - * When excessive queueing occurs, applications become unusable because the application - * visibly lags user input, and such problems make windowed interactive applications impossible. - * Some drivers may not have sufficient knowledge of their hardware's FIFO to know - * when a certain blt has been retired. Such drivers should code cautiously, and - * simply not allow any frames to be queued at all. DDBLT_LAST_PRESENTATION should cause - * such drivers to return DDERR_WASSTILLDRAWING until the accelerator is completely - * finished- exactly as if the application had called Lock on the source surface - * before calling Blt. - * In other words, the driver is allowed and encouraged to - * generate as much latency as it can, but never more than 3 frames worth. - * Implementation detail: Drivers should count blts against the SOURCE surface, not - * against the primary surface. This enables multiple parallel windowed application - * to function more optimally. - * This flag is passed only to DX8 or higher drivers. - * - * APPLICATIONS DO NOT SET THESE FLAGS. THEY ARE SET BY THE DIRECTDRAW RUNTIME. - * - */ -#define DDBLT_PRESENTATION 0x10000000l -#define DDBLT_LAST_PRESENTATION 0x20000000l - - - -/**************************************************************************** - * - * BLTFAST FLAGS - * - ****************************************************************************/ - -#define DDBLTFAST_NOCOLORKEY 0x00000000 -#define DDBLTFAST_SRCCOLORKEY 0x00000001 -#define DDBLTFAST_DESTCOLORKEY 0x00000002 -#define DDBLTFAST_WAIT 0x00000010 -#define DDBLTFAST_DONOTWAIT 0x00000020 - -/**************************************************************************** - * - * FLIP FLAGS - * - ****************************************************************************/ - -#define DDFLIP_WAIT 0x00000001L - -/* - * Indicates that the target surface contains the even field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_EVEN 0x00000002L - -/* - * Indicates that the target surface contains the odd field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_ODD 0x00000004L - -/* - * Causes DirectDraw to perform the physical flip immediately and return - * to the application. Typically, what was the front buffer but is now the back - * buffer will still be visible (depending on timing) until the next vertical - * retrace. Subsequent operations involving the two flipped surfaces will - * not check to see if the physical flip has finished (i.e. will not return - * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)). - * This allows an application to perform Flips at a higher frequency than the - * monitor refresh rate, but may introduce visible artifacts. - * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set, - * DDFLIP_NOVSYNC has no effect. - */ -#define DDFLIP_NOVSYNC 0x00000008L - - -/* - * Flip Interval Flags. These flags indicate how many vertical retraces to wait between - * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each - * surface involved in the flip until the specified number of vertical retraces has - * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set, - * DDFLIP_INTERVALn has no effect. - */ - -/* - * DirectDraw will flip on every other vertical sync - */ -#define DDFLIP_INTERVAL2 0x02000000L - - -/* - * DirectDraw will flip on every third vertical sync - */ -#define DDFLIP_INTERVAL3 0x03000000L - - -/* - * DirectDraw will flip on every fourth vertical sync - */ -#define DDFLIP_INTERVAL4 0x04000000L - -/* - * DirectDraw will flip and display a main stereo surface - */ -#define DDFLIP_STEREO 0x00000010L - -/* - * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish - * to override the default and use time when the accelerator is busy (as denoted by - * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT. - */ -#define DDFLIP_DONOTWAIT 0x00000020L - - -/**************************************************************************** - * - * DIRECTDRAW SURFACE OVERLAY FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for the - * destination overlay. - */ -#define DDOVER_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the - * destination alpha channel for this overlay. - */ -#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. - */ -#define DDOVER_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha - * channel destination for this overlay. - */ -#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha - * channel for the edges of the image that border the color key colors. - */ -#define DDOVER_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the source alpha channel for this overlay. - */ -#define DDOVER_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source - * alpha channel for this overlay. - */ -#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. - */ -#define DDOVER_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel - * source for this overlay. - */ -#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Turn this overlay off. - */ -#define DDOVER_HIDE 0x00000200l - -/* - * Use the color key associated with the destination surface. - */ -#define DDOVER_KEYDEST 0x00000400l - -/* - * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key - * for the destination surface - */ -#define DDOVER_KEYDESTOVERRIDE 0x00000800l - -/* - * Use the color key associated with the source surface. - */ -#define DDOVER_KEYSRC 0x00001000l - -/* - * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key - * for the source surface. - */ -#define DDOVER_KEYSRCOVERRIDE 0x00002000l - -/* - * Turn this overlay on. - */ -#define DDOVER_SHOW 0x00004000l - -/* - * Add a dirty rect to an emulated overlayed surface. - */ -#define DDOVER_ADDDIRTYRECT 0x00008000l - -/* - * Redraw all dirty rects on an emulated overlayed surface. - */ -#define DDOVER_REFRESHDIRTYRECTS 0x00010000l - -/* - * Redraw the entire surface on an emulated overlayed surface. - */ -#define DDOVER_REFRESHALL 0x00020000l - - -/* - * Use the overlay FX flags to define special overlay FX - */ -#define DDOVER_DDFX 0x00080000l - -/* - * Autoflip the overlay when ever the video port autoflips - */ -#define DDOVER_AUTOFLIP 0x00100000l - -/* - * Display each field of video port data individually without - * causing any jittery artifacts - */ -#define DDOVER_BOB 0x00200000l - -/* - * Indicates that bob/weave decisions should not be overridden by other - * interfaces. - */ -#define DDOVER_OVERRIDEBOBWEAVE 0x00400000l - -/* - * Indicates that the surface memory is composed of interleaved fields. - */ -#define DDOVER_INTERLEAVED 0x00800000l - -/* - * Indicates that bob will be performed using hardware rather than - * software or emulated. - */ -#define DDOVER_BOBHARDWARE 0x01000000l - -/* - * Indicates that overlay FX structure contains valid ARGB scaling factors. - */ -#define DDOVER_ARGBSCALEFACTORS 0x02000000l - -/* - * Indicates that ARGB scaling factors can be degraded to fit driver capabilities. - */ -#define DDOVER_DEGRADEARGBSCALING 0x04000000l - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE LOCK FLAGS - * - ****************************************************************************/ - -/* - * The default. Set to indicate that Lock should return a valid memory pointer - * to the top of the specified rectangle. If no rectangle is specified then a - * pointer to the top of the surface is returned. - */ -#define DDLOCK_SURFACEMEMORYPTR 0x00000000L // default - -/* - * Set to indicate that Lock should wait until it can obtain a valid memory - * pointer before returning. If this bit is set, Lock will never return - * DDERR_WASSTILLDRAWING. - */ -#define DDLOCK_WAIT 0x00000001L - -/* - * Set if an event handle is being passed to Lock. Lock will trigger the event - * when it can return the surface memory pointer requested. - */ -#define DDLOCK_EVENT 0x00000002L - -/* - * Indicates that the surface being locked will only be read from. - */ -#define DDLOCK_READONLY 0x00000010L - -/* - * Indicates that the surface being locked will only be written to - */ -#define DDLOCK_WRITEONLY 0x00000020L - - -/* - * Indicates that a system wide lock should not be taken when this surface - * is locked. This has several advantages (cursor responsiveness, ability - * to call more Windows functions, easier debugging) when locking video - * memory surfaces. However, an application specifying this flag must - * comply with a number of conditions documented in the help file. - * Furthermore, this flag cannot be specified when locking the primary. - */ -#define DDLOCK_NOSYSLOCK 0x00000800L - -/* - * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices - * that were referred to in Draw*PrimtiveVB calls since the start of the - * frame (or the last lock without this flag) will be modified during the - * lock. This can be useful when one is only appending data to the vertex - * buffer - */ -#define DDLOCK_NOOVERWRITE 0x00001000L - -/* - * Indicates that no assumptions will be made about the contents of the - * surface or vertex buffer during this lock. - * This enables two things: - * - Direct3D or the driver may provide an alternative memory - * area as the vertex buffer. This is useful when one plans to clear the - * contents of the vertex buffer and fill in new data. - * - Drivers sometimes store surface data in a re-ordered format. - * When the application locks the surface, the driver is forced to un-re-order - * the surface data before allowing the application to see the surface contents. - * This flag is a hint to the driver that it can skip the un-re-ordering process - * since the application plans to overwrite every single pixel in the surface - * or locked rectangle (and so erase any un-re-ordered pixels anyway). - * Applications should always set this flag when they intend to overwrite the entire - * surface or locked rectangle. - */ -#define DDLOCK_DISCARDCONTENTS 0x00002000L - /* - * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS - */ -#define DDLOCK_OKTOSWAP 0x00002000L - -/* - * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish - * to override the default and use time when the accelerator is busy (as denoted by - * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT. - */ -#define DDLOCK_DONOTWAIT 0x00004000L - -/* - * This indicates volume texture lock with front and back specified. - */ -#define DDLOCK_HASVOLUMETEXTUREBOXRECT 0x00008000L - -/* - * This indicates that the driver should not update dirty rect information for this lock. - */ -#define DDLOCK_NODIRTYUPDATE 0x00010000L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGELOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE BLT FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this blt. - */ -#define DDBLTFX_ARITHSTRETCHY 0x00000001l - -/* - * Do this blt mirroring the surface left to right. Spin the - * surface around its y-axis. - */ -#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Do this blt mirroring the surface up and down. Spin the surface - * around its x-axis. - */ -#define DDBLTFX_MIRRORUPDOWN 0x00000004l - -/* - * Schedule this blt to avoid tearing. - */ -#define DDBLTFX_NOTEARING 0x00000008l - -/* - * Do this blt rotating the surface one hundred and eighty degrees. - */ -#define DDBLTFX_ROTATE180 0x00000010l - -/* - * Do this blt rotating the surface two hundred and seventy degrees. - */ -#define DDBLTFX_ROTATE270 0x00000020l - -/* - * Do this blt rotating the surface ninety degrees. - */ -#define DDBLTFX_ROTATE90 0x00000040l - -/* - * Do this z blt using dwZBufferLow and dwZBufferHigh as range values - * specified to limit the bits copied from the source surface. - */ -#define DDBLTFX_ZBUFFERRANGE 0x00000080l - -/* - * Do this z blt adding the dwZBufferBaseDest to each of the sources z values - * before comparing it with the desting z values. - */ -#define DDBLTFX_ZBUFFERBASEDEST 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE OVERLAY FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this overlay. - */ -#define DDOVERFX_ARITHSTRETCHY 0x00000001l - -/* - * Mirror the overlay across the vertical axis - */ -#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Mirror the overlay across the horizontal axis - */ -#define DDOVERFX_MIRRORUPDOWN 0x00000004l - -/* - * Deinterlace the overlay, if possible - */ -#define DDOVERFX_DEINTERLACE 0x00000008l - - -/**************************************************************************** - * - * DIRECTDRAW WAITFORVERTICALBLANK FLAGS - * - ****************************************************************************/ - -/* - * return when the vertical blank interval begins - */ -#define DDWAITVB_BLOCKBEGIN 0x00000001l - -/* - * set up an event to trigger when the vertical blank begins - */ -#define DDWAITVB_BLOCKBEGINEVENT 0x00000002l - -/* - * return when the vertical blank interval ends and display begins - */ -#define DDWAITVB_BLOCKEND 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW GETFLIPSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to flip now? - */ -#define DDGFS_CANFLIP 0x00000001l - -/* - * is the last flip finished? - */ -#define DDGFS_ISFLIPDONE 0x00000002l - -/**************************************************************************** - * - * DIRECTDRAW GETBLTSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to blt now? - */ -#define DDGBS_CANBLT 0x00000001l - -/* - * is the blt to the surface finished? - */ -#define DDGBS_ISBLTDONE 0x00000002l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Enumerate overlays back to front. - */ -#define DDENUMOVERLAYZ_BACKTOFRONT 0x00000000l - -/* - * Enumerate overlays front to back - */ -#define DDENUMOVERLAYZ_FRONTTOBACK 0x00000001l - -/**************************************************************************** - * - * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Send overlay to front - */ -#define DDOVERZ_SENDTOFRONT 0x00000000l - -/* - * Send overlay to back - */ -#define DDOVERZ_SENDTOBACK 0x00000001l - -/* - * Move Overlay forward - */ -#define DDOVERZ_MOVEFORWARD 0x00000002l - -/* - * Move Overlay backward - */ -#define DDOVERZ_MOVEBACKWARD 0x00000003l - -/* - * Move Overlay in front of relative surface - */ -#define DDOVERZ_INSERTINFRONTOF 0x00000004l - -/* - * Move Overlay in back of relative surface - */ -#define DDOVERZ_INSERTINBACKOF 0x00000005l - - -/**************************************************************************** - * - * DIRECTDRAW SETGAMMARAMP FLAGS - * - ****************************************************************************/ - -/* - * Request calibrator to adjust the gamma ramp according to the physical - * properties of the display so that the result should appear identical - * on all systems. - */ -#define DDSGR_CALIBRATE 0x00000001L - - -/**************************************************************************** - * - * DIRECTDRAW STARTMODETEST FLAGS - * - ****************************************************************************/ - -/* - * Indicates that the mode being tested has passed - */ -#define DDSMT_ISTESTREQUIRED 0x00000001L - - -/**************************************************************************** - * - * DIRECTDRAW EVALUATEMODE FLAGS - * - ****************************************************************************/ - -/* - * Indicates that the mode being tested has passed - */ -#define DDEM_MODEPASSED 0x00000001L - -/* - * Indicates that the mode being tested has failed - */ -#define DDEM_MODEFAILED 0x00000002L - - -/*=========================================================================== - * - * - * DIRECTDRAW RETURN CODES - * - * The return values from DirectDraw Commands and Surface that return an HRESULT - * are codes from DirectDraw concerning the results of the action - * requested by DirectDraw. - * - *==========================================================================*/ - -/* - * Status is OK - * - * Issued by: DirectDraw Commands and all callbacks - */ -#define DD_OK S_OK -#define DD_FALSE S_FALSE - -/**************************************************************************** - * - * DIRECTDRAW ENUMCALLBACK RETURN VALUES - * - * EnumCallback returns are used to control the flow of the DIRECTDRAW and - * DIRECTDRAWSURFACE object enumerations. They can only be returned by - * enumeration callback routines. - * - ****************************************************************************/ - -/* - * stop the enumeration - */ -#define DDENUMRET_CANCEL 0 - -/* - * continue the enumeration - */ -#define DDENUMRET_OK 1 - -/**************************************************************************** - * - * DIRECTDRAW ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -/* - * This object is already initialized - */ -#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) - -/* - * This surface can not be attached to the requested surface. - */ -#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) - -/* - * This surface can not be detached from the requested surface. - */ -#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) - -/* - * Support is currently not available. - */ -#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) - -/* - * An exception was encountered while performing the requested operation - */ -#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) - -/* - * Generic failure. - */ -#define DDERR_GENERIC E_FAIL - -/* - * Height of rectangle provided is not a multiple of reqd alignment - */ -#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) - -/* - * Unable to match primary surface creation request with existing - * primary surface. - */ -#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) - -/* - * One or more of the caps bits passed to the callback are incorrect. - */ -#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) - -/* - * DirectDraw does not support provided Cliplist. - */ -#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) - -/* - * DirectDraw does not support the requested mode - */ -#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) - -/* - * DirectDraw received a pointer that was an invalid DIRECTDRAW object. - */ -#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) - -/* - * One or more of the parameters passed to the callback function are - * incorrect. - */ -#define DDERR_INVALIDPARAMS E_INVALIDARG - -/* - * pixel format was invalid as specified - */ -#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) - -/* - * Rectangle provided was invalid. - */ -#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) - -/* - * Operation could not be carried out because one or more surfaces are locked - */ -#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) - -/* - * There is no 3D present. - */ -#define DDERR_NO3D MAKE_DDHRESULT( 170 ) - -/* - * Operation could not be carried out because there is no alpha accleration - * hardware present or available. - */ -#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) - -/* - * Operation could not be carried out because there is no stereo - * hardware present or available. - */ -#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 ) - -/* - * Operation could not be carried out because there is no hardware - * present which supports stereo surfaces - */ -#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 ) - - - -/* - * no clip list available - */ -#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) - -/* - * Operation could not be carried out because there is no color conversion - * hardware present or available. - */ -#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) - -/* - * Create function called without DirectDraw object method SetCooperativeLevel - * being called. - */ -#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) - -/* - * Surface doesn't currently have a color key - */ -#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) - -/* - * Operation could not be carried out because there is no hardware support - * of the dest color key. - */ -#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) - -/* - * No DirectDraw support possible with current display driver - */ -#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) - -/* - * Operation requires the application to have exclusive mode but the - * application does not have exclusive mode. - */ -#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) - -/* - * Flipping visible surfaces is not supported. - */ -#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) - -/* - * There is no GDI present. - */ -#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) - -/* - * Operation could not be carried out because there is no hardware present - * or available. - */ -#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) - -/* - * Requested item was not found - */ -#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) - -/* - * Operation could not be carried out because there is no overlay hardware - * present or available. - */ -#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) - -/* - * Operation could not be carried out because the source and destination - * rectangles are on the same surface and overlap each other. - */ -#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 ) - -/* - * Operation could not be carried out because there is no appropriate raster - * op hardware present or available. - */ -#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) - -/* - * Operation could not be carried out because there is no rotation hardware - * present or available. - */ -#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) - -/* - * Operation could not be carried out because there is no hardware support - * for stretching - */ -#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) - -/* - * DirectDrawSurface is not in 4 bit color palette and the requested operation - * requires 4 bit color palette. - */ -#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) - -/* - * DirectDrawSurface is not in 4 bit color index palette and the requested - * operation requires 4 bit color index palette. - */ -#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) - -/* - * DirectDraw Surface is not in 8 bit color mode and the requested operation - * requires 8 bit color. - */ -#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) - -/* - * Operation could not be carried out because there is no texture mapping - * hardware present or available. - */ -#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) - -/* - * Operation could not be carried out because there is no hardware support - * for vertical blank synchronized operations. - */ -#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) - -/* - * Operation could not be carried out because there is no hardware support - * for zbuffer blting. - */ -#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) - -/* - * Overlay surfaces could not be z layered based on their BltOrder because - * the hardware does not support z layering of overlays. - */ -#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) - -/* - * The hardware needed for the requested operation has already been - * allocated. - */ -#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) - -/* - * hardware does not support clipped overlays - */ -#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) - -/* - * Can only have ony color key active at one time for overlays - */ -#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) - -/* - * Access to this palette is being refused because the palette is already - * locked by another thread. - */ -#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) - -/* - * No src color key specified for this operation. - */ -#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) - -/* - * This surface is already attached to the surface it is being attached to. - */ -#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) - -/* - * This surface is already a dependency of the surface it is being made a - * dependency of. - */ -#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) - -/* - * Access to this surface is being refused because the surface is already - * locked by another thread. - */ -#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) - -/* - * Access to this surface is being refused because no driver exists - * which can supply a pointer to the surface. - * This is most likely to happen when attempting to lock the primary - * surface when no DCI provider is present. - * Will also happen on attempts to lock an optimized surface. - */ -#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) - -/* - * Access to Surface refused because Surface is obscured. - */ -#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) - -/* - * Access to this surface is being refused because the surface is gone. - * The DIRECTDRAWSURFACE object representing this surface should - * have Restore called on it. - */ -#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) - -/* - * The requested surface is not attached. - */ -#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) - -/* - * Height requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) - -/* - * Size requested by DirectDraw is too large -- The individual height and - * width are OK. - */ -#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) - -/* - * Width requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) - -/* - * Action not supported. - */ -#define DDERR_UNSUPPORTED E_NOTIMPL - -/* - * Pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) - -/* - * Bitmask in the pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) - -/* - * The specified stream contains invalid data - */ -#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 ) - -/* - * vertical blank is in progress - */ -#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) - -/* - * Informs DirectDraw that the previous Blt which is transfering information - * to or from this Surface is incomplete. - */ -#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) - - -/* - * The specified surface type requires specification of the COMPLEX flag - */ -#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 ) - - -/* - * Rectangle provided was not horizontally aligned on reqd. boundary - */ -#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) - -/* - * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver - * identifier. - */ -#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) - -/* - * A DirectDraw object representing this driver has already been created - * for this process. - */ -#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) - -/* - * A hardware only DirectDraw object creation was attempted but the driver - * did not support any hardware. - */ -#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) - -/* - * this process already has created a primary surface - */ -#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) - -/* - * software emulation not available. - */ -#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) - -/* - * region passed to Clipper::GetClipList is too small. - */ -#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) - -/* - * an attempt was made to set a clip list for a clipper objec that - * is already monitoring an hwnd. - */ -#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) - -/* - * No clipper object attached to surface object - */ -#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) - -/* - * Clipper notification requires an HWND or - * no HWND has previously been set as the CooperativeLevel HWND. - */ -#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) - -/* - * HWND used by DirectDraw CooperativeLevel has been subclassed, - * this prevents DirectDraw from restoring state. - */ -#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) - -/* - * The CooperativeLevel HWND has already been set. - * It can not be reset while the process has surfaces or palettes created. - */ -#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) - -/* - * No palette object attached to this surface. - */ -#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) - -/* - * No hardware support for 16 or 256 color palettes. - */ -#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) - -/* - * If a clipper object is attached to the source surface passed into a - * BltFast call. - */ -#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) - -/* - * No blter. - */ -#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) - -/* - * No DirectDraw ROP hardware. - */ -#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) - -/* - * returned when GetOverlayPosition is called on a hidden overlay - */ -#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) - -/* - * returned when GetOverlayPosition is called on a overlay that UpdateOverlay - * has never been called on to establish a destionation. - */ -#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) - -/* - * returned when the position of the overlay on the destionation is no longer - * legal for that destionation. - */ -#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) - -/* - * returned when an overlay member is called for a non-overlay surface - */ -#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) - -/* - * An attempt was made to set the cooperative level when it was already - * set to exclusive. - */ -#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) - -/* - * An attempt has been made to flip a surface that is not flippable. - */ -#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) - -/* - * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly - * created. - */ -#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) - -/* - * Surface was not locked. An attempt to unlock a surface that was not - * locked at all, or by this process, has been attempted. - */ -#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) - -/* - * Windows can not create any more DCs, or a DC was requested for a paltte-indexed - * surface when the surface had no palette AND the display mode was not palette-indexed - * (in this case DirectDraw cannot select a proper palette into the DC) - */ -#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) - -/* - * No DC was ever created for this surface. - */ -#define DDERR_NODC MAKE_DDHRESULT( 586 ) - -/* - * This surface can not be restored because it was created in a different - * mode. - */ -#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) - -/* - * This surface can not be restored because it is an implicitly created - * surface. - */ -#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) - -/* - * The surface being used is not a palette-based surface - */ -#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) - - -/* - * The display is currently in an unsupported mode - */ -#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) - -/* - * Operation could not be carried out because there is no mip-map - * texture mapping hardware present or available. - */ -#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) - -/* - * The requested action could not be performed because the surface was of - * the wrong type. - */ -#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) - - -/* - * Device does not support optimized surfaces, therefore no video memory optimized surfaces - */ -#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 ) - -/* - * Surface is an optimized surface, but has not yet been allocated any memory - */ -#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 ) - -/* - * Attempt was made to create or set a device window without first setting - * the focus window - */ -#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 ) - -/* - * Attempt was made to set a palette on a mipmap sublevel - */ -#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 ) - -/* - * A DC has already been returned for this surface. Only one DC can be - * retrieved per surface. - */ -#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) - -/* - * An attempt was made to allocate non-local video memory from a device - * that does not support non-local video memory. - */ -#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 ) - -/* - * The attempt to page lock a surface failed. - */ -#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) - - -/* - * The attempt to page unlock a surface failed. - */ -#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) - -/* - * An attempt was made to page unlock a surface with no outstanding page locks. - */ -#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) - -/* - * There is more data available than the specified buffer size could hold - */ -#define DDERR_MOREDATA MAKE_DDHRESULT( 690 ) - -/* - * The data has expired and is therefore no longer valid. - */ -#define DDERR_EXPIRED MAKE_DDHRESULT( 691 ) - -/* - * The mode test has finished executing. - */ -#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 ) - -/* - * The mode test has switched to a new mode. - */ -#define DDERR_NEWMODE MAKE_DDHRESULT( 693 ) - -/* - * D3D has not yet been initialized. - */ -#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 ) - -/* - * The video port is not active - */ -#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 ) - -/* - * The monitor does not have EDID data. - */ -#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 ) - -/* - * The driver does not enumerate display mode refresh rates. - */ -#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 ) - -/* - * Surfaces created by one direct draw device cannot be used directly by - * another direct draw device. - */ -#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 ) - - - -/* - * An attempt was made to invoke an interface member of a DirectDraw object - * created by CoCreateInstance() before it was initialized. - */ -#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED - - -/* Alpha bit depth constants */ - - -#ifdef __cplusplus -}; -#endif - -#ifdef ENABLE_NAMELESS_UNION_PRAGMA -#pragma warning(default:4201) -#endif - -#endif //__DDRAW_INCLUDED__ - - diff --git a/import/DirectX8/include/ddrawex.h b/import/DirectX8/include/ddrawex.h deleted file mode 100644 index e2b180ba2..000000000 --- a/import/DirectX8/include/ddrawex.h +++ /dev/null @@ -1,218 +0,0 @@ -//********************************************************************* -//* Microsoft Windows ** -//* Copyright(c) Microsoft Corp., 1995-1997 ** -//********************************************************************* -// -// DDRAWEX.H -// -// Header file for DirectDrawEx functionality - -#ifndef __DDRAWEXH__ -#define __DDRAWEXH__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -// {4FD2A832-86C8-11d0-8FCA-00C04FD9189D} -DEFINE_GUID(CLSID_DirectDrawFactory, -0x4fd2a832, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); - -DEFINE_GUID(IID_IDirectDrawFactory, -0x4fd2a833, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); - -#ifndef DIRECTDRAW_VERSION - -//Functionality supported by DDrawex but not DX3 -#define DDSD_LPSURFACE 0x00000800l - -DEFINE_GUID( IID_IDirectDrawSurface3, -0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); - -typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; - -#undef INTERFACE -#define INTERFACE IDirectDrawSurface3 -DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the v3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD ) PURE; -}; -#endif - - - - -#define DDSCAPS_DATAEXCHANGE (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY) - -#undef INTERFACE -#define INTERFACE IDirectDrawFactory - -DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawFactory methods ***/ - STDMETHOD(CreateDirectDraw) (THIS_ GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE; - STDMETHOD(DirectDrawEnumerate) (THIS_ LPDDENUMCALLBACK lpCallback, LPVOID lpContext) PURE; -}; - - - -// {618F8AD4-8B7A-11d0-8FCC-00C04FD9189D} -DEFINE_GUID(IID_IDirectDraw3, -0x618f8ad4, 0x8b7a, 0x11d0, 0x8f, 0xcc, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); - -typedef struct IDirectDraw3 FAR *LPDIRECTDRAW3; - -#undef INTERFACE -#define INTERFACE IDirectDraw3 - -DECLARE_INTERFACE_(IDirectDraw3, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; - /*** IDirectDraw3 methods ***/ - STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, IDirectDrawSurface **) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw3_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw3_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw3_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw3_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw3_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw3_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw3_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw3_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw3_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw3_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw3_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw3_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw3_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw3_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw3_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw3_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw3_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw3_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw3_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw3_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw3_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw3_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#define IDirectDraw3_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) -#endif - - - -/*=========================================================================== - * - * - * DIRECTDRAWEX RETURN CODES - * - * The return values from DirectDrawEx Commands and Surface that return an - * HRESULT are codes from DirectDrawEx concerning the results of the action - * requested by DirectDrawEx. - * - *==========================================================================*/ - -/* - * An attempt was made to load ddraw.dll - */ -#define DDERR_LOADFAILED MAKE_DDHRESULT( 901 ) - -/* - * Unable to determine module/os version number - */ -#define DDERR_BADVERSIONINFO MAKE_DDHRESULT( 902 ) - -/* - * Unable to determine address of ddraw.dll exported symbol (DirectDrawCreate or - * DirectDrawEnumerate). - */ -#define DDERR_BADPROCADDRESS MAKE_DDHRESULT( 903 ) - -/* - * Legacy usage: do not use QI() to create D3D device objects from surface objects. - * Use IDirect3D2::CreateDevice() - */ -#define DDERR_LEGACYUSAGE MAKE_DDHRESULT( 904 ) - -#ifdef __cplusplus -} -#endif - - -#endif // __DDRAWEXH__ diff --git a/import/DirectX8/include/ddstream.h b/import/DirectX8/include/ddstream.h deleted file mode 100644 index e17a7313b..000000000 --- a/import/DirectX8/include/ddstream.h +++ /dev/null @@ -1,533 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for ddstream.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __ddstream_h__ -#define __ddstream_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDirectDrawMediaStream_FWD_DEFINED__ -#define __IDirectDrawMediaStream_FWD_DEFINED__ -typedef interface IDirectDrawMediaStream IDirectDrawMediaStream; -#endif /* __IDirectDrawMediaStream_FWD_DEFINED__ */ - - -#ifndef __IDirectDrawStreamSample_FWD_DEFINED__ -#define __IDirectDrawStreamSample_FWD_DEFINED__ -typedef interface IDirectDrawStreamSample IDirectDrawStreamSample; -#endif /* __IDirectDrawStreamSample_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "mmstream.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_ddstream_0000 */ -/* [local] */ - -// -// The following declarations within the 'if 0' block are dummy typedefs used to make -// the ddstream.idl file build. The actual definitions are contained in DDRAW.H -// -#if 0 -typedef void *LPDDSURFACEDESC; - -typedef struct tDDSURFACEDESC DDSURFACEDESC; - -#endif -#include - -enum __MIDL___MIDL_itf_ddstream_0000_0001 - { DDSFF_PROGRESSIVERENDER = 0x1 - } ; - - - - - - - -extern RPC_IF_HANDLE __MIDL_itf_ddstream_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_ddstream_0000_v0_0_s_ifspec; - -#ifndef __IDirectDrawMediaStream_INTERFACE_DEFINED__ -#define __IDirectDrawMediaStream_INTERFACE_DEFINED__ - -/* interface IDirectDrawMediaStream */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDirectDrawMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F4104FCE-9A70-11d0-8FDE-00C04FD9189D") - IDirectDrawMediaStream : public IMediaStream - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFormat( - /* [out] */ DDSURFACEDESC *pDDSDCurrent, - /* [out] */ IDirectDrawPalette **ppDirectDrawPalette, - /* [out] */ DDSURFACEDESC *pDDSDDesired, - /* [out] */ DWORD *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFormat( - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ IDirectDrawPalette *pDirectDrawPalette) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDirectDraw( - /* [out] */ IDirectDraw **ppDirectDraw) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDirectDraw( - /* [in] */ IDirectDraw *pDirectDraw) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateSample( - /* [in] */ IDirectDrawSurface *pSurface, - /* [in] */ const RECT *pRect, - /* [in] */ DWORD dwFlags, - /* [out] */ IDirectDrawStreamSample **ppSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimePerFrame( - /* [out] */ STREAM_TIME *pFrameTime) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDirectDrawMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDirectDrawMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDirectDrawMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDirectDrawMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetMultiMediaStream )( - IDirectDrawMediaStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IDirectDrawMediaStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetSameFormat )( - IDirectDrawMediaStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *AllocateSample )( - IDirectDrawMediaStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *CreateSharedSample )( - IDirectDrawMediaStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - HRESULT ( STDMETHODCALLTYPE *SendEndOfStream )( - IDirectDrawMediaStream * This, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetFormat )( - IDirectDrawMediaStream * This, - /* [out] */ DDSURFACEDESC *pDDSDCurrent, - /* [out] */ IDirectDrawPalette **ppDirectDrawPalette, - /* [out] */ DDSURFACEDESC *pDDSDDesired, - /* [out] */ DWORD *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE *SetFormat )( - IDirectDrawMediaStream * This, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ IDirectDrawPalette *pDirectDrawPalette); - - HRESULT ( STDMETHODCALLTYPE *GetDirectDraw )( - IDirectDrawMediaStream * This, - /* [out] */ IDirectDraw **ppDirectDraw); - - HRESULT ( STDMETHODCALLTYPE *SetDirectDraw )( - IDirectDrawMediaStream * This, - /* [in] */ IDirectDraw *pDirectDraw); - - HRESULT ( STDMETHODCALLTYPE *CreateSample )( - IDirectDrawMediaStream * This, - /* [in] */ IDirectDrawSurface *pSurface, - /* [in] */ const RECT *pRect, - /* [in] */ DWORD dwFlags, - /* [out] */ IDirectDrawStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *GetTimePerFrame )( - IDirectDrawMediaStream * This, - /* [out] */ STREAM_TIME *pFrameTime); - - END_INTERFACE - } IDirectDrawMediaStreamVtbl; - - interface IDirectDrawMediaStream - { - CONST_VTBL struct IDirectDrawMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDirectDrawMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDirectDrawMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDirectDrawMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDirectDrawMediaStream_GetMultiMediaStream(This,ppMultiMediaStream) \ - (This)->lpVtbl -> GetMultiMediaStream(This,ppMultiMediaStream) - -#define IDirectDrawMediaStream_GetInformation(This,pPurposeId,pType) \ - (This)->lpVtbl -> GetInformation(This,pPurposeId,pType) - -#define IDirectDrawMediaStream_SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) \ - (This)->lpVtbl -> SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) - -#define IDirectDrawMediaStream_AllocateSample(This,dwFlags,ppSample) \ - (This)->lpVtbl -> AllocateSample(This,dwFlags,ppSample) - -#define IDirectDrawMediaStream_CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) \ - (This)->lpVtbl -> CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) - -#define IDirectDrawMediaStream_SendEndOfStream(This,dwFlags) \ - (This)->lpVtbl -> SendEndOfStream(This,dwFlags) - - -#define IDirectDrawMediaStream_GetFormat(This,pDDSDCurrent,ppDirectDrawPalette,pDDSDDesired,pdwFlags) \ - (This)->lpVtbl -> GetFormat(This,pDDSDCurrent,ppDirectDrawPalette,pDDSDDesired,pdwFlags) - -#define IDirectDrawMediaStream_SetFormat(This,pDDSurfaceDesc,pDirectDrawPalette) \ - (This)->lpVtbl -> SetFormat(This,pDDSurfaceDesc,pDirectDrawPalette) - -#define IDirectDrawMediaStream_GetDirectDraw(This,ppDirectDraw) \ - (This)->lpVtbl -> GetDirectDraw(This,ppDirectDraw) - -#define IDirectDrawMediaStream_SetDirectDraw(This,pDirectDraw) \ - (This)->lpVtbl -> SetDirectDraw(This,pDirectDraw) - -#define IDirectDrawMediaStream_CreateSample(This,pSurface,pRect,dwFlags,ppSample) \ - (This)->lpVtbl -> CreateSample(This,pSurface,pRect,dwFlags,ppSample) - -#define IDirectDrawMediaStream_GetTimePerFrame(This,pFrameTime) \ - (This)->lpVtbl -> GetTimePerFrame(This,pFrameTime) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_GetFormat_Proxy( - IDirectDrawMediaStream * This, - /* [out] */ DDSURFACEDESC *pDDSDCurrent, - /* [out] */ IDirectDrawPalette **ppDirectDrawPalette, - /* [out] */ DDSURFACEDESC *pDDSDDesired, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IDirectDrawMediaStream_GetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_SetFormat_Proxy( - IDirectDrawMediaStream * This, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ IDirectDrawPalette *pDirectDrawPalette); - - -void __RPC_STUB IDirectDrawMediaStream_SetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_GetDirectDraw_Proxy( - IDirectDrawMediaStream * This, - /* [out] */ IDirectDraw **ppDirectDraw); - - -void __RPC_STUB IDirectDrawMediaStream_GetDirectDraw_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_SetDirectDraw_Proxy( - IDirectDrawMediaStream * This, - /* [in] */ IDirectDraw *pDirectDraw); - - -void __RPC_STUB IDirectDrawMediaStream_SetDirectDraw_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_CreateSample_Proxy( - IDirectDrawMediaStream * This, - /* [in] */ IDirectDrawSurface *pSurface, - /* [in] */ const RECT *pRect, - /* [in] */ DWORD dwFlags, - /* [out] */ IDirectDrawStreamSample **ppSample); - - -void __RPC_STUB IDirectDrawMediaStream_CreateSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawMediaStream_GetTimePerFrame_Proxy( - IDirectDrawMediaStream * This, - /* [out] */ STREAM_TIME *pFrameTime); - - -void __RPC_STUB IDirectDrawMediaStream_GetTimePerFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDirectDrawMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IDirectDrawStreamSample_INTERFACE_DEFINED__ -#define __IDirectDrawStreamSample_INTERFACE_DEFINED__ - -/* interface IDirectDrawStreamSample */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDirectDrawStreamSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F4104FCF-9A70-11d0-8FDE-00C04FD9189D") - IDirectDrawStreamSample : public IStreamSample - { - public: - virtual HRESULT STDMETHODCALLTYPE GetSurface( - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRect( - /* [in] */ const RECT *pRect) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDirectDrawStreamSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDirectDrawStreamSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDirectDrawStreamSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDirectDrawStreamSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IDirectDrawStreamSample * This, - /* [in] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetSampleTimes )( - IDirectDrawStreamSample * This, - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *SetSampleTimes )( - IDirectDrawStreamSample * This, - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime); - - HRESULT ( STDMETHODCALLTYPE *Update )( - IDirectDrawStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData); - - HRESULT ( STDMETHODCALLTYPE *CompletionStatus )( - IDirectDrawStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds); - - HRESULT ( STDMETHODCALLTYPE *GetSurface )( - IDirectDrawStreamSample * This, - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect); - - HRESULT ( STDMETHODCALLTYPE *SetRect )( - IDirectDrawStreamSample * This, - /* [in] */ const RECT *pRect); - - END_INTERFACE - } IDirectDrawStreamSampleVtbl; - - interface IDirectDrawStreamSample - { - CONST_VTBL struct IDirectDrawStreamSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDirectDrawStreamSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDirectDrawStreamSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDirectDrawStreamSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDirectDrawStreamSample_GetMediaStream(This,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,ppMediaStream) - -#define IDirectDrawStreamSample_GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) \ - (This)->lpVtbl -> GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) - -#define IDirectDrawStreamSample_SetSampleTimes(This,pStartTime,pEndTime) \ - (This)->lpVtbl -> SetSampleTimes(This,pStartTime,pEndTime) - -#define IDirectDrawStreamSample_Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) \ - (This)->lpVtbl -> Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) - -#define IDirectDrawStreamSample_CompletionStatus(This,dwFlags,dwMilliseconds) \ - (This)->lpVtbl -> CompletionStatus(This,dwFlags,dwMilliseconds) - - -#define IDirectDrawStreamSample_GetSurface(This,ppDirectDrawSurface,pRect) \ - (This)->lpVtbl -> GetSurface(This,ppDirectDrawSurface,pRect) - -#define IDirectDrawStreamSample_SetRect(This,pRect) \ - (This)->lpVtbl -> SetRect(This,pRect) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDirectDrawStreamSample_GetSurface_Proxy( - IDirectDrawStreamSample * This, - /* [out] */ IDirectDrawSurface **ppDirectDrawSurface, - /* [out] */ RECT *pRect); - - -void __RPC_STUB IDirectDrawStreamSample_GetSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDirectDrawStreamSample_SetRect_Proxy( - IDirectDrawStreamSample * This, - /* [in] */ const RECT *pRect); - - -void __RPC_STUB IDirectDrawStreamSample_SetRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDirectDrawStreamSample_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dls1.h b/import/DirectX8/include/dls1.h deleted file mode 100644 index fc88a3170..000000000 --- a/import/DirectX8/include/dls1.h +++ /dev/null @@ -1,267 +0,0 @@ -/*==========================================================================; -// -// dls1.h -// -// -// Description: -// -// Interface defines and structures for the Instrument Collection Form -// RIFF DLS. -// -// -// Written by Sonic Foundry 1996. Released for public use. -// -//=========================================================================*/ - -#ifndef _INC_DLS1 -#define _INC_DLS1 - -/*////////////////////////////////////////////////////////////////////////// -// -// -// Layout of an instrument collection: -// -// -// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST] -// -// INSTLIST -// LIST [] 'lins' -// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] -// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] -// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] -// -// RGNLIST -// LIST [] 'lrgn' -// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] -// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] -// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] -// -// ARTLIST -// LIST [] 'lart' -// 'art1' level 1 Articulation connection graph -// 'art2' level 2 Articulation connection graph -// '3rd1' Possible 3rd party articulation structure 1 -// '3rd2' Possible 3rd party articulation structure 2 .... and so on -// -// WAVEPOOL -// ptbl [] [pool table] -// LIST [] 'wvpl' -// [path], -// [path], -// LIST [] 'wave' [dlid,RIFFWAVE] -// LIST [] 'wave' [dlid,RIFFWAVE] -// LIST [] 'wave' [dlid,RIFFWAVE] -// LIST [] 'wave' [dlid,RIFFWAVE] -// LIST [] 'wave' [dlid,RIFFWAVE] -// -// INFOLIST -// LIST [] 'INFO' -// 'icmt' 'One of those crazy comments.' -// 'icop' 'Copyright (C) 1996 Sonic Foundry' -// -/////////////////////////////////////////////////////////////////////////*/ - - -/*///////////////////////////////////////////////////////////////////////// -// FOURCC's used in the DLS file -/////////////////////////////////////////////////////////////////////////*/ - -#define FOURCC_DLS mmioFOURCC('D','L','S',' ') -#define FOURCC_DLID mmioFOURCC('d','l','i','d') -#define FOURCC_COLH mmioFOURCC('c','o','l','h') -#define FOURCC_WVPL mmioFOURCC('w','v','p','l') -#define FOURCC_PTBL mmioFOURCC('p','t','b','l') -#define FOURCC_PATH mmioFOURCC('p','a','t','h') -#define FOURCC_wave mmioFOURCC('w','a','v','e') -#define FOURCC_LINS mmioFOURCC('l','i','n','s') -#define FOURCC_INS mmioFOURCC('i','n','s',' ') -#define FOURCC_INSH mmioFOURCC('i','n','s','h') -#define FOURCC_LRGN mmioFOURCC('l','r','g','n') -#define FOURCC_RGN mmioFOURCC('r','g','n',' ') -#define FOURCC_RGNH mmioFOURCC('r','g','n','h') -#define FOURCC_LART mmioFOURCC('l','a','r','t') -#define FOURCC_ART1 mmioFOURCC('a','r','t','1') -#define FOURCC_WLNK mmioFOURCC('w','l','n','k') -#define FOURCC_WSMP mmioFOURCC('w','s','m','p') -#define FOURCC_VERS mmioFOURCC('v','e','r','s') - -/*///////////////////////////////////////////////////////////////////////// -// Articulation connection graph definitions -/////////////////////////////////////////////////////////////////////////*/ - -/* Generic Sources */ -#define CONN_SRC_NONE 0x0000 -#define CONN_SRC_LFO 0x0001 -#define CONN_SRC_KEYONVELOCITY 0x0002 -#define CONN_SRC_KEYNUMBER 0x0003 -#define CONN_SRC_EG1 0x0004 -#define CONN_SRC_EG2 0x0005 -#define CONN_SRC_PITCHWHEEL 0x0006 - -/* Midi Controllers 0-127 */ -#define CONN_SRC_CC1 0x0081 -#define CONN_SRC_CC7 0x0087 -#define CONN_SRC_CC10 0x008a -#define CONN_SRC_CC11 0x008b - -/* Generic Destinations */ -#define CONN_DST_NONE 0x0000 -#define CONN_DST_ATTENUATION 0x0001 -#define CONN_DST_PITCH 0x0003 -#define CONN_DST_PAN 0x0004 - -/* LFO Destinations */ -#define CONN_DST_LFO_FREQUENCY 0x0104 -#define CONN_DST_LFO_STARTDELAY 0x0105 - -/* EG1 Destinations */ -#define CONN_DST_EG1_ATTACKTIME 0x0206 -#define CONN_DST_EG1_DECAYTIME 0x0207 -#define CONN_DST_EG1_RELEASETIME 0x0209 -#define CONN_DST_EG1_SUSTAINLEVEL 0x020a - -/* EG2 Destinations */ -#define CONN_DST_EG2_ATTACKTIME 0x030a -#define CONN_DST_EG2_DECAYTIME 0x030b -#define CONN_DST_EG2_RELEASETIME 0x030d -#define CONN_DST_EG2_SUSTAINLEVEL 0x030e - -#define CONN_TRN_NONE 0x0000 -#define CONN_TRN_CONCAVE 0x0001 - -typedef struct _DLSID { - ULONG ulData1; - USHORT usData2; - USHORT usData3; - BYTE abData4[8]; -} DLSID, FAR *LPDLSID; - -typedef struct _DLSVERSION { - DWORD dwVersionMS; - DWORD dwVersionLS; -}DLSVERSION, FAR *LPDLSVERSION; - - -typedef struct _CONNECTION { - USHORT usSource; - USHORT usControl; - USHORT usDestination; - USHORT usTransform; - LONG lScale; - }CONNECTION, FAR *LPCONNECTION; - - -/* Level 1 Articulation Data */ - -typedef struct _CONNECTIONLIST { - ULONG cbSize; /* size of the connection list structure */ - ULONG cConnections; /* count of connections in the list */ - } CONNECTIONLIST, FAR *LPCONNECTIONLIST; - - - -/*///////////////////////////////////////////////////////////////////////// -// Generic type defines for regions and instruments -/////////////////////////////////////////////////////////////////////////*/ - -typedef struct _RGNRANGE { - USHORT usLow; - USHORT usHigh; -}RGNRANGE, FAR * LPRGNRANGE; - -#define F_INSTRUMENT_DRUMS 0x80000000 - -typedef struct _MIDILOCALE { - ULONG ulBank; - ULONG ulInstrument; -}MIDILOCALE, FAR *LPMIDILOCALE; - -/*///////////////////////////////////////////////////////////////////////// -// Header structures found in an DLS file for collection, instruments, and -// regions. -/////////////////////////////////////////////////////////////////////////*/ - -#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001 - -typedef struct _RGNHEADER { - RGNRANGE RangeKey; /* Key range */ - RGNRANGE RangeVelocity; /* Velocity Range */ - USHORT fusOptions; /* Synthesis options for this range */ - USHORT usKeyGroup; /* Key grouping for non simultaneous play */ - /* 0 = no group, 1 up is group */ - /* for Level 1 only groups 1-15 are allowed */ -}RGNHEADER, FAR *LPRGNHEADER; - -typedef struct _INSTHEADER { - ULONG cRegions; /* Count of regions in this instrument */ - MIDILOCALE Locale; /* Intended MIDI locale of this instrument */ -}INSTHEADER, FAR *LPINSTHEADER; - -typedef struct _DLSHEADER { - ULONG cInstruments; /* Count of instruments in the collection */ -}DLSHEADER, FAR *LPDLSHEADER; - -/*//////////////////////////////////////////////////////////////////////////// -// definitions for the Wave link structure -////////////////////////////////////////////////////////////////////////////*/ - -/* **** For level 1 only WAVELINK_CHANNEL_MONO is valid **** */ -/* ulChannel allows for up to 32 channels of audio with each bit position */ -/* specifiying a channel of playback */ - -#define WAVELINK_CHANNEL_LEFT 0x0001l -#define WAVELINK_CHANNEL_RIGHT 0x0002l - -#define F_WAVELINK_PHASE_MASTER 0x0001 - -typedef struct _WAVELINK { /* any paths or links are stored right after struct */ - USHORT fusOptions; /* options flags for this wave */ - USHORT usPhaseGroup; /* Phase grouping for locking channels */ - ULONG ulChannel; /* channel placement */ - ULONG ulTableIndex; /* index into the wave pool table, 0 based */ -}WAVELINK, FAR *LPWAVELINK; - -#define POOL_CUE_NULL 0xffffffffl - -typedef struct _POOLCUE { - ULONG ulOffset; /* Offset to the entry in the list */ -}POOLCUE, FAR *LPPOOLCUE; - -typedef struct _POOLTABLE { - ULONG cbSize; /* size of the pool table structure */ - ULONG cCues; /* count of cues in the list */ - } POOLTABLE, FAR *LPPOOLTABLE; - -/*//////////////////////////////////////////////////////////////////////////// -// Structures for the "wsmp" chunk -////////////////////////////////////////////////////////////////////////////*/ - -#define F_WSMP_NO_TRUNCATION 0x0001l -#define F_WSMP_NO_COMPRESSION 0x0002l - - -typedef struct _rwsmp { - ULONG cbSize; - USHORT usUnityNote; /* MIDI Unity Playback Note */ - SHORT sFineTune; /* Fine Tune in log tuning */ - LONG lAttenuation; /* Overall Attenuation to be applied to data */ - ULONG fulOptions; /* Flag options */ - ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */ - } WSMPL, FAR *LPWSMPL; - - -/* This loop type is a normal forward playing loop which is continually */ -/* played until the envelope reaches an off threshold in the release */ -/* portion of the volume envelope */ - -#define WLOOP_TYPE_FORWARD 0 - -typedef struct _rloop { - ULONG cbSize; - ULONG ulType; /* Loop Type */ - ULONG ulStart; /* Start of loop in samples */ - ULONG ulLength; /* Length of loop in samples */ -} WLOOP, FAR *LPWLOOP; - -#endif /*_INC_DLS1 */ - diff --git a/import/DirectX8/include/dls2.h b/import/DirectX8/include/dls2.h deleted file mode 100644 index 30cec23a2..000000000 --- a/import/DirectX8/include/dls2.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - - dls2.h - - Description: - - Interface defines and structures for the DLS2 extensions of DLS. - - - Written by Microsoft 1998. Released for public use. - -*/ - -#ifndef _INC_DLS2 -#define _INC_DLS2 - -/* - FOURCC's used in the DLS2 file, in addition to DLS1 chunks -*/ - -#define FOURCC_RGN2 mmioFOURCC('r','g','n','2') -#define FOURCC_LAR2 mmioFOURCC('l','a','r','2') -#define FOURCC_ART2 mmioFOURCC('a','r','t','2') -#define FOURCC_CDL mmioFOURCC('c','d','l',' ') -#define FOURCC_DLID mmioFOURCC('d','l','i','d') - -/* - Articulation connection graph definitions. These are in addition to - the definitions in the DLS1 header. -*/ - -/* Generic Sources (in addition to DLS1 sources. */ -#define CONN_SRC_POLYPRESSURE 0x0007 /* Polyphonic Pressure */ -#define CONN_SRC_CHANNELPRESSURE 0x0008 /* Channel Pressure */ -#define CONN_SRC_VIBRATO 0x0009 /* Vibrato LFO */ -#define CONN_SRC_MONOPRESSURE 0x000a /* MIDI Mono pressure */ - - -/* Midi Controllers */ -#define CONN_SRC_CC91 0x00db /* Reverb Send */ -#define CONN_SRC_CC93 0x00dd /* Chorus Send */ - - -/* Generic Destinations */ -#define CONN_DST_GAIN 0x0001 /* Same as CONN_DST_ ATTENUATION, but more appropriate terminology. */ -#define CONN_DST_KEYNUMBER 0x0005 /* Key Number Generator */ - -/* Audio Channel Output Destinations */ -#define CONN_DST_LEFT 0x0010 /* Left Channel Send */ -#define CONN_DST_RIGHT 0x0011 /* Right Channel Send */ -#define CONN_DST_CENTER 0x0012 /* Center Channel Send */ -#define CONN_DST_LEFTREAR 0x0013 /* Left Rear Channel Send */ -#define CONN_DST_RIGHTREAR 0x0014 /* Right Rear Channel Send */ -#define CONN_DST_LFE_CHANNEL 0x0015 /* LFE Channel Send */ -#define CONN_DST_CHORUS 0x0080 /* Chorus Send */ -#define CONN_DST_REVERB 0x0081 /* Reverb Send */ - -/* Vibrato LFO Destinations */ -#define CONN_DST_VIB_FREQUENCY 0x0114 /* Vibrato Frequency */ -#define CONN_DST_VIB_STARTDELAY 0x0115 /* Vibrato Start Delay */ - -/* EG1 Destinations */ -#define CONN_DST_EG1_DELAYTIME 0x020B /* EG1 Delay Time */ -#define CONN_DST_EG1_HOLDTIME 0x020C /* EG1 Hold Time */ -#define CONN_DST_EG1_SHUTDOWNTIME 0x020D /* EG1 Shutdown Time */ - - -/* EG2 Destinations */ -#define CONN_DST_EG2_DELAYTIME 0x030F /* EG2 Delay Time */ -#define CONN_DST_EG2_HOLDTIME 0x0310 /* EG2 Hold Time */ - - -/* Filter Destinations */ -#define CONN_DST_FILTER_CUTOFF 0x0500 /* Filter Cutoff Frequency */ -#define CONN_DST_FILTER_Q 0x0501 /* Filter Resonance */ - - -/* Transforms */ -#define CONN_TRN_CONVEX 0x0002 /* Convex Transform */ -#define CONN_TRN_SWITCH 0x0003 /* Switch Transform */ - - -/* Conditional chunk operators */ - #define DLS_CDL_AND 0x0001 /* X = X & Y */ - #define DLS_CDL_OR 0x0002 /* X = X | Y */ - #define DLS_CDL_XOR 0x0003 /* X = X ^ Y */ - #define DLS_CDL_ADD 0x0004 /* X = X + Y */ - #define DLS_CDL_SUBTRACT 0x0005 /* X = X - Y */ - #define DLS_CDL_MULTIPLY 0x0006 /* X = X * Y */ - #define DLS_CDL_DIVIDE 0x0007 /* X = X / Y */ - #define DLS_CDL_LOGICAL_AND 0x0008 /* X = X && Y */ - #define DLS_CDL_LOGICAL_OR 0x0009 /* X = X || Y */ - #define DLS_CDL_LT 0x000A /* X = (X < Y) */ - #define DLS_CDL_LE 0x000B /* X = (X <= Y) */ - #define DLS_CDL_GT 0x000C /* X = (X > Y) */ - #define DLS_CDL_GE 0x000D /* X = (X >= Y) */ - #define DLS_CDL_EQ 0x000E /* X = (X == Y) */ - #define DLS_CDL_NOT 0x000F /* X = !X */ - #define DLS_CDL_CONST 0x0010 /* 32-bit constant */ - #define DLS_CDL_QUERY 0x0011 /* 32-bit value returned from query */ - #define DLS_CDL_QUERYSUPPORTED 0x0012 /* Test to see if query is supported by synth */ - -/* - Loop and release -*/ - -#define WLOOP_TYPE_RELEASE 1 - -/* - WaveLink chunk -*/ - -#define F_WAVELINK_MULTICHANNEL 0x0002 - - -/* - DLSID queries for -*/ - -DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); -DEFINE_GUID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); -DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); - -#endif /* _INC_DLS2 */ diff --git a/import/DirectX8/include/dmdls.h b/import/DirectX8/include/dmdls.h deleted file mode 100644 index 974e28661..000000000 --- a/import/DirectX8/include/dmdls.h +++ /dev/null @@ -1,199 +0,0 @@ -/************************************************************************ -* * -* dmdls.h -- DLS download definitions for DirectMusic API's * -* * -* Copyright (c) 1998-1999 Microsoft Corporation * -* * -************************************************************************/ - -#ifndef _DMDLS_ -#define _DMDLS_ - -#include "dls1.h" - -typedef long PCENT; /* Pitch cents */ -typedef long GCENT; /* Gain cents */ -typedef long TCENT; /* Time cents */ -typedef long PERCENT; /* Per.. cent! */ - -typedef LONGLONG REFERENCE_TIME; -typedef REFERENCE_TIME *LPREFERENCE_TIME; - -#ifndef MAKE_FOURCC -#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) - - -typedef DWORD FOURCC; /* a four character code */ -#endif - -typedef struct _DMUS_DOWNLOADINFO -{ - DWORD dwDLType; /* Instrument or Wave */ - DWORD dwDLId; /* Unique identifier to tag this download. */ - DWORD dwNumOffsetTableEntries; /* Number of index in the offset address table. */ - DWORD cbSize; /* Total size of this memory chunk. */ -} DMUS_DOWNLOADINFO; - -#define DMUS_DOWNLOADINFO_INSTRUMENT 1 -#define DMUS_DOWNLOADINFO_WAVE 2 -#define DMUS_DOWNLOADINFO_INSTRUMENT2 3 /* New version for better DLS2 support. */ - -/* Support for oneshot and streaming wave data - */ -#define DMUS_DOWNLOADINFO_WAVEARTICULATION 4 /* Wave articulation data */ -#define DMUS_DOWNLOADINFO_STREAMINGWAVE 5 /* One chunk of a streaming */ -#define DMUS_DOWNLOADINFO_ONESHOTWAVE 6 - -#define DMUS_DEFAULT_SIZE_OFFSETTABLE 1 - -/* Flags for DMUS_INSTRUMENT's ulFlags member */ - -#define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0) - -typedef struct _DMUS_OFFSETTABLE -{ - ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE]; -} DMUS_OFFSETTABLE; - -typedef struct _DMUS_INSTRUMENT -{ - ULONG ulPatch; - ULONG ulFirstRegionIdx; - ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */ - ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */ - ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */ - ULONG ulFlags; -} DMUS_INSTRUMENT; - -typedef struct _DMUS_REGION -{ - RGNRANGE RangeKey; - RGNRANGE RangeVelocity; - USHORT fusOptions; - USHORT usKeyGroup; - ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */ - ULONG ulNextRegionIdx; /* If zero no more regions */ - ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */ - WAVELINK WaveLink; - WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */ - WLOOP WLOOP[1]; -} DMUS_REGION; - -typedef struct _DMUS_LFOPARAMS -{ - PCENT pcFrequency; - TCENT tcDelay; - GCENT gcVolumeScale; - PCENT pcPitchScale; - GCENT gcMWToVolume; - PCENT pcMWToPitch; -} DMUS_LFOPARAMS; - -typedef struct _DMUS_VEGPARAMS -{ - TCENT tcAttack; - TCENT tcDecay; - PERCENT ptSustain; - TCENT tcRelease; - TCENT tcVel2Attack; - TCENT tcKey2Decay; -} DMUS_VEGPARAMS; - -typedef struct _DMUS_PEGPARAMS -{ - TCENT tcAttack; - TCENT tcDecay; - PERCENT ptSustain; - TCENT tcRelease; - TCENT tcVel2Attack; - TCENT tcKey2Decay; - PCENT pcRange; -} DMUS_PEGPARAMS; - -typedef struct _DMUS_MSCPARAMS -{ - PERCENT ptDefaultPan; -} DMUS_MSCPARAMS; - -typedef struct _DMUS_ARTICPARAMS -{ - DMUS_LFOPARAMS LFO; - DMUS_VEGPARAMS VolEG; - DMUS_PEGPARAMS PitchEG; - DMUS_MSCPARAMS Misc; -} DMUS_ARTICPARAMS; - -typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */ -{ - ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */ - ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */ -} DMUS_ARTICULATION; - -typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */ -{ - ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */ - ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */ - ULONG ulNextArtIdx; /* Additional articulation chunks */ -} DMUS_ARTICULATION2; - -#define DMUS_MIN_DATA_SIZE 4 -/* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */ - -typedef struct _DMUS_EXTENSIONCHUNK -{ - ULONG cbSize; /* Size of extension chunk */ - ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */ - FOURCC ExtCkID; - BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */ -} DMUS_EXTENSIONCHUNK; - -/* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */ - -typedef struct _DMUS_COPYRIGHT -{ - ULONG cbSize; /* Size of copyright information */ - BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */ -} DMUS_COPYRIGHT; - -typedef struct _DMUS_WAVEDATA -{ - ULONG cbSize; - BYTE byData[DMUS_MIN_DATA_SIZE]; -} DMUS_WAVEDATA; - -typedef struct _DMUS_WAVE -{ - ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */ - ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */ - ULONG ulWaveDataIdx; /* Location of actual wave data. */ - WAVEFORMATEX WaveformatEx; -} DMUS_WAVE; - -typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE; -typedef struct _DMUS_NOTERANGE -{ - DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/ - DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/ -} DMUS_NOTERANGE; - -typedef struct _DMUS_WAVEARTDL -{ - ULONG ulDownloadIdIdx; /* Download ID's of each buffer */ - ULONG ulBus; /* Playback bus */ - ULONG ulBuffers; /* Buffers */ - ULONG ulMasterDLId; /* Download ID of master voice of slave group */ - USHORT usOptions; /* Same as DLS2 region options */ -} DMUS_WAVEARTDL, - *LPDMUS_WAVEARTDL; - -typedef struct _DMUS_WAVEDL -{ - ULONG cbWaveData; /* Bytes of wave data */ -} DMUS_WAVEDL, - *LPDMUS_WAVEDL; - -#endif - - diff --git a/import/DirectX8/include/dmerror.h b/import/DirectX8/include/dmerror.h deleted file mode 100644 index 1097aa822..000000000 --- a/import/DirectX8/include/dmerror.h +++ /dev/null @@ -1,843 +0,0 @@ -/************************************************************************ -* * -* dmerror.h -- Error code returned by DirectMusic API's * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -************************************************************************/ - -#ifndef _DMERROR_ -#define _DMERROR_ - -#define FACILITY_DIRECTMUSIC 0x878 /* Shared with DirectSound */ -#define DMUS_ERRBASE 0x1000 /* Make error codes human readable in hex */ - -#ifndef MAKE_HRESULT -#define MAKE_HRESULT(sev,fac,code) \ - ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) -#endif - -#define MAKE_DMHRESULTSUCCESS(code) MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code))) -#define MAKE_DMHRESULTERROR(code) MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code))) - -/* DMUS_S_PARTIALLOAD - * - * The object could only load partially. This can happen if some components are - * not registered properly, such as embedded tracks and tools. This can also happen - * if some content is missing. For example, if a segment uses a DLS collection that - * is not in the loader's current search directory. - */ -#define DMUS_S_PARTIALLOAD MAKE_DMHRESULTSUCCESS(0x091) - -/* DMUS_S_PARTIALDOWNLOAD - * - * Return value from IDirectMusicBand::Download() which indicates that - * some of the instruments safely downloaded, but others failed. This usually - * occurs when some instruments are on PChannels not supported by the performance - * or port. - */ -#define DMUS_S_PARTIALDOWNLOAD MAKE_DMHRESULTSUCCESS(0x092) - -/* DMUS_S_REQUEUE - * - * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the - * performance that it should cue the PMsg again automatically. - */ -#define DMUS_S_REQUEUE MAKE_DMHRESULTSUCCESS(0x200) - -/* DMUS_S_FREE - * - * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the - * performance that it should free the PMsg automatically. - */ -#define DMUS_S_FREE MAKE_DMHRESULTSUCCESS(0x201) - -/* DMUS_S_END - * - * Return value from IDirectMusicTrack::Play() which indicates to the - * segment that the track has no more data after mtEnd. - */ -#define DMUS_S_END MAKE_DMHRESULTSUCCESS(0x202) - -/* DMUS_S_STRING_TRUNCATED - * - * Returned string has been truncated to fit the buffer size. - */ -#define DMUS_S_STRING_TRUNCATED MAKE_DMHRESULTSUCCESS(0x210) - -/* DMUS_S_LAST_TOOL - * - * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg - * is already stamped with the last tool in the graph. The returned PMsg's - * tool pointer is now NULL. - */ -#define DMUS_S_LAST_TOOL MAKE_DMHRESULTSUCCESS(0x211) - -/* DMUS_S_OVER_CHORD - * - * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates - * that no note has been calculated because the music value has the note - * at a position higher than the top note of the chord. This applies only - * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates - * that the caller should not do anything with the note. It is not meant - * to be played against this chord. - */ -#define DMUS_S_OVER_CHORD MAKE_DMHRESULTSUCCESS(0x212) - -/* DMUS_S_UP_OCTAVE - * - * Returned from IDirectMusicPerformance::MIDIToMusic(), and - * IDirectMusicPerformance::MusicToMIDI(), this indicates - * that the note conversion generated a note value that is below 0, - * so it has been bumped up one or more octaves to be in the proper - * MIDI range of 0 through 127. - * Note that this is valid for MIDIToMusic() when using play modes - * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of - * which store MIDI values in wMusicValue. With MusicToMIDI(), it is - * valid for all play modes. - * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code. - */ -#define DMUS_S_UP_OCTAVE MAKE_DMHRESULTSUCCESS(0x213) - -/* DMUS_S_DOWN_OCTAVE - * - * Returned from IDirectMusicPerformance::MIDIToMusic(), and - * IDirectMusicPerformance::MusicToMIDI(), this indicates - * that the note conversion generated a note value that is above 127, - * so it has been bumped down one or more octaves to be in the proper - * MIDI range of 0 through 127. - * Note that this is valid for MIDIToMusic() when using play modes - * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of - * which store MIDI values in wMusicValue. With MusicToMIDI(), it is - * valid for all play modes. - * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code. - */ -#define DMUS_S_DOWN_OCTAVE MAKE_DMHRESULTSUCCESS(0x214) - -/* DMUS_S_NOBUFFERCONTROL - * - * Although the audio output from the port will be routed to the - * same device as the given DirectSound buffer, buffer controls - * such as pan and volume will not affect the output. - * - */ -#define DMUS_S_NOBUFFERCONTROL MAKE_DMHRESULTSUCCESS(0x215) - -/* DMUS_S_GARBAGE_COLLECTED - * - * The requested operation was not performed because during CollectGarbage - * the loader determined that the object had been released. - */ -#define DMUS_S_GARBAGE_COLLECTED MAKE_DMHRESULTSUCCESS(0x216) - -/* DMUS_E_DRIVER_FAILED - * - * An unexpected error was returned from a device driver, indicating - * possible failure of the driver or hardware. - */ -#define DMUS_E_DRIVER_FAILED MAKE_DMHRESULTERROR(0x0101) - -/* DMUS_E_PORTS_OPEN - * - * The requested operation cannot be performed while there are - * instantiated ports in any process in the system. - */ -#define DMUS_E_PORTS_OPEN MAKE_DMHRESULTERROR(0x0102) - -/* DMUS_E_DEVICE_IN_USE - * - * The requested device is already in use (possibly by a non-DirectMusic - * client) and cannot be opened again. - */ -#define DMUS_E_DEVICE_IN_USE MAKE_DMHRESULTERROR(0x0103) - -/* DMUS_E_INSUFFICIENTBUFFER - * - * Buffer is not large enough for requested operation. - */ -#define DMUS_E_INSUFFICIENTBUFFER MAKE_DMHRESULTERROR(0x0104) - -/* DMUS_E_BUFFERNOTSET - * - * No buffer was prepared for the download data. - */ -#define DMUS_E_BUFFERNOTSET MAKE_DMHRESULTERROR(0x0105) - -/* DMUS_E_BUFFERNOTAVAILABLE - * - * Download failed due to inability to access or create download buffer. - */ -#define DMUS_E_BUFFERNOTAVAILABLE MAKE_DMHRESULTERROR(0x0106) - -/* DMUS_E_NOTADLSCOL - * - * Error parsing DLS collection. File is corrupt. - */ -#define DMUS_E_NOTADLSCOL MAKE_DMHRESULTERROR(0x0108) - -/* DMUS_E_INVALIDOFFSET - * - * Wave chunks in DLS collection file are at incorrect offsets. - */ -#define DMUS_E_INVALIDOFFSET MAKE_DMHRESULTERROR(0x0109) - -/* DMUS_E_ALREADY_LOADED - * - * Second attempt to load a DLS collection that is currently open. - */ -#define DMUS_E_ALREADY_LOADED MAKE_DMHRESULTERROR(0x0111) - -/* DMUS_E_INVALIDPOS - * - * Error reading wave data from DLS collection. Indicates bad file. - */ -#define DMUS_E_INVALIDPOS MAKE_DMHRESULTERROR(0x0113) - -/* DMUS_E_INVALIDPATCH - * - * There is no instrument in the collection that matches patch number. - */ -#define DMUS_E_INVALIDPATCH MAKE_DMHRESULTERROR(0x0114) - -/* DMUS_E_CANNOTSEEK - * - * The IStream* doesn't support Seek(). - */ -#define DMUS_E_CANNOTSEEK MAKE_DMHRESULTERROR(0x0115) - -/* DMUS_E_CANNOTWRITE - * - * The IStream* doesn't support Write(). - */ -#define DMUS_E_CANNOTWRITE MAKE_DMHRESULTERROR(0x0116) - -/* DMUS_E_CHUNKNOTFOUND - * - * The RIFF parser doesn't contain a required chunk while parsing file. - */ -#define DMUS_E_CHUNKNOTFOUND MAKE_DMHRESULTERROR(0x0117) - -/* DMUS_E_INVALID_DOWNLOADID - * - * Invalid download id was used in the process of creating a download buffer. - */ -#define DMUS_E_INVALID_DOWNLOADID MAKE_DMHRESULTERROR(0x0119) - -/* DMUS_E_NOT_DOWNLOADED_TO_PORT - * - * Tried to unload an object that was not downloaded or previously unloaded. - */ -#define DMUS_E_NOT_DOWNLOADED_TO_PORT MAKE_DMHRESULTERROR(0x0120) - -/* DMUS_E_ALREADY_DOWNLOADED - * - * Buffer was already downloaded to synth. - */ -#define DMUS_E_ALREADY_DOWNLOADED MAKE_DMHRESULTERROR(0x0121) - -/* DMUS_E_UNKNOWN_PROPERTY - * - * The specified property item was not recognized by the target object. - */ -#define DMUS_E_UNKNOWN_PROPERTY MAKE_DMHRESULTERROR(0x0122) - -/* DMUS_E_SET_UNSUPPORTED - * - * The specified property item may not be set on the target object. - */ -#define DMUS_E_SET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0123) - -/* DMUS_E_GET_UNSUPPORTED - * - * The specified property item may not be retrieved from the target object. - */ -#define DMUS_E_GET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0124) - -/* DMUS_E_NOTMONO - * - * Wave chunk has more than one interleaved channel. DLS format requires MONO. - */ -#define DMUS_E_NOTMONO MAKE_DMHRESULTERROR(0x0125) - -/* DMUS_E_BADARTICULATION - * - * Invalid articulation chunk in DLS collection. - */ -#define DMUS_E_BADARTICULATION MAKE_DMHRESULTERROR(0x0126) - -/* DMUS_E_BADINSTRUMENT - * - * Invalid instrument chunk in DLS collection. - */ -#define DMUS_E_BADINSTRUMENT MAKE_DMHRESULTERROR(0x0127) - -/* DMUS_E_BADWAVELINK - * - * Wavelink chunk in DLS collection points to invalid wave. - */ -#define DMUS_E_BADWAVELINK MAKE_DMHRESULTERROR(0x0128) - -/* DMUS_E_NOARTICULATION - * - * Articulation missing from instrument in DLS collection. - */ -#define DMUS_E_NOARTICULATION MAKE_DMHRESULTERROR(0x0129) - -/* DMUS_E_NOTPCM - * - * Downoaded DLS wave is not in PCM format. -*/ -#define DMUS_E_NOTPCM MAKE_DMHRESULTERROR(0x012A) - -/* DMUS_E_BADWAVE - * - * Bad wave chunk in DLS collection - */ -#define DMUS_E_BADWAVE MAKE_DMHRESULTERROR(0x012B) - -/* DMUS_E_BADOFFSETTABLE - * - * Offset Table for download buffer has errors. - */ -#define DMUS_E_BADOFFSETTABLE MAKE_DMHRESULTERROR(0x012C) - -/* DMUS_E_UNKNOWNDOWNLOAD - * - * Attempted to download unknown data type. - */ -#define DMUS_E_UNKNOWNDOWNLOAD MAKE_DMHRESULTERROR(0x012D) - -/* DMUS_E_NOSYNTHSINK - * - * The operation could not be completed because no sink was connected to - * the synthesizer. - */ -#define DMUS_E_NOSYNTHSINK MAKE_DMHRESULTERROR(0x012E) - -/* DMUS_E_ALREADYOPEN - * - * An attempt was made to open the software synthesizer while it was already - * open. - * ASSERT? - */ -#define DMUS_E_ALREADYOPEN MAKE_DMHRESULTERROR(0x012F) - -/* DMUS_E_ALREADYCLOSE - * - * An attempt was made to close the software synthesizer while it was already - * open. - * ASSERT? - */ -#define DMUS_E_ALREADYCLOSED MAKE_DMHRESULTERROR(0x0130) - -/* DMUS_E_SYNTHNOTCONFIGURED - * - * The operation could not be completed because the software synth has not - * yet been fully configured. - * ASSERT? - */ -#define DMUS_E_SYNTHNOTCONFIGURED MAKE_DMHRESULTERROR(0x0131) - -/* DMUS_E_SYNTHACTIVE - * - * The operation cannot be carried out while the synthesizer is active. - */ -#define DMUS_E_SYNTHACTIVE MAKE_DMHRESULTERROR(0x0132) - -/* DMUS_E_CANNOTREAD - * - * An error occurred while attempting to read from the IStream* object. - */ -#define DMUS_E_CANNOTREAD MAKE_DMHRESULTERROR(0x0133) - -/* DMUS_E_DMUSIC_RELEASED - * - * The operation cannot be performed because the final instance of the - * DirectMusic object was released. Ports cannot be used after final - * release of the DirectMusic object. - */ -#define DMUS_E_DMUSIC_RELEASED MAKE_DMHRESULTERROR(0x0134) - -/* DMUS_E_BUFFER_EMPTY - * - * There was no data in the referenced buffer. - */ -#define DMUS_E_BUFFER_EMPTY MAKE_DMHRESULTERROR(0x0135) - -/* DMUS_E_BUFFER_FULL - * - * There is insufficient space to insert the given event into the buffer. - */ -#define DMUS_E_BUFFER_FULL MAKE_DMHRESULTERROR(0x0136) - -/* DMUS_E_PORT_NOT_CAPTURE - * - * The given operation could not be carried out because the port is a - * capture port. - */ -#define DMUS_E_PORT_NOT_CAPTURE MAKE_DMHRESULTERROR(0x0137) - -/* DMUS_E_PORT_NOT_RENDER - * - * The given operation could not be carried out because the port is a - * render port. - */ -#define DMUS_E_PORT_NOT_RENDER MAKE_DMHRESULTERROR(0x0138) - -/* DMUS_E_DSOUND_NOT_SET - * - * The port could not be created because no DirectSound has been specified. - * Specify a DirectSound interface via the IDirectMusic::SetDirectSound - * method; pass NULL to have DirectMusic manage usage of DirectSound. - */ -#define DMUS_E_DSOUND_NOT_SET MAKE_DMHRESULTERROR(0x0139) - -/* DMUS_E_ALREADY_ACTIVATED - * - * The operation cannot be carried out while the port is active. - */ -#define DMUS_E_ALREADY_ACTIVATED MAKE_DMHRESULTERROR(0x013A) - -/* DMUS_E_INVALIDBUFFER - * - * Invalid DirectSound buffer was handed to port. - */ -#define DMUS_E_INVALIDBUFFER MAKE_DMHRESULTERROR(0x013B) - -/* DMUS_E_WAVEFORMATNOTSUPPORTED - * - * Invalid buffer format was handed to the synth sink. - */ -#define DMUS_E_WAVEFORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x013C) - -/* DMUS_E_SYNTHINACTIVE - * - * The operation cannot be carried out while the synthesizer is inactive. - */ -#define DMUS_E_SYNTHINACTIVE MAKE_DMHRESULTERROR(0x013D) - -/* DMUS_E_DSOUND_ALREADY_SET - * - * IDirectMusic::SetDirectSound has already been called. It may not be - * changed while in use. - */ -#define DMUS_E_DSOUND_ALREADY_SET MAKE_DMHRESULTERROR(0x013E) - -/* DMUS_E_INVALID_EVENT - * - * The given event is invalid (either it is not a valid MIDI message - * or it makes use of running status). The event cannot be packed - * into the buffer. - */ -#define DMUS_E_INVALID_EVENT MAKE_DMHRESULTERROR(0x013F) - -/* DMUS_E_UNSUPPORTED_STREAM - * - * The IStream* object does not contain data supported by the loading object. - */ -#define DMUS_E_UNSUPPORTED_STREAM MAKE_DMHRESULTERROR(0x0150) - -/* DMUS_E_ALREADY_INITED - * - * The object has already been initialized. - */ -#define DMUS_E_ALREADY_INITED MAKE_DMHRESULTERROR(0x0151) - -/* DMUS_E_INVALID_BAND - * - * The file does not contain a valid band. - */ -#define DMUS_E_INVALID_BAND MAKE_DMHRESULTERROR(0x0152) - -/* DMUS_E_TRACK_HDR_NOT_FIRST_CK - * - * The IStream* object's data does not have a track header as the first chunk, - * and therefore can not be read by the segment object. - */ -#define DMUS_E_TRACK_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0155) - -/* DMUS_E_TOOL_HDR_NOT_FIRST_CK - * - * The IStream* object's data does not have a tool header as the first chunk, - * and therefore can not be read by the graph object. - */ -#define DMUS_E_TOOL_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0156) - -/* DMUS_E_INVALID_TRACK_HDR - * - * The IStream* object's data contains an invalid track header (ckid is 0 and - * fccType is NULL,) and therefore can not be read by the segment object. - */ -#define DMUS_E_INVALID_TRACK_HDR MAKE_DMHRESULTERROR(0x0157) - -/* DMUS_E_INVALID_TOOL_HDR - * - * The IStream* object's data contains an invalid tool header (ckid is 0 and - * fccType is NULL,) and therefore can not be read by the graph object. - */ -#define DMUS_E_INVALID_TOOL_HDR MAKE_DMHRESULTERROR(0x0158) - -/* DMUS_E_ALL_TOOLS_FAILED - * - * The graph object was unable to load all tools from the IStream* object data. - * This may be due to errors in the stream, or the tools being incorrectly - * registered on the client. - */ -#define DMUS_E_ALL_TOOLS_FAILED MAKE_DMHRESULTERROR(0x0159) - -/* DMUS_E_ALL_TRACKS_FAILED - * - * The segment object was unable to load all tracks from the IStream* object data. - * This may be due to errors in the stream, or the tracks being incorrectly - * registered on the client. - */ -#define DMUS_E_ALL_TRACKS_FAILED MAKE_DMHRESULTERROR(0x0160) - -/* DMUS_E_NOT_FOUND - * - * The requested item was not contained by the object. - */ -#define DMUS_E_NOT_FOUND MAKE_DMHRESULTERROR(0x0161) - -/* DMUS_E_NOT_INIT - * - * A required object is not initialized or failed to initialize. - */ -#define DMUS_E_NOT_INIT MAKE_DMHRESULTERROR(0x0162) - -/* DMUS_E_TYPE_DISABLED - * - * The requested parameter type is currently disabled. Parameter types may - * be enabled and disabled by certain calls to SetParam(). - */ -#define DMUS_E_TYPE_DISABLED MAKE_DMHRESULTERROR(0x0163) - -/* DMUS_E_TYPE_UNSUPPORTED - * - * The requested parameter type is not supported on the object. - */ -#define DMUS_E_TYPE_UNSUPPORTED MAKE_DMHRESULTERROR(0x0164) - -/* DMUS_E_TIME_PAST - * - * The time is in the past, and the operation can not succeed. - */ -#define DMUS_E_TIME_PAST MAKE_DMHRESULTERROR(0x0165) - -/* DMUS_E_TRACK_NOT_FOUND - * - * The requested track is not contained by the segment. - */ -#define DMUS_E_TRACK_NOT_FOUND MAKE_DMHRESULTERROR(0x0166) - -/* DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT - * - * The track does not support clock time playback or getparam. - */ -#define DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT MAKE_DMHRESULTERROR(0x0167) - -/* DMUS_E_NO_MASTER_CLOCK - * - * There is no master clock in the performance. Be sure to call - * IDirectMusicPerformance::Init(). - */ -#define DMUS_E_NO_MASTER_CLOCK MAKE_DMHRESULTERROR(0x0170) - -/* DMUS_E_LOADER_NOCLASSID - * - * The class id field is required and missing in the DMUS_OBJECTDESC. - */ -#define DMUS_E_LOADER_NOCLASSID MAKE_DMHRESULTERROR(0x0180) - -/* DMUS_E_LOADER_BADPATH - * - * The requested file path is invalid. - */ -#define DMUS_E_LOADER_BADPATH MAKE_DMHRESULTERROR(0x0181) - -/* DMUS_E_LOADER_FAILEDOPEN - * - * File open failed - either file doesn't exist or is locked. - */ -#define DMUS_E_LOADER_FAILEDOPEN MAKE_DMHRESULTERROR(0x0182) - -/* DMUS_E_LOADER_FORMATNOTSUPPORTED - * - * Search data type is not supported. - */ -#define DMUS_E_LOADER_FORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x0183) - -/* DMUS_E_LOADER_FAILEDCREATE - * - * Unable to find or create object. - */ -#define DMUS_E_LOADER_FAILEDCREATE MAKE_DMHRESULTERROR(0x0184) - -/* DMUS_E_LOADER_OBJECTNOTFOUND - * - * Object was not found. - */ -#define DMUS_E_LOADER_OBJECTNOTFOUND MAKE_DMHRESULTERROR(0x0185) - -/* DMUS_E_LOADER_NOFILENAME - * - * The file name is missing from the DMUS_OBJECTDESC. - */ -#define DMUS_E_LOADER_NOFILENAME MAKE_DMHRESULTERROR(0x0186) - -/* DMUS_E_INVALIDFILE - * - * The file requested is not a valid file. - */ -#define DMUS_E_INVALIDFILE MAKE_DMHRESULTERROR(0x0200) - -/* DMUS_E_ALREADY_EXISTS - * - * The tool is already contained in the graph. Create a new instance. - */ -#define DMUS_E_ALREADY_EXISTS MAKE_DMHRESULTERROR(0x0201) - -/* DMUS_E_OUT_OF_RANGE - * - * Value is out of range, for instance the requested length is longer than - * the segment. - */ -#define DMUS_E_OUT_OF_RANGE MAKE_DMHRESULTERROR(0x0202) - -/* DMUS_E_SEGMENT_INIT_FAILED - * - * Segment initialization failed, most likely due to a critical memory situation. - */ -#define DMUS_E_SEGMENT_INIT_FAILED MAKE_DMHRESULTERROR(0x0203) - -/* DMUS_E_ALREADY_SENT - * - * The DMUS_PMSG has already been sent to the performance object via - * IDirectMusicPerformance::SendPMsg(). - */ -#define DMUS_E_ALREADY_SENT MAKE_DMHRESULTERROR(0x0204) - -/* DMUS_E_CANNOT_FREE - * - * The DMUS_PMSG was either not allocated by the performance via - * IDirectMusicPerformance::AllocPMsg(), or it was already freed via - * IDirectMusicPerformance::FreePMsg(). - */ -#define DMUS_E_CANNOT_FREE MAKE_DMHRESULTERROR(0x0205) - -/* DMUS_E_CANNOT_OPEN_PORT - * - * The default system port could not be opened. - */ -#define DMUS_E_CANNOT_OPEN_PORT MAKE_DMHRESULTERROR(0x0206) - -/* DMUS_E_CANNOT_CONVERT - * - * A call to MIDIToMusic() or MusicToMIDI() resulted in an error because - * the requested conversion could not happen. This usually occurs when the - * provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern. - */ -#define DMUS_E_CANNOT_CONVERT MAKE_DMHRESULTERROR(0x0207) -/* misspelling in previous versions of DirectX preserved for backward compatibility */ -#define DMUS_E_CONNOT_CONVERT DMUS_E_CANNOT_CONVERT - -/* DMUS_E_DESCEND_CHUNK_FAIL - * - * DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file - * was reached before the desired chunk was found. - */ -#define DMUS_E_DESCEND_CHUNK_FAIL MAKE_DMHRESULTERROR(0x0210) - -/* DMUS_E_NOT_LOADED - * - * An attempt to use this object failed because it first needs to - * be loaded. - */ -#define DMUS_E_NOT_LOADED MAKE_DMHRESULTERROR(0x0211) - -/* DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE - * - * The activeX scripting engine for the script's language is not compatible with - * DirectMusic. - * - */ -#define DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE MAKE_DMHRESULTERROR(0x0213) - -/* DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE - * - * A varient was used that had a type that is not supported by DirectMusic. - * - */ -#define DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE MAKE_DMHRESULTERROR(0x0214) - -/* DMUS_E_SCRIPT_ERROR_IN_SCRIPT - * - * An error was encountered while parsing or executing the script. - * The pErrorInfo parameter (if supplied) was filled with information about the error. - */ -#define DMUS_E_SCRIPT_ERROR_IN_SCRIPT MAKE_DMHRESULTERROR(0x0215) - -/* DMUS_E_SCRIPT_CANTLOAD_OLEAUT32 - * - * Loading of oleaut32.dll failed. VBScript and other activeX scripting languages - * require use of oleaut32.dll. On platforms where oleaut32.dll is not present, only - * the DirectMusicScript language, which doesn't require oleaut32.dll can be used. - */ -#define DMUS_E_SCRIPT_CANTLOAD_OLEAUT32 MAKE_DMHRESULTERROR(0x0216) - -/* DMUS_E_SCRIPT_LOADSCRIPT_ERROR - * - * An error occured while parsing a script loaded using LoadScript. The script that - * was loaded contains an error. - */ -#define DMUS_E_SCRIPT_LOADSCRIPT_ERROR MAKE_DMHRESULTERROR(0x0217) - -/* DMUS_E_SCRIPT_INVALID_FILE - * - * The script file is invalid. - */ -#define DMUS_E_SCRIPT_INVALID_FILE MAKE_DMHRESULTERROR(0x0218) - -/* DMUS_E_INVALID_SCRIPTTRACK - * - * The file contains an invalid script track. - */ -#define DMUS_E_INVALID_SCRIPTTRACK MAKE_DMHRESULTERROR(0x0219) - -/* DMUS_E_SCRIPT_VARIABLE_NOT_FOUND - * - * The script does not contain a variable with the specified name. - */ -#define DMUS_E_SCRIPT_VARIABLE_NOT_FOUND MAKE_DMHRESULTERROR(0x021A) - -/* DMUS_E_SCRIPT_ROUTINE_NOT_FOUND - * - * The script does not contain a routine with the specified name. - */ -#define DMUS_E_SCRIPT_ROUTINE_NOT_FOUND MAKE_DMHRESULTERROR(0x021B) - -/* DMUS_E_SCRIPT_CONTENT_READONLY - * - * Scripts variables for content referenced or embedded in a script cannot be set. - */ -#define DMUS_E_SCRIPT_CONTENT_READONLY MAKE_DMHRESULTERROR(0x021C) - -/* DMUS_E_SCRIPT_NOT_A_REFERENCE - * - * Attempt was made to set a script's variable by reference to a value that was - * not an object type. - */ -#define DMUS_E_SCRIPT_NOT_A_REFERENCE MAKE_DMHRESULTERROR(0x021D) - -/* DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED - * - * Attempt was made to set a script's variable by value to an object that does - * not support a default value property. - */ -#define DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED MAKE_DMHRESULTERROR(0x021E) - -/* DMUS_E_INVALID_SEGMENTTRIGGERTRACK - * - * The file contains an invalid segment trigger track. - */ -#define DMUS_E_INVALID_SEGMENTTRIGGERTRACK MAKE_DMHRESULTERROR(0x0220) - -/* DMUS_E_INVALID_LYRICSTRACK - * - * The file contains an invalid lyrics track. - */ -#define DMUS_E_INVALID_LYRICSTRACK MAKE_DMHRESULTERROR(0x0221) - -/* DMUS_E_INVALID_PARAMCONTROLTRACK - * - * The file contains an invalid parameter control track. - */ -#define DMUS_E_INVALID_PARAMCONTROLTRACK MAKE_DMHRESULTERROR(0x0222) - -/* DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR - * - * A script written in AudioVBScript could not be read because it contained a statement that - * is not allowed by the AudioVBScript language. - */ -#define DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR MAKE_DMHRESULTERROR(0x0223) - -/* DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR - * - * A script routine written in AudioVBScript failed because an invalid operation occurred. For example, - * adding the number 3 to a segment object would produce this error. So would attempting to call a routine - * that doesn't exist. - */ -#define DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR MAKE_DMHRESULTERROR(0x0224) - -/* DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE - * - * A script routine written in AudioVBScript failed because a function outside of a script failed to complete. - * For example, a call to PlaySegment that fails to play because of low memory would return this error. - */ -#define DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE MAKE_DMHRESULTERROR(0x0225) - -/* DMUS_E_AUDIOPATHS_NOT_VALID - * - * The Performance has set up some PChannels using the AssignPChannel command, which - * makes it not capable of supporting audio paths. - */ -#define DMUS_E_AUDIOPATHS_NOT_VALID MAKE_DMHRESULTERROR(0x0226) - -/* DMUS_E_AUDIOPATHS_IN_USE - * - * This is the inverse of the previous error. - * The Performance has set up some audio paths, which makes is incompatible - * with the calls to allocate pchannels, etc. - */ -#define DMUS_E_AUDIOPATHS_IN_USE MAKE_DMHRESULTERROR(0x0227) - -/* DMUS_E_NO_AUDIOPATH_CONFIG - * - * A segment or song was asked for its embedded audio path configuration, - * but there isn't any. - */ -#define DMUS_E_NO_AUDIOPATH_CONFIG MAKE_DMHRESULTERROR(0x0228) - -/* DMUS_E_AUDIOPATH_INACTIVE - * - * An audiopath is inactive, perhaps because closedown was called. - */ -#define DMUS_E_AUDIOPATH_INACTIVE MAKE_DMHRESULTERROR(0x0229) - -/* DMUS_E_AUDIOPATH_NOBUFFER - * - * An audiopath failed to create because a requested buffer could not be created. - */ -#define DMUS_E_AUDIOPATH_NOBUFFER MAKE_DMHRESULTERROR(0x022A) - -/* DMUS_E_AUDIOPATH_NOPORT - * - * An audiopath could not be used for playback because it lacked port assignments. - */ -#define DMUS_E_AUDIOPATH_NOPORT MAKE_DMHRESULTERROR(0x022B) - -/* DMUS_E_NO_AUDIOPATH - * - * Attempt was made to play segment in audiopath mode and there was no audiopath. - */ -#define DMUS_E_NO_AUDIOPATH MAKE_DMHRESULTERROR(0x022C) - -/* DMUS_E_INVALIDCHUNK - * - * Invalid data was found in a RIFF file chunk. - */ -#define DMUS_E_INVALIDCHUNK MAKE_DMHRESULTERROR(0x022D) - -/* DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER - * - * Attempt was made to create an audiopath that sends to a global effects buffer which did not exist. - */ -#define DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER MAKE_DMHRESULTERROR(0x022E) - -/* DMUS_E_INVALID_CONTAINER_OBJECT - * - * The file does not contain a valid container object. - */ -#define DMUS_E_INVALID_CONTAINER_OBJECT MAKE_DMHRESULTERROR(0x022F) - -#endif diff --git a/import/DirectX8/include/dmksctrl.h b/import/DirectX8/include/dmksctrl.h deleted file mode 100644 index e0cf392cc..000000000 --- a/import/DirectX8/include/dmksctrl.h +++ /dev/null @@ -1,167 +0,0 @@ -/************************************************************************ -* * -* dmksctrl.h -- Definition of IKsControl * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -* * -* This header file contains the definition of IKsControl, which * -* duplicates definitions from ks.h and ksproxy.h. Your code should * -* include ks.h and ksproxy.h directly if you have them (they are * -* provided in the Windows 98 DDK and will be in the Windows NT 5 * -* SDK). * -* * -************************************************************************/ - -#ifndef _DMKSCTRL_ -#define _DMKSCTRL_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) /* Disable warnings on anonymous unions */ - -#include - -#include - -#if !defined(_NTRTL_) - #ifndef DEFINE_GUIDEX - #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name - #endif /* !defined(DEFINE_GUIDEX) */ - - #ifndef STATICGUIDOF - #define STATICGUIDOF(guid) STATIC_##guid - #endif /* !defined(STATICGUIDOF) */ -#endif /* !defined(_NTRTL_) */ - -#ifndef STATIC_IID_IKsControl -#define STATIC_IID_IKsControl\ - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -#endif /* STATIC_IID_IKsControl */ - -/* - * Warning: This will prevent the rest of ks.h from being pulled in if ks.h is - * included after dmksctrl.h. Make sure you do not include both headers in - * the same source file. - */ -#ifndef _KS_ -#define _KS_ - -#if (defined(_MSC_EXTENSIONS) || defined(__cplusplus)) && !defined(CINTERFACE) -typedef struct { - union { - struct { - GUID Set; - ULONG Id; - ULONG Flags; - }; - LONGLONG Alignment; - }; -} KSIDENTIFIER, *PKSIDENTIFIER; -#else -typedef struct { - union { - struct { - GUID Set; - ULONG Id; - ULONG Flags; - } Data; - LONGLONG Alignment; - }; -} KSIDENTIFIER, *PKSIDENTIFIER; -#endif - -typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY, KSMETHOD, *PKSMETHOD, KSEVENT, *PKSEVENT; - -#define KSMETHOD_TYPE_NONE 0x00000000 -#define KSMETHOD_TYPE_READ 0x00000001 -#define KSMETHOD_TYPE_WRITE 0x00000002 -#define KSMETHOD_TYPE_MODIFY 0x00000003 -#define KSMETHOD_TYPE_SOURCE 0x00000004 - -#define KSMETHOD_TYPE_SEND 0x00000001 -#define KSMETHOD_TYPE_SETSUPPORT 0x00000100 -#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200 - -#define KSPROPERTY_TYPE_GET 0x00000001 -#define KSPROPERTY_TYPE_SET 0x00000002 -#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100 -#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200 -#define KSPROPERTY_TYPE_RELATIONS 0x00000400 -#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800 -#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000 -#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000 -#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000 -#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000 -#define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000 - -#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000 -#endif /* _KS_ */ - -#ifndef _IKsControl_ -#define _IKsControl_ - -#ifdef DECLARE_INTERFACE_ - - -#undef INTERFACE -#define INTERFACE IKsControl -DECLARE_INTERFACE_(IKsControl, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /*IKsControl*/ - STDMETHOD(KsProperty)( - THIS_ - IN PKSPROPERTY Property, - IN ULONG PropertyLength, - IN OUT LPVOID PropertyData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD(KsMethod)( - THIS_ - IN PKSMETHOD Method, - IN ULONG MethodLength, - IN OUT LPVOID MethodData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD(KsEvent)( - THIS_ - IN PKSEVENT Event OPTIONAL, - IN ULONG EventLength, - IN OUT LPVOID EventData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; -}; - -#endif /* DECLARE_INTERFACE_ */ -#endif /* _IKsControl_ */ - -#include - -DEFINE_GUID(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96); - -/* These formats are in ksmedia.h - */ -#ifndef _KSMEDIA_ - -DEFINE_GUID(KSDATAFORMAT_SUBTYPE_MIDI, 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00); -DEFINE_GUID(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1); - -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#endif /* _DMKSCTRL */ - - - diff --git a/import/DirectX8/include/dmo.h b/import/DirectX8/include/dmo.h deleted file mode 100644 index 30cc2e9dd..000000000 --- a/import/DirectX8/include/dmo.h +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DMO.h -// -// Desc: Headers needed by almost all DMOs. -// -// Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __DMO_H__ -#define __DMO_H__ - - -#include "mediaerr.h" - -// When using ATL we get collisions on Lock, so in this case rename -// IMediaObject::Lock to IMediaObject::DMOLock - -#ifdef FIX_LOCK_NAME -#define Lock DMOLock -#endif -#include "mediaobj.h" -#ifdef FIX_LOCK_NAME -#undef Lock -#endif -#include "dmoreg.h" -#include "dmort.h" - -#endif //__DMO_H__ diff --git a/import/DirectX8/include/dmodshow.h b/import/DirectX8/include/dmodshow.h deleted file mode 100644 index aa62d0af4..000000000 --- a/import/DirectX8/include/dmodshow.h +++ /dev/null @@ -1,176 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for dmodshow.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __dmodshow_h__ -#define __dmodshow_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDMOWrapperFilter_FWD_DEFINED__ -#define __IDMOWrapperFilter_FWD_DEFINED__ -typedef interface IDMOWrapperFilter IDMOWrapperFilter; -#endif /* __IDMOWrapperFilter_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" -#include "mediaobj.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_dmodshow_0000 */ -/* [local] */ - -DEFINE_GUID(CLSID_DMOWrapperFilter, 0x94297043,0xbd82,0x4dfd,0xb0,0xde,0x81,0x77,0x73,0x9c,0x6d,0x20); -DEFINE_GUID(CLSID_DMOFilterCategory,0xbcd5796c,0xbd52,0x4d30,0xab,0x76,0x70,0xf9,0x75,0xb8,0x91,0x99); - - -extern RPC_IF_HANDLE __MIDL_itf_dmodshow_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dmodshow_0000_v0_0_s_ifspec; - -#ifndef __IDMOWrapperFilter_INTERFACE_DEFINED__ -#define __IDMOWrapperFilter_INTERFACE_DEFINED__ - -/* interface IDMOWrapperFilter */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IDMOWrapperFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("52d6f586-9f0f-4824-8fc8-e32ca04930c2") - IDMOWrapperFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Init( - REFCLSID clsidDMO, - REFCLSID catDMO) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDMOWrapperFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDMOWrapperFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDMOWrapperFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDMOWrapperFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Init )( - IDMOWrapperFilter * This, - REFCLSID clsidDMO, - REFCLSID catDMO); - - END_INTERFACE - } IDMOWrapperFilterVtbl; - - interface IDMOWrapperFilter - { - CONST_VTBL struct IDMOWrapperFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDMOWrapperFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDMOWrapperFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDMOWrapperFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDMOWrapperFilter_Init(This,clsidDMO,catDMO) \ - (This)->lpVtbl -> Init(This,clsidDMO,catDMO) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDMOWrapperFilter_Init_Proxy( - IDMOWrapperFilter * This, - REFCLSID clsidDMO, - REFCLSID catDMO); - - -void __RPC_STUB IDMOWrapperFilter_Init_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDMOWrapperFilter_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dmoimpl.h b/import/DirectX8/include/dmoimpl.h deleted file mode 100644 index 8ba6e3a8e..000000000 --- a/import/DirectX8/include/dmoimpl.h +++ /dev/null @@ -1,645 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DMOImpl.h -// -// Desc: Classes to implement a DMO. -// -// Copyright (c) 2000-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _dmoimpl_h_ -#define _dmoimpl_h_ - -#ifdef _DEBUG -#include -#endif - -// Class to implement a DMO -// -// -// Assumes the number of input and output streams is fixed -// (these are template parameters) -// -// Provides following services: -// -// Basic parameter checking and locking -// Fully implements : -// GetStreamCount -// SetInputType -// SetOutputType -// GetCurrentInputType -// GetCurrentOutputType -// -// Checks if all types are set before streaming -// Automatically calls AllocateStreamingResources before streaming -// if it's not been called already -// Prevents streaming until the types on all non-optional streams -// have been set -// -// -// Derived class implements the following methods : -// -/* - HRESULT InternalGetInputStreamInfo(DWORD dwInputStreamIndex, DWORD *pdwFlags); - HRESULT InternalGetOutputStreamInfo(DWORD dwOutputStreamIndex, DWORD *pdwFlags); - HRESULT InternalCheckInputType(DWORD dwInputStreamIndex, const DMO_MEDIA_TYPE *pmt); - HRESULT InternalCheckOutputType(DWORD dwOutputStreamIndex, const DMO_MEDIA_TYPE *pmt); - HRESULT InternalGetInputType(DWORD dwInputStreamIndex, DWORD dwTypeIndex, - DMO_MEDIA_TYPE *pmt); - HRESULT InternalGetOutputType(DWORD dwOutputStreamIndex, DWORD dwTypeIndex, - DMO_MEDIA_TYPE *pmt); - HRESULT InternalGetInputSizeInfo(DWORD dwInputStreamIndex, DWORD *pcbSize, - DWORD *pcbMaxLookahead, DWORD *pcbAlignment); - HRESULT InternalGetOutputSizeInfo(DWORD dwOutputStreamIndex, DWORD *pcbSize, - DWORD *pcbAlignment); - HRESULT InternalGetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME *prtMaxLatency); - HRESULT InternalSetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME rtMaxLatency); - HRESULT InternalFlush(); - HRESULT InternalDiscontinuity(DWORD dwInputStreamIndex); - HRESULT InternalAllocateStreamingResources(); - HRESULT InternalFreeStreamingResources(); - HRESULT InternalProcessInput(DWORD dwInputStreamIndex, IMediaBuffer *pBuffer, - DWORD dwFlags, REFERENCE_TIME rtTimestamp, - REFERENCE_TIME rtTimelength); - HRESULT InternalProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, - DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, - DWORD *pdwStatus); - HRESULT InternalAcceptingInput(DWORD dwInputStreamIndex); - void Lock(); - void Unlock(); - - Notes: - The derived class is meant to do most work to initialize streaming - in AllocateStreamingResources rather than when types are set. - - This centralizes the work to one - clear place based on the types set for all streams. - - The derived class implements locking. - - The derived class implements the IUnknown methods - - Usage example (1 input and 1 output) : - class CMyDMO : public IMediaObjectImpl, - ... -*/ - - -#define INTERNAL_CALL(_T_, _X_) \ - static_cast<_T_ *>(this)->Internal##_X_ - -template -class IMediaObjectImpl : public IMediaObject -{ -private: - // Member variables - struct { - DWORD fTypeSet:1; - DWORD fIncomplete:1; - DMO_MEDIA_TYPE CurrentMediaType; - } m_InputInfo[NUMBEROFINPUTS], m_OutputInfo[NUMBEROFOUTPUTS]; - - bool m_fTypesSet; - bool m_fFlushed; - bool m_fResourcesAllocated; - -protected: - - // Helpers - bool InputTypeSet(DWORD ulInputStreamIndex) const - { - _ASSERTE(ulInputStreamIndex < NUMBEROFINPUTS); - return 0 != m_InputInfo[ulInputStreamIndex].fTypeSet; - } - - bool OutputTypeSet(DWORD ulOutputStreamIndex) const - { - _ASSERTE(ulOutputStreamIndex < NUMBEROFOUTPUTS); - return 0 != m_OutputInfo[ulOutputStreamIndex].fTypeSet; - } - const DMO_MEDIA_TYPE *InputType(DWORD ulInputStreamIndex) - { - if (!InputTypeSet(ulInputStreamIndex)) { - return NULL; - } - return &m_InputInfo[ulInputStreamIndex].CurrentMediaType; - } - const DMO_MEDIA_TYPE *OutputType(DWORD ulOutputStreamIndex) - { - if (!OutputTypeSet(ulOutputStreamIndex)) { - return NULL; - } - return &m_OutputInfo[ulOutputStreamIndex].CurrentMediaType; - } - - - class LockIt - { - public: - LockIt(_DERIVED_ *p) : m_p(p) - { - static_cast<_DERIVED_ *>(m_p)->Lock(); - } - ~LockIt() - { - static_cast<_DERIVED_ *>(m_p)->Unlock(); - } - _DERIVED_ *const m_p; - }; - - bool CheckTypesSet() - { - m_fTypesSet = false; - DWORD dw; - for (dw = 0; dw < NUMBEROFINPUTS; dw++) { - if (!InputTypeSet(dw)) { - return false; - } - } - for (dw = 0; dw < NUMBEROFOUTPUTS; dw++) { - if (!OutputTypeSet(dw)) { - // Check if it's optional - DWORD dwFlags; -#ifdef _DEBUG - dwFlags = 0xFFFFFFFF; -#endif - INTERNAL_CALL(_DERIVED_, GetOutputStreamInfo)(dw, &dwFlags); - _ASSERTE(0 == (dwFlags & ~(DMO_OUTPUT_STREAMF_WHOLE_SAMPLES | - DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER | - DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE | - DMO_OUTPUT_STREAMF_DISCARDABLE | - DMO_OUTPUT_STREAMF_OPTIONAL))); - if (!(dwFlags & DMO_OUTPUT_STREAMF_OPTIONAL)) { - return false; - } - } - } - m_fTypesSet = true; - return true; - } - - - IMediaObjectImpl() : - m_fTypesSet(false), - m_fFlushed(true), - m_fResourcesAllocated(false) - { - ZeroMemory(&m_InputInfo, sizeof(m_InputInfo)); - ZeroMemory(&m_OutputInfo, sizeof(m_OutputInfo)); - } - - virtual ~IMediaObjectImpl() { - DWORD dwCurrentType; - - for (dwCurrentType = 0; dwCurrentType < NUMBEROFINPUTS; dwCurrentType++) { - if(InputTypeSet(dwCurrentType)) { - MoFreeMediaType(&m_InputInfo[dwCurrentType].CurrentMediaType); - } - } - - for (dwCurrentType = 0; dwCurrentType < NUMBEROFOUTPUTS; dwCurrentType++) { - if(OutputTypeSet(dwCurrentType)) { - MoFreeMediaType(&m_OutputInfo[dwCurrentType].CurrentMediaType); - } - } - } - - - // IMediaObject methods - - - // - // IMediaObject methods - // - STDMETHODIMP GetStreamCount(unsigned long *pulNumberOfInputStreams, unsigned long *pulNumberOfOutputStreams) - { - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (pulNumberOfInputStreams == NULL || - pulNumberOfOutputStreams == NULL) { - return E_POINTER; - } - *pulNumberOfInputStreams = NUMBEROFINPUTS; - *pulNumberOfOutputStreams = NUMBEROFOUTPUTS; - return S_OK; - } - - STDMETHODIMP GetInputStreamInfo(ULONG ulStreamIndex, DWORD *pdwFlags) - { - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (pdwFlags == NULL) { - return E_POINTER; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, GetInputStreamInfo)(ulStreamIndex, pdwFlags); - _ASSERTE(0 == (*pdwFlags & ~(DMO_INPUT_STREAMF_WHOLE_SAMPLES | - DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER | - DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE | - DMO_INPUT_STREAMF_HOLDS_BUFFERS))); - return hr; - } - - STDMETHODIMP GetOutputStreamInfo(ULONG ulStreamIndex, DWORD *pdwFlags) - { - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (ulStreamIndex >= NUMBEROFOUTPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (pdwFlags == NULL) { - return E_POINTER; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, GetOutputStreamInfo)(ulStreamIndex, pdwFlags); - _ASSERTE(0 == (*pdwFlags & ~(DMO_OUTPUT_STREAMF_WHOLE_SAMPLES | - DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER | - DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE | - DMO_OUTPUT_STREAMF_DISCARDABLE | - DMO_OUTPUT_STREAMF_OPTIONAL))); - return hr; - } - - STDMETHODIMP GetInputType(ULONG ulStreamIndex, ULONG ulTypeIndex, DMO_MEDIA_TYPE *pmt) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - return INTERNAL_CALL(_DERIVED_, GetInputType)(ulStreamIndex, ulTypeIndex, pmt); - } - - STDMETHODIMP GetOutputType(ULONG ulStreamIndex, ULONG ulTypeIndex, DMO_MEDIA_TYPE *pmt) { - if (ulStreamIndex >= NUMBEROFOUTPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - return INTERNAL_CALL(_DERIVED_, GetOutputType)(ulStreamIndex, ulTypeIndex, pmt); - } - - STDMETHODIMP GetInputCurrentType(ULONG ulStreamIndex, DMO_MEDIA_TYPE *pmt) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (NULL == pmt) { - return E_POINTER; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (InputTypeSet(ulStreamIndex)) - return MoCopyMediaType(pmt, - &m_InputInfo[ulStreamIndex].CurrentMediaType); - else - return DMO_E_TYPE_NOT_SET; - } - - STDMETHODIMP GetOutputCurrentType(ULONG ulStreamIndex, DMO_MEDIA_TYPE *pmt) { - if (ulStreamIndex >= NUMBEROFOUTPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (NULL == pmt) { - return E_POINTER; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (OutputTypeSet(ulStreamIndex)) - return MoCopyMediaType(pmt, - &m_OutputInfo[ulStreamIndex].CurrentMediaType); - else - return DMO_E_TYPE_NOT_SET; - } - - STDMETHODIMP GetInputSizeInfo(ULONG ulStreamIndex, ULONG *pulSize, ULONG *pcbMaxLookahead, ULONG *pulAlignment) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (NULL == pulSize || NULL == pulAlignment || - NULL == pcbMaxLookahead) { - return E_POINTER; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (!InputTypeSet(ulStreamIndex)) { - return DMO_E_TYPE_NOT_SET; - } - return INTERNAL_CALL(_DERIVED_, GetInputSizeInfo)(ulStreamIndex, pulSize, pcbMaxLookahead, pulAlignment); - } - - STDMETHODIMP GetOutputSizeInfo(ULONG ulStreamIndex, ULONG *pulSize, ULONG *pulAlignment) { - if (ulStreamIndex >= NUMBEROFOUTPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (NULL == pulSize || NULL == pulAlignment) { - return E_POINTER; - } - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (!m_fTypesSet || !OutputTypeSet(ulStreamIndex)) { - return DMO_E_TYPE_NOT_SET; - } - return INTERNAL_CALL(_DERIVED_, GetOutputSizeInfo)(ulStreamIndex, pulSize, pulAlignment); - } - - STDMETHODIMP SetInputType(ULONG ulStreamIndex, const DMO_MEDIA_TYPE *pmt, DWORD dwFlags) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (dwFlags & ~ (DMO_SET_TYPEF_CLEAR | DMO_SET_TYPEF_TEST_ONLY)) { - return E_INVALIDARG; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - if (dwFlags & DMO_SET_TYPEF_CLEAR) { - MoFreeMediaType(&m_InputInfo[ulStreamIndex].CurrentMediaType); - m_InputInfo[ulStreamIndex].fTypeSet = FALSE; - if (!CheckTypesSet()) { - Flush(); - FreeStreamingResources(); - } - return NOERROR; - } - if (NULL == pmt) { - return E_POINTER; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, CheckInputType)(ulStreamIndex, pmt); - if (FAILED(hr)) - return hr; - - if (dwFlags & DMO_SET_TYPEF_TEST_ONLY) { - return NOERROR; - } - - - // actually set the type - DMO_MEDIA_TYPE mtTemp; - if (S_OK == MoCopyMediaType(&mtTemp, pmt)) { - // Free any previous mediatype - if (InputTypeSet(ulStreamIndex)) { - MoFreeMediaType(&m_InputInfo[ulStreamIndex].CurrentMediaType); - } - m_InputInfo[ulStreamIndex].CurrentMediaType = mtTemp; - m_InputInfo[ulStreamIndex].fTypeSet = TRUE; - CheckTypesSet(); - } else { - return E_OUTOFMEMORY; - } - - return NOERROR; - } - - STDMETHODIMP SetOutputType(ULONG ulStreamIndex, const DMO_MEDIA_TYPE *pmt, DWORD dwFlags) { - if (ulStreamIndex >= NUMBEROFOUTPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (dwFlags & ~ (DMO_SET_TYPEF_CLEAR | DMO_SET_TYPEF_TEST_ONLY)) { - return E_INVALIDARG; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - if (dwFlags & DMO_SET_TYPEF_CLEAR) { - MoFreeMediaType(&m_OutputInfo[ulStreamIndex].CurrentMediaType); - m_OutputInfo[ulStreamIndex].fTypeSet = FALSE; - if (!CheckTypesSet()) { - Flush(); - FreeStreamingResources(); - } - return NOERROR; - } - if (NULL == pmt) { - return E_POINTER; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, CheckOutputType)(ulStreamIndex, pmt); - if (FAILED(hr)) { - return hr; - } - - if (dwFlags & DMO_SET_TYPEF_TEST_ONLY) { - return NOERROR; - } - - - // actually set the type - DMO_MEDIA_TYPE mtTemp; - if (S_OK == MoCopyMediaType(&mtTemp, pmt)) { - // Free any previous mediatype - if (OutputTypeSet(ulStreamIndex)) { - MoFreeMediaType(&m_OutputInfo[ulStreamIndex].CurrentMediaType); - } - m_OutputInfo[ulStreamIndex].CurrentMediaType = mtTemp; - m_OutputInfo[ulStreamIndex].fTypeSet = TRUE; - CheckTypesSet(); - } else { - return E_OUTOFMEMORY; - } - - return NOERROR; - } - - STDMETHODIMP GetInputStatus( - ULONG ulStreamIndex, - DWORD *pdwStatus - ) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (NULL == pdwStatus) { - return E_POINTER; - } - *pdwStatus = 0; - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - if (!m_fTypesSet) { - return DMO_E_TYPE_NOT_SET; - } - - if (INTERNAL_CALL(_DERIVED_, AcceptingInput)(ulStreamIndex) == S_OK) { - *pdwStatus |= DMO_INPUT_STATUSF_ACCEPT_DATA; - } - return NOERROR; - } - - STDMETHODIMP GetInputMaxLatency(unsigned long ulStreamIndex, REFERENCE_TIME *prtLatency) { - - if (prtLatency == NULL) { - return E_POINTER; - } - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - return INTERNAL_CALL(_DERIVED_, GetInputMaxLatency)(ulStreamIndex, prtLatency); - } - - STDMETHODIMP SetInputMaxLatency(unsigned long ulStreamIndex, REFERENCE_TIME rtLatency) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - return INTERNAL_CALL(_DERIVED_, SetInputMaxLatency)(ulStreamIndex, rtLatency); - } - - STDMETHODIMP Discontinuity(ULONG ulStreamIndex) { - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - if (!m_fTypesSet) { - return DMO_E_TYPE_NOT_SET; - } - - if (S_OK != INTERNAL_CALL(_DERIVED_, AcceptingInput)(ulStreamIndex)) { - return DMO_E_NOTACCEPTING; - } - - return INTERNAL_CALL(_DERIVED_, Discontinuity)(ulStreamIndex); - } - - STDMETHODIMP Flush() - { - LockIt lck(static_cast<_DERIVED_ *>(this)); - - if (!m_fTypesSet) { - return S_OK; - } - if (m_fFlushed) { - return S_OK; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, Flush)(); - m_fFlushed = true; - return hr; - } - - STDMETHODIMP AllocateStreamingResources() { - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (!m_fTypesSet) { - return DMO_E_TYPE_NOT_SET; - } - if (m_fResourcesAllocated) { - return S_OK; - } - HRESULT hr = INTERNAL_CALL(_DERIVED_, AllocateStreamingResources)(); - if (SUCCEEDED(hr)) { - m_fResourcesAllocated = true; - } - return hr; - } - - STDMETHODIMP FreeStreamingResources() - { - LockIt lck(static_cast<_DERIVED_ *>(this)); - if (m_fResourcesAllocated) { - m_fResourcesAllocated = false; - INTERNAL_CALL(_DERIVED_, Flush)(); - return INTERNAL_CALL(_DERIVED_, FreeStreamingResources)(); - } - return S_OK; - } - - // - // Processing methods - public entry points - // - STDMETHODIMP ProcessInput( - DWORD ulStreamIndex, - IMediaBuffer *pBuffer, // [in], must not be NULL - DWORD dwFlags, // [in] - discontinuity, timestamp, etc. - REFERENCE_TIME rtTimestamp, // [in], valid if flag set - REFERENCE_TIME rtTimelength // [in], valid if flag set - ) { - if (!pBuffer) { - return E_POINTER; - } - if (ulStreamIndex >= NUMBEROFINPUTS) { - return DMO_E_INVALIDSTREAMINDEX; - } - if (dwFlags & ~(DMO_INPUT_DATA_BUFFERF_SYNCPOINT | - DMO_INPUT_DATA_BUFFERF_TIME | - DMO_INPUT_DATA_BUFFERF_TIMELENGTH)) { - return E_INVALIDARG; - } - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - // Make sure all streams have media types set and resources are allocated - HRESULT hr = AllocateStreamingResources(); - if (FAILED(hr)) { - return hr; - } - if (INTERNAL_CALL(_DERIVED_, AcceptingInput)(ulStreamIndex) != S_OK) { - return DMO_E_NOTACCEPTING; - } - - m_fFlushed = false; - - return INTERNAL_CALL(_DERIVED_, ProcessInput)( - ulStreamIndex, - pBuffer, - dwFlags, - rtTimestamp, - rtTimelength); - } - - STDMETHODIMP ProcessOutput( - DWORD dwFlags, - DWORD ulOutputBufferCount, - DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, - DWORD *pdwStatus) - { - if (pdwStatus == NULL) { - return E_POINTER; - } - - - if (ulOutputBufferCount != NUMBEROFOUTPUTS || (dwFlags & ~DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER)) { - return E_INVALIDARG; - } - - if (NUMBEROFOUTPUTS != 0 && pOutputBuffers == NULL) { - return E_POINTER; - } - - *pdwStatus = 0; - - LockIt lck(static_cast<_DERIVED_ *>(this)); - - HRESULT hr = AllocateStreamingResources(); - if (FAILED(hr)) { - return hr; - } - - for (DWORD dw = 0; dw < NUMBEROFOUTPUTS; dw++) { - pOutputBuffers[dw].dwStatus = 0; - } - - hr = INTERNAL_CALL(_DERIVED_, ProcessOutput)( - dwFlags, - ulOutputBufferCount, - pOutputBuffers, - pdwStatus); - - // remember the DMO's incomplete status - for (dw = 0; dw < NUMBEROFOUTPUTS; dw++) { - if (pOutputBuffers[dw].dwStatus & DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE) { - m_OutputInfo[dw].fIncomplete = TRUE; - } else { - m_OutputInfo[dw].fIncomplete = FALSE; - } - } - - return hr; - } - - STDMETHODIMP DMOLock(LONG lLock) - { - if (lLock) { - static_cast<_DERIVED_ *>(this)->Lock(); - } else { - static_cast<_DERIVED_ *>(this)->Unlock(); - } - return S_OK; - } -}; - -#endif // _dmoimpl_h_ - diff --git a/import/DirectX8/include/dmoreg.h b/import/DirectX8/include/dmoreg.h deleted file mode 100644 index 6c6c22f7b..000000000 --- a/import/DirectX8/include/dmoreg.h +++ /dev/null @@ -1,110 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DMOReg.h -// -// Desc: -// -// Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __DMOREG_H__ -#define __DMOREG_H__ - -#include "mediaobj.h" - - -// 57f2db8b-e6bb-4513-9d43-dcd2a6593125 -DEFINE_GUID(DMOCATEGORY_AUDIO_DECODER, 0x57f2db8b,0xe6bb,0x4513,0x9d,0x43,0xdc,0xd2,0xa6,0x59,0x31,0x25); -// 33D9A761-90C8-11d0-BD43-00A0C911CE86 -DEFINE_GUID(DMOCATEGORY_AUDIO_ENCODER, 0x33D9A761,0x90C8,0x11d0,0xBD,0x43,0x00,0xA0,0xC9,0x11,0xCE,0x86); -// 4a69b442-28be-4991-969c-b500adf5d8a8 -DEFINE_GUID(DMOCATEGORY_VIDEO_DECODER, 0x4a69b442,0x28be,0x4991,0x96,0x9c,0xb5,0x00,0xad,0xf5,0xd8,0xa8); -// 33D9A760-90C8-11d0-BD43-00A0C911CE86 -DEFINE_GUID(DMOCATEGORY_VIDEO_ENCODER, 0x33D9A760,0x90C8,0x11d0,0xBD,0x43,0x00,0xA0,0xC9,0x11,0xCE,0x86); -// f3602b3f-0592-48df-a4cd-674721e7ebeb -DEFINE_GUID(DMOCATEGORY_AUDIO_EFFECT, 0xf3602b3f,0x0592,0x48df,0xa4,0xcd,0x67,0x47,0x21,0xe7,0xeb,0xeb); -// d990ee14-776c-4723-be46-3da2f56f10b9 -DEFINE_GUID(DMOCATEGORY_VIDEO_EFFECT, 0xd990ee14,0x776c,0x4723,0xbe,0x46,0x3d,0xa2,0xf5,0x6f,0x10,0xb9); -// f665aaba-3e09-4920-aa5f-219811148f09 -DEFINE_GUID(DMOCATEGORY_AUDIO_CAPTURE_EFFECT, 0xf665aaba,0x3e09,0x4920,0xaa,0x5f,0x21,0x98,0x11,0x14,0x8f,0x09); - -// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} -// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h -DEFINE_GUID(DMOCATEGORY_ACOUSTIC_ECHO_CANCEL, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); - -// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} -// Matches KSNODETYPE_AUDIO_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h -DEFINE_GUID(DMOCATEGORY_AUDIO_NOISE_SUPPRESS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); - -// Automatic Gain Control {E88C9BA0-C557-11D0-8A2B-00A0C9255AC1} -// Matches KSNODETYPE_AGC in ksmedia.h -DEFINE_GUID(DMOCATEGORY_AGC, 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); - -typedef struct _DMO_PARTIAL_MEDIATYPE { - GUID type; - GUID subtype; -} DMO_PARTIAL_MEDIATYPE, *PDMO_PARTIAL_MEDIATYPE; - -enum DMO_REGISTER_FLAGS { - DMO_REGISTERF_IS_KEYED = 0x00000001 -}; - -enum DMO_ENUM_FLAGS { - DMO_ENUMF_INCLUDE_KEYED = 0x00000001 -}; - -STDAPI DMORegister( - LPCWSTR szName, - REFCLSID clsidDMO, - REFGUID guidCategory, - DWORD dwFlags, // DMO_REGISTERF_XXX - // - // Register all mediatypes supported by the object. This carries no - // information about which combinations of input/output types would - // actually work. - // - DWORD cInTypes, - const DMO_PARTIAL_MEDIATYPE *pInTypes, - DWORD cOutTypes, - const DMO_PARTIAL_MEDIATYPE *pOutTypes -); - -STDAPI DMOUnregister( - REFCLSID clsidDMO, - REFGUID guidCategory // optional - GUID_NULL means unregister from all -); - -STDAPI DMOEnum( - REFGUID guidCategory, // GUID_NULL for "all" - DWORD dwFlags, // DMO_ENUMF_XXX - // - // Enumerate only objects that support at least one of the specified input types - // and at least one of the specified output types. If no input types are specified, - // enumerate objects regardless of what input types they support. Same for - // output types. - // - DWORD cInTypes, - const DMO_PARTIAL_MEDIATYPE *pInTypes, // can be NULL only of ulInTypes = 0 - DWORD cOutTypes, - const DMO_PARTIAL_MEDIATYPE *pOutTypes, // can be NULL only of ulOutTypes = 0 - // - // Output parameter - this receives a pointer to the DMO CLSID enumerator - // - IEnumDMO **ppEnum -); - -STDAPI DMOGetTypes( - REFCLSID clsidDMO, - unsigned long ulInputTypesRequested, - unsigned long *pulInputTypesSupplied, - DMO_PARTIAL_MEDIATYPE *pInputTypes, - unsigned long ulOutputTypesRequested, - unsigned long *pulOutputTypesSupplied, - DMO_PARTIAL_MEDIATYPE *pOutputTypes -); - -STDAPI DMOGetName( - REFCLSID clsidDMO, - WCHAR szName[80] -); -#endif //__DMOREG_H__ diff --git a/import/DirectX8/include/dmort.h b/import/DirectX8/include/dmort.h deleted file mode 100644 index cfe25a4a0..000000000 --- a/import/DirectX8/include/dmort.h +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DMORt.h -// -// Desc: Miscellaneous runtime support for DirectShow Media Objects -// -// Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __DMORT_H__ -#define __DMORT_H__ - -// -// Mediatype helpers. MoInitMediaType() goes with MoFreeMediaType(), and -// MoCreateMediaType() goes with MoDeleteMediaType(). Don't mix them! -// - - - -// -// Takes a pointer to an already allocated DMO_MEDIA_TYPE structure, allocates -// a format block of cbFormat bytes, and sets appropriate members of -// DMO_MEDIA_TYPE to point to the newly allocated format block. Also -// initializes the IUnknown pointer inside DMO_MEDIA_TYPE to NULL. -// -// The format block allocated by MoInitMediaType must be freed by calling -// MoFreeMediaType(). -// -STDAPI MoInitMediaType(DMO_MEDIA_TYPE *pmt, DWORD cbFormat); - -// -// Frees the format block and releases any IUnknown, but does not free the -// DMO_MEDIA_TYPE structure itself. Input parameter must point to an -// DMO_MEDIA_TYPE structure previously initialized by MoInitMediaType(). -// -STDAPI MoFreeMediaType(DMO_MEDIA_TYPE *pmt); - -// -// Copies the DMO_MEDIA_TYPE members. Also duplicates the format block and -// the IUnknown pointer. Both parameters must point to valid DMO_MEDIA_TYPE -// structures. Target structure must be later freed using MoFreeMediaType(). -// -STDAPI MoCopyMediaType(DMO_MEDIA_TYPE *pmtDest, const DMO_MEDIA_TYPE *pmtSrc); - - - -// -// Allocates a new DMO_MEDIA_TYPE structure and initializes it just like -// MoInitMediaType. I.e., this function allocates both the format block -// and the DMO_MEDIA_TYPE structure itself. Pointer to DMO_MEDIA_TYPE is -// returned as *ppmt. -// -// DMO_MEDIA_TYPE structures allocated by MoCreateMediaType() must be freed -// by calling MoDeleteMediaType(). -// -STDAPI MoCreateMediaType(DMO_MEDIA_TYPE **ppmt, DWORD cbFormat); - -// -// Frees any format block, releases any IUnknown, and deletes the -// DMO_MEDIA_TYPE structure itself. The input parameter must point to an -// DMO_MEDIA_TYPE structure previously allocated by MoCreateMediaType(). -// -STDAPI MoDeleteMediaType(DMO_MEDIA_TYPE *pmt); - -// -// Allocates a new DMO_MEDIA_TYPE structure and copies pmtSrc into it like -// MoCopyMediaType. I.e., this function allocates a new DMO_MEDIA_TYPE struct -// as well as a new format block for the target mediatype. Trager mediatype -// must later be freed using MoDeleteMediaType(). -// -STDAPI MoDuplicateMediaType(DMO_MEDIA_TYPE **ppmtDest, const DMO_MEDIA_TYPE *pmtSrc); - - - -#endif //__DMORT_H__ diff --git a/import/DirectX8/include/dmplugin.h b/import/DirectX8/include/dmplugin.h deleted file mode 100644 index 821ef7d60..000000000 --- a/import/DirectX8/include/dmplugin.h +++ /dev/null @@ -1,281 +0,0 @@ -/************************************************************************ -* * -* dmplugin.h -- This module contains the API for plugins for the * -* DirectMusic performance layer * -* * -* Copyright (c) 1998-1999 Microsoft Corporation * -* * -************************************************************************/ - -#ifndef _DMPLUGIN_ -#define _DMPLUGIN_ - -#include - -#define COM_NO_WINDOWS_H -#include - -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -interface IDirectMusicTrack; -interface IDirectMusicTool; -interface IDirectMusicTool8; -interface IDirectMusicTrack8; -interface IDirectMusicPerformance; -interface IDirectMusicPerformance8; -interface IDirectMusicSegment; -interface IDirectMusicSegment8; -interface IDirectMusicSegmentState; -interface IDirectMusicSegmentState8; -interface IDirectMusicGraph; -#ifndef __cplusplus -typedef interface IDirectMusicTrack IDirectMusicTrack; -typedef interface IDirectMusicTool IDirectMusicTool; -typedef interface IDirectMusicTool8 IDirectMusicTool8; -typedef interface IDirectMusicTrack8 IDirectMusicTrack8; -typedef interface IDirectMusicPerformance IDirectMusicPerformance; -typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8; -typedef interface IDirectMusicSegment IDirectMusicSegment; -typedef interface IDirectMusicSegment8 IDirectMusicSegment8; -typedef interface IDirectMusicSegmentState IDirectMusicSegmentState; -typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8; -typedef interface IDirectMusicGraph IDirectMusicGraph; -#endif - -typedef struct _DMUS_PMSG DMUS_PMSG; -typedef long MUSIC_TIME; - -/* Registry location for tools */ -#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools" - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicTool */ -#undef INTERFACE -#define INTERFACE IDirectMusicTool -DECLARE_INTERFACE_(IDirectMusicTool, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicTool */ - STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE; - STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE; - STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes, - DWORD dwNumElements) PURE; - STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf, - DMUS_PMSG* pPMSG) PURE; - STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf, - DMUS_PMSG* pPMSG, - REFERENCE_TIME rtTime) PURE; -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicTool8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicTool8 -DECLARE_INTERFACE_(IDirectMusicTool8, IDirectMusicTool) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicTool */ - STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE; - STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE; - STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes, - DWORD dwNumElements) PURE; - STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf, - DMUS_PMSG* pPMSG) PURE; - STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf, - DMUS_PMSG* pPMSG, - REFERENCE_TIME rtTime) PURE; - /* IDirectMusicTool8 */ - STDMETHOD(Clone) (THIS_ IDirectMusicTool ** ppTool) PURE; -}; - - -/* The following flags are sent in the IDirectMusicTrack::Play() method */ -/* inside the dwFlags parameter */ -typedef enum enumDMUS_TRACKF_FLAGS -{ - DMUS_TRACKF_SEEK = 1, /* set on a seek */ - DMUS_TRACKF_LOOP = 2, /* set on a loop (repeat) */ - DMUS_TRACKF_START = 4, /* set on first call to Play */ - DMUS_TRACKF_FLUSH = 8, /* set when this call is in response to a flush on the perfomance */ - DMUS_TRACKF_DIRTY = 0x10, /* set when the track should consider any cached values from a previous call to GetParam to be invalidated */ - /* The following flags are DX8 only. */ - DMUS_TRACKF_NOTIFY_OFF = 0x20, /* tells track not to send notifications. */ - DMUS_TRACKF_PLAY_OFF = 0x40, /* tells track not to play anything (but can still send notifications.) */ - DMUS_TRACKF_LOOPEND = 0x80, /* set when the end of range is also a loop end. */ - DMUS_TRACKF_STOP = 0x100, /* set when the end of range is also end of playing this segment. */ - DMUS_TRACKF_RECOMPOSE = 0x200, /* set to indicate the track should compose. */ - DMUS_TRACKF_CLOCK = 0x400, /* set when time parameters are in reference (clock) time. Only valid for PlayEx(). */ -} DMUS_TRACKF_FLAGS; - -/* The following flags are sent in the IDirectMusicTrack8::GetParamEx() and SetParamEx() methods */ -/* inside the dwFlags parameter */ -#define DMUS_TRACK_PARAMF_CLOCK 0x01 /* set when the time is measured is in reference (clock) time */ - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicTrack */ -#undef INTERFACE -#define INTERFACE IDirectMusicTrack -DECLARE_INTERFACE_(IDirectMusicTrack, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicTrack */ - STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE; - STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState, - IDirectMusicPerformance* pPerformance, - void** ppStateData, - DWORD dwVirtualTrackID, - DWORD dwFlags) PURE; - STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE; - STDMETHOD(Play) (THIS_ void* pStateData, - MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - MUSIC_TIME mtOffset, - DWORD dwFlags, - IDirectMusicPerformance* pPerf, - IDirectMusicSegmentState* pSegSt, - DWORD dwVirtualID) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - IDirectMusicTrack** ppTrack) PURE; -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicTrack8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicTrack8 -DECLARE_INTERFACE_(IDirectMusicTrack8, IDirectMusicTrack) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicTrack */ - STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE; - STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState, - IDirectMusicPerformance* pPerformance, - void** ppStateData, - DWORD dwVirtualTrackID, - DWORD dwFlags) PURE; - STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE; - STDMETHOD(Play) (THIS_ void* pStateData, - MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - MUSIC_TIME mtOffset, - DWORD dwFlags, - IDirectMusicPerformance* pPerf, - IDirectMusicSegmentState* pSegSt, - DWORD dwVirtualID) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - IDirectMusicTrack** ppTrack) PURE; - /* IDirectMusicTrack8 */ - STDMETHOD(PlayEx) (THIS_ void* pStateData, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd, - REFERENCE_TIME rtOffset, - DWORD dwFlags, - IDirectMusicPerformance* pPerf, - IDirectMusicSegmentState* pSegSt, - DWORD dwVirtualID) PURE; - STDMETHOD(GetParamEx) (THIS_ REFGUID rguidType, /* Command type. */ - REFERENCE_TIME rtTime, /* Time, in ref time if dwFlags == DMUS_TRACK_PARAMF_CLOCK. Otherwise, music time. */ - REFERENCE_TIME* prtNext, /* Time of next parameter, relative to rtTime, in music or clock time units. */ - void* pParam, /* Pointer to the parameter data. */ - void * pStateData, /* State data for track instance. */ - DWORD dwFlags) PURE; /* Control flags. */ - STDMETHOD(SetParamEx) (THIS_ REFGUID rguidType, - REFERENCE_TIME rtTime, - void* pParam, /* Pointer to the parameter data. */ - void * pStateData, /* State data for track instance. */ - DWORD dwFlags) PURE; /* Control flags. */ - STDMETHOD(Compose) (THIS_ IUnknown* pContext, /* Context for composition (song or segment) */ - DWORD dwTrackGroup, - IDirectMusicTrack** ppResultTrack) PURE; - STDMETHOD(Join) (THIS_ IDirectMusicTrack* pNewTrack, - MUSIC_TIME mtJoin, - IUnknown* pContext, /* Context for joining (song or segment) */ - DWORD dwTrackGroup, - IDirectMusicTrack** ppResultTrack) PURE; -}; - -/* CLSID's */ -DEFINE_GUID(CLSID_DirectMusicTempoTrack,0xd2ac2885, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicSeqTrack,0xd2ac2886, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicSysExTrack,0xd2ac2887, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicTimeSigTrack,0xd2ac2888, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicChordTrack,0xd2ac288b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicCommandTrack,0xd2ac288c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicStyleTrack,0xd2ac288d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicMotifTrack,0xd2ac288e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicSignPostTrack,0xf17e8672, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicBandTrack,0xd2ac2894, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicChordMapTrack,0xd2ac2896, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicMuteTrack,0xd2ac2898, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* New CLSID's for DX8 */ -DEFINE_GUID(CLSID_DirectMusicScriptTrack,0x4108fa85, 0x3586, 0x11d3, 0x8b, 0xd7, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4108FA85-3586-11d3-8BD7-00600893B1B6} */ -DEFINE_GUID(CLSID_DirectMusicMarkerTrack,0x55a8fd00, 0x4288, 0x11d3, 0x9b, 0xd1, 0x8a, 0xd, 0x61, 0xc8, 0x88, 0x35); -DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665, 0x4ea1, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {BAE4D665-4EA1-11d3-8BDA-00600893B1B6} */ -DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5, 0x54ff, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {995C1CF5-54FF-11d3-8BDA-00600893B1B6} */ -DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b, 0x5c19, 0x11d3, 0x8b, 0xdc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4BE0537B-5C19-11d3-8BDC-00600893B1B6} */ -DEFINE_GUID(CLSID_DirectMusicMelodyFormulationTrack, 0xb0684266, 0xb57f, 0x11d2, 0x97, 0xf9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); -DEFINE_GUID(CLSID_DirectMusicWaveTrack,0xeed36461, 0x9ea5, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); - -/* IID's */ -DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicTool,0xd2ac28ba, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Interface IDs for DX8 */ -/* changed interfaces (GUID only) */ -DEFINE_GUID(IID_IDirectMusicTool8, 0xe674303, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36); -DEFINE_GUID(IID_IDirectMusicTrack8, 0xe674304, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36); - -#ifdef __cplusplus -}; /* extern "C" */ -#endif - -#include - -#endif /* #ifndef _DMPLUGIN_ */ diff --git a/import/DirectX8/include/dmusbuff.h b/import/DirectX8/include/dmusbuff.h deleted file mode 100644 index 548845381..000000000 --- a/import/DirectX8/include/dmusbuff.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** -* * -* DMusBuff.h -- This module defines the buffer format for DirectMusic * -* Shared file between user mode and kernel mode components * -* * -* Copyright (c) 1998, Microsoft Corp. All rights reserved. * -* * -***************************************************************************/ - -#ifndef _DMusBuff_ -#define _DMusBuff_ - -/* Format of DirectMusic events in a buffer - * - * A buffer contains 1 or more events, each with the following header. - * Immediately following the header is the event data. The header+data - * size is rounded to the nearest quadword (8 bytes). - */ - -#include /* Do not pad at end - that's where the data is */ -typedef struct _DMUS_EVENTHEADER *LPDMUS_EVENTHEADER; -typedef struct _DMUS_EVENTHEADER -{ - DWORD cbEvent; /* Unrounded bytes in event */ - DWORD dwChannelGroup; /* Channel group of event */ - REFERENCE_TIME rtDelta; /* Delta from start time of entire buffer */ - DWORD dwFlags; /* Flags DMUS_EVENT_xxx */ -} DMUS_EVENTHEADER; -#include - -#define DMUS_EVENT_STRUCTURED 0x00000001 /* Unstructured data (SysEx, etc.) */ - -/* The number of bytes to allocate for an event with 'cb' data bytes. - */ -#define QWORD_ALIGN(x) (((x) + 7) & ~7) -#define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) - - -#endif /* _DMusBuff_ */ - - diff --git a/import/DirectX8/include/dmusicc.h b/import/DirectX8/include/dmusicc.h deleted file mode 100644 index eeff1fc67..000000000 --- a/import/DirectX8/include/dmusicc.h +++ /dev/null @@ -1,784 +0,0 @@ -/************************************************************************ -* * -* dmusicc.h -- This module defines the DirectMusic core API's * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -************************************************************************/ - -#ifndef _DMUSICC_ -#define _DMUSICC_ - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#include "dls1.h" -#include "dmerror.h" -#include "dmdls.h" -#include "dsound.h" -#include "dmusbuff.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef ULONGLONG SAMPLE_TIME; -typedef ULONGLONG SAMPLE_POSITION; -typedef SAMPLE_TIME *LPSAMPLE_TIME; - -#define DMUS_MAX_DESCRIPTION 128 -#define DMUS_MAX_DRIVER 128 - -typedef struct _DMUS_BUFFERDESC *LPDMUS_BUFFERDESC; -typedef struct _DMUS_BUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - GUID guidBufferFormat; - DWORD cbBuffer; -} DMUS_BUFFERDESC; - -/* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS - * and DMUS_PORTPARAMS. - */ -#define DMUS_EFFECT_NONE 0x00000000 -#define DMUS_EFFECT_REVERB 0x00000001 -#define DMUS_EFFECT_CHORUS 0x00000002 -#define DMUS_EFFECT_DELAY 0x00000004 - -/* For DMUS_PORTCAPS dwClass - */ -#define DMUS_PC_INPUTCLASS (0) -#define DMUS_PC_OUTPUTCLASS (1) - -/* For DMUS_PORTCAPS dwFlags - */ -#define DMUS_PC_DLS (0x00000001) // Supports DLS downloading and DLS level 1. -#define DMUS_PC_EXTERNAL (0x00000002) // External MIDI module. -#define DMUS_PC_SOFTWARESYNTH (0x00000004) // Software synthesizer. -#define DMUS_PC_MEMORYSIZEFIXED (0x00000008) // Memory size is fixed. -#define DMUS_PC_GMINHARDWARE (0x00000010) // GM sound set is built in, no need to download. -#define DMUS_PC_GSINHARDWARE (0x00000020) // GS sound set is built in. -#define DMUS_PC_XGINHARDWARE (0x00000040) // XG sound set is built in. -#define DMUS_PC_DIRECTSOUND (0x00000080) // Connects to DirectSound via a DSound buffer. -#define DMUS_PC_SHAREABLE (0x00000100) // Synth can be actively shared by multiple apps at once. -#define DMUS_PC_DLS2 (0x00000200) // Supports DLS2 instruments. -#define DMUS_PC_AUDIOPATH (0x00000400) // Multiple outputs can be connected to DirectSound for audiopaths. -#define DMUS_PC_WAVE (0x00000800) // Supports streaming and one shot waves. - -#define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF) // Sample memory is system memory. - - -typedef struct _DMUS_PORTCAPS -{ - DWORD dwSize; - DWORD dwFlags; - GUID guidPort; - DWORD dwClass; - DWORD dwType; - DWORD dwMemorySize; - DWORD dwMaxChannelGroups; - DWORD dwMaxVoices; - DWORD dwMaxAudioChannels; - DWORD dwEffectFlags; - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; -} DMUS_PORTCAPS; - -typedef DMUS_PORTCAPS *LPDMUS_PORTCAPS; - -/* Values for DMUS_PORTCAPS dwType. This field indicates the underlying - * driver type of the port. - */ -#define DMUS_PORT_WINMM_DRIVER (0) -#define DMUS_PORT_USER_MODE_SYNTH (1) -#define DMUS_PORT_KERNEL_MODE (2) - -/* These flags (set in dwValidParams) indicate which other members of the */ -/* DMUS_PORTPARAMS are valid. */ -/* */ -#define DMUS_PORTPARAMS_VOICES 0x00000001 -#define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002 -#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004 -#define DMUS_PORTPARAMS_SAMPLERATE 0x00000008 -#define DMUS_PORTPARAMS_EFFECTS 0x00000020 -#define DMUS_PORTPARAMS_SHARE 0x00000040 -#define DMUS_PORTPARAMS_FEATURES 0x00000080 /* DirectX 8.0 and above */ - -typedef struct _DMUS_PORTPARAMS -{ - DWORD dwSize; - DWORD dwValidParams; - DWORD dwVoices; - DWORD dwChannelGroups; - DWORD dwAudioChannels; - DWORD dwSampleRate; - DWORD dwEffectFlags; - BOOL fShare; -} DMUS_PORTPARAMS7; - -typedef struct _DMUS_PORTPARAMS8 -{ - DWORD dwSize; - DWORD dwValidParams; - DWORD dwVoices; - DWORD dwChannelGroups; - DWORD dwAudioChannels; - DWORD dwSampleRate; - DWORD dwEffectFlags; - BOOL fShare; - DWORD dwFeatures; -} DMUS_PORTPARAMS8; - -#define DMUS_PORT_FEATURE_AUDIOPATH 0x00000001 /* Supports audiopath connection to DSound buffers. */ -#define DMUS_PORT_FEATURE_STREAMING 0x00000002 /* Supports streaming waves through the synth. */ - - -typedef DMUS_PORTPARAMS8 DMUS_PORTPARAMS; -typedef DMUS_PORTPARAMS *LPDMUS_PORTPARAMS; - -typedef struct _DMUS_SYNTHSTATS *LPDMUS_SYNTHSTATS; -typedef struct _DMUS_SYNTHSTATS8 *LPDMUS_SYNTHSTATS8; -typedef struct _DMUS_SYNTHSTATS -{ - DWORD dwSize; /* Size in bytes of the structure */ - DWORD dwValidStats; /* Flags indicating which fields below are valid. */ - DWORD dwVoices; /* Average number of voices playing. */ - DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */ - DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */ - DWORD dwLostNotes; /* Number of notes lost in 1 second. */ - DWORD dwFreeMemory; /* Free memory in bytes */ - long lPeakVolume; /* Decibel level * 100. */ -} DMUS_SYNTHSTATS; - -typedef struct _DMUS_SYNTHSTATS8 -{ - DWORD dwSize; /* Size in bytes of the structure */ - DWORD dwValidStats; /* Flags indicating which fields below are valid. */ - DWORD dwVoices; /* Average number of voices playing. */ - DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */ - DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */ - DWORD dwLostNotes; /* Number of notes lost in 1 second. */ - DWORD dwFreeMemory; /* Free memory in bytes */ - long lPeakVolume; /* Decibel level * 100. */ - DWORD dwSynthMemUse; /* Memory used by synth wave data */ -} DMUS_SYNTHSTATS8; - -#define DMUS_SYNTHSTATS_VOICES (1 << 0) -#define DMUS_SYNTHSTATS_TOTAL_CPU (1 << 1) -#define DMUS_SYNTHSTATS_CPU_PER_VOICE (1 << 2) -#define DMUS_SYNTHSTATS_LOST_NOTES (1 << 3) -#define DMUS_SYNTHSTATS_PEAK_VOLUME (1 << 4) -#define DMUS_SYNTHSTATS_FREE_MEMORY (1 << 5) - -#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY - -typedef struct _DMUS_WAVES_REVERB_PARAMS -{ - float fInGain; /* Input gain in dB (to avoid output overflows) */ - float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal) - Negative values gives less wet signal. - The coeficients are calculated so that the overall output level stays - (approximately) constant regardless of the ammount of reverb mix. */ - float fReverbTime; /* The reverb decay time, in milliseconds. */ - float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time. - Unless very 'splashy-bright' reverbs are wanted, this should be set to - a value < 1.0. - For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the - decay time for high frequencies will be 100ms.*/ - -} DMUS_WAVES_REVERB_PARAMS; - -/* Note: Default values for Reverb are: - fInGain = 0.0dB (no change in level) - fReverbMix = -10.0dB (a reasonable reverb mix) - fReverbTime = 1000.0ms (one second global reverb time) - fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time) -*/ - -typedef enum -{ - DMUS_CLOCK_SYSTEM = 0, - DMUS_CLOCK_WAVE = 1 -} DMUS_CLOCKTYPE; - -#define DMUS_CLOCKF_GLOBAL 0x00000001 - -typedef struct _DMUS_CLOCKINFO7 *LPDMUS_CLOCKINFO7; -typedef struct _DMUS_CLOCKINFO7 -{ - DWORD dwSize; - DMUS_CLOCKTYPE ctType; - GUID guidClock; /* Identifies this time source */ - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; -} DMUS_CLOCKINFO7; - -typedef struct _DMUS_CLOCKINFO8 *LPDMUS_CLOCKINFO8; -typedef struct _DMUS_CLOCKINFO8 -{ - DWORD dwSize; - DMUS_CLOCKTYPE ctType; - GUID guidClock; /* Identifies this time source */ - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; - DWORD dwFlags; -} DMUS_CLOCKINFO8; - -typedef DMUS_CLOCKINFO8 DMUS_CLOCKINFO; -typedef DMUS_CLOCKINFO *LPDMUS_CLOCKINFO; - -/* Default bus identifiers - * - * The first 17 are direct mappings to the destinations defined in both - * the MMA DLS Level 2 specification and the Microsoft Multi-Channel audio - * specification. - */ -#define DSBUSID_FIRST_SPKR_LOC 0 -#define DSBUSID_FRONT_LEFT 0 -#define DSBUSID_LEFT 0 /* Front left is also just left */ -#define DSBUSID_FRONT_RIGHT 1 -#define DSBUSID_RIGHT 1 /* Ditto front right */ -#define DSBUSID_FRONT_CENTER 2 -#define DSBUSID_LOW_FREQUENCY 3 -#define DSBUSID_BACK_LEFT 4 -#define DSBUSID_BACK_RIGHT 5 -#define DSBUSID_FRONT_LEFT_OF_CENTER 6 -#define DSBUSID_FRONT_RIGHT_OF_CENTER 7 -#define DSBUSID_BACK_CENTER 8 -#define DSBUSID_SIDE_LEFT 9 -#define DSBUSID_SIDE_RIGHT 10 -#define DSBUSID_TOP_CENTER 11 -#define DSBUSID_TOP_FRONT_LEFT 12 -#define DSBUSID_TOP_FRONT_CENTER 13 -#define DSBUSID_TOP_FRONT_RIGHT 14 -#define DSBUSID_TOP_BACK_LEFT 15 -#define DSBUSID_TOP_BACK_CENTER 16 -#define DSBUSID_TOP_BACK_RIGHT 17 -#define DSBUSID_LAST_SPKR_LOC 17 - -#define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) ) - -/* These bus identifiers are for the standard DLS effect sends - */ -#define DSBUSID_REVERB_SEND 64 -#define DSBUSID_CHORUS_SEND 65 - -/* Dynamic bus identifiers start here. See the documentation for how - * synthesizers map the output of voices to static and dynamic - * bus identifiers. - */ -#define DSBUSID_DYNAMIC_0 512 - -/* Null bus, used to identify busses that have no function mapping. -*/ -#define DSBUSID_NULL 0xFFFFFFFF - -interface IDirectMusic; -interface IDirectMusic8; -interface IDirectMusicBuffer; -interface IDirectMusicPort; -interface IDirectMusicThru; -interface IReferenceClock; - -#ifndef __cplusplus - -typedef interface IDirectMusic IDirectMusic; -typedef interface IDirectMusic8 IDirectMusic8; -typedef interface IDirectMusicPort IDirectMusicPort; -typedef interface IDirectMusicBuffer IDirectMusicBuffer; -typedef interface IDirectMusicThru IDirectMusicThru; -typedef interface IReferenceClock IReferenceClock; - -#endif /* C++ */ - -typedef IDirectMusic *LPDIRECTMUSIC; -typedef IDirectMusic8 *LPDIRECTMUSIC8; -typedef IDirectMusicPort *LPDIRECTMUSICPORT; -typedef IDirectMusicBuffer *LPDIRECTMUSICBUFFER; - -#undef INTERFACE -#define INTERFACE IDirectMusic -DECLARE_INTERFACE_(IDirectMusic, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusic */ - STDMETHOD(EnumPort) (THIS_ DWORD dwIndex, - LPDMUS_PORTCAPS pPortCaps) PURE; - STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc, - LPDIRECTMUSICBUFFER *ppBuffer, - LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort, - LPDMUS_PORTPARAMS pPortParams, - LPDIRECTMUSICPORT *ppPort, - LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex, - LPDMUS_CLOCKINFO lpClockInfo) PURE; - STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock, - IReferenceClock **ppReferenceClock) PURE; - STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE; - STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, - HWND hWnd) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectMusic8 -DECLARE_INTERFACE_(IDirectMusic8, IDirectMusic) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusic */ - STDMETHOD(EnumPort) (THIS_ DWORD dwIndex, - LPDMUS_PORTCAPS pPortCaps) PURE; - STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc, - LPDIRECTMUSICBUFFER *ppBuffer, - LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort, - LPDMUS_PORTPARAMS pPortParams, - LPDIRECTMUSICPORT *ppPort, - LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex, - LPDMUS_CLOCKINFO lpClockInfo) PURE; - STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock, - IReferenceClock **ppReferenceClock) PURE; - STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE; - STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, - HWND hWnd) PURE; - /* IDirectMusic8 */ - STDMETHOD(SetExternalMasterClock) - (THIS_ IReferenceClock *pClock) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectMusicBuffer -DECLARE_INTERFACE_(IDirectMusicBuffer, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicBuffer */ - STDMETHOD(Flush) (THIS) PURE; - STDMETHOD(TotalTime) (THIS_ LPREFERENCE_TIME prtTime) PURE; - - STDMETHOD(PackStructured) (THIS_ REFERENCE_TIME rt, - DWORD dwChannelGroup, - DWORD dwChannelMessage) PURE; - - STDMETHOD(PackUnstructured) (THIS_ REFERENCE_TIME rt, - DWORD dwChannelGroup, - DWORD cb, - LPBYTE lpb) PURE; - - STDMETHOD(ResetReadPtr) (THIS) PURE; - STDMETHOD(GetNextEvent) (THIS_ LPREFERENCE_TIME prt, - LPDWORD pdwChannelGroup, - LPDWORD pdwLength, - LPBYTE *ppData) PURE; - - STDMETHOD(GetRawBufferPtr) (THIS_ LPBYTE *ppData) PURE; - STDMETHOD(GetStartTime) (THIS_ LPREFERENCE_TIME prt) PURE; - STDMETHOD(GetUsedBytes) (THIS_ LPDWORD pcb) PURE; - STDMETHOD(GetMaxBytes) (THIS_ LPDWORD pcb) PURE; - STDMETHOD(GetBufferFormat) (THIS_ LPGUID pGuidFormat) PURE; - - STDMETHOD(SetStartTime) (THIS_ REFERENCE_TIME rt) PURE; - STDMETHOD(SetUsedBytes) (THIS_ DWORD cb) PURE; -}; - -typedef IDirectMusicBuffer IDirectMusicBuffer8; -typedef IDirectMusicBuffer8 *LPDIRECTMUSICBUFFER8; - -#undef INTERFACE -#define INTERFACE IDirectMusicInstrument -DECLARE_INTERFACE_(IDirectMusicInstrument, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicInstrument */ - STDMETHOD(GetPatch) (THIS_ DWORD* pdwPatch) PURE; - STDMETHOD(SetPatch) (THIS_ DWORD dwPatch) PURE; -}; - -typedef IDirectMusicInstrument IDirectMusicInstrument8; -typedef IDirectMusicInstrument8 *LPDIRECTMUSICINSTRUMENT8; - -#undef INTERFACE -#define INTERFACE IDirectMusicDownloadedInstrument -DECLARE_INTERFACE_(IDirectMusicDownloadedInstrument, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicDownloadedInstrument */ - /* None at this time */ -}; - -typedef IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument8; -typedef IDirectMusicDownloadedInstrument8 *LPDIRECTMUSICDOWNLOADEDINSTRUMENT8; - -#undef INTERFACE -#define INTERFACE IDirectMusicCollection -DECLARE_INTERFACE_(IDirectMusicCollection, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicCollection */ - STDMETHOD(GetInstrument) (THIS_ DWORD dwPatch, - IDirectMusicInstrument** ppInstrument) PURE; - STDMETHOD(EnumInstrument) (THIS_ DWORD dwIndex, - DWORD* pdwPatch, - LPWSTR pwszName, - DWORD dwNameLen) PURE; -}; - -typedef IDirectMusicCollection IDirectMusicCollection8; -typedef IDirectMusicCollection8 *LPDIRECTMUSICCOLLECTION8; - -#undef INTERFACE -#define INTERFACE IDirectMusicDownload -DECLARE_INTERFACE_(IDirectMusicDownload , IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicDownload */ - STDMETHOD(GetBuffer) (THIS_ void** ppvBuffer, - DWORD* pdwSize) PURE; -}; - -typedef IDirectMusicDownload IDirectMusicDownload8; -typedef IDirectMusicDownload8 *LPDIRECTMUSICDOWNLOAD8; - -#undef INTERFACE -#define INTERFACE IDirectMusicPortDownload -DECLARE_INTERFACE_(IDirectMusicPortDownload, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicPortDownload */ - STDMETHOD(GetBuffer) (THIS_ DWORD dwDLId, - IDirectMusicDownload** ppIDMDownload) PURE; - STDMETHOD(AllocateBuffer) (THIS_ DWORD dwSize, - IDirectMusicDownload** ppIDMDownload) PURE; - STDMETHOD(GetDLId) (THIS_ DWORD* pdwStartDLId, - DWORD dwCount) PURE; - STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; - STDMETHOD(Download) (THIS_ IDirectMusicDownload* pIDMDownload) PURE; - STDMETHOD(Unload) (THIS_ IDirectMusicDownload* pIDMDownload) PURE; -}; - -typedef IDirectMusicPortDownload IDirectMusicPortDownload8; -typedef IDirectMusicPortDownload8 *LPDIRECTMUSICPORTDOWNLOAD8; - -/* Standard values for voice priorities. Numerically higher priorities are higher in priority. - * These priorities are used to set the voice priority for all voices on a channel. They are - * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the - * lpwPriority parameter of pdwPriority. - * - * These priorities are shared with DirectSound. - */ - -#ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_ -#define _DIRECTAUDIO_PRIORITIES_DEFINED_ - -#define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000) -#define DAUD_HIGH_VOICE_PRIORITY (0xC0000000) -#define DAUD_STANDARD_VOICE_PRIORITY (0x80000000) -#define DAUD_LOW_VOICE_PRIORITY (0x40000000) -#define DAUD_PERSIST_VOICE_PRIORITY (0x10000000) - -/* These are the default priorities assigned if not overridden. By default priorities are - * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as - * channel 5 on channel group 2). - * - * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16 - * except for 10. - */ -#define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E) -#define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D) -#define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C) -#define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B) -#define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A) -#define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009) -#define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008) -#define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007) -#define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006) -#define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F) -#define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005) -#define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004) -#define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003) -#define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002) -#define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001) -#define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000) - - -#define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET) - -#endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */ - - -#undef INTERFACE -#define INTERFACE IDirectMusicPort -DECLARE_INTERFACE_(IDirectMusicPort, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicPort */ - /* */ - STDMETHOD(PlayBuffer) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE; - STDMETHOD(SetReadNotificationHandle) (THIS_ HANDLE hEvent) PURE; - STDMETHOD(Read) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE; - STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument *pInstrument, - IDirectMusicDownloadedInstrument **ppDownloadedInstrument, - DMUS_NOTERANGE *pNoteRanges, - DWORD dwNumNoteRanges) PURE; - STDMETHOD(UnloadInstrument) (THIS_ IDirectMusicDownloadedInstrument *pDownloadedInstrument) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; - STDMETHOD(Compact) (THIS) PURE; - STDMETHOD(GetCaps) (THIS_ LPDMUS_PORTCAPS pPortCaps) PURE; - STDMETHOD(DeviceIoControl) (THIS_ DWORD dwIoControlCode, - LPVOID lpInBuffer, - DWORD nInBufferSize, - LPVOID lpOutBuffer, - DWORD nOutBufferSize, - LPDWORD lpBytesReturned, - LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwChannelGroups) PURE; - STDMETHOD(GetNumChannelGroups) (THIS_ LPDWORD pdwChannelGroups) PURE; - STDMETHOD(Activate) (THIS_ BOOL fActive) PURE; - STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE; - STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE; - STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize) PURE; -}; - -typedef IDirectMusicPort IDirectMusicPort8; -typedef IDirectMusicPort8 *LPDIRECTMUSICPORT8; - -#undef INTERFACE -#define INTERFACE IDirectMusicThru -DECLARE_INTERFACE_(IDirectMusicThru, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicThru - */ - STDMETHOD(ThruChannel) (THIS_ DWORD dwSourceChannelGroup, - DWORD dwSourceChannel, - DWORD dwDestinationChannelGroup, - DWORD dwDestinationChannel, - LPDIRECTMUSICPORT pDestinationPort) PURE; -}; - -typedef IDirectMusicThru IDirectMusicThru8; -typedef IDirectMusicThru8 *LPDIRECTMUSICTHRU8; - -#ifndef __IReferenceClock_INTERFACE_DEFINED__ -#define __IReferenceClock_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IReferenceClock,0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -#undef INTERFACE -#define INTERFACE IReferenceClock -DECLARE_INTERFACE_(IReferenceClock, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IReferenceClock */ - /* */ - - /* get the time now */ - STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE; - - /* ask for an async notification that a time has elapsed */ - STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME baseTime, /* base time */ - REFERENCE_TIME streamTime, /* stream offset time */ - HANDLE hEvent, /* advise via this event */ - DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */ - - /* ask for an async periodic notification that a time has elapsed */ - STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME startTime, /* starting at this time */ - REFERENCE_TIME periodTime, /* time between notifications */ - HANDLE hSemaphore, /* advise via a semaphore */ - DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */ - - /* cancel a request for notification */ - STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; -}; - -#endif /* __IReferenceClock_INTERFACE_DEFINED__ */ - -DEFINE_GUID(CLSID_DirectMusic,0x636b9f10,0x0c7d,0x11d1,0x95,0xb2,0x00,0x20,0xaf,0xdc,0x74,0x21); -DEFINE_GUID(CLSID_DirectMusicCollection,0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef); -DEFINE_GUID(CLSID_DirectMusicSynth,0x58C2B4D0,0x46E7,0x11D1,0x89,0xAC,0x00,0xA0,0xC9,0x05,0x41,0x29); - -DEFINE_GUID(IID_IDirectMusic,0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(IID_IDirectMusicBuffer,0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(IID_IDirectMusicPortDownload,0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicDownload,0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicCollection,0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicInstrument,0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicDownloadedInstrument,0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - - -/* Alternate interface ID for IID_IDirectMusic, available in DX7 release and after. */ -DEFINE_GUID(IID_IDirectMusic2,0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -DEFINE_GUID(IID_IDirectMusic8,0x2d3629f7,0x813d,0x4939,0x85,0x08,0xf0,0x5c,0x6b,0x75,0xfd,0x97); - -#define IID_IDirectMusicThru8 IID_IDirectMusicThru -#define IID_IDirectMusicPortDownload8 IID_IDirectMusicPortDownload -#define IID_IDirectMusicDownload8 IID_IDirectMusicDownload -#define IID_IDirectMusicCollection8 IID_IDirectMusicCollection -#define IID_IDirectMusicInstrument8 IID_IDirectMusicInstrument -#define IID_IDirectMusicDownloadedInstrument8 IID_IDirectMusicDownloadedInstrument -#define IID_IDirectMusicPort8 IID_IDirectMusicPort - - -/* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download - * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download - * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download - * Property Query GUID_DMUS_PROP_DLS1 - Support DLS level 1 - * Property Query GUID_DMUS_PROP_INSTRUMENT2 - Support new INSTRUMENT2 download format - * Property Query GUID_DMUS_PROP_XG_Capable - Support minimum requirements of XG - * Property Query GUID_DMUS_PROP_GS_Capable - Support minimum requirements of GS - * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DSound - * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device - * - * Item 0: Supported - * Returns a DWORD which is non-zero if the feature is supported - */ -DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND,0xaa97844, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE,0xaa97845, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); - -/* Property Get/Set GUID_DMUS_PROP_WriteLatency - * - * Item 0: Synth buffer write latency, in milliseconds - * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written. - */ -DEFINE_GUID(GUID_DMUS_PROP_WriteLatency,0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -/* Property Get/Set GUID_DMUS_PROP_WritePeriod - * - * Item 0: Synth buffer write period, in milliseconds - * Get/Set SynthSink buffer write period, time span between successive writes. - */ -DEFINE_GUID(GUID_DMUS_PROP_WritePeriod,0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -/* Property Get GUID_DMUS_PROP_MemorySize - * - * Item 0: Memory size - * Returns a DWORD containing the total number of bytes of sample RAM - */ -DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -/* Property Set GUID_DMUS_PROP_WavesReverb - * - * Item 0: DMUS_WAVES_REVERB structure - * Sets reverb parameters - */ -DEFINE_GUID(GUID_DMUS_PROP_WavesReverb,0x4cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -/* Property Set GUID_DMUS_PROP_Effects - * - * Item 0: DWORD with effects flags. - * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS: - * DMUS_EFFECT_NONE - * DMUS_EFFECT_REVERB - * DMUS_EFFECT_CHORUS - */ -DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Property Set GUID_DMUS_PROP_LegacyCaps - * - * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported - * by ports which wrap WinMM devices. - */ - -DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps,0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -/* Property Set GUID_DMUS_PROP_Volume - * - * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume - * - */ -DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -/* Min and Max values for setting volume with GUID_DMUS_PROP_Volume */ - -#define DMUS_VOLUME_MAX 2000 /* +20 dB */ -#define DMUS_VOLUME_MIN -20000 /* -200 dB */ - -#ifdef __cplusplus -}; /* extern "C" */ -#endif - -#include - -#endif /* #ifndef _DMUSICC_ */ diff --git a/import/DirectX8/include/dmusicf.h b/import/DirectX8/include/dmusicf.h deleted file mode 100644 index 10908a9b5..000000000 --- a/import/DirectX8/include/dmusicf.h +++ /dev/null @@ -1,2373 +0,0 @@ -/************************************************************************ -* * -* dmusicf.h -- This module defines the DirectMusic file formats * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -************************************************************************/ - -#ifndef _DMUSICF_ -#define _DMUSICF_ - - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -interface IDirectMusicCollection; -#ifndef __cplusplus -typedef interface IDirectMusicCollection IDirectMusicCollection; -#endif - -/* Common chunks */ - -#define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d') -#define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O') -#define DMUS_FOURCC_UNFO_LIST mmioFOURCC('U','N','F','O') -#define DMUS_FOURCC_UNAM_CHUNK mmioFOURCC('U','N','A','M') -#define DMUS_FOURCC_UART_CHUNK mmioFOURCC('U','A','R','T') -#define DMUS_FOURCC_UCOP_CHUNK mmioFOURCC('U','C','O','P') -#define DMUS_FOURCC_USBJ_CHUNK mmioFOURCC('U','S','B','J') -#define DMUS_FOURCC_UCMT_CHUNK mmioFOURCC('U','C','M','T') -#define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g') -#define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s') - -/* The following structures are used by the Tracks, and are the packed structures */ -/* that are passed to the Tracks inside the IStream. */ - - -typedef struct _DMUS_IO_SEQ_ITEM -{ - MUSIC_TIME mtTime; - MUSIC_TIME mtDuration; - DWORD dwPChannel; - short nOffset; - BYTE bStatus; - BYTE bByte1; - BYTE bByte2; -} DMUS_IO_SEQ_ITEM; - - -typedef struct _DMUS_IO_CURVE_ITEM -{ - MUSIC_TIME mtStart; - MUSIC_TIME mtDuration; - MUSIC_TIME mtResetDuration; - DWORD dwPChannel; - short nOffset; - short nStartValue; - short nEndValue; - short nResetValue; - BYTE bType; - BYTE bCurveShape; - BYTE bCCData; - BYTE bFlags; - /* Following was added for DX8. */ - WORD wParamType; /* RPN or NRPN parameter number. */ - WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */ -} DMUS_IO_CURVE_ITEM; - - -typedef struct _DMUS_IO_TEMPO_ITEM -{ - MUSIC_TIME lTime; - double dblTempo; -} DMUS_IO_TEMPO_ITEM; - - -typedef struct _DMUS_IO_SYSEX_ITEM -{ - MUSIC_TIME mtTime; - DWORD dwPChannel; - DWORD dwSysExLength; -} DMUS_IO_SYSEX_ITEM; - -typedef DMUS_CHORD_KEY DMUS_CHORD_PARAM; /* DMUS_CHORD_KEY defined in dmusici.h */ - -typedef struct _DMUS_RHYTHM_PARAM -{ - DMUS_TIMESIGNATURE TimeSig; - DWORD dwRhythmPattern; -} DMUS_RHYTHM_PARAM; - -typedef struct _DMUS_TEMPO_PARAM -{ - MUSIC_TIME mtTime; - double dblTempo; -} DMUS_TEMPO_PARAM; - - -typedef struct _DMUS_MUTE_PARAM -{ - DWORD dwPChannel; - DWORD dwPChannelMap; - BOOL fMute; -} DMUS_MUTE_PARAM; - -/* Style chunks */ - -#define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T') -#define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h') -#define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t') -#define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h') -#define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e') -#define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e') -#define DMUS_FOURCC_MARKER_CHUNK mmioFOURCC('m','r','k','r') -#define DMUS_FOURCC_RESOLUTION_CHUNK mmioFOURCC('r','s','l','n') -#define DMUS_FOURCC_ANTICIPATION_CHUNK mmioFOURCC('a','n','p','n') -#define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n') -#define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h') -#define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m') -#define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f') -#define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c') -#define DMUS_FOURCC_STYLE_PERS_REF_LIST mmioFOURCC('p','r','r','f') -#define DMUS_FOURCC_MOTIFSETTINGS_CHUNK mmioFOURCC('m','t','f','s') - -/* Flags used by variations: these make up the DWORDs in dwVariationChoices. */ - -/* These flags determine the types of chords supported by a given variation in DirectMusic */ -/* mode. The first seven flags (bits 1-7) are set if the variation supports major chords */ -/* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation */ -/* supports major chords rooted in the tonic, second, and fourth scale positions. The */ -/* next seven flags serve the same purpose, but for minor chords, and the following seven */ -/* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4 */ -/* chords). Bits 22, 23, and 24 are set if the variation supports chords rooted in the */ -/* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones, */ -/* respectively. For example, to support a C# minor chord in the scale of C Major, */ -/* bits 8 (for tonic minor) and 24 (for sharp) need to be set. Bits 25, 26, an 27 handle */ -/* chords that are triads, 6th or 7th chords, and chords with extensions, respectively. */ -/* bits 28 and 29 handle chords that are followed by tonic and dominant chords, */ -/* respectively. */ -#define DMUS_VARIATIONF_MAJOR 0x0000007F /* Seven positions in the scale - major chords. */ -#define DMUS_VARIATIONF_MINOR 0x00003F80 /* Seven positions in the scale - minor chords. */ -#define DMUS_VARIATIONF_OTHER 0x001FC000 /* Seven positions in the scale - other chords. */ -#define DMUS_VARIATIONF_ROOT_SCALE 0x00200000 /* Handles chord roots in the scale. */ -#define DMUS_VARIATIONF_ROOT_FLAT 0x00400000 /* Handles flat chord roots (based on scale notes). */ -#define DMUS_VARIATIONF_ROOT_SHARP 0x00800000 /* Handles sharp chord roots (based on scale notes). */ -#define DMUS_VARIATIONF_TYPE_TRIAD 0x01000000 /* Handles simple chords - triads. */ -#define DMUS_VARIATIONF_TYPE_6AND7 0x02000000 /* Handles simple chords - 6 and 7. */ -#define DMUS_VARIATIONF_TYPE_COMPLEX 0x04000000 /* Handles complex chords. */ -#define DMUS_VARIATIONF_DEST_TO1 0x08000000 /* Handles transitions to 1 chord. */ -#define DMUS_VARIATIONF_DEST_TO5 0x10000000 /* Handles transitions to 5 chord. */ -#define DMUS_VARIATIONF_DEST_OTHER 0x40000000 /* Handles transitions to chords other than 1 . */ - -/* legacy mask for variation modes */ -#define DMUS_VARIATIONF_MODES 0xE0000000 -/* Bits 29 and 31 of the variation flags are the Mode bits. If both are 0, it's IMA. */ -/* If bit 29 is 1, it's Direct Music. */ -#define DMUS_VARIATIONF_MODES_EX (0x20000000 | 0x80000000) -#define DMUS_VARIATIONF_IMA25_MODE 0x00000000 -#define DMUS_VARIATIONF_DMUS_MODE 0x20000000 - -/* Set this if the part uses marker events */ -#define DMUS_PARTF_USE_MARKERS 0x1 -/* Set this if the part is allowed to switch only on chord-aligned markers */ -#define DMUS_PARTF_ALIGN_CHORDS 0x2 - -/* These specify if the marker event signals whether to stop a variation or start a -pattern/variation (or both), and whether new variations must align with a chord */ -#define DMUS_MARKERF_START 0x1 -#define DMUS_MARKERF_STOP 0x2 -#define DMUS_MARKERF_CHORD_ALIGN 0x4 - -/* if this flag is set, variation settings in a playing pattern-based track's state data will -persist in the track after it stops playing */ -#define DMUS_PATTERNF_PERSIST_CONTROL 0x1 - -/* These specify possible values for DMUS_IO_PARTREF.bRandomVariation - all but DMUS_VARIATIONT_SEQUENTIAL and DMUS_VARIATIONT_RANDOM are dx8. */ -typedef enum enumDMUS_VARIATIONT_TYPES -{ - DMUS_VARIATIONT_SEQUENTIAL = 0, /* Play sequential starting with variation 1. */ - DMUS_VARIATIONT_RANDOM = 1, /* Play randomly. */ - DMUS_VARIATIONT_RANDOM_START = 2, /* Play sequential starting with a random variation. */ - DMUS_VARIATIONT_NO_REPEAT = 3, /* Play randomly, but don't play the same variation twice. */ - DMUS_VARIATIONT_RANDOM_ROW = 4 /* Play randomly as a row: don't repeat any variation until all have played. */ -} DMUS_VARIATIONT_TYPES; - -#pragma pack(2) - -typedef struct _DMUS_IO_TIMESIG -{ - /* Time signatures define how many beats per measure, which note receives */ - /* the beat, and the grid resolution. */ - BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ - BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ - /* we can assume that 0 means 256th note */ - WORD wGridsPerBeat; /* grids per beat */ -} DMUS_IO_TIMESIG; - -typedef struct _DMUS_IO_STYLE -{ - DMUS_IO_TIMESIG timeSig; /* Styles have a default Time Signature */ - double dblTempo; -} DMUS_IO_STYLE; - -typedef struct _DMUS_IO_VERSION -{ - DWORD dwVersionMS; /* Version # high-order 32 bits */ - DWORD dwVersionLS; /* Version # low-order 32 bits */ -} DMUS_IO_VERSION; - -typedef struct _DMUS_IO_PATTERN -{ - DMUS_IO_TIMESIG timeSig; /* Patterns can override the Style's Time sig. */ - BYTE bGrooveBottom; /* bottom of groove range */ - BYTE bGrooveTop; /* top of groove range */ - WORD wEmbellishment; /* Fill, Break, Intro, End, Normal, Motif */ - WORD wNbrMeasures; /* length in measures */ - BYTE bDestGrooveBottom; /* bottom of groove range for next pattern */ - BYTE bDestGrooveTop; /* top of groove range for next pattern */ - DWORD dwFlags; /* various flags */ -} DMUS_IO_PATTERN; - -typedef struct _DMUS_IO_STYLEPART -{ - DMUS_IO_TIMESIG timeSig; /* can override pattern's */ - DWORD dwVariationChoices[32]; /* MOAW choice bitfield */ - GUID guidPartID; /* identifies the part */ - WORD wNbrMeasures; /* length of the Part */ - BYTE bPlayModeFlags; /* see PLAYMODE flags */ - BYTE bInvertUpper; /* inversion upper limit */ - BYTE bInvertLower; /* inversion lower limit */ - BYTE bPad[3]; /* for DWORD alignment */ - DWORD dwFlags; /* various flags */ -} DMUS_IO_STYLEPART; - -typedef struct _DMUS_IO_PARTREF -{ - GUID guidPartID; /* unique ID for matching up with parts */ - WORD wLogicalPartID; /* corresponds to port/device/midi channel OBSOLETE */ - BYTE bVariationLockID; /* parts with the same ID lock variations. */ - /* high bit is used to identify master Part */ - BYTE bSubChordLevel; /* tells which sub chord level this part wants */ - BYTE bPriority; /* 256 priority levels. Parts with lower priority */ - /* aren't played first when a device runs out of */ - /* notes */ - BYTE bRandomVariation; /* when set, matching variations play in random order */ - /* when clear, matching variations play sequentially */ - WORD wPad; /* not used */ - DWORD dwPChannel; /* replaces wLogicalPartID */ -} DMUS_IO_PARTREF; - -typedef struct _DMUS_IO_STYLENOTE -{ - MUSIC_TIME mtGridStart; /* when this note occurs */ - DWORD dwVariation; /* variation bits */ - MUSIC_TIME mtDuration; /* how long this note lasts */ - short nTimeOffset; /* offset from mtGridStart */ - WORD wMusicValue; /* Position in scale. */ - BYTE bVelocity; /* Note velocity. */ - BYTE bTimeRange; /* Range to randomize start time. */ - BYTE bDurRange; /* Range to randomize duration. */ - BYTE bVelRange; /* Range to randomize velocity. */ - BYTE bInversionID; /* Identifies inversion group to which this note belongs */ - BYTE bPlayModeFlags; /* Can override part */ - /* Following exists only under DX8 and on */ - BYTE bNoteFlags; /* values from DMUS_NOTEF_FLAGS */ -} DMUS_IO_STYLENOTE; - -typedef struct _DMUS_IO_STYLECURVE -{ - MUSIC_TIME mtGridStart; /* when this curve occurs */ - DWORD dwVariation; /* variation bits */ - MUSIC_TIME mtDuration; /* how long this curve lasts */ - MUSIC_TIME mtResetDuration;/* how long after the end of the curve to reset the curve */ - short nTimeOffset; /* offset from mtGridStart */ - short nStartValue; /* curve's start value */ - short nEndValue; /* curve's end value */ - short nResetValue; /* the value to which to reset the curve */ - BYTE bEventType; /* type of curve */ - BYTE bCurveShape; /* shape of curve */ - BYTE bCCData; /* CC# */ - BYTE bFlags; /* Bit 1=TRUE means to send nResetValue. Otherwise, don't. - Other bits are reserved. */ - /* Following was added for DX8. */ - WORD wParamType; /* RPN or NRPN parameter number. */ - WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */ -} DMUS_IO_STYLECURVE; - -typedef struct _DMUS_IO_STYLEMARKER -{ - MUSIC_TIME mtGridStart; /* when this marker occurs */ - DWORD dwVariation; /* variation bits */ - WORD wMarkerFlags; /* how the marker is used */ -} DMUS_IO_STYLEMARKER; - -typedef struct _DMUS_IO_STYLERESOLUTION -{ - DWORD dwVariation; /* variation bits */ - WORD wMusicValue; /* Position in scale. */ - BYTE bInversionID; /* Identifies inversion group to which this note belongs */ - BYTE bPlayModeFlags; /* Can override part */ -} DMUS_IO_STYLERESOLUTION; - -typedef struct _DMUS_IO_STYLE_ANTICIPATION -{ - MUSIC_TIME mtGridStart; /* when this anticipation occurs */ - DWORD dwVariation; /* variation bits */ - short nTimeOffset; /* offset from mtGridStart */ - BYTE bTimeRange; /* Range to randomize start time. */ -} DMUS_IO_STYLE_ANTICIPATION; - -typedef struct _DMUS_IO_MOTIFSETTINGS -{ - DWORD dwRepeats; /* Number of repeats. By default, 0. */ - MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */ - MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */ - MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than mtLoopStart. Or, 0, indicating loop full motif. */ - DWORD dwResolution; /* Default resolution. */ -} DMUS_IO_MOTIFSETTINGS; - -#pragma pack() - - -/* -RIFF -( - 'DMST' // Style - // Style header chunk - // Every Style has a GUID - [] // Name, author, copyright info., comments - [] // version chunk - ... // Array of parts in the Style, used by patterns - ... // Array of patterns in the Style - ... // Array of bands in the Style - []...// Optional array of chord map references in the Style -) - - // - styh - ( - - ) - - // - guid - ( - - ) - - // - vers - ( - - ) - - // - LIST - ( - 'part' - // Part header chunk - [] // Name, author, copyright info., comments - [] // Optional chunk containing an array of notes in Part - [] // Optional chunk containing an array of curves in Part - [] // Optional chunk containing an array of markers in Part - [] // Optional chunk containing an array of variation resolutions in Part - [] // Optional chunk containing an array of resolution anticipations in Part - ) - - // - prth - ( - - ) - - // - 'note' - ( - // sizeof DMUS_IO_STYLENOTE:DWORD - ... - ) - - // - 'crve' - ( - // sizeof DMUS_IO_STYLECURVE:DWORD - ... - ) - - // - 'mrkr' - ( - // sizeof DMUS_IO_STYLEMARKER:DWORD - ... - ) - - // - 'rsln' - ( - // sizeof DMUS_IO_STYLERESOLUTION:DWORD - ... - ) - - // - 'anpn' - ( - // sizeof DMUS_IO_STYLE_ANTICIPATION:DWORD - ... - ) - - // - LIST - ( - 'pttn' - // Pattern header chunk - // Chunk containing an array of rhythms for chord matching - [] // Name, author, copyright info., comments - [] // Motif settings chunk - [] // Optional band to be associated with the pattern (for motifs) - ... // Array of part reference id's - ) - - // - ptnh - ( - - ) - - // - 'rhtm' - ( - // DWORD's representing rhythms for chord matching based on number - // of measures in the pattern - ) - - - // pref-list - LIST - ( - 'pref' - // part ref chunk - ) - - // - prfc - ( - - ) - - // - mtfs - ( - - ) - - // - LIST - ( - 'prrf' - ... // Array of Chordmap references - ) -*/ - -/* Pattern chunk, for use in Pattern tracks */ - -#define DMUS_FOURCC_PATTERN_FORM mmioFOURCC('D','M','P','T') - -/* -RIFF -( - 'DMPT' // Pattern - // Style header chunk - // The pattern, in single pattern format (includes DMUS_FOURCC_PART_LIST chunks) -) -*/ - - -/* Chord and command file formats */ - -/* These specify possible values for DMUS_IO_COMMAND.bRepeatMode (dx8) */ -typedef enum enumDMUS_PATTERNT_TYPES -{ - DMUS_PATTERNT_RANDOM = 0, /* Play randomly. (dx7 behavior) */ - DMUS_PATTERNT_REPEAT = 1, /* Repeat last pattern. */ - DMUS_PATTERNT_SEQUENTIAL = 2, /* Play sequential starting with first matching pattern. */ - DMUS_PATTERNT_RANDOM_START = 3, /* Play sequential starting with a random pattern. */ - DMUS_PATTERNT_NO_REPEAT = 4, /* Play randomly, but don't play the same pattern twice. */ - DMUS_PATTERNT_RANDOM_ROW = 5 /* Play randomly as a row: don't repeat any pattern until all have played. */ -} DMUS_PATTERNT_TYPES; - -#define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d') -#define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h') -#define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b') - -#define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d') - -typedef struct _DMUS_IO_CHORD -{ - WCHAR wszName[16]; /* Name of the chord */ - MUSIC_TIME mtTime; /* Time of this chord */ - WORD wMeasure; /* Measure this falls on */ - BYTE bBeat; /* Beat this falls on */ - BYTE bFlags; /* Various flags */ -} DMUS_IO_CHORD; - -typedef struct _DMUS_IO_SUBCHORD -{ - DWORD dwChordPattern; /* Notes in the subchord */ - DWORD dwScalePattern; /* Notes in the scale */ - DWORD dwInversionPoints; /* Where inversions can occur */ - DWORD dwLevels; /* Which levels are supported by this subchord */ - BYTE bChordRoot; /* Root of the subchord */ - BYTE bScaleRoot; /* Root of the scale */ -} DMUS_IO_SUBCHORD; - -typedef struct _DMUS_IO_COMMAND -{ - MUSIC_TIME mtTime; /* Time of this command */ - WORD wMeasure; /* Measure this falls on */ - BYTE bBeat; /* Beat this falls on */ - BYTE bCommand; /* Command type (see #defines below) */ - BYTE bGrooveLevel; /* Groove level (0 if command is not a groove) */ - BYTE bGrooveRange; /* Groove range */ - BYTE bRepeatMode; /* Used to control selection of patterns with same groove level */ -} DMUS_IO_COMMAND; - - -/* - - // - LIST - ( - 'cord' - - // Chord body chunk - ) - - // - crdh - ( - // Scale: dword (upper 8 bits for root, lower 24 for scale) - ) - - // - crdb - ( - // sizeof DMUS_IO_CHORD:dword - - // # of DMUS_IO_SUBCHORDS:dword - // sizeof DMUS_IO_SUBCHORDS:dword - // a number of - ) - - - // - 'cmnd' - ( - //sizeof DMUS_IO_COMMAND: DWORD - ... - ) - -*/ - -/* File io for DirectMusic Tool and ToolGraph objects -*/ - -/* RIFF ids: */ - -#define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G') -#define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l') -#define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L') -#define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h') - -/* io structures: */ - -typedef struct _DMUS_IO_TOOL_HEADER -{ - GUID guidClassID; /* Class id of tool. */ - long lIndex; /* Position in graph. */ - DWORD cPChannels; /* Number of items in channels array. */ - FOURCC ckid; /* chunk ID of tool's data chunk if 0 fccType valid. */ - FOURCC fccType; /* list type if NULL ckid valid. */ - DWORD dwPChannels[1]; /* Array of PChannels, size determined by cPChannels. */ -} DMUS_IO_TOOL_HEADER; - -/* -RIFF -( - 'DMTG' // DirectMusic ToolGraph chunk - [] // GUID for ToolGraph - [] // Optional version info - [] // Name, author, copyright info., comments - // List of Tools -) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - // - LIST - ( - 'toll' // Array of tools - ... // Each tool is encapsulated in a RIFF chunk - ) - -// Tools are embedded in a graph. Theoretically, they can be saved as individual files too. -RIFF -( - 'DMTL' - - [] // Tool data. Must be a RIFF readable chunk. -) - - // // Tool header chunk - ( - 'tolh' - // Tool header - ) -*/ - -/* The AudioPath file carries everything for describing a specific audio path, - including Tool Graph and Buffer Descriptor. - This can even be used for configuring a complete performance. -*/ - -#define DMUS_FOURCC_AUDIOPATH_FORM mmioFOURCC('D','M','A','P') - -/* -RIFF -( - 'DMAP' // DirectMusic AudioPath chunk - [] // GUID for this Audio Path configuration - [] // Optional version info - [] // Name, author, copyright info., comments - [] // Optional ToolGraph - [] // Optional list of port configurations - []...// Optional array of Dsound buffer descriptors -) -*/ - -#define DMUS_FOURCC_PORTCONFIGS_LIST mmioFOURCC('p','c','s','l') -#define DMUS_FOURCC_PORTCONFIG_LIST mmioFOURCC('p','c','f','l') -#define DMUS_FOURCC_PORTCONFIG_ITEM mmioFOURCC('p','c','f','h') -#define DMUS_FOURCC_PORTPARAMS_ITEM mmioFOURCC('p','p','r','h') -#define DMUS_FOURCC_DSBUFFER_LIST mmioFOURCC('d','b','f','l') -#define DMUS_FOURCC_DSBUFFATTR_ITEM mmioFOURCC('d','d','a','h') -#define DMUS_FOURCC_PCHANNELS_LIST mmioFOURCC('p','c','h','l') -#define DMUS_FOURCC_PCHANNELS_ITEM mmioFOURCC('p','c','h','h') - -typedef struct _DMUS_IO_PORTCONFIG_HEADER -{ - GUID guidPort; /* GUID of requested port. */ - DWORD dwPChannelBase; /* PChannel that this should start on. */ - DWORD dwPChannelCount; /* How many channels. */ - DWORD dwFlags; /* Various flags. */ -} DMUS_IO_PORTCONFIG_HEADER; - -#define DMUS_PORTCONFIGF_DRUMSON10 1 /* This port configured for drums on channel 10. */ -#define DMUS_PORTCONFIGF_USEDEFAULT 2 /* Use the default port. */ - -/* Each portconfig has one or more pchannel to buffer mappings. Each buffer - is identified by a guid. Each pchannel can map to one or more buffers. - This is defined with one or more DMUS_IO_PCHANNELTOBUFFER_HEADER - structures. Each defines a range of PChannels and the set of buffers - that they connect to. -*/ - -typedef struct _DMUS_IO_PCHANNELTOBUFFER_HEADER -{ - DWORD dwPChannelBase; /* PChannel that this should start on. */ - DWORD dwPChannelCount; /* How many PChannels. */ - DWORD dwBufferCount; /* How many buffers do these connect to. */ - DWORD dwFlags; /* Various flags. Currently reserved for future use. Must be 0. */ -} DMUS_IO_PCHANNELTOBUFFER_HEADER; - -/* Each buffer is represented by an DSBC form. This is wrapped by the - DMUS_IO_BUFFER_ATTRIBUTES_HEADER which identifies how to use the - buffer. In particular, it indicates whether this gets dynamically duplicated - or all references to this should share the same instance. - To resolve references, the unique GUID of the buffer is also stored - in this structure. -*/ - -typedef struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER -{ - GUID guidBufferID; /* Each buffer config has a unique ID. */ - DWORD dwFlags; /* Various flags. */ -} DMUS_IO_BUFFER_ATTRIBUTES_HEADER; - -/* DMUS_IO_BUFFER_ATTRIBUTES_HEADER.dwFlags: */ -#define DMUS_BUFFERF_SHARED 1 /* Share this with other audio paths, instead of creating unique copies. */ -#define DMUS_BUFFERF_DEFINED 2 /* Use one of the standard predefined buffers (see GUID_Buffer... in dmusici.h.) */ -#define DMUS_BUFFERF_MIXIN 8 /* This is a mixin buffer. */ - -/* - -LIST -( - 'pcsl' // Array of port configurations - ... // One or more port configurations, each in a list chunk -) - -LIST -( - 'pcfl' // List container for one port configuration. - // Portconfig header chunk. - // Port params, to be used to create the port. - []...// Optional array of Dsound buffer descriptors - [] // Optional list of pchannel to buffer assignments - -) - - // // Port config header chunk - ( - 'pcfh' - // Port config header - ) - - // // Port params header chunk - ( - 'pprh' - // Port params header - ) - -LIST -( - 'pchl' // List container for one or more pchannel to buffer assignments. - ... // One or more pchannel to buffer assignment headers and data. - - // - ( - 'pchh' - // Description of PChannels - ... // Array of GUIDs defining the buffers they all connect to. - ) -) - -LIST -( - 'dbfl' // List container for one buffer and buffer attributes header. - // Buffer attributes header. - [] // Buffer configuration. Not required when header uses a predefined buffer type. - - // - ( - 'ddah' - // Buffer attributes. - ) -) -*/ - -/* File io for DirectMusic Band Track object */ - - -/* RIFF ids: */ -#define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T') -#define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h') -#define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l') -#define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d') -#define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','d','i','h') -#define DMUS_FOURCC_BANDITEM_CHUNK2 mmioFOURCC('b','d','2','h') - -/* io structures */ -typedef struct _DMUS_IO_BAND_TRACK_HEADER -{ - BOOL bAutoDownload; /* Determines if Auto-Download is enabled. */ -} DMUS_IO_BAND_TRACK_HEADER; - -typedef struct _DMUS_IO_BAND_ITEM_HEADER -{ - MUSIC_TIME lBandTime; /* Position in track list. */ -} DMUS_IO_BAND_ITEM_HEADER; - -typedef struct _DMUS_IO_BAND_ITEM_HEADER2 -{ - MUSIC_TIME lBandTimeLogical; /* Position in track list. Time in the music with which band change is associated. */ - MUSIC_TIME lBandTimePhysical; /* Precise time band change will take effect. Should be close to logical time. */ -} DMUS_IO_BAND_ITEM_HEADER2; - -/* -RIFF -( - 'DMBT' // DirectMusic Band Track form-type - [] // Band track header - [] // GUID for band track - [] // Optional version info - [] // Name, author, copyright info., comments - // List of Band items -) - - // - 'bdth' - ( - - ) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - // - LIST - ( - 'lbdl' - ... // Array of bands, each encapsulated in a list chunk - ) - - // - LIST - ( - 'lbnd' - or // bdih is a legacy format. bd2h is preferred for new content. - // Band - ) - - // or // band item header - ( - or // Band item header - ) -*/ - - -/* File io for DirectMusic Band object -*/ - -/* RIFF ids: */ - -#define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D') -#define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l') -#define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n') -#define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s') - -/* Flags for DMUS_IO_INSTRUMENT - */ -#define DMUS_IO_INST_PATCH (1 << 0) /* dwPatch is valid. */ -#define DMUS_IO_INST_BANKSELECT (1 << 1) /* dwPatch contains a valid Bank Select MSB and LSB part */ -#define DMUS_IO_INST_ASSIGN_PATCH (1 << 3) /* dwAssignPatch is valid */ -#define DMUS_IO_INST_NOTERANGES (1 << 4) /* dwNoteRanges is valid */ -#define DMUS_IO_INST_PAN (1 << 5) /* bPan is valid */ -#define DMUS_IO_INST_VOLUME (1 << 6 ) /* bVolume is valid */ -#define DMUS_IO_INST_TRANSPOSE (1 << 7) /* nTranspose is valid */ -#define DMUS_IO_INST_GM (1 << 8) /* Instrument is from GM collection */ -#define DMUS_IO_INST_GS (1 << 9) /* Instrument is from GS collection */ -#define DMUS_IO_INST_XG (1 << 10) /* Instrument is from XG collection */ -#define DMUS_IO_INST_CHANNEL_PRIORITY (1 << 11) /* dwChannelPriority is valid */ -#define DMUS_IO_INST_USE_DEFAULT_GM_SET (1 << 12) /* Always use the default GM set for this patch, */ - /* don't rely on the synth caps stating GM or GS in hardware. */ -#define DMUS_IO_INST_PITCHBENDRANGE (1 << 13) /* nPitchBendRange is valid */ - -/* io structures */ -typedef struct _DMUS_IO_INSTRUMENT -{ - DWORD dwPatch; /* MSB, LSB and Program change to define instrument */ - DWORD dwAssignPatch; /* MSB, LSB and Program change to assign to instrument when downloading */ - DWORD dwNoteRanges[4]; /* 128 bits; one for each MIDI note instrument needs to able to play */ - DWORD dwPChannel; /* PChannel instrument plays on */ - DWORD dwFlags; /* DMUS_IO_INST_ flags */ - BYTE bPan; /* Pan for instrument */ - BYTE bVolume; /* Volume for instrument */ - short nTranspose; /* Number of semitones to transpose notes */ - DWORD dwChannelPriority; /* Channel priority */ - short nPitchBendRange; /* Number of semitones shifted by pitch bend */ -} DMUS_IO_INSTRUMENT; - -/* -// bands can be embedded in other forms -RIFF -( - 'DMBD' // DirectMusic Band chunk - [] // GUID for band - [] // Optional version info - [] // Name, author, copyright info., comments - // List of Instruments -) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - // - LIST - ( - 'lbil' // Array of instruments - ... // Each instrument is encapsulated in a list - ) - - // - LIST - ( - 'lbin' - - [] // Optional reference to DLS Collection file. - ) - - // // Instrument chunk - ( - 'bins' - // Instrument header - ) -*/ - -/* This RIFF id and io struct have been added to allow wave files (and the wave object) to - differentiate between streaming and one-shot waves, and to give a prefetch for streaming - waves */ - -#define DMUS_FOURCC_WAVEHEADER_CHUNK mmioFOURCC('w','a','v','h') - -typedef struct _DMUS_IO_WAVE_HEADER -{ - REFERENCE_TIME rtReadAhead; /* How far ahead in the stream wave data will be read (in REFERENCE_TIME). Ignored for one-shot waves. */ - DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */ -} DMUS_IO_WAVE_HEADER; - - -/* File io for Wave track */ - -/* RIFF ids: */ - -#define DMUS_FOURCC_WAVETRACK_LIST mmioFOURCC('w','a','v','t') -#define DMUS_FOURCC_WAVETRACK_CHUNK mmioFOURCC('w','a','t','h') -#define DMUS_FOURCC_WAVEPART_LIST mmioFOURCC('w','a','v','p') -#define DMUS_FOURCC_WAVEPART_CHUNK mmioFOURCC('w','a','p','h') -#define DMUS_FOURCC_WAVEITEM_LIST mmioFOURCC('w','a','v','i') -#define DMUS_FOURCC_WAVE_LIST mmioFOURCC('w','a','v','e') -#define DMUS_FOURCC_WAVEITEM_CHUNK mmioFOURCC('w','a','i','h') - -/* This flag is included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, the track will get its - variations from a pattern track, via GetParam(GUID_Variations). */ -#define DMUS_WAVETRACKF_SYNC_VAR 0x1 -/* This is also included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, variation control - information will persist from one playback instance to the next.*/ -#define DMUS_WAVETRACKF_PERSIST_CONTROL 0x2 - -typedef struct _DMUS_IO_WAVE_TRACK_HEADER -{ - long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves. Note: All gain values should be negative. */ - DWORD dwFlags; /* Flags, including whether this track syncs to a pattern track for its variations. */ -} DMUS_IO_WAVE_TRACK_HEADER; - -typedef struct _DMUS_IO_WAVE_PART_HEADER -{ - long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves in wave part. Note: All gain values should be negative. */ - DWORD dwVariations; /* Variation mask for which of 32 variations */ - DWORD dwPChannel; /* PChannel */ - DWORD dwLockToPart; /* Part ID to lock to. */ - DWORD dwFlags; /* Flags, including stuff for managing how variations are chosen (in low-order nibble) */ - DWORD dwIndex; /* Index for distinguishing multiple parts on the same PChannel*/ -} DMUS_IO_WAVE_PART_HEADER; - -typedef struct _DMUS_IO_WAVE_ITEM_HEADER -{ - long lVolume; /* Gain, in 1/100th of dB. Note: All gain values should be negative. */ - long lPitch; /* Pitch offset in 1/100th of a semitone. */ - DWORD dwVariations; /* Variation flags for which of 32 variations this wave belongs to. */ - REFERENCE_TIME rtTime; /* Start time, in REFERENCE_TIME, if clock time track, or MUSIC_TIME for music time track. */ - REFERENCE_TIME rtStartOffset; /* Distance into wave to start playback, in reference time units. */ - REFERENCE_TIME rtReserved; /* Reserved field. */ - REFERENCE_TIME rtDuration; /* Duration, in REFERENCE_TIME or MUSIC_TIME, depending on track timing format. */ - MUSIC_TIME mtLogicalTime; /* If in music track format, this indicates the musical boundary where this belongs. Otherwise, ignored. */ - DWORD dwLoopStart; /* Start point for a looping wave. */ - DWORD dwLoopEnd; /* End point for a looping wave. */ - DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */ -} DMUS_IO_WAVE_ITEM_HEADER; - -/* -LIST -{ - 'wavt' // Wave track chunk - // Wave track header - ... // Array of Wave Parts -} - // - 'wath' - { - - } - - // - LIST - { - 'wavp' - // Wave Part Header - // List of wave items - } - - // - 'waph' - { - - } - - // - LIST - { - 'wavi' - ... // Array of waves; each wave is encapsulated in a list - } - - // - LIST - { - 'wave' - // Wave item header - // Reference to wave object - } - - // - 'waih' - { - - } - -*/ - -/* File io for DirectMusic Container file. This embeds a set of related files. And, - in turn, it can be embedded within a segment or script file. -*/ - -#define DMUS_FOURCC_CONTAINER_FORM mmioFOURCC('D','M','C','N') -#define DMUS_FOURCC_CONTAINER_CHUNK mmioFOURCC('c','o','n','h') -#define DMUS_FOURCC_CONTAINED_ALIAS_CHUNK mmioFOURCC('c','o','b','a') -#define DMUS_FOURCC_CONTAINED_OBJECT_CHUNK mmioFOURCC('c','o','b','h') -#define DMUS_FOURCC_CONTAINED_OBJECTS_LIST mmioFOURCC('c','o','s','l') -#define DMUS_FOURCC_CONTAINED_OBJECT_LIST mmioFOURCC('c','o','b','l') - -typedef struct _DMUS_IO_CONTAINER_HEADER -{ - DWORD dwFlags; /* Flags. */ -} DMUS_IO_CONTAINER_HEADER; - -#define DMUS_CONTAINER_NOLOADS (1 << 1) /* Contained items are not loaded when the container is loaded. - Entries will be created in the loader (via SetObject) but - the actual objects will not be created until they are - specifically loaded at a later time. */ - -typedef struct _DMUS_IO_CONTAINED_OBJECT_HEADER -{ - GUID guidClassID; /* Class id of object. */ - DWORD dwFlags; /* Flags, for example DMUS_CONTAINED_OBJF_KEEP. */ - FOURCC ckid; /* chunk ID of track's data chunk if 0 fccType valid. */ - FOURCC fccType; /* list type if NULL ckid valid */ - /* Note that LIST:DMRF may be used for ckid and fccType in order to reference an - object instead of embedding it within the container. */ -} DMUS_IO_CONTAINED_OBJECT_HEADER; - -#define DMUS_CONTAINED_OBJF_KEEP 1 /* Keep the object cached in the loader after the container is released. */ - -/* -RIFF -( - 'DMCN' // DirectMusic Container chunk - // Container header chunk - [] // GUID for container - [] // Optional version info - [] // Name, author, copyright info., comments - // List of objects. -) - - // - 'conh' - ( - - ) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - LIST - ( - 'cosl' // Array of embedded objects. - ... // Each object is encapsulated in a LIST chunk - ) - - // // Encapsulates one object - LIST - ( - 'cobl' - [] // Alias. An alternative name by which this object is known - // within the container. - // Required header, includes CLASS ID for object. - [] or // Object data of the type specified in . - // If DMRF, it is a reference of where to find the object. - // Otherwise, it could be any RIFF readable chunk in the - // exact same format as a file. The object will load - // itself from this data. - ) - - // - 'coba' - ( - // Alias, stored as NULL terminated string of WCHARs - ) - - // - 'cobh' - ( - - ) -*/ - -/* File io for DirectMusic Segment object */ - -/* RIFF ids: */ - -#define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G') -#define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h') -#define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l') -#define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K') -#define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h') -#define DMUS_FOURCC_TRACK_EXTRAS_CHUNK mmioFOURCC('t','r','k','x') - -/* io structures:*/ - -typedef struct _DMUS_IO_SEGMENT_HEADER -{ - DWORD dwRepeats; /* Number of repeats. By default, 0. */ - MUSIC_TIME mtLength; /* Length, in music time. */ - MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */ - MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */ - MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than dwPlayStart. Or, 0, indicating loop full segment. */ - DWORD dwResolution; /* Default resolution. */ - /* Following added for DX8: */ - REFERENCE_TIME rtLength; /* Length, in reference time (overrides music time length.) */ - DWORD dwFlags; - DWORD dwReserved; /* Reserved. */ -} DMUS_IO_SEGMENT_HEADER; - -#define DMUS_SEGIOF_REFLENGTH 1 /* Use the time in rtLength for the segment length. */ - -typedef struct _DMUS_IO_TRACK_HEADER -{ - GUID guidClassID; /* Class id of track. */ - DWORD dwPosition; /* Position in track list. */ - DWORD dwGroup; /* Group bits for track. */ - FOURCC ckid; /* chunk ID of track's data chunk. */ - FOURCC fccType; /* list type if ckid is RIFF or LIST */ -} DMUS_IO_TRACK_HEADER; - -/* Additional parameters for the track header chunk, introduced in DX8 and - on, are stored in a separate chunk. */ - -typedef struct _DMUS_IO_TRACK_EXTRAS_HEADER -{ - DWORD dwFlags; /* DX8 Added flags for control tracks. */ - DWORD dwPriority; /* Priority for composition. */ -} DMUS_IO_TRACK_EXTRAS_HEADER; - -/* -RIFF -( - 'DMSG' // DirectMusic Segment chunk - // Segment header chunk - [] // GUID for segment - [] // Optional version info - [] // Name, author, copyright info., comments - [] // Optional container of objects embedded in file. Must precede tracklist. - // List of Tracks - [] // Optional ToolGraph - [] // Optional Audio Path -) - - // - 'segh' - ( - - ) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - // - LIST - ( - 'trkl' // Array of tracks - ... // Each track is encapsulated in a RIFF chunk - ) - - // // Tracks can be embedded in a segment or stored as separate files. - RIFF - ( - 'DMTK' - - [] // Optional track flags. - [] // Optional GUID for track object instance (not to be confused with Class id in track header) - [] // Optional version info - [] // Optional name, author, copyright info., comments - [] // Track data. Must be a RIFF readable chunk. - ) - - // // Track header chunk - ( - 'trkh' - // Track header - ) - - // // Track flags chunk - ( - 'trkx' - // DX8 Track flags header - ) -*/ - -/* File io for DirectMusic Song object */ -/* Note: Song file format is not supported in DX8. */ - -/* RIFF ids: */ - -#define DMUS_FOURCC_SONG_FORM mmioFOURCC('D','M','S','O') /* Entire song. */ -#define DMUS_FOURCC_SONG_CHUNK mmioFOURCC('s','n','g','h') /* Song header info. */ -#define DMUS_FOURCC_SONGSEGMENTS_LIST mmioFOURCC('s','e','g','l') /* List of embedded segments. */ -#define DMUS_FOURCC_SONGSEGMENT_LIST mmioFOURCC('s','s','g','l') /* Container for a segment or segment reference. */ -#define DMUS_FOURCC_TOOLGRAPHS_LIST mmioFOURCC('t','l','g','l') /* List of embedded tool graphs. */ -#define DMUS_FOURCC_SEGREFS_LIST mmioFOURCC('s','r','s','l') /* List of segment references. */ -#define DMUS_FOURCC_SEGREF_LIST mmioFOURCC('s','g','r','l') /* Container for a segment reference. */ -#define DMUS_FOURCC_SEGREF_CHUNK mmioFOURCC('s','g','r','h') /* Segment reference header. */ -#define DMUS_FOURCC_SEGTRANS_CHUNK mmioFOURCC('s','t','r','h') /* Set of transitions to this segment. */ -#define DMUS_FOURCC_TRACKREFS_LIST mmioFOURCC('t','r','s','l') /* Set of track references within the segment reference. */ -#define DMUS_FOURCC_TRACKREF_LIST mmioFOURCC('t','k','r','l') /* Container for a track reference. */ -#define DMUS_FOURCC_TRACKREF_CHUNK mmioFOURCC('t','k','r','h') /* Track reference header. */ - -/* io structures:*/ - -typedef struct _DMUS_IO_SONG_HEADER -{ - DWORD dwFlags; - DWORD dwStartSegID; /* Id of the segment that starts playback. */ -} DMUS_IO_SONG_HEADER; - -typedef struct _DMUS_IO_SEGREF_HEADER -{ - DWORD dwID; /* Each has a unique ID. Must be less than DMUS_SONG_MAXSEGID. */ - DWORD dwSegmentID; /* Optional segment to link to. */ - DWORD dwToolGraphID; /* Optional tool graph to use for processing. */ - DWORD dwFlags; /* Various control flags. Currently reserved for future use. Must be 0. */ - DWORD dwNextPlayID; /* ID of next segment, to chain segments into a song. */ -} DMUS_IO_SEGREF_HEADER; - - -typedef struct _DMUS_IO_TRACKREF_HEADER -{ - DWORD dwSegmentID; /* Which segment to find this in. */ - DWORD dwFlags; /* Reference control flags. */ -} DMUS_IO_TRACKREF_HEADER; - -/* Transition definition chunk defines a transition, using an optional transition template - segment. -*/ - -typedef struct _DMUS_IO_TRANSITION_DEF -{ - DWORD dwSegmentID; /* Segment the transition goes to. */ - DWORD dwTransitionID; /* Template segment to use for the transition. */ - DWORD dwPlayFlags; /* Flags to use for transition. */ -} DMUS_IO_TRANSITION_DEF; - -#define DMUS_SONG_MAXSEGID 0x7FFFFFFF /* Segment ids can not go higher than this. */ -#define DMUS_SONG_ANYSEG 0x80000000 /* Special ID to indicate any segment. */ -#define DMUS_SONG_NOSEG 0xFFFFFFFF /* Special ID to indicate no segment. */ -#define DMUS_SONG_NOFROMSEG 0x80000001 /* Special ID for dwSegmentID to indicate transition from nothing (or outside the song) into this segment. */ - -/* -RIFF -( - 'DMSO' // DirectMusic Song chunk - // Song header chunk - [] // GUID for song - [] // Optional version info - [] // Name, author, copyright info., comments - [] // Optional container of objects embedded in file. Must precede segment list. - // List of Segments - [] // Optional list of ToolGraphs - [] // Optional Audio Path - to be shared by all segments in song. - // List of segment references. -) - - // - 'sngh' - ( - - ) - - // - LIST - ( - 'segl' // Array of segments - ... // Each segment is wrapped in this. - ) - - // - LIST - ( - 'ssgl' // Segment container. - [DMSG-form] // Each segment is either a full embedded segment RIFF form. - [DMRF-list] // Or a reference to an external segment. - ) - - // - LIST - ( - 'tlgl' // Array of toolgraphs - ... // Each toolgraph is a full RIFF form. - ) - - // - LIST - ( - 'srsl' // Array of segment references - ... // Each segment reference is contained in a RIFF list. - ) - - // // Segment reference container. - LIST - ( - 'sgrl' - // Segment reference header chunk. - // Segment header chunk. Defines the segment. - // Name, author, etc. Primarily for name, though, which is required for Song->GetSegment(). - [] // Segment transition chunk. Defines how to do transitions from other segments. - [] // List of track references, to create a segment from tracks in multiple segments. - ) - - // // Segment reference header chunk - ( - 'sgrh' - // Segment reference header - ) - - // // Segment transition chunk. - ( - 'strh' - // Default transition. - ... // Additional transitions. - ) - - // // Array of track references - ( - 'trsl' - ... // Each track reference is multiple chunks in a tkrl list. - ) - - // // Track reference container - ( - 'tkrl' - // Track reference header chunk. - // Normal track header chunk. - [] // Optional track flags. - ) - - // // Track reference header chunk - ( - 'tkrh' - // Track reference header - ) -*/ - -/* File io for DirectMusic reference chunk. - This is used to embed a reference to an object. -*/ - -/* RIFF ids: */ - -#define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F') -#define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h') -#define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e') -#define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e') -#define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e') - -typedef struct _DMUS_IO_REFERENCE -{ - GUID guidClassID; /* Class id is always required. */ - DWORD dwValidData; /* Flags. */ -} DMUS_IO_REFERENCE; - -/* -LIST -( - 'DMRF' // DirectMusic Reference chunk - // Reference header chunk - [] // Optional object GUID. - [] // Optional file date. - [] // Optional name. - [] // Optional file name. - [] // Optional category name. - [] // Optional version info. -) - - // - 'refh' - ( - - ) - - // - 'guid' - ( - - ) - - // - date - ( - - ) - - // - name - ( - // Name, stored as NULL terminated string of WCHARs - ) - - // - file - ( - // File name, stored as NULL terminated string of WCHARs - ) - - // - catg - ( - // Category name, stored as NULL terminated string of WCHARs - ) - - // - vers - ( - - ) -*/ - -/* Chord Maps */ - -/* runtime chunks */ -#define DMUS_FOURCC_CHORDMAP_FORM mmioFOURCC('D','M','P','R') -#define DMUS_FOURCC_IOCHORDMAP_CHUNK mmioFOURCC('p','e','r','h') -#define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t') -#define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h') -#define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n') -#define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d') -#define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q') -#define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h') -#define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M') - -/* runtime list chunks */ -#define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e') -#define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p') -#define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d') -#define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l') -#define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e') -#define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t') - -#define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q') - -/* values for dwChord field of DMUS_IO_PERS_SIGNPOST */ -/* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) */ -#define DMUS_SIGNPOSTF_A 1 -#define DMUS_SIGNPOSTF_B 2 -#define DMUS_SIGNPOSTF_C 4 -#define DMUS_SIGNPOSTF_D 8 -#define DMUS_SIGNPOSTF_E 0x10 -#define DMUS_SIGNPOSTF_F 0x20 -#define DMUS_SIGNPOSTF_LETTER (DMUS_SIGNPOSTF_A | DMUS_SIGNPOSTF_B | DMUS_SIGNPOSTF_C | DMUS_SIGNPOSTF_D | DMUS_SIGNPOSTF_E | DMUS_SIGNPOSTF_F) -#define DMUS_SIGNPOSTF_1 0x100 -#define DMUS_SIGNPOSTF_2 0x200 -#define DMUS_SIGNPOSTF_3 0x400 -#define DMUS_SIGNPOSTF_4 0x800 -#define DMUS_SIGNPOSTF_5 0x1000 -#define DMUS_SIGNPOSTF_6 0x2000 -#define DMUS_SIGNPOSTF_7 0x4000 -#define DMUS_SIGNPOSTF_ROOT (DMUS_SIGNPOSTF_1 | DMUS_SIGNPOSTF_2 | DMUS_SIGNPOSTF_3 | DMUS_SIGNPOSTF_4 | DMUS_SIGNPOSTF_5 | DMUS_SIGNPOSTF_6 | DMUS_SIGNPOSTF_7) -#define DMUS_SIGNPOSTF_CADENCE 0x8000 - -/* values for dwFlags field of DMUS_IO_CHORDMAP */ -#define DMUS_CHORDMAPF_VERSION8 1 /* Chordmap is version 8 or above. */ - -/* values for dwChord field of DMUS_IO_PERS_SIGNPOST */ -#define DMUS_SPOSTCADENCEF_1 2 /* Use the first cadence chord. */ -#define DMUS_SPOSTCADENCEF_2 4 /* Use the second cadence chord. */ - -/* run time data structs */ -typedef struct _DMUS_IO_CHORDMAP -{ - WCHAR wszLoadName[20]; - DWORD dwScalePattern; - DWORD dwFlags; /* Various flags. Only lower 16 bits are significant. */ -} DMUS_IO_CHORDMAP; - -typedef struct _DMUS_IO_CHORDMAP_SUBCHORD -{ - DWORD dwChordPattern; - DWORD dwScalePattern; - DWORD dwInvertPattern; - BYTE bChordRoot; - BYTE bScaleRoot; - WORD wCFlags; - DWORD dwLevels; /* parts or which subchord levels this chord supports */ -} DMUS_IO_CHORDMAP_SUBCHORD; - -/* Legacy name... */ -typedef DMUS_IO_CHORDMAP_SUBCHORD DMUS_IO_PERS_SUBCHORD; - -typedef struct _DMUS_IO_CHORDENTRY -{ - DWORD dwFlags; - WORD wConnectionID; /* replaces runtime "pointer to this" */ -} DMUS_IO_CHORDENTRY; - -typedef struct _DMUS_IO_NEXTCHORD -{ - DWORD dwFlags; - WORD nWeight; - WORD wMinBeats; - WORD wMaxBeats; - WORD wConnectionID; /* points to an ioChordEntry */ -} DMUS_IO_NEXTCHORD; - -typedef struct _DMUS_IO_CHORDMAP_SIGNPOST -{ - DWORD dwChords; /* 1bit per group */ - DWORD dwFlags; -} DMUS_IO_CHORDMAP_SIGNPOST; - -/* Legacy name... */ -typedef DMUS_IO_CHORDMAP_SIGNPOST DMUS_IO_PERS_SIGNPOST; - -/* -RIFF -( - 'DMPR' - // Chord map header chunk - [] // guid chunk - [] // version chunk (two DWORDS) - [] // Unfo chunk - // subchord database - // chord palette - // chord map - // signpost list - ) - - ::= LIST('cmap' ) - - ::= LIST('choe' - // chord entry data - // chord definition - // connecting(next) chords - ) - - ::= LIST('chrd' - // name of chord in wide char format - // list of subchords composing chord - ) - - ::= LIST('chpl' - ... // chord definition - ) - - ::== LIST('spsq' ... ) - - ::= LIST('spst' - - - [] - ) - - ::= LIST('cade' ...) - - ::= perh() - - ::= chdt( - ... ) - - ::= cheh() - - ::= sbcn( ...) - - ::= ncsq( - ...) - - ::= spsh() - -*/ - -/* File io for DirectMusic Script object */ - -/* RIFF ids: */ - -#define DMUS_FOURCC_SCRIPT_FORM mmioFOURCC('D','M','S','C') -#define DMUS_FOURCC_SCRIPT_CHUNK mmioFOURCC('s','c','h','d') -#define DMUS_FOURCC_SCRIPTVERSION_CHUNK mmioFOURCC('s','c','v','e') -#define DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK mmioFOURCC('s','c','l','a') -#define DMUS_FOURCC_SCRIPTSOURCE_CHUNK mmioFOURCC('s','c','s','r') - -/* io structures:*/ - -typedef struct _DMUS_IO_SCRIPT_HEADER -{ - DWORD dwFlags; /* DMUS_SCRIPTIOF_ flags */ -} DMUS_IO_SCRIPT_HEADER; - -#define DMUS_SCRIPTIOF_LOAD_ALL_CONTENT (1 << 0) - /* If set, when the script loads it will also load all the content in its container. */ -#define DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS (1 << 1) - /* If set and LOAD_ALL_CONTENT is also set, when the script initializes it will also download all the segments in its container. - If set and LOAD_ALL_CONTENT is not set, when the script calls segment.Load on a segment then the segment will also be downloaded. - If not set, the script must manually download and unload by calling segment.DownloadSoundData and segment.UnloadSoundData. */ - -/* -RIFF -( - 'DMSC' // DirectMusic Script chunk - // Script header chunk - [] // GUID for script - [] // Optional version info - [] // Name, author, copyright info., comments - // Version of DirectMusic this script was authored to run against - // Container of content referenced by the script. - // ActiveX scripting language in which the script is written - or // The script's source code. - // If scsr-ck, the source is embedding in the chunk. - // If DMRF, it is a reference of where to find a text file with the source. - // Class id (guidClassID in DMUS_IO_REFERENCE) must be GUID_NULL because - // this text file is not a DirectMusic object in its own right. -) - - // - 'schd' - ( - - ) - - // - 'guid' - ( - - ) - - // - vers - ( - - ) - - // - scve - ( - - ) - - 'scla' - ( - // Language name, stored as NULL terminated string of WCHARs - ) - - 'scsr' - ( - // Source code, stored as NULL terminated string of WCHARs - ) -*/ - -/* Signpost tracks */ - -#define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC( 's', 'g', 'n', 'p' ) - - -typedef struct _DMUS_IO_SIGNPOST -{ - MUSIC_TIME mtTime; - DWORD dwChords; - WORD wMeasure; -} DMUS_IO_SIGNPOST; - -/* - - // - 'sgnp' - ( - //sizeof DMUS_IO_SIGNPOST: DWORD - ... - ) - -*/ - -#define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e') - -typedef struct _DMUS_IO_MUTE -{ - MUSIC_TIME mtTime; - DWORD dwPChannel; - DWORD dwPChannelMap; -} DMUS_IO_MUTE; - -/* - - // - 'mute' - ( - //sizeof DMUS_IO_MUTE:DWORD - ... - ) - - -*/ - -/* Used for both style and chord map tracks */ - -#define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s', 't', 'm', 'p') - -/* Style tracks */ - -#define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s', 't', 't', 'r') -#define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s', 't', 'r', 'f') - -/* - - // - LIST('sttr' - ( - ... // Array of Style references - ) - - // - LIST('strf' - ( - - - ) - - // - 'stmp' - ( - // time:DWORD - ) - -*/ - -/* Chord map tracks */ - -#define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p', 'f', 't', 'r') -#define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p', 'f', 'r', 'f') - -/* - - // - LIST('pftr' - ( - ... // Array of Chord map references - ) - - // - LIST('pfrf' - ( - - - ) - - // - 'stmp' - ( - // time:DWORD - ) - -*/ - -#define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r') - -/* - // tempo array - 'tetr' - ( - // sizeof DMUS_IO_TEMPO_ITEM: DWORD - ... - ) - */ - -#define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','e','q','t') -#define DMUS_FOURCC_SEQ_LIST mmioFOURCC('e','v','t','l') -#define DMUS_FOURCC_CURVE_LIST mmioFOURCC('c','u','r','l') - -/* - // sequence track - 'seqt' - ( - // sequence array - 'evtl' - ( - // sizeof DMUS_IO_SEQ_ITEM: DWORD - ... - ) - // curve array - 'curl' - ( - // sizeof DMUS_IO_CURVE_ITEM: DWORD - ... - ) - ) -*/ - -#define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','e','x') - -/* - // sysex track - 'syex' - ( - { - - ... // Array of bytes, length defined in the DMUS_IO_SYSEXITEM structure - }... - ) -*/ - -#define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s') - -typedef struct _DMUS_IO_TIMESIGNATURE_ITEM -{ - MUSIC_TIME lTime; - BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ - BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ - /* we can assume that 0 means 256th note */ - WORD wGridsPerBeat; /* grids per beat */ -} DMUS_IO_TIMESIGNATURE_ITEM; - -/* DX6 time signature track - - 'tims' - ( - // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD - ... - ) -*/ - -/* DX8 Time signature track. The track has been updated from DX7 to support a list of - RIFF chunks. This will allow the time signature track to expand in the future. -*/ - -#define DMUS_FOURCC_TIMESIGTRACK_LIST mmioFOURCC('T','I','M','S') -#define DMUS_FOURCC_TIMESIG_CHUNK DMUS_FOURCC_TIMESIGNATURE_TRACK - -/* -LIST -( - 'TIMS' // Time Signature Track list-type - // Chunk containing an array of time signatures -) - - 'tims' - ( - // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD - ... - ) - -*/ - -/* DX8 Marker track. This is used to store valid start points and other - flow control parameters that may come later. For example, if we want - to implement more sophisticated looping and branching constructs, they - would live in this track. -*/ - -#define DMUS_FOURCC_MARKERTRACK_LIST mmioFOURCC('M','A','R','K') -#define DMUS_FOURCC_VALIDSTART_CHUNK mmioFOURCC('v','a','l','s') -#define DMUS_FOURCC_PLAYMARKER_CHUNK mmioFOURCC('p','l','a','y') - -/* io structures */ -typedef struct _DMUS_IO_VALID_START -{ - MUSIC_TIME mtTime; /* Time of a legal start. */ -} DMUS_IO_VALID_START; - -typedef struct _DMUS_IO_PLAY_MARKER -{ - MUSIC_TIME mtTime; /* Time of a next legal play point marker. */ -} DMUS_IO_PLAY_MARKER; - -/* -LIST -( - 'MARK' // Marker Track list-type - [] // Chunk containing an array of start points - [] // Chunk containing an array of play start markers -) - - 'vals' - ( - // size of DMUS_IO_VALID_START : DWORD - ... - ) - - 'play' - ( - // size of DMUS_IO_PLAY_MARKER : DWORD - ... - ) - -*/ - -/* segment trigger tracks */ - -/* RIFF ids: */ -#define DMUS_FOURCC_SEGTRACK_LIST mmioFOURCC('s','e','g','t') -#define DMUS_FOURCC_SEGTRACK_CHUNK mmioFOURCC('s','g','t','h') -#define DMUS_FOURCC_SEGMENTS_LIST mmioFOURCC('l','s','g','l') -#define DMUS_FOURCC_SEGMENT_LIST mmioFOURCC('l','s','e','g') -#define DMUS_FOURCC_SEGMENTITEM_CHUNK mmioFOURCC('s','g','i','h') -#define DMUS_FOURCC_SEGMENTITEMNAME_CHUNK mmioFOURCC('s','n','a','m') - -/* io structures */ -typedef struct _DMUS_IO_SEGMENT_TRACK_HEADER -{ - DWORD dwFlags; /* Reserved leave as 0. */ -} DMUS_IO_SEGMENT_TRACK_HEADER; - -typedef struct _DMUS_IO_SEGMENT_ITEM_HEADER -{ - MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ - MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ - DWORD dwPlayFlags; /* Flags for PlaySegment(). */ - DWORD dwFlags; /* Flags. */ -} DMUS_IO_SEGMENT_ITEM_HEADER; - -/* values for dwflags field of DMUS_IO_SEGMENT_ITEM_HEADER */ -#define DMUS_SEGMENTTRACKF_MOTIF 1 /* interpret DMRF as link to style, and use snam as the name of a motif within the style */ - -/* -LIST -( - 'segt' // DirectMusic Segment Trigger Track form-type - [] // Segment track header - // List of Segment Lists -) - - // - 'sgth' - ( - - ) - - // - LIST - ( - 'lsgl' // Array of segments - ... // Each segment is encapsulated in a list (that way it can still be riff parsed.) - ) - - // - LIST - ( - 'lseg' - - // Link to a segment or style file. - [] // Name field. Used with DMUS_SEGMENTTRACKF_MOTIF flag. - ) - - // // segment item header - ( - // Segment item header - ) - - // - ( - // Name, stored as NULL terminated string of WCHARs - ) -*/ - -/* Script track. */ - -/* RIFF ids: */ -#define DMUS_FOURCC_SCRIPTTRACK_LIST mmioFOURCC('s','c','r','t') -#define DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST mmioFOURCC('s','c','r','l') -#define DMUS_FOURCC_SCRIPTTRACKEVENT_LIST mmioFOURCC('s','c','r','e') -#define DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK mmioFOURCC('s','c','r','h') -#define DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK mmioFOURCC('s','c','r','n') - -/* Flags for DMUS_IO_SCRIPTTRACK_TIMING - */ -#define DMUS_IO_SCRIPTTRACKF_PREPARE (1 << 0) /* Fire event in advance of time stamp, at Prepare time. This is the default because it leaves the script time to change the music happening at the target time. */ -#define DMUS_IO_SCRIPTTRACKF_QUEUE (1 << 1) /* Fire event just before time stamp, at Queue time. */ -#define DMUS_IO_SCRIPTTRACKF_ATTIME (1 << 2) /* Fire event right at the time stamp. */ - -typedef struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER -{ - DWORD dwFlags; /* various bits (see DMUS_IO_SCRIPTTRACKF_*) */ - MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ - MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ -} DMUS_IO_SCRIPTTRACK_EVENTHEADER; - -/* - // Script Track - - // - LIST - ( - // List of script events - ) - - // - LIST - ( - ... // Array of event descriptions - ) - - // - LIST - ( - // Event header chunk - - // Routine name - ) - - 'scrh' - ( - - ) - - 'scrn' - ( - // Name, stored as NULL terminated string of WCHARs - ) -*/ - -/* Lyrics/Notification track. */ - -/* RIFF ids: */ -#define DMUS_FOURCC_LYRICSTRACK_LIST mmioFOURCC('l','y','r','t') -#define DMUS_FOURCC_LYRICSTRACKEVENTS_LIST mmioFOURCC('l','y','r','l') -#define DMUS_FOURCC_LYRICSTRACKEVENT_LIST mmioFOURCC('l','y','r','e') -#define DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK mmioFOURCC('l','y','r','h') -#define DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK mmioFOURCC('l','y','r','n') - -typedef struct _DMUS_IO_LYRICSTRACK_EVENTHEADER -{ - DWORD dwFlags; /* Reserved leave as 0. */ - DWORD dwTimingFlags; /* Combination DMUS_PMSGF_TOOL_* flags. Determines the precise timing of when the notification happens. Invalid with the flag DMUS_PMSGF_REFTIME, DMUS_PMSGF_MUSICTIME, DMUS_PMSGF_TOOL_FLUSH, or DMUS_PMSGF_LOCKTOREFTIME. */ - MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ - MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ -} DMUS_IO_LYRICSTRACK_EVENTHEADER; - -/* - // Lyrics/Notification Track - - // - LIST - ( - // List of notification events - ) - - // - LIST - ( - ... // Array of event descriptions - ) - - // - LIST - ( - // Event header chunk - // Notification text - ) - - 'lyrh' - ( - - ) - - 'lyrn' - ( - // Name, stored as NULL terminated string of WCHARs - ) -*/ - -/* Parameter control track */ - -/* RIFF ids: */ -#define DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST mmioFOURCC('p','r','m','t') -#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST mmioFOURCC('p','r','o','l') -#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK mmioFOURCC('p','r','o','h') -#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST mmioFOURCC('p','r','p','l') -#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK mmioFOURCC('p','r','p','h') -#define DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK mmioFOURCC('p','r','c','c') - -typedef struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER -{ - DWORD dwFlags; /* Reserved. Must be zero. */ - GUID guidTimeFormat; /* Time format to set the object to. Must be GUID_TIME_REFERNCE or GUID_TIME_MUSIC from medparam.h. */ - /* Path for finding the object. These fields correspond to the first five parameters of IDirectMusicSegmentState::GetObjectInPath. */ - DWORD dwPChannel; - DWORD dwStage; - DWORD dwBuffer; - GUID guidObject; - DWORD dwIndex; -} DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER; - -typedef struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER -{ - DWORD dwFlags; /* Reserved. Must be zero. */ - DWORD dwIndex; /* Index number of the parameter on the object */ -} DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER; - -typedef struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO -{ - MUSIC_TIME mtStartTime; - MUSIC_TIME mtEndTime; - float fltStartValue; - float fltEndValue; - DWORD dwCurveType; /* One of the items from the MP_CURVE_TYPE enum in medparam.h */ - DWORD dwFlags; /* A combination of the MPF_ENVLP_* constants in medparam.h */ -} DMUS_IO_PARAMCONTROLTRACK_CURVEINFO; - -/* - // - LIST - ( - ... // one for each object - ) - - // - LIST - ( - // object header chunk - ... // one for each parameter - ) - - // - proh - ( - - ) - - // - LIST - ( - // parameter header chunk - // chunk containing an array of curves - ) - - // - prph - ( - - ) - - // - prcc - ( - // sizeof DMUS_IO_PARAMCONTROLTRACK_CURVEINFO:DWORD - ... // curves, sorted in order of mtTime - ) -*/ - -/* Melody formulation track */ -/* Note: Melody formulation file format is not supported in DX8. */ - -typedef DMUS_CONNECTION_RULE DMUS_IO_CONNECTION_RULE; /* defined in dmusici.h */ - -typedef DMUS_MELODY_FRAGMENT DMUS_IO_MELODY_FRAGMENT; /* defined in dmusici.h */ - -#define DMUS_FOURCC_MELODYFORM_TRACK_LIST mmioFOURCC( 'm', 'f', 'r', 'm' ) -#define DMUS_FOURCC_MELODYFORM_HEADER_CHUNK mmioFOURCC( 'm', 'l', 'f', 'h' ) -#define DMUS_FOURCC_MELODYFORM_BODY_CHUNK mmioFOURCC( 'm', 'l', 'f', 'b' ) - -typedef struct _DMUS_IO_MELFORM -{ - DWORD dwPlaymode; /* NOT CURRENTLY USED - MUST BE 0 */ -} DMUS_IO_MELFORM; - - -/* - // - LIST - ( - 'mfrm' - // Melody formulation header chunk - // Melody formulation body chunk - ) - - // - 'mlfb' - ( - - ) - - // - 'mlfb' - ( - //sizeof DMUS_IO_MELODY_FRAGMENT: DWORD - ... - ) - -*/ - -#if (DIRECTSOUND_VERSION >= 0x0800) - -/* DirectSoundBufferConfig FX Map */ - -/* RIFF ids: */ - -#define DMUS_FOURCC_DSBC_FORM mmioFOURCC('D','S','B','C') -#define DMUS_FOURCC_DSBD_CHUNK mmioFOURCC('d','s','b','d') -#define DMUS_FOURCC_BSID_CHUNK mmioFOURCC('b','s','i','d') -#define DMUS_FOURCC_DS3D_CHUNK mmioFOURCC('d','s','3','d') -#define DMUS_FOURCC_DSBC_LIST mmioFOURCC('f','x','l','s') -#define DMUS_FOURCC_DSFX_FORM mmioFOURCC('D','S','F','X') -#define DMUS_FOURCC_DSFX_CHUNK mmioFOURCC('f','x','h','r') -#define DMUS_FOURCC_DSFX_DATA mmioFOURCC('d','a','t','a') - -/* io structures */ - -typedef struct _DSOUND_IO_DSBUFFERDESC -{ - DWORD dwFlags; /* DirectSound buffer creation flags */ - WORD nChannels; /* No. of channels (rest of buffer format is determined by owning sink) */ - LONG lVolume; /* Initial pan; only used if CTRLVOLUME is specified */ - LONG lPan; /* Initial pan; only used if CTRLPAN is specified */ - DWORD dwReserved; /* Reserved - must be 0 */ -} DSOUND_IO_DSBUFFERDESC; - -typedef struct _DSOUND_IO_DSBUSID -{ - DWORD busid[1]; /* Array size determined from chunk size */ -} DSOUND_IO_DSBUSID; - -typedef struct _DSOUND_IO_3D -{ - GUID guid3DAlgorithm; /* GUID identifying the 3D algorithm to use (defined in dsound.h) */ - DS3DBUFFER ds3d; /* Initial 3D parameters */ -} DSOUND_IO_3D; - -typedef struct _DSOUND_IO_DXDMO_HEADER -{ - DWORD dwEffectFlags; /* Effect creation flags - equivalent to DSEFFECTDESC::dwFlags */ - GUID guidDSFXClass; /* GUID identifying the effect to use - corresponds to a COM CLSID */ - GUID guidReserved; /* Reserved - must be the null GUID */ - GUID guidSendBuffer; /* GUID identifying the buffer to send to if this is a send effect */ - DWORD dwReserved; /* Reserved - must be 0 */ -} DSOUND_IO_DXDMO_HEADER; - -typedef struct _DSOUND_IO_DXDMO_DATA -{ - DWORD data[1]; /* Array size determined by the DMO involved */ -} DSOUND_IO_DXDMO_DATA; - -/* -RIFF -( - 'DSBC' // DirectSoundBufferConfig chunk - [] // GUID identifier for this DirectSoundBufferConfig - [] // Optional version info - [] // Name, author, copyright info., comments - // DirectSound Buffer descriptor chunk - [] // Optional bus id array - [] // Optional 3d Parameters - [] // Optional list of FX descriptors -) - - // - 'guid' - ( - - ) - - // - 'vers' - ( - - ) - - // - 'dsbd' - ( - // Creation parameters and initial settings for the buffer - ) - - // - 'bsid' - ( - // The size of DSOUND_IO_DSBUSID is determined by the chunk size - ) - - // - 'ds3d' - ( - // Initial 3D buffer parameters: position, etc. - ) - - // - LIST - ( - 'fxls' // Array of DMO creation parameter blocks - ... // Each DMO is encapsulated in a RIFF chunk - ) - -// // DMOs can be embedded in a buffer configuration or stored as separate files -RIFF -( - 'DSFX' - // FX header chunk - [] // FX initial settings chunk -) - - // - 'fxhr' - ( - - ) - - // - 'data' - ( - // Opaque data block used by the DMO to load itself. - // For our standard included DMOs, this is simply the structure accepted by - // the DMO's SetAllParameters() method - e.g. struct DSFXChorus for Chorus. - ) -*/ - -#endif - -#ifdef __cplusplus -}; /* extern "C" */ -#endif - -#include - -#endif /* #ifndef _DMUSICF_ */ diff --git a/import/DirectX8/include/dmusici.h b/import/DirectX8/include/dmusici.h deleted file mode 100644 index c6bc37db9..000000000 --- a/import/DirectX8/include/dmusici.h +++ /dev/null @@ -1,1964 +0,0 @@ -/************************************************************************ -* * -* dmusici.h -- This module contains the API for the * -* DirectMusic performance layer * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -************************************************************************/ - -#ifndef _DMUSICI_ -#define _DMUSICI_ - -#include - -#define COM_NO_WINDOWS_H -#include - -#include -#include -/* plugin (track and tool) interfaces. This #include will eventually go away. */ -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef WORD TRANSITION_TYPE; -typedef __int64 REFERENCE_TIME; -typedef long MUSIC_TIME; - -#define MT_MIN 0x80000000 /* Minimum music time value. */ -#define MT_MAX 0x7FFFFFFF /* Maximum music time value. */ - -#define DMUS_PPQ 768 /* parts per quarter note */ - -interface IDirectMusicTrack; -interface IDirectMusicPerformance; -interface IDirectMusicPerformance8; -interface IDirectMusicTool; -interface IDirectMusicSegment; -interface IDirectMusicSegment8; -interface IDirectMusicSegmentState; -interface IDirectMusicSegmentState8; -interface IDirectMusicGraph; -interface IDirectMusicBuffer; -interface IDirectMusicInstrument; -interface IDirectMusicDownloadedInstrument; -interface IDirectMusicBand; -interface IDirectMusicChordMap; -interface IDirectMusicLoader; -interface IDirectMusicLoader8; -interface IDirectMusicScript; -interface IDirectMusicObject; -interface IDirectMusicStyle8; -interface IDirectMusicPatternTrack; -interface IDirectMusicContainer; -interface IDirectMusicTool8; -interface IDirectMusicTrack8; -interface IDirectMusicSong; -interface IDirectMusicAudioPath; -#ifndef __cplusplus -typedef interface IDirectMusicTrack IDirectMusicTrack; -typedef interface IDirectMusicPerformance IDirectMusicPerformance; -typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8; -typedef interface IDirectMusicTool IDirectMusicTool; -typedef interface IDirectMusicSegment IDirectMusicSegment; -typedef interface IDirectMusicSegment8 IDirectMusicSegment8; -typedef interface IDirectMusicSegmentState IDirectMusicSegmentState; -typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8; -typedef interface IDirectMusicGraph IDirectMusicGraph; -typedef interface IDirectMusicBuffer IDirectMusicBuffer; -typedef interface IDirectMusicInstrument IDirectMusicInstrument; -typedef interface IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument; -typedef interface IDirectMusicBand IDirectMusicBand; -typedef interface IDirectMusicChordMap IDirectMusicChordMap; -typedef interface IDirectMusicObject IDirectMusicObject; -typedef interface IDirectMusicLoader IDirectMusicLoader; -typedef interface IDirectMusicLoader8 IDirectMusicLoader8; -typedef interface IDirectMusicScript IDirectMusicScript; -typedef interface IDirectMusicStyle8 IDirectMusicStyle8; -typedef interface IDirectMusicPatternTrack IDirectMusicPatternTrack; -typedef interface IDirectMusicContainer IDirectMusicContainer; -typedef interface IDirectMusicTool8 IDirectMusicTool8; -typedef interface IDirectMusicTrack8 IDirectMusicTrack8; -typedef interface IDirectMusicSong IDirectMusicSong; -typedef interface IDirectMusicAudioPath IDirectMusicAudioPath; -#endif - -typedef enum enumDMUS_STYLET_TYPES -{ - DMUS_STYLET_PATTERN = 0, - DMUS_STYLET_MOTIF = 1, - DMUS_STYLET_FRAGMENT = 2, -} DMUS_STYLET_TYPES; - - -typedef enum enumDMUS_COMMANDT_TYPES -{ - DMUS_COMMANDT_GROOVE = 0, - DMUS_COMMANDT_FILL = 1, - DMUS_COMMANDT_INTRO = 2, - DMUS_COMMANDT_BREAK = 3, - DMUS_COMMANDT_END = 4, - DMUS_COMMANDT_ENDANDINTRO = 5 -} DMUS_COMMANDT_TYPES; - -typedef enum enumDMUS_SHAPET_TYPES -{ - DMUS_SHAPET_FALLING = 0, - DMUS_SHAPET_LEVEL = 1, - DMUS_SHAPET_LOOPABLE = 2, - DMUS_SHAPET_LOUD = 3, - DMUS_SHAPET_QUIET = 4, - DMUS_SHAPET_PEAKING = 5, - DMUS_SHAPET_RANDOM = 6, - DMUS_SHAPET_RISING = 7, - DMUS_SHAPET_SONG = 8 -} DMUS_SHAPET_TYPES; - -typedef enum enumDMUS_COMPOSEF_FLAGS -{ - DMUS_COMPOSEF_NONE = 0, - DMUS_COMPOSEF_ALIGN = 0x1, - DMUS_COMPOSEF_OVERLAP = 0x2, - DMUS_COMPOSEF_IMMEDIATE = 0x4, - DMUS_COMPOSEF_GRID = 0x8, - DMUS_COMPOSEF_BEAT = 0x10, - DMUS_COMPOSEF_MEASURE = 0x20, - DMUS_COMPOSEF_AFTERPREPARETIME = 0x40, - DMUS_COMPOSEF_VALID_START_BEAT = 0x80, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any beat. */ - DMUS_COMPOSEF_VALID_START_GRID = 0x100, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any grid. */ - DMUS_COMPOSEF_VALID_START_TICK = 0x200, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur any time. */ - DMUS_COMPOSEF_SEGMENTEND = 0x400, /* Play the transition at the end of the current segment. */ - DMUS_COMPOSEF_MARKER = 0x800, /* Play the transition at the next marker in the current segment. */ - DMUS_COMPOSEF_MODULATE = 0x1000, - DMUS_COMPOSEF_LONG = 0x2000, - DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x4000, /* play the entire transition pattern */ - DMUS_COMPOSEF_1BAR_TRANSITION = 0x8000, /* play one bar of the transition pattern */ - DMUS_COMPOSEF_ENTIRE_ADDITION = 0x10000, /* play the additional pattern in its entirety */ - DMUS_COMPOSEF_1BAR_ADDITION = 0x20000, /* play one bar of the additional pattern */ - DMUS_COMPOSEF_VALID_START_MEASURE = 0x40000, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any bar. */ - DMUS_COMPOSEF_DEFAULT = 0x80000, /* Use segment's default boundary */ - DMUS_COMPOSEF_NOINVALIDATE = 0x100000, /* Play without invalidating the currently playing segment(s) */ - DMUS_COMPOSEF_USE_AUDIOPATH = 0x200000, /* Uses the audio paths that are embedded in the segments */ - DMUS_COMPOSEF_INVALIDATE_PRI = 0x400000 /* Invalidate only the current primary seg state */ -} DMUS_COMPOSEF_FLAGS; - -#define DMUS_PMSG_PART \ - DWORD dwSize; \ - REFERENCE_TIME rtTime; /* real time (in 100 nanosecond increments) */ \ - MUSIC_TIME mtTime; /* music time */ \ - DWORD dwFlags; /* various bits (see DMUS_PMSGF_FLAGS enumeration) */ \ - DWORD dwPChannel; /* Performance Channel. The Performance can */ \ - /* use this to determine the port/channel. */ \ - DWORD dwVirtualTrackID; /* virtual track ID */ \ - IDirectMusicTool* pTool; /* tool interface pointer */ \ - IDirectMusicGraph* pGraph; /* tool graph interface pointer */ \ - DWORD dwType; /* PMSG type (see DMUS_PMSGT_TYPES defines) */ \ - DWORD dwVoiceID; /* unique voice id which allows synthesizers to */ \ - /* identify a specific event. For DirectX 6.0, */ \ - /* this field should always be 0. */ \ - DWORD dwGroupID; /* Track group id */ \ - IUnknown* punkUser; /* user com pointer, auto released upon PMSG free */ - -/* every DMUS_PMSG is based off of this structure. The Performance needs - to access these members consistently in every PMSG that goes through it. */ -typedef struct _DMUS_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - -} DMUS_PMSG; - -#define DMUS_PCHANNEL_BROADCAST_PERFORMANCE 0xFFFFFFFF /* PMsg is sent on all PChannels of the performance. */ -#define DMUS_PCHANNEL_BROADCAST_AUDIOPATH 0xFFFFFFFE /* PMsg is sent on all PChannels of the audio path. */ -#define DMUS_PCHANNEL_BROADCAST_SEGMENT 0xFFFFFFFD /* PMsg is sent on all PChannels of the segment. */ -#define DMUS_PCHANNEL_BROADCAST_GROUPS 0xFFFFFFFC /* A duplicate PMsg is for each Channels Groups in the performance. */ - -/* The DMUS_PATH constants are used in conjunction with GetObjectInPath to find a requested - interface at a particular stage in the audio path. -*/ -#define DMUS_PATH_SEGMENT 0x1000 /* Get the segment itself (from a segment state.) */ -#define DMUS_PATH_SEGMENT_TRACK 0x1100 /* Look in Track List of Segment. */ -#define DMUS_PATH_SEGMENT_GRAPH 0x1200 /* Get the segment's tool graph. */ -#define DMUS_PATH_SEGMENT_TOOL 0x1300 /* Look in Tool Graph of Segment. */ -#define DMUS_PATH_AUDIOPATH 0x2000 /* Get the audiopath itself (from a segment state.) */ -#define DMUS_PATH_AUDIOPATH_GRAPH 0x2200 /* Get the audiopath's tool graph. */ -#define DMUS_PATH_AUDIOPATH_TOOL 0x2300 /* Look in Tool Graph of Audio Path. */ -#define DMUS_PATH_PERFORMANCE 0x3000 /* Access the performance. */ -#define DMUS_PATH_PERFORMANCE_GRAPH 0x3200 /* Get the performance's tool graph. */ -#define DMUS_PATH_PERFORMANCE_TOOL 0x3300 /* Look in Tool Graph of Performance. */ -#define DMUS_PATH_PORT 0x4000 /* Access the synth. */ -#define DMUS_PATH_BUFFER 0x6000 /* Look in DirectSoundBuffer. */ -#define DMUS_PATH_BUFFER_DMO 0x6100 /* Access a DMO in the buffer. */ -#define DMUS_PATH_MIXIN_BUFFER 0x7000 /* Look in a global mixin buffer. */ -#define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100 /* Access a DMO in a global mixin buffer. */ -#define DMUS_PATH_PRIMARY_BUFFER 0x8000 /* Access the primary buffer. */ - -/* To ignore PChannels when calling GetObjectInPath(), use the DMUS_PCHANNEL_ALL constant. */ -#define DMUS_PCHANNEL_ALL 0xFFFFFFFB - -/* The DMUS_APATH types are used in conjunction with CreateStandardAudioPath to - build default path types. _SHARED_ means the same buffer is shared across multiple - instantiations of the audiopath type. _DYNAMIC_ means a unique buffer is created - every time. -*/ - -#define DMUS_APATH_SHARED_STEREOPLUSREVERB 1 /* A standard music set up with stereo outs and reverb. */ -#define DMUS_APATH_DYNAMIC_3D 6 /* An audio path with one dynamic bus from the synth feeding to a dynamic 3d buffer. Does not send to env reverb. */ -#define DMUS_APATH_DYNAMIC_MONO 7 /* An audio path with one dynamic bus from the synth feeding to a dynamic mono buffer. */ -#define DMUS_APATH_DYNAMIC_STEREO 8 /* An audio path with two dynamic buses from the synth feeding to a dynamic stereo buffer. */ - -typedef struct _DMUS_AUDIOPARAMS -{ - DWORD dwSize; /* Size of this structure. */ - BOOL fInitNow; /* If true, the sink and synth are created immediately and results returned in this structure. */ - DWORD dwValidData; /* Flags indicating which fields below are valid. */ - DWORD dwFeatures; /* Required DMUS_AUDIOF features. */ - DWORD dwVoices; /* Required number of voices. */ - DWORD dwSampleRate; /* Sample rate of synths and sink. */ - CLSID clsidDefaultSynth; /* Class ID of default synthesizer. */ -} DMUS_AUDIOPARAMS; - -/* dwFeatures flags. These indicate which features are required for the audio environment. */ -#define DMUS_AUDIOF_3D 0x1 /* Require 3D buffers. */ -#define DMUS_AUDIOF_ENVIRON 0x2 /* Require environmental modeling. */ -#define DMUS_AUDIOF_EAX 0x4 /* Require use of EAX effects. */ -#define DMUS_AUDIOF_DMOS 0x8 /* Require use of additional DMOs. */ -#define DMUS_AUDIOF_STREAMING 0x10 /* Require support for streaming waves. */ -#define DMUS_AUDIOF_BUFFERS 0x20 /* Require support for multiple buffers (all above cases need this.) */ -#define DMUS_AUDIOF_ALL 0x3F /* Requires everything. */ - -/* dwValidData flags. These indicate which fields in DMUS_AUDIOPARAMS have been filled in. If fInitNow is set, these also return what was allocated. */ -#define DMUS_AUDIOPARAMS_FEATURES 0x00000001 -#define DMUS_AUDIOPARAMS_VOICES 0x00000002 -#define DMUS_AUDIOPARAMS_SAMPLERATE 0x00000004 -#define DMUS_AUDIOPARAMS_DEFAULTSYNTH 0x00000008 - -/* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member */ -typedef enum enumDMUS_PMSGF_FLAGS -{ - DMUS_PMSGF_REFTIME = 1, /* if rtTime is valid */ - DMUS_PMSGF_MUSICTIME = 2, /* if mtTime is valid */ - DMUS_PMSGF_TOOL_IMMEDIATE = 4, /* if PMSG should be processed immediately */ - DMUS_PMSGF_TOOL_QUEUE = 8, /* if PMSG should be processed a little early, at Queue time */ - DMUS_PMSGF_TOOL_ATTIME = 0x10, /* if PMSG should be processed at the time stamp */ - DMUS_PMSGF_TOOL_FLUSH = 0x20, /* if PMSG is being flushed */ - DMUS_PMSGF_LOCKTOREFTIME = 0x40, /* if rtTime can not be overriden by a tempo change. */ - DMUS_PMSGF_DX8 = 0x80 /* if the message has DX8 or later extensions. */ - /* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the */ - /* DMUS_PMSG's dwFlags member. */ -} DMUS_PMSGF_FLAGS; - -/* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member */ -typedef enum enumDMUS_PMSGT_TYPES -{ - DMUS_PMSGT_MIDI = 0, /* MIDI short message */ - DMUS_PMSGT_NOTE = 1, /* Interactive Music Note */ - DMUS_PMSGT_SYSEX = 2, /* MIDI long message (system exclusive message) */ - DMUS_PMSGT_NOTIFICATION = 3, /* Notification message */ - DMUS_PMSGT_TEMPO = 4, /* Tempo message */ - DMUS_PMSGT_CURVE = 5, /* Control change / pitch bend, etc. curve */ - DMUS_PMSGT_TIMESIG = 6, /* Time signature */ - DMUS_PMSGT_PATCH = 7, /* Patch changes */ - DMUS_PMSGT_TRANSPOSE = 8, /* Transposition messages */ - DMUS_PMSGT_CHANNEL_PRIORITY = 9, /* Channel priority */ - DMUS_PMSGT_STOP = 10, /* Stop message */ - DMUS_PMSGT_DIRTY = 11, /* Tells Tools that cache GetParam() info to refresh */ - DMUS_PMSGT_WAVE = 12, /* Carries control information for playing a wave. */ - DMUS_PMSGT_LYRIC = 13, /* Lyric message from lyric track. */ - DMUS_PMSGT_SCRIPTLYRIC = 14, /* Lyric message sent by a script with the Trace function. */ - DMUS_PMSGT_USER = 255 /* User message */ -} DMUS_PMSGT_TYPES; - -/* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API */ -typedef enum enumDMUS_SEGF_FLAGS -{ - DMUS_SEGF_REFTIME = 1<<6, /* 0x40 Time parameter is in reference time */ - DMUS_SEGF_SECONDARY = 1<<7, /* 0x80 Secondary segment */ - DMUS_SEGF_QUEUE = 1<<8, /* 0x100 Queue at the end of the primary segment queue (primary only) */ - DMUS_SEGF_CONTROL = 1<<9, /* 0x200 Play as a control track (secondary segments only) */ - DMUS_SEGF_AFTERPREPARETIME = 1<<10, /* 0x400 Play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) */ - DMUS_SEGF_GRID = 1<<11, /* 0x800 Play on grid boundary */ - DMUS_SEGF_BEAT = 1<<12, /* 0x1000 Play on beat boundary */ - DMUS_SEGF_MEASURE = 1<<13, /* 0x2000 Play on measure boundary */ - DMUS_SEGF_DEFAULT = 1<<14, /* 0x4000 Use segment's default boundary */ - DMUS_SEGF_NOINVALIDATE = 1<<15, /* 0x8000 Play without invalidating the currently playing segment(s) */ - DMUS_SEGF_ALIGN = 1<<16, /* 0x10000 Align segment with requested boundary, but switch at first valid point */ - DMUS_SEGF_VALID_START_BEAT = 1<<17, /* 0x20000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any beat. */ - DMUS_SEGF_VALID_START_GRID = 1<<18, /* 0x40000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any grid. */ - DMUS_SEGF_VALID_START_TICK = 1<<19, /* 0x80000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur any time. */ - DMUS_SEGF_AUTOTRANSITION = 1<<20, /* 0x100000 Compose and play a transition segment, using either the transition template or transition embedded in song. */ - DMUS_SEGF_AFTERQUEUETIME = 1<<21, /* 0x200000 Make sure to play after the queue time. This is default for primary segments */ - DMUS_SEGF_AFTERLATENCYTIME = 1<<22, /* 0x400000 Make sure to play after the latency time. This is true for all segments, so this is a nop */ - DMUS_SEGF_SEGMENTEND = 1<<23, /* 0x800000 Play at the next end of segment. */ - DMUS_SEGF_MARKER = 1<<24, /* 0x1000000 Play at next marker in the primary segment. If there are no markers, default to any other resolution requests. */ - DMUS_SEGF_TIMESIG_ALWAYS = 1<<25, /* 0x2000000 Even if there is no primary segment, align start time with current time signature. */ - DMUS_SEGF_USE_AUDIOPATH = 1<<26, /* 0x4000000 Uses the audio path that is embedded in the segment or song. */ - DMUS_SEGF_VALID_START_MEASURE = 1<<27, /* 0x8000000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any bar. */ - DMUS_SEGF_INVALIDATE_PRI = 1<<28 /* 0x10000000 invalidate only the current primary seg state */ -} DMUS_SEGF_FLAGS; - -#define DMUS_SEG_REPEAT_INFINITE 0xFFFFFFFF /* For IDirectMusicSegment::SetRepeat*/ -#define DMUS_SEG_ALLTRACKS 0x80000000 /* For IDirectMusicSegment::SetParam() and SetTrackConfig() - selects all tracks instead on nth index. */ -#define DMUS_SEG_ANYTRACK 0x80000000 /* For IDirectMusicSegment::GetParam() - checks each track until it finds one that returns data (not DMUS_E_NOT_FOUND.) */ - - -/* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can */ -/* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values */ -/* are intentionally the same */ -typedef enum enumDMUS_TIME_RESOLVE_FLAGS -{ - DMUS_TIME_RESOLVE_AFTERPREPARETIME = DMUS_SEGF_AFTERPREPARETIME, - DMUS_TIME_RESOLVE_AFTERQUEUETIME = DMUS_SEGF_AFTERQUEUETIME, - DMUS_TIME_RESOLVE_AFTERLATENCYTIME = DMUS_SEGF_AFTERLATENCYTIME, - DMUS_TIME_RESOLVE_GRID = DMUS_SEGF_GRID, - DMUS_TIME_RESOLVE_BEAT = DMUS_SEGF_BEAT, - DMUS_TIME_RESOLVE_MEASURE = DMUS_SEGF_MEASURE, - DMUS_TIME_RESOLVE_MARKER = DMUS_SEGF_MARKER, - DMUS_TIME_RESOLVE_SEGMENTEND = DMUS_SEGF_SEGMENTEND, -} DMUS_TIME_RESOLVE_FLAGS; - -/* The following flags are sent inside the DMUS_CHORD_KEY.dwFlags parameter */ -typedef enum enumDMUS_CHORDKEYF_FLAGS -{ - DMUS_CHORDKEYF_SILENT = 1, /* is the chord silent? */ -} DMUS_CHORDKEYF_FLAGS; - -#define DMUS_MAXSUBCHORD 8 - -typedef struct _DMUS_SUBCHORD -{ - DWORD dwChordPattern; /* Notes in the subchord */ - DWORD dwScalePattern; /* Notes in the scale */ - DWORD dwInversionPoints; /* Where inversions can occur */ - DWORD dwLevels; /* Which levels are supported by this subchord */ - BYTE bChordRoot; /* Root of the subchord */ - BYTE bScaleRoot; /* Root of the scale */ -} DMUS_SUBCHORD; - -typedef struct _DMUS_CHORD_KEY -{ - WCHAR wszName[16]; /* Name of the chord */ - WORD wMeasure; /* Measure this falls on */ - BYTE bBeat; /* Beat this falls on */ - BYTE bSubChordCount; /* Number of chords in the list of subchords */ - DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; /* List of sub chords */ - DWORD dwScale; /* Scale underlying the entire chord */ - BYTE bKey; /* Key underlying the entire chord */ - BYTE bFlags; /* Miscelaneous flags */ -} DMUS_CHORD_KEY; - -/* DMUS_NOTE_PMSG */ -typedef struct _DMUS_NOTE_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - MUSIC_TIME mtDuration; /* duration */ - WORD wMusicValue; /* Description of note in chord and key. */ - WORD wMeasure; /* Measure in which this note occurs */ - short nOffset; /* Offset from grid at which this note occurs */ - BYTE bBeat; /* Beat (in measure) at which this note occurs */ - BYTE bGrid; /* Grid offset from beat at which this note occurs */ - BYTE bVelocity; /* Note velocity */ - BYTE bFlags; /* see DMUS_NOTEF_FLAGS */ - BYTE bTimeRange; /* Range to randomize time. */ - BYTE bDurRange; /* Range to randomize duration. */ - BYTE bVelRange; /* Range to randomize velocity. */ - BYTE bPlayModeFlags; /* Play mode */ - BYTE bSubChordLevel; /* Which subchord level this note uses. */ - BYTE bMidiValue; /* The MIDI note value, converted from wMusicValue */ - char cTranspose; /* Transposition to add to midi note value after converted from wMusicValue. */ -} DMUS_NOTE_PMSG; - -typedef enum enumDMUS_NOTEF_FLAGS -{ - DMUS_NOTEF_NOTEON = 1, /* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off */ - /* DX8 flags: */ - DMUS_NOTEF_NOINVALIDATE = 2, /* Don't invalidate this note off. */ - DMUS_NOTEF_NOINVALIDATE_INSCALE = 4,/* Don't invalidate if still within the scale. */ - DMUS_NOTEF_NOINVALIDATE_INCHORD = 8,/* Don't invalidate if still within the chord. */ - DMUS_NOTEF_REGENERATE = 0x10, /* Regenerate the note on an invalidate. */ -} DMUS_NOTEF_FLAGS; - -/* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue - into the appropriate bMidiValue. -*/ - -typedef enum enumDMUS_PLAYMODE_FLAGS -{ - DMUS_PLAYMODE_KEY_ROOT = 1, /* Transpose on top of the key root. */ - DMUS_PLAYMODE_CHORD_ROOT = 2, /* Transpose on top of the chord root. */ - DMUS_PLAYMODE_SCALE_INTERVALS = 4, /* Use scale intervals from scale pattern. */ - DMUS_PLAYMODE_CHORD_INTERVALS = 8, /* Use chord intervals from chord pattern. */ - DMUS_PLAYMODE_NONE = 16, /* No mode. Indicates the parent part's mode should be used. */ -} DMUS_PLAYMODE_FLAGS; - -/* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS - in various ways: -*/ - -/* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced - notes that should not be transposed by the chord or scale. -*/ -#define DMUS_PLAYMODE_FIXED 0 -/* In fixed to key, the musicvalue is again a fixed MIDI value, but it - is transposed on top of the key root. -*/ -#define DMUS_PLAYMODE_FIXEDTOKEY DMUS_PLAYMODE_KEY_ROOT -/* In fixed to chord, the musicvalue is also a fixed MIDI value, but it - is transposed on top of the chord root. -*/ -#define DMUS_PLAYMODE_FIXEDTOCHORD DMUS_PLAYMODE_CHORD_ROOT -/* In Pedalpoint, the key root is used and the notes only track the intervals in - the scale. The chord root and intervals are completely ignored. This is useful - for melodic lines that play relative to the key root. -*/ -#define DMUS_PLAYMODE_PEDALPOINT (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS) -/* In the Melodic mode, the chord root is used but the notes only track the intervals in - the scale. The key root and chord intervals are completely ignored. This is useful - for melodic lines that play relative to the chord root. -*/ -#define DMUS_PLAYMODE_MELODIC (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS) -/* Normal chord mode is the prevalent playback mode. - The notes track the intervals in the chord, which is based on the chord root. - If there is a scale component to the MusicValue, the additional intervals - are pulled from the scale and added. - If the chord does not have an interval to match the chord component of - the MusicValue, the note is silent. -*/ -#define DMUS_PLAYMODE_NORMALCHORD (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS) -/* If it is desirable to play a note that is above the top of the chord, the - always play mode (known as "purpleized" in a former life) finds a position - for the note by using intervals from the scale. Essentially, this mode is - a combination of the Normal and Melodic playback modes, where a failure - in Normal causes a second try in Melodic mode. -*/ -#define DMUS_PLAYMODE_ALWAYSPLAY (DMUS_PLAYMODE_MELODIC | DMUS_PLAYMODE_NORMALCHORD) - -/* These playmodes are new for dx8. */ -/* In PedalpointChord, the key root is used and the notes only track the intervals in - the chord. The chord root and scale intervals are completely ignored. This is useful - for chordal lines that play relative to the key root. -*/ -#define DMUS_PLAYMODE_PEDALPOINTCHORD (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS) - -/* For completeness, here's a mode that tries for pedalpointchord, but if it fails - uses scale intervals -*/ -#define DMUS_PLAYMODE_PEDALPOINTALWAYS (DMUS_PLAYMODE_PEDALPOINT | DMUS_PLAYMODE_PEDALPOINTCHORD) - - -/* Legacy names for modes... */ -#define DMUS_PLAYMODE_PURPLEIZED DMUS_PLAYMODE_ALWAYSPLAY -#define DMUS_PLAYMODE_SCALE_ROOT DMUS_PLAYMODE_KEY_ROOT -#define DMUS_PLAYMODE_FIXEDTOSCALE DMUS_PLAYMODE_FIXEDTOKEY - - -/* DMUS_MIDI_PMSG */ -typedef struct _DMUS_MIDI_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - BYTE bStatus; - BYTE bByte1; - BYTE bByte2; - BYTE bPad[1]; -} DMUS_MIDI_PMSG; - -/* DMUS_PATCH_PMSG */ -typedef struct _DMUS_PATCH_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - BYTE byInstrument; - BYTE byMSB; - BYTE byLSB; - BYTE byPad[1]; -} DMUS_PATCH_PMSG; - -/* DMUS_TRANSPOSE_PMSG */ -typedef struct _DMUS_TRANSPOSE_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - short nTranspose; - /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */ - WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/ -} DMUS_TRANSPOSE_PMSG; - -/* DMUS_CHANNEL_PRIORITY_PMSG */ -typedef struct _DMUS_CHANNEL_PRIORITY_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - DWORD dwChannelPriority; -} DMUS_CHANNEL_PRIORITY_PMSG; - -/* DMUS_TEMPO_PMSG */ -typedef struct _DMUS_TEMPO_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - double dblTempo; /* the tempo */ -} DMUS_TEMPO_PMSG; - -#define DMUS_TEMPO_MAX 1000 -#define DMUS_TEMPO_MIN 1 - -#define DMUS_MASTERTEMPO_MAX 100.0f -#define DMUS_MASTERTEMPO_MIN 0.01f - -/* DMUS_SYSEX_PMSG */ -typedef struct _DMUS_SYSEX_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - DWORD dwLen; /* length of the data */ - BYTE abData[1]; /* array of data, length equal to dwLen */ -} DMUS_SYSEX_PMSG; - -/* DMUS_CURVE_PMSG */ -typedef struct _DMUS_CURVE_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - MUSIC_TIME mtDuration; /* how long this curve lasts */ - MUSIC_TIME mtOriginalStart; /* must be set to either zero when this PMSG is created or to the original mtTime of the curve */ - MUSIC_TIME mtResetDuration; /* how long after the curve is finished to allow a flush or - invalidation to reset to the reset value, nResetValue */ - short nStartValue; /* curve's start value */ - short nEndValue; /* curve's end value */ - short nResetValue; /* curve's reset value, set when a flush or invalidation - occurs within mtDuration + mtResetDuration */ - WORD wMeasure; /* Measure in which this curve occurs */ - short nOffset; /* Offset from grid at which this curve occurs */ - BYTE bBeat; /* Beat (in measure) at which this curve occurs */ - BYTE bGrid; /* Grid offset from beat at which this curve occurs */ - BYTE bType; /* type of curve */ - BYTE bCurveShape; /* shape of curve */ - BYTE bCCData; /* CC# if this is a control change type */ - BYTE bFlags; /* Curve reset and start from current value flags. */ - /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */ - WORD wParamType; /* RPN or NRPN parameter number. */ - WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/ -} DMUS_CURVE_PMSG; - -typedef enum enumDMUS_CURVE_FLAGS -{ - DMUS_CURVE_RESET = 1, /* When set, the nResetValue must be sent when the - time is reached or an invalidate occurs because - of a transition. If not set, the curve stays - permanently stuck at the new value. */ - DMUS_CURVE_START_FROM_CURRENT = 2/* Ignore Start, start the curve at the current value. - This only works for volume, expression, and pitchbend. */ -} DMUS_CURVE_FLAGS; - - -#define DMUS_CURVE_RESET 1 - -/* Curve shapes */ -enum -{ - DMUS_CURVES_LINEAR = 0, - DMUS_CURVES_INSTANT = 1, - DMUS_CURVES_EXP = 2, - DMUS_CURVES_LOG = 3, - DMUS_CURVES_SINE = 4 -}; -/* curve types */ -#define DMUS_CURVET_PBCURVE 0x03 /* Pitch bend curve. */ -#define DMUS_CURVET_CCCURVE 0x04 /* Control change curve. */ -#define DMUS_CURVET_MATCURVE 0x05 /* Mono aftertouch curve. */ -#define DMUS_CURVET_PATCURVE 0x06 /* Poly aftertouch curve. */ -#define DMUS_CURVET_RPNCURVE 0x07 /* RPN curve with curve type in wParamType. */ -#define DMUS_CURVET_NRPNCURVE 0x08 /* NRPN curve with curve type in wParamType. */ - -/* DMUS_TIMESIG_PMSG */ -typedef struct _DMUS_TIMESIG_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - /* Time signatures define how many beats per measure, which note receives */ - /* the beat, and the grid resolution. */ - BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ - BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ - /* we can assume that 0 means 256th note */ - WORD wGridsPerBeat; /* grids per beat */ -} DMUS_TIMESIG_PMSG; - - - -/* notification type values */ -/* The following correspond to GUID_NOTIFICATION_SEGMENT */ -#define DMUS_NOTIFICATION_SEGSTART 0 -#define DMUS_NOTIFICATION_SEGEND 1 -#define DMUS_NOTIFICATION_SEGALMOSTEND 2 -#define DMUS_NOTIFICATION_SEGLOOP 3 -#define DMUS_NOTIFICATION_SEGABORT 4 -/* The following correspond to GUID_NOTIFICATION_PERFORMANCE */ -#define DMUS_NOTIFICATION_MUSICSTARTED 0 -#define DMUS_NOTIFICATION_MUSICSTOPPED 1 -#define DMUS_NOTIFICATION_MUSICALMOSTEND 2 -/* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT */ -#define DMUS_NOTIFICATION_MEASUREBEAT 0 -/* The following corresponds to GUID_NOTIFICATION_CHORD */ -#define DMUS_NOTIFICATION_CHORD 0 -/* The following correspond to GUID_NOTIFICATION_COMMAND */ -#define DMUS_NOTIFICATION_GROOVE 0 -#define DMUS_NOTIFICATION_EMBELLISHMENT 1 -/* The following corresponds to GUID_NOTIFICATION_RECOMPOSE */ -#define DMUS_NOTIFICATION_RECOMPOSE 0 - -/* DMUS_NOTIFICATION_PMSG */ -typedef struct _DMUS_NOTIFICATION_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - GUID guidNotificationType; - DWORD dwNotificationOption; - DWORD dwField1; - DWORD dwField2; -} DMUS_NOTIFICATION_PMSG; - -/* DMUS_WAVE_PMSG */ -typedef struct _DMUS_WAVE_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - REFERENCE_TIME rtStartOffset; /* How far into the wave to start, in reference time units only. */ - REFERENCE_TIME rtDuration; /* Duration of the wave, in either reference time or music time. */ - long lOffset; /* Offset from actual time to logical time, in music or ref time. */ - long lVolume; /* Initial volume, in 100ths of a dB. */ - long lPitch; /* Initial pitch, in 100ths of a semitone. */ - BYTE bFlags; /* Flags, including DMUS_WAVEF_OFF... */ -} DMUS_WAVE_PMSG; - -#define DMUS_WAVEF_OFF 1 /* If wave is playing and this is the off message. */ -#define DMUS_WAVEF_STREAMING 2 /* If wave is streaming. */ -#define DMUS_WAVEF_NOINVALIDATE 4 /* Don't invalidate this wave. */ -#define DMUS_WAVEF_NOPREROLL 8 /* Don't preroll any wave data. */ - -/* DMUS_LYRIC_PMSG */ -typedef struct _DMUS_LYRIC_PMSG -{ - /* begin DMUS_PMSG_PART */ - DMUS_PMSG_PART - /* end DMUS_PMSG_PART */ - - WCHAR wszString[1]; /* null-terminated Unicode lyric string (structure is actually larger than size 1) */ -} DMUS_LYRIC_PMSG; - -#define DMUS_MAX_NAME 64 /* Maximum object name length. */ -#define DMUS_MAX_CATEGORY 64 /* Maximum object category name length. */ -#define DMUS_MAX_FILENAME MAX_PATH - -typedef struct _DMUS_VERSION { - DWORD dwVersionMS; - DWORD dwVersionLS; -}DMUS_VERSION, FAR *LPDMUS_VERSION; - -/* Time Signature structure, used by IDirectMusicStyle */ -/* Also used as a parameter for GetParam() and SetParam */ -typedef struct _DMUS_TIMESIGNATURE -{ - MUSIC_TIME mtTime; - BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ - BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ - /* we can assume that 0 means 256th note */ - WORD wGridsPerBeat; /* grids per beat */ -} DMUS_TIMESIGNATURE; - -typedef struct _DMUS_VALID_START_PARAM -{ - MUSIC_TIME mtTime; /* Time of the first legal start - point after (or including) the requested time. - This is a returned value. - Time format is the relative offset from requested time. */ -} DMUS_VALID_START_PARAM; - -typedef struct _DMUS_PLAY_MARKER_PARAM -{ - MUSIC_TIME mtTime; /* Time of the first legal segment play - marker before (or including) the requested time. - This is a returned value. - Time format is the relative offset from requested time. */ -} DMUS_PLAY_MARKER_PARAM; - -/* The DMUSOBJECTDESC structure is used to communicate everything you could */ -/* possibly use to describe a DirectMusic object. */ - -typedef struct _DMUS_OBJECTDESC -{ - DWORD dwSize; /* Size of this structure. */ - DWORD dwValidData; /* Flags indicating which fields below are valid. */ - GUID guidObject; /* Unique ID for this object. */ - GUID guidClass; /* GUID for the class of object. */ - FILETIME ftDate; /* Last edited date of object. */ - DMUS_VERSION vVersion; /* Version. */ - WCHAR wszName[DMUS_MAX_NAME]; /* Name of object. */ - WCHAR wszCategory[DMUS_MAX_CATEGORY]; /* Category for object (optional). */ - WCHAR wszFileName[DMUS_MAX_FILENAME]; /* File path. */ - LONGLONG llMemLength; /* Size of Memory data. */ - LPBYTE pbMemData; /* Memory pointer for data. */ - IStream * pStream; /* Stream with data. */ -} DMUS_OBJECTDESC; - -typedef DMUS_OBJECTDESC *LPDMUS_OBJECTDESC; - -/* Flags for dwValidData. When set, a flag indicates that the */ -/* corresponding field in DMUSOBJECTDESC holds valid data. */ - -#define DMUS_OBJ_OBJECT (1 << 0) /* Object GUID is valid. */ -#define DMUS_OBJ_CLASS (1 << 1) /* Class GUID is valid. */ -#define DMUS_OBJ_NAME (1 << 2) /* Name is valid. */ -#define DMUS_OBJ_CATEGORY (1 << 3) /* Category is valid. */ -#define DMUS_OBJ_FILENAME (1 << 4) /* File path is valid. */ -#define DMUS_OBJ_FULLPATH (1 << 5) /* Path is full path. */ -#define DMUS_OBJ_URL (1 << 6) /* Path is URL. */ -#define DMUS_OBJ_VERSION (1 << 7) /* Version is valid. */ -#define DMUS_OBJ_DATE (1 << 8) /* Date is valid. */ -#define DMUS_OBJ_LOADED (1 << 9) /* Object is currently loaded in memory. */ -#define DMUS_OBJ_MEMORY (1 << 10) /* Object is pointed to by pbMemData. */ -#define DMUS_OBJ_STREAM (1 << 11) /* Object is stored in pStream. */ - -/* The DMUS_SCRIPT_ERRORINFO structure describes an error that occurred in a script. - It is returned by methods in IDirectMusicScript. */ -typedef struct _DMUS_SCRIPT_ERRORINFO -{ - DWORD dwSize; /* Size of this structure. */ - HRESULT hr; - ULONG ulLineNumber; - LONG ichCharPosition; - WCHAR wszSourceFile[DMUS_MAX_FILENAME]; - WCHAR wszSourceComponent[DMUS_MAX_FILENAME]; - WCHAR wszDescription[DMUS_MAX_FILENAME]; - WCHAR wszSourceLineText[DMUS_MAX_FILENAME]; -} DMUS_SCRIPT_ERRORINFO; - -/* Track configuration flags, used with IDirectMusicSegment8::SetTrackConfig() */ - -#define DMUS_TRACKCONFIG_OVERRIDE_ALL 1 /* This track should get parameters from this segment before controlling and primary tracks. */ -#define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY 2 /* This track should get parameters from this segment before the primary segment tracks. */ -#define DMUS_TRACKCONFIG_FALLBACK 4 /* This track should get parameters from this segment if the primary and controlling segments don't succeed. */ -#define DMUS_TRACKCONFIG_CONTROL_ENABLED 8 /* GetParam() enabled for this track. */ -#define DMUS_TRACKCONFIG_PLAY_ENABLED 0x10 /* Play() enabled for this track. */ -#define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x20 /* Notifications enabled for this track. */ -#define DMUS_TRACKCONFIG_PLAY_CLOCKTIME 0x40 /* This track plays in clock time, not music time. */ -#define DMUS_TRACKCONFIG_PLAY_COMPOSE 0x80 /* This track should regenerate data each time it starts playing. */ -#define DMUS_TRACKCONFIG_LOOP_COMPOSE 0x100 /* This track should regenerate data each time it repeats. */ -#define DMUS_TRACKCONFIG_COMPOSING 0x200 /* This track is used to compose other tracks. */ -#define DMUS_TRACKCONFIG_CONTROL_PLAY 0x10000 /* This track, when played in a controlling segment, overrides playback of primary segment tracks. */ -#define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION 0x20000 /* This track, when played in a controlling segment, overrides notification of primary segment tracks. */ -/* Additional track config flags for composing transitions */ -#define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART 0x400 /* Get track info from start of From segment */ -#define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT 0x800 /* Get track info from current place in From segment */ -#define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART 0x1000 /* Get track info from start of To segment */ -#define DMUS_TRACKCONFIG_DEFAULT (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED) - -/* #defines for melody fragments */ -/* Note: Melody formulation is not supported in DX8. */ - -#define DMUS_MAX_FRAGMENTLABEL 20 - -#define DMUS_FRAGMENTF_USE_REPEAT 0x1 -#define DMUS_FRAGMENTF_REJECT_REPEAT (0x1 << 1) -#define DMUS_FRAGMENTF_USE_LABEL (0x1 << 2) - -#define DMUS_CONNECTIONF_INTERVALS (0x1 << 1) /* Use transition intervals */ -#define DMUS_CONNECTIONF_OVERLAP (0x1 << 2) /* Use overlapping notes for transitions */ - -/* Get/SetParam structs for commands */ -/* PARAM structures, used by GetParam() and SetParam() */ -typedef struct _DMUS_COMMAND_PARAM -{ - BYTE bCommand; - BYTE bGrooveLevel; - BYTE bGrooveRange; - BYTE bRepeatMode; -} DMUS_COMMAND_PARAM; - -typedef struct _DMUS_COMMAND_PARAM_2 -{ - MUSIC_TIME mtTime; - BYTE bCommand; - BYTE bGrooveLevel; - BYTE bGrooveRange; - BYTE bRepeatMode; -} DMUS_COMMAND_PARAM_2; - -/* Get/SetParam structs for melody fragments */ -/* Note: Melody formulation is not supported in DX8. */ -typedef struct _DMUS_CONNECTION_RULE -{ - DWORD dwFlags; /* DMUS_CONNECTIONF_ flags */ - DWORD dwIntervals; /* Legal transition intervals (first 24 bits; two-octave range) */ -} DMUS_CONNECTION_RULE; - -typedef struct _DMUS_MELODY_FRAGMENT -{ - MUSIC_TIME mtTime; - DWORD dwID; /* This fragment's ID */ - WCHAR wszVariationLabel[DMUS_MAX_FRAGMENTLABEL]; /* Each style translates this into a set of variations (held in part ref) */ - DWORD dwVariationFlags; /* A set of variations */ - DWORD dwRepeatFragmentID; /* ID of a fragment to repeat */ - DWORD dwFragmentFlags; /* DMUS_FRAGMENTF_ flags */ - DWORD dwPlayModeFlags; /* NOT CURRENTLY USED - MUST BE 0 */ - DWORD dwTransposeIntervals; /* Legal transposition intervals (first 24 bits; two-octave range) */ - DMUS_COMMAND_PARAM Command; - DMUS_CONNECTION_RULE ConnectionArc; -} DMUS_MELODY_FRAGMENT; - -typedef IDirectMusicObject __RPC_FAR *LPDMUS_OBJECT; -typedef IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER; -typedef IDirectMusicBand __RPC_FAR *LPDMUS_BAND; - -#define DMUSB_LOADED (1 << 0) /* Set when band has been loaded */ -#define DMUSB_DEFAULT (1 << 1) /* Set when band is default band for a style */ - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicBand */ -#undef INTERFACE -#define INTERFACE IDirectMusicBand -DECLARE_INTERFACE_(IDirectMusicBand, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicBand */ - STDMETHOD(CreateSegment) (THIS_ IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(Download) (THIS_ IDirectMusicPerformance* pPerformance) PURE; - STDMETHOD(Unload) (THIS_ IDirectMusicPerformance* pPerformance) PURE; -}; - -typedef IDirectMusicBand IDirectMusicBand8; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicObject */ -#undef INTERFACE -#define INTERFACE IDirectMusicObject -DECLARE_INTERFACE_(IDirectMusicObject, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicObject */ - STDMETHOD(GetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; - STDMETHOD(SetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; - STDMETHOD(ParseDescriptor) (THIS_ LPSTREAM pStream, - LPDMUS_OBJECTDESC pDesc) PURE; -}; - -typedef IDirectMusicObject IDirectMusicObject8; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicLoader */ -#undef INTERFACE -#define INTERFACE IDirectMusicLoader -DECLARE_INTERFACE_(IDirectMusicLoader, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicLoader */ - STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc, - REFIID riid, - LPVOID FAR *ppv) PURE; - STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; - STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass, - WCHAR *pwzPath, - BOOL fClear) PURE; - STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass, - WCHAR *pwzFileExtension, - WCHAR *pwzScanFileName) PURE; - STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE; - STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE; - STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE; - STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass, - BOOL fEnable) PURE; - STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, - DWORD dwIndex, - LPDMUS_OBJECTDESC pDesc) PURE; -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicLoader8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicLoader8 -DECLARE_INTERFACE_(IDirectMusicLoader8, IDirectMusicLoader) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicLoader */ - STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc, - REFIID riid, - LPVOID FAR *ppv) PURE; - STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; - STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass, - WCHAR *pwzPath, - BOOL fClear) PURE; - STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass, - WCHAR *pwzFileExtension, - WCHAR *pwzScanFileName) PURE; - STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE; - STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE; - STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE; - STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass, - BOOL fEnable) PURE; - STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, - DWORD dwIndex, - LPDMUS_OBJECTDESC pDesc) PURE; - - /* IDirectMusicLoader8 */ - STDMETHOD_(void, CollectGarbage) (THIS) PURE; - STDMETHOD(ReleaseObjectByUnknown) (THIS_ IUnknown *pObject) PURE; - STDMETHOD(LoadObjectFromFile) (THIS_ REFGUID rguidClassID, - REFIID iidInterfaceID, - WCHAR *pwzFilePath, - void ** ppObject) PURE; -}; - -/* Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. */ - -#undef INTERFACE -#define INTERFACE IDirectMusicGetLoader -DECLARE_INTERFACE_(IDirectMusicGetLoader, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicGetLoader */ - STDMETHOD(GetLoader) (THIS_ IDirectMusicLoader ** ppLoader) PURE; -}; - -typedef IDirectMusicGetLoader IDirectMusicGetLoader8; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicSegment */ -#undef INTERFACE -#define INTERFACE IDirectMusicSegment -DECLARE_INTERFACE_(IDirectMusicSegment, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSegment */ - STDMETHOD(GetLength) (THIS_ MUSIC_TIME* pmtLength) PURE; - STDMETHOD(SetLength) (THIS_ MUSIC_TIME mtLength) PURE; - STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; - STDMETHOD(SetRepeats) (THIS_ DWORD dwRepeats) PURE; - STDMETHOD(GetDefaultResolution) (THIS_ DWORD* pdwResolution) PURE; - STDMETHOD(SetDefaultResolution) (THIS_ DWORD dwResolution) PURE; - STDMETHOD(GetTrack) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - IDirectMusicTrack** ppTrack) PURE; - STDMETHOD(GetTrackGroup) (THIS_ IDirectMusicTrack* pTrack, - DWORD* pdwGroupBits) PURE; - STDMETHOD(InsertTrack) (THIS_ IDirectMusicTrack* pTrack, - DWORD dwGroupBits) PURE; - STDMETHOD(RemoveTrack) (THIS_ IDirectMusicTrack* pTrack) PURE; - STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState** ppSegState, - IDirectMusicPerformance* pPerformance, - DWORD dwFlags) PURE; - STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; - STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(SetStartPoint) (THIS_ MUSIC_TIME mtStart) PURE; - STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; - STDMETHOD(SetLoopPoints) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd) PURE; - STDMETHOD(GetLoopPoints) (THIS_ MUSIC_TIME* pmtStart, - MUSIC_TIME* pmtEnd) PURE; - STDMETHOD(SetPChannelsUsed) (THIS_ DWORD dwNumPChannels, - DWORD* paPChannels) PURE; -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicSegment8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicSegment8 -DECLARE_INTERFACE_(IDirectMusicSegment8, IDirectMusicSegment) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSegment */ - STDMETHOD(GetLength) (THIS_ MUSIC_TIME* pmtLength) PURE; - STDMETHOD(SetLength) (THIS_ MUSIC_TIME mtLength) PURE; - STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; - STDMETHOD(SetRepeats) (THIS_ DWORD dwRepeats) PURE; - STDMETHOD(GetDefaultResolution) (THIS_ DWORD* pdwResolution) PURE; - STDMETHOD(SetDefaultResolution) (THIS_ DWORD dwResolution) PURE; - STDMETHOD(GetTrack) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - IDirectMusicTrack** ppTrack) PURE; - STDMETHOD(GetTrackGroup) (THIS_ IDirectMusicTrack* pTrack, - DWORD* pdwGroupBits) PURE; - STDMETHOD(InsertTrack) (THIS_ IDirectMusicTrack* pTrack, - DWORD dwGroupBits) PURE; - STDMETHOD(RemoveTrack) (THIS_ IDirectMusicTrack* pTrack) PURE; - STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState** ppSegState, - IDirectMusicPerformance* pPerformance, - DWORD dwFlags) PURE; - STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; - STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(SetStartPoint) (THIS_ MUSIC_TIME mtStart) PURE; - STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; - STDMETHOD(SetLoopPoints) (THIS_ MUSIC_TIME mtStart, - MUSIC_TIME mtEnd) PURE; - STDMETHOD(GetLoopPoints) (THIS_ MUSIC_TIME* pmtStart, - MUSIC_TIME* pmtEnd) PURE; - STDMETHOD(SetPChannelsUsed) (THIS_ DWORD dwNumPChannels, - DWORD* paPChannels) PURE; - /* IDirectMusicSegment8 */ - STDMETHOD(SetTrackConfig) (THIS_ REFGUID rguidTrackClassID, /* Class ID of the type of track on which to set the configuration flags. */ - DWORD dwGroupBits, /* Group bits. */ - DWORD dwIndex, /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */ - DWORD dwFlagsOn, /* DMUS_TRACKCONFIG_ flags to enable. */ - DWORD dwFlagsOff) PURE; /* DMUS_TRACKCONFIG_ flags to disable. */ - STDMETHOD(GetAudioPathConfig) (THIS_ IUnknown ** ppAudioPathConfig) PURE; - STDMETHOD(Compose) (THIS_ MUSIC_TIME mtTime, - IDirectMusicSegment* pFromSegment, - IDirectMusicSegment* pToSegment, - IDirectMusicSegment** ppComposedSegment) PURE; - STDMETHOD(Download) (THIS_ IUnknown *pAudioPath) PURE; - STDMETHOD(Unload) (THIS_ IUnknown *pAudioPath) PURE; -}; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicSegmentState */ -#undef INTERFACE -#define INTERFACE IDirectMusicSegmentState -DECLARE_INTERFACE_(IDirectMusicSegmentState, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSegmentState */ - STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; - STDMETHOD(GetSegment ) (THIS_ IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(GetStartTime) (THIS_ MUSIC_TIME* pmtStart) PURE; - STDMETHOD(GetSeek) (THIS_ MUSIC_TIME* pmtSeek) PURE; - STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; -}; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicSegmentState8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicSegmentState8 -DECLARE_INTERFACE_(IDirectMusicSegmentState8, IDirectMusicSegmentState) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSegmentState */ - STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; - STDMETHOD(GetSegment ) (THIS_ IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(GetStartTime) (THIS_ MUSIC_TIME* pmtStart) PURE; - STDMETHOD(GetSeek) (THIS_ MUSIC_TIME* pmtSeek) PURE; - STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; - - /* IDirectMusicSegmentState8 */ - STDMETHOD(SetTrackConfig) (THIS_ REFGUID rguidTrackClassID, /* Class ID of the type of track on which to set the configuration flags. */ - DWORD dwGroupBits, /* Group bits. */ - DWORD dwIndex, /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */ - DWORD dwFlagsOn, /* DMUS_TRACKCONFIG_ flags to enable. */ - DWORD dwFlagsOff) PURE; /* DMUS_TRACKCONFIG_ flags to disable. */ - STDMETHOD(GetObjectInPath) (THIS_ DWORD dwPChannel, /* PChannel to search. */ - DWORD dwStage, /* Which stage in the path. */ - DWORD dwBuffer, /* Which buffer to address, if more than one. */ - REFGUID guidObject, /* ClassID of object. */ - DWORD dwIndex, /* Which object of that class. */ - REFGUID iidInterface,/* Requested COM interface. */ - void ** ppObject) PURE; /* Pointer to interface. */ -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicAudioPath */ -#undef INTERFACE -#define INTERFACE IDirectMusicAudioPath -DECLARE_INTERFACE_(IDirectMusicAudioPath, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicAudioPath */ - STDMETHOD(GetObjectInPath) (THIS_ DWORD dwPChannel, /* PChannel to search. */ - DWORD dwStage, /* Which stage in the path. */ - DWORD dwBuffer, /* Which buffer to address, if more than one. */ - REFGUID guidObject, /* ClassID of object. */ - DWORD dwIndex, /* Which object of that class. */ - REFGUID iidInterface,/* Requested COM interface. */ - void ** ppObject) PURE; /* Pointer to interface. */ - STDMETHOD(Activate) (THIS_ BOOL fActivate) PURE;/* True to activate, False to deactivate. */ - STDMETHOD(SetVolume) (THIS_ long lVolume, /* Gain, in 100ths of a dB. This must be negative (0 represents full volume.) */ - DWORD dwDuration) PURE;/* Duration of volume ramp in milliseconds. Note that 0 is more efficient. */ - STDMETHOD(ConvertPChannel) (THIS_ DWORD dwPChannelIn, /* Pchannel of source. */ - DWORD *pdwPChannelOut) PURE; /* Equivalent pchannel on performance. */ -}; - -typedef IDirectMusicAudioPath IDirectMusicAudioPath8; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicPerformance */ -#undef INTERFACE -#define INTERFACE IDirectMusicPerformance -DECLARE_INTERFACE_(IDirectMusicPerformance, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicPerformance */ - STDMETHOD(Init) (THIS_ IDirectMusic** ppDirectMusic, - LPDIRECTSOUND pDirectSound, - HWND hWnd) PURE; - STDMETHOD(PlaySegment) (THIS_ IDirectMusicSegment* pSegment, - DWORD dwFlags, - __int64 i64StartTime, - IDirectMusicSegmentState** ppSegmentState) PURE; - STDMETHOD(Stop) (THIS_ IDirectMusicSegment* pSegment, - IDirectMusicSegmentState* pSegmentState, - MUSIC_TIME mtTime, - DWORD dwFlags) PURE; - STDMETHOD(GetSegmentState) (THIS_ IDirectMusicSegmentState** ppSegmentState, - MUSIC_TIME mtTime) PURE; - STDMETHOD(SetPrepareTime) (THIS_ DWORD dwMilliSeconds) PURE; - STDMETHOD(GetPrepareTime) (THIS_ DWORD* pdwMilliSeconds) PURE; - STDMETHOD(SetBumperLength) (THIS_ DWORD dwMilliSeconds) PURE; - STDMETHOD(GetBumperLength) (THIS_ DWORD* pdwMilliSeconds) PURE; - STDMETHOD(SendPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; - STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, - REFERENCE_TIME* prtTime) PURE; - STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, - MUSIC_TIME* pmtTime) PURE; - STDMETHOD(IsPlaying) (THIS_ IDirectMusicSegment* pSegment, - IDirectMusicSegmentState* pSegState) PURE; - STDMETHOD(GetTime) (THIS_ REFERENCE_TIME* prtNow, - MUSIC_TIME* pmtNow) PURE; - STDMETHOD(AllocPMsg) (THIS_ ULONG cb, - DMUS_PMSG** ppPMSG) PURE; - STDMETHOD(FreePMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; - STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; - STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, - REFERENCE_TIME rtMinimum) PURE; - STDMETHOD(GetNotificationPMsg) (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(AddPort) (THIS_ IDirectMusicPort* pPort) PURE; - STDMETHOD(RemovePort) (THIS_ IDirectMusicPort* pPort ) PURE; - STDMETHOD(AssignPChannelBlock) (THIS_ DWORD dwBlockNum, - IDirectMusicPort* pPort, - DWORD dwGroup ) PURE; - STDMETHOD(AssignPChannel) (THIS_ DWORD dwPChannel, - IDirectMusicPort* pPort, - DWORD dwGroup, - DWORD dwMChannel ) PURE; - STDMETHOD(PChannelInfo) (THIS_ DWORD dwPChannel, - IDirectMusicPort** ppPort, - DWORD* pdwGroup, - DWORD* pdwMChannel ) PURE; - STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument* pInst, - DWORD dwPChannel, - IDirectMusicDownloadedInstrument** ppDownInst, - DMUS_NOTERANGE* pNoteRanges, - DWORD dwNumNoteRanges, - IDirectMusicPort** ppPort, - DWORD* pdwGroup, - DWORD* pdwMChannel ) PURE; - STDMETHOD(Invalidate) (THIS_ MUSIC_TIME mtTime, - DWORD dwFlags) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(GetGlobalParam) (THIS_ REFGUID rguidType, - void* pParam, - DWORD dwSize) PURE; - STDMETHOD(SetGlobalParam) (THIS_ REFGUID rguidType, - void* pParam, - DWORD dwSize) PURE; - STDMETHOD(GetLatencyTime) (THIS_ REFERENCE_TIME* prtTime) PURE; - STDMETHOD(GetQueueTime) (THIS_ REFERENCE_TIME* prtTime) PURE; - STDMETHOD(AdjustTime) (THIS_ REFERENCE_TIME rtAmount) PURE; - STDMETHOD(CloseDown) (THIS) PURE; - STDMETHOD(GetResolvedTime) (THIS_ REFERENCE_TIME rtTime, - REFERENCE_TIME* prtResolved, - DWORD dwTimeResolveFlags) PURE; - STDMETHOD(MIDIToMusic) (THIS_ BYTE bMIDIValue, - DMUS_CHORD_KEY* pChord, - BYTE bPlayMode, - BYTE bChordLevel, - WORD *pwMusicValue) PURE; - STDMETHOD(MusicToMIDI) (THIS_ WORD wMusicValue, - DMUS_CHORD_KEY* pChord, - BYTE bPlayMode, - BYTE bChordLevel, - BYTE *pbMIDIValue) PURE; - STDMETHOD(TimeToRhythm) (THIS_ MUSIC_TIME mtTime, - DMUS_TIMESIGNATURE *pTimeSig, - WORD *pwMeasure, - BYTE *pbBeat, - BYTE *pbGrid, - short *pnOffset) PURE; - STDMETHOD(RhythmToTime) (THIS_ WORD wMeasure, - BYTE bBeat, - BYTE bGrid, - short nOffset, - DMUS_TIMESIGNATURE *pTimeSig, - MUSIC_TIME *pmtTime) PURE; -}; - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicPerformance8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicPerformance8 -DECLARE_INTERFACE_(IDirectMusicPerformance8, IDirectMusicPerformance) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicPerformance */ - STDMETHOD(Init) (THIS_ IDirectMusic** ppDirectMusic, - LPDIRECTSOUND pDirectSound, - HWND hWnd) PURE; - STDMETHOD(PlaySegment) (THIS_ IDirectMusicSegment* pSegment, - DWORD dwFlags, - __int64 i64StartTime, - IDirectMusicSegmentState** ppSegmentState) PURE; - STDMETHOD(Stop) (THIS_ IDirectMusicSegment* pSegment, - IDirectMusicSegmentState* pSegmentState, - MUSIC_TIME mtTime, - DWORD dwFlags) PURE; - STDMETHOD(GetSegmentState) (THIS_ IDirectMusicSegmentState** ppSegmentState, - MUSIC_TIME mtTime) PURE; - STDMETHOD(SetPrepareTime) (THIS_ DWORD dwMilliSeconds) PURE; - STDMETHOD(GetPrepareTime) (THIS_ DWORD* pdwMilliSeconds) PURE; - STDMETHOD(SetBumperLength) (THIS_ DWORD dwMilliSeconds) PURE; - STDMETHOD(GetBumperLength) (THIS_ DWORD* pdwMilliSeconds) PURE; - STDMETHOD(SendPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; - STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, - REFERENCE_TIME* prtTime) PURE; - STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, - MUSIC_TIME* pmtTime) PURE; - STDMETHOD(IsPlaying) (THIS_ IDirectMusicSegment* pSegment, - IDirectMusicSegmentState* pSegState) PURE; - STDMETHOD(GetTime) (THIS_ REFERENCE_TIME* prtNow, - MUSIC_TIME* pmtNow) PURE; - STDMETHOD(AllocPMsg) (THIS_ ULONG cb, - DMUS_PMSG** ppPMSG) PURE; - STDMETHOD(FreePMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; - STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; - STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; - STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, - REFERENCE_TIME rtMinimum) PURE; - STDMETHOD(GetNotificationPMsg) (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE; - STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; - STDMETHOD(AddPort) (THIS_ IDirectMusicPort* pPort) PURE; - STDMETHOD(RemovePort) (THIS_ IDirectMusicPort* pPort ) PURE; - STDMETHOD(AssignPChannelBlock) (THIS_ DWORD dwBlockNum, - IDirectMusicPort* pPort, - DWORD dwGroup ) PURE; - STDMETHOD(AssignPChannel) (THIS_ DWORD dwPChannel, - IDirectMusicPort* pPort, - DWORD dwGroup, - DWORD dwMChannel ) PURE; - STDMETHOD(PChannelInfo) (THIS_ DWORD dwPChannel, - IDirectMusicPort** ppPort, - DWORD* pdwGroup, - DWORD* pdwMChannel ) PURE; - STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument* pInst, - DWORD dwPChannel, - IDirectMusicDownloadedInstrument** ppDownInst, - DMUS_NOTERANGE* pNoteRanges, - DWORD dwNumNoteRanges, - IDirectMusicPort** ppPort, - DWORD* pdwGroup, - DWORD* pdwMChannel ) PURE; - STDMETHOD(Invalidate) (THIS_ MUSIC_TIME mtTime, - DWORD dwFlags) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(SetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - void* pParam) PURE; - STDMETHOD(GetGlobalParam) (THIS_ REFGUID rguidType, - void* pParam, - DWORD dwSize) PURE; - STDMETHOD(SetGlobalParam) (THIS_ REFGUID rguidType, - void* pParam, - DWORD dwSize) PURE; - STDMETHOD(GetLatencyTime) (THIS_ REFERENCE_TIME* prtTime) PURE; - STDMETHOD(GetQueueTime) (THIS_ REFERENCE_TIME* prtTime) PURE; - STDMETHOD(AdjustTime) (THIS_ REFERENCE_TIME rtAmount) PURE; - STDMETHOD(CloseDown) (THIS) PURE; - STDMETHOD(GetResolvedTime) (THIS_ REFERENCE_TIME rtTime, - REFERENCE_TIME* prtResolved, - DWORD dwTimeResolveFlags) PURE; - STDMETHOD(MIDIToMusic) (THIS_ BYTE bMIDIValue, - DMUS_CHORD_KEY* pChord, - BYTE bPlayMode, - BYTE bChordLevel, - WORD *pwMusicValue) PURE; - STDMETHOD(MusicToMIDI) (THIS_ WORD wMusicValue, - DMUS_CHORD_KEY* pChord, - BYTE bPlayMode, - BYTE bChordLevel, - BYTE *pbMIDIValue) PURE; - STDMETHOD(TimeToRhythm) (THIS_ MUSIC_TIME mtTime, - DMUS_TIMESIGNATURE *pTimeSig, - WORD *pwMeasure, - BYTE *pbBeat, - BYTE *pbGrid, - short *pnOffset) PURE; - STDMETHOD(RhythmToTime) (THIS_ WORD wMeasure, - BYTE bBeat, - BYTE bGrid, - short nOffset, - DMUS_TIMESIGNATURE *pTimeSig, - MUSIC_TIME *pmtTime) PURE; - /* IDirectMusicPerformance8 */ - STDMETHOD(InitAudio) (THIS_ IDirectMusic** ppDirectMusic, /* Optional DMusic pointer. */ - IDirectSound** ppDirectSound, /* Optional DSound pointer. */ - HWND hWnd, /* HWND for DSound. */ - DWORD dwDefaultPathType, /* Requested default audio path type, also optional. */ - DWORD dwPChannelCount, /* Number of PChannels, if default audio path to be created. */ - DWORD dwFlags, /* DMUS_AUDIOF flags, if no pParams structure. */ - DMUS_AUDIOPARAMS *pParams) PURE; /* Optional initialization structure, defining required voices, buffers, etc. */ - STDMETHOD(PlaySegmentEx) (THIS_ IUnknown* pSource, /* Segment to play. Alternately, could be an IDirectMusicSong (not supported in DX8.) */ - WCHAR *pwzSegmentName, /* If song, which segment in the song (not supported in DX8.) */ - IUnknown* pTransition, /* Optional template segment to compose transition with. */ - DWORD dwFlags, /* DMUS_SEGF_ flags. */ - __int64 i64StartTime, /* Time to start playback. */ - IDirectMusicSegmentState** ppSegmentState, /* Returned Segment State. */ - IUnknown *pFrom, /* Optional segmentstate or audiopath to replace. */ - IUnknown *pAudioPath) PURE; /* Optional audioPath to play on. */ - STDMETHOD(StopEx) (THIS_ IUnknown *pObjectToStop, /* Segstate, AudioPath, Segment, or Song. */ - __int64 i64StopTime, - DWORD dwFlags) PURE; - STDMETHOD(ClonePMsg) (THIS_ DMUS_PMSG* pSourcePMSG, - DMUS_PMSG** ppCopyPMSG) PURE; - STDMETHOD(CreateAudioPath) (THIS_ IUnknown *pSourceConfig, /* Source configuration, from AudioPathConfig file. */ - BOOL fActivate, /* TRUE to activate on creation. */ - IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */ - STDMETHOD(CreateStandardAudioPath)(THIS_ DWORD dwType, /* Type of path to create. */ - DWORD dwPChannelCount, /* How many PChannels to allocate for it. */ - BOOL fActivate, /* TRUE to activate on creation. */ - IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */ - STDMETHOD(SetDefaultAudioPath) (THIS_ IDirectMusicAudioPath *pAudioPath) PURE; - STDMETHOD(GetDefaultAudioPath) (THIS_ IDirectMusicAudioPath **ppAudioPath) PURE; - STDMETHOD(GetParamEx) (THIS_ REFGUID rguidType, /* GetParam command ID. */ - DWORD dwTrackID, /* Virtual track ID of caller. */ - DWORD dwGroupBits, /* Group bits of caller. */ - DWORD dwIndex, /* Index to Nth parameter. */ - MUSIC_TIME mtTime, /* Time of requested parameter. */ - MUSIC_TIME* pmtNext, /* Returned delta to next parameter. */ - void* pParam) PURE; /* Data structure to fill with parameter. */ -}; - - - -/*//////////////////////////////////////////////////////////////////// -// IDirectMusicGraph */ -#undef INTERFACE -#define INTERFACE IDirectMusicGraph -DECLARE_INTERFACE_(IDirectMusicGraph, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicGraph */ - STDMETHOD(StampPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; - STDMETHOD(InsertTool) (THIS_ IDirectMusicTool* pTool, - DWORD* pdwPChannels, - DWORD cPChannels, - LONG lIndex) PURE; - STDMETHOD(GetTool) (THIS_ DWORD dwIndex, - IDirectMusicTool** ppTool) PURE; - STDMETHOD(RemoveTool) (THIS_ IDirectMusicTool* pTool) PURE; -}; - -typedef IDirectMusicGraph IDirectMusicGraph8; - - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicStyle */ -#undef INTERFACE -#define INTERFACE IDirectMusicStyle -DECLARE_INTERFACE_(IDirectMusicStyle, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicStyle */ - STDMETHOD(GetBand) (THIS_ WCHAR* pwszName, - IDirectMusicBand** ppBand) PURE; - STDMETHOD(EnumBand) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; - STDMETHOD(GetDefaultBand) (THIS_ IDirectMusicBand** ppBand) PURE; - STDMETHOD(EnumMotif) (THIS_ DWORD dwIndex, - WCHAR* pwszName) PURE; - STDMETHOD(GetMotif) (THIS_ WCHAR* pwszName, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(GetDefaultChordMap) (THIS_ IDirectMusicChordMap** ppChordMap) PURE; - STDMETHOD(EnumChordMap) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; - STDMETHOD(GetChordMap) (THIS_ WCHAR* pwszName, - IDirectMusicChordMap** ppChordMap) PURE; - STDMETHOD(GetTimeSignature) (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE; - STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, - DWORD dwLevel, - DWORD* pdwMin, - DWORD* pdwMax) PURE; - STDMETHOD(GetTempo) (THIS_ double* pTempo) PURE; -}; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicStyle8 */ -#undef INTERFACE -#define INTERFACE IDirectMusicStyle8 -DECLARE_INTERFACE_(IDirectMusicStyle8, IDirectMusicStyle) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicStyle */ - STDMETHOD(GetBand) (THIS_ WCHAR* pwszName, - IDirectMusicBand** ppBand) PURE; - STDMETHOD(EnumBand) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; - STDMETHOD(GetDefaultBand) (THIS_ IDirectMusicBand** ppBand) PURE; - STDMETHOD(EnumMotif) (THIS_ DWORD dwIndex, - WCHAR* pwszName) PURE; - STDMETHOD(GetMotif) (THIS_ WCHAR* pwszName, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(GetDefaultChordMap) (THIS_ IDirectMusicChordMap** ppChordMap) PURE; - STDMETHOD(EnumChordMap) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; - STDMETHOD(GetChordMap) (THIS_ WCHAR* pwszName, - IDirectMusicChordMap** ppChordMap) PURE; - STDMETHOD(GetTimeSignature) (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE; - STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, - DWORD dwLevel, - DWORD* pdwMin, - DWORD* pdwMax) PURE; - STDMETHOD(GetTempo) (THIS_ double* pTempo) PURE; - - /* IDirectMusicStyle8 */ - STDMETHOD(EnumPattern) (THIS_ DWORD dwIndex, - DWORD dwPatternType, - WCHAR* pwszName) PURE; -}; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicChordMap */ -#undef INTERFACE -#define INTERFACE IDirectMusicChordMap -DECLARE_INTERFACE_(IDirectMusicChordMap, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicChordMap */ - STDMETHOD(GetScale) (THIS_ DWORD* pdwScale) PURE; -}; - -typedef IDirectMusicChordMap IDirectMusicChordMap8; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicComposer */ -#undef INTERFACE -#define INTERFACE IDirectMusicComposer -DECLARE_INTERFACE_(IDirectMusicComposer, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicComposer */ - STDMETHOD(ComposeSegmentFromTemplate) (THIS_ IDirectMusicStyle* pStyle, - IDirectMusicSegment* pTemplate, - WORD wActivity, - IDirectMusicChordMap* pChordMap, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(ComposeSegmentFromShape) (THIS_ IDirectMusicStyle* pStyle, - WORD wNumMeasures, - WORD wShape, - WORD wActivity, - BOOL fIntro, - BOOL fEnd, - IDirectMusicChordMap* pChordMap, - IDirectMusicSegment** ppSegment ) PURE; - STDMETHOD(ComposeTransition) (THIS_ IDirectMusicSegment* pFromSeg, - IDirectMusicSegment* pToSeg, - MUSIC_TIME mtTime, - WORD wCommand, - DWORD dwFlags, - IDirectMusicChordMap* pChordMap, - IDirectMusicSegment** ppTransSeg) PURE; - STDMETHOD(AutoTransition) (THIS_ IDirectMusicPerformance* pPerformance, - IDirectMusicSegment* pToSeg, - WORD wCommand, - DWORD dwFlags, - IDirectMusicChordMap* pChordMap, - IDirectMusicSegment** ppTransSeg, - IDirectMusicSegmentState** ppToSegState, - IDirectMusicSegmentState** ppTransSegState) PURE; - STDMETHOD(ComposeTemplateFromShape) (THIS_ WORD wNumMeasures, - WORD wShape, - BOOL fIntro, - BOOL fEnd, - WORD wEndLength, - IDirectMusicSegment** ppTemplate) PURE; - STDMETHOD(ChangeChordMap) (THIS_ IDirectMusicSegment* pSegment, - BOOL fTrackScale, - IDirectMusicChordMap* pChordMap) PURE; -}; - -typedef IDirectMusicComposer IDirectMusicComposer8; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicPatternTrack */ - -#undef INTERFACE -#define INTERFACE IDirectMusicPatternTrack -DECLARE_INTERFACE_(IDirectMusicPatternTrack, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicPatternTrack */ - STDMETHOD(CreateSegment) (THIS_ IDirectMusicStyle* pStyle, - IDirectMusicSegment** ppSegment) PURE; - STDMETHOD(SetVariation) (THIS_ IDirectMusicSegmentState* pSegState, - DWORD dwVariationFlags, - DWORD dwPart) PURE; - STDMETHOD(SetPatternByName) (THIS_ IDirectMusicSegmentState* pSegState, - WCHAR* wszName, - IDirectMusicStyle* pStyle, - DWORD dwPatternType, - DWORD* pdwLength) PURE; -}; - -typedef IDirectMusicPatternTrack IDirectMusicPatternTrack8; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicScript */ - -#undef INTERFACE -#define INTERFACE IDirectMusicScript -DECLARE_INTERFACE_(IDirectMusicScript, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicScript */ - STDMETHOD(Init) (THIS_ IDirectMusicPerformance *pPerformance, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(CallRoutine) (THIS_ WCHAR *pwszRoutineName, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(SetVariableVariant) (THIS_ WCHAR *pwszVariableName, - VARIANT varValue, - BOOL fSetRef, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(GetVariableVariant) (THIS_ WCHAR *pwszVariableName, - VARIANT *pvarValue, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(SetVariableNumber) (THIS_ WCHAR *pwszVariableName, - LONG lValue, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(GetVariableNumber) (THIS_ WCHAR *pwszVariableName, - LONG *plValue, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(SetVariableObject) (THIS_ WCHAR *pwszVariableName, - IUnknown *punkValue, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(GetVariableObject) (THIS_ WCHAR *pwszVariableName, - REFIID riid, - LPVOID FAR *ppv, - DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; - STDMETHOD(EnumRoutine) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; - STDMETHOD(EnumVariable) (THIS_ DWORD dwIndex, - WCHAR *pwszName) PURE; -}; - -typedef IDirectMusicScript IDirectMusicScript8; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicContainer */ - -#undef INTERFACE -#define INTERFACE IDirectMusicContainer -DECLARE_INTERFACE_(IDirectMusicContainer, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicContainer */ - STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, - DWORD dwIndex, - LPDMUS_OBJECTDESC pDesc, - WCHAR *pwszAlias) PURE; -}; - -typedef IDirectMusicContainer IDirectMusicContainer8; - -/*///////////////////////////////////////////////////////////////////// -// IDirectMusicSong */ -/* Note: Songs are not supported in DX8. */ - -#undef INTERFACE -#define INTERFACE IDirectMusicSong -DECLARE_INTERFACE_(IDirectMusicSong, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSong */ - STDMETHOD(Compose) (THIS) PURE; - STDMETHOD(GetParam) (THIS_ REFGUID rguidType, - DWORD dwGroupBits, - DWORD dwIndex, - MUSIC_TIME mtTime, - MUSIC_TIME* pmtNext, - void* pParam) PURE; - STDMETHOD(GetSegment) (THIS_ WCHAR *pwzName, /* Retrieve a specific segment by name. */ - IDirectMusicSegment **ppSegment) PURE; /* Returned segment. */ - STDMETHOD(GetAudioPathConfig) (THIS_ IUnknown ** ppAudioPathConfig) PURE; /* Retrieve embedded audiopath configuration. */ - STDMETHOD(Download) (THIS_ IUnknown *pAudioPath) PURE; /* Download entire song to ports on performance or audiopath. */ - STDMETHOD(Unload) (THIS_ IUnknown *pAudioPath) PURE; /* Unload entire song from port on performance or audiopath. */ - STDMETHOD(EnumSegment) (THIS_ DWORD dwIndex, /* Nth segment to retrieve. */ - IDirectMusicSegment **ppSegment) PURE; /* Pointer to segment. */ -}; - -typedef IDirectMusicSong IDirectMusicSong8; - -/* CLSID's */ -DEFINE_GUID(CLSID_DirectMusicPerformance,0xd2ac2881, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicSegment,0xd2ac2882, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicSegmentState,0xd2ac2883, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicGraph,0xd2ac2884, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicStyle,0xd2ac288a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicChordMap,0xd2ac288f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicComposer,0xd2ac2890, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicLoader,0xd2ac2892, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicBand,0x79ba9e00, 0xb6ee, 0x11d1, 0x86, 0xbe, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef); - -/* New CLSID's for DX8 */ -DEFINE_GUID(CLSID_DirectMusicPatternTrack,0xd2ac2897, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(CLSID_DirectMusicScript,0x810b5013, 0xe88d, 0x11d2, 0x8b, 0xc1, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {810B5013-E88D-11d2-8BC1-00600893B1B6} */ -DEFINE_GUID(CLSID_DirectMusicContainer,0x9301e380, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47); -DEFINE_GUID(CLSID_DirectSoundWave,0x8a667154, 0xf9cb, 0x11d2, 0xad, 0x8a, 0x0, 0x60, 0xb0, 0x57, 0x5a, 0xbc); -/* Note: Songs are not supported in DX8. */ -DEFINE_GUID(CLSID_DirectMusicSong, 0xaed5f0a5, 0xd972, 0x483d, 0xa3, 0x84, 0x64, 0x9d, 0xfe, 0xb9, 0xc1, 0x81); -DEFINE_GUID(CLSID_DirectMusicAudioPathConfig,0xee0b9ca0, 0xa81e, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); - -/* Special GUID for all object types. This is used by the loader. */ -DEFINE_GUID(GUID_DirectMusicAllTypes,0xd2ac2893, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Notification guids */ -DEFINE_GUID(GUID_NOTIFICATION_SEGMENT,0xd2ac2899, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE,0x81f75bc5, 0x4e5d, 0x11d2, 0xbc, 0xc7, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT,0xd2ac289a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_NOTIFICATION_CHORD,0xd2ac289b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_NOTIFICATION_COMMAND,0xd2ac289c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_NOTIFICATION_RECOMPOSE, 0xd348372b, 0x945b, 0x45ae, 0xa5, 0x22, 0x45, 0xf, 0x12, 0x5b, 0x84, 0xa5); - -/* Track param type guids */ -/* Use to get/set a DMUS_COMMAND_PARAM param in the Command track */ -DEFINE_GUID(GUID_CommandParam,0xd2ac289d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track */ -DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7, 0x9538, 0x11d2, 0x97, 0xa9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); - -/* Use to get/set a DMUS_COMMAND_PARAM_2 param to be used as the command following all commands in -the Command track (this information can't be saved) */ -DEFINE_GUID(GUID_CommandParamNext, 0x472afe7a, 0x281b, 0x11d3, 0x81, 0x7d, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); - -/* Use to get/set a DMUS_CHORD_PARAM param in the Chord track */ -DEFINE_GUID(GUID_ChordParam,0xd2ac289e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get a DMUS_RHYTHM_PARAM param in the Chord track */ -DEFINE_GUID(GUID_RhythmParam,0xd2ac289f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get/set an IDirectMusicStyle param in the Style track */ -DEFINE_GUID(GUID_IDirectMusicStyle,0xd2ac28a1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks */ -DEFINE_GUID(GUID_TimeSignature,0xd2ac28a4, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track */ -DEFINE_GUID(GUID_TempoParam,0xd2ac28a5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get the next valid point in a segment at which it may start */ -DEFINE_GUID(GUID_Valid_Start_Time,0x7f6b1760, 0x1fdb, 0x11d3, 0x82, 0x26, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); - -/* Use to get the next point in the currently playing primary segment at which a new segment may start */ -DEFINE_GUID(GUID_Play_Marker,0xd8761a41, 0x801a, 0x11d3, 0x9b, 0xd1, 0xda, 0xf7, 0xe1, 0xc3, 0xd8, 0x34); - -/* Use to get (GetParam) or add (SetParam) bands in the Band track */ -DEFINE_GUID(GUID_BandParam,0x2bb1938, 0xcb8b, 0x11d2, 0x8b, 0xb9, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); -typedef struct _DMUS_BAND_PARAM -{ - MUSIC_TIME mtTimePhysical; /* Note: If this is a clock-time track, then this field is interpreted in the track's internal time format, which is the number of milliseconds after the beginning of playback. */ - IDirectMusicBand *pBand; -} DMUS_BAND_PARAM; - -/* Obsolete -- doesn't distinguish physical and logical time. Use GUID_BandParam instead. */ -DEFINE_GUID(GUID_IDirectMusicBand,0xd2ac28ac, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get/set an IDirectMusicChordMap param in the ChordMap track */ -DEFINE_GUID(GUID_IDirectMusicChordMap,0xd2ac28ad, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Use to get/set a DMUS_MUTE_PARAM param in the Mute track */ -DEFINE_GUID(GUID_MuteParam,0xd2ac28af, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions. - Some of these guids (where noted) also apply to wave tracks. - */ -/* Download bands/waves for the IDirectMusicSegment */ -DEFINE_GUID(GUID_Download,0xd2ac28a7, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Unload bands/waves for the IDirectMusicSegment */ -DEFINE_GUID(GUID_Unload,0xd2ac28a8, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Connect segment's bands to an IDirectMusicCollection */ -DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e); - -/* Enable/disable autodownloading of bands/waves */ -DEFINE_GUID(GUID_Enable_Auto_Download,0xd2ac28a9, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_Disable_Auto_Download,0xd2ac28aa, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Clear all bands */ -DEFINE_GUID(GUID_Clear_All_Bands,0xd2ac28ab, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file */ -DEFINE_GUID(GUID_StandardMIDIFile, 0x6621075, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e); -/* For compatibility with beta releases... */ -#define GUID_IgnoreBankSelectForGM GUID_StandardMIDIFile - -/* Disable/enable param guids. Use these in SetParam calls to disable or enable sending - * specific PMsg types. - */ -DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(GUID_DisableTempo, 0x45fc707d, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(GUID_EnableTempo, 0x45fc707e, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); - -/* Used in SetParam calls for pattern-based tracks. A nonzero value seeds the random number -generator for variation selection; a value of zero reverts to the default behavior of -getting the seed from the system clock. -*/ -DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5, 0xff37, 0x11d2, 0x81, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); - -/* Used to get/set melody fragments (pParam points to a DMUS_MELODY_FRAGMENT) */ -/* Note: Melody formulation is not supported in DX8. */ -DEFINE_GUID(GUID_MelodyFragment, 0xb291c7f2, 0xb616, 0x11d2, 0x97, 0xfa, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); - -/* Used to clear all melody fragments */ -/* Note: Melody formulation is not supported in DX8. */ -DEFINE_GUID(GUID_Clear_All_MelodyFragments, 0x8509fee6, 0xb617, 0x11d2, 0x97, 0xfa, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); - -/* Used to get the variations currently in effect across PChannels */ -DEFINE_GUID(GUID_Variations, 0x11f72cce, 0x26e6, 0x4ecd, 0xaf, 0x2e, 0xd6, 0x68, 0xe6, 0x67, 0x7, 0xd8); -typedef struct _DMUS_VARIATIONS_PARAM -{ - DWORD dwPChannelsUsed; /* number of PChannels in use */ - DWORD* padwPChannels; /* array of PChannels in use */ - DWORD* padwVariations; /* array of variations in effect for each PChannel */ -} DMUS_VARIATIONS_PARAM; - -/* Download bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */ -DEFINE_GUID(GUID_DownloadToAudioPath,0x9f2c0341, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); - -/* Unload bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */ -DEFINE_GUID(GUID_UnloadFromAudioPath,0x9f2c0342, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); - - -/* Global data guids */ -DEFINE_GUID(GUID_PerfMasterTempo,0xd2ac28b0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_PerfMasterVolume,0xd2ac28b1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_PerfMasterGrooveLevel,0xd2ac28b2, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b, 0x3631, 0x11d2, 0xbc, 0xb8, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); - -/* GUID for default GM/GS dls collection. */ -DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* GUID to define default synth, placed in AudioPath configuration file. */ -DEFINE_GUID(GUID_Synth_Default,0x26bb9432, 0x45fe, 0x48d3, 0xa3, 0x75, 0x24, 0x72, 0xc5, 0xe3, 0xe7, 0x86); - -/* GUIDs to define default buffer configurations to place in AudioPath configuration file. */ -DEFINE_GUID(GUID_Buffer_Reverb,0x186cc541, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); -DEFINE_GUID(GUID_Buffer_EnvReverb,0x186cc542, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); -DEFINE_GUID(GUID_Buffer_Stereo,0x186cc545, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); -DEFINE_GUID(GUID_Buffer_3D_Dry,0x186cc546, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); -DEFINE_GUID(GUID_Buffer_Mono,0x186cc547, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); - -/* IID's */ -DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2, 0x5dca, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(IID_IDirectMusicGetLoader,0x68a04844, 0xd13d, 0x11d1, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(IID_IDirectMusicObject,0xd2ac28b5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7, 0xd3ee, 0x11d1, 0xbc, 0x8d, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(IID_IDirectMusicPerformance,0x7d43d03, 0x6523, 0x11d2, 0x87, 0x1d, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicGraph,0x2befc277, 0x5497, 0x11d2, 0xbc, 0xcb, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); -DEFINE_GUID(IID_IDirectMusicStyle,0xd2ac28bd, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicChordMap,0xd2ac28be, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicComposer,0xd2ac28bf, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); -DEFINE_GUID(IID_IDirectMusicBand,0xd2ac28c0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Alternate interface IDs, available in DX7 release and after. */ -DEFINE_GUID(IID_IDirectMusicPerformance2,0x6fc2cae0, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1, 0xc052, 0x11d2, 0x87, 0x2f, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); - -/* Interface IDs for DX8 */ -/* changed interfaces (GUID only) */ -DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c, 0xa44, 0x4e6a, 0xa1, 0x16, 0x59, 0x5a, 0x7c, 0xd5, 0xde, 0x8c); -DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137, 0xc62e, 0x4147, 0xb2, 0xb4, 0x9d, 0x56, 0x9a, 0xcb, 0x25, 0x4c); -DEFINE_GUID(IID_IDirectMusicSegment8,0xc6784488, 0x41a3, 0x418f, 0xaa, 0x15, 0xb3, 0x50, 0x93, 0xba, 0x42, 0xd4); -DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730, 0xae4, 0x48a7, 0x98, 0x39, 0xbc, 0x4, 0xbf, 0xe0, 0x77, 0x72); -DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a, 0xa260, 0x453d, 0xbf, 0x50, 0x6f, 0x93, 0x84, 0xf7, 0x9, 0x85); -/* new interfaces (GUID + alias) */ -DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10, 0xb49f, 0x46fc, 0xbe, 0xc2, 0xe6, 0x28, 0x8f, 0xb9, 0xed, 0xe6); -#define IID_IDirectMusicPatternTrack8 IID_IDirectMusicPatternTrack -DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a, 0x5814, 0x489b, 0x82, 0x9, 0x31, 0xfe, 0xde, 0xba, 0xf1, 0x37); /* {2252373A-5814-489b-8209-31FEDEBAF137} */ -#define IID_IDirectMusicScript8 IID_IDirectMusicScript -DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47); -#define IID_IDirectMusicContainer8 IID_IDirectMusicContainer -/* Note: Songs are not supported in DX8. */ -DEFINE_GUID(IID_IDirectMusicSong, 0xa862b2ec, 0x3676, 0x4982, 0x85, 0xa, 0x78, 0x42, 0x77, 0x5e, 0x1d, 0x86); -#define IID_IDirectMusicSong8 IID_IDirectMusicSong -DEFINE_GUID(IID_IDirectMusicAudioPath,0xc87631f5, 0x23be, 0x4986, 0x88, 0x36, 0x5, 0x83, 0x2f, 0xcc, 0x48, 0xf9); -#define IID_IDirectMusicAudioPath8 IID_IDirectMusicAudioPath -/* unchanged interfaces (alias only) */ -#define IID_IDirectMusicGetLoader8 IID_IDirectMusicGetLoader -#define IID_IDirectMusicChordMap8 IID_IDirectMusicChordMap -#define IID_IDirectMusicGraph8 IID_IDirectMusicGraph -#define IID_IDirectMusicBand8 IID_IDirectMusicBand -#define IID_IDirectMusicObject8 IID_IDirectMusicObject -#define IID_IDirectMusicComposer8 IID_IDirectMusicComposer - - -#ifdef __cplusplus -}; /* extern "C" */ -#endif - -#include - -#endif /* #ifndef _DMUSICI_ */ diff --git a/import/DirectX8/include/dmusics.h b/import/DirectX8/include/dmusics.h deleted file mode 100644 index cda65d284..000000000 --- a/import/DirectX8/include/dmusics.h +++ /dev/null @@ -1,193 +0,0 @@ -/************************************************************************ -* * -* dmusics.h -- Definitions for created a DirectMusic software synth * -* * -* Copyright (c) 1998-1999 Microsoft Corporation -* * -************************************************************************/ - -#ifndef _DMUSICS_ -#define _DMUSICS_ - -#include "dmusicc.h" - -/* Software synths are enumerated from under this registry key. - */ -#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths" - -interface IDirectMusicSynth; -interface IDirectMusicSynthSink; - -#ifndef __cplusplus -typedef interface IDirectMusicSynth IDirectMusicSynth; -typedef interface IDirectMusicSynthSink IDirectMusicSynthSink; -#endif - -#ifndef _DMUS_VOICE_STATE_DEFINED -#define _DMUS_VOICE_STATE_DEFINED - -typedef struct _DMUS_VOICE_STATE -{ - BOOL bExists; - SAMPLE_POSITION spPosition; -} DMUS_VOICE_STATE; - -#endif /* _DMUS_VOICE_STATE_DEFINED */ - -/* IDirectMusicSynth::Refresh - * - * This is the last buffer of the stream. It may be a partial block. - */ -#define REFRESH_F_LASTBUFFER 0x00000001 - -#undef INTERFACE -#define INTERFACE IDirectMusicSynth -DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynth */ - STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; - STDMETHOD(Download) (THIS_ LPHANDLE phDownload, - LPVOID pvData, - LPBOOL pbFree ) PURE; - STDMETHOD(Unload) (THIS_ HANDLE hDownload, - HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), - HANDLE hUserData ) PURE; - STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, - LPBYTE pbBuffer, - DWORD cbBuffer) PURE; - STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; - STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; - STDMETHOD(Render) (THIS_ short *pBuffer, - DWORD dwLength, - LONGLONG llPosition) PURE; - STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwPriority) PURE; - STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwPriority) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, - LPDWORD pdwWaveFormatExSize) PURE; - STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; -}; - -#undef INTERFACE - -#define INTERFACE IDirectMusicSynth8 -DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynth */ - STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; - STDMETHOD(Download) (THIS_ LPHANDLE phDownload, - LPVOID pvData, - LPBOOL pbFree ) PURE; - STDMETHOD(Unload) (THIS_ HANDLE hDownload, - HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), - HANDLE hUserData ) PURE; - STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, - LPBYTE pbBuffer, - DWORD cbBuffer) PURE; - STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; - STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; - STDMETHOD(Render) (THIS_ short *pBuffer, - DWORD dwLength, - LONGLONG llPosition) PURE; - STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwPriority) PURE; - STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwPriority) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, - LPDWORD pdwWaveFormatExSize) PURE; - STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; - - /* IDirectMusicSynth8 */ - STDMETHOD(PlayVoice) (THIS_ REFERENCE_TIME rt, - DWORD dwVoiceId, - DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwDLId, - long prPitch, /* PREL not defined here */ - long vrVolume, /* VREL not defined here */ - SAMPLE_TIME stVoiceStart, - SAMPLE_TIME stLoopStart, - SAMPLE_TIME stLoopEnd) PURE; - - STDMETHOD(StopVoice) (THIS_ REFERENCE_TIME rt, - DWORD dwVoiceId ) PURE; - - STDMETHOD(GetVoiceState) (THIS_ DWORD dwVoice[], - DWORD cbVoice, - DMUS_VOICE_STATE dwVoiceState[] ) PURE; - STDMETHOD(Refresh) (THIS_ DWORD dwDownloadID, - DWORD dwFlags) PURE; - STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwBuses, - DWORD cBuses) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectMusicSynthSink -DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynthSink */ - STDMETHOD(Init) (THIS_ IDirectMusicSynth *pSynth) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime, - REFERENCE_TIME *prfTime) PURE; - STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime, - LONGLONG *pllSampleTime) PURE; - STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, - LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; - STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE; -}; - -DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8); -DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -/* Property Set GUID_DMUS_PROP_SetSynthSink - * - * Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink. - */ -DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -/* Property Set GUID_DMUS_PROP_SinkUsesDSound - * - * Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The - * default is FALSE if this property item is not implemented by the sink. - */ -DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -#endif diff --git a/import/DirectX8/include/dpaddr.h b/import/DirectX8/include/dpaddr.h deleted file mode 100644 index e7ef18246..000000000 --- a/import/DirectX8/include/dpaddr.h +++ /dev/null @@ -1,375 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved. - * - * File: dpaddr.h - * Content: DirectPlayAddress include file - ***************************************************************************/ - -#ifndef __DIRECTPLAYADDRESS__ -#define __DIRECTPLAYADDRESS__ - -#include // for DECLARE_INTERFACE and HRESULT - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dplay8.h" - -/**************************************************************************** - * - * DirectPlay8Address CLSIDs - * - ****************************************************************************/ - -// {934A9523-A3CA-4bc5-ADA0-D6D95D979421} -DEFINE_GUID(CLSID_DirectPlay8Address, -0x934a9523, 0xa3ca, 0x4bc5, 0xad, 0xa0, 0xd6, 0xd9, 0x5d, 0x97, 0x94, 0x21); - -/**************************************************************************** - * - * DirectPlay8Address Interface IIDs - * - ****************************************************************************/ - - -// {83783300-4063-4c8a-9DB3-82830A7FEB31} -DEFINE_GUID(IID_IDirectPlay8Address, -0x83783300, 0x4063, 0x4c8a, 0x9d, 0xb3, 0x82, 0x83, 0xa, 0x7f, 0xeb, 0x31); - -// {E5A0E990-2BAD-430b-87DA-A142CF75DE58} -DEFINE_GUID(IID_IDirectPlay8AddressIP, -0xe5a0e990, 0x2bad, 0x430b, 0x87, 0xda, 0xa1, 0x42, 0xcf, 0x75, 0xde, 0x58); - - -/**************************************************************************** - * - * DirectPlay8Address Interface Pointer definitions - * - ****************************************************************************/ - - -typedef struct IDirectPlay8Address *PDIRECTPLAY8ADDRESS, *LPDIRECTPLAY8ADDRESS; -typedef struct IDirectPlay8AddressIP *PDIRECTPLAY8ADDRESSIP, *LPDIRECTPLAY8ADDRESSIP; - -/**************************************************************************** - * - * DirectPlay8Address Forward Declarations For External Types - * - ****************************************************************************/ - -typedef struct sockaddr SOCKADDR; - -/**************************************************************************** - * - * DirectPlay8Address Constants - * - ****************************************************************************/ -// -// Asynchronous operation flags -// -#define DPNA_DATATYPE_STRING 0x00000001 -#define DPNA_DATATYPE_DWORD 0x00000002 -#define DPNA_DATATYPE_GUID 0x00000003 -#define DPNA_DATATYPE_BINARY 0x00000004 -#define DPNA_DATATYPE_STRING_ANSI 0x00000005 - -#define DPNA_DPNSVR_PORT 6073 - -#define DPNA_INDEX_INVALID 0xFFFFFFFF - -/**************************************************************************** - * - * DirectPlay8Address Address Elements - * - ****************************************************************************/ - -#define DPNA_SEPARATOR_KEYVALUE L'=' -#define DPNA_SEPARATOR_USERDATA L'#' -#define DPNA_SEPARATOR_COMPONENT L';' -#define DPNA_ESCAPECHAR L'%' - -// Header -#define DPNA_HEADER L"x-directplay:/" - -// key names for address components -#define DPNA_KEY_APPLICATION_INSTANCE L"applicationinstance" -#define DPNA_KEY_BAUD L"baud" -#define DPNA_KEY_DEVICE L"device" -#define DPNA_KEY_FLOWCONTROL L"flowcontrol" -#define DPNA_KEY_HOSTNAME L"hostname" -#define DPNA_KEY_PARITY L"parity" -#define DPNA_KEY_PHONENUMBER L"phonenumber" -#define DPNA_KEY_PORT L"port" -#define DPNA_KEY_PROGRAM L"program" -#define DPNA_KEY_PROVIDER L"provider" -#define DPNA_KEY_STOPBITS L"stopbits" - -// values for baud rate -#define DPNA_BAUD_RATE_9600 9600 -#define DPNA_BAUD_RATE_14400 14400 -#define DPNA_BAUD_RATE_19200 19200 -#define DPNA_BAUD_RATE_38400 38400 -#define DPNA_BAUD_RATE_56000 56000 -#define DPNA_BAUD_RATE_57600 57600 -#define DPNA_BAUD_RATE_115200 115200 - -// values for stop bits -#define DPNA_STOP_BITS_ONE L"1" -#define DPNA_STOP_BITS_ONE_FIVE L"1.5" -#define DPNA_STOP_BITS_TWO L"2" - -// values for parity -#define DPNA_PARITY_NONE L"NONE" -#define DPNA_PARITY_EVEN L"EVEN" -#define DPNA_PARITY_ODD L"ODD" -#define DPNA_PARITY_MARK L"MARK" -#define DPNA_PARITY_SPACE L"SPACE" - -// values for flow control -#define DPNA_FLOW_CONTROL_NONE L"NONE" -#define DPNA_FLOW_CONTROL_XONXOFF L"XONXOFF" -#define DPNA_FLOW_CONTROL_RTS L"RTS" -#define DPNA_FLOW_CONTROL_DTR L"DTR" -#define DPNA_FLOW_CONTROL_RTSDTR L"RTSDTR" - -// Shortcut values -// -// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids -// -#define DPNA_VALUE_TCPIPPROVIDER L"IP" -#define DPNA_VALUE_IPXPROVIDER L"IPX" -#define DPNA_VALUE_MODEMPROVIDER L"MODEM" -#define DPNA_VALUE_SERIALPROVIDER L"SERIAL" - - -//// ANSI DEFINITIONS - -// Header -#define DPNA_HEADER_A "x-directplay:/" -#define DPNA_SEPARATOR_KEYVALUE_A '=' -#define DPNA_SEPARATOR_USERDATA_A '#' -#define DPNA_SEPARATOR_COMPONENT_A ';' -#define DPNA_ESCAPECHAR_A '%' - -// key names for address components -#define DPNA_KEY_APPLICATION_INSTANCE_A "applicationinstance" -#define DPNA_KEY_BAUD_A "baud" -#define DPNA_KEY_DEVICE_A "device" -#define DPNA_KEY_FLOWCONTROL_A "flowcontrol" -#define DPNA_KEY_HOSTNAME_A "hostname" -#define DPNA_KEY_PARITY_A "parity" -#define DPNA_KEY_PHONENUMBER_A "phonenumber" -#define DPNA_KEY_PORT_A "port" -#define DPNA_KEY_PROGRAM_A "program" -#define DPNA_KEY_PROVIDER_A "provider" -#define DPNA_KEY_STOPBITS_A "stopbits" - -// values for stop bits -#define DPNA_STOP_BITS_ONE_A "1" -#define DPNA_STOP_BITS_ONE_FIVE_A "1.5" -#define DPNA_STOP_BITS_TWO_A "2" - -// values for parity -#define DPNA_PARITY_NONE_A "NONE" -#define DPNA_PARITY_EVEN_A "EVEN" -#define DPNA_PARITY_ODD_A "ODD" -#define DPNA_PARITY_MARK_A "MARK" -#define DPNA_PARITY_SPACE_A "SPACE" - -// values for flow control -#define DPNA_FLOW_CONTROL_NONE_A "NONE" -#define DPNA_FLOW_CONTROL_XONXOFF_A "XONXOFF" -#define DPNA_FLOW_CONTROL_RTS_A "RTS" -#define DPNA_FLOW_CONTROL_DTR_A "DTR" -#define DPNA_FLOW_CONTROL_RTSDTR_A "RTSDTR" - -// Shortcut values -// -// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids -// -#define DPNA_VALUE_TCPIPPROVIDER_A "IP" -#define DPNA_VALUE_IPXPROVIDER_A "IPX" -#define DPNA_VALUE_MODEMPROVIDER_A "MODEM" -#define DPNA_VALUE_SERIALPROVIDER_A "SERIAL" - -/**************************************************************************** - * - * DirectPlay8Address Functions - * - ****************************************************************************/ - -/* - * - * This function is no longer supported. It is recommended that CoCreateInstance be used to create - * DirectPlay8 address objects. - * - * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); - * - */ - -/**************************************************************************** - * - * DirectPlay8Address Application Interfaces - * - ****************************************************************************/ - -// -// COM definition for IDirectPlay8Address Generic Interface -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8Address -DECLARE_INTERFACE_(IDirectPlay8Address,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay8Address methods ***/ - - STDMETHOD(BuildFromURLW)(THIS_ WCHAR *pwszSourceURL ) PURE; - STDMETHOD(BuildFromURLA)(THIS_ CHAR *pszSourceURL ) PURE; - STDMETHOD(Duplicate)(THIS_ PDIRECTPLAY8ADDRESS *ppdpaNewAddress ) PURE; - STDMETHOD(SetEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE; - STDMETHOD(IsEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE; - STDMETHOD(Clear)(THIS ) PURE; - STDMETHOD(GetURLW)(THIS_ WCHAR *pwszURL, PDWORD pdwNumChars ) PURE; - STDMETHOD(GetURLA)(THIS_ CHAR *pszURL, PDWORD pdwNumChars) PURE; - STDMETHOD(GetSP)(THIS_ GUID *pguidSP ) PURE; - STDMETHOD(GetUserData)(THIS_ void *pvUserData, PDWORD pdwBufferSize) PURE; - STDMETHOD(SetSP)(THIS_ const GUID * const pguidSP ) PURE; - STDMETHOD(SetUserData)(THIS_ const void * const pvUserData, const DWORD dwDataSize) PURE; - STDMETHOD(GetNumComponents)(THIS_ PDWORD pdwNumComponents ) PURE; - STDMETHOD(GetComponentByName)(THIS_ const WCHAR * const pwszName, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE; - STDMETHOD(GetComponentByIndex)(THIS_ const DWORD dwComponentID, WCHAR * pwszName, PDWORD pdwNameLen, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE; - STDMETHOD(AddComponent)(THIS_ const WCHAR * const pwszName, const void * const lpvData, const DWORD dwDataSize, const DWORD dwDataType ) PURE; - STDMETHOD(GetDevice)(THIS_ GUID * ) PURE; - STDMETHOD(SetDevice)(THIS_ const GUID * const) PURE; - STDMETHOD(BuildFromDPADDRESS)( THIS_ LPVOID pvAddress, DWORD dwDataSize ) PURE; -}; - -// -// COM definition for IDirectPlay8AddressIP Generic Interface -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8AddressIP -DECLARE_INTERFACE_(IDirectPlay8AddressIP,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID, PVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /*** IDirectPlay8AddressIP methods ***/ - - // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure - STDMETHOD(BuildFromSockAddr)(THIS_ const SOCKADDR * const ) PURE; - - // Constructs a TCP Address from a string (hostname) and port - STDMETHOD(BuildAddress)(THIS_ const WCHAR * const wszAddress, const USHORT usPort ) PURE; - - // Builds a local TCP Address - STDMETHOD(BuildLocalAddress)(THIS_ const GUID * const pguidAdapter, const USHORT usPort ) PURE; - - // Gets the address from the structure in SOCKADR format - STDMETHOD(GetSockAddress)(THIS_ SOCKADDR *, PDWORD ) PURE; - - // Gets the local afddress - STDMETHOD(GetLocalAddress)(THIS_ GUID *pguidAdapter, USHORT *pusPort ) PURE; - - // Gets the remote address - STDMETHOD(GetAddress)(THIS_ WCHAR *wszAddress, PDWORD pdwAddressLength, USHORT *psPort ) PURE; - -}; - - - -/**************************************************************************** - * - * IDirectPlay8 application interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8Address_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8Address_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->lpVtbl->BuildFromURLW(p,a) -#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->lpVtbl->BuildFromURLA(p,a) -#define IDirectPlay8Address_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a) -#define IDirectPlay8Address_SetEqual(p,a) (p)->lpVtbl->SetEqual(p,a) -#define IDirectPlay8Address_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a) -#define IDirectPlay8Address_Clear(p) (p)->lpVtbl->Clear(p) -#define IDirectPlay8Address_GetURLW(p,a,b) (p)->lpVtbl->GetURLW(p,a,b) -#define IDirectPlay8Address_GetURLA(p,a,b) (p)->lpVtbl->GetURLA(p,a,b) -#define IDirectPlay8Address_GetSP(p,a) (p)->lpVtbl->GetSP(p,a) -#define IDirectPlay8Address_GetUserData(p,a,b) (p)->lpVtbl->GetUserData(p,a,b) -#define IDirectPlay8Address_SetSP(p,a) (p)->lpVtbl->SetSP(p,a) -#define IDirectPlay8Address_SetUserData(p,a,b) (p)->lpVtbl->SetUserData(p,a,b) -#define IDirectPlay8Address_GetNumComponents(p,a) (p)->lpVtbl->GetNumComponents(p,a) -#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->lpVtbl->GetComponentByName(p,a,b,c,d) -#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->lpVtbl->GetComponentByIndex(p,a,b,c,d,e,f) -#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->lpVtbl->AddComponent(p,a,b,c,d) -#define IDirectPlay8Address_SetDevice(p,a) (p)->lpVtbl->SetDevice(p,a) -#define IDirectPlay8Address_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->lpVtbl->BuildFromDirectPlay4Address(p,a,b) - -#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8AddressIP_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8AddressIP_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->lpVtbl->BuildFromSockAddr(p,a) -#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->lpVtbl->BuildAddress(p,a,b) -#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->lpVtbl->BuildLocalAddress(p,a,b) -#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->lpVtbl->GetSockAddress(p,a,b) -#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->lpVtbl->GetLocalAddress(p,a,b) -#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->lpVtbl->GetAddress(p,a,b,c) - - -#else /* C++ */ - -#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8Address_AddRef(p) (p)->AddRef() -#define IDirectPlay8Address_Release(p) (p)->Release() -#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->BuildFromURLW(a) -#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->BuildFromURLA(a) -#define IDirectPlay8Address_Duplicate(p,a) (p)->Duplicate(a) -#define IDirectPlay8Address_SetEqual(p,a) (p)->SetEqual(a) -#define IDirectPlay8Address_IsEqual(p,a) (p)->IsEqual(a) -#define IDirectPlay8Address_Clear(p) (p)->Clear() -#define IDirectPlay8Address_GetURLW(p,a,b) (p)->GetURLW(a,b) -#define IDirectPlay8Address_GetURLA(p,a,b) (p)->GetURLA(a,b) -#define IDirectPlay8Address_GetSP(p,a) (p)->GetSP(a) -#define IDirectPlay8Address_GetUserData(p,a,b) (p)->GetUserData(a,b) -#define IDirectPlay8Address_SetSP(p,a) (p)->SetSP(a) -#define IDirectPlay8Address_SetUserData(p,a,b) (p)->SetUserData(a,b) -#define IDirectPlay8Address_GetNumComponents(p,a) (p)->GetNumComponents(a) -#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->GetComponentByName(a,b,c,d) -#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->GetComponentByIndex(a,b,c,d,e,f) -#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->AddComponent(a,b,c,d) -#define IDirectPlay8Address_SetDevice(p,a) (p)->SetDevice(a) -#define IDirectPlay8Address_GetDevice(p,a) (p)->GetDevice(a) -#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->BuildFromDirectPlay4Address(a,b) - -#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8AddressIP_AddRef(p) (p)->AddRef() -#define IDirectPlay8AddressIP_Release(p) (p)->Release() -#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->BuildFromSockAddr(a) -#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->BuildAddress(a,b) -#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->BuildLocalAddress(a,b) -#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->GetSockAddress(a,b) -#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->GetLocalAddress(a,b) -#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->GetAddress(a,b,c) - - -#endif - - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dplay.h b/import/DirectX8/include/dplay.h deleted file mode 100644 index ae2114489..000000000 --- a/import/DirectX8/include/dplay.h +++ /dev/null @@ -1,2146 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dplay.h - * Content: DirectPlay include file - * - ***************************************************************************/ - -#ifndef __DPLAY_INCLUDED__ -#define __DPLAY_INCLUDED__ - -#include // for DECLARE_INTERFACE and HRESULT - -/* avoid warnings in MSVC at Level4 */ -#pragma warning(disable:4201) - - -/* - * Some types - */ - -#ifndef _WIN64 -#define DWORD_PTR DWORD -#endif - -typedef LPVOID (*LPRGLPVOID)[]; -typedef LPRGLPVOID PRGPVOID, LPRGPVOID, PRGLPVOID, PAPVOID, LPAPVOID, PALPVOID, LPALPVOID; - -#define VOL volatile -typedef VOID *VOL LPVOIDV; - - -#define _FACDP 0x877 -#define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectPlay objects - */ -DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); -DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); -DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); -DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - -// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB} -DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -/* - * GUIDS used by Service Providers shipped with DirectPlay - * Use these to identify Service Provider returned by EnumConnections - */ - -// GUID for IPX service provider -// {685BC400-9D2C-11cf-A9CD-00AA006886E3} -DEFINE_GUID(DPSPGUID_IPX, -0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); - -// GUID for TCP/IP service provider -// 36E95EE0-8577-11cf-960C-0080C7534E82 -DEFINE_GUID(DPSPGUID_TCPIP, -0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -// GUID for Serial service provider -// {0F1D6860-88D9-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_SERIAL, -0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// GUID for Modem service provider -// {44EAA760-CB68-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_MODEM, -0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/**************************************************************************** - * - * DirectPlay Structures - * - * Various structures used to invoke DirectPlay. - * - ****************************************************************************/ - -#ifndef IDIRECTPLAY2_OR_GREATER -typedef struct IDirectPlay FAR *LPDIRECTPLAY; -#else -typedef struct IUnknown FAR *LPDIRECTPLAY; -#endif - -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2; -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2A; -typedef struct IDirectPlay2 IDirectPlay2A; - -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3; -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3A; -typedef struct IDirectPlay3 IDirectPlay3A; - -typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4; -typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4A; -typedef struct IDirectPlay4 IDirectPlay4A; - -/* - * DPID - * DirectPlay player and group ID - */ -typedef DWORD DPID, FAR *LPDPID; - -/* - * DPID that system messages come from - */ -#define DPID_SYSMSG 0 - -/* - * DPID representing all players in the session - */ -#define DPID_ALLPLAYERS 0 - -/* - * DPID representing the server player - */ -#define DPID_SERVERPLAYER 1 - - -/* - * DPID representing the maxiumum ID in the range of DPID's reserved for - * use by DirectPlay. - */ -#define DPID_RESERVEDRANGE 100 - -/* - * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID) - */ -#define DPID_UNKNOWN 0xFFFFFFFF - -/* - * DPCAPS - * Used to obtain the capabilities of a DirectPlay object - */ -typedef struct -{ - DWORD dwSize; // Size of structure, in bytes - DWORD dwFlags; // DPCAPS_xxx flags - DWORD dwMaxBufferSize; // Maximum message size, in bytes, for this service provider - DWORD dwMaxQueueSize; // Obsolete. - DWORD dwMaxPlayers; // Maximum players/groups (local + remote) - DWORD dwHundredBaud; // Bandwidth in 100 bits per second units; - // i.e. 24 is 2400, 96 is 9600, etc. - DWORD dwLatency; // Estimated latency; 0 = unknown - DWORD dwMaxLocalPlayers; // Maximum # of locally created players allowed - DWORD dwHeaderLength; // Maximum header length, in bytes, on messages - // added by the service provider - DWORD dwTimeout; // Service provider's suggested timeout value - // This is how long DirectPlay will wait for - // responses to system messages -} DPCAPS, FAR *LPDPCAPS; - -/* - * This DirectPlay object is the session host. If the host exits the - * session, another application will become the host and receive a - * DPSYS_HOST system message. - */ -#define DPCAPS_ISHOST 0x00000002 - -/* - * The service provider bound to this DirectPlay object can optimize - * group messaging. - */ -#define DPCAPS_GROUPOPTIMIZED 0x00000008 - -/* - * The service provider bound to this DirectPlay object can optimize - * keep alives (see DPSESSION_KEEPALIVE) - */ -#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010 - -/* - * The service provider bound to this DirectPlay object can optimize - * guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020 - -/* - * This DirectPlay object supports guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040 - -/* - * This DirectPlay object supports digital signing of messages. - */ -#define DPCAPS_SIGNINGSUPPORTED 0x00000080 - -/* - * This DirectPlay object supports encryption of messages. - */ -#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100 - -/* - * This DirectPlay player was created on this machine - */ -#define DPPLAYERCAPS_LOCAL 0x00000800 - -/* - * Current Open settings supports all forms of Cancel - */ -#define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000 - -/* - * Current Open settings supports CancelAll, but not Cancel - */ -#define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000 - -/* - * Current Open settings supports Send Timeouts for sends - */ -#define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000 - -/* - * Current Open settings supports send priority - */ -#define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000 - -/* - * Current Open settings supports DPSEND_ASYNC flag - */ -#define DPCAPS_ASYNCSUPPORTED 0x00010000 - - -/* - * DPSESSIONDESC2 - * Used to describe the properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // DPSESSION_xxx flags - GUID guidInstance; // ID for the session instance - GUID guidApplication; // GUID of the DirectPlay application. - // GUID_NULL for all applications. - DWORD dwMaxPlayers; // Maximum # players allowed in session - DWORD dwCurrentPlayers; // Current # players in session (read only) - union - { // Name of the session - LPWSTR lpszSessionName; // Unicode - LPSTR lpszSessionNameA; // ANSI - }; - union - { // Password of the session (optional) - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - DWORD_PTR dwReserved1; // Reserved for future MS use. - DWORD_PTR dwReserved2; - DWORD_PTR dwUser1; // For use by the application - DWORD_PTR dwUser2; - DWORD_PTR dwUser3; - DWORD_PTR dwUser4; -} DPSESSIONDESC2, FAR *LPDPSESSIONDESC2; - -typedef DPSESSIONDESC2 * VOL LPDPSESSIONDESC2_V; - -/* - * LPCDPSESSIONDESC2 - * A constant pointer to DPSESSIONDESC2 - */ -typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2; - -/* - * Applications cannot create new players in this session. - */ -#define DPSESSION_NEWPLAYERSDISABLED 0x00000001 - -/* - * If the DirectPlay object that created the session, the host, - * quits, then the host will attempt to migrate to another - * DirectPlay object so that new players can continue to be created - * and new applications can join the session. - */ -#define DPSESSION_MIGRATEHOST 0x00000004 - -/* - * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom - * fields in player messages. This cuts two DWORD's off the message - * overhead. - */ -#define DPSESSION_NOMESSAGEID 0x00000008 - - -/* - * This flag tells DirectPlay to not allow any new applications to - * join the session. Applications already in the session can still - * create new players. - */ -#define DPSESSION_JOINDISABLED 0x00000020 - -/* - * This flag tells DirectPlay to detect when remote players - * exit abnormally (e.g. their computer or modem gets unplugged) - */ -#define DPSESSION_KEEPALIVE 0x00000040 - -/* - * This flag tells DirectPlay not to send a message to all players - * when a players remote data changes - */ -#define DPSESSION_NODATAMESSAGES 0x00000080 - -/* - * This flag indicates that the session belongs to a secure server - * and needs user authentication - */ -#define DPSESSION_SECURESERVER 0x00000100 - -/* - * This flag indicates that the session is private and requirs a password - * for EnumSessions as well as Open. - */ -#define DPSESSION_PRIVATE 0x00000200 - -/* - * This flag indicates that the session requires a password for joining. - */ -#define DPSESSION_PASSWORDREQUIRED 0x00000400 - -/* - * This flag tells DirectPlay to route all messages through the server - */ -#define DPSESSION_MULTICASTSERVER 0x00000800 - -/* - * This flag tells DirectPlay to only download information about the - * DPPLAYER_SERVERPLAYER. - */ -#define DPSESSION_CLIENTSERVER 0x00001000 - -/* - * This flag tells DirectPlay to use the protocol built into dplay - * for reliability and statistics all the time. When this bit is - * set, only other sessions with this bit set can join or be joined. - */ -#define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000 - -/* - * This flag tells DirectPlay that preserving order of received - * packets is not important, when using reliable delivery. This - * will allow messages to be indicated out of order if preceding - * messages have not yet arrived. Otherwise DPLAY will wait for - * earlier messages before delivering later reliable messages. - */ -#define DPSESSION_NOPRESERVEORDER 0x00004000 - - -/* - * This flag tells DirectPlay to optimize communication for latency - */ -#define DPSESSION_OPTIMIZELATENCY 0x00008000 - -/* - * This flag allows lobby launched games that aren't voice enabled - * to get voice capabilities. - */ -#define DPSESSION_ALLOWVOICERETRO 0x00010000 - -/* - * This flag supresses transmission of session desc changes. - * DPSESSION_NODATAMESSAGES was supposed to do that, but SetSessionDesc - * was ignoring the flag and some apps depended on the broken behavior, this - * flag allows applications to get the right behaviour without breaking apps depending - * on old broken behavior. - */ -#define DPSESSION_NOSESSIONDESCMESSAGES 0x00020000 - -/* - * DPNAME - * Used to hold the name of a DirectPlay entity - * like a player or a group - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // The short or friendly name - LPWSTR lpszShortName; // Unicode - LPSTR lpszShortNameA; // ANSI - }; - union - { // The long or formal name - LPWSTR lpszLongName; // Unicode - LPSTR lpszLongNameA; // ANSI - }; - -} DPNAME, FAR *LPDPNAME; - -/* - * LPCDPNAME - * A constant pointer to DPNAME - */ -typedef const DPNAME FAR *LPCDPNAME; - -/* - * DPCREDENTIALS - * Used to hold the user name and password of a DirectPlay user - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // User name of the account - LPWSTR lpszUsername; // Unicode - LPSTR lpszUsernameA; // ANSI - }; - union - { // Password of the account - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - union - { // Domain name of the account - LPWSTR lpszDomain; // Unicode - LPSTR lpszDomainA; // ANSI - }; -} DPCREDENTIALS, FAR *LPDPCREDENTIALS; - -typedef const DPCREDENTIALS FAR *LPCDPCREDENTIALS; - -/* - * DPSECURITYDESC - * Used to describe the security properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // SSPI provider name - LPWSTR lpszSSPIProvider; // Unicode - LPSTR lpszSSPIProviderA; // ANSI - }; - union - { // CAPI provider name - LPWSTR lpszCAPIProvider; // Unicode - LPSTR lpszCAPIProviderA; // ANSI - }; - DWORD dwCAPIProviderType; // Crypto Service Provider type - DWORD dwEncryptionAlgorithm; // Encryption Algorithm type -} DPSECURITYDESC, FAR *LPDPSECURITYDESC; - -typedef const DPSECURITYDESC FAR *LPCDPSECURITYDESC; - -/* - * DPACCOUNTDESC - * Used to describe a user membership account - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // Account identifier - LPWSTR lpszAccountID; // Unicode - LPSTR lpszAccountIDA; // ANSI - }; -} DPACCOUNTDESC, FAR *LPDPACCOUNTDESC; - -typedef const DPACCOUNTDESC FAR *LPCDPACCOUNTDESC; - -/* - * LPCGUID - * A constant pointer to a guid - */ -typedef const GUID FAR *LPCGUID; - -/* - * DPLCONNECTION - * Used to hold all in the informaion needed to connect - * an application to a session or create a session - */ -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags specific to this structure - LPDPSESSIONDESC2 lpSessionDesc; // Pointer to session desc to use on connect - LPDPNAME lpPlayerName; // Pointer to Player name structure - GUID guidSP; // GUID of the DPlay SP to use - LPVOID lpAddress; // Address for service provider - DWORD dwAddressSize; // Size of address data -} DPLCONNECTION, FAR *LPDPLCONNECTION; - -/* - * LPCDPLCONNECTION - * A constant pointer to DPLCONNECTION - */ -typedef const DPLCONNECTION FAR *LPCDPLCONNECTION; - -/* - * DPCHAT - * Used to hold the a DirectPlay chat message - */ -typedef struct -{ - DWORD dwSize; - DWORD dwFlags; - union - { // Message string - LPWSTR lpszMessage; // Unicode - LPSTR lpszMessageA; // ANSI - }; -} DPCHAT, FAR * LPDPCHAT; - -/* - * SGBUFFER - * Scatter Gather Buffer used for SendEx - */ -typedef struct -{ - UINT len; // length of buffer data - PUCHAR pData; // pointer to buffer data -} SGBUFFER, *PSGBUFFER, FAR *LPSGBUFFER; - - -/**************************************************************************** - * - * Prototypes for DirectPlay callback functions - * - ****************************************************************************/ - -/* - * Callback for IDirectPlay2::EnumSessions - */ -typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)( - LPCDPSESSIONDESC2 lpThisSD, - LPDWORD lpdwTimeOut, - DWORD dwFlags, - LPVOID lpContext ); - -/* - * This flag is set on the EnumSessions callback dwFlags parameter when - * the time out has occurred. There will be no session data for this - * callback. If *lpdwTimeOut is set to a non-zero value and the - * EnumSessionsCallback function returns TRUE then EnumSessions will - * continue waiting until the next timeout occurs. Timeouts are in - * milliseconds. - */ -#define DPESC_TIMEDOUT 0x00000001 - - -/* - * Callback for IDirectPlay2::EnumPlayers - * IDirectPlay2::EnumGroups - * IDirectPlay2::EnumGroupPlayers - */ -typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)( - DPID dpId, - DWORD dwPlayerType, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext ); - - -/* - * Unicode callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for Unicode strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)( - LPGUID lpguidSP, - LPWSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * ANSI callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for ANSI strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)( - LPGUID lpguidSP, - LPSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * Callback for IDirectPlay3(A)::EnumConnections - */ -typedef BOOL (FAR PASCAL * LPDPENUMCONNECTIONSCALLBACK)( - LPCGUID lpguidSP, - LPVOID lpConnection, - DWORD dwConnectionSize, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext); - - -/* - * API's - */ - -#ifdef UNICODE -#define DirectPlayEnumerate DirectPlayEnumerateW -#else -#define DirectPlayEnumerate DirectPlayEnumerateA -#endif // UNICODE - -extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID ); -extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID ); -extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk); - -/**************************************************************************** - * - * IDirectPlay2 (and IDirectPlay2A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay2 -DECLARE_INTERFACE_( IDirectPlay2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay2 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay2_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay2_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) - -#else /* C++ */ - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay2_AddRef(p) (p)->AddRef() -#define IDirectPlay2_Release(p) (p)->Release() -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay2_Close(p) (p)->Close() -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay2_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay2_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) - -#endif - -/**************************************************************************** - * - * IDirectPlay3 (and IDirectPlay3A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay3 -DECLARE_INTERFACE_( IDirectPlay3, IDirectPlay2 ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - /*** IDirectPlay3 methods ***/ - STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; - STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; - STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; - STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; - STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; - STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; - STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; - STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; - STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; - STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay3 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay3_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay3_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) - -#else /* C++ */ - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay3_AddRef(p) (p)->AddRef() -#define IDirectPlay3_Release(p) (p)->Release() -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay3_Close(p) (p)->Close() -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay3_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay3_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) - -#endif - -/**************************************************************************** - * - * IDirectPlay4 (and IDirectPlay4A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay4 -DECLARE_INTERFACE_( IDirectPlay4, IDirectPlay3 ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - /*** IDirectPlay3 methods ***/ - STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; - STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; - STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; - STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; - STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; - STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; - STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; - STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; - STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; - STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; - /*** IDirectPlay4 methods ***/ - STDMETHOD(GetGroupOwner) (THIS_ DPID, LPDPID) PURE; - STDMETHOD(SetGroupOwner) (THIS_ DPID, DPID) PURE; - STDMETHOD(SendEx) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD, DWORD, DWORD, LPVOID, DWORD_PTR *) PURE; - STDMETHOD(GetMessageQueue) (THIS_ DPID, DPID, DWORD, LPDWORD, LPDWORD) PURE; - STDMETHOD(CancelMessage) (THIS_ DWORD, DWORD) PURE; - STDMETHOD(CancelPriority) (THIS_ DWORD, DWORD, DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlayX interface macros (for IDirectPlay4 and beyond) - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlayX_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayX_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayX_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlayX_CancelMessage(p,a,b) (p)->lpVtbl->CancelMessage(p,a,b) -#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->lpVtbl->CancelPriority(p,a,b,c) -#define IDirectPlayX_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlayX_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlayX_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlayX_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlayX_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->lpVtbl->GetMessageQueue(p,a,b,c,d,e) -#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlayX_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlayX_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->SendEx(p,a,b,c,d,e,f,g,h,i) -#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) -#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) -#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) -#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) -#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) -#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) -#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) -#define IDirectPlayX_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) -#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) -#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) -#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) -#define IDirectPlayX_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) -#define IDirectPlayX_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) -#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) -#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) -#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->lpVtbl->GetGroupOwner(p,a,b) -#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->lpVtbl->SetGroupOwner(p,a,b) - -#else /* C++ */ - -#define IDirectPlayX_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayX_AddRef(p) (p)->AddRef() -#define IDirectPlayX_Release(p) (p)->Release() -#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlayX_CancelMessage(p,a,b) (p)->CancelMessage(a,b) -#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->CancelPriority(a,b,c) -#define IDirectPlayX_Close(p) (p)->Close() -#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlayX_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlayX_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlayX_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlayX_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->GetMessageQueue(a,b,c,d,e) -#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlayX_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlayX_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->SendEx(a,b,c,d,e,f,g,h,i) -#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) -#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) -#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) -#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) -#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) -#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) -#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) -#define IDirectPlayX_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) -#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) -#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) -#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) -#define IDirectPlayX_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) -#define IDirectPlayX_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) -#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) -#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) -#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->GetGroupOwner(a,b) -#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->SetGroupOwner(a,b) - -#endif - -/**************************************************************************** - * - * EnumConnections API flags - * - ****************************************************************************/ - -/* - * Enumerate Service Providers - */ -#define DPCONNECTION_DIRECTPLAY 0x00000001 - -/* - * Enumerate Lobby Providers - */ -#define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002 - - -/**************************************************************************** - * - * EnumPlayers API flags - * - ****************************************************************************/ - -/* - * Enumerate all players in the current session - */ -#define DPENUMPLAYERS_ALL 0x00000000 -#define DPENUMGROUPS_ALL DPENUMPLAYERS_ALL - - -/* - * Enumerate only local (created by this application) players - * or groups - */ -#define DPENUMPLAYERS_LOCAL 0x00000008 -#define DPENUMGROUPS_LOCAL DPENUMPLAYERS_LOCAL - -/* - * Enumerate only remote (non-local) players - * or groups - */ -#define DPENUMPLAYERS_REMOTE 0x00000010 -#define DPENUMGROUPS_REMOTE DPENUMPLAYERS_REMOTE - -/* - * Enumerate groups along with the players - */ -#define DPENUMPLAYERS_GROUP 0x00000020 - -/* - * Enumerate players or groups in another session - * (must supply lpguidInstance) - */ -#define DPENUMPLAYERS_SESSION 0x00000080 -#define DPENUMGROUPS_SESSION DPENUMPLAYERS_SESSION - -/* - * Enumerate server players - */ -#define DPENUMPLAYERS_SERVERPLAYER 0x00000100 - -/* - * Enumerate spectator players - */ -#define DPENUMPLAYERS_SPECTATOR 0x00000200 - -/* - * Enumerate shortcut groups - */ -#define DPENUMGROUPS_SHORTCUT 0x00000400 - -/* - * Enumerate staging area groups - */ -#define DPENUMGROUPS_STAGINGAREA 0x00000800 - -/* - * Enumerate hidden groups - */ -#define DPENUMGROUPS_HIDDEN 0x00001000 - -/* - * Enumerate the group's owner - */ -#define DPENUMPLAYERS_OWNER 0x00002000 - - -/**************************************************************************** - * - * CreatePlayer API flags - * - ****************************************************************************/ - -/* - * This flag indicates that this player should be designated - * the server player. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER - -/* - * This flag indicates that this player should be designated - * a spectator. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR - -/* - * This flag indicates that this player was created locally. - * (returned from GetPlayerFlags) - */ -#define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL - -/* - * This flag indicates that this player is the group's owner - * (Only returned in EnumGroupPlayers) - */ -#define DPPLAYER_OWNER DPENUMPLAYERS_OWNER - -/**************************************************************************** - * - * CreateGroup API flags - * - ****************************************************************************/ - - -/* - * This flag indicates that the StartSession can be called on the group. - * The app should specify this at CreateGroup, or CreateGroupInGroup. - */ -#define DPGROUP_STAGINGAREA DPENUMGROUPS_STAGINGAREA - -/* - * This flag indicates that this group was created locally. - * (returned from GetGroupFlags) - */ -#define DPGROUP_LOCAL DPENUMGROUPS_LOCAL - -/* - * This flag indicates that this group was created hidden. - */ -#define DPGROUP_HIDDEN DPENUMGROUPS_HIDDEN - - -/**************************************************************************** - * - * EnumSessions API flags - * - ****************************************************************************/ - -/* - * Enumerate sessions which can be joined - */ -#define DPENUMSESSIONS_AVAILABLE 0x00000001 - -/* - * Enumerate all sessions even if they can't be joined. - */ -#define DPENUMSESSIONS_ALL 0x00000002 - - -/* - * Start an asynchronous enum sessions - */ - #define DPENUMSESSIONS_ASYNC 0x00000010 - -/* - * Stop an asynchronous enum sessions - */ - #define DPENUMSESSIONS_STOPASYNC 0x00000020 - -/* - * Enumerate sessions even if they require a password - */ - #define DPENUMSESSIONS_PASSWORDREQUIRED 0x00000040 - -/* - * Return status about progress of enumeration instead of - * showing any status dialogs. - */ - #define DPENUMSESSIONS_RETURNSTATUS 0x00000080 - -/**************************************************************************** - * - * GetCaps and GetPlayerCaps API flags - * - ****************************************************************************/ - -/* - * The latency returned should be for guaranteed message sending. - * Default is non-guaranteed messaging. - */ -#define DPGETCAPS_GUARANTEED 0x00000001 - - -/**************************************************************************** - * - * GetGroupData, GetPlayerData API flags - * Remote and local Group/Player data is maintained separately. - * Default is DPGET_REMOTE. - * - ****************************************************************************/ - -/* - * Get the remote data (set by any DirectPlay object in - * the session using DPSET_REMOTE) - */ -#define DPGET_REMOTE 0x00000000 - -/* - * Get the local data (set by this DirectPlay object - * using DPSET_LOCAL) - */ -#define DPGET_LOCAL 0x00000001 - - -/**************************************************************************** - * - * Open API flags - * - ****************************************************************************/ - -/* - * Join the session that is described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_JOIN 0x00000001 - -/* - * Create a new session as described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_CREATE 0x00000002 - -/* - * Return status about progress of open instead of showing - * any status dialogs. - */ - #define DPOPEN_RETURNSTATUS DPENUMSESSIONS_RETURNSTATUS - - -/**************************************************************************** - * - * DPLCONNECTION flags - * - ****************************************************************************/ - -/* - * This application should create a new session as - * described by the DPSESIONDESC structure - */ -#define DPLCONNECTION_CREATESESSION DPOPEN_CREATE - -/* - * This application should join the session described by - * the DPSESIONDESC structure with the lpAddress data - */ -#define DPLCONNECTION_JOINSESSION DPOPEN_JOIN - -/**************************************************************************** - * - * Receive API flags - * Default is DPRECEIVE_ALL - * - ****************************************************************************/ - -/* - * Get the first message in the queue - */ -#define DPRECEIVE_ALL 0x00000001 - -/* - * Get the first message in the queue directed to a specific player - */ -#define DPRECEIVE_TOPLAYER 0x00000002 - -/* - * Get the first message in the queue from a specific player - */ -#define DPRECEIVE_FROMPLAYER 0x00000004 - -/* - * Get the message but don't remove it from the queue - */ -#define DPRECEIVE_PEEK 0x00000008 - - -/**************************************************************************** - * - * Send API flags - * - ****************************************************************************/ - -/* - * Send the message using a guaranteed send method. - * Default is non-guaranteed. - */ -#define DPSEND_GUARANTEED 0x00000001 - - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_HIGHPRIORITY 0x00000002 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_OPENSTREAM 0x00000008 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_CLOSESTREAM 0x00000010 - -/* - * Send the message digitally signed to ensure authenticity. - */ -#define DPSEND_SIGNED 0x00000020 - -/* - * Send the message with encryption to ensure privacy. - */ -#define DPSEND_ENCRYPTED 0x00000040 - -/* - * The message is a lobby system message - */ -#define DPSEND_LOBBYSYSTEMMESSAGE 0x00000080 - - -/* - * Send message asynchronously, must check caps - * before using this flag. It is always provided - * if the protocol flag is set. - */ -#define DPSEND_ASYNC 0x00000200 - -/* - * When an message is completed, don't tell me. - * by default the application is notified with a system message. - */ -#define DPSEND_NOSENDCOMPLETEMSG 0x00000400 - - -/* - * Maximum priority for sends available to applications - */ -#define DPSEND_MAX_PRI 0x0000FFFF -#define DPSEND_MAX_PRIORITY DPSEND_MAX_PRI - - -/**************************************************************************** - * - * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName, - * SetSessionDesc API flags. - * Default is DPSET_REMOTE. - * - ****************************************************************************/ - -/* - * Propagate the data to all players in the session - */ -#define DPSET_REMOTE 0x00000000 - -/* - * Do not propagate the data to other players - */ -#define DPSET_LOCAL 0x00000001 - -/* - * Used with DPSET_REMOTE, use guaranteed message send to - * propagate the data - */ -#define DPSET_GUARANTEED 0x00000002 - -/**************************************************************************** - * - * GetMessageQueue API flags. - * Default is DPMESSAGEQUEUE_SEND - * - ****************************************************************************/ - -/* - * Get Send Queue - requires Service Provider Support - */ -#define DPMESSAGEQUEUE_SEND 0x00000001 - -/* - * Get Receive Queue - */ -#define DPMESSAGEQUEUE_RECEIVE 0x00000002 - - -/**************************************************************************** - * - * Connect API flags - * - ****************************************************************************/ - - -/* - * Start an asynchronous connect which returns status codes - */ -#define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS) - - -/**************************************************************************** - * - * DirectPlay system messages and message data structures - * - * All system message come 'From' player DPID_SYSMSG. To determine what type - * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check - * the dwType member against one of the following DPSYS_xxx constants. Once - * a match is found, cast the lpData to the corresponding of the DPMSG_xxx - * structures to access the data of the message. - * - ****************************************************************************/ - -/* - * A new player or group has been created in the session - * Use DPMSG_CREATEPLAYERORGROUP. Check dwPlayerType to see if it - * is a player or a group. - */ -#define DPSYS_CREATEPLAYERORGROUP 0x0003 - -/* - * A player has been deleted from the session - * Use DPMSG_DESTROYPLAYERORGROUP - */ -#define DPSYS_DESTROYPLAYERORGROUP 0x0005 - -/* - * A player has been added to a group - * Use DPMSG_ADDPLAYERTOGROUP - */ -#define DPSYS_ADDPLAYERTOGROUP 0x0007 - -/* - * A player has been removed from a group - * Use DPMSG_DELETEPLAYERFROMGROUP - */ -#define DPSYS_DELETEPLAYERFROMGROUP 0x0021 - -/* - * This DirectPlay object lost its connection with all the - * other players in the session. - * Use DPMSG_SESSIONLOST. - */ -#define DPSYS_SESSIONLOST 0x0031 - -/* - * The current host has left the session. - * This DirectPlay object is now the host. - * Use DPMSG_HOST. - */ -#define DPSYS_HOST 0x0101 - -/* - * The remote data associated with a player or - * group has changed. Check dwPlayerType to see - * if it is a player or a group - * Use DPMSG_SETPLAYERORGROUPDATA - */ -#define DPSYS_SETPLAYERORGROUPDATA 0x0102 - -/* - * The name of a player or group has changed. - * Check dwPlayerType to see if it is a player - * or a group. - * Use DPMSG_SETPLAYERORGROUPNAME - */ -#define DPSYS_SETPLAYERORGROUPNAME 0x0103 - -/* - * The session description has changed. - * Use DPMSG_SETSESSIONDESC - */ -#define DPSYS_SETSESSIONDESC 0x0104 - -/* - * A group has been added to a group - * Use DPMSG_ADDGROUPTOGROUP - */ -#define DPSYS_ADDGROUPTOGROUP 0x0105 - -/* - * A group has been removed from a group - * Use DPMSG_DELETEGROUPFROMGROUP - */ -#define DPSYS_DELETEGROUPFROMGROUP 0x0106 - -/* - * A secure player-player message has arrived. - * Use DPMSG_SECUREMESSAGE - */ -#define DPSYS_SECUREMESSAGE 0x0107 - -/* - * Start a new session. - * Use DPMSG_STARTSESSION - */ -#define DPSYS_STARTSESSION 0x0108 - -/* - * A chat message has arrived - * Use DPMSG_CHAT - */ -#define DPSYS_CHAT 0x0109 - -/* - * The owner of a group has changed - * Use DPMSG_SETGROUPOWNER - */ -#define DPSYS_SETGROUPOWNER 0x010A - -/* - * An async send has finished, failed or been cancelled - * Use DPMSG_SENDCOMPLETE - */ -#define DPSYS_SENDCOMPLETE 0x010d - - -/* - * Used in the dwPlayerType field to indicate if it applies to a group - * or a player - */ -#define DPPLAYERTYPE_GROUP 0x00000000 -#define DPPLAYERTYPE_PLAYER 0x00000001 - - -/* - * DPMSG_GENERIC - * Generic message structure used to identify the message type. - */ -typedef struct -{ - DWORD dwType; // Message type -} DPMSG_GENERIC, FAR *LPDPMSG_GENERIC; - -/* - * DPMSG_CREATEPLAYERORGROUP - * System message generated when a new player or group - * created in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of the player or group - DWORD dwCurrentPlayers; // current # players & groups in session - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data - DPNAME dpnName; // structure with name info - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP; - -/* - * DPMSG_DESTROYPLAYERORGROUP - * System message generated when a player or group is being - * destroyed in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // player ID being deleted - LPVOID lpLocalData; // copy of players local data - DWORD dwLocalDataSize; // sizeof local data - LPVOID lpRemoteData; // copy of players remote data - DWORD dwRemoteDataSize; // sizeof remote data - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPNAME dpnName; // structure with name info - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP; - -/* - * DPMSG_ADDPLAYERTOGROUP - * System message generated when a player is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdGroup; // group ID being added to - DPID dpIdPlayer; // player ID being added -} DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP; - -/* - * DPMSG_DELETEPLAYERFROMGROUP - * System message generated when a player is being - * removed from a group - */ -typedef DPMSG_ADDPLAYERTOGROUP DPMSG_DELETEPLAYERFROMGROUP; -typedef DPMSG_DELETEPLAYERFROMGROUP FAR *LPDPMSG_DELETEPLAYERFROMGROUP; - -/* - * DPMSG_ADDGROUPTOGROUP - * System message generated when a group is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdParentGroup; // group ID being added to - DPID dpIdGroup; // group ID being added -} DPMSG_ADDGROUPTOGROUP, FAR *LPDPMSG_ADDGROUPTOGROUP; - -/* - * DPMSG_DELETEGROUPFROMGROUP - * System message generated when a GROUP is being - * removed from a group - */ -typedef DPMSG_ADDGROUPTOGROUP DPMSG_DELETEGROUPFROMGROUP; -typedef DPMSG_DELETEGROUPFROMGROUP FAR *LPDPMSG_DELETEGROUPFROMGROUP; - -/* - * DPMSG_SETPLAYERORGROUPDATA - * System message generated when remote data for a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data -} DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA; - -/* - * DPMSG_SETPLAYERORGROUPNAME - * System message generated when the name of a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - DPNAME dpnName; // structure with new name info -} DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME; - -/* - * DPMSG_SETSESSIONDESC - * System message generated when session desc has changed - */ -typedef struct -{ - DWORD dwType; // Message type - DPSESSIONDESC2 dpDesc; // Session desc -} DPMSG_SETSESSIONDESC, FAR *LPDPMSG_SETSESSIONDESC; - -/* - * DPMSG_HOST - * System message generated when the host has migrated to this - * DirectPlay object. - * - */ -typedef DPMSG_GENERIC DPMSG_HOST; -typedef DPMSG_HOST FAR *LPDPMSG_HOST; - -/* - * DPMSG_SESSIONLOST - * System message generated when the connection to the session is lost. - * - */ -typedef DPMSG_GENERIC DPMSG_SESSIONLOST; -typedef DPMSG_SESSIONLOST FAR *LPDPMSG_SESSIONLOST; - -/* - * DPMSG_SECUREMESSAGE - * System message generated when a player requests a secure send - */ -typedef struct -{ - DWORD dwType; // Message Type - DWORD dwFlags; // Signed/Encrypted - DPID dpIdFrom; // ID of Sending Player - LPVOID lpData; // Player message - DWORD dwDataSize; // Size of player message -} DPMSG_SECUREMESSAGE, FAR *LPDPMSG_SECUREMESSAGE; - -/* - * DPMSG_STARTSESSION - * System message containing all information required to - * start a new session - */ -typedef struct -{ - DWORD dwType; // Message type - LPDPLCONNECTION lpConn; // DPLCONNECTION structure -} DPMSG_STARTSESSION, FAR *LPDPMSG_STARTSESSION; - -/* - * DPMSG_CHAT - * System message containing a chat message - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwFlags; // Message flags - DPID idFromPlayer; // ID of the Sending Player - DPID idToPlayer; // ID of the To Player - DPID idToGroup; // ID of the To Group - LPDPCHAT lpChat; // Pointer to a structure containing the chat message -} DPMSG_CHAT, FAR *LPDPMSG_CHAT; - -/* - * DPMSG_SETGROUPOWNER - * System message generated when the owner of a group has changed - */ -typedef struct -{ - DWORD dwType; // Message type - DPID idGroup; // ID of the group - DPID idNewOwner; // ID of the player that is the new owner - DPID idOldOwner; // ID of the player that used to be the owner -} DPMSG_SETGROUPOWNER, FAR *LPDPMSG_SETGROUPOWNER; - -/* - * DPMSG_SENDCOMPLETE - * System message generated when finished with an Async Send message - * - * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't - * change this message w/o changing SENDPARMS. - */ -typedef struct -{ - DWORD dwType; - DPID idFrom; - DPID idTo; - DWORD dwFlags; - DWORD dwPriority; - DWORD dwTimeout; - LPVOID lpvContext; - DWORD dwMsgID; - HRESULT hr; - DWORD dwSendTime; -} DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE; - -/**************************************************************************** - * - * DIRECTPLAY ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ -#define DP_OK S_OK -#define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 ) -#define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 ) -#define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 ) -#define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 ) -#define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 ) -#define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 ) -#define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 ) -#define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 ) -#define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 ) -#define DPERR_EXCEPTION MAKE_DPHRESULT( 90 ) -#define DPERR_GENERIC E_FAIL -#define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 ) -#define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 ) -#define DPERR_INVALIDPARAM E_INVALIDARG -#define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM -#define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 ) -#define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 ) -#define DPERR_NOCAPS MAKE_DPHRESULT( 160 ) -#define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 ) -#define DPERR_NOMEMORY E_OUTOFMEMORY -#define DPERR_OUTOFMEMORY DPERR_NOMEMORY -#define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 ) -#define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 ) -#define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 ) -#define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 ) -#define DPERR_PENDING E_PENDING -#define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 ) -#define DPERR_TIMEOUT MAKE_DPHRESULT( 240 ) -#define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 ) -#define DPERR_UNSUPPORTED E_NOTIMPL -#define DPERR_BUSY MAKE_DPHRESULT( 270 ) -#define DPERR_USERCANCEL MAKE_DPHRESULT( 280 ) -#define DPERR_NOINTERFACE E_NOINTERFACE -#define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 ) -#define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 ) -#define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 ) -#define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 ) -#define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 ) -#define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 ) -#define DPERR_CONNECTING MAKE_DPHRESULT( 350 ) -#define DPERR_CONNECTIONLOST MAKE_DPHRESULT( 360 ) -#define DPERR_UNKNOWNMESSAGE MAKE_DPHRESULT( 370 ) -#define DPERR_CANCELFAILED MAKE_DPHRESULT( 380 ) -#define DPERR_INVALIDPRIORITY MAKE_DPHRESULT( 390 ) -#define DPERR_NOTHANDLED MAKE_DPHRESULT( 400 ) -#define DPERR_CANCELLED MAKE_DPHRESULT( 410 ) -#define DPERR_ABORTED MAKE_DPHRESULT( 420 ) - - -#define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 ) -#define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 ) -#define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 ) -#define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 ) -#define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 ) -#define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 ) -#define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 ) -#define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 ) -#define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 ) -#define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 ) - -// -// Security related errors -// -#define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 ) -#define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 ) -#define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 ) -#define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 ) -#define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 ) -#define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 ) -#define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 ) -#define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 ) -#define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 ) - - -/**************************************************************************** - * - * dplay 1.0 obsolete structures + interfaces - * Included for compatibility only. New apps should - * use IDirectPlay2 - * - ****************************************************************************/ - -// define this to ignore obsolete interfaces and constants -#ifndef IDIRECTPLAY2_OR_GREATER - -#define DPOPEN_OPENSESSION DPOPEN_JOIN -#define DPOPEN_CREATESESSION DPOPEN_CREATE - -#define DPENUMSESSIONS_PREVIOUS 0x00000004 - -#define DPENUMPLAYERS_PREVIOUS 0x00000004 - -#define DPSEND_GUARANTEE DPSEND_GUARANTEED -#define DPSEND_TRYONCE 0x00000004 - -#define DPCAPS_NAMESERVICE 0x00000001 -#define DPCAPS_NAMESERVER DPCAPS_ISHOST -#define DPCAPS_GUARANTEED 0x00000004 - -#define DPLONGNAMELEN 52 -#define DPSHORTNAMELEN 20 -#define DPSESSIONNAMELEN 32 -#define DPPASSWORDLEN 16 -#define DPUSERRESERVED 16 - -#define DPSYS_ADDPLAYER 0x0003 -#define DPSYS_DELETEPLAYER 0x0005 - -#define DPSYS_DELETEGROUP 0x0020 -#define DPSYS_DELETEPLAYERFROMGRP 0x0021 -#define DPSYS_CONNECT 0x484b - -typedef struct -{ - DWORD dwType; - DWORD dwPlayerType; - DPID dpId; - char szLongName[DPLONGNAMELEN]; - char szShortName[DPSHORTNAMELEN]; - DWORD dwCurrentPlayers; -} DPMSG_ADDPLAYER; - -typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP; - -typedef struct -{ - DWORD dwType; - DPID dpIdGroup; - DPID dpIdPlayer; -} DPMSG_GROUPADD; - -typedef DPMSG_GROUPADD DPMSG_GROUPDELETE; -typedef struct -{ - DWORD dwType; - DPID dpId; -} DPMSG_DELETEPLAYER; - -typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)( - DPID dpId, - LPSTR lpFriendlyName, - LPSTR lpFormalName, - DWORD dwFlags, - LPVOID lpContext ); - -typedef struct -{ - DWORD dwSize; - GUID guidSession; - DWORD_PTR dwSession; - DWORD dwMaxPlayers; - DWORD dwCurrentPlayers; - DWORD dwFlags; - char szSessionName[DPSESSIONNAMELEN]; - char szUserField[DPUSERRESERVED]; - DWORD_PTR dwReserved1; - char szPassword[DPPASSWORDLEN]; - DWORD_PTR dwReserved2; - DWORD_PTR dwUser1; - DWORD_PTR dwUser2; - DWORD_PTR dwUser3; - DWORD_PTR dwUser4; -} DPSESSIONDESC,*LPDPSESSIONDESC; - -typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)( - LPDPSESSIONDESC lpDPSessionDesc, - LPVOID lpContext, - LPDWORD lpdwTimeOut, - DWORD dwFlags); - -/* - * IDirectPlay - */ -#undef INTERFACE -#define INTERFACE IDirectPlay -DECLARE_INTERFACE_( IDirectPlay, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPSTR,LPSTR) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(EnableNewPlayers) (THIS_ BOOL) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID, LPDPCAPS) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(SaveSession) (THIS_ LPSTR) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPSTR,LPSTR) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->lpVtbl->CreateGroup(p,a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->lpVtbl->CreatePlayer(p,a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->lpVtbl->EnableNewPlayers(p,a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->lpVtbl->GetPlayerCaps(p,a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay_Open(p,a) (p)->lpVtbl->Open(p,a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->lpVtbl->SaveSession(p,a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay_Close(p) (p)->Close() -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->CreateGroup(a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->CreatePlayer(a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->EnableNewPlayers(a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->EnumGroupPlayers(a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->GetPlayerCaps(a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->GetPlayerName(a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay_Open(p,a) (p)->Open(a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->SaveSession(a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) - -#endif - -DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72); - -#endif // IDIRECTPLAY2_OR_GREATER - -/**************************************************************************** - * - * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag) - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay_Release(p) (p)->lpVtbl->Release(p) - -#else - -#define IDirectPlay_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay_AddRef(p) (p)->AddRef() -#define IDirectPlay_Release(p) (p)->Release() - -#endif // IDirectPlay interface macros - -#ifdef __cplusplus -}; -#endif - -#pragma warning(default:4201) - -#endif - diff --git a/import/DirectX8/include/dplay8.h b/import/DirectX8/include/dplay8.h deleted file mode 100644 index 930fce906..000000000 --- a/import/DirectX8/include/dplay8.h +++ /dev/null @@ -1,1189 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1998-2000 Microsoft Corporation. All Rights Reserved. - * - * File: DPlay8.h - * Content: DirectPlay8 include file - * - ***************************************************************************/ - -#ifndef __DIRECTPLAY8_H__ -#define __DIRECTPLAY8_H__ - -#include // for DECLARE_INTERFACE and HRESULT - -#include "dpaddr.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/**************************************************************************** - * - * DirectPlay8 CLSIDs - * - ****************************************************************************/ - -// {743F1DC6-5ABA-429f-8BDF-C54D03253DC2} -DEFINE_GUID(CLSID_DirectPlay8Client, -0x743f1dc6, 0x5aba, 0x429f, 0x8b, 0xdf, 0xc5, 0x4d, 0x3, 0x25, 0x3d, 0xc2); - -// {286F484D-375E-4458-A272-B138E2F80A6A} -DEFINE_GUID(CLSID_DirectPlay8Peer, -0x286f484d, 0x375e, 0x4458, 0xa2, 0x72, 0xb1, 0x38, 0xe2, 0xf8, 0xa, 0x6a); - -// {DA825E1B-6830-43d7-835D-0B5AD82956A2} -DEFINE_GUID(CLSID_DirectPlay8Server, -0xda825e1b, 0x6830, 0x43d7, 0x83, 0x5d, 0xb, 0x5a, 0xd8, 0x29, 0x56, 0xa2); - - -/**************************************************************************** - * - * DirectPlay8 Interface IIDs - * - ****************************************************************************/ - -// {5102DACD-241B-11d3-AEA7-006097B01411} -DEFINE_GUID(IID_IDirectPlay8Client, -0x5102dacd, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {5102DACF-241B-11d3-AEA7-006097B01411} -DEFINE_GUID(IID_IDirectPlay8Peer, -0x5102dacf, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {5102DACE-241B-11d3-AEA7-006097B01411} -DEFINE_GUID(IID_IDirectPlay8Server, -0x5102dace, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -/**************************************************************************** - * - * DirectPlay8 Service Provider GUIDs - * - ****************************************************************************/ - -// {53934290-628D-11D2-AE0F-006097B01411} -DEFINE_GUID(CLSID_DP8SP_IPX, 0x53934290, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {6D4A3650-628D-11D2-AE0F-006097B01411} -DEFINE_GUID(CLSID_DP8SP_MODEM, 0x6d4a3650, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {743B5D60-628D-11D2-AE0F-006097B01411} -DEFINE_GUID(CLSID_DP8SP_SERIAL, 0x743b5d60, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {EBFE7BA0-628D-11D2-AE0F-006097B01411} -DEFINE_GUID(CLSID_DP8SP_TCPIP, 0xebfe7ba0, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -/**************************************************************************** - * - * DirectPlay8 Interface Pointer definitions - * - ****************************************************************************/ - -typedef struct IDirectPlay8Peer *PDIRECTPLAY8PEER; -typedef struct IDirectPlay8Server *PDIRECTPLAY8SERVER; -typedef struct IDirectPlay8Client *PDIRECTPLAY8CLIENT; - -/**************************************************************************** - * - * DirectPlay8 Forward Declarations For External Types - * - ****************************************************************************/ - -typedef struct IDirectPlay8LobbiedApplication *PDNLOBBIEDAPPLICATION; -typedef struct IDirectPlay8Address IDirectPlay8Address; - -/**************************************************************************** - * - * DirectPlay8 Callback Functions - * - ****************************************************************************/ - -// -// Callback Function Type Definition -// -typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)(PVOID,DWORD,PVOID); - -/**************************************************************************** - * - * DirectPlay8 Datatypes (Non-Structure / Non-Message) - * - ****************************************************************************/ - -// -// Player IDs. Used to uniquely identify a player in a session -// -typedef DWORD DPNID, *PDPNID; - -// -// Used as identifiers for operations -// -typedef DWORD DPNHANDLE, *PDPNHANDLE; - -/**************************************************************************** - * - * DirectPlay8 Message Identifiers - * - ****************************************************************************/ - -#define DPN_MSGID_OFFSET 0xFFFF0000 -#define DPN_MSGID_ADD_PLAYER_TO_GROUP ( DPN_MSGID_OFFSET | 0x0001 ) -#define DPN_MSGID_APPLICATION_DESC ( DPN_MSGID_OFFSET | 0x0002 ) -#define DPN_MSGID_ASYNC_OP_COMPLETE ( DPN_MSGID_OFFSET | 0x0003 ) -#define DPN_MSGID_CLIENT_INFO ( DPN_MSGID_OFFSET | 0x0004 ) -#define DPN_MSGID_CONNECT_COMPLETE ( DPN_MSGID_OFFSET | 0x0005 ) -#define DPN_MSGID_CREATE_GROUP ( DPN_MSGID_OFFSET | 0x0006 ) -#define DPN_MSGID_CREATE_PLAYER ( DPN_MSGID_OFFSET | 0x0007 ) -#define DPN_MSGID_DESTROY_GROUP ( DPN_MSGID_OFFSET | 0x0008 ) -#define DPN_MSGID_DESTROY_PLAYER ( DPN_MSGID_OFFSET | 0x0009 ) -#define DPN_MSGID_ENUM_HOSTS_QUERY ( DPN_MSGID_OFFSET | 0x000a ) -#define DPN_MSGID_ENUM_HOSTS_RESPONSE ( DPN_MSGID_OFFSET | 0x000b ) -#define DPN_MSGID_GROUP_INFO ( DPN_MSGID_OFFSET | 0x000c ) -#define DPN_MSGID_HOST_MIGRATE ( DPN_MSGID_OFFSET | 0x000d ) -#define DPN_MSGID_INDICATE_CONNECT ( DPN_MSGID_OFFSET | 0x000e ) -#define DPN_MSGID_INDICATED_CONNECT_ABORTED ( DPN_MSGID_OFFSET | 0x000f ) -#define DPN_MSGID_PEER_INFO ( DPN_MSGID_OFFSET | 0x0010 ) -#define DPN_MSGID_RECEIVE ( DPN_MSGID_OFFSET | 0x0011 ) -#define DPN_MSGID_REMOVE_PLAYER_FROM_GROUP ( DPN_MSGID_OFFSET | 0x0012 ) -#define DPN_MSGID_RETURN_BUFFER ( DPN_MSGID_OFFSET | 0x0013 ) -#define DPN_MSGID_SEND_COMPLETE ( DPN_MSGID_OFFSET | 0x0014 ) -#define DPN_MSGID_SERVER_INFO ( DPN_MSGID_OFFSET | 0x0015 ) -#define DPN_MSGID_TERMINATE_SESSION ( DPN_MSGID_OFFSET | 0x0016 ) - -/**************************************************************************** - * - * DirectPlay8 Constants - * - ****************************************************************************/ - -#define DPNID_ALL_PLAYERS_GROUP 0 - -// -// DESTROY_GROUP reasons -// -#define DPNDESTROYGROUPREASON_NORMAL 0x0001 -#define DPNDESTROYGROUPREASON_AUTODESTRUCTED 0x0002 -#define DPNDESTROYGROUPREASON_SESSIONTERMINATED 0x0003 - -// -// DESTROY_PLAYER reasons -// -#define DPNDESTROYPLAYERREASON_NORMAL 0x0001 -#define DPNDESTROYPLAYERREASON_CONNECTIONLOST 0x0002 -#define DPNDESTROYPLAYERREASON_SESSIONTERMINATED 0x0003 -#define DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER 0x0004 - -/**************************************************************************** - * - * DirectPlay8 Flags - * - ****************************************************************************/ - -// -// Asynchronous operation flags (For Async Ops) -// -#define DPNOP_SYNC 0x80000000 - -// -// Add player to group flags (For AddPlayerToGroup) -// -#define DPNADDPLAYERTOGROUP_SYNC DPNOP_SYNC - -// -// Cancel flags -// -#define DPNCANCEL_CONNECT 0x0001 -#define DPNCANCEL_ENUM 0x0002 -#define DPNCANCEL_SEND 0x0004 -#define DPNCANCEL_ALL_OPERATIONS 0x8000 - -// -// Connect flags (For Connect) -// -#define DPNCONNECT_SYNC DPNOP_SYNC -#define DPNCONNECT_OKTOQUERYFORADDRESSING 0x0001 - -// -// Create group flags (For CreateGroup) -// -#define DPNCREATEGROUP_SYNC DPNOP_SYNC - -// -// Destroy group flags (For DestroyGroup) -// -#define DPNDESTROYGROUP_SYNC DPNOP_SYNC - -// -// Enumerate clients and groups flags (For EnumPlayersAndGroups) -// -#define DPNENUM_PLAYERS 0x0001 -#define DPNENUM_GROUPS 0x0010 - -// -// Enum hosts flags (For EnumHosts) -// -#define DPNENUMHOSTS_SYNC DPNOP_SYNC -#define DPNENUMHOSTS_OKTOQUERYFORADDRESSING 0x0001 -#define DPNENUMHOSTS_NOBROADCASTFALLBACK 0x0002 - -// -// Enum service provider flags (For EnumSP) -// -#define DPNENUMSERVICEPROVIDERS_ALL 0x0001 - -// -// Get send queue info flags (For GetSendQueueInfo) -// -#define DPNGETSENDQUEUEINFO_PRIORITY_NORMAL 0x0001 -#define DPNGETSENDQUEUEINFO_PRIORITY_HIGH 0x0002 -#define DPNGETSENDQUEUEINFO_PRIORITY_LOW 0x0004 - -// -// Group information flags (For Group Info) -// -#define DPNGROUP_AUTODESTRUCT 0x0001 - -// -// Host flags (For Host) -// -#define DPNHOST_OKTOQUERYFORADDRESSING 0x0001 - -// -// Set info -// -#define DPNINFO_NAME 0x0001 -#define DPNINFO_DATA 0x0002 - -// -// Initialize flags (For Initialize) -// -#define DPNINITIALIZE_DISABLEPARAMVAL 0x0001 - -// -// Register Lobby flags -// -#define DPNLOBBY_REGISTER 0x0001 -#define DPNLOBBY_UNREGISTER 0x0002 - -// -// Player information flags (For Player Info / Player Messages) -// -#define DPNPLAYER_LOCAL 0x0002 -#define DPNPLAYER_HOST 0x0004 - -// -// Remove player from group flags (For RemovePlayerFromGroup) -// -#define DPNREMOVEPLAYERFROMGROUP_SYNC DPNOP_SYNC - -// -// Send flags (For Send/SendTo) -// -#define DPNSEND_SYNC DPNOP_SYNC -#define DPNSEND_NOCOPY 0x0001 -#define DPNSEND_NOCOMPLETE 0x0002 -#define DPNSEND_COMPLETEONPROCESS 0x0004 -#define DPNSEND_GUARANTEED 0x0008 -#define DPNSEND_NONSEQUENTIAL 0x0010 -#define DPNSEND_NOLOOPBACK 0x0020 -#define DPNSEND_PRIORITY_LOW 0x0040 -#define DPNSEND_PRIORITY_HIGH 0x0080 - -// -// Session Flags (for DPN_APPLICATION_DESC) -// -#define DPNSESSION_CLIENT_SERVER 0x0001 -#define DPNSESSION_MIGRATE_HOST 0x0004 -#define DPNSESSION_NODPNSVR 0x0040 -#define DPNSESSION_REQUIREPASSWORD 0x0080 - -// -// Set client info flags (For SetClientInfo) -// -#define DPNSETCLIENTINFO_SYNC DPNOP_SYNC - -// -// Set group info flags (For SetGroupInfo) -// -#define DPNSETGROUPINFO_SYNC DPNOP_SYNC - -// -// Set peer info flags (For SetPeerInfo) -// -#define DPNSETPEERINFO_SYNC DPNOP_SYNC - -// -// Set server info flags (For SetServerInfo) -// -#define DPNSETSERVERINFO_SYNC DPNOP_SYNC - -// -// SP capabilities flags -// -#define DPNSPCAPS_SUPPORTSDPNSRV 0x0001 -#define DPNSPCAPS_SUPPORTSBROADCAST 0x0002 -#define DPNSPCAPS_SUPPORTSALLADAPTERS 0x0004 - -/**************************************************************************** - * - * DirectPlay8 Structures (Non-Message) - * - ****************************************************************************/ - -// -// Application description -// -typedef struct _DPN_APPLICATION_DESC -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags (DPNSESSION_...) - GUID guidInstance; // Instance GUID - GUID guidApplication; // Application GUID - DWORD dwMaxPlayers; // Maximum # of players allowed (0=no limit) - DWORD dwCurrentPlayers; // Current # of players allowed - WCHAR *pwszSessionName; // Name of the session - WCHAR *pwszPassword; // Password for the session - PVOID pvReservedData; - DWORD dwReservedDataSize; - PVOID pvApplicationReservedData; - DWORD dwApplicationReservedDataSize; -} DPN_APPLICATION_DESC, *PDPN_APPLICATION_DESC; - -// -// Generic Buffer Description -// -typedef struct _BUFFERDESC -{ - DWORD dwBufferSize; - BYTE * pBufferData; -} BUFFERDESC, DPN_BUFFER_DESC, *PDPN_BUFFER_DESC; - -typedef BUFFERDESC FAR * PBUFFERDESC; - -// -// DirectPlay8 capabilities -// -typedef struct _DPN_CAPS -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags - DWORD dwConnectTimeout; // ms before a connect request times out - DWORD dwConnectRetries; // # of times to attempt the connection - DWORD dwTimeoutUntilKeepAlive; // ms of inactivity before a keep alive is sent -} DPN_CAPS, *PDPN_CAPS; - -// Connection Statistics information - -typedef struct _DPN_CONNECTION_INFO -{ - DWORD dwSize; - DWORD dwRoundTripLatencyMS; - DWORD dwThroughputBPS; - DWORD dwPeakThroughputBPS; - - DWORD dwBytesSentGuaranteed; - DWORD dwPacketsSentGuaranteed; - DWORD dwBytesSentNonGuaranteed; - DWORD dwPacketsSentNonGuaranteed; - - DWORD dwBytesRetried; // Guaranteed only - DWORD dwPacketsRetried; // Guaranteed only - DWORD dwBytesDropped; // Non Guaranteed only - DWORD dwPacketsDropped; // Non Guaranteed only - - DWORD dwMessagesTransmittedHighPriority; - DWORD dwMessagesTimedOutHighPriority; - DWORD dwMessagesTransmittedNormalPriority; - DWORD dwMessagesTimedOutNormalPriority; - DWORD dwMessagesTransmittedLowPriority; - DWORD dwMessagesTimedOutLowPriority; - - DWORD dwBytesReceivedGuaranteed; - DWORD dwPacketsReceivedGuaranteed; - DWORD dwBytesReceivedNonGuaranteed; - DWORD dwPacketsReceivedNonGuaranteed; - DWORD dwMessagesReceived; - -} DPN_CONNECTION_INFO, *PDPN_CONNECTION_INFO; - - -// -// Group information strucutre -// -typedef struct _DPN_GROUP_INFO -{ - DWORD dwSize; // size of this structure - DWORD dwInfoFlags; // information contained - PWSTR pwszName; // Unicode Name - PVOID pvData; // data block - DWORD dwDataSize; // size in BYTES of data block - DWORD dwGroupFlags; // group flags (DPNGROUP_...) -} DPN_GROUP_INFO, *PDPN_GROUP_INFO; - -// -// Player information structure -// -typedef struct _DPN_PLAYER_INFO -{ - DWORD dwSize; // size of this structure - DWORD dwInfoFlags; // information contained - PWSTR pwszName; // Unicode Name - PVOID pvData; // data block - DWORD dwDataSize; // size in BYTES of data block - DWORD dwPlayerFlags; // player flags (DPNPLAYER_...) -} DPN_PLAYER_INFO, *PDPN_PLAYER_INFO; - -typedef struct _DPN_SECURITY_CREDENTIALS DPN_SECURITY_CREDENTIALS, *PDPN_SECURITY_CREDENTIALS; -typedef struct _DPN_SECURITY_DESC DPN_SECURITY_DESC, *PDPN_SECURITY_DESC; - -// -// Service provider & adapter enumeration structure -// -typedef struct _DPN_SERVICE_PROVIDER_INFO -{ - DWORD dwFlags; - GUID guid; // SP Guid - WCHAR *pwszName; // Friendly Name - PVOID pvReserved; - DWORD dwReserved; -} DPN_SERVICE_PROVIDER_INFO, *PDPN_SERVICE_PROVIDER_INFO; - -// -// Service provider caps structure -// -typedef struct _DPN_SP_CAPS -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags ((DPNSPCAPS_...) - DWORD dwNumThreads; // # of worker threads to use - DWORD dwDefaultEnumCount; // default # of enum requests - DWORD dwDefaultEnumRetryInterval; // default ms between enum requests - DWORD dwDefaultEnumTimeout; // default enum timeout - DWORD dwMaxEnumPayloadSize; // maximum size in bytes for enum payload data - DWORD dwBuffersPerThread; // number of receive buffers per thread - DWORD dwSystemBufferSize; // amount of buffering to do in addition to posted receive buffers -} DPN_SP_CAPS, *PDPN_SP_CAPS; - - -/**************************************************************************** - * - * IDirectPlay8 message handler call back structures - * - ****************************************************************************/ - -// -// Add player to group strucutre for message handler -// (DPN_MSGID_ADD_PLAYER_TO_GROUP) -// -typedef struct _DPNMSG_ADD_PLAYER_TO_GROUP -{ - DWORD dwSize; // Size of this structure - DPNID dpnidGroup; // DPNID of group - PVOID pvGroupContext; // Group context value - DPNID dpnidPlayer; // DPNID of added player - PVOID pvPlayerContext; // Player context value -} DPNMSG_ADD_PLAYER_TO_GROUP, *PDPNMSG_ADD_PLAYER_TO_GROUP; - -// -// Async operation completion structure for message handler -// (DPN_MSGID_ASYNC_OP_COMPLETE) -// -typedef struct _DPNMSG_ASYNC_OP_COMPLETE -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hAsyncOp; // DirectPlay8 async operation handle - PVOID pvUserContext; // User context supplied - HRESULT hResultCode; // HRESULT of operation -} DPNMSG_ASYNC_OP_COMPLETE, *PDPNMSG_ASYNC_OP_COMPLETE; - -// -// Client info structure for message handler -// (DPN_MSGID_CLIENT_INFO) -// -typedef struct _DPNMSG_CLIENT_INFO -{ - DWORD dwSize; // Size of this structure - DPNID dpnidClient; // DPNID of client - PVOID pvPlayerContext; // Player context value -} DPNMSG_CLIENT_INFO, *PDPNMSG_CLIENT_INFO; - -// -// Connect complete structure for message handler -// (DPN_MSGID_CONNECT_COMPLETE) -// -typedef struct _DPNMSG_CONNECT_COMPLETE -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle - PVOID pvUserContext; // User context supplied at Connect - HRESULT hResultCode; // HRESULT of connection attempt - PVOID pvApplicationReplyData; // Connection reply data from Host/Server - DWORD dwApplicationReplyDataSize; // Size (in bytes) of pvApplicationReplyData -} DPNMSG_CONNECT_COMPLETE, *PDPNMSG_CONNECT_COMPLETE; - -// -// Create group structure for message handler -// (DPN_MSGID_CREATE_GROUP) -// -typedef struct _DPNMSG_CREATE_GROUP -{ - DWORD dwSize; // Size of this structure - DPNID dpnidGroup; // DPNID of new group - DPNID dpnidOwner; // Owner of newgroup - PVOID pvGroupContext; // Group context value -} DPNMSG_CREATE_GROUP, *PDPNMSG_CREATE_GROUP; - -// -// Create player structure for message handler -// (DPN_MSGID_CREATE_PLAYER) -// -typedef struct _DPNMSG_CREATE_PLAYER -{ - DWORD dwSize; // Size of this structure - DPNID dpnidPlayer; // DPNID of new player - PVOID pvPlayerContext; // Player context value -} DPNMSG_CREATE_PLAYER, *PDPNMSG_CREATE_PLAYER; - -// -// Destroy group structure for message handler -// (DPN_MSGID_DESTROY_GROUP) -// -typedef struct _DPNMSG_DESTROY_GROUP -{ - DWORD dwSize; // Size of this structure - DPNID dpnidGroup; // DPNID of destroyed group - PVOID pvGroupContext; // Group context value - DWORD dwReason; // Information only -} DPNMSG_DESTROY_GROUP, *PDPNMSG_DESTROY_GROUP; - -// -// Destroy player structure for message handler -// (DPN_MSGID_DESTROY_PLAYER) -// -typedef struct _DPNMSG_DESTROY_PLAYER -{ - DWORD dwSize; // Size of this structure - DPNID dpnidPlayer; // DPNID of leaving player - PVOID pvPlayerContext; // Player context value - DWORD dwReason; // Information only -} DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER; - -// -// Enumeration request received structure for message handler -// (DPN_MSGID_ENUM_HOSTS_QUERY) -// -typedef struct _DPNMSG_ENUM_HOSTS_QUERY -{ - DWORD dwSize; // Size of this structure. - IDirectPlay8Address *pAddressSender; // Address of client who sent the request - IDirectPlay8Address *pAddressDevice; // Address of device request was received on - PVOID pvReceivedData; // Request data (set on client) - DWORD dwReceivedDataSize; // Request data size (set on client) - DWORD dwMaxResponseDataSize; // Max allowable size of enum response - PVOID pvResponseData; // Optional query repsonse (user set) - DWORD dwResponseDataSize; // Optional query response size (user set) - PVOID pvResponseContext; // Optional query response context (user set) -} DPNMSG_ENUM_HOSTS_QUERY, *PDPNMSG_ENUM_HOSTS_QUERY; - -// -// Enumeration response received structure for message handler -// (DPN_MSGID_ENUM_HOSTS_RESPONSE) -// -typedef struct _DPNMSG_ENUM_HOSTS_RESPONSE -{ - DWORD dwSize; // Size of this structure - IDirectPlay8Address *pAddressSender; // Address of host who responded - IDirectPlay8Address *pAddressDevice; // Device response was received on - const DPN_APPLICATION_DESC *pApplicationDescription; // Application description for the session - PVOID pvResponseData; // Optional response data (set on host) - DWORD dwResponseDataSize; // Optional response data size (set on host) - PVOID pvUserContext; // Context value supplied for enumeration - DWORD dwRoundTripLatencyMS; // Round trip latency in MS -} DPNMSG_ENUM_HOSTS_RESPONSE, *PDPNMSG_ENUM_HOSTS_RESPONSE; - -// -// Group info structure for message handler -// (DPN_MSGID_GROUP_INFO) -// -typedef struct _DPNMSG_GROUP_INFO -{ - DWORD dwSize; // Size of this structure - DPNID dpnidGroup; // DPNID of group - PVOID pvGroupContext; // Group context value -} DPNMSG_GROUP_INFO, *PDPNMSG_GROUP_INFO; - -// -// Migrate host structure for message handler -// (DPN_MSGID_HOST_MIGRATE) -// -typedef struct _DPNMSG_HOST_MIGRATE -{ - DWORD dwSize; // Size of this structure - DPNID dpnidNewHost; // DPNID of new Host player - PVOID pvPlayerContext; // Player context value -} DPNMSG_HOST_MIGRATE, *PDPNMSG_HOST_MIGRATE; - -// -// Indicate connect structure for message handler -// (DPN_MSGID_INDICATE_CONNECT) -// -typedef struct _DPNMSG_INDICATE_CONNECT -{ - DWORD dwSize; // Size of this structure - PVOID pvUserConnectData; // Connecting player data - DWORD dwUserConnectDataSize; // Size (in bytes) of pvUserConnectData - PVOID pvReplyData; // Connection reply data - DWORD dwReplyDataSize; // Size (in bytes) of pvReplyData - PVOID pvReplyContext; // Buffer context for pvReplyData - PVOID pvPlayerContext; // Player context preset - IDirectPlay8Address *pAddressPlayer;// Address of connecting player - IDirectPlay8Address *pAddressDevice;// Address of device receiving connect attempt -} DPNMSG_INDICATE_CONNECT, *PDPNMSG_INDICATE_CONNECT; - -// -// Indicated connect aborted structure for message handler -// (DPN_MSGID_INDICATED_CONNECT_ABORTED) -// -typedef struct _DPNMSG_INDICATED_CONNECT_ABORTED -{ - DWORD dwSize; // Size of this structure - PVOID pvPlayerContext; // Player context preset from DPNMSG_INDICATE_CONNECT -} DPNMSG_INDICATED_CONNECT_ABORTED, *PDPNMSG_INDICATED_CONNECT_ABORTED; - -// -// Peer info structure for message handler -// (DPN_MSGID_PEER_INFO) -// -typedef struct _DPNMSG_PEER_INFO -{ - DWORD dwSize; // Size of this structure - DPNID dpnidPeer; // DPNID of peer - PVOID pvPlayerContext; // Player context value -} DPNMSG_PEER_INFO, *PDPNMSG_PEER_INFO; - -// -// Receive structure for message handler -// (DPN_MSGID_RECEIVE) -// -typedef struct _DPNMSG_RECEIVE -{ - DWORD dwSize; // Size of this structure - DPNID dpnidSender; // DPNID of sending player - PVOID pvPlayerContext; // Player context value of sending player - PBYTE pReceiveData; // Received data - DWORD dwReceiveDataSize; // Size (in bytes) of pReceiveData - DPNHANDLE hBufferHandle; // Buffer handle for pReceiveData -} DPNMSG_RECEIVE, *PDPNMSG_RECEIVE; - -// -// Remove player from group structure for message handler -// (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP) -// -typedef struct _DPNMSG_REMOVE_PLAYER_FROM_GROUP -{ - DWORD dwSize; // Size of this structure - DPNID dpnidGroup; // DPNID of group - PVOID pvGroupContext; // Group context value - DPNID dpnidPlayer; // DPNID of deleted player - PVOID pvPlayerContext; // Player context value -} DPNMSG_REMOVE_PLAYER_FROM_GROUP, *PDPNMSG_REMOVE_PLAYER_FROM_GROUP; - -// -// Returned buffer structure for message handler -// (DPN_MSGID_RETURN_BUFFER) -// -typedef struct _DPNMSG_RETURN_BUFFER -{ - DWORD dwSize; // Size of this structure - HRESULT hResultCode; // Return value of operation - PVOID pvBuffer; // Buffer being returned - PVOID pvUserContext; // Context associated with buffer -} DPNMSG_RETURN_BUFFER, *PDPNMSG_RETURN_BUFFER; - -// -// Send complete structure for message handler -// (DPN_MSGID_SEND_COMPLETE) -// -typedef struct _DPNMSG_SEND_COMPLETE -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle - PVOID pvUserContext; // User context supplied at Send/SendTo - HRESULT hResultCode; // HRESULT of send - DWORD dwSendTime; // Send time in ms -} DPNMSG_SEND_COMPLETE, *PDPNMSG_SEND_COMPLETE; - -// -// Server info structure for message handler -// (DPN_MSGID_SERVER_INFO) -// -typedef struct _DPNMSG_SERVER_INFO -{ - DWORD dwSize; // Size of this structure - DPNID dpnidServer; // DPNID of server - PVOID pvPlayerContext; // Player context value -} DPNMSG_SERVER_INFO, *PDPNMSG_SERVER_INFO; - -// -// Terminated session structure for message handler -// (DPN_MSGID_TERMINATE_SESSION) -// -typedef struct _DPNMSG_TERMINATE_SESSION -{ - DWORD dwSize; // Size of this structure - HRESULT hResultCode; // Reason - PVOID pvTerminateData; // Data passed from Host/Server - DWORD dwTerminateDataSize;// Size (in bytes) of pvTerminateData -} DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION; - - -/**************************************************************************** - * - * DirectPlay8 Functions - * - ****************************************************************************/ - -/* - * This function is no longer supported. It is recommended that CoCreateInstance be used to create - * DirectPlay8 objects. - * - * extern HRESULT WINAPI DirectPlay8Create( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); - * - */ - -/**************************************************************************** - * - * DirectPlay8 Application Interfaces - * - ****************************************************************************/ - -// -// COM definition for DirectPlay8 Client interface -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8Client -DECLARE_INTERFACE_(IDirectPlay8Client,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay8Client methods ***/ - STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; - STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pcbEnumData, PDWORD const pcReturned, const DWORD dwFlags) PURE; - STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(Send) (THIS_ const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetSendQueueInfo) (THIS_ DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; - STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; - STDMETHOD(SetClientInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(GetServerInfo) (THIS_ DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; - STDMETHOD(GetServerAddress) (THIS_ IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE; - STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; - STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; - STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; - STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; - STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP,DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; - STDMETHOD(GetConnectionInfo) (THIS_ DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; - STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; -}; - -// -// COM definition for DirectPlay8 Server interface -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8Server -DECLARE_INTERFACE_(IDirectPlay8Server,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay8Server methods ***/ - STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; - STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider,const GUID *const pguidApplication,DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer,PDWORD const pcbEnumData,PDWORD const pcReturned,const DWORD dwFlags) PURE; - STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid,DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; - STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; - STDMETHOD(SetServerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(GetClientInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; - STDMETHOD(GetClientAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE; - STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE; - STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE; - STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE; - STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; - STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; - STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; - STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; - STDMETHOD(DestroyClient) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE; - STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE; - STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE; - STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; - STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; - STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; - STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; - STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; - STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; -}; - -// -// COM definition for DirectPlay8 Peer interface -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8Peer -DECLARE_INTERFACE_(IDirectPlay8Peer,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay8Peer methods ***/ - STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; - STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, DWORD *const pcbEnumData, DWORD *const pcReturned, const DWORD dwFlags) PURE; - STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvPlayerContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid, DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; - STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE; - STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; - STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE; - STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; - STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; - STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; - STDMETHOD(SetPeerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; - STDMETHOD(GetPeerInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; - STDMETHOD(GetPeerAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE; - STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE; - STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; - STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE; - STDMETHOD(DestroyPeer) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE; - STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; - STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE; - STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE; - STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; - STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; - STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; - STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; - STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; - STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; - STDMETHOD(TerminateSession) (THIS_ void *const pvTerminateData,const DWORD dwTerminateDataSize,const DWORD dwFlags) PURE; -}; - - -/**************************************************************************** - * - * IDirectPlay8 application interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay8Client_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8Client_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8Client_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8Client_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) -#define IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Client_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) -#define IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j) -#define IDirectPlay8Client_Send(p,a,b,c,d,e,f) (p)->lpVtbl->Send(p,a,b,c,d,e,f) -#define IDirectPlay8Client_GetSendQueueInfo(p,a,b,c) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c) -#define IDirectPlay8Client_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) -#define IDirectPlay8Client_SetClientInfo(p,a,b,c,d) (p)->lpVtbl->SetClientInfo(p,a,b,c,d) -#define IDirectPlay8Client_GetServerInfo(p,a,b,c) (p)->lpVtbl->GetServerInfo(p,a,b,c) -#define IDirectPlay8Client_GetServerAddress(p,a,b) (p)->lpVtbl->GetServerAddress(p,a,b) -#define IDirectPlay8Client_Close(p,a) (p)->lpVtbl->Close(p,a) -#define IDirectPlay8Client_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) -#define IDirectPlay8Client_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay8Client_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) -#define IDirectPlay8Client_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) -#define IDirectPlay8Client_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) -#define IDirectPlay8Client_GetConnectionInfo(p,a,b) (p)->lpVtbl->GetConnectionInfo(p,a,b) -#define IDirectPlay8Client_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) - -#define IDirectPlay8Server_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8Server_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8Server_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8Server_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) -#define IDirectPlay8Server_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) -#define IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d) -#define IDirectPlay8Server_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) -#define IDirectPlay8Server_SetServerInfo(p,a,b,c,d) (p)->lpVtbl->SetServerInfo(p,a,b,c,d) -#define IDirectPlay8Server_GetClientInfo(p,a,b,c,d) (p)->lpVtbl->GetClientInfo(p,a,b,c,d) -#define IDirectPlay8Server_GetClientAddress(p,a,b,c) (p)->lpVtbl->GetClientAddress(p,a,b,c) -#define IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c) (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c) -#define IDirectPlay8Server_SetApplicationDesc(p,a,b) (p)->lpVtbl->SetApplicationDesc(p,a,b) -#define IDirectPlay8Server_Host(p,a,b,c,d,e,f,g) (p)->lpVtbl->Host(p,a,b,c,d,e,f,g) -#define IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g) (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g) -#define IDirectPlay8Server_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay8Server_DestroyGroup(p,a,b,c,d) (p)->lpVtbl->DestroyGroup(p,a,b,c,d) -#define IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e) (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e) -#define IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e) -#define IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e) (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e) -#define IDirectPlay8Server_GetGroupInfo(p,a,b,c,d) (p)->lpVtbl->GetGroupInfo(p,a,b,c,d) -#define IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c) (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c) -#define IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d) (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d) -#define IDirectPlay8Server_Close(p,a) (p)->lpVtbl->Close(p,a) -#define IDirectPlay8Server_DestroyClient(p,a,b,c,d) (p)->lpVtbl->DestroyClient(p,a,b,c,d) -#define IDirectPlay8Server_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) -#define IDirectPlay8Server_GetPlayerContext(p,a,b,c) (p)->lpVtbl->GetPlayerContext(p,a,b,c) -#define IDirectPlay8Server_GetGroupContext(p,a,b,c) (p)->lpVtbl->GetGroupContext(p,a,b,c) -#define IDirectPlay8Server_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay8Server_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) -#define IDirectPlay8Server_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) -#define IDirectPlay8Server_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) -#define IDirectPlay8Server_GetConnectionInfo(p,a,b,c) (p)->lpVtbl->GetConnectionInfo(p,a,b,c) -#define IDirectPlay8Server_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) - -#define IDirectPlay8Peer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8Peer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8Peer_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8Peer_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) -#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) - -#define IDirectPlay8Peer_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) -#define IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g) (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g) -#define IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d) -#define IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g) (p)->lpVtbl->Host(p,a,b,c,d,e,f,g) -#define IDirectPlay8Peer_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) -#define IDirectPlay8Peer_SetApplicationDesc(p,a,b) (p)->lpVtbl->SetApplicationDesc(p,a,b) -#define IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay8Peer_DestroyGroup(p,a,b,c,d) (p)->lpVtbl->DestroyGroup(p,a,b,c,d) -#define IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e) (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e) -#define IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e) -#define IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e) (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e) -#define IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d) (p)->lpVtbl->GetGroupInfo(p,a,b,c,d) -#define IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c) (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c) -#define IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d) (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d) -#define IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d) (p)->lpVtbl->SetPeerInfo(p,a,b,c,d) -#define IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d) (p)->lpVtbl->GetPeerInfo(p,a,b,c,d) -#define IDirectPlay8Peer_GetPeerAddress(p,a,b,c) (p)->lpVtbl->GetPeerAddress(p,a,b,c) -#define IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c) (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c) -#define IDirectPlay8Peer_Close(p,a) (p)->lpVtbl->Close(p,a) -#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Peer_DestroyPeer(p,a,b,c,d) (p)->lpVtbl->DestroyPeer(p,a,b,c,d) -#define IDirectPlay8Peer_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) -#define IDirectPlay8Peer_GetPlayerContext(p,a,b,c) (p)->lpVtbl->GetPlayerContext(p,a,b,c) -#define IDirectPlay8Peer_GetGroupContext(p,a,b,c) (p)->lpVtbl->GetGroupContext(p,a,b,c) -#define IDirectPlay8Peer_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay8Peer_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) -#define IDirectPlay8Peer_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) -#define IDirectPlay8Peer_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) -#define IDirectPlay8Peer_GetConnectionInfo(p,a,b,c) (p)->lpVtbl->GetConnectionInfo(p,a,b,c) -#define IDirectPlay8Peer_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) -#define IDirectPlay8Peer_TerminateSession(p,a,b,c) (p)->lpVtbl->TerminateSession(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlay8Client_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8Client_AddRef(p) (p)->AddRef() -#define IDirectPlay8Client_Release(p) (p)->Release() -#define IDirectPlay8Client_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) -#define IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Client_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) -#define IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j) (p)->Connect(a,b,c,d,e,f,g,h,i,j) -#define IDirectPlay8Client_Send(p,a,b,c,d,e,f) (p)->Send(a,b,c,d,e,f) -#define IDirectPlay8Client_GetSendQueueInfo(p,a,b,c) (p)->GetSendQueueInfo(a,b,c) -#define IDirectPlay8Client_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) -#define IDirectPlay8Client_SetClientInfo(p,a,b,c,d) (p)->SetClientInfo(a,b,c,d) -#define IDirectPlay8Client_GetServerInfo(p,a,b,c) (p)->GetServerInfo(a,b,c) -#define IDirectPlay8Client_GetServerAddress(p,a,b) (p)->GetServerAddress(a,b) -#define IDirectPlay8Client_Close(p,a) (p)->Close(a) -#define IDirectPlay8Client_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) -#define IDirectPlay8Client_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay8Client_SetCaps(p,a,b) (p)->SetCaps(a,b) -#define IDirectPlay8Client_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) -#define IDirectPlay8Client_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) -#define IDirectPlay8Client_GetConnectionInfo(p,a,b) (p)->GetConnectionInfo(a,b) -#define IDirectPlay8Client_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) - -#define IDirectPlay8Server_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8Server_AddRef(p) (p)->AddRef() -#define IDirectPlay8Server_Release(p) (p)->Release() -#define IDirectPlay8Server_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) -#define IDirectPlay8Server_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) -#define IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d) (p)->GetSendQueueInfo(a,b,c,d) -#define IDirectPlay8Server_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) -#define IDirectPlay8Server_SetServerInfo(p,a,b,c,d) (p)->SetServerInfo(a,b,c,d) -#define IDirectPlay8Server_GetClientInfo(p,a,b,c,d) (p)->GetClientInfo(a,b,c,d) -#define IDirectPlay8Server_GetClientAddress(p,a,b,c) (p)->GetClientAddress(a,b,c) -#define IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c) (p)->GetLocalHostAddresses(a,b,c) -#define IDirectPlay8Server_SetApplicationDesc(p,a,b) (p)->SetApplicationDesc(a,b) -#define IDirectPlay8Server_Host(p,a,b,c,d,e,f,g) (p)->Host(a,b,c,d,e,f,g) -#define IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g) (p)->SendTo(a,b,c,d,e,f,g) -#define IDirectPlay8Server_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay8Server_DestroyGroup(p,a,b,c,d) (p)->DestroyGroup(a,b,c,d) -#define IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e) (p)->AddPlayerToGroup(a,b,c,d,e) -#define IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->RemovePlayerFromGroup(a,b,c,d,e) -#define IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e) (p)->SetGroupInfo(a,b,c,d,e) -#define IDirectPlay8Server_GetGroupInfo(p,a,b,c,d) (p)->GetGroupInfo(a,b,c,d) -#define IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c) (p)->EnumPlayersAndGroups(a,b,c) -#define IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d) (p)->EnumGroupMembers(a,b,c,d) -#define IDirectPlay8Server_Close(p,a) (p)->Close(a) -#define IDirectPlay8Server_DestroyClient(p,a,b,c,d) (p)->DestroyClient(a,b,c,d) -#define IDirectPlay8Server_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) -#define IDirectPlay8Server_GetPlayerContext(p,a,b,c) (p)->GetPlayerContext(a,b,c) -#define IDirectPlay8Server_GetGroupContext(p,a,b,c) (p)->GetGroupContext(a,b,c) -#define IDirectPlay8Server_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay8Server_SetCaps(p,a,b) (p)->SetCaps(a,b) -#define IDirectPlay8Server_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) -#define IDirectPlay8Server_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) -#define IDirectPlay8Server_GetConnectionInfo(p,a,b,c) (p)->GetConnectionInfo(a,b,c) -#define IDirectPlay8Server_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) - -#define IDirectPlay8Peer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8Peer_AddRef(p) (p)->AddRef() -#define IDirectPlay8Peer_Release(p) (p)->Release() -#define IDirectPlay8Peer_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) -#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Peer_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) -#define IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k) (p)->Connect(a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g) (p)->SendTo(a,b,c,d,e,f,g) -#define IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d) (p)->GetSendQueueInfo(a,b,c,d) -#define IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g) (p)->Host(a,b,c,d,e,f,g) -#define IDirectPlay8Peer_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) -#define IDirectPlay8Peer_SetApplicationDesc(p,a,b) (p)->SetApplicationDesc(a,b) -#define IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay8Peer_DestroyGroup(p,a,b,c,d) (p)->DestroyGroup(a,b,c,d) -#define IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e) (p)->AddPlayerToGroup(a,b,c,d,e) -#define IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->RemovePlayerFromGroup(a,b,c,d,e) -#define IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e) (p)->SetGroupInfo(a,b,c,d,e) -#define IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d) (p)->GetGroupInfo(a,b,c,d) -#define IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c) (p)->EnumPlayersAndGroups(a,b,c) -#define IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d) (p)->EnumGroupMembers(a,b,c,d) -#define IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d) (p)->SetPeerInfo(a,b,c,d) -#define IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d) (p)->GetPeerInfo(a,b,c,d) -#define IDirectPlay8Peer_GetPeerAddress(p,a,b,c) (p)->GetPeerAddress(a,b,c) -#define IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c) (p)->GetLocalHostAddresses(a,b,c) -#define IDirectPlay8Peer_Close(p,a) (p)->Close(a) -#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k) -#define IDirectPlay8Peer_DestroyPeer(p,a,b,c,d) (p)->DestroyPeer(a,b,c,d) -#define IDirectPlay8Peer_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) -#define IDirectPlay8Peer_GetPlayerContext(p,a,b,c) (p)->GetPlayerContext(a,b,c) -#define IDirectPlay8Peer_GetGroupContext(p,a,b,c) (p)->GetGroupContext(a,b,c) -#define IDirectPlay8Peer_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay8Peer_SetCaps(p,a,b) (p)->SetCaps(a,b) -#define IDirectPlay8Peer_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) -#define IDirectPlay8Peer_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) -#define IDirectPlay8Peer_GetConnectionInfo(p,a,b,c) (p)->GetConnectionInfo(a,b,c) -#define IDirectPlay8Peer_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) -#define IDirectPlay8Peer_TerminateSession(p,a,b,c) (p)->TerminateSession(a,b,c) - -#endif - -/**************************************************************************** - * - * DIRECTPLAY8 ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -#define _DPN_FACILITY_CODE 0x015 -#define _DPNHRESULT_BASE 0x8000 -#define MAKE_DPNHRESULT( code ) MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) ) - -#define DPN_OK S_OK - -#define DPNSUCCESS_EQUAL MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x5 + _DPNHRESULT_BASE ) ) -#define DPNSUCCESS_NOTEQUAL MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0A + _DPNHRESULT_BASE ) ) -#define DPNSUCCESS_PENDING MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0e + _DPNHRESULT_BASE ) ) - -#define DPNERR_ABORTED MAKE_DPNHRESULT( 0x30 ) -#define DPNERR_ADDRESSING MAKE_DPNHRESULT( 0x40 ) -#define DPNERR_ALREADYCLOSING MAKE_DPNHRESULT( 0x50 ) -#define DPNERR_ALREADYCONNECTED MAKE_DPNHRESULT( 0x60 ) -#define DPNERR_ALREADYDISCONNECTING MAKE_DPNHRESULT( 0x70 ) -#define DPNERR_ALREADYINITIALIZED MAKE_DPNHRESULT( 0x80 ) -#define DPNERR_ALREADYREGISTERED MAKE_DPNHRESULT( 0x90 ) -#define DPNERR_BUFFERTOOSMALL MAKE_DPNHRESULT( 0x100 ) -#define DPNERR_CANNOTCANCEL MAKE_DPNHRESULT( 0x110 ) -#define DPNERR_CANTCREATEGROUP MAKE_DPNHRESULT( 0x120 ) -#define DPNERR_CANTCREATEPLAYER MAKE_DPNHRESULT( 0x130 ) -#define DPNERR_CANTLAUNCHAPPLICATION MAKE_DPNHRESULT( 0x140 ) -#define DPNERR_CONNECTING MAKE_DPNHRESULT( 0x150 ) -#define DPNERR_CONNECTIONLOST MAKE_DPNHRESULT( 0x160 ) -#define DPNERR_CONVERSION MAKE_DPNHRESULT( 0x170 ) -#define DPNERR_DATATOOLARGE MAKE_DPNHRESULT( 0x175 ) -#define DPNERR_DOESNOTEXIST MAKE_DPNHRESULT( 0x180 ) -#define DPNERR_DUPLICATECOMMAND MAKE_DPNHRESULT( 0x190 ) -#define DPNERR_ENDPOINTNOTRECEIVING MAKE_DPNHRESULT( 0x200 ) -#define DPNERR_ENUMQUERYTOOLARGE MAKE_DPNHRESULT( 0x210 ) -#define DPNERR_ENUMRESPONSETOOLARGE MAKE_DPNHRESULT( 0x220 ) -#define DPNERR_EXCEPTION MAKE_DPNHRESULT( 0x230 ) -#define DPNERR_GENERIC E_FAIL -#define DPNERR_GROUPNOTEMPTY MAKE_DPNHRESULT( 0x240 ) -#define DPNERR_HOSTING MAKE_DPNHRESULT( 0x250 ) -#define DPNERR_HOSTREJECTEDCONNECTION MAKE_DPNHRESULT( 0x260 ) -#define DPNERR_HOSTTERMINATEDSESSION MAKE_DPNHRESULT( 0x270 ) -#define DPNERR_INCOMPLETEADDRESS MAKE_DPNHRESULT( 0x280 ) -#define DPNERR_INVALIDADDRESSFORMAT MAKE_DPNHRESULT( 0x290 ) -#define DPNERR_INVALIDAPPLICATION MAKE_DPNHRESULT( 0x300 ) -#define DPNERR_INVALIDCOMMAND MAKE_DPNHRESULT( 0x310 ) -#define DPNERR_INVALIDDEVICEADDRESS MAKE_DPNHRESULT( 0x320 ) -#define DPNERR_INVALIDENDPOINT MAKE_DPNHRESULT( 0x330 ) -#define DPNERR_INVALIDFLAGS MAKE_DPNHRESULT( 0x340 ) -#define DPNERR_INVALIDGROUP MAKE_DPNHRESULT( 0x350 ) -#define DPNERR_INVALIDHANDLE MAKE_DPNHRESULT( 0x360 ) -#define DPNERR_INVALIDHOSTADDRESS MAKE_DPNHRESULT( 0x370 ) -#define DPNERR_INVALIDINSTANCE MAKE_DPNHRESULT( 0x380 ) -#define DPNERR_INVALIDINTERFACE MAKE_DPNHRESULT( 0x390 ) -#define DPNERR_INVALIDOBJECT MAKE_DPNHRESULT( 0x400 ) -#define DPNERR_INVALIDPARAM E_INVALIDARG -#define DPNERR_INVALIDPASSWORD MAKE_DPNHRESULT( 0x410 ) -#define DPNERR_INVALIDPLAYER MAKE_DPNHRESULT( 0x420 ) -#define DPNERR_INVALIDPOINTER E_POINTER -#define DPNERR_INVALIDPRIORITY MAKE_DPNHRESULT( 0x430 ) -#define DPNERR_INVALIDSTRING MAKE_DPNHRESULT( 0x440 ) -#define DPNERR_INVALIDURL MAKE_DPNHRESULT( 0x450 ) -#define DPNERR_INVALIDVERSION MAKE_DPNHRESULT( 0x460 ) -#define DPNERR_NOCAPS MAKE_DPNHRESULT( 0x470 ) -#define DPNERR_NOCONNECTION MAKE_DPNHRESULT( 0x480 ) -#define DPNERR_NOHOSTPLAYER MAKE_DPNHRESULT( 0x490 ) -#define DPNERR_NOINTERFACE E_NOINTERFACE -#define DPNERR_NOMOREADDRESSCOMPONENTS MAKE_DPNHRESULT( 0x500 ) -#define DPNERR_NORESPONSE MAKE_DPNHRESULT( 0x510 ) -#define DPNERR_NOTALLOWED MAKE_DPNHRESULT( 0x520 ) -#define DPNERR_NOTHOST MAKE_DPNHRESULT( 0x530 ) -#define DPNERR_NOTREADY MAKE_DPNHRESULT( 0x540 ) -#define DPNERR_NOTREGISTERED MAKE_DPNHRESULT( 0x550 ) -#define DPNERR_OUTOFMEMORY E_OUTOFMEMORY -#define DPNERR_PENDING DPNSUCCESS_PENDING -#define DPNERR_PLAYERALREADYINGROUP MAKE_DPNHRESULT( 0x560 ) -#define DPNERR_PLAYERLOST MAKE_DPNHRESULT( 0x570 ) -#define DPNERR_PLAYERNOTINGROUP MAKE_DPNHRESULT( 0x580 ) -#define DPNERR_PLAYERNOTREACHABLE MAKE_DPNHRESULT( 0x590 ) -#define DPNERR_SENDTOOLARGE MAKE_DPNHRESULT( 0x600 ) -#define DPNERR_SESSIONFULL MAKE_DPNHRESULT( 0x610 ) -#define DPNERR_TABLEFULL MAKE_DPNHRESULT( 0x620 ) -#define DPNERR_TIMEDOUT MAKE_DPNHRESULT( 0x630 ) -#define DPNERR_UNINITIALIZED MAKE_DPNHRESULT( 0x640 ) -#define DPNERR_UNSUPPORTED E_NOTIMPL -#define DPNERR_USERCANCEL MAKE_DPNHRESULT( 0x650 ) - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/import/DirectX8/include/dplobby.h b/import/DirectX8/include/dplobby.h deleted file mode 100644 index c91d3238c..000000000 --- a/import/DirectX8/include/dplobby.h +++ /dev/null @@ -1,853 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dplobby.h - * Content: DirectPlayLobby include file - ***************************************************************************/ -#ifndef __DPLOBBY_INCLUDED__ -#define __DPLOBBY_INCLUDED__ - -#include "dplay.h" - -/* avoid warnings at Level 4 */ -#pragma warning(disable:4201) - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * GUIDS used by DirectPlay objects - */ - -/* {AF465C71-9588-11cf-A020-00AA006157AC} */ -DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); -/* {26C66A70-B367-11cf-A024-00AA006157AC} */ -DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); -/* {0194C220-A303-11d0-9C4F-00A0C905425E} */ -DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); -/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */ -DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); -/* {2DB72490-652C-11d1-A7A8-0000F803ABFC} */ -DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); -/* {2DB72491-652C-11d1-A7A8-0000F803ABFC} */ -DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); -/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */ -DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - - -/**************************************************************************** - * - * IDirectPlayLobby Structures - * - * Various structures used to invoke DirectPlayLobby. - * - ****************************************************************************/ - -typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY; -typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA; -typedef struct IDirectPlayLobby IDirectPlayLobbyA; - -typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2; -typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A; -typedef struct IDirectPlayLobby2 IDirectPlayLobby2A; - -typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3; -typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3A; -typedef struct IDirectPlayLobby3 IDirectPlayLobby3A; - - -/* - * DPLAPPINFO - * Used to hold information about a registered DirectPlay - * application - */ -typedef struct DPLAPPINFO -{ - DWORD dwSize; // Size of this structure - GUID guidApplication; // GUID of the Application - union - { - LPSTR lpszAppNameA; // Pointer to the Application Name - LPWSTR lpszAppName; - }; - -} DPLAPPINFO, FAR *LPDPLAPPINFO; - -/* - * LPCDPLAPPINFO - * A constant pointer to DPLAPPINFO - */ -typedef const DPLAPPINFO FAR *LPCDPLAPPINFO; - -/* - * DPCOMPOUNDADDRESSELEMENT - * - * An array of these is passed to CreateCompoundAddresses() - */ -typedef struct DPCOMPOUNDADDRESSELEMENT -{ - GUID guidDataType; - DWORD dwDataSize; - LPVOID lpData; -} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT; - -/* - * LPCDPCOMPOUNDADDRESSELEMENT - * A constant pointer to DPCOMPOUNDADDRESSELEMENT - */ -typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT; - -/* - * LPDPAPPLICATIONDESC - * Used to register a DirectPlay application - */ -typedef struct DPAPPLICATIONDESC -{ - DWORD dwSize; - DWORD dwFlags; - union - { - LPSTR lpszApplicationNameA; - LPWSTR lpszApplicationName; - }; - GUID guidApplication; - union - { - LPSTR lpszFilenameA; - LPWSTR lpszFilename; - }; - union - { - LPSTR lpszCommandLineA; - LPWSTR lpszCommandLine; - }; - union - { - LPSTR lpszPathA; - LPWSTR lpszPath; - }; - union - { - LPSTR lpszCurrentDirectoryA; - LPWSTR lpszCurrentDirectory; - }; - LPSTR lpszDescriptionA; - LPWSTR lpszDescriptionW; -} DPAPPLICATIONDESC, *LPDPAPPLICATIONDESC; - -/* - * LPDPAPPLICATIONDESC2 - * Used to register a DirectPlay application - */ -typedef struct DPAPPLICATIONDESC2 -{ - DWORD dwSize; - DWORD dwFlags; - union - { - LPSTR lpszApplicationNameA; - LPWSTR lpszApplicationName; - }; - GUID guidApplication; - union - { - LPSTR lpszFilenameA; - LPWSTR lpszFilename; - }; - union - { - LPSTR lpszCommandLineA; - LPWSTR lpszCommandLine; - }; - union - { - LPSTR lpszPathA; - LPWSTR lpszPath; - }; - union - { - LPSTR lpszCurrentDirectoryA; - LPWSTR lpszCurrentDirectory; - }; - LPSTR lpszDescriptionA; - LPWSTR lpszDescriptionW; - union - { - LPSTR lpszAppLauncherNameA; - LPWSTR lpszAppLauncherName; - }; -} DPAPPLICATIONDESC2, *LPDPAPPLICATIONDESC2; - - -/**************************************************************************** - * - * Enumeration Method Callback Prototypes - * - ****************************************************************************/ - -/* - * Callback for EnumAddress() - */ -typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)( - REFGUID guidDataType, - DWORD dwDataSize, - LPCVOID lpData, - LPVOID lpContext); - -/* - * Callback for EnumAddressTypes() - */ -typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)( - REFGUID guidDataType, - LPVOID lpContext, - DWORD dwFlags); - -/* - * Callback for EnumLocalApplications() - */ -typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)( - LPCDPLAPPINFO lpAppInfo, - LPVOID lpContext, - DWORD dwFlags); - - -/**************************************************************************** - * - * DirectPlayLobby API Prototypes - * - ****************************************************************************/ -#ifdef UNICODE -#define DirectPlayLobbyCreate DirectPlayLobbyCreateW -#else -#define DirectPlayLobbyCreate DirectPlayLobbyCreateA -#endif /* UNICODE */ - -extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD ); -extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD ); - - -/**************************************************************************** - * - * IDirectPlayLobby (and IDirectPlayLobbyA) Interface - * - ****************************************************************************/ -#undef INTERFACE -#define INTERFACE IDirectPlayLobby -DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectPlayLobby Methods */ - STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; - STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; - STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; - STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; - STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; - STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; - -}; - -/**************************************************************************** - * - * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface - * - ****************************************************************************/ -#undef INTERFACE -#define INTERFACE IDirectPlayLobby2 -DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectPlayLobby Methods */ - STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; - STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; - STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; - STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; - STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; - STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; - - /* IDirectPlayLobby2 Methods */ - STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface - * - ****************************************************************************/ -#undef INTERFACE -#define INTERFACE IDirectPlayLobby3 -DECLARE_INTERFACE_( IDirectPlayLobby3, IDirectPlayLobby ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectPlayLobby Methods */ - STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; - STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; - STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; - STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; - STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; - STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; - - /* IDirectPlayLobby2 Methods */ - STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE; - - /* IDirectPlayLobby3 Methods */ - STDMETHOD(ConnectEx) (THIS_ DWORD, REFIID, LPVOID *, IUnknown FAR *) PURE; - STDMETHOD(RegisterApplication) (THIS_ DWORD, LPVOID) PURE; - STDMETHOD(UnregisterApplication)(THIS_ DWORD, REFGUID) PURE; - STDMETHOD(WaitForConnectionSettings)(THIS_ DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlayLobby interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) -#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->lpVtbl->ConnectEx(p,a,b,c,d) -#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f) -#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d) -#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d) -#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d) -#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c) -#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c) -#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e) -#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->lpVtbl->RegisterApplication(p,a,b) -#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d) -#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d) -#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) -#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c) -#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->lpVtbl->UnregisterApplication(p,a,b) -#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->lpVtbl->WaitForConnectionSettings(p,a) - -#else /* C++ */ - -#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayLobby_AddRef(p) (p)->AddRef() -#define IDirectPlayLobby_Release(p) (p)->Release() -#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c) -#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->ConnectEx(a,b,c,d) -#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f) -#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->CreateCompoundAddress(a,b,c,d) -#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d) -#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d) -#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c) -#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c) -#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e) -#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->RegisterApplication(a,b) -#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d) -#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d) -#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) -#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c) -#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->UnregisterApplication(a,b) -#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->WaitForConnectionSettings(a) - -#endif - -/**************************************************************************** - * - * DirectPlayLobby Flags - * - ****************************************************************************/ - -/* - * This flag is used by IDirectPlayLobby->WaitForConnectionSettings to - * cancel a current wait that is in progress. - */ -#define DPLWAIT_CANCEL 0x00000001 - - -/* - * This is a message flag used by ReceiveLobbyMessage. It can be - * returned in the dwMessageFlags parameter to indicate a message from - * the system. - */ -#define DPLMSG_SYSTEM 0x00000001 - -/* - * This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage. - * It is used to indicate that the message is a standard lobby message. - * DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY, - * DPLMSG_GETPROPERTYRESPONSE - */ -#define DPLMSG_STANDARD 0x00000002 - -/* - * Lobbyable Application registration flags - */ - -/* - * Applications registered with this flag will not show up when - * applications are enumerated in the lobby. This application - * will only be able to be launched by a lobby client that already - * knows about the application. - */ -#define DPLAPP_NOENUM 0x80000000 - -/* - * Applications registered with this flag want voice to automatically - * be enabled for their application. All players will be launched into - * an 'n'-way voice conference when the application is started. The - * user will be able to enable this flag for existing non-voice - * directplay applications. - */ -#define DPLAPP_AUTOVOICE 0x00000001 - -/* - * Applications that do their own voice conferencing should register with - * this flag to avoid allowing the user to enable other voice chat - * capabilites during the same session. This is to avoid users forcing - * the DPLAPP_AUTOVOICE flag for the application. - */ -#define DPLAPP_SELFVOICE 0x00000002 - -/**************************************************************************** - * - * DirectPlayLobby messages and message data structures - * - * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned - * from a call to ReceiveLobbyMessage. - * - * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned - * from a call to ReceiveLobbyMessage. - * - ****************************************************************************/ - -/* - * DPLMSG_GENERIC - * Generic message structure used to identify the message type. - */ -typedef struct _DPLMSG_GENERIC -{ - DWORD dwType; // Message type -} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC; - -/* - * DPLMSG_SYSTEMMESSAGE - * Generic message format for all system messages -- - * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED, - * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS - */ -typedef struct _DPLMSG_SYSTEMMESSAGE -{ - DWORD dwType; // Message type - GUID guidInstance; // Instance GUID of the dplay session the message corresponds to -} DPLMSG_SYSTEMMESSAGE, FAR *LPDPLMSG_SYSTEMMESSAGE; - -/* - * DPLMSG_SETPROPERTY - * Standard message sent by an application to a lobby to set a - * property - */ -typedef struct _DPLMSG_SETPROPERTY -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired) - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - DWORD dwDataSize; // Size of data - DWORD dwPropertyData[1]; // Buffer containing data -} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY; - -#define DPL_NOCONFIRMATION 0 - -/* - * DPLMSG_SETPROPERTYRESPONSE - * Standard message returned by a lobby to confirm a - * DPLMSG_SETPROPERTY message. - */ -typedef struct _DPLMSG_SETPROPERTYRESPONSE -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - HRESULT hr; // Return Code -} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE; - -/* - * DPLMSG_GETPROPERTY - * Standard message sent by an application to a lobby to request - * the current value of a property - */ -typedef struct _DPLMSG_GETPROPERTY -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID -} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY; - -/* - * DPLMSG_GETPROPERTYRESPONSE - * Standard message returned by a lobby in response to a - * DPLMSG_GETPROPERTY message. - */ -typedef struct _DPLMSG_GETPROPERTYRESPONSE -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - HRESULT hr; // Return Code - DWORD dwDataSize; // Size of data - DWORD dwPropertyData[1]; // Buffer containing data -} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE; - -/* - * DPLMSG_NEWSESSIONHOST - * Standard message returned by a lobby in response to a - * the session host migrating to a new client - */ -typedef struct _DPLMSG_NEWSESSIONHOST -{ - DWORD dwType; // Message type - GUID guidInstance; // GUID Instance of the session -} DPLMSG_NEWSESSIONHOST, FAR *LPDPLMSG_NEWSESSIONHOST; - - -/****************************************** - * - * DirectPlay Lobby message dwType values - * - *****************************************/ - -/* - * The application has read the connection settings. - * It is now O.K. for the lobby client to release - * its IDirectPlayLobby interface. - */ -#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001 - -/* - * The application's call to DirectPlayConnect failed - */ -#define DPLSYS_DPLAYCONNECTFAILED 0x00000002 - -/* - * The application has created a DirectPlay session. - */ -#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003 - -/* - * The application has terminated. - */ -#define DPLSYS_APPTERMINATED 0x00000004 - -/* - * The message is a DPLMSG_SETPROPERTY message. - */ -#define DPLSYS_SETPROPERTY 0x00000005 - -/* - * The message is a DPLMSG_SETPROPERTYRESPONSE message. - */ -#define DPLSYS_SETPROPERTYRESPONSE 0x00000006 - -/* - * The message is a DPLMSG_GETPROPERTY message. - */ -#define DPLSYS_GETPROPERTY 0x00000007 - -/* - * The message is a DPLMSG_GETPROPERTYRESPONSE message. - */ -#define DPLSYS_GETPROPERTYRESPONSE 0x00000008 - -/* - * The message is a DPLMSG_NEWSESSIONHOST message. - */ -#define DPLSYS_NEWSESSIONHOST 0x00000009 - -/* - * New connection settings are available. - */ -#define DPLSYS_NEWCONNECTIONSETTINGS 0x0000000A - -/* - * The Lobby Client has released the DirectPlayLobby Interface - */ -#define DPLSYS_LOBBYCLIENTRELEASE 0x0000000B - -/**************************************************************************** - * - * DirectPlay defined property GUIDs and associated data structures - * - ****************************************************************************/ - -/* - * DPLPROPERTY_MessagesSupported - * - * Request whether the lobby supports standard. Lobby with respond with either - * TRUE or FALSE or may not respond at all. - * - * Property data is a single BOOL with TRUE or FALSE - */ -// {762CCDA1-D916-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_MessagesSupported, -0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLPROPERTY_LobbyGuid - * - * Request the GUID that identifies the lobby software that the application - * is communicating with. - * - * Property data is a single GUID. - */ -// {F56920A0-D218-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_LobbyGuid, -0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLPROPERTY_PlayerGuid - * - * Request the GUID that identifies the player on this machine for sending - * property data back to the lobby. - * - * Property data is the DPLDATA_PLAYERDATA structure - */ -// {B4319322-D20D-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_PlayerGuid, -0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLDATA_PLAYERGUID - * - * Data structure to hold the GUID of the player and player creation flags - * from the lobby. - */ -typedef struct _DPLDATA_PLAYERGUID -{ - GUID guidPlayer; - DWORD dwPlayerFlags; -} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID; - -/* - * DPLPROPERTY_PlayerScore - * - * Used to send an array of long integers to the lobby indicating the - * score of a player. - * - * Property data is the DPLDATA_PLAYERSCORE structure. - */ -// {48784000-D219-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_PlayerScore, -0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLDATA_PLAYERSCORE - * - * Data structure to hold an array of long integers representing a player score. - * Application must allocate enough memory to hold all the scores. - */ -typedef struct _DPLDATA_PLAYERSCORE -{ - DWORD dwScoreCount; - LONG Score[1]; -} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE; - -/**************************************************************************** - * - * DirectPlay Address ID's - * - ****************************************************************************/ - -/* DirectPlay Address - * - * A DirectPlay address consists of multiple chunks of data, each tagged - * with a GUID signifying the type of data in the chunk. The chunk also - * has a length so that unknown chunk types can be skipped. - * - * The EnumAddress() function is used to parse these address data chunks. - */ - -/* - * DPADDRESS - * - * Header for block of address data elements - */ -typedef struct _DPADDRESS -{ - GUID guidDataType; - DWORD dwDataSize; -} DPADDRESS; - -typedef DPADDRESS FAR *LPDPADDRESS; - -/* - * DPAID_TotalSize - * - * Chunk is a DWORD containing size of entire DPADDRESS structure - */ - -// {1318F560-912C-11d0-9DAA-00A0C90A43CB} -DEFINE_GUID(DPAID_TotalSize, -0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -/* - * DPAID_ServiceProvider - * - * Chunk is a GUID describing the service provider that created the chunk. - * All addresses must contain this chunk. - */ - -// {07D916C0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_ServiceProvider, -0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_LobbyProvider - * - * Chunk is a GUID describing the lobby provider that created the chunk. - * All addresses must contain this chunk. - */ - -// {59B95640-9667-11d0-A77D-0000F803ABFC} -DEFINE_GUID(DPAID_LobbyProvider, -0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - -/* - * DPAID_Phone and DPAID_PhoneW - * - * Chunk is a string containing a phone number (i.e. "1-800-555-1212") - * in ANSI or UNICODE format - */ - -// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_Phone, -0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E} -DEFINE_GUID(DPAID_PhoneW, -0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_Modem and DPAID_ModemW - * - * Chunk is a string containing a modem name registered with TAPI - * in ANSI or UNICODE format - */ - -// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E} -DEFINE_GUID(DPAID_Modem, -0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E} -DEFINE_GUID(DPAID_ModemW, -0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_Inet and DPAID_InetW - * - * Chunk is a string containing a TCP/IP host name or an IP address - * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format - */ - -// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_INet, -0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {E63232A0-9DBF-11d0-9CC1-00A0C905425E} -DEFINE_GUID(DPAID_INetW, -0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_InetPort - * - * Chunk is the port number used for creating the apps TCP and UDP sockets. - * WORD value (i.e. 47624). - */ - -// {E4524541-8EA5-11d1-8A96-006097B01411} -DEFINE_GUID(DPAID_INetPort, -0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -#ifdef BIGMESSAGEDEFENSE -#endif - -/* - * DPCOMPORTADDRESS - * - * Used to specify com port settings. The constants that define baud rate, - * stop bits and parity are defined in WINBASE.H. The constants for flow - * control are given below. - */ - -#define DPCPA_NOFLOW 0 // no flow control -#define DPCPA_XONXOFFFLOW 1 // software flow control -#define DPCPA_RTSFLOW 2 // hardware flow control with RTS -#define DPCPA_DTRFLOW 3 // hardware flow control with DTR -#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR - -typedef struct _DPCOMPORTADDRESS -{ - DWORD dwComPort; // COM port to use (1-4) - DWORD dwBaudRate; // baud rate (100-256k) - DWORD dwStopBits; // no. stop bits (1-2) - DWORD dwParity; // parity (none, odd, even, mark) - DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr) -} DPCOMPORTADDRESS; - -typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS; - -/* - * DPAID_ComPort - * - * Chunk contains a DPCOMPORTADDRESS structure defining the serial port. - */ - -// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_ComPort, -0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/**************************************************************************** - * - * dplobby 1.0 obsolete definitions - * Included for compatibility only. - * - ****************************************************************************/ -#define DPLAD_SYSTEM DPLMSG_SYSTEM - - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#pragma warning(default:4201) - -#endif /* __DPLOBBY_INCLUDED__ */ - diff --git a/import/DirectX8/include/dplobby8.h b/import/DirectX8/include/dplobby8.h deleted file mode 100644 index e63a5aac1..000000000 --- a/import/DirectX8/include/dplobby8.h +++ /dev/null @@ -1,407 +0,0 @@ -/*========================================================================== - * - * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved. - * - * File: DPLobby.h - * Content: DirectPlay8 Lobby Include File - * - ***************************************************************************/ - -#ifndef __DPLOBBY_H__ -#define __DPLOBBY_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/**************************************************************************** - * - * DirectPlay8Lobby CLSIDs - * - ****************************************************************************/ - -// {667955AD-6B3B-43ca-B949-BC69B5BAFF7F} -DEFINE_GUID(CLSID_DirectPlay8LobbiedApplication, -0x667955ad, 0x6b3b, 0x43ca, 0xb9, 0x49, 0xbc, 0x69, 0xb5, 0xba, 0xff, 0x7f); - -// {3B2B6775-70B6-45af-8DEA-A209C69559F3} -DEFINE_GUID(CLSID_DirectPlay8LobbyClient, -0x3b2b6775, 0x70b6, 0x45af, 0x8d, 0xea, 0xa2, 0x9, 0xc6, 0x95, 0x59, 0xf3); - -/**************************************************************************** - * - * DirectPlay8Lobby Interface IIDs - * - ****************************************************************************/ - -// {819074A3-016C-11d3-AE14-006097B01411} -DEFINE_GUID(IID_IDirectPlay8LobbiedApplication, -0x819074a3, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -// {819074A2-016C-11d3-AE14-006097B01411} -DEFINE_GUID(IID_IDirectPlay8LobbyClient, -0x819074a2, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); - -/**************************************************************************** - * - * DirectPlay8Lobby Interface Pointer - * - ****************************************************************************/ - -typedef struct IDirectPlay8LobbiedApplication *PDIRECTPLAY8LOBBIEDAPPLICATION; -typedef struct IDirectPlay8LobbyClient *PDIRECTPLAY8LOBBYCLIENT; - -/**************************************************************************** - * - * DirectPlay8 Lobby Message IDs - * - ****************************************************************************/ - -#define DPL_MSGID_LOBBY 0x8000 -#define DPL_MSGID_RECEIVE (0x0001 | DPL_MSGID_LOBBY) -#define DPL_MSGID_CONNECT (0x0002 | DPL_MSGID_LOBBY) -#define DPL_MSGID_DISCONNECT (0x0003 | DPL_MSGID_LOBBY) -#define DPL_MSGID_SESSION_STATUS (0x0004 | DPL_MSGID_LOBBY) -#define DPL_MSGID_CONNECTION_SETTINGS (0x0005 | DPL_MSGID_LOBBY) - -/**************************************************************************** - * - * DirectPlay8Lobby Constants - * - ****************************************************************************/ - -// -// Specifies that operation should be performed on all open connections -// -#define DPLHANDLE_ALLCONNECTIONS 0xFFFFFFFF - -// -// The associated game session has suceeded in connecting / hosting -// -#define DPLSESSION_CONNECTED 0x0001 - -// The associated game session failed connecting / hosting -// -#define DPLSESSION_COULDNOTCONNECT 0x0002 - -// -// The associated game session has disconnected -// -#define DPLSESSION_DISCONNECTED 0x0003 - -// -// The associated game session has terminated -// -#define DPLSESSION_TERMINATED 0x0004 - -// -// The associated game session's host has migrated -// -#define DPLSESSION_HOSTMIGRATED 0x0005 - -// -// The associated game session's host has migrated to the local client -// -#define DPLSESSION_HOSTMIGRATEDHERE 0x0006 - - -/**************************************************************************** - * - * DirectPlay8 Lobby Flags - * - ****************************************************************************/ - -// -// Do not automatically make the lobby app unavailable when a connection is established -// -#define DPLAVAILABLE_ALLOWMULTIPLECONNECT 0x0001 - -// -// Launch a new instance of the application to connect to -// -#define DPLCONNECT_LAUNCHNEW 0x0001 - -// -// Launch a new instance of the application if one is not waiting -// -#define DPLCONNECT_LAUNCHNOTFOUND 0x0002 - -// -// When starting the associated game session, start it as a host -// -#define DPLCONNECTSETTINGS_HOST 0x0001 - -// -// Disable parameter validation -// -#define DPLINITIALIZE_DISABLEPARAMVAL 0x0001 - -/**************************************************************************** - * - * DirectPlay8Lobby Structures (Non-Message) - * - ****************************************************************************/ - -// -// Information on a registered game -// -typedef struct _DPL_APPLICATION_INFO { - GUID guidApplication; // GUID of the application - PWSTR pwszApplicationName; // Name of the application - DWORD dwNumRunning; // # of instances of this application running - DWORD dwNumWaiting; // # of instances of this application waiting - DWORD dwFlags; // Flags -} DPL_APPLICATION_INFO, *PDPL_APPLICATION_INFO; - -// -// Settings to be used for connecting / hosting a game session -// -typedef struct _DPL_CONNECTION_SETTINGS { - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Connection settings flags (DPLCONNECTSETTINGS_...) - DPN_APPLICATION_DESC dpnAppDesc; // Application desc for the associated DirectPlay session - IDirectPlay8Address *pdp8HostAddress; // Address of host to connect to - IDirectPlay8Address **ppdp8DeviceAddresses; // Address of device to connect from / host on - DWORD cNumDeviceAddresses; // # of addresses specified in ppdp8DeviceAddresses - PWSTR pwszPlayerName; // Name to give the player -} DPL_CONNECTION_SETTINGS, *PDPL_CONNECTION_SETTINGS; - -// -// Information for performing a lobby connect -// (ConnectApplication) -// -typedef struct _DPL_CONNECT_INFO { - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags (DPLCONNECT_...) - GUID guidApplication; // GUID of application to launch - PDPL_CONNECTION_SETTINGS pdplConnectionSettings; - // Settings application should use - PVOID pvLobbyConnectData; // User defined data block - DWORD dwLobbyConnectDataSize; - // Size of user defined data block -} DPL_CONNECT_INFO, *PDPL_CONNECT_INFO; - -// -// Information for registering an application -// (RegisterApplication) -// -typedef struct _DPL_PROGRAM_DESC { - DWORD dwSize; - DWORD dwFlags; - GUID guidApplication; // Application GUID - PWSTR pwszApplicationName; // Unicode application name - PWSTR pwszCommandLine; // Unicode command line arguments - PWSTR pwszCurrentDirectory; // Unicode current directory - PWSTR pwszDescription; // Unicode application description - PWSTR pwszExecutableFilename; // Unicode filename of application executable - PWSTR pwszExecutablePath; // Unicode path of application executable - PWSTR pwszLauncherFilename; // Unicode filename of launcher executable - PWSTR pwszLauncherPath; // Unicode path of launcher executable -} DPL_PROGRAM_DESC, *PDPL_PROGRAM_DESC; - -/**************************************************************************** - * - * DirectPlay8 Lobby Message Structures - * - ****************************************************************************/ - -// -// A connection was established -// (DPL_MSGID_CONNECT) -// -typedef struct _DPL_MESSAGE_CONNECT -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hConnectId; // Handle of new connection - PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings for this connection - PVOID pvLobbyConnectData; // User defined lobby data block - DWORD dwLobbyConnectDataSize; // Size of user defined lobby data block - PVOID pvConnectionContext; // Context value for this connection (user set) -} DPL_MESSAGE_CONNECT, *PDPL_MESSAGE_CONNECT; - -// -// Connection settings have been updated -// (DPL_MSGID_CONNECTION_SETTINGS) -// -typedef struct _DPL_MESSAGE_CONNECTION_SETTINGS -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hSender; // Handle of the connection for these settings - PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings - PVOID pvConnectionContext; // Context value for this connection -} DPL_MESSAGE_CONNECTION_SETTINGS, *PDPL_MESSAGE_CONNECTION_SETTINGS; - -// -// A connection has been disconnected -// (DPL_MSGID_DISCONNECT) -// -typedef struct _DPL_MESSAGE_DISCONNECT -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hDisconnectId; // Handle of the connection that was terminated - HRESULT hrReason; // Reason the connection was broken - PVOID pvConnectionContext; // Context value for this connection -} DPL_MESSAGE_DISCONNECT, *PDPL_MESSAGE_DISCONNECT; - -// -// Data was received through a connection -// (DPL_MSGID_RECEIVE) -// -typedef struct _DPL_MESSAGE_RECEIVE -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hSender; // Handle of the connection that is from - BYTE *pBuffer; // Contents of the message - DWORD dwBufferSize; // Size of the message context - PVOID pvConnectionContext; // Context value for this connection -} DPL_MESSAGE_RECEIVE, *PDPL_MESSAGE_RECEIVE; - -// -// Current status of the associated connection -// (DPL_MSGID_SESSION_STATUS) -// -typedef struct _DPL_MESSAGE_SESSION_STATUS -{ - DWORD dwSize; // Size of this structure - DPNHANDLE hSender; // Handle of the connection that this is from - DWORD dwStatus; // Status (DPLSESSION_...) - PVOID pvConnectionContext; // Context value for this connection -} DPL_MESSAGE_SESSION_STATUS, *PDPL_MESSAGE_SESSION_STATUS; - -/**************************************************************************** - * - * DirectPlay8Lobby Create - * - ****************************************************************************/ - -/* - * This function is no longer supported. It is recommended that CoCreateInstance be used to create - * DirectPlay8 lobby objects. - * - * extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); - * - */ - -/**************************************************************************** - * - * DirectPlay8 Functions - * - ****************************************************************************/ - -// -// COM definition for DirectPlayLobbyClient -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8LobbyClient -DECLARE_INTERFACE_(IDirectPlay8LobbyClient,IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - // IDirectPlayLobbyClient methods - STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,const DWORD dwFlags) PURE; - STDMETHOD(EnumLocalPrograms) (THIS_ GUID *const pGuidApplication,BYTE *const pEnumData,DWORD *const pdwEnumData,DWORD *const pdwItems, const DWORD dwFlags) PURE; - STDMETHOD(ConnectApplication) (THIS_ DPL_CONNECT_INFO *const pdplConnectionInfo,const PVOID pvConnectionContext,DPNHANDLE *const hApplication,const DWORD dwTimeOut,const DWORD dwFlags) PURE; - STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE; - STDMETHOD(ReleaseApplication) (THIS_ const DPNHANDLE hConnection, const DWORD dwFlags ) PURE; - STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE; - STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE; - STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE; -}; - - -// -// COM definition for DirectPlayLobbiedApplication -// -#undef INTERFACE // External COM Implementation -#define INTERFACE IDirectPlay8LobbiedApplication -DECLARE_INTERFACE_(IDirectPlay8LobbiedApplication,IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - // IDirectPlayLobbiedApplication methods - STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,DPNHANDLE * const pdpnhConnection, const DWORD dwFlags) PURE; - STDMETHOD(RegisterProgram) (THIS_ PDPL_PROGRAM_DESC pdplProgramDesc,const DWORD dwFlags) PURE; - STDMETHOD(UnRegisterProgram) (THIS_ GUID *pguidApplication,const DWORD dwFlags) PURE; - STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE; - STDMETHOD(SetAppAvailable) (THIS_ const BOOL fAvailable, const DWORD dwFlags ) PURE; - STDMETHOD(UpdateStatus) (THIS_ const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags ) PURE; - STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE; - STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE; - STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE; -}; - - -/**************************************************************************** - * - * DirectPlayLobby Interface Macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8LobbyClient_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8LobbyClient_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->lpVtbl->EnumLocalPrograms(p,a,b,c,d,e) -#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->lpVtbl->ConnectApplication(p,a,b,c,d,e) -#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d) -#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->lpVtbl->ReleaseApplication(p,a,b) -#define IDirectPlay8LobbyClient_Close(p,a) (p)->lpVtbl->Close(p,a) -#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d) -#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) - -#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay8LobbiedApplication_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d) -#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->lpVtbl->RegisterProgram(p,a,b) -#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->lpVtbl->UnRegisterProgram(p,a,b) -#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d) -#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->lpVtbl->SetAppAvailable(p,a,b) -#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->lpVtbl->UpdateStatus(p,a,b,c) -#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->lpVtbl->Close(p,a) -#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d) -#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8LobbyClient_AddRef(p) (p)->AddRef() -#define IDirectPlay8LobbyClient_Release(p) (p)->Release() -#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->EnumLocalPrograms(a,b,c,d,e) -#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->ConnectApplication(a,b,c,d,e) -#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->Send(a,b,c,d) -#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->ReleaseApplication(a,b) -#define IDirectPlay8LobbyClient_Close(p,a) (p)->Close(a) -#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d) -#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) - -#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->AddRef() -#define IDirectPlay8LobbiedApplication_Release(p) (p)->Release() -#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->Initialize(a,b,c,d) -#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->RegisterProgram(a,b) -#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->UnRegisterProgram(a,b) -#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->Send(a,b,c,d) -#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->SetAppAvailable(a,b) -#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->UpdateStatus(a,b,c) -#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->Close(a) -#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d) -#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) - -#endif - -#ifdef __cplusplus -} -#endif - -#endif // __DPLOBBY_H__ - diff --git a/import/DirectX8/include/dsetup.h b/import/DirectX8/include/dsetup.h deleted file mode 100644 index 3f0de4640..000000000 --- a/import/DirectX8/include/dsetup.h +++ /dev/null @@ -1,308 +0,0 @@ -/*========================================================================== - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dsetup.h - * Content: DirectXSetup, error codes and flags - ***************************************************************************/ - -#ifndef __DSETUP_H__ -#define __DSETUP_H__ - -#include // windows stuff - -#ifdef _WIN32 -#define COM_NO_WINDOWS_H -#include -#else -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -#define FOURCC_VERS mmioFOURCC('v','e','r','s') - -// DSETUP Error Codes, must remain compatible with previous setup. -#define DSETUPERR_SUCCESS_RESTART 1 -#define DSETUPERR_SUCCESS 0 -#define DSETUPERR_BADWINDOWSVERSION -1 -#define DSETUPERR_SOURCEFILENOTFOUND -2 -#define DSETUPERR_BADSOURCESIZE -3 -#define DSETUPERR_BADSOURCETIME -4 -#define DSETUPERR_NOCOPY -5 -#define DSETUPERR_OUTOFDISKSPACE -6 -#define DSETUPERR_CANTFINDINF -7 -#define DSETUPERR_CANTFINDDIR -8 -#define DSETUPERR_INTERNAL -9 -#define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */ -#define DSETUPERR_UNKNOWNOS -11 -#define DSETUPERR_USERHITCANCEL -12 -#define DSETUPERR_NOTPREINSTALLEDONNT -13 -#define DSETUPERR_NEWERVERSION -14 -#define DSETUPERR_NOTADMIN -15 -#define DSETUPERR_UNSUPPORTEDPROCESSOR -16 - -// DSETUP flags. DirectX 5.0 apps should use these flags only. -#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */ -#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */ -#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */ -#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV) -#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */ -#define DSETUP_USEROLDERFLAG 0x02000000 /* enable return DSETUPERR_NEWERVERSION */ - -// These OBSOLETE flags are here for compatibility with pre-DX5 apps only. -// They are present to allow DX3 apps to be recompiled with DX5 and still work. -// DO NOT USE THEM for DX5. They will go away in future DX releases. -#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */ -#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */ -#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */ -#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */ -#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */ -#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */ -#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */ -#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */ -#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */ -#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */ -#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */ - - - -//****************************************************************** -// DirectX Setup Callback mechanism -//****************************************************************** - -// DSETUP Message Info Codes, passed to callback as Reason parameter. -#define DSETUP_CB_MSG_NOMESSAGE 0 -#define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1 -#define DSETUP_CB_MSG_CANTINSTALL_NT 2 -#define DSETUP_CB_MSG_CANTINSTALL_BETA 3 -#define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4 -#define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5 -#define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6 -#define DSETUP_CB_MSG_PREINSTALL_NT 7 -#define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8 -#define DSETUP_CB_MSG_SETUP_INIT_FAILED 9 -#define DSETUP_CB_MSG_INTERNAL_ERROR 10 -#define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11 -#define DSETUP_CB_MSG_OUTOFDISKSPACE 12 -#define DSETUP_CB_MSG_BEGIN_INSTALL 13 -#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14 -#define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15 -#define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16 -#define DSETUP_CB_MSG_FILECOPYERROR 17 - - -#define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F -#define DSETUP_CB_UPGRADE_KEEP 0x0001 -#define DSETUP_CB_UPGRADE_SAFE 0x0002 -#define DSETUP_CB_UPGRADE_FORCE 0x0004 -#define DSETUP_CB_UPGRADE_UNKNOWN 0x0008 - -#define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100 -#define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200 - -#define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800 - -#define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000 -#define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000 - - -typedef struct _DSETUP_CB_UPGRADEINFO -{ - DWORD UpgradeFlags; -} DSETUP_CB_UPGRADEINFO; - -typedef struct _DSETUP_CB_FILECOPYERROR -{ - DWORD dwError; -} DSETUP_CB_FILECOPYERROR; - - -#ifdef _WIN32 -// -// Data Structures -// -#ifndef UNICODE_ONLY - -typedef struct _DIRECTXREGISTERAPPA { - DWORD dwSize; - DWORD dwFlags; - LPSTR lpszApplicationName; - LPGUID lpGUID; - LPSTR lpszFilename; - LPSTR lpszCommandLine; - LPSTR lpszPath; - LPSTR lpszCurrentDirectory; -} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA; - -typedef struct _DIRECTXREGISTERAPP2A { - DWORD dwSize; - DWORD dwFlags; - LPSTR lpszApplicationName; - LPGUID lpGUID; - LPSTR lpszFilename; - LPSTR lpszCommandLine; - LPSTR lpszPath; - LPSTR lpszCurrentDirectory; - LPSTR lpszLauncherName; -} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A; - -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY - -typedef struct _DIRECTXREGISTERAPPW { - DWORD dwSize; - DWORD dwFlags; - LPWSTR lpszApplicationName; - LPGUID lpGUID; - LPWSTR lpszFilename; - LPWSTR lpszCommandLine; - LPWSTR lpszPath; - LPWSTR lpszCurrentDirectory; -} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW; - -typedef struct _DIRECTXREGISTERAPP2W { - DWORD dwSize; - DWORD dwFlags; - LPWSTR lpszApplicationName; - LPGUID lpGUID; - LPWSTR lpszFilename; - LPWSTR lpszCommandLine; - LPWSTR lpszPath; - LPWSTR lpszCurrentDirectory; - LPWSTR lpszLauncherName; -} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W; -#endif //!ANSI_ONLY -#ifdef UNICODE -typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP; -typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP; -typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP; -typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2; -typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2; -typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2; -#else -typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP; -typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP; -typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP; -typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2; -typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2; -typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2; -#endif // UNICODE - - -// -// API -// - -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXSetupA( - HWND hWnd, - LPSTR lpszRootPath, - DWORD dwFlags - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXSetupW( - HWND hWnd, - LPWSTR lpszRootPath, - DWORD dwFlags - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXSetup DirectXSetupW -#else -#define DirectXSetup DirectXSetupA -#endif // !UNICODE - - -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXDeviceDriverSetupA( - HWND hWnd, - LPSTR lpszDriverClass, - LPSTR lpszDriverPath, - DWORD dwFlags - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXDeviceDriverSetupW( - HWND hWnd, - LPWSTR lpszDriverClass, - LPWSTR lpszDriverPath, - DWORD dwFlags - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW -#else -#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA -#endif // !UNICODE - -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXRegisterApplicationA( - HWND hWnd, - LPVOID lpDXRegApp - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXRegisterApplicationW( - HWND hWnd, - LPVOID lpDXRegApp - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXRegisterApplication DirectXRegisterApplicationW -#else -#define DirectXRegisterApplication DirectXRegisterApplicationA -#endif // !UNICODE - -INT -WINAPI -DirectXUnRegisterApplication( - HWND hWnd, - LPGUID lpGUID - ); - -// -// Function Pointers -// -#ifdef UNICODE -typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); -#else -typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); -#endif // UNICODE - -typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason, - DWORD MsgType, /* Same as flags to MessageBox */ - LPSTR szMessage, - LPSTR szName, - void *pInfo); - -INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback); -INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion); - -#endif // WIN32 - - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/import/DirectX8/include/dshowasf.h b/import/DirectX8/include/dshowasf.h deleted file mode 100644 index 14d194876..000000000 --- a/import/DirectX8/include/dshowasf.h +++ /dev/null @@ -1,329 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0338 */ -/* Compiler settings for dshowasf.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __dshowasf_h__ -#define __dshowasf_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IConfigAsfWriter_FWD_DEFINED__ -#define __IConfigAsfWriter_FWD_DEFINED__ -typedef interface IConfigAsfWriter IConfigAsfWriter; -#endif /* __IConfigAsfWriter_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" -#include "strmif.h" -#include "wmsdkidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_dshowasf_0000 */ -/* [local] */ - -EXTERN_GUID( IID_IConfigAsfWriter,0x45086030,0xF7E4,0x486a,0xB5,0x04,0x82,0x6B,0xB5,0x79,0x2A,0x3B ); - - - - -extern RPC_IF_HANDLE __MIDL_itf_dshowasf_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dshowasf_0000_v0_0_s_ifspec; - -#ifndef __IConfigAsfWriter_INTERFACE_DEFINED__ -#define __IConfigAsfWriter_INTERFACE_DEFINED__ - -/* interface IConfigAsfWriter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IConfigAsfWriter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("45086030-F7E4-486a-B504-826BB5792A3B") - IConfigAsfWriter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfileId( - /* [in] */ DWORD dwProfileId) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentProfileId( - /* [out] */ DWORD *pdwProfileId) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfileGuid( - /* [in] */ REFGUID guidProfile) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentProfileGuid( - /* [out] */ GUID *pProfileGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConfigureFilterUsingProfile( - /* [in] */ IWMProfile *pProfile) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentProfile( - /* [out] */ IWMProfile **ppProfile) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIndexMode( - /* [in] */ BOOL bIndexFile) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIndexMode( - /* [out] */ BOOL *pbIndexFile) = 0; - - }; - -#else /* C style interface */ - - typedef struct IConfigAsfWriterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IConfigAsfWriter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IConfigAsfWriter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IConfigAsfWriter * This); - - HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfileId )( - IConfigAsfWriter * This, - /* [in] */ DWORD dwProfileId); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentProfileId )( - IConfigAsfWriter * This, - /* [out] */ DWORD *pdwProfileId); - - HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfileGuid )( - IConfigAsfWriter * This, - /* [in] */ REFGUID guidProfile); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentProfileGuid )( - IConfigAsfWriter * This, - /* [out] */ GUID *pProfileGuid); - - HRESULT ( STDMETHODCALLTYPE *ConfigureFilterUsingProfile )( - IConfigAsfWriter * This, - /* [in] */ IWMProfile *pProfile); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentProfile )( - IConfigAsfWriter * This, - /* [out] */ IWMProfile **ppProfile); - - HRESULT ( STDMETHODCALLTYPE *SetIndexMode )( - IConfigAsfWriter * This, - /* [in] */ BOOL bIndexFile); - - HRESULT ( STDMETHODCALLTYPE *GetIndexMode )( - IConfigAsfWriter * This, - /* [out] */ BOOL *pbIndexFile); - - END_INTERFACE - } IConfigAsfWriterVtbl; - - interface IConfigAsfWriter - { - CONST_VTBL struct IConfigAsfWriterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IConfigAsfWriter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IConfigAsfWriter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IConfigAsfWriter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IConfigAsfWriter_ConfigureFilterUsingProfileId(This,dwProfileId) \ - (This)->lpVtbl -> ConfigureFilterUsingProfileId(This,dwProfileId) - -#define IConfigAsfWriter_GetCurrentProfileId(This,pdwProfileId) \ - (This)->lpVtbl -> GetCurrentProfileId(This,pdwProfileId) - -#define IConfigAsfWriter_ConfigureFilterUsingProfileGuid(This,guidProfile) \ - (This)->lpVtbl -> ConfigureFilterUsingProfileGuid(This,guidProfile) - -#define IConfigAsfWriter_GetCurrentProfileGuid(This,pProfileGuid) \ - (This)->lpVtbl -> GetCurrentProfileGuid(This,pProfileGuid) - -#define IConfigAsfWriter_ConfigureFilterUsingProfile(This,pProfile) \ - (This)->lpVtbl -> ConfigureFilterUsingProfile(This,pProfile) - -#define IConfigAsfWriter_GetCurrentProfile(This,ppProfile) \ - (This)->lpVtbl -> GetCurrentProfile(This,ppProfile) - -#define IConfigAsfWriter_SetIndexMode(This,bIndexFile) \ - (This)->lpVtbl -> SetIndexMode(This,bIndexFile) - -#define IConfigAsfWriter_GetIndexMode(This,pbIndexFile) \ - (This)->lpVtbl -> GetIndexMode(This,pbIndexFile) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfileId_Proxy( - IConfigAsfWriter * This, - /* [in] */ DWORD dwProfileId); - - -void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfileId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfileId_Proxy( - IConfigAsfWriter * This, - /* [out] */ DWORD *pdwProfileId); - - -void __RPC_STUB IConfigAsfWriter_GetCurrentProfileId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfileGuid_Proxy( - IConfigAsfWriter * This, - /* [in] */ REFGUID guidProfile); - - -void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfileGuid_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfileGuid_Proxy( - IConfigAsfWriter * This, - /* [out] */ GUID *pProfileGuid); - - -void __RPC_STUB IConfigAsfWriter_GetCurrentProfileGuid_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_ConfigureFilterUsingProfile_Proxy( - IConfigAsfWriter * This, - /* [in] */ IWMProfile *pProfile); - - -void __RPC_STUB IConfigAsfWriter_ConfigureFilterUsingProfile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetCurrentProfile_Proxy( - IConfigAsfWriter * This, - /* [out] */ IWMProfile **ppProfile); - - -void __RPC_STUB IConfigAsfWriter_GetCurrentProfile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_SetIndexMode_Proxy( - IConfigAsfWriter * This, - /* [in] */ BOOL bIndexFile); - - -void __RPC_STUB IConfigAsfWriter_SetIndexMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAsfWriter_GetIndexMode_Proxy( - IConfigAsfWriter * This, - /* [out] */ BOOL *pbIndexFile); - - -void __RPC_STUB IConfigAsfWriter_GetIndexMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IConfigAsfWriter_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dv.h b/import/DirectX8/include/dv.h deleted file mode 100644 index d0fe04851..000000000 --- a/import/DirectX8/include/dv.h +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DV.h -// -// Desc: DV typedefs and defines -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _DV_H_ -#define _DV_H_ - -#define DV_DVSD_NTSC_FRAMESIZE 120000L -#define DV_DVSD_PAL_FRAMESIZE 144000L - -#define DV_SMCHN 0x0000e000 -#define DV_AUDIOMODE 0x00000f00 -#define DV_AUDIOSMP 0x38000000 - -#define DV_AUDIOQU 0x07000000 -#define DV_NTSCPAL 0x00200000 -#define DV_STYPE 0x001f0000 - - -//There are NTSC or PAL DV camcorders -#define DV_NTSC 0 -#define DV_PAL 1 - -//DV camcorder can output sd/hd/sl -#define DV_SD 0x00 -#define DV_HD 0x01 -#define DV_SL 0x02 - -//user can choice 12 bits or 16 bits audio from DV camcorder -#define DV_CAP_AUD16Bits 0x00 -#define DV_CAP_AUD12Bits 0x01 - -#define SIZE_DVINFO 0x20 - -typedef struct Tag_DVAudInfo -{ - BYTE bAudStyle[2]; - - //LSB 6 bits for starting DIF sequence number - //MSB 2 bits: 0 for mon. 1: stereo in one 5/6 DIF sequences, 2: stereo audio in both 5/6 DIF sequences - //example: 0x00: mon, audio in first 5/6 DIF sequence - // 0x05: mon, audio in 2nd 5 DIF sequence - // 0x15: stereo, audio only in 2nd 5 DIF sequence - // 0x10: stereo, audio only in 1st 5/6 DIF sequence - // 0x20: stereo, left ch in 1st 5/6 DIF sequence, right ch in 2nd 5/6 DIF sequence - // 0x26: stereo, rightch in 1st 6 DIF sequence, left ch in 2nd 6 DIF sequence - BYTE bAudQu[2]; //qbits, only support 12, 16, - - BYTE bNumAudPin; //how many pins - WORD wAvgSamplesPerPinPerFrm[2]; //sample size for one audio pin in one frame(which has 10 or 12 DIF sequence) - WORD wBlkMode; //45 for NTSC, 54 for PAL - WORD wDIFMode; //5 for NTSC, 6 for PAL - WORD wBlkDiv; //15 for NTSC, 18 for PAL - -} DVAudInfo; - -#endif // _DV_H_ diff --git a/import/DirectX8/include/dvdevcod.h b/import/DirectX8/include/dvdevcod.h deleted file mode 100644 index 69a12c184..000000000 --- a/import/DirectX8/include/dvdevcod.h +++ /dev/null @@ -1,731 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DVDevCod.h -// -// Desc: List of standard DVD-Video event codes and the expected params. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - -#ifndef __DVDEVCOD__ -#define __DVDEVCOD__ - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - -#define EC_DVDBASE 0x0100 - -#ifndef EXCLUDE_DVDEVCODE_ENUMS - -typedef enum _tagDVD_ERROR { - DVD_ERROR_Unexpected=1, // Something unexpected happened, perhaps content - // is incorrectly authored. Playback is stopped. - DVD_ERROR_CopyProtectFail=2, // Key exchange for DVD copy protection failed. - // Playback is stopped. - DVD_ERROR_InvalidDVD1_0Disc=3, // DVD-Video disc is incorrectly authored for v1.0 - // of spec. Playback is stopped. - DVD_ERROR_InvalidDiscRegion=4, // The Disc cannot be played because the disc is not - // authored to play in system region. - // The region mismatch may be fixable by - // changing the system region with dvdrgn.exe - DVD_ERROR_LowParentalLevel=5, // Player parental level is lower than the lowest parental - // level available in the DVD content. Playback is stopped. - DVD_ERROR_MacrovisionFail=6, // Macrovision Distribution Failed. - // Playback is stopped. - DVD_ERROR_IncompatibleSystemAndDecoderRegions=7, - // No discs can be played because the system region - // does not match the decoder region. - DVD_ERROR_IncompatibleDiscAndDecoderRegions=8 - // The disc cannot be played because the disc is - // not authored to be played in the decoder's region -} DVD_ERROR; - -typedef enum _tagDVD_WARNING { - DVD_WARNING_InvalidDVD1_0Disc=1,// DVD-Video disc is incorrectly authored. Playback - // can continue, but unexpected behavior may occur. - DVD_WARNING_FormatNotSupported=2,// A decoder would not support the current format. Playback - // of a stream (audio, video of SP) may not function. - // lParam2 contains the stream type (see AM_DVD_STREAM_FLAGS) - DVD_WARNING_IllegalNavCommand=3,// The internal DVD navigation command processor attempted to - // process an illegal command. - DVD_WARNING_Open = 4, // File Open Failed - DVD_WARNING_Seek = 5, // File Seek Failed - DVD_WARNING_Read = 6 // File Read Failed -} DVD_WARNING; - -typedef enum _tagDVD_PB_STOPPED { - DVD_PB_STOPPED_Other=0, // The navigator stopped the playback (no reason available). - DVD_PB_STOPPED_NoBranch=1, // The nav completed the current pgc and there was no more video and - // did not find any other branching instruction for subsequent playback. - DVD_PB_STOPPED_NoFirstPlayDomain =2, // The disc does not contain an initial startup program. - DVD_PB_STOPPED_StopCommand = 3, // The app issued a stop() command or a stop command was authored on the disc. - DVD_PB_STOPPED_Reset=4, // The navigator was reset to the start of the disc (using ResetOnStop). - DVD_PB_STOPPED_DiscEjected=5, // The disc was ejected. - DVD_PB_STOPPED_IllegalNavCommand = 6, // An illegal nav command prevented playback from continuing. - DVD_PB_STOPPED_PlayPeriodAutoStop = 7, // PlayPeriod completed - DVD_PB_STOPPED_PlayChapterAutoStop = 8, // PlayChapter completed - DVD_PB_STOPPED_ParentalFailure = 9, // A parental level failure prevented playback - DVD_PB_STOPPED_RegionFailure = 10, // A region failure prevented playback - DVD_PB_STOPPED_MacrovisionFailure = 11, // A Macrovision failure prevented playback. - DVD_PB_STOPPED_DiscReadError = 12, // A read error prevented playback. - DVD_PB_STOPPED_CopyProtectFailure = 13 // Copy protection failure. -} DVD_PB_STOPPED; - - -#endif - -// DVD-Video event codes -// ====================== -// -// All DVD-Video event are always passed on to the application, and are -// never processed by the filter graph - - -#define EC_DVD_DOMAIN_CHANGE (EC_DVDBASE + 0x01) -// Parameters: ( DWORD, void ) -// lParam1 is enum DVD_DOMAIN, and indicates the player's new domain -// -// Raised from following domains: all -// -// Signaled when ever the DVD player changes domains. - - -#define EC_DVD_TITLE_CHANGE (EC_DVDBASE + 0x02) -// Parameters: ( DWORD, void ) -// lParam1 is the new title number. -// -// Raised from following domains: DVD_DOMAIN_Title -// -// Indicates when the current title number changes. Title numbers -// range 1 to 99. This indicates the TTN, which is the title number -// with respect to the whole disc, not the VTS_TTN which is the title -// number with respect to just a current VTS. - - -#define EC_DVD_CHAPTER_START (EC_DVDBASE + 0x03) -// Parameters: ( DWORD, void ) -// lParam1 is the new chapter number (which is the program number for -// One_Sequential_PGC_Titles). -// -// Raised from following domains: DVD_DOMAIN_Title -// -// Signales that DVD player started playback of a new program in the Title -// domain. This is only signaled for One_Sequential_PGC_Titles. - - -#define EC_DVD_AUDIO_STREAM_CHANGE (EC_DVDBASE + 0x04) -// Parameters: ( DWORD, void ) -// lParam1 is the new user audio stream number. -// -// Raised from following domains: all -// -// Signaled when ever the current user audio stream number changes for the main -// title. This can be changed automatically with a navigation command on disc -// as well as through IDVDAnnexJ. -// Audio stream numbers range from 0 to 7. Stream 0xffffffff -// indicates that no stream is selected. - -#define EC_DVD_SUBPICTURE_STREAM_CHANGE (EC_DVDBASE + 0x05) -// Parameters: ( DWORD, BOOL ) -// lParam1 is the new user subpicture stream number. -// lParam2 is the subpicture's on/off state (TRUE if on) -// -// Raised from following domains: all -// -// Signaled when ever the current user subpicture stream number changes for the main -// title. This can be changed automatically with a navigation command on disc -// as well as through IDVDAnnexJ. -// Subpicture stream numbers range from 0 to 31. Stream 0xffffffff -// indicates that no stream is selected. - -#define EC_DVD_ANGLE_CHANGE (EC_DVDBASE + 0x06) -// Parameters: ( DWORD, DWORD ) -// lParam1 is the number of available angles. -// lParam2 is the current user angle number. -// -// Raised from following domains: all -// -// Signaled when ever either -// a) the number of available angles changes, or -// b) the current user angle number changes. -// Current angle number can be changed automatically with navigation command -// on disc as well as through IDVDAnnexJ. -// When the number of available angles is 1, the current video is not multiangle. -// Angle numbers range from 1 to 9. - - -#define EC_DVD_BUTTON_CHANGE (EC_DVDBASE + 0x07) -// Parameters: ( DWORD, DWORD ) -// lParam1 is the number of available buttons. -// lParam2 is the current selected button number. -// -// Raised from following domains: all -// -// Signaled when ever either -// a) the number of available buttons changes, or -// b) the current selected button number changes. -// The current selected button can be changed automatically with navigation -// commands on disc as well as through IDVDAnnexJ. -// Button numbers range from 1 to 36. Selected button number 0 implies that -// no button is selected. Note that these button numbers enumerate all -// available button numbers, and do not always correspond to button numbers -// used for IDVDAnnexJ::ButtonSelectAndActivate since only a subset of buttons -// may be activated with ButtonSelectAndActivate. - - -#define EC_DVD_VALID_UOPS_CHANGE (EC_DVDBASE + 0x08) -// Parameters: ( DWORD, void ) -// lParam1 is a VALID_UOP_SOMTHING_OR_OTHER bit-field stuct which indicates -// which IDVDAnnexJ commands are explicitly disable by the DVD disc. -// -// Raised from following domains: all -// -// Signaled when ever the available set of IDVDAnnexJ methods changes. This -// only indicates which operations are explicited disabled by the content on -// the DVD disc, and does not guarentee that it is valid to call methods -// which are not disabled. For example, if no buttons are currently present, -// IDVDAnnexJ::ButtonActivate() won't work, even though the buttons are not -// explicitly disabled. - - -#define EC_DVD_STILL_ON (EC_DVDBASE + 0x09) -// Parameters: ( BOOL, DWORD ) -// lParam1 == 0 --> buttons are available, so StillOff won't work -// lParam1 == 1 --> no buttons available, so StillOff will work -// lParam2 indicates the number of seconds the still will last, with 0xffffffff -// indicating an infinite still (wait till button or StillOff selected). -// -// Raised from following domains: all -// -// Signaled at the beginning of any still: PGC still, Cell Still, or VOBU Still. -// Note that all combinations of buttons and still are possible (buttons on with -// still on, buttons on with still off, button off with still on, button off -// with still off). - -#define EC_DVD_STILL_OFF (EC_DVDBASE + 0x0a) -// Parameters: ( void, void ) -// -// Indicating that any still that is currently active -// has been released. -// -// Raised from following domains: all -// -// Signaled at the end of any still: PGC still, Cell Still, or VOBU Still. -// - -#define EC_DVD_CURRENT_TIME (EC_DVDBASE + 0x0b) -// Parameters: ( DWORD, BOOL ) -// lParam1 is a DVD_TIMECODE which indicates the current -// playback time code in a BCD HH:MM:SS:FF format. -// lParam2 == 0 --> time code is 25 frames/sec -// lParam2 == 1 --> time code is 30 frames/sec (non-drop). -// lParam2 == 2 --> time code is invalid (current playback time -// cannot be determined for current title) -// -// Raised from following domains: DVD_DOMAIN_Title -// -// Signaled at the beginning of every VOBU, which occurs every .4 to 1.0 sec. -// This is only signaled for One_Sequential_PGC_Titles. - - -#define EC_DVD_ERROR (EC_DVDBASE + 0x0c) -// Parameters: ( DWORD, void) -// lParam1 is an enum DVD_ERROR which notifies the app of some error condition. -// -// Raised from following domains: all -// - -#define EC_DVD_WARNING (EC_DVDBASE + 0x0d) -// Parameters: ( DWORD, DWORD) -// lParam1 is an enum DVD_WARNING which notifies the app of some warning condition. -// lParam2 contains more specific information about the warning (warning dependent) -// -// Raised from following domains: all -// - -#define EC_DVD_CHAPTER_AUTOSTOP (EC_DVDBASE + 0x0e) -// Parameters: (BOOL, void) -// lParam1 is a BOOL which indicates the reason for the cancellation of ChapterPlayAutoStop -// lParam1 == 0 indicates successful completion of ChapterPlayAutoStop -// lParam1 == 1 indicates that ChapterPlayAutoStop is being cancelled as a result of another -// IDVDControl call or the end of content has been reached & no more chapters -// can be played. -// Indicating that playback is stopped as a result of a call -// to IDVDControl::ChapterPlayAutoStop() -// -// Raised from following domains : DVD_DOMAIN_TITLE -// - -#define EC_DVD_NO_FP_PGC (EC_DVDBASE + 0x0f) -// Parameters : (void, void) -// -// Raised from the following domains : FP_DOM -// -// Indicates that the DVD disc does not have a FP_PGC (First Play Program Chain) -// and the DVD Navigator will not automatically load any PGC and start playback. -// - -#define EC_DVD_PLAYBACK_RATE_CHANGE (EC_DVDBASE + 0x10) -// Parameters : (LONG, void) -// lParam1 is a LONG indicating the new playback rate. -// lParam1 < 0 indicates reverse playback mode. -// lParam1 > 0 indicates forward playback mode -// Value of lParam1 is the actual playback rate multiplied by 10000. -// i.e. lParam1 = rate * 10000 -// -// Raised from the following domains : TT_DOM -// -// Indicates that a rate change in playback has been initiated and the parameter -// lParam1 indicates the new playback rate that is being used. -// - -#define EC_DVD_PARENTAL_LEVEL_CHANGE (EC_DVDBASE + 0x11) -// Parameters : (LONG, void) -// lParam1 is a LONG indicating the new parental level. -// -// Raised from the following domains : VMGM_DOM -// -// Indicates that an authored Nav command has changed the parental level -// setting in the player. -// - -#define EC_DVD_PLAYBACK_STOPPED (EC_DVDBASE + 0x12) -// Parameters : (DWORD, void) -// -// Raised from the following domains : All Domains -// -// Indicates that playback has been stopped as the Navigator has completed -// playback of the pgc and did not find any other branching instruction for -// subsequent playback. -// -// The DWORD returns the reason for the completion of the playback. See -// The DVD_PB_STOPPED enumeration for details. -// - -#define EC_DVD_ANGLES_AVAILABLE (EC_DVDBASE + 0x13) -// Parameters : (BOOL, void) -// lParam1 == 0 indicates that playback is not in an angle block and angles are -// not available -// lParam1 == 1 indicates that an angle block is being played back and angle changes -// can be performed. -// -// Indicates whether an angle block is being played and if angle changes can be -// performed. However, angle changes are not restricted to angle blocks and the -// manifestation of the angle change can be seen only in an angle block. - -#define EC_DVD_PLAYPERIOD_AUTOSTOP (EC_DVDBASE + 0x14) -// Parameters: (void, void) -// Sent when the PlayPeriodInTitle completes or is cancelled -// -// Raised from following domains : DVD_DOMAIN_TITLE -// - -#define EC_DVD_BUTTON_AUTO_ACTIVATED (EC_DVDBASE + 0x15) -// Parameters: (DWORD button, void) -// Sent when a button is automatically activated -// -// Raised from following domains : DVD_DOMAIN_MENU -// - -#define EC_DVD_CMD_START (EC_DVDBASE + 0x16) -// Parameters: (CmdID, HRESULT) -// Sent when a command begins -// - -#define EC_DVD_CMD_END (EC_DVDBASE + 0x17) -// Parameters: (CmdID, HRESULT) -// Sent when a command completes -// - -#define EC_DVD_DISC_EJECTED (EC_DVDBASE + 0x18) -// Parameters: none -// Sent when the nav detects that a disc was ejected and stops the playback -// The app does not need to take any action to stop the playback. -// - -#define EC_DVD_DISC_INSERTED (EC_DVDBASE + 0x19) -// Parameters: none -// Sent when the nav detects that a disc was inserted and the nav begins playback -// The app does not need to take any action to start the playback. -// - -#define EC_DVD_CURRENT_HMSF_TIME (EC_DVDBASE + 0x1a) -// Parameters: ( ULONG, ULONG ) -// lParam2 contains a union of the DVD_TIMECODE_FLAGS -// lParam1 contains a DVD_HMSF_TIMECODE. Assign lParam1 to a ULONG then cast the -// ULONG as a DVD_HMSF_TIMECODE to use its values. -// -// Raised from following domains: DVD_DOMAIN_Title -// -// Signaled at the beginning of every VOBU, which occurs every .4 to 1.0 sec. - -#define EC_DVD_KARAOKE_MODE (EC_DVDBASE + 0x1b) -// Parameters: ( BOOL, reserved ) -// lParam1 is either TRUE (a karaoke track is being played) or FALSE (no karaoke data is being played). -// - - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - #define EC_DVDBASE 0x0100 - - #ifndef EXCLUDE_DVDEVCODE_ENUMS - - typedef enum _tagDVD_ERROR { - DVD_ERROR_Unexpected=1, // Something unexpected happened, perhaps content - // is incorrectly authored. Playback is stopped. - DVD_ERROR_CopyProtectFail=2, // Key exchange for DVD copy protection failed. - // Playback is stopped. - DVD_ERROR_InvalidDVD1_0Disc=3, // DVD-Video disc is incorrectly authored for v1.0 - // of spec. Playback is stopped. - DVD_ERROR_InvalidDiscRegion=4, // The Disc cannot be played because the disc is not - // authored to play in system region. - // The region mismatch may be fixable by - // changing the system region with dvdrgn.exe - DVD_ERROR_LowParentalLevel=5, // Player parental level is lower than the lowest parental - // level available in the DVD content. Playback is stopped. - DVD_ERROR_MacrovisionFail=6, // Macrovision Distribution Failed. - // Playback is stopped. - DVD_ERROR_IncompatibleSystemAndDecoderRegions=7, - // No discs can be played because the system region - // does not match the decoder region. - DVD_ERROR_IncompatibleDiscAndDecoderRegions=8 - // The disc cannot be played because the disc is - // not authored to be played in the decoder's region - } DVD_ERROR; - - typedef enum _tagDVD_WARNING { - DVD_WARNING_InvalidDVD1_0Disc=1,// DVD-Video disc is incorrectly authored. Playback - // can continue, but unexpected behavior may occur. - DVD_WARNING_FormatNotSupported=2,// A decoder would not support the current format. Playback - // of a stream (audio, video of SP) may not function. - DVD_WARNING_IllegalNavCommand=3,// The internal DVD navigation command processor attempted to - // process an illegal command. - DVD_WARNING_Open = 4, // File Open Failed - DVD_WARNING_Seek = 5, // File Seek Failed - DVD_WARNING_Read = 6 // File Read Failed - } DVD_WARNING; - - #endif - - // DVD-Video event codes - // ====================== - // - // All DVD-Video event are always passed on to the application, and are - // never processed by the filter graph - - - #define EC_DVD_DOMAIN_CHANGE (EC_DVDBASE + 0x01) - // Parameters: ( DWORD, void ) - // lParam1 is enum DVD_DOMAIN, and indicates the player's new domain - // - // Raised from following domains: all - // - // Signaled when ever the DVD player changes domains. - - - #define EC_DVD_TITLE_CHANGE (EC_DVDBASE + 0x02) - // Parameters: ( DWORD, void ) - // lParam1 is the new title number. - // - // Raised from following domains: DVD_DOMAIN_Title - // - // Indicates when the current title number changes. Title numbers - // range 1 to 99. This indicates the TTN, which is the title number - // with respect to the whole disc, not the VTS_TTN which is the title - // number with respect to just a current VTS. - - - #define EC_DVD_CHAPTER_START (EC_DVDBASE + 0x03) - // Parameters: ( DWORD, void ) - // lParam1 is the new chapter number (which is the program number for - // One_Sequential_PGC_Titles). - // - // Raised from following domains: DVD_DOMAIN_Title - // - // Signales that DVD player started playback of a new program in the Title - // domain. This is only signaled for One_Sequential_PGC_Titles. - - - #define EC_DVD_AUDIO_STREAM_CHANGE (EC_DVDBASE + 0x04) - // Parameters: ( DWORD, void ) - // lParam1 is the new user audio stream number. - // - // Raised from following domains: all - // - // Signaled when ever the current user audio stream number changes for the main - // title. This can be changed automatically with a navigation command on disc - // as well as through IDVDAnnexJ. - // Audio stream numbers range from 0 to 7. Stream 0xffffffff - // indicates that no stream is selected. - - #define EC_DVD_SUBPICTURE_STREAM_CHANGE (EC_DVDBASE + 0x05) - // Parameters: ( DWORD, void ) - // lParam1 is the new user subpicture stream number. - // - // Raised from following domains: all - // - // Signaled when ever the current user subpicture stream number changes for the main - // title. This can be changed automatically with a navigation command on disc - // as well as through IDVDAnnexJ. - // Subpicture stream numbers range from 0 to 31. Stream 0xffffffff - // indicates that no stream is selected. - - #define EC_DVD_ANGLE_CHANGE (EC_DVDBASE + 0x06) - // Parameters: ( DWORD, DWORD ) - // lParam1 is the number of available angles. - // lParam2 is the current user angle number. - // - // Raised from following domains: all - // - // Signaled when ever either - // a) the number of available angles changes, or - // b) the current user angle number changes. - // Current angle number can be changed automatically with navigation command - // on disc as well as through IDVDAnnexJ. - // When the number of available angles is 1, the current video is not multiangle. - // Angle numbers range from 1 to 9. - - - #define EC_DVD_BUTTON_CHANGE (EC_DVDBASE + 0x07) - // Parameters: ( DWORD, DWORD ) - // lParam1 is the number of available buttons. - // lParam2 is the current selected button number. - // - // Raised from following domains: all - // - // Signaled when ever either - // a) the number of available buttons changes, or - // b) the current selected button number changes. - // The current selected button can be changed automatically with navigation - // commands on disc as well as through IDVDAnnexJ. - // Button numbers range from 1 to 36. Selected button number 0 implies that - // no button is selected. Note that these button numbers enumerate all - // available button numbers, and do not always correspond to button numbers - // used for IDVDAnnexJ::ButtonSelectAndActivate since only a subset of buttons - // may be activated with ButtonSelectAndActivate. - - - #define EC_DVD_VALID_UOPS_CHANGE (EC_DVDBASE + 0x08) - // Parameters: ( DWORD, void ) - // lParam1 is a VALID_UOP_SOMTHING_OR_OTHER bit-field stuct which indicates - // which IDVDAnnexJ commands are explicitly disable by the DVD disc. - // - // Raised from following domains: all - // - // Signaled when ever the available set of IDVDAnnexJ methods changes. This - // only indicates which operations are explicited disabled by the content on - // the DVD disc, and does not guarentee that it is valid to call methods - // which are not disabled. For example, if no buttons are currently present, - // IDVDAnnexJ::ButtonActivate() won't work, even though the buttons are not - // explicitly disabled. - - - #define EC_DVD_STILL_ON (EC_DVDBASE + 0x09) - // Parameters: ( BOOL, DWORD ) - // lParam1 == 0 --> buttons are available, so StillOff won't work - // lParam1 == 1 --> no buttons available, so StillOff will work - // lParam2 indicates the number of seconds the still will last, with 0xffffffff - // indicating an infinite still (wait till button or StillOff selected). - // - // Raised from following domains: all - // - // Signaled at the beginning of any still: PGC still, Cell Still, or VOBU Still. - // Note that all combinations of buttons and still are possible (buttons on with - // still on, buttons on with still off, button off with still on, button off - // with still off). - - #define EC_DVD_STILL_OFF (EC_DVDBASE + 0x0a) - // Parameters: ( void, void ) - // - // Indicating that any still that is currently active - // has been released. - // - // Raised from following domains: all - // - // Signaled at the end of any still: PGC still, Cell Still, or VOBU Still. - // - - #define EC_DVD_CURRENT_TIME (EC_DVDBASE + 0x0b) - // Parameters: ( DWORD, BOOL ) - // lParam1 is a DVD_TIMECODE which indicates the current - // playback time code in a BCD HH:MM:SS:FF format. - // lParam2 == 0 --> time code is 25 frames/sec - // lParam2 == 1 --> time code is 30 frames/sec (non-drop). - // lParam2 == 2 --> time code is invalid (current playback time - // cannot be determined for current title) - // - // Raised from following domains: DVD_DOMAIN_Title - // - // Signaled at the beginning of every VOBU, which occurs every .4 to 1.0 sec. - // This is only signaled for One_Sequential_PGC_Titles. - - - #define EC_DVD_ERROR (EC_DVDBASE + 0x0c) - // Parameters: ( DWORD, void) - // lParam1 is an enum DVD_ERROR which notifies the app of some error condition. - // - // Raised from following domains: all - // - - #define EC_DVD_WARNING (EC_DVDBASE + 0x0d) - // Parameters: ( DWORD, void) - // lParam1 is an enum DVD_WARNING which notifies the app of some warning condition. - // - // Raised from following domains: all - // - - #define EC_DVD_CHAPTER_AUTOSTOP (EC_DVDBASE + 0x0e) - // Parameters: (BOOL, void) - // lParam1 is a BOOL which indicates the reason for the cancellation of ChapterPlayAutoStop - // lParam1 == 0 indicates successful completion of ChapterPlayAutoStop - // lParam1 == 1 indicates that ChapterPlayAutoStop is being cancelled as a result of another - // IDVDControl call or the end of content has been reached & no more chapters - // can be played. - // Indicating that playback is stopped as a result of a call - // to IDVDControl::ChapterPlayAutoStop() - // - // Raised from following domains : DVD_DOMAIN_TITLE - // - - #define EC_DVD_NO_FP_PGC (EC_DVDBASE + 0x0f) - // Parameters : (void, void) - // - // Raised from the following domains : FP_DOM - // - // Indicates that the DVD disc does not have a FP_PGC (First Play Program Chain) - // and the DVD Navigator will not automatically load any PGC and start playback. - // - - #define EC_DVD_PLAYBACK_RATE_CHANGE (EC_DVDBASE + 0x10) - // Parameters : (LONG, void) - // lParam1 is a LONG indicating the new playback rate. - // lParam1 < 0 indicates reverse playback mode. - // lParam1 > 0 indicates forward playback mode - // Value of lParam1 is the actual playback rate multiplied by 10000. - // i.e. lParam1 = rate * 10000 - // - // Raised from the following domains : TT_DOM - // - // Indicates that a rate change in playback has been initiated and the parameter - // lParam1 indicates the new playback rate that is being used. - // - - #define EC_DVD_PARENTAL_LEVEL_CHANGE (EC_DVDBASE + 0x11) - // Parameters : (LONG, void) - // lParam1 is a LONG indicating the new parental level. - // - // Raised from the following domains : VMGM_DOM - // - // Indicates that an authored Nav command has changed the parental level - // setting in the player. - // - - #define EC_DVD_PLAYBACK_STOPPED (EC_DVDBASE + 0x12) - // Parameters : (void, void) - // - // Raised from the following domains : All Domains - // - // Indicates that playback has been stopped as the Navigator has completed - // playback of the pgc and did not find any other branching instruction for - // subsequent playback. - // - - #define EC_DVD_ANGLES_AVAILABLE (EC_DVDBASE + 0x13) - // Parameters : (BOOL, void) - // lParam1 == 0 indicates that playback is not in an angle block and angles are - // not available - // lParam1 == 1 indicates that an angle block is being played back and angle changes - // can be performed. - // - // Indicates whether an angle block is being played and if angle changes can be - // performed. However, angle changes are not restricted to angle blocks and the - // manifestation of the angle change can be seen only in an angle block. - - #define EC_DVD_PLAYPERIOD_AUTOSTOP (EC_DVDBASE + 0x14) - // Parameters: (void, void) - // Sent when the PlayPeriodInTitle completes or is cancelled - // - // Raised from following domains : DVD_DOMAIN_TITLE - // - - #define EC_DVD_BUTTON_AUTO_ACTIVATED (EC_DVDBASE + 0x15) - // Parameters: (DWORD button, void) - // Sent when a button is automatically activated - // - // Raised from following domains : DVD_DOMAIN_MENU - // - - #define EC_DVD_CMD_START (EC_DVDBASE + 0x16) - // Parameters: (CmdID, HRESULT) - // Sent when a command begins - // - - #define EC_DVD_CMD_END (EC_DVDBASE + 0x17) - // Parameters: (CmdID, HRESULT) - // Sent when a command completes - // - - #define EC_DVD_DISC_EJECTED (EC_DVDBASE + 0x18) - // Parameters: none - // Sent when the nav detects that a disc was ejected and stops the playback - // The app does not need to take any action to stop the playback. - // - - #define EC_DVD_DISC_INSERTED (EC_DVDBASE + 0x19) - // Parameters: none - // Sent when the nav detects that a disc was inserted and the nav begins playback - // The app does not need to take any action to start the playback. - // - - #define EC_DVD_CURRENT_HMSF_TIME (EC_DVDBASE + 0x1a) - // Parameters: ( ULONG, ULONG ) - // lParam2 contains a union of the DVD_TIMECODE_FLAGS - // lParam1 contains a DVD_HMSF_TIMECODE. Assign lParam1 to a ULONG then cast the - // ULONG as a DVD_HMSF_TIMECODE to use its values. - // - // Raised from following domains: DVD_DOMAIN_Title - // - // Signaled at the beginning of every VOBU, which occurs every .4 to 1.0 sec. - - #define EC_DVD_KARAOKE_MODE (EC_DVDBASE + 0x1b) - // Parameters: ( BOOL, reserved ) - // lParam1 is either TRUE (a karaoke track is being played) or FALSE (no karaoke data is being played). - // - - -#endif // DirectX 8.0 content - - -#endif // __DVDEVCOD__ diff --git a/import/DirectX8/include/dvdmedia.h b/import/DirectX8/include/dvdmedia.h deleted file mode 100644 index ae58cede2..000000000 --- a/import/DirectX8/include/dvdmedia.h +++ /dev/null @@ -1,418 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DVDMedia.h -// -// Desc: Contains typedefs and defines necessary for user mode (ring 3) DVD -// filters and applications. -// -// This should be included in the DirectShow SDK for user mode filters. -// The types defined here should be kept in synch with ksmedia.h WDM -// DDK for kernel mode filters. -// -// Copyright (c) 1997 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __DVDMEDIA_H__ -#define __DVDMEDIA_H__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// ----------------------------------------------------------------------- -// AC-3 definition for the AM_KSPROPSETID_AC3 property set -// ----------------------------------------------------------------------- - -typedef enum { - AM_PROPERTY_AC3_ERROR_CONCEALMENT = 1, - AM_PROPERTY_AC3_ALTERNATE_AUDIO = 2, - AM_PROPERTY_AC3_DOWNMIX = 3, - AM_PROPERTY_AC3_BIT_STREAM_MODE = 4, - AM_PROPERTY_AC3_DIALOGUE_LEVEL = 5, - AM_PROPERTY_AC3_LANGUAGE_CODE = 6, - AM_PROPERTY_AC3_ROOM_TYPE = 7 -} AM_PROPERTY_AC3; - -typedef struct { - BOOL fRepeatPreviousBlock; - BOOL fErrorInCurrentBlock; -} AM_AC3_ERROR_CONCEALMENT, *PAM_AC3_ERROR_CONCEALMENT; - -typedef struct { - BOOL fStereo; - ULONG DualMode; -} AM_AC3_ALTERNATE_AUDIO, *PAM_AC3_ALTERNATE_AUDIO; - -#define AM_AC3_ALTERNATE_AUDIO_1 1 -#define AM_AC3_ALTERNATE_AUDIO_2 2 -#define AM_AC3_ALTERNATE_AUDIO_BOTH 3 - -typedef struct { - BOOL fDownMix; - BOOL fDolbySurround; -} AM_AC3_DOWNMIX, *PAM_AC3_DOWNMIX; - -typedef struct { - LONG BitStreamMode; -} AM_AC3_BIT_STREAM_MODE, *PAM_AC3_BIT_STREAM_MODE; - -#define AM_AC3_SERVICE_MAIN_AUDIO 0 -#define AM_AC3_SERVICE_NO_DIALOG 1 -#define AM_AC3_SERVICE_VISUALLY_IMPAIRED 2 -#define AM_AC3_SERVICE_HEARING_IMPAIRED 3 -#define AM_AC3_SERVICE_DIALOG_ONLY 4 -#define AM_AC3_SERVICE_COMMENTARY 5 -#define AM_AC3_SERVICE_EMERGENCY_FLASH 6 -#define AM_AC3_SERVICE_VOICE_OVER 7 - -typedef struct { - ULONG DialogueLevel; -} AM_AC3_DIALOGUE_LEVEL, *PAM_AC3_DIALOGUE_LEVEL; - -typedef struct { - BOOL fLargeRoom; -} AM_AC3_ROOM_TYPE, *PAM_AC3_ROOM_TYPE; - - -// ----------------------------------------------------------------------- -// subpicture definition for the AM_KSPROPSETID_DvdSubPic property set -// ----------------------------------------------------------------------- - -typedef enum { - AM_PROPERTY_DVDSUBPIC_PALETTE = 0, - AM_PROPERTY_DVDSUBPIC_HLI = 1, - AM_PROPERTY_DVDSUBPIC_COMPOSIT_ON = 2 // TRUE for subpicture is displayed -} AM_PROPERTY_DVDSUBPIC; - -typedef struct _AM_DVD_YUV { - UCHAR Reserved; - UCHAR Y; - UCHAR U; - UCHAR V; -} AM_DVD_YUV, *PAM_DVD_YUV; - -typedef struct _AM_PROPERTY_SPPAL { - AM_DVD_YUV sppal[16]; -} AM_PROPERTY_SPPAL, *PAM_PROPERTY_SPPAL; - -typedef struct _AM_COLCON { - UCHAR emph1col:4; - UCHAR emph2col:4; - UCHAR backcol:4; - UCHAR patcol:4; - UCHAR emph1con:4; - UCHAR emph2con:4; - UCHAR backcon:4; - UCHAR patcon:4; - -} AM_COLCON, *PAM_COLCON; - -typedef struct _AM_PROPERTY_SPHLI { - USHORT HLISS; // - USHORT Reserved; - ULONG StartPTM; // start presentation time in x/90000 - ULONG EndPTM; // end PTM in x/90000 - USHORT StartX; - USHORT StartY; - USHORT StopX; - USHORT StopY; - AM_COLCON ColCon; // color contrast description (4 bytes as given in HLI) -} AM_PROPERTY_SPHLI, *PAM_PROPERTY_SPHLI; - -typedef BOOL AM_PROPERTY_COMPOSIT_ON, *PAM_PROPERTY_COMPOSIT_ON; - - - -// ----------------------------------------------------------------------- -// copy protection definitions -// ----------------------------------------------------------------------- - -// AM_UseNewCSSKey for the dwTypeSpecificFlags in IMediaSample2 to indicate -// the exact point in a stream after which to start applying a new CSS key. -// This is typically sent on an empty media sample just before attempting -// to renegotiate a CSS key. -#define AM_UseNewCSSKey 0x1 - -// -// AM_KSPROPSETID_CopyProt property set definitions -// -typedef enum { - AM_PROPERTY_DVDCOPY_CHLG_KEY = 0x01, - AM_PROPERTY_DVDCOPY_DVD_KEY1 = 0x02, - AM_PROPERTY_DVDCOPY_DEC_KEY2 = 0x03, - AM_PROPERTY_DVDCOPY_TITLE_KEY = 0x04, - AM_PROPERTY_COPY_MACROVISION = 0x05, - AM_PROPERTY_DVDCOPY_REGION = 0x06, - AM_PROPERTY_DVDCOPY_SET_COPY_STATE = 0x07, - AM_PROPERTY_DVDCOPY_DISC_KEY = 0x80 -} AM_PROPERTY_DVDCOPYPROT; - -typedef struct _AM_DVDCOPY_CHLGKEY { - BYTE ChlgKey[10]; - BYTE Reserved[2]; -} AM_DVDCOPY_CHLGKEY, *PAM_DVDCOPY_CHLGKEY; - -typedef struct _AM_DVDCOPY_BUSKEY { - BYTE BusKey[5]; - BYTE Reserved[1]; -} AM_DVDCOPY_BUSKEY, *PAM_DVDCOPY_BUSKEY; - -typedef struct _AM_DVDCOPY_DISCKEY { - BYTE DiscKey[2048]; -} AM_DVDCOPY_DISCKEY, *PAM_DVDCOPY_DISCKEY; - -typedef struct AM_DVDCOPY_TITLEKEY { - ULONG KeyFlags; - ULONG Reserved1[2]; - UCHAR TitleKey[6]; - UCHAR Reserved2[2]; -} AM_DVDCOPY_TITLEKEY, *PAM_DVDCOPY_TITLEKEY; - -typedef struct _AM_COPY_MACROVISION { - ULONG MACROVISIONLevel; -} AM_COPY_MACROVISION, *PAM_COPY_MACROVISION; - -typedef struct AM_DVDCOPY_SET_COPY_STATE { - ULONG DVDCopyState; -} AM_DVDCOPY_SET_COPY_STATE, *PAM_DVDCOPY_SET_COPY_STATE; - -typedef enum { - AM_DVDCOPYSTATE_INITIALIZE = 0, - AM_DVDCOPYSTATE_INITIALIZE_TITLE = 1, // indicates we are starting a title - // key copy protection sequence - AM_DVDCOPYSTATE_AUTHENTICATION_NOT_REQUIRED = 2, - AM_DVDCOPYSTATE_AUTHENTICATION_REQUIRED = 3, - AM_DVDCOPYSTATE_DONE = 4 -} AM_DVDCOPYSTATE; - -typedef enum { - AM_MACROVISION_DISABLED = 0, - AM_MACROVISION_LEVEL1 = 1, - AM_MACROVISION_LEVEL2 = 2, - AM_MACROVISION_LEVEL3 = 3 -} AM_COPY_MACROVISION_LEVEL, *PAM_COPY_MACROVISION_LEVEL; - - -// CSS region stucture -typedef struct _DVD_REGION { - UCHAR CopySystem; - UCHAR RegionData; - UCHAR SystemRegion; - UCHAR Reserved; -} DVD_REGION, *PDVD_REGION; - -// -// CGMS Copy Protection Flags -// - -#define AM_DVD_CGMS_RESERVED_MASK 0x00000078 - -#define AM_DVD_CGMS_COPY_PROTECT_MASK 0x00000018 -#define AM_DVD_CGMS_COPY_PERMITTED 0x00000000 -#define AM_DVD_CGMS_COPY_ONCE 0x00000010 -#define AM_DVD_CGMS_NO_COPY 0x00000018 - -#define AM_DVD_COPYRIGHT_MASK 0x00000040 -#define AM_DVD_NOT_COPYRIGHTED 0x00000000 -#define AM_DVD_COPYRIGHTED 0x00000040 - -#define AM_DVD_SECTOR_PROTECT_MASK 0x00000020 -#define AM_DVD_SECTOR_NOT_PROTECTED 0x00000000 -#define AM_DVD_SECTOR_PROTECTED 0x00000020 - - -// ----------------------------------------------------------------------- -// video format blocks -// ----------------------------------------------------------------------- - -enum AM_MPEG2Level { - AM_MPEG2Level_Low = 1, - AM_MPEG2Level_Main = 2, - AM_MPEG2Level_High1440 = 3, - AM_MPEG2Level_High = 4 -}; - -enum AM_MPEG2Profile { - AM_MPEG2Profile_Simple = 1, - AM_MPEG2Profile_Main = 2, - AM_MPEG2Profile_SNRScalable = 3, - AM_MPEG2Profile_SpatiallyScalable = 4, - AM_MPEG2Profile_High = 5 -}; - -#define AMINTERLACE_IsInterlaced 0x00000001 // if 0, other interlace bits are irrelevent -#define AMINTERLACE_1FieldPerSample 0x00000002 // else 2 fields per media sample -#define AMINTERLACE_Field1First 0x00000004 // else Field 2 is first; top field in PAL is field 1, top field in NTSC is field 2? -#define AMINTERLACE_UNUSED 0x00000008 // -#define AMINTERLACE_FieldPatternMask 0x00000030 // use this mask with AMINTERLACE_FieldPat* -#define AMINTERLACE_FieldPatField1Only 0x00000000 // stream never contains a Field2 -#define AMINTERLACE_FieldPatField2Only 0x00000010 // stream never contains a Field1 -#define AMINTERLACE_FieldPatBothRegular 0x00000020 // There will be a Field2 for every Field1 (required for Weave?) -#define AMINTERLACE_FieldPatBothIrregular 0x00000030 // Random pattern of Field1s and Field2s -#define AMINTERLACE_DisplayModeMask 0x000000c0 -#define AMINTERLACE_DisplayModeBobOnly 0x00000000 -#define AMINTERLACE_DisplayModeWeaveOnly 0x00000040 -#define AMINTERLACE_DisplayModeBobOrWeave 0x00000080 - -#define AMCOPYPROTECT_RestrictDuplication 0x00000001 // duplication of this stream should be restricted - -#define AMMPEG2_DoPanScan 0x00000001 //if set, the MPEG-2 video decoder should crop output image - // based on pan-scan vectors in picture_display_extension - // and change the picture aspect ratio accordingly. -#define AMMPEG2_DVDLine21Field1 0x00000002 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 1 -#define AMMPEG2_DVDLine21Field2 0x00000004 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 2 -#define AMMPEG2_SourceIsLetterboxed 0x00000008 //if set, indicates that black bars have been encoded in the top - // and bottom of the video. -#define AMMPEG2_FilmCameraMode 0x00000010 //if set, indicates "film mode" used for 625/50 content. If cleared, - // indicates that "camera mode" was used. -#define AMMPEG2_LetterboxAnalogOut 0x00000020 //if set and this stream is sent to an analog output, it should - // be letterboxed. Streams sent to VGA should be letterboxed only by renderers. -#define AMMPEG2_DSS_UserData 0x00000040 //if set, the MPEG-2 decoder must process DSS style user data -#define AMMPEG2_DVB_UserData 0x00000080 //if set, the MPEG-2 decoder must process DVB style user data -#define AMMPEG2_27MhzTimebase 0x00000100 //if set, the PTS,DTS timestamps advance at 27MHz rather than 90KHz - -#define AMMPEG2_WidescreenAnalogOut 0x00000200 //if set and this stream is sent to an analog output, it should - // be in widescreen format (4x3 content should be centered on a 16x9 output). - // Streams sent to VGA should be widescreened only by renderers. - -// PRESENT in dwReserved1 field in VIDEOINFOHEADER2 -#define AMCONTROL_USED 0x00000001 // Used to test if these flags are supported. Set and test for AcceptMediaType. - // If rejected, then you cannot use the AMCONTROL flags (send 0 for dwReserved1) -#define AMCONTROL_PAD_TO_4x3 0x00000002 // if set means display the image in a 4x3 area -#define AMCONTROL_PAD_TO_16x9 0x00000004 // if set means display the image in a 16x9 area - -typedef struct tagVIDEOINFOHEADER2 { - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - DWORD dwInterlaceFlags; // use AMINTERLACE_* defines. Reject connection if undefined bits are not 0 - DWORD dwCopyProtectFlags; // use AMCOPYPROTECT_* defines. Reject connection if undefined bits are not 0 - DWORD dwPictAspectRatioX; // X dimension of picture aspect ratio, e.g. 16 for 16x9 display - DWORD dwPictAspectRatioY; // Y dimension of picture aspect ratio, e.g. 9 for 16x9 display - union { - DWORD dwControlFlags; // use AMCONTROL_* defines, use this from now on - DWORD dwReserved1; // for backward compatiblity (was "must be 0"; connection rejected otherwise) - }; - DWORD dwReserved2; // must be 0; reject connection otherwise - BITMAPINFOHEADER bmiHeader; -} VIDEOINFOHEADER2; - -typedef struct tagMPEG2VIDEOINFO { - VIDEOINFOHEADER2 hdr; - DWORD dwStartTimeCode; // ?? not used for DVD ?? - DWORD cbSequenceHeader; // is 0 for DVD (no sequence header) - DWORD dwProfile; // use enum MPEG2Profile - DWORD dwLevel; // use enum MPEG2Level - DWORD dwFlags; // use AMMPEG2_* defines. Reject connection if undefined bits are not 0 - DWORD dwSequenceHeader[1]; // DWORD instead of Byte for alignment purposes - // For MPEG-2, if a sequence_header is included, the sequence_extension - // should also be included -} MPEG2VIDEOINFO; - -#define SIZE_MPEG2VIDEOINFO(pv) (FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader[0]) + (pv)->cbSequenceHeader) - -// do not use -#define MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - -// use this macro instead, the previous only works for MPEG1VIDEOINFO structures -#define MPEG2_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->dwSequenceHeader) - - -//=================================================================================== -// flags for dwTypeSpecificFlags in AM_SAMPLE2_PROPERTIES which define type specific -// data in IMediaSample2 -//=================================================================================== - -#define AM_VIDEO_FLAG_FIELD_MASK 0x0003L // use this mask to check whether the sample is field1 or field2 or frame -#define AM_VIDEO_FLAG_INTERLEAVED_FRAME 0x0000L // the sample is a frame (remember to use AM_VIDEO_FLAG_FIELD_MASK when using this) -#define AM_VIDEO_FLAG_FIELD1 0x0001L // the sample is field1 (remember to use AM_VIDEO_FLAG_FIELD_MASK when using this) -#define AM_VIDEO_FLAG_FIELD2 0x0002L // the sample is the field2 (remember to use AM_VIDEO_FLAG_FIELD_MASK when using this) -#define AM_VIDEO_FLAG_FIELD1FIRST 0x0004L // if set means display field1 first, else display field2 first. - // this bit is irrelavant for 1FieldPerSample mode -#define AM_VIDEO_FLAG_WEAVE 0x0008L // if set use bob display mode else weave -#define AM_VIDEO_FLAG_IPB_MASK 0x0030L // use this mask to check whether the sample is I, P or B -#define AM_VIDEO_FLAG_I_SAMPLE 0x0000L // I Sample (remember to use AM_VIDEO_FLAG_IPB_MASK when using this) -#define AM_VIDEO_FLAG_P_SAMPLE 0x0010L // P Sample (remember to use AM_VIDEO_FLAG_IPB_MASK when using this) -#define AM_VIDEO_FLAG_B_SAMPLE 0x0020L // B Sample (remember to use AM_VIDEO_FLAG_IPB_MASK when using this) -#define AM_VIDEO_FLAG_REPEAT_FIELD 0x0040L // if set means display the field which has been displayed first again after displaying - // both fields first. This bit is irrelavant for 1FieldPerSample mode - -// ----------------------------------------------------------------------- -// AM_KSPROPSETID_DvdKaraoke property set definitions -// ----------------------------------------------------------------------- - -typedef struct tagAM_DvdKaraokeData -{ - DWORD dwDownmix; // bitwise OR of AM_DvdKaraoke_Downmix flags - DWORD dwSpeakerAssignment; // AM_DvdKaraoke_SpeakerAssignment -} AM_DvdKaraokeData; - -typedef enum { - AM_PROPERTY_DVDKARAOKE_ENABLE = 0, // BOOL - AM_PROPERTY_DVDKARAOKE_DATA = 1, -} AM_PROPERTY_DVDKARAOKE; - -// ----------------------------------------------------------------------- -// AM_KSPROPSETID_TSRateChange property set definitions for time stamp -// rate changes. -// ----------------------------------------------------------------------- - -typedef enum { - AM_RATE_SimpleRateChange = 1, // rw, use AM_SimpleRateChange - AM_RATE_ExactRateChange = 2, // rw, use AM_ExactRateChange - AM_RATE_MaxFullDataRate = 3, // r, use AM_MaxFullDataRate - AM_RATE_Step = 4 // w, use AM_Step -} AM_PROPERTY_TS_RATE_CHANGE; - -// ------------------------------------------------------------------- -// AM_KSPROPSETID_DVD_RateChange property set definitions for new DVD -// rate change scheme. -// ------------------------------------------------------------------- - -typedef enum { - AM_RATE_ChangeRate = 1, // w, use AM_DVD_ChangeRate - AM_RATE_FullDataRateMax = 2, // r, use AM_MaxFullDataRate - AM_RATE_ReverseDecode = 3, // r, use LONG - AM_RATE_DecoderPosition = 4, // r, use AM_DVD_DecoderPosition - AM_RATE_DecoderVersion = 5 // r, use LONG -} AM_PROPERTY_DVD_RATE_CHANGE; - -typedef struct { - // this is the simplest mechanism to set a time stamp rate change on - // a filter (simplest for the person setting the rate change, harder - // for the filter doing the rate change). - REFERENCE_TIME StartTime; //stream time at which to start this rate - LONG Rate; //new rate * 10000 (decimal) -} AM_SimpleRateChange; - -typedef struct { - REFERENCE_TIME OutputZeroTime; //input TS that maps to zero output TS - LONG Rate; //new rate * 10000 (decimal) -} AM_ExactRateChange; - -typedef LONG AM_MaxFullDataRate; //rate * 10000 (decimal) - -typedef DWORD AM_Step; // number of frame to step - -// New rate change property set, structs. enums etc. -typedef struct { - REFERENCE_TIME StartInTime; // stream time (input) at which to start decoding at this rate - REFERENCE_TIME StartOutTime; // reference time (output) at which to start showing at this rate - LONG Rate; // new rate * 10000 (decimal) -} AM_DVD_ChangeRate ; - -typedef LONGLONG AM_DVD_DecoderPosition ; - -typedef enum { - DVD_DIR_FORWARD = 0, - DVD_DIR_BACKWARD = 1 -} DVD_PLAY_DIRECTION ; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __DVDMEDIA_H__ diff --git a/import/DirectX8/include/dvoice.h b/import/DirectX8/include/dvoice.h deleted file mode 100644 index b11a255cf..000000000 --- a/import/DirectX8/include/dvoice.h +++ /dev/null @@ -1,856 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved. - * - * File: dpvoice.h - * Content: DirectPlayVoice include file - ***************************************************************************/ - -#ifndef __DVOICE__ -#define __DVOICE__ - -#include // for DECLARE_INTERFACE and HRESULT -#include -#include -#include -#include "dsound.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/**************************************************************************** - * - * DirectPlayVoice CLSIDs - * - ****************************************************************************/ - - -// {B9F3EB85-B781-4ac1-8D90-93A05EE37D7D} -DEFINE_GUID(CLSID_DirectPlayVoiceClient, -0xb9f3eb85, 0xb781, 0x4ac1, 0x8d, 0x90, 0x93, 0xa0, 0x5e, 0xe3, 0x7d, 0x7d); - -// {D3F5B8E6-9B78-4a4c-94EA-CA2397B663D3} -DEFINE_GUID(CLSID_DirectPlayVoiceServer, -0xd3f5b8e6, 0x9b78, 0x4a4c, 0x94, 0xea, 0xca, 0x23, 0x97, 0xb6, 0x63, 0xd3); - -// {0F0F094B-B01C-4091-A14D-DD0CD807711A} -DEFINE_GUID(CLSID_DirectPlayVoiceTest, -0xf0f094b, 0xb01c, 0x4091, 0xa1, 0x4d, 0xdd, 0xc, 0xd8, 0x7, 0x71, 0x1a); - -/**************************************************************************** - * - * DirectPlayVoice Interface IIDs - * - ****************************************************************************/ - - -// {1DFDC8EA-BCF7-41d6-B295-AB64B3B23306} -DEFINE_GUID(IID_IDirectPlayVoiceClient, -0x1dfdc8ea, 0xbcf7, 0x41d6, 0xb2, 0x95, 0xab, 0x64, 0xb3, 0xb2, 0x33, 0x6); - -// {FAA1C173-0468-43b6-8A2A-EA8A4F2076C9} -DEFINE_GUID(IID_IDirectPlayVoiceServer, -0xfaa1c173, 0x468, 0x43b6, 0x8a, 0x2a, 0xea, 0x8a, 0x4f, 0x20, 0x76, 0xc9); - -// {D26AF734-208B-41da-8224-E0CE79810BE1} -DEFINE_GUID(IID_IDirectPlayVoiceTest, -0xd26af734, 0x208b, 0x41da, 0x82, 0x24, 0xe0, 0xce, 0x79, 0x81, 0xb, 0xe1); - -/**************************************************************************** - * - * DirectPlayVoice Compression Type GUIDs - * - ****************************************************************************/ - -// MS-ADPCM 32.8 kbit/s -// -// {699B52C1-A885-46a8-A308-97172419ADC7} -DEFINE_GUID(DPVCTGUID_ADPCM, -0x699b52c1, 0xa885, 0x46a8, 0xa3, 0x8, 0x97, 0x17, 0x24, 0x19, 0xad, 0xc7); - -// Microsoft GSM 6.10 13 kbit/s -// -// {24768C60-5A0D-11d3-9BE4-525400D985E7} -DEFINE_GUID(DPVCTGUID_GSM, -0x24768c60, 0x5a0d, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7); - -// MS-PCM 64 kbit/s -// -// {8DE12FD4-7CB3-48ce-A7E8-9C47A22E8AC5} -DEFINE_GUID(DPVCTGUID_NONE, -0x8de12fd4, 0x7cb3, 0x48ce, 0xa7, 0xe8, 0x9c, 0x47, 0xa2, 0x2e, 0x8a, 0xc5); - -// Voxware SC03 3.2kbit/s -// -// {7D82A29B-2242-4f82-8F39-5D1153DF3E41} -DEFINE_GUID(DPVCTGUID_SC03, -0x7d82a29b, 0x2242, 0x4f82, 0x8f, 0x39, 0x5d, 0x11, 0x53, 0xdf, 0x3e, 0x41); - -// Voxware SC06 6.4kbit/s -// -// {53DEF900-7168-4633-B47F-D143916A13C7} -DEFINE_GUID(DPVCTGUID_SC06, -0x53def900, 0x7168, 0x4633, 0xb4, 0x7f, 0xd1, 0x43, 0x91, 0x6a, 0x13, 0xc7); - -// TrueSpeech(TM) 8.6 kbit/s -// -// {D7954361-5A0B-11d3-9BE4-525400D985E7} -DEFINE_GUID(DPVCTGUID_TRUESPEECH, -0xd7954361, 0x5a0b, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7); - -// Voxware VR12 1.4kbit/s -// -// {FE44A9FE-8ED4-48bf-9D66-1B1ADFF9FF6D} -DEFINE_GUID(DPVCTGUID_VR12, -0xfe44a9fe, 0x8ed4, 0x48bf, 0x9d, 0x66, 0x1b, 0x1a, 0xdf, 0xf9, 0xff, 0x6d); - -// Define the default compression type -#define DPVCTGUID_DEFAULT DPVCTGUID_SC03 - -/**************************************************************************** - * - * DirectPlayVoice Interface Pointer definitions - * - ****************************************************************************/ - -typedef struct IDirectPlayVoiceClient FAR *LPDIRECTPLAYVOICECLIENT, *PDIRECTPLAYVOICECLIENT; -typedef struct IDirectPlayVoiceServer FAR *LPDIRECTPLAYVOICESERVER, *PDIRECTPLAYVOICESERVER; -typedef struct IDirectPlayVoiceTest FAR *LPDIRECTPLAYVOICETEST, *PDIRECTPLAYVOICETEST; - -/**************************************************************************** - * - * DirectPlayVoice Callback Functions - * - ****************************************************************************/ -typedef HRESULT (FAR PASCAL *PDVMESSAGEHANDLER)( - PVOID pvUserContext, - DWORD dwMessageType, - LPVOID lpMessage -); - -typedef PDVMESSAGEHANDLER LPDVMESSAGEHANDLER; - -/**************************************************************************** - * - * DirectPlayVoice Datatypes (Non-Structure / Non-Message) - * - ****************************************************************************/ - -typedef DWORD DVID, *LPDVID, *PDVID; - -/**************************************************************************** - * - * DirectPlayVoice Message Types - * - ****************************************************************************/ - -#define DVMSGID_BASE 0x0000 - -#define DVMSGID_MINBASE (DVMSGID_CREATEVOICEPLAYER) -#define DVMSGID_CREATEVOICEPLAYER (DVMSGID_BASE+0x0001) -#define DVMSGID_DELETEVOICEPLAYER (DVMSGID_BASE+0x0002) -#define DVMSGID_SESSIONLOST (DVMSGID_BASE+0x0003) -#define DVMSGID_PLAYERVOICESTART (DVMSGID_BASE+0x0004) -#define DVMSGID_PLAYERVOICESTOP (DVMSGID_BASE+0x0005) -#define DVMSGID_RECORDSTART (DVMSGID_BASE+0x0006) -#define DVMSGID_RECORDSTOP (DVMSGID_BASE+0x0007) -#define DVMSGID_CONNECTRESULT (DVMSGID_BASE+0x0008) -#define DVMSGID_DISCONNECTRESULT (DVMSGID_BASE+0x0009) -#define DVMSGID_INPUTLEVEL (DVMSGID_BASE+0x000A) -#define DVMSGID_OUTPUTLEVEL (DVMSGID_BASE+0x000B) -#define DVMSGID_HOSTMIGRATED (DVMSGID_BASE+0x000C) -#define DVMSGID_SETTARGETS (DVMSGID_BASE+0x000D) -#define DVMSGID_PLAYEROUTPUTLEVEL (DVMSGID_BASE+0x000E) -#define DVMSGID_LOSTFOCUS (DVMSGID_BASE+0x0010) -#define DVMSGID_GAINFOCUS (DVMSGID_BASE+0x0011) -#define DVMSGID_LOCALHOSTSETUP (DVMSGID_BASE+0x0012) -#define DVMSGID_MAXBASE (DVMSGID_LOCALHOSTSETUP) - -/**************************************************************************** - * - * DirectPlayVoice Constants - * - ****************************************************************************/ - -// -// Buffer Aggresiveness Value Ranges -// -#define DVBUFFERAGGRESSIVENESS_MIN 0x00000001 -#define DVBUFFERAGGRESSIVENESS_MAX 0x00000064 -#define DVBUFFERAGGRESSIVENESS_DEFAULT 0x00000000 - -// -// Buffer Quality Value Ranges -// -#define DVBUFFERQUALITY_MIN 0x00000001 -#define DVBUFFERQUALITY_MAX 0x00000064 -#define DVBUFFERQUALITY_DEFAULT 0x00000000 - -#define DVID_SYS 0 - -// -// Used to identify the session host in client/server -// -#define DVID_SERVERPLAYER 1 - -// -// Used to target all players -// -#define DVID_ALLPLAYERS 0 - -// -// Used to identify the main buffer -// -#define DVID_REMAINING 0xFFFFFFFF - -// -// Input level range -// -#define DVINPUTLEVEL_MIN 0x00000000 -#define DVINPUTLEVEL_MAX 0x00000063 // 99 decimal - -#define DVNOTIFYPERIOD_MINPERIOD 20 - - -#define DVPLAYBACKVOLUME_DEFAULT DSBVOLUME_MAX - -#define DVRECORDVOLUME_LAST 0x00000001 - - -// -// Use the default value -// -#define DVTHRESHOLD_DEFAULT 0xFFFFFFFF - -// -// Threshold Ranges -// -#define DVTHRESHOLD_MIN 0x00000000 -#define DVTHRESHOLD_MAX 0x00000063 // 99 decimal - -// -// Threshold field is not used -// -#define DVTHRESHOLD_UNUSED 0xFFFFFFFE - -// -// Session Types -// -#define DVSESSIONTYPE_PEER 0x00000001 -#define DVSESSIONTYPE_MIXING 0x00000002 -#define DVSESSIONTYPE_FORWARDING 0x00000003 -#define DVSESSIONTYPE_ECHO 0x00000004 - -/**************************************************************************** - * - * DirectPlayVoice Flags - * - ****************************************************************************/ - - -// -// Enable automatic adjustment of the recording volume -// -#define DVCLIENTCONFIG_AUTORECORDVOLUME 0x00000008 - -// -// Enable automatic voice activation -// -#define DVCLIENTCONFIG_AUTOVOICEACTIVATED 0x00000020 - -// -// Enable echo suppression -// -#define DVCLIENTCONFIG_ECHOSUPPRESSION 0x08000000 - -// -// Voice Activation manual mode -// -#define DVCLIENTCONFIG_MANUALVOICEACTIVATED 0x00000004 - -// -// Only playback voices that have buffers created for them -// -#define DVCLIENTCONFIG_MUTEGLOBAL 0x00000010 - -// -// Mute the playback -// -#define DVCLIENTCONFIG_PLAYBACKMUTE 0x00000002 - -// -// Mute the recording -// -#define DVCLIENTCONFIG_RECORDMUTE 0x00000001 - -// -// Complete the operation before returning -// -#define DVFLAGS_SYNC 0x00000001 - -// -// Just check to see if wizard has been run, and if so what it's results were -// -#define DVFLAGS_QUERYONLY 0x00000002 - -// -// Shutdown the voice session without migrating the host -// -#define DVFLAGS_NOHOSTMIGRATE 0x00000008 - -// -// Allow the back button to be enabled in the wizard -// -#define DVFLAGS_ALLOWBACK 0x00000010 - -// -// Disable host migration in the voice session -// -#define DVSESSION_NOHOSTMIGRATION 0x00000001 - -// -// Server controlled targetting -// -#define DVSESSION_SERVERCONTROLTARGET 0x00000002 - -// -// Use DirectSound Normal Mode instead of priority -// -#define DVSOUNDCONFIG_NORMALMODE 0x00000001 - -// -// Automatically select the microphone -// -#define DVSOUNDCONFIG_AUTOSELECT 0x00000002 - -// -// Run in half duplex mode -// -#define DVSOUNDCONFIG_HALFDUPLEX 0x00000004 - -// -// No volume controls are available for the recording device -// -#define DVSOUNDCONFIG_NORECVOLAVAILABLE 0x00000010 - -// -// Disable capture sharing -// -#define DVSOUNDCONFIG_NOFOCUS 0x20000000 - -// -// Set system conversion quality to high -// -#define DVSOUNDCONFIG_SETCONVERSIONQUALITY 0x00000008 - -// -// Enable strict focus mode -// -#define DVSOUNDCONFIG_STRICTFOCUS 0x40000000 - -// -// Player is in half duplex mode -// -#define DVPLAYERCAPS_HALFDUPLEX 0x00000001 - -// -// Specifies that player is the local player -// -#define DVPLAYERCAPS_LOCAL 0x00000002 - -/**************************************************************************** - * - * DirectPlayVoice Structures (Non-Message) - * - ****************************************************************************/ - - -// -// DirectPlayVoice Caps -// (GetCaps / SetCaps) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Caps flags -} DVCAPS, *LPDVCAPS, *PDVCAPS; - -// -// DirectPlayVoice Client Configuration -// (Connect / GetClientConfig) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags for client config (DVCLIENTCONFIG_...) - LONG lRecordVolume; // Recording volume - LONG lPlaybackVolume; // Playback volume - DWORD dwThreshold; // Voice Activation Threshold - DWORD dwBufferQuality; // Buffer quality - DWORD dwBufferAggressiveness; // Buffer aggressiveness - DWORD dwNotifyPeriod; // Period of notification messages (ms) -} DVCLIENTCONFIG, *LPDVCLIENTCONFIG, *PDVCLIENTCONFIG; - -// -// DirectPlayVoice Compression Type Information -// (GetCompressionTypes) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - GUID guidType; // GUID that identifies this compression type - LPWSTR lpszName; // String name of this compression type - LPWSTR lpszDescription; // Description for this compression type - DWORD dwFlags; // Flags for this compression type - DWORD dwMaxBitsPerSecond; // Maximum # of bit/s this compression type uses -} DVCOMPRESSIONINFO, *LPDVCOMPRESSIONINFO, *PDVCOMPRESSIONINFO; - -// -// DirectPlayVoice Session Description -// (Host / GetSessionDesc) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Session flags (DVSESSION_...) - DWORD dwSessionType; // Session type (DVSESSIONTYPE_...) - GUID guidCT; // Compression Type to use - DWORD dwBufferQuality; // Buffer quality - DWORD dwBufferAggressiveness; // Buffer aggresiveness -} DVSESSIONDESC, *LPDVSESSIONDESC, *PDVSESSIONDESC; - -// -// DirectPlayVoice Client Sound Device Configuration -// (Connect / GetSoundDeviceConfig) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags for sound config (DVSOUNDCONFIG_...) - GUID guidPlaybackDevice; // GUID of the playback device to use - LPDIRECTSOUND lpdsPlaybackDevice; // DirectSound Object to use (optional) - GUID guidCaptureDevice; // GUID of the capture device to use - LPDIRECTSOUNDCAPTURE lpdsCaptureDevice; // DirectSoundCapture Object to use (optional) - HWND hwndAppWindow; // HWND of your application's top-level window - LPDIRECTSOUNDBUFFER lpdsMainBuffer; // DirectSoundBuffer to use for playback (optional) - DWORD dwMainBufferFlags; // Flags to pass to Play() on the main buffer - DWORD dwMainBufferPriority; // Priority to set when calling Play() on the main buffer -} DVSOUNDDEVICECONFIG, *LPDVSOUNDDEVICECONFIG, *PDVSOUNDDEVICECONFIG; - -/**************************************************************************** - * - * DirectPlayVoice message handler call back structures - * - ****************************************************************************/ - -// -// Result of the Connect() call. (If it wasn't called Async) -// (DVMSGID_CONNECTRESULT) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - HRESULT hrResult; // Result of the Connect() call -} DVMSG_CONNECTRESULT, *LPDVMSG_CONNECTRESULT, *PDVMSG_CONNECTRESULT; - -// -// A new player has entered the voice session -// (DVMSGID_CREATEVOICEPLAYER) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidPlayer; // DVID of the player who joined - DWORD dwFlags; // Player flags (DVPLAYERCAPS_...) - PVOID pvPlayerContext; // Context value for this player (user set) -} DVMSG_CREATEVOICEPLAYER, *LPDVMSG_CREATEVOICEPLAYER, *PDVMSG_CREATEVOICEPLAYER; - -// -// A player has left the voice session -// (DVMSGID_DELETEVOICEPLAYER) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidPlayer; // DVID of the player who left - PVOID pvPlayerContext; // Context value for the player -} DVMSG_DELETEVOICEPLAYER, *LPDVMSG_DELETEVOICEPLAYER, *PDVMSG_DELETEVOICEPLAYER; - -// -// Result of the Disconnect() call. (If it wasn't called Async) -// (DVMSGID_DISCONNECTRESULT) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - HRESULT hrResult; // Result of the Disconnect() call -} DVMSG_DISCONNECTRESULT, *LPDVMSG_DISCONNECTRESULT, *PDVMSG_DISCONNECTRESULT; - -// -// The voice session host has migrated. -// (DVMSGID_HOSTMIGRATED) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidNewHostID; // DVID of the player who is now the host - LPDIRECTPLAYVOICESERVER pdvServerInterface; - // Pointer to the new host object (if local player is now host) -} DVMSG_HOSTMIGRATED, *LPDVMSG_HOSTMIGRATED, *PDVMSG_HOSTMIGRATED; - -// -// The current input level / recording volume on the local machine -// (DVMSGID_INPUTLEVEL) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwPeakLevel; // Current peak level of the audio - LONG lRecordVolume; // Current recording volume - PVOID pvLocalPlayerContext; // Context value for the local player -} DVMSG_INPUTLEVEL, *LPDVMSG_INPUTLEVEL, *PDVMSG_INPUTLEVEL; - -// -// The local client is about to become the new host -// (DVMSGID_LOCALHOSTSETUP) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - PVOID pvContext; // Context value to be passed to Initialize() of new host object - PDVMESSAGEHANDLER pMessageHandler; // Message handler to be used by new host object -} DVMSG_LOCALHOSTSETUP, *LPDVMSG_LOCALHOSTSETUP, *PDVMSG_LOCALHOSTSETUP; - -// -// The current output level for the combined output of all incoming streams. -// (DVMSGID_OUTPUTLEVEL) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwPeakLevel; // Current peak level of the output - LONG lOutputVolume; // Current playback volume - PVOID pvLocalPlayerContext; // Context value for the local player -} DVMSG_OUTPUTLEVEL, *LPDVMSG_OUTPUTLEVEL, *PDVMSG_OUTPUTLEVEL; - -// -// The current peak level of an individual player's incoming audio stream as it is -// being played back. -// (DVMSGID_PLAYEROUTPUTLEVEL) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidSourcePlayerID; // DVID of the player - DWORD dwPeakLevel; // Peak level of the player's stream - PVOID pvPlayerContext; // Context value for the player -} DVMSG_PLAYEROUTPUTLEVEL, *LPDVMSG_PLAYEROUTPUTLEVEL, *PDVMSG_PLAYEROUTPUTLEVEL; - -// -// An audio stream from the specified player has started playing back on the local client. -// (DVMSGID_PLAYERVOICESTART). -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidSourcePlayerID; // DVID of the Player - PVOID pvPlayerContext; // Context value for this player -} DVMSG_PLAYERVOICESTART, *LPDVMSG_PLAYERVOICESTART, *PDVMSG_PLAYERVOICESTART; - -// -// The audio stream from the specified player has stopped playing back on the local client. -// (DVMSGID_PLAYERVOICESTOP) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DVID dvidSourcePlayerID; // DVID of the player - PVOID pvPlayerContext; // Context value for this player -} DVMSG_PLAYERVOICESTOP, *LPDVMSG_PLAYERVOICESTOP, *PDVMSG_PLAYERVOICESTOP; - -// -// Transmission has started on the local machine -// (DVMSGID_RECORDSTART) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwPeakLevel; // Peak level that caused transmission to start - PVOID pvLocalPlayerContext; // Context value for the local player -} DVMSG_RECORDSTART, *LPDVMSG_RECORDSTART, *PDVMSG_RECORDSTART; - -// -// Transmission has stopped on the local machine -// (DVMSGID_RECORDSTOP) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwPeakLevel; // Peak level that caused transmission to stop - PVOID pvLocalPlayerContext; // Context value for the local player -} DVMSG_RECORDSTOP, *LPDVMSG_RECORDSTOP, *PDVMSG_RECORDSTOP; - -// -// The voice session has been lost -// (DVMSGID_SESSIONLOST) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - HRESULT hrResult; // Reason the session was disconnected -} DVMSG_SESSIONLOST, *LPDVMSG_SESSIONLOST, *PDVMSG_SESSIONLOST; - -// -// The target list has been updated for the local client -// (DVMSGID_SETTARGETS) -// -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwNumTargets; // # of targets - PDVID pdvidTargets; // An array of DVIDs specifying the current targets -} DVMSG_SETTARGETS, *LPDVMSG_SETTARGETS, *PDVMSG_SETTARGETS; - - -/**************************************************************************** - * - * DirectPlayVoice Functions - * - ****************************************************************************/ - -/* - * - * This function is no longer supported. It is recommended that CoCreateInstance be used to create - * DirectPlay voice objects. - * - * extern HRESULT WINAPI DirectPlayVoiceCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); - * - */ - -/**************************************************************************** - * - * DirectPlay8 Application Interfaces - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlayVoiceClient -DECLARE_INTERFACE_( IDirectPlayVoiceClient, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, PVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectPlayVoiceClient methods ***/ - STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, Connect) (THIS_ PDVSOUNDDEVICECONFIG, PDVCLIENTCONFIG, DWORD ) PURE; - STDMETHOD_(HRESULT, Disconnect) (THIS_ DWORD ) PURE; - STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; - STDMETHOD_(HRESULT, GetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE; - STDMETHOD_(HRESULT, SetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE; - STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE; - STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ PDVID, DWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ PDVID, PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, Create3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUNDBUFFER, DWORD, DWORD, LPDIRECTSOUND3DBUFFER * ) PURE; - STDMETHOD_(HRESULT, Delete3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUND3DBUFFER * ) PURE; - STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, GetSoundDeviceConfig)( THIS_ PDVSOUNDDEVICECONFIG, PDWORD ) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirectPlayVoiceServer -DECLARE_INTERFACE_( IDirectPlayVoiceServer, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlayVoiceServer methods ***/ - STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, LPDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, StartSession) (THIS_ PDVSESSIONDESC, DWORD ) PURE; - STDMETHOD_(HRESULT, StopSession) (THIS_ DWORD ) PURE; - STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; - STDMETHOD_(HRESULT, SetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; - STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE; - STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ DVID, PDVID, DWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ DVID, PDVID, PDWORD, DWORD ) PURE; - STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectPlayVoiceTest -DECLARE_INTERFACE_( IDirectPlayVoiceTest, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlayVoiceTest methods ***/ - STDMETHOD_(HRESULT, CheckAudioSetup) (THIS_ const GUID *, const GUID * , HWND, DWORD ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayVoiceClient_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayVoiceClient_Release(p) (p)->lpVtbl->Release(p) - -#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) -#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) -#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->lpVtbl->Disconnect(p,a) -#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) -#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->lpVtbl->GetClientConfig(p,a) -#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->lpVtbl->SetClientConfig(p,a) -#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) -#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->lpVtbl->SetTransmitTargets(p,a,b,c) -#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->lpVtbl->GetTransmitTargets(p,a,b,c) -#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->lpVtbl->Create3DSoundBuffer(p,a,b,c,d,e) -#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->lpVtbl->Delete3DSoundBuffer(p,a,b) -#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) -#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->lpVtbl->GetSoundDeviceConfig(p,a,b) - -#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayVoiceServer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayVoiceServer_Release(p) (p)->lpVtbl->Release(p) - -#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) -#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlayVoiceServer_StopSession(p,a) (p)->lpVtbl->StopSession(p,a) -#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) -#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a) -#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) -#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->SetTransmitTargets(p,a,b,c,d) -#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->GetTransmitTargets(p,a,b,c,d) -#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) -#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayVoiceTest_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayVoiceTest_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->lpVtbl->CheckAudioSetup(p,a,b,c,d) - - -#else /* C++ */ - -#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayVoiceClient_AddRef(p) (p)->AddRef() -#define IDirectPlayVoiceClient_Release(p) (p)->Release() - -#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) -#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->Connect(a,b,c) -#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->Disconnect(a) -#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->GetSessionDesc(a) -#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->GetClientConfig(a) -#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->SetClientConfig(a) -#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) -#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->SetTransmitTargets(a,b,c) -#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->GetTransmitTargets(a,b,c) -#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->Create3DSoundBuffer(a,b,c,d,e) -#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->Delete3DSoundBuffer(a,b) -#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) -#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->GetSoundDeviceConfig(a,b) - -#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayVoiceServer_AddRef(p) (p)->AddRef() -#define IDirectPlayVoiceServer_Release(p) (p)->Release() - -#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) -#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlayVoiceServer_StopSession(p,a) (p)->StopSession(a) -#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->GetSessionDesc(a) -#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->SetSessionDesc(a) -#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) -#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->SetTransmitTargets(a,b,c,d) -#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->GetTransmitTargets(a,b,c,d) -#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) - -#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayVoiceTest_AddRef(p) (p)->AddRef() -#define IDirectPlayVoiceTest_Release(p) (p)->Release() -#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->CheckAudioSetup(a,b,c,d) - - -#endif - - -/**************************************************************************** - * - * DIRECTPLAYVOICE ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -#define _FACDPV 0x15 -#define MAKE_DVHRESULT( code ) MAKE_HRESULT( 1, _FACDPV, code ) - -#define DV_OK S_OK -#define DV_FULLDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x0005 ) -#define DV_HALFDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x000A ) -#define DV_PENDING MAKE_HRESULT( 0, _FACDPV, 0x0010 ) - -#define DVERR_BUFFERTOOSMALL MAKE_DVHRESULT( 0x001E ) -#define DVERR_EXCEPTION MAKE_DVHRESULT( 0x004A ) -#define DVERR_GENERIC E_FAIL -#define DVERR_INVALIDFLAGS MAKE_DVHRESULT( 0x0078 ) -#define DVERR_INVALIDOBJECT MAKE_DVHRESULT( 0x0082 ) -#define DVERR_INVALIDPARAM E_INVALIDARG -#define DVERR_INVALIDPLAYER MAKE_DVHRESULT( 0x0087 ) -#define DVERR_INVALIDGROUP MAKE_DVHRESULT( 0x0091 ) -#define DVERR_INVALIDHANDLE MAKE_DVHRESULT( 0x0096 ) -#define DVERR_OUTOFMEMORY E_OUTOFMEMORY -#define DVERR_PENDING DV_PENDING -#define DVERR_NOTSUPPORTED E_NOTIMPL -#define DVERR_NOINTERFACE E_NOINTERFACE -#define DVERR_SESSIONLOST MAKE_DVHRESULT( 0x012C ) -#define DVERR_NOVOICESESSION MAKE_DVHRESULT( 0x012E ) -#define DVERR_CONNECTIONLOST MAKE_DVHRESULT( 0x0168 ) -#define DVERR_NOTINITIALIZED MAKE_DVHRESULT( 0x0169 ) -#define DVERR_CONNECTED MAKE_DVHRESULT( 0x016A ) -#define DVERR_NOTCONNECTED MAKE_DVHRESULT( 0x016B ) -#define DVERR_CONNECTABORTING MAKE_DVHRESULT( 0x016E ) -#define DVERR_NOTALLOWED MAKE_DVHRESULT( 0x016F ) -#define DVERR_INVALIDTARGET MAKE_DVHRESULT( 0x0170 ) -#define DVERR_TRANSPORTNOTHOST MAKE_DVHRESULT( 0x0171 ) -#define DVERR_COMPRESSIONNOTSUPPORTED MAKE_DVHRESULT( 0x0172 ) -#define DVERR_ALREADYPENDING MAKE_DVHRESULT( 0x0173 ) -#define DVERR_SOUNDINITFAILURE MAKE_DVHRESULT( 0x0174 ) -#define DVERR_TIMEOUT MAKE_DVHRESULT( 0x0175 ) -#define DVERR_CONNECTABORTED MAKE_DVHRESULT( 0x0176 ) -#define DVERR_NO3DSOUND MAKE_DVHRESULT( 0x0177 ) -#define DVERR_ALREADYBUFFERED MAKE_DVHRESULT( 0x0178 ) -#define DVERR_NOTBUFFERED MAKE_DVHRESULT( 0x0179 ) -#define DVERR_HOSTING MAKE_DVHRESULT( 0x017A ) -#define DVERR_NOTHOSTING MAKE_DVHRESULT( 0x017B ) -#define DVERR_INVALIDDEVICE MAKE_DVHRESULT( 0x017C ) -#define DVERR_RECORDSYSTEMERROR MAKE_DVHRESULT( 0x017D ) -#define DVERR_PLAYBACKSYSTEMERROR MAKE_DVHRESULT( 0x017E ) -#define DVERR_SENDERROR MAKE_DVHRESULT( 0x017F ) -#define DVERR_USERCANCEL MAKE_DVHRESULT( 0x0180 ) -#define DVERR_RUNSETUP MAKE_DVHRESULT( 0x0183 ) -#define DVERR_INCOMPATIBLEVERSION MAKE_DVHRESULT( 0x0184 ) -#define DVERR_INITIALIZED MAKE_DVHRESULT( 0x0187 ) -#define DVERR_INVALIDPOINTER E_POINTER -#define DVERR_NOTRANSPORT MAKE_DVHRESULT( 0x0188 ) -#define DVERR_NOCALLBACK MAKE_DVHRESULT( 0x0189 ) -#define DVERR_TRANSPORTNOTINIT MAKE_DVHRESULT( 0x018A ) -#define DVERR_TRANSPORTNOSESSION MAKE_DVHRESULT( 0x018B ) -#define DVERR_TRANSPORTNOPLAYER MAKE_DVHRESULT( 0x018C ) -#define DVERR_USERBACK MAKE_DVHRESULT( 0x018D ) -#define DVERR_NORECVOLAVAILABLE MAKE_DVHRESULT( 0x018E ) -#define DVERR_INVALIDBUFFER MAKE_DVHRESULT( 0x018F ) -#define DVERR_LOCKEDBUFFER MAKE_DVHRESULT( 0x0190 ) - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dvp.h b/import/DirectX8/include/dvp.h deleted file mode 100644 index c40dc793d..000000000 --- a/import/DirectX8/include/dvp.h +++ /dev/null @@ -1,966 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: dvp.h - * Content: DirectDrawVideoPort include file - * - ***************************************************************************/ - -#ifndef __DVP_INCLUDED__ -#define __DVP_INCLUDED__ - -/* - * GUIDS used by DirectDrawVideoPort objects - */ -#if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID )) -DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDrawVideoPortNotify, 0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88); - - - -DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -#endif - -#ifndef GUID_DEFS_ONLY - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#endif - -/* - * These definitions are required to allow polymorphic structure members (i.e. those - * that are referred to both as DWORDs and as pointers) to resolve into a type - * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit - * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD. - */ -#ifndef MAXULONG_PTR -#define ULONG_PTR DWORD -#endif //MAXULONG_PTR - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER; -typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT; -typedef struct IDirectDrawVideoPortNotify FAR *LPDIRECTDRAWVIDEOPORTNOTIFY; - -typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT; -typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS; -typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC; -typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO; -typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH; -typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS; -typedef struct _DDVIDEOPORTNOTIFY FAR *LPDDVIDEOPORTNOTIFY; - -typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS; -typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS; -typedef struct IDirectDrawVideoPortNotifyVtbl DIRECTDRAWVIDEOPORTNOTIFYCALLBACKS; - - -/* - * API's - */ -typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); - - -/* - * INTERACES FOLLOW: - * IDirectDrawVideoPort - * IVideoPort - */ - -/* - * IDirectDrawVideoPortContainer - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDDVideoPortContainer -DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawVideoPort methods ***/ - STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE; - STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE; - STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE; - STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p) -#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d) -#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d) -#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c) -#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b) -#else -#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IVideoPortContainer_AddRef(p) (p)->AddRef() -#define IVideoPortContainer_Release(p) (p)->Release() -#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d) -#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d) -#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c) -#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b) -#endif - -#endif - - -/* - * IDirectDrawVideoPort - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawVideoPort -DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IVideoPort methods ***/ - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE; - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; - STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; - STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE; - STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; - STDMETHOD(StopVideo)(THIS) PURE; - STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; - STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IVideoPort_Release(p) (p)->lpVtbl->Release(p) -#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b) -#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e) -#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a) -#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c) -#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d) -#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a) -#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a) -#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a) -#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a) -#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a) -#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p) -#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a) -#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c) -#else -#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IVideoPort_AddRef(p) (p)->AddRef() -#define IVideoPort_Release(p) (p)->Release() -#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b) -#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b) -#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e) -#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a) -#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c) -#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d) -#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a) -#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a) -#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a) -#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a) -#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a) -#define IVideoPort_StopVideo(p) (p)->StopVideo() -#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a) -#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c) -#endif - -#endif - -/* - * IDirectDrawVideoPort - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawVideoPortNotify -DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IVideoPort methods ***/ - STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE; - STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IVideoPortNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IVideoPortNotify_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IVideoPortNotify_Release(p) (p)->lpVtbl->Release(p) -#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(p,a,b) -#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(p,a) -#else -#define IVideoPortNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IVideoPortNotify_AddRef(p) (p)->AddRef() -#define IVideoPortNotify_Release(p) (p)->Release() -#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(a,b) -#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(a) -#endif - -#endif - -/* - * DDVIDEOPORTCONNECT - */ -typedef struct _DDVIDEOPORTCONNECT -{ - DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure - DWORD dwPortWidth; // Width of the video port - GUID guidTypeID; // Description of video port connection - DWORD dwFlags; // Connection flags - ULONG_PTR dwReserved1; // Reserved, set to zero. -} DDVIDEOPORTCONNECT; - - -/* - * DDVIDEOPORTCAPS - */ -typedef struct _DDVIDEOPORTCAPS -{ - DWORD dwSize; // size of the DDVIDEOPORTCAPS structure - DWORD dwFlags; // indicates which fields contain data - DWORD dwMaxWidth; // max width of the video port field - DWORD dwMaxVBIWidth; // max width of the VBI data - DWORD dwMaxHeight; // max height of the video port field - DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) - DWORD dwCaps; // Video port capabilities - DWORD dwFX; // More video port capabilities - DWORD dwNumAutoFlipSurfaces; // Max number of autoflippable surfaces allowed - DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface - DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling - DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping - DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width - DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x - DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x - DWORD dwNumVBIAutoFlipSurfaces; // Max number of VBI autoflippable surfaces allowed - DWORD dwNumPreferredAutoflip; // Optimal number of autoflippable surfaces for hardware - WORD wNumFilterTapsX; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.) - WORD wNumFilterTapsY; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.) -} DDVIDEOPORTCAPS; - -/* - * The dwMaxWidth and dwMaxVBIWidth members are valid - */ -#define DDVPD_WIDTH 0x00000001l - -/* - * The dwMaxHeight member is valid - */ -#define DDVPD_HEIGHT 0x00000002l - -/* - * The dwVideoPortID member is valid - */ -#define DDVPD_ID 0x00000004l - -/* - * The dwCaps member is valid - */ -#define DDVPD_CAPS 0x00000008l - -/* - * The dwFX member is valid - */ -#define DDVPD_FX 0x00000010l - -/* - * The dwNumAutoFlipSurfaces member is valid - */ -#define DDVPD_AUTOFLIP 0x00000020l - -/* - * All of the alignment members are valid - */ -#define DDVPD_ALIGN 0x00000040l - -/* - * The dwNumPreferredAutoflip member is valid - */ -#define DDVPD_PREFERREDAUTOFLIP 0x00000080l - -/* - * The wNumFilterTapsX and wNumFilterTapsY fields are valid - */ -#define DDVPD_FILTERQUALITY 0x00000100l - -/* - * DDVIDEOPORTDESC - */ -typedef struct _DDVIDEOPORTDESC -{ - DWORD dwSize; // size of the DDVIDEOPORTDESC structure - DWORD dwFieldWidth; // width of the video port field - DWORD dwVBIWidth; // width of the VBI data - DWORD dwFieldHeight; // height of the video port field - DWORD dwMicrosecondsPerField; // Microseconds per video field - DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second - DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) - DWORD dwReserved1; // Reserved for future use - set to zero (struct padding) - DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection - ULONG_PTR dwReserved2; // Reserved for future use - set to zero - ULONG_PTR dwReserved3; // Reserved for future use - set to zero -} DDVIDEOPORTDESC; - - -/* - * DDVIDEOPORTINFO - */ -typedef struct _DDVIDEOPORTINFO -{ - DWORD dwSize; // Size of the structure - DWORD dwOriginX; // Placement of the video data within the surface. - DWORD dwOriginY; // Placement of the video data within the surface. - DWORD dwVPFlags; // Video port options - RECT rCrop; // Cropping rectangle (optional). - DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional). - DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional). - LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port - LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data - LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data - DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval. - ULONG_PTR dwReserved1; // Reserved for future use - set to zero - ULONG_PTR dwReserved2; // Reserved for future use - set to zero -} DDVIDEOPORTINFO; - - -/* - * DDVIDEOPORTBANDWIDTH - */ -typedef struct _DDVIDEOPORTBANDWIDTH -{ - DWORD dwSize; // Size of the structure - DWORD dwCaps; - DWORD dwOverlay; // Zoom factor at which overlay is supported - DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported - DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported - DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported - ULONG_PTR dwReserved1; // Reserved for future use - set to zero - ULONG_PTR dwReserved2; // Reserved for future use - set to zero -} DDVIDEOPORTBANDWIDTH; - - -/* - * DDVIDEOPORTSTATUS - */ -typedef struct _DDVIDEOPORTSTATUS -{ - DWORD dwSize; // Size of the structure - BOOL bInUse; // TRUE if video port is currently being used - DWORD dwFlags; // Currently not used - DWORD dwReserved1; // Reserved for future use - DDVIDEOPORTCONNECT VideoPortType; // Information about the connection - ULONG_PTR dwReserved2; // Reserved for future use - ULONG_PTR dwReserved3; // Reserved for future use -} DDVIDEOPORTSTATUS; - -/* - * DDVIDEOPORTNOTIFY - */ -typedef struct _DDVIDEOPORTNOTIFY -{ - LARGE_INTEGER ApproximateTimeStamp; // Timestamp in the event notification - LONG lField; // 0 if even, 1 if odd, -1 if unknown - UINT dwSurfaceIndex; // Index in the surface chain of the surface that received the sample - LONG lDone; // Call InterlockedIncrement on this when done with sample -} DDVIDEOPORTNOTIFY; - - -/*============================================================================ - * - * Video Port Flags - * - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTCONNECT FLAGS - * - ****************************************************************************/ - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of double clocking the data. - * When this is set by the client, this indicates that the video port - * should enable double clocking. This flag is only valid with external - * syncs. - */ -#define DDVPCONNECT_DOUBLECLOCK 0x00000001l - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of using an external VACT - * signal. When this is set by the client, this indicates that the - * video port should use the external VACT signal. - */ -#define DDVPCONNECT_VACT 0x00000002l - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of treating even fields - * like odd fields and visa versa. When this is set by the client, - * this indicates that the video port should treat even fields like odd - * fields. - */ -#define DDVPCONNECT_INVERTPOLARITY 0x00000004l - -/* - * Indicates that any data written to the video port during the VREF - * period will not be written into the frame buffer. This flag is read only. - */ -#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l - -/* - * When this is set be the driver and passed to the client, this - * indicates that the device will write half lines into the frame buffer - * if half lines are provided by the decoder. If this is set by the client, - * this indicates that the decoder will be supplying half lines. - */ -#define DDVPCONNECT_HALFLINE 0x00000010l - -/* - * Indicates that the signal is interlaced. This flag is only - * set by the client. - */ -#define DDVPCONNECT_INTERLACED 0x00000020l - -/* - * Indicates that video port is shareable and that this video port - * will use the even fields. This flag is only set by the client. - */ -#define DDVPCONNECT_SHAREEVEN 0x00000040l - -/* - * Indicates that video port is shareable and that this video port - * will use the odd fields. This flag is only set by the client. - */ -#define DDVPCONNECT_SHAREODD 0x00000080l - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTDESC CAPS - * - ****************************************************************************/ - -/* - * Flip can be performed automatically to avoid tearing. - */ -#define DDVPCAPS_AUTOFLIP 0x00000001l - -/* - * Supports interlaced video - */ -#define DDVPCAPS_INTERLACED 0x00000002l - -/* - * Supports non-interlaced video - */ -#define DDVPCAPS_NONINTERLACED 0x00000004l - -/* - * Indicates that the device can return whether the current field - * of an interlaced signal is even or odd. - */ -#define DDVPCAPS_READBACKFIELD 0x00000008l - -/* - * Indicates that the device can return the current line of video - * being written into the frame buffer. - */ -#define DDVPCAPS_READBACKLINE 0x00000010l - -/* - * Allows two gen-locked video streams to share a single video port, - * where one stream uses the even fields and the other uses the odd - * fields. Separate parameters (including address, scaling, - * cropping, etc.) are maintained for both fields.) - */ -#define DDVPCAPS_SHAREABLE 0x00000020l - -/* - * Even fields of video can be automatically discarded. - */ -#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l - -/* - * Odd fields of video can be automatically discarded. - */ -#define DDVPCAPS_SKIPODDFIELDS 0x00000080l - -/* - * Indicates that the device is capable of driving the graphics - * VSYNC with the video port VSYNC. - */ -#define DDVPCAPS_SYNCMASTER 0x00000100l - -/* - * Indicates that data within the vertical blanking interval can - * be written to a different surface. - */ -#define DDVPCAPS_VBISURFACE 0x00000200l - -/* - * Indicates that the video port can perform color operations - * on the incoming data before it is written to the frame buffer. - */ -#define DDVPCAPS_COLORCONTROL 0x00000400l - -/* - * Indicates that the video port can accept VBI data in a different - * width or format than the regular video data. - */ -#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l - -/* - * Indicates that the video port can write data directly to system memory - */ -#define DDVPCAPS_SYSTEMMEMORY 0x00001000l - -/* - * Indicates that the VBI and video portions of the video stream can - * be controlled by an independent processes. - */ -#define DDVPCAPS_VBIANDVIDEOINDEPENDENT 0x00002000l - -/* - * Indicates that the video port contains high quality hardware - * de-interlacing hardware that should be used instead of the - * bob/weave algorithms. - */ -#define DDVPCAPS_HARDWAREDEINTERLACE 0x00004000l - - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTDESC FX - * - ****************************************************************************/ - -/* - * Limited cropping is available to crop out the vertical interval data. - */ -#define DDVPFX_CROPTOPDATA 0x00000001l - -/* - * Incoming data can be cropped in the X direction before it is written - * to the surface. - */ -#define DDVPFX_CROPX 0x00000002l - -/* - * Incoming data can be cropped in the Y direction before it is written - * to the surface. - */ -#define DDVPFX_CROPY 0x00000004l - -/* - * Supports interleaving interlaced fields in memory. - */ -#define DDVPFX_INTERLEAVE 0x00000008l - -/* - * Supports mirroring left to right as the video data is written - * into the frame buffer. - */ -#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l - -/* - * Supports mirroring top to bottom as the video data is written - * into the frame buffer. - */ -#define DDVPFX_MIRRORUPDOWN 0x00000020l - -/* - * Data can be arbitrarily shrunk in the X direction before it - * is written to the surface. - */ -#define DDVPFX_PRESHRINKX 0x00000040l - -/* - * Data can be arbitrarily shrunk in the Y direction before it - * is written to the surface. - */ -#define DDVPFX_PRESHRINKY 0x00000080l - -/* - * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X - * direction before it is written to the surface. - */ -#define DDVPFX_PRESHRINKXB 0x00000100l - -/* - * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y - * direction before it is written to the surface. - */ -#define DDVPFX_PRESHRINKYB 0x00000200l - -/* - * Data can be shrunk in increments of 1/x in the X direction - * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep) - * before it is written to the surface. - */ -#define DDVPFX_PRESHRINKXS 0x00000400l - -/* - * Data can be shrunk in increments of 1/x in the Y direction - * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep) - * before it is written to the surface. - */ -#define DDVPFX_PRESHRINKYS 0x00000800l - -/* - * Data can be arbitrarily stretched in the X direction before - * it is written to the surface. - */ -#define DDVPFX_PRESTRETCHX 0x00001000l - -/* - * Data can be arbitrarily stretched in the Y direction before - * it is written to the surface. - */ -#define DDVPFX_PRESTRETCHY 0x00002000l - -/* - * Data can be integer stretched in the X direction before it is - * written to the surface. - */ -#define DDVPFX_PRESTRETCHXN 0x00004000l - -/* - * Data can be integer stretched in the Y direction before it is - * written to the surface. - */ -#define DDVPFX_PRESTRETCHYN 0x00008000l - -/* - * Indicates that data within the vertical blanking interval can - * be converted independently of the remaining video data. - */ -#define DDVPFX_VBICONVERT 0x00010000l - -/* - * Indicates that scaling can be disabled for data within the - * vertical blanking interval. - */ -#define DDVPFX_VBINOSCALE 0x00020000l - -/* - * Indicates that the video data can ignore the left and right - * cropping coordinates when cropping oversampled VBI data. - */ -#define DDVPFX_IGNOREVBIXCROP 0x00040000l - -/* - * Indicates that interleaving can be disabled for data within the - * vertical blanking interval. - */ -#define DDVPFX_VBINOINTERLEAVE 0x00080000l - - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTINFO FLAGS - * - ****************************************************************************/ - -/* - * Perform automatic flipping. Auto-flipping is performed between - * the overlay surface that was attached to the video port using - * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that - * are attached to the surface via the IDirectDrawSurface::AttachSurface - * method. The flip order is the order in which the overlay surfaces - * were. attached. - */ -#define DDVP_AUTOFLIP 0x00000001l - -/* - * Perform conversion using the ddpfOutputFormat information. - */ -#define DDVP_CONVERT 0x00000002l - -/* - * Perform cropping using the specified rectangle. - */ -#define DDVP_CROP 0x00000004l - -/* - * Indicates that interlaced fields should be interleaved in memory. - */ -#define DDVP_INTERLEAVE 0x00000008l - -/* - * Indicates that the data should be mirrored left to right as it's - * written into the frame buffer. - */ -#define DDVP_MIRRORLEFTRIGHT 0x00000010l - -/* - * Indicates that the data should be mirrored top to bottom as it's - * written into the frame buffer. - */ -#define DDVP_MIRRORUPDOWN 0x00000020l - -/* - * Perform pre-scaling/zooming based on the pre-scale parameters. - */ -#define DDVP_PRESCALE 0x00000040l - -/* - * Ignore input of even fields. - */ -#define DDVP_SKIPEVENFIELDS 0x00000080l - -/* - * Ignore input of odd fields. - */ -#define DDVP_SKIPODDFIELDS 0x00000100l - -/* - * Drive the graphics VSYNCs using the video port VYSNCs. - */ -#define DDVP_SYNCMASTER 0x00000200l - -/* - * The ddpfVBIOutputFormatFormat member contains data that should be used - * to convert the data within the vertical blanking interval. - */ -#define DDVP_VBICONVERT 0x00000400l - -/* - * Indicates that data within the vertical blanking interval - * should not be scaled. - */ -#define DDVP_VBINOSCALE 0x00000800l - -/* - * Indicates that these bob/weave decisions should not be - * overriden by other interfaces. - */ -#define DDVP_OVERRIDEBOBWEAVE 0x00001000l - -/* - * Indicates that the video data should ignore the left and right - * cropping coordinates when cropping the VBI data. - */ -#define DDVP_IGNOREVBIXCROP 0x00002000l - -/* - * Indicates that interleaving can be disabled for data within the - * vertical blanking interval. - */ -#define DDVP_VBINOINTERLEAVE 0x00004000l - -/* - * Indicates that the video port should use the hardware - * de-interlacing hardware. - */ -#define DDVP_HARDWAREDEINTERLACE 0x00008000l - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS - * - ****************************************************************************/ - -/* - * Return formats for the video data - */ -#define DDVPFORMAT_VIDEO 0x00000001l - -/* - * Return formats for the VBI data - */ -#define DDVPFORMAT_VBI 0x00000002l - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS - * - ****************************************************************************/ - -/* - * Surface should receive video data (and VBI data if a surface - * is not explicitly attached for that purpose) - */ -#define DDVPTARGET_VIDEO 0x00000001l - -/* - * Surface should receive VBI data - */ -#define DDVPTARGET_VBI 0x00000002l - - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS - * - ****************************************************************************/ - -/* - * Waits until the beginning of the next VSYNC - */ -#define DDVPWAIT_BEGIN 0x00000001l - -/* - * Waits until the end of the next/current VSYNC - */ -#define DDVPWAIT_END 0x00000002l - -/* - * Waits until the beginning of the specified line - */ -#define DDVPWAIT_LINE 0x00000003l - -/**************************************************************************** - * - * DIRECTDRAWVIDEOPORT FLIP FLAGS - * - ****************************************************************************/ - -/* - * Flips the normal video surface - */ -#define DDVPFLIP_VIDEO 0x00000001l - -/* - * Flips the VBI surface - */ -#define DDVPFLIP_VBI 0x00000002l - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES - * - ****************************************************************************/ - -/* - * No video signal is present at the video port - */ -#define DDVPSQ_NOSIGNAL 0x00000001l - -/* - * A valid video signal is present at the video port - */ -#define DDVPSQ_SIGNALOK 0x00000002l - -/**************************************************************************** - * - * VIDEOPORTBANDWIDTH Flags - * - ****************************************************************************/ - -/* - * The specified height/width refer to the size of the video port data - * written into memory, after prescaling has occured. - */ -#define DDVPB_VIDEOPORT 0x00000001l - -/* - * The specified height/width refer to the source size of the overlay. - */ -#define DDVPB_OVERLAY 0x00000002l - -/* - * This is a query for the device to return which caps this device requires. - */ -#define DDVPB_TYPE 0x00000004l - -/**************************************************************************** - * - * VIDEOPORTBANDWIDTH Caps - * - ****************************************************************************/ - -/* - * The bandwidth for this device is dependant on the overlay source size. - */ -#define DDVPBCAPS_SOURCE 0x00000001l - -/* - * The bandwidth for this device is dependant on the overlay destination - * size. - */ -#define DDVPBCAPS_DESTINATION 0x00000002l - -/**************************************************************************** - * - * DDVIDEOPORTCONTAINER CreateVideoPort flags - * - ****************************************************************************/ - -/* - * The process only wants to control the VBI portion of the video stream. - */ -#define DDVPCREATE_VBIONLY 0x00000001l - -/* - * The process only wants to control the non-VBI (video) portion of - * the video stream. - */ -#define DDVPCREATE_VIDEOONLY 0x00000002l - -/**************************************************************************** - * - * DDVIDEOPORTSTATUS flags - * - ****************************************************************************/ - -/* - * The video port interface is only controlling the VBI portion of the - * video stream - */ -#define DDVPSTATUS_VBIONLY 0x00000001l - -/* - * The video port interface is only controlling the video portion of the - * video stream - */ -#define DDVPSTATUS_VIDEOONLY 0x00000002l - - -#ifdef __cplusplus -}; -#endif - -#endif // GUID_DEFS_ONLY - -#endif - diff --git a/import/DirectX8/include/dx7todx8.h b/import/DirectX8/include/dx7todx8.h deleted file mode 100644 index a513d6934..000000000 --- a/import/DirectX8/include/dx7todx8.h +++ /dev/null @@ -1,98 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: dx7todx8.h - * Content: DX7 to DX8 Direct3D aliases to aid porting DX7 apps to DX8 - * - ***************************************************************************/ - -#ifndef _DX7TODX8_H_ - -/////////////////////////////////////////////////////////////////////////////// -// -// d3d8types.h -// -/////////////////////////////////////////////////////////////////////////////// - -#define D3DTRANSFORMSTATE_WORLD D3DTS_WORLD -#define D3DTRANSFORMSTATE_VIEW D3DTS_VIEW -#define D3DTRANSFORMSTATE_PROJECTION D3DTS_PROJECTION -#define D3DTRANSFORMSTATE_WORLD1 D3DTS_WORLD1 -#define D3DTRANSFORMSTATE_WORLD2 D3DTS_WORLD2 -#define D3DTRANSFORMSTATE_WORLD3 D3DTS_WORLD3 -#define D3DTRANSFORMSTATE_TEXTURE0 D3DTS_TEXTURE0 -#define D3DTRANSFORMSTATE_TEXTURE1 D3DTS_TEXTURE1 -#define D3DTRANSFORMSTATE_TEXTURE2 D3DTS_TEXTURE2 -#define D3DTRANSFORMSTATE_TEXTURE3 D3DTS_TEXTURE3 -#define D3DTRANSFORMSTATE_TEXTURE4 D3DTS_TEXTURE4 -#define D3DTRANSFORMSTATE_TEXTURE5 D3DTS_TEXTURE5 -#define D3DTRANSFORMSTATE_TEXTURE6 D3DTS_TEXTURE6 -#define D3DTRANSFORMSTATE_TEXTURE7 D3DTS_TEXTURE7 -#define D3DTRANSFORMSTATE_FORCE_DWORD D3DTS_FORCE_DWORD - -#define D3DRENDERSTATE_ZENABLE D3DRS_ZENABLE -#define D3DRENDERSTATE_FILLMODE D3DRS_FILLMODE -#define D3DRENDERSTATE_SHADEMODE D3DRS_SHADEMODE -#define D3DRENDERSTATE_LINEPATTERN D3DRS_LINEPATTERN -#define D3DRENDERSTATE_ZWRITEENABLE D3DRS_ZWRITEENABLE -#define D3DRENDERSTATE_ALPHATESTENABLE D3DRS_ALPHATESTENABLE -#define D3DRENDERSTATE_LASTPIXEL D3DRS_LASTPIXEL -#define D3DRENDERSTATE_SRCBLEND D3DRS_SRCBLEND -#define D3DRENDERSTATE_DESTBLEND D3DRS_DESTBLEND -#define D3DRENDERSTATE_CULLMODE D3DRS_CULLMODE -#define D3DRENDERSTATE_ZFUNC D3DRS_ZFUNC -#define D3DRENDERSTATE_ALPHAREF D3DRS_ALPHAREF -#define D3DRENDERSTATE_ALPHAFUNC D3DRS_ALPHAFUNC -#define D3DRENDERSTATE_DITHERENABLE D3DRS_DITHERENABLE -#define D3DRENDERSTATE_ALPHABLENDENABLE D3DRS_ALPHABLENDENABLE -#define D3DRENDERSTATE_FOGENABLE D3DRS_FOGENABLE -#define D3DRENDERSTATE_SPECULARENABLE D3DRS_SPECULARENABLE -#define D3DRENDERSTATE_ZVISIBLE D3DRS_ZVISIBLE -#define D3DRENDERSTATE_FOGCOLOR D3DRS_FOGCOLOR -#define D3DRENDERSTATE_FOGTABLEMODE D3DRS_FOGTABLEMODE -#define D3DRENDERSTATE_FOGSTART D3DRS_FOGSTART -#define D3DRENDERSTATE_FOGEND D3DRS_FOGEND -#define D3DRENDERSTATE_FOGDENSITY D3DRS_FOGDENSITY -#define D3DRENDERSTATE_EDGEANTIALIAS D3DRS_EDGEANTIALIAS -#define D3DRENDERSTATE_ZBIAS D3DRS_ZBIAS -#define D3DRENDERSTATE_RANGEFOGENABLE D3DRS_RANGEFOGENABLE -#define D3DRENDERSTATE_STENCILENABLE D3DRS_STENCILENABLE -#define D3DRENDERSTATE_STENCILFAIL D3DRS_STENCILFAIL -#define D3DRENDERSTATE_STENCILZFAIL D3DRS_STENCILZFAIL -#define D3DRENDERSTATE_STENCILPASS D3DRS_STENCILPASS -#define D3DRENDERSTATE_STENCILFUNC D3DRS_STENCILFUNC -#define D3DRENDERSTATE_STENCILREF D3DRS_STENCILREF -#define D3DRENDERSTATE_STENCILMASK D3DRS_STENCILMASK -#define D3DRENDERSTATE_STENCILWRITEMASK D3DRS_STENCILWRITEMASK -#define D3DRENDERSTATE_TEXTUREFACTOR D3DRS_TEXTUREFACTOR -#define D3DRENDERSTATE_WRAP0 D3DRS_WRAP0 -#define D3DRENDERSTATE_WRAP1 D3DRS_WRAP1 -#define D3DRENDERSTATE_WRAP2 D3DRS_WRAP2 -#define D3DRENDERSTATE_WRAP3 D3DRS_WRAP3 -#define D3DRENDERSTATE_WRAP4 D3DRS_WRAP4 -#define D3DRENDERSTATE_WRAP5 D3DRS_WRAP5 -#define D3DRENDERSTATE_WRAP6 D3DRS_WRAP6 -#define D3DRENDERSTATE_WRAP7 D3DRS_WRAP7 -#define D3DRENDERSTATE_CLIPPING D3DRS_CLIPPING -#define D3DRENDERSTATE_LIGHTING D3DRS_LIGHTING -#define D3DRENDERSTATE_EXTENTS D3DRS_EXTENTS -#define D3DRENDERSTATE_AMBIENT D3DRS_AMBIENT -#define D3DRENDERSTATE_FOGVERTEXMODE D3DRS_FOGVERTEXMODE -#define D3DRENDERSTATE_COLORVERTEX D3DRS_COLORVERTEX -#define D3DRENDERSTATE_LOCALVIEWER D3DRS_LOCALVIEWER -#define D3DRENDERSTATE_NORMALIZENORMALS D3DRS_NORMALIZENORMALS -#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE D3DRS_DIFFUSEMATERIALSOURCE -#define D3DRENDERSTATE_SPECULARMATERIALSOURCE D3DRS_SPECULARMATERIALSOURCE -#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE D3DRS_AMBIENTMATERIALSOURCE -#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE D3DRS_EMISSIVEMATERIALSOURCE -#define D3DRENDERSTATE_VERTEXBLEND D3DRS_VERTEXBLEND -#define D3DRENDERSTATE_CLIPPLANEENABLE D3DRS_CLIPPLANEENABLE - -#define RGBA_MAKE D3DCOLOR_RGBA -#define RGB_MAKE D3DCOLOR_XRGB -#define D3DRGBA D3DCOLOR_COLORVALUE -#define D3DRGB(_r,_g,_b) D3DCOLOR_COLORVALUE(_r,_g,_b,1.f) - -#define _DX7TODX8_H_ -#endif //_DX7TODX8_H_ diff --git a/import/DirectX8/include/dxfile.h b/import/DirectX8/include/dxfile.h deleted file mode 100644 index 8b5995a5c..000000000 --- a/import/DirectX8/include/dxfile.h +++ /dev/null @@ -1,240 +0,0 @@ -/*************************************************************************** - * - * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. - * - * File: dxfile.h - * - * Content: DirectX File public header file - * - ***************************************************************************/ - -#ifndef __DXFILE_H__ -#define __DXFILE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef DWORD DXFILEFORMAT; - -#define DXFILEFORMAT_BINARY 0 -#define DXFILEFORMAT_TEXT 1 -#define DXFILEFORMAT_COMPRESSED 2 - -typedef DWORD DXFILELOADOPTIONS; - -#define DXFILELOAD_FROMFILE 0x00L -#define DXFILELOAD_FROMRESOURCE 0x01L -#define DXFILELOAD_FROMMEMORY 0x02L -#define DXFILELOAD_FROMSTREAM 0x04L -#define DXFILELOAD_FROMURL 0x08L - -typedef struct _DXFILELOADRESOURCE { - HMODULE hModule; - LPCTSTR lpName; - LPCTSTR lpType; -}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE; - -typedef struct _DXFILELOADMEMORY { - LPVOID lpMemory; - DWORD dSize; -}DXFILELOADMEMORY, *LPDXFILELOADMEMORY; - -/* - * DirectX File object types. - */ - -#ifndef WIN_TYPES -#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype -#endif - -WIN_TYPES(IDirectXFile, DIRECTXFILE); -WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT); -WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT); -WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT); -WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA); -WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE); -WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY); - -/* - * API for creating IDirectXFile interface. - */ - -STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile); - -/* - * The methods for IUnknown - */ - -#define IUNKNOWN_METHODS(kind) \ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ - STDMETHOD_(ULONG, AddRef) (THIS) kind; \ - STDMETHOD_(ULONG, Release) (THIS) kind - -/* - * The methods for IDirectXFileObject - */ - -#define IDIRECTXFILEOBJECT_METHODS(kind) \ - STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \ - STDMETHOD(GetId) (THIS_ LPGUID) kind - -/* - * DirectX File interfaces. - */ - -#undef INTERFACE -#define INTERFACE IDirectXFile - -DECLARE_INTERFACE_(IDirectXFile, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS, - LPDIRECTXFILEENUMOBJECT *) PURE; - STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT, - LPDIRECTXFILESAVEOBJECT *) PURE; - STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectXFileEnumObject - -DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE; - STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE; - STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectXFileSaveObject - -DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE; - STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *, - DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE; - STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IDirectXFileObject - -DECLARE_INTERFACE_(IDirectXFileObject, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - IDIRECTXFILEOBJECT_METHODS(PURE); -}; - -#undef INTERFACE -#define INTERFACE IDirectXFileData - -DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECTXFILEOBJECT_METHODS(PURE); - - STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE; - STDMETHOD(GetType) (THIS_ const GUID **) PURE; - STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE; - STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE; - STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE; - STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectXFileDataReference - -DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECTXFILEOBJECT_METHODS(PURE); - - STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirectXFileBinary - -DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECTXFILEOBJECT_METHODS(PURE); - - STDMETHOD(GetSize) (THIS_ DWORD *) PURE; - STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE; - STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE; -}; - -/* - * DirectXFile Object Class Id (for CoCreateInstance()) - */ - -DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); - -/* - * DirectX File Interface GUIDs. - */ - -DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); -DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* - * DirectX File Header template's GUID. - */ - -DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - - -/* - * DirectX File errors. - */ - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#define DXFILE_OK 0 - -#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850) -#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851) -#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852) -#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853) -#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854) -#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855) -#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856) -#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857) -#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858) -#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859) -#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860) -#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861) -#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862) -#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863) -#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864) -#define DXFILEERR_BADFILE MAKE_DDHRESULT(865) -#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866) -#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867) -#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868) -#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869) -#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870) -#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871) -#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872) -#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873) -#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874) -#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875) -#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876) - - -#ifdef __cplusplus -}; -#endif - -#endif /* _DXFILE_H_ */ - \ No newline at end of file diff --git a/import/DirectX8/include/dxsdk.inc b/import/DirectX8/include/dxsdk.inc deleted file mode 100644 index be0424041..000000000 --- a/import/DirectX8/include/dxsdk.inc +++ /dev/null @@ -1,131 +0,0 @@ -!IFDEF BORLAND -cc = bcc32 -rc = brc32 -link = ilink32 -bldlib = tlib -cflags = -c -3 -j1 -X -Vd -I$(INCLUDE) -rcflags = -r -fo -linkflags = -n -V4.0 -aa -!IFDEF main -linkflags = $(linkflags) -ap -borobjs=c0x32.obj -!ELSE -linkflags = $(linkflags) -Tpe -borobjs=c0w32.obj -!ENDIF -linkflags = $(linkflags) -j$(LIB) -L$(LIB) -libflags=$(OBJ_DIR)\$(proj).lib -outobj = -o -commas =, -outexe= -borlib=+ -deflibs = import32.lib cw32mti.lib ole2w32.lib -!IFDEF MFC -cflags =$(cflags) -VF -w-hid -w-par -w-aus -w-inl -w-inq -WM -Vd /D_NO_VCL;_RTLDLL;_AFXDLL;_X86_;_WINDOWS;_MSC_VER=1100;WIN32; -!IFDEF NODEBUG -deflibs = bfc42.lib bfcs42.lib $(deflibs) -!ELSE -deflibs = BFC42D.lib BFCS42D.lib bfcd42d.lib bfco42d.lib bfcn42d.lib $(deflibs) -!ENDIF -!ENDIF - -d3dframe=..\..\lib\borland\d3dframe.lib - -!IFDEF nodebug -cdebug = -Od -linkdebug = /x -cflags = $(cflags) /DNDEBUG; -!ELSE -cdebug = -Od -v -y -linkdebug = /v -cflags = $(cflags) /DDEBUG; -!ENDIF - -!ELSE -!IFDEF WATCOM -cc = cl -rc = rc -link = link -bldlib = lib -deflibs = kernel32.lib gdi32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib winspool.lib shell32.lib winmm.lib comctl32.lib ole32.lib oleaut32.lib -cflags = -c /D "WIN32" /D "_WINDOWS" -!IFDEF NODEBUG -cflags =$(cflags) /D "NDEBUG" -cdebug = -Ox -linkdebug = -!IFDEF MFC -cflags =$(cflags) /MD /D "_AFXDLL" -!ELSE -cflags =$(cflags) /ML -!ENDIF -!ELSE -cflags =$(cflags) /D "DEBUG" -cdebug = -Z7 -Ox -linkdebug = -map -debug:full -!IFDEF MFC -cflags =$(cflags) /MDd /D "_AFXDLL" -!ELSE -cflags =$(cflags) /MLd -!ENDIF -!ENDIF -rcflags = -r -fo -linkflags = /INCREMENTAL:NO /NOLOGO -!IFDEF main -linkflags = $(linkflags) /SUBSYSTEM:CONSOLE -!ELSE -linkflags = $(linkflags) /SUBSYSTEM:WINDOWS -!ENDIF -libflags=/OUT:$(OBJ_DIR)\$(proj).lib -outobj = -Fo -commas= -outexe=-out: -borobjs= -borlib= -d3dframe=..\..\lib\watcom\d3dframe.lib - -!ELSE -cc = cl -rc = rc -link = link -bldlib = lib -deflibs = kernel32.lib gdi32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib winspool.lib shell32.lib winmm.lib comctl32.lib ole32.lib oleaut32.lib -cflags = -c /D "WIN32" /D "_WINDOWS" -linkflags= -!IFDEF NODEBUG -cflags =$(cflags) /D "NDEBUG" -cdebug = -Ox -linkdebug = /RELEASE -!IFDEF MFC -cflags =$(cflags) /MD /D "_AFXDLL" -!ELSE -cflags =$(cflags) /ML -!ENDIF -!ELSE -cflags = $(cflags) /D "DEBUG" -cdebug = -Z7 -Ox -linkdebug = -map -debug:full -debugtype:cv -!IFDEF MFC -cflags =$(cflags) /MDd /D "_AFXDLL" -!ELSE -linkflags = $(linkflags) /NODEFAULTLIB:LIBC -cflags =$(cflags) /MLd -!ENDIF -!ENDIF -cflags =$(cflags) -rcflags = -r -fo -linkflags = $(linkflags) /INCREMENTAL:NO /PDB:NONE /NOLOGO -!IFDEF main -linkflags = $(linkflags) /SUBSYSTEM:CONSOLE -!ELSE -linkflags = $(linkflags) /SUBSYSTEM:WINDOWS -!ENDIF -libflags=/OUT:$(OBJ_DIR)\$(proj).lib /SUBSYSTEM:WINDOWS -outobj = -Fo -commas= -outexe=-out: -borobjs= -borlib= -d3dframe=..\..\lib\d3dframe.lib - -!ENDIF -!ENDIF diff --git a/import/DirectX8/include/dxtrans.h b/import/DirectX8/include/dxtrans.h deleted file mode 100644 index b09bcde2a..000000000 --- a/import/DirectX8/include/dxtrans.h +++ /dev/null @@ -1,5362 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for dxtrans.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 440 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __dxtrans_h__ -#define __dxtrans_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDXBaseObject_FWD_DEFINED__ -#define __IDXBaseObject_FWD_DEFINED__ -typedef interface IDXBaseObject IDXBaseObject; -#endif /* __IDXBaseObject_FWD_DEFINED__ */ - - -#ifndef __IDXTransformFactory_FWD_DEFINED__ -#define __IDXTransformFactory_FWD_DEFINED__ -typedef interface IDXTransformFactory IDXTransformFactory; -#endif /* __IDXTransformFactory_FWD_DEFINED__ */ - - -#ifndef __IDXTransform_FWD_DEFINED__ -#define __IDXTransform_FWD_DEFINED__ -typedef interface IDXTransform IDXTransform; -#endif /* __IDXTransform_FWD_DEFINED__ */ - - -#ifndef __IDXSurfacePick_FWD_DEFINED__ -#define __IDXSurfacePick_FWD_DEFINED__ -typedef interface IDXSurfacePick IDXSurfacePick; -#endif /* __IDXSurfacePick_FWD_DEFINED__ */ - - -#ifndef __IDXTBindHost_FWD_DEFINED__ -#define __IDXTBindHost_FWD_DEFINED__ -typedef interface IDXTBindHost IDXTBindHost; -#endif /* __IDXTBindHost_FWD_DEFINED__ */ - - -#ifndef __IDXTaskManager_FWD_DEFINED__ -#define __IDXTaskManager_FWD_DEFINED__ -typedef interface IDXTaskManager IDXTaskManager; -#endif /* __IDXTaskManager_FWD_DEFINED__ */ - - -#ifndef __IDXSurfaceFactory_FWD_DEFINED__ -#define __IDXSurfaceFactory_FWD_DEFINED__ -typedef interface IDXSurfaceFactory IDXSurfaceFactory; -#endif /* __IDXSurfaceFactory_FWD_DEFINED__ */ - - -#ifndef __IDXSurfaceModifier_FWD_DEFINED__ -#define __IDXSurfaceModifier_FWD_DEFINED__ -typedef interface IDXSurfaceModifier IDXSurfaceModifier; -#endif /* __IDXSurfaceModifier_FWD_DEFINED__ */ - - -#ifndef __IDXSurface_FWD_DEFINED__ -#define __IDXSurface_FWD_DEFINED__ -typedef interface IDXSurface IDXSurface; -#endif /* __IDXSurface_FWD_DEFINED__ */ - - -#ifndef __IDXSurfaceInit_FWD_DEFINED__ -#define __IDXSurfaceInit_FWD_DEFINED__ -typedef interface IDXSurfaceInit IDXSurfaceInit; -#endif /* __IDXSurfaceInit_FWD_DEFINED__ */ - - -#ifndef __IDXARGBSurfaceInit_FWD_DEFINED__ -#define __IDXARGBSurfaceInit_FWD_DEFINED__ -typedef interface IDXARGBSurfaceInit IDXARGBSurfaceInit; -#endif /* __IDXARGBSurfaceInit_FWD_DEFINED__ */ - - -#ifndef __IDXARGBReadPtr_FWD_DEFINED__ -#define __IDXARGBReadPtr_FWD_DEFINED__ -typedef interface IDXARGBReadPtr IDXARGBReadPtr; -#endif /* __IDXARGBReadPtr_FWD_DEFINED__ */ - - -#ifndef __IDXARGBReadWritePtr_FWD_DEFINED__ -#define __IDXARGBReadWritePtr_FWD_DEFINED__ -typedef interface IDXARGBReadWritePtr IDXARGBReadWritePtr; -#endif /* __IDXARGBReadWritePtr_FWD_DEFINED__ */ - - -#ifndef __IDXDCLock_FWD_DEFINED__ -#define __IDXDCLock_FWD_DEFINED__ -typedef interface IDXDCLock IDXDCLock; -#endif /* __IDXDCLock_FWD_DEFINED__ */ - - -#ifndef __IDXTScaleOutput_FWD_DEFINED__ -#define __IDXTScaleOutput_FWD_DEFINED__ -typedef interface IDXTScaleOutput IDXTScaleOutput; -#endif /* __IDXTScaleOutput_FWD_DEFINED__ */ - - -#ifndef __IDXGradient_FWD_DEFINED__ -#define __IDXGradient_FWD_DEFINED__ -typedef interface IDXGradient IDXGradient; -#endif /* __IDXGradient_FWD_DEFINED__ */ - - -#ifndef __IDXTScale_FWD_DEFINED__ -#define __IDXTScale_FWD_DEFINED__ -typedef interface IDXTScale IDXTScale; -#endif /* __IDXTScale_FWD_DEFINED__ */ - - -#ifndef __IDXEffect_FWD_DEFINED__ -#define __IDXEffect_FWD_DEFINED__ -typedef interface IDXEffect IDXEffect; -#endif /* __IDXEffect_FWD_DEFINED__ */ - - -#ifndef __IDXLookupTable_FWD_DEFINED__ -#define __IDXLookupTable_FWD_DEFINED__ -typedef interface IDXLookupTable IDXLookupTable; -#endif /* __IDXLookupTable_FWD_DEFINED__ */ - - -#ifndef __IDXRawSurface_FWD_DEFINED__ -#define __IDXRawSurface_FWD_DEFINED__ -typedef interface IDXRawSurface IDXRawSurface; -#endif /* __IDXRawSurface_FWD_DEFINED__ */ - - -#ifndef __IHTMLDXTransform_FWD_DEFINED__ -#define __IHTMLDXTransform_FWD_DEFINED__ -typedef interface IHTMLDXTransform IHTMLDXTransform; -#endif /* __IHTMLDXTransform_FWD_DEFINED__ */ - - -#ifndef __ICSSFilterDispatch_FWD_DEFINED__ -#define __ICSSFilterDispatch_FWD_DEFINED__ -typedef interface ICSSFilterDispatch ICSSFilterDispatch; -#endif /* __ICSSFilterDispatch_FWD_DEFINED__ */ - - -#ifndef __DXTransformFactory_FWD_DEFINED__ -#define __DXTransformFactory_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXTransformFactory DXTransformFactory; -#else -typedef struct DXTransformFactory DXTransformFactory; -#endif /* __cplusplus */ - -#endif /* __DXTransformFactory_FWD_DEFINED__ */ - - -#ifndef __DXTaskManager_FWD_DEFINED__ -#define __DXTaskManager_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXTaskManager DXTaskManager; -#else -typedef struct DXTaskManager DXTaskManager; -#endif /* __cplusplus */ - -#endif /* __DXTaskManager_FWD_DEFINED__ */ - - -#ifndef __DXTScale_FWD_DEFINED__ -#define __DXTScale_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXTScale DXTScale; -#else -typedef struct DXTScale DXTScale; -#endif /* __cplusplus */ - -#endif /* __DXTScale_FWD_DEFINED__ */ - - -#ifndef __DXSurface_FWD_DEFINED__ -#define __DXSurface_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXSurface DXSurface; -#else -typedef struct DXSurface DXSurface; -#endif /* __cplusplus */ - -#endif /* __DXSurface_FWD_DEFINED__ */ - - -#ifndef __DXSurfaceModifier_FWD_DEFINED__ -#define __DXSurfaceModifier_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXSurfaceModifier DXSurfaceModifier; -#else -typedef struct DXSurfaceModifier DXSurfaceModifier; -#endif /* __cplusplus */ - -#endif /* __DXSurfaceModifier_FWD_DEFINED__ */ - - -#ifndef __DXGradient_FWD_DEFINED__ -#define __DXGradient_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXGradient DXGradient; -#else -typedef struct DXGradient DXGradient; -#endif /* __cplusplus */ - -#endif /* __DXGradient_FWD_DEFINED__ */ - - -#ifndef __DXTFilter_FWD_DEFINED__ -#define __DXTFilter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DXTFilter DXTFilter; -#else -typedef struct DXTFilter DXTFilter; -#endif /* __cplusplus */ - -#endif /* __DXTFilter_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "comcat.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_dxtrans_0000 */ -/* [local] */ - -#include -#include -#include -#include -#include -#if 0 -// Bogus definition used to make MIDL compiler happy -typedef void DDSURFACEDESC; - -typedef void D3DRMBOX; - -typedef void D3DVECTOR; - -typedef void D3DRMMATRIX4D; - -typedef void *LPSECURITY_ATTRIBUTES; - -#endif -#ifdef _DXTRANSIMPL - #define _DXTRANS_IMPL_EXT _declspec(dllexport) -#else - #define _DXTRANS_IMPL_EXT _declspec(dllimport) -#endif - - - - - - - - - - - - - - - - -// -// All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory -// -EXTERN_C const GUID DDPF_RGB1; -EXTERN_C const GUID DDPF_RGB2; -EXTERN_C const GUID DDPF_RGB4; -EXTERN_C const GUID DDPF_RGB8; -EXTERN_C const GUID DDPF_RGB332; -EXTERN_C const GUID DDPF_ARGB4444; -EXTERN_C const GUID DDPF_RGB565; -EXTERN_C const GUID DDPF_BGR565; -EXTERN_C const GUID DDPF_RGB555; -EXTERN_C const GUID DDPF_ARGB1555; -EXTERN_C const GUID DDPF_RGB24; -EXTERN_C const GUID DDPF_BGR24; -EXTERN_C const GUID DDPF_RGB32; -EXTERN_C const GUID DDPF_BGR32; -EXTERN_C const GUID DDPF_ABGR32; -EXTERN_C const GUID DDPF_ARGB32; -EXTERN_C const GUID DDPF_PMARGB32; -EXTERN_C const GUID DDPF_A1; -EXTERN_C const GUID DDPF_A2; -EXTERN_C const GUID DDPF_A4; -EXTERN_C const GUID DDPF_A8; -EXTERN_C const GUID DDPF_Z8; -EXTERN_C const GUID DDPF_Z16; -EXTERN_C const GUID DDPF_Z24; -EXTERN_C const GUID DDPF_Z32; -// -// Component categories -// -EXTERN_C const GUID CATID_DXImageTransform; -EXTERN_C const GUID CATID_DX3DTransform; -EXTERN_C const GUID CATID_DXAuthoringTransform; -EXTERN_C const GUID CATID_DXSurface; -// -// Service IDs -// -EXTERN_C const GUID SID_SDirectDraw; -EXTERN_C const GUID SID_SDirect3DRM; -#define SID_SDXTaskManager CLSID_DXTaskManager -#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory -#define SID_SDXTransformFactory IID_IDXTransformFactory -// -// DXTransforms Core Type Library Version Info -// -#define DXTRANS_TLB_MAJOR_VER 1 -#define DXTRANS_TLB_MINOR_VER 1 - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_s_ifspec; - -#ifndef __IDXBaseObject_INTERFACE_DEFINED__ -#define __IDXBaseObject_INTERFACE_DEFINED__ - -/* interface IDXBaseObject */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXBaseObject; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("17B59B2B-9CC8-11d1-9053-00C04FD9189D") - IDXBaseObject : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetGenerationId( - /* [out] */ ULONG *pID) = 0; - - virtual HRESULT STDMETHODCALLTYPE IncrementGenerationId( - /* [in] */ BOOL bRefresh) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetObjectSize( - /* [out] */ ULONG *pcbSize) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXBaseObjectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXBaseObject * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXBaseObject * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXBaseObject * This); - - HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( - IDXBaseObject * This, - /* [out] */ ULONG *pID); - - HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( - IDXBaseObject * This, - /* [in] */ BOOL bRefresh); - - HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( - IDXBaseObject * This, - /* [out] */ ULONG *pcbSize); - - END_INTERFACE - } IDXBaseObjectVtbl; - - interface IDXBaseObject - { - CONST_VTBL struct IDXBaseObjectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXBaseObject_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXBaseObject_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXBaseObject_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXBaseObject_GetGenerationId(This,pID) \ - (This)->lpVtbl -> GetGenerationId(This,pID) - -#define IDXBaseObject_IncrementGenerationId(This,bRefresh) \ - (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) - -#define IDXBaseObject_GetObjectSize(This,pcbSize) \ - (This)->lpVtbl -> GetObjectSize(This,pcbSize) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXBaseObject_GetGenerationId_Proxy( - IDXBaseObject * This, - /* [out] */ ULONG *pID); - - -void __RPC_STUB IDXBaseObject_GetGenerationId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXBaseObject_IncrementGenerationId_Proxy( - IDXBaseObject * This, - /* [in] */ BOOL bRefresh); - - -void __RPC_STUB IDXBaseObject_IncrementGenerationId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXBaseObject_GetObjectSize_Proxy( - IDXBaseObject * This, - /* [out] */ ULONG *pcbSize); - - -void __RPC_STUB IDXBaseObject_GetObjectSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXBaseObject_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0259 */ -/* [local] */ - -typedef -enum DXBNDID - { DXB_X = 0, - DXB_Y = 1, - DXB_Z = 2, - DXB_T = 3 - } DXBNDID; - -typedef -enum DXBNDTYPE - { DXBT_DISCRETE = 0, - DXBT_DISCRETE64 = DXBT_DISCRETE + 1, - DXBT_CONTINUOUS = DXBT_DISCRETE64 + 1, - DXBT_CONTINUOUS64 = DXBT_CONTINUOUS + 1 - } DXBNDTYPE; - -typedef struct DXDBND - { - long Min; - long Max; - } DXDBND; - -typedef DXDBND DXDBNDS[ 4 ]; - -typedef struct DXDBND64 - { - LONGLONG Min; - LONGLONG Max; - } DXDBND64; - -typedef DXDBND64 DXDBNDS64[ 4 ]; - -typedef struct DXCBND - { - float Min; - float Max; - } DXCBND; - -typedef DXCBND DXCBNDS[ 4 ]; - -typedef struct DXCBND64 - { - double Min; - double Max; - } DXCBND64; - -typedef DXCBND64 DXCBNDS64[ 4 ]; - -typedef struct DXBNDS - { - DXBNDTYPE eType; - /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0259_0001 - { - /* [case()] */ DXDBND D[ 4 ]; - /* [case()] */ DXDBND64 LD[ 4 ]; - /* [case()] */ DXCBND C[ 4 ]; - /* [case()] */ DXCBND64 LC[ 4 ]; - } u; - } DXBNDS; - -typedef long DXDVEC[ 4 ]; - -typedef LONGLONG DXDVEC64[ 4 ]; - -typedef float DXCVEC[ 4 ]; - -typedef double DXCVEC64[ 4 ]; - -typedef struct DXVEC - { - DXBNDTYPE eType; - /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0259_0002 - { - /* [case()] */ long D[ 4 ]; - /* [case()] */ LONGLONG LD[ 4 ]; - /* [case()] */ float C[ 4 ]; - /* [case()] */ double LC[ 4 ]; - } u; - } DXVEC; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0259_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0259_v0_0_s_ifspec; - -#ifndef __IDXTransformFactory_INTERFACE_DEFINED__ -#define __IDXTransformFactory_INTERFACE_DEFINED__ - -/* interface IDXTransformFactory */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTransformFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6A950B2B-A971-11d1-81C8-0000F87557DB") - IDXTransformFactory : public IServiceProvider - { - public: - virtual HRESULT STDMETHODCALLTYPE SetService( - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkService, - /* [in] */ BOOL bWeakReference) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateTransform( - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog, - /* [in] */ REFCLSID TransCLSID, - /* [in] */ REFIID TransIID, - /* [iid_is][out] */ void **ppTransform) = 0; - - virtual HRESULT STDMETHODCALLTYPE InitializeTransform( - /* [in] */ IDXTransform *pTransform, - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTransformFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTransformFactory * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTransformFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTransformFactory * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *QueryService )( - IDXTransformFactory * This, - /* [in] */ REFGUID guidService, - /* [in] */ REFIID riid, - /* [out] */ void **ppvObject); - - HRESULT ( STDMETHODCALLTYPE *SetService )( - IDXTransformFactory * This, - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkService, - /* [in] */ BOOL bWeakReference); - - HRESULT ( STDMETHODCALLTYPE *CreateTransform )( - IDXTransformFactory * This, - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog, - /* [in] */ REFCLSID TransCLSID, - /* [in] */ REFIID TransIID, - /* [iid_is][out] */ void **ppTransform); - - HRESULT ( STDMETHODCALLTYPE *InitializeTransform )( - IDXTransformFactory * This, - /* [in] */ IDXTransform *pTransform, - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog); - - END_INTERFACE - } IDXTransformFactoryVtbl; - - interface IDXTransformFactory - { - CONST_VTBL struct IDXTransformFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTransformFactory_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTransformFactory_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTransformFactory_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTransformFactory_QueryService(This,guidService,riid,ppvObject) \ - (This)->lpVtbl -> QueryService(This,guidService,riid,ppvObject) - - -#define IDXTransformFactory_SetService(This,guidService,pUnkService,bWeakReference) \ - (This)->lpVtbl -> SetService(This,guidService,pUnkService,bWeakReference) - -#define IDXTransformFactory_CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) \ - (This)->lpVtbl -> CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) - -#define IDXTransformFactory_InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) \ - (This)->lpVtbl -> InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTransformFactory_SetService_Proxy( - IDXTransformFactory * This, - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkService, - /* [in] */ BOOL bWeakReference); - - -void __RPC_STUB IDXTransformFactory_SetService_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransformFactory_CreateTransform_Proxy( - IDXTransformFactory * This, - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog, - /* [in] */ REFCLSID TransCLSID, - /* [in] */ REFIID TransIID, - /* [iid_is][out] */ void **ppTransform); - - -void __RPC_STUB IDXTransformFactory_CreateTransform_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransformFactory_InitializeTransform_Proxy( - IDXTransformFactory * This, - /* [in] */ IDXTransform *pTransform, - /* [size_is][in] */ IUnknown **punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown **punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ IPropertyBag *pInitProps, - /* [in] */ IErrorLog *pErrLog); - - -void __RPC_STUB IDXTransformFactory_InitializeTransform_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTransformFactory_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0260 */ -/* [local] */ - -typedef -enum DXTMISCFLAGS - { DXTMF_BLEND_WITH_OUTPUT = 1L << 0, - DXTMF_DITHER_OUTPUT = 1L << 1, - DXTMF_OPTION_MASK = 0xffff, - DXTMF_VALID_OPTIONS = DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT, - DXTMF_BLEND_SUPPORTED = 1L << 16, - DXTMF_DITHER_SUPPORTED = 1L << 17, - DXTMF_INPLACE_OPERATION = 1L << 24, - DXTMF_BOUNDS_SUPPORTED = 1L << 25, - DXTMF_PLACEMENT_SUPPORTED = 1L << 26, - DXTMF_QUALITY_SUPPORTED = 1L << 27, - DXTMF_OPAQUE_RESULT = 1L << 28 - } DXTMISCFLAGS; - -typedef -enum DXINOUTINFOFLAGS - { DXINOUTF_OPTIONAL = 1L << 0 - } DXINOUTINFOFLAGS; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_s_ifspec; - -#ifndef __IDXTransform_INTERFACE_DEFINED__ -#define __IDXTransform_INTERFACE_DEFINED__ - -/* interface IDXTransform */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTransform; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("30A5FB78-E11F-11d1-9064-00C04FD9189D") - IDXTransform : public IDXBaseObject - { - public: - virtual HRESULT STDMETHODCALLTYPE Setup( - /* [size_is][in] */ IUnknown *const *punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown *const *punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Execute( - /* [in] */ const GUID *pRequestID, - /* [in] */ const DXBNDS *pClipBnds, - /* [in] */ const DXVEC *pPlacement) = 0; - - virtual HRESULT STDMETHODCALLTYPE MapBoundsIn2Out( - /* [in] */ const DXBNDS *pInBounds, - /* [in] */ ULONG ulNumInBnds, - /* [in] */ ULONG ulOutIndex, - /* [out] */ DXBNDS *pOutBounds) = 0; - - virtual HRESULT STDMETHODCALLTYPE MapBoundsOut2In( - /* [in] */ ULONG ulOutIndex, - /* [in] */ const DXBNDS *pOutBounds, - /* [in] */ ULONG ulInIndex, - /* [out] */ DXBNDS *pInBounds) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMiscFlags( - /* [in] */ DWORD dwMiscFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMiscFlags( - /* [out] */ DWORD *pdwMiscFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInOutInfo( - /* [in] */ BOOL bIsOutput, - /* [in] */ ULONG ulIndex, - /* [out] */ DWORD *pdwFlags, - /* [size_is][out] */ GUID *pIDs, - /* [out][in] */ ULONG *pcIDs, - /* [out] */ IUnknown **ppUnkCurrentObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetQuality( - /* [in] */ float fQuality) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetQuality( - /* [out] */ float *fQuality) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTransformVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTransform * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTransform * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTransform * This); - - HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( - IDXTransform * This, - /* [out] */ ULONG *pID); - - HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( - IDXTransform * This, - /* [in] */ BOOL bRefresh); - - HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( - IDXTransform * This, - /* [out] */ ULONG *pcbSize); - - HRESULT ( STDMETHODCALLTYPE *Setup )( - IDXTransform * This, - /* [size_is][in] */ IUnknown *const *punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown *const *punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *Execute )( - IDXTransform * This, - /* [in] */ const GUID *pRequestID, - /* [in] */ const DXBNDS *pClipBnds, - /* [in] */ const DXVEC *pPlacement); - - HRESULT ( STDMETHODCALLTYPE *MapBoundsIn2Out )( - IDXTransform * This, - /* [in] */ const DXBNDS *pInBounds, - /* [in] */ ULONG ulNumInBnds, - /* [in] */ ULONG ulOutIndex, - /* [out] */ DXBNDS *pOutBounds); - - HRESULT ( STDMETHODCALLTYPE *MapBoundsOut2In )( - IDXTransform * This, - /* [in] */ ULONG ulOutIndex, - /* [in] */ const DXBNDS *pOutBounds, - /* [in] */ ULONG ulInIndex, - /* [out] */ DXBNDS *pInBounds); - - HRESULT ( STDMETHODCALLTYPE *SetMiscFlags )( - IDXTransform * This, - /* [in] */ DWORD dwMiscFlags); - - HRESULT ( STDMETHODCALLTYPE *GetMiscFlags )( - IDXTransform * This, - /* [out] */ DWORD *pdwMiscFlags); - - HRESULT ( STDMETHODCALLTYPE *GetInOutInfo )( - IDXTransform * This, - /* [in] */ BOOL bIsOutput, - /* [in] */ ULONG ulIndex, - /* [out] */ DWORD *pdwFlags, - /* [size_is][out] */ GUID *pIDs, - /* [out][in] */ ULONG *pcIDs, - /* [out] */ IUnknown **ppUnkCurrentObject); - - HRESULT ( STDMETHODCALLTYPE *SetQuality )( - IDXTransform * This, - /* [in] */ float fQuality); - - HRESULT ( STDMETHODCALLTYPE *GetQuality )( - IDXTransform * This, - /* [out] */ float *fQuality); - - END_INTERFACE - } IDXTransformVtbl; - - interface IDXTransform - { - CONST_VTBL struct IDXTransformVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTransform_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTransform_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTransform_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTransform_GetGenerationId(This,pID) \ - (This)->lpVtbl -> GetGenerationId(This,pID) - -#define IDXTransform_IncrementGenerationId(This,bRefresh) \ - (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) - -#define IDXTransform_GetObjectSize(This,pcbSize) \ - (This)->lpVtbl -> GetObjectSize(This,pcbSize) - - -#define IDXTransform_Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) \ - (This)->lpVtbl -> Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) - -#define IDXTransform_Execute(This,pRequestID,pClipBnds,pPlacement) \ - (This)->lpVtbl -> Execute(This,pRequestID,pClipBnds,pPlacement) - -#define IDXTransform_MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) \ - (This)->lpVtbl -> MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) - -#define IDXTransform_MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) \ - (This)->lpVtbl -> MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) - -#define IDXTransform_SetMiscFlags(This,dwMiscFlags) \ - (This)->lpVtbl -> SetMiscFlags(This,dwMiscFlags) - -#define IDXTransform_GetMiscFlags(This,pdwMiscFlags) \ - (This)->lpVtbl -> GetMiscFlags(This,pdwMiscFlags) - -#define IDXTransform_GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) \ - (This)->lpVtbl -> GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) - -#define IDXTransform_SetQuality(This,fQuality) \ - (This)->lpVtbl -> SetQuality(This,fQuality) - -#define IDXTransform_GetQuality(This,fQuality) \ - (This)->lpVtbl -> GetQuality(This,fQuality) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTransform_Setup_Proxy( - IDXTransform * This, - /* [size_is][in] */ IUnknown *const *punkInputs, - /* [in] */ ULONG ulNumInputs, - /* [size_is][in] */ IUnknown *const *punkOutputs, - /* [in] */ ULONG ulNumOutputs, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDXTransform_Setup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_Execute_Proxy( - IDXTransform * This, - /* [in] */ const GUID *pRequestID, - /* [in] */ const DXBNDS *pClipBnds, - /* [in] */ const DXVEC *pPlacement); - - -void __RPC_STUB IDXTransform_Execute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsIn2Out_Proxy( - IDXTransform * This, - /* [in] */ const DXBNDS *pInBounds, - /* [in] */ ULONG ulNumInBnds, - /* [in] */ ULONG ulOutIndex, - /* [out] */ DXBNDS *pOutBounds); - - -void __RPC_STUB IDXTransform_MapBoundsIn2Out_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsOut2In_Proxy( - IDXTransform * This, - /* [in] */ ULONG ulOutIndex, - /* [in] */ const DXBNDS *pOutBounds, - /* [in] */ ULONG ulInIndex, - /* [out] */ DXBNDS *pInBounds); - - -void __RPC_STUB IDXTransform_MapBoundsOut2In_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_SetMiscFlags_Proxy( - IDXTransform * This, - /* [in] */ DWORD dwMiscFlags); - - -void __RPC_STUB IDXTransform_SetMiscFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_GetMiscFlags_Proxy( - IDXTransform * This, - /* [out] */ DWORD *pdwMiscFlags); - - -void __RPC_STUB IDXTransform_GetMiscFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_GetInOutInfo_Proxy( - IDXTransform * This, - /* [in] */ BOOL bIsOutput, - /* [in] */ ULONG ulIndex, - /* [out] */ DWORD *pdwFlags, - /* [size_is][out] */ GUID *pIDs, - /* [out][in] */ ULONG *pcIDs, - /* [out] */ IUnknown **ppUnkCurrentObject); - - -void __RPC_STUB IDXTransform_GetInOutInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_SetQuality_Proxy( - IDXTransform * This, - /* [in] */ float fQuality); - - -void __RPC_STUB IDXTransform_SetQuality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTransform_GetQuality_Proxy( - IDXTransform * This, - /* [out] */ float *fQuality); - - -void __RPC_STUB IDXTransform_GetQuality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTransform_INTERFACE_DEFINED__ */ - - -#ifndef __IDXSurfacePick_INTERFACE_DEFINED__ -#define __IDXSurfacePick_INTERFACE_DEFINED__ - -/* interface IDXSurfacePick */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXSurfacePick; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("30A5FB79-E11F-11d1-9064-00C04FD9189D") - IDXSurfacePick : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE PointPick( - /* [in] */ const DXVEC *pPoint, - /* [out] */ ULONG *pulInputSurfaceIndex, - /* [out] */ DXVEC *pInputPoint) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXSurfacePickVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXSurfacePick * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXSurfacePick * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXSurfacePick * This); - - HRESULT ( STDMETHODCALLTYPE *PointPick )( - IDXSurfacePick * This, - /* [in] */ const DXVEC *pPoint, - /* [out] */ ULONG *pulInputSurfaceIndex, - /* [out] */ DXVEC *pInputPoint); - - END_INTERFACE - } IDXSurfacePickVtbl; - - interface IDXSurfacePick - { - CONST_VTBL struct IDXSurfacePickVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXSurfacePick_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXSurfacePick_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXSurfacePick_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXSurfacePick_PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) \ - (This)->lpVtbl -> PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXSurfacePick_PointPick_Proxy( - IDXSurfacePick * This, - /* [in] */ const DXVEC *pPoint, - /* [out] */ ULONG *pulInputSurfaceIndex, - /* [out] */ DXVEC *pInputPoint); - - -void __RPC_STUB IDXSurfacePick_PointPick_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXSurfacePick_INTERFACE_DEFINED__ */ - - -#ifndef __IDXTBindHost_INTERFACE_DEFINED__ -#define __IDXTBindHost_INTERFACE_DEFINED__ - -/* interface IDXTBindHost */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTBindHost; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D26BCE55-E9DC-11d1-9066-00C04FD9189D") - IDXTBindHost : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetBindHost( - /* [in] */ IBindHost *pBindHost) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTBindHostVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTBindHost * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTBindHost * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTBindHost * This); - - HRESULT ( STDMETHODCALLTYPE *SetBindHost )( - IDXTBindHost * This, - /* [in] */ IBindHost *pBindHost); - - END_INTERFACE - } IDXTBindHostVtbl; - - interface IDXTBindHost - { - CONST_VTBL struct IDXTBindHostVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTBindHost_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTBindHost_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTBindHost_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTBindHost_SetBindHost(This,pBindHost) \ - (This)->lpVtbl -> SetBindHost(This,pBindHost) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTBindHost_SetBindHost_Proxy( - IDXTBindHost * This, - /* [in] */ IBindHost *pBindHost); - - -void __RPC_STUB IDXTBindHost_SetBindHost_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTBindHost_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0263 */ -/* [local] */ - -typedef void __stdcall __stdcall DXTASKPROC( - void *pTaskData, - BOOL *pbContinueProcessing); - -typedef DXTASKPROC *PFNDXTASKPROC; - -typedef void __stdcall __stdcall DXAPCPROC( - DWORD dwData); - -typedef DXAPCPROC *PFNDXAPCPROC; - -#ifdef __cplusplus -typedef struct DXTMTASKINFO -{ - PFNDXTASKPROC pfnTaskProc; // Pointer to function to execute - PVOID pTaskData; // Pointer to argument data - PFNDXAPCPROC pfnCompletionAPC; // Pointer to completion APC proc - DWORD dwCompletionData; // Pointer to APC proc data - const GUID* pRequestID; // Used to identify groups of tasks -} DXTMTASKINFO; -#else -typedef struct DXTMTASKINFO - { - PVOID pfnTaskProc; - PVOID pTaskData; - PVOID pfnCompletionAPC; - DWORD dwCompletionData; - const GUID *pRequestID; - } DXTMTASKINFO; - -#endif - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0263_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0263_v0_0_s_ifspec; - -#ifndef __IDXTaskManager_INTERFACE_DEFINED__ -#define __IDXTaskManager_INTERFACE_DEFINED__ - -/* interface IDXTaskManager */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTaskManager; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("254DBBC1-F922-11d0-883A-3C8B00C10000") - IDXTaskManager : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryNumProcessors( - /* [out] */ ULONG *pulNumProc) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetThreadPoolSize( - /* [in] */ ULONG ulNumThreads) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetThreadPoolSize( - /* [out] */ ULONG *pulNumThreads) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetConcurrencyLimit( - /* [in] */ ULONG ulNumThreads) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConcurrencyLimit( - /* [out] */ ULONG *pulNumThreads) = 0; - - virtual HRESULT STDMETHODCALLTYPE ScheduleTasks( - /* [in] */ DXTMTASKINFO TaskInfo[ ], - /* [in] */ HANDLE Events[ ], - /* [out] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulNumTasks, - /* [in] */ ULONG ulWaitPeriod) = 0; - - virtual HRESULT STDMETHODCALLTYPE TerminateTasks( - /* [in] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulCount, - /* [in] */ ULONG ulTimeOut) = 0; - - virtual HRESULT STDMETHODCALLTYPE TerminateRequest( - /* [in] */ REFIID RequestID, - /* [in] */ ULONG ulTimeOut) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTaskManagerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTaskManager * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTaskManager * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTaskManager * This); - - HRESULT ( STDMETHODCALLTYPE *QueryNumProcessors )( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumProc); - - HRESULT ( STDMETHODCALLTYPE *SetThreadPoolSize )( - IDXTaskManager * This, - /* [in] */ ULONG ulNumThreads); - - HRESULT ( STDMETHODCALLTYPE *GetThreadPoolSize )( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumThreads); - - HRESULT ( STDMETHODCALLTYPE *SetConcurrencyLimit )( - IDXTaskManager * This, - /* [in] */ ULONG ulNumThreads); - - HRESULT ( STDMETHODCALLTYPE *GetConcurrencyLimit )( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumThreads); - - HRESULT ( STDMETHODCALLTYPE *ScheduleTasks )( - IDXTaskManager * This, - /* [in] */ DXTMTASKINFO TaskInfo[ ], - /* [in] */ HANDLE Events[ ], - /* [out] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulNumTasks, - /* [in] */ ULONG ulWaitPeriod); - - HRESULT ( STDMETHODCALLTYPE *TerminateTasks )( - IDXTaskManager * This, - /* [in] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulCount, - /* [in] */ ULONG ulTimeOut); - - HRESULT ( STDMETHODCALLTYPE *TerminateRequest )( - IDXTaskManager * This, - /* [in] */ REFIID RequestID, - /* [in] */ ULONG ulTimeOut); - - END_INTERFACE - } IDXTaskManagerVtbl; - - interface IDXTaskManager - { - CONST_VTBL struct IDXTaskManagerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTaskManager_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTaskManager_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTaskManager_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTaskManager_QueryNumProcessors(This,pulNumProc) \ - (This)->lpVtbl -> QueryNumProcessors(This,pulNumProc) - -#define IDXTaskManager_SetThreadPoolSize(This,ulNumThreads) \ - (This)->lpVtbl -> SetThreadPoolSize(This,ulNumThreads) - -#define IDXTaskManager_GetThreadPoolSize(This,pulNumThreads) \ - (This)->lpVtbl -> GetThreadPoolSize(This,pulNumThreads) - -#define IDXTaskManager_SetConcurrencyLimit(This,ulNumThreads) \ - (This)->lpVtbl -> SetConcurrencyLimit(This,ulNumThreads) - -#define IDXTaskManager_GetConcurrencyLimit(This,pulNumThreads) \ - (This)->lpVtbl -> GetConcurrencyLimit(This,pulNumThreads) - -#define IDXTaskManager_ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) \ - (This)->lpVtbl -> ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) - -#define IDXTaskManager_TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) \ - (This)->lpVtbl -> TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) - -#define IDXTaskManager_TerminateRequest(This,RequestID,ulTimeOut) \ - (This)->lpVtbl -> TerminateRequest(This,RequestID,ulTimeOut) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_QueryNumProcessors_Proxy( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumProc); - - -void __RPC_STUB IDXTaskManager_QueryNumProcessors_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_SetThreadPoolSize_Proxy( - IDXTaskManager * This, - /* [in] */ ULONG ulNumThreads); - - -void __RPC_STUB IDXTaskManager_SetThreadPoolSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_GetThreadPoolSize_Proxy( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumThreads); - - -void __RPC_STUB IDXTaskManager_GetThreadPoolSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_SetConcurrencyLimit_Proxy( - IDXTaskManager * This, - /* [in] */ ULONG ulNumThreads); - - -void __RPC_STUB IDXTaskManager_SetConcurrencyLimit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_GetConcurrencyLimit_Proxy( - IDXTaskManager * This, - /* [out] */ ULONG *pulNumThreads); - - -void __RPC_STUB IDXTaskManager_GetConcurrencyLimit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_ScheduleTasks_Proxy( - IDXTaskManager * This, - /* [in] */ DXTMTASKINFO TaskInfo[ ], - /* [in] */ HANDLE Events[ ], - /* [out] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulNumTasks, - /* [in] */ ULONG ulWaitPeriod); - - -void __RPC_STUB IDXTaskManager_ScheduleTasks_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateTasks_Proxy( - IDXTaskManager * This, - /* [in] */ DWORD TaskIDs[ ], - /* [in] */ ULONG ulCount, - /* [in] */ ULONG ulTimeOut); - - -void __RPC_STUB IDXTaskManager_TerminateTasks_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateRequest_Proxy( - IDXTaskManager * This, - /* [in] */ REFIID RequestID, - /* [in] */ ULONG ulTimeOut); - - -void __RPC_STUB IDXTaskManager_TerminateRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTaskManager_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0264 */ -/* [local] */ - -#ifdef __cplusplus -///////////////////////////////////////////////////// - -class DXBASESAMPLE; -class DXSAMPLE; -class DXPMSAMPLE; - -///////////////////////////////////////////////////// - -class DXBASESAMPLE -{ -public: - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - DXBASESAMPLE() {} - DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : - Alpha(alpha), - Red(red), - Green(green), - Blue(blue) {} - DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); } - operator DWORD () const {return *((DWORD *)this); } - DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); } -}; // DXBASESAMPLE - -///////////////////////////////////////////////////// - -class DXSAMPLE : public DXBASESAMPLE -{ -public: - DXSAMPLE() {} - DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : - DXBASESAMPLE(alpha, red, green, blue) {} - DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); } - operator DWORD () const {return *((DWORD *)this); } - DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); } - operator DXPMSAMPLE() const; -}; // DXSAMPLE - -///////////////////////////////////////////////////// - -class DXPMSAMPLE : public DXBASESAMPLE -{ -public: - DXPMSAMPLE() {} - DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : - DXBASESAMPLE(alpha, red, green, blue) {} - DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); } - operator DWORD () const {return *((DWORD *)this); } - DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); } - operator DXSAMPLE() const; -}; // DXPMSAMPLE - -// -// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE -// -inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); } -inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); } -#else // !__cplusplus -typedef struct DXBASESAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXBASESAMPLE; - -typedef struct DXSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXSAMPLE; - -typedef struct DXPMSAMPLE - { - BYTE Blue; - BYTE Green; - BYTE Red; - BYTE Alpha; - } DXPMSAMPLE; - -#endif // !__cplusplus -typedef -enum DXRUNTYPE - { DXRUNTYPE_CLEAR = 0, - DXRUNTYPE_OPAQUE = 1, - DXRUNTYPE_TRANS = 2, - DXRUNTYPE_UNKNOWN = 3 - } DXRUNTYPE; - -#define DX_MAX_RUN_INFO_COUNT ( 128 ) - -// Ignore the definition used by MIDL for TLB generation -#if 0 -typedef struct DXRUNINFO - { - ULONG Bitfields; - } DXRUNINFO; - -#endif // 0 -typedef struct DXRUNINFO -{ - ULONG Type : 2; // Type - ULONG Count : 30; // Number of samples in run -} DXRUNINFO; -typedef -enum DXSFCREATE - { DXSF_FORMAT_IS_CLSID = 1L << 0, - DXSF_NO_LAZY_DDRAW_LOCK = 1L << 1 - } DXSFCREATE; - -typedef -enum DXBLTOPTIONS - { DXBOF_DO_OVER = 1L << 0, - DXBOF_DITHER = 1L << 1 - } DXBLTOPTIONS; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_s_ifspec; - -#ifndef __IDXSurfaceFactory_INTERFACE_DEFINED__ -#define __IDXSurfaceFactory_INTERFACE_DEFINED__ - -/* interface IDXSurfaceFactory */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXSurfaceFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("144946F5-C4D4-11d1-81D1-0000F87557DB") - IDXSurfaceFactory : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateSurface( - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateFromDDSurface( - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadImage( - /* [in] */ const LPWSTR pszFileName, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadImageFromStream( - /* [in] */ IStream *pStream, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE CopySurfaceToNewFormat( - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pDestFormatID, - /* [out] */ IDXSurface **ppNewSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateD3DRMTexture( - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ IUnknown *pD3DRM3, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppTexture3) = 0; - - virtual HRESULT STDMETHODCALLTYPE BitBlt( - /* [in] */ IDXSurface *pDest, - /* [in] */ const DXVEC *pPlacement, - /* [in] */ IDXSurface *pSrc, - /* [in] */ const DXBNDS *pClipBounds, - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXSurfaceFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXSurfaceFactory * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXSurfaceFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXSurfaceFactory * This); - - HRESULT ( STDMETHODCALLTYPE *CreateSurface )( - IDXSurfaceFactory * This, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - HRESULT ( STDMETHODCALLTYPE *CreateFromDDSurface )( - IDXSurfaceFactory * This, - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - HRESULT ( STDMETHODCALLTYPE *LoadImage )( - IDXSurfaceFactory * This, - /* [in] */ const LPWSTR pszFileName, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - HRESULT ( STDMETHODCALLTYPE *LoadImageFromStream )( - IDXSurfaceFactory * This, - /* [in] */ IStream *pStream, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - HRESULT ( STDMETHODCALLTYPE *CopySurfaceToNewFormat )( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pDestFormatID, - /* [out] */ IDXSurface **ppNewSurface); - - HRESULT ( STDMETHODCALLTYPE *CreateD3DRMTexture )( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ IUnknown *pD3DRM3, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppTexture3); - - HRESULT ( STDMETHODCALLTYPE *BitBlt )( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pDest, - /* [in] */ const DXVEC *pPlacement, - /* [in] */ IDXSurface *pSrc, - /* [in] */ const DXBNDS *pClipBounds, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } IDXSurfaceFactoryVtbl; - - interface IDXSurfaceFactory - { - CONST_VTBL struct IDXSurfaceFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXSurfaceFactory_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXSurfaceFactory_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXSurfaceFactory_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXSurfaceFactory_CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) \ - (This)->lpVtbl -> CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) - -#define IDXSurfaceFactory_CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) \ - (This)->lpVtbl -> CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) - -#define IDXSurfaceFactory_LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ - (This)->lpVtbl -> LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) - -#define IDXSurfaceFactory_LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ - (This)->lpVtbl -> LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) - -#define IDXSurfaceFactory_CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) \ - (This)->lpVtbl -> CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) - -#define IDXSurfaceFactory_CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) \ - (This)->lpVtbl -> CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) - -#define IDXSurfaceFactory_BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) \ - (This)->lpVtbl -> BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateSurface_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - -void __RPC_STUB IDXSurfaceFactory_CreateSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateFromDDSurface_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags, - /* [in] */ IUnknown *punkOuter, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - -void __RPC_STUB IDXSurfaceFactory_CreateFromDDSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImage_Proxy( - IDXSurfaceFactory * This, - /* [in] */ const LPWSTR pszFileName, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - -void __RPC_STUB IDXSurfaceFactory_LoadImage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImageFromStream_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IStream *pStream, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppDXSurface); - - -void __RPC_STUB IDXSurfaceFactory_LoadImageFromStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CopySurfaceToNewFormat_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pDestFormatID, - /* [out] */ IDXSurface **ppNewSurface); - - -void __RPC_STUB IDXSurfaceFactory_CopySurfaceToNewFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateD3DRMTexture_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pSrc, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ IUnknown *pD3DRM3, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppTexture3); - - -void __RPC_STUB IDXSurfaceFactory_CreateD3DRMTexture_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_BitBlt_Proxy( - IDXSurfaceFactory * This, - /* [in] */ IDXSurface *pDest, - /* [in] */ const DXVEC *pPlacement, - /* [in] */ IDXSurface *pSrc, - /* [in] */ const DXBNDS *pClipBounds, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDXSurfaceFactory_BitBlt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXSurfaceFactory_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0265 */ -/* [local] */ - -typedef -enum DXSURFMODCOMPOP - { DXSURFMOD_COMP_OVER = 0, - DXSURFMOD_COMP_ALPHA_MASK = 1, - DXSURFMOD_COMP_MAX_VALID = 1 - } DXSURFMODCOMPOP; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_s_ifspec; - -#ifndef __IDXSurfaceModifier_INTERFACE_DEFINED__ -#define __IDXSurfaceModifier_INTERFACE_DEFINED__ - -/* interface IDXSurfaceModifier */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXSurfaceModifier; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EA3B637-C37D-11d1-905E-00C04FD9189D") - IDXSurfaceModifier : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFillColor( - /* [in] */ DXSAMPLE Color) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFillColor( - /* [out] */ DXSAMPLE *pColor) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBounds( - /* [in] */ const DXBNDS *pBounds) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBackground( - /* [in] */ IDXSurface *pSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBackground( - /* [out] */ IDXSurface **ppSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCompositeOperation( - /* [in] */ DXSURFMODCOMPOP CompOp) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCompositeOperation( - /* [out] */ DXSURFMODCOMPOP *pCompOp) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetForeground( - /* [in] */ IDXSurface *pSurface, - /* [in] */ BOOL bTile, - /* [in] */ const POINT *pOrigin) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetForeground( - /* [out] */ IDXSurface **ppSurface, - /* [out] */ BOOL *pbTile, - /* [out] */ POINT *pOrigin) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOpacity( - /* [in] */ float Opacity) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOpacity( - /* [out] */ float *pOpacity) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetLookup( - /* [in] */ IDXLookupTable *pLookupTable) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetLookup( - /* [out] */ IDXLookupTable **ppLookupTable) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXSurfaceModifierVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXSurfaceModifier * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXSurfaceModifier * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXSurfaceModifier * This); - - HRESULT ( STDMETHODCALLTYPE *SetFillColor )( - IDXSurfaceModifier * This, - /* [in] */ DXSAMPLE Color); - - HRESULT ( STDMETHODCALLTYPE *GetFillColor )( - IDXSurfaceModifier * This, - /* [out] */ DXSAMPLE *pColor); - - HRESULT ( STDMETHODCALLTYPE *SetBounds )( - IDXSurfaceModifier * This, - /* [in] */ const DXBNDS *pBounds); - - HRESULT ( STDMETHODCALLTYPE *SetBackground )( - IDXSurfaceModifier * This, - /* [in] */ IDXSurface *pSurface); - - HRESULT ( STDMETHODCALLTYPE *GetBackground )( - IDXSurfaceModifier * This, - /* [out] */ IDXSurface **ppSurface); - - HRESULT ( STDMETHODCALLTYPE *SetCompositeOperation )( - IDXSurfaceModifier * This, - /* [in] */ DXSURFMODCOMPOP CompOp); - - HRESULT ( STDMETHODCALLTYPE *GetCompositeOperation )( - IDXSurfaceModifier * This, - /* [out] */ DXSURFMODCOMPOP *pCompOp); - - HRESULT ( STDMETHODCALLTYPE *SetForeground )( - IDXSurfaceModifier * This, - /* [in] */ IDXSurface *pSurface, - /* [in] */ BOOL bTile, - /* [in] */ const POINT *pOrigin); - - HRESULT ( STDMETHODCALLTYPE *GetForeground )( - IDXSurfaceModifier * This, - /* [out] */ IDXSurface **ppSurface, - /* [out] */ BOOL *pbTile, - /* [out] */ POINT *pOrigin); - - HRESULT ( STDMETHODCALLTYPE *SetOpacity )( - IDXSurfaceModifier * This, - /* [in] */ float Opacity); - - HRESULT ( STDMETHODCALLTYPE *GetOpacity )( - IDXSurfaceModifier * This, - /* [out] */ float *pOpacity); - - HRESULT ( STDMETHODCALLTYPE *SetLookup )( - IDXSurfaceModifier * This, - /* [in] */ IDXLookupTable *pLookupTable); - - HRESULT ( STDMETHODCALLTYPE *GetLookup )( - IDXSurfaceModifier * This, - /* [out] */ IDXLookupTable **ppLookupTable); - - END_INTERFACE - } IDXSurfaceModifierVtbl; - - interface IDXSurfaceModifier - { - CONST_VTBL struct IDXSurfaceModifierVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXSurfaceModifier_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXSurfaceModifier_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXSurfaceModifier_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXSurfaceModifier_SetFillColor(This,Color) \ - (This)->lpVtbl -> SetFillColor(This,Color) - -#define IDXSurfaceModifier_GetFillColor(This,pColor) \ - (This)->lpVtbl -> GetFillColor(This,pColor) - -#define IDXSurfaceModifier_SetBounds(This,pBounds) \ - (This)->lpVtbl -> SetBounds(This,pBounds) - -#define IDXSurfaceModifier_SetBackground(This,pSurface) \ - (This)->lpVtbl -> SetBackground(This,pSurface) - -#define IDXSurfaceModifier_GetBackground(This,ppSurface) \ - (This)->lpVtbl -> GetBackground(This,ppSurface) - -#define IDXSurfaceModifier_SetCompositeOperation(This,CompOp) \ - (This)->lpVtbl -> SetCompositeOperation(This,CompOp) - -#define IDXSurfaceModifier_GetCompositeOperation(This,pCompOp) \ - (This)->lpVtbl -> GetCompositeOperation(This,pCompOp) - -#define IDXSurfaceModifier_SetForeground(This,pSurface,bTile,pOrigin) \ - (This)->lpVtbl -> SetForeground(This,pSurface,bTile,pOrigin) - -#define IDXSurfaceModifier_GetForeground(This,ppSurface,pbTile,pOrigin) \ - (This)->lpVtbl -> GetForeground(This,ppSurface,pbTile,pOrigin) - -#define IDXSurfaceModifier_SetOpacity(This,Opacity) \ - (This)->lpVtbl -> SetOpacity(This,Opacity) - -#define IDXSurfaceModifier_GetOpacity(This,pOpacity) \ - (This)->lpVtbl -> GetOpacity(This,pOpacity) - -#define IDXSurfaceModifier_SetLookup(This,pLookupTable) \ - (This)->lpVtbl -> SetLookup(This,pLookupTable) - -#define IDXSurfaceModifier_GetLookup(This,ppLookupTable) \ - (This)->lpVtbl -> GetLookup(This,ppLookupTable) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetFillColor_Proxy( - IDXSurfaceModifier * This, - /* [in] */ DXSAMPLE Color); - - -void __RPC_STUB IDXSurfaceModifier_SetFillColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetFillColor_Proxy( - IDXSurfaceModifier * This, - /* [out] */ DXSAMPLE *pColor); - - -void __RPC_STUB IDXSurfaceModifier_GetFillColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBounds_Proxy( - IDXSurfaceModifier * This, - /* [in] */ const DXBNDS *pBounds); - - -void __RPC_STUB IDXSurfaceModifier_SetBounds_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBackground_Proxy( - IDXSurfaceModifier * This, - /* [in] */ IDXSurface *pSurface); - - -void __RPC_STUB IDXSurfaceModifier_SetBackground_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetBackground_Proxy( - IDXSurfaceModifier * This, - /* [out] */ IDXSurface **ppSurface); - - -void __RPC_STUB IDXSurfaceModifier_GetBackground_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetCompositeOperation_Proxy( - IDXSurfaceModifier * This, - /* [in] */ DXSURFMODCOMPOP CompOp); - - -void __RPC_STUB IDXSurfaceModifier_SetCompositeOperation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetCompositeOperation_Proxy( - IDXSurfaceModifier * This, - /* [out] */ DXSURFMODCOMPOP *pCompOp); - - -void __RPC_STUB IDXSurfaceModifier_GetCompositeOperation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetForeground_Proxy( - IDXSurfaceModifier * This, - /* [in] */ IDXSurface *pSurface, - /* [in] */ BOOL bTile, - /* [in] */ const POINT *pOrigin); - - -void __RPC_STUB IDXSurfaceModifier_SetForeground_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetForeground_Proxy( - IDXSurfaceModifier * This, - /* [out] */ IDXSurface **ppSurface, - /* [out] */ BOOL *pbTile, - /* [out] */ POINT *pOrigin); - - -void __RPC_STUB IDXSurfaceModifier_GetForeground_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetOpacity_Proxy( - IDXSurfaceModifier * This, - /* [in] */ float Opacity); - - -void __RPC_STUB IDXSurfaceModifier_SetOpacity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetOpacity_Proxy( - IDXSurfaceModifier * This, - /* [out] */ float *pOpacity); - - -void __RPC_STUB IDXSurfaceModifier_GetOpacity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetLookup_Proxy( - IDXSurfaceModifier * This, - /* [in] */ IDXLookupTable *pLookupTable); - - -void __RPC_STUB IDXSurfaceModifier_SetLookup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetLookup_Proxy( - IDXSurfaceModifier * This, - /* [out] */ IDXLookupTable **ppLookupTable); - - -void __RPC_STUB IDXSurfaceModifier_GetLookup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXSurfaceModifier_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0266 */ -/* [local] */ - -typedef -enum DXSAMPLEFORMATENUM - { DXPF_FLAGSMASK = 0xffff0000, - DXPF_NONPREMULT = 0x10000, - DXPF_TRANSPARENCY = 0x20000, - DXPF_TRANSLUCENCY = 0x40000, - DXPF_2BITERROR = 0x200000, - DXPF_3BITERROR = 0x300000, - DXPF_4BITERROR = 0x400000, - DXPF_5BITERROR = 0x500000, - DXPF_ERRORMASK = 0x700000, - DXPF_NONSTANDARD = 0, - DXPF_PMARGB32 = 1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, - DXPF_ARGB32 = 2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, - DXPF_ARGB4444 = 3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR, - DXPF_A8 = 4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, - DXPF_RGB32 = 5, - DXPF_RGB24 = 6, - DXPF_RGB565 = 7 | DXPF_3BITERROR, - DXPF_RGB555 = 8 | DXPF_3BITERROR, - DXPF_RGB8 = 9 | DXPF_5BITERROR, - DXPF_ARGB1555 = 10 | DXPF_TRANSPARENCY | DXPF_3BITERROR, - DXPF_RGB32_CK = DXPF_RGB32 | DXPF_TRANSPARENCY, - DXPF_RGB24_CK = DXPF_RGB24 | DXPF_TRANSPARENCY, - DXPF_RGB555_CK = DXPF_RGB555 | DXPF_TRANSPARENCY, - DXPF_RGB565_CK = DXPF_RGB565 | DXPF_TRANSPARENCY, - DXPF_RGB8_CK = DXPF_RGB8 | DXPF_TRANSPARENCY - } DXSAMPLEFORMATENUM; - -typedef -enum DXLOCKSURF - { DXLOCKF_READ = 0, - DXLOCKF_READWRITE = 1 << 0, - DXLOCKF_EXISTINGINFOONLY = 1 << 1, - DXLOCKF_WANTRUNINFO = 1 << 2, - DXLOCKF_NONPREMULT = 1 << 16, - DXLOCKF_VALIDFLAGS = DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT - } DXLOCKSURF; - -typedef -enum DXSURFSTATUS - { DXSURF_TRANSIENT = 1 << 0, - DXSURF_READONLY = 1 << 1, - DXSURF_VALIDFLAGS = DXSURF_TRANSIENT | DXSURF_READONLY - } DXSURFSTATUS; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_s_ifspec; - -#ifndef __IDXSurface_INTERFACE_DEFINED__ -#define __IDXSurface_INTERFACE_DEFINED__ - -/* interface IDXSurface */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXSurface; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B39FD73F-E139-11d1-9065-00C04FD9189D") - IDXSurface : public IDXBaseObject - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPixelFormat( - /* [out] */ GUID *pFormatID, - /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBounds( - /* [out] */ DXBNDS *pBounds) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStatusFlags( - /* [out] */ DWORD *pdwStatusFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStatusFlags( - /* [in] */ DWORD dwStatusFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE LockSurface( - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppPointer, - /* [out] */ ULONG *pulGenerationId) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDirectDrawSurface( - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetColorKey( - DXSAMPLE *pColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetColorKey( - DXSAMPLE ColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE LockSurfaceDC( - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [out] */ IDXDCLock **ppDCLock) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetAppData( - DWORD_PTR dwAppData) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAppData( - DWORD_PTR *pdwAppData) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXSurfaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXSurface * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXSurface * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXSurface * This); - - HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( - IDXSurface * This, - /* [out] */ ULONG *pID); - - HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( - IDXSurface * This, - /* [in] */ BOOL bRefresh); - - HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( - IDXSurface * This, - /* [out] */ ULONG *pcbSize); - - HRESULT ( STDMETHODCALLTYPE *GetPixelFormat )( - IDXSurface * This, - /* [out] */ GUID *pFormatID, - /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); - - HRESULT ( STDMETHODCALLTYPE *GetBounds )( - IDXSurface * This, - /* [out] */ DXBNDS *pBounds); - - HRESULT ( STDMETHODCALLTYPE *GetStatusFlags )( - IDXSurface * This, - /* [out] */ DWORD *pdwStatusFlags); - - HRESULT ( STDMETHODCALLTYPE *SetStatusFlags )( - IDXSurface * This, - /* [in] */ DWORD dwStatusFlags); - - HRESULT ( STDMETHODCALLTYPE *LockSurface )( - IDXSurface * This, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppPointer, - /* [out] */ ULONG *pulGenerationId); - - HRESULT ( STDMETHODCALLTYPE *GetDirectDrawSurface )( - IDXSurface * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface); - - HRESULT ( STDMETHODCALLTYPE *GetColorKey )( - IDXSurface * This, - DXSAMPLE *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *SetColorKey )( - IDXSurface * This, - DXSAMPLE ColorKey); - - HRESULT ( STDMETHODCALLTYPE *LockSurfaceDC )( - IDXSurface * This, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [out] */ IDXDCLock **ppDCLock); - - HRESULT ( STDMETHODCALLTYPE *SetAppData )( - IDXSurface * This, - DWORD_PTR dwAppData); - - HRESULT ( STDMETHODCALLTYPE *GetAppData )( - IDXSurface * This, - DWORD_PTR *pdwAppData); - - END_INTERFACE - } IDXSurfaceVtbl; - - interface IDXSurface - { - CONST_VTBL struct IDXSurfaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXSurface_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXSurface_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXSurface_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXSurface_GetGenerationId(This,pID) \ - (This)->lpVtbl -> GetGenerationId(This,pID) - -#define IDXSurface_IncrementGenerationId(This,bRefresh) \ - (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) - -#define IDXSurface_GetObjectSize(This,pcbSize) \ - (This)->lpVtbl -> GetObjectSize(This,pcbSize) - - -#define IDXSurface_GetPixelFormat(This,pFormatID,pSampleFormatEnum) \ - (This)->lpVtbl -> GetPixelFormat(This,pFormatID,pSampleFormatEnum) - -#define IDXSurface_GetBounds(This,pBounds) \ - (This)->lpVtbl -> GetBounds(This,pBounds) - -#define IDXSurface_GetStatusFlags(This,pdwStatusFlags) \ - (This)->lpVtbl -> GetStatusFlags(This,pdwStatusFlags) - -#define IDXSurface_SetStatusFlags(This,dwStatusFlags) \ - (This)->lpVtbl -> SetStatusFlags(This,dwStatusFlags) - -#define IDXSurface_LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) \ - (This)->lpVtbl -> LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) - -#define IDXSurface_GetDirectDrawSurface(This,riid,ppSurface) \ - (This)->lpVtbl -> GetDirectDrawSurface(This,riid,ppSurface) - -#define IDXSurface_GetColorKey(This,pColorKey) \ - (This)->lpVtbl -> GetColorKey(This,pColorKey) - -#define IDXSurface_SetColorKey(This,ColorKey) \ - (This)->lpVtbl -> SetColorKey(This,ColorKey) - -#define IDXSurface_LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) \ - (This)->lpVtbl -> LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) - -#define IDXSurface_SetAppData(This,dwAppData) \ - (This)->lpVtbl -> SetAppData(This,dwAppData) - -#define IDXSurface_GetAppData(This,pdwAppData) \ - (This)->lpVtbl -> GetAppData(This,pdwAppData) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetPixelFormat_Proxy( - IDXSurface * This, - /* [out] */ GUID *pFormatID, - /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); - - -void __RPC_STUB IDXSurface_GetPixelFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetBounds_Proxy( - IDXSurface * This, - /* [out] */ DXBNDS *pBounds); - - -void __RPC_STUB IDXSurface_GetBounds_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetStatusFlags_Proxy( - IDXSurface * This, - /* [out] */ DWORD *pdwStatusFlags); - - -void __RPC_STUB IDXSurface_GetStatusFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_SetStatusFlags_Proxy( - IDXSurface * This, - /* [in] */ DWORD dwStatusFlags); - - -void __RPC_STUB IDXSurface_SetStatusFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_LockSurface_Proxy( - IDXSurface * This, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppPointer, - /* [out] */ ULONG *pulGenerationId); - - -void __RPC_STUB IDXSurface_LockSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetDirectDrawSurface_Proxy( - IDXSurface * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface); - - -void __RPC_STUB IDXSurface_GetDirectDrawSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetColorKey_Proxy( - IDXSurface * This, - DXSAMPLE *pColorKey); - - -void __RPC_STUB IDXSurface_GetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_SetColorKey_Proxy( - IDXSurface * This, - DXSAMPLE ColorKey); - - -void __RPC_STUB IDXSurface_SetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_LockSurfaceDC_Proxy( - IDXSurface * This, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ ULONG ulTimeOut, - /* [in] */ DWORD dwFlags, - /* [out] */ IDXDCLock **ppDCLock); - - -void __RPC_STUB IDXSurface_LockSurfaceDC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_SetAppData_Proxy( - IDXSurface * This, - DWORD_PTR dwAppData); - - -void __RPC_STUB IDXSurface_SetAppData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXSurface_GetAppData_Proxy( - IDXSurface * This, - DWORD_PTR *pdwAppData); - - -void __RPC_STUB IDXSurface_GetAppData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXSurface_INTERFACE_DEFINED__ */ - - -#ifndef __IDXSurfaceInit_INTERFACE_DEFINED__ -#define __IDXSurfaceInit_INTERFACE_DEFINED__ - -/* interface IDXSurfaceInit */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXSurfaceInit; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EA3B639-C37D-11d1-905E-00C04FD9189D") - IDXSurfaceInit : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InitSurface( - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXSurfaceInitVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXSurfaceInit * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXSurfaceInit * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXSurfaceInit * This); - - HRESULT ( STDMETHODCALLTYPE *InitSurface )( - IDXSurfaceInit * This, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } IDXSurfaceInitVtbl; - - interface IDXSurfaceInit - { - CONST_VTBL struct IDXSurfaceInitVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXSurfaceInit_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXSurfaceInit_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXSurfaceInit_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ - (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXSurfaceInit_InitSurface_Proxy( - IDXSurfaceInit * This, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDXSurfaceInit_InitSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXSurfaceInit_INTERFACE_DEFINED__ */ - - -#ifndef __IDXARGBSurfaceInit_INTERFACE_DEFINED__ -#define __IDXARGBSurfaceInit_INTERFACE_DEFINED__ - -/* interface IDXARGBSurfaceInit */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXARGBSurfaceInit; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EA3B63A-C37D-11d1-905E-00C04FD9189D") - IDXARGBSurfaceInit : public IDXSurfaceInit - { - public: - virtual HRESULT STDMETHODCALLTYPE InitFromDDSurface( - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE InitFromRawSurface( - /* [in] */ IDXRawSurface *pRawSurface) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXARGBSurfaceInitVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXARGBSurfaceInit * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXARGBSurfaceInit * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXARGBSurfaceInit * This); - - HRESULT ( STDMETHODCALLTYPE *InitSurface )( - IDXARGBSurfaceInit * This, - /* [in] */ IUnknown *pDirectDraw, - /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, - /* [in] */ const GUID *pFormatID, - /* [in] */ const DXBNDS *pBounds, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *InitFromDDSurface )( - IDXARGBSurfaceInit * This, - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *InitFromRawSurface )( - IDXARGBSurfaceInit * This, - /* [in] */ IDXRawSurface *pRawSurface); - - END_INTERFACE - } IDXARGBSurfaceInitVtbl; - - interface IDXARGBSurfaceInit - { - CONST_VTBL struct IDXARGBSurfaceInitVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXARGBSurfaceInit_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXARGBSurfaceInit_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXARGBSurfaceInit_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXARGBSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ - (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) - - -#define IDXARGBSurfaceInit_InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) \ - (This)->lpVtbl -> InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) - -#define IDXARGBSurfaceInit_InitFromRawSurface(This,pRawSurface) \ - (This)->lpVtbl -> InitFromRawSurface(This,pRawSurface) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromDDSurface_Proxy( - IDXARGBSurfaceInit * This, - /* [in] */ IUnknown *pDDrawSurface, - /* [in] */ const GUID *pFormatID, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDXARGBSurfaceInit_InitFromDDSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromRawSurface_Proxy( - IDXARGBSurfaceInit * This, - /* [in] */ IDXRawSurface *pRawSurface); - - -void __RPC_STUB IDXARGBSurfaceInit_InitFromRawSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXARGBSurfaceInit_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0269 */ -/* [local] */ - -typedef struct tagDXNATIVETYPEINFO - { - BYTE *pCurrentData; - BYTE *pFirstByte; - long lPitch; - DWORD dwColorKey; - } DXNATIVETYPEINFO; - -typedef struct tagDXPACKEDRECTDESC - { - DXBASESAMPLE *pSamples; - BOOL bPremult; - RECT rect; - long lRowPadding; - } DXPACKEDRECTDESC; - -typedef struct tagDXOVERSAMPLEDESC - { - POINT p; - DXPMSAMPLE Color; - } DXOVERSAMPLEDESC; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0269_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0269_v0_0_s_ifspec; - -#ifndef __IDXARGBReadPtr_INTERFACE_DEFINED__ -#define __IDXARGBReadPtr_INTERFACE_DEFINED__ - -/* interface IDXARGBReadPtr */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXARGBReadPtr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAAAC2D6-C290-11d1-905D-00C04FD9189D") - IDXARGBReadPtr : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetSurface( - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface) = 0; - - virtual DXSAMPLEFORMATENUM STDMETHODCALLTYPE GetNativeType( - /* [out] */ DXNATIVETYPEINFO *pInfo) = 0; - - virtual void STDMETHODCALLTYPE Move( - /* [in] */ long cSamples) = 0; - - virtual void STDMETHODCALLTYPE MoveToRow( - /* [in] */ ULONG y) = 0; - - virtual void STDMETHODCALLTYPE MoveToXY( - /* [in] */ ULONG x, - /* [in] */ ULONG y) = 0; - - virtual ULONG STDMETHODCALLTYPE MoveAndGetRunInfo( - /* [in] */ ULONG Row, - /* [out] */ const DXRUNINFO **ppInfo) = 0; - - virtual DXSAMPLE *STDMETHODCALLTYPE Unpack( - /* [in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove) = 0; - - virtual DXPMSAMPLE *STDMETHODCALLTYPE UnpackPremult( - /* [in] */ DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove) = 0; - - virtual void STDMETHODCALLTYPE UnpackRect( - /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXARGBReadPtrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXARGBReadPtr * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXARGBReadPtr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXARGBReadPtr * This); - - HRESULT ( STDMETHODCALLTYPE *GetSurface )( - IDXARGBReadPtr * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface); - - DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( - IDXARGBReadPtr * This, - /* [out] */ DXNATIVETYPEINFO *pInfo); - - void ( STDMETHODCALLTYPE *Move )( - IDXARGBReadPtr * This, - /* [in] */ long cSamples); - - void ( STDMETHODCALLTYPE *MoveToRow )( - IDXARGBReadPtr * This, - /* [in] */ ULONG y); - - void ( STDMETHODCALLTYPE *MoveToXY )( - IDXARGBReadPtr * This, - /* [in] */ ULONG x, - /* [in] */ ULONG y); - - ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( - IDXARGBReadPtr * This, - /* [in] */ ULONG Row, - /* [out] */ const DXRUNINFO **ppInfo); - - DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( - IDXARGBReadPtr * This, - /* [in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( - IDXARGBReadPtr * This, - /* [in] */ DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - void ( STDMETHODCALLTYPE *UnpackRect )( - IDXARGBReadPtr * This, - /* [in] */ const DXPACKEDRECTDESC *pRectDesc); - - END_INTERFACE - } IDXARGBReadPtrVtbl; - - interface IDXARGBReadPtr - { - CONST_VTBL struct IDXARGBReadPtrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXARGBReadPtr_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXARGBReadPtr_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXARGBReadPtr_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXARGBReadPtr_GetSurface(This,riid,ppSurface) \ - (This)->lpVtbl -> GetSurface(This,riid,ppSurface) - -#define IDXARGBReadPtr_GetNativeType(This,pInfo) \ - (This)->lpVtbl -> GetNativeType(This,pInfo) - -#define IDXARGBReadPtr_Move(This,cSamples) \ - (This)->lpVtbl -> Move(This,cSamples) - -#define IDXARGBReadPtr_MoveToRow(This,y) \ - (This)->lpVtbl -> MoveToRow(This,y) - -#define IDXARGBReadPtr_MoveToXY(This,x,y) \ - (This)->lpVtbl -> MoveToXY(This,x,y) - -#define IDXARGBReadPtr_MoveAndGetRunInfo(This,Row,ppInfo) \ - (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) - -#define IDXARGBReadPtr_Unpack(This,pSamples,cSamples,bMove) \ - (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) - -#define IDXARGBReadPtr_UnpackPremult(This,pSamples,cSamples,bMove) \ - (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) - -#define IDXARGBReadPtr_UnpackRect(This,pRectDesc) \ - (This)->lpVtbl -> UnpackRect(This,pRectDesc) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXARGBReadPtr_GetSurface_Proxy( - IDXARGBReadPtr * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface); - - -void __RPC_STUB IDXARGBReadPtr_GetSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -DXSAMPLEFORMATENUM STDMETHODCALLTYPE IDXARGBReadPtr_GetNativeType_Proxy( - IDXARGBReadPtr * This, - /* [out] */ DXNATIVETYPEINFO *pInfo); - - -void __RPC_STUB IDXARGBReadPtr_GetNativeType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadPtr_Move_Proxy( - IDXARGBReadPtr * This, - /* [in] */ long cSamples); - - -void __RPC_STUB IDXARGBReadPtr_Move_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToRow_Proxy( - IDXARGBReadPtr * This, - /* [in] */ ULONG y); - - -void __RPC_STUB IDXARGBReadPtr_MoveToRow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToXY_Proxy( - IDXARGBReadPtr * This, - /* [in] */ ULONG x, - /* [in] */ ULONG y); - - -void __RPC_STUB IDXARGBReadPtr_MoveToXY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -ULONG STDMETHODCALLTYPE IDXARGBReadPtr_MoveAndGetRunInfo_Proxy( - IDXARGBReadPtr * This, - /* [in] */ ULONG Row, - /* [out] */ const DXRUNINFO **ppInfo); - - -void __RPC_STUB IDXARGBReadPtr_MoveAndGetRunInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -DXSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_Unpack_Proxy( - IDXARGBReadPtr * This, - /* [in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - -void __RPC_STUB IDXARGBReadPtr_Unpack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -DXPMSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_UnpackPremult_Proxy( - IDXARGBReadPtr * This, - /* [in] */ DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - -void __RPC_STUB IDXARGBReadPtr_UnpackPremult_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadPtr_UnpackRect_Proxy( - IDXARGBReadPtr * This, - /* [in] */ const DXPACKEDRECTDESC *pRectDesc); - - -void __RPC_STUB IDXARGBReadPtr_UnpackRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXARGBReadPtr_INTERFACE_DEFINED__ */ - - -#ifndef __IDXARGBReadWritePtr_INTERFACE_DEFINED__ -#define __IDXARGBReadWritePtr_INTERFACE_DEFINED__ - -/* interface IDXARGBReadWritePtr */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXARGBReadWritePtr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAAAC2D7-C290-11d1-905D-00C04FD9189D") - IDXARGBReadWritePtr : public IDXARGBReadPtr - { - public: - virtual void STDMETHODCALLTYPE PackAndMove( - /* [in] */ const DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples) = 0; - - virtual void STDMETHODCALLTYPE PackPremultAndMove( - /* [in] */ const DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples) = 0; - - virtual void STDMETHODCALLTYPE PackRect( - /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; - - virtual void STDMETHODCALLTYPE CopyAndMoveBoth( - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bIsOpaque) = 0; - - virtual void STDMETHODCALLTYPE CopyRect( - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const RECT *pDestRect, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ const POINT *pSrcOrigin, - /* [in] */ BOOL bIsOpaque) = 0; - - virtual void STDMETHODCALLTYPE FillAndMove( - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bDoOver) = 0; - - virtual void STDMETHODCALLTYPE FillRect( - /* [in] */ const RECT *pRect, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ BOOL bDoOver) = 0; - - virtual void STDMETHODCALLTYPE OverSample( - /* [in] */ const DXOVERSAMPLEDESC *pOverDesc) = 0; - - virtual void STDMETHODCALLTYPE OverArrayAndMove( - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const DXPMSAMPLE *pSrc, - /* [in] */ ULONG cSamples) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXARGBReadWritePtrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXARGBReadWritePtr * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXARGBReadWritePtr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXARGBReadWritePtr * This); - - HRESULT ( STDMETHODCALLTYPE *GetSurface )( - IDXARGBReadWritePtr * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppSurface); - - DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( - IDXARGBReadWritePtr * This, - /* [out] */ DXNATIVETYPEINFO *pInfo); - - void ( STDMETHODCALLTYPE *Move )( - IDXARGBReadWritePtr * This, - /* [in] */ long cSamples); - - void ( STDMETHODCALLTYPE *MoveToRow )( - IDXARGBReadWritePtr * This, - /* [in] */ ULONG y); - - void ( STDMETHODCALLTYPE *MoveToXY )( - IDXARGBReadWritePtr * This, - /* [in] */ ULONG x, - /* [in] */ ULONG y); - - ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( - IDXARGBReadWritePtr * This, - /* [in] */ ULONG Row, - /* [out] */ const DXRUNINFO **ppInfo); - - DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( - IDXARGBReadWritePtr * This, - /* [in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( - IDXARGBReadWritePtr * This, - /* [in] */ DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bMove); - - void ( STDMETHODCALLTYPE *UnpackRect )( - IDXARGBReadWritePtr * This, - /* [in] */ const DXPACKEDRECTDESC *pRectDesc); - - void ( STDMETHODCALLTYPE *PackAndMove )( - IDXARGBReadWritePtr * This, - /* [in] */ const DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - void ( STDMETHODCALLTYPE *PackPremultAndMove )( - IDXARGBReadWritePtr * This, - /* [in] */ const DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - void ( STDMETHODCALLTYPE *PackRect )( - IDXARGBReadWritePtr * This, - /* [in] */ const DXPACKEDRECTDESC *pRectDesc); - - void ( STDMETHODCALLTYPE *CopyAndMoveBoth )( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bIsOpaque); - - void ( STDMETHODCALLTYPE *CopyRect )( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const RECT *pDestRect, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ const POINT *pSrcOrigin, - /* [in] */ BOOL bIsOpaque); - - void ( STDMETHODCALLTYPE *FillAndMove )( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bDoOver); - - void ( STDMETHODCALLTYPE *FillRect )( - IDXARGBReadWritePtr * This, - /* [in] */ const RECT *pRect, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ BOOL bDoOver); - - void ( STDMETHODCALLTYPE *OverSample )( - IDXARGBReadWritePtr * This, - /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); - - void ( STDMETHODCALLTYPE *OverArrayAndMove )( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const DXPMSAMPLE *pSrc, - /* [in] */ ULONG cSamples); - - END_INTERFACE - } IDXARGBReadWritePtrVtbl; - - interface IDXARGBReadWritePtr - { - CONST_VTBL struct IDXARGBReadWritePtrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXARGBReadWritePtr_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXARGBReadWritePtr_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXARGBReadWritePtr_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXARGBReadWritePtr_GetSurface(This,riid,ppSurface) \ - (This)->lpVtbl -> GetSurface(This,riid,ppSurface) - -#define IDXARGBReadWritePtr_GetNativeType(This,pInfo) \ - (This)->lpVtbl -> GetNativeType(This,pInfo) - -#define IDXARGBReadWritePtr_Move(This,cSamples) \ - (This)->lpVtbl -> Move(This,cSamples) - -#define IDXARGBReadWritePtr_MoveToRow(This,y) \ - (This)->lpVtbl -> MoveToRow(This,y) - -#define IDXARGBReadWritePtr_MoveToXY(This,x,y) \ - (This)->lpVtbl -> MoveToXY(This,x,y) - -#define IDXARGBReadWritePtr_MoveAndGetRunInfo(This,Row,ppInfo) \ - (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) - -#define IDXARGBReadWritePtr_Unpack(This,pSamples,cSamples,bMove) \ - (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) - -#define IDXARGBReadWritePtr_UnpackPremult(This,pSamples,cSamples,bMove) \ - (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) - -#define IDXARGBReadWritePtr_UnpackRect(This,pRectDesc) \ - (This)->lpVtbl -> UnpackRect(This,pRectDesc) - - -#define IDXARGBReadWritePtr_PackAndMove(This,pSamples,cSamples) \ - (This)->lpVtbl -> PackAndMove(This,pSamples,cSamples) - -#define IDXARGBReadWritePtr_PackPremultAndMove(This,pSamples,cSamples) \ - (This)->lpVtbl -> PackPremultAndMove(This,pSamples,cSamples) - -#define IDXARGBReadWritePtr_PackRect(This,pRectDesc) \ - (This)->lpVtbl -> PackRect(This,pRectDesc) - -#define IDXARGBReadWritePtr_CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) \ - (This)->lpVtbl -> CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) - -#define IDXARGBReadWritePtr_CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) \ - (This)->lpVtbl -> CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) - -#define IDXARGBReadWritePtr_FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) \ - (This)->lpVtbl -> FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) - -#define IDXARGBReadWritePtr_FillRect(This,pRect,SampVal,bDoOver) \ - (This)->lpVtbl -> FillRect(This,pRect,SampVal,bDoOver) - -#define IDXARGBReadWritePtr_OverSample(This,pOverDesc) \ - (This)->lpVtbl -> OverSample(This,pOverDesc) - -#define IDXARGBReadWritePtr_OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) \ - (This)->lpVtbl -> OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackAndMove_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ const DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - -void __RPC_STUB IDXARGBReadWritePtr_PackAndMove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackPremultAndMove_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ const DXPMSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - -void __RPC_STUB IDXARGBReadWritePtr_PackPremultAndMove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackRect_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ const DXPACKEDRECTDESC *pRectDesc); - - -void __RPC_STUB IDXARGBReadWritePtr_PackRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyAndMoveBoth_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bIsOpaque); - - -void __RPC_STUB IDXARGBReadWritePtr_CopyAndMoveBoth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyRect_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const RECT *pDestRect, - /* [in] */ IDXARGBReadPtr *pSrc, - /* [in] */ const POINT *pSrcOrigin, - /* [in] */ BOOL bIsOpaque); - - -void __RPC_STUB IDXARGBReadWritePtr_CopyRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillAndMove_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ ULONG cSamples, - /* [in] */ BOOL bDoOver); - - -void __RPC_STUB IDXARGBReadWritePtr_FillAndMove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillRect_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ const RECT *pRect, - /* [in] */ DXPMSAMPLE SampVal, - /* [in] */ BOOL bDoOver); - - -void __RPC_STUB IDXARGBReadWritePtr_FillRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverSample_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); - - -void __RPC_STUB IDXARGBReadWritePtr_OverSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverArrayAndMove_Proxy( - IDXARGBReadWritePtr * This, - /* [in] */ DXBASESAMPLE *pScratchBuffer, - /* [in] */ const DXPMSAMPLE *pSrc, - /* [in] */ ULONG cSamples); - - -void __RPC_STUB IDXARGBReadWritePtr_OverArrayAndMove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXARGBReadWritePtr_INTERFACE_DEFINED__ */ - - -#ifndef __IDXDCLock_INTERFACE_DEFINED__ -#define __IDXDCLock_INTERFACE_DEFINED__ - -/* interface IDXDCLock */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXDCLock; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0F619456-CF39-11d1-905E-00C04FD9189D") - IDXDCLock : public IUnknown - { - public: - virtual HDC STDMETHODCALLTYPE GetDC( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXDCLockVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXDCLock * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXDCLock * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXDCLock * This); - - HDC ( STDMETHODCALLTYPE *GetDC )( - IDXDCLock * This); - - END_INTERFACE - } IDXDCLockVtbl; - - interface IDXDCLock - { - CONST_VTBL struct IDXDCLockVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXDCLock_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXDCLock_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXDCLock_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXDCLock_GetDC(This) \ - (This)->lpVtbl -> GetDC(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HDC STDMETHODCALLTYPE IDXDCLock_GetDC_Proxy( - IDXDCLock * This); - - -void __RPC_STUB IDXDCLock_GetDC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXDCLock_INTERFACE_DEFINED__ */ - - -#ifndef __IDXTScaleOutput_INTERFACE_DEFINED__ -#define __IDXTScaleOutput_INTERFACE_DEFINED__ - -/* interface IDXTScaleOutput */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTScaleOutput; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B2024B50-EE77-11d1-9066-00C04FD9189D") - IDXTScaleOutput : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetOutputSize( - /* [in] */ const SIZE OutSize, - /* [in] */ BOOL bMaintainAspect) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTScaleOutputVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTScaleOutput * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTScaleOutput * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTScaleOutput * This); - - HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( - IDXTScaleOutput * This, - /* [in] */ const SIZE OutSize, - /* [in] */ BOOL bMaintainAspect); - - END_INTERFACE - } IDXTScaleOutputVtbl; - - interface IDXTScaleOutput - { - CONST_VTBL struct IDXTScaleOutputVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTScaleOutput_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTScaleOutput_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTScaleOutput_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTScaleOutput_SetOutputSize(This,OutSize,bMaintainAspect) \ - (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTScaleOutput_SetOutputSize_Proxy( - IDXTScaleOutput * This, - /* [in] */ const SIZE OutSize, - /* [in] */ BOOL bMaintainAspect); - - -void __RPC_STUB IDXTScaleOutput_SetOutputSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTScaleOutput_INTERFACE_DEFINED__ */ - - -#ifndef __IDXGradient_INTERFACE_DEFINED__ -#define __IDXGradient_INTERFACE_DEFINED__ - -/* interface IDXGradient */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXGradient; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B2024B51-EE77-11d1-9066-00C04FD9189D") - IDXGradient : public IDXTScaleOutput - { - public: - virtual HRESULT STDMETHODCALLTYPE SetGradient( - DXSAMPLE StartColor, - DXSAMPLE EndColor, - BOOL bHorizontal) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputSize( - /* [out] */ SIZE *pOutSize) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXGradientVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXGradient * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXGradient * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXGradient * This); - - HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( - IDXGradient * This, - /* [in] */ const SIZE OutSize, - /* [in] */ BOOL bMaintainAspect); - - HRESULT ( STDMETHODCALLTYPE *SetGradient )( - IDXGradient * This, - DXSAMPLE StartColor, - DXSAMPLE EndColor, - BOOL bHorizontal); - - HRESULT ( STDMETHODCALLTYPE *GetOutputSize )( - IDXGradient * This, - /* [out] */ SIZE *pOutSize); - - END_INTERFACE - } IDXGradientVtbl; - - interface IDXGradient - { - CONST_VTBL struct IDXGradientVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXGradient_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXGradient_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXGradient_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXGradient_SetOutputSize(This,OutSize,bMaintainAspect) \ - (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) - - -#define IDXGradient_SetGradient(This,StartColor,EndColor,bHorizontal) \ - (This)->lpVtbl -> SetGradient(This,StartColor,EndColor,bHorizontal) - -#define IDXGradient_GetOutputSize(This,pOutSize) \ - (This)->lpVtbl -> GetOutputSize(This,pOutSize) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXGradient_SetGradient_Proxy( - IDXGradient * This, - DXSAMPLE StartColor, - DXSAMPLE EndColor, - BOOL bHorizontal); - - -void __RPC_STUB IDXGradient_SetGradient_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXGradient_GetOutputSize_Proxy( - IDXGradient * This, - /* [out] */ SIZE *pOutSize); - - -void __RPC_STUB IDXGradient_GetOutputSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXGradient_INTERFACE_DEFINED__ */ - - -#ifndef __IDXTScale_INTERFACE_DEFINED__ -#define __IDXTScale_INTERFACE_DEFINED__ - -/* interface IDXTScale */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXTScale; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B39FD742-E139-11d1-9065-00C04FD9189D") - IDXTScale : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetScales( - /* [in] */ float Scales[ 2 ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetScales( - /* [out] */ float Scales[ 2 ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE ScaleFitToSize( - /* [out][in] */ DXBNDS *pClipBounds, - /* [in] */ SIZE FitToSize, - /* [in] */ BOOL bMaintainAspect) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXTScaleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXTScale * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXTScale * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXTScale * This); - - HRESULT ( STDMETHODCALLTYPE *SetScales )( - IDXTScale * This, - /* [in] */ float Scales[ 2 ]); - - HRESULT ( STDMETHODCALLTYPE *GetScales )( - IDXTScale * This, - /* [out] */ float Scales[ 2 ]); - - HRESULT ( STDMETHODCALLTYPE *ScaleFitToSize )( - IDXTScale * This, - /* [out][in] */ DXBNDS *pClipBounds, - /* [in] */ SIZE FitToSize, - /* [in] */ BOOL bMaintainAspect); - - END_INTERFACE - } IDXTScaleVtbl; - - interface IDXTScale - { - CONST_VTBL struct IDXTScaleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXTScale_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXTScale_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXTScale_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXTScale_SetScales(This,Scales) \ - (This)->lpVtbl -> SetScales(This,Scales) - -#define IDXTScale_GetScales(This,Scales) \ - (This)->lpVtbl -> GetScales(This,Scales) - -#define IDXTScale_ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) \ - (This)->lpVtbl -> ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXTScale_SetScales_Proxy( - IDXTScale * This, - /* [in] */ float Scales[ 2 ]); - - -void __RPC_STUB IDXTScale_SetScales_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTScale_GetScales_Proxy( - IDXTScale * This, - /* [out] */ float Scales[ 2 ]); - - -void __RPC_STUB IDXTScale_GetScales_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXTScale_ScaleFitToSize_Proxy( - IDXTScale * This, - /* [out][in] */ DXBNDS *pClipBounds, - /* [in] */ SIZE FitToSize, - /* [in] */ BOOL bMaintainAspect); - - -void __RPC_STUB IDXTScale_ScaleFitToSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXTScale_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0275 */ -/* [local] */ - -typedef -enum DISPIDDXEFFECT - { DISPID_DXECAPABILITIES = 10000, - DISPID_DXEPROGRESS = DISPID_DXECAPABILITIES + 1, - DISPID_DXESTEP = DISPID_DXEPROGRESS + 1, - DISPID_DXEDURATION = DISPID_DXESTEP + 1, - DISPID_DXE_NEXT_ID = DISPID_DXEDURATION + 1 - } DISPIDDXBOUNDEDEFFECT; - -typedef -enum DXEFFECTTYPE - { DXTET_PERIODIC = 1 << 0, - DXTET_MORPH = 1 << 1 - } DXEFFECTTYPE; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0275_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0275_v0_0_s_ifspec; - -#ifndef __IDXEffect_INTERFACE_DEFINED__ -#define __IDXEffect_INTERFACE_DEFINED__ - -/* interface IDXEffect */ -/* [dual][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXEffect; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E31FB81B-1335-11d1-8189-0000F87557DB") - IDXEffect : public IDispatch - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Capabilities( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Progress( - /* [retval][out] */ float *pVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Progress( - /* [in] */ float newVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_StepResolution( - /* [retval][out] */ float *pVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( - /* [retval][out] */ float *pVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( - /* [in] */ float newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXEffectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXEffect * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXEffect * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXEffect * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDXEffect * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDXEffect * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDXEffect * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDXEffect * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDXEffect * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDXEffect * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDXEffect * This, - /* [in] */ float newVal); - - END_INTERFACE - } IDXEffectVtbl; - - interface IDXEffect - { - CONST_VTBL struct IDXEffectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXEffect_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXEffect_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXEffect_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXEffect_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDXEffect_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDXEffect_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDXEffect_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDXEffect_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - -#define IDXEffect_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - -#define IDXEffect_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - -#define IDXEffect_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - -#define IDXEffect_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define IDXEffect_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Capabilities_Proxy( - IDXEffect * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDXEffect_get_Capabilities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Progress_Proxy( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - -void __RPC_STUB IDXEffect_get_Progress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Progress_Proxy( - IDXEffect * This, - /* [in] */ float newVal); - - -void __RPC_STUB IDXEffect_put_Progress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_StepResolution_Proxy( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - -void __RPC_STUB IDXEffect_get_StepResolution_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Duration_Proxy( - IDXEffect * This, - /* [retval][out] */ float *pVal); - - -void __RPC_STUB IDXEffect_get_Duration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Duration_Proxy( - IDXEffect * This, - /* [in] */ float newVal); - - -void __RPC_STUB IDXEffect_put_Duration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXEffect_INTERFACE_DEFINED__ */ - - -#ifndef __IDXLookupTable_INTERFACE_DEFINED__ -#define __IDXLookupTable_INTERFACE_DEFINED__ - -/* interface IDXLookupTable */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXLookupTable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("01BAFC7F-9E63-11d1-9053-00C04FD9189D") - IDXLookupTable : public IDXBaseObject - { - public: - virtual HRESULT STDMETHODCALLTYPE GetTables( - /* [out] */ BYTE RedLUT[ 256 ], - /* [out] */ BYTE GreenLUT[ 256 ], - /* [out] */ BYTE BlueLUT[ 256 ], - /* [out] */ BYTE AlphaLUT[ 256 ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsChannelIdentity( - /* [out] */ DXBASESAMPLE *pSampleBools) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIndexValues( - /* [in] */ ULONG Index, - /* [out] */ DXBASESAMPLE *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyTables( - /* [out][in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXLookupTableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXLookupTable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXLookupTable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXLookupTable * This); - - HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( - IDXLookupTable * This, - /* [out] */ ULONG *pID); - - HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( - IDXLookupTable * This, - /* [in] */ BOOL bRefresh); - - HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( - IDXLookupTable * This, - /* [out] */ ULONG *pcbSize); - - HRESULT ( STDMETHODCALLTYPE *GetTables )( - IDXLookupTable * This, - /* [out] */ BYTE RedLUT[ 256 ], - /* [out] */ BYTE GreenLUT[ 256 ], - /* [out] */ BYTE BlueLUT[ 256 ], - /* [out] */ BYTE AlphaLUT[ 256 ]); - - HRESULT ( STDMETHODCALLTYPE *IsChannelIdentity )( - IDXLookupTable * This, - /* [out] */ DXBASESAMPLE *pSampleBools); - - HRESULT ( STDMETHODCALLTYPE *GetIndexValues )( - IDXLookupTable * This, - /* [in] */ ULONG Index, - /* [out] */ DXBASESAMPLE *pSample); - - HRESULT ( STDMETHODCALLTYPE *ApplyTables )( - IDXLookupTable * This, - /* [out][in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - END_INTERFACE - } IDXLookupTableVtbl; - - interface IDXLookupTable - { - CONST_VTBL struct IDXLookupTableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXLookupTable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXLookupTable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXLookupTable_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXLookupTable_GetGenerationId(This,pID) \ - (This)->lpVtbl -> GetGenerationId(This,pID) - -#define IDXLookupTable_IncrementGenerationId(This,bRefresh) \ - (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) - -#define IDXLookupTable_GetObjectSize(This,pcbSize) \ - (This)->lpVtbl -> GetObjectSize(This,pcbSize) - - -#define IDXLookupTable_GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) \ - (This)->lpVtbl -> GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) - -#define IDXLookupTable_IsChannelIdentity(This,pSampleBools) \ - (This)->lpVtbl -> IsChannelIdentity(This,pSampleBools) - -#define IDXLookupTable_GetIndexValues(This,Index,pSample) \ - (This)->lpVtbl -> GetIndexValues(This,Index,pSample) - -#define IDXLookupTable_ApplyTables(This,pSamples,cSamples) \ - (This)->lpVtbl -> ApplyTables(This,pSamples,cSamples) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXLookupTable_GetTables_Proxy( - IDXLookupTable * This, - /* [out] */ BYTE RedLUT[ 256 ], - /* [out] */ BYTE GreenLUT[ 256 ], - /* [out] */ BYTE BlueLUT[ 256 ], - /* [out] */ BYTE AlphaLUT[ 256 ]); - - -void __RPC_STUB IDXLookupTable_GetTables_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXLookupTable_IsChannelIdentity_Proxy( - IDXLookupTable * This, - /* [out] */ DXBASESAMPLE *pSampleBools); - - -void __RPC_STUB IDXLookupTable_IsChannelIdentity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXLookupTable_GetIndexValues_Proxy( - IDXLookupTable * This, - /* [in] */ ULONG Index, - /* [out] */ DXBASESAMPLE *pSample); - - -void __RPC_STUB IDXLookupTable_GetIndexValues_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDXLookupTable_ApplyTables_Proxy( - IDXLookupTable * This, - /* [out][in] */ DXSAMPLE *pSamples, - /* [in] */ ULONG cSamples); - - -void __RPC_STUB IDXLookupTable_ApplyTables_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXLookupTable_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0277 */ -/* [local] */ - -typedef struct DXRAWSURFACEINFO - { - BYTE *pFirstByte; - long lPitch; - ULONG Width; - ULONG Height; - const GUID *pPixelFormat; - HDC hdc; - DWORD dwColorKey; - DXBASESAMPLE *pPalette; - } DXRAWSURFACEINFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0277_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0277_v0_0_s_ifspec; - -#ifndef __IDXRawSurface_INTERFACE_DEFINED__ -#define __IDXRawSurface_INTERFACE_DEFINED__ - -/* interface IDXRawSurface */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDXRawSurface; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("09756C8A-D96A-11d1-9062-00C04FD9189D") - IDXRawSurface : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetSurfaceInfo( - DXRAWSURFACEINFO *pSurfaceInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDXRawSurfaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDXRawSurface * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDXRawSurface * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDXRawSurface * This); - - HRESULT ( STDMETHODCALLTYPE *GetSurfaceInfo )( - IDXRawSurface * This, - DXRAWSURFACEINFO *pSurfaceInfo); - - END_INTERFACE - } IDXRawSurfaceVtbl; - - interface IDXRawSurface - { - CONST_VTBL struct IDXRawSurfaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDXRawSurface_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDXRawSurface_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDXRawSurface_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDXRawSurface_GetSurfaceInfo(This,pSurfaceInfo) \ - (This)->lpVtbl -> GetSurfaceInfo(This,pSurfaceInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDXRawSurface_GetSurfaceInfo_Proxy( - IDXRawSurface * This, - DXRAWSURFACEINFO *pSurfaceInfo); - - -void __RPC_STUB IDXRawSurface_GetSurfaceInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDXRawSurface_INTERFACE_DEFINED__ */ - - -#ifndef __IHTMLDXTransform_INTERFACE_DEFINED__ -#define __IHTMLDXTransform_INTERFACE_DEFINED__ - -/* interface IHTMLDXTransform */ -/* [local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IHTMLDXTransform; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5") - IHTMLDXTransform : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetHostUrl( - BSTR bstrHostUrl) = 0; - - }; - -#else /* C style interface */ - - typedef struct IHTMLDXTransformVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IHTMLDXTransform * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IHTMLDXTransform * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IHTMLDXTransform * This); - - HRESULT ( STDMETHODCALLTYPE *SetHostUrl )( - IHTMLDXTransform * This, - BSTR bstrHostUrl); - - END_INTERFACE - } IHTMLDXTransformVtbl; - - interface IHTMLDXTransform - { - CONST_VTBL struct IHTMLDXTransformVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IHTMLDXTransform_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IHTMLDXTransform_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IHTMLDXTransform_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IHTMLDXTransform_SetHostUrl(This,bstrHostUrl) \ - (This)->lpVtbl -> SetHostUrl(This,bstrHostUrl) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IHTMLDXTransform_SetHostUrl_Proxy( - IHTMLDXTransform * This, - BSTR bstrHostUrl); - - -void __RPC_STUB IHTMLDXTransform_SetHostUrl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IHTMLDXTransform_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_dxtrans_0279 */ -/* [local] */ - -typedef -enum DXTFILTER_STATUS - { DXTFILTER_STATUS_Stopped = 0, - DXTFILTER_STATUS_Applied = DXTFILTER_STATUS_Stopped + 1, - DXTFILTER_STATUS_Playing = DXTFILTER_STATUS_Applied + 1, - DXTFILTER_STATUS_MAX = DXTFILTER_STATUS_Playing + 1 - } DXTFILTER_STATUS; - -typedef -enum DXTFILTER_DISPID - { DISPID_DXTFilter_Percent = 1, - DISPID_DXTFilter_Duration = DISPID_DXTFilter_Percent + 1, - DISPID_DXTFilter_Enabled = DISPID_DXTFilter_Duration + 1, - DISPID_DXTFilter_Status = DISPID_DXTFilter_Enabled + 1, - DISPID_DXTFilter_Apply = DISPID_DXTFilter_Status + 1, - DISPID_DXTFilter_Play = DISPID_DXTFilter_Apply + 1, - DISPID_DXTFilter_Stop = DISPID_DXTFilter_Play + 1, - DISPID_DXTFilter_MAX = DISPID_DXTFilter_Stop + 1 - } DXTFILTER_DISPID; - - - -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0279_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0279_v0_0_s_ifspec; - -#ifndef __ICSSFilterDispatch_INTERFACE_DEFINED__ -#define __ICSSFilterDispatch_INTERFACE_DEFINED__ - -/* interface ICSSFilterDispatch */ -/* [dual][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ICSSFilterDispatch; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9519152B-9484-4A6C-B6A7-4F25E92D6C6B") - ICSSFilterDispatch : public IDispatch - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Percent( - /* [retval][out] */ float *pVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Percent( - /* [in] */ float newVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( - /* [retval][out] */ float *pVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( - /* [in] */ float newVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Enabled( - /* [retval][out] */ VARIANT_BOOL *pfVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Enabled( - /* [in] */ VARIANT_BOOL fVal) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Status( - /* [retval][out] */ DXTFILTER_STATUS *peVal) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE Apply( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE Play( - /* [optional][in] */ VARIANT varDuration) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICSSFilterDispatchVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICSSFilterDispatch * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICSSFilterDispatch * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICSSFilterDispatch * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ICSSFilterDispatch * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ICSSFilterDispatch * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ICSSFilterDispatch * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ICSSFilterDispatch * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Percent )( - ICSSFilterDispatch * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Percent )( - ICSSFilterDispatch * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - ICSSFilterDispatch * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - ICSSFilterDispatch * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Enabled )( - ICSSFilterDispatch * This, - /* [retval][out] */ VARIANT_BOOL *pfVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Enabled )( - ICSSFilterDispatch * This, - /* [in] */ VARIANT_BOOL fVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( - ICSSFilterDispatch * This, - /* [retval][out] */ DXTFILTER_STATUS *peVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Apply )( - ICSSFilterDispatch * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Play )( - ICSSFilterDispatch * This, - /* [optional][in] */ VARIANT varDuration); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Stop )( - ICSSFilterDispatch * This); - - END_INTERFACE - } ICSSFilterDispatchVtbl; - - interface ICSSFilterDispatch - { - CONST_VTBL struct ICSSFilterDispatchVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICSSFilterDispatch_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ICSSFilterDispatch_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ICSSFilterDispatch_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ICSSFilterDispatch_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ICSSFilterDispatch_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ICSSFilterDispatch_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ICSSFilterDispatch_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ICSSFilterDispatch_get_Percent(This,pVal) \ - (This)->lpVtbl -> get_Percent(This,pVal) - -#define ICSSFilterDispatch_put_Percent(This,newVal) \ - (This)->lpVtbl -> put_Percent(This,newVal) - -#define ICSSFilterDispatch_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define ICSSFilterDispatch_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - -#define ICSSFilterDispatch_get_Enabled(This,pfVal) \ - (This)->lpVtbl -> get_Enabled(This,pfVal) - -#define ICSSFilterDispatch_put_Enabled(This,fVal) \ - (This)->lpVtbl -> put_Enabled(This,fVal) - -#define ICSSFilterDispatch_get_Status(This,peVal) \ - (This)->lpVtbl -> get_Status(This,peVal) - -#define ICSSFilterDispatch_Apply(This) \ - (This)->lpVtbl -> Apply(This) - -#define ICSSFilterDispatch_Play(This,varDuration) \ - (This)->lpVtbl -> Play(This,varDuration) - -#define ICSSFilterDispatch_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Percent_Proxy( - ICSSFilterDispatch * This, - /* [retval][out] */ float *pVal); - - -void __RPC_STUB ICSSFilterDispatch_get_Percent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Percent_Proxy( - ICSSFilterDispatch * This, - /* [in] */ float newVal); - - -void __RPC_STUB ICSSFilterDispatch_put_Percent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Duration_Proxy( - ICSSFilterDispatch * This, - /* [retval][out] */ float *pVal); - - -void __RPC_STUB ICSSFilterDispatch_get_Duration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Duration_Proxy( - ICSSFilterDispatch * This, - /* [in] */ float newVal); - - -void __RPC_STUB ICSSFilterDispatch_put_Duration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Enabled_Proxy( - ICSSFilterDispatch * This, - /* [retval][out] */ VARIANT_BOOL *pfVal); - - -void __RPC_STUB ICSSFilterDispatch_get_Enabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Enabled_Proxy( - ICSSFilterDispatch * This, - /* [in] */ VARIANT_BOOL fVal); - - -void __RPC_STUB ICSSFilterDispatch_put_Enabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Status_Proxy( - ICSSFilterDispatch * This, - /* [retval][out] */ DXTFILTER_STATUS *peVal); - - -void __RPC_STUB ICSSFilterDispatch_get_Status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Apply_Proxy( - ICSSFilterDispatch * This); - - -void __RPC_STUB ICSSFilterDispatch_Apply_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Play_Proxy( - ICSSFilterDispatch * This, - /* [optional][in] */ VARIANT varDuration); - - -void __RPC_STUB ICSSFilterDispatch_Play_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Stop_Proxy( - ICSSFilterDispatch * This); - - -void __RPC_STUB ICSSFilterDispatch_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ICSSFilterDispatch_INTERFACE_DEFINED__ */ - - - -#ifndef __DXTRANSLib_LIBRARY_DEFINED__ -#define __DXTRANSLib_LIBRARY_DEFINED__ - -/* library DXTRANSLib */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_DXTRANSLib; - -EXTERN_C const CLSID CLSID_DXTransformFactory; - -#ifdef __cplusplus - -class DECLSPEC_UUID("D1FE6762-FC48-11D0-883A-3C8B00C10000") -DXTransformFactory; -#endif - -EXTERN_C const CLSID CLSID_DXTaskManager; - -#ifdef __cplusplus - -class DECLSPEC_UUID("4CB26C03-FF93-11d0-817E-0000F87557DB") -DXTaskManager; -#endif - -EXTERN_C const CLSID CLSID_DXTScale; - -#ifdef __cplusplus - -class DECLSPEC_UUID("555278E2-05DB-11D1-883A-3C8B00C10000") -DXTScale; -#endif - -EXTERN_C const CLSID CLSID_DXSurface; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0E890F83-5F79-11D1-9043-00C04FD9189D") -DXSurface; -#endif - -EXTERN_C const CLSID CLSID_DXSurfaceModifier; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3E669F1D-9C23-11d1-9053-00C04FD9189D") -DXSurfaceModifier; -#endif - -EXTERN_C const CLSID CLSID_DXGradient; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C6365470-F667-11d1-9067-00C04FD9189D") -DXGradient; -#endif - -EXTERN_C const CLSID CLSID_DXTFilter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD") -DXTFilter; -#endif -#endif /* __DXTRANSLib_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/dxva.h b/import/DirectX8/include/dxva.h deleted file mode 100644 index 17f0d826b..000000000 --- a/import/DirectX8/include/dxva.h +++ /dev/null @@ -1,628 +0,0 @@ -//------------------------------------------------------------------------------ -// File: DXVA.h -// -// Desc: DirectX Video Acceleration header file. -// -// Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __DIRECTX_VA__ -#define __DIRECTX_VA__ - -#ifdef __cplusplus -extern "C" { -#endif - -DEFINE_GUID(DXVA_ModeNone, 0x1b81be00, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH261_A, 0x1b81be01, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH261_B, 0x1b81be02, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_A, 0x1b81be03, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_B, 0x1b81be04, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_C, 0x1b81be05, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_D, 0x1b81be06, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_E, 0x1b81be07, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeH263_F, 0x1b81be08, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeMPEG1_A, 0x1b81be09, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeMPEG2_A, 0x1b81be0A, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeMPEG2_B, 0x1b81be0B, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeMPEG2_C, 0x1b81be0C, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVA_ModeMPEG2_D, 0x1b81be0D, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); - -DEFINE_GUID(DXVA_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); - -#define DXVA_RESTRICTED_MODE_UNRESTRICTED 0xFFFF -#define DXVA_RESTRICTED_MODE_H261_A 1 -#define DXVA_RESTRICTED_MODE_H261_B 2 -#define DXVA_RESTRICTED_MODE_H263_A 3 -#define DXVA_RESTRICTED_MODE_H263_B 4 -#define DXVA_RESTRICTED_MODE_H263_C 5 -#define DXVA_RESTRICTED_MODE_H263_D 6 -#define DXVA_RESTRICTED_MODE_H263_E 7 -#define DXVA_RESTRICTED_MODE_H263_F 8 -#define DXVA_RESTRICTED_MODE_MPEG1_A 9 -#define DXVA_RESTRICTED_MODE_MPEG2_A 0xA -#define DXVA_RESTRICTED_MODE_MPEG2_B 0xB -#define DXVA_RESTRICTED_MODE_MPEG2_C 0xC -#define DXVA_RESTRICTED_MODE_MPEG2_D 0xD - -#define DXVA_COMPBUFFER_TYPE_THAT_IS_NOT_USED 0 -#define DXVA_PICTURE_DECODE_BUFFER 1 -#define DXVA_MACROBLOCK_CONTROL_BUFFER 2 -#define DXVA_RESIDUAL_DIFFERENCE_BUFFER 3 -#define DXVA_DEBLOCKING_CONTROL_BUFFER 4 -#define DXVA_INVERSE_QUANTIZATION_MATRIX_BUFFER 5 -#define DXVA_SLICE_CONTROL_BUFFER 6 -#define DXVA_BITSTREAM_DATA_BUFFER 7 -#define DXVA_AYUV_BUFFER 8 -#define DXVA_IA44_SURFACE_BUFFER 9 -#define DXVA_DPXD_SURFACE_BUFFER 10 -#define DXVA_HIGHLIGHT_BUFFER 11 -#define DXVA_DCCMD_SURFACE_BUFFER 12 -#define DXVA_ALPHA_BLEND_COMBINATION_BUFFER 13 -#define DXVA_PICTURE_RESAMPLE_BUFFER 14 -#define DXVA_READ_BACK_BUFFER 15 - -#define DXVA_NUM_TYPES_COMP_BUFFERS 16 - -/* values for bDXVA_Func */ -#define DXVA_PICTURE_DECODING_FUNCTION 1 -#define DXVA_ALPHA_BLEND_DATA_LOAD_FUNCTION 2 -#define DXVA_ALPHA_BLEND_COMBINATION_FUNCTION 3 -#define DXVA_PICTURE_RESAMPLE_FUNCTION 4 - -/* values returned from Execute command in absence of read-back */ -#define DXVA_EXECUTE_RETURN_OK 0 -#define DXVA_EXECUTE_RETURN_DATA_ERROR_MINOR 1 -#define DXVA_EXECUTE_RETURN_DATA_ERROR_SIGNIF 2 -#define DXVA_EXECUTE_RETURN_DATA_ERROR_SEVERE 3 -#define DXVA_EXECUTE_RETURN_OTHER_ERROR_SEVERE 4 - - -#pragma pack(push, BeforeDXVApacking, 1) - - -typedef struct _DXVA_ConnectMode { - GUID guidMode; - WORD wRestrictedMode; -} DXVA_ConnectMode, *LPDXVA_ConnectMode; - - -typedef DWORD DXVA_ConfigQueryOrReplyFunc, *LPDXVA_ConfigQueryOrReplyFunc; - -#define DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY 0xFFFFF1 -#define DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY 0xFFFFF5 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_COPY 0xFFFFF8 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_PLUS 0xFFFFF9 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_OK_COPY 0xFFFFFC -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_FALSE_PLUS 0xFFFFFB -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_FALSE_PLUS 0xFFFFFF - -#define readDXVA_QueryOrReplyFuncFlag(ptr) ((*(ptr)) >> 8) - -#define readDXVA_QueryOrReplyFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1) -#define readDXVA_QueryOrReplyFuncFlag_LOCK(ptr) (((*(ptr)) >> 10) & 1) -#define readDXVA_QueryOrReplyFuncFlag_BAD(ptr) (((*(ptr)) >> 9) & 1) -#define readDXVA_QueryOrReplyFuncFlag_PLUS(ptr) (((*(ptr)) >> 8) & 1) - -#define readDXVA_QueryOrReplyFuncFunc(ptr) ((*(ptr)) & 0xFF) - -#define writeDXVA_QueryOrReplyFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc)) - -#define setDXVA_QueryOrReplyFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8)) -#define setDXVA_QueryOrReplyFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc)); - -typedef DWORD DXVA_EncryptProtocolFunc, *LPDXVA_EncryptProtocolFunc; - -#define DXVA_ENCRYPTPROTOCOLFUNCFLAG_HOST 0xFFFF00 -#define DXVA_ENCRYPTPROTOCOLFUNCFLAG_ACCEL 0xFFFF08 - -#define readDXVA_EncryptProtocolFuncFlag(ptr) ((*(ptr)) >> 8) -#define readDXVA_EncryptProtocolFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1) - -#define readDXVA_EncryptProtocolFuncFunc(ptr) ((*(ptr)) & 0xFF) - -#define writeDXVA_EncryptProtocolFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc)) - -#define setDXVA_EncryptProtocolFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8)) -#define setDXVA_EncryptProtocolFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc)); - -typedef struct _DXVA_EncryptProtocolHeader { - DXVA_EncryptProtocolFunc dwFunction; - DWORD ReservedBits[3]; - GUID guidEncryptProtocol; -} DXVA_EncryptProtocolHeader, *LPDXVA_EncryptProtocolHeader; - -typedef struct _DXVA_ConfigPictureDecode { - - // Operation Indicated - DXVA_ConfigQueryOrReplyFunc dwFunction; - - // Alignment - DWORD dwReservedBits[3]; - - // Encryption GUIDs - GUID guidConfigBitstreamEncryption; - GUID guidConfigMBcontrolEncryption; - GUID guidConfigResidDiffEncryption; - - // Bitstream Processing Indicator - BYTE bConfigBitstreamRaw; - - // Macroblock Control Config - BYTE bConfigMBcontrolRasterOrder; - - // Host Resid Diff Config - BYTE bConfigResidDiffHost; - BYTE bConfigSpatialResid8; - BYTE bConfigResid8Subtraction; - BYTE bConfigSpatialHost8or9Clipping; - BYTE bConfigSpatialResidInterleaved; - BYTE bConfigIntraResidUnsigned; - - // Accelerator Resid Diff Config - BYTE bConfigResidDiffAccelerator; - BYTE bConfigHostInverseScan; - BYTE bConfigSpecificIDCT; - BYTE bConfig4GroupedCoefs; -} DXVA_ConfigPictureDecode, *LPDXVA_ConfigPictureDecode; - - -/* Picture Decoding Parameters */ - -typedef struct _DXVA_PictureParameters { - - WORD wDecodedPictureIndex; - WORD wDeblockedPictureIndex; - - WORD wForwardRefPictureIndex; - WORD wBackwardRefPictureIndex; - - WORD wPicWidthInMBminus1; - WORD wPicHeightInMBminus1; - - BYTE bMacroblockWidthMinus1; - BYTE bMacroblockHeightMinus1; - - BYTE bBlockWidthMinus1; - BYTE bBlockHeightMinus1; - - BYTE bBPPminus1; - - BYTE bPicStructure; - BYTE bSecondField; - BYTE bPicIntra; - BYTE bPicBackwardPrediction; - - BYTE bBidirectionalAveragingMode; - BYTE bMVprecisionAndChromaRelation; - BYTE bChromaFormat; - - BYTE bPicScanFixed; - BYTE bPicScanMethod; - BYTE bPicReadbackRequests; - - BYTE bRcontrol; - BYTE bPicSpatialResid8; - BYTE bPicOverflowBlocks; - BYTE bPicExtrapolation; - - BYTE bPicDeblocked; - BYTE bPicDeblockConfined; - BYTE bPic4MVallowed; - BYTE bPicOBMC; - BYTE bPicBinPB; - BYTE bMV_RPS; - - BYTE bReservedBits; - - WORD wBitstreamFcodes; - WORD wBitstreamPCEelements; - BYTE bBitstreamConcealmentNeed; - BYTE bBitstreamConcealmentMethod; - -} DXVA_PictureParameters, *LPDXVA_PictureParameters; - - -/* Picture Resampling */ - -typedef struct _DXVA_PicResample { - - WORD wPicResampleSourcePicIndex; - WORD wPicResampleDestPicIndex; - - WORD wPicResampleRcontrol; - BYTE bPicResampleExtrapWidth; - BYTE bPicResampleExtrapHeight; - - DWORD dwPicResampleSourceWidth; - DWORD dwPicResampleSourceHeight; - - DWORD dwPicResampleDestWidth; - DWORD dwPicResampleDestHeight; - - DWORD dwPicResampleFullDestWidth; - DWORD dwPicResampleFullDestHeight; - -} DXVA_PicResample, *LPDXVA_PicResample; - - -#define DXVA_CHROMA_FORMAT_420 1 -#define DXVA_CHROMA_FORMAT_422 2 -#define DXVA_CHROMA_FORMAT_444 3 - -#define DXVA_PICTURE_STRUCTURE_TOP_FIELD 1 -#define DXVA_PICTURE_STRUCTURE_BOTTOM_FIELD 2 -#define DXVA_PICTURE_STRUCTURE_FRAME 3 - -#define DXVA_BIDIRECTIONAL_AVERAGING_MPEG2_ROUND 0 -#define DXVA_BIDIRECTIONAL_AVERAGING_H263_TRUNC 1 - -#define DXVA_MV_PRECISION_AND_CHROMA_RELATION_MPEG2 0 -#define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H263 1 -#define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H261 2 - -#define DXVA_SCAN_METHOD_ZIG_ZAG 0 -#define DXVA_SCAN_METHOD_ALTERNATE_VERTICAL 1 -#define DXVA_SCAN_METHOD_ALTERNATE_HORIZONTAL 2 -#define DXVA_SCAN_METHOD_ARBITRARY 3 - -#define DXVA_BITSTREAM_CONCEALMENT_NEED_UNLIKELY 0 -#define DXVA_BITSTREAM_CONCEALMENT_NEED_MILD 1 -#define DXVA_BITSTREAM_CONCEALMENT_NEED_LIKELY 2 -#define DXVA_BITSTREAM_CONCEALMENT_NEED_SEVERE 3 - -#define DXVA_BITSTREAM_CONCEALMENT_METHOD_UNSPECIFIED 0 -#define DXVA_BITSTREAM_CONCEALMENT_METHOD_INTRA 1 -#define DXVA_BITSTREAM_CONCEALMENT_METHOD_FORWARD 2 -#define DXVA_BITSTREAM_CONCEALMENT_METHOD_BACKWARD 3 - - -/* Buffer Description Data */ - -typedef struct _DXVA_BufferDescription { - DWORD dwTypeIndex; - DWORD dwBufferIndex; - DWORD dwDataOffset; - DWORD dwDataSize; - DWORD dwFirstMBaddress; - DWORD dwNumMBsInBuffer; - DWORD dwWidth; - DWORD dwHeight; - DWORD dwStride; - DWORD dwReservedBits; -} DXVA_BufferDescription, *LPDXVA_BufferDescription; - - -/* Off-Host IDCT Coefficient Data Structures */ - -typedef struct _DXVA_TCoef4Group { - BYTE TCoefIDX[4]; - SHORT TCoefValue[4]; -} DXVA_TCoef4Group, *LPDXVA_TCoef4Group; - -typedef struct _DXVA_TCoefSingle { - WORD wIndexWithEOB; - SHORT TCoefValue; -} DXVA_TCoefSingle, *LPDXVA_TCoefSingle; - -/* Macros for Reading EOB and Index Values */ - -#define readDXVA_TCoefSingleIDX(ptr) ((ptr)->wIndexWithEOB >> 1) -#define readDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB & 1) - -/* Macro for Writing EOB and Index Values */ - -#define writeDXVA_TCoefSingleIndexWithEOB(ptr, idx, eob) ((ptr)->wIndexWithEOB = ((idx) << 1) | (eob)) -#define setDXVA_TCoefSingleIDX(ptr, idx) ((ptr)->wIndexWithEOB |= ((idx) << 1)) -#define setDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB |= 1) - -/* Spatial-Domain Residual Difference Blocks */ - -#define DXVA_USUAL_BLOCK_WIDTH 8 -#define DXVA_USUAL_BLOCK_HEIGHT 8 -#define DXVA_USUAL_BLOCK_SIZE (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT) - -typedef SHORT DXVA_Sample16[DXVA_USUAL_BLOCK_SIZE]; -typedef signed char DXVA_Sample8 [DXVA_USUAL_BLOCK_SIZE]; - -/* Deblocking Filter Control Structure */ - -typedef BYTE DXVA_DeblockingEdgeControl; - -typedef DXVA_DeblockingEdgeControl * LPDXVA_DeblockingEdgeControl; - -/* Macros for Reading STRENGTH and FilterOn */ - -#define readDXVA_EdgeFilterStrength(ptr) ((*(ptr)) >> 1) -#define readDXVA_EdgeFilterOn(ptr) ((*(ptr)) & 1) - -/* Macro for Writing STRENGTH and FilterOn */ - -#define writeDXVA_DeblockingEdgeControl(ptr, str, fon) ((*(ptr)) = ((str) << 1) | (fon)) -#define setDXVA_EdgeFilterStrength(ptr, str) ((*(ptr)) |= ((str) << 1)) -#define setDXVA_EdgeFilterOn(ptr) ((*(ptr)) |= 1) - - -/* Macroblock Control Command Data Structures */ - -typedef struct _DXVA_MVvalue { - SHORT horz, vert; -} DXVA_MVvalue, *LPDXVA_MVvalue; - - -/* Inverse Quantization Matrices */ - -typedef struct _DXVA_QmatrixData { - BYTE bNewQmatrix[4]; /* intra Y, inter Y, intra chroma, inter chroma */ - WORD Qmatrix[4][DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT]; -} DXVA_QmatrixData, *LPDXVA_QmatrixData; - - -/* Slice Control Buffer Data */ - -typedef struct _DXVA_SliceInfo { - WORD wHorizontalPosition; - WORD wVerticalPosition; - DWORD dwSliceBitsInBuffer; - DWORD dwSliceDataLocation; - BYTE bStartCodeBitOffset; - BYTE bReservedBits; - WORD wMBbitOffset; - WORD wNumberMBsInSlice; - WORD wQuantizerScaleCode; - WORD wBadSliceChopping; -} DXVA_SliceInfo, *LPDXVA_SliceInfo; - - -#define DXVA_NumMV_OBMC_off_BinPBwith4MV_off 4 -#define DXVA_NumMV_OBMC_off_BinPBwith4MV_on (4+1) -#define DXVA_NumMV_OBMC_on__BinPB_off (10) -#define DXVA_NumMV_OBMC_on__BinPB_on (11) /* not current standards */ - -#define DXVA_NumBlocksPerMB_420 (4+2+0) -#define DXVA_NumBlocksPerMB_422 (4+2+2) -#define DXVA_NumBlocksPerMB_444 (4+4+4) - -/* Basic form for I pictures */ -/* Host Residual Differences */ -typedef struct _DXVA_MBctrl_I_HostResidDiff_1 { - WORD wMBaddress; - WORD wMBtype; - DWORD dwMB_SNL; - WORD wPatternCode; - WORD wPC_Overflow; /* zero if not overflow format */ - DWORD dwReservedBits2; -} DXVA_MBctrl_I_HostResidDiff_1; - -/* Basic form for I pictures */ -/* Off-Host IDCT, 4:2:0 sampling */ -typedef struct _DXVA_MBctrl_I_OffHostIDCT_1 { - WORD wMBaddress; - WORD wMBtype; - DWORD dwMB_SNL; - WORD wPatternCode; - BYTE bNumCoef[DXVA_NumBlocksPerMB_420]; -} DXVA_MBctrl_I_OffHostIDCT_1; - -/* Basic form for P and B pictures */ -/* Should also be used for concealment MVs in MPEG-2 I pictures */ -/* Without OBMC, without BinPB and 4MV together, without MV RPS */ -/* Host Residual Differences */ -typedef struct _DXVA_MBctrl_P_HostResidDiff_1 { - WORD wMBaddress; - WORD wMBtype; - DWORD dwMB_SNL; - WORD wPatternCode; - WORD wPC_Overflow; /* zero if not overflow format */ - DWORD dwReservedBits2; - DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off]; -} DXVA_MBctrl_P_HostResidDiff_1; - -/* Basic form for P and B pictures */ -/* Without OBMC, without BinPB and 4MV together, without MV RPS */ -/* Off-Host IDCT, 4:2:0 sampling */ -typedef struct _DXVA_MBctrl_P_OffHostIDCT_1 { - WORD wMBaddress; - WORD wMBtype; - DWORD dwMB_SNL; - WORD wPatternCode; - BYTE bNumCoef[DXVA_NumBlocksPerMB_420]; - DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off]; -} DXVA_MBctrl_P_OffHostIDCT_1; - -/* How to load alpha blending graphic data */ -typedef struct _DXVA_ConfigAlphaLoad { - - // Operation Indicated - DXVA_ConfigQueryOrReplyFunc dwFunction; - - // Alignment - DWORD dwReservedBits[3]; - - BYTE bConfigDataType; -} DXVA_ConfigAlphaLoad, *LPDXVA_ConfigAlphaLoad; - -#define DXVA_CONFIG_DATA_TYPE_IA44 0 -#define DXVA_CONFIG_DATA_TYPE_AI44 1 -#define DXVA_CONFIG_DATA_TYPE_DPXD 2 -#define DXVA_CONFIG_DATA_TYPE_AYUV 3 - - -/* How to combine alpha blending graphic data */ -typedef struct _DXVA_ConfigAlphaCombine { - - // Operation Indicated - DXVA_ConfigQueryOrReplyFunc dwFunction; - - // Alignment - DWORD dwReservedBits[3]; - - BYTE bConfigBlendType; - BYTE bConfigPictureResizing; - BYTE bConfigOnlyUsePicDestRectArea; - BYTE bConfigGraphicResizing; - BYTE bConfigWholePlaneAlpha; - -} DXVA_ConfigAlphaCombine, *LPDXVA_ConfigAlphaCombine; - -#define DXVA_CONFIG_BLEND_TYPE_FRONT_BUFFER 0 -#define DXVA_CONFIG_BLEND_TYPE_BACK_HARDWARE 1 - - -/* AYUV sample for 16-entry YUV palette or graphic surface */ - -typedef struct _DXVA_AYUVsample2 { - BYTE bCrValue; - BYTE bCbValue; - BYTE bY_Value; - BYTE bSampleAlpha8; -} DXVA_AYUVsample2, *LPDXVA_AYUVsample2; - -/* Macros for IA44 alpha blending surface samples */ - -typedef BYTE DXVA_IA44sample, *LPDXVA_IA44sample; - -#define readDXVA_IA44index(ptr) (((*(ptr)) & 0xF0) >> 4) -#define readDXVA_IA44alpha(ptr) ((*(ptr)) & 0x0F) - -#define writeDXVA_IA44(ptr, idx, alpha) ((*(ptr)) = (((idx) << 4) | (alpha))) - -#define setDXVA_IA44index(ptr, idx) ((*(ptr)) |= ((idx) << 4)) -#define setDXVA_IA44alpha(ptr, alpha) ((*(ptr)) |= (alpha)) - -/* Macros for AI44 alpha blending surface samples */ - -typedef BYTE DXVA_AI44sample, *LPDXVA_AI44sample; - -#define readDXVA_AI44index(ptr) ((*(ptr)) & 0x0F) -#define readDXVA_AI44alpha(ptr) (((*(ptr)) & 0xF0) >> 4) - -#define writeDXVA_AI44(ptr, idx, alpha) ((*(ptr)) = (((alpha) << 4) | (idx))) - -#define setDXVA_AI44index(ptr, idx) ((*(ptr)) |= (idx)) -#define setDXVA_AI44alpha(ptr, alpha) ((*(ptr)) |= ((alpha) << 4)) - - -/* Highlight data structure */ - -typedef struct _DXVA_Highlight { - WORD wHighlightActive; - WORD wHighlightIndices; - WORD wHighlightAlphas; - RECT HighlightRect; -} DXVA_Highlight, *LPDXVA_Highlight; - -typedef BYTE DXVA_DPXD, *LPDXVA_DPXD; -typedef WORD DXVA_DCCMD, *LPDXVA_DCCMD; - -/* Alpha blend combination */ - -typedef struct _DXVA_BlendCombination { - WORD wPictureSourceIndex; - WORD wBlendedDestinationIndex; - RECT PictureSourceRect16thPel; - RECT PictureDestinationRect; - RECT GraphicSourceRect; - RECT GraphicDestinationRect; - WORD wBlendDelay; - BYTE bBlendOn; - BYTE bWholePlaneAlpha; - DXVA_AYUVsample2 OutsideYUVcolor; -} DXVA_BlendCombination, *LPDXVA_BlendCombination; - - -#pragma pack(push, 16) - - -typedef DXVA_MBctrl_I_HostResidDiff_1 * - LPDXVA_MBctrl_I_HostResidDiff_1; - -typedef DXVA_MBctrl_I_OffHostIDCT_1 * - LPDXVA_MBctrl_I_OffHostIDCT_1; - -typedef DXVA_MBctrl_P_HostResidDiff_1 * - LPDXVA_MBctrl_P_HostResidDiff_1; - -typedef DXVA_MBctrl_P_OffHostIDCT_1 * - LPDXVA_MBctrl_P_OffHostIDCT_1; - - -#pragma pack(pop) - -/* - * Other forms of pictures are constructed in the obvious way - * from the above by adjusting the number of residual difference - * blocks, the number of motion vectors per macroblock, etc. - */ - -#define readDXVA_MBskipsFollowing(ptr) (((ptr)->dwMB_SNL & 0xFF000000) >> 24) -#define readDXVA_MBdataLocation(ptr) (((ptr)->dwMB_SNL & 0x00FFFFFF)) - -#define writeDXVA_MB_SNL(ptr, skips, dloc) ((ptr)->dwMB_SNL = (((skips) << 24) | (dloc))) -#define setDXVA_MBskipsFollowing(ptr, skips) ((ptr)->dwMB_SNL |= ((skips) << 24)) -#define setDXVA_MBdataLocation(ptr, dloc) ((ptr)->dwMB_SNL |= (dloc)) - -#define readDXVA_MvertFieldSel_3(ptr) (((ptr)->wMBtype & 0x8000) >> 15) -#define readDXVA_MvertFieldSel_2(ptr) (((ptr)->wMBtype & 0x4000) >> 14) -#define readDXVA_MvertFieldSel_1(ptr) (((ptr)->wMBtype & 0x2000) >> 13) -#define readDXVA_MvertFieldSel_0(ptr) (((ptr)->wMBtype & 0x1000) >> 12) -#define readDXVA_ReservedBits(ptr) (((ptr)->wMBtype & 0x0800) >> 11) -#define readDXVA_HostResidDiff(ptr) (((ptr)->wMBtype & 0x0400) >> 10) -#define readDXVA_MotionType(ptr) (((ptr)->wMBtype & 0x0300) >> 8) -#define readDXVA_MBscanMethod(ptr) (((ptr)->wMBtype & 0x00C0) >> 6) -#define readDXVA_FieldResidual(ptr) (((ptr)->wMBtype & 0x0020) >> 5) -#define readDXVA_H261LoopFilter(ptr) (((ptr)->wMBtype & 0x0010) >> 4) -#define readDXVA_Motion4MV(ptr) (((ptr)->wMBtype & 0x0008) >> 3) -#define readDXVA_MotionBackward(ptr) (((ptr)->wMBtype & 0x0004) >> 2) -#define readDXVA_MotionForward(ptr) (((ptr)->wMBtype & 0x0002) >> 1) -#define readDXVA_IntraMacroblock(ptr) (((ptr)->wMBtype & 0x0001)) - -#define setDXVA_MvertFieldSel_3(ptr) ((ptr)->wMBtype |= 0x8000) -#define setDXVA_MvertFieldSel_2(ptr) ((ptr)->wMBtype |= 0x4000) -#define setDXVA_MvertFieldSel_1(ptr) ((ptr)->wMBtype |= 0x2000) -#define setDXVA_MvertFieldSel_0(ptr) ((ptr)->wMBtype |= 0x1000) -#define setDXVA_ReservedBits(ptr) ((ptr)->wMBtype |= 0x0800) -#define setDXVA_HostResidDiff(ptr) ((ptr)->wMBtype |= 0x0400) -#define setDXVA_MotionType(ptr, value) ((ptr)->wMBtype |= ((value) << 8)) -#define setDXVA_MBscanMethod(ptr, value) ((ptr)->wMBtype |= ((value) << 6)) -#define setDXVA_FieldResidual(ptr) ((ptr)->wMBtype |= 0x0020) -#define setDXVA_H261LoopFilter(ptr) ((ptr)->wMBtype |= 0x0010) -#define setDXVA_Motion4MV(ptr) ((ptr)->wMBtype |= 0x0008) -#define setDXVA_MotionBackward(ptr) ((ptr)->wMBtype |= 0x0004) -#define setDXVA_MotionForward(ptr) ((ptr)->wMBtype |= 0x0002) -#define setDXVA_IntraMacroblock(ptr) ((ptr)->wMBtype |= 0x0001) - -#define readDXVA_Y___0coded(ptr) (((ptr)->wPatternCode & 0x0800) >> 11) -#define readDXVA_Y___1coded(ptr) (((ptr)->wPatternCode & 0x0400) >> 10) -#define readDXVA_Y___2coded(ptr) (((ptr)->wPatternCode & 0x0200) >> 9) -#define readDXVA_Y___3coded(ptr) (((ptr)->wPatternCode & 0x0100) >> 8) -#define readDXVA_Cb__4coded(ptr) (((ptr)->wPatternCode & 0x0080) >> 7) -#define readDXVA_Cr__5coded(ptr) (((ptr)->wPatternCode & 0x0040) >> 6) -#define readDXVA_Cb__6coded(ptr) (((ptr)->wPatternCode & 0x0020) >> 5) -#define readDXVA_Cr__7coded(ptr) (((ptr)->wPatternCode & 0x0010) >> 4) -#define readDXVA_Cb__8coded(ptr) (((ptr)->wPatternCode & 0x0008) >> 3) -#define readDXVA_Cb__9coded(ptr) (((ptr)->wPatternCode & 0x0004) >> 2) -#define readDXVA_Cr_10coded(ptr) (((ptr)->wPatternCode & 0x0002) >> 1) -#define readDXVA_Cr_11coded(ptr) (((ptr)->wPatternCode & 0x0001)) - -#define readDXVA_Y___0oflow(ptr) (((ptr)->wPC_Overflow & 0x0800) >> 11) -#define readDXVA_Y___1oflow(ptr) (((ptr)->wPC_Overflow & 0x0400) >> 10) -#define readDXVA_Y___2oflow(ptr) (((ptr)->wPC_Overflow & 0x0200) >> 9) -#define readDXVA_Y___3oflow(ptr) (((ptr)->wPC_Overflow & 0x0100) >> 8) -#define readDXVA_Cb__4oflow(ptr) (((ptr)->wPC_Overflow & 0x0080) >> 7) -#define readDXVA_Cr__5oflow(ptr) (((ptr)->wPC_Overflow & 0x0040) >> 6) -#define readDXVA_Cb__6oflow(ptr) (((ptr)->wPC_Overflow & 0x0020) >> 5) -#define readDXVA_Cr__7oflow(ptr) (((ptr)->wPC_Overflow & 0x0010) >> 4) -#define readDXVA_Cb__8oflow(ptr) (((ptr)->wPC_Overflow & 0x0008) >> 3) -#define readDXVA_Cb__9oflow(ptr) (((ptr)->wPC_Overflow & 0x0004) >> 2) -#define readDXVA_Cr_10oflow(ptr) (((ptr)->wPC_Overflow & 0x0002) >> 1) -#define readDXVA_Cr_11oflow(ptr) (((ptr)->wPC_Overflow & 0x0001)) - -#pragma pack(pop, BeforeDXVApacking) - -#ifdef __cplusplus -} -#endif - -#endif /* __DIRECTX_VA__ */ diff --git a/import/DirectX8/include/edevdefs.h b/import/DirectX8/include/edevdefs.h deleted file mode 100644 index 16af462d8..000000000 --- a/import/DirectX8/include/edevdefs.h +++ /dev/null @@ -1,531 +0,0 @@ -//------------------------------------------------------------------------------ -// File: EDevDefs.h -// -// Desc: External Device (such as a VCR) control interface parameter and -// value definitions. -// -// Note: new constants added: ED_BASE+800L -> ED_BASE+811L -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __EDEVDEFS__ -#define __EDEVDEFS__ - - -#define ED_BASE 0x1000L - -// this is used to tell the device communications object which -// physical communications port to use. -#define DEV_PORT_SIM 1 -#define DEV_PORT_COM1 2 // standard serial ports -#define DEV_PORT_COM2 3 -#define DEV_PORT_COM3 4 -#define DEV_PORT_COM4 5 -#define DEV_PORT_DIAQ 6 // Diaquest driver -#define DEV_PORT_ARTI 7 // ARTI driver -#define DEV_PORT_1394 8 // IEEE 1394 Bus -#define DEV_PORT_USB 9 // Universal Serial Bus -#define DEV_PORT_MIN DEV_PORT_SIM -#define DEV_PORT_MAX DEV_PORT_USB - - -// IAMExtDevice Capability Items: unless otherwise specified, these items return -// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified: - -#define ED_DEVCAP_CAN_RECORD ED_BASE+1L -#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2L // for multitrack devices: - // switches currently recording tracks off - // and selected non-recording tracks into record -#define ED_DEVCAP_HAS_AUDIO ED_BASE+3L -#define ED_DEVCAP_HAS_VIDEO ED_BASE+4L -#define ED_DEVCAP_USES_FILES ED_BASE+5L -#define ED_DEVCAP_CAN_SAVE ED_BASE+6L - -#define ED_DEVCAP_DEVICE_TYPE ED_BASE+7L // returns one of the following: -#define ED_DEVTYPE_VCR ED_BASE+8L -#define ED_DEVTYPE_LASERDISK ED_BASE+9L -#define ED_DEVTYPE_ATR ED_BASE+10L -#define ED_DEVTYPE_DDR ED_BASE+11L -#define ED_DEVTYPE_ROUTER ED_BASE+12L -#define ED_DEVTYPE_KEYER ED_BASE+13L -#define ED_DEVTYPE_MIXER_VIDEO ED_BASE+14L -#define ED_DEVTYPE_DVE ED_BASE+15L -#define ED_DEVTYPE_WIPEGEN ED_BASE+16L -#define ED_DEVTYPE_MIXER_AUDIO ED_BASE+17L -#define ED_DEVTYPE_CG ED_BASE+18L -#define ED_DEVTYPE_TBC ED_BASE+19L -#define ED_DEVTYPE_TCG ED_BASE+20L -#define ED_DEVTYPE_GPI ED_BASE+21L -#define ED_DEVTYPE_JOYSTICK ED_BASE+22L -#define ED_DEVTYPE_KEYBOARD ED_BASE+23L - -// returns mfr-specific ID from external device. -#define ED_DEVCAP_EXTERNAL_DEVICE_ID ED_BASE+24L - -#define ED_DEVCAP_TIMECODE_READ ED_BASE+25L -#define ED_DEVCAP_TIMECODE_WRITE ED_BASE+26L -// used for seekable non-timecode enabled devices -#define ED_DEVCAP_CTLTRK_READ ED_BASE+27L -// used for seekable non-timecode enabled devices -#define ED_DEVCAP_INDEX_READ ED_BASE+28L - -// returns device preroll time in current time format -#define ED_DEVCAP_PREROLL ED_BASE+29L -// returns device postroll time in current time format -#define ED_DEVCAP_POSTROLL ED_BASE+30L - -// returns indication of devices synchronization accuracy. -#define ED_DEVCAP_SYNC_ACCURACY ED_BASE+31L // returns one of the following: -#define ED_SYNCACC_PRECISE ED_BASE+32L -#define ED_SYNCACC_FRAME ED_BASE+33L -#define ED_SYNCACC_ROUGH ED_BASE+34L - -// returns devices normal framerate. -#define ED_DEVCAP_NORMAL_RATE ED_BASE+35L // returns one of the following: -#define ED_RATE_24 ED_BASE+36L -#define ED_RATE_25 ED_BASE+37L -#define ED_RATE_2997 ED_BASE+38L -#define ED_RATE_30 ED_BASE+39L - -#define ED_DEVCAP_CAN_PREVIEW ED_BASE+40L -#define ED_DEVCAP_CAN_MONITOR_SOURCES ED_BASE+41L - -// indicates implementation allows testing of methods/parameters by -// setting the hi bit of a parm that makes sense - see individual methods -// for details. -#define ED_DEVCAP_CAN_TEST ED_BASE+42L - -// indicates device accepts video as an input. -#define ED_DEVCAP_VIDEO_INPUTS ED_BASE+43L - -// indicates device accepts audio as an input. -#define ED_DEVCAP_AUDIO_INPUTS ED_BASE+44L - -#define ED_DEVCAP_NEEDS_CALIBRATING ED_BASE+45L - -#define ED_DEVCAP_SEEK_TYPE ED_BASE+46L // returns one of the following: -#define ED_SEEK_PERFECT ED_BASE+47L // indicates device can execute seek - // within 1 video frames without signal - // break (like a DDR) -#define ED_SEEK_FAST ED_BASE+48L // indicates device can move pretty quick - // with short break in signal -#define ED_SEEK_SLOW ED_BASE+49L // seeks like a tape transport - -#define ED_POWER_ON ED_BASE+50L -#define ED_POWER_OFF ED_BASE+51L -#define ED_POWER_STANDBY ED_BASE+52L - -#define ED_ACTIVE ED_BASE+53L -#define ED_INACTIVE ED_BASE+54L -#define ED_ALL ED_BASE+55L -#define ED_TEST ED_BASE+56L - -// IAMExtTransport Capability Items: unless otherwise specified, these items return -// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified: - -#define ED_TRANSCAP_CAN_EJECT ED_BASE+100L -#define ED_TRANSCAP_CAN_BUMP_PLAY ED_BASE+101L // variable speed for synchronizing -#define ED_TRANSCAP_CAN_PLAY_BACKWARDS ED_BASE+102L // servo locked for use during an edit -#define ED_TRANSCAP_CAN_SET_EE ED_BASE+103L // show devices input on its output -#define ED_TRANSCAP_CAN_SET_PB ED_BASE+104L // show media playback on devices output -#define ED_TRANSCAP_CAN_DELAY_VIDEO_IN ED_BASE+105L // transport can do delayed-in video edits -#define ED_TRANSCAP_CAN_DELAY_VIDEO_OUT ED_BASE+106L // transport can do delayed-out video edits -#define ED_TRANSCAP_CAN_DELAY_AUDIO_IN ED_BASE+107L // transport can do delayed-in audio edits -#define ED_TRANSCAP_CAN_DELAY_AUDIO_OUT ED_BASE+108L // transport can do delayed-out audio edits -#define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109L // max forward speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_FWD_VARIABLE_MIN ED_BASE+800L // min forward speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110L // max reverse speed (multiple of play speed) in - // pdblValue -#define ED_TRANSCAP_REV_VARIABLE_MIN ED_BASE+801L // min reverse speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_FWD_SHUTTLE_MAX ED_BASE+802L // max forward speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_FWD_SHUTTLE_MIN ED_BASE+803L // min forward speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_REV_SHUTTLE_MAX ED_BASE+804L // max reverse speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_REV_SHUTTLE_MIN ED_BASE+805L // min reverse speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111L // returns number of audio tracks -#define ED_TRANSCAP_LTC_TRACK ED_BASE+112L // returns track number of LTC timecode track. - // ED_ALL means no dedicated timecode track -#define ED_TRANSCAP_NEEDS_TBC ED_BASE+113L // devices output not stable -#define ED_TRANSCAP_NEEDS_CUEING ED_BASE+114L // device must be cued prior to performing edit -#define ED_TRANSCAP_CAN_INSERT ED_BASE+115L -#define ED_TRANSCAP_CAN_ASSEMBLE ED_BASE+116L -#define ED_TRANSCAP_FIELD_STEP ED_BASE+117L // device responds to Frame Advance command by - // advancing one field -#define ED_TRANSCAP_CLOCK_INC_RATE ED_BASE+118L // VISCA command - keep for compatibility -#define ED_TRANSCAP_CAN_DETECT_LENGTH ED_BASE+119L -#define ED_TRANSCAP_CAN_FREEZE ED_BASE+120L -#define ED_TRANSCAP_HAS_TUNER ED_BASE+121L -#define ED_TRANSCAP_HAS_TIMER ED_BASE+122L -#define ED_TRANSCAP_HAS_CLOCK ED_BASE+123L -#define ED_TRANSCAP_MULTIPLE_EDITS ED_BASE+806L // OATRUE means device/filter can support - // multiple edit events -#define ED_TRANSCAP_IS_MASTER ED_BASE+807L // OATRUE means device is the master clock - // for synchronizing (this sets timecode-to- - // reference clock offset for editing) -#define ED_TRANSCAP_HAS_DT ED_BASE+814L // OATRUE means device has Dynamic Tracking - -// IAMExtTransport Media States -#define ED_MEDIA_SPIN_UP ED_BASE+130L -#define ED_MEDIA_SPIN_DOWN ED_BASE+131L -#define ED_MEDIA_UNLOAD ED_BASE+132L - -// IAMExtTransport Modes -#define ED_MODE_PLAY ED_BASE+200L -#define ED_MODE_STOP ED_BASE+201L -#define ED_MODE_FREEZE ED_BASE+202L // really "pause" -#define ED_MODE_THAW ED_BASE+203L -#define ED_MODE_FF ED_BASE+204L -#define ED_MODE_REW ED_BASE+205L -#define ED_MODE_RECORD ED_BASE+206L -#define ED_MODE_RECORD_STROBE ED_BASE+207L -#define ED_MODE_RECORD_FREEZE ED_BASE+808L // never "put", only "get" -#define ED_MODE_STEP ED_BASE+208L // same as "jog" -#define ED_MODE_STEP_FWD ED_BASE+208L // same as ED_MODE_STEP -#define ED_MODE_STEP_REV ED_BASE+809L -#define ED_MODE_SHUTTLE ED_BASE+209L -#define ED_MODE_EDIT_CUE ED_BASE+210L -#define ED_MODE_VAR_SPEED ED_BASE+211L -#define ED_MODE_PERFORM ED_BASE+212L // returned status only -#define ED_MODE_LINK_ON ED_BASE+280L -#define ED_MODE_LINK_OFF ED_BASE+281L -#define ED_MODE_NOTIFY_ENABLE ED_BASE+810L -#define ED_MODE_NOTIFY_DISABLE ED_BASE+811L -#define ED_MODE_SHOT_SEARCH ED_BASE+812L - -// IAMTimecodeReader/Generator/Display defines -// -// Timecode Generator Mode params and values: -// -#define ED_TCG_TIMECODE_TYPE ED_BASE+400L // can be one of the following: -#define ED_TCG_SMPTE_LTC ED_BASE+401L -#define ED_TCG_SMPTE_VITC ED_BASE+402L -#define ED_TCG_MIDI_QF ED_BASE+403L -#define ED_TCG_MIDI_FULL ED_BASE+404L - -#define ED_TCG_FRAMERATE ED_BASE+405L // can be one of the following: -#define ED_FORMAT_SMPTE_30 ED_BASE+406L -#define ED_FORMAT_SMPTE_30DROP ED_BASE+407L -#define ED_FORMAT_SMPTE_25 ED_BASE+408L -#define ED_FORMAT_SMPTE_24 ED_BASE+409L - -#define ED_TCG_SYNC_SOURCE ED_BASE+410L // can be one of the following: -#define ED_TCG_VIDEO ED_BASE+411L -#define ED_TCG_READER ED_BASE+412L -#define ED_TCG_FREE ED_BASE+413L - -#define ED_TCG_REFERENCE_SOURCE ED_BASE+414L // can have one these values: - // ED_TCG_FREE || ED_TCG_READER - // (for regen/jamsync) - -// TimeCodeReader Mode params and values: -#define ED_TCR_SOURCE ED_BASE+416L // can be one of the following: -// ED_TCG (already defined) -#define ED_TCR_LTC ED_BASE+417L -#define ED_TCR_VITC ED_BASE+418L -#define ED_TCR_CT ED_BASE+419L // Control Track -#define ED_TCR_FTC ED_BASE+420L // File TimeCode - for file-based devices - // that wish they were transports -// ED_MODE_NOTIFY_ENABLE can be OATRUE or OAFALSE (defined in transport mode -// section of this file). -#define ED_TCR_LAST_VALUE ED_BASE+421L // for notification mode - - // successive calls to GetTimecode - // return the last read value -// TimeCode Display Mode params and values: -// -#define ED_TCD_SOURCE ED_BASE+422L // can be one of the following: -#define ED_TCR ED_BASE+423L -#define ED_TCG ED_BASE+424L - -#define ED_TCD_SIZE ED_BASE+425L // can be one of the following: -#define ED_SMALL ED_BASE+426L -#define ED_MED ED_BASE+427L -#define ED_LARGE ED_BASE+428L - -#define ED_TCD_POSITION ED_BASE+429L // can be one of the following: -#define ED_TOP 0x0001 -#define ED_MIDDLE 0x0002 -#define ED_BOTTOM 0x0004 // OR'd with -#define ED_LEFT 0x0100 -#define ED_CENTER 0x0200 -#define ED_RIGHT 0x0400 - -#define ED_TCD_INTENSITY ED_BASE+436L // can be one of the following: -#define ED_HIGH ED_BASE+437L -#define ED_LOW ED_BASE+438L - -#define ED_TCD_TRANSPARENCY ED_BASE+439L // 0-4, 0 is opaque - -#define ED_TCD_INVERT ED_BASE+440L // OATRUE=black on white - // OAFALSE=white on black -// IAMExtTransport defines -// -// Transport status, params and values -// - -// IAMExtTransport Status items and and values: -#define ED_MODE ED_BASE+500L // see ED_MODE_xxx values above -#define ED_ERROR ED_BASE+501L -#define ED_LOCAL ED_BASE+502L -#define ED_RECORD_INHIBIT ED_BASE+503L -#define ED_SERVO_LOCK ED_BASE+504L -#define ED_MEDIA_PRESENT ED_BASE+505L -#define ED_MEDIA_LENGTH ED_BASE+506L -#define ED_MEDIA_SIZE ED_BASE+507L -#define ED_MEDIA_TRACK_COUNT ED_BASE+508L -#define ED_MEDIA_TRACK_LENGTH ED_BASE+509L -#define ED_MEDIA_SIDE ED_BASE+510L - -#define ED_MEDIA_TYPE ED_BASE+511L // can be one of the following: -#define ED_MEDIA_VHS ED_BASE+512L -#define ED_MEDIA_SVHS ED_BASE+513L -#define ED_MEDIA_HI8 ED_BASE+514L -#define ED_MEDIA_UMATIC ED_BASE+515L -#define ED_MEDIA_DVC ED_BASE+516L -#define ED_MEDIA_1_INCH ED_BASE+517L -#define ED_MEDIA_D1 ED_BASE+518L -#define ED_MEDIA_D2 ED_BASE+519L -#define ED_MEDIA_D3 ED_BASE+520L -#define ED_MEDIA_D5 ED_BASE+521L -#define ED_MEDIA_DBETA ED_BASE+522L -#define ED_MEDIA_BETA ED_BASE+523L -#define ED_MEDIA_8MM ED_BASE+524L -#define ED_MEDIA_DDR ED_BASE+525L -#define ED_MEDIA_SX ED_BASE+813L -#define ED_MEDIA_OTHER ED_BASE+526L -#define ED_MEDIA_CLV ED_BASE+527L -#define ED_MEDIA_CAV ED_BASE+528L -#define ED_MEDIA_POSITION ED_BASE+529L - -#define ED_LINK_MODE ED_BASE+530L // OATRUE if transport controls - // are linked to graph's RUN, - // STOP, and PAUSE methods - -// IAMExtTransport Basic Parms -#define ED_TRANSBASIC_TIME_FORMAT ED_BASE+540L // can be one of the following: -#define ED_FORMAT_MILLISECONDS ED_BASE+541L -#define ED_FORMAT_FRAMES ED_BASE+542L -#define ED_FORMAT_REFERENCE_TIME ED_BASE+543L - -#define ED_FORMAT_HMSF ED_BASE+547L -#define ED_FORMAT_TMSF ED_BASE+548L - -#define ED_TRANSBASIC_TIME_REFERENCE ED_BASE+549L // can be one of the following: -#define ED_TIMEREF_TIMECODE ED_BASE+550L -#define ED_TIMEREF_CONTROL_TRACK ED_BASE+551L -#define ED_TIMEREF_INDEX ED_BASE+552L - -#define ED_TRANSBASIC_SUPERIMPOSE ED_BASE+553L // enable/disable onscreen display -#define ED_TRANSBASIC_END_STOP_ACTION ED_BASE+554L // can be one of: ED_MODE_STOP | - // ED_MODE_REWIND | ED_MODE_FREEZE -#define ED_TRANSBASIC_RECORD_FORMAT ED_BASE+555L // can be one of the following: -#define ED_RECORD_FORMAT_SP ED_BASE+556L -#define ED_RECORD_FORMAT_LP ED_BASE+557L -#define ED_RECORD_FORMAT_EP ED_BASE+558L - -#define ED_TRANSBASIC_STEP_COUNT ED_BASE+559L -#define ED_TRANSBASIC_STEP_UNIT ED_BASE+560L // can be one of the following: -#define ED_STEP_FIELD ED_BASE+561L -#define ED_STEP_FRAME ED_BASE+562L -#define ED_STEP_3_2 ED_BASE+563L - -#define ED_TRANSBASIC_PREROLL ED_BASE+564L -#define ED_TRANSBASIC_RECPREROLL ED_BASE+565L -#define ED_TRANSBASIC_POSTROLL ED_BASE+566L -#define ED_TRANSBASIC_EDIT_DELAY ED_BASE+567L -#define ED_TRANSBASIC_PLAYTC_DELAY ED_BASE+568L -#define ED_TRANSBASIC_RECTC_DELAY ED_BASE+569L -#define ED_TRANSBASIC_EDIT_FIELD ED_BASE+570L -#define ED_TRANSBASIC_FRAME_SERVO ED_BASE+571L -#define ED_TRANSBASIC_CF_SERVO ED_BASE+572L -#define ED_TRANSBASIC_SERVO_REF ED_BASE+573L // can be one of the following: -#define ED_REF_EXTERNAL ED_BASE+574L -#define ED_REF_INPUT ED_BASE+575L -#define ED_REF_INTERNAL ED_BASE+576L -#define ED_REF_AUTO ED_BASE+577L - -#define ED_TRANSBASIC_WARN_GL ED_BASE+578L -#define ED_TRANSBASIC_SET_TRACKING ED_BASE+579L // can be one of the following: -#define ED_TRACKING_PLUS ED_BASE+580L -#define ED_TRACKING_MINUS ED_BASE+581L -#define ED_TRACKING_RESET ED_BASE+582L - -#define ED_TRANSBASIC_SET_FREEZE_TIMEOUT ED_BASE+583L -#define ED_TRANSBASIC_VOLUME_NAME ED_BASE+584L -#define ED_TRANSBASIC_BALLISTIC_1 ED_BASE+585L // space for proprietary data -#define ED_TRANSBASIC_BALLISTIC_2 ED_BASE+586L -#define ED_TRANSBASIC_BALLISTIC_3 ED_BASE+587L -#define ED_TRANSBASIC_BALLISTIC_4 ED_BASE+588L -#define ED_TRANSBASIC_BALLISTIC_5 ED_BASE+589L -#define ED_TRANSBASIC_BALLISTIC_6 ED_BASE+590L -#define ED_TRANSBASIC_BALLISTIC_7 ED_BASE+591L -#define ED_TRANSBASIC_BALLISTIC_8 ED_BASE+592L -#define ED_TRANSBASIC_BALLISTIC_9 ED_BASE+593L -#define ED_TRANSBASIC_BALLISTIC_10 ED_BASE+594L -#define ED_TRANSBASIC_BALLISTIC_11 ED_BASE+595L -#define ED_TRANSBASIC_BALLISTIC_12 ED_BASE+596L -#define ED_TRANSBASIC_BALLISTIC_13 ED_BASE+597L -#define ED_TRANSBASIC_BALLISTIC_14 ED_BASE+598L -#define ED_TRANSBASIC_BALLISTIC_15 ED_BASE+599L -#define ED_TRANSBASIC_BALLISTIC_16 ED_BASE+600L -#define ED_TRANSBASIC_BALLISTIC_17 ED_BASE+601L -#define ED_TRANSBASIC_BALLISTIC_18 ED_BASE+602L -#define ED_TRANSBASIC_BALLISTIC_19 ED_BASE+603L -#define ED_TRANSBASIC_BALLISTIC_20 ED_BASE+604L - -// consumer VCR items -#define ED_TRANSBASIC_SETCLOCK ED_BASE+605L -#define ED_TRANSBASIC_SET_COUNTER_FORMAT ED_BASE+606L // uses time format flags -#define ED_TRANSBASIC_SET_COUNTER_VALUE ED_BASE+607L - -#define ED_TRANSBASIC_SETTUNER_CH_UP ED_BASE+608L -#define ED_TRANSBASIC_SETTUNER_CH_DN ED_BASE+609L -#define ED_TRANSBASIC_SETTUNER_SK_UP ED_BASE+610L -#define ED_TRANSBASIC_SETTUNER_SK_DN ED_BASE+611L -#define ED_TRANSBASIC_SETTUNER_CH ED_BASE+612L -#define ED_TRANSBASIC_SETTUNER_NUM ED_BASE+613L - -#define ED_TRANSBASIC_SETTIMER_EVENT ED_BASE+614L -#define ED_TRANSBASIC_SETTIMER_STARTDAY ED_BASE+615L -#define ED_TRANSBASIC_SETTIMER_STARTTIME ED_BASE+616L -#define ED_TRANSBASIC_SETTIMER_STOPDAY ED_BASE+617L -#define ED_TRANSBASIC_SETTIMER_STOPTIME ED_BASE+618L - -// IAMExtTransport video parameters -#define ED_TRANSVIDEO_SET_OUTPUT ED_BASE+630L // can be one of the following: -#define ED_E2E ED_BASE+631L -#define ED_PLAYBACK ED_BASE+632L -#define ED_OFF ED_BASE+633L - -#define ED_TRANSVIDEO_SET_SOURCE ED_BASE+634L - -// IAMExtTransport audio parameters -#define ED_TRANSAUDIO_ENABLE_OUTPUT ED_BASE+640L // can be the following: -#define ED_AUDIO_ALL 0x10000000 // or any of the following OR'd together -#define ED_AUDIO_1 0x0000001L -#define ED_AUDIO_2 0x0000002L -#define ED_AUDIO_3 0x0000004L -#define ED_AUDIO_4 0x0000008L -#define ED_AUDIO_5 0x0000010L -#define ED_AUDIO_6 0x0000020L -#define ED_AUDIO_7 0x0000040L -#define ED_AUDIO_8 0x0000080L -#define ED_AUDIO_9 0x0000100L -#define ED_AUDIO_10 0x0000200L -#define ED_AUDIO_11 0x0000400L -#define ED_AUDIO_12 0x0000800L -#define ED_AUDIO_13 0x0001000L -#define ED_AUDIO_14 0x0002000L -#define ED_AUDIO_15 0x0004000L -#define ED_AUDIO_16 0x0008000L -#define ED_AUDIO_17 0x0010000L -#define ED_AUDIO_18 0x0020000L -#define ED_AUDIO_19 0x0040000L -#define ED_AUDIO_20 0x0080000L -#define ED_AUDIO_21 0x0100000L -#define ED_AUDIO_22 0x0200000L -#define ED_AUDIO_23 0x0400000L -#define ED_AUDIO_24 0x0800000L -#define ED_VIDEO 0x2000000L // for Edit props below - -#define ED_TRANSAUDIO_ENABLE_RECORD ED_BASE+642L -#define ED_TRANSAUDIO_ENABLE_SELSYNC ED_BASE+643L -#define ED_TRANSAUDIO_SET_SOURCE ED_BASE+644L -#define ED_TRANSAUDIO_SET_MONITOR ED_BASE+645L - - -// Edit Property Set-related defs - -// The following values reflect (and control) the state of an -// edit property set -#define ED_INVALID ED_BASE+652L -#define ED_EXECUTING ED_BASE+653L -#define ED_REGISTER ED_BASE+654L -#define ED_DELETE ED_BASE+655L - -// Edit property set parameters and values -#define ED_EDIT_HEVENT ED_BASE+656L // event handle to signal event - // completion -#define ED_EDIT_TEST ED_BASE+657L // returns OAFALSE if filter thinks - // edit can be done, OATRUE if not -#define ED_EDIT_IMMEDIATE ED_BASE+658L // OATRUE means start put the - // device into edit mode (editing - // "on the fly") immediately upon - // execution of Mode(ED_MODE_EDIT_CUE) -#define ED_EDIT_MODE ED_BASE+659L -// can be one of the following values: -#define ED_EDIT_MODE_ASSEMBLE ED_BASE+660L -#define ED_EDIT_MODE_INSERT ED_BASE+661L -#define ED_EDIT_MODE_CRASH_RECORD ED_BASE+662L -#define ED_EDIT_MODE_BOOKMARK_TIME ED_BASE+663L // these two are for -#define ED_EDIT_MODE_BOOKMARK_CHAPTER ED_BASE+664L // laserdisks - -#define ED_EDIT_MASTER ED_BASE+666L // OATRUE causes device - // not to synchronize - -#define ED_EDIT_TRACK ED_BASE+667L -// can be one of the following possible OR'd values: -// ED_VIDEO, ED_AUDIO_1 thru ED_AUDIO_24 (or ED_AUDIO_ALL) - -#define ED_EDIT_SRC_INPOINT ED_BASE+668L // in current time format -#define ED_EDIT_SRC_OUTPOINT ED_BASE+669L // in current time format -#define ED_EDIT_REC_INPOINT ED_BASE+670L // in current time format -#define ED_EDIT_REC_OUTPOINT ED_BASE+671L // in current time format - -#define ED_EDIT_REHEARSE_MODE ED_BASE+672L -// can be one of the following possible values: -#define ED_EDIT_BVB ED_BASE+673L // means rehearse the edit with - // "black-video-black" -#define ED_EDIT_VBV ED_BASE+674L -#define ED_EDIT_VVV ED_BASE+675L -#define ED_EDIT_PERFORM ED_BASE+676L // means perform the edit with no - // rehearsal. - -// Set this property to OATRUE to kill the edit if in progress -#define ED_EDIT_ABORT ED_BASE+677L -// how long to wait for edit to complete -#define ED_EDIT_TIMEOUT ED_BASE+678L // in current time format - -// This property causes the device to seek to a point specified by -// ED_EDIT_SEEK_MODE (see below). NOTE: Only one event at a time can seek. -#define ED_EDIT_SEEK ED_BASE+679L // OATRUE means do it now. -#define ED_EDIT_SEEK_MODE ED_BASE+680L -//possible values: -#define ED_EDIT_SEEK_EDIT_IN ED_BASE+681L // seek to edit's inpoint -#define ED_EDIT_SEEK_EDIT_OUT ED_BASE+682L // seek to edit's outpoint -#define ED_EDIT_SEEK_PREROLL ED_BASE+683L // seek to edit's - // inpoint-preroll -#define ED_EDIT_SEEK_PREROLL_CT ED_BASE+684L // seek to preroll point - // using control track (used for tapes with - // discontinuoustimecode before edit point: seek - // to inpoint using timecode, then backup to - // preroll point using control track) -#define ED_EDIT_SEEK_BOOKMARK ED_BASE+685L // seek to bookmark (just like - // timecode search) -// This property is used for multiple-VCR systems where each machine must -// cue to a different location relative to the graph's reference clock. The -// basic idea is that an edit event is setup with an ED_EDIT_OFFSET property -// that tells the VCR what offset to maintain between it's timecode (converted -// to reference clock units) and the reference clock. -#define ED_EDIT_OFFSET ED_BASE+686L // in current time format - -#define ED_EDIT_PREREAD ED_BASE+815L // OATRUE means device supports - // pre-read (recorder can also be - // player - -// -// Some error codes: -// -// device could be in local mode -#define ED_ERR_DEVICE_NOT_READY ED_BASE+700L - -#endif // __EDEVDEFS__ - -// eof edevdefs.h diff --git a/import/DirectX8/include/errors.h b/import/DirectX8/include/errors.h deleted file mode 100644 index d89a0a1ff..000000000 --- a/import/DirectX8/include/errors.h +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// File: Errors.h -// -// Desc: ActiveMovie error defines. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __ERRORS__ -#define __ERRORS__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#ifndef _AMOVIE_ -#define AMOVIEAPI DECLSPEC_IMPORT -#else -#define AMOVIEAPI -#endif - -// codes 0-01ff are reserved for OLE -#define VFW_FIRST_CODE 0x200 -#define MAX_ERROR_TEXT_LEN 160 - -#include // includes all message definitions - -typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD); -typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD); - -AMOVIEAPI DWORD WINAPI AMGetErrorTextA( HRESULT hr , char *pbuffer , DWORD MaxLen); -AMOVIEAPI DWORD WINAPI AMGetErrorTextW( HRESULT hr , WCHAR *pbuffer , DWORD MaxLen); - - -#ifdef UNICODE -#define AMGetErrorText AMGetErrorTextW -typedef AMGETERRORTEXTPROCW AMGETERRORTEXTPROC; -#else -#define AMGetErrorText AMGetErrorTextA -typedef AMGETERRORTEXTPROCA AMGETERRORTEXTPROC; -#endif - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __ERRORS__ diff --git a/import/DirectX8/include/evcode.h b/import/DirectX8/include/evcode.h deleted file mode 100644 index 97b17887e..000000000 --- a/import/DirectX8/include/evcode.h +++ /dev/null @@ -1,415 +0,0 @@ -//------------------------------------------------------------------------------ -// File: EvCode.h -// -// Desc: List of standard Quartz event codes and the expected params. -// -// Copyright (c) 1992 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// Event codes are broken into two groups -// -- system event codes -// -- extension event codes -// All system event codes are below EC_USER - -#define EC_SYSTEMBASE 0x00 -#define EC_USER 0x8000 - -// System-defined event codes -// ========================== -// -// There are three types of system-defined event codes: -// -// 1. Those which are always passed through to the application -// (To be collected by calls to GetEvent or within WaitForCompletion.) -// (e.g. EC_ERRORABORT, EC_USERABORT.) -// -// 2. Those which are pure internal and will never be passed to -// the application. (e.g. EC_SHUTDOWN) -// -// 3. Those which have default handling. Default handing implies that -// the event is not passed to the application. However, default -// handling may be canceled by calling -// IMediaEvent::CancelDefaultHandling. If the default handling is -// cancelled in this way, then the message will be delivered to the -// application and the application must action it appropriately. -// Default handling can be restored by calling RestoreDefaultHandling. -// -// We will refer to these events as application, internal and defaulted -// events respectively. -// -// System-defined events may have interface pointers, BSTR's, etc passed -// as parameters. It is therefore essential that, for any message -// retrieved using GetEvent, a matching call to FreeEventParams is made -// to ensure that relevant interfaces are released and storage freed. -// Failure to call FreeEventParams will result in memory leaks, if not -// worse. -// -// Filters sending these messages to the filter graph should not AddRef() -// any interfaces that they may pass as parameters. The filter graph -// manager will AddRef them if required. E.g. if the event is to be queued -// for the application or queued to a worker thread. - -// Each event listed below is immediately followed by a parameter list -// detailing the types of the parameters associated with the message, -// and an indication of whether the message is an application, internal -// or defaulted message. This is then followed by a short description. -// The use of "void" in the parameter list implies that the parameter is not -// used. Such parameters should be zero. - -// Other defined EC_ regions: -// DVD event codes 0x0100 - 0x0150 (dvdevcod.h) -// audio device event codes 0x0200 - 0x0250 (audevcod.h) -// WindowsMedia SDK-originated events 0x0251 - 0x0300 (see below) -// MSVIDCTL 0x0301 - 0x0325 (msvidctl.idl) - -#define EC_COMPLETE 0x01 -// ( HRESULT, void ) : defaulted (special) -// Signals the completed playback of a stream within the graph. This message -// is sent by renderers when they receive end-of-stream. The default handling -// of this message results in a _SINGLE_ EC_COMPLETE being sent to the -// application when ALL of the individual renderers have signaled EC_COMPLETE -// to the filter graph. If the default handing is canceled, the application -// will see all of the individual EC_COMPLETEs. - - -#define EC_USERABORT 0x02 -// ( void, void ) : application -// In some sense, the user has requested that playback be terminated. -// This message is typically sent by renderers that render into a -// window if the user closes the window into which it was rendering. -// It is up to the application to decide if playback should actually -// be stopped. - - -#define EC_ERRORABORT 0x03 -// ( HRESULT, void ) : application -// Operation aborted because of error - - -#define EC_TIME 0x04 -// ( DWORD, DWORD ) : application -// The requested reference time occurred. (This event is currently not used). -// lParam1 is low dword of ref time, lParam2 is high dword of reftime. - - -#define EC_REPAINT 0x05 -// ( IPin * (could be NULL), void ) : defaulted -// A repaint is required - lParam1 contains the (IPin *) that needs the data -// to be sent again. Default handling is: if the output pin which the IPin is -// attached to supports the IMediaEventSink interface then it will be called -// with the EC_REPAINT first. If that fails then normal repaint processing is -// done by the filter graph. - - -// Stream error notifications -#define EC_STREAM_ERROR_STOPPED 0x06 -#define EC_STREAM_ERROR_STILLPLAYING 0x07 -// ( HRESULT, DWORD ) : application -// lParam 1 is major code, lParam2 is minor code, either may be zero. - - -#define EC_ERROR_STILLPLAYING 0x08 -// ( HRESULT, void ) : application -// The filter graph manager may issue Run's to the graph asynchronously. -// If such a Run fails, EC_ERROR_STILLPLAYING is issued to notify the -// application of the failure. The state of the underlying filters -// at such a time will be indeterminate - they will all have been asked -// to run, but some are almost certainly not. - - -#define EC_PALETTE_CHANGED 0x09 -// ( void, void ) : application -// notify application that the video palette has changed - - -#define EC_VIDEO_SIZE_CHANGED 0x0A -// ( DWORD, void ) : application -// Sent by video renderers. -// Notifies the application that the native video size has changed. -// LOWORD of the DWORD is the new width, HIWORD is the new height. - - -#define EC_QUALITY_CHANGE 0x0B -// ( void, void ) : application -// Notify application that playback degradation has occurred - - -#define EC_SHUTTING_DOWN 0x0C -// ( void, void ) : internal -// This message is sent by the filter graph manager to any plug-in -// distributors which support IMediaEventSink to notify them that -// the filter graph is starting to shutdown. - - -#define EC_CLOCK_CHANGED 0x0D -// ( void, void ) : application -// Notify application that the clock has changed. -// (i.e. SetSyncSource has been called on the filter graph and has been -// distributed successfully to the filters in the graph.) - - -#define EC_PAUSED 0x0E -// ( HRESULT, void ) : application -// Notify application the previous pause request has completed - - -#define EC_OPENING_FILE 0x10 -#define EC_BUFFERING_DATA 0x11 -// ( BOOL, void ) : application -// lParam1 == 1 --> starting to open file or buffer data -// lParam1 == 0 --> not opening or buffering any more -// (This event does not appear to be used by ActiveMovie.) - - -#define EC_FULLSCREEN_LOST 0x12 -// ( void, IBaseFilter * ) : application -// Sent by full screen renderers when switched away from full screen. -// IBaseFilter may be NULL. - - -#define EC_ACTIVATE 0x13 -// ( BOOL, IBaseFilter * ) : internal -// Sent by video renderers when they lose or gain activation. -// lParam1 is set to 1 if gained or 0 if lost -// lParam2 is the IBaseFilter* for the filter that is sending the message -// Used for sound follows focus and full-screen switching - - -#define EC_NEED_RESTART 0x14 -// ( void, void ) : defaulted -// Sent by renderers when they regain a resource (e.g. audio renderer). -// Causes a restart by Pause/put_Current/Run (if running). - - -#define EC_WINDOW_DESTROYED 0x15 -// ( IBaseFilter *, void ) : internal -// Sent by video renderers when the window has been destroyed. Handled -// by the filter graph / distributor telling the resource manager. -// lParam1 is the IBaseFilter* of the filter whose window is being destroyed - - -#define EC_DISPLAY_CHANGED 0x16 -// ( IPin *, void ) : internal -// Sent by renderers when they detect a display change. the filter graph -// will arrange for the graph to be stopped and the pin send in lParam1 -// to be reconnected. by being reconnected it allows a renderer to reset -// and connect with a more appropriate format for the new display mode -// lParam1 contains an (IPin *) that should be reconnected by the graph - - -#define EC_STARVATION 0x17 -// ( void, void ) : defaulted -// Sent by a filter when it detects starvation. Default handling (only when -// running) is for the graph to be paused until all filters enter the -// paused state and then run. Normally this would be sent by a parser or source -// filter when too little data is arriving. - - -#define EC_OLE_EVENT 0x18 -// ( BSTR, BSTR ) : application -// Sent by a filter to pass a text string to the application. -// Conventionally, the first string is a type, and the second a parameter. - - -#define EC_NOTIFY_WINDOW 0x19 -// ( HWND, void ) : internal -// Pass the window handle around during pin connection. - -#define EC_STREAM_CONTROL_STOPPED 0x1A -// ( IPin * pSender, DWORD dwCookie ) -// Notification that an earlier call to IAMStreamControl::StopAt -// has now take effect. Calls to the method can be marked -// with a cookie which is passed back in the second parameter, -// allowing applications to easily tie together request -// and completion notifications. -// -// NB: IPin will point to the pin that actioned the Stop. This -// may not be the pin that the StopAt was sent to. - -#define EC_STREAM_CONTROL_STARTED 0x1B -// ( IPin * pSender, DWORD dwCookie ) -// Notification that an earlier call to IAMStreamControl::StartAt -// has now take effect. Calls to the method can be marked -// with a cookie which is passed back in the second parameter, -// allowing applications to easily tie together request -// and completion notifications. -// -// NB: IPin will point to the pin that actioned the Start. This -// may not be the pin that the StartAt was sent to. - -#define EC_END_OF_SEGMENT 0x1C -// -// ( const REFERENCE_TIME *pStreamTimeAtEndOfSegment, DWORD dwSegmentNumber ) -// -// pStreamTimeAtEndOfSegment -// pointer to the accumulated stream clock -// time since the start of the segment - this is directly computable -// as the sum of the previous and current segment durations (Stop - Start) -// and the rate applied to each segment -// The source add this time to the time within each segment to get -// a total elapsed time -// -// dwSegmentNumber -// Segment number - starts at 0 -// -// Notifies that a segment end has been reached when the -// AM_SEEKING_Segment flags was set for IMediaSeeking::SetPositions -// Passes in an IMediaSeeking interface to allow the next segment -// to be defined by the application - -#define EC_SEGMENT_STARTED 0x1D -// -// ( const REFERENCE_TIME *pStreamTimeAtStartOfSegment, DWORD dwSegmentNumber) -// -// pStreamTimeAtStartOfSegment -// pointer to the accumulated stream clock -// time since the start of the segment - this is directly computable -// as the sum of the previous segment durations (Stop - Start) -// and the rate applied to each segment -// -// dwSegmentNumber -// Segment number - starts at 0 -// -// Notifies that a new segment has been started. -// This is sent synchronously by any entity that will issue -// EC_END_OF_SEGMENT when a new segment is started -// (See IMediaSeeking::SetPositions - AM_SEEKING_Segment flag) -// It is used to compute how many EC_END_OF_SEGMENT notifications -// to expect at the end of a segment and as a consitency check - - -#define EC_LENGTH_CHANGED 0x1E -// (void, void) -// sent to indicate that the length of the "file" has changed - -#define EC_DEVICE_LOST 0x1f -// (IUnknown, 0) -// -// request window notification when the device is available again -// (through WM_DEVICECHANGED messages registered with -// RegisterDeviceNotification; see IAMDeviceRemoval interface) - -#define EC_STEP_COMPLETE 0x24 -// (BOOL bCacelled, void) -// Step request complete -// if bCancelled is TRUE the step was cancelled. This can happen -// if the application issued some control request or because there -// was a mode change etc etc - -// Event code 25 is reserved for future use. - -#define EC_TIMECODE_AVAILABLE 0x30 -// Sent by filter supporting timecode -// Param1 has a pointer to the sending object -// Param2 has the device ID of the sending object - -#define EC_EXTDEVICE_MODE_CHANGE 0x31 -// Sent by filter supporting IAMExtDevice -// Param1 has the new mode -// Param2 has the device ID of the sending object - -#define EC_STATE_CHANGE 0x32 -// ( FILTER_STATE, BOOL bInternal) -// Used to notify the application of any state changes in the filter graph. -// lParam1 is of type enum FILTER_STATE (defined in strmif.h) and indicates -// the state of the filter graph. -// -// lParam2 == 0 indicates that the previous state change request has completed -// & a change in application state. -// lParam2 == 1 reserved for future use to indicate internal state changes. - - -#define EC_GRAPH_CHANGED 0x50 -// Sent by filter to notify interesting graph changes - -#define EC_CLOCK_UNSET 0x51 -// ( void, void ) : application -// Used to notify the filter graph to unset the current graph clock. -// Has the affect of forcing the filter graph to reestablish the graph clock -// on the next Pause/Run (note that this is only used by ksproxy, when the pin -// of a clock providing filter is disconnected) - -#define EC_VMR_RENDERDEVICE_SET 0x53 -// (Render_Device type, void) -// Identifies the type of rendering mechanism the VMR -// is using to display video. Types used include: -#define VMR_RENDER_DEVICE_OVERLAY 0x01 -#define VMR_RENDER_DEVICE_VIDMEM 0x02 -#define VMR_RENDER_DEVICE_SYSMEM 0x04 - - -#define EC_VMR_SURFACE_FLIPPED 0x54 -// (hr - Flip return code, void) -// Identifies the VMR's allocator-presenter has called the DDraw flip api on -// the surface being presented. This allows the VMR to keep its DX-VA table -// of DDraw surfaces in sync with DDraws flipping chain. - -#define EC_VMR_RECONNECTION_FAILED 0x55 -// (hr - ReceiveConnection return code, void) -// Identifies that an upstream decoder tried to perform a dynamic format -// change and the VMR was unable to accept the new format. - - - -//------------------------------------------ -// -// BDA events: -// -// Event code 0x80 through 0x8f are reserved for BDA -// - - -//------------------------------------------ -// -// WindowsMedia SDK filter-specific events: -// -// -// Note that for EC_WMT_EVENT events the wmsdk-based filters use the following structure for -// passing event parameters to the app: -#ifndef AM_WMT_EVENT_DATA_DEFINED -#define AM_WMT_EVENT_DATA_DEFINED -typedef struct { - HRESULT hrStatus; // status code - void * pData; // event data -} AM_WMT_EVENT_DATA; -#endif -// -#define EC_WMT_EVENT_BASE 0x0251 -// -#define EC_WMT_INDEX_EVENT EC_WMT_EVENT_BASE -// WindowsMedia SDK-originated file indexing status, sent by WMSDK-based filters -// -// lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK -// lParam2 is specific to the lParam event -// -// the following WMT_STATUS messages are sent for this event: -// WMT_STARTED - lParam2 is 0 -// WMT_CLOSED - lParam2 is 0 -// WMT_INDEX_PROGRESS - lParam2 is a DWORD containing the progress percent complete -// -#define EC_WMT_EVENT EC_WMT_EVENT_BASE+1 -// WindowsMedia SDK-originated event, sent by WMSDK-based filters -// -// lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK -// lParam2 is a pointer an AM_WMT_EVENT_DATA structure where, -// hrStatus is the status code sent by the wmsdk -// pData is specific to the lParam1 event -// -// the following WMT_STATUS messages are sent by the WMSDK Reader filter for this event: -// WMT_NO_RIGHTS - pData is a pointer to a WCHAR string containing a challenge URL -// WMT_ACQUIRE_LICENSE - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct -// WMT_NO_RIGHTS_EX - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct -// WMT_NEEDS_INDIVIDUALIZATION - lParam2 is NULL -// WMT_INDIVIDUALIZE - lParam2 is a pointer to a WM_INDIVIDUALIZE_STATUS struct -// -// end WMSDK-originated events -//----------------------------------------- - - -#define EC_BUILT 0x300 -// Sent to notify transition from unbuilt to built state - - -#define EC_UNBUILT 0x301 -// Sent to notify transtion from built to unbuilt state diff --git a/import/DirectX8/include/il21dec.h b/import/DirectX8/include/il21dec.h deleted file mode 100644 index a2c7fc67b..000000000 --- a/import/DirectX8/include/il21dec.h +++ /dev/null @@ -1,112 +0,0 @@ -//------------------------------------------------------------------------------ -// File: IL21Dec.h -// -// Desc: Line 21 Decoder related definitions and interfaces for ActiveMovie. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __IL21DEC__ -#define __IL21DEC__ - - -// -// Some enum data types used as line 21 decoder params by the interface -// -typedef enum _AM_LINE21_CCLEVEL { // should we use TC1, TC2 in stead? - AM_L21_CCLEVEL_TC2 = 0 -} AM_LINE21_CCLEVEL, *PAM_LINE21_CCLEVEL ; - -typedef enum _AM_LINE21_CCSERVICE { - AM_L21_CCSERVICE_None = 0, - AM_L21_CCSERVICE_Caption1, - AM_L21_CCSERVICE_Caption2, - AM_L21_CCSERVICE_Text1, - AM_L21_CCSERVICE_Text2, - AM_L21_CCSERVICE_XDS, - AM_L21_CCSERVICE_DefChannel = 10, - AM_L21_CCSERVICE_Invalid -} AM_LINE21_CCSERVICE, *PAM_LINE21_CCSERVICE ; - -typedef enum _AM_LINE21_CCSTATE { - AM_L21_CCSTATE_Off = 0, - AM_L21_CCSTATE_On -} AM_LINE21_CCSTATE, *PAM_LINE21_CCSTATE ; - -typedef enum _AM_LINE21_CCSTYLE { - AM_L21_CCSTYLE_None = 0, - AM_L21_CCSTYLE_PopOn, - AM_L21_CCSTYLE_PaintOn, - AM_L21_CCSTYLE_RollUp -} AM_LINE21_CCSTYLE, *PAM_LINE21_CCSTYLE ; - -typedef enum _AM_LINE21_DRAWBGMODE { - AM_L21_DRAWBGMODE_Opaque, - AM_L21_DRAWBGMODE_Transparent -} AM_LINE21_DRAWBGMODE, *PAM_LINE21_DRAWBGMODE ; - - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// -// Line 21 Decoder standard COM interface -// -DECLARE_INTERFACE_(IAMLine21Decoder, IUnknown) -{ - public: - // - // Decoder options to be used by apps - // - - // What is the decoder's level - STDMETHOD(GetDecoderLevel)(THIS_ AM_LINE21_CCLEVEL *lpLevel) PURE ; - // supported level value is AM_L21Level_TC2 only - // skipping the SetDecoderLevel( ) - - // Which of the services is being currently used - STDMETHOD(GetCurrentService)(THIS_ AM_LINE21_CCSERVICE *lpService) PURE ; - STDMETHOD(SetCurrentService)(THIS_ AM_LINE21_CCSERVICE Service) PURE ; - // supported service values are AM_L21Service_Caption1, - // AM_L21Service_Caption2, AM_L21Service_Text1, AM_L21Service_Text2, - // AM_L21Service_XDS, AM_L21Service_None) - - // Query/Set the service state (On/Off) - // supported state values are AM_L21State_On and AM_L21State_Off - STDMETHOD(GetServiceState)(THIS_ AM_LINE21_CCSTATE *lpState) PURE ; - STDMETHOD(SetServiceState)(THIS_ AM_LINE21_CCSTATE State) PURE ; - - // - // Output options to be used by downstream filters - // - - // What size, bitdepth, etc. should the output video be - STDMETHOD(GetOutputFormat)(THIS_ LPBITMAPINFOHEADER lpbmih) PURE ; - // GetOutputFormat() method, if successful, returns - // 1. S_FALSE if no output format has so far been defined by downstream filters - // 2. S_OK if an output format has already been defined by downstream filters - STDMETHOD(SetOutputFormat)(THIS_ LPBITMAPINFO lpbmi) PURE ; - - // Specify physical color to be used in colorkeying the background - // for overlay mixing - STDMETHOD(GetBackgroundColor)(THIS_ DWORD *pdwPhysColor) PURE ; - STDMETHOD(SetBackgroundColor)(THIS_ DWORD dwPhysColor) PURE ; - - // Specify if whole output bitmap should be redrawn for each sample - STDMETHOD(GetRedrawAlways)(THIS_ LPBOOL lpbOption) PURE ; - STDMETHOD(SetRedrawAlways)(THIS_ BOOL bOption) PURE ; - - // Specify if the caption text background should be opaque/transparent - STDMETHOD(GetDrawBackgroundMode)(THIS_ AM_LINE21_DRAWBGMODE *lpMode) PURE ; - STDMETHOD(SetDrawBackgroundMode)(THIS_ AM_LINE21_DRAWBGMODE Mode) PURE ; - // supported mode values are AM_L21_DrawBGMode_Opaque and - // AM_L21_DrawBGMode_Transparent - -} ; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __IL21DEC__ diff --git a/import/DirectX8/include/ks.h b/import/DirectX8/include/ks.h deleted file mode 100644 index 2ccf3f469..000000000 --- a/import/DirectX8/include/ks.h +++ /dev/null @@ -1,11337 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ks.h - -Abstract: - - Windows Driver Model/Connection and Streaming Architecture (WDM-CSA) - core definitions. - ---*/ - -#if !defined(_KS_) -#define _KS_ - -#if defined(__TCS__) -#define _KS_NO_ANONYMOUS_STRUCTURES_ 1 -#endif - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - -#if !defined(_NTRTL_) - #ifndef DEFINE_GUIDEX - #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name - #endif // !defined(DEFINE_GUIDEX) - - #ifndef STATICGUIDOF - #define STATICGUIDOF(guid) STATIC_##guid - #endif // !defined(STATICGUIDOF) -#endif // !defined(_NTRTL_) - -#ifndef SIZEOF_ARRAY - #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0])) -#endif // !defined(SIZEOF_ARRAY) - -#if defined(__cplusplus) && _MSC_VER >= 1100 -#define DEFINE_GUIDSTRUCT(g, n) struct __declspec(uuid(g)) n -#define DEFINE_GUIDNAMED(n) __uuidof(struct n) -#else // !defined(__cplusplus) -#define DEFINE_GUIDSTRUCT(g, n) DEFINE_GUIDEX(n) -#define DEFINE_GUIDNAMED(n) n -#endif // !defined(__cplusplus) - -//=========================================================================== - -#define STATIC_GUID_NULL \ - 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -DEFINE_GUIDSTRUCT("00000000-0000-0000-0000-000000000000", GUID_NULL); -#define GUID_NULL DEFINE_GUIDNAMED(GUID_NULL) - -//=========================================================================== - -#define IOCTL_KS_PROPERTY CTL_CODE(FILE_DEVICE_KS, 0x000, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_ENABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x001, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_DISABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x002, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_METHOD CTL_CODE(FILE_DEVICE_KS, 0x003, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_WRITE_STREAM CTL_CODE(FILE_DEVICE_KS, 0x004, METHOD_NEITHER, FILE_WRITE_ACCESS) -#define IOCTL_KS_READ_STREAM CTL_CODE(FILE_DEVICE_KS, 0x005, METHOD_NEITHER, FILE_READ_ACCESS) -#define IOCTL_KS_RESET_STATE CTL_CODE(FILE_DEVICE_KS, 0x006, METHOD_NEITHER, FILE_ANY_ACCESS) - -//=========================================================================== - -typedef enum { - KSRESET_BEGIN, - KSRESET_END -} KSRESET; - -typedef enum { - KSSTATE_STOP, - KSSTATE_ACQUIRE, - KSSTATE_PAUSE, - KSSTATE_RUN -} KSSTATE, *PKSSTATE; - -#define KSPRIORITY_LOW 0x00000001 -#define KSPRIORITY_NORMAL 0x40000000 -#define KSPRIORITY_HIGH 0x80000000 -#define KSPRIORITY_EXCLUSIVE 0xFFFFFFFF - -typedef struct { - ULONG PriorityClass; - ULONG PrioritySubClass; -} KSPRIORITY, *PKSPRIORITY; - -typedef struct { - union { -#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _IDENTIFIER { -#else - struct { -#endif - GUID Set; - ULONG Id; - ULONG Flags; - }; - LONGLONG Alignment; - }; -} KSIDENTIFIER, *PKSIDENTIFIER; - -typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY, KSMETHOD, *PKSMETHOD, KSEVENT, *PKSEVENT; - -#define KSMETHOD_TYPE_NONE 0x00000000 -#define KSMETHOD_TYPE_READ 0x00000001 -#define KSMETHOD_TYPE_WRITE 0x00000002 -#define KSMETHOD_TYPE_MODIFY 0x00000003 -#define KSMETHOD_TYPE_SOURCE 0x00000004 - -#define KSMETHOD_TYPE_SEND 0x00000001 -#define KSMETHOD_TYPE_SETSUPPORT 0x00000100 -#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200 - -#define KSMETHOD_TYPE_TOPOLOGY 0x10000000 - -#define KSPROPERTY_TYPE_GET 0x00000001 -#define KSPROPERTY_TYPE_SET 0x00000002 -#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100 -#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200 -#define KSPROPERTY_TYPE_RELATIONS 0x00000400 -#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800 -#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000 -#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000 -#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000 -#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000 -#define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000 - -#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000 - -typedef struct { - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; -} KSP_NODE, *PKSP_NODE; - -typedef struct { - KSMETHOD Method; - ULONG NodeId; - ULONG Reserved; -} KSM_NODE, *PKSM_NODE; - -typedef struct { - KSEVENT Event; - ULONG NodeId; - ULONG Reserved; -} KSE_NODE, *PKSE_NODE; - -#define STATIC_KSPROPTYPESETID_General \ - 0x97E99BA0L, 0xBDEA, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("97E99BA0-BDEA-11CF-A5D6-28DB04C10000", KSPROPTYPESETID_General); -#define KSPROPTYPESETID_General DEFINE_GUIDNAMED(KSPROPTYPESETID_General) - -#if defined(_NTDDK_) && !defined(__wtypes_h__) -enum VARENUM { - VT_EMPTY = 0, - VT_NULL = 1, - VT_I2 = 2, - VT_I4 = 3, - VT_R4 = 4, - VT_R8 = 5, - VT_CY = 6, - VT_DATE = 7, - VT_BSTR = 8, - VT_DISPATCH = 9, - VT_ERROR = 10, - VT_BOOL = 11, - VT_VARIANT = 12, - VT_UNKNOWN = 13, - VT_DECIMAL = 14, - VT_I1 = 16, - VT_UI1 = 17, - VT_UI2 = 18, - VT_UI4 = 19, - VT_I8 = 20, - VT_UI8 = 21, - VT_INT = 22, - VT_UINT = 23, - VT_VOID = 24, - VT_HRESULT = 25, - VT_PTR = 26, - VT_SAFEARRAY = 27, - VT_CARRAY = 28, - VT_USERDEFINED = 29, - VT_LPSTR = 30, - VT_LPWSTR = 31, - VT_FILETIME = 64, - VT_BLOB = 65, - VT_STREAM = 66, - VT_STORAGE = 67, - VT_STREAMED_OBJECT = 68, - VT_STORED_OBJECT = 69, - VT_BLOB_OBJECT = 70, - VT_CF = 71, - VT_CLSID = 72, - VT_VECTOR = 0x1000, - VT_ARRAY = 0x2000, - VT_BYREF = 0x4000, - VT_RESERVED = 0x8000, - VT_ILLEGAL = 0xffff, - VT_ILLEGALMASKED = 0xfff, - VT_TYPEMASK = 0xfff -}; -#endif // _NTDDK_ && !__wtypes_h__ - -typedef struct { - ULONG Size; - ULONG Count; -} KSMULTIPLE_ITEM, *PKSMULTIPLE_ITEM; - -typedef struct { - ULONG AccessFlags; - ULONG DescriptionSize; - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - ULONG Reserved; -} KSPROPERTY_DESCRIPTION, *PKSPROPERTY_DESCRIPTION; - -#define KSPROPERTY_MEMBER_RANGES 0x00000001 -#define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002 -#define KSPROPERTY_MEMBER_VALUES 0x00000003 - -#define KSPROPERTY_MEMBER_FLAG_DEFAULT 0x00000001 -#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_MULTICHANNEL 0x00000002 -#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_UNIFORM 0x00000004 - -typedef struct { - ULONG MembersFlags; - ULONG MembersSize; - ULONG MembersCount; - ULONG Flags; -} KSPROPERTY_MEMBERSHEADER, *PKSPROPERTY_MEMBERSHEADER; - -typedef union { -#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _SIGNED { -#else - struct { -#endif - LONG SignedMinimum; - LONG SignedMaximum; - }; -#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _UNSIGNED { -#else - struct { -#endif - ULONG UnsignedMinimum; - ULONG UnsignedMaximum; - }; -} KSPROPERTY_BOUNDS_LONG, *PKSPROPERTY_BOUNDS_LONG; - -typedef union { -#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _SIGNED64 { -#else - struct { -#endif - LONGLONG SignedMinimum; - LONGLONG SignedMaximum; - }; -#if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _UNSIGNED64 { -#else - struct { -#endif -#if defined(_NTDDK_) - ULONGLONG UnsignedMinimum; - ULONGLONG UnsignedMaximum; -#else // !_NTDDK_ - DWORDLONG UnsignedMinimum; - DWORDLONG UnsignedMaximum; -#endif // !_NTDDK_ - }; -} KSPROPERTY_BOUNDS_LONGLONG, *PKSPROPERTY_BOUNDS_LONGLONG; - -typedef struct { - ULONG SteppingDelta; - ULONG Reserved; - KSPROPERTY_BOUNDS_LONG Bounds; -} KSPROPERTY_STEPPING_LONG, *PKSPROPERTY_STEPPING_LONG; - -typedef struct { -#if defined(_NTDDK_) - ULONGLONG SteppingDelta; -#else // !_NTDDK_ - DWORDLONG SteppingDelta; -#endif // !_NTDDK_ - KSPROPERTY_BOUNDS_LONGLONG Bounds; -} KSPROPERTY_STEPPING_LONGLONG, *PKSPROPERTY_STEPPING_LONGLONG; - -//=========================================================================== - -#if defined(_NTDDK_) -// -// Structure forward declarations. -// -typedef struct _KSDEVICE_DESCRIPTOR -KSDEVICE_DESCRIPTOR, *PKSDEVICE_DESCRIPTOR; -typedef struct _KSDEVICE_DISPATCH -KSDEVICE_DISPATCH, *PKSDEVICE_DISPATCH; -typedef struct _KSDEVICE -KSDEVICE, *PKSDEVICE; -typedef struct _KSFILTERFACTORY -KSFILTERFACTORY, *PKSFILTERFACTORY; -typedef struct _KSFILTER_DESCRIPTOR -KSFILTER_DESCRIPTOR, *PKSFILTER_DESCRIPTOR; -typedef struct _KSFILTER_DISPATCH -KSFILTER_DISPATCH, *PKSFILTER_DISPATCH; -typedef struct _KSFILTER -KSFILTER, *PKSFILTER; -typedef struct _KSPIN_DESCRIPTOR_EX -KSPIN_DESCRIPTOR_EX, *PKSPIN_DESCRIPTOR_EX; -typedef struct _KSPIN_DISPATCH -KSPIN_DISPATCH, *PKSPIN_DISPATCH; -typedef struct _KSCLOCK_DISPATCH -KSCLOCK_DISPATCH, *PKSCLOCK_DISPATCH; -typedef struct _KSALLOCATOR_DISPATCH -KSALLOCATOR_DISPATCH, *PKSALLOCATOR_DISPATCH; -typedef struct _KSPIN -KSPIN, *PKSPIN; -typedef struct _KSNODE_DESCRIPTOR -KSNODE_DESCRIPTOR, *PKSNODE_DESCRIPTOR; -typedef struct _KSSTREAM_POINTER_OFFSET -KSSTREAM_POINTER_OFFSET, *PKSSTREAM_POINTER_OFFSET; -typedef struct _KSSTREAM_POINTER -KSSTREAM_POINTER, *PKSSTREAM_POINTER; -typedef struct _KSMAPPING -KSMAPPING, *PKSMAPPING; -typedef struct _KSPROCESSPIN -KSPROCESSPIN, *PKSPROCESSPIN; -typedef struct _KSPROCESSPIN_INDEXENTRY -KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY; -#endif // _NTDDK_ - -typedef PVOID PKSWORKER; - -typedef struct { - ULONG NotificationType; - union { - struct { - HANDLE Event; - ULONG_PTR Reserved[2]; - } EventHandle; - struct { - HANDLE Semaphore; - ULONG Reserved; - LONG Adjustment; - } SemaphoreHandle; -#if defined(_NTDDK_) - struct { - PVOID Event; - KPRIORITY Increment; - ULONG_PTR Reserved; - } EventObject; - struct { - PVOID Semaphore; - KPRIORITY Increment; - LONG Adjustment; - } SemaphoreObject; - struct { - PKDPC Dpc; - ULONG ReferenceCount; - ULONG_PTR Reserved; - } Dpc; - struct { - PWORK_QUEUE_ITEM WorkQueueItem; - WORK_QUEUE_TYPE WorkQueueType; - ULONG_PTR Reserved; - } WorkItem; - struct { - PWORK_QUEUE_ITEM WorkQueueItem; - PKSWORKER KsWorkerObject; - ULONG_PTR Reserved; - } KsWorkItem; -// @@BEGIN_DDKSPLIT - struct { - PKSFILTER Filter; - ULONG_PTR Reserved[2]; - } KsFilterProcessing; - struct { - PKSPIN Pin; - ULONG_PTR Reserved[2]; - } KsPinProcessing; -// @@END_DDKSPLIT -#endif // defined(_NTDDK_) - struct { - PVOID Unused; - LONG_PTR Alignment[2]; - } Alignment; - }; -} KSEVENTDATA, *PKSEVENTDATA; - -#define KSEVENTF_EVENT_HANDLE 0x00000001 -#define KSEVENTF_SEMAPHORE_HANDLE 0x00000002 -#if defined(_NTDDK_) -#define KSEVENTF_EVENT_OBJECT 0x00000004 -#define KSEVENTF_SEMAPHORE_OBJECT 0x00000008 -#define KSEVENTF_DPC 0x00000010 -#define KSEVENTF_WORKITEM 0x00000020 -#define KSEVENTF_KSWORKITEM 0x00000080 -// @@BEGIN_DDKSPLIT -#define KSEVENTF_KSFILTERPROCESSING 0x00000100 -#define KSEVENTF_KSPINPROCESSING 0x00000200 -// @@END_DDKSPLIT -#endif // defined(_NTDDK_) - -#define KSEVENT_TYPE_ENABLE 0x00000001 -#define KSEVENT_TYPE_ONESHOT 0x00000002 -#define KSEVENT_TYPE_ENABLEBUFFERED 0x00000004 -#define KSEVENT_TYPE_SETSUPPORT 0x00000100 -#define KSEVENT_TYPE_BASICSUPPORT 0x00000200 -#define KSEVENT_TYPE_QUERYBUFFER 0x00000400 - -#define KSEVENT_TYPE_TOPOLOGY 0x10000000 - -typedef struct { - KSEVENT Event; - PKSEVENTDATA EventData; - PVOID Reserved; -} KSQUERYBUFFER, *PKSQUERYBUFFER; - -typedef struct { - ULONG Size; - ULONG Flags; - union { - HANDLE ObjectHandle; - PVOID ObjectPointer; - }; - PVOID Reserved; - KSEVENT Event; - KSEVENTDATA EventData; -} KSRELATIVEEVENT; - -#define KSRELATIVEEVENT_FLAG_HANDLE 0x00000001 -#define KSRELATIVEEVENT_FLAG_POINTER 0x00000002 - -//=========================================================================== - -typedef struct { - KSEVENTDATA EventData; - LONGLONG MarkTime; -} KSEVENT_TIME_MARK, *PKSEVENT_TIME_MARK; - -typedef struct { - KSEVENTDATA EventData; - LONGLONG TimeBase; - LONGLONG Interval; -} KSEVENT_TIME_INTERVAL, *PKSEVENT_TIME_INTERVAL; - -typedef struct { - LONGLONG TimeBase; - LONGLONG Interval; -} KSINTERVAL, *PKSINTERVAL; - -//=========================================================================== - -#define STATIC_KSPROPSETID_General\ - 0x1464EDA5L, 0x6A8F, 0x11D1, 0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("1464EDA5-6A8F-11D1-9AA7-00A0C9223196", KSPROPSETID_General); -#define KSPROPSETID_General DEFINE_GUIDNAMED(KSPROPSETID_General) - -typedef enum { - KSPROPERTY_GENERAL_COMPONENTID -} KSPROPERTY_GENERAL; - -typedef struct { - GUID Manufacturer; - GUID Product; - GUID Component; - GUID Name; - ULONG Version; - ULONG Revision; -} KSCOMPONENTID, *PKSCOMPONENTID; - -#define DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_GENERAL_COMPONENTID,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCOMPONENTID),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define STATIC_KSMETHODSETID_StreamIo\ - 0x65D003CAL, 0x1523, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65D003CA-1523-11D2-B27A-00A0C9223196", KSMETHODSETID_StreamIo); -#define KSMETHODSETID_StreamIo DEFINE_GUIDNAMED(KSMETHODSETID_StreamIo) - -typedef enum { - KSMETHOD_STREAMIO_READ, - KSMETHOD_STREAMIO_WRITE -} KSMETHOD_STREAMIO; - -#define DEFINE_KSMETHOD_ITEM_STREAMIO_READ(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMIO_READ,\ - KSMETHOD_TYPE_WRITE,\ - (Handler),\ - sizeof(KSMETHOD),\ - 0,\ - NULL) - -#define DEFINE_KSMETHOD_ITEM_STREAMIO_WRITE(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMIO_WRITE,\ - KSMETHOD_TYPE_READ,\ - (Handler),\ - sizeof(KSMETHOD),\ - 0,\ - NULL) - -#define STATIC_KSPROPSETID_MediaSeeking\ - 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("EE904F0C-D09B-11D0-ABE9-00A0C9223196", KSPROPSETID_MediaSeeking); -#define KSPROPSETID_MediaSeeking DEFINE_GUIDNAMED(KSPROPSETID_MediaSeeking) - -typedef enum { - KSPROPERTY_MEDIASEEKING_CAPABILITIES, - KSPROPERTY_MEDIASEEKING_FORMATS, - KSPROPERTY_MEDIASEEKING_TIMEFORMAT, - KSPROPERTY_MEDIASEEKING_POSITION, - KSPROPERTY_MEDIASEEKING_STOPPOSITION, - KSPROPERTY_MEDIASEEKING_POSITIONS, - KSPROPERTY_MEDIASEEKING_DURATION, - KSPROPERTY_MEDIASEEKING_AVAILABLE, - KSPROPERTY_MEDIASEEKING_PREROLL, - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT -} KSPROPERTY_MEDIASEEKING; - -typedef enum { - KS_SEEKING_NoPositioning, - KS_SEEKING_AbsolutePositioning, - KS_SEEKING_RelativePositioning, - KS_SEEKING_IncrementalPositioning, - KS_SEEKING_PositioningBitsMask = 0x3, - KS_SEEKING_SeekToKeyFrame, - KS_SEEKING_ReturnTime = 0x8 -} KS_SEEKING_FLAGS; - -typedef enum { - KS_SEEKING_CanSeekAbsolute = 0x1, - KS_SEEKING_CanSeekForwards = 0x2, - KS_SEEKING_CanSeekBackwards = 0x4, - KS_SEEKING_CanGetCurrentPos = 0x8, - KS_SEEKING_CanGetStopPos = 0x10, - KS_SEEKING_CanGetDuration = 0x20, - KS_SEEKING_CanPlayBackwards = 0x40 -} KS_SEEKING_CAPABILITIES; - -typedef struct { - LONGLONG Current; - LONGLONG Stop; - KS_SEEKING_FLAGS CurrentFlags; - KS_SEEKING_FLAGS StopFlags; -} KSPROPERTY_POSITIONS, *PKSPROPERTY_POSITIONS; - -typedef struct { - LONGLONG Earliest; - LONGLONG Latest; -} KSPROPERTY_MEDIAAVAILABLE, *PKSPROPERTY_MEDIAAVAILABLE; - -typedef struct { - KSPROPERTY Property; - GUID SourceFormat; - GUID TargetFormat; - LONGLONG Time; -} KSP_TIMEFORMAT, *PKSP_TIMEFORMAT; - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CAPABILITIES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_CAPABILITIES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KS_SEEKING_CAPABILITIES),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_FORMATS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_FORMATS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_TIMEFORMAT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_TIMEFORMAT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_POSITION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_STOPPOSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_STOPPOSITION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITIONS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_POSITIONS,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSPROPERTY_POSITIONS),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_DURATION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_DURATION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_AVAILABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_AVAILABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSPROPERTY_MEDIAAVAILABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_PREROLL(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_PREROLL,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CONVERTTIMEFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT,\ - (Handler),\ - sizeof(KSP_TIMEFORMAT),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -//=========================================================================== - -#define STATIC_KSPROPSETID_Topology\ - 0x720D4AC0L, 0x7533, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("720D4AC0-7533-11D0-A5D6-28DB04C10000", KSPROPSETID_Topology); -#define KSPROPSETID_Topology DEFINE_GUIDNAMED(KSPROPSETID_Topology) - -typedef enum { - KSPROPERTY_TOPOLOGY_CATEGORIES, - KSPROPERTY_TOPOLOGY_NODES, - KSPROPERTY_TOPOLOGY_CONNECTIONS, - KSPROPERTY_TOPOLOGY_NAME -} KSPROPERTY_TOPOLOGY; - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_CATEGORIES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_NODES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_CONNECTIONS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_NAME,\ - (Handler),\ - sizeof(KSP_NODE),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_TOPOLOGYSET(TopologySet, Handler)\ -DEFINE_KSPROPERTY_TABLE(TopologySet) {\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\ -} - -//============================================================================= - -// -// properties used by graph manager to talk to particular filters -// -#if defined(_NTDDK_) - -#define STATIC_KSPROPSETID_GM \ - 0xAF627536L, 0xE719, 0x11D2, 0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D -DEFINE_GUIDSTRUCT("AF627536-E719-11D2-8A1D-006097D2DF5D", KSPROPSETID_GM); -#define KSPROPSETID_GM DEFINE_GUIDNAMED(KSPROPSETID_GM) - -typedef VOID (*PFNKSGRAPHMANAGER_NOTIFY)(IN PFILE_OBJECT GraphManager, - IN ULONG EventId, - IN PVOID Filter, - IN PVOID Pin, - IN PVOID Frame, - IN ULONG Duration); - -typedef struct KSGRAPHMANAGER_FUNCTIONTABLE { - PFNKSGRAPHMANAGER_NOTIFY NotifyEvent; -} KSGRAPHMANAGER_FUNCTIONTABLE, PKSGRAPHMANAGER_FUNCTIONTABLE; - -typedef struct _KSPROPERTY_GRAPHMANAGER_INTERFACE { - PFILE_OBJECT GraphManager; - KSGRAPHMANAGER_FUNCTIONTABLE FunctionTable; -} KSPROPERTY_GRAPHMANAGER_INTERFACE, *PKSPROPERTY_GRAPHMANAGER_INTERFACE; - - -// -// Commands -// -typedef enum { - KSPROPERTY_GM_GRAPHMANAGER, - KSPROPERTY_GM_TIMESTAMP_CLOCK, - KSPROPERTY_GM_RATEMATCH, - KSPROPERTY_GM_RENDER_CLOCK, -} KSPROPERTY_GM; - -#endif - -//=========================================================================== - - -#define STATIC_KSCATEGORY_BRIDGE \ - 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("085AFF00-62CE-11CF-A5D6-28DB04C10000", KSCATEGORY_BRIDGE); -#define KSCATEGORY_BRIDGE DEFINE_GUIDNAMED(KSCATEGORY_BRIDGE) - -#define STATIC_KSCATEGORY_CAPTURE \ - 0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65E8773D-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_CAPTURE); -#define KSCATEGORY_CAPTURE DEFINE_GUIDNAMED(KSCATEGORY_CAPTURE) - -#define STATIC_KSCATEGORY_RENDER \ - 0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65E8773E-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_RENDER); -#define KSCATEGORY_RENDER DEFINE_GUIDNAMED(KSCATEGORY_RENDER) - -#define STATIC_KSCATEGORY_MIXER \ - 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("AD809C00-7B88-11D0-A5D6-28DB04C10000", KSCATEGORY_MIXER); -#define KSCATEGORY_MIXER DEFINE_GUIDNAMED(KSCATEGORY_MIXER) - -#define STATIC_KSCATEGORY_SPLITTER \ - 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("0A4252A0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_SPLITTER); -#define KSCATEGORY_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_SPLITTER) - -#define STATIC_KSCATEGORY_DATACOMPRESSOR \ - 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("1E84C900-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATACOMPRESSOR); -#define KSCATEGORY_DATACOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATACOMPRESSOR) - -#define STATIC_KSCATEGORY_DATADECOMPRESSOR \ - 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2721AE20-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATADECOMPRESSOR); -#define KSCATEGORY_DATADECOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATADECOMPRESSOR) - -#define STATIC_KSCATEGORY_DATATRANSFORM \ - 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2EB07EA0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATATRANSFORM); -#define KSCATEGORY_DATATRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_DATATRANSFORM) - -#define STATIC_KSCATEGORY_COMMUNICATIONSTRANSFORM \ - 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2C-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_COMMUNICATIONSTRANSFORM); -#define KSCATEGORY_COMMUNICATIONSTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_COMMUNICATIONSTRANSFORM) - -#define STATIC_KSCATEGORY_INTERFACETRANSFORM \ - 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2D-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_INTERFACETRANSFORM); -#define KSCATEGORY_INTERFACETRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_INTERFACETRANSFORM) - -#define STATIC_KSCATEGORY_MEDIUMTRANSFORM \ - 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2E-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_MEDIUMTRANSFORM); -#define KSCATEGORY_MEDIUMTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_MEDIUMTRANSFORM) - -#define STATIC_KSCATEGORY_FILESYSTEM \ - 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("760FED5E-9357-11D0-A3CC-00A0C9223196", KSCATEGORY_FILESYSTEM); -#define KSCATEGORY_FILESYSTEM DEFINE_GUIDNAMED(KSCATEGORY_FILESYSTEM) - -// KSNAME_Clock -#define STATIC_KSCATEGORY_CLOCK \ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSCATEGORY_CLOCK); -#define KSCATEGORY_CLOCK DEFINE_GUIDNAMED(KSCATEGORY_CLOCK) - -#define STATIC_KSCATEGORY_PROXY \ - 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("97EBAACA-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_PROXY); -#define KSCATEGORY_PROXY DEFINE_GUIDNAMED(KSCATEGORY_PROXY) - -#define STATIC_KSCATEGORY_QUALITY \ - 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY); -#define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY) - -typedef struct { - ULONG FromNode; - ULONG FromNodePin; - ULONG ToNode; - ULONG ToNodePin; -} KSTOPOLOGY_CONNECTION, *PKSTOPOLOGY_CONNECTION; - -typedef struct { - ULONG CategoriesCount; - const GUID* Categories; - ULONG TopologyNodesCount; - const GUID* TopologyNodes; - ULONG TopologyConnectionsCount; - const KSTOPOLOGY_CONNECTION* TopologyConnections; - const GUID* TopologyNodesNames; - ULONG Reserved; -} KSTOPOLOGY, *PKSTOPOLOGY; - -#define KSFILTER_NODE ((ULONG)-1) -#define KSALL_NODES ((ULONG)-1) - -typedef struct { - ULONG CreateFlags; - ULONG Node; -} KSNODE_CREATE, *PKSNODE_CREATE; - -//=========================================================================== - -// TIME_FORMAT_NONE -#define STATIC_KSTIME_FORMAT_NONE STATIC_GUID_NULL -#define KSTIME_FORMAT_NONE GUID_NULL - -// TIME_FORMAT_FRAME -#define STATIC_KSTIME_FORMAT_FRAME\ - 0x7b785570L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785570-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FRAME); -#define KSTIME_FORMAT_FRAME DEFINE_GUIDNAMED(KSTIME_FORMAT_FRAME) - -// TIME_FORMAT_BYTE -#define STATIC_KSTIME_FORMAT_BYTE\ - 0x7b785571L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785571-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_BYTE); -#define KSTIME_FORMAT_BYTE DEFINE_GUIDNAMED(KSTIME_FORMAT_BYTE) - -// TIME_FORMAT_SAMPLE -#define STATIC_KSTIME_FORMAT_SAMPLE\ - 0x7b785572L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785572-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_SAMPLE); -#define KSTIME_FORMAT_SAMPLE DEFINE_GUIDNAMED(KSTIME_FORMAT_SAMPLE) - -// TIME_FORMAT_FIELD -#define STATIC_KSTIME_FORMAT_FIELD\ - 0x7b785573L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785573-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FIELD); -#define KSTIME_FORMAT_FIELD DEFINE_GUIDNAMED(KSTIME_FORMAT_FIELD) - -// TIME_FORMAT_MEDIA_TIME -#define STATIC_KSTIME_FORMAT_MEDIA_TIME\ - 0x7b785574L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785574-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_MEDIA_TIME); -#define KSTIME_FORMAT_MEDIA_TIME DEFINE_GUIDNAMED(KSTIME_FORMAT_MEDIA_TIME) - -//=========================================================================== - -typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE; - -#define STATIC_KSINTERFACESETID_Standard \ - 0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard); -#define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard) - -typedef enum { - KSINTERFACE_STANDARD_STREAMING, - KSINTERFACE_STANDARD_LOOPED_STREAMING, - KSINTERFACE_STANDARD_CONTROL -} KSINTERFACE_STANDARD; - -#define STATIC_KSINTERFACESETID_FileIo \ - 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo); -#define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo) - -typedef enum { - KSINTERFACE_FILEIO_STREAMING -} KSINTERFACE_FILEIO; - -//=========================================================================== - -#define KSMEDIUM_TYPE_ANYINSTANCE 0 - -#define STATIC_KSMEDIUMSETID_Standard \ - 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard); -#define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard) - -//For compatibility only -#define KSMEDIUM_STANDARD_DEVIO KSMEDIUM_TYPE_ANYINSTANCE - -//=========================================================================== - -#define STATIC_KSPROPSETID_Pin\ - 0x8C134960L, 0x51AD, 0x11CF, 0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin); -#define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin) - -typedef enum { - KSPROPERTY_PIN_CINSTANCES, - KSPROPERTY_PIN_CTYPES, - KSPROPERTY_PIN_DATAFLOW, - KSPROPERTY_PIN_DATARANGES, - KSPROPERTY_PIN_DATAINTERSECTION, - KSPROPERTY_PIN_INTERFACES, - KSPROPERTY_PIN_MEDIUMS, - KSPROPERTY_PIN_COMMUNICATION, - KSPROPERTY_PIN_GLOBALCINSTANCES, - KSPROPERTY_PIN_NECESSARYINSTANCES, - KSPROPERTY_PIN_PHYSICALCONNECTION, - KSPROPERTY_PIN_CATEGORY, - KSPROPERTY_PIN_NAME, - KSPROPERTY_PIN_CONSTRAINEDDATARANGES, - KSPROPERTY_PIN_PROPOSEDATAFORMAT -} KSPROPERTY_PIN; - -typedef struct { - KSPROPERTY Property; - ULONG PinId; - ULONG Reserved; -} KSP_PIN, *PKSP_PIN; - -#define KSINSTANCE_INDETERMINATE ((ULONG)-1) - -typedef struct { - ULONG PossibleCount; - ULONG CurrentCount; -} KSPIN_CINSTANCES, *PKSPIN_CINSTANCES; - -typedef enum { - KSPIN_DATAFLOW_IN = 1, - KSPIN_DATAFLOW_OUT -} KSPIN_DATAFLOW, *PKSPIN_DATAFLOW; - -#define KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION 0 -#define KSDATAFORMAT_TEMPORAL_COMPRESSION (1 << KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION) -#define KSDATAFORMAT_BIT_ATTRIBUTES 1 -#define KSDATAFORMAT_ATTRIBUTES (1 << KSDATAFORMAT_BIT_ATTRIBUTES) - -#define KSDATARANGE_BIT_ATTRIBUTES 1 -#define KSDATARANGE_ATTRIBUTES (1 << KSDATARANGE_BIT_ATTRIBUTES) -#define KSDATARANGE_BIT_REQUIRED_ATTRIBUTES 2 -#define KSDATARANGE_REQUIRED_ATTRIBUTES (1 << KSDATARANGE_BIT_REQUIRED_ATTRIBUTES) - -#if !defined( _MSC_VER ) -typedef struct { - ULONG FormatSize; - ULONG Flags; - ULONG SampleSize; - ULONG Reserved; - GUID MajorFormat; - GUID SubFormat; - GUID Specifier; -} KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; -#else -typedef union { - struct { - ULONG FormatSize; - ULONG Flags; - ULONG SampleSize; - ULONG Reserved; - GUID MajorFormat; - GUID SubFormat; - GUID Specifier; - }; - LONGLONG Alignment; -} KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; -#endif - -#define KSATTRIBUTE_REQUIRED 0x00000001 - -typedef struct { - ULONG Size; - ULONG Flags; - GUID Attribute; -} KSATTRIBUTE, *PKSATTRIBUTE; - -#if defined(_NTDDK_) -typedef struct { - ULONG Count; - PKSATTRIBUTE* Attributes; -} KSATTRIBUTE_LIST, *PKSATTRIBUTE_LIST; -#endif // _NTDDK_ - -typedef enum { - KSPIN_COMMUNICATION_NONE, - KSPIN_COMMUNICATION_SINK, - KSPIN_COMMUNICATION_SOURCE, - KSPIN_COMMUNICATION_BOTH, - KSPIN_COMMUNICATION_BRIDGE -} KSPIN_COMMUNICATION, *PKSPIN_COMMUNICATION; - -typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM; - -typedef struct { - KSPIN_INTERFACE Interface; - KSPIN_MEDIUM Medium; - ULONG PinId; - HANDLE PinToHandle; - KSPRIORITY Priority; -} KSPIN_CONNECT, *PKSPIN_CONNECT; - -typedef struct { - ULONG Size; - ULONG Pin; - WCHAR SymbolicLinkName[1]; -} KSPIN_PHYSICALCONNECTION, *PKSPIN_PHYSICALCONNECTION; - -#if defined(_NTDDK_) -typedef -NTSTATUS -(*PFNKSINTERSECTHANDLER)( - IN PIRP Irp, - IN PKSP_PIN Pin, - IN PKSDATARANGE DataRange, - OUT PVOID Data OPTIONAL - ); -typedef -NTSTATUS -(*PFNKSINTERSECTHANDLEREX)( - IN PVOID Context, - IN PIRP Irp, - IN PKSP_PIN Pin, - IN PKSDATARANGE DataRange, - IN PKSDATARANGE MatchingDataRange, - IN ULONG DataBufferSize, - OUT PVOID Data OPTIONAL, - OUT PULONG DataSize - ); -#endif // _NTDDK_ - -#define DEFINE_KSPIN_INTERFACE_TABLE(tablename)\ - const KSPIN_INTERFACE tablename[] = - -#define DEFINE_KSPIN_INTERFACE_ITEM(guid, interface)\ - {\ - STATICGUIDOF(guid),\ - (interface),\ - 0\ - } - -#define DEFINE_KSPIN_MEDIUM_TABLE( tablename )\ - const KSPIN_MEDIUM tablename[] = - -#define DEFINE_KSPIN_MEDIUM_ITEM(guid, medium)\ - DEFINE_KSPIN_INTERFACE_ITEM(guid, medium) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_CINSTANCES),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CTYPES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATAFLOW,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_DATAFLOW),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATARANGES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATAINTERSECTION,\ - (Handler),\ - sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_INTERFACES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_MEDIUMS,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_COMMUNICATION,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_COMMUNICATION),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_GLOBALCINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_GLOBALCINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_CINSTANCES),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_NECESSARYINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_NECESSARYINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_PHYSICALCONNECTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_PHYSICALCONNECTION,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CATEGORY,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(GUID),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_NAME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_NAME,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CONSTRAINEDDATARANGES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_PROPOSEDATAFORMAT,\ - NULL,\ - sizeof(KSP_PIN),\ - sizeof(KSDATAFORMAT),\ - (Handler), NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_PINSET(PinSet,\ - PropGeneral, PropInstances, PropIntersection)\ -DEFINE_KSPROPERTY_TABLE(PinSet) {\ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral)\ -} - -#define DEFINE_KSPROPERTY_PINSETCONSTRAINED(PinSet,\ - PropGeneral, PropInstances, PropIntersection)\ -DEFINE_KSPROPERTY_TABLE(PinSet) {\ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral)\ -} - -#define STATIC_KSNAME_Filter\ - 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("9b365890-165f-11d0-a195-0020afd156e4", KSNAME_Filter); -#define KSNAME_Filter DEFINE_GUIDNAMED(KSNAME_Filter) - -#define KSSTRING_Filter L"{9B365890-165F-11D0-A195-0020AFD156E4}" - -#define STATIC_KSNAME_Pin\ - 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("146F1A80-4791-11D0-A5D6-28DB04C10000", KSNAME_Pin); -#define KSNAME_Pin DEFINE_GUIDNAMED(KSNAME_Pin) - -#define KSSTRING_Pin L"{146F1A80-4791-11D0-A5D6-28DB04C10000}" - -#define STATIC_KSNAME_Clock\ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSNAME_Clock); -#define KSNAME_Clock DEFINE_GUIDNAMED(KSNAME_Clock) - -#define KSSTRING_Clock L"{53172480-4791-11D0-A5D6-28DB04C10000}" - -#define STATIC_KSNAME_Allocator\ - 0x642F5D00L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("642F5D00-4791-11D0-A5D6-28DB04C10000", KSNAME_Allocator); -#define KSNAME_Allocator DEFINE_GUIDNAMED(KSNAME_Allocator) - -#define KSSTRING_Allocator L"{642F5D00-4791-11D0-A5D6-28DB04C10000}" - -#define KSSTRING_AllocatorEx L"{091BB63B-603F-11D1-B067-00A0C9062802}" - -#define STATIC_KSNAME_TopologyNode\ - 0x0621061AL, 0xEE75, 0x11D0, 0xB9, 0x15, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("0621061A-EE75-11D0-B915-00A0C9223196", KSNAME_TopologyNode); -#define KSNAME_TopologyNode DEFINE_GUIDNAMED(KSNAME_TopologyNode) - -#define KSSTRING_TopologyNode L"{0621061A-EE75-11D0-B915-00A0C9223196}" - -#if defined(_NTDDK_) - -typedef struct { - ULONG InterfacesCount; - const KSPIN_INTERFACE* Interfaces; - ULONG MediumsCount; - const KSPIN_MEDIUM* Mediums; - ULONG DataRangesCount; - const PKSDATARANGE* DataRanges; - KSPIN_DATAFLOW DataFlow; - KSPIN_COMMUNICATION Communication; - const GUID* Category; - const GUID* Name; - union { - LONGLONG Reserved; - struct { - ULONG ConstrainedDataRangesCount; - PKSDATARANGE* ConstrainedDataRanges; - }; - }; -} KSPIN_DESCRIPTOR, *PKSPIN_DESCRIPTOR; -typedef const KSPIN_DESCRIPTOR *PCKSPIN_DESCRIPTOR; - -#define DEFINE_KSPIN_DESCRIPTOR_TABLE(tablename)\ - const KSPIN_DESCRIPTOR tablename[] = - -#define DEFINE_KSPIN_DESCRIPTOR_ITEM(\ - InterfacesCount, Interfaces,\ - MediumsCount, Mediums,\ - DataRangesCount, DataRanges,\ - DataFlow, Communication)\ -{\ - InterfacesCount, Interfaces, MediumsCount, Mediums,\ - DataRangesCount, DataRanges, DataFlow, Communication,\ - NULL, NULL, 0\ -} -#define DEFINE_KSPIN_DESCRIPTOR_ITEMEX(\ - InterfacesCount, Interfaces,\ - MediumsCount, Mediums,\ - DataRangesCount, DataRanges,\ - DataFlow, Communication,\ - Category, Name)\ -{\ - InterfacesCount, Interfaces, MediumsCount, Mediums,\ - DataRangesCount, DataRanges, DataFlow, Communication,\ - Category, Name, 0\ -} - -#endif // defined(_NTDDK_) - -//=========================================================================== - -// MEDIATYPE_NULL -#define STATIC_KSDATAFORMAT_TYPE_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_TYPE_WILDCARD GUID_NULL - -// MEDIASUBTYPE_NULL -#define STATIC_KSDATAFORMAT_SUBTYPE_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_SUBTYPE_WILDCARD GUID_NULL - -// MEDIATYPE_Stream -#define STATIC_KSDATAFORMAT_TYPE_STREAM\ - 0xE436EB83L, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 -DEFINE_GUIDSTRUCT("E436EB83-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_TYPE_STREAM); -#define KSDATAFORMAT_TYPE_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STREAM) - -// MEDIASUBTYPE_None -#define STATIC_KSDATAFORMAT_SUBTYPE_NONE\ - 0xE436EB8EL, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 -DEFINE_GUIDSTRUCT("E436EB8E-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_SUBTYPE_NONE); -#define KSDATAFORMAT_SUBTYPE_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NONE) - -#define STATIC_KSDATAFORMAT_SPECIFIER_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_SPECIFIER_WILDCARD GUID_NULL - -#define STATIC_KSDATAFORMAT_SPECIFIER_FILENAME\ - 0xAA797B40L, 0xE974, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("AA797B40-E974-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SPECIFIER_FILENAME); -#define KSDATAFORMAT_SPECIFIER_FILENAME DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILENAME) - -#define STATIC_KSDATAFORMAT_SPECIFIER_FILEHANDLE\ - 0x65E8773CL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65E8773C-8F56-11D0-A3B9-00A0C9223196", KSDATAFORMAT_SPECIFIER_FILEHANDLE); -#define KSDATAFORMAT_SPECIFIER_FILEHANDLE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILEHANDLE) - -// FORMAT_None -#define STATIC_KSDATAFORMAT_SPECIFIER_NONE\ - 0x0F6417D6L, 0xC318, 0x11D0, 0xA4, 0x3F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("0F6417D6-C318-11D0-A43F-00A0C9223196", KSDATAFORMAT_SPECIFIER_NONE); -#define KSDATAFORMAT_SPECIFIER_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_NONE) - -//=========================================================================== - -#define STATIC_KSPROPSETID_Quality \ - 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("D16AD380-AC1A-11CF-A5D6-28DB04C10000", KSPROPSETID_Quality); -#define KSPROPSETID_Quality DEFINE_GUIDNAMED(KSPROPSETID_Quality) - -typedef enum { - KSPROPERTY_QUALITY_REPORT, - KSPROPERTY_QUALITY_ERROR -} KSPROPERTY_QUALITY; - -#define DEFINE_KSPROPERTY_ITEM_QUALITY_REPORT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_QUALITY_REPORT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSQUALITY),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_QUALITY_ERROR(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_QUALITY_ERROR,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSERROR),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -//=========================================================================== - -#define STATIC_KSPROPSETID_Connection \ - 0x1D58C920L, 0xAC9B, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("1D58C920-AC9B-11CF-A5D6-28DB04C10000", KSPROPSETID_Connection); -#define KSPROPSETID_Connection DEFINE_GUIDNAMED(KSPROPSETID_Connection) - -typedef enum { - KSPROPERTY_CONNECTION_STATE, - KSPROPERTY_CONNECTION_PRIORITY, - KSPROPERTY_CONNECTION_DATAFORMAT, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING, - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT, - KSPROPERTY_CONNECTION_ACQUIREORDERING, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, - KSPROPERTY_CONNECTION_STARTAT -} KSPROPERTY_CONNECTION; - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_STATE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTATE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PRIORITY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_PRIORITY,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSPRIORITY),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_DATAFORMAT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSALLOCATOR_FRAMING),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING_EX(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSALLOCATOR_FRAMING_EX),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PROPOSEDATAFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSDATAFORMAT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ACQUIREORDERING(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ACQUIREORDERING,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(int),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STARTAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_STARTAT,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSRELATIVEEVENT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -//=========================================================================== -// -// pins flags -// -#define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER 0x00000001 -#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY 0x00000002 -#define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY 0x00000004 -#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE 0x00000008 -#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY 0x80000000 - -#define KSALLOCATOR_OPTIONF_COMPATIBLE 0x00000001 -#define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY 0x00000002 -#define KSALLOCATOR_OPTIONF_VALID 0x00000003 -// -// pins extended framing flags -// -#define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT 0x00000010 -#define KSALLOCATOR_FLAG_DEVICE_SPECIFIC 0x00000020 -#define KSALLOCATOR_FLAG_CAN_ALLOCATE 0x00000040 -#define KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO 0x00000080 -// -// allocator pipes flags -// -// there is at least one data modification in a pipe -#define KSALLOCATOR_FLAG_NO_FRAME_INTEGRITY 0x00000100 -#define KSALLOCATOR_FLAG_MULTIPLE_OUTPUT 0x00000200 -#define KSALLOCATOR_FLAG_CYCLE 0x00000400 -#define KSALLOCATOR_FLAG_ALLOCATOR_EXISTS 0x00000800 -// there is no framing dependency between neighbouring pipes. -#define KSALLOCATOR_FLAG_INDEPENDENT_RANGES 0x00001000 -#define KSALLOCATOR_FLAG_ATTENTION_STEPPING 0x00002000 - - -// -// old Framing structure -// -typedef struct { - union { - ULONG OptionsFlags; // allocator options (create) - ULONG RequirementsFlags; // allocation requirements (query) - }; -#if defined(_NTDDK_) - POOL_TYPE PoolType; -#else // !_NTDDK_ - ULONG PoolType; -#endif // !_NTDDK_ - ULONG Frames; // total number of allowable outstanding frames - ULONG FrameSize; // total size of frame - ULONG FileAlignment; - ULONG Reserved; -} KSALLOCATOR_FRAMING, *PKSALLOCATOR_FRAMING; - -#if defined(_NTDDK_) -typedef -PVOID -(*PFNKSDEFAULTALLOCATE)( - IN PVOID Context - ); - -typedef -VOID -(*PFNKSDEFAULTFREE)( - IN PVOID Context, - IN PVOID Buffer - ); - -typedef -NTSTATUS -(*PFNKSINITIALIZEALLOCATOR)( - IN PVOID InitialContext, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PVOID* Context - ); - -typedef -VOID -(*PFNKSDELETEALLOCATOR)( - IN PVOID Context - ); -#endif // !_NTDDK_ - -// -// new Framing structure, eventually will replace KSALLOCATOR_FRAMING. -// -typedef struct { - ULONG MinFrameSize; - ULONG MaxFrameSize; - ULONG Stepping; -} KS_FRAMING_RANGE, *PKS_FRAMING_RANGE; - - -typedef struct { - KS_FRAMING_RANGE Range; - ULONG InPlaceWeight; - ULONG NotInPlaceWeight; -} KS_FRAMING_RANGE_WEIGHTED, *PKS_FRAMING_RANGE_WEIGHTED; - - -typedef struct { - ULONG RatioNumerator; // compression/expansion ratio - ULONG RatioDenominator; - ULONG RatioConstantMargin; -} KS_COMPRESSION, *PKS_COMPRESSION; - - -// -// Memory Types and Buses are repeated in each entry. -// Easiest to use but takes a little more memory than the varsize layout Pin\Memories\Buses\Ranges. -// -typedef struct { - GUID MemoryType; - GUID BusType; - ULONG MemoryFlags; - ULONG BusFlags; - ULONG Flags; - ULONG Frames; // total number of allowable outstanding frames - ULONG FileAlignment; - ULONG MemoryTypeWeight; // this memory type Weight pin-wide - KS_FRAMING_RANGE PhysicalRange; - KS_FRAMING_RANGE_WEIGHTED FramingRange; -} KS_FRAMING_ITEM, *PKS_FRAMING_ITEM; - - -typedef struct { - ULONG CountItems; // count of FramingItem-s below. - ULONG PinFlags; - KS_COMPRESSION OutputCompression; - ULONG PinWeight; // this pin framing's Weight graph-wide - KS_FRAMING_ITEM FramingItem[1]; -} KSALLOCATOR_FRAMING_EX, *PKSALLOCATOR_FRAMING_EX; - - - -// -// define memory type GUIDs -// -#define KSMEMORY_TYPE_WILDCARD GUID_NULL -#define STATIC_KSMEMORY_TYPE_WILDCARD STATIC_GUID_NULL - -#define KSMEMORY_TYPE_DONT_CARE GUID_NULL -#define STATIC_KSMEMORY_TYPE_DONT_CARE STATIC_GUID_NULL - -#define KS_TYPE_DONT_CARE GUID_NULL -#define STATIC_KS_TYPE_DONT_CARE STATIC_GUID_NULL - -#define STATIC_KSMEMORY_TYPE_SYSTEM \ - 0x091bb638L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("091bb638-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_SYSTEM); -#define KSMEMORY_TYPE_SYSTEM DEFINE_GUIDNAMED(KSMEMORY_TYPE_SYSTEM) - -#define STATIC_KSMEMORY_TYPE_USER \ - 0x8cb0fc28L, 0x7893, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("8cb0fc28-7893-11d1-b069-00a0c9062802", KSMEMORY_TYPE_USER); -#define KSMEMORY_TYPE_USER DEFINE_GUIDNAMED(KSMEMORY_TYPE_USER) - -#define STATIC_KSMEMORY_TYPE_KERNEL_PAGED \ - 0xd833f8f8L, 0x7894, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("d833f8f8-7894-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_PAGED); -#define KSMEMORY_TYPE_KERNEL_PAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_PAGED) - -#define STATIC_KSMEMORY_TYPE_KERNEL_NONPAGED \ - 0x4a6d5fc4L, 0x7895, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("4a6d5fc4-7895-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_NONPAGED); -#define KSMEMORY_TYPE_KERNEL_NONPAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_NONPAGED) - -// old KS clients did not specify the device memory type -#define STATIC_KSMEMORY_TYPE_DEVICE_UNKNOWN \ - 0x091bb639L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("091bb639-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_DEVICE_UNKNOWN); -#define KSMEMORY_TYPE_DEVICE_UNKNOWN DEFINE_GUIDNAMED(KSMEMORY_TYPE_DEVICE_UNKNOWN) - -// -// Helper framing macros. -// -#define DECLARE_SIMPLE_FRAMING_EX(FramingExName, MemoryType, Flags, Frames, Alignment, MinFrameSize, MaxFrameSize) \ - const KSALLOCATOR_FRAMING_EX FramingExName = \ - {\ - 1, \ - 0, \ - {\ - 1, \ - 1, \ - 0 \ - }, \ - 0, \ - {\ - {\ - MemoryType, \ - STATIC_KS_TYPE_DONT_CARE, \ - 0, \ - 0, \ - Flags, \ - Frames, \ - Alignment, \ - 0, \ - {\ - 0, \ - (ULONG)-1, \ - 1 \ - }, \ - {\ - {\ - MinFrameSize, \ - MaxFrameSize, \ - 1 \ - }, \ - 0, \ - 0 \ - }\ - }\ - }\ - } - -#define SetDefaultKsCompression(KsCompressionPointer) \ -{\ - KsCompressionPointer->RatioNumerator = 1;\ - KsCompressionPointer->RatioDenominator = 1;\ - KsCompressionPointer->RatioConstantMargin = 0;\ -} - -#define SetDontCareKsFramingRange(KsFramingRangePointer) \ -{\ - KsFramingRangePointer->MinFrameSize = 0;\ - KsFramingRangePointer->MaxFrameSize = (ULONG) -1;\ - KsFramingRangePointer->Stepping = 1;\ -} - -#define SetKsFramingRange(KsFramingRangePointer, P_MinFrameSize, P_MaxFrameSize) \ -{\ - KsFramingRangePointer->MinFrameSize = P_MinFrameSize;\ - KsFramingRangePointer->MaxFrameSize = P_MaxFrameSize;\ - KsFramingRangePointer->Stepping = 1;\ -} - -#define SetKsFramingRangeWeighted(KsFramingRangeWeightedPointer, P_MinFrameSize, P_MaxFrameSize) \ -{\ - KS_FRAMING_RANGE *KsFramingRange = &KsFramingRangeWeightedPointer->Range;\ - SetKsFramingRange(KsFramingRange, P_MinFrameSize, P_MaxFrameSize);\ - KsFramingRangeWeightedPointer->InPlaceWeight = 0;\ - KsFramingRangeWeightedPointer->NotInPlaceWeight = 0;\ -} - -#define INITIALIZE_SIMPLE_FRAMING_EX(FramingExPointer, P_MemoryType, P_Flags, P_Frames, P_Alignment, P_MinFrameSize, P_MaxFrameSize) \ -{\ - KS_COMPRESSION *KsCompression = &FramingExPointer->OutputCompression;\ - KS_FRAMING_RANGE *KsFramingRange = &FramingExPointer->FramingItem[0].PhysicalRange;\ - KS_FRAMING_RANGE_WEIGHTED *KsFramingRangeWeighted = &FramingExPointer->FramingItem[0].FramingRange;\ - FramingExPointer->CountItems = 1;\ - FramingExPointer->PinFlags = 0;\ - SetDefaultKsCompression(KsCompression);\ - FramingExPointer->PinWeight = 0;\ - FramingExPointer->FramingItem[0].MemoryType = P_MemoryType;\ - FramingExPointer->FramingItem[0].BusType = KS_TYPE_DONT_CARE;\ - FramingExPointer->FramingItem[0].MemoryFlags = 0;\ - FramingExPointer->FramingItem[0].BusFlags = 0;\ - FramingExPointer->FramingItem[0].Flags = P_Flags;\ - FramingExPointer->FramingItem[0].Frames = P_Frames;\ - FramingExPointer->FramingItem[0].FileAlignment = P_Alignment;\ - FramingExPointer->FramingItem[0].MemoryTypeWeight = 0;\ - SetDontCareKsFramingRange(KsFramingRange);\ - SetKsFramingRangeWeighted(KsFramingRangeWeighted, P_MinFrameSize, P_MaxFrameSize);\ -} - - - -// KSEVENTSETID_StreamAllocator: {75D95571-073C-11d0-A161-0020AFD156E4} - -#define STATIC_KSEVENTSETID_StreamAllocator\ - 0x75d95571L, 0x073c, 0x11d0, 0xa1, 0x61, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("75d95571-073c-11d0-a161-0020afd156e4", KSEVENTSETID_StreamAllocator); -#define KSEVENTSETID_StreamAllocator DEFINE_GUIDNAMED(KSEVENTSETID_StreamAllocator) - -typedef enum { - KSEVENT_STREAMALLOCATOR_INTERNAL_FREEFRAME, - KSEVENT_STREAMALLOCATOR_FREEFRAME -} KSEVENT_STREAMALLOCATOR; - -#define STATIC_KSMETHODSETID_StreamAllocator\ - 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("cf6e4341-ec87-11cf-a130-0020afd156e4", KSMETHODSETID_StreamAllocator); -#define KSMETHODSETID_StreamAllocator DEFINE_GUIDNAMED(KSMETHODSETID_StreamAllocator) - -typedef enum { - KSMETHOD_STREAMALLOCATOR_ALLOC, - KSMETHOD_STREAMALLOCATOR_FREE -} KSMETHOD_STREAMALLOCATOR; - -#define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMALLOCATOR_ALLOC,\ - KSMETHOD_TYPE_WRITE,\ - (Handler),\ - sizeof(KSMETHOD),\ - sizeof(PVOID),\ - NULL) - -#define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMALLOCATOR_FREE,\ - KSMETHOD_TYPE_READ,\ - (Handler),\ - sizeof(KSMETHOD),\ - sizeof(PVOID),\ - NULL) - -#define DEFINE_KSMETHOD_ALLOCATORSET(AllocatorSet, MethodAlloc, MethodFree)\ -DEFINE_KSMETHOD_TABLE(AllocatorSet) {\ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(MethodAlloc),\ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(MethodFree)\ -} - -#define STATIC_KSPROPSETID_StreamAllocator\ - 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("cf6e4342-ec87-11cf-a130-0020afd156e4", KSPROPSETID_StreamAllocator); -#define KSPROPSETID_StreamAllocator DEFINE_GUIDNAMED(KSPROPSETID_StreamAllocator) - -#if defined(_NTDDK_) -typedef enum { - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE, - KSPROPERTY_STREAMALLOCATOR_STATUS -} KSPROPERTY_STREAMALLOCATOR; - -#define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMALLOCATOR_STATUS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTREAMALLOCATOR_STATUS),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ALLOCATORSET(AllocatorSet, PropFunctionTable, PropStatus)\ -DEFINE_KSPROPERTY_TABLE(AllocatorSet) {\ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(PropStatus),\ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(PropFunctionTable)\ -} - -typedef -NTSTATUS -(*PFNALLOCATOR_ALLOCATEFRAME)( - IN PFILE_OBJECT FileObject, - PVOID *Frame - ); - -typedef -VOID -(*PFNALLOCATOR_FREEFRAME)( - IN PFILE_OBJECT FileObject, - IN PVOID Frame - ); - -typedef struct { - PFNALLOCATOR_ALLOCATEFRAME AllocateFrame; - PFNALLOCATOR_FREEFRAME FreeFrame; -} KSSTREAMALLOCATOR_FUNCTIONTABLE, *PKSSTREAMALLOCATOR_FUNCTIONTABLE; -#endif // defined(_NTDDK_) - -typedef struct { - KSALLOCATOR_FRAMING Framing; - ULONG AllocatedFrames; - ULONG Reserved; -} KSSTREAMALLOCATOR_STATUS, *PKSSTREAMALLOCATOR_STATUS; - -typedef struct { - KSALLOCATOR_FRAMING_EX Framing; - ULONG AllocatedFrames; - ULONG Reserved; -} KSSTREAMALLOCATOR_STATUS_EX, *PKSSTREAMALLOCATOR_STATUS_EX; - - -#define KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT 0x00000001 -#define KSSTREAM_HEADER_OPTIONSF_PREROLL 0x00000002 -#define KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY 0x00000004 -#define KSSTREAM_HEADER_OPTIONSF_TYPECHANGED 0x00000008 -#define KSSTREAM_HEADER_OPTIONSF_TIMEVALID 0x00000010 -#define KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY 0x00000040 -#define KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE 0x00000080 -#define KSSTREAM_HEADER_OPTIONSF_DURATIONVALID 0x00000100 -#define KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM 0x00000200 -#define KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA 0x80000000 - -typedef struct { - LONGLONG Time; - ULONG Numerator; - ULONG Denominator; -} KSTIME, *PKSTIME; - -typedef struct { - ULONG Size; - ULONG TypeSpecificFlags; - KSTIME PresentationTime; - LONGLONG Duration; - ULONG FrameExtent; - ULONG DataUsed; - PVOID Data; - ULONG OptionsFlags; -#if _WIN64 - ULONG Reserved; -#endif -} KSSTREAM_HEADER, *PKSSTREAM_HEADER; - -#define STATIC_KSPROPSETID_StreamInterface\ - 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a -DEFINE_GUIDSTRUCT("1fdd8ee1-9cd3-11d0-82aa-0000f822fe8a", KSPROPSETID_StreamInterface); -#define KSPROPSETID_StreamInterface DEFINE_GUIDNAMED(KSPROPSETID_StreamInterface) - -typedef enum { - KSPROPERTY_STREAMINTERFACE_HEADERSIZE -} KSPROPERTY_STREAMINTERFACE; - -#define DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE( GetHandler )\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMINTERFACE_HEADERSIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_STREAMINTERFACESET(StreamInterfaceSet,\ - HeaderSizeHandler)\ -DEFINE_KSPROPERTY_TABLE(StreamInterfaceSet) {\ - DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE( HeaderSizeHandler )\ -} - -#define STATIC_KSPROPSETID_Stream\ - 0x65aaba60L, 0x98ae, 0x11cf, 0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("65aaba60-98ae-11cf-a10d-0020afd156e4", KSPROPSETID_Stream); -#define KSPROPSETID_Stream DEFINE_GUIDNAMED(KSPROPSETID_Stream) - -typedef enum { - KSPROPERTY_STREAM_ALLOCATOR, - KSPROPERTY_STREAM_QUALITY, - KSPROPERTY_STREAM_DEGRADATION, - KSPROPERTY_STREAM_MASTERCLOCK, - KSPROPERTY_STREAM_TIMEFORMAT, - KSPROPERTY_STREAM_PRESENTATIONTIME, - KSPROPERTY_STREAM_PRESENTATIONEXTENT, - KSPROPERTY_STREAM_FRAMETIME, - KSPROPERTY_STREAM_RATECAPABILITY, - KSPROPERTY_STREAM_RATE, - KSPROPERTY_STREAM_PIPE_ID -} KSPROPERTY_STREAM; - -#define DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_ALLOCATOR,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_QUALITY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_QUALITY,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSQUALITY_MANAGER),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_DEGRADATION(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_DEGRADATION,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_MASTERCLOCK,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_TIMEFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_TIMEFORMAT,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONTIME(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PRESENTATIONTIME,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSTIME),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONEXTENT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PRESENTATIONEXTENT,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_FRAMETIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_FRAMETIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSFRAMETIME),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_RATECAPABILITY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_RATECAPABILITY,\ - (Handler),\ - sizeof(KSRATE_CAPABILITY),\ - sizeof(KSRATE),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_RATE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSRATE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PIPE_ID,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -typedef struct { - HANDLE QualityManager; - PVOID Context; -} KSQUALITY_MANAGER, *PKSQUALITY_MANAGER; - -typedef struct { - LONGLONG Duration; - ULONG FrameFlags; - ULONG Reserved; -} KSFRAMETIME, *PKSFRAMETIME; - -#define KSFRAMETIME_VARIABLESIZE 0x00000001 - -typedef struct { - LONGLONG PresentationStart; - LONGLONG Duration; - KSPIN_INTERFACE Interface; - LONG Rate; - ULONG Flags; -} KSRATE, *PKSRATE; - -#define KSRATE_NOPRESENTATIONSTART 0x00000001 -#define KSRATE_NOPRESENTATIONDURATION 0x00000002 - -typedef struct { - KSPROPERTY Property; - KSRATE Rate; -} KSRATE_CAPABILITY, *PKSRATE_CAPABILITY; - -#define STATIC_KSPROPSETID_Clock \ - 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("DF12A4C0-AC17-11CF-A5D6-28DB04C10000", KSPROPSETID_Clock); -#define KSPROPSETID_Clock DEFINE_GUIDNAMED(KSPROPSETID_Clock) - -// -// Performs a x*y/z operation on 64 bit quantities by splitting the operation. The equation -// is simplified with respect to adding in the remainder for the upper 32 bits. -// -// (xh * 10000000 / Frequency) * 2^32 + ((((xh * 10000000) % Frequency) * 2^32 + (xl * 10000000)) / Frequency) -// -#define NANOSECONDS 10000000 -#define KSCONVERT_PERFORMANCE_TIME(Frequency, PerformanceTime) \ - ((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS / (Frequency)) << 32) + \ - ((((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS) % (Frequency)) << 32) + \ - ((ULONGLONG)(PerformanceTime).LowPart * NANOSECONDS)) / (Frequency))) - -typedef struct { - ULONG CreateFlags; -} KSCLOCK_CREATE, *PKSCLOCK_CREATE; - -typedef struct { - LONGLONG Time; - LONGLONG SystemTime; -} KSCORRELATED_TIME, *PKSCORRELATED_TIME; - -typedef struct { - LONGLONG Granularity; - LONGLONG Error; -} KSRESOLUTION, *PKSRESOLUTION; - -typedef enum { - KSPROPERTY_CLOCK_TIME, - KSPROPERTY_CLOCK_PHYSICALTIME, - KSPROPERTY_CLOCK_CORRELATEDTIME, - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME, - KSPROPERTY_CLOCK_RESOLUTION, - KSPROPERTY_CLOCK_STATE, -#if defined(_NTDDK_) - KSPROPERTY_CLOCK_FUNCTIONTABLE -#endif // defined(_NTDDK_) -} KSPROPERTY_CLOCK; - -#if defined(_NTDDK_) - -typedef -LONGLONG -(FASTCALL *PFNKSCLOCK_GETTIME)( - IN PFILE_OBJECT FileObject - ); -typedef -LONGLONG -(FASTCALL *PFNKSCLOCK_CORRELATEDTIME)( - IN PFILE_OBJECT FileObject, - OUT PLONGLONG SystemTime); - -typedef struct { - PFNKSCLOCK_GETTIME GetTime; - PFNKSCLOCK_GETTIME GetPhysicalTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedPhysicalTime; -} KSCLOCK_FUNCTIONTABLE, *PKSCLOCK_FUNCTIONTABLE; - -typedef -BOOLEAN -(*PFNKSSETTIMER)( - IN PVOID Context, - IN PKTIMER Timer, - IN LARGE_INTEGER DueTime, - IN PKDPC Dpc - ); - -typedef -BOOLEAN -(*PFNKSCANCELTIMER)( - IN PVOID Context, - IN PKTIMER Timer - ); - -typedef -LONGLONG -(FASTCALL *PFNKSCORRELATEDTIME)( - IN PVOID Context, - OUT PLONGLONG SystemTime); - -typedef PVOID PKSDEFAULTCLOCK; - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_TIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_PHYSICALTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_CORRELATEDTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCORRELATED_TIME),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCORRELATED_TIME),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_RESOLUTION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSRESOLUTION),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_STATE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTATE),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_FUNCTIONTABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCLOCK_FUNCTIONTABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_CLOCKSET(ClockSet,\ - PropTime, PropPhysicalTime,\ - PropCorrelatedTime, PropCorrelatedPhysicalTime,\ - PropResolution, PropState, PropFunctionTable)\ -DEFINE_KSPROPERTY_TABLE(ClockSet) {\ - DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(PropTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(PropPhysicalTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(PropCorrelatedTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(PropCorrelatedPhysicalTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(PropResolution),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(PropState),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(PropFunctionTable),\ -} - -#endif // defined(_NTDDK_) - -#define STATIC_KSEVENTSETID_Clock \ - 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("364D8E20-62C7-11CF-A5D6-28DB04C10000", KSEVENTSETID_Clock); -#define KSEVENTSETID_Clock DEFINE_GUIDNAMED(KSEVENTSETID_Clock) - -typedef enum { - KSEVENT_CLOCK_INTERVAL_MARK, - KSEVENT_CLOCK_POSITION_MARK -} KSEVENT_CLOCK_POSITION; - -#define STATIC_KSEVENTSETID_Connection\ - 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("7f4bcbe0-9ea5-11cf-a5d6-28db04c10000", KSEVENTSETID_Connection); -#define KSEVENTSETID_Connection DEFINE_GUIDNAMED(KSEVENTSETID_Connection) - -typedef enum { - KSEVENT_CONNECTION_POSITIONUPDATE, - KSEVENT_CONNECTION_DATADISCONTINUITY, - KSEVENT_CONNECTION_TIMEDISCONTINUITY, - KSEVENT_CONNECTION_PRIORITY, - KSEVENT_CONNECTION_ENDOFSTREAM -} KSEVENT_CONNECTION; - -typedef struct { - PVOID Context; - ULONG Proportion; - LONGLONG DeltaTime; -} KSQUALITY, *PKSQUALITY; - -typedef struct { - PVOID Context; - ULONG Status; -} KSERROR, *PKSERROR; - -typedef KSIDENTIFIER KSDEGRADE, *PKSDEGRADE; - -#define STATIC_KSDEGRADESETID_Standard\ - 0x9F564180L, 0x704C, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("9F564180-704C-11D0-A5D6-28DB04C10000", KSDEGRADESETID_Standard); -#define KSDEGRADESETID_Standard DEFINE_GUIDNAMED(KSDEGRADESETID_Standard) - -typedef enum { - KSDEGRADE_STANDARD_SAMPLE, - KSDEGRADE_STANDARD_QUALITY, - KSDEGRADE_STANDARD_COMPUTATION, - KSDEGRADE_STANDARD_SKIP -} KSDEGRADE_STANDARD; - -#if defined(_NTDDK_) - -#define KSPROBE_STREAMREAD 0x00000000 -#define KSPROBE_STREAMWRITE 0x00000001 -#define KSPROBE_ALLOCATEMDL 0x00000010 -#define KSPROBE_PROBEANDLOCK 0x00000020 -#define KSPROBE_SYSTEMADDRESS 0x00000040 -#define KSPROBE_MODIFY 0x00000200 -#define KSPROBE_STREAMWRITEMODIFY (KSPROBE_MODIFY | KSPROBE_STREAMWRITE) -#define KSPROBE_ALLOWFORMATCHANGE 0x00000080 - -#define KSSTREAM_READ KSPROBE_STREAMREAD -#define KSSTREAM_WRITE KSPROBE_STREAMWRITE -#define KSSTREAM_PAGED_DATA 0x00000000 -#define KSSTREAM_NONPAGED_DATA 0x00000100 -#define KSSTREAM_SYNCHRONOUS 0x00001000 -#define KSSTREAM_FAILUREEXCEPTION 0x00002000 - -typedef -NTSTATUS -(*PFNKSCONTEXT_DISPATCH)( - IN PVOID Context, - IN PIRP Irp - ); - -typedef -NTSTATUS -(*PFNKSHANDLER)( - IN PIRP Irp, - IN PKSIDENTIFIER Request, - IN OUT PVOID Data - ); - -typedef -BOOLEAN -(*PFNKSFASTHANDLER)( - IN PFILE_OBJECT FileObject, - IN PKSIDENTIFIER Request, - IN ULONG RequestLength, - IN OUT PVOID Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus - ); - -typedef -NTSTATUS -(*PFNKSALLOCATOR)( - IN PIRP Irp, - IN ULONG BufferSize, - IN BOOLEAN InputOperation - ); - -typedef struct { - KSPROPERTY_MEMBERSHEADER MembersHeader; - const VOID* Members; -} KSPROPERTY_MEMBERSLIST, *PKSPROPERTY_MEMBERSLIST; - -typedef struct { - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - const KSPROPERTY_MEMBERSLIST* MembersList; -} KSPROPERTY_VALUES, *PKSPROPERTY_VALUES; - -#define DEFINE_KSPROPERTY_TABLE(tablename)\ - const KSPROPERTY_ITEM tablename[] = - -#define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\ - MinProperty,\ - MinData,\ - SetHandler,\ - Values, RelationsCount, Relations, SupportHandler,\ - SerializedSize)\ -{\ - PropertyId, (PFNKSHANDLER)GetHandler, MinProperty, MinData,\ - (PFNKSHANDLER)SetHandler,\ - (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\ - (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\ -} - -typedef struct { - ULONG PropertyId; - union { - PFNKSHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - ULONG MinProperty; - ULONG MinData; - union { - PFNKSHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - const KSPROPERTY_VALUES*Values; - ULONG RelationsCount; - const KSPROPERTY* Relations; - PFNKSHANDLER SupportHandler; - ULONG SerializedSize; -} KSPROPERTY_ITEM, *PKSPROPERTY_ITEM; - -#define DEFINE_KSFASTPROPERTY_ITEM(PropertyId, GetHandler, SetHandler)\ -{\ - PropertyId, (PFNKSFASTHANDLER)GetHandler, (PFNKSFASTHANDLER)SetHandler, 0\ -} - -typedef struct { - ULONG PropertyId; - union { - PFNKSFASTHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - union { - PFNKSFASTHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - ULONG Reserved; -} KSFASTPROPERTY_ITEM, *PKSFASTPROPERTY_ITEM; - -#define DEFINE_KSPROPERTY_SET(Set,\ - PropertiesCount,\ - PropertyItem,\ - FastIoCount,\ - FastIoTable)\ -{\ - Set,\ - PropertiesCount,\ - PropertyItem,\ - FastIoCount,\ - FastIoTable\ -} - -#define DEFINE_KSPROPERTY_SET_TABLE(tablename)\ - const KSPROPERTY_SET tablename[] = - -typedef struct { - const GUID* Set; - ULONG PropertiesCount; - const KSPROPERTY_ITEM* PropertyItem; - ULONG FastIoCount; - const KSFASTPROPERTY_ITEM* FastIoTable; -} KSPROPERTY_SET, *PKSPROPERTY_SET; - -#define DEFINE_KSMETHOD_TABLE(tablename)\ - const KSMETHOD_ITEM tablename[] = - -#define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\ - MethodHandler,\ - MinMethod, MinData, SupportHandler)\ -{\ - MethodId, (PFNKSHANDLER)MethodHandler, MinMethod, MinData,\ - SupportHandler, Flags\ -} - -typedef struct { - ULONG MethodId; - union { - PFNKSHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; - ULONG MinMethod; - ULONG MinData; - PFNKSHANDLER SupportHandler; - ULONG Flags; -} KSMETHOD_ITEM, *PKSMETHOD_ITEM; - -#define DEFINE_KSFASTMETHOD_ITEM(MethodId, MethodHandler)\ -{\ - MethodId, (PFNKSFASTHANDLER)MethodHandler\ -} - -typedef struct { - ULONG MethodId; - union { - PFNKSFASTHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; -} KSFASTMETHOD_ITEM, *PKSFASTMETHOD_ITEM; - -#define DEFINE_KSMETHOD_SET(Set,\ - MethodsCount,\ - MethodItem,\ - FastIoCount,\ - FastIoTable)\ -{\ - Set,\ - MethodsCount,\ - MethodItem,\ - FastIoCount,\ - FastIoTable\ -} - -#define DEFINE_KSMETHOD_SET_TABLE(tablename)\ - const KSMETHOD_SET tablename[] = - -typedef struct { - const GUID* Set; - ULONG MethodsCount; - const KSMETHOD_ITEM* MethodItem; - ULONG FastIoCount; - const KSFASTMETHOD_ITEM*FastIoTable; -} KSMETHOD_SET, *PKSMETHOD_SET; - -typedef struct _KSEVENT_ENTRY -KSEVENT_ENTRY, *PKSEVENT_ENTRY; - -typedef -NTSTATUS -(*PFNKSADDEVENT)( - IN PIRP Irp, - IN PKSEVENTDATA EventData, - IN struct _KSEVENT_ENTRY* EventEntry - ); - -typedef -VOID -(*PFNKSREMOVEEVENT)( - IN PFILE_OBJECT FileObject, - IN struct _KSEVENT_ENTRY* EventEntry - ); - -#define DEFINE_KSEVENT_TABLE(tablename)\ - const KSEVENT_ITEM tablename[] = - -#define DEFINE_KSEVENT_ITEM(EventId, DataInput, ExtraEntryData,\ - AddHandler, RemoveHandler, SupportHandler)\ -{\ - EventId,\ - DataInput,\ - ExtraEntryData,\ - AddHandler,\ - RemoveHandler,\ - SupportHandler\ -} - -typedef struct { - ULONG EventId; - ULONG DataInput; - ULONG ExtraEntryData; - PFNKSADDEVENT AddHandler; - PFNKSREMOVEEVENT RemoveHandler; - PFNKSHANDLER SupportHandler; -} KSEVENT_ITEM, *PKSEVENT_ITEM; - -#define DEFINE_KSEVENT_SET(Set,\ - EventsCount,\ - EventItem)\ -{\ - Set, EventsCount, EventItem\ -} - -#define DEFINE_KSEVENT_SET_TABLE(tablename)\ - const KSEVENT_SET tablename[] = - -typedef struct { - const GUID* Set; - ULONG EventsCount; - const KSEVENT_ITEM* EventItem; -} KSEVENT_SET, *PKSEVENT_SET; - -typedef struct { - KDPC Dpc; - ULONG ReferenceCount; - KSPIN_LOCK AccessLock; -} KSDPC_ITEM, *PKSDPC_ITEM; - -typedef struct { - KSDPC_ITEM DpcItem; - LIST_ENTRY BufferList; -} KSBUFFER_ITEM, *PKSBUFFER_ITEM; - -#define KSEVENT_ENTRY_DELETED 1 -#define KSEVENT_ENTRY_ONESHOT 2 -#define KSEVENT_ENTRY_BUFFERED 4 - -struct _KSEVENT_ENTRY { - LIST_ENTRY ListEntry; - PVOID Object; - union { - PKSDPC_ITEM DpcItem; - PKSBUFFER_ITEM BufferItem; - }; - PKSEVENTDATA EventData; - ULONG NotificationType; - const KSEVENT_SET* EventSet; - const KSEVENT_ITEM* EventItem; - PFILE_OBJECT FileObject; - ULONG SemaphoreAdjustment; - ULONG Reserved; - ULONG Flags; -}; - -typedef enum { - KSEVENTS_NONE, - KSEVENTS_SPINLOCK, - KSEVENTS_MUTEX, - KSEVENTS_FMUTEX, - KSEVENTS_FMUTEXUNSAFE, - KSEVENTS_INTERRUPT, - KSEVENTS_ERESOURCE -} KSEVENTS_LOCKTYPE; - -#define KSDISPATCH_FASTIO 0x80000000 - -typedef struct { - PDRIVER_DISPATCH Create; - PVOID Context; - UNICODE_STRING ObjectClass; - PSECURITY_DESCRIPTOR SecurityDescriptor; - ULONG Flags; -} KSOBJECT_CREATE_ITEM, *PKSOBJECT_CREATE_ITEM; - -typedef -VOID -(*PFNKSITEMFREECALLBACK)( - IN PKSOBJECT_CREATE_ITEM CreateItem - ); - -#define KSCREATE_ITEM_SECURITYCHANGED 0x00000001 -#define KSCREATE_ITEM_WILDCARD 0x00000002 -#define KSCREATE_ITEM_NOPARAMETERS 0x00000004 -#define KSCREATE_ITEM_FREEONSTOP 0x00000008 - -#define DEFINE_KSCREATE_DISPATCH_TABLE( tablename )\ - KSOBJECT_CREATE_ITEM tablename[] = - -#define DEFINE_KSCREATE_ITEM(DispatchCreate, TypeName, Context)\ -{\ - (DispatchCreate),\ - (PVOID)(Context),\ - {\ - sizeof(TypeName) - sizeof(UNICODE_NULL),\ - sizeof(TypeName),\ - (PWCHAR)(TypeName)\ - },\ - NULL, 0\ -} - -#define DEFINE_KSCREATE_ITEMEX(DispatchCreate, TypeName, Context, Flags)\ -{\ - (DispatchCreate),\ - (PVOID)(Context),\ - {\ - sizeof(TypeName) - sizeof(UNICODE_NULL),\ - sizeof(TypeName),\ - (PWCHAR)(TypeName)\ - },\ - NULL, (Flags)\ -} - -#define DEFINE_KSCREATE_ITEMNULL( DispatchCreate, Context )\ -{\ - DispatchCreate,\ - Context,\ - {\ - 0,\ - 0,\ - NULL,\ - },\ - NULL, 0\ -} - -typedef struct { - ULONG CreateItemsCount; - PKSOBJECT_CREATE_ITEM CreateItemsList; -} KSOBJECT_CREATE, *PKSOBJECT_CREATE; - -typedef struct { - PDRIVER_DISPATCH DeviceIoControl; - PDRIVER_DISPATCH Read; - PDRIVER_DISPATCH Write; - PDRIVER_DISPATCH Flush; - PDRIVER_DISPATCH Close; - PDRIVER_DISPATCH QuerySecurity; - PDRIVER_DISPATCH SetSecurity; - PFAST_IO_DEVICE_CONTROL FastDeviceIoControl; - PFAST_IO_READ FastRead; - PFAST_IO_WRITE FastWrite; -} KSDISPATCH_TABLE, *PKSDISPATCH_TABLE; - -#define DEFINE_KSDISPATCH_TABLE( tablename, DeviceIoControl, Read, Write,\ - Flush, Close, QuerySecurity, SetSecurity,\ - FastDeviceIoControl, FastRead, FastWrite )\ - const KSDISPATCH_TABLE tablename = \ - {\ - DeviceIoControl, \ - Read, \ - Write, \ - Flush, \ - Close, \ - QuerySecurity, \ - SetSecurity, \ - FastDeviceIoControl, \ - FastRead, \ - FastWrite, \ - } - -#define KSCREATE_ITEM_IRP_STORAGE(Irp) (*(PKSOBJECT_CREATE_ITEM*)&(Irp)->Tail.Overlay.DriverContext[0]) -#define KSEVENT_SET_IRP_STORAGE(Irp) (*(const KSEVENT_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) -#define KSEVENT_ITEM_IRP_STORAGE(Irp) (*(const KSEVENT_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) -#define KSEVENT_ENTRY_IRP_STORAGE(Irp) (*(PKSEVENT_ENTRY*)&(Irp)->Tail.Overlay.DriverContext[0]) -#define KSMETHOD_SET_IRP_STORAGE(Irp) (*(const KSMETHOD_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) -#define KSMETHOD_ITEM_IRP_STORAGE(Irp) (*(const KSMETHOD_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) -#define KSMETHOD_TYPE_IRP_STORAGE(Irp) (*(ULONG_PTR*)(&(Irp)->Tail.Overlay.DriverContext[2])) -#define KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) (*(PKSPIN_LOCK*)&(Irp)->Tail.Overlay.DriverContext[1]) -#define KSPROPERTY_SET_IRP_STORAGE(Irp) (*(const KSPROPERTY_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) -#define KSPROPERTY_ITEM_IRP_STORAGE(Irp) (*(const KSPROPERTY_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) -#define KSPROPERTY_ATTRIBUTES_IRP_STORAGE(Irp) (*(PKSATTRIBUTE_LIST*)&(Irp)->Tail.Overlay.DriverContext[2]) - -typedef PVOID KSDEVICE_HEADER, KSOBJECT_HEADER; - -typedef enum { - KsInvokeOnSuccess = 1, - KsInvokeOnError = 2, - KsInvokeOnCancel = 4 -} KSCOMPLETION_INVOCATION; - -typedef enum { - KsListEntryTail, - KsListEntryHead -} KSLIST_ENTRY_LOCATION; - -typedef enum { - KsAcquireOnly, - KsAcquireAndRemove, - KsAcquireOnlySingleItem, - KsAcquireAndRemoveOnlySingleItem -} KSIRP_REMOVAL_OPERATION; - -typedef enum { - KsStackCopyToNewLocation, - KsStackReuseCurrentLocation, - KsStackUseNewLocation -} KSSTACK_USE; - -typedef enum { - KSTARGET_STATE_DISABLED, - KSTARGET_STATE_ENABLED -} KSTARGET_STATE; - -typedef -NTSTATUS -(*PFNKSIRPLISTCALLBACK)( - IN PIRP Irp, - IN PVOID Context - ); - -typedef -VOID -(*PFNREFERENCEDEVICEOBJECT)( - IN PVOID Context - ); - -typedef -VOID -(*PFNDEREFERENCEDEVICEOBJECT)( - IN PVOID Context - ); - -typedef -NTSTATUS -(*PFNQUERYREFERENCESTRING)( - IN PVOID Context, - IN OUT PWCHAR *String - ); - -#define BUS_INTERFACE_REFERENCE_VERSION 0x100 - -typedef struct { - // - // Standard interface header - // - - INTERFACE Interface; - - // - // Standard bus interfaces - // - - PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject; - PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject; - PFNQUERYREFERENCESTRING QueryReferenceString; - -} BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE; - -#define STATIC_REFERENCE_BUS_INTERFACE STATIC_KSMEDIUMSETID_Standard -#define REFERENCE_BUS_INTERFACE KSMEDIUMSETID_Standard - -typedef -NTSTATUS -(*PFNQUERYMEDIUMSLIST)( - IN PVOID Context, - OUT ULONG* MediumsCount, - OUT PKSPIN_MEDIUM* MediumList - ); - -typedef struct { - // - // Standard interface header - // - - INTERFACE Interface; - - // - // Interface definition - // - - PFNQUERYMEDIUMSLIST QueryMediumsList; - -} BUS_INTERFACE_MEDIUMS, *PBUS_INTERFACE_MEDIUMS; - -#define STATIC_GUID_BUS_INTERFACE_MEDIUMS \ - 0x4EC35C3EL, 0x201B, 0x11D2, 0x87, 0x45, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("4EC35C3E-201B-11D2-8745-00A0C9223196", GUID_BUS_INTERFACE_MEDIUMS); -#define GUID_BUS_INTERFACE_MEDIUMS DEFINE_GUIDNAMED(GUID_BUS_INTERFACE_MEDIUMS) - -#endif // defined(_NTDDK_) - -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif - -typedef struct { - GUID PropertySet; - ULONG Count; -} KSPROPERTY_SERIALHDR, *PKSPROPERTY_SERIALHDR; - -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif - -typedef struct { - KSIDENTIFIER PropTypeSet; - ULONG Id; - ULONG PropertyLength; -} KSPROPERTY_SERIAL, *PKSPROPERTY_SERIAL; - -#if defined(_NTDDK_) - -#define IOCTL_KS_HANDSHAKE CTL_CODE(FILE_DEVICE_KS, 0x007, METHOD_NEITHER, FILE_ANY_ACCESS) - -typedef struct { - GUID ProtocolId; - PVOID Argument1; - PVOID Argument2; -} KSHANDSHAKE, *PKSHANDSHAKE; - -typedef struct _KSGATE -KSGATE, *PKSGATE; - -struct _KSGATE { - LONG Count; - PKSGATE NextGate; -}; - -#ifndef _NTOS_ - -void __inline -KsGateTurnInputOn( - IN PKSGATE Gate OPTIONAL - ) -{ - while (Gate && (InterlockedIncrement(&Gate->Count) == 1)) { - Gate = Gate->NextGate; - } -} - -void __inline -KsGateTurnInputOff( - IN PKSGATE Gate OPTIONAL - ) -{ - while (Gate && (InterlockedDecrement(&Gate->Count) == 0)) { - Gate = Gate->NextGate; - } -} - -BOOLEAN __inline -KsGateGetStateUnsafe( - IN PKSGATE Gate - ) -{ - ASSERT(Gate); - return Gate->Count > 0; -} - -BOOLEAN __inline -KsGateCaptureThreshold( - IN PKSGATE Gate - ) -{ - BOOLEAN captured; - - ASSERT(Gate); - - captured = (BOOLEAN)(InterlockedCompareExchange(&Gate->Count,0,1) == 1); - - // - // If we made a transition, it must be propagated. - // - if (captured) { - KsGateTurnInputOff(Gate->NextGate); - } - - // - // We return whatever the state was prior to the compare/exchange. If - // the state was on, the state is now off. - // - return captured; -} - -void __inline -KsGateInitialize( - IN PKSGATE Gate, - IN LONG InitialCount, - IN PKSGATE NextGate OPTIONAL, - IN BOOLEAN StateToPropagate // IN BOOLEAN NextGateIsAnOrGate - ) -{ - ASSERT(Gate); - Gate->Count = InitialCount; - Gate->NextGate = NextGate; - - if (NextGate) { - if (InitialCount > 0) { - if (StateToPropagate) { - KsGateTurnInputOn(NextGate); - } - } else { - if (! StateToPropagate) { - KsGateTurnInputOff(NextGate); - } - } - } -} - -void __inline -KsGateInitializeAnd( - IN PKSGATE AndGate, - IN PKSGATE NextOrGate OPTIONAL - ) -{ - KsGateInitialize(AndGate,1,NextOrGate,TRUE); -} - -void __inline -KsGateInitializeOr( - IN PKSGATE OrGate, - IN PKSGATE NextAndGate OPTIONAL - ) -{ - KsGateInitialize(OrGate,0,NextAndGate,FALSE); -} - -void __inline KsGateAddOnInputToAnd(IN PKSGATE AndGate) { UNREFERENCED_PARAMETER (AndGate); } -void __inline KsGateAddOffInputToAnd(IN PKSGATE AndGate) { KsGateTurnInputOff(AndGate); } -void __inline KsGateRemoveOnInputFromAnd(IN PKSGATE AndGate) { UNREFERENCED_PARAMETER (AndGate); } -void __inline KsGateRemoveOffInputFromAnd(IN PKSGATE AndGate) { KsGateTurnInputOn(AndGate); } - -void __inline KsGateAddOnInputToOr(IN PKSGATE OrGate) { KsGateTurnInputOn(OrGate); } -void __inline KsGateAddOffInputToOr(IN PKSGATE OrGate) { UNREFERENCED_PARAMETER (OrGate); } -void __inline KsGateRemoveOnInputFromOr(IN PKSGATE OrGate) { KsGateTurnInputOff(OrGate); } -void __inline KsGateRemoveOffInputFromOr(IN PKSGATE OrGate) { UNREFERENCED_PARAMETER (OrGate); } - -void __inline -KsGateTerminateAnd( - IN PKSGATE AndGate - ) -{ - ASSERT(AndGate); - if (KsGateGetStateUnsafe(AndGate)) { - KsGateRemoveOnInputFromOr(AndGate->NextGate); - } else { - KsGateRemoveOffInputFromOr(AndGate->NextGate); - } -} - -void __inline -KsGateTerminateOr( - IN PKSGATE OrGate - ) -{ - ASSERT(OrGate); - if (KsGateGetStateUnsafe(OrGate)) { - KsGateRemoveOnInputFromAnd(OrGate->NextGate); - } else { - KsGateRemoveOffInputFromAnd(OrGate->NextGate); - } -} - -#endif // !_NTOS_ - -typedef PVOID KSOBJECT_BAG; - -typedef -BOOLEAN -(*PFNKSGENERATEEVENTCALLBACK)( - IN PVOID Context, - IN PKSEVENT_ENTRY EventEntry - ); - -typedef -NTSTATUS -(*PFNKSDEVICECREATE)( - IN PKSDEVICE Device - ); -typedef -NTSTATUS -(*PFNKSDEVICEPNPSTART)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN PCM_RESOURCE_LIST TranslatedResourceList OPTIONAL, - IN PCM_RESOURCE_LIST UntranslatedResourceList OPTIONAL - ); -typedef -NTSTATUS -(*PFNKSDEVICE)( - IN PKSDEVICE Device - ); -typedef -NTSTATUS -(*PFNKSDEVICEIRP)( - IN PKSDEVICE Device, - IN PIRP Irp - ); -typedef -void -(*PFNKSDEVICEIRPVOID)( - IN PKSDEVICE Device, - IN PIRP Irp - ); -typedef -NTSTATUS -(*PFNKSDEVICEQUERYCAPABILITIES)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN OUT PDEVICE_CAPABILITIES Capabilities - ); -typedef -NTSTATUS -(*PFNKSDEVICEQUERYPOWER)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN DEVICE_POWER_STATE DeviceTo, - IN DEVICE_POWER_STATE DeviceFrom, - IN SYSTEM_POWER_STATE SystemTo, - IN SYSTEM_POWER_STATE SystemFrom, - IN POWER_ACTION Action - ); -typedef -void -(*PFNKSDEVICESETPOWER)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN DEVICE_POWER_STATE To, - IN DEVICE_POWER_STATE From - ); -typedef -NTSTATUS -(*PFNKSFILTERFACTORYVOID)( - IN PKSFILTERFACTORY FilterFactory - ); -typedef -void -(*PFNKSFILTERFACTORYPOWER)( - IN PKSFILTERFACTORY FilterFactory, - IN DEVICE_POWER_STATE State - ); -typedef -NTSTATUS -(*PFNKSFILTERIRP)( - IN PKSFILTER Filter, - IN PIRP Irp - ); -typedef -NTSTATUS -(*PFNKSFILTERPROCESS)( - IN PKSFILTER Filter, - IN PKSPROCESSPIN_INDEXENTRY Index - ); -typedef -NTSTATUS -(*PFNKSFILTERVOID)( - IN PKSFILTER Filter - ); -typedef -void -(*PFNKSFILTERPOWER)( - IN PKSFILTER Filter, - IN DEVICE_POWER_STATE State - ); -typedef -NTSTATUS -(*PFNKSPINIRP)( - IN PKSPIN Pin, - IN PIRP Irp - ); -typedef -NTSTATUS -(*PFNKSPINSETDEVICESTATE)( - IN PKSPIN Pin, - IN KSSTATE ToState, - IN KSSTATE FromState - ); -typedef -NTSTATUS -(*PFNKSPINSETDATAFORMAT)( - IN PKSPIN Pin, - IN PKSDATAFORMAT OldFormat OPTIONAL, - IN PKSMULTIPLE_ITEM OldAttributeList OPTIONAL, - IN const KSDATARANGE* DataRange, - IN const KSATTRIBUTE_LIST* AttributeRange OPTIONAL - ); -typedef -NTSTATUS -(*PFNKSPINHANDSHAKE)( - IN PKSPIN Pin, - IN PKSHANDSHAKE In, - IN PKSHANDSHAKE Out - ); -typedef -NTSTATUS -(*PFNKSPIN)( - IN PKSPIN Pin - ); -typedef -void -(*PFNKSPINVOID)( - IN PKSPIN Pin - ); -typedef -void -(*PFNKSPINPOWER)( - IN PKSPIN Pin, - IN DEVICE_POWER_STATE State - ); -typedef -BOOLEAN -(*PFNKSPINSETTIMER)( - IN PKSPIN Pin, - IN PKTIMER Timer, - IN LARGE_INTEGER DueTime, - IN PKDPC Dpc - ); -typedef -BOOLEAN -(*PFNKSPINCANCELTIMER)( - IN PKSPIN Pin, - IN PKTIMER Timer - ); -typedef -LONGLONG -(FASTCALL *PFNKSPINCORRELATEDTIME)( - IN PKSPIN Pin, - OUT PLONGLONG SystemTime - ); -typedef -void -(*PFNKSPINRESOLUTION)( - IN PKSPIN Pin, - OUT PKSRESOLUTION Resolution - ); -typedef -NTSTATUS -(*PFNKSPININITIALIZEALLOCATOR)( - IN PKSPIN Pin, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PVOID* Context - ); -typedef -void -(*PFNKSSTREAMPOINTER)( - IN PKSSTREAM_POINTER StreamPointer - ); - -typedef struct KSAUTOMATION_TABLE_ -KSAUTOMATION_TABLE, *PKSAUTOMATION_TABLE; -struct KSAUTOMATION_TABLE_ { - ULONG PropertySetsCount; - ULONG PropertyItemSize; - const KSPROPERTY_SET* PropertySets; - ULONG MethodSetsCount; - ULONG MethodItemSize; - const KSMETHOD_SET* MethodSets; - ULONG EventSetsCount; - ULONG EventItemSize; - const KSEVENT_SET* EventSets; -#if !defined(_WIN64) - PVOID Alignment; -#endif // !defined(_WIN64) -}; - -#define DEFINE_KSAUTOMATION_TABLE(table)\ - const KSAUTOMATION_TABLE table = - -#define DEFINE_KSAUTOMATION_PROPERTIES(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSPROPERTY_ITEM),\ - table - -#define DEFINE_KSAUTOMATION_METHODS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSMETHOD_ITEM),\ - table - -#define DEFINE_KSAUTOMATION_EVENTS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSEVENT_ITEM),\ - table - -#define DEFINE_KSAUTOMATION_PROPERTIES_NULL\ - 0,\ - sizeof(KSPROPERTY_ITEM),\ - NULL - -#define DEFINE_KSAUTOMATION_METHODS_NULL\ - 0,\ - sizeof(KSMETHOD_ITEM),\ - NULL - -#define DEFINE_KSAUTOMATION_EVENTS_NULL\ - 0,\ - sizeof(KSEVENT_ITEM),\ - NULL - -#define MIN_DEV_VER_FOR_QI (0x100) - -struct _KSDEVICE_DISPATCH { - PFNKSDEVICECREATE Add; - PFNKSDEVICEPNPSTART Start; - PFNKSDEVICE PostStart; - PFNKSDEVICEIRP QueryStop; - PFNKSDEVICEIRPVOID CancelStop; - PFNKSDEVICEIRPVOID Stop; - PFNKSDEVICEIRP QueryRemove; - PFNKSDEVICEIRPVOID CancelRemove; - PFNKSDEVICEIRPVOID Remove; - PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities; - PFNKSDEVICEIRPVOID SurpriseRemoval; - PFNKSDEVICEQUERYPOWER QueryPower; - PFNKSDEVICESETPOWER SetPower; - PFNKSDEVICEIRP QueryInterface; // added in version 0x100 -}; - -struct _KSFILTER_DISPATCH { - PFNKSFILTERIRP Create; - PFNKSFILTERIRP Close; - PFNKSFILTERPROCESS Process; - PFNKSFILTERVOID Reset; -}; - -struct _KSPIN_DISPATCH { - PFNKSPINIRP Create; - PFNKSPINIRP Close; - PFNKSPIN Process; - PFNKSPINVOID Reset; - PFNKSPINSETDATAFORMAT SetDataFormat; - PFNKSPINSETDEVICESTATE SetDeviceState; - PFNKSPIN Connect; - PFNKSPINVOID Disconnect; - const KSCLOCK_DISPATCH* Clock; - const KSALLOCATOR_DISPATCH* Allocator; -}; - -struct _KSCLOCK_DISPATCH { - PFNKSPINSETTIMER SetTimer; - PFNKSPINCANCELTIMER CancelTimer; - PFNKSPINCORRELATEDTIME CorrelatedTime; - PFNKSPINRESOLUTION Resolution; -}; - -struct _KSALLOCATOR_DISPATCH { - PFNKSPININITIALIZEALLOCATOR InitializeAllocator; - PFNKSDELETEALLOCATOR DeleteAllocator; - PFNKSDEFAULTALLOCATE Allocate; - PFNKSDEFAULTFREE Free; -}; - -#define KSDEVICE_DESCRIPTOR_VERSION (0x100) - -struct _KSDEVICE_DESCRIPTOR { - const KSDEVICE_DISPATCH* Dispatch; - ULONG FilterDescriptorsCount; - const KSFILTER_DESCRIPTOR*const* FilterDescriptors; - ULONG Version; // this is 0 for pre-version 100 driver - //#if !defined(_WIN64) - //PVOID Alignment; - //#endif //!defined(_WIN64) -}; - -struct _KSFILTER_DESCRIPTOR { - const KSFILTER_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - ULONG Version; -#define KSFILTER_DESCRIPTOR_VERSION ((ULONG)-1) - ULONG Flags; -#define KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING 0x00000001 -#define KSFILTER_FLAG_CRITICAL_PROCESSING 0x00000002 -#define KSFILTER_FLAG_HYPERCRITICAL_PROCESSING 0x00000004 -#define KSFILTER_FLAG_RECEIVE_ZERO_LENGTH_SAMPLES 0x00000008 - const GUID* ReferenceGuid; - ULONG PinDescriptorsCount; - ULONG PinDescriptorSize; - const KSPIN_DESCRIPTOR_EX* PinDescriptors; - ULONG CategoriesCount; - const GUID* Categories; - ULONG NodeDescriptorsCount; - ULONG NodeDescriptorSize; - const KSNODE_DESCRIPTOR* NodeDescriptors; - ULONG ConnectionsCount; - const KSTOPOLOGY_CONNECTION* Connections; - const KSCOMPONENTID* ComponentId; -}; - -#define DEFINE_KSFILTER_DESCRIPTOR(descriptor)\ - const KSFILTER_DESCRIPTOR descriptor = - -#define DEFINE_KSFILTER_PIN_DESCRIPTORS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(table[0]),\ - table - -#define DEFINE_KSFILTER_CATEGORIES(table)\ - SIZEOF_ARRAY(table),\ - table - -#define DEFINE_KSFILTER_CATEGORY(category)\ - 1,\ - &(category) - -#define DEFINE_KSFILTER_CATEGORIES_NULL\ - 0,\ - NULL - -#define DEFINE_KSFILTER_NODE_DESCRIPTORS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(table[0]),\ - table - -#define DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL\ - 0,\ - sizeof(KSNODE_DESCRIPTOR),\ - NULL - -#define DEFINE_KSFILTER_CONNECTIONS(table)\ - SIZEOF_ARRAY(table),\ - table - -#define DEFINE_KSFILTER_DEFAULT_CONNECTIONS\ - 0,\ - NULL - -#define DEFINE_KSFILTER_DESCRIPTOR_TABLE(table)\ - const KSFILTER_DESCRIPTOR*const table[] = - -struct _KSPIN_DESCRIPTOR_EX { - const KSPIN_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - KSPIN_DESCRIPTOR PinDescriptor; - ULONG Flags; -#define KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING -#define KSPIN_FLAG_CRITICAL_PROCESSING KSFILTER_FLAG_CRITICAL_PROCESSING -#define KSPIN_FLAG_HYPERCRITICAL_PROCESSING KSFILTER_FLAG_HYPERCRITICAL_PROCESSING -#define KSPIN_FLAG_ASYNCHRONOUS_PROCESSING 0x00000008 -#define KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING 0x00000010 -#define KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL 0x00000020 -#define KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING 0x00000040 -#define KSPIN_FLAG_ENFORCE_FIFO 0x00000080 - -#define KSPIN_FLAG_GENERATE_MAPPINGS 0x00000100 -#define KSPIN_FLAG_DISTINCT_TRAILING_EDGE 0x00000200 - -#define KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY 0x00010000 -#define KSPIN_FLAG_SPLITTER 0x00020000 -#define KSPIN_FLAG_USE_STANDARD_TRANSPORT 0x00040000 -#define KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT 0x00080000 -#define KSPIN_FLAG_FIXED_FORMAT 0x00100000 -#define KSPIN_FLAG_GENERATE_EOS_EVENTS 0x00200000 -#define KSPIN_FLAG_RENDERER (KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY|KSPIN_FLAG_GENERATE_EOS_EVENTS) -#define KSPIN_FLAG_IMPLEMENT_CLOCK 0x00400000 -#define KSPIN_FLAG_SOME_FRAMES_REQUIRED_FOR_PROCESSING 0x00800000 -#define KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE 0x01000000 - ULONG InstancesPossible; - ULONG InstancesNecessary; - const KSALLOCATOR_FRAMING_EX* AllocatorFraming; - PFNKSINTERSECTHANDLEREX IntersectHandler; -}; - -#define DEFINE_KSPIN_DEFAULT_INTERFACES\ - 0,\ - NULL - -#define DEFINE_KSPIN_DEFAULT_MEDIUMS\ - 0,\ - NULL - -struct _KSNODE_DESCRIPTOR { - const KSAUTOMATION_TABLE* AutomationTable; - const GUID* Type; - const GUID* Name; -#if !defined(_WIN64) - PVOID Alignment; -#endif // !defined(_WIN64) -}; - -#if !defined(_WIN64) -#define DEFINE_NODE_DESCRIPTOR(automation,type,name) \ - { (automation), (type), (name), NULL } -#else // !defined(_WIN64) -#define DEFINE_NODE_DESCRIPTOR(automation,type,name) \ - { (automation), (type), (name) } -#endif // !defined(_WIN64) - -struct _KSDEVICE { - const KSDEVICE_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - PDEVICE_OBJECT FunctionalDeviceObject; - PDEVICE_OBJECT PhysicalDeviceObject; - PDEVICE_OBJECT NextDeviceObject; - BOOLEAN Started; - SYSTEM_POWER_STATE SystemPowerState; - DEVICE_POWER_STATE DevicePowerState; -}; - -struct _KSFILTERFACTORY { - const KSFILTER_DESCRIPTOR* FilterDescriptor; - KSOBJECT_BAG Bag; - PVOID Context; -}; - -struct _KSFILTER { - const KSFILTER_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; -}; - -struct _KSPIN { - const KSPIN_DESCRIPTOR_EX* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - ULONG Id; - KSPIN_COMMUNICATION Communication; - BOOLEAN ConnectionIsExternal; - KSPIN_INTERFACE ConnectionInterface; - KSPIN_MEDIUM ConnectionMedium; - KSPRIORITY ConnectionPriority; - PKSDATAFORMAT ConnectionFormat; - PKSMULTIPLE_ITEM AttributeList; - ULONG StreamHeaderSize; - KSPIN_DATAFLOW DataFlow; - KSSTATE DeviceState; - KSRESET ResetState; - KSSTATE ClientState; -}; - -struct _KSMAPPING { - PHYSICAL_ADDRESS PhysicalAddress; - ULONG ByteCount; - ULONG Alignment; -}; - -struct _KSSTREAM_POINTER_OFFSET -{ -#if defined(_NTDDK_) - union { - PUCHAR Data; - PKSMAPPING Mappings; - }; -#else // !defined(_NTDDK_) - PUCHAR Data; -#endif // !defined(_NTDDK_) -#if !defined(_WIN64) - PVOID Alignment; -#endif // !defined(_WIN64) - ULONG Count; - ULONG Remaining; -}; - -struct _KSSTREAM_POINTER -{ - PVOID Context; - PKSPIN Pin; - PKSSTREAM_HEADER StreamHeader; - PKSSTREAM_POINTER_OFFSET Offset; - KSSTREAM_POINTER_OFFSET OffsetIn; - KSSTREAM_POINTER_OFFSET OffsetOut; -}; - -struct _KSPROCESSPIN { - PKSPIN Pin; - PKSSTREAM_POINTER StreamPointer; - PKSPROCESSPIN InPlaceCounterpart; - PKSPROCESSPIN DelegateBranch; - PKSPROCESSPIN CopySource; - PVOID Data; - ULONG BytesAvailable; - ULONG BytesUsed; - ULONG Flags; - BOOLEAN Terminate; -}; - -struct _KSPROCESSPIN_INDEXENTRY { - PKSPROCESSPIN *Pins; - ULONG Count; -}; - -typedef enum { - KsObjectTypeDevice, - KsObjectTypeFilterFactory, - KsObjectTypeFilter, - KsObjectTypePin -} KSOBJECTTYPE; - -typedef -void -(*PFNKSFREE)( - IN PVOID Data - ); - -typedef -void -(*PFNKSPINFRAMERETURN)( - IN PKSPIN Pin, - IN PVOID Data OPTIONAL, - IN ULONG Size OPTIONAL, - IN PMDL Mdl OPTIONAL, - IN PVOID Context OPTIONAL, - IN NTSTATUS Status - ); - -typedef -void -(*PFNKSPINIRPCOMPLETION)( - IN PKSPIN Pin, - IN PIRP Irp - ); - -#if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) -#if !defined(_IKsControl_) -#define _IKsControl_ - -typedef interface IKsControl* PIKSCONTROL; - -#if !defined(DEFINE_ABSTRACT_UNKNOWN) - -#define DEFINE_ABSTRACT_UNKNOWN() \ - STDMETHOD_(NTSTATUS, QueryInterface)(THIS_ \ - REFIID InterfaceId, \ - PVOID* Interface \ - ) PURE; \ - STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ - STDMETHOD_(ULONG,Release)(THIS) PURE; - -#endif //!defined(DEFINE_ABSTRACT_UNKNOWN) - -#undef INTERFACE -#define INTERFACE IKsControl -DECLARE_INTERFACE_(IKsControl,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For C - - STDMETHOD_(NTSTATUS, KsProperty)(THIS_ - IN PKSPROPERTY Property, - IN ULONG PropertyLength, - IN OUT PVOID PropertyData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsMethod)(THIS_ - IN PKSMETHOD Method, - IN ULONG MethodLength, - IN OUT PVOID MethodData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsEvent)(THIS_ - IN PKSEVENT Event OPTIONAL, - IN ULONG EventLength, - IN OUT PVOID EventData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; -}; - -typedef interface IKsReferenceClock* PIKSREFERENCECLOCK; - -#undef INTERFACE -#define INTERFACE IKsReferenceClock -DECLARE_INTERFACE_(IKsReferenceClock,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For C - - STDMETHOD_(LONGLONG,GetTime)(THIS - ) PURE; - STDMETHOD_(LONGLONG,GetPhysicalTime)(THIS - ) PURE; - STDMETHOD_(LONGLONG,GetCorrelatedTime)(THIS_ - OUT PLONGLONG SystemTime - ) PURE; - STDMETHOD_(LONGLONG,GetCorrelatedPhysicalTime)(THIS_ - OUT PLONGLONG SystemTime - ) PURE; - STDMETHOD_(NTSTATUS, GetResolution)(THIS_ - OUT PKSRESOLUTION Resolution - ) PURE; - STDMETHOD_(NTSTATUS, GetState)(THIS_ - OUT PKSSTATE State - ) PURE; -}; -#undef INTERFACE - -#define STATIC_IID_IKsControl \ -0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUID(IID_IKsControl, -0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96); -#if defined(__cplusplus) && _MSC_VER >= 1100 -struct __declspec(uuid("28F54685-06FD-11D2-B27A-00A0C9223196")) IKsControl; -#endif - -#define STATIC_IID_IKsFastClock \ -0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e -DEFINE_GUID(IID_IKsFastClock, -0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e); -#if defined(__cplusplus) && _MSC_VER >= 1100 -struct __declspec(uuid("C9902485-C180-11d2-8473-D42394459E5E")) IKsFastClock; -#endif - -#endif // !defined(_IKsControl_) -#endif // defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - -#endif // defined(_NTDDK_) - -//=========================================================================== - -#if defined(__cplusplus) -extern "C" { -#endif // defined(__cplusplus) - -// -// exported prototypes -// - -#ifdef _KSDDK_ -#define KSDDKAPI -#else // !_KSDDK_ -#define KSDDKAPI DECLSPEC_IMPORT -#endif // _KSDDK_ - -#if defined(_NTDDK_) - -KSDDKAPI -NTSTATUS -NTAPI -KsEnableEvent( - IN PIRP Irp, - IN ULONG EventSetsCount, - IN const KSEVENT_SET* EventSet, - IN OUT PLIST_ENTRY EventsList OPTIONAL, - IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL, - IN PVOID EventsLock OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsEnableEventWithAllocator( - IN PIRP Irp, - IN ULONG EventSetsCount, - IN const KSEVENT_SET* EventSet, - IN OUT PLIST_ENTRY EventsList OPTIONAL, - IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL, - IN PVOID EventsLock OPTIONAL, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG EventItemSize OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDisableEvent( - IN PIRP Irp, - IN OUT PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - -KSDDKAPI -VOID -NTAPI -KsDiscardEvent( - IN PKSEVENT_ENTRY EventEntry - ); - -KSDDKAPI -VOID -NTAPI -KsFreeEventList( - IN PFILE_OBJECT FileObject, - IN OUT PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsGenerateEvent( - IN PKSEVENT_ENTRY EventEntry - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsGenerateDataEvent( - IN PKSEVENT_ENTRY EventEntry, - IN ULONG DataSize, - IN PVOID Data - ); - -KSDDKAPI -VOID -NTAPI -KsGenerateEventList( - IN GUID* Set OPTIONAL, - IN ULONG EventId, - IN PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - -// property.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsPropertyHandler( - IN PIRP Irp, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPropertyHandlerWithAllocator( - IN PIRP Irp, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG PropertyItemSize OPTIONAL - ); - -KSDDKAPI -BOOLEAN -NTAPI -KsFastPropertyHandler( - IN PFILE_OBJECT FileObject, - IN PKSPROPERTY Property, - IN ULONG PropertyLength, - IN OUT PVOID Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet - ); - -// method.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsMethodHandler( - IN PIRP Irp, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsMethodHandlerWithAllocator( - IN PIRP Irp, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG MethodItemSize OPTIONAL - ); - -KSDDKAPI -BOOLEAN -NTAPI -KsFastMethodHandler( - IN PFILE_OBJECT FileObject, - IN PKSMETHOD Method, - IN ULONG MethodLength, - IN OUT PVOID Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet - ); - -// alloc.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateDefaultAllocator( - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateDefaultAllocatorEx( - IN PIRP Irp, - IN PVOID InitializeContext OPTIONAL, - IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL, - IN PFNKSDEFAULTFREE DefaultFree OPTIONAL, - IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL, - IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateAllocator( - IN HANDLE ConnectionHandle, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PHANDLE AllocatorHandle - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsValidateAllocatorCreateRequest( - IN PIRP Irp, - OUT PKSALLOCATOR_FRAMING* AllocatorFraming - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsValidateAllocatorFramingEx( - IN PKSALLOCATOR_FRAMING_EX Framing, - IN ULONG BufferSize, - IN const KSALLOCATOR_FRAMING_EX *PinFraming - ); - -// clock.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateDefaultClock( - OUT PKSDEFAULTCLOCK* DefaultClock - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateDefaultClockEx( - OUT PKSDEFAULTCLOCK* DefaultClock, - IN PVOID Context OPTIONAL, - IN PFNKSSETTIMER SetTimer OPTIONAL, - IN PFNKSCANCELTIMER CancelTimer OPTIONAL, - IN PFNKSCORRELATEDTIME CorrelatedTime OPTIONAL, - IN const KSRESOLUTION* Resolution OPTIONAL, - IN ULONG Flags - ); - -KSDDKAPI -VOID -NTAPI -KsFreeDefaultClock( - IN PKSDEFAULTCLOCK DefaultClock - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateDefaultClock( - IN PIRP Irp, - IN PKSDEFAULTCLOCK DefaultClock - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateClock( - IN HANDLE ConnectionHandle, - IN PKSCLOCK_CREATE ClockCreate, - OUT PHANDLE ClockHandle - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsValidateClockCreateRequest( - IN PIRP Irp, - OUT PKSCLOCK_CREATE* ClockCreate - ); - -KSDDKAPI -KSSTATE -NTAPI -KsGetDefaultClockState( - IN PKSDEFAULTCLOCK DefaultClock - ); - -KSDDKAPI -VOID -NTAPI -KsSetDefaultClockState( - IN PKSDEFAULTCLOCK DefaultClock, - IN KSSTATE State - ); - -KSDDKAPI -LONGLONG -NTAPI -KsGetDefaultClockTime( - IN PKSDEFAULTCLOCK DefaultClock - ); - -KSDDKAPI -VOID -NTAPI -KsSetDefaultClockTime( - IN PKSDEFAULTCLOCK DefaultClock, - IN LONGLONG Time - ); - -// connect.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsCreatePin( - IN HANDLE FilterHandle, - IN PKSPIN_CONNECT Connect, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE ConnectionHandle - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsValidateConnectRequest( - IN PIRP Irp, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - OUT PKSPIN_CONNECT* Connect - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinPropertyHandler( - IN PIRP Irp, - IN PKSPROPERTY Property, - IN OUT PVOID Data, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinDataIntersection( - IN PIRP Irp, - IN PKSP_PIN Pin, - OUT PVOID Data OPTIONAL, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - IN PFNKSINTERSECTHANDLER IntersectHandler - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinDataIntersectionEx( - IN PIRP Irp, - IN PKSP_PIN Pin, - OUT PVOID Data, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - IN ULONG DescriptorSize, - IN PFNKSINTERSECTHANDLEREX IntersectHandler OPTIONAL, - IN PVOID HandlerContext OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsHandleSizedListQuery( - IN PIRP Irp, - IN ULONG DataItemsCount, - IN ULONG DataItemSize, - IN const VOID* DataItems - ); - -// image.c: - -#if (!defined( MAKEINTRESOURCE )) -#define MAKEINTRESOURCE( res ) ((ULONG_PTR) (USHORT) res) -#endif - -#if (!defined( RT_STRING )) -#define RT_STRING MAKEINTRESOURCE( 6 ) -#define RT_RCDATA MAKEINTRESOURCE( 10 ) -#endif - -KSDDKAPI -NTSTATUS -NTAPI -KsLoadResource( - IN PVOID ImageBase, - IN POOL_TYPE PoolType, - IN ULONG_PTR ResourceName, - IN ULONG ResourceType, - OUT PVOID *Resource, - OUT PULONG ResourceSize - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsGetImageNameAndResourceId( - IN HANDLE RegKey, - OUT PUNICODE_STRING ImageName, - OUT PULONG_PTR ResourceId, - OUT PULONG ValueType -); - -KSDDKAPI -NTSTATUS -NTAPI -KsMapModuleName( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PUNICODE_STRING ModuleName, - OUT PUNICODE_STRING ImageName, - OUT PULONG_PTR ResourceId, - OUT PULONG ValueType - ); - -// irp.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsReferenceBusObject( - IN KSDEVICE_HEADER Header - ); - -KSDDKAPI -VOID -NTAPI -KsDereferenceBusObject( - IN KSDEVICE_HEADER Header - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchQuerySecurity( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchSetSecurity( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchSpecificProperty( - IN PIRP Irp, - IN PFNKSHANDLER Handler - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchSpecificMethod( - IN PIRP Irp, - IN PFNKSHANDLER Handler - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsReadFile( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN ULONG Key OPTIONAL, - IN KPROCESSOR_MODE RequestorMode - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsWriteFile( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN ULONG Key OPTIONAL, - IN KPROCESSOR_MODE RequestorMode - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsQueryInformationFile( - IN PFILE_OBJECT FileObject, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsSetInformationFile( - IN PFILE_OBJECT FileObject, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamIo( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL, - IN PVOID CompletionContext OPTIONAL, - IN KSCOMPLETION_INVOCATION CompletionInvocationFlags OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN OUT PVOID StreamHeaders, - IN ULONG Length, - IN ULONG Flags, - IN KPROCESSOR_MODE RequestorMode - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsProbeStreamIrp( - IN OUT PIRP Irp, - IN ULONG ProbeFlags, - IN ULONG HeaderSize OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateExtraData( - IN OUT PIRP Irp, - IN ULONG ExtraSize, - OUT PVOID* ExtraBuffer - ); - -KSDDKAPI -VOID -NTAPI -KsNullDriverUnload( - IN PDRIVER_OBJECT DriverObject - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsSetMajorFunctionHandler( - IN PDRIVER_OBJECT DriverObject, - IN ULONG MajorFunction - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchInvalidDeviceRequest( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDefaultDeviceIoCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDispatchIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -BOOLEAN -NTAPI -KsDispatchFastIoDeviceControlFailure( - IN PFILE_OBJECT FileObject, - IN BOOLEAN Wait, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, - IN ULONG OutputBufferLength, - IN ULONG IoControlCode, - OUT PIO_STATUS_BLOCK IoStatus, - IN PDEVICE_OBJECT DeviceObject - ); - -KSDDKAPI -BOOLEAN -NTAPI -KsDispatchFastReadFailure( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - IN ULONG LockKey, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus, - IN PDEVICE_OBJECT DeviceObject - ); - -#define KsDispatchFastWriteFailure KsDispatchFastReadFailure - -KSDDKAPI -VOID -NTAPI -KsCancelRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -VOID -NTAPI -KsCancelIo( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock - ); - -KSDDKAPI -VOID -NTAPI -KsReleaseIrpOnCancelableQueue( - IN PIRP Irp, - IN PDRIVER_CANCEL DriverCancel OPTIONAL - ); - -KSDDKAPI -PIRP -NTAPI -KsRemoveIrpFromCancelableQueue( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN KSIRP_REMOVAL_OPERATION RemovalOperation - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsMoveIrpsOnCancelableQueue( - IN OUT PLIST_ENTRY SourceList, - IN PKSPIN_LOCK SourceLock, - IN OUT PLIST_ENTRY DestinationList, - IN PKSPIN_LOCK DestinationLock OPTIONAL, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN PFNKSIRPLISTCALLBACK ListCallback, - IN PVOID Context - ); - -KSDDKAPI -VOID -NTAPI -KsRemoveSpecificIrpFromCancelableQueue( - IN PIRP Irp - ); - -KSDDKAPI -VOID -NTAPI -KsAddIrpToCancelableQueue( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock, - IN PIRP Irp, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN PDRIVER_CANCEL DriverCancel OPTIONAL - ); - -// api.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsAcquireResetValue( - IN PIRP Irp, - OUT KSRESET* ResetValue - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsTopologyPropertyHandler( - IN PIRP Irp, - IN PKSPROPERTY Property, - IN OUT PVOID Data, - IN const KSTOPOLOGY* Topology - ); - -KSDDKAPI -VOID -NTAPI -KsAcquireDeviceSecurityLock( - IN KSDEVICE_HEADER Header, - IN BOOLEAN Exclusive - ); - -KSDDKAPI -VOID -NTAPI -KsReleaseDeviceSecurityLock( - IN KSDEVICE_HEADER Header - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDefaultDispatchPnp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDefaultDispatchPower( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsDefaultForwardIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -KSDDKAPI -VOID -NTAPI -KsSetDevicePnpAndBaseObject( - IN KSDEVICE_HEADER Header, - IN PDEVICE_OBJECT PnpDeviceObject, - IN PDEVICE_OBJECT BaseObject - ); - -KSDDKAPI -PDEVICE_OBJECT -NTAPI -KsQueryDevicePnpObject( - IN KSDEVICE_HEADER Header - ); - -KSDDKAPI -ACCESS_MASK -NTAPI -KsQueryObjectAccessMask( - IN KSOBJECT_HEADER Header - ); - -KSDDKAPI -VOID -NTAPI -KsRecalculateStackDepth( - IN KSDEVICE_HEADER Header, - IN BOOLEAN ReuseStackLocation - ); - -KSDDKAPI -VOID -NTAPI -KsSetTargetState( - IN KSOBJECT_HEADER Header, - IN KSTARGET_STATE TargetState - ); - -KSDDKAPI -VOID -NTAPI -KsSetTargetDeviceObject( - IN KSOBJECT_HEADER Header, - IN PDEVICE_OBJECT TargetDevice OPTIONAL - ); - -KSDDKAPI -VOID -NTAPI -KsSetPowerDispatch( - IN KSOBJECT_HEADER Header, - IN PFNKSCONTEXT_DISPATCH PowerDispatch OPTIONAL, - IN PVOID PowerContext OPTIONAL - ); - -KSDDKAPI -PKSOBJECT_CREATE_ITEM -NTAPI -KsQueryObjectCreateItem( - IN KSOBJECT_HEADER Header - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateDeviceHeader( - OUT KSDEVICE_HEADER* Header, - IN ULONG ItemsCount, - IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL - ); - -KSDDKAPI -VOID -NTAPI -KsFreeDeviceHeader( - IN KSDEVICE_HEADER Header - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateObjectHeader( - OUT KSOBJECT_HEADER* Header, - IN ULONG ItemsCount, - IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL, - IN PIRP Irp, - IN const KSDISPATCH_TABLE* Table - ); - -KSDDKAPI -VOID -NTAPI -KsFreeObjectHeader( - IN KSOBJECT_HEADER Header - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAddObjectCreateItemToDeviceHeader( - IN KSDEVICE_HEADER Header, - IN PDRIVER_DISPATCH Create, - IN PVOID Context, - IN PWCHAR ObjectClass, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAddObjectCreateItemToObjectHeader( - IN KSOBJECT_HEADER Header, - IN PDRIVER_DISPATCH Create, - IN PVOID Context, - IN PWCHAR ObjectClass, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateObjectCreateItem( - IN KSDEVICE_HEADER Header, - IN PKSOBJECT_CREATE_ITEM CreateItem, - IN BOOLEAN AllocateEntry, - IN PFNKSITEMFREECALLBACK ItemFreeCallback OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFreeObjectCreateItem( - IN KSDEVICE_HEADER Header, - IN PUNICODE_STRING CreateItem - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFreeObjectCreateItemsByContext( - IN KSDEVICE_HEADER Header, - IN PVOID Context - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateDefaultSecurity( - IN PSECURITY_DESCRIPTOR ParentSecurity OPTIONAL, - OUT PSECURITY_DESCRIPTOR* DefaultSecurity - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsForwardIrp( - IN PIRP Irp, - IN PFILE_OBJECT FileObject, - IN BOOLEAN ReuseStackLocation - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsForwardAndCatchIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PFILE_OBJECT FileObject, - IN KSSTACK_USE StackUse - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsSynchronousIoControlDevice( - IN PFILE_OBJECT FileObject, - IN KPROCESSOR_MODE RequestorMode, - IN ULONG IoControl, - IN PVOID InBuffer, - IN ULONG InSize, - OUT PVOID OutBuffer, - IN ULONG OutSize, - OUT PULONG BytesReturned - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsUnserializeObjectPropertiesFromRegistry( - IN PFILE_OBJECT FileObject, - IN HANDLE ParentKey OPTIONAL, - IN PUNICODE_STRING RegistryPath OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCacheMedium( - IN PUNICODE_STRING SymbolicLink, - IN PKSPIN_MEDIUM Medium, - IN ULONG PinDirection - ); - -// thread.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsRegisterWorker( - IN WORK_QUEUE_TYPE WorkQueueType, - OUT PKSWORKER* Worker - ); -KSDDKAPI -NTSTATUS -NTAPI -KsRegisterCountedWorker( - IN WORK_QUEUE_TYPE WorkQueueType, - IN PWORK_QUEUE_ITEM CountedWorkItem, - OUT PKSWORKER* Worker - ); -KSDDKAPI -VOID -NTAPI -KsUnregisterWorker( - IN PKSWORKER Worker - ); -KSDDKAPI -NTSTATUS -NTAPI -KsQueueWorkItem( - IN PKSWORKER Worker, - IN PWORK_QUEUE_ITEM WorkItem - ); -KSDDKAPI -ULONG -NTAPI -KsIncrementCountedWorker( - IN PKSWORKER Worker - ); -KSDDKAPI -ULONG -NTAPI -KsDecrementCountedWorker( - IN PKSWORKER Worker - ); - -// topology.c: - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateTopologyNode( - IN HANDLE ParentHandle, - IN PKSNODE_CREATE NodeCreate, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE NodeHandle - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsValidateTopologyNodeCreateRequest( - IN PIRP Irp, - IN PKSTOPOLOGY Topology, - OUT PKSNODE_CREATE* NodeCreate - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsMergeAutomationTables( - OUT PKSAUTOMATION_TABLE* AutomationTableAB, - IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, - IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL, - IN KSOBJECT_BAG Bag OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsInitializeDriver( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPathName, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsAddDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT PhysicalDeviceObject - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL, - IN ULONG ExtensionSize OPTIONAL, - OUT PKSDEVICE* Device OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsInitializeDevice( - IN PDEVICE_OBJECT FunctionalDeviceObject, - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_OBJECT NextDeviceObject, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsTerminateDevice( - IN PDEVICE_OBJECT DeviceObject - ); - -KSDDKAPI -PKSDEVICE -NTAPI -KsGetDeviceForDeviceObject( - IN PDEVICE_OBJECT FunctionalDeviceObject - ); - -KSDDKAPI -void -NTAPI -KsAcquireDevice( - IN PKSDEVICE Device - ); - -KSDDKAPI -void -NTAPI -KsReleaseDevice( - IN PKSDEVICE Device - ); - -KSDDKAPI -void -NTAPI -KsDeviceRegisterAdapterObject( - IN PKSDEVICE Device, - IN PADAPTER_OBJECT AdapterObject, - IN ULONG MaxMappingsByteCount, - IN ULONG MappingTableStride - ); - -KSDDKAPI -ULONG -NTAPI -KsDeviceGetBusData( - IN PKSDEVICE Device, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - -KSDDKAPI -ULONG -NTAPI -KsDeviceSetBusData( - IN PKSDEVICE Device, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCreateFilterFactory( - IN PDEVICE_OBJECT DeviceObject, - IN const KSFILTER_DESCRIPTOR* Descriptor, - IN PWCHAR RefString OPTIONAL, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL, - IN ULONG CreateItemFlags, - IN PFNKSFILTERFACTORYPOWER SleepCallback OPTIONAL, - IN PFNKSFILTERFACTORYPOWER WakeCallback OPTIONAL, - OUT PKSFILTERFACTORY* FilterFactory OPTIONAL - ); - -#define KsDeleteFilterFactory(FilterFactory) \ - KsFreeObjectCreateItemsByContext(\ - *(KSDEVICE_HEADER *)(\ - KsFilterFactoryGetParentDevice(FilterFactory)->FunctionalDeviceObject->\ - DeviceExtension),\ - FilterFactory) - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterFactoryUpdateCacheData( - IN PKSFILTERFACTORY FilterFactory, - IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterFactoryAddCreateItem( - IN PKSFILTERFACTORY FilterFactory, - IN PWCHAR RefString, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL, - IN ULONG CreateItemFlags - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterFactorySetDeviceClassesState( - IN PKSFILTERFACTORY FilterFactory, - IN BOOLEAN NewState - ); - -KSDDKAPI -PUNICODE_STRING -NTAPI -KsFilterFactoryGetSymbolicLink( - IN PKSFILTERFACTORY FilterFactory - ); - -KSDDKAPI -void -NTAPI -KsAddEvent( - IN PVOID Object, - IN PKSEVENT_ENTRY EventEntry - ); - -void _inline -KsFilterAddEvent( - IN PKSFILTER Filter, - IN PKSEVENT_ENTRY EventEntry - ) -{ - KsAddEvent(Filter,EventEntry); -} - -void _inline -KsPinAddEvent( - IN PKSPIN Pin, - IN PKSEVENT_ENTRY EventEntry - ) -{ - KsAddEvent(Pin,EventEntry); -} - -KSDDKAPI -NTSTATUS -NTAPI -KsDefaultAddEventHandler( - IN PIRP Irp, - IN PKSEVENTDATA EventData, - IN OUT PKSEVENT_ENTRY EventEntry - ); - -KSDDKAPI -void -NTAPI -KsGenerateEvents( - IN PVOID Object, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ); - -void _inline -KsFilterGenerateEvents( - IN PKSFILTER Filter, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ) -{ - KsGenerateEvents( - Filter, - EventSet, - EventId, - DataSize, - Data, - CallBack, - CallBackContext); -} - -void _inline -KsPinGenerateEvents( - IN PKSPIN Pin, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ) -{ - KsGenerateEvents( - Pin, - EventSet, - EventId, - DataSize, - Data, - CallBack, - CallBackContext); -} - -typedef enum { - KSSTREAM_POINTER_STATE_UNLOCKED = 0, - KSSTREAM_POINTER_STATE_LOCKED -} KSSTREAM_POINTER_STATE; - -KSDDKAPI -NTSTATUS -NTAPI -KsPinGetAvailableByteCount( - IN PKSPIN Pin, - OUT PLONG InputDataBytes OPTIONAL, - OUT PLONG OutputBufferBytes OPTIONAL - ); - -KSDDKAPI -PKSSTREAM_POINTER -NTAPI -KsPinGetLeadingEdgeStreamPointer( - IN PKSPIN Pin, - IN KSSTREAM_POINTER_STATE State - ); - -KSDDKAPI -PKSSTREAM_POINTER -NTAPI -KsPinGetTrailingEdgeStreamPointer( - IN PKSPIN Pin, - IN KSSTREAM_POINTER_STATE State - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamPointerSetStatusCode( - IN PKSSTREAM_POINTER StreamPointer, - IN NTSTATUS Status - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamPointerLock( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -void -NTAPI -KsStreamPointerUnlock( - IN PKSSTREAM_POINTER StreamPointer, - IN BOOLEAN Eject - ); - -KSDDKAPI -void -NTAPI -KsStreamPointerAdvanceOffsetsAndUnlock( - IN PKSSTREAM_POINTER StreamPointer, - IN ULONG InUsed, - IN ULONG OutUsed, - IN BOOLEAN Eject - ); - -KSDDKAPI -void -NTAPI -KsStreamPointerDelete( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamPointerClone( - IN PKSSTREAM_POINTER StreamPointer, - IN PFNKSSTREAMPOINTER CancelCallback OPTIONAL, - IN ULONG ContextSize, - OUT PKSSTREAM_POINTER* CloneStreamPointer - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamPointerAdvanceOffsets( - IN PKSSTREAM_POINTER StreamPointer, - IN ULONG InUsed, - IN ULONG OutUsed, - IN BOOLEAN Eject - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsStreamPointerAdvance( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -PMDL -NTAPI -KsStreamPointerGetMdl( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -PIRP -NTAPI -KsStreamPointerGetIrp( - IN PKSSTREAM_POINTER StreamPointer, - OUT PBOOLEAN FirstFrameInIrp OPTIONAL, - OUT PBOOLEAN LastFrameInIrp OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsStreamPointerScheduleTimeout( - IN PKSSTREAM_POINTER StreamPointer, - IN PFNKSSTREAMPOINTER Callback, - IN ULONGLONG Interval - ); - -KSDDKAPI -void -NTAPI -KsStreamPointerCancelTimeout( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -PKSSTREAM_POINTER -NTAPI -KsPinGetFirstCloneStreamPointer( - IN PKSPIN Pin - ); - -KSDDKAPI -PKSSTREAM_POINTER -NTAPI -KsStreamPointerGetNextClone( - IN PKSSTREAM_POINTER StreamPointer - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinHandshake( - IN PKSPIN Pin, - IN PKSHANDSHAKE In, - OUT PKSHANDSHAKE Out - ); - -KSDDKAPI -void -NTAPI -KsCompletePendingRequest( - IN PIRP Irp - ); - -KSDDKAPI -KSOBJECTTYPE -NTAPI -KsGetObjectTypeFromIrp( - IN PIRP Irp - ); - -KSDDKAPI -PVOID -NTAPI -KsGetObjectFromFileObject( - IN PFILE_OBJECT FileObject - ); - -KSDDKAPI -KSOBJECTTYPE -NTAPI -KsGetObjectTypeFromFileObject( - IN PFILE_OBJECT FileObject - ); - -PKSFILTER __inline -KsGetFilterFromFileObject( - IN PFILE_OBJECT FileObject - ) -{ - return (PKSFILTER) KsGetObjectFromFileObject(FileObject); -} - -PKSPIN __inline -KsGetPinFromFileObject( - IN PFILE_OBJECT FileObject - ) -{ - return (PKSPIN) KsGetObjectFromFileObject(FileObject); -} - -KSDDKAPI -PKSGATE -NTAPI -KsFilterGetAndGate( - IN PKSFILTER Filter - ); - -KSDDKAPI -void -NTAPI -KsFilterAcquireProcessingMutex( - IN PKSFILTER Filter - ); - -KSDDKAPI -void -NTAPI -KsFilterReleaseProcessingMutex( - IN PKSFILTER Filter - ); - -KSDDKAPI -void -NTAPI -KsFilterAttemptProcessing( - IN PKSFILTER Filter, - IN BOOLEAN Asynchronous - ); - -KSDDKAPI -PKSGATE -NTAPI -KsPinGetAndGate( - IN PKSPIN Pin - ); - -KSDDKAPI -void -NTAPI -KsPinAttachAndGate( - IN PKSPIN Pin, - IN PKSGATE AndGate OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsPinAttachOrGate( - IN PKSPIN Pin, - IN PKSGATE OrGate OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsPinAcquireProcessingMutex( - IN PKSPIN Pin - ); - -KSDDKAPI -void -NTAPI -KsPinReleaseProcessingMutex( - IN PKSPIN Pin - ); - -KSDDKAPI -BOOLEAN -NTAPI -KsProcessPinUpdate( - IN PKSPROCESSPIN ProcessPin - ); - -KSDDKAPI -void -NTAPI -KsPinGetCopyRelationships( - IN PKSPIN Pin, - OUT PKSPIN* CopySource, - OUT PKSPIN* DelegateBranch - ); - -KSDDKAPI -void -NTAPI -KsPinAttemptProcessing( - IN PKSPIN Pin, - IN BOOLEAN Asynchronous - ); - -KSDDKAPI -PVOID -NTAPI -KsGetParent( - IN PVOID Object - ); - -PKSDEVICE __inline -KsFilterFactoryGetParentDevice( - IN PKSFILTERFACTORY FilterFactory - ) -{ - return (PKSDEVICE) KsGetParent((PVOID) FilterFactory); -} - -PKSFILTERFACTORY __inline -KsFilterGetParentFilterFactory( - IN PKSFILTER Filter - ) -{ - return (PKSFILTERFACTORY) KsGetParent((PVOID) Filter); -} - -KSDDKAPI -PKSFILTER -NTAPI -KsPinGetParentFilter( - IN PKSPIN Pin - ); - -KSDDKAPI -PVOID -NTAPI -KsGetFirstChild( - IN PVOID Object - ); - -PKSFILTERFACTORY __inline -KsDeviceGetFirstChildFilterFactory( - IN PKSDEVICE Device - ) -{ - return (PKSFILTERFACTORY) KsGetFirstChild((PVOID) Device); -} - -PKSFILTER __inline -KsFilterFactoryGetFirstChildFilter( - IN PKSFILTERFACTORY FilterFactory - ) -{ - return (PKSFILTER) KsGetFirstChild((PVOID) FilterFactory); -} - -KSDDKAPI -ULONG -NTAPI -KsFilterGetChildPinCount( - IN PKSFILTER Filter, - IN ULONG PinId - ); - -KSDDKAPI -PKSPIN -NTAPI -KsFilterGetFirstChildPin( - IN PKSFILTER Filter, - IN ULONG PinId - ); - -KSDDKAPI -PVOID -NTAPI -KsGetNextSibling( - IN PVOID Object - ); - -KSDDKAPI -PKSPIN -NTAPI -KsPinGetNextSiblingPin( - IN PKSPIN Pin - ); - -PKSFILTERFACTORY __inline -KsFilterFactoryGetNextSiblingFilterFactory( - IN PKSFILTERFACTORY FilterFactory - ) -{ - return (PKSFILTERFACTORY) KsGetNextSibling((PVOID) FilterFactory); -} - -PKSFILTER __inline -KsFilterGetNextSiblingFilter( - IN PKSFILTER Filter - ) -{ - return (PKSFILTER) KsGetNextSibling((PVOID) Filter); -} - - -KSDDKAPI -PKSDEVICE -NTAPI -KsGetDevice( - IN PVOID Object - ); - -PKSDEVICE __inline -KsFilterFactoryGetDevice( - IN PKSFILTERFACTORY FilterFactory - ) -{ - return KsGetDevice((PVOID) FilterFactory); -} - -PKSDEVICE __inline -KsFilterGetDevice( - IN PKSFILTER Filter - ) -{ - return KsGetDevice((PVOID) Filter); -} - -PKSDEVICE __inline -KsPinGetDevice( - IN PKSPIN Pin - ) -{ - return KsGetDevice((PVOID) Pin); -} - -KSDDKAPI -PKSFILTER -NTAPI -KsGetFilterFromIrp( - IN PIRP Irp - ); - -KSDDKAPI -PKSPIN -NTAPI -KsGetPinFromIrp( - IN PIRP Irp - ); - -KSDDKAPI -ULONG -NTAPI -KsGetNodeIdFromIrp( - IN PIRP Irp - ); - -KSDDKAPI -void -NTAPI -KsAcquireControl( - IN PVOID Object - ); - -KSDDKAPI -void -NTAPI -KsReleaseControl( - IN PVOID Object - ); - -void __inline -KsFilterAcquireControl( - IN PKSFILTER Filter - ) -{ - KsAcquireControl((PVOID) Filter); -} - -void __inline -KsFilterReleaseControl( - IN PKSFILTER Filter - ) -{ - KsReleaseControl((PVOID) Filter); -} - -void __inline -KsPinAcquireControl( - IN PKSPIN Pin - ) -{ - KsAcquireControl((PVOID) Pin); -} - -void __inline -KsPinReleaseControl( - IN PKSPIN Pin - ) -{ - KsReleaseControl((PVOID) Pin); -} - -KSDDKAPI -NTSTATUS -NTAPI -KsAddItemToObjectBag( - IN KSOBJECT_BAG ObjectBag, - IN PVOID Item, - IN PFNKSFREE Free OPTIONAL - ); - -KSDDKAPI -ULONG -NTAPI -KsRemoveItemFromObjectBag( - IN KSOBJECT_BAG ObjectBag, - IN PVOID Item, - IN BOOLEAN Free - ); - -#define KsDiscard(Object,Pointer)\ - KsRemoveItemFromObjectBag(\ - (Object)->Bag,\ - (PVOID)(Pointer),\ - TRUE) - -KSDDKAPI -NTSTATUS -NTAPI -KsAllocateObjectBag( - IN PKSDEVICE Device, - OUT KSOBJECT_BAG* ObjectBag - ); - -KSDDKAPI -void -NTAPI -KsFreeObjectBag( - IN KSOBJECT_BAG ObjectBag - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsCopyObjectBagItems( - IN KSOBJECT_BAG ObjectBagDestination, - IN KSOBJECT_BAG ObjectBagSource - ); - -KSDDKAPI -NTSTATUS -NTAPI -_KsEdit( - IN KSOBJECT_BAG ObjectBag, - IN OUT PVOID* PointerToPointerToItem, - IN ULONG NewSize, - IN ULONG OldSize, - IN ULONG Tag - ); - -#define KsEdit(Object,PointerToPointer,Tag)\ - _KsEdit(\ - (Object)->Bag,\ - (PVOID*)(PointerToPointer),\ - sizeof(**(PointerToPointer)),\ - sizeof(**(PointerToPointer)),\ - (Tag)) -#define KsEditSized(Object,PointerToPointer,NewSize,OldSize,Tag)\ - _KsEdit((Object)->Bag,(PVOID*)(PointerToPointer),(NewSize),(OldSize),(Tag)) - -KSDDKAPI -NTSTATUS -NTAPI -KsRegisterFilterWithNoKSPins( - IN PDEVICE_OBJECT DeviceObject, - IN const GUID * InterfaceClassGUID, - IN ULONG PinCount, - IN BOOL * PinDirection, - IN KSPIN_MEDIUM * MediumList, - IN OPTIONAL GUID * CategoryList -); - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterCreatePinFactory ( - IN PKSFILTER Filter, - IN const KSPIN_DESCRIPTOR_EX *const PinDescriptor, - OUT PULONG PinID - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterCreateNode ( - IN PKSFILTER Filter, - IN const KSNODE_DESCRIPTOR *const NodeDescriptor, - OUT PULONG NodeID - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsFilterAddTopologyConnections ( - IN PKSFILTER Filter, - IN ULONG NewConnectionsCount, - IN const KSTOPOLOGY_CONNECTION *const NewTopologyConnections - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinGetConnectedPinInterface( - IN PKSPIN Pin, - IN const GUID* InterfaceId, - OUT PVOID* Interface - ); - -KSDDKAPI -PFILE_OBJECT -NTAPI -KsPinGetConnectedPinFileObject( - IN PKSPIN Pin - ); - -KSDDKAPI -PDEVICE_OBJECT -NTAPI -KsPinGetConnectedPinDeviceObject( - IN PKSPIN Pin - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinGetConnectedFilterInterface( - IN PKSPIN Pin, - IN const GUID* InterfaceId, - OUT PVOID* Interface - ); - -#if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - -KSDDKAPI -NTSTATUS -NTAPI -KsPinGetReferenceClockInterface( - IN PKSPIN Pin, - OUT PIKSREFERENCECLOCK* Interface - ); - -#endif //defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - -KSDDKAPI -VOID -NTAPI -KsPinSetPinClockTime( - IN PKSPIN Pin, - IN LONGLONG Time - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinSubmitFrame( - IN PKSPIN Pin, - IN PVOID Data OPTIONAL, - IN ULONG Size OPTIONAL, - IN PKSSTREAM_HEADER StreamHeader OPTIONAL, - IN PVOID Context OPTIONAL - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsPinSubmitFrameMdl( - IN PKSPIN Pin, - IN PMDL Mdl OPTIONAL, - IN PKSSTREAM_HEADER StreamHeader OPTIONAL, - IN PVOID Context OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsPinRegisterFrameReturnCallback( - IN PKSPIN Pin, - IN PFNKSPINFRAMERETURN FrameReturn - ); - -KSDDKAPI -void -NTAPI -KsPinRegisterIrpCompletionCallback( - IN PKSPIN Pin, - IN PFNKSPINIRPCOMPLETION IrpCompletion - ); - -KSDDKAPI -void -NTAPI -KsPinRegisterHandshakeCallback( - IN PKSPIN Pin, - IN PFNKSPINHANDSHAKE Handshake - ); - -KSDDKAPI -void -NTAPI -KsFilterRegisterPowerCallbacks( - IN PKSFILTER Filter, - IN PFNKSFILTERPOWER Sleep OPTIONAL, - IN PFNKSFILTERPOWER Wake OPTIONAL - ); - -KSDDKAPI -void -NTAPI -KsPinRegisterPowerCallbacks( - IN PKSPIN Pin, - IN PFNKSPINPOWER Sleep OPTIONAL, - IN PFNKSPINPOWER Wake OPTIONAL - ); - -#if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - -KSDDKAPI -PUNKNOWN -NTAPI -KsRegisterAggregatedClientUnknown( - IN PVOID Object, - IN PUNKNOWN ClientUnknown - ); - -KSDDKAPI -PUNKNOWN -NTAPI -KsGetOuterUnknown( - IN PVOID Object - ); - -PUNKNOWN __inline -KsDeviceRegisterAggregatedClientUnknown( - IN PKSDEVICE Device, - IN PUNKNOWN ClientUnknown - ) -{ - return KsRegisterAggregatedClientUnknown((PVOID) Device,ClientUnknown); -} - -PUNKNOWN __inline -KsDeviceGetOuterUnknown( - IN PKSDEVICE Device - ) -{ - return KsGetOuterUnknown((PVOID) Device); -} - -PUNKNOWN __inline -KsFilterFactoryRegisterAggregatedClientUnknown( - IN PKSFILTERFACTORY FilterFactory, - IN PUNKNOWN ClientUnknown - ) -{ - return KsRegisterAggregatedClientUnknown((PVOID) FilterFactory,ClientUnknown); -} - -PUNKNOWN __inline -KsFilterFactoryGetOuterUnknown( - IN PKSFILTERFACTORY FilterFactory - ) -{ - return KsGetOuterUnknown((PVOID) FilterFactory); -} - -PUNKNOWN __inline -KsFilterRegisterAggregatedClientUnknown( - IN PKSFILTER Filter, - IN PUNKNOWN ClientUnknown - ) -{ - return KsRegisterAggregatedClientUnknown((PVOID) Filter,ClientUnknown); -} - -PUNKNOWN __inline -KsFilterGetOuterUnknown( - IN PKSFILTER Filter - ) -{ - return KsGetOuterUnknown((PVOID) Filter); -} - -PUNKNOWN __inline -KsPinRegisterAggregatedClientUnknown( - IN PKSPIN Pin, - IN PUNKNOWN ClientUnknown - ) -{ - return KsRegisterAggregatedClientUnknown((PVOID) Pin,ClientUnknown); -} - -PUNKNOWN __inline -KsPinGetOuterUnknown( - IN PKSPIN Pin - ) -{ - return KsGetOuterUnknown((PVOID) Pin); -} - -#endif // defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - -#else // !defined(_NTDDK_) - -#if !defined( KS_NO_CREATE_FUNCTIONS ) - -KSDDKAPI -DWORD -WINAPI -KsCreateAllocator( - IN HANDLE ConnectionHandle, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PHANDLE AllocatorHandle - ); - -KSDDKAPI -DWORD -NTAPI -KsCreateClock( - IN HANDLE ConnectionHandle, - IN PKSCLOCK_CREATE ClockCreate, - OUT PHANDLE ClockHandle - ); - -KSDDKAPI -DWORD -WINAPI -KsCreatePin( - IN HANDLE FilterHandle, - IN PKSPIN_CONNECT Connect, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE ConnectionHandle - ); - -KSDDKAPI -DWORD -WINAPI -KsCreateTopologyNode( - IN HANDLE ParentHandle, - IN PKSNODE_CREATE NodeCreate, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE NodeHandle - ); - -#endif - -#endif // !defined(_NTDDK_) - -#if defined(__cplusplus) -} -#endif // defined(__cplusplus) - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - #if !defined(_NTRTL_) - #ifndef DEFINE_GUIDEX - #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name - #endif // !defined(DEFINE_GUIDEX) - - #ifndef STATICGUIDOF - #define STATICGUIDOF(guid) STATIC_##guid - #endif // !defined(STATICGUIDOF) - #endif // !defined(_NTRTL_) - - #ifndef SIZEOF_ARRAY - #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0])) - #endif // !defined(SIZEOF_ARRAY) - - #if defined(__cplusplus) && _MSC_VER >= 1100 - #define DEFINE_GUIDSTRUCT(g, n) struct __declspec(uuid(g)) n - #define DEFINE_GUIDNAMED(n) __uuidof(struct n) - #else // !defined(__cplusplus) - #define DEFINE_GUIDSTRUCT(g, n) DEFINE_GUIDEX(n) - #define DEFINE_GUIDNAMED(n) n - #endif // !defined(__cplusplus) - - //=========================================================================== - - #define STATIC_GUID_NULL \ - 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - DEFINE_GUIDSTRUCT("00000000-0000-0000-0000-000000000000", GUID_NULL); - #define GUID_NULL DEFINE_GUIDNAMED(GUID_NULL) - - //=========================================================================== - - #define IOCTL_KS_PROPERTY CTL_CODE(FILE_DEVICE_KS, 0x000, METHOD_NEITHER, FILE_ANY_ACCESS) - #define IOCTL_KS_ENABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x001, METHOD_NEITHER, FILE_ANY_ACCESS) - #define IOCTL_KS_DISABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x002, METHOD_NEITHER, FILE_ANY_ACCESS) - #define IOCTL_KS_METHOD CTL_CODE(FILE_DEVICE_KS, 0x003, METHOD_NEITHER, FILE_ANY_ACCESS) - #define IOCTL_KS_WRITE_STREAM CTL_CODE(FILE_DEVICE_KS, 0x004, METHOD_NEITHER, FILE_WRITE_ACCESS) - #define IOCTL_KS_READ_STREAM CTL_CODE(FILE_DEVICE_KS, 0x005, METHOD_NEITHER, FILE_READ_ACCESS) - #define IOCTL_KS_RESET_STATE CTL_CODE(FILE_DEVICE_KS, 0x006, METHOD_NEITHER, FILE_ANY_ACCESS) - - //=========================================================================== - - typedef enum { - KSRESET_BEGIN, - KSRESET_END - } KSRESET; - - typedef enum { - KSSTATE_STOP, - KSSTATE_ACQUIRE, - KSSTATE_PAUSE, - KSSTATE_RUN - } KSSTATE, *PKSSTATE; - - #define KSPRIORITY_LOW 0x00000001 - #define KSPRIORITY_NORMAL 0x40000000 - #define KSPRIORITY_HIGH 0x80000000 - #define KSPRIORITY_EXCLUSIVE 0xFFFFFFFF - - typedef struct { - ULONG PriorityClass; - ULONG PrioritySubClass; - } KSPRIORITY, *PKSPRIORITY; - - typedef struct { - union { - #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _IDENTIFIER { - #else - struct { - #endif - GUID Set; - ULONG Id; - ULONG Flags; - }; - LONGLONG Alignment; - }; - } KSIDENTIFIER, *PKSIDENTIFIER; - - typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY, KSMETHOD, *PKSMETHOD, KSEVENT, *PKSEVENT; - - #define KSMETHOD_TYPE_NONE 0x00000000 - #define KSMETHOD_TYPE_READ 0x00000001 - #define KSMETHOD_TYPE_WRITE 0x00000002 - #define KSMETHOD_TYPE_MODIFY 0x00000003 - #define KSMETHOD_TYPE_SOURCE 0x00000004 - - #define KSMETHOD_TYPE_SEND 0x00000001 - #define KSMETHOD_TYPE_SETSUPPORT 0x00000100 - #define KSMETHOD_TYPE_BASICSUPPORT 0x00000200 - - #define KSMETHOD_TYPE_TOPOLOGY 0x10000000 - - #define KSPROPERTY_TYPE_GET 0x00000001 - #define KSPROPERTY_TYPE_SET 0x00000002 - #define KSPROPERTY_TYPE_SETSUPPORT 0x00000100 - #define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200 - #define KSPROPERTY_TYPE_RELATIONS 0x00000400 - #define KSPROPERTY_TYPE_SERIALIZESET 0x00000800 - #define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000 - #define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000 - #define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000 - #define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000 - #define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000 - - #define KSPROPERTY_TYPE_TOPOLOGY 0x10000000 - - typedef struct { - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; - } KSP_NODE, *PKSP_NODE; - - typedef struct { - KSMETHOD Method; - ULONG NodeId; - ULONG Reserved; - } KSM_NODE, *PKSM_NODE; - - typedef struct { - KSEVENT Event; - ULONG NodeId; - ULONG Reserved; - } KSE_NODE, *PKSE_NODE; - - #define STATIC_KSPROPTYPESETID_General \ - 0x97E99BA0L, 0xBDEA, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("97E99BA0-BDEA-11CF-A5D6-28DB04C10000", KSPROPTYPESETID_General); - #define KSPROPTYPESETID_General DEFINE_GUIDNAMED(KSPROPTYPESETID_General) - - #if defined(_NTDDK_) && !defined(__wtypes_h__) - enum VARENUM { - VT_EMPTY = 0, - VT_NULL = 1, - VT_I2 = 2, - VT_I4 = 3, - VT_R4 = 4, - VT_R8 = 5, - VT_CY = 6, - VT_DATE = 7, - VT_BSTR = 8, - VT_DISPATCH = 9, - VT_ERROR = 10, - VT_BOOL = 11, - VT_VARIANT = 12, - VT_UNKNOWN = 13, - VT_DECIMAL = 14, - VT_I1 = 16, - VT_UI1 = 17, - VT_UI2 = 18, - VT_UI4 = 19, - VT_I8 = 20, - VT_UI8 = 21, - VT_INT = 22, - VT_UINT = 23, - VT_VOID = 24, - VT_HRESULT = 25, - VT_PTR = 26, - VT_SAFEARRAY = 27, - VT_CARRAY = 28, - VT_USERDEFINED = 29, - VT_LPSTR = 30, - VT_LPWSTR = 31, - VT_FILETIME = 64, - VT_BLOB = 65, - VT_STREAM = 66, - VT_STORAGE = 67, - VT_STREAMED_OBJECT = 68, - VT_STORED_OBJECT = 69, - VT_BLOB_OBJECT = 70, - VT_CF = 71, - VT_CLSID = 72, - VT_VECTOR = 0x1000, - VT_ARRAY = 0x2000, - VT_BYREF = 0x4000, - VT_RESERVED = 0x8000, - VT_ILLEGAL = 0xffff, - VT_ILLEGALMASKED = 0xfff, - VT_TYPEMASK = 0xfff - }; - #endif // _NTDDK_ && !__wtypes_h__ - - typedef struct { - ULONG Size; - ULONG Count; - } KSMULTIPLE_ITEM, *PKSMULTIPLE_ITEM; - - typedef struct { - ULONG AccessFlags; - ULONG DescriptionSize; - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - ULONG Reserved; - } KSPROPERTY_DESCRIPTION, *PKSPROPERTY_DESCRIPTION; - - #define KSPROPERTY_MEMBER_RANGES 0x00000001 - #define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002 - #define KSPROPERTY_MEMBER_VALUES 0x00000003 - - #define KSPROPERTY_MEMBER_FLAG_DEFAULT 0x00000001 - - typedef struct { - ULONG MembersFlags; - ULONG MembersSize; - ULONG MembersCount; - ULONG Flags; - } KSPROPERTY_MEMBERSHEADER, *PKSPROPERTY_MEMBERSHEADER; - - typedef union { - #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _SIGNED { - #else - struct { - #endif - LONG SignedMinimum; - LONG SignedMaximum; - }; - #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _UNSIGNED { - #else - struct { - #endif - ULONG UnsignedMinimum; - ULONG UnsignedMaximum; - }; - } KSPROPERTY_BOUNDS_LONG, *PKSPROPERTY_BOUNDS_LONG; - - typedef union { - #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _SIGNED64 { - #else - struct { - #endif - LONGLONG SignedMinimum; - LONGLONG SignedMaximum; - }; - #if defined( _KS_NO_ANONYMOUS_STRUCTURES_ ) - struct _UNSIGNED64 { - #else - struct { - #endif - #if defined(_NTDDK_) - ULONGLONG UnsignedMinimum; - ULONGLONG UnsignedMaximum; - #else // !_NTDDK_ - DWORDLONG UnsignedMinimum; - DWORDLONG UnsignedMaximum; - #endif // !_NTDDK_ - }; - } KSPROPERTY_BOUNDS_LONGLONG, *PKSPROPERTY_BOUNDS_LONGLONG; - - typedef struct { - ULONG SteppingDelta; - ULONG Reserved; - KSPROPERTY_BOUNDS_LONG Bounds; - } KSPROPERTY_STEPPING_LONG, *PKSPROPERTY_STEPPING_LONG; - - typedef struct { - #if defined(_NTDDK_) - ULONGLONG SteppingDelta; - #else // !_NTDDK_ - DWORDLONG SteppingDelta; - #endif // !_NTDDK_ - KSPROPERTY_BOUNDS_LONGLONG Bounds; - } KSPROPERTY_STEPPING_LONGLONG, *PKSPROPERTY_STEPPING_LONGLONG; - - //=========================================================================== - - #if defined(_NTDDK_) - // - // Structure forward declarations. - // - typedef struct _KSDEVICE_DESCRIPTOR - KSDEVICE_DESCRIPTOR, *PKSDEVICE_DESCRIPTOR; - typedef struct _KSDEVICE_DISPATCH - KSDEVICE_DISPATCH, *PKSDEVICE_DISPATCH; - typedef struct _KSDEVICE - KSDEVICE, *PKSDEVICE; - typedef struct _KSFILTERFACTORY - KSFILTERFACTORY, *PKSFILTERFACTORY; - typedef struct _KSFILTER_DESCRIPTOR - KSFILTER_DESCRIPTOR, *PKSFILTER_DESCRIPTOR; - typedef struct _KSFILTER_DISPATCH - KSFILTER_DISPATCH, *PKSFILTER_DISPATCH; - typedef struct _KSFILTER - KSFILTER, *PKSFILTER; - typedef struct _KSPIN_DESCRIPTOR_EX - KSPIN_DESCRIPTOR_EX, *PKSPIN_DESCRIPTOR_EX; - typedef struct _KSPIN_DISPATCH - KSPIN_DISPATCH, *PKSPIN_DISPATCH; - typedef struct _KSCLOCK_DISPATCH - KSCLOCK_DISPATCH, *PKSCLOCK_DISPATCH; - typedef struct _KSALLOCATOR_DISPATCH - KSALLOCATOR_DISPATCH, *PKSALLOCATOR_DISPATCH; - typedef struct _KSPIN - KSPIN, *PKSPIN; - typedef struct _KSNODE_DESCRIPTOR - KSNODE_DESCRIPTOR, *PKSNODE_DESCRIPTOR; - typedef struct _KSSTREAM_POINTER_OFFSET - KSSTREAM_POINTER_OFFSET, *PKSSTREAM_POINTER_OFFSET; - typedef struct _KSSTREAM_POINTER - KSSTREAM_POINTER, *PKSSTREAM_POINTER; - typedef struct _KSMAPPING - KSMAPPING, *PKSMAPPING; - typedef struct _KSPROCESSPIN - KSPROCESSPIN, *PKSPROCESSPIN; - typedef struct _KSPROCESSPIN_INDEXENTRY - KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY; - #endif // _NTDDK_ - - typedef PVOID PKSWORKER; - - typedef struct { - ULONG NotificationType; - union { - struct { - HANDLE Event; - ULONG_PTR Reserved[2]; - } EventHandle; - struct { - HANDLE Semaphore; - ULONG Reserved; - LONG Adjustment; - } SemaphoreHandle; - #if defined(_NTDDK_) - struct { - PVOID Event; - KPRIORITY Increment; - ULONG_PTR Reserved; - } EventObject; - struct { - PVOID Semaphore; - KPRIORITY Increment; - LONG Adjustment; - } SemaphoreObject; - struct { - PKDPC Dpc; - ULONG ReferenceCount; - ULONG_PTR Reserved; - } Dpc; - struct { - PWORK_QUEUE_ITEM WorkQueueItem; - WORK_QUEUE_TYPE WorkQueueType; - ULONG_PTR Reserved; - } WorkItem; - struct { - PWORK_QUEUE_ITEM WorkQueueItem; - PKSWORKER KsWorkerObject; - ULONG_PTR Reserved; - } KsWorkItem; - // @@BEGIN_DDKSPLIT - struct { - PKSFILTER Filter; - ULONG_PTR Reserved[2]; - } KsFilterProcessing; - struct { - PKSPIN Pin; - ULONG_PTR Reserved[2]; - } KsPinProcessing; - // @@END_DDKSPLIT - #endif // defined(_NTDDK_) - struct { - PVOID Unused; - LONG_PTR Alignment[2]; - } Alignment; - }; - } KSEVENTDATA, *PKSEVENTDATA; - - #define KSEVENTF_EVENT_HANDLE 0x00000001 - #define KSEVENTF_SEMAPHORE_HANDLE 0x00000002 - #if defined(_NTDDK_) - #define KSEVENTF_EVENT_OBJECT 0x00000004 - #define KSEVENTF_SEMAPHORE_OBJECT 0x00000008 - #define KSEVENTF_DPC 0x00000010 - #define KSEVENTF_WORKITEM 0x00000020 - #define KSEVENTF_KSWORKITEM 0x00000080 - // @@BEGIN_DDKSPLIT - #define KSEVENTF_KSFILTERPROCESSING 0x00000100 - #define KSEVENTF_KSPINPROCESSING 0x00000200 - // @@END_DDKSPLIT - #endif // defined(_NTDDK_) - - #define KSEVENT_TYPE_ENABLE 0x00000001 - #define KSEVENT_TYPE_ONESHOT 0x00000002 - #define KSEVENT_TYPE_ENABLEBUFFERED 0x00000004 - #define KSEVENT_TYPE_SETSUPPORT 0x00000100 - #define KSEVENT_TYPE_BASICSUPPORT 0x00000200 - #define KSEVENT_TYPE_QUERYBUFFER 0x00000400 - - #define KSEVENT_TYPE_TOPOLOGY 0x10000000 - - typedef struct { - KSEVENT Event; - PKSEVENTDATA EventData; - PVOID Reserved; - } KSQUERYBUFFER, *PKSQUERYBUFFER; - - typedef struct { - ULONG Size; - ULONG Flags; - union { - HANDLE ObjectHandle; - PVOID ObjectPointer; - }; - PVOID Reserved; - KSEVENT Event; - KSEVENTDATA EventData; - } KSRELATIVEEVENT; - - #define KSRELATIVEEVENT_FLAG_HANDLE 0x00000001 - #define KSRELATIVEEVENT_FLAG_POINTER 0x00000002 - - //=========================================================================== - - typedef struct { - KSEVENTDATA EventData; - LONGLONG MarkTime; - } KSEVENT_TIME_MARK, *PKSEVENT_TIME_MARK; - - typedef struct { - KSEVENTDATA EventData; - LONGLONG TimeBase; - LONGLONG Interval; - } KSEVENT_TIME_INTERVAL, *PKSEVENT_TIME_INTERVAL; - - typedef struct { - LONGLONG TimeBase; - LONGLONG Interval; - } KSINTERVAL, *PKSINTERVAL; - - //=========================================================================== - - #define STATIC_KSPROPSETID_General\ - 0x1464EDA5L, 0x6A8F, 0x11D1, 0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("1464EDA5-6A8F-11D1-9AA7-00A0C9223196", KSPROPSETID_General); - #define KSPROPSETID_General DEFINE_GUIDNAMED(KSPROPSETID_General) - - typedef enum { - KSPROPERTY_GENERAL_COMPONENTID - } KSPROPERTY_GENERAL; - - typedef struct { - GUID Manufacturer; - GUID Product; - GUID Component; - GUID Name; - ULONG Version; - ULONG Revision; - } KSCOMPONENTID, *PKSCOMPONENTID; - - #define DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_GENERAL_COMPONENTID,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCOMPONENTID),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define STATIC_KSMETHODSETID_StreamIo\ - 0x65D003CAL, 0x1523, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("65D003CA-1523-11D2-B27A-00A0C9223196", KSMETHODSETID_StreamIo); - #define KSMETHODSETID_StreamIo DEFINE_GUIDNAMED(KSMETHODSETID_StreamIo) - - typedef enum { - KSMETHOD_STREAMIO_READ, - KSMETHOD_STREAMIO_WRITE - } KSMETHOD_STREAMIO; - - #define DEFINE_KSMETHOD_ITEM_STREAMIO_READ(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMIO_READ,\ - KSMETHOD_TYPE_WRITE,\ - (Handler),\ - sizeof(KSMETHOD),\ - 0,\ - NULL) - - #define DEFINE_KSMETHOD_ITEM_STREAMIO_WRITE(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMIO_WRITE,\ - KSMETHOD_TYPE_READ,\ - (Handler),\ - sizeof(KSMETHOD),\ - 0,\ - NULL) - - #define STATIC_KSPROPSETID_MediaSeeking\ - 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("EE904F0C-D09B-11D0-ABE9-00A0C9223196", KSPROPSETID_MediaSeeking); - #define KSPROPSETID_MediaSeeking DEFINE_GUIDNAMED(KSPROPSETID_MediaSeeking) - - typedef enum { - KSPROPERTY_MEDIASEEKING_CAPABILITIES, - KSPROPERTY_MEDIASEEKING_FORMATS, - KSPROPERTY_MEDIASEEKING_TIMEFORMAT, - KSPROPERTY_MEDIASEEKING_POSITION, - KSPROPERTY_MEDIASEEKING_STOPPOSITION, - KSPROPERTY_MEDIASEEKING_POSITIONS, - KSPROPERTY_MEDIASEEKING_DURATION, - KSPROPERTY_MEDIASEEKING_AVAILABLE, - KSPROPERTY_MEDIASEEKING_PREROLL, - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT - } KSPROPERTY_MEDIASEEKING; - - typedef enum { - KS_SEEKING_NoPositioning, - KS_SEEKING_AbsolutePositioning, - KS_SEEKING_RelativePositioning, - KS_SEEKING_IncrementalPositioning, - KS_SEEKING_PositioningBitsMask = 0x3, - KS_SEEKING_SeekToKeyFrame, - KS_SEEKING_ReturnTime = 0x8 - } KS_SEEKING_FLAGS; - - typedef enum { - KS_SEEKING_CanSeekAbsolute = 0x1, - KS_SEEKING_CanSeekForwards = 0x2, - KS_SEEKING_CanSeekBackwards = 0x4, - KS_SEEKING_CanGetCurrentPos = 0x8, - KS_SEEKING_CanGetStopPos = 0x10, - KS_SEEKING_CanGetDuration = 0x20, - KS_SEEKING_CanPlayBackwards = 0x40 - } KS_SEEKING_CAPABILITIES; - - typedef struct { - LONGLONG Current; - LONGLONG Stop; - KS_SEEKING_FLAGS CurrentFlags; - KS_SEEKING_FLAGS StopFlags; - } KSPROPERTY_POSITIONS, *PKSPROPERTY_POSITIONS; - - typedef struct { - LONGLONG Earliest; - LONGLONG Latest; - } KSPROPERTY_MEDIAAVAILABLE, *PKSPROPERTY_MEDIAAVAILABLE; - - typedef struct { - KSPROPERTY Property; - GUID SourceFormat; - GUID TargetFormat; - LONGLONG Time; - } KSP_TIMEFORMAT, *PKSP_TIMEFORMAT; - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CAPABILITIES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_CAPABILITIES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KS_SEEKING_CAPABILITIES),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_FORMATS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_FORMATS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_TIMEFORMAT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_TIMEFORMAT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_POSITION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_STOPPOSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_STOPPOSITION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITIONS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_POSITIONS,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSPROPERTY_POSITIONS),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_DURATION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_DURATION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_AVAILABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_AVAILABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSPROPERTY_MEDIAAVAILABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_PREROLL(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_PREROLL,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CONVERTTIMEFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT,\ - (Handler),\ - sizeof(KSP_TIMEFORMAT),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - //=========================================================================== - - #define STATIC_KSPROPSETID_Topology\ - 0x720D4AC0L, 0x7533, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("720D4AC0-7533-11D0-A5D6-28DB04C10000", KSPROPSETID_Topology); - #define KSPROPSETID_Topology DEFINE_GUIDNAMED(KSPROPSETID_Topology) - - typedef enum { - KSPROPERTY_TOPOLOGY_CATEGORIES, - KSPROPERTY_TOPOLOGY_NODES, - KSPROPERTY_TOPOLOGY_CONNECTIONS, - KSPROPERTY_TOPOLOGY_NAME - } KSPROPERTY_TOPOLOGY; - - #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_CATEGORIES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_NODES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_CONNECTIONS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_TOPOLOGY_NAME,\ - (Handler),\ - sizeof(KSP_NODE),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_TOPOLOGYSET(TopologySet, Handler)\ - DEFINE_KSPROPERTY_TABLE(TopologySet) {\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler),\ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler)\ - } - - //============================================================================= - - // - // properties used by graph manager to talk to particular filters - // - #if defined(_NTDDK_) - - #define STATIC_KSPROPSETID_GM \ - 0xAF627536L, 0xE719, 0x11D2, 0x8A, 0x1D, 0x00, 0x60, 0x97, 0xD2, 0xDF, 0x5D - DEFINE_GUIDSTRUCT("AF627536-E719-11D2-8A1D-006097D2DF5D", KSPROPSETID_GM); - #define KSPROPSETID_GM DEFINE_GUIDNAMED(KSPROPSETID_GM) - - typedef VOID (*PFNKSGRAPHMANAGER_NOTIFY)(IN PFILE_OBJECT GraphManager, - IN ULONG EventId, - IN PVOID Filter, - IN PVOID Pin, - IN PVOID Frame, - IN ULONG Duration); - - typedef struct KSGRAPHMANAGER_FUNCTIONTABLE { - PFNKSGRAPHMANAGER_NOTIFY NotifyEvent; - } KSGRAPHMANAGER_FUNCTIONTABLE, PKSGRAPHMANAGER_FUNCTIONTABLE; - - typedef struct _KSPROPERTY_GRAPHMANAGER_INTERFACE { - PFILE_OBJECT GraphManager; - KSGRAPHMANAGER_FUNCTIONTABLE FunctionTable; - } KSPROPERTY_GRAPHMANAGER_INTERFACE, *PKSPROPERTY_GRAPHMANAGER_INTERFACE; - - - // - // Commands - // - typedef enum { - KSPROPERTY_GM_GRAPHMANAGER, - KSPROPERTY_GM_TIMESTAMP_CLOCK, - KSPROPERTY_GM_RATEMATCH, - KSPROPERTY_GM_RENDER_CLOCK, - } KSPROPERTY_GM; - - #endif - - //=========================================================================== - - - #define STATIC_KSCATEGORY_BRIDGE \ - 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("085AFF00-62CE-11CF-A5D6-28DB04C10000", KSCATEGORY_BRIDGE); - #define KSCATEGORY_BRIDGE DEFINE_GUIDNAMED(KSCATEGORY_BRIDGE) - - #define STATIC_KSCATEGORY_CAPTURE \ - 0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("65E8773D-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_CAPTURE); - #define KSCATEGORY_CAPTURE DEFINE_GUIDNAMED(KSCATEGORY_CAPTURE) - - #define STATIC_KSCATEGORY_RENDER \ - 0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("65E8773E-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_RENDER); - #define KSCATEGORY_RENDER DEFINE_GUIDNAMED(KSCATEGORY_RENDER) - - #define STATIC_KSCATEGORY_MIXER \ - 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("AD809C00-7B88-11D0-A5D6-28DB04C10000", KSCATEGORY_MIXER); - #define KSCATEGORY_MIXER DEFINE_GUIDNAMED(KSCATEGORY_MIXER) - - #define STATIC_KSCATEGORY_SPLITTER \ - 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("0A4252A0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_SPLITTER); - #define KSCATEGORY_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_SPLITTER) - - #define STATIC_KSCATEGORY_DATACOMPRESSOR \ - 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("1E84C900-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATACOMPRESSOR); - #define KSCATEGORY_DATACOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATACOMPRESSOR) - - #define STATIC_KSCATEGORY_DATADECOMPRESSOR \ - 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("2721AE20-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATADECOMPRESSOR); - #define KSCATEGORY_DATADECOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATADECOMPRESSOR) - - #define STATIC_KSCATEGORY_DATATRANSFORM \ - 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("2EB07EA0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATATRANSFORM); - #define KSCATEGORY_DATATRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_DATATRANSFORM) - - #define STATIC_KSCATEGORY_COMMUNICATIONSTRANSFORM \ - 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("CF1DDA2C-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_COMMUNICATIONSTRANSFORM); - #define KSCATEGORY_COMMUNICATIONSTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_COMMUNICATIONSTRANSFORM) - - #define STATIC_KSCATEGORY_INTERFACETRANSFORM \ - 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("CF1DDA2D-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_INTERFACETRANSFORM); - #define KSCATEGORY_INTERFACETRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_INTERFACETRANSFORM) - - #define STATIC_KSCATEGORY_MEDIUMTRANSFORM \ - 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("CF1DDA2E-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_MEDIUMTRANSFORM); - #define KSCATEGORY_MEDIUMTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_MEDIUMTRANSFORM) - - #define STATIC_KSCATEGORY_FILESYSTEM \ - 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("760FED5E-9357-11D0-A3CC-00A0C9223196", KSCATEGORY_FILESYSTEM); - #define KSCATEGORY_FILESYSTEM DEFINE_GUIDNAMED(KSCATEGORY_FILESYSTEM) - - // KSNAME_Clock - #define STATIC_KSCATEGORY_CLOCK \ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSCATEGORY_CLOCK); - #define KSCATEGORY_CLOCK DEFINE_GUIDNAMED(KSCATEGORY_CLOCK) - - #define STATIC_KSCATEGORY_PROXY \ - 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("97EBAACA-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_PROXY); - #define KSCATEGORY_PROXY DEFINE_GUIDNAMED(KSCATEGORY_PROXY) - - #define STATIC_KSCATEGORY_QUALITY \ - 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY); - #define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY) - - typedef struct { - ULONG FromNode; - ULONG FromNodePin; - ULONG ToNode; - ULONG ToNodePin; - } KSTOPOLOGY_CONNECTION, *PKSTOPOLOGY_CONNECTION; - - typedef struct { - ULONG CategoriesCount; - const GUID* Categories; - ULONG TopologyNodesCount; - const GUID* TopologyNodes; - ULONG TopologyConnectionsCount; - const KSTOPOLOGY_CONNECTION* TopologyConnections; - const GUID* TopologyNodesNames; - ULONG Reserved; - } KSTOPOLOGY, *PKSTOPOLOGY; - - #define KSFILTER_NODE ((ULONG)-1) - #define KSALL_NODES ((ULONG)-1) - - typedef struct { - ULONG CreateFlags; - ULONG Node; - } KSNODE_CREATE, *PKSNODE_CREATE; - - //=========================================================================== - - // TIME_FORMAT_NONE - #define STATIC_KSTIME_FORMAT_NONE STATIC_GUID_NULL - #define KSTIME_FORMAT_NONE GUID_NULL - - // TIME_FORMAT_FRAME - #define STATIC_KSTIME_FORMAT_FRAME\ - 0x7b785570L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 - DEFINE_GUIDSTRUCT("7b785570-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FRAME); - #define KSTIME_FORMAT_FRAME DEFINE_GUIDNAMED(KSTIME_FORMAT_FRAME) - - // TIME_FORMAT_BYTE - #define STATIC_KSTIME_FORMAT_BYTE\ - 0x7b785571L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 - DEFINE_GUIDSTRUCT("7b785571-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_BYTE); - #define KSTIME_FORMAT_BYTE DEFINE_GUIDNAMED(KSTIME_FORMAT_BYTE) - - // TIME_FORMAT_SAMPLE - #define STATIC_KSTIME_FORMAT_SAMPLE\ - 0x7b785572L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 - DEFINE_GUIDSTRUCT("7b785572-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_SAMPLE); - #define KSTIME_FORMAT_SAMPLE DEFINE_GUIDNAMED(KSTIME_FORMAT_SAMPLE) - - // TIME_FORMAT_FIELD - #define STATIC_KSTIME_FORMAT_FIELD\ - 0x7b785573L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 - DEFINE_GUIDSTRUCT("7b785573-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FIELD); - #define KSTIME_FORMAT_FIELD DEFINE_GUIDNAMED(KSTIME_FORMAT_FIELD) - - // TIME_FORMAT_MEDIA_TIME - #define STATIC_KSTIME_FORMAT_MEDIA_TIME\ - 0x7b785574L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 - DEFINE_GUIDSTRUCT("7b785574-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_MEDIA_TIME); - #define KSTIME_FORMAT_MEDIA_TIME DEFINE_GUIDNAMED(KSTIME_FORMAT_MEDIA_TIME) - - //=========================================================================== - - typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE; - - #define STATIC_KSINTERFACESETID_Standard \ - 0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard); - #define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard) - - typedef enum { - KSINTERFACE_STANDARD_STREAMING, - KSINTERFACE_STANDARD_LOOPED_STREAMING, - KSINTERFACE_STANDARD_CONTROL - } KSINTERFACE_STANDARD; - - #define STATIC_KSINTERFACESETID_FileIo \ - 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo); - #define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo) - - typedef enum { - KSINTERFACE_FILEIO_STREAMING - } KSINTERFACE_FILEIO; - - //=========================================================================== - - #define KSMEDIUM_TYPE_ANYINSTANCE 0 - - #define STATIC_KSMEDIUMSETID_Standard \ - 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard); - #define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard) - - //For compatibility only - #define KSMEDIUM_STANDARD_DEVIO KSMEDIUM_TYPE_ANYINSTANCE - - //=========================================================================== - - #define STATIC_KSPROPSETID_Pin\ - 0x8C134960L, 0x51AD, 0x11CF, 0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin); - #define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin) - - typedef enum { - KSPROPERTY_PIN_CINSTANCES, - KSPROPERTY_PIN_CTYPES, - KSPROPERTY_PIN_DATAFLOW, - KSPROPERTY_PIN_DATARANGES, - KSPROPERTY_PIN_DATAINTERSECTION, - KSPROPERTY_PIN_INTERFACES, - KSPROPERTY_PIN_MEDIUMS, - KSPROPERTY_PIN_COMMUNICATION, - KSPROPERTY_PIN_GLOBALCINSTANCES, - KSPROPERTY_PIN_NECESSARYINSTANCES, - KSPROPERTY_PIN_PHYSICALCONNECTION, - KSPROPERTY_PIN_CATEGORY, - KSPROPERTY_PIN_NAME, - KSPROPERTY_PIN_CONSTRAINEDDATARANGES, - KSPROPERTY_PIN_PROPOSEDATAFORMAT - } KSPROPERTY_PIN; - - typedef struct { - KSPROPERTY Property; - ULONG PinId; - ULONG Reserved; - } KSP_PIN, *PKSP_PIN; - - #define KSINSTANCE_INDETERMINATE ((ULONG)-1) - - typedef struct { - ULONG PossibleCount; - ULONG CurrentCount; - } KSPIN_CINSTANCES, *PKSPIN_CINSTANCES; - - typedef enum { - KSPIN_DATAFLOW_IN = 1, - KSPIN_DATAFLOW_OUT - } KSPIN_DATAFLOW, *PKSPIN_DATAFLOW; - - #define KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION 0 - #define KSDATAFORMAT_TEMPORAL_COMPRESSION (1 << KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION) - #define KSDATAFORMAT_BIT_ATTRIBUTES 1 - #define KSDATAFORMAT_ATTRIBUTES (1 << KSDATAFORMAT_BIT_ATTRIBUTES) - - #define KSDATARANGE_BIT_ATTRIBUTES 1 - #define KSDATARANGE_ATTRIBUTES (1 << KSDATARANGE_BIT_ATTRIBUTES) - #define KSDATARANGE_BIT_REQUIRED_ATTRIBUTES 2 - #define KSDATARANGE_REQUIRED_ATTRIBUTES (1 << KSDATARANGE_BIT_REQUIRED_ATTRIBUTES) - - #if !defined( _MSC_VER ) - typedef struct { - ULONG FormatSize; - ULONG Flags; - ULONG SampleSize; - ULONG Reserved; - GUID MajorFormat; - GUID SubFormat; - GUID Specifier; - } KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; - #else - typedef union { - struct { - ULONG FormatSize; - ULONG Flags; - ULONG SampleSize; - ULONG Reserved; - GUID MajorFormat; - GUID SubFormat; - GUID Specifier; - }; - LONGLONG Alignment; - } KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; - #endif - - #define KSATTRIBUTE_REQUIRED 0x00000001 - - typedef struct { - ULONG Size; - ULONG Flags; - GUID Attribute; - } KSATTRIBUTE, *PKSATTRIBUTE; - - #if defined(_NTDDK_) - typedef struct { - ULONG Count; - PKSATTRIBUTE* Attributes; - } KSATTRIBUTE_LIST, *PKSATTRIBUTE_LIST; - #endif // _NTDDK_ - - typedef enum { - KSPIN_COMMUNICATION_NONE, - KSPIN_COMMUNICATION_SINK, - KSPIN_COMMUNICATION_SOURCE, - KSPIN_COMMUNICATION_BOTH, - KSPIN_COMMUNICATION_BRIDGE - } KSPIN_COMMUNICATION, *PKSPIN_COMMUNICATION; - - typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM; - - typedef struct { - KSPIN_INTERFACE Interface; - KSPIN_MEDIUM Medium; - ULONG PinId; - HANDLE PinToHandle; - KSPRIORITY Priority; - } KSPIN_CONNECT, *PKSPIN_CONNECT; - - typedef struct { - ULONG Size; - ULONG Pin; - WCHAR SymbolicLinkName[1]; - } KSPIN_PHYSICALCONNECTION, *PKSPIN_PHYSICALCONNECTION; - - #if defined(_NTDDK_) - typedef - NTSTATUS - (*PFNKSINTERSECTHANDLER)( - IN PIRP Irp, - IN PKSP_PIN Pin, - IN PKSDATARANGE DataRange, - OUT PVOID Data OPTIONAL - ); - typedef - NTSTATUS - (*PFNKSINTERSECTHANDLEREX)( - IN PVOID Context, - IN PIRP Irp, - IN PKSP_PIN Pin, - IN PKSDATARANGE DataRange, - IN PKSDATARANGE MatchingDataRange, - IN ULONG DataBufferSize, - OUT PVOID Data OPTIONAL, - OUT PULONG DataSize - ); - #endif // _NTDDK_ - - #define DEFINE_KSPIN_INTERFACE_TABLE(tablename)\ - const KSPIN_INTERFACE tablename[] = - - #define DEFINE_KSPIN_INTERFACE_ITEM(guid, interface)\ - {\ - STATICGUIDOF(guid),\ - (interface),\ - 0\ - } - - #define DEFINE_KSPIN_MEDIUM_TABLE( tablename )\ - const KSPIN_MEDIUM tablename[] = - - #define DEFINE_KSPIN_MEDIUM_ITEM(guid, medium)\ - DEFINE_KSPIN_INTERFACE_ITEM(guid, medium) - - #define DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_CINSTANCES),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CTYPES,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATAFLOW,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_DATAFLOW),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATARANGES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_DATAINTERSECTION,\ - (Handler),\ - sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_INTERFACES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_MEDIUMS,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_COMMUNICATION,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_COMMUNICATION),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_GLOBALCINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_GLOBALCINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(KSPIN_CINSTANCES),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_NECESSARYINSTANCES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_NECESSARYINSTANCES,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_PHYSICALCONNECTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_PHYSICALCONNECTION,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CATEGORY,\ - (Handler),\ - sizeof(KSP_PIN),\ - sizeof(GUID),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_NAME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_NAME,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_CONSTRAINEDDATARANGES,\ - (Handler),\ - sizeof(KSP_PIN),\ - 0,\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_PIN_PROPOSEDATAFORMAT,\ - NULL,\ - sizeof(KSP_PIN),\ - sizeof(KSDATAFORMAT),\ - (Handler), NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_PINSET(PinSet,\ - PropGeneral, PropInstances, PropIntersection)\ - DEFINE_KSPROPERTY_TABLE(PinSet) {\ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral)\ - } - - #define DEFINE_KSPROPERTY_PINSETCONSTRAINED(PinSet,\ - PropGeneral, PropInstances, PropIntersection)\ - DEFINE_KSPROPERTY_TABLE(PinSet) {\ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral),\ - DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral)\ - } - - #define STATIC_KSNAME_Filter\ - 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("9b365890-165f-11d0-a195-0020afd156e4", KSNAME_Filter); - #define KSNAME_Filter DEFINE_GUIDNAMED(KSNAME_Filter) - - #define KSSTRING_Filter L"{9B365890-165F-11D0-A195-0020AFD156E4}" - - #define STATIC_KSNAME_Pin\ - 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("146F1A80-4791-11D0-A5D6-28DB04C10000", KSNAME_Pin); - #define KSNAME_Pin DEFINE_GUIDNAMED(KSNAME_Pin) - - #define KSSTRING_Pin L"{146F1A80-4791-11D0-A5D6-28DB04C10000}" - - #define STATIC_KSNAME_Clock\ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSNAME_Clock); - #define KSNAME_Clock DEFINE_GUIDNAMED(KSNAME_Clock) - - #define KSSTRING_Clock L"{53172480-4791-11D0-A5D6-28DB04C10000}" - - #define STATIC_KSNAME_Allocator\ - 0x642F5D00L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("642F5D00-4791-11D0-A5D6-28DB04C10000", KSNAME_Allocator); - #define KSNAME_Allocator DEFINE_GUIDNAMED(KSNAME_Allocator) - - #define KSSTRING_Allocator L"{642F5D00-4791-11D0-A5D6-28DB04C10000}" - - #define KSSTRING_AllocatorEx L"{091BB63B-603F-11D1-B067-00A0C9062802}" - - #define STATIC_KSNAME_TopologyNode\ - 0x0621061AL, 0xEE75, 0x11D0, 0xB9, 0x15, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("0621061A-EE75-11D0-B915-00A0C9223196", KSNAME_TopologyNode); - #define KSNAME_TopologyNode DEFINE_GUIDNAMED(KSNAME_TopologyNode) - - #define KSSTRING_TopologyNode L"{0621061A-EE75-11D0-B915-00A0C9223196}" - - #if defined(_NTDDK_) - - typedef struct { - ULONG InterfacesCount; - const KSPIN_INTERFACE* Interfaces; - ULONG MediumsCount; - const KSPIN_MEDIUM* Mediums; - ULONG DataRangesCount; - const PKSDATARANGE* DataRanges; - KSPIN_DATAFLOW DataFlow; - KSPIN_COMMUNICATION Communication; - const GUID* Category; - const GUID* Name; - union { - LONGLONG Reserved; - struct { - ULONG ConstrainedDataRangesCount; - PKSDATARANGE* ConstrainedDataRanges; - }; - }; - } KSPIN_DESCRIPTOR, *PKSPIN_DESCRIPTOR; - typedef const KSPIN_DESCRIPTOR *PCKSPIN_DESCRIPTOR; - - #define DEFINE_KSPIN_DESCRIPTOR_TABLE(tablename)\ - const KSPIN_DESCRIPTOR tablename[] = - - #define DEFINE_KSPIN_DESCRIPTOR_ITEM(\ - InterfacesCount, Interfaces,\ - MediumsCount, Mediums,\ - DataRangesCount, DataRanges,\ - DataFlow, Communication)\ - {\ - InterfacesCount, Interfaces, MediumsCount, Mediums,\ - DataRangesCount, DataRanges, DataFlow, Communication,\ - NULL, NULL, 0\ - } - #define DEFINE_KSPIN_DESCRIPTOR_ITEMEX(\ - InterfacesCount, Interfaces,\ - MediumsCount, Mediums,\ - DataRangesCount, DataRanges,\ - DataFlow, Communication,\ - Category, Name)\ - {\ - InterfacesCount, Interfaces, MediumsCount, Mediums,\ - DataRangesCount, DataRanges, DataFlow, Communication,\ - Category, Name, 0\ - } - - #endif // defined(_NTDDK_) - - //=========================================================================== - - // MEDIATYPE_NULL - #define STATIC_KSDATAFORMAT_TYPE_WILDCARD STATIC_GUID_NULL - #define KSDATAFORMAT_TYPE_WILDCARD GUID_NULL - - // MEDIASUBTYPE_NULL - #define STATIC_KSDATAFORMAT_SUBTYPE_WILDCARD STATIC_GUID_NULL - #define KSDATAFORMAT_SUBTYPE_WILDCARD GUID_NULL - - // MEDIATYPE_Stream - #define STATIC_KSDATAFORMAT_TYPE_STREAM\ - 0xE436EB83L, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 - DEFINE_GUIDSTRUCT("E436EB83-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_TYPE_STREAM); - #define KSDATAFORMAT_TYPE_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STREAM) - - // MEDIASUBTYPE_None - #define STATIC_KSDATAFORMAT_SUBTYPE_NONE\ - 0xE436EB8EL, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 - DEFINE_GUIDSTRUCT("E436EB8E-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_SUBTYPE_NONE); - #define KSDATAFORMAT_SUBTYPE_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NONE) - - #define STATIC_KSDATAFORMAT_SPECIFIER_WILDCARD STATIC_GUID_NULL - #define KSDATAFORMAT_SPECIFIER_WILDCARD GUID_NULL - - #define STATIC_KSDATAFORMAT_SPECIFIER_FILENAME\ - 0xAA797B40L, 0xE974, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("AA797B40-E974-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SPECIFIER_FILENAME); - #define KSDATAFORMAT_SPECIFIER_FILENAME DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILENAME) - - #define STATIC_KSDATAFORMAT_SPECIFIER_FILEHANDLE\ - 0x65E8773CL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("65E8773C-8F56-11D0-A3B9-00A0C9223196", KSDATAFORMAT_SPECIFIER_FILEHANDLE); - #define KSDATAFORMAT_SPECIFIER_FILEHANDLE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILEHANDLE) - - // FORMAT_None - #define STATIC_KSDATAFORMAT_SPECIFIER_NONE\ - 0x0F6417D6L, 0xC318, 0x11D0, 0xA4, 0x3F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("0F6417D6-C318-11D0-A43F-00A0C9223196", KSDATAFORMAT_SPECIFIER_NONE); - #define KSDATAFORMAT_SPECIFIER_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_NONE) - - //=========================================================================== - - #define STATIC_KSPROPSETID_Quality \ - 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("D16AD380-AC1A-11CF-A5D6-28DB04C10000", KSPROPSETID_Quality); - #define KSPROPSETID_Quality DEFINE_GUIDNAMED(KSPROPSETID_Quality) - - typedef enum { - KSPROPERTY_QUALITY_REPORT, - KSPROPERTY_QUALITY_ERROR - } KSPROPERTY_QUALITY; - - #define DEFINE_KSPROPERTY_ITEM_QUALITY_REPORT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_QUALITY_REPORT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSQUALITY),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_QUALITY_ERROR(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_QUALITY_ERROR,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSERROR),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - //=========================================================================== - - #define STATIC_KSPROPSETID_Connection \ - 0x1D58C920L, 0xAC9B, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("1D58C920-AC9B-11CF-A5D6-28DB04C10000", KSPROPSETID_Connection); - #define KSPROPSETID_Connection DEFINE_GUIDNAMED(KSPROPSETID_Connection) - - typedef enum { - KSPROPERTY_CONNECTION_STATE, - KSPROPERTY_CONNECTION_PRIORITY, - KSPROPERTY_CONNECTION_DATAFORMAT, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING, - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT, - KSPROPERTY_CONNECTION_ACQUIREORDERING, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, - KSPROPERTY_CONNECTION_STARTAT - } KSPROPERTY_CONNECTION; - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_STATE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTATE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_PRIORITY(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_PRIORITY,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSPRIORITY),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_DATAFORMAT,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSALLOCATOR_FRAMING),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING_EX(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSALLOCATOR_FRAMING_EX),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_PROPOSEDATAFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSDATAFORMAT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_ACQUIREORDERING(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_ACQUIREORDERING,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(int),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CONNECTION_STARTAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CONNECTION_STARTAT,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSRELATIVEEVENT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - //=========================================================================== - // - // pins flags - // - #define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER 0x00000001 - #define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY 0x00000002 - #define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY 0x00000004 - #define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE 0x00000008 - #define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY 0x80000000 - - #define KSALLOCATOR_OPTIONF_COMPATIBLE 0x00000001 - #define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY 0x00000002 - #define KSALLOCATOR_OPTIONF_VALID 0x00000003 - // - // pins extended framing flags - // - #define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT 0x00000010 - #define KSALLOCATOR_FLAG_DEVICE_SPECIFIC 0x00000020 - #define KSALLOCATOR_FLAG_CAN_ALLOCATE 0x00000040 - #define KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO 0x00000080 - // - // allocator pipes flags - // - // there is at least one data modification in a pipe - #define KSALLOCATOR_FLAG_NO_FRAME_INTEGRITY 0x00000100 - #define KSALLOCATOR_FLAG_MULTIPLE_OUTPUT 0x00000200 - #define KSALLOCATOR_FLAG_CYCLE 0x00000400 - #define KSALLOCATOR_FLAG_ALLOCATOR_EXISTS 0x00000800 - // there is no framing dependency between neighbouring pipes. - #define KSALLOCATOR_FLAG_INDEPENDENT_RANGES 0x00001000 - #define KSALLOCATOR_FLAG_ATTENTION_STEPPING 0x00002000 - - - // - // old Framing structure - // - typedef struct { - union { - ULONG OptionsFlags; // allocator options (create) - ULONG RequirementsFlags; // allocation requirements (query) - }; - #if defined(_NTDDK_) - POOL_TYPE PoolType; - #else // !_NTDDK_ - ULONG PoolType; - #endif // !_NTDDK_ - ULONG Frames; // total number of allowable outstanding frames - ULONG FrameSize; // total size of frame - ULONG FileAlignment; - ULONG Reserved; - } KSALLOCATOR_FRAMING, *PKSALLOCATOR_FRAMING; - - #if defined(_NTDDK_) - typedef - PVOID - (*PFNKSDEFAULTALLOCATE)( - IN PVOID Context - ); - - typedef - VOID - (*PFNKSDEFAULTFREE)( - IN PVOID Context, - IN PVOID Buffer - ); - - typedef - NTSTATUS - (*PFNKSINITIALIZEALLOCATOR)( - IN PVOID InitialContext, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PVOID* Context - ); - - typedef - VOID - (*PFNKSDELETEALLOCATOR)( - IN PVOID Context - ); - #endif // !_NTDDK_ - - // - // new Framing structure, eventually will replace KSALLOCATOR_FRAMING. - // - typedef struct { - ULONG MinFrameSize; - ULONG MaxFrameSize; - ULONG Stepping; - } KS_FRAMING_RANGE, *PKS_FRAMING_RANGE; - - - typedef struct { - KS_FRAMING_RANGE Range; - ULONG InPlaceWeight; - ULONG NotInPlaceWeight; - } KS_FRAMING_RANGE_WEIGHTED, *PKS_FRAMING_RANGE_WEIGHTED; - - - typedef struct { - ULONG RatioNumerator; // compression/expansion ratio - ULONG RatioDenominator; - ULONG RatioConstantMargin; - } KS_COMPRESSION, *PKS_COMPRESSION; - - - // - // Memory Types and Buses are repeated in each entry. - // Easiest to use but takes a little more memory than the varsize layout Pin\Memories\Buses\Ranges. - // - typedef struct { - GUID MemoryType; - GUID BusType; - ULONG MemoryFlags; - ULONG BusFlags; - ULONG Flags; - ULONG Frames; // total number of allowable outstanding frames - ULONG FileAlignment; - ULONG MemoryTypeWeight; // this memory type Weight pin-wide - KS_FRAMING_RANGE PhysicalRange; - KS_FRAMING_RANGE_WEIGHTED FramingRange; - } KS_FRAMING_ITEM, *PKS_FRAMING_ITEM; - - - typedef struct { - ULONG CountItems; // count of FramingItem-s below. - ULONG PinFlags; - KS_COMPRESSION OutputCompression; - ULONG PinWeight; // this pin framing's Weight graph-wide - KS_FRAMING_ITEM FramingItem[1]; - } KSALLOCATOR_FRAMING_EX, *PKSALLOCATOR_FRAMING_EX; - - - - // - // define memory type GUIDs - // - #define KSMEMORY_TYPE_WILDCARD GUID_NULL - #define STATIC_KSMEMORY_TYPE_WILDCARD STATIC_GUID_NULL - - #define KSMEMORY_TYPE_DONT_CARE GUID_NULL - #define STATIC_KSMEMORY_TYPE_DONT_CARE STATIC_GUID_NULL - - #define KS_TYPE_DONT_CARE GUID_NULL - #define STATIC_KS_TYPE_DONT_CARE STATIC_GUID_NULL - - #define STATIC_KSMEMORY_TYPE_SYSTEM \ - 0x091bb638L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - DEFINE_GUIDSTRUCT("091bb638-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_SYSTEM); - #define KSMEMORY_TYPE_SYSTEM DEFINE_GUIDNAMED(KSMEMORY_TYPE_SYSTEM) - - #define STATIC_KSMEMORY_TYPE_USER \ - 0x8cb0fc28L, 0x7893, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - DEFINE_GUIDSTRUCT("8cb0fc28-7893-11d1-b069-00a0c9062802", KSMEMORY_TYPE_USER); - #define KSMEMORY_TYPE_USER DEFINE_GUIDNAMED(KSMEMORY_TYPE_USER) - - #define STATIC_KSMEMORY_TYPE_KERNEL_PAGED \ - 0xd833f8f8L, 0x7894, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - DEFINE_GUIDSTRUCT("d833f8f8-7894-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_PAGED); - #define KSMEMORY_TYPE_KERNEL_PAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_PAGED) - - #define STATIC_KSMEMORY_TYPE_KERNEL_NONPAGED \ - 0x4a6d5fc4L, 0x7895, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - DEFINE_GUIDSTRUCT("4a6d5fc4-7895-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_NONPAGED); - #define KSMEMORY_TYPE_KERNEL_NONPAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_NONPAGED) - - // old KS clients did not specify the device memory type - #define STATIC_KSMEMORY_TYPE_DEVICE_UNKNOWN \ - 0x091bb639L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - DEFINE_GUIDSTRUCT("091bb639-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_DEVICE_UNKNOWN); - #define KSMEMORY_TYPE_DEVICE_UNKNOWN DEFINE_GUIDNAMED(KSMEMORY_TYPE_DEVICE_UNKNOWN) - - // - // Helper framing macros. - // - #define DECLARE_SIMPLE_FRAMING_EX(FramingExName, MemoryType, Flags, Frames, Alignment, MinFrameSize, MaxFrameSize) \ - const KSALLOCATOR_FRAMING_EX FramingExName = \ - {\ - 1, \ - 0, \ - {\ - 1, \ - 1, \ - 0 \ - }, \ - 0, \ - {\ - {\ - MemoryType, \ - STATIC_KS_TYPE_DONT_CARE, \ - 0, \ - 0, \ - Flags, \ - Frames, \ - Alignment, \ - 0, \ - {\ - 0, \ - (ULONG)-1, \ - 1 \ - }, \ - {\ - {\ - MinFrameSize, \ - MaxFrameSize, \ - 1 \ - }, \ - 0, \ - 0 \ - }\ - }\ - }\ - } - - #define SetDefaultKsCompression(KsCompressionPointer) \ - {\ - KsCompressionPointer->RatioNumerator = 1;\ - KsCompressionPointer->RatioDenominator = 1;\ - KsCompressionPointer->RatioConstantMargin = 0;\ - } - - #define SetDontCareKsFramingRange(KsFramingRangePointer) \ - {\ - KsFramingRangePointer->MinFrameSize = 0;\ - KsFramingRangePointer->MaxFrameSize = (ULONG) -1;\ - KsFramingRangePointer->Stepping = 1;\ - } - - #define SetKsFramingRange(KsFramingRangePointer, P_MinFrameSize, P_MaxFrameSize) \ - {\ - KsFramingRangePointer->MinFrameSize = P_MinFrameSize;\ - KsFramingRangePointer->MaxFrameSize = P_MaxFrameSize;\ - KsFramingRangePointer->Stepping = 1;\ - } - - #define SetKsFramingRangeWeighted(KsFramingRangeWeightedPointer, P_MinFrameSize, P_MaxFrameSize) \ - {\ - KS_FRAMING_RANGE *KsFramingRange = &KsFramingRangeWeightedPointer->Range;\ - SetKsFramingRange(KsFramingRange, P_MinFrameSize, P_MaxFrameSize);\ - KsFramingRangeWeightedPointer->InPlaceWeight = 0;\ - KsFramingRangeWeightedPointer->NotInPlaceWeight = 0;\ - } - - #define INITIALIZE_SIMPLE_FRAMING_EX(FramingExPointer, P_MemoryType, P_Flags, P_Frames, P_Alignment, P_MinFrameSize, P_MaxFrameSize) \ - {\ - KS_COMPRESSION *KsCompression = &FramingExPointer->OutputCompression;\ - KS_FRAMING_RANGE *KsFramingRange = &FramingExPointer->FramingItem[0].PhysicalRange;\ - KS_FRAMING_RANGE_WEIGHTED *KsFramingRangeWeighted = &FramingExPointer->FramingItem[0].FramingRange;\ - FramingExPointer->CountItems = 1;\ - FramingExPointer->PinFlags = 0;\ - SetDefaultKsCompression(KsCompression);\ - FramingExPointer->PinWeight = 0;\ - FramingExPointer->FramingItem[0].MemoryType = P_MemoryType;\ - FramingExPointer->FramingItem[0].BusType = KS_TYPE_DONT_CARE;\ - FramingExPointer->FramingItem[0].MemoryFlags = 0;\ - FramingExPointer->FramingItem[0].BusFlags = 0;\ - FramingExPointer->FramingItem[0].Flags = P_Flags;\ - FramingExPointer->FramingItem[0].Frames = P_Frames;\ - FramingExPointer->FramingItem[0].FileAlignment = P_Alignment;\ - FramingExPointer->FramingItem[0].MemoryTypeWeight = 0;\ - SetDontCareKsFramingRange(KsFramingRange);\ - SetKsFramingRangeWeighted(KsFramingRangeWeighted, P_MinFrameSize, P_MaxFrameSize);\ - } - - - - // KSEVENTSETID_StreamAllocator: {75D95571-073C-11d0-A161-0020AFD156E4} - - #define STATIC_KSEVENTSETID_StreamAllocator\ - 0x75d95571L, 0x073c, 0x11d0, 0xa1, 0x61, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("75d95571-073c-11d0-a161-0020afd156e4", KSEVENTSETID_StreamAllocator); - #define KSEVENTSETID_StreamAllocator DEFINE_GUIDNAMED(KSEVENTSETID_StreamAllocator) - - typedef enum { - KSEVENT_STREAMALLOCATOR_INTERNAL_FREEFRAME, - KSEVENT_STREAMALLOCATOR_FREEFRAME - } KSEVENT_STREAMALLOCATOR; - - #define STATIC_KSMETHODSETID_StreamAllocator\ - 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("cf6e4341-ec87-11cf-a130-0020afd156e4", KSMETHODSETID_StreamAllocator); - #define KSMETHODSETID_StreamAllocator DEFINE_GUIDNAMED(KSMETHODSETID_StreamAllocator) - - typedef enum { - KSMETHOD_STREAMALLOCATOR_ALLOC, - KSMETHOD_STREAMALLOCATOR_FREE - } KSMETHOD_STREAMALLOCATOR; - - #define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMALLOCATOR_ALLOC,\ - KSMETHOD_TYPE_WRITE,\ - (Handler),\ - sizeof(KSMETHOD),\ - sizeof(PVOID),\ - NULL) - - #define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(Handler)\ - DEFINE_KSMETHOD_ITEM(\ - KSMETHOD_STREAMALLOCATOR_FREE,\ - KSMETHOD_TYPE_READ,\ - (Handler),\ - sizeof(KSMETHOD),\ - sizeof(PVOID),\ - NULL) - - #define DEFINE_KSMETHOD_ALLOCATORSET(AllocatorSet, MethodAlloc, MethodFree)\ - DEFINE_KSMETHOD_TABLE(AllocatorSet) {\ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(MethodAlloc),\ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(MethodFree)\ - } - - #define STATIC_KSPROPSETID_StreamAllocator\ - 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("cf6e4342-ec87-11cf-a130-0020afd156e4", KSPROPSETID_StreamAllocator); - #define KSPROPSETID_StreamAllocator DEFINE_GUIDNAMED(KSPROPSETID_StreamAllocator) - - #if defined(_NTDDK_) - typedef enum { - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE, - KSPROPERTY_STREAMALLOCATOR_STATUS - } KSPROPERTY_STREAMALLOCATOR; - - #define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMALLOCATOR_STATUS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTREAMALLOCATOR_STATUS),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ALLOCATORSET(AllocatorSet, PropFunctionTable, PropStatus)\ - DEFINE_KSPROPERTY_TABLE(AllocatorSet) {\ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(PropStatus),\ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(PropFunctionTable)\ - } - - typedef - NTSTATUS - (*PFNALLOCATOR_ALLOCATEFRAME)( - IN PFILE_OBJECT FileObject, - PVOID *Frame - ); - - typedef - VOID - (*PFNALLOCATOR_FREEFRAME)( - IN PFILE_OBJECT FileObject, - IN PVOID Frame - ); - - typedef struct { - PFNALLOCATOR_ALLOCATEFRAME AllocateFrame; - PFNALLOCATOR_FREEFRAME FreeFrame; - } KSSTREAMALLOCATOR_FUNCTIONTABLE, *PKSSTREAMALLOCATOR_FUNCTIONTABLE; - #endif // defined(_NTDDK_) - - typedef struct { - KSALLOCATOR_FRAMING Framing; - ULONG AllocatedFrames; - ULONG Reserved; - } KSSTREAMALLOCATOR_STATUS, *PKSSTREAMALLOCATOR_STATUS; - - typedef struct { - KSALLOCATOR_FRAMING_EX Framing; - ULONG AllocatedFrames; - ULONG Reserved; - } KSSTREAMALLOCATOR_STATUS_EX, *PKSSTREAMALLOCATOR_STATUS_EX; - - - #define KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT 0x00000001 - #define KSSTREAM_HEADER_OPTIONSF_PREROLL 0x00000002 - #define KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY 0x00000004 - #define KSSTREAM_HEADER_OPTIONSF_TYPECHANGED 0x00000008 - #define KSSTREAM_HEADER_OPTIONSF_TIMEVALID 0x00000010 - #define KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY 0x00000040 - #define KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE 0x00000080 - #define KSSTREAM_HEADER_OPTIONSF_DURATIONVALID 0x00000100 - #define KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM 0x00000200 - #define KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA 0x80000000 - - typedef struct { - LONGLONG Time; - ULONG Numerator; - ULONG Denominator; - } KSTIME, *PKSTIME; - - typedef struct { - ULONG Size; - ULONG TypeSpecificFlags; - KSTIME PresentationTime; - LONGLONG Duration; - ULONG FrameExtent; - ULONG DataUsed; - PVOID Data; - ULONG OptionsFlags; - #if _WIN64 - ULONG Reserved; - #endif - } KSSTREAM_HEADER, *PKSSTREAM_HEADER; - - #define STATIC_KSPROPSETID_StreamInterface\ - 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a - DEFINE_GUIDSTRUCT("1fdd8ee1-9cd3-11d0-82aa-0000f822fe8a", KSPROPSETID_StreamInterface); - #define KSPROPSETID_StreamInterface DEFINE_GUIDNAMED(KSPROPSETID_StreamInterface) - - typedef enum { - KSPROPERTY_STREAMINTERFACE_HEADERSIZE - } KSPROPERTY_STREAMINTERFACE; - - #define DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE( GetHandler )\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAMINTERFACE_HEADERSIZE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_STREAMINTERFACESET(StreamInterfaceSet,\ - HeaderSizeHandler)\ - DEFINE_KSPROPERTY_TABLE(StreamInterfaceSet) {\ - DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE( HeaderSizeHandler )\ - } - - #define STATIC_KSPROPSETID_Stream\ - 0x65aaba60L, 0x98ae, 0x11cf, 0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("65aaba60-98ae-11cf-a10d-0020afd156e4", KSPROPSETID_Stream); - #define KSPROPSETID_Stream DEFINE_GUIDNAMED(KSPROPSETID_Stream) - - typedef enum { - KSPROPERTY_STREAM_ALLOCATOR, - KSPROPERTY_STREAM_QUALITY, - KSPROPERTY_STREAM_DEGRADATION, - KSPROPERTY_STREAM_MASTERCLOCK, - KSPROPERTY_STREAM_TIMEFORMAT, - KSPROPERTY_STREAM_PRESENTATIONTIME, - KSPROPERTY_STREAM_PRESENTATIONEXTENT, - KSPROPERTY_STREAM_FRAMETIME, - KSPROPERTY_STREAM_RATECAPABILITY, - KSPROPERTY_STREAM_RATE, - KSPROPERTY_STREAM_PIPE_ID - } KSPROPERTY_STREAM; - - #define DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_ALLOCATOR,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_QUALITY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_QUALITY,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSQUALITY_MANAGER),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_DEGRADATION(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_DEGRADATION,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - 0,\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_MASTERCLOCK,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_TIMEFORMAT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_TIMEFORMAT,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(GUID),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONTIME(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PRESENTATIONTIME,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSTIME),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONEXTENT(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PRESENTATIONEXTENT,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_FRAMETIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_FRAMETIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSFRAMETIME),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_RATECAPABILITY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_RATECAPABILITY,\ - (Handler),\ - sizeof(KSRATE_CAPABILITY),\ - sizeof(KSRATE),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_RATE(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_RATE,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(KSRATE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(GetHandler, SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_STREAM_PIPE_ID,\ - (GetHandler),\ - sizeof(KSPROPERTY),\ - sizeof(HANDLE),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - - typedef struct { - HANDLE QualityManager; - PVOID Context; - } KSQUALITY_MANAGER, *PKSQUALITY_MANAGER; - - typedef struct { - LONGLONG Duration; - ULONG FrameFlags; - ULONG Reserved; - } KSFRAMETIME, *PKSFRAMETIME; - - #define KSFRAMETIME_VARIABLESIZE 0x00000001 - - typedef struct { - LONGLONG PresentationStart; - LONGLONG Duration; - KSPIN_INTERFACE Interface; - LONG Rate; - ULONG Flags; - } KSRATE, *PKSRATE; - - #define KSRATE_NOPRESENTATIONSTART 0x00000001 - #define KSRATE_NOPRESENTATIONDURATION 0x00000002 - - typedef struct { - KSPROPERTY Property; - KSRATE Rate; - } KSRATE_CAPABILITY, *PKSRATE_CAPABILITY; - - #define STATIC_KSPROPSETID_Clock \ - 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("DF12A4C0-AC17-11CF-A5D6-28DB04C10000", KSPROPSETID_Clock); - #define KSPROPSETID_Clock DEFINE_GUIDNAMED(KSPROPSETID_Clock) - - // - // Performs a x*y/z operation on 64 bit quantities by splitting the operation. The equation - // is simplified with respect to adding in the remainder for the upper 32 bits. - // - // (xh * 10000000 / Frequency) * 2^32 + ((((xh * 10000000) % Frequency) * 2^32 + (xl * 10000000)) / Frequency) - // - #define NANOSECONDS 10000000 - #define KSCONVERT_PERFORMANCE_TIME(Frequency, PerformanceTime) \ - ((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS / (Frequency)) << 32) + \ - ((((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS) % (Frequency)) << 32) + \ - ((ULONGLONG)(PerformanceTime).LowPart * NANOSECONDS)) / (Frequency))) - - typedef struct { - ULONG CreateFlags; - } KSCLOCK_CREATE, *PKSCLOCK_CREATE; - - typedef struct { - LONGLONG Time; - LONGLONG SystemTime; - } KSCORRELATED_TIME, *PKSCORRELATED_TIME; - - typedef struct { - LONGLONG Granularity; - LONGLONG Error; - } KSRESOLUTION, *PKSRESOLUTION; - - typedef enum { - KSPROPERTY_CLOCK_TIME, - KSPROPERTY_CLOCK_PHYSICALTIME, - KSPROPERTY_CLOCK_CORRELATEDTIME, - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME, - KSPROPERTY_CLOCK_RESOLUTION, - KSPROPERTY_CLOCK_STATE, - #if defined(_NTDDK_) - KSPROPERTY_CLOCK_FUNCTIONTABLE - #endif // defined(_NTDDK_) - } KSPROPERTY_CLOCK; - - #if defined(_NTDDK_) - - typedef - LONGLONG - (FASTCALL *PFNKSCLOCK_GETTIME)( - IN PFILE_OBJECT FileObject - ); - typedef - LONGLONG - (FASTCALL *PFNKSCLOCK_CORRELATEDTIME)( - IN PFILE_OBJECT FileObject, - OUT PLONGLONG SystemTime); - - typedef struct { - PFNKSCLOCK_GETTIME GetTime; - PFNKSCLOCK_GETTIME GetPhysicalTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedPhysicalTime; - } KSCLOCK_FUNCTIONTABLE, *PKSCLOCK_FUNCTIONTABLE; - - typedef - BOOLEAN - (*PFNKSSETTIMER)( - IN PVOID Context, - IN PKTIMER Timer, - IN LARGE_INTEGER DueTime, - IN PKDPC Dpc - ); - - typedef - BOOLEAN - (*PFNKSCANCELTIMER)( - IN PVOID Context, - IN PKTIMER Timer - ); - - typedef - LONGLONG - (FASTCALL *PFNKSCORRELATEDTIME)( - IN PVOID Context, - OUT PLONGLONG SystemTime); - - typedef PVOID PKSDEFAULTCLOCK; - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_TIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_PHYSICALTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(LONGLONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_CORRELATEDTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCORRELATED_TIME),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCORRELATED_TIME),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_RESOLUTION,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSRESOLUTION),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_STATE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSSTATE),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_CLOCK_FUNCTIONTABLE,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(KSCLOCK_FUNCTIONTABLE),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_CLOCKSET(ClockSet,\ - PropTime, PropPhysicalTime,\ - PropCorrelatedTime, PropCorrelatedPhysicalTime,\ - PropResolution, PropState, PropFunctionTable)\ - DEFINE_KSPROPERTY_TABLE(ClockSet) {\ - DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(PropTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(PropPhysicalTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(PropCorrelatedTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(PropCorrelatedPhysicalTime),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(PropResolution),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(PropState),\ - DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(PropFunctionTable),\ - } - - #endif // defined(_NTDDK_) - - #define STATIC_KSEVENTSETID_Clock \ - 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("364D8E20-62C7-11CF-A5D6-28DB04C10000", KSEVENTSETID_Clock); - #define KSEVENTSETID_Clock DEFINE_GUIDNAMED(KSEVENTSETID_Clock) - - typedef enum { - KSEVENT_CLOCK_INTERVAL_MARK, - KSEVENT_CLOCK_POSITION_MARK - } KSEVENT_CLOCK_POSITION; - - #define STATIC_KSEVENTSETID_Connection\ - 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("7f4bcbe0-9ea5-11cf-a5d6-28db04c10000", KSEVENTSETID_Connection); - #define KSEVENTSETID_Connection DEFINE_GUIDNAMED(KSEVENTSETID_Connection) - - typedef enum { - KSEVENT_CONNECTION_POSITIONUPDATE, - KSEVENT_CONNECTION_DATADISCONTINUITY, - KSEVENT_CONNECTION_TIMEDISCONTINUITY, - KSEVENT_CONNECTION_PRIORITY, - KSEVENT_CONNECTION_ENDOFSTREAM - } KSEVENT_CONNECTION; - - typedef struct { - PVOID Context; - ULONG Proportion; - LONGLONG DeltaTime; - } KSQUALITY, *PKSQUALITY; - - typedef struct { - PVOID Context; - ULONG Status; - } KSERROR, *PKSERROR; - - typedef KSIDENTIFIER KSDEGRADE, *PKSDEGRADE; - - #define STATIC_KSDEGRADESETID_Standard\ - 0x9F564180L, 0x704C, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("9F564180-704C-11D0-A5D6-28DB04C10000", KSDEGRADESETID_Standard); - #define KSDEGRADESETID_Standard DEFINE_GUIDNAMED(KSDEGRADESETID_Standard) - - typedef enum { - KSDEGRADE_STANDARD_SAMPLE, - KSDEGRADE_STANDARD_QUALITY, - KSDEGRADE_STANDARD_COMPUTATION, - KSDEGRADE_STANDARD_SKIP - } KSDEGRADE_STANDARD; - - #if defined(_NTDDK_) - - #define KSPROBE_STREAMREAD 0x00000000 - #define KSPROBE_STREAMWRITE 0x00000001 - #define KSPROBE_ALLOCATEMDL 0x00000010 - #define KSPROBE_PROBEANDLOCK 0x00000020 - #define KSPROBE_SYSTEMADDRESS 0x00000040 - #define KSPROBE_MODIFY 0x00000200 - #define KSPROBE_STREAMWRITEMODIFY (KSPROBE_MODIFY | KSPROBE_STREAMWRITE) - #define KSPROBE_ALLOWFORMATCHANGE 0x00000080 - - #define KSSTREAM_READ KSPROBE_STREAMREAD - #define KSSTREAM_WRITE KSPROBE_STREAMWRITE - #define KSSTREAM_PAGED_DATA 0x00000000 - #define KSSTREAM_NONPAGED_DATA 0x00000100 - #define KSSTREAM_SYNCHRONOUS 0x00001000 - #define KSSTREAM_FAILUREEXCEPTION 0x00002000 - - typedef - NTSTATUS - (*PFNKSCONTEXT_DISPATCH)( - IN PVOID Context, - IN PIRP Irp - ); - - typedef - NTSTATUS - (*PFNKSHANDLER)( - IN PIRP Irp, - IN PKSIDENTIFIER Request, - IN OUT PVOID Data - ); - - typedef - BOOLEAN - (*PFNKSFASTHANDLER)( - IN PFILE_OBJECT FileObject, - IN PKSIDENTIFIER UNALIGNED Request, - IN ULONG RequestLength, - IN OUT PVOID UNALIGNED Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus - ); - - typedef - NTSTATUS - (*PFNKSALLOCATOR)( - IN PIRP Irp, - IN ULONG BufferSize, - IN BOOLEAN InputOperation - ); - - typedef struct { - KSPROPERTY_MEMBERSHEADER MembersHeader; - const VOID* Members; - } KSPROPERTY_MEMBERSLIST, *PKSPROPERTY_MEMBERSLIST; - - typedef struct { - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - const KSPROPERTY_MEMBERSLIST* MembersList; - } KSPROPERTY_VALUES, *PKSPROPERTY_VALUES; - - #define DEFINE_KSPROPERTY_TABLE(tablename)\ - const KSPROPERTY_ITEM tablename[] = - - #define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler,\ - MinProperty,\ - MinData,\ - SetHandler,\ - Values, RelationsCount, Relations, SupportHandler,\ - SerializedSize)\ - {\ - PropertyId, (PFNKSHANDLER)GetHandler, MinProperty, MinData,\ - (PFNKSHANDLER)SetHandler,\ - (PKSPROPERTY_VALUES)Values, RelationsCount, (PKSPROPERTY)Relations,\ - (PFNKSHANDLER)SupportHandler, (ULONG)SerializedSize\ - } - - typedef struct { - ULONG PropertyId; - union { - PFNKSHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - ULONG MinProperty; - ULONG MinData; - union { - PFNKSHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - const KSPROPERTY_VALUES*Values; - ULONG RelationsCount; - const KSPROPERTY* Relations; - PFNKSHANDLER SupportHandler; - ULONG SerializedSize; - } KSPROPERTY_ITEM, *PKSPROPERTY_ITEM; - - #define DEFINE_KSFASTPROPERTY_ITEM(PropertyId, GetHandler, SetHandler)\ - {\ - PropertyId, (PFNKSFASTHANDLER)GetHandler, (PFNKSFASTHANDLER)SetHandler, 0\ - } - - typedef struct { - ULONG PropertyId; - union { - PFNKSFASTHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - union { - PFNKSFASTHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - ULONG Reserved; - } KSFASTPROPERTY_ITEM, *PKSFASTPROPERTY_ITEM; - - #define DEFINE_KSPROPERTY_SET(Set,\ - PropertiesCount,\ - PropertyItem,\ - FastIoCount,\ - FastIoTable)\ - {\ - Set,\ - PropertiesCount,\ - PropertyItem,\ - FastIoCount,\ - FastIoTable\ - } - - #define DEFINE_KSPROPERTY_SET_TABLE(tablename)\ - const KSPROPERTY_SET tablename[] = - - typedef struct { - const GUID* Set; - ULONG PropertiesCount; - const KSPROPERTY_ITEM* PropertyItem; - ULONG FastIoCount; - const KSFASTPROPERTY_ITEM* FastIoTable; - } KSPROPERTY_SET, *PKSPROPERTY_SET; - - #define DEFINE_KSMETHOD_TABLE(tablename)\ - const KSMETHOD_ITEM tablename[] = - - #define DEFINE_KSMETHOD_ITEM(MethodId, Flags,\ - MethodHandler,\ - MinMethod, MinData, SupportHandler)\ - {\ - MethodId, (PFNKSHANDLER)MethodHandler, MinMethod, MinData,\ - SupportHandler, Flags\ - } - - typedef struct { - ULONG MethodId; - union { - PFNKSHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; - ULONG MinMethod; - ULONG MinData; - PFNKSHANDLER SupportHandler; - ULONG Flags; - } KSMETHOD_ITEM, *PKSMETHOD_ITEM; - - #define DEFINE_KSFASTMETHOD_ITEM(MethodId, MethodHandler)\ - {\ - MethodId, (PFNKSFASTHANDLER)MethodHandler\ - } - - typedef struct { - ULONG MethodId; - union { - PFNKSFASTHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; - } KSFASTMETHOD_ITEM, *PKSFASTMETHOD_ITEM; - - #define DEFINE_KSMETHOD_SET(Set,\ - MethodsCount,\ - MethodItem,\ - FastIoCount,\ - FastIoTable)\ - {\ - Set,\ - MethodsCount,\ - MethodItem,\ - FastIoCount,\ - FastIoTable\ - } - - #define DEFINE_KSMETHOD_SET_TABLE(tablename)\ - const KSMETHOD_SET tablename[] = - - typedef struct { - const GUID* Set; - ULONG MethodsCount; - const KSMETHOD_ITEM* MethodItem; - ULONG FastIoCount; - const KSFASTMETHOD_ITEM*FastIoTable; - } KSMETHOD_SET, *PKSMETHOD_SET; - - typedef struct _KSEVENT_ENTRY - KSEVENT_ENTRY, *PKSEVENT_ENTRY; - - typedef - NTSTATUS - (*PFNKSADDEVENT)( - IN PIRP Irp, - IN PKSEVENTDATA EventData, - IN struct _KSEVENT_ENTRY* EventEntry - ); - - typedef - VOID - (*PFNKSREMOVEEVENT)( - IN PFILE_OBJECT FileObject, - IN struct _KSEVENT_ENTRY* EventEntry - ); - - #define DEFINE_KSEVENT_TABLE(tablename)\ - const KSEVENT_ITEM tablename[] = - - #define DEFINE_KSEVENT_ITEM(EventId, DataInput, ExtraEntryData,\ - AddHandler, RemoveHandler, SupportHandler)\ - {\ - EventId,\ - DataInput,\ - ExtraEntryData,\ - AddHandler,\ - RemoveHandler,\ - SupportHandler\ - } - - typedef struct { - ULONG EventId; - ULONG DataInput; - ULONG ExtraEntryData; - PFNKSADDEVENT AddHandler; - PFNKSREMOVEEVENT RemoveHandler; - PFNKSHANDLER SupportHandler; - } KSEVENT_ITEM, *PKSEVENT_ITEM; - - #define DEFINE_KSEVENT_SET(Set,\ - EventsCount,\ - EventItem)\ - {\ - Set, EventsCount, EventItem\ - } - - #define DEFINE_KSEVENT_SET_TABLE(tablename)\ - const KSEVENT_SET tablename[] = - - typedef struct { - const GUID* Set; - ULONG EventsCount; - const KSEVENT_ITEM* EventItem; - } KSEVENT_SET, *PKSEVENT_SET; - - typedef struct { - KDPC Dpc; - ULONG ReferenceCount; - KSPIN_LOCK AccessLock; - } KSDPC_ITEM, *PKSDPC_ITEM; - - typedef struct { - KSDPC_ITEM DpcItem; - LIST_ENTRY BufferList; - } KSBUFFER_ITEM, *PKSBUFFER_ITEM; - - #define KSEVENT_ENTRY_DELETED 1 - #define KSEVENT_ENTRY_ONESHOT 2 - #define KSEVENT_ENTRY_BUFFERED 4 - - struct _KSEVENT_ENTRY { - LIST_ENTRY ListEntry; - PVOID Object; - union { - PKSDPC_ITEM DpcItem; - PKSBUFFER_ITEM BufferItem; - }; - PKSEVENTDATA EventData; - ULONG NotificationType; - const KSEVENT_SET* EventSet; - const KSEVENT_ITEM* EventItem; - PFILE_OBJECT FileObject; - ULONG SemaphoreAdjustment; - ULONG Reserved; - ULONG Flags; - }; - - typedef enum { - KSEVENTS_NONE, - KSEVENTS_SPINLOCK, - KSEVENTS_MUTEX, - KSEVENTS_FMUTEX, - KSEVENTS_FMUTEXUNSAFE, - KSEVENTS_INTERRUPT, - KSEVENTS_ERESOURCE - } KSEVENTS_LOCKTYPE; - - #define KSDISPATCH_FASTIO 0x80000000 - - typedef struct { - PDRIVER_DISPATCH Create; - PVOID Context; - UNICODE_STRING ObjectClass; - PSECURITY_DESCRIPTOR SecurityDescriptor; - ULONG Flags; - } KSOBJECT_CREATE_ITEM, *PKSOBJECT_CREATE_ITEM; - - typedef - VOID - (*PFNKSITEMFREECALLBACK)( - IN PKSOBJECT_CREATE_ITEM CreateItem - ); - - #define KSCREATE_ITEM_SECURITYCHANGED 0x00000001 - #define KSCREATE_ITEM_WILDCARD 0x00000002 - #define KSCREATE_ITEM_NOPARAMETERS 0x00000004 - #define KSCREATE_ITEM_FREEONSTOP 0x00000008 - - #define DEFINE_KSCREATE_DISPATCH_TABLE( tablename )\ - KSOBJECT_CREATE_ITEM tablename[] = - - #define DEFINE_KSCREATE_ITEM(DispatchCreate, TypeName, Context)\ - {\ - (DispatchCreate),\ - (PVOID)(Context),\ - {\ - sizeof(TypeName) - sizeof(UNICODE_NULL),\ - sizeof(TypeName),\ - (PWCHAR)(TypeName)\ - },\ - NULL, 0\ - } - - #define DEFINE_KSCREATE_ITEMEX(DispatchCreate, TypeName, Context, Flags)\ - {\ - (DispatchCreate),\ - (PVOID)(Context),\ - {\ - sizeof(TypeName) - sizeof(UNICODE_NULL),\ - sizeof(TypeName),\ - (PWCHAR)(TypeName)\ - },\ - NULL, (Flags)\ - } - - #define DEFINE_KSCREATE_ITEMNULL( DispatchCreate, Context )\ - {\ - DispatchCreate,\ - Context,\ - {\ - 0,\ - 0,\ - NULL,\ - },\ - NULL, 0\ - } - - typedef struct { - ULONG CreateItemsCount; - PKSOBJECT_CREATE_ITEM CreateItemsList; - } KSOBJECT_CREATE, *PKSOBJECT_CREATE; - - typedef struct { - PDRIVER_DISPATCH DeviceIoControl; - PDRIVER_DISPATCH Read; - PDRIVER_DISPATCH Write; - PDRIVER_DISPATCH Flush; - PDRIVER_DISPATCH Close; - PDRIVER_DISPATCH QuerySecurity; - PDRIVER_DISPATCH SetSecurity; - PFAST_IO_DEVICE_CONTROL FastDeviceIoControl; - PFAST_IO_READ FastRead; - PFAST_IO_WRITE FastWrite; - } KSDISPATCH_TABLE, *PKSDISPATCH_TABLE; - - #define DEFINE_KSDISPATCH_TABLE( tablename, DeviceIoControl, Read, Write,\ - Flush, Close, QuerySecurity, SetSecurity,\ - FastDeviceIoControl, FastRead, FastWrite )\ - const KSDISPATCH_TABLE tablename = \ - {\ - DeviceIoControl, \ - Read, \ - Write, \ - Flush, \ - Close, \ - QuerySecurity, \ - SetSecurity, \ - FastDeviceIoControl, \ - FastRead, \ - FastWrite, \ - } - - #define KSCREATE_ITEM_IRP_STORAGE(Irp) ((PKSOBJECT_CREATE_ITEM)(Irp)->Tail.Overlay.DriverContext[0]) - #define KSEVENT_SET_IRP_STORAGE(Irp) ((const KSEVENT_SET*)(Irp)->Tail.Overlay.DriverContext[0]) - #define KSEVENT_ITEM_IRP_STORAGE(Irp) ((const KSEVENT_ITEM*)(Irp)->Tail.Overlay.DriverContext[3]) - #define KSEVENT_ENTRY_IRP_STORAGE(Irp) ((PKSEVENT_ENTRY)(Irp)->Tail.Overlay.DriverContext[0]) - #define KSMETHOD_SET_IRP_STORAGE(Irp) ((const KSMETHOD_SET*)(Irp)->Tail.Overlay.DriverContext[0]) - #define KSMETHOD_ITEM_IRP_STORAGE(Irp) ((const KSMETHOD_ITEM*)(Irp)->Tail.Overlay.DriverContext[3]) - #define KSMETHOD_TYPE_IRP_STORAGE(Irp) ((ULONG_PTR)((Irp)->Tail.Overlay.DriverContext[2])) - #define KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) ((PKSPIN_LOCK)(Irp)->Tail.Overlay.DriverContext[1]) - #define KSPROPERTY_SET_IRP_STORAGE(Irp) ((const KSPROPERTY_SET*)(Irp)->Tail.Overlay.DriverContext[0]) - #define KSPROPERTY_ITEM_IRP_STORAGE(Irp) ((const KSPROPERTY_ITEM*)(Irp)->Tail.Overlay.DriverContext[3]) - #define KSPROPERTY_ATTRIBUTES_IRP_STORAGE(Irp) ((PKSATTRIBUTE_LIST)(Irp)->Tail.Overlay.DriverContext[2]) - - typedef PVOID KSDEVICE_HEADER, KSOBJECT_HEADER; - - typedef enum { - KsInvokeOnSuccess = 1, - KsInvokeOnError = 2, - KsInvokeOnCancel = 4 - } KSCOMPLETION_INVOCATION; - - typedef enum { - KsListEntryTail, - KsListEntryHead - } KSLIST_ENTRY_LOCATION; - - typedef enum { - KsAcquireOnly, - KsAcquireAndRemove, - KsAcquireOnlySingleItem, - KsAcquireAndRemoveOnlySingleItem - } KSIRP_REMOVAL_OPERATION; - - typedef enum { - KsStackCopyToNewLocation, - KsStackReuseCurrentLocation, - KsStackUseNewLocation - } KSSTACK_USE; - - typedef enum { - KSTARGET_STATE_DISABLED, - KSTARGET_STATE_ENABLED - } KSTARGET_STATE; - - typedef - NTSTATUS - (*PFNKSIRPLISTCALLBACK)( - IN PIRP Irp, - IN PVOID Context - ); - - typedef - VOID - (*PFNREFERENCEDEVICEOBJECT)( - IN PVOID Context - ); - - typedef - VOID - (*PFNDEREFERENCEDEVICEOBJECT)( - IN PVOID Context - ); - - typedef - NTSTATUS - (*PFNQUERYREFERENCESTRING)( - IN PVOID Context, - IN OUT PWCHAR *String - ); - - #define BUS_INTERFACE_REFERENCE_VERSION 0x100 - - typedef struct { - // - // Standard interface header - // - - INTERFACE Interface; - - // - // Standard bus interfaces - // - - PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject; - PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject; - PFNQUERYREFERENCESTRING QueryReferenceString; - - } BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE; - - #define STATIC_REFERENCE_BUS_INTERFACE STATIC_KSMEDIUMSETID_Standard - #define REFERENCE_BUS_INTERFACE KSMEDIUMSETID_Standard - - typedef - NTSTATUS - (*PFNQUERYMEDIUMSLIST)( - IN PVOID Context, - OUT ULONG* MediumsCount, - OUT PKSPIN_MEDIUM* MediumList - ); - - typedef struct { - // - // Standard interface header - // - - INTERFACE Interface; - - // - // Interface definition - // - - PFNQUERYMEDIUMSLIST QueryMediumsList; - - } BUS_INTERFACE_MEDIUMS, *PBUS_INTERFACE_MEDIUMS; - - #define STATIC_GUID_BUS_INTERFACE_MEDIUMS \ - 0x4EC35C3EL, 0x201B, 0x11D2, 0x87, 0x45, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("4EC35C3E-201B-11D2-8745-00A0C9223196", GUID_BUS_INTERFACE_MEDIUMS); - #define GUID_BUS_INTERFACE_MEDIUMS DEFINE_GUIDNAMED(GUID_BUS_INTERFACE_MEDIUMS) - - #endif // defined(_NTDDK_) - - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - - typedef struct { - GUID PropertySet; - ULONG Count; - } KSPROPERTY_SERIALHDR, *PKSPROPERTY_SERIALHDR; - - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - - typedef struct { - KSIDENTIFIER PropTypeSet; - ULONG Id; - ULONG PropertyLength; - } KSPROPERTY_SERIAL, *PKSPROPERTY_SERIAL; - - #if defined(_NTDDK_) - - #define IOCTL_KS_HANDSHAKE CTL_CODE(FILE_DEVICE_KS, 0x007, METHOD_NEITHER, FILE_ANY_ACCESS) - - typedef struct { - GUID ProtocolId; - PVOID Argument1; - PVOID Argument2; - } KSHANDSHAKE, *PKSHANDSHAKE; - - typedef struct _KSGATE - KSGATE, *PKSGATE; - - struct _KSGATE { - LONG Count; - PKSGATE NextGate; - }; - - #ifndef _NTOS_ - - void __inline - KsGateTurnInputOn( - IN PKSGATE Gate OPTIONAL - ) - { - while (Gate && (InterlockedIncrement(&Gate->Count) == 1)) { - Gate = Gate->NextGate; - } - } - - void __inline - KsGateTurnInputOff( - IN PKSGATE Gate OPTIONAL - ) - { - while (Gate && (InterlockedDecrement(&Gate->Count) == 0)) { - Gate = Gate->NextGate; - } - } - - BOOLEAN __inline - KsGateGetStateUnsafe( - IN PKSGATE Gate - ) - { - ASSERT(Gate); - return Gate->Count > 0; - } - - BOOLEAN __inline - KsGateCaptureThreshold( - IN PKSGATE Gate - ) - { - BOOLEAN captured; - - ASSERT(Gate); - - captured = (InterlockedCompareExchange(&Gate->Count,0,1) == 1); - - // - // If we made a transition, it must be propagated. - // - if (captured) { - KsGateTurnInputOff(Gate->NextGate); - } - - // - // We return whatever the state was prior to the compare/exchange. If - // the state was on, the state is now off. - // - return captured; - } - - void __inline - KsGateInitialize( - IN PKSGATE Gate, - IN LONG InitialCount, - IN PKSGATE NextGate OPTIONAL, - IN BOOLEAN StateToPropagate // IN BOOLEAN NextGateIsAnOrGate - ) - { - ASSERT(Gate); - Gate->Count = InitialCount; - Gate->NextGate = NextGate; - - if (NextGate) { - if (InitialCount > 0) { - if (StateToPropagate) { - KsGateTurnInputOn(NextGate); - } - } else { - if (! StateToPropagate) { - KsGateTurnInputOff(NextGate); - } - } - } - } - - void __inline - KsGateInitializeAnd( - IN PKSGATE AndGate, - IN PKSGATE NextOrGate OPTIONAL - ) - { - KsGateInitialize(AndGate,1,NextOrGate,TRUE); - } - - void __inline - KsGateInitializeOr( - IN PKSGATE OrGate, - IN PKSGATE NextAndGate OPTIONAL - ) - { - KsGateInitialize(OrGate,0,NextAndGate,FALSE); - } - - void __inline KsGateAddOnInputToAnd(IN PKSGATE AndGate) {} - void __inline KsGateAddOffInputToAnd(IN PKSGATE AndGate) { KsGateTurnInputOff(AndGate); } - void __inline KsGateRemoveOnInputFromAnd(IN PKSGATE AndGate) {} - void __inline KsGateRemoveOffInputFromAnd(IN PKSGATE AndGate) { KsGateTurnInputOn(AndGate); } - - void __inline KsGateAddOnInputToOr(IN PKSGATE OrGate) { KsGateTurnInputOn(OrGate); } - void __inline KsGateAddOffInputToOr(IN PKSGATE OrGate) {} - void __inline KsGateRemoveOnInputFromOr(IN PKSGATE OrGate) { KsGateTurnInputOff(OrGate); } - void __inline KsGateRemoveOffInputFromOr(IN PKSGATE OrGate) {} - - void __inline - KsGateTerminateAnd( - IN PKSGATE AndGate - ) - { - ASSERT(AndGate); - if (KsGateGetStateUnsafe(AndGate)) { - KsGateRemoveOnInputFromOr(AndGate->NextGate); - } else { - KsGateRemoveOffInputFromOr(AndGate->NextGate); - } - } - - void __inline - KsGateTerminateOr( - IN PKSGATE OrGate - ) - { - ASSERT(OrGate); - if (KsGateGetStateUnsafe(OrGate)) { - KsGateRemoveOnInputFromAnd(OrGate->NextGate); - } else { - KsGateRemoveOffInputFromAnd(OrGate->NextGate); - } - } - - #endif // !_NTOS_ - - typedef PVOID KSOBJECT_BAG; - - typedef - BOOLEAN - (*PFNKSGENERATEEVENTCALLBACK)( - IN PVOID Context, - IN PKSEVENT_ENTRY EventEntry - ); - - typedef - NTSTATUS - (*PFNKSDEVICECREATE)( - IN PKSDEVICE Device - ); - typedef - NTSTATUS - (*PFNKSDEVICEPNPSTART)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN PCM_RESOURCE_LIST TranslatedResourceList OPTIONAL, - IN PCM_RESOURCE_LIST UntranslatedResourceList OPTIONAL - ); - typedef - NTSTATUS - (*PFNKSDEVICE)( - IN PKSDEVICE Device - ); - typedef - NTSTATUS - (*PFNKSDEVICEIRP)( - IN PKSDEVICE Device, - IN PIRP Irp - ); - typedef - void - (*PFNKSDEVICEIRPVOID)( - IN PKSDEVICE Device, - IN PIRP Irp - ); - typedef - NTSTATUS - (*PFNKSDEVICEQUERYCAPABILITIES)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN OUT PDEVICE_CAPABILITIES Capabilities - ); - typedef - NTSTATUS - (*PFNKSDEVICEQUERYPOWER)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN DEVICE_POWER_STATE DeviceTo, - IN DEVICE_POWER_STATE DeviceFrom, - IN SYSTEM_POWER_STATE SystemTo, - IN SYSTEM_POWER_STATE SystemFrom, - IN POWER_ACTION Action - ); - typedef - void - (*PFNKSDEVICESETPOWER)( - IN PKSDEVICE Device, - IN PIRP Irp, - IN DEVICE_POWER_STATE To, - IN DEVICE_POWER_STATE From - ); - typedef - NTSTATUS - (*PFNKSFILTERFACTORYVOID)( - IN PKSFILTERFACTORY FilterFactory - ); - typedef - void - (*PFNKSFILTERFACTORYPOWER)( - IN PKSFILTERFACTORY FilterFactory, - IN DEVICE_POWER_STATE State - ); - typedef - NTSTATUS - (*PFNKSFILTERIRP)( - IN PKSFILTER Filter, - IN PIRP Irp - ); - typedef - NTSTATUS - (*PFNKSFILTERPROCESS)( - IN PKSFILTER Filter, - IN PKSPROCESSPIN_INDEXENTRY Index - ); - typedef - NTSTATUS - (*PFNKSFILTERVOID)( - IN PKSFILTER Filter - ); - typedef - void - (*PFNKSFILTERPOWER)( - IN PKSFILTER Filter, - IN DEVICE_POWER_STATE State - ); - typedef - NTSTATUS - (*PFNKSPINIRP)( - IN PKSPIN Pin, - IN PIRP Irp - ); - typedef - NTSTATUS - (*PFNKSPINSETDEVICESTATE)( - IN PKSPIN Pin, - IN KSSTATE ToState, - IN KSSTATE FromState - ); - typedef - NTSTATUS - (*PFNKSPINSETDATAFORMAT)( - IN PKSPIN Pin, - IN PKSDATAFORMAT OldFormat OPTIONAL, - IN PKSMULTIPLE_ITEM OldAttributeList OPTIONAL, - IN const KSDATARANGE* DataRange, - IN const KSATTRIBUTE_LIST* AttributeRange OPTIONAL - ); - typedef - NTSTATUS - (*PFNKSPINHANDSHAKE)( - IN PKSPIN Pin, - IN PKSHANDSHAKE In, - IN PKSHANDSHAKE Out - ); - typedef - NTSTATUS - (*PFNKSPIN)( - IN PKSPIN Pin - ); - typedef - void - (*PFNKSPINVOID)( - IN PKSPIN Pin - ); - typedef - void - (*PFNKSPINPOWER)( - IN PKSPIN Pin, - IN DEVICE_POWER_STATE State - ); - typedef - BOOLEAN - (*PFNKSPINSETTIMER)( - IN PKSPIN Pin, - IN PKTIMER Timer, - IN LARGE_INTEGER DueTime, - IN PKDPC Dpc - ); - typedef - BOOLEAN - (*PFNKSPINCANCELTIMER)( - IN PKSPIN Pin, - IN PKTIMER Timer - ); - typedef - LONGLONG - (FASTCALL *PFNKSPINCORRELATEDTIME)( - IN PKSPIN Pin, - OUT PLONGLONG SystemTime - ); - typedef - void - (*PFNKSPINRESOLUTION)( - IN PKSPIN Pin, - OUT PKSRESOLUTION Resolution - ); - typedef - NTSTATUS - (*PFNKSPININITIALIZEALLOCATOR)( - IN PKSPIN Pin, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PVOID* Context - ); - typedef - void - (*PFNKSSTREAMPOINTER)( - IN PKSSTREAM_POINTER StreamPointer - ); - - typedef struct KSAUTOMATION_TABLE_ - KSAUTOMATION_TABLE, *PKSAUTOMATION_TABLE; - struct KSAUTOMATION_TABLE_ { - ULONG PropertySetsCount; - ULONG PropertyItemSize; - const KSPROPERTY_SET* PropertySets; - ULONG MethodSetsCount; - ULONG MethodItemSize; - const KSMETHOD_SET* MethodSets; - ULONG EventSetsCount; - ULONG EventItemSize; - const KSEVENT_SET* EventSets; - #if !defined(_WIN64) - PVOID Alignment; - #endif // !defined(_WIN64) - }; - - #define DEFINE_KSAUTOMATION_TABLE(table)\ - const KSAUTOMATION_TABLE table = - - #define DEFINE_KSAUTOMATION_PROPERTIES(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSPROPERTY_ITEM),\ - table - - #define DEFINE_KSAUTOMATION_METHODS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSMETHOD_ITEM),\ - table - - #define DEFINE_KSAUTOMATION_EVENTS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(KSEVENT_ITEM),\ - table - - #define DEFINE_KSAUTOMATION_PROPERTIES_NULL\ - 0,\ - sizeof(KSPROPERTY_ITEM),\ - NULL - - #define DEFINE_KSAUTOMATION_METHODS_NULL\ - 0,\ - sizeof(KSMETHOD_ITEM),\ - NULL - - #define DEFINE_KSAUTOMATION_EVENTS_NULL\ - 0,\ - sizeof(KSEVENT_ITEM),\ - NULL - - #define MIN_DEV_VER_FOR_QI (0x100) - - struct _KSDEVICE_DISPATCH { - PFNKSDEVICECREATE Add; - PFNKSDEVICEPNPSTART Start; - PFNKSDEVICE PostStart; - PFNKSDEVICEIRP QueryStop; - PFNKSDEVICEIRPVOID CancelStop; - PFNKSDEVICEIRPVOID Stop; - PFNKSDEVICEIRP QueryRemove; - PFNKSDEVICEIRPVOID CancelRemove; - PFNKSDEVICEIRPVOID Remove; - PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities; - PFNKSDEVICEIRPVOID SurpriseRemoval; - PFNKSDEVICEQUERYPOWER QueryPower; - PFNKSDEVICESETPOWER SetPower; - PFNKSDEVICEIRP QueryInterface; // added in version 0x100 - }; - - struct _KSFILTER_DISPATCH { - PFNKSFILTERIRP Create; - PFNKSFILTERIRP Close; - PFNKSFILTERPROCESS Process; - PFNKSFILTERVOID Reset; - }; - - struct _KSPIN_DISPATCH { - PFNKSPINIRP Create; - PFNKSPINIRP Close; - PFNKSPIN Process; - PFNKSPINVOID Reset; - PFNKSPINSETDATAFORMAT SetDataFormat; - PFNKSPINSETDEVICESTATE SetDeviceState; - PFNKSPIN Connect; - PFNKSPINVOID Disconnect; - const KSCLOCK_DISPATCH* Clock; - const KSALLOCATOR_DISPATCH* Allocator; - }; - - struct _KSCLOCK_DISPATCH { - PFNKSPINSETTIMER SetTimer; - PFNKSPINCANCELTIMER CancelTimer; - PFNKSPINCORRELATEDTIME CorrelatedTime; - PFNKSPINRESOLUTION Resolution; - }; - - struct _KSALLOCATOR_DISPATCH { - PFNKSPININITIALIZEALLOCATOR InitializeAllocator; - PFNKSDELETEALLOCATOR DeleteAllocator; - PFNKSDEFAULTALLOCATE Allocate; - PFNKSDEFAULTFREE Free; - }; - - #define KSDEVICE_DESCRIPTOR_VERSION (0x100) - - struct _KSDEVICE_DESCRIPTOR { - const KSDEVICE_DISPATCH* Dispatch; - ULONG FilterDescriptorsCount; - const KSFILTER_DESCRIPTOR*const* FilterDescriptors; - ULONG Version; // this is 0 for pre-version 100 driver - //#if !defined(_WIN64) - //PVOID Alignment; - //#endif //!defined(_WIN64) - }; - - struct _KSFILTER_DESCRIPTOR { - const KSFILTER_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - ULONG Version; - #define KSFILTER_DESCRIPTOR_VERSION ((ULONG)-1) - ULONG Flags; - #define KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING 0x00000001 - #define KSFILTER_FLAG_CRITICAL_PROCESSING 0x00000002 - #define KSFILTER_FLAG_HYPERCRITICAL_PROCESSING 0x00000004 - const GUID* ReferenceGuid; - ULONG PinDescriptorsCount; - ULONG PinDescriptorSize; - const KSPIN_DESCRIPTOR_EX* PinDescriptors; - ULONG CategoriesCount; - const GUID* Categories; - ULONG NodeDescriptorsCount; - ULONG NodeDescriptorSize; - const KSNODE_DESCRIPTOR* NodeDescriptors; - ULONG ConnectionsCount; - const KSTOPOLOGY_CONNECTION* Connections; - const KSCOMPONENTID* ComponentId; - }; - - #define DEFINE_KSFILTER_DESCRIPTOR(descriptor)\ - const KSFILTER_DESCRIPTOR descriptor = - - #define DEFINE_KSFILTER_PIN_DESCRIPTORS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(table[0]),\ - table - - #define DEFINE_KSFILTER_CATEGORIES(table)\ - SIZEOF_ARRAY(table),\ - table - - #define DEFINE_KSFILTER_CATEGORY(category)\ - 1,\ - &(category) - - #define DEFINE_KSFILTER_CATEGORIES_NULL\ - 0,\ - NULL - - #define DEFINE_KSFILTER_NODE_DESCRIPTORS(table)\ - SIZEOF_ARRAY(table),\ - sizeof(table[0]),\ - table - - #define DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL\ - 0,\ - sizeof(KSNODE_DESCRIPTOR),\ - NULL - - #define DEFINE_KSFILTER_CONNECTIONS(table)\ - SIZEOF_ARRAY(table),\ - table - - #define DEFINE_KSFILTER_DEFAULT_CONNECTIONS\ - 0,\ - NULL - - #define DEFINE_KSFILTER_DESCRIPTOR_TABLE(table)\ - const KSFILTER_DESCRIPTOR*const table[] = - - struct _KSPIN_DESCRIPTOR_EX { - const KSPIN_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - KSPIN_DESCRIPTOR PinDescriptor; - ULONG Flags; - #define KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING - #define KSPIN_FLAG_CRITICAL_PROCESSING KSFILTER_FLAG_CRITICAL_PROCESSING - #define KSPIN_FLAG_HYPERCRITICAL_PROCESSING KSFILTER_FLAG_HYPERCRITICAL_PROCESSING - #define KSPIN_FLAG_ASYNCHRONOUS_PROCESSING 0x00000008 - #define KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING 0x00000010 - #define KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL 0x00000020 - #define KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING 0x00000040 - #define KSPIN_FLAG_ENFORCE_FIFO 0x00000080 - - #define KSPIN_FLAG_GENERATE_MAPPINGS 0x00000100 - #define KSPIN_FLAG_DISTINCT_TRAILING_EDGE 0x00000200 - - #define KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY 0x00010000 - #define KSPIN_FLAG_SPLITTER 0x00020000 - #define KSPIN_FLAG_USE_STANDARD_TRANSPORT 0x00040000 - #define KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT 0x00080000 - #define KSPIN_FLAG_FIXED_FORMAT 0x00100000 - #define KSPIN_FLAG_GENERATE_EOS_EVENTS 0x00200000 - #define KSPIN_FLAG_RENDERER (KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY|KSPIN_FLAG_GENERATE_EOS_EVENTS) - #define KSPIN_FLAG_IMPLEMENT_CLOCK 0x00400000 - ULONG InstancesPossible; - ULONG InstancesNecessary; - const KSALLOCATOR_FRAMING_EX* AllocatorFraming; - PFNKSINTERSECTHANDLEREX IntersectHandler; - }; - - #define DEFINE_KSPIN_DEFAULT_INTERFACES\ - 0,\ - NULL - - #define DEFINE_KSPIN_DEFAULT_MEDIUMS\ - 0,\ - NULL - - struct _KSNODE_DESCRIPTOR { - const KSAUTOMATION_TABLE* AutomationTable; - const GUID* Type; - const GUID* Name; - #if !defined(_WIN64) - PVOID Alignment; - #endif // !defined(_WIN64) - }; - - #if !defined(_WIN64) - #define DEFINE_NODE_DESCRIPTOR(automation,type,name) \ - { (automation), (type), (name), NULL } - #else // !defined(_WIN64) - #define DEFINE_NODE_DESCRIPTOR(automation,type,name) \ - { (automation), (type), (name) } - #endif // !defined(_WIN64) - - struct _KSDEVICE { - const KSDEVICE_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - PDEVICE_OBJECT FunctionalDeviceObject; - PDEVICE_OBJECT PhysicalDeviceObject; - PDEVICE_OBJECT NextDeviceObject; - BOOLEAN Started; - SYSTEM_POWER_STATE SystemPowerState; - DEVICE_POWER_STATE DevicePowerState; - }; - - struct _KSFILTERFACTORY { - const KSFILTER_DESCRIPTOR* FilterDescriptor; - KSOBJECT_BAG Bag; - PVOID Context; - }; - - struct _KSFILTER { - const KSFILTER_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - }; - - struct _KSPIN { - const KSPIN_DESCRIPTOR_EX* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - ULONG Id; - KSPIN_COMMUNICATION Communication; - BOOLEAN ConnectionIsExternal; - KSPIN_INTERFACE ConnectionInterface; - KSPIN_MEDIUM ConnectionMedium; - KSPRIORITY ConnectionPriority; - PKSDATAFORMAT ConnectionFormat; - PKSMULTIPLE_ITEM AttributeList; - ULONG StreamHeaderSize; - KSPIN_DATAFLOW DataFlow; - KSSTATE DeviceState; - KSRESET ResetState; - }; - - struct _KSMAPPING { - PHYSICAL_ADDRESS PhysicalAddress; - ULONG ByteCount; - ULONG Alignment; - }; - - struct _KSSTREAM_POINTER_OFFSET - { - #if defined(_NTDDK_) - union { - PUCHAR Data; - PKSMAPPING Mappings; - }; - #else // !defined(_NTDDK_) - PUCHAR Data; - #endif // !defined(_NTDDK_) - #if !defined(_WIN64) - PVOID Alignment; - #endif // !defined(_WIN64) - ULONG Count; - ULONG Remaining; - }; - - struct _KSSTREAM_POINTER - { - PVOID Context; - PKSPIN Pin; - PKSSTREAM_HEADER StreamHeader; - PKSSTREAM_POINTER_OFFSET Offset; - KSSTREAM_POINTER_OFFSET OffsetIn; - KSSTREAM_POINTER_OFFSET OffsetOut; - }; - - struct _KSPROCESSPIN { - PKSPIN Pin; - PKSSTREAM_POINTER StreamPointer; - PKSPROCESSPIN InPlaceCounterpart; - PKSPROCESSPIN DelegateBranch; - PKSPROCESSPIN CopySource; - PVOID Data; - ULONG BytesAvailable; - ULONG BytesUsed; - ULONG Flags; - BOOLEAN Terminate; - }; - - struct _KSPROCESSPIN_INDEXENTRY { - PKSPROCESSPIN *Pins; - ULONG Count; - }; - - typedef enum { - KsObjectTypeDevice, - KsObjectTypeFilterFactory, - KsObjectTypeFilter, - KsObjectTypePin - } KSOBJECTTYPE; - - typedef - void - (*PFNKSFREE)( - IN PVOID Data - ); - - typedef - void - (*PFNKSPINFRAMERETURN)( - IN PKSPIN Pin, - IN PVOID Data OPTIONAL, - IN ULONG Size OPTIONAL, - IN PMDL Mdl OPTIONAL, - IN PVOID Context OPTIONAL, - IN NTSTATUS Status - ); - - #if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - #if !defined(_IKsControl_) - #define _IKsControl_ - - typedef interface IKsControl* PIKSCONTROL; - - #if !defined(DEFINE_ABSTRACT_UNKNOWN) - - #define DEFINE_ABSTRACT_UNKNOWN() \ - STDMETHOD_(NTSTATUS, QueryInterface)(THIS_ \ - REFIID InterfaceId, \ - PVOID* Interface \ - ) PURE; \ - STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ - STDMETHOD_(ULONG,Release)(THIS) PURE; - - #endif //!defined(DEFINE_ABSTRACT_UNKNOWN) - - #undef INTERFACE - #define INTERFACE IKsControl - DECLARE_INTERFACE_(IKsControl,IUnknown) - { - DEFINE_ABSTRACT_UNKNOWN() // For C - - STDMETHOD_(NTSTATUS, KsProperty)(THIS_ - IN PKSPROPERTY Property, - IN ULONG PropertyLength, - IN OUT PVOID PropertyData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsMethod)(THIS_ - IN PKSMETHOD Method, - IN ULONG MethodLength, - IN OUT PVOID MethodData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsEvent)(THIS_ - IN PKSEVENT Event OPTIONAL, - IN ULONG EventLength, - IN OUT PVOID EventData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - }; - - typedef interface IKsReferenceClock* PIKSREFERENCECLOCK; - - #undef INTERFACE - #define INTERFACE IKsReferenceClock - DECLARE_INTERFACE_(IKsReferenceClock,IUnknown) - { - DEFINE_ABSTRACT_UNKNOWN() // For C - - STDMETHOD_(LONGLONG,GetTime)(THIS - ) PURE; - STDMETHOD_(LONGLONG,GetPhysicalTime)(THIS - ) PURE; - STDMETHOD_(LONGLONG,GetCorrelatedTime)(THIS_ - OUT PLONGLONG SystemTime - ) PURE; - STDMETHOD_(LONGLONG,GetCorrelatedPhysicalTime)(THIS_ - OUT PLONGLONG SystemTime - ) PURE; - STDMETHOD_(NTSTATUS, GetResolution)(THIS_ - OUT PKSRESOLUTION Resolution - ) PURE; - STDMETHOD_(NTSTATUS, GetState)(THIS_ - OUT PKSSTATE State - ) PURE; - }; - #undef INTERFACE - - #define STATIC_IID_IKsControl \ - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUID(IID_IKsControl, - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96); - #if defined(__cplusplus) && _MSC_VER >= 1100 - struct __declspec(uuid("28F54685-06FD-11D2-B27A-00A0C9223196")) IKsControl; - #endif - - #define STATIC_IID_IKsFastClock \ - 0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e - DEFINE_GUID(IID_IKsFastClock, - 0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e); - #if defined(__cplusplus) && _MSC_VER >= 1100 - struct __declspec(uuid("C9902485-C180-11d2-8473-D42394459E5E")) IKsFastClock; - #endif - - #endif // !defined(_IKsControl_) - #endif // defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - - #endif // defined(_NTDDK_) - - //=========================================================================== - - #if defined(__cplusplus) - extern "C" { - #endif // defined(__cplusplus) - - // - // exported prototypes - // - - #ifdef _KSDDK_ - #define KSDDKAPI - #else // !_KSDDK_ - #define KSDDKAPI DECLSPEC_IMPORT - #endif // _KSDDK_ - - #if defined(_NTDDK_) - - KSDDKAPI - NTSTATUS - NTAPI - KsEnableEvent( - IN PIRP Irp, - IN ULONG EventSetsCount, - IN const KSEVENT_SET* EventSet, - IN OUT PLIST_ENTRY EventsList OPTIONAL, - IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL, - IN PVOID EventsLock OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsEnableEventWithAllocator( - IN PIRP Irp, - IN ULONG EventSetsCount, - IN const KSEVENT_SET* EventSet, - IN OUT PLIST_ENTRY EventsList OPTIONAL, - IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL, - IN PVOID EventsLock OPTIONAL, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG EventItemSize OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDisableEvent( - IN PIRP Irp, - IN OUT PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - - KSDDKAPI - VOID - NTAPI - KsDiscardEvent( - IN PKSEVENT_ENTRY EventEntry - ); - - KSDDKAPI - VOID - NTAPI - KsFreeEventList( - IN PFILE_OBJECT FileObject, - IN OUT PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsGenerateEvent( - IN PKSEVENT_ENTRY EventEntry - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsGenerateDataEvent( - IN PKSEVENT_ENTRY EventEntry, - IN ULONG DataSize, - IN PVOID Data - ); - - KSDDKAPI - VOID - NTAPI - KsGenerateEventList( - IN GUID* Set OPTIONAL, - IN ULONG EventId, - IN PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EventsFlags, - IN PVOID EventsLock - ); - - // property.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsPropertyHandler( - IN PIRP Irp, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPropertyHandlerWithAllocator( - IN PIRP Irp, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG PropertyItemSize OPTIONAL - ); - - KSDDKAPI - BOOLEAN - NTAPI - KsFastPropertyHandler( - IN PFILE_OBJECT FileObject, - IN PKSPROPERTY UNALIGNED Property, - IN ULONG PropertyLength, - IN OUT PVOID UNALIGNED Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus, - IN ULONG PropertySetsCount, - IN const KSPROPERTY_SET* PropertySet - ); - - // method.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsMethodHandler( - IN PIRP Irp, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsMethodHandlerWithAllocator( - IN PIRP Irp, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet, - IN PFNKSALLOCATOR Allocator OPTIONAL, - IN ULONG MethodItemSize OPTIONAL - ); - - KSDDKAPI - BOOLEAN - NTAPI - KsFastMethodHandler( - IN PFILE_OBJECT FileObject, - IN PKSMETHOD UNALIGNED Method, - IN ULONG MethodLength, - IN OUT PVOID UNALIGNED Data, - IN ULONG DataLength, - OUT PIO_STATUS_BLOCK IoStatus, - IN ULONG MethodSetsCount, - IN const KSMETHOD_SET* MethodSet - ); - - // alloc.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateDefaultAllocator( - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateDefaultAllocatorEx( - IN PIRP Irp, - IN PVOID InitializeContext OPTIONAL, - IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL, - IN PFNKSDEFAULTFREE DefaultFree OPTIONAL, - IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL, - IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateAllocator( - IN HANDLE ConnectionHandle, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PHANDLE AllocatorHandle - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsValidateAllocatorCreateRequest( - IN PIRP Irp, - OUT PKSALLOCATOR_FRAMING* AllocatorFraming - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsValidateAllocatorFramingEx( - IN PKSALLOCATOR_FRAMING_EX Framing, - IN ULONG BufferSize, - IN const KSALLOCATOR_FRAMING_EX *PinFraming - ); - - // clock.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateDefaultClock( - OUT PKSDEFAULTCLOCK* DefaultClock - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateDefaultClockEx( - OUT PKSDEFAULTCLOCK* DefaultClock, - IN PVOID Context OPTIONAL, - IN PFNKSSETTIMER SetTimer OPTIONAL, - IN PFNKSCANCELTIMER CancelTimer OPTIONAL, - IN PFNKSCORRELATEDTIME CorrelatedTime OPTIONAL, - IN const KSRESOLUTION* Resolution OPTIONAL, - IN ULONG Flags - ); - - KSDDKAPI - VOID - NTAPI - KsFreeDefaultClock( - IN PKSDEFAULTCLOCK DefaultClock - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateDefaultClock( - IN PIRP Irp, - IN PKSDEFAULTCLOCK DefaultClock - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateClock( - IN HANDLE ConnectionHandle, - IN PKSCLOCK_CREATE ClockCreate, - OUT PHANDLE ClockHandle - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsValidateClockCreateRequest( - IN PIRP Irp, - OUT PKSCLOCK_CREATE* ClockCreate - ); - - KSDDKAPI - KSSTATE - NTAPI - KsGetDefaultClockState( - IN PKSDEFAULTCLOCK DefaultClock - ); - - KSDDKAPI - VOID - NTAPI - KsSetDefaultClockState( - IN PKSDEFAULTCLOCK DefaultClock, - IN KSSTATE State - ); - - KSDDKAPI - LONGLONG - NTAPI - KsGetDefaultClockTime( - IN PKSDEFAULTCLOCK DefaultClock - ); - - KSDDKAPI - VOID - NTAPI - KsSetDefaultClockTime( - IN PKSDEFAULTCLOCK DefaultClock, - IN LONGLONG Time - ); - - // connect.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsCreatePin( - IN HANDLE FilterHandle, - IN PKSPIN_CONNECT Connect, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE ConnectionHandle - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsValidateConnectRequest( - IN PIRP Irp, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - OUT PKSPIN_CONNECT* Connect - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinPropertyHandler( - IN PIRP Irp, - IN PKSPROPERTY Property, - IN OUT PVOID Data, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinDataIntersection( - IN PIRP Irp, - IN PKSP_PIN Pin, - OUT PVOID Data OPTIONAL, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - IN PFNKSINTERSECTHANDLER IntersectHandler - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinDataIntersectionEx( - IN PIRP Irp, - IN PKSP_PIN Pin, - OUT PVOID Data, - IN ULONG DescriptorsCount, - IN const KSPIN_DESCRIPTOR* Descriptor, - IN ULONG DescriptorSize, - IN PFNKSINTERSECTHANDLEREX IntersectHandler OPTIONAL, - IN PVOID HandlerContext OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsHandleSizedListQuery( - IN PIRP Irp, - IN ULONG DataItemsCount, - IN ULONG DataItemSize, - IN const VOID* DataItems - ); - - // image.c: - - #if (!defined( MAKEINTRESOURCE )) - #define MAKEINTRESOURCE( res ) ((ULONG_PTR) (USHORT) res) - #endif - - #if (!defined( RT_STRING )) - #define RT_STRING MAKEINTRESOURCE( 6 ) - #define RT_RCDATA MAKEINTRESOURCE( 10 ) - #endif - - KSDDKAPI - NTSTATUS - NTAPI - KsLoadResource( - IN PVOID ImageBase, - IN POOL_TYPE PoolType, - IN ULONG_PTR ResourceName, - IN ULONG ResourceType, - OUT PVOID *Resource, - OUT PULONG ResourceSize - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsGetImageNameAndResourceId( - IN HANDLE RegKey, - OUT PUNICODE_STRING ImageName, - OUT PULONG_PTR ResourceId, - OUT PULONG ValueType - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsMapModuleName( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PUNICODE_STRING ModuleName, - OUT PUNICODE_STRING ImageName, - OUT PULONG_PTR ResourceId, - OUT PULONG ValueType - ); - - // irp.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsReferenceBusObject( - IN KSDEVICE_HEADER Header - ); - - KSDDKAPI - VOID - NTAPI - KsDereferenceBusObject( - IN KSDEVICE_HEADER Header - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchQuerySecurity( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchSetSecurity( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchSpecificProperty( - IN PIRP Irp, - IN PFNKSHANDLER Handler - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchSpecificMethod( - IN PIRP Irp, - IN PFNKSHANDLER Handler - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsReadFile( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN ULONG Key OPTIONAL, - IN KPROCESSOR_MODE RequestorMode - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsWriteFile( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN ULONG Key OPTIONAL, - IN KPROCESSOR_MODE RequestorMode - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsQueryInformationFile( - IN PFILE_OBJECT FileObject, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsSetInformationFile( - IN PFILE_OBJECT FileObject, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsStreamIo( - IN PFILE_OBJECT FileObject, - IN PKEVENT Event OPTIONAL, - IN PVOID PortContext OPTIONAL, - IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL, - IN PVOID CompletionContext OPTIONAL, - IN KSCOMPLETION_INVOCATION CompletionInvocationFlags OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN OUT PVOID StreamHeaders, - IN ULONG Length, - IN ULONG Flags, - IN KPROCESSOR_MODE RequestorMode - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsProbeStreamIrp( - IN OUT PIRP Irp, - IN ULONG ProbeFlags, - IN ULONG HeaderSize OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateExtraData( - IN OUT PIRP Irp, - IN ULONG ExtraSize, - OUT PVOID* ExtraBuffer - ); - - KSDDKAPI - VOID - NTAPI - KsNullDriverUnload( - IN PDRIVER_OBJECT DriverObject - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsSetMajorFunctionHandler( - IN PDRIVER_OBJECT DriverObject, - IN ULONG MajorFunction - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchInvalidDeviceRequest( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDefaultDeviceIoCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDispatchIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - BOOLEAN - NTAPI - KsDispatchFastIoDeviceControlFailure( - IN PFILE_OBJECT FileObject, - IN BOOLEAN Wait, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, - IN ULONG OutputBufferLength, - IN ULONG IoControlCode, - OUT PIO_STATUS_BLOCK IoStatus, - IN PDEVICE_OBJECT DeviceObject - ); - - KSDDKAPI - BOOLEAN - NTAPI - KsDispatchFastReadFailure( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - IN ULONG LockKey, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus, - IN PDEVICE_OBJECT DeviceObject - ); - - #define KsDispatchFastWriteFailure KsDispatchFastReadFailure - - KSDDKAPI - VOID - NTAPI - KsCancelRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - VOID - NTAPI - KsCancelIo( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock - ); - - KSDDKAPI - VOID - NTAPI - KsReleaseIrpOnCancelableQueue( - IN PIRP Irp, - IN PDRIVER_CANCEL DriverCancel OPTIONAL - ); - - KSDDKAPI - PIRP - NTAPI - KsRemoveIrpFromCancelableQueue( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN KSIRP_REMOVAL_OPERATION RemovalOperation - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsMoveIrpsOnCancelableQueue( - IN OUT PLIST_ENTRY SourceList, - IN PKSPIN_LOCK SourceLock, - IN OUT PLIST_ENTRY DestinationList, - IN PKSPIN_LOCK DestinationLock OPTIONAL, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN PFNKSIRPLISTCALLBACK ListCallback, - IN PVOID Context - ); - - KSDDKAPI - VOID - NTAPI - KsRemoveSpecificIrpFromCancelableQueue( - IN PIRP Irp - ); - - KSDDKAPI - VOID - NTAPI - KsAddIrpToCancelableQueue( - IN OUT PLIST_ENTRY QueueHead, - IN PKSPIN_LOCK SpinLock, - IN PIRP Irp, - IN KSLIST_ENTRY_LOCATION ListLocation, - IN PDRIVER_CANCEL DriverCancel OPTIONAL - ); - - // api.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsAcquireResetValue( - IN PIRP Irp, - OUT KSRESET* ResetValue - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsTopologyPropertyHandler( - IN PIRP Irp, - IN PKSPROPERTY Property, - IN OUT PVOID Data, - IN const KSTOPOLOGY* Topology - ); - - KSDDKAPI - VOID - NTAPI - KsAcquireDeviceSecurityLock( - IN KSDEVICE_HEADER Header, - IN BOOLEAN Exclusive - ); - - KSDDKAPI - VOID - NTAPI - KsReleaseDeviceSecurityLock( - IN KSDEVICE_HEADER Header - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDefaultDispatchPnp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDefaultDispatchPower( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsDefaultForwardIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - - KSDDKAPI - VOID - NTAPI - KsSetDevicePnpAndBaseObject( - IN KSDEVICE_HEADER Header, - IN PDEVICE_OBJECT PnpDeviceObject, - IN PDEVICE_OBJECT BaseObject - ); - - KSDDKAPI - PDEVICE_OBJECT - NTAPI - KsQueryDevicePnpObject( - IN KSDEVICE_HEADER Header - ); - - KSDDKAPI - ACCESS_MASK - NTAPI - KsQueryObjectAccessMask( - IN KSOBJECT_HEADER Header - ); - - KSDDKAPI - VOID - NTAPI - KsRecalculateStackDepth( - IN KSDEVICE_HEADER Header, - IN BOOLEAN ReuseStackLocation - ); - - KSDDKAPI - VOID - NTAPI - KsSetTargetState( - IN KSOBJECT_HEADER Header, - IN KSTARGET_STATE TargetState - ); - - KSDDKAPI - VOID - NTAPI - KsSetTargetDeviceObject( - IN KSOBJECT_HEADER Header, - IN PDEVICE_OBJECT TargetDevice OPTIONAL - ); - - KSDDKAPI - VOID - NTAPI - KsSetPowerDispatch( - IN KSOBJECT_HEADER Header, - IN PFNKSCONTEXT_DISPATCH PowerDispatch OPTIONAL, - IN PVOID PowerContext OPTIONAL - ); - - KSDDKAPI - PKSOBJECT_CREATE_ITEM - NTAPI - KsQueryObjectCreateItem( - IN KSOBJECT_HEADER Header - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateDeviceHeader( - OUT KSDEVICE_HEADER* Header, - IN ULONG ItemsCount, - IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL - ); - - KSDDKAPI - VOID - NTAPI - KsFreeDeviceHeader( - IN KSDEVICE_HEADER Header - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateObjectHeader( - OUT KSOBJECT_HEADER* Header, - IN ULONG ItemsCount, - IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL, - IN PIRP Irp, - IN const KSDISPATCH_TABLE* Table - ); - - KSDDKAPI - VOID - NTAPI - KsFreeObjectHeader( - IN KSOBJECT_HEADER Header - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAddObjectCreateItemToDeviceHeader( - IN KSDEVICE_HEADER Header, - IN PDRIVER_DISPATCH Create, - IN PVOID Context, - IN PWCHAR ObjectClass, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAddObjectCreateItemToObjectHeader( - IN KSOBJECT_HEADER Header, - IN PDRIVER_DISPATCH Create, - IN PVOID Context, - IN PWCHAR ObjectClass, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateObjectCreateItem( - IN KSDEVICE_HEADER Header, - IN PKSOBJECT_CREATE_ITEM CreateItem, - IN BOOLEAN AllocateEntry, - IN PFNKSITEMFREECALLBACK ItemFreeCallback OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFreeObjectCreateItem( - IN KSDEVICE_HEADER Header, - IN PUNICODE_STRING CreateItem - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFreeObjectCreateItemsByContext( - IN KSDEVICE_HEADER Header, - IN PVOID Context - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateDefaultSecurity( - IN PSECURITY_DESCRIPTOR ParentSecurity OPTIONAL, - OUT PSECURITY_DESCRIPTOR* DefaultSecurity - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsForwardIrp( - IN PIRP Irp, - IN PFILE_OBJECT FileObject, - IN BOOLEAN ReuseStackLocation - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsForwardAndCatchIrp( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PFILE_OBJECT FileObject, - IN KSSTACK_USE StackUse - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsSynchronousIoControlDevice( - IN PFILE_OBJECT FileObject, - IN KPROCESSOR_MODE RequestorMode, - IN ULONG IoControl, - IN PVOID InBuffer, - IN ULONG InSize, - OUT PVOID OutBuffer, - IN ULONG OutSize, - OUT PULONG BytesReturned - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsUnserializeObjectPropertiesFromRegistry( - IN PFILE_OBJECT FileObject, - IN HANDLE ParentKey OPTIONAL, - IN PUNICODE_STRING RegistryPath OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCacheMedium( - IN PUNICODE_STRING SymbolicLink, - IN PKSPIN_MEDIUM Medium, - IN ULONG PinDirection - ); - - // thread.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsRegisterWorker( - IN WORK_QUEUE_TYPE WorkQueueType, - OUT PKSWORKER* Worker - ); - KSDDKAPI - NTSTATUS - NTAPI - KsRegisterCountedWorker( - IN WORK_QUEUE_TYPE WorkQueueType, - IN PWORK_QUEUE_ITEM CountedWorkItem, - OUT PKSWORKER* Worker - ); - KSDDKAPI - VOID - NTAPI - KsUnregisterWorker( - IN PKSWORKER Worker - ); - KSDDKAPI - NTSTATUS - NTAPI - KsQueueWorkItem( - IN PKSWORKER Worker, - IN PWORK_QUEUE_ITEM WorkItem - ); - KSDDKAPI - ULONG - NTAPI - KsIncrementCountedWorker( - IN PKSWORKER Worker - ); - KSDDKAPI - ULONG - NTAPI - KsDecrementCountedWorker( - IN PKSWORKER Worker - ); - - // topology.c: - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateTopologyNode( - IN HANDLE ParentHandle, - IN PKSNODE_CREATE NodeCreate, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE NodeHandle - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsValidateTopologyNodeCreateRequest( - IN PIRP Irp, - IN PKSTOPOLOGY Topology, - OUT PKSNODE_CREATE* NodeCreate - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsMergeAutomationTables( - OUT PKSAUTOMATION_TABLE* AutomationTableAB, - IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, - IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL, - IN KSOBJECT_BAG Bag OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsInitializeDriver( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPathName, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsAddDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT PhysicalDeviceObject - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL, - IN ULONG ExtensionSize OPTIONAL, - OUT PKSDEVICE* Device OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsInitializeDevice( - IN PDEVICE_OBJECT FunctionalDeviceObject, - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_OBJECT NextDeviceObject, - IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsTerminateDevice( - IN PDEVICE_OBJECT DeviceObject - ); - - KSDDKAPI - PKSDEVICE - NTAPI - KsGetDeviceForDeviceObject( - IN PDEVICE_OBJECT FunctionalDeviceObject - ); - - KSDDKAPI - void - NTAPI - KsAcquireDevice( - IN PKSDEVICE Device - ); - - KSDDKAPI - void - NTAPI - KsReleaseDevice( - IN PKSDEVICE Device - ); - - KSDDKAPI - void - NTAPI - KsDeviceRegisterAdapterObject( - IN PKSDEVICE Device, - IN PADAPTER_OBJECT AdapterObject, - IN ULONG MaxMappingsByteCount, - IN ULONG MappingTableStride - ); - - KSDDKAPI - ULONG - NTAPI - KsDeviceGetBusData( - IN PKSDEVICE Device, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - - KSDDKAPI - ULONG - NTAPI - KsDeviceSetBusData( - IN PKSDEVICE Device, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCreateFilterFactory( - IN PDEVICE_OBJECT DeviceObject, - IN const KSFILTER_DESCRIPTOR* Descriptor, - IN PWCHAR RefString OPTIONAL, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL, - IN ULONG CreateItemFlags, - IN PFNKSFILTERFACTORYPOWER SleepCallback OPTIONAL, - IN PFNKSFILTERFACTORYPOWER WakeCallback OPTIONAL, - OUT PKSFILTERFACTORY* FilterFactory OPTIONAL - ); - - #define KsDeleteFilterFactory(FilterFactory) \ - KsFreeObjectCreateItemsByContext(\ - *(KSDEVICE_HEADER *)(\ - KsFilterFactoryGetParentDevice(FilterFactory)->FunctionalDeviceObject->\ - DeviceExtension),\ - FilterFactory) - - KSDDKAPI - NTSTATUS - NTAPI - KsFilterFactoryAddCreateItem( - IN PKSFILTERFACTORY FilterFactory, - IN PWCHAR RefString, - IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL, - IN ULONG CreateItemFlags - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFilterFactorySetDeviceClassesState( - IN PKSFILTERFACTORY FilterFactory, - IN BOOLEAN NewState - ); - - KSDDKAPI - PUNICODE_STRING - NTAPI - KsFilterFactoryGetSymbolicLink( - IN PKSFILTERFACTORY FilterFactory - ); - - KSDDKAPI - void - NTAPI - KsAddEvent( - IN PVOID Object, - IN PKSEVENT_ENTRY EventEntry - ); - - void _inline - KsFilterAddEvent( - IN PKSFILTER Filter, - IN PKSEVENT_ENTRY EventEntry - ) - { - KsAddEvent(Filter,EventEntry); - } - - void _inline - KsPinAddEvent( - IN PKSPIN Pin, - IN PKSEVENT_ENTRY EventEntry - ) - { - KsAddEvent(Pin,EventEntry); - } - - KSDDKAPI - NTSTATUS - NTAPI - KsDefaultAddEventHandler( - IN PIRP Irp, - IN PKSEVENTDATA EventData, - IN OUT PKSEVENT_ENTRY EventEntry - ); - - KSDDKAPI - void - NTAPI - KsGenerateEvents( - IN PVOID Object, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ); - - void _inline - KsFilterGenerateEvents( - IN PKSFILTER Filter, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ) - { - KsGenerateEvents( - Filter, - EventSet, - EventId, - DataSize, - Data, - CallBack, - CallBackContext); - } - - void _inline - KsPinGenerateEvents( - IN PKSPIN Pin, - IN const GUID* EventSet OPTIONAL, - IN ULONG EventId, - IN ULONG DataSize, - IN PVOID Data OPTIONAL, - IN PFNKSGENERATEEVENTCALLBACK CallBack OPTIONAL, - IN PVOID CallBackContext OPTIONAL - ) - { - KsGenerateEvents( - Pin, - EventSet, - EventId, - DataSize, - Data, - CallBack, - CallBackContext); - } - - typedef enum { - KSSTREAM_POINTER_STATE_UNLOCKED = 0, - KSSTREAM_POINTER_STATE_LOCKED - } KSSTREAM_POINTER_STATE; - - KSDDKAPI - NTSTATUS - NTAPI - KsPinGetAvailableByteCount( - IN PKSPIN Pin, - OUT PLONG InputDataBytes OPTIONAL, - OUT PLONG OutputBufferBytes OPTIONAL - ); - - KSDDKAPI - PKSSTREAM_POINTER - NTAPI - KsPinGetLeadingEdgeStreamPointer( - IN PKSPIN Pin, - IN KSSTREAM_POINTER_STATE State - ); - - KSDDKAPI - PKSSTREAM_POINTER - NTAPI - KsPinGetTrailingEdgeStreamPointer( - IN PKSPIN Pin, - IN KSSTREAM_POINTER_STATE State - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsStreamPointerLock( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - void - NTAPI - KsStreamPointerUnlock( - IN PKSSTREAM_POINTER StreamPointer, - IN BOOLEAN Eject - ); - - KSDDKAPI - void - NTAPI - KsStreamPointerAdvanceOffsetsAndUnlock( - IN PKSSTREAM_POINTER StreamPointer, - IN ULONG InUsed, - IN ULONG OutUsed, - IN BOOLEAN Eject - ); - - KSDDKAPI - void - NTAPI - KsStreamPointerDelete( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsStreamPointerClone( - IN PKSSTREAM_POINTER StreamPointer, - IN PFNKSSTREAMPOINTER CancelCallback OPTIONAL, - IN ULONG ContextSize, - OUT PKSSTREAM_POINTER* CloneStreamPointer - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsStreamPointerAdvanceOffsets( - IN PKSSTREAM_POINTER StreamPointer, - IN ULONG InUsed, - IN ULONG OutUsed, - IN BOOLEAN Eject - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsStreamPointerAdvance( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - PMDL - NTAPI - KsStreamPointerGetMdl( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - PIRP - NTAPI - KsStreamPointerGetIrp( - IN PKSSTREAM_POINTER StreamPointer, - OUT PBOOLEAN FirstFrameInIrp OPTIONAL, - OUT PBOOLEAN LastFrameInIrp OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsStreamPointerScheduleTimeout( - IN PKSSTREAM_POINTER StreamPointer, - IN PFNKSSTREAMPOINTER Callback, - IN ULONGLONG Interval - ); - - KSDDKAPI - void - NTAPI - KsStreamPointerCancelTimeout( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - PKSSTREAM_POINTER - NTAPI - KsPinGetFirstCloneStreamPointer( - IN PKSPIN Pin - ); - - KSDDKAPI - PKSSTREAM_POINTER - NTAPI - KsStreamPointerGetNextClone( - IN PKSSTREAM_POINTER StreamPointer - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinHandshake( - IN PKSPIN Pin, - IN PKSHANDSHAKE In, - OUT PKSHANDSHAKE Out - ); - - KSDDKAPI - void - NTAPI - KsCompletePendingRequest( - IN PIRP Irp - ); - - KSDDKAPI - KSOBJECTTYPE - NTAPI - KsGetObjectTypeFromIrp( - IN PIRP Irp - ); - - KSDDKAPI - PVOID - NTAPI - KsGetObjectFromFileObject( - IN PFILE_OBJECT FileObject - ); - - KSDDKAPI - KSOBJECTTYPE - NTAPI - KsGetObjectTypeFromFileObject( - IN PFILE_OBJECT FileObject - ); - - PKSFILTER __inline - KsGetFilterFromFileObject( - IN PFILE_OBJECT FileObject - ) - { - return (PKSFILTER) KsGetObjectFromFileObject(FileObject); - } - - PKSPIN __inline - KsGetPinFromFileObject( - IN PFILE_OBJECT FileObject - ) - { - return (PKSPIN) KsGetObjectFromFileObject(FileObject); - } - - KSDDKAPI - PKSGATE - NTAPI - KsFilterGetAndGate( - IN PKSFILTER Filter - ); - - KSDDKAPI - void - NTAPI - KsFilterAcquireProcessingMutex( - IN PKSFILTER Filter - ); - - KSDDKAPI - void - NTAPI - KsFilterReleaseProcessingMutex( - IN PKSFILTER Filter - ); - - KSDDKAPI - void - NTAPI - KsFilterAttemptProcessing( - IN PKSFILTER Filter, - IN BOOLEAN Asynchronous - ); - - KSDDKAPI - PKSGATE - NTAPI - KsPinGetAndGate( - IN PKSPIN Pin - ); - - KSDDKAPI - void - NTAPI - KsPinAttachAndGate( - IN PKSPIN Pin, - IN PKSGATE AndGate OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsPinAttachOrGate( - IN PKSPIN Pin, - IN PKSGATE OrGate OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsPinAcquireProcessingMutex( - IN PKSPIN Pin - ); - - KSDDKAPI - void - NTAPI - KsPinReleaseProcessingMutex( - IN PKSPIN Pin - ); - - KSDDKAPI - BOOLEAN - NTAPI - KsProcessPinUpdate( - IN PKSPROCESSPIN ProcessPin - ); - - KSDDKAPI - void - NTAPI - KsPinAttemptProcessing( - IN PKSPIN Pin, - IN BOOLEAN Asynchronous - ); - - KSDDKAPI - PVOID - NTAPI - KsGetParent( - IN PVOID Object - ); - - PKSDEVICE __inline - KsFilterFactoryGetParentDevice( - IN PKSFILTERFACTORY FilterFactory - ) - { - return (PKSDEVICE) KsGetParent((PVOID) FilterFactory); - } - - PKSFILTERFACTORY __inline - KsFilterGetParentFilterFactory( - IN PKSFILTER Filter - ) - { - return (PKSFILTERFACTORY) KsGetParent((PVOID) Filter); - } - - KSDDKAPI - PKSFILTER - NTAPI - KsPinGetParentFilter( - IN PKSPIN Pin - ); - - KSDDKAPI - PVOID - NTAPI - KsGetFirstChild( - IN PVOID Object - ); - - PKSFILTERFACTORY __inline - KsDeviceGetFirstChildFilterFactory( - IN PKSDEVICE Device - ) - { - return (PKSFILTERFACTORY) KsGetFirstChild((PVOID) Device); - } - - PKSFILTER __inline - KsFilterFactoryGetFirstChildFilter( - IN PKSFILTERFACTORY FilterFactory - ) - { - return (PKSFILTER) KsGetFirstChild((PVOID) FilterFactory); - } - - KSDDKAPI - ULONG - NTAPI - KsFilterGetChildPinCount( - IN PKSFILTER Filter, - IN ULONG PinId - ); - - KSDDKAPI - PKSPIN - NTAPI - KsFilterGetFirstChildPin( - IN PKSFILTER Filter, - IN ULONG PinId - ); - - KSDDKAPI - PVOID - NTAPI - KsGetNextSibling( - IN PVOID Object - ); - - KSDDKAPI - PKSPIN - NTAPI - KsPinGetNextSiblingPin( - IN PKSPIN Pin - ); - - PKSFILTERFACTORY __inline - KsFilterFactoryGetNextSiblingFilterFactory( - IN PKSFILTERFACTORY FilterFactory - ) - { - return (PKSFILTERFACTORY) KsGetNextSibling((PVOID) FilterFactory); - } - - PKSFILTER __inline - KsFilterGetNextSiblingFilter( - IN PKSFILTER Filter - ) - { - return (PKSFILTER) KsGetNextSibling((PVOID) Filter); - } - - - KSDDKAPI - PKSDEVICE - NTAPI - KsGetDevice( - IN PVOID Object - ); - - PKSDEVICE __inline - KsFilterFactoryGetDevice( - IN PKSFILTERFACTORY FilterFactory - ) - { - return KsGetDevice((PVOID) FilterFactory); - } - - PKSDEVICE __inline - KsFilterGetDevice( - IN PKSFILTER Filter - ) - { - return KsGetDevice((PVOID) Filter); - } - - PKSDEVICE __inline - KsPinGetDevice( - IN PKSPIN Pin - ) - { - return KsGetDevice((PVOID) Pin); - } - - KSDDKAPI - PKSFILTER - NTAPI - KsGetFilterFromIrp( - IN PIRP Irp - ); - - KSDDKAPI - PKSPIN - NTAPI - KsGetPinFromIrp( - IN PIRP Irp - ); - - KSDDKAPI - ULONG - NTAPI - KsGetNodeIdFromIrp( - IN PIRP Irp - ); - - KSDDKAPI - void - NTAPI - KsAcquireControl( - IN PVOID Object - ); - - KSDDKAPI - void - NTAPI - KsReleaseControl( - IN PVOID Object - ); - - void __inline - KsFilterAcquireControl( - IN PKSFILTER Filter - ) - { - KsAcquireControl((PVOID) Filter); - } - - void __inline - KsFilterReleaseControl( - IN PKSFILTER Filter - ) - { - KsReleaseControl((PVOID) Filter); - } - - void __inline - KsPinAcquireControl( - IN PKSPIN Pin - ) - { - KsAcquireControl((PVOID) Pin); - } - - void __inline - KsPinReleaseControl( - IN PKSPIN Pin - ) - { - KsReleaseControl((PVOID) Pin); - } - - KSDDKAPI - NTSTATUS - NTAPI - KsAddItemToObjectBag( - IN KSOBJECT_BAG ObjectBag, - IN PVOID Item, - IN PFNKSFREE Free OPTIONAL - ); - - KSDDKAPI - ULONG - NTAPI - KsRemoveItemFromObjectBag( - IN KSOBJECT_BAG ObjectBag, - IN PVOID Item, - IN BOOLEAN Free - ); - - #define KsDiscard(Object,Pointer)\ - KsRemoveItemFromObjectBag(\ - (Object)->Bag,\ - (PVOID)(Pointer),\ - TRUE) - - KSDDKAPI - NTSTATUS - NTAPI - KsAllocateObjectBag( - IN PKSDEVICE Device, - OUT KSOBJECT_BAG* ObjectBag - ); - - KSDDKAPI - void - NTAPI - KsFreeObjectBag( - IN KSOBJECT_BAG ObjectBag - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsCopyObjectBagItems( - IN KSOBJECT_BAG ObjectBagDestination, - IN KSOBJECT_BAG ObjectBagSource - ); - - KSDDKAPI - NTSTATUS - NTAPI - _KsEdit( - IN KSOBJECT_BAG ObjectBag, - IN OUT PVOID* PointerToPointerToItem, - IN ULONG NewSize, - IN ULONG OldSize, - IN ULONG Tag - ); - - #define KsEdit(Object,PointerToPointer,Tag)\ - _KsEdit(\ - (Object)->Bag,\ - (PVOID*)(PointerToPointer),\ - sizeof(**(PointerToPointer)),\ - sizeof(**(PointerToPointer)),\ - (Tag)) - #define KsEditSized(Object,PointerToPointer,NewSize,OldSize,Tag)\ - _KsEdit((Object)->Bag,(PVOID*)(PointerToPointer),(NewSize),(OldSize),(Tag)) - - KSDDKAPI - NTSTATUS - NTAPI - KsRegisterFilterWithNoKSPins( - IN PDEVICE_OBJECT DeviceObject, - IN const GUID * InterfaceClassGUID, - IN ULONG PinCount, - IN BOOL * PinDirection, - IN KSPIN_MEDIUM * MediumList, - IN OPTIONAL GUID * CategoryList - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFilterCreatePinFactory ( - IN PKSFILTER Filter, - IN const KSPIN_DESCRIPTOR_EX *const PinDescriptor, - OUT PULONG PinID - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFilterCreateNode ( - IN PKSFILTER Filter, - IN const KSNODE_DESCRIPTOR *const NodeDescriptor, - OUT PULONG NodeID - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsFilterAddTopologyConnections ( - IN PKSFILTER Filter, - IN ULONG NewConnectionsCount, - IN const KSTOPOLOGY_CONNECTION *const NewTopologyConnections - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinGetConnectedPinInterface( - IN PKSPIN Pin, - IN const GUID* InterfaceId, - OUT PVOID* Interface - ); - - KSDDKAPI - PFILE_OBJECT - NTAPI - KsPinGetConnectedPinFileObject( - IN PKSPIN Pin - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinGetConnectedFilterInterface( - IN PKSPIN Pin, - IN const GUID* InterfaceId, - OUT PVOID* Interface - ); - - #if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - - KSDDKAPI - NTSTATUS - NTAPI - KsPinGetReferenceClockInterface( - IN PKSPIN Pin, - OUT PIKSREFERENCECLOCK* Interface - ); - - #endif //defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - - KSDDKAPI - VOID - NTAPI - KsPinSetPinClockTime( - IN PKSPIN Pin, - IN LONGLONG Time - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinSubmitFrame( - IN PKSPIN Pin, - IN PVOID Data OPTIONAL, - IN ULONG Size OPTIONAL, - IN PKSSTREAM_HEADER StreamHeader OPTIONAL, - IN PVOID Context OPTIONAL - ); - - KSDDKAPI - NTSTATUS - NTAPI - KsPinSubmitFrameMdl( - IN PKSPIN Pin, - IN PMDL Mdl OPTIONAL, - IN PKSSTREAM_HEADER StreamHeader OPTIONAL, - IN PVOID Context OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsPinRegisterFrameReturnCallback( - IN PKSPIN Pin, - IN PFNKSPINFRAMERETURN FrameReturn - ); - - KSDDKAPI - void - NTAPI - KsPinRegisterHandshakeCallback( - IN PKSPIN Pin, - IN PFNKSPINHANDSHAKE Handshake - ); - - KSDDKAPI - void - NTAPI - KsFilterRegisterPowerCallbacks( - IN PKSFILTER Filter, - IN PFNKSFILTERPOWER Sleep OPTIONAL, - IN PFNKSFILTERPOWER Wake OPTIONAL - ); - - KSDDKAPI - void - NTAPI - KsPinRegisterPowerCallbacks( - IN PKSPIN Pin, - IN PFNKSPINPOWER Sleep OPTIONAL, - IN PFNKSPINPOWER Wake OPTIONAL - ); - - #if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - - KSDDKAPI - PUNKNOWN - NTAPI - KsRegisterAggregatedClientUnknown( - IN PVOID Object, - IN PUNKNOWN ClientUnknown - ); - - KSDDKAPI - PUNKNOWN - NTAPI - KsGetOuterUnknown( - IN PVOID Object - ); - - PUNKNOWN __inline - KsDeviceRegisterAggregatedClientUnknown( - IN PKSDEVICE Device, - IN PUNKNOWN ClientUnknown - ) - { - return KsRegisterAggregatedClientUnknown((PVOID) Device,ClientUnknown); - } - - PUNKNOWN __inline - KsDeviceGetOuterUnknown( - IN PKSDEVICE Device - ) - { - return KsGetOuterUnknown((PVOID) Device); - } - - PUNKNOWN __inline - KsFilterFactoryRegisterAggregatedClientUnknown( - IN PKSFILTERFACTORY FilterFactory, - IN PUNKNOWN ClientUnknown - ) - { - return KsRegisterAggregatedClientUnknown((PVOID) FilterFactory,ClientUnknown); - } - - PUNKNOWN __inline - KsFilterFactoryGetOuterUnknown( - IN PKSFILTERFACTORY FilterFactory - ) - { - return KsGetOuterUnknown((PVOID) FilterFactory); - } - - PUNKNOWN __inline - KsFilterRegisterAggregatedClientUnknown( - IN PKSFILTER Filter, - IN PUNKNOWN ClientUnknown - ) - { - return KsRegisterAggregatedClientUnknown((PVOID) Filter,ClientUnknown); - } - - PUNKNOWN __inline - KsFilterGetOuterUnknown( - IN PKSFILTER Filter - ) - { - return KsGetOuterUnknown((PVOID) Filter); - } - - PUNKNOWN __inline - KsPinRegisterAggregatedClientUnknown( - IN PKSPIN Pin, - IN PUNKNOWN ClientUnknown - ) - { - return KsRegisterAggregatedClientUnknown((PVOID) Pin,ClientUnknown); - } - - PUNKNOWN __inline - KsPinGetOuterUnknown( - IN PKSPIN Pin - ) - { - return KsGetOuterUnknown((PVOID) Pin); - } - - #endif // defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - - #else // !defined(_NTDDK_) - - #if !defined( KS_NO_CREATE_FUNCTIONS ) - - KSDDKAPI - DWORD - WINAPI - KsCreateAllocator( - IN HANDLE ConnectionHandle, - IN PKSALLOCATOR_FRAMING AllocatorFraming, - OUT PHANDLE AllocatorHandle - ); - - KSDDKAPI - DWORD - NTAPI - KsCreateClock( - IN HANDLE ConnectionHandle, - IN PKSCLOCK_CREATE ClockCreate, - OUT PHANDLE ClockHandle - ); - - KSDDKAPI - DWORD - WINAPI - KsCreatePin( - IN HANDLE FilterHandle, - IN PKSPIN_CONNECT Connect, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE ConnectionHandle - ); - - KSDDKAPI - DWORD - WINAPI - KsCreateTopologyNode( - IN HANDLE ParentHandle, - IN PKSNODE_CREATE NodeCreate, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE NodeHandle - ); - - #endif - - #endif // !defined(_NTDDK_) - - #if defined(__cplusplus) - } - #endif // defined(__cplusplus) - - -#endif // DirectX 8.0 content - - -#endif // !_KS_ diff --git a/import/DirectX8/include/ksguid.h b/import/DirectX8/include/ksguid.h deleted file mode 100644 index 7ff5506c4..000000000 --- a/import/DirectX8/include/ksguid.h +++ /dev/null @@ -1,29 +0,0 @@ -/*++ - -Copyright (C) Microsoft Corporation, 1996 - 2001 - -Module Name: - - ksguid.h - -Abstract: - - Define guids for non-C++. - ---*/ - -#define INITGUID -#include - -#if defined( DEFINE_GUIDEX ) - #undef DEFINE_GUIDEX -#endif -#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID __declspec(selectany) name = { STATICGUIDOF(name) } - -#ifndef STATICGUIDOF - #define STATICGUIDOF(guid) STATIC_##guid -#endif // !defined(STATICGUIDOF) - -#if !defined( DEFINE_WAVEFORMATEX_GUID ) -#define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -#endif diff --git a/import/DirectX8/include/ksmedia.h b/import/DirectX8/include/ksmedia.h deleted file mode 100644 index 3e75ad5ed..000000000 --- a/import/DirectX8/include/ksmedia.h +++ /dev/null @@ -1,9074 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ksmedia.h - -Abstract: - - WDM-CSA Multimedia Definitions. - ---*/ - -#if !defined(_KS_) -#error KS.H must be included before KSMEDIA.H -#endif // !defined(_KS_) - -#if !defined(_KSMEDIA_) -#define _KSMEDIA_ - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - -typedef struct { - KSPROPERTY Property; - KSMULTIPLE_ITEM MultipleItem; -} KSMULTIPLE_DATA_PROP, *PKSMULTIPLE_DATA_PROP; - -#define STATIC_KSMEDIUMSETID_MidiBus \ - 0x05908040L, 0x3246, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("05908040-3246-11D0-A5D6-28DB04C10000", KSMEDIUMSETID_MidiBus); -#define KSMEDIUMSETID_MidiBus DEFINE_GUIDNAMED(KSMEDIUMSETID_MidiBus) - -#define STATIC_KSMEDIUMSETID_VPBus \ - 0xA18C15ECL, 0xCE43, 0x11D0, 0xAB, 0xE7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("A18C15EC-CE43-11D0-ABE7-00A0C9223196", KSMEDIUMSETID_VPBus); -#define KSMEDIUMSETID_VPBus DEFINE_GUIDNAMED(KSMEDIUMSETID_VPBus) - -#define STATIC_KSINTERFACESETID_Media \ - 0x3A13EB40L, 0x30A7, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("3A13EB40-30A7-11D0-A5D6-28DB04C10000", KSINTERFACESETID_Media); -#define KSINTERFACESETID_Media DEFINE_GUIDNAMED(KSINTERFACESETID_Media) - -typedef enum { - KSINTERFACE_MEDIA_MUSIC, - KSINTERFACE_MEDIA_WAVE_BUFFERED, - KSINTERFACE_MEDIA_WAVE_QUEUED -} KSINTERFACE_MEDIA; - - -#if !defined(INIT_USBAUDIO_MID) -// {4e1cecd2-1679-463b-a72f-a5bf64c86eba} -#define INIT_USBAUDIO_MID(guid, id)\ -{\ - (guid)->Data1 = 0x4e1cecd2 + (USHORT)(id);\ - (guid)->Data2 = 0x1679;\ - (guid)->Data3 = 0x463b;\ - (guid)->Data4[0] = 0xa7;\ - (guid)->Data4[1] = 0x2f;\ - (guid)->Data4[2] = 0xa5;\ - (guid)->Data4[3] = 0xbf;\ - (guid)->Data4[4] = 0x64;\ - (guid)->Data4[5] = 0xc8;\ - (guid)->Data4[6] = 0x6e;\ - (guid)->Data4[7] = 0xba;\ -} -#define EXTRACT_USBAUDIO_MID(guid)\ - (USHORT)((guid)->Data1 - 0x4e1cecd2) -#define DEFINE_USBAUDIO_MID_GUID(id)\ - 0x4e1cecd2+(USHORT)(id), 0x1679, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba - -#define IS_COMPATIBLE_USBAUDIO_MID(guid)\ - (((guid)->Data1 >= 0x4e1cecd2) &&\ - ((guid)->Data1 < 0x4e1cecd2 + 0xffff) &&\ - ((guid)->Data2 == 0x1679) &&\ - ((guid)->Data3 == 0x463b) &&\ - ((guid)->Data4[0] == 0xa7) &&\ - ((guid)->Data4[1] == 0x2f) &&\ - ((guid)->Data4[2] == 0xa5) &&\ - ((guid)->Data4[3] == 0xbf) &&\ - ((guid)->Data4[4] == 0x64) &&\ - ((guid)->Data4[5] == 0xc8) &&\ - ((guid)->Data4[6] == 0x6e) &&\ - ((guid)->Data4[7] == 0xba)) -#endif // !defined(INIT_USBAUDIO_MID) - -#if !defined(INIT_USBAUDIO_PID) -// {abcc5a5e-c263-463b-a72f-a5bf64c86eba} -#define INIT_USBAUDIO_PID(guid, id)\ -{\ - (guid)->Data1 = 0xabcc5a5e + (USHORT)(id);\ - (guid)->Data2 = 0xc263;\ - (guid)->Data3 = 0x463b;\ - (guid)->Data4[0] = 0xa7;\ - (guid)->Data4[1] = 0x2f;\ - (guid)->Data4[2] = 0xa5;\ - (guid)->Data4[3] = 0xbf;\ - (guid)->Data4[4] = 0x64;\ - (guid)->Data4[5] = 0xc8;\ - (guid)->Data4[6] = 0x6e;\ - (guid)->Data4[7] = 0xba;\ -} -#define EXTRACT_USBAUDIO_PID(guid)\ - (USHORT)((guid)->Data1 - 0xabcc5a5e) -#define DEFINE_USBAUDIO_PID_GUID(id)\ - 0xabcc5a5e+(USHORT)(id), 0xc263, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba - -#define IS_COMPATIBLE_USBAUDIO_PID(guid)\ - (((guid)->Data1 >= 0xabcc5a5e) &&\ - ((guid)->Data1 < 0xabcc5a5e + 0xffff) &&\ - ((guid)->Data2 == 0xc263) &&\ - ((guid)->Data3 == 0x463b) &&\ - ((guid)->Data4[0] == 0xa7) &&\ - ((guid)->Data4[1] == 0x2f) &&\ - ((guid)->Data4[2] == 0xa5) &&\ - ((guid)->Data4[3] == 0xbf) &&\ - ((guid)->Data4[4] == 0x64) &&\ - ((guid)->Data4[5] == 0xc8) &&\ - ((guid)->Data4[6] == 0x6e) &&\ - ((guid)->Data4[7] == 0xba)) -#endif // !defined(INIT_USBAUDIO_PID) - -#if !defined(INIT_USBAUDIO_PRODUCT_NAME) -// {FC575048-2E08-463B-A72F-A5BF64C86EBA} -#define INIT_USBAUDIO_PRODUCT_NAME(guid, vid, pid, strIndex)\ -{\ - (guid)->Data1 = 0XFC575048 + (USHORT)(vid);\ - (guid)->Data2 = 0x2E08 + (USHORT)(pid);\ - (guid)->Data3 = 0x463B + (USHORT)(strIndex);\ - (guid)->Data4[0] = 0xA7;\ - (guid)->Data4[1] = 0x2F;\ - (guid)->Data4[2] = 0xA5;\ - (guid)->Data4[3] = 0xBF;\ - (guid)->Data4[4] = 0x64;\ - (guid)->Data4[5] = 0xC8;\ - (guid)->Data4[6] = 0x6E;\ - (guid)->Data4[7] = 0xBA;\ -} -#define DEFINE_USBAUDIO_PRODUCT_NAME(vid, pid, strIndex)\ - 0xFC575048+(USHORT)(vid), 0x2E08+(USHORT)(pid), 0x463B+(USHORT)(strIndex), 0xA7, 0x2F, 0xA5, 0xBF, 0x64, 0xC8, 0x6E, 0xBA -#endif // !defined(INIT_USBAUDIO_PRODUCT_NAME) - - -// USB Component ID -#define STATIC_KSCOMPONENTID_USBAUDIO \ - 0x8F1275F0, 0x26E9, 0x4264, 0xBA, 0x4D, 0x39, 0xFF, 0xF0, 0x1D, 0x94, 0xAA -DEFINE_GUIDSTRUCT("8F1275F0-26E9-4264-BA4D-39FFF01D94AA", KSCOMPONENTID_USBAUDIO); -#define KSCOMPONENTID_USBAUDIO DEFINE_GUIDNAMED(KSCOMPONENTID_USBAUDIO) - -// USB Terminals -#define INIT_USB_TERMINAL(guid, id)\ -{\ - (guid)->Data1 = 0xDFF219E0 + (USHORT)(id);\ - (guid)->Data2 = 0xF70F;\ - (guid)->Data3 = 0x11D0;\ - (guid)->Data4[0] = 0xb9;\ - (guid)->Data4[1] = 0x17;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ -} -#define EXTRACT_USB_TERMINAL(guid)\ - (USHORT)((guid)->Data1 - 0xDFF219E0) -#define DEFINE_USB_TERMINAL_GUID(id)\ - 0xDFF219E0+(USHORT)(id), 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#define STATIC_KSNODETYPE_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0201) -DEFINE_GUIDSTRUCT("DFF21BE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE); -#define KSNODETYPE_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE) - -#define STATIC_KSNODETYPE_DESKTOP_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0202) -DEFINE_GUIDSTRUCT("DFF21BE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_MICROPHONE); -#define KSNODETYPE_DESKTOP_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_MICROPHONE) - -#define STATIC_KSNODETYPE_PERSONAL_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0203) -DEFINE_GUIDSTRUCT("DFF21BE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PERSONAL_MICROPHONE); -#define KSNODETYPE_PERSONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_PERSONAL_MICROPHONE) - -#define STATIC_KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0204) -DEFINE_GUIDSTRUCT("DFF21BE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE); -#define KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE) - -#define STATIC_KSNODETYPE_MICROPHONE_ARRAY\ - DEFINE_USB_TERMINAL_GUID(0x0205) -DEFINE_GUIDSTRUCT("DFF21BE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE_ARRAY); -#define KSNODETYPE_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE_ARRAY) - -#define STATIC_KSNODETYPE_PROCESSING_MICROPHONE_ARRAY\ - DEFINE_USB_TERMINAL_GUID(0x0206) -DEFINE_GUIDSTRUCT("DFF21BE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PROCESSING_MICROPHONE_ARRAY); -#define KSNODETYPE_PROCESSING_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_PROCESSING_MICROPHONE_ARRAY) - -#define STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR \ - 0x830a44f2, 0xa32d, 0x476b, 0xbe, 0x97, 0x42, 0x84, 0x56, 0x73, 0xb3, 0x5a -DEFINE_GUIDSTRUCT("830a44f2-a32d-476b-be97-42845673b35a", KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR); -#define KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR DEFINE_GUIDNAMED(KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR) - -#define STATIC_KSNODETYPE_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0301) -DEFINE_GUIDSTRUCT("DFF21CE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKER); -#define KSNODETYPE_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_SPEAKER) - -#define STATIC_KSNODETYPE_HEADPHONES\ - DEFINE_USB_TERMINAL_GUID(0x0302) -DEFINE_GUIDSTRUCT("DFF21CE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADPHONES); -#define KSNODETYPE_HEADPHONES DEFINE_GUIDNAMED(KSNODETYPE_HEADPHONES) - -#define STATIC_KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x0303) -DEFINE_GUIDSTRUCT("DFF21CE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO); -#define KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO) - -#define STATIC_KSNODETYPE_DESKTOP_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0304) -DEFINE_GUIDSTRUCT("DFF21CE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_SPEAKER); -#define KSNODETYPE_DESKTOP_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_SPEAKER) - -#define STATIC_KSNODETYPE_ROOM_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0305) -DEFINE_GUIDSTRUCT("DFF21CE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ROOM_SPEAKER); -#define KSNODETYPE_ROOM_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_ROOM_SPEAKER) - -#define STATIC_KSNODETYPE_COMMUNICATION_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0306) -DEFINE_GUIDSTRUCT("DFF21CE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_COMMUNICATION_SPEAKER); -#define KSNODETYPE_COMMUNICATION_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_COMMUNICATION_SPEAKER) - -#define STATIC_KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0307) -DEFINE_GUIDSTRUCT("DFF21CE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER); -#define KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER) - -#define STATIC_KSNODETYPE_HANDSET\ - DEFINE_USB_TERMINAL_GUID(0x0401) -DEFINE_GUIDSTRUCT("DFF21DE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HANDSET); -#define KSNODETYPE_HANDSET DEFINE_GUIDNAMED(KSNODETYPE_HANDSET) - -#define STATIC_KSNODETYPE_HEADSET\ - DEFINE_USB_TERMINAL_GUID(0x0402) -DEFINE_GUIDSTRUCT("DFF21DE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADSET); -#define KSNODETYPE_HEADSET DEFINE_GUIDNAMED(KSNODETYPE_HEADSET) - -#define STATIC_KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION\ - DEFINE_USB_TERMINAL_GUID(0x0403) -DEFINE_GUIDSTRUCT("DFF21DE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION); -#define KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION DEFINE_GUIDNAMED(KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION) - -#define STATIC_KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0404) -DEFINE_GUIDSTRUCT("DFF21DE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE); -#define KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE) - -#define STATIC_KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0405) -DEFINE_GUIDSTRUCT("DFF21DE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE); -#define KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE) - -#define STATIC_KSNODETYPE_PHONE_LINE\ - DEFINE_USB_TERMINAL_GUID(0x0501) -DEFINE_GUIDSTRUCT("DFF21EE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONE_LINE); -#define KSNODETYPE_PHONE_LINE DEFINE_GUIDNAMED(KSNODETYPE_PHONE_LINE) - -#define STATIC_KSNODETYPE_TELEPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0502) -DEFINE_GUIDSTRUCT("DFF21EE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TELEPHONE); -#define KSNODETYPE_TELEPHONE DEFINE_GUIDNAMED(KSNODETYPE_TELEPHONE) - -#define STATIC_KSNODETYPE_DOWN_LINE_PHONE\ - DEFINE_USB_TERMINAL_GUID(0x0503) -DEFINE_GUIDSTRUCT("DFF21EE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DOWN_LINE_PHONE); -#define KSNODETYPE_DOWN_LINE_PHONE DEFINE_GUIDNAMED(KSNODETYPE_DOWN_LINE_PHONE) - -#define STATIC_KSNODETYPE_ANALOG_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x601) -DEFINE_GUIDSTRUCT("DFF21FE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_CONNECTOR); -#define KSNODETYPE_ANALOG_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_CONNECTOR) - -#define STATIC_KSNODETYPE_DIGITAL_AUDIO_INTERFACE\ - DEFINE_USB_TERMINAL_GUID(0x0602) -DEFINE_GUIDSTRUCT("DFF21FE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DIGITAL_AUDIO_INTERFACE); -#define KSNODETYPE_DIGITAL_AUDIO_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_DIGITAL_AUDIO_INTERFACE) - -#define STATIC_KSNODETYPE_LINE_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x0603) -DEFINE_GUIDSTRUCT("DFF21FE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LINE_CONNECTOR); -#define KSNODETYPE_LINE_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LINE_CONNECTOR) - -#define STATIC_KSNODETYPE_LEGACY_AUDIO_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x0604) -DEFINE_GUIDSTRUCT("DFF21FE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEGACY_AUDIO_CONNECTOR); -#define KSNODETYPE_LEGACY_AUDIO_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LEGACY_AUDIO_CONNECTOR) - -#define STATIC_KSNODETYPE_SPDIF_INTERFACE\ - DEFINE_USB_TERMINAL_GUID(0x0605) -DEFINE_GUIDSTRUCT("DFF21FE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPDIF_INTERFACE); -#define KSNODETYPE_SPDIF_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_SPDIF_INTERFACE) - -#define STATIC_KSNODETYPE_1394_DA_STREAM\ - DEFINE_USB_TERMINAL_GUID(0x0606) -DEFINE_GUIDSTRUCT("DFF21FE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DA_STREAM); -#define KSNODETYPE_1394_DA_STREAM DEFINE_GUIDNAMED(KSNODETYPE_1394_DA_STREAM) - -#define STATIC_KSNODETYPE_1394_DV_STREAM_SOUNDTRACK\ - DEFINE_USB_TERMINAL_GUID(0x0607) -DEFINE_GUIDSTRUCT("DFF21FE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DV_STREAM_SOUNDTRACK); -#define KSNODETYPE_1394_DV_STREAM_SOUNDTRACK DEFINE_GUIDNAMED(KSNODETYPE_1394_DV_STREAM_SOUNDTRACK) - -#define STATIC_KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE\ - DEFINE_USB_TERMINAL_GUID(0x0701) -DEFINE_GUIDSTRUCT("DFF220E1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE); -#define KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE DEFINE_GUIDNAMED(KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE) - -#define STATIC_KSNODETYPE_EQUALIZATION_NOISE\ - DEFINE_USB_TERMINAL_GUID(0x0702) -DEFINE_GUIDSTRUCT("DFF220E2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_EQUALIZATION_NOISE); -#define KSNODETYPE_EQUALIZATION_NOISE DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZATION_NOISE) - -#define STATIC_KSNODETYPE_CD_PLAYER\ - DEFINE_USB_TERMINAL_GUID(0x0703) -DEFINE_GUIDSTRUCT("DFF220E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CD_PLAYER); -#define KSNODETYPE_CD_PLAYER DEFINE_GUIDNAMED(KSNODETYPE_CD_PLAYER) - -#define STATIC_KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE\ - DEFINE_USB_TERMINAL_GUID(0x0704) -DEFINE_GUIDSTRUCT("DFF220E4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE); -#define KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE DEFINE_GUIDNAMED(KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE) - -#define STATIC_KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE\ - DEFINE_USB_TERMINAL_GUID(0x0705) -DEFINE_GUIDSTRUCT("DFF220E5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE); -#define KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE DEFINE_GUIDNAMED(KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE) - -#define STATIC_KSNODETYPE_MINIDISK\ - DEFINE_USB_TERMINAL_GUID(0x0706) -DEFINE_GUIDSTRUCT("DFF220E6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MINIDISK); -#define KSNODETYPE_MINIDISK DEFINE_GUIDNAMED(KSNODETYPE_MINIDISK) - -#define STATIC_KSNODETYPE_ANALOG_TAPE\ - DEFINE_USB_TERMINAL_GUID(0x0707) -DEFINE_GUIDSTRUCT("DFF220E7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_TAPE); -#define KSNODETYPE_ANALOG_TAPE DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_TAPE) - -#define STATIC_KSNODETYPE_PHONOGRAPH\ - DEFINE_USB_TERMINAL_GUID(0x0708) -DEFINE_GUIDSTRUCT("DFF220E8-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONOGRAPH); -#define KSNODETYPE_PHONOGRAPH DEFINE_GUIDNAMED(KSNODETYPE_PHONOGRAPH) - -#define STATIC_KSNODETYPE_VCR_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x0708) -DEFINE_GUIDSTRUCT("DFF220E9-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VCR_AUDIO); -#define KSNODETYPE_VCR_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VCR_AUDIO) - -#define STATIC_KSNODETYPE_VIDEO_DISC_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070A) -DEFINE_GUIDSTRUCT("DFF220EA-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_DISC_AUDIO); -#define KSNODETYPE_VIDEO_DISC_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_DISC_AUDIO) - -#define STATIC_KSNODETYPE_DVD_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070B) -DEFINE_GUIDSTRUCT("DFF220EB-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DVD_AUDIO); -#define KSNODETYPE_DVD_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DVD_AUDIO) - -#define STATIC_KSNODETYPE_TV_TUNER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070C) -DEFINE_GUIDSTRUCT("DFF220EC-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TV_TUNER_AUDIO); -#define KSNODETYPE_TV_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_TV_TUNER_AUDIO) - -#define STATIC_KSNODETYPE_SATELLITE_RECEIVER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070D) -DEFINE_GUIDSTRUCT("DFF220ED-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SATELLITE_RECEIVER_AUDIO); -#define KSNODETYPE_SATELLITE_RECEIVER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_SATELLITE_RECEIVER_AUDIO) - -#define STATIC_KSNODETYPE_CABLE_TUNER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070E) -DEFINE_GUIDSTRUCT("DFF220EE-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CABLE_TUNER_AUDIO); -#define KSNODETYPE_CABLE_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_CABLE_TUNER_AUDIO) - -#define STATIC_KSNODETYPE_DSS_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070F) -DEFINE_GUIDSTRUCT("DFF220EF-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DSS_AUDIO); -#define KSNODETYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DSS_AUDIO) - -#define STATIC_KSNODETYPE_RADIO_RECEIVER\ - DEFINE_USB_TERMINAL_GUID(0x0710) -DEFINE_GUIDSTRUCT("DFF220F0-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_RECEIVER); -#define KSNODETYPE_RADIO_RECEIVER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_RECEIVER) - -#define STATIC_KSNODETYPE_RADIO_TRANSMITTER\ - DEFINE_USB_TERMINAL_GUID(0x0711) -DEFINE_GUIDSTRUCT("DFF220F1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_TRANSMITTER); -#define KSNODETYPE_RADIO_TRANSMITTER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_TRANSMITTER) - -#define STATIC_KSNODETYPE_MULTITRACK_RECORDER\ - DEFINE_USB_TERMINAL_GUID(0x0712) -DEFINE_GUIDSTRUCT("DFF220F2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MULTITRACK_RECORDER); -#define KSNODETYPE_MULTITRACK_RECORDER DEFINE_GUIDNAMED(KSNODETYPE_MULTITRACK_RECORDER) - -#define STATIC_KSNODETYPE_SYNTHESIZER\ - DEFINE_USB_TERMINAL_GUID(0x0713) -DEFINE_GUIDSTRUCT("DFF220F3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SYNTHESIZER); -#define KSNODETYPE_SYNTHESIZER DEFINE_GUIDNAMED(KSNODETYPE_SYNTHESIZER) - -// Microsoft's WDMAUD virtual swsynth pin name guid - -#define STATIC_KSNODETYPE_SWSYNTH\ - 0x423274A0L, 0x8B81, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("423274A0-8B81-11D1-A050-0000F8004788", KSNODETYPE_SWSYNTH); -#define KSNODETYPE_SWSYNTH DEFINE_GUIDNAMED(KSNODETYPE_SWSYNTH) - -// Microsoft's SWMIDI midi pin and node name guid - -#define STATIC_KSNODETYPE_SWMIDI\ - 0xCB9BEFA0L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("CB9BEFA0-A251-11D1-A050-0000F8004788", KSNODETYPE_SWMIDI); -#define KSNODETYPE_SWMIDI DEFINE_GUIDNAMED(KSNODETYPE_SWMIDI) - -#define STATIC_KSNODETYPE_DRM_DESCRAMBLE\ - 0xFFBB6E3FL, 0xCCFE, 0x4D84, 0x90, 0xD9, 0x42, 0x14, 0x18, 0xB0, 0x3A, 0x8E -DEFINE_GUIDSTRUCT("FFBB6E3F-CCFE-4D84-90D9-421418B03A8E", KSNODETYPE_DRM_DESCRAMBLE); -#define KSNODETYPE_DRM_DESCRAMBLE DEFINE_GUIDNAMED(KSNODETYPE_DRM_DESCRAMBLE) - -// General categories -#define STATIC_KSCATEGORY_AUDIO \ - 0x6994AD04L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO); -#define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO) - -#define STATIC_KSCATEGORY_VIDEO \ - 0x6994AD05L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("6994AD05-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_VIDEO); -#define KSCATEGORY_VIDEO DEFINE_GUIDNAMED(KSCATEGORY_VIDEO) - -#define STATIC_KSCATEGORY_TEXT \ - 0x6994AD06L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("6994AD06-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_TEXT); -#define KSCATEGORY_TEXT DEFINE_GUIDNAMED(KSCATEGORY_TEXT) - -#define STATIC_KSCATEGORY_NETWORK \ - 0x67C9CC3CL, 0x69C4, 0x11D2, 0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("67C9CC3C-69C4-11D2-8759-00A0C9223196", KSCATEGORY_NETWORK); -#define KSCATEGORY_NETWORK DEFINE_GUIDNAMED(KSCATEGORY_NETWORK) - -#define STATIC_KSCATEGORY_TOPOLOGY \ - 0xDDA54A40L, 0x1E4C, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("DDA54A40-1E4C-11D1-A050-405705C10000", KSCATEGORY_TOPOLOGY); -#define KSCATEGORY_TOPOLOGY DEFINE_GUIDNAMED(KSCATEGORY_TOPOLOGY) - -#define STATIC_KSCATEGORY_VIRTUAL \ - 0x3503EAC4L, 0x1F26, 0x11D1, 0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("3503EAC4-1F26-11D1-8AB0-00A0C9223196", KSCATEGORY_VIRTUAL); -#define KSCATEGORY_VIRTUAL DEFINE_GUIDNAMED(KSCATEGORY_VIRTUAL) - -#define STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL \ - 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("BF963D80-C559-11D0-8A2B-00A0C9255AC1", KSCATEGORY_ACOUSTIC_ECHO_CANCEL); -#define KSCATEGORY_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSCATEGORY_ACOUSTIC_ECHO_CANCEL) - -#define STATIC_KSCATEGORY_SYSAUDIO \ - 0xA7C7A5B1L, 0x5AF3, 0x11D1, 0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07 -DEFINE_GUIDSTRUCT("A7C7A5B1-5AF3-11D1-9CED-00A024BF0407", KSCATEGORY_SYSAUDIO); -#define KSCATEGORY_SYSAUDIO DEFINE_GUIDNAMED(KSCATEGORY_SYSAUDIO) - -#define STATIC_KSCATEGORY_WDMAUD \ - 0x3E227E76L, 0x690D, 0x11D2, 0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1 -DEFINE_GUIDSTRUCT("3E227E76-690D-11D2-8161-0000F8775BF1", KSCATEGORY_WDMAUD); -#define KSCATEGORY_WDMAUD DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD) - -#define STATIC_KSCATEGORY_AUDIO_GFX \ - 0x9BAF9572L, 0x340C, 0x11D3, 0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F -DEFINE_GUIDSTRUCT("9BAF9572-340C-11D3-ABDC-00A0C90AB16F", KSCATEGORY_AUDIO_GFX); -#define KSCATEGORY_AUDIO_GFX DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_GFX) - -#define STATIC_KSCATEGORY_AUDIO_SPLITTER \ - 0x9EA331FAL, 0xB91B, 0x45F8, 0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE -DEFINE_GUIDSTRUCT("9EA331FA-B91B-45F8-9285-BD2BC77AFCDE", KSCATEGORY_AUDIO_SPLITTER); -#define KSCATEGORY_AUDIO_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_SPLITTER) - -#define STATIC_KSCATEGORY_SYNTHESIZER STATIC_KSNODETYPE_SYNTHESIZER -#define KSCATEGORY_SYNTHESIZER KSNODETYPE_SYNTHESIZER - -#define STATIC_KSCATEGORY_DRM_DESCRAMBLE STATIC_KSNODETYPE_DRM_DESCRAMBLE -#define KSCATEGORY_DRM_DESCRAMBLE KSNODETYPE_DRM_DESCRAMBLE - -#define STATIC_KSCATEGORY_AUDIO_DEVICE \ - 0xFBF6F530L, 0x07B9, 0x11D2, 0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("FBF6F530-07B9-11D2-A71E-0000F8004788", KSCATEGORY_AUDIO_DEVICE); -#define KSCATEGORY_AUDIO_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_DEVICE) - -#define STATIC_KSCATEGORY_PREFERRED_WAVEOUT_DEVICE \ - 0xD6C5066EL, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C5066E-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEOUT_DEVICE); -#define KSCATEGORY_PREFERRED_WAVEOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEOUT_DEVICE) - -#define STATIC_KSCATEGORY_PREFERRED_WAVEIN_DEVICE \ - 0xD6C50671L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C50671-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEIN_DEVICE); -#define KSCATEGORY_PREFERRED_WAVEIN_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEIN_DEVICE) - -#define STATIC_KSCATEGORY_PREFERRED_MIDIOUT_DEVICE \ - 0xD6C50674L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C50674-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_MIDIOUT_DEVICE); -#define KSCATEGORY_PREFERRED_MIDIOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_MIDIOUT_DEVICE) - -// Special pin category for wdmaud - -#define STATIC_KSCATEGORY_WDMAUD_USE_PIN_NAME \ - 0x47A4FA20L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("47A4FA20-A251-11D1-A050-0000F8004788", KSCATEGORY_WDMAUD_USE_PIN_NAME); -#define KSCATEGORY_WDMAUD_USE_PIN_NAME DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD_USE_PIN_NAME) - -// Escalante Platform Interface - -#define STATIC_KSCATEGORY_ESCALANTE_PLATFORM_DRIVER \ - 0x74f3aea8L, 0x9768, 0x11d1, 0x8e, 0x07, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e -DEFINE_GUIDSTRUCT("74f3aea8-9768-11d1-8e07-00a0c95ec22e", KSCATEGORY_ESCALANTE_PLATFORM_DRIVER); -#define KSCATEGORY_ESCALANTE_PLATFORM_DRIVER DEFINE_GUIDNAMED(KSCATEGORY_ESCALANTE_PLATFORM_DRIVER) - -// -- major types --- - -// 'vids' == MEDIATYPE_Video, -#define STATIC_KSDATAFORMAT_TYPE_VIDEO\ - 0x73646976L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73646976-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_VIDEO); -#define KSDATAFORMAT_TYPE_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VIDEO) - -// 'auds' == MEDIATYPE_Audio -#define STATIC_KSDATAFORMAT_TYPE_AUDIO\ - 0x73647561L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73647561-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_AUDIO); -#define KSDATAFORMAT_TYPE_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUDIO) - -// 'txts' == MEDIATYPE_Text -#define STATIC_KSDATAFORMAT_TYPE_TEXT\ - 0x73747874L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73747874-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_TEXT); -#define KSDATAFORMAT_TYPE_TEXT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_TEXT) - -#if !defined( DEFINE_WAVEFORMATEX_GUID ) -#define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -#endif - -#define STATIC_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX\ - 0x00000000L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("00000000-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_WAVEFORMATEX); -#define KSDATAFORMAT_SUBTYPE_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) - -#define INIT_WAVEFORMATEX_GUID(Guid, x)\ -{\ - *(Guid) = KSDATAFORMAT_SUBTYPE_WAVEFORMATEX;\ - (Guid)->Data1 = (USHORT)(x);\ -} - -#define EXTRACT_WAVEFORMATEX_ID(Guid)\ - (USHORT)((Guid)->Data1) - -#define IS_VALID_WAVEFORMATEX_GUID(Guid)\ - (!memcmp(((PUSHORT)&KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) + 1, ((PUSHORT)(Guid)) + 1, sizeof(GUID) - sizeof(USHORT))) - -#if !defined(INIT_MMREG_MID) -//{d5a47fa7-6d98-11d1-a21a-00a0c9223196} -#define INIT_MMREG_MID(guid, id)\ -{\ - (guid)->Data1 = 0xd5a47fa7 + (USHORT)(id);\ - (guid)->Data2 = 0x6d98;\ - (guid)->Data3 = 0x11d1;\ - (guid)->Data4[0] = 0xa2;\ - (guid)->Data4[1] = 0x1a;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ -} -#define EXTRACT_MMREG_MID(guid)\ - (USHORT)((guid)->Data1 - 0xd5a47fa7) -#define DEFINE_MMREG_MID_GUID(id)\ - 0xd5a47fa7+(USHORT)(id), 0x6d98, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - -#define IS_COMPATIBLE_MMREG_MID(guid)\ - (((guid)->Data1 >= 0xd5a47fa7) &&\ - ((guid)->Data1 < 0xd5a47fa7 + 0xffff) &&\ - ((guid)->Data2 == 0x6d98) &&\ - ((guid)->Data3 == 0x11d1) &&\ - ((guid)->Data4[0] == 0xa2) &&\ - ((guid)->Data4[1] == 0x1a) &&\ - ((guid)->Data4[2] == 0x00) &&\ - ((guid)->Data4[3] == 0xa0) &&\ - ((guid)->Data4[4] == 0xc9) &&\ - ((guid)->Data4[5] == 0x22) &&\ - ((guid)->Data4[6] == 0x31) &&\ - ((guid)->Data4[7] == 0x96)) -#endif // !defined(INIT_MMREG_MID) - -#if !defined(INIT_MMREG_PID) -//{e36dc2ac-6d9a-11d1-a21a-00a0c9223196} -#define INIT_MMREG_PID(guid, id)\ -{\ - (guid)->Data1 = 0xe36dc2ac + (USHORT)(id);\ - (guid)->Data2 = 0x6d9a;\ - (guid)->Data3 = 0x11d1;\ - (guid)->Data4[0] = 0xa2;\ - (guid)->Data4[1] = 0x1a;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ -} -#define EXTRACT_MMREG_PID(guid)\ - (USHORT)((guid)->Data1 - 0xe36dc2ac) -#define DEFINE_MMREG_PID_GUID(id)\ - 0xe36dc2ac+(USHORT)(id), 0x6d9a, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - -#define IS_COMPATIBLE_MMREG_PID(guid)\ - (((guid)->Data1 >= 0xe36dc2ac) &&\ - ((guid)->Data1 < 0xe36dc2ac + 0xffff) &&\ - ((guid)->Data2 == 0x6d9a) &&\ - ((guid)->Data3 == 0x11d1) &&\ - ((guid)->Data4[0] == 0xa2) &&\ - ((guid)->Data4[1] == 0x1a) &&\ - ((guid)->Data4[2] == 0x00) &&\ - ((guid)->Data4[3] == 0xa0) &&\ - ((guid)->Data4[4] == 0xc9) &&\ - ((guid)->Data4[5] == 0x22) &&\ - ((guid)->Data4[6] == 0x31) &&\ - ((guid)->Data4[7] == 0x96)) -#endif // !defined(INIT_MMREG_PID) - -#define STATIC_KSDATAFORMAT_SUBTYPE_ANALOG\ - 0x6dba3190L, 0x67bd, 0x11cf, 0xa0, 0xf7, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("6dba3190-67bd-11cf-a0f7-0020afd156e4", KSDATAFORMAT_SUBTYPE_ANALOG); -#define KSDATAFORMAT_SUBTYPE_ANALOG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ANALOG) - -#define STATIC_KSDATAFORMAT_SUBTYPE_PCM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_PCM) -DEFINE_GUIDSTRUCT("00000001-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_PCM); -#define KSDATAFORMAT_SUBTYPE_PCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_PCM) - -#if defined(_INC_MMREG) -#define STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_IEEE_FLOAT) -DEFINE_GUIDSTRUCT("00000003-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_IEEE_FLOAT); -#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) - -#define STATIC_KSDATAFORMAT_SUBTYPE_DRM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DRM) -DEFINE_GUIDSTRUCT("00000009-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DRM); -#define KSDATAFORMAT_SUBTYPE_DRM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DRM) - -#define STATIC_KSDATAFORMAT_SUBTYPE_ALAW\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ALAW) -DEFINE_GUIDSTRUCT("00000006-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ALAW); -#define KSDATAFORMAT_SUBTYPE_ALAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ALAW) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MULAW\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MULAW) -DEFINE_GUIDSTRUCT("00000007-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MULAW); -#define KSDATAFORMAT_SUBTYPE_MULAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MULAW) - -#define STATIC_KSDATAFORMAT_SUBTYPE_ADPCM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ADPCM) -DEFINE_GUIDSTRUCT("00000002-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ADPCM); -#define KSDATAFORMAT_SUBTYPE_ADPCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ADPCM) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MPEG) -DEFINE_GUIDSTRUCT("00000050-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MPEG); -#define KSDATAFORMAT_SUBTYPE_MPEG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG) -#endif // defined(_INC_MMREG) - -#define STATIC_KSDATAFORMAT_SPECIFIER_VC_ID\ - 0xAD98D184L, 0xAAC3, 0x11D0, 0xA4, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("AD98D184-AAC3-11D0-A41C-00A0C9223196", KSDATAFORMAT_SPECIFIER_VC_ID); -#define KSDATAFORMAT_SPECIFIER_VC_ID DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VC_ID) - -#define STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX\ - 0x05589f81L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f81-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_WAVEFORMATEX); -#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) - -#define STATIC_KSDATAFORMAT_SPECIFIER_DSOUND\ - 0x518590a2L, 0xa184, 0x11d0, 0x85, 0x22, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("518590a2-a184-11d0-8522-00c04fd9baf3", KSDATAFORMAT_SPECIFIER_DSOUND); -#define KSDATAFORMAT_SPECIFIER_DSOUND DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DSOUND) - -#if defined(_INC_MMSYSTEM) || defined(_INC_MMREG) -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif -typedef struct { - KSDATAFORMAT DataFormat; - WAVEFORMATEX WaveFormatEx; -} KSDATAFORMAT_WAVEFORMATEX, *PKSDATAFORMAT_WAVEFORMATEX; - -#ifndef _WAVEFORMATEXTENSIBLE_ -#define _WAVEFORMATEXTENSIBLE_ -typedef struct { - WAVEFORMATEX Format; - union { - WORD wValidBitsPerSample; /* bits of precision */ - WORD wSamplesPerBlock; /* valid if wBitsPerSample==0 */ - WORD wReserved; /* If neither applies, set to zero. */ - } Samples; - DWORD dwChannelMask; /* which channels are */ - /* present in stream */ - GUID SubFormat; -} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; -#endif // !_WAVEFORMATEXTENSIBLE_ - -#if !defined(WAVE_FORMAT_EXTENSIBLE) -#define WAVE_FORMAT_EXTENSIBLE 0xFFFE -#endif // !defined(WAVE_FORMAT_EXTENSIBLE) - -// DirectSound buffer description -typedef struct { - ULONG Flags; - ULONG Control; - WAVEFORMATEX WaveFormatEx; -} KSDSOUND_BUFFERDESC, *PKSDSOUND_BUFFERDESC; - -// DirectSound format -typedef struct { - KSDATAFORMAT DataFormat; - KSDSOUND_BUFFERDESC BufferDesc; -} KSDATAFORMAT_DSOUND, *PKSDATAFORMAT_DSOUND; - -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif -#endif // defined(_INC_MMSYSTEM) || defined(_INC_MMREG) - - - -// DirectSound buffer flags -#define KSDSOUND_BUFFER_PRIMARY 0x00000001 -#define KSDSOUND_BUFFER_STATIC 0x00000002 -#define KSDSOUND_BUFFER_LOCHARDWARE 0x00000004 -#define KSDSOUND_BUFFER_LOCSOFTWARE 0x00000008 - -// DirectSound buffer control flags -#define KSDSOUND_BUFFER_CTRL_3D 0x00000001 -#define KSDSOUND_BUFFER_CTRL_FREQUENCY 0x00000002 -#define KSDSOUND_BUFFER_CTRL_PAN 0x00000004 -#define KSDSOUND_BUFFER_CTRL_VOLUME 0x00000008 -#define KSDSOUND_BUFFER_CTRL_POSITIONNOTIFY 0x00000010 - -typedef struct { -#if defined(_NTDDK_) - ULONGLONG PlayOffset; - ULONGLONG WriteOffset; -#else // !_NTDDK_ - DWORDLONG PlayOffset; - DWORDLONG WriteOffset; -#endif // !_NTDDK_ -} KSAUDIO_POSITION, *PKSAUDIO_POSITION; - -//=========================================================================== -// DirectSound3D HAL - - -typedef struct _DS3DVECTOR { - union { - FLOAT x; - FLOAT dvX; - }; - union { - FLOAT y; - FLOAT dvY; - }; - union { - FLOAT z; - FLOAT dvZ; - }; -} DS3DVECTOR, *PDS3DVECTOR; - - -//=========================================================================== -//=========================================================================== - -// KSPROPSETID_DirectSound3DListener : {437B3414-D060-11d0-8583-00C04FD9BAF3} - -#define STATIC_KSPROPSETID_DirectSound3DListener\ - 0x437b3414L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("437b3414-d060-11d0-8583-00c04fd9baf3",KSPROPSETID_DirectSound3DListener); -#define KSPROPSETID_DirectSound3DListener DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DListener) - -typedef enum { - KSPROPERTY_DIRECTSOUND3DLISTENER_ALL, - KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION, - KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION, - KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH, - KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION -} KSPROPERTY_DIRECTSOUND3DLISTENER; - -typedef struct { - DS3DVECTOR Position; - DS3DVECTOR Velocity; - DS3DVECTOR OrientFront; - DS3DVECTOR OrientTop; - FLOAT DistanceFactor; - FLOAT RolloffFactor; - FLOAT DopplerFactor; -} KSDS3D_LISTENER_ALL, *PKSDS3D_LISTENER_ALL; - -typedef struct { - DS3DVECTOR Front; - DS3DVECTOR Top; -} KSDS3D_LISTENER_ORIENTATION, *PKSDS3D_LISTENER_ORIENTATION; - - -//=========================================================================== -//=========================================================================== -// KSPROPSETID_DirectSound3DBuffer : {437B3411-D060-11d0-8583-00C04FD9BAF3} - -#define STATIC_KSPROPSETID_DirectSound3DBuffer\ - 0x437b3411L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("437b3411-d060-11d0-8583-00c04fd9baf3", KSPROPSETID_DirectSound3DBuffer); -#define KSPROPSETID_DirectSound3DBuffer DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DBuffer) - - -typedef enum { - KSPROPERTY_DIRECTSOUND3DBUFFER_ALL, - KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION, - KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME, - KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MODE -} KSPROPERTY_DIRECTSOUND3DBUFFER; - - -typedef struct { - DS3DVECTOR Position; - DS3DVECTOR Velocity; - ULONG InsideConeAngle; - ULONG OutsideConeAngle; - DS3DVECTOR ConeOrientation; - LONG ConeOutsideVolume; - FLOAT MinDistance; - FLOAT MaxDistance; - ULONG Mode; -} KSDS3D_BUFFER_ALL, *PKSDS3D_BUFFER_ALL; - -typedef struct { - ULONG InsideConeAngle; - ULONG OutsideConeAngle; -} KSDS3D_BUFFER_CONE_ANGLES, *PKSDS3D_BUFFER_CONE_ANGLES; - -#define KSAUDIO_STEREO_SPEAKER_GEOMETRY_HEADPHONE (-1) -#define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MIN 5 -#define KSAUDIO_STEREO_SPEAKER_GEOMETRY_NARROW 10 -#define KSAUDIO_STEREO_SPEAKER_GEOMETRY_WIDE 20 -#define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MAX 180 - -#define KSDSOUND_3D_MODE_NORMAL 0x00000000 -#define KSDSOUND_3D_MODE_HEADRELATIVE 0x00000001 -#define KSDSOUND_3D_MODE_DISABLE 0x00000002 - -typedef struct { - KSDATARANGE DataRange; - ULONG MaximumChannels; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; -} KSDATARANGE_AUDIO, *PKSDATARANGE_AUDIO; - -//--------------------------------------------------------------------------- - -#define STATIC_KSDATAFORMAT_SUBTYPE_RIFF\ - 0x4995DAEEL, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("4995DAEE-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFF); -#define KSDATAFORMAT_SUBTYPE_RIFF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFF) - -#define STATIC_KSDATAFORMAT_SUBTYPE_RIFFWAVE\ - 0xe436eb8bL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb8b-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_RIFFWAVE); -#define KSDATAFORMAT_SUBTYPE_RIFFWAVE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFWAVE) - -//=========================================================================== -//=========================================================================== - -#define STATIC_KSPROPSETID_Bibliographic \ - 0x07BA150EL, 0xE2B1, 0x11D0, 0xAC, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("07BA150E-E2B1-11D0-AC17-00A0C9223196", KSPROPSETID_Bibliographic); -#define KSPROPSETID_Bibliographic DEFINE_GUIDNAMED(KSPROPSETID_Bibliographic) - -//Repeatable tags contain all entries within the property, each preceeded by length -typedef enum { - KSPROPERTY_BIBLIOGRAPHIC_LEADER = 'RDL ', - KSPROPERTY_BIBLIOGRAPHIC_LCCN = '010 ', - KSPROPERTY_BIBLIOGRAPHIC_ISBN = '020 ', - KSPROPERTY_BIBLIOGRAPHIC_ISSN = '220 ', - KSPROPERTY_BIBLIOGRAPHIC_CATALOGINGSOURCE = '040 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINPERSONALNAME = '001 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINCORPORATEBODY = '011 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINMEETINGNAME = '111 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINUNIFORMTITLE = '031 ', - KSPROPERTY_BIBLIOGRAPHIC_UNIFORMTITLE = '042 ', - KSPROPERTY_BIBLIOGRAPHIC_TITLESTATEMENT = '542 ', - KSPROPERTY_BIBLIOGRAPHIC_VARYINGFORMTITLE = '642 ', - KSPROPERTY_BIBLIOGRAPHIC_PUBLICATION = '062 ', - KSPROPERTY_BIBLIOGRAPHIC_PHYSICALDESCRIPTION = '003 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTITLE = '044 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENT = '094 ', - KSPROPERTY_BIBLIOGRAPHIC_GENERALNOTE = '005 ', - KSPROPERTY_BIBLIOGRAPHIC_BIBLIOGRAPHYNOTE = '405 ', - KSPROPERTY_BIBLIOGRAPHIC_CONTENTSNOTE = '505 ', - KSPROPERTY_BIBLIOGRAPHIC_CREATIONCREDIT = '805 ', - KSPROPERTY_BIBLIOGRAPHIC_CITATION = '015 ', - KSPROPERTY_BIBLIOGRAPHIC_PARTICIPANT = '115 ', - KSPROPERTY_BIBLIOGRAPHIC_SUMMARY = '025 ', - KSPROPERTY_BIBLIOGRAPHIC_TARGETAUDIENCE = '125 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDFORMAVAILABLE = '035 ', - KSPROPERTY_BIBLIOGRAPHIC_SYSTEMDETAILS = '835 ', - KSPROPERTY_BIBLIOGRAPHIC_AWARDS = '685 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYPERSONALNAME = '006 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTOPICALTERM = '056 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYGEOGRAPHIC = '156 ', - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMGENRE = '556 ', - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMCURRICULUM = '856 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYUNIFORMTITLE = '037 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYRELATED = '047 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTPERSONALNAME = '008 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTUNIFORMTITLE = '038 ' -} KSPROPERTY_BIBLIOGRAPHIC; - -#define STATIC_KSPROPSETID_TopologyNode\ - 0x45FFAAA1L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("45FFAAA1-6E1B-11D0-BCF2-444553540000", KSPROPSETID_TopologyNode); -#define KSPROPSETID_TopologyNode DEFINE_GUIDNAMED(KSPROPSETID_TopologyNode) - -typedef enum { - KSPROPERTY_TOPOLOGYNODE_ENABLE = 1, - KSPROPERTY_TOPOLOGYNODE_RESET -} KSPROPERTY_TOPOLOGYNODE; - -//=========================================================================== - -#if defined(_NTDDK_) -typedef NTSTATUS (CALLBACK *PRTAUDIOGETPOSITION)(IN PFILE_OBJECT PinFileObject, - OUT PUCHAR *ppPlayPosition, - OUT PLONG plOffset); -#endif // defined(_NTDDK_) - -#define STATIC_KSPROPSETID_RtAudio\ - 0xa855a48c, 0x2f78, 0x4729, 0x90, 0x51, 0x19, 0x68, 0x74, 0x6b, 0x9e, 0xef -DEFINE_GUIDSTRUCT("A855A48C-2F78-4729-9051-1968746B9EEF", KSPROPSETID_RtAudio); -#define KSPROPSETID_RtAudio DEFINE_GUIDNAMED(KSPROPSETID_RtAudio) - -typedef enum { - KSPROPERTY_RTAUDIO_GETPOSITIONFUNCTION -} KSPROPERTY_RTAUDIO; - -//=========================================================================== -#define STATIC_KSPROPSETID_DrmAudioStream\ - 0x2f2c8ddd, 0x4198, 0x4fac, 0xba, 0x29, 0x61, 0xbb, 0x5, 0xb7, 0xde, 0x6 -DEFINE_GUIDSTRUCT("2F2C8DDD-4198-4fac-BA29-61BB05B7DE06", KSPROPSETID_DrmAudioStream); -#define KSPROPSETID_DrmAudioStream DEFINE_GUIDNAMED(KSPROPSETID_DrmAudioStream) - -typedef enum { - KSPROPERTY_DRMAUDIOSTREAM_CONTENTID -} KSPROPERTY_DRMAUDIOSTREAM; - -//=========================================================================== -#define STATIC_KSPROPSETID_Audio\ - 0x45FFAAA0L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("45FFAAA0-6E1B-11D0-BCF2-444553540000", KSPROPSETID_Audio); -#define KSPROPSETID_Audio DEFINE_GUIDNAMED(KSPROPSETID_Audio) - -typedef enum { - KSPROPERTY_AUDIO_LATENCY = 1, - KSPROPERTY_AUDIO_COPY_PROTECTION, - KSPROPERTY_AUDIO_CHANNEL_CONFIG, - KSPROPERTY_AUDIO_VOLUMELEVEL, - KSPROPERTY_AUDIO_POSITION, - KSPROPERTY_AUDIO_DYNAMIC_RANGE, - KSPROPERTY_AUDIO_QUALITY, - KSPROPERTY_AUDIO_SAMPLING_RATE, - KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE, - KSPROPERTY_AUDIO_MIX_LEVEL_TABLE, - KSPROPERTY_AUDIO_MIX_LEVEL_CAPS, - KSPROPERTY_AUDIO_MUX_SOURCE, - KSPROPERTY_AUDIO_MUTE, - KSPROPERTY_AUDIO_BASS, - KSPROPERTY_AUDIO_MID, - KSPROPERTY_AUDIO_TREBLE, - KSPROPERTY_AUDIO_BASS_BOOST, - KSPROPERTY_AUDIO_EQ_LEVEL, - KSPROPERTY_AUDIO_NUM_EQ_BANDS, - KSPROPERTY_AUDIO_EQ_BANDS, - KSPROPERTY_AUDIO_AGC, - KSPROPERTY_AUDIO_DELAY, - KSPROPERTY_AUDIO_LOUDNESS, - KSPROPERTY_AUDIO_WIDE_MODE, - KSPROPERTY_AUDIO_WIDENESS, - KSPROPERTY_AUDIO_REVERB_LEVEL, - KSPROPERTY_AUDIO_CHORUS_LEVEL, - KSPROPERTY_AUDIO_DEV_SPECIFIC, - KSPROPERTY_AUDIO_DEMUX_DEST, - KSPROPERTY_AUDIO_STEREO_ENHANCE, - KSPROPERTY_AUDIO_MANUFACTURE_GUID, - KSPROPERTY_AUDIO_PRODUCT_GUID, - KSPROPERTY_AUDIO_CPU_RESOURCES, - KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY, - KSPROPERTY_AUDIO_SURROUND_ENCODE, - KSPROPERTY_AUDIO_3D_INTERFACE, - KSPROPERTY_AUDIO_PEAKMETER, - KSPROPERTY_AUDIO_ALGORITHM_INSTANCE, - KSPROPERTY_AUDIO_FILTER_STATE, - KSPROPERTY_AUDIO_PREFERRED_STATUS -} KSPROPERTY_AUDIO; - -// Audio quality constants -#define KSAUDIO_QUALITY_WORST 0x0 -#define KSAUDIO_QUALITY_PC 0x1 -#define KSAUDIO_QUALITY_BASIC 0x2 -#define KSAUDIO_QUALITY_ADVANCED 0x3 - -// Audio CPU resource constants -#define KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU 0x00000000 -#define KSAUDIO_CPU_RESOURCES_HOST_CPU 0x7FFFFFFF - -typedef struct { - BOOL fCopyrighted; - BOOL fOriginal; -} KSAUDIO_COPY_PROTECTION, *PKSAUDIO_COPY_PROTECTION; - -typedef struct { - LONG ActiveSpeakerPositions; -} KSAUDIO_CHANNEL_CONFIG, *PKSAUDIO_CHANNEL_CONFIG; - -// Speaker Positions: -#define SPEAKER_FRONT_LEFT 0x1 -#define SPEAKER_FRONT_RIGHT 0x2 -#define SPEAKER_FRONT_CENTER 0x4 -#define SPEAKER_LOW_FREQUENCY 0x8 -#define SPEAKER_BACK_LEFT 0x10 -#define SPEAKER_BACK_RIGHT 0x20 -#define SPEAKER_FRONT_LEFT_OF_CENTER 0x40 -#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 -#define SPEAKER_BACK_CENTER 0x100 -#define SPEAKER_SIDE_LEFT 0x200 -#define SPEAKER_SIDE_RIGHT 0x400 -#define SPEAKER_TOP_CENTER 0x800 -#define SPEAKER_TOP_FRONT_LEFT 0x1000 -#define SPEAKER_TOP_FRONT_CENTER 0x2000 -#define SPEAKER_TOP_FRONT_RIGHT 0x4000 -#define SPEAKER_TOP_BACK_LEFT 0x8000 -#define SPEAKER_TOP_BACK_CENTER 0x10000 -#define SPEAKER_TOP_BACK_RIGHT 0x20000 - -// Bit mask locations reserved for future use -#define SPEAKER_RESERVED 0x7FFC0000 - -// Used to specify that any possible permutation of speaker configurations -#define SPEAKER_ALL 0x80000000 - -// DirectSound Speaker Config -#define KSAUDIO_SPEAKER_DIRECTOUT 0 -#define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER) -#define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) -#define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) -#define KSAUDIO_SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) -#define KSAUDIO_SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) -#define KSAUDIO_SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) - -// DVD Speaker Positions -#define KSAUDIO_SPEAKER_GROUND_FRONT_LEFT SPEAKER_FRONT_LEFT -#define KSAUDIO_SPEAKER_GROUND_FRONT_CENTER SPEAKER_FRONT_CENTER -#define KSAUDIO_SPEAKER_GROUND_FRONT_RIGHT SPEAKER_FRONT_RIGHT -#define KSAUDIO_SPEAKER_GROUND_REAR_LEFT SPEAKER_BACK_LEFT -#define KSAUDIO_SPEAKER_GROUND_REAR_RIGHT SPEAKER_BACK_RIGHT -#define KSAUDIO_SPEAKER_TOP_MIDDLE SPEAKER_TOP_CENTER -#define KSAUDIO_SPEAKER_SUPER_WOOFER SPEAKER_LOW_FREQUENCY - -typedef struct { - ULONG QuietCompression; - ULONG LoudCompression; -} KSAUDIO_DYNAMIC_RANGE, *PKSAUDIO_DYNAMIC_RANGE; - -typedef struct { - BOOL Mute; - LONG Level; -} KSAUDIO_MIXLEVEL, *PKSAUDIO_MIXLEVEL; - -typedef struct { - BOOL Mute; - LONG Minimum; - LONG Maximum; - LONG Reset; -} KSAUDIO_MIX_CAPS, *PKSAUDIO_MIX_CAPS; - -typedef struct { - ULONG InputChannels; - ULONG OutputChannels; - KSAUDIO_MIX_CAPS Capabilities[1]; -} KSAUDIO_MIXCAP_TABLE, *PKSAUDIO_MIXCAP_TABLE; - -typedef enum { - SE_TECH_NONE, - SE_TECH_ANALOG_DEVICES_PHAT, - SE_TECH_CREATIVE, - SE_TECH_NATIONAL_SEMI, - SE_TECH_YAMAHA_YMERSION, - SE_TECH_BBE, - SE_TECH_CRYSTAL_SEMI, - SE_TECH_QSOUND_QXPANDER, - SE_TECH_SPATIALIZER, - SE_TECH_SRS, - SE_TECH_PLATFORM_TECH, - SE_TECH_AKM, - SE_TECH_AUREAL, - SE_TECH_AZTECH, - SE_TECH_BINAURA, - SE_TECH_ESS_TECH, - SE_TECH_HARMAN_VMAX, - SE_TECH_NVIDEA, - SE_TECH_PHILIPS_INCREDIBLE, - SE_TECH_TEXAS_INST, - SE_TECH_VLSI_TECH -} SE_TECHNIQUE; - -typedef struct { - SE_TECHNIQUE Technique; - ULONG Center; - ULONG Depth; - ULONG Reserved; -} KSAUDIO_STEREO_ENHANCE, *PKSAUDIO_STEREO_ENHANCE; - -typedef enum { // preferred device index - KSPROPERTY_SYSAUDIO_NORMAL_DEFAULT = 0, - KSPROPERTY_SYSAUDIO_PLAYBACK_DEFAULT, - KSPROPERTY_SYSAUDIO_RECORD_DEFAULT, - KSPROPERTY_SYSAUDIO_MIDI_DEFAULT, - KSPROPERTY_SYSAUDIO_MIXER_DEFAULT -} KSPROPERTY_SYSAUDIO_DEFAULT_TYPE; - -typedef struct { - BOOL Enable; - KSPROPERTY_SYSAUDIO_DEFAULT_TYPE DeviceType; - ULONG Flags; - ULONG Reserved; -} KSAUDIO_PREFERRED_STATUS, *PKSAUDIO_PREFERRED_STATUS; -//=========================================================================== -// Topology Node Type GUIDs - -#define STATIC_KSNODETYPE_DAC\ - 0x507AE360L, 0xC554, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("507AE360-C554-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DAC); -#define KSNODETYPE_DAC DEFINE_GUIDNAMED(KSNODETYPE_DAC) - -#define STATIC_KSNODETYPE_ADC\ - 0x4D837FE0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("4D837FE0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_ADC); -#define KSNODETYPE_ADC DEFINE_GUIDNAMED(KSNODETYPE_ADC) - -#define STATIC_KSNODETYPE_SRC\ - 0x9DB7B9E0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("9DB7B9E0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SRC); -#define KSNODETYPE_SRC DEFINE_GUIDNAMED(KSNODETYPE_SRC) - -#define STATIC_KSNODETYPE_SUPERMIX\ - 0xE573ADC0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("E573ADC0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUPERMIX); -#define KSNODETYPE_SUPERMIX DEFINE_GUIDNAMED(KSNODETYPE_SUPERMIX) - -#define STATIC_KSNODETYPE_MUX\ - 0x2CEAF780L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("2CEAF780-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUX); -#define KSNODETYPE_MUX DEFINE_GUIDNAMED(KSNODETYPE_MUX) - -#define STATIC_KSNODETYPE_DEMUX\ - 0xC0EB67D4L, 0xE807, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("C0EB67D4-E807-11D0-958A-00C04FB925D3", KSNODETYPE_DEMUX); -#define KSNODETYPE_DEMUX DEFINE_GUIDNAMED(KSNODETYPE_DEMUX) - -#define STATIC_KSNODETYPE_SUM\ - 0xDA441A60L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("DA441A60-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUM); -#define KSNODETYPE_SUM DEFINE_GUIDNAMED(KSNODETYPE_SUM) - -#define STATIC_KSNODETYPE_MUTE\ - 0x02B223C0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("02B223C0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUTE); -#define KSNODETYPE_MUTE DEFINE_GUIDNAMED(KSNODETYPE_MUTE) - -#define STATIC_KSNODETYPE_VOLUME\ - 0x3A5ACC00L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("3A5ACC00-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_VOLUME); -#define KSNODETYPE_VOLUME DEFINE_GUIDNAMED(KSNODETYPE_VOLUME) - -#define STATIC_KSNODETYPE_TONE\ - 0x7607E580L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("7607E580-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_TONE); -#define KSNODETYPE_TONE DEFINE_GUIDNAMED(KSNODETYPE_TONE) - -#define STATIC_KSNODETYPE_EQUALIZER\ - 0x9D41B4A0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("9D41B4A0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_EQUALIZER); -#define KSNODETYPE_EQUALIZER DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZER) - -#define STATIC_KSNODETYPE_AGC\ - 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("E88C9BA0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_AGC); -#define KSNODETYPE_AGC DEFINE_GUIDNAMED(KSNODETYPE_AGC) - -#define STATIC_KSNODETYPE_NOISE_SUPPRESS\ - 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5 -DEFINE_GUIDSTRUCT("E07F903F-62FD-4e60-8CDD-DEA7236665B5", KSNODETYPE_NOISE_SUPPRESS); -#define KSNODETYPE_NOISE_SUPPRESS DEFINE_GUIDNAMED(KSNODETYPE_NOISE_SUPPRESS) - -#define STATIC_KSNODETYPE_DELAY\ - 0x144981E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("144981E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DELAY); -#define KSNODETYPE_DELAY DEFINE_GUIDNAMED(KSNODETYPE_DELAY) - -#define STATIC_KSNODETYPE_LOUDNESS\ - 0x41887440L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("41887440-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_LOUDNESS); -#define KSNODETYPE_LOUDNESS DEFINE_GUIDNAMED(KSNODETYPE_LOUDNESS) - -#define STATIC_KSNODETYPE_PROLOGIC_DECODER\ - 0x831C2C80L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("831C2C80-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_PROLOGIC_DECODER); -#define KSNODETYPE_PROLOGIC_DECODER DEFINE_GUIDNAMED(KSNODETYPE_PROLOGIC_DECODER) - -#define STATIC_KSNODETYPE_STEREO_WIDE\ - 0xA9E69800L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("A9E69800-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_STEREO_WIDE); -#define KSNODETYPE_STEREO_WIDE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_WIDE) - -#define STATIC_KSNODETYPE_STEREO_ENHANCE\ - 0xAF6878ACL, 0xE83F, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("AF6878AC-E83F-11D0-958A-00C04FB925D3", KSNODETYPE_STEREO_ENHANCE); -#define KSNODETYPE_STEREO_ENHANCE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_ENHANCE) - -#define STATIC_KSNODETYPE_REVERB\ - 0xEF0328E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("EF0328E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_REVERB); -#define KSNODETYPE_REVERB DEFINE_GUIDNAMED(KSNODETYPE_REVERB) - -#define STATIC_KSNODETYPE_CHORUS\ - 0x20173F20L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("20173F20-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_CHORUS); -#define KSNODETYPE_CHORUS DEFINE_GUIDNAMED(KSNODETYPE_CHORUS) - -#define STATIC_KSNODETYPE_3D_EFFECTS\ - 0x55515860L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("55515860-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_3D_EFFECTS); -#define KSNODETYPE_3D_EFFECTS DEFINE_GUIDNAMED(KSNODETYPE_3D_EFFECTS) - -#define STATIC_KSNODETYPE_ACOUSTIC_ECHO_CANCEL STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL -#define KSNODETYPE_ACOUSTIC_ECHO_CANCEL KSCATEGORY_ACOUSTIC_ECHO_CANCEL - -#define STATIC_KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL\ - 0x1c22c56dL, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10 -DEFINE_GUIDSTRUCT("1C22C56D-9879-4f5b-A389-27996DDC2810", KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL); -#define KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL) - -#define STATIC_KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS\ - 0x5ab0882eL, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0 -DEFINE_GUIDSTRUCT("5AB0882E-7274-4516-877D-4EEE99BA4FD0", KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS); -#define KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS) - -#define STATIC_KSALGORITHMINSTANCE_SYSTEM_AGC\ - 0x950e55b9L, 0x877c, 0x4c67, 0xbe, 0x8, 0xe4, 0x7b, 0x56, 0x11, 0x13, 0xa -DEFINE_GUIDSTRUCT("950E55B9-877C-4c67-BE08-E47B5611130A", KSALGORITHMINSTANCE_SYSTEM_AGC); -#define KSALGORITHMINSTANCE_SYSTEM_AGC DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_AGC) - -#define STATIC_KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR\ - 0xB6F5A0A0L, 0x9E61, 0x4F8C, 0x91, 0xE3, 0x76, 0xCF, 0xF, 0x3C, 0x47, 0x1F -DEFINE_GUIDSTRUCT("B6F5A0A0-9E61-4f8c-91E3-76CF0F3C471F", KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR); -#define KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR) - - -#define STATIC_KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR -#define KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR - -#define STATIC_KSNODETYPE_DEV_SPECIFIC\ - 0x941C7AC0L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("941C7AC0-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DEV_SPECIFIC); -#define KSNODETYPE_DEV_SPECIFIC DEFINE_GUIDNAMED(KSNODETYPE_DEV_SPECIFIC) - -#define STATIC_KSNODETYPE_PROLOGIC_ENCODER\ - 0x8074C5B2L, 0x3C66, 0x11D2, 0xB4, 0x5A, 0x30, 0x78, 0x30, 0x2C, 0x20, 0x30 -DEFINE_GUIDSTRUCT("8074C5B2-3C66-11D2-B45A-3078302C2030", KSNODETYPE_PROLOGIC_ENCODER); -#define KSNODETYPE_PROLOGIC_ENCODER DEFINE_GUIDNAMED(KSNODETYPE_PROLOGIC_ENCODER) -#define KSNODETYPE_SURROUND_ENCODER KSNODETYPE_PROLOGIC_ENCODER - -#define STATIC_KSNODETYPE_PEAKMETER\ - 0xa085651eL, 0x5f0d, 0x4b36, 0xa8, 0x69, 0xd1, 0x95, 0xd6, 0xab, 0x4b, 0x9e -DEFINE_GUIDSTRUCT("A085651E-5F0D-4b36-A869-D195D6AB4B9E", KSNODETYPE_PEAKMETER); -#define KSNODETYPE_PEAKMETER DEFINE_GUIDNAMED(KSNODETYPE_PEAKMETER) - -//=========================================================================== -// Topology Node Name GUIDs for common audio nodes -#define STATIC_KSAUDFNAME_BASS\ - 0x185FEDE0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_BASS); -#define KSAUDFNAME_BASS DEFINE_GUIDNAMED(KSAUDFNAME_BASS) - -#define STATIC_KSAUDFNAME_TREBLE\ - 0x185FEDE1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_TREBLE); -#define KSAUDFNAME_TREBLE DEFINE_GUIDNAMED(KSAUDFNAME_TREBLE) - -#define STATIC_KSAUDFNAME_3D_STEREO\ - 0x185FEDE2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_3D_STEREO); -#define KSAUDFNAME_3D_STEREO DEFINE_GUIDNAMED(KSAUDFNAME_3D_STEREO) - -#define STATIC_KSAUDFNAME_MASTER_VOLUME\ - 0x185FEDE3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_VOLUME); -#define KSAUDFNAME_MASTER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_VOLUME) - -#define STATIC_KSAUDFNAME_MASTER_MUTE\ - 0x185FEDE4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_MUTE); -#define KSAUDFNAME_MASTER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_MUTE) - -#define STATIC_KSAUDFNAME_WAVE_VOLUME\ - 0x185FEDE5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_VOLUME); -#define KSAUDFNAME_WAVE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_VOLUME) - -#define STATIC_KSAUDFNAME_WAVE_MUTE\ - 0x185FEDE6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_MUTE); -#define KSAUDFNAME_WAVE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_MUTE) - -#define STATIC_KSAUDFNAME_MIDI_VOLUME\ - 0x185FEDE7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_VOLUME); -#define KSAUDFNAME_MIDI_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_VOLUME) - -#define STATIC_KSAUDFNAME_MIDI_MUTE\ - 0x185FEDE8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_MUTE); -#define KSAUDFNAME_MIDI_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_MUTE) - -#define STATIC_KSAUDFNAME_CD_VOLUME\ - 0x185FEDE9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_VOLUME); -#define KSAUDFNAME_CD_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_VOLUME) - -#define STATIC_KSAUDFNAME_CD_MUTE\ - 0x185FEDEAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_MUTE); -#define KSAUDFNAME_CD_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_CD_MUTE) - -#define STATIC_KSAUDFNAME_LINE_VOLUME\ - 0x185FEDEBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_VOLUME); -#define KSAUDFNAME_LINE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_VOLUME) - -#define STATIC_KSAUDFNAME_LINE_MUTE\ - 0x185FEDECL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_MUTE); -#define KSAUDFNAME_LINE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_LINE_MUTE) - -#define STATIC_KSAUDFNAME_MIC_VOLUME\ - 0x185FEDEDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDED-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_VOLUME); -#define KSAUDFNAME_MIC_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_VOLUME) - -#define STATIC_KSAUDFNAME_MIC_MUTE\ - 0x185FEDEEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_MUTE); -#define KSAUDFNAME_MIC_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIC_MUTE) - -#define STATIC_KSAUDFNAME_RECORDING_SOURCE\ - 0x185FEDEFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_SOURCE); -#define KSAUDFNAME_RECORDING_SOURCE DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_SOURCE) - -#define STATIC_KSAUDFNAME_PC_SPEAKER_VOLUME\ - 0x185FEDF0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_VOLUME); -#define KSAUDFNAME_PC_SPEAKER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_VOLUME) - -#define STATIC_KSAUDFNAME_PC_SPEAKER_MUTE\ - 0x185FEDF1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_MUTE); -#define KSAUDFNAME_PC_SPEAKER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_MUTE) - -#define STATIC_KSAUDFNAME_MIDI_IN_VOLUME\ - 0x185FEDF2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_IN_VOLUME); -#define KSAUDFNAME_MIDI_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_IN_VOLUME) - -#define STATIC_KSAUDFNAME_CD_IN_VOLUME\ - 0x185FEDF3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_IN_VOLUME); -#define KSAUDFNAME_CD_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_IN_VOLUME) - -#define STATIC_KSAUDFNAME_LINE_IN_VOLUME\ - 0x185FEDF4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN_VOLUME); -#define KSAUDFNAME_LINE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN_VOLUME) - -#define STATIC_KSAUDFNAME_MIC_IN_VOLUME\ - 0x185FEDF5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_IN_VOLUME); -#define KSAUDFNAME_MIC_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_IN_VOLUME) - -#define STATIC_KSAUDFNAME_WAVE_IN_VOLUME\ - 0x185FEDF6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_IN_VOLUME); -#define KSAUDFNAME_WAVE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_IN_VOLUME) - -#define STATIC_KSAUDFNAME_VOLUME_CONTROL\ - 0x185FEDF7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_VOLUME_CONTROL); -#define KSAUDFNAME_VOLUME_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_VOLUME_CONTROL) - -#define STATIC_KSAUDFNAME_MIDI\ - 0x185FEDF8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI); -#define KSAUDFNAME_MIDI DEFINE_GUIDNAMED(KSAUDFNAME_MIDI) - -#define STATIC_KSAUDFNAME_LINE_IN\ - 0x185FEDF9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN); -#define KSAUDFNAME_LINE_IN DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN) - -#define STATIC_KSAUDFNAME_RECORDING_CONTROL\ - 0x185FEDFAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_CONTROL); -#define KSAUDFNAME_RECORDING_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_CONTROL) - -#define STATIC_KSAUDFNAME_CD_AUDIO\ - 0x185FEDFBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_AUDIO); -#define KSAUDFNAME_CD_AUDIO DEFINE_GUIDNAMED(KSAUDFNAME_CD_AUDIO) - -#define STATIC_KSAUDFNAME_AUX_VOLUME\ - 0x185FEDFCL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_VOLUME); -#define KSAUDFNAME_AUX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_AUX_VOLUME) - -#define STATIC_KSAUDFNAME_AUX_MUTE\ - 0x185FEDFDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFD-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_MUTE); -#define KSAUDFNAME_AUX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_AUX_MUTE) - -#define STATIC_KSAUDFNAME_AUX\ - 0x185FEDFEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX); -#define KSAUDFNAME_AUX DEFINE_GUIDNAMED(KSAUDFNAME_AUX) - -#define STATIC_KSAUDFNAME_PC_SPEAKER\ - 0x185FEDFFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER); -#define KSAUDFNAME_PC_SPEAKER DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER) - -#define STATIC_KSAUDFNAME_WAVE_OUT_MIX\ - 0x185FEE00L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEE00-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_OUT_MIX); -#define KSAUDFNAME_WAVE_OUT_MIX DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_OUT_MIX) - -#define STATIC_KSAUDFNAME_MONO_OUT\ - 0xf9b41dc3L, 0x96e2, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("F9B41DC3-96E2-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT); -#define KSAUDFNAME_MONO_OUT DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT) - -#define STATIC_KSAUDFNAME_STEREO_MIX\ - 0xdff077L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("00DFF077-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX); -#define KSAUDFNAME_STEREO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX) - -#define STATIC_KSAUDFNAME_MONO_MIX\ - 0xdff078L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("00DFF078-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX); -#define KSAUDFNAME_MONO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX) - -#define STATIC_KSAUDFNAME_MONO_OUT_VOLUME\ - 0x1ad247ebL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247EB-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_VOLUME); -#define KSAUDFNAME_MONO_OUT_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_VOLUME) - -#define STATIC_KSAUDFNAME_MONO_OUT_MUTE\ - 0x1ad247ecL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247EC-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_MUTE); -#define KSAUDFNAME_MONO_OUT_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_MUTE) - -#define STATIC_KSAUDFNAME_STEREO_MIX_VOLUME\ - 0x1ad247edL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247ED-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_VOLUME); -#define KSAUDFNAME_STEREO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_VOLUME) - -#define STATIC_KSAUDFNAME_STEREO_MIX_MUTE\ - 0x22b0eafdL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("22B0EAFD-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_MUTE); -#define KSAUDFNAME_STEREO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_MUTE) - -#define STATIC_KSAUDFNAME_MONO_MIX_VOLUME\ - 0x22b0eafeL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("22B0EAFE-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_VOLUME); -#define KSAUDFNAME_MONO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_VOLUME) - -#define STATIC_KSAUDFNAME_MONO_MIX_MUTE\ - 0x2bc31d69L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D69-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_MUTE); -#define KSAUDFNAME_MONO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_MUTE) - -#define STATIC_KSAUDFNAME_MICROPHONE_BOOST\ - 0x2bc31d6aL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D6A-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MICROPHONE_BOOST); -#define KSAUDFNAME_MICROPHONE_BOOST DEFINE_GUIDNAMED(KSAUDFNAME_MICROPHONE_BOOST) - -#define STATIC_KSAUDFNAME_ALTERNATE_MICROPHONE\ - 0x2bc31d6bL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D6B-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_ALTERNATE_MICROPHONE); -#define KSAUDFNAME_ALTERNATE_MICROPHONE DEFINE_GUIDNAMED(KSAUDFNAME_ALTERNATE_MICROPHONE) - -#define STATIC_KSAUDFNAME_3D_DEPTH\ - 0x63ff5747L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("63FF5747-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_DEPTH); -#define KSAUDFNAME_3D_DEPTH DEFINE_GUIDNAMED(KSAUDFNAME_3D_DEPTH) - -#define STATIC_KSAUDFNAME_3D_CENTER\ - 0x9f0670b4L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9F0670B4-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_CENTER); -#define KSAUDFNAME_3D_CENTER DEFINE_GUIDNAMED(KSAUDFNAME_3D_CENTER) - -#define STATIC_KSAUDFNAME_VIDEO_VOLUME\ - 0x9b46e708L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9B46E708-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_VOLUME); -#define KSAUDFNAME_VIDEO_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_VOLUME) - -#define STATIC_KSAUDFNAME_VIDEO_MUTE\ - 0x9b46e709L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9B46E709-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_MUTE); -#define KSAUDFNAME_VIDEO_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_MUTE) - -#define STATIC_KSAUDFNAME_VIDEO\ - 0x915daec4L, 0xa434, 0x11d2, 0xac, 0x52, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("915DAEC4-A434-11d2-AC52-00C04F8EFB68", KSAUDFNAME_VIDEO); -#define KSAUDFNAME_VIDEO DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO) - -#define STATIC_KSAUDFNAME_PEAKMETER\ - 0x57e24340L, 0xfc5b, 0x4612, 0xa5, 0x62, 0x72, 0xb1, 0x1a, 0x29, 0xdf, 0xae -DEFINE_GUIDSTRUCT("57E24340-FC5B-4612-A562-72B11A29DFAE", KSAUDFNAME_PEAKMETER); -#define KSAUDFNAME_PEAKMETER DEFINE_GUIDNAMED(KSAUDFNAME_PEAKMETER) - -// Internal topology node pin definitions - -#define KSNODEPIN_STANDARD_IN 1 -#define KSNODEPIN_STANDARD_OUT 0 - -#define KSNODEPIN_SUM_MUX_IN 1 // can be >= 1 -#define KSNODEPIN_SUM_MUX_OUT 0 - -#define KSNODEPIN_DEMUX_IN 0 -#define KSNODEPIN_DEMUX_OUT 1 // can be >= 1 - -#define KSNODEPIN_AEC_RENDER_IN 1 -#define KSNODEPIN_AEC_RENDER_OUT 0 -#define KSNODEPIN_AEC_CAPTURE_IN 2 -#define KSNODEPIN_AEC_CAPTURE_OUT 3 - -//=========================================================================== -//=========================================================================== - -#define STATIC_KSMETHODSETID_Wavetable\ - 0xDCEF31EBL, 0xD907, 0x11D0, 0x95, 0x83, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("DCEF31EB-D907-11D0-9583-00C04FB925D3", KSMETHODSETID_Wavetable); -#define KSMETHODSETID_Wavetable DEFINE_GUIDNAMED(KSMETHODSETID_Wavetable) - -typedef enum { - KSMETHOD_WAVETABLE_WAVE_ALLOC, - KSMETHOD_WAVETABLE_WAVE_FREE, - KSMETHOD_WAVETABLE_WAVE_FIND, - KSMETHOD_WAVETABLE_WAVE_WRITE -} KSMETHOD_WAVETABLE; - -typedef struct { - KSIDENTIFIER Identifier; // wave identifier - ULONG Size; // wave size - BOOL Looped; // wave looped flag - ULONG LoopPoint; // wave loop point - BOOL InROM; // wave InROM flag - KSDATAFORMAT Format; // wave format -} KSWAVETABLE_WAVE_DESC, *PKSWAVETABLE_WAVE_DESC; - - -//=========================================================================== -//=========================================================================== - -/* - Property sets and items -*/ - -//=========================================================================== -//=========================================================================== - -#define STATIC_KSPROPSETID_Acoustic_Echo_Cancel\ - 0xd7a4af8bL, 0x3dc1, 0x4902, 0x91, 0xea, 0x8a, 0x15, 0xc9, 0x0e, 0x05, 0xb2 -DEFINE_GUIDSTRUCT("D7A4AF8B-3DC1-4902-91EA-8A15C90E05B2", KSPROPSETID_Acoustic_Echo_Cancel); -#define KSPROPSETID_Acoustic_Echo_Cancel DEFINE_GUIDNAMED(KSPROPSETID_Acoustic_Echo_Cancel) - -typedef enum { - KSPROPERTY_AEC_NOISE_FILL_ENABLE = 0, - KSPROPERTY_AEC_STATUS, - KSPROPERTY_AEC_MODE -} KSPROPERTY_AEC; - -#define AEC_STATUS_FD_HISTORY_UNINITIALIZED 0x0 -#define AEC_STATUS_FD_HISTORY_CONTINUOUSLY_CONVERGED 0x1 -#define AEC_STATUS_FD_HISTORY_PREVIOUSLY_DIVERGED 0x2 -#define AEC_STATUS_FD_CURRENTLY_CONVERGED 0x8 - -#define AEC_MODE_PASS_THROUGH 0x0 -#define AEC_MODE_HALF_DUPLEX 0x1 -#define AEC_MODE_FULL_DUPLEX 0x2 - -//=========================================================================== -//=========================================================================== - -#define STATIC_KSPROPSETID_Wave_Queued\ - 0x16a15b10L, 0x16f0, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("16a15b10-16f0-11d0-a195-0020afd156e4", KSPROPSETID_Wave_Queued); -#define KSPROPSETID_Wave_Queued DEFINE_GUIDNAMED(KSPROPSETID_Wave_Queued) - -#define KSPROPERTY_WAVE_QUEUED_POSITION 0x00000001 - -#define STATIC_KSMETHODSETID_Wave_Queued\ - 0x7432c160L, 0x8827, 0x11cf, 0xa1, 0x02, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("7432c160-8827-11cf-a102-0020afd156e4", KSMETHODSETID_Wave_Queued); -#define KSMETHODSETID_Wave_Queued DEFINE_GUIDNAMED(KSMETHODSETID_Wave_Queued) - -#define KSMETHOD_WAVE_QUEUED_BREAKLOOP 0x00000001 - -#define STATIC_KSPROPSETID_Wave\ - 0x924e54b0L, 0x630f, 0x11cf, 0xad, 0xa7, 0x08, 0x00, 0x3e, 0x30, 0x49, 0x4a -DEFINE_GUIDSTRUCT("924e54b0-630f-11cf-ada7-08003e30494a", KSPROPSETID_Wave); -#define KSPROPSETID_Wave DEFINE_GUIDNAMED(KSPROPSETID_Wave) - -typedef enum { - KSPROPERTY_WAVE_COMPATIBLE_CAPABILITIES, - KSPROPERTY_WAVE_INPUT_CAPABILITIES, - KSPROPERTY_WAVE_OUTPUT_CAPABILITIES, - KSPROPERTY_WAVE_BUFFER, - KSPROPERTY_WAVE_FREQUENCY, - KSPROPERTY_WAVE_VOLUME, - KSPROPERTY_WAVE_PAN -} KSPROPERTY_WAVE; - -typedef struct { - ULONG ulDeviceType; -} KSWAVE_COMPATCAPS, *PKSWAVE_COMPATCAPS; - -#define KSWAVE_COMPATCAPS_INPUT 0x00000000 -#define KSWAVE_COMPATCAPS_OUTPUT 0x00000001 - -typedef struct { - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG ActiveConnections; -} KSWAVE_INPUT_CAPABILITIES, *PKSWAVE_INPUT_CAPABILITIES; - -typedef struct { - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG StaticConnections; - ULONG StreamingConnections; - ULONG ActiveConnections; - ULONG ActiveStaticConnections; - ULONG ActiveStreamingConnections; - ULONG Total3DConnections; - ULONG Static3DConnections; - ULONG Streaming3DConnections; - ULONG Active3DConnections; - ULONG ActiveStatic3DConnections; - ULONG ActiveStreaming3DConnections; - ULONG TotalSampleMemory; - ULONG FreeSampleMemory; - ULONG LargestFreeContiguousSampleMemory; -} KSWAVE_OUTPUT_CAPABILITIES, *PKSWAVE_OUTPUT_CAPABILITIES; - -typedef struct { - LONG LeftAttenuation; - LONG RightAttenuation; -} KSWAVE_VOLUME, *PKSWAVE_VOLUME; - -#define KSWAVE_BUFFER_ATTRIBUTEF_LOOPING 0x00000001 -#define KSWAVE_BUFFER_ATTRIBUTEF_STATIC 0x00000002 - -typedef struct { - ULONG Attributes; - ULONG BufferSize; - PVOID BufferAddress; -} KSWAVE_BUFFER, *PKSWAVE_BUFFER; - -//=========================================================================== -//=========================================================================== - -#define STATIC_KSMUSIC_TECHNOLOGY_PORT\ - 0x86C92E60L, 0x62E8, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("86C92E60-62E8-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_PORT); -#define KSMUSIC_TECHNOLOGY_PORT DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_PORT) - -#define STATIC_KSMUSIC_TECHNOLOGY_SQSYNTH\ - 0x0ECF4380L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("0ECF4380-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_SQSYNTH); -#define KSMUSIC_TECHNOLOGY_SQSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SQSYNTH) - -#define STATIC_KSMUSIC_TECHNOLOGY_FMSYNTH\ - 0x252C5C80L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("252C5C80-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_FMSYNTH); -#define KSMUSIC_TECHNOLOGY_FMSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_FMSYNTH) - -#define STATIC_KSMUSIC_TECHNOLOGY_WAVETABLE\ - 0x394EC7C0L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("394EC7C0-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_WAVETABLE); -#define KSMUSIC_TECHNOLOGY_WAVETABLE DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_WAVETABLE) - -#define STATIC_KSMUSIC_TECHNOLOGY_SWSYNTH\ - 0x37407736L, 0x3620, 0x11D1, 0x85, 0xD3, 0x00, 0x00, 0xF8, 0x75, 0x43, 0x80 -DEFINE_GUIDSTRUCT("37407736-3620-11D1-85D3-0000F8754380", KSMUSIC_TECHNOLOGY_SWSYNTH); -#define KSMUSIC_TECHNOLOGY_SWSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SWSYNTH) - -#define STATIC_KSPROPSETID_WaveTable\ - 0x8539E660L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("8539E660-62E9-11CF-A5D6-28DB04C10000", KSPROPSETID_WaveTable); -#define KSPROPSETID_WaveTable DEFINE_GUIDNAMED(KSPROPSETID_WaveTable) - -typedef enum { - KSPROPERTY_WAVETABLE_LOAD_SAMPLE, - KSPROPERTY_WAVETABLE_UNLOAD_SAMPLE, - KSPROPERTY_WAVETABLE_MEMORY, - KSPROPERTY_WAVETABLE_VERSION -} KSPROPERTY_WAVETABLE; - -typedef struct { - KSDATARANGE DataRange; - GUID Technology; - ULONG Channels; - ULONG Notes; - ULONG ChannelMask; -} KSDATARANGE_MUSIC, *PKSDATARANGE_MUSIC; - -//=========================================================================== - -#define STATIC_KSEVENTSETID_Cyclic\ - 0x142C1AC0L, 0x072A, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("142C1AC0-072A-11D0-A5D6-28DB04C10000", KSEVENTSETID_Cyclic); -#define KSEVENTSETID_Cyclic DEFINE_GUIDNAMED(KSEVENTSETID_Cyclic) - -typedef enum { - KSEVENT_CYCLIC_TIME_INTERVAL, -} KSEVENT_CYCLIC_TIME; - -#define STATIC_KSPROPSETID_Cyclic\ - 0x3FFEAEA0L, 0x2BEE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("3FFEAEA0-2BEE-11CF-A5D6-28DB04C10000", KSPROPSETID_Cyclic); -#define KSPROPSETID_Cyclic DEFINE_GUIDNAMED(KSPROPSETID_Cyclic) - -typedef enum { - KSPROPERTY_CYCLIC_POSITION, -} KSPROPERTY_CYCLIC; - -//=========================================================================== -#define STATIC_KSEVENTSETID_AudioControlChange\ - 0xE85E9698L, 0xFA2F, 0x11D1, 0x95, 0xBD, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("E85E9698-FA2F-11D1-95BD-00C04FB925D3", KSEVENTSETID_AudioControlChange); -#define KSEVENTSETID_AudioControlChange DEFINE_GUIDNAMED(KSEVENTSETID_AudioControlChange) - -typedef enum { - KSEVENT_CONTROL_CHANGE, -} KSEVENT_AUDIO_CONTROL_CHANGE; - -//=========================================================================== - -#define STATIC_KSEVENTSETID_LoopedStreaming\ - 0x4682B940L, 0xC6EF, 0x11D0, 0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D -DEFINE_GUIDSTRUCT("4682B940-C6EF-11D0-96D8-00AA0051E51D", KSEVENTSETID_LoopedStreaming); -#define KSEVENTSETID_LoopedStreaming DEFINE_GUIDNAMED(KSEVENTSETID_LoopedStreaming) - -typedef enum { - KSEVENT_LOOPEDSTREAMING_POSITION, -} KSEVENT_LOOPEDSTREAMING; - -typedef struct { - KSEVENTDATA KsEventData; -#if defined(_NTDDK_) - ULONGLONG Position; -#else // !_NTDDK_ - DWORDLONG Position; -#endif // !_NTDDK_ -} LOOPEDSTREAMING_POSITION_EVENT_DATA, *PLOOPEDSTREAMING_POSITION_EVENT_DATA ; - -//=========================================================================== -#define STATIC_KSEVENTSETID_Sysaudio \ - 0x04800320L, 0x4491, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("04800320-4491-11D1-A050-405705C10000", KSEVENTSETID_Sysaudio); -#define KSEVENTSETID_Sysaudio DEFINE_GUIDNAMED(KSEVENTSETID_Sysaudio) - -typedef enum { - KSEVENT_SYSAUDIO_ADDREMOVE_DEVICE, - KSEVENT_SYSAUDIO_CHANGE_DEVICE -} KSEVENT_SYSAUDIO; - -//=========================================================================== -// @@BEGIN_DDKSPLIT -#define STATIC_KSPROPSETID_Sysaudio\ - 0xCBE3FAA0L, 0xCC75, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 -DEFINE_GUIDSTRUCT("CBE3FAA0-CC75-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio); -#define KSPROPSETID_Sysaudio DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio) - -typedef enum { - KSPROPERTY_SYSAUDIO_DEVICE_COUNT = 1, - KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME, - KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE, - KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME, - KSPROPERTY_SYSAUDIO_SELECT_GRAPH, - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_DEVICE_DEFAULT, - KSPROPERTY_SYSAUDIO_ALWAYS_CREATE_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_ADDREMOVE_LOCK, - KSPROPERTY_SYSAUDIO_ADDREMOVE_UNLOCK, - KSPROPERTY_SYSAUDIO_RENDER_PIN_INSTANCES, - KSPROPERTY_SYSAUDIO_RENDER_CONNECTION_INDEX, - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE_ONLY, - KSPROPERTY_SYSAUDIO_INSTANCE_INFO, - KSPROPERTY_SYSAUDIO_PREFERRED_DEVICE, - KSPROPERTY_SYSAUDIO_COMPONENT_ID, - KSPROPERTY_SYSAUDIO_ADDREMOVE_GFX -} KSPROPERTY_SYSAUDIO; - -typedef struct { - KSPROPERTY Property; - GUID PinCategory; - GUID PinName; -} SYSAUDIO_CREATE_VIRTUAL_SOURCE, *PSYSAUDIO_CREATE_VIRTUAL_SOURCE; - -typedef struct { - BOOL Enable; - HANDLE hGfx; - ULONG ulOrder; // Order of the GFX - ULONG ulType; // Type of the GFX - ULONG ulFlags; - ULONG ulDeviceNameOffset; // DeviceInterface on which this GFX needs to be attached - ULONG ulFriendlyNameOffset; // Friendly name of the GFX -} SYSAUDIO_GFX, *PSYSAUDIO_GFX; - -#define GFX_DEVICETYPE_RENDER 1 -#define GFX_DEVICETYPE_CAPTURE 2 - -typedef struct { - KSPROPERTY Property; - ULONG PinId; - ULONG NodeId; - ULONG Flags; - ULONG Reserved; -} SYSAUDIO_SELECT_GRAPH, *PSYSAUDIO_SELECT_GRAPH; - -typedef struct { - KSPROPERTY Property; - ULONG Flags; - ULONG DeviceNumber; -} SYSAUDIO_INSTANCE_INFO, *PSYSAUDIO_INSTANCE_INFO; - -#define SYSAUDIO_FLAGS_DONT_COMBINE_PINS 0x00000001 - - -typedef struct { - KSPROPERTY Property; - ULONG Flags; - ULONG Index; // KSPROPERTY_SYSAUDIO_DEFAULT_TYPE -} SYSAUDIO_PREFERRED_DEVICE, *PSYSAUDIO_PREFERRED_DEVICE; - -#define SYSAUDIO_FLAGS_CLEAR_PREFERRED 0x00000002 - -#define STATIC_KSPROPSETID_Sysaudio_Pin \ - 0xA3A53220L, 0xC6E4, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 -DEFINE_GUIDSTRUCT("A3A53220-C6E4-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio_Pin); -#define KSPROPSETID_Sysaudio_Pin DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio_Pin) - -typedef enum { - KSPROPERTY_SYSAUDIO_TOPOLOGY_CONNECTION_INDEX, - KSPROPERTY_SYSAUDIO_ATTACH_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_PIN_VOLUME_NODE -} KSPROPERTY_SYSAUDIO_PIN; - -typedef struct { - KSPROPERTY Property; - ULONG MixerPinId; - ULONG Reserved; -} SYSAUDIO_ATTACH_VIRTUAL_SOURCE, *PSYSAUDIO_ATTACH_VIRTUAL_SOURCE; -// @@END_DDKSPLIT - -//=========================================================================== -typedef struct { - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; -} KSNODEPROPERTY, *PKSNODEPROPERTY; - -typedef struct { - KSNODEPROPERTY NodeProperty; - LONG Channel; // value to get or set - ULONG Reserved; -} KSNODEPROPERTY_AUDIO_CHANNEL, *PKSNODEPROPERTY_AUDIO_CHANNEL; - -typedef struct { - KSNODEPROPERTY NodeProperty; - ULONG DevSpecificId; - ULONG DeviceInfo; - ULONG Length; -} KSNODEPROPERTY_AUDIO_DEV_SPECIFIC, *PKSNODEPROPERTY_AUDIO_DEV_SPECIFIC; - -typedef struct { - KSNODEPROPERTY NodeProperty; - PVOID ListenerId; -#ifndef _WIN64 - ULONG Reserved; -#endif // _WIN64 -} KSNODEPROPERTY_AUDIO_3D_LISTENER, *PKSNODEPROPERTY_AUDIO_3D_LISTENER; - -typedef struct { - KSNODEPROPERTY NodeProperty; - PVOID AppContext; - ULONG Length; -#ifndef _WIN64 - ULONG Reserved; -#endif // _WIN64 -} KSNODEPROPERTY_AUDIO_PROPERTY, *PKSNODEPROPERTY_AUDIO_PROPERTY; - -//=========================================================================== -// {79A9312E-59AE-43b0-A350-8B05284CAB24} -#define STATIC_KSPROPSETID_AudioGfx\ - 0x79a9312eL, 0x59ae, 0x43b0, 0xa3, 0x50, 0x8b, 0x5, 0x28, 0x4c, 0xab, 0x24 -DEFINE_GUIDSTRUCT("79A9312E-59AE-43b0-A350-8B05284CAB24", KSPROPSETID_AudioGfx); -#define KSPROPSETID_AudioGfx DEFINE_GUIDNAMED(KSPROPSETID_AudioGfx) - -typedef enum { - KSPROPERTY_AUDIOGFX_RENDERTARGETDEVICEID, - KSPROPERTY_AUDIOGFX_CAPTURETARGETDEVICEID -} KSPROPERTY_AUDIOGFX; - -//=========================================================================== - -#define STATIC_KSPROPSETID_Linear\ - 0x5A2FFE80L, 0x16B9, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("5A2FFE80-16B9-11D0-A5D6-28DB04C10000", KSPROPSETID_Linear); -#define KSPROPSETID_Linear DEFINE_GUIDNAMED(KSPROPSETID_Linear) - -typedef enum { - KSPROPERTY_LINEAR_POSITION, -} KSPROPERTY_LINEAR; - -//=========================================================================== - -// -// Midi definitions -// - -/* - Formats -*/ - -#define STATIC_KSDATAFORMAT_TYPE_MUSIC\ - 0xE725D360L, 0x62CC, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("E725D360-62CC-11CF-A5D6-28DB04C10000", KSDATAFORMAT_TYPE_MUSIC); -#define KSDATAFORMAT_TYPE_MUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MUSIC) - -// 'mids' == MEDIATYPE_Midi -#define STATIC_KSDATAFORMAT_TYPE_MIDI\ - 0x7364696DL, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("7364696D-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_MIDI); -#define KSDATAFORMAT_TYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MIDI) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MIDI\ - 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("1D262760-E957-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI); -#define KSDATAFORMAT_SUBTYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MIDI_BUS\ - 0x2CA15FA0L, 0x6CFE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2CA15FA0-6CFE-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI_BUS); -#define KSDATAFORMAT_SUBTYPE_MIDI_BUS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI_BUS) - -#define STATIC_KSDATAFORMAT_SUBTYPE_RIFFMIDI\ - 0x4995DAF0L, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("4995DAF0-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFFMIDI); -#define KSDATAFORMAT_SUBTYPE_RIFFMIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFMIDI) - -/* - KSDATAFORMAT_SUBTYPE_DIRECTMUSIC - see DMusicKS.h -*/ - -// WARNING! This structure MUST be dword aligned -// regardless of the number of data bytes. - -typedef struct { - ULONG TimeDeltaMs; // Delta Milliseconds from the previous midiformat - // in the packet. The first midiformat in the packet - // is a delta from the PTS in the KSSTREAM_HEADER. - ULONG ByteCount; // Number of bytes of data that follow this struct. -} KSMUSICFORMAT, *PKSMUSICFORMAT; - -// -// This entire set of MPEG Standard/Dialect Guids are obsolete. Do not use them. -// -//==================================================================================================== -//==================================================================================================== -// The following official MPEG Formats, Subtypes and Specifiers are listed as required or optional -// These official MPEG GUIDs are the preferred method of supporting MPEG/AC-3 media types in new code. -// Older MPEG GUIDs should also be supported for compatibilty, but these new modes are still required. -//==================================================================================================== -//==================================================================================================== - -/* -This is a summary of what media types/specifiers will be required for all DVD+DSS+DVB+DTV MPEG decoders. -These media types are what the decoder driver must accept, hardware support for all of these media types -may or may not actually be provided by the decoder natively. These media types are intended to define -the "officially" supported MPEG/AC-3 media types that all WHQL certified decoders must implement. This -specifically includes driver and/or hardware support for all the required standards and dialects. - -All MPEG video decoders must support all of the MPEG video modes shown as [required] below. -All MPEG audio decoders must support all of the MPEG audio modes shown as [required] below. -All AC-3 audio decoders must support all of the AC-3 audio modes shown as [required] below. -The line items shown as [optional] need not be implemented, but are possible formats that might be implemented. - -Note that the input/output pin formats are defined by 2 or 3 GUIDs: TYPE, SUBTYPE, and maybe SPECIFIER. -The specifiers are included if the data format is a "dialect" that needs to be differentiated during decoding. -The decoder MUST be prepared to deal with ALL requests for _required_ "Standard" formats OR _required_ "Dialects". - -STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] -STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] -STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] - -Note that the SPECIFIER GUIDs normally identify particular versions of MPEG such as DSS and DVD. -This approach was taken to minimize the number of DSS/DVB/DVD/DTV etc. media SUBTYPES. -These specifiers are currently required to disambiguate MPEG syntax _parsing_ by the decoder -using alternate parsing routines or downloadable firmware or hardware decode settings. - -In the future these specifiers will be extended to cover new KS MPEG flavors such as DVB and DTV. -Thus, the optional specifiers will be subject to clarification and/or definition as they are needed. - -Important note: Per the ITU MPEG specs, MPEG 2 media may contain pure MPEG 1 syntax and -any "MPEG 2" PES packets may actually contain MPEG 1 payloads and MPEG 1 syntax. Some MPEG -broadcasts can revert from MPEG2 to MPEG1 format data at their discretion, without warning. - -CAUTION: Decoders MUST attempt to process MPEG data AS SOON AS POSSIBLE after reception. -In particular, elementary MPEG or MPEG PES packet streams should not be aggregated into DVD -"pack headers" internally before submission to the codec hardware if AT ALL POSSIBLE. The -reason is that mpeg data may need to be processed immediately but there may be no additional -MPEG data forthcoming to fill up the PES packet OR DVD "pack" in a timely fashion. This is -particularly true of MPEG dialects that utilize "repeat field signally" to reuse the last -decoded MPEG video field. - -*/ - -///////////////////////////////////////////////////////////////////////// -// The major data type GUIDs that define the data packet encapsulation // -///////////////////////////////////////////////////////////////////////// - -// STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM -#define STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM \ - 0x36523b11L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B11-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM ); -#define KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM) - -// STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET -#define STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET \ - 0x36523b12L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B12-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PES_PACKET ); -#define KSDATAFORMAT_TYPE_STANDARD_PES_PACKET DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PES_PACKET) - -// STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER -#define STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER \ - 0x36523b13L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B13-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER ); -#define KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER) - -/////////////////////////////////////////////////////////////////////////////// -// The minor data subtype GUIDs that define the exact class of the data type.// -/////////////////////////////////////////////////////////////////////////////// - -// STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO -#define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO \ - 0x36523b21L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B21-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO ); -#define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO) - -// STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO -#define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO \ - 0x36523b22L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B22-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO ); -#define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO) - -// STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO -#define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO \ - 0x36523b23L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B23-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO ); -#define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO) - -// STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO -#define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO \ - 0x36523b24L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B24-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO ); -#define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO) - -// STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO -#define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO \ - 0x36523b25L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B25-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO ); -#define KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO) - -/////////////////////////////////////////////////////////////////////////////// -// The low-level specifier GUIDs that define the flavor of the data subtype. // -// Some SUBTYPES, notably MPEG2_VIDEO, MPEG2_AUDIO have different dialects. // -// These specifiers are intended to be accompanied by a specifier structure. // -/////////////////////////////////////////////////////////////////////////////// - -// STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO -#define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO \ - 0x36523b31L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B31-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO ); -#define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO) - -// STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO -#define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO \ - 0x36523b32L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B32-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO ); -#define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO) - -// STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO Associated with KS_MPEGVIDEOINFO2 defined later -#define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO \ - 0x36523b33L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B33-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO ); -#define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO) - -// STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO Associated with KS_MPEGAUDIOINFO defined later -#define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO \ - 0x36523b34L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B34-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO ); -#define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO) - -// STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO -#define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO \ - 0x36523b35L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B35-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO ); -#define KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO) - -//==================================================================================================== -//==================================================================================================== -// *** COMPATIBILITY WARNING *** -// The *following* older DSS, MPEG, DVD & AC-3 GUID definitions are retained for backward compability. -// These MPEG GUIDs should also be supported for compatibilty, but the above newer modes are still required. -//==================================================================================================== -//==================================================================================================== - -// -// DSS definitions -// - -#define STATIC_KSDATAFORMAT_SUBTYPE_DSS_VIDEO\ - 0xa0af4f81L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("a0af4f81-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_VIDEO); -#define KSDATAFORMAT_SUBTYPE_DSS_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_VIDEO) - -#define STATIC_KSDATAFORMAT_SUBTYPE_DSS_AUDIO\ - 0xa0af4f82L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("a0af4f82-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_AUDIO); -#define KSDATAFORMAT_SUBTYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_AUDIO) - -// -// End of obsolete MPEG definitions. -// - -// -// mpeg 1 definitions -// -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Packet\ - 0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb80-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Packet); -#define KSDATAFORMAT_SUBTYPE_MPEG1Packet DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Packet) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Payload\ - 0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb81-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Payload); -#define KSDATAFORMAT_SUBTYPE_MPEG1Payload DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Payload) - -// MEDIASUBTYPE_MPEG1Video -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Video\ - 0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb86-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Video); -#define KSDATAFORMAT_SUBTYPE_MPEG1Video DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Video) - -//FORMAT_MPEGVideo -#define STATIC_KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO\ - 0x05589f82L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f82-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO); -#define KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO) - -// -// mpeg 2 definitions -// -#define STATIC_KSDATAFORMAT_TYPE_MPEG2_PES\ - 0xe06d8020L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8020-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PES); -#define KSDATAFORMAT_TYPE_MPEG2_PES DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PES) - -#define STATIC_KSDATAFORMAT_TYPE_MPEG2_PROGRAM\ - 0xe06d8022L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8022-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PROGRAM); -#define KSDATAFORMAT_TYPE_MPEG2_PROGRAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PROGRAM) - -#define STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT\ - 0xe06d8023L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8023-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_TRANSPORT); -#define KSDATAFORMAT_TYPE_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_TRANSPORT) - -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO\ - 0xe06d8026L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8026-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO); -#define KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO) - -// use MPEGVIDEOINFO2 (defined below) with KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO -#define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO\ - 0xe06d80e3L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e3-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO); -#define KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO) - - -// -// Mpeg2 video properties -// - - -#define STATIC_KSPROPSETID_Mpeg2Vid\ - 0xC8E11B60L, 0x0CC9, 0x11D0, 0xBD, 0x69, 0x00, 0x35, 0x05, 0xC1, 0x03, 0xA9 -DEFINE_GUIDSTRUCT("C8E11B60-0CC9-11D0-BD69-003505C103A9", KSPROPSETID_Mpeg2Vid); -#define KSPROPSETID_Mpeg2Vid DEFINE_GUIDNAMED( KSPROPSETID_Mpeg2Vid ) - - -typedef enum { - KSPROPERTY_MPEG2VID_MODES, // available output modes of decoder - KSPROPERTY_MPEG2VID_CUR_MODE, // current mode of the decoder - KSPROPERTY_MPEG2VID_4_3_RECT, // output coordinates for 4:3 source - KSPROPERTY_MPEG2VID_16_9_RECT, // output coordinates for 16:9 source - KSPROPERTY_MPEG2VID_16_9_PANSCAN, // pan and scan vectors -} KSPROPERTY_MPEG2VID; - -// -// bit field definitions for MPEG2 VIDEO mode -// - -#define KSMPEGVIDMODE_PANSCAN 0x0001 -#define KSMPEGVIDMODE_LTRBOX 0x0002 -#define KSMPEGVIDMODE_SCALE 0x0004 - -// -// rectangle definitions for the 4/3 and 16/9 cropping properties of -// the MPEG2Video decoder -// - -typedef struct _KSMPEGVID_RECT { - ULONG StartX; - ULONG StartY; - ULONG EndX; - ULONG EndY; -} KSMPEGVID_RECT, *PKSMPEGVID_RECT; - -// -// Params for pan / scan -// - - -// -// MPEG2 Audio definition -// - -#define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO\ - 0xe06d802bL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802b-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO); -#define KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO) - -#define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO\ - 0xe06d80e5L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e5-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO); -#define KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO) - -// -// DVD LPCM Audio definition -// - -#define STATIC_KSDATAFORMAT_SUBTYPE_LPCM_AUDIO\ - 0xe06d8032L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8032-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_LPCM_AUDIO); -#define KSDATAFORMAT_SUBTYPE_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_LPCM_AUDIO) - -#define STATIC_KSDATAFORMAT_SPECIFIER_LPCM_AUDIO\ - 0xe06d80e6L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e6-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_LPCM_AUDIO); -#define KSDATAFORMAT_SPECIFIER_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_LPCM_AUDIO) - -// -// AC-3 definition -// - -#define STATIC_KSDATAFORMAT_SUBTYPE_AC3_AUDIO\ - 0xe06d802cL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802c-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_AC3_AUDIO); -#define KSDATAFORMAT_SUBTYPE_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_AC3_AUDIO) - -#define STATIC_KSDATAFORMAT_SPECIFIER_AC3_AUDIO\ - 0xe06d80e4L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e4-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_AC3_AUDIO); -#define KSDATAFORMAT_SPECIFIER_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_AC3_AUDIO) - -#define STATIC_KSPROPSETID_AC3\ - 0xBFABE720L, 0x6E1F, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("BFABE720-6E1F-11D0-BCF2-444553540000", KSPROPSETID_AC3); -#define KSPROPSETID_AC3 DEFINE_GUIDNAMED(KSPROPSETID_AC3) - -typedef enum { - KSPROPERTY_AC3_ERROR_CONCEALMENT = 1, - KSPROPERTY_AC3_ALTERNATE_AUDIO, - KSPROPERTY_AC3_DOWNMIX, - KSPROPERTY_AC3_BIT_STREAM_MODE, - KSPROPERTY_AC3_DIALOGUE_LEVEL, - KSPROPERTY_AC3_LANGUAGE_CODE, - KSPROPERTY_AC3_ROOM_TYPE -} KSPROPERTY_AC3; - -typedef struct { - BOOL fRepeatPreviousBlock; - BOOL fErrorInCurrentBlock; -} KSAC3_ERROR_CONCEALMENT, *PKSAC3_ERROR_CONCEALMENT; - -typedef struct { - BOOL fStereo; - ULONG DualMode; -} KSAC3_ALTERNATE_AUDIO, *PKSAC3_ALTERNATE_AUDIO; - -#define KSAC3_ALTERNATE_AUDIO_1 1 -#define KSAC3_ALTERNATE_AUDIO_2 2 -#define KSAC3_ALTERNATE_AUDIO_BOTH 3 - -typedef struct { - BOOL fDownMix; - BOOL fDolbySurround; -} KSAC3_DOWNMIX, *PKSAC3_DOWNMIX; - -typedef struct { - LONG BitStreamMode; -} KSAC3_BIT_STREAM_MODE, *PKSAC3_BIT_STREAM_MODE; - -#define KSAC3_SERVICE_MAIN_AUDIO 0 -#define KSAC3_SERVICE_NO_DIALOG 1 -#define KSAC3_SERVICE_VISUALLY_IMPAIRED 2 -#define KSAC3_SERVICE_HEARING_IMPAIRED 3 -#define KSAC3_SERVICE_DIALOG_ONLY 4 -#define KSAC3_SERVICE_COMMENTARY 5 -#define KSAC3_SERVICE_EMERGENCY_FLASH 6 -#define KSAC3_SERVICE_VOICE_OVER 7 - -typedef struct { - ULONG DialogueLevel; -} KSAC3_DIALOGUE_LEVEL, *PKSAC3_DIALOGUE_LEVEL; - -typedef struct { - BOOL fLargeRoom; -} KSAC3_ROOM_TYPE, *PKSAC3_ROOM_TYPE; - - -// -// DTS and SDDS definitions (media subtype GUIDs) -// -#define STATIC_KSDATAFORMAT_SUBTYPE_DTS_AUDIO\ - 0xe06d8033L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8033-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_DTS_AUDIO); -#define KSDATAFORMAT_SUBTYPE_DTS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DTS_AUDIO) - -#define STATIC_KSDATAFORMAT_SUBTYPE_SDDS_AUDIO\ - 0xe06d8034L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8034-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SDDS_AUDIO); -#define KSDATAFORMAT_SUBTYPE_SDDS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SDDS_AUDIO) - - -// -// audio decoder output properties -// - -#define STATIC_KSPROPSETID_AudioDecoderOut\ - 0x6ca6e020L, 0x43bd, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 -DEFINE_GUIDSTRUCT("6ca6e020-43bd-11d0-bd6a-003505c103a9", KSPROPSETID_AudioDecoderOut); -#define KSPROPSETID_AudioDecoderOut DEFINE_GUIDNAMED(KSPROPSETID_AudioDecoderOut) - -typedef enum { - KSPROPERTY_AUDDECOUT_MODES, // available output modes of decoder - KSPROPERTY_AUDDECOUT_CUR_MODE, // current mode of the decoder -} KSPROPERTY_AUDDECOUT; - -#define KSAUDDECOUTMODE_STEREO_ANALOG 0x0001 -#define KSAUDDECOUTMODE_PCM_51 0x0002 -#define KSAUDDECOUTMODE_SPDIFF 0x0004 - - - -// -// subpicture definition -// - -#define STATIC_KSDATAFORMAT_SUBTYPE_SUBPICTURE\ - 0xe06d802dL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802d-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SUBPICTURE); -#define KSDATAFORMAT_SUBTYPE_SUBPICTURE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SUBPICTURE) - - -#define STATIC_KSPROPSETID_DvdSubPic\ - 0xac390460L, 0x43af, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 -DEFINE_GUIDSTRUCT("ac390460-43af-11d0-bd6a-003505c103a9", KSPROPSETID_DvdSubPic); -#define KSPROPSETID_DvdSubPic DEFINE_GUIDNAMED(KSPROPSETID_DvdSubPic) - -typedef enum { - KSPROPERTY_DVDSUBPIC_PALETTE, - KSPROPERTY_DVDSUBPIC_HLI, - KSPROPERTY_DVDSUBPIC_COMPOSIT_ON, // TRUE for subpicture is displayed -} KSPROPERTY_DVDSUBPIC; - -typedef struct _KS_DVD_YCrCb { - UCHAR Reserved; - UCHAR Y; - UCHAR Cr; - UCHAR Cb; -} KS_DVD_YCrCb, *PKS_DVD_YCrCb; - -/* The KS_DVD_YUV structure is now superseded by KS_DVD_YCrCb above and is - here for backward compatibility only */ - -typedef struct _KS_DVD_YUV { - UCHAR Reserved; - UCHAR Y; - UCHAR V; - UCHAR U; -} KS_DVD_YUV, *PKS_DVD_YUV; - -typedef struct _KSPROPERTY_SPPAL { - KS_DVD_YUV sppal[16]; -} KSPROPERTY_SPPAL, *PKSPROPERTY_SPPAL; - -typedef struct _KS_COLCON { - UCHAR emph1col:4; - UCHAR emph2col:4; - UCHAR backcol:4; - UCHAR patcol:4; - UCHAR emph1con:4; - UCHAR emph2con:4; - UCHAR backcon:4; - UCHAR patcon:4; - -} KS_COLCON, *PKS_COLCON; - -typedef struct _KSPROPERTY_SPHLI { - USHORT HLISS; - USHORT Reserved; - ULONG StartPTM; // start presentation time in x/90000 - ULONG EndPTM; // end PTM in x/90000 - USHORT StartX; - USHORT StartY; - USHORT StopX; - USHORT StopY; - KS_COLCON ColCon; // color contrast description (4 bytes as given in HLI) -} KSPROPERTY_SPHLI, *PKSPROPERTY_SPHLI; - -typedef BOOL KSPROPERTY_COMPOSIT_ON, *PKSPROPERTY_COMPOSIT_ON; - -#define STATIC_KSPROPSETID_CopyProt \ - 0x0E8A0A40L, 0x6AEF, 0x11D0, 0x9E, 0xD0, 0x00, 0xA0, 0x24, 0xCA, 0x19, 0xB3 -DEFINE_GUIDSTRUCT("0E8A0A40-6AEF-11D0-9ED0-00A024CA19B3", KSPROPSETID_CopyProt); -#define KSPROPSETID_CopyProt DEFINE_GUIDNAMED(KSPROPSETID_CopyProt) - -typedef enum { - - KSPROPERTY_DVDCOPY_CHLG_KEY = 0x01, - KSPROPERTY_DVDCOPY_DVD_KEY1, - KSPROPERTY_DVDCOPY_DEC_KEY2, - KSPROPERTY_DVDCOPY_TITLE_KEY, - KSPROPERTY_COPY_MACROVISION, - KSPROPERTY_DVDCOPY_REGION, - KSPROPERTY_DVDCOPY_SET_COPY_STATE, - KSPROPERTY_DVDCOPY_DISC_KEY = 0x80 - -} KSPROPERTY_COPYPROT; - -typedef struct _KS_DVDCOPY_CHLGKEY { - BYTE ChlgKey[10]; - BYTE Reserved[2]; -} KS_DVDCOPY_CHLGKEY, *PKS_DVDCOPY_CHLGKEY; - -typedef struct _KS_DVDCOPY_BUSKEY { - BYTE BusKey[5]; - BYTE Reserved[1]; -} KS_DVDCOPY_BUSKEY, *PKS_DVDCOPY_BUSKEY; - - -typedef struct _KS_DVDCOPY_DISCKEY { - BYTE DiscKey[2048]; -} KS_DVDCOPY_DISCKEY, *PKS_DVDCOPY_DISCKEY; - -typedef struct _KS_DVDCOPY_REGION { - UCHAR Reserved; - UCHAR RegionData; - UCHAR Reserved2[2]; -} KS_DVDCOPY_REGION, *PKS_DVDCOPY_REGION; - -typedef struct _KS_DVDCOPY_TITLEKEY { - ULONG KeyFlags; - ULONG ReservedNT[2]; - UCHAR TitleKey[6]; - UCHAR Reserved[2]; -} KS_DVDCOPY_TITLEKEY, *PKS_DVDCOPY_TITLEKEY; - -typedef struct _KS_COPY_MACROVISION { - ULONG MACROVISIONLevel; -} KS_COPY_MACROVISION, *PKS_COPY_MACROVISION; - -typedef struct _KS_DVDCOPY_SET_COPY_STATE { - ULONG DVDCopyState; -} KS_DVDCOPY_SET_COPY_STATE, *PKS_DVDCOPY_SET_COPY_STATE; - -typedef enum { - KS_DVDCOPYSTATE_INITIALIZE, // indicates we are starting a full - // copy protection sequence. - KS_DVDCOPYSTATE_INITIALIZE_TITLE, // indicates we are starting a title - // key copy protection sequence - KS_DVDCOPYSTATE_AUTHENTICATION_NOT_REQUIRED, - KS_DVDCOPYSTATE_AUTHENTICATION_REQUIRED, - KS_DVDCOPYSTATE_DONE, -} KS_DVDCOPYSTATE; - -typedef enum { - KS_MACROVISION_DISABLED, - KS_MACROVISION_LEVEL1, - KS_MACROVISION_LEVEL2, - KS_MACROVISION_LEVEL3 -} KS_COPY_MACROVISION_LEVEL, *PKS_COPY_MACROVISION_LEVEL; - -// -// CGMS Copy Protection Flags -// - -#define KS_DVD_CGMS_RESERVED_MASK 0x00000078 - -#define KS_DVD_CGMS_COPY_PROTECT_MASK 0x00000018 -#define KS_DVD_CGMS_COPY_PERMITTED 0x00000000 -#define KS_DVD_CGMS_COPY_ONCE 0x00000010 -#define KS_DVD_CGMS_NO_COPY 0x00000018 - -#define KS_DVD_COPYRIGHT_MASK 0x00000040 -#define KS_DVD_NOT_COPYRIGHTED 0x00000000 -#define KS_DVD_COPYRIGHTED 0x00000040 - -#define KS_DVD_SECTOR_PROTECT_MASK 0x00000020 -#define KS_DVD_SECTOR_NOT_PROTECTED 0x00000000 -#define KS_DVD_SECTOR_PROTECTED 0x00000020 - - -//=========================================================================== -// The following MUST match the structures in WinGDI.h and AMVideo.h -//=========================================================================== - -#define STATIC_KSCATEGORY_TVTUNER \ - 0xa799a800L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a800-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVTUNER); -#define KSCATEGORY_TVTUNER DEFINE_GUIDNAMED(KSCATEGORY_TVTUNER) - -#define STATIC_KSCATEGORY_CROSSBAR \ - 0xa799a801L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a801-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_CROSSBAR); -#define KSCATEGORY_CROSSBAR DEFINE_GUIDNAMED(KSCATEGORY_CROSSBAR) - -#define STATIC_KSCATEGORY_TVAUDIO \ - 0xa799a802L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a802-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVAUDIO); -#define KSCATEGORY_TVAUDIO DEFINE_GUIDNAMED(KSCATEGORY_TVAUDIO) - -#define STATIC_KSCATEGORY_VPMUX \ - 0xa799a803L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a803-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_VPMUX); -#define KSCATEGORY_VPMUX DEFINE_GUIDNAMED(KSCATEGORY_VPMUX) - -#define STATIC_KSCATEGORY_VBICODEC \ - 0x07dad660L, 0x22f1, 0x11d1, 0xa9, 0xf4, 0x00, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("07dad660-22f1-11d1-a9f4-00c04fbbde8f", KSCATEGORY_VBICODEC); -#define KSCATEGORY_VBICODEC DEFINE_GUIDNAMED(KSCATEGORY_VBICODEC) - -// SUBTYPE_VPVideo -#define STATIC_KSDATAFORMAT_SUBTYPE_VPVideo\ - 0x5a9b6a40L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("5a9b6a40-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVideo); -#define KSDATAFORMAT_SUBTYPE_VPVideo DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVideo) - -// SUBTYPE_VPVBI -#define STATIC_KSDATAFORMAT_SUBTYPE_VPVBI\ - 0x5a9b6a41L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("5a9b6a41-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVBI); -#define KSDATAFORMAT_SUBTYPE_VPVBI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVBI) - - -// FORMAT_VideoInfo -#define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO\ - 0x05589f80L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f80-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_VIDEOINFO); -#define KSDATAFORMAT_SPECIFIER_VIDEOINFO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO) - -// FORMAT_VideoInfo2 -#define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO2\ - 0xf72a76A0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76A0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VIDEOINFO2); -#define KSDATAFORMAT_SPECIFIER_VIDEOINFO2 DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO2) - -// MEDIATYPE_AnalogVideo -#define STATIC_KSDATAFORMAT_TYPE_ANALOGVIDEO\ - 0x0482dde1L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 -DEFINE_GUIDSTRUCT("0482dde1-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_TYPE_ANALOGVIDEO); -#define KSDATAFORMAT_TYPE_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_ANALOGVIDEO) - -// FORMAT_AnalogVideo -#define STATIC_KSDATAFORMAT_SPECIFIER_ANALOGVIDEO\ - 0x0482dde0L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 -DEFINE_GUIDSTRUCT("0482dde0-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_SPECIFIER_ANALOGVIDEO); -#define KSDATAFORMAT_SPECIFIER_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_ANALOGVIDEO) - -// FORMAT_VBI -#define STATIC_KSDATAFORMAT_SPECIFIER_VBI\ - 0xf72a76e0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VBI); -#define KSDATAFORMAT_SPECIFIER_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VBI) - -// MEDIATYPE_VBI -#define STATIC_KSDATAFORMAT_TYPE_VBI\ - 0xf72a76e1L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e1-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_TYPE_VBI); -#define KSDATAFORMAT_TYPE_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VBI) - -// SUBTYPE_RAW8 -#define STATIC_KSDATAFORMAT_SUBTYPE_RAW8\ - 0xca20d9a0, 0x3e3e, 0x11d1, 0x9b, 0xf9, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0xbf -DEFINE_GUIDSTRUCT("ca20d9a0-3e3e-11d1-9bf9-00c04fbbdebf", KSDATAFORMAT_SUBTYPE_RAW8); -#define KSDATAFORMAT_SUBTYPE_RAW8 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RAW8) - -// MEDIASUBTYPE_CC -#define STATIC_KSDATAFORMAT_SUBTYPE_CC\ - 0x33214cc1, 0x11f, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe -DEFINE_GUIDSTRUCT("33214CC1-011F-11D2-B4B1-00A0D102CFBE", KSDATAFORMAT_SUBTYPE_CC); -#define KSDATAFORMAT_SUBTYPE_CC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_CC) - -// MEDIASUBTYPE_NABTS -#define STATIC_KSDATAFORMAT_SUBTYPE_NABTS\ - 0xf72a76e2L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e2-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_NABTS); -#define KSDATAFORMAT_SUBTYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS) - -// MEDIASUBTYPE_TELETEXT -#define STATIC_KSDATAFORMAT_SUBTYPE_TELETEXT\ - 0xf72a76e3L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e3-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_TELETEXT); -#define KSDATAFORMAT_SUBTYPE_TELETEXT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_TELETEXT) - - - -/* constants for the biCompression field */ -#define KS_BI_RGB 0L -#define KS_BI_RLE8 1L -#define KS_BI_RLE4 2L -#define KS_BI_BITFIELDS 3L - -typedef struct tagKS_RGBQUAD { // rgbq - BYTE rgbBlue; - BYTE rgbGreen; - BYTE rgbRed; - BYTE rgbReserved; -} KS_RGBQUAD, *PKS_RGBQUAD; - -/* constants for palettes */ -#define KS_iPALETTE_COLORS 256 // Maximum colours in palette -#define KS_iEGA_COLORS 16 // Number colours in EGA palette -#define KS_iMASK_COLORS 3 // Maximum three components -#define KS_iTRUECOLOR 16 // Minimum true colour device -#define KS_iRED 0 // Index position for RED mask -#define KS_iGREEN 1 // Index position for GREEN mask -#define KS_iBLUE 2 // Index position for BLUE mask -#define KS_iPALETTE 8 // Maximum colour depth using a palette -#define KS_iMAXBITS 8 // Maximum bits per colour component -#define KS_SIZE_EGA_PALETTE (KS_iEGA_COLORS * sizeof(KS_RGBQUAD)) -#define KS_SIZE_PALETTE (KS_iPALETTE_COLORS * sizeof(KS_RGBQUAD)) - -typedef struct tagKS_BITMAPINFOHEADER{ - DWORD biSize; - LONG biWidth; - LONG biHeight; - WORD biPlanes; - WORD biBitCount; - DWORD biCompression; - DWORD biSizeImage; - LONG biXPelsPerMeter; - LONG biYPelsPerMeter; - DWORD biClrUsed; - DWORD biClrImportant; -} KS_BITMAPINFOHEADER, *PKS_BITMAPINFOHEADER; - -// Used for true colour images that also have a palette - -typedef struct tag_KS_TRUECOLORINFO { - DWORD dwBitMasks[KS_iMASK_COLORS]; - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; -} KS_TRUECOLORINFO, *PKS_TRUECOLORINFO; - - -#define KS_WIDTHBYTES(bits) ((DWORD)(((bits)+31) & (~31)) / 8) -#define KS_DIBWIDTHBYTES(bi) (DWORD)KS_WIDTHBYTES((DWORD)(bi).biWidth * (DWORD)(bi).biBitCount) -#define KS__DIBSIZE(bi) (KS_DIBWIDTHBYTES(bi) * (DWORD)(bi).biHeight) -#define KS_DIBSIZE(bi) ((bi).biHeight < 0 ? (-1)*(KS__DIBSIZE(bi)) : KS__DIBSIZE(bi)) - -typedef LONGLONG REFERENCE_TIME; - -// The BITMAPINFOHEADER contains all the details about the video stream such -// as the actual image dimensions and their pixel depth. A source filter may -// also request that the sink take only a section of the video by providing a -// clipping rectangle in rcSource. In the worst case where the sink filter -// forgets to check this on connection it will simply render the whole thing -// which isn't a disaster. Ideally a sink filter will check the rcSource and -// if it doesn't support image extraction and the rectangle is not empty then -// it will reject the connection. A filter should use SetRectEmpty to reset a -// rectangle to all zeroes (and IsRectEmpty to later check the rectangle). -// The rcTarget specifies the destination rectangle for the video, for most -// source filters they will set this to all zeroes, a downstream filter may -// request that the video be placed in a particular area of the buffers it -// supplies in which case it will call QueryAccept with a non empty target - -typedef struct tagKS_VIDEOINFOHEADER { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - KS_BITMAPINFOHEADER bmiHeader; - -} KS_VIDEOINFOHEADER, *PKS_VIDEOINFOHEADER; - -// !!! WARNING !!! -// DO NOT use the following structure unless you are sure that the BITMAPINFOHEADER -// has a normal biSize == sizeof(BITMAPINFOHEADER) ! -// !!! WARNING !!! - -typedef struct tagKS_VIDEOINFO { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - KS_BITMAPINFOHEADER bmiHeader; - - union { - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; // Colour palette - DWORD dwBitMasks[KS_iMASK_COLORS]; // True colour masks - KS_TRUECOLORINFO TrueColorInfo; // Both of the above - }; - -} KS_VIDEOINFO, *PKS_VIDEOINFO; - - -#define KS_SIZE_MASKS (KS_iMASK_COLORS * sizeof(DWORD)) -#define KS_SIZE_PREHEADER (FIELD_OFFSET(KS_VIDEOINFOHEADER,bmiHeader)) - -// For normal size -// #define KS_SIZE_VIDEOHEADER (sizeof(KS_BITMAPINFOHEADER) + KS_SIZE_PREHEADER) -// !!! for abnormal biSizes -#define KS_SIZE_VIDEOHEADER(pbmi) ((pbmi)->bmiHeader.biSize + KS_SIZE_PREHEADER) - -// VBI -// Used for NABTS, CC, Intercast, WST -typedef struct tagKS_VBIINFOHEADER { - ULONG StartLine; // inclusive - ULONG EndLine; // inclusive - ULONG SamplingFrequency; // Hz. - ULONG MinLineStartTime; // microSec * 100 from HSync LE - ULONG MaxLineStartTime; // microSec * 100 from HSync LE - ULONG ActualLineStartTime; // microSec * 100 from HSync LE - ULONG ActualLineEndTime; // microSec * 100 from HSync LE - ULONG VideoStandard; // KS_AnalogVideoStandard* - ULONG SamplesPerLine; - ULONG StrideInBytes; // May be > SamplesPerLine - ULONG BufferSize; // Bytes -} KS_VBIINFOHEADER, *PKS_VBIINFOHEADER; - -// VBI Sampling Rates -#define KS_VBIDATARATE_NABTS (5727272L) -#define KS_VBIDATARATE_CC ( 503493L) // ~= 1/1.986125e-6 -#define KS_VBISAMPLINGRATE_4X_NABTS ((long)(4*KS_VBIDATARATE_NABTS)) -#define KS_VBISAMPLINGRATE_47X_NABTS ((long)(27000000)) -#define KS_VBISAMPLINGRATE_5X_NABTS ((long)(5*KS_VBIDATARATE_NABTS)) - -#define KS_47NABTS_SCALER (KS_VBISAMPLINGRATE_47X_NABTS/(double)KS_VBIDATARATE_NABTS) - -// Analog video variant - Use this when the format is FORMAT_AnalogVideo -// -// rcSource defines the portion of the active video signal to use -// rcTarget defines the destination rectangle -// both of the above are relative to the dwActiveWidth and dwActiveHeight fields -// dwActiveWidth is currently set to 720 for all formats (but could change for HDTV) -// dwActiveHeight is 483 for NTSC and 575 for PAL/SECAM (but could change for HDTV) - -typedef struct tagKS_AnalogVideoInfo { - RECT rcSource; // Width max is 720, height varies w/ TransmissionStd - RECT rcTarget; // Where the video should go - DWORD dwActiveWidth; // Always 720 (CCIR-601 active samples per line) - DWORD dwActiveHeight; // 483 for NTSC, 575 for PAL/SECAM - REFERENCE_TIME AvgTimePerFrame; // Normal ActiveMovie units (100 nS) -} KS_ANALOGVIDEOINFO, *PKS_ANALOGVIDEOINFO; - -//=========================================================================== -// Data packet passed on Analog video stream channel change -//=========================================================================== - -#define KS_TVTUNER_CHANGE_BEGIN_TUNE 0x0001L // Starting a tuning operation -#define KS_TVTUNER_CHANGE_END_TUNE 0x0002L // Ending a tuning operation - -typedef struct tagKS_TVTUNER_CHANGE_INFO { - DWORD dwFlags; // KS_TVTUNER_CHANGE_* - DWORD dwCountryCode; - DWORD dwAnalogVideoStandard; // KS_AnalogVideoStandard - DWORD dwChannel; -} KS_TVTUNER_CHANGE_INFO, *PKS_TVTUNER_CHANGE_INFO; - -//=========================================================================== -// Video format blocks -//=========================================================================== - -typedef enum { - KS_MPEG2Level_Low, - KS_MPEG2Level_Main, - KS_MPEG2Level_High1440, - KS_MPEG2Level_High -} KS_MPEG2Level; - -typedef enum { - KS_MPEG2Profile_Simple, - KS_MPEG2Profile_Main, - KS_MPEG2Profile_SNRScalable, - KS_MPEG2Profile_SpatiallyScalable, - KS_MPEG2Profile_High -} KS_MPEG2Profile; - -#define KS_INTERLACE_IsInterlaced 0x00000001 // if 0, other interlace bits are irrelevent -#define KS_INTERLACE_1FieldPerSample 0x00000002 // else 2 fields per media sample -#define KS_INTERLACE_Field1First 0x00000004 // else Field 2 is first; top field in PAL is field 1, top field in NTSC is field 2? -#define KS_INTERLACE_UNUSED 0x00000008 // -#define KS_INTERLACE_FieldPatternMask 0x00000030 // use this mask with AMINTERLACE_FieldPat* -#define KS_INTERLACE_FieldPatField1Only 0x00000000 // Data never contains a Field2 -#define KS_INTERLACE_FieldPatField2Only 0x00000010 // Data never contains a Field1 -#define KS_INTERLACE_FieldPatBothRegular 0x00000020 // There will be a Field2 for every Field1 (required for Weave?) -#define KS_INTERLACE_FieldPatBothIrregular 0x00000030 // Random pattern of Field1s and Field2s -#define KS_INTERLACE_DisplayModeMask 0x000000c0 -#define KS_INTERLACE_DisplayModeBobOnly 0x00000000 -#define KS_INTERLACE_DisplayModeWeaveOnly 0x00000040 -#define KS_INTERLACE_DisplayModeBobOrWeave 0x00000080 - - - -#define KS_MPEG2_DoPanScan 0x00000001 //if set, the MPEG-2 video decoder should crop output image - // based on pan-scan vectors in picture_display_extension - // and change the picture aspect ratio accordingly. -#define KS_MPEG2_DVDLine21Field1 0x00000002 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 1 -#define KS_MPEG2_DVDLine21Field2 0x00000004 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 2 -#define KS_MPEG2_SourceIsLetterboxed 0x00000008 //if set, indicates that black bars have been encoded in the top - // and bottom of the video. -#define KS_MPEG2_FilmCameraMode 0x00000010 //if set, indicates "film mode" used for 625/50 content. If cleared, - // indicates that "camera mode" was used. -#define KS_MPEG2_LetterboxAnalogOut 0x00000020 //if set and this stream is sent to an analog output, it should - // be letterboxed. Streams sent to VGA should be letterboxed only by renderers. -#define KS_MPEG2_DSS_UserData 0x00000040 //if set, the MPEG-2 decoder must process DSS style user data -#define KS_MPEG2_DVB_UserData 0x00000080 //if set, the MPEG-2 decoder must process DVB style user data -#define KS_MPEG2_27MhzTimebase 0x00000100 //if set, the PTS,DTS timestamps advance at 27MHz rather than 90KHz - -typedef struct tagKS_VIDEOINFOHEADER2 { - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - DWORD dwInterlaceFlags; // use AMINTERLACE_* defines. Reject connection if undefined bits are not 0 - DWORD dwCopyProtectFlags; // use AMCOPYPROTECT_* defines. Reject connection if undefined bits are not 0 - DWORD dwPictAspectRatioX; // X dimension of picture aspect ratio, e.g. 16 for 16x9 display - DWORD dwPictAspectRatioY; // Y dimension of picture aspect ratio, e.g. 9 for 16x9 display - DWORD dwReserved1; // must be 0; reject connection otherwise - DWORD dwReserved2; // must be 0; reject connection otherwise - KS_BITMAPINFOHEADER bmiHeader; -} KS_VIDEOINFOHEADER2, *PKS_VIDEOINFOHEADER2; - -typedef struct tagKS_MPEG1VIDEOINFO { - KS_VIDEOINFOHEADER hdr; // Compatible with VIDEOINFO - DWORD dwStartTimeCode; // 25-bit Group of pictures time code at start of data - DWORD cbSequenceHeader; // Length in bytes of bSequenceHeader - BYTE bSequenceHeader[1]; // Sequence header including quantization matrices if any -} KS_MPEG1VIDEOINFO, *PKS_MPEG1VIDEOINFO; - -#define KS_MAX_SIZE_MPEG1_SEQUENCE_INFO 140 -#define KS_SIZE_MPEG1VIDEOINFO(pv) (FIELD_OFFSET(KS_MPEG1VIDEOINFO, bSequenceHeader[0]) + (pv)->cbSequenceHeader) -#define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - -typedef struct tagKS_MPEGVIDEOINFO2 { - KS_VIDEOINFOHEADER2 hdr; - DWORD dwStartTimeCode; // ?? not used for DVD ?? - DWORD cbSequenceHeader; // is 0 for DVD (no sequence header) - DWORD dwProfile; // use enum MPEG2Profile - DWORD dwLevel; // use enum MPEG2Level - DWORD dwFlags; // use AMMPEG2_* defines. Reject connection if undefined bits are not 0 - DWORD bSequenceHeader[1]; // DWORD instead of Byte for alignment purposes - // For MPEG-2, if a sequence_header is included, the sequence_extension - // should also be included -} KS_MPEGVIDEOINFO2, *PKS_MPEGVIDEOINFO2; - - -#define KS_SIZE_MPEGVIDEOINFO2(pv) (FIELD_OFFSET(KS_MPEGVIDEOINFO2, bSequenceHeader[0]) + (pv)->cbSequenceHeader) -#define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - -//=========================================================================== -// Audio format blocks -//=========================================================================== - -//if set, the PTS,DTS timestamps advance at 27MHz rather than 90KHz -#define KS_MPEGAUDIOINFO_27MhzTimebase 0x00000001 - -typedef struct tagKS_MPEAUDIOINFO { - DWORD dwFlags; // use KS_MPEGAUDIOINFO_* defines. Reject connection if undefined bits are not 0 - DWORD dwReserved1; // must be 0; reject connection otherwise - DWORD dwReserved2; // must be 0; reject connection otherwise - DWORD dwReserved3; // must be 0; reject connection otherwise -} KS_MPEGAUDIOINFO, *PKS_MPEGAUDIOINFO; - -//=========================================================================== -// Video DATAFORMATs -//=========================================================================== - -typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER { - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER VideoInfoHeader; -} KS_DATAFORMAT_VIDEOINFOHEADER, *PKS_DATAFORMAT_VIDEOINFOHEADER; - -typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER2 { - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER2 VideoInfoHeader2; -} KS_DATAFORMAT_VIDEOINFOHEADER2, *PKS_DATAFORMAT_VIDEOINFOHEADER2; - -typedef struct tagKS_DATAFORMAT_VIDEOINFO_PALETTE { - KSDATAFORMAT DataFormat; - KS_VIDEOINFO VideoInfo; -} KS_DATAFORMAT_VIDEOINFO_PALETTE, *PKS_DATAFORMAT_VIDEOINFO_PALETTE; - -typedef struct tagKS_DATAFORMAT_VBIINFOHEADER { - KSDATAFORMAT DataFormat; - KS_VBIINFOHEADER VBIInfoHeader; -} KS_DATAFORMAT_VBIINFOHEADER, *PKS_DATAFORMAT_VBIINFOHEADER; - -typedef struct _KS_VIDEO_STREAM_CONFIG_CAPS { - GUID guid; // will be MEDIATYPE_Video - ULONG VideoStandard; // logical OR of all AnalogVideoStandards - // supported - SIZE InputSize; // the inherent size of the incoming signal - // (every pixel unique) - SIZE MinCroppingSize; // smallest rcSrc cropping rect allowed - SIZE MaxCroppingSize; // largest rcSrc cropping rect allowed - int CropGranularityX; // granularity of cropping size - int CropGranularityY; - int CropAlignX; // alignment of cropping rect - int CropAlignY; - SIZE MinOutputSize; // smallest bitmap stream can produce - SIZE MaxOutputSize; // largest bitmap stream can produce - int OutputGranularityX; // granularity of output bitmap size - int OutputGranularityY; - int StretchTapsX; // 0, no stretch, 1 pix dup, 2 interp, ... - int StretchTapsY; // Describes quality of hardware scaler - int ShrinkTapsX; // - int ShrinkTapsY; // - LONGLONG MinFrameInterval; // 100 nS units - LONGLONG MaxFrameInterval; - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; -} KS_VIDEO_STREAM_CONFIG_CAPS, *PKS_VIDEO_STREAM_CONFIG_CAPS; - -//=========================================================================== -// Video DATARANGEs -//=========================================================================== - -typedef struct tagKS_DATARANGE_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER VideoInfoHeader; // default format -} KS_DATARANGE_VIDEO, *PKS_DATARANGE_VIDEO; - -typedef struct tagKS_DATARANGE_VIDEO2 { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER2 VideoInfoHeader; // default format -} KS_DATARANGE_VIDEO2, *PKS_DATARANGE_VIDEO2; - -typedef struct tagKS_DATARANGE_MPEG1_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEG1VIDEOINFO VideoInfoHeader; // default format -} KS_DATARANGE_MPEG1_VIDEO, *PKS_DATARANGE_MPEG1_VIDEO; - -typedef struct tagKS_DATARANGE_MPEG2_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEGVIDEOINFO2 VideoInfoHeader; // default format -} KS_DATARANGE_MPEG2_VIDEO, *PKS_DATARANGE_MPEG2_VIDEO; - -typedef struct tagKS_DATARANGE_VIDEO_PALETTE { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFO VideoInfo; // default format -} KS_DATARANGE_VIDEO_PALETTE, *PKS_DATARANGE_VIDEO_PALETTE; - -typedef struct tagKS_DATARANGE_VIDEO_VBI { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VBIINFOHEADER VBIInfoHeader; // default format -} KS_DATARANGE_VIDEO_VBI, *PKS_DATARANGE_VIDEO_VBI; - -typedef struct tagKS_DATARANGE_ANALOGVIDEO { - KSDATARANGE DataRange; - KS_ANALOGVIDEOINFO AnalogVideoInfo; -} KS_DATARANGE_ANALOGVIDEO, *PKS_DATARANGE_ANALOGVIDEO; - -//=========================================================================== -// StreamDescriptionFlags -// -// These define the "purpose" of each video stream -//=========================================================================== - -#define KS_VIDEOSTREAM_PREVIEW 0x0001 // Preview stream -#define KS_VIDEOSTREAM_CAPTURE 0x0002 // Capture stream -#define KS_VIDEOSTREAM_VBI 0x0010 // Field1 VBI -#define KS_VIDEOSTREAM_NABTS 0x0020 // Field1 NABTS -#define KS_VIDEOSTREAM_CC 0x0100 // Closed Captioning -#define KS_VIDEOSTREAM_EDS 0x0200 // Extended Data Services -#define KS_VIDEOSTREAM_TELETEXT 0x0400 // Field1 Teletext only -#define KS_VIDEOSTREAM_STILL 0x1000 // Still image input -#define KS_VIDEOSTREAM_IS_VPE 0x8000 // Is a VPE based stream? - -// MemoryAllocationFlags -#define KS_VIDEO_ALLOC_VPE_SYSTEM 0x0001 // VPE surface in system memory -#define KS_VIDEO_ALLOC_VPE_DISPLAY 0x0002 // VPE surface in display memory -#define KS_VIDEO_ALLOC_VPE_AGP 0x0004 // VPE surface in AGP memory - -////////////////////////////////////////////////////////////// -// Capture driver VBI property sets -////////////////////////////////////////////////////////////// - -// {F162C607-7B35-496f-AD7F-2DCA3B46B718} -#define STATIC_KSPROPSETID_VBICAP_PROPERTIES\ - 0xf162c607, 0x7b35, 0x496f, 0xad, 0x7f, 0x2d, 0xca, 0x3b, 0x46, 0xb7, 0x18 -DEFINE_GUIDSTRUCT("F162C607-7B35-496f-AD7F-2DCA3B46B718", KSPROPSETID_VBICAP_PROPERTIES); -#define KSPROPSETID_VBICAP_PROPERTIES DEFINE_GUIDNAMED(KSPROPSETID_VBICAP_PROPERTIES) - -typedef enum { - KSPROPERTY_VBICAP_PROPERTIES_PROTECTION = 0x01, -} KSPROPERTY_VBICAP; - -typedef struct _VBICAP_PROPERTIES_PROTECTION_S { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG Status; -} VBICAP_PROPERTIES_PROTECTION_S, *PVBICAP_PROPERTIES_PROTECTION_S; -#define KS_VBICAP_PROTECTION_MV_PRESENT 0x0001L -#define KS_VBICAP_PROTECTION_MV_HARDWARE 0x0002L -#define KS_VBICAP_PROTECTION_MV_DETECTED 0x0004L - - -/***************************************************************************/ -/* VBI Related GUIDs, structs and properties for codecs(generic, cc, nabts)*/ -/***************************************************************************/ - -/////////////////////////////////////////////////////////////////////////////////////// -// IP/NABTS Protocol Reserved Group IDs - Overall Range 0x800-0x8FF [Decimal 2048-2079] -// Intervening values(0-F) are used if there are multiple providers at a particular tier -/////////////////////////////////////////////////////////////////////////////////////// - -// Used by individual content creators in show footage/data -#define KS_NABTS_GROUPID_ORIGINAL_CONTENT_BASE 0x800 -#define KS_NABTS_GROUPID_ORIGINAL_CONTENT_ADVERTISER_BASE 0x810 - -// Used by production company in finished show data -#define KS_NABTS_GROUPID_PRODUCTION_COMPANY_CONTENT_BASE 0x820 -#define KS_NABTS_GROUPID_PRODUCTION_COMPANY_ADVERTISER_BASE 0x830 - -// Used by broadcast syndicates in syndicated show data -#define KS_NABTS_GROUPID_SYNDICATED_SHOW_CONTENT_BASE 0x840 -#define KS_NABTS_GROUPID_SYNDICATED_SHOW_ADVERTISER_BASE 0x850 - -// Used by tv networks in network television data -#define KS_NABTS_GROUPID_NETWORK_WIDE_CONTENT_BASE 0x860 -#define KS_NABTS_GROUPID_NETWORK_WIDE_ADVERTISER_BASE 0x870 - -// Used by telvision stations in local programming data -#define KS_NABTS_GROUPID_TELEVISION_STATION_CONTENT_BASE 0x880 -#define KS_NABTS_GROUPID_TELEVISION_STATION_ADVERTISER_BASE 0x890 - -// Used by cable system in cable head-end originated data -#define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_CONTENT_BASE 0x8A0 -#define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_ADVERTISER_BASE 0x8B0 - -// The values between 0x8C0 - 0x8EF are reserved for future expansion - -// Used by Microsoft for Testing purposes (0x8F0 - 0x8FF) -#define KS_NABTS_GROUPID_MICROSOFT_RESERVED_TEST_DATA_BASE 0x8F0 - -////////////////////////////////////////////////////////////// -// Stream Format FEC-corrected NABTS bundles -////////////////////////////////////////////////////////////// - -#define STATIC_KSDATAFORMAT_TYPE_NABTS \ - 0xe757bca0, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("E757BCA0-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_TYPE_NABTS); -#define KSDATAFORMAT_TYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_NABTS) - -#define STATIC_KSDATAFORMAT_SUBTYPE_NABTS_FEC \ - 0xe757bca1, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("E757BCA1-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_SUBTYPE_NABTS_FEC); -#define KSDATAFORMAT_SUBTYPE_NABTS_FEC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS_FEC) - - -////////////////////////////////////////////////////////////// -// NABTS Bundle data structure definition -////////////////////////////////////////////////////////////// - -#define MAX_NABTS_VBI_LINES_PER_FIELD 11 -#define NABTS_LINES_PER_BUNDLE 16 -#define NABTS_PAYLOAD_PER_LINE 28 -#define NABTS_BYTES_PER_LINE 36 - -typedef struct _NABTSFEC_BUFFER { - ULONG dataSize; - USHORT groupID; - USHORT Reserved; - UCHAR data[NABTS_LINES_PER_BUNDLE * NABTS_PAYLOAD_PER_LINE]; -} NABTSFEC_BUFFER, *PNABTSFEC_BUFFER; - -////////////////////////////////////////////////////////////// -// vbi codec filtering pin properties -////////////////////////////////////////////////////////////// - -#define STATIC_KSPROPSETID_VBICodecFiltering \ - 0xcafeb0caL, 0x8715, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0xc0, 0xed, 0xba, 0xbe -DEFINE_GUIDSTRUCT("cafeb0ca-8715-11d0-bd6a-0035c0edbabe", KSPROPSETID_VBICodecFiltering); -#define KSPROPSETID_VBICodecFiltering DEFINE_GUIDNAMED(KSPROPSETID_VBICodecFiltering) - -typedef enum { - KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY = 0x01, - KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_STATISTICS, -} KSPROPERTY_VBICODECFILTERING; - -typedef struct _VBICODECFILTERING_SCANLINES { - DWORD DwordBitArray[32]; // An array of scanline bits 0..1024(32*32) -} VBICODECFILTERING_SCANLINES, *PVBICODECFILTERING_SCANLINES; - -typedef struct _VBICODECFILTERING_NABTS_SUBSTREAMS { - DWORD SubstreamMask[128]; // An array of 4096 bits (one for each NABTS GroupID) -} VBICODECFILTERING_NABTS_SUBSTREAMS, *PVBICODECFILTERING_NABTS_SUBSTREAMS; - -typedef struct _VBICODECFILTERING_CC_SUBSTREAMS { - DWORD SubstreamMask; // An array of 32 bits (see KS_CC_SUBSTREAM *) -} VBICODECFILTERING_CC_SUBSTREAMS, *PVBICODECFILTERING_CC_SUBSTREAMS; - -// These KS_CC_SUBSTREAM_* bitmasks are used with VBICODECFILTERING_CC_SUBSTREAMS -#define KS_CC_SUBSTREAM_ODD 0x0001L // Unfiltered Field 1 Data -#define KS_CC_SUBSTREAM_EVEN 0x0002L // Unfiltered Field 2 Data - -// The following flags describe CC field 1 substreams: CC1,CC2,TT1,TT2 -#define KS_CC_SUBSTREAM_FIELD1_MASK 0x00F0L -#define KS_CC_SUBSTREAM_SERVICE_CC1 0x0010L -#define KS_CC_SUBSTREAM_SERVICE_CC2 0x0020L -#define KS_CC_SUBSTREAM_SERVICE_T1 0x0040L -#define KS_CC_SUBSTREAM_SERVICE_T2 0x0080L - -// The following flags describe CC field 2 substreams: CC3,CC4,TT3,TT4,XDS -#define KS_CC_SUBSTREAM_FIELD2_MASK 0x1F00L -#define KS_CC_SUBSTREAM_SERVICE_CC3 0x0100L -#define KS_CC_SUBSTREAM_SERVICE_CC4 0x0200L -#define KS_CC_SUBSTREAM_SERVICE_T3 0x0400L -#define KS_CC_SUBSTREAM_SERVICE_T4 0x0800L -#define KS_CC_SUBSTREAM_SERVICE_XDS 0x1000L - -// Special Note: field 1 or 2 substreams are usually on found on field 1 and 2 respectively -// If the VBI odd/even polarity is reversed, the correct filtered data will still be found. - -/////////////////////////////////////////////////////////////////// -// Hardware decoded CC stream format -/////////////////////////////////////////////////////////////////// - -#define CC_MAX_HW_DECODE_LINES 12 -typedef struct _CC_BYTE_PAIR { - BYTE Decoded[2]; - USHORT Reserved; -} CC_BYTE_PAIR, *PCC_BYTE_PAIR; - -typedef struct _CC_HW_FIELD { - VBICODECFILTERING_SCANLINES ScanlinesRequested; - ULONG fieldFlags; // KS_VBI_FLAG_FIELD1,2 - LONGLONG PictureNumber; - CC_BYTE_PAIR Lines[CC_MAX_HW_DECODE_LINES]; -} CC_HW_FIELD, *PCC_HW_FIELD; - -/////////////////////////////////////////////////////////////////// -// Raw NABTS stream format (TYPE_NABTS, SUBTYPE_NABTS) -/////////////////////////////////////////////////////////////////// - -// These low-level structures are byte packed( -Zp1 ) -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif -typedef struct _NABTS_BUFFER_LINE { - BYTE Confidence; - BYTE Bytes[NABTS_BYTES_PER_LINE]; -} NABTS_BUFFER_LINE, *PNABTS_BUFFER_LINE; - -#define NABTS_BUFFER_PICTURENUMBER_SUPPORT 1 -typedef struct _NABTS_BUFFER { - VBICODECFILTERING_SCANLINES ScanlinesRequested; - LONGLONG PictureNumber; - NABTS_BUFFER_LINE NabtsLines[MAX_NABTS_VBI_LINES_PER_FIELD]; -} NABTS_BUFFER, *PNABTS_BUFFER; -#if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) -#include -#endif - -////////////////////////////////////////////////////////////// -// WST Codec Teletext Media Sample Format -////////////////////////////////////////////////////////////// - -#define WST_TVTUNER_CHANGE_BEGIN_TUNE 0x1000L // Starting a tuning operation -#define WST_TVTUNER_CHANGE_END_TUNE 0x2000L // Ending a tuning operation - -#define MAX_WST_VBI_LINES_PER_FIELD 17 -#define WST_BYTES_PER_LINE 42 - -typedef struct _WST_BUFFER_LINE { - BYTE Confidence; - BYTE Bytes[WST_BYTES_PER_LINE]; -} WST_BUFFER_LINE, *PWST_BUFFER_LINE; - -typedef struct _WST_BUFFER { - VBICODECFILTERING_SCANLINES ScanlinesRequested; - WST_BUFFER_LINE WstLines[MAX_WST_VBI_LINES_PER_FIELD]; -} WST_BUFFER, *PWST_BUFFER; - -// -// Common codec statistics -// - -typedef struct _VBICODECFILTERING_STATISTICS_COMMON { - DWORD InputSRBsProcessed; // upstream SRBs received - DWORD OutputSRBsProcessed; // downstream SRBs sent - DWORD SRBsIgnored; // SRBs ignored due to no requests - DWORD InputSRBsMissing; // SRBs dropped upstream - DWORD OutputSRBsMissing; // Output dropped because no SRB pending - DWORD OutputFailures; // dropped because of other failure - DWORD InternalErrors; // could not process due to int. failure - DWORD ExternalErrors; // could not process due to ext. failure - DWORD InputDiscontinuities; // discontinuities received - DWORD DSPFailures; // DSP confidence failure - DWORD TvTunerChanges; // number of received KS_TVTUNER_CHANGE_BEGIN_TUNE and KS_TVTUNER_CHANGE_END_TUNE pairs. - DWORD VBIHeaderChanges; // number of received KS_VBI_FLAG_VBIINFOHEADER_CHANGE - DWORD LineConfidenceAvg; // Average of all DSP confidence results - DWORD BytesOutput; // Bytes sent downstream -} VBICODECFILTERING_STATISTICS_COMMON, *PVBICODECFILTERING_STATISTICS_COMMON; - -typedef struct _VBICODECFILTERING_STATISTICS_COMMON_PIN { - DWORD SRBsProcessed; // SRBs sent/received - DWORD SRBsIgnored; // SRBs ignored due to filtering - DWORD SRBsMissing; // SRBs not sent/received - DWORD InternalErrors; // could not send/receive due to int. failure - DWORD ExternalErrors; // could not send/receive due to ext. failure - DWORD Discontinuities; // discontinuities received/sent - DWORD LineConfidenceAvg; // Average of all DSP confidence results for this pin - DWORD BytesOutput; // Bytes sent downstream -} VBICODECFILTERING_STATISTICS_COMMON_PIN, *PVBICODECFILTERING_STATISTICS_COMMON_PIN; - -// -// Codec-specific statistics - NABTS -// - -typedef struct _VBICODECFILTERING_STATISTICS_NABTS { - VBICODECFILTERING_STATISTICS_COMMON Common; // Generic VBI statistics - DWORD FECBundleBadLines; // Un-FEC-correctable lines - DWORD FECQueueOverflows; // Number of times FEC queue overflowed - DWORD FECCorrectedLines; // Lines CSUM corrected by FEC - DWORD FECUncorrectableLines; // FEC input lines not CSUM correctable - DWORD BundlesProcessed; // Bundles received from FEC - DWORD BundlesSent2IP; // Bundles sent to IP driver - DWORD FilteredLines; // Lines processed and then dropped - // because no one was interested -} VBICODECFILTERING_STATISTICS_NABTS, *PVBICODECFILTERING_STATISTICS_NABTS; - -typedef struct _VBICODECFILTERING_STATISTICS_NABTS_PIN { - VBICODECFILTERING_STATISTICS_COMMON_PIN Common;// Generic VBI pin statistics -} VBICODECFILTERING_STATISTICS_NABTS_PIN, *PVBICODECFILTERING_STATISTICS_NABTS_PIN; - -// -// Codec-specific statistics - Closed Caption -// - -typedef struct _VBICODECFILTERING_STATISTICS_CC { - VBICODECFILTERING_STATISTICS_COMMON Common; // Generic VBI statistics -} VBICODECFILTERING_STATISTICS_CC, *PVBICODECFILTERING_STATISTICS_CC; - - -typedef struct _VBICODECFILTERING_STATISTICS_CC_PIN { - VBICODECFILTERING_STATISTICS_COMMON_PIN Common;// Generic VBI pin statistics -} VBICODECFILTERING_STATISTICS_CC_PIN, *PVBICODECFILTERING_STATISTICS_CC_PIN; - -// -// Codec-specific statistics - Closed Caption -// - -typedef struct _VBICODECFILTERING_STATISTICS_TELETEXT { - VBICODECFILTERING_STATISTICS_COMMON Common; // Generic VBI statistics -} VBICODECFILTERING_STATISTICS_TELETEXT, *PVBICODECFILTERING_STATISTICS_TELETEXT; - -typedef struct _VBICODECFILTERING_STATISTICS_TELETEXT_PIN { - VBICODECFILTERING_STATISTICS_COMMON_PIN Common;// Generic VBI pin statistics -} VBICODECFILTERING_STATISTICS_TELETEXT_PIN, *PVBICODECFILTERING_STATISTICS_TELETEXT_PIN; - -//////////////////////////////////////////////////////////////////////////// -// VBI codec property structures(based on KSPROPERTY_VBICODECFILTERING enum) -//////////////////////////////////////////////////////////////////////////// - -// *** Most codecs support this property -// KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY -// KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY, -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_SCANLINES Scanlines; -} KSPROPERTY_VBICODECFILTERING_SCANLINES_S, *PKSPROPERTY_VBICODECFILTERING_SCANLINES_S; - -// *** NABTS codecs support this property -// KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, -// KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_NABTS_SUBSTREAMS Substreams; -} KSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S, *PKSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S; - -// *** Closed captioning codecs support this property -// KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, -// KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_CC_SUBSTREAMS Substreams; -} KSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S, *PKSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S; - -// *** Most codecs support these versions of the global and pin properties -// KSPROPERTY_VBICODECFILTERING_STATISTICS -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S; - -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON_PIN Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S; - -// *** NABTS codecs support this version of the global and pin properties -// KSPROPERTY_VBICODECFILTERING_STATISTICS -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S; - -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS_PIN Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S; - -// *** Closed captioning codecs support this version of the global and pin properties -// KSPROPERTY_VBICODECFILTERING_STATISTICS - -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S; - -typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC_PIN Statistics; -} KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S; - -// Standard Pin Names for the video capture filter -//=========================================================================== - -#define STATIC_PINNAME_VIDEO_CAPTURE \ - 0xfb6c4281, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -#define STATIC_PINNAME_CAPTURE STATIC_PINNAME_VIDEO_CAPTURE -DEFINE_GUIDSTRUCT("FB6C4281-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CAPTURE); -#define PINNAME_VIDEO_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CAPTURE) -#define PINNAME_CAPTURE PINNAME_VIDEO_CAPTURE - -#define STATIC_PINNAME_VIDEO_CC_CAPTURE \ - 0x1aad8061, 0x12d, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe -#define STATIC_PINNAME_CC_CAPTURE STATIC_PINNAME_VIDEO_CC_CAPTURE -DEFINE_GUIDSTRUCT("1AAD8061-012D-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_CC_CAPTURE); -#define PINNAME_VIDEO_CC_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CC_CAPTURE) - -#define STATIC_PINNAME_VIDEO_NABTS_CAPTURE \ - 0x29703660, 0x498a, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe -#define STATIC_PINNAME_NABTS_CAPTURE STATIC_PINNAME_VIDEO_NABTS_CAPTURE -DEFINE_GUIDSTRUCT("29703660-498A-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_NABTS_CAPTURE); -#define PINNAME_VIDEO_NABTS_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS_CAPTURE) - -#define STATIC_PINNAME_VIDEO_PREVIEW \ - 0xfb6c4282, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -#define STATIC_PINNAME_PREVIEW STATIC_PINNAME_VIDEO_PREVIEW -DEFINE_GUIDSTRUCT("FB6C4282-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_PREVIEW); -#define PINNAME_VIDEO_PREVIEW DEFINE_GUIDNAMED(PINNAME_VIDEO_PREVIEW) -#define PINNAME_PREVIEW PINNAME_VIDEO_PREVIEW - -#define STATIC_PINNAME_VIDEO_ANALOGVIDEOIN \ - 0xfb6c4283, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4283-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_ANALOGVIDEOIN); -#define PINNAME_VIDEO_ANALOGVIDEOIN DEFINE_GUIDNAMED(PINNAME_VIDEO_ANALOGVIDEOIN) - -#define STATIC_PINNAME_VIDEO_VBI \ - 0xfb6c4284, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4284-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VBI); -#define PINNAME_VIDEO_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VBI) - -#define STATIC_PINNAME_VIDEO_VIDEOPORT \ - 0xfb6c4285, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4285-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT); -#define PINNAME_VIDEO_VIDEOPORT DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT) - -#define STATIC_PINNAME_VIDEO_NABTS \ - 0xfb6c4286, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4286-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_NABTS); -#define PINNAME_VIDEO_NABTS DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS) - -#define STATIC_PINNAME_VIDEO_EDS \ - 0xfb6c4287, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4287-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_EDS); -#define PINNAME_VIDEO_EDS DEFINE_GUIDNAMED(PINNAME_VIDEO_EDS) - -#define STATIC_PINNAME_VIDEO_TELETEXT \ - 0xfb6c4288, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4288-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TELETEXT); -#define PINNAME_VIDEO_TELETEXT DEFINE_GUIDNAMED(PINNAME_VIDEO_TELETEXT) - -#define STATIC_PINNAME_VIDEO_CC \ - 0xfb6c4289, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4289-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CC); -#define PINNAME_VIDEO_CC DEFINE_GUIDNAMED(PINNAME_VIDEO_CC) - -#define STATIC_PINNAME_VIDEO_STILL \ - 0xfb6c428A, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428A-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_STILL); -#define PINNAME_VIDEO_STILL DEFINE_GUIDNAMED(PINNAME_VIDEO_STILL) - -#define STATIC_PINNAME_VIDEO_TIMECODE \ - 0xfb6c428B, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428B-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TIMECODE); -#define PINNAME_VIDEO_TIMECODE DEFINE_GUIDNAMED(PINNAME_VIDEO_TIMECODE) - -#define STATIC_PINNAME_VIDEO_VIDEOPORT_VBI \ - 0xfb6c428C, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428C-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT_VBI); -#define PINNAME_VIDEO_VIDEOPORT_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT_VBI) - -//=========================================================================== -// KSSTREAM_HEADER extensions for digital video -//=========================================================================== - -#define KS_VIDEO_FLAG_FRAME 0x0000L // Frame or Field (default is frame) -#define KS_VIDEO_FLAG_FIELD1 0x0001L -#define KS_VIDEO_FLAG_FIELD2 0x0002L - -#define KS_VIDEO_FLAG_I_FRAME 0x0000L // I, B, or P (default is I) -#define KS_VIDEO_FLAG_P_FRAME 0x0010L -#define KS_VIDEO_FLAG_B_FRAME 0x0020L - -typedef struct tagKS_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // Field1, Field2, or Frame - LONGLONG PictureNumber; - LONGLONG DropCount; - - // The following are only set when using OverlayMixer - HANDLE hDirectDraw; // user mode DDraw handle - HANDLE hSurfaceHandle; // user mode surface handle - RECT DirectDrawRect; // portion of surface locked - // Reserved fields, never reference these - DWORD Reserved1; - DWORD Reserved2; - DWORD Reserved3; - DWORD Reserved4; -} KS_FRAME_INFO, *PKS_FRAME_INFO; - -//=========================================================================== -// KSSTREAM_HEADER extensions for VBI -//=========================================================================== - -#define KS_VBI_FLAG_FIELD1 0x0001L -#define KS_VBI_FLAG_FIELD2 0x0002L - -#define KS_VBI_FLAG_MV_PRESENT 0x0100L -#define KS_VBI_FLAG_MV_HARDWARE 0x0200L -#define KS_VBI_FLAG_MV_DETECTED 0x0400L - -#define KS_VBI_FLAG_TVTUNER_CHANGE 0x0010L // TvTunerChangeInfo is valid -#define KS_VBI_FLAG_VBIINFOHEADER_CHANGE 0x0020L // VBIInfoHeader is valid - -typedef struct tagKS_VBI_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // Field1, Field2, or Frame; & etc - LONGLONG PictureNumber; // Test only? - LONGLONG DropCount; // Test only? - DWORD dwSamplingFrequency; - KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo; - KS_VBIINFOHEADER VBIInfoHeader; -} KS_VBI_FRAME_INFO, *PKS_VBI_FRAME_INFO; - - -//=========================================================================== -// Analog video formats, used with: -// Analog Video Decoders -// TVTuners -// Analog Video Encoders -// -// XXX_STANDARDS_SUPPORTED returns a bitmask -//=========================================================================== - -typedef enum -{ - KS_AnalogVideo_None = 0x00000000, // This is a digital sensor - KS_AnalogVideo_NTSC_M = 0x00000001, // 75 IRE Setup - KS_AnalogVideo_NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup - KS_AnalogVideo_NTSC_433 = 0x00000004, - - KS_AnalogVideo_PAL_B = 0x00000010, - KS_AnalogVideo_PAL_D = 0x00000020, - KS_AnalogVideo_PAL_G = 0x00000040, - KS_AnalogVideo_PAL_H = 0x00000080, - KS_AnalogVideo_PAL_I = 0x00000100, - KS_AnalogVideo_PAL_M = 0x00000200, - KS_AnalogVideo_PAL_N = 0x00000400, - - KS_AnalogVideo_PAL_60 = 0x00000800, - - KS_AnalogVideo_SECAM_B = 0x00001000, - KS_AnalogVideo_SECAM_D = 0x00002000, - KS_AnalogVideo_SECAM_G = 0x00004000, - KS_AnalogVideo_SECAM_H = 0x00008000, - KS_AnalogVideo_SECAM_K = 0x00010000, - KS_AnalogVideo_SECAM_K1 = 0x00020000, - KS_AnalogVideo_SECAM_L = 0x00040000, - KS_AnalogVideo_SECAM_L1 = 0x00080000, - - KS_AnalogVideo_PAL_N_COMBO - = 0x00100000 -} KS_AnalogVideoStandard; - -#define KS_AnalogVideo_NTSC_Mask 0x00000007 -#define KS_AnalogVideo_PAL_Mask 0x00100FF0 -#define KS_AnalogVideo_SECAM_Mask 0x000FF000 - -//=========================================================================== -// Property set definitions -// The comments show whether a given property is: -// R : READ only -// w : WRITE only -// RW : READ / WRITE -// O : Optional (return E_UNSUPPORTED if you don't handle this) -//=========================================================================== - -#define STATIC_PROPSETID_ALLOCATOR_CONTROL\ - 0x53171960, 0x148e, 0x11d2, 0x99, 0x79, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("53171960-148E-11d2-9979-0000C0CC16BA", PROPSETID_ALLOCATOR_CONTROL); -#define PROPSETID_ALLOCATOR_CONTROL DEFINE_GUIDNAMED(PROPSETID_ALLOCATOR_CONTROL) -typedef enum { - KSPROPERTY_ALLOCATOR_CONTROL_HONOR_COUNT, // R O (will allocate exactly this number of buffers) - KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE, // R O (return 2 DWORDs specifying surface size) - // W I (informn a capture driver whether interleave capture is possible or - // not - a value of 1 means that interleaved capture is supported) - KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS, - - // R O (if value == 1, then the ovmixer will turn on the DDVP_INTERLEAVE - // flag thus allowing interleaved capture of the video) - KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE, -} KSPROPERTY_ALLOCATOR_CONTROL; - -typedef struct { - //KSPROPERTY Property; - ULONG CX; - ULONG CY; -} KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE_S, *PKSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE_S; - -typedef struct { - //KSPROPERTY Property; - ULONG InterleavedCapSupported; -} KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS_S, *PKSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS_S; - - -typedef struct { - //KSPROPERTY Property; - ULONG InterleavedCapPossible; -} KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE_S, *PKSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE_S; - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_VIDEOPROCAMP\ - 0xC6E13360L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13360-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOPROCAMP); -#define PROPSETID_VIDCAP_VIDEOPROCAMP DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOPROCAMP) - -typedef enum { - KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS, // RW O - KSPROPERTY_VIDEOPROCAMP_CONTRAST, // RW O - KSPROPERTY_VIDEOPROCAMP_HUE, // RW O - KSPROPERTY_VIDEOPROCAMP_SATURATION, // RW O - KSPROPERTY_VIDEOPROCAMP_SHARPNESS, // RW O - KSPROPERTY_VIDEOPROCAMP_GAMMA, // RW O - KSPROPERTY_VIDEOPROCAMP_COLORENABLE, // RW O - KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, // RW O - KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION,// RW O - KSPROPERTY_VIDEOPROCAMP_GAIN, // RW O -} KSPROPERTY_VIDCAP_VIDEOPROCAMP; - -typedef struct { - KSPROPERTY Property; - LONG Value; // Value to set or get - ULONG Flags; // KSPROPERTY_VIDEOPROCAMP_FLAGS_* - ULONG Capabilities; // KSPROPERTY_VIDEOPROCAMP_FLAGS_* -} KSPROPERTY_VIDEOPROCAMP_S, *PKSPROPERTY_VIDEOPROCAMP_S; - -#define KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO 0X0001L -#define KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL 0X0002L - -//=========================================================================== - -#define STATIC_PROPSETID_TUNER\ - 0x6a2e0605L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0605-28e4-11d0-a18c-00a0c9118956", PROPSETID_TUNER); -#define PROPSETID_TUNER DEFINE_GUIDNAMED(PROPSETID_TUNER) - -typedef enum { - KSPROPERTY_TUNER_CAPS, // R -overall device capabilities - KSPROPERTY_TUNER_MODE_CAPS, // R -capabilities in this mode - KSPROPERTY_TUNER_MODE, // RW -set a mode (TV, FM, AM, DSS) - KSPROPERTY_TUNER_STANDARD, // R -get TV standard (only if TV mode) - KSPROPERTY_TUNER_FREQUENCY, // RW -set/get frequency - KSPROPERTY_TUNER_INPUT, // RW -select an input - KSPROPERTY_TUNER_STATUS, // R -tuning status - KSPROPERTY_TUNER_IF_MEDIUM // R O-Medium for IF or Transport Pin -} KSPROPERTY_TUNER; - -typedef enum { - KSPROPERTY_TUNER_MODE_TV = 0X0001, - KSPROPERTY_TUNER_MODE_FM_RADIO = 0X0002, - KSPROPERTY_TUNER_MODE_AM_RADIO = 0X0004, - KSPROPERTY_TUNER_MODE_DSS = 0X0008, - KSPROPERTY_TUNER_MODE_ATSC = 0X0010, // also used for DVB-T, DVB-C -} KSPROPERTY_TUNER_MODES; - -// Describes how the device tunes. Only one of these flags may be set -// in KSPROPERTY_TUNER_MODE_CAPS_S.Strategy - -// Describe how the driver should attempt to tune: -// EXACT: just go to the frequency specified (no fine tuning) -// FINE: (slow) do an exhaustive search for the best signal -// COARSE: (fast) use larger frequency jumps to just determine if any signal - -typedef enum { - KS_TUNER_TUNING_EXACT = 1, // No fine tuning - KS_TUNER_TUNING_FINE, // Fine grained search - KS_TUNER_TUNING_COARSE, // Coarse search -}KS_TUNER_TUNING_FLAGS; - -typedef enum { - KS_TUNER_STRATEGY_PLL = 0X01, // Tune by PLL offset - KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0X02, // Tune by signal strength - KS_TUNER_STRATEGY_DRIVER_TUNES = 0X04, // Driver does fine tuning -}KS_TUNER_STRATEGY; - -typedef struct { - KSPROPERTY Property; - ULONG ModesSupported; // KS_PROPERTY_TUNER_MODES_* - KSPIN_MEDIUM VideoMedium; // GUID_NULL (no pin), or GUID - KSPIN_MEDIUM TVAudioMedium; // GUID_NULL (no pin), or GUID - KSPIN_MEDIUM RadioAudioMedium; // GUID_NULL (no pin), or GUID -} KSPROPERTY_TUNER_CAPS_S, *PKSPROPERTY_TUNER_CAPS_S; - -typedef struct { - KSPROPERTY Property; - KSPIN_MEDIUM IFMedium; // GUID_NULL (no pin), or GUID -} KSPROPERTY_TUNER_IF_MEDIUM_S, *PKSPROPERTY_TUNER_IF_MEDIUM_S; - -typedef struct { - KSPROPERTY Property; - ULONG Mode; // IN: KSPROPERTY_TUNER_MODE - ULONG StandardsSupported; // KS_AnalogVideo_* (if TV or DSS) - ULONG MinFrequency; // Hz - ULONG MaxFrequency; // Hz - ULONG TuningGranularity; // Hz - ULONG NumberOfInputs; // count of inputs - ULONG SettlingTime; // milliSeconds - ULONG Strategy; // KS_TUNER_STRATEGY -} KSPROPERTY_TUNER_MODE_CAPS_S, *PKSPROPERTY_TUNER_MODE_CAPS_S; - -typedef struct { - KSPROPERTY Property; - ULONG Mode; // IN: KSPROPERTY_TUNER_MODE -} KSPROPERTY_TUNER_MODE_S, *PKSPROPERTY_TUNER_MODE_S; - -typedef struct { - KSPROPERTY Property; - ULONG Frequency; // Hz - ULONG LastFrequency; // Hz (last known good) - ULONG TuningFlags; // KS_TUNER_TUNING_FLAGS - ULONG VideoSubChannel; // DSS - ULONG AudioSubChannel; // DSS - ULONG Channel; // VBI decoders - ULONG Country; // VBI decoders -} KSPROPERTY_TUNER_FREQUENCY_S, *PKSPROPERTY_TUNER_FREQUENCY_S; - -typedef struct { - KSPROPERTY Property; - ULONG Standard; // KS_AnalogVideo_* -} KSPROPERTY_TUNER_STANDARD_S, *PKSPROPERTY_TUNER_STANDARD_S; - -typedef struct { - KSPROPERTY Property; - ULONG InputIndex; // 0 to (n-1) inputs -} KSPROPERTY_TUNER_INPUT_S, *PKSPROPERTY_TUNER_INPUT_S; - -typedef struct { - KSPROPERTY Property; - ULONG CurrentFrequency; // Hz - ULONG PLLOffset; // if Strategy.KS_TUNER_STRATEGY_PLL - ULONG SignalStrength; // if Stretegy.KS_TUNER_STRATEGY_SIGNAL_STRENGTH - ULONG Busy; // TRUE if in the process of tuning -} KSPROPERTY_TUNER_STATUS_S, *PKSPROPERTY_TUNER_STATUS_S; - -#define STATIC_EVENTSETID_TUNER\ - 0x6a2e0606L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0606-28e4-11d0-a18c-00a0c9118956", EVENTSETID_TUNER); -#define EVENTSETID_TUNER DEFINE_GUIDNAMED(EVENTSETID_TUNER) - -typedef enum { - KSEVENT_TUNER_CHANGED -} KSEVENT_TUNER; - - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_VIDEOENCODER\ - 0x6a2e0610L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0610-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOENCODER); -#define PROPSETID_VIDCAP_VIDEOENCODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOENCODER) - -typedef enum { - KSPROPERTY_VIDEOENCODER_CAPS, // R - KSPROPERTY_VIDEOENCODER_STANDARD, // RW - KSPROPERTY_VIDEOENCODER_COPYPROTECTION, // RW O - KSPROPERTY_VIDEOENCODER_CC_ENABLE, // RW O -} KSPROPERTY_VIDCAP_VIDEOENCODER; - -typedef struct { - KSPROPERTY Property; - LONG Value; // value to get or set - ULONG Flags; // - ULONG Capabilities; // -} KSPROPERTY_VIDEOENCODER_S, *PKSPROPERTY_VIDEOENCODER_S; - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_VIDEODECODER\ - 0xC6E13350L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13350-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEODECODER); -#define PROPSETID_VIDCAP_VIDEODECODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEODECODER) - -typedef enum { - KSPROPERTY_VIDEODECODER_CAPS, // R - KSPROPERTY_VIDEODECODER_STANDARD, // RW - KSPROPERTY_VIDEODECODER_STATUS, // R - KSPROPERTY_VIDEODECODER_OUTPUT_ENABLE, // Rw O - KSPROPERTY_VIDEODECODER_VCR_TIMING, // RW O -} KSPROPERTY_VIDCAP_VIDEODECODER; - -typedef enum { - KS_VIDEODECODER_FLAGS_CAN_DISABLE_OUTPUT = 0X0001, // VP Output can tri-stae - KS_VIDEODECODER_FLAGS_CAN_USE_VCR_LOCKING = 0X0002, // VCR PLL timings - KS_VIDEODECODER_FLAGS_CAN_INDICATE_LOCKED = 0X0004, // Can indicate valid signal -}KS_VIDEODECODER_FLAGS; - -typedef struct { - KSPROPERTY Property; - ULONG StandardsSupported; // KS_AnalogVideo_* - ULONG Capabilities; // KS_VIDEODECODER_FLAGS_* - ULONG SettlingTime; // milliseconds - ULONG HSyncPerVSync; // Number of HSync Pulses per VSync -} KSPROPERTY_VIDEODECODER_CAPS_S, *PKSPROPERTY_VIDEODECODER_CAPS_S; - -typedef struct { - KSPROPERTY Property; - ULONG NumberOfLines; // 525 or 625 lines detected - ULONG SignalLocked; // TRUE if signal is locked -} KSPROPERTY_VIDEODECODER_STATUS_S, *PKSPROPERTY_VIDEODECODER_STATUS_S; - -typedef struct { - KSPROPERTY Property; - ULONG Value; // Get or set a value -} KSPROPERTY_VIDEODECODER_S, *PKSPROPERTY_VIDEODECODER_S; - -#define STATIC_EVENTSETID_VIDEODECODER\ - 0x6a2e0621L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0621-28e4-11d0-a18c-00a0c9118956", EVENTSETID_VIDEODECODER); -#define EVENTSETID_VIDEODECODER DEFINE_GUIDNAMED(EVENTSETID_VIDEODECODER) - -typedef enum { - KSEVENT_VIDEODECODER_CHANGED -} KSEVENT_VIDEODECODER; - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_CAMERACONTROL\ - 0xC6E13370L, 0x30AC, 0x11d0, 0xa1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13370-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_CAMERACONTROL); -#define PROPSETID_VIDCAP_CAMERACONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CAMERACONTROL) - -typedef enum { - KSPROPERTY_CAMERACONTROL_PAN, // RW O - KSPROPERTY_CAMERACONTROL_TILT, // RW O - KSPROPERTY_CAMERACONTROL_ROLL, // RW O - KSPROPERTY_CAMERACONTROL_ZOOM, // RW O - KSPROPERTY_CAMERACONTROL_EXPOSURE, // RW O - KSPROPERTY_CAMERACONTROL_IRIS, // RW O - KSPROPERTY_CAMERACONTROL_FOCUS, // RW O -} KSPROPERTY_VIDCAP_CAMERACONTROL; - -typedef struct { - KSPROPERTY Property; - LONG Value; // value to get or set - ULONG Flags; // KSPROPERTY_CAMERACONTROL_FLAGS_* - ULONG Capabilities; // KSPROPERTY_CAMERACONTROL_FLAGS_* -} KSPROPERTY_CAMERACONTROL_S, *PKSPROPERTY_CAMERACONTROL_S; - -#define KSPROPERTY_CAMERACONTROL_FLAGS_AUTO 0X0001L -#define KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL 0X0002L - -#define KSPROPERTY_CAMERACONTROL_FLAGS_ABSOLUTE 0X0000L -#define KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE 0X0010L - - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_CROSSBAR\ - 0x6a2e0640L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0640-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_CROSSBAR); -#define PROPSETID_VIDCAP_CROSSBAR DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CROSSBAR) - -typedef enum { - KSPROPERTY_CROSSBAR_CAPS, // R - KSPROPERTY_CROSSBAR_PININFO, // R - KSPROPERTY_CROSSBAR_CAN_ROUTE, // R - KSPROPERTY_CROSSBAR_ROUTE, // RW -} KSPROPERTY_VIDCAP_CROSSBAR; - -typedef struct { - KSPROPERTY Property; - ULONG NumberOfInputs; // the number of audio and video input pins - ULONG NumberOfOutputs; // the number of audio and video output pins -} KSPROPERTY_CROSSBAR_CAPS_S, *PKSPROPERTY_CROSSBAR_CAPS_S; - -typedef struct { - KSPROPERTY Property; - KSPIN_DATAFLOW Direction; // KSPIN_DATAFLOW_IN or KSPIN_DATAFLOW_OUT? - ULONG Index; // Which pin to return data for? - ULONG PinType; // KS_PhysConn_Video_* or KS_PhysConn_Audio_* - ULONG RelatedPinIndex; // For video pins, this is the related audio pin - KSPIN_MEDIUM Medium; // Identifies the hardware connection -} KSPROPERTY_CROSSBAR_PININFO_S, *PKSPROPERTY_CROSSBAR_PININFO_S; - -typedef struct { - KSPROPERTY Property; - ULONG IndexInputPin; // Zero based index of the input pin - ULONG IndexOutputPin; // Zero based index of the output pin - ULONG CanRoute; // returns non-zero on CAN_ROUTE if routing is possible -} KSPROPERTY_CROSSBAR_ROUTE_S, *PKSPROPERTY_CROSSBAR_ROUTE_S; - -#define STATIC_EVENTSETID_CROSSBAR\ - 0x6a2e0641L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0641-28e4-11d0-a18c-00a0c9118956", EVENTSETID_CROSSBAR); -#define EVENTSETID_CROSSBAR DEFINE_GUIDNAMED(EVENTSETID_CROSSBAR) - -typedef enum { - KSEVENT_CROSSBAR_CHANGED -} KSEVENT_CROSSBAR; - -// The following IDs should match the AM equivalents -typedef enum { - KS_PhysConn_Video_Tuner = 1, - KS_PhysConn_Video_Composite, - KS_PhysConn_Video_SVideo, - KS_PhysConn_Video_RGB, - KS_PhysConn_Video_YRYBY, - KS_PhysConn_Video_SerialDigital, - KS_PhysConn_Video_ParallelDigital, - KS_PhysConn_Video_SCSI, - KS_PhysConn_Video_AUX, - KS_PhysConn_Video_1394, - KS_PhysConn_Video_USB, - KS_PhysConn_Video_VideoDecoder, - KS_PhysConn_Video_VideoEncoder, - KS_PhysConn_Video_SCART, - - KS_PhysConn_Audio_Tuner = 4096, - KS_PhysConn_Audio_Line, - KS_PhysConn_Audio_Mic, - KS_PhysConn_Audio_AESDigital, - KS_PhysConn_Audio_SPDIFDigital, - KS_PhysConn_Audio_SCSI, - KS_PhysConn_Audio_AUX, - KS_PhysConn_Audio_1394, - KS_PhysConn_Audio_USB, - KS_PhysConn_Audio_AudioDecoder, -} KS_PhysicalConnectorType; - - -//=========================================================================== - -#define STATIC_PROPSETID_VIDCAP_TVAUDIO\ - 0x6a2e0650L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0650-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_TVAUDIO); -#define PROPSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(PROPSETID_VIDCAP_TVAUDIO) - -typedef enum { - KSPROPERTY_TVAUDIO_CAPS, // R - KSPROPERTY_TVAUDIO_MODE, // RW - KSPROPERTY_TVAUDIO_CURRENTLY_AVAILABLE_MODES // R -} KSPROPERTY_VIDCAP_TVAUDIO; - -#define KS_TVAUDIO_MODE_MONO 0x0001 // Mono -#define KS_TVAUDIO_MODE_STEREO 0x0002 // Stereo -#define KS_TVAUDIO_MODE_LANG_A 0x0010 // Primary language -#define KS_TVAUDIO_MODE_LANG_B 0x0020 // 2nd avail language -#define KS_TVAUDIO_MODE_LANG_C 0x0040 // 3rd avail language - -typedef struct { - KSPROPERTY Property; - ULONG Capabilities; // Bitmask of KS_TVAUDIO_MODE_* - KSPIN_MEDIUM InputMedium; - KSPIN_MEDIUM OutputMedium; -} KSPROPERTY_TVAUDIO_CAPS_S, *PKSPROPERTY_TVAUDIO_CAPS_S; - -typedef struct { - KSPROPERTY Property; - ULONG Mode; // KS_TVAUDIO_MODE_* -} KSPROPERTY_TVAUDIO_S, *PKSPROPERTY_TVAUDIO_S; - - -#define STATIC_KSEVENTSETID_VIDCAP_TVAUDIO\ - 0x6a2e0651L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0651-28e4-11d0-a18c-00a0c9118956", KSEVENTSETID_VIDCAP_TVAUDIO); -#define KSEVENTSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAP_TVAUDIO) - -typedef enum { - KSEVENT_TVAUDIO_CHANGED, -} KSEVENT_TVAUDIO; - -//=========================================================================== -#define STATIC_PROPSETID_VIDCAP_VIDEOCOMPRESSION\ - 0xC6E13343L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13343-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOCOMPRESSION); -#define PROPSETID_VIDCAP_VIDEOCOMPRESSION DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCOMPRESSION) - -typedef enum { - KSPROPERTY_VIDEOCOMPRESSION_GETINFO, // R - KSPROPERTY_VIDEOCOMPRESSION_KEYFRAME_RATE, // RW - KSPROPERTY_VIDEOCOMPRESSION_PFRAMES_PER_KEYFRAME, // RW - KSPROPERTY_VIDEOCOMPRESSION_QUALITY, // RW - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_KEYFRAME, // W - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_FRAME_SIZE, // W - KSPROPERTY_VIDEOCOMPRESSION_WINDOWSIZE, // RW -} KSPROPERTY_VIDCAP_VIDEOCOMPRESSION; - -typedef enum { - KS_CompressionCaps_CanQuality = 1, - KS_CompressionCaps_CanCrunch = 2, - KS_CompressionCaps_CanKeyFrame = 4, - KS_CompressionCaps_CanBFrame = 8, - KS_CompressionCaps_CanWindow = 0x10, -} KS_CompressionCaps; - -typedef struct { - KSPROPERTY Property; - // Note, no VersionString! - // Note, no DescriptionString! - ULONG StreamIndex; // zero based index of stream - LONG DefaultKeyFrameRate; // Key frame rate - LONG DefaultPFrameRate; // Predeicted frames per Key frame - LONG DefaultQuality; // 0 to 10000 - LONG NumberOfQualitySettings; // How many discreet quality settings? - LONG Capabilities; // KS_CompressionCaps_* -} KSPROPERTY_VIDEOCOMPRESSION_GETINFO_S, *PKSPROPERTY_VIDEOCOMPRESSION_GETINFO_S; - -typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // zero based index of stream - LONG Value; // value to get or set -} KSPROPERTY_VIDEOCOMPRESSION_S, *PKSPROPERTY_VIDEOCOMPRESSION_S; - -//=========================================================================== -// MEDIASUBTYPE_Overlay -#define STATIC_KSDATAFORMAT_SUBTYPE_OVERLAY\ - 0xe436eb7fL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb7f-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_OVERLAY); -#define KSDATAFORMAT_SUBTYPE_OVERLAY DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_OVERLAY) - -#define STATIC_KSPROPSETID_OverlayUpdate\ - 0x490EA5CFL, 0x7681, 0x11D1, 0xA2, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("490EA5CF-7681-11D1-A21C-00A0C9223196", KSPROPSETID_OverlayUpdate); -#define KSPROPSETID_OverlayUpdate DEFINE_GUIDNAMED(KSPROPSETID_OverlayUpdate) - -typedef enum { - KSPROPERTY_OVERLAYUPDATE_INTERESTS, - KSPROPERTY_OVERLAYUPDATE_CLIPLIST = 0x1, - KSPROPERTY_OVERLAYUPDATE_PALETTE = 0x2, - KSPROPERTY_OVERLAYUPDATE_COLORKEY = 0x4, - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION = 0x8, - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE = 0x10, - KSPROPERTY_OVERLAYUPDATE_COLORREF = 0x10000000 -} KSPROPERTY_OVERLAYUPDATE; - -typedef struct { - ULONG PelsWidth; - ULONG PelsHeight; - ULONG BitsPerPel; - WCHAR DeviceID[1]; -} KSDISPLAYCHANGE, *PKSDISPLAYCHANGE; - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_INTERESTS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_INTERESTS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_PALETTE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_PALETTE,\ - NULL,\ - sizeof(KSPROPERTY),\ - 0,\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORKEY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_COLORKEY,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(COLORKEY),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_CLIPLIST(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_CLIPLIST,\ - NULL,\ - sizeof(KSPROPERTY),\ - 2 * sizeof(RECT) + sizeof(RGNDATAHEADER),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_VIDEOPOSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION,\ - NULL,\ - sizeof(KSPROPERTY),\ - 2 * sizeof(RECT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_DISPLAYCHANGE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSDISPLAYCHANGE),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORREF(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_COLORREF,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(COLORREF),\ - NULL,\ - NULL, 0, NULL, NULL, 0) - -//=========================================================================== -#define STATIC_PROPSETID_VIDCAP_VIDEOCONTROL\ - 0x6a2e0670L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0670-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOCONTROL); -#define PROPSETID_VIDCAP_VIDEOCONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCONTROL) - -typedef enum { - KSPROPERTY_VIDEOCONTROL_CAPS, // R - KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE, // R O - KSPROPERTY_VIDEOCONTROL_FRAME_RATES, // R O - KSPROPERTY_VIDEOCONTROL_MODE, // RWO -} KSPROPERTY_VIDCAP_VIDEOCONTROL; - -typedef enum { - KS_VideoControlFlag_FlipHorizontal = 0x0001, - KS_VideoControlFlag_FlipVertical = 0x0002, - KS_Obsolete_VideoControlFlag_ExternalTriggerEnable = 0x0010, // ***WARNING *** Flag msimatch with DSHOW. - KS_Obsolete_VideoControlFlag_Trigger = 0x0020, // ***WARNING *** Flag msimatch with DSHOW. - KS_VideoControlFlag_ExternalTriggerEnable = 0x0004, - KS_VideoControlFlag_Trigger = 0x0008, -} KS_VideoControlFlags; - -typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; - ULONG VideoControlCaps; // KS_VideoControlFlags_* -} KSPROPERTY_VIDEOCONTROL_CAPS_S, *PKSPROPERTY_VIDEOCONTROL_CAPS_S; - -typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; - LONG Mode; // KS_VideoControlFlags_* -} KSPROPERTY_VIDEOCONTROL_MODE_S, *PKSPROPERTY_VIDEOCONTROL_MODE_S; - -typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG RangeIndex; // Index of range - SIZE Dimensions; // Size of image - LONGLONG CurrentActualFrameRate; // Only correct if pin is open - LONGLONG CurrentMaxAvailableFrameRate; // Max Rate temporarily limited on USB or 1394? -} KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S, *PKSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S; - -// KSPROPERTY_VIDEOCONTROL_FRAME_RATES returns a list of available frame rates in 100 nS units -typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG RangeIndex; // Index of range - SIZE Dimensions; // Size of image -} KSPROPERTY_VIDEOCONTROL_FRAME_RATES_S, *PKSPROPERTY_VIDEOCONTROL_FRAME_RATES_S; - -//=========================================================================== -#define STATIC_PROPSETID_VIDCAP_DROPPEDFRAMES\ - 0xC6E13344L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13344-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_DROPPEDFRAMES); -#define PROPSETID_VIDCAP_DROPPEDFRAMES DEFINE_GUIDNAMED(PROPSETID_VIDCAP_DROPPEDFRAMES) - -typedef enum { - KSPROPERTY_DROPPEDFRAMES_CURRENT // R -} KSPROPERTY_VIDCAP_DROPPEDFRAMES; - -typedef struct { - KSPROPERTY Property; - LONGLONG PictureNumber; // Current Picture Number - LONGLONG DropCount; // Count of frames dropped - ULONG AverageFrameSize; // Average size of frames captured -} KSPROPERTY_DROPPEDFRAMES_CURRENT_S, *PKSPROPERTY_DROPPEDFRAMES_CURRENT_S; - -//=========================================================================== -// VPE - -#define STATIC_KSPROPSETID_VPConfig\ - 0xbc29a660L, 0x30e3, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b -DEFINE_GUIDSTRUCT("bc29a660-30e3-11d0-9e69-00c04fd7c15b", KSPROPSETID_VPConfig); -#define KSPROPSETID_VPConfig DEFINE_GUIDNAMED(KSPROPSETID_VPConfig) - -#define STATIC_KSPROPSETID_VPVBIConfig\ - 0xec529b00L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("ec529b00-1a1f-11d1-bad9-00609744111a", KSPROPSETID_VPVBIConfig); -#define KSPROPSETID_VPVBIConfig DEFINE_GUIDNAMED(KSPROPSETID_VPVBIConfig) - -// Both of the above property sets use the same list of properties below - -typedef enum { - KSPROPERTY_VPCONFIG_NUMCONNECTINFO, - KSPROPERTY_VPCONFIG_GETCONNECTINFO, - KSPROPERTY_VPCONFIG_SETCONNECTINFO, - KSPROPERTY_VPCONFIG_VPDATAINFO, - KSPROPERTY_VPCONFIG_MAXPIXELRATE, - KSPROPERTY_VPCONFIG_INFORMVPINPUT, - KSPROPERTY_VPCONFIG_NUMVIDEOFORMAT, - KSPROPERTY_VPCONFIG_GETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_SETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_INVERTPOLARITY, - KSPROPERTY_VPCONFIG_DECIMATIONCAPABILITY, // E_NOTIMPL for VBI - KSPROPERTY_VPCONFIG_SCALEFACTOR, // E_NOTIMPL for VBI - KSPROPERTY_VPCONFIG_DDRAWHANDLE, - KSPROPERTY_VPCONFIG_VIDEOPORTID, - KSPROPERTY_VPCONFIG_DDRAWSURFACEHANDLE, - KSPROPERTY_VPCONFIG_SURFACEPARAMS -} KSPROPERTY_VPCONFIG; - -//========================= -// IBasicAudio -// -#define STATIC_CLSID_KsIBasicAudioInterfaceHandler\ - 0xb9f8ac3e, 0x0f71, 0x11d2, 0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d -DEFINE_GUIDSTRUCT("b9f8ac3e-0f71-11d2-b72c-00c04fb6bd3d", CLSID_KsIBasicAudioInterfaceHandler); -#define CLSID_KsIBasicAudioInterfaceHandler DEFINE_GUIDNAMED(CLSID_KsIBasicAudioInterfaceHandler) - - -#if defined(__IVPType__) - -typedef struct { - AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; -} KSVPMAXPIXELRATE, *PKSVPMAXPIXELRATE; - -typedef struct { - KSPROPERTY Property; - AMVPSIZE Size; -} KSVPSIZE_PROP, *PKSVPSIZE_PROP; - -typedef struct { - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; -} KSVPSURFACEPARAMS, *PKSVPSURFACEPARAMS; - -#else // !defined(__IVPType__) - -#if !defined(__DDRAW_INCLUDED__) - -//========================================================================== -// The following definitions must be in sync with DDraw.h in DirectX SDK -//========================================================================== - -/* - * The FourCC code is valid. - */ -#define DDPF_FOURCC 0x00000004l - - -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel (BD_1,2,4,8,16,24,32) - DWORD dwYUVBitCount; // how many bits per pixel (BD_4,8,16,24,32) - DWORD dwZBufferBitDepth; // how many bits for z buffers (BD_8,16,24,32) - DWORD dwAlphaBitDepth; // how many bits for alpha channels (BD_1,2,4,8) - }; - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - }; - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - }; - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - }; - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - }; -} DDPIXELFORMAT, * LPDDPIXELFORMAT; - -#endif // !defined(__DDRAW_INCLUDED__) - -//========================================================================== -// End of DDraw.h header info -//========================================================================== - -//========================================================================== -// The following definitions must be in sync with DVP.h in DirectX SDK -//========================================================================== - -#if !defined(__DVP_INCLUDED__) - -typedef struct _DDVIDEOPORTCONNECT { - DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure - DWORD dwPortWidth; // Width of the video port - GUID guidTypeID; // Description of video port connection - DWORD dwFlags; // Connection flags - DWORD dwReserved1; // Reserved, set to zero. -} DDVIDEOPORTCONNECT, * LPDDVIDEOPORTCONNECT; - -#define DDVPTYPE_E_HREFH_VREFH \ - 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 - -#define DDVPTYPE_E_HREFL_VREFL \ - 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 - -#endif // !defined(__DVP_INCLUDED__) - -//========================================================================== -// End of DVP.h header info -//========================================================================== - - -//========================================================================== -// The following definitions must be in sync with VPType.h in AM 2.0 SDK -//========================================================================== - -// pixel aspect ratios corresponding to a 720x480 NTSC image or a 720x576 image -typedef enum // AMPixAspectRatio -{ - KS_PixAspectRatio_NTSC4x3, - KS_PixAspectRatio_NTSC16x9, - KS_PixAspectRatio_PAL4x3, - KS_PixAspectRatio_PAL16x9, -} KS_AMPixAspectRatio ; - -typedef enum // AMVP_SELECTFORMATBY -{ - KS_AMVP_DO_NOT_CARE, - KS_AMVP_BEST_BANDWIDTH, - KS_AMVP_INPUT_SAME_AS_OUTPUT -} KS_AMVP_SELECTFORMATBY; - -typedef enum // AMVP_MODE -{ - KS_AMVP_MODE_WEAVE, - KS_AMVP_MODE_BOBINTERLEAVED, - KS_AMVP_MODE_BOBNONINTERLEAVED, - KS_AMVP_MODE_SKIPEVEN, - KS_AMVP_MODE_SKIPODD -} KS_AMVP_MODE ; - -typedef struct tagKS_AMVPDIMINFO // AMVPDIMINFO -{ - DWORD dwFieldWidth ; // [out] field width - DWORD dwFieldHeight ; // [out] field height - DWORD dwVBIWidth ; // [out] VBI data width - DWORD dwVBIHeight ; // [out] VBI data height - RECT rcValidRegion ; // [out] valid rect for data cropping -} KS_AMVPDIMINFO, *PKS_AMVPDIMINFO ; - -typedef struct tagKS_AMVPDATAINFO // AMVPDATAINFO -{ - DWORD dwSize; // Size of the struct - DWORD dwMicrosecondsPerField; // Time taken by each field - KS_AMVPDIMINFO amvpDimInfo; // Dimensional Information - DWORD dwPictAspectRatioX; // Pict aspect ratio in X dimn - DWORD dwPictAspectRatioY; // Pict aspect ratio in Y dimn - BOOL bEnableDoubleClock; // Videoport should enable double clocking - BOOL bEnableVACT; // Videoport should use an external VACT signal - BOOL bDataIsInterlaced; // Indicates that the signal is interlaced - LONG lHalfLinesOdd; // number of halflines in the odd field - BOOL bFieldPolarityInverted; // Device inverts the polarity by default - DWORD dwNumLinesInVREF; // Number of lines of data in VREF - LONG lHalfLinesEven; // number of halflines in the even field - DWORD dwReserved1; // Reserved for future use -} KS_AMVPDATAINFO, *PKS_AMVPDATAINFO; - -typedef struct tagKS_AMVPSIZE // AMVPSIZE -{ - DWORD dwWidth ; // [in] width in pixels - DWORD dwHeight ; // [in] height in pixels -} KS_AMVPSIZE, *PKS_AMVPSIZE ; - -//========================================================================== -// End of VPType.h header info -//========================================================================== - -typedef struct { - KS_AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; -} KSVPMAXPIXELRATE, *PKSVPMAXPIXELRATE; - -typedef struct { - KSPROPERTY Property; - KS_AMVPSIZE Size; -} KSVPSIZE_PROP, *PKSVPSIZE_PROP; - -typedef struct { - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; -} KSVPSURFACEPARAMS, *PKSVPSURFACEPARAMS; - -#endif // !defined(__IVPType__) - -// -// IVPNotify event notification -// -#define STATIC_KSEVENTSETID_VPNotify\ - 0x20c5598eL, 0xd3c8, 0x11d0, 0x8d, 0xfc, 0x00, 0xc0, 0x4f, 0xd7, 0xc0, 0x8b -DEFINE_GUIDSTRUCT("20c5598e-d3c8-11d0-8dfc-00c04fd7c08b", KSEVENTSETID_VPNotify); -#define KSEVENTSETID_VPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VPNotify) - -typedef enum { - KSEVENT_VPNOTIFY_FORMATCHANGE, -} KSEVENT_VPNOTIFY; - -// -// VIDCAPTOSTI event notification -// -#define STATIC_KSEVENTSETID_VIDCAPTOSTI\ - 0xdb47de20, 0xf628, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5 -DEFINE_GUIDSTRUCT("DB47DE20-F628-11d1-BA41-00A0C90D2B05", KSEVENTSETID_VIDCAPTOSTI); -#define KSEVENTSETID_VIDCAPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAPTOSTI) - -typedef enum { - KSEVENT_VIDCAPTOSTI_EXT_TRIGGER, -} KSEVENT_VIDCAPTOSTI; - - -// -// IVPVBINotify event notification -// -#define STATIC_KSEVENTSETID_VPVBINotify\ - 0xec529b01L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("ec529b01-1a1f-11d1-bad9-00609744111a", KSEVENTSETID_VPVBINotify); -#define KSEVENTSETID_VPVBINotify DEFINE_GUIDNAMED(KSEVENTSETID_VPVBINotify) - -typedef enum { - KSEVENT_VPVBINOTIFY_FORMATCHANGE, -} KSEVENT_VPVBINOTIFY; - - -// -// closed caption information -// - -#define STATIC_KSDATAFORMAT_TYPE_AUXLine21Data \ -0x670aea80L, 0x3a82, 0x11d0, 0xb7, 0x9b, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("670aea80-3a82-11d0-b79b-00aa003767a7", KSDATAFORMAT_TYPE_AUXLine21Data); -#define KSDATAFORMAT_TYPE_AUXLine21Data DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUXLine21Data) - -#define STATIC_KSDATAFORMAT_SUBTYPE_Line21_BytePair \ -0x6e8d4a22L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("6e8d4a22-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_BytePair); -#define KSDATAFORMAT_SUBTYPE_Line21_BytePair DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_BytePair) - -#define STATIC_KSDATAFORMAT_SUBTYPE_Line21_GOPPacket \ -0x6e8d4a23L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("6e8d4a23-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_GOPPacket); -#define KSDATAFORMAT_SUBTYPE_Line21_GOPPacket DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_GOPPacket) - -typedef struct _KSGOP_USERDATA { - ULONG sc; - ULONG reserved1; - BYTE cFields; - CHAR l21Data[3]; -} KSGOP_USERDATA, *PKSGOP_USERDATA; - -// -// DVD encrypted PACK format type definition -// - -#define STATIC_KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK\ - 0xed0b916a, 0x044d, 0x11d1, 0xaa, 0x78, 0x00, 0xc0, 0x4f, 0xc3, 0x1d, 0x60 -DEFINE_GUIDSTRUCT("ed0b916a-044d-11d1-aa78-00c04fc31d60", KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK); -#define KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK) - -#define KS_AM_UseNewCSSKey 0x1 - - -// ----------------------------------------------------------------------- -// KS_AM_KSPROPSETID_TSRateChange property set definitions for time stamp -// rate changes. -// ----------------------------------------------------------------------- - - -#define STATIC_KSPROPSETID_TSRateChange\ - 0xa503c5c0, 0x1d1d, 0x11d1, 0xad, 0x80, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 - -DEFINE_GUIDSTRUCT("A503C5C0-1D1D-11D1-AD80-444553540000", KSPROPSETID_TSRateChange); -#define KSPROPSETID_TSRateChange DEFINE_GUIDNAMED(KSPROPSETID_TSRateChange) -typedef enum { - KS_AM_RATE_SimpleRateChange=1, // rw, use KS_AM_SimpleRateChange - KS_AM_RATE_ExactRateChange=2, // rw, use KS_AM_ExactRateChange - KS_AM_RATE_MaxFullDataRate=3, // r, use KS_AM_MaxFullDataRate - KS_AM_RATE_Step=4 // w, use KS_AM_Step -} KS_AM_PROPERTY_TS_RATE_CHANGE; - -typedef struct { - // this is the simplest mechanism to set a time stamp rate change on - // a filter (simplest for the person setting the rate change, harder - // for the filter doing the rate change). - REFERENCE_TIME StartTime; //stream time at which to start this rate - LONG Rate; //new rate * 10000 (decimal) -} KS_AM_SimpleRateChange, *PKS_AM_SimpleRateChange; - -typedef struct { - REFERENCE_TIME OutputZeroTime; //input TS that maps to zero output TS - LONG Rate; //new rate * 10000 (decimal) -} KS_AM_ExactRateChange, *PKS_AM_ExactRateChange; - -typedef LONG KS_AM_MaxFullDataRate; //rate * 10000 (decimal) - -typedef DWORD KS_AM_Step; // number of frame to step - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - typedef struct { - KSPROPERTY Property; - KSMULTIPLE_ITEM MultipleItem; - } KSMULTIPLE_DATA_PROP, *PKSMULTIPLE_DATA_PROP; - - #define STATIC_KSMEDIUMSETID_MidiBus \ - 0x05908040L, 0x3246, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("05908040-3246-11D0-A5D6-28DB04C10000", KSMEDIUMSETID_MidiBus); - #define KSMEDIUMSETID_MidiBus DEFINE_GUIDNAMED(KSMEDIUMSETID_MidiBus) - - #define STATIC_KSMEDIUMSETID_VPBus \ - 0xA18C15ECL, 0xCE43, 0x11D0, 0xAB, 0xE7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("A18C15EC-CE43-11D0-ABE7-00A0C9223196", KSMEDIUMSETID_VPBus); - #define KSMEDIUMSETID_VPBus DEFINE_GUIDNAMED(KSMEDIUMSETID_VPBus) - - #define STATIC_KSINTERFACESETID_Media \ - 0x3A13EB40L, 0x30A7, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("3A13EB40-30A7-11D0-A5D6-28DB04C10000", KSINTERFACESETID_Media); - #define KSINTERFACESETID_Media DEFINE_GUIDNAMED(KSINTERFACESETID_Media) - - typedef enum { - KSINTERFACE_MEDIA_MUSIC, - KSINTERFACE_MEDIA_WAVE_BUFFERED, - KSINTERFACE_MEDIA_WAVE_QUEUED - } KSINTERFACE_MEDIA; - - - // USB Terminals - #define INIT_USB_TERMINAL(guid, id)\ - {\ - (guid)->Data1 = 0xDFF219E0 + (USHORT)(id);\ - (guid)->Data2 = 0xF70F;\ - (guid)->Data3 = 0x11D0;\ - (guid)->Data4[0] = 0xb9;\ - (guid)->Data4[1] = 0x17;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ - } - #define EXTRACT_USB_TERMINAL(guid)\ - (USHORT)((guid)->Data1 - 0xDFF219E0) - #define DEFINE_USB_TERMINAL_GUID(id)\ - 0xDFF219E0+(USHORT)(id), 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - - #define STATIC_KSNODETYPE_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0201) - DEFINE_GUIDSTRUCT("DFF21BE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE); - #define KSNODETYPE_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE) - - #define STATIC_KSNODETYPE_DESKTOP_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0202) - DEFINE_GUIDSTRUCT("DFF21BE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_MICROPHONE); - #define KSNODETYPE_DESKTOP_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_MICROPHONE) - - #define STATIC_KSNODETYPE_PERSONAL_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0203) - DEFINE_GUIDSTRUCT("DFF21BE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PERSONAL_MICROPHONE); - #define KSNODETYPE_PERSONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_PERSONAL_MICROPHONE) - - #define STATIC_KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0204) - DEFINE_GUIDSTRUCT("DFF21BE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE); - #define KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE) - - #define STATIC_KSNODETYPE_MICROPHONE_ARRAY\ - DEFINE_USB_TERMINAL_GUID(0x0205) - DEFINE_GUIDSTRUCT("DFF21BE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE_ARRAY); - #define KSNODETYPE_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE_ARRAY) - - #define STATIC_KSNODETYPE_PROCESSING_MICROPHONE_ARRAY\ - DEFINE_USB_TERMINAL_GUID(0x0206) - DEFINE_GUIDSTRUCT("DFF21BE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PROCESSING_MICROPHONE_ARRAY); - #define KSNODETYPE_PROCESSING_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_PROCESSING_MICROPHONE_ARRAY) - - #define STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR \ - 0x830a44f2, 0xa32d, 0x476b, 0xbe, 0x97, 0x42, 0x84, 0x56, 0x73, 0xb3, 0x5a - DEFINE_GUIDSTRUCT("830a44f2-a32d-476b-be97-42845673b35a", KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR); - #define KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR DEFINE_GUIDNAMED(KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR) - - #define STATIC_KSNODETYPE_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0301) - DEFINE_GUIDSTRUCT("DFF21CE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKER); - #define KSNODETYPE_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_SPEAKER) - - #define STATIC_KSNODETYPE_HEADPHONES\ - DEFINE_USB_TERMINAL_GUID(0x0302) - DEFINE_GUIDSTRUCT("DFF21CE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADPHONES); - #define KSNODETYPE_HEADPHONES DEFINE_GUIDNAMED(KSNODETYPE_HEADPHONES) - - #define STATIC_KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x0303) - DEFINE_GUIDSTRUCT("DFF21CE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO); - #define KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO) - - #define STATIC_KSNODETYPE_DESKTOP_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0304) - DEFINE_GUIDSTRUCT("DFF21CE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_SPEAKER); - #define KSNODETYPE_DESKTOP_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_SPEAKER) - - #define STATIC_KSNODETYPE_ROOM_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0305) - DEFINE_GUIDSTRUCT("DFF21CE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ROOM_SPEAKER); - #define KSNODETYPE_ROOM_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_ROOM_SPEAKER) - - #define STATIC_KSNODETYPE_COMMUNICATION_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0306) - DEFINE_GUIDSTRUCT("DFF21CE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_COMMUNICATION_SPEAKER); - #define KSNODETYPE_COMMUNICATION_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_COMMUNICATION_SPEAKER) - - #define STATIC_KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER\ - DEFINE_USB_TERMINAL_GUID(0x0307) - DEFINE_GUIDSTRUCT("DFF21CE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER); - #define KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER) - - #define STATIC_KSNODETYPE_HANDSET\ - DEFINE_USB_TERMINAL_GUID(0x0401) - DEFINE_GUIDSTRUCT("DFF21DE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HANDSET); - #define KSNODETYPE_HANDSET DEFINE_GUIDNAMED(KSNODETYPE_HANDSET) - - #define STATIC_KSNODETYPE_HEADSET\ - DEFINE_USB_TERMINAL_GUID(0x0402) - DEFINE_GUIDSTRUCT("DFF21DE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADSET); - #define KSNODETYPE_HEADSET DEFINE_GUIDNAMED(KSNODETYPE_HEADSET) - - #define STATIC_KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION\ - DEFINE_USB_TERMINAL_GUID(0x0403) - DEFINE_GUIDSTRUCT("DFF21DE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION); - #define KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION DEFINE_GUIDNAMED(KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION) - - #define STATIC_KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0404) - DEFINE_GUIDSTRUCT("DFF21DE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE); - #define KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE) - - #define STATIC_KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0405) - DEFINE_GUIDSTRUCT("DFF21DE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE); - #define KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE) - - #define STATIC_KSNODETYPE_PHONE_LINE\ - DEFINE_USB_TERMINAL_GUID(0x0501) - DEFINE_GUIDSTRUCT("DFF21EE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONE_LINE); - #define KSNODETYPE_PHONE_LINE DEFINE_GUIDNAMED(KSNODETYPE_PHONE_LINE) - - #define STATIC_KSNODETYPE_TELEPHONE\ - DEFINE_USB_TERMINAL_GUID(0x0502) - DEFINE_GUIDSTRUCT("DFF21EE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TELEPHONE); - #define KSNODETYPE_TELEPHONE DEFINE_GUIDNAMED(KSNODETYPE_TELEPHONE) - - #define STATIC_KSNODETYPE_DOWN_LINE_PHONE\ - DEFINE_USB_TERMINAL_GUID(0x0503) - DEFINE_GUIDSTRUCT("DFF21EE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DOWN_LINE_PHONE); - #define KSNODETYPE_DOWN_LINE_PHONE DEFINE_GUIDNAMED(KSNODETYPE_DOWN_LINE_PHONE) - - #define STATIC_KSNODETYPE_ANALOG_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x601) - DEFINE_GUIDSTRUCT("DFF21FE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_CONNECTOR); - #define KSNODETYPE_ANALOG_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_CONNECTOR) - - #define STATIC_KSNODETYPE_DIGITAL_AUDIO_INTERFACE\ - DEFINE_USB_TERMINAL_GUID(0x0602) - DEFINE_GUIDSTRUCT("DFF21FE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DIGITAL_AUDIO_INTERFACE); - #define KSNODETYPE_DIGITAL_AUDIO_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_DIGITAL_AUDIO_INTERFACE) - - #define STATIC_KSNODETYPE_LINE_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x0603) - DEFINE_GUIDSTRUCT("DFF21FE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LINE_CONNECTOR); - #define KSNODETYPE_LINE_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LINE_CONNECTOR) - - #define STATIC_KSNODETYPE_LEGACY_AUDIO_CONNECTOR\ - DEFINE_USB_TERMINAL_GUID(0x0604) - DEFINE_GUIDSTRUCT("DFF21FE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEGACY_AUDIO_CONNECTOR); - #define KSNODETYPE_LEGACY_AUDIO_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LEGACY_AUDIO_CONNECTOR) - - #define STATIC_KSNODETYPE_SPDIF_INTERFACE\ - DEFINE_USB_TERMINAL_GUID(0x0605) - DEFINE_GUIDSTRUCT("DFF21FE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPDIF_INTERFACE); - #define KSNODETYPE_SPDIF_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_SPDIF_INTERFACE) - - #define STATIC_KSNODETYPE_1394_DA_STREAM\ - DEFINE_USB_TERMINAL_GUID(0x0606) - DEFINE_GUIDSTRUCT("DFF21FE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DA_STREAM); - #define KSNODETYPE_1394_DA_STREAM DEFINE_GUIDNAMED(KSNODETYPE_1394_DA_STREAM) - - #define STATIC_KSNODETYPE_1394_DV_STREAM_SOUNDTRACK\ - DEFINE_USB_TERMINAL_GUID(0x0607) - DEFINE_GUIDSTRUCT("DFF21FE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DV_STREAM_SOUNDTRACK); - #define KSNODETYPE_1394_DV_STREAM_SOUNDTRACK DEFINE_GUIDNAMED(KSNODETYPE_1394_DV_STREAM_SOUNDTRACK) - - #define STATIC_KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE\ - DEFINE_USB_TERMINAL_GUID(0x0701) - DEFINE_GUIDSTRUCT("DFF220E1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE); - #define KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE DEFINE_GUIDNAMED(KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE) - - #define STATIC_KSNODETYPE_EQUALIZATION_NOISE\ - DEFINE_USB_TERMINAL_GUID(0x0702) - DEFINE_GUIDSTRUCT("DFF220E2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_EQUALIZATION_NOISE); - #define KSNODETYPE_EQUALIZATION_NOISE DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZATION_NOISE) - - #define STATIC_KSNODETYPE_CD_PLAYER\ - DEFINE_USB_TERMINAL_GUID(0x0703) - DEFINE_GUIDSTRUCT("DFF220E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CD_PLAYER); - #define KSNODETYPE_CD_PLAYER DEFINE_GUIDNAMED(KSNODETYPE_CD_PLAYER) - - #define STATIC_KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE\ - DEFINE_USB_TERMINAL_GUID(0x0704) - DEFINE_GUIDSTRUCT("DFF220E4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE); - #define KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE DEFINE_GUIDNAMED(KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE) - - #define STATIC_KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE\ - DEFINE_USB_TERMINAL_GUID(0x0705) - DEFINE_GUIDSTRUCT("DFF220E5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE); - #define KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE DEFINE_GUIDNAMED(KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE) - - #define STATIC_KSNODETYPE_MINIDISK\ - DEFINE_USB_TERMINAL_GUID(0x0706) - DEFINE_GUIDSTRUCT("DFF220E6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MINIDISK); - #define KSNODETYPE_MINIDISK DEFINE_GUIDNAMED(KSNODETYPE_MINIDISK) - - #define STATIC_KSNODETYPE_ANALOG_TAPE\ - DEFINE_USB_TERMINAL_GUID(0x0707) - DEFINE_GUIDSTRUCT("DFF220E7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_TAPE); - #define KSNODETYPE_ANALOG_TAPE DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_TAPE) - - #define STATIC_KSNODETYPE_PHONOGRAPH\ - DEFINE_USB_TERMINAL_GUID(0x0708) - DEFINE_GUIDSTRUCT("DFF220E8-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONOGRAPH); - #define KSNODETYPE_PHONOGRAPH DEFINE_GUIDNAMED(KSNODETYPE_PHONOGRAPH) - - #define STATIC_KSNODETYPE_VCR_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x0708) - DEFINE_GUIDSTRUCT("DFF220E9-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VCR_AUDIO); - #define KSNODETYPE_VCR_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VCR_AUDIO) - - #define STATIC_KSNODETYPE_VIDEO_DISC_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070A) - DEFINE_GUIDSTRUCT("DFF220EA-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_DISC_AUDIO); - #define KSNODETYPE_VIDEO_DISC_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_DISC_AUDIO) - - #define STATIC_KSNODETYPE_DVD_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070B) - DEFINE_GUIDSTRUCT("DFF220EB-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DVD_AUDIO); - #define KSNODETYPE_DVD_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DVD_AUDIO) - - #define STATIC_KSNODETYPE_TV_TUNER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070C) - DEFINE_GUIDSTRUCT("DFF220EC-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TV_TUNER_AUDIO); - #define KSNODETYPE_TV_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_TV_TUNER_AUDIO) - - #define STATIC_KSNODETYPE_SATELLITE_RECEIVER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070D) - DEFINE_GUIDSTRUCT("DFF220ED-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SATELLITE_RECEIVER_AUDIO); - #define KSNODETYPE_SATELLITE_RECEIVER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_SATELLITE_RECEIVER_AUDIO) - - #define STATIC_KSNODETYPE_CABLE_TUNER_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070E) - DEFINE_GUIDSTRUCT("DFF220EE-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CABLE_TUNER_AUDIO); - #define KSNODETYPE_CABLE_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_CABLE_TUNER_AUDIO) - - #define STATIC_KSNODETYPE_DSS_AUDIO\ - DEFINE_USB_TERMINAL_GUID(0x070F) - DEFINE_GUIDSTRUCT("DFF220EF-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DSS_AUDIO); - #define KSNODETYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DSS_AUDIO) - - #define STATIC_KSNODETYPE_RADIO_RECEIVER\ - DEFINE_USB_TERMINAL_GUID(0x0710) - DEFINE_GUIDSTRUCT("DFF220F0-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_RECEIVER); - #define KSNODETYPE_RADIO_RECEIVER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_RECEIVER) - - #define STATIC_KSNODETYPE_RADIO_TRANSMITTER\ - DEFINE_USB_TERMINAL_GUID(0x0711) - DEFINE_GUIDSTRUCT("DFF220F1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_TRANSMITTER); - #define KSNODETYPE_RADIO_TRANSMITTER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_TRANSMITTER) - - #define STATIC_KSNODETYPE_MULTITRACK_RECORDER\ - DEFINE_USB_TERMINAL_GUID(0x0712) - DEFINE_GUIDSTRUCT("DFF220F2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MULTITRACK_RECORDER); - #define KSNODETYPE_MULTITRACK_RECORDER DEFINE_GUIDNAMED(KSNODETYPE_MULTITRACK_RECORDER) - - #define STATIC_KSNODETYPE_SYNTHESIZER\ - DEFINE_USB_TERMINAL_GUID(0x0713) - DEFINE_GUIDSTRUCT("DFF220F3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SYNTHESIZER); - #define KSNODETYPE_SYNTHESIZER DEFINE_GUIDNAMED(KSNODETYPE_SYNTHESIZER) - - // Microsoft's WDMAUD virtual swsynth pin name guid - - #define STATIC_KSNODETYPE_SWSYNTH\ - 0x423274A0L, 0x8B81, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("423274A0-8B81-11D1-A050-0000F8004788", KSNODETYPE_SWSYNTH); - #define KSNODETYPE_SWSYNTH DEFINE_GUIDNAMED(KSNODETYPE_SWSYNTH) - - // Microsoft's SWMIDI midi pin and node name guid - - #define STATIC_KSNODETYPE_SWMIDI\ - 0xCB9BEFA0L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("CB9BEFA0-A251-11D1-A050-0000F8004788", KSNODETYPE_SWMIDI); - #define KSNODETYPE_SWMIDI DEFINE_GUIDNAMED(KSNODETYPE_SWMIDI) - - #define STATIC_KSNODETYPE_DRM_DESCRAMBLE\ - 0xFFBB6E3FL, 0xCCFE, 0x4D84, 0x90, 0xD9, 0x42, 0x14, 0x18, 0xB0, 0x3A, 0x8E - DEFINE_GUIDSTRUCT("FFBB6E3F-CCFE-4D84-90D9-421418B03A8E", KSNODETYPE_DRM_DESCRAMBLE); - #define KSNODETYPE_DRM_DESCRAMBLE DEFINE_GUIDNAMED(KSNODETYPE_DRM_DESCRAMBLE) - - // General categories - #define STATIC_KSCATEGORY_AUDIO \ - 0x6994AD04L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO); - #define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO) - - #define STATIC_KSCATEGORY_VIDEO \ - 0x6994AD05L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("6994AD05-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_VIDEO); - #define KSCATEGORY_VIDEO DEFINE_GUIDNAMED(KSCATEGORY_VIDEO) - - #define STATIC_KSCATEGORY_TEXT \ - 0x6994AD06L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("6994AD06-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_TEXT); - #define KSCATEGORY_TEXT DEFINE_GUIDNAMED(KSCATEGORY_TEXT) - - #define STATIC_KSCATEGORY_NETWORK \ - 0x67C9CC3CL, 0x69C4, 0x11D2, 0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("67C9CC3C-69C4-11D2-8759-00A0C9223196", KSCATEGORY_NETWORK); - #define KSCATEGORY_NETWORK DEFINE_GUIDNAMED(KSCATEGORY_NETWORK) - - #define STATIC_KSCATEGORY_TOPOLOGY \ - 0xDDA54A40L, 0x1E4C, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("DDA54A40-1E4C-11D1-A050-405705C10000", KSCATEGORY_TOPOLOGY); - #define KSCATEGORY_TOPOLOGY DEFINE_GUIDNAMED(KSCATEGORY_TOPOLOGY) - - #define STATIC_KSCATEGORY_VIRTUAL \ - 0x3503EAC4L, 0x1F26, 0x11D1, 0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("3503EAC4-1F26-11D1-8AB0-00A0C9223196", KSCATEGORY_VIRTUAL); - #define KSCATEGORY_VIRTUAL DEFINE_GUIDNAMED(KSCATEGORY_VIRTUAL) - - #define STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL \ - 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("BF963D80-C559-11D0-8A2B-00A0C9255AC1", KSCATEGORY_ACOUSTIC_ECHO_CANCEL); - #define KSCATEGORY_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSCATEGORY_ACOUSTIC_ECHO_CANCEL) - - - #define STATIC_KSCATEGORY_SYSAUDIO \ - 0xA7C7A5B1L, 0x5AF3, 0x11D1, 0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07 - DEFINE_GUIDSTRUCT("A7C7A5B1-5AF3-11D1-9CED-00A024BF0407", KSCATEGORY_SYSAUDIO); - #define KSCATEGORY_SYSAUDIO DEFINE_GUIDNAMED(KSCATEGORY_SYSAUDIO) - - #define STATIC_KSCATEGORY_WDMAUD \ - 0x3E227E76L, 0x690D, 0x11D2, 0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1 - DEFINE_GUIDSTRUCT("3E227E76-690D-11D2-8161-0000F8775BF1", KSCATEGORY_WDMAUD); - #define KSCATEGORY_WDMAUD DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD) - - #define STATIC_KSCATEGORY_AUDIO_GFX \ - 0x9BAF9572L, 0x340C, 0x11D3, 0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F - DEFINE_GUIDSTRUCT("9BAF9572-340C-11D3-ABDC-00A0C90AB16F", KSCATEGORY_AUDIO_GFX); - #define KSCATEGORY_AUDIO_GFX DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_GFX) - - #define STATIC_KSCATEGORY_AUDIO_SPLITTER \ - 0x9EA331FAL, 0xB91B, 0x45F8, 0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE - DEFINE_GUIDSTRUCT("9EA331FA-B91B-45F8-9285-BD2BC77AFCDE", KSCATEGORY_AUDIO_SPLITTER); - #define KSCATEGORY_AUDIO_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_SPLITTER) - - #define STATIC_KSCATEGORY_SYNTHESIZER STATIC_KSNODETYPE_SYNTHESIZER - #define KSCATEGORY_SYNTHESIZER KSNODETYPE_SYNTHESIZER - - #define STATIC_KSCATEGORY_DRM_DESCRAMBLE STATIC_KSNODETYPE_DRM_DESCRAMBLE - #define KSCATEGORY_DRM_DESCRAMBLE KSNODETYPE_DRM_DESCRAMBLE - - #define STATIC_KSCATEGORY_AUDIO_DEVICE \ - 0xFBF6F530L, 0x07B9, 0x11D2, 0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("FBF6F530-07B9-11D2-A71E-0000F8004788", KSCATEGORY_AUDIO_DEVICE); - #define KSCATEGORY_AUDIO_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_DEVICE) - - #define STATIC_KSCATEGORY_PREFERRED_WAVEOUT_DEVICE \ - 0xD6C5066EL, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("D6C5066E-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEOUT_DEVICE); - #define KSCATEGORY_PREFERRED_WAVEOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEOUT_DEVICE) - - #define STATIC_KSCATEGORY_PREFERRED_WAVEIN_DEVICE \ - 0xD6C50671L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("D6C50671-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEIN_DEVICE); - #define KSCATEGORY_PREFERRED_WAVEIN_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEIN_DEVICE) - - #define STATIC_KSCATEGORY_PREFERRED_MIDIOUT_DEVICE \ - 0xD6C50674L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("D6C50674-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_MIDIOUT_DEVICE); - #define KSCATEGORY_PREFERRED_MIDIOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_MIDIOUT_DEVICE) - - // Special pin category for wdmaud - - #define STATIC_KSCATEGORY_WDMAUD_USE_PIN_NAME \ - 0x47A4FA20L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 - DEFINE_GUIDSTRUCT("47A4FA20-A251-11D1-A050-0000F8004788", KSCATEGORY_WDMAUD_USE_PIN_NAME); - #define KSCATEGORY_WDMAUD_USE_PIN_NAME DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD_USE_PIN_NAME) - - // Escalante Platform Interface - - #define STATIC_KSCATEGORY_ESCALANTE_PLATFORM_DRIVER \ - 0x74f3aea8L, 0x9768, 0x11d1, 0x8e, 0x07, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e - DEFINE_GUIDSTRUCT("74f3aea8-9768-11d1-8e07-00a0c95ec22e", KSCATEGORY_ESCALANTE_PLATFORM_DRIVER); - #define KSCATEGORY_ESCALANTE_PLATFORM_DRIVER DEFINE_GUIDNAMED(KSCATEGORY_ESCALANTE_PLATFORM_DRIVER) - - // -- major types --- - - // 'vids' == MEDIATYPE_Video, - #define STATIC_KSDATAFORMAT_TYPE_VIDEO\ - 0x73646976L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - DEFINE_GUIDSTRUCT("73646976-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_VIDEO); - #define KSDATAFORMAT_TYPE_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VIDEO) - - // 'auds' == MEDIATYPE_Audio - #define STATIC_KSDATAFORMAT_TYPE_AUDIO\ - 0x73647561L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - DEFINE_GUIDSTRUCT("73647561-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_AUDIO); - #define KSDATAFORMAT_TYPE_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUDIO) - - // 'txts' == MEDIATYPE_Text - #define STATIC_KSDATAFORMAT_TYPE_TEXT\ - 0x73747874L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - DEFINE_GUIDSTRUCT("73747874-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_TEXT); - #define KSDATAFORMAT_TYPE_TEXT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_TEXT) - - #if !defined( DEFINE_WAVEFORMATEX_GUID ) - #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - #endif - - #define STATIC_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX\ - 0x00000000L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - DEFINE_GUIDSTRUCT("00000000-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_WAVEFORMATEX); - #define KSDATAFORMAT_SUBTYPE_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) - - #define INIT_WAVEFORMATEX_GUID(Guid, x)\ - {\ - *(Guid) = KSDATAFORMAT_SUBTYPE_WAVEFORMATEX;\ - (Guid)->Data1 = (USHORT)(x);\ - } - - #define EXTRACT_WAVEFORMATEX_ID(Guid)\ - (USHORT)((Guid)->Data1) - - #define IS_VALID_WAVEFORMATEX_GUID(Guid)\ - (!memcmp(((PUSHORT)&KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) + 1, ((PUSHORT)(Guid)) + 1, sizeof(GUID) - sizeof(USHORT))) - - #if !defined(INIT_MMREG_MID) - //{d5a47fa7-6d98-11d1-a21a-00a0c9223196} - #define INIT_MMREG_MID(guid, id)\ - {\ - (guid)->Data1 = 0xd5a47fa7 + (USHORT)(id);\ - (guid)->Data2 = 0x6d98;\ - (guid)->Data3 = 0x11d1;\ - (guid)->Data4[0] = 0xa2;\ - (guid)->Data4[1] = 0x1a;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ - } - #define EXTRACT_MMREG_MID(guid)\ - (USHORT)((guid)->Data1 - 0xd5a47fa7) - #define DEFINE_MMREG_MID_GUID(id)\ - 0xd5a47fa7+(USHORT)(id), 0x6d98, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - - #define IS_COMPATIBLE_MMREG_MID(guid)\ - (((guid)->Data1 >= 0xd5a47fa7) &&\ - ((guid)->Data1 < 0xd5a47fa7 + 0xffff) &&\ - ((guid)->Data2 == 0x6d98) &&\ - ((guid)->Data3 == 0x11d1) &&\ - ((guid)->Data4[0] == 0xa2) &&\ - ((guid)->Data4[1] == 0x1a) &&\ - ((guid)->Data4[2] == 0x00) &&\ - ((guid)->Data4[3] == 0xa0) &&\ - ((guid)->Data4[4] == 0xc9) &&\ - ((guid)->Data4[5] == 0x22) &&\ - ((guid)->Data4[6] == 0x31) &&\ - ((guid)->Data4[7] == 0x96)) - #endif // !defined(INIT_MMREG_MID) - - #if !defined(INIT_MMREG_PID) - //{e36dc2ac-6d9a-11d1-a21a-00a0c9223196} - #define INIT_MMREG_PID(guid, id)\ - {\ - (guid)->Data1 = 0xe36dc2ac + (USHORT)(id);\ - (guid)->Data2 = 0x6d9a;\ - (guid)->Data3 = 0x11d1;\ - (guid)->Data4[0] = 0xa2;\ - (guid)->Data4[1] = 0x1a;\ - (guid)->Data4[2] = 0x00;\ - (guid)->Data4[3] = 0xa0;\ - (guid)->Data4[4] = 0xc9;\ - (guid)->Data4[5] = 0x22;\ - (guid)->Data4[6] = 0x31;\ - (guid)->Data4[7] = 0x96;\ - } - #define EXTRACT_MMREG_PID(guid)\ - (USHORT)((guid)->Data1 - 0xe36dc2ac) - #define DEFINE_MMREG_PID_GUID(id)\ - 0xe36dc2ac+(USHORT)(id), 0x6d9a, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - - #define IS_COMPATIBLE_MMREG_PID(guid)\ - (((guid)->Data1 >= 0xe36dc2ac) &&\ - ((guid)->Data1 < 0xe36dc2ac + 0xffff) &&\ - ((guid)->Data2 == 0x6d9a) &&\ - ((guid)->Data3 == 0x11d1) &&\ - ((guid)->Data4[0] == 0xa2) &&\ - ((guid)->Data4[1] == 0x1a) &&\ - ((guid)->Data4[2] == 0x00) &&\ - ((guid)->Data4[3] == 0xa0) &&\ - ((guid)->Data4[4] == 0xc9) &&\ - ((guid)->Data4[5] == 0x22) &&\ - ((guid)->Data4[6] == 0x31) &&\ - ((guid)->Data4[7] == 0x96)) - #endif // !defined(INIT_MMREG_PID) - - #define STATIC_KSDATAFORMAT_SUBTYPE_ANALOG\ - 0x6dba3190L, 0x67bd, 0x11cf, 0xa0, 0xf7, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("6dba3190-67bd-11cf-a0f7-0020afd156e4", KSDATAFORMAT_SUBTYPE_ANALOG); - #define KSDATAFORMAT_SUBTYPE_ANALOG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ANALOG) - - #define STATIC_KSDATAFORMAT_SUBTYPE_PCM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_PCM) - DEFINE_GUIDSTRUCT("00000001-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_PCM); - #define KSDATAFORMAT_SUBTYPE_PCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_PCM) - - #if defined(_INC_MMREG) - #define STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_IEEE_FLOAT) - DEFINE_GUIDSTRUCT("00000003-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_IEEE_FLOAT); - #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) - - #define STATIC_KSDATAFORMAT_SUBTYPE_DRM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DRM) - DEFINE_GUIDSTRUCT("00000009-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DRM); - #define KSDATAFORMAT_SUBTYPE_DRM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DRM) - - #define STATIC_KSDATAFORMAT_SUBTYPE_ALAW\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ALAW) - DEFINE_GUIDSTRUCT("00000006-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ALAW); - #define KSDATAFORMAT_SUBTYPE_ALAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ALAW) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MULAW\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MULAW) - DEFINE_GUIDSTRUCT("00000007-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MULAW); - #define KSDATAFORMAT_SUBTYPE_MULAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MULAW) - - #define STATIC_KSDATAFORMAT_SUBTYPE_ADPCM\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ADPCM) - DEFINE_GUIDSTRUCT("00000002-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ADPCM); - #define KSDATAFORMAT_SUBTYPE_ADPCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ADPCM) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG\ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MPEG) - DEFINE_GUIDSTRUCT("00000050-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MPEG); - #define KSDATAFORMAT_SUBTYPE_MPEG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG) - #endif // defined(_INC_MMREG) - - #define STATIC_KSDATAFORMAT_SPECIFIER_VC_ID\ - 0xAD98D184L, 0xAAC3, 0x11D0, 0xA4, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("AD98D184-AAC3-11D0-A41C-00A0C9223196", KSDATAFORMAT_SPECIFIER_VC_ID); - #define KSDATAFORMAT_SPECIFIER_VC_ID DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VC_ID) - - #define STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX\ - 0x05589f81L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a - DEFINE_GUIDSTRUCT("05589f81-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_WAVEFORMATEX); - #define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) - - #define STATIC_KSDATAFORMAT_SPECIFIER_DSOUND\ - 0x518590a2L, 0xa184, 0x11d0, 0x85, 0x22, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 - DEFINE_GUIDSTRUCT("518590a2-a184-11d0-8522-00c04fd9baf3", KSDATAFORMAT_SPECIFIER_DSOUND); - #define KSDATAFORMAT_SPECIFIER_DSOUND DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DSOUND) - - #if defined(_INC_MMSYSTEM) || defined(_INC_MMREG) - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - typedef struct { - KSDATAFORMAT DataFormat; - WAVEFORMATEX WaveFormatEx; - } KSDATAFORMAT_WAVEFORMATEX, *PKSDATAFORMAT_WAVEFORMATEX; - - #ifndef _WAVEFORMATEXTENSIBLE_ - #define _WAVEFORMATEXTENSIBLE_ - typedef struct { - WAVEFORMATEX Format; - union { - WORD wValidBitsPerSample; /* bits of precision */ - WORD wSamplesPerBlock; /* valid if wBitsPerSample==0 */ - WORD wReserved; /* If neither applies, set to zero. */ - } Samples; - DWORD dwChannelMask; /* which channels are */ - /* present in stream */ - GUID SubFormat; - } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; - #endif // !_WAVEFORMATEXTENSIBLE_ - - #if !defined(WAVE_FORMAT_EXTENSIBLE) - #define WAVE_FORMAT_EXTENSIBLE 0xFFFE - #endif // !defined(WAVE_FORMAT_EXTENSIBLE) - - // DirectSound buffer description - typedef struct { - ULONG Flags; - ULONG Control; - WAVEFORMATEX WaveFormatEx; - } KSDSOUND_BUFFERDESC, *PKSDSOUND_BUFFERDESC; - - // DirectSound format - typedef struct { - KSDATAFORMAT DataFormat; - KSDSOUND_BUFFERDESC BufferDesc; - } KSDATAFORMAT_DSOUND, *PKSDATAFORMAT_DSOUND; - - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - #endif // defined(_INC_MMSYSTEM) || defined(_INC_MMREG) - - - - // DirectSound buffer flags - #define KSDSOUND_BUFFER_PRIMARY 0x00000001 - #define KSDSOUND_BUFFER_STATIC 0x00000002 - #define KSDSOUND_BUFFER_LOCHARDWARE 0x00000004 - #define KSDSOUND_BUFFER_LOCSOFTWARE 0x00000008 - - // DirectSound buffer control flags - #define KSDSOUND_BUFFER_CTRL_3D 0x00000001 - #define KSDSOUND_BUFFER_CTRL_FREQUENCY 0x00000002 - #define KSDSOUND_BUFFER_CTRL_PAN 0x00000004 - #define KSDSOUND_BUFFER_CTRL_VOLUME 0x00000008 - #define KSDSOUND_BUFFER_CTRL_POSITIONNOTIFY 0x00000010 - - #define KSDSOUND_BUFFER_CTRL_HRTF_3D 0x40000000 - - typedef struct { - #if defined(_NTDDK_) - ULONGLONG PlayOffset; - ULONGLONG WriteOffset; - #else // !_NTDDK_ - DWORDLONG PlayOffset; - DWORDLONG WriteOffset; - #endif // !_NTDDK_ - } KSAUDIO_POSITION, *PKSAUDIO_POSITION; - - // DirectSound3D FIR context - typedef struct { - LONG Channel; - FLOAT VolSmoothScale; - FLOAT TotalDryAttenuation; - FLOAT TotalWetAttenuation; - LONG SmoothFrequency; - LONG Delay; - } KSDS3D_ITD_PARAMS, *PKSDS3D_ITD_PARAMS; - - typedef struct { - ULONG Enabled; - KSDS3D_ITD_PARAMS LeftParams; - KSDS3D_ITD_PARAMS RightParams; - ULONG Reserved; - } KSDS3D_ITD_PARAMS_MSG, *PKSDS3D_ITD_PARAMS_MSG; - - // DirectSound3D HRTF messages - - typedef struct { - ULONG Size; // This is the size of the struct in bytes - ULONG Enabled; - BOOL SwapChannels; - BOOL ZeroAzimuth; - BOOL CrossFadeOutput; - ULONG FilterSize; // This is the additional size of the filter coeff in bytes - } KSDS3D_HRTF_PARAMS_MSG, *PKSDS3D_HRTF_PARAMS_MSG; - - - // HRTF filter quality levels - typedef enum { - FULL_FILTER, - LIGHT_FILTER, - KSDS3D_FILTER_QUALITY_COUNT - } KSDS3D_HRTF_FILTER_QUALITY; - - typedef struct { - ULONG Size; // This is the size of the struct in bytes - KSDS3D_HRTF_FILTER_QUALITY Quality; - FLOAT SampleRate; - ULONG MaxFilterSize; - ULONG FilterTransientMuteLength; - ULONG FilterOverlapBufferLength; - ULONG OutputOverlapBufferLength; - ULONG Reserved; - } KSDS3D_HRTF_INIT_MSG, *PKSDS3D_HRTF_INIT_MSG; - - // Coefficient formats - typedef enum { - FLOAT_COEFF, - SHORT_COEFF, - KSDS3D_COEFF_COUNT - } KSDS3D_HRTF_COEFF_FORMAT; - - // Filter methods - typedef enum { - DIRECT_FORM, - CASCADE_FORM, - KSDS3D_FILTER_METHOD_COUNT - } KSDS3D_HRTF_FILTER_METHOD; - - // Filter methods - typedef enum { - DS3D_HRTF_VERSION_1 - } KSDS3D_HRTF_FILTER_VERSION; - - typedef struct { - KSDS3D_HRTF_FILTER_METHOD FilterMethod; - KSDS3D_HRTF_COEFF_FORMAT CoeffFormat; - KSDS3D_HRTF_FILTER_VERSION Version; - ULONG Reserved; - } KSDS3D_HRTF_FILTER_FORMAT_MSG, *PKSDS3D_HRTF_FILTER_FORMAT_MSG; - - //=========================================================================== - // DirectSound3D HAL - - - typedef struct _DS3DVECTOR { - union { - FLOAT x; - FLOAT dvX; - }; - union { - FLOAT y; - FLOAT dvY; - }; - union { - FLOAT z; - FLOAT dvZ; - }; - } DS3DVECTOR, *PDS3DVECTOR; - - - //=========================================================================== - //=========================================================================== - - // KSPROPSETID_DirectSound3DListener : {437B3414-D060-11d0-8583-00C04FD9BAF3} - - #define STATIC_KSPROPSETID_DirectSound3DListener\ - 0x437b3414L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 - DEFINE_GUIDSTRUCT("437b3414-d060-11d0-8583-00c04fd9baf3",KSPROPSETID_DirectSound3DListener); - #define KSPROPSETID_DirectSound3DListener DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DListener) - - typedef enum { - KSPROPERTY_DIRECTSOUND3DLISTENER_ALL, - KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION, - KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION, - KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH, - KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION - } KSPROPERTY_DIRECTSOUND3DLISTENER; - - typedef struct { - DS3DVECTOR Position; - DS3DVECTOR Velocity; - DS3DVECTOR OrientFront; - DS3DVECTOR OrientTop; - FLOAT DistanceFactor; - FLOAT RolloffFactor; - FLOAT DopplerFactor; - } KSDS3D_LISTENER_ALL, *PKSDS3D_LISTENER_ALL; - - typedef struct { - DS3DVECTOR Front; - DS3DVECTOR Top; - } KSDS3D_LISTENER_ORIENTATION, *PKSDS3D_LISTENER_ORIENTATION; - - - //=========================================================================== - //=========================================================================== - // KSPROPSETID_DirectSound3DBuffer : {437B3411-D060-11d0-8583-00C04FD9BAF3} - - #define STATIC_KSPROPSETID_DirectSound3DBuffer\ - 0x437b3411L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 - DEFINE_GUIDSTRUCT("437b3411-d060-11d0-8583-00c04fd9baf3", KSPROPSETID_DirectSound3DBuffer); - #define KSPROPSETID_DirectSound3DBuffer DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DBuffer) - - - typedef enum { - KSPROPERTY_DIRECTSOUND3DBUFFER_ALL, - KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION, - KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME, - KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MODE - } KSPROPERTY_DIRECTSOUND3DBUFFER; - - - typedef struct { - DS3DVECTOR Position; - DS3DVECTOR Velocity; - ULONG InsideConeAngle; - ULONG OutsideConeAngle; - DS3DVECTOR ConeOrientation; - LONG ConeOutsideVolume; - FLOAT MinDistance; - FLOAT MaxDistance; - ULONG Mode; - } KSDS3D_BUFFER_ALL, *PKSDS3D_BUFFER_ALL; - - typedef struct { - ULONG InsideConeAngle; - ULONG OutsideConeAngle; - } KSDS3D_BUFFER_CONE_ANGLES, *PKSDS3D_BUFFER_CONE_ANGLES; - - #define KSAUDIO_STEREO_SPEAKER_GEOMETRY_HEADPHONE (-1) - #define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MIN 5 - #define KSAUDIO_STEREO_SPEAKER_GEOMETRY_NARROW 10 - #define KSAUDIO_STEREO_SPEAKER_GEOMETRY_WIDE 20 - #define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MAX 180 - - #define KSDSOUND_3D_MODE_NORMAL 0x00000000 - #define KSDSOUND_3D_MODE_HEADRELATIVE 0x00000001 - #define KSDSOUND_3D_MODE_DISABLE 0x00000002 - - typedef struct { - KSDATARANGE DataRange; - ULONG MaximumChannels; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - } KSDATARANGE_AUDIO, *PKSDATARANGE_AUDIO; - - //--------------------------------------------------------------------------- - - #define STATIC_KSDATAFORMAT_SUBTYPE_RIFF\ - 0x4995DAEEL, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("4995DAEE-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFF); - #define KSDATAFORMAT_SUBTYPE_RIFF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFF) - - #define STATIC_KSDATAFORMAT_SUBTYPE_RIFFWAVE\ - 0xe436eb8bL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 - DEFINE_GUIDSTRUCT("e436eb8b-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_RIFFWAVE); - #define KSDATAFORMAT_SUBTYPE_RIFFWAVE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFWAVE) - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSPROPSETID_Bibliographic \ - 0x07BA150EL, 0xE2B1, 0x11D0, 0xAC, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("07BA150E-E2B1-11D0-AC17-00A0C9223196", KSPROPSETID_Bibliographic); - #define KSPROPSETID_Bibliographic DEFINE_GUIDNAMED(KSPROPSETID_Bibliographic) - - //Repeatable tags contain all entries within the property, each preceeded by length - typedef enum { - KSPROPERTY_BIBLIOGRAPHIC_LEADER = 'RDL ', - KSPROPERTY_BIBLIOGRAPHIC_LCCN = '010 ', - KSPROPERTY_BIBLIOGRAPHIC_ISBN = '020 ', - KSPROPERTY_BIBLIOGRAPHIC_ISSN = '220 ', - KSPROPERTY_BIBLIOGRAPHIC_CATALOGINGSOURCE = '040 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINPERSONALNAME = '001 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINCORPORATEBODY = '011 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINMEETINGNAME = '111 ', - KSPROPERTY_BIBLIOGRAPHIC_MAINUNIFORMTITLE = '031 ', - KSPROPERTY_BIBLIOGRAPHIC_UNIFORMTITLE = '042 ', - KSPROPERTY_BIBLIOGRAPHIC_TITLESTATEMENT = '542 ', - KSPROPERTY_BIBLIOGRAPHIC_VARYINGFORMTITLE = '642 ', - KSPROPERTY_BIBLIOGRAPHIC_PUBLICATION = '062 ', - KSPROPERTY_BIBLIOGRAPHIC_PHYSICALDESCRIPTION = '003 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTITLE = '044 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENT = '094 ', - KSPROPERTY_BIBLIOGRAPHIC_GENERALNOTE = '005 ', - KSPROPERTY_BIBLIOGRAPHIC_BIBLIOGRAPHYNOTE = '405 ', - KSPROPERTY_BIBLIOGRAPHIC_CONTENTSNOTE = '505 ', - KSPROPERTY_BIBLIOGRAPHIC_CREATIONCREDIT = '805 ', - KSPROPERTY_BIBLIOGRAPHIC_CITATION = '015 ', - KSPROPERTY_BIBLIOGRAPHIC_PARTICIPANT = '115 ', - KSPROPERTY_BIBLIOGRAPHIC_SUMMARY = '025 ', - KSPROPERTY_BIBLIOGRAPHIC_TARGETAUDIENCE = '125 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDFORMAVAILABLE = '035 ', - KSPROPERTY_BIBLIOGRAPHIC_SYSTEMDETAILS = '835 ', - KSPROPERTY_BIBLIOGRAPHIC_AWARDS = '685 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYPERSONALNAME = '006 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTOPICALTERM = '056 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYGEOGRAPHIC = '156 ', - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMGENRE = '556 ', - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMCURRICULUM = '856 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYUNIFORMTITLE = '037 ', - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYRELATED = '047 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTPERSONALNAME = '008 ', - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTUNIFORMTITLE = '038 ' - } KSPROPERTY_BIBLIOGRAPHIC; - - #define STATIC_KSPROPSETID_TopologyNode\ - 0x45FFAAA1L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 - DEFINE_GUIDSTRUCT("45FFAAA1-6E1B-11D0-BCF2-444553540000", KSPROPSETID_TopologyNode); - #define KSPROPSETID_TopologyNode DEFINE_GUIDNAMED(KSPROPSETID_TopologyNode) - - typedef enum { - KSPROPERTY_TOPOLOGYNODE_ENABLE = 1, - KSPROPERTY_TOPOLOGYNODE_RESET - } KSPROPERTY_TOPOLOGYNODE; - - //=========================================================================== - #define STATIC_KSPROPSETID_DrmAudioStream\ - 0x2f2c8ddd, 0x4198, 0x4fac, 0xba, 0x29, 0x61, 0xbb, 0x5, 0xb7, 0xde, 0x6 - DEFINE_GUIDSTRUCT("2F2C8DDD-4198-4fac-BA29-61BB05B7DE06", KSPROPSETID_DrmAudioStream); - #define KSPROPSETID_DrmAudioStream DEFINE_GUIDNAMED(KSPROPSETID_DrmAudioStream) - - typedef enum { - KSPROPERTY_DRMAUDIOSTREAM_CONTENTID, - KSPROPERTY_DRMAUDIOSTREAM_AUTHENTICATEFUNCTION - } KSPROPERTY_DRMAUDIOSTREAM; - - //=========================================================================== - #define STATIC_KSPROPSETID_Audio\ - 0x45FFAAA0L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 - DEFINE_GUIDSTRUCT("45FFAAA0-6E1B-11D0-BCF2-444553540000", KSPROPSETID_Audio); - #define KSPROPSETID_Audio DEFINE_GUIDNAMED(KSPROPSETID_Audio) - - typedef enum { - KSPROPERTY_AUDIO_LATENCY = 1, - KSPROPERTY_AUDIO_COPY_PROTECTION, - KSPROPERTY_AUDIO_CHANNEL_CONFIG, - KSPROPERTY_AUDIO_VOLUMELEVEL, - KSPROPERTY_AUDIO_POSITION, - KSPROPERTY_AUDIO_DYNAMIC_RANGE, - KSPROPERTY_AUDIO_QUALITY, - KSPROPERTY_AUDIO_SAMPLING_RATE, - KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE, - KSPROPERTY_AUDIO_MIX_LEVEL_TABLE, - KSPROPERTY_AUDIO_MIX_LEVEL_CAPS, - KSPROPERTY_AUDIO_MUX_SOURCE, - KSPROPERTY_AUDIO_MUTE, - KSPROPERTY_AUDIO_BASS, - KSPROPERTY_AUDIO_MID, - KSPROPERTY_AUDIO_TREBLE, - KSPROPERTY_AUDIO_BASS_BOOST, - KSPROPERTY_AUDIO_EQ_LEVEL, - KSPROPERTY_AUDIO_NUM_EQ_BANDS, - KSPROPERTY_AUDIO_EQ_BANDS, - KSPROPERTY_AUDIO_AGC, - KSPROPERTY_AUDIO_DELAY, - KSPROPERTY_AUDIO_LOUDNESS, - KSPROPERTY_AUDIO_WIDE_MODE, - KSPROPERTY_AUDIO_WIDENESS, - KSPROPERTY_AUDIO_REVERB_LEVEL, - KSPROPERTY_AUDIO_CHORUS_LEVEL, - KSPROPERTY_AUDIO_DEV_SPECIFIC, - KSPROPERTY_AUDIO_DEMUX_DEST, - KSPROPERTY_AUDIO_STEREO_ENHANCE, - KSPROPERTY_AUDIO_MANUFACTURE_GUID, - KSPROPERTY_AUDIO_PRODUCT_GUID, - KSPROPERTY_AUDIO_CPU_RESOURCES, - KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY, - KSPROPERTY_AUDIO_SURROUND_ENCODE, - KSPROPERTY_AUDIO_3D_INTERFACE, - KSPROPERTY_AUDIO_PEAKMETER, - KSPROPERTY_AUDIO_ALGORITHM_INSTANCE - } KSPROPERTY_AUDIO; - - // Audio quality constants - #define KSAUDIO_QUALITY_WORST 0x0 - #define KSAUDIO_QUALITY_PC 0x1 - #define KSAUDIO_QUALITY_BASIC 0x2 - #define KSAUDIO_QUALITY_ADVANCED 0x3 - - // Audio CPU resource constants - #define KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU 0x00000000 - #define KSAUDIO_CPU_RESOURCES_HOST_CPU 0x7FFFFFFF - - typedef struct { - BOOL fCopyrighted; - BOOL fOriginal; - } KSAUDIO_COPY_PROTECTION, *PKSAUDIO_COPY_PROTECTION; - - typedef struct { - LONG ActiveSpeakerPositions; - } KSAUDIO_CHANNEL_CONFIG, *PKSAUDIO_CHANNEL_CONFIG; - - // Speaker Positions: - #define SPEAKER_FRONT_LEFT 0x1 - #define SPEAKER_FRONT_RIGHT 0x2 - #define SPEAKER_FRONT_CENTER 0x4 - #define SPEAKER_LOW_FREQUENCY 0x8 - #define SPEAKER_BACK_LEFT 0x10 - #define SPEAKER_BACK_RIGHT 0x20 - #define SPEAKER_FRONT_LEFT_OF_CENTER 0x40 - #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 - #define SPEAKER_BACK_CENTER 0x100 - #define SPEAKER_SIDE_LEFT 0x200 - #define SPEAKER_SIDE_RIGHT 0x400 - #define SPEAKER_TOP_CENTER 0x800 - #define SPEAKER_TOP_FRONT_LEFT 0x1000 - #define SPEAKER_TOP_FRONT_CENTER 0x2000 - #define SPEAKER_TOP_FRONT_RIGHT 0x4000 - #define SPEAKER_TOP_BACK_LEFT 0x8000 - #define SPEAKER_TOP_BACK_CENTER 0x10000 - #define SPEAKER_TOP_BACK_RIGHT 0x20000 - - // Bit mask locations reserved for future use - #define SPEAKER_RESERVED 0x7FFC0000 - - // Used to specify that any possible permutation of speaker configurations - #define SPEAKER_ALL 0x80000000 - - // DirectSound Speaker Config - #define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER) - #define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) - #define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - #define KSAUDIO_SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) - #define KSAUDIO_SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - #define KSAUDIO_SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) - - // DVD Speaker Positions - #define KSAUDIO_SPEAKER_GROUND_FRONT_LEFT SPEAKER_FRONT_LEFT - #define KSAUDIO_SPEAKER_GROUND_FRONT_CENTER SPEAKER_FRONT_CENTER - #define KSAUDIO_SPEAKER_GROUND_FRONT_RIGHT SPEAKER_FRONT_RIGHT - #define KSAUDIO_SPEAKER_GROUND_REAR_LEFT SPEAKER_BACK_LEFT - #define KSAUDIO_SPEAKER_GROUND_REAR_RIGHT SPEAKER_BACK_RIGHT - #define KSAUDIO_SPEAKER_TOP_MIDDLE SPEAKER_TOP_CENTER - #define KSAUDIO_SPEAKER_SUPER_WOOFER SPEAKER_LOW_FREQUENCY - - typedef struct { - ULONG QuietCompression; - ULONG LoudCompression; - } KSAUDIO_DYNAMIC_RANGE, *PKSAUDIO_DYNAMIC_RANGE; - - typedef struct { - BOOL Mute; - LONG Level; - } KSAUDIO_MIXLEVEL, *PKSAUDIO_MIXLEVEL; - - typedef struct { - BOOL Mute; - LONG Minimum; - LONG Maximum; - LONG Reset; - } KSAUDIO_MIX_CAPS, *PKSAUDIO_MIX_CAPS; - - typedef struct { - ULONG InputChannels; - ULONG OutputChannels; - KSAUDIO_MIX_CAPS Capabilities[1]; - } KSAUDIO_MIXCAP_TABLE, *PKSAUDIO_MIXCAP_TABLE; - - typedef enum { - SE_TECH_NONE, - SE_TECH_ANALOG_DEVICES_PHAT, - SE_TECH_CREATIVE, - SE_TECH_NATIONAL_SEMI, - SE_TECH_YAMAHA_YMERSION, - SE_TECH_BBE, - SE_TECH_CRYSTAL_SEMI, - SE_TECH_QSOUND_QXPANDER, - SE_TECH_SPATIALIZER, - SE_TECH_SRS, - SE_TECH_PLATFORM_TECH, - SE_TECH_AKM, - SE_TECH_AUREAL, - SE_TECH_AZTECH, - SE_TECH_BINAURA, - SE_TECH_ESS_TECH, - SE_TECH_HARMAN_VMAX, - SE_TECH_NVIDEA, - SE_TECH_PHILIPS_INCREDIBLE, - SE_TECH_TEXAS_INST, - SE_TECH_VLSI_TECH - } SE_TECHNIQUE; - - typedef struct { - SE_TECHNIQUE Technique; - ULONG Center; - ULONG Depth; - ULONG Reserved; - } KSAUDIO_STEREO_ENHANCE, *PKSAUDIO_STEREO_ENHANCE; - - //=========================================================================== - // Topology Node Type GUIDs - - #define STATIC_KSNODETYPE_DAC\ - 0x507AE360L, 0xC554, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("507AE360-C554-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DAC); - #define KSNODETYPE_DAC DEFINE_GUIDNAMED(KSNODETYPE_DAC) - - #define STATIC_KSNODETYPE_ADC\ - 0x4D837FE0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("4D837FE0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_ADC); - #define KSNODETYPE_ADC DEFINE_GUIDNAMED(KSNODETYPE_ADC) - - #define STATIC_KSNODETYPE_SRC\ - 0x9DB7B9E0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("9DB7B9E0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SRC); - #define KSNODETYPE_SRC DEFINE_GUIDNAMED(KSNODETYPE_SRC) - - #define STATIC_KSNODETYPE_SUPERMIX\ - 0xE573ADC0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("E573ADC0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUPERMIX); - #define KSNODETYPE_SUPERMIX DEFINE_GUIDNAMED(KSNODETYPE_SUPERMIX) - - #define STATIC_KSNODETYPE_MUX\ - 0x2CEAF780L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("2CEAF780-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUX); - #define KSNODETYPE_MUX DEFINE_GUIDNAMED(KSNODETYPE_MUX) - - #define STATIC_KSNODETYPE_DEMUX\ - 0xC0EB67D4L, 0xE807, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("C0EB67D4-E807-11D0-958A-00C04FB925D3", KSNODETYPE_DEMUX); - #define KSNODETYPE_DEMUX DEFINE_GUIDNAMED(KSNODETYPE_DEMUX) - - #define STATIC_KSNODETYPE_SUM\ - 0xDA441A60L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("DA441A60-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUM); - #define KSNODETYPE_SUM DEFINE_GUIDNAMED(KSNODETYPE_SUM) - - #define STATIC_KSNODETYPE_MUTE\ - 0x02B223C0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("02B223C0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUTE); - #define KSNODETYPE_MUTE DEFINE_GUIDNAMED(KSNODETYPE_MUTE) - - #define STATIC_KSNODETYPE_VOLUME\ - 0x3A5ACC00L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("3A5ACC00-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_VOLUME); - #define KSNODETYPE_VOLUME DEFINE_GUIDNAMED(KSNODETYPE_VOLUME) - - #define STATIC_KSNODETYPE_TONE\ - 0x7607E580L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("7607E580-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_TONE); - #define KSNODETYPE_TONE DEFINE_GUIDNAMED(KSNODETYPE_TONE) - - #define STATIC_KSNODETYPE_EQUALIZER\ - 0x9D41B4A0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("9D41B4A0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_EQUALIZER); - #define KSNODETYPE_EQUALIZER DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZER) - - #define STATIC_KSNODETYPE_AGC\ - 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("E88C9BA0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_AGC); - #define KSNODETYPE_AGC DEFINE_GUIDNAMED(KSNODETYPE_AGC) - - #define STATIC_KSNODETYPE_NOISE_SUPPRESS\ - 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5 - DEFINE_GUIDSTRUCT("E07F903F-62FD-4e60-8CDD-DEA7236665B5", KSNODETYPE_NOISE_SUPPRESS); - #define KSNODETYPE_NOISE_SUPPRESS DEFINE_GUIDNAMED(KSNODETYPE_NOISE_SUPPRESS) - - #define STATIC_KSNODETYPE_DELAY\ - 0x144981E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("144981E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DELAY); - #define KSNODETYPE_DELAY DEFINE_GUIDNAMED(KSNODETYPE_DELAY) - - #define STATIC_KSNODETYPE_LOUDNESS\ - 0x41887440L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("41887440-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_LOUDNESS); - #define KSNODETYPE_LOUDNESS DEFINE_GUIDNAMED(KSNODETYPE_LOUDNESS) - - #define STATIC_KSNODETYPE_PROLOGIC_DECODER\ - 0x831C2C80L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("831C2C80-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_PROLOGIC_DECODER); - #define KSNODETYPE_PROLOGIC_DECODER DEFINE_GUIDNAMED(KSNODETYPE_PROLOGIC_DECODER) - - #define STATIC_KSNODETYPE_STEREO_WIDE\ - 0xA9E69800L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("A9E69800-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_STEREO_WIDE); - #define KSNODETYPE_STEREO_WIDE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_WIDE) - - #define STATIC_KSNODETYPE_STEREO_ENHANCE\ - 0xAF6878ACL, 0xE83F, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("AF6878AC-E83F-11D0-958A-00C04FB925D3", KSNODETYPE_STEREO_ENHANCE); - #define KSNODETYPE_STEREO_ENHANCE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_ENHANCE) - - #define STATIC_KSNODETYPE_REVERB\ - 0xEF0328E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("EF0328E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_REVERB); - #define KSNODETYPE_REVERB DEFINE_GUIDNAMED(KSNODETYPE_REVERB) - - #define STATIC_KSNODETYPE_CHORUS\ - 0x20173F20L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("20173F20-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_CHORUS); - #define KSNODETYPE_CHORUS DEFINE_GUIDNAMED(KSNODETYPE_CHORUS) - - #define STATIC_KSNODETYPE_3D_EFFECTS\ - 0x55515860L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("55515860-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_3D_EFFECTS); - #define KSNODETYPE_3D_EFFECTS DEFINE_GUIDNAMED(KSNODETYPE_3D_EFFECTS) - - #define STATIC_KSNODETYPE_ACOUSTIC_ECHO_CANCEL STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL - #define KSNODETYPE_ACOUSTIC_ECHO_CANCEL KSCATEGORY_ACOUSTIC_ECHO_CANCEL - - #define STATIC_KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR - #define KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR - - #define STATIC_KSNODETYPE_DEV_SPECIFIC\ - 0x941C7AC0L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 - DEFINE_GUIDSTRUCT("941C7AC0-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DEV_SPECIFIC); - #define KSNODETYPE_DEV_SPECIFIC DEFINE_GUIDNAMED(KSNODETYPE_DEV_SPECIFIC) - - #define STATIC_KSNODETYPE_SURROUND_ENCODER\ - 0x8074C5B2L, 0x3C66, 0x11D2, 0xB4, 0x5A, 0x30, 0x78, 0x30, 0x2C, 0x20, 0x30 - DEFINE_GUIDSTRUCT("8074C5B2-3C66-11D2-B45A-3078302C2030", KSNODETYPE_SURROUND_ENCODER); - #define KSNODETYPE_SURROUND_ENCODER DEFINE_GUIDNAMED(KSNODETYPE_SURROUND_ENCODER) - - #define STATIC_KSNODETYPE_PEAKMETER\ - 0xa085651eL, 0x5f0d, 0x4b36, 0xa8, 0x69, 0xd1, 0x95, 0xd6, 0xab, 0x4b, 0x9e - DEFINE_GUIDSTRUCT("A085651E-5F0D-4b36-A869-D195D6AB4B9E", KSNODETYPE_PEAKMETER); - #define KSNODETYPE_PEAKMETER DEFINE_GUIDNAMED(KSNODETYPE_PEAKMETER) - - //=========================================================================== - // Topology Node Name GUIDs for common audio nodes - #define STATIC_KSAUDFNAME_BASS\ - 0x185FEDE0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_BASS); - #define KSAUDFNAME_BASS DEFINE_GUIDNAMED(KSAUDFNAME_BASS) - - #define STATIC_KSAUDFNAME_TREBLE\ - 0x185FEDE1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_TREBLE); - #define KSAUDFNAME_TREBLE DEFINE_GUIDNAMED(KSAUDFNAME_TREBLE) - - #define STATIC_KSAUDFNAME_3D_STEREO\ - 0x185FEDE2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_3D_STEREO); - #define KSAUDFNAME_3D_STEREO DEFINE_GUIDNAMED(KSAUDFNAME_3D_STEREO) - - #define STATIC_KSAUDFNAME_MASTER_VOLUME\ - 0x185FEDE3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_VOLUME); - #define KSAUDFNAME_MASTER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_VOLUME) - - #define STATIC_KSAUDFNAME_MASTER_MUTE\ - 0x185FEDE4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_MUTE); - #define KSAUDFNAME_MASTER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_MUTE) - - #define STATIC_KSAUDFNAME_WAVE_VOLUME\ - 0x185FEDE5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_VOLUME); - #define KSAUDFNAME_WAVE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_VOLUME) - - #define STATIC_KSAUDFNAME_WAVE_MUTE\ - 0x185FEDE6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_MUTE); - #define KSAUDFNAME_WAVE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_MUTE) - - #define STATIC_KSAUDFNAME_MIDI_VOLUME\ - 0x185FEDE7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_VOLUME); - #define KSAUDFNAME_MIDI_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_VOLUME) - - #define STATIC_KSAUDFNAME_MIDI_MUTE\ - 0x185FEDE8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_MUTE); - #define KSAUDFNAME_MIDI_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_MUTE) - - #define STATIC_KSAUDFNAME_CD_VOLUME\ - 0x185FEDE9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDE9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_VOLUME); - #define KSAUDFNAME_CD_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_VOLUME) - - #define STATIC_KSAUDFNAME_CD_MUTE\ - 0x185FEDEAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDEA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_MUTE); - #define KSAUDFNAME_CD_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_CD_MUTE) - - #define STATIC_KSAUDFNAME_LINE_VOLUME\ - 0x185FEDEBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDEB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_VOLUME); - #define KSAUDFNAME_LINE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_VOLUME) - - #define STATIC_KSAUDFNAME_LINE_MUTE\ - 0x185FEDECL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDEC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_MUTE); - #define KSAUDFNAME_LINE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_LINE_MUTE) - - #define STATIC_KSAUDFNAME_MIC_VOLUME\ - 0x185FEDEDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDED-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_VOLUME); - #define KSAUDFNAME_MIC_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_VOLUME) - - #define STATIC_KSAUDFNAME_MIC_MUTE\ - 0x185FEDEEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDEE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_MUTE); - #define KSAUDFNAME_MIC_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIC_MUTE) - - #define STATIC_KSAUDFNAME_RECORDING_SOURCE\ - 0x185FEDEFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDEF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_SOURCE); - #define KSAUDFNAME_RECORDING_SOURCE DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_SOURCE) - - #define STATIC_KSAUDFNAME_PC_SPEAKER_VOLUME\ - 0x185FEDF0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_VOLUME); - #define KSAUDFNAME_PC_SPEAKER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_VOLUME) - - #define STATIC_KSAUDFNAME_PC_SPEAKER_MUTE\ - 0x185FEDF1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_MUTE); - #define KSAUDFNAME_PC_SPEAKER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_MUTE) - - #define STATIC_KSAUDFNAME_MIDI_IN_VOLUME\ - 0x185FEDF2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_IN_VOLUME); - #define KSAUDFNAME_MIDI_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_IN_VOLUME) - - #define STATIC_KSAUDFNAME_CD_IN_VOLUME\ - 0x185FEDF3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_IN_VOLUME); - #define KSAUDFNAME_CD_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_IN_VOLUME) - - #define STATIC_KSAUDFNAME_LINE_IN_VOLUME\ - 0x185FEDF4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN_VOLUME); - #define KSAUDFNAME_LINE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN_VOLUME) - - #define STATIC_KSAUDFNAME_MIC_IN_VOLUME\ - 0x185FEDF5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_IN_VOLUME); - #define KSAUDFNAME_MIC_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_IN_VOLUME) - - #define STATIC_KSAUDFNAME_WAVE_IN_VOLUME\ - 0x185FEDF6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_IN_VOLUME); - #define KSAUDFNAME_WAVE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_IN_VOLUME) - - #define STATIC_KSAUDFNAME_VOLUME_CONTROL\ - 0x185FEDF7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_VOLUME_CONTROL); - #define KSAUDFNAME_VOLUME_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_VOLUME_CONTROL) - - #define STATIC_KSAUDFNAME_MIDI\ - 0x185FEDF8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI); - #define KSAUDFNAME_MIDI DEFINE_GUIDNAMED(KSAUDFNAME_MIDI) - - #define STATIC_KSAUDFNAME_LINE_IN\ - 0x185FEDF9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDF9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN); - #define KSAUDFNAME_LINE_IN DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN) - - #define STATIC_KSAUDFNAME_RECORDING_CONTROL\ - 0x185FEDFAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_CONTROL); - #define KSAUDFNAME_RECORDING_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_CONTROL) - - #define STATIC_KSAUDFNAME_CD_AUDIO\ - 0x185FEDFBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_AUDIO); - #define KSAUDFNAME_CD_AUDIO DEFINE_GUIDNAMED(KSAUDFNAME_CD_AUDIO) - - #define STATIC_KSAUDFNAME_AUX_VOLUME\ - 0x185FEDFCL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_VOLUME); - #define KSAUDFNAME_AUX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_AUX_VOLUME) - - #define STATIC_KSAUDFNAME_AUX_MUTE\ - 0x185FEDFDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFD-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_MUTE); - #define KSAUDFNAME_AUX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_AUX_MUTE) - - #define STATIC_KSAUDFNAME_AUX\ - 0x185FEDFEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX); - #define KSAUDFNAME_AUX DEFINE_GUIDNAMED(KSAUDFNAME_AUX) - - #define STATIC_KSAUDFNAME_PC_SPEAKER\ - 0x185FEDFFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEDFF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER); - #define KSAUDFNAME_PC_SPEAKER DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER) - - #define STATIC_KSAUDFNAME_WAVE_OUT_MIX\ - 0x185FEE00L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("185FEE00-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_OUT_MIX); - #define KSAUDFNAME_WAVE_OUT_MIX DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_OUT_MIX) - - #define STATIC_KSAUDFNAME_MONO_OUT\ - 0xf9b41dc3L, 0x96e2, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("F9B41DC3-96E2-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT); - #define KSAUDFNAME_MONO_OUT DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT) - - #define STATIC_KSAUDFNAME_STEREO_MIX\ - 0xdff077L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("00DFF077-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX); - #define KSAUDFNAME_STEREO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX) - - #define STATIC_KSAUDFNAME_MONO_MIX\ - 0xdff078L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("00DFF078-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX); - #define KSAUDFNAME_MONO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX) - - #define STATIC_KSAUDFNAME_MONO_OUT_VOLUME\ - 0x1ad247ebL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("1AD247EB-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_VOLUME); - #define KSAUDFNAME_MONO_OUT_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_VOLUME) - - #define STATIC_KSAUDFNAME_MONO_OUT_MUTE\ - 0x1ad247ecL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("1AD247EC-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_MUTE); - #define KSAUDFNAME_MONO_OUT_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_MUTE) - - #define STATIC_KSAUDFNAME_STEREO_MIX_VOLUME\ - 0x1ad247edL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("1AD247ED-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_VOLUME); - #define KSAUDFNAME_STEREO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_VOLUME) - - #define STATIC_KSAUDFNAME_STEREO_MIX_MUTE\ - 0x22b0eafdL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("22B0EAFD-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_MUTE); - #define KSAUDFNAME_STEREO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_MUTE) - - #define STATIC_KSAUDFNAME_MONO_MIX_VOLUME\ - 0x22b0eafeL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("22B0EAFE-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_VOLUME); - #define KSAUDFNAME_MONO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_VOLUME) - - #define STATIC_KSAUDFNAME_MONO_MIX_MUTE\ - 0x2bc31d69L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("2BC31D69-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_MUTE); - #define KSAUDFNAME_MONO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_MUTE) - - #define STATIC_KSAUDFNAME_MICROPHONE_BOOST\ - 0x2bc31d6aL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("2BC31D6A-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MICROPHONE_BOOST); - #define KSAUDFNAME_MICROPHONE_BOOST DEFINE_GUIDNAMED(KSAUDFNAME_MICROPHONE_BOOST) - - #define STATIC_KSAUDFNAME_ALTERNATE_MICROPHONE\ - 0x2bc31d6bL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("2BC31D6B-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_ALTERNATE_MICROPHONE); - #define KSAUDFNAME_ALTERNATE_MICROPHONE DEFINE_GUIDNAMED(KSAUDFNAME_ALTERNATE_MICROPHONE) - - #define STATIC_KSAUDFNAME_3D_DEPTH\ - 0x63ff5747L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("63FF5747-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_DEPTH); - #define KSAUDFNAME_3D_DEPTH DEFINE_GUIDNAMED(KSAUDFNAME_3D_DEPTH) - - #define STATIC_KSAUDFNAME_3D_CENTER\ - 0x9f0670b4L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("9F0670B4-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_CENTER); - #define KSAUDFNAME_3D_CENTER DEFINE_GUIDNAMED(KSAUDFNAME_3D_CENTER) - - #define STATIC_KSAUDFNAME_VIDEO_VOLUME\ - 0x9b46e708L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("9B46E708-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_VOLUME); - #define KSAUDFNAME_VIDEO_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_VOLUME) - - #define STATIC_KSAUDFNAME_VIDEO_MUTE\ - 0x9b46e709L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("9B46E709-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_MUTE); - #define KSAUDFNAME_VIDEO_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_MUTE) - - #define STATIC_KSAUDFNAME_VIDEO\ - 0x915daec4L, 0xa434, 0x11d2, 0xac, 0x52, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 - DEFINE_GUIDSTRUCT("915DAEC4-A434-11d2-AC52-00C04F8EFB68", KSAUDFNAME_VIDEO); - #define KSAUDFNAME_VIDEO DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO) - - #define STATIC_KSAUDFNAME_PEAKMETER\ - 0x57e24340L, 0xfc5b, 0x4612, 0xa5, 0x62, 0x72, 0xb1, 0x1a, 0x29, 0xdf, 0xae - DEFINE_GUIDSTRUCT("57E24340-FC5B-4612-A562-72B11A29DFAE", KSAUDFNAME_PEAKMETER); - #define KSAUDFNAME_PEAKMETER DEFINE_GUIDNAMED(KSAUDFNAME_PEAKMETER) - - // Internal topology node pin definitions - - #define KSNODEPIN_STANDARD_IN 1 - #define KSNODEPIN_STANDARD_OUT 0 - - #define KSNODEPIN_SUM_MUX_IN 1 // can be >= 1 - #define KSNODEPIN_SUM_MUX_OUT 0 - - #define KSNODEPIN_DEMUX_IN 0 - #define KSNODEPIN_DEMUX_OUT 1 // can be >= 1 - - #define KSNODEPIN_AEC_RENDER_IN 1 - #define KSNODEPIN_AEC_RENDER_OUT 0 - #define KSNODEPIN_AEC_CAPTURE_IN 2 - #define KSNODEPIN_AEC_CAPTURE_OUT 3 - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSMETHODSETID_Wavetable\ - 0xDCEF31EBL, 0xD907, 0x11D0, 0x95, 0x83, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("DCEF31EB-D907-11D0-9583-00C04FB925D3", KSMETHODSETID_Wavetable); - #define KSMETHODSETID_Wavetable DEFINE_GUIDNAMED(KSMETHODSETID_Wavetable) - - typedef enum { - KSMETHOD_WAVETABLE_WAVE_ALLOC, - KSMETHOD_WAVETABLE_WAVE_FREE, - KSMETHOD_WAVETABLE_WAVE_FIND, - KSMETHOD_WAVETABLE_WAVE_WRITE - } KSMETHOD_WAVETABLE; - - typedef struct { - KSIDENTIFIER Identifier; // wave identifier - ULONG Size; // wave size - BOOL Looped; // wave looped flag - ULONG LoopPoint; // wave loop point - BOOL InROM; // wave InROM flag - KSDATAFORMAT Format; // wave format - } KSWAVETABLE_WAVE_DESC, *PKSWAVETABLE_WAVE_DESC; - - - //=========================================================================== - //=========================================================================== - - /* - Property sets and items - */ - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSPROPSETID_Itd3d\ - 0x6429f090L, 0x9fd9, 0x11d0, 0xa7, 0x5b, 0x00, 0xa0, 0xc9, 0x03, 0x65, 0xe3 - DEFINE_GUIDSTRUCT("6429f090-9fd9-11d0-a75b-00a0c90365e3", KSPROPSETID_Itd3d); - #define KSPROPSETID_Itd3d DEFINE_GUIDNAMED(KSPROPSETID_Itd3d) - - typedef enum { - KSPROPERTY_ITD3D_PARAMS = 0 - } KSPROPERTY_ITD3D; - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSPROPSETID_Hrtf3d\ - 0xb66decb0L, 0xa083, 0x11d0, 0x85, 0x1e, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 - DEFINE_GUIDSTRUCT("b66decb0-a083-11d0-851e-00c04fd9baf3", KSPROPSETID_Hrtf3d); - #define KSPROPSETID_Hrtf3d DEFINE_GUIDNAMED(KSPROPSETID_Hrtf3d) - - typedef enum { - KSPROPERTY_HRTF3D_PARAMS = 0, - KSPROPERTY_HRTF3D_INITIALIZE, - KSPROPERTY_HRTF3D_FILTER_FORMAT - } KSPROPERTY_HRTF3D; - - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSPROPSETID_Wave_Queued\ - 0x16a15b10L, 0x16f0, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("16a15b10-16f0-11d0-a195-0020afd156e4", KSPROPSETID_Wave_Queued); - #define KSPROPSETID_Wave_Queued DEFINE_GUIDNAMED(KSPROPSETID_Wave_Queued) - - #define KSPROPERTY_WAVE_QUEUED_POSITION 0x00000001 - - #define STATIC_KSMETHODSETID_Wave_Queued\ - 0x7432c160L, 0x8827, 0x11cf, 0xa1, 0x02, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 - DEFINE_GUIDSTRUCT("7432c160-8827-11cf-a102-0020afd156e4", KSMETHODSETID_Wave_Queued); - #define KSMETHODSETID_Wave_Queued DEFINE_GUIDNAMED(KSMETHODSETID_Wave_Queued) - - #define KSMETHOD_WAVE_QUEUED_BREAKLOOP 0x00000001 - - #define STATIC_KSPROPSETID_Wave\ - 0x924e54b0L, 0x630f, 0x11cf, 0xad, 0xa7, 0x08, 0x00, 0x3e, 0x30, 0x49, 0x4a - DEFINE_GUIDSTRUCT("924e54b0-630f-11cf-ada7-08003e30494a", KSPROPSETID_Wave); - #define KSPROPSETID_Wave DEFINE_GUIDNAMED(KSPROPSETID_Wave) - - typedef enum { - KSPROPERTY_WAVE_COMPATIBLE_CAPABILITIES, - KSPROPERTY_WAVE_INPUT_CAPABILITIES, - KSPROPERTY_WAVE_OUTPUT_CAPABILITIES, - KSPROPERTY_WAVE_BUFFER, - KSPROPERTY_WAVE_FREQUENCY, - KSPROPERTY_WAVE_VOLUME, - KSPROPERTY_WAVE_PAN - } KSPROPERTY_WAVE; - - typedef struct { - ULONG ulDeviceType; - } KSWAVE_COMPATCAPS, *PKSWAVE_COMPATCAPS; - - #define KSWAVE_COMPATCAPS_INPUT 0x00000000 - #define KSWAVE_COMPATCAPS_OUTPUT 0x00000001 - - typedef struct { - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG ActiveConnections; - } KSWAVE_INPUT_CAPABILITIES, *PKSWAVE_INPUT_CAPABILITIES; - - typedef struct { - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG StaticConnections; - ULONG StreamingConnections; - ULONG ActiveConnections; - ULONG ActiveStaticConnections; - ULONG ActiveStreamingConnections; - ULONG Total3DConnections; - ULONG Static3DConnections; - ULONG Streaming3DConnections; - ULONG Active3DConnections; - ULONG ActiveStatic3DConnections; - ULONG ActiveStreaming3DConnections; - ULONG TotalSampleMemory; - ULONG FreeSampleMemory; - ULONG LargestFreeContiguousSampleMemory; - } KSWAVE_OUTPUT_CAPABILITIES, *PKSWAVE_OUTPUT_CAPABILITIES; - - typedef struct { - LONG LeftAttenuation; - LONG RightAttenuation; - } KSWAVE_VOLUME, *PKSWAVE_VOLUME; - - #define KSWAVE_BUFFER_ATTRIBUTEF_LOOPING 0x00000001 - #define KSWAVE_BUFFER_ATTRIBUTEF_STATIC 0x00000002 - - typedef struct { - ULONG Attributes; - ULONG BufferSize; - PVOID BufferAddress; - } KSWAVE_BUFFER, *PKSWAVE_BUFFER; - - //=========================================================================== - //=========================================================================== - - #define STATIC_KSMUSIC_TECHNOLOGY_PORT\ - 0x86C92E60L, 0x62E8, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("86C92E60-62E8-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_PORT); - #define KSMUSIC_TECHNOLOGY_PORT DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_PORT) - - #define STATIC_KSMUSIC_TECHNOLOGY_SQSYNTH\ - 0x0ECF4380L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("0ECF4380-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_SQSYNTH); - #define KSMUSIC_TECHNOLOGY_SQSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SQSYNTH) - - #define STATIC_KSMUSIC_TECHNOLOGY_FMSYNTH\ - 0x252C5C80L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("252C5C80-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_FMSYNTH); - #define KSMUSIC_TECHNOLOGY_FMSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_FMSYNTH) - - #define STATIC_KSMUSIC_TECHNOLOGY_WAVETABLE\ - 0x394EC7C0L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("394EC7C0-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_WAVETABLE); - #define KSMUSIC_TECHNOLOGY_WAVETABLE DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_WAVETABLE) - - #define STATIC_KSMUSIC_TECHNOLOGY_SWSYNTH\ - 0x37407736L, 0x3620, 0x11D1, 0x85, 0xD3, 0x00, 0x00, 0xF8, 0x75, 0x43, 0x80 - DEFINE_GUIDSTRUCT("37407736-3620-11D1-85D3-0000F8754380", KSMUSIC_TECHNOLOGY_SWSYNTH); - #define KSMUSIC_TECHNOLOGY_SWSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SWSYNTH) - - #define STATIC_KSPROPSETID_WaveTable\ - 0x8539E660L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("8539E660-62E9-11CF-A5D6-28DB04C10000", KSPROPSETID_WaveTable); - #define KSPROPSETID_WaveTable DEFINE_GUIDNAMED(KSPROPSETID_WaveTable) - - typedef enum { - KSPROPERTY_WAVETABLE_LOAD_SAMPLE, - KSPROPERTY_WAVETABLE_UNLOAD_SAMPLE, - KSPROPERTY_WAVETABLE_MEMORY, - KSPROPERTY_WAVETABLE_VERSION - } KSPROPERTY_WAVETABLE; - - typedef struct { - KSDATARANGE DataRange; - GUID Technology; - ULONG Channels; - ULONG Notes; - ULONG ChannelMask; - } KSDATARANGE_MUSIC, *PKSDATARANGE_MUSIC; - - //=========================================================================== - - #define STATIC_KSEVENTSETID_Cyclic\ - 0x142C1AC0L, 0x072A, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("142C1AC0-072A-11D0-A5D6-28DB04C10000", KSEVENTSETID_Cyclic); - #define KSEVENTSETID_Cyclic DEFINE_GUIDNAMED(KSEVENTSETID_Cyclic) - - typedef enum { - KSEVENT_CYCLIC_TIME_INTERVAL, - } KSEVENT_CYCLIC_TIME; - - #define STATIC_KSPROPSETID_Cyclic\ - 0x3FFEAEA0L, 0x2BEE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("3FFEAEA0-2BEE-11CF-A5D6-28DB04C10000", KSPROPSETID_Cyclic); - #define KSPROPSETID_Cyclic DEFINE_GUIDNAMED(KSPROPSETID_Cyclic) - - typedef enum { - KSPROPERTY_CYCLIC_POSITION, - } KSPROPERTY_CYCLIC; - - //=========================================================================== - #define STATIC_KSEVENTSETID_AudioControlChange\ - 0xE85E9698L, 0xFA2F, 0x11D1, 0x95, 0xBD, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 - DEFINE_GUIDSTRUCT("E85E9698-FA2F-11D1-95BD-00C04FB925D3", KSEVENTSETID_AudioControlChange); - #define KSEVENTSETID_AudioControlChange DEFINE_GUIDNAMED(KSEVENTSETID_AudioControlChange) - - typedef enum { - KSEVENT_CONTROL_CHANGE, - } KSEVENT_AUDIO_CONTROL_CHANGE; - - //=========================================================================== - - #define STATIC_KSEVENTSETID_LoopedStreaming\ - 0x4682B940L, 0xC6EF, 0x11D0, 0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D - DEFINE_GUIDSTRUCT("4682B940-C6EF-11D0-96D8-00AA0051E51D", KSEVENTSETID_LoopedStreaming); - #define KSEVENTSETID_LoopedStreaming DEFINE_GUIDNAMED(KSEVENTSETID_LoopedStreaming) - - typedef enum { - KSEVENT_LOOPEDSTREAMING_POSITION, - } KSEVENT_LOOPEDSTREAMING; - - typedef struct { - KSEVENTDATA KsEventData; - #if defined(_NTDDK_) - ULONGLONG Position; - #else // !_NTDDK_ - DWORDLONG Position; - #endif // !_NTDDK_ - } LOOPEDSTREAMING_POSITION_EVENT_DATA, *PLOOPEDSTREAMING_POSITION_EVENT_DATA ; - - #define STATIC_KSEVENTSETID_Sysaudio \ - 0x04800320L, 0x4491, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("04800320-4491-11D1-A050-405705C10000", KSEVENTSETID_Sysaudio); - #define KSEVENTSETID_Sysaudio DEFINE_GUIDNAMED(KSEVENTSETID_Sysaudio) - - typedef enum { - KSEVENT_SYSAUDIO_ADDREMOVE_DEVICE, - KSEVENT_SYSAUDIO_CHANGE_DEVICE - } KSEVENT_SYSAUDIO; - - #define STATIC_KSPROPSETID_Sysaudio\ - 0xCBE3FAA0L, 0xCC75, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 - DEFINE_GUIDSTRUCT("CBE3FAA0-CC75-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio); - #define KSPROPSETID_Sysaudio DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio) - - typedef enum { - KSPROPERTY_SYSAUDIO_DEVICE_COUNT = 1, - KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME, - KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE, - KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME, - KSPROPERTY_SYSAUDIO_SELECT_GRAPH, - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_DEVICE_DEFAULT, - KSPROPERTY_SYSAUDIO_ALWAYS_CREATE_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_ADDREMOVE_LOCK, - KSPROPERTY_SYSAUDIO_ADDREMOVE_UNLOCK, - KSPROPERTY_SYSAUDIO_RENDER_PIN_INSTANCES, - KSPROPERTY_SYSAUDIO_RENDER_CONNECTION_INDEX, - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE_ONLY, - KSPROPERTY_SYSAUDIO_INSTANCE_INFO, - KSPROPERTY_SYSAUDIO_PREFERRED_DEVICE - } KSPROPERTY_SYSAUDIO; - - typedef struct { - KSPROPERTY Property; - GUID PinCategory; - GUID PinName; - } SYSAUDIO_CREATE_VIRTUAL_SOURCE, *PSYSAUDIO_CREATE_VIRTUAL_SOURCE; - - typedef struct { - KSPROPERTY Property; - ULONG PinId; - ULONG NodeId; - ULONG Flags; - ULONG Reserved; - } SYSAUDIO_SELECT_GRAPH, *PSYSAUDIO_SELECT_GRAPH; - - typedef struct { - KSPROPERTY Property; - ULONG Flags; - ULONG DeviceNumber; - } SYSAUDIO_INSTANCE_INFO, *PSYSAUDIO_INSTANCE_INFO; - - #define SYSAUDIO_FLAGS_DONT_COMBINE_PINS 0x00000001 - - typedef struct { - KSPROPERTY Property; - ULONG Flags; - ULONG Index; // KSPROPERTY_SYSAUDIO_DEFAULT_TYPE - } SYSAUDIO_PREFERRED_DEVICE, *PSYSAUDIO_PREFERRED_DEVICE; - - #define SYSAUDIO_FLAGS_CLEAR_PREFERRED 0x00000002 - - typedef enum { // preferred device index - KSPROPERTY_SYSAUDIO_NORMAL_DEFAULT = 0, - KSPROPERTY_SYSAUDIO_PLAYBACK_DEFAULT, - KSPROPERTY_SYSAUDIO_RECORD_DEFAULT, - KSPROPERTY_SYSAUDIO_MIDI_DEFAULT, - KSPROPERTY_SYSAUDIO_MIXER_DEFAULT - } KSPROPERTY_SYSAUDIO_DEFAULT_TYPE; - - #define STATIC_KSPROPSETID_Sysaudio_Pin \ - 0xA3A53220L, 0xC6E4, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 - DEFINE_GUIDSTRUCT("A3A53220-C6E4-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio_Pin); - #define KSPROPSETID_Sysaudio_Pin DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio_Pin) - - typedef enum { - KSPROPERTY_SYSAUDIO_TOPOLOGY_CONNECTION_INDEX, - KSPROPERTY_SYSAUDIO_ATTACH_VIRTUAL_SOURCE, - KSPROPERTY_SYSAUDIO_PIN_VOLUME_NODE - } KSPROPERTY_SYSAUDIO_PIN; - - typedef struct { - KSPROPERTY Property; - ULONG MixerPinId; - ULONG Reserved; - } SYSAUDIO_ATTACH_VIRTUAL_SOURCE, *PSYSAUDIO_ATTACH_VIRTUAL_SOURCE; - - typedef struct { - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; - } KSNODEPROPERTY, *PKSNODEPROPERTY; - - typedef struct { - KSNODEPROPERTY NodeProperty; - LONG Channel; // value to get or set - ULONG Reserved; - } KSNODEPROPERTY_AUDIO_CHANNEL, *PKSNODEPROPERTY_AUDIO_CHANNEL; - - typedef struct { - KSNODEPROPERTY NodeProperty; - ULONG DevSpecificId; - ULONG DeviceInfo; - ULONG Length; - } KSNODEPROPERTY_AUDIO_DEV_SPECIFIC, *PKSNODEPROPERTY_AUDIO_DEV_SPECIFIC; - - typedef struct { - KSNODEPROPERTY NodeProperty; - PVOID ListenerId; - #ifndef _WIN64 - ULONG Reserved; - #endif // _WIN64 - } KSNODEPROPERTY_AUDIO_3D_LISTENER, *PKSNODEPROPERTY_AUDIO_3D_LISTENER; - - typedef struct { - KSNODEPROPERTY NodeProperty; - PVOID AppContext; - ULONG Length; - #ifndef _WIN64 - ULONG Reserved; - #endif // _WIN64 - } KSNODEPROPERTY_AUDIO_PROPERTY, *PKSNODEPROPERTY_AUDIO_PROPERTY; - - //=========================================================================== - - #define STATIC_KSPROPSETID_Linear\ - 0x5A2FFE80L, 0x16B9, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("5A2FFE80-16B9-11D0-A5D6-28DB04C10000", KSPROPSETID_Linear); - #define KSPROPSETID_Linear DEFINE_GUIDNAMED(KSPROPSETID_Linear) - - typedef enum { - KSPROPERTY_LINEAR_POSITION, - } KSPROPERTY_LINEAR; - - //=========================================================================== - - // - // Midi definitions - // - - /* - Formats - */ - - #define STATIC_KSDATAFORMAT_TYPE_MUSIC\ - 0xE725D360L, 0x62CC, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("E725D360-62CC-11CF-A5D6-28DB04C10000", KSDATAFORMAT_TYPE_MUSIC); - #define KSDATAFORMAT_TYPE_MUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MUSIC) - - // 'mids' == MEDIATYPE_Midi - #define STATIC_KSDATAFORMAT_TYPE_MIDI\ - 0x7364696DL, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - DEFINE_GUIDSTRUCT("7364696D-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_MIDI); - #define KSDATAFORMAT_TYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MIDI) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MIDI\ - 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("1D262760-E957-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI); - #define KSDATAFORMAT_SUBTYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MIDI_BUS\ - 0x2CA15FA0L, 0x6CFE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 - DEFINE_GUIDSTRUCT("2CA15FA0-6CFE-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI_BUS); - #define KSDATAFORMAT_SUBTYPE_MIDI_BUS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI_BUS) - - #define STATIC_KSDATAFORMAT_SUBTYPE_RIFFMIDI\ - 0x4995DAF0L, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("4995DAF0-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFFMIDI); - #define KSDATAFORMAT_SUBTYPE_RIFFMIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFMIDI) - - /* - KSDATAFORMAT_SUBTYPE_DIRECTMUSIC - see DMusicKS.h - */ - - // WARNING! This structure MUST be dword aligned - // regardless of the number of data bytes. - - typedef struct { - ULONG TimeDeltaMs; // Delta Milliseconds from the previous midiformat - // in the packet. The first midiformat in the packet - // is a delta from the PTS in the KSSTREAM_HEADER. - ULONG ByteCount; // Number of bytes of data that follow this struct. - } KSMUSICFORMAT, *PKSMUSICFORMAT; - - // - // This entire set of MPEG Standard/Dialect Guids are obsolete. Do not use them. - // - //==================================================================================================== - //==================================================================================================== - // The following official MPEG Formats, Subtypes and Specifiers are listed as required or optional - // These official MPEG GUIDs are the preferred method of supporting MPEG/AC-3 media types in new code. - // Older MPEG GUIDs should also be supported for compatibilty, but these new modes are still required. - //==================================================================================================== - //==================================================================================================== - - /* - This is a summary of what media types/specifiers will be required for all DVD+DSS+DVB+DTV MPEG decoders. - These media types are what the decoder driver must accept, hardware support for all of these media types - may or may not actually be provided by the decoder natively. These media types are intended to define - the "officially" supported MPEG/AC-3 media types that all WHQL certified decoders must implement. This - specifically includes driver and/or hardware support for all the required standards and dialects. - - All MPEG video decoders must support all of the MPEG video modes shown as [required] below. - All MPEG audio decoders must support all of the MPEG audio modes shown as [required] below. - All AC-3 audio decoders must support all of the AC-3 audio modes shown as [required] below. - The line items shown as [optional] need not be implemented, but are possible formats that might be implemented. - - Note that the input/output pin formats are defined by 2 or 3 GUIDs: TYPE, SUBTYPE, and maybe SPECIFIER. - The specifiers are included if the data format is a "dialect" that needs to be differentiated during decoding. - The decoder MUST be prepared to deal with ALL requests for _required_ "Standard" formats OR _required_ "Dialects". - - STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] - STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] - STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO [required] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO [optional] - STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO [required] - STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO [optional] - - Note that the SPECIFIER GUIDs normally identify particular versions of MPEG such as DSS and DVD. - This approach was taken to minimize the number of DSS/DVB/DVD/DTV etc. media SUBTYPES. - These specifiers are currently required to disambiguate MPEG syntax _parsing_ by the decoder - using alternate parsing routines or downloadable firmware or hardware decode settings. - - In the future these specifiers will be extended to cover new KS MPEG flavors such as DVB and DTV. - Thus, the optional specifiers will be subject to clarification and/or definition as they are needed. - - Important note: Per the ITU MPEG specs, MPEG 2 media may contain pure MPEG 1 syntax and - any "MPEG 2" PES packets may actually contain MPEG 1 payloads and MPEG 1 syntax. Some MPEG - broadcasts can revert from MPEG2 to MPEG1 format data at their discretion, without warning. - - CAUTION: Decoders MUST attempt to process MPEG data AS SOON AS POSSIBLE after reception. - In particular, elementary MPEG or MPEG PES packet streams should not be aggregated into DVD - "pack headers" internally before submission to the codec hardware if AT ALL POSSIBLE. The - reason is that mpeg data may need to be processed immediately but there may be no additional - MPEG data forthcoming to fill up the PES packet OR DVD "pack" in a timely fashion. This is - particularly true of MPEG dialects that utilize "repeat field signally" to reuse the last - decoded MPEG video field. - - */ - - ///////////////////////////////////////////////////////////////////////// - // The major data type GUIDs that define the data packet encapsulation // - ///////////////////////////////////////////////////////////////////////// - - // STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM - #define STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM \ - 0x36523b11L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B11-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM ); - #define KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM) - - // STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET - #define STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET \ - 0x36523b12L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B12-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PES_PACKET ); - #define KSDATAFORMAT_TYPE_STANDARD_PES_PACKET DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PES_PACKET) - - // STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER - #define STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER \ - 0x36523b13L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B13-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER ); - #define KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER) - - /////////////////////////////////////////////////////////////////////////////// - // The minor data subtype GUIDs that define the exact class of the data type.// - /////////////////////////////////////////////////////////////////////////////// - - // STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO - #define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO \ - 0x36523b21L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B21-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO ); - #define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO) - - // STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO - #define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO \ - 0x36523b22L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B22-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO ); - #define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO) - - // STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO - #define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO \ - 0x36523b23L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B23-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO ); - #define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO) - - // STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO - #define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO \ - 0x36523b24L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B24-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO ); - #define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO) - - // STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO - #define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO \ - 0x36523b25L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B25-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO ); - #define KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO) - - /////////////////////////////////////////////////////////////////////////////// - // The low-level specifier GUIDs that define the flavor of the data subtype. // - // Some SUBTYPES, notably MPEG2_VIDEO, MPEG2_AUDIO have different dialects. // - // These specifiers are intended to be accompanied by a specifier structure. // - /////////////////////////////////////////////////////////////////////////////// - - // STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO - #define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO \ - 0x36523b31L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B31-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO ); - #define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO) - - // STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO - #define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO \ - 0x36523b32L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B32-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO ); - #define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO) - - // STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO Associated with KS_MPEGVIDEOINFO2 defined later - #define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO \ - 0x36523b33L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B33-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO ); - #define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO) - - // STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO Associated with KS_MPEGAUDIOINFO defined later - #define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO \ - 0x36523b34L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B34-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO ); - #define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO) - - // STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO - #define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO \ - 0x36523b35L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a - DEFINE_GUIDSTRUCT("36523B35-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO ); - #define KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO) - - //==================================================================================================== - //==================================================================================================== - // *** COMPATIBILITY WARNING *** - // The *following* older DSS, MPEG, DVD & AC-3 GUID definitions are retained for backward compability. - // These MPEG GUIDs should also be supported for compatibilty, but the above newer modes are still required. - //==================================================================================================== - //==================================================================================================== - - // - // DSS definitions - // - - #define STATIC_KSDATAFORMAT_SUBTYPE_DSS_VIDEO\ - 0xa0af4f81L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("a0af4f81-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_VIDEO); - #define KSDATAFORMAT_SUBTYPE_DSS_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_VIDEO) - - #define STATIC_KSDATAFORMAT_SUBTYPE_DSS_AUDIO\ - 0xa0af4f82L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("a0af4f82-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_AUDIO); - #define KSDATAFORMAT_SUBTYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_AUDIO) - - // - // End of obsolete MPEG definitions. - // - - // - // mpeg 1 definitions - // - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Packet\ - 0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 - DEFINE_GUIDSTRUCT("e436eb80-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Packet); - #define KSDATAFORMAT_SUBTYPE_MPEG1Packet DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Packet) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Payload\ - 0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 - DEFINE_GUIDSTRUCT("e436eb81-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Payload); - #define KSDATAFORMAT_SUBTYPE_MPEG1Payload DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Payload) - - // MEDIASUBTYPE_MPEG1Video - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Video\ - 0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 - DEFINE_GUIDSTRUCT("e436eb86-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Video); - #define KSDATAFORMAT_SUBTYPE_MPEG1Video DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Video) - - //FORMAT_MPEGVideo - #define STATIC_KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO\ - 0x05589f82L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a - DEFINE_GUIDSTRUCT("05589f82-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO); - #define KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO) - - // - // mpeg 2 definitions - // - #define STATIC_KSDATAFORMAT_TYPE_MPEG2_PES\ - 0xe06d8020L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8020-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PES); - #define KSDATAFORMAT_TYPE_MPEG2_PES DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PES) - - #define STATIC_KSDATAFORMAT_TYPE_MPEG2_PROGRAM\ - 0xe06d8022L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8022-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PROGRAM); - #define KSDATAFORMAT_TYPE_MPEG2_PROGRAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PROGRAM) - - #define STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT\ - 0xe06d8023L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8023-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_TRANSPORT); - #define KSDATAFORMAT_TYPE_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_TRANSPORT) - - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO\ - 0xe06d8026L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8026-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO); - #define KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO) - - // use MPEGVIDEOINFO2 (defined below) with KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO - #define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO\ - 0xe06d80e3L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d80e3-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO); - #define KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO) - - - // - // Mpeg2 video properties - // - - - #define STATIC_KSPROPSETID_Mpeg2Vid\ - 0xC8E11B60L, 0x0CC9, 0x11D0, 0xBD, 0x69, 0x00, 0x35, 0x05, 0xC1, 0x03, 0xA9 - DEFINE_GUIDSTRUCT("C8E11B60-0CC9-11D0-BD69-003505C103A9", KSPROPSETID_Mpeg2Vid); - #define KSPROPSETID_Mpeg2Vid DEFINE_GUIDNAMED( KSPROPSETID_Mpeg2Vid ) - - - typedef enum { - KSPROPERTY_MPEG2VID_MODES, // available output modes of decoder - KSPROPERTY_MPEG2VID_CUR_MODE, // current mode of the decoder - KSPROPERTY_MPEG2VID_4_3_RECT, // output coordinates for 4:3 source - KSPROPERTY_MPEG2VID_16_9_RECT, // output coordinates for 16:9 source - KSPROPERTY_MPEG2VID_16_9_PANSCAN, // pan and scan vectors - } KSPROPERTY_MPEG2VID; - - // - // bit field definitions for MPEG2 VIDEO mode - // - - #define KSMPEGVIDMODE_PANSCAN 0x0001 - #define KSMPEGVIDMODE_LTRBOX 0x0002 - #define KSMPEGVIDMODE_SCALE 0x0004 - - // - // rectangle definitions for the 4/3 and 16/9 cropping properties of - // the MPEG2Video decoder - // - - typedef struct _KSMPEGVID_RECT { - ULONG StartX; - ULONG StartY; - ULONG EndX; - ULONG EndY; - } KSMPEGVID_RECT, *PKSMPEGVID_RECT; - - // - // Params for pan / scan - // - - - // - // MPEG2 Audio definition - // - - #define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO\ - 0xe06d802bL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d802b-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO); - #define KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO) - - #define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO\ - 0xe06d80e5L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d80e5-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO); - #define KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO) - - // - // DVD LPCM Audio definition - // - - #define STATIC_KSDATAFORMAT_SUBTYPE_LPCM_AUDIO\ - 0xe06d8032L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8032-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_LPCM_AUDIO); - #define KSDATAFORMAT_SUBTYPE_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_LPCM_AUDIO) - - #define STATIC_KSDATAFORMAT_SPECIFIER_LPCM_AUDIO\ - 0xe06d80e6L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d80e6-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_LPCM_AUDIO); - #define KSDATAFORMAT_SPECIFIER_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_LPCM_AUDIO) - - // - // AC-3 definition - // - - #define STATIC_KSDATAFORMAT_SUBTYPE_AC3_AUDIO\ - 0xe06d802cL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d802c-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_AC3_AUDIO); - #define KSDATAFORMAT_SUBTYPE_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_AC3_AUDIO) - - #define STATIC_KSDATAFORMAT_SPECIFIER_AC3_AUDIO\ - 0xe06d80e4L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d80e4-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_AC3_AUDIO); - #define KSDATAFORMAT_SPECIFIER_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_AC3_AUDIO) - - #define STATIC_KSPROPSETID_AC3\ - 0xBFABE720L, 0x6E1F, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 - DEFINE_GUIDSTRUCT("BFABE720-6E1F-11D0-BCF2-444553540000", KSPROPSETID_AC3); - #define KSPROPSETID_AC3 DEFINE_GUIDNAMED(KSPROPSETID_AC3) - - typedef enum { - KSPROPERTY_AC3_ERROR_CONCEALMENT = 1, - KSPROPERTY_AC3_ALTERNATE_AUDIO, - KSPROPERTY_AC3_DOWNMIX, - KSPROPERTY_AC3_BIT_STREAM_MODE, - KSPROPERTY_AC3_DIALOGUE_LEVEL, - KSPROPERTY_AC3_LANGUAGE_CODE, - KSPROPERTY_AC3_ROOM_TYPE - } KSPROPERTY_AC3; - - typedef struct { - BOOL fRepeatPreviousBlock; - BOOL fErrorInCurrentBlock; - } KSAC3_ERROR_CONCEALMENT, *PKSAC3_ERROR_CONCEALMENT; - - typedef struct { - BOOL fStereo; - ULONG DualMode; - } KSAC3_ALTERNATE_AUDIO, *PKSAC3_ALTERNATE_AUDIO; - - #define KSAC3_ALTERNATE_AUDIO_1 1 - #define KSAC3_ALTERNATE_AUDIO_2 2 - #define KSAC3_ALTERNATE_AUDIO_BOTH 3 - - typedef struct { - BOOL fDownMix; - BOOL fDolbySurround; - } KSAC3_DOWNMIX, *PKSAC3_DOWNMIX; - - typedef struct { - LONG BitStreamMode; - } KSAC3_BIT_STREAM_MODE, *PKSAC3_BIT_STREAM_MODE; - - #define KSAC3_SERVICE_MAIN_AUDIO 0 - #define KSAC3_SERVICE_NO_DIALOG 1 - #define KSAC3_SERVICE_VISUALLY_IMPAIRED 2 - #define KSAC3_SERVICE_HEARING_IMPAIRED 3 - #define KSAC3_SERVICE_DIALOG_ONLY 4 - #define KSAC3_SERVICE_COMMENTARY 5 - #define KSAC3_SERVICE_EMERGENCY_FLASH 6 - #define KSAC3_SERVICE_VOICE_OVER 7 - - typedef struct { - ULONG DialogueLevel; - } KSAC3_DIALOGUE_LEVEL, *PKSAC3_DIALOGUE_LEVEL; - - typedef struct { - BOOL fLargeRoom; - } KSAC3_ROOM_TYPE, *PKSAC3_ROOM_TYPE; - - - // - // DTS and SDDS definitions (media subtype GUIDs) - // - #define STATIC_KSDATAFORMAT_SUBTYPE_DTS_AUDIO\ - 0xe06d8033L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8033-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_DTS_AUDIO); - #define KSDATAFORMAT_SUBTYPE_DTS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DTS_AUDIO) - - #define STATIC_KSDATAFORMAT_SUBTYPE_SDDS_AUDIO\ - 0xe06d8034L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d8034-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SDDS_AUDIO); - #define KSDATAFORMAT_SUBTYPE_SDDS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SDDS_AUDIO) - - - // - // audio decoder output properties - // - - #define STATIC_KSPROPSETID_AudioDecoderOut\ - 0x6ca6e020L, 0x43bd, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 - DEFINE_GUIDSTRUCT("6ca6e020-43bd-11d0-bd6a-003505c103a9", KSPROPSETID_AudioDecoderOut); - #define KSPROPSETID_AudioDecoderOut DEFINE_GUIDNAMED(KSPROPSETID_AudioDecoderOut) - - typedef enum { - KSPROPERTY_AUDDECOUT_MODES, // available output modes of decoder - KSPROPERTY_AUDDECOUT_CUR_MODE, // current mode of the decoder - } KSPROPERTY_AUDDECOUT; - - #define KSAUDDECOUTMODE_STEREO_ANALOG 0x0001 - #define KSAUDDECOUTMODE_PCM_51 0x0002 - #define KSAUDDECOUTMODE_SPDIFF 0x0004 - - - - // - // subpicture definition - // - - #define STATIC_KSDATAFORMAT_SUBTYPE_SUBPICTURE\ - 0xe06d802dL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea - DEFINE_GUIDSTRUCT("e06d802d-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SUBPICTURE); - #define KSDATAFORMAT_SUBTYPE_SUBPICTURE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SUBPICTURE) - - - #define STATIC_KSPROPSETID_DvdSubPic\ - 0xac390460L, 0x43af, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 - DEFINE_GUIDSTRUCT("ac390460-43af-11d0-bd6a-003505c103a9", KSPROPSETID_DvdSubPic); - #define KSPROPSETID_DvdSubPic DEFINE_GUIDNAMED(KSPROPSETID_DvdSubPic) - - typedef enum { - KSPROPERTY_DVDSUBPIC_PALETTE, - KSPROPERTY_DVDSUBPIC_HLI, - KSPROPERTY_DVDSUBPIC_COMPOSIT_ON, // TRUE for subpicture is displayed - } KSPROPERTY_DVDSUBPIC; - - typedef struct _KS_DVD_YCrCb { - UCHAR Reserved; - UCHAR Y; - UCHAR Cr; - UCHAR Cb; - } KS_DVD_YCrCb, *PKS_DVD_YCrCb; - - /* The KS_DVD_YUV structure is now superseded by KS_DVD_YCrCb above and is - here for backward compatibility only */ - - typedef struct _KS_DVD_YUV { - UCHAR Reserved; - UCHAR Y; - UCHAR V; - UCHAR U; - } KS_DVD_YUV, *PKS_DVD_YUV; - - typedef struct _KSPROPERTY_SPPAL { - KS_DVD_YUV sppal[16]; - } KSPROPERTY_SPPAL, *PKSPROPERTY_SPPAL; - - typedef struct _KS_COLCON { - UCHAR emph1col:4; - UCHAR emph2col:4; - UCHAR backcol:4; - UCHAR patcol:4; - UCHAR emph1con:4; - UCHAR emph2con:4; - UCHAR backcon:4; - UCHAR patcon:4; - - } KS_COLCON, *PKS_COLCON; - - typedef struct _KSPROPERTY_SPHLI { - USHORT HLISS; - USHORT Reserved; - ULONG StartPTM; // start presentation time in x/90000 - ULONG EndPTM; // end PTM in x/90000 - USHORT StartX; - USHORT StartY; - USHORT StopX; - USHORT StopY; - KS_COLCON ColCon; // color contrast description (4 bytes as given in HLI) - } KSPROPERTY_SPHLI, *PKSPROPERTY_SPHLI; - - typedef BOOL KSPROPERTY_COMPOSIT_ON, *PKSPROPERTY_COMPOSIT_ON; - - #define STATIC_KSPROPSETID_CopyProt \ - 0x0E8A0A40L, 0x6AEF, 0x11D0, 0x9E, 0xD0, 0x00, 0xA0, 0x24, 0xCA, 0x19, 0xB3 - DEFINE_GUIDSTRUCT("0E8A0A40-6AEF-11D0-9ED0-00A024CA19B3", KSPROPSETID_CopyProt); - #define KSPROPSETID_CopyProt DEFINE_GUIDNAMED(KSPROPSETID_CopyProt) - - typedef enum { - - KSPROPERTY_DVDCOPY_CHLG_KEY = 0x01, - KSPROPERTY_DVDCOPY_DVD_KEY1, - KSPROPERTY_DVDCOPY_DEC_KEY2, - KSPROPERTY_DVDCOPY_TITLE_KEY, - KSPROPERTY_COPY_MACROVISION, - KSPROPERTY_DVDCOPY_REGION, - KSPROPERTY_DVDCOPY_SET_COPY_STATE, - KSPROPERTY_DVDCOPY_DISC_KEY = 0x80 - - } KSPROPERTY_COPYPROT; - - typedef struct _KS_DVDCOPY_CHLGKEY { - BYTE ChlgKey[10]; - BYTE Reserved[2]; - } KS_DVDCOPY_CHLGKEY, *PKS_DVDCOPY_CHLGKEY; - - typedef struct _KS_DVDCOPY_BUSKEY { - BYTE BusKey[5]; - BYTE Reserved[1]; - } KS_DVDCOPY_BUSKEY, *PKS_DVDCOPY_BUSKEY; - - - typedef struct _KS_DVDCOPY_DISCKEY { - BYTE DiscKey[2048]; - } KS_DVDCOPY_DISCKEY, *PKS_DVDCOPY_DISCKEY; - - typedef struct _KS_DVDCOPY_REGION { - UCHAR Reserved; - UCHAR RegionData; - UCHAR Reserved2[2]; - } KS_DVDCOPY_REGION, *PKS_DVDCOPY_REGION; - - typedef struct _KS_DVDCOPY_TITLEKEY { - ULONG KeyFlags; - ULONG ReservedNT[2]; - UCHAR TitleKey[6]; - UCHAR Reserved[2]; - } KS_DVDCOPY_TITLEKEY, *PKS_DVDCOPY_TITLEKEY; - - typedef struct _KS_COPY_MACROVISION { - ULONG MACROVISIONLevel; - } KS_COPY_MACROVISION, *PKS_COPY_MACROVISION; - - typedef struct _KS_DVDCOPY_SET_COPY_STATE { - ULONG DVDCopyState; - } KS_DVDCOPY_SET_COPY_STATE, *PKS_DVDCOPY_SET_COPY_STATE; - - typedef enum { - KS_DVDCOPYSTATE_INITIALIZE, // indicates we are starting a full - // copy protection sequence. - KS_DVDCOPYSTATE_INITIALIZE_TITLE, // indicates we are starting a title - // key copy protection sequence - KS_DVDCOPYSTATE_AUTHENTICATION_NOT_REQUIRED, - KS_DVDCOPYSTATE_AUTHENTICATION_REQUIRED, - KS_DVDCOPYSTATE_DONE, - } KS_DVDCOPYSTATE; - - typedef enum { - KS_MACROVISION_DISABLED, - KS_MACROVISION_LEVEL1, - KS_MACROVISION_LEVEL2, - KS_MACROVISION_LEVEL3 - } KS_COPY_MACROVISION_LEVEL, *PKS_COPY_MACROVISION_LEVEL; - - // - // CGMS Copy Protection Flags - // - - #define KS_DVD_CGMS_RESERVED_MASK 0x00000078 - - #define KS_DVD_CGMS_COPY_PROTECT_MASK 0x00000018 - #define KS_DVD_CGMS_COPY_PERMITTED 0x00000000 - #define KS_DVD_CGMS_COPY_ONCE 0x00000010 - #define KS_DVD_CGMS_NO_COPY 0x00000018 - - #define KS_DVD_COPYRIGHT_MASK 0x00000040 - #define KS_DVD_NOT_COPYRIGHTED 0x00000000 - #define KS_DVD_COPYRIGHTED 0x00000040 - - #define KS_DVD_SECTOR_PROTECT_MASK 0x00000020 - #define KS_DVD_SECTOR_NOT_PROTECTED 0x00000000 - #define KS_DVD_SECTOR_PROTECTED 0x00000020 - - - //=========================================================================== - // The following MUST match the structures in WinGDI.h and AMVideo.h - //=========================================================================== - - #define STATIC_KSCATEGORY_TVTUNER \ - 0xa799a800L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 - DEFINE_GUIDSTRUCT("a799a800-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVTUNER); - #define KSCATEGORY_TVTUNER DEFINE_GUIDNAMED(KSCATEGORY_TVTUNER) - - #define STATIC_KSCATEGORY_CROSSBAR \ - 0xa799a801L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 - DEFINE_GUIDSTRUCT("a799a801-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_CROSSBAR); - #define KSCATEGORY_CROSSBAR DEFINE_GUIDNAMED(KSCATEGORY_CROSSBAR) - - #define STATIC_KSCATEGORY_TVAUDIO \ - 0xa799a802L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 - DEFINE_GUIDSTRUCT("a799a802-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVAUDIO); - #define KSCATEGORY_TVAUDIO DEFINE_GUIDNAMED(KSCATEGORY_TVAUDIO) - - #define STATIC_KSCATEGORY_VPMUX \ - 0xa799a803L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 - DEFINE_GUIDSTRUCT("a799a803-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_VPMUX); - #define KSCATEGORY_VPMUX DEFINE_GUIDNAMED(KSCATEGORY_VPMUX) - - #define STATIC_KSCATEGORY_VBICODEC \ - 0x07dad660L, 0x22f1, 0x11d1, 0xa9, 0xf4, 0x00, 0xc0, 0x4f, 0xbb, 0xde, 0x8f - DEFINE_GUIDSTRUCT("07dad660-22f1-11d1-a9f4-00c04fbbde8f", KSCATEGORY_VBICODEC); - #define KSCATEGORY_VBICODEC DEFINE_GUIDNAMED(KSCATEGORY_VBICODEC) - - // SUBTYPE_VPVideo - #define STATIC_KSDATAFORMAT_SUBTYPE_VPVideo\ - 0x5a9b6a40L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("5a9b6a40-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVideo); - #define KSDATAFORMAT_SUBTYPE_VPVideo DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVideo) - - // SUBTYPE_VPVBI - #define STATIC_KSDATAFORMAT_SUBTYPE_VPVBI\ - 0x5a9b6a41L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("5a9b6a41-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVBI); - #define KSDATAFORMAT_SUBTYPE_VPVBI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVBI) - - - // FORMAT_VideoInfo - #define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO\ - 0x05589f80L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a - DEFINE_GUIDSTRUCT("05589f80-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_VIDEOINFO); - #define KSDATAFORMAT_SPECIFIER_VIDEOINFO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO) - - // FORMAT_VideoInfo2 - #define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO2\ - 0xf72a76A0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("f72a76A0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VIDEOINFO2); - #define KSDATAFORMAT_SPECIFIER_VIDEOINFO2 DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO2) - - // MEDIATYPE_AnalogVideo - #define STATIC_KSDATAFORMAT_TYPE_ANALOGVIDEO\ - 0x0482dde1L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 - DEFINE_GUIDSTRUCT("0482dde1-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_TYPE_ANALOGVIDEO); - #define KSDATAFORMAT_TYPE_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_ANALOGVIDEO) - - // FORMAT_AnalogVideo - #define STATIC_KSDATAFORMAT_SPECIFIER_ANALOGVIDEO\ - 0x0482dde0L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 - DEFINE_GUIDSTRUCT("0482dde0-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_SPECIFIER_ANALOGVIDEO); - #define KSDATAFORMAT_SPECIFIER_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_ANALOGVIDEO) - - // FORMAT_VBI - #define STATIC_KSDATAFORMAT_SPECIFIER_VBI\ - 0xf72a76e0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("f72a76e0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VBI); - #define KSDATAFORMAT_SPECIFIER_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VBI) - - // MEDIATYPE_VBI - #define STATIC_KSDATAFORMAT_TYPE_VBI\ - 0xf72a76e1L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("f72a76e1-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_TYPE_VBI); - #define KSDATAFORMAT_TYPE_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VBI) - - // SUBTYPE_RAW8 - #define STATIC_KSDATAFORMAT_SUBTYPE_RAW8\ - 0xca20d9a0, 0x3e3e, 0x11d1, 0x9b, 0xf9, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0xbf - DEFINE_GUIDSTRUCT("ca20d9a0-3e3e-11d1-9bf9-00c04fbbdebf", KSDATAFORMAT_SUBTYPE_RAW8); - #define KSDATAFORMAT_SUBTYPE_RAW8 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RAW8) - - // MEDIASUBTYPE_CC - #define STATIC_KSDATAFORMAT_SUBTYPE_CC\ - 0x33214cc1, 0x11f, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe - DEFINE_GUIDSTRUCT("33214CC1-011F-11D2-B4B1-00A0D102CFBE", KSDATAFORMAT_SUBTYPE_CC); - #define KSDATAFORMAT_SUBTYPE_CC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_CC) - - // MEDIASUBTYPE_NABTS - #define STATIC_KSDATAFORMAT_SUBTYPE_NABTS\ - 0xf72a76e2L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("f72a76e2-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_NABTS); - #define KSDATAFORMAT_SUBTYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS) - - // MEDIASUBTYPE_TELETEXT - #define STATIC_KSDATAFORMAT_SUBTYPE_TELETEXT\ - 0xf72a76e3L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("f72a76e3-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_TELETEXT); - #define KSDATAFORMAT_SUBTYPE_TELETEXT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_TELETEXT) - - - - /* constants for the biCompression field */ - #define KS_BI_RGB 0L - #define KS_BI_RLE8 1L - #define KS_BI_RLE4 2L - #define KS_BI_BITFIELDS 3L - - typedef struct tagKS_RGBQUAD { // rgbq - BYTE rgbBlue; - BYTE rgbGreen; - BYTE rgbRed; - BYTE rgbReserved; - } KS_RGBQUAD, *PKS_RGBQUAD; - - /* constants for palettes */ - #define KS_iPALETTE_COLORS 256 // Maximum colours in palette - #define KS_iEGA_COLORS 16 // Number colours in EGA palette - #define KS_iMASK_COLORS 3 // Maximum three components - #define KS_iTRUECOLOR 16 // Minimum true colour device - #define KS_iRED 0 // Index position for RED mask - #define KS_iGREEN 1 // Index position for GREEN mask - #define KS_iBLUE 2 // Index position for BLUE mask - #define KS_iPALETTE 8 // Maximum colour depth using a palette - #define KS_iMAXBITS 8 // Maximum bits per colour component - #define KS_SIZE_EGA_PALETTE (KS_iEGA_COLORS * sizeof(KS_RGBQUAD)) - #define KS_SIZE_PALETTE (KS_iPALETTE_COLORS * sizeof(KS_RGBQUAD)) - - typedef struct tagKS_BITMAPINFOHEADER{ - DWORD biSize; - LONG biWidth; - LONG biHeight; - WORD biPlanes; - WORD biBitCount; - DWORD biCompression; - DWORD biSizeImage; - LONG biXPelsPerMeter; - LONG biYPelsPerMeter; - DWORD biClrUsed; - DWORD biClrImportant; - } KS_BITMAPINFOHEADER, *PKS_BITMAPINFOHEADER; - - // Used for true colour images that also have a palette - - typedef struct tag_KS_TRUECOLORINFO { - DWORD dwBitMasks[KS_iMASK_COLORS]; - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; - } KS_TRUECOLORINFO, *PKS_TRUECOLORINFO; - - - #define KS_WIDTHBYTES(bits) ((DWORD)(((bits)+31) & (~31)) / 8) - #define KS_DIBWIDTHBYTES(bi) (DWORD)KS_WIDTHBYTES((DWORD)(bi).biWidth * (DWORD)(bi).biBitCount) - #define KS__DIBSIZE(bi) (KS_DIBWIDTHBYTES(bi) * (DWORD)(bi).biHeight) - #define KS_DIBSIZE(bi) ((bi).biHeight < 0 ? (-1)*(KS__DIBSIZE(bi)) : KS__DIBSIZE(bi)) - - typedef LONGLONG REFERENCE_TIME; - - // The BITMAPINFOHEADER contains all the details about the video stream such - // as the actual image dimensions and their pixel depth. A source filter may - // also request that the sink take only a section of the video by providing a - // clipping rectangle in rcSource. In the worst case where the sink filter - // forgets to check this on connection it will simply render the whole thing - // which isn't a disaster. Ideally a sink filter will check the rcSource and - // if it doesn't support image extraction and the rectangle is not empty then - // it will reject the connection. A filter should use SetRectEmpty to reset a - // rectangle to all zeroes (and IsRectEmpty to later check the rectangle). - // The rcTarget specifies the destination rectangle for the video, for most - // source filters they will set this to all zeroes, a downstream filter may - // request that the video be placed in a particular area of the buffers it - // supplies in which case it will call QueryAccept with a non empty target - - typedef struct tagKS_VIDEOINFOHEADER { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - KS_BITMAPINFOHEADER bmiHeader; - - } KS_VIDEOINFOHEADER, *PKS_VIDEOINFOHEADER; - - // !!! WARNING !!! - // DO NOT use the following structure unless you are sure that the BITMAPINFOHEADER - // has a normal biSize == sizeof(BITMAPINFOHEADER) ! - // !!! WARNING !!! - - typedef struct tagKS_VIDEOINFO { - - RECT rcSource; // The bit we really want to use - RECT rcTarget; // Where the video should go - DWORD dwBitRate; // Approximate bit data rate - DWORD dwBitErrorRate; // Bit error rate for this stream - REFERENCE_TIME AvgTimePerFrame; // Average time per frame (100ns units) - - KS_BITMAPINFOHEADER bmiHeader; - - union { - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; // Colour palette - DWORD dwBitMasks[KS_iMASK_COLORS]; // True colour masks - KS_TRUECOLORINFO TrueColorInfo; // Both of the above - }; - - } KS_VIDEOINFO, *PKS_VIDEOINFO; - - - #define KS_SIZE_MASKS (KS_iMASK_COLORS * sizeof(DWORD)) - #define KS_SIZE_PREHEADER (FIELD_OFFSET(KS_VIDEOINFOHEADER,bmiHeader)) - - // For normal size - // #define KS_SIZE_VIDEOHEADER (sizeof(KS_BITMAPINFOHEADER) + KS_SIZE_PREHEADER) - // !!! for abnormal biSizes - #define KS_SIZE_VIDEOHEADER(pbmi) ((pbmi)->bmiHeader.biSize + KS_SIZE_PREHEADER) - - // VBI - // Used for NABTS, CC, Intercast, - typedef struct tagKS_VBIINFOHEADER { - ULONG StartLine; // inclusive - ULONG EndLine; // inclusive - ULONG SamplingFrequency; // Hz. - ULONG MinLineStartTime; // microSec * 100 from HSync LE - ULONG MaxLineStartTime; // microSec * 100 from HSync LE - ULONG ActualLineStartTime; // microSec * 100 from HSync LE - ULONG ActualLineEndTime; // microSec * 100 from HSync LE - ULONG VideoStandard; // KS_AnalogVideoStandard* - ULONG SamplesPerLine; - ULONG StrideInBytes; // May be > SamplesPerLine - ULONG BufferSize; // Bytes - } KS_VBIINFOHEADER, *PKS_VBIINFOHEADER; - - // VBI Sampling Rates - #define KS_VBIDATARATE_NABTS (5727272L) - #define KS_VBIDATARATE_CC ( 503493L) // ~= 1/1.986125e-6 - #define KS_VBISAMPLINGRATE_4X_NABTS ((long)(4*KS_VBIDATARATE_NABTS)) - #define KS_VBISAMPLINGRATE_47X_NABTS ((long)(27000000)) - #define KS_VBISAMPLINGRATE_5X_NABTS ((long)(5*KS_VBIDATARATE_NABTS)) - - #define KS_47NABTS_SCALER (KS_VBISAMPLINGRATE_47X_NABTS/(double)KS_VBIDATARATE_NABTS) - - // Analog video variant - Use this when the format is FORMAT_AnalogVideo - // - // rcSource defines the portion of the active video signal to use - // rcTarget defines the destination rectangle - // both of the above are relative to the dwActiveWidth and dwActiveHeight fields - // dwActiveWidth is currently set to 720 for all formats (but could change for HDTV) - // dwActiveHeight is 483 for NTSC and 575 for PAL/SECAM (but could change for HDTV) - - typedef struct tagKS_AnalogVideoInfo { - RECT rcSource; // Width max is 720, height varies w/ TransmissionStd - RECT rcTarget; // Where the video should go - DWORD dwActiveWidth; // Always 720 (CCIR-601 active samples per line) - DWORD dwActiveHeight; // 483 for NTSC, 575 for PAL/SECAM - REFERENCE_TIME AvgTimePerFrame; // Normal ActiveMovie units (100 nS) - } KS_ANALOGVIDEOINFO, *PKS_ANALOGVIDEOINFO; - - //=========================================================================== - // Data packet passed on Analog video stream channel change - //=========================================================================== - - #define KS_TVTUNER_CHANGE_BEGIN_TUNE 0x0001L // Starting a tuning operation - #define KS_TVTUNER_CHANGE_END_TUNE 0x0002L // Ending a tuning operation - - typedef struct tagKS_TVTUNER_CHANGE_INFO { - DWORD dwFlags; // KS_TVTUNER_CHANGE_* - DWORD dwCountryCode; - DWORD dwAnalogVideoStandard; // KS_AnalogVideoStandard - DWORD dwChannel; - } KS_TVTUNER_CHANGE_INFO, *PKS_TVTUNER_CHANGE_INFO; - - //=========================================================================== - // Video format blocks - //=========================================================================== - - typedef enum { - KS_MPEG2Level_Low, - KS_MPEG2Level_Main, - KS_MPEG2Level_High1440, - KS_MPEG2Level_High - } KS_MPEG2Level; - - typedef enum { - KS_MPEG2Profile_Simple, - KS_MPEG2Profile_Main, - KS_MPEG2Profile_SNRScalable, - KS_MPEG2Profile_SpatiallyScalable, - KS_MPEG2Profile_High - } KS_MPEG2Profile; - - #define KS_INTERLACE_IsInterlaced 0x00000001 // if 0, other interlace bits are irrelevent - #define KS_INTERLACE_1FieldPerSample 0x00000002 // else 2 fields per media sample - #define KS_INTERLACE_Field1First 0x00000004 // else Field 2 is first; top field in PAL is field 1, top field in NTSC is field 2? - #define KS_INTERLACE_UNUSED 0x00000008 // - #define KS_INTERLACE_FieldPatternMask 0x00000030 // use this mask with AMINTERLACE_FieldPat* - #define KS_INTERLACE_FieldPatField1Only 0x00000000 // Data never contains a Field2 - #define KS_INTERLACE_FieldPatField2Only 0x00000010 // Data never contains a Field1 - #define KS_INTERLACE_FieldPatBothRegular 0x00000020 // There will be a Field2 for every Field1 (required for Weave?) - #define KS_INTERLACE_FieldPatBothIrregular 0x00000030 // Random pattern of Field1s and Field2s - #define KS_INTERLACE_DisplayModeMask 0x000000c0 - #define KS_INTERLACE_DisplayModeBobOnly 0x00000000 - #define KS_INTERLACE_DisplayModeWeaveOnly 0x00000040 - #define KS_INTERLACE_DisplayModeBobOrWeave 0x00000080 - - - - #define KS_MPEG2_DoPanScan 0x00000001 //if set, the MPEG-2 video decoder should crop output image - // based on pan-scan vectors in picture_display_extension - // and change the picture aspect ratio accordingly. - #define KS_MPEG2_DVDLine21Field1 0x00000002 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 1 - #define KS_MPEG2_DVDLine21Field2 0x00000004 //if set, the MPEG-2 decoder must be able to produce an output - // pin for DVD style closed caption data found in GOP layer of field 2 - #define KS_MPEG2_SourceIsLetterboxed 0x00000008 //if set, indicates that black bars have been encoded in the top - // and bottom of the video. - #define KS_MPEG2_FilmCameraMode 0x00000010 //if set, indicates "film mode" used for 625/50 content. If cleared, - // indicates that "camera mode" was used. - #define KS_MPEG2_LetterboxAnalogOut 0x00000020 //if set and this stream is sent to an analog output, it should - // be letterboxed. Streams sent to VGA should be letterboxed only by renderers. - #define KS_MPEG2_DSS_UserData 0x00000040 //if set, the MPEG-2 decoder must process DSS style user data - #define KS_MPEG2_DVB_UserData 0x00000080 //if set, the MPEG-2 decoder must process DVB style user data - #define KS_MPEG2_27MhzTimebase 0x00000100 //if set, the PTS,DTS timestamps advance at 27MHz rather than 90KHz - - typedef struct tagKS_VIDEOINFOHEADER2 { - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - DWORD dwInterlaceFlags; // use AMINTERLACE_* defines. Reject connection if undefined bits are not 0 - DWORD dwCopyProtectFlags; // use AMCOPYPROTECT_* defines. Reject connection if undefined bits are not 0 - DWORD dwPictAspectRatioX; // X dimension of picture aspect ratio, e.g. 16 for 16x9 display - DWORD dwPictAspectRatioY; // Y dimension of picture aspect ratio, e.g. 9 for 16x9 display - DWORD dwReserved1; // must be 0; reject connection otherwise - DWORD dwReserved2; // must be 0; reject connection otherwise - KS_BITMAPINFOHEADER bmiHeader; - } KS_VIDEOINFOHEADER2, *PKS_VIDEOINFOHEADER2; - - typedef struct tagKS_MPEG1VIDEOINFO { - KS_VIDEOINFOHEADER hdr; // Compatible with VIDEOINFO - DWORD dwStartTimeCode; // 25-bit Group of pictures time code at start of data - DWORD cbSequenceHeader; // Length in bytes of bSequenceHeader - BYTE bSequenceHeader[1]; // Sequence header including quantization matrices if any - } KS_MPEG1VIDEOINFO, *PKS_MPEG1VIDEOINFO; - - #define KS_MAX_SIZE_MPEG1_SEQUENCE_INFO 140 - #define KS_SIZE_MPEG1VIDEOINFO(pv) (FIELD_OFFSET(KS_MPEG1VIDEOINFO, bSequenceHeader[0]) + (pv)->cbSequenceHeader) - #define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - - typedef struct tagKS_MPEGVIDEOINFO2 { - KS_VIDEOINFOHEADER2 hdr; - DWORD dwStartTimeCode; // ?? not used for DVD ?? - DWORD cbSequenceHeader; // is 0 for DVD (no sequence header) - DWORD dwProfile; // use enum MPEG2Profile - DWORD dwLevel; // use enum MPEG2Level - DWORD dwFlags; // use AMMPEG2_* defines. Reject connection if undefined bits are not 0 - DWORD bSequenceHeader[1]; // DWORD instead of Byte for alignment purposes - // For MPEG-2, if a sequence_header is included, the sequence_extension - // should also be included - } KS_MPEGVIDEOINFO2, *PKS_MPEGVIDEOINFO2; - - - #define KS_SIZE_MPEGVIDEOINFO2(pv) (FIELD_OFFSET(KS_MPEGVIDEOINFO2, bSequenceHeader[0]) + (pv)->cbSequenceHeader) - #define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader) - - //=========================================================================== - // Audio format blocks - //=========================================================================== - - //if set, the PTS,DTS timestamps advance at 27MHz rather than 90KHz - #define KS_MPEGAUDIOINFO_27MhzTimebase 0x00000001 - - typedef struct tagKS_MPEAUDIOINFO { - DWORD dwFlags; // use KS_MPEGAUDIOINFO_* defines. Reject connection if undefined bits are not 0 - DWORD dwReserved1; // must be 0; reject connection otherwise - DWORD dwReserved2; // must be 0; reject connection otherwise - DWORD dwReserved3; // must be 0; reject connection otherwise - } KS_MPEGAUDIOINFO, *PKS_MPEGAUDIOINFO; - - //=========================================================================== - // Video DATAFORMATs - //=========================================================================== - - typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER { - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER VideoInfoHeader; - } KS_DATAFORMAT_VIDEOINFOHEADER, *PKS_DATAFORMAT_VIDEOINFOHEADER; - - typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER2 { - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER2 VideoInfoHeader2; - } KS_DATAFORMAT_VIDEOINFOHEADER2, *PKS_DATAFORMAT_VIDEOINFOHEADER2; - - typedef struct tagKS_DATAFORMAT_VIDEOINFO_PALETTE { - KSDATAFORMAT DataFormat; - KS_VIDEOINFO VideoInfo; - } KS_DATAFORMAT_VIDEOINFO_PALETTE, *PKS_DATAFORMAT_VIDEOINFO_PALETTE; - - typedef struct tagKS_DATAFORMAT_VBIINFOHEADER { - KSDATAFORMAT DataFormat; - KS_VBIINFOHEADER VBIInfoHeader; - } KS_DATAFORMAT_VBIINFOHEADER, *PKS_DATAFORMAT_VBIINFOHEADER; - - typedef struct _KS_VIDEO_STREAM_CONFIG_CAPS { - GUID guid; // will be MEDIATYPE_Video - ULONG VideoStandard; // logical OR of all AnalogVideoStandards - // supported - SIZE InputSize; // the inherent size of the incoming signal - // (every pixel unique) - SIZE MinCroppingSize; // smallest rcSrc cropping rect allowed - SIZE MaxCroppingSize; // largest rcSrc cropping rect allowed - int CropGranularityX; // granularity of cropping size - int CropGranularityY; - int CropAlignX; // alignment of cropping rect - int CropAlignY; - SIZE MinOutputSize; // smallest bitmap stream can produce - SIZE MaxOutputSize; // largest bitmap stream can produce - int OutputGranularityX; // granularity of output bitmap size - int OutputGranularityY; - int StretchTapsX; // 0, no stretch, 1 pix dup, 2 interp, ... - int StretchTapsY; // Describes quality of hardware scaler - int ShrinkTapsX; // - int ShrinkTapsY; // - LONGLONG MinFrameInterval; // 100 nS units - LONGLONG MaxFrameInterval; - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; - } KS_VIDEO_STREAM_CONFIG_CAPS, *PKS_VIDEO_STREAM_CONFIG_CAPS; - - //=========================================================================== - // Video DATARANGEs - //=========================================================================== - - typedef struct tagKS_DATARANGE_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER VideoInfoHeader; // default format - } KS_DATARANGE_VIDEO, *PKS_DATARANGE_VIDEO; - - typedef struct tagKS_DATARANGE_VIDEO2 { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER2 VideoInfoHeader; // default format - } KS_DATARANGE_VIDEO2, *PKS_DATARANGE_VIDEO2; - - typedef struct tagKS_DATARANGE_MPEG1_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEG1VIDEOINFO VideoInfoHeader; // default format - } KS_DATARANGE_MPEG1_VIDEO, *PKS_DATARANGE_MPEG1_VIDEO; - - typedef struct tagKS_DATARANGE_MPEG2_VIDEO { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEGVIDEOINFO2 VideoInfoHeader; // default format - } KS_DATARANGE_MPEG2_VIDEO, *PKS_DATARANGE_MPEG2_VIDEO; - - typedef struct tagKS_DATARANGE_VIDEO_PALETTE { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFO VideoInfo; // default format - } KS_DATARANGE_VIDEO_PALETTE, *PKS_DATARANGE_VIDEO_PALETTE; - - typedef struct tagKS_DATARANGE_VIDEO_VBI { - KSDATARANGE DataRange; - BOOL bFixedSizeSamples; // all samples same size? - BOOL bTemporalCompression; // all I frames? - DWORD StreamDescriptionFlags; // KS_VIDEO_DESC_* - DWORD MemoryAllocationFlags; // KS_VIDEO_ALLOC_* - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VBIINFOHEADER VBIInfoHeader; // default format - } KS_DATARANGE_VIDEO_VBI, *PKS_DATARANGE_VIDEO_VBI; - - typedef struct tagKS_DATARANGE_ANALOGVIDEO { - KSDATARANGE DataRange; - KS_ANALOGVIDEOINFO AnalogVideoInfo; - } KS_DATARANGE_ANALOGVIDEO, *PKS_DATARANGE_ANALOGVIDEO; - - //=========================================================================== - // StreamDescriptionFlags - // - // These define the "purpose" of each video stream - //=========================================================================== - - #define KS_VIDEOSTREAM_PREVIEW 0x0001 // Preview stream - #define KS_VIDEOSTREAM_CAPTURE 0x0002 // Capture stream - #define KS_VIDEOSTREAM_VBI 0x0010 // Field1 VBI - #define KS_VIDEOSTREAM_NABTS 0x0020 // Field1 NABTS - #define KS_VIDEOSTREAM_CC 0x0100 // Closed Captioning - #define KS_VIDEOSTREAM_EDS 0x0200 // Extended Data Services - #define KS_VIDEOSTREAM_TELETEXT 0x0400 // Field1 Teletext only - #define KS_VIDEOSTREAM_STILL 0x1000 // Still image input - #define KS_VIDEOSTREAM_IS_VPE 0x8000 // Is a VPE based stream? - - // MemoryAllocationFlags - #define KS_VIDEO_ALLOC_VPE_SYSTEM 0x0001 // VPE surface in system memory - #define KS_VIDEO_ALLOC_VPE_DISPLAY 0x0002 // VPE surface in display memory - #define KS_VIDEO_ALLOC_VPE_AGP 0x0004 // VPE surface in AGP memory - - ////////////////////////////////////////////////////////////// - // Capture driver VBI property sets - ////////////////////////////////////////////////////////////// - - // {F162C607-7B35-496f-AD7F-2DCA3B46B718} - #define STATIC_KSPROPSETID_VBICAP_PROPERTIES\ - 0xf162c607, 0x7b35, 0x496f, 0xad, 0x7f, 0x2d, 0xca, 0x3b, 0x46, 0xb7, 0x18 - DEFINE_GUIDSTRUCT("F162C607-7B35-496f-AD7F-2DCA3B46B718", KSPROPSETID_VBICAP_PROPERTIES); - #define KSPROPSETID_VBICAP_PROPERTIES DEFINE_GUIDNAMED(KSPROPSETID_VBICAP_PROPERTIES) - - typedef enum { - KSPROPERTY_VBICAP_PROPERTIES_PROTECTION = 0x01, - } KSPROPERTY_VBICAP; - - typedef struct _VBICAP_PROPERTIES_PROTECTION_S { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG Status; - } VBICAP_PROPERTIES_PROTECTION_S, *PVBICAP_PROPERTIES_PROTECTION_S; - #define KS_VBICAP_PROTECTION_MV_PRESENT 0x0001L - #define KS_VBICAP_PROTECTION_MV_HARDWARE 0x0002L - #define KS_VBICAP_PROTECTION_MV_DETECTED 0x0004L - - - /***************************************************************************/ - /* VBI Related GUIDs, structs and properties for codecs(generic, cc, nabts)*/ - /***************************************************************************/ - - /////////////////////////////////////////////////////////////////////////////////////// - // IP/NABTS Protocol Reserved Group IDs - Overall Range 0x800-0x8FF [Decimal 2048-2079] - // Intervening values(0-F) are used if there are multiple providers at a particular tier - /////////////////////////////////////////////////////////////////////////////////////// - - // Used by individual content creators in show footage/data - #define KS_NABTS_GROUPID_ORIGINAL_CONTENT_BASE 0x800 - #define KS_NABTS_GROUPID_ORIGINAL_CONTENT_ADVERTISER_BASE 0x810 - - // Used by production company in finished show data - #define KS_NABTS_GROUPID_PRODUCTION_COMPANY_CONTENT_BASE 0x820 - #define KS_NABTS_GROUPID_PRODUCTION_COMPANY_ADVERTISER_BASE 0x830 - - // Used by broadcast syndicates in syndicated show data - #define KS_NABTS_GROUPID_SYNDICATED_SHOW_CONTENT_BASE 0x840 - #define KS_NABTS_GROUPID_SYNDICATED_SHOW_ADVERTISER_BASE 0x850 - - // Used by tv networks in network television data - #define KS_NABTS_GROUPID_NETWORK_WIDE_CONTENT_BASE 0x860 - #define KS_NABTS_GROUPID_NETWORK_WIDE_ADVERTISER_BASE 0x870 - - // Used by telvision stations in local programming data - #define KS_NABTS_GROUPID_TELEVISION_STATION_CONTENT_BASE 0x880 - #define KS_NABTS_GROUPID_TELEVISION_STATION_ADVERTISER_BASE 0x890 - - // Used by cable system in cable head-end originated data - #define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_CONTENT_BASE 0x8A0 - #define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_ADVERTISER_BASE 0x8B0 - - // The values between 0x8C0 - 0x8EF are reserved for future expansion - - // Used by Microsoft for Testing purposes (0x8F0 - 0x8FF) - #define KS_NABTS_GROUPID_MICROSOFT_RESERVED_TEST_DATA_BASE 0x8F0 - - ////////////////////////////////////////////////////////////// - // Stream Format FEC-corrected NABTS bundles - ////////////////////////////////////////////////////////////// - - #define STATIC_KSDATAFORMAT_TYPE_NABTS \ - 0xe757bca0, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f - DEFINE_GUIDSTRUCT("E757BCA0-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_TYPE_NABTS); - #define KSDATAFORMAT_TYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_NABTS) - - #define STATIC_KSDATAFORMAT_SUBTYPE_NABTS_FEC \ - 0xe757bca1, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f - DEFINE_GUIDSTRUCT("E757BCA1-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_SUBTYPE_NABTS_FEC); - #define KSDATAFORMAT_SUBTYPE_NABTS_FEC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS_FEC) - - - ////////////////////////////////////////////////////////////// - // NABTS Bundle data structure definition - ////////////////////////////////////////////////////////////// - - #define MAX_NABTS_VBI_LINES_PER_FIELD 11 - #define NABTS_LINES_PER_BUNDLE 16 - #define NABTS_PAYLOAD_PER_LINE 28 - #define NABTS_BYTES_PER_LINE 36 - - typedef struct _NABTSFEC_BUFFER { - ULONG dataSize; - USHORT groupID; - USHORT Reserved; - UCHAR data[NABTS_LINES_PER_BUNDLE * NABTS_PAYLOAD_PER_LINE]; - } NABTSFEC_BUFFER, *PNABTSFEC_BUFFER; - - ////////////////////////////////////////////////////////////// - // vbi codec filtering pin properties - ////////////////////////////////////////////////////////////// - - #define STATIC_KSPROPSETID_VBICodecFiltering \ - 0xcafeb0caL, 0x8715, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0xc0, 0xed, 0xba, 0xbe - DEFINE_GUIDSTRUCT("cafeb0ca-8715-11d0-bd6a-0035c0edbabe", KSPROPSETID_VBICodecFiltering); - #define KSPROPSETID_VBICodecFiltering DEFINE_GUIDNAMED(KSPROPSETID_VBICodecFiltering) - - typedef enum { - KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY = 0x01, - KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_STATISTICS, - } KSPROPERTY_VBICODECFILTERING; - - typedef struct _VBICODECFILTERING_SCANLINES { - DWORD DwordBitArray[32]; // An array of scanline bits 0..1024(32*32) - } VBICODECFILTERING_SCANLINES, *PVBICODECFILTERING_SCANLINES; - - typedef struct _VBICODECFILTERING_NABTS_SUBSTREAMS { - DWORD SubstreamMask[128]; // An array of 4096 bits (one for each NABTS GroupID) - } VBICODECFILTERING_NABTS_SUBSTREAMS, *PVBICODECFILTERING_NABTS_SUBSTREAMS; - - typedef struct _VBICODECFILTERING_CC_SUBSTREAMS { - DWORD SubstreamMask; // An array of 32 bits (see KS_CC_SUBSTREAM *) - } VBICODECFILTERING_CC_SUBSTREAMS, *PVBICODECFILTERING_CC_SUBSTREAMS; - - #define KS_CC_SUBSTREAM_ODD 0x0001L - #define KS_CC_SUBSTREAM_EVEN 0x0002L - #define KS_CC_SUBSTREAM_SERVICE_MASK_DC1 0x00F0L // DataChannel1: CC1,CC3,T1,T3 - #define KS_CC_SUBSTREAM_SERVICE_CC1 0x0010L - #define KS_CC_SUBSTREAM_SERVICE_CC3 0x0020L - #define KS_CC_SUBSTREAM_SERVICE_T1 0x0040L - #define KS_CC_SUBSTREAM_SERVICE_T3 0x0080L - #define KS_CC_SUBSTREAM_SERVICE_MASK_DC2 0x0F00L // DataChannel2: CC2,CC4,T2,T4 - #define KS_CC_SUBSTREAM_SERVICE_CC2 0x0100L - #define KS_CC_SUBSTREAM_SERVICE_CC4 0x0200L - #define KS_CC_SUBSTREAM_SERVICE_T2 0x0400L - #define KS_CC_SUBSTREAM_SERVICE_T4 0x0800L - #define KS_CC_SUBSTREAM_SERVICE_XDS 0x1000L - - /////////////////////////////////////////////////////////////////// - // Hardware decoded CC stream format - /////////////////////////////////////////////////////////////////// - - #define CC_MAX_HW_DECODE_LINES 12 - typedef struct _CC_BYTE_PAIR { - BYTE Decoded[2]; - USHORT Reserved; - } CC_BYTE_PAIR, *PCC_BYTE_PAIR; - - typedef struct _CC_HW_FIELD { - VBICODECFILTERING_SCANLINES ScanlinesRequested; - ULONG fieldFlags; // KS_VBI_FLAG_FIELD1,2 - LONGLONG PictureNumber; - CC_BYTE_PAIR Lines[CC_MAX_HW_DECODE_LINES]; - } CC_HW_FIELD, *PCC_HW_FIELD; - - /////////////////////////////////////////////////////////////////// - // Raw NABTS stream format (TYPE_NABTS, SUBTYPE_NABTS) - /////////////////////////////////////////////////////////////////// - - // These low-level structures are byte packed( -Zp1 ) - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - typedef struct _NABTS_BUFFER_LINE { - BYTE Confidence; - BYTE Bytes[NABTS_BYTES_PER_LINE]; - } NABTS_BUFFER_LINE, *PNABTS_BUFFER_LINE; - - #define NABTS_BUFFER_PICTURENUMBER_SUPPORT 1 - typedef struct _NABTS_BUFFER { - VBICODECFILTERING_SCANLINES ScanlinesRequested; - LONGLONG PictureNumber; - NABTS_BUFFER_LINE NabtsLines[MAX_NABTS_VBI_LINES_PER_FIELD]; - } NABTS_BUFFER, *PNABTS_BUFFER; - #if !defined( PACK_PRAGMAS_NOT_SUPPORTED ) - #include - #endif - - // - // Common codec statistics - // - - typedef struct _VBICODECFILTERING_STATISTICS_COMMON { - DWORD InputSRBsProcessed; // upstream SRBs received - DWORD OutputSRBsProcessed; // downstream SRBs sent - DWORD SRBsIgnored; // SRBs ignored due to no requests - DWORD InputSRBsMissing; // SRBs dropped upstream - DWORD OutputSRBsMissing; // Output dropped because no SRB pending - DWORD OutputFailures; // dropped because of other failure - DWORD InternalErrors; // could not process due to int. failure - DWORD ExternalErrors; // could not process due to ext. failure - DWORD InputDiscontinuities; // discontinuities received - DWORD DSPFailures; // DSP confidence failure - DWORD TvTunerChanges; // number of received KS_TVTUNER_CHANGE_BEGIN_TUNE and KS_TVTUNER_CHANGE_END_TUNE pairs. - DWORD VBIHeaderChanges; // number of received KS_VBI_FLAG_VBIINFOHEADER_CHANGE - DWORD LineConfidenceAvg; // Average of all DSP confidence results - DWORD BytesOutput; // Bytes sent downstream - } VBICODECFILTERING_STATISTICS_COMMON, *PVBICODECFILTERING_STATISTICS_COMMON; - - typedef struct _VBICODECFILTERING_STATISTICS_COMMON_PIN { - DWORD SRBsProcessed; // SRBs sent/received - DWORD SRBsIgnored; // SRBs ignored due to filtering - DWORD SRBsMissing; // SRBs not sent/received - DWORD InternalErrors; // could not send/receive due to int. failure - DWORD ExternalErrors; // could not send/receive due to ext. failure - DWORD Discontinuities; // discontinuities received/sent - DWORD LineConfidenceAvg; // Average of all DSP confidence results for this pin - DWORD BytesOutput; // Bytes sent downstream - } VBICODECFILTERING_STATISTICS_COMMON_PIN, *PVBICODECFILTERING_STATISTICS_COMMON_PIN; - - // - // Codec-specific statistics - NABTS - // - - typedef struct _VBICODECFILTERING_STATISTICS_NABTS { - VBICODECFILTERING_STATISTICS_COMMON Common; // Generic VBI statistics - DWORD FECBundleBadLines; // Un-FEC-correctable lines - DWORD FECQueueOverflows; // Number of times FEC queue overflowed - DWORD FECCorrectedLines; // Lines CSUM corrected by FEC - DWORD FECUncorrectableLines; // FEC input lines not CSUM correctable - DWORD BundlesProcessed; // Bundles received from FEC - DWORD BundlesSent2IP; // Bundles sent to IP driver - DWORD FilteredLines; // Lines processed and then dropped - // because no one was interested - } VBICODECFILTERING_STATISTICS_NABTS, *PVBICODECFILTERING_STATISTICS_NABTS; - - typedef struct _VBICODECFILTERING_STATISTICS_NABTS_PIN { - VBICODECFILTERING_STATISTICS_COMMON_PIN Common;// Generic VBI pin statistics - } VBICODECFILTERING_STATISTICS_NABTS_PIN, *PVBICODECFILTERING_STATISTICS_NABTS_PIN; - - // - // Codec-specific statistics - Closed Caption - // - - typedef struct _VBICODECFILTERING_STATISTICS_CC { - VBICODECFILTERING_STATISTICS_COMMON Common; // Generic VBI statistics - } VBICODECFILTERING_STATISTICS_CC, *PVBICODECFILTERING_STATISTICS_CC; - - - typedef struct _VBICODECFILTERING_STATISTICS_CC_PIN { - VBICODECFILTERING_STATISTICS_COMMON_PIN Common;// Generic VBI pin statistics - } VBICODECFILTERING_STATISTICS_CC_PIN, *PVBICODECFILTERING_STATISTICS_CC_PIN; - - //////////////////////////////////////////////////////////////////////////// - // VBI codec property structures(based on KSPROPERTY_VBICODECFILTERING enum) - //////////////////////////////////////////////////////////////////////////// - - // *** Most codecs support this property - // KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY - // KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY, - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_SCANLINES Scanlines; - } KSPROPERTY_VBICODECFILTERING_SCANLINES_S, *PKSPROPERTY_VBICODECFILTERING_SCANLINES_S; - - // *** NABTS codecs support this property - // KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, - // KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_NABTS_SUBSTREAMS Substreams; - } KSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S, *PKSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S; - - // *** Closed captioning codecs support this property - // KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, - // KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_CC_SUBSTREAMS Substreams; - } KSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S, *PKSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S; - - // *** Most codecs support these versions of the global and pin properties - // KSPROPERTY_VBICODECFILTERING_STATISTICS - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S; - - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON_PIN Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S; - - // *** NABTS codecs support this version of the global and pin properties - // KSPROPERTY_VBICODECFILTERING_STATISTICS - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S; - - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS_PIN Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S; - - // *** Closed captioning codecs support this version of the global and pin properties - // KSPROPERTY_VBICODECFILTERING_STATISTICS - - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S; - - typedef struct { - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC_PIN Statistics; - } KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S, *PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S; - - // Standard Pin Names for the video capture filter - //=========================================================================== - - #define STATIC_PINNAME_VIDEO_CAPTURE \ - 0xfb6c4281, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - #define STATIC_PINNAME_CAPTURE STATIC_PINNAME_VIDEO_CAPTURE - DEFINE_GUIDSTRUCT("FB6C4281-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CAPTURE); - #define PINNAME_VIDEO_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CAPTURE) - #define PINNAME_CAPTURE PINNAME_VIDEO_CAPTURE - - #define STATIC_PINNAME_VIDEO_CC_CAPTURE \ - 0x1aad8061, 0x12d, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe - #define STATIC_PINNAME_CC_CAPTURE STATIC_PINNAME_VIDEO_CC_CAPTURE - DEFINE_GUIDSTRUCT("1AAD8061-012D-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_CC_CAPTURE); - #define PINNAME_VIDEO_CC_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CC_CAPTURE) - - #define STATIC_PINNAME_VIDEO_NABTS_CAPTURE \ - 0x29703660, 0x498a, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe - #define STATIC_PINNAME_NABTS_CAPTURE STATIC_PINNAME_VIDEO_NABTS_CAPTURE - DEFINE_GUIDSTRUCT("29703660-498A-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_NABTS_CAPTURE); - #define PINNAME_VIDEO_NABTS_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS_CAPTURE) - - #define STATIC_PINNAME_VIDEO_PREVIEW \ - 0xfb6c4282, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - #define STATIC_PINNAME_PREVIEW STATIC_PINNAME_VIDEO_PREVIEW - DEFINE_GUIDSTRUCT("FB6C4282-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_PREVIEW); - #define PINNAME_VIDEO_PREVIEW DEFINE_GUIDNAMED(PINNAME_VIDEO_PREVIEW) - #define PINNAME_PREVIEW PINNAME_VIDEO_PREVIEW - - #define STATIC_PINNAME_VIDEO_ANALOGVIDEOIN \ - 0xfb6c4283, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4283-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_ANALOGVIDEOIN); - #define PINNAME_VIDEO_ANALOGVIDEOIN DEFINE_GUIDNAMED(PINNAME_VIDEO_ANALOGVIDEOIN) - - #define STATIC_PINNAME_VIDEO_VBI \ - 0xfb6c4284, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4284-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VBI); - #define PINNAME_VIDEO_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VBI) - - #define STATIC_PINNAME_VIDEO_VIDEOPORT \ - 0xfb6c4285, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4285-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT); - #define PINNAME_VIDEO_VIDEOPORT DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT) - - #define STATIC_PINNAME_VIDEO_NABTS \ - 0xfb6c4286, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4286-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_NABTS); - #define PINNAME_VIDEO_NABTS DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS) - - #define STATIC_PINNAME_VIDEO_EDS \ - 0xfb6c4287, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4287-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_EDS); - #define PINNAME_VIDEO_EDS DEFINE_GUIDNAMED(PINNAME_VIDEO_EDS) - - #define STATIC_PINNAME_VIDEO_TELETEXT \ - 0xfb6c4288, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4288-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TELETEXT); - #define PINNAME_VIDEO_TELETEXT DEFINE_GUIDNAMED(PINNAME_VIDEO_TELETEXT) - - #define STATIC_PINNAME_VIDEO_CC \ - 0xfb6c4289, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C4289-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CC); - #define PINNAME_VIDEO_CC DEFINE_GUIDNAMED(PINNAME_VIDEO_CC) - - #define STATIC_PINNAME_VIDEO_STILL \ - 0xfb6c428A, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C428A-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_STILL); - #define PINNAME_VIDEO_STILL DEFINE_GUIDNAMED(PINNAME_VIDEO_STILL) - - #define STATIC_PINNAME_VIDEO_TIMECODE \ - 0xfb6c428B, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C428B-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TIMECODE); - #define PINNAME_VIDEO_TIMECODE DEFINE_GUIDNAMED(PINNAME_VIDEO_TIMECODE) - - #define STATIC_PINNAME_VIDEO_VIDEOPORT_VBI \ - 0xfb6c428C, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("FB6C428C-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT_VBI); - #define PINNAME_VIDEO_VIDEOPORT_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT_VBI) - - //=========================================================================== - // KSSTREAM_HEADER extensions for digital video - //=========================================================================== - - #define KS_VIDEO_FLAG_FRAME 0x0000L // Frame or Field (default is frame) - #define KS_VIDEO_FLAG_FIELD1 0x0001L - #define KS_VIDEO_FLAG_FIELD2 0x0002L - - #define KS_VIDEO_FLAG_I_FRAME 0x0000L // I, B, or P (default is I) - #define KS_VIDEO_FLAG_P_FRAME 0x0010L - #define KS_VIDEO_FLAG_B_FRAME 0x0020L - - typedef struct tagKS_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // Field1, Field2, or Frame - LONGLONG PictureNumber; - LONGLONG DropCount; - - // The following are only set when using OverlayMixer - HANDLE hDirectDraw; // user mode DDraw handle - HANDLE hSurfaceHandle; // user mode surface handle - RECT DirectDrawRect; // portion of surface locked - // Reserved fields, never reference these - DWORD Reserved1; - DWORD Reserved2; - DWORD Reserved3; - DWORD Reserved4; - } KS_FRAME_INFO, *PKS_FRAME_INFO; - - //=========================================================================== - // KSSTREAM_HEADER extensions for VBI - //=========================================================================== - - #define KS_VBI_FLAG_FIELD1 0x0001L - #define KS_VBI_FLAG_FIELD2 0x0002L - - #define KS_VBI_FLAG_MV_PRESENT 0x0100L - #define KS_VBI_FLAG_MV_HARDWARE 0x0200L - #define KS_VBI_FLAG_MV_DETECTED 0x0400L - - #define KS_VBI_FLAG_TVTUNER_CHANGE 0x0010L // TvTunerChangeInfo is valid - #define KS_VBI_FLAG_VBIINFOHEADER_CHANGE 0x0020L // VBIInfoHeader is valid - - typedef struct tagKS_VBI_FRAME_INFO { - ULONG ExtendedHeaderSize; // Size of this extended header - DWORD dwFrameFlags; // Field1, Field2, or Frame; & etc - LONGLONG PictureNumber; // Test only? - LONGLONG DropCount; // Test only? - DWORD dwSamplingFrequency; - KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo; - KS_VBIINFOHEADER VBIInfoHeader; - } KS_VBI_FRAME_INFO, *PKS_VBI_FRAME_INFO; - - - //=========================================================================== - // Analog video formats, used with: - // Analog Video Decoders - // TVTuners - // Analog Video Encoders - // - // XXX_STANDARDS_SUPPORTED returns a bitmask - //=========================================================================== - - typedef enum - { - KS_AnalogVideo_None = 0x00000000, // This is a digital sensor - KS_AnalogVideo_NTSC_M = 0x00000001, // 75 IRE Setup - KS_AnalogVideo_NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup - KS_AnalogVideo_NTSC_433 = 0x00000004, - - KS_AnalogVideo_PAL_B = 0x00000010, - KS_AnalogVideo_PAL_D = 0x00000020, - KS_AnalogVideo_PAL_G = 0x00000040, - KS_AnalogVideo_PAL_H = 0x00000080, - KS_AnalogVideo_PAL_I = 0x00000100, - KS_AnalogVideo_PAL_M = 0x00000200, - KS_AnalogVideo_PAL_N = 0x00000400, - - KS_AnalogVideo_PAL_60 = 0x00000800, - - KS_AnalogVideo_SECAM_B = 0x00001000, - KS_AnalogVideo_SECAM_D = 0x00002000, - KS_AnalogVideo_SECAM_G = 0x00004000, - KS_AnalogVideo_SECAM_H = 0x00008000, - KS_AnalogVideo_SECAM_K = 0x00010000, - KS_AnalogVideo_SECAM_K1 = 0x00020000, - KS_AnalogVideo_SECAM_L = 0x00040000, - KS_AnalogVideo_SECAM_L1 = 0x00080000, - - KS_AnalogVideo_PAL_N_COMBO - = 0x00100000 - } KS_AnalogVideoStandard; - - #define KS_AnalogVideo_NTSC_Mask 0x00000007 - #define KS_AnalogVideo_PAL_Mask 0x00100FF0 - #define KS_AnalogVideo_SECAM_Mask 0x000FF000 - - //=========================================================================== - // Property set definitions - // The comments show whether a given property is: - // R : READ only - // w : WRITE only - // RW : READ / WRITE - // O : Optional (return E_UNSUPPORTED if you don't handle this) - //=========================================================================== - - #define STATIC_PROPSETID_ALLOCATOR_CONTROL\ - 0x53171960, 0x148e, 0x11d2, 0x99, 0x79, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - DEFINE_GUIDSTRUCT("53171960-148E-11d2-9979-0000C0CC16BA", PROPSETID_ALLOCATOR_CONTROL); - #define PROPSETID_ALLOCATOR_CONTROL DEFINE_GUIDNAMED(PROPSETID_ALLOCATOR_CONTROL) - typedef enum { - KSPROPERTY_ALLOCATOR_CONTROL_HONOR_COUNT, // R O (will allocate exactly this number of buffers) - KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE, // R O (return 2 DWORDs specifying surface size) - } KSPROPERTY_ALLOCATOR_CONTROL; - - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_VIDEOPROCAMP\ - 0xC6E13360L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("C6E13360-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOPROCAMP); - #define PROPSETID_VIDCAP_VIDEOPROCAMP DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOPROCAMP) - - typedef enum { - KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS, // RW O - KSPROPERTY_VIDEOPROCAMP_CONTRAST, // RW O - KSPROPERTY_VIDEOPROCAMP_HUE, // RW O - KSPROPERTY_VIDEOPROCAMP_SATURATION, // RW O - KSPROPERTY_VIDEOPROCAMP_SHARPNESS, // RW O - KSPROPERTY_VIDEOPROCAMP_GAMMA, // RW O - KSPROPERTY_VIDEOPROCAMP_COLORENABLE, // RW O - KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, // RW O - KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION,// RW O - KSPROPERTY_VIDEOPROCAMP_GAIN, // RW O - } KSPROPERTY_VIDCAP_VIDEOPROCAMP; - - typedef struct { - KSPROPERTY Property; - LONG Value; // Value to set or get - ULONG Flags; // KSPROPERTY_VIDEOPROCAMP_FLAGS_* - ULONG Capabilities; // KSPROPERTY_VIDEOPROCAMP_FLAGS_* - } KSPROPERTY_VIDEOPROCAMP_S, *PKSPROPERTY_VIDEOPROCAMP_S; - - #define KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO 0X0001L - #define KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL 0X0002L - - //=========================================================================== - - #define STATIC_PROPSETID_TUNER\ - 0x6a2e0605L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0605-28e4-11d0-a18c-00a0c9118956", PROPSETID_TUNER); - #define PROPSETID_TUNER DEFINE_GUIDNAMED(PROPSETID_TUNER) - - typedef enum { - KSPROPERTY_TUNER_CAPS, // R -overall device capabilities - KSPROPERTY_TUNER_MODE_CAPS, // R -capabilities in this mode - KSPROPERTY_TUNER_MODE, // RW -set a mode (TV, FM, AM, DSS) - KSPROPERTY_TUNER_STANDARD, // R -get TV standard (only if TV mode) - KSPROPERTY_TUNER_FREQUENCY, // RW -set/get frequency - KSPROPERTY_TUNER_INPUT, // RW -select an input - KSPROPERTY_TUNER_STATUS, // R -tuning status - KSPROPERTY_TUNER_IF_MEDIUM // R O-Medium for IF or Transport Pin - } KSPROPERTY_TUNER; - - typedef enum { - KSPROPERTY_TUNER_MODE_TV = 0X0001, - KSPROPERTY_TUNER_MODE_FM_RADIO = 0X0002, - KSPROPERTY_TUNER_MODE_AM_RADIO = 0X0004, - KSPROPERTY_TUNER_MODE_DSS = 0X0008, - KSPROPERTY_TUNER_MODE_ATSC = 0X0010, // also used for DVB-T, DVB-C - } KSPROPERTY_TUNER_MODES; - - // Describes how the device tunes. Only one of these flags may be set - // in KSPROPERTY_TUNER_MODE_CAPS_S.Strategy - - // Describe how the driver should attempt to tune: - // EXACT: just go to the frequency specified (no fine tuning) - // FINE: (slow) do an exhaustive search for the best signal - // COARSE: (fast) use larger frequency jumps to just determine if any signal - - typedef enum { - KS_TUNER_TUNING_EXACT = 1, // No fine tuning - KS_TUNER_TUNING_FINE, // Fine grained search - KS_TUNER_TUNING_COARSE, // Coarse search - }KS_TUNER_TUNING_FLAGS; - - typedef enum { - KS_TUNER_STRATEGY_PLL = 0X01, // Tune by PLL offset - KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0X02, // Tune by signal strength - KS_TUNER_STRATEGY_DRIVER_TUNES = 0X04, // Driver does fine tuning - }KS_TUNER_STRATEGY; - - typedef struct { - KSPROPERTY Property; - ULONG ModesSupported; // KS_PROPERTY_TUNER_MODES_* - KSPIN_MEDIUM VideoMedium; // GUID_NULL (no pin), or GUID - KSPIN_MEDIUM TVAudioMedium; // GUID_NULL (no pin), or GUID - KSPIN_MEDIUM RadioAudioMedium; // GUID_NULL (no pin), or GUID - } KSPROPERTY_TUNER_CAPS_S, *PKSPROPERTY_TUNER_CAPS_S; - - typedef struct { - KSPROPERTY Property; - KSPIN_MEDIUM IFMedium; // GUID_NULL (no pin), or GUID - } KSPROPERTY_TUNER_IF_MEDIUM_S, *PKSPROPERTY_TUNER_IF_MEDIUM_S; - - typedef struct { - KSPROPERTY Property; - ULONG Mode; // IN: KSPROPERTY_TUNER_MODE - ULONG StandardsSupported; // KS_AnalogVideo_* (if TV or DSS) - ULONG MinFrequency; // Hz - ULONG MaxFrequency; // Hz - ULONG TuningGranularity; // Hz - ULONG NumberOfInputs; // count of inputs - ULONG SettlingTime; // milliSeconds - ULONG Strategy; // KS_TUNER_STRATEGY - } KSPROPERTY_TUNER_MODE_CAPS_S, *PKSPROPERTY_TUNER_MODE_CAPS_S; - - typedef struct { - KSPROPERTY Property; - ULONG Mode; // IN: KSPROPERTY_TUNER_MODE - } KSPROPERTY_TUNER_MODE_S, *PKSPROPERTY_TUNER_MODE_S; - - typedef struct { - KSPROPERTY Property; - ULONG Frequency; // Hz - ULONG LastFrequency; // Hz (last known good) - ULONG TuningFlags; // KS_TUNER_TUNING_FLAGS - ULONG VideoSubChannel; // DSS - ULONG AudioSubChannel; // DSS - ULONG Channel; // VBI decoders - ULONG Country; // VBI decoders - } KSPROPERTY_TUNER_FREQUENCY_S, *PKSPROPERTY_TUNER_FREQUENCY_S; - - typedef struct { - KSPROPERTY Property; - ULONG Standard; // KS_AnalogVideo_* - } KSPROPERTY_TUNER_STANDARD_S, *PKSPROPERTY_TUNER_STANDARD_S; - - typedef struct { - KSPROPERTY Property; - ULONG InputIndex; // 0 to (n-1) inputs - } KSPROPERTY_TUNER_INPUT_S, *PKSPROPERTY_TUNER_INPUT_S; - - typedef struct { - KSPROPERTY Property; - ULONG CurrentFrequency; // Hz - ULONG PLLOffset; // if Strategy.KS_TUNER_STRATEGY_PLL - ULONG SignalStrength; // if Stretegy.KS_TUNER_STRATEGY_SIGNAL_STRENGTH - ULONG Busy; // TRUE if in the process of tuning - } KSPROPERTY_TUNER_STATUS_S, *PKSPROPERTY_TUNER_STATUS_S; - - #define STATIC_EVENTSETID_TUNER\ - 0x6a2e0606L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0606-28e4-11d0-a18c-00a0c9118956", EVENTSETID_TUNER); - #define EVENTSETID_TUNER DEFINE_GUIDNAMED(EVENTSETID_TUNER) - - typedef enum { - KSEVENT_TUNER_CHANGED - } KSEVENT_TUNER; - - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_VIDEOENCODER\ - 0x6a2e0610L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0610-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOENCODER); - #define PROPSETID_VIDCAP_VIDEOENCODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOENCODER) - - typedef enum { - KSPROPERTY_VIDEOENCODER_CAPS, // R - KSPROPERTY_VIDEOENCODER_STANDARD, // RW - KSPROPERTY_VIDEOENCODER_COPYPROTECTION, // RW O - KSPROPERTY_VIDEOENCODER_CC_ENABLE, // RW O - } KSPROPERTY_VIDCAP_VIDEOENCODER; - - typedef struct { - KSPROPERTY Property; - LONG Value; // value to get or set - ULONG Flags; // - ULONG Capabilities; // - } KSPROPERTY_VIDEOENCODER_S, *PKSPROPERTY_VIDEOENCODER_S; - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_VIDEODECODER\ - 0xC6E13350L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("C6E13350-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEODECODER); - #define PROPSETID_VIDCAP_VIDEODECODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEODECODER) - - typedef enum { - KSPROPERTY_VIDEODECODER_CAPS, // R - KSPROPERTY_VIDEODECODER_STANDARD, // RW - KSPROPERTY_VIDEODECODER_STATUS, // R - KSPROPERTY_VIDEODECODER_OUTPUT_ENABLE, // Rw O - KSPROPERTY_VIDEODECODER_VCR_TIMING, // RW O - } KSPROPERTY_VIDCAP_VIDEODECODER; - - typedef enum { - KS_VIDEODECODER_FLAGS_CAN_DISABLE_OUTPUT = 0X0001, // VP Output can tri-stae - KS_VIDEODECODER_FLAGS_CAN_USE_VCR_LOCKING = 0X0002, // VCR PLL timings - KS_VIDEODECODER_FLAGS_CAN_INDICATE_LOCKED = 0X0004, // Can indicate valid signal - }KS_VIDEODECODER_FLAGS; - - typedef struct { - KSPROPERTY Property; - ULONG StandardsSupported; // KS_AnalogVideo_* - ULONG Capabilities; // KS_VIDEODECODER_FLAGS_* - ULONG SettlingTime; // milliseconds - ULONG HSyncPerVSync; // Number of HSync Pulses per VSync - } KSPROPERTY_VIDEODECODER_CAPS_S, *PKSPROPERTY_VIDEODECODER_CAPS_S; - - typedef struct { - KSPROPERTY Property; - ULONG NumberOfLines; // 525 or 625 lines detected - ULONG SignalLocked; // TRUE if signal is locked - } KSPROPERTY_VIDEODECODER_STATUS_S, *PKSPROPERTY_VIDEODECODER_STATUS_S; - - typedef struct { - KSPROPERTY Property; - ULONG Value; // Get or set a value - } KSPROPERTY_VIDEODECODER_S, *PKSPROPERTY_VIDEODECODER_S; - - #define STATIC_EVENTSETID_VIDEODECODER\ - 0x6a2e0621L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0621-28e4-11d0-a18c-00a0c9118956", EVENTSETID_VIDEODECODER); - #define EVENTSETID_VIDEODECODER DEFINE_GUIDNAMED(EVENTSETID_VIDEODECODER) - - typedef enum { - KSEVENT_VIDEODECODER_CHANGED - } KSEVENT_VIDEODECODER; - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_CAMERACONTROL\ - 0xC6E13370L, 0x30AC, 0x11d0, 0xa1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("C6E13370-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_CAMERACONTROL); - #define PROPSETID_VIDCAP_CAMERACONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CAMERACONTROL) - - typedef enum { - KSPROPERTY_CAMERACONTROL_PAN, // RW O - KSPROPERTY_CAMERACONTROL_TILT, // RW O - KSPROPERTY_CAMERACONTROL_ROLL, // RW O - KSPROPERTY_CAMERACONTROL_ZOOM, // RW O - KSPROPERTY_CAMERACONTROL_EXPOSURE, // RW O - KSPROPERTY_CAMERACONTROL_IRIS, // RW O - KSPROPERTY_CAMERACONTROL_FOCUS, // RW O - } KSPROPERTY_VIDCAP_CAMERACONTROL; - - typedef struct { - KSPROPERTY Property; - LONG Value; // value to get or set - ULONG Flags; // KSPROPERTY_CAMERACONTROL_FLAGS_* - ULONG Capabilities; // KSPROPERTY_CAMERACONTROL_FLAGS_* - } KSPROPERTY_CAMERACONTROL_S, *PKSPROPERTY_CAMERACONTROL_S; - - #define KSPROPERTY_CAMERACONTROL_FLAGS_AUTO 0X0001L - #define KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL 0X0002L - - #define KSPROPERTY_CAMERACONTROL_FLAGS_ABSOLUTE 0X0000L - #define KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE 0X0010L - - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_CROSSBAR\ - 0x6a2e0640L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0640-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_CROSSBAR); - #define PROPSETID_VIDCAP_CROSSBAR DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CROSSBAR) - - typedef enum { - KSPROPERTY_CROSSBAR_CAPS, // R - KSPROPERTY_CROSSBAR_PININFO, // R - KSPROPERTY_CROSSBAR_CAN_ROUTE, // R - KSPROPERTY_CROSSBAR_ROUTE, // RW - } KSPROPERTY_VIDCAP_CROSSBAR; - - typedef struct { - KSPROPERTY Property; - ULONG NumberOfInputs; // the number of audio and video input pins - ULONG NumberOfOutputs; // the number of audio and video output pins - } KSPROPERTY_CROSSBAR_CAPS_S, *PKSPROPERTY_CROSSBAR_CAPS_S; - - typedef struct { - KSPROPERTY Property; - KSPIN_DATAFLOW Direction; // KSPIN_DATAFLOW_IN or KSPIN_DATAFLOW_OUT? - ULONG Index; // Which pin to return data for? - ULONG PinType; // KS_PhysConn_Video_* or KS_PhysConn_Audio_* - ULONG RelatedPinIndex; // For video pins, this is the related audio pin - KSPIN_MEDIUM Medium; // Identifies the hardware connection - } KSPROPERTY_CROSSBAR_PININFO_S, *PKSPROPERTY_CROSSBAR_PININFO_S; - - typedef struct { - KSPROPERTY Property; - ULONG IndexInputPin; // Zero based index of the input pin - ULONG IndexOutputPin; // Zero based index of the output pin - ULONG CanRoute; // returns non-zero on CAN_ROUTE if routing is possible - } KSPROPERTY_CROSSBAR_ROUTE_S, *PKSPROPERTY_CROSSBAR_ROUTE_S; - - #define STATIC_EVENTSETID_CROSSBAR\ - 0x6a2e0641L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0641-28e4-11d0-a18c-00a0c9118956", EVENTSETID_CROSSBAR); - #define EVENTSETID_CROSSBAR DEFINE_GUIDNAMED(EVENTSETID_CROSSBAR) - - typedef enum { - KSEVENT_CROSSBAR_CHANGED - } KSEVENT_CROSSBAR; - - // The following IDs should match the AM equivalents - typedef enum { - KS_PhysConn_Video_Tuner = 1, - KS_PhysConn_Video_Composite, - KS_PhysConn_Video_SVideo, - KS_PhysConn_Video_RGB, - KS_PhysConn_Video_YRYBY, - KS_PhysConn_Video_SerialDigital, - KS_PhysConn_Video_ParallelDigital, - KS_PhysConn_Video_SCSI, - KS_PhysConn_Video_AUX, - KS_PhysConn_Video_1394, - KS_PhysConn_Video_USB, - KS_PhysConn_Video_VideoDecoder, - KS_PhysConn_Video_VideoEncoder, - KS_PhysConn_Video_SCART, - - KS_PhysConn_Audio_Tuner = 4096, - KS_PhysConn_Audio_Line, - KS_PhysConn_Audio_Mic, - KS_PhysConn_Audio_AESDigital, - KS_PhysConn_Audio_SPDIFDigital, - KS_PhysConn_Audio_SCSI, - KS_PhysConn_Audio_AUX, - KS_PhysConn_Audio_1394, - KS_PhysConn_Audio_USB, - KS_PhysConn_Audio_AudioDecoder, - } KS_PhysicalConnectorType; - - - //=========================================================================== - - #define STATIC_PROPSETID_VIDCAP_TVAUDIO\ - 0x6a2e0650L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0650-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_TVAUDIO); - #define PROPSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(PROPSETID_VIDCAP_TVAUDIO) - - typedef enum { - KSPROPERTY_TVAUDIO_CAPS, // R - KSPROPERTY_TVAUDIO_MODE, // RW - KSPROPERTY_TVAUDIO_CURRENTLY_AVAILABLE_MODES // R - } KSPROPERTY_VIDCAP_TVAUDIO; - - #define KS_TVAUDIO_MODE_MONO 0x0001 // Mono - #define KS_TVAUDIO_MODE_STEREO 0x0002 // Stereo - #define KS_TVAUDIO_MODE_LANG_A 0x0010 // Primary language - #define KS_TVAUDIO_MODE_LANG_B 0x0020 // 2nd avail language - #define KS_TVAUDIO_MODE_LANG_C 0x0040 // 3rd avail language - - typedef struct { - KSPROPERTY Property; - ULONG Capabilities; // Bitmask of KS_TVAUDIO_MODE_* - KSPIN_MEDIUM InputMedium; - KSPIN_MEDIUM OutputMedium; - } KSPROPERTY_TVAUDIO_CAPS_S, *PKSPROPERTY_TVAUDIO_CAPS_S; - - typedef struct { - KSPROPERTY Property; - ULONG Mode; // KS_TVAUDIO_MODE_* - } KSPROPERTY_TVAUDIO_S, *PKSPROPERTY_TVAUDIO_S; - - - #define STATIC_KSEVENTSETID_VIDCAP_TVAUDIO\ - 0x6a2e0651L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0651-28e4-11d0-a18c-00a0c9118956", KSEVENTSETID_VIDCAP_TVAUDIO); - #define KSEVENTSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAP_TVAUDIO) - - typedef enum { - KSEVENT_TVAUDIO_CHANGED, - } KSEVENT_TVAUDIO; - - //=========================================================================== - #define STATIC_PROPSETID_VIDCAP_VIDEOCOMPRESSION\ - 0xC6E13343L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("C6E13343-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOCOMPRESSION); - #define PROPSETID_VIDCAP_VIDEOCOMPRESSION DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCOMPRESSION) - - typedef enum { - KSPROPERTY_VIDEOCOMPRESSION_GETINFO, // R - KSPROPERTY_VIDEOCOMPRESSION_KEYFRAME_RATE, // RW - KSPROPERTY_VIDEOCOMPRESSION_PFRAMES_PER_KEYFRAME, // RW - KSPROPERTY_VIDEOCOMPRESSION_QUALITY, // RW - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_KEYFRAME, // W - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_FRAME_SIZE, // W - KSPROPERTY_VIDEOCOMPRESSION_WINDOWSIZE, // RW - } KSPROPERTY_VIDCAP_VIDEOCOMPRESSION; - - typedef enum { - KS_CompressionCaps_CanQuality = 1, - KS_CompressionCaps_CanCrunch = 2, - KS_CompressionCaps_CanKeyFrame = 4, - KS_CompressionCaps_CanBFrame = 8, - KS_CompressionCaps_CanWindow = 0x10, - } KS_CompressionCaps; - - typedef struct { - KSPROPERTY Property; - // Note, no VersionString! - // Note, no DescriptionString! - ULONG StreamIndex; // zero based index of stream - LONG DefaultKeyFrameRate; // Key frame rate - LONG DefaultPFrameRate; // Predeicted frames per Key frame - LONG DefaultQuality; // 0 to 10000 - LONG NumberOfQualitySettings; // How many discreet quality settings? - LONG Capabilities; // KS_CompressionCaps_* - } KSPROPERTY_VIDEOCOMPRESSION_GETINFO_S, *PKSPROPERTY_VIDEOCOMPRESSION_GETINFO_S; - - typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // zero based index of stream - LONG Value; // value to get or set - } KSPROPERTY_VIDEOCOMPRESSION_S, *PKSPROPERTY_VIDEOCOMPRESSION_S; - - //=========================================================================== - // MEDIASUBTYPE_Overlay - #define STATIC_KSDATAFORMAT_SUBTYPE_OVERLAY\ - 0xe436eb7fL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 - DEFINE_GUIDSTRUCT("e436eb7f-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_OVERLAY); - #define KSDATAFORMAT_SUBTYPE_OVERLAY DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_OVERLAY) - - #define STATIC_KSPROPSETID_OverlayUpdate\ - 0x490EA5CFL, 0x7681, 0x11D1, 0xA2, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - DEFINE_GUIDSTRUCT("490EA5CF-7681-11D1-A21C-00A0C9223196", KSPROPSETID_OverlayUpdate); - #define KSPROPSETID_OverlayUpdate DEFINE_GUIDNAMED(KSPROPSETID_OverlayUpdate) - - typedef enum { - KSPROPERTY_OVERLAYUPDATE_INTERESTS, - KSPROPERTY_OVERLAYUPDATE_CLIPLIST = 0x1, - KSPROPERTY_OVERLAYUPDATE_PALETTE = 0x2, - KSPROPERTY_OVERLAYUPDATE_COLORKEY = 0x4, - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION = 0x8, - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE = 0x10, - KSPROPERTY_OVERLAYUPDATE_COLORREF = 0x10000000 - } KSPROPERTY_OVERLAYUPDATE; - - typedef struct { - ULONG PelsWidth; - ULONG PelsHeight; - ULONG BitsPerPel; - WCHAR DeviceID[1]; - } KSDISPLAYCHANGE, *PKSDISPLAYCHANGE; - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_INTERESTS(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_INTERESTS,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(ULONG),\ - NULL, NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_PALETTE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_PALETTE,\ - NULL,\ - sizeof(KSPROPERTY),\ - 0,\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORKEY(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_COLORKEY,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(COLORKEY),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_CLIPLIST(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_CLIPLIST,\ - NULL,\ - sizeof(KSPROPERTY),\ - 2 * sizeof(RECT) + sizeof(RGNDATAHEADER),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_VIDEOPOSITION(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION,\ - NULL,\ - sizeof(KSPROPERTY),\ - 2 * sizeof(RECT),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_DISPLAYCHANGE(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(KSDISPLAYCHANGE),\ - (Handler),\ - NULL, 0, NULL, NULL, 0) - - #define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORREF(Handler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_OVERLAYUPDATE_COLORREF,\ - (Handler),\ - sizeof(KSPROPERTY),\ - sizeof(COLORREF),\ - NULL,\ - NULL, 0, NULL, NULL, 0) - - //=========================================================================== - #define STATIC_PROPSETID_VIDCAP_VIDEOCONTROL\ - 0x6a2e0670L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("6a2e0670-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOCONTROL); - #define PROPSETID_VIDCAP_VIDEOCONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCONTROL) - - typedef enum { - KSPROPERTY_VIDEOCONTROL_CAPS, // R - KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE, // R O - KSPROPERTY_VIDEOCONTROL_FRAME_RATES, // R O - KSPROPERTY_VIDEOCONTROL_MODE, // RWO - } KSPROPERTY_VIDCAP_VIDEOCONTROL; - - typedef enum { - KS_VideoControlFlag_FlipHorizontal = 0x0001, - KS_VideoControlFlag_FlipVertical = 0x0002, - KS_Obsolete_VideoControlFlag_ExternalTriggerEnable = 0x0010, // ***WARNING *** Flag msimatch with DSHOW. - KS_Obsolete_VideoControlFlag_Trigger = 0x0020, // ***WARNING *** Flag msimatch with DSHOW. - KS_VideoControlFlag_ExternalTriggerEnable = 0x0004, - KS_VideoControlFlag_Trigger = 0x0008, - } KS_VideoControlFlags; - - typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; - ULONG VideoControlCaps; // KS_VideoControlFlags_* - } KSPROPERTY_VIDEOCONTROL_CAPS_S, *PKSPROPERTY_VIDEOCONTROL_CAPS_S; - - typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; - LONG Mode; // KS_VideoControlFlags_* - } KSPROPERTY_VIDEOCONTROL_MODE_S, *PKSPROPERTY_VIDEOCONTROL_MODE_S; - - typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG RangeIndex; // Index of range - SIZE Dimensions; // Size of image - LONGLONG CurrentActualFrameRate; // Only correct if pin is open - LONGLONG CurrentMaxAvailableFrameRate; // Max Rate temporarily limited on USB or 1394? - } KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S, *PKSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S; - - // KSPROPERTY_VIDEOCONTROL_FRAME_RATES returns a list of available frame rates in 100 nS units - typedef struct { - KSPROPERTY Property; - ULONG StreamIndex; // Index of stream - ULONG RangeIndex; // Index of range - SIZE Dimensions; // Size of image - } KSPROPERTY_VIDEOCONTROL_FRAME_RATES_S, *PKSPROPERTY_VIDEOCONTROL_FRAME_RATES_S; - - //=========================================================================== - #define STATIC_PROPSETID_VIDCAP_DROPPEDFRAMES\ - 0xC6E13344L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 - DEFINE_GUIDSTRUCT("C6E13344-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_DROPPEDFRAMES); - #define PROPSETID_VIDCAP_DROPPEDFRAMES DEFINE_GUIDNAMED(PROPSETID_VIDCAP_DROPPEDFRAMES) - - typedef enum { - KSPROPERTY_DROPPEDFRAMES_CURRENT // R - } KSPROPERTY_VIDCAP_DROPPEDFRAMES; - - typedef struct { - KSPROPERTY Property; - LONGLONG PictureNumber; // Current Picture Number - LONGLONG DropCount; // Count of frames dropped - ULONG AverageFrameSize; // Average size of frames captured - } KSPROPERTY_DROPPEDFRAMES_CURRENT_S, *PKSPROPERTY_DROPPEDFRAMES_CURRENT_S; - - //=========================================================================== - // VPE - - #define STATIC_KSPROPSETID_VPConfig\ - 0xbc29a660L, 0x30e3, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b - DEFINE_GUIDSTRUCT("bc29a660-30e3-11d0-9e69-00c04fd7c15b", KSPROPSETID_VPConfig); - #define KSPROPSETID_VPConfig DEFINE_GUIDNAMED(KSPROPSETID_VPConfig) - - #define STATIC_KSPROPSETID_VPVBIConfig\ - 0xec529b00L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("ec529b00-1a1f-11d1-bad9-00609744111a", KSPROPSETID_VPVBIConfig); - #define KSPROPSETID_VPVBIConfig DEFINE_GUIDNAMED(KSPROPSETID_VPVBIConfig) - - // Both of the above property sets use the same list of properties below - - typedef enum { - KSPROPERTY_VPCONFIG_NUMCONNECTINFO, - KSPROPERTY_VPCONFIG_GETCONNECTINFO, - KSPROPERTY_VPCONFIG_SETCONNECTINFO, - KSPROPERTY_VPCONFIG_VPDATAINFO, - KSPROPERTY_VPCONFIG_MAXPIXELRATE, - KSPROPERTY_VPCONFIG_INFORMVPINPUT, - KSPROPERTY_VPCONFIG_NUMVIDEOFORMAT, - KSPROPERTY_VPCONFIG_GETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_SETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_INVERTPOLARITY, - KSPROPERTY_VPCONFIG_DECIMATIONCAPABILITY, // E_NOTIMPL for VBI - KSPROPERTY_VPCONFIG_SCALEFACTOR, // E_NOTIMPL for VBI - KSPROPERTY_VPCONFIG_DDRAWHANDLE, - KSPROPERTY_VPCONFIG_VIDEOPORTID, - KSPROPERTY_VPCONFIG_DDRAWSURFACEHANDLE, - KSPROPERTY_VPCONFIG_SURFACEPARAMS - } KSPROPERTY_VPCONFIG; - - //========================= - // IBasicAudio - // - #define STATIC_CLSID_KsIBasicAudioInterfaceHandler\ - 0xb9f8ac3e, 0x0f71, 0x11d2, 0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d - DEFINE_GUIDSTRUCT("b9f8ac3e-0f71-11d2-b72c-00c04fb6bd3d", CLSID_KsIBasicAudioInterfaceHandler); - #define CLSID_KsIBasicAudioInterfaceHandler DEFINE_GUIDNAMED(CLSID_KsIBasicAudioInterfaceHandler) - - - #if defined(__IVPType__) - - typedef struct { - AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; - } KSVPMAXPIXELRATE, *PKSVPMAXPIXELRATE; - - typedef struct { - KSPROPERTY Property; - AMVPSIZE Size; - } KSVPSIZE_PROP, *PKSVPSIZE_PROP; - - typedef struct { - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; - } KSVPSURFACEPARAMS, *PKSVPSURFACEPARAMS; - - #else // !defined(__IVPType__) - - #if !defined(__DDRAW_INCLUDED__) - - //========================================================================== - // The following definitions must be in sync with DDraw.h in DirectX SDK - //========================================================================== - - /* - * The FourCC code is valid. - */ - #define DDPF_FOURCC 0x00000004l - - - typedef struct _DDPIXELFORMAT - { - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel (BD_1,2,4,8,16,24,32) - DWORD dwYUVBitCount; // how many bits per pixel (BD_4,8,16,24,32) - DWORD dwZBufferBitDepth; // how many bits for z buffers (BD_8,16,24,32) - DWORD dwAlphaBitDepth; // how many bits for alpha channels (BD_1,2,4,8) - }; - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - }; - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - }; - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - }; - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - }; - } DDPIXELFORMAT, * LPDDPIXELFORMAT; - - #endif // !defined(__DDRAW_INCLUDED__) - - //========================================================================== - // End of DDraw.h header info - //========================================================================== - - //========================================================================== - // The following definitions must be in sync with DVP.h in DirectX SDK - //========================================================================== - - #if !defined(__DVP_INCLUDED__) - - typedef struct _DDVIDEOPORTCONNECT { - DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure - DWORD dwPortWidth; // Width of the video port - GUID guidTypeID; // Description of video port connection - DWORD dwFlags; // Connection flags - DWORD dwReserved1; // Reserved, set to zero. - } DDVIDEOPORTCONNECT, * LPDDVIDEOPORTCONNECT; - - #define DDVPTYPE_E_HREFH_VREFH \ - 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 - - #define DDVPTYPE_E_HREFL_VREFL \ - 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 - - #endif // !defined(__DVP_INCLUDED__) - - //========================================================================== - // End of DVP.h header info - //========================================================================== - - - //========================================================================== - // The following definitions must be in sync with VPType.h in AM 2.0 SDK - //========================================================================== - - // pixel aspect ratios corresponding to a 720x480 NTSC image or a 720x576 image - typedef enum // AMPixAspectRatio - { - KS_PixAspectRatio_NTSC4x3, - KS_PixAspectRatio_NTSC16x9, - KS_PixAspectRatio_PAL4x3, - KS_PixAspectRatio_PAL16x9, - } KS_AMPixAspectRatio ; - - typedef enum // AMVP_SELECTFORMATBY - { - KS_AMVP_DO_NOT_CARE, - KS_AMVP_BEST_BANDWIDTH, - KS_AMVP_INPUT_SAME_AS_OUTPUT - } KS_AMVP_SELECTFORMATBY; - - typedef enum // AMVP_MODE - { - KS_AMVP_MODE_WEAVE, - KS_AMVP_MODE_BOBINTERLEAVED, - KS_AMVP_MODE_BOBNONINTERLEAVED, - KS_AMVP_MODE_SKIPEVEN, - KS_AMVP_MODE_SKIPODD - } KS_AMVP_MODE ; - - typedef struct tagKS_AMVPDIMINFO // AMVPDIMINFO - { - DWORD dwFieldWidth ; // [out] field width - DWORD dwFieldHeight ; // [out] field height - DWORD dwVBIWidth ; // [out] VBI data width - DWORD dwVBIHeight ; // [out] VBI data height - RECT rcValidRegion ; // [out] valid rect for data cropping - } KS_AMVPDIMINFO, *PKS_AMVPDIMINFO ; - - typedef struct tagKS_AMVPDATAINFO // AMVPDATAINFO - { - DWORD dwSize; // Size of the struct - DWORD dwMicrosecondsPerField; // Time taken by each field - KS_AMVPDIMINFO amvpDimInfo; // Dimensional Information - DWORD dwPictAspectRatioX; // Pict aspect ratio in X dimn - DWORD dwPictAspectRatioY; // Pict aspect ratio in Y dimn - BOOL bEnableDoubleClock; // Videoport should enable double clocking - BOOL bEnableVACT; // Videoport should use an external VACT signal - BOOL bDataIsInterlaced; // Indicates that the signal is interlaced - LONG lHalfLinesOdd; // number of halflines in the odd field - BOOL bFieldPolarityInverted; // Device inverts the polarity by default - DWORD dwNumLinesInVREF; // Number of lines of data in VREF - LONG lHalfLinesEven; // number of halflines in the even field - DWORD dwReserved1; // Reserved for future use - } KS_AMVPDATAINFO, *PKS_AMVPDATAINFO; - - typedef struct tagKS_AMVPSIZE // AMVPSIZE - { - DWORD dwWidth ; // [in] width in pixels - DWORD dwHeight ; // [in] height in pixels - } KS_AMVPSIZE, *PKS_AMVPSIZE ; - - //========================================================================== - // End of VPType.h header info - //========================================================================== - - typedef struct { - KS_AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; - } KSVPMAXPIXELRATE, *PKSVPMAXPIXELRATE; - - typedef struct { - KSPROPERTY Property; - KS_AMVPSIZE Size; - } KSVPSIZE_PROP, *PKSVPSIZE_PROP; - - typedef struct { - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; - } KSVPSURFACEPARAMS, *PKSVPSURFACEPARAMS; - - #endif // !defined(__IVPType__) - - // - // IVPNotify event notification - // - #define STATIC_KSEVENTSETID_VPNotify\ - 0x20c5598eL, 0xd3c8, 0x11d0, 0x8d, 0xfc, 0x00, 0xc0, 0x4f, 0xd7, 0xc0, 0x8b - DEFINE_GUIDSTRUCT("20c5598e-d3c8-11d0-8dfc-00c04fd7c08b", KSEVENTSETID_VPNotify); - #define KSEVENTSETID_VPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VPNotify) - - typedef enum { - KSEVENT_VPNOTIFY_FORMATCHANGE, - } KSEVENT_VPNOTIFY; - - // - // VIDCAPTOSTI event notification - // - #define STATIC_KSEVENTSETID_VIDCAPTOSTI\ - 0xdb47de20, 0xf628, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5 - DEFINE_GUIDSTRUCT("DB47DE20-F628-11d1-BA41-00A0C90D2B05", KSEVENTSETID_VIDCAPTOSTI); - #define KSEVENTSETID_VIDCAPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAPTOSTI) - - typedef enum { - KSEVENT_VIDCAPTOSTI_EXT_TRIGGER, - } KSEVENT_VIDCAPTOSTI; - - - // - // IVPVBINotify event notification - // - #define STATIC_KSEVENTSETID_VPVBINotify\ - 0xec529b01L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a - DEFINE_GUIDSTRUCT("ec529b01-1a1f-11d1-bad9-00609744111a", KSEVENTSETID_VPVBINotify); - #define KSEVENTSETID_VPVBINotify DEFINE_GUIDNAMED(KSEVENTSETID_VPVBINotify) - - typedef enum { - KSEVENT_VPVBINOTIFY_FORMATCHANGE, - } KSEVENT_VPVBINOTIFY; - - - // - // closed caption information - // - - #define STATIC_KSDATAFORMAT_TYPE_AUXLine21Data \ - 0x670aea80L, 0x3a82, 0x11d0, 0xb7, 0x9b, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 - DEFINE_GUIDSTRUCT("670aea80-3a82-11d0-b79b-00aa003767a7", KSDATAFORMAT_TYPE_AUXLine21Data); - #define KSDATAFORMAT_TYPE_AUXLine21Data DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUXLine21Data) - - #define STATIC_KSDATAFORMAT_SUBTYPE_Line21_BytePair \ - 0x6e8d4a22L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 - DEFINE_GUIDSTRUCT("6e8d4a22-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_BytePair); - #define KSDATAFORMAT_SUBTYPE_Line21_BytePair DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_BytePair) - - #define STATIC_KSDATAFORMAT_SUBTYPE_Line21_GOPPacket \ - 0x6e8d4a23L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 - DEFINE_GUIDSTRUCT("6e8d4a23-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_GOPPacket); - #define KSDATAFORMAT_SUBTYPE_Line21_GOPPacket DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_GOPPacket) - - typedef struct _KSGOP_USERDATA { - ULONG sc; - ULONG reserved1; - BYTE cFields; - CHAR l21Data[3]; - } KSGOP_USERDATA, *PKSGOP_USERDATA; - - // - // DVD encrypted PACK format type definition - // - - #define STATIC_KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK\ - 0xed0b916a, 0x044d, 0x11d1, 0xaa, 0x78, 0x00, 0xc0, 0x4f, 0xc3, 0x1d, 0x60 - DEFINE_GUIDSTRUCT("ed0b916a-044d-11d1-aa78-00c04fc31d60", KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK); - #define KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK) - - #define KS_AM_UseNewCSSKey 0x1 - - - // ----------------------------------------------------------------------- - // KS_AM_KSPROPSETID_TSRateChange property set definitions for time stamp - // rate changes. - // ----------------------------------------------------------------------- - - - #define STATIC_KSPROPSETID_TSRateChange\ - 0xa503c5c0, 0x1d1d, 0x11d1, 0xad, 0x80, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 - - DEFINE_GUIDSTRUCT("A503C5C0-1D1D-11D1-AD80-444553540000", KSPROPSETID_TSRateChange); - #define KSPROPSETID_TSRateChange DEFINE_GUIDNAMED(KSPROPSETID_TSRateChange) - typedef enum { - KS_AM_RATE_SimpleRateChange=1, // rw, use KS_AM_SimpleRateChange - KS_AM_RATE_ExactRateChange=2, // rw, use KS_AM_ExactRateChange - KS_AM_RATE_MaxFullDataRate=3, // r, use KS_AM_MaxFullDataRate - KS_AM_RATE_Step=4 // w, use KS_AM_Step - } KS_AM_PROPERTY_TS_RATE_CHANGE; - - typedef struct { - // this is the simplest mechanism to set a time stamp rate change on - // a filter (simplest for the person setting the rate change, harder - // for the filter doing the rate change). - REFERENCE_TIME StartTime; //stream time at which to start this rate - LONG Rate; //new rate * 10000 (decimal) - } KS_AM_SimpleRateChange, *PKS_AM_SimpleRateChange; - - typedef struct { - REFERENCE_TIME OutputZeroTime; //input TS that maps to zero output TS - LONG Rate; //new rate * 10000 (decimal) - } KS_AM_ExactRateChange, *PKS_AM_ExactRateChange; - - typedef LONG KS_AM_MaxFullDataRate; //rate * 10000 (decimal) - - typedef DWORD KS_AM_Step; // number of frame to step - - -#endif // DirectX 8.0 content - - -#endif // !defined(_KSMEDIA_) diff --git a/import/DirectX8/include/ksproxy.h b/import/DirectX8/include/ksproxy.h deleted file mode 100644 index 48eb4f74f..000000000 --- a/import/DirectX8/include/ksproxy.h +++ /dev/null @@ -1,845 +0,0 @@ -/*++ - -Copyright (C) Microsoft Corporation, 1996 - 2001 - -Module Name: - - ksproxy.h - -Abstract: - - Interface definitions for WDM-CSA proxy filters. - ---*/ - -#ifndef __KSPROXY__ -#define __KSPROXY__ - -#ifdef __cplusplus -extern "C" { -#endif - -#undef KSDDKAPI -#ifdef _KSDDK_ -#define KSDDKAPI -#else // !_KSDDK_ -#define KSDDKAPI DECLSPEC_IMPORT -#endif // _KSDDK_ - -#define STATIC_IID_IKsObject\ - 0x423c13a2L, 0x2070, 0x11d0, 0x9e, 0xf7, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1 - -#define STATIC_IID_IKsPinEx\ - 0x7bb38260L, 0xd19c, 0x11d2, 0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e - -#define STATIC_IID_IKsPin\ - 0xb61178d1L, 0xa2d9, 0x11cf, 0x9e, 0x53, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1 - -#define STATIC_IID_IKsPinPipe\ - 0xe539cd90L, 0xa8b4, 0x11d1, 0x81, 0x89, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - -#define STATIC_IID_IKsDataTypeHandler\ - 0x5ffbaa02L, 0x49a3, 0x11d0, 0x9f, 0x36, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1 - -#define STATIC_IID_IKsDataTypeCompletion\ - 0x827D1A0EL, 0x0F73, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#define STATIC_IID_IKsInterfaceHandler\ - 0xD3ABC7E0L, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#define STATIC_IID_IKsClockPropertySet\ - 0x5C5CBD84L, 0xE755, 0x11D0, 0xAC, 0x18, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#define STATIC_IID_IKsAllocator\ - 0x8da64899L, 0xc0d9, 0x11d0, 0x84, 0x13, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a - -#define STATIC_IID_IKsAllocatorEx\ - 0x091bb63aL, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 - - -#ifndef STATIC_IID_IKsPropertySet -#define STATIC_IID_IKsPropertySet\ - 0x31EFAC30L, 0x515C, 0x11d0, 0xA9, 0xAA, 0x00, 0xAA, 0x00, 0x61, 0xBE, 0x93 -#endif // STATIC_IID_IKsPropertySet - -#define STATIC_IID_IKsTopology\ - 0x28F54683L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#ifndef STATIC_IID_IKsControl -#define STATIC_IID_IKsControl\ - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -#endif // STATIC_IID_IKsControl - -#define STATIC_IID_IKsAggregateControl\ - 0x7F40EAC0L, 0x3947, 0x11D2, 0x87, 0x4E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#define STATIC_CLSID_Proxy \ - 0x17CCA71BL, 0xECD7, 0x11D0, 0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - -#ifdef _KS_ - -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUIDEX(IID_IKsObject); - -DEFINE_GUIDEX(IID_IKsPin); - -DEFINE_GUIDEX(IID_IKsPinEx); - -DEFINE_GUIDEX(IID_IKsPinPipe); - -DEFINE_GUIDEX(IID_IKsDataTypeHandler); - -DEFINE_GUIDEX(IID_IKsDataTypeCompletion); - -DEFINE_GUIDEX(IID_IKsInterfaceHandler); - -DEFINE_GUIDEX(IID_IKsClockPropertySet); - -DEFINE_GUIDEX(IID_IKsAllocator); - -DEFINE_GUIDEX(IID_IKsAllocatorEx); - -#define IID_IKsQualityForwarder KSCATEGORY_QUALITY -#endif // !defined(__cplusplus) || _MSC_VER < 1100 - -#define STATIC_IID_IKsQualityForwarder STATIC_KSCATEGORY_QUALITY - -typedef enum { - KsAllocatorMode_User, - KsAllocatorMode_Kernel -} KSALLOCATORMODE; - - -typedef enum { - FramingProp_Uninitialized, - FramingProp_None, - FramingProp_Old, - FramingProp_Ex -} FRAMING_PROP; - -typedef FRAMING_PROP *PFRAMING_PROP; - - -typedef enum { - Framing_Cache_Update, // request to bypass cache when read/write - Framing_Cache_ReadLast, - Framing_Cache_ReadOrig, - Framing_Cache_Write -} FRAMING_CACHE_OPS; - - -typedef struct { - LONGLONG MinTotalNominator; - LONGLONG MaxTotalNominator; - LONGLONG TotalDenominator; -} OPTIMAL_WEIGHT_TOTALS; - -// forward declaration -typedef struct IPin IPin; -typedef struct IKsPin IKsPin; -typedef struct IKsAllocator IKsAllocator; -typedef struct IKsAllocatorEx IKsAllocatorEx; - - -// -// allocators strategy is defined by graph manager -// -#define AllocatorStrategy_DontCare 0 - -// -// what to optimize -// -#define AllocatorStrategy_MinimizeNumberOfFrames 0x00000001 -#define AllocatorStrategy_MinimizeFrameSize 0x00000002 -#define AllocatorStrategy_MinimizeNumberOfAllocators 0x00000004 -#define AllocatorStrategy_MaximizeSpeed 0x00000008 - -// -// factors (flags) defining the Pipes properties -// -#define PipeFactor_None 0 -#define PipeFactor_UserModeUpstream 0x00000001 -#define PipeFactor_UserModeDownstream 0x00000002 -#define PipeFactor_MemoryTypes 0x00000004 -#define PipeFactor_Flags 0x00000008 -#define PipeFactor_PhysicalRanges 0x00000010 -#define PipeFactor_OptimalRanges 0x00000020 -#define PipeFactor_FixedCompression 0x00000040 -#define PipeFactor_UnknownCompression 0x00000080 - -#define PipeFactor_Buffers 0x00000100 -#define PipeFactor_Align 0x00000200 - -#define PipeFactor_PhysicalEnd 0x00000400 -#define PipeFactor_LogicalEnd 0x00000800 - - - -typedef enum { - PipeState_DontCare, - PipeState_RangeNotFixed, - PipeState_RangeFixed, - PipeState_CompressionUnknown, - PipeState_Finalized -} PIPE_STATE; - - -// -// pipe dimensions relative to BeginPin. -// - -typedef struct _PIPE_DIMENSIONS { - KS_COMPRESSION AllocatorPin; - KS_COMPRESSION MaxExpansionPin; - KS_COMPRESSION EndPin; -} PIPE_DIMENSIONS, *PPIPE_DIMENSIONS; - - -typedef enum { - Pipe_Allocator_None, - Pipe_Allocator_FirstPin, - Pipe_Allocator_LastPin, - Pipe_Allocator_MiddlePin -} PIPE_ALLOCATOR_PLACE; - -typedef PIPE_ALLOCATOR_PLACE *PPIPE_ALLOCATOR_PLACE; - - -typedef enum { - KS_MemoryTypeDontCare = 0, - KS_MemoryTypeKernelPaged, - KS_MemoryTypeKernelNonPaged, - KS_MemoryTypeDeviceHostMapped, - KS_MemoryTypeDeviceSpecific, - KS_MemoryTypeUser, - KS_MemoryTypeAnyHost -} KS_LogicalMemoryType; - -typedef KS_LogicalMemoryType *PKS_LogicalMemoryType; - - - -typedef struct _PIPE_TERMINATION { - ULONG Flags; - ULONG OutsideFactors; - ULONG Weigth; // outside weight - KS_FRAMING_RANGE PhysicalRange; - KS_FRAMING_RANGE_WEIGHTED OptimalRange; - KS_COMPRESSION Compression; // relative to the connected pin on a neighboring filter. -} PIPE_TERMINATION; - - -// -// extended allocator properties -// -typedef struct _ALLOCATOR_PROPERTIES_EX - { - long cBuffers; - long cbBuffer; - long cbAlign; - long cbPrefix; -// new part - GUID MemoryType; - GUID BusType; // one of the buses this pipe is using - PIPE_STATE State; - PIPE_TERMINATION Input; - PIPE_TERMINATION Output; - ULONG Strategy; - ULONG Flags; - ULONG Weight; - KS_LogicalMemoryType LogicalMemoryType; - PIPE_ALLOCATOR_PLACE AllocatorPlace; - PIPE_DIMENSIONS Dimensions; - KS_FRAMING_RANGE PhysicalRange; // on allocator pin - IKsAllocatorEx* PrevSegment; // doubly-linked list of KS allocators - ULONG CountNextSegments; // possible multiple dependent pipes - IKsAllocatorEx** NextSegments; - ULONG InsideFactors; // existing factors (different from "don't care") - ULONG NumberPins; -} ALLOCATOR_PROPERTIES_EX; - -typedef ALLOCATOR_PROPERTIES_EX *PALLOCATOR_PROPERTIES_EX; - - -#ifdef __STREAMS__ - -struct DECLSPEC_UUID("5C5CBD84-E755-11D0-AC18-00A0C9223196") IKsClockPropertySet; -#undef INTERFACE -#define INTERFACE IKsClockPropertySet -DECLARE_INTERFACE_(IKsClockPropertySet, IUnknown) -{ - STDMETHOD(KsGetTime)( - THIS_ - LONGLONG* Time - ) PURE; - STDMETHOD(KsSetTime)( - THIS_ - LONGLONG Time - ) PURE; - STDMETHOD(KsGetPhysicalTime)( - THIS_ - LONGLONG* Time - ) PURE; - STDMETHOD(KsSetPhysicalTime)( - THIS_ - LONGLONG Time - ) PURE; - STDMETHOD(KsGetCorrelatedTime)( - THIS_ - KSCORRELATED_TIME* CorrelatedTime - ) PURE; - STDMETHOD(KsSetCorrelatedTime)( - THIS_ - KSCORRELATED_TIME* CorrelatedTime - ) PURE; - STDMETHOD(KsGetCorrelatedPhysicalTime)( - THIS_ - KSCORRELATED_TIME* CorrelatedTime - ) PURE; - STDMETHOD(KsSetCorrelatedPhysicalTime)( - THIS_ - KSCORRELATED_TIME* CorrelatedTime - ) PURE; - STDMETHOD(KsGetResolution)( - THIS_ - KSRESOLUTION* Resolution - ) PURE; - STDMETHOD(KsGetState)( - THIS_ - KSSTATE* State - ) PURE; -}; - - -interface DECLSPEC_UUID("8da64899-c0d9-11d0-8413-0000f822fe8a") IKsAllocator; -#undef INTERFACE -#define INTERFACE IKsAllocator -DECLARE_INTERFACE_(IKsAllocator, IUnknown) -{ - STDMETHOD_(HANDLE, KsGetAllocatorHandle)( - THIS - ) PURE; - STDMETHOD_(KSALLOCATORMODE, KsGetAllocatorMode)( - THIS - ) PURE; - STDMETHOD(KsGetAllocatorStatus)( - THIS_ - PKSSTREAMALLOCATOR_STATUS AllocatorStatus - ) PURE; - STDMETHOD_(VOID, KsSetAllocatorMode)( - THIS_ - KSALLOCATORMODE Mode - ) PURE; -}; - -interface DECLSPEC_UUID("091bb63a-603f-11d1-b067-00a0c9062802") IKsAllocatorEx; -#undef INTERFACE -#define INTERFACE IKsAllocatorEx -DECLARE_INTERFACE_(IKsAllocatorEx, IKsAllocator) -{ - STDMETHOD_(PALLOCATOR_PROPERTIES_EX, KsGetProperties)( - THIS - ) PURE; - STDMETHOD_(VOID, KsSetProperties)( - THIS_ - PALLOCATOR_PROPERTIES_EX - ) PURE; - STDMETHOD_(VOID, KsSetAllocatorHandle)( - THIS_ - HANDLE AllocatorHandle - ) PURE; - STDMETHOD_(HANDLE, KsCreateAllocatorAndGetHandle)( - THIS_ - IKsPin* KsPin - ) PURE; -}; - -typedef enum { - KsPeekOperation_PeekOnly, - KsPeekOperation_AddRef -} KSPEEKOPERATION; - -typedef struct _KSSTREAM_SEGMENT *PKSSTREAM_SEGMENT; - -interface DECLSPEC_UUID("b61178d1-a2d9-11cf-9e53-00aa00a216a1") IKsPin; - -#undef INTERFACE -#define INTERFACE IKsPin -DECLARE_INTERFACE_(IKsPin, IUnknown) -{ - STDMETHOD(KsQueryMediums)( - THIS_ - PKSMULTIPLE_ITEM* MediumList - ) PURE; - STDMETHOD(KsQueryInterfaces)( - THIS_ - PKSMULTIPLE_ITEM* InterfaceList - ) PURE; - STDMETHOD(KsCreateSinkPinHandle)( - THIS_ - KSPIN_INTERFACE& Interface, - KSPIN_MEDIUM& Medium - ) PURE; - STDMETHOD(KsGetCurrentCommunication)( - THIS_ - KSPIN_COMMUNICATION *Communication, - KSPIN_INTERFACE *Interface, - KSPIN_MEDIUM *Medium - ) PURE; - STDMETHOD(KsPropagateAcquire)( - THIS - ) PURE; - STDMETHOD(KsDeliver)( - THIS_ - IMediaSample* Sample, - ULONG Flags - ) PURE; - STDMETHOD(KsMediaSamplesCompleted)( - THIS_ - PKSSTREAM_SEGMENT StreamSegment - ) PURE; - STDMETHOD_(IMemAllocator *, KsPeekAllocator)( - THIS_ - KSPEEKOPERATION Operation - ) PURE; - STDMETHOD(KsReceiveAllocator)( - THIS_ - IMemAllocator *MemAllocator - ) PURE; - STDMETHOD(KsRenegotiateAllocator)( - THIS - ) PURE; - STDMETHOD_(LONG, KsIncrementPendingIoCount)( - THIS - ) PURE; - STDMETHOD_(LONG, KsDecrementPendingIoCount)( - THIS - ) PURE; - STDMETHOD(KsQualityNotify)( - THIS_ - ULONG Proportion, - REFERENCE_TIME TimeDelta - ) PURE; -}; - -interface DECLSPEC_UUID("7bb38260-d19c-11d2-b38a-00a0c95ec22e") IKsPinEx; -#undef INTERFACE -#define INTERFACE IKsPinEx -DECLARE_INTERFACE_(IKsPinEx, IKsPin) -{ - STDMETHOD_(VOID, KsNotifyError)( - THIS_ - IMediaSample* Sample, - HRESULT hr - ) PURE; -}; - -interface DECLSPEC_UUID("e539cd90-a8b4-11d1-8189-00a0c9062802") IKsPinPipe; -#undef INTERFACE -#define INTERFACE IKsPinPipe -DECLARE_INTERFACE_(IKsPinPipe, IUnknown) -{ - STDMETHOD(KsGetPinFramingCache)( - THIS_ - PKSALLOCATOR_FRAMING_EX *FramingEx, - PFRAMING_PROP FramingProp, - FRAMING_CACHE_OPS Option - ) PURE; - STDMETHOD(KsSetPinFramingCache)( - THIS_ - PKSALLOCATOR_FRAMING_EX FramingEx, - PFRAMING_PROP FramingProp, - FRAMING_CACHE_OPS Option - ) PURE; - STDMETHOD_(IPin*, KsGetConnectedPin)( - THIS - ) PURE; - STDMETHOD_(IKsAllocatorEx*, KsGetPipe)( - THIS_ - KSPEEKOPERATION Operation - ) PURE; - STDMETHOD(KsSetPipe)( - THIS_ - IKsAllocatorEx *KsAllocator - ) PURE; - STDMETHOD_(ULONG, KsGetPipeAllocatorFlag)( - THIS - ) PURE; - STDMETHOD(KsSetPipeAllocatorFlag)( - THIS_ - ULONG Flag - ) PURE; - STDMETHOD_(GUID, KsGetPinBusCache)( - THIS - ) PURE; - STDMETHOD(KsSetPinBusCache)( - THIS_ - GUID Bus - ) PURE; -// -// very useful methods for tracing. -// - STDMETHOD_(PWCHAR, KsGetPinName)( - THIS - ) PURE; - STDMETHOD_(PWCHAR, KsGetFilterName)( - THIS - ) PURE; -}; - - -interface DECLSPEC_UUID("CD5EBE6B-8B6E-11D1-8AE0-00A0C9223196") IKsPinFactory; -#undef INTERFACE -#define INTERFACE IKsPinFactory -DECLARE_INTERFACE_(IKsPinFactory, IUnknown) -{ - STDMETHOD(KsPinFactory)( - THIS_ - ULONG* PinFactory - ) PURE; -}; - -typedef enum { - KsIoOperation_Write, - KsIoOperation_Read -} KSIOOPERATION; - -interface DECLSPEC_UUID("5ffbaa02-49a3-11d0-9f36-00aa00a216a1") IKsDataTypeHandler; -#undef INTERFACE -#define INTERFACE IKsDataTypeHandler -DECLARE_INTERFACE_(IKsDataTypeHandler, IUnknown) -{ - STDMETHOD(KsCompleteIoOperation)( - THIS_ - IMediaSample *Sample, - PVOID StreamHeader, - KSIOOPERATION IoOperation, - BOOL Cancelled - ) PURE; - STDMETHOD(KsIsMediaTypeInRanges)( - THIS_ - PVOID DataRanges - ) PURE; - STDMETHOD(KsPrepareIoOperation)( - THIS_ - IMediaSample *Sample, - PVOID StreamHeader, - KSIOOPERATION IoOperation - ) PURE; - STDMETHOD(KsQueryExtendedSize)( - THIS_ - ULONG* ExtendedSize - ) PURE; - STDMETHOD(KsSetMediaType)( - THIS_ - const AM_MEDIA_TYPE* AmMediaType - ) PURE; -}; - -interface DECLSPEC_UUID("827D1A0E-0F73-11D2-B27A-00A0C9223196") IKsDataTypeCompletion; -#undef INTERFACE -#define INTERFACE IKsDataTypeCompletion -DECLARE_INTERFACE_(IKsDataTypeCompletion, IUnknown) -{ - STDMETHOD(KsCompleteMediaType)( - THIS_ - HANDLE FilterHandle, - ULONG PinFactoryId, - AM_MEDIA_TYPE* AmMediaType - ) PURE; -}; - -interface DECLSPEC_UUID("D3ABC7E0-9A61-11d0-A40D-00A0C9223196") IKsInterfaceHandler; -#undef INTERFACE -#define INTERFACE IKsInterfaceHandler -DECLARE_INTERFACE_(IKsInterfaceHandler, IUnknown) -{ - STDMETHOD(KsSetPin)( - THIS_ - IKsPin *KsPin - ) PURE; - STDMETHOD(KsProcessMediaSamples)( - THIS_ - IKsDataTypeHandler *KsDataTypeHandler, - IMediaSample** SampleList, - PLONG SampleCount, - KSIOOPERATION IoOperation, - PKSSTREAM_SEGMENT *StreamSegment - ) PURE; - STDMETHOD(KsCompleteIo)( - THIS_ - PKSSTREAM_SEGMENT StreamSegment - ) PURE; -}; - - -// -// This structure definition is the common header required by the proxy to -// dispatch the stream segment to the interface handler. Interface handlers -// will create extended structures to include other information such as -// media samples, extended header size and so on. -// - -typedef struct _KSSTREAM_SEGMENT { - IKsInterfaceHandler *KsInterfaceHandler; - IKsDataTypeHandler *KsDataTypeHandler; - KSIOOPERATION IoOperation; - HANDLE CompletionEvent; - -} KSSTREAM_SEGMENT; - -interface DECLSPEC_UUID("423c13a2-2070-11d0-9ef7-00aa00a216a1") IKsObject; -#undef INTERFACE -#define INTERFACE IKsObject -DECLARE_INTERFACE_(IKsObject, IUnknown) -{ - STDMETHOD_(HANDLE, KsGetObjectHandle)( - THIS - ) PURE; -}; - -interface DECLSPEC_UUID("97ebaacb-95bd-11d0-a3ea-00a0c9223196") IKsQualityForwarder; -#undef INTERFACE -#define INTERFACE IKsQualityForwarder -DECLARE_INTERFACE_(IKsQualityForwarder, IKsObject) -{ - STDMETHOD_(VOID, KsFlushClient)( - THIS_ - IKsPin* Pin - ) PURE; -}; - -KSDDKAPI -HRESULT -WINAPI -KsResolveRequiredAttributes( - PKSDATARANGE DataRange, - PKSMULTIPLE_ITEM Attributes OPTIONAL - ); - -KSDDKAPI -HRESULT -WINAPI -KsOpenDefaultDevice( - REFGUID Category, - ACCESS_MASK Access, - PHANDLE DeviceHandle - ); -KSDDKAPI -HRESULT -WINAPI -KsSynchronousDeviceControl( - HANDLE Handle, - ULONG IoControl, - PVOID InBuffer, - ULONG InLength, - PVOID OutBuffer, - ULONG OutLength, - PULONG BytesReturned - ); -KSDDKAPI -HRESULT -WINAPI -KsGetMultiplePinFactoryItems( - HANDLE FilterHandle, - ULONG PinFactoryId, - ULONG PropertyId, - PVOID* Items - ); -KSDDKAPI -HRESULT -WINAPI -KsGetMediaTypeCount( - HANDLE FilterHandle, - ULONG PinFactoryId, - ULONG* MediaTypeCount - ); -KSDDKAPI -HRESULT -WINAPI -KsGetMediaType( - int Position, - AM_MEDIA_TYPE* AmMediaType, - HANDLE FilterHandle, - ULONG PinFactoryId - ); - -#endif // __STREAMS__ - -#ifndef _IKsPropertySet_ -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUIDEX(IID_IKsPropertySet); -#endif // !defined(__cplusplus) || _MSC_VER < 1100 -#endif // _IKsPropertySet_ - -#ifndef _IKsControl_ -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUIDEX(IID_IKsControl); -#endif // !defined(__cplusplus) || _MSC_VER < 1100 -#endif // _IKsControl_ - -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUIDEX(IID_IKsAggregateControl); -#endif // !defined(__cplusplus) || _MSC_VER < 1100 - -#ifndef _IKsTopology_ -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUIDEX(IID_IKsTopology); -#endif // !defined(__cplusplus) || _MSC_VER < 1100 -#endif // _IKsTopology_ - -DEFINE_GUIDSTRUCT("17CCA71B-ECD7-11D0-B908-00A0C9223196", CLSID_Proxy); -#define CLSID_Proxy DEFINE_GUIDNAMED(CLSID_Proxy) - -#else // !_KS_ - -#ifndef _IKsPropertySet_ -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUID(IID_IKsPropertySet, STATIC_IID_IKsPropertySet); -#endif // !defined(__cplusplus) || _MSC_VER < 1100 -#endif // _IKsPropertySet_ - -#if !defined(__cplusplus) || _MSC_VER < 1100 -DEFINE_GUID(CLSID_Proxy, STATIC_CLSID_Proxy); -#else // defined(__cplusplus) && _MSC_VER >= 1100 -DECLSPEC_UUID("17CCA71B-ECD7-11D0-B908-00A0C9223196") CLSID_Proxy; -#endif // defined(__cplusplus) && _MSC_VER >= 1100 - -#endif // !_KS_ - -#ifndef _IKsPropertySet_ -#define _IKsPropertySet_ - -#define KSPROPERTY_SUPPORT_GET 1 -#define KSPROPERTY_SUPPORT_SET 2 - -#ifdef DECLARE_INTERFACE_ - -interface DECLSPEC_UUID("31EFAC30-515C-11d0-A9AA-00aa0061be93") IKsPropertySet; -#undef INTERFACE -#define INTERFACE IKsPropertySet -DECLARE_INTERFACE_(IKsPropertySet, IUnknown) -{ - STDMETHOD(Set)( - THIS_ - IN REFGUID PropSet, - IN ULONG Id, - IN LPVOID InstanceData, - IN ULONG InstanceLength, - IN LPVOID PropertyData, - IN ULONG DataLength - ) PURE; - - STDMETHOD(Get)( - THIS_ - IN REFGUID PropSet, - IN ULONG Id, - IN LPVOID InstanceData, - IN ULONG InstanceLength, - OUT LPVOID PropertyData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - - STDMETHOD(QuerySupported)( - THIS_ - IN REFGUID PropSet, - IN ULONG Id, - OUT ULONG* TypeSupport - ) PURE; -}; - -#endif // DECLARE_INTERFACE_ - -#endif // _IKsPropertySet_ - -#ifndef _IKsControl_ -#define _IKsControl_ - -#ifdef DECLARE_INTERFACE_ - -interface DECLSPEC_UUID("28F54685-06FD-11D2-B27A-00A0C9223196") IKsControl; -#undef INTERFACE -#define INTERFACE IKsControl -DECLARE_INTERFACE_(IKsControl, IUnknown) -{ - STDMETHOD(KsProperty)( - THIS_ - IN PKSPROPERTY Property, - IN ULONG PropertyLength, - IN OUT LPVOID PropertyData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD(KsMethod)( - THIS_ - IN PKSMETHOD Method, - IN ULONG MethodLength, - IN OUT LPVOID MethodData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; - STDMETHOD(KsEvent)( - THIS_ - IN PKSEVENT Event OPTIONAL, - IN ULONG EventLength, - IN OUT LPVOID EventData, - IN ULONG DataLength, - OUT ULONG* BytesReturned - ) PURE; -}; - -#endif // DECLARE_INTERFACE_ - -#endif // _IKsControl_ - - -#ifdef DECLARE_INTERFACE_ - -interface DECLSPEC_UUID("7F40EAC0-3947-11D2-874E-00A0C9223196") IKsAggregateControl; -#undef INTERFACE -#define INTERFACE IKsAggregateControl -DECLARE_INTERFACE_(IKsAggregateControl, IUnknown) -{ - STDMETHOD(KsAddAggregate)( - THIS_ - IN REFGUID AggregateClass - ) PURE; - STDMETHOD(KsRemoveAggregate)( - THIS_ - IN REFGUID AggregateClass - ) PURE; -}; - -#endif // DECLARE_INTERFACE_ - -#ifndef _IKsTopology_ -#define _IKsTopology_ - -#ifdef DECLARE_INTERFACE_ - -interface DECLSPEC_UUID("28F54683-06FD-11D2-B27A-00A0C9223196") IKsTopology; -#undef INTERFACE -#define INTERFACE IKsTopology -DECLARE_INTERFACE_(IKsTopology, IUnknown) -{ - STDMETHOD(CreateNodeInstance)( - THIS_ - IN ULONG NodeId, - IN ULONG Flags, - IN ACCESS_MASK DesiredAccess, - IN IUnknown* UnkOuter OPTIONAL, - IN REFGUID InterfaceId, - OUT LPVOID* Interface - ) PURE; -}; - -#endif // DECLARE_INTERFACE_ - -#endif // _IKsTopology_ - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif // __KSPROXY__ diff --git a/import/DirectX8/include/ksuuids.h b/import/DirectX8/include/ksuuids.h deleted file mode 100644 index 1d06ddd88..000000000 --- a/import/DirectX8/include/ksuuids.h +++ /dev/null @@ -1,228 +0,0 @@ -//------------------------------------------------------------------------------ -// File: ksuuids.h -// -// Desc: Contains the GUIDs for the MediaType type, subtype fields and format -// types for DVD/MPEG2 media types. -// -// Copyright (c) 1992 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// -// --- MPEG 2 definitions --- -// - -// 36523B13-8EE5-11d1-8CA3-0060B057664A -OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK, -0x36523B13, 0x8EE5, 0x11d1, 0x8C, 0xA3, 0x00, 0x60, 0xB0, 0x57, 0x66, 0x4A) - -// e06d8020-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES, -0xe06d8020, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea) - - -#if 0 -DEFINE_GUID(MEDIATYPE_CONTROL, -0xe06d8021, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea); -#endif // #if 0 - - -// e06d8026-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO, -0xe06d8026, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea) - -// use MPEG2VIDEOINFO (defined below) with FORMAT_MPEG2_VIDEO -// e06d80e3-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO, -0xe06d80e3, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea) - -// F72A76A0-EB0A-11d0-ACE4-0000C0CC16BA (FORMAT_VideoInfo2) -OUR_GUID_ENTRY(FORMAT_VIDEOINFO2, -0xf72a76A0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba) - -// MPEG2 Other subtypes -// e06d8022-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM, -0xe06d8022, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8023-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT, -0xe06d8023, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// 138AA9A4-1EE2-4c5b-988E-19ABFDBC8A11 -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE, -0x138aa9a4, 0x1ee2, 0x4c5b, 0x98, 0x8e, 0x19, 0xab, 0xfd, 0xbc, 0x8a, 0x11) - -// e06d802b-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO, -0xe06d802b, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d802c-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3, -0xe06d802c, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d802d-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE, -0xe06d802d, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8032-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO, -0xe06d8032, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8033-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DTS, -0xe06d8033, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8034-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS, -0xe06d8034, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// DVD-related mediatypes -// ED0B916A-044D-11d1-AA78-00C04FC31D60 -OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK, -0xed0b916a, 0x044d, 0x11d1, 0xaa, 0x78, 0x00, 0xc0, 0x04f, 0xc3, 0x1d, 0x60) - -// e06d802e-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION, -0xe06d802e, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d802f-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI, -0xe06d802f, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8030-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI, -0xe06d8030, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d8031-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER, -0xe06d8031, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// -// DVD - MPEG2/AC3-related Formats -// -// e06d80e3-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(FORMAT_MPEG2Video, -0xe06d80e3, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d80e4-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(FORMAT_DolbyAC3, -0xe06d80e4, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d80e5-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(FORMAT_MPEG2Audio, -0xe06d80e5, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - -// e06d80e6-db46-11cf-b4d1-00805f6cbbea -OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio, -0xe06d80e6, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x05f, 0x6c, 0xbb, 0xea) - - -// -// KS Property Set Id (to communicate with the WDM Proxy filter) -- from -// ksmedia.h of WDM DDK. -// - -// BFABE720-6E1F-11D0-BCF2-444553540000 -OUR_GUID_ENTRY(AM_KSPROPSETID_AC3, -0xBFABE720, 0x6E1F, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00) - -// ac390460-43af-11d0-bd6a-003505c103a9 -OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic, -0xac390460, 0x43af, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9) - -// 0E8A0A40L-6AEF-11D0-9ED0-00A024CA19B3 -OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt, -0x0E8A0A40, 0x6AEF, 0x11D0, 0x9E, 0xD0, 0x00, 0xA0, 0x24, 0xCA, 0x19, 0xB3) - -// A503C5C0-1D1D-11d1-AD80-444553540000 -OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange, -0xa503c5c0, 0x1d1d, 0x11d1, 0xad, 0x80, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0) - -// 3577EB09-9582-477f-B29C-B0C452A4FF9A -OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange, -0x3577eb09, 0x9582, 0x477f, 0xb2, 0x9c, 0xb0, 0xc4, 0x52, 0xa4, 0xff, 0x9a) - -// ae4720ae-aa71-42d8-b82a-fffdf58b76fd -OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke, -0xae4720ae, 0xaa71, 0x42d8, 0xb8, 0x2a, 0xff, 0xfd, 0xf5, 0x8b, 0x76, 0xfd) - -// c830acbd-ab07-492f-8852-45b6987c2979 -OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep, -0xc830acbd, 0xab07, 0x492f, 0x88, 0x52, 0x45, 0xb6, 0x98, 0x7c, 0x29, 0x79) - -// -// KS categories from ks.h and ksmedia.h -// -// - -// 65E8773D-8F56-11D0-A3B9-00A0C9223196 -OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE, -0x65E8773DL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// 65E8773E-8F56-11D0-A3B9-00A0C9223196 -OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER, -0x65E8773EL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// 1E84C900-7E70-11D0-A5D6-28DB04C10000 -OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR, -0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) - -// 6994AD04-93EF-11D0-A3CC-00A0C9223196 -OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO, -0x6994AD04L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// 6994AD05-93EF-11D0-A3CC-00A0C9223196 -OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO, -0x6994AD05L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// a799a800-a46d-11d0-a18c-00a02401dcd4 -OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER, -0xa799a800L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4) - -// a799a801-a46d-11d0-a18c-00a02401dcd4 -OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR, -0xa799a801L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4) - -// a799a802-a46d-11d0-a18c-00a02401dcd4 -OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO, -0xa799a802L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4) - - -// 07dad660L-22f1-11d1-a9f4-00c04fbbde8f -OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC, -0x07dad660L, 0x22f1, 0x11d1, 0xa9, 0xf4, 0x00, 0xc0, 0x4f, 0xbb, 0xde, 0x8f) - - -// 0A4252A0L-7E70-11D0-A5D6-28DB04C10000 -OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER, -0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) - - -// -// guids needed to support IKsPin interface -// - -// d3abc7e0l-9a61-11d0-a40d00a0c9223196 -OUR_GUID_ENTRY(IID_IKsInterfaceHandler, -0xD3ABC7E0L, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// 5ffbaa02l-49a3-11d0-9f3600aa00a216a1 -OUR_GUID_ENTRY(IID_IKsDataTypeHandler, -0x5FFBAA02L, 0x49A3, 0x11D0, 0x9F, 0x36, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xA1) - -// b61178d1-a2d9-11cf-9e53-00aa00a216a1 -OUR_GUID_ENTRY(IID_IKsPin, -0xb61178d1L, 0xa2d9, 0x11cf, 0x9e, 0x53, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1) - -// 28F54685-06FD-11D2-B27A-00A0C9223196 -OUR_GUID_ENTRY(IID_IKsControl, -0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// CD5EBE6B-8B6E-11D1-8AE0-00A0C9223196 -OUR_GUID_ENTRY(IID_IKsPinFactory, -0xCD5EBE6BL, 0x8B6E, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96) - -// 1A8766A0-62CE-11CF-A5D6-28DB04C10000 -OUR_GUID_ENTRY(AM_INTERFACESETID_Standard, -0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) diff --git a/import/DirectX8/include/mediaerr.h b/import/DirectX8/include/mediaerr.h deleted file mode 100644 index 5203d554f..000000000 --- a/import/DirectX8/include/mediaerr.h +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MediaErr.h -// -// Desc: Shell error codes -// -// Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _MEDIAERR_H_ -#define _MEDIAERR_H_ - -#define DMO_E_INVALIDSTREAMINDEX 0x80040201 -#define DMO_E_INVALIDTYPE 0x80040202 -#define DMO_E_TYPE_NOT_SET 0x80040203 -#define DMO_E_NOTACCEPTING 0x80040204 -#define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 -#define DMO_E_NO_MORE_ITEMS 0x80040206 - -#endif _MEDIAERR_H_ diff --git a/import/DirectX8/include/mediaobj.h b/import/DirectX8/include/mediaobj.h deleted file mode 100644 index 047e3a45f..000000000 --- a/import/DirectX8/include/mediaobj.h +++ /dev/null @@ -1,1574 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for mediaobj.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __mediaobj_h__ -#define __mediaobj_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IMediaBuffer_FWD_DEFINED__ -#define __IMediaBuffer_FWD_DEFINED__ -typedef interface IMediaBuffer IMediaBuffer; -#endif /* __IMediaBuffer_FWD_DEFINED__ */ - - -#ifndef __IMediaObject_FWD_DEFINED__ -#define __IMediaObject_FWD_DEFINED__ -typedef interface IMediaObject IMediaObject; -#endif /* __IMediaObject_FWD_DEFINED__ */ - - -#ifndef __IEnumDMO_FWD_DEFINED__ -#define __IEnumDMO_FWD_DEFINED__ -typedef interface IEnumDMO IEnumDMO; -#endif /* __IEnumDMO_FWD_DEFINED__ */ - - -#ifndef __IMediaObjectInPlace_FWD_DEFINED__ -#define __IMediaObjectInPlace_FWD_DEFINED__ -typedef interface IMediaObjectInPlace IMediaObjectInPlace; -#endif /* __IMediaObjectInPlace_FWD_DEFINED__ */ - - -#ifndef __IDMOQualityControl_FWD_DEFINED__ -#define __IDMOQualityControl_FWD_DEFINED__ -typedef interface IDMOQualityControl IDMOQualityControl; -#endif /* __IDMOQualityControl_FWD_DEFINED__ */ - - -#ifndef __IDMOVideoOutputOptimizations_FWD_DEFINED__ -#define __IDMOVideoOutputOptimizations_FWD_DEFINED__ -typedef interface IDMOVideoOutputOptimizations IDMOVideoOutputOptimizations; -#endif /* __IDMOVideoOutputOptimizations_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_mediaobj_0000 */ -/* [local] */ - -#ifdef __strmif_h__ -typedef AM_MEDIA_TYPE DMO_MEDIA_TYPE; -#else -typedef struct _DMOMediaType - { - GUID majortype; - GUID subtype; - BOOL bFixedSizeSamples; - BOOL bTemporalCompression; - ULONG lSampleSize; - GUID formattype; - IUnknown *pUnk; - ULONG cbFormat; - /* [size_is] */ BYTE *pbFormat; - } DMO_MEDIA_TYPE; - -typedef LONGLONG REFERENCE_TIME; - -#endif - -enum _DMO_INPUT_DATA_BUFFER_FLAGS - { DMO_INPUT_DATA_BUFFERF_SYNCPOINT = 0x1, - DMO_INPUT_DATA_BUFFERF_TIME = 0x2, - DMO_INPUT_DATA_BUFFERF_TIMELENGTH = 0x4 - } ; - -enum _DMO_OUTPUT_DATA_BUFFER_FLAGS - { DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT = 0x1, - DMO_OUTPUT_DATA_BUFFERF_TIME = 0x2, - DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH = 0x4, - DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE = 0x1000000 - } ; - -enum _DMO_INPUT_STATUS_FLAGS - { DMO_INPUT_STATUSF_ACCEPT_DATA = 0x1 - } ; - -enum _DMO_INPUT_STREAM_INFO_FLAGS - { DMO_INPUT_STREAMF_WHOLE_SAMPLES = 0x1, - DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = 0x2, - DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE = 0x4, - DMO_INPUT_STREAMF_HOLDS_BUFFERS = 0x8 - } ; - -enum _DMO_OUTPUT_STREAM_INFO_FLAGS - { DMO_OUTPUT_STREAMF_WHOLE_SAMPLES = 0x1, - DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = 0x2, - DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE = 0x4, - DMO_OUTPUT_STREAMF_DISCARDABLE = 0x8, - DMO_OUTPUT_STREAMF_OPTIONAL = 0x10 - } ; - -enum _DMO_SET_TYPE_FLAGS - { DMO_SET_TYPEF_TEST_ONLY = 0x1, - DMO_SET_TYPEF_CLEAR = 0x2 - } ; - -enum _DMO_PROCESS_OUTPUT_FLAGS - { DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0000_v0_0_s_ifspec; - -#ifndef __IMediaBuffer_INTERFACE_DEFINED__ -#define __IMediaBuffer_INTERFACE_DEFINED__ - -/* interface IMediaBuffer */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IMediaBuffer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("59eff8b9-938c-4a26-82f2-95cb84cdc837") - IMediaBuffer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetLength( - DWORD cbLength) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMaxLength( - /* [out] */ DWORD *pcbMaxLength) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBufferAndLength( - /* [out] */ BYTE **ppBuffer, - /* [out] */ DWORD *pcbLength) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaBufferVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaBuffer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaBuffer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaBuffer * This); - - HRESULT ( STDMETHODCALLTYPE *SetLength )( - IMediaBuffer * This, - DWORD cbLength); - - HRESULT ( STDMETHODCALLTYPE *GetMaxLength )( - IMediaBuffer * This, - /* [out] */ DWORD *pcbMaxLength); - - HRESULT ( STDMETHODCALLTYPE *GetBufferAndLength )( - IMediaBuffer * This, - /* [out] */ BYTE **ppBuffer, - /* [out] */ DWORD *pcbLength); - - END_INTERFACE - } IMediaBufferVtbl; - - interface IMediaBuffer - { - CONST_VTBL struct IMediaBufferVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaBuffer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaBuffer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaBuffer_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaBuffer_SetLength(This,cbLength) \ - (This)->lpVtbl -> SetLength(This,cbLength) - -#define IMediaBuffer_GetMaxLength(This,pcbMaxLength) \ - (This)->lpVtbl -> GetMaxLength(This,pcbMaxLength) - -#define IMediaBuffer_GetBufferAndLength(This,ppBuffer,pcbLength) \ - (This)->lpVtbl -> GetBufferAndLength(This,ppBuffer,pcbLength) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaBuffer_SetLength_Proxy( - IMediaBuffer * This, - DWORD cbLength); - - -void __RPC_STUB IMediaBuffer_SetLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaBuffer_GetMaxLength_Proxy( - IMediaBuffer * This, - /* [out] */ DWORD *pcbMaxLength); - - -void __RPC_STUB IMediaBuffer_GetMaxLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaBuffer_GetBufferAndLength_Proxy( - IMediaBuffer * This, - /* [out] */ BYTE **ppBuffer, - /* [out] */ DWORD *pcbLength); - - -void __RPC_STUB IMediaBuffer_GetBufferAndLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaBuffer_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_mediaobj_0089 */ -/* [local] */ - -typedef struct _DMO_OUTPUT_DATA_BUFFER - { - IMediaBuffer *pBuffer; - DWORD dwStatus; - REFERENCE_TIME rtTimestamp; - REFERENCE_TIME rtTimelength; - } DMO_OUTPUT_DATA_BUFFER; - -typedef struct _DMO_OUTPUT_DATA_BUFFER *PDMO_OUTPUT_DATA_BUFFER; - - - -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0089_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0089_v0_0_s_ifspec; - -#ifndef __IMediaObject_INTERFACE_DEFINED__ -#define __IMediaObject_INTERFACE_DEFINED__ - -/* interface IMediaObject */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IMediaObject; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d8ad0f58-5494-4102-97c5-ec798e59bcf4") - IMediaObject : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetStreamCount( - /* [out] */ DWORD *pcInputStreams, - /* [out] */ DWORD *pcOutputStreams) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputStreamInfo( - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputStreamInfo( - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputType( - DWORD dwInputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputType( - DWORD dwOutputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInputType( - DWORD dwInputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputType( - DWORD dwOutputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputCurrentType( - DWORD dwInputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputCurrentType( - DWORD dwOutputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputSizeInfo( - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbMaxLookahead, - /* [out] */ DWORD *pcbAlignment) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputSizeInfo( - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbAlignment) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputMaxLatency( - DWORD dwInputStreamIndex, - /* [out] */ REFERENCE_TIME *prtMaxLatency) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInputMaxLatency( - DWORD dwInputStreamIndex, - REFERENCE_TIME rtMaxLatency) = 0; - - virtual HRESULT STDMETHODCALLTYPE Flush( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Discontinuity( - DWORD dwInputStreamIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE AllocateStreamingResources( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeStreamingResources( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInputStatus( - DWORD dwInputStreamIndex, - /* [out] */ DWORD *dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE ProcessInput( - DWORD dwInputStreamIndex, - IMediaBuffer *pBuffer, - DWORD dwFlags, - REFERENCE_TIME rtTimestamp, - REFERENCE_TIME rtTimelength) = 0; - - virtual HRESULT STDMETHODCALLTYPE ProcessOutput( - DWORD dwFlags, - DWORD cOutputBufferCount, - /* [size_is][out][in] */ DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, - /* [out] */ DWORD *pdwStatus) = 0; - - virtual HRESULT STDMETHODCALLTYPE Lock( - LONG bLock) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaObjectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaObject * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaObject * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaObject * This); - - HRESULT ( STDMETHODCALLTYPE *GetStreamCount )( - IMediaObject * This, - /* [out] */ DWORD *pcInputStreams, - /* [out] */ DWORD *pcOutputStreams); - - HRESULT ( STDMETHODCALLTYPE *GetInputStreamInfo )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetOutputStreamInfo )( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetInputType )( - IMediaObject * This, - DWORD dwInputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetOutputType )( - IMediaObject * This, - DWORD dwOutputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *SetInputType )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *SetOutputType )( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetInputCurrentType )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetOutputCurrentType )( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetInputSizeInfo )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbMaxLookahead, - /* [out] */ DWORD *pcbAlignment); - - HRESULT ( STDMETHODCALLTYPE *GetOutputSizeInfo )( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbAlignment); - - HRESULT ( STDMETHODCALLTYPE *GetInputMaxLatency )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ REFERENCE_TIME *prtMaxLatency); - - HRESULT ( STDMETHODCALLTYPE *SetInputMaxLatency )( - IMediaObject * This, - DWORD dwInputStreamIndex, - REFERENCE_TIME rtMaxLatency); - - HRESULT ( STDMETHODCALLTYPE *Flush )( - IMediaObject * This); - - HRESULT ( STDMETHODCALLTYPE *Discontinuity )( - IMediaObject * This, - DWORD dwInputStreamIndex); - - HRESULT ( STDMETHODCALLTYPE *AllocateStreamingResources )( - IMediaObject * This); - - HRESULT ( STDMETHODCALLTYPE *FreeStreamingResources )( - IMediaObject * This); - - HRESULT ( STDMETHODCALLTYPE *GetInputStatus )( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *dwFlags); - - HRESULT ( STDMETHODCALLTYPE *ProcessInput )( - IMediaObject * This, - DWORD dwInputStreamIndex, - IMediaBuffer *pBuffer, - DWORD dwFlags, - REFERENCE_TIME rtTimestamp, - REFERENCE_TIME rtTimelength); - - HRESULT ( STDMETHODCALLTYPE *ProcessOutput )( - IMediaObject * This, - DWORD dwFlags, - DWORD cOutputBufferCount, - /* [size_is][out][in] */ DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, - /* [out] */ DWORD *pdwStatus); - - HRESULT ( STDMETHODCALLTYPE *Lock )( - IMediaObject * This, - LONG bLock); - - END_INTERFACE - } IMediaObjectVtbl; - - interface IMediaObject - { - CONST_VTBL struct IMediaObjectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaObject_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaObject_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaObject_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaObject_GetStreamCount(This,pcInputStreams,pcOutputStreams) \ - (This)->lpVtbl -> GetStreamCount(This,pcInputStreams,pcOutputStreams) - -#define IMediaObject_GetInputStreamInfo(This,dwInputStreamIndex,pdwFlags) \ - (This)->lpVtbl -> GetInputStreamInfo(This,dwInputStreamIndex,pdwFlags) - -#define IMediaObject_GetOutputStreamInfo(This,dwOutputStreamIndex,pdwFlags) \ - (This)->lpVtbl -> GetOutputStreamInfo(This,dwOutputStreamIndex,pdwFlags) - -#define IMediaObject_GetInputType(This,dwInputStreamIndex,dwTypeIndex,pmt) \ - (This)->lpVtbl -> GetInputType(This,dwInputStreamIndex,dwTypeIndex,pmt) - -#define IMediaObject_GetOutputType(This,dwOutputStreamIndex,dwTypeIndex,pmt) \ - (This)->lpVtbl -> GetOutputType(This,dwOutputStreamIndex,dwTypeIndex,pmt) - -#define IMediaObject_SetInputType(This,dwInputStreamIndex,pmt,dwFlags) \ - (This)->lpVtbl -> SetInputType(This,dwInputStreamIndex,pmt,dwFlags) - -#define IMediaObject_SetOutputType(This,dwOutputStreamIndex,pmt,dwFlags) \ - (This)->lpVtbl -> SetOutputType(This,dwOutputStreamIndex,pmt,dwFlags) - -#define IMediaObject_GetInputCurrentType(This,dwInputStreamIndex,pmt) \ - (This)->lpVtbl -> GetInputCurrentType(This,dwInputStreamIndex,pmt) - -#define IMediaObject_GetOutputCurrentType(This,dwOutputStreamIndex,pmt) \ - (This)->lpVtbl -> GetOutputCurrentType(This,dwOutputStreamIndex,pmt) - -#define IMediaObject_GetInputSizeInfo(This,dwInputStreamIndex,pcbSize,pcbMaxLookahead,pcbAlignment) \ - (This)->lpVtbl -> GetInputSizeInfo(This,dwInputStreamIndex,pcbSize,pcbMaxLookahead,pcbAlignment) - -#define IMediaObject_GetOutputSizeInfo(This,dwOutputStreamIndex,pcbSize,pcbAlignment) \ - (This)->lpVtbl -> GetOutputSizeInfo(This,dwOutputStreamIndex,pcbSize,pcbAlignment) - -#define IMediaObject_GetInputMaxLatency(This,dwInputStreamIndex,prtMaxLatency) \ - (This)->lpVtbl -> GetInputMaxLatency(This,dwInputStreamIndex,prtMaxLatency) - -#define IMediaObject_SetInputMaxLatency(This,dwInputStreamIndex,rtMaxLatency) \ - (This)->lpVtbl -> SetInputMaxLatency(This,dwInputStreamIndex,rtMaxLatency) - -#define IMediaObject_Flush(This) \ - (This)->lpVtbl -> Flush(This) - -#define IMediaObject_Discontinuity(This,dwInputStreamIndex) \ - (This)->lpVtbl -> Discontinuity(This,dwInputStreamIndex) - -#define IMediaObject_AllocateStreamingResources(This) \ - (This)->lpVtbl -> AllocateStreamingResources(This) - -#define IMediaObject_FreeStreamingResources(This) \ - (This)->lpVtbl -> FreeStreamingResources(This) - -#define IMediaObject_GetInputStatus(This,dwInputStreamIndex,dwFlags) \ - (This)->lpVtbl -> GetInputStatus(This,dwInputStreamIndex,dwFlags) - -#define IMediaObject_ProcessInput(This,dwInputStreamIndex,pBuffer,dwFlags,rtTimestamp,rtTimelength) \ - (This)->lpVtbl -> ProcessInput(This,dwInputStreamIndex,pBuffer,dwFlags,rtTimestamp,rtTimelength) - -#define IMediaObject_ProcessOutput(This,dwFlags,cOutputBufferCount,pOutputBuffers,pdwStatus) \ - (This)->lpVtbl -> ProcessOutput(This,dwFlags,cOutputBufferCount,pOutputBuffers,pdwStatus) - -#define IMediaObject_Lock(This,bLock) \ - (This)->lpVtbl -> Lock(This,bLock) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetStreamCount_Proxy( - IMediaObject * This, - /* [out] */ DWORD *pcInputStreams, - /* [out] */ DWORD *pcOutputStreams); - - -void __RPC_STUB IMediaObject_GetStreamCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputStreamInfo_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IMediaObject_GetInputStreamInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetOutputStreamInfo_Proxy( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IMediaObject_GetOutputStreamInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputType_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - -void __RPC_STUB IMediaObject_GetInputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetOutputType_Proxy( - IMediaObject * This, - DWORD dwOutputStreamIndex, - DWORD dwTypeIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - -void __RPC_STUB IMediaObject_GetOutputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_SetInputType_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags); - - -void __RPC_STUB IMediaObject_SetInputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_SetOutputType_Proxy( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [in] */ const DMO_MEDIA_TYPE *pmt, - DWORD dwFlags); - - -void __RPC_STUB IMediaObject_SetOutputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputCurrentType_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - -void __RPC_STUB IMediaObject_GetInputCurrentType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetOutputCurrentType_Proxy( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DMO_MEDIA_TYPE *pmt); - - -void __RPC_STUB IMediaObject_GetOutputCurrentType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputSizeInfo_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbMaxLookahead, - /* [out] */ DWORD *pcbAlignment); - - -void __RPC_STUB IMediaObject_GetInputSizeInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetOutputSizeInfo_Proxy( - IMediaObject * This, - DWORD dwOutputStreamIndex, - /* [out] */ DWORD *pcbSize, - /* [out] */ DWORD *pcbAlignment); - - -void __RPC_STUB IMediaObject_GetOutputSizeInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputMaxLatency_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ REFERENCE_TIME *prtMaxLatency); - - -void __RPC_STUB IMediaObject_GetInputMaxLatency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_SetInputMaxLatency_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - REFERENCE_TIME rtMaxLatency); - - -void __RPC_STUB IMediaObject_SetInputMaxLatency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_Flush_Proxy( - IMediaObject * This); - - -void __RPC_STUB IMediaObject_Flush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_Discontinuity_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex); - - -void __RPC_STUB IMediaObject_Discontinuity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_AllocateStreamingResources_Proxy( - IMediaObject * This); - - -void __RPC_STUB IMediaObject_AllocateStreamingResources_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_FreeStreamingResources_Proxy( - IMediaObject * This); - - -void __RPC_STUB IMediaObject_FreeStreamingResources_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_GetInputStatus_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - /* [out] */ DWORD *dwFlags); - - -void __RPC_STUB IMediaObject_GetInputStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_ProcessInput_Proxy( - IMediaObject * This, - DWORD dwInputStreamIndex, - IMediaBuffer *pBuffer, - DWORD dwFlags, - REFERENCE_TIME rtTimestamp, - REFERENCE_TIME rtTimelength); - - -void __RPC_STUB IMediaObject_ProcessInput_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_ProcessOutput_Proxy( - IMediaObject * This, - DWORD dwFlags, - DWORD cOutputBufferCount, - /* [size_is][out][in] */ DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, - /* [out] */ DWORD *pdwStatus); - - -void __RPC_STUB IMediaObject_ProcessOutput_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObject_Lock_Proxy( - IMediaObject * This, - LONG bLock); - - -void __RPC_STUB IMediaObject_Lock_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaObject_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumDMO_INTERFACE_DEFINED__ -#define __IEnumDMO_INTERFACE_DEFINED__ - -/* interface IEnumDMO */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IEnumDMO; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2c3cd98a-2bfa-4a53-9c27-5249ba64ba0f") - IEnumDMO : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - DWORD cItemsToFetch, - /* [length_is][size_is][out] */ CLSID *pCLSID, - /* [string][length_is][size_is][out] */ WCHAR **Names, - /* [out] */ DWORD *pcItemsFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - DWORD cItemsToSkip) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumDMO **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumDMOVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumDMO * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumDMO * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumDMO * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumDMO * This, - DWORD cItemsToFetch, - /* [length_is][size_is][out] */ CLSID *pCLSID, - /* [string][length_is][size_is][out] */ WCHAR **Names, - /* [out] */ DWORD *pcItemsFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumDMO * This, - DWORD cItemsToSkip); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumDMO * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumDMO * This, - /* [out] */ IEnumDMO **ppEnum); - - END_INTERFACE - } IEnumDMOVtbl; - - interface IEnumDMO - { - CONST_VTBL struct IEnumDMOVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumDMO_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumDMO_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumDMO_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumDMO_Next(This,cItemsToFetch,pCLSID,Names,pcItemsFetched) \ - (This)->lpVtbl -> Next(This,cItemsToFetch,pCLSID,Names,pcItemsFetched) - -#define IEnumDMO_Skip(This,cItemsToSkip) \ - (This)->lpVtbl -> Skip(This,cItemsToSkip) - -#define IEnumDMO_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumDMO_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumDMO_Next_Proxy( - IEnumDMO * This, - DWORD cItemsToFetch, - /* [length_is][size_is][out] */ CLSID *pCLSID, - /* [string][length_is][size_is][out] */ WCHAR **Names, - /* [out] */ DWORD *pcItemsFetched); - - -void __RPC_STUB IEnumDMO_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumDMO_Skip_Proxy( - IEnumDMO * This, - DWORD cItemsToSkip); - - -void __RPC_STUB IEnumDMO_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumDMO_Reset_Proxy( - IEnumDMO * This); - - -void __RPC_STUB IEnumDMO_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumDMO_Clone_Proxy( - IEnumDMO * This, - /* [out] */ IEnumDMO **ppEnum); - - -void __RPC_STUB IEnumDMO_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumDMO_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_mediaobj_0091 */ -/* [local] */ - - -enum _DMO_INPLACE_PROCESS_FLAGS - { DMO_INPLACE_NORMAL = 0, - DMO_INPLACE_ZERO = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0091_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0091_v0_0_s_ifspec; - -#ifndef __IMediaObjectInPlace_INTERFACE_DEFINED__ -#define __IMediaObjectInPlace_INTERFACE_DEFINED__ - -/* interface IMediaObjectInPlace */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IMediaObjectInPlace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("651b9ad0-0fc7-4aa9-9538-d89931010741") - IMediaObjectInPlace : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Process( - /* [in] */ ULONG ulSize, - /* [size_is][out][in] */ BYTE *pData, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IMediaObjectInPlace **ppMediaObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetLatency( - /* [out] */ REFERENCE_TIME *pLatencyTime) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaObjectInPlaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaObjectInPlace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaObjectInPlace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaObjectInPlace * This); - - HRESULT ( STDMETHODCALLTYPE *Process )( - IMediaObjectInPlace * This, - /* [in] */ ULONG ulSize, - /* [size_is][out][in] */ BYTE *pData, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IMediaObjectInPlace * This, - /* [out] */ IMediaObjectInPlace **ppMediaObject); - - HRESULT ( STDMETHODCALLTYPE *GetLatency )( - IMediaObjectInPlace * This, - /* [out] */ REFERENCE_TIME *pLatencyTime); - - END_INTERFACE - } IMediaObjectInPlaceVtbl; - - interface IMediaObjectInPlace - { - CONST_VTBL struct IMediaObjectInPlaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaObjectInPlace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaObjectInPlace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaObjectInPlace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaObjectInPlace_Process(This,ulSize,pData,refTimeStart,dwFlags) \ - (This)->lpVtbl -> Process(This,ulSize,pData,refTimeStart,dwFlags) - -#define IMediaObjectInPlace_Clone(This,ppMediaObject) \ - (This)->lpVtbl -> Clone(This,ppMediaObject) - -#define IMediaObjectInPlace_GetLatency(This,pLatencyTime) \ - (This)->lpVtbl -> GetLatency(This,pLatencyTime) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaObjectInPlace_Process_Proxy( - IMediaObjectInPlace * This, - /* [in] */ ULONG ulSize, - /* [size_is][out][in] */ BYTE *pData, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IMediaObjectInPlace_Process_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObjectInPlace_Clone_Proxy( - IMediaObjectInPlace * This, - /* [out] */ IMediaObjectInPlace **ppMediaObject); - - -void __RPC_STUB IMediaObjectInPlace_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaObjectInPlace_GetLatency_Proxy( - IMediaObjectInPlace * This, - /* [out] */ REFERENCE_TIME *pLatencyTime); - - -void __RPC_STUB IMediaObjectInPlace_GetLatency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaObjectInPlace_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_mediaobj_0092 */ -/* [local] */ - - -enum _DMO_QUALITY_STATUS_FLAGS - { DMO_QUALITY_STATUS_ENABLED = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0092_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0092_v0_0_s_ifspec; - -#ifndef __IDMOQualityControl_INTERFACE_DEFINED__ -#define __IDMOQualityControl_INTERFACE_DEFINED__ - -/* interface IDMOQualityControl */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IDMOQualityControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("65abea96-cf36-453f-af8a-705e98f16260") - IDMOQualityControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetNow( - /* [in] */ REFERENCE_TIME rtNow) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStatus( - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStatus( - /* [out] */ DWORD *pdwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDMOQualityControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDMOQualityControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDMOQualityControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDMOQualityControl * This); - - HRESULT ( STDMETHODCALLTYPE *SetNow )( - IDMOQualityControl * This, - /* [in] */ REFERENCE_TIME rtNow); - - HRESULT ( STDMETHODCALLTYPE *SetStatus )( - IDMOQualityControl * This, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetStatus )( - IDMOQualityControl * This, - /* [out] */ DWORD *pdwFlags); - - END_INTERFACE - } IDMOQualityControlVtbl; - - interface IDMOQualityControl - { - CONST_VTBL struct IDMOQualityControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDMOQualityControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDMOQualityControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDMOQualityControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDMOQualityControl_SetNow(This,rtNow) \ - (This)->lpVtbl -> SetNow(This,rtNow) - -#define IDMOQualityControl_SetStatus(This,dwFlags) \ - (This)->lpVtbl -> SetStatus(This,dwFlags) - -#define IDMOQualityControl_GetStatus(This,pdwFlags) \ - (This)->lpVtbl -> GetStatus(This,pdwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDMOQualityControl_SetNow_Proxy( - IDMOQualityControl * This, - /* [in] */ REFERENCE_TIME rtNow); - - -void __RPC_STUB IDMOQualityControl_SetNow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDMOQualityControl_SetStatus_Proxy( - IDMOQualityControl * This, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDMOQualityControl_SetStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDMOQualityControl_GetStatus_Proxy( - IDMOQualityControl * This, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IDMOQualityControl_GetStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDMOQualityControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_mediaobj_0093 */ -/* [local] */ - - -enum _DMO_VIDEO_OUTPUT_STREAM_FLAGS - { DMO_VOSF_NEEDS_PREVIOUS_SAMPLE = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0093_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mediaobj_0093_v0_0_s_ifspec; - -#ifndef __IDMOVideoOutputOptimizations_INTERFACE_DEFINED__ -#define __IDMOVideoOutputOptimizations_INTERFACE_DEFINED__ - -/* interface IDMOVideoOutputOptimizations */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IDMOVideoOutputOptimizations; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("be8f4f4e-5b16-4d29-b350-7f6b5d9298ac") - IDMOVideoOutputOptimizations : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryOperationModePreferences( - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedCapabilities) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOperationMode( - ULONG ulOutputStreamIndex, - DWORD dwEnabledFeatures) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentOperationMode( - ULONG ulOutputStreamIndex, - DWORD *pdwEnabledFeatures) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSampleRequirements( - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedFeatures) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDMOVideoOutputOptimizationsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDMOVideoOutputOptimizations * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDMOVideoOutputOptimizations * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDMOVideoOutputOptimizations * This); - - HRESULT ( STDMETHODCALLTYPE *QueryOperationModePreferences )( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedCapabilities); - - HRESULT ( STDMETHODCALLTYPE *SetOperationMode )( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD dwEnabledFeatures); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentOperationMode )( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwEnabledFeatures); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSampleRequirements )( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedFeatures); - - END_INTERFACE - } IDMOVideoOutputOptimizationsVtbl; - - interface IDMOVideoOutputOptimizations - { - CONST_VTBL struct IDMOVideoOutputOptimizationsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDMOVideoOutputOptimizations_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDMOVideoOutputOptimizations_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDMOVideoOutputOptimizations_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDMOVideoOutputOptimizations_QueryOperationModePreferences(This,ulOutputStreamIndex,pdwRequestedCapabilities) \ - (This)->lpVtbl -> QueryOperationModePreferences(This,ulOutputStreamIndex,pdwRequestedCapabilities) - -#define IDMOVideoOutputOptimizations_SetOperationMode(This,ulOutputStreamIndex,dwEnabledFeatures) \ - (This)->lpVtbl -> SetOperationMode(This,ulOutputStreamIndex,dwEnabledFeatures) - -#define IDMOVideoOutputOptimizations_GetCurrentOperationMode(This,ulOutputStreamIndex,pdwEnabledFeatures) \ - (This)->lpVtbl -> GetCurrentOperationMode(This,ulOutputStreamIndex,pdwEnabledFeatures) - -#define IDMOVideoOutputOptimizations_GetCurrentSampleRequirements(This,ulOutputStreamIndex,pdwRequestedFeatures) \ - (This)->lpVtbl -> GetCurrentSampleRequirements(This,ulOutputStreamIndex,pdwRequestedFeatures) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDMOVideoOutputOptimizations_QueryOperationModePreferences_Proxy( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedCapabilities); - - -void __RPC_STUB IDMOVideoOutputOptimizations_QueryOperationModePreferences_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDMOVideoOutputOptimizations_SetOperationMode_Proxy( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD dwEnabledFeatures); - - -void __RPC_STUB IDMOVideoOutputOptimizations_SetOperationMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDMOVideoOutputOptimizations_GetCurrentOperationMode_Proxy( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwEnabledFeatures); - - -void __RPC_STUB IDMOVideoOutputOptimizations_GetCurrentOperationMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDMOVideoOutputOptimizations_GetCurrentSampleRequirements_Proxy( - IDMOVideoOutputOptimizations * This, - ULONG ulOutputStreamIndex, - DWORD *pdwRequestedFeatures); - - -void __RPC_STUB IDMOVideoOutputOptimizations_GetCurrentSampleRequirements_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDMOVideoOutputOptimizations_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/medparam.h b/import/DirectX8/include/medparam.h deleted file mode 100644 index ba4200d5c..000000000 --- a/import/DirectX8/include/medparam.h +++ /dev/null @@ -1,581 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for medparam.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __medparam_h__ -#define __medparam_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IMediaParamInfo_FWD_DEFINED__ -#define __IMediaParamInfo_FWD_DEFINED__ -typedef interface IMediaParamInfo IMediaParamInfo; -#endif /* __IMediaParamInfo_FWD_DEFINED__ */ - - -#ifndef __IMediaParams_FWD_DEFINED__ -#define __IMediaParams_FWD_DEFINED__ -typedef interface IMediaParams IMediaParams; -#endif /* __IMediaParams_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "strmif.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_medparam_0000 */ -/* [local] */ - -typedef float MP_DATA; - -typedef -enum _MP_Type - { MPT_INT = 0, - MPT_FLOAT = MPT_INT + 1, - MPT_BOOL = MPT_FLOAT + 1, - MPT_ENUM = MPT_BOOL + 1, - MPT_MAX = MPT_ENUM + 1 - } MP_TYPE; - -#define MPBOOL_TRUE ( 1 ) - -#define MPBOOL_FALSE ( 0 ) - -typedef -enum _MP_CURVE_TYPE - { MP_CURVE_JUMP = 0x1, - MP_CURVE_LINEAR = 0x2, - MP_CURVE_SQUARE = 0x4, - MP_CURVE_INVSQUARE = 0x8, - MP_CURVE_SINE = 0x10 - } MP_CURVE_TYPE; - -typedef DWORD MP_CAPS; - -#define MP_CAPS_CURVE_JUMP ( MP_CURVE_JUMP ) - -#define MP_CAPS_CURVE_LINEAR ( MP_CURVE_LINEAR ) - -#define MP_CAPS_CURVE_SQUARE ( MP_CURVE_SQUARE ) - -#define MP_CAPS_CURVE_INVSQUARE ( MP_CURVE_INVSQUARE ) - -#define MP_CAPS_CURVE_SINE ( MP_CURVE_SINE ) - -typedef struct _MP_PARAMINFO - { - MP_TYPE mpType; - MP_CAPS mopCaps; - MP_DATA mpdMinValue; - MP_DATA mpdMaxValue; - MP_DATA mpdNeutralValue; - WCHAR szUnitText[ 32 ]; - WCHAR szLabel[ 32 ]; - } MP_PARAMINFO; - -typedef DWORD DWORD; - -#define DWORD_ALLPARAMS ( -1 ) - -typedef DWORD MP_TIMEDATA; - -DEFINE_GUID(GUID_TIME_REFERENCE, -0x93ad712b, 0xdaa0, 0x4ffe, 0xbc, 0x81, 0xb0, 0xce, 0x50, 0xf, 0xcd, 0xd9); -DEFINE_GUID(GUID_TIME_MUSIC, -0x574c49d, 0x5b04, 0x4b15, 0xa5, 0x42, 0xae, 0x28, 0x20, 0x30, 0x11, 0x7b); -DEFINE_GUID(GUID_TIME_SAMPLES, -0xa8593d05, 0xc43, 0x4984, 0x9a, 0x63, 0x97, 0xaf, 0x9e, 0x2, 0xc4, 0xc0); -typedef DWORD MP_FLAGS; - -#define MPF_ENVLP_STANDARD ( 0 ) - -#define MPF_ENVLP_BEGIN_CURRENTVAL ( 0x1 ) - -#define MPF_ENVLP_BEGIN_NEUTRALVAL ( 0x2 ) - -typedef struct _MP_ENVELOPE_SEGMENT - { - REFERENCE_TIME rtStart; - REFERENCE_TIME rtEnd; - MP_DATA valStart; - MP_DATA valEnd; - MP_CURVE_TYPE iCurve; - MP_FLAGS flags; - } MP_ENVELOPE_SEGMENT; - -#define MPF_PUNCHIN_REFTIME ( 0 ) - -#define MPF_PUNCHIN_NOW ( 0x1 ) - -#define MPF_PUNCHIN_STOPPED ( 0x2 ) - - - -extern RPC_IF_HANDLE __MIDL_itf_medparam_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_medparam_0000_v0_0_s_ifspec; - -#ifndef __IMediaParamInfo_INTERFACE_DEFINED__ -#define __IMediaParamInfo_INTERFACE_DEFINED__ - -/* interface IMediaParamInfo */ -/* [version][uuid][object] */ - - -EXTERN_C const IID IID_IMediaParamInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6d6cbb60-a223-44aa-842f-a2f06750be6d") - IMediaParamInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetParamCount( - /* [out] */ DWORD *pdwParams) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParamInfo( - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_PARAMINFO *pInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParamText( - /* [in] */ DWORD dwParamIndex, - /* [out] */ WCHAR **ppwchText) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumTimeFormats( - /* [out] */ DWORD *pdwNumTimeFormats) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSupportedTimeFormat( - /* [in] */ DWORD dwFormatIndex, - /* [out] */ GUID *pguidTimeFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentTimeFormat( - /* [out] */ GUID *pguidTimeFormat, - /* [out] */ MP_TIMEDATA *pTimeData) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaParamInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaParamInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaParamInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaParamInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetParamCount )( - IMediaParamInfo * This, - /* [out] */ DWORD *pdwParams); - - HRESULT ( STDMETHODCALLTYPE *GetParamInfo )( - IMediaParamInfo * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_PARAMINFO *pInfo); - - HRESULT ( STDMETHODCALLTYPE *GetParamText )( - IMediaParamInfo * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ WCHAR **ppwchText); - - HRESULT ( STDMETHODCALLTYPE *GetNumTimeFormats )( - IMediaParamInfo * This, - /* [out] */ DWORD *pdwNumTimeFormats); - - HRESULT ( STDMETHODCALLTYPE *GetSupportedTimeFormat )( - IMediaParamInfo * This, - /* [in] */ DWORD dwFormatIndex, - /* [out] */ GUID *pguidTimeFormat); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentTimeFormat )( - IMediaParamInfo * This, - /* [out] */ GUID *pguidTimeFormat, - /* [out] */ MP_TIMEDATA *pTimeData); - - END_INTERFACE - } IMediaParamInfoVtbl; - - interface IMediaParamInfo - { - CONST_VTBL struct IMediaParamInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaParamInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaParamInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaParamInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaParamInfo_GetParamCount(This,pdwParams) \ - (This)->lpVtbl -> GetParamCount(This,pdwParams) - -#define IMediaParamInfo_GetParamInfo(This,dwParamIndex,pInfo) \ - (This)->lpVtbl -> GetParamInfo(This,dwParamIndex,pInfo) - -#define IMediaParamInfo_GetParamText(This,dwParamIndex,ppwchText) \ - (This)->lpVtbl -> GetParamText(This,dwParamIndex,ppwchText) - -#define IMediaParamInfo_GetNumTimeFormats(This,pdwNumTimeFormats) \ - (This)->lpVtbl -> GetNumTimeFormats(This,pdwNumTimeFormats) - -#define IMediaParamInfo_GetSupportedTimeFormat(This,dwFormatIndex,pguidTimeFormat) \ - (This)->lpVtbl -> GetSupportedTimeFormat(This,dwFormatIndex,pguidTimeFormat) - -#define IMediaParamInfo_GetCurrentTimeFormat(This,pguidTimeFormat,pTimeData) \ - (This)->lpVtbl -> GetCurrentTimeFormat(This,pguidTimeFormat,pTimeData) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetParamCount_Proxy( - IMediaParamInfo * This, - /* [out] */ DWORD *pdwParams); - - -void __RPC_STUB IMediaParamInfo_GetParamCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetParamInfo_Proxy( - IMediaParamInfo * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_PARAMINFO *pInfo); - - -void __RPC_STUB IMediaParamInfo_GetParamInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetParamText_Proxy( - IMediaParamInfo * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ WCHAR **ppwchText); - - -void __RPC_STUB IMediaParamInfo_GetParamText_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetNumTimeFormats_Proxy( - IMediaParamInfo * This, - /* [out] */ DWORD *pdwNumTimeFormats); - - -void __RPC_STUB IMediaParamInfo_GetNumTimeFormats_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetSupportedTimeFormat_Proxy( - IMediaParamInfo * This, - /* [in] */ DWORD dwFormatIndex, - /* [out] */ GUID *pguidTimeFormat); - - -void __RPC_STUB IMediaParamInfo_GetSupportedTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParamInfo_GetCurrentTimeFormat_Proxy( - IMediaParamInfo * This, - /* [out] */ GUID *pguidTimeFormat, - /* [out] */ MP_TIMEDATA *pTimeData); - - -void __RPC_STUB IMediaParamInfo_GetCurrentTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaParamInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaParams_INTERFACE_DEFINED__ -#define __IMediaParams_INTERFACE_DEFINED__ - -/* interface IMediaParams */ -/* [version][uuid][object] */ - - -EXTERN_C const IID IID_IMediaParams; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6d6cbb61-a223-44aa-842f-a2f06750be6e") - IMediaParams : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetParam( - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_DATA *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetParam( - /* [in] */ DWORD dwParamIndex, - /* [in] */ MP_DATA value) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddEnvelope( - /* [in] */ DWORD dwParamIndex, - /* [in] */ DWORD cSegments, - /* [in] */ MP_ENVELOPE_SEGMENT *pEnvelopeSegments) = 0; - - virtual HRESULT STDMETHODCALLTYPE FlushEnvelope( - /* [in] */ DWORD dwParamIndex, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ REFERENCE_TIME refTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTimeFormat( - /* [in] */ GUID guidTimeFormat, - /* [in] */ MP_TIMEDATA mpTimeData) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaParamsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaParams * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaParams * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaParams * This); - - HRESULT ( STDMETHODCALLTYPE *GetParam )( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_DATA *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetParam )( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ MP_DATA value); - - HRESULT ( STDMETHODCALLTYPE *AddEnvelope )( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ DWORD cSegments, - /* [in] */ MP_ENVELOPE_SEGMENT *pEnvelopeSegments); - - HRESULT ( STDMETHODCALLTYPE *FlushEnvelope )( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ REFERENCE_TIME refTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetTimeFormat )( - IMediaParams * This, - /* [in] */ GUID guidTimeFormat, - /* [in] */ MP_TIMEDATA mpTimeData); - - END_INTERFACE - } IMediaParamsVtbl; - - interface IMediaParams - { - CONST_VTBL struct IMediaParamsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaParams_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaParams_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaParams_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaParams_GetParam(This,dwParamIndex,pValue) \ - (This)->lpVtbl -> GetParam(This,dwParamIndex,pValue) - -#define IMediaParams_SetParam(This,dwParamIndex,value) \ - (This)->lpVtbl -> SetParam(This,dwParamIndex,value) - -#define IMediaParams_AddEnvelope(This,dwParamIndex,cSegments,pEnvelopeSegments) \ - (This)->lpVtbl -> AddEnvelope(This,dwParamIndex,cSegments,pEnvelopeSegments) - -#define IMediaParams_FlushEnvelope(This,dwParamIndex,refTimeStart,refTimeEnd) \ - (This)->lpVtbl -> FlushEnvelope(This,dwParamIndex,refTimeStart,refTimeEnd) - -#define IMediaParams_SetTimeFormat(This,guidTimeFormat,mpTimeData) \ - (This)->lpVtbl -> SetTimeFormat(This,guidTimeFormat,mpTimeData) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaParams_GetParam_Proxy( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [out] */ MP_DATA *pValue); - - -void __RPC_STUB IMediaParams_GetParam_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParams_SetParam_Proxy( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ MP_DATA value); - - -void __RPC_STUB IMediaParams_SetParam_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParams_AddEnvelope_Proxy( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ DWORD cSegments, - /* [in] */ MP_ENVELOPE_SEGMENT *pEnvelopeSegments); - - -void __RPC_STUB IMediaParams_AddEnvelope_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParams_FlushEnvelope_Proxy( - IMediaParams * This, - /* [in] */ DWORD dwParamIndex, - /* [in] */ REFERENCE_TIME refTimeStart, - /* [in] */ REFERENCE_TIME refTimeEnd); - - -void __RPC_STUB IMediaParams_FlushEnvelope_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaParams_SetTimeFormat_Proxy( - IMediaParams * This, - /* [in] */ GUID guidTimeFormat, - /* [in] */ MP_TIMEDATA mpTimeData); - - -void __RPC_STUB IMediaParams_SetTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaParams_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/mmstream.h b/import/DirectX8/include/mmstream.h deleted file mode 100644 index fd76073cd..000000000 --- a/import/DirectX8/include/mmstream.h +++ /dev/null @@ -1,846 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for mmstream.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __mmstream_h__ -#define __mmstream_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IMultiMediaStream_FWD_DEFINED__ -#define __IMultiMediaStream_FWD_DEFINED__ -typedef interface IMultiMediaStream IMultiMediaStream; -#endif /* __IMultiMediaStream_FWD_DEFINED__ */ - - -#ifndef __IMediaStream_FWD_DEFINED__ -#define __IMediaStream_FWD_DEFINED__ -typedef interface IMediaStream IMediaStream; -#endif /* __IMediaStream_FWD_DEFINED__ */ - - -#ifndef __IStreamSample_FWD_DEFINED__ -#define __IStreamSample_FWD_DEFINED__ -typedef interface IStreamSample IStreamSample; -#endif /* __IStreamSample_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_mmstream_0000 */ -/* [local] */ - -#define MS_ERROR_CODE(x) MAKE_HRESULT(1, FACILITY_ITF, (x) + 0x400) -#define MS_SUCCESS_CODE(x) MAKE_HRESULT(0, FACILITY_ITF, x) -#define MS_S_PENDING MS_SUCCESS_CODE(1) -#define MS_S_NOUPDATE MS_SUCCESS_CODE(2) -#define MS_S_ENDOFSTREAM MS_SUCCESS_CODE(3) -#define MS_E_SAMPLEALLOC MS_ERROR_CODE(1) -#define MS_E_PURPOSEID MS_ERROR_CODE(2) -#define MS_E_NOSTREAM MS_ERROR_CODE(3) -#define MS_E_NOSEEKING MS_ERROR_CODE(4) -#define MS_E_INCOMPATIBLE MS_ERROR_CODE(5) -#define MS_E_BUSY MS_ERROR_CODE(6) -#define MS_E_NOTINIT MS_ERROR_CODE(7) -#define MS_E_SOURCEALREADYDEFINED MS_ERROR_CODE(8) -#define MS_E_INVALIDSTREAMTYPE MS_ERROR_CODE(9) -#define MS_E_NOTRUNNING MS_ERROR_CODE(10) -// {A35FF56A-9FDA-11d0-8FDF-00C04FD9189D} -DEFINE_GUID(MSPID_PrimaryVideo, -0xa35ff56a, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); -// {A35FF56B-9FDA-11d0-8FDF-00C04FD9189D} -DEFINE_GUID(MSPID_PrimaryAudio, -0xa35ff56b, 0x9fda, 0x11d0, 0x8f, 0xdf, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); -#if(_WIN32_WINNT < 0x0400) -typedef void ( __stdcall *PAPCFUNC )( - DWORD_PTR dwParam); - -#endif -typedef LONGLONG STREAM_TIME; - -typedef GUID MSPID; - -typedef REFGUID REFMSPID; - -typedef /* [public][public][public] */ -enum __MIDL___MIDL_itf_mmstream_0000_0001 - { STREAMTYPE_READ = 0, - STREAMTYPE_WRITE = 1, - STREAMTYPE_TRANSFORM = 2 - } STREAM_TYPE; - -typedef /* [public][public][public] */ -enum __MIDL___MIDL_itf_mmstream_0000_0002 - { STREAMSTATE_STOP = 0, - STREAMSTATE_RUN = 1 - } STREAM_STATE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_mmstream_0000_0003 - { COMPSTAT_NOUPDATEOK = 0x1, - COMPSTAT_WAIT = 0x2, - COMPSTAT_ABORT = 0x4 - } COMPLETION_STATUS_FLAGS; - - -enum __MIDL___MIDL_itf_mmstream_0000_0004 - { MMSSF_HASCLOCK = 0x1, - MMSSF_SUPPORTSEEK = 0x2, - MMSSF_ASYNCHRONOUS = 0x4 - } ; - -enum __MIDL___MIDL_itf_mmstream_0000_0005 - { SSUPDATE_ASYNC = 0x1, - SSUPDATE_CONTINUOUS = 0x2 - } ; - - - - - -extern RPC_IF_HANDLE __MIDL_itf_mmstream_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_mmstream_0000_v0_0_s_ifspec; - -#ifndef __IMultiMediaStream_INTERFACE_DEFINED__ -#define __IMultiMediaStream_INTERFACE_DEFINED__ - -/* interface IMultiMediaStream */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IMultiMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B502D1BC-9A57-11d0-8FDE-00C04FD9189D") - IMultiMediaStream : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetInformation( - /* [out] */ DWORD *pdwFlags, - /* [out] */ STREAM_TYPE *pStreamType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaStream( - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumMediaStreams( - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetState( - /* [out] */ STREAM_STATE *pCurrentState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetState( - /* [in] */ STREAM_STATE NewState) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTime( - /* [out] */ STREAM_TIME *pCurrentTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDuration( - /* [out] */ STREAM_TIME *pDuration) = 0; - - virtual HRESULT STDMETHODCALLTYPE Seek( - /* [in] */ STREAM_TIME SeekTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEndOfStreamEventHandle( - /* [out] */ HANDLE *phEOS) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMultiMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMultiMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMultiMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMultiMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IMultiMediaStream * This, - /* [out] */ DWORD *pdwFlags, - /* [out] */ STREAM_TYPE *pStreamType); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IMultiMediaStream * This, - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *EnumMediaStreams )( - IMultiMediaStream * This, - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IMultiMediaStream * This, - /* [out] */ STREAM_STATE *pCurrentState); - - HRESULT ( STDMETHODCALLTYPE *SetState )( - IMultiMediaStream * This, - /* [in] */ STREAM_STATE NewState); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IMultiMediaStream * This, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IMultiMediaStream * This, - /* [out] */ STREAM_TIME *pDuration); - - HRESULT ( STDMETHODCALLTYPE *Seek )( - IMultiMediaStream * This, - /* [in] */ STREAM_TIME SeekTime); - - HRESULT ( STDMETHODCALLTYPE *GetEndOfStreamEventHandle )( - IMultiMediaStream * This, - /* [out] */ HANDLE *phEOS); - - END_INTERFACE - } IMultiMediaStreamVtbl; - - interface IMultiMediaStream - { - CONST_VTBL struct IMultiMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMultiMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMultiMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMultiMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMultiMediaStream_GetInformation(This,pdwFlags,pStreamType) \ - (This)->lpVtbl -> GetInformation(This,pdwFlags,pStreamType) - -#define IMultiMediaStream_GetMediaStream(This,idPurpose,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,idPurpose,ppMediaStream) - -#define IMultiMediaStream_EnumMediaStreams(This,Index,ppMediaStream) \ - (This)->lpVtbl -> EnumMediaStreams(This,Index,ppMediaStream) - -#define IMultiMediaStream_GetState(This,pCurrentState) \ - (This)->lpVtbl -> GetState(This,pCurrentState) - -#define IMultiMediaStream_SetState(This,NewState) \ - (This)->lpVtbl -> SetState(This,NewState) - -#define IMultiMediaStream_GetTime(This,pCurrentTime) \ - (This)->lpVtbl -> GetTime(This,pCurrentTime) - -#define IMultiMediaStream_GetDuration(This,pDuration) \ - (This)->lpVtbl -> GetDuration(This,pDuration) - -#define IMultiMediaStream_Seek(This,SeekTime) \ - (This)->lpVtbl -> Seek(This,SeekTime) - -#define IMultiMediaStream_GetEndOfStreamEventHandle(This,phEOS) \ - (This)->lpVtbl -> GetEndOfStreamEventHandle(This,phEOS) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetInformation_Proxy( - IMultiMediaStream * This, - /* [out] */ DWORD *pdwFlags, - /* [out] */ STREAM_TYPE *pStreamType); - - -void __RPC_STUB IMultiMediaStream_GetInformation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetMediaStream_Proxy( - IMultiMediaStream * This, - /* [in] */ REFMSPID idPurpose, - /* [out] */ IMediaStream **ppMediaStream); - - -void __RPC_STUB IMultiMediaStream_GetMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_EnumMediaStreams_Proxy( - IMultiMediaStream * This, - /* [in] */ long Index, - /* [out] */ IMediaStream **ppMediaStream); - - -void __RPC_STUB IMultiMediaStream_EnumMediaStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetState_Proxy( - IMultiMediaStream * This, - /* [out] */ STREAM_STATE *pCurrentState); - - -void __RPC_STUB IMultiMediaStream_GetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_SetState_Proxy( - IMultiMediaStream * This, - /* [in] */ STREAM_STATE NewState); - - -void __RPC_STUB IMultiMediaStream_SetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetTime_Proxy( - IMultiMediaStream * This, - /* [out] */ STREAM_TIME *pCurrentTime); - - -void __RPC_STUB IMultiMediaStream_GetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetDuration_Proxy( - IMultiMediaStream * This, - /* [out] */ STREAM_TIME *pDuration); - - -void __RPC_STUB IMultiMediaStream_GetDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_Seek_Proxy( - IMultiMediaStream * This, - /* [in] */ STREAM_TIME SeekTime); - - -void __RPC_STUB IMultiMediaStream_Seek_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMultiMediaStream_GetEndOfStreamEventHandle_Proxy( - IMultiMediaStream * This, - /* [out] */ HANDLE *phEOS); - - -void __RPC_STUB IMultiMediaStream_GetEndOfStreamEventHandle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMultiMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaStream_INTERFACE_DEFINED__ -#define __IMediaStream_INTERFACE_DEFINED__ - -/* interface IMediaStream */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMediaStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B502D1BD-9A57-11d0-8FDE-00C04FD9189D") - IMediaStream : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMultiMediaStream( - /* [out] */ IMultiMediaStream **ppMultiMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInformation( - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSameFormat( - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE AllocateSample( - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateSharedSample( - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendEndOfStream( - DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaStream * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaStream * This); - - HRESULT ( STDMETHODCALLTYPE *GetMultiMediaStream )( - IMediaStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetInformation )( - IMediaStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetSameFormat )( - IMediaStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *AllocateSample )( - IMediaStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *CreateSharedSample )( - IMediaStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - HRESULT ( STDMETHODCALLTYPE *SendEndOfStream )( - IMediaStream * This, - DWORD dwFlags); - - END_INTERFACE - } IMediaStreamVtbl; - - interface IMediaStream - { - CONST_VTBL struct IMediaStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaStream_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaStream_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaStream_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaStream_GetMultiMediaStream(This,ppMultiMediaStream) \ - (This)->lpVtbl -> GetMultiMediaStream(This,ppMultiMediaStream) - -#define IMediaStream_GetInformation(This,pPurposeId,pType) \ - (This)->lpVtbl -> GetInformation(This,pPurposeId,pType) - -#define IMediaStream_SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) \ - (This)->lpVtbl -> SetSameFormat(This,pStreamThatHasDesiredFormat,dwFlags) - -#define IMediaStream_AllocateSample(This,dwFlags,ppSample) \ - (This)->lpVtbl -> AllocateSample(This,dwFlags,ppSample) - -#define IMediaStream_CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) \ - (This)->lpVtbl -> CreateSharedSample(This,pExistingSample,dwFlags,ppNewSample) - -#define IMediaStream_SendEndOfStream(This,dwFlags) \ - (This)->lpVtbl -> SendEndOfStream(This,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaStream_GetMultiMediaStream_Proxy( - IMediaStream * This, - /* [out] */ IMultiMediaStream **ppMultiMediaStream); - - -void __RPC_STUB IMediaStream_GetMultiMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStream_GetInformation_Proxy( - IMediaStream * This, - /* [out] */ MSPID *pPurposeId, - /* [out] */ STREAM_TYPE *pType); - - -void __RPC_STUB IMediaStream_GetInformation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStream_SetSameFormat_Proxy( - IMediaStream * This, - /* [in] */ IMediaStream *pStreamThatHasDesiredFormat, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IMediaStream_SetSameFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStream_AllocateSample_Proxy( - IMediaStream * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppSample); - - -void __RPC_STUB IMediaStream_AllocateSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStream_CreateSharedSample_Proxy( - IMediaStream * This, - /* [in] */ IStreamSample *pExistingSample, - /* [in] */ DWORD dwFlags, - /* [out] */ IStreamSample **ppNewSample); - - -void __RPC_STUB IMediaStream_CreateSharedSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaStream_SendEndOfStream_Proxy( - IMediaStream * This, - DWORD dwFlags); - - -void __RPC_STUB IMediaStream_SendEndOfStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaStream_INTERFACE_DEFINED__ */ - - -#ifndef __IStreamSample_INTERFACE_DEFINED__ -#define __IStreamSample_INTERFACE_DEFINED__ - -/* interface IStreamSample */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IStreamSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B502D1BE-9A57-11d0-8FDE-00C04FD9189D") - IStreamSample : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetMediaStream( - /* [in] */ IMediaStream **ppMediaStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSampleTimes( - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSampleTimes( - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE Update( - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData) = 0; - - virtual HRESULT STDMETHODCALLTYPE CompletionStatus( - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds) = 0; - - }; - -#else /* C style interface */ - - typedef struct IStreamSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IStreamSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IStreamSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IStreamSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetMediaStream )( - IStreamSample * This, - /* [in] */ IMediaStream **ppMediaStream); - - HRESULT ( STDMETHODCALLTYPE *GetSampleTimes )( - IStreamSample * This, - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime); - - HRESULT ( STDMETHODCALLTYPE *SetSampleTimes )( - IStreamSample * This, - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime); - - HRESULT ( STDMETHODCALLTYPE *Update )( - IStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData); - - HRESULT ( STDMETHODCALLTYPE *CompletionStatus )( - IStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds); - - END_INTERFACE - } IStreamSampleVtbl; - - interface IStreamSample - { - CONST_VTBL struct IStreamSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IStreamSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IStreamSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IStreamSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IStreamSample_GetMediaStream(This,ppMediaStream) \ - (This)->lpVtbl -> GetMediaStream(This,ppMediaStream) - -#define IStreamSample_GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) \ - (This)->lpVtbl -> GetSampleTimes(This,pStartTime,pEndTime,pCurrentTime) - -#define IStreamSample_SetSampleTimes(This,pStartTime,pEndTime) \ - (This)->lpVtbl -> SetSampleTimes(This,pStartTime,pEndTime) - -#define IStreamSample_Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) \ - (This)->lpVtbl -> Update(This,dwFlags,hEvent,pfnAPC,dwAPCData) - -#define IStreamSample_CompletionStatus(This,dwFlags,dwMilliseconds) \ - (This)->lpVtbl -> CompletionStatus(This,dwFlags,dwMilliseconds) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IStreamSample_GetMediaStream_Proxy( - IStreamSample * This, - /* [in] */ IMediaStream **ppMediaStream); - - -void __RPC_STUB IStreamSample_GetMediaStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IStreamSample_GetSampleTimes_Proxy( - IStreamSample * This, - /* [out] */ STREAM_TIME *pStartTime, - /* [out] */ STREAM_TIME *pEndTime, - /* [out] */ STREAM_TIME *pCurrentTime); - - -void __RPC_STUB IStreamSample_GetSampleTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IStreamSample_SetSampleTimes_Proxy( - IStreamSample * This, - /* [in] */ const STREAM_TIME *pStartTime, - /* [in] */ const STREAM_TIME *pEndTime); - - -void __RPC_STUB IStreamSample_SetSampleTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IStreamSample_Update_Proxy( - IStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hEvent, - /* [in] */ PAPCFUNC pfnAPC, - /* [in] */ DWORD_PTR dwAPCData); - - -void __RPC_STUB IStreamSample_Update_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IStreamSample_CompletionStatus_Proxy( - IStreamSample * This, - /* [in] */ DWORD dwFlags, - /* [in] */ DWORD dwMilliseconds); - - -void __RPC_STUB IStreamSample_CompletionStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IStreamSample_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/mpconfig.h b/import/DirectX8/include/mpconfig.h deleted file mode 100644 index 49f8cf107..000000000 --- a/import/DirectX8/include/mpconfig.h +++ /dev/null @@ -1,144 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MPConfig.h -// -// Desc: -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __IMPConfig__ -#define __IMPConfig__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum _AM_ASPECT_RATIO_MODE -{ - AM_ARMODE_STRETCHED, // don't do any aspect ratio correction - AM_ARMODE_LETTER_BOX, // letter box the video, paint background color in the excess region - AM_ARMODE_CROP, // crop the video to the right aspect ratio - AM_ARMODE_STRETCHED_AS_PRIMARY // follow whatever the primary stream does (in terms of the mode as well as pict-aspect-ratio values) -} AM_ASPECT_RATIO_MODE; - - -DECLARE_INTERFACE_(IMixerPinConfig, IUnknown) -{ - // this function sets the position of the stream in the display window, assuming - // that the window coordinates are {0, 0, 10000, 10000}. Thus giving arguments - // (0, 0, 5000, 5000) will put the stream in the top-left quarter. Any value greater - // than 10000 is invalid. - STDMETHOD (SetRelativePosition)(THIS_ - IN DWORD dwLeft, - IN DWORD dwTop, - IN DWORD dwRight, - IN DWORD dwBottom - ) PURE; - - // this function gets the position of the stream in the display window, assuming - // that the window coordinates are {0, 0, 10000, 10000}. Thus if the values returned - // are (0, 0, 5000, 5000), then it means that the stream is in the top-left quarter. - STDMETHOD (GetRelativePosition)(THIS_ - OUT DWORD *pdwLeft, - OUT DWORD *pdwTop, - OUT DWORD *pdwRight, - OUT DWORD *pdwBottom - ) PURE; - - // this function sets the ZOrder of the stream. The ZOrder of 0 is the closest - // to the eyes of the user, and increasing values imply greater distance. - STDMETHOD (SetZOrder)(THIS_ - IN DWORD dwZOrder - ) PURE; - - - // this function gets the ZOrder of the stream. The ZOrder of 0 is the closest - // to the eyes of the user, and increasing values imply greater distance. - STDMETHOD (GetZOrder)(THIS_ - OUT DWORD *pdwZOrder - ) PURE; - - // this function sets the colorkey being used by the stream. Setting this value on the - // primary stream sets the destination colorkey being used by the overlay surface. Setting - // this value on the secondary pin makes sense only if the stream is transparent. By default - // the destination colorkey is used as the colorkey for all transparent (secondary) streams. - STDMETHOD (SetColorKey)(THIS_ - IN COLORKEY *pColorKey - ) PURE; - - // this function gets the colorkey being used by the stream. Getting this value on the - // primary stream gets the destination colorkey being used by the overlay surface. Getting - // this value on the secondary pin returns the colorkey being used by that particular stream. - // When using this method, you are allowed to pass NULL for either pColorKey or pColor but - // not both. - STDMETHOD (GetColorKey)(THIS_ - OUT COLORKEY *pColorKey, - OUT DWORD *pColor - ) PURE; - - // this function sets the blending parameter which in turn defines, how the secondary stream - // is going to be blended with the primary stream. A value of 0 makes the secondary stream - // invisible, a value of 255 makes the primary stream invisible (in that region only ofcourse), - // and any value inbetween, say x, blends the secondary and primary streams in the ratio x : (255-x). - // If no value is set, the default is 255. - // Any value less than 0 or greater than 255 is invalid. Calling this function on the primary - // stream would result in a return value of E_UNEXPECTED. - STDMETHOD (SetBlendingParameter)(THIS_ - IN DWORD dwBlendingParameter - ) PURE; - - // this function gets the blending parameter which in turn defines, how the secondary stream - // is currently being blended with the primary stream. - STDMETHOD (GetBlendingParameter)(THIS_ - OUT DWORD *pdwBlendingParameter - ) PURE; - - - // this function is used to set the Aspect Ratio Correction mode on the pin. - // If the mode is set to letter box, black color is painted on the excess region - STDMETHOD (SetAspectRatioMode)(THIS_ - IN AM_ASPECT_RATIO_MODE amAspectRatioMode - ) PURE; - - // this function is used to get the Aspect Ratio Correction mode on the pin. - STDMETHOD (GetAspectRatioMode)(THIS_ - OUT AM_ASPECT_RATIO_MODE* pamAspectRatioMode - ) PURE; - - // this function sets the stream to be transparent. That means that the stream is not going - // to occupy the whole of the rectangle (specified by SetRelativePosition), some of the region - // is going to be transparent i.e. the stream underneath, is going to see through. - // Calling this function on the primary stream would result in a return value of E_UNEXPECTED. - STDMETHOD (SetStreamTransparent)(THIS_ - IN BOOL bStreamTransparent - ) PURE; - - // this function is used to tell whether the stream is transparent or not. - STDMETHOD (GetStreamTransparent)(THIS_ - OUT BOOL *pbStreamTransparent - ) PURE; -}; - - -DECLARE_INTERFACE_(IMixerPinConfig2, IMixerPinConfig) -{ - // this functions sets the color-controls, if the vga chip supports it. - STDMETHOD (SetOverlaySurfaceColorControls)(THIS_ - IN LPDDCOLORCONTROL pColorControl - ) PURE; - - // this functions gets the color-controls. It also returns the capability of the vga hardware - // in the dwFlags value of the struct. - STDMETHOD (GetOverlaySurfaceColorControls)(THIS_ - OUT LPDDCOLORCONTROL pColorControl - ) PURE; -}; - -#ifdef __cplusplus -} -#endif - - -#endif // #define __IMPConfig__ - diff --git a/import/DirectX8/include/mpegtype.h b/import/DirectX8/include/mpegtype.h deleted file mode 100644 index 4e79fcb00..000000000 --- a/import/DirectX8/include/mpegtype.h +++ /dev/null @@ -1,119 +0,0 @@ -//------------------------------------------------------------------------------ -// File: MPEGType.h -// -// Desc: MPEG system stream compound type definition -// -// Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __MPEGTYPE__ -#define __MPEGTYPE__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// -// AM_MPEGSYSTEMTYPE defines the format block contents for -// data of type MEDIATYPE_MPEG1System when the format -// block GUID is FORMAT_MPEG1System -// -// The format block consists of elements of type -// AM_MPEGSYSTEMTYPE up to the length of the format block -// Each format block is 8-byte aligned from the start of -// the format block -// - -typedef struct tagAM_MPEGSTREAMTYPE -{ - DWORD dwStreamId; // Stream id of stream to process - DWORD dwReserved; // 8-byte alignment - AM_MEDIA_TYPE mt; // Type for substream - pbFormat is NULL - BYTE bFormat[1]; // Format data -} AM_MPEGSTREAMTYPE; - -typedef struct tagAM_MPEGSYSTEMTYPE -{ - DWORD dwBitRate; // Bits per second - DWORD cStreams; // Number of streams - AM_MPEGSTREAMTYPE Streams[1]; -} AM_MPEGSYSTEMTYPE; - -// -// Helper macros for AM_MPEGSTREAMTYPE -// -#define AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) \ - FIELD_OFFSET(AM_MPEGSTREAMTYPE, bFormat[(pStreamType)->mt.cbFormat]) -#define AM_MPEGSTREAMTYPE_NEXT(pStreamType) \ - ((AM_MPEGSTREAMTYPE *)((PBYTE)(pStreamType) + \ - ((AM_MPEGSTREAMTYPE_ELEMENTLENGTH(pStreamType) + 7) & ~7))) - -// -// IMpegAudioDecoder -// - -// Values for DualMode -#define AM_MPEG_AUDIO_DUAL_MERGE 0 -#define AM_MPEG_AUDIO_DUAL_LEFT 1 -#define AM_MPEG_AUDIO_DUAL_RIGHT 2 - -DECLARE_INTERFACE_(IMpegAudioDecoder, IUnknown) { - - STDMETHOD(get_FrequencyDivider) (THIS_ - unsigned long *pDivider /* [out] */ - ) PURE; - - STDMETHOD(put_FrequencyDivider) (THIS_ - unsigned long Divider /* [in] */ - ) PURE; - - STDMETHOD(get_DecoderAccuracy) (THIS_ - unsigned long *pAccuracy /* [out] */ - ) PURE; - - STDMETHOD(put_DecoderAccuracy) (THIS_ - unsigned long Accuracy /* [in] */ - ) PURE; - - STDMETHOD(get_Stereo) (THIS_ - unsigned long *pStereo /* [out] */ - ) PURE; - - STDMETHOD(put_Stereo) (THIS_ - unsigned long Stereo /* [in] */ - ) PURE; - - STDMETHOD(get_DecoderWordSize) (THIS_ - unsigned long *pWordSize /* [out] */ - ) PURE; - - STDMETHOD(put_DecoderWordSize) (THIS_ - unsigned long WordSize /* [in] */ - ) PURE; - - STDMETHOD(get_IntegerDecode) (THIS_ - unsigned long *pIntDecode /* [out] */ - ) PURE; - - STDMETHOD(put_IntegerDecode) (THIS_ - unsigned long IntDecode /* [in] */ - ) PURE; - - STDMETHOD(get_DualMode) (THIS_ - unsigned long *pIntDecode /* [out] */ - ) PURE; - - STDMETHOD(put_DualMode) (THIS_ - unsigned long IntDecode /* [in] */ - ) PURE; - - STDMETHOD(get_AudioFormat) (THIS_ - MPEG1WAVEFORMAT *lpFmt /* [out] */ - ) PURE; -}; - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // __MPEGTYPE__ diff --git a/import/DirectX8/include/multimon.h b/import/DirectX8/include/multimon.h deleted file mode 100644 index 88e2862a2..000000000 --- a/import/DirectX8/include/multimon.h +++ /dev/null @@ -1,484 +0,0 @@ -//============================================================================= -// -// multimon.h -- Stub module that fakes multiple monitor apis on Win32 OSes -// without them. -// -// By using this header your code will get back default values from -// GetSystemMetrics() for new metrics, and the new multimonitor APIs -// will act like only one display is present on a Win32 OS without -// multimonitor APIs. -// -// Exactly one source must include this with COMPILE_MULTIMON_STUBS defined. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//============================================================================= - -#ifdef __cplusplus -extern "C" { // Assume C declarations for C++ -#endif // __cplusplus - -// -// If we are building with Win95/NT4 headers, we need to declare -// the multimonitor-related metrics and APIs ourselves. -// -#ifndef SM_CMONITORS - -#define SM_XVIRTUALSCREEN 76 -#define SM_YVIRTUALSCREEN 77 -#define SM_CXVIRTUALSCREEN 78 -#define SM_CYVIRTUALSCREEN 79 -#define SM_CMONITORS 80 -#define SM_SAMEDISPLAYFORMAT 81 - -// HMONITOR is already declared if WINVER >= 0x0500 in windef.h -// This is for components built with an older version number. -// -#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif - -#define MONITOR_DEFAULTTONULL 0x00000000 -#define MONITOR_DEFAULTTOPRIMARY 0x00000001 -#define MONITOR_DEFAULTTONEAREST 0x00000002 - -#define MONITORINFOF_PRIMARY 0x00000001 - -typedef struct tagMONITORINFO -{ - DWORD cbSize; - RECT rcMonitor; - RECT rcWork; - DWORD dwFlags; -} MONITORINFO, *LPMONITORINFO; - -#ifndef CCHDEVICENAME -#define CCHDEVICENAME 32 -#endif - -#ifdef __cplusplus -typedef struct tagMONITORINFOEXA : public tagMONITORINFO -{ - CHAR szDevice[CCHDEVICENAME]; -} MONITORINFOEXA, *LPMONITORINFOEXA; -typedef struct tagMONITORINFOEXW : public tagMONITORINFO -{ - WCHAR szDevice[CCHDEVICENAME]; -} MONITORINFOEXW, *LPMONITORINFOEXW; -#ifdef UNICODE -typedef MONITORINFOEXW MONITORINFOEX; -typedef LPMONITORINFOEXW LPMONITORINFOEX; -#else -typedef MONITORINFOEXA MONITORINFOEX; -typedef LPMONITORINFOEXA LPMONITORINFOEX; -#endif // UNICODE -#else // ndef __cplusplus -typedef struct tagMONITORINFOEXA -{ - MONITORINFO; - CHAR szDevice[CCHDEVICENAME]; -} MONITORINFOEXA, *LPMONITORINFOEXA; -typedef struct tagMONITORINFOEXW -{ - MONITORINFO; - WCHAR szDevice[CCHDEVICENAME]; -} MONITORINFOEXW, *LPMONITORINFOEXW; -#ifdef UNICODE -typedef MONITORINFOEXW MONITORINFOEX; -typedef LPMONITORINFOEXW LPMONITORINFOEX; -#else -typedef MONITORINFOEXA MONITORINFOEX; -typedef LPMONITORINFOEXA LPMONITORINFOEX; -#endif // UNICODE -#endif - -typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); - -#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP -typedef struct _DISPLAY_DEVICEA { - DWORD cb; - CHAR DeviceName[32]; - CHAR DeviceString[128]; - DWORD StateFlags; - CHAR DeviceID[128]; - CHAR DeviceKey[128]; -} DISPLAY_DEVICEA, *PDISPLAY_DEVICEA, *LPDISPLAY_DEVICEA; -typedef struct _DISPLAY_DEVICEW { - DWORD cb; - WCHAR DeviceName[32]; - WCHAR DeviceString[128]; - DWORD StateFlags; - WCHAR DeviceID[128]; - WCHAR DeviceKey[128]; -} DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW; -#ifdef UNICODE -typedef DISPLAY_DEVICEW DISPLAY_DEVICE; -typedef PDISPLAY_DEVICEW PDISPLAY_DEVICE; -typedef LPDISPLAY_DEVICEW LPDISPLAY_DEVICE; -#else -typedef DISPLAY_DEVICEA DISPLAY_DEVICE; -typedef PDISPLAY_DEVICEA PDISPLAY_DEVICE; -typedef LPDISPLAY_DEVICEA LPDISPLAY_DEVICE; -#endif // UNICODE - -#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 -#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002 -#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 -#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 -#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010 -#endif - -#endif // SM_CMONITORS - -#undef GetMonitorInfo -#undef GetSystemMetrics -#undef MonitorFromWindow -#undef MonitorFromRect -#undef MonitorFromPoint -#undef EnumDisplayMonitors -#undef EnumDisplayDevices - -// -// Define COMPILE_MULTIMON_STUBS to compile the stubs; -// otherwise, you get the declarations. -// -#ifdef COMPILE_MULTIMON_STUBS - -//----------------------------------------------------------------------------- -// -// Implement the API stubs. -// -//----------------------------------------------------------------------------- - -#ifndef MULTIMON_FNS_DEFINED - -int (WINAPI* g_pfnGetSystemMetrics)(int) = NULL; -HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, DWORD) = NULL; -HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, DWORD) = NULL; -HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, DWORD) = NULL; -BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL; -BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM) = NULL; -BOOL (WINAPI* g_pfnEnumDisplayDevices)(PVOID, DWORD, PDISPLAY_DEVICE,DWORD) = NULL; -BOOL g_fMultiMonInitDone = FALSE; -BOOL g_fMultimonPlatformNT = FALSE; - -#endif - -BOOL IsPlatformNT() -{ - OSVERSIONINFOA osvi = {0}; - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionExA((OSVERSIONINFOA*)&osvi); - return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId); -} - -BOOL InitMultipleMonitorStubs(void) -{ - HMODULE hUser32; - if (g_fMultiMonInitDone) - { - return g_pfnGetMonitorInfo != NULL; - } - - g_fMultimonPlatformNT = IsPlatformNT(); - hUser32 = GetModuleHandle(TEXT("USER32")); - if (hUser32 && - (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) != NULL && - (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) != NULL && - (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) != NULL && - (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) != NULL && - (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) != NULL && -#ifdef UNICODE - (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) != NULL && - (*(FARPROC*)&g_pfnGetMonitorInfo = g_fMultimonPlatformNT ? GetProcAddress(hUser32,"GetMonitorInfoW") : - GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL -#else - (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL && - (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) != NULL -#endif - ) { - g_fMultiMonInitDone = TRUE; - return TRUE; - } - else - { - g_pfnGetSystemMetrics = NULL; - g_pfnMonitorFromWindow = NULL; - g_pfnMonitorFromRect = NULL; - g_pfnMonitorFromPoint = NULL; - g_pfnGetMonitorInfo = NULL; - g_pfnEnumDisplayMonitors = NULL; - g_pfnEnumDisplayDevices = NULL; - - g_fMultiMonInitDone = TRUE; - return FALSE; - } -} - -//----------------------------------------------------------------------------- -// -// fake implementations of Monitor APIs that work with the primary display -// no special parameter validation is made since these run in client code -// -//----------------------------------------------------------------------------- - -int WINAPI -xGetSystemMetrics(int nIndex) -{ - if (InitMultipleMonitorStubs()) - return g_pfnGetSystemMetrics(nIndex); - - switch (nIndex) - { - case SM_CMONITORS: - case SM_SAMEDISPLAYFORMAT: - return 1; - - case SM_XVIRTUALSCREEN: - case SM_YVIRTUALSCREEN: - return 0; - - case SM_CXVIRTUALSCREEN: - nIndex = SM_CXSCREEN; - break; - - case SM_CYVIRTUALSCREEN: - nIndex = SM_CYSCREEN; - break; - } - - return GetSystemMetrics(nIndex); -} - -#define xPRIMARY_MONITOR ((HMONITOR)0x12340042) - -HMONITOR WINAPI -xMonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags) -{ - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromPoint(ptScreenCoords, dwFlags); - - if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || - ((ptScreenCoords.x >= 0) && - (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) && - (ptScreenCoords.y >= 0) && - (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN)))) - { - return xPRIMARY_MONITOR; - } - - return NULL; -} - -HMONITOR WINAPI -xMonitorFromRect(LPCRECT lprcScreenCoords, DWORD dwFlags) -{ - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromRect(lprcScreenCoords, dwFlags); - - if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || - ((lprcScreenCoords->right > 0) && - (lprcScreenCoords->bottom > 0) && - (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) && - (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN)))) - { - return xPRIMARY_MONITOR; - } - - return NULL; -} - -HMONITOR WINAPI -xMonitorFromWindow(HWND hWnd, DWORD dwFlags) -{ - WINDOWPLACEMENT wp; - - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromWindow(hWnd, dwFlags); - - if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) - return xPRIMARY_MONITOR; - - if (IsIconic(hWnd) ? - GetWindowPlacement(hWnd, &wp) : - GetWindowRect(hWnd, &wp.rcNormalPosition)) { - - return xMonitorFromRect(&wp.rcNormalPosition, dwFlags); - } - - return NULL; -} - -BOOL WINAPI -xGetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo) -{ - RECT rcWork; - - if (InitMultipleMonitorStubs()) - { - BOOL f = g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo); -#ifdef UNICODE - if (f && !g_fMultimonPlatformNT && (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX))) - { - MultiByteToWideChar(CP_ACP, 0, - (LPSTR)((MONITORINFOEX*)lpMonitorInfo)->szDevice, -1, - ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR))); - } -#endif - return f; - } - - if ((hMonitor == xPRIMARY_MONITOR) && - lpMonitorInfo && - (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && - SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0)) - { - lpMonitorInfo->rcMonitor.left = 0; - lpMonitorInfo->rcMonitor.top = 0; - lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN); - lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN); - lpMonitorInfo->rcWork = rcWork; - lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; - - if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)) - { -#ifdef UNICODE - MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR))); -#else // UNICODE - lstrcpy(((MONITORINFOEX*)lpMonitorInfo)->szDevice, TEXT("DISPLAY")); -#endif // UNICODE - } - - return TRUE; - } - - return FALSE; -} - -BOOL WINAPI -xEnumDisplayMonitors( - HDC hdcOptionalForPainting, - LPCRECT lprcEnumMonitorsThatIntersect, - MONITORENUMPROC lpfnEnumProc, - LPARAM dwData) -{ - RECT rcLimit; - - if (InitMultipleMonitorStubs()) { - return g_pfnEnumDisplayMonitors( - hdcOptionalForPainting, - lprcEnumMonitorsThatIntersect, - lpfnEnumProc, - dwData); - } - - if (!lpfnEnumProc) - return FALSE; - - rcLimit.left = 0; - rcLimit.top = 0; - rcLimit.right = GetSystemMetrics(SM_CXSCREEN); - rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN); - - if (hdcOptionalForPainting) - { - RECT rcClip; - POINT ptOrg; - - switch (GetClipBox(hdcOptionalForPainting, &rcClip)) - { - default: - if (!GetDCOrgEx(hdcOptionalForPainting, &ptOrg)) - return FALSE; - - OffsetRect(&rcLimit, -ptOrg.x, -ptOrg.y); - if (IntersectRect(&rcLimit, &rcLimit, &rcClip) && - (!lprcEnumMonitorsThatIntersect || - IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect))) { - - break; - } - //fall thru - case NULLREGION: - return TRUE; - case ERROR: - return FALSE; - } - } else { - if ( lprcEnumMonitorsThatIntersect && - !IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect)) { - - return TRUE; - } - } - - return lpfnEnumProc( - xPRIMARY_MONITOR, - hdcOptionalForPainting, - &rcLimit, - dwData); -} - -BOOL WINAPI -xEnumDisplayDevices( - PVOID Unused, - DWORD iDevNum, - PDISPLAY_DEVICE lpDisplayDevice, - DWORD dwFlags) -{ - if (InitMultipleMonitorStubs()) - return g_pfnEnumDisplayDevices(Unused, iDevNum, lpDisplayDevice, dwFlags); - - if (Unused != NULL) - return FALSE; - - if (iDevNum != 0) - return FALSE; - - if (lpDisplayDevice == NULL || lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE)) - return FALSE; - -#ifdef UNICODE - MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR))); - MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR))); -#else // UNICODE - lstrcpy((LPTSTR)lpDisplayDevice->DeviceName, TEXT("DISPLAY")); - lstrcpy((LPTSTR)lpDisplayDevice->DeviceString, TEXT("DISPLAY")); -#endif // UNICODE - - lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE; - - return TRUE; -} - -#undef xPRIMARY_MONITOR -#undef COMPILE_MULTIMON_STUBS - -#else // COMPILE_MULTIMON_STUBS - -extern int WINAPI xGetSystemMetrics(int); -extern HMONITOR WINAPI xMonitorFromWindow(HWND, DWORD); -extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, DWORD); -extern HMONITOR WINAPI xMonitorFromPoint(POINT, DWORD); -extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO); -extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM); -extern BOOL WINAPI xEnumDisplayDevices(PVOID, DWORD, PDISPLAY_DEVICE, DWORD); - -#endif // COMPILE_MULTIMON_STUBS - -// -// build defines that replace the regular APIs with our versions -// -#define GetSystemMetrics xGetSystemMetrics -#define MonitorFromWindow xMonitorFromWindow -#define MonitorFromRect xMonitorFromRect -#define MonitorFromPoint xMonitorFromPoint -#define GetMonitorInfo xGetMonitorInfo -#define EnumDisplayMonitors xEnumDisplayMonitors -#define EnumDisplayDevices xEnumDisplayDevices - -#ifdef __cplusplus -} -#endif // __cplusplus - diff --git a/import/DirectX8/include/playlist.h b/import/DirectX8/include/playlist.h deleted file mode 100644 index 605275601..000000000 --- a/import/DirectX8/include/playlist.h +++ /dev/null @@ -1,847 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 5.03.0286 */ -/* Compiler settings for playlist.idl: - Oicf (OptLev=i2), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __playlist_h__ -#define __playlist_h__ - -/* Forward Declarations */ - -#ifndef __IAMPlayListItem_FWD_DEFINED__ -#define __IAMPlayListItem_FWD_DEFINED__ -typedef interface IAMPlayListItem IAMPlayListItem; -#endif /* __IAMPlayListItem_FWD_DEFINED__ */ - - -#ifndef __IAMPlayList_FWD_DEFINED__ -#define __IAMPlayList_FWD_DEFINED__ -typedef interface IAMPlayList IAMPlayList; -#endif /* __IAMPlayList_FWD_DEFINED__ */ - - -#ifndef __ISpecifyParticularPages_FWD_DEFINED__ -#define __ISpecifyParticularPages_FWD_DEFINED__ -typedef interface ISpecifyParticularPages ISpecifyParticularPages; -#endif /* __ISpecifyParticularPages_FWD_DEFINED__ */ - - -#ifndef __IAMRebuild_FWD_DEFINED__ -#define __IAMRebuild_FWD_DEFINED__ -typedef interface IAMRebuild IAMRebuild; -#endif /* __IAMRebuild_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "strmif.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void __RPC_FAR * ); - -/* interface __MIDL_itf_playlist_0000 */ -/* [local] */ - - -enum AMPlayListItemFlags - { AMPLAYLISTITEM_CANSKIP = 0x1, - AMPLAYLISTITEM_CANBIND = 0x2 - }; - - -extern RPC_IF_HANDLE __MIDL_itf_playlist_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_playlist_0000_v0_0_s_ifspec; - -#ifndef __IAMPlayListItem_INTERFACE_DEFINED__ -#define __IAMPlayListItem_INTERFACE_DEFINED__ - -/* interface IAMPlayListItem */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMPlayListItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868ff-0ad4-11ce-b03a-0020af0ba770") - IAMPlayListItem : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFlags( - /* [out] */ DWORD __RPC_FAR *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceCount( - /* [out] */ DWORD __RPC_FAR *pdwSources) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceURL( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrURL) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceStart( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtStart) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceDuration( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtDuration) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceStartMarker( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceEndMarker( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceStartMarkerName( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrStartMarker) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSourceEndMarkerName( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrEndMarker) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetLinkURL( - /* [out] */ BSTR __RPC_FAR *pbstrURL) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetScanDuration( - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtScanDuration) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMPlayListItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IAMPlayListItem __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IAMPlayListItem __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFlags )( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceCount )( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwSources); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceURL )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrURL); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceStart )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtStart); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceDuration )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtDuration); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceStartMarker )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceEndMarker )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceStartMarkerName )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrStartMarker); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSourceEndMarkerName )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrEndMarker); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLinkURL )( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ BSTR __RPC_FAR *pbstrURL); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetScanDuration )( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtScanDuration); - - END_INTERFACE - } IAMPlayListItemVtbl; - - interface IAMPlayListItem - { - CONST_VTBL struct IAMPlayListItemVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMPlayListItem_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMPlayListItem_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMPlayListItem_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMPlayListItem_GetFlags(This,pdwFlags) \ - (This)->lpVtbl -> GetFlags(This,pdwFlags) - -#define IAMPlayListItem_GetSourceCount(This,pdwSources) \ - (This)->lpVtbl -> GetSourceCount(This,pdwSources) - -#define IAMPlayListItem_GetSourceURL(This,dwSourceIndex,pbstrURL) \ - (This)->lpVtbl -> GetSourceURL(This,dwSourceIndex,pbstrURL) - -#define IAMPlayListItem_GetSourceStart(This,dwSourceIndex,prtStart) \ - (This)->lpVtbl -> GetSourceStart(This,dwSourceIndex,prtStart) - -#define IAMPlayListItem_GetSourceDuration(This,dwSourceIndex,prtDuration) \ - (This)->lpVtbl -> GetSourceDuration(This,dwSourceIndex,prtDuration) - -#define IAMPlayListItem_GetSourceStartMarker(This,dwSourceIndex,pdwMarker) \ - (This)->lpVtbl -> GetSourceStartMarker(This,dwSourceIndex,pdwMarker) - -#define IAMPlayListItem_GetSourceEndMarker(This,dwSourceIndex,pdwMarker) \ - (This)->lpVtbl -> GetSourceEndMarker(This,dwSourceIndex,pdwMarker) - -#define IAMPlayListItem_GetSourceStartMarkerName(This,dwSourceIndex,pbstrStartMarker) \ - (This)->lpVtbl -> GetSourceStartMarkerName(This,dwSourceIndex,pbstrStartMarker) - -#define IAMPlayListItem_GetSourceEndMarkerName(This,dwSourceIndex,pbstrEndMarker) \ - (This)->lpVtbl -> GetSourceEndMarkerName(This,dwSourceIndex,pbstrEndMarker) - -#define IAMPlayListItem_GetLinkURL(This,pbstrURL) \ - (This)->lpVtbl -> GetLinkURL(This,pbstrURL) - -#define IAMPlayListItem_GetScanDuration(This,dwSourceIndex,prtScanDuration) \ - (This)->lpVtbl -> GetScanDuration(This,dwSourceIndex,prtScanDuration) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetFlags_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - -void __RPC_STUB IAMPlayListItem_GetFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceCount_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwSources); - - -void __RPC_STUB IAMPlayListItem_GetSourceCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceURL_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrURL); - - -void __RPC_STUB IAMPlayListItem_GetSourceURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceStart_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtStart); - - -void __RPC_STUB IAMPlayListItem_GetSourceStart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceDuration_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtDuration); - - -void __RPC_STUB IAMPlayListItem_GetSourceDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceStartMarker_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker); - - -void __RPC_STUB IAMPlayListItem_GetSourceStartMarker_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceEndMarker_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ DWORD __RPC_FAR *pdwMarker); - - -void __RPC_STUB IAMPlayListItem_GetSourceEndMarker_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceStartMarkerName_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrStartMarker); - - -void __RPC_STUB IAMPlayListItem_GetSourceStartMarkerName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetSourceEndMarkerName_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ BSTR __RPC_FAR *pbstrEndMarker); - - -void __RPC_STUB IAMPlayListItem_GetSourceEndMarkerName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetLinkURL_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [out] */ BSTR __RPC_FAR *pbstrURL); - - -void __RPC_STUB IAMPlayListItem_GetLinkURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayListItem_GetScanDuration_Proxy( - IAMPlayListItem __RPC_FAR * This, - /* [in] */ DWORD dwSourceIndex, - /* [out] */ REFERENCE_TIME __RPC_FAR *prtScanDuration); - - -void __RPC_STUB IAMPlayListItem_GetScanDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMPlayListItem_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_playlist_0348 */ -/* [local] */ - - -enum AMPlayListFlags - { AMPLAYLIST_STARTINSCANMODE = 0x1, - AMPLAYLIST_FORCEBANNER = 0x2 - }; - -enum AMPlayListEventFlags - { AMPLAYLISTEVENT_RESUME = 0, - AMPLAYLISTEVENT_BREAK = 0x1, - AMPLAYLISTEVENT_NEXT = 0x2, - AMPLAYLISTEVENT_MASK = 0xf, - AMPLAYLISTEVENT_REFRESH = 0x10 - }; - - -extern RPC_IF_HANDLE __MIDL_itf_playlist_0348_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_playlist_0348_v0_0_s_ifspec; - -#ifndef __IAMPlayList_INTERFACE_DEFINED__ -#define __IAMPlayList_INTERFACE_DEFINED__ - -/* interface IAMPlayList */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMPlayList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868fe-0ad4-11ce-b03a-0020af0ba770") - IAMPlayList : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFlags( - /* [out] */ DWORD __RPC_FAR *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetItemCount( - /* [out] */ DWORD __RPC_FAR *pdwItems) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetItem( - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNamedEvent( - /* [in] */ WCHAR __RPC_FAR *pwszEventName, - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem, - /* [out] */ DWORD __RPC_FAR *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRepeatInfo( - /* [out] */ DWORD __RPC_FAR *pdwRepeatCount, - /* [out] */ DWORD __RPC_FAR *pdwRepeatStart, - /* [out] */ DWORD __RPC_FAR *pdwRepeatEnd) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMPlayListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IAMPlayList __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IAMPlayList __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IAMPlayList __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFlags )( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetItemCount )( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwItems); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetItem )( - IAMPlayList __RPC_FAR * This, - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetNamedEvent )( - IAMPlayList __RPC_FAR * This, - /* [in] */ WCHAR __RPC_FAR *pwszEventName, - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetRepeatInfo )( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwRepeatCount, - /* [out] */ DWORD __RPC_FAR *pdwRepeatStart, - /* [out] */ DWORD __RPC_FAR *pdwRepeatEnd); - - END_INTERFACE - } IAMPlayListVtbl; - - interface IAMPlayList - { - CONST_VTBL struct IAMPlayListVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMPlayList_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMPlayList_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMPlayList_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMPlayList_GetFlags(This,pdwFlags) \ - (This)->lpVtbl -> GetFlags(This,pdwFlags) - -#define IAMPlayList_GetItemCount(This,pdwItems) \ - (This)->lpVtbl -> GetItemCount(This,pdwItems) - -#define IAMPlayList_GetItem(This,dwItemIndex,ppItem) \ - (This)->lpVtbl -> GetItem(This,dwItemIndex,ppItem) - -#define IAMPlayList_GetNamedEvent(This,pwszEventName,dwItemIndex,ppItem,pdwFlags) \ - (This)->lpVtbl -> GetNamedEvent(This,pwszEventName,dwItemIndex,ppItem,pdwFlags) - -#define IAMPlayList_GetRepeatInfo(This,pdwRepeatCount,pdwRepeatStart,pdwRepeatEnd) \ - (This)->lpVtbl -> GetRepeatInfo(This,pdwRepeatCount,pdwRepeatStart,pdwRepeatEnd) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMPlayList_GetFlags_Proxy( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - -void __RPC_STUB IAMPlayList_GetFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayList_GetItemCount_Proxy( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwItems); - - -void __RPC_STUB IAMPlayList_GetItemCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayList_GetItem_Proxy( - IAMPlayList __RPC_FAR * This, - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem); - - -void __RPC_STUB IAMPlayList_GetItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayList_GetNamedEvent_Proxy( - IAMPlayList __RPC_FAR * This, - /* [in] */ WCHAR __RPC_FAR *pwszEventName, - /* [in] */ DWORD dwItemIndex, - /* [out] */ IAMPlayListItem __RPC_FAR *__RPC_FAR *ppItem, - /* [out] */ DWORD __RPC_FAR *pdwFlags); - - -void __RPC_STUB IAMPlayList_GetNamedEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPlayList_GetRepeatInfo_Proxy( - IAMPlayList __RPC_FAR * This, - /* [out] */ DWORD __RPC_FAR *pdwRepeatCount, - /* [out] */ DWORD __RPC_FAR *pdwRepeatStart, - /* [out] */ DWORD __RPC_FAR *pdwRepeatEnd); - - -void __RPC_STUB IAMPlayList_GetRepeatInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMPlayList_INTERFACE_DEFINED__ */ - - -#ifndef __ISpecifyParticularPages_INTERFACE_DEFINED__ -#define __ISpecifyParticularPages_INTERFACE_DEFINED__ - -/* interface ISpecifyParticularPages */ -/* [object][helpstring][uuid] */ - - -EXTERN_C const IID IID_ISpecifyParticularPages; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4C437B91-6E9E-11d1-A704-006097C4E476") - ISpecifyParticularPages : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPages( - /* [in] */ REFGUID guidWhatPages, - /* [out] */ CAUUID __RPC_FAR *pPages) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISpecifyParticularPagesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - ISpecifyParticularPages __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - ISpecifyParticularPages __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - ISpecifyParticularPages __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetPages )( - ISpecifyParticularPages __RPC_FAR * This, - /* [in] */ REFGUID guidWhatPages, - /* [out] */ CAUUID __RPC_FAR *pPages); - - END_INTERFACE - } ISpecifyParticularPagesVtbl; - - interface ISpecifyParticularPages - { - CONST_VTBL struct ISpecifyParticularPagesVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISpecifyParticularPages_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISpecifyParticularPages_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISpecifyParticularPages_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISpecifyParticularPages_GetPages(This,guidWhatPages,pPages) \ - (This)->lpVtbl -> GetPages(This,guidWhatPages,pPages) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISpecifyParticularPages_GetPages_Proxy( - ISpecifyParticularPages __RPC_FAR * This, - /* [in] */ REFGUID guidWhatPages, - /* [out] */ CAUUID __RPC_FAR *pPages); - - -void __RPC_STUB ISpecifyParticularPages_GetPages_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISpecifyParticularPages_INTERFACE_DEFINED__ */ - - -#ifndef __IAMRebuild_INTERFACE_DEFINED__ -#define __IAMRebuild_INTERFACE_DEFINED__ - -/* interface IAMRebuild */ -/* [object][helpstring][uuid][local] */ - - -EXTERN_C const IID IID_IAMRebuild; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("02EF04DD-7580-11d1-BECE-00C04FB6E937") - IAMRebuild : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RebuildNow( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMRebuildVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IAMRebuild __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IAMRebuild __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IAMRebuild __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RebuildNow )( - IAMRebuild __RPC_FAR * This); - - END_INTERFACE - } IAMRebuildVtbl; - - interface IAMRebuild - { - CONST_VTBL struct IAMRebuildVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMRebuild_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMRebuild_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMRebuild_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMRebuild_RebuildNow(This) \ - (This)->lpVtbl -> RebuildNow(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMRebuild_RebuildNow_Proxy( - IAMRebuild __RPC_FAR * This); - - -void __RPC_STUB IAMRebuild_RebuildNow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMRebuild_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_playlist_0351 */ -/* [local] */ - -EXTERN_GUID(IID_IAMPlayListItem,0x56a868ff,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70); -EXTERN_GUID(IID_IAMRebuild,0x2ef04dd,0x7580,0x11d1,0xbe,0xce,0x0,0xc0,0x4f,0xb6,0xe9,0x37); -EXTERN_GUID(IID_IAMPlayList,0x56a868fe,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70); -EXTERN_GUID(SPECIFYPAGES_STATISTICS,0x4c437b92,0x6e9e,0x11d1,0xa7,0x4,0x0,0x60,0x97,0xc4,0xe4,0x76); -EXTERN_GUID(IID_ISpecifyParticularPages,0x4c437b91,0x6e9e,0x11d1,0xa7,0x4,0x0,0x60,0x97,0xc4,0xe4,0x76); - - -extern RPC_IF_HANDLE __MIDL_itf_playlist_0351_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_playlist_0351_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * ); -unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); -unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); -void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/qedit.h b/import/DirectX8/include/qedit.h deleted file mode 100644 index ce9a171dc..000000000 --- a/import/DirectX8/include/qedit.h +++ /dev/null @@ -1,19878 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1999-2001. -// -//-------------------------------------------------------------------------- - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for qedit.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __qedit_h__ -#define __qedit_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IPropertySetter_FWD_DEFINED__ -#define __IPropertySetter_FWD_DEFINED__ -typedef interface IPropertySetter IPropertySetter; -#endif /* __IPropertySetter_FWD_DEFINED__ */ - - -#ifndef __IDxtCompositor_FWD_DEFINED__ -#define __IDxtCompositor_FWD_DEFINED__ -typedef interface IDxtCompositor IDxtCompositor; -#endif /* __IDxtCompositor_FWD_DEFINED__ */ - - -#ifndef __IDxtAlphaSetter_FWD_DEFINED__ -#define __IDxtAlphaSetter_FWD_DEFINED__ -typedef interface IDxtAlphaSetter IDxtAlphaSetter; -#endif /* __IDxtAlphaSetter_FWD_DEFINED__ */ - - -#ifndef __IDxtJpeg_FWD_DEFINED__ -#define __IDxtJpeg_FWD_DEFINED__ -typedef interface IDxtJpeg IDxtJpeg; -#endif /* __IDxtJpeg_FWD_DEFINED__ */ - - -#ifndef __IDxtKey_FWD_DEFINED__ -#define __IDxtKey_FWD_DEFINED__ -typedef interface IDxtKey IDxtKey; -#endif /* __IDxtKey_FWD_DEFINED__ */ - - -#ifndef __IMediaLocator_FWD_DEFINED__ -#define __IMediaLocator_FWD_DEFINED__ -typedef interface IMediaLocator IMediaLocator; -#endif /* __IMediaLocator_FWD_DEFINED__ */ - - -#ifndef __IMediaDet_FWD_DEFINED__ -#define __IMediaDet_FWD_DEFINED__ -typedef interface IMediaDet IMediaDet; -#endif /* __IMediaDet_FWD_DEFINED__ */ - - -#ifndef __IGrfCache_FWD_DEFINED__ -#define __IGrfCache_FWD_DEFINED__ -typedef interface IGrfCache IGrfCache; -#endif /* __IGrfCache_FWD_DEFINED__ */ - - -#ifndef __IRenderEngine_FWD_DEFINED__ -#define __IRenderEngine_FWD_DEFINED__ -typedef interface IRenderEngine IRenderEngine; -#endif /* __IRenderEngine_FWD_DEFINED__ */ - - -#ifndef __IFindCompressorCB_FWD_DEFINED__ -#define __IFindCompressorCB_FWD_DEFINED__ -typedef interface IFindCompressorCB IFindCompressorCB; -#endif /* __IFindCompressorCB_FWD_DEFINED__ */ - - -#ifndef __ISmartRenderEngine_FWD_DEFINED__ -#define __ISmartRenderEngine_FWD_DEFINED__ -typedef interface ISmartRenderEngine ISmartRenderEngine; -#endif /* __ISmartRenderEngine_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineObj_FWD_DEFINED__ -#define __IAMTimelineObj_FWD_DEFINED__ -typedef interface IAMTimelineObj IAMTimelineObj; -#endif /* __IAMTimelineObj_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineEffectable_FWD_DEFINED__ -#define __IAMTimelineEffectable_FWD_DEFINED__ -typedef interface IAMTimelineEffectable IAMTimelineEffectable; -#endif /* __IAMTimelineEffectable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineEffect_FWD_DEFINED__ -#define __IAMTimelineEffect_FWD_DEFINED__ -typedef interface IAMTimelineEffect IAMTimelineEffect; -#endif /* __IAMTimelineEffect_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTransable_FWD_DEFINED__ -#define __IAMTimelineTransable_FWD_DEFINED__ -typedef interface IAMTimelineTransable IAMTimelineTransable; -#endif /* __IAMTimelineTransable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineSplittable_FWD_DEFINED__ -#define __IAMTimelineSplittable_FWD_DEFINED__ -typedef interface IAMTimelineSplittable IAMTimelineSplittable; -#endif /* __IAMTimelineSplittable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTrans_FWD_DEFINED__ -#define __IAMTimelineTrans_FWD_DEFINED__ -typedef interface IAMTimelineTrans IAMTimelineTrans; -#endif /* __IAMTimelineTrans_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineSrc_FWD_DEFINED__ -#define __IAMTimelineSrc_FWD_DEFINED__ -typedef interface IAMTimelineSrc IAMTimelineSrc; -#endif /* __IAMTimelineSrc_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTrack_FWD_DEFINED__ -#define __IAMTimelineTrack_FWD_DEFINED__ -typedef interface IAMTimelineTrack IAMTimelineTrack; -#endif /* __IAMTimelineTrack_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineVirtualTrack_FWD_DEFINED__ -#define __IAMTimelineVirtualTrack_FWD_DEFINED__ -typedef interface IAMTimelineVirtualTrack IAMTimelineVirtualTrack; -#endif /* __IAMTimelineVirtualTrack_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineComp_FWD_DEFINED__ -#define __IAMTimelineComp_FWD_DEFINED__ -typedef interface IAMTimelineComp IAMTimelineComp; -#endif /* __IAMTimelineComp_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineGroup_FWD_DEFINED__ -#define __IAMTimelineGroup_FWD_DEFINED__ -typedef interface IAMTimelineGroup IAMTimelineGroup; -#endif /* __IAMTimelineGroup_FWD_DEFINED__ */ - - -#ifndef __IAMTimeline_FWD_DEFINED__ -#define __IAMTimeline_FWD_DEFINED__ -typedef interface IAMTimeline IAMTimeline; -#endif /* __IAMTimeline_FWD_DEFINED__ */ - - -#ifndef __IXml2Dex_FWD_DEFINED__ -#define __IXml2Dex_FWD_DEFINED__ -typedef interface IXml2Dex IXml2Dex; -#endif /* __IXml2Dex_FWD_DEFINED__ */ - - -#ifndef __IAMErrorLog_FWD_DEFINED__ -#define __IAMErrorLog_FWD_DEFINED__ -typedef interface IAMErrorLog IAMErrorLog; -#endif /* __IAMErrorLog_FWD_DEFINED__ */ - - -#ifndef __IAMSetErrorLog_FWD_DEFINED__ -#define __IAMSetErrorLog_FWD_DEFINED__ -typedef interface IAMSetErrorLog IAMSetErrorLog; -#endif /* __IAMSetErrorLog_FWD_DEFINED__ */ - - -#ifndef __ISampleGrabberCB_FWD_DEFINED__ -#define __ISampleGrabberCB_FWD_DEFINED__ -typedef interface ISampleGrabberCB ISampleGrabberCB; -#endif /* __ISampleGrabberCB_FWD_DEFINED__ */ - - -#ifndef __ISampleGrabber_FWD_DEFINED__ -#define __ISampleGrabber_FWD_DEFINED__ -typedef interface ISampleGrabber ISampleGrabber; -#endif /* __ISampleGrabber_FWD_DEFINED__ */ - - -#ifndef __AMTimeline_FWD_DEFINED__ -#define __AMTimeline_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimeline AMTimeline; -#else -typedef struct AMTimeline AMTimeline; -#endif /* __cplusplus */ - -#endif /* __AMTimeline_FWD_DEFINED__ */ - - -#ifndef __AMTimelineObj_FWD_DEFINED__ -#define __AMTimelineObj_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineObj AMTimelineObj; -#else -typedef struct AMTimelineObj AMTimelineObj; -#endif /* __cplusplus */ - -#endif /* __AMTimelineObj_FWD_DEFINED__ */ - - -#ifndef __AMTimelineSrc_FWD_DEFINED__ -#define __AMTimelineSrc_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineSrc AMTimelineSrc; -#else -typedef struct AMTimelineSrc AMTimelineSrc; -#endif /* __cplusplus */ - -#endif /* __AMTimelineSrc_FWD_DEFINED__ */ - - -#ifndef __AMTimelineTrack_FWD_DEFINED__ -#define __AMTimelineTrack_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineTrack AMTimelineTrack; -#else -typedef struct AMTimelineTrack AMTimelineTrack; -#endif /* __cplusplus */ - -#endif /* __AMTimelineTrack_FWD_DEFINED__ */ - - -#ifndef __AMTimelineComp_FWD_DEFINED__ -#define __AMTimelineComp_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineComp AMTimelineComp; -#else -typedef struct AMTimelineComp AMTimelineComp; -#endif /* __cplusplus */ - -#endif /* __AMTimelineComp_FWD_DEFINED__ */ - - -#ifndef __AMTimelineGroup_FWD_DEFINED__ -#define __AMTimelineGroup_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineGroup AMTimelineGroup; -#else -typedef struct AMTimelineGroup AMTimelineGroup; -#endif /* __cplusplus */ - -#endif /* __AMTimelineGroup_FWD_DEFINED__ */ - - -#ifndef __AMTimelineTrans_FWD_DEFINED__ -#define __AMTimelineTrans_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineTrans AMTimelineTrans; -#else -typedef struct AMTimelineTrans AMTimelineTrans; -#endif /* __cplusplus */ - -#endif /* __AMTimelineTrans_FWD_DEFINED__ */ - - -#ifndef __AMTimelineEffect_FWD_DEFINED__ -#define __AMTimelineEffect_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineEffect AMTimelineEffect; -#else -typedef struct AMTimelineEffect AMTimelineEffect; -#endif /* __cplusplus */ - -#endif /* __AMTimelineEffect_FWD_DEFINED__ */ - - -#ifndef __RenderEngine_FWD_DEFINED__ -#define __RenderEngine_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class RenderEngine RenderEngine; -#else -typedef struct RenderEngine RenderEngine; -#endif /* __cplusplus */ - -#endif /* __RenderEngine_FWD_DEFINED__ */ - - -#ifndef __SmartRenderEngine_FWD_DEFINED__ -#define __SmartRenderEngine_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SmartRenderEngine SmartRenderEngine; -#else -typedef struct SmartRenderEngine SmartRenderEngine; -#endif /* __cplusplus */ - -#endif /* __SmartRenderEngine_FWD_DEFINED__ */ - - -#ifndef __AudMixer_FWD_DEFINED__ -#define __AudMixer_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AudMixer AudMixer; -#else -typedef struct AudMixer AudMixer; -#endif /* __cplusplus */ - -#endif /* __AudMixer_FWD_DEFINED__ */ - - -#ifndef __Xml2Dex_FWD_DEFINED__ -#define __Xml2Dex_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class Xml2Dex Xml2Dex; -#else -typedef struct Xml2Dex Xml2Dex; -#endif /* __cplusplus */ - -#endif /* __Xml2Dex_FWD_DEFINED__ */ - - -#ifndef __MediaLocator_FWD_DEFINED__ -#define __MediaLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MediaLocator MediaLocator; -#else -typedef struct MediaLocator MediaLocator; -#endif /* __cplusplus */ - -#endif /* __MediaLocator_FWD_DEFINED__ */ - - -#ifndef __PropertySetter_FWD_DEFINED__ -#define __PropertySetter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PropertySetter PropertySetter; -#else -typedef struct PropertySetter PropertySetter; -#endif /* __cplusplus */ - -#endif /* __PropertySetter_FWD_DEFINED__ */ - - -#ifndef __MediaDet_FWD_DEFINED__ -#define __MediaDet_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MediaDet MediaDet; -#else -typedef struct MediaDet MediaDet; -#endif /* __cplusplus */ - -#endif /* __MediaDet_FWD_DEFINED__ */ - - -#ifndef __SampleGrabber_FWD_DEFINED__ -#define __SampleGrabber_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SampleGrabber SampleGrabber; -#else -typedef struct SampleGrabber SampleGrabber; -#endif /* __cplusplus */ - -#endif /* __SampleGrabber_FWD_DEFINED__ */ - - -#ifndef __NullRenderer_FWD_DEFINED__ -#define __NullRenderer_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class NullRenderer NullRenderer; -#else -typedef struct NullRenderer NullRenderer; -#endif /* __cplusplus */ - -#endif /* __NullRenderer_FWD_DEFINED__ */ - - -#ifndef __DxtCompositor_FWD_DEFINED__ -#define __DxtCompositor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtCompositor DxtCompositor; -#else -typedef struct DxtCompositor DxtCompositor; -#endif /* __cplusplus */ - -#endif /* __DxtCompositor_FWD_DEFINED__ */ - - -#ifndef __DxtAlphaSetter_FWD_DEFINED__ -#define __DxtAlphaSetter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtAlphaSetter DxtAlphaSetter; -#else -typedef struct DxtAlphaSetter DxtAlphaSetter; -#endif /* __cplusplus */ - -#endif /* __DxtAlphaSetter_FWD_DEFINED__ */ - - -#ifndef __DxtJpeg_FWD_DEFINED__ -#define __DxtJpeg_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtJpeg DxtJpeg; -#else -typedef struct DxtJpeg DxtJpeg; -#endif /* __cplusplus */ - -#endif /* __DxtJpeg_FWD_DEFINED__ */ - - -#ifndef __ColorSource_FWD_DEFINED__ -#define __ColorSource_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ColorSource ColorSource; -#else -typedef struct ColorSource ColorSource; -#endif /* __cplusplus */ - -#endif /* __ColorSource_FWD_DEFINED__ */ - - -#ifndef __DxtKey_FWD_DEFINED__ -#define __DxtKey_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtKey DxtKey; -#else -typedef struct DxtKey DxtKey; -#endif /* __cplusplus */ - -#endif /* __DxtKey_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "dxtrans.h" -#include "amstream.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_qedit_0000 */ -/* [local] */ - - - - - - - - - - -typedef /* [public] */ -enum __MIDL___MIDL_itf_qedit_0000_0001 - { DEXTERF_JUMP = 0, - DEXTERF_INTERPOLATE = DEXTERF_JUMP + 1 - } DEXTERF; - -typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0002 - { - BSTR Name; - DISPID dispID; - LONG nValues; - } DEXTER_PARAM; - -typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0003 - { - VARIANT v; - REFERENCE_TIME rt; - DWORD dwInterp; - } DEXTER_VALUE; - - -enum __MIDL___MIDL_itf_qedit_0000_0004 - { DEXTER_AUDIO_JUMP = 0, - DEXTER_AUDIO_INTERPOLATE = DEXTER_AUDIO_JUMP + 1 - } ; -typedef /* [public] */ struct __MIDL___MIDL_itf_qedit_0000_0005 - { - REFERENCE_TIME rtEnd; - double dLevel; - BOOL bMethod; - } DEXTER_AUDIO_VOLUMEENVELOPE; - - -enum __MIDL___MIDL_itf_qedit_0000_0006 - { TIMELINE_INSERT_MODE_INSERT = 1, - TIMELINE_INSERT_MODE_OVERLAY = 2 - } ; -typedef /* [public][public][public][public][public][public][public][public] */ -enum __MIDL___MIDL_itf_qedit_0000_0007 - { TIMELINE_MAJOR_TYPE_COMPOSITE = 1, - TIMELINE_MAJOR_TYPE_TRACK = 2, - TIMELINE_MAJOR_TYPE_SOURCE = 4, - TIMELINE_MAJOR_TYPE_TRANSITION = 8, - TIMELINE_MAJOR_TYPE_EFFECT = 16, - TIMELINE_MAJOR_TYPE_GROUP = 128 - } TIMELINE_MAJOR_TYPE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_qedit_0000_0008 - { DEXTERF_BOUNDING = -1, - DEXTERF_EXACTLY_AT = 0, - DEXTERF_FORWARDS = 1 - } DEXTERF_TRACK_SEARCH_FLAGS; - -typedef struct _SCompFmt0 - { - long nFormatId; - AM_MEDIA_TYPE MediaType; - } SCompFmt0; - - -enum __MIDL___MIDL_itf_qedit_0000_0009 - { RESIZEF_STRETCH = 0, - RESIZEF_CROP = RESIZEF_STRETCH + 1, - RESIZEF_PRESERVEASPECTRATIO = RESIZEF_CROP + 1, - RESIZEF_PRESERVEASPECTRATIO_NOLETTERBOX = RESIZEF_PRESERVEASPECTRATIO + 1 - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0010 - { CONNECTF_DYNAMIC_NONE = 0, - CONNECTF_DYNAMIC_SOURCES = 0x1, - CONNECTF_DYNAMIC_EFFECTS = 0x2 - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0011 - { SFN_VALIDATEF_CHECK = 0x1, - SFN_VALIDATEF_POPUP = 0x2, - SFN_VALIDATEF_TELLME = 0x4, - SFN_VALIDATEF_REPLACE = 0x8, - SFN_VALIDATEF_USELOCAL = 0x10, - SFN_VALIDATEF_NOFIND = 0x20, - SFN_VALIDATEF_IGNOREMUTED = 0x40, - SFN_VALIDATEF_END = SFN_VALIDATEF_IGNOREMUTED + 1 - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0012 - { DXTKEY_RGB = 0, - DXTKEY_NONRED = DXTKEY_RGB + 1, - DXTKEY_LUMINANCE = DXTKEY_NONRED + 1, - DXTKEY_ALPHA = DXTKEY_LUMINANCE + 1, - DXTKEY_HUE = DXTKEY_ALPHA + 1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_s_ifspec; - -#ifndef __IPropertySetter_INTERFACE_DEFINED__ -#define __IPropertySetter_INTERFACE_DEFINED__ - -/* interface IPropertySetter */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPropertySetter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BD-B0C3-11D2-8D24-00A0C9441E20") - IPropertySetter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE LoadXML( - /* [in] */ IUnknown *pxml) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrintXML( - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent) = 0; - - virtual HRESULT STDMETHODCALLTYPE CloneProps( - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddProp( - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProps( - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeProps( - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearProps( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SaveToBlob( - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadFromBlob( - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetProps( - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrintXMLW( - /* [out] */ WCHAR *pszXML, - /* [in] */ int cchXML, - /* [out] */ int *pcchPrinted, - /* [in] */ int indent) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPropertySetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPropertySetter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPropertySetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *LoadXML )( - IPropertySetter * This, - /* [in] */ IUnknown *pxml); - - HRESULT ( STDMETHODCALLTYPE *PrintXML )( - IPropertySetter * This, - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent); - - HRESULT ( STDMETHODCALLTYPE *CloneProps )( - IPropertySetter * This, - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop); - - HRESULT ( STDMETHODCALLTYPE *AddProp )( - IPropertySetter * This, - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *GetProps )( - IPropertySetter * This, - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue); - - HRESULT ( STDMETHODCALLTYPE *FreeProps )( - IPropertySetter * This, - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *ClearProps )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *SaveToBlob )( - IPropertySetter * This, - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb); - - HRESULT ( STDMETHODCALLTYPE *LoadFromBlob )( - IPropertySetter * This, - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb); - - HRESULT ( STDMETHODCALLTYPE *SetProps )( - IPropertySetter * This, - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow); - - HRESULT ( STDMETHODCALLTYPE *PrintXMLW )( - IPropertySetter * This, - /* [out] */ WCHAR *pszXML, - /* [in] */ int cchXML, - /* [out] */ int *pcchPrinted, - /* [in] */ int indent); - - END_INTERFACE - } IPropertySetterVtbl; - - interface IPropertySetter - { - CONST_VTBL struct IPropertySetterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPropertySetter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPropertySetter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPropertySetter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPropertySetter_LoadXML(This,pxml) \ - (This)->lpVtbl -> LoadXML(This,pxml) - -#define IPropertySetter_PrintXML(This,pszXML,cbXML,pcbPrinted,indent) \ - (This)->lpVtbl -> PrintXML(This,pszXML,cbXML,pcbPrinted,indent) - -#define IPropertySetter_CloneProps(This,ppSetter,rtStart,rtStop) \ - (This)->lpVtbl -> CloneProps(This,ppSetter,rtStart,rtStop) - -#define IPropertySetter_AddProp(This,Param,paValue) \ - (This)->lpVtbl -> AddProp(This,Param,paValue) - -#define IPropertySetter_GetProps(This,pcParams,paParam,paValue) \ - (This)->lpVtbl -> GetProps(This,pcParams,paParam,paValue) - -#define IPropertySetter_FreeProps(This,cParams,paParam,paValue) \ - (This)->lpVtbl -> FreeProps(This,cParams,paParam,paValue) - -#define IPropertySetter_ClearProps(This) \ - (This)->lpVtbl -> ClearProps(This) - -#define IPropertySetter_SaveToBlob(This,pcSize,ppb) \ - (This)->lpVtbl -> SaveToBlob(This,pcSize,ppb) - -#define IPropertySetter_LoadFromBlob(This,cSize,pb) \ - (This)->lpVtbl -> LoadFromBlob(This,cSize,pb) - -#define IPropertySetter_SetProps(This,pTarget,rtNow) \ - (This)->lpVtbl -> SetProps(This,pTarget,rtNow) - -#define IPropertySetter_PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) \ - (This)->lpVtbl -> PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IPropertySetter_LoadXML_Proxy( - IPropertySetter * This, - /* [in] */ IUnknown *pxml); - - -void __RPC_STUB IPropertySetter_LoadXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_PrintXML_Proxy( - IPropertySetter * This, - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent); - - -void __RPC_STUB IPropertySetter_PrintXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_CloneProps_Proxy( - IPropertySetter * This, - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop); - - -void __RPC_STUB IPropertySetter_CloneProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_AddProp_Proxy( - IPropertySetter * This, - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue); - - -void __RPC_STUB IPropertySetter_AddProp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_GetProps_Proxy( - IPropertySetter * This, - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue); - - -void __RPC_STUB IPropertySetter_GetProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_FreeProps_Proxy( - IPropertySetter * This, - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue); - - -void __RPC_STUB IPropertySetter_FreeProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_ClearProps_Proxy( - IPropertySetter * This); - - -void __RPC_STUB IPropertySetter_ClearProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_SaveToBlob_Proxy( - IPropertySetter * This, - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb); - - -void __RPC_STUB IPropertySetter_SaveToBlob_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_LoadFromBlob_Proxy( - IPropertySetter * This, - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb); - - -void __RPC_STUB IPropertySetter_LoadFromBlob_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_SetProps_Proxy( - IPropertySetter * This, - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow); - - -void __RPC_STUB IPropertySetter_SetProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPropertySetter_PrintXMLW_Proxy( - IPropertySetter * This, - /* [out] */ WCHAR *pszXML, - /* [in] */ int cchXML, - /* [out] */ int *pcchPrinted, - /* [in] */ int indent); - - -void __RPC_STUB IPropertySetter_PrintXMLW_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPropertySetter_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtCompositor_INTERFACE_DEFINED__ -#define __IDxtCompositor_INTERFACE_DEFINED__ - -/* interface IDxtCompositor */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtCompositor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BB44391E-6ABD-422f-9E2E-385C9DFF51FC") - IDxtCompositor : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Width( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Width( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Height( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Height( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcWidth( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcHeight( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcHeight( - /* [in] */ long newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtCompositorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtCompositor * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtCompositor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtCompositor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtCompositor * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtCompositor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtCompositor * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtCompositor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Width )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Height )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetX )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetY )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcWidth )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcWidth )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcHeight )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcHeight )( - IDxtCompositor * This, - /* [in] */ long newVal); - - END_INTERFACE - } IDxtCompositorVtbl; - - interface IDxtCompositor - { - CONST_VTBL struct IDxtCompositorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtCompositor_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDxtCompositor_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDxtCompositor_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDxtCompositor_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDxtCompositor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDxtCompositor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDxtCompositor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDxtCompositor_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - -#define IDxtCompositor_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - -#define IDxtCompositor_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - -#define IDxtCompositor_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - -#define IDxtCompositor_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define IDxtCompositor_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - -#define IDxtCompositor_get_OffsetX(This,pVal) \ - (This)->lpVtbl -> get_OffsetX(This,pVal) - -#define IDxtCompositor_put_OffsetX(This,newVal) \ - (This)->lpVtbl -> put_OffsetX(This,newVal) - -#define IDxtCompositor_get_OffsetY(This,pVal) \ - (This)->lpVtbl -> get_OffsetY(This,pVal) - -#define IDxtCompositor_put_OffsetY(This,newVal) \ - (This)->lpVtbl -> put_OffsetY(This,newVal) - -#define IDxtCompositor_get_Width(This,pVal) \ - (This)->lpVtbl -> get_Width(This,pVal) - -#define IDxtCompositor_put_Width(This,newVal) \ - (This)->lpVtbl -> put_Width(This,newVal) - -#define IDxtCompositor_get_Height(This,pVal) \ - (This)->lpVtbl -> get_Height(This,pVal) - -#define IDxtCompositor_put_Height(This,newVal) \ - (This)->lpVtbl -> put_Height(This,newVal) - -#define IDxtCompositor_get_SrcOffsetX(This,pVal) \ - (This)->lpVtbl -> get_SrcOffsetX(This,pVal) - -#define IDxtCompositor_put_SrcOffsetX(This,newVal) \ - (This)->lpVtbl -> put_SrcOffsetX(This,newVal) - -#define IDxtCompositor_get_SrcOffsetY(This,pVal) \ - (This)->lpVtbl -> get_SrcOffsetY(This,pVal) - -#define IDxtCompositor_put_SrcOffsetY(This,newVal) \ - (This)->lpVtbl -> put_SrcOffsetY(This,newVal) - -#define IDxtCompositor_get_SrcWidth(This,pVal) \ - (This)->lpVtbl -> get_SrcWidth(This,pVal) - -#define IDxtCompositor_put_SrcWidth(This,newVal) \ - (This)->lpVtbl -> put_SrcWidth(This,newVal) - -#define IDxtCompositor_get_SrcHeight(This,pVal) \ - (This)->lpVtbl -> get_SrcHeight(This,pVal) - -#define IDxtCompositor_put_SrcHeight(This,newVal) \ - (This)->lpVtbl -> put_SrcHeight(This,newVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetX_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetX_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetY_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetY_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Width_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Width_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Height_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Height_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetX_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_SrcOffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetX_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_SrcOffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetY_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_SrcOffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetY_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_SrcOffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcWidth_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_SrcWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcWidth_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_SrcWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcHeight_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtCompositor_get_SrcHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcHeight_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtCompositor_put_SrcHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDxtCompositor_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtAlphaSetter_INTERFACE_DEFINED__ -#define __IDxtAlphaSetter_INTERFACE_DEFINED__ - -/* interface IDxtAlphaSetter */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtAlphaSetter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4EE9EAD9-DA4D-43d0-9383-06B90C08B12B") - IDxtAlphaSetter : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Alpha( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Alpha( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AlphaRamp( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AlphaRamp( - /* [in] */ double newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtAlphaSetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtAlphaSetter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtAlphaSetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtAlphaSetter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtAlphaSetter * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtAlphaSetter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtAlphaSetter * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtAlphaSetter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Alpha )( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Alpha )( - IDxtAlphaSetter * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AlphaRamp )( - IDxtAlphaSetter * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_AlphaRamp )( - IDxtAlphaSetter * This, - /* [in] */ double newVal); - - END_INTERFACE - } IDxtAlphaSetterVtbl; - - interface IDxtAlphaSetter - { - CONST_VTBL struct IDxtAlphaSetterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtAlphaSetter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDxtAlphaSetter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDxtAlphaSetter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDxtAlphaSetter_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDxtAlphaSetter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDxtAlphaSetter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDxtAlphaSetter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDxtAlphaSetter_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - -#define IDxtAlphaSetter_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - -#define IDxtAlphaSetter_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - -#define IDxtAlphaSetter_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - -#define IDxtAlphaSetter_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define IDxtAlphaSetter_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - -#define IDxtAlphaSetter_get_Alpha(This,pVal) \ - (This)->lpVtbl -> get_Alpha(This,pVal) - -#define IDxtAlphaSetter_put_Alpha(This,newVal) \ - (This)->lpVtbl -> put_Alpha(This,newVal) - -#define IDxtAlphaSetter_get_AlphaRamp(This,pVal) \ - (This)->lpVtbl -> get_AlphaRamp(This,pVal) - -#define IDxtAlphaSetter_put_AlphaRamp(This,newVal) \ - (This)->lpVtbl -> put_AlphaRamp(This,newVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_Alpha_Proxy( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtAlphaSetter_get_Alpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_Alpha_Proxy( - IDxtAlphaSetter * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtAlphaSetter_put_Alpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_AlphaRamp_Proxy( - IDxtAlphaSetter * This, - /* [retval][out] */ double *pVal); - - -void __RPC_STUB IDxtAlphaSetter_get_AlphaRamp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_AlphaRamp_Proxy( - IDxtAlphaSetter * This, - /* [in] */ double newVal); - - -void __RPC_STUB IDxtAlphaSetter_put_AlphaRamp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDxtAlphaSetter_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtJpeg_INTERFACE_DEFINED__ -#define __IDxtJpeg_INTERFACE_DEFINED__ - -/* interface IDxtJpeg */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtJpeg; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DE75D011-7A65-11D2-8CEA-00A0C9441E20") - IDxtJpeg : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskNum( - /* [retval][out] */ long *__MIDL_0018) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskNum( - /* [in] */ long __MIDL_0019) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskName( - /* [in] */ BSTR newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleX( - /* [retval][out] */ double *__MIDL_0020) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleX( - /* [in] */ double __MIDL_0021) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleY( - /* [retval][out] */ double *__MIDL_0022) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleY( - /* [in] */ double __MIDL_0023) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ long *__MIDL_0024) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long __MIDL_0025) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ long *__MIDL_0026) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long __MIDL_0027) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderColor( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderColor( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderWidth( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderSoftness( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderSoftness( - /* [in] */ long newVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadDefSettings( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtJpegVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtJpeg * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtJpeg * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtJpeg * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtJpeg * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtJpeg * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtJpeg * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskNum )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0018); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskNum )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0019); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskName )( - IDxtJpeg * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskName )( - IDxtJpeg * This, - /* [in] */ BSTR newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleX )( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0020); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleX )( - IDxtJpeg * This, - /* [in] */ double __MIDL_0021); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleY )( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0022); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleY )( - IDxtJpeg * This, - /* [in] */ double __MIDL_0023); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0024); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0025); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0026); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0027); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateX )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateX )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateY )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateY )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderColor )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderColor )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderWidth )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderWidth )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderSoftness )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderSoftness )( - IDxtJpeg * This, - /* [in] */ long newVal); - - HRESULT ( STDMETHODCALLTYPE *ApplyChanges )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *LoadDefSettings )( - IDxtJpeg * This); - - END_INTERFACE - } IDxtJpegVtbl; - - interface IDxtJpeg - { - CONST_VTBL struct IDxtJpegVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtJpeg_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDxtJpeg_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDxtJpeg_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDxtJpeg_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDxtJpeg_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDxtJpeg_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDxtJpeg_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDxtJpeg_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - -#define IDxtJpeg_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - -#define IDxtJpeg_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - -#define IDxtJpeg_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - -#define IDxtJpeg_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define IDxtJpeg_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - -#define IDxtJpeg_get_MaskNum(This,__MIDL_0018) \ - (This)->lpVtbl -> get_MaskNum(This,__MIDL_0018) - -#define IDxtJpeg_put_MaskNum(This,__MIDL_0019) \ - (This)->lpVtbl -> put_MaskNum(This,__MIDL_0019) - -#define IDxtJpeg_get_MaskName(This,pVal) \ - (This)->lpVtbl -> get_MaskName(This,pVal) - -#define IDxtJpeg_put_MaskName(This,newVal) \ - (This)->lpVtbl -> put_MaskName(This,newVal) - -#define IDxtJpeg_get_ScaleX(This,__MIDL_0020) \ - (This)->lpVtbl -> get_ScaleX(This,__MIDL_0020) - -#define IDxtJpeg_put_ScaleX(This,__MIDL_0021) \ - (This)->lpVtbl -> put_ScaleX(This,__MIDL_0021) - -#define IDxtJpeg_get_ScaleY(This,__MIDL_0022) \ - (This)->lpVtbl -> get_ScaleY(This,__MIDL_0022) - -#define IDxtJpeg_put_ScaleY(This,__MIDL_0023) \ - (This)->lpVtbl -> put_ScaleY(This,__MIDL_0023) - -#define IDxtJpeg_get_OffsetX(This,__MIDL_0024) \ - (This)->lpVtbl -> get_OffsetX(This,__MIDL_0024) - -#define IDxtJpeg_put_OffsetX(This,__MIDL_0025) \ - (This)->lpVtbl -> put_OffsetX(This,__MIDL_0025) - -#define IDxtJpeg_get_OffsetY(This,__MIDL_0026) \ - (This)->lpVtbl -> get_OffsetY(This,__MIDL_0026) - -#define IDxtJpeg_put_OffsetY(This,__MIDL_0027) \ - (This)->lpVtbl -> put_OffsetY(This,__MIDL_0027) - -#define IDxtJpeg_get_ReplicateX(This,pVal) \ - (This)->lpVtbl -> get_ReplicateX(This,pVal) - -#define IDxtJpeg_put_ReplicateX(This,newVal) \ - (This)->lpVtbl -> put_ReplicateX(This,newVal) - -#define IDxtJpeg_get_ReplicateY(This,pVal) \ - (This)->lpVtbl -> get_ReplicateY(This,pVal) - -#define IDxtJpeg_put_ReplicateY(This,newVal) \ - (This)->lpVtbl -> put_ReplicateY(This,newVal) - -#define IDxtJpeg_get_BorderColor(This,pVal) \ - (This)->lpVtbl -> get_BorderColor(This,pVal) - -#define IDxtJpeg_put_BorderColor(This,newVal) \ - (This)->lpVtbl -> put_BorderColor(This,newVal) - -#define IDxtJpeg_get_BorderWidth(This,pVal) \ - (This)->lpVtbl -> get_BorderWidth(This,pVal) - -#define IDxtJpeg_put_BorderWidth(This,newVal) \ - (This)->lpVtbl -> put_BorderWidth(This,newVal) - -#define IDxtJpeg_get_BorderSoftness(This,pVal) \ - (This)->lpVtbl -> get_BorderSoftness(This,pVal) - -#define IDxtJpeg_put_BorderSoftness(This,newVal) \ - (This)->lpVtbl -> put_BorderSoftness(This,newVal) - -#define IDxtJpeg_ApplyChanges(This) \ - (This)->lpVtbl -> ApplyChanges(This) - -#define IDxtJpeg_LoadDefSettings(This) \ - (This)->lpVtbl -> LoadDefSettings(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskNum_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0018); - - -void __RPC_STUB IDxtJpeg_get_MaskNum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskNum_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0019); - - -void __RPC_STUB IDxtJpeg_put_MaskNum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskName_Proxy( - IDxtJpeg * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IDxtJpeg_get_MaskName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskName_Proxy( - IDxtJpeg * This, - /* [in] */ BSTR newVal); - - -void __RPC_STUB IDxtJpeg_put_MaskName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0020); - - -void __RPC_STUB IDxtJpeg_get_ScaleX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleX_Proxy( - IDxtJpeg * This, - /* [in] */ double __MIDL_0021); - - -void __RPC_STUB IDxtJpeg_put_ScaleX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0022); - - -void __RPC_STUB IDxtJpeg_get_ScaleY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleY_Proxy( - IDxtJpeg * This, - /* [in] */ double __MIDL_0023); - - -void __RPC_STUB IDxtJpeg_put_ScaleY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0024); - - -void __RPC_STUB IDxtJpeg_get_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetX_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0025); - - -void __RPC_STUB IDxtJpeg_put_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0026); - - -void __RPC_STUB IDxtJpeg_get_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetY_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0027); - - -void __RPC_STUB IDxtJpeg_put_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtJpeg_get_ReplicateX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateX_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtJpeg_put_ReplicateX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtJpeg_get_ReplicateY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateY_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtJpeg_put_ReplicateY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderColor_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtJpeg_get_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderColor_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtJpeg_put_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderWidth_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtJpeg_get_BorderWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderWidth_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtJpeg_put_BorderWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderSoftness_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IDxtJpeg_get_BorderSoftness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderSoftness_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - -void __RPC_STUB IDxtJpeg_put_BorderSoftness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDxtJpeg_ApplyChanges_Proxy( - IDxtJpeg * This); - - -void __RPC_STUB IDxtJpeg_ApplyChanges_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDxtJpeg_LoadDefSettings_Proxy( - IDxtJpeg * This); - - -void __RPC_STUB IDxtJpeg_LoadDefSettings_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDxtJpeg_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtKey_INTERFACE_DEFINED__ -#define __IDxtKey_INTERFACE_DEFINED__ - -/* interface IDxtKey */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtKey; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3255de56-38fb-4901-b980-94b438010d7b") - IDxtKey : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KeyType( - /* [retval][out] */ int *__MIDL_0028) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KeyType( - /* [in] */ int __MIDL_0029) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Hue( - /* [retval][out] */ int *__MIDL_0030) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Hue( - /* [in] */ int __MIDL_0031) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Luminance( - /* [retval][out] */ int *__MIDL_0032) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Luminance( - /* [in] */ int __MIDL_0033) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RGB( - /* [retval][out] */ DWORD *__MIDL_0034) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_RGB( - /* [in] */ DWORD __MIDL_0035) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Similarity( - /* [retval][out] */ int *__MIDL_0036) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Similarity( - /* [in] */ int __MIDL_0037) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Invert( - /* [retval][out] */ BOOL *__MIDL_0038) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Invert( - /* [in] */ BOOL __MIDL_0039) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtKeyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtKey * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtKey * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtKey * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtKey * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtKey * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtKey * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtKey * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtKey * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KeyType )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0028); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KeyType )( - IDxtKey * This, - /* [in] */ int __MIDL_0029); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Hue )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0030); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Hue )( - IDxtKey * This, - /* [in] */ int __MIDL_0031); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Luminance )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0032); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Luminance )( - IDxtKey * This, - /* [in] */ int __MIDL_0033); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_RGB )( - IDxtKey * This, - /* [retval][out] */ DWORD *__MIDL_0034); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_RGB )( - IDxtKey * This, - /* [in] */ DWORD __MIDL_0035); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Similarity )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0036); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Similarity )( - IDxtKey * This, - /* [in] */ int __MIDL_0037); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Invert )( - IDxtKey * This, - /* [retval][out] */ BOOL *__MIDL_0038); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Invert )( - IDxtKey * This, - /* [in] */ BOOL __MIDL_0039); - - END_INTERFACE - } IDxtKeyVtbl; - - interface IDxtKey - { - CONST_VTBL struct IDxtKeyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtKey_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDxtKey_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDxtKey_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDxtKey_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDxtKey_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDxtKey_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDxtKey_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDxtKey_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - -#define IDxtKey_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - -#define IDxtKey_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - -#define IDxtKey_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - -#define IDxtKey_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - -#define IDxtKey_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - -#define IDxtKey_get_KeyType(This,__MIDL_0028) \ - (This)->lpVtbl -> get_KeyType(This,__MIDL_0028) - -#define IDxtKey_put_KeyType(This,__MIDL_0029) \ - (This)->lpVtbl -> put_KeyType(This,__MIDL_0029) - -#define IDxtKey_get_Hue(This,__MIDL_0030) \ - (This)->lpVtbl -> get_Hue(This,__MIDL_0030) - -#define IDxtKey_put_Hue(This,__MIDL_0031) \ - (This)->lpVtbl -> put_Hue(This,__MIDL_0031) - -#define IDxtKey_get_Luminance(This,__MIDL_0032) \ - (This)->lpVtbl -> get_Luminance(This,__MIDL_0032) - -#define IDxtKey_put_Luminance(This,__MIDL_0033) \ - (This)->lpVtbl -> put_Luminance(This,__MIDL_0033) - -#define IDxtKey_get_RGB(This,__MIDL_0034) \ - (This)->lpVtbl -> get_RGB(This,__MIDL_0034) - -#define IDxtKey_put_RGB(This,__MIDL_0035) \ - (This)->lpVtbl -> put_RGB(This,__MIDL_0035) - -#define IDxtKey_get_Similarity(This,__MIDL_0036) \ - (This)->lpVtbl -> get_Similarity(This,__MIDL_0036) - -#define IDxtKey_put_Similarity(This,__MIDL_0037) \ - (This)->lpVtbl -> put_Similarity(This,__MIDL_0037) - -#define IDxtKey_get_Invert(This,__MIDL_0038) \ - (This)->lpVtbl -> get_Invert(This,__MIDL_0038) - -#define IDxtKey_put_Invert(This,__MIDL_0039) \ - (This)->lpVtbl -> put_Invert(This,__MIDL_0039) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_KeyType_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0028); - - -void __RPC_STUB IDxtKey_get_KeyType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_KeyType_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0029); - - -void __RPC_STUB IDxtKey_put_KeyType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Hue_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0030); - - -void __RPC_STUB IDxtKey_get_Hue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Hue_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0031); - - -void __RPC_STUB IDxtKey_put_Hue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Luminance_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0032); - - -void __RPC_STUB IDxtKey_get_Luminance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Luminance_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0033); - - -void __RPC_STUB IDxtKey_put_Luminance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_RGB_Proxy( - IDxtKey * This, - /* [retval][out] */ DWORD *__MIDL_0034); - - -void __RPC_STUB IDxtKey_get_RGB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_RGB_Proxy( - IDxtKey * This, - /* [in] */ DWORD __MIDL_0035); - - -void __RPC_STUB IDxtKey_put_RGB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Similarity_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0036); - - -void __RPC_STUB IDxtKey_get_Similarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Similarity_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0037); - - -void __RPC_STUB IDxtKey_put_Similarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Invert_Proxy( - IDxtKey * This, - /* [retval][out] */ BOOL *__MIDL_0038); - - -void __RPC_STUB IDxtKey_get_Invert_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Invert_Proxy( - IDxtKey * This, - /* [in] */ BOOL __MIDL_0039); - - -void __RPC_STUB IDxtKey_put_Invert_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDxtKey_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaLocator_INTERFACE_DEFINED__ -#define __IMediaLocator_INTERFACE_DEFINED__ - -/* interface IMediaLocator */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IMediaLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("288581E0-66CE-11d2-918F-00C0DF10D434") - IMediaLocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE FindMediaFile( - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddFoundLocation( - BSTR DirectoryName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaLocator * This); - - HRESULT ( STDMETHODCALLTYPE *FindMediaFile )( - IMediaLocator * This, - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags); - - HRESULT ( STDMETHODCALLTYPE *AddFoundLocation )( - IMediaLocator * This, - BSTR DirectoryName); - - END_INTERFACE - } IMediaLocatorVtbl; - - interface IMediaLocator - { - CONST_VTBL struct IMediaLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaLocator_FindMediaFile(This,Input,FilterString,pOutput,Flags) \ - (This)->lpVtbl -> FindMediaFile(This,Input,FilterString,pOutput,Flags) - -#define IMediaLocator_AddFoundLocation(This,DirectoryName) \ - (This)->lpVtbl -> AddFoundLocation(This,DirectoryName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaLocator_FindMediaFile_Proxy( - IMediaLocator * This, - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags); - - -void __RPC_STUB IMediaLocator_FindMediaFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaLocator_AddFoundLocation_Proxy( - IMediaLocator * This, - BSTR DirectoryName); - - -void __RPC_STUB IMediaLocator_AddFoundLocation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaDet_INTERFACE_DEFINED__ -#define __IMediaDet_INTERFACE_DEFINED__ - -/* interface IMediaDet */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IMediaDet; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA") - IMediaDet : public IUnknown - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filter( - /* [retval][out] */ IUnknown **pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filter( - /* [in] */ IUnknown *newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OutputStreams( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentStream( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentStream( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( - /* [retval][out] */ GUID *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamTypeB( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamLength( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filename( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filename( - /* [in] */ BSTR newVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetBitmapBits( - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteBitmapBits( - double StreamTime, - long Width, - long Height, - BSTR Filename) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamMediaType( - /* [retval][out] */ AM_MEDIA_TYPE *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSampleGrabber( - /* [out] */ ISampleGrabber **ppVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrameRate( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnterBitmapGrabMode( - double SeekTime) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaDetVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaDet * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaDet * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaDet * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filter )( - IMediaDet * This, - /* [retval][out] */ IUnknown **pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filter )( - IMediaDet * This, - /* [in] */ IUnknown *newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OutputStreams )( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentStream )( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CurrentStream )( - IMediaDet * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IMediaDet * This, - /* [retval][out] */ GUID *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamTypeB )( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamLength )( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filename )( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filename )( - IMediaDet * This, - /* [in] */ BSTR newVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetBitmapBits )( - IMediaDet * This, - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteBitmapBits )( - IMediaDet * This, - double StreamTime, - long Width, - long Height, - BSTR Filename); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamMediaType )( - IMediaDet * This, - /* [retval][out] */ AM_MEDIA_TYPE *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSampleGrabber )( - IMediaDet * This, - /* [out] */ ISampleGrabber **ppVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrameRate )( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EnterBitmapGrabMode )( - IMediaDet * This, - double SeekTime); - - END_INTERFACE - } IMediaDetVtbl; - - interface IMediaDet - { - CONST_VTBL struct IMediaDetVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaDet_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaDet_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaDet_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaDet_get_Filter(This,pVal) \ - (This)->lpVtbl -> get_Filter(This,pVal) - -#define IMediaDet_put_Filter(This,newVal) \ - (This)->lpVtbl -> put_Filter(This,newVal) - -#define IMediaDet_get_OutputStreams(This,pVal) \ - (This)->lpVtbl -> get_OutputStreams(This,pVal) - -#define IMediaDet_get_CurrentStream(This,pVal) \ - (This)->lpVtbl -> get_CurrentStream(This,pVal) - -#define IMediaDet_put_CurrentStream(This,newVal) \ - (This)->lpVtbl -> put_CurrentStream(This,newVal) - -#define IMediaDet_get_StreamType(This,pVal) \ - (This)->lpVtbl -> get_StreamType(This,pVal) - -#define IMediaDet_get_StreamTypeB(This,pVal) \ - (This)->lpVtbl -> get_StreamTypeB(This,pVal) - -#define IMediaDet_get_StreamLength(This,pVal) \ - (This)->lpVtbl -> get_StreamLength(This,pVal) - -#define IMediaDet_get_Filename(This,pVal) \ - (This)->lpVtbl -> get_Filename(This,pVal) - -#define IMediaDet_put_Filename(This,newVal) \ - (This)->lpVtbl -> put_Filename(This,newVal) - -#define IMediaDet_GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) \ - (This)->lpVtbl -> GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) - -#define IMediaDet_WriteBitmapBits(This,StreamTime,Width,Height,Filename) \ - (This)->lpVtbl -> WriteBitmapBits(This,StreamTime,Width,Height,Filename) - -#define IMediaDet_get_StreamMediaType(This,pVal) \ - (This)->lpVtbl -> get_StreamMediaType(This,pVal) - -#define IMediaDet_GetSampleGrabber(This,ppVal) \ - (This)->lpVtbl -> GetSampleGrabber(This,ppVal) - -#define IMediaDet_get_FrameRate(This,pVal) \ - (This)->lpVtbl -> get_FrameRate(This,pVal) - -#define IMediaDet_EnterBitmapGrabMode(This,SeekTime) \ - (This)->lpVtbl -> EnterBitmapGrabMode(This,SeekTime) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filter_Proxy( - IMediaDet * This, - /* [retval][out] */ IUnknown **pVal); - - -void __RPC_STUB IMediaDet_get_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filter_Proxy( - IMediaDet * This, - /* [in] */ IUnknown *newVal); - - -void __RPC_STUB IMediaDet_put_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_OutputStreams_Proxy( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IMediaDet_get_OutputStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_CurrentStream_Proxy( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - -void __RPC_STUB IMediaDet_get_CurrentStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_CurrentStream_Proxy( - IMediaDet * This, - /* [in] */ long newVal); - - -void __RPC_STUB IMediaDet_put_CurrentStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamType_Proxy( - IMediaDet * This, - /* [retval][out] */ GUID *pVal); - - -void __RPC_STUB IMediaDet_get_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamTypeB_Proxy( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IMediaDet_get_StreamTypeB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamLength_Proxy( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - -void __RPC_STUB IMediaDet_get_StreamLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filename_Proxy( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IMediaDet_get_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filename_Proxy( - IMediaDet * This, - /* [in] */ BSTR newVal); - - -void __RPC_STUB IMediaDet_put_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetBitmapBits_Proxy( - IMediaDet * This, - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height); - - -void __RPC_STUB IMediaDet_GetBitmapBits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_WriteBitmapBits_Proxy( - IMediaDet * This, - double StreamTime, - long Width, - long Height, - BSTR Filename); - - -void __RPC_STUB IMediaDet_WriteBitmapBits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamMediaType_Proxy( - IMediaDet * This, - /* [retval][out] */ AM_MEDIA_TYPE *pVal); - - -void __RPC_STUB IMediaDet_get_StreamMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetSampleGrabber_Proxy( - IMediaDet * This, - /* [out] */ ISampleGrabber **ppVal); - - -void __RPC_STUB IMediaDet_GetSampleGrabber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_FrameRate_Proxy( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - -void __RPC_STUB IMediaDet_get_FrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_EnterBitmapGrabMode_Proxy( - IMediaDet * This, - double SeekTime); - - -void __RPC_STUB IMediaDet_EnterBitmapGrabMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaDet_INTERFACE_DEFINED__ */ - - -#ifndef __IGrfCache_INTERFACE_DEFINED__ -#define __IGrfCache_INTERFACE_DEFINED__ - -/* interface IGrfCache */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IGrfCache; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BE-B0C3-11D2-8D24-00A0C9441E20") - IGrfCache : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddFilter( - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ConnectPins( - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetGraph( - const IGraphBuilder *pGraph) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DoConnectionsNow( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGrfCacheVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGrfCache * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGrfCache * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGrfCache * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IGrfCache * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IGrfCache * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IGrfCache * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IGrfCache * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ConnectPins )( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetGraph )( - IGrfCache * This, - const IGraphBuilder *pGraph); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DoConnectionsNow )( - IGrfCache * This); - - END_INTERFACE - } IGrfCacheVtbl; - - interface IGrfCache - { - CONST_VTBL struct IGrfCacheVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGrfCache_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IGrfCache_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IGrfCache_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IGrfCache_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IGrfCache_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IGrfCache_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IGrfCache_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IGrfCache_AddFilter(This,ChainedCache,ID,pFilter,pName) \ - (This)->lpVtbl -> AddFilter(This,ChainedCache,ID,pFilter,pName) - -#define IGrfCache_ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) \ - (This)->lpVtbl -> ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) - -#define IGrfCache_SetGraph(This,pGraph) \ - (This)->lpVtbl -> SetGraph(This,pGraph) - -#define IGrfCache_DoConnectionsNow(This) \ - (This)->lpVtbl -> DoConnectionsNow(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_AddFilter_Proxy( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName); - - -void __RPC_STUB IGrfCache_AddFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_ConnectPins_Proxy( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2); - - -void __RPC_STUB IGrfCache_ConnectPins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_SetGraph_Proxy( - IGrfCache * This, - const IGraphBuilder *pGraph); - - -void __RPC_STUB IGrfCache_SetGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_DoConnectionsNow_Proxy( - IGrfCache * This); - - -void __RPC_STUB IGrfCache_DoConnectionsNow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IGrfCache_INTERFACE_DEFINED__ */ - - -#ifndef __IRenderEngine_INTERFACE_DEFINED__ -#define __IRenderEngine_INTERFACE_DEFINED__ - -/* interface IRenderEngine */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IRenderEngine; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6BEE3A81-66C9-11d2-918F-00C0DF10D434") - IRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetTimelineObject( - IAMTimeline *pTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineObject( - /* [out] */ IAMTimeline **ppTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilterGraph( - /* [out] */ IGraphBuilder **ppFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFilterGraph( - IGraphBuilder *pFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupOutputPin( - long Group, - /* [out] */ IPin **ppRenderPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ScrapIt( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderOutputPins( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVendorString( - /* [retval][out] */ BSTR *pVendorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectFrontEnd( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceConnectCallback( - IGrfCache *pCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDynamicReconnectLevel( - long Level) = 0; - - virtual HRESULT STDMETHODCALLTYPE DoSmartRecompression( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE UseInSmartRecompressionGraph( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceNameValidation( - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Decommit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCaps( - long Index, - long *pReturn) = 0; - - }; - -#else /* C style interface */ - - typedef struct IRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRenderEngine * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetTimelineObject )( - IRenderEngine * This, - IAMTimeline *pTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineObject )( - IRenderEngine * This, - /* [out] */ IAMTimeline **ppTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetFilterGraph )( - IRenderEngine * This, - /* [out] */ IGraphBuilder **ppFG); - - HRESULT ( STDMETHODCALLTYPE *SetFilterGraph )( - IRenderEngine * This, - IGraphBuilder *pFG); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *GetGroupOutputPin )( - IRenderEngine * This, - long Group, - /* [out] */ IPin **ppRenderPin); - - HRESULT ( STDMETHODCALLTYPE *ScrapIt )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *RenderOutputPins )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetVendorString )( - IRenderEngine * This, - /* [retval][out] */ BSTR *pVendorID); - - HRESULT ( STDMETHODCALLTYPE *ConnectFrontEnd )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceConnectCallback )( - IRenderEngine * This, - IGrfCache *pCallback); - - HRESULT ( STDMETHODCALLTYPE *SetDynamicReconnectLevel )( - IRenderEngine * This, - long Level); - - HRESULT ( STDMETHODCALLTYPE *DoSmartRecompression )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *UseInSmartRecompressionGraph )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceNameValidation )( - IRenderEngine * This, - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *Decommit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetCaps )( - IRenderEngine * This, - long Index, - long *pReturn); - - END_INTERFACE - } IRenderEngineVtbl; - - interface IRenderEngine - { - CONST_VTBL struct IRenderEngineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IRenderEngine_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IRenderEngine_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IRenderEngine_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IRenderEngine_SetTimelineObject(This,pTimeline) \ - (This)->lpVtbl -> SetTimelineObject(This,pTimeline) - -#define IRenderEngine_GetTimelineObject(This,ppTimeline) \ - (This)->lpVtbl -> GetTimelineObject(This,ppTimeline) - -#define IRenderEngine_GetFilterGraph(This,ppFG) \ - (This)->lpVtbl -> GetFilterGraph(This,ppFG) - -#define IRenderEngine_SetFilterGraph(This,pFG) \ - (This)->lpVtbl -> SetFilterGraph(This,pFG) - -#define IRenderEngine_SetInterestRange(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange(This,Start,Stop) - -#define IRenderEngine_SetInterestRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange2(This,Start,Stop) - -#define IRenderEngine_SetRenderRange(This,Start,Stop) \ - (This)->lpVtbl -> SetRenderRange(This,Start,Stop) - -#define IRenderEngine_SetRenderRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetRenderRange2(This,Start,Stop) - -#define IRenderEngine_GetGroupOutputPin(This,Group,ppRenderPin) \ - (This)->lpVtbl -> GetGroupOutputPin(This,Group,ppRenderPin) - -#define IRenderEngine_ScrapIt(This) \ - (This)->lpVtbl -> ScrapIt(This) - -#define IRenderEngine_RenderOutputPins(This) \ - (This)->lpVtbl -> RenderOutputPins(This) - -#define IRenderEngine_GetVendorString(This,pVendorID) \ - (This)->lpVtbl -> GetVendorString(This,pVendorID) - -#define IRenderEngine_ConnectFrontEnd(This) \ - (This)->lpVtbl -> ConnectFrontEnd(This) - -#define IRenderEngine_SetSourceConnectCallback(This,pCallback) \ - (This)->lpVtbl -> SetSourceConnectCallback(This,pCallback) - -#define IRenderEngine_SetDynamicReconnectLevel(This,Level) \ - (This)->lpVtbl -> SetDynamicReconnectLevel(This,Level) - -#define IRenderEngine_DoSmartRecompression(This) \ - (This)->lpVtbl -> DoSmartRecompression(This) - -#define IRenderEngine_UseInSmartRecompressionGraph(This) \ - (This)->lpVtbl -> UseInSmartRecompressionGraph(This) - -#define IRenderEngine_SetSourceNameValidation(This,FilterString,pOverride,Flags) \ - (This)->lpVtbl -> SetSourceNameValidation(This,FilterString,pOverride,Flags) - -#define IRenderEngine_Commit(This) \ - (This)->lpVtbl -> Commit(This) - -#define IRenderEngine_Decommit(This) \ - (This)->lpVtbl -> Decommit(This) - -#define IRenderEngine_GetCaps(This,Index,pReturn) \ - (This)->lpVtbl -> GetCaps(This,Index,pReturn) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetTimelineObject_Proxy( - IRenderEngine * This, - IAMTimeline *pTimeline); - - -void __RPC_STUB IRenderEngine_SetTimelineObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_GetTimelineObject_Proxy( - IRenderEngine * This, - /* [out] */ IAMTimeline **ppTimeline); - - -void __RPC_STUB IRenderEngine_GetTimelineObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_GetFilterGraph_Proxy( - IRenderEngine * This, - /* [out] */ IGraphBuilder **ppFG); - - -void __RPC_STUB IRenderEngine_GetFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetFilterGraph_Proxy( - IRenderEngine * This, - IGraphBuilder *pFG); - - -void __RPC_STUB IRenderEngine_SetFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange_Proxy( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IRenderEngine_SetInterestRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange2_Proxy( - IRenderEngine * This, - double Start, - double Stop); - - -void __RPC_STUB IRenderEngine_SetInterestRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange_Proxy( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IRenderEngine_SetRenderRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange2_Proxy( - IRenderEngine * This, - double Start, - double Stop); - - -void __RPC_STUB IRenderEngine_SetRenderRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_GetGroupOutputPin_Proxy( - IRenderEngine * This, - long Group, - /* [out] */ IPin **ppRenderPin); - - -void __RPC_STUB IRenderEngine_GetGroupOutputPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_ScrapIt_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_ScrapIt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_RenderOutputPins_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_RenderOutputPins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_GetVendorString_Proxy( - IRenderEngine * This, - /* [retval][out] */ BSTR *pVendorID); - - -void __RPC_STUB IRenderEngine_GetVendorString_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_ConnectFrontEnd_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_ConnectFrontEnd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceConnectCallback_Proxy( - IRenderEngine * This, - IGrfCache *pCallback); - - -void __RPC_STUB IRenderEngine_SetSourceConnectCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetDynamicReconnectLevel_Proxy( - IRenderEngine * This, - long Level); - - -void __RPC_STUB IRenderEngine_SetDynamicReconnectLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_DoSmartRecompression_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_DoSmartRecompression_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_UseInSmartRecompressionGraph_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_UseInSmartRecompressionGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceNameValidation_Proxy( - IRenderEngine * This, - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags); - - -void __RPC_STUB IRenderEngine_SetSourceNameValidation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_Commit_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_Commit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_Decommit_Proxy( - IRenderEngine * This); - - -void __RPC_STUB IRenderEngine_Decommit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IRenderEngine_GetCaps_Proxy( - IRenderEngine * This, - long Index, - long *pReturn); - - -void __RPC_STUB IRenderEngine_GetCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IRenderEngine_INTERFACE_DEFINED__ */ - - -#ifndef __IFindCompressorCB_INTERFACE_DEFINED__ -#define __IFindCompressorCB_INTERFACE_DEFINED__ - -/* interface IFindCompressorCB */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IFindCompressorCB; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8DE-879A-4d59-9B2C-26BB1CF83461") - IFindCompressorCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCompressor( - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFindCompressorCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFindCompressorCB * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFindCompressorCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFindCompressorCB * This); - - HRESULT ( STDMETHODCALLTYPE *GetCompressor )( - IFindCompressorCB * This, - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter); - - END_INTERFACE - } IFindCompressorCBVtbl; - - interface IFindCompressorCB - { - CONST_VTBL struct IFindCompressorCBVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFindCompressorCB_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFindCompressorCB_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFindCompressorCB_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFindCompressorCB_GetCompressor(This,pType,pCompType,ppFilter) \ - (This)->lpVtbl -> GetCompressor(This,pType,pCompType,ppFilter) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFindCompressorCB_GetCompressor_Proxy( - IFindCompressorCB * This, - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter); - - -void __RPC_STUB IFindCompressorCB_GetCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFindCompressorCB_INTERFACE_DEFINED__ */ - - -#ifndef __ISmartRenderEngine_INTERFACE_DEFINED__ -#define __ISmartRenderEngine_INTERFACE_DEFINED__ - -/* interface ISmartRenderEngine */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISmartRenderEngine; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8CE-879A-4d59-9B2C-26BB1CF83461") - ISmartRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetGroupCompressor( - long Group, - IBaseFilter *pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCompressor( - long Group, - IBaseFilter **pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFindCompressorCB( - IFindCompressorCB *pCallback) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISmartRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISmartRenderEngine * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISmartRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISmartRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - IBaseFilter *pCompressor); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - IBaseFilter **pCompressor); - - HRESULT ( STDMETHODCALLTYPE *SetFindCompressorCB )( - ISmartRenderEngine * This, - IFindCompressorCB *pCallback); - - END_INTERFACE - } ISmartRenderEngineVtbl; - - interface ISmartRenderEngine - { - CONST_VTBL struct ISmartRenderEngineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISmartRenderEngine_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISmartRenderEngine_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISmartRenderEngine_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISmartRenderEngine_SetGroupCompressor(This,Group,pCompressor) \ - (This)->lpVtbl -> SetGroupCompressor(This,Group,pCompressor) - -#define ISmartRenderEngine_GetGroupCompressor(This,Group,pCompressor) \ - (This)->lpVtbl -> GetGroupCompressor(This,Group,pCompressor) - -#define ISmartRenderEngine_SetFindCompressorCB(This,pCallback) \ - (This)->lpVtbl -> SetFindCompressorCB(This,pCallback) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetGroupCompressor_Proxy( - ISmartRenderEngine * This, - long Group, - IBaseFilter *pCompressor); - - -void __RPC_STUB ISmartRenderEngine_SetGroupCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISmartRenderEngine_GetGroupCompressor_Proxy( - ISmartRenderEngine * This, - long Group, - IBaseFilter **pCompressor); - - -void __RPC_STUB ISmartRenderEngine_GetGroupCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetFindCompressorCB_Proxy( - ISmartRenderEngine * This, - IFindCompressorCB *pCallback); - - -void __RPC_STUB ISmartRenderEngine_SetFindCompressorCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISmartRenderEngine_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineObj_INTERFACE_DEFINED__ -#define __IAMTimelineObj_INTERFACE_DEFINED__ - -/* interface IAMTimelineObj */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMTimelineObj; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B77-61F9-11D2-8CAD-00A024580902") - IAMTimelineObj : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertySetter( - /* [retval][out] */ IPropertySetter **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPropertySetter( - IPropertySetter *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObject( - /* [retval][out] */ IUnknown **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObject( - IUnknown *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUID( - GUID newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUIDB( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUID( - GUID *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUIDB( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectLoaded( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimelineType( - TIMELINE_MAJOR_TYPE *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimelineType( - TIMELINE_MAJOR_TYPE newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserID( - long newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGenID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserName( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserData( - BYTE *pData, - long *pSize) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserData( - BYTE *pData, - long Size) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMuted( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMuted( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLocked( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLocked( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ClearDirty( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Remove( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveAll( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineNoRef( - IAMTimeline **ppResult) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupIBelongTo( - /* [out] */ IAMTimelineGroup **ppGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEmbedDepth( - long *pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineObjVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineObj * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineObj * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertySetter )( - IAMTimelineObj * This, - /* [retval][out] */ IPropertySetter **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPropertySetter )( - IAMTimelineObj * This, - IPropertySetter *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObject )( - IAMTimelineObj * This, - /* [retval][out] */ IUnknown **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObject )( - IAMTimelineObj * This, - IUnknown *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUID )( - IAMTimelineObj * This, - GUID newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUIDB )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUID )( - IAMTimelineObj * This, - GUID *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUIDB )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectLoaded )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserID )( - IAMTimelineObj * This, - long newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGenID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserName )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserName )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long *pSize); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long Size); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMuted )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMuted )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLocked )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLocked )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ClearDirty )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveAll )( - IAMTimelineObj * This); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineNoRef )( - IAMTimelineObj * This, - IAMTimeline **ppResult); - - HRESULT ( STDMETHODCALLTYPE *GetGroupIBelongTo )( - IAMTimelineObj * This, - /* [out] */ IAMTimelineGroup **ppGroup); - - HRESULT ( STDMETHODCALLTYPE *GetEmbedDepth )( - IAMTimelineObj * This, - long *pVal); - - END_INTERFACE - } IAMTimelineObjVtbl; - - interface IAMTimelineObj - { - CONST_VTBL struct IAMTimelineObjVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineObj_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineObj_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineObj_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineObj_GetStartStop(This,pStart,pStop) \ - (This)->lpVtbl -> GetStartStop(This,pStart,pStop) - -#define IAMTimelineObj_GetStartStop2(This,pStart,pStop) \ - (This)->lpVtbl -> GetStartStop2(This,pStart,pStop) - -#define IAMTimelineObj_FixTimes(This,pStart,pStop) \ - (This)->lpVtbl -> FixTimes(This,pStart,pStop) - -#define IAMTimelineObj_FixTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> FixTimes2(This,pStart,pStop) - -#define IAMTimelineObj_SetStartStop(This,Start,Stop) \ - (This)->lpVtbl -> SetStartStop(This,Start,Stop) - -#define IAMTimelineObj_SetStartStop2(This,Start,Stop) \ - (This)->lpVtbl -> SetStartStop2(This,Start,Stop) - -#define IAMTimelineObj_GetPropertySetter(This,pVal) \ - (This)->lpVtbl -> GetPropertySetter(This,pVal) - -#define IAMTimelineObj_SetPropertySetter(This,newVal) \ - (This)->lpVtbl -> SetPropertySetter(This,newVal) - -#define IAMTimelineObj_GetSubObject(This,pVal) \ - (This)->lpVtbl -> GetSubObject(This,pVal) - -#define IAMTimelineObj_SetSubObject(This,newVal) \ - (This)->lpVtbl -> SetSubObject(This,newVal) - -#define IAMTimelineObj_SetSubObjectGUID(This,newVal) \ - (This)->lpVtbl -> SetSubObjectGUID(This,newVal) - -#define IAMTimelineObj_SetSubObjectGUIDB(This,newVal) \ - (This)->lpVtbl -> SetSubObjectGUIDB(This,newVal) - -#define IAMTimelineObj_GetSubObjectGUID(This,pVal) \ - (This)->lpVtbl -> GetSubObjectGUID(This,pVal) - -#define IAMTimelineObj_GetSubObjectGUIDB(This,pVal) \ - (This)->lpVtbl -> GetSubObjectGUIDB(This,pVal) - -#define IAMTimelineObj_GetSubObjectLoaded(This,pVal) \ - (This)->lpVtbl -> GetSubObjectLoaded(This,pVal) - -#define IAMTimelineObj_GetTimelineType(This,pVal) \ - (This)->lpVtbl -> GetTimelineType(This,pVal) - -#define IAMTimelineObj_SetTimelineType(This,newVal) \ - (This)->lpVtbl -> SetTimelineType(This,newVal) - -#define IAMTimelineObj_GetUserID(This,pVal) \ - (This)->lpVtbl -> GetUserID(This,pVal) - -#define IAMTimelineObj_SetUserID(This,newVal) \ - (This)->lpVtbl -> SetUserID(This,newVal) - -#define IAMTimelineObj_GetGenID(This,pVal) \ - (This)->lpVtbl -> GetGenID(This,pVal) - -#define IAMTimelineObj_GetUserName(This,pVal) \ - (This)->lpVtbl -> GetUserName(This,pVal) - -#define IAMTimelineObj_SetUserName(This,newVal) \ - (This)->lpVtbl -> SetUserName(This,newVal) - -#define IAMTimelineObj_GetUserData(This,pData,pSize) \ - (This)->lpVtbl -> GetUserData(This,pData,pSize) - -#define IAMTimelineObj_SetUserData(This,pData,Size) \ - (This)->lpVtbl -> SetUserData(This,pData,Size) - -#define IAMTimelineObj_GetMuted(This,pVal) \ - (This)->lpVtbl -> GetMuted(This,pVal) - -#define IAMTimelineObj_SetMuted(This,newVal) \ - (This)->lpVtbl -> SetMuted(This,newVal) - -#define IAMTimelineObj_GetLocked(This,pVal) \ - (This)->lpVtbl -> GetLocked(This,pVal) - -#define IAMTimelineObj_SetLocked(This,newVal) \ - (This)->lpVtbl -> SetLocked(This,newVal) - -#define IAMTimelineObj_GetDirtyRange(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) - -#define IAMTimelineObj_GetDirtyRange2(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange2(This,pStart,pStop) - -#define IAMTimelineObj_SetDirtyRange(This,Start,Stop) \ - (This)->lpVtbl -> SetDirtyRange(This,Start,Stop) - -#define IAMTimelineObj_SetDirtyRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetDirtyRange2(This,Start,Stop) - -#define IAMTimelineObj_ClearDirty(This) \ - (This)->lpVtbl -> ClearDirty(This) - -#define IAMTimelineObj_Remove(This) \ - (This)->lpVtbl -> Remove(This) - -#define IAMTimelineObj_RemoveAll(This) \ - (This)->lpVtbl -> RemoveAll(This) - -#define IAMTimelineObj_GetTimelineNoRef(This,ppResult) \ - (This)->lpVtbl -> GetTimelineNoRef(This,ppResult) - -#define IAMTimelineObj_GetGroupIBelongTo(This,ppGroup) \ - (This)->lpVtbl -> GetGroupIBelongTo(This,ppGroup) - -#define IAMTimelineObj_GetEmbedDepth(This,pVal) \ - (This)->lpVtbl -> GetEmbedDepth(This,pVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimelineObj_GetStartStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - -void __RPC_STUB IAMTimelineObj_GetStartStop2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimelineObj_FixTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - -void __RPC_STUB IAMTimelineObj_FixTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IAMTimelineObj_SetStartStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop2_Proxy( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - -void __RPC_STUB IAMTimelineObj_SetStartStop2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetPropertySetter_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ IPropertySetter **pVal); - - -void __RPC_STUB IAMTimelineObj_GetPropertySetter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetPropertySetter_Proxy( - IAMTimelineObj * This, - IPropertySetter *newVal); - - -void __RPC_STUB IAMTimelineObj_SetPropertySetter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObject_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ IUnknown **pVal); - - -void __RPC_STUB IAMTimelineObj_GetSubObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObject_Proxy( - IAMTimelineObj * This, - IUnknown *newVal); - - -void __RPC_STUB IAMTimelineObj_SetSubObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUID_Proxy( - IAMTimelineObj * This, - GUID newVal); - - -void __RPC_STUB IAMTimelineObj_SetSubObjectGUID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUIDB_Proxy( - IAMTimelineObj * This, - BSTR newVal); - - -void __RPC_STUB IAMTimelineObj_SetSubObjectGUIDB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUID_Proxy( - IAMTimelineObj * This, - GUID *pVal); - - -void __RPC_STUB IAMTimelineObj_GetSubObjectGUID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUIDB_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IAMTimelineObj_GetSubObjectGUIDB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectLoaded_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineObj_GetSubObjectLoaded_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineType_Proxy( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE *pVal); - - -void __RPC_STUB IAMTimelineObj_GetTimelineType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetTimelineType_Proxy( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE newVal); - - -void __RPC_STUB IAMTimelineObj_SetTimelineType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserID_Proxy( - IAMTimelineObj * This, - long *pVal); - - -void __RPC_STUB IAMTimelineObj_GetUserID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserID_Proxy( - IAMTimelineObj * This, - long newVal); - - -void __RPC_STUB IAMTimelineObj_SetUserID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGenID_Proxy( - IAMTimelineObj * This, - long *pVal); - - -void __RPC_STUB IAMTimelineObj_GetGenID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserName_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IAMTimelineObj_GetUserName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserName_Proxy( - IAMTimelineObj * This, - BSTR newVal); - - -void __RPC_STUB IAMTimelineObj_SetUserName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserData_Proxy( - IAMTimelineObj * This, - BYTE *pData, - long *pSize); - - -void __RPC_STUB IAMTimelineObj_GetUserData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserData_Proxy( - IAMTimelineObj * This, - BYTE *pData, - long Size); - - -void __RPC_STUB IAMTimelineObj_SetUserData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetMuted_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineObj_GetMuted_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetMuted_Proxy( - IAMTimelineObj * This, - BOOL newVal); - - -void __RPC_STUB IAMTimelineObj_SetMuted_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetLocked_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineObj_GetLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetLocked_Proxy( - IAMTimelineObj * This, - BOOL newVal); - - -void __RPC_STUB IAMTimelineObj_SetLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimelineObj_GetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - -void __RPC_STUB IAMTimelineObj_GetDirtyRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IAMTimelineObj_SetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange2_Proxy( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - -void __RPC_STUB IAMTimelineObj_SetDirtyRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_ClearDirty_Proxy( - IAMTimelineObj * This); - - -void __RPC_STUB IAMTimelineObj_ClearDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_Remove_Proxy( - IAMTimelineObj * This); - - -void __RPC_STUB IAMTimelineObj_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_RemoveAll_Proxy( - IAMTimelineObj * This); - - -void __RPC_STUB IAMTimelineObj_RemoveAll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineNoRef_Proxy( - IAMTimelineObj * This, - IAMTimeline **ppResult); - - -void __RPC_STUB IAMTimelineObj_GetTimelineNoRef_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGroupIBelongTo_Proxy( - IAMTimelineObj * This, - /* [out] */ IAMTimelineGroup **ppGroup); - - -void __RPC_STUB IAMTimelineObj_GetGroupIBelongTo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetEmbedDepth_Proxy( - IAMTimelineObj * This, - long *pVal); - - -void __RPC_STUB IAMTimelineObj_GetEmbedDepth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineObj_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineEffectable_INTERFACE_DEFINED__ -#define __IAMTimelineEffectable_INTERFACE_DEFINED__ - -/* interface IAMTimelineEffectable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineEffectable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58537-622E-11d2-8CAD-00A024580902") - IAMTimelineEffectable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectInsBefore( - IAMTimelineObj *pFX, - long priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectSwapPriorities( - long PriorityA, - long PriorityB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetCount( - long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEffect( - /* [out] */ IAMTimelineObj **ppFx, - long Which) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineEffectableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffectable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffectable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffectable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectInsBefore )( - IAMTimelineEffectable * This, - IAMTimelineObj *pFX, - long priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectSwapPriorities )( - IAMTimelineEffectable * This, - long PriorityA, - long PriorityB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetCount )( - IAMTimelineEffectable * This, - long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetEffect )( - IAMTimelineEffectable * This, - /* [out] */ IAMTimelineObj **ppFx, - long Which); - - END_INTERFACE - } IAMTimelineEffectableVtbl; - - interface IAMTimelineEffectable - { - CONST_VTBL struct IAMTimelineEffectableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineEffectable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineEffectable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineEffectable_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineEffectable_EffectInsBefore(This,pFX,priority) \ - (This)->lpVtbl -> EffectInsBefore(This,pFX,priority) - -#define IAMTimelineEffectable_EffectSwapPriorities(This,PriorityA,PriorityB) \ - (This)->lpVtbl -> EffectSwapPriorities(This,PriorityA,PriorityB) - -#define IAMTimelineEffectable_EffectGetCount(This,pCount) \ - (This)->lpVtbl -> EffectGetCount(This,pCount) - -#define IAMTimelineEffectable_GetEffect(This,ppFx,Which) \ - (This)->lpVtbl -> GetEffect(This,ppFx,Which) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectInsBefore_Proxy( - IAMTimelineEffectable * This, - IAMTimelineObj *pFX, - long priority); - - -void __RPC_STUB IAMTimelineEffectable_EffectInsBefore_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectSwapPriorities_Proxy( - IAMTimelineEffectable * This, - long PriorityA, - long PriorityB); - - -void __RPC_STUB IAMTimelineEffectable_EffectSwapPriorities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectGetCount_Proxy( - IAMTimelineEffectable * This, - long *pCount); - - -void __RPC_STUB IAMTimelineEffectable_EffectGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_GetEffect_Proxy( - IAMTimelineEffectable * This, - /* [out] */ IAMTimelineObj **ppFx, - long Which); - - -void __RPC_STUB IAMTimelineEffectable_GetEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineEffectable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineEffect_INTERFACE_DEFINED__ -#define __IAMTimelineEffect_INTERFACE_DEFINED__ - -/* interface IAMTimelineEffect */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineEffect; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C264-622D-11d2-8CAD-00A024580902") - IAMTimelineEffect : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetPriority( - long *pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineEffectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffect * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffect * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffect * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetPriority )( - IAMTimelineEffect * This, - long *pVal); - - END_INTERFACE - } IAMTimelineEffectVtbl; - - interface IAMTimelineEffect - { - CONST_VTBL struct IAMTimelineEffectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineEffect_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineEffect_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineEffect_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineEffect_EffectGetPriority(This,pVal) \ - (This)->lpVtbl -> EffectGetPriority(This,pVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffect_EffectGetPriority_Proxy( - IAMTimelineEffect * This, - long *pVal); - - -void __RPC_STUB IAMTimelineEffect_EffectGetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineEffect_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTransable_INTERFACE_DEFINED__ -#define __IAMTimelineTransable_INTERFACE_DEFINED__ - -/* interface IAMTimelineTransable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTransable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("378FA386-622E-11d2-8CAD-00A024580902") - IAMTimelineTransable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransAdd( - IAMTimelineObj *pTrans) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransGetCount( - long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans( - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans2( - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime( - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime2( - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTransableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTransable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTransable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTransable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransAdd )( - IAMTimelineTransable * This, - IAMTimelineObj *pTrans); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransGetCount )( - IAMTimelineTransable * This, - long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans2 )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime2 )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection); - - END_INTERFACE - } IAMTimelineTransableVtbl; - - interface IAMTimelineTransable - { - CONST_VTBL struct IAMTimelineTransableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTransable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineTransable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineTransable_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineTransable_TransAdd(This,pTrans) \ - (This)->lpVtbl -> TransAdd(This,pTrans) - -#define IAMTimelineTransable_TransGetCount(This,pCount) \ - (This)->lpVtbl -> TransGetCount(This,pCount) - -#define IAMTimelineTransable_GetNextTrans(This,ppTrans,pInOut) \ - (This)->lpVtbl -> GetNextTrans(This,ppTrans,pInOut) - -#define IAMTimelineTransable_GetNextTrans2(This,ppTrans,pInOut) \ - (This)->lpVtbl -> GetNextTrans2(This,ppTrans,pInOut) - -#define IAMTimelineTransable_GetTransAtTime(This,ppObj,Time,SearchDirection) \ - (This)->lpVtbl -> GetTransAtTime(This,ppObj,Time,SearchDirection) - -#define IAMTimelineTransable_GetTransAtTime2(This,ppObj,Time,SearchDirection) \ - (This)->lpVtbl -> GetTransAtTime2(This,ppObj,Time,SearchDirection) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransAdd_Proxy( - IAMTimelineTransable * This, - IAMTimelineObj *pTrans); - - -void __RPC_STUB IAMTimelineTransable_TransAdd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransGetCount_Proxy( - IAMTimelineTransable * This, - long *pCount); - - -void __RPC_STUB IAMTimelineTransable_TransGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut); - - -void __RPC_STUB IAMTimelineTransable_GetNextTrans_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans2_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut); - - -void __RPC_STUB IAMTimelineTransable_GetNextTrans2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection); - - -void __RPC_STUB IAMTimelineTransable_GetTransAtTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime2_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection); - - -void __RPC_STUB IAMTimelineTransable_GetTransAtTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineTransable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineSplittable_INTERFACE_DEFINED__ -#define __IAMTimelineSplittable_INTERFACE_DEFINED__ - -/* interface IAMTimelineSplittable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineSplittable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A0F840A0-D590-11d2-8D55-00A0C9441E20") - IAMTimelineSplittable : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SplitAt( - REFERENCE_TIME Time) = 0; - - virtual HRESULT STDMETHODCALLTYPE SplitAt2( - REFTIME Time) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineSplittableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSplittable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSplittable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSplittable * This); - - HRESULT ( STDMETHODCALLTYPE *SplitAt )( - IAMTimelineSplittable * This, - REFERENCE_TIME Time); - - HRESULT ( STDMETHODCALLTYPE *SplitAt2 )( - IAMTimelineSplittable * This, - REFTIME Time); - - END_INTERFACE - } IAMTimelineSplittableVtbl; - - interface IAMTimelineSplittable - { - CONST_VTBL struct IAMTimelineSplittableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineSplittable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineSplittable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineSplittable_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineSplittable_SplitAt(This,Time) \ - (This)->lpVtbl -> SplitAt(This,Time) - -#define IAMTimelineSplittable_SplitAt2(This,Time) \ - (This)->lpVtbl -> SplitAt2(This,Time) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt_Proxy( - IAMTimelineSplittable * This, - REFERENCE_TIME Time); - - -void __RPC_STUB IAMTimelineSplittable_SplitAt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt2_Proxy( - IAMTimelineSplittable * This, - REFTIME Time); - - -void __RPC_STUB IAMTimelineSplittable_SplitAt2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineSplittable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTrans_INTERFACE_DEFINED__ -#define __IAMTimelineTrans_INTERFACE_DEFINED__ - -/* interface IAMTimelineTrans */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTrans; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C265-622D-11d2-8CAD-00A024580902") - IAMTimelineTrans : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint( - REFERENCE_TIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint2( - REFTIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint( - REFERENCE_TIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint2( - REFTIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSwapInputs( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSwapInputs( - BOOL pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutsOnly( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutsOnly( - BOOL pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTransVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrans * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrans * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrans * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint )( - IAMTimelineTrans * This, - REFERENCE_TIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint2 )( - IAMTimelineTrans * This, - REFTIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint )( - IAMTimelineTrans * This, - REFERENCE_TIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint2 )( - IAMTimelineTrans * This, - REFTIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSwapInputs )( - IAMTimelineTrans * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSwapInputs )( - IAMTimelineTrans * This, - BOOL pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutsOnly )( - IAMTimelineTrans * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutsOnly )( - IAMTimelineTrans * This, - BOOL pVal); - - END_INTERFACE - } IAMTimelineTransVtbl; - - interface IAMTimelineTrans - { - CONST_VTBL struct IAMTimelineTransVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTrans_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineTrans_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineTrans_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineTrans_GetCutPoint(This,pTLTime) \ - (This)->lpVtbl -> GetCutPoint(This,pTLTime) - -#define IAMTimelineTrans_GetCutPoint2(This,pTLTime) \ - (This)->lpVtbl -> GetCutPoint2(This,pTLTime) - -#define IAMTimelineTrans_SetCutPoint(This,TLTime) \ - (This)->lpVtbl -> SetCutPoint(This,TLTime) - -#define IAMTimelineTrans_SetCutPoint2(This,TLTime) \ - (This)->lpVtbl -> SetCutPoint2(This,TLTime) - -#define IAMTimelineTrans_GetSwapInputs(This,pVal) \ - (This)->lpVtbl -> GetSwapInputs(This,pVal) - -#define IAMTimelineTrans_SetSwapInputs(This,pVal) \ - (This)->lpVtbl -> SetSwapInputs(This,pVal) - -#define IAMTimelineTrans_GetCutsOnly(This,pVal) \ - (This)->lpVtbl -> GetCutsOnly(This,pVal) - -#define IAMTimelineTrans_SetCutsOnly(This,pVal) \ - (This)->lpVtbl -> SetCutsOnly(This,pVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint_Proxy( - IAMTimelineTrans * This, - REFERENCE_TIME *pTLTime); - - -void __RPC_STUB IAMTimelineTrans_GetCutPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint2_Proxy( - IAMTimelineTrans * This, - REFTIME *pTLTime); - - -void __RPC_STUB IAMTimelineTrans_GetCutPoint2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint_Proxy( - IAMTimelineTrans * This, - REFERENCE_TIME TLTime); - - -void __RPC_STUB IAMTimelineTrans_SetCutPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint2_Proxy( - IAMTimelineTrans * This, - REFTIME TLTime); - - -void __RPC_STUB IAMTimelineTrans_SetCutPoint2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetSwapInputs_Proxy( - IAMTimelineTrans * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineTrans_GetSwapInputs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetSwapInputs_Proxy( - IAMTimelineTrans * This, - BOOL pVal); - - -void __RPC_STUB IAMTimelineTrans_SetSwapInputs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutsOnly_Proxy( - IAMTimelineTrans * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineTrans_GetCutsOnly_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutsOnly_Proxy( - IAMTimelineTrans * This, - BOOL pVal); - - -void __RPC_STUB IAMTimelineTrans_SetCutsOnly_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineTrans_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineSrc_INTERFACE_DEFINED__ -#define __IAMTimelineSrc_INTERFACE_DEFINED__ - -/* interface IAMTimelineSrc */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineSrc; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B79-61F9-11D2-8CAD-00A024580902") - IAMTimelineSrc : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime( - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime2( - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength( - REFERENCE_TIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength2( - REFTIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength( - REFERENCE_TIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength2( - REFTIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaName( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SpliceWithNext( - IAMTimelineObj *pNext) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStreamNumber( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStreamNumber( - long Val) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsNormalRate( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStretchMode( - int *pnStretchMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStretchMode( - int nStretchMode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineSrcVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSrc * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSrc * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSrc * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime )( - IAMTimelineSrc * This, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime2 )( - IAMTimelineSrc * This, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength )( - IAMTimelineSrc * This, - REFERENCE_TIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength2 )( - IAMTimelineSrc * This, - REFTIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength )( - IAMTimelineSrc * This, - REFERENCE_TIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength2 )( - IAMTimelineSrc * This, - REFTIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaName )( - IAMTimelineSrc * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaName )( - IAMTimelineSrc * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SpliceWithNext )( - IAMTimelineSrc * This, - IAMTimelineObj *pNext); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStreamNumber )( - IAMTimelineSrc * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStreamNumber )( - IAMTimelineSrc * This, - long Val); - - HRESULT ( STDMETHODCALLTYPE *IsNormalRate )( - IAMTimelineSrc * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimelineSrc * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimelineSrc * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStretchMode )( - IAMTimelineSrc * This, - int *pnStretchMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStretchMode )( - IAMTimelineSrc * This, - int nStretchMode); - - END_INTERFACE - } IAMTimelineSrcVtbl; - - interface IAMTimelineSrc - { - CONST_VTBL struct IAMTimelineSrcVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineSrc_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineSrc_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineSrc_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineSrc_GetMediaTimes(This,pStart,pStop) \ - (This)->lpVtbl -> GetMediaTimes(This,pStart,pStop) - -#define IAMTimelineSrc_GetMediaTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> GetMediaTimes2(This,pStart,pStop) - -#define IAMTimelineSrc_ModifyStopTime(This,Stop) \ - (This)->lpVtbl -> ModifyStopTime(This,Stop) - -#define IAMTimelineSrc_ModifyStopTime2(This,Stop) \ - (This)->lpVtbl -> ModifyStopTime2(This,Stop) - -#define IAMTimelineSrc_FixMediaTimes(This,pStart,pStop) \ - (This)->lpVtbl -> FixMediaTimes(This,pStart,pStop) - -#define IAMTimelineSrc_FixMediaTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> FixMediaTimes2(This,pStart,pStop) - -#define IAMTimelineSrc_SetMediaTimes(This,Start,Stop) \ - (This)->lpVtbl -> SetMediaTimes(This,Start,Stop) - -#define IAMTimelineSrc_SetMediaTimes2(This,Start,Stop) \ - (This)->lpVtbl -> SetMediaTimes2(This,Start,Stop) - -#define IAMTimelineSrc_SetMediaLength(This,Length) \ - (This)->lpVtbl -> SetMediaLength(This,Length) - -#define IAMTimelineSrc_SetMediaLength2(This,Length) \ - (This)->lpVtbl -> SetMediaLength2(This,Length) - -#define IAMTimelineSrc_GetMediaLength(This,pLength) \ - (This)->lpVtbl -> GetMediaLength(This,pLength) - -#define IAMTimelineSrc_GetMediaLength2(This,pLength) \ - (This)->lpVtbl -> GetMediaLength2(This,pLength) - -#define IAMTimelineSrc_GetMediaName(This,pVal) \ - (This)->lpVtbl -> GetMediaName(This,pVal) - -#define IAMTimelineSrc_SetMediaName(This,newVal) \ - (This)->lpVtbl -> SetMediaName(This,newVal) - -#define IAMTimelineSrc_SpliceWithNext(This,pNext) \ - (This)->lpVtbl -> SpliceWithNext(This,pNext) - -#define IAMTimelineSrc_GetStreamNumber(This,pVal) \ - (This)->lpVtbl -> GetStreamNumber(This,pVal) - -#define IAMTimelineSrc_SetStreamNumber(This,Val) \ - (This)->lpVtbl -> SetStreamNumber(This,Val) - -#define IAMTimelineSrc_IsNormalRate(This,pVal) \ - (This)->lpVtbl -> IsNormalRate(This,pVal) - -#define IAMTimelineSrc_GetDefaultFPS(This,pFPS) \ - (This)->lpVtbl -> GetDefaultFPS(This,pFPS) - -#define IAMTimelineSrc_SetDefaultFPS(This,FPS) \ - (This)->lpVtbl -> SetDefaultFPS(This,FPS) - -#define IAMTimelineSrc_GetStretchMode(This,pnStretchMode) \ - (This)->lpVtbl -> GetStretchMode(This,pnStretchMode) - -#define IAMTimelineSrc_SetStretchMode(This,nStretchMode) \ - (This)->lpVtbl -> SetStretchMode(This,nStretchMode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimelineSrc_GetMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - -void __RPC_STUB IAMTimelineSrc_GetMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Stop); - - -void __RPC_STUB IAMTimelineSrc_ModifyStopTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime2_Proxy( - IAMTimelineSrc * This, - REFTIME Stop); - - -void __RPC_STUB IAMTimelineSrc_ModifyStopTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimelineSrc_FixMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - -void __RPC_STUB IAMTimelineSrc_FixMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IAMTimelineSrc_SetMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME Start, - REFTIME Stop); - - -void __RPC_STUB IAMTimelineSrc_SetMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Length); - - -void __RPC_STUB IAMTimelineSrc_SetMediaLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength2_Proxy( - IAMTimelineSrc * This, - REFTIME Length); - - -void __RPC_STUB IAMTimelineSrc_SetMediaLength2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pLength); - - -void __RPC_STUB IAMTimelineSrc_GetMediaLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength2_Proxy( - IAMTimelineSrc * This, - REFTIME *pLength); - - -void __RPC_STUB IAMTimelineSrc_GetMediaLength2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaName_Proxy( - IAMTimelineSrc * This, - /* [retval][out] */ BSTR *pVal); - - -void __RPC_STUB IAMTimelineSrc_GetMediaName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaName_Proxy( - IAMTimelineSrc * This, - BSTR newVal); - - -void __RPC_STUB IAMTimelineSrc_SetMediaName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SpliceWithNext_Proxy( - IAMTimelineSrc * This, - IAMTimelineObj *pNext); - - -void __RPC_STUB IAMTimelineSrc_SpliceWithNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStreamNumber_Proxy( - IAMTimelineSrc * This, - long *pVal); - - -void __RPC_STUB IAMTimelineSrc_GetStreamNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStreamNumber_Proxy( - IAMTimelineSrc * This, - long Val); - - -void __RPC_STUB IAMTimelineSrc_SetStreamNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineSrc_IsNormalRate_Proxy( - IAMTimelineSrc * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineSrc_IsNormalRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetDefaultFPS_Proxy( - IAMTimelineSrc * This, - double *pFPS); - - -void __RPC_STUB IAMTimelineSrc_GetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetDefaultFPS_Proxy( - IAMTimelineSrc * This, - double FPS); - - -void __RPC_STUB IAMTimelineSrc_SetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStretchMode_Proxy( - IAMTimelineSrc * This, - int *pnStretchMode); - - -void __RPC_STUB IAMTimelineSrc_GetStretchMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStretchMode_Proxy( - IAMTimelineSrc * This, - int nStretchMode); - - -void __RPC_STUB IAMTimelineSrc_SetStretchMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineSrc_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTrack_INTERFACE_DEFINED__ -#define __IAMTimelineTrack_INTERFACE_DEFINED__ - -/* interface IAMTimelineTrack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTrack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58538-622E-11d2-8CAD-00A024580902") - IAMTimelineTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SrcAdd( - IAMTimelineObj *pSource) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc( - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc2( - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy( - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy2( - REFTIME Start, - REFTIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSourcesCount( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AreYouBlank( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime( - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime2( - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextSrcEx( - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrack * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SrcAdd )( - IAMTimelineTrack * This, - IAMTimelineObj *pSource); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc2 )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy )( - IAMTimelineTrack * This, - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy2 )( - IAMTimelineTrack * This, - REFTIME Start, - REFTIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSourcesCount )( - IAMTimelineTrack * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AreYouBlank )( - IAMTimelineTrack * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime2 )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *GetNextSrcEx )( - IAMTimelineTrack * This, - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext); - - END_INTERFACE - } IAMTimelineTrackVtbl; - - interface IAMTimelineTrack - { - CONST_VTBL struct IAMTimelineTrackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTrack_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineTrack_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineTrack_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineTrack_SrcAdd(This,pSource) \ - (This)->lpVtbl -> SrcAdd(This,pSource) - -#define IAMTimelineTrack_GetNextSrc(This,ppSrc,pInOut) \ - (This)->lpVtbl -> GetNextSrc(This,ppSrc,pInOut) - -#define IAMTimelineTrack_GetNextSrc2(This,ppSrc,pInOut) \ - (This)->lpVtbl -> GetNextSrc2(This,ppSrc,pInOut) - -#define IAMTimelineTrack_MoveEverythingBy(This,Start,MoveBy) \ - (This)->lpVtbl -> MoveEverythingBy(This,Start,MoveBy) - -#define IAMTimelineTrack_MoveEverythingBy2(This,Start,MoveBy) \ - (This)->lpVtbl -> MoveEverythingBy2(This,Start,MoveBy) - -#define IAMTimelineTrack_GetSourcesCount(This,pVal) \ - (This)->lpVtbl -> GetSourcesCount(This,pVal) - -#define IAMTimelineTrack_AreYouBlank(This,pVal) \ - (This)->lpVtbl -> AreYouBlank(This,pVal) - -#define IAMTimelineTrack_GetSrcAtTime(This,ppSrc,Time,SearchDirection) \ - (This)->lpVtbl -> GetSrcAtTime(This,ppSrc,Time,SearchDirection) - -#define IAMTimelineTrack_GetSrcAtTime2(This,ppSrc,Time,SearchDirection) \ - (This)->lpVtbl -> GetSrcAtTime2(This,ppSrc,Time,SearchDirection) - -#define IAMTimelineTrack_InsertSpace(This,rtStart,rtEnd) \ - (This)->lpVtbl -> InsertSpace(This,rtStart,rtEnd) - -#define IAMTimelineTrack_InsertSpace2(This,rtStart,rtEnd) \ - (This)->lpVtbl -> InsertSpace2(This,rtStart,rtEnd) - -#define IAMTimelineTrack_ZeroBetween(This,rtStart,rtEnd) \ - (This)->lpVtbl -> ZeroBetween(This,rtStart,rtEnd) - -#define IAMTimelineTrack_ZeroBetween2(This,rtStart,rtEnd) \ - (This)->lpVtbl -> ZeroBetween2(This,rtStart,rtEnd) - -#define IAMTimelineTrack_GetNextSrcEx(This,pLast,ppNext) \ - (This)->lpVtbl -> GetNextSrcEx(This,pLast,ppNext) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_SrcAdd_Proxy( - IAMTimelineTrack * This, - IAMTimelineObj *pSource); - - -void __RPC_STUB IAMTimelineTrack_SrcAdd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut); - - -void __RPC_STUB IAMTimelineTrack_GetNextSrc_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc2_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut); - - -void __RPC_STUB IAMTimelineTrack_GetNextSrc2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy); - - -void __RPC_STUB IAMTimelineTrack_MoveEverythingBy_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy2_Proxy( - IAMTimelineTrack * This, - REFTIME Start, - REFTIME MoveBy); - - -void __RPC_STUB IAMTimelineTrack_MoveEverythingBy2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSourcesCount_Proxy( - IAMTimelineTrack * This, - long *pVal); - - -void __RPC_STUB IAMTimelineTrack_GetSourcesCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_AreYouBlank_Proxy( - IAMTimelineTrack * This, - long *pVal); - - -void __RPC_STUB IAMTimelineTrack_AreYouBlank_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection); - - -void __RPC_STUB IAMTimelineTrack_GetSrcAtTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime2_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection); - - -void __RPC_STUB IAMTimelineTrack_GetSrcAtTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - -void __RPC_STUB IAMTimelineTrack_InsertSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace2_Proxy( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - -void __RPC_STUB IAMTimelineTrack_InsertSpace2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - -void __RPC_STUB IAMTimelineTrack_ZeroBetween_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween2_Proxy( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - -void __RPC_STUB IAMTimelineTrack_ZeroBetween2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrcEx_Proxy( - IAMTimelineTrack * This, - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext); - - -void __RPC_STUB IAMTimelineTrack_GetNextSrcEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineTrack_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ -#define __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ - -/* interface IAMTimelineVirtualTrack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineVirtualTrack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A8ED5F80-C2C7-11d2-8D39-00A0C9441E20") - IAMTimelineVirtualTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TrackGetPriority( - long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTrackDirty( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineVirtualTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineVirtualTrack * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineVirtualTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineVirtualTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TrackGetPriority )( - IAMTimelineVirtualTrack * This, - long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTrackDirty )( - IAMTimelineVirtualTrack * This); - - END_INTERFACE - } IAMTimelineVirtualTrackVtbl; - - interface IAMTimelineVirtualTrack - { - CONST_VTBL struct IAMTimelineVirtualTrackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineVirtualTrack_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineVirtualTrack_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineVirtualTrack_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineVirtualTrack_TrackGetPriority(This,pPriority) \ - (This)->lpVtbl -> TrackGetPriority(This,pPriority) - -#define IAMTimelineVirtualTrack_SetTrackDirty(This) \ - (This)->lpVtbl -> SetTrackDirty(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_TrackGetPriority_Proxy( - IAMTimelineVirtualTrack * This, - long *pPriority); - - -void __RPC_STUB IAMTimelineVirtualTrack_TrackGetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_SetTrackDirty_Proxy( - IAMTimelineVirtualTrack * This); - - -void __RPC_STUB IAMTimelineVirtualTrack_SetTrackDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineComp_INTERFACE_DEFINED__ -#define __IAMTimelineComp_INTERFACE_DEFINED__ - -/* interface IAMTimelineComp */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineComp; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58536-622E-11d2-8CAD-00A024580902") - IAMTimelineComp : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackInsBefore( - IAMTimelineObj *pVirtualTrack, - long Priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackSwapPriorities( - long VirtualTrackA, - long VirtualTrackB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackGetCount( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetVTrack( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfType( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfTypeI( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextVTrack( - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineCompVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineComp * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineComp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineComp * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackInsBefore )( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - long Priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackSwapPriorities )( - IAMTimelineComp * This, - long VirtualTrackA, - long VirtualTrackB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackGetCount )( - IAMTimelineComp * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetVTrack )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimelineComp * This, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfType )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfTypeI )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *GetNextVTrack )( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack); - - END_INTERFACE - } IAMTimelineCompVtbl; - - interface IAMTimelineComp - { - CONST_VTBL struct IAMTimelineCompVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineComp_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineComp_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineComp_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineComp_VTrackInsBefore(This,pVirtualTrack,Priority) \ - (This)->lpVtbl -> VTrackInsBefore(This,pVirtualTrack,Priority) - -#define IAMTimelineComp_VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) \ - (This)->lpVtbl -> VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) - -#define IAMTimelineComp_VTrackGetCount(This,pVal) \ - (This)->lpVtbl -> VTrackGetCount(This,pVal) - -#define IAMTimelineComp_GetVTrack(This,ppVirtualTrack,Which) \ - (This)->lpVtbl -> GetVTrack(This,ppVirtualTrack,Which) - -#define IAMTimelineComp_GetCountOfType(This,pVal,pValWithComps,MajorType) \ - (This)->lpVtbl -> GetCountOfType(This,pVal,pValWithComps,MajorType) - -#define IAMTimelineComp_GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) \ - (This)->lpVtbl -> GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) - -#define IAMTimelineComp_GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) \ - (This)->lpVtbl -> GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) - -#define IAMTimelineComp_GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) \ - (This)->lpVtbl -> GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackInsBefore_Proxy( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - long Priority); - - -void __RPC_STUB IAMTimelineComp_VTrackInsBefore_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackSwapPriorities_Proxy( - IAMTimelineComp * This, - long VirtualTrackA, - long VirtualTrackB); - - -void __RPC_STUB IAMTimelineComp_VTrackSwapPriorities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackGetCount_Proxy( - IAMTimelineComp * This, - long *pVal); - - -void __RPC_STUB IAMTimelineComp_VTrackGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetVTrack_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which); - - -void __RPC_STUB IAMTimelineComp_GetVTrack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetCountOfType_Proxy( - IAMTimelineComp * This, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - -void __RPC_STUB IAMTimelineComp_GetCountOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfType_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - - -void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfTypeI_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - - -void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfTypeI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetNextVTrack_Proxy( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack); - - -void __RPC_STUB IAMTimelineComp_GetNextVTrack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineComp_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineGroup_INTERFACE_DEFINED__ -#define __IAMTimelineGroup_INTERFACE_DEFINED__ - -/* interface IAMTimelineGroup */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineGroup; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EED4F00-B8A6-11d2-8023-00C0DF10D434") - IAMTimelineGroup : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimeline( - IAMTimeline *pTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimeline( - /* [out] */ IAMTimeline **ppTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPriority( - long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaType( - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaType( - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetGroupName( - BSTR pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGroupName( - /* [retval][out] */ BSTR *pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPreviewMode( - BOOL fPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPreviewMode( - BOOL *pfPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTypeForVB( - /* [in] */ long Val) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputBuffering( - /* [out] */ int *pnBuffer) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputBuffering( - /* [in] */ int nBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSmartRecompressFormat( - long *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSmartRecompressFormat( - long **ppFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSmartRecompressFormatSet( - BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsRecompressFormatDirty( - BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearRecompressFormatDirty( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRecompFormatFromSource( - IAMTimelineSrc *pSource) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineGroupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineGroup * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineGroup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineGroup * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimeline )( - IAMTimelineGroup * This, - IAMTimeline *pTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimeline )( - IAMTimelineGroup * This, - /* [out] */ IAMTimeline **ppTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPriority )( - IAMTimelineGroup * This, - long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IAMTimelineGroup * This, - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IAMTimelineGroup * This, - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputFPS )( - IAMTimelineGroup * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputFPS )( - IAMTimelineGroup * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetGroupName )( - IAMTimelineGroup * This, - BSTR pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGroupName )( - IAMTimelineGroup * This, - /* [retval][out] */ BSTR *pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPreviewMode )( - IAMTimelineGroup * This, - BOOL fPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPreviewMode )( - IAMTimelineGroup * This, - BOOL *pfPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTypeForVB )( - IAMTimelineGroup * This, - /* [in] */ long Val); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputBuffering )( - IAMTimelineGroup * This, - /* [out] */ int *pnBuffer); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputBuffering )( - IAMTimelineGroup * This, - /* [in] */ int nBuffer); - - HRESULT ( STDMETHODCALLTYPE *SetSmartRecompressFormat )( - IAMTimelineGroup * This, - long *pFormat); - - HRESULT ( STDMETHODCALLTYPE *GetSmartRecompressFormat )( - IAMTimelineGroup * This, - long **ppFormat); - - HRESULT ( STDMETHODCALLTYPE *IsSmartRecompressFormatSet )( - IAMTimelineGroup * This, - BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *IsRecompressFormatDirty )( - IAMTimelineGroup * This, - BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *ClearRecompressFormatDirty )( - IAMTimelineGroup * This); - - HRESULT ( STDMETHODCALLTYPE *SetRecompFormatFromSource )( - IAMTimelineGroup * This, - IAMTimelineSrc *pSource); - - END_INTERFACE - } IAMTimelineGroupVtbl; - - interface IAMTimelineGroup - { - CONST_VTBL struct IAMTimelineGroupVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineGroup_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimelineGroup_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimelineGroup_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimelineGroup_SetTimeline(This,pTimeline) \ - (This)->lpVtbl -> SetTimeline(This,pTimeline) - -#define IAMTimelineGroup_GetTimeline(This,ppTimeline) \ - (This)->lpVtbl -> GetTimeline(This,ppTimeline) - -#define IAMTimelineGroup_GetPriority(This,pPriority) \ - (This)->lpVtbl -> GetPriority(This,pPriority) - -#define IAMTimelineGroup_GetMediaType(This,__MIDL_0040) \ - (This)->lpVtbl -> GetMediaType(This,__MIDL_0040) - -#define IAMTimelineGroup_SetMediaType(This,__MIDL_0041) \ - (This)->lpVtbl -> SetMediaType(This,__MIDL_0041) - -#define IAMTimelineGroup_SetOutputFPS(This,FPS) \ - (This)->lpVtbl -> SetOutputFPS(This,FPS) - -#define IAMTimelineGroup_GetOutputFPS(This,pFPS) \ - (This)->lpVtbl -> GetOutputFPS(This,pFPS) - -#define IAMTimelineGroup_SetGroupName(This,pGroupName) \ - (This)->lpVtbl -> SetGroupName(This,pGroupName) - -#define IAMTimelineGroup_GetGroupName(This,pGroupName) \ - (This)->lpVtbl -> GetGroupName(This,pGroupName) - -#define IAMTimelineGroup_SetPreviewMode(This,fPreview) \ - (This)->lpVtbl -> SetPreviewMode(This,fPreview) - -#define IAMTimelineGroup_GetPreviewMode(This,pfPreview) \ - (This)->lpVtbl -> GetPreviewMode(This,pfPreview) - -#define IAMTimelineGroup_SetMediaTypeForVB(This,Val) \ - (This)->lpVtbl -> SetMediaTypeForVB(This,Val) - -#define IAMTimelineGroup_GetOutputBuffering(This,pnBuffer) \ - (This)->lpVtbl -> GetOutputBuffering(This,pnBuffer) - -#define IAMTimelineGroup_SetOutputBuffering(This,nBuffer) \ - (This)->lpVtbl -> SetOutputBuffering(This,nBuffer) - -#define IAMTimelineGroup_SetSmartRecompressFormat(This,pFormat) \ - (This)->lpVtbl -> SetSmartRecompressFormat(This,pFormat) - -#define IAMTimelineGroup_GetSmartRecompressFormat(This,ppFormat) \ - (This)->lpVtbl -> GetSmartRecompressFormat(This,ppFormat) - -#define IAMTimelineGroup_IsSmartRecompressFormatSet(This,pVal) \ - (This)->lpVtbl -> IsSmartRecompressFormatSet(This,pVal) - -#define IAMTimelineGroup_IsRecompressFormatDirty(This,pVal) \ - (This)->lpVtbl -> IsRecompressFormatDirty(This,pVal) - -#define IAMTimelineGroup_ClearRecompressFormatDirty(This) \ - (This)->lpVtbl -> ClearRecompressFormatDirty(This) - -#define IAMTimelineGroup_SetRecompFormatFromSource(This,pSource) \ - (This)->lpVtbl -> SetRecompFormatFromSource(This,pSource) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetTimeline_Proxy( - IAMTimelineGroup * This, - IAMTimeline *pTimeline); - - -void __RPC_STUB IAMTimelineGroup_SetTimeline_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetTimeline_Proxy( - IAMTimelineGroup * This, - /* [out] */ IAMTimeline **ppTimeline); - - -void __RPC_STUB IAMTimelineGroup_GetTimeline_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPriority_Proxy( - IAMTimelineGroup * This, - long *pPriority); - - -void __RPC_STUB IAMTimelineGroup_GetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetMediaType_Proxy( - IAMTimelineGroup * This, - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040); - - -void __RPC_STUB IAMTimelineGroup_GetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaType_Proxy( - IAMTimelineGroup * This, - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041); - - -void __RPC_STUB IAMTimelineGroup_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputFPS_Proxy( - IAMTimelineGroup * This, - double FPS); - - -void __RPC_STUB IAMTimelineGroup_SetOutputFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputFPS_Proxy( - IAMTimelineGroup * This, - double *pFPS); - - -void __RPC_STUB IAMTimelineGroup_GetOutputFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetGroupName_Proxy( - IAMTimelineGroup * This, - BSTR pGroupName); - - -void __RPC_STUB IAMTimelineGroup_SetGroupName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetGroupName_Proxy( - IAMTimelineGroup * This, - /* [retval][out] */ BSTR *pGroupName); - - -void __RPC_STUB IAMTimelineGroup_GetGroupName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetPreviewMode_Proxy( - IAMTimelineGroup * This, - BOOL fPreview); - - -void __RPC_STUB IAMTimelineGroup_SetPreviewMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPreviewMode_Proxy( - IAMTimelineGroup * This, - BOOL *pfPreview); - - -void __RPC_STUB IAMTimelineGroup_GetPreviewMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaTypeForVB_Proxy( - IAMTimelineGroup * This, - /* [in] */ long Val); - - -void __RPC_STUB IAMTimelineGroup_SetMediaTypeForVB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputBuffering_Proxy( - IAMTimelineGroup * This, - /* [out] */ int *pnBuffer); - - -void __RPC_STUB IAMTimelineGroup_GetOutputBuffering_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputBuffering_Proxy( - IAMTimelineGroup * This, - /* [in] */ int nBuffer); - - -void __RPC_STUB IAMTimelineGroup_SetOutputBuffering_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetSmartRecompressFormat_Proxy( - IAMTimelineGroup * This, - long *pFormat); - - -void __RPC_STUB IAMTimelineGroup_SetSmartRecompressFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetSmartRecompressFormat_Proxy( - IAMTimelineGroup * This, - long **ppFormat); - - -void __RPC_STUB IAMTimelineGroup_GetSmartRecompressFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsSmartRecompressFormatSet_Proxy( - IAMTimelineGroup * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineGroup_IsSmartRecompressFormatSet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsRecompressFormatDirty_Proxy( - IAMTimelineGroup * This, - BOOL *pVal); - - -void __RPC_STUB IAMTimelineGroup_IsRecompressFormatDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_ClearRecompressFormatDirty_Proxy( - IAMTimelineGroup * This); - - -void __RPC_STUB IAMTimelineGroup_ClearRecompressFormatDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetRecompFormatFromSource_Proxy( - IAMTimelineGroup * This, - IAMTimelineSrc *pSource); - - -void __RPC_STUB IAMTimelineGroup_SetRecompFormatFromSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimelineGroup_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimeline_INTERFACE_DEFINED__ -#define __IAMTimeline_INTERFACE_DEFINED__ - -/* interface IAMTimeline */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimeline; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B74-61F9-11D2-8CAD-00A024580902") - IAMTimeline : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateEmptyNode( - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddGroup( - IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemGroupFromList( - IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroup( - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCount( - long *pCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearAllGroups( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInsertMode( - long *pMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInsertMode( - long Mode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableTransitions( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransitionsEnabled( - BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableEffects( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectsEnabled( - BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration( - REFERENCE_TIME *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration2( - double *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE IsDirty( - BOOL *pDirty) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual HRESULT STDMETHODCALLTYPE ValidateSourceNames( - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransition( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransition( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffect( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffect( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransitionB( - BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransitionB( - /* [retval][out] */ BSTR *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffectB( - BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffectB( - /* [retval][out] */ BSTR *pGuid) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimeline * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimeline * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimeline * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateEmptyNode )( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *AddGroup )( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *RemGroupFromList )( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroup )( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCount )( - IAMTimeline * This, - long *pCount); - - HRESULT ( STDMETHODCALLTYPE *ClearAllGroups )( - IAMTimeline * This); - - HRESULT ( STDMETHODCALLTYPE *GetInsertMode )( - IAMTimeline * This, - long *pMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInsertMode )( - IAMTimeline * This, - long Mode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableTransitions )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransitionsEnabled )( - IAMTimeline * This, - BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableEffects )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectsEnabled )( - IAMTimeline * This, - BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IAMTimeline * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IAMTimeline * This, - REFERENCE_TIME *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration2 )( - IAMTimeline * This, - double *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimeline * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimeline * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *IsDirty )( - IAMTimeline * This, - BOOL *pDirty); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimeline * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimeline * This, - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - HRESULT ( STDMETHODCALLTYPE *ValidateSourceNames )( - IAMTimeline * This, - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransition )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransition )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffect )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffect )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransitionB )( - IAMTimeline * This, - BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransitionB )( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffectB )( - IAMTimeline * This, - BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffectB )( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - END_INTERFACE - } IAMTimelineVtbl; - - interface IAMTimeline - { - CONST_VTBL struct IAMTimelineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimeline_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimeline_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimeline_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimeline_CreateEmptyNode(This,ppObj,Type) \ - (This)->lpVtbl -> CreateEmptyNode(This,ppObj,Type) - -#define IAMTimeline_AddGroup(This,pGroup) \ - (This)->lpVtbl -> AddGroup(This,pGroup) - -#define IAMTimeline_RemGroupFromList(This,pGroup) \ - (This)->lpVtbl -> RemGroupFromList(This,pGroup) - -#define IAMTimeline_GetGroup(This,ppGroup,WhichGroup) \ - (This)->lpVtbl -> GetGroup(This,ppGroup,WhichGroup) - -#define IAMTimeline_GetGroupCount(This,pCount) \ - (This)->lpVtbl -> GetGroupCount(This,pCount) - -#define IAMTimeline_ClearAllGroups(This) \ - (This)->lpVtbl -> ClearAllGroups(This) - -#define IAMTimeline_GetInsertMode(This,pMode) \ - (This)->lpVtbl -> GetInsertMode(This,pMode) - -#define IAMTimeline_SetInsertMode(This,Mode) \ - (This)->lpVtbl -> SetInsertMode(This,Mode) - -#define IAMTimeline_EnableTransitions(This,fEnabled) \ - (This)->lpVtbl -> EnableTransitions(This,fEnabled) - -#define IAMTimeline_TransitionsEnabled(This,pfEnabled) \ - (This)->lpVtbl -> TransitionsEnabled(This,pfEnabled) - -#define IAMTimeline_EnableEffects(This,fEnabled) \ - (This)->lpVtbl -> EnableEffects(This,fEnabled) - -#define IAMTimeline_EffectsEnabled(This,pfEnabled) \ - (This)->lpVtbl -> EffectsEnabled(This,pfEnabled) - -#define IAMTimeline_SetInterestRange(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange(This,Start,Stop) - -#define IAMTimeline_GetDuration(This,pDuration) \ - (This)->lpVtbl -> GetDuration(This,pDuration) - -#define IAMTimeline_GetDuration2(This,pDuration) \ - (This)->lpVtbl -> GetDuration2(This,pDuration) - -#define IAMTimeline_SetDefaultFPS(This,FPS) \ - (This)->lpVtbl -> SetDefaultFPS(This,FPS) - -#define IAMTimeline_GetDefaultFPS(This,pFPS) \ - (This)->lpVtbl -> GetDefaultFPS(This,pFPS) - -#define IAMTimeline_IsDirty(This,pDirty) \ - (This)->lpVtbl -> IsDirty(This,pDirty) - -#define IAMTimeline_GetDirtyRange(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) - -#define IAMTimeline_GetCountOfType(This,Group,pVal,pValWithComps,MajorType) \ - (This)->lpVtbl -> GetCountOfType(This,Group,pVal,pValWithComps,MajorType) - -#define IAMTimeline_ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) \ - (This)->lpVtbl -> ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) - -#define IAMTimeline_SetDefaultTransition(This,pGuid) \ - (This)->lpVtbl -> SetDefaultTransition(This,pGuid) - -#define IAMTimeline_GetDefaultTransition(This,pGuid) \ - (This)->lpVtbl -> GetDefaultTransition(This,pGuid) - -#define IAMTimeline_SetDefaultEffect(This,pGuid) \ - (This)->lpVtbl -> SetDefaultEffect(This,pGuid) - -#define IAMTimeline_GetDefaultEffect(This,pGuid) \ - (This)->lpVtbl -> GetDefaultEffect(This,pGuid) - -#define IAMTimeline_SetDefaultTransitionB(This,pGuid) \ - (This)->lpVtbl -> SetDefaultTransitionB(This,pGuid) - -#define IAMTimeline_GetDefaultTransitionB(This,pGuid) \ - (This)->lpVtbl -> GetDefaultTransitionB(This,pGuid) - -#define IAMTimeline_SetDefaultEffectB(This,pGuid) \ - (This)->lpVtbl -> SetDefaultEffectB(This,pGuid) - -#define IAMTimeline_GetDefaultEffectB(This,pGuid) \ - (This)->lpVtbl -> GetDefaultEffectB(This,pGuid) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_CreateEmptyNode_Proxy( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type); - - -void __RPC_STUB IAMTimeline_CreateEmptyNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_AddGroup_Proxy( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - -void __RPC_STUB IAMTimeline_AddGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_RemGroupFromList_Proxy( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - -void __RPC_STUB IAMTimeline_RemGroupFromList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroup_Proxy( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup); - - -void __RPC_STUB IAMTimeline_GetGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroupCount_Proxy( - IAMTimeline * This, - long *pCount); - - -void __RPC_STUB IAMTimeline_GetGroupCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_ClearAllGroups_Proxy( - IAMTimeline * This); - - -void __RPC_STUB IAMTimeline_ClearAllGroups_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetInsertMode_Proxy( - IAMTimeline * This, - long *pMode); - - -void __RPC_STUB IAMTimeline_GetInsertMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInsertMode_Proxy( - IAMTimeline * This, - long Mode); - - -void __RPC_STUB IAMTimeline_SetInsertMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableTransitions_Proxy( - IAMTimeline * This, - BOOL fEnabled); - - -void __RPC_STUB IAMTimeline_EnableTransitions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_TransitionsEnabled_Proxy( - IAMTimeline * This, - BOOL *pfEnabled); - - -void __RPC_STUB IAMTimeline_TransitionsEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableEffects_Proxy( - IAMTimeline * This, - BOOL fEnabled); - - -void __RPC_STUB IAMTimeline_EnableEffects_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EffectsEnabled_Proxy( - IAMTimeline * This, - BOOL *pfEnabled); - - -void __RPC_STUB IAMTimeline_EffectsEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInterestRange_Proxy( - IAMTimeline * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - -void __RPC_STUB IAMTimeline_SetInterestRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration_Proxy( - IAMTimeline * This, - REFERENCE_TIME *pDuration); - - -void __RPC_STUB IAMTimeline_GetDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration2_Proxy( - IAMTimeline * This, - double *pDuration); - - -void __RPC_STUB IAMTimeline_GetDuration2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultFPS_Proxy( - IAMTimeline * This, - double FPS); - - -void __RPC_STUB IAMTimeline_SetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultFPS_Proxy( - IAMTimeline * This, - double *pFPS); - - -void __RPC_STUB IAMTimeline_GetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_IsDirty_Proxy( - IAMTimeline * This, - BOOL *pDirty); - - -void __RPC_STUB IAMTimeline_IsDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDirtyRange_Proxy( - IAMTimeline * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - -void __RPC_STUB IAMTimeline_GetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetCountOfType_Proxy( - IAMTimeline * This, - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - -void __RPC_STUB IAMTimeline_GetCountOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_ValidateSourceNames_Proxy( - IAMTimeline * This, - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle); - - -void __RPC_STUB IAMTimeline_ValidateSourceNames_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransition_Proxy( - IAMTimeline * This, - GUID *pGuid); - - -void __RPC_STUB IAMTimeline_SetDefaultTransition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransition_Proxy( - IAMTimeline * This, - GUID *pGuid); - - -void __RPC_STUB IAMTimeline_GetDefaultTransition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffect_Proxy( - IAMTimeline * This, - GUID *pGuid); - - -void __RPC_STUB IAMTimeline_SetDefaultEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffect_Proxy( - IAMTimeline * This, - GUID *pGuid); - - -void __RPC_STUB IAMTimeline_GetDefaultEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransitionB_Proxy( - IAMTimeline * This, - BSTR pGuid); - - -void __RPC_STUB IAMTimeline_SetDefaultTransitionB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransitionB_Proxy( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - -void __RPC_STUB IAMTimeline_GetDefaultTransitionB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffectB_Proxy( - IAMTimeline * This, - BSTR pGuid); - - -void __RPC_STUB IAMTimeline_SetDefaultEffectB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffectB_Proxy( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - -void __RPC_STUB IAMTimeline_GetDefaultEffectB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimeline_INTERFACE_DEFINED__ */ - - -#ifndef __IXml2Dex_INTERFACE_DEFINED__ -#define __IXml2Dex_INTERFACE_DEFINED__ - -/* interface IXml2Dex */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IXml2Dex; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("18C628ED-962A-11D2-8D08-00A0C9441E20") - IXml2Dex : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateGraphFromFile( - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteGrfFile( - IUnknown *pGraph, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLFile( - IUnknown *pTimeline, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXMLFile( - IUnknown *pTimeline, - BSTR XMLName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( - IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLPart( - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXMLFile( - IUnknown *pTimeline, - double dStart, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CopyXML( - IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXML( - IUnknown *pTimeline, - double dStart) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXML( - IUnknown *pTimeline, - IUnknown *pXML) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXML( - IUnknown *pTimeline, - BSTR *pbstrXML) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXml2DexVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXml2Dex * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXml2Dex * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXml2Dex * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXml2Dex * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXml2Dex * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXml2Dex * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXml2Dex * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateGraphFromFile )( - IXml2Dex * This, - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteGrfFile )( - IXml2Dex * This, - IUnknown *pGraph, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR XMLName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLPart )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CopyXML )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXML )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - IXml2Dex * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXML )( - IXml2Dex * This, - IUnknown *pTimeline, - IUnknown *pXML); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXML )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR *pbstrXML); - - END_INTERFACE - } IXml2DexVtbl; - - interface IXml2Dex - { - CONST_VTBL struct IXml2DexVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXml2Dex_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXml2Dex_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXml2Dex_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXml2Dex_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXml2Dex_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXml2Dex_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXml2Dex_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXml2Dex_CreateGraphFromFile(This,ppGraph,pTimeline,Filename) \ - (This)->lpVtbl -> CreateGraphFromFile(This,ppGraph,pTimeline,Filename) - -#define IXml2Dex_WriteGrfFile(This,pGraph,FileName) \ - (This)->lpVtbl -> WriteGrfFile(This,pGraph,FileName) - -#define IXml2Dex_WriteXMLFile(This,pTimeline,FileName) \ - (This)->lpVtbl -> WriteXMLFile(This,pTimeline,FileName) - -#define IXml2Dex_ReadXMLFile(This,pTimeline,XMLName) \ - (This)->lpVtbl -> ReadXMLFile(This,pTimeline,XMLName) - -#define IXml2Dex_Delete(This,pTimeline,dStart,dEnd) \ - (This)->lpVtbl -> Delete(This,pTimeline,dStart,dEnd) - -#define IXml2Dex_WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) \ - (This)->lpVtbl -> WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) - -#define IXml2Dex_PasteXMLFile(This,pTimeline,dStart,FileName) \ - (This)->lpVtbl -> PasteXMLFile(This,pTimeline,dStart,FileName) - -#define IXml2Dex_CopyXML(This,pTimeline,dStart,dEnd) \ - (This)->lpVtbl -> CopyXML(This,pTimeline,dStart,dEnd) - -#define IXml2Dex_PasteXML(This,pTimeline,dStart) \ - (This)->lpVtbl -> PasteXML(This,pTimeline,dStart) - -#define IXml2Dex_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IXml2Dex_ReadXML(This,pTimeline,pXML) \ - (This)->lpVtbl -> ReadXML(This,pTimeline,pXML) - -#define IXml2Dex_WriteXML(This,pTimeline,pbstrXML) \ - (This)->lpVtbl -> WriteXML(This,pTimeline,pbstrXML) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CreateGraphFromFile_Proxy( - IXml2Dex * This, - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename); - - -void __RPC_STUB IXml2Dex_CreateGraphFromFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteGrfFile_Proxy( - IXml2Dex * This, - IUnknown *pGraph, - BSTR FileName); - - -void __RPC_STUB IXml2Dex_WriteGrfFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR FileName); - - -void __RPC_STUB IXml2Dex_WriteXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR XMLName); - - -void __RPC_STUB IXml2Dex_ReadXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Delete_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - -void __RPC_STUB IXml2Dex_Delete_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLPart_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName); - - -void __RPC_STUB IXml2Dex_WriteXMLPart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - BSTR FileName); - - -void __RPC_STUB IXml2Dex_PasteXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CopyXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - -void __RPC_STUB IXml2Dex_CopyXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart); - - -void __RPC_STUB IXml2Dex_PasteXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Reset_Proxy( - IXml2Dex * This); - - -void __RPC_STUB IXml2Dex_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - IUnknown *pXML); - - -void __RPC_STUB IXml2Dex_ReadXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR *pbstrXML); - - -void __RPC_STUB IXml2Dex_WriteXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXml2Dex_INTERFACE_DEFINED__ */ - - -#ifndef __IAMErrorLog_INTERFACE_DEFINED__ -#define __IAMErrorLog_INTERFACE_DEFINED__ - -/* interface IAMErrorLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMErrorLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E43E73A2-0EFA-11d3-9601-00A0C9441E20") - IAMErrorLog : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogError( - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMErrorLog * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMErrorLog * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogError )( - IAMErrorLog * This, - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo); - - END_INTERFACE - } IAMErrorLogVtbl; - - interface IAMErrorLog - { - CONST_VTBL struct IAMErrorLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMErrorLog_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMErrorLog_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMErrorLog_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMErrorLog_LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) \ - (This)->lpVtbl -> LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMErrorLog_LogError_Proxy( - IAMErrorLog * This, - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo); - - -void __RPC_STUB IAMErrorLog_LogError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMErrorLog_INTERFACE_DEFINED__ */ - - -#ifndef __IAMSetErrorLog_INTERFACE_DEFINED__ -#define __IAMSetErrorLog_INTERFACE_DEFINED__ - -/* interface IAMSetErrorLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMSetErrorLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("963566DA-BE21-4eaf-88E9-35704F8F52A1") - IAMSetErrorLog : public IUnknown - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorLog( - /* [retval][out] */ IAMErrorLog **pVal) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_ErrorLog( - /* [in] */ IAMErrorLog *newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMSetErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMSetErrorLog * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMSetErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMSetErrorLog * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ErrorLog )( - IAMSetErrorLog * This, - /* [retval][out] */ IAMErrorLog **pVal); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ErrorLog )( - IAMSetErrorLog * This, - /* [in] */ IAMErrorLog *newVal); - - END_INTERFACE - } IAMSetErrorLogVtbl; - - interface IAMSetErrorLog - { - CONST_VTBL struct IAMSetErrorLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMSetErrorLog_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMSetErrorLog_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMSetErrorLog_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMSetErrorLog_get_ErrorLog(This,pVal) \ - (This)->lpVtbl -> get_ErrorLog(This,pVal) - -#define IAMSetErrorLog_put_ErrorLog(This,newVal) \ - (This)->lpVtbl -> put_ErrorLog(This,newVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_get_ErrorLog_Proxy( - IAMSetErrorLog * This, - /* [retval][out] */ IAMErrorLog **pVal); - - -void __RPC_STUB IAMSetErrorLog_get_ErrorLog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_put_ErrorLog_Proxy( - IAMSetErrorLog * This, - /* [in] */ IAMErrorLog *newVal); - - -void __RPC_STUB IAMSetErrorLog_put_ErrorLog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMSetErrorLog_INTERFACE_DEFINED__ */ - - -#ifndef __ISampleGrabberCB_INTERFACE_DEFINED__ -#define __ISampleGrabberCB_INTERFACE_DEFINED__ - -/* interface ISampleGrabberCB */ -/* [unique][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_ISampleGrabberCB; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0579154A-2B53-4994-B0D0-E773148EFF85") - ISampleGrabberCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SampleCB( - double SampleTime, - IMediaSample *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE BufferCB( - double SampleTime, - BYTE *pBuffer, - long BufferLen) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISampleGrabberCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabberCB * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabberCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabberCB * This); - - HRESULT ( STDMETHODCALLTYPE *SampleCB )( - ISampleGrabberCB * This, - double SampleTime, - IMediaSample *pSample); - - HRESULT ( STDMETHODCALLTYPE *BufferCB )( - ISampleGrabberCB * This, - double SampleTime, - BYTE *pBuffer, - long BufferLen); - - END_INTERFACE - } ISampleGrabberCBVtbl; - - interface ISampleGrabberCB - { - CONST_VTBL struct ISampleGrabberCBVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISampleGrabberCB_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISampleGrabberCB_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISampleGrabberCB_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISampleGrabberCB_SampleCB(This,SampleTime,pSample) \ - (This)->lpVtbl -> SampleCB(This,SampleTime,pSample) - -#define ISampleGrabberCB_BufferCB(This,SampleTime,pBuffer,BufferLen) \ - (This)->lpVtbl -> BufferCB(This,SampleTime,pBuffer,BufferLen) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISampleGrabberCB_SampleCB_Proxy( - ISampleGrabberCB * This, - double SampleTime, - IMediaSample *pSample); - - -void __RPC_STUB ISampleGrabberCB_SampleCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabberCB_BufferCB_Proxy( - ISampleGrabberCB * This, - double SampleTime, - BYTE *pBuffer, - long BufferLen); - - -void __RPC_STUB ISampleGrabberCB_BufferCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISampleGrabberCB_INTERFACE_DEFINED__ */ - - -#ifndef __ISampleGrabber_INTERFACE_DEFINED__ -#define __ISampleGrabber_INTERFACE_DEFINED__ - -/* interface ISampleGrabber */ -/* [unique][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_ISampleGrabber; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6B652FFF-11FE-4fce-92AD-0266B5D7C78F") - ISampleGrabber : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetOneShot( - BOOL OneShot) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - const AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( - AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( - BOOL BufferThem) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( - /* [retval][out] */ IMediaSample **ppSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCallback( - ISampleGrabberCB *pCallback, - long WhichMethodToCallback) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISampleGrabberVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabber * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabber * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabber * This); - - HRESULT ( STDMETHODCALLTYPE *SetOneShot )( - ISampleGrabber * This, - BOOL OneShot); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - ISampleGrabber * This, - const AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *GetConnectedMediaType )( - ISampleGrabber * This, - AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetBufferSamples )( - ISampleGrabber * This, - BOOL BufferThem); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentBuffer )( - ISampleGrabber * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSample )( - ISampleGrabber * This, - /* [retval][out] */ IMediaSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *SetCallback )( - ISampleGrabber * This, - ISampleGrabberCB *pCallback, - long WhichMethodToCallback); - - END_INTERFACE - } ISampleGrabberVtbl; - - interface ISampleGrabber - { - CONST_VTBL struct ISampleGrabberVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISampleGrabber_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISampleGrabber_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISampleGrabber_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISampleGrabber_SetOneShot(This,OneShot) \ - (This)->lpVtbl -> SetOneShot(This,OneShot) - -#define ISampleGrabber_SetMediaType(This,pType) \ - (This)->lpVtbl -> SetMediaType(This,pType) - -#define ISampleGrabber_GetConnectedMediaType(This,pType) \ - (This)->lpVtbl -> GetConnectedMediaType(This,pType) - -#define ISampleGrabber_SetBufferSamples(This,BufferThem) \ - (This)->lpVtbl -> SetBufferSamples(This,BufferThem) - -#define ISampleGrabber_GetCurrentBuffer(This,pBufferSize,pBuffer) \ - (This)->lpVtbl -> GetCurrentBuffer(This,pBufferSize,pBuffer) - -#define ISampleGrabber_GetCurrentSample(This,ppSample) \ - (This)->lpVtbl -> GetCurrentSample(This,ppSample) - -#define ISampleGrabber_SetCallback(This,pCallback,WhichMethodToCallback) \ - (This)->lpVtbl -> SetCallback(This,pCallback,WhichMethodToCallback) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_SetOneShot_Proxy( - ISampleGrabber * This, - BOOL OneShot); - - -void __RPC_STUB ISampleGrabber_SetOneShot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_SetMediaType_Proxy( - ISampleGrabber * This, - const AM_MEDIA_TYPE *pType); - - -void __RPC_STUB ISampleGrabber_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_GetConnectedMediaType_Proxy( - ISampleGrabber * This, - AM_MEDIA_TYPE *pType); - - -void __RPC_STUB ISampleGrabber_GetConnectedMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_SetBufferSamples_Proxy( - ISampleGrabber * This, - BOOL BufferThem); - - -void __RPC_STUB ISampleGrabber_SetBufferSamples_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentBuffer_Proxy( - ISampleGrabber * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer); - - -void __RPC_STUB ISampleGrabber_GetCurrentBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentSample_Proxy( - ISampleGrabber * This, - /* [retval][out] */ IMediaSample **ppSample); - - -void __RPC_STUB ISampleGrabber_GetCurrentSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISampleGrabber_SetCallback_Proxy( - ISampleGrabber * This, - ISampleGrabberCB *pCallback, - long WhichMethodToCallback); - - -void __RPC_STUB ISampleGrabber_SetCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISampleGrabber_INTERFACE_DEFINED__ */ - - - -#ifndef __DexterLib_LIBRARY_DEFINED__ -#define __DexterLib_LIBRARY_DEFINED__ - -/* library DexterLib */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_DexterLib; - -EXTERN_C const CLSID CLSID_AMTimeline; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B75-61F9-11D2-8CAD-00A024580902") -AMTimeline; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineObj; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B78-61F9-11D2-8CAD-00A024580902") -AMTimelineObj; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineSrc; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B7A-61F9-11D2-8CAD-00A024580902") -AMTimelineSrc; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineTrack; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8F6C3C50-897B-11d2-8CFB-00A0C9441E20") -AMTimelineTrack; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineComp; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC80-6233-11d2-8CAD-00A024580902") -AMTimelineComp; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineGroup; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F6D371E1-B8A6-11d2-8023-00C0DF10D434") -AMTimelineGroup; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineTrans; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC81-6233-11d2-8CAD-00A024580902") -AMTimelineTrans; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineEffect; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC82-6233-11d2-8CAD-00A024580902") -AMTimelineEffect; -#endif - -EXTERN_C const CLSID CLSID_RenderEngine; - -#ifdef __cplusplus - -class DECLSPEC_UUID("64D8A8E0-80A2-11d2-8CF3-00A0C9441E20") -RenderEngine; -#endif - -EXTERN_C const CLSID CLSID_SmartRenderEngine; - -#ifdef __cplusplus - -class DECLSPEC_UUID("498B0949-BBE9-4072-98BE-6CCAEB79DC6F") -SmartRenderEngine; -#endif - -EXTERN_C const CLSID CLSID_AudMixer; - -#ifdef __cplusplus - -class DECLSPEC_UUID("036A9790-C153-11d2-9EF7-006008039E37") -AudMixer; -#endif - -EXTERN_C const CLSID CLSID_Xml2Dex; - -#ifdef __cplusplus - -class DECLSPEC_UUID("18C628EE-962A-11D2-8D08-00A0C9441E20") -Xml2Dex; -#endif - -EXTERN_C const CLSID CLSID_MediaLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("CC1101F2-79DC-11D2-8CE6-00A0C9441E20") -MediaLocator; -#endif - -EXTERN_C const CLSID CLSID_PropertySetter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("ADF95821-DED7-11d2-ACBE-0080C75E246E") -PropertySetter; -#endif - -EXTERN_C const CLSID CLSID_MediaDet; - -#ifdef __cplusplus - -class DECLSPEC_UUID("65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA") -MediaDet; -#endif - -EXTERN_C const CLSID CLSID_SampleGrabber; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C1F400A0-3F08-11d3-9F0B-006008039E37") -SampleGrabber; -#endif - -EXTERN_C const CLSID CLSID_NullRenderer; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C1F400A4-3F08-11d3-9F0B-006008039E37") -NullRenderer; -#endif - -EXTERN_C const CLSID CLSID_DxtCompositor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("BB44391D-6ABD-422f-9E2E-385C9DFF51FC") -DxtCompositor; -#endif - -EXTERN_C const CLSID CLSID_DxtAlphaSetter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("506D89AE-909A-44f7-9444-ABD575896E35") -DxtAlphaSetter; -#endif - -EXTERN_C const CLSID CLSID_DxtJpeg; - -#ifdef __cplusplus - -class DECLSPEC_UUID("DE75D012-7A65-11D2-8CEA-00A0C9441E20") -DxtJpeg; -#endif - -EXTERN_C const CLSID CLSID_ColorSource; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0cfdd070-581a-11d2-9ee6-006008039e37") -ColorSource; -#endif - -EXTERN_C const CLSID CLSID_DxtKey; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C5B19592-145E-11d3-9F04-006008039E37") -DxtKey; -#endif -#endif /* __DexterLib_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_qedit_0474 */ -/* [local] */ - - -enum __MIDL___MIDL_itf_qedit_0474_0001 - { E_NOTINTREE = 0x80040400, - E_RENDER_ENGINE_IS_BROKEN = 0x80040401, - E_MUST_INIT_RENDERER = 0x80040402, - E_NOTDETERMINED = 0x80040403, - E_NO_TIMELINE = 0x80040404, - S_WARN_OUTPUTRESET = 40404 - } ; -#define DEX_IDS_BAD_SOURCE_NAME 1400 -#define DEX_IDS_BAD_SOURCE_NAME2 1401 -#define DEX_IDS_MISSING_SOURCE_NAME 1402 -#define DEX_IDS_UNKNOWN_SOURCE 1403 -#define DEX_IDS_INSTALL_PROBLEM 1404 -#define DEX_IDS_NO_SOURCE_NAMES 1405 -#define DEX_IDS_BAD_MEDIATYPE 1406 -#define DEX_IDS_STREAM_NUMBER 1407 -#define DEX_IDS_OUTOFMEMORY 1408 -#define DEX_IDS_DIBSEQ_NOTALLSAME 1409 -#define DEX_IDS_CLIPTOOSHORT 1410 -#define DEX_IDS_INVALID_DXT 1411 -#define DEX_IDS_INVALID_DEFAULT_DXT 1412 -#define DEX_IDS_NO_3D 1413 -#define DEX_IDS_BROKEN_DXT 1414 -#define DEX_IDS_NO_SUCH_PROPERTY 1415 -#define DEX_IDS_ILLEGAL_PROPERTY_VAL 1416 -#define DEX_IDS_INVALID_XML 1417 -#define DEX_IDS_CANT_FIND_FILTER 1418 -#define DEX_IDS_DISK_WRITE_ERROR 1419 -#define DEX_IDS_INVALID_AUDIO_FX 1420 -#define DEX_IDS_CANT_FIND_COMPRESSOR 1421 -#define DEX_IDS_TIMELINE_PARSE 1426 -#define DEX_IDS_GRAPH_ERROR 1427 -#define DEX_IDS_GRID_ERROR 1428 -#define DEX_IDS_INTERFACE_ERROR 1429 -EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - - -extern RPC_IF_HANDLE __MIDL_itf_qedit_0474_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_qedit_0474_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - -unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - - /* verify that the version is high enough to compile this file*/ - #ifndef __REQUIRED_RPCNDR_H_VERSION__ - #define __REQUIRED_RPCNDR_H_VERSION__ 440 - #endif - - #include "rpc.h" - #include "rpcndr.h" - - #ifndef __RPCNDR_H_VERSION__ - #error this stub requires an updated version of - #endif // __RPCNDR_H_VERSION__ - - #ifndef COM_NO_WINDOWS_H - #include "windows.h" - #include "ole2.h" - #endif /*COM_NO_WINDOWS_H*/ - - #ifndef __qedit_h__ - #define __qedit_h__ - - #if defined(_MSC_VER) && (_MSC_VER >= 1020) - #pragma once - #endif - - /* Forward Declarations */ - - #ifndef __IPropertySetter_FWD_DEFINED__ - #define __IPropertySetter_FWD_DEFINED__ - typedef interface IPropertySetter IPropertySetter; - #endif /* __IPropertySetter_FWD_DEFINED__ */ - - - #ifndef __IDxtCompositor_FWD_DEFINED__ - #define __IDxtCompositor_FWD_DEFINED__ - typedef interface IDxtCompositor IDxtCompositor; - #endif /* __IDxtCompositor_FWD_DEFINED__ */ - - - #ifndef __IDxtAlphaSetter_FWD_DEFINED__ - #define __IDxtAlphaSetter_FWD_DEFINED__ - typedef interface IDxtAlphaSetter IDxtAlphaSetter; - #endif /* __IDxtAlphaSetter_FWD_DEFINED__ */ - - - #ifndef __IDxtJpeg_FWD_DEFINED__ - #define __IDxtJpeg_FWD_DEFINED__ - typedef interface IDxtJpeg IDxtJpeg; - #endif /* __IDxtJpeg_FWD_DEFINED__ */ - - - #ifndef __IDxtKey_FWD_DEFINED__ - #define __IDxtKey_FWD_DEFINED__ - typedef interface IDxtKey IDxtKey; - #endif /* __IDxtKey_FWD_DEFINED__ */ - - - #ifndef __IMediaLocator_FWD_DEFINED__ - #define __IMediaLocator_FWD_DEFINED__ - typedef interface IMediaLocator IMediaLocator; - #endif /* __IMediaLocator_FWD_DEFINED__ */ - - - #ifndef __IMediaDet_FWD_DEFINED__ - #define __IMediaDet_FWD_DEFINED__ - typedef interface IMediaDet IMediaDet; - #endif /* __IMediaDet_FWD_DEFINED__ */ - - - #ifndef __IGrfCache_FWD_DEFINED__ - #define __IGrfCache_FWD_DEFINED__ - typedef interface IGrfCache IGrfCache; - #endif /* __IGrfCache_FWD_DEFINED__ */ - - - #ifndef __IRenderEngine_FWD_DEFINED__ - #define __IRenderEngine_FWD_DEFINED__ - typedef interface IRenderEngine IRenderEngine; - #endif /* __IRenderEngine_FWD_DEFINED__ */ - - - #ifndef __IFindCompressorCB_FWD_DEFINED__ - #define __IFindCompressorCB_FWD_DEFINED__ - typedef interface IFindCompressorCB IFindCompressorCB; - #endif /* __IFindCompressorCB_FWD_DEFINED__ */ - - - #ifndef __ISmartRenderEngine_FWD_DEFINED__ - #define __ISmartRenderEngine_FWD_DEFINED__ - typedef interface ISmartRenderEngine ISmartRenderEngine; - #endif /* __ISmartRenderEngine_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineObj_FWD_DEFINED__ - #define __IAMTimelineObj_FWD_DEFINED__ - typedef interface IAMTimelineObj IAMTimelineObj; - #endif /* __IAMTimelineObj_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineEffectable_FWD_DEFINED__ - #define __IAMTimelineEffectable_FWD_DEFINED__ - typedef interface IAMTimelineEffectable IAMTimelineEffectable; - #endif /* __IAMTimelineEffectable_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineEffect_FWD_DEFINED__ - #define __IAMTimelineEffect_FWD_DEFINED__ - typedef interface IAMTimelineEffect IAMTimelineEffect; - #endif /* __IAMTimelineEffect_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineTransable_FWD_DEFINED__ - #define __IAMTimelineTransable_FWD_DEFINED__ - typedef interface IAMTimelineTransable IAMTimelineTransable; - #endif /* __IAMTimelineTransable_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineSplittable_FWD_DEFINED__ - #define __IAMTimelineSplittable_FWD_DEFINED__ - typedef interface IAMTimelineSplittable IAMTimelineSplittable; - #endif /* __IAMTimelineSplittable_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineTrans_FWD_DEFINED__ - #define __IAMTimelineTrans_FWD_DEFINED__ - typedef interface IAMTimelineTrans IAMTimelineTrans; - #endif /* __IAMTimelineTrans_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineSrc_FWD_DEFINED__ - #define __IAMTimelineSrc_FWD_DEFINED__ - typedef interface IAMTimelineSrc IAMTimelineSrc; - #endif /* __IAMTimelineSrc_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineTrack_FWD_DEFINED__ - #define __IAMTimelineTrack_FWD_DEFINED__ - typedef interface IAMTimelineTrack IAMTimelineTrack; - #endif /* __IAMTimelineTrack_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineVirtualTrack_FWD_DEFINED__ - #define __IAMTimelineVirtualTrack_FWD_DEFINED__ - typedef interface IAMTimelineVirtualTrack IAMTimelineVirtualTrack; - #endif /* __IAMTimelineVirtualTrack_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineComp_FWD_DEFINED__ - #define __IAMTimelineComp_FWD_DEFINED__ - typedef interface IAMTimelineComp IAMTimelineComp; - #endif /* __IAMTimelineComp_FWD_DEFINED__ */ - - - #ifndef __IAMTimelineGroup_FWD_DEFINED__ - #define __IAMTimelineGroup_FWD_DEFINED__ - typedef interface IAMTimelineGroup IAMTimelineGroup; - #endif /* __IAMTimelineGroup_FWD_DEFINED__ */ - - - #ifndef __IAMTimeline_FWD_DEFINED__ - #define __IAMTimeline_FWD_DEFINED__ - typedef interface IAMTimeline IAMTimeline; - #endif /* __IAMTimeline_FWD_DEFINED__ */ - - - #ifndef __IXml2Dex_FWD_DEFINED__ - #define __IXml2Dex_FWD_DEFINED__ - typedef interface IXml2Dex IXml2Dex; - #endif /* __IXml2Dex_FWD_DEFINED__ */ - - - #ifndef __IAMErrorLog_FWD_DEFINED__ - #define __IAMErrorLog_FWD_DEFINED__ - typedef interface IAMErrorLog IAMErrorLog; - #endif /* __IAMErrorLog_FWD_DEFINED__ */ - - - #ifndef __IAMSetErrorLog_FWD_DEFINED__ - #define __IAMSetErrorLog_FWD_DEFINED__ - typedef interface IAMSetErrorLog IAMSetErrorLog; - #endif /* __IAMSetErrorLog_FWD_DEFINED__ */ - - - #ifndef __ISampleGrabberCB_FWD_DEFINED__ - #define __ISampleGrabberCB_FWD_DEFINED__ - typedef interface ISampleGrabberCB ISampleGrabberCB; - #endif /* __ISampleGrabberCB_FWD_DEFINED__ */ - - - #ifndef __ISampleGrabber_FWD_DEFINED__ - #define __ISampleGrabber_FWD_DEFINED__ - typedef interface ISampleGrabber ISampleGrabber; - #endif /* __ISampleGrabber_FWD_DEFINED__ */ - - - #ifndef __AMTimeline_FWD_DEFINED__ - #define __AMTimeline_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimeline AMTimeline; - #else - typedef struct AMTimeline AMTimeline; - #endif /* __cplusplus */ - - #endif /* __AMTimeline_FWD_DEFINED__ */ - - - #ifndef __AMTimelineObj_FWD_DEFINED__ - #define __AMTimelineObj_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineObj AMTimelineObj; - #else - typedef struct AMTimelineObj AMTimelineObj; - #endif /* __cplusplus */ - - #endif /* __AMTimelineObj_FWD_DEFINED__ */ - - - #ifndef __AMTimelineSrc_FWD_DEFINED__ - #define __AMTimelineSrc_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineSrc AMTimelineSrc; - #else - typedef struct AMTimelineSrc AMTimelineSrc; - #endif /* __cplusplus */ - - #endif /* __AMTimelineSrc_FWD_DEFINED__ */ - - - #ifndef __AMTimelineTrack_FWD_DEFINED__ - #define __AMTimelineTrack_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineTrack AMTimelineTrack; - #else - typedef struct AMTimelineTrack AMTimelineTrack; - #endif /* __cplusplus */ - - #endif /* __AMTimelineTrack_FWD_DEFINED__ */ - - - #ifndef __AMTimelineComp_FWD_DEFINED__ - #define __AMTimelineComp_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineComp AMTimelineComp; - #else - typedef struct AMTimelineComp AMTimelineComp; - #endif /* __cplusplus */ - - #endif /* __AMTimelineComp_FWD_DEFINED__ */ - - - #ifndef __AMTimelineGroup_FWD_DEFINED__ - #define __AMTimelineGroup_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineGroup AMTimelineGroup; - #else - typedef struct AMTimelineGroup AMTimelineGroup; - #endif /* __cplusplus */ - - #endif /* __AMTimelineGroup_FWD_DEFINED__ */ - - - #ifndef __AMTimelineTrans_FWD_DEFINED__ - #define __AMTimelineTrans_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineTrans AMTimelineTrans; - #else - typedef struct AMTimelineTrans AMTimelineTrans; - #endif /* __cplusplus */ - - #endif /* __AMTimelineTrans_FWD_DEFINED__ */ - - - #ifndef __AMTimelineEffect_FWD_DEFINED__ - #define __AMTimelineEffect_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AMTimelineEffect AMTimelineEffect; - #else - typedef struct AMTimelineEffect AMTimelineEffect; - #endif /* __cplusplus */ - - #endif /* __AMTimelineEffect_FWD_DEFINED__ */ - - - #ifndef __RenderEngine_FWD_DEFINED__ - #define __RenderEngine_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class RenderEngine RenderEngine; - #else - typedef struct RenderEngine RenderEngine; - #endif /* __cplusplus */ - - #endif /* __RenderEngine_FWD_DEFINED__ */ - - - #ifndef __SmartRenderEngine_FWD_DEFINED__ - #define __SmartRenderEngine_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class SmartRenderEngine SmartRenderEngine; - #else - typedef struct SmartRenderEngine SmartRenderEngine; - #endif /* __cplusplus */ - - #endif /* __SmartRenderEngine_FWD_DEFINED__ */ - - - #ifndef __AudMixer_FWD_DEFINED__ - #define __AudMixer_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AudMixer AudMixer; - #else - typedef struct AudMixer AudMixer; - #endif /* __cplusplus */ - - #endif /* __AudMixer_FWD_DEFINED__ */ - - - #ifndef __Xml2Dex_FWD_DEFINED__ - #define __Xml2Dex_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class Xml2Dex Xml2Dex; - #else - typedef struct Xml2Dex Xml2Dex; - #endif /* __cplusplus */ - - #endif /* __Xml2Dex_FWD_DEFINED__ */ - - - #ifndef __MediaLocator_FWD_DEFINED__ - #define __MediaLocator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class MediaLocator MediaLocator; - #else - typedef struct MediaLocator MediaLocator; - #endif /* __cplusplus */ - - #endif /* __MediaLocator_FWD_DEFINED__ */ - - - #ifndef __PropertySetter_FWD_DEFINED__ - #define __PropertySetter_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class PropertySetter PropertySetter; - #else - typedef struct PropertySetter PropertySetter; - #endif /* __cplusplus */ - - #endif /* __PropertySetter_FWD_DEFINED__ */ - - - #ifndef __MediaDet_FWD_DEFINED__ - #define __MediaDet_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class MediaDet MediaDet; - #else - typedef struct MediaDet MediaDet; - #endif /* __cplusplus */ - - #endif /* __MediaDet_FWD_DEFINED__ */ - - - #ifndef __SampleGrabber_FWD_DEFINED__ - #define __SampleGrabber_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class SampleGrabber SampleGrabber; - #else - typedef struct SampleGrabber SampleGrabber; - #endif /* __cplusplus */ - - #endif /* __SampleGrabber_FWD_DEFINED__ */ - - - #ifndef __NullRenderer_FWD_DEFINED__ - #define __NullRenderer_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class NullRenderer NullRenderer; - #else - typedef struct NullRenderer NullRenderer; - #endif /* __cplusplus */ - - #endif /* __NullRenderer_FWD_DEFINED__ */ - - - #ifndef __DxtCompositor_FWD_DEFINED__ - #define __DxtCompositor_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DxtCompositor DxtCompositor; - #else - typedef struct DxtCompositor DxtCompositor; - #endif /* __cplusplus */ - - #endif /* __DxtCompositor_FWD_DEFINED__ */ - - - #ifndef __DxtAlphaSetter_FWD_DEFINED__ - #define __DxtAlphaSetter_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DxtAlphaSetter DxtAlphaSetter; - #else - typedef struct DxtAlphaSetter DxtAlphaSetter; - #endif /* __cplusplus */ - - #endif /* __DxtAlphaSetter_FWD_DEFINED__ */ - - - #ifndef __DxtJpeg_FWD_DEFINED__ - #define __DxtJpeg_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DxtJpeg DxtJpeg; - #else - typedef struct DxtJpeg DxtJpeg; - #endif /* __cplusplus */ - - #endif /* __DxtJpeg_FWD_DEFINED__ */ - - - #ifndef __ColorSource_FWD_DEFINED__ - #define __ColorSource_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ColorSource ColorSource; - #else - typedef struct ColorSource ColorSource; - #endif /* __cplusplus */ - - #endif /* __ColorSource_FWD_DEFINED__ */ - - - #ifndef __DxtKey_FWD_DEFINED__ - #define __DxtKey_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DxtKey DxtKey; - #else - typedef struct DxtKey DxtKey; - #endif /* __cplusplus */ - - #endif /* __DxtKey_FWD_DEFINED__ */ - - - /* header files for imported files */ - #include "oaidl.h" - #include "ocidl.h" - #include "dxtrans.h" - #include "amstream.h" - - #ifdef __cplusplus - extern "C"{ - #endif - - void * __RPC_USER MIDL_user_allocate(size_t); - void __RPC_USER MIDL_user_free( void * ); - - /* interface __MIDL_itf_qedit_0000 */ - /* [local] */ - - - - - - - - - - - typedef /* [public] */ - enum __MIDL___MIDL_itf_qedit_0000_0001 - { DEXTERF_JUMP = 0, - DEXTERF_INTERPOLATE = DEXTERF_JUMP + 1 - } DEXTERF; - - typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0002 - { - BSTR Name; - DISPID dispID; - LONG nValues; - } DEXTER_PARAM; - - typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0003 - { - VARIANT v; - REFERENCE_TIME rt; - DWORD dwInterp; - } DEXTER_VALUE; - - - enum __MIDL___MIDL_itf_qedit_0000_0004 - { DEXTER_AUDIO_JUMP = 0, - DEXTER_AUDIO_INTERPOLATE = DEXTER_AUDIO_JUMP + 1 - } ; - typedef /* [public] */ struct __MIDL___MIDL_itf_qedit_0000_0005 - { - REFERENCE_TIME rtEnd; - double dLevel; - BOOL bMethod; - } DEXTER_AUDIO_VOLUMEENVELOPE; - - - enum __MIDL___MIDL_itf_qedit_0000_0006 - { TIMELINE_INSERT_MODE_INSERT = 1, - TIMELINE_INSERT_MODE_OVERLAY = 2 - } ; - typedef /* [public][public][public][public][public][public][public][public] */ - enum __MIDL___MIDL_itf_qedit_0000_0007 - { TIMELINE_MAJOR_TYPE_COMPOSITE = 1, - TIMELINE_MAJOR_TYPE_TRACK = 2, - TIMELINE_MAJOR_TYPE_SOURCE = 4, - TIMELINE_MAJOR_TYPE_TRANSITION = 8, - TIMELINE_MAJOR_TYPE_EFFECT = 16, - TIMELINE_MAJOR_TYPE_GROUP = 128 - } TIMELINE_MAJOR_TYPE; - - typedef /* [public] */ - enum __MIDL___MIDL_itf_qedit_0000_0008 - { DEXTERF_BOUNDING = -1, - DEXTERF_EXACTLY_AT = 0, - DEXTERF_FORWARDS = 1 - } DEXTERF_TRACK_SEARCH_FLAGS; - - typedef struct _SCompFmt0 - { - long nFormatId; - AM_MEDIA_TYPE MediaType; - } SCompFmt0; - - - enum __MIDL___MIDL_itf_qedit_0000_0009 - { RESIZEF_STRETCH = 0, - RESIZEF_CROP = RESIZEF_STRETCH + 1, - RESIZEF_PRESERVEASPECTRATIO = RESIZEF_CROP + 1, - RESIZEF_PRESERVEASPECTRATIO_NOLETTERBOX = RESIZEF_PRESERVEASPECTRATIO + 1 - } ; - - enum __MIDL___MIDL_itf_qedit_0000_0010 - { CONNECTF_DYNAMIC_NONE = 0, - CONNECTF_DYNAMIC_SOURCES = 0x1, - CONNECTF_DYNAMIC_EFFECTS = 0x2 - } ; - - enum __MIDL___MIDL_itf_qedit_0000_0011 - { SFN_VALIDATEF_CHECK = 0x1, - SFN_VALIDATEF_POPUP = 0x2, - SFN_VALIDATEF_TELLME = 0x4, - SFN_VALIDATEF_REPLACE = 0x8, - SFN_VALIDATEF_USELOCAL = 0x10, - SFN_VALIDATEF_NOFIND = 0x20, - SFN_VALIDATEF_IGNOREMUTED = 0x40, - SFN_VALIDATEF_END = SFN_VALIDATEF_IGNOREMUTED + 1 - } ; - - enum __MIDL___MIDL_itf_qedit_0000_0012 - { DXTKEY_RGB = 0, - DXTKEY_NONRED = DXTKEY_RGB + 1, - DXTKEY_LUMINANCE = DXTKEY_NONRED + 1, - DXTKEY_ALPHA = DXTKEY_LUMINANCE + 1, - DXTKEY_HUE = DXTKEY_ALPHA + 1 - } ; - - - extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_c_ifspec; - extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_s_ifspec; - - #ifndef __IPropertySetter_INTERFACE_DEFINED__ - #define __IPropertySetter_INTERFACE_DEFINED__ - - /* interface IPropertySetter */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IPropertySetter; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BD-B0C3-11D2-8D24-00A0C9441E20") - IPropertySetter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE LoadXML( - /* [in] */ IUnknown *pxml) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrintXML( - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent) = 0; - - virtual HRESULT STDMETHODCALLTYPE CloneProps( - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddProp( - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProps( - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeProps( - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearProps( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SaveToBlob( - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadFromBlob( - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetProps( - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow) = 0; - - }; - - #else /* C style interface */ - - typedef struct IPropertySetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPropertySetter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPropertySetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *LoadXML )( - IPropertySetter * This, - /* [in] */ IUnknown *pxml); - - HRESULT ( STDMETHODCALLTYPE *PrintXML )( - IPropertySetter * This, - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent); - - HRESULT ( STDMETHODCALLTYPE *CloneProps )( - IPropertySetter * This, - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop); - - HRESULT ( STDMETHODCALLTYPE *AddProp )( - IPropertySetter * This, - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *GetProps )( - IPropertySetter * This, - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue); - - HRESULT ( STDMETHODCALLTYPE *FreeProps )( - IPropertySetter * This, - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *ClearProps )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *SaveToBlob )( - IPropertySetter * This, - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb); - - HRESULT ( STDMETHODCALLTYPE *LoadFromBlob )( - IPropertySetter * This, - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb); - - HRESULT ( STDMETHODCALLTYPE *SetProps )( - IPropertySetter * This, - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow); - - END_INTERFACE - } IPropertySetterVtbl; - - interface IPropertySetter - { - CONST_VTBL struct IPropertySetterVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IPropertySetter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IPropertySetter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IPropertySetter_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IPropertySetter_LoadXML(This,pxml) \ - (This)->lpVtbl -> LoadXML(This,pxml) - - #define IPropertySetter_PrintXML(This,pszXML,cbXML,pcbPrinted,indent) \ - (This)->lpVtbl -> PrintXML(This,pszXML,cbXML,pcbPrinted,indent) - - #define IPropertySetter_CloneProps(This,ppSetter,rtStart,rtStop) \ - (This)->lpVtbl -> CloneProps(This,ppSetter,rtStart,rtStop) - - #define IPropertySetter_AddProp(This,Param,paValue) \ - (This)->lpVtbl -> AddProp(This,Param,paValue) - - #define IPropertySetter_GetProps(This,pcParams,paParam,paValue) \ - (This)->lpVtbl -> GetProps(This,pcParams,paParam,paValue) - - #define IPropertySetter_FreeProps(This,cParams,paParam,paValue) \ - (This)->lpVtbl -> FreeProps(This,cParams,paParam,paValue) - - #define IPropertySetter_ClearProps(This) \ - (This)->lpVtbl -> ClearProps(This) - - #define IPropertySetter_SaveToBlob(This,pcSize,ppb) \ - (This)->lpVtbl -> SaveToBlob(This,pcSize,ppb) - - #define IPropertySetter_LoadFromBlob(This,cSize,pb) \ - (This)->lpVtbl -> LoadFromBlob(This,cSize,pb) - - #define IPropertySetter_SetProps(This,pTarget,rtNow) \ - (This)->lpVtbl -> SetProps(This,pTarget,rtNow) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IPropertySetter_LoadXML_Proxy( - IPropertySetter * This, - /* [in] */ IUnknown *pxml); - - - void __RPC_STUB IPropertySetter_LoadXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_PrintXML_Proxy( - IPropertySetter * This, - /* [out] */ char *pszXML, - /* [in] */ int cbXML, - /* [out] */ int *pcbPrinted, - /* [in] */ int indent); - - - void __RPC_STUB IPropertySetter_PrintXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_CloneProps_Proxy( - IPropertySetter * This, - /* [out] */ IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop); - - - void __RPC_STUB IPropertySetter_CloneProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_AddProp_Proxy( - IPropertySetter * This, - /* [in] */ DEXTER_PARAM Param, - /* [in] */ DEXTER_VALUE *paValue); - - - void __RPC_STUB IPropertySetter_AddProp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_GetProps_Proxy( - IPropertySetter * This, - /* [out] */ LONG *pcParams, - /* [out] */ DEXTER_PARAM **paParam, - /* [out] */ DEXTER_VALUE **paValue); - - - void __RPC_STUB IPropertySetter_GetProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_FreeProps_Proxy( - IPropertySetter * This, - /* [in] */ LONG cParams, - /* [in] */ DEXTER_PARAM *paParam, - /* [in] */ DEXTER_VALUE *paValue); - - - void __RPC_STUB IPropertySetter_FreeProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_ClearProps_Proxy( - IPropertySetter * This); - - - void __RPC_STUB IPropertySetter_ClearProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_SaveToBlob_Proxy( - IPropertySetter * This, - /* [out] */ LONG *pcSize, - /* [out] */ BYTE **ppb); - - - void __RPC_STUB IPropertySetter_SaveToBlob_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_LoadFromBlob_Proxy( - IPropertySetter * This, - /* [in] */ LONG cSize, - /* [in] */ BYTE *pb); - - - void __RPC_STUB IPropertySetter_LoadFromBlob_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IPropertySetter_SetProps_Proxy( - IPropertySetter * This, - /* [in] */ IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow); - - - void __RPC_STUB IPropertySetter_SetProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IPropertySetter_INTERFACE_DEFINED__ */ - - - #ifndef __IDxtCompositor_INTERFACE_DEFINED__ - #define __IDxtCompositor_INTERFACE_DEFINED__ - - /* interface IDxtCompositor */ - /* [unique][helpstring][dual][uuid][object] */ - - - EXTERN_C const IID IID_IDxtCompositor; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BB44391E-6ABD-422f-9E2E-385C9DFF51FC") - IDxtCompositor : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Width( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Width( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Height( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Height( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcWidth( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcHeight( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcHeight( - /* [in] */ long newVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDxtCompositorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtCompositor * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtCompositor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtCompositor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtCompositor * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtCompositor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtCompositor * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtCompositor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtCompositor * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Width )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Height )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetX )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetY )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcWidth )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcWidth )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcHeight )( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcHeight )( - IDxtCompositor * This, - /* [in] */ long newVal); - - END_INTERFACE - } IDxtCompositorVtbl; - - interface IDxtCompositor - { - CONST_VTBL struct IDxtCompositorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDxtCompositor_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDxtCompositor_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDxtCompositor_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDxtCompositor_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDxtCompositor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDxtCompositor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDxtCompositor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDxtCompositor_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - - #define IDxtCompositor_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - - #define IDxtCompositor_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - - #define IDxtCompositor_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - - #define IDxtCompositor_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - - #define IDxtCompositor_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - - #define IDxtCompositor_get_OffsetX(This,pVal) \ - (This)->lpVtbl -> get_OffsetX(This,pVal) - - #define IDxtCompositor_put_OffsetX(This,newVal) \ - (This)->lpVtbl -> put_OffsetX(This,newVal) - - #define IDxtCompositor_get_OffsetY(This,pVal) \ - (This)->lpVtbl -> get_OffsetY(This,pVal) - - #define IDxtCompositor_put_OffsetY(This,newVal) \ - (This)->lpVtbl -> put_OffsetY(This,newVal) - - #define IDxtCompositor_get_Width(This,pVal) \ - (This)->lpVtbl -> get_Width(This,pVal) - - #define IDxtCompositor_put_Width(This,newVal) \ - (This)->lpVtbl -> put_Width(This,newVal) - - #define IDxtCompositor_get_Height(This,pVal) \ - (This)->lpVtbl -> get_Height(This,pVal) - - #define IDxtCompositor_put_Height(This,newVal) \ - (This)->lpVtbl -> put_Height(This,newVal) - - #define IDxtCompositor_get_SrcOffsetX(This,pVal) \ - (This)->lpVtbl -> get_SrcOffsetX(This,pVal) - - #define IDxtCompositor_put_SrcOffsetX(This,newVal) \ - (This)->lpVtbl -> put_SrcOffsetX(This,newVal) - - #define IDxtCompositor_get_SrcOffsetY(This,pVal) \ - (This)->lpVtbl -> get_SrcOffsetY(This,pVal) - - #define IDxtCompositor_put_SrcOffsetY(This,newVal) \ - (This)->lpVtbl -> put_SrcOffsetY(This,newVal) - - #define IDxtCompositor_get_SrcWidth(This,pVal) \ - (This)->lpVtbl -> get_SrcWidth(This,pVal) - - #define IDxtCompositor_put_SrcWidth(This,newVal) \ - (This)->lpVtbl -> put_SrcWidth(This,newVal) - - #define IDxtCompositor_get_SrcHeight(This,pVal) \ - (This)->lpVtbl -> get_SrcHeight(This,pVal) - - #define IDxtCompositor_put_SrcHeight(This,newVal) \ - (This)->lpVtbl -> put_SrcHeight(This,newVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetX_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetX_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetY_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetY_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Width_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Width_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_Width_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Height_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Height_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_Height_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetX_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_SrcOffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetX_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_SrcOffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetY_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_SrcOffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetY_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_SrcOffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcWidth_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_SrcWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcWidth_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_SrcWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcHeight_Proxy( - IDxtCompositor * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtCompositor_get_SrcHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcHeight_Proxy( - IDxtCompositor * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtCompositor_put_SrcHeight_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDxtCompositor_INTERFACE_DEFINED__ */ - - - #ifndef __IDxtAlphaSetter_INTERFACE_DEFINED__ - #define __IDxtAlphaSetter_INTERFACE_DEFINED__ - - /* interface IDxtAlphaSetter */ - /* [unique][helpstring][dual][uuid][object] */ - - - EXTERN_C const IID IID_IDxtAlphaSetter; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4EE9EAD9-DA4D-43d0-9383-06B90C08B12B") - IDxtAlphaSetter : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Alpha( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Alpha( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AlphaRamp( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AlphaRamp( - /* [in] */ double newVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDxtAlphaSetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtAlphaSetter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtAlphaSetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtAlphaSetter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtAlphaSetter * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtAlphaSetter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtAlphaSetter * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtAlphaSetter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtAlphaSetter * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Alpha )( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Alpha )( - IDxtAlphaSetter * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AlphaRamp )( - IDxtAlphaSetter * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_AlphaRamp )( - IDxtAlphaSetter * This, - /* [in] */ double newVal); - - END_INTERFACE - } IDxtAlphaSetterVtbl; - - interface IDxtAlphaSetter - { - CONST_VTBL struct IDxtAlphaSetterVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDxtAlphaSetter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDxtAlphaSetter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDxtAlphaSetter_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDxtAlphaSetter_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDxtAlphaSetter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDxtAlphaSetter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDxtAlphaSetter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDxtAlphaSetter_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - - #define IDxtAlphaSetter_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - - #define IDxtAlphaSetter_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - - #define IDxtAlphaSetter_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - - #define IDxtAlphaSetter_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - - #define IDxtAlphaSetter_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - - #define IDxtAlphaSetter_get_Alpha(This,pVal) \ - (This)->lpVtbl -> get_Alpha(This,pVal) - - #define IDxtAlphaSetter_put_Alpha(This,newVal) \ - (This)->lpVtbl -> put_Alpha(This,newVal) - - #define IDxtAlphaSetter_get_AlphaRamp(This,pVal) \ - (This)->lpVtbl -> get_AlphaRamp(This,pVal) - - #define IDxtAlphaSetter_put_AlphaRamp(This,newVal) \ - (This)->lpVtbl -> put_AlphaRamp(This,newVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_Alpha_Proxy( - IDxtAlphaSetter * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtAlphaSetter_get_Alpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_Alpha_Proxy( - IDxtAlphaSetter * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtAlphaSetter_put_Alpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_AlphaRamp_Proxy( - IDxtAlphaSetter * This, - /* [retval][out] */ double *pVal); - - - void __RPC_STUB IDxtAlphaSetter_get_AlphaRamp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_AlphaRamp_Proxy( - IDxtAlphaSetter * This, - /* [in] */ double newVal); - - - void __RPC_STUB IDxtAlphaSetter_put_AlphaRamp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDxtAlphaSetter_INTERFACE_DEFINED__ */ - - - #ifndef __IDxtJpeg_INTERFACE_DEFINED__ - #define __IDxtJpeg_INTERFACE_DEFINED__ - - /* interface IDxtJpeg */ - /* [unique][helpstring][dual][uuid][object] */ - - - EXTERN_C const IID IID_IDxtJpeg; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DE75D011-7A65-11D2-8CEA-00A0C9441E20") - IDxtJpeg : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskNum( - /* [retval][out] */ long *__MIDL_0018) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskNum( - /* [in] */ long __MIDL_0019) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskName( - /* [in] */ BSTR newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleX( - /* [retval][out] */ double *__MIDL_0020) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleX( - /* [in] */ double __MIDL_0021) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleY( - /* [retval][out] */ double *__MIDL_0022) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleY( - /* [in] */ double __MIDL_0023) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ long *__MIDL_0024) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long __MIDL_0025) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ long *__MIDL_0026) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long __MIDL_0027) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateX( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateY( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderColor( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderColor( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderWidth( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderSoftness( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderSoftness( - /* [in] */ long newVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadDefSettings( void) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDxtJpegVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtJpeg * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtJpeg * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtJpeg * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtJpeg * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtJpeg * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtJpeg * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtJpeg * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskNum )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0018); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskNum )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0019); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskName )( - IDxtJpeg * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskName )( - IDxtJpeg * This, - /* [in] */ BSTR newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleX )( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0020); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleX )( - IDxtJpeg * This, - /* [in] */ double __MIDL_0021); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleY )( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0022); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleY )( - IDxtJpeg * This, - /* [in] */ double __MIDL_0023); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0024); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0025); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0026); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtJpeg * This, - /* [in] */ long __MIDL_0027); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateX )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateX )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateY )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateY )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderColor )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderColor )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderWidth )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderWidth )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderSoftness )( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderSoftness )( - IDxtJpeg * This, - /* [in] */ long newVal); - - HRESULT ( STDMETHODCALLTYPE *ApplyChanges )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *LoadDefSettings )( - IDxtJpeg * This); - - END_INTERFACE - } IDxtJpegVtbl; - - interface IDxtJpeg - { - CONST_VTBL struct IDxtJpegVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDxtJpeg_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDxtJpeg_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDxtJpeg_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDxtJpeg_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDxtJpeg_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDxtJpeg_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDxtJpeg_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDxtJpeg_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - - #define IDxtJpeg_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - - #define IDxtJpeg_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - - #define IDxtJpeg_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - - #define IDxtJpeg_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - - #define IDxtJpeg_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - - #define IDxtJpeg_get_MaskNum(This,__MIDL_0018) \ - (This)->lpVtbl -> get_MaskNum(This,__MIDL_0018) - - #define IDxtJpeg_put_MaskNum(This,__MIDL_0019) \ - (This)->lpVtbl -> put_MaskNum(This,__MIDL_0019) - - #define IDxtJpeg_get_MaskName(This,pVal) \ - (This)->lpVtbl -> get_MaskName(This,pVal) - - #define IDxtJpeg_put_MaskName(This,newVal) \ - (This)->lpVtbl -> put_MaskName(This,newVal) - - #define IDxtJpeg_get_ScaleX(This,__MIDL_0020) \ - (This)->lpVtbl -> get_ScaleX(This,__MIDL_0020) - - #define IDxtJpeg_put_ScaleX(This,__MIDL_0021) \ - (This)->lpVtbl -> put_ScaleX(This,__MIDL_0021) - - #define IDxtJpeg_get_ScaleY(This,__MIDL_0022) \ - (This)->lpVtbl -> get_ScaleY(This,__MIDL_0022) - - #define IDxtJpeg_put_ScaleY(This,__MIDL_0023) \ - (This)->lpVtbl -> put_ScaleY(This,__MIDL_0023) - - #define IDxtJpeg_get_OffsetX(This,__MIDL_0024) \ - (This)->lpVtbl -> get_OffsetX(This,__MIDL_0024) - - #define IDxtJpeg_put_OffsetX(This,__MIDL_0025) \ - (This)->lpVtbl -> put_OffsetX(This,__MIDL_0025) - - #define IDxtJpeg_get_OffsetY(This,__MIDL_0026) \ - (This)->lpVtbl -> get_OffsetY(This,__MIDL_0026) - - #define IDxtJpeg_put_OffsetY(This,__MIDL_0027) \ - (This)->lpVtbl -> put_OffsetY(This,__MIDL_0027) - - #define IDxtJpeg_get_ReplicateX(This,pVal) \ - (This)->lpVtbl -> get_ReplicateX(This,pVal) - - #define IDxtJpeg_put_ReplicateX(This,newVal) \ - (This)->lpVtbl -> put_ReplicateX(This,newVal) - - #define IDxtJpeg_get_ReplicateY(This,pVal) \ - (This)->lpVtbl -> get_ReplicateY(This,pVal) - - #define IDxtJpeg_put_ReplicateY(This,newVal) \ - (This)->lpVtbl -> put_ReplicateY(This,newVal) - - #define IDxtJpeg_get_BorderColor(This,pVal) \ - (This)->lpVtbl -> get_BorderColor(This,pVal) - - #define IDxtJpeg_put_BorderColor(This,newVal) \ - (This)->lpVtbl -> put_BorderColor(This,newVal) - - #define IDxtJpeg_get_BorderWidth(This,pVal) \ - (This)->lpVtbl -> get_BorderWidth(This,pVal) - - #define IDxtJpeg_put_BorderWidth(This,newVal) \ - (This)->lpVtbl -> put_BorderWidth(This,newVal) - - #define IDxtJpeg_get_BorderSoftness(This,pVal) \ - (This)->lpVtbl -> get_BorderSoftness(This,pVal) - - #define IDxtJpeg_put_BorderSoftness(This,newVal) \ - (This)->lpVtbl -> put_BorderSoftness(This,newVal) - - #define IDxtJpeg_ApplyChanges(This) \ - (This)->lpVtbl -> ApplyChanges(This) - - #define IDxtJpeg_LoadDefSettings(This) \ - (This)->lpVtbl -> LoadDefSettings(This) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskNum_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0018); - - - void __RPC_STUB IDxtJpeg_get_MaskNum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskNum_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0019); - - - void __RPC_STUB IDxtJpeg_put_MaskNum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskName_Proxy( - IDxtJpeg * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IDxtJpeg_get_MaskName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskName_Proxy( - IDxtJpeg * This, - /* [in] */ BSTR newVal); - - - void __RPC_STUB IDxtJpeg_put_MaskName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0020); - - - void __RPC_STUB IDxtJpeg_get_ScaleX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleX_Proxy( - IDxtJpeg * This, - /* [in] */ double __MIDL_0021); - - - void __RPC_STUB IDxtJpeg_put_ScaleX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ double *__MIDL_0022); - - - void __RPC_STUB IDxtJpeg_get_ScaleY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleY_Proxy( - IDxtJpeg * This, - /* [in] */ double __MIDL_0023); - - - void __RPC_STUB IDxtJpeg_put_ScaleY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0024); - - - void __RPC_STUB IDxtJpeg_get_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetX_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0025); - - - void __RPC_STUB IDxtJpeg_put_OffsetX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *__MIDL_0026); - - - void __RPC_STUB IDxtJpeg_get_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetY_Proxy( - IDxtJpeg * This, - /* [in] */ long __MIDL_0027); - - - void __RPC_STUB IDxtJpeg_put_OffsetY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateX_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtJpeg_get_ReplicateX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateX_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtJpeg_put_ReplicateX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateY_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtJpeg_get_ReplicateY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateY_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtJpeg_put_ReplicateY_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderColor_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtJpeg_get_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderColor_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtJpeg_put_BorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderWidth_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtJpeg_get_BorderWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderWidth_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtJpeg_put_BorderWidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderSoftness_Proxy( - IDxtJpeg * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IDxtJpeg_get_BorderSoftness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderSoftness_Proxy( - IDxtJpeg * This, - /* [in] */ long newVal); - - - void __RPC_STUB IDxtJpeg_put_BorderSoftness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IDxtJpeg_ApplyChanges_Proxy( - IDxtJpeg * This); - - - void __RPC_STUB IDxtJpeg_ApplyChanges_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IDxtJpeg_LoadDefSettings_Proxy( - IDxtJpeg * This); - - - void __RPC_STUB IDxtJpeg_LoadDefSettings_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDxtJpeg_INTERFACE_DEFINED__ */ - - - #ifndef __IDxtKey_INTERFACE_DEFINED__ - #define __IDxtKey_INTERFACE_DEFINED__ - - /* interface IDxtKey */ - /* [unique][helpstring][dual][uuid][object] */ - - - EXTERN_C const IID IID_IDxtKey; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3255de56-38fb-4901-b980-94b438010d7b") - IDxtKey : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KeyType( - /* [retval][out] */ int *__MIDL_0028) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KeyType( - /* [in] */ int __MIDL_0029) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Hue( - /* [retval][out] */ int *__MIDL_0030) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Hue( - /* [in] */ int __MIDL_0031) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Luminance( - /* [retval][out] */ int *__MIDL_0032) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Luminance( - /* [in] */ int __MIDL_0033) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RGB( - /* [retval][out] */ DWORD *__MIDL_0034) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_RGB( - /* [in] */ DWORD __MIDL_0035) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Similarity( - /* [retval][out] */ int *__MIDL_0036) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Similarity( - /* [in] */ int __MIDL_0037) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Invert( - /* [retval][out] */ BOOL *__MIDL_0038) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Invert( - /* [in] */ BOOL __MIDL_0039) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDxtKeyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtKey * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtKey * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtKey * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtKey * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtKey * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtKey * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtKey * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtKey * This, - /* [retval][out] */ long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtKey * This, - /* [retval][out] */ float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KeyType )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0028); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KeyType )( - IDxtKey * This, - /* [in] */ int __MIDL_0029); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Hue )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0030); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Hue )( - IDxtKey * This, - /* [in] */ int __MIDL_0031); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Luminance )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0032); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Luminance )( - IDxtKey * This, - /* [in] */ int __MIDL_0033); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_RGB )( - IDxtKey * This, - /* [retval][out] */ DWORD *__MIDL_0034); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_RGB )( - IDxtKey * This, - /* [in] */ DWORD __MIDL_0035); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Similarity )( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0036); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Similarity )( - IDxtKey * This, - /* [in] */ int __MIDL_0037); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Invert )( - IDxtKey * This, - /* [retval][out] */ BOOL *__MIDL_0038); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Invert )( - IDxtKey * This, - /* [in] */ BOOL __MIDL_0039); - - END_INTERFACE - } IDxtKeyVtbl; - - interface IDxtKey - { - CONST_VTBL struct IDxtKeyVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDxtKey_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDxtKey_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDxtKey_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDxtKey_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDxtKey_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDxtKey_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDxtKey_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDxtKey_get_Capabilities(This,pVal) \ - (This)->lpVtbl -> get_Capabilities(This,pVal) - - #define IDxtKey_get_Progress(This,pVal) \ - (This)->lpVtbl -> get_Progress(This,pVal) - - #define IDxtKey_put_Progress(This,newVal) \ - (This)->lpVtbl -> put_Progress(This,newVal) - - #define IDxtKey_get_StepResolution(This,pVal) \ - (This)->lpVtbl -> get_StepResolution(This,pVal) - - #define IDxtKey_get_Duration(This,pVal) \ - (This)->lpVtbl -> get_Duration(This,pVal) - - #define IDxtKey_put_Duration(This,newVal) \ - (This)->lpVtbl -> put_Duration(This,newVal) - - - #define IDxtKey_get_KeyType(This,__MIDL_0028) \ - (This)->lpVtbl -> get_KeyType(This,__MIDL_0028) - - #define IDxtKey_put_KeyType(This,__MIDL_0029) \ - (This)->lpVtbl -> put_KeyType(This,__MIDL_0029) - - #define IDxtKey_get_Hue(This,__MIDL_0030) \ - (This)->lpVtbl -> get_Hue(This,__MIDL_0030) - - #define IDxtKey_put_Hue(This,__MIDL_0031) \ - (This)->lpVtbl -> put_Hue(This,__MIDL_0031) - - #define IDxtKey_get_Luminance(This,__MIDL_0032) \ - (This)->lpVtbl -> get_Luminance(This,__MIDL_0032) - - #define IDxtKey_put_Luminance(This,__MIDL_0033) \ - (This)->lpVtbl -> put_Luminance(This,__MIDL_0033) - - #define IDxtKey_get_RGB(This,__MIDL_0034) \ - (This)->lpVtbl -> get_RGB(This,__MIDL_0034) - - #define IDxtKey_put_RGB(This,__MIDL_0035) \ - (This)->lpVtbl -> put_RGB(This,__MIDL_0035) - - #define IDxtKey_get_Similarity(This,__MIDL_0036) \ - (This)->lpVtbl -> get_Similarity(This,__MIDL_0036) - - #define IDxtKey_put_Similarity(This,__MIDL_0037) \ - (This)->lpVtbl -> put_Similarity(This,__MIDL_0037) - - #define IDxtKey_get_Invert(This,__MIDL_0038) \ - (This)->lpVtbl -> get_Invert(This,__MIDL_0038) - - #define IDxtKey_put_Invert(This,__MIDL_0039) \ - (This)->lpVtbl -> put_Invert(This,__MIDL_0039) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_KeyType_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0028); - - - void __RPC_STUB IDxtKey_get_KeyType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_KeyType_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0029); - - - void __RPC_STUB IDxtKey_put_KeyType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Hue_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0030); - - - void __RPC_STUB IDxtKey_get_Hue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Hue_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0031); - - - void __RPC_STUB IDxtKey_put_Hue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Luminance_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0032); - - - void __RPC_STUB IDxtKey_get_Luminance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Luminance_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0033); - - - void __RPC_STUB IDxtKey_put_Luminance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_RGB_Proxy( - IDxtKey * This, - /* [retval][out] */ DWORD *__MIDL_0034); - - - void __RPC_STUB IDxtKey_get_RGB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_RGB_Proxy( - IDxtKey * This, - /* [in] */ DWORD __MIDL_0035); - - - void __RPC_STUB IDxtKey_put_RGB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Similarity_Proxy( - IDxtKey * This, - /* [retval][out] */ int *__MIDL_0036); - - - void __RPC_STUB IDxtKey_get_Similarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Similarity_Proxy( - IDxtKey * This, - /* [in] */ int __MIDL_0037); - - - void __RPC_STUB IDxtKey_put_Similarity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Invert_Proxy( - IDxtKey * This, - /* [retval][out] */ BOOL *__MIDL_0038); - - - void __RPC_STUB IDxtKey_get_Invert_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Invert_Proxy( - IDxtKey * This, - /* [in] */ BOOL __MIDL_0039); - - - void __RPC_STUB IDxtKey_put_Invert_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDxtKey_INTERFACE_DEFINED__ */ - - - #ifndef __IMediaLocator_INTERFACE_DEFINED__ - #define __IMediaLocator_INTERFACE_DEFINED__ - - /* interface IMediaLocator */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IMediaLocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("288581E0-66CE-11d2-918F-00C0DF10D434") - IMediaLocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE FindMediaFile( - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddFoundLocation( - BSTR DirectoryName) = 0; - - }; - - #else /* C style interface */ - - typedef struct IMediaLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaLocator * This); - - HRESULT ( STDMETHODCALLTYPE *FindMediaFile )( - IMediaLocator * This, - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags); - - HRESULT ( STDMETHODCALLTYPE *AddFoundLocation )( - IMediaLocator * This, - BSTR DirectoryName); - - END_INTERFACE - } IMediaLocatorVtbl; - - interface IMediaLocator - { - CONST_VTBL struct IMediaLocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IMediaLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IMediaLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IMediaLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IMediaLocator_FindMediaFile(This,Input,FilterString,pOutput,Flags) \ - (This)->lpVtbl -> FindMediaFile(This,Input,FilterString,pOutput,Flags) - - #define IMediaLocator_AddFoundLocation(This,DirectoryName) \ - (This)->lpVtbl -> AddFoundLocation(This,DirectoryName) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IMediaLocator_FindMediaFile_Proxy( - IMediaLocator * This, - BSTR Input, - BSTR FilterString, - BSTR *pOutput, - long Flags); - - - void __RPC_STUB IMediaLocator_FindMediaFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IMediaLocator_AddFoundLocation_Proxy( - IMediaLocator * This, - BSTR DirectoryName); - - - void __RPC_STUB IMediaLocator_AddFoundLocation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IMediaLocator_INTERFACE_DEFINED__ */ - - - #ifndef __IMediaDet_INTERFACE_DEFINED__ - #define __IMediaDet_INTERFACE_DEFINED__ - - /* interface IMediaDet */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IMediaDet; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA") - IMediaDet : public IUnknown - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filter( - /* [retval][out] */ IUnknown **pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filter( - /* [in] */ IUnknown *newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OutputStreams( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentStream( - /* [retval][out] */ long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentStream( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( - /* [retval][out] */ GUID *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamTypeB( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamLength( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filename( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filename( - /* [in] */ BSTR newVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetBitmapBits( - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteBitmapBits( - double StreamTime, - long Width, - long Height, - BSTR Filename) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamMediaType( - /* [retval][out] */ AM_MEDIA_TYPE *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSampleGrabber( - /* [out] */ ISampleGrabber **ppVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrameRate( - /* [retval][out] */ double *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnterBitmapGrabMode( - double SeekTime) = 0; - - }; - - #else /* C style interface */ - - typedef struct IMediaDetVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaDet * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaDet * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaDet * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filter )( - IMediaDet * This, - /* [retval][out] */ IUnknown **pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filter )( - IMediaDet * This, - /* [in] */ IUnknown *newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OutputStreams )( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentStream )( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CurrentStream )( - IMediaDet * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IMediaDet * This, - /* [retval][out] */ GUID *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamTypeB )( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamLength )( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filename )( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filename )( - IMediaDet * This, - /* [in] */ BSTR newVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetBitmapBits )( - IMediaDet * This, - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteBitmapBits )( - IMediaDet * This, - double StreamTime, - long Width, - long Height, - BSTR Filename); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamMediaType )( - IMediaDet * This, - /* [retval][out] */ AM_MEDIA_TYPE *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSampleGrabber )( - IMediaDet * This, - /* [out] */ ISampleGrabber **ppVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrameRate )( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EnterBitmapGrabMode )( - IMediaDet * This, - double SeekTime); - - END_INTERFACE - } IMediaDetVtbl; - - interface IMediaDet - { - CONST_VTBL struct IMediaDetVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IMediaDet_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IMediaDet_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IMediaDet_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IMediaDet_get_Filter(This,pVal) \ - (This)->lpVtbl -> get_Filter(This,pVal) - - #define IMediaDet_put_Filter(This,newVal) \ - (This)->lpVtbl -> put_Filter(This,newVal) - - #define IMediaDet_get_OutputStreams(This,pVal) \ - (This)->lpVtbl -> get_OutputStreams(This,pVal) - - #define IMediaDet_get_CurrentStream(This,pVal) \ - (This)->lpVtbl -> get_CurrentStream(This,pVal) - - #define IMediaDet_put_CurrentStream(This,newVal) \ - (This)->lpVtbl -> put_CurrentStream(This,newVal) - - #define IMediaDet_get_StreamType(This,pVal) \ - (This)->lpVtbl -> get_StreamType(This,pVal) - - #define IMediaDet_get_StreamTypeB(This,pVal) \ - (This)->lpVtbl -> get_StreamTypeB(This,pVal) - - #define IMediaDet_get_StreamLength(This,pVal) \ - (This)->lpVtbl -> get_StreamLength(This,pVal) - - #define IMediaDet_get_Filename(This,pVal) \ - (This)->lpVtbl -> get_Filename(This,pVal) - - #define IMediaDet_put_Filename(This,newVal) \ - (This)->lpVtbl -> put_Filename(This,newVal) - - #define IMediaDet_GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) \ - (This)->lpVtbl -> GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) - - #define IMediaDet_WriteBitmapBits(This,StreamTime,Width,Height,Filename) \ - (This)->lpVtbl -> WriteBitmapBits(This,StreamTime,Width,Height,Filename) - - #define IMediaDet_get_StreamMediaType(This,pVal) \ - (This)->lpVtbl -> get_StreamMediaType(This,pVal) - - #define IMediaDet_GetSampleGrabber(This,ppVal) \ - (This)->lpVtbl -> GetSampleGrabber(This,ppVal) - - #define IMediaDet_get_FrameRate(This,pVal) \ - (This)->lpVtbl -> get_FrameRate(This,pVal) - - #define IMediaDet_EnterBitmapGrabMode(This,SeekTime) \ - (This)->lpVtbl -> EnterBitmapGrabMode(This,SeekTime) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filter_Proxy( - IMediaDet * This, - /* [retval][out] */ IUnknown **pVal); - - - void __RPC_STUB IMediaDet_get_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filter_Proxy( - IMediaDet * This, - /* [in] */ IUnknown *newVal); - - - void __RPC_STUB IMediaDet_put_Filter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_OutputStreams_Proxy( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IMediaDet_get_OutputStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_CurrentStream_Proxy( - IMediaDet * This, - /* [retval][out] */ long *pVal); - - - void __RPC_STUB IMediaDet_get_CurrentStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_CurrentStream_Proxy( - IMediaDet * This, - /* [in] */ long newVal); - - - void __RPC_STUB IMediaDet_put_CurrentStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamType_Proxy( - IMediaDet * This, - /* [retval][out] */ GUID *pVal); - - - void __RPC_STUB IMediaDet_get_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamTypeB_Proxy( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IMediaDet_get_StreamTypeB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamLength_Proxy( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - - void __RPC_STUB IMediaDet_get_StreamLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filename_Proxy( - IMediaDet * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IMediaDet_get_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filename_Proxy( - IMediaDet * This, - /* [in] */ BSTR newVal); - - - void __RPC_STUB IMediaDet_put_Filename_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetBitmapBits_Proxy( - IMediaDet * This, - double StreamTime, - long *pBufferSize, - char *pBuffer, - long Width, - long Height); - - - void __RPC_STUB IMediaDet_GetBitmapBits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_WriteBitmapBits_Proxy( - IMediaDet * This, - double StreamTime, - long Width, - long Height, - BSTR Filename); - - - void __RPC_STUB IMediaDet_WriteBitmapBits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamMediaType_Proxy( - IMediaDet * This, - /* [retval][out] */ AM_MEDIA_TYPE *pVal); - - - void __RPC_STUB IMediaDet_get_StreamMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetSampleGrabber_Proxy( - IMediaDet * This, - /* [out] */ ISampleGrabber **ppVal); - - - void __RPC_STUB IMediaDet_GetSampleGrabber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_FrameRate_Proxy( - IMediaDet * This, - /* [retval][out] */ double *pVal); - - - void __RPC_STUB IMediaDet_get_FrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_EnterBitmapGrabMode_Proxy( - IMediaDet * This, - double SeekTime); - - - void __RPC_STUB IMediaDet_EnterBitmapGrabMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IMediaDet_INTERFACE_DEFINED__ */ - - - #ifndef __IGrfCache_INTERFACE_DEFINED__ - #define __IGrfCache_INTERFACE_DEFINED__ - - /* interface IGrfCache */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IGrfCache; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BE-B0C3-11D2-8D24-00A0C9441E20") - IGrfCache : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddFilter( - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ConnectPins( - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetGraph( - const IGraphBuilder *pGraph) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DoConnectionsNow( void) = 0; - - }; - - #else /* C style interface */ - - typedef struct IGrfCacheVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGrfCache * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGrfCache * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGrfCache * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IGrfCache * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IGrfCache * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IGrfCache * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IGrfCache * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ConnectPins )( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetGraph )( - IGrfCache * This, - const IGraphBuilder *pGraph); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DoConnectionsNow )( - IGrfCache * This); - - END_INTERFACE - } IGrfCacheVtbl; - - interface IGrfCache - { - CONST_VTBL struct IGrfCacheVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IGrfCache_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IGrfCache_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IGrfCache_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IGrfCache_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IGrfCache_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IGrfCache_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IGrfCache_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IGrfCache_AddFilter(This,ChainedCache,ID,pFilter,pName) \ - (This)->lpVtbl -> AddFilter(This,ChainedCache,ID,pFilter,pName) - - #define IGrfCache_ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) \ - (This)->lpVtbl -> ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) - - #define IGrfCache_SetGraph(This,pGraph) \ - (This)->lpVtbl -> SetGraph(This,pGraph) - - #define IGrfCache_DoConnectionsNow(This) \ - (This)->lpVtbl -> DoConnectionsNow(This) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_AddFilter_Proxy( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG ID, - const IBaseFilter *pFilter, - LPCWSTR pName); - - - void __RPC_STUB IGrfCache_AddFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_ConnectPins_Proxy( - IGrfCache * This, - IGrfCache *ChainedCache, - LONGLONG PinID1, - const IPin *pPin1, - LONGLONG PinID2, - const IPin *pPin2); - - - void __RPC_STUB IGrfCache_ConnectPins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_SetGraph_Proxy( - IGrfCache * This, - const IGraphBuilder *pGraph); - - - void __RPC_STUB IGrfCache_SetGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_DoConnectionsNow_Proxy( - IGrfCache * This); - - - void __RPC_STUB IGrfCache_DoConnectionsNow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IGrfCache_INTERFACE_DEFINED__ */ - - - #ifndef __IRenderEngine_INTERFACE_DEFINED__ - #define __IRenderEngine_INTERFACE_DEFINED__ - - /* interface IRenderEngine */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IRenderEngine; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6BEE3A81-66C9-11d2-918F-00C0DF10D434") - IRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetTimelineObject( - IAMTimeline *pTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineObject( - /* [out] */ IAMTimeline **ppTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilterGraph( - /* [out] */ IGraphBuilder **ppFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFilterGraph( - IGraphBuilder *pFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupOutputPin( - long Group, - /* [out] */ IPin **ppRenderPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ScrapIt( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderOutputPins( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVendorString( - /* [retval][out] */ BSTR *pVendorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectFrontEnd( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceConnectCallback( - IGrfCache *pCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDynamicReconnectLevel( - long Level) = 0; - - virtual HRESULT STDMETHODCALLTYPE DoSmartRecompression( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE UseInSmartRecompressionGraph( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceNameValidation( - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Decommit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCaps( - long Index, - long *pReturn) = 0; - - }; - - #else /* C style interface */ - - typedef struct IRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRenderEngine * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetTimelineObject )( - IRenderEngine * This, - IAMTimeline *pTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineObject )( - IRenderEngine * This, - /* [out] */ IAMTimeline **ppTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetFilterGraph )( - IRenderEngine * This, - /* [out] */ IGraphBuilder **ppFG); - - HRESULT ( STDMETHODCALLTYPE *SetFilterGraph )( - IRenderEngine * This, - IGraphBuilder *pFG); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *GetGroupOutputPin )( - IRenderEngine * This, - long Group, - /* [out] */ IPin **ppRenderPin); - - HRESULT ( STDMETHODCALLTYPE *ScrapIt )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *RenderOutputPins )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetVendorString )( - IRenderEngine * This, - /* [retval][out] */ BSTR *pVendorID); - - HRESULT ( STDMETHODCALLTYPE *ConnectFrontEnd )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceConnectCallback )( - IRenderEngine * This, - IGrfCache *pCallback); - - HRESULT ( STDMETHODCALLTYPE *SetDynamicReconnectLevel )( - IRenderEngine * This, - long Level); - - HRESULT ( STDMETHODCALLTYPE *DoSmartRecompression )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *UseInSmartRecompressionGraph )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceNameValidation )( - IRenderEngine * This, - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *Decommit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetCaps )( - IRenderEngine * This, - long Index, - long *pReturn); - - END_INTERFACE - } IRenderEngineVtbl; - - interface IRenderEngine - { - CONST_VTBL struct IRenderEngineVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IRenderEngine_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IRenderEngine_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IRenderEngine_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IRenderEngine_SetTimelineObject(This,pTimeline) \ - (This)->lpVtbl -> SetTimelineObject(This,pTimeline) - - #define IRenderEngine_GetTimelineObject(This,ppTimeline) \ - (This)->lpVtbl -> GetTimelineObject(This,ppTimeline) - - #define IRenderEngine_GetFilterGraph(This,ppFG) \ - (This)->lpVtbl -> GetFilterGraph(This,ppFG) - - #define IRenderEngine_SetFilterGraph(This,pFG) \ - (This)->lpVtbl -> SetFilterGraph(This,pFG) - - #define IRenderEngine_SetInterestRange(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange(This,Start,Stop) - - #define IRenderEngine_SetInterestRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange2(This,Start,Stop) - - #define IRenderEngine_SetRenderRange(This,Start,Stop) \ - (This)->lpVtbl -> SetRenderRange(This,Start,Stop) - - #define IRenderEngine_SetRenderRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetRenderRange2(This,Start,Stop) - - #define IRenderEngine_GetGroupOutputPin(This,Group,ppRenderPin) \ - (This)->lpVtbl -> GetGroupOutputPin(This,Group,ppRenderPin) - - #define IRenderEngine_ScrapIt(This) \ - (This)->lpVtbl -> ScrapIt(This) - - #define IRenderEngine_RenderOutputPins(This) \ - (This)->lpVtbl -> RenderOutputPins(This) - - #define IRenderEngine_GetVendorString(This,pVendorID) \ - (This)->lpVtbl -> GetVendorString(This,pVendorID) - - #define IRenderEngine_ConnectFrontEnd(This) \ - (This)->lpVtbl -> ConnectFrontEnd(This) - - #define IRenderEngine_SetSourceConnectCallback(This,pCallback) \ - (This)->lpVtbl -> SetSourceConnectCallback(This,pCallback) - - #define IRenderEngine_SetDynamicReconnectLevel(This,Level) \ - (This)->lpVtbl -> SetDynamicReconnectLevel(This,Level) - - #define IRenderEngine_DoSmartRecompression(This) \ - (This)->lpVtbl -> DoSmartRecompression(This) - - #define IRenderEngine_UseInSmartRecompressionGraph(This) \ - (This)->lpVtbl -> UseInSmartRecompressionGraph(This) - - #define IRenderEngine_SetSourceNameValidation(This,FilterString,pOverride,Flags) \ - (This)->lpVtbl -> SetSourceNameValidation(This,FilterString,pOverride,Flags) - - #define IRenderEngine_Commit(This) \ - (This)->lpVtbl -> Commit(This) - - #define IRenderEngine_Decommit(This) \ - (This)->lpVtbl -> Decommit(This) - - #define IRenderEngine_GetCaps(This,Index,pReturn) \ - (This)->lpVtbl -> GetCaps(This,Index,pReturn) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetTimelineObject_Proxy( - IRenderEngine * This, - IAMTimeline *pTimeline); - - - void __RPC_STUB IRenderEngine_SetTimelineObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_GetTimelineObject_Proxy( - IRenderEngine * This, - /* [out] */ IAMTimeline **ppTimeline); - - - void __RPC_STUB IRenderEngine_GetTimelineObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_GetFilterGraph_Proxy( - IRenderEngine * This, - /* [out] */ IGraphBuilder **ppFG); - - - void __RPC_STUB IRenderEngine_GetFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetFilterGraph_Proxy( - IRenderEngine * This, - IGraphBuilder *pFG); - - - void __RPC_STUB IRenderEngine_SetFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange_Proxy( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IRenderEngine_SetInterestRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange2_Proxy( - IRenderEngine * This, - double Start, - double Stop); - - - void __RPC_STUB IRenderEngine_SetInterestRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange_Proxy( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IRenderEngine_SetRenderRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange2_Proxy( - IRenderEngine * This, - double Start, - double Stop); - - - void __RPC_STUB IRenderEngine_SetRenderRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_GetGroupOutputPin_Proxy( - IRenderEngine * This, - long Group, - /* [out] */ IPin **ppRenderPin); - - - void __RPC_STUB IRenderEngine_GetGroupOutputPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_ScrapIt_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_ScrapIt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_RenderOutputPins_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_RenderOutputPins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_GetVendorString_Proxy( - IRenderEngine * This, - /* [retval][out] */ BSTR *pVendorID); - - - void __RPC_STUB IRenderEngine_GetVendorString_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_ConnectFrontEnd_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_ConnectFrontEnd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceConnectCallback_Proxy( - IRenderEngine * This, - IGrfCache *pCallback); - - - void __RPC_STUB IRenderEngine_SetSourceConnectCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetDynamicReconnectLevel_Proxy( - IRenderEngine * This, - long Level); - - - void __RPC_STUB IRenderEngine_SetDynamicReconnectLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_DoSmartRecompression_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_DoSmartRecompression_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_UseInSmartRecompressionGraph_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_UseInSmartRecompressionGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceNameValidation_Proxy( - IRenderEngine * This, - BSTR FilterString, - IMediaLocator *pOverride, - LONG Flags); - - - void __RPC_STUB IRenderEngine_SetSourceNameValidation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_Commit_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_Commit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_Decommit_Proxy( - IRenderEngine * This); - - - void __RPC_STUB IRenderEngine_Decommit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IRenderEngine_GetCaps_Proxy( - IRenderEngine * This, - long Index, - long *pReturn); - - - void __RPC_STUB IRenderEngine_GetCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IRenderEngine_INTERFACE_DEFINED__ */ - - - #ifndef __IFindCompressorCB_INTERFACE_DEFINED__ - #define __IFindCompressorCB_INTERFACE_DEFINED__ - - /* interface IFindCompressorCB */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IFindCompressorCB; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8DE-879A-4d59-9B2C-26BB1CF83461") - IFindCompressorCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCompressor( - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter) = 0; - - }; - - #else /* C style interface */ - - typedef struct IFindCompressorCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFindCompressorCB * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFindCompressorCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFindCompressorCB * This); - - HRESULT ( STDMETHODCALLTYPE *GetCompressor )( - IFindCompressorCB * This, - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter); - - END_INTERFACE - } IFindCompressorCBVtbl; - - interface IFindCompressorCB - { - CONST_VTBL struct IFindCompressorCBVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IFindCompressorCB_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IFindCompressorCB_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IFindCompressorCB_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IFindCompressorCB_GetCompressor(This,pType,pCompType,ppFilter) \ - (This)->lpVtbl -> GetCompressor(This,pType,pCompType,ppFilter) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IFindCompressorCB_GetCompressor_Proxy( - IFindCompressorCB * This, - AM_MEDIA_TYPE *pType, - AM_MEDIA_TYPE *pCompType, - /* [out] */ IBaseFilter **ppFilter); - - - void __RPC_STUB IFindCompressorCB_GetCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IFindCompressorCB_INTERFACE_DEFINED__ */ - - - #ifndef __ISmartRenderEngine_INTERFACE_DEFINED__ - #define __ISmartRenderEngine_INTERFACE_DEFINED__ - - /* interface ISmartRenderEngine */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_ISmartRenderEngine; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8CE-879A-4d59-9B2C-26BB1CF83461") - ISmartRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetGroupCompressor( - long Group, - IBaseFilter *pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCompressor( - long Group, - IBaseFilter **pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFindCompressorCB( - IFindCompressorCB *pCallback) = 0; - - }; - - #else /* C style interface */ - - typedef struct ISmartRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISmartRenderEngine * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISmartRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISmartRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - IBaseFilter *pCompressor); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - IBaseFilter **pCompressor); - - HRESULT ( STDMETHODCALLTYPE *SetFindCompressorCB )( - ISmartRenderEngine * This, - IFindCompressorCB *pCallback); - - END_INTERFACE - } ISmartRenderEngineVtbl; - - interface ISmartRenderEngine - { - CONST_VTBL struct ISmartRenderEngineVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ISmartRenderEngine_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ISmartRenderEngine_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ISmartRenderEngine_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ISmartRenderEngine_SetGroupCompressor(This,Group,pCompressor) \ - (This)->lpVtbl -> SetGroupCompressor(This,Group,pCompressor) - - #define ISmartRenderEngine_GetGroupCompressor(This,Group,pCompressor) \ - (This)->lpVtbl -> GetGroupCompressor(This,Group,pCompressor) - - #define ISmartRenderEngine_SetFindCompressorCB(This,pCallback) \ - (This)->lpVtbl -> SetFindCompressorCB(This,pCallback) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetGroupCompressor_Proxy( - ISmartRenderEngine * This, - long Group, - IBaseFilter *pCompressor); - - - void __RPC_STUB ISmartRenderEngine_SetGroupCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISmartRenderEngine_GetGroupCompressor_Proxy( - ISmartRenderEngine * This, - long Group, - IBaseFilter **pCompressor); - - - void __RPC_STUB ISmartRenderEngine_GetGroupCompressor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetFindCompressorCB_Proxy( - ISmartRenderEngine * This, - IFindCompressorCB *pCallback); - - - void __RPC_STUB ISmartRenderEngine_SetFindCompressorCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ISmartRenderEngine_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineObj_INTERFACE_DEFINED__ - #define __IAMTimelineObj_INTERFACE_DEFINED__ - - /* interface IAMTimelineObj */ - /* [unique][helpstring][uuid][local][object] */ - - - EXTERN_C const IID IID_IAMTimelineObj; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B77-61F9-11D2-8CAD-00A024580902") - IAMTimelineObj : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertySetter( - /* [retval][out] */ IPropertySetter **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPropertySetter( - IPropertySetter *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObject( - /* [retval][out] */ IUnknown **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObject( - IUnknown *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUID( - GUID newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUIDB( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUID( - GUID *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUIDB( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectLoaded( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimelineType( - TIMELINE_MAJOR_TYPE *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimelineType( - TIMELINE_MAJOR_TYPE newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserID( - long newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGenID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserName( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserData( - BYTE *pData, - long *pSize) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserData( - BYTE *pData, - long Size) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMuted( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMuted( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLocked( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLocked( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ClearDirty( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Remove( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveAll( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineNoRef( - IAMTimeline **ppResult) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupIBelongTo( - /* [out] */ IAMTimelineGroup **ppGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEmbedDepth( - long *pVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineObjVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineObj * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineObj * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertySetter )( - IAMTimelineObj * This, - /* [retval][out] */ IPropertySetter **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPropertySetter )( - IAMTimelineObj * This, - IPropertySetter *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObject )( - IAMTimelineObj * This, - /* [retval][out] */ IUnknown **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObject )( - IAMTimelineObj * This, - IUnknown *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUID )( - IAMTimelineObj * This, - GUID newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUIDB )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUID )( - IAMTimelineObj * This, - GUID *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUIDB )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectLoaded )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserID )( - IAMTimelineObj * This, - long newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGenID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserName )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserName )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long *pSize); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long Size); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMuted )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMuted )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLocked )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLocked )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ClearDirty )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveAll )( - IAMTimelineObj * This); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineNoRef )( - IAMTimelineObj * This, - IAMTimeline **ppResult); - - HRESULT ( STDMETHODCALLTYPE *GetGroupIBelongTo )( - IAMTimelineObj * This, - /* [out] */ IAMTimelineGroup **ppGroup); - - HRESULT ( STDMETHODCALLTYPE *GetEmbedDepth )( - IAMTimelineObj * This, - long *pVal); - - END_INTERFACE - } IAMTimelineObjVtbl; - - interface IAMTimelineObj - { - CONST_VTBL struct IAMTimelineObjVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineObj_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineObj_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineObj_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineObj_GetStartStop(This,pStart,pStop) \ - (This)->lpVtbl -> GetStartStop(This,pStart,pStop) - - #define IAMTimelineObj_GetStartStop2(This,pStart,pStop) \ - (This)->lpVtbl -> GetStartStop2(This,pStart,pStop) - - #define IAMTimelineObj_FixTimes(This,pStart,pStop) \ - (This)->lpVtbl -> FixTimes(This,pStart,pStop) - - #define IAMTimelineObj_FixTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> FixTimes2(This,pStart,pStop) - - #define IAMTimelineObj_SetStartStop(This,Start,Stop) \ - (This)->lpVtbl -> SetStartStop(This,Start,Stop) - - #define IAMTimelineObj_SetStartStop2(This,Start,Stop) \ - (This)->lpVtbl -> SetStartStop2(This,Start,Stop) - - #define IAMTimelineObj_GetPropertySetter(This,pVal) \ - (This)->lpVtbl -> GetPropertySetter(This,pVal) - - #define IAMTimelineObj_SetPropertySetter(This,newVal) \ - (This)->lpVtbl -> SetPropertySetter(This,newVal) - - #define IAMTimelineObj_GetSubObject(This,pVal) \ - (This)->lpVtbl -> GetSubObject(This,pVal) - - #define IAMTimelineObj_SetSubObject(This,newVal) \ - (This)->lpVtbl -> SetSubObject(This,newVal) - - #define IAMTimelineObj_SetSubObjectGUID(This,newVal) \ - (This)->lpVtbl -> SetSubObjectGUID(This,newVal) - - #define IAMTimelineObj_SetSubObjectGUIDB(This,newVal) \ - (This)->lpVtbl -> SetSubObjectGUIDB(This,newVal) - - #define IAMTimelineObj_GetSubObjectGUID(This,pVal) \ - (This)->lpVtbl -> GetSubObjectGUID(This,pVal) - - #define IAMTimelineObj_GetSubObjectGUIDB(This,pVal) \ - (This)->lpVtbl -> GetSubObjectGUIDB(This,pVal) - - #define IAMTimelineObj_GetSubObjectLoaded(This,pVal) \ - (This)->lpVtbl -> GetSubObjectLoaded(This,pVal) - - #define IAMTimelineObj_GetTimelineType(This,pVal) \ - (This)->lpVtbl -> GetTimelineType(This,pVal) - - #define IAMTimelineObj_SetTimelineType(This,newVal) \ - (This)->lpVtbl -> SetTimelineType(This,newVal) - - #define IAMTimelineObj_GetUserID(This,pVal) \ - (This)->lpVtbl -> GetUserID(This,pVal) - - #define IAMTimelineObj_SetUserID(This,newVal) \ - (This)->lpVtbl -> SetUserID(This,newVal) - - #define IAMTimelineObj_GetGenID(This,pVal) \ - (This)->lpVtbl -> GetGenID(This,pVal) - - #define IAMTimelineObj_GetUserName(This,pVal) \ - (This)->lpVtbl -> GetUserName(This,pVal) - - #define IAMTimelineObj_SetUserName(This,newVal) \ - (This)->lpVtbl -> SetUserName(This,newVal) - - #define IAMTimelineObj_GetUserData(This,pData,pSize) \ - (This)->lpVtbl -> GetUserData(This,pData,pSize) - - #define IAMTimelineObj_SetUserData(This,pData,Size) \ - (This)->lpVtbl -> SetUserData(This,pData,Size) - - #define IAMTimelineObj_GetMuted(This,pVal) \ - (This)->lpVtbl -> GetMuted(This,pVal) - - #define IAMTimelineObj_SetMuted(This,newVal) \ - (This)->lpVtbl -> SetMuted(This,newVal) - - #define IAMTimelineObj_GetLocked(This,pVal) \ - (This)->lpVtbl -> GetLocked(This,pVal) - - #define IAMTimelineObj_SetLocked(This,newVal) \ - (This)->lpVtbl -> SetLocked(This,newVal) - - #define IAMTimelineObj_GetDirtyRange(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) - - #define IAMTimelineObj_GetDirtyRange2(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange2(This,pStart,pStop) - - #define IAMTimelineObj_SetDirtyRange(This,Start,Stop) \ - (This)->lpVtbl -> SetDirtyRange(This,Start,Stop) - - #define IAMTimelineObj_SetDirtyRange2(This,Start,Stop) \ - (This)->lpVtbl -> SetDirtyRange2(This,Start,Stop) - - #define IAMTimelineObj_ClearDirty(This) \ - (This)->lpVtbl -> ClearDirty(This) - - #define IAMTimelineObj_Remove(This) \ - (This)->lpVtbl -> Remove(This) - - #define IAMTimelineObj_RemoveAll(This) \ - (This)->lpVtbl -> RemoveAll(This) - - #define IAMTimelineObj_GetTimelineNoRef(This,ppResult) \ - (This)->lpVtbl -> GetTimelineNoRef(This,ppResult) - - #define IAMTimelineObj_GetGroupIBelongTo(This,ppGroup) \ - (This)->lpVtbl -> GetGroupIBelongTo(This,ppGroup) - - #define IAMTimelineObj_GetEmbedDepth(This,pVal) \ - (This)->lpVtbl -> GetEmbedDepth(This,pVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimelineObj_GetStartStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - - void __RPC_STUB IAMTimelineObj_GetStartStop2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimelineObj_FixTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - - void __RPC_STUB IAMTimelineObj_FixTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IAMTimelineObj_SetStartStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop2_Proxy( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - - void __RPC_STUB IAMTimelineObj_SetStartStop2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetPropertySetter_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ IPropertySetter **pVal); - - - void __RPC_STUB IAMTimelineObj_GetPropertySetter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetPropertySetter_Proxy( - IAMTimelineObj * This, - IPropertySetter *newVal); - - - void __RPC_STUB IAMTimelineObj_SetPropertySetter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObject_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ IUnknown **pVal); - - - void __RPC_STUB IAMTimelineObj_GetSubObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObject_Proxy( - IAMTimelineObj * This, - IUnknown *newVal); - - - void __RPC_STUB IAMTimelineObj_SetSubObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUID_Proxy( - IAMTimelineObj * This, - GUID newVal); - - - void __RPC_STUB IAMTimelineObj_SetSubObjectGUID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUIDB_Proxy( - IAMTimelineObj * This, - BSTR newVal); - - - void __RPC_STUB IAMTimelineObj_SetSubObjectGUIDB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUID_Proxy( - IAMTimelineObj * This, - GUID *pVal); - - - void __RPC_STUB IAMTimelineObj_GetSubObjectGUID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUIDB_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IAMTimelineObj_GetSubObjectGUIDB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectLoaded_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineObj_GetSubObjectLoaded_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineType_Proxy( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE *pVal); - - - void __RPC_STUB IAMTimelineObj_GetTimelineType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetTimelineType_Proxy( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE newVal); - - - void __RPC_STUB IAMTimelineObj_SetTimelineType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserID_Proxy( - IAMTimelineObj * This, - long *pVal); - - - void __RPC_STUB IAMTimelineObj_GetUserID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserID_Proxy( - IAMTimelineObj * This, - long newVal); - - - void __RPC_STUB IAMTimelineObj_SetUserID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGenID_Proxy( - IAMTimelineObj * This, - long *pVal); - - - void __RPC_STUB IAMTimelineObj_GetGenID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserName_Proxy( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IAMTimelineObj_GetUserName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserName_Proxy( - IAMTimelineObj * This, - BSTR newVal); - - - void __RPC_STUB IAMTimelineObj_SetUserName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserData_Proxy( - IAMTimelineObj * This, - BYTE *pData, - long *pSize); - - - void __RPC_STUB IAMTimelineObj_GetUserData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserData_Proxy( - IAMTimelineObj * This, - BYTE *pData, - long Size); - - - void __RPC_STUB IAMTimelineObj_SetUserData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetMuted_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineObj_GetMuted_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetMuted_Proxy( - IAMTimelineObj * This, - BOOL newVal); - - - void __RPC_STUB IAMTimelineObj_SetMuted_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetLocked_Proxy( - IAMTimelineObj * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineObj_GetLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetLocked_Proxy( - IAMTimelineObj * This, - BOOL newVal); - - - void __RPC_STUB IAMTimelineObj_SetLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimelineObj_GetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange2_Proxy( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - - void __RPC_STUB IAMTimelineObj_GetDirtyRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange_Proxy( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IAMTimelineObj_SetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange2_Proxy( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - - void __RPC_STUB IAMTimelineObj_SetDirtyRange2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_ClearDirty_Proxy( - IAMTimelineObj * This); - - - void __RPC_STUB IAMTimelineObj_ClearDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_Remove_Proxy( - IAMTimelineObj * This); - - - void __RPC_STUB IAMTimelineObj_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_RemoveAll_Proxy( - IAMTimelineObj * This); - - - void __RPC_STUB IAMTimelineObj_RemoveAll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineNoRef_Proxy( - IAMTimelineObj * This, - IAMTimeline **ppResult); - - - void __RPC_STUB IAMTimelineObj_GetTimelineNoRef_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGroupIBelongTo_Proxy( - IAMTimelineObj * This, - /* [out] */ IAMTimelineGroup **ppGroup); - - - void __RPC_STUB IAMTimelineObj_GetGroupIBelongTo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetEmbedDepth_Proxy( - IAMTimelineObj * This, - long *pVal); - - - void __RPC_STUB IAMTimelineObj_GetEmbedDepth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineObj_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineEffectable_INTERFACE_DEFINED__ - #define __IAMTimelineEffectable_INTERFACE_DEFINED__ - - /* interface IAMTimelineEffectable */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineEffectable; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58537-622E-11d2-8CAD-00A024580902") - IAMTimelineEffectable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectInsBefore( - IAMTimelineObj *pFX, - long priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectSwapPriorities( - long PriorityA, - long PriorityB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetCount( - long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEffect( - /* [out] */ IAMTimelineObj **ppFx, - long Which) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineEffectableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffectable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffectable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffectable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectInsBefore )( - IAMTimelineEffectable * This, - IAMTimelineObj *pFX, - long priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectSwapPriorities )( - IAMTimelineEffectable * This, - long PriorityA, - long PriorityB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetCount )( - IAMTimelineEffectable * This, - long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetEffect )( - IAMTimelineEffectable * This, - /* [out] */ IAMTimelineObj **ppFx, - long Which); - - END_INTERFACE - } IAMTimelineEffectableVtbl; - - interface IAMTimelineEffectable - { - CONST_VTBL struct IAMTimelineEffectableVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineEffectable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineEffectable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineEffectable_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineEffectable_EffectInsBefore(This,pFX,priority) \ - (This)->lpVtbl -> EffectInsBefore(This,pFX,priority) - - #define IAMTimelineEffectable_EffectSwapPriorities(This,PriorityA,PriorityB) \ - (This)->lpVtbl -> EffectSwapPriorities(This,PriorityA,PriorityB) - - #define IAMTimelineEffectable_EffectGetCount(This,pCount) \ - (This)->lpVtbl -> EffectGetCount(This,pCount) - - #define IAMTimelineEffectable_GetEffect(This,ppFx,Which) \ - (This)->lpVtbl -> GetEffect(This,ppFx,Which) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectInsBefore_Proxy( - IAMTimelineEffectable * This, - IAMTimelineObj *pFX, - long priority); - - - void __RPC_STUB IAMTimelineEffectable_EffectInsBefore_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectSwapPriorities_Proxy( - IAMTimelineEffectable * This, - long PriorityA, - long PriorityB); - - - void __RPC_STUB IAMTimelineEffectable_EffectSwapPriorities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectGetCount_Proxy( - IAMTimelineEffectable * This, - long *pCount); - - - void __RPC_STUB IAMTimelineEffectable_EffectGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_GetEffect_Proxy( - IAMTimelineEffectable * This, - /* [out] */ IAMTimelineObj **ppFx, - long Which); - - - void __RPC_STUB IAMTimelineEffectable_GetEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineEffectable_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineEffect_INTERFACE_DEFINED__ - #define __IAMTimelineEffect_INTERFACE_DEFINED__ - - /* interface IAMTimelineEffect */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineEffect; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C264-622D-11d2-8CAD-00A024580902") - IAMTimelineEffect : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetPriority( - long *pVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineEffectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffect * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffect * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffect * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetPriority )( - IAMTimelineEffect * This, - long *pVal); - - END_INTERFACE - } IAMTimelineEffectVtbl; - - interface IAMTimelineEffect - { - CONST_VTBL struct IAMTimelineEffectVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineEffect_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineEffect_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineEffect_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineEffect_EffectGetPriority(This,pVal) \ - (This)->lpVtbl -> EffectGetPriority(This,pVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffect_EffectGetPriority_Proxy( - IAMTimelineEffect * This, - long *pVal); - - - void __RPC_STUB IAMTimelineEffect_EffectGetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineEffect_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineTransable_INTERFACE_DEFINED__ - #define __IAMTimelineTransable_INTERFACE_DEFINED__ - - /* interface IAMTimelineTransable */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineTransable; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("378FA386-622E-11d2-8CAD-00A024580902") - IAMTimelineTransable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransAdd( - IAMTimelineObj *pTrans) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransGetCount( - long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans( - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans2( - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime( - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime2( - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineTransableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTransable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTransable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTransable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransAdd )( - IAMTimelineTransable * This, - IAMTimelineObj *pTrans); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransGetCount )( - IAMTimelineTransable * This, - long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans2 )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime2 )( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection); - - END_INTERFACE - } IAMTimelineTransableVtbl; - - interface IAMTimelineTransable - { - CONST_VTBL struct IAMTimelineTransableVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineTransable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineTransable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineTransable_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineTransable_TransAdd(This,pTrans) \ - (This)->lpVtbl -> TransAdd(This,pTrans) - - #define IAMTimelineTransable_TransGetCount(This,pCount) \ - (This)->lpVtbl -> TransGetCount(This,pCount) - - #define IAMTimelineTransable_GetNextTrans(This,ppTrans,pInOut) \ - (This)->lpVtbl -> GetNextTrans(This,ppTrans,pInOut) - - #define IAMTimelineTransable_GetNextTrans2(This,ppTrans,pInOut) \ - (This)->lpVtbl -> GetNextTrans2(This,ppTrans,pInOut) - - #define IAMTimelineTransable_GetTransAtTime(This,ppObj,Time,SearchDirection) \ - (This)->lpVtbl -> GetTransAtTime(This,ppObj,Time,SearchDirection) - - #define IAMTimelineTransable_GetTransAtTime2(This,ppObj,Time,SearchDirection) \ - (This)->lpVtbl -> GetTransAtTime2(This,ppObj,Time,SearchDirection) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransAdd_Proxy( - IAMTimelineTransable * This, - IAMTimelineObj *pTrans); - - - void __RPC_STUB IAMTimelineTransable_TransAdd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransGetCount_Proxy( - IAMTimelineTransable * This, - long *pCount); - - - void __RPC_STUB IAMTimelineTransable_TransGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFERENCE_TIME *pInOut); - - - void __RPC_STUB IAMTimelineTransable_GetNextTrans_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans2_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppTrans, - REFTIME *pInOut); - - - void __RPC_STUB IAMTimelineTransable_GetNextTrans2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection); - - - void __RPC_STUB IAMTimelineTransable_GetTransAtTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime2_Proxy( - IAMTimelineTransable * This, - /* [out] */ IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection); - - - void __RPC_STUB IAMTimelineTransable_GetTransAtTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineTransable_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineSplittable_INTERFACE_DEFINED__ - #define __IAMTimelineSplittable_INTERFACE_DEFINED__ - - /* interface IAMTimelineSplittable */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineSplittable; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A0F840A0-D590-11d2-8D55-00A0C9441E20") - IAMTimelineSplittable : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SplitAt( - REFERENCE_TIME Time) = 0; - - virtual HRESULT STDMETHODCALLTYPE SplitAt2( - REFTIME Time) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineSplittableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSplittable * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSplittable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSplittable * This); - - HRESULT ( STDMETHODCALLTYPE *SplitAt )( - IAMTimelineSplittable * This, - REFERENCE_TIME Time); - - HRESULT ( STDMETHODCALLTYPE *SplitAt2 )( - IAMTimelineSplittable * This, - REFTIME Time); - - END_INTERFACE - } IAMTimelineSplittableVtbl; - - interface IAMTimelineSplittable - { - CONST_VTBL struct IAMTimelineSplittableVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineSplittable_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineSplittable_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineSplittable_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineSplittable_SplitAt(This,Time) \ - (This)->lpVtbl -> SplitAt(This,Time) - - #define IAMTimelineSplittable_SplitAt2(This,Time) \ - (This)->lpVtbl -> SplitAt2(This,Time) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt_Proxy( - IAMTimelineSplittable * This, - REFERENCE_TIME Time); - - - void __RPC_STUB IAMTimelineSplittable_SplitAt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt2_Proxy( - IAMTimelineSplittable * This, - REFTIME Time); - - - void __RPC_STUB IAMTimelineSplittable_SplitAt2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineSplittable_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineTrans_INTERFACE_DEFINED__ - #define __IAMTimelineTrans_INTERFACE_DEFINED__ - - /* interface IAMTimelineTrans */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineTrans; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C265-622D-11d2-8CAD-00A024580902") - IAMTimelineTrans : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint( - REFERENCE_TIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint2( - REFTIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint( - REFERENCE_TIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint2( - REFTIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSwapInputs( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSwapInputs( - BOOL pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutsOnly( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutsOnly( - BOOL pVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineTransVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrans * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrans * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrans * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint )( - IAMTimelineTrans * This, - REFERENCE_TIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint2 )( - IAMTimelineTrans * This, - REFTIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint )( - IAMTimelineTrans * This, - REFERENCE_TIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint2 )( - IAMTimelineTrans * This, - REFTIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSwapInputs )( - IAMTimelineTrans * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSwapInputs )( - IAMTimelineTrans * This, - BOOL pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutsOnly )( - IAMTimelineTrans * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutsOnly )( - IAMTimelineTrans * This, - BOOL pVal); - - END_INTERFACE - } IAMTimelineTransVtbl; - - interface IAMTimelineTrans - { - CONST_VTBL struct IAMTimelineTransVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineTrans_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineTrans_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineTrans_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineTrans_GetCutPoint(This,pTLTime) \ - (This)->lpVtbl -> GetCutPoint(This,pTLTime) - - #define IAMTimelineTrans_GetCutPoint2(This,pTLTime) \ - (This)->lpVtbl -> GetCutPoint2(This,pTLTime) - - #define IAMTimelineTrans_SetCutPoint(This,TLTime) \ - (This)->lpVtbl -> SetCutPoint(This,TLTime) - - #define IAMTimelineTrans_SetCutPoint2(This,TLTime) \ - (This)->lpVtbl -> SetCutPoint2(This,TLTime) - - #define IAMTimelineTrans_GetSwapInputs(This,pVal) \ - (This)->lpVtbl -> GetSwapInputs(This,pVal) - - #define IAMTimelineTrans_SetSwapInputs(This,pVal) \ - (This)->lpVtbl -> SetSwapInputs(This,pVal) - - #define IAMTimelineTrans_GetCutsOnly(This,pVal) \ - (This)->lpVtbl -> GetCutsOnly(This,pVal) - - #define IAMTimelineTrans_SetCutsOnly(This,pVal) \ - (This)->lpVtbl -> SetCutsOnly(This,pVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint_Proxy( - IAMTimelineTrans * This, - REFERENCE_TIME *pTLTime); - - - void __RPC_STUB IAMTimelineTrans_GetCutPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint2_Proxy( - IAMTimelineTrans * This, - REFTIME *pTLTime); - - - void __RPC_STUB IAMTimelineTrans_GetCutPoint2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint_Proxy( - IAMTimelineTrans * This, - REFERENCE_TIME TLTime); - - - void __RPC_STUB IAMTimelineTrans_SetCutPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint2_Proxy( - IAMTimelineTrans * This, - REFTIME TLTime); - - - void __RPC_STUB IAMTimelineTrans_SetCutPoint2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetSwapInputs_Proxy( - IAMTimelineTrans * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineTrans_GetSwapInputs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetSwapInputs_Proxy( - IAMTimelineTrans * This, - BOOL pVal); - - - void __RPC_STUB IAMTimelineTrans_SetSwapInputs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutsOnly_Proxy( - IAMTimelineTrans * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineTrans_GetCutsOnly_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutsOnly_Proxy( - IAMTimelineTrans * This, - BOOL pVal); - - - void __RPC_STUB IAMTimelineTrans_SetCutsOnly_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineTrans_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineSrc_INTERFACE_DEFINED__ - #define __IAMTimelineSrc_INTERFACE_DEFINED__ - - /* interface IAMTimelineSrc */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineSrc; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B79-61F9-11D2-8CAD-00A024580902") - IAMTimelineSrc : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime( - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime2( - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength( - REFERENCE_TIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength2( - REFTIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength( - REFERENCE_TIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength2( - REFTIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaName( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SpliceWithNext( - IAMTimelineObj *pNext) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStreamNumber( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStreamNumber( - long Val) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsNormalRate( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStretchMode( - int *pnStretchMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStretchMode( - int nStretchMode) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineSrcVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSrc * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSrc * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSrc * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime )( - IAMTimelineSrc * This, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime2 )( - IAMTimelineSrc * This, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength )( - IAMTimelineSrc * This, - REFERENCE_TIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength2 )( - IAMTimelineSrc * This, - REFTIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength )( - IAMTimelineSrc * This, - REFERENCE_TIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength2 )( - IAMTimelineSrc * This, - REFTIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaName )( - IAMTimelineSrc * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaName )( - IAMTimelineSrc * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SpliceWithNext )( - IAMTimelineSrc * This, - IAMTimelineObj *pNext); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStreamNumber )( - IAMTimelineSrc * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStreamNumber )( - IAMTimelineSrc * This, - long Val); - - HRESULT ( STDMETHODCALLTYPE *IsNormalRate )( - IAMTimelineSrc * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimelineSrc * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimelineSrc * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStretchMode )( - IAMTimelineSrc * This, - int *pnStretchMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStretchMode )( - IAMTimelineSrc * This, - int nStretchMode); - - END_INTERFACE - } IAMTimelineSrcVtbl; - - interface IAMTimelineSrc - { - CONST_VTBL struct IAMTimelineSrcVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineSrc_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineSrc_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineSrc_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineSrc_GetMediaTimes(This,pStart,pStop) \ - (This)->lpVtbl -> GetMediaTimes(This,pStart,pStop) - - #define IAMTimelineSrc_GetMediaTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> GetMediaTimes2(This,pStart,pStop) - - #define IAMTimelineSrc_ModifyStopTime(This,Stop) \ - (This)->lpVtbl -> ModifyStopTime(This,Stop) - - #define IAMTimelineSrc_ModifyStopTime2(This,Stop) \ - (This)->lpVtbl -> ModifyStopTime2(This,Stop) - - #define IAMTimelineSrc_FixMediaTimes(This,pStart,pStop) \ - (This)->lpVtbl -> FixMediaTimes(This,pStart,pStop) - - #define IAMTimelineSrc_FixMediaTimes2(This,pStart,pStop) \ - (This)->lpVtbl -> FixMediaTimes2(This,pStart,pStop) - - #define IAMTimelineSrc_SetMediaTimes(This,Start,Stop) \ - (This)->lpVtbl -> SetMediaTimes(This,Start,Stop) - - #define IAMTimelineSrc_SetMediaTimes2(This,Start,Stop) \ - (This)->lpVtbl -> SetMediaTimes2(This,Start,Stop) - - #define IAMTimelineSrc_SetMediaLength(This,Length) \ - (This)->lpVtbl -> SetMediaLength(This,Length) - - #define IAMTimelineSrc_SetMediaLength2(This,Length) \ - (This)->lpVtbl -> SetMediaLength2(This,Length) - - #define IAMTimelineSrc_GetMediaLength(This,pLength) \ - (This)->lpVtbl -> GetMediaLength(This,pLength) - - #define IAMTimelineSrc_GetMediaLength2(This,pLength) \ - (This)->lpVtbl -> GetMediaLength2(This,pLength) - - #define IAMTimelineSrc_GetMediaName(This,pVal) \ - (This)->lpVtbl -> GetMediaName(This,pVal) - - #define IAMTimelineSrc_SetMediaName(This,newVal) \ - (This)->lpVtbl -> SetMediaName(This,newVal) - - #define IAMTimelineSrc_SpliceWithNext(This,pNext) \ - (This)->lpVtbl -> SpliceWithNext(This,pNext) - - #define IAMTimelineSrc_GetStreamNumber(This,pVal) \ - (This)->lpVtbl -> GetStreamNumber(This,pVal) - - #define IAMTimelineSrc_SetStreamNumber(This,Val) \ - (This)->lpVtbl -> SetStreamNumber(This,Val) - - #define IAMTimelineSrc_IsNormalRate(This,pVal) \ - (This)->lpVtbl -> IsNormalRate(This,pVal) - - #define IAMTimelineSrc_GetDefaultFPS(This,pFPS) \ - (This)->lpVtbl -> GetDefaultFPS(This,pFPS) - - #define IAMTimelineSrc_SetDefaultFPS(This,FPS) \ - (This)->lpVtbl -> SetDefaultFPS(This,FPS) - - #define IAMTimelineSrc_GetStretchMode(This,pnStretchMode) \ - (This)->lpVtbl -> GetStretchMode(This,pnStretchMode) - - #define IAMTimelineSrc_SetStretchMode(This,nStretchMode) \ - (This)->lpVtbl -> SetStretchMode(This,nStretchMode) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimelineSrc_GetMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - - void __RPC_STUB IAMTimelineSrc_GetMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Stop); - - - void __RPC_STUB IAMTimelineSrc_ModifyStopTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime2_Proxy( - IAMTimelineSrc * This, - REFTIME Stop); - - - void __RPC_STUB IAMTimelineSrc_ModifyStopTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimelineSrc_FixMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME *pStart, - REFTIME *pStop); - - - void __RPC_STUB IAMTimelineSrc_FixMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IAMTimelineSrc_SetMediaTimes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes2_Proxy( - IAMTimelineSrc * This, - REFTIME Start, - REFTIME Stop); - - - void __RPC_STUB IAMTimelineSrc_SetMediaTimes2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME Length); - - - void __RPC_STUB IAMTimelineSrc_SetMediaLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength2_Proxy( - IAMTimelineSrc * This, - REFTIME Length); - - - void __RPC_STUB IAMTimelineSrc_SetMediaLength2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength_Proxy( - IAMTimelineSrc * This, - REFERENCE_TIME *pLength); - - - void __RPC_STUB IAMTimelineSrc_GetMediaLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength2_Proxy( - IAMTimelineSrc * This, - REFTIME *pLength); - - - void __RPC_STUB IAMTimelineSrc_GetMediaLength2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaName_Proxy( - IAMTimelineSrc * This, - /* [retval][out] */ BSTR *pVal); - - - void __RPC_STUB IAMTimelineSrc_GetMediaName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaName_Proxy( - IAMTimelineSrc * This, - BSTR newVal); - - - void __RPC_STUB IAMTimelineSrc_SetMediaName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SpliceWithNext_Proxy( - IAMTimelineSrc * This, - IAMTimelineObj *pNext); - - - void __RPC_STUB IAMTimelineSrc_SpliceWithNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStreamNumber_Proxy( - IAMTimelineSrc * This, - long *pVal); - - - void __RPC_STUB IAMTimelineSrc_GetStreamNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStreamNumber_Proxy( - IAMTimelineSrc * This, - long Val); - - - void __RPC_STUB IAMTimelineSrc_SetStreamNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineSrc_IsNormalRate_Proxy( - IAMTimelineSrc * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineSrc_IsNormalRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetDefaultFPS_Proxy( - IAMTimelineSrc * This, - double *pFPS); - - - void __RPC_STUB IAMTimelineSrc_GetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetDefaultFPS_Proxy( - IAMTimelineSrc * This, - double FPS); - - - void __RPC_STUB IAMTimelineSrc_SetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStretchMode_Proxy( - IAMTimelineSrc * This, - int *pnStretchMode); - - - void __RPC_STUB IAMTimelineSrc_GetStretchMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStretchMode_Proxy( - IAMTimelineSrc * This, - int nStretchMode); - - - void __RPC_STUB IAMTimelineSrc_SetStretchMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineSrc_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineTrack_INTERFACE_DEFINED__ - #define __IAMTimelineTrack_INTERFACE_DEFINED__ - - /* interface IAMTimelineTrack */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineTrack; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58538-622E-11d2-8CAD-00A024580902") - IAMTimelineTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SrcAdd( - IAMTimelineObj *pSource) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc( - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc2( - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy( - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy2( - REFTIME Start, - REFTIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSourcesCount( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AreYouBlank( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime( - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime2( - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextSrcEx( - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrack * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SrcAdd )( - IAMTimelineTrack * This, - IAMTimelineObj *pSource); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc2 )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy )( - IAMTimelineTrack * This, - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy2 )( - IAMTimelineTrack * This, - REFTIME Start, - REFTIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSourcesCount )( - IAMTimelineTrack * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AreYouBlank )( - IAMTimelineTrack * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime2 )( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *GetNextSrcEx )( - IAMTimelineTrack * This, - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext); - - END_INTERFACE - } IAMTimelineTrackVtbl; - - interface IAMTimelineTrack - { - CONST_VTBL struct IAMTimelineTrackVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineTrack_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineTrack_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineTrack_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineTrack_SrcAdd(This,pSource) \ - (This)->lpVtbl -> SrcAdd(This,pSource) - - #define IAMTimelineTrack_GetNextSrc(This,ppSrc,pInOut) \ - (This)->lpVtbl -> GetNextSrc(This,ppSrc,pInOut) - - #define IAMTimelineTrack_GetNextSrc2(This,ppSrc,pInOut) \ - (This)->lpVtbl -> GetNextSrc2(This,ppSrc,pInOut) - - #define IAMTimelineTrack_MoveEverythingBy(This,Start,MoveBy) \ - (This)->lpVtbl -> MoveEverythingBy(This,Start,MoveBy) - - #define IAMTimelineTrack_MoveEverythingBy2(This,Start,MoveBy) \ - (This)->lpVtbl -> MoveEverythingBy2(This,Start,MoveBy) - - #define IAMTimelineTrack_GetSourcesCount(This,pVal) \ - (This)->lpVtbl -> GetSourcesCount(This,pVal) - - #define IAMTimelineTrack_AreYouBlank(This,pVal) \ - (This)->lpVtbl -> AreYouBlank(This,pVal) - - #define IAMTimelineTrack_GetSrcAtTime(This,ppSrc,Time,SearchDirection) \ - (This)->lpVtbl -> GetSrcAtTime(This,ppSrc,Time,SearchDirection) - - #define IAMTimelineTrack_GetSrcAtTime2(This,ppSrc,Time,SearchDirection) \ - (This)->lpVtbl -> GetSrcAtTime2(This,ppSrc,Time,SearchDirection) - - #define IAMTimelineTrack_InsertSpace(This,rtStart,rtEnd) \ - (This)->lpVtbl -> InsertSpace(This,rtStart,rtEnd) - - #define IAMTimelineTrack_InsertSpace2(This,rtStart,rtEnd) \ - (This)->lpVtbl -> InsertSpace2(This,rtStart,rtEnd) - - #define IAMTimelineTrack_ZeroBetween(This,rtStart,rtEnd) \ - (This)->lpVtbl -> ZeroBetween(This,rtStart,rtEnd) - - #define IAMTimelineTrack_ZeroBetween2(This,rtStart,rtEnd) \ - (This)->lpVtbl -> ZeroBetween2(This,rtStart,rtEnd) - - #define IAMTimelineTrack_GetNextSrcEx(This,pLast,ppNext) \ - (This)->lpVtbl -> GetNextSrcEx(This,pLast,ppNext) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_SrcAdd_Proxy( - IAMTimelineTrack * This, - IAMTimelineObj *pSource); - - - void __RPC_STUB IAMTimelineTrack_SrcAdd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME *pInOut); - - - void __RPC_STUB IAMTimelineTrack_GetNextSrc_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc2_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME *pInOut); - - - void __RPC_STUB IAMTimelineTrack_GetNextSrc2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy); - - - void __RPC_STUB IAMTimelineTrack_MoveEverythingBy_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy2_Proxy( - IAMTimelineTrack * This, - REFTIME Start, - REFTIME MoveBy); - - - void __RPC_STUB IAMTimelineTrack_MoveEverythingBy2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSourcesCount_Proxy( - IAMTimelineTrack * This, - long *pVal); - - - void __RPC_STUB IAMTimelineTrack_GetSourcesCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_AreYouBlank_Proxy( - IAMTimelineTrack * This, - long *pVal); - - - void __RPC_STUB IAMTimelineTrack_AreYouBlank_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection); - - - void __RPC_STUB IAMTimelineTrack_GetSrcAtTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime2_Proxy( - IAMTimelineTrack * This, - /* [out] */ IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection); - - - void __RPC_STUB IAMTimelineTrack_GetSrcAtTime2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - - void __RPC_STUB IAMTimelineTrack_InsertSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace2_Proxy( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - - void __RPC_STUB IAMTimelineTrack_InsertSpace2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween_Proxy( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - - void __RPC_STUB IAMTimelineTrack_ZeroBetween_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween2_Proxy( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - - void __RPC_STUB IAMTimelineTrack_ZeroBetween2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrcEx_Proxy( - IAMTimelineTrack * This, - IAMTimelineObj *pLast, - /* [out] */ IAMTimelineObj **ppNext); - - - void __RPC_STUB IAMTimelineTrack_GetNextSrcEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineTrack_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ - #define __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ - - /* interface IAMTimelineVirtualTrack */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineVirtualTrack; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A8ED5F80-C2C7-11d2-8D39-00A0C9441E20") - IAMTimelineVirtualTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TrackGetPriority( - long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTrackDirty( void) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineVirtualTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineVirtualTrack * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineVirtualTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineVirtualTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TrackGetPriority )( - IAMTimelineVirtualTrack * This, - long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTrackDirty )( - IAMTimelineVirtualTrack * This); - - END_INTERFACE - } IAMTimelineVirtualTrackVtbl; - - interface IAMTimelineVirtualTrack - { - CONST_VTBL struct IAMTimelineVirtualTrackVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineVirtualTrack_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineVirtualTrack_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineVirtualTrack_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineVirtualTrack_TrackGetPriority(This,pPriority) \ - (This)->lpVtbl -> TrackGetPriority(This,pPriority) - - #define IAMTimelineVirtualTrack_SetTrackDirty(This) \ - (This)->lpVtbl -> SetTrackDirty(This) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_TrackGetPriority_Proxy( - IAMTimelineVirtualTrack * This, - long *pPriority); - - - void __RPC_STUB IAMTimelineVirtualTrack_TrackGetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_SetTrackDirty_Proxy( - IAMTimelineVirtualTrack * This); - - - void __RPC_STUB IAMTimelineVirtualTrack_SetTrackDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineComp_INTERFACE_DEFINED__ - #define __IAMTimelineComp_INTERFACE_DEFINED__ - - /* interface IAMTimelineComp */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineComp; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58536-622E-11d2-8CAD-00A024580902") - IAMTimelineComp : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackInsBefore( - IAMTimelineObj *pVirtualTrack, - long Priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackSwapPriorities( - long VirtualTrackA, - long VirtualTrackB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackGetCount( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetVTrack( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfType( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfTypeI( - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextVTrack( - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineCompVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineComp * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineComp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineComp * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackInsBefore )( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - long Priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackSwapPriorities )( - IAMTimelineComp * This, - long VirtualTrackA, - long VirtualTrackB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackGetCount )( - IAMTimelineComp * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetVTrack )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimelineComp * This, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfType )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfTypeI )( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *GetNextVTrack )( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack); - - END_INTERFACE - } IAMTimelineCompVtbl; - - interface IAMTimelineComp - { - CONST_VTBL struct IAMTimelineCompVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineComp_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineComp_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineComp_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineComp_VTrackInsBefore(This,pVirtualTrack,Priority) \ - (This)->lpVtbl -> VTrackInsBefore(This,pVirtualTrack,Priority) - - #define IAMTimelineComp_VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) \ - (This)->lpVtbl -> VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) - - #define IAMTimelineComp_VTrackGetCount(This,pVal) \ - (This)->lpVtbl -> VTrackGetCount(This,pVal) - - #define IAMTimelineComp_GetVTrack(This,ppVirtualTrack,Which) \ - (This)->lpVtbl -> GetVTrack(This,ppVirtualTrack,Which) - - #define IAMTimelineComp_GetCountOfType(This,pVal,pValWithComps,MajorType) \ - (This)->lpVtbl -> GetCountOfType(This,pVal,pValWithComps,MajorType) - - #define IAMTimelineComp_GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) \ - (This)->lpVtbl -> GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) - - #define IAMTimelineComp_GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) \ - (This)->lpVtbl -> GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) - - #define IAMTimelineComp_GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) \ - (This)->lpVtbl -> GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackInsBefore_Proxy( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - long Priority); - - - void __RPC_STUB IAMTimelineComp_VTrackInsBefore_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackSwapPriorities_Proxy( - IAMTimelineComp * This, - long VirtualTrackA, - long VirtualTrackB); - - - void __RPC_STUB IAMTimelineComp_VTrackSwapPriorities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackGetCount_Proxy( - IAMTimelineComp * This, - long *pVal); - - - void __RPC_STUB IAMTimelineComp_VTrackGetCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetVTrack_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long Which); - - - void __RPC_STUB IAMTimelineComp_GetVTrack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetCountOfType_Proxy( - IAMTimelineComp * This, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - - void __RPC_STUB IAMTimelineComp_GetCountOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfType_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - - - void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfTypeI_Proxy( - IAMTimelineComp * This, - /* [out] */ IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - - - void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfTypeI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetNextVTrack_Proxy( - IAMTimelineComp * This, - IAMTimelineObj *pVirtualTrack, - /* [out] */ IAMTimelineObj **ppNextVirtualTrack); - - - void __RPC_STUB IAMTimelineComp_GetNextVTrack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineComp_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimelineGroup_INTERFACE_DEFINED__ - #define __IAMTimelineGroup_INTERFACE_DEFINED__ - - /* interface IAMTimelineGroup */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimelineGroup; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EED4F00-B8A6-11d2-8023-00C0DF10D434") - IAMTimelineGroup : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimeline( - IAMTimeline *pTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimeline( - /* [out] */ IAMTimeline **ppTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPriority( - long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaType( - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaType( - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetGroupName( - BSTR pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGroupName( - /* [retval][out] */ BSTR *pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPreviewMode( - BOOL fPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPreviewMode( - BOOL *pfPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTypeForVB( - /* [in] */ long Val) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputBuffering( - /* [out] */ int *pnBuffer) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputBuffering( - /* [in] */ int nBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSmartRecompressFormat( - long *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSmartRecompressFormat( - long **ppFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSmartRecompressFormatSet( - BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsRecompressFormatDirty( - BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearRecompressFormatDirty( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRecompFormatFromSource( - IAMTimelineSrc *pSource) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineGroupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineGroup * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineGroup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineGroup * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimeline )( - IAMTimelineGroup * This, - IAMTimeline *pTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimeline )( - IAMTimelineGroup * This, - /* [out] */ IAMTimeline **ppTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPriority )( - IAMTimelineGroup * This, - long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IAMTimelineGroup * This, - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IAMTimelineGroup * This, - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputFPS )( - IAMTimelineGroup * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputFPS )( - IAMTimelineGroup * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetGroupName )( - IAMTimelineGroup * This, - BSTR pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGroupName )( - IAMTimelineGroup * This, - /* [retval][out] */ BSTR *pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPreviewMode )( - IAMTimelineGroup * This, - BOOL fPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPreviewMode )( - IAMTimelineGroup * This, - BOOL *pfPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTypeForVB )( - IAMTimelineGroup * This, - /* [in] */ long Val); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputBuffering )( - IAMTimelineGroup * This, - /* [out] */ int *pnBuffer); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputBuffering )( - IAMTimelineGroup * This, - /* [in] */ int nBuffer); - - HRESULT ( STDMETHODCALLTYPE *SetSmartRecompressFormat )( - IAMTimelineGroup * This, - long *pFormat); - - HRESULT ( STDMETHODCALLTYPE *GetSmartRecompressFormat )( - IAMTimelineGroup * This, - long **ppFormat); - - HRESULT ( STDMETHODCALLTYPE *IsSmartRecompressFormatSet )( - IAMTimelineGroup * This, - BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *IsRecompressFormatDirty )( - IAMTimelineGroup * This, - BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *ClearRecompressFormatDirty )( - IAMTimelineGroup * This); - - HRESULT ( STDMETHODCALLTYPE *SetRecompFormatFromSource )( - IAMTimelineGroup * This, - IAMTimelineSrc *pSource); - - END_INTERFACE - } IAMTimelineGroupVtbl; - - interface IAMTimelineGroup - { - CONST_VTBL struct IAMTimelineGroupVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimelineGroup_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimelineGroup_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimelineGroup_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimelineGroup_SetTimeline(This,pTimeline) \ - (This)->lpVtbl -> SetTimeline(This,pTimeline) - - #define IAMTimelineGroup_GetTimeline(This,ppTimeline) \ - (This)->lpVtbl -> GetTimeline(This,ppTimeline) - - #define IAMTimelineGroup_GetPriority(This,pPriority) \ - (This)->lpVtbl -> GetPriority(This,pPriority) - - #define IAMTimelineGroup_GetMediaType(This,__MIDL_0040) \ - (This)->lpVtbl -> GetMediaType(This,__MIDL_0040) - - #define IAMTimelineGroup_SetMediaType(This,__MIDL_0041) \ - (This)->lpVtbl -> SetMediaType(This,__MIDL_0041) - - #define IAMTimelineGroup_SetOutputFPS(This,FPS) \ - (This)->lpVtbl -> SetOutputFPS(This,FPS) - - #define IAMTimelineGroup_GetOutputFPS(This,pFPS) \ - (This)->lpVtbl -> GetOutputFPS(This,pFPS) - - #define IAMTimelineGroup_SetGroupName(This,pGroupName) \ - (This)->lpVtbl -> SetGroupName(This,pGroupName) - - #define IAMTimelineGroup_GetGroupName(This,pGroupName) \ - (This)->lpVtbl -> GetGroupName(This,pGroupName) - - #define IAMTimelineGroup_SetPreviewMode(This,fPreview) \ - (This)->lpVtbl -> SetPreviewMode(This,fPreview) - - #define IAMTimelineGroup_GetPreviewMode(This,pfPreview) \ - (This)->lpVtbl -> GetPreviewMode(This,pfPreview) - - #define IAMTimelineGroup_SetMediaTypeForVB(This,Val) \ - (This)->lpVtbl -> SetMediaTypeForVB(This,Val) - - #define IAMTimelineGroup_GetOutputBuffering(This,pnBuffer) \ - (This)->lpVtbl -> GetOutputBuffering(This,pnBuffer) - - #define IAMTimelineGroup_SetOutputBuffering(This,nBuffer) \ - (This)->lpVtbl -> SetOutputBuffering(This,nBuffer) - - #define IAMTimelineGroup_SetSmartRecompressFormat(This,pFormat) \ - (This)->lpVtbl -> SetSmartRecompressFormat(This,pFormat) - - #define IAMTimelineGroup_GetSmartRecompressFormat(This,ppFormat) \ - (This)->lpVtbl -> GetSmartRecompressFormat(This,ppFormat) - - #define IAMTimelineGroup_IsSmartRecompressFormatSet(This,pVal) \ - (This)->lpVtbl -> IsSmartRecompressFormatSet(This,pVal) - - #define IAMTimelineGroup_IsRecompressFormatDirty(This,pVal) \ - (This)->lpVtbl -> IsRecompressFormatDirty(This,pVal) - - #define IAMTimelineGroup_ClearRecompressFormatDirty(This) \ - (This)->lpVtbl -> ClearRecompressFormatDirty(This) - - #define IAMTimelineGroup_SetRecompFormatFromSource(This,pSource) \ - (This)->lpVtbl -> SetRecompFormatFromSource(This,pSource) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetTimeline_Proxy( - IAMTimelineGroup * This, - IAMTimeline *pTimeline); - - - void __RPC_STUB IAMTimelineGroup_SetTimeline_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetTimeline_Proxy( - IAMTimelineGroup * This, - /* [out] */ IAMTimeline **ppTimeline); - - - void __RPC_STUB IAMTimelineGroup_GetTimeline_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPriority_Proxy( - IAMTimelineGroup * This, - long *pPriority); - - - void __RPC_STUB IAMTimelineGroup_GetPriority_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetMediaType_Proxy( - IAMTimelineGroup * This, - /* [out] */ AM_MEDIA_TYPE *__MIDL_0040); - - - void __RPC_STUB IAMTimelineGroup_GetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaType_Proxy( - IAMTimelineGroup * This, - /* [in] */ AM_MEDIA_TYPE *__MIDL_0041); - - - void __RPC_STUB IAMTimelineGroup_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputFPS_Proxy( - IAMTimelineGroup * This, - double FPS); - - - void __RPC_STUB IAMTimelineGroup_SetOutputFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputFPS_Proxy( - IAMTimelineGroup * This, - double *pFPS); - - - void __RPC_STUB IAMTimelineGroup_GetOutputFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetGroupName_Proxy( - IAMTimelineGroup * This, - BSTR pGroupName); - - - void __RPC_STUB IAMTimelineGroup_SetGroupName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetGroupName_Proxy( - IAMTimelineGroup * This, - /* [retval][out] */ BSTR *pGroupName); - - - void __RPC_STUB IAMTimelineGroup_GetGroupName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetPreviewMode_Proxy( - IAMTimelineGroup * This, - BOOL fPreview); - - - void __RPC_STUB IAMTimelineGroup_SetPreviewMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPreviewMode_Proxy( - IAMTimelineGroup * This, - BOOL *pfPreview); - - - void __RPC_STUB IAMTimelineGroup_GetPreviewMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaTypeForVB_Proxy( - IAMTimelineGroup * This, - /* [in] */ long Val); - - - void __RPC_STUB IAMTimelineGroup_SetMediaTypeForVB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputBuffering_Proxy( - IAMTimelineGroup * This, - /* [out] */ int *pnBuffer); - - - void __RPC_STUB IAMTimelineGroup_GetOutputBuffering_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputBuffering_Proxy( - IAMTimelineGroup * This, - /* [in] */ int nBuffer); - - - void __RPC_STUB IAMTimelineGroup_SetOutputBuffering_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetSmartRecompressFormat_Proxy( - IAMTimelineGroup * This, - long *pFormat); - - - void __RPC_STUB IAMTimelineGroup_SetSmartRecompressFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetSmartRecompressFormat_Proxy( - IAMTimelineGroup * This, - long **ppFormat); - - - void __RPC_STUB IAMTimelineGroup_GetSmartRecompressFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsSmartRecompressFormatSet_Proxy( - IAMTimelineGroup * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineGroup_IsSmartRecompressFormatSet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsRecompressFormatDirty_Proxy( - IAMTimelineGroup * This, - BOOL *pVal); - - - void __RPC_STUB IAMTimelineGroup_IsRecompressFormatDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_ClearRecompressFormatDirty_Proxy( - IAMTimelineGroup * This); - - - void __RPC_STUB IAMTimelineGroup_ClearRecompressFormatDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetRecompFormatFromSource_Proxy( - IAMTimelineGroup * This, - IAMTimelineSrc *pSource); - - - void __RPC_STUB IAMTimelineGroup_SetRecompFormatFromSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimelineGroup_INTERFACE_DEFINED__ */ - - - #ifndef __IAMTimeline_INTERFACE_DEFINED__ - #define __IAMTimeline_INTERFACE_DEFINED__ - - /* interface IAMTimeline */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMTimeline; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B74-61F9-11D2-8CAD-00A024580902") - IAMTimeline : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateEmptyNode( - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddGroup( - IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemGroupFromList( - IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroup( - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCount( - long *pCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearAllGroups( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInsertMode( - long *pMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInsertMode( - long Mode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableTransitions( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransitionsEnabled( - BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableEffects( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectsEnabled( - BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration( - REFERENCE_TIME *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration2( - double *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE IsDirty( - BOOL *pDirty) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual HRESULT STDMETHODCALLTYPE ValidateSourceNames( - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransition( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransition( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffect( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffect( - GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransitionB( - BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransitionB( - /* [retval][out] */ BSTR *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffectB( - BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffectB( - /* [retval][out] */ BSTR *pGuid) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMTimelineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimeline * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimeline * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimeline * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateEmptyNode )( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *AddGroup )( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *RemGroupFromList )( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroup )( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCount )( - IAMTimeline * This, - long *pCount); - - HRESULT ( STDMETHODCALLTYPE *ClearAllGroups )( - IAMTimeline * This); - - HRESULT ( STDMETHODCALLTYPE *GetInsertMode )( - IAMTimeline * This, - long *pMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInsertMode )( - IAMTimeline * This, - long Mode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableTransitions )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransitionsEnabled )( - IAMTimeline * This, - BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableEffects )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectsEnabled )( - IAMTimeline * This, - BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IAMTimeline * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IAMTimeline * This, - REFERENCE_TIME *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration2 )( - IAMTimeline * This, - double *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimeline * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimeline * This, - double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *IsDirty )( - IAMTimeline * This, - BOOL *pDirty); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimeline * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimeline * This, - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - HRESULT ( STDMETHODCALLTYPE *ValidateSourceNames )( - IAMTimeline * This, - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransition )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransition )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffect )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffect )( - IAMTimeline * This, - GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransitionB )( - IAMTimeline * This, - BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransitionB )( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffectB )( - IAMTimeline * This, - BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffectB )( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - END_INTERFACE - } IAMTimelineVtbl; - - interface IAMTimeline - { - CONST_VTBL struct IAMTimelineVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMTimeline_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMTimeline_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMTimeline_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMTimeline_CreateEmptyNode(This,ppObj,Type) \ - (This)->lpVtbl -> CreateEmptyNode(This,ppObj,Type) - - #define IAMTimeline_AddGroup(This,pGroup) \ - (This)->lpVtbl -> AddGroup(This,pGroup) - - #define IAMTimeline_RemGroupFromList(This,pGroup) \ - (This)->lpVtbl -> RemGroupFromList(This,pGroup) - - #define IAMTimeline_GetGroup(This,ppGroup,WhichGroup) \ - (This)->lpVtbl -> GetGroup(This,ppGroup,WhichGroup) - - #define IAMTimeline_GetGroupCount(This,pCount) \ - (This)->lpVtbl -> GetGroupCount(This,pCount) - - #define IAMTimeline_ClearAllGroups(This) \ - (This)->lpVtbl -> ClearAllGroups(This) - - #define IAMTimeline_GetInsertMode(This,pMode) \ - (This)->lpVtbl -> GetInsertMode(This,pMode) - - #define IAMTimeline_SetInsertMode(This,Mode) \ - (This)->lpVtbl -> SetInsertMode(This,Mode) - - #define IAMTimeline_EnableTransitions(This,fEnabled) \ - (This)->lpVtbl -> EnableTransitions(This,fEnabled) - - #define IAMTimeline_TransitionsEnabled(This,pfEnabled) \ - (This)->lpVtbl -> TransitionsEnabled(This,pfEnabled) - - #define IAMTimeline_EnableEffects(This,fEnabled) \ - (This)->lpVtbl -> EnableEffects(This,fEnabled) - - #define IAMTimeline_EffectsEnabled(This,pfEnabled) \ - (This)->lpVtbl -> EffectsEnabled(This,pfEnabled) - - #define IAMTimeline_SetInterestRange(This,Start,Stop) \ - (This)->lpVtbl -> SetInterestRange(This,Start,Stop) - - #define IAMTimeline_GetDuration(This,pDuration) \ - (This)->lpVtbl -> GetDuration(This,pDuration) - - #define IAMTimeline_GetDuration2(This,pDuration) \ - (This)->lpVtbl -> GetDuration2(This,pDuration) - - #define IAMTimeline_SetDefaultFPS(This,FPS) \ - (This)->lpVtbl -> SetDefaultFPS(This,FPS) - - #define IAMTimeline_GetDefaultFPS(This,pFPS) \ - (This)->lpVtbl -> GetDefaultFPS(This,pFPS) - - #define IAMTimeline_IsDirty(This,pDirty) \ - (This)->lpVtbl -> IsDirty(This,pDirty) - - #define IAMTimeline_GetDirtyRange(This,pStart,pStop) \ - (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) - - #define IAMTimeline_GetCountOfType(This,Group,pVal,pValWithComps,MajorType) \ - (This)->lpVtbl -> GetCountOfType(This,Group,pVal,pValWithComps,MajorType) - - #define IAMTimeline_ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) \ - (This)->lpVtbl -> ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) - - #define IAMTimeline_SetDefaultTransition(This,pGuid) \ - (This)->lpVtbl -> SetDefaultTransition(This,pGuid) - - #define IAMTimeline_GetDefaultTransition(This,pGuid) \ - (This)->lpVtbl -> GetDefaultTransition(This,pGuid) - - #define IAMTimeline_SetDefaultEffect(This,pGuid) \ - (This)->lpVtbl -> SetDefaultEffect(This,pGuid) - - #define IAMTimeline_GetDefaultEffect(This,pGuid) \ - (This)->lpVtbl -> GetDefaultEffect(This,pGuid) - - #define IAMTimeline_SetDefaultTransitionB(This,pGuid) \ - (This)->lpVtbl -> SetDefaultTransitionB(This,pGuid) - - #define IAMTimeline_GetDefaultTransitionB(This,pGuid) \ - (This)->lpVtbl -> GetDefaultTransitionB(This,pGuid) - - #define IAMTimeline_SetDefaultEffectB(This,pGuid) \ - (This)->lpVtbl -> SetDefaultEffectB(This,pGuid) - - #define IAMTimeline_GetDefaultEffectB(This,pGuid) \ - (This)->lpVtbl -> GetDefaultEffectB(This,pGuid) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_CreateEmptyNode_Proxy( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type); - - - void __RPC_STUB IAMTimeline_CreateEmptyNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_AddGroup_Proxy( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - - void __RPC_STUB IAMTimeline_AddGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_RemGroupFromList_Proxy( - IAMTimeline * This, - IAMTimelineObj *pGroup); - - - void __RPC_STUB IAMTimeline_RemGroupFromList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroup_Proxy( - IAMTimeline * This, - /* [out] */ IAMTimelineObj **ppGroup, - long WhichGroup); - - - void __RPC_STUB IAMTimeline_GetGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroupCount_Proxy( - IAMTimeline * This, - long *pCount); - - - void __RPC_STUB IAMTimeline_GetGroupCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_ClearAllGroups_Proxy( - IAMTimeline * This); - - - void __RPC_STUB IAMTimeline_ClearAllGroups_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetInsertMode_Proxy( - IAMTimeline * This, - long *pMode); - - - void __RPC_STUB IAMTimeline_GetInsertMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInsertMode_Proxy( - IAMTimeline * This, - long Mode); - - - void __RPC_STUB IAMTimeline_SetInsertMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableTransitions_Proxy( - IAMTimeline * This, - BOOL fEnabled); - - - void __RPC_STUB IAMTimeline_EnableTransitions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_TransitionsEnabled_Proxy( - IAMTimeline * This, - BOOL *pfEnabled); - - - void __RPC_STUB IAMTimeline_TransitionsEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableEffects_Proxy( - IAMTimeline * This, - BOOL fEnabled); - - - void __RPC_STUB IAMTimeline_EnableEffects_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EffectsEnabled_Proxy( - IAMTimeline * This, - BOOL *pfEnabled); - - - void __RPC_STUB IAMTimeline_EffectsEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInterestRange_Proxy( - IAMTimeline * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - - void __RPC_STUB IAMTimeline_SetInterestRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration_Proxy( - IAMTimeline * This, - REFERENCE_TIME *pDuration); - - - void __RPC_STUB IAMTimeline_GetDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration2_Proxy( - IAMTimeline * This, - double *pDuration); - - - void __RPC_STUB IAMTimeline_GetDuration2_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultFPS_Proxy( - IAMTimeline * This, - double FPS); - - - void __RPC_STUB IAMTimeline_SetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultFPS_Proxy( - IAMTimeline * This, - double *pFPS); - - - void __RPC_STUB IAMTimeline_GetDefaultFPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_IsDirty_Proxy( - IAMTimeline * This, - BOOL *pDirty); - - - void __RPC_STUB IAMTimeline_IsDirty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDirtyRange_Proxy( - IAMTimeline * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - - void __RPC_STUB IAMTimeline_GetDirtyRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetCountOfType_Proxy( - IAMTimeline * This, - long Group, - long *pVal, - long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - - void __RPC_STUB IAMTimeline_GetCountOfType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_ValidateSourceNames_Proxy( - IAMTimeline * This, - long ValidateFlags, - IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle); - - - void __RPC_STUB IAMTimeline_ValidateSourceNames_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransition_Proxy( - IAMTimeline * This, - GUID *pGuid); - - - void __RPC_STUB IAMTimeline_SetDefaultTransition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransition_Proxy( - IAMTimeline * This, - GUID *pGuid); - - - void __RPC_STUB IAMTimeline_GetDefaultTransition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffect_Proxy( - IAMTimeline * This, - GUID *pGuid); - - - void __RPC_STUB IAMTimeline_SetDefaultEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffect_Proxy( - IAMTimeline * This, - GUID *pGuid); - - - void __RPC_STUB IAMTimeline_GetDefaultEffect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransitionB_Proxy( - IAMTimeline * This, - BSTR pGuid); - - - void __RPC_STUB IAMTimeline_SetDefaultTransitionB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransitionB_Proxy( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - - void __RPC_STUB IAMTimeline_GetDefaultTransitionB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffectB_Proxy( - IAMTimeline * This, - BSTR pGuid); - - - void __RPC_STUB IAMTimeline_SetDefaultEffectB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffectB_Proxy( - IAMTimeline * This, - /* [retval][out] */ BSTR *pGuid); - - - void __RPC_STUB IAMTimeline_GetDefaultEffectB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMTimeline_INTERFACE_DEFINED__ */ - - - #ifndef __IXml2Dex_INTERFACE_DEFINED__ - #define __IXml2Dex_INTERFACE_DEFINED__ - - /* interface IXml2Dex */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IXml2Dex; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("18C628ED-962A-11D2-8D08-00A0C9441E20") - IXml2Dex : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateGraphFromFile( - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteGrfFile( - IUnknown *pGraph, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLFile( - IUnknown *pTimeline, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXMLFile( - IUnknown *pTimeline, - BSTR XMLName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( - IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLPart( - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXMLFile( - IUnknown *pTimeline, - double dStart, - BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CopyXML( - IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXML( - IUnknown *pTimeline, - double dStart) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXML( - IUnknown *pTimeline, - IUnknown *pXML) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXML( - IUnknown *pTimeline, - BSTR *pbstrXML) = 0; - - }; - - #else /* C style interface */ - - typedef struct IXml2DexVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXml2Dex * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXml2Dex * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXml2Dex * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXml2Dex * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXml2Dex * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXml2Dex * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXml2Dex * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateGraphFromFile )( - IXml2Dex * This, - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteGrfFile )( - IXml2Dex * This, - IUnknown *pGraph, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR XMLName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLPart )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXMLFile )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CopyXML )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXML )( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - IXml2Dex * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXML )( - IXml2Dex * This, - IUnknown *pTimeline, - IUnknown *pXML); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXML )( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR *pbstrXML); - - END_INTERFACE - } IXml2DexVtbl; - - interface IXml2Dex - { - CONST_VTBL struct IXml2DexVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IXml2Dex_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IXml2Dex_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IXml2Dex_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IXml2Dex_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IXml2Dex_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IXml2Dex_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IXml2Dex_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IXml2Dex_CreateGraphFromFile(This,ppGraph,pTimeline,Filename) \ - (This)->lpVtbl -> CreateGraphFromFile(This,ppGraph,pTimeline,Filename) - - #define IXml2Dex_WriteGrfFile(This,pGraph,FileName) \ - (This)->lpVtbl -> WriteGrfFile(This,pGraph,FileName) - - #define IXml2Dex_WriteXMLFile(This,pTimeline,FileName) \ - (This)->lpVtbl -> WriteXMLFile(This,pTimeline,FileName) - - #define IXml2Dex_ReadXMLFile(This,pTimeline,XMLName) \ - (This)->lpVtbl -> ReadXMLFile(This,pTimeline,XMLName) - - #define IXml2Dex_Delete(This,pTimeline,dStart,dEnd) \ - (This)->lpVtbl -> Delete(This,pTimeline,dStart,dEnd) - - #define IXml2Dex_WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) \ - (This)->lpVtbl -> WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) - - #define IXml2Dex_PasteXMLFile(This,pTimeline,dStart,FileName) \ - (This)->lpVtbl -> PasteXMLFile(This,pTimeline,dStart,FileName) - - #define IXml2Dex_CopyXML(This,pTimeline,dStart,dEnd) \ - (This)->lpVtbl -> CopyXML(This,pTimeline,dStart,dEnd) - - #define IXml2Dex_PasteXML(This,pTimeline,dStart) \ - (This)->lpVtbl -> PasteXML(This,pTimeline,dStart) - - #define IXml2Dex_Reset(This) \ - (This)->lpVtbl -> Reset(This) - - #define IXml2Dex_ReadXML(This,pTimeline,pXML) \ - (This)->lpVtbl -> ReadXML(This,pTimeline,pXML) - - #define IXml2Dex_WriteXML(This,pTimeline,pbstrXML) \ - (This)->lpVtbl -> WriteXML(This,pTimeline,pbstrXML) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CreateGraphFromFile_Proxy( - IXml2Dex * This, - /* [out] */ IUnknown **ppGraph, - IUnknown *pTimeline, - BSTR Filename); - - - void __RPC_STUB IXml2Dex_CreateGraphFromFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteGrfFile_Proxy( - IXml2Dex * This, - IUnknown *pGraph, - BSTR FileName); - - - void __RPC_STUB IXml2Dex_WriteGrfFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR FileName); - - - void __RPC_STUB IXml2Dex_WriteXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR XMLName); - - - void __RPC_STUB IXml2Dex_ReadXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Delete_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - - void __RPC_STUB IXml2Dex_Delete_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLPart_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd, - BSTR FileName); - - - void __RPC_STUB IXml2Dex_WriteXMLPart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXMLFile_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - BSTR FileName); - - - void __RPC_STUB IXml2Dex_PasteXMLFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CopyXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart, - double dEnd); - - - void __RPC_STUB IXml2Dex_CopyXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - double dStart); - - - void __RPC_STUB IXml2Dex_PasteXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Reset_Proxy( - IXml2Dex * This); - - - void __RPC_STUB IXml2Dex_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - IUnknown *pXML); - - - void __RPC_STUB IXml2Dex_ReadXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXML_Proxy( - IXml2Dex * This, - IUnknown *pTimeline, - BSTR *pbstrXML); - - - void __RPC_STUB IXml2Dex_WriteXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IXml2Dex_INTERFACE_DEFINED__ */ - - - #ifndef __IAMErrorLog_INTERFACE_DEFINED__ - #define __IAMErrorLog_INTERFACE_DEFINED__ - - /* interface IAMErrorLog */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMErrorLog; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E43E73A2-0EFA-11d3-9601-00A0C9441E20") - IAMErrorLog : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogError( - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMErrorLog * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMErrorLog * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogError )( - IAMErrorLog * This, - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo); - - END_INTERFACE - } IAMErrorLogVtbl; - - interface IAMErrorLog - { - CONST_VTBL struct IAMErrorLogVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMErrorLog_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMErrorLog_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMErrorLog_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMErrorLog_LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) \ - (This)->lpVtbl -> LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMErrorLog_LogError_Proxy( - IAMErrorLog * This, - long Severity, - BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ VARIANT *pExtraInfo); - - - void __RPC_STUB IAMErrorLog_LogError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMErrorLog_INTERFACE_DEFINED__ */ - - - #ifndef __IAMSetErrorLog_INTERFACE_DEFINED__ - #define __IAMSetErrorLog_INTERFACE_DEFINED__ - - /* interface IAMSetErrorLog */ - /* [unique][helpstring][uuid][object] */ - - - EXTERN_C const IID IID_IAMSetErrorLog; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("963566DA-BE21-4eaf-88E9-35704F8F52A1") - IAMSetErrorLog : public IUnknown - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorLog( - /* [retval][out] */ IAMErrorLog **pVal) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_ErrorLog( - /* [in] */ IAMErrorLog *newVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAMSetErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMSetErrorLog * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMSetErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMSetErrorLog * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ErrorLog )( - IAMSetErrorLog * This, - /* [retval][out] */ IAMErrorLog **pVal); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ErrorLog )( - IAMSetErrorLog * This, - /* [in] */ IAMErrorLog *newVal); - - END_INTERFACE - } IAMSetErrorLogVtbl; - - interface IAMSetErrorLog - { - CONST_VTBL struct IAMSetErrorLogVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAMSetErrorLog_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAMSetErrorLog_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAMSetErrorLog_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAMSetErrorLog_get_ErrorLog(This,pVal) \ - (This)->lpVtbl -> get_ErrorLog(This,pVal) - - #define IAMSetErrorLog_put_ErrorLog(This,newVal) \ - (This)->lpVtbl -> put_ErrorLog(This,newVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_get_ErrorLog_Proxy( - IAMSetErrorLog * This, - /* [retval][out] */ IAMErrorLog **pVal); - - - void __RPC_STUB IAMSetErrorLog_get_ErrorLog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_put_ErrorLog_Proxy( - IAMSetErrorLog * This, - /* [in] */ IAMErrorLog *newVal); - - - void __RPC_STUB IAMSetErrorLog_put_ErrorLog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAMSetErrorLog_INTERFACE_DEFINED__ */ - - - #ifndef __ISampleGrabberCB_INTERFACE_DEFINED__ - #define __ISampleGrabberCB_INTERFACE_DEFINED__ - - /* interface ISampleGrabberCB */ - /* [unique][helpstring][local][uuid][object] */ - - - EXTERN_C const IID IID_ISampleGrabberCB; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0579154A-2B53-4994-B0D0-E773148EFF85") - ISampleGrabberCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SampleCB( - double SampleTime, - IMediaSample *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE BufferCB( - double SampleTime, - BYTE *pBuffer, - long BufferLen) = 0; - - }; - - #else /* C style interface */ - - typedef struct ISampleGrabberCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabberCB * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabberCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabberCB * This); - - HRESULT ( STDMETHODCALLTYPE *SampleCB )( - ISampleGrabberCB * This, - double SampleTime, - IMediaSample *pSample); - - HRESULT ( STDMETHODCALLTYPE *BufferCB )( - ISampleGrabberCB * This, - double SampleTime, - BYTE *pBuffer, - long BufferLen); - - END_INTERFACE - } ISampleGrabberCBVtbl; - - interface ISampleGrabberCB - { - CONST_VTBL struct ISampleGrabberCBVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ISampleGrabberCB_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ISampleGrabberCB_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ISampleGrabberCB_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ISampleGrabberCB_SampleCB(This,SampleTime,pSample) \ - (This)->lpVtbl -> SampleCB(This,SampleTime,pSample) - - #define ISampleGrabberCB_BufferCB(This,SampleTime,pBuffer,BufferLen) \ - (This)->lpVtbl -> BufferCB(This,SampleTime,pBuffer,BufferLen) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE ISampleGrabberCB_SampleCB_Proxy( - ISampleGrabberCB * This, - double SampleTime, - IMediaSample *pSample); - - - void __RPC_STUB ISampleGrabberCB_SampleCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabberCB_BufferCB_Proxy( - ISampleGrabberCB * This, - double SampleTime, - BYTE *pBuffer, - long BufferLen); - - - void __RPC_STUB ISampleGrabberCB_BufferCB_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ISampleGrabberCB_INTERFACE_DEFINED__ */ - - - #ifndef __ISampleGrabber_INTERFACE_DEFINED__ - #define __ISampleGrabber_INTERFACE_DEFINED__ - - /* interface ISampleGrabber */ - /* [unique][helpstring][local][uuid][object] */ - - - EXTERN_C const IID IID_ISampleGrabber; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6B652FFF-11FE-4fce-92AD-0266B5D7C78F") - ISampleGrabber : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetOneShot( - BOOL OneShot) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - const AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( - AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( - BOOL BufferThem) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( - /* [retval][out] */ IMediaSample **ppSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCallback( - ISampleGrabberCB *pCallback, - long WhichMethodToCallback) = 0; - - }; - - #else /* C style interface */ - - typedef struct ISampleGrabberVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabber * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabber * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabber * This); - - HRESULT ( STDMETHODCALLTYPE *SetOneShot )( - ISampleGrabber * This, - BOOL OneShot); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - ISampleGrabber * This, - const AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *GetConnectedMediaType )( - ISampleGrabber * This, - AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetBufferSamples )( - ISampleGrabber * This, - BOOL BufferThem); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentBuffer )( - ISampleGrabber * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSample )( - ISampleGrabber * This, - /* [retval][out] */ IMediaSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *SetCallback )( - ISampleGrabber * This, - ISampleGrabberCB *pCallback, - long WhichMethodToCallback); - - END_INTERFACE - } ISampleGrabberVtbl; - - interface ISampleGrabber - { - CONST_VTBL struct ISampleGrabberVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ISampleGrabber_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ISampleGrabber_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ISampleGrabber_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ISampleGrabber_SetOneShot(This,OneShot) \ - (This)->lpVtbl -> SetOneShot(This,OneShot) - - #define ISampleGrabber_SetMediaType(This,pType) \ - (This)->lpVtbl -> SetMediaType(This,pType) - - #define ISampleGrabber_GetConnectedMediaType(This,pType) \ - (This)->lpVtbl -> GetConnectedMediaType(This,pType) - - #define ISampleGrabber_SetBufferSamples(This,BufferThem) \ - (This)->lpVtbl -> SetBufferSamples(This,BufferThem) - - #define ISampleGrabber_GetCurrentBuffer(This,pBufferSize,pBuffer) \ - (This)->lpVtbl -> GetCurrentBuffer(This,pBufferSize,pBuffer) - - #define ISampleGrabber_GetCurrentSample(This,ppSample) \ - (This)->lpVtbl -> GetCurrentSample(This,ppSample) - - #define ISampleGrabber_SetCallback(This,pCallback,WhichMethodToCallback) \ - (This)->lpVtbl -> SetCallback(This,pCallback,WhichMethodToCallback) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_SetOneShot_Proxy( - ISampleGrabber * This, - BOOL OneShot); - - - void __RPC_STUB ISampleGrabber_SetOneShot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_SetMediaType_Proxy( - ISampleGrabber * This, - const AM_MEDIA_TYPE *pType); - - - void __RPC_STUB ISampleGrabber_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_GetConnectedMediaType_Proxy( - ISampleGrabber * This, - AM_MEDIA_TYPE *pType); - - - void __RPC_STUB ISampleGrabber_GetConnectedMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_SetBufferSamples_Proxy( - ISampleGrabber * This, - BOOL BufferThem); - - - void __RPC_STUB ISampleGrabber_SetBufferSamples_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentBuffer_Proxy( - ISampleGrabber * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer); - - - void __RPC_STUB ISampleGrabber_GetCurrentBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentSample_Proxy( - ISampleGrabber * This, - /* [retval][out] */ IMediaSample **ppSample); - - - void __RPC_STUB ISampleGrabber_GetCurrentSample_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ISampleGrabber_SetCallback_Proxy( - ISampleGrabber * This, - ISampleGrabberCB *pCallback, - long WhichMethodToCallback); - - - void __RPC_STUB ISampleGrabber_SetCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ISampleGrabber_INTERFACE_DEFINED__ */ - - - - #ifndef __DexterLib_LIBRARY_DEFINED__ - #define __DexterLib_LIBRARY_DEFINED__ - - /* library DexterLib */ - /* [helpstring][version][uuid] */ - - - EXTERN_C const IID LIBID_DexterLib; - - EXTERN_C const CLSID CLSID_AMTimeline; - - #ifdef __cplusplus - - class DECLSPEC_UUID("78530B75-61F9-11D2-8CAD-00A024580902") - AMTimeline; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineObj; - - #ifdef __cplusplus - - class DECLSPEC_UUID("78530B78-61F9-11D2-8CAD-00A024580902") - AMTimelineObj; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineSrc; - - #ifdef __cplusplus - - class DECLSPEC_UUID("78530B7A-61F9-11D2-8CAD-00A024580902") - AMTimelineSrc; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineTrack; - - #ifdef __cplusplus - - class DECLSPEC_UUID("8F6C3C50-897B-11d2-8CFB-00A0C9441E20") - AMTimelineTrack; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineComp; - - #ifdef __cplusplus - - class DECLSPEC_UUID("74D2EC80-6233-11d2-8CAD-00A024580902") - AMTimelineComp; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineGroup; - - #ifdef __cplusplus - - class DECLSPEC_UUID("F6D371E1-B8A6-11d2-8023-00C0DF10D434") - AMTimelineGroup; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineTrans; - - #ifdef __cplusplus - - class DECLSPEC_UUID("74D2EC81-6233-11d2-8CAD-00A024580902") - AMTimelineTrans; - #endif - - EXTERN_C const CLSID CLSID_AMTimelineEffect; - - #ifdef __cplusplus - - class DECLSPEC_UUID("74D2EC82-6233-11d2-8CAD-00A024580902") - AMTimelineEffect; - #endif - - EXTERN_C const CLSID CLSID_RenderEngine; - - #ifdef __cplusplus - - class DECLSPEC_UUID("64D8A8E0-80A2-11d2-8CF3-00A0C9441E20") - RenderEngine; - #endif - - EXTERN_C const CLSID CLSID_SmartRenderEngine; - - #ifdef __cplusplus - - class DECLSPEC_UUID("498B0949-BBE9-4072-98BE-6CCAEB79DC6F") - SmartRenderEngine; - #endif - - EXTERN_C const CLSID CLSID_AudMixer; - - #ifdef __cplusplus - - class DECLSPEC_UUID("036A9790-C153-11d2-9EF7-006008039E37") - AudMixer; - #endif - - EXTERN_C const CLSID CLSID_Xml2Dex; - - #ifdef __cplusplus - - class DECLSPEC_UUID("18C628EE-962A-11D2-8D08-00A0C9441E20") - Xml2Dex; - #endif - - EXTERN_C const CLSID CLSID_MediaLocator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("CC1101F2-79DC-11D2-8CE6-00A0C9441E20") - MediaLocator; - #endif - - EXTERN_C const CLSID CLSID_PropertySetter; - - #ifdef __cplusplus - - class DECLSPEC_UUID("ADF95821-DED7-11d2-ACBE-0080C75E246E") - PropertySetter; - #endif - - EXTERN_C const CLSID CLSID_MediaDet; - - #ifdef __cplusplus - - class DECLSPEC_UUID("65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA") - MediaDet; - #endif - - EXTERN_C const CLSID CLSID_SampleGrabber; - - #ifdef __cplusplus - - class DECLSPEC_UUID("C1F400A0-3F08-11d3-9F0B-006008039E37") - SampleGrabber; - #endif - - EXTERN_C const CLSID CLSID_NullRenderer; - - #ifdef __cplusplus - - class DECLSPEC_UUID("C1F400A4-3F08-11d3-9F0B-006008039E37") - NullRenderer; - #endif - - EXTERN_C const CLSID CLSID_DxtCompositor; - - #ifdef __cplusplus - - class DECLSPEC_UUID("BB44391D-6ABD-422f-9E2E-385C9DFF51FC") - DxtCompositor; - #endif - - EXTERN_C const CLSID CLSID_DxtAlphaSetter; - - #ifdef __cplusplus - - class DECLSPEC_UUID("506D89AE-909A-44f7-9444-ABD575896E35") - DxtAlphaSetter; - #endif - - EXTERN_C const CLSID CLSID_DxtJpeg; - - #ifdef __cplusplus - - class DECLSPEC_UUID("DE75D012-7A65-11D2-8CEA-00A0C9441E20") - DxtJpeg; - #endif - - EXTERN_C const CLSID CLSID_ColorSource; - - #ifdef __cplusplus - - class DECLSPEC_UUID("0cfdd070-581a-11d2-9ee6-006008039e37") - ColorSource; - #endif - - EXTERN_C const CLSID CLSID_DxtKey; - - #ifdef __cplusplus - - class DECLSPEC_UUID("C5B19592-145E-11d3-9F04-006008039E37") - DxtKey; - #endif - #endif /* __DexterLib_LIBRARY_DEFINED__ */ - - /* interface __MIDL_itf_qedit_0450 */ - /* [local] */ - - - enum __MIDL___MIDL_itf_qedit_0450_0001 - { E_NOTINTREE = 0x80040400, - E_RENDER_ENGINE_IS_BROKEN = 0x80040401, - E_MUST_INIT_RENDERER = 0x80040402, - E_NOTDETERMINED = 0x80040403, - E_NO_TIMELINE = 0x80040404, - S_WARN_OUTPUTRESET = 40404 - } ; - #define DEX_IDS_BAD_SOURCE_NAME 1400 - #define DEX_IDS_BAD_SOURCE_NAME2 1401 - #define DEX_IDS_MISSING_SOURCE_NAME 1402 - #define DEX_IDS_UNKNOWN_SOURCE 1403 - #define DEX_IDS_INSTALL_PROBLEM 1404 - #define DEX_IDS_NO_SOURCE_NAMES 1405 - #define DEX_IDS_BAD_MEDIATYPE 1406 - #define DEX_IDS_STREAM_NUMBER 1407 - #define DEX_IDS_OUTOFMEMORY 1408 - #define DEX_IDS_DIBSEQ_NOTALLSAME 1409 - #define DEX_IDS_CLIPTOOSHORT 1410 - #define DEX_IDS_INVALID_DXT 1411 - #define DEX_IDS_INVALID_DEFAULT_DXT 1412 - #define DEX_IDS_NO_3D 1413 - #define DEX_IDS_BROKEN_DXT 1414 - #define DEX_IDS_NO_SUCH_PROPERTY 1415 - #define DEX_IDS_ILLEGAL_PROPERTY_VAL 1416 - #define DEX_IDS_INVALID_XML 1417 - #define DEX_IDS_CANT_FIND_FILTER 1418 - #define DEX_IDS_DISK_WRITE_ERROR 1419 - #define DEX_IDS_INVALID_AUDIO_FX 1420 - #define DEX_IDS_CANT_FIND_COMPRESSOR 1421 - #define DEX_IDS_TIMELINE_PARSE 1426 - #define DEX_IDS_GRAPH_ERROR 1427 - #define DEX_IDS_GRID_ERROR 1428 - #define DEX_IDS_INTERFACE_ERROR 1429 - EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - - - extern RPC_IF_HANDLE __MIDL_itf_qedit_0450_v0_0_c_ifspec; - extern RPC_IF_HANDLE __MIDL_itf_qedit_0450_v0_0_s_ifspec; - - /* Additional Prototypes for ALL interfaces */ - - unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); - unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); - unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); - void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - - unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); - unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); - unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); - void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - - /* end of Additional Prototypes */ - - #ifdef __cplusplus - } - #endif - - #endif - - -#endif // DirectX 8.0 content \ No newline at end of file diff --git a/import/DirectX8/include/qnetwork.h b/import/DirectX8/include/qnetwork.h deleted file mode 100644 index 2df219464..000000000 --- a/import/DirectX8/include/qnetwork.h +++ /dev/null @@ -1,555 +0,0 @@ -//------------------------------------------------------------------------------ -// File: qnetwork.h -// -// Desc: This header file machine-generated by mktyplib.exe. -// Interface to type library: QuartzNetTypeLib -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef _QuartzNetTypeLib_H_ -#define _QuartzNetTypeLib_H_ - -DEFINE_GUID(LIBID_QuartzNetTypeLib,0x56A868B1L,0x0AD4,0x11CE,0xB0,0x3A,0x00,0x20,0xAF,0x0B,0xA7,0x70); -#ifndef BEGIN_INTERFACE -#define BEGIN_INTERFACE -#endif - -DEFINE_GUID(IID_IAMNetShowConfig,0xFA2AA8F1L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMNetShowConfig */ -#undef INTERFACE -#define INTERFACE IAMNetShowConfig - -DECLARE_INTERFACE_(IAMNetShowConfig, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMNetShowConfig methods */ - STDMETHOD(get_BufferingTime)(THIS_ double FAR* pBufferingTime) PURE; - STDMETHOD(put_BufferingTime)(THIS_ double BufferingTime) PURE; - STDMETHOD(get_UseFixedUDPPort)(THIS_ VARIANT_BOOL FAR* pUseFixedUDPPort) PURE; - STDMETHOD(put_UseFixedUDPPort)(THIS_ VARIANT_BOOL UseFixedUDPPort) PURE; - STDMETHOD(get_FixedUDPPort)(THIS_ long FAR* pFixedUDPPort) PURE; - STDMETHOD(put_FixedUDPPort)(THIS_ long FixedUDPPort) PURE; - STDMETHOD(get_UseHTTPProxy)(THIS_ VARIANT_BOOL FAR* pUseHTTPProxy) PURE; - STDMETHOD(put_UseHTTPProxy)(THIS_ VARIANT_BOOL UseHTTPProxy) PURE; - STDMETHOD(get_EnableAutoProxy)(THIS_ VARIANT_BOOL FAR* pEnableAutoProxy) PURE; - STDMETHOD(put_EnableAutoProxy)(THIS_ VARIANT_BOOL EnableAutoProxy) PURE; - STDMETHOD(get_HTTPProxyHost)(THIS_ BSTR FAR* pbstrHTTPProxyHost) PURE; - STDMETHOD(put_HTTPProxyHost)(THIS_ BSTR bstrHTTPProxyHost) PURE; - STDMETHOD(get_HTTPProxyPort)(THIS_ long FAR* pHTTPProxyPort) PURE; - STDMETHOD(put_HTTPProxyPort)(THIS_ long HTTPProxyPort) PURE; - STDMETHOD(get_EnableMulticast)(THIS_ VARIANT_BOOL FAR* pEnableMulticast) PURE; - STDMETHOD(put_EnableMulticast)(THIS_ VARIANT_BOOL EnableMulticast) PURE; - STDMETHOD(get_EnableUDP)(THIS_ VARIANT_BOOL FAR* pEnableUDP) PURE; - STDMETHOD(put_EnableUDP)(THIS_ VARIANT_BOOL EnableUDP) PURE; - STDMETHOD(get_EnableTCP)(THIS_ VARIANT_BOOL FAR* pEnableTCP) PURE; - STDMETHOD(put_EnableTCP)(THIS_ VARIANT_BOOL EnableTCP) PURE; - STDMETHOD(get_EnableHTTP)(THIS_ VARIANT_BOOL FAR* pEnableHTTP) PURE; - STDMETHOD(put_EnableHTTP)(THIS_ VARIANT_BOOL EnableHTTP) PURE; -}; - -DEFINE_GUID(IID_IAMChannelInfo,0xFA2AA8F2L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMChannelInfo */ -#undef INTERFACE -#define INTERFACE IAMChannelInfo - -DECLARE_INTERFACE_(IAMChannelInfo, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMChannelInfo methods */ - STDMETHOD(get_ChannelName)(THIS_ BSTR FAR* pbstrChannelName) PURE; - STDMETHOD(get_ChannelDescription)(THIS_ BSTR FAR* pbstrChannelDescription) PURE; - STDMETHOD(get_ChannelURL)(THIS_ BSTR FAR* pbstrChannelURL) PURE; - STDMETHOD(get_ContactAddress)(THIS_ BSTR FAR* pbstrContactAddress) PURE; - STDMETHOD(get_ContactPhone)(THIS_ BSTR FAR* pbstrContactPhone) PURE; - STDMETHOD(get_ContactEmail)(THIS_ BSTR FAR* pbstrContactEmail) PURE; -}; - -DEFINE_GUID(IID_IAMNetworkStatus,0xFA2AA8F3L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMNetworkStatus */ -#undef INTERFACE -#define INTERFACE IAMNetworkStatus - -DECLARE_INTERFACE_(IAMNetworkStatus, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMNetworkStatus methods */ - STDMETHOD(get_ReceivedPackets)(THIS_ long FAR* pReceivedPackets) PURE; - STDMETHOD(get_RecoveredPackets)(THIS_ long FAR* pRecoveredPackets) PURE; - STDMETHOD(get_LostPackets)(THIS_ long FAR* pLostPackets) PURE; - STDMETHOD(get_ReceptionQuality)(THIS_ long FAR* pReceptionQuality) PURE; - STDMETHOD(get_BufferingCount)(THIS_ long FAR* pBufferingCount) PURE; - STDMETHOD(get_IsBroadcast)(THIS_ VARIANT_BOOL FAR* pIsBroadcast) PURE; - STDMETHOD(get_BufferingProgress)(THIS_ long FAR* pBufferingProgress) PURE; -}; - -typedef enum { - AM_EXSEEK_CANSEEK = 1, - AM_EXSEEK_CANSCAN = 2, - AM_EXSEEK_MARKERSEEK = 4, - AM_EXSEEK_SCANWITHOUTCLOCK = 8, - AM_EXSEEK_NOSTANDARDREPAINT = 16, - AM_EXSEEK_BUFFERING = 32, - AM_EXSEEK_SENDS_VIDEOFRAMEREADY = 64 -} AMExtendedSeekingCapabilities; - -DEFINE_GUID(IID_IAMExtendedSeeking,0xFA2AA8F9L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMExtendedSeeking */ -#undef INTERFACE -#define INTERFACE IAMExtendedSeeking - -DECLARE_INTERFACE_(IAMExtendedSeeking, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMExtendedSeeking methods */ - STDMETHOD(get_ExSeekCapabilities)(THIS_ long FAR* pExCapabilities) PURE; - STDMETHOD(get_MarkerCount)(THIS_ long FAR* pMarkerCount) PURE; - STDMETHOD(get_CurrentMarker)(THIS_ long FAR* pCurrentMarker) PURE; - STDMETHOD(GetMarkerTime)(THIS_ long MarkerNum, double FAR* pMarkerTime) PURE; - STDMETHOD(GetMarkerName)(THIS_ long MarkerNum, BSTR FAR* pbstrMarkerName) PURE; - STDMETHOD(put_PlaybackSpeed)(THIS_ double Speed) PURE; - STDMETHOD(get_PlaybackSpeed)(THIS_ double FAR* pSpeed) PURE; -}; - -DEFINE_GUID(IID_IAMNetShowExProps,0xFA2AA8F5L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMNetShowExProps */ -#undef INTERFACE -#define INTERFACE IAMNetShowExProps - -DECLARE_INTERFACE_(IAMNetShowExProps, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMNetShowExProps methods */ - STDMETHOD(get_SourceProtocol)(THIS_ long FAR* pSourceProtocol) PURE; - STDMETHOD(get_Bandwidth)(THIS_ long FAR* pBandwidth) PURE; - STDMETHOD(get_ErrorCorrection)(THIS_ BSTR FAR* pbstrErrorCorrection) PURE; - STDMETHOD(get_CodecCount)(THIS_ long FAR* pCodecCount) PURE; - STDMETHOD(GetCodecInstalled)(THIS_ long CodecNum, VARIANT_BOOL FAR* pCodecInstalled) PURE; - STDMETHOD(GetCodecDescription)(THIS_ long CodecNum, BSTR FAR* pbstrCodecDescription) PURE; - STDMETHOD(GetCodecURL)(THIS_ long CodecNum, BSTR FAR* pbstrCodecURL) PURE; - STDMETHOD(get_CreationDate)(THIS_ DATE FAR* pCreationDate) PURE; - STDMETHOD(get_SourceLink)(THIS_ BSTR FAR* pbstrSourceLink) PURE; -}; - -DEFINE_GUID(IID_IAMExtendedErrorInfo,0xFA2AA8F6L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMExtendedErrorInfo */ -#undef INTERFACE -#define INTERFACE IAMExtendedErrorInfo - -DECLARE_INTERFACE_(IAMExtendedErrorInfo, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMExtendedErrorInfo methods */ - STDMETHOD(get_HasError)(THIS_ VARIANT_BOOL FAR* pHasError) PURE; - STDMETHOD(get_ErrorDescription)(THIS_ BSTR FAR* pbstrErrorDescription) PURE; - STDMETHOD(get_ErrorCode)(THIS_ long FAR* pErrorCode) PURE; -}; - -DEFINE_GUID(IID_IAMMediaContent,0xFA2AA8F4L,0x8B62,0x11D0,0xA5,0x20,0x00,0x00,0x00,0x00,0x00,0x00); - -/* Definition of interface: IAMMediaContent */ -#undef INTERFACE -#define INTERFACE IAMMediaContent - -DECLARE_INTERFACE_(IAMMediaContent, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMMediaContent methods */ - STDMETHOD(get_AuthorName)(THIS_ BSTR FAR* pbstrAuthorName) PURE; - STDMETHOD(get_Title)(THIS_ BSTR FAR* pbstrTitle) PURE; - STDMETHOD(get_Rating)(THIS_ BSTR FAR* pbstrRating) PURE; - STDMETHOD(get_Description)(THIS_ BSTR FAR* pbstrDescription) PURE; - STDMETHOD(get_Copyright)(THIS_ BSTR FAR* pbstrCopyright) PURE; - STDMETHOD(get_BaseURL)(THIS_ BSTR FAR* pbstrBaseURL) PURE; - STDMETHOD(get_LogoURL)(THIS_ BSTR FAR* pbstrLogoURL) PURE; - STDMETHOD(get_LogoIconURL)(THIS_ BSTR FAR* pbstrLogoURL) PURE; - STDMETHOD(get_WatermarkURL)(THIS_ BSTR FAR* pbstrWatermarkURL) PURE; - STDMETHOD(get_MoreInfoURL)(THIS_ BSTR FAR* pbstrMoreInfoURL) PURE; - STDMETHOD(get_MoreInfoBannerImage)(THIS_ BSTR FAR* pbstrMoreInfoBannerImage) PURE; - STDMETHOD(get_MoreInfoBannerURL)(THIS_ BSTR FAR* pbstrMoreInfoBannerURL) PURE; - STDMETHOD(get_MoreInfoText)(THIS_ BSTR FAR* pbstrMoreInfoText) PURE; -}; - -DEFINE_GUID(IID_IAMMediaContent2,0xCE8F78C1L,0x74D9,0x11D2,0xB0,0x9D,0x00,0xA0,0xC9,0xA8,0x11,0x17); - -/* Definition of interface: IAMMediaContent2 */ -#undef INTERFACE -#define INTERFACE IAMMediaContent2 - -DECLARE_INTERFACE_(IAMMediaContent2, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMMediaContent2 methods */ - STDMETHOD(get_MediaParameter)(THIS_ long EntryNum, BSTR bstrName, BSTR FAR* pbstrValue) PURE; - STDMETHOD(get_MediaParameterName)(THIS_ long EntryNum, long Index, BSTR FAR* pbstrName) PURE; - STDMETHOD(get_PlaylistCount)(THIS_ long FAR* pNumberEntries) PURE; -}; - -DEFINE_GUID(IID_IAMNetShowPreroll,0xAAE7E4E2L,0x6388,0x11D1,0x8D,0x93,0x00,0x60,0x97,0xC9,0xA2,0xB2); - -/* Definition of interface: IAMNetShowPreroll */ -#undef INTERFACE -#define INTERFACE IAMNetShowPreroll - -DECLARE_INTERFACE_(IAMNetShowPreroll, IDispatch) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDispatch methods */ - STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE; - - STDMETHOD(GetTypeInfo)( - THIS_ - UINT itinfo, - LCID lcid, - ITypeInfo FAR* FAR* pptinfo) PURE; - - STDMETHOD(GetIDsOfNames)( - THIS_ - REFIID riid, - OLECHAR FAR* FAR* rgszNames, - UINT cNames, - LCID lcid, - DISPID FAR* rgdispid) PURE; - - STDMETHOD(Invoke)( - THIS_ - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS FAR* pdispparams, - VARIANT FAR* pvarResult, - EXCEPINFO FAR* pexcepinfo, - UINT FAR* puArgErr) PURE; -#endif - - /* IAMNetShowPreroll methods */ - STDMETHOD(put_Preroll)(THIS_ VARIANT_BOOL fPreroll) PURE; - STDMETHOD(get_Preroll)(THIS_ VARIANT_BOOL FAR* pfPreroll) PURE; -}; - -DEFINE_GUID(IID_IDShowPlugin,0x4746B7C8L,0x700E,0x11D1,0xBE,0xCC,0x00,0xC0,0x4F,0xB6,0xE9,0x37); - -/* Definition of interface: IDShowPlugin */ -#undef INTERFACE -#define INTERFACE IDShowPlugin - -DECLARE_INTERFACE_(IDShowPlugin, IUnknown) -{ -BEGIN_INTERFACE -#ifndef NO_BASEINTERFACE_FUNCS - - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDShowPlugin methods */ - STDMETHOD(get_URL)(THIS_ BSTR FAR* pURL) PURE; - STDMETHOD(get_UserAgent)(THIS_ BSTR FAR* pUserAgent) PURE; -}; - -#endif diff --git a/import/DirectX8/include/regbag.h b/import/DirectX8/include/regbag.h deleted file mode 100644 index faded963f..000000000 --- a/import/DirectX8/include/regbag.h +++ /dev/null @@ -1,193 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for regbag.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __regbag_h__ -#define __regbag_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ICreatePropBagOnRegKey_FWD_DEFINED__ -#define __ICreatePropBagOnRegKey_FWD_DEFINED__ -typedef interface ICreatePropBagOnRegKey ICreatePropBagOnRegKey; -#endif /* __ICreatePropBagOnRegKey_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "objidl.h" -#include "oaidl.h" -#include "ocidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_regbag_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1999-2001. -// -//-------------------------------------------------------------------------- -#pragma once - - -extern RPC_IF_HANDLE __MIDL_itf_regbag_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_regbag_0000_v0_0_s_ifspec; - -#ifndef __ICreatePropBagOnRegKey_INTERFACE_DEFINED__ -#define __ICreatePropBagOnRegKey_INTERFACE_DEFINED__ - -/* interface ICreatePropBagOnRegKey */ -/* [local][unique][helpstring][uuid][restricted][hidden][object] */ - - -EXTERN_C const IID IID_ICreatePropBagOnRegKey; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8A674B48-1F63-11d3-B64C-00C04F79498E") - ICreatePropBagOnRegKey : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Create( - /* [in] */ HKEY hkey, - /* [in] */ LPCOLESTR subkey, - /* [in] */ DWORD ulOptions, - /* [in] */ DWORD samDesired, - REFIID iid, - /* [out] */ LPVOID *ppBag) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICreatePropBagOnRegKeyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICreatePropBagOnRegKey * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICreatePropBagOnRegKey * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICreatePropBagOnRegKey * This); - - HRESULT ( STDMETHODCALLTYPE *Create )( - ICreatePropBagOnRegKey * This, - /* [in] */ HKEY hkey, - /* [in] */ LPCOLESTR subkey, - /* [in] */ DWORD ulOptions, - /* [in] */ DWORD samDesired, - REFIID iid, - /* [out] */ LPVOID *ppBag); - - END_INTERFACE - } ICreatePropBagOnRegKeyVtbl; - - interface ICreatePropBagOnRegKey - { - CONST_VTBL struct ICreatePropBagOnRegKeyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICreatePropBagOnRegKey_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ICreatePropBagOnRegKey_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ICreatePropBagOnRegKey_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ICreatePropBagOnRegKey_Create(This,hkey,subkey,ulOptions,samDesired,iid,ppBag) \ - (This)->lpVtbl -> Create(This,hkey,subkey,ulOptions,samDesired,iid,ppBag) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ICreatePropBagOnRegKey_Create_Proxy( - ICreatePropBagOnRegKey * This, - /* [in] */ HKEY hkey, - /* [in] */ LPCOLESTR subkey, - /* [in] */ DWORD ulOptions, - /* [in] */ DWORD samDesired, - REFIID iid, - /* [out] */ LPVOID *ppBag); - - -void __RPC_STUB ICreatePropBagOnRegKey_Create_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ICreatePropBagOnRegKey_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/rmxfguid.h b/import/DirectX8/include/rmxfguid.h deleted file mode 100644 index d3326ccc9..000000000 --- a/import/DirectX8/include/rmxfguid.h +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * - * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. - * - * File: rmxfguid.h - * - * Content: Defines GUIDs of D3DRM's templates. - * - ***************************************************************************/ - -#ifndef __RMXFGUID_H_ -#define __RMXFGUID_H_ - -/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMInfo, -0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMMesh, -0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMVector, -0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMMeshFace, -0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMMaterial, -0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialArray, -0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMFrame, -0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {F6F23F41-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMFrameTransformMatrix, -0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F6F23F42-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMeshMaterialList, -0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F6F23F40-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMeshTextureCoords, -0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F6F23F43-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMeshNormals, -0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F6F23F44-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMCoords2d, -0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F6F23F45-7686-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMatrix4x4, -0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMAnimation, -0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMAnimationSet, -0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {10DD46A8-775B-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMAnimationKey, -0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {10DD46A9-775B-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMFloatKeys, -0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {01411840-7786-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialAmbientColor, -0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {01411841-7786-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialDiffuseColor, -0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {01411842-7786-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialSpecularColor, -0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {D3E16E80-7835-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialEmissiveColor, -0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {01411843-7786-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialPower, -0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMColorRGBA, -0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); - -/* {D3E16E81-7835-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMColorRGB, -0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {A42790E0-7810-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMGuid, -0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {A42790E1-7810-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMTextureFilename, -0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {A42790E2-7810-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMTextureReference, -0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {1630B820-7842-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMIndexedColor, -0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {1630B821-7842-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMeshVertexColors, -0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {4885AE60-78E8-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMMaterialWrap, -0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */ -DEFINE_GUID(TID_D3DRMBoolean, -0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); - -/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */ -DEFINE_GUID(TID_D3DRMMeshFaceWraps, -0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); - -/* {4885AE63-78E8-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMBoolean2d, -0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {F406B180-7B3B-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMTimedFloatKeys, -0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMAnimationOptions, -0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMFramePosition, -0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMFrameVelocity, -0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */ -DEFINE_GUID(TID_D3DRMFrameRotation, -0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); - -/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMLight, -0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMCamera, -0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */ -DEFINE_GUID(TID_D3DRMAppData, -0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); - -/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */ -DEFINE_GUID(TID_D3DRMLightUmbra, -0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); - -/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */ -DEFINE_GUID(TID_D3DRMLightRange, -0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); - -/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */ -DEFINE_GUID(TID_D3DRMLightPenumbra, -0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); - -/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */ -DEFINE_GUID(TID_D3DRMLightAttenuation, -0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); - -/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMInlineData, -0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */ -DEFINE_GUID(TID_D3DRMUrl, -0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); - -/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */ -DEFINE_GUID(TID_D3DRMProgressiveMesh, -0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B); - -/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */ -DEFINE_GUID(TID_D3DRMExternalVisual, -0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71); - -/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */ -DEFINE_GUID(TID_D3DRMStringProperty, -0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); - -/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */ -DEFINE_GUID(TID_D3DRMPropertyBag, -0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); - -// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271} -DEFINE_GUID(TID_D3DRMRightHanded, -0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); - -#endif /* __RMXFGUID_H_ */ - diff --git a/import/DirectX8/include/rmxftmpl.h b/import/DirectX8/include/rmxftmpl.h deleted file mode 100644 index e0018d046..000000000 --- a/import/DirectX8/include/rmxftmpl.h +++ /dev/null @@ -1,339 +0,0 @@ -/* D3DRM XFile templates in binary form */ - -#ifndef _RMXFTMPL_H_ -#define _RMXFTMPL_H_ - -unsigned char D3DRM_XTEMPLATES[] = { - 0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62, - 0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1, - 0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda, - 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, - 0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0, - 0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14, - 0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d, - 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, - 0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0, - 0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0, - 0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, - 0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, - 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, - 0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2, - 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, - 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0, - 0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, - 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, - 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f, - 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, - 0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0, - 0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, - 0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0, - 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, - 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, - 0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c, - 0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, - 0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72, - 0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, - 0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a, - 0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75, - 0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0, - 0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0, - 0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, - 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0, - 0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52, - 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, - 0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a, - 0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65, - 0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0, - 0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0, - 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, - 0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78, - 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, - 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0, - 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, - 0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0, - 0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, - 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0, - 0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0, - 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9, - 0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c, - 0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, - 0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, - 0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85, - 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, - 0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42, - 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, - 0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0, - 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, - 0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, - 0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74, - 0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa, - 0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf, - 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, - 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, - 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14, - 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, - 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, - 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf, - 0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, - 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0, - 0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, - 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0, - 0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab, - 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, - 0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0, - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1, - 0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43, - 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0, - 0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14, - 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c, - 0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0, - 0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43, - 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0, - 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, - 0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, - 0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, - 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0, - 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa, - 0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, - 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, - 0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61, - 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, - 0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63, - 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0, - 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72, - 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, - 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, - 0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, - 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5, - 0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94, - 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, - 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, - 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0, - 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1, - 0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57, - 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe, - 0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, - 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, - 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, - 0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2, - 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, - 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0, - 0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, - 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1, - 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, - 0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74, - 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72, - 0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, - 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, - 0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, - 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65, - 0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f, - 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, - 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0, - 0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0, - 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0, - 0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1, - 0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14, - 0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d, - 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d, - 0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, - 0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76, - 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, - 0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e, - 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, - 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f, - 0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8, - 0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, - 0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, - 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f, - 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1, - 0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, - 0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66, - 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, - 0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46, - 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, - 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, - 0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65, - 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, - 0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78, - 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, - 0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, - 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0, - 0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, - 0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, - 0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, - 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, - 0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, - 0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62, - 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, - 0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56, - 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, - 0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76, - 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, - 0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74, - 0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0, - 0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, - 0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0, - 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, - 0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, - 0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e, - 0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe, - 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa, - 0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, - 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, - 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5, - 0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0, - 0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, - 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0, - 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0, - 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c, - 0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5, - 0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f, - 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, - 0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0, - 0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, - 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, - 0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6, - 0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, - 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0, - 0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9, - 0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, - 0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66, - 0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0, - 0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, - 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, - 0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54, - 0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5, - 0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0, - 0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69, - 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, - 0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65, - 0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0, - 0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41, - 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0, - 0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0, - 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, - 0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, - 0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf, - 0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0, - 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, - 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa, - 0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, - 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, - 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41, - 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda, - 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, - 0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41, - 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0, - 0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0, - 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, - 0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94, - 0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, - 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49, - 0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0, - 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa, - 0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0, - 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, - 0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, - 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0, - 0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0, - 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c, - 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, - 0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68, - 0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99, - 0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, - 0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, - 0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49, - 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf, - 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0, - 0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0, - 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, - 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5, - 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0, - 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61, - 0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5, - 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0, - 0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0, - 0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8, - 0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, - 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1, - 0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, - 0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b, - 0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0, - 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, - 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67, - 0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf, - 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, - 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, - 0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0, - 0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11, - 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0, - 0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0, - 0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, - 0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0, - 0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, - 0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, - 0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0, - 0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0, - 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc, - 0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, - 0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0 -}; - -#define D3DRM_XTEMPLATE_BYTES 3278 - -#endif /* _RMXFTMPL_H_ */ diff --git a/import/DirectX8/include/strmif.h b/import/DirectX8/include/strmif.h deleted file mode 100644 index 3eda1cb47..000000000 --- a/import/DirectX8/include/strmif.h +++ /dev/null @@ -1,29217 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for strmif.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __strmif_h__ -#define __strmif_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ICreateDevEnum_FWD_DEFINED__ -#define __ICreateDevEnum_FWD_DEFINED__ -typedef interface ICreateDevEnum ICreateDevEnum; -#endif /* __ICreateDevEnum_FWD_DEFINED__ */ - - -#ifndef __IPin_FWD_DEFINED__ -#define __IPin_FWD_DEFINED__ -typedef interface IPin IPin; -#endif /* __IPin_FWD_DEFINED__ */ - - -#ifndef __IEnumPins_FWD_DEFINED__ -#define __IEnumPins_FWD_DEFINED__ -typedef interface IEnumPins IEnumPins; -#endif /* __IEnumPins_FWD_DEFINED__ */ - - -#ifndef __IEnumMediaTypes_FWD_DEFINED__ -#define __IEnumMediaTypes_FWD_DEFINED__ -typedef interface IEnumMediaTypes IEnumMediaTypes; -#endif /* __IEnumMediaTypes_FWD_DEFINED__ */ - - -#ifndef __IFilterGraph_FWD_DEFINED__ -#define __IFilterGraph_FWD_DEFINED__ -typedef interface IFilterGraph IFilterGraph; -#endif /* __IFilterGraph_FWD_DEFINED__ */ - - -#ifndef __IEnumFilters_FWD_DEFINED__ -#define __IEnumFilters_FWD_DEFINED__ -typedef interface IEnumFilters IEnumFilters; -#endif /* __IEnumFilters_FWD_DEFINED__ */ - - -#ifndef __IMediaFilter_FWD_DEFINED__ -#define __IMediaFilter_FWD_DEFINED__ -typedef interface IMediaFilter IMediaFilter; -#endif /* __IMediaFilter_FWD_DEFINED__ */ - - -#ifndef __IBaseFilter_FWD_DEFINED__ -#define __IBaseFilter_FWD_DEFINED__ -typedef interface IBaseFilter IBaseFilter; -#endif /* __IBaseFilter_FWD_DEFINED__ */ - - -#ifndef __IReferenceClock_FWD_DEFINED__ -#define __IReferenceClock_FWD_DEFINED__ -typedef interface IReferenceClock IReferenceClock; -#endif /* __IReferenceClock_FWD_DEFINED__ */ - - -#ifndef __IReferenceClock2_FWD_DEFINED__ -#define __IReferenceClock2_FWD_DEFINED__ -typedef interface IReferenceClock2 IReferenceClock2; -#endif /* __IReferenceClock2_FWD_DEFINED__ */ - - -#ifndef __IMediaSample_FWD_DEFINED__ -#define __IMediaSample_FWD_DEFINED__ -typedef interface IMediaSample IMediaSample; -#endif /* __IMediaSample_FWD_DEFINED__ */ - - -#ifndef __IMediaSample2_FWD_DEFINED__ -#define __IMediaSample2_FWD_DEFINED__ -typedef interface IMediaSample2 IMediaSample2; -#endif /* __IMediaSample2_FWD_DEFINED__ */ - - -#ifndef __IMemAllocator_FWD_DEFINED__ -#define __IMemAllocator_FWD_DEFINED__ -typedef interface IMemAllocator IMemAllocator; -#endif /* __IMemAllocator_FWD_DEFINED__ */ - - -#ifndef __IMemAllocatorCallbackTemp_FWD_DEFINED__ -#define __IMemAllocatorCallbackTemp_FWD_DEFINED__ -typedef interface IMemAllocatorCallbackTemp IMemAllocatorCallbackTemp; -#endif /* __IMemAllocatorCallbackTemp_FWD_DEFINED__ */ - - -#ifndef __IMemAllocatorNotifyCallbackTemp_FWD_DEFINED__ -#define __IMemAllocatorNotifyCallbackTemp_FWD_DEFINED__ -typedef interface IMemAllocatorNotifyCallbackTemp IMemAllocatorNotifyCallbackTemp; -#endif /* __IMemAllocatorNotifyCallbackTemp_FWD_DEFINED__ */ - - -#ifndef __IMemInputPin_FWD_DEFINED__ -#define __IMemInputPin_FWD_DEFINED__ -typedef interface IMemInputPin IMemInputPin; -#endif /* __IMemInputPin_FWD_DEFINED__ */ - - -#ifndef __IAMovieSetup_FWD_DEFINED__ -#define __IAMovieSetup_FWD_DEFINED__ -typedef interface IAMovieSetup IAMovieSetup; -#endif /* __IAMovieSetup_FWD_DEFINED__ */ - - -#ifndef __IMediaSeeking_FWD_DEFINED__ -#define __IMediaSeeking_FWD_DEFINED__ -typedef interface IMediaSeeking IMediaSeeking; -#endif /* __IMediaSeeking_FWD_DEFINED__ */ - - -#ifndef __IEnumRegFilters_FWD_DEFINED__ -#define __IEnumRegFilters_FWD_DEFINED__ -typedef interface IEnumRegFilters IEnumRegFilters; -#endif /* __IEnumRegFilters_FWD_DEFINED__ */ - - -#ifndef __IFilterMapper_FWD_DEFINED__ -#define __IFilterMapper_FWD_DEFINED__ -typedef interface IFilterMapper IFilterMapper; -#endif /* __IFilterMapper_FWD_DEFINED__ */ - - -#ifndef __IFilterMapper2_FWD_DEFINED__ -#define __IFilterMapper2_FWD_DEFINED__ -typedef interface IFilterMapper2 IFilterMapper2; -#endif /* __IFilterMapper2_FWD_DEFINED__ */ - - -#ifndef __IFilterMapper3_FWD_DEFINED__ -#define __IFilterMapper3_FWD_DEFINED__ -typedef interface IFilterMapper3 IFilterMapper3; -#endif /* __IFilterMapper3_FWD_DEFINED__ */ - - -#ifndef __IQualityControl_FWD_DEFINED__ -#define __IQualityControl_FWD_DEFINED__ -typedef interface IQualityControl IQualityControl; -#endif /* __IQualityControl_FWD_DEFINED__ */ - - -#ifndef __IOverlayNotify_FWD_DEFINED__ -#define __IOverlayNotify_FWD_DEFINED__ -typedef interface IOverlayNotify IOverlayNotify; -#endif /* __IOverlayNotify_FWD_DEFINED__ */ - - -#ifndef __IOverlayNotify2_FWD_DEFINED__ -#define __IOverlayNotify2_FWD_DEFINED__ -typedef interface IOverlayNotify2 IOverlayNotify2; -#endif /* __IOverlayNotify2_FWD_DEFINED__ */ - - -#ifndef __IOverlay_FWD_DEFINED__ -#define __IOverlay_FWD_DEFINED__ -typedef interface IOverlay IOverlay; -#endif /* __IOverlay_FWD_DEFINED__ */ - - -#ifndef __IMediaEventSink_FWD_DEFINED__ -#define __IMediaEventSink_FWD_DEFINED__ -typedef interface IMediaEventSink IMediaEventSink; -#endif /* __IMediaEventSink_FWD_DEFINED__ */ - - -#ifndef __IFileSourceFilter_FWD_DEFINED__ -#define __IFileSourceFilter_FWD_DEFINED__ -typedef interface IFileSourceFilter IFileSourceFilter; -#endif /* __IFileSourceFilter_FWD_DEFINED__ */ - - -#ifndef __IFileSinkFilter_FWD_DEFINED__ -#define __IFileSinkFilter_FWD_DEFINED__ -typedef interface IFileSinkFilter IFileSinkFilter; -#endif /* __IFileSinkFilter_FWD_DEFINED__ */ - - -#ifndef __IFileSinkFilter2_FWD_DEFINED__ -#define __IFileSinkFilter2_FWD_DEFINED__ -typedef interface IFileSinkFilter2 IFileSinkFilter2; -#endif /* __IFileSinkFilter2_FWD_DEFINED__ */ - - -#ifndef __IGraphBuilder_FWD_DEFINED__ -#define __IGraphBuilder_FWD_DEFINED__ -typedef interface IGraphBuilder IGraphBuilder; -#endif /* __IGraphBuilder_FWD_DEFINED__ */ - - -#ifndef __ICaptureGraphBuilder_FWD_DEFINED__ -#define __ICaptureGraphBuilder_FWD_DEFINED__ -typedef interface ICaptureGraphBuilder ICaptureGraphBuilder; -#endif /* __ICaptureGraphBuilder_FWD_DEFINED__ */ - - -#ifndef __IAMCopyCaptureFileProgress_FWD_DEFINED__ -#define __IAMCopyCaptureFileProgress_FWD_DEFINED__ -typedef interface IAMCopyCaptureFileProgress IAMCopyCaptureFileProgress; -#endif /* __IAMCopyCaptureFileProgress_FWD_DEFINED__ */ - - -#ifndef __ICaptureGraphBuilder2_FWD_DEFINED__ -#define __ICaptureGraphBuilder2_FWD_DEFINED__ -typedef interface ICaptureGraphBuilder2 ICaptureGraphBuilder2; -#endif /* __ICaptureGraphBuilder2_FWD_DEFINED__ */ - - -#ifndef __IFilterGraph2_FWD_DEFINED__ -#define __IFilterGraph2_FWD_DEFINED__ -typedef interface IFilterGraph2 IFilterGraph2; -#endif /* __IFilterGraph2_FWD_DEFINED__ */ - - -#ifndef __IStreamBuilder_FWD_DEFINED__ -#define __IStreamBuilder_FWD_DEFINED__ -typedef interface IStreamBuilder IStreamBuilder; -#endif /* __IStreamBuilder_FWD_DEFINED__ */ - - -#ifndef __IAsyncReader_FWD_DEFINED__ -#define __IAsyncReader_FWD_DEFINED__ -typedef interface IAsyncReader IAsyncReader; -#endif /* __IAsyncReader_FWD_DEFINED__ */ - - -#ifndef __IGraphVersion_FWD_DEFINED__ -#define __IGraphVersion_FWD_DEFINED__ -typedef interface IGraphVersion IGraphVersion; -#endif /* __IGraphVersion_FWD_DEFINED__ */ - - -#ifndef __IResourceConsumer_FWD_DEFINED__ -#define __IResourceConsumer_FWD_DEFINED__ -typedef interface IResourceConsumer IResourceConsumer; -#endif /* __IResourceConsumer_FWD_DEFINED__ */ - - -#ifndef __IResourceManager_FWD_DEFINED__ -#define __IResourceManager_FWD_DEFINED__ -typedef interface IResourceManager IResourceManager; -#endif /* __IResourceManager_FWD_DEFINED__ */ - - -#ifndef __IDistributorNotify_FWD_DEFINED__ -#define __IDistributorNotify_FWD_DEFINED__ -typedef interface IDistributorNotify IDistributorNotify; -#endif /* __IDistributorNotify_FWD_DEFINED__ */ - - -#ifndef __IAMStreamControl_FWD_DEFINED__ -#define __IAMStreamControl_FWD_DEFINED__ -typedef interface IAMStreamControl IAMStreamControl; -#endif /* __IAMStreamControl_FWD_DEFINED__ */ - - -#ifndef __ISeekingPassThru_FWD_DEFINED__ -#define __ISeekingPassThru_FWD_DEFINED__ -typedef interface ISeekingPassThru ISeekingPassThru; -#endif /* __ISeekingPassThru_FWD_DEFINED__ */ - - -#ifndef __IAMStreamConfig_FWD_DEFINED__ -#define __IAMStreamConfig_FWD_DEFINED__ -typedef interface IAMStreamConfig IAMStreamConfig; -#endif /* __IAMStreamConfig_FWD_DEFINED__ */ - - -#ifndef __IConfigInterleaving_FWD_DEFINED__ -#define __IConfigInterleaving_FWD_DEFINED__ -typedef interface IConfigInterleaving IConfigInterleaving; -#endif /* __IConfigInterleaving_FWD_DEFINED__ */ - - -#ifndef __IConfigAviMux_FWD_DEFINED__ -#define __IConfigAviMux_FWD_DEFINED__ -typedef interface IConfigAviMux IConfigAviMux; -#endif /* __IConfigAviMux_FWD_DEFINED__ */ - - -#ifndef __IAMVideoCompression_FWD_DEFINED__ -#define __IAMVideoCompression_FWD_DEFINED__ -typedef interface IAMVideoCompression IAMVideoCompression; -#endif /* __IAMVideoCompression_FWD_DEFINED__ */ - - -#ifndef __IAMVfwCaptureDialogs_FWD_DEFINED__ -#define __IAMVfwCaptureDialogs_FWD_DEFINED__ -typedef interface IAMVfwCaptureDialogs IAMVfwCaptureDialogs; -#endif /* __IAMVfwCaptureDialogs_FWD_DEFINED__ */ - - -#ifndef __IAMVfwCompressDialogs_FWD_DEFINED__ -#define __IAMVfwCompressDialogs_FWD_DEFINED__ -typedef interface IAMVfwCompressDialogs IAMVfwCompressDialogs; -#endif /* __IAMVfwCompressDialogs_FWD_DEFINED__ */ - - -#ifndef __IAMDroppedFrames_FWD_DEFINED__ -#define __IAMDroppedFrames_FWD_DEFINED__ -typedef interface IAMDroppedFrames IAMDroppedFrames; -#endif /* __IAMDroppedFrames_FWD_DEFINED__ */ - - -#ifndef __IAMAudioInputMixer_FWD_DEFINED__ -#define __IAMAudioInputMixer_FWD_DEFINED__ -typedef interface IAMAudioInputMixer IAMAudioInputMixer; -#endif /* __IAMAudioInputMixer_FWD_DEFINED__ */ - - -#ifndef __IAMBufferNegotiation_FWD_DEFINED__ -#define __IAMBufferNegotiation_FWD_DEFINED__ -typedef interface IAMBufferNegotiation IAMBufferNegotiation; -#endif /* __IAMBufferNegotiation_FWD_DEFINED__ */ - - -#ifndef __IAMAnalogVideoDecoder_FWD_DEFINED__ -#define __IAMAnalogVideoDecoder_FWD_DEFINED__ -typedef interface IAMAnalogVideoDecoder IAMAnalogVideoDecoder; -#endif /* __IAMAnalogVideoDecoder_FWD_DEFINED__ */ - - -#ifndef __IAMVideoProcAmp_FWD_DEFINED__ -#define __IAMVideoProcAmp_FWD_DEFINED__ -typedef interface IAMVideoProcAmp IAMVideoProcAmp; -#endif /* __IAMVideoProcAmp_FWD_DEFINED__ */ - - -#ifndef __IAMCameraControl_FWD_DEFINED__ -#define __IAMCameraControl_FWD_DEFINED__ -typedef interface IAMCameraControl IAMCameraControl; -#endif /* __IAMCameraControl_FWD_DEFINED__ */ - - -#ifndef __IAMVideoControl_FWD_DEFINED__ -#define __IAMVideoControl_FWD_DEFINED__ -typedef interface IAMVideoControl IAMVideoControl; -#endif /* __IAMVideoControl_FWD_DEFINED__ */ - - -#ifndef __IAMCrossbar_FWD_DEFINED__ -#define __IAMCrossbar_FWD_DEFINED__ -typedef interface IAMCrossbar IAMCrossbar; -#endif /* __IAMCrossbar_FWD_DEFINED__ */ - - -#ifndef __IAMTuner_FWD_DEFINED__ -#define __IAMTuner_FWD_DEFINED__ -typedef interface IAMTuner IAMTuner; -#endif /* __IAMTuner_FWD_DEFINED__ */ - - -#ifndef __IAMTunerNotification_FWD_DEFINED__ -#define __IAMTunerNotification_FWD_DEFINED__ -typedef interface IAMTunerNotification IAMTunerNotification; -#endif /* __IAMTunerNotification_FWD_DEFINED__ */ - - -#ifndef __IAMTVTuner_FWD_DEFINED__ -#define __IAMTVTuner_FWD_DEFINED__ -typedef interface IAMTVTuner IAMTVTuner; -#endif /* __IAMTVTuner_FWD_DEFINED__ */ - - -#ifndef __IBPCSatelliteTuner_FWD_DEFINED__ -#define __IBPCSatelliteTuner_FWD_DEFINED__ -typedef interface IBPCSatelliteTuner IBPCSatelliteTuner; -#endif /* __IBPCSatelliteTuner_FWD_DEFINED__ */ - - -#ifndef __IAMTVAudio_FWD_DEFINED__ -#define __IAMTVAudio_FWD_DEFINED__ -typedef interface IAMTVAudio IAMTVAudio; -#endif /* __IAMTVAudio_FWD_DEFINED__ */ - - -#ifndef __IAMTVAudioNotification_FWD_DEFINED__ -#define __IAMTVAudioNotification_FWD_DEFINED__ -typedef interface IAMTVAudioNotification IAMTVAudioNotification; -#endif /* __IAMTVAudioNotification_FWD_DEFINED__ */ - - -#ifndef __IAMAnalogVideoEncoder_FWD_DEFINED__ -#define __IAMAnalogVideoEncoder_FWD_DEFINED__ -typedef interface IAMAnalogVideoEncoder IAMAnalogVideoEncoder; -#endif /* __IAMAnalogVideoEncoder_FWD_DEFINED__ */ - - -#ifndef __IKsPropertySet_FWD_DEFINED__ -#define __IKsPropertySet_FWD_DEFINED__ -typedef interface IKsPropertySet IKsPropertySet; -#endif /* __IKsPropertySet_FWD_DEFINED__ */ - - -#ifndef __IMediaPropertyBag_FWD_DEFINED__ -#define __IMediaPropertyBag_FWD_DEFINED__ -typedef interface IMediaPropertyBag IMediaPropertyBag; -#endif /* __IMediaPropertyBag_FWD_DEFINED__ */ - - -#ifndef __IPersistMediaPropertyBag_FWD_DEFINED__ -#define __IPersistMediaPropertyBag_FWD_DEFINED__ -typedef interface IPersistMediaPropertyBag IPersistMediaPropertyBag; -#endif /* __IPersistMediaPropertyBag_FWD_DEFINED__ */ - - -#ifndef __IAMPhysicalPinInfo_FWD_DEFINED__ -#define __IAMPhysicalPinInfo_FWD_DEFINED__ -typedef interface IAMPhysicalPinInfo IAMPhysicalPinInfo; -#endif /* __IAMPhysicalPinInfo_FWD_DEFINED__ */ - - -#ifndef __IAMExtDevice_FWD_DEFINED__ -#define __IAMExtDevice_FWD_DEFINED__ -typedef interface IAMExtDevice IAMExtDevice; -#endif /* __IAMExtDevice_FWD_DEFINED__ */ - - -#ifndef __IAMExtTransport_FWD_DEFINED__ -#define __IAMExtTransport_FWD_DEFINED__ -typedef interface IAMExtTransport IAMExtTransport; -#endif /* __IAMExtTransport_FWD_DEFINED__ */ - - -#ifndef __IAMTimecodeReader_FWD_DEFINED__ -#define __IAMTimecodeReader_FWD_DEFINED__ -typedef interface IAMTimecodeReader IAMTimecodeReader; -#endif /* __IAMTimecodeReader_FWD_DEFINED__ */ - - -#ifndef __IAMTimecodeGenerator_FWD_DEFINED__ -#define __IAMTimecodeGenerator_FWD_DEFINED__ -typedef interface IAMTimecodeGenerator IAMTimecodeGenerator; -#endif /* __IAMTimecodeGenerator_FWD_DEFINED__ */ - - -#ifndef __IAMTimecodeDisplay_FWD_DEFINED__ -#define __IAMTimecodeDisplay_FWD_DEFINED__ -typedef interface IAMTimecodeDisplay IAMTimecodeDisplay; -#endif /* __IAMTimecodeDisplay_FWD_DEFINED__ */ - - -#ifndef __IAMDevMemoryAllocator_FWD_DEFINED__ -#define __IAMDevMemoryAllocator_FWD_DEFINED__ -typedef interface IAMDevMemoryAllocator IAMDevMemoryAllocator; -#endif /* __IAMDevMemoryAllocator_FWD_DEFINED__ */ - - -#ifndef __IAMDevMemoryControl_FWD_DEFINED__ -#define __IAMDevMemoryControl_FWD_DEFINED__ -typedef interface IAMDevMemoryControl IAMDevMemoryControl; -#endif /* __IAMDevMemoryControl_FWD_DEFINED__ */ - - -#ifndef __IAMStreamSelect_FWD_DEFINED__ -#define __IAMStreamSelect_FWD_DEFINED__ -typedef interface IAMStreamSelect IAMStreamSelect; -#endif /* __IAMStreamSelect_FWD_DEFINED__ */ - - -#ifndef __IAMResourceControl_FWD_DEFINED__ -#define __IAMResourceControl_FWD_DEFINED__ -typedef interface IAMResourceControl IAMResourceControl; -#endif /* __IAMResourceControl_FWD_DEFINED__ */ - - -#ifndef __IAMClockAdjust_FWD_DEFINED__ -#define __IAMClockAdjust_FWD_DEFINED__ -typedef interface IAMClockAdjust IAMClockAdjust; -#endif /* __IAMClockAdjust_FWD_DEFINED__ */ - - -#ifndef __IAMFilterMiscFlags_FWD_DEFINED__ -#define __IAMFilterMiscFlags_FWD_DEFINED__ -typedef interface IAMFilterMiscFlags IAMFilterMiscFlags; -#endif /* __IAMFilterMiscFlags_FWD_DEFINED__ */ - - -#ifndef __IDrawVideoImage_FWD_DEFINED__ -#define __IDrawVideoImage_FWD_DEFINED__ -typedef interface IDrawVideoImage IDrawVideoImage; -#endif /* __IDrawVideoImage_FWD_DEFINED__ */ - - -#ifndef __IDecimateVideoImage_FWD_DEFINED__ -#define __IDecimateVideoImage_FWD_DEFINED__ -typedef interface IDecimateVideoImage IDecimateVideoImage; -#endif /* __IDecimateVideoImage_FWD_DEFINED__ */ - - -#ifndef __IAMVideoDecimationProperties_FWD_DEFINED__ -#define __IAMVideoDecimationProperties_FWD_DEFINED__ -typedef interface IAMVideoDecimationProperties IAMVideoDecimationProperties; -#endif /* __IAMVideoDecimationProperties_FWD_DEFINED__ */ - - -#ifndef __IVideoFrameStep_FWD_DEFINED__ -#define __IVideoFrameStep_FWD_DEFINED__ -typedef interface IVideoFrameStep IVideoFrameStep; -#endif /* __IVideoFrameStep_FWD_DEFINED__ */ - - -#ifndef __IAMLatency_FWD_DEFINED__ -#define __IAMLatency_FWD_DEFINED__ -typedef interface IAMLatency IAMLatency; -#endif /* __IAMLatency_FWD_DEFINED__ */ - - -#ifndef __IAMPushSource_FWD_DEFINED__ -#define __IAMPushSource_FWD_DEFINED__ -typedef interface IAMPushSource IAMPushSource; -#endif /* __IAMPushSource_FWD_DEFINED__ */ - - -#ifndef __IAMDeviceRemoval_FWD_DEFINED__ -#define __IAMDeviceRemoval_FWD_DEFINED__ -typedef interface IAMDeviceRemoval IAMDeviceRemoval; -#endif /* __IAMDeviceRemoval_FWD_DEFINED__ */ - - -#ifndef __IDVEnc_FWD_DEFINED__ -#define __IDVEnc_FWD_DEFINED__ -typedef interface IDVEnc IDVEnc; -#endif /* __IDVEnc_FWD_DEFINED__ */ - - -#ifndef __IIPDVDec_FWD_DEFINED__ -#define __IIPDVDec_FWD_DEFINED__ -typedef interface IIPDVDec IIPDVDec; -#endif /* __IIPDVDec_FWD_DEFINED__ */ - - -#ifndef __IDVRGB219_FWD_DEFINED__ -#define __IDVRGB219_FWD_DEFINED__ -typedef interface IDVRGB219 IDVRGB219; -#endif /* __IDVRGB219_FWD_DEFINED__ */ - - -#ifndef __IDVSplitter_FWD_DEFINED__ -#define __IDVSplitter_FWD_DEFINED__ -typedef interface IDVSplitter IDVSplitter; -#endif /* __IDVSplitter_FWD_DEFINED__ */ - - -#ifndef __IAMAudioRendererStats_FWD_DEFINED__ -#define __IAMAudioRendererStats_FWD_DEFINED__ -typedef interface IAMAudioRendererStats IAMAudioRendererStats; -#endif /* __IAMAudioRendererStats_FWD_DEFINED__ */ - - -#ifndef __IAMGraphStreams_FWD_DEFINED__ -#define __IAMGraphStreams_FWD_DEFINED__ -typedef interface IAMGraphStreams IAMGraphStreams; -#endif /* __IAMGraphStreams_FWD_DEFINED__ */ - - -#ifndef __IAMOverlayFX_FWD_DEFINED__ -#define __IAMOverlayFX_FWD_DEFINED__ -typedef interface IAMOverlayFX IAMOverlayFX; -#endif /* __IAMOverlayFX_FWD_DEFINED__ */ - - -#ifndef __IAMOpenProgress_FWD_DEFINED__ -#define __IAMOpenProgress_FWD_DEFINED__ -typedef interface IAMOpenProgress IAMOpenProgress; -#endif /* __IAMOpenProgress_FWD_DEFINED__ */ - - -#ifndef __IMpeg2Demultiplexer_FWD_DEFINED__ -#define __IMpeg2Demultiplexer_FWD_DEFINED__ -typedef interface IMpeg2Demultiplexer IMpeg2Demultiplexer; -#endif /* __IMpeg2Demultiplexer_FWD_DEFINED__ */ - - -#ifndef __IEnumStreamIdMap_FWD_DEFINED__ -#define __IEnumStreamIdMap_FWD_DEFINED__ -typedef interface IEnumStreamIdMap IEnumStreamIdMap; -#endif /* __IEnumStreamIdMap_FWD_DEFINED__ */ - - -#ifndef __IMPEG2StreamIdMap_FWD_DEFINED__ -#define __IMPEG2StreamIdMap_FWD_DEFINED__ -typedef interface IMPEG2StreamIdMap IMPEG2StreamIdMap; -#endif /* __IMPEG2StreamIdMap_FWD_DEFINED__ */ - - -#ifndef __IRegisterServiceProvider_FWD_DEFINED__ -#define __IRegisterServiceProvider_FWD_DEFINED__ -typedef interface IRegisterServiceProvider IRegisterServiceProvider; -#endif /* __IRegisterServiceProvider_FWD_DEFINED__ */ - - -#ifndef __IAMDecoderCaps_FWD_DEFINED__ -#define __IAMDecoderCaps_FWD_DEFINED__ -typedef interface IAMDecoderCaps IAMDecoderCaps; -#endif /* __IAMDecoderCaps_FWD_DEFINED__ */ - - -#ifndef __IAMClockSlave_FWD_DEFINED__ -#define __IAMClockSlave_FWD_DEFINED__ -typedef interface IAMClockSlave IAMClockSlave; -#endif /* __IAMClockSlave_FWD_DEFINED__ */ - - -#ifndef __IDvdControl_FWD_DEFINED__ -#define __IDvdControl_FWD_DEFINED__ -typedef interface IDvdControl IDvdControl; -#endif /* __IDvdControl_FWD_DEFINED__ */ - - -#ifndef __IDvdInfo_FWD_DEFINED__ -#define __IDvdInfo_FWD_DEFINED__ -typedef interface IDvdInfo IDvdInfo; -#endif /* __IDvdInfo_FWD_DEFINED__ */ - - -#ifndef __IDvdCmd_FWD_DEFINED__ -#define __IDvdCmd_FWD_DEFINED__ -typedef interface IDvdCmd IDvdCmd; -#endif /* __IDvdCmd_FWD_DEFINED__ */ - - -#ifndef __IDvdState_FWD_DEFINED__ -#define __IDvdState_FWD_DEFINED__ -typedef interface IDvdState IDvdState; -#endif /* __IDvdState_FWD_DEFINED__ */ - - -#ifndef __IDvdControl2_FWD_DEFINED__ -#define __IDvdControl2_FWD_DEFINED__ -typedef interface IDvdControl2 IDvdControl2; -#endif /* __IDvdControl2_FWD_DEFINED__ */ - - -#ifndef __IDvdInfo2_FWD_DEFINED__ -#define __IDvdInfo2_FWD_DEFINED__ -typedef interface IDvdInfo2 IDvdInfo2; -#endif /* __IDvdInfo2_FWD_DEFINED__ */ - - -#ifndef __IDvdGraphBuilder_FWD_DEFINED__ -#define __IDvdGraphBuilder_FWD_DEFINED__ -typedef interface IDvdGraphBuilder IDvdGraphBuilder; -#endif /* __IDvdGraphBuilder_FWD_DEFINED__ */ - - -#ifndef __IDDrawExclModeVideo_FWD_DEFINED__ -#define __IDDrawExclModeVideo_FWD_DEFINED__ -typedef interface IDDrawExclModeVideo IDDrawExclModeVideo; -#endif /* __IDDrawExclModeVideo_FWD_DEFINED__ */ - - -#ifndef __IDDrawExclModeVideoCallback_FWD_DEFINED__ -#define __IDDrawExclModeVideoCallback_FWD_DEFINED__ -typedef interface IDDrawExclModeVideoCallback IDDrawExclModeVideoCallback; -#endif /* __IDDrawExclModeVideoCallback_FWD_DEFINED__ */ - - -#ifndef __IPinConnection_FWD_DEFINED__ -#define __IPinConnection_FWD_DEFINED__ -typedef interface IPinConnection IPinConnection; -#endif /* __IPinConnection_FWD_DEFINED__ */ - - -#ifndef __IPinFlowControl_FWD_DEFINED__ -#define __IPinFlowControl_FWD_DEFINED__ -typedef interface IPinFlowControl IPinFlowControl; -#endif /* __IPinFlowControl_FWD_DEFINED__ */ - - -#ifndef __IGraphConfig_FWD_DEFINED__ -#define __IGraphConfig_FWD_DEFINED__ -typedef interface IGraphConfig IGraphConfig; -#endif /* __IGraphConfig_FWD_DEFINED__ */ - - -#ifndef __IGraphConfigCallback_FWD_DEFINED__ -#define __IGraphConfigCallback_FWD_DEFINED__ -typedef interface IGraphConfigCallback IGraphConfigCallback; -#endif /* __IGraphConfigCallback_FWD_DEFINED__ */ - - -#ifndef __IFilterChain_FWD_DEFINED__ -#define __IFilterChain_FWD_DEFINED__ -typedef interface IFilterChain IFilterChain; -#endif /* __IFilterChain_FWD_DEFINED__ */ - - -#ifndef __IVMRImagePresenter_FWD_DEFINED__ -#define __IVMRImagePresenter_FWD_DEFINED__ -typedef interface IVMRImagePresenter IVMRImagePresenter; -#endif /* __IVMRImagePresenter_FWD_DEFINED__ */ - - -#ifndef __IVMRSurfaceAllocator_FWD_DEFINED__ -#define __IVMRSurfaceAllocator_FWD_DEFINED__ -typedef interface IVMRSurfaceAllocator IVMRSurfaceAllocator; -#endif /* __IVMRSurfaceAllocator_FWD_DEFINED__ */ - - -#ifndef __IVMRSurfaceAllocatorNotify_FWD_DEFINED__ -#define __IVMRSurfaceAllocatorNotify_FWD_DEFINED__ -typedef interface IVMRSurfaceAllocatorNotify IVMRSurfaceAllocatorNotify; -#endif /* __IVMRSurfaceAllocatorNotify_FWD_DEFINED__ */ - - -#ifndef __IVMRWindowlessControl_FWD_DEFINED__ -#define __IVMRWindowlessControl_FWD_DEFINED__ -typedef interface IVMRWindowlessControl IVMRWindowlessControl; -#endif /* __IVMRWindowlessControl_FWD_DEFINED__ */ - - -#ifndef __IVMRMixerControl_FWD_DEFINED__ -#define __IVMRMixerControl_FWD_DEFINED__ -typedef interface IVMRMixerControl IVMRMixerControl; -#endif /* __IVMRMixerControl_FWD_DEFINED__ */ - - -#ifndef __IVMRMonitorConfig_FWD_DEFINED__ -#define __IVMRMonitorConfig_FWD_DEFINED__ -typedef interface IVMRMonitorConfig IVMRMonitorConfig; -#endif /* __IVMRMonitorConfig_FWD_DEFINED__ */ - - -#ifndef __IVMRFilterConfig_FWD_DEFINED__ -#define __IVMRFilterConfig_FWD_DEFINED__ -typedef interface IVMRFilterConfig IVMRFilterConfig; -#endif /* __IVMRFilterConfig_FWD_DEFINED__ */ - - -#ifndef __IVMRMixerBitmap_FWD_DEFINED__ -#define __IVMRMixerBitmap_FWD_DEFINED__ -typedef interface IVMRMixerBitmap IVMRMixerBitmap; -#endif /* __IVMRMixerBitmap_FWD_DEFINED__ */ - - -#ifndef __IVMRImageCompositor_FWD_DEFINED__ -#define __IVMRImageCompositor_FWD_DEFINED__ -typedef interface IVMRImageCompositor IVMRImageCompositor; -#endif /* __IVMRImageCompositor_FWD_DEFINED__ */ - - -#ifndef __IVMRVideoStreamControl_FWD_DEFINED__ -#define __IVMRVideoStreamControl_FWD_DEFINED__ -typedef interface IVMRVideoStreamControl IVMRVideoStreamControl; -#endif /* __IVMRVideoStreamControl_FWD_DEFINED__ */ - - -#ifndef __IVMRSurface_FWD_DEFINED__ -#define __IVMRSurface_FWD_DEFINED__ -typedef interface IVMRSurface IVMRSurface; -#endif /* __IVMRSurface_FWD_DEFINED__ */ - - -#ifndef __IVMRImagePresenterConfig_FWD_DEFINED__ -#define __IVMRImagePresenterConfig_FWD_DEFINED__ -typedef interface IVMRImagePresenterConfig IVMRImagePresenterConfig; -#endif /* __IVMRImagePresenterConfig_FWD_DEFINED__ */ - - -#ifndef __IVMRImagePresenterExclModeConfig_FWD_DEFINED__ -#define __IVMRImagePresenterExclModeConfig_FWD_DEFINED__ -typedef interface IVMRImagePresenterExclModeConfig IVMRImagePresenterExclModeConfig; -#endif /* __IVMRImagePresenterExclModeConfig_FWD_DEFINED__ */ - - -#ifndef __IVPManager_FWD_DEFINED__ -#define __IVPManager_FWD_DEFINED__ -typedef interface IVPManager IVPManager; -#endif /* __IVPManager_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" -#include "oaidl.h" -#include "ocidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_strmif_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation, 1999-2001. -// -//-------------------------------------------------------------------------- -// Disable /W4 compiler warning C4201: nameless struct/union -#pragma warning(disable:4201) // Disable C4201: nameless struct/union - -#define CDEF_CLASS_DEFAULT 0x0001 -#define CDEF_BYPASS_CLASS_MANAGER 0x0002 -#define CDEF_MERIT_ABOVE_DO_NOT_USE 0x0008 -#define CDEF_DEVMON_CMGR_DEVICE 0x0010 -#define CDEF_DEVMON_DMO 0x0020 -#define CDEF_DEVMON_PNP_DEVICE 0x0040 -#define CDEF_DEVMON_FILTER 0x0080 -#define CDEF_DEVMON_SELECTIVE_MASK 0x00f0 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0000_v0_0_s_ifspec; - -#ifndef __ICreateDevEnum_INTERFACE_DEFINED__ -#define __ICreateDevEnum_INTERFACE_DEFINED__ - -/* interface ICreateDevEnum */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_ICreateDevEnum; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("29840822-5B84-11D0-BD3B-00A0C911CE86") - ICreateDevEnum : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateClassEnumerator( - /* [in] */ REFCLSID clsidDeviceClass, - /* [out] */ IEnumMoniker **ppEnumMoniker, - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICreateDevEnumVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICreateDevEnum * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICreateDevEnum * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICreateDevEnum * This); - - HRESULT ( STDMETHODCALLTYPE *CreateClassEnumerator )( - ICreateDevEnum * This, - /* [in] */ REFCLSID clsidDeviceClass, - /* [out] */ IEnumMoniker **ppEnumMoniker, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } ICreateDevEnumVtbl; - - interface ICreateDevEnum - { - CONST_VTBL struct ICreateDevEnumVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICreateDevEnum_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ICreateDevEnum_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ICreateDevEnum_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ICreateDevEnum_CreateClassEnumerator(This,clsidDeviceClass,ppEnumMoniker,dwFlags) \ - (This)->lpVtbl -> CreateClassEnumerator(This,clsidDeviceClass,ppEnumMoniker,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ICreateDevEnum_CreateClassEnumerator_Proxy( - ICreateDevEnum * This, - /* [in] */ REFCLSID clsidDeviceClass, - /* [out] */ IEnumMoniker **ppEnumMoniker, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB ICreateDevEnum_CreateClassEnumerator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ICreateDevEnum_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0112 */ -/* [local] */ - -#define CHARS_IN_GUID 39 -typedef struct _AMMediaType - { - GUID majortype; - GUID subtype; - BOOL bFixedSizeSamples; - BOOL bTemporalCompression; - ULONG lSampleSize; - GUID formattype; - IUnknown *pUnk; - ULONG cbFormat; - /* [size_is] */ BYTE *pbFormat; - } AM_MEDIA_TYPE; - -typedef -enum _PinDirection - { PINDIR_INPUT = 0, - PINDIR_OUTPUT = PINDIR_INPUT + 1 - } PIN_DIRECTION; - -#define MAX_PIN_NAME 128 -#define MAX_FILTER_NAME 128 -typedef LONGLONG REFERENCE_TIME; - -typedef double REFTIME; - -typedef DWORD_PTR HSEMAPHORE; - -typedef DWORD_PTR HEVENT; - -typedef struct _AllocatorProperties - { - long cBuffers; - long cbBuffer; - long cbAlign; - long cbPrefix; - } ALLOCATOR_PROPERTIES; - - - - - - - - - - - - - - - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0112_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0112_v0_0_s_ifspec; - -#ifndef __IPin_INTERFACE_DEFINED__ -#define __IPin_INTERFACE_DEFINED__ - -/* interface IPin */ -/* [unique][uuid][object] */ - -typedef struct _PinInfo - { - IBaseFilter *pFilter; - PIN_DIRECTION dir; - WCHAR achName[ 128 ]; - } PIN_INFO; - - -EXTERN_C const IID IID_IPin; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86891-0ad4-11ce-b03a-0020af0ba770") - IPin : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Connect( - /* [in] */ IPin *pReceivePin, - /* [in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReceiveConnection( - /* [in] */ IPin *pConnector, - /* [in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Disconnect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectedTo( - /* [out] */ IPin **pPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectionMediaType( - /* [out] */ AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryPinInfo( - /* [out] */ PIN_INFO *pInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryDirection( - /* [out] */ PIN_DIRECTION *pPinDir) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryId( - /* [out] */ LPWSTR *Id) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryAccept( - /* [in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumMediaTypes( - /* [out] */ IEnumMediaTypes **ppEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryInternalConnections( - /* [out] */ IPin **apPin, - /* [out][in] */ ULONG *nPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndOfStream( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE BeginFlush( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndFlush( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE NewSegment( - /* [in] */ REFERENCE_TIME tStart, - /* [in] */ REFERENCE_TIME tStop, - /* [in] */ double dRate) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPinVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPin * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPin * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPin * This); - - HRESULT ( STDMETHODCALLTYPE *Connect )( - IPin * This, - /* [in] */ IPin *pReceivePin, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *ReceiveConnection )( - IPin * This, - /* [in] */ IPin *pConnector, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *Disconnect )( - IPin * This); - - HRESULT ( STDMETHODCALLTYPE *ConnectedTo )( - IPin * This, - /* [out] */ IPin **pPin); - - HRESULT ( STDMETHODCALLTYPE *ConnectionMediaType )( - IPin * This, - /* [out] */ AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *QueryPinInfo )( - IPin * This, - /* [out] */ PIN_INFO *pInfo); - - HRESULT ( STDMETHODCALLTYPE *QueryDirection )( - IPin * This, - /* [out] */ PIN_DIRECTION *pPinDir); - - HRESULT ( STDMETHODCALLTYPE *QueryId )( - IPin * This, - /* [out] */ LPWSTR *Id); - - HRESULT ( STDMETHODCALLTYPE *QueryAccept )( - IPin * This, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *EnumMediaTypes )( - IPin * This, - /* [out] */ IEnumMediaTypes **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *QueryInternalConnections )( - IPin * This, - /* [out] */ IPin **apPin, - /* [out][in] */ ULONG *nPin); - - HRESULT ( STDMETHODCALLTYPE *EndOfStream )( - IPin * This); - - HRESULT ( STDMETHODCALLTYPE *BeginFlush )( - IPin * This); - - HRESULT ( STDMETHODCALLTYPE *EndFlush )( - IPin * This); - - HRESULT ( STDMETHODCALLTYPE *NewSegment )( - IPin * This, - /* [in] */ REFERENCE_TIME tStart, - /* [in] */ REFERENCE_TIME tStop, - /* [in] */ double dRate); - - END_INTERFACE - } IPinVtbl; - - interface IPin - { - CONST_VTBL struct IPinVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPin_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPin_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPin_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPin_Connect(This,pReceivePin,pmt) \ - (This)->lpVtbl -> Connect(This,pReceivePin,pmt) - -#define IPin_ReceiveConnection(This,pConnector,pmt) \ - (This)->lpVtbl -> ReceiveConnection(This,pConnector,pmt) - -#define IPin_Disconnect(This) \ - (This)->lpVtbl -> Disconnect(This) - -#define IPin_ConnectedTo(This,pPin) \ - (This)->lpVtbl -> ConnectedTo(This,pPin) - -#define IPin_ConnectionMediaType(This,pmt) \ - (This)->lpVtbl -> ConnectionMediaType(This,pmt) - -#define IPin_QueryPinInfo(This,pInfo) \ - (This)->lpVtbl -> QueryPinInfo(This,pInfo) - -#define IPin_QueryDirection(This,pPinDir) \ - (This)->lpVtbl -> QueryDirection(This,pPinDir) - -#define IPin_QueryId(This,Id) \ - (This)->lpVtbl -> QueryId(This,Id) - -#define IPin_QueryAccept(This,pmt) \ - (This)->lpVtbl -> QueryAccept(This,pmt) - -#define IPin_EnumMediaTypes(This,ppEnum) \ - (This)->lpVtbl -> EnumMediaTypes(This,ppEnum) - -#define IPin_QueryInternalConnections(This,apPin,nPin) \ - (This)->lpVtbl -> QueryInternalConnections(This,apPin,nPin) - -#define IPin_EndOfStream(This) \ - (This)->lpVtbl -> EndOfStream(This) - -#define IPin_BeginFlush(This) \ - (This)->lpVtbl -> BeginFlush(This) - -#define IPin_EndFlush(This) \ - (This)->lpVtbl -> EndFlush(This) - -#define IPin_NewSegment(This,tStart,tStop,dRate) \ - (This)->lpVtbl -> NewSegment(This,tStart,tStop,dRate) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IPin_Connect_Proxy( - IPin * This, - /* [in] */ IPin *pReceivePin, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IPin_Connect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_ReceiveConnection_Proxy( - IPin * This, - /* [in] */ IPin *pConnector, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IPin_ReceiveConnection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_Disconnect_Proxy( - IPin * This); - - -void __RPC_STUB IPin_Disconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_ConnectedTo_Proxy( - IPin * This, - /* [out] */ IPin **pPin); - - -void __RPC_STUB IPin_ConnectedTo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_ConnectionMediaType_Proxy( - IPin * This, - /* [out] */ AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IPin_ConnectionMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_QueryPinInfo_Proxy( - IPin * This, - /* [out] */ PIN_INFO *pInfo); - - -void __RPC_STUB IPin_QueryPinInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_QueryDirection_Proxy( - IPin * This, - /* [out] */ PIN_DIRECTION *pPinDir); - - -void __RPC_STUB IPin_QueryDirection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_QueryId_Proxy( - IPin * This, - /* [out] */ LPWSTR *Id); - - -void __RPC_STUB IPin_QueryId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_QueryAccept_Proxy( - IPin * This, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IPin_QueryAccept_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_EnumMediaTypes_Proxy( - IPin * This, - /* [out] */ IEnumMediaTypes **ppEnum); - - -void __RPC_STUB IPin_EnumMediaTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_QueryInternalConnections_Proxy( - IPin * This, - /* [out] */ IPin **apPin, - /* [out][in] */ ULONG *nPin); - - -void __RPC_STUB IPin_QueryInternalConnections_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_EndOfStream_Proxy( - IPin * This); - - -void __RPC_STUB IPin_EndOfStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_BeginFlush_Proxy( - IPin * This); - - -void __RPC_STUB IPin_BeginFlush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_EndFlush_Proxy( - IPin * This); - - -void __RPC_STUB IPin_EndFlush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPin_NewSegment_Proxy( - IPin * This, - /* [in] */ REFERENCE_TIME tStart, - /* [in] */ REFERENCE_TIME tStop, - /* [in] */ double dRate); - - -void __RPC_STUB IPin_NewSegment_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPin_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0113 */ -/* [local] */ - -typedef IPin *PPIN; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0113_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0113_v0_0_s_ifspec; - -#ifndef __IEnumPins_INTERFACE_DEFINED__ -#define __IEnumPins_INTERFACE_DEFINED__ - -/* interface IEnumPins */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IEnumPins; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86892-0ad4-11ce-b03a-0020af0ba770") - IEnumPins : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cPins, - /* [size_is][out] */ IPin **ppPins, - /* [out] */ ULONG *pcFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cPins) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumPins **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumPinsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumPins * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumPins * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumPins * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumPins * This, - /* [in] */ ULONG cPins, - /* [size_is][out] */ IPin **ppPins, - /* [out] */ ULONG *pcFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumPins * This, - /* [in] */ ULONG cPins); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumPins * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumPins * This, - /* [out] */ IEnumPins **ppEnum); - - END_INTERFACE - } IEnumPinsVtbl; - - interface IEnumPins - { - CONST_VTBL struct IEnumPinsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumPins_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumPins_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumPins_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumPins_Next(This,cPins,ppPins,pcFetched) \ - (This)->lpVtbl -> Next(This,cPins,ppPins,pcFetched) - -#define IEnumPins_Skip(This,cPins) \ - (This)->lpVtbl -> Skip(This,cPins) - -#define IEnumPins_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumPins_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumPins_Next_Proxy( - IEnumPins * This, - /* [in] */ ULONG cPins, - /* [size_is][out] */ IPin **ppPins, - /* [out] */ ULONG *pcFetched); - - -void __RPC_STUB IEnumPins_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPins_Skip_Proxy( - IEnumPins * This, - /* [in] */ ULONG cPins); - - -void __RPC_STUB IEnumPins_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPins_Reset_Proxy( - IEnumPins * This); - - -void __RPC_STUB IEnumPins_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumPins_Clone_Proxy( - IEnumPins * This, - /* [out] */ IEnumPins **ppEnum); - - -void __RPC_STUB IEnumPins_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumPins_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0114 */ -/* [local] */ - -typedef IEnumPins *PENUMPINS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0114_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0114_v0_0_s_ifspec; - -#ifndef __IEnumMediaTypes_INTERFACE_DEFINED__ -#define __IEnumMediaTypes_INTERFACE_DEFINED__ - -/* interface IEnumMediaTypes */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IEnumMediaTypes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("89c31040-846b-11ce-97d3-00aa0055595a") - IEnumMediaTypes : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cMediaTypes, - /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes, - /* [out] */ ULONG *pcFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cMediaTypes) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumMediaTypes **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumMediaTypesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumMediaTypes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumMediaTypes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumMediaTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumMediaTypes * This, - /* [in] */ ULONG cMediaTypes, - /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes, - /* [out] */ ULONG *pcFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumMediaTypes * This, - /* [in] */ ULONG cMediaTypes); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumMediaTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumMediaTypes * This, - /* [out] */ IEnumMediaTypes **ppEnum); - - END_INTERFACE - } IEnumMediaTypesVtbl; - - interface IEnumMediaTypes - { - CONST_VTBL struct IEnumMediaTypesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumMediaTypes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumMediaTypes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumMediaTypes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumMediaTypes_Next(This,cMediaTypes,ppMediaTypes,pcFetched) \ - (This)->lpVtbl -> Next(This,cMediaTypes,ppMediaTypes,pcFetched) - -#define IEnumMediaTypes_Skip(This,cMediaTypes) \ - (This)->lpVtbl -> Skip(This,cMediaTypes) - -#define IEnumMediaTypes_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumMediaTypes_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumMediaTypes_Next_Proxy( - IEnumMediaTypes * This, - /* [in] */ ULONG cMediaTypes, - /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes, - /* [out] */ ULONG *pcFetched); - - -void __RPC_STUB IEnumMediaTypes_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumMediaTypes_Skip_Proxy( - IEnumMediaTypes * This, - /* [in] */ ULONG cMediaTypes); - - -void __RPC_STUB IEnumMediaTypes_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumMediaTypes_Reset_Proxy( - IEnumMediaTypes * This); - - -void __RPC_STUB IEnumMediaTypes_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumMediaTypes_Clone_Proxy( - IEnumMediaTypes * This, - /* [out] */ IEnumMediaTypes **ppEnum); - - -void __RPC_STUB IEnumMediaTypes_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumMediaTypes_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0115 */ -/* [local] */ - -typedef IEnumMediaTypes *PENUMMEDIATYPES; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0115_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0115_v0_0_s_ifspec; - -#ifndef __IFilterGraph_INTERFACE_DEFINED__ -#define __IFilterGraph_INTERFACE_DEFINED__ - -/* interface IFilterGraph */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFilterGraph; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a8689f-0ad4-11ce-b03a-0020af0ba770") - IFilterGraph : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE AddFilter( - /* [in] */ IBaseFilter *pFilter, - /* [string][in] */ LPCWSTR pName) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveFilter( - /* [in] */ IBaseFilter *pFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumFilters( - /* [out] */ IEnumFilters **ppEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindFilterByName( - /* [string][in] */ LPCWSTR pName, - /* [out] */ IBaseFilter **ppFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectDirect( - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reconnect( - /* [in] */ IPin *ppin) = 0; - - virtual HRESULT STDMETHODCALLTYPE Disconnect( - /* [in] */ IPin *ppin) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultSyncSource( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterGraphVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterGraph * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterGraph * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterGraph * This); - - HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IFilterGraph * This, - /* [in] */ IBaseFilter *pFilter, - /* [string][in] */ LPCWSTR pName); - - HRESULT ( STDMETHODCALLTYPE *RemoveFilter )( - IFilterGraph * This, - /* [in] */ IBaseFilter *pFilter); - - HRESULT ( STDMETHODCALLTYPE *EnumFilters )( - IFilterGraph * This, - /* [out] */ IEnumFilters **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *FindFilterByName )( - IFilterGraph * This, - /* [string][in] */ LPCWSTR pName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *ConnectDirect )( - IFilterGraph * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *Reconnect )( - IFilterGraph * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *Disconnect )( - IFilterGraph * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultSyncSource )( - IFilterGraph * This); - - END_INTERFACE - } IFilterGraphVtbl; - - interface IFilterGraph - { - CONST_VTBL struct IFilterGraphVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterGraph_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterGraph_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterGraph_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterGraph_AddFilter(This,pFilter,pName) \ - (This)->lpVtbl -> AddFilter(This,pFilter,pName) - -#define IFilterGraph_RemoveFilter(This,pFilter) \ - (This)->lpVtbl -> RemoveFilter(This,pFilter) - -#define IFilterGraph_EnumFilters(This,ppEnum) \ - (This)->lpVtbl -> EnumFilters(This,ppEnum) - -#define IFilterGraph_FindFilterByName(This,pName,ppFilter) \ - (This)->lpVtbl -> FindFilterByName(This,pName,ppFilter) - -#define IFilterGraph_ConnectDirect(This,ppinOut,ppinIn,pmt) \ - (This)->lpVtbl -> ConnectDirect(This,ppinOut,ppinIn,pmt) - -#define IFilterGraph_Reconnect(This,ppin) \ - (This)->lpVtbl -> Reconnect(This,ppin) - -#define IFilterGraph_Disconnect(This,ppin) \ - (This)->lpVtbl -> Disconnect(This,ppin) - -#define IFilterGraph_SetDefaultSyncSource(This) \ - (This)->lpVtbl -> SetDefaultSyncSource(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterGraph_AddFilter_Proxy( - IFilterGraph * This, - /* [in] */ IBaseFilter *pFilter, - /* [string][in] */ LPCWSTR pName); - - -void __RPC_STUB IFilterGraph_AddFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_RemoveFilter_Proxy( - IFilterGraph * This, - /* [in] */ IBaseFilter *pFilter); - - -void __RPC_STUB IFilterGraph_RemoveFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_EnumFilters_Proxy( - IFilterGraph * This, - /* [out] */ IEnumFilters **ppEnum); - - -void __RPC_STUB IFilterGraph_EnumFilters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_FindFilterByName_Proxy( - IFilterGraph * This, - /* [string][in] */ LPCWSTR pName, - /* [out] */ IBaseFilter **ppFilter); - - -void __RPC_STUB IFilterGraph_FindFilterByName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_ConnectDirect_Proxy( - IFilterGraph * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFilterGraph_ConnectDirect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_Reconnect_Proxy( - IFilterGraph * This, - /* [in] */ IPin *ppin); - - -void __RPC_STUB IFilterGraph_Reconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_Disconnect_Proxy( - IFilterGraph * This, - /* [in] */ IPin *ppin); - - -void __RPC_STUB IFilterGraph_Disconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph_SetDefaultSyncSource_Proxy( - IFilterGraph * This); - - -void __RPC_STUB IFilterGraph_SetDefaultSyncSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterGraph_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0116 */ -/* [local] */ - -typedef IFilterGraph *PFILTERGRAPH; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0116_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0116_v0_0_s_ifspec; - -#ifndef __IEnumFilters_INTERFACE_DEFINED__ -#define __IEnumFilters_INTERFACE_DEFINED__ - -/* interface IEnumFilters */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IEnumFilters; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86893-0ad4-11ce-b03a-0020af0ba770") - IEnumFilters : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cFilters, - /* [out] */ IBaseFilter **ppFilter, - /* [out] */ ULONG *pcFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cFilters) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumFilters **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumFiltersVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumFilters * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumFilters * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumFilters * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumFilters * This, - /* [in] */ ULONG cFilters, - /* [out] */ IBaseFilter **ppFilter, - /* [out] */ ULONG *pcFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumFilters * This, - /* [in] */ ULONG cFilters); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumFilters * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumFilters * This, - /* [out] */ IEnumFilters **ppEnum); - - END_INTERFACE - } IEnumFiltersVtbl; - - interface IEnumFilters - { - CONST_VTBL struct IEnumFiltersVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumFilters_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumFilters_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumFilters_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumFilters_Next(This,cFilters,ppFilter,pcFetched) \ - (This)->lpVtbl -> Next(This,cFilters,ppFilter,pcFetched) - -#define IEnumFilters_Skip(This,cFilters) \ - (This)->lpVtbl -> Skip(This,cFilters) - -#define IEnumFilters_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumFilters_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumFilters_Next_Proxy( - IEnumFilters * This, - /* [in] */ ULONG cFilters, - /* [out] */ IBaseFilter **ppFilter, - /* [out] */ ULONG *pcFetched); - - -void __RPC_STUB IEnumFilters_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumFilters_Skip_Proxy( - IEnumFilters * This, - /* [in] */ ULONG cFilters); - - -void __RPC_STUB IEnumFilters_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumFilters_Reset_Proxy( - IEnumFilters * This); - - -void __RPC_STUB IEnumFilters_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumFilters_Clone_Proxy( - IEnumFilters * This, - /* [out] */ IEnumFilters **ppEnum); - - -void __RPC_STUB IEnumFilters_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumFilters_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0117 */ -/* [local] */ - -typedef IEnumFilters *PENUMFILTERS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0117_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0117_v0_0_s_ifspec; - -#ifndef __IMediaFilter_INTERFACE_DEFINED__ -#define __IMediaFilter_INTERFACE_DEFINED__ - -/* interface IMediaFilter */ -/* [unique][uuid][object] */ - -typedef -enum _FilterState - { State_Stopped = 0, - State_Paused = State_Stopped + 1, - State_Running = State_Paused + 1 - } FILTER_STATE; - - -EXTERN_C const IID IID_IMediaFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86899-0ad4-11ce-b03a-0020af0ba770") - IMediaFilter : public IPersist - { - public: - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Pause( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Run( - REFERENCE_TIME tStart) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetState( - /* [in] */ DWORD dwMilliSecsTimeout, - /* [out] */ FILTER_STATE *State) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSyncSource( - /* [in] */ IReferenceClock *pClock) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSyncSource( - /* [out] */ IReferenceClock **pClock) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetClassID )( - IMediaFilter * This, - /* [out] */ CLSID *pClassID); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IMediaFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IMediaFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Run )( - IMediaFilter * This, - REFERENCE_TIME tStart); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IMediaFilter * This, - /* [in] */ DWORD dwMilliSecsTimeout, - /* [out] */ FILTER_STATE *State); - - HRESULT ( STDMETHODCALLTYPE *SetSyncSource )( - IMediaFilter * This, - /* [in] */ IReferenceClock *pClock); - - HRESULT ( STDMETHODCALLTYPE *GetSyncSource )( - IMediaFilter * This, - /* [out] */ IReferenceClock **pClock); - - END_INTERFACE - } IMediaFilterVtbl; - - interface IMediaFilter - { - CONST_VTBL struct IMediaFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaFilter_GetClassID(This,pClassID) \ - (This)->lpVtbl -> GetClassID(This,pClassID) - - -#define IMediaFilter_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IMediaFilter_Pause(This) \ - (This)->lpVtbl -> Pause(This) - -#define IMediaFilter_Run(This,tStart) \ - (This)->lpVtbl -> Run(This,tStart) - -#define IMediaFilter_GetState(This,dwMilliSecsTimeout,State) \ - (This)->lpVtbl -> GetState(This,dwMilliSecsTimeout,State) - -#define IMediaFilter_SetSyncSource(This,pClock) \ - (This)->lpVtbl -> SetSyncSource(This,pClock) - -#define IMediaFilter_GetSyncSource(This,pClock) \ - (This)->lpVtbl -> GetSyncSource(This,pClock) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaFilter_Stop_Proxy( - IMediaFilter * This); - - -void __RPC_STUB IMediaFilter_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaFilter_Pause_Proxy( - IMediaFilter * This); - - -void __RPC_STUB IMediaFilter_Pause_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaFilter_Run_Proxy( - IMediaFilter * This, - REFERENCE_TIME tStart); - - -void __RPC_STUB IMediaFilter_Run_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaFilter_GetState_Proxy( - IMediaFilter * This, - /* [in] */ DWORD dwMilliSecsTimeout, - /* [out] */ FILTER_STATE *State); - - -void __RPC_STUB IMediaFilter_GetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaFilter_SetSyncSource_Proxy( - IMediaFilter * This, - /* [in] */ IReferenceClock *pClock); - - -void __RPC_STUB IMediaFilter_SetSyncSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaFilter_GetSyncSource_Proxy( - IMediaFilter * This, - /* [out] */ IReferenceClock **pClock); - - -void __RPC_STUB IMediaFilter_GetSyncSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaFilter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0118 */ -/* [local] */ - -typedef IMediaFilter *PMEDIAFILTER; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0118_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0118_v0_0_s_ifspec; - -#ifndef __IBaseFilter_INTERFACE_DEFINED__ -#define __IBaseFilter_INTERFACE_DEFINED__ - -/* interface IBaseFilter */ -/* [unique][uuid][object] */ - -typedef struct _FilterInfo - { - WCHAR achName[ 128 ]; - IFilterGraph *pGraph; - } FILTER_INFO; - - -EXTERN_C const IID IID_IBaseFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86895-0ad4-11ce-b03a-0020af0ba770") - IBaseFilter : public IMediaFilter - { - public: - virtual HRESULT STDMETHODCALLTYPE EnumPins( - /* [out] */ IEnumPins **ppEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindPin( - /* [string][in] */ LPCWSTR Id, - /* [out] */ IPin **ppPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryFilterInfo( - /* [out] */ FILTER_INFO *pInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE JoinFilterGraph( - /* [in] */ IFilterGraph *pGraph, - /* [string][in] */ LPCWSTR pName) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryVendorInfo( - /* [string][out] */ LPWSTR *pVendorInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBaseFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBaseFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBaseFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBaseFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetClassID )( - IBaseFilter * This, - /* [out] */ CLSID *pClassID); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IBaseFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IBaseFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Run )( - IBaseFilter * This, - REFERENCE_TIME tStart); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IBaseFilter * This, - /* [in] */ DWORD dwMilliSecsTimeout, - /* [out] */ FILTER_STATE *State); - - HRESULT ( STDMETHODCALLTYPE *SetSyncSource )( - IBaseFilter * This, - /* [in] */ IReferenceClock *pClock); - - HRESULT ( STDMETHODCALLTYPE *GetSyncSource )( - IBaseFilter * This, - /* [out] */ IReferenceClock **pClock); - - HRESULT ( STDMETHODCALLTYPE *EnumPins )( - IBaseFilter * This, - /* [out] */ IEnumPins **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *FindPin )( - IBaseFilter * This, - /* [string][in] */ LPCWSTR Id, - /* [out] */ IPin **ppPin); - - HRESULT ( STDMETHODCALLTYPE *QueryFilterInfo )( - IBaseFilter * This, - /* [out] */ FILTER_INFO *pInfo); - - HRESULT ( STDMETHODCALLTYPE *JoinFilterGraph )( - IBaseFilter * This, - /* [in] */ IFilterGraph *pGraph, - /* [string][in] */ LPCWSTR pName); - - HRESULT ( STDMETHODCALLTYPE *QueryVendorInfo )( - IBaseFilter * This, - /* [string][out] */ LPWSTR *pVendorInfo); - - END_INTERFACE - } IBaseFilterVtbl; - - interface IBaseFilter - { - CONST_VTBL struct IBaseFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBaseFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBaseFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBaseFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBaseFilter_GetClassID(This,pClassID) \ - (This)->lpVtbl -> GetClassID(This,pClassID) - - -#define IBaseFilter_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IBaseFilter_Pause(This) \ - (This)->lpVtbl -> Pause(This) - -#define IBaseFilter_Run(This,tStart) \ - (This)->lpVtbl -> Run(This,tStart) - -#define IBaseFilter_GetState(This,dwMilliSecsTimeout,State) \ - (This)->lpVtbl -> GetState(This,dwMilliSecsTimeout,State) - -#define IBaseFilter_SetSyncSource(This,pClock) \ - (This)->lpVtbl -> SetSyncSource(This,pClock) - -#define IBaseFilter_GetSyncSource(This,pClock) \ - (This)->lpVtbl -> GetSyncSource(This,pClock) - - -#define IBaseFilter_EnumPins(This,ppEnum) \ - (This)->lpVtbl -> EnumPins(This,ppEnum) - -#define IBaseFilter_FindPin(This,Id,ppPin) \ - (This)->lpVtbl -> FindPin(This,Id,ppPin) - -#define IBaseFilter_QueryFilterInfo(This,pInfo) \ - (This)->lpVtbl -> QueryFilterInfo(This,pInfo) - -#define IBaseFilter_JoinFilterGraph(This,pGraph,pName) \ - (This)->lpVtbl -> JoinFilterGraph(This,pGraph,pName) - -#define IBaseFilter_QueryVendorInfo(This,pVendorInfo) \ - (This)->lpVtbl -> QueryVendorInfo(This,pVendorInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBaseFilter_EnumPins_Proxy( - IBaseFilter * This, - /* [out] */ IEnumPins **ppEnum); - - -void __RPC_STUB IBaseFilter_EnumPins_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBaseFilter_FindPin_Proxy( - IBaseFilter * This, - /* [string][in] */ LPCWSTR Id, - /* [out] */ IPin **ppPin); - - -void __RPC_STUB IBaseFilter_FindPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBaseFilter_QueryFilterInfo_Proxy( - IBaseFilter * This, - /* [out] */ FILTER_INFO *pInfo); - - -void __RPC_STUB IBaseFilter_QueryFilterInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBaseFilter_JoinFilterGraph_Proxy( - IBaseFilter * This, - /* [in] */ IFilterGraph *pGraph, - /* [string][in] */ LPCWSTR pName); - - -void __RPC_STUB IBaseFilter_JoinFilterGraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBaseFilter_QueryVendorInfo_Proxy( - IBaseFilter * This, - /* [string][out] */ LPWSTR *pVendorInfo); - - -void __RPC_STUB IBaseFilter_QueryVendorInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBaseFilter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0119 */ -/* [local] */ - -typedef IBaseFilter *PFILTER; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0119_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0119_v0_0_s_ifspec; - -#ifndef __IReferenceClock_INTERFACE_DEFINED__ -#define __IReferenceClock_INTERFACE_DEFINED__ - -/* interface IReferenceClock */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IReferenceClock; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a86897-0ad4-11ce-b03a-0020af0ba770") - IReferenceClock : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetTime( - /* [out] */ REFERENCE_TIME *pTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE AdviseTime( - /* [in] */ REFERENCE_TIME baseTime, - /* [in] */ REFERENCE_TIME streamTime, - /* [in] */ HEVENT hEvent, - /* [out] */ DWORD_PTR *pdwAdviseCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE AdvisePeriodic( - /* [in] */ REFERENCE_TIME startTime, - /* [in] */ REFERENCE_TIME periodTime, - /* [in] */ HSEMAPHORE hSemaphore, - /* [out] */ DWORD_PTR *pdwAdviseCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE Unadvise( - /* [in] */ DWORD_PTR dwAdviseCookie) = 0; - - }; - -#else /* C style interface */ - - typedef struct IReferenceClockVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IReferenceClock * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IReferenceClock * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IReferenceClock * This); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IReferenceClock * This, - /* [out] */ REFERENCE_TIME *pTime); - - HRESULT ( STDMETHODCALLTYPE *AdviseTime )( - IReferenceClock * This, - /* [in] */ REFERENCE_TIME baseTime, - /* [in] */ REFERENCE_TIME streamTime, - /* [in] */ HEVENT hEvent, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - HRESULT ( STDMETHODCALLTYPE *AdvisePeriodic )( - IReferenceClock * This, - /* [in] */ REFERENCE_TIME startTime, - /* [in] */ REFERENCE_TIME periodTime, - /* [in] */ HSEMAPHORE hSemaphore, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - HRESULT ( STDMETHODCALLTYPE *Unadvise )( - IReferenceClock * This, - /* [in] */ DWORD_PTR dwAdviseCookie); - - END_INTERFACE - } IReferenceClockVtbl; - - interface IReferenceClock - { - CONST_VTBL struct IReferenceClockVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IReferenceClock_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IReferenceClock_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IReferenceClock_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IReferenceClock_GetTime(This,pTime) \ - (This)->lpVtbl -> GetTime(This,pTime) - -#define IReferenceClock_AdviseTime(This,baseTime,streamTime,hEvent,pdwAdviseCookie) \ - (This)->lpVtbl -> AdviseTime(This,baseTime,streamTime,hEvent,pdwAdviseCookie) - -#define IReferenceClock_AdvisePeriodic(This,startTime,periodTime,hSemaphore,pdwAdviseCookie) \ - (This)->lpVtbl -> AdvisePeriodic(This,startTime,periodTime,hSemaphore,pdwAdviseCookie) - -#define IReferenceClock_Unadvise(This,dwAdviseCookie) \ - (This)->lpVtbl -> Unadvise(This,dwAdviseCookie) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IReferenceClock_GetTime_Proxy( - IReferenceClock * This, - /* [out] */ REFERENCE_TIME *pTime); - - -void __RPC_STUB IReferenceClock_GetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IReferenceClock_AdviseTime_Proxy( - IReferenceClock * This, - /* [in] */ REFERENCE_TIME baseTime, - /* [in] */ REFERENCE_TIME streamTime, - /* [in] */ HEVENT hEvent, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - -void __RPC_STUB IReferenceClock_AdviseTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IReferenceClock_AdvisePeriodic_Proxy( - IReferenceClock * This, - /* [in] */ REFERENCE_TIME startTime, - /* [in] */ REFERENCE_TIME periodTime, - /* [in] */ HSEMAPHORE hSemaphore, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - -void __RPC_STUB IReferenceClock_AdvisePeriodic_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IReferenceClock_Unadvise_Proxy( - IReferenceClock * This, - /* [in] */ DWORD_PTR dwAdviseCookie); - - -void __RPC_STUB IReferenceClock_Unadvise_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IReferenceClock_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0120 */ -/* [local] */ - -typedef IReferenceClock *PREFERENCECLOCK; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0120_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0120_v0_0_s_ifspec; - -#ifndef __IReferenceClock2_INTERFACE_DEFINED__ -#define __IReferenceClock2_INTERFACE_DEFINED__ - -/* interface IReferenceClock2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IReferenceClock2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73885-c2c8-11cf-8b46-00805f6cef60") - IReferenceClock2 : public IReferenceClock - { - public: - }; - -#else /* C style interface */ - - typedef struct IReferenceClock2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IReferenceClock2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IReferenceClock2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IReferenceClock2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IReferenceClock2 * This, - /* [out] */ REFERENCE_TIME *pTime); - - HRESULT ( STDMETHODCALLTYPE *AdviseTime )( - IReferenceClock2 * This, - /* [in] */ REFERENCE_TIME baseTime, - /* [in] */ REFERENCE_TIME streamTime, - /* [in] */ HEVENT hEvent, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - HRESULT ( STDMETHODCALLTYPE *AdvisePeriodic )( - IReferenceClock2 * This, - /* [in] */ REFERENCE_TIME startTime, - /* [in] */ REFERENCE_TIME periodTime, - /* [in] */ HSEMAPHORE hSemaphore, - /* [out] */ DWORD_PTR *pdwAdviseCookie); - - HRESULT ( STDMETHODCALLTYPE *Unadvise )( - IReferenceClock2 * This, - /* [in] */ DWORD_PTR dwAdviseCookie); - - END_INTERFACE - } IReferenceClock2Vtbl; - - interface IReferenceClock2 - { - CONST_VTBL struct IReferenceClock2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IReferenceClock2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IReferenceClock2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IReferenceClock2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IReferenceClock2_GetTime(This,pTime) \ - (This)->lpVtbl -> GetTime(This,pTime) - -#define IReferenceClock2_AdviseTime(This,baseTime,streamTime,hEvent,pdwAdviseCookie) \ - (This)->lpVtbl -> AdviseTime(This,baseTime,streamTime,hEvent,pdwAdviseCookie) - -#define IReferenceClock2_AdvisePeriodic(This,startTime,periodTime,hSemaphore,pdwAdviseCookie) \ - (This)->lpVtbl -> AdvisePeriodic(This,startTime,periodTime,hSemaphore,pdwAdviseCookie) - -#define IReferenceClock2_Unadvise(This,dwAdviseCookie) \ - (This)->lpVtbl -> Unadvise(This,dwAdviseCookie) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IReferenceClock2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0121 */ -/* [local] */ - -typedef IReferenceClock2 *PREFERENCECLOCK2; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0121_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0121_v0_0_s_ifspec; - -#ifndef __IMediaSample_INTERFACE_DEFINED__ -#define __IMediaSample_INTERFACE_DEFINED__ - -/* interface IMediaSample */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IMediaSample; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a8689a-0ad4-11ce-b03a-0020af0ba770") - IMediaSample : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPointer( - /* [out] */ BYTE **ppBuffer) = 0; - - virtual long STDMETHODCALLTYPE GetSize( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTime( - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTime( - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSyncPoint( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSyncPoint( - BOOL bIsSyncPoint) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsPreroll( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPreroll( - BOOL bIsPreroll) = 0; - - virtual long STDMETHODCALLTYPE GetActualDataLength( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetActualDataLength( - long __MIDL_0010) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaType( - AM_MEDIA_TYPE **ppMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - AM_MEDIA_TYPE *pMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsDiscontinuity( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDiscontinuity( - BOOL bDiscontinuity) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMediaTime( - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaTime( - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaSampleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaSample * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaSample * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetPointer )( - IMediaSample * This, - /* [out] */ BYTE **ppBuffer); - - long ( STDMETHODCALLTYPE *GetSize )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IMediaSample * This, - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetTime )( - IMediaSample * This, - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *IsSyncPoint )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetSyncPoint )( - IMediaSample * This, - BOOL bIsSyncPoint); - - HRESULT ( STDMETHODCALLTYPE *IsPreroll )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetPreroll )( - IMediaSample * This, - BOOL bIsPreroll); - - long ( STDMETHODCALLTYPE *GetActualDataLength )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetActualDataLength )( - IMediaSample * This, - long __MIDL_0010); - - HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IMediaSample * This, - AM_MEDIA_TYPE **ppMediaType); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IMediaSample * This, - AM_MEDIA_TYPE *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *IsDiscontinuity )( - IMediaSample * This); - - HRESULT ( STDMETHODCALLTYPE *SetDiscontinuity )( - IMediaSample * This, - BOOL bDiscontinuity); - - HRESULT ( STDMETHODCALLTYPE *GetMediaTime )( - IMediaSample * This, - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetMediaTime )( - IMediaSample * This, - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd); - - END_INTERFACE - } IMediaSampleVtbl; - - interface IMediaSample - { - CONST_VTBL struct IMediaSampleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaSample_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaSample_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaSample_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaSample_GetPointer(This,ppBuffer) \ - (This)->lpVtbl -> GetPointer(This,ppBuffer) - -#define IMediaSample_GetSize(This) \ - (This)->lpVtbl -> GetSize(This) - -#define IMediaSample_GetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample_SetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample_IsSyncPoint(This) \ - (This)->lpVtbl -> IsSyncPoint(This) - -#define IMediaSample_SetSyncPoint(This,bIsSyncPoint) \ - (This)->lpVtbl -> SetSyncPoint(This,bIsSyncPoint) - -#define IMediaSample_IsPreroll(This) \ - (This)->lpVtbl -> IsPreroll(This) - -#define IMediaSample_SetPreroll(This,bIsPreroll) \ - (This)->lpVtbl -> SetPreroll(This,bIsPreroll) - -#define IMediaSample_GetActualDataLength(This) \ - (This)->lpVtbl -> GetActualDataLength(This) - -#define IMediaSample_SetActualDataLength(This,__MIDL_0010) \ - (This)->lpVtbl -> SetActualDataLength(This,__MIDL_0010) - -#define IMediaSample_GetMediaType(This,ppMediaType) \ - (This)->lpVtbl -> GetMediaType(This,ppMediaType) - -#define IMediaSample_SetMediaType(This,pMediaType) \ - (This)->lpVtbl -> SetMediaType(This,pMediaType) - -#define IMediaSample_IsDiscontinuity(This) \ - (This)->lpVtbl -> IsDiscontinuity(This) - -#define IMediaSample_SetDiscontinuity(This,bDiscontinuity) \ - (This)->lpVtbl -> SetDiscontinuity(This,bDiscontinuity) - -#define IMediaSample_GetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetMediaTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample_SetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetMediaTime(This,pTimeStart,pTimeEnd) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaSample_GetPointer_Proxy( - IMediaSample * This, - /* [out] */ BYTE **ppBuffer); - - -void __RPC_STUB IMediaSample_GetPointer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -long STDMETHODCALLTYPE IMediaSample_GetSize_Proxy( - IMediaSample * This); - - -void __RPC_STUB IMediaSample_GetSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_GetTime_Proxy( - IMediaSample * This, - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd); - - -void __RPC_STUB IMediaSample_GetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetTime_Proxy( - IMediaSample * This, - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd); - - -void __RPC_STUB IMediaSample_SetTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_IsSyncPoint_Proxy( - IMediaSample * This); - - -void __RPC_STUB IMediaSample_IsSyncPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetSyncPoint_Proxy( - IMediaSample * This, - BOOL bIsSyncPoint); - - -void __RPC_STUB IMediaSample_SetSyncPoint_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_IsPreroll_Proxy( - IMediaSample * This); - - -void __RPC_STUB IMediaSample_IsPreroll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetPreroll_Proxy( - IMediaSample * This, - BOOL bIsPreroll); - - -void __RPC_STUB IMediaSample_SetPreroll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -long STDMETHODCALLTYPE IMediaSample_GetActualDataLength_Proxy( - IMediaSample * This); - - -void __RPC_STUB IMediaSample_GetActualDataLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetActualDataLength_Proxy( - IMediaSample * This, - long __MIDL_0010); - - -void __RPC_STUB IMediaSample_SetActualDataLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_GetMediaType_Proxy( - IMediaSample * This, - AM_MEDIA_TYPE **ppMediaType); - - -void __RPC_STUB IMediaSample_GetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetMediaType_Proxy( - IMediaSample * This, - AM_MEDIA_TYPE *pMediaType); - - -void __RPC_STUB IMediaSample_SetMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_IsDiscontinuity_Proxy( - IMediaSample * This); - - -void __RPC_STUB IMediaSample_IsDiscontinuity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetDiscontinuity_Proxy( - IMediaSample * This, - BOOL bDiscontinuity); - - -void __RPC_STUB IMediaSample_SetDiscontinuity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_GetMediaTime_Proxy( - IMediaSample * This, - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd); - - -void __RPC_STUB IMediaSample_GetMediaTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample_SetMediaTime_Proxy( - IMediaSample * This, - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd); - - -void __RPC_STUB IMediaSample_SetMediaTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaSample_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0122 */ -/* [local] */ - -typedef IMediaSample *PMEDIASAMPLE; - - -enum tagAM_SAMPLE_PROPERTY_FLAGS - { AM_SAMPLE_SPLICEPOINT = 0x1, - AM_SAMPLE_PREROLL = 0x2, - AM_SAMPLE_DATADISCONTINUITY = 0x4, - AM_SAMPLE_TYPECHANGED = 0x8, - AM_SAMPLE_TIMEVALID = 0x10, - AM_SAMPLE_TIMEDISCONTINUITY = 0x40, - AM_SAMPLE_FLUSH_ON_PAUSE = 0x80, - AM_SAMPLE_STOPVALID = 0x100, - AM_SAMPLE_ENDOFSTREAM = 0x200, - AM_STREAM_MEDIA = 0, - AM_STREAM_CONTROL = 1 - } ; -typedef struct tagAM_SAMPLE2_PROPERTIES - { - DWORD cbData; - DWORD dwTypeSpecificFlags; - DWORD dwSampleFlags; - LONG lActual; - REFERENCE_TIME tStart; - REFERENCE_TIME tStop; - DWORD dwStreamId; - AM_MEDIA_TYPE *pMediaType; - BYTE *pbBuffer; - LONG cbBuffer; - } AM_SAMPLE2_PROPERTIES; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0122_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0122_v0_0_s_ifspec; - -#ifndef __IMediaSample2_INTERFACE_DEFINED__ -#define __IMediaSample2_INTERFACE_DEFINED__ - -/* interface IMediaSample2 */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IMediaSample2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73884-c2c8-11cf-8b46-00805f6cef60") - IMediaSample2 : public IMediaSample - { - public: - virtual HRESULT STDMETHODCALLTYPE GetProperties( - /* [in] */ DWORD cbProperties, - /* [size_is][out] */ BYTE *pbProperties) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetProperties( - /* [in] */ DWORD cbProperties, - /* [size_is][in] */ const BYTE *pbProperties) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaSample2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaSample2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaSample2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetPointer )( - IMediaSample2 * This, - /* [out] */ BYTE **ppBuffer); - - long ( STDMETHODCALLTYPE *GetSize )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTime )( - IMediaSample2 * This, - /* [out] */ REFERENCE_TIME *pTimeStart, - /* [out] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetTime )( - IMediaSample2 * This, - /* [in] */ REFERENCE_TIME *pTimeStart, - /* [in] */ REFERENCE_TIME *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *IsSyncPoint )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetSyncPoint )( - IMediaSample2 * This, - BOOL bIsSyncPoint); - - HRESULT ( STDMETHODCALLTYPE *IsPreroll )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetPreroll )( - IMediaSample2 * This, - BOOL bIsPreroll); - - long ( STDMETHODCALLTYPE *GetActualDataLength )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetActualDataLength )( - IMediaSample2 * This, - long __MIDL_0010); - - HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IMediaSample2 * This, - AM_MEDIA_TYPE **ppMediaType); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IMediaSample2 * This, - AM_MEDIA_TYPE *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *IsDiscontinuity )( - IMediaSample2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetDiscontinuity )( - IMediaSample2 * This, - BOOL bDiscontinuity); - - HRESULT ( STDMETHODCALLTYPE *GetMediaTime )( - IMediaSample2 * This, - /* [out] */ LONGLONG *pTimeStart, - /* [out] */ LONGLONG *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *SetMediaTime )( - IMediaSample2 * This, - /* [in] */ LONGLONG *pTimeStart, - /* [in] */ LONGLONG *pTimeEnd); - - HRESULT ( STDMETHODCALLTYPE *GetProperties )( - IMediaSample2 * This, - /* [in] */ DWORD cbProperties, - /* [size_is][out] */ BYTE *pbProperties); - - HRESULT ( STDMETHODCALLTYPE *SetProperties )( - IMediaSample2 * This, - /* [in] */ DWORD cbProperties, - /* [size_is][in] */ const BYTE *pbProperties); - - END_INTERFACE - } IMediaSample2Vtbl; - - interface IMediaSample2 - { - CONST_VTBL struct IMediaSample2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaSample2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaSample2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaSample2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaSample2_GetPointer(This,ppBuffer) \ - (This)->lpVtbl -> GetPointer(This,ppBuffer) - -#define IMediaSample2_GetSize(This) \ - (This)->lpVtbl -> GetSize(This) - -#define IMediaSample2_GetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample2_SetTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample2_IsSyncPoint(This) \ - (This)->lpVtbl -> IsSyncPoint(This) - -#define IMediaSample2_SetSyncPoint(This,bIsSyncPoint) \ - (This)->lpVtbl -> SetSyncPoint(This,bIsSyncPoint) - -#define IMediaSample2_IsPreroll(This) \ - (This)->lpVtbl -> IsPreroll(This) - -#define IMediaSample2_SetPreroll(This,bIsPreroll) \ - (This)->lpVtbl -> SetPreroll(This,bIsPreroll) - -#define IMediaSample2_GetActualDataLength(This) \ - (This)->lpVtbl -> GetActualDataLength(This) - -#define IMediaSample2_SetActualDataLength(This,__MIDL_0010) \ - (This)->lpVtbl -> SetActualDataLength(This,__MIDL_0010) - -#define IMediaSample2_GetMediaType(This,ppMediaType) \ - (This)->lpVtbl -> GetMediaType(This,ppMediaType) - -#define IMediaSample2_SetMediaType(This,pMediaType) \ - (This)->lpVtbl -> SetMediaType(This,pMediaType) - -#define IMediaSample2_IsDiscontinuity(This) \ - (This)->lpVtbl -> IsDiscontinuity(This) - -#define IMediaSample2_SetDiscontinuity(This,bDiscontinuity) \ - (This)->lpVtbl -> SetDiscontinuity(This,bDiscontinuity) - -#define IMediaSample2_GetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> GetMediaTime(This,pTimeStart,pTimeEnd) - -#define IMediaSample2_SetMediaTime(This,pTimeStart,pTimeEnd) \ - (This)->lpVtbl -> SetMediaTime(This,pTimeStart,pTimeEnd) - - -#define IMediaSample2_GetProperties(This,cbProperties,pbProperties) \ - (This)->lpVtbl -> GetProperties(This,cbProperties,pbProperties) - -#define IMediaSample2_SetProperties(This,cbProperties,pbProperties) \ - (This)->lpVtbl -> SetProperties(This,cbProperties,pbProperties) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaSample2_GetProperties_Proxy( - IMediaSample2 * This, - /* [in] */ DWORD cbProperties, - /* [size_is][out] */ BYTE *pbProperties); - - -void __RPC_STUB IMediaSample2_GetProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSample2_SetProperties_Proxy( - IMediaSample2 * This, - /* [in] */ DWORD cbProperties, - /* [size_is][in] */ const BYTE *pbProperties); - - -void __RPC_STUB IMediaSample2_SetProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaSample2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0123 */ -/* [local] */ - -typedef IMediaSample2 *PMEDIASAMPLE2; - -#define AM_GBF_PREVFRAMESKIPPED 1 -#define AM_GBF_NOTASYNCPOINT 2 -#define AM_GBF_NOWAIT 4 -#define AM_GBF_NODDSURFACELOCK 8 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0123_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0123_v0_0_s_ifspec; - -#ifndef __IMemAllocator_INTERFACE_DEFINED__ -#define __IMemAllocator_INTERFACE_DEFINED__ - -/* interface IMemAllocator */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMemAllocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a8689c-0ad4-11ce-b03a-0020af0ba770") - IMemAllocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetProperties( - /* [in] */ ALLOCATOR_PROPERTIES *pRequest, - /* [out] */ ALLOCATOR_PROPERTIES *pActual) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProperties( - /* [out] */ ALLOCATOR_PROPERTIES *pProps) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Decommit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBuffer( - /* [out] */ IMediaSample **ppBuffer, - /* [in] */ REFERENCE_TIME *pStartTime, - /* [in] */ REFERENCE_TIME *pEndTime, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReleaseBuffer( - /* [in] */ IMediaSample *pBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMemAllocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMemAllocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMemAllocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMemAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *SetProperties )( - IMemAllocator * This, - /* [in] */ ALLOCATOR_PROPERTIES *pRequest, - /* [out] */ ALLOCATOR_PROPERTIES *pActual); - - HRESULT ( STDMETHODCALLTYPE *GetProperties )( - IMemAllocator * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - IMemAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *Decommit )( - IMemAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetBuffer )( - IMemAllocator * This, - /* [out] */ IMediaSample **ppBuffer, - /* [in] */ REFERENCE_TIME *pStartTime, - /* [in] */ REFERENCE_TIME *pEndTime, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *ReleaseBuffer )( - IMemAllocator * This, - /* [in] */ IMediaSample *pBuffer); - - END_INTERFACE - } IMemAllocatorVtbl; - - interface IMemAllocator - { - CONST_VTBL struct IMemAllocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMemAllocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMemAllocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMemAllocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMemAllocator_SetProperties(This,pRequest,pActual) \ - (This)->lpVtbl -> SetProperties(This,pRequest,pActual) - -#define IMemAllocator_GetProperties(This,pProps) \ - (This)->lpVtbl -> GetProperties(This,pProps) - -#define IMemAllocator_Commit(This) \ - (This)->lpVtbl -> Commit(This) - -#define IMemAllocator_Decommit(This) \ - (This)->lpVtbl -> Decommit(This) - -#define IMemAllocator_GetBuffer(This,ppBuffer,pStartTime,pEndTime,dwFlags) \ - (This)->lpVtbl -> GetBuffer(This,ppBuffer,pStartTime,pEndTime,dwFlags) - -#define IMemAllocator_ReleaseBuffer(This,pBuffer) \ - (This)->lpVtbl -> ReleaseBuffer(This,pBuffer) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMemAllocator_SetProperties_Proxy( - IMemAllocator * This, - /* [in] */ ALLOCATOR_PROPERTIES *pRequest, - /* [out] */ ALLOCATOR_PROPERTIES *pActual); - - -void __RPC_STUB IMemAllocator_SetProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocator_GetProperties_Proxy( - IMemAllocator * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - -void __RPC_STUB IMemAllocator_GetProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocator_Commit_Proxy( - IMemAllocator * This); - - -void __RPC_STUB IMemAllocator_Commit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocator_Decommit_Proxy( - IMemAllocator * This); - - -void __RPC_STUB IMemAllocator_Decommit_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocator_GetBuffer_Proxy( - IMemAllocator * This, - /* [out] */ IMediaSample **ppBuffer, - /* [in] */ REFERENCE_TIME *pStartTime, - /* [in] */ REFERENCE_TIME *pEndTime, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IMemAllocator_GetBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocator_ReleaseBuffer_Proxy( - IMemAllocator * This, - /* [in] */ IMediaSample *pBuffer); - - -void __RPC_STUB IMemAllocator_ReleaseBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMemAllocator_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0124 */ -/* [local] */ - -typedef IMemAllocator *PMEMALLOCATOR; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0124_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0124_v0_0_s_ifspec; - -#ifndef __IMemAllocatorCallbackTemp_INTERFACE_DEFINED__ -#define __IMemAllocatorCallbackTemp_INTERFACE_DEFINED__ - -/* interface IMemAllocatorCallbackTemp */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMemAllocatorCallbackTemp; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("379a0cf0-c1de-11d2-abf5-00a0c905f375") - IMemAllocatorCallbackTemp : public IMemAllocator - { - public: - virtual HRESULT STDMETHODCALLTYPE SetNotify( - /* [in] */ IMemAllocatorNotifyCallbackTemp *pNotify) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFreeCount( - /* [out] */ LONG *plBuffersFree) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMemAllocatorCallbackTempVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMemAllocatorCallbackTemp * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMemAllocatorCallbackTemp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMemAllocatorCallbackTemp * This); - - HRESULT ( STDMETHODCALLTYPE *SetProperties )( - IMemAllocatorCallbackTemp * This, - /* [in] */ ALLOCATOR_PROPERTIES *pRequest, - /* [out] */ ALLOCATOR_PROPERTIES *pActual); - - HRESULT ( STDMETHODCALLTYPE *GetProperties )( - IMemAllocatorCallbackTemp * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - IMemAllocatorCallbackTemp * This); - - HRESULT ( STDMETHODCALLTYPE *Decommit )( - IMemAllocatorCallbackTemp * This); - - HRESULT ( STDMETHODCALLTYPE *GetBuffer )( - IMemAllocatorCallbackTemp * This, - /* [out] */ IMediaSample **ppBuffer, - /* [in] */ REFERENCE_TIME *pStartTime, - /* [in] */ REFERENCE_TIME *pEndTime, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *ReleaseBuffer )( - IMemAllocatorCallbackTemp * This, - /* [in] */ IMediaSample *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *SetNotify )( - IMemAllocatorCallbackTemp * This, - /* [in] */ IMemAllocatorNotifyCallbackTemp *pNotify); - - HRESULT ( STDMETHODCALLTYPE *GetFreeCount )( - IMemAllocatorCallbackTemp * This, - /* [out] */ LONG *plBuffersFree); - - END_INTERFACE - } IMemAllocatorCallbackTempVtbl; - - interface IMemAllocatorCallbackTemp - { - CONST_VTBL struct IMemAllocatorCallbackTempVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMemAllocatorCallbackTemp_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMemAllocatorCallbackTemp_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMemAllocatorCallbackTemp_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMemAllocatorCallbackTemp_SetProperties(This,pRequest,pActual) \ - (This)->lpVtbl -> SetProperties(This,pRequest,pActual) - -#define IMemAllocatorCallbackTemp_GetProperties(This,pProps) \ - (This)->lpVtbl -> GetProperties(This,pProps) - -#define IMemAllocatorCallbackTemp_Commit(This) \ - (This)->lpVtbl -> Commit(This) - -#define IMemAllocatorCallbackTemp_Decommit(This) \ - (This)->lpVtbl -> Decommit(This) - -#define IMemAllocatorCallbackTemp_GetBuffer(This,ppBuffer,pStartTime,pEndTime,dwFlags) \ - (This)->lpVtbl -> GetBuffer(This,ppBuffer,pStartTime,pEndTime,dwFlags) - -#define IMemAllocatorCallbackTemp_ReleaseBuffer(This,pBuffer) \ - (This)->lpVtbl -> ReleaseBuffer(This,pBuffer) - - -#define IMemAllocatorCallbackTemp_SetNotify(This,pNotify) \ - (This)->lpVtbl -> SetNotify(This,pNotify) - -#define IMemAllocatorCallbackTemp_GetFreeCount(This,plBuffersFree) \ - (This)->lpVtbl -> GetFreeCount(This,plBuffersFree) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMemAllocatorCallbackTemp_SetNotify_Proxy( - IMemAllocatorCallbackTemp * This, - /* [in] */ IMemAllocatorNotifyCallbackTemp *pNotify); - - -void __RPC_STUB IMemAllocatorCallbackTemp_SetNotify_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemAllocatorCallbackTemp_GetFreeCount_Proxy( - IMemAllocatorCallbackTemp * This, - /* [out] */ LONG *plBuffersFree); - - -void __RPC_STUB IMemAllocatorCallbackTemp_GetFreeCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMemAllocatorCallbackTemp_INTERFACE_DEFINED__ */ - - -#ifndef __IMemAllocatorNotifyCallbackTemp_INTERFACE_DEFINED__ -#define __IMemAllocatorNotifyCallbackTemp_INTERFACE_DEFINED__ - -/* interface IMemAllocatorNotifyCallbackTemp */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMemAllocatorNotifyCallbackTemp; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("92980b30-c1de-11d2-abf5-00a0c905f375") - IMemAllocatorNotifyCallbackTemp : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE NotifyRelease( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMemAllocatorNotifyCallbackTempVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMemAllocatorNotifyCallbackTemp * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMemAllocatorNotifyCallbackTemp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMemAllocatorNotifyCallbackTemp * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyRelease )( - IMemAllocatorNotifyCallbackTemp * This); - - END_INTERFACE - } IMemAllocatorNotifyCallbackTempVtbl; - - interface IMemAllocatorNotifyCallbackTemp - { - CONST_VTBL struct IMemAllocatorNotifyCallbackTempVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMemAllocatorNotifyCallbackTemp_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMemAllocatorNotifyCallbackTemp_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMemAllocatorNotifyCallbackTemp_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMemAllocatorNotifyCallbackTemp_NotifyRelease(This) \ - (This)->lpVtbl -> NotifyRelease(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMemAllocatorNotifyCallbackTemp_NotifyRelease_Proxy( - IMemAllocatorNotifyCallbackTemp * This); - - -void __RPC_STUB IMemAllocatorNotifyCallbackTemp_NotifyRelease_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMemAllocatorNotifyCallbackTemp_INTERFACE_DEFINED__ */ - - -#ifndef __IMemInputPin_INTERFACE_DEFINED__ -#define __IMemInputPin_INTERFACE_DEFINED__ - -/* interface IMemInputPin */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMemInputPin; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a8689d-0ad4-11ce-b03a-0020af0ba770") - IMemInputPin : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetAllocator( - /* [out] */ IMemAllocator **ppAllocator) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyAllocator( - /* [in] */ IMemAllocator *pAllocator, - /* [in] */ BOOL bReadOnly) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllocatorRequirements( - /* [out] */ ALLOCATOR_PROPERTIES *pProps) = 0; - - virtual HRESULT STDMETHODCALLTYPE Receive( - /* [in] */ IMediaSample *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReceiveMultiple( - /* [size_is][in] */ IMediaSample **pSamples, - /* [in] */ long nSamples, - /* [out] */ long *nSamplesProcessed) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReceiveCanBlock( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMemInputPinVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMemInputPin * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMemInputPin * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMemInputPin * This); - - HRESULT ( STDMETHODCALLTYPE *GetAllocator )( - IMemInputPin * This, - /* [out] */ IMemAllocator **ppAllocator); - - HRESULT ( STDMETHODCALLTYPE *NotifyAllocator )( - IMemInputPin * This, - /* [in] */ IMemAllocator *pAllocator, - /* [in] */ BOOL bReadOnly); - - HRESULT ( STDMETHODCALLTYPE *GetAllocatorRequirements )( - IMemInputPin * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - HRESULT ( STDMETHODCALLTYPE *Receive )( - IMemInputPin * This, - /* [in] */ IMediaSample *pSample); - - HRESULT ( STDMETHODCALLTYPE *ReceiveMultiple )( - IMemInputPin * This, - /* [size_is][in] */ IMediaSample **pSamples, - /* [in] */ long nSamples, - /* [out] */ long *nSamplesProcessed); - - HRESULT ( STDMETHODCALLTYPE *ReceiveCanBlock )( - IMemInputPin * This); - - END_INTERFACE - } IMemInputPinVtbl; - - interface IMemInputPin - { - CONST_VTBL struct IMemInputPinVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMemInputPin_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMemInputPin_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMemInputPin_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMemInputPin_GetAllocator(This,ppAllocator) \ - (This)->lpVtbl -> GetAllocator(This,ppAllocator) - -#define IMemInputPin_NotifyAllocator(This,pAllocator,bReadOnly) \ - (This)->lpVtbl -> NotifyAllocator(This,pAllocator,bReadOnly) - -#define IMemInputPin_GetAllocatorRequirements(This,pProps) \ - (This)->lpVtbl -> GetAllocatorRequirements(This,pProps) - -#define IMemInputPin_Receive(This,pSample) \ - (This)->lpVtbl -> Receive(This,pSample) - -#define IMemInputPin_ReceiveMultiple(This,pSamples,nSamples,nSamplesProcessed) \ - (This)->lpVtbl -> ReceiveMultiple(This,pSamples,nSamples,nSamplesProcessed) - -#define IMemInputPin_ReceiveCanBlock(This) \ - (This)->lpVtbl -> ReceiveCanBlock(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMemInputPin_GetAllocator_Proxy( - IMemInputPin * This, - /* [out] */ IMemAllocator **ppAllocator); - - -void __RPC_STUB IMemInputPin_GetAllocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemInputPin_NotifyAllocator_Proxy( - IMemInputPin * This, - /* [in] */ IMemAllocator *pAllocator, - /* [in] */ BOOL bReadOnly); - - -void __RPC_STUB IMemInputPin_NotifyAllocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemInputPin_GetAllocatorRequirements_Proxy( - IMemInputPin * This, - /* [out] */ ALLOCATOR_PROPERTIES *pProps); - - -void __RPC_STUB IMemInputPin_GetAllocatorRequirements_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemInputPin_Receive_Proxy( - IMemInputPin * This, - /* [in] */ IMediaSample *pSample); - - -void __RPC_STUB IMemInputPin_Receive_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemInputPin_ReceiveMultiple_Proxy( - IMemInputPin * This, - /* [size_is][in] */ IMediaSample **pSamples, - /* [in] */ long nSamples, - /* [out] */ long *nSamplesProcessed); - - -void __RPC_STUB IMemInputPin_ReceiveMultiple_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMemInputPin_ReceiveCanBlock_Proxy( - IMemInputPin * This); - - -void __RPC_STUB IMemInputPin_ReceiveCanBlock_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMemInputPin_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0127 */ -/* [local] */ - -typedef IMemInputPin *PMEMINPUTPIN; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0127_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0127_v0_0_s_ifspec; - -#ifndef __IAMovieSetup_INTERFACE_DEFINED__ -#define __IAMovieSetup_INTERFACE_DEFINED__ - -/* interface IAMovieSetup */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMovieSetup; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a3d8cec0-7e5a-11cf-bbc5-00805f6cef20") - IAMovieSetup : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Register( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Unregister( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMovieSetupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMovieSetup * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMovieSetup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMovieSetup * This); - - HRESULT ( STDMETHODCALLTYPE *Register )( - IAMovieSetup * This); - - HRESULT ( STDMETHODCALLTYPE *Unregister )( - IAMovieSetup * This); - - END_INTERFACE - } IAMovieSetupVtbl; - - interface IAMovieSetup - { - CONST_VTBL struct IAMovieSetupVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMovieSetup_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMovieSetup_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMovieSetup_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMovieSetup_Register(This) \ - (This)->lpVtbl -> Register(This) - -#define IAMovieSetup_Unregister(This) \ - (This)->lpVtbl -> Unregister(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMovieSetup_Register_Proxy( - IAMovieSetup * This); - - -void __RPC_STUB IAMovieSetup_Register_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMovieSetup_Unregister_Proxy( - IAMovieSetup * This); - - -void __RPC_STUB IAMovieSetup_Unregister_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMovieSetup_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0128 */ -/* [local] */ - -typedef IAMovieSetup *PAMOVIESETUP; - -typedef -enum AM_SEEKING_SeekingFlags - { AM_SEEKING_NoPositioning = 0, - AM_SEEKING_AbsolutePositioning = 0x1, - AM_SEEKING_RelativePositioning = 0x2, - AM_SEEKING_IncrementalPositioning = 0x3, - AM_SEEKING_PositioningBitsMask = 0x3, - AM_SEEKING_SeekToKeyFrame = 0x4, - AM_SEEKING_ReturnTime = 0x8, - AM_SEEKING_Segment = 0x10, - AM_SEEKING_NoFlush = 0x20 - } AM_SEEKING_SEEKING_FLAGS; - -typedef -enum AM_SEEKING_SeekingCapabilities - { AM_SEEKING_CanSeekAbsolute = 0x1, - AM_SEEKING_CanSeekForwards = 0x2, - AM_SEEKING_CanSeekBackwards = 0x4, - AM_SEEKING_CanGetCurrentPos = 0x8, - AM_SEEKING_CanGetStopPos = 0x10, - AM_SEEKING_CanGetDuration = 0x20, - AM_SEEKING_CanPlayBackwards = 0x40, - AM_SEEKING_CanDoSegments = 0x80, - AM_SEEKING_Source = 0x100 - } AM_SEEKING_SEEKING_CAPABILITIES; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0128_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0128_v0_0_s_ifspec; - -#ifndef __IMediaSeeking_INTERFACE_DEFINED__ -#define __IMediaSeeking_INTERFACE_DEFINED__ - -/* interface IMediaSeeking */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMediaSeeking; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73880-c2c8-11cf-8b46-00805f6cef60") - IMediaSeeking : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCapabilities( - /* [out] */ DWORD *pCapabilities) = 0; - - virtual HRESULT STDMETHODCALLTYPE CheckCapabilities( - /* [out][in] */ DWORD *pCapabilities) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsFormatSupported( - /* [in] */ const GUID *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryPreferredFormat( - /* [out] */ GUID *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimeFormat( - /* [out] */ GUID *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsUsingTimeFormat( - /* [in] */ const GUID *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTimeFormat( - /* [in] */ const GUID *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDuration( - /* [out] */ LONGLONG *pDuration) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStopPosition( - /* [out] */ LONGLONG *pStop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentPosition( - /* [out] */ LONGLONG *pCurrent) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConvertTimeFormat( - /* [out] */ LONGLONG *pTarget, - /* [in] */ const GUID *pTargetFormat, - /* [in] */ LONGLONG Source, - /* [in] */ const GUID *pSourceFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPositions( - /* [out][in] */ LONGLONG *pCurrent, - /* [in] */ DWORD dwCurrentFlags, - /* [out][in] */ LONGLONG *pStop, - /* [in] */ DWORD dwStopFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPositions( - /* [out] */ LONGLONG *pCurrent, - /* [out] */ LONGLONG *pStop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAvailable( - /* [out] */ LONGLONG *pEarliest, - /* [out] */ LONGLONG *pLatest) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRate( - /* [in] */ double dRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRate( - /* [out] */ double *pdRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPreroll( - /* [out] */ LONGLONG *pllPreroll) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaSeekingVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaSeeking * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaSeeking * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaSeeking * This); - - HRESULT ( STDMETHODCALLTYPE *GetCapabilities )( - IMediaSeeking * This, - /* [out] */ DWORD *pCapabilities); - - HRESULT ( STDMETHODCALLTYPE *CheckCapabilities )( - IMediaSeeking * This, - /* [out][in] */ DWORD *pCapabilities); - - HRESULT ( STDMETHODCALLTYPE *IsFormatSupported )( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - HRESULT ( STDMETHODCALLTYPE *QueryPreferredFormat )( - IMediaSeeking * This, - /* [out] */ GUID *pFormat); - - HRESULT ( STDMETHODCALLTYPE *GetTimeFormat )( - IMediaSeeking * This, - /* [out] */ GUID *pFormat); - - HRESULT ( STDMETHODCALLTYPE *IsUsingTimeFormat )( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - HRESULT ( STDMETHODCALLTYPE *SetTimeFormat )( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pDuration); - - HRESULT ( STDMETHODCALLTYPE *GetStopPosition )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pStop); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentPosition )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pCurrent); - - HRESULT ( STDMETHODCALLTYPE *ConvertTimeFormat )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pTarget, - /* [in] */ const GUID *pTargetFormat, - /* [in] */ LONGLONG Source, - /* [in] */ const GUID *pSourceFormat); - - HRESULT ( STDMETHODCALLTYPE *SetPositions )( - IMediaSeeking * This, - /* [out][in] */ LONGLONG *pCurrent, - /* [in] */ DWORD dwCurrentFlags, - /* [out][in] */ LONGLONG *pStop, - /* [in] */ DWORD dwStopFlags); - - HRESULT ( STDMETHODCALLTYPE *GetPositions )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pCurrent, - /* [out] */ LONGLONG *pStop); - - HRESULT ( STDMETHODCALLTYPE *GetAvailable )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pEarliest, - /* [out] */ LONGLONG *pLatest); - - HRESULT ( STDMETHODCALLTYPE *SetRate )( - IMediaSeeking * This, - /* [in] */ double dRate); - - HRESULT ( STDMETHODCALLTYPE *GetRate )( - IMediaSeeking * This, - /* [out] */ double *pdRate); - - HRESULT ( STDMETHODCALLTYPE *GetPreroll )( - IMediaSeeking * This, - /* [out] */ LONGLONG *pllPreroll); - - END_INTERFACE - } IMediaSeekingVtbl; - - interface IMediaSeeking - { - CONST_VTBL struct IMediaSeekingVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaSeeking_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaSeeking_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaSeeking_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaSeeking_GetCapabilities(This,pCapabilities) \ - (This)->lpVtbl -> GetCapabilities(This,pCapabilities) - -#define IMediaSeeking_CheckCapabilities(This,pCapabilities) \ - (This)->lpVtbl -> CheckCapabilities(This,pCapabilities) - -#define IMediaSeeking_IsFormatSupported(This,pFormat) \ - (This)->lpVtbl -> IsFormatSupported(This,pFormat) - -#define IMediaSeeking_QueryPreferredFormat(This,pFormat) \ - (This)->lpVtbl -> QueryPreferredFormat(This,pFormat) - -#define IMediaSeeking_GetTimeFormat(This,pFormat) \ - (This)->lpVtbl -> GetTimeFormat(This,pFormat) - -#define IMediaSeeking_IsUsingTimeFormat(This,pFormat) \ - (This)->lpVtbl -> IsUsingTimeFormat(This,pFormat) - -#define IMediaSeeking_SetTimeFormat(This,pFormat) \ - (This)->lpVtbl -> SetTimeFormat(This,pFormat) - -#define IMediaSeeking_GetDuration(This,pDuration) \ - (This)->lpVtbl -> GetDuration(This,pDuration) - -#define IMediaSeeking_GetStopPosition(This,pStop) \ - (This)->lpVtbl -> GetStopPosition(This,pStop) - -#define IMediaSeeking_GetCurrentPosition(This,pCurrent) \ - (This)->lpVtbl -> GetCurrentPosition(This,pCurrent) - -#define IMediaSeeking_ConvertTimeFormat(This,pTarget,pTargetFormat,Source,pSourceFormat) \ - (This)->lpVtbl -> ConvertTimeFormat(This,pTarget,pTargetFormat,Source,pSourceFormat) - -#define IMediaSeeking_SetPositions(This,pCurrent,dwCurrentFlags,pStop,dwStopFlags) \ - (This)->lpVtbl -> SetPositions(This,pCurrent,dwCurrentFlags,pStop,dwStopFlags) - -#define IMediaSeeking_GetPositions(This,pCurrent,pStop) \ - (This)->lpVtbl -> GetPositions(This,pCurrent,pStop) - -#define IMediaSeeking_GetAvailable(This,pEarliest,pLatest) \ - (This)->lpVtbl -> GetAvailable(This,pEarliest,pLatest) - -#define IMediaSeeking_SetRate(This,dRate) \ - (This)->lpVtbl -> SetRate(This,dRate) - -#define IMediaSeeking_GetRate(This,pdRate) \ - (This)->lpVtbl -> GetRate(This,pdRate) - -#define IMediaSeeking_GetPreroll(This,pllPreroll) \ - (This)->lpVtbl -> GetPreroll(This,pllPreroll) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetCapabilities_Proxy( - IMediaSeeking * This, - /* [out] */ DWORD *pCapabilities); - - -void __RPC_STUB IMediaSeeking_GetCapabilities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_CheckCapabilities_Proxy( - IMediaSeeking * This, - /* [out][in] */ DWORD *pCapabilities); - - -void __RPC_STUB IMediaSeeking_CheckCapabilities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_IsFormatSupported_Proxy( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - -void __RPC_STUB IMediaSeeking_IsFormatSupported_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_QueryPreferredFormat_Proxy( - IMediaSeeking * This, - /* [out] */ GUID *pFormat); - - -void __RPC_STUB IMediaSeeking_QueryPreferredFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetTimeFormat_Proxy( - IMediaSeeking * This, - /* [out] */ GUID *pFormat); - - -void __RPC_STUB IMediaSeeking_GetTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_IsUsingTimeFormat_Proxy( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - -void __RPC_STUB IMediaSeeking_IsUsingTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_SetTimeFormat_Proxy( - IMediaSeeking * This, - /* [in] */ const GUID *pFormat); - - -void __RPC_STUB IMediaSeeking_SetTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetDuration_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pDuration); - - -void __RPC_STUB IMediaSeeking_GetDuration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetStopPosition_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pStop); - - -void __RPC_STUB IMediaSeeking_GetStopPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetCurrentPosition_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pCurrent); - - -void __RPC_STUB IMediaSeeking_GetCurrentPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_ConvertTimeFormat_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pTarget, - /* [in] */ const GUID *pTargetFormat, - /* [in] */ LONGLONG Source, - /* [in] */ const GUID *pSourceFormat); - - -void __RPC_STUB IMediaSeeking_ConvertTimeFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_SetPositions_Proxy( - IMediaSeeking * This, - /* [out][in] */ LONGLONG *pCurrent, - /* [in] */ DWORD dwCurrentFlags, - /* [out][in] */ LONGLONG *pStop, - /* [in] */ DWORD dwStopFlags); - - -void __RPC_STUB IMediaSeeking_SetPositions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetPositions_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pCurrent, - /* [out] */ LONGLONG *pStop); - - -void __RPC_STUB IMediaSeeking_GetPositions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetAvailable_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pEarliest, - /* [out] */ LONGLONG *pLatest); - - -void __RPC_STUB IMediaSeeking_GetAvailable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_SetRate_Proxy( - IMediaSeeking * This, - /* [in] */ double dRate); - - -void __RPC_STUB IMediaSeeking_SetRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetRate_Proxy( - IMediaSeeking * This, - /* [out] */ double *pdRate); - - -void __RPC_STUB IMediaSeeking_GetRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMediaSeeking_GetPreroll_Proxy( - IMediaSeeking * This, - /* [out] */ LONGLONG *pllPreroll); - - -void __RPC_STUB IMediaSeeking_GetPreroll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaSeeking_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0129 */ -/* [local] */ - -typedef IMediaSeeking *PMEDIASEEKING; - -enum tagAM_MEDIAEVENT_FLAGS -{ - AM_MEDIAEVENT_NONOTIFY = 0x01 -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -typedef /* [public][public] */ struct __MIDL___MIDL_itf_strmif_0129_0001 - { - CLSID Clsid; - LPWSTR Name; - } REGFILTER; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0129_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0129_v0_0_s_ifspec; - -#ifndef __IEnumRegFilters_INTERFACE_DEFINED__ -#define __IEnumRegFilters_INTERFACE_DEFINED__ - -/* interface IEnumRegFilters */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IEnumRegFilters; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a4-0ad4-11ce-b03a-0020af0ba770") - IEnumRegFilters : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cFilters, - /* [out] */ REGFILTER **apRegFilter, - /* [out] */ ULONG *pcFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cFilters) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumRegFilters **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumRegFiltersVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumRegFilters * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumRegFilters * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumRegFilters * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumRegFilters * This, - /* [in] */ ULONG cFilters, - /* [out] */ REGFILTER **apRegFilter, - /* [out] */ ULONG *pcFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumRegFilters * This, - /* [in] */ ULONG cFilters); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumRegFilters * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumRegFilters * This, - /* [out] */ IEnumRegFilters **ppEnum); - - END_INTERFACE - } IEnumRegFiltersVtbl; - - interface IEnumRegFilters - { - CONST_VTBL struct IEnumRegFiltersVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumRegFilters_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumRegFilters_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumRegFilters_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumRegFilters_Next(This,cFilters,apRegFilter,pcFetched) \ - (This)->lpVtbl -> Next(This,cFilters,apRegFilter,pcFetched) - -#define IEnumRegFilters_Skip(This,cFilters) \ - (This)->lpVtbl -> Skip(This,cFilters) - -#define IEnumRegFilters_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumRegFilters_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumRegFilters_Next_Proxy( - IEnumRegFilters * This, - /* [in] */ ULONG cFilters, - /* [out] */ REGFILTER **apRegFilter, - /* [out] */ ULONG *pcFetched); - - -void __RPC_STUB IEnumRegFilters_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumRegFilters_Skip_Proxy( - IEnumRegFilters * This, - /* [in] */ ULONG cFilters); - - -void __RPC_STUB IEnumRegFilters_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumRegFilters_Reset_Proxy( - IEnumRegFilters * This); - - -void __RPC_STUB IEnumRegFilters_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumRegFilters_Clone_Proxy( - IEnumRegFilters * This, - /* [out] */ IEnumRegFilters **ppEnum); - - -void __RPC_STUB IEnumRegFilters_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumRegFilters_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0131 */ -/* [local] */ - -typedef IEnumRegFilters *PENUMREGFILTERS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0131_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0131_v0_0_s_ifspec; - -#ifndef __IFilterMapper_INTERFACE_DEFINED__ -#define __IFilterMapper_INTERFACE_DEFINED__ - -/* interface IFilterMapper */ -/* [unique][uuid][object] */ - - -enum __MIDL_IFilterMapper_0001 - { MERIT_PREFERRED = 0x800000, - MERIT_NORMAL = 0x600000, - MERIT_UNLIKELY = 0x400000, - MERIT_DO_NOT_USE = 0x200000, - MERIT_SW_COMPRESSOR = 0x100000, - MERIT_HW_COMPRESSOR = 0x100050 - } ; - -EXTERN_C const IID IID_IFilterMapper; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a3-0ad4-11ce-b03a-0020af0ba770") - IFilterMapper : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RegisterFilter( - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [in] */ DWORD dwMerit) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterFilterInstance( - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [out] */ CLSID *MRId) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterPin( - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name, - /* [in] */ BOOL bRendered, - /* [in] */ BOOL bOutput, - /* [in] */ BOOL bZero, - /* [in] */ BOOL bMany, - /* [in] */ CLSID ConnectsToFilter, - /* [in] */ LPCWSTR ConnectsToPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterPinType( - /* [in] */ CLSID clsFilter, - /* [in] */ LPCWSTR strName, - /* [in] */ CLSID clsMajorType, - /* [in] */ CLSID clsSubType) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnregisterFilter( - /* [in] */ CLSID Filter) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnregisterFilterInstance( - /* [in] */ CLSID MRId) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnregisterPin( - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumMatchingFilters( - /* [out] */ IEnumRegFilters **ppEnum, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ CLSID clsInMaj, - /* [in] */ CLSID clsInSub, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOututNeeded, - /* [in] */ CLSID clsOutMaj, - /* [in] */ CLSID clsOutSub) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterMapperVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterMapper * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterMapper * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterMapper * This); - - HRESULT ( STDMETHODCALLTYPE *RegisterFilter )( - IFilterMapper * This, - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [in] */ DWORD dwMerit); - - HRESULT ( STDMETHODCALLTYPE *RegisterFilterInstance )( - IFilterMapper * This, - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [out] */ CLSID *MRId); - - HRESULT ( STDMETHODCALLTYPE *RegisterPin )( - IFilterMapper * This, - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name, - /* [in] */ BOOL bRendered, - /* [in] */ BOOL bOutput, - /* [in] */ BOOL bZero, - /* [in] */ BOOL bMany, - /* [in] */ CLSID ConnectsToFilter, - /* [in] */ LPCWSTR ConnectsToPin); - - HRESULT ( STDMETHODCALLTYPE *RegisterPinType )( - IFilterMapper * This, - /* [in] */ CLSID clsFilter, - /* [in] */ LPCWSTR strName, - /* [in] */ CLSID clsMajorType, - /* [in] */ CLSID clsSubType); - - HRESULT ( STDMETHODCALLTYPE *UnregisterFilter )( - IFilterMapper * This, - /* [in] */ CLSID Filter); - - HRESULT ( STDMETHODCALLTYPE *UnregisterFilterInstance )( - IFilterMapper * This, - /* [in] */ CLSID MRId); - - HRESULT ( STDMETHODCALLTYPE *UnregisterPin )( - IFilterMapper * This, - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name); - - HRESULT ( STDMETHODCALLTYPE *EnumMatchingFilters )( - IFilterMapper * This, - /* [out] */ IEnumRegFilters **ppEnum, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ CLSID clsInMaj, - /* [in] */ CLSID clsInSub, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOututNeeded, - /* [in] */ CLSID clsOutMaj, - /* [in] */ CLSID clsOutSub); - - END_INTERFACE - } IFilterMapperVtbl; - - interface IFilterMapper - { - CONST_VTBL struct IFilterMapperVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterMapper_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterMapper_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterMapper_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterMapper_RegisterFilter(This,clsid,Name,dwMerit) \ - (This)->lpVtbl -> RegisterFilter(This,clsid,Name,dwMerit) - -#define IFilterMapper_RegisterFilterInstance(This,clsid,Name,MRId) \ - (This)->lpVtbl -> RegisterFilterInstance(This,clsid,Name,MRId) - -#define IFilterMapper_RegisterPin(This,Filter,Name,bRendered,bOutput,bZero,bMany,ConnectsToFilter,ConnectsToPin) \ - (This)->lpVtbl -> RegisterPin(This,Filter,Name,bRendered,bOutput,bZero,bMany,ConnectsToFilter,ConnectsToPin) - -#define IFilterMapper_RegisterPinType(This,clsFilter,strName,clsMajorType,clsSubType) \ - (This)->lpVtbl -> RegisterPinType(This,clsFilter,strName,clsMajorType,clsSubType) - -#define IFilterMapper_UnregisterFilter(This,Filter) \ - (This)->lpVtbl -> UnregisterFilter(This,Filter) - -#define IFilterMapper_UnregisterFilterInstance(This,MRId) \ - (This)->lpVtbl -> UnregisterFilterInstance(This,MRId) - -#define IFilterMapper_UnregisterPin(This,Filter,Name) \ - (This)->lpVtbl -> UnregisterPin(This,Filter,Name) - -#define IFilterMapper_EnumMatchingFilters(This,ppEnum,dwMerit,bInputNeeded,clsInMaj,clsInSub,bRender,bOututNeeded,clsOutMaj,clsOutSub) \ - (This)->lpVtbl -> EnumMatchingFilters(This,ppEnum,dwMerit,bInputNeeded,clsInMaj,clsInSub,bRender,bOututNeeded,clsOutMaj,clsOutSub) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterMapper_RegisterFilter_Proxy( - IFilterMapper * This, - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [in] */ DWORD dwMerit); - - -void __RPC_STUB IFilterMapper_RegisterFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_RegisterFilterInstance_Proxy( - IFilterMapper * This, - /* [in] */ CLSID clsid, - /* [in] */ LPCWSTR Name, - /* [out] */ CLSID *MRId); - - -void __RPC_STUB IFilterMapper_RegisterFilterInstance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_RegisterPin_Proxy( - IFilterMapper * This, - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name, - /* [in] */ BOOL bRendered, - /* [in] */ BOOL bOutput, - /* [in] */ BOOL bZero, - /* [in] */ BOOL bMany, - /* [in] */ CLSID ConnectsToFilter, - /* [in] */ LPCWSTR ConnectsToPin); - - -void __RPC_STUB IFilterMapper_RegisterPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_RegisterPinType_Proxy( - IFilterMapper * This, - /* [in] */ CLSID clsFilter, - /* [in] */ LPCWSTR strName, - /* [in] */ CLSID clsMajorType, - /* [in] */ CLSID clsSubType); - - -void __RPC_STUB IFilterMapper_RegisterPinType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_UnregisterFilter_Proxy( - IFilterMapper * This, - /* [in] */ CLSID Filter); - - -void __RPC_STUB IFilterMapper_UnregisterFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_UnregisterFilterInstance_Proxy( - IFilterMapper * This, - /* [in] */ CLSID MRId); - - -void __RPC_STUB IFilterMapper_UnregisterFilterInstance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_UnregisterPin_Proxy( - IFilterMapper * This, - /* [in] */ CLSID Filter, - /* [in] */ LPCWSTR Name); - - -void __RPC_STUB IFilterMapper_UnregisterPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper_EnumMatchingFilters_Proxy( - IFilterMapper * This, - /* [out] */ IEnumRegFilters **ppEnum, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ CLSID clsInMaj, - /* [in] */ CLSID clsInSub, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOututNeeded, - /* [in] */ CLSID clsOutMaj, - /* [in] */ CLSID clsOutSub); - - -void __RPC_STUB IFilterMapper_EnumMatchingFilters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterMapper_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0133 */ -/* [local] */ - -typedef /* [public][public][public][public][public][public][public] */ struct __MIDL___MIDL_itf_strmif_0133_0001 - { - const CLSID *clsMajorType; - const CLSID *clsMinorType; - } REGPINTYPES; - -typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_strmif_0133_0002 - { - LPWSTR strName; - BOOL bRendered; - BOOL bOutput; - BOOL bZero; - BOOL bMany; - const CLSID *clsConnectsToFilter; - const WCHAR *strConnectsToPin; - UINT nMediaTypes; - const REGPINTYPES *lpMediaType; - } REGFILTERPINS; - -typedef /* [public][public][public][public][public][public] */ struct __MIDL___MIDL_itf_strmif_0133_0003 - { - CLSID clsMedium; - DWORD dw1; - DWORD dw2; - } REGPINMEDIUM; - - -enum __MIDL___MIDL_itf_strmif_0133_0004 - { REG_PINFLAG_B_ZERO = 0x1, - REG_PINFLAG_B_RENDERER = 0x2, - REG_PINFLAG_B_MANY = 0x4, - REG_PINFLAG_B_OUTPUT = 0x8 - } ; -typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_strmif_0133_0005 - { - DWORD dwFlags; - UINT cInstances; - UINT nMediaTypes; - /* [size_is] */ const REGPINTYPES *lpMediaType; - UINT nMediums; - /* [size_is] */ const REGPINMEDIUM *lpMedium; - const CLSID *clsPinCategory; - } REGFILTERPINS2; - -typedef /* [public][public] */ struct __MIDL___MIDL_itf_strmif_0133_0006 - { - DWORD dwVersion; - DWORD dwMerit; - /* [switch_type][switch_is] */ union - { - /* [case()] */ struct - { - ULONG cPins; - /* [size_is] */ const REGFILTERPINS *rgPins; - } ; - /* [case()] */ struct - { - ULONG cPins2; - /* [size_is] */ const REGFILTERPINS2 *rgPins2; - } ; - /* [default] */ /* Empty union arm */ - } ; - } REGFILTER2; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0133_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0133_v0_0_s_ifspec; - -#ifndef __IFilterMapper2_INTERFACE_DEFINED__ -#define __IFilterMapper2_INTERFACE_DEFINED__ - -/* interface IFilterMapper2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFilterMapper2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("b79bb0b0-33c1-11d1-abe1-00a0c905f375") - IFilterMapper2 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateCategory( - /* [in] */ REFCLSID clsidCategory, - /* [in] */ DWORD dwCategoryMerit, - /* [in] */ LPCWSTR Description) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnregisterFilter( - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ REFCLSID Filter) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterFilter( - /* [in] */ REFCLSID clsidFilter, - /* [in] */ LPCWSTR Name, - /* [out][in] */ IMoniker **ppMoniker, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ const REGFILTER2 *prf2) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumMatchingFilters( - /* [out] */ IEnumMoniker **ppEnum, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bExactMatch, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ DWORD cInputTypes, - /* [size_is] */ const GUID *pInputTypes, - /* [in] */ const REGPINMEDIUM *pMedIn, - /* [in] */ const CLSID *pPinCategoryIn, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOutputNeeded, - /* [in] */ DWORD cOutputTypes, - /* [size_is] */ const GUID *pOutputTypes, - /* [in] */ const REGPINMEDIUM *pMedOut, - /* [in] */ const CLSID *pPinCategoryOut) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterMapper2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterMapper2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterMapper2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterMapper2 * This); - - HRESULT ( STDMETHODCALLTYPE *CreateCategory )( - IFilterMapper2 * This, - /* [in] */ REFCLSID clsidCategory, - /* [in] */ DWORD dwCategoryMerit, - /* [in] */ LPCWSTR Description); - - HRESULT ( STDMETHODCALLTYPE *UnregisterFilter )( - IFilterMapper2 * This, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ REFCLSID Filter); - - HRESULT ( STDMETHODCALLTYPE *RegisterFilter )( - IFilterMapper2 * This, - /* [in] */ REFCLSID clsidFilter, - /* [in] */ LPCWSTR Name, - /* [out][in] */ IMoniker **ppMoniker, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ const REGFILTER2 *prf2); - - HRESULT ( STDMETHODCALLTYPE *EnumMatchingFilters )( - IFilterMapper2 * This, - /* [out] */ IEnumMoniker **ppEnum, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bExactMatch, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ DWORD cInputTypes, - /* [size_is] */ const GUID *pInputTypes, - /* [in] */ const REGPINMEDIUM *pMedIn, - /* [in] */ const CLSID *pPinCategoryIn, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOutputNeeded, - /* [in] */ DWORD cOutputTypes, - /* [size_is] */ const GUID *pOutputTypes, - /* [in] */ const REGPINMEDIUM *pMedOut, - /* [in] */ const CLSID *pPinCategoryOut); - - END_INTERFACE - } IFilterMapper2Vtbl; - - interface IFilterMapper2 - { - CONST_VTBL struct IFilterMapper2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterMapper2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterMapper2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterMapper2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterMapper2_CreateCategory(This,clsidCategory,dwCategoryMerit,Description) \ - (This)->lpVtbl -> CreateCategory(This,clsidCategory,dwCategoryMerit,Description) - -#define IFilterMapper2_UnregisterFilter(This,pclsidCategory,szInstance,Filter) \ - (This)->lpVtbl -> UnregisterFilter(This,pclsidCategory,szInstance,Filter) - -#define IFilterMapper2_RegisterFilter(This,clsidFilter,Name,ppMoniker,pclsidCategory,szInstance,prf2) \ - (This)->lpVtbl -> RegisterFilter(This,clsidFilter,Name,ppMoniker,pclsidCategory,szInstance,prf2) - -#define IFilterMapper2_EnumMatchingFilters(This,ppEnum,dwFlags,bExactMatch,dwMerit,bInputNeeded,cInputTypes,pInputTypes,pMedIn,pPinCategoryIn,bRender,bOutputNeeded,cOutputTypes,pOutputTypes,pMedOut,pPinCategoryOut) \ - (This)->lpVtbl -> EnumMatchingFilters(This,ppEnum,dwFlags,bExactMatch,dwMerit,bInputNeeded,cInputTypes,pInputTypes,pMedIn,pPinCategoryIn,bRender,bOutputNeeded,cOutputTypes,pOutputTypes,pMedOut,pPinCategoryOut) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterMapper2_CreateCategory_Proxy( - IFilterMapper2 * This, - /* [in] */ REFCLSID clsidCategory, - /* [in] */ DWORD dwCategoryMerit, - /* [in] */ LPCWSTR Description); - - -void __RPC_STUB IFilterMapper2_CreateCategory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper2_UnregisterFilter_Proxy( - IFilterMapper2 * This, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ REFCLSID Filter); - - -void __RPC_STUB IFilterMapper2_UnregisterFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper2_RegisterFilter_Proxy( - IFilterMapper2 * This, - /* [in] */ REFCLSID clsidFilter, - /* [in] */ LPCWSTR Name, - /* [out][in] */ IMoniker **ppMoniker, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ const REGFILTER2 *prf2); - - -void __RPC_STUB IFilterMapper2_RegisterFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterMapper2_EnumMatchingFilters_Proxy( - IFilterMapper2 * This, - /* [out] */ IEnumMoniker **ppEnum, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bExactMatch, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ DWORD cInputTypes, - /* [size_is] */ const GUID *pInputTypes, - /* [in] */ const REGPINMEDIUM *pMedIn, - /* [in] */ const CLSID *pPinCategoryIn, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOutputNeeded, - /* [in] */ DWORD cOutputTypes, - /* [size_is] */ const GUID *pOutputTypes, - /* [in] */ const REGPINMEDIUM *pMedOut, - /* [in] */ const CLSID *pPinCategoryOut); - - -void __RPC_STUB IFilterMapper2_EnumMatchingFilters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterMapper2_INTERFACE_DEFINED__ */ - - -#ifndef __IFilterMapper3_INTERFACE_DEFINED__ -#define __IFilterMapper3_INTERFACE_DEFINED__ - -/* interface IFilterMapper3 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFilterMapper3; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("b79bb0b1-33c1-11d1-abe1-00a0c905f375") - IFilterMapper3 : public IFilterMapper2 - { - public: - virtual HRESULT STDMETHODCALLTYPE GetICreateDevEnum( - /* [out] */ ICreateDevEnum **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterMapper3Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterMapper3 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterMapper3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterMapper3 * This); - - HRESULT ( STDMETHODCALLTYPE *CreateCategory )( - IFilterMapper3 * This, - /* [in] */ REFCLSID clsidCategory, - /* [in] */ DWORD dwCategoryMerit, - /* [in] */ LPCWSTR Description); - - HRESULT ( STDMETHODCALLTYPE *UnregisterFilter )( - IFilterMapper3 * This, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ REFCLSID Filter); - - HRESULT ( STDMETHODCALLTYPE *RegisterFilter )( - IFilterMapper3 * This, - /* [in] */ REFCLSID clsidFilter, - /* [in] */ LPCWSTR Name, - /* [out][in] */ IMoniker **ppMoniker, - /* [in] */ const CLSID *pclsidCategory, - /* [in] */ const OLECHAR *szInstance, - /* [in] */ const REGFILTER2 *prf2); - - HRESULT ( STDMETHODCALLTYPE *EnumMatchingFilters )( - IFilterMapper3 * This, - /* [out] */ IEnumMoniker **ppEnum, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bExactMatch, - /* [in] */ DWORD dwMerit, - /* [in] */ BOOL bInputNeeded, - /* [in] */ DWORD cInputTypes, - /* [size_is] */ const GUID *pInputTypes, - /* [in] */ const REGPINMEDIUM *pMedIn, - /* [in] */ const CLSID *pPinCategoryIn, - /* [in] */ BOOL bRender, - /* [in] */ BOOL bOutputNeeded, - /* [in] */ DWORD cOutputTypes, - /* [size_is] */ const GUID *pOutputTypes, - /* [in] */ const REGPINMEDIUM *pMedOut, - /* [in] */ const CLSID *pPinCategoryOut); - - HRESULT ( STDMETHODCALLTYPE *GetICreateDevEnum )( - IFilterMapper3 * This, - /* [out] */ ICreateDevEnum **ppEnum); - - END_INTERFACE - } IFilterMapper3Vtbl; - - interface IFilterMapper3 - { - CONST_VTBL struct IFilterMapper3Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterMapper3_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterMapper3_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterMapper3_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterMapper3_CreateCategory(This,clsidCategory,dwCategoryMerit,Description) \ - (This)->lpVtbl -> CreateCategory(This,clsidCategory,dwCategoryMerit,Description) - -#define IFilterMapper3_UnregisterFilter(This,pclsidCategory,szInstance,Filter) \ - (This)->lpVtbl -> UnregisterFilter(This,pclsidCategory,szInstance,Filter) - -#define IFilterMapper3_RegisterFilter(This,clsidFilter,Name,ppMoniker,pclsidCategory,szInstance,prf2) \ - (This)->lpVtbl -> RegisterFilter(This,clsidFilter,Name,ppMoniker,pclsidCategory,szInstance,prf2) - -#define IFilterMapper3_EnumMatchingFilters(This,ppEnum,dwFlags,bExactMatch,dwMerit,bInputNeeded,cInputTypes,pInputTypes,pMedIn,pPinCategoryIn,bRender,bOutputNeeded,cOutputTypes,pOutputTypes,pMedOut,pPinCategoryOut) \ - (This)->lpVtbl -> EnumMatchingFilters(This,ppEnum,dwFlags,bExactMatch,dwMerit,bInputNeeded,cInputTypes,pInputTypes,pMedIn,pPinCategoryIn,bRender,bOutputNeeded,cOutputTypes,pOutputTypes,pMedOut,pPinCategoryOut) - - -#define IFilterMapper3_GetICreateDevEnum(This,ppEnum) \ - (This)->lpVtbl -> GetICreateDevEnum(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterMapper3_GetICreateDevEnum_Proxy( - IFilterMapper3 * This, - /* [out] */ ICreateDevEnum **ppEnum); - - -void __RPC_STUB IFilterMapper3_GetICreateDevEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterMapper3_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0136 */ -/* [local] */ - -typedef -enum tagQualityMessageType - { Famine = 0, - Flood = Famine + 1 - } QualityMessageType; - -typedef struct tagQuality - { - QualityMessageType Type; - long Proportion; - REFERENCE_TIME Late; - REFERENCE_TIME TimeStamp; - } Quality; - -typedef IQualityControl *PQUALITYCONTROL; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0136_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0136_v0_0_s_ifspec; - -#ifndef __IQualityControl_INTERFACE_DEFINED__ -#define __IQualityControl_INTERFACE_DEFINED__ - -/* interface IQualityControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IQualityControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a5-0ad4-11ce-b03a-0020af0ba770") - IQualityControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Notify( - /* [in] */ IBaseFilter *pSelf, - /* [in] */ Quality q) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSink( - /* [in] */ IQualityControl *piqc) = 0; - - }; - -#else /* C style interface */ - - typedef struct IQualityControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IQualityControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IQualityControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IQualityControl * This); - - HRESULT ( STDMETHODCALLTYPE *Notify )( - IQualityControl * This, - /* [in] */ IBaseFilter *pSelf, - /* [in] */ Quality q); - - HRESULT ( STDMETHODCALLTYPE *SetSink )( - IQualityControl * This, - /* [in] */ IQualityControl *piqc); - - END_INTERFACE - } IQualityControlVtbl; - - interface IQualityControl - { - CONST_VTBL struct IQualityControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IQualityControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IQualityControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IQualityControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IQualityControl_Notify(This,pSelf,q) \ - (This)->lpVtbl -> Notify(This,pSelf,q) - -#define IQualityControl_SetSink(This,piqc) \ - (This)->lpVtbl -> SetSink(This,piqc) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IQualityControl_Notify_Proxy( - IQualityControl * This, - /* [in] */ IBaseFilter *pSelf, - /* [in] */ Quality q); - - -void __RPC_STUB IQualityControl_Notify_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IQualityControl_SetSink_Proxy( - IQualityControl * This, - /* [in] */ IQualityControl *piqc); - - -void __RPC_STUB IQualityControl_SetSink_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IQualityControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0137 */ -/* [local] */ - - -enum __MIDL___MIDL_itf_strmif_0137_0001 - { CK_NOCOLORKEY = 0, - CK_INDEX = 0x1, - CK_RGB = 0x2 - } ; -typedef struct tagCOLORKEY - { - DWORD KeyType; - DWORD PaletteIndex; - COLORREF LowColorValue; - COLORREF HighColorValue; - } COLORKEY; - - -enum __MIDL___MIDL_itf_strmif_0137_0002 - { ADVISE_NONE = 0, - ADVISE_CLIPPING = 0x1, - ADVISE_PALETTE = 0x2, - ADVISE_COLORKEY = 0x4, - ADVISE_POSITION = 0x8, - ADVISE_DISPLAY_CHANGE = 0x10 - } ; -#define ADVISE_ALL ( ADVISE_CLIPPING | ADVISE_PALETTE | ADVISE_COLORKEY | ADVISE_POSITION ) - -#define ADVISE_ALL2 ( ADVISE_ALL | ADVISE_DISPLAY_CHANGE ) - -#ifndef _WINGDI_ -typedef struct _RGNDATAHEADER - { - DWORD dwSize; - DWORD iType; - DWORD nCount; - DWORD nRgnSize; - RECT rcBound; - } RGNDATAHEADER; - -typedef struct _RGNDATA - { - RGNDATAHEADER rdh; - char Buffer[ 1 ]; - } RGNDATA; - -#endif - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0137_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0137_v0_0_s_ifspec; - -#ifndef __IOverlayNotify_INTERFACE_DEFINED__ -#define __IOverlayNotify_INTERFACE_DEFINED__ - -/* interface IOverlayNotify */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IOverlayNotify; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a0-0ad4-11ce-b03a-0020af0ba770") - IOverlayNotify : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnPaletteChange( - /* [in] */ DWORD dwColors, - /* [in] */ const PALETTEENTRY *pPalette) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnClipChange( - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect, - /* [in] */ const RGNDATA *pRgnData) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnColorKeyChange( - /* [in] */ const COLORKEY *pColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnPositionChange( - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect) = 0; - - }; - -#else /* C style interface */ - - typedef struct IOverlayNotifyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IOverlayNotify * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IOverlayNotify * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IOverlayNotify * This); - - HRESULT ( STDMETHODCALLTYPE *OnPaletteChange )( - IOverlayNotify * This, - /* [in] */ DWORD dwColors, - /* [in] */ const PALETTEENTRY *pPalette); - - HRESULT ( STDMETHODCALLTYPE *OnClipChange )( - IOverlayNotify * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect, - /* [in] */ const RGNDATA *pRgnData); - - HRESULT ( STDMETHODCALLTYPE *OnColorKeyChange )( - IOverlayNotify * This, - /* [in] */ const COLORKEY *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *OnPositionChange )( - IOverlayNotify * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect); - - END_INTERFACE - } IOverlayNotifyVtbl; - - interface IOverlayNotify - { - CONST_VTBL struct IOverlayNotifyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IOverlayNotify_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IOverlayNotify_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IOverlayNotify_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IOverlayNotify_OnPaletteChange(This,dwColors,pPalette) \ - (This)->lpVtbl -> OnPaletteChange(This,dwColors,pPalette) - -#define IOverlayNotify_OnClipChange(This,pSourceRect,pDestinationRect,pRgnData) \ - (This)->lpVtbl -> OnClipChange(This,pSourceRect,pDestinationRect,pRgnData) - -#define IOverlayNotify_OnColorKeyChange(This,pColorKey) \ - (This)->lpVtbl -> OnColorKeyChange(This,pColorKey) - -#define IOverlayNotify_OnPositionChange(This,pSourceRect,pDestinationRect) \ - (This)->lpVtbl -> OnPositionChange(This,pSourceRect,pDestinationRect) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IOverlayNotify_OnPaletteChange_Proxy( - IOverlayNotify * This, - /* [in] */ DWORD dwColors, - /* [in] */ const PALETTEENTRY *pPalette); - - -void __RPC_STUB IOverlayNotify_OnPaletteChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlayNotify_OnClipChange_Proxy( - IOverlayNotify * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect, - /* [in] */ const RGNDATA *pRgnData); - - -void __RPC_STUB IOverlayNotify_OnClipChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlayNotify_OnColorKeyChange_Proxy( - IOverlayNotify * This, - /* [in] */ const COLORKEY *pColorKey); - - -void __RPC_STUB IOverlayNotify_OnColorKeyChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlayNotify_OnPositionChange_Proxy( - IOverlayNotify * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect); - - -void __RPC_STUB IOverlayNotify_OnPositionChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IOverlayNotify_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0138 */ -/* [local] */ - -typedef IOverlayNotify *POVERLAYNOTIFY; - -#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500) -#define HMONITOR_DECLARED -#if 0 -typedef HANDLE HMONITOR; - -#endif -DECLARE_HANDLE(HMONITOR); -#endif - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0138_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0138_v0_0_s_ifspec; - -#ifndef __IOverlayNotify2_INTERFACE_DEFINED__ -#define __IOverlayNotify2_INTERFACE_DEFINED__ - -/* interface IOverlayNotify2 */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IOverlayNotify2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("680EFA10-D535-11D1-87C8-00A0C9223196") - IOverlayNotify2 : public IOverlayNotify - { - public: - virtual HRESULT STDMETHODCALLTYPE OnDisplayChange( - HMONITOR hMonitor) = 0; - - }; - -#else /* C style interface */ - - typedef struct IOverlayNotify2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IOverlayNotify2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IOverlayNotify2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IOverlayNotify2 * This); - - HRESULT ( STDMETHODCALLTYPE *OnPaletteChange )( - IOverlayNotify2 * This, - /* [in] */ DWORD dwColors, - /* [in] */ const PALETTEENTRY *pPalette); - - HRESULT ( STDMETHODCALLTYPE *OnClipChange )( - IOverlayNotify2 * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect, - /* [in] */ const RGNDATA *pRgnData); - - HRESULT ( STDMETHODCALLTYPE *OnColorKeyChange )( - IOverlayNotify2 * This, - /* [in] */ const COLORKEY *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *OnPositionChange )( - IOverlayNotify2 * This, - /* [in] */ const RECT *pSourceRect, - /* [in] */ const RECT *pDestinationRect); - - HRESULT ( STDMETHODCALLTYPE *OnDisplayChange )( - IOverlayNotify2 * This, - HMONITOR hMonitor); - - END_INTERFACE - } IOverlayNotify2Vtbl; - - interface IOverlayNotify2 - { - CONST_VTBL struct IOverlayNotify2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IOverlayNotify2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IOverlayNotify2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IOverlayNotify2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IOverlayNotify2_OnPaletteChange(This,dwColors,pPalette) \ - (This)->lpVtbl -> OnPaletteChange(This,dwColors,pPalette) - -#define IOverlayNotify2_OnClipChange(This,pSourceRect,pDestinationRect,pRgnData) \ - (This)->lpVtbl -> OnClipChange(This,pSourceRect,pDestinationRect,pRgnData) - -#define IOverlayNotify2_OnColorKeyChange(This,pColorKey) \ - (This)->lpVtbl -> OnColorKeyChange(This,pColorKey) - -#define IOverlayNotify2_OnPositionChange(This,pSourceRect,pDestinationRect) \ - (This)->lpVtbl -> OnPositionChange(This,pSourceRect,pDestinationRect) - - -#define IOverlayNotify2_OnDisplayChange(This,hMonitor) \ - (This)->lpVtbl -> OnDisplayChange(This,hMonitor) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IOverlayNotify2_OnDisplayChange_Proxy( - IOverlayNotify2 * This, - HMONITOR hMonitor); - - -void __RPC_STUB IOverlayNotify2_OnDisplayChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IOverlayNotify2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0139 */ -/* [local] */ - -typedef IOverlayNotify2 *POVERLAYNOTIFY2; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0139_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0139_v0_0_s_ifspec; - -#ifndef __IOverlay_INTERFACE_DEFINED__ -#define __IOverlay_INTERFACE_DEFINED__ - -/* interface IOverlay */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IOverlay; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a1-0ad4-11ce-b03a-0020af0ba770") - IOverlay : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPalette( - /* [out] */ DWORD *pdwColors, - /* [out] */ PALETTEENTRY **ppPalette) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPalette( - /* [in] */ DWORD dwColors, - /* [in] */ PALETTEENTRY *pPalette) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultColorKey( - /* [out] */ COLORKEY *pColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetColorKey( - /* [out] */ COLORKEY *pColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetColorKey( - /* [out][in] */ COLORKEY *pColorKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetWindowHandle( - /* [out] */ HWND *pHwnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetClipList( - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect, - /* [out] */ RGNDATA **ppRgnData) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVideoPosition( - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE Advise( - /* [in] */ IOverlayNotify *pOverlayNotify, - /* [in] */ DWORD dwInterests) = 0; - - virtual HRESULT STDMETHODCALLTYPE Unadvise( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IOverlayVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IOverlay * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IOverlay * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IOverlay * This); - - HRESULT ( STDMETHODCALLTYPE *GetPalette )( - IOverlay * This, - /* [out] */ DWORD *pdwColors, - /* [out] */ PALETTEENTRY **ppPalette); - - HRESULT ( STDMETHODCALLTYPE *SetPalette )( - IOverlay * This, - /* [in] */ DWORD dwColors, - /* [in] */ PALETTEENTRY *pPalette); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultColorKey )( - IOverlay * This, - /* [out] */ COLORKEY *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *GetColorKey )( - IOverlay * This, - /* [out] */ COLORKEY *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *SetColorKey )( - IOverlay * This, - /* [out][in] */ COLORKEY *pColorKey); - - HRESULT ( STDMETHODCALLTYPE *GetWindowHandle )( - IOverlay * This, - /* [out] */ HWND *pHwnd); - - HRESULT ( STDMETHODCALLTYPE *GetClipList )( - IOverlay * This, - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect, - /* [out] */ RGNDATA **ppRgnData); - - HRESULT ( STDMETHODCALLTYPE *GetVideoPosition )( - IOverlay * This, - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect); - - HRESULT ( STDMETHODCALLTYPE *Advise )( - IOverlay * This, - /* [in] */ IOverlayNotify *pOverlayNotify, - /* [in] */ DWORD dwInterests); - - HRESULT ( STDMETHODCALLTYPE *Unadvise )( - IOverlay * This); - - END_INTERFACE - } IOverlayVtbl; - - interface IOverlay - { - CONST_VTBL struct IOverlayVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IOverlay_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IOverlay_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IOverlay_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IOverlay_GetPalette(This,pdwColors,ppPalette) \ - (This)->lpVtbl -> GetPalette(This,pdwColors,ppPalette) - -#define IOverlay_SetPalette(This,dwColors,pPalette) \ - (This)->lpVtbl -> SetPalette(This,dwColors,pPalette) - -#define IOverlay_GetDefaultColorKey(This,pColorKey) \ - (This)->lpVtbl -> GetDefaultColorKey(This,pColorKey) - -#define IOverlay_GetColorKey(This,pColorKey) \ - (This)->lpVtbl -> GetColorKey(This,pColorKey) - -#define IOverlay_SetColorKey(This,pColorKey) \ - (This)->lpVtbl -> SetColorKey(This,pColorKey) - -#define IOverlay_GetWindowHandle(This,pHwnd) \ - (This)->lpVtbl -> GetWindowHandle(This,pHwnd) - -#define IOverlay_GetClipList(This,pSourceRect,pDestinationRect,ppRgnData) \ - (This)->lpVtbl -> GetClipList(This,pSourceRect,pDestinationRect,ppRgnData) - -#define IOverlay_GetVideoPosition(This,pSourceRect,pDestinationRect) \ - (This)->lpVtbl -> GetVideoPosition(This,pSourceRect,pDestinationRect) - -#define IOverlay_Advise(This,pOverlayNotify,dwInterests) \ - (This)->lpVtbl -> Advise(This,pOverlayNotify,dwInterests) - -#define IOverlay_Unadvise(This) \ - (This)->lpVtbl -> Unadvise(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IOverlay_GetPalette_Proxy( - IOverlay * This, - /* [out] */ DWORD *pdwColors, - /* [out] */ PALETTEENTRY **ppPalette); - - -void __RPC_STUB IOverlay_GetPalette_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_SetPalette_Proxy( - IOverlay * This, - /* [in] */ DWORD dwColors, - /* [in] */ PALETTEENTRY *pPalette); - - -void __RPC_STUB IOverlay_SetPalette_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_GetDefaultColorKey_Proxy( - IOverlay * This, - /* [out] */ COLORKEY *pColorKey); - - -void __RPC_STUB IOverlay_GetDefaultColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_GetColorKey_Proxy( - IOverlay * This, - /* [out] */ COLORKEY *pColorKey); - - -void __RPC_STUB IOverlay_GetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_SetColorKey_Proxy( - IOverlay * This, - /* [out][in] */ COLORKEY *pColorKey); - - -void __RPC_STUB IOverlay_SetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_GetWindowHandle_Proxy( - IOverlay * This, - /* [out] */ HWND *pHwnd); - - -void __RPC_STUB IOverlay_GetWindowHandle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_GetClipList_Proxy( - IOverlay * This, - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect, - /* [out] */ RGNDATA **ppRgnData); - - -void __RPC_STUB IOverlay_GetClipList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_GetVideoPosition_Proxy( - IOverlay * This, - /* [out] */ RECT *pSourceRect, - /* [out] */ RECT *pDestinationRect); - - -void __RPC_STUB IOverlay_GetVideoPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_Advise_Proxy( - IOverlay * This, - /* [in] */ IOverlayNotify *pOverlayNotify, - /* [in] */ DWORD dwInterests); - - -void __RPC_STUB IOverlay_Advise_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IOverlay_Unadvise_Proxy( - IOverlay * This); - - -void __RPC_STUB IOverlay_Unadvise_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IOverlay_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0140 */ -/* [local] */ - -typedef IOverlay *POVERLAY; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0140_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0140_v0_0_s_ifspec; - -#ifndef __IMediaEventSink_INTERFACE_DEFINED__ -#define __IMediaEventSink_INTERFACE_DEFINED__ - -/* interface IMediaEventSink */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IMediaEventSink; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a2-0ad4-11ce-b03a-0020af0ba770") - IMediaEventSink : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Notify( - /* [in] */ long EventCode, - /* [in] */ LONG_PTR EventParam1, - /* [in] */ LONG_PTR EventParam2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaEventSinkVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaEventSink * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaEventSink * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaEventSink * This); - - HRESULT ( STDMETHODCALLTYPE *Notify )( - IMediaEventSink * This, - /* [in] */ long EventCode, - /* [in] */ LONG_PTR EventParam1, - /* [in] */ LONG_PTR EventParam2); - - END_INTERFACE - } IMediaEventSinkVtbl; - - interface IMediaEventSink - { - CONST_VTBL struct IMediaEventSinkVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaEventSink_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaEventSink_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaEventSink_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaEventSink_Notify(This,EventCode,EventParam1,EventParam2) \ - (This)->lpVtbl -> Notify(This,EventCode,EventParam1,EventParam2) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaEventSink_Notify_Proxy( - IMediaEventSink * This, - /* [in] */ long EventCode, - /* [in] */ LONG_PTR EventParam1, - /* [in] */ LONG_PTR EventParam2); - - -void __RPC_STUB IMediaEventSink_Notify_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaEventSink_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0141 */ -/* [local] */ - -typedef IMediaEventSink *PMEDIAEVENTSINK; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0141_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0141_v0_0_s_ifspec; - -#ifndef __IFileSourceFilter_INTERFACE_DEFINED__ -#define __IFileSourceFilter_INTERFACE_DEFINED__ - -/* interface IFileSourceFilter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFileSourceFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a6-0ad4-11ce-b03a-0020af0ba770") - IFileSourceFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Load( - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurFile( - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFileSourceFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileSourceFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFileSourceFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFileSourceFilter * This); - - HRESULT ( STDMETHODCALLTYPE *Load )( - IFileSourceFilter * This, - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetCurFile )( - IFileSourceFilter * This, - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt); - - END_INTERFACE - } IFileSourceFilterVtbl; - - interface IFileSourceFilter - { - CONST_VTBL struct IFileSourceFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFileSourceFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFileSourceFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFileSourceFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFileSourceFilter_Load(This,pszFileName,pmt) \ - (This)->lpVtbl -> Load(This,pszFileName,pmt) - -#define IFileSourceFilter_GetCurFile(This,ppszFileName,pmt) \ - (This)->lpVtbl -> GetCurFile(This,ppszFileName,pmt) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFileSourceFilter_Load_Proxy( - IFileSourceFilter * This, - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFileSourceFilter_Load_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFileSourceFilter_GetCurFile_Proxy( - IFileSourceFilter * This, - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFileSourceFilter_GetCurFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFileSourceFilter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0142 */ -/* [local] */ - -typedef IFileSourceFilter *PFILTERFILESOURCE; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0142_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0142_v0_0_s_ifspec; - -#ifndef __IFileSinkFilter_INTERFACE_DEFINED__ -#define __IFileSinkFilter_INTERFACE_DEFINED__ - -/* interface IFileSinkFilter */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFileSinkFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a2104830-7c70-11cf-8bce-00aa00a3f1a6") - IFileSinkFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFileName( - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurFile( - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFileSinkFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileSinkFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFileSinkFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFileSinkFilter * This); - - HRESULT ( STDMETHODCALLTYPE *SetFileName )( - IFileSinkFilter * This, - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetCurFile )( - IFileSinkFilter * This, - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt); - - END_INTERFACE - } IFileSinkFilterVtbl; - - interface IFileSinkFilter - { - CONST_VTBL struct IFileSinkFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFileSinkFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFileSinkFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFileSinkFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFileSinkFilter_SetFileName(This,pszFileName,pmt) \ - (This)->lpVtbl -> SetFileName(This,pszFileName,pmt) - -#define IFileSinkFilter_GetCurFile(This,ppszFileName,pmt) \ - (This)->lpVtbl -> GetCurFile(This,ppszFileName,pmt) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFileSinkFilter_SetFileName_Proxy( - IFileSinkFilter * This, - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFileSinkFilter_SetFileName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFileSinkFilter_GetCurFile_Proxy( - IFileSinkFilter * This, - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFileSinkFilter_GetCurFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFileSinkFilter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0143 */ -/* [local] */ - -typedef IFileSinkFilter *PFILTERFILESINK; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0143_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0143_v0_0_s_ifspec; - -#ifndef __IFileSinkFilter2_INTERFACE_DEFINED__ -#define __IFileSinkFilter2_INTERFACE_DEFINED__ - -/* interface IFileSinkFilter2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFileSinkFilter2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("00855B90-CE1B-11d0-BD4F-00A0C911CE86") - IFileSinkFilter2 : public IFileSinkFilter - { - public: - virtual HRESULT STDMETHODCALLTYPE SetMode( - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMode( - /* [out] */ DWORD *pdwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFileSinkFilter2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileSinkFilter2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFileSinkFilter2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFileSinkFilter2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetFileName )( - IFileSinkFilter2 * This, - /* [in] */ LPCOLESTR pszFileName, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetCurFile )( - IFileSinkFilter2 * This, - /* [out] */ LPOLESTR *ppszFileName, - /* [out] */ AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *SetMode )( - IFileSinkFilter2 * This, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetMode )( - IFileSinkFilter2 * This, - /* [out] */ DWORD *pdwFlags); - - END_INTERFACE - } IFileSinkFilter2Vtbl; - - interface IFileSinkFilter2 - { - CONST_VTBL struct IFileSinkFilter2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFileSinkFilter2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFileSinkFilter2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFileSinkFilter2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFileSinkFilter2_SetFileName(This,pszFileName,pmt) \ - (This)->lpVtbl -> SetFileName(This,pszFileName,pmt) - -#define IFileSinkFilter2_GetCurFile(This,ppszFileName,pmt) \ - (This)->lpVtbl -> GetCurFile(This,ppszFileName,pmt) - - -#define IFileSinkFilter2_SetMode(This,dwFlags) \ - (This)->lpVtbl -> SetMode(This,dwFlags) - -#define IFileSinkFilter2_GetMode(This,pdwFlags) \ - (This)->lpVtbl -> GetMode(This,pdwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFileSinkFilter2_SetMode_Proxy( - IFileSinkFilter2 * This, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IFileSinkFilter2_SetMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFileSinkFilter2_GetMode_Proxy( - IFileSinkFilter2 * This, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IFileSinkFilter2_GetMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFileSinkFilter2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0144 */ -/* [local] */ - -typedef IFileSinkFilter2 *PFILESINKFILTER2; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0144_0001 - { AM_FILE_OVERWRITE = 0x1 - } AM_FILESINK_FLAGS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0144_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0144_v0_0_s_ifspec; - -#ifndef __IGraphBuilder_INTERFACE_DEFINED__ -#define __IGraphBuilder_INTERFACE_DEFINED__ - -/* interface IGraphBuilder */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IGraphBuilder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868a9-0ad4-11ce-b03a-0020af0ba770") - IGraphBuilder : public IFilterGraph - { - public: - virtual HRESULT STDMETHODCALLTYPE Connect( - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn) = 0; - - virtual HRESULT STDMETHODCALLTYPE Render( - /* [in] */ IPin *ppinOut) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderFile( - /* [in] */ LPCWSTR lpcwstrFile, - /* [unique][in] */ LPCWSTR lpcwstrPlayList) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddSourceFilter( - /* [in] */ LPCWSTR lpcwstrFileName, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetLogFile( - /* [in] */ DWORD_PTR hFile) = 0; - - virtual HRESULT STDMETHODCALLTYPE Abort( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ShouldOperationContinue( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGraphBuilderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGraphBuilder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGraphBuilder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGraphBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IGraphBuilder * This, - /* [in] */ IBaseFilter *pFilter, - /* [string][in] */ LPCWSTR pName); - - HRESULT ( STDMETHODCALLTYPE *RemoveFilter )( - IGraphBuilder * This, - /* [in] */ IBaseFilter *pFilter); - - HRESULT ( STDMETHODCALLTYPE *EnumFilters )( - IGraphBuilder * This, - /* [out] */ IEnumFilters **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *FindFilterByName )( - IGraphBuilder * This, - /* [string][in] */ LPCWSTR pName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *ConnectDirect )( - IGraphBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *Reconnect )( - IGraphBuilder * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *Disconnect )( - IGraphBuilder * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultSyncSource )( - IGraphBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *Connect )( - IGraphBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn); - - HRESULT ( STDMETHODCALLTYPE *Render )( - IGraphBuilder * This, - /* [in] */ IPin *ppinOut); - - HRESULT ( STDMETHODCALLTYPE *RenderFile )( - IGraphBuilder * This, - /* [in] */ LPCWSTR lpcwstrFile, - /* [unique][in] */ LPCWSTR lpcwstrPlayList); - - HRESULT ( STDMETHODCALLTYPE *AddSourceFilter )( - IGraphBuilder * This, - /* [in] */ LPCWSTR lpcwstrFileName, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *SetLogFile )( - IGraphBuilder * This, - /* [in] */ DWORD_PTR hFile); - - HRESULT ( STDMETHODCALLTYPE *Abort )( - IGraphBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *ShouldOperationContinue )( - IGraphBuilder * This); - - END_INTERFACE - } IGraphBuilderVtbl; - - interface IGraphBuilder - { - CONST_VTBL struct IGraphBuilderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGraphBuilder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IGraphBuilder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IGraphBuilder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IGraphBuilder_AddFilter(This,pFilter,pName) \ - (This)->lpVtbl -> AddFilter(This,pFilter,pName) - -#define IGraphBuilder_RemoveFilter(This,pFilter) \ - (This)->lpVtbl -> RemoveFilter(This,pFilter) - -#define IGraphBuilder_EnumFilters(This,ppEnum) \ - (This)->lpVtbl -> EnumFilters(This,ppEnum) - -#define IGraphBuilder_FindFilterByName(This,pName,ppFilter) \ - (This)->lpVtbl -> FindFilterByName(This,pName,ppFilter) - -#define IGraphBuilder_ConnectDirect(This,ppinOut,ppinIn,pmt) \ - (This)->lpVtbl -> ConnectDirect(This,ppinOut,ppinIn,pmt) - -#define IGraphBuilder_Reconnect(This,ppin) \ - (This)->lpVtbl -> Reconnect(This,ppin) - -#define IGraphBuilder_Disconnect(This,ppin) \ - (This)->lpVtbl -> Disconnect(This,ppin) - -#define IGraphBuilder_SetDefaultSyncSource(This) \ - (This)->lpVtbl -> SetDefaultSyncSource(This) - - -#define IGraphBuilder_Connect(This,ppinOut,ppinIn) \ - (This)->lpVtbl -> Connect(This,ppinOut,ppinIn) - -#define IGraphBuilder_Render(This,ppinOut) \ - (This)->lpVtbl -> Render(This,ppinOut) - -#define IGraphBuilder_RenderFile(This,lpcwstrFile,lpcwstrPlayList) \ - (This)->lpVtbl -> RenderFile(This,lpcwstrFile,lpcwstrPlayList) - -#define IGraphBuilder_AddSourceFilter(This,lpcwstrFileName,lpcwstrFilterName,ppFilter) \ - (This)->lpVtbl -> AddSourceFilter(This,lpcwstrFileName,lpcwstrFilterName,ppFilter) - -#define IGraphBuilder_SetLogFile(This,hFile) \ - (This)->lpVtbl -> SetLogFile(This,hFile) - -#define IGraphBuilder_Abort(This) \ - (This)->lpVtbl -> Abort(This) - -#define IGraphBuilder_ShouldOperationContinue(This) \ - (This)->lpVtbl -> ShouldOperationContinue(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_Connect_Proxy( - IGraphBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn); - - -void __RPC_STUB IGraphBuilder_Connect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_Render_Proxy( - IGraphBuilder * This, - /* [in] */ IPin *ppinOut); - - -void __RPC_STUB IGraphBuilder_Render_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_RenderFile_Proxy( - IGraphBuilder * This, - /* [in] */ LPCWSTR lpcwstrFile, - /* [unique][in] */ LPCWSTR lpcwstrPlayList); - - -void __RPC_STUB IGraphBuilder_RenderFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_AddSourceFilter_Proxy( - IGraphBuilder * This, - /* [in] */ LPCWSTR lpcwstrFileName, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter); - - -void __RPC_STUB IGraphBuilder_AddSourceFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_SetLogFile_Proxy( - IGraphBuilder * This, - /* [in] */ DWORD_PTR hFile); - - -void __RPC_STUB IGraphBuilder_SetLogFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_Abort_Proxy( - IGraphBuilder * This); - - -void __RPC_STUB IGraphBuilder_Abort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphBuilder_ShouldOperationContinue_Proxy( - IGraphBuilder * This); - - -void __RPC_STUB IGraphBuilder_ShouldOperationContinue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IGraphBuilder_INTERFACE_DEFINED__ */ - - -#ifndef __ICaptureGraphBuilder_INTERFACE_DEFINED__ -#define __ICaptureGraphBuilder_INTERFACE_DEFINED__ - -/* interface ICaptureGraphBuilder */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_ICaptureGraphBuilder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("bf87b6e0-8c27-11d0-b3f0-00aa003761c5") - ICaptureGraphBuilder : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFiltergraph( - /* [in] */ IGraphBuilder *pfg) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFiltergraph( - /* [out] */ IGraphBuilder **ppfg) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputFileName( - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE FindInterface( - /* [unique][in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderStream( - /* [in] */ const GUID *pCategory, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer) = 0; - - virtual HRESULT STDMETHODCALLTYPE ControlStream( - /* [in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE AllocCapFile( - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE CopyCaptureFile( - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICaptureGraphBuilderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICaptureGraphBuilder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICaptureGraphBuilder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICaptureGraphBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *SetFiltergraph )( - ICaptureGraphBuilder * This, - /* [in] */ IGraphBuilder *pfg); - - HRESULT ( STDMETHODCALLTYPE *GetFiltergraph )( - ICaptureGraphBuilder * This, - /* [out] */ IGraphBuilder **ppfg); - - HRESULT ( STDMETHODCALLTYPE *SetOutputFileName )( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *FindInterface )( - ICaptureGraphBuilder * This, - /* [unique][in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint); - - HRESULT ( STDMETHODCALLTYPE *RenderStream )( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pCategory, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer); - - HRESULT ( STDMETHODCALLTYPE *ControlStream )( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie); - - HRESULT ( STDMETHODCALLTYPE *AllocCapFile )( - ICaptureGraphBuilder * This, - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize); - - HRESULT ( STDMETHODCALLTYPE *CopyCaptureFile )( - ICaptureGraphBuilder * This, - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback); - - END_INTERFACE - } ICaptureGraphBuilderVtbl; - - interface ICaptureGraphBuilder - { - CONST_VTBL struct ICaptureGraphBuilderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICaptureGraphBuilder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ICaptureGraphBuilder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ICaptureGraphBuilder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ICaptureGraphBuilder_SetFiltergraph(This,pfg) \ - (This)->lpVtbl -> SetFiltergraph(This,pfg) - -#define ICaptureGraphBuilder_GetFiltergraph(This,ppfg) \ - (This)->lpVtbl -> GetFiltergraph(This,ppfg) - -#define ICaptureGraphBuilder_SetOutputFileName(This,pType,lpstrFile,ppf,ppSink) \ - (This)->lpVtbl -> SetOutputFileName(This,pType,lpstrFile,ppf,ppSink) - -#define ICaptureGraphBuilder_FindInterface(This,pCategory,pf,riid,ppint) \ - (This)->lpVtbl -> FindInterface(This,pCategory,pf,riid,ppint) - -#define ICaptureGraphBuilder_RenderStream(This,pCategory,pSource,pfCompressor,pfRenderer) \ - (This)->lpVtbl -> RenderStream(This,pCategory,pSource,pfCompressor,pfRenderer) - -#define ICaptureGraphBuilder_ControlStream(This,pCategory,pFilter,pstart,pstop,wStartCookie,wStopCookie) \ - (This)->lpVtbl -> ControlStream(This,pCategory,pFilter,pstart,pstop,wStartCookie,wStopCookie) - -#define ICaptureGraphBuilder_AllocCapFile(This,lpstr,dwlSize) \ - (This)->lpVtbl -> AllocCapFile(This,lpstr,dwlSize) - -#define ICaptureGraphBuilder_CopyCaptureFile(This,lpwstrOld,lpwstrNew,fAllowEscAbort,pCallback) \ - (This)->lpVtbl -> CopyCaptureFile(This,lpwstrOld,lpwstrNew,fAllowEscAbort,pCallback) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_SetFiltergraph_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ IGraphBuilder *pfg); - - -void __RPC_STUB ICaptureGraphBuilder_SetFiltergraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_GetFiltergraph_Proxy( - ICaptureGraphBuilder * This, - /* [out] */ IGraphBuilder **ppfg); - - -void __RPC_STUB ICaptureGraphBuilder_GetFiltergraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_SetOutputFileName_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink); - - -void __RPC_STUB ICaptureGraphBuilder_SetOutputFileName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_RemoteFindInterface_Proxy( - ICaptureGraphBuilder * This, - /* [unique][in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ IUnknown **ppint); - - -void __RPC_STUB ICaptureGraphBuilder_RemoteFindInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_RenderStream_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pCategory, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer); - - -void __RPC_STUB ICaptureGraphBuilder_RenderStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_ControlStream_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie); - - -void __RPC_STUB ICaptureGraphBuilder_ControlStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_AllocCapFile_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize); - - -void __RPC_STUB ICaptureGraphBuilder_AllocCapFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_CopyCaptureFile_Proxy( - ICaptureGraphBuilder * This, - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback); - - -void __RPC_STUB ICaptureGraphBuilder_CopyCaptureFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ICaptureGraphBuilder_INTERFACE_DEFINED__ */ - - -#ifndef __IAMCopyCaptureFileProgress_INTERFACE_DEFINED__ -#define __IAMCopyCaptureFileProgress_INTERFACE_DEFINED__ - -/* interface IAMCopyCaptureFileProgress */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMCopyCaptureFileProgress; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("670d1d20-a068-11d0-b3f0-00aa003761c5") - IAMCopyCaptureFileProgress : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Progress( - /* [in] */ int iProgress) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMCopyCaptureFileProgressVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMCopyCaptureFileProgress * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMCopyCaptureFileProgress * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMCopyCaptureFileProgress * This); - - HRESULT ( STDMETHODCALLTYPE *Progress )( - IAMCopyCaptureFileProgress * This, - /* [in] */ int iProgress); - - END_INTERFACE - } IAMCopyCaptureFileProgressVtbl; - - interface IAMCopyCaptureFileProgress - { - CONST_VTBL struct IAMCopyCaptureFileProgressVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMCopyCaptureFileProgress_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMCopyCaptureFileProgress_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMCopyCaptureFileProgress_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMCopyCaptureFileProgress_Progress(This,iProgress) \ - (This)->lpVtbl -> Progress(This,iProgress) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMCopyCaptureFileProgress_Progress_Proxy( - IAMCopyCaptureFileProgress * This, - /* [in] */ int iProgress); - - -void __RPC_STUB IAMCopyCaptureFileProgress_Progress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMCopyCaptureFileProgress_INTERFACE_DEFINED__ */ - - -#ifndef __ICaptureGraphBuilder2_INTERFACE_DEFINED__ -#define __ICaptureGraphBuilder2_INTERFACE_DEFINED__ - -/* interface ICaptureGraphBuilder2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_ICaptureGraphBuilder2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D") - ICaptureGraphBuilder2 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFiltergraph( - /* [in] */ IGraphBuilder *pfg) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFiltergraph( - /* [out] */ IGraphBuilder **ppfg) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputFileName( - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE FindInterface( - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderStream( - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer) = 0; - - virtual HRESULT STDMETHODCALLTYPE ControlStream( - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE AllocCapFile( - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE CopyCaptureFile( - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindPin( - /* [in] */ IUnknown *pSource, - /* [in] */ PIN_DIRECTION pindir, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ BOOL fUnconnected, - /* [in] */ int num, - /* [out] */ IPin **ppPin) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICaptureGraphBuilder2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICaptureGraphBuilder2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICaptureGraphBuilder2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICaptureGraphBuilder2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetFiltergraph )( - ICaptureGraphBuilder2 * This, - /* [in] */ IGraphBuilder *pfg); - - HRESULT ( STDMETHODCALLTYPE *GetFiltergraph )( - ICaptureGraphBuilder2 * This, - /* [out] */ IGraphBuilder **ppfg); - - HRESULT ( STDMETHODCALLTYPE *SetOutputFileName )( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *FindInterface )( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint); - - HRESULT ( STDMETHODCALLTYPE *RenderStream )( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer); - - HRESULT ( STDMETHODCALLTYPE *ControlStream )( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie); - - HRESULT ( STDMETHODCALLTYPE *AllocCapFile )( - ICaptureGraphBuilder2 * This, - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize); - - HRESULT ( STDMETHODCALLTYPE *CopyCaptureFile )( - ICaptureGraphBuilder2 * This, - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback); - - HRESULT ( STDMETHODCALLTYPE *FindPin )( - ICaptureGraphBuilder2 * This, - /* [in] */ IUnknown *pSource, - /* [in] */ PIN_DIRECTION pindir, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ BOOL fUnconnected, - /* [in] */ int num, - /* [out] */ IPin **ppPin); - - END_INTERFACE - } ICaptureGraphBuilder2Vtbl; - - interface ICaptureGraphBuilder2 - { - CONST_VTBL struct ICaptureGraphBuilder2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICaptureGraphBuilder2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ICaptureGraphBuilder2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ICaptureGraphBuilder2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ICaptureGraphBuilder2_SetFiltergraph(This,pfg) \ - (This)->lpVtbl -> SetFiltergraph(This,pfg) - -#define ICaptureGraphBuilder2_GetFiltergraph(This,ppfg) \ - (This)->lpVtbl -> GetFiltergraph(This,ppfg) - -#define ICaptureGraphBuilder2_SetOutputFileName(This,pType,lpstrFile,ppf,ppSink) \ - (This)->lpVtbl -> SetOutputFileName(This,pType,lpstrFile,ppf,ppSink) - -#define ICaptureGraphBuilder2_FindInterface(This,pCategory,pType,pf,riid,ppint) \ - (This)->lpVtbl -> FindInterface(This,pCategory,pType,pf,riid,ppint) - -#define ICaptureGraphBuilder2_RenderStream(This,pCategory,pType,pSource,pfCompressor,pfRenderer) \ - (This)->lpVtbl -> RenderStream(This,pCategory,pType,pSource,pfCompressor,pfRenderer) - -#define ICaptureGraphBuilder2_ControlStream(This,pCategory,pType,pFilter,pstart,pstop,wStartCookie,wStopCookie) \ - (This)->lpVtbl -> ControlStream(This,pCategory,pType,pFilter,pstart,pstop,wStartCookie,wStopCookie) - -#define ICaptureGraphBuilder2_AllocCapFile(This,lpstr,dwlSize) \ - (This)->lpVtbl -> AllocCapFile(This,lpstr,dwlSize) - -#define ICaptureGraphBuilder2_CopyCaptureFile(This,lpwstrOld,lpwstrNew,fAllowEscAbort,pCallback) \ - (This)->lpVtbl -> CopyCaptureFile(This,lpwstrOld,lpwstrNew,fAllowEscAbort,pCallback) - -#define ICaptureGraphBuilder2_FindPin(This,pSource,pindir,pCategory,pType,fUnconnected,num,ppPin) \ - (This)->lpVtbl -> FindPin(This,pSource,pindir,pCategory,pType,fUnconnected,num,ppPin) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_SetFiltergraph_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ IGraphBuilder *pfg); - - -void __RPC_STUB ICaptureGraphBuilder2_SetFiltergraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_GetFiltergraph_Proxy( - ICaptureGraphBuilder2 * This, - /* [out] */ IGraphBuilder **ppfg); - - -void __RPC_STUB ICaptureGraphBuilder2_GetFiltergraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_SetOutputFileName_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pType, - /* [in] */ LPCOLESTR lpstrFile, - /* [out] */ IBaseFilter **ppf, - /* [out] */ IFileSinkFilter **ppSink); - - -void __RPC_STUB ICaptureGraphBuilder2_SetOutputFileName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_RemoteFindInterface_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ IUnknown **ppint); - - -void __RPC_STUB ICaptureGraphBuilder2_RemoteFindInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_RenderStream_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IUnknown *pSource, - /* [in] */ IBaseFilter *pfCompressor, - /* [in] */ IBaseFilter *pfRenderer); - - -void __RPC_STUB ICaptureGraphBuilder2_RenderStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_ControlStream_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ REFERENCE_TIME *pstart, - /* [in] */ REFERENCE_TIME *pstop, - /* [in] */ WORD wStartCookie, - /* [in] */ WORD wStopCookie); - - -void __RPC_STUB ICaptureGraphBuilder2_ControlStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_AllocCapFile_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ LPCOLESTR lpstr, - /* [in] */ DWORDLONG dwlSize); - - -void __RPC_STUB ICaptureGraphBuilder2_AllocCapFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_CopyCaptureFile_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ LPOLESTR lpwstrOld, - /* [in] */ LPOLESTR lpwstrNew, - /* [in] */ int fAllowEscAbort, - /* [in] */ IAMCopyCaptureFileProgress *pCallback); - - -void __RPC_STUB ICaptureGraphBuilder2_CopyCaptureFile_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_FindPin_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ IUnknown *pSource, - /* [in] */ PIN_DIRECTION pindir, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ BOOL fUnconnected, - /* [in] */ int num, - /* [out] */ IPin **ppPin); - - -void __RPC_STUB ICaptureGraphBuilder2_FindPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ICaptureGraphBuilder2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0148 */ -/* [local] */ - - -enum _AM_RENSDEREXFLAGS - { AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0148_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0148_v0_0_s_ifspec; - -#ifndef __IFilterGraph2_INTERFACE_DEFINED__ -#define __IFilterGraph2_INTERFACE_DEFINED__ - -/* interface IFilterGraph2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IFilterGraph2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73882-c2c8-11cf-8b46-00805f6cef60") - IFilterGraph2 : public IGraphBuilder - { - public: - virtual HRESULT STDMETHODCALLTYPE AddSourceFilterForMoniker( - /* [in] */ IMoniker *pMoniker, - /* [in] */ IBindCtx *pCtx, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReconnectEx( - /* [in] */ IPin *ppin, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderEx( - /* [in] */ IPin *pPinOut, - /* [in] */ DWORD dwFlags, - /* [out][in] */ DWORD *pvContext) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterGraph2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterGraph2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterGraph2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterGraph2 * This); - - HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IFilterGraph2 * This, - /* [in] */ IBaseFilter *pFilter, - /* [string][in] */ LPCWSTR pName); - - HRESULT ( STDMETHODCALLTYPE *RemoveFilter )( - IFilterGraph2 * This, - /* [in] */ IBaseFilter *pFilter); - - HRESULT ( STDMETHODCALLTYPE *EnumFilters )( - IFilterGraph2 * This, - /* [out] */ IEnumFilters **ppEnum); - - HRESULT ( STDMETHODCALLTYPE *FindFilterByName )( - IFilterGraph2 * This, - /* [string][in] */ LPCWSTR pName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *ConnectDirect )( - IFilterGraph2 * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *Reconnect )( - IFilterGraph2 * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *Disconnect )( - IFilterGraph2 * This, - /* [in] */ IPin *ppin); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultSyncSource )( - IFilterGraph2 * This); - - HRESULT ( STDMETHODCALLTYPE *Connect )( - IFilterGraph2 * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IPin *ppinIn); - - HRESULT ( STDMETHODCALLTYPE *Render )( - IFilterGraph2 * This, - /* [in] */ IPin *ppinOut); - - HRESULT ( STDMETHODCALLTYPE *RenderFile )( - IFilterGraph2 * This, - /* [in] */ LPCWSTR lpcwstrFile, - /* [unique][in] */ LPCWSTR lpcwstrPlayList); - - HRESULT ( STDMETHODCALLTYPE *AddSourceFilter )( - IFilterGraph2 * This, - /* [in] */ LPCWSTR lpcwstrFileName, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *SetLogFile )( - IFilterGraph2 * This, - /* [in] */ DWORD_PTR hFile); - - HRESULT ( STDMETHODCALLTYPE *Abort )( - IFilterGraph2 * This); - - HRESULT ( STDMETHODCALLTYPE *ShouldOperationContinue )( - IFilterGraph2 * This); - - HRESULT ( STDMETHODCALLTYPE *AddSourceFilterForMoniker )( - IFilterGraph2 * This, - /* [in] */ IMoniker *pMoniker, - /* [in] */ IBindCtx *pCtx, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter); - - HRESULT ( STDMETHODCALLTYPE *ReconnectEx )( - IFilterGraph2 * This, - /* [in] */ IPin *ppin, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *RenderEx )( - IFilterGraph2 * This, - /* [in] */ IPin *pPinOut, - /* [in] */ DWORD dwFlags, - /* [out][in] */ DWORD *pvContext); - - END_INTERFACE - } IFilterGraph2Vtbl; - - interface IFilterGraph2 - { - CONST_VTBL struct IFilterGraph2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterGraph2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterGraph2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterGraph2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterGraph2_AddFilter(This,pFilter,pName) \ - (This)->lpVtbl -> AddFilter(This,pFilter,pName) - -#define IFilterGraph2_RemoveFilter(This,pFilter) \ - (This)->lpVtbl -> RemoveFilter(This,pFilter) - -#define IFilterGraph2_EnumFilters(This,ppEnum) \ - (This)->lpVtbl -> EnumFilters(This,ppEnum) - -#define IFilterGraph2_FindFilterByName(This,pName,ppFilter) \ - (This)->lpVtbl -> FindFilterByName(This,pName,ppFilter) - -#define IFilterGraph2_ConnectDirect(This,ppinOut,ppinIn,pmt) \ - (This)->lpVtbl -> ConnectDirect(This,ppinOut,ppinIn,pmt) - -#define IFilterGraph2_Reconnect(This,ppin) \ - (This)->lpVtbl -> Reconnect(This,ppin) - -#define IFilterGraph2_Disconnect(This,ppin) \ - (This)->lpVtbl -> Disconnect(This,ppin) - -#define IFilterGraph2_SetDefaultSyncSource(This) \ - (This)->lpVtbl -> SetDefaultSyncSource(This) - - -#define IFilterGraph2_Connect(This,ppinOut,ppinIn) \ - (This)->lpVtbl -> Connect(This,ppinOut,ppinIn) - -#define IFilterGraph2_Render(This,ppinOut) \ - (This)->lpVtbl -> Render(This,ppinOut) - -#define IFilterGraph2_RenderFile(This,lpcwstrFile,lpcwstrPlayList) \ - (This)->lpVtbl -> RenderFile(This,lpcwstrFile,lpcwstrPlayList) - -#define IFilterGraph2_AddSourceFilter(This,lpcwstrFileName,lpcwstrFilterName,ppFilter) \ - (This)->lpVtbl -> AddSourceFilter(This,lpcwstrFileName,lpcwstrFilterName,ppFilter) - -#define IFilterGraph2_SetLogFile(This,hFile) \ - (This)->lpVtbl -> SetLogFile(This,hFile) - -#define IFilterGraph2_Abort(This) \ - (This)->lpVtbl -> Abort(This) - -#define IFilterGraph2_ShouldOperationContinue(This) \ - (This)->lpVtbl -> ShouldOperationContinue(This) - - -#define IFilterGraph2_AddSourceFilterForMoniker(This,pMoniker,pCtx,lpcwstrFilterName,ppFilter) \ - (This)->lpVtbl -> AddSourceFilterForMoniker(This,pMoniker,pCtx,lpcwstrFilterName,ppFilter) - -#define IFilterGraph2_ReconnectEx(This,ppin,pmt) \ - (This)->lpVtbl -> ReconnectEx(This,ppin,pmt) - -#define IFilterGraph2_RenderEx(This,pPinOut,dwFlags,pvContext) \ - (This)->lpVtbl -> RenderEx(This,pPinOut,dwFlags,pvContext) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterGraph2_AddSourceFilterForMoniker_Proxy( - IFilterGraph2 * This, - /* [in] */ IMoniker *pMoniker, - /* [in] */ IBindCtx *pCtx, - /* [unique][in] */ LPCWSTR lpcwstrFilterName, - /* [out] */ IBaseFilter **ppFilter); - - -void __RPC_STUB IFilterGraph2_AddSourceFilterForMoniker_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph2_ReconnectEx_Proxy( - IFilterGraph2 * This, - /* [in] */ IPin *ppin, - /* [unique][in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IFilterGraph2_ReconnectEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterGraph2_RenderEx_Proxy( - IFilterGraph2 * This, - /* [in] */ IPin *pPinOut, - /* [in] */ DWORD dwFlags, - /* [out][in] */ DWORD *pvContext); - - -void __RPC_STUB IFilterGraph2_RenderEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterGraph2_INTERFACE_DEFINED__ */ - - -#ifndef __IStreamBuilder_INTERFACE_DEFINED__ -#define __IStreamBuilder_INTERFACE_DEFINED__ - -/* interface IStreamBuilder */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IStreamBuilder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868bf-0ad4-11ce-b03a-0020af0ba770") - IStreamBuilder : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Render( - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph) = 0; - - virtual HRESULT STDMETHODCALLTYPE Backout( - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph) = 0; - - }; - -#else /* C style interface */ - - typedef struct IStreamBuilderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IStreamBuilder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IStreamBuilder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IStreamBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *Render )( - IStreamBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph); - - HRESULT ( STDMETHODCALLTYPE *Backout )( - IStreamBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph); - - END_INTERFACE - } IStreamBuilderVtbl; - - interface IStreamBuilder - { - CONST_VTBL struct IStreamBuilderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IStreamBuilder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IStreamBuilder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IStreamBuilder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IStreamBuilder_Render(This,ppinOut,pGraph) \ - (This)->lpVtbl -> Render(This,ppinOut,pGraph) - -#define IStreamBuilder_Backout(This,ppinOut,pGraph) \ - (This)->lpVtbl -> Backout(This,ppinOut,pGraph) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IStreamBuilder_Render_Proxy( - IStreamBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph); - - -void __RPC_STUB IStreamBuilder_Render_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IStreamBuilder_Backout_Proxy( - IStreamBuilder * This, - /* [in] */ IPin *ppinOut, - /* [in] */ IGraphBuilder *pGraph); - - -void __RPC_STUB IStreamBuilder_Backout_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IStreamBuilder_INTERFACE_DEFINED__ */ - - -#ifndef __IAsyncReader_INTERFACE_DEFINED__ -#define __IAsyncReader_INTERFACE_DEFINED__ - -/* interface IAsyncReader */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAsyncReader; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868aa-0ad4-11ce-b03a-0020af0ba770") - IAsyncReader : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RequestAllocator( - /* [in] */ IMemAllocator *pPreferred, - /* [in] */ ALLOCATOR_PROPERTIES *pProps, - /* [out] */ IMemAllocator **ppActual) = 0; - - virtual HRESULT STDMETHODCALLTYPE Request( - /* [in] */ IMediaSample *pSample, - /* [in] */ DWORD_PTR dwUser) = 0; - - virtual HRESULT STDMETHODCALLTYPE WaitForNext( - /* [in] */ DWORD dwTimeout, - /* [out] */ IMediaSample **ppSample, - /* [out] */ DWORD_PTR *pdwUser) = 0; - - virtual HRESULT STDMETHODCALLTYPE SyncReadAligned( - /* [in] */ IMediaSample *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE SyncRead( - /* [in] */ LONGLONG llPosition, - /* [in] */ LONG lLength, - /* [size_is][out] */ BYTE *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE Length( - /* [out] */ LONGLONG *pTotal, - /* [out] */ LONGLONG *pAvailable) = 0; - - virtual HRESULT STDMETHODCALLTYPE BeginFlush( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndFlush( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAsyncReaderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAsyncReader * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAsyncReader * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAsyncReader * This); - - HRESULT ( STDMETHODCALLTYPE *RequestAllocator )( - IAsyncReader * This, - /* [in] */ IMemAllocator *pPreferred, - /* [in] */ ALLOCATOR_PROPERTIES *pProps, - /* [out] */ IMemAllocator **ppActual); - - HRESULT ( STDMETHODCALLTYPE *Request )( - IAsyncReader * This, - /* [in] */ IMediaSample *pSample, - /* [in] */ DWORD_PTR dwUser); - - HRESULT ( STDMETHODCALLTYPE *WaitForNext )( - IAsyncReader * This, - /* [in] */ DWORD dwTimeout, - /* [out] */ IMediaSample **ppSample, - /* [out] */ DWORD_PTR *pdwUser); - - HRESULT ( STDMETHODCALLTYPE *SyncReadAligned )( - IAsyncReader * This, - /* [in] */ IMediaSample *pSample); - - HRESULT ( STDMETHODCALLTYPE *SyncRead )( - IAsyncReader * This, - /* [in] */ LONGLONG llPosition, - /* [in] */ LONG lLength, - /* [size_is][out] */ BYTE *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *Length )( - IAsyncReader * This, - /* [out] */ LONGLONG *pTotal, - /* [out] */ LONGLONG *pAvailable); - - HRESULT ( STDMETHODCALLTYPE *BeginFlush )( - IAsyncReader * This); - - HRESULT ( STDMETHODCALLTYPE *EndFlush )( - IAsyncReader * This); - - END_INTERFACE - } IAsyncReaderVtbl; - - interface IAsyncReader - { - CONST_VTBL struct IAsyncReaderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAsyncReader_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAsyncReader_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAsyncReader_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAsyncReader_RequestAllocator(This,pPreferred,pProps,ppActual) \ - (This)->lpVtbl -> RequestAllocator(This,pPreferred,pProps,ppActual) - -#define IAsyncReader_Request(This,pSample,dwUser) \ - (This)->lpVtbl -> Request(This,pSample,dwUser) - -#define IAsyncReader_WaitForNext(This,dwTimeout,ppSample,pdwUser) \ - (This)->lpVtbl -> WaitForNext(This,dwTimeout,ppSample,pdwUser) - -#define IAsyncReader_SyncReadAligned(This,pSample) \ - (This)->lpVtbl -> SyncReadAligned(This,pSample) - -#define IAsyncReader_SyncRead(This,llPosition,lLength,pBuffer) \ - (This)->lpVtbl -> SyncRead(This,llPosition,lLength,pBuffer) - -#define IAsyncReader_Length(This,pTotal,pAvailable) \ - (This)->lpVtbl -> Length(This,pTotal,pAvailable) - -#define IAsyncReader_BeginFlush(This) \ - (This)->lpVtbl -> BeginFlush(This) - -#define IAsyncReader_EndFlush(This) \ - (This)->lpVtbl -> EndFlush(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAsyncReader_RequestAllocator_Proxy( - IAsyncReader * This, - /* [in] */ IMemAllocator *pPreferred, - /* [in] */ ALLOCATOR_PROPERTIES *pProps, - /* [out] */ IMemAllocator **ppActual); - - -void __RPC_STUB IAsyncReader_RequestAllocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_Request_Proxy( - IAsyncReader * This, - /* [in] */ IMediaSample *pSample, - /* [in] */ DWORD_PTR dwUser); - - -void __RPC_STUB IAsyncReader_Request_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_WaitForNext_Proxy( - IAsyncReader * This, - /* [in] */ DWORD dwTimeout, - /* [out] */ IMediaSample **ppSample, - /* [out] */ DWORD_PTR *pdwUser); - - -void __RPC_STUB IAsyncReader_WaitForNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_SyncReadAligned_Proxy( - IAsyncReader * This, - /* [in] */ IMediaSample *pSample); - - -void __RPC_STUB IAsyncReader_SyncReadAligned_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_SyncRead_Proxy( - IAsyncReader * This, - /* [in] */ LONGLONG llPosition, - /* [in] */ LONG lLength, - /* [size_is][out] */ BYTE *pBuffer); - - -void __RPC_STUB IAsyncReader_SyncRead_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_Length_Proxy( - IAsyncReader * This, - /* [out] */ LONGLONG *pTotal, - /* [out] */ LONGLONG *pAvailable); - - -void __RPC_STUB IAsyncReader_Length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_BeginFlush_Proxy( - IAsyncReader * This); - - -void __RPC_STUB IAsyncReader_BeginFlush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAsyncReader_EndFlush_Proxy( - IAsyncReader * This); - - -void __RPC_STUB IAsyncReader_EndFlush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAsyncReader_INTERFACE_DEFINED__ */ - - -#ifndef __IGraphVersion_INTERFACE_DEFINED__ -#define __IGraphVersion_INTERFACE_DEFINED__ - -/* interface IGraphVersion */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IGraphVersion; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868ab-0ad4-11ce-b03a-0020af0ba770") - IGraphVersion : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryVersion( - LONG *pVersion) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGraphVersionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGraphVersion * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGraphVersion * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGraphVersion * This); - - HRESULT ( STDMETHODCALLTYPE *QueryVersion )( - IGraphVersion * This, - LONG *pVersion); - - END_INTERFACE - } IGraphVersionVtbl; - - interface IGraphVersion - { - CONST_VTBL struct IGraphVersionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGraphVersion_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IGraphVersion_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IGraphVersion_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IGraphVersion_QueryVersion(This,pVersion) \ - (This)->lpVtbl -> QueryVersion(This,pVersion) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IGraphVersion_QueryVersion_Proxy( - IGraphVersion * This, - LONG *pVersion); - - -void __RPC_STUB IGraphVersion_QueryVersion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IGraphVersion_INTERFACE_DEFINED__ */ - - -#ifndef __IResourceConsumer_INTERFACE_DEFINED__ -#define __IResourceConsumer_INTERFACE_DEFINED__ - -/* interface IResourceConsumer */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IResourceConsumer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868ad-0ad4-11ce-b03a-0020af0ba770") - IResourceConsumer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE AcquireResource( - /* [in] */ LONG idResource) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReleaseResource( - /* [in] */ LONG idResource) = 0; - - }; - -#else /* C style interface */ - - typedef struct IResourceConsumerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IResourceConsumer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IResourceConsumer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IResourceConsumer * This); - - HRESULT ( STDMETHODCALLTYPE *AcquireResource )( - IResourceConsumer * This, - /* [in] */ LONG idResource); - - HRESULT ( STDMETHODCALLTYPE *ReleaseResource )( - IResourceConsumer * This, - /* [in] */ LONG idResource); - - END_INTERFACE - } IResourceConsumerVtbl; - - interface IResourceConsumer - { - CONST_VTBL struct IResourceConsumerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IResourceConsumer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IResourceConsumer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IResourceConsumer_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IResourceConsumer_AcquireResource(This,idResource) \ - (This)->lpVtbl -> AcquireResource(This,idResource) - -#define IResourceConsumer_ReleaseResource(This,idResource) \ - (This)->lpVtbl -> ReleaseResource(This,idResource) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IResourceConsumer_AcquireResource_Proxy( - IResourceConsumer * This, - /* [in] */ LONG idResource); - - -void __RPC_STUB IResourceConsumer_AcquireResource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceConsumer_ReleaseResource_Proxy( - IResourceConsumer * This, - /* [in] */ LONG idResource); - - -void __RPC_STUB IResourceConsumer_ReleaseResource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IResourceConsumer_INTERFACE_DEFINED__ */ - - -#ifndef __IResourceManager_INTERFACE_DEFINED__ -#define __IResourceManager_INTERFACE_DEFINED__ - -/* interface IResourceManager */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IResourceManager; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868ac-0ad4-11ce-b03a-0020af0ba770") - IResourceManager : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Register( - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [out] */ LONG *plToken) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterGroup( - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [size_is][in] */ LONG *palTokens, - /* [out] */ LONG *plToken) = 0; - - virtual HRESULT STDMETHODCALLTYPE RequestResource( - /* [in] */ LONG idResource, - /* [in] */ IUnknown *pFocusObject, - /* [in] */ IResourceConsumer *pConsumer) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyAcquire( - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ HRESULT hr) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyRelease( - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ BOOL bStillWant) = 0; - - virtual HRESULT STDMETHODCALLTYPE CancelRequest( - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFocus( - /* [in] */ IUnknown *pFocusObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReleaseFocus( - /* [in] */ IUnknown *pFocusObject) = 0; - - }; - -#else /* C style interface */ - - typedef struct IResourceManagerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IResourceManager * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IResourceManager * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IResourceManager * This); - - HRESULT ( STDMETHODCALLTYPE *Register )( - IResourceManager * This, - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [out] */ LONG *plToken); - - HRESULT ( STDMETHODCALLTYPE *RegisterGroup )( - IResourceManager * This, - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [size_is][in] */ LONG *palTokens, - /* [out] */ LONG *plToken); - - HRESULT ( STDMETHODCALLTYPE *RequestResource )( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IUnknown *pFocusObject, - /* [in] */ IResourceConsumer *pConsumer); - - HRESULT ( STDMETHODCALLTYPE *NotifyAcquire )( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ HRESULT hr); - - HRESULT ( STDMETHODCALLTYPE *NotifyRelease )( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ BOOL bStillWant); - - HRESULT ( STDMETHODCALLTYPE *CancelRequest )( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer); - - HRESULT ( STDMETHODCALLTYPE *SetFocus )( - IResourceManager * This, - /* [in] */ IUnknown *pFocusObject); - - HRESULT ( STDMETHODCALLTYPE *ReleaseFocus )( - IResourceManager * This, - /* [in] */ IUnknown *pFocusObject); - - END_INTERFACE - } IResourceManagerVtbl; - - interface IResourceManager - { - CONST_VTBL struct IResourceManagerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IResourceManager_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IResourceManager_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IResourceManager_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IResourceManager_Register(This,pName,cResource,plToken) \ - (This)->lpVtbl -> Register(This,pName,cResource,plToken) - -#define IResourceManager_RegisterGroup(This,pName,cResource,palTokens,plToken) \ - (This)->lpVtbl -> RegisterGroup(This,pName,cResource,palTokens,plToken) - -#define IResourceManager_RequestResource(This,idResource,pFocusObject,pConsumer) \ - (This)->lpVtbl -> RequestResource(This,idResource,pFocusObject,pConsumer) - -#define IResourceManager_NotifyAcquire(This,idResource,pConsumer,hr) \ - (This)->lpVtbl -> NotifyAcquire(This,idResource,pConsumer,hr) - -#define IResourceManager_NotifyRelease(This,idResource,pConsumer,bStillWant) \ - (This)->lpVtbl -> NotifyRelease(This,idResource,pConsumer,bStillWant) - -#define IResourceManager_CancelRequest(This,idResource,pConsumer) \ - (This)->lpVtbl -> CancelRequest(This,idResource,pConsumer) - -#define IResourceManager_SetFocus(This,pFocusObject) \ - (This)->lpVtbl -> SetFocus(This,pFocusObject) - -#define IResourceManager_ReleaseFocus(This,pFocusObject) \ - (This)->lpVtbl -> ReleaseFocus(This,pFocusObject) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IResourceManager_Register_Proxy( - IResourceManager * This, - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [out] */ LONG *plToken); - - -void __RPC_STUB IResourceManager_Register_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_RegisterGroup_Proxy( - IResourceManager * This, - /* [in] */ LPCWSTR pName, - /* [in] */ LONG cResource, - /* [size_is][in] */ LONG *palTokens, - /* [out] */ LONG *plToken); - - -void __RPC_STUB IResourceManager_RegisterGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_RequestResource_Proxy( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IUnknown *pFocusObject, - /* [in] */ IResourceConsumer *pConsumer); - - -void __RPC_STUB IResourceManager_RequestResource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_NotifyAcquire_Proxy( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ HRESULT hr); - - -void __RPC_STUB IResourceManager_NotifyAcquire_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_NotifyRelease_Proxy( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer, - /* [in] */ BOOL bStillWant); - - -void __RPC_STUB IResourceManager_NotifyRelease_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_CancelRequest_Proxy( - IResourceManager * This, - /* [in] */ LONG idResource, - /* [in] */ IResourceConsumer *pConsumer); - - -void __RPC_STUB IResourceManager_CancelRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_SetFocus_Proxy( - IResourceManager * This, - /* [in] */ IUnknown *pFocusObject); - - -void __RPC_STUB IResourceManager_SetFocus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IResourceManager_ReleaseFocus_Proxy( - IResourceManager * This, - /* [in] */ IUnknown *pFocusObject); - - -void __RPC_STUB IResourceManager_ReleaseFocus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IResourceManager_INTERFACE_DEFINED__ */ - - -#ifndef __IDistributorNotify_INTERFACE_DEFINED__ -#define __IDistributorNotify_INTERFACE_DEFINED__ - -/* interface IDistributorNotify */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDistributorNotify; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56a868af-0ad4-11ce-b03a-0020af0ba770") - IDistributorNotify : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Pause( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Run( - REFERENCE_TIME tStart) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSyncSource( - /* [in] */ IReferenceClock *pClock) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyGraphChange( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDistributorNotifyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDistributorNotify * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDistributorNotify * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDistributorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IDistributorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IDistributorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *Run )( - IDistributorNotify * This, - REFERENCE_TIME tStart); - - HRESULT ( STDMETHODCALLTYPE *SetSyncSource )( - IDistributorNotify * This, - /* [in] */ IReferenceClock *pClock); - - HRESULT ( STDMETHODCALLTYPE *NotifyGraphChange )( - IDistributorNotify * This); - - END_INTERFACE - } IDistributorNotifyVtbl; - - interface IDistributorNotify - { - CONST_VTBL struct IDistributorNotifyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDistributorNotify_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDistributorNotify_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDistributorNotify_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDistributorNotify_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IDistributorNotify_Pause(This) \ - (This)->lpVtbl -> Pause(This) - -#define IDistributorNotify_Run(This,tStart) \ - (This)->lpVtbl -> Run(This,tStart) - -#define IDistributorNotify_SetSyncSource(This,pClock) \ - (This)->lpVtbl -> SetSyncSource(This,pClock) - -#define IDistributorNotify_NotifyGraphChange(This) \ - (This)->lpVtbl -> NotifyGraphChange(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDistributorNotify_Stop_Proxy( - IDistributorNotify * This); - - -void __RPC_STUB IDistributorNotify_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDistributorNotify_Pause_Proxy( - IDistributorNotify * This); - - -void __RPC_STUB IDistributorNotify_Pause_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDistributorNotify_Run_Proxy( - IDistributorNotify * This, - REFERENCE_TIME tStart); - - -void __RPC_STUB IDistributorNotify_Run_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDistributorNotify_SetSyncSource_Proxy( - IDistributorNotify * This, - /* [in] */ IReferenceClock *pClock); - - -void __RPC_STUB IDistributorNotify_SetSyncSource_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDistributorNotify_NotifyGraphChange_Proxy( - IDistributorNotify * This); - - -void __RPC_STUB IDistributorNotify_NotifyGraphChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDistributorNotify_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0155 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0155_0001 - { AM_STREAM_INFO_START_DEFINED = 0x1, - AM_STREAM_INFO_STOP_DEFINED = 0x2, - AM_STREAM_INFO_DISCARDING = 0x4, - AM_STREAM_INFO_STOP_SEND_EXTRA = 0x10 - } AM_STREAM_INFO_FLAGS; - -typedef /* [public][public] */ struct __MIDL___MIDL_itf_strmif_0155_0002 - { - REFERENCE_TIME tStart; - REFERENCE_TIME tStop; - DWORD dwStartCookie; - DWORD dwStopCookie; - DWORD dwFlags; - } AM_STREAM_INFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0155_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0155_v0_0_s_ifspec; - -#ifndef __IAMStreamControl_INTERFACE_DEFINED__ -#define __IAMStreamControl_INTERFACE_DEFINED__ - -/* interface IAMStreamControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMStreamControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73881-c2c8-11cf-8b46-00805f6cef60") - IAMStreamControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE StartAt( - /* [in] */ const REFERENCE_TIME *ptStart, - /* [in] */ DWORD dwCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE StopAt( - /* [in] */ const REFERENCE_TIME *ptStop, - /* [in] */ BOOL bSendExtra, - /* [in] */ DWORD dwCookie) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInfo( - /* [out] */ AM_STREAM_INFO *pInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMStreamControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMStreamControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMStreamControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMStreamControl * This); - - HRESULT ( STDMETHODCALLTYPE *StartAt )( - IAMStreamControl * This, - /* [in] */ const REFERENCE_TIME *ptStart, - /* [in] */ DWORD dwCookie); - - HRESULT ( STDMETHODCALLTYPE *StopAt )( - IAMStreamControl * This, - /* [in] */ const REFERENCE_TIME *ptStop, - /* [in] */ BOOL bSendExtra, - /* [in] */ DWORD dwCookie); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - IAMStreamControl * This, - /* [out] */ AM_STREAM_INFO *pInfo); - - END_INTERFACE - } IAMStreamControlVtbl; - - interface IAMStreamControl - { - CONST_VTBL struct IAMStreamControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMStreamControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMStreamControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMStreamControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMStreamControl_StartAt(This,ptStart,dwCookie) \ - (This)->lpVtbl -> StartAt(This,ptStart,dwCookie) - -#define IAMStreamControl_StopAt(This,ptStop,bSendExtra,dwCookie) \ - (This)->lpVtbl -> StopAt(This,ptStop,bSendExtra,dwCookie) - -#define IAMStreamControl_GetInfo(This,pInfo) \ - (This)->lpVtbl -> GetInfo(This,pInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMStreamControl_StartAt_Proxy( - IAMStreamControl * This, - /* [in] */ const REFERENCE_TIME *ptStart, - /* [in] */ DWORD dwCookie); - - -void __RPC_STUB IAMStreamControl_StartAt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamControl_StopAt_Proxy( - IAMStreamControl * This, - /* [in] */ const REFERENCE_TIME *ptStop, - /* [in] */ BOOL bSendExtra, - /* [in] */ DWORD dwCookie); - - -void __RPC_STUB IAMStreamControl_StopAt_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamControl_GetInfo_Proxy( - IAMStreamControl * This, - /* [out] */ AM_STREAM_INFO *pInfo); - - -void __RPC_STUB IAMStreamControl_GetInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMStreamControl_INTERFACE_DEFINED__ */ - - -#ifndef __ISeekingPassThru_INTERFACE_DEFINED__ -#define __ISeekingPassThru_INTERFACE_DEFINED__ - -/* interface ISeekingPassThru */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_ISeekingPassThru; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36b73883-c2c8-11cf-8b46-00805f6cef60") - ISeekingPassThru : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Init( - /* [in] */ BOOL bSupportRendering, - /* [in] */ IPin *pPin) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISeekingPassThruVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISeekingPassThru * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISeekingPassThru * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISeekingPassThru * This); - - HRESULT ( STDMETHODCALLTYPE *Init )( - ISeekingPassThru * This, - /* [in] */ BOOL bSupportRendering, - /* [in] */ IPin *pPin); - - END_INTERFACE - } ISeekingPassThruVtbl; - - interface ISeekingPassThru - { - CONST_VTBL struct ISeekingPassThruVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISeekingPassThru_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISeekingPassThru_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISeekingPassThru_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISeekingPassThru_Init(This,bSupportRendering,pPin) \ - (This)->lpVtbl -> Init(This,bSupportRendering,pPin) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISeekingPassThru_Init_Proxy( - ISeekingPassThru * This, - /* [in] */ BOOL bSupportRendering, - /* [in] */ IPin *pPin); - - -void __RPC_STUB ISeekingPassThru_Init_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISeekingPassThru_INTERFACE_DEFINED__ */ - - -#ifndef __IAMStreamConfig_INTERFACE_DEFINED__ -#define __IAMStreamConfig_INTERFACE_DEFINED__ - -/* interface IAMStreamConfig */ -/* [unique][uuid][object] */ - -typedef struct _VIDEO_STREAM_CONFIG_CAPS - { - GUID guid; - ULONG VideoStandard; - SIZE InputSize; - SIZE MinCroppingSize; - SIZE MaxCroppingSize; - int CropGranularityX; - int CropGranularityY; - int CropAlignX; - int CropAlignY; - SIZE MinOutputSize; - SIZE MaxOutputSize; - int OutputGranularityX; - int OutputGranularityY; - int StretchTapsX; - int StretchTapsY; - int ShrinkTapsX; - int ShrinkTapsY; - LONGLONG MinFrameInterval; - LONGLONG MaxFrameInterval; - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; - } VIDEO_STREAM_CONFIG_CAPS; - -typedef struct _AUDIO_STREAM_CONFIG_CAPS - { - GUID guid; - ULONG MinimumChannels; - ULONG MaximumChannels; - ULONG ChannelsGranularity; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG BitsPerSampleGranularity; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG SampleFrequencyGranularity; - } AUDIO_STREAM_CONFIG_CAPS; - - -EXTERN_C const IID IID_IAMStreamConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13340-30AC-11d0-A18C-00A0C9118956") - IAMStreamConfig : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFormat( - /* [in] */ AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFormat( - /* [out] */ AM_MEDIA_TYPE **ppmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumberOfCapabilities( - /* [out] */ int *piCount, - /* [out] */ int *piSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStreamCaps( - /* [in] */ int iIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ BYTE *pSCC) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMStreamConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMStreamConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMStreamConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMStreamConfig * This); - - HRESULT ( STDMETHODCALLTYPE *SetFormat )( - IAMStreamConfig * This, - /* [in] */ AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *GetFormat )( - IAMStreamConfig * This, - /* [out] */ AM_MEDIA_TYPE **ppmt); - - HRESULT ( STDMETHODCALLTYPE *GetNumberOfCapabilities )( - IAMStreamConfig * This, - /* [out] */ int *piCount, - /* [out] */ int *piSize); - - HRESULT ( STDMETHODCALLTYPE *GetStreamCaps )( - IAMStreamConfig * This, - /* [in] */ int iIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ BYTE *pSCC); - - END_INTERFACE - } IAMStreamConfigVtbl; - - interface IAMStreamConfig - { - CONST_VTBL struct IAMStreamConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMStreamConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMStreamConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMStreamConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMStreamConfig_SetFormat(This,pmt) \ - (This)->lpVtbl -> SetFormat(This,pmt) - -#define IAMStreamConfig_GetFormat(This,ppmt) \ - (This)->lpVtbl -> GetFormat(This,ppmt) - -#define IAMStreamConfig_GetNumberOfCapabilities(This,piCount,piSize) \ - (This)->lpVtbl -> GetNumberOfCapabilities(This,piCount,piSize) - -#define IAMStreamConfig_GetStreamCaps(This,iIndex,ppmt,pSCC) \ - (This)->lpVtbl -> GetStreamCaps(This,iIndex,ppmt,pSCC) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMStreamConfig_SetFormat_Proxy( - IAMStreamConfig * This, - /* [in] */ AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IAMStreamConfig_SetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamConfig_GetFormat_Proxy( - IAMStreamConfig * This, - /* [out] */ AM_MEDIA_TYPE **ppmt); - - -void __RPC_STUB IAMStreamConfig_GetFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamConfig_GetNumberOfCapabilities_Proxy( - IAMStreamConfig * This, - /* [out] */ int *piCount, - /* [out] */ int *piSize); - - -void __RPC_STUB IAMStreamConfig_GetNumberOfCapabilities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamConfig_GetStreamCaps_Proxy( - IAMStreamConfig * This, - /* [in] */ int iIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ BYTE *pSCC); - - -void __RPC_STUB IAMStreamConfig_GetStreamCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMStreamConfig_INTERFACE_DEFINED__ */ - - -#ifndef __IConfigInterleaving_INTERFACE_DEFINED__ -#define __IConfigInterleaving_INTERFACE_DEFINED__ - -/* interface IConfigInterleaving */ -/* [unique][uuid][object] */ - -typedef /* [public][public][public] */ -enum __MIDL_IConfigInterleaving_0001 - { INTERLEAVE_NONE = 0, - INTERLEAVE_CAPTURE = INTERLEAVE_NONE + 1, - INTERLEAVE_FULL = INTERLEAVE_CAPTURE + 1, - INTERLEAVE_NONE_BUFFERED = INTERLEAVE_FULL + 1 - } InterleavingMode; - - -EXTERN_C const IID IID_IConfigInterleaving; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BEE3D220-157B-11d0-BD23-00A0C911CE86") - IConfigInterleaving : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_Mode( - /* [in] */ InterleavingMode mode) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Mode( - /* [out] */ InterleavingMode *pMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Interleaving( - /* [in] */ const REFERENCE_TIME *prtInterleave, - /* [in] */ const REFERENCE_TIME *prtPreroll) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Interleaving( - /* [out] */ REFERENCE_TIME *prtInterleave, - /* [out] */ REFERENCE_TIME *prtPreroll) = 0; - - }; - -#else /* C style interface */ - - typedef struct IConfigInterleavingVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IConfigInterleaving * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IConfigInterleaving * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IConfigInterleaving * This); - - HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IConfigInterleaving * This, - /* [in] */ InterleavingMode mode); - - HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IConfigInterleaving * This, - /* [out] */ InterleavingMode *pMode); - - HRESULT ( STDMETHODCALLTYPE *put_Interleaving )( - IConfigInterleaving * This, - /* [in] */ const REFERENCE_TIME *prtInterleave, - /* [in] */ const REFERENCE_TIME *prtPreroll); - - HRESULT ( STDMETHODCALLTYPE *get_Interleaving )( - IConfigInterleaving * This, - /* [out] */ REFERENCE_TIME *prtInterleave, - /* [out] */ REFERENCE_TIME *prtPreroll); - - END_INTERFACE - } IConfigInterleavingVtbl; - - interface IConfigInterleaving - { - CONST_VTBL struct IConfigInterleavingVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IConfigInterleaving_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IConfigInterleaving_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IConfigInterleaving_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IConfigInterleaving_put_Mode(This,mode) \ - (This)->lpVtbl -> put_Mode(This,mode) - -#define IConfigInterleaving_get_Mode(This,pMode) \ - (This)->lpVtbl -> get_Mode(This,pMode) - -#define IConfigInterleaving_put_Interleaving(This,prtInterleave,prtPreroll) \ - (This)->lpVtbl -> put_Interleaving(This,prtInterleave,prtPreroll) - -#define IConfigInterleaving_get_Interleaving(This,prtInterleave,prtPreroll) \ - (This)->lpVtbl -> get_Interleaving(This,prtInterleave,prtPreroll) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IConfigInterleaving_put_Mode_Proxy( - IConfigInterleaving * This, - /* [in] */ InterleavingMode mode); - - -void __RPC_STUB IConfigInterleaving_put_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigInterleaving_get_Mode_Proxy( - IConfigInterleaving * This, - /* [out] */ InterleavingMode *pMode); - - -void __RPC_STUB IConfigInterleaving_get_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigInterleaving_put_Interleaving_Proxy( - IConfigInterleaving * This, - /* [in] */ const REFERENCE_TIME *prtInterleave, - /* [in] */ const REFERENCE_TIME *prtPreroll); - - -void __RPC_STUB IConfigInterleaving_put_Interleaving_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigInterleaving_get_Interleaving_Proxy( - IConfigInterleaving * This, - /* [out] */ REFERENCE_TIME *prtInterleave, - /* [out] */ REFERENCE_TIME *prtPreroll); - - -void __RPC_STUB IConfigInterleaving_get_Interleaving_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IConfigInterleaving_INTERFACE_DEFINED__ */ - - -#ifndef __IConfigAviMux_INTERFACE_DEFINED__ -#define __IConfigAviMux_INTERFACE_DEFINED__ - -/* interface IConfigAviMux */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IConfigAviMux; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6") - IConfigAviMux : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetMasterStream( - /* [in] */ LONG iStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMasterStream( - /* [out] */ LONG *pStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputCompatibilityIndex( - /* [in] */ BOOL fOldIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputCompatibilityIndex( - /* [out] */ BOOL *pfOldIndex) = 0; - - }; - -#else /* C style interface */ - - typedef struct IConfigAviMuxVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IConfigAviMux * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IConfigAviMux * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IConfigAviMux * This); - - HRESULT ( STDMETHODCALLTYPE *SetMasterStream )( - IConfigAviMux * This, - /* [in] */ LONG iStream); - - HRESULT ( STDMETHODCALLTYPE *GetMasterStream )( - IConfigAviMux * This, - /* [out] */ LONG *pStream); - - HRESULT ( STDMETHODCALLTYPE *SetOutputCompatibilityIndex )( - IConfigAviMux * This, - /* [in] */ BOOL fOldIndex); - - HRESULT ( STDMETHODCALLTYPE *GetOutputCompatibilityIndex )( - IConfigAviMux * This, - /* [out] */ BOOL *pfOldIndex); - - END_INTERFACE - } IConfigAviMuxVtbl; - - interface IConfigAviMux - { - CONST_VTBL struct IConfigAviMuxVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IConfigAviMux_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IConfigAviMux_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IConfigAviMux_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IConfigAviMux_SetMasterStream(This,iStream) \ - (This)->lpVtbl -> SetMasterStream(This,iStream) - -#define IConfigAviMux_GetMasterStream(This,pStream) \ - (This)->lpVtbl -> GetMasterStream(This,pStream) - -#define IConfigAviMux_SetOutputCompatibilityIndex(This,fOldIndex) \ - (This)->lpVtbl -> SetOutputCompatibilityIndex(This,fOldIndex) - -#define IConfigAviMux_GetOutputCompatibilityIndex(This,pfOldIndex) \ - (This)->lpVtbl -> GetOutputCompatibilityIndex(This,pfOldIndex) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IConfigAviMux_SetMasterStream_Proxy( - IConfigAviMux * This, - /* [in] */ LONG iStream); - - -void __RPC_STUB IConfigAviMux_SetMasterStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAviMux_GetMasterStream_Proxy( - IConfigAviMux * This, - /* [out] */ LONG *pStream); - - -void __RPC_STUB IConfigAviMux_GetMasterStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAviMux_SetOutputCompatibilityIndex_Proxy( - IConfigAviMux * This, - /* [in] */ BOOL fOldIndex); - - -void __RPC_STUB IConfigAviMux_SetOutputCompatibilityIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IConfigAviMux_GetOutputCompatibilityIndex_Proxy( - IConfigAviMux * This, - /* [out] */ BOOL *pfOldIndex); - - -void __RPC_STUB IConfigAviMux_GetOutputCompatibilityIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IConfigAviMux_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0162 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0162_0001 - { CompressionCaps_CanQuality = 0x1, - CompressionCaps_CanCrunch = 0x2, - CompressionCaps_CanKeyFrame = 0x4, - CompressionCaps_CanBFrame = 0x8, - CompressionCaps_CanWindow = 0x10 - } CompressionCaps; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0162_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0162_v0_0_s_ifspec; - -#ifndef __IAMVideoCompression_INTERFACE_DEFINED__ -#define __IAMVideoCompression_INTERFACE_DEFINED__ - -/* interface IAMVideoCompression */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMVideoCompression; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13343-30AC-11d0-A18C-00A0C9118956") - IAMVideoCompression : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_KeyFrameRate( - /* [in] */ long KeyFrameRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_KeyFrameRate( - /* [out] */ long *pKeyFrameRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_PFramesPerKeyFrame( - /* [in] */ long PFramesPerKeyFrame) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_PFramesPerKeyFrame( - /* [out] */ long *pPFramesPerKeyFrame) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Quality( - /* [in] */ double Quality) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Quality( - /* [out] */ double *pQuality) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_WindowSize( - /* [in] */ DWORDLONG WindowSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_WindowSize( - /* [out] */ DWORDLONG *pWindowSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInfo( - /* [size_is][out] */ WCHAR *pszVersion, - /* [out][in] */ int *pcbVersion, - /* [size_is][out] */ LPWSTR pszDescription, - /* [out][in] */ int *pcbDescription, - /* [out] */ long *pDefaultKeyFrameRate, - /* [out] */ long *pDefaultPFramesPerKey, - /* [out] */ double *pDefaultQuality, - /* [out] */ long *pCapabilities) = 0; - - virtual HRESULT STDMETHODCALLTYPE OverrideKeyFrame( - /* [in] */ long FrameNumber) = 0; - - virtual HRESULT STDMETHODCALLTYPE OverrideFrameSize( - /* [in] */ long FrameNumber, - /* [in] */ long Size) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoCompressionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoCompression * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoCompression * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoCompression * This); - - HRESULT ( STDMETHODCALLTYPE *put_KeyFrameRate )( - IAMVideoCompression * This, - /* [in] */ long KeyFrameRate); - - HRESULT ( STDMETHODCALLTYPE *get_KeyFrameRate )( - IAMVideoCompression * This, - /* [out] */ long *pKeyFrameRate); - - HRESULT ( STDMETHODCALLTYPE *put_PFramesPerKeyFrame )( - IAMVideoCompression * This, - /* [in] */ long PFramesPerKeyFrame); - - HRESULT ( STDMETHODCALLTYPE *get_PFramesPerKeyFrame )( - IAMVideoCompression * This, - /* [out] */ long *pPFramesPerKeyFrame); - - HRESULT ( STDMETHODCALLTYPE *put_Quality )( - IAMVideoCompression * This, - /* [in] */ double Quality); - - HRESULT ( STDMETHODCALLTYPE *get_Quality )( - IAMVideoCompression * This, - /* [out] */ double *pQuality); - - HRESULT ( STDMETHODCALLTYPE *put_WindowSize )( - IAMVideoCompression * This, - /* [in] */ DWORDLONG WindowSize); - - HRESULT ( STDMETHODCALLTYPE *get_WindowSize )( - IAMVideoCompression * This, - /* [out] */ DWORDLONG *pWindowSize); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - IAMVideoCompression * This, - /* [size_is][out] */ WCHAR *pszVersion, - /* [out][in] */ int *pcbVersion, - /* [size_is][out] */ LPWSTR pszDescription, - /* [out][in] */ int *pcbDescription, - /* [out] */ long *pDefaultKeyFrameRate, - /* [out] */ long *pDefaultPFramesPerKey, - /* [out] */ double *pDefaultQuality, - /* [out] */ long *pCapabilities); - - HRESULT ( STDMETHODCALLTYPE *OverrideKeyFrame )( - IAMVideoCompression * This, - /* [in] */ long FrameNumber); - - HRESULT ( STDMETHODCALLTYPE *OverrideFrameSize )( - IAMVideoCompression * This, - /* [in] */ long FrameNumber, - /* [in] */ long Size); - - END_INTERFACE - } IAMVideoCompressionVtbl; - - interface IAMVideoCompression - { - CONST_VTBL struct IAMVideoCompressionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoCompression_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoCompression_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoCompression_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoCompression_put_KeyFrameRate(This,KeyFrameRate) \ - (This)->lpVtbl -> put_KeyFrameRate(This,KeyFrameRate) - -#define IAMVideoCompression_get_KeyFrameRate(This,pKeyFrameRate) \ - (This)->lpVtbl -> get_KeyFrameRate(This,pKeyFrameRate) - -#define IAMVideoCompression_put_PFramesPerKeyFrame(This,PFramesPerKeyFrame) \ - (This)->lpVtbl -> put_PFramesPerKeyFrame(This,PFramesPerKeyFrame) - -#define IAMVideoCompression_get_PFramesPerKeyFrame(This,pPFramesPerKeyFrame) \ - (This)->lpVtbl -> get_PFramesPerKeyFrame(This,pPFramesPerKeyFrame) - -#define IAMVideoCompression_put_Quality(This,Quality) \ - (This)->lpVtbl -> put_Quality(This,Quality) - -#define IAMVideoCompression_get_Quality(This,pQuality) \ - (This)->lpVtbl -> get_Quality(This,pQuality) - -#define IAMVideoCompression_put_WindowSize(This,WindowSize) \ - (This)->lpVtbl -> put_WindowSize(This,WindowSize) - -#define IAMVideoCompression_get_WindowSize(This,pWindowSize) \ - (This)->lpVtbl -> get_WindowSize(This,pWindowSize) - -#define IAMVideoCompression_GetInfo(This,pszVersion,pcbVersion,pszDescription,pcbDescription,pDefaultKeyFrameRate,pDefaultPFramesPerKey,pDefaultQuality,pCapabilities) \ - (This)->lpVtbl -> GetInfo(This,pszVersion,pcbVersion,pszDescription,pcbDescription,pDefaultKeyFrameRate,pDefaultPFramesPerKey,pDefaultQuality,pCapabilities) - -#define IAMVideoCompression_OverrideKeyFrame(This,FrameNumber) \ - (This)->lpVtbl -> OverrideKeyFrame(This,FrameNumber) - -#define IAMVideoCompression_OverrideFrameSize(This,FrameNumber,Size) \ - (This)->lpVtbl -> OverrideFrameSize(This,FrameNumber,Size) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_put_KeyFrameRate_Proxy( - IAMVideoCompression * This, - /* [in] */ long KeyFrameRate); - - -void __RPC_STUB IAMVideoCompression_put_KeyFrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_get_KeyFrameRate_Proxy( - IAMVideoCompression * This, - /* [out] */ long *pKeyFrameRate); - - -void __RPC_STUB IAMVideoCompression_get_KeyFrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_put_PFramesPerKeyFrame_Proxy( - IAMVideoCompression * This, - /* [in] */ long PFramesPerKeyFrame); - - -void __RPC_STUB IAMVideoCompression_put_PFramesPerKeyFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_get_PFramesPerKeyFrame_Proxy( - IAMVideoCompression * This, - /* [out] */ long *pPFramesPerKeyFrame); - - -void __RPC_STUB IAMVideoCompression_get_PFramesPerKeyFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_put_Quality_Proxy( - IAMVideoCompression * This, - /* [in] */ double Quality); - - -void __RPC_STUB IAMVideoCompression_put_Quality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_get_Quality_Proxy( - IAMVideoCompression * This, - /* [out] */ double *pQuality); - - -void __RPC_STUB IAMVideoCompression_get_Quality_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_put_WindowSize_Proxy( - IAMVideoCompression * This, - /* [in] */ DWORDLONG WindowSize); - - -void __RPC_STUB IAMVideoCompression_put_WindowSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_get_WindowSize_Proxy( - IAMVideoCompression * This, - /* [out] */ DWORDLONG *pWindowSize); - - -void __RPC_STUB IAMVideoCompression_get_WindowSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_GetInfo_Proxy( - IAMVideoCompression * This, - /* [size_is][out] */ WCHAR *pszVersion, - /* [out][in] */ int *pcbVersion, - /* [size_is][out] */ LPWSTR pszDescription, - /* [out][in] */ int *pcbDescription, - /* [out] */ long *pDefaultKeyFrameRate, - /* [out] */ long *pDefaultPFramesPerKey, - /* [out] */ double *pDefaultQuality, - /* [out] */ long *pCapabilities); - - -void __RPC_STUB IAMVideoCompression_GetInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_OverrideKeyFrame_Proxy( - IAMVideoCompression * This, - /* [in] */ long FrameNumber); - - -void __RPC_STUB IAMVideoCompression_OverrideKeyFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoCompression_OverrideFrameSize_Proxy( - IAMVideoCompression * This, - /* [in] */ long FrameNumber, - /* [in] */ long Size); - - -void __RPC_STUB IAMVideoCompression_OverrideFrameSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoCompression_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0163 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0163_0001 - { VfwCaptureDialog_Source = 0x1, - VfwCaptureDialog_Format = 0x2, - VfwCaptureDialog_Display = 0x4 - } VfwCaptureDialogs; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0163_0002 - { VfwCompressDialog_Config = 0x1, - VfwCompressDialog_About = 0x2, - VfwCompressDialog_QueryConfig = 0x4, - VfwCompressDialog_QueryAbout = 0x8 - } VfwCompressDialogs; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0163_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0163_v0_0_s_ifspec; - -#ifndef __IAMVfwCaptureDialogs_INTERFACE_DEFINED__ -#define __IAMVfwCaptureDialogs_INTERFACE_DEFINED__ - -/* interface IAMVfwCaptureDialogs */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMVfwCaptureDialogs; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D8D715A0-6E5E-11D0-B3F0-00AA003761C5") - IAMVfwCaptureDialogs : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE HasDialog( - /* [in] */ int iDialog) = 0; - - virtual HRESULT STDMETHODCALLTYPE ShowDialog( - /* [in] */ int iDialog, - /* [in] */ HWND hwnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendDriverMessage( - /* [in] */ int iDialog, - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVfwCaptureDialogsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVfwCaptureDialogs * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVfwCaptureDialogs * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVfwCaptureDialogs * This); - - HRESULT ( STDMETHODCALLTYPE *HasDialog )( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog); - - HRESULT ( STDMETHODCALLTYPE *ShowDialog )( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog, - /* [in] */ HWND hwnd); - - HRESULT ( STDMETHODCALLTYPE *SendDriverMessage )( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog, - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2); - - END_INTERFACE - } IAMVfwCaptureDialogsVtbl; - - interface IAMVfwCaptureDialogs - { - CONST_VTBL struct IAMVfwCaptureDialogsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVfwCaptureDialogs_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVfwCaptureDialogs_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVfwCaptureDialogs_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVfwCaptureDialogs_HasDialog(This,iDialog) \ - (This)->lpVtbl -> HasDialog(This,iDialog) - -#define IAMVfwCaptureDialogs_ShowDialog(This,iDialog,hwnd) \ - (This)->lpVtbl -> ShowDialog(This,iDialog,hwnd) - -#define IAMVfwCaptureDialogs_SendDriverMessage(This,iDialog,uMsg,dw1,dw2) \ - (This)->lpVtbl -> SendDriverMessage(This,iDialog,uMsg,dw1,dw2) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVfwCaptureDialogs_HasDialog_Proxy( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog); - - -void __RPC_STUB IAMVfwCaptureDialogs_HasDialog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVfwCaptureDialogs_ShowDialog_Proxy( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog, - /* [in] */ HWND hwnd); - - -void __RPC_STUB IAMVfwCaptureDialogs_ShowDialog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVfwCaptureDialogs_SendDriverMessage_Proxy( - IAMVfwCaptureDialogs * This, - /* [in] */ int iDialog, - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2); - - -void __RPC_STUB IAMVfwCaptureDialogs_SendDriverMessage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVfwCaptureDialogs_INTERFACE_DEFINED__ */ - - -#ifndef __IAMVfwCompressDialogs_INTERFACE_DEFINED__ -#define __IAMVfwCompressDialogs_INTERFACE_DEFINED__ - -/* interface IAMVfwCompressDialogs */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMVfwCompressDialogs; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D8D715A3-6E5E-11D0-B3F0-00AA003761C5") - IAMVfwCompressDialogs : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ShowDialog( - /* [in] */ int iDialog, - /* [in] */ HWND hwnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetState( - /* [size_is][out] */ LPVOID pState, - /* [out][in] */ int *pcbState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetState( - /* [size_is][in] */ LPVOID pState, - /* [in] */ int cbState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendDriverMessage( - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVfwCompressDialogsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVfwCompressDialogs * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVfwCompressDialogs * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVfwCompressDialogs * This); - - HRESULT ( STDMETHODCALLTYPE *ShowDialog )( - IAMVfwCompressDialogs * This, - /* [in] */ int iDialog, - /* [in] */ HWND hwnd); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IAMVfwCompressDialogs * This, - /* [size_is][out] */ LPVOID pState, - /* [out][in] */ int *pcbState); - - HRESULT ( STDMETHODCALLTYPE *SetState )( - IAMVfwCompressDialogs * This, - /* [size_is][in] */ LPVOID pState, - /* [in] */ int cbState); - - HRESULT ( STDMETHODCALLTYPE *SendDriverMessage )( - IAMVfwCompressDialogs * This, - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2); - - END_INTERFACE - } IAMVfwCompressDialogsVtbl; - - interface IAMVfwCompressDialogs - { - CONST_VTBL struct IAMVfwCompressDialogsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVfwCompressDialogs_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVfwCompressDialogs_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVfwCompressDialogs_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVfwCompressDialogs_ShowDialog(This,iDialog,hwnd) \ - (This)->lpVtbl -> ShowDialog(This,iDialog,hwnd) - -#define IAMVfwCompressDialogs_GetState(This,pState,pcbState) \ - (This)->lpVtbl -> GetState(This,pState,pcbState) - -#define IAMVfwCompressDialogs_SetState(This,pState,cbState) \ - (This)->lpVtbl -> SetState(This,pState,cbState) - -#define IAMVfwCompressDialogs_SendDriverMessage(This,uMsg,dw1,dw2) \ - (This)->lpVtbl -> SendDriverMessage(This,uMsg,dw1,dw2) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVfwCompressDialogs_ShowDialog_Proxy( - IAMVfwCompressDialogs * This, - /* [in] */ int iDialog, - /* [in] */ HWND hwnd); - - -void __RPC_STUB IAMVfwCompressDialogs_ShowDialog_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVfwCompressDialogs_GetState_Proxy( - IAMVfwCompressDialogs * This, - /* [size_is][out] */ LPVOID pState, - /* [out][in] */ int *pcbState); - - -void __RPC_STUB IAMVfwCompressDialogs_GetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVfwCompressDialogs_SetState_Proxy( - IAMVfwCompressDialogs * This, - /* [size_is][in] */ LPVOID pState, - /* [in] */ int cbState); - - -void __RPC_STUB IAMVfwCompressDialogs_SetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVfwCompressDialogs_SendDriverMessage_Proxy( - IAMVfwCompressDialogs * This, - /* [in] */ int uMsg, - /* [in] */ long dw1, - /* [in] */ long dw2); - - -void __RPC_STUB IAMVfwCompressDialogs_SendDriverMessage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVfwCompressDialogs_INTERFACE_DEFINED__ */ - - -#ifndef __IAMDroppedFrames_INTERFACE_DEFINED__ -#define __IAMDroppedFrames_INTERFACE_DEFINED__ - -/* interface IAMDroppedFrames */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMDroppedFrames; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13344-30AC-11d0-A18C-00A0C9118956") - IAMDroppedFrames : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetNumDropped( - /* [out] */ long *plDropped) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumNotDropped( - /* [out] */ long *plNotDropped) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDroppedInfo( - /* [in] */ long lSize, - /* [out] */ long *plArray, - /* [out] */ long *plNumCopied) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAverageFrameSize( - /* [out] */ long *plAverageSize) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMDroppedFramesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMDroppedFrames * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMDroppedFrames * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMDroppedFrames * This); - - HRESULT ( STDMETHODCALLTYPE *GetNumDropped )( - IAMDroppedFrames * This, - /* [out] */ long *plDropped); - - HRESULT ( STDMETHODCALLTYPE *GetNumNotDropped )( - IAMDroppedFrames * This, - /* [out] */ long *plNotDropped); - - HRESULT ( STDMETHODCALLTYPE *GetDroppedInfo )( - IAMDroppedFrames * This, - /* [in] */ long lSize, - /* [out] */ long *plArray, - /* [out] */ long *plNumCopied); - - HRESULT ( STDMETHODCALLTYPE *GetAverageFrameSize )( - IAMDroppedFrames * This, - /* [out] */ long *plAverageSize); - - END_INTERFACE - } IAMDroppedFramesVtbl; - - interface IAMDroppedFrames - { - CONST_VTBL struct IAMDroppedFramesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMDroppedFrames_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMDroppedFrames_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMDroppedFrames_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMDroppedFrames_GetNumDropped(This,plDropped) \ - (This)->lpVtbl -> GetNumDropped(This,plDropped) - -#define IAMDroppedFrames_GetNumNotDropped(This,plNotDropped) \ - (This)->lpVtbl -> GetNumNotDropped(This,plNotDropped) - -#define IAMDroppedFrames_GetDroppedInfo(This,lSize,plArray,plNumCopied) \ - (This)->lpVtbl -> GetDroppedInfo(This,lSize,plArray,plNumCopied) - -#define IAMDroppedFrames_GetAverageFrameSize(This,plAverageSize) \ - (This)->lpVtbl -> GetAverageFrameSize(This,plAverageSize) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMDroppedFrames_GetNumDropped_Proxy( - IAMDroppedFrames * This, - /* [out] */ long *plDropped); - - -void __RPC_STUB IAMDroppedFrames_GetNumDropped_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDroppedFrames_GetNumNotDropped_Proxy( - IAMDroppedFrames * This, - /* [out] */ long *plNotDropped); - - -void __RPC_STUB IAMDroppedFrames_GetNumNotDropped_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDroppedFrames_GetDroppedInfo_Proxy( - IAMDroppedFrames * This, - /* [in] */ long lSize, - /* [out] */ long *plArray, - /* [out] */ long *plNumCopied); - - -void __RPC_STUB IAMDroppedFrames_GetDroppedInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDroppedFrames_GetAverageFrameSize_Proxy( - IAMDroppedFrames * This, - /* [out] */ long *plAverageSize); - - -void __RPC_STUB IAMDroppedFrames_GetAverageFrameSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMDroppedFrames_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0166 */ -/* [local] */ - -#define AMF_AUTOMATICGAIN -1.0 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0166_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0166_v0_0_s_ifspec; - -#ifndef __IAMAudioInputMixer_INTERFACE_DEFINED__ -#define __IAMAudioInputMixer_INTERFACE_DEFINED__ - -/* interface IAMAudioInputMixer */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMAudioInputMixer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("54C39221-8380-11d0-B3F0-00AA003761C5") - IAMAudioInputMixer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_Enable( - /* [in] */ BOOL fEnable) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Enable( - /* [out] */ BOOL *pfEnable) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Mono( - /* [in] */ BOOL fMono) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Mono( - /* [out] */ BOOL *pfMono) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_MixLevel( - /* [in] */ double Level) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_MixLevel( - /* [out] */ double *pLevel) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Pan( - /* [in] */ double Pan) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Pan( - /* [out] */ double *pPan) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Loudness( - /* [in] */ BOOL fLoudness) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Loudness( - /* [out] */ BOOL *pfLoudness) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Treble( - /* [in] */ double Treble) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Treble( - /* [out] */ double *pTreble) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TrebleRange( - /* [out] */ double *pRange) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Bass( - /* [in] */ double Bass) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Bass( - /* [out] */ double *pBass) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_BassRange( - /* [out] */ double *pRange) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMAudioInputMixerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMAudioInputMixer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMAudioInputMixer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMAudioInputMixer * This); - - HRESULT ( STDMETHODCALLTYPE *put_Enable )( - IAMAudioInputMixer * This, - /* [in] */ BOOL fEnable); - - HRESULT ( STDMETHODCALLTYPE *get_Enable )( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfEnable); - - HRESULT ( STDMETHODCALLTYPE *put_Mono )( - IAMAudioInputMixer * This, - /* [in] */ BOOL fMono); - - HRESULT ( STDMETHODCALLTYPE *get_Mono )( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfMono); - - HRESULT ( STDMETHODCALLTYPE *put_MixLevel )( - IAMAudioInputMixer * This, - /* [in] */ double Level); - - HRESULT ( STDMETHODCALLTYPE *get_MixLevel )( - IAMAudioInputMixer * This, - /* [out] */ double *pLevel); - - HRESULT ( STDMETHODCALLTYPE *put_Pan )( - IAMAudioInputMixer * This, - /* [in] */ double Pan); - - HRESULT ( STDMETHODCALLTYPE *get_Pan )( - IAMAudioInputMixer * This, - /* [out] */ double *pPan); - - HRESULT ( STDMETHODCALLTYPE *put_Loudness )( - IAMAudioInputMixer * This, - /* [in] */ BOOL fLoudness); - - HRESULT ( STDMETHODCALLTYPE *get_Loudness )( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfLoudness); - - HRESULT ( STDMETHODCALLTYPE *put_Treble )( - IAMAudioInputMixer * This, - /* [in] */ double Treble); - - HRESULT ( STDMETHODCALLTYPE *get_Treble )( - IAMAudioInputMixer * This, - /* [out] */ double *pTreble); - - HRESULT ( STDMETHODCALLTYPE *get_TrebleRange )( - IAMAudioInputMixer * This, - /* [out] */ double *pRange); - - HRESULT ( STDMETHODCALLTYPE *put_Bass )( - IAMAudioInputMixer * This, - /* [in] */ double Bass); - - HRESULT ( STDMETHODCALLTYPE *get_Bass )( - IAMAudioInputMixer * This, - /* [out] */ double *pBass); - - HRESULT ( STDMETHODCALLTYPE *get_BassRange )( - IAMAudioInputMixer * This, - /* [out] */ double *pRange); - - END_INTERFACE - } IAMAudioInputMixerVtbl; - - interface IAMAudioInputMixer - { - CONST_VTBL struct IAMAudioInputMixerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMAudioInputMixer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMAudioInputMixer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMAudioInputMixer_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMAudioInputMixer_put_Enable(This,fEnable) \ - (This)->lpVtbl -> put_Enable(This,fEnable) - -#define IAMAudioInputMixer_get_Enable(This,pfEnable) \ - (This)->lpVtbl -> get_Enable(This,pfEnable) - -#define IAMAudioInputMixer_put_Mono(This,fMono) \ - (This)->lpVtbl -> put_Mono(This,fMono) - -#define IAMAudioInputMixer_get_Mono(This,pfMono) \ - (This)->lpVtbl -> get_Mono(This,pfMono) - -#define IAMAudioInputMixer_put_MixLevel(This,Level) \ - (This)->lpVtbl -> put_MixLevel(This,Level) - -#define IAMAudioInputMixer_get_MixLevel(This,pLevel) \ - (This)->lpVtbl -> get_MixLevel(This,pLevel) - -#define IAMAudioInputMixer_put_Pan(This,Pan) \ - (This)->lpVtbl -> put_Pan(This,Pan) - -#define IAMAudioInputMixer_get_Pan(This,pPan) \ - (This)->lpVtbl -> get_Pan(This,pPan) - -#define IAMAudioInputMixer_put_Loudness(This,fLoudness) \ - (This)->lpVtbl -> put_Loudness(This,fLoudness) - -#define IAMAudioInputMixer_get_Loudness(This,pfLoudness) \ - (This)->lpVtbl -> get_Loudness(This,pfLoudness) - -#define IAMAudioInputMixer_put_Treble(This,Treble) \ - (This)->lpVtbl -> put_Treble(This,Treble) - -#define IAMAudioInputMixer_get_Treble(This,pTreble) \ - (This)->lpVtbl -> get_Treble(This,pTreble) - -#define IAMAudioInputMixer_get_TrebleRange(This,pRange) \ - (This)->lpVtbl -> get_TrebleRange(This,pRange) - -#define IAMAudioInputMixer_put_Bass(This,Bass) \ - (This)->lpVtbl -> put_Bass(This,Bass) - -#define IAMAudioInputMixer_get_Bass(This,pBass) \ - (This)->lpVtbl -> get_Bass(This,pBass) - -#define IAMAudioInputMixer_get_BassRange(This,pRange) \ - (This)->lpVtbl -> get_BassRange(This,pRange) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Enable_Proxy( - IAMAudioInputMixer * This, - /* [in] */ BOOL fEnable); - - -void __RPC_STUB IAMAudioInputMixer_put_Enable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Enable_Proxy( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfEnable); - - -void __RPC_STUB IAMAudioInputMixer_get_Enable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Mono_Proxy( - IAMAudioInputMixer * This, - /* [in] */ BOOL fMono); - - -void __RPC_STUB IAMAudioInputMixer_put_Mono_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Mono_Proxy( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfMono); - - -void __RPC_STUB IAMAudioInputMixer_get_Mono_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_MixLevel_Proxy( - IAMAudioInputMixer * This, - /* [in] */ double Level); - - -void __RPC_STUB IAMAudioInputMixer_put_MixLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_MixLevel_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pLevel); - - -void __RPC_STUB IAMAudioInputMixer_get_MixLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Pan_Proxy( - IAMAudioInputMixer * This, - /* [in] */ double Pan); - - -void __RPC_STUB IAMAudioInputMixer_put_Pan_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Pan_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pPan); - - -void __RPC_STUB IAMAudioInputMixer_get_Pan_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Loudness_Proxy( - IAMAudioInputMixer * This, - /* [in] */ BOOL fLoudness); - - -void __RPC_STUB IAMAudioInputMixer_put_Loudness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Loudness_Proxy( - IAMAudioInputMixer * This, - /* [out] */ BOOL *pfLoudness); - - -void __RPC_STUB IAMAudioInputMixer_get_Loudness_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Treble_Proxy( - IAMAudioInputMixer * This, - /* [in] */ double Treble); - - -void __RPC_STUB IAMAudioInputMixer_put_Treble_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Treble_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pTreble); - - -void __RPC_STUB IAMAudioInputMixer_get_Treble_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_TrebleRange_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pRange); - - -void __RPC_STUB IAMAudioInputMixer_get_TrebleRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_put_Bass_Proxy( - IAMAudioInputMixer * This, - /* [in] */ double Bass); - - -void __RPC_STUB IAMAudioInputMixer_put_Bass_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_Bass_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pBass); - - -void __RPC_STUB IAMAudioInputMixer_get_Bass_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAudioInputMixer_get_BassRange_Proxy( - IAMAudioInputMixer * This, - /* [out] */ double *pRange); - - -void __RPC_STUB IAMAudioInputMixer_get_BassRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMAudioInputMixer_INTERFACE_DEFINED__ */ - - -#ifndef __IAMBufferNegotiation_INTERFACE_DEFINED__ -#define __IAMBufferNegotiation_INTERFACE_DEFINED__ - -/* interface IAMBufferNegotiation */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMBufferNegotiation; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("56ED71A0-AF5F-11D0-B3F0-00AA003761C5") - IAMBufferNegotiation : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SuggestAllocatorProperties( - /* [in] */ const ALLOCATOR_PROPERTIES *pprop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllocatorProperties( - /* [out] */ ALLOCATOR_PROPERTIES *pprop) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMBufferNegotiationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMBufferNegotiation * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMBufferNegotiation * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMBufferNegotiation * This); - - HRESULT ( STDMETHODCALLTYPE *SuggestAllocatorProperties )( - IAMBufferNegotiation * This, - /* [in] */ const ALLOCATOR_PROPERTIES *pprop); - - HRESULT ( STDMETHODCALLTYPE *GetAllocatorProperties )( - IAMBufferNegotiation * This, - /* [out] */ ALLOCATOR_PROPERTIES *pprop); - - END_INTERFACE - } IAMBufferNegotiationVtbl; - - interface IAMBufferNegotiation - { - CONST_VTBL struct IAMBufferNegotiationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMBufferNegotiation_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMBufferNegotiation_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMBufferNegotiation_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMBufferNegotiation_SuggestAllocatorProperties(This,pprop) \ - (This)->lpVtbl -> SuggestAllocatorProperties(This,pprop) - -#define IAMBufferNegotiation_GetAllocatorProperties(This,pprop) \ - (This)->lpVtbl -> GetAllocatorProperties(This,pprop) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMBufferNegotiation_SuggestAllocatorProperties_Proxy( - IAMBufferNegotiation * This, - /* [in] */ const ALLOCATOR_PROPERTIES *pprop); - - -void __RPC_STUB IAMBufferNegotiation_SuggestAllocatorProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMBufferNegotiation_GetAllocatorProperties_Proxy( - IAMBufferNegotiation * This, - /* [out] */ ALLOCATOR_PROPERTIES *pprop); - - -void __RPC_STUB IAMBufferNegotiation_GetAllocatorProperties_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMBufferNegotiation_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0168 */ -/* [local] */ - -typedef -enum tagAnalogVideoStandard - { AnalogVideo_None = 0, - AnalogVideo_NTSC_M = 0x1, - AnalogVideo_NTSC_M_J = 0x2, - AnalogVideo_NTSC_433 = 0x4, - AnalogVideo_PAL_B = 0x10, - AnalogVideo_PAL_D = 0x20, - AnalogVideo_PAL_G = 0x40, - AnalogVideo_PAL_H = 0x80, - AnalogVideo_PAL_I = 0x100, - AnalogVideo_PAL_M = 0x200, - AnalogVideo_PAL_N = 0x400, - AnalogVideo_PAL_60 = 0x800, - AnalogVideo_SECAM_B = 0x1000, - AnalogVideo_SECAM_D = 0x2000, - AnalogVideo_SECAM_G = 0x4000, - AnalogVideo_SECAM_H = 0x8000, - AnalogVideo_SECAM_K = 0x10000, - AnalogVideo_SECAM_K1 = 0x20000, - AnalogVideo_SECAM_L = 0x40000, - AnalogVideo_SECAM_L1 = 0x80000, - AnalogVideo_PAL_N_COMBO = 0x100000 - } AnalogVideoStandard; - -#define AnalogVideo_NTSC_Mask 0x00000007 -#define AnalogVideo_PAL_Mask 0x00100FF0 -#define AnalogVideo_SECAM_Mask 0x000FF000 -typedef -enum tagTunerInputType - { TunerInputCable = 0, - TunerInputAntenna = TunerInputCable + 1 - } TunerInputType; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0168_0001 - { VideoCopyProtectionMacrovisionBasic = 0, - VideoCopyProtectionMacrovisionCBI = VideoCopyProtectionMacrovisionBasic + 1 - } VideoCopyProtectionType; - -typedef -enum tagPhysicalConnectorType - { PhysConn_Video_Tuner = 1, - PhysConn_Video_Composite = PhysConn_Video_Tuner + 1, - PhysConn_Video_SVideo = PhysConn_Video_Composite + 1, - PhysConn_Video_RGB = PhysConn_Video_SVideo + 1, - PhysConn_Video_YRYBY = PhysConn_Video_RGB + 1, - PhysConn_Video_SerialDigital = PhysConn_Video_YRYBY + 1, - PhysConn_Video_ParallelDigital = PhysConn_Video_SerialDigital + 1, - PhysConn_Video_SCSI = PhysConn_Video_ParallelDigital + 1, - PhysConn_Video_AUX = PhysConn_Video_SCSI + 1, - PhysConn_Video_1394 = PhysConn_Video_AUX + 1, - PhysConn_Video_USB = PhysConn_Video_1394 + 1, - PhysConn_Video_VideoDecoder = PhysConn_Video_USB + 1, - PhysConn_Video_VideoEncoder = PhysConn_Video_VideoDecoder + 1, - PhysConn_Video_SCART = PhysConn_Video_VideoEncoder + 1, - PhysConn_Video_Black = PhysConn_Video_SCART + 1, - PhysConn_Audio_Tuner = 0x1000, - PhysConn_Audio_Line = PhysConn_Audio_Tuner + 1, - PhysConn_Audio_Mic = PhysConn_Audio_Line + 1, - PhysConn_Audio_AESDigital = PhysConn_Audio_Mic + 1, - PhysConn_Audio_SPDIFDigital = PhysConn_Audio_AESDigital + 1, - PhysConn_Audio_SCSI = PhysConn_Audio_SPDIFDigital + 1, - PhysConn_Audio_AUX = PhysConn_Audio_SCSI + 1, - PhysConn_Audio_1394 = PhysConn_Audio_AUX + 1, - PhysConn_Audio_USB = PhysConn_Audio_1394 + 1, - PhysConn_Audio_AudioDecoder = PhysConn_Audio_USB + 1 - } PhysicalConnectorType; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0168_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0168_v0_0_s_ifspec; - -#ifndef __IAMAnalogVideoDecoder_INTERFACE_DEFINED__ -#define __IAMAnalogVideoDecoder_INTERFACE_DEFINED__ - -/* interface IAMAnalogVideoDecoder */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMAnalogVideoDecoder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13350-30AC-11d0-A18C-00A0C9118956") - IAMAnalogVideoDecoder : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_AvailableTVFormats( - /* [out] */ long *lAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_TVFormat( - /* [in] */ long lAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TVFormat( - /* [out] */ long *plAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_HorizontalLocked( - /* [out] */ long *plLocked) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_VCRHorizontalLocking( - /* [in] */ long lVCRHorizontalLocking) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_VCRHorizontalLocking( - /* [out] */ long *plVCRHorizontalLocking) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_NumberOfLines( - /* [out] */ long *plNumberOfLines) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_OutputEnable( - /* [in] */ long lOutputEnable) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_OutputEnable( - /* [out] */ long *plOutputEnable) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMAnalogVideoDecoderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMAnalogVideoDecoder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMAnalogVideoDecoder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMAnalogVideoDecoder * This); - - HRESULT ( STDMETHODCALLTYPE *get_AvailableTVFormats )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *lAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *put_TVFormat )( - IAMAnalogVideoDecoder * This, - /* [in] */ long lAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *get_TVFormat )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *get_HorizontalLocked )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plLocked); - - HRESULT ( STDMETHODCALLTYPE *put_VCRHorizontalLocking )( - IAMAnalogVideoDecoder * This, - /* [in] */ long lVCRHorizontalLocking); - - HRESULT ( STDMETHODCALLTYPE *get_VCRHorizontalLocking )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plVCRHorizontalLocking); - - HRESULT ( STDMETHODCALLTYPE *get_NumberOfLines )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plNumberOfLines); - - HRESULT ( STDMETHODCALLTYPE *put_OutputEnable )( - IAMAnalogVideoDecoder * This, - /* [in] */ long lOutputEnable); - - HRESULT ( STDMETHODCALLTYPE *get_OutputEnable )( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plOutputEnable); - - END_INTERFACE - } IAMAnalogVideoDecoderVtbl; - - interface IAMAnalogVideoDecoder - { - CONST_VTBL struct IAMAnalogVideoDecoderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMAnalogVideoDecoder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMAnalogVideoDecoder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMAnalogVideoDecoder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMAnalogVideoDecoder_get_AvailableTVFormats(This,lAnalogVideoStandard) \ - (This)->lpVtbl -> get_AvailableTVFormats(This,lAnalogVideoStandard) - -#define IAMAnalogVideoDecoder_put_TVFormat(This,lAnalogVideoStandard) \ - (This)->lpVtbl -> put_TVFormat(This,lAnalogVideoStandard) - -#define IAMAnalogVideoDecoder_get_TVFormat(This,plAnalogVideoStandard) \ - (This)->lpVtbl -> get_TVFormat(This,plAnalogVideoStandard) - -#define IAMAnalogVideoDecoder_get_HorizontalLocked(This,plLocked) \ - (This)->lpVtbl -> get_HorizontalLocked(This,plLocked) - -#define IAMAnalogVideoDecoder_put_VCRHorizontalLocking(This,lVCRHorizontalLocking) \ - (This)->lpVtbl -> put_VCRHorizontalLocking(This,lVCRHorizontalLocking) - -#define IAMAnalogVideoDecoder_get_VCRHorizontalLocking(This,plVCRHorizontalLocking) \ - (This)->lpVtbl -> get_VCRHorizontalLocking(This,plVCRHorizontalLocking) - -#define IAMAnalogVideoDecoder_get_NumberOfLines(This,plNumberOfLines) \ - (This)->lpVtbl -> get_NumberOfLines(This,plNumberOfLines) - -#define IAMAnalogVideoDecoder_put_OutputEnable(This,lOutputEnable) \ - (This)->lpVtbl -> put_OutputEnable(This,lOutputEnable) - -#define IAMAnalogVideoDecoder_get_OutputEnable(This,plOutputEnable) \ - (This)->lpVtbl -> get_OutputEnable(This,plOutputEnable) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_AvailableTVFormats_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *lAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_AvailableTVFormats_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_put_TVFormat_Proxy( - IAMAnalogVideoDecoder * This, - /* [in] */ long lAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoDecoder_put_TVFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_TVFormat_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_TVFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_HorizontalLocked_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plLocked); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_HorizontalLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_put_VCRHorizontalLocking_Proxy( - IAMAnalogVideoDecoder * This, - /* [in] */ long lVCRHorizontalLocking); - - -void __RPC_STUB IAMAnalogVideoDecoder_put_VCRHorizontalLocking_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_VCRHorizontalLocking_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plVCRHorizontalLocking); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_VCRHorizontalLocking_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_NumberOfLines_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plNumberOfLines); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_NumberOfLines_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_put_OutputEnable_Proxy( - IAMAnalogVideoDecoder * This, - /* [in] */ long lOutputEnable); - - -void __RPC_STUB IAMAnalogVideoDecoder_put_OutputEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoDecoder_get_OutputEnable_Proxy( - IAMAnalogVideoDecoder * This, - /* [out] */ long *plOutputEnable); - - -void __RPC_STUB IAMAnalogVideoDecoder_get_OutputEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMAnalogVideoDecoder_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0169 */ -/* [local] */ - -typedef -enum tagVideoProcAmpProperty - { VideoProcAmp_Brightness = 0, - VideoProcAmp_Contrast = VideoProcAmp_Brightness + 1, - VideoProcAmp_Hue = VideoProcAmp_Contrast + 1, - VideoProcAmp_Saturation = VideoProcAmp_Hue + 1, - VideoProcAmp_Sharpness = VideoProcAmp_Saturation + 1, - VideoProcAmp_Gamma = VideoProcAmp_Sharpness + 1, - VideoProcAmp_ColorEnable = VideoProcAmp_Gamma + 1, - VideoProcAmp_WhiteBalance = VideoProcAmp_ColorEnable + 1, - VideoProcAmp_BacklightCompensation = VideoProcAmp_WhiteBalance + 1, - VideoProcAmp_Gain = VideoProcAmp_BacklightCompensation + 1 - } VideoProcAmpProperty; - -typedef -enum tagVideoProcAmpFlags - { VideoProcAmp_Flags_Auto = 0x1, - VideoProcAmp_Flags_Manual = 0x2 - } VideoProcAmpFlags; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0169_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0169_v0_0_s_ifspec; - -#ifndef __IAMVideoProcAmp_INTERFACE_DEFINED__ -#define __IAMVideoProcAmp_INTERFACE_DEFINED__ - -/* interface IAMVideoProcAmp */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMVideoProcAmp; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13360-30AC-11d0-A18C-00A0C9118956") - IAMVideoProcAmp : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetRange( - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Set( - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Get( - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoProcAmpVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoProcAmp * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoProcAmp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoProcAmp * This); - - HRESULT ( STDMETHODCALLTYPE *GetRange )( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags); - - HRESULT ( STDMETHODCALLTYPE *Set )( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags); - - HRESULT ( STDMETHODCALLTYPE *Get )( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags); - - END_INTERFACE - } IAMVideoProcAmpVtbl; - - interface IAMVideoProcAmp - { - CONST_VTBL struct IAMVideoProcAmpVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoProcAmp_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoProcAmp_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoProcAmp_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoProcAmp_GetRange(This,Property,pMin,pMax,pSteppingDelta,pDefault,pCapsFlags) \ - (This)->lpVtbl -> GetRange(This,Property,pMin,pMax,pSteppingDelta,pDefault,pCapsFlags) - -#define IAMVideoProcAmp_Set(This,Property,lValue,Flags) \ - (This)->lpVtbl -> Set(This,Property,lValue,Flags) - -#define IAMVideoProcAmp_Get(This,Property,lValue,Flags) \ - (This)->lpVtbl -> Get(This,Property,lValue,Flags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoProcAmp_GetRange_Proxy( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags); - - -void __RPC_STUB IAMVideoProcAmp_GetRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoProcAmp_Set_Proxy( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags); - - -void __RPC_STUB IAMVideoProcAmp_Set_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoProcAmp_Get_Proxy( - IAMVideoProcAmp * This, - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags); - - -void __RPC_STUB IAMVideoProcAmp_Get_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoProcAmp_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0170 */ -/* [local] */ - -typedef -enum tagCameraControlProperty - { CameraControl_Pan = 0, - CameraControl_Tilt = CameraControl_Pan + 1, - CameraControl_Roll = CameraControl_Tilt + 1, - CameraControl_Zoom = CameraControl_Roll + 1, - CameraControl_Exposure = CameraControl_Zoom + 1, - CameraControl_Iris = CameraControl_Exposure + 1, - CameraControl_Focus = CameraControl_Iris + 1 - } CameraControlProperty; - -typedef -enum tagCameraControlFlags - { CameraControl_Flags_Auto = 0x1, - CameraControl_Flags_Manual = 0x2 - } CameraControlFlags; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0170_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0170_v0_0_s_ifspec; - -#ifndef __IAMCameraControl_INTERFACE_DEFINED__ -#define __IAMCameraControl_INTERFACE_DEFINED__ - -/* interface IAMCameraControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMCameraControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13370-30AC-11d0-A18C-00A0C9118956") - IAMCameraControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetRange( - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Set( - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Get( - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMCameraControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMCameraControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMCameraControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMCameraControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetRange )( - IAMCameraControl * This, - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags); - - HRESULT ( STDMETHODCALLTYPE *Set )( - IAMCameraControl * This, - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags); - - HRESULT ( STDMETHODCALLTYPE *Get )( - IAMCameraControl * This, - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags); - - END_INTERFACE - } IAMCameraControlVtbl; - - interface IAMCameraControl - { - CONST_VTBL struct IAMCameraControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMCameraControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMCameraControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMCameraControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMCameraControl_GetRange(This,Property,pMin,pMax,pSteppingDelta,pDefault,pCapsFlags) \ - (This)->lpVtbl -> GetRange(This,Property,pMin,pMax,pSteppingDelta,pDefault,pCapsFlags) - -#define IAMCameraControl_Set(This,Property,lValue,Flags) \ - (This)->lpVtbl -> Set(This,Property,lValue,Flags) - -#define IAMCameraControl_Get(This,Property,lValue,Flags) \ - (This)->lpVtbl -> Get(This,Property,lValue,Flags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMCameraControl_GetRange_Proxy( - IAMCameraControl * This, - /* [in] */ long Property, - /* [out] */ long *pMin, - /* [out] */ long *pMax, - /* [out] */ long *pSteppingDelta, - /* [out] */ long *pDefault, - /* [out] */ long *pCapsFlags); - - -void __RPC_STUB IAMCameraControl_GetRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCameraControl_Set_Proxy( - IAMCameraControl * This, - /* [in] */ long Property, - /* [in] */ long lValue, - /* [in] */ long Flags); - - -void __RPC_STUB IAMCameraControl_Set_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCameraControl_Get_Proxy( - IAMCameraControl * This, - /* [in] */ long Property, - /* [out] */ long *lValue, - /* [out] */ long *Flags); - - -void __RPC_STUB IAMCameraControl_Get_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMCameraControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0171 */ -/* [local] */ - -typedef -enum tagVideoControlFlags - { VideoControlFlag_FlipHorizontal = 0x1, - VideoControlFlag_FlipVertical = 0x2, - VideoControlFlag_ExternalTriggerEnable = 0x4, - VideoControlFlag_Trigger = 0x8 - } VideoControlFlags; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0171_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0171_v0_0_s_ifspec; - -#ifndef __IAMVideoControl_INTERFACE_DEFINED__ -#define __IAMVideoControl_INTERFACE_DEFINED__ - -/* interface IAMVideoControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMVideoControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6a2e0670-28e4-11d0-a18c-00a0c9118956") - IAMVideoControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCaps( - /* [in] */ IPin *pPin, - /* [out] */ long *pCapsFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMode( - /* [in] */ IPin *pPin, - /* [in] */ long Mode) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMode( - /* [in] */ IPin *pPin, - /* [out] */ long *Mode) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentActualFrameRate( - /* [in] */ IPin *pPin, - /* [out] */ LONGLONG *ActualFrameRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMaxAvailableFrameRate( - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ LONGLONG *MaxAvailableFrameRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFrameRateList( - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ long *ListSize, - /* [out] */ LONGLONG **FrameRates) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetCaps )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ long *pCapsFlags); - - HRESULT ( STDMETHODCALLTYPE *SetMode )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long Mode); - - HRESULT ( STDMETHODCALLTYPE *GetMode )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ long *Mode); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentActualFrameRate )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ LONGLONG *ActualFrameRate); - - HRESULT ( STDMETHODCALLTYPE *GetMaxAvailableFrameRate )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ LONGLONG *MaxAvailableFrameRate); - - HRESULT ( STDMETHODCALLTYPE *GetFrameRateList )( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ long *ListSize, - /* [out] */ LONGLONG **FrameRates); - - END_INTERFACE - } IAMVideoControlVtbl; - - interface IAMVideoControl - { - CONST_VTBL struct IAMVideoControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoControl_GetCaps(This,pPin,pCapsFlags) \ - (This)->lpVtbl -> GetCaps(This,pPin,pCapsFlags) - -#define IAMVideoControl_SetMode(This,pPin,Mode) \ - (This)->lpVtbl -> SetMode(This,pPin,Mode) - -#define IAMVideoControl_GetMode(This,pPin,Mode) \ - (This)->lpVtbl -> GetMode(This,pPin,Mode) - -#define IAMVideoControl_GetCurrentActualFrameRate(This,pPin,ActualFrameRate) \ - (This)->lpVtbl -> GetCurrentActualFrameRate(This,pPin,ActualFrameRate) - -#define IAMVideoControl_GetMaxAvailableFrameRate(This,pPin,iIndex,Dimensions,MaxAvailableFrameRate) \ - (This)->lpVtbl -> GetMaxAvailableFrameRate(This,pPin,iIndex,Dimensions,MaxAvailableFrameRate) - -#define IAMVideoControl_GetFrameRateList(This,pPin,iIndex,Dimensions,ListSize,FrameRates) \ - (This)->lpVtbl -> GetFrameRateList(This,pPin,iIndex,Dimensions,ListSize,FrameRates) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_GetCaps_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ long *pCapsFlags); - - -void __RPC_STUB IAMVideoControl_GetCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_SetMode_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long Mode); - - -void __RPC_STUB IAMVideoControl_SetMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_GetMode_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ long *Mode); - - -void __RPC_STUB IAMVideoControl_GetMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_GetCurrentActualFrameRate_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [out] */ LONGLONG *ActualFrameRate); - - -void __RPC_STUB IAMVideoControl_GetCurrentActualFrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_GetMaxAvailableFrameRate_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ LONGLONG *MaxAvailableFrameRate); - - -void __RPC_STUB IAMVideoControl_GetMaxAvailableFrameRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoControl_GetFrameRateList_Proxy( - IAMVideoControl * This, - /* [in] */ IPin *pPin, - /* [in] */ long iIndex, - /* [in] */ SIZE Dimensions, - /* [out] */ long *ListSize, - /* [out] */ LONGLONG **FrameRates); - - -void __RPC_STUB IAMVideoControl_GetFrameRateList_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoControl_INTERFACE_DEFINED__ */ - - -#ifndef __IAMCrossbar_INTERFACE_DEFINED__ -#define __IAMCrossbar_INTERFACE_DEFINED__ - -/* interface IAMCrossbar */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMCrossbar; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E13380-30AC-11d0-A18C-00A0C9118956") - IAMCrossbar : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_PinCounts( - /* [out] */ long *OutputPinCount, - /* [out] */ long *InputPinCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE CanRoute( - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE Route( - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_IsRoutedTo( - /* [in] */ long OutputPinIndex, - /* [out] */ long *InputPinIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_CrossbarPinInfo( - /* [in] */ BOOL IsInputPin, - /* [in] */ long PinIndex, - /* [out] */ long *PinIndexRelated, - /* [out] */ long *PhysicalType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMCrossbarVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMCrossbar * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMCrossbar * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMCrossbar * This); - - HRESULT ( STDMETHODCALLTYPE *get_PinCounts )( - IAMCrossbar * This, - /* [out] */ long *OutputPinCount, - /* [out] */ long *InputPinCount); - - HRESULT ( STDMETHODCALLTYPE *CanRoute )( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex); - - HRESULT ( STDMETHODCALLTYPE *Route )( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex); - - HRESULT ( STDMETHODCALLTYPE *get_IsRoutedTo )( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [out] */ long *InputPinIndex); - - HRESULT ( STDMETHODCALLTYPE *get_CrossbarPinInfo )( - IAMCrossbar * This, - /* [in] */ BOOL IsInputPin, - /* [in] */ long PinIndex, - /* [out] */ long *PinIndexRelated, - /* [out] */ long *PhysicalType); - - END_INTERFACE - } IAMCrossbarVtbl; - - interface IAMCrossbar - { - CONST_VTBL struct IAMCrossbarVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMCrossbar_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMCrossbar_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMCrossbar_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMCrossbar_get_PinCounts(This,OutputPinCount,InputPinCount) \ - (This)->lpVtbl -> get_PinCounts(This,OutputPinCount,InputPinCount) - -#define IAMCrossbar_CanRoute(This,OutputPinIndex,InputPinIndex) \ - (This)->lpVtbl -> CanRoute(This,OutputPinIndex,InputPinIndex) - -#define IAMCrossbar_Route(This,OutputPinIndex,InputPinIndex) \ - (This)->lpVtbl -> Route(This,OutputPinIndex,InputPinIndex) - -#define IAMCrossbar_get_IsRoutedTo(This,OutputPinIndex,InputPinIndex) \ - (This)->lpVtbl -> get_IsRoutedTo(This,OutputPinIndex,InputPinIndex) - -#define IAMCrossbar_get_CrossbarPinInfo(This,IsInputPin,PinIndex,PinIndexRelated,PhysicalType) \ - (This)->lpVtbl -> get_CrossbarPinInfo(This,IsInputPin,PinIndex,PinIndexRelated,PhysicalType) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMCrossbar_get_PinCounts_Proxy( - IAMCrossbar * This, - /* [out] */ long *OutputPinCount, - /* [out] */ long *InputPinCount); - - -void __RPC_STUB IAMCrossbar_get_PinCounts_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCrossbar_CanRoute_Proxy( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex); - - -void __RPC_STUB IAMCrossbar_CanRoute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCrossbar_Route_Proxy( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [in] */ long InputPinIndex); - - -void __RPC_STUB IAMCrossbar_Route_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCrossbar_get_IsRoutedTo_Proxy( - IAMCrossbar * This, - /* [in] */ long OutputPinIndex, - /* [out] */ long *InputPinIndex); - - -void __RPC_STUB IAMCrossbar_get_IsRoutedTo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMCrossbar_get_CrossbarPinInfo_Proxy( - IAMCrossbar * This, - /* [in] */ BOOL IsInputPin, - /* [in] */ long PinIndex, - /* [out] */ long *PinIndexRelated, - /* [out] */ long *PhysicalType); - - -void __RPC_STUB IAMCrossbar_get_CrossbarPinInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMCrossbar_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0173 */ -/* [local] */ - -typedef -enum tagAMTunerSubChannel - { AMTUNER_SUBCHAN_NO_TUNE = -2, - AMTUNER_SUBCHAN_DEFAULT = -1 - } AMTunerSubChannel; - -typedef -enum tagAMTunerSignalStrength - { AMTUNER_HASNOSIGNALSTRENGTH = -1, - AMTUNER_NOSIGNAL = 0, - AMTUNER_SIGNALPRESENT = 1 - } AMTunerSignalStrength; - -typedef -enum tagAMTunerModeType - { AMTUNER_MODE_DEFAULT = 0, - AMTUNER_MODE_TV = 0x1, - AMTUNER_MODE_FM_RADIO = 0x2, - AMTUNER_MODE_AM_RADIO = 0x4, - AMTUNER_MODE_DSS = 0x8 - } AMTunerModeType; - -typedef -enum tagAMTunerEventType - { AMTUNER_EVENT_CHANGED = 0x1 - } AMTunerEventType; - - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0173_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0173_v0_0_s_ifspec; - -#ifndef __IAMTuner_INTERFACE_DEFINED__ -#define __IAMTuner_INTERFACE_DEFINED__ - -/* interface IAMTuner */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTuner; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("211A8761-03AC-11d1-8D13-00AA00BD8339") - IAMTuner : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE put_Channel( - /* [in] */ long lChannel, - /* [in] */ long lVideoSubChannel, - /* [in] */ long lAudioSubChannel) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Channel( - /* [out] */ long *plChannel, - /* [out] */ long *plVideoSubChannel, - /* [out] */ long *plAudioSubChannel) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChannelMinMax( - /* [out] */ long *lChannelMin, - /* [out] */ long *lChannelMax) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_CountryCode( - /* [in] */ long lCountryCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_CountryCode( - /* [out] */ long *plCountryCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_TuningSpace( - /* [in] */ long lTuningSpace) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TuningSpace( - /* [out] */ long *plTuningSpace) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Logon( - /* [in] */ HANDLE hCurrentUser) = 0; - - virtual HRESULT STDMETHODCALLTYPE Logout( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SignalPresent( - /* [out] */ long *plSignalStrength) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Mode( - /* [in] */ AMTunerModeType lMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Mode( - /* [out] */ AMTunerModeType *plMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAvailableModes( - /* [out] */ long *plModes) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterNotificationCallBack( - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnRegisterNotificationCallBack( - /* [in] */ IAMTunerNotification *pNotify) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTuner * This); - - HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IAMTuner * This, - /* [in] */ long lChannel, - /* [in] */ long lVideoSubChannel, - /* [in] */ long lAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IAMTuner * This, - /* [out] */ long *plChannel, - /* [out] */ long *plVideoSubChannel, - /* [out] */ long *plAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *ChannelMinMax )( - IAMTuner * This, - /* [out] */ long *lChannelMin, - /* [out] */ long *lChannelMax); - - HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IAMTuner * This, - /* [in] */ long lCountryCode); - - HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IAMTuner * This, - /* [out] */ long *plCountryCode); - - HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - IAMTuner * This, - /* [in] */ long lTuningSpace); - - HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IAMTuner * This, - /* [out] */ long *plTuningSpace); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Logon )( - IAMTuner * This, - /* [in] */ HANDLE hCurrentUser); - - HRESULT ( STDMETHODCALLTYPE *Logout )( - IAMTuner * This); - - HRESULT ( STDMETHODCALLTYPE *SignalPresent )( - IAMTuner * This, - /* [out] */ long *plSignalStrength); - - HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IAMTuner * This, - /* [in] */ AMTunerModeType lMode); - - HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IAMTuner * This, - /* [out] */ AMTunerModeType *plMode); - - HRESULT ( STDMETHODCALLTYPE *GetAvailableModes )( - IAMTuner * This, - /* [out] */ long *plModes); - - HRESULT ( STDMETHODCALLTYPE *RegisterNotificationCallBack )( - IAMTuner * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - HRESULT ( STDMETHODCALLTYPE *UnRegisterNotificationCallBack )( - IAMTuner * This, - /* [in] */ IAMTunerNotification *pNotify); - - END_INTERFACE - } IAMTunerVtbl; - - interface IAMTuner - { - CONST_VTBL struct IAMTunerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTuner_put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) \ - (This)->lpVtbl -> put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) - -#define IAMTuner_get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) \ - (This)->lpVtbl -> get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) - -#define IAMTuner_ChannelMinMax(This,lChannelMin,lChannelMax) \ - (This)->lpVtbl -> ChannelMinMax(This,lChannelMin,lChannelMax) - -#define IAMTuner_put_CountryCode(This,lCountryCode) \ - (This)->lpVtbl -> put_CountryCode(This,lCountryCode) - -#define IAMTuner_get_CountryCode(This,plCountryCode) \ - (This)->lpVtbl -> get_CountryCode(This,plCountryCode) - -#define IAMTuner_put_TuningSpace(This,lTuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,lTuningSpace) - -#define IAMTuner_get_TuningSpace(This,plTuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,plTuningSpace) - -#define IAMTuner_Logon(This,hCurrentUser) \ - (This)->lpVtbl -> Logon(This,hCurrentUser) - -#define IAMTuner_Logout(This) \ - (This)->lpVtbl -> Logout(This) - -#define IAMTuner_SignalPresent(This,plSignalStrength) \ - (This)->lpVtbl -> SignalPresent(This,plSignalStrength) - -#define IAMTuner_put_Mode(This,lMode) \ - (This)->lpVtbl -> put_Mode(This,lMode) - -#define IAMTuner_get_Mode(This,plMode) \ - (This)->lpVtbl -> get_Mode(This,plMode) - -#define IAMTuner_GetAvailableModes(This,plModes) \ - (This)->lpVtbl -> GetAvailableModes(This,plModes) - -#define IAMTuner_RegisterNotificationCallBack(This,pNotify,lEvents) \ - (This)->lpVtbl -> RegisterNotificationCallBack(This,pNotify,lEvents) - -#define IAMTuner_UnRegisterNotificationCallBack(This,pNotify) \ - (This)->lpVtbl -> UnRegisterNotificationCallBack(This,pNotify) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTuner_put_Channel_Proxy( - IAMTuner * This, - /* [in] */ long lChannel, - /* [in] */ long lVideoSubChannel, - /* [in] */ long lAudioSubChannel); - - -void __RPC_STUB IAMTuner_put_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_get_Channel_Proxy( - IAMTuner * This, - /* [out] */ long *plChannel, - /* [out] */ long *plVideoSubChannel, - /* [out] */ long *plAudioSubChannel); - - -void __RPC_STUB IAMTuner_get_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_ChannelMinMax_Proxy( - IAMTuner * This, - /* [out] */ long *lChannelMin, - /* [out] */ long *lChannelMax); - - -void __RPC_STUB IAMTuner_ChannelMinMax_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_put_CountryCode_Proxy( - IAMTuner * This, - /* [in] */ long lCountryCode); - - -void __RPC_STUB IAMTuner_put_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_get_CountryCode_Proxy( - IAMTuner * This, - /* [out] */ long *plCountryCode); - - -void __RPC_STUB IAMTuner_get_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_put_TuningSpace_Proxy( - IAMTuner * This, - /* [in] */ long lTuningSpace); - - -void __RPC_STUB IAMTuner_put_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_get_TuningSpace_Proxy( - IAMTuner * This, - /* [out] */ long *plTuningSpace); - - -void __RPC_STUB IAMTuner_get_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [local] */ HRESULT STDMETHODCALLTYPE IAMTuner_Logon_Proxy( - IAMTuner * This, - /* [in] */ HANDLE hCurrentUser); - - -void __RPC_STUB IAMTuner_Logon_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_Logout_Proxy( - IAMTuner * This); - - -void __RPC_STUB IAMTuner_Logout_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_SignalPresent_Proxy( - IAMTuner * This, - /* [out] */ long *plSignalStrength); - - -void __RPC_STUB IAMTuner_SignalPresent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_put_Mode_Proxy( - IAMTuner * This, - /* [in] */ AMTunerModeType lMode); - - -void __RPC_STUB IAMTuner_put_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_get_Mode_Proxy( - IAMTuner * This, - /* [out] */ AMTunerModeType *plMode); - - -void __RPC_STUB IAMTuner_get_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_GetAvailableModes_Proxy( - IAMTuner * This, - /* [out] */ long *plModes); - - -void __RPC_STUB IAMTuner_GetAvailableModes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_RegisterNotificationCallBack_Proxy( - IAMTuner * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - -void __RPC_STUB IAMTuner_RegisterNotificationCallBack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTuner_UnRegisterNotificationCallBack_Proxy( - IAMTuner * This, - /* [in] */ IAMTunerNotification *pNotify); - - -void __RPC_STUB IAMTuner_UnRegisterNotificationCallBack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTuner_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTunerNotification_INTERFACE_DEFINED__ -#define __IAMTunerNotification_INTERFACE_DEFINED__ - -/* interface IAMTunerNotification */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTunerNotification; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("211A8760-03AC-11d1-8D13-00AA00BD8339") - IAMTunerNotification : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnEvent( - /* [in] */ AMTunerEventType Event) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTunerNotificationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTunerNotification * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTunerNotification * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTunerNotification * This); - - HRESULT ( STDMETHODCALLTYPE *OnEvent )( - IAMTunerNotification * This, - /* [in] */ AMTunerEventType Event); - - END_INTERFACE - } IAMTunerNotificationVtbl; - - interface IAMTunerNotification - { - CONST_VTBL struct IAMTunerNotificationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTunerNotification_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTunerNotification_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTunerNotification_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTunerNotification_OnEvent(This,Event) \ - (This)->lpVtbl -> OnEvent(This,Event) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTunerNotification_OnEvent_Proxy( - IAMTunerNotification * This, - /* [in] */ AMTunerEventType Event); - - -void __RPC_STUB IAMTunerNotification_OnEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTunerNotification_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTVTuner_INTERFACE_DEFINED__ -#define __IAMTVTuner_INTERFACE_DEFINED__ - -/* interface IAMTVTuner */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTVTuner; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("211A8766-03AC-11d1-8D13-00AA00BD8339") - IAMTVTuner : public IAMTuner - { - public: - virtual HRESULT STDMETHODCALLTYPE get_AvailableTVFormats( - /* [out] */ long *lAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TVFormat( - /* [out] */ long *plAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE AutoTune( - /* [in] */ long lChannel, - /* [out] */ long *plFoundSignal) = 0; - - virtual HRESULT STDMETHODCALLTYPE StoreAutoTune( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_NumInputConnections( - /* [out] */ long *plNumInputConnections) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_InputType( - /* [in] */ long lIndex, - /* [in] */ TunerInputType InputType) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_InputType( - /* [in] */ long lIndex, - /* [out] */ TunerInputType *pInputType) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_ConnectInput( - /* [in] */ long lIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_ConnectInput( - /* [out] */ long *plIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_VideoFrequency( - /* [out] */ long *lFreq) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_AudioFrequency( - /* [out] */ long *lFreq) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTVTunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTVTuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTVTuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTVTuner * This); - - HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IAMTVTuner * This, - /* [in] */ long lChannel, - /* [in] */ long lVideoSubChannel, - /* [in] */ long lAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IAMTVTuner * This, - /* [out] */ long *plChannel, - /* [out] */ long *plVideoSubChannel, - /* [out] */ long *plAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *ChannelMinMax )( - IAMTVTuner * This, - /* [out] */ long *lChannelMin, - /* [out] */ long *lChannelMax); - - HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IAMTVTuner * This, - /* [in] */ long lCountryCode); - - HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IAMTVTuner * This, - /* [out] */ long *plCountryCode); - - HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - IAMTVTuner * This, - /* [in] */ long lTuningSpace); - - HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IAMTVTuner * This, - /* [out] */ long *plTuningSpace); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Logon )( - IAMTVTuner * This, - /* [in] */ HANDLE hCurrentUser); - - HRESULT ( STDMETHODCALLTYPE *Logout )( - IAMTVTuner * This); - - HRESULT ( STDMETHODCALLTYPE *SignalPresent )( - IAMTVTuner * This, - /* [out] */ long *plSignalStrength); - - HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IAMTVTuner * This, - /* [in] */ AMTunerModeType lMode); - - HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IAMTVTuner * This, - /* [out] */ AMTunerModeType *plMode); - - HRESULT ( STDMETHODCALLTYPE *GetAvailableModes )( - IAMTVTuner * This, - /* [out] */ long *plModes); - - HRESULT ( STDMETHODCALLTYPE *RegisterNotificationCallBack )( - IAMTVTuner * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - HRESULT ( STDMETHODCALLTYPE *UnRegisterNotificationCallBack )( - IAMTVTuner * This, - /* [in] */ IAMTunerNotification *pNotify); - - HRESULT ( STDMETHODCALLTYPE *get_AvailableTVFormats )( - IAMTVTuner * This, - /* [out] */ long *lAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *get_TVFormat )( - IAMTVTuner * This, - /* [out] */ long *plAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *AutoTune )( - IAMTVTuner * This, - /* [in] */ long lChannel, - /* [out] */ long *plFoundSignal); - - HRESULT ( STDMETHODCALLTYPE *StoreAutoTune )( - IAMTVTuner * This); - - HRESULT ( STDMETHODCALLTYPE *get_NumInputConnections )( - IAMTVTuner * This, - /* [out] */ long *plNumInputConnections); - - HRESULT ( STDMETHODCALLTYPE *put_InputType )( - IAMTVTuner * This, - /* [in] */ long lIndex, - /* [in] */ TunerInputType InputType); - - HRESULT ( STDMETHODCALLTYPE *get_InputType )( - IAMTVTuner * This, - /* [in] */ long lIndex, - /* [out] */ TunerInputType *pInputType); - - HRESULT ( STDMETHODCALLTYPE *put_ConnectInput )( - IAMTVTuner * This, - /* [in] */ long lIndex); - - HRESULT ( STDMETHODCALLTYPE *get_ConnectInput )( - IAMTVTuner * This, - /* [out] */ long *plIndex); - - HRESULT ( STDMETHODCALLTYPE *get_VideoFrequency )( - IAMTVTuner * This, - /* [out] */ long *lFreq); - - HRESULT ( STDMETHODCALLTYPE *get_AudioFrequency )( - IAMTVTuner * This, - /* [out] */ long *lFreq); - - END_INTERFACE - } IAMTVTunerVtbl; - - interface IAMTVTuner - { - CONST_VTBL struct IAMTVTunerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTVTuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTVTuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTVTuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTVTuner_put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) \ - (This)->lpVtbl -> put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) - -#define IAMTVTuner_get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) \ - (This)->lpVtbl -> get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) - -#define IAMTVTuner_ChannelMinMax(This,lChannelMin,lChannelMax) \ - (This)->lpVtbl -> ChannelMinMax(This,lChannelMin,lChannelMax) - -#define IAMTVTuner_put_CountryCode(This,lCountryCode) \ - (This)->lpVtbl -> put_CountryCode(This,lCountryCode) - -#define IAMTVTuner_get_CountryCode(This,plCountryCode) \ - (This)->lpVtbl -> get_CountryCode(This,plCountryCode) - -#define IAMTVTuner_put_TuningSpace(This,lTuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,lTuningSpace) - -#define IAMTVTuner_get_TuningSpace(This,plTuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,plTuningSpace) - -#define IAMTVTuner_Logon(This,hCurrentUser) \ - (This)->lpVtbl -> Logon(This,hCurrentUser) - -#define IAMTVTuner_Logout(This) \ - (This)->lpVtbl -> Logout(This) - -#define IAMTVTuner_SignalPresent(This,plSignalStrength) \ - (This)->lpVtbl -> SignalPresent(This,plSignalStrength) - -#define IAMTVTuner_put_Mode(This,lMode) \ - (This)->lpVtbl -> put_Mode(This,lMode) - -#define IAMTVTuner_get_Mode(This,plMode) \ - (This)->lpVtbl -> get_Mode(This,plMode) - -#define IAMTVTuner_GetAvailableModes(This,plModes) \ - (This)->lpVtbl -> GetAvailableModes(This,plModes) - -#define IAMTVTuner_RegisterNotificationCallBack(This,pNotify,lEvents) \ - (This)->lpVtbl -> RegisterNotificationCallBack(This,pNotify,lEvents) - -#define IAMTVTuner_UnRegisterNotificationCallBack(This,pNotify) \ - (This)->lpVtbl -> UnRegisterNotificationCallBack(This,pNotify) - - -#define IAMTVTuner_get_AvailableTVFormats(This,lAnalogVideoStandard) \ - (This)->lpVtbl -> get_AvailableTVFormats(This,lAnalogVideoStandard) - -#define IAMTVTuner_get_TVFormat(This,plAnalogVideoStandard) \ - (This)->lpVtbl -> get_TVFormat(This,plAnalogVideoStandard) - -#define IAMTVTuner_AutoTune(This,lChannel,plFoundSignal) \ - (This)->lpVtbl -> AutoTune(This,lChannel,plFoundSignal) - -#define IAMTVTuner_StoreAutoTune(This) \ - (This)->lpVtbl -> StoreAutoTune(This) - -#define IAMTVTuner_get_NumInputConnections(This,plNumInputConnections) \ - (This)->lpVtbl -> get_NumInputConnections(This,plNumInputConnections) - -#define IAMTVTuner_put_InputType(This,lIndex,InputType) \ - (This)->lpVtbl -> put_InputType(This,lIndex,InputType) - -#define IAMTVTuner_get_InputType(This,lIndex,pInputType) \ - (This)->lpVtbl -> get_InputType(This,lIndex,pInputType) - -#define IAMTVTuner_put_ConnectInput(This,lIndex) \ - (This)->lpVtbl -> put_ConnectInput(This,lIndex) - -#define IAMTVTuner_get_ConnectInput(This,plIndex) \ - (This)->lpVtbl -> get_ConnectInput(This,plIndex) - -#define IAMTVTuner_get_VideoFrequency(This,lFreq) \ - (This)->lpVtbl -> get_VideoFrequency(This,lFreq) - -#define IAMTVTuner_get_AudioFrequency(This,lFreq) \ - (This)->lpVtbl -> get_AudioFrequency(This,lFreq) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_AvailableTVFormats_Proxy( - IAMTVTuner * This, - /* [out] */ long *lAnalogVideoStandard); - - -void __RPC_STUB IAMTVTuner_get_AvailableTVFormats_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_TVFormat_Proxy( - IAMTVTuner * This, - /* [out] */ long *plAnalogVideoStandard); - - -void __RPC_STUB IAMTVTuner_get_TVFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_AutoTune_Proxy( - IAMTVTuner * This, - /* [in] */ long lChannel, - /* [out] */ long *plFoundSignal); - - -void __RPC_STUB IAMTVTuner_AutoTune_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_StoreAutoTune_Proxy( - IAMTVTuner * This); - - -void __RPC_STUB IAMTVTuner_StoreAutoTune_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_NumInputConnections_Proxy( - IAMTVTuner * This, - /* [out] */ long *plNumInputConnections); - - -void __RPC_STUB IAMTVTuner_get_NumInputConnections_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_put_InputType_Proxy( - IAMTVTuner * This, - /* [in] */ long lIndex, - /* [in] */ TunerInputType InputType); - - -void __RPC_STUB IAMTVTuner_put_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_InputType_Proxy( - IAMTVTuner * This, - /* [in] */ long lIndex, - /* [out] */ TunerInputType *pInputType); - - -void __RPC_STUB IAMTVTuner_get_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_put_ConnectInput_Proxy( - IAMTVTuner * This, - /* [in] */ long lIndex); - - -void __RPC_STUB IAMTVTuner_put_ConnectInput_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_ConnectInput_Proxy( - IAMTVTuner * This, - /* [out] */ long *plIndex); - - -void __RPC_STUB IAMTVTuner_get_ConnectInput_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_VideoFrequency_Proxy( - IAMTVTuner * This, - /* [out] */ long *lFreq); - - -void __RPC_STUB IAMTVTuner_get_VideoFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVTuner_get_AudioFrequency_Proxy( - IAMTVTuner * This, - /* [out] */ long *lFreq); - - -void __RPC_STUB IAMTVTuner_get_AudioFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTVTuner_INTERFACE_DEFINED__ */ - - -#ifndef __IBPCSatelliteTuner_INTERFACE_DEFINED__ -#define __IBPCSatelliteTuner_INTERFACE_DEFINED__ - -/* interface IBPCSatelliteTuner */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IBPCSatelliteTuner; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("211A8765-03AC-11d1-8D13-00AA00BD8339") - IBPCSatelliteTuner : public IAMTuner - { - public: - virtual HRESULT STDMETHODCALLTYPE get_DefaultSubChannelTypes( - /* [out] */ long *plDefaultVideoType, - /* [out] */ long *plDefaultAudioType) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_DefaultSubChannelTypes( - /* [in] */ long lDefaultVideoType, - /* [in] */ long lDefaultAudioType) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsTapingPermitted( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBPCSatelliteTunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBPCSatelliteTuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBPCSatelliteTuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBPCSatelliteTuner * This); - - HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IBPCSatelliteTuner * This, - /* [in] */ long lChannel, - /* [in] */ long lVideoSubChannel, - /* [in] */ long lAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IBPCSatelliteTuner * This, - /* [out] */ long *plChannel, - /* [out] */ long *plVideoSubChannel, - /* [out] */ long *plAudioSubChannel); - - HRESULT ( STDMETHODCALLTYPE *ChannelMinMax )( - IBPCSatelliteTuner * This, - /* [out] */ long *lChannelMin, - /* [out] */ long *lChannelMax); - - HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IBPCSatelliteTuner * This, - /* [in] */ long lCountryCode); - - HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IBPCSatelliteTuner * This, - /* [out] */ long *plCountryCode); - - HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - IBPCSatelliteTuner * This, - /* [in] */ long lTuningSpace); - - HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IBPCSatelliteTuner * This, - /* [out] */ long *plTuningSpace); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Logon )( - IBPCSatelliteTuner * This, - /* [in] */ HANDLE hCurrentUser); - - HRESULT ( STDMETHODCALLTYPE *Logout )( - IBPCSatelliteTuner * This); - - HRESULT ( STDMETHODCALLTYPE *SignalPresent )( - IBPCSatelliteTuner * This, - /* [out] */ long *plSignalStrength); - - HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IBPCSatelliteTuner * This, - /* [in] */ AMTunerModeType lMode); - - HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IBPCSatelliteTuner * This, - /* [out] */ AMTunerModeType *plMode); - - HRESULT ( STDMETHODCALLTYPE *GetAvailableModes )( - IBPCSatelliteTuner * This, - /* [out] */ long *plModes); - - HRESULT ( STDMETHODCALLTYPE *RegisterNotificationCallBack )( - IBPCSatelliteTuner * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - HRESULT ( STDMETHODCALLTYPE *UnRegisterNotificationCallBack )( - IBPCSatelliteTuner * This, - /* [in] */ IAMTunerNotification *pNotify); - - HRESULT ( STDMETHODCALLTYPE *get_DefaultSubChannelTypes )( - IBPCSatelliteTuner * This, - /* [out] */ long *plDefaultVideoType, - /* [out] */ long *plDefaultAudioType); - - HRESULT ( STDMETHODCALLTYPE *put_DefaultSubChannelTypes )( - IBPCSatelliteTuner * This, - /* [in] */ long lDefaultVideoType, - /* [in] */ long lDefaultAudioType); - - HRESULT ( STDMETHODCALLTYPE *IsTapingPermitted )( - IBPCSatelliteTuner * This); - - END_INTERFACE - } IBPCSatelliteTunerVtbl; - - interface IBPCSatelliteTuner - { - CONST_VTBL struct IBPCSatelliteTunerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBPCSatelliteTuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBPCSatelliteTuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBPCSatelliteTuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBPCSatelliteTuner_put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) \ - (This)->lpVtbl -> put_Channel(This,lChannel,lVideoSubChannel,lAudioSubChannel) - -#define IBPCSatelliteTuner_get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) \ - (This)->lpVtbl -> get_Channel(This,plChannel,plVideoSubChannel,plAudioSubChannel) - -#define IBPCSatelliteTuner_ChannelMinMax(This,lChannelMin,lChannelMax) \ - (This)->lpVtbl -> ChannelMinMax(This,lChannelMin,lChannelMax) - -#define IBPCSatelliteTuner_put_CountryCode(This,lCountryCode) \ - (This)->lpVtbl -> put_CountryCode(This,lCountryCode) - -#define IBPCSatelliteTuner_get_CountryCode(This,plCountryCode) \ - (This)->lpVtbl -> get_CountryCode(This,plCountryCode) - -#define IBPCSatelliteTuner_put_TuningSpace(This,lTuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,lTuningSpace) - -#define IBPCSatelliteTuner_get_TuningSpace(This,plTuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,plTuningSpace) - -#define IBPCSatelliteTuner_Logon(This,hCurrentUser) \ - (This)->lpVtbl -> Logon(This,hCurrentUser) - -#define IBPCSatelliteTuner_Logout(This) \ - (This)->lpVtbl -> Logout(This) - -#define IBPCSatelliteTuner_SignalPresent(This,plSignalStrength) \ - (This)->lpVtbl -> SignalPresent(This,plSignalStrength) - -#define IBPCSatelliteTuner_put_Mode(This,lMode) \ - (This)->lpVtbl -> put_Mode(This,lMode) - -#define IBPCSatelliteTuner_get_Mode(This,plMode) \ - (This)->lpVtbl -> get_Mode(This,plMode) - -#define IBPCSatelliteTuner_GetAvailableModes(This,plModes) \ - (This)->lpVtbl -> GetAvailableModes(This,plModes) - -#define IBPCSatelliteTuner_RegisterNotificationCallBack(This,pNotify,lEvents) \ - (This)->lpVtbl -> RegisterNotificationCallBack(This,pNotify,lEvents) - -#define IBPCSatelliteTuner_UnRegisterNotificationCallBack(This,pNotify) \ - (This)->lpVtbl -> UnRegisterNotificationCallBack(This,pNotify) - - -#define IBPCSatelliteTuner_get_DefaultSubChannelTypes(This,plDefaultVideoType,plDefaultAudioType) \ - (This)->lpVtbl -> get_DefaultSubChannelTypes(This,plDefaultVideoType,plDefaultAudioType) - -#define IBPCSatelliteTuner_put_DefaultSubChannelTypes(This,lDefaultVideoType,lDefaultAudioType) \ - (This)->lpVtbl -> put_DefaultSubChannelTypes(This,lDefaultVideoType,lDefaultAudioType) - -#define IBPCSatelliteTuner_IsTapingPermitted(This) \ - (This)->lpVtbl -> IsTapingPermitted(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBPCSatelliteTuner_get_DefaultSubChannelTypes_Proxy( - IBPCSatelliteTuner * This, - /* [out] */ long *plDefaultVideoType, - /* [out] */ long *plDefaultAudioType); - - -void __RPC_STUB IBPCSatelliteTuner_get_DefaultSubChannelTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBPCSatelliteTuner_put_DefaultSubChannelTypes_Proxy( - IBPCSatelliteTuner * This, - /* [in] */ long lDefaultVideoType, - /* [in] */ long lDefaultAudioType); - - -void __RPC_STUB IBPCSatelliteTuner_put_DefaultSubChannelTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IBPCSatelliteTuner_IsTapingPermitted_Proxy( - IBPCSatelliteTuner * This); - - -void __RPC_STUB IBPCSatelliteTuner_IsTapingPermitted_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBPCSatelliteTuner_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0177 */ -/* [local] */ - -typedef -enum tagTVAudioMode - { AMTVAUDIO_MODE_MONO = 0x1, - AMTVAUDIO_MODE_STEREO = 0x2, - AMTVAUDIO_MODE_LANG_A = 0x10, - AMTVAUDIO_MODE_LANG_B = 0x20, - AMTVAUDIO_MODE_LANG_C = 0x40 - } TVAudioMode; - -typedef -enum tagAMTVAudioEventType - { AMTVAUDIO_EVENT_CHANGED = 0x1 - } AMTVAudioEventType; - - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0177_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0177_v0_0_s_ifspec; - -#ifndef __IAMTVAudio_INTERFACE_DEFINED__ -#define __IAMTVAudio_INTERFACE_DEFINED__ - -/* interface IAMTVAudio */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMTVAudio; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("83EC1C30-23D1-11d1-99E6-00A0C9560266") - IAMTVAudio : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetHardwareSupportedTVAudioModes( - /* [out] */ long *plModes) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAvailableTVAudioModes( - /* [out] */ long *plModes) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TVAudioMode( - /* [out] */ long *plMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_TVAudioMode( - /* [in] */ long lMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE RegisterNotificationCallBack( - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnRegisterNotificationCallBack( - IAMTunerNotification *pNotify) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTVAudioVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTVAudio * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTVAudio * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTVAudio * This); - - HRESULT ( STDMETHODCALLTYPE *GetHardwareSupportedTVAudioModes )( - IAMTVAudio * This, - /* [out] */ long *plModes); - - HRESULT ( STDMETHODCALLTYPE *GetAvailableTVAudioModes )( - IAMTVAudio * This, - /* [out] */ long *plModes); - - HRESULT ( STDMETHODCALLTYPE *get_TVAudioMode )( - IAMTVAudio * This, - /* [out] */ long *plMode); - - HRESULT ( STDMETHODCALLTYPE *put_TVAudioMode )( - IAMTVAudio * This, - /* [in] */ long lMode); - - HRESULT ( STDMETHODCALLTYPE *RegisterNotificationCallBack )( - IAMTVAudio * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - HRESULT ( STDMETHODCALLTYPE *UnRegisterNotificationCallBack )( - IAMTVAudio * This, - IAMTunerNotification *pNotify); - - END_INTERFACE - } IAMTVAudioVtbl; - - interface IAMTVAudio - { - CONST_VTBL struct IAMTVAudioVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTVAudio_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTVAudio_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTVAudio_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTVAudio_GetHardwareSupportedTVAudioModes(This,plModes) \ - (This)->lpVtbl -> GetHardwareSupportedTVAudioModes(This,plModes) - -#define IAMTVAudio_GetAvailableTVAudioModes(This,plModes) \ - (This)->lpVtbl -> GetAvailableTVAudioModes(This,plModes) - -#define IAMTVAudio_get_TVAudioMode(This,plMode) \ - (This)->lpVtbl -> get_TVAudioMode(This,plMode) - -#define IAMTVAudio_put_TVAudioMode(This,lMode) \ - (This)->lpVtbl -> put_TVAudioMode(This,lMode) - -#define IAMTVAudio_RegisterNotificationCallBack(This,pNotify,lEvents) \ - (This)->lpVtbl -> RegisterNotificationCallBack(This,pNotify,lEvents) - -#define IAMTVAudio_UnRegisterNotificationCallBack(This,pNotify) \ - (This)->lpVtbl -> UnRegisterNotificationCallBack(This,pNotify) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_GetHardwareSupportedTVAudioModes_Proxy( - IAMTVAudio * This, - /* [out] */ long *plModes); - - -void __RPC_STUB IAMTVAudio_GetHardwareSupportedTVAudioModes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_GetAvailableTVAudioModes_Proxy( - IAMTVAudio * This, - /* [out] */ long *plModes); - - -void __RPC_STUB IAMTVAudio_GetAvailableTVAudioModes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_get_TVAudioMode_Proxy( - IAMTVAudio * This, - /* [out] */ long *plMode); - - -void __RPC_STUB IAMTVAudio_get_TVAudioMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_put_TVAudioMode_Proxy( - IAMTVAudio * This, - /* [in] */ long lMode); - - -void __RPC_STUB IAMTVAudio_put_TVAudioMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_RegisterNotificationCallBack_Proxy( - IAMTVAudio * This, - /* [in] */ IAMTunerNotification *pNotify, - /* [in] */ long lEvents); - - -void __RPC_STUB IAMTVAudio_RegisterNotificationCallBack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTVAudio_UnRegisterNotificationCallBack_Proxy( - IAMTVAudio * This, - IAMTunerNotification *pNotify); - - -void __RPC_STUB IAMTVAudio_UnRegisterNotificationCallBack_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTVAudio_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTVAudioNotification_INTERFACE_DEFINED__ -#define __IAMTVAudioNotification_INTERFACE_DEFINED__ - -/* interface IAMTVAudioNotification */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMTVAudioNotification; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("83EC1C33-23D1-11d1-99E6-00A0C9560266") - IAMTVAudioNotification : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnEvent( - /* [in] */ AMTVAudioEventType Event) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTVAudioNotificationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTVAudioNotification * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTVAudioNotification * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTVAudioNotification * This); - - HRESULT ( STDMETHODCALLTYPE *OnEvent )( - IAMTVAudioNotification * This, - /* [in] */ AMTVAudioEventType Event); - - END_INTERFACE - } IAMTVAudioNotificationVtbl; - - interface IAMTVAudioNotification - { - CONST_VTBL struct IAMTVAudioNotificationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTVAudioNotification_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTVAudioNotification_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTVAudioNotification_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTVAudioNotification_OnEvent(This,Event) \ - (This)->lpVtbl -> OnEvent(This,Event) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTVAudioNotification_OnEvent_Proxy( - IAMTVAudioNotification * This, - /* [in] */ AMTVAudioEventType Event); - - -void __RPC_STUB IAMTVAudioNotification_OnEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTVAudioNotification_INTERFACE_DEFINED__ */ - - -#ifndef __IAMAnalogVideoEncoder_INTERFACE_DEFINED__ -#define __IAMAnalogVideoEncoder_INTERFACE_DEFINED__ - -/* interface IAMAnalogVideoEncoder */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMAnalogVideoEncoder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C6E133B0-30AC-11d0-A18C-00A0C9118956") - IAMAnalogVideoEncoder : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_AvailableTVFormats( - /* [out] */ long *lAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_TVFormat( - /* [in] */ long lAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_TVFormat( - /* [out] */ long *plAnalogVideoStandard) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_CopyProtection( - /* [in] */ long lVideoCopyProtection) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_CopyProtection( - /* [out] */ long *lVideoCopyProtection) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_CCEnable( - /* [in] */ long lCCEnable) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_CCEnable( - /* [out] */ long *lCCEnable) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMAnalogVideoEncoderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMAnalogVideoEncoder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMAnalogVideoEncoder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMAnalogVideoEncoder * This); - - HRESULT ( STDMETHODCALLTYPE *get_AvailableTVFormats )( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *put_TVFormat )( - IAMAnalogVideoEncoder * This, - /* [in] */ long lAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *get_TVFormat )( - IAMAnalogVideoEncoder * This, - /* [out] */ long *plAnalogVideoStandard); - - HRESULT ( STDMETHODCALLTYPE *put_CopyProtection )( - IAMAnalogVideoEncoder * This, - /* [in] */ long lVideoCopyProtection); - - HRESULT ( STDMETHODCALLTYPE *get_CopyProtection )( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lVideoCopyProtection); - - HRESULT ( STDMETHODCALLTYPE *put_CCEnable )( - IAMAnalogVideoEncoder * This, - /* [in] */ long lCCEnable); - - HRESULT ( STDMETHODCALLTYPE *get_CCEnable )( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lCCEnable); - - END_INTERFACE - } IAMAnalogVideoEncoderVtbl; - - interface IAMAnalogVideoEncoder - { - CONST_VTBL struct IAMAnalogVideoEncoderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMAnalogVideoEncoder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMAnalogVideoEncoder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMAnalogVideoEncoder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMAnalogVideoEncoder_get_AvailableTVFormats(This,lAnalogVideoStandard) \ - (This)->lpVtbl -> get_AvailableTVFormats(This,lAnalogVideoStandard) - -#define IAMAnalogVideoEncoder_put_TVFormat(This,lAnalogVideoStandard) \ - (This)->lpVtbl -> put_TVFormat(This,lAnalogVideoStandard) - -#define IAMAnalogVideoEncoder_get_TVFormat(This,plAnalogVideoStandard) \ - (This)->lpVtbl -> get_TVFormat(This,plAnalogVideoStandard) - -#define IAMAnalogVideoEncoder_put_CopyProtection(This,lVideoCopyProtection) \ - (This)->lpVtbl -> put_CopyProtection(This,lVideoCopyProtection) - -#define IAMAnalogVideoEncoder_get_CopyProtection(This,lVideoCopyProtection) \ - (This)->lpVtbl -> get_CopyProtection(This,lVideoCopyProtection) - -#define IAMAnalogVideoEncoder_put_CCEnable(This,lCCEnable) \ - (This)->lpVtbl -> put_CCEnable(This,lCCEnable) - -#define IAMAnalogVideoEncoder_get_CCEnable(This,lCCEnable) \ - (This)->lpVtbl -> get_CCEnable(This,lCCEnable) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_get_AvailableTVFormats_Proxy( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoEncoder_get_AvailableTVFormats_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_put_TVFormat_Proxy( - IAMAnalogVideoEncoder * This, - /* [in] */ long lAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoEncoder_put_TVFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_get_TVFormat_Proxy( - IAMAnalogVideoEncoder * This, - /* [out] */ long *plAnalogVideoStandard); - - -void __RPC_STUB IAMAnalogVideoEncoder_get_TVFormat_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_put_CopyProtection_Proxy( - IAMAnalogVideoEncoder * This, - /* [in] */ long lVideoCopyProtection); - - -void __RPC_STUB IAMAnalogVideoEncoder_put_CopyProtection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_get_CopyProtection_Proxy( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lVideoCopyProtection); - - -void __RPC_STUB IAMAnalogVideoEncoder_get_CopyProtection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_put_CCEnable_Proxy( - IAMAnalogVideoEncoder * This, - /* [in] */ long lCCEnable); - - -void __RPC_STUB IAMAnalogVideoEncoder_put_CCEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMAnalogVideoEncoder_get_CCEnable_Proxy( - IAMAnalogVideoEncoder * This, - /* [out] */ long *lCCEnable); - - -void __RPC_STUB IAMAnalogVideoEncoder_get_CCEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMAnalogVideoEncoder_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0180 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0180_0001 - { AMPROPERTY_PIN_CATEGORY = 0, - AMPROPERTY_PIN_MEDIUM = AMPROPERTY_PIN_CATEGORY + 1 - } AMPROPERTY_PIN; - -#ifndef _IKsPropertySet_ -#define _IKsPropertySet_ -#define KSPROPERTY_SUPPORT_GET 1 -#define KSPROPERTY_SUPPORT_SET 2 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0180_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0180_v0_0_s_ifspec; - -#ifndef __IKsPropertySet_INTERFACE_DEFINED__ -#define __IKsPropertySet_INTERFACE_DEFINED__ - -/* interface IKsPropertySet */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IKsPropertySet; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("31EFAC30-515C-11d0-A9AA-00AA0061BE93") - IKsPropertySet : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Set( - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][in] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Get( - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][out] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData, - /* [out] */ DWORD *pcbReturned) = 0; - - virtual HRESULT STDMETHODCALLTYPE QuerySupported( - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [out] */ DWORD *pTypeSupport) = 0; - - }; - -#else /* C style interface */ - - typedef struct IKsPropertySetVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IKsPropertySet * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IKsPropertySet * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IKsPropertySet * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Set )( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][in] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Get )( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][out] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData, - /* [out] */ DWORD *pcbReturned); - - HRESULT ( STDMETHODCALLTYPE *QuerySupported )( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [out] */ DWORD *pTypeSupport); - - END_INTERFACE - } IKsPropertySetVtbl; - - interface IKsPropertySet - { - CONST_VTBL struct IKsPropertySetVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IKsPropertySet_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IKsPropertySet_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IKsPropertySet_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IKsPropertySet_Set(This,guidPropSet,dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData) \ - (This)->lpVtbl -> Set(This,guidPropSet,dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData) - -#define IKsPropertySet_Get(This,guidPropSet,dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned) \ - (This)->lpVtbl -> Get(This,guidPropSet,dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned) - -#define IKsPropertySet_QuerySupported(This,guidPropSet,dwPropID,pTypeSupport) \ - (This)->lpVtbl -> QuerySupported(This,guidPropSet,dwPropID,pTypeSupport) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_RemoteSet_Proxy( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ byte *pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][in] */ byte *pPropData, - /* [in] */ DWORD cbPropData); - - -void __RPC_STUB IKsPropertySet_RemoteSet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_RemoteGet_Proxy( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ byte *pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][out] */ byte *pPropData, - /* [in] */ DWORD cbPropData, - /* [out] */ DWORD *pcbReturned); - - -void __RPC_STUB IKsPropertySet_RemoteGet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IKsPropertySet_QuerySupported_Proxy( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [out] */ DWORD *pTypeSupport); - - -void __RPC_STUB IKsPropertySet_QuerySupported_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IKsPropertySet_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0181 */ -/* [local] */ - -#endif // _IKsPropertySet_ - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0181_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0181_v0_0_s_ifspec; - -#ifndef __IMediaPropertyBag_INTERFACE_DEFINED__ -#define __IMediaPropertyBag_INTERFACE_DEFINED__ - -/* interface IMediaPropertyBag */ -/* [unique][uuid][object] */ - -typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG; - - -EXTERN_C const IID IID_IMediaPropertyBag; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6025A880-C0D5-11d0-BD4E-00A0C911CE86") - IMediaPropertyBag : public IPropertyBag - { - public: - virtual HRESULT STDMETHODCALLTYPE EnumProperty( - /* [in] */ ULONG iProperty, - /* [out][in] */ VARIANT *pvarPropertyName, - /* [out][in] */ VARIANT *pvarPropertyValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaPropertyBagVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaPropertyBag * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaPropertyBag * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaPropertyBag * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Read )( - IMediaPropertyBag * This, - /* [in] */ LPCOLESTR pszPropName, - /* [out][in] */ VARIANT *pVar, - /* [in] */ IErrorLog *pErrorLog); - - HRESULT ( STDMETHODCALLTYPE *Write )( - IMediaPropertyBag * This, - /* [in] */ LPCOLESTR pszPropName, - /* [in] */ VARIANT *pVar); - - HRESULT ( STDMETHODCALLTYPE *EnumProperty )( - IMediaPropertyBag * This, - /* [in] */ ULONG iProperty, - /* [out][in] */ VARIANT *pvarPropertyName, - /* [out][in] */ VARIANT *pvarPropertyValue); - - END_INTERFACE - } IMediaPropertyBagVtbl; - - interface IMediaPropertyBag - { - CONST_VTBL struct IMediaPropertyBagVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaPropertyBag_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMediaPropertyBag_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMediaPropertyBag_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMediaPropertyBag_Read(This,pszPropName,pVar,pErrorLog) \ - (This)->lpVtbl -> Read(This,pszPropName,pVar,pErrorLog) - -#define IMediaPropertyBag_Write(This,pszPropName,pVar) \ - (This)->lpVtbl -> Write(This,pszPropName,pVar) - - -#define IMediaPropertyBag_EnumProperty(This,iProperty,pvarPropertyName,pvarPropertyValue) \ - (This)->lpVtbl -> EnumProperty(This,iProperty,pvarPropertyName,pvarPropertyValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMediaPropertyBag_EnumProperty_Proxy( - IMediaPropertyBag * This, - /* [in] */ ULONG iProperty, - /* [out][in] */ VARIANT *pvarPropertyName, - /* [out][in] */ VARIANT *pvarPropertyValue); - - -void __RPC_STUB IMediaPropertyBag_EnumProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMediaPropertyBag_INTERFACE_DEFINED__ */ - - -#ifndef __IPersistMediaPropertyBag_INTERFACE_DEFINED__ -#define __IPersistMediaPropertyBag_INTERFACE_DEFINED__ - -/* interface IPersistMediaPropertyBag */ -/* [unique][uuid][object] */ - -typedef IPersistMediaPropertyBag *LPPERSISTMEDIAPROPERTYBAG; - - -EXTERN_C const IID IID_IPersistMediaPropertyBag; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5738E040-B67F-11d0-BD4D-00A0C911CE86") - IPersistMediaPropertyBag : public IPersist - { - public: - virtual HRESULT STDMETHODCALLTYPE InitNew( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Load( - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ IErrorLog *pErrorLog) = 0; - - virtual HRESULT STDMETHODCALLTYPE Save( - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ BOOL fClearDirty, - /* [in] */ BOOL fSaveAllProperties) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPersistMediaPropertyBagVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPersistMediaPropertyBag * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPersistMediaPropertyBag * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPersistMediaPropertyBag * This); - - HRESULT ( STDMETHODCALLTYPE *GetClassID )( - IPersistMediaPropertyBag * This, - /* [out] */ CLSID *pClassID); - - HRESULT ( STDMETHODCALLTYPE *InitNew )( - IPersistMediaPropertyBag * This); - - HRESULT ( STDMETHODCALLTYPE *Load )( - IPersistMediaPropertyBag * This, - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ IErrorLog *pErrorLog); - - HRESULT ( STDMETHODCALLTYPE *Save )( - IPersistMediaPropertyBag * This, - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ BOOL fClearDirty, - /* [in] */ BOOL fSaveAllProperties); - - END_INTERFACE - } IPersistMediaPropertyBagVtbl; - - interface IPersistMediaPropertyBag - { - CONST_VTBL struct IPersistMediaPropertyBagVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPersistMediaPropertyBag_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPersistMediaPropertyBag_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPersistMediaPropertyBag_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPersistMediaPropertyBag_GetClassID(This,pClassID) \ - (This)->lpVtbl -> GetClassID(This,pClassID) - - -#define IPersistMediaPropertyBag_InitNew(This) \ - (This)->lpVtbl -> InitNew(This) - -#define IPersistMediaPropertyBag_Load(This,pPropBag,pErrorLog) \ - (This)->lpVtbl -> Load(This,pPropBag,pErrorLog) - -#define IPersistMediaPropertyBag_Save(This,pPropBag,fClearDirty,fSaveAllProperties) \ - (This)->lpVtbl -> Save(This,pPropBag,fClearDirty,fSaveAllProperties) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IPersistMediaPropertyBag_InitNew_Proxy( - IPersistMediaPropertyBag * This); - - -void __RPC_STUB IPersistMediaPropertyBag_InitNew_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPersistMediaPropertyBag_Load_Proxy( - IPersistMediaPropertyBag * This, - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ IErrorLog *pErrorLog); - - -void __RPC_STUB IPersistMediaPropertyBag_Load_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPersistMediaPropertyBag_Save_Proxy( - IPersistMediaPropertyBag * This, - /* [in] */ IMediaPropertyBag *pPropBag, - /* [in] */ BOOL fClearDirty, - /* [in] */ BOOL fSaveAllProperties); - - -void __RPC_STUB IPersistMediaPropertyBag_Save_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPersistMediaPropertyBag_INTERFACE_DEFINED__ */ - - -#ifndef __IAMPhysicalPinInfo_INTERFACE_DEFINED__ -#define __IAMPhysicalPinInfo_INTERFACE_DEFINED__ - -/* interface IAMPhysicalPinInfo */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMPhysicalPinInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F938C991-3029-11cf-8C44-00AA006B6814") - IAMPhysicalPinInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPhysicalType( - /* [out] */ long *pType, - /* [out] */ LPOLESTR *ppszType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMPhysicalPinInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMPhysicalPinInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMPhysicalPinInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMPhysicalPinInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetPhysicalType )( - IAMPhysicalPinInfo * This, - /* [out] */ long *pType, - /* [out] */ LPOLESTR *ppszType); - - END_INTERFACE - } IAMPhysicalPinInfoVtbl; - - interface IAMPhysicalPinInfo - { - CONST_VTBL struct IAMPhysicalPinInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMPhysicalPinInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMPhysicalPinInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMPhysicalPinInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMPhysicalPinInfo_GetPhysicalType(This,pType,ppszType) \ - (This)->lpVtbl -> GetPhysicalType(This,pType,ppszType) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMPhysicalPinInfo_GetPhysicalType_Proxy( - IAMPhysicalPinInfo * This, - /* [out] */ long *pType, - /* [out] */ LPOLESTR *ppszType); - - -void __RPC_STUB IAMPhysicalPinInfo_GetPhysicalType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMPhysicalPinInfo_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0328 */ -/* [local] */ - -typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0328_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0328_v0_0_s_ifspec; - -#ifndef __IAMExtDevice_INTERFACE_DEFINED__ -#define __IAMExtDevice_INTERFACE_DEFINED__ - -/* interface IAMExtDevice */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMExtDevice; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B5730A90-1A2C-11cf-8C23-00AA006B6814") - IAMExtDevice : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCapability( - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_ExternalDeviceID( - /* [out] */ LPOLESTR *ppszData) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_ExternalDeviceVersion( - /* [out] */ LPOLESTR *ppszData) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_DevicePower( - /* [in] */ long PowerMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_DevicePower( - /* [out] */ long *pPowerMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE Calibrate( - /* [in] */ HEVENT hEvent, - /* [in] */ long Mode, - /* [out] */ long *pStatus) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_DevicePort( - /* [in] */ long DevicePort) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_DevicePort( - /* [out] */ long *pDevicePort) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMExtDeviceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMExtDevice * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMExtDevice * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMExtDevice * This); - - HRESULT ( STDMETHODCALLTYPE *GetCapability )( - IAMExtDevice * This, - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue); - - HRESULT ( STDMETHODCALLTYPE *get_ExternalDeviceID )( - IAMExtDevice * This, - /* [out] */ LPOLESTR *ppszData); - - HRESULT ( STDMETHODCALLTYPE *get_ExternalDeviceVersion )( - IAMExtDevice * This, - /* [out] */ LPOLESTR *ppszData); - - HRESULT ( STDMETHODCALLTYPE *put_DevicePower )( - IAMExtDevice * This, - /* [in] */ long PowerMode); - - HRESULT ( STDMETHODCALLTYPE *get_DevicePower )( - IAMExtDevice * This, - /* [out] */ long *pPowerMode); - - HRESULT ( STDMETHODCALLTYPE *Calibrate )( - IAMExtDevice * This, - /* [in] */ HEVENT hEvent, - /* [in] */ long Mode, - /* [out] */ long *pStatus); - - HRESULT ( STDMETHODCALLTYPE *put_DevicePort )( - IAMExtDevice * This, - /* [in] */ long DevicePort); - - HRESULT ( STDMETHODCALLTYPE *get_DevicePort )( - IAMExtDevice * This, - /* [out] */ long *pDevicePort); - - END_INTERFACE - } IAMExtDeviceVtbl; - - interface IAMExtDevice - { - CONST_VTBL struct IAMExtDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMExtDevice_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMExtDevice_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMExtDevice_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMExtDevice_GetCapability(This,Capability,pValue,pdblValue) \ - (This)->lpVtbl -> GetCapability(This,Capability,pValue,pdblValue) - -#define IAMExtDevice_get_ExternalDeviceID(This,ppszData) \ - (This)->lpVtbl -> get_ExternalDeviceID(This,ppszData) - -#define IAMExtDevice_get_ExternalDeviceVersion(This,ppszData) \ - (This)->lpVtbl -> get_ExternalDeviceVersion(This,ppszData) - -#define IAMExtDevice_put_DevicePower(This,PowerMode) \ - (This)->lpVtbl -> put_DevicePower(This,PowerMode) - -#define IAMExtDevice_get_DevicePower(This,pPowerMode) \ - (This)->lpVtbl -> get_DevicePower(This,pPowerMode) - -#define IAMExtDevice_Calibrate(This,hEvent,Mode,pStatus) \ - (This)->lpVtbl -> Calibrate(This,hEvent,Mode,pStatus) - -#define IAMExtDevice_put_DevicePort(This,DevicePort) \ - (This)->lpVtbl -> put_DevicePort(This,DevicePort) - -#define IAMExtDevice_get_DevicePort(This,pDevicePort) \ - (This)->lpVtbl -> get_DevicePort(This,pDevicePort) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_GetCapability_Proxy( - IAMExtDevice * This, - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue); - - -void __RPC_STUB IAMExtDevice_GetCapability_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_get_ExternalDeviceID_Proxy( - IAMExtDevice * This, - /* [out] */ LPOLESTR *ppszData); - - -void __RPC_STUB IAMExtDevice_get_ExternalDeviceID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_get_ExternalDeviceVersion_Proxy( - IAMExtDevice * This, - /* [out] */ LPOLESTR *ppszData); - - -void __RPC_STUB IAMExtDevice_get_ExternalDeviceVersion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_put_DevicePower_Proxy( - IAMExtDevice * This, - /* [in] */ long PowerMode); - - -void __RPC_STUB IAMExtDevice_put_DevicePower_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_get_DevicePower_Proxy( - IAMExtDevice * This, - /* [out] */ long *pPowerMode); - - -void __RPC_STUB IAMExtDevice_get_DevicePower_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_Calibrate_Proxy( - IAMExtDevice * This, - /* [in] */ HEVENT hEvent, - /* [in] */ long Mode, - /* [out] */ long *pStatus); - - -void __RPC_STUB IAMExtDevice_Calibrate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_put_DevicePort_Proxy( - IAMExtDevice * This, - /* [in] */ long DevicePort); - - -void __RPC_STUB IAMExtDevice_put_DevicePort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtDevice_get_DevicePort_Proxy( - IAMExtDevice * This, - /* [out] */ long *pDevicePort); - - -void __RPC_STUB IAMExtDevice_get_DevicePort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMExtDevice_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0329 */ -/* [local] */ - -typedef IAMExtDevice *PEXTDEVICE; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0329_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0329_v0_0_s_ifspec; - -#ifndef __IAMExtTransport_INTERFACE_DEFINED__ -#define __IAMExtTransport_INTERFACE_DEFINED__ - -/* interface IAMExtTransport */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMExtTransport; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A03CD5F0-3045-11cf-8C44-00AA006B6814") - IAMExtTransport : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCapability( - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_MediaState( - /* [in] */ long State) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_MediaState( - /* [out] */ long *pState) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_LocalControl( - /* [in] */ long State) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_LocalControl( - /* [out] */ long *pState) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStatus( - /* [in] */ long StatusItem, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTransportBasicParameters( - /* [in] */ long Param, - /* [out] */ long *pValue, - /* [out] */ LPOLESTR *ppszData) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTransportBasicParameters( - /* [in] */ long Param, - /* [in] */ long Value, - /* [in] */ LPCOLESTR pszData) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTransportVideoParameters( - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTransportVideoParameters( - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTransportAudioParameters( - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTransportAudioParameters( - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Mode( - /* [in] */ long Mode) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Mode( - /* [out] */ long *pMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Rate( - /* [in] */ double dblRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Rate( - /* [out] */ double *pdblRate) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetChase( - /* [out] */ long *pEnabled, - /* [out] */ long *pOffset, - /* [out] */ HEVENT *phEvent) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetChase( - /* [in] */ long Enable, - /* [in] */ long Offset, - /* [in] */ HEVENT hEvent) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBump( - /* [out] */ long *pSpeed, - /* [out] */ long *pDuration) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBump( - /* [in] */ long Speed, - /* [in] */ long Duration) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_AntiClogControl( - /* [out] */ long *pEnabled) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_AntiClogControl( - /* [in] */ long Enable) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEditPropertySet( - /* [in] */ long EditID, - /* [out] */ long *pState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetEditPropertySet( - /* [out][in] */ long *pEditID, - /* [in] */ long State) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEditProperty( - /* [in] */ long EditID, - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetEditProperty( - /* [in] */ long EditID, - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_EditStart( - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_EditStart( - /* [in] */ long Value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMExtTransportVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMExtTransport * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMExtTransport * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMExtTransport * This); - - HRESULT ( STDMETHODCALLTYPE *GetCapability )( - IAMExtTransport * This, - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue); - - HRESULT ( STDMETHODCALLTYPE *put_MediaState )( - IAMExtTransport * This, - /* [in] */ long State); - - HRESULT ( STDMETHODCALLTYPE *get_MediaState )( - IAMExtTransport * This, - /* [out] */ long *pState); - - HRESULT ( STDMETHODCALLTYPE *put_LocalControl )( - IAMExtTransport * This, - /* [in] */ long State); - - HRESULT ( STDMETHODCALLTYPE *get_LocalControl )( - IAMExtTransport * This, - /* [out] */ long *pState); - - HRESULT ( STDMETHODCALLTYPE *GetStatus )( - IAMExtTransport * This, - /* [in] */ long StatusItem, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetTransportBasicParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue, - /* [out] */ LPOLESTR *ppszData); - - HRESULT ( STDMETHODCALLTYPE *SetTransportBasicParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value, - /* [in] */ LPCOLESTR pszData); - - HRESULT ( STDMETHODCALLTYPE *GetTransportVideoParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetTransportVideoParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value); - - HRESULT ( STDMETHODCALLTYPE *GetTransportAudioParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetTransportAudioParameters )( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value); - - HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IAMExtTransport * This, - /* [in] */ long Mode); - - HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IAMExtTransport * This, - /* [out] */ long *pMode); - - HRESULT ( STDMETHODCALLTYPE *put_Rate )( - IAMExtTransport * This, - /* [in] */ double dblRate); - - HRESULT ( STDMETHODCALLTYPE *get_Rate )( - IAMExtTransport * This, - /* [out] */ double *pdblRate); - - HRESULT ( STDMETHODCALLTYPE *GetChase )( - IAMExtTransport * This, - /* [out] */ long *pEnabled, - /* [out] */ long *pOffset, - /* [out] */ HEVENT *phEvent); - - HRESULT ( STDMETHODCALLTYPE *SetChase )( - IAMExtTransport * This, - /* [in] */ long Enable, - /* [in] */ long Offset, - /* [in] */ HEVENT hEvent); - - HRESULT ( STDMETHODCALLTYPE *GetBump )( - IAMExtTransport * This, - /* [out] */ long *pSpeed, - /* [out] */ long *pDuration); - - HRESULT ( STDMETHODCALLTYPE *SetBump )( - IAMExtTransport * This, - /* [in] */ long Speed, - /* [in] */ long Duration); - - HRESULT ( STDMETHODCALLTYPE *get_AntiClogControl )( - IAMExtTransport * This, - /* [out] */ long *pEnabled); - - HRESULT ( STDMETHODCALLTYPE *put_AntiClogControl )( - IAMExtTransport * This, - /* [in] */ long Enable); - - HRESULT ( STDMETHODCALLTYPE *GetEditPropertySet )( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [out] */ long *pState); - - HRESULT ( STDMETHODCALLTYPE *SetEditPropertySet )( - IAMExtTransport * This, - /* [out][in] */ long *pEditID, - /* [in] */ long State); - - HRESULT ( STDMETHODCALLTYPE *GetEditProperty )( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetEditProperty )( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [in] */ long Param, - /* [in] */ long Value); - - HRESULT ( STDMETHODCALLTYPE *get_EditStart )( - IAMExtTransport * This, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *put_EditStart )( - IAMExtTransport * This, - /* [in] */ long Value); - - END_INTERFACE - } IAMExtTransportVtbl; - - interface IAMExtTransport - { - CONST_VTBL struct IAMExtTransportVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMExtTransport_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMExtTransport_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMExtTransport_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMExtTransport_GetCapability(This,Capability,pValue,pdblValue) \ - (This)->lpVtbl -> GetCapability(This,Capability,pValue,pdblValue) - -#define IAMExtTransport_put_MediaState(This,State) \ - (This)->lpVtbl -> put_MediaState(This,State) - -#define IAMExtTransport_get_MediaState(This,pState) \ - (This)->lpVtbl -> get_MediaState(This,pState) - -#define IAMExtTransport_put_LocalControl(This,State) \ - (This)->lpVtbl -> put_LocalControl(This,State) - -#define IAMExtTransport_get_LocalControl(This,pState) \ - (This)->lpVtbl -> get_LocalControl(This,pState) - -#define IAMExtTransport_GetStatus(This,StatusItem,pValue) \ - (This)->lpVtbl -> GetStatus(This,StatusItem,pValue) - -#define IAMExtTransport_GetTransportBasicParameters(This,Param,pValue,ppszData) \ - (This)->lpVtbl -> GetTransportBasicParameters(This,Param,pValue,ppszData) - -#define IAMExtTransport_SetTransportBasicParameters(This,Param,Value,pszData) \ - (This)->lpVtbl -> SetTransportBasicParameters(This,Param,Value,pszData) - -#define IAMExtTransport_GetTransportVideoParameters(This,Param,pValue) \ - (This)->lpVtbl -> GetTransportVideoParameters(This,Param,pValue) - -#define IAMExtTransport_SetTransportVideoParameters(This,Param,Value) \ - (This)->lpVtbl -> SetTransportVideoParameters(This,Param,Value) - -#define IAMExtTransport_GetTransportAudioParameters(This,Param,pValue) \ - (This)->lpVtbl -> GetTransportAudioParameters(This,Param,pValue) - -#define IAMExtTransport_SetTransportAudioParameters(This,Param,Value) \ - (This)->lpVtbl -> SetTransportAudioParameters(This,Param,Value) - -#define IAMExtTransport_put_Mode(This,Mode) \ - (This)->lpVtbl -> put_Mode(This,Mode) - -#define IAMExtTransport_get_Mode(This,pMode) \ - (This)->lpVtbl -> get_Mode(This,pMode) - -#define IAMExtTransport_put_Rate(This,dblRate) \ - (This)->lpVtbl -> put_Rate(This,dblRate) - -#define IAMExtTransport_get_Rate(This,pdblRate) \ - (This)->lpVtbl -> get_Rate(This,pdblRate) - -#define IAMExtTransport_GetChase(This,pEnabled,pOffset,phEvent) \ - (This)->lpVtbl -> GetChase(This,pEnabled,pOffset,phEvent) - -#define IAMExtTransport_SetChase(This,Enable,Offset,hEvent) \ - (This)->lpVtbl -> SetChase(This,Enable,Offset,hEvent) - -#define IAMExtTransport_GetBump(This,pSpeed,pDuration) \ - (This)->lpVtbl -> GetBump(This,pSpeed,pDuration) - -#define IAMExtTransport_SetBump(This,Speed,Duration) \ - (This)->lpVtbl -> SetBump(This,Speed,Duration) - -#define IAMExtTransport_get_AntiClogControl(This,pEnabled) \ - (This)->lpVtbl -> get_AntiClogControl(This,pEnabled) - -#define IAMExtTransport_put_AntiClogControl(This,Enable) \ - (This)->lpVtbl -> put_AntiClogControl(This,Enable) - -#define IAMExtTransport_GetEditPropertySet(This,EditID,pState) \ - (This)->lpVtbl -> GetEditPropertySet(This,EditID,pState) - -#define IAMExtTransport_SetEditPropertySet(This,pEditID,State) \ - (This)->lpVtbl -> SetEditPropertySet(This,pEditID,State) - -#define IAMExtTransport_GetEditProperty(This,EditID,Param,pValue) \ - (This)->lpVtbl -> GetEditProperty(This,EditID,Param,pValue) - -#define IAMExtTransport_SetEditProperty(This,EditID,Param,Value) \ - (This)->lpVtbl -> SetEditProperty(This,EditID,Param,Value) - -#define IAMExtTransport_get_EditStart(This,pValue) \ - (This)->lpVtbl -> get_EditStart(This,pValue) - -#define IAMExtTransport_put_EditStart(This,Value) \ - (This)->lpVtbl -> put_EditStart(This,Value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetCapability_Proxy( - IAMExtTransport * This, - /* [in] */ long Capability, - /* [out] */ long *pValue, - /* [out] */ double *pdblValue); - - -void __RPC_STUB IAMExtTransport_GetCapability_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_MediaState_Proxy( - IAMExtTransport * This, - /* [in] */ long State); - - -void __RPC_STUB IAMExtTransport_put_MediaState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_MediaState_Proxy( - IAMExtTransport * This, - /* [out] */ long *pState); - - -void __RPC_STUB IAMExtTransport_get_MediaState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_LocalControl_Proxy( - IAMExtTransport * This, - /* [in] */ long State); - - -void __RPC_STUB IAMExtTransport_put_LocalControl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_LocalControl_Proxy( - IAMExtTransport * This, - /* [out] */ long *pState); - - -void __RPC_STUB IAMExtTransport_get_LocalControl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetStatus_Proxy( - IAMExtTransport * This, - /* [in] */ long StatusItem, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMExtTransport_GetStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetTransportBasicParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue, - /* [out] */ LPOLESTR *ppszData); - - -void __RPC_STUB IAMExtTransport_GetTransportBasicParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetTransportBasicParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value, - /* [in] */ LPCOLESTR pszData); - - -void __RPC_STUB IAMExtTransport_SetTransportBasicParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetTransportVideoParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMExtTransport_GetTransportVideoParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetTransportVideoParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMExtTransport_SetTransportVideoParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetTransportAudioParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMExtTransport_GetTransportAudioParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetTransportAudioParameters_Proxy( - IAMExtTransport * This, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMExtTransport_SetTransportAudioParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_Mode_Proxy( - IAMExtTransport * This, - /* [in] */ long Mode); - - -void __RPC_STUB IAMExtTransport_put_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_Mode_Proxy( - IAMExtTransport * This, - /* [out] */ long *pMode); - - -void __RPC_STUB IAMExtTransport_get_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_Rate_Proxy( - IAMExtTransport * This, - /* [in] */ double dblRate); - - -void __RPC_STUB IAMExtTransport_put_Rate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_Rate_Proxy( - IAMExtTransport * This, - /* [out] */ double *pdblRate); - - -void __RPC_STUB IAMExtTransport_get_Rate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetChase_Proxy( - IAMExtTransport * This, - /* [out] */ long *pEnabled, - /* [out] */ long *pOffset, - /* [out] */ HEVENT *phEvent); - - -void __RPC_STUB IAMExtTransport_GetChase_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetChase_Proxy( - IAMExtTransport * This, - /* [in] */ long Enable, - /* [in] */ long Offset, - /* [in] */ HEVENT hEvent); - - -void __RPC_STUB IAMExtTransport_SetChase_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetBump_Proxy( - IAMExtTransport * This, - /* [out] */ long *pSpeed, - /* [out] */ long *pDuration); - - -void __RPC_STUB IAMExtTransport_GetBump_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetBump_Proxy( - IAMExtTransport * This, - /* [in] */ long Speed, - /* [in] */ long Duration); - - -void __RPC_STUB IAMExtTransport_SetBump_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_AntiClogControl_Proxy( - IAMExtTransport * This, - /* [out] */ long *pEnabled); - - -void __RPC_STUB IAMExtTransport_get_AntiClogControl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_AntiClogControl_Proxy( - IAMExtTransport * This, - /* [in] */ long Enable); - - -void __RPC_STUB IAMExtTransport_put_AntiClogControl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetEditPropertySet_Proxy( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [out] */ long *pState); - - -void __RPC_STUB IAMExtTransport_GetEditPropertySet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetEditPropertySet_Proxy( - IAMExtTransport * This, - /* [out][in] */ long *pEditID, - /* [in] */ long State); - - -void __RPC_STUB IAMExtTransport_SetEditPropertySet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_GetEditProperty_Proxy( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMExtTransport_GetEditProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_SetEditProperty_Proxy( - IAMExtTransport * This, - /* [in] */ long EditID, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMExtTransport_SetEditProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_get_EditStart_Proxy( - IAMExtTransport * This, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMExtTransport_get_EditStart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMExtTransport_put_EditStart_Proxy( - IAMExtTransport * This, - /* [in] */ long Value); - - -void __RPC_STUB IAMExtTransport_put_EditStart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMExtTransport_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0330 */ -/* [local] */ - -typedef IAMExtTransport *PIAMEXTTRANSPORT; - -#if 0 -/* the following is what MIDL knows how to remote */ -typedef struct tagTIMECODE - { - WORD wFrameRate; - WORD wFrameFract; - DWORD dwFrames; - } TIMECODE; - -#else /* 0 */ -#ifndef TIMECODE_DEFINED -#define TIMECODE_DEFINED -typedef union _timecode { - struct { - WORD wFrameRate; - WORD wFrameFract; - DWORD dwFrames; - }; - DWORDLONG qw; - } TIMECODE; - -#endif /* TIMECODE_DEFINED */ -#endif /* 0 */ -typedef TIMECODE *PTIMECODE; - -typedef struct tagTIMECODE_SAMPLE - { - LONGLONG qwTick; - TIMECODE timecode; - DWORD dwUser; - DWORD dwFlags; - } TIMECODE_SAMPLE; - -typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0330_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0330_v0_0_s_ifspec; - -#ifndef __IAMTimecodeReader_INTERFACE_DEFINED__ -#define __IAMTimecodeReader_INTERFACE_DEFINED__ - -/* interface IAMTimecodeReader */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimecodeReader; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9B496CE1-811B-11cf-8C77-00AA006B6814") - IAMTimecodeReader : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetTCRMode( - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTCRMode( - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_VITCLine( - /* [in] */ long Line) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_VITCLine( - /* [out] */ long *pLine) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimecode( - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimecodeReaderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimecodeReader * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimecodeReader * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimecodeReader * This); - - HRESULT ( STDMETHODCALLTYPE *GetTCRMode )( - IAMTimecodeReader * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetTCRMode )( - IAMTimecodeReader * This, - /* [in] */ long Param, - /* [in] */ long Value); - - HRESULT ( STDMETHODCALLTYPE *put_VITCLine )( - IAMTimecodeReader * This, - /* [in] */ long Line); - - HRESULT ( STDMETHODCALLTYPE *get_VITCLine )( - IAMTimecodeReader * This, - /* [out] */ long *pLine); - - HRESULT ( STDMETHODCALLTYPE *GetTimecode )( - IAMTimecodeReader * This, - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample); - - END_INTERFACE - } IAMTimecodeReaderVtbl; - - interface IAMTimecodeReader - { - CONST_VTBL struct IAMTimecodeReaderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimecodeReader_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimecodeReader_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimecodeReader_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimecodeReader_GetTCRMode(This,Param,pValue) \ - (This)->lpVtbl -> GetTCRMode(This,Param,pValue) - -#define IAMTimecodeReader_SetTCRMode(This,Param,Value) \ - (This)->lpVtbl -> SetTCRMode(This,Param,Value) - -#define IAMTimecodeReader_put_VITCLine(This,Line) \ - (This)->lpVtbl -> put_VITCLine(This,Line) - -#define IAMTimecodeReader_get_VITCLine(This,pLine) \ - (This)->lpVtbl -> get_VITCLine(This,pLine) - -#define IAMTimecodeReader_GetTimecode(This,pTimecodeSample) \ - (This)->lpVtbl -> GetTimecode(This,pTimecodeSample) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTimecodeReader_GetTCRMode_Proxy( - IAMTimecodeReader * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMTimecodeReader_GetTCRMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeReader_SetTCRMode_Proxy( - IAMTimecodeReader * This, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMTimecodeReader_SetTCRMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeReader_put_VITCLine_Proxy( - IAMTimecodeReader * This, - /* [in] */ long Line); - - -void __RPC_STUB IAMTimecodeReader_put_VITCLine_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeReader_get_VITCLine_Proxy( - IAMTimecodeReader * This, - /* [out] */ long *pLine); - - -void __RPC_STUB IAMTimecodeReader_get_VITCLine_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeReader_GetTimecode_Proxy( - IAMTimecodeReader * This, - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample); - - -void __RPC_STUB IAMTimecodeReader_GetTimecode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimecodeReader_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0331 */ -/* [local] */ - -typedef IAMTimecodeReader *PIAMTIMECODEREADER; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0331_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0331_v0_0_s_ifspec; - -#ifndef __IAMTimecodeGenerator_INTERFACE_DEFINED__ -#define __IAMTimecodeGenerator_INTERFACE_DEFINED__ - -/* interface IAMTimecodeGenerator */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimecodeGenerator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9B496CE0-811B-11cf-8C77-00AA006B6814") - IAMTimecodeGenerator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetTCGMode( - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTCGMode( - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_VITCLine( - /* [in] */ long Line) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_VITCLine( - /* [out] */ long *pLine) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTimecode( - /* [in] */ PTIMECODE_SAMPLE pTimecodeSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimecode( - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimecodeGeneratorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimecodeGenerator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimecodeGenerator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimecodeGenerator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTCGMode )( - IAMTimecodeGenerator * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetTCGMode )( - IAMTimecodeGenerator * This, - /* [in] */ long Param, - /* [in] */ long Value); - - HRESULT ( STDMETHODCALLTYPE *put_VITCLine )( - IAMTimecodeGenerator * This, - /* [in] */ long Line); - - HRESULT ( STDMETHODCALLTYPE *get_VITCLine )( - IAMTimecodeGenerator * This, - /* [out] */ long *pLine); - - HRESULT ( STDMETHODCALLTYPE *SetTimecode )( - IAMTimecodeGenerator * This, - /* [in] */ PTIMECODE_SAMPLE pTimecodeSample); - - HRESULT ( STDMETHODCALLTYPE *GetTimecode )( - IAMTimecodeGenerator * This, - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample); - - END_INTERFACE - } IAMTimecodeGeneratorVtbl; - - interface IAMTimecodeGenerator - { - CONST_VTBL struct IAMTimecodeGeneratorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimecodeGenerator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimecodeGenerator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimecodeGenerator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimecodeGenerator_GetTCGMode(This,Param,pValue) \ - (This)->lpVtbl -> GetTCGMode(This,Param,pValue) - -#define IAMTimecodeGenerator_SetTCGMode(This,Param,Value) \ - (This)->lpVtbl -> SetTCGMode(This,Param,Value) - -#define IAMTimecodeGenerator_put_VITCLine(This,Line) \ - (This)->lpVtbl -> put_VITCLine(This,Line) - -#define IAMTimecodeGenerator_get_VITCLine(This,pLine) \ - (This)->lpVtbl -> get_VITCLine(This,pLine) - -#define IAMTimecodeGenerator_SetTimecode(This,pTimecodeSample) \ - (This)->lpVtbl -> SetTimecode(This,pTimecodeSample) - -#define IAMTimecodeGenerator_GetTimecode(This,pTimecodeSample) \ - (This)->lpVtbl -> GetTimecode(This,pTimecodeSample) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_GetTCGMode_Proxy( - IAMTimecodeGenerator * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMTimecodeGenerator_GetTCGMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_SetTCGMode_Proxy( - IAMTimecodeGenerator * This, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMTimecodeGenerator_SetTCGMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_put_VITCLine_Proxy( - IAMTimecodeGenerator * This, - /* [in] */ long Line); - - -void __RPC_STUB IAMTimecodeGenerator_put_VITCLine_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_get_VITCLine_Proxy( - IAMTimecodeGenerator * This, - /* [out] */ long *pLine); - - -void __RPC_STUB IAMTimecodeGenerator_get_VITCLine_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_SetTimecode_Proxy( - IAMTimecodeGenerator * This, - /* [in] */ PTIMECODE_SAMPLE pTimecodeSample); - - -void __RPC_STUB IAMTimecodeGenerator_SetTimecode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeGenerator_GetTimecode_Proxy( - IAMTimecodeGenerator * This, - /* [out] */ PTIMECODE_SAMPLE pTimecodeSample); - - -void __RPC_STUB IAMTimecodeGenerator_GetTimecode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimecodeGenerator_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0332 */ -/* [local] */ - -typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0332_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0332_v0_0_s_ifspec; - -#ifndef __IAMTimecodeDisplay_INTERFACE_DEFINED__ -#define __IAMTimecodeDisplay_INTERFACE_DEFINED__ - -/* interface IAMTimecodeDisplay */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimecodeDisplay; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9B496CE2-811B-11cf-8C77-00AA006B6814") - IAMTimecodeDisplay : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetTCDisplayEnable( - /* [out] */ long *pState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTCDisplayEnable( - /* [in] */ long State) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTCDisplay( - /* [in] */ long Param, - /* [out] */ long *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTCDisplay( - /* [in] */ long Param, - /* [in] */ long Value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimecodeDisplayVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimecodeDisplay * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimecodeDisplay * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimecodeDisplay * This); - - HRESULT ( STDMETHODCALLTYPE *GetTCDisplayEnable )( - IAMTimecodeDisplay * This, - /* [out] */ long *pState); - - HRESULT ( STDMETHODCALLTYPE *SetTCDisplayEnable )( - IAMTimecodeDisplay * This, - /* [in] */ long State); - - HRESULT ( STDMETHODCALLTYPE *GetTCDisplay )( - IAMTimecodeDisplay * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetTCDisplay )( - IAMTimecodeDisplay * This, - /* [in] */ long Param, - /* [in] */ long Value); - - END_INTERFACE - } IAMTimecodeDisplayVtbl; - - interface IAMTimecodeDisplay - { - CONST_VTBL struct IAMTimecodeDisplayVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimecodeDisplay_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMTimecodeDisplay_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMTimecodeDisplay_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMTimecodeDisplay_GetTCDisplayEnable(This,pState) \ - (This)->lpVtbl -> GetTCDisplayEnable(This,pState) - -#define IAMTimecodeDisplay_SetTCDisplayEnable(This,State) \ - (This)->lpVtbl -> SetTCDisplayEnable(This,State) - -#define IAMTimecodeDisplay_GetTCDisplay(This,Param,pValue) \ - (This)->lpVtbl -> GetTCDisplay(This,Param,pValue) - -#define IAMTimecodeDisplay_SetTCDisplay(This,Param,Value) \ - (This)->lpVtbl -> SetTCDisplay(This,Param,Value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMTimecodeDisplay_GetTCDisplayEnable_Proxy( - IAMTimecodeDisplay * This, - /* [out] */ long *pState); - - -void __RPC_STUB IAMTimecodeDisplay_GetTCDisplayEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeDisplay_SetTCDisplayEnable_Proxy( - IAMTimecodeDisplay * This, - /* [in] */ long State); - - -void __RPC_STUB IAMTimecodeDisplay_SetTCDisplayEnable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeDisplay_GetTCDisplay_Proxy( - IAMTimecodeDisplay * This, - /* [in] */ long Param, - /* [out] */ long *pValue); - - -void __RPC_STUB IAMTimecodeDisplay_GetTCDisplay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMTimecodeDisplay_SetTCDisplay_Proxy( - IAMTimecodeDisplay * This, - /* [in] */ long Param, - /* [in] */ long Value); - - -void __RPC_STUB IAMTimecodeDisplay_SetTCDisplay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMTimecodeDisplay_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0333 */ -/* [local] */ - -typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0333_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0333_v0_0_s_ifspec; - -#ifndef __IAMDevMemoryAllocator_INTERFACE_DEFINED__ -#define __IAMDevMemoryAllocator_INTERFACE_DEFINED__ - -/* interface IAMDevMemoryAllocator */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMDevMemoryAllocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c6545bf0-e76b-11d0-bd52-00a0c911ce86") - IAMDevMemoryAllocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetInfo( - /* [out] */ DWORD *pdwcbTotalFree, - /* [out] */ DWORD *pdwcbLargestFree, - /* [out] */ DWORD *pdwcbTotalMemory, - /* [out] */ DWORD *pdwcbMinimumChunk) = 0; - - virtual HRESULT STDMETHODCALLTYPE CheckMemory( - /* [in] */ const BYTE *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE Alloc( - /* [out] */ BYTE **ppBuffer, - /* [out][in] */ DWORD *pdwcbBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE Free( - /* [in] */ BYTE *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDevMemoryObject( - /* [out] */ IUnknown **ppUnkInnner, - /* [in] */ IUnknown *pUnkOuter) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMDevMemoryAllocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMDevMemoryAllocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMDevMemoryAllocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMDevMemoryAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - IAMDevMemoryAllocator * This, - /* [out] */ DWORD *pdwcbTotalFree, - /* [out] */ DWORD *pdwcbLargestFree, - /* [out] */ DWORD *pdwcbTotalMemory, - /* [out] */ DWORD *pdwcbMinimumChunk); - - HRESULT ( STDMETHODCALLTYPE *CheckMemory )( - IAMDevMemoryAllocator * This, - /* [in] */ const BYTE *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *Alloc )( - IAMDevMemoryAllocator * This, - /* [out] */ BYTE **ppBuffer, - /* [out][in] */ DWORD *pdwcbBuffer); - - HRESULT ( STDMETHODCALLTYPE *Free )( - IAMDevMemoryAllocator * This, - /* [in] */ BYTE *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *GetDevMemoryObject )( - IAMDevMemoryAllocator * This, - /* [out] */ IUnknown **ppUnkInnner, - /* [in] */ IUnknown *pUnkOuter); - - END_INTERFACE - } IAMDevMemoryAllocatorVtbl; - - interface IAMDevMemoryAllocator - { - CONST_VTBL struct IAMDevMemoryAllocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMDevMemoryAllocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMDevMemoryAllocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMDevMemoryAllocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMDevMemoryAllocator_GetInfo(This,pdwcbTotalFree,pdwcbLargestFree,pdwcbTotalMemory,pdwcbMinimumChunk) \ - (This)->lpVtbl -> GetInfo(This,pdwcbTotalFree,pdwcbLargestFree,pdwcbTotalMemory,pdwcbMinimumChunk) - -#define IAMDevMemoryAllocator_CheckMemory(This,pBuffer) \ - (This)->lpVtbl -> CheckMemory(This,pBuffer) - -#define IAMDevMemoryAllocator_Alloc(This,ppBuffer,pdwcbBuffer) \ - (This)->lpVtbl -> Alloc(This,ppBuffer,pdwcbBuffer) - -#define IAMDevMemoryAllocator_Free(This,pBuffer) \ - (This)->lpVtbl -> Free(This,pBuffer) - -#define IAMDevMemoryAllocator_GetDevMemoryObject(This,ppUnkInnner,pUnkOuter) \ - (This)->lpVtbl -> GetDevMemoryObject(This,ppUnkInnner,pUnkOuter) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryAllocator_GetInfo_Proxy( - IAMDevMemoryAllocator * This, - /* [out] */ DWORD *pdwcbTotalFree, - /* [out] */ DWORD *pdwcbLargestFree, - /* [out] */ DWORD *pdwcbTotalMemory, - /* [out] */ DWORD *pdwcbMinimumChunk); - - -void __RPC_STUB IAMDevMemoryAllocator_GetInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryAllocator_CheckMemory_Proxy( - IAMDevMemoryAllocator * This, - /* [in] */ const BYTE *pBuffer); - - -void __RPC_STUB IAMDevMemoryAllocator_CheckMemory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryAllocator_Alloc_Proxy( - IAMDevMemoryAllocator * This, - /* [out] */ BYTE **ppBuffer, - /* [out][in] */ DWORD *pdwcbBuffer); - - -void __RPC_STUB IAMDevMemoryAllocator_Alloc_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryAllocator_Free_Proxy( - IAMDevMemoryAllocator * This, - /* [in] */ BYTE *pBuffer); - - -void __RPC_STUB IAMDevMemoryAllocator_Free_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryAllocator_GetDevMemoryObject_Proxy( - IAMDevMemoryAllocator * This, - /* [out] */ IUnknown **ppUnkInnner, - /* [in] */ IUnknown *pUnkOuter); - - -void __RPC_STUB IAMDevMemoryAllocator_GetDevMemoryObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMDevMemoryAllocator_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0334 */ -/* [local] */ - -typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0334_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0334_v0_0_s_ifspec; - -#ifndef __IAMDevMemoryControl_INTERFACE_DEFINED__ -#define __IAMDevMemoryControl_INTERFACE_DEFINED__ - -/* interface IAMDevMemoryControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMDevMemoryControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c6545bf1-e76b-11d0-bd52-00a0c911ce86") - IAMDevMemoryControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryWriteSync( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE WriteSync( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDevId( - /* [out] */ DWORD *pdwDevId) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMDevMemoryControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMDevMemoryControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMDevMemoryControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMDevMemoryControl * This); - - HRESULT ( STDMETHODCALLTYPE *QueryWriteSync )( - IAMDevMemoryControl * This); - - HRESULT ( STDMETHODCALLTYPE *WriteSync )( - IAMDevMemoryControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetDevId )( - IAMDevMemoryControl * This, - /* [out] */ DWORD *pdwDevId); - - END_INTERFACE - } IAMDevMemoryControlVtbl; - - interface IAMDevMemoryControl - { - CONST_VTBL struct IAMDevMemoryControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMDevMemoryControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMDevMemoryControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMDevMemoryControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMDevMemoryControl_QueryWriteSync(This) \ - (This)->lpVtbl -> QueryWriteSync(This) - -#define IAMDevMemoryControl_WriteSync(This) \ - (This)->lpVtbl -> WriteSync(This) - -#define IAMDevMemoryControl_GetDevId(This,pdwDevId) \ - (This)->lpVtbl -> GetDevId(This,pdwDevId) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryControl_QueryWriteSync_Proxy( - IAMDevMemoryControl * This); - - -void __RPC_STUB IAMDevMemoryControl_QueryWriteSync_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryControl_WriteSync_Proxy( - IAMDevMemoryControl * This); - - -void __RPC_STUB IAMDevMemoryControl_WriteSync_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDevMemoryControl_GetDevId_Proxy( - IAMDevMemoryControl * This, - /* [out] */ DWORD *pdwDevId); - - -void __RPC_STUB IAMDevMemoryControl_GetDevId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMDevMemoryControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0335 */ -/* [local] */ - -typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL; - - -enum _AMSTREAMSELECTINFOFLAGS - { AMSTREAMSELECTINFO_ENABLED = 0x1, - AMSTREAMSELECTINFO_EXCLUSIVE = 0x2 - } ; - -enum _AMSTREAMSELECTENABLEFLAGS - { AMSTREAMSELECTENABLE_ENABLE = 0x1, - AMSTREAMSELECTENABLE_ENABLEALL = 0x2 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0335_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0335_v0_0_s_ifspec; - -#ifndef __IAMStreamSelect_INTERFACE_DEFINED__ -#define __IAMStreamSelect_INTERFACE_DEFINED__ - -/* interface IAMStreamSelect */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMStreamSelect; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c1960960-17f5-11d1-abe1-00a0c905f375") - IAMStreamSelect : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Count( - /* [out] */ DWORD *pcStreams) = 0; - - virtual HRESULT STDMETHODCALLTYPE Info( - /* [in] */ long lIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ DWORD *pdwFlags, - /* [out] */ LCID *plcid, - /* [out] */ DWORD *pdwGroup, - /* [out] */ WCHAR **ppszName, - /* [out] */ IUnknown **ppObject, - /* [out] */ IUnknown **ppUnk) = 0; - - virtual HRESULT STDMETHODCALLTYPE Enable( - /* [in] */ long lIndex, - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMStreamSelectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMStreamSelect * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMStreamSelect * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMStreamSelect * This); - - HRESULT ( STDMETHODCALLTYPE *Count )( - IAMStreamSelect * This, - /* [out] */ DWORD *pcStreams); - - HRESULT ( STDMETHODCALLTYPE *Info )( - IAMStreamSelect * This, - /* [in] */ long lIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ DWORD *pdwFlags, - /* [out] */ LCID *plcid, - /* [out] */ DWORD *pdwGroup, - /* [out] */ WCHAR **ppszName, - /* [out] */ IUnknown **ppObject, - /* [out] */ IUnknown **ppUnk); - - HRESULT ( STDMETHODCALLTYPE *Enable )( - IAMStreamSelect * This, - /* [in] */ long lIndex, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } IAMStreamSelectVtbl; - - interface IAMStreamSelect - { - CONST_VTBL struct IAMStreamSelectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMStreamSelect_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMStreamSelect_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMStreamSelect_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMStreamSelect_Count(This,pcStreams) \ - (This)->lpVtbl -> Count(This,pcStreams) - -#define IAMStreamSelect_Info(This,lIndex,ppmt,pdwFlags,plcid,pdwGroup,ppszName,ppObject,ppUnk) \ - (This)->lpVtbl -> Info(This,lIndex,ppmt,pdwFlags,plcid,pdwGroup,ppszName,ppObject,ppUnk) - -#define IAMStreamSelect_Enable(This,lIndex,dwFlags) \ - (This)->lpVtbl -> Enable(This,lIndex,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMStreamSelect_Count_Proxy( - IAMStreamSelect * This, - /* [out] */ DWORD *pcStreams); - - -void __RPC_STUB IAMStreamSelect_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamSelect_Info_Proxy( - IAMStreamSelect * This, - /* [in] */ long lIndex, - /* [out] */ AM_MEDIA_TYPE **ppmt, - /* [out] */ DWORD *pdwFlags, - /* [out] */ LCID *plcid, - /* [out] */ DWORD *pdwGroup, - /* [out] */ WCHAR **ppszName, - /* [out] */ IUnknown **ppObject, - /* [out] */ IUnknown **ppUnk); - - -void __RPC_STUB IAMStreamSelect_Info_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMStreamSelect_Enable_Proxy( - IAMStreamSelect * This, - /* [in] */ long lIndex, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMStreamSelect_Enable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMStreamSelect_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0336 */ -/* [local] */ - -typedef IAMStreamSelect *PAMSTREAMSELECT; - - -enum _AMRESCTL_RESERVEFLAGS - { AMRESCTL_RESERVEFLAGS_RESERVE = 0, - AMRESCTL_RESERVEFLAGS_UNRESERVE = 0x1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0336_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0336_v0_0_s_ifspec; - -#ifndef __IAMResourceControl_INTERFACE_DEFINED__ -#define __IAMResourceControl_INTERFACE_DEFINED__ - -/* interface IAMResourceControl */ -/* [local][unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMResourceControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8389d2d0-77d7-11d1-abe6-00a0c905f375") - IAMResourceControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Reserve( - /* [in] */ DWORD dwFlags, - /* [in] */ PVOID pvReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMResourceControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMResourceControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMResourceControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMResourceControl * This); - - HRESULT ( STDMETHODCALLTYPE *Reserve )( - IAMResourceControl * This, - /* [in] */ DWORD dwFlags, - /* [in] */ PVOID pvReserved); - - END_INTERFACE - } IAMResourceControlVtbl; - - interface IAMResourceControl - { - CONST_VTBL struct IAMResourceControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMResourceControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMResourceControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMResourceControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMResourceControl_Reserve(This,dwFlags,pvReserved) \ - (This)->lpVtbl -> Reserve(This,dwFlags,pvReserved) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMResourceControl_Reserve_Proxy( - IAMResourceControl * This, - /* [in] */ DWORD dwFlags, - /* [in] */ PVOID pvReserved); - - -void __RPC_STUB IAMResourceControl_Reserve_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMResourceControl_INTERFACE_DEFINED__ */ - - -#ifndef __IAMClockAdjust_INTERFACE_DEFINED__ -#define __IAMClockAdjust_INTERFACE_DEFINED__ - -/* interface IAMClockAdjust */ -/* [local][unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMClockAdjust; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4d5466b0-a49c-11d1-abe8-00a0c905f375") - IAMClockAdjust : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetClockDelta( - /* [in] */ REFERENCE_TIME rtDelta) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMClockAdjustVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMClockAdjust * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMClockAdjust * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMClockAdjust * This); - - HRESULT ( STDMETHODCALLTYPE *SetClockDelta )( - IAMClockAdjust * This, - /* [in] */ REFERENCE_TIME rtDelta); - - END_INTERFACE - } IAMClockAdjustVtbl; - - interface IAMClockAdjust - { - CONST_VTBL struct IAMClockAdjustVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMClockAdjust_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMClockAdjust_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMClockAdjust_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMClockAdjust_SetClockDelta(This,rtDelta) \ - (This)->lpVtbl -> SetClockDelta(This,rtDelta) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMClockAdjust_SetClockDelta_Proxy( - IAMClockAdjust * This, - /* [in] */ REFERENCE_TIME rtDelta); - - -void __RPC_STUB IAMClockAdjust_SetClockDelta_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMClockAdjust_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0338 */ -/* [local] */ - - -enum _AM_FILTER_MISC_FLAGS - { AM_FILTER_MISC_FLAGS_IS_RENDERER = 0x1, - AM_FILTER_MISC_FLAGS_IS_SOURCE = 0x2 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0338_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0338_v0_0_s_ifspec; - -#ifndef __IAMFilterMiscFlags_INTERFACE_DEFINED__ -#define __IAMFilterMiscFlags_INTERFACE_DEFINED__ - -/* interface IAMFilterMiscFlags */ -/* [local][unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMFilterMiscFlags; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2dd74950-a890-11d1-abe8-00a0c905f375") - IAMFilterMiscFlags : public IUnknown - { - public: - virtual ULONG STDMETHODCALLTYPE GetMiscFlags( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMFilterMiscFlagsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMFilterMiscFlags * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMFilterMiscFlags * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMFilterMiscFlags * This); - - ULONG ( STDMETHODCALLTYPE *GetMiscFlags )( - IAMFilterMiscFlags * This); - - END_INTERFACE - } IAMFilterMiscFlagsVtbl; - - interface IAMFilterMiscFlags - { - CONST_VTBL struct IAMFilterMiscFlagsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMFilterMiscFlags_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMFilterMiscFlags_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMFilterMiscFlags_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMFilterMiscFlags_GetMiscFlags(This) \ - (This)->lpVtbl -> GetMiscFlags(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -ULONG STDMETHODCALLTYPE IAMFilterMiscFlags_GetMiscFlags_Proxy( - IAMFilterMiscFlags * This); - - -void __RPC_STUB IAMFilterMiscFlags_GetMiscFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMFilterMiscFlags_INTERFACE_DEFINED__ */ - - -#ifndef __IDrawVideoImage_INTERFACE_DEFINED__ -#define __IDrawVideoImage_INTERFACE_DEFINED__ - -/* interface IDrawVideoImage */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDrawVideoImage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("48efb120-ab49-11d2-aed2-00a0c995e8d5") - IDrawVideoImage : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE DrawVideoImageBegin( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE DrawVideoImageEnd( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE DrawVideoImageDraw( - /* [in] */ HDC hdc, - /* [in] */ LPRECT lprcSrc, - /* [in] */ LPRECT lprcDst) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDrawVideoImageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDrawVideoImage * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDrawVideoImage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDrawVideoImage * This); - - HRESULT ( STDMETHODCALLTYPE *DrawVideoImageBegin )( - IDrawVideoImage * This); - - HRESULT ( STDMETHODCALLTYPE *DrawVideoImageEnd )( - IDrawVideoImage * This); - - HRESULT ( STDMETHODCALLTYPE *DrawVideoImageDraw )( - IDrawVideoImage * This, - /* [in] */ HDC hdc, - /* [in] */ LPRECT lprcSrc, - /* [in] */ LPRECT lprcDst); - - END_INTERFACE - } IDrawVideoImageVtbl; - - interface IDrawVideoImage - { - CONST_VTBL struct IDrawVideoImageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDrawVideoImage_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDrawVideoImage_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDrawVideoImage_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDrawVideoImage_DrawVideoImageBegin(This) \ - (This)->lpVtbl -> DrawVideoImageBegin(This) - -#define IDrawVideoImage_DrawVideoImageEnd(This) \ - (This)->lpVtbl -> DrawVideoImageEnd(This) - -#define IDrawVideoImage_DrawVideoImageDraw(This,hdc,lprcSrc,lprcDst) \ - (This)->lpVtbl -> DrawVideoImageDraw(This,hdc,lprcSrc,lprcDst) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDrawVideoImage_DrawVideoImageBegin_Proxy( - IDrawVideoImage * This); - - -void __RPC_STUB IDrawVideoImage_DrawVideoImageBegin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDrawVideoImage_DrawVideoImageEnd_Proxy( - IDrawVideoImage * This); - - -void __RPC_STUB IDrawVideoImage_DrawVideoImageEnd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDrawVideoImage_DrawVideoImageDraw_Proxy( - IDrawVideoImage * This, - /* [in] */ HDC hdc, - /* [in] */ LPRECT lprcSrc, - /* [in] */ LPRECT lprcDst); - - -void __RPC_STUB IDrawVideoImage_DrawVideoImageDraw_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDrawVideoImage_INTERFACE_DEFINED__ */ - - -#ifndef __IDecimateVideoImage_INTERFACE_DEFINED__ -#define __IDecimateVideoImage_INTERFACE_DEFINED__ - -/* interface IDecimateVideoImage */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDecimateVideoImage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2e5ea3e0-e924-11d2-b6da-00a0c995e8df") - IDecimateVideoImage : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetDecimationImageSize( - /* [in] */ long lWidth, - /* [in] */ long lHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE ResetDecimationImageSize( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDecimateVideoImageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDecimateVideoImage * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDecimateVideoImage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDecimateVideoImage * This); - - HRESULT ( STDMETHODCALLTYPE *SetDecimationImageSize )( - IDecimateVideoImage * This, - /* [in] */ long lWidth, - /* [in] */ long lHeight); - - HRESULT ( STDMETHODCALLTYPE *ResetDecimationImageSize )( - IDecimateVideoImage * This); - - END_INTERFACE - } IDecimateVideoImageVtbl; - - interface IDecimateVideoImage - { - CONST_VTBL struct IDecimateVideoImageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDecimateVideoImage_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDecimateVideoImage_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDecimateVideoImage_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDecimateVideoImage_SetDecimationImageSize(This,lWidth,lHeight) \ - (This)->lpVtbl -> SetDecimationImageSize(This,lWidth,lHeight) - -#define IDecimateVideoImage_ResetDecimationImageSize(This) \ - (This)->lpVtbl -> ResetDecimationImageSize(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDecimateVideoImage_SetDecimationImageSize_Proxy( - IDecimateVideoImage * This, - /* [in] */ long lWidth, - /* [in] */ long lHeight); - - -void __RPC_STUB IDecimateVideoImage_SetDecimationImageSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDecimateVideoImage_ResetDecimationImageSize_Proxy( - IDecimateVideoImage * This); - - -void __RPC_STUB IDecimateVideoImage_ResetDecimationImageSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDecimateVideoImage_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0341 */ -/* [local] */ - -typedef -enum _DECIMATION_USAGE - { DECIMATION_LEGACY = 0, - DECIMATION_USE_DECODER_ONLY = DECIMATION_LEGACY + 1, - DECIMATION_USE_VIDEOPORT_ONLY = DECIMATION_USE_DECODER_ONLY + 1, - DECIMATION_USE_OVERLAY_ONLY = DECIMATION_USE_VIDEOPORT_ONLY + 1, - DECIMATION_DEFAULT = DECIMATION_USE_OVERLAY_ONLY + 1 - } DECIMATION_USAGE; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0341_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0341_v0_0_s_ifspec; - -#ifndef __IAMVideoDecimationProperties_INTERFACE_DEFINED__ -#define __IAMVideoDecimationProperties_INTERFACE_DEFINED__ - -/* interface IAMVideoDecimationProperties */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMVideoDecimationProperties; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("60d32930-13da-11d3-9ec6-c4fcaef5c7be") - IAMVideoDecimationProperties : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryDecimationUsage( - /* [out] */ DECIMATION_USAGE *lpUsage) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDecimationUsage( - /* [in] */ DECIMATION_USAGE Usage) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoDecimationPropertiesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoDecimationProperties * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoDecimationProperties * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoDecimationProperties * This); - - HRESULT ( STDMETHODCALLTYPE *QueryDecimationUsage )( - IAMVideoDecimationProperties * This, - /* [out] */ DECIMATION_USAGE *lpUsage); - - HRESULT ( STDMETHODCALLTYPE *SetDecimationUsage )( - IAMVideoDecimationProperties * This, - /* [in] */ DECIMATION_USAGE Usage); - - END_INTERFACE - } IAMVideoDecimationPropertiesVtbl; - - interface IAMVideoDecimationProperties - { - CONST_VTBL struct IAMVideoDecimationPropertiesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoDecimationProperties_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoDecimationProperties_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoDecimationProperties_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoDecimationProperties_QueryDecimationUsage(This,lpUsage) \ - (This)->lpVtbl -> QueryDecimationUsage(This,lpUsage) - -#define IAMVideoDecimationProperties_SetDecimationUsage(This,Usage) \ - (This)->lpVtbl -> SetDecimationUsage(This,Usage) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoDecimationProperties_QueryDecimationUsage_Proxy( - IAMVideoDecimationProperties * This, - /* [out] */ DECIMATION_USAGE *lpUsage); - - -void __RPC_STUB IAMVideoDecimationProperties_QueryDecimationUsage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoDecimationProperties_SetDecimationUsage_Proxy( - IAMVideoDecimationProperties * This, - /* [in] */ DECIMATION_USAGE Usage); - - -void __RPC_STUB IAMVideoDecimationProperties_SetDecimationUsage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoDecimationProperties_INTERFACE_DEFINED__ */ - - -#ifndef __IVideoFrameStep_INTERFACE_DEFINED__ -#define __IVideoFrameStep_INTERFACE_DEFINED__ - -/* interface IVideoFrameStep */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IVideoFrameStep; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e46a9787-2b71-444d-a4b5-1fab7b708d6a") - IVideoFrameStep : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Step( - DWORD dwFrames, - /* [unique] */ IUnknown *pStepObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE CanStep( - long bMultiple, - /* [unique] */ IUnknown *pStepObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE CancelStep( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVideoFrameStepVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVideoFrameStep * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVideoFrameStep * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVideoFrameStep * This); - - HRESULT ( STDMETHODCALLTYPE *Step )( - IVideoFrameStep * This, - DWORD dwFrames, - /* [unique] */ IUnknown *pStepObject); - - HRESULT ( STDMETHODCALLTYPE *CanStep )( - IVideoFrameStep * This, - long bMultiple, - /* [unique] */ IUnknown *pStepObject); - - HRESULT ( STDMETHODCALLTYPE *CancelStep )( - IVideoFrameStep * This); - - END_INTERFACE - } IVideoFrameStepVtbl; - - interface IVideoFrameStep - { - CONST_VTBL struct IVideoFrameStepVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVideoFrameStep_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVideoFrameStep_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVideoFrameStep_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVideoFrameStep_Step(This,dwFrames,pStepObject) \ - (This)->lpVtbl -> Step(This,dwFrames,pStepObject) - -#define IVideoFrameStep_CanStep(This,bMultiple,pStepObject) \ - (This)->lpVtbl -> CanStep(This,bMultiple,pStepObject) - -#define IVideoFrameStep_CancelStep(This) \ - (This)->lpVtbl -> CancelStep(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVideoFrameStep_Step_Proxy( - IVideoFrameStep * This, - DWORD dwFrames, - /* [unique] */ IUnknown *pStepObject); - - -void __RPC_STUB IVideoFrameStep_Step_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoFrameStep_CanStep_Proxy( - IVideoFrameStep * This, - long bMultiple, - /* [unique] */ IUnknown *pStepObject); - - -void __RPC_STUB IVideoFrameStep_CanStep_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVideoFrameStep_CancelStep_Proxy( - IVideoFrameStep * This); - - -void __RPC_STUB IVideoFrameStep_CancelStep_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVideoFrameStep_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0343 */ -/* [local] */ - - -enum _AM_PUSHSOURCE_FLAGS - { AM_PUSHSOURCECAPS_INTERNAL_RM = 0x1, - AM_PUSHSOURCECAPS_NOT_LIVE = 0x2, - AM_PUSHSOURCECAPS_PRIVATE_CLOCK = 0x4, - AM_PUSHSOURCEREQS_USE_STREAM_CLOCK = 0x10000 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0343_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0343_v0_0_s_ifspec; - -#ifndef __IAMLatency_INTERFACE_DEFINED__ -#define __IAMLatency_INTERFACE_DEFINED__ - -/* interface IAMLatency */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMLatency; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("62EA93BA-EC62-11d2-B770-00C04FB6BD3D") - IAMLatency : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetLatency( - /* [in] */ REFERENCE_TIME *prtLatency) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMLatencyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMLatency * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMLatency * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMLatency * This); - - HRESULT ( STDMETHODCALLTYPE *GetLatency )( - IAMLatency * This, - /* [in] */ REFERENCE_TIME *prtLatency); - - END_INTERFACE - } IAMLatencyVtbl; - - interface IAMLatency - { - CONST_VTBL struct IAMLatencyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMLatency_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMLatency_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMLatency_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMLatency_GetLatency(This,prtLatency) \ - (This)->lpVtbl -> GetLatency(This,prtLatency) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMLatency_GetLatency_Proxy( - IAMLatency * This, - /* [in] */ REFERENCE_TIME *prtLatency); - - -void __RPC_STUB IAMLatency_GetLatency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMLatency_INTERFACE_DEFINED__ */ - - -#ifndef __IAMPushSource_INTERFACE_DEFINED__ -#define __IAMPushSource_INTERFACE_DEFINED__ - -/* interface IAMPushSource */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMPushSource; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F185FE76-E64E-11d2-B76E-00C04FB6BD3D") - IAMPushSource : public IAMLatency - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPushSourceFlags( - /* [out] */ ULONG *pFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPushSourceFlags( - /* [in] */ ULONG Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStreamOffset( - /* [in] */ REFERENCE_TIME rtOffset) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStreamOffset( - /* [out] */ REFERENCE_TIME *prtOffset) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMaxStreamOffset( - /* [out] */ REFERENCE_TIME *prtMaxOffset) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMaxStreamOffset( - /* [in] */ REFERENCE_TIME rtMaxOffset) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMPushSourceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMPushSource * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMPushSource * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMPushSource * This); - - HRESULT ( STDMETHODCALLTYPE *GetLatency )( - IAMPushSource * This, - /* [in] */ REFERENCE_TIME *prtLatency); - - HRESULT ( STDMETHODCALLTYPE *GetPushSourceFlags )( - IAMPushSource * This, - /* [out] */ ULONG *pFlags); - - HRESULT ( STDMETHODCALLTYPE *SetPushSourceFlags )( - IAMPushSource * This, - /* [in] */ ULONG Flags); - - HRESULT ( STDMETHODCALLTYPE *SetStreamOffset )( - IAMPushSource * This, - /* [in] */ REFERENCE_TIME rtOffset); - - HRESULT ( STDMETHODCALLTYPE *GetStreamOffset )( - IAMPushSource * This, - /* [out] */ REFERENCE_TIME *prtOffset); - - HRESULT ( STDMETHODCALLTYPE *GetMaxStreamOffset )( - IAMPushSource * This, - /* [out] */ REFERENCE_TIME *prtMaxOffset); - - HRESULT ( STDMETHODCALLTYPE *SetMaxStreamOffset )( - IAMPushSource * This, - /* [in] */ REFERENCE_TIME rtMaxOffset); - - END_INTERFACE - } IAMPushSourceVtbl; - - interface IAMPushSource - { - CONST_VTBL struct IAMPushSourceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMPushSource_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMPushSource_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMPushSource_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMPushSource_GetLatency(This,prtLatency) \ - (This)->lpVtbl -> GetLatency(This,prtLatency) - - -#define IAMPushSource_GetPushSourceFlags(This,pFlags) \ - (This)->lpVtbl -> GetPushSourceFlags(This,pFlags) - -#define IAMPushSource_SetPushSourceFlags(This,Flags) \ - (This)->lpVtbl -> SetPushSourceFlags(This,Flags) - -#define IAMPushSource_SetStreamOffset(This,rtOffset) \ - (This)->lpVtbl -> SetStreamOffset(This,rtOffset) - -#define IAMPushSource_GetStreamOffset(This,prtOffset) \ - (This)->lpVtbl -> GetStreamOffset(This,prtOffset) - -#define IAMPushSource_GetMaxStreamOffset(This,prtMaxOffset) \ - (This)->lpVtbl -> GetMaxStreamOffset(This,prtMaxOffset) - -#define IAMPushSource_SetMaxStreamOffset(This,rtMaxOffset) \ - (This)->lpVtbl -> SetMaxStreamOffset(This,rtMaxOffset) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMPushSource_GetPushSourceFlags_Proxy( - IAMPushSource * This, - /* [out] */ ULONG *pFlags); - - -void __RPC_STUB IAMPushSource_GetPushSourceFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPushSource_SetPushSourceFlags_Proxy( - IAMPushSource * This, - /* [in] */ ULONG Flags); - - -void __RPC_STUB IAMPushSource_SetPushSourceFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPushSource_SetStreamOffset_Proxy( - IAMPushSource * This, - /* [in] */ REFERENCE_TIME rtOffset); - - -void __RPC_STUB IAMPushSource_SetStreamOffset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPushSource_GetStreamOffset_Proxy( - IAMPushSource * This, - /* [out] */ REFERENCE_TIME *prtOffset); - - -void __RPC_STUB IAMPushSource_GetStreamOffset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPushSource_GetMaxStreamOffset_Proxy( - IAMPushSource * This, - /* [out] */ REFERENCE_TIME *prtMaxOffset); - - -void __RPC_STUB IAMPushSource_GetMaxStreamOffset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMPushSource_SetMaxStreamOffset_Proxy( - IAMPushSource * This, - /* [in] */ REFERENCE_TIME rtMaxOffset); - - -void __RPC_STUB IAMPushSource_SetMaxStreamOffset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMPushSource_INTERFACE_DEFINED__ */ - - -#ifndef __IAMDeviceRemoval_INTERFACE_DEFINED__ -#define __IAMDeviceRemoval_INTERFACE_DEFINED__ - -/* interface IAMDeviceRemoval */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMDeviceRemoval; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("f90a6130-b658-11d2-ae49-0000f8754b99") - IAMDeviceRemoval : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE DeviceInfo( - /* [out] */ CLSID *pclsidInterfaceClass, - /* [out] */ WCHAR **pwszSymbolicLink) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reassociate( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Disassociate( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMDeviceRemovalVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMDeviceRemoval * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMDeviceRemoval * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMDeviceRemoval * This); - - HRESULT ( STDMETHODCALLTYPE *DeviceInfo )( - IAMDeviceRemoval * This, - /* [out] */ CLSID *pclsidInterfaceClass, - /* [out] */ WCHAR **pwszSymbolicLink); - - HRESULT ( STDMETHODCALLTYPE *Reassociate )( - IAMDeviceRemoval * This); - - HRESULT ( STDMETHODCALLTYPE *Disassociate )( - IAMDeviceRemoval * This); - - END_INTERFACE - } IAMDeviceRemovalVtbl; - - interface IAMDeviceRemoval - { - CONST_VTBL struct IAMDeviceRemovalVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMDeviceRemoval_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMDeviceRemoval_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMDeviceRemoval_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMDeviceRemoval_DeviceInfo(This,pclsidInterfaceClass,pwszSymbolicLink) \ - (This)->lpVtbl -> DeviceInfo(This,pclsidInterfaceClass,pwszSymbolicLink) - -#define IAMDeviceRemoval_Reassociate(This) \ - (This)->lpVtbl -> Reassociate(This) - -#define IAMDeviceRemoval_Disassociate(This) \ - (This)->lpVtbl -> Disassociate(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMDeviceRemoval_DeviceInfo_Proxy( - IAMDeviceRemoval * This, - /* [out] */ CLSID *pclsidInterfaceClass, - /* [out] */ WCHAR **pwszSymbolicLink); - - -void __RPC_STUB IAMDeviceRemoval_DeviceInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDeviceRemoval_Reassociate_Proxy( - IAMDeviceRemoval * This); - - -void __RPC_STUB IAMDeviceRemoval_Reassociate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMDeviceRemoval_Disassociate_Proxy( - IAMDeviceRemoval * This); - - -void __RPC_STUB IAMDeviceRemoval_Disassociate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMDeviceRemoval_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0345 */ -/* [local] */ - -typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_strmif_0345_0001 - { - DWORD dwDVAAuxSrc; - DWORD dwDVAAuxCtl; - DWORD dwDVAAuxSrc1; - DWORD dwDVAAuxCtl1; - DWORD dwDVVAuxSrc; - DWORD dwDVVAuxCtl; - DWORD dwDVReserved[ 2 ]; - } DVINFO; - -typedef struct __MIDL___MIDL_itf_strmif_0345_0001 *PDVINFO; - - -enum _DVENCODERRESOLUTION - { DVENCODERRESOLUTION_720x480 = 2012, - DVENCODERRESOLUTION_360x240 = 2013, - DVENCODERRESOLUTION_180x120 = 2014, - DVENCODERRESOLUTION_88x60 = 2015 - } ; - -enum _DVENCODERVIDEOFORMAT - { DVENCODERVIDEOFORMAT_NTSC = 2000, - DVENCODERVIDEOFORMAT_PAL = 2001 - } ; - -enum _DVENCODERFORMAT - { DVENCODERFORMAT_DVSD = 2007, - DVENCODERFORMAT_DVHD = 2008, - DVENCODERFORMAT_DVSL = 2009 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0345_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0345_v0_0_s_ifspec; - -#ifndef __IDVEnc_INTERFACE_DEFINED__ -#define __IDVEnc_INTERFACE_DEFINED__ - -/* interface IDVEnc */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDVEnc; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d18e17a0-aacb-11d0-afb0-00aa00b67a42") - IDVEnc : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_IFormatResolution( - /* [out] */ int *VideoFormat, - /* [out] */ int *DVFormat, - /* [out] */ int *Resolution, - /* [in] */ BYTE fDVInfo, - /* [out] */ DVINFO *sDVInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_IFormatResolution( - /* [in] */ int VideoFormat, - /* [in] */ int DVFormat, - /* [in] */ int Resolution, - /* [in] */ BYTE fDVInfo, - /* [in] */ DVINFO *sDVInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVEncVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVEnc * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVEnc * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVEnc * This); - - HRESULT ( STDMETHODCALLTYPE *get_IFormatResolution )( - IDVEnc * This, - /* [out] */ int *VideoFormat, - /* [out] */ int *DVFormat, - /* [out] */ int *Resolution, - /* [in] */ BYTE fDVInfo, - /* [out] */ DVINFO *sDVInfo); - - HRESULT ( STDMETHODCALLTYPE *put_IFormatResolution )( - IDVEnc * This, - /* [in] */ int VideoFormat, - /* [in] */ int DVFormat, - /* [in] */ int Resolution, - /* [in] */ BYTE fDVInfo, - /* [in] */ DVINFO *sDVInfo); - - END_INTERFACE - } IDVEncVtbl; - - interface IDVEnc - { - CONST_VTBL struct IDVEncVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVEnc_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVEnc_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVEnc_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVEnc_get_IFormatResolution(This,VideoFormat,DVFormat,Resolution,fDVInfo,sDVInfo) \ - (This)->lpVtbl -> get_IFormatResolution(This,VideoFormat,DVFormat,Resolution,fDVInfo,sDVInfo) - -#define IDVEnc_put_IFormatResolution(This,VideoFormat,DVFormat,Resolution,fDVInfo,sDVInfo) \ - (This)->lpVtbl -> put_IFormatResolution(This,VideoFormat,DVFormat,Resolution,fDVInfo,sDVInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDVEnc_get_IFormatResolution_Proxy( - IDVEnc * This, - /* [out] */ int *VideoFormat, - /* [out] */ int *DVFormat, - /* [out] */ int *Resolution, - /* [in] */ BYTE fDVInfo, - /* [out] */ DVINFO *sDVInfo); - - -void __RPC_STUB IDVEnc_get_IFormatResolution_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDVEnc_put_IFormatResolution_Proxy( - IDVEnc * This, - /* [in] */ int VideoFormat, - /* [in] */ int DVFormat, - /* [in] */ int Resolution, - /* [in] */ BYTE fDVInfo, - /* [in] */ DVINFO *sDVInfo); - - -void __RPC_STUB IDVEnc_put_IFormatResolution_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVEnc_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0346 */ -/* [local] */ - - -enum _DVDECODERRESOLUTION - { DVDECODERRESOLUTION_720x480 = 1000, - DVDECODERRESOLUTION_360x240 = 1001, - DVDECODERRESOLUTION_180x120 = 1002, - DVDECODERRESOLUTION_88x60 = 1003 - } ; - -enum _DVRESOLUTION - { DVRESOLUTION_FULL = 1000, - DVRESOLUTION_HALF = 1001, - DVRESOLUTION_QUARTER = 1002, - DVRESOLUTION_DC = 1003 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0346_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0346_v0_0_s_ifspec; - -#ifndef __IIPDVDec_INTERFACE_DEFINED__ -#define __IIPDVDec_INTERFACE_DEFINED__ - -/* interface IIPDVDec */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IIPDVDec; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("b8e8bd60-0bfe-11d0-af91-00aa00b67a42") - IIPDVDec : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_IPDisplay( - /* [out] */ int *displayPix) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_IPDisplay( - /* [in] */ int displayPix) = 0; - - }; - -#else /* C style interface */ - - typedef struct IIPDVDecVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IIPDVDec * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IIPDVDec * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IIPDVDec * This); - - HRESULT ( STDMETHODCALLTYPE *get_IPDisplay )( - IIPDVDec * This, - /* [out] */ int *displayPix); - - HRESULT ( STDMETHODCALLTYPE *put_IPDisplay )( - IIPDVDec * This, - /* [in] */ int displayPix); - - END_INTERFACE - } IIPDVDecVtbl; - - interface IIPDVDec - { - CONST_VTBL struct IIPDVDecVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IIPDVDec_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IIPDVDec_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IIPDVDec_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IIPDVDec_get_IPDisplay(This,displayPix) \ - (This)->lpVtbl -> get_IPDisplay(This,displayPix) - -#define IIPDVDec_put_IPDisplay(This,displayPix) \ - (This)->lpVtbl -> put_IPDisplay(This,displayPix) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IIPDVDec_get_IPDisplay_Proxy( - IIPDVDec * This, - /* [out] */ int *displayPix); - - -void __RPC_STUB IIPDVDec_get_IPDisplay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IIPDVDec_put_IPDisplay_Proxy( - IIPDVDec * This, - /* [in] */ int displayPix); - - -void __RPC_STUB IIPDVDec_put_IPDisplay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IIPDVDec_INTERFACE_DEFINED__ */ - - -#ifndef __IDVRGB219_INTERFACE_DEFINED__ -#define __IDVRGB219_INTERFACE_DEFINED__ - -/* interface IDVRGB219 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDVRGB219; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("58473A19-2BC8-4663-8012-25F81BABDDD1") - IDVRGB219 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetRGB219( - /* [in] */ BOOL bState) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVRGB219Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVRGB219 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVRGB219 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVRGB219 * This); - - HRESULT ( STDMETHODCALLTYPE *SetRGB219 )( - IDVRGB219 * This, - /* [in] */ BOOL bState); - - END_INTERFACE - } IDVRGB219Vtbl; - - interface IDVRGB219 - { - CONST_VTBL struct IDVRGB219Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVRGB219_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVRGB219_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVRGB219_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVRGB219_SetRGB219(This,bState) \ - (This)->lpVtbl -> SetRGB219(This,bState) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDVRGB219_SetRGB219_Proxy( - IDVRGB219 * This, - /* [in] */ BOOL bState); - - -void __RPC_STUB IDVRGB219_SetRGB219_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVRGB219_INTERFACE_DEFINED__ */ - - -#ifndef __IDVSplitter_INTERFACE_DEFINED__ -#define __IDVSplitter_INTERFACE_DEFINED__ - -/* interface IDVSplitter */ -/* [uuid][object] */ - - -EXTERN_C const IID IID_IDVSplitter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("92a3a302-da7c-4a1f-ba7e-1802bb5d2d02") - IDVSplitter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE DiscardAlternateVideoFrames( - /* [in] */ int nDiscard) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVSplitterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVSplitter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVSplitter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVSplitter * This); - - HRESULT ( STDMETHODCALLTYPE *DiscardAlternateVideoFrames )( - IDVSplitter * This, - /* [in] */ int nDiscard); - - END_INTERFACE - } IDVSplitterVtbl; - - interface IDVSplitter - { - CONST_VTBL struct IDVSplitterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVSplitter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVSplitter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVSplitter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVSplitter_DiscardAlternateVideoFrames(This,nDiscard) \ - (This)->lpVtbl -> DiscardAlternateVideoFrames(This,nDiscard) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDVSplitter_DiscardAlternateVideoFrames_Proxy( - IDVSplitter * This, - /* [in] */ int nDiscard); - - -void __RPC_STUB IDVSplitter_DiscardAlternateVideoFrames_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVSplitter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0349 */ -/* [local] */ - - -enum _AM_AUDIO_RENDERER_STAT_PARAM - { AM_AUDREND_STAT_PARAM_BREAK_COUNT = 1, - AM_AUDREND_STAT_PARAM_SLAVE_MODE = AM_AUDREND_STAT_PARAM_BREAK_COUNT + 1, - AM_AUDREND_STAT_PARAM_SILENCE_DUR = AM_AUDREND_STAT_PARAM_SLAVE_MODE + 1, - AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR = AM_AUDREND_STAT_PARAM_SILENCE_DUR + 1, - AM_AUDREND_STAT_PARAM_DISCONTINUITIES = AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR + 1, - AM_AUDREND_STAT_PARAM_SLAVE_RATE = AM_AUDREND_STAT_PARAM_DISCONTINUITIES + 1, - AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR = AM_AUDREND_STAT_PARAM_SLAVE_RATE + 1, - AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR = AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR + 1, - AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR = AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR + 1, - AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR = AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR + 1, - AM_AUDREND_STAT_PARAM_BUFFERFULLNESS = AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR + 1, - AM_AUDREND_STAT_PARAM_JITTER = AM_AUDREND_STAT_PARAM_BUFFERFULLNESS + 1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0349_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0349_v0_0_s_ifspec; - -#ifndef __IAMAudioRendererStats_INTERFACE_DEFINED__ -#define __IAMAudioRendererStats_INTERFACE_DEFINED__ - -/* interface IAMAudioRendererStats */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMAudioRendererStats; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93") - IAMAudioRendererStats : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetStatParam( - /* [in] */ DWORD dwParam, - /* [out] */ DWORD *pdwParam1, - /* [out] */ DWORD *pdwParam2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMAudioRendererStatsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMAudioRendererStats * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMAudioRendererStats * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMAudioRendererStats * This); - - HRESULT ( STDMETHODCALLTYPE *GetStatParam )( - IAMAudioRendererStats * This, - /* [in] */ DWORD dwParam, - /* [out] */ DWORD *pdwParam1, - /* [out] */ DWORD *pdwParam2); - - END_INTERFACE - } IAMAudioRendererStatsVtbl; - - interface IAMAudioRendererStats - { - CONST_VTBL struct IAMAudioRendererStatsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMAudioRendererStats_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMAudioRendererStats_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMAudioRendererStats_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMAudioRendererStats_GetStatParam(This,dwParam,pdwParam1,pdwParam2) \ - (This)->lpVtbl -> GetStatParam(This,dwParam,pdwParam1,pdwParam2) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMAudioRendererStats_GetStatParam_Proxy( - IAMAudioRendererStats * This, - /* [in] */ DWORD dwParam, - /* [out] */ DWORD *pdwParam1, - /* [out] */ DWORD *pdwParam2); - - -void __RPC_STUB IAMAudioRendererStats_GetStatParam_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMAudioRendererStats_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0351 */ -/* [local] */ - - -enum _AM_INTF_SEARCH_FLAGS - { AM_INTF_SEARCH_INPUT_PIN = 0x1, - AM_INTF_SEARCH_OUTPUT_PIN = 0x2, - AM_INTF_SEARCH_FILTER = 0x4 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0351_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0351_v0_0_s_ifspec; - -#ifndef __IAMGraphStreams_INTERFACE_DEFINED__ -#define __IAMGraphStreams_INTERFACE_DEFINED__ - -/* interface IAMGraphStreams */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMGraphStreams; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("632105FA-072E-11d3-8AF9-00C04FB6BD3D") - IAMGraphStreams : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE FindUpstreamInterface( - /* [in] */ IPin *pPin, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvInterface, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SyncUsingStreamOffset( - /* [in] */ BOOL bUseStreamOffset) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMaxGraphLatency( - /* [in] */ REFERENCE_TIME rtMaxGraphLatency) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMGraphStreamsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMGraphStreams * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMGraphStreams * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMGraphStreams * This); - - HRESULT ( STDMETHODCALLTYPE *FindUpstreamInterface )( - IAMGraphStreams * This, - /* [in] */ IPin *pPin, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvInterface, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *SyncUsingStreamOffset )( - IAMGraphStreams * This, - /* [in] */ BOOL bUseStreamOffset); - - HRESULT ( STDMETHODCALLTYPE *SetMaxGraphLatency )( - IAMGraphStreams * This, - /* [in] */ REFERENCE_TIME rtMaxGraphLatency); - - END_INTERFACE - } IAMGraphStreamsVtbl; - - interface IAMGraphStreams - { - CONST_VTBL struct IAMGraphStreamsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMGraphStreams_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMGraphStreams_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMGraphStreams_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMGraphStreams_FindUpstreamInterface(This,pPin,riid,ppvInterface,dwFlags) \ - (This)->lpVtbl -> FindUpstreamInterface(This,pPin,riid,ppvInterface,dwFlags) - -#define IAMGraphStreams_SyncUsingStreamOffset(This,bUseStreamOffset) \ - (This)->lpVtbl -> SyncUsingStreamOffset(This,bUseStreamOffset) - -#define IAMGraphStreams_SetMaxGraphLatency(This,rtMaxGraphLatency) \ - (This)->lpVtbl -> SetMaxGraphLatency(This,rtMaxGraphLatency) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMGraphStreams_FindUpstreamInterface_Proxy( - IAMGraphStreams * This, - /* [in] */ IPin *pPin, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvInterface, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMGraphStreams_FindUpstreamInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMGraphStreams_SyncUsingStreamOffset_Proxy( - IAMGraphStreams * This, - /* [in] */ BOOL bUseStreamOffset); - - -void __RPC_STUB IAMGraphStreams_SyncUsingStreamOffset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMGraphStreams_SetMaxGraphLatency_Proxy( - IAMGraphStreams * This, - /* [in] */ REFERENCE_TIME rtMaxGraphLatency); - - -void __RPC_STUB IAMGraphStreams_SetMaxGraphLatency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMGraphStreams_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0352 */ -/* [local] */ - - -enum AMOVERLAYFX - { AMOVERFX_NOFX = 0, - AMOVERFX_MIRRORLEFTRIGHT = 0x2, - AMOVERFX_MIRRORUPDOWN = 0x4, - AMOVERFX_DEINTERLACE = 0x8 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0352_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0352_v0_0_s_ifspec; - -#ifndef __IAMOverlayFX_INTERFACE_DEFINED__ -#define __IAMOverlayFX_INTERFACE_DEFINED__ - -/* interface IAMOverlayFX */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMOverlayFX; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("62fae250-7e65-4460-bfc9-6398b322073c") - IAMOverlayFX : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryOverlayFXCaps( - /* [out] */ DWORD *lpdwOverlayFXCaps) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOverlayFX( - /* [in] */ DWORD dwOverlayFX) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOverlayFX( - /* [out] */ DWORD *lpdwOverlayFX) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMOverlayFXVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMOverlayFX * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMOverlayFX * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMOverlayFX * This); - - HRESULT ( STDMETHODCALLTYPE *QueryOverlayFXCaps )( - IAMOverlayFX * This, - /* [out] */ DWORD *lpdwOverlayFXCaps); - - HRESULT ( STDMETHODCALLTYPE *SetOverlayFX )( - IAMOverlayFX * This, - /* [in] */ DWORD dwOverlayFX); - - HRESULT ( STDMETHODCALLTYPE *GetOverlayFX )( - IAMOverlayFX * This, - /* [out] */ DWORD *lpdwOverlayFX); - - END_INTERFACE - } IAMOverlayFXVtbl; - - interface IAMOverlayFX - { - CONST_VTBL struct IAMOverlayFXVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMOverlayFX_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMOverlayFX_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMOverlayFX_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMOverlayFX_QueryOverlayFXCaps(This,lpdwOverlayFXCaps) \ - (This)->lpVtbl -> QueryOverlayFXCaps(This,lpdwOverlayFXCaps) - -#define IAMOverlayFX_SetOverlayFX(This,dwOverlayFX) \ - (This)->lpVtbl -> SetOverlayFX(This,dwOverlayFX) - -#define IAMOverlayFX_GetOverlayFX(This,lpdwOverlayFX) \ - (This)->lpVtbl -> GetOverlayFX(This,lpdwOverlayFX) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMOverlayFX_QueryOverlayFXCaps_Proxy( - IAMOverlayFX * This, - /* [out] */ DWORD *lpdwOverlayFXCaps); - - -void __RPC_STUB IAMOverlayFX_QueryOverlayFXCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMOverlayFX_SetOverlayFX_Proxy( - IAMOverlayFX * This, - /* [in] */ DWORD dwOverlayFX); - - -void __RPC_STUB IAMOverlayFX_SetOverlayFX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMOverlayFX_GetOverlayFX_Proxy( - IAMOverlayFX * This, - /* [out] */ DWORD *lpdwOverlayFX); - - -void __RPC_STUB IAMOverlayFX_GetOverlayFX_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMOverlayFX_INTERFACE_DEFINED__ */ - - -#ifndef __IAMOpenProgress_INTERFACE_DEFINED__ -#define __IAMOpenProgress_INTERFACE_DEFINED__ - -/* interface IAMOpenProgress */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMOpenProgress; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8E1C39A1-DE53-11cf-AA63-0080C744528D") - IAMOpenProgress : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE QueryProgress( - /* [out] */ LONGLONG *pllTotal, - /* [out] */ LONGLONG *pllCurrent) = 0; - - virtual HRESULT STDMETHODCALLTYPE AbortOperation( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMOpenProgressVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMOpenProgress * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMOpenProgress * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMOpenProgress * This); - - HRESULT ( STDMETHODCALLTYPE *QueryProgress )( - IAMOpenProgress * This, - /* [out] */ LONGLONG *pllTotal, - /* [out] */ LONGLONG *pllCurrent); - - HRESULT ( STDMETHODCALLTYPE *AbortOperation )( - IAMOpenProgress * This); - - END_INTERFACE - } IAMOpenProgressVtbl; - - interface IAMOpenProgress - { - CONST_VTBL struct IAMOpenProgressVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMOpenProgress_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMOpenProgress_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMOpenProgress_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMOpenProgress_QueryProgress(This,pllTotal,pllCurrent) \ - (This)->lpVtbl -> QueryProgress(This,pllTotal,pllCurrent) - -#define IAMOpenProgress_AbortOperation(This) \ - (This)->lpVtbl -> AbortOperation(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMOpenProgress_QueryProgress_Proxy( - IAMOpenProgress * This, - /* [out] */ LONGLONG *pllTotal, - /* [out] */ LONGLONG *pllCurrent); - - -void __RPC_STUB IAMOpenProgress_QueryProgress_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMOpenProgress_AbortOperation_Proxy( - IAMOpenProgress * This); - - -void __RPC_STUB IAMOpenProgress_AbortOperation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMOpenProgress_INTERFACE_DEFINED__ */ - - -#ifndef __IMpeg2Demultiplexer_INTERFACE_DEFINED__ -#define __IMpeg2Demultiplexer_INTERFACE_DEFINED__ - -/* interface IMpeg2Demultiplexer */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IMpeg2Demultiplexer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("436eee9c-264f-4242-90e1-4e330c107512") - IMpeg2Demultiplexer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateOutputPin( - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ LPWSTR pszPinName, - /* [out] */ IPin **ppIPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputPinMediaType( - /* [in] */ LPWSTR pszPinName, - /* [in] */ AM_MEDIA_TYPE *pMediaType) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeleteOutputPin( - /* [in] */ LPWSTR pszPinName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMpeg2DemultiplexerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMpeg2Demultiplexer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMpeg2Demultiplexer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMpeg2Demultiplexer * This); - - HRESULT ( STDMETHODCALLTYPE *CreateOutputPin )( - IMpeg2Demultiplexer * This, - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ LPWSTR pszPinName, - /* [out] */ IPin **ppIPin); - - HRESULT ( STDMETHODCALLTYPE *SetOutputPinMediaType )( - IMpeg2Demultiplexer * This, - /* [in] */ LPWSTR pszPinName, - /* [in] */ AM_MEDIA_TYPE *pMediaType); - - HRESULT ( STDMETHODCALLTYPE *DeleteOutputPin )( - IMpeg2Demultiplexer * This, - /* [in] */ LPWSTR pszPinName); - - END_INTERFACE - } IMpeg2DemultiplexerVtbl; - - interface IMpeg2Demultiplexer - { - CONST_VTBL struct IMpeg2DemultiplexerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMpeg2Demultiplexer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMpeg2Demultiplexer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMpeg2Demultiplexer_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMpeg2Demultiplexer_CreateOutputPin(This,pMediaType,pszPinName,ppIPin) \ - (This)->lpVtbl -> CreateOutputPin(This,pMediaType,pszPinName,ppIPin) - -#define IMpeg2Demultiplexer_SetOutputPinMediaType(This,pszPinName,pMediaType) \ - (This)->lpVtbl -> SetOutputPinMediaType(This,pszPinName,pMediaType) - -#define IMpeg2Demultiplexer_DeleteOutputPin(This,pszPinName) \ - (This)->lpVtbl -> DeleteOutputPin(This,pszPinName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMpeg2Demultiplexer_CreateOutputPin_Proxy( - IMpeg2Demultiplexer * This, - /* [in] */ AM_MEDIA_TYPE *pMediaType, - /* [in] */ LPWSTR pszPinName, - /* [out] */ IPin **ppIPin); - - -void __RPC_STUB IMpeg2Demultiplexer_CreateOutputPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMpeg2Demultiplexer_SetOutputPinMediaType_Proxy( - IMpeg2Demultiplexer * This, - /* [in] */ LPWSTR pszPinName, - /* [in] */ AM_MEDIA_TYPE *pMediaType); - - -void __RPC_STUB IMpeg2Demultiplexer_SetOutputPinMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMpeg2Demultiplexer_DeleteOutputPin_Proxy( - IMpeg2Demultiplexer * This, - /* [in] */ LPWSTR pszPinName); - - -void __RPC_STUB IMpeg2Demultiplexer_DeleteOutputPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMpeg2Demultiplexer_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0355 */ -/* [local] */ - -#define MPEG2_PROGRAM_STREAM_MAP 0x00000000 -#define MPEG2_PROGRAM_ELEMENTARY_STREAM 0x00000001 -#define MPEG2_PROGRAM_DIRECTORY_PES_PACKET 0x00000002 -#define MPEG2_PROGRAM_PACK_HEADER 0x00000003 -#define MPEG2_PROGRAM_PES_STREAM 0x00000004 -#define MPEG2_PROGRAM_SYSTEM_HEADER 0x00000005 -#define SUBSTREAM_FILTER_VAL_NONE 0x10000000 -typedef /* [public][public] */ struct __MIDL___MIDL_itf_strmif_0355_0001 - { - ULONG stream_id; - DWORD dwMediaSampleContent; - ULONG ulSubstreamFilterValue; - int iDataOffset; - } STREAM_ID_MAP; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0355_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0355_v0_0_s_ifspec; - -#ifndef __IEnumStreamIdMap_INTERFACE_DEFINED__ -#define __IEnumStreamIdMap_INTERFACE_DEFINED__ - -/* interface IEnumStreamIdMap */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IEnumStreamIdMap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("945C1566-6202-46fc-96C7-D87F289C6534") - IEnumStreamIdMap : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ STREAM_ID_MAP *pStreamIdMap, - /* [out] */ ULONG *pcReceived) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cRecords) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumStreamIdMapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumStreamIdMap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumStreamIdMap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumStreamIdMap * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumStreamIdMap * This, - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ STREAM_ID_MAP *pStreamIdMap, - /* [out] */ ULONG *pcReceived); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumStreamIdMap * This, - /* [in] */ ULONG cRecords); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumStreamIdMap * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumStreamIdMap * This, - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap); - - END_INTERFACE - } IEnumStreamIdMapVtbl; - - interface IEnumStreamIdMap - { - CONST_VTBL struct IEnumStreamIdMapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumStreamIdMap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumStreamIdMap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumStreamIdMap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumStreamIdMap_Next(This,cRequest,pStreamIdMap,pcReceived) \ - (This)->lpVtbl -> Next(This,cRequest,pStreamIdMap,pcReceived) - -#define IEnumStreamIdMap_Skip(This,cRecords) \ - (This)->lpVtbl -> Skip(This,cRecords) - -#define IEnumStreamIdMap_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumStreamIdMap_Clone(This,ppIEnumStreamIdMap) \ - (This)->lpVtbl -> Clone(This,ppIEnumStreamIdMap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumStreamIdMap_Next_Proxy( - IEnumStreamIdMap * This, - /* [in] */ ULONG cRequest, - /* [size_is][out][in] */ STREAM_ID_MAP *pStreamIdMap, - /* [out] */ ULONG *pcReceived); - - -void __RPC_STUB IEnumStreamIdMap_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumStreamIdMap_Skip_Proxy( - IEnumStreamIdMap * This, - /* [in] */ ULONG cRecords); - - -void __RPC_STUB IEnumStreamIdMap_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumStreamIdMap_Reset_Proxy( - IEnumStreamIdMap * This); - - -void __RPC_STUB IEnumStreamIdMap_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumStreamIdMap_Clone_Proxy( - IEnumStreamIdMap * This, - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap); - - -void __RPC_STUB IEnumStreamIdMap_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumStreamIdMap_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2StreamIdMap_INTERFACE_DEFINED__ -#define __IMPEG2StreamIdMap_INTERFACE_DEFINED__ - -/* interface IMPEG2StreamIdMap */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IMPEG2StreamIdMap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D0E04C47-25B8-4369-925A-362A01D95444") - IMPEG2StreamIdMap : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE MapStreamId( - /* [in] */ ULONG ulStreamId, - /* [in] */ DWORD MediaSampleContent, - /* [in] */ ULONG ulSubstreamFilterValue, - /* [in] */ int iDataOffset) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnmapStreamId( - /* [in] */ ULONG culStreamId, - /* [in] */ ULONG *pulStreamId) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumStreamIdMap( - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2StreamIdMapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2StreamIdMap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2StreamIdMap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2StreamIdMap * This); - - HRESULT ( STDMETHODCALLTYPE *MapStreamId )( - IMPEG2StreamIdMap * This, - /* [in] */ ULONG ulStreamId, - /* [in] */ DWORD MediaSampleContent, - /* [in] */ ULONG ulSubstreamFilterValue, - /* [in] */ int iDataOffset); - - HRESULT ( STDMETHODCALLTYPE *UnmapStreamId )( - IMPEG2StreamIdMap * This, - /* [in] */ ULONG culStreamId, - /* [in] */ ULONG *pulStreamId); - - HRESULT ( STDMETHODCALLTYPE *EnumStreamIdMap )( - IMPEG2StreamIdMap * This, - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap); - - END_INTERFACE - } IMPEG2StreamIdMapVtbl; - - interface IMPEG2StreamIdMap - { - CONST_VTBL struct IMPEG2StreamIdMapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2StreamIdMap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2StreamIdMap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2StreamIdMap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2StreamIdMap_MapStreamId(This,ulStreamId,MediaSampleContent,ulSubstreamFilterValue,iDataOffset) \ - (This)->lpVtbl -> MapStreamId(This,ulStreamId,MediaSampleContent,ulSubstreamFilterValue,iDataOffset) - -#define IMPEG2StreamIdMap_UnmapStreamId(This,culStreamId,pulStreamId) \ - (This)->lpVtbl -> UnmapStreamId(This,culStreamId,pulStreamId) - -#define IMPEG2StreamIdMap_EnumStreamIdMap(This,ppIEnumStreamIdMap) \ - (This)->lpVtbl -> EnumStreamIdMap(This,ppIEnumStreamIdMap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMPEG2StreamIdMap_MapStreamId_Proxy( - IMPEG2StreamIdMap * This, - /* [in] */ ULONG ulStreamId, - /* [in] */ DWORD MediaSampleContent, - /* [in] */ ULONG ulSubstreamFilterValue, - /* [in] */ int iDataOffset); - - -void __RPC_STUB IMPEG2StreamIdMap_MapStreamId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMPEG2StreamIdMap_UnmapStreamId_Proxy( - IMPEG2StreamIdMap * This, - /* [in] */ ULONG culStreamId, - /* [in] */ ULONG *pulStreamId); - - -void __RPC_STUB IMPEG2StreamIdMap_UnmapStreamId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMPEG2StreamIdMap_EnumStreamIdMap_Proxy( - IMPEG2StreamIdMap * This, - /* [out] */ IEnumStreamIdMap **ppIEnumStreamIdMap); - - -void __RPC_STUB IMPEG2StreamIdMap_EnumStreamIdMap_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2StreamIdMap_INTERFACE_DEFINED__ */ - - -#ifndef __IRegisterServiceProvider_INTERFACE_DEFINED__ -#define __IRegisterServiceProvider_INTERFACE_DEFINED__ - -/* interface IRegisterServiceProvider */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IRegisterServiceProvider; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7B3A2F01-0751-48DD-B556-004785171C54") - IRegisterServiceProvider : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RegisterService( - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkObject) = 0; - - }; - -#else /* C style interface */ - - typedef struct IRegisterServiceProviderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRegisterServiceProvider * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRegisterServiceProvider * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRegisterServiceProvider * This); - - HRESULT ( STDMETHODCALLTYPE *RegisterService )( - IRegisterServiceProvider * This, - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkObject); - - END_INTERFACE - } IRegisterServiceProviderVtbl; - - interface IRegisterServiceProvider - { - CONST_VTBL struct IRegisterServiceProviderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IRegisterServiceProvider_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IRegisterServiceProvider_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IRegisterServiceProvider_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IRegisterServiceProvider_RegisterService(This,guidService,pUnkObject) \ - (This)->lpVtbl -> RegisterService(This,guidService,pUnkObject) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IRegisterServiceProvider_RegisterService_Proxy( - IRegisterServiceProvider * This, - /* [in] */ REFGUID guidService, - /* [in] */ IUnknown *pUnkObject); - - -void __RPC_STUB IRegisterServiceProvider_RegisterService_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IRegisterServiceProvider_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0358 */ -/* [local] */ - -#define AM_GETDECODERCAP_QUERY_VMR_SUPPORT 0x00000001 -#define VMR_NOTSUPPORTED 0x00000000 -#define VMR_SUPPORTED 0x00000001 -#define AM_QUERY_DECODER_VMR_SUPPORT 0x00000001 -#define AM_QUERY_DECODER_DXVA_1_SUPPORT 0x00000002 -#define AM_QUERY_DECODER_DVD_SUPPORT 0x00000003 -#define AM_QUERY_DECODER_ATSC_SD_SUPPORT 0x00000004 -#define AM_QUERY_DECODER_ATSC_HD_SUPPORT 0x00000005 -#define DECODER_CAP_NOTSUPPORTED 0x00000000 -#define DECODER_CAP_SUPPORTED 0x00000001 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0358_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0358_v0_0_s_ifspec; - -#ifndef __IAMDecoderCaps_INTERFACE_DEFINED__ -#define __IAMDecoderCaps_INTERFACE_DEFINED__ - -/* interface IAMDecoderCaps */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMDecoderCaps; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c0dff467-d499-4986-972b-e1d9090fa941") - IAMDecoderCaps : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDecoderCaps( - /* [in] */ DWORD dwCapIndex, - /* [out] */ DWORD *lpdwCap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMDecoderCapsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMDecoderCaps * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMDecoderCaps * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMDecoderCaps * This); - - HRESULT ( STDMETHODCALLTYPE *GetDecoderCaps )( - IAMDecoderCaps * This, - /* [in] */ DWORD dwCapIndex, - /* [out] */ DWORD *lpdwCap); - - END_INTERFACE - } IAMDecoderCapsVtbl; - - interface IAMDecoderCaps - { - CONST_VTBL struct IAMDecoderCapsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMDecoderCaps_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMDecoderCaps_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMDecoderCaps_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMDecoderCaps_GetDecoderCaps(This,dwCapIndex,lpdwCap) \ - (This)->lpVtbl -> GetDecoderCaps(This,dwCapIndex,lpdwCap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMDecoderCaps_GetDecoderCaps_Proxy( - IAMDecoderCaps * This, - /* [in] */ DWORD dwCapIndex, - /* [out] */ DWORD *lpdwCap); - - -void __RPC_STUB IAMDecoderCaps_GetDecoderCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMDecoderCaps_INTERFACE_DEFINED__ */ - - -#ifndef __IAMClockSlave_INTERFACE_DEFINED__ -#define __IAMClockSlave_INTERFACE_DEFINED__ - -/* interface IAMClockSlave */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IAMClockSlave; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9FD52741-176D-4b36-8F51-CA8F933223BE") - IAMClockSlave : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetErrorTolerance( - /* [in] */ DWORD dwTolerance) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetErrorTolerance( - /* [out] */ DWORD *pdwTolerance) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMClockSlaveVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMClockSlave * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMClockSlave * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMClockSlave * This); - - HRESULT ( STDMETHODCALLTYPE *SetErrorTolerance )( - IAMClockSlave * This, - /* [in] */ DWORD dwTolerance); - - HRESULT ( STDMETHODCALLTYPE *GetErrorTolerance )( - IAMClockSlave * This, - /* [out] */ DWORD *pdwTolerance); - - END_INTERFACE - } IAMClockSlaveVtbl; - - interface IAMClockSlave - { - CONST_VTBL struct IAMClockSlaveVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMClockSlave_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMClockSlave_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMClockSlave_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMClockSlave_SetErrorTolerance(This,dwTolerance) \ - (This)->lpVtbl -> SetErrorTolerance(This,dwTolerance) - -#define IAMClockSlave_GetErrorTolerance(This,pdwTolerance) \ - (This)->lpVtbl -> GetErrorTolerance(This,pdwTolerance) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMClockSlave_SetErrorTolerance_Proxy( - IAMClockSlave * This, - /* [in] */ DWORD dwTolerance); - - -void __RPC_STUB IAMClockSlave_SetErrorTolerance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMClockSlave_GetErrorTolerance_Proxy( - IAMClockSlave * This, - /* [out] */ DWORD *pdwTolerance); - - -void __RPC_STUB IAMClockSlave_GetErrorTolerance_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMClockSlave_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0360 */ -/* [local] */ - -#include - - - - - - - - - -typedef -enum tagDVD_DOMAIN - { DVD_DOMAIN_FirstPlay = 1, - DVD_DOMAIN_VideoManagerMenu = DVD_DOMAIN_FirstPlay + 1, - DVD_DOMAIN_VideoTitleSetMenu = DVD_DOMAIN_VideoManagerMenu + 1, - DVD_DOMAIN_Title = DVD_DOMAIN_VideoTitleSetMenu + 1, - DVD_DOMAIN_Stop = DVD_DOMAIN_Title + 1 - } DVD_DOMAIN; - -typedef -enum tagDVD_MENU_ID - { DVD_MENU_Title = 2, - DVD_MENU_Root = 3, - DVD_MENU_Subpicture = 4, - DVD_MENU_Audio = 5, - DVD_MENU_Angle = 6, - DVD_MENU_Chapter = 7 - } DVD_MENU_ID; - -typedef -enum tagDVD_DISC_SIDE - { DVD_SIDE_A = 1, - DVD_SIDE_B = 2 - } DVD_DISC_SIDE; - -typedef -enum tagDVD_PREFERRED_DISPLAY_MODE - { DISPLAY_CONTENT_DEFAULT = 0, - DISPLAY_16x9 = 1, - DISPLAY_4x3_PANSCAN_PREFERRED = 2, - DISPLAY_4x3_LETTERBOX_PREFERRED = 3 - } DVD_PREFERRED_DISPLAY_MODE; - -typedef WORD DVD_REGISTER; - -typedef DVD_REGISTER GPRMARRAY[ 16 ]; - -typedef DVD_REGISTER SPRMARRAY[ 24 ]; - -typedef struct tagDVD_ATR - { - ULONG ulCAT; - BYTE pbATRI[ 768 ]; - } DVD_ATR; - -typedef BYTE DVD_VideoATR[ 2 ]; - -typedef BYTE DVD_AudioATR[ 8 ]; - -typedef BYTE DVD_SubpictureATR[ 6 ]; - -typedef -enum tagDVD_FRAMERATE - { DVD_FPS_25 = 1, - DVD_FPS_30NonDrop = 3 - } DVD_FRAMERATE; - -typedef struct tagDVD_TIMECODE -{ - ULONG Hours1 :4; // Hours - ULONG Hours10 :4; // Tens of Hours - - ULONG Minutes1 :4; // Minutes - ULONG Minutes10:4; // Tens of Minutes - - ULONG Seconds1 :4; // Seconds - ULONG Seconds10:4; // Tens of Seconds - - ULONG Frames1 :4; // Frames - ULONG Frames10 :2; // Tens of Frames - - ULONG FrameRateCode: 2; // use DVD_FRAMERATE to indicate frames/sec and drop/non-drop -} DVD_TIMECODE; -typedef -enum tagDVD_TIMECODE_FLAGS - { DVD_TC_FLAG_25fps = 0x1, - DVD_TC_FLAG_30fps = 0x2, - DVD_TC_FLAG_DropFrame = 0x4, - DVD_TC_FLAG_Interpolated = 0x8 - } DVD_TIMECODE_FLAGS; - -typedef struct tagDVD_HMSF_TIMECODE - { - BYTE bHours; - BYTE bMinutes; - BYTE bSeconds; - BYTE bFrames; - } DVD_HMSF_TIMECODE; - -typedef struct tagDVD_PLAYBACK_LOCATION2 - { - ULONG TitleNum; - ULONG ChapterNum; - DVD_HMSF_TIMECODE TimeCode; - ULONG TimeCodeFlags; - } DVD_PLAYBACK_LOCATION2; - -typedef struct tagDVD_PLAYBACK_LOCATION - { - ULONG TitleNum; - ULONG ChapterNum; - ULONG TimeCode; - } DVD_PLAYBACK_LOCATION; - -typedef DWORD VALID_UOP_SOMTHING_OR_OTHER; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0360_0001 - { UOP_FLAG_Play_Title_Or_AtTime = 0x1, - UOP_FLAG_Play_Chapter = 0x2, - UOP_FLAG_Play_Title = 0x4, - UOP_FLAG_Stop = 0x8, - UOP_FLAG_ReturnFromSubMenu = 0x10, - UOP_FLAG_Play_Chapter_Or_AtTime = 0x20, - UOP_FLAG_PlayPrev_Or_Replay_Chapter = 0x40, - UOP_FLAG_PlayNext_Chapter = 0x80, - UOP_FLAG_Play_Forwards = 0x100, - UOP_FLAG_Play_Backwards = 0x200, - UOP_FLAG_ShowMenu_Title = 0x400, - UOP_FLAG_ShowMenu_Root = 0x800, - UOP_FLAG_ShowMenu_SubPic = 0x1000, - UOP_FLAG_ShowMenu_Audio = 0x2000, - UOP_FLAG_ShowMenu_Angle = 0x4000, - UOP_FLAG_ShowMenu_Chapter = 0x8000, - UOP_FLAG_Resume = 0x10000, - UOP_FLAG_Select_Or_Activate_Button = 0x20000, - UOP_FLAG_Still_Off = 0x40000, - UOP_FLAG_Pause_On = 0x80000, - UOP_FLAG_Select_Audio_Stream = 0x100000, - UOP_FLAG_Select_SubPic_Stream = 0x200000, - UOP_FLAG_Select_Angle = 0x400000, - UOP_FLAG_Select_Karaoke_Audio_Presentation_Mode = 0x800000, - UOP_FLAG_Select_Video_Mode_Preference = 0x1000000 - } VALID_UOP_FLAG; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0360_0002 - { DVD_CMD_FLAG_None = 0, - DVD_CMD_FLAG_Flush = 0x1, - DVD_CMD_FLAG_SendEvents = 0x2, - DVD_CMD_FLAG_Block = 0x4, - DVD_CMD_FLAG_StartWhenRendered = 0x8, - DVD_CMD_FLAG_EndAfterRendered = 0x10 - } DVD_CMD_FLAGS; - -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_strmif_0360_0003 - { DVD_ResetOnStop = 1, - DVD_NotifyParentalLevelChange = 2, - DVD_HMSF_TimeCodeEvents = 3 - } DVD_OPTION_FLAG; - -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_strmif_0360_0004 - { DVD_Relative_Upper = 1, - DVD_Relative_Lower = 2, - DVD_Relative_Left = 3, - DVD_Relative_Right = 4 - } DVD_RELATIVE_BUTTON; - -typedef -enum tagDVD_PARENTAL_LEVEL - { DVD_PARENTAL_LEVEL_8 = 0x8000, - DVD_PARENTAL_LEVEL_7 = 0x4000, - DVD_PARENTAL_LEVEL_6 = 0x2000, - DVD_PARENTAL_LEVEL_5 = 0x1000, - DVD_PARENTAL_LEVEL_4 = 0x800, - DVD_PARENTAL_LEVEL_3 = 0x400, - DVD_PARENTAL_LEVEL_2 = 0x200, - DVD_PARENTAL_LEVEL_1 = 0x100 - } DVD_PARENTAL_LEVEL; - -typedef -enum tagDVD_AUDIO_LANG_EXT - { DVD_AUD_EXT_NotSpecified = 0, - DVD_AUD_EXT_Captions = 1, - DVD_AUD_EXT_VisuallyImpaired = 2, - DVD_AUD_EXT_DirectorComments1 = 3, - DVD_AUD_EXT_DirectorComments2 = 4 - } DVD_AUDIO_LANG_EXT; - -typedef -enum tagDVD_SUBPICTURE_LANG_EXT - { DVD_SP_EXT_NotSpecified = 0, - DVD_SP_EXT_Caption_Normal = 1, - DVD_SP_EXT_Caption_Big = 2, - DVD_SP_EXT_Caption_Children = 3, - DVD_SP_EXT_CC_Normal = 5, - DVD_SP_EXT_CC_Big = 6, - DVD_SP_EXT_CC_Children = 7, - DVD_SP_EXT_Forced = 9, - DVD_SP_EXT_DirectorComments_Normal = 13, - DVD_SP_EXT_DirectorComments_Big = 14, - DVD_SP_EXT_DirectorComments_Children = 15 - } DVD_SUBPICTURE_LANG_EXT; - -typedef -enum tagDVD_AUDIO_APPMODE - { DVD_AudioMode_None = 0, - DVD_AudioMode_Karaoke = 1, - DVD_AudioMode_Surround = 2, - DVD_AudioMode_Other = 3 - } DVD_AUDIO_APPMODE; - -typedef -enum tagDVD_AUDIO_FORMAT - { DVD_AudioFormat_AC3 = 0, - DVD_AudioFormat_MPEG1 = 1, - DVD_AudioFormat_MPEG1_DRC = 2, - DVD_AudioFormat_MPEG2 = 3, - DVD_AudioFormat_MPEG2_DRC = 4, - DVD_AudioFormat_LPCM = 5, - DVD_AudioFormat_DTS = 6, - DVD_AudioFormat_SDDS = 7, - DVD_AudioFormat_Other = 8 - } DVD_AUDIO_FORMAT; - -typedef -enum tagDVD_KARAOKE_DOWNMIX - { DVD_Mix_0to0 = 0x1, - DVD_Mix_1to0 = 0x2, - DVD_Mix_2to0 = 0x4, - DVD_Mix_3to0 = 0x8, - DVD_Mix_4to0 = 0x10, - DVD_Mix_Lto0 = 0x20, - DVD_Mix_Rto0 = 0x40, - DVD_Mix_0to1 = 0x100, - DVD_Mix_1to1 = 0x200, - DVD_Mix_2to1 = 0x400, - DVD_Mix_3to1 = 0x800, - DVD_Mix_4to1 = 0x1000, - DVD_Mix_Lto1 = 0x2000, - DVD_Mix_Rto1 = 0x4000 - } DVD_KARAOKE_DOWNMIX; - -typedef struct tagDVD_AudioAttributes - { - DVD_AUDIO_APPMODE AppMode; - BYTE AppModeData; - DVD_AUDIO_FORMAT AudioFormat; - LCID Language; - DVD_AUDIO_LANG_EXT LanguageExtension; - BOOL fHasMultichannelInfo; - DWORD dwFrequency; - BYTE bQuantization; - BYTE bNumberOfChannels; - DWORD dwReserved[ 2 ]; - } DVD_AudioAttributes; - -typedef struct tagDVD_MUA_MixingInfo - { - BOOL fMixTo0; - BOOL fMixTo1; - BOOL fMix0InPhase; - BOOL fMix1InPhase; - DWORD dwSpeakerPosition; - } DVD_MUA_MixingInfo; - -typedef struct tagDVD_MUA_Coeff - { - double log2_alpha; - double log2_beta; - } DVD_MUA_Coeff; - -typedef struct tagDVD_MultichannelAudioAttributes - { - DVD_MUA_MixingInfo Info[ 8 ]; - DVD_MUA_Coeff Coeff[ 8 ]; - } DVD_MultichannelAudioAttributes; - -typedef -enum tagDVD_KARAOKE_CONTENTS - { DVD_Karaoke_GuideVocal1 = 0x1, - DVD_Karaoke_GuideVocal2 = 0x2, - DVD_Karaoke_GuideMelody1 = 0x4, - DVD_Karaoke_GuideMelody2 = 0x8, - DVD_Karaoke_GuideMelodyA = 0x10, - DVD_Karaoke_GuideMelodyB = 0x20, - DVD_Karaoke_SoundEffectA = 0x40, - DVD_Karaoke_SoundEffectB = 0x80 - } DVD_KARAOKE_CONTENTS; - -typedef -enum tagDVD_KARAOKE_ASSIGNMENT - { DVD_Assignment_reserved0 = 0, - DVD_Assignment_reserved1 = 1, - DVD_Assignment_LR = 2, - DVD_Assignment_LRM = 3, - DVD_Assignment_LR1 = 4, - DVD_Assignment_LRM1 = 5, - DVD_Assignment_LR12 = 6, - DVD_Assignment_LRM12 = 7 - } DVD_KARAOKE_ASSIGNMENT; - -typedef struct tagDVD_KaraokeAttributes - { - BYTE bVersion; - BOOL fMasterOfCeremoniesInGuideVocal1; - BOOL fDuet; - DVD_KARAOKE_ASSIGNMENT ChannelAssignment; - WORD wChannelContents[ 8 ]; - } DVD_KaraokeAttributes; - -typedef -enum tagDVD_VIDEO_COMPRESSION - { DVD_VideoCompression_Other = 0, - DVD_VideoCompression_MPEG1 = 1, - DVD_VideoCompression_MPEG2 = 2 - } DVD_VIDEO_COMPRESSION; - -typedef struct tagDVD_VideoAttributes - { - BOOL fPanscanPermitted; - BOOL fLetterboxPermitted; - ULONG ulAspectX; - ULONG ulAspectY; - ULONG ulFrameRate; - ULONG ulFrameHeight; - DVD_VIDEO_COMPRESSION Compression; - BOOL fLine21Field1InGOP; - BOOL fLine21Field2InGOP; - ULONG ulSourceResolutionX; - ULONG ulSourceResolutionY; - BOOL fIsSourceLetterboxed; - BOOL fIsFilmMode; - } DVD_VideoAttributes; - -typedef -enum tagDVD_SUBPICTURE_TYPE - { DVD_SPType_NotSpecified = 0, - DVD_SPType_Language = 1, - DVD_SPType_Other = 2 - } DVD_SUBPICTURE_TYPE; - -typedef -enum tagDVD_SUBPICTURE_CODING - { DVD_SPCoding_RunLength = 0, - DVD_SPCoding_Extended = 1, - DVD_SPCoding_Other = 2 - } DVD_SUBPICTURE_CODING; - -typedef struct tagDVD_SubpictureAttributes - { - DVD_SUBPICTURE_TYPE Type; - DVD_SUBPICTURE_CODING CodingMode; - LCID Language; - DVD_SUBPICTURE_LANG_EXT LanguageExtension; - } DVD_SubpictureAttributes; - -typedef -enum tagDVD_TITLE_APPMODE - { DVD_AppMode_Not_Specified = 0, - DVD_AppMode_Karaoke = 1, - DVD_AppMode_Other = 3 - } DVD_TITLE_APPMODE; - -typedef struct tagDVD_TitleMainAttributes - { - DVD_TITLE_APPMODE AppMode; - DVD_VideoAttributes VideoAttributes; - ULONG ulNumberOfAudioStreams; - DVD_AudioAttributes AudioAttributes[ 8 ]; - DVD_MultichannelAudioAttributes MultichannelAudioAttributes[ 8 ]; - ULONG ulNumberOfSubpictureStreams; - DVD_SubpictureAttributes SubpictureAttributes[ 32 ]; - } DVD_TitleAttributes; - -typedef struct tagDVD_MenuAttributes - { - BOOL fCompatibleRegion[ 8 ]; - DVD_VideoAttributes VideoAttributes; - BOOL fAudioPresent; - DVD_AudioAttributes AudioAttributes; - BOOL fSubpicturePresent; - DVD_SubpictureAttributes SubpictureAttributes; - } DVD_MenuAttributes; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0360_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0360_v0_0_s_ifspec; - -#ifndef __IDvdControl_INTERFACE_DEFINED__ -#define __IDvdControl_INTERFACE_DEFINED__ - -/* interface IDvdControl */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A70EFE61-E2A3-11d0-A9BE-00AA0061BE93") - IDvdControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE TitlePlay( - /* [in] */ ULONG ulTitle) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChapterPlay( - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter) = 0; - - virtual HRESULT STDMETHODCALLTYPE TimePlay( - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG bcdTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE StopForResume( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GoUp( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE TimeSearch( - /* [in] */ ULONG bcdTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChapterSearch( - /* [in] */ ULONG ulChapter) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrevPGSearch( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE TopPGSearch( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE NextPGSearch( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ForwardScan( - /* [in] */ double dwSpeed) = 0; - - virtual HRESULT STDMETHODCALLTYPE BackwardScan( - /* [in] */ double dwSpeed) = 0; - - virtual HRESULT STDMETHODCALLTYPE MenuCall( - /* [in] */ DVD_MENU_ID MenuID) = 0; - - virtual HRESULT STDMETHODCALLTYPE Resume( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE UpperButtonSelect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LowerButtonSelect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LeftButtonSelect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RightButtonSelect( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ButtonActivate( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ButtonSelectAndActivate( - /* [in] */ ULONG ulButton) = 0; - - virtual HRESULT STDMETHODCALLTYPE StillOff( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE PauseOn( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE PauseOff( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE MenuLanguageSelect( - /* [in] */ LCID Language) = 0; - - virtual HRESULT STDMETHODCALLTYPE AudioStreamChange( - /* [in] */ ULONG ulAudio) = 0; - - virtual HRESULT STDMETHODCALLTYPE SubpictureStreamChange( - /* [in] */ ULONG ulSubPicture, - /* [in] */ BOOL bDisplay) = 0; - - virtual HRESULT STDMETHODCALLTYPE AngleChange( - /* [in] */ ULONG ulAngle) = 0; - - virtual HRESULT STDMETHODCALLTYPE ParentalLevelSelect( - /* [in] */ ULONG ulParentalLevel) = 0; - - virtual HRESULT STDMETHODCALLTYPE ParentalCountrySelect( - /* [in] */ WORD wCountry) = 0; - - virtual HRESULT STDMETHODCALLTYPE KaraokeAudioPresentationModeChange( - /* [in] */ ULONG ulMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE VideoModePreferrence( - /* [in] */ ULONG ulPreferredDisplayMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRoot( - /* [in] */ LPCWSTR pszPath) = 0; - - virtual HRESULT STDMETHODCALLTYPE MouseActivate( - /* [in] */ POINT point) = 0; - - virtual HRESULT STDMETHODCALLTYPE MouseSelect( - /* [in] */ POINT point) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChapterPlayAutoStop( - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *TitlePlay )( - IDvdControl * This, - /* [in] */ ULONG ulTitle); - - HRESULT ( STDMETHODCALLTYPE *ChapterPlay )( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter); - - HRESULT ( STDMETHODCALLTYPE *TimePlay )( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG bcdTime); - - HRESULT ( STDMETHODCALLTYPE *StopForResume )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *GoUp )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *TimeSearch )( - IDvdControl * This, - /* [in] */ ULONG bcdTime); - - HRESULT ( STDMETHODCALLTYPE *ChapterSearch )( - IDvdControl * This, - /* [in] */ ULONG ulChapter); - - HRESULT ( STDMETHODCALLTYPE *PrevPGSearch )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *TopPGSearch )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *NextPGSearch )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *ForwardScan )( - IDvdControl * This, - /* [in] */ double dwSpeed); - - HRESULT ( STDMETHODCALLTYPE *BackwardScan )( - IDvdControl * This, - /* [in] */ double dwSpeed); - - HRESULT ( STDMETHODCALLTYPE *MenuCall )( - IDvdControl * This, - /* [in] */ DVD_MENU_ID MenuID); - - HRESULT ( STDMETHODCALLTYPE *Resume )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *UpperButtonSelect )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *LowerButtonSelect )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *LeftButtonSelect )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *RightButtonSelect )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *ButtonActivate )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *ButtonSelectAndActivate )( - IDvdControl * This, - /* [in] */ ULONG ulButton); - - HRESULT ( STDMETHODCALLTYPE *StillOff )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *PauseOn )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *PauseOff )( - IDvdControl * This); - - HRESULT ( STDMETHODCALLTYPE *MenuLanguageSelect )( - IDvdControl * This, - /* [in] */ LCID Language); - - HRESULT ( STDMETHODCALLTYPE *AudioStreamChange )( - IDvdControl * This, - /* [in] */ ULONG ulAudio); - - HRESULT ( STDMETHODCALLTYPE *SubpictureStreamChange )( - IDvdControl * This, - /* [in] */ ULONG ulSubPicture, - /* [in] */ BOOL bDisplay); - - HRESULT ( STDMETHODCALLTYPE *AngleChange )( - IDvdControl * This, - /* [in] */ ULONG ulAngle); - - HRESULT ( STDMETHODCALLTYPE *ParentalLevelSelect )( - IDvdControl * This, - /* [in] */ ULONG ulParentalLevel); - - HRESULT ( STDMETHODCALLTYPE *ParentalCountrySelect )( - IDvdControl * This, - /* [in] */ WORD wCountry); - - HRESULT ( STDMETHODCALLTYPE *KaraokeAudioPresentationModeChange )( - IDvdControl * This, - /* [in] */ ULONG ulMode); - - HRESULT ( STDMETHODCALLTYPE *VideoModePreferrence )( - IDvdControl * This, - /* [in] */ ULONG ulPreferredDisplayMode); - - HRESULT ( STDMETHODCALLTYPE *SetRoot )( - IDvdControl * This, - /* [in] */ LPCWSTR pszPath); - - HRESULT ( STDMETHODCALLTYPE *MouseActivate )( - IDvdControl * This, - /* [in] */ POINT point); - - HRESULT ( STDMETHODCALLTYPE *MouseSelect )( - IDvdControl * This, - /* [in] */ POINT point); - - HRESULT ( STDMETHODCALLTYPE *ChapterPlayAutoStop )( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay); - - END_INTERFACE - } IDvdControlVtbl; - - interface IDvdControl - { - CONST_VTBL struct IDvdControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdControl_TitlePlay(This,ulTitle) \ - (This)->lpVtbl -> TitlePlay(This,ulTitle) - -#define IDvdControl_ChapterPlay(This,ulTitle,ulChapter) \ - (This)->lpVtbl -> ChapterPlay(This,ulTitle,ulChapter) - -#define IDvdControl_TimePlay(This,ulTitle,bcdTime) \ - (This)->lpVtbl -> TimePlay(This,ulTitle,bcdTime) - -#define IDvdControl_StopForResume(This) \ - (This)->lpVtbl -> StopForResume(This) - -#define IDvdControl_GoUp(This) \ - (This)->lpVtbl -> GoUp(This) - -#define IDvdControl_TimeSearch(This,bcdTime) \ - (This)->lpVtbl -> TimeSearch(This,bcdTime) - -#define IDvdControl_ChapterSearch(This,ulChapter) \ - (This)->lpVtbl -> ChapterSearch(This,ulChapter) - -#define IDvdControl_PrevPGSearch(This) \ - (This)->lpVtbl -> PrevPGSearch(This) - -#define IDvdControl_TopPGSearch(This) \ - (This)->lpVtbl -> TopPGSearch(This) - -#define IDvdControl_NextPGSearch(This) \ - (This)->lpVtbl -> NextPGSearch(This) - -#define IDvdControl_ForwardScan(This,dwSpeed) \ - (This)->lpVtbl -> ForwardScan(This,dwSpeed) - -#define IDvdControl_BackwardScan(This,dwSpeed) \ - (This)->lpVtbl -> BackwardScan(This,dwSpeed) - -#define IDvdControl_MenuCall(This,MenuID) \ - (This)->lpVtbl -> MenuCall(This,MenuID) - -#define IDvdControl_Resume(This) \ - (This)->lpVtbl -> Resume(This) - -#define IDvdControl_UpperButtonSelect(This) \ - (This)->lpVtbl -> UpperButtonSelect(This) - -#define IDvdControl_LowerButtonSelect(This) \ - (This)->lpVtbl -> LowerButtonSelect(This) - -#define IDvdControl_LeftButtonSelect(This) \ - (This)->lpVtbl -> LeftButtonSelect(This) - -#define IDvdControl_RightButtonSelect(This) \ - (This)->lpVtbl -> RightButtonSelect(This) - -#define IDvdControl_ButtonActivate(This) \ - (This)->lpVtbl -> ButtonActivate(This) - -#define IDvdControl_ButtonSelectAndActivate(This,ulButton) \ - (This)->lpVtbl -> ButtonSelectAndActivate(This,ulButton) - -#define IDvdControl_StillOff(This) \ - (This)->lpVtbl -> StillOff(This) - -#define IDvdControl_PauseOn(This) \ - (This)->lpVtbl -> PauseOn(This) - -#define IDvdControl_PauseOff(This) \ - (This)->lpVtbl -> PauseOff(This) - -#define IDvdControl_MenuLanguageSelect(This,Language) \ - (This)->lpVtbl -> MenuLanguageSelect(This,Language) - -#define IDvdControl_AudioStreamChange(This,ulAudio) \ - (This)->lpVtbl -> AudioStreamChange(This,ulAudio) - -#define IDvdControl_SubpictureStreamChange(This,ulSubPicture,bDisplay) \ - (This)->lpVtbl -> SubpictureStreamChange(This,ulSubPicture,bDisplay) - -#define IDvdControl_AngleChange(This,ulAngle) \ - (This)->lpVtbl -> AngleChange(This,ulAngle) - -#define IDvdControl_ParentalLevelSelect(This,ulParentalLevel) \ - (This)->lpVtbl -> ParentalLevelSelect(This,ulParentalLevel) - -#define IDvdControl_ParentalCountrySelect(This,wCountry) \ - (This)->lpVtbl -> ParentalCountrySelect(This,wCountry) - -#define IDvdControl_KaraokeAudioPresentationModeChange(This,ulMode) \ - (This)->lpVtbl -> KaraokeAudioPresentationModeChange(This,ulMode) - -#define IDvdControl_VideoModePreferrence(This,ulPreferredDisplayMode) \ - (This)->lpVtbl -> VideoModePreferrence(This,ulPreferredDisplayMode) - -#define IDvdControl_SetRoot(This,pszPath) \ - (This)->lpVtbl -> SetRoot(This,pszPath) - -#define IDvdControl_MouseActivate(This,point) \ - (This)->lpVtbl -> MouseActivate(This,point) - -#define IDvdControl_MouseSelect(This,point) \ - (This)->lpVtbl -> MouseSelect(This,point) - -#define IDvdControl_ChapterPlayAutoStop(This,ulTitle,ulChapter,ulChaptersToPlay) \ - (This)->lpVtbl -> ChapterPlayAutoStop(This,ulTitle,ulChapter,ulChaptersToPlay) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdControl_TitlePlay_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulTitle); - - -void __RPC_STUB IDvdControl_TitlePlay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ChapterPlay_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter); - - -void __RPC_STUB IDvdControl_ChapterPlay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_TimePlay_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG bcdTime); - - -void __RPC_STUB IDvdControl_TimePlay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_StopForResume_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_StopForResume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_GoUp_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_GoUp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_TimeSearch_Proxy( - IDvdControl * This, - /* [in] */ ULONG bcdTime); - - -void __RPC_STUB IDvdControl_TimeSearch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ChapterSearch_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulChapter); - - -void __RPC_STUB IDvdControl_ChapterSearch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_PrevPGSearch_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_PrevPGSearch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_TopPGSearch_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_TopPGSearch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_NextPGSearch_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_NextPGSearch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ForwardScan_Proxy( - IDvdControl * This, - /* [in] */ double dwSpeed); - - -void __RPC_STUB IDvdControl_ForwardScan_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_BackwardScan_Proxy( - IDvdControl * This, - /* [in] */ double dwSpeed); - - -void __RPC_STUB IDvdControl_BackwardScan_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_MenuCall_Proxy( - IDvdControl * This, - /* [in] */ DVD_MENU_ID MenuID); - - -void __RPC_STUB IDvdControl_MenuCall_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_Resume_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_Resume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_UpperButtonSelect_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_UpperButtonSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_LowerButtonSelect_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_LowerButtonSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_LeftButtonSelect_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_LeftButtonSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_RightButtonSelect_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_RightButtonSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ButtonActivate_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_ButtonActivate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ButtonSelectAndActivate_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulButton); - - -void __RPC_STUB IDvdControl_ButtonSelectAndActivate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_StillOff_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_StillOff_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_PauseOn_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_PauseOn_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_PauseOff_Proxy( - IDvdControl * This); - - -void __RPC_STUB IDvdControl_PauseOff_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_MenuLanguageSelect_Proxy( - IDvdControl * This, - /* [in] */ LCID Language); - - -void __RPC_STUB IDvdControl_MenuLanguageSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_AudioStreamChange_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulAudio); - - -void __RPC_STUB IDvdControl_AudioStreamChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_SubpictureStreamChange_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulSubPicture, - /* [in] */ BOOL bDisplay); - - -void __RPC_STUB IDvdControl_SubpictureStreamChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_AngleChange_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulAngle); - - -void __RPC_STUB IDvdControl_AngleChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ParentalLevelSelect_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulParentalLevel); - - -void __RPC_STUB IDvdControl_ParentalLevelSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ParentalCountrySelect_Proxy( - IDvdControl * This, - /* [in] */ WORD wCountry); - - -void __RPC_STUB IDvdControl_ParentalCountrySelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_KaraokeAudioPresentationModeChange_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulMode); - - -void __RPC_STUB IDvdControl_KaraokeAudioPresentationModeChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_VideoModePreferrence_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulPreferredDisplayMode); - - -void __RPC_STUB IDvdControl_VideoModePreferrence_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_SetRoot_Proxy( - IDvdControl * This, - /* [in] */ LPCWSTR pszPath); - - -void __RPC_STUB IDvdControl_SetRoot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_MouseActivate_Proxy( - IDvdControl * This, - /* [in] */ POINT point); - - -void __RPC_STUB IDvdControl_MouseActivate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_MouseSelect_Proxy( - IDvdControl * This, - /* [in] */ POINT point); - - -void __RPC_STUB IDvdControl_MouseSelect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl_ChapterPlayAutoStop_Proxy( - IDvdControl * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay); - - -void __RPC_STUB IDvdControl_ChapterPlayAutoStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdControl_INTERFACE_DEFINED__ */ - - -#ifndef __IDvdInfo_INTERFACE_DEFINED__ -#define __IDvdInfo_INTERFACE_DEFINED__ - -/* interface IDvdInfo */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A70EFE60-E2A3-11d0-A9BE-00AA0061BE93") - IDvdInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCurrentDomain( - /* [out] */ DVD_DOMAIN *pDomain) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentLocation( - /* [out] */ DVD_PLAYBACK_LOCATION *pLocation) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTotalTitleTime( - /* [out] */ ULONG *pulTotalTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentButton( - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentAngle( - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentAudio( - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSubpicture( - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pIsDisabled) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentUOPS( - /* [out] */ VALID_UOP_SOMTHING_OR_OTHER *pUOP) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllSPRMs( - /* [out] */ SPRMARRAY *pRegisterArray) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllGPRMs( - /* [out] */ GPRMARRAY *pRegisterArray) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAudioLanguage( - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSubpictureLanguage( - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTitleAttributes( - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_ATR *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVMGAttributes( - /* [out] */ DVD_ATR *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentVideoAttributes( - /* [out] */ DVD_VideoATR *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentAudioAttributes( - /* [out] */ DVD_AudioATR *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSubpictureAttributes( - /* [out] */ DVD_SubpictureATR *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentVolumeInfo( - /* [out] */ ULONG *pulNumOfVol, - /* [out] */ ULONG *pulThisVolNum, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDTextInfo( - /* [size_is][out] */ BYTE *pTextManager, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPlayerParentalLevel( - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ ULONG *pulCountryCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumberOfChapters( - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumberOfChapters) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTitleParentalLevels( - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRoot( - /* [size_is][out] */ LPSTR pRoot, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdInfo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentDomain )( - IDvdInfo * This, - /* [out] */ DVD_DOMAIN *pDomain); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentLocation )( - IDvdInfo * This, - /* [out] */ DVD_PLAYBACK_LOCATION *pLocation); - - HRESULT ( STDMETHODCALLTYPE *GetTotalTitleTime )( - IDvdInfo * This, - /* [out] */ ULONG *pulTotalTime); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentButton )( - IDvdInfo * This, - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentAngle )( - IDvdInfo * This, - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentAudio )( - IDvdInfo * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSubpicture )( - IDvdInfo * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pIsDisabled); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentUOPS )( - IDvdInfo * This, - /* [out] */ VALID_UOP_SOMTHING_OR_OTHER *pUOP); - - HRESULT ( STDMETHODCALLTYPE *GetAllSPRMs )( - IDvdInfo * This, - /* [out] */ SPRMARRAY *pRegisterArray); - - HRESULT ( STDMETHODCALLTYPE *GetAllGPRMs )( - IDvdInfo * This, - /* [out] */ GPRMARRAY *pRegisterArray); - - HRESULT ( STDMETHODCALLTYPE *GetAudioLanguage )( - IDvdInfo * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - HRESULT ( STDMETHODCALLTYPE *GetSubpictureLanguage )( - IDvdInfo * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - HRESULT ( STDMETHODCALLTYPE *GetTitleAttributes )( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_ATR *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetVMGAttributes )( - IDvdInfo * This, - /* [out] */ DVD_ATR *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentVideoAttributes )( - IDvdInfo * This, - /* [out] */ DVD_VideoATR *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentAudioAttributes )( - IDvdInfo * This, - /* [out] */ DVD_AudioATR *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSubpictureAttributes )( - IDvdInfo * This, - /* [out] */ DVD_SubpictureATR *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentVolumeInfo )( - IDvdInfo * This, - /* [out] */ ULONG *pulNumOfVol, - /* [out] */ ULONG *pulThisVolNum, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles); - - HRESULT ( STDMETHODCALLTYPE *GetDVDTextInfo )( - IDvdInfo * This, - /* [size_is][out] */ BYTE *pTextManager, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize); - - HRESULT ( STDMETHODCALLTYPE *GetPlayerParentalLevel )( - IDvdInfo * This, - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ ULONG *pulCountryCode); - - HRESULT ( STDMETHODCALLTYPE *GetNumberOfChapters )( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumberOfChapters); - - HRESULT ( STDMETHODCALLTYPE *GetTitleParentalLevels )( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels); - - HRESULT ( STDMETHODCALLTYPE *GetRoot )( - IDvdInfo * This, - /* [size_is][out] */ LPSTR pRoot, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize); - - END_INTERFACE - } IDvdInfoVtbl; - - interface IDvdInfo - { - CONST_VTBL struct IDvdInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdInfo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdInfo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdInfo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdInfo_GetCurrentDomain(This,pDomain) \ - (This)->lpVtbl -> GetCurrentDomain(This,pDomain) - -#define IDvdInfo_GetCurrentLocation(This,pLocation) \ - (This)->lpVtbl -> GetCurrentLocation(This,pLocation) - -#define IDvdInfo_GetTotalTitleTime(This,pulTotalTime) \ - (This)->lpVtbl -> GetTotalTitleTime(This,pulTotalTime) - -#define IDvdInfo_GetCurrentButton(This,pulButtonsAvailable,pulCurrentButton) \ - (This)->lpVtbl -> GetCurrentButton(This,pulButtonsAvailable,pulCurrentButton) - -#define IDvdInfo_GetCurrentAngle(This,pulAnglesAvailable,pulCurrentAngle) \ - (This)->lpVtbl -> GetCurrentAngle(This,pulAnglesAvailable,pulCurrentAngle) - -#define IDvdInfo_GetCurrentAudio(This,pulStreamsAvailable,pulCurrentStream) \ - (This)->lpVtbl -> GetCurrentAudio(This,pulStreamsAvailable,pulCurrentStream) - -#define IDvdInfo_GetCurrentSubpicture(This,pulStreamsAvailable,pulCurrentStream,pIsDisabled) \ - (This)->lpVtbl -> GetCurrentSubpicture(This,pulStreamsAvailable,pulCurrentStream,pIsDisabled) - -#define IDvdInfo_GetCurrentUOPS(This,pUOP) \ - (This)->lpVtbl -> GetCurrentUOPS(This,pUOP) - -#define IDvdInfo_GetAllSPRMs(This,pRegisterArray) \ - (This)->lpVtbl -> GetAllSPRMs(This,pRegisterArray) - -#define IDvdInfo_GetAllGPRMs(This,pRegisterArray) \ - (This)->lpVtbl -> GetAllGPRMs(This,pRegisterArray) - -#define IDvdInfo_GetAudioLanguage(This,ulStream,pLanguage) \ - (This)->lpVtbl -> GetAudioLanguage(This,ulStream,pLanguage) - -#define IDvdInfo_GetSubpictureLanguage(This,ulStream,pLanguage) \ - (This)->lpVtbl -> GetSubpictureLanguage(This,ulStream,pLanguage) - -#define IDvdInfo_GetTitleAttributes(This,ulTitle,pATR) \ - (This)->lpVtbl -> GetTitleAttributes(This,ulTitle,pATR) - -#define IDvdInfo_GetVMGAttributes(This,pATR) \ - (This)->lpVtbl -> GetVMGAttributes(This,pATR) - -#define IDvdInfo_GetCurrentVideoAttributes(This,pATR) \ - (This)->lpVtbl -> GetCurrentVideoAttributes(This,pATR) - -#define IDvdInfo_GetCurrentAudioAttributes(This,pATR) \ - (This)->lpVtbl -> GetCurrentAudioAttributes(This,pATR) - -#define IDvdInfo_GetCurrentSubpictureAttributes(This,pATR) \ - (This)->lpVtbl -> GetCurrentSubpictureAttributes(This,pATR) - -#define IDvdInfo_GetCurrentVolumeInfo(This,pulNumOfVol,pulThisVolNum,pSide,pulNumOfTitles) \ - (This)->lpVtbl -> GetCurrentVolumeInfo(This,pulNumOfVol,pulThisVolNum,pSide,pulNumOfTitles) - -#define IDvdInfo_GetDVDTextInfo(This,pTextManager,ulBufSize,pulActualSize) \ - (This)->lpVtbl -> GetDVDTextInfo(This,pTextManager,ulBufSize,pulActualSize) - -#define IDvdInfo_GetPlayerParentalLevel(This,pulParentalLevel,pulCountryCode) \ - (This)->lpVtbl -> GetPlayerParentalLevel(This,pulParentalLevel,pulCountryCode) - -#define IDvdInfo_GetNumberOfChapters(This,ulTitle,pulNumberOfChapters) \ - (This)->lpVtbl -> GetNumberOfChapters(This,ulTitle,pulNumberOfChapters) - -#define IDvdInfo_GetTitleParentalLevels(This,ulTitle,pulParentalLevels) \ - (This)->lpVtbl -> GetTitleParentalLevels(This,ulTitle,pulParentalLevels) - -#define IDvdInfo_GetRoot(This,pRoot,ulBufSize,pulActualSize) \ - (This)->lpVtbl -> GetRoot(This,pRoot,ulBufSize,pulActualSize) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentDomain_Proxy( - IDvdInfo * This, - /* [out] */ DVD_DOMAIN *pDomain); - - -void __RPC_STUB IDvdInfo_GetCurrentDomain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentLocation_Proxy( - IDvdInfo * This, - /* [out] */ DVD_PLAYBACK_LOCATION *pLocation); - - -void __RPC_STUB IDvdInfo_GetCurrentLocation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetTotalTitleTime_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulTotalTime); - - -void __RPC_STUB IDvdInfo_GetTotalTitleTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentButton_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton); - - -void __RPC_STUB IDvdInfo_GetCurrentButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentAngle_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle); - - -void __RPC_STUB IDvdInfo_GetCurrentAngle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentAudio_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream); - - -void __RPC_STUB IDvdInfo_GetCurrentAudio_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentSubpicture_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pIsDisabled); - - -void __RPC_STUB IDvdInfo_GetCurrentSubpicture_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentUOPS_Proxy( - IDvdInfo * This, - /* [out] */ VALID_UOP_SOMTHING_OR_OTHER *pUOP); - - -void __RPC_STUB IDvdInfo_GetCurrentUOPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetAllSPRMs_Proxy( - IDvdInfo * This, - /* [out] */ SPRMARRAY *pRegisterArray); - - -void __RPC_STUB IDvdInfo_GetAllSPRMs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetAllGPRMs_Proxy( - IDvdInfo * This, - /* [out] */ GPRMARRAY *pRegisterArray); - - -void __RPC_STUB IDvdInfo_GetAllGPRMs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetAudioLanguage_Proxy( - IDvdInfo * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - -void __RPC_STUB IDvdInfo_GetAudioLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetSubpictureLanguage_Proxy( - IDvdInfo * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - -void __RPC_STUB IDvdInfo_GetSubpictureLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetTitleAttributes_Proxy( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_ATR *pATR); - - -void __RPC_STUB IDvdInfo_GetTitleAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetVMGAttributes_Proxy( - IDvdInfo * This, - /* [out] */ DVD_ATR *pATR); - - -void __RPC_STUB IDvdInfo_GetVMGAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentVideoAttributes_Proxy( - IDvdInfo * This, - /* [out] */ DVD_VideoATR *pATR); - - -void __RPC_STUB IDvdInfo_GetCurrentVideoAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentAudioAttributes_Proxy( - IDvdInfo * This, - /* [out] */ DVD_AudioATR *pATR); - - -void __RPC_STUB IDvdInfo_GetCurrentAudioAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentSubpictureAttributes_Proxy( - IDvdInfo * This, - /* [out] */ DVD_SubpictureATR *pATR); - - -void __RPC_STUB IDvdInfo_GetCurrentSubpictureAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetCurrentVolumeInfo_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulNumOfVol, - /* [out] */ ULONG *pulThisVolNum, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles); - - -void __RPC_STUB IDvdInfo_GetCurrentVolumeInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetDVDTextInfo_Proxy( - IDvdInfo * This, - /* [size_is][out] */ BYTE *pTextManager, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize); - - -void __RPC_STUB IDvdInfo_GetDVDTextInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetPlayerParentalLevel_Proxy( - IDvdInfo * This, - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ ULONG *pulCountryCode); - - -void __RPC_STUB IDvdInfo_GetPlayerParentalLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetNumberOfChapters_Proxy( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumberOfChapters); - - -void __RPC_STUB IDvdInfo_GetNumberOfChapters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetTitleParentalLevels_Proxy( - IDvdInfo * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels); - - -void __RPC_STUB IDvdInfo_GetTitleParentalLevels_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo_GetRoot_Proxy( - IDvdInfo * This, - /* [size_is][out] */ LPSTR pRoot, - /* [in] */ ULONG ulBufSize, - /* [out] */ ULONG *pulActualSize); - - -void __RPC_STUB IDvdInfo_GetRoot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IDvdCmd_INTERFACE_DEFINED__ -#define __IDvdCmd_INTERFACE_DEFINED__ - -/* interface IDvdCmd */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdCmd; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5a4a97e4-94ee-4a55-9751-74b5643aa27d") - IDvdCmd : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE WaitForStart( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE WaitForEnd( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdCmdVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdCmd * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdCmd * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdCmd * This); - - HRESULT ( STDMETHODCALLTYPE *WaitForStart )( - IDvdCmd * This); - - HRESULT ( STDMETHODCALLTYPE *WaitForEnd )( - IDvdCmd * This); - - END_INTERFACE - } IDvdCmdVtbl; - - interface IDvdCmd - { - CONST_VTBL struct IDvdCmdVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdCmd_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdCmd_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdCmd_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdCmd_WaitForStart(This) \ - (This)->lpVtbl -> WaitForStart(This) - -#define IDvdCmd_WaitForEnd(This) \ - (This)->lpVtbl -> WaitForEnd(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdCmd_WaitForStart_Proxy( - IDvdCmd * This); - - -void __RPC_STUB IDvdCmd_WaitForStart_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdCmd_WaitForEnd_Proxy( - IDvdCmd * This); - - -void __RPC_STUB IDvdCmd_WaitForEnd_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdCmd_INTERFACE_DEFINED__ */ - - -#ifndef __IDvdState_INTERFACE_DEFINED__ -#define __IDvdState_INTERFACE_DEFINED__ - -/* interface IDvdState */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdState; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("86303d6d-1c4a-4087-ab42-f711167048ef") - IDvdState : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDiscID( - /* [out] */ ULONGLONG *pullUniqueID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParentalLevel( - /* [out] */ ULONG *pulParentalLevel) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdStateVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdState * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdState * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdState * This); - - HRESULT ( STDMETHODCALLTYPE *GetDiscID )( - IDvdState * This, - /* [out] */ ULONGLONG *pullUniqueID); - - HRESULT ( STDMETHODCALLTYPE *GetParentalLevel )( - IDvdState * This, - /* [out] */ ULONG *pulParentalLevel); - - END_INTERFACE - } IDvdStateVtbl; - - interface IDvdState - { - CONST_VTBL struct IDvdStateVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdState_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdState_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdState_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdState_GetDiscID(This,pullUniqueID) \ - (This)->lpVtbl -> GetDiscID(This,pullUniqueID) - -#define IDvdState_GetParentalLevel(This,pulParentalLevel) \ - (This)->lpVtbl -> GetParentalLevel(This,pulParentalLevel) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdState_GetDiscID_Proxy( - IDvdState * This, - /* [out] */ ULONGLONG *pullUniqueID); - - -void __RPC_STUB IDvdState_GetDiscID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdState_GetParentalLevel_Proxy( - IDvdState * This, - /* [out] */ ULONG *pulParentalLevel); - - -void __RPC_STUB IDvdState_GetParentalLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdState_INTERFACE_DEFINED__ */ - - -#ifndef __IDvdControl2_INTERFACE_DEFINED__ -#define __IDvdControl2_INTERFACE_DEFINED__ - -/* interface IDvdControl2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdControl2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("33BC7430-EEC0-11D2-8201-00A0C9D74842") - IDvdControl2 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE PlayTitle( - /* [in] */ ULONG ulTitle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayChapterInTitle( - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayAtTimeInTitle( - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReturnFromSubmenu( - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayAtTime( - /* [in] */ DVD_HMSF_TIMECODE *pTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayChapter( - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayPrevChapter( - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReplayChapter( - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayNextChapter( - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayForwards( - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayBackwards( - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ShowMenu( - /* [in] */ DVD_MENU_ID MenuID, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE Resume( - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectRelativeButton( - DVD_RELATIVE_BUTTON buttonDir) = 0; - - virtual HRESULT STDMETHODCALLTYPE ActivateButton( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectButton( - /* [in] */ ULONG ulButton) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectAndActivateButton( - /* [in] */ ULONG ulButton) = 0; - - virtual HRESULT STDMETHODCALLTYPE StillOff( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Pause( - /* [in] */ BOOL bState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectAudioStream( - /* [in] */ ULONG ulAudio, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectSubpictureStream( - /* [in] */ ULONG ulSubPicture, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSubpictureState( - /* [in] */ BOOL bState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectAngle( - /* [in] */ ULONG ulAngle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectParentalLevel( - /* [in] */ ULONG ulParentalLevel) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectParentalCountry( - /* [in] */ BYTE bCountry[ 2 ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectKaraokeAudioPresentationMode( - /* [in] */ ULONG ulMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectVideoModePreference( - /* [in] */ ULONG ulPreferredDisplayMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDVDDirectory( - /* [in] */ LPCWSTR pszwPath) = 0; - - virtual HRESULT STDMETHODCALLTYPE ActivateAtPosition( - /* [in] */ POINT point) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectAtPosition( - /* [in] */ POINT point) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayChaptersAutoStop( - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE AcceptParentalLevelChange( - /* [in] */ BOOL bAccept) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOption( - /* [in] */ DVD_OPTION_FLAG flag, - /* [in] */ BOOL fState) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetState( - /* [in] */ IDvdState *pState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE PlayPeriodInTitleAutoStop( - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DVD_HMSF_TIMECODE *pEndTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetGPRM( - /* [in] */ ULONG ulIndex, - /* [in] */ WORD wValue, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectDefaultMenuLanguage( - /* [in] */ LCID Language) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectDefaultAudioLanguage( - /* [in] */ LCID Language, - /* [in] */ DVD_AUDIO_LANG_EXT audioExtension) = 0; - - virtual HRESULT STDMETHODCALLTYPE SelectDefaultSubpictureLanguage( - /* [in] */ LCID Language, - /* [in] */ DVD_SUBPICTURE_LANG_EXT subpictureExtension) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdControl2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdControl2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdControl2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdControl2 * This); - - HRESULT ( STDMETHODCALLTYPE *PlayTitle )( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayChapterInTitle )( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayAtTimeInTitle )( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *Stop )( - IDvdControl2 * This); - - HRESULT ( STDMETHODCALLTYPE *ReturnFromSubmenu )( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayAtTime )( - IDvdControl2 * This, - /* [in] */ DVD_HMSF_TIMECODE *pTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayChapter )( - IDvdControl2 * This, - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayPrevChapter )( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *ReplayChapter )( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayNextChapter )( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayForwards )( - IDvdControl2 * This, - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayBackwards )( - IDvdControl2 * This, - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *ShowMenu )( - IDvdControl2 * This, - /* [in] */ DVD_MENU_ID MenuID, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *Resume )( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SelectRelativeButton )( - IDvdControl2 * This, - DVD_RELATIVE_BUTTON buttonDir); - - HRESULT ( STDMETHODCALLTYPE *ActivateButton )( - IDvdControl2 * This); - - HRESULT ( STDMETHODCALLTYPE *SelectButton )( - IDvdControl2 * This, - /* [in] */ ULONG ulButton); - - HRESULT ( STDMETHODCALLTYPE *SelectAndActivateButton )( - IDvdControl2 * This, - /* [in] */ ULONG ulButton); - - HRESULT ( STDMETHODCALLTYPE *StillOff )( - IDvdControl2 * This); - - HRESULT ( STDMETHODCALLTYPE *Pause )( - IDvdControl2 * This, - /* [in] */ BOOL bState); - - HRESULT ( STDMETHODCALLTYPE *SelectAudioStream )( - IDvdControl2 * This, - /* [in] */ ULONG ulAudio, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SelectSubpictureStream )( - IDvdControl2 * This, - /* [in] */ ULONG ulSubPicture, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SetSubpictureState )( - IDvdControl2 * This, - /* [in] */ BOOL bState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SelectAngle )( - IDvdControl2 * This, - /* [in] */ ULONG ulAngle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SelectParentalLevel )( - IDvdControl2 * This, - /* [in] */ ULONG ulParentalLevel); - - HRESULT ( STDMETHODCALLTYPE *SelectParentalCountry )( - IDvdControl2 * This, - /* [in] */ BYTE bCountry[ 2 ]); - - HRESULT ( STDMETHODCALLTYPE *SelectKaraokeAudioPresentationMode )( - IDvdControl2 * This, - /* [in] */ ULONG ulMode); - - HRESULT ( STDMETHODCALLTYPE *SelectVideoModePreference )( - IDvdControl2 * This, - /* [in] */ ULONG ulPreferredDisplayMode); - - HRESULT ( STDMETHODCALLTYPE *SetDVDDirectory )( - IDvdControl2 * This, - /* [in] */ LPCWSTR pszwPath); - - HRESULT ( STDMETHODCALLTYPE *ActivateAtPosition )( - IDvdControl2 * This, - /* [in] */ POINT point); - - HRESULT ( STDMETHODCALLTYPE *SelectAtPosition )( - IDvdControl2 * This, - /* [in] */ POINT point); - - HRESULT ( STDMETHODCALLTYPE *PlayChaptersAutoStop )( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *AcceptParentalLevelChange )( - IDvdControl2 * This, - /* [in] */ BOOL bAccept); - - HRESULT ( STDMETHODCALLTYPE *SetOption )( - IDvdControl2 * This, - /* [in] */ DVD_OPTION_FLAG flag, - /* [in] */ BOOL fState); - - HRESULT ( STDMETHODCALLTYPE *SetState )( - IDvdControl2 * This, - /* [in] */ IDvdState *pState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *PlayPeriodInTitleAutoStop )( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DVD_HMSF_TIMECODE *pEndTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SetGPRM )( - IDvdControl2 * This, - /* [in] */ ULONG ulIndex, - /* [in] */ WORD wValue, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - HRESULT ( STDMETHODCALLTYPE *SelectDefaultMenuLanguage )( - IDvdControl2 * This, - /* [in] */ LCID Language); - - HRESULT ( STDMETHODCALLTYPE *SelectDefaultAudioLanguage )( - IDvdControl2 * This, - /* [in] */ LCID Language, - /* [in] */ DVD_AUDIO_LANG_EXT audioExtension); - - HRESULT ( STDMETHODCALLTYPE *SelectDefaultSubpictureLanguage )( - IDvdControl2 * This, - /* [in] */ LCID Language, - /* [in] */ DVD_SUBPICTURE_LANG_EXT subpictureExtension); - - END_INTERFACE - } IDvdControl2Vtbl; - - interface IDvdControl2 - { - CONST_VTBL struct IDvdControl2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdControl2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdControl2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdControl2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdControl2_PlayTitle(This,ulTitle,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayTitle(This,ulTitle,dwFlags,ppCmd) - -#define IDvdControl2_PlayChapterInTitle(This,ulTitle,ulChapter,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayChapterInTitle(This,ulTitle,ulChapter,dwFlags,ppCmd) - -#define IDvdControl2_PlayAtTimeInTitle(This,ulTitle,pStartTime,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayAtTimeInTitle(This,ulTitle,pStartTime,dwFlags,ppCmd) - -#define IDvdControl2_Stop(This) \ - (This)->lpVtbl -> Stop(This) - -#define IDvdControl2_ReturnFromSubmenu(This,dwFlags,ppCmd) \ - (This)->lpVtbl -> ReturnFromSubmenu(This,dwFlags,ppCmd) - -#define IDvdControl2_PlayAtTime(This,pTime,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayAtTime(This,pTime,dwFlags,ppCmd) - -#define IDvdControl2_PlayChapter(This,ulChapter,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayChapter(This,ulChapter,dwFlags,ppCmd) - -#define IDvdControl2_PlayPrevChapter(This,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayPrevChapter(This,dwFlags,ppCmd) - -#define IDvdControl2_ReplayChapter(This,dwFlags,ppCmd) \ - (This)->lpVtbl -> ReplayChapter(This,dwFlags,ppCmd) - -#define IDvdControl2_PlayNextChapter(This,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayNextChapter(This,dwFlags,ppCmd) - -#define IDvdControl2_PlayForwards(This,dSpeed,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayForwards(This,dSpeed,dwFlags,ppCmd) - -#define IDvdControl2_PlayBackwards(This,dSpeed,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayBackwards(This,dSpeed,dwFlags,ppCmd) - -#define IDvdControl2_ShowMenu(This,MenuID,dwFlags,ppCmd) \ - (This)->lpVtbl -> ShowMenu(This,MenuID,dwFlags,ppCmd) - -#define IDvdControl2_Resume(This,dwFlags,ppCmd) \ - (This)->lpVtbl -> Resume(This,dwFlags,ppCmd) - -#define IDvdControl2_SelectRelativeButton(This,buttonDir) \ - (This)->lpVtbl -> SelectRelativeButton(This,buttonDir) - -#define IDvdControl2_ActivateButton(This) \ - (This)->lpVtbl -> ActivateButton(This) - -#define IDvdControl2_SelectButton(This,ulButton) \ - (This)->lpVtbl -> SelectButton(This,ulButton) - -#define IDvdControl2_SelectAndActivateButton(This,ulButton) \ - (This)->lpVtbl -> SelectAndActivateButton(This,ulButton) - -#define IDvdControl2_StillOff(This) \ - (This)->lpVtbl -> StillOff(This) - -#define IDvdControl2_Pause(This,bState) \ - (This)->lpVtbl -> Pause(This,bState) - -#define IDvdControl2_SelectAudioStream(This,ulAudio,dwFlags,ppCmd) \ - (This)->lpVtbl -> SelectAudioStream(This,ulAudio,dwFlags,ppCmd) - -#define IDvdControl2_SelectSubpictureStream(This,ulSubPicture,dwFlags,ppCmd) \ - (This)->lpVtbl -> SelectSubpictureStream(This,ulSubPicture,dwFlags,ppCmd) - -#define IDvdControl2_SetSubpictureState(This,bState,dwFlags,ppCmd) \ - (This)->lpVtbl -> SetSubpictureState(This,bState,dwFlags,ppCmd) - -#define IDvdControl2_SelectAngle(This,ulAngle,dwFlags,ppCmd) \ - (This)->lpVtbl -> SelectAngle(This,ulAngle,dwFlags,ppCmd) - -#define IDvdControl2_SelectParentalLevel(This,ulParentalLevel) \ - (This)->lpVtbl -> SelectParentalLevel(This,ulParentalLevel) - -#define IDvdControl2_SelectParentalCountry(This,bCountry) \ - (This)->lpVtbl -> SelectParentalCountry(This,bCountry) - -#define IDvdControl2_SelectKaraokeAudioPresentationMode(This,ulMode) \ - (This)->lpVtbl -> SelectKaraokeAudioPresentationMode(This,ulMode) - -#define IDvdControl2_SelectVideoModePreference(This,ulPreferredDisplayMode) \ - (This)->lpVtbl -> SelectVideoModePreference(This,ulPreferredDisplayMode) - -#define IDvdControl2_SetDVDDirectory(This,pszwPath) \ - (This)->lpVtbl -> SetDVDDirectory(This,pszwPath) - -#define IDvdControl2_ActivateAtPosition(This,point) \ - (This)->lpVtbl -> ActivateAtPosition(This,point) - -#define IDvdControl2_SelectAtPosition(This,point) \ - (This)->lpVtbl -> SelectAtPosition(This,point) - -#define IDvdControl2_PlayChaptersAutoStop(This,ulTitle,ulChapter,ulChaptersToPlay,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayChaptersAutoStop(This,ulTitle,ulChapter,ulChaptersToPlay,dwFlags,ppCmd) - -#define IDvdControl2_AcceptParentalLevelChange(This,bAccept) \ - (This)->lpVtbl -> AcceptParentalLevelChange(This,bAccept) - -#define IDvdControl2_SetOption(This,flag,fState) \ - (This)->lpVtbl -> SetOption(This,flag,fState) - -#define IDvdControl2_SetState(This,pState,dwFlags,ppCmd) \ - (This)->lpVtbl -> SetState(This,pState,dwFlags,ppCmd) - -#define IDvdControl2_PlayPeriodInTitleAutoStop(This,ulTitle,pStartTime,pEndTime,dwFlags,ppCmd) \ - (This)->lpVtbl -> PlayPeriodInTitleAutoStop(This,ulTitle,pStartTime,pEndTime,dwFlags,ppCmd) - -#define IDvdControl2_SetGPRM(This,ulIndex,wValue,dwFlags,ppCmd) \ - (This)->lpVtbl -> SetGPRM(This,ulIndex,wValue,dwFlags,ppCmd) - -#define IDvdControl2_SelectDefaultMenuLanguage(This,Language) \ - (This)->lpVtbl -> SelectDefaultMenuLanguage(This,Language) - -#define IDvdControl2_SelectDefaultAudioLanguage(This,Language,audioExtension) \ - (This)->lpVtbl -> SelectDefaultAudioLanguage(This,Language,audioExtension) - -#define IDvdControl2_SelectDefaultSubpictureLanguage(This,Language,subpictureExtension) \ - (This)->lpVtbl -> SelectDefaultSubpictureLanguage(This,Language,subpictureExtension) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayTitle_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayTitle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayChapterInTitle_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayChapterInTitle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayAtTimeInTitle_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayAtTimeInTitle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_Stop_Proxy( - IDvdControl2 * This); - - -void __RPC_STUB IDvdControl2_Stop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_ReturnFromSubmenu_Proxy( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_ReturnFromSubmenu_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayAtTime_Proxy( - IDvdControl2 * This, - /* [in] */ DVD_HMSF_TIMECODE *pTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayAtTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayChapter_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulChapter, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayChapter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayPrevChapter_Proxy( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayPrevChapter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_ReplayChapter_Proxy( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_ReplayChapter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayNextChapter_Proxy( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayNextChapter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayForwards_Proxy( - IDvdControl2 * This, - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayForwards_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayBackwards_Proxy( - IDvdControl2 * This, - /* [in] */ double dSpeed, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayBackwards_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_ShowMenu_Proxy( - IDvdControl2 * This, - /* [in] */ DVD_MENU_ID MenuID, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_ShowMenu_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_Resume_Proxy( - IDvdControl2 * This, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_Resume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectRelativeButton_Proxy( - IDvdControl2 * This, - DVD_RELATIVE_BUTTON buttonDir); - - -void __RPC_STUB IDvdControl2_SelectRelativeButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_ActivateButton_Proxy( - IDvdControl2 * This); - - -void __RPC_STUB IDvdControl2_ActivateButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectButton_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulButton); - - -void __RPC_STUB IDvdControl2_SelectButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectAndActivateButton_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulButton); - - -void __RPC_STUB IDvdControl2_SelectAndActivateButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_StillOff_Proxy( - IDvdControl2 * This); - - -void __RPC_STUB IDvdControl2_StillOff_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_Pause_Proxy( - IDvdControl2 * This, - /* [in] */ BOOL bState); - - -void __RPC_STUB IDvdControl2_Pause_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectAudioStream_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulAudio, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SelectAudioStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectSubpictureStream_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulSubPicture, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SelectSubpictureStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SetSubpictureState_Proxy( - IDvdControl2 * This, - /* [in] */ BOOL bState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SetSubpictureState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectAngle_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulAngle, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SelectAngle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectParentalLevel_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulParentalLevel); - - -void __RPC_STUB IDvdControl2_SelectParentalLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectParentalCountry_Proxy( - IDvdControl2 * This, - /* [in] */ BYTE bCountry[ 2 ]); - - -void __RPC_STUB IDvdControl2_SelectParentalCountry_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectKaraokeAudioPresentationMode_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulMode); - - -void __RPC_STUB IDvdControl2_SelectKaraokeAudioPresentationMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectVideoModePreference_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulPreferredDisplayMode); - - -void __RPC_STUB IDvdControl2_SelectVideoModePreference_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SetDVDDirectory_Proxy( - IDvdControl2 * This, - /* [in] */ LPCWSTR pszwPath); - - -void __RPC_STUB IDvdControl2_SetDVDDirectory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_ActivateAtPosition_Proxy( - IDvdControl2 * This, - /* [in] */ POINT point); - - -void __RPC_STUB IDvdControl2_ActivateAtPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectAtPosition_Proxy( - IDvdControl2 * This, - /* [in] */ POINT point); - - -void __RPC_STUB IDvdControl2_SelectAtPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayChaptersAutoStop_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ ULONG ulChapter, - /* [in] */ ULONG ulChaptersToPlay, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayChaptersAutoStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_AcceptParentalLevelChange_Proxy( - IDvdControl2 * This, - /* [in] */ BOOL bAccept); - - -void __RPC_STUB IDvdControl2_AcceptParentalLevelChange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SetOption_Proxy( - IDvdControl2 * This, - /* [in] */ DVD_OPTION_FLAG flag, - /* [in] */ BOOL fState); - - -void __RPC_STUB IDvdControl2_SetOption_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SetState_Proxy( - IDvdControl2 * This, - /* [in] */ IDvdState *pState, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_PlayPeriodInTitleAutoStop_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulTitle, - /* [in] */ DVD_HMSF_TIMECODE *pStartTime, - /* [in] */ DVD_HMSF_TIMECODE *pEndTime, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_PlayPeriodInTitleAutoStop_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SetGPRM_Proxy( - IDvdControl2 * This, - /* [in] */ ULONG ulIndex, - /* [in] */ WORD wValue, - /* [in] */ DWORD dwFlags, - /* [out] */ IDvdCmd **ppCmd); - - -void __RPC_STUB IDvdControl2_SetGPRM_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectDefaultMenuLanguage_Proxy( - IDvdControl2 * This, - /* [in] */ LCID Language); - - -void __RPC_STUB IDvdControl2_SelectDefaultMenuLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectDefaultAudioLanguage_Proxy( - IDvdControl2 * This, - /* [in] */ LCID Language, - /* [in] */ DVD_AUDIO_LANG_EXT audioExtension); - - -void __RPC_STUB IDvdControl2_SelectDefaultAudioLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdControl2_SelectDefaultSubpictureLanguage_Proxy( - IDvdControl2 * This, - /* [in] */ LCID Language, - /* [in] */ DVD_SUBPICTURE_LANG_EXT subpictureExtension); - - -void __RPC_STUB IDvdControl2_SelectDefaultSubpictureLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdControl2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0371 */ -/* [local] */ - - -enum DVD_TextStringType - { DVD_Struct_Volume = 0x1, - DVD_Struct_Title = 0x2, - DVD_Struct_ParentalID = 0x3, - DVD_Struct_PartOfTitle = 0x4, - DVD_Struct_Cell = 0x5, - DVD_Stream_Audio = 0x10, - DVD_Stream_Subpicture = 0x11, - DVD_Stream_Angle = 0x12, - DVD_Channel_Audio = 0x20, - DVD_General_Name = 0x30, - DVD_General_Comments = 0x31, - DVD_Title_Series = 0x38, - DVD_Title_Movie = 0x39, - DVD_Title_Video = 0x3a, - DVD_Title_Album = 0x3b, - DVD_Title_Song = 0x3c, - DVD_Title_Other = 0x3f, - DVD_Title_Sub_Series = 0x40, - DVD_Title_Sub_Movie = 0x41, - DVD_Title_Sub_Video = 0x42, - DVD_Title_Sub_Album = 0x43, - DVD_Title_Sub_Song = 0x44, - DVD_Title_Sub_Other = 0x47, - DVD_Title_Orig_Series = 0x48, - DVD_Title_Orig_Movie = 0x49, - DVD_Title_Orig_Video = 0x4a, - DVD_Title_Orig_Album = 0x4b, - DVD_Title_Orig_Song = 0x4c, - DVD_Title_Orig_Other = 0x4f, - DVD_Other_Scene = 0x50, - DVD_Other_Cut = 0x51, - DVD_Other_Take = 0x52 - } ; - -enum DVD_TextCharSet - { DVD_CharSet_Unicode = 0, - DVD_CharSet_ISO646 = 1, - DVD_CharSet_JIS_Roman_Kanji = 2, - DVD_CharSet_ISO8859_1 = 3, - DVD_CharSet_ShiftJIS_Kanji_Roman_Katakana = 4 - } ; -#define DVD_TITLE_MENU 0x000 -#define DVD_STREAM_DATA_CURRENT 0x800 -#define DVD_STREAM_DATA_VMGM 0x400 -#define DVD_STREAM_DATA_VTSM 0x401 -#define DVD_DEFAULT_AUDIO_STREAM 0x0f -typedef struct tagDVD_DECODER_CAPS - { - DWORD dwSize; - DWORD dwAudioCaps; - double dFwdMaxRateVideo; - double dFwdMaxRateAudio; - double dFwdMaxRateSP; - double dBwdMaxRateVideo; - double dBwdMaxRateAudio; - double dBwdMaxRateSP; - DWORD dwRes1; - DWORD dwRes2; - DWORD dwRes3; - DWORD dwRes4; - } DVD_DECODER_CAPS; - -#define DVD_AUDIO_CAPS_AC3 0x00000001 -#define DVD_AUDIO_CAPS_MPEG2 0x00000002 -#define DVD_AUDIO_CAPS_LPCM 0x00000004 -#define DVD_AUDIO_CAPS_DTS 0x00000008 -#define DVD_AUDIO_CAPS_SDDS 0x00000010 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0371_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0371_v0_0_s_ifspec; - -#ifndef __IDvdInfo2_INTERFACE_DEFINED__ -#define __IDvdInfo2_INTERFACE_DEFINED__ - -/* interface IDvdInfo2 */ -/* [unique][uuid][object] */ - - -EXTERN_C const IID IID_IDvdInfo2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("34151510-EEC0-11D2-8201-00A0C9D74842") - IDvdInfo2 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCurrentDomain( - /* [out] */ DVD_DOMAIN *pDomain) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentLocation( - /* [out] */ DVD_PLAYBACK_LOCATION2 *pLocation) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTotalTitleTime( - /* [out] */ DVD_HMSF_TIMECODE *pTotalTime, - /* [out] */ ULONG *ulTimeCodeFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentButton( - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentAngle( - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentAudio( - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSubpicture( - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pbIsDisabled) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentUOPS( - /* [out] */ ULONG *pulUOPs) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllSPRMs( - /* [out] */ SPRMARRAY *pRegisterArray) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAllGPRMs( - /* [out] */ GPRMARRAY *pRegisterArray) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAudioLanguage( - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSubpictureLanguage( - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTitleAttributes( - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_MenuAttributes *pMenu, - /* [out] */ DVD_TitleAttributes *pTitle) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVMGAttributes( - /* [out] */ DVD_MenuAttributes *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentVideoAttributes( - /* [out] */ DVD_VideoAttributes *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAudioAttributes( - /* [in] */ ULONG ulStream, - /* [out] */ DVD_AudioAttributes *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetKaraokeAttributes( - /* [in] */ ULONG ulStream, - /* [out] */ DVD_KaraokeAttributes *pAttributes) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSubpictureAttributes( - /* [in] */ ULONG ulStream, - /* [out] */ DVD_SubpictureAttributes *pATR) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDVolumeInfo( - /* [out] */ ULONG *pulNumOfVolumes, - /* [out] */ ULONG *pulVolume, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDTextNumberOfLanguages( - /* [out] */ ULONG *pulNumOfLangs) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDTextLanguageInfo( - /* [in] */ ULONG ulLangIndex, - /* [out] */ ULONG *pulNumOfStrings, - /* [out] */ LCID *pLangCode, - /* [out] */ enum DVD_TextCharSet *pbCharacterSet) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDTextStringAsNative( - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ BYTE *pbBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDTextStringAsUnicode( - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ WCHAR *pchwBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPlayerParentalLevel( - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ BYTE pbCountryCode[ 2 ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumberOfChapters( - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumOfChapters) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTitleParentalLevels( - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDVDDirectory( - /* [size_is][out] */ LPWSTR pszwPath, - /* [in] */ ULONG ulMaxSize, - /* [out] */ ULONG *pulActualSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsAudioStreamEnabled( - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDiscID( - /* [in] */ LPCWSTR pszwPath, - /* [out] */ ULONGLONG *pullDiscID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetState( - /* [out] */ IDvdState **pStateData) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMenuLanguages( - /* [out] */ LCID *pLanguages, - /* [in] */ ULONG ulMaxLanguages, - /* [out] */ ULONG *pulActualLanguages) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetButtonAtPosition( - /* [in] */ POINT point, - /* [out] */ ULONG *pulButtonIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCmdFromEvent( - /* [in] */ LONG_PTR lParam1, - /* [out] */ IDvdCmd **pCmdObj) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultMenuLanguage( - /* [out] */ LCID *pLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultAudioLanguage( - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_AUDIO_LANG_EXT *pAudioExtension) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultSubpictureLanguage( - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_SUBPICTURE_LANG_EXT *pSubpictureExtension) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDecoderCaps( - /* [out] */ DVD_DECODER_CAPS *pCaps) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetButtonRect( - /* [in] */ ULONG ulButton, - /* [out] */ RECT *pRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSubpictureStreamEnabled( - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdInfo2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdInfo2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdInfo2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdInfo2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentDomain )( - IDvdInfo2 * This, - /* [out] */ DVD_DOMAIN *pDomain); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentLocation )( - IDvdInfo2 * This, - /* [out] */ DVD_PLAYBACK_LOCATION2 *pLocation); - - HRESULT ( STDMETHODCALLTYPE *GetTotalTitleTime )( - IDvdInfo2 * This, - /* [out] */ DVD_HMSF_TIMECODE *pTotalTime, - /* [out] */ ULONG *ulTimeCodeFlags); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentButton )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentAngle )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentAudio )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSubpicture )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pbIsDisabled); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentUOPS )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulUOPs); - - HRESULT ( STDMETHODCALLTYPE *GetAllSPRMs )( - IDvdInfo2 * This, - /* [out] */ SPRMARRAY *pRegisterArray); - - HRESULT ( STDMETHODCALLTYPE *GetAllGPRMs )( - IDvdInfo2 * This, - /* [out] */ GPRMARRAY *pRegisterArray); - - HRESULT ( STDMETHODCALLTYPE *GetAudioLanguage )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - HRESULT ( STDMETHODCALLTYPE *GetSubpictureLanguage )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - HRESULT ( STDMETHODCALLTYPE *GetTitleAttributes )( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_MenuAttributes *pMenu, - /* [out] */ DVD_TitleAttributes *pTitle); - - HRESULT ( STDMETHODCALLTYPE *GetVMGAttributes )( - IDvdInfo2 * This, - /* [out] */ DVD_MenuAttributes *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentVideoAttributes )( - IDvdInfo2 * This, - /* [out] */ DVD_VideoAttributes *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetAudioAttributes )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_AudioAttributes *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetKaraokeAttributes )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_KaraokeAttributes *pAttributes); - - HRESULT ( STDMETHODCALLTYPE *GetSubpictureAttributes )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_SubpictureAttributes *pATR); - - HRESULT ( STDMETHODCALLTYPE *GetDVDVolumeInfo )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulNumOfVolumes, - /* [out] */ ULONG *pulVolume, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles); - - HRESULT ( STDMETHODCALLTYPE *GetDVDTextNumberOfLanguages )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulNumOfLangs); - - HRESULT ( STDMETHODCALLTYPE *GetDVDTextLanguageInfo )( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [out] */ ULONG *pulNumOfStrings, - /* [out] */ LCID *pLangCode, - /* [out] */ enum DVD_TextCharSet *pbCharacterSet); - - HRESULT ( STDMETHODCALLTYPE *GetDVDTextStringAsNative )( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ BYTE *pbBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType); - - HRESULT ( STDMETHODCALLTYPE *GetDVDTextStringAsUnicode )( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ WCHAR *pchwBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType); - - HRESULT ( STDMETHODCALLTYPE *GetPlayerParentalLevel )( - IDvdInfo2 * This, - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ BYTE pbCountryCode[ 2 ]); - - HRESULT ( STDMETHODCALLTYPE *GetNumberOfChapters )( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumOfChapters); - - HRESULT ( STDMETHODCALLTYPE *GetTitleParentalLevels )( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels); - - HRESULT ( STDMETHODCALLTYPE *GetDVDDirectory )( - IDvdInfo2 * This, - /* [size_is][out] */ LPWSTR pszwPath, - /* [in] */ ULONG ulMaxSize, - /* [out] */ ULONG *pulActualSize); - - HRESULT ( STDMETHODCALLTYPE *IsAudioStreamEnabled )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled); - - HRESULT ( STDMETHODCALLTYPE *GetDiscID )( - IDvdInfo2 * This, - /* [in] */ LPCWSTR pszwPath, - /* [out] */ ULONGLONG *pullDiscID); - - HRESULT ( STDMETHODCALLTYPE *GetState )( - IDvdInfo2 * This, - /* [out] */ IDvdState **pStateData); - - HRESULT ( STDMETHODCALLTYPE *GetMenuLanguages )( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguages, - /* [in] */ ULONG ulMaxLanguages, - /* [out] */ ULONG *pulActualLanguages); - - HRESULT ( STDMETHODCALLTYPE *GetButtonAtPosition )( - IDvdInfo2 * This, - /* [in] */ POINT point, - /* [out] */ ULONG *pulButtonIndex); - - HRESULT ( STDMETHODCALLTYPE *GetCmdFromEvent )( - IDvdInfo2 * This, - /* [in] */ LONG_PTR lParam1, - /* [out] */ IDvdCmd **pCmdObj); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultMenuLanguage )( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultAudioLanguage )( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_AUDIO_LANG_EXT *pAudioExtension); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultSubpictureLanguage )( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_SUBPICTURE_LANG_EXT *pSubpictureExtension); - - HRESULT ( STDMETHODCALLTYPE *GetDecoderCaps )( - IDvdInfo2 * This, - /* [out] */ DVD_DECODER_CAPS *pCaps); - - HRESULT ( STDMETHODCALLTYPE *GetButtonRect )( - IDvdInfo2 * This, - /* [in] */ ULONG ulButton, - /* [out] */ RECT *pRect); - - HRESULT ( STDMETHODCALLTYPE *IsSubpictureStreamEnabled )( - IDvdInfo2 * This, - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled); - - END_INTERFACE - } IDvdInfo2Vtbl; - - interface IDvdInfo2 - { - CONST_VTBL struct IDvdInfo2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdInfo2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdInfo2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdInfo2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdInfo2_GetCurrentDomain(This,pDomain) \ - (This)->lpVtbl -> GetCurrentDomain(This,pDomain) - -#define IDvdInfo2_GetCurrentLocation(This,pLocation) \ - (This)->lpVtbl -> GetCurrentLocation(This,pLocation) - -#define IDvdInfo2_GetTotalTitleTime(This,pTotalTime,ulTimeCodeFlags) \ - (This)->lpVtbl -> GetTotalTitleTime(This,pTotalTime,ulTimeCodeFlags) - -#define IDvdInfo2_GetCurrentButton(This,pulButtonsAvailable,pulCurrentButton) \ - (This)->lpVtbl -> GetCurrentButton(This,pulButtonsAvailable,pulCurrentButton) - -#define IDvdInfo2_GetCurrentAngle(This,pulAnglesAvailable,pulCurrentAngle) \ - (This)->lpVtbl -> GetCurrentAngle(This,pulAnglesAvailable,pulCurrentAngle) - -#define IDvdInfo2_GetCurrentAudio(This,pulStreamsAvailable,pulCurrentStream) \ - (This)->lpVtbl -> GetCurrentAudio(This,pulStreamsAvailable,pulCurrentStream) - -#define IDvdInfo2_GetCurrentSubpicture(This,pulStreamsAvailable,pulCurrentStream,pbIsDisabled) \ - (This)->lpVtbl -> GetCurrentSubpicture(This,pulStreamsAvailable,pulCurrentStream,pbIsDisabled) - -#define IDvdInfo2_GetCurrentUOPS(This,pulUOPs) \ - (This)->lpVtbl -> GetCurrentUOPS(This,pulUOPs) - -#define IDvdInfo2_GetAllSPRMs(This,pRegisterArray) \ - (This)->lpVtbl -> GetAllSPRMs(This,pRegisterArray) - -#define IDvdInfo2_GetAllGPRMs(This,pRegisterArray) \ - (This)->lpVtbl -> GetAllGPRMs(This,pRegisterArray) - -#define IDvdInfo2_GetAudioLanguage(This,ulStream,pLanguage) \ - (This)->lpVtbl -> GetAudioLanguage(This,ulStream,pLanguage) - -#define IDvdInfo2_GetSubpictureLanguage(This,ulStream,pLanguage) \ - (This)->lpVtbl -> GetSubpictureLanguage(This,ulStream,pLanguage) - -#define IDvdInfo2_GetTitleAttributes(This,ulTitle,pMenu,pTitle) \ - (This)->lpVtbl -> GetTitleAttributes(This,ulTitle,pMenu,pTitle) - -#define IDvdInfo2_GetVMGAttributes(This,pATR) \ - (This)->lpVtbl -> GetVMGAttributes(This,pATR) - -#define IDvdInfo2_GetCurrentVideoAttributes(This,pATR) \ - (This)->lpVtbl -> GetCurrentVideoAttributes(This,pATR) - -#define IDvdInfo2_GetAudioAttributes(This,ulStream,pATR) \ - (This)->lpVtbl -> GetAudioAttributes(This,ulStream,pATR) - -#define IDvdInfo2_GetKaraokeAttributes(This,ulStream,pAttributes) \ - (This)->lpVtbl -> GetKaraokeAttributes(This,ulStream,pAttributes) - -#define IDvdInfo2_GetSubpictureAttributes(This,ulStream,pATR) \ - (This)->lpVtbl -> GetSubpictureAttributes(This,ulStream,pATR) - -#define IDvdInfo2_GetDVDVolumeInfo(This,pulNumOfVolumes,pulVolume,pSide,pulNumOfTitles) \ - (This)->lpVtbl -> GetDVDVolumeInfo(This,pulNumOfVolumes,pulVolume,pSide,pulNumOfTitles) - -#define IDvdInfo2_GetDVDTextNumberOfLanguages(This,pulNumOfLangs) \ - (This)->lpVtbl -> GetDVDTextNumberOfLanguages(This,pulNumOfLangs) - -#define IDvdInfo2_GetDVDTextLanguageInfo(This,ulLangIndex,pulNumOfStrings,pLangCode,pbCharacterSet) \ - (This)->lpVtbl -> GetDVDTextLanguageInfo(This,ulLangIndex,pulNumOfStrings,pLangCode,pbCharacterSet) - -#define IDvdInfo2_GetDVDTextStringAsNative(This,ulLangIndex,ulStringIndex,pbBuffer,ulMaxBufferSize,pulActualSize,pType) \ - (This)->lpVtbl -> GetDVDTextStringAsNative(This,ulLangIndex,ulStringIndex,pbBuffer,ulMaxBufferSize,pulActualSize,pType) - -#define IDvdInfo2_GetDVDTextStringAsUnicode(This,ulLangIndex,ulStringIndex,pchwBuffer,ulMaxBufferSize,pulActualSize,pType) \ - (This)->lpVtbl -> GetDVDTextStringAsUnicode(This,ulLangIndex,ulStringIndex,pchwBuffer,ulMaxBufferSize,pulActualSize,pType) - -#define IDvdInfo2_GetPlayerParentalLevel(This,pulParentalLevel,pbCountryCode) \ - (This)->lpVtbl -> GetPlayerParentalLevel(This,pulParentalLevel,pbCountryCode) - -#define IDvdInfo2_GetNumberOfChapters(This,ulTitle,pulNumOfChapters) \ - (This)->lpVtbl -> GetNumberOfChapters(This,ulTitle,pulNumOfChapters) - -#define IDvdInfo2_GetTitleParentalLevels(This,ulTitle,pulParentalLevels) \ - (This)->lpVtbl -> GetTitleParentalLevels(This,ulTitle,pulParentalLevels) - -#define IDvdInfo2_GetDVDDirectory(This,pszwPath,ulMaxSize,pulActualSize) \ - (This)->lpVtbl -> GetDVDDirectory(This,pszwPath,ulMaxSize,pulActualSize) - -#define IDvdInfo2_IsAudioStreamEnabled(This,ulStreamNum,pbEnabled) \ - (This)->lpVtbl -> IsAudioStreamEnabled(This,ulStreamNum,pbEnabled) - -#define IDvdInfo2_GetDiscID(This,pszwPath,pullDiscID) \ - (This)->lpVtbl -> GetDiscID(This,pszwPath,pullDiscID) - -#define IDvdInfo2_GetState(This,pStateData) \ - (This)->lpVtbl -> GetState(This,pStateData) - -#define IDvdInfo2_GetMenuLanguages(This,pLanguages,ulMaxLanguages,pulActualLanguages) \ - (This)->lpVtbl -> GetMenuLanguages(This,pLanguages,ulMaxLanguages,pulActualLanguages) - -#define IDvdInfo2_GetButtonAtPosition(This,point,pulButtonIndex) \ - (This)->lpVtbl -> GetButtonAtPosition(This,point,pulButtonIndex) - -#define IDvdInfo2_GetCmdFromEvent(This,lParam1,pCmdObj) \ - (This)->lpVtbl -> GetCmdFromEvent(This,lParam1,pCmdObj) - -#define IDvdInfo2_GetDefaultMenuLanguage(This,pLanguage) \ - (This)->lpVtbl -> GetDefaultMenuLanguage(This,pLanguage) - -#define IDvdInfo2_GetDefaultAudioLanguage(This,pLanguage,pAudioExtension) \ - (This)->lpVtbl -> GetDefaultAudioLanguage(This,pLanguage,pAudioExtension) - -#define IDvdInfo2_GetDefaultSubpictureLanguage(This,pLanguage,pSubpictureExtension) \ - (This)->lpVtbl -> GetDefaultSubpictureLanguage(This,pLanguage,pSubpictureExtension) - -#define IDvdInfo2_GetDecoderCaps(This,pCaps) \ - (This)->lpVtbl -> GetDecoderCaps(This,pCaps) - -#define IDvdInfo2_GetButtonRect(This,ulButton,pRect) \ - (This)->lpVtbl -> GetButtonRect(This,ulButton,pRect) - -#define IDvdInfo2_IsSubpictureStreamEnabled(This,ulStreamNum,pbEnabled) \ - (This)->lpVtbl -> IsSubpictureStreamEnabled(This,ulStreamNum,pbEnabled) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentDomain_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_DOMAIN *pDomain); - - -void __RPC_STUB IDvdInfo2_GetCurrentDomain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentLocation_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_PLAYBACK_LOCATION2 *pLocation); - - -void __RPC_STUB IDvdInfo2_GetCurrentLocation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetTotalTitleTime_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_HMSF_TIMECODE *pTotalTime, - /* [out] */ ULONG *ulTimeCodeFlags); - - -void __RPC_STUB IDvdInfo2_GetTotalTitleTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentButton_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulButtonsAvailable, - /* [out] */ ULONG *pulCurrentButton); - - -void __RPC_STUB IDvdInfo2_GetCurrentButton_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentAngle_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulAnglesAvailable, - /* [out] */ ULONG *pulCurrentAngle); - - -void __RPC_STUB IDvdInfo2_GetCurrentAngle_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentAudio_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream); - - -void __RPC_STUB IDvdInfo2_GetCurrentAudio_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentSubpicture_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulStreamsAvailable, - /* [out] */ ULONG *pulCurrentStream, - /* [out] */ BOOL *pbIsDisabled); - - -void __RPC_STUB IDvdInfo2_GetCurrentSubpicture_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentUOPS_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulUOPs); - - -void __RPC_STUB IDvdInfo2_GetCurrentUOPS_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetAllSPRMs_Proxy( - IDvdInfo2 * This, - /* [out] */ SPRMARRAY *pRegisterArray); - - -void __RPC_STUB IDvdInfo2_GetAllSPRMs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetAllGPRMs_Proxy( - IDvdInfo2 * This, - /* [out] */ GPRMARRAY *pRegisterArray); - - -void __RPC_STUB IDvdInfo2_GetAllGPRMs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetAudioLanguage_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - -void __RPC_STUB IDvdInfo2_GetAudioLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetSubpictureLanguage_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ LCID *pLanguage); - - -void __RPC_STUB IDvdInfo2_GetSubpictureLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetTitleAttributes_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ DVD_MenuAttributes *pMenu, - /* [out] */ DVD_TitleAttributes *pTitle); - - -void __RPC_STUB IDvdInfo2_GetTitleAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetVMGAttributes_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_MenuAttributes *pATR); - - -void __RPC_STUB IDvdInfo2_GetVMGAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCurrentVideoAttributes_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_VideoAttributes *pATR); - - -void __RPC_STUB IDvdInfo2_GetCurrentVideoAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetAudioAttributes_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_AudioAttributes *pATR); - - -void __RPC_STUB IDvdInfo2_GetAudioAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetKaraokeAttributes_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_KaraokeAttributes *pAttributes); - - -void __RPC_STUB IDvdInfo2_GetKaraokeAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetSubpictureAttributes_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStream, - /* [out] */ DVD_SubpictureAttributes *pATR); - - -void __RPC_STUB IDvdInfo2_GetSubpictureAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDVolumeInfo_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulNumOfVolumes, - /* [out] */ ULONG *pulVolume, - /* [out] */ DVD_DISC_SIDE *pSide, - /* [out] */ ULONG *pulNumOfTitles); - - -void __RPC_STUB IDvdInfo2_GetDVDVolumeInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDTextNumberOfLanguages_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulNumOfLangs); - - -void __RPC_STUB IDvdInfo2_GetDVDTextNumberOfLanguages_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDTextLanguageInfo_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [out] */ ULONG *pulNumOfStrings, - /* [out] */ LCID *pLangCode, - /* [out] */ enum DVD_TextCharSet *pbCharacterSet); - - -void __RPC_STUB IDvdInfo2_GetDVDTextLanguageInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDTextStringAsNative_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ BYTE *pbBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType); - - -void __RPC_STUB IDvdInfo2_GetDVDTextStringAsNative_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDTextStringAsUnicode_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulLangIndex, - /* [in] */ ULONG ulStringIndex, - /* [out] */ WCHAR *pchwBuffer, - /* [in] */ ULONG ulMaxBufferSize, - /* [out] */ ULONG *pulActualSize, - /* [out] */ enum DVD_TextStringType *pType); - - -void __RPC_STUB IDvdInfo2_GetDVDTextStringAsUnicode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetPlayerParentalLevel_Proxy( - IDvdInfo2 * This, - /* [out] */ ULONG *pulParentalLevel, - /* [out] */ BYTE pbCountryCode[ 2 ]); - - -void __RPC_STUB IDvdInfo2_GetPlayerParentalLevel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetNumberOfChapters_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulNumOfChapters); - - -void __RPC_STUB IDvdInfo2_GetNumberOfChapters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetTitleParentalLevels_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulTitle, - /* [out] */ ULONG *pulParentalLevels); - - -void __RPC_STUB IDvdInfo2_GetTitleParentalLevels_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDVDDirectory_Proxy( - IDvdInfo2 * This, - /* [size_is][out] */ LPWSTR pszwPath, - /* [in] */ ULONG ulMaxSize, - /* [out] */ ULONG *pulActualSize); - - -void __RPC_STUB IDvdInfo2_GetDVDDirectory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_IsAudioStreamEnabled_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled); - - -void __RPC_STUB IDvdInfo2_IsAudioStreamEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDiscID_Proxy( - IDvdInfo2 * This, - /* [in] */ LPCWSTR pszwPath, - /* [out] */ ULONGLONG *pullDiscID); - - -void __RPC_STUB IDvdInfo2_GetDiscID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetState_Proxy( - IDvdInfo2 * This, - /* [out] */ IDvdState **pStateData); - - -void __RPC_STUB IDvdInfo2_GetState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetMenuLanguages_Proxy( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguages, - /* [in] */ ULONG ulMaxLanguages, - /* [out] */ ULONG *pulActualLanguages); - - -void __RPC_STUB IDvdInfo2_GetMenuLanguages_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetButtonAtPosition_Proxy( - IDvdInfo2 * This, - /* [in] */ POINT point, - /* [out] */ ULONG *pulButtonIndex); - - -void __RPC_STUB IDvdInfo2_GetButtonAtPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetCmdFromEvent_Proxy( - IDvdInfo2 * This, - /* [in] */ LONG_PTR lParam1, - /* [out] */ IDvdCmd **pCmdObj); - - -void __RPC_STUB IDvdInfo2_GetCmdFromEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDefaultMenuLanguage_Proxy( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage); - - -void __RPC_STUB IDvdInfo2_GetDefaultMenuLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDefaultAudioLanguage_Proxy( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_AUDIO_LANG_EXT *pAudioExtension); - - -void __RPC_STUB IDvdInfo2_GetDefaultAudioLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDefaultSubpictureLanguage_Proxy( - IDvdInfo2 * This, - /* [out] */ LCID *pLanguage, - /* [out] */ DVD_SUBPICTURE_LANG_EXT *pSubpictureExtension); - - -void __RPC_STUB IDvdInfo2_GetDefaultSubpictureLanguage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetDecoderCaps_Proxy( - IDvdInfo2 * This, - /* [out] */ DVD_DECODER_CAPS *pCaps); - - -void __RPC_STUB IDvdInfo2_GetDecoderCaps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_GetButtonRect_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulButton, - /* [out] */ RECT *pRect); - - -void __RPC_STUB IDvdInfo2_GetButtonRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdInfo2_IsSubpictureStreamEnabled_Proxy( - IDvdInfo2 * This, - /* [in] */ ULONG ulStreamNum, - /* [out] */ BOOL *pbEnabled); - - -void __RPC_STUB IDvdInfo2_IsSubpictureStreamEnabled_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdInfo2_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0373 */ -/* [local] */ - -typedef -enum _AM_DVD_GRAPH_FLAGS - { AM_DVD_HWDEC_PREFER = 0x1, - AM_DVD_HWDEC_ONLY = 0x2, - AM_DVD_SWDEC_PREFER = 0x4, - AM_DVD_SWDEC_ONLY = 0x8, - AM_DVD_NOVPE = 0x100 - } AM_DVD_GRAPH_FLAGS; - -typedef -enum _AM_DVD_STREAM_FLAGS - { AM_DVD_STREAM_VIDEO = 0x1, - AM_DVD_STREAM_AUDIO = 0x2, - AM_DVD_STREAM_SUBPIC = 0x4 - } AM_DVD_STREAM_FLAGS; - -typedef /* [public][public] */ struct __MIDL___MIDL_itf_strmif_0373_0001 - { - HRESULT hrVPEStatus; - BOOL bDvdVolInvalid; - BOOL bDvdVolUnknown; - BOOL bNoLine21In; - BOOL bNoLine21Out; - int iNumStreams; - int iNumStreamsFailed; - DWORD dwFailedStreamsFlag; - } AM_DVD_RENDERSTATUS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0373_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0373_v0_0_s_ifspec; - -#ifndef __IDvdGraphBuilder_INTERFACE_DEFINED__ -#define __IDvdGraphBuilder_INTERFACE_DEFINED__ - -/* interface IDvdGraphBuilder */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDvdGraphBuilder; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FCC152B6-F372-11d0-8E00-00C04FD7C08B") - IDvdGraphBuilder : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFiltergraph( - /* [out] */ IGraphBuilder **ppGB) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDvdInterface( - /* [in] */ REFIID riid, - /* [out] */ void **ppvIF) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderDvdVideoVolume( - /* [in] */ LPCWSTR lpcwszPathName, - /* [in] */ DWORD dwFlags, - /* [out] */ AM_DVD_RENDERSTATUS *pStatus) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDvdGraphBuilderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDvdGraphBuilder * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDvdGraphBuilder * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDvdGraphBuilder * This); - - HRESULT ( STDMETHODCALLTYPE *GetFiltergraph )( - IDvdGraphBuilder * This, - /* [out] */ IGraphBuilder **ppGB); - - HRESULT ( STDMETHODCALLTYPE *GetDvdInterface )( - IDvdGraphBuilder * This, - /* [in] */ REFIID riid, - /* [out] */ void **ppvIF); - - HRESULT ( STDMETHODCALLTYPE *RenderDvdVideoVolume )( - IDvdGraphBuilder * This, - /* [in] */ LPCWSTR lpcwszPathName, - /* [in] */ DWORD dwFlags, - /* [out] */ AM_DVD_RENDERSTATUS *pStatus); - - END_INTERFACE - } IDvdGraphBuilderVtbl; - - interface IDvdGraphBuilder - { - CONST_VTBL struct IDvdGraphBuilderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDvdGraphBuilder_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDvdGraphBuilder_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDvdGraphBuilder_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDvdGraphBuilder_GetFiltergraph(This,ppGB) \ - (This)->lpVtbl -> GetFiltergraph(This,ppGB) - -#define IDvdGraphBuilder_GetDvdInterface(This,riid,ppvIF) \ - (This)->lpVtbl -> GetDvdInterface(This,riid,ppvIF) - -#define IDvdGraphBuilder_RenderDvdVideoVolume(This,lpcwszPathName,dwFlags,pStatus) \ - (This)->lpVtbl -> RenderDvdVideoVolume(This,lpcwszPathName,dwFlags,pStatus) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDvdGraphBuilder_GetFiltergraph_Proxy( - IDvdGraphBuilder * This, - /* [out] */ IGraphBuilder **ppGB); - - -void __RPC_STUB IDvdGraphBuilder_GetFiltergraph_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdGraphBuilder_GetDvdInterface_Proxy( - IDvdGraphBuilder * This, - /* [in] */ REFIID riid, - /* [out] */ void **ppvIF); - - -void __RPC_STUB IDvdGraphBuilder_GetDvdInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDvdGraphBuilder_RenderDvdVideoVolume_Proxy( - IDvdGraphBuilder * This, - /* [in] */ LPCWSTR lpcwszPathName, - /* [in] */ DWORD dwFlags, - /* [out] */ AM_DVD_RENDERSTATUS *pStatus); - - -void __RPC_STUB IDvdGraphBuilder_RenderDvdVideoVolume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDvdGraphBuilder_INTERFACE_DEFINED__ */ - - -#ifndef __IDDrawExclModeVideo_INTERFACE_DEFINED__ -#define __IDDrawExclModeVideo_INTERFACE_DEFINED__ - -/* interface IDDrawExclModeVideo */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDDrawExclModeVideo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("153ACC21-D83B-11d1-82BF-00A0C9696C8F") - IDDrawExclModeVideo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetDDrawObject( - /* [in] */ IDirectDraw *pDDrawObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDDrawObject( - /* [out] */ IDirectDraw **ppDDrawObject, - /* [out] */ BOOL *pbUsingExternal) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDDrawSurface( - /* [in] */ IDirectDrawSurface *pDDrawSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDDrawSurface( - /* [out] */ IDirectDrawSurface **ppDDrawSurface, - /* [out] */ BOOL *pbUsingExternal) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDrawParameters( - /* [in] */ const RECT *prcSource, - /* [in] */ const RECT *prcTarget) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNativeVideoProps( - /* [out] */ DWORD *pdwVideoWidth, - /* [out] */ DWORD *pdwVideoHeight, - /* [out] */ DWORD *pdwPictAspectRatioX, - /* [out] */ DWORD *pdwPictAspectRatioY) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCallbackInterface( - /* [in] */ IDDrawExclModeVideoCallback *pCallback, - /* [in] */ DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDDrawExclModeVideoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDDrawExclModeVideo * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDDrawExclModeVideo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDDrawExclModeVideo * This); - - HRESULT ( STDMETHODCALLTYPE *SetDDrawObject )( - IDDrawExclModeVideo * This, - /* [in] */ IDirectDraw *pDDrawObject); - - HRESULT ( STDMETHODCALLTYPE *GetDDrawObject )( - IDDrawExclModeVideo * This, - /* [out] */ IDirectDraw **ppDDrawObject, - /* [out] */ BOOL *pbUsingExternal); - - HRESULT ( STDMETHODCALLTYPE *SetDDrawSurface )( - IDDrawExclModeVideo * This, - /* [in] */ IDirectDrawSurface *pDDrawSurface); - - HRESULT ( STDMETHODCALLTYPE *GetDDrawSurface )( - IDDrawExclModeVideo * This, - /* [out] */ IDirectDrawSurface **ppDDrawSurface, - /* [out] */ BOOL *pbUsingExternal); - - HRESULT ( STDMETHODCALLTYPE *SetDrawParameters )( - IDDrawExclModeVideo * This, - /* [in] */ const RECT *prcSource, - /* [in] */ const RECT *prcTarget); - - HRESULT ( STDMETHODCALLTYPE *GetNativeVideoProps )( - IDDrawExclModeVideo * This, - /* [out] */ DWORD *pdwVideoWidth, - /* [out] */ DWORD *pdwVideoHeight, - /* [out] */ DWORD *pdwPictAspectRatioX, - /* [out] */ DWORD *pdwPictAspectRatioY); - - HRESULT ( STDMETHODCALLTYPE *SetCallbackInterface )( - IDDrawExclModeVideo * This, - /* [in] */ IDDrawExclModeVideoCallback *pCallback, - /* [in] */ DWORD dwFlags); - - END_INTERFACE - } IDDrawExclModeVideoVtbl; - - interface IDDrawExclModeVideo - { - CONST_VTBL struct IDDrawExclModeVideoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDDrawExclModeVideo_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDDrawExclModeVideo_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDDrawExclModeVideo_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDDrawExclModeVideo_SetDDrawObject(This,pDDrawObject) \ - (This)->lpVtbl -> SetDDrawObject(This,pDDrawObject) - -#define IDDrawExclModeVideo_GetDDrawObject(This,ppDDrawObject,pbUsingExternal) \ - (This)->lpVtbl -> GetDDrawObject(This,ppDDrawObject,pbUsingExternal) - -#define IDDrawExclModeVideo_SetDDrawSurface(This,pDDrawSurface) \ - (This)->lpVtbl -> SetDDrawSurface(This,pDDrawSurface) - -#define IDDrawExclModeVideo_GetDDrawSurface(This,ppDDrawSurface,pbUsingExternal) \ - (This)->lpVtbl -> GetDDrawSurface(This,ppDDrawSurface,pbUsingExternal) - -#define IDDrawExclModeVideo_SetDrawParameters(This,prcSource,prcTarget) \ - (This)->lpVtbl -> SetDrawParameters(This,prcSource,prcTarget) - -#define IDDrawExclModeVideo_GetNativeVideoProps(This,pdwVideoWidth,pdwVideoHeight,pdwPictAspectRatioX,pdwPictAspectRatioY) \ - (This)->lpVtbl -> GetNativeVideoProps(This,pdwVideoWidth,pdwVideoHeight,pdwPictAspectRatioX,pdwPictAspectRatioY) - -#define IDDrawExclModeVideo_SetCallbackInterface(This,pCallback,dwFlags) \ - (This)->lpVtbl -> SetCallbackInterface(This,pCallback,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_SetDDrawObject_Proxy( - IDDrawExclModeVideo * This, - /* [in] */ IDirectDraw *pDDrawObject); - - -void __RPC_STUB IDDrawExclModeVideo_SetDDrawObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_GetDDrawObject_Proxy( - IDDrawExclModeVideo * This, - /* [out] */ IDirectDraw **ppDDrawObject, - /* [out] */ BOOL *pbUsingExternal); - - -void __RPC_STUB IDDrawExclModeVideo_GetDDrawObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_SetDDrawSurface_Proxy( - IDDrawExclModeVideo * This, - /* [in] */ IDirectDrawSurface *pDDrawSurface); - - -void __RPC_STUB IDDrawExclModeVideo_SetDDrawSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_GetDDrawSurface_Proxy( - IDDrawExclModeVideo * This, - /* [out] */ IDirectDrawSurface **ppDDrawSurface, - /* [out] */ BOOL *pbUsingExternal); - - -void __RPC_STUB IDDrawExclModeVideo_GetDDrawSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_SetDrawParameters_Proxy( - IDDrawExclModeVideo * This, - /* [in] */ const RECT *prcSource, - /* [in] */ const RECT *prcTarget); - - -void __RPC_STUB IDDrawExclModeVideo_SetDrawParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_GetNativeVideoProps_Proxy( - IDDrawExclModeVideo * This, - /* [out] */ DWORD *pdwVideoWidth, - /* [out] */ DWORD *pdwVideoHeight, - /* [out] */ DWORD *pdwPictAspectRatioX, - /* [out] */ DWORD *pdwPictAspectRatioY); - - -void __RPC_STUB IDDrawExclModeVideo_GetNativeVideoProps_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideo_SetCallbackInterface_Proxy( - IDDrawExclModeVideo * This, - /* [in] */ IDDrawExclModeVideoCallback *pCallback, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IDDrawExclModeVideo_SetCallbackInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDDrawExclModeVideo_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0375 */ -/* [local] */ - - -enum _AM_OVERLAY_NOTIFY_FLAGS - { AM_OVERLAY_NOTIFY_VISIBLE_CHANGE = 0x1, - AM_OVERLAY_NOTIFY_SOURCE_CHANGE = 0x2, - AM_OVERLAY_NOTIFY_DEST_CHANGE = 0x4 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0375_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0375_v0_0_s_ifspec; - -#ifndef __IDDrawExclModeVideoCallback_INTERFACE_DEFINED__ -#define __IDDrawExclModeVideoCallback_INTERFACE_DEFINED__ - -/* interface IDDrawExclModeVideoCallback */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_IDDrawExclModeVideoCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("913c24a0-20ab-11d2-9038-00a0c9697298") - IDDrawExclModeVideoCallback : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnUpdateOverlay( - /* [in] */ BOOL bBefore, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bOldVisible, - /* [in] */ const RECT *prcOldSrc, - /* [in] */ const RECT *prcOldDest, - /* [in] */ BOOL bNewVisible, - /* [in] */ const RECT *prcNewSrc, - /* [in] */ const RECT *prcNewDest) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnUpdateColorKey( - /* [in] */ const COLORKEY *pKey, - /* [in] */ DWORD dwColor) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnUpdateSize( - /* [in] */ DWORD dwWidth, - /* [in] */ DWORD dwHeight, - /* [in] */ DWORD dwARWidth, - /* [in] */ DWORD dwARHeight) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDDrawExclModeVideoCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDDrawExclModeVideoCallback * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDDrawExclModeVideoCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDDrawExclModeVideoCallback * This); - - HRESULT ( STDMETHODCALLTYPE *OnUpdateOverlay )( - IDDrawExclModeVideoCallback * This, - /* [in] */ BOOL bBefore, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bOldVisible, - /* [in] */ const RECT *prcOldSrc, - /* [in] */ const RECT *prcOldDest, - /* [in] */ BOOL bNewVisible, - /* [in] */ const RECT *prcNewSrc, - /* [in] */ const RECT *prcNewDest); - - HRESULT ( STDMETHODCALLTYPE *OnUpdateColorKey )( - IDDrawExclModeVideoCallback * This, - /* [in] */ const COLORKEY *pKey, - /* [in] */ DWORD dwColor); - - HRESULT ( STDMETHODCALLTYPE *OnUpdateSize )( - IDDrawExclModeVideoCallback * This, - /* [in] */ DWORD dwWidth, - /* [in] */ DWORD dwHeight, - /* [in] */ DWORD dwARWidth, - /* [in] */ DWORD dwARHeight); - - END_INTERFACE - } IDDrawExclModeVideoCallbackVtbl; - - interface IDDrawExclModeVideoCallback - { - CONST_VTBL struct IDDrawExclModeVideoCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDDrawExclModeVideoCallback_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDDrawExclModeVideoCallback_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDDrawExclModeVideoCallback_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDDrawExclModeVideoCallback_OnUpdateOverlay(This,bBefore,dwFlags,bOldVisible,prcOldSrc,prcOldDest,bNewVisible,prcNewSrc,prcNewDest) \ - (This)->lpVtbl -> OnUpdateOverlay(This,bBefore,dwFlags,bOldVisible,prcOldSrc,prcOldDest,bNewVisible,prcNewSrc,prcNewDest) - -#define IDDrawExclModeVideoCallback_OnUpdateColorKey(This,pKey,dwColor) \ - (This)->lpVtbl -> OnUpdateColorKey(This,pKey,dwColor) - -#define IDDrawExclModeVideoCallback_OnUpdateSize(This,dwWidth,dwHeight,dwARWidth,dwARHeight) \ - (This)->lpVtbl -> OnUpdateSize(This,dwWidth,dwHeight,dwARWidth,dwARHeight) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideoCallback_OnUpdateOverlay_Proxy( - IDDrawExclModeVideoCallback * This, - /* [in] */ BOOL bBefore, - /* [in] */ DWORD dwFlags, - /* [in] */ BOOL bOldVisible, - /* [in] */ const RECT *prcOldSrc, - /* [in] */ const RECT *prcOldDest, - /* [in] */ BOOL bNewVisible, - /* [in] */ const RECT *prcNewSrc, - /* [in] */ const RECT *prcNewDest); - - -void __RPC_STUB IDDrawExclModeVideoCallback_OnUpdateOverlay_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideoCallback_OnUpdateColorKey_Proxy( - IDDrawExclModeVideoCallback * This, - /* [in] */ const COLORKEY *pKey, - /* [in] */ DWORD dwColor); - - -void __RPC_STUB IDDrawExclModeVideoCallback_OnUpdateColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IDDrawExclModeVideoCallback_OnUpdateSize_Proxy( - IDDrawExclModeVideoCallback * This, - /* [in] */ DWORD dwWidth, - /* [in] */ DWORD dwHeight, - /* [in] */ DWORD dwARWidth, - /* [in] */ DWORD dwARHeight); - - -void __RPC_STUB IDDrawExclModeVideoCallback_OnUpdateSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDDrawExclModeVideoCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0376 */ -/* [local] */ - - - - - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0376_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0376_v0_0_s_ifspec; - -#ifndef __IPinConnection_INTERFACE_DEFINED__ -#define __IPinConnection_INTERFACE_DEFINED__ - -/* interface IPinConnection */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IPinConnection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4a9a62d3-27d4-403d-91e9-89f540e55534") - IPinConnection : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE DynamicQueryAccept( - /* [in] */ const AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyEndOfStream( - /* [in] */ HANDLE hNotifyEvent) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsEndPin( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE DynamicDisconnect( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPinConnectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPinConnection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPinConnection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPinConnection * This); - - HRESULT ( STDMETHODCALLTYPE *DynamicQueryAccept )( - IPinConnection * This, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *NotifyEndOfStream )( - IPinConnection * This, - /* [in] */ HANDLE hNotifyEvent); - - HRESULT ( STDMETHODCALLTYPE *IsEndPin )( - IPinConnection * This); - - HRESULT ( STDMETHODCALLTYPE *DynamicDisconnect )( - IPinConnection * This); - - END_INTERFACE - } IPinConnectionVtbl; - - interface IPinConnection - { - CONST_VTBL struct IPinConnectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPinConnection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPinConnection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPinConnection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPinConnection_DynamicQueryAccept(This,pmt) \ - (This)->lpVtbl -> DynamicQueryAccept(This,pmt) - -#define IPinConnection_NotifyEndOfStream(This,hNotifyEvent) \ - (This)->lpVtbl -> NotifyEndOfStream(This,hNotifyEvent) - -#define IPinConnection_IsEndPin(This) \ - (This)->lpVtbl -> IsEndPin(This) - -#define IPinConnection_DynamicDisconnect(This) \ - (This)->lpVtbl -> DynamicDisconnect(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IPinConnection_DynamicQueryAccept_Proxy( - IPinConnection * This, - /* [in] */ const AM_MEDIA_TYPE *pmt); - - -void __RPC_STUB IPinConnection_DynamicQueryAccept_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinConnection_NotifyEndOfStream_Proxy( - IPinConnection * This, - /* [in] */ HANDLE hNotifyEvent); - - -void __RPC_STUB IPinConnection_NotifyEndOfStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinConnection_IsEndPin_Proxy( - IPinConnection * This); - - -void __RPC_STUB IPinConnection_IsEndPin_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IPinConnection_DynamicDisconnect_Proxy( - IPinConnection * This); - - -void __RPC_STUB IPinConnection_DynamicDisconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPinConnection_INTERFACE_DEFINED__ */ - - -#ifndef __IPinFlowControl_INTERFACE_DEFINED__ -#define __IPinFlowControl_INTERFACE_DEFINED__ - -/* interface IPinFlowControl */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IPinFlowControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c56e9858-dbf3-4f6b-8119-384af2060deb") - IPinFlowControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Block( - /* [in] */ DWORD dwBlockFlags, - /* [in] */ HANDLE hEvent) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPinFlowControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPinFlowControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPinFlowControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPinFlowControl * This); - - HRESULT ( STDMETHODCALLTYPE *Block )( - IPinFlowControl * This, - /* [in] */ DWORD dwBlockFlags, - /* [in] */ HANDLE hEvent); - - END_INTERFACE - } IPinFlowControlVtbl; - - interface IPinFlowControl - { - CONST_VTBL struct IPinFlowControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPinFlowControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IPinFlowControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IPinFlowControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IPinFlowControl_Block(This,dwBlockFlags,hEvent) \ - (This)->lpVtbl -> Block(This,dwBlockFlags,hEvent) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IPinFlowControl_Block_Proxy( - IPinFlowControl * This, - /* [in] */ DWORD dwBlockFlags, - /* [in] */ HANDLE hEvent); - - -void __RPC_STUB IPinFlowControl_Block_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IPinFlowControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0378 */ -/* [local] */ - - -enum _AM_PIN_FLOW_CONTROL_BLOCK_FLAGS - { AM_PIN_FLOW_CONTROL_BLOCK = 0x1 - } ; -typedef -enum _AM_GRAPH_CONFIG_RECONNECT_FLAGS - { AM_GRAPH_CONFIG_RECONNECT_DIRECTCONNECT = 0x1, - AM_GRAPH_CONFIG_RECONNECT_CACHE_REMOVED_FILTERS = 0x2, - AM_GRAPH_CONFIG_RECONNECT_USE_ONLY_CACHED_FILTERS = 0x4 - } AM_GRAPH_CONFIG_RECONNECT_FLAGS; - - -enum _REM_FILTER_FLAGS - { REMFILTERF_LEAVECONNECTED = 0x1 - } ; -typedef -enum _AM_FILTER_FLAGS - { AM_FILTER_FLAGS_REMOVABLE = 0x1 - } AM_FILTER_FLAGS; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0378_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0378_v0_0_s_ifspec; - -#ifndef __IGraphConfig_INTERFACE_DEFINED__ -#define __IGraphConfig_INTERFACE_DEFINED__ - -/* interface IGraphConfig */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IGraphConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("03A1EB8E-32BF-4245-8502-114D08A9CB88") - IGraphConfig : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Reconnect( - /* [in] */ IPin *pOutputPin, - /* [in] */ IPin *pInputPin, - /* [in] */ const AM_MEDIA_TYPE *pmtFirstConnection, - /* [in] */ IBaseFilter *pUsingFilter, - /* [in] */ HANDLE hAbortEvent, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reconfigure( - /* [in] */ IGraphConfigCallback *pCallback, - /* [in] */ PVOID pvContext, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hAbortEvent) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddFilterToCache( - /* [in] */ IBaseFilter *pFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumCacheFilter( - /* [out] */ IEnumFilters **pEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveFilterFromCache( - /* [in] */ IBaseFilter *pFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStartTime( - /* [out] */ REFERENCE_TIME *prtStart) = 0; - - virtual HRESULT STDMETHODCALLTYPE PushThroughData( - /* [in] */ IPin *pOutputPin, - /* [in] */ IPinConnection *pConnection, - /* [in] */ HANDLE hEventAbort) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFilterFlags( - /* [in] */ IBaseFilter *pFilter, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilterFlags( - /* [in] */ IBaseFilter *pFilter, - /* [out] */ DWORD *pdwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveFilterEx( - /* [in] */ IBaseFilter *pFilter, - DWORD Flags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGraphConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGraphConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGraphConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGraphConfig * This); - - HRESULT ( STDMETHODCALLTYPE *Reconnect )( - IGraphConfig * This, - /* [in] */ IPin *pOutputPin, - /* [in] */ IPin *pInputPin, - /* [in] */ const AM_MEDIA_TYPE *pmtFirstConnection, - /* [in] */ IBaseFilter *pUsingFilter, - /* [in] */ HANDLE hAbortEvent, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *Reconfigure )( - IGraphConfig * This, - /* [in] */ IGraphConfigCallback *pCallback, - /* [in] */ PVOID pvContext, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hAbortEvent); - - HRESULT ( STDMETHODCALLTYPE *AddFilterToCache )( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter); - - HRESULT ( STDMETHODCALLTYPE *EnumCacheFilter )( - IGraphConfig * This, - /* [out] */ IEnumFilters **pEnum); - - HRESULT ( STDMETHODCALLTYPE *RemoveFilterFromCache )( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter); - - HRESULT ( STDMETHODCALLTYPE *GetStartTime )( - IGraphConfig * This, - /* [out] */ REFERENCE_TIME *prtStart); - - HRESULT ( STDMETHODCALLTYPE *PushThroughData )( - IGraphConfig * This, - /* [in] */ IPin *pOutputPin, - /* [in] */ IPinConnection *pConnection, - /* [in] */ HANDLE hEventAbort); - - HRESULT ( STDMETHODCALLTYPE *SetFilterFlags )( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *GetFilterFlags )( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - /* [out] */ DWORD *pdwFlags); - - HRESULT ( STDMETHODCALLTYPE *RemoveFilterEx )( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - DWORD Flags); - - END_INTERFACE - } IGraphConfigVtbl; - - interface IGraphConfig - { - CONST_VTBL struct IGraphConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGraphConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IGraphConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IGraphConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IGraphConfig_Reconnect(This,pOutputPin,pInputPin,pmtFirstConnection,pUsingFilter,hAbortEvent,dwFlags) \ - (This)->lpVtbl -> Reconnect(This,pOutputPin,pInputPin,pmtFirstConnection,pUsingFilter,hAbortEvent,dwFlags) - -#define IGraphConfig_Reconfigure(This,pCallback,pvContext,dwFlags,hAbortEvent) \ - (This)->lpVtbl -> Reconfigure(This,pCallback,pvContext,dwFlags,hAbortEvent) - -#define IGraphConfig_AddFilterToCache(This,pFilter) \ - (This)->lpVtbl -> AddFilterToCache(This,pFilter) - -#define IGraphConfig_EnumCacheFilter(This,pEnum) \ - (This)->lpVtbl -> EnumCacheFilter(This,pEnum) - -#define IGraphConfig_RemoveFilterFromCache(This,pFilter) \ - (This)->lpVtbl -> RemoveFilterFromCache(This,pFilter) - -#define IGraphConfig_GetStartTime(This,prtStart) \ - (This)->lpVtbl -> GetStartTime(This,prtStart) - -#define IGraphConfig_PushThroughData(This,pOutputPin,pConnection,hEventAbort) \ - (This)->lpVtbl -> PushThroughData(This,pOutputPin,pConnection,hEventAbort) - -#define IGraphConfig_SetFilterFlags(This,pFilter,dwFlags) \ - (This)->lpVtbl -> SetFilterFlags(This,pFilter,dwFlags) - -#define IGraphConfig_GetFilterFlags(This,pFilter,pdwFlags) \ - (This)->lpVtbl -> GetFilterFlags(This,pFilter,pdwFlags) - -#define IGraphConfig_RemoveFilterEx(This,pFilter,Flags) \ - (This)->lpVtbl -> RemoveFilterEx(This,pFilter,Flags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IGraphConfig_Reconnect_Proxy( - IGraphConfig * This, - /* [in] */ IPin *pOutputPin, - /* [in] */ IPin *pInputPin, - /* [in] */ const AM_MEDIA_TYPE *pmtFirstConnection, - /* [in] */ IBaseFilter *pUsingFilter, - /* [in] */ HANDLE hAbortEvent, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IGraphConfig_Reconnect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_Reconfigure_Proxy( - IGraphConfig * This, - /* [in] */ IGraphConfigCallback *pCallback, - /* [in] */ PVOID pvContext, - /* [in] */ DWORD dwFlags, - /* [in] */ HANDLE hAbortEvent); - - -void __RPC_STUB IGraphConfig_Reconfigure_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_AddFilterToCache_Proxy( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter); - - -void __RPC_STUB IGraphConfig_AddFilterToCache_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_EnumCacheFilter_Proxy( - IGraphConfig * This, - /* [out] */ IEnumFilters **pEnum); - - -void __RPC_STUB IGraphConfig_EnumCacheFilter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_RemoveFilterFromCache_Proxy( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter); - - -void __RPC_STUB IGraphConfig_RemoveFilterFromCache_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_GetStartTime_Proxy( - IGraphConfig * This, - /* [out] */ REFERENCE_TIME *prtStart); - - -void __RPC_STUB IGraphConfig_GetStartTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_PushThroughData_Proxy( - IGraphConfig * This, - /* [in] */ IPin *pOutputPin, - /* [in] */ IPinConnection *pConnection, - /* [in] */ HANDLE hEventAbort); - - -void __RPC_STUB IGraphConfig_PushThroughData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_SetFilterFlags_Proxy( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IGraphConfig_SetFilterFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_GetFilterFlags_Proxy( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - /* [out] */ DWORD *pdwFlags); - - -void __RPC_STUB IGraphConfig_GetFilterFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IGraphConfig_RemoveFilterEx_Proxy( - IGraphConfig * This, - /* [in] */ IBaseFilter *pFilter, - DWORD Flags); - - -void __RPC_STUB IGraphConfig_RemoveFilterEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IGraphConfig_INTERFACE_DEFINED__ */ - - -#ifndef __IGraphConfigCallback_INTERFACE_DEFINED__ -#define __IGraphConfigCallback_INTERFACE_DEFINED__ - -/* interface IGraphConfigCallback */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IGraphConfigCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ade0fd60-d19d-11d2-abf6-00a0c905f375") - IGraphConfigCallback : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Reconfigure( - PVOID pvContext, - DWORD dwFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGraphConfigCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGraphConfigCallback * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGraphConfigCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGraphConfigCallback * This); - - HRESULT ( STDMETHODCALLTYPE *Reconfigure )( - IGraphConfigCallback * This, - PVOID pvContext, - DWORD dwFlags); - - END_INTERFACE - } IGraphConfigCallbackVtbl; - - interface IGraphConfigCallback - { - CONST_VTBL struct IGraphConfigCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGraphConfigCallback_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IGraphConfigCallback_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IGraphConfigCallback_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IGraphConfigCallback_Reconfigure(This,pvContext,dwFlags) \ - (This)->lpVtbl -> Reconfigure(This,pvContext,dwFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IGraphConfigCallback_Reconfigure_Proxy( - IGraphConfigCallback * This, - PVOID pvContext, - DWORD dwFlags); - - -void __RPC_STUB IGraphConfigCallback_Reconfigure_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IGraphConfigCallback_INTERFACE_DEFINED__ */ - - -#ifndef __IFilterChain_INTERFACE_DEFINED__ -#define __IFilterChain_INTERFACE_DEFINED__ - -/* interface IFilterChain */ -/* [unique][uuid][object][local] */ - - -EXTERN_C const IID IID_IFilterChain; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29") - IFilterChain : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE StartChain( - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE PauseChain( - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE StopChain( - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveChain( - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFilterChainVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFilterChain * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFilterChain * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFilterChain * This); - - HRESULT ( STDMETHODCALLTYPE *StartChain )( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - HRESULT ( STDMETHODCALLTYPE *PauseChain )( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - HRESULT ( STDMETHODCALLTYPE *StopChain )( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - HRESULT ( STDMETHODCALLTYPE *RemoveChain )( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - END_INTERFACE - } IFilterChainVtbl; - - interface IFilterChain - { - CONST_VTBL struct IFilterChainVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFilterChain_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IFilterChain_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IFilterChain_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IFilterChain_StartChain(This,pStartFilter,pEndFilter) \ - (This)->lpVtbl -> StartChain(This,pStartFilter,pEndFilter) - -#define IFilterChain_PauseChain(This,pStartFilter,pEndFilter) \ - (This)->lpVtbl -> PauseChain(This,pStartFilter,pEndFilter) - -#define IFilterChain_StopChain(This,pStartFilter,pEndFilter) \ - (This)->lpVtbl -> StopChain(This,pStartFilter,pEndFilter) - -#define IFilterChain_RemoveChain(This,pStartFilter,pEndFilter) \ - (This)->lpVtbl -> RemoveChain(This,pStartFilter,pEndFilter) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IFilterChain_StartChain_Proxy( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - -void __RPC_STUB IFilterChain_StartChain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterChain_PauseChain_Proxy( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - -void __RPC_STUB IFilterChain_PauseChain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterChain_StopChain_Proxy( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - -void __RPC_STUB IFilterChain_StopChain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IFilterChain_RemoveChain_Proxy( - IFilterChain * This, - /* [in] */ IBaseFilter *pStartFilter, - /* [in] */ IBaseFilter *pEndFilter); - - -void __RPC_STUB IFilterChain_RemoveChain_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IFilterChain_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0381 */ -/* [local] */ - -// Restore the previous setting for C4201 compiler warning -#pragma warning(default:4201) - - -#if 0 -typedef DWORD *LPDIRECTDRAW7; - -typedef DWORD *LPDIRECTDRAWSURFACE7; - -typedef DWORD *LPDDPIXELFORMAT; - -typedef DWORD *LPBITMAPINFOHEADER; - -typedef /* [public][public][public][public][public][public] */ struct __MIDL___MIDL_itf_strmif_0381_0001 - { - DWORD dw1; - DWORD dw2; - } DDCOLORKEY; - -typedef DDCOLORKEY *LPDDCOLORKEY; - -#endif -#include - - - - - - - - - - - - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0381_0002 - { VMRSample_SyncPoint = 0x1, - VMRSample_Preroll = 0x2, - VMRSample_Discontinuity = 0x4, - VMRSample_TimeValid = 0x8 - } VMRPresentationFlags; - -typedef struct tagVMRPRESENTATIONINFO - { - DWORD dwFlags; - LPDIRECTDRAWSURFACE7 lpSurf; - REFERENCE_TIME rtStart; - REFERENCE_TIME rtEnd; - SIZE szAspectRatio; - RECT rcSrc; - RECT rcDst; - DWORD dwTypeSpecificFlags; - DWORD dwInterlaceFlags; - } VMRPRESENTATIONINFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0381_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0381_v0_0_s_ifspec; - -#ifndef __IVMRImagePresenter_INTERFACE_DEFINED__ -#define __IVMRImagePresenter_INTERFACE_DEFINED__ - -/* interface IVMRImagePresenter */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRImagePresenter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("CE704FE7-E71E-41fb-BAA2-C4403E1182F5") - IVMRImagePresenter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE StartPresenting( - /* [in] */ DWORD_PTR dwUserID) = 0; - - virtual HRESULT STDMETHODCALLTYPE StopPresenting( - /* [in] */ DWORD_PTR dwUserID) = 0; - - virtual HRESULT STDMETHODCALLTYPE PresentImage( - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRPRESENTATIONINFO *lpPresInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRImagePresenterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRImagePresenter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRImagePresenter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRImagePresenter * This); - - HRESULT ( STDMETHODCALLTYPE *StartPresenting )( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID); - - HRESULT ( STDMETHODCALLTYPE *StopPresenting )( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID); - - HRESULT ( STDMETHODCALLTYPE *PresentImage )( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRPRESENTATIONINFO *lpPresInfo); - - END_INTERFACE - } IVMRImagePresenterVtbl; - - interface IVMRImagePresenter - { - CONST_VTBL struct IVMRImagePresenterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRImagePresenter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRImagePresenter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRImagePresenter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRImagePresenter_StartPresenting(This,dwUserID) \ - (This)->lpVtbl -> StartPresenting(This,dwUserID) - -#define IVMRImagePresenter_StopPresenting(This,dwUserID) \ - (This)->lpVtbl -> StopPresenting(This,dwUserID) - -#define IVMRImagePresenter_PresentImage(This,dwUserID,lpPresInfo) \ - (This)->lpVtbl -> PresentImage(This,dwUserID,lpPresInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenter_StartPresenting_Proxy( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID); - - -void __RPC_STUB IVMRImagePresenter_StartPresenting_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenter_StopPresenting_Proxy( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID); - - -void __RPC_STUB IVMRImagePresenter_StopPresenting_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenter_PresentImage_Proxy( - IVMRImagePresenter * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRPRESENTATIONINFO *lpPresInfo); - - -void __RPC_STUB IVMRImagePresenter_PresentImage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRImagePresenter_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0382 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0382_0001 - { AMAP_PIXELFORMAT_VALID = 0x1, - AMAP_3D_TARGET = 0x2, - AMAP_ALLOW_SYSMEM = 0x4, - AMAP_FORCE_SYSMEM = 0x8, - AMAP_DIRECTED_FLIP = 0x10, - AMAP_DXVA_TARGET = 0x20 - } VMRSurfaceAllocationFlags; - -typedef struct tagVMRALLOCATIONINFO - { - DWORD dwFlags; - LPBITMAPINFOHEADER lpHdr; - LPDDPIXELFORMAT lpPixFmt; - SIZE szAspectRatio; - DWORD dwMinBuffers; - DWORD dwMaxBuffers; - DWORD dwInterlaceFlags; - SIZE szNativeSize; - } VMRALLOCATIONINFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0382_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0382_v0_0_s_ifspec; - -#ifndef __IVMRSurfaceAllocator_INTERFACE_DEFINED__ -#define __IVMRSurfaceAllocator_INTERFACE_DEFINED__ - -/* interface IVMRSurfaceAllocator */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRSurfaceAllocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("31ce832e-4484-458b-8cca-f4d7e3db0b52") - IVMRSurfaceAllocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE AllocateSurface( - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRALLOCATIONINFO *lpAllocInfo, - /* [out][in] */ DWORD *lpdwActualBuffers, - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeSurface( - /* [in] */ DWORD_PTR dwID) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrepareSurface( - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ LPDIRECTDRAWSURFACE7 lpSurface, - /* [in] */ DWORD dwSurfaceFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE AdviseNotify( - /* [in] */ IVMRSurfaceAllocatorNotify *lpIVMRSurfAllocNotify) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRSurfaceAllocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRSurfaceAllocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRSurfaceAllocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRSurfaceAllocator * This); - - HRESULT ( STDMETHODCALLTYPE *AllocateSurface )( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRALLOCATIONINFO *lpAllocInfo, - /* [out][in] */ DWORD *lpdwActualBuffers, - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface); - - HRESULT ( STDMETHODCALLTYPE *FreeSurface )( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwID); - - HRESULT ( STDMETHODCALLTYPE *PrepareSurface )( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ LPDIRECTDRAWSURFACE7 lpSurface, - /* [in] */ DWORD dwSurfaceFlags); - - HRESULT ( STDMETHODCALLTYPE *AdviseNotify )( - IVMRSurfaceAllocator * This, - /* [in] */ IVMRSurfaceAllocatorNotify *lpIVMRSurfAllocNotify); - - END_INTERFACE - } IVMRSurfaceAllocatorVtbl; - - interface IVMRSurfaceAllocator - { - CONST_VTBL struct IVMRSurfaceAllocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRSurfaceAllocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRSurfaceAllocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRSurfaceAllocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRSurfaceAllocator_AllocateSurface(This,dwUserID,lpAllocInfo,lpdwActualBuffers,lplpSurface) \ - (This)->lpVtbl -> AllocateSurface(This,dwUserID,lpAllocInfo,lpdwActualBuffers,lplpSurface) - -#define IVMRSurfaceAllocator_FreeSurface(This,dwID) \ - (This)->lpVtbl -> FreeSurface(This,dwID) - -#define IVMRSurfaceAllocator_PrepareSurface(This,dwUserID,lpSurface,dwSurfaceFlags) \ - (This)->lpVtbl -> PrepareSurface(This,dwUserID,lpSurface,dwSurfaceFlags) - -#define IVMRSurfaceAllocator_AdviseNotify(This,lpIVMRSurfAllocNotify) \ - (This)->lpVtbl -> AdviseNotify(This,lpIVMRSurfAllocNotify) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocator_AllocateSurface_Proxy( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ VMRALLOCATIONINFO *lpAllocInfo, - /* [out][in] */ DWORD *lpdwActualBuffers, - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface); - - -void __RPC_STUB IVMRSurfaceAllocator_AllocateSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocator_FreeSurface_Proxy( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwID); - - -void __RPC_STUB IVMRSurfaceAllocator_FreeSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocator_PrepareSurface_Proxy( - IVMRSurfaceAllocator * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ LPDIRECTDRAWSURFACE7 lpSurface, - /* [in] */ DWORD dwSurfaceFlags); - - -void __RPC_STUB IVMRSurfaceAllocator_PrepareSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocator_AdviseNotify_Proxy( - IVMRSurfaceAllocator * This, - /* [in] */ IVMRSurfaceAllocatorNotify *lpIVMRSurfAllocNotify); - - -void __RPC_STUB IVMRSurfaceAllocator_AdviseNotify_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRSurfaceAllocator_INTERFACE_DEFINED__ */ - - -#ifndef __IVMRSurfaceAllocatorNotify_INTERFACE_DEFINED__ -#define __IVMRSurfaceAllocatorNotify_INTERFACE_DEFINED__ - -/* interface IVMRSurfaceAllocatorNotify */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRSurfaceAllocatorNotify; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("aada05a8-5a4e-4729-af0b-cea27aed51e2") - IVMRSurfaceAllocatorNotify : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE AdviseSurfaceAllocator( - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ IVMRSurfaceAllocator *lpIVRMSurfaceAllocator) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDDrawDevice( - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChangeDDrawDevice( - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor) = 0; - - virtual HRESULT STDMETHODCALLTYPE RestoreDDrawSurfaces( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE NotifyEvent( - /* [in] */ LONG EventCode, - /* [in] */ LONG_PTR Param1, - /* [in] */ LONG_PTR Param2) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBorderColor( - /* [in] */ COLORREF clrBorder) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRSurfaceAllocatorNotifyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRSurfaceAllocatorNotify * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRSurfaceAllocatorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *AdviseSurfaceAllocator )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ IVMRSurfaceAllocator *lpIVRMSurfaceAllocator); - - HRESULT ( STDMETHODCALLTYPE *SetDDrawDevice )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor); - - HRESULT ( STDMETHODCALLTYPE *ChangeDDrawDevice )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor); - - HRESULT ( STDMETHODCALLTYPE *RestoreDDrawSurfaces )( - IVMRSurfaceAllocatorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyEvent )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LONG EventCode, - /* [in] */ LONG_PTR Param1, - /* [in] */ LONG_PTR Param2); - - HRESULT ( STDMETHODCALLTYPE *SetBorderColor )( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ COLORREF clrBorder); - - END_INTERFACE - } IVMRSurfaceAllocatorNotifyVtbl; - - interface IVMRSurfaceAllocatorNotify - { - CONST_VTBL struct IVMRSurfaceAllocatorNotifyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRSurfaceAllocatorNotify_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRSurfaceAllocatorNotify_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRSurfaceAllocatorNotify_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator(This,dwUserID,lpIVRMSurfaceAllocator) \ - (This)->lpVtbl -> AdviseSurfaceAllocator(This,dwUserID,lpIVRMSurfaceAllocator) - -#define IVMRSurfaceAllocatorNotify_SetDDrawDevice(This,lpDDrawDevice,hMonitor) \ - (This)->lpVtbl -> SetDDrawDevice(This,lpDDrawDevice,hMonitor) - -#define IVMRSurfaceAllocatorNotify_ChangeDDrawDevice(This,lpDDrawDevice,hMonitor) \ - (This)->lpVtbl -> ChangeDDrawDevice(This,lpDDrawDevice,hMonitor) - -#define IVMRSurfaceAllocatorNotify_RestoreDDrawSurfaces(This) \ - (This)->lpVtbl -> RestoreDDrawSurfaces(This) - -#define IVMRSurfaceAllocatorNotify_NotifyEvent(This,EventCode,Param1,Param2) \ - (This)->lpVtbl -> NotifyEvent(This,EventCode,Param1,Param2) - -#define IVMRSurfaceAllocatorNotify_SetBorderColor(This,clrBorder) \ - (This)->lpVtbl -> SetBorderColor(This,clrBorder) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator_Proxy( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ DWORD_PTR dwUserID, - /* [in] */ IVMRSurfaceAllocator *lpIVRMSurfaceAllocator); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_SetDDrawDevice_Proxy( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_SetDDrawDevice_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_ChangeDDrawDevice_Proxy( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LPDIRECTDRAW7 lpDDrawDevice, - /* [in] */ HMONITOR hMonitor); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_ChangeDDrawDevice_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_RestoreDDrawSurfaces_Proxy( - IVMRSurfaceAllocatorNotify * This); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_RestoreDDrawSurfaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_NotifyEvent_Proxy( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ LONG EventCode, - /* [in] */ LONG_PTR Param1, - /* [in] */ LONG_PTR Param2); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_NotifyEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurfaceAllocatorNotify_SetBorderColor_Proxy( - IVMRSurfaceAllocatorNotify * This, - /* [in] */ COLORREF clrBorder); - - -void __RPC_STUB IVMRSurfaceAllocatorNotify_SetBorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRSurfaceAllocatorNotify_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0384 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0384_0001 - { VMR_ARMODE_NONE = 0, - VMR_ARMODE_LETTER_BOX = VMR_ARMODE_NONE + 1 - } VMR_ASPECT_RATIO_MODE; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0384_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0384_v0_0_s_ifspec; - -#ifndef __IVMRWindowlessControl_INTERFACE_DEFINED__ -#define __IVMRWindowlessControl_INTERFACE_DEFINED__ - -/* interface IVMRWindowlessControl */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRWindowlessControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0eb1088c-4dcd-46f0-878f-39dae86a51b7") - IVMRWindowlessControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetNativeVideoSize( - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight, - /* [out] */ LONG *lpARWidth, - /* [out] */ LONG *lpARHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMinIdealVideoSize( - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMaxIdealVideoSize( - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetVideoPosition( - /* [in] */ const LPRECT lpSRCRect, - /* [in] */ const LPRECT lpDSTRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVideoPosition( - /* [out] */ LPRECT lpSRCRect, - /* [out] */ LPRECT lpDSTRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAspectRatioMode( - /* [out] */ DWORD *lpAspectRatioMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetAspectRatioMode( - /* [in] */ DWORD AspectRatioMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetVideoClippingWindow( - /* [in] */ HWND hwnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE RepaintVideo( - /* [in] */ HWND hwnd, - /* [in] */ HDC hdc) = 0; - - virtual HRESULT STDMETHODCALLTYPE DisplayModeChanged( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentImage( - /* [out] */ BYTE **lpDib) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBorderColor( - /* [in] */ COLORREF Clr) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBorderColor( - /* [out] */ COLORREF *lpClr) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetColorKey( - /* [in] */ COLORREF Clr) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetColorKey( - /* [out] */ COLORREF *lpClr) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRWindowlessControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRWindowlessControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRWindowlessControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRWindowlessControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetNativeVideoSize )( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight, - /* [out] */ LONG *lpARWidth, - /* [out] */ LONG *lpARHeight); - - HRESULT ( STDMETHODCALLTYPE *GetMinIdealVideoSize )( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight); - - HRESULT ( STDMETHODCALLTYPE *GetMaxIdealVideoSize )( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight); - - HRESULT ( STDMETHODCALLTYPE *SetVideoPosition )( - IVMRWindowlessControl * This, - /* [in] */ const LPRECT lpSRCRect, - /* [in] */ const LPRECT lpDSTRect); - - HRESULT ( STDMETHODCALLTYPE *GetVideoPosition )( - IVMRWindowlessControl * This, - /* [out] */ LPRECT lpSRCRect, - /* [out] */ LPRECT lpDSTRect); - - HRESULT ( STDMETHODCALLTYPE *GetAspectRatioMode )( - IVMRWindowlessControl * This, - /* [out] */ DWORD *lpAspectRatioMode); - - HRESULT ( STDMETHODCALLTYPE *SetAspectRatioMode )( - IVMRWindowlessControl * This, - /* [in] */ DWORD AspectRatioMode); - - HRESULT ( STDMETHODCALLTYPE *SetVideoClippingWindow )( - IVMRWindowlessControl * This, - /* [in] */ HWND hwnd); - - HRESULT ( STDMETHODCALLTYPE *RepaintVideo )( - IVMRWindowlessControl * This, - /* [in] */ HWND hwnd, - /* [in] */ HDC hdc); - - HRESULT ( STDMETHODCALLTYPE *DisplayModeChanged )( - IVMRWindowlessControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentImage )( - IVMRWindowlessControl * This, - /* [out] */ BYTE **lpDib); - - HRESULT ( STDMETHODCALLTYPE *SetBorderColor )( - IVMRWindowlessControl * This, - /* [in] */ COLORREF Clr); - - HRESULT ( STDMETHODCALLTYPE *GetBorderColor )( - IVMRWindowlessControl * This, - /* [out] */ COLORREF *lpClr); - - HRESULT ( STDMETHODCALLTYPE *SetColorKey )( - IVMRWindowlessControl * This, - /* [in] */ COLORREF Clr); - - HRESULT ( STDMETHODCALLTYPE *GetColorKey )( - IVMRWindowlessControl * This, - /* [out] */ COLORREF *lpClr); - - END_INTERFACE - } IVMRWindowlessControlVtbl; - - interface IVMRWindowlessControl - { - CONST_VTBL struct IVMRWindowlessControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRWindowlessControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRWindowlessControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRWindowlessControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRWindowlessControl_GetNativeVideoSize(This,lpWidth,lpHeight,lpARWidth,lpARHeight) \ - (This)->lpVtbl -> GetNativeVideoSize(This,lpWidth,lpHeight,lpARWidth,lpARHeight) - -#define IVMRWindowlessControl_GetMinIdealVideoSize(This,lpWidth,lpHeight) \ - (This)->lpVtbl -> GetMinIdealVideoSize(This,lpWidth,lpHeight) - -#define IVMRWindowlessControl_GetMaxIdealVideoSize(This,lpWidth,lpHeight) \ - (This)->lpVtbl -> GetMaxIdealVideoSize(This,lpWidth,lpHeight) - -#define IVMRWindowlessControl_SetVideoPosition(This,lpSRCRect,lpDSTRect) \ - (This)->lpVtbl -> SetVideoPosition(This,lpSRCRect,lpDSTRect) - -#define IVMRWindowlessControl_GetVideoPosition(This,lpSRCRect,lpDSTRect) \ - (This)->lpVtbl -> GetVideoPosition(This,lpSRCRect,lpDSTRect) - -#define IVMRWindowlessControl_GetAspectRatioMode(This,lpAspectRatioMode) \ - (This)->lpVtbl -> GetAspectRatioMode(This,lpAspectRatioMode) - -#define IVMRWindowlessControl_SetAspectRatioMode(This,AspectRatioMode) \ - (This)->lpVtbl -> SetAspectRatioMode(This,AspectRatioMode) - -#define IVMRWindowlessControl_SetVideoClippingWindow(This,hwnd) \ - (This)->lpVtbl -> SetVideoClippingWindow(This,hwnd) - -#define IVMRWindowlessControl_RepaintVideo(This,hwnd,hdc) \ - (This)->lpVtbl -> RepaintVideo(This,hwnd,hdc) - -#define IVMRWindowlessControl_DisplayModeChanged(This) \ - (This)->lpVtbl -> DisplayModeChanged(This) - -#define IVMRWindowlessControl_GetCurrentImage(This,lpDib) \ - (This)->lpVtbl -> GetCurrentImage(This,lpDib) - -#define IVMRWindowlessControl_SetBorderColor(This,Clr) \ - (This)->lpVtbl -> SetBorderColor(This,Clr) - -#define IVMRWindowlessControl_GetBorderColor(This,lpClr) \ - (This)->lpVtbl -> GetBorderColor(This,lpClr) - -#define IVMRWindowlessControl_SetColorKey(This,Clr) \ - (This)->lpVtbl -> SetColorKey(This,Clr) - -#define IVMRWindowlessControl_GetColorKey(This,lpClr) \ - (This)->lpVtbl -> GetColorKey(This,lpClr) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetNativeVideoSize_Proxy( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight, - /* [out] */ LONG *lpARWidth, - /* [out] */ LONG *lpARHeight); - - -void __RPC_STUB IVMRWindowlessControl_GetNativeVideoSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetMinIdealVideoSize_Proxy( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight); - - -void __RPC_STUB IVMRWindowlessControl_GetMinIdealVideoSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetMaxIdealVideoSize_Proxy( - IVMRWindowlessControl * This, - /* [out] */ LONG *lpWidth, - /* [out] */ LONG *lpHeight); - - -void __RPC_STUB IVMRWindowlessControl_GetMaxIdealVideoSize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_SetVideoPosition_Proxy( - IVMRWindowlessControl * This, - /* [in] */ const LPRECT lpSRCRect, - /* [in] */ const LPRECT lpDSTRect); - - -void __RPC_STUB IVMRWindowlessControl_SetVideoPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetVideoPosition_Proxy( - IVMRWindowlessControl * This, - /* [out] */ LPRECT lpSRCRect, - /* [out] */ LPRECT lpDSTRect); - - -void __RPC_STUB IVMRWindowlessControl_GetVideoPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetAspectRatioMode_Proxy( - IVMRWindowlessControl * This, - /* [out] */ DWORD *lpAspectRatioMode); - - -void __RPC_STUB IVMRWindowlessControl_GetAspectRatioMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_SetAspectRatioMode_Proxy( - IVMRWindowlessControl * This, - /* [in] */ DWORD AspectRatioMode); - - -void __RPC_STUB IVMRWindowlessControl_SetAspectRatioMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_SetVideoClippingWindow_Proxy( - IVMRWindowlessControl * This, - /* [in] */ HWND hwnd); - - -void __RPC_STUB IVMRWindowlessControl_SetVideoClippingWindow_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_RepaintVideo_Proxy( - IVMRWindowlessControl * This, - /* [in] */ HWND hwnd, - /* [in] */ HDC hdc); - - -void __RPC_STUB IVMRWindowlessControl_RepaintVideo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_DisplayModeChanged_Proxy( - IVMRWindowlessControl * This); - - -void __RPC_STUB IVMRWindowlessControl_DisplayModeChanged_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetCurrentImage_Proxy( - IVMRWindowlessControl * This, - /* [out] */ BYTE **lpDib); - - -void __RPC_STUB IVMRWindowlessControl_GetCurrentImage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_SetBorderColor_Proxy( - IVMRWindowlessControl * This, - /* [in] */ COLORREF Clr); - - -void __RPC_STUB IVMRWindowlessControl_SetBorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetBorderColor_Proxy( - IVMRWindowlessControl * This, - /* [out] */ COLORREF *lpClr); - - -void __RPC_STUB IVMRWindowlessControl_GetBorderColor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_SetColorKey_Proxy( - IVMRWindowlessControl * This, - /* [in] */ COLORREF Clr); - - -void __RPC_STUB IVMRWindowlessControl_SetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRWindowlessControl_GetColorKey_Proxy( - IVMRWindowlessControl * This, - /* [out] */ COLORREF *lpClr); - - -void __RPC_STUB IVMRWindowlessControl_GetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRWindowlessControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0385 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0385_0001 - { MixerPref_NoDecimation = 0x1, - MixerPref_DecimateOutput = 0x2, - MixerPref_DecimateMask = 0xf, - MixerPref_BiLinearFiltering = 0x10, - MixerPref_PointFiltering = 0x20, - MixerPref_FilteringMask = 0xf0, - MixerPref_RenderTargetRGB = 0x100, - MixerPref_RenderTargetYUV420 = 0x200, - MixerPref_RenderTargetYUV422 = 0x400, - MixerPref_RenderTargetYUV444 = 0x800, - MixerPref_RenderTargetReserved = 0xf000, - MixerPref_RenderTargetMask = 0xff00 - } VMRMixerPrefs; - -typedef struct _NORMALIZEDRECT - { - float left; - float top; - float right; - float bottom; - } NORMALIZEDRECT; - -typedef struct _NORMALIZEDRECT *PNORMALIZEDRECT; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0385_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0385_v0_0_s_ifspec; - -#ifndef __IVMRMixerControl_INTERFACE_DEFINED__ -#define __IVMRMixerControl_INTERFACE_DEFINED__ - -/* interface IVMRMixerControl */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRMixerControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1c1a17b0-bed0-415d-974b-dc6696131599") - IVMRMixerControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetAlpha( - /* [in] */ DWORD dwStreamID, - /* [in] */ float Alpha) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAlpha( - /* [in] */ DWORD dwStreamID, - /* [out] */ float *pAlpha) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetZOrder( - /* [in] */ DWORD dwStreamID, - /* [in] */ DWORD dwZ) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetZOrder( - /* [in] */ DWORD dwStreamID, - /* [out] */ DWORD *pZ) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetOutputRect( - /* [in] */ DWORD dwStreamID, - /* [in] */ const NORMALIZEDRECT *pRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetOutputRect( - /* [in] */ DWORD dwStreamID, - /* [out] */ NORMALIZEDRECT *pRect) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBackgroundClr( - /* [in] */ COLORREF ClrBkg) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBackgroundClr( - /* [in] */ COLORREF *lpClrBkg) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMixingPrefs( - /* [in] */ DWORD dwMixerPrefs) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMixingPrefs( - /* [out] */ DWORD *pdwMixerPrefs) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRMixerControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRMixerControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRMixerControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRMixerControl * This); - - HRESULT ( STDMETHODCALLTYPE *SetAlpha )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ float Alpha); - - HRESULT ( STDMETHODCALLTYPE *GetAlpha )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ float *pAlpha); - - HRESULT ( STDMETHODCALLTYPE *SetZOrder )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ DWORD dwZ); - - HRESULT ( STDMETHODCALLTYPE *GetZOrder )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ DWORD *pZ); - - HRESULT ( STDMETHODCALLTYPE *SetOutputRect )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ const NORMALIZEDRECT *pRect); - - HRESULT ( STDMETHODCALLTYPE *GetOutputRect )( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ NORMALIZEDRECT *pRect); - - HRESULT ( STDMETHODCALLTYPE *SetBackgroundClr )( - IVMRMixerControl * This, - /* [in] */ COLORREF ClrBkg); - - HRESULT ( STDMETHODCALLTYPE *GetBackgroundClr )( - IVMRMixerControl * This, - /* [in] */ COLORREF *lpClrBkg); - - HRESULT ( STDMETHODCALLTYPE *SetMixingPrefs )( - IVMRMixerControl * This, - /* [in] */ DWORD dwMixerPrefs); - - HRESULT ( STDMETHODCALLTYPE *GetMixingPrefs )( - IVMRMixerControl * This, - /* [out] */ DWORD *pdwMixerPrefs); - - END_INTERFACE - } IVMRMixerControlVtbl; - - interface IVMRMixerControl - { - CONST_VTBL struct IVMRMixerControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRMixerControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRMixerControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRMixerControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRMixerControl_SetAlpha(This,dwStreamID,Alpha) \ - (This)->lpVtbl -> SetAlpha(This,dwStreamID,Alpha) - -#define IVMRMixerControl_GetAlpha(This,dwStreamID,pAlpha) \ - (This)->lpVtbl -> GetAlpha(This,dwStreamID,pAlpha) - -#define IVMRMixerControl_SetZOrder(This,dwStreamID,dwZ) \ - (This)->lpVtbl -> SetZOrder(This,dwStreamID,dwZ) - -#define IVMRMixerControl_GetZOrder(This,dwStreamID,pZ) \ - (This)->lpVtbl -> GetZOrder(This,dwStreamID,pZ) - -#define IVMRMixerControl_SetOutputRect(This,dwStreamID,pRect) \ - (This)->lpVtbl -> SetOutputRect(This,dwStreamID,pRect) - -#define IVMRMixerControl_GetOutputRect(This,dwStreamID,pRect) \ - (This)->lpVtbl -> GetOutputRect(This,dwStreamID,pRect) - -#define IVMRMixerControl_SetBackgroundClr(This,ClrBkg) \ - (This)->lpVtbl -> SetBackgroundClr(This,ClrBkg) - -#define IVMRMixerControl_GetBackgroundClr(This,lpClrBkg) \ - (This)->lpVtbl -> GetBackgroundClr(This,lpClrBkg) - -#define IVMRMixerControl_SetMixingPrefs(This,dwMixerPrefs) \ - (This)->lpVtbl -> SetMixingPrefs(This,dwMixerPrefs) - -#define IVMRMixerControl_GetMixingPrefs(This,pdwMixerPrefs) \ - (This)->lpVtbl -> GetMixingPrefs(This,pdwMixerPrefs) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_SetAlpha_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ float Alpha); - - -void __RPC_STUB IVMRMixerControl_SetAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_GetAlpha_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ float *pAlpha); - - -void __RPC_STUB IVMRMixerControl_GetAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_SetZOrder_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ DWORD dwZ); - - -void __RPC_STUB IVMRMixerControl_SetZOrder_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_GetZOrder_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ DWORD *pZ); - - -void __RPC_STUB IVMRMixerControl_GetZOrder_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_SetOutputRect_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [in] */ const NORMALIZEDRECT *pRect); - - -void __RPC_STUB IVMRMixerControl_SetOutputRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_GetOutputRect_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwStreamID, - /* [out] */ NORMALIZEDRECT *pRect); - - -void __RPC_STUB IVMRMixerControl_GetOutputRect_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_SetBackgroundClr_Proxy( - IVMRMixerControl * This, - /* [in] */ COLORREF ClrBkg); - - -void __RPC_STUB IVMRMixerControl_SetBackgroundClr_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_GetBackgroundClr_Proxy( - IVMRMixerControl * This, - /* [in] */ COLORREF *lpClrBkg); - - -void __RPC_STUB IVMRMixerControl_GetBackgroundClr_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_SetMixingPrefs_Proxy( - IVMRMixerControl * This, - /* [in] */ DWORD dwMixerPrefs); - - -void __RPC_STUB IVMRMixerControl_SetMixingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerControl_GetMixingPrefs_Proxy( - IVMRMixerControl * This, - /* [out] */ DWORD *pdwMixerPrefs); - - -void __RPC_STUB IVMRMixerControl_GetMixingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRMixerControl_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0386 */ -/* [local] */ - -typedef struct tagVMRGUID - { - GUID *pGUID; - GUID GUID; - } VMRGUID; - -typedef struct tagVMRMONITORINFO - { - VMRGUID guid; - RECT rcMonitor; - HMONITOR hMon; - DWORD dwFlags; - wchar_t szDevice[ 32 ]; - wchar_t szDescription[ 256 ]; - LARGE_INTEGER liDriverVersion; - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - } VMRMONITORINFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0386_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0386_v0_0_s_ifspec; - -#ifndef __IVMRMonitorConfig_INTERFACE_DEFINED__ -#define __IVMRMonitorConfig_INTERFACE_DEFINED__ - -/* interface IVMRMonitorConfig */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IVMRMonitorConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce") - IVMRMonitorConfig : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetMonitor( - /* [in] */ const VMRGUID *pGUID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetMonitor( - /* [out] */ VMRGUID *pGUID) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultMonitor( - /* [in] */ const VMRGUID *pGUID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultMonitor( - /* [out] */ VMRGUID *pGUID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAvailableMonitors( - /* [size_is][out] */ VMRMONITORINFO *pInfo, - /* [in] */ DWORD dwMaxInfoArraySize, - /* [out] */ DWORD *pdwNumDevices) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRMonitorConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRMonitorConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRMonitorConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRMonitorConfig * This); - - HRESULT ( STDMETHODCALLTYPE *SetMonitor )( - IVMRMonitorConfig * This, - /* [in] */ const VMRGUID *pGUID); - - HRESULT ( STDMETHODCALLTYPE *GetMonitor )( - IVMRMonitorConfig * This, - /* [out] */ VMRGUID *pGUID); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultMonitor )( - IVMRMonitorConfig * This, - /* [in] */ const VMRGUID *pGUID); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultMonitor )( - IVMRMonitorConfig * This, - /* [out] */ VMRGUID *pGUID); - - HRESULT ( STDMETHODCALLTYPE *GetAvailableMonitors )( - IVMRMonitorConfig * This, - /* [size_is][out] */ VMRMONITORINFO *pInfo, - /* [in] */ DWORD dwMaxInfoArraySize, - /* [out] */ DWORD *pdwNumDevices); - - END_INTERFACE - } IVMRMonitorConfigVtbl; - - interface IVMRMonitorConfig - { - CONST_VTBL struct IVMRMonitorConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRMonitorConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRMonitorConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRMonitorConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRMonitorConfig_SetMonitor(This,pGUID) \ - (This)->lpVtbl -> SetMonitor(This,pGUID) - -#define IVMRMonitorConfig_GetMonitor(This,pGUID) \ - (This)->lpVtbl -> GetMonitor(This,pGUID) - -#define IVMRMonitorConfig_SetDefaultMonitor(This,pGUID) \ - (This)->lpVtbl -> SetDefaultMonitor(This,pGUID) - -#define IVMRMonitorConfig_GetDefaultMonitor(This,pGUID) \ - (This)->lpVtbl -> GetDefaultMonitor(This,pGUID) - -#define IVMRMonitorConfig_GetAvailableMonitors(This,pInfo,dwMaxInfoArraySize,pdwNumDevices) \ - (This)->lpVtbl -> GetAvailableMonitors(This,pInfo,dwMaxInfoArraySize,pdwNumDevices) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRMonitorConfig_SetMonitor_Proxy( - IVMRMonitorConfig * This, - /* [in] */ const VMRGUID *pGUID); - - -void __RPC_STUB IVMRMonitorConfig_SetMonitor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMonitorConfig_GetMonitor_Proxy( - IVMRMonitorConfig * This, - /* [out] */ VMRGUID *pGUID); - - -void __RPC_STUB IVMRMonitorConfig_GetMonitor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMonitorConfig_SetDefaultMonitor_Proxy( - IVMRMonitorConfig * This, - /* [in] */ const VMRGUID *pGUID); - - -void __RPC_STUB IVMRMonitorConfig_SetDefaultMonitor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMonitorConfig_GetDefaultMonitor_Proxy( - IVMRMonitorConfig * This, - /* [out] */ VMRGUID *pGUID); - - -void __RPC_STUB IVMRMonitorConfig_GetDefaultMonitor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMonitorConfig_GetAvailableMonitors_Proxy( - IVMRMonitorConfig * This, - /* [size_is][out] */ VMRMONITORINFO *pInfo, - /* [in] */ DWORD dwMaxInfoArraySize, - /* [out] */ DWORD *pdwNumDevices); - - -void __RPC_STUB IVMRMonitorConfig_GetAvailableMonitors_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRMonitorConfig_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0387 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0387_0001 - { RenderPrefs_ForceOffscreen = 0x1, - RenderPrefs_ForceOverlays = 0x2, - RenderPrefs_AllowOverlays = 0, - RenderPrefs_AllowOffscreen = 0, - RenderPrefs_DoNotRenderColorKeyAndBorder = 0x8, - RenderPrefs_RestrictToInitialMonitor = 0x10, - RenderPrefs_PreferAGPMemWhenMixing = 0x20, - RenderPrefs_Mask = 0x3f - } VMRRenderPrefs; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_strmif_0387_0002 - { VMRMode_Windowed = 0x1, - VMRMode_Windowless = 0x2, - VMRMode_Renderless = 0x4, - VMRMode_Mask = 0x7 - } VMRMode; - - -enum __MIDL___MIDL_itf_strmif_0387_0003 - { MAX_NUMBER_OF_STREAMS = 16 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0387_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0387_v0_0_s_ifspec; - -#ifndef __IVMRFilterConfig_INTERFACE_DEFINED__ -#define __IVMRFilterConfig_INTERFACE_DEFINED__ - -/* interface IVMRFilterConfig */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IVMRFilterConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9e5530c5-7034-48b4-bb46-0b8a6efc8e36") - IVMRFilterConfig : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetImageCompositor( - /* [in] */ IVMRImageCompositor *lpVMRImgCompositor) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetNumberOfStreams( - /* [in] */ DWORD dwMaxStreams) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNumberOfStreams( - /* [out] */ DWORD *pdwMaxStreams) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderingPrefs( - /* [in] */ DWORD dwRenderFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRenderingPrefs( - /* [out] */ DWORD *pdwRenderFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderingMode( - /* [in] */ DWORD Mode) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRenderingMode( - /* [out] */ DWORD *pMode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRFilterConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRFilterConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRFilterConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRFilterConfig * This); - - HRESULT ( STDMETHODCALLTYPE *SetImageCompositor )( - IVMRFilterConfig * This, - /* [in] */ IVMRImageCompositor *lpVMRImgCompositor); - - HRESULT ( STDMETHODCALLTYPE *SetNumberOfStreams )( - IVMRFilterConfig * This, - /* [in] */ DWORD dwMaxStreams); - - HRESULT ( STDMETHODCALLTYPE *GetNumberOfStreams )( - IVMRFilterConfig * This, - /* [out] */ DWORD *pdwMaxStreams); - - HRESULT ( STDMETHODCALLTYPE *SetRenderingPrefs )( - IVMRFilterConfig * This, - /* [in] */ DWORD dwRenderFlags); - - HRESULT ( STDMETHODCALLTYPE *GetRenderingPrefs )( - IVMRFilterConfig * This, - /* [out] */ DWORD *pdwRenderFlags); - - HRESULT ( STDMETHODCALLTYPE *SetRenderingMode )( - IVMRFilterConfig * This, - /* [in] */ DWORD Mode); - - HRESULT ( STDMETHODCALLTYPE *GetRenderingMode )( - IVMRFilterConfig * This, - /* [out] */ DWORD *pMode); - - END_INTERFACE - } IVMRFilterConfigVtbl; - - interface IVMRFilterConfig - { - CONST_VTBL struct IVMRFilterConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRFilterConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRFilterConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRFilterConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRFilterConfig_SetImageCompositor(This,lpVMRImgCompositor) \ - (This)->lpVtbl -> SetImageCompositor(This,lpVMRImgCompositor) - -#define IVMRFilterConfig_SetNumberOfStreams(This,dwMaxStreams) \ - (This)->lpVtbl -> SetNumberOfStreams(This,dwMaxStreams) - -#define IVMRFilterConfig_GetNumberOfStreams(This,pdwMaxStreams) \ - (This)->lpVtbl -> GetNumberOfStreams(This,pdwMaxStreams) - -#define IVMRFilterConfig_SetRenderingPrefs(This,dwRenderFlags) \ - (This)->lpVtbl -> SetRenderingPrefs(This,dwRenderFlags) - -#define IVMRFilterConfig_GetRenderingPrefs(This,pdwRenderFlags) \ - (This)->lpVtbl -> GetRenderingPrefs(This,pdwRenderFlags) - -#define IVMRFilterConfig_SetRenderingMode(This,Mode) \ - (This)->lpVtbl -> SetRenderingMode(This,Mode) - -#define IVMRFilterConfig_GetRenderingMode(This,pMode) \ - (This)->lpVtbl -> GetRenderingMode(This,pMode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_SetImageCompositor_Proxy( - IVMRFilterConfig * This, - /* [in] */ IVMRImageCompositor *lpVMRImgCompositor); - - -void __RPC_STUB IVMRFilterConfig_SetImageCompositor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_SetNumberOfStreams_Proxy( - IVMRFilterConfig * This, - /* [in] */ DWORD dwMaxStreams); - - -void __RPC_STUB IVMRFilterConfig_SetNumberOfStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_GetNumberOfStreams_Proxy( - IVMRFilterConfig * This, - /* [out] */ DWORD *pdwMaxStreams); - - -void __RPC_STUB IVMRFilterConfig_GetNumberOfStreams_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_SetRenderingPrefs_Proxy( - IVMRFilterConfig * This, - /* [in] */ DWORD dwRenderFlags); - - -void __RPC_STUB IVMRFilterConfig_SetRenderingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_GetRenderingPrefs_Proxy( - IVMRFilterConfig * This, - /* [out] */ DWORD *pdwRenderFlags); - - -void __RPC_STUB IVMRFilterConfig_GetRenderingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_SetRenderingMode_Proxy( - IVMRFilterConfig * This, - /* [in] */ DWORD Mode); - - -void __RPC_STUB IVMRFilterConfig_SetRenderingMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRFilterConfig_GetRenderingMode_Proxy( - IVMRFilterConfig * This, - /* [out] */ DWORD *pMode); - - -void __RPC_STUB IVMRFilterConfig_GetRenderingMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRFilterConfig_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0388 */ -/* [local] */ - -typedef struct _VMRALPHABITMAP - { - DWORD dwFlags; - HDC hdc; - LPDIRECTDRAWSURFACE7 pDDS; - RECT rSrc; - NORMALIZEDRECT rDest; - FLOAT fAlpha; - COLORREF clrSrcKey; - } VMRALPHABITMAP; - -typedef struct _VMRALPHABITMAP *PVMRALPHABITMAP; - -#define VMRBITMAP_DISABLE 0x00000001 -#define VMRBITMAP_HDC 0x00000002 -#define VMRBITMAP_ENTIREDDS 0x00000004 -#define VMRBITMAP_SRCCOLORKEY 0x00000008 -#define VMRBITMAP_SRCRECT 0x00000010 - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0388_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0388_v0_0_s_ifspec; - -#ifndef __IVMRMixerBitmap_INTERFACE_DEFINED__ -#define __IVMRMixerBitmap_INTERFACE_DEFINED__ - -/* interface IVMRMixerBitmap */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IVMRMixerBitmap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1E673275-0257-40aa-AF20-7C608D4A0428") - IVMRMixerBitmap : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetAlphaBitmap( - /* [in] */ const VMRALPHABITMAP *pBmpParms) = 0; - - virtual HRESULT STDMETHODCALLTYPE UpdateAlphaBitmapParameters( - /* [in] */ PVMRALPHABITMAP pBmpParms) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAlphaBitmapParameters( - /* [out] */ PVMRALPHABITMAP pBmpParms) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRMixerBitmapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRMixerBitmap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRMixerBitmap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRMixerBitmap * This); - - HRESULT ( STDMETHODCALLTYPE *SetAlphaBitmap )( - IVMRMixerBitmap * This, - /* [in] */ const VMRALPHABITMAP *pBmpParms); - - HRESULT ( STDMETHODCALLTYPE *UpdateAlphaBitmapParameters )( - IVMRMixerBitmap * This, - /* [in] */ PVMRALPHABITMAP pBmpParms); - - HRESULT ( STDMETHODCALLTYPE *GetAlphaBitmapParameters )( - IVMRMixerBitmap * This, - /* [out] */ PVMRALPHABITMAP pBmpParms); - - END_INTERFACE - } IVMRMixerBitmapVtbl; - - interface IVMRMixerBitmap - { - CONST_VTBL struct IVMRMixerBitmapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRMixerBitmap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRMixerBitmap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRMixerBitmap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRMixerBitmap_SetAlphaBitmap(This,pBmpParms) \ - (This)->lpVtbl -> SetAlphaBitmap(This,pBmpParms) - -#define IVMRMixerBitmap_UpdateAlphaBitmapParameters(This,pBmpParms) \ - (This)->lpVtbl -> UpdateAlphaBitmapParameters(This,pBmpParms) - -#define IVMRMixerBitmap_GetAlphaBitmapParameters(This,pBmpParms) \ - (This)->lpVtbl -> GetAlphaBitmapParameters(This,pBmpParms) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRMixerBitmap_SetAlphaBitmap_Proxy( - IVMRMixerBitmap * This, - /* [in] */ const VMRALPHABITMAP *pBmpParms); - - -void __RPC_STUB IVMRMixerBitmap_SetAlphaBitmap_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerBitmap_UpdateAlphaBitmapParameters_Proxy( - IVMRMixerBitmap * This, - /* [in] */ PVMRALPHABITMAP pBmpParms); - - -void __RPC_STUB IVMRMixerBitmap_UpdateAlphaBitmapParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRMixerBitmap_GetAlphaBitmapParameters_Proxy( - IVMRMixerBitmap * This, - /* [out] */ PVMRALPHABITMAP pBmpParms); - - -void __RPC_STUB IVMRMixerBitmap_GetAlphaBitmapParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRMixerBitmap_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_strmif_0389 */ -/* [local] */ - -typedef struct _VMRVIDEOSTREAMINFO - { - LPDIRECTDRAWSURFACE7 pddsVideoSurface; - DWORD dwWidth; - DWORD dwHeight; - DWORD dwStrmID; - FLOAT fAlpha; - DDCOLORKEY ddClrKey; - NORMALIZEDRECT rNormal; - } VMRVIDEOSTREAMINFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_strmif_0389_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_strmif_0389_v0_0_s_ifspec; - -#ifndef __IVMRImageCompositor_INTERFACE_DEFINED__ -#define __IVMRImageCompositor_INTERFACE_DEFINED__ - -/* interface IVMRImageCompositor */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRImageCompositor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7a4fb5af-479f-4074-bb40-ce6722e43c82") - IVMRImageCompositor : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InitCompositionTarget( - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget) = 0; - - virtual HRESULT STDMETHODCALLTYPE TermCompositionTarget( - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStreamMediaType( - /* [in] */ DWORD dwStrmID, - /* [in] */ AM_MEDIA_TYPE *pmt, - /* [in] */ BOOL fTexture) = 0; - - virtual HRESULT STDMETHODCALLTYPE CompositeImage( - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget, - /* [in] */ AM_MEDIA_TYPE *pmtRenderTarget, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtEnd, - /* [in] */ DWORD dwClrBkGnd, - /* [in] */ VMRVIDEOSTREAMINFO *pVideoStreamInfo, - /* [in] */ UINT cStreams) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRImageCompositorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRImageCompositor * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRImageCompositor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRImageCompositor * This); - - HRESULT ( STDMETHODCALLTYPE *InitCompositionTarget )( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget); - - HRESULT ( STDMETHODCALLTYPE *TermCompositionTarget )( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget); - - HRESULT ( STDMETHODCALLTYPE *SetStreamMediaType )( - IVMRImageCompositor * This, - /* [in] */ DWORD dwStrmID, - /* [in] */ AM_MEDIA_TYPE *pmt, - /* [in] */ BOOL fTexture); - - HRESULT ( STDMETHODCALLTYPE *CompositeImage )( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget, - /* [in] */ AM_MEDIA_TYPE *pmtRenderTarget, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtEnd, - /* [in] */ DWORD dwClrBkGnd, - /* [in] */ VMRVIDEOSTREAMINFO *pVideoStreamInfo, - /* [in] */ UINT cStreams); - - END_INTERFACE - } IVMRImageCompositorVtbl; - - interface IVMRImageCompositor - { - CONST_VTBL struct IVMRImageCompositorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRImageCompositor_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRImageCompositor_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRImageCompositor_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRImageCompositor_InitCompositionTarget(This,pD3DDevice,pddsRenderTarget) \ - (This)->lpVtbl -> InitCompositionTarget(This,pD3DDevice,pddsRenderTarget) - -#define IVMRImageCompositor_TermCompositionTarget(This,pD3DDevice,pddsRenderTarget) \ - (This)->lpVtbl -> TermCompositionTarget(This,pD3DDevice,pddsRenderTarget) - -#define IVMRImageCompositor_SetStreamMediaType(This,dwStrmID,pmt,fTexture) \ - (This)->lpVtbl -> SetStreamMediaType(This,dwStrmID,pmt,fTexture) - -#define IVMRImageCompositor_CompositeImage(This,pD3DDevice,pddsRenderTarget,pmtRenderTarget,rtStart,rtEnd,dwClrBkGnd,pVideoStreamInfo,cStreams) \ - (This)->lpVtbl -> CompositeImage(This,pD3DDevice,pddsRenderTarget,pmtRenderTarget,rtStart,rtEnd,dwClrBkGnd,pVideoStreamInfo,cStreams) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRImageCompositor_InitCompositionTarget_Proxy( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget); - - -void __RPC_STUB IVMRImageCompositor_InitCompositionTarget_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImageCompositor_TermCompositionTarget_Proxy( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget); - - -void __RPC_STUB IVMRImageCompositor_TermCompositionTarget_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImageCompositor_SetStreamMediaType_Proxy( - IVMRImageCompositor * This, - /* [in] */ DWORD dwStrmID, - /* [in] */ AM_MEDIA_TYPE *pmt, - /* [in] */ BOOL fTexture); - - -void __RPC_STUB IVMRImageCompositor_SetStreamMediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImageCompositor_CompositeImage_Proxy( - IVMRImageCompositor * This, - /* [in] */ IUnknown *pD3DDevice, - /* [in] */ LPDIRECTDRAWSURFACE7 pddsRenderTarget, - /* [in] */ AM_MEDIA_TYPE *pmtRenderTarget, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtEnd, - /* [in] */ DWORD dwClrBkGnd, - /* [in] */ VMRVIDEOSTREAMINFO *pVideoStreamInfo, - /* [in] */ UINT cStreams); - - -void __RPC_STUB IVMRImageCompositor_CompositeImage_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRImageCompositor_INTERFACE_DEFINED__ */ - - -#ifndef __IVMRVideoStreamControl_INTERFACE_DEFINED__ -#define __IVMRVideoStreamControl_INTERFACE_DEFINED__ - -/* interface IVMRVideoStreamControl */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IVMRVideoStreamControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("058d1f11-2a54-4bef-bd54-df706626b727") - IVMRVideoStreamControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetColorKey( - /* [in] */ LPDDCOLORKEY lpClrKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetColorKey( - /* [out] */ LPDDCOLORKEY lpClrKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStreamActiveState( - /* [in] */ BOOL fActive) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStreamActiveState( - /* [out] */ BOOL *lpfActive) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRVideoStreamControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRVideoStreamControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRVideoStreamControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRVideoStreamControl * This); - - HRESULT ( STDMETHODCALLTYPE *SetColorKey )( - IVMRVideoStreamControl * This, - /* [in] */ LPDDCOLORKEY lpClrKey); - - HRESULT ( STDMETHODCALLTYPE *GetColorKey )( - IVMRVideoStreamControl * This, - /* [out] */ LPDDCOLORKEY lpClrKey); - - HRESULT ( STDMETHODCALLTYPE *SetStreamActiveState )( - IVMRVideoStreamControl * This, - /* [in] */ BOOL fActive); - - HRESULT ( STDMETHODCALLTYPE *GetStreamActiveState )( - IVMRVideoStreamControl * This, - /* [out] */ BOOL *lpfActive); - - END_INTERFACE - } IVMRVideoStreamControlVtbl; - - interface IVMRVideoStreamControl - { - CONST_VTBL struct IVMRVideoStreamControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRVideoStreamControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRVideoStreamControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRVideoStreamControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRVideoStreamControl_SetColorKey(This,lpClrKey) \ - (This)->lpVtbl -> SetColorKey(This,lpClrKey) - -#define IVMRVideoStreamControl_GetColorKey(This,lpClrKey) \ - (This)->lpVtbl -> GetColorKey(This,lpClrKey) - -#define IVMRVideoStreamControl_SetStreamActiveState(This,fActive) \ - (This)->lpVtbl -> SetStreamActiveState(This,fActive) - -#define IVMRVideoStreamControl_GetStreamActiveState(This,lpfActive) \ - (This)->lpVtbl -> GetStreamActiveState(This,lpfActive) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRVideoStreamControl_SetColorKey_Proxy( - IVMRVideoStreamControl * This, - /* [in] */ LPDDCOLORKEY lpClrKey); - - -void __RPC_STUB IVMRVideoStreamControl_SetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRVideoStreamControl_GetColorKey_Proxy( - IVMRVideoStreamControl * This, - /* [out] */ LPDDCOLORKEY lpClrKey); - - -void __RPC_STUB IVMRVideoStreamControl_GetColorKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRVideoStreamControl_SetStreamActiveState_Proxy( - IVMRVideoStreamControl * This, - /* [in] */ BOOL fActive); - - -void __RPC_STUB IVMRVideoStreamControl_SetStreamActiveState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRVideoStreamControl_GetStreamActiveState_Proxy( - IVMRVideoStreamControl * This, - /* [out] */ BOOL *lpfActive); - - -void __RPC_STUB IVMRVideoStreamControl_GetStreamActiveState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRVideoStreamControl_INTERFACE_DEFINED__ */ - - -#ifndef __IVMRSurface_INTERFACE_DEFINED__ -#define __IVMRSurface_INTERFACE_DEFINED__ - -/* interface IVMRSurface */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRSurface; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a9849bbe-9ec8-4263-b764-62730f0d15d0") - IVMRSurface : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE IsSurfaceLocked( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LockSurface( - /* [out] */ BYTE **lpSurface) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnlockSurface( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSurface( - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRSurfaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRSurface * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRSurface * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRSurface * This); - - HRESULT ( STDMETHODCALLTYPE *IsSurfaceLocked )( - IVMRSurface * This); - - HRESULT ( STDMETHODCALLTYPE *LockSurface )( - IVMRSurface * This, - /* [out] */ BYTE **lpSurface); - - HRESULT ( STDMETHODCALLTYPE *UnlockSurface )( - IVMRSurface * This); - - HRESULT ( STDMETHODCALLTYPE *GetSurface )( - IVMRSurface * This, - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface); - - END_INTERFACE - } IVMRSurfaceVtbl; - - interface IVMRSurface - { - CONST_VTBL struct IVMRSurfaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRSurface_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRSurface_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRSurface_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRSurface_IsSurfaceLocked(This) \ - (This)->lpVtbl -> IsSurfaceLocked(This) - -#define IVMRSurface_LockSurface(This,lpSurface) \ - (This)->lpVtbl -> LockSurface(This,lpSurface) - -#define IVMRSurface_UnlockSurface(This) \ - (This)->lpVtbl -> UnlockSurface(This) - -#define IVMRSurface_GetSurface(This,lplpSurface) \ - (This)->lpVtbl -> GetSurface(This,lplpSurface) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRSurface_IsSurfaceLocked_Proxy( - IVMRSurface * This); - - -void __RPC_STUB IVMRSurface_IsSurfaceLocked_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurface_LockSurface_Proxy( - IVMRSurface * This, - /* [out] */ BYTE **lpSurface); - - -void __RPC_STUB IVMRSurface_LockSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurface_UnlockSurface_Proxy( - IVMRSurface * This); - - -void __RPC_STUB IVMRSurface_UnlockSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRSurface_GetSurface_Proxy( - IVMRSurface * This, - /* [out] */ LPDIRECTDRAWSURFACE7 *lplpSurface); - - -void __RPC_STUB IVMRSurface_GetSurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRSurface_INTERFACE_DEFINED__ */ - - -#ifndef __IVMRImagePresenterConfig_INTERFACE_DEFINED__ -#define __IVMRImagePresenterConfig_INTERFACE_DEFINED__ - -/* interface IVMRImagePresenterConfig */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRImagePresenterConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9f3a1c85-8555-49ba-935f-be5b5b29d178") - IVMRImagePresenterConfig : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetRenderingPrefs( - /* [in] */ DWORD dwRenderFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRenderingPrefs( - /* [out] */ DWORD *dwRenderFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRImagePresenterConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRImagePresenterConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRImagePresenterConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRImagePresenterConfig * This); - - HRESULT ( STDMETHODCALLTYPE *SetRenderingPrefs )( - IVMRImagePresenterConfig * This, - /* [in] */ DWORD dwRenderFlags); - - HRESULT ( STDMETHODCALLTYPE *GetRenderingPrefs )( - IVMRImagePresenterConfig * This, - /* [out] */ DWORD *dwRenderFlags); - - END_INTERFACE - } IVMRImagePresenterConfigVtbl; - - interface IVMRImagePresenterConfig - { - CONST_VTBL struct IVMRImagePresenterConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRImagePresenterConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRImagePresenterConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRImagePresenterConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRImagePresenterConfig_SetRenderingPrefs(This,dwRenderFlags) \ - (This)->lpVtbl -> SetRenderingPrefs(This,dwRenderFlags) - -#define IVMRImagePresenterConfig_GetRenderingPrefs(This,dwRenderFlags) \ - (This)->lpVtbl -> GetRenderingPrefs(This,dwRenderFlags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenterConfig_SetRenderingPrefs_Proxy( - IVMRImagePresenterConfig * This, - /* [in] */ DWORD dwRenderFlags); - - -void __RPC_STUB IVMRImagePresenterConfig_SetRenderingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenterConfig_GetRenderingPrefs_Proxy( - IVMRImagePresenterConfig * This, - /* [out] */ DWORD *dwRenderFlags); - - -void __RPC_STUB IVMRImagePresenterConfig_GetRenderingPrefs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRImagePresenterConfig_INTERFACE_DEFINED__ */ - - -#ifndef __IVMRImagePresenterExclModeConfig_INTERFACE_DEFINED__ -#define __IVMRImagePresenterExclModeConfig_INTERFACE_DEFINED__ - -/* interface IVMRImagePresenterExclModeConfig */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVMRImagePresenterExclModeConfig; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e6f7ce40-4673-44f1-8f77-5499d68cb4ea") - IVMRImagePresenterExclModeConfig : public IVMRImagePresenterConfig - { - public: - virtual HRESULT STDMETHODCALLTYPE SetXlcModeDDObjAndPrimarySurface( - /* [in] */ LPDIRECTDRAW7 lpDDObj, - /* [in] */ LPDIRECTDRAWSURFACE7 lpPrimarySurf) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetXlcModeDDObjAndPrimarySurface( - /* [out] */ LPDIRECTDRAW7 *lpDDObj, - /* [out] */ LPDIRECTDRAWSURFACE7 *lpPrimarySurf) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVMRImagePresenterExclModeConfigVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVMRImagePresenterExclModeConfig * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVMRImagePresenterExclModeConfig * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVMRImagePresenterExclModeConfig * This); - - HRESULT ( STDMETHODCALLTYPE *SetRenderingPrefs )( - IVMRImagePresenterExclModeConfig * This, - /* [in] */ DWORD dwRenderFlags); - - HRESULT ( STDMETHODCALLTYPE *GetRenderingPrefs )( - IVMRImagePresenterExclModeConfig * This, - /* [out] */ DWORD *dwRenderFlags); - - HRESULT ( STDMETHODCALLTYPE *SetXlcModeDDObjAndPrimarySurface )( - IVMRImagePresenterExclModeConfig * This, - /* [in] */ LPDIRECTDRAW7 lpDDObj, - /* [in] */ LPDIRECTDRAWSURFACE7 lpPrimarySurf); - - HRESULT ( STDMETHODCALLTYPE *GetXlcModeDDObjAndPrimarySurface )( - IVMRImagePresenterExclModeConfig * This, - /* [out] */ LPDIRECTDRAW7 *lpDDObj, - /* [out] */ LPDIRECTDRAWSURFACE7 *lpPrimarySurf); - - END_INTERFACE - } IVMRImagePresenterExclModeConfigVtbl; - - interface IVMRImagePresenterExclModeConfig - { - CONST_VTBL struct IVMRImagePresenterExclModeConfigVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVMRImagePresenterExclModeConfig_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVMRImagePresenterExclModeConfig_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVMRImagePresenterExclModeConfig_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVMRImagePresenterExclModeConfig_SetRenderingPrefs(This,dwRenderFlags) \ - (This)->lpVtbl -> SetRenderingPrefs(This,dwRenderFlags) - -#define IVMRImagePresenterExclModeConfig_GetRenderingPrefs(This,dwRenderFlags) \ - (This)->lpVtbl -> GetRenderingPrefs(This,dwRenderFlags) - - -#define IVMRImagePresenterExclModeConfig_SetXlcModeDDObjAndPrimarySurface(This,lpDDObj,lpPrimarySurf) \ - (This)->lpVtbl -> SetXlcModeDDObjAndPrimarySurface(This,lpDDObj,lpPrimarySurf) - -#define IVMRImagePresenterExclModeConfig_GetXlcModeDDObjAndPrimarySurface(This,lpDDObj,lpPrimarySurf) \ - (This)->lpVtbl -> GetXlcModeDDObjAndPrimarySurface(This,lpDDObj,lpPrimarySurf) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenterExclModeConfig_SetXlcModeDDObjAndPrimarySurface_Proxy( - IVMRImagePresenterExclModeConfig * This, - /* [in] */ LPDIRECTDRAW7 lpDDObj, - /* [in] */ LPDIRECTDRAWSURFACE7 lpPrimarySurf); - - -void __RPC_STUB IVMRImagePresenterExclModeConfig_SetXlcModeDDObjAndPrimarySurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVMRImagePresenterExclModeConfig_GetXlcModeDDObjAndPrimarySurface_Proxy( - IVMRImagePresenterExclModeConfig * This, - /* [out] */ LPDIRECTDRAW7 *lpDDObj, - /* [out] */ LPDIRECTDRAWSURFACE7 *lpPrimarySurf); - - -void __RPC_STUB IVMRImagePresenterExclModeConfig_GetXlcModeDDObjAndPrimarySurface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVMRImagePresenterExclModeConfig_INTERFACE_DEFINED__ */ - - -#ifndef __IVPManager_INTERFACE_DEFINED__ -#define __IVPManager_INTERFACE_DEFINED__ - -/* interface IVPManager */ -/* [unique][helpstring][uuid][local][object][local] */ - - -EXTERN_C const IID IID_IVPManager; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("aac18c18-e186-46d2-825d-a1f8dc8e395a") - IVPManager : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetVideoPortIndex( - /* [in] */ DWORD dwVideoPortIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVideoPortIndex( - /* [out] */ DWORD *pdwVideoPortIndex) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVPManagerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVPManager * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVPManager * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVPManager * This); - - HRESULT ( STDMETHODCALLTYPE *SetVideoPortIndex )( - IVPManager * This, - /* [in] */ DWORD dwVideoPortIndex); - - HRESULT ( STDMETHODCALLTYPE *GetVideoPortIndex )( - IVPManager * This, - /* [out] */ DWORD *pdwVideoPortIndex); - - END_INTERFACE - } IVPManagerVtbl; - - interface IVPManager - { - CONST_VTBL struct IVPManagerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVPManager_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVPManager_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVPManager_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVPManager_SetVideoPortIndex(This,dwVideoPortIndex) \ - (This)->lpVtbl -> SetVideoPortIndex(This,dwVideoPortIndex) - -#define IVPManager_GetVideoPortIndex(This,pdwVideoPortIndex) \ - (This)->lpVtbl -> GetVideoPortIndex(This,pdwVideoPortIndex) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IVPManager_SetVideoPortIndex_Proxy( - IVPManager * This, - /* [in] */ DWORD dwVideoPortIndex); - - -void __RPC_STUB IVPManager_SetVideoPortIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IVPManager_GetVideoPortIndex_Proxy( - IVPManager * This, - /* [out] */ DWORD *pdwVideoPortIndex); - - -void __RPC_STUB IVPManager_GetVideoPortIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVPManager_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - -/* [local] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_FindInterface_Proxy( - ICaptureGraphBuilder * This, - /* [unique][in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder_FindInterface_Stub( - ICaptureGraphBuilder * This, - /* [unique][in] */ const GUID *pCategory, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ IUnknown **ppint); - -/* [local] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_FindInterface_Proxy( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ void **ppint); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE ICaptureGraphBuilder2_FindInterface_Stub( - ICaptureGraphBuilder2 * This, - /* [in] */ const GUID *pCategory, - /* [in] */ const GUID *pType, - /* [in] */ IBaseFilter *pf, - /* [in] */ REFIID riid, - /* [out] */ IUnknown **ppint); - -/* [local] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_Set_Proxy( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][in] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_Set_Stub( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ byte *pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][in] */ byte *pPropData, - /* [in] */ DWORD cbPropData); - -/* [local] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_Get_Proxy( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ LPVOID pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][out] */ LPVOID pPropData, - /* [in] */ DWORD cbPropData, - /* [out] */ DWORD *pcbReturned); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IKsPropertySet_Get_Stub( - IKsPropertySet * This, - /* [in] */ REFGUID guidPropSet, - /* [in] */ DWORD dwPropID, - /* [size_is][in] */ byte *pInstanceData, - /* [in] */ DWORD cbInstanceData, - /* [size_is][out] */ byte *pPropData, - /* [in] */ DWORD cbPropData, - /* [out] */ DWORD *pcbReturned); - - - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/tune.h b/import/DirectX8/include/tune.h deleted file mode 100644 index bf10da2f0..000000000 --- a/import/DirectX8/include/tune.h +++ /dev/null @@ -1,815 +0,0 @@ -//------------------------------------------------------------------------------ -// File: Tune.h -// -// Desc: Additional infrastructure to extend the tuner.idl. Works nicely -// from C++. -// -// Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#pragma once - -#ifndef TUNE_H -#define TUNE_H - -#include - -namespace BDATuningModel { - -const long DEFAULT_MIN_CHANNEL = 2; -const long DEFAULT_MAX_CHANNEL = 999; -const long DEFAULT_MIN_FREQUENCY = 535; //bottom us am -const long DEFAULT_MAX_FREQUENCY = 108000; // top us fm -const long DEFAULT_ANALOG_TUNER_COUNTRY_CODE = 1; //usa -const TunerInputType DEFAULT_ANALOG_TUNER_INPUT_TYPE = TunerInputCable; //usa - -typedef CComQIPtr PQTuningSpaceContainer; -typedef CComQIPtr PQTuningSpace; -typedef CComQIPtr PQAnalogRadioTuningSpace; -typedef CComQIPtr PQAnalogTVTuningSpace; -typedef CComQIPtr PQATSCTuningSpace; -typedef CComQIPtr PQTuneRequest; -typedef CComQIPtr PQChannelTuneRequest; -typedef CComQIPtr PQATSCChannelTuneRequest; -typedef CComQIPtr PQLocator; -typedef CComQIPtr PQATSCLocator; -typedef CComQIPtr PQDVBTuningSpace; -typedef CComQIPtr PQDVBTuneRequest; -typedef CComQIPtr PQDVBSLocator; -typedef CComQIPtr PQDVBTLocator; - -// tuning space container -class TNTuningSpaceContainer : public PQTuningSpaceContainer { - TNTuningSpaceContainer() {} - TNTuningSpaceContainer(const PQTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {} - TNTuningSpaceContainer(ITuningSpace *p) : PQTuningSpaceContainer(p) {} - TNTuningSpaceContainer(IUnknown *p) : PQTuningSpaceContainer(p) {} - TNTuningSpaceContainer(const TNTuningSpaceContainer &a) : PQTuningSpaceContainer(a) {} - TNTuningSpaceContainer& operator=(TNTuningSpaceContainer& rhs) { - PQTuningSpaceContainer::operator=(rhs); - return *this; - } - -}; - -// tuning spaces -template class TNTuningSpaceHelper : public TUNINGSPACETYPE { -public: - TNTuningSpaceHelper() {} - TNTuningSpaceHelper(const TUNINGSPACETYPE &a) : TUNINGSPACETYPE(a) {} - TNTuningSpaceHelper(ITuningSpace *p) : TUNINGSPACETYPE(p) {} - TNTuningSpaceHelper(IUnknown *p) : TUNINGSPACETYPE(p) {} - TNTuningSpaceHelper(const TNTuningSpaceHelper &a) : TUNINGSPACETYPE(a) {} - TNTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { - TUNINGSPACETYPE::operator=(rhs); - return *this; - } - TNTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { - TUNINGSPACETYPE::operator=(rhs); - return *this; - } - TNTuningSpaceHelper& operator=(IUnknown *rhs) { - TUNINGSPACETYPE::operator=(rhs); - return *this; - } - TNTuningSpaceHelper& operator=(ITuningSpace *rhs) { - TUNINGSPACETYPE::operator=(rhs); - return *this; - } - bool operator==(TUNINGSPACETYPE& rhs) { - CComBSTR rhsname; - HRESULT hr = rhs->get_UniqueName(&rhsname); - if (FAILED(hr)) { - return false; - } - CComBSTR name; - hr = (*this)->get_UniqueName(&name); - if (FAILED(hr)) { - return false; - } - return name == rhsname; - } - bool operator!=(TUNINGSPACETYPE& rhs) { - return !operator==(rhs); - } - PQTuneRequest CreateTuneRequest() { - PQTuneRequest p; - HRESULT hr = (*this)->CreateTuneRequest(&p); - if (FAILED(hr)) { - return PQTuneRequest(); - } - return p; - } - - PQLocator Locator() { - _ASSERT(*this); - PQLocator ts; - HRESULT hr = (*this)->get_DefaultLocator(&ts); - if (FAILED(hr)) { - return PQLocator(); - } - return ts; - } - - HRESULT Locator(PQLocator& l) { - _ASSERT(*this); - return (*this)->put_Locator(l); - } - - void Clone() { - PQTuningSpace t; - HRESULT hr = (*this)->Clone(&t); - if (FAILED(hr) || !t) { - Release(); // clone failed, clear ourselves - return; - } - TUNINGSPACETYPE::operator=(t); - } - -}; - -typedef TNTuningSpaceHelper TNTuningSpace; - -template class TNAnalogRadioTuningSpaceHelper : public TNTuningSpaceHelper { -public: - TNAnalogRadioTuningSpaceHelper() {} - TNAnalogRadioTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} - TNAnalogRadioTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} - TNAnalogRadioTuningSpaceHelper(const TNAnalogRadioTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} - TNAnalogRadioTuningSpaceHelper& operator=(TNAnalogRadioTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - template TNAnalogRadioTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); - return *this; - } - TNAnalogRadioTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - TNAnalogRadioTuningSpaceHelper& operator=(IUnknown* rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - long MaxFrequency() { - _ASSERT(*this); - long freq; - HRESULT hr = (*this)->get_MaxFrequency(&freq); - if (FAILED(hr)) { - freq = DEFAULT_MAX_FREQUENCY; - } - return freq; - } - HRESULT MaxFrequency(long freq) { - _ASSERT(*this); - return (*this)->put_MaxFrequency(freq); - } - long MinFrequency() { - _ASSERT(*this); - long freq; - HRESULT hr = (*this)->get_MinFrequency(&freq); - if (FAILED(hr)) { - freq = DEFAULT_MIN_FREQUENCY; - } - return freq; - } - HRESULT MinFrequency(long freq) { - _ASSERT(*this); - return (*this)->put_MinFrequency(freq); - } -}; -typedef TNAnalogRadioTuningSpaceHelper TNAnalogRadioTuningSpace; - -template class TNAnalogTVTuningSpaceHelper : public TNTuningSpaceHelper { -public: - TNAnalogTVTuningSpaceHelper() {} - TNAnalogTVTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} - TNAnalogTVTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} - TNAnalogTVTuningSpaceHelper(const TNAnalogTVTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} - TNAnalogTVTuningSpaceHelper& operator=(TNAnalogTVTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - template TNAnalogTVTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); - return *this; - } - TNAnalogTVTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - TNAnalogTVTuningSpaceHelper& operator=(IUnknown* rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - TunerInputType InputType() { - _ASSERT(*this); - TunerInputType ti; - HRESULT hr = (*this)->get_InputType(&ti); - if (FAILED(hr)) { - ti = DEFAULT_ANALOG_TUNER_INPUT_TYPE; - } - return ti; - } - HRESULT InputType(TunerInputType ti) { - _ASSERT(*this); - return (*this)->put_InputType(&ti); - } - long CountryCode() { - _ASSERT(*this); - long cc; - HRESULT hr = (*this)->get_CountryCode(&cc); - if (FAILED(hr)) { - cc = DEFAULT_ANALOG_TUNER_INPUT_TYPE; - } - return cc; - } - HRESULT CountryCode(long cc) { - _ASSERT(*this); - return (*this)->put_CountryCode(cc); - } - long MinChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MinChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MIN_CHANNEL; - } - return chan; - } - HRESULT MinChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MinChannel(chan); - } - long MaxChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MaxChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MAX_CHANNEL; - } - return chan; - } - HRESULT MaxChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MaxChannel(chan); - } -}; -typedef TNAnalogTVTuningSpaceHelper TNAnalogTVTuningSpace; - -template class TNATSCTuningSpaceHelper : public TNAnalogTVTuningSpaceHelper { -public: - TNATSCTuningSpaceHelper() {} - TNATSCTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNAnalogTVTuningSpaceHelper(a) {} - TNATSCTuningSpaceHelper(IUnknown *p) : TNAnalogTVTuningSpaceHelper(p) {} - TNATSCTuningSpaceHelper(const TNATSCTuningSpaceHelper &a) : TNAnalogTVTuningSpaceHelper(a) {} - - TNATSCTuningSpaceHelper& operator=(TNATSCTuningSpaceHelper& rhs) { - TNAnalogTVTuningSpaceHelper::operator=(rhs); - return *this; - } - template TNATSCTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { - TNAnalogTVTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); - return *this; - } - TNATSCTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { - TNAnalogTVTuningSpaceHelper::operator=(rhs); - return *this; - } - TNATSCTuningSpaceHelper& operator=(IUnknown* rhs) { - TNAnalogTVTuningSpaceHelper::operator=(rhs); - return *this; - } - long MinMinorChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MinMinorChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MIN_CHANNEL; - } - return chan; - } - HRESULT MinMinorChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MinMinorChannel(chan); - } - - long MaxMinorChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MaxMinorChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MAX_CHANNEL; - } - return chan; - } - HRESULT MaxMinorChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MaxMinorChannel(chan); - } - long MinPhysicalChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MinPhysicalChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MIN_CHANNEL; - } - return chan; - } - HRESULT MinPhysicalChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MinPhysicalChannel(chan); - } - - long MaxPhysicalChannel() { - _ASSERT(*this); - long chan; - HRESULT hr = (*this)->get_MaxPhysicalChannel(&chan); - if (FAILED(hr)) { - chan = DEFAULT_MAX_CHANNEL; - } - return chan; - } - - HRESULT MaxPhysicalChannel(long chan) { - _ASSERT(*this); - return (*this)->put_MaxPhysicalChannel(chan); - } -}; -typedef TNATSCTuningSpaceHelper TNATSCTuningSpace; - -// dvb tuning space -template class TNDVBTuningSpaceHelper : public TNTuningSpaceHelper { -public: - TNDVBTuningSpaceHelper() {} - TNDVBTuningSpaceHelper(const TUNINGSPACETYPE &a) : TNTuningSpaceHelper(a) {} - TNDVBTuningSpaceHelper(IUnknown *p) : TNTuningSpaceHelper(p) {} - TNDVBTuningSpaceHelper(const TNDVBTuningSpaceHelper &a) : TNTuningSpaceHelper(a) {} - TNDVBTuningSpaceHelper& operator=(TNDVBTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - template TNDVBTuningSpaceHelper& operator=(TNTuningSpaceHelper& rhs) { - TNTuningSpaceHelper::operator=(TUNINGSPACETYPE(rhs)); - return *this; - } - TNDVBTuningSpaceHelper& operator=(TUNINGSPACETYPE& rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - TNDVBTuningSpaceHelper& operator=(IUnknown* rhs) { - TNTuningSpaceHelper::operator=(rhs); - return *this; - } - DVBSystemType SystemType() const { - DVBSystemType st; - HRESULT hr = (*this)->get_SystemType(&st); - if (FAILED(hr)) { - return DVB_Cable; - } - return st; - } - HRESULT SystemType(DVBSystemType st) { - _ASSERT(*this); - return (*this)->put_SystemType(st); - } -}; -typedef TNDVBTuningSpaceHelper TNDVBTuningSpace; - -// locators -template class TNLocatorHelper : public LOCATORTYPE { -public: - TNLocatorHelper() {} - TNLocatorHelper(const LOCATORTYPE &a) : LOCATORTYPE(a) {} - TNLocatorHelper(IUnknown *p) : LOCATORTYPE(p) {} - TNLocatorHelper(const TNLocatorHelper &a) : LOCATORTYPE(a) {} - TNLocatorHelper(ILocator *p) : LOCATORTYPE(p) {} - TNLocatorHelper& operator=(TNLocatorHelper& rhs) { - LOCATORTYPE::operator=(rhs); - return *this; - } - TNLocatorHelper& operator=(LOCATORTYPE& rhs) { - LOCATORTYPE::operator=(rhs); - return *this; - } - TNLocatorHelper& operator=(ILocator* rhs) { - LOCATORTYPE::operator=(rhs); - return *this; - } - TNLocatorHelper& operator=(IUnknown* rhs) { - LOCATORTYPE::operator=(rhs); - return *this; - } - - void Clone() { - PQLocator t; - HRESULT hr = (*this)->Clone(&t); - if (FAILED(hr) || !t) { - Release(); // clone failed, clear ourselves - return; - } - LOCATORTYPE::operator=(t); - } - - long CarrierFrequency() { - _ASSERT(*this); - long f; - HRESULT hr = (*this)->get_CarrierFrequency(&f); - if (FAILED(hr)) { - return -1; - } - return f; - } - HRESULT CarrierFrequency(long f) { - _ASSERT(*this); - return (*this)->put_CarrierFrequency(f); - } - - FECMethod InnerFEC() { - _ASSERT(*this); - FECMethod f; - HRESULT hr = (*this)->get_InnerFEC(&f); - if (FAILED(hr)) { - return BDA_FEC_METHOD_NOT_SET; - } - return f; - } - HRESULT InnerFEC(FECMethod f) { - _ASSERT(*this); - return (*this)->put_InnerFEC(f); - } - BinaryConvolutionCodeRate InnerFECRate() { - _ASSERT(*this); - BinaryConvolutionCodeRate f; - HRESULT hr = (*this)->get_InnerFECRate(&f); - if (FAILED(hr)) { - return BDA_BCC_RATE_NOT_SET; - } - return f; - } - HRESULT InnerFECRate(BinaryConvolutionCodeRate f) { - _ASSERT(*this); - return (*this)->put_InnerFECRate(f); - } - FECMethod OuterFEC() { - _ASSERT(*this); - FECMethod f; - HRESULT hr = (*this)->get_OuterFEC(&f); - if (FAILED(hr)) { - return BDA_FEC_METHOD_NOT_SET; - } - return f; - } - HRESULT OuterFEC(FECMethod f) { - _ASSERT(*this); - return (*this)->put_OuterFEC(f); - } - BinaryConvolutionCodeRate OuterFECRate() { - _ASSERT(*this); - BinaryConvolutionCodeRate f; - HRESULT hr = (*this)->get_OuterFECRate(&f); - if (FAILED(hr)) { - return BDA_BCC_RATE_NOT_SET; - } - return f; - } - HRESULT OuterFECRate(BinaryConvolutionCodeRate f) { - _ASSERT(*this); - return (*this)->put_OuterFECRate(f); - } - ModulationType Modulation() { - _ASSERT(*this); - ModulationType f; - HRESULT hr = (*this)->get_Modulation(&f); - if (FAILED(hr)) { - return BDA_MOD_NOT_SET; - } - return f; - } - HRESULT Modulation(ModulationType f) { - _ASSERT(*this); - return (*this)->put_Modulation(f); - } - - long SymbolRate() { - _ASSERT(*this); - long f; - HRESULT hr = (*this)->get_SymbolRate(&f); - if (FAILED(hr)) { - return -1; - } - return f; - } - HRESULT SymbolRate(long f) { - _ASSERT(*this); - return (*this)->put_SymbolRate(f); - } - -}; -typedef TNLocatorHelper TNLocator; - -template class TNATSCLocatorHelper : public TNLocatorHelper { -public: - TNATSCLocatorHelper() {} - TNATSCLocatorHelper(const LOCATORTYPE &a) : TNLocatorHelper(a) {} - TNATSCLocatorHelper(IUnknown *p) : TNLocatorHelper(p) {} - TNATSCLocatorHelper(const TNATSCLocatorHelper &a) : TNLocatorHelper(a) {} - TNATSCLocatorHelper(IATSCLocator *p) : TNLocatorHelper(p) {} - TNATSCLocatorHelper(const TNLocatorHelper &a) : TNLocatorHelper(a) {} - TNATSCLocatorHelper& operator=(TNATSCLocatorHelper& rhs) { - TNLocatorHelper::operator=(rhs); - return *this; - } - TNATSCLocatorHelper& operator=(TNLocatorHelper& rhs) { - TNLocatorHelper::operator=(rhs); - return *this; - } - TNATSCLocatorHelper& operator=(LOCATORTYPE& rhs) { - TNLocatorHelper::operator=(rhs); - return *this; - } - TNATSCLocatorHelper& operator=(IATSCLocator* rhs) { - TNLocatorHelper::operator=(rhs); - return *this; - } - TNATSCLocatorHelper& operator=(IUnknown* rhs) { - TNLocatorHelper::operator=(rhs); - return *this; - } - - long PhysicalChannel() { - _ASSERT(*this); - long pc; - HRESULT hr = (*this)->get_PhysicalChannel(&pc); - if (FAILED(hr)) { - return -1; - } - return pc; - } - HRESULT PhysicalChannel(long pc) { - _ASSERT(*this); - return (*this)->put_PhysicalChannel(pc); - } - - long TSID() { - _ASSERT(*this); - long pc; - HRESULT hr = (*this)->get_TSID(&pc); - if (FAILED(hr)) { - return -1; - } - return pc; - } - HRESULT TSID(long pc) { - _ASSERT(*this); - return (*this)->put_TSID(pc); - } - - long ProgramNumber() { - _ASSERT(*this); - long pc; - HRESULT hr = (*this)->get_ProgramNumber(&pc); - if (FAILED(hr)) { - return -1; - } - return pc; - } - HRESULT ProgramNumber(long pc) { - _ASSERT(*this); - return (*this)->put_ProgramNumber(pc); - } -}; -typedef TNATSCLocatorHelper TNATSCLocator; - -// tune requests -template class TNTuneRequestHelper : public TUNEREQUESTTYPE { -public: - TNTuneRequestHelper() {} - TNTuneRequestHelper(const TUNEREQUESTTYPE &a) : TUNEREQUESTTYPE(a) {} - TNTuneRequestHelper(IUnknown *p) : TUNEREQUESTTYPE(p) {} - TNTuneRequestHelper(const TNTuneRequestHelper &a) : TUNEREQUESTTYPE(a) {} - TNTuneRequestHelper(ITuneRequest *p) : TUNEREQUESTTYPE(p) {} - TNTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - TNTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - TNTuneRequestHelper& operator=(ITuneRequest* rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - TNTuneRequestHelper& operator=(IUnknown* rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - // this function creates a new instance of the base ITuneRequest* and copies - // all the values of the current ITuneRequest and sets this to the new one - // this provides the value semantics needed by the network providers - void Clone() { - PQTuneRequest t; - HRESULT hr = (*this)->Clone(&t); - if (FAILED(hr) || !t) { - Release(); // clone failed, clear ourselves - return; - } - TUNEREQUESTTYPE::operator=(t); - } - - PQTuningSpace TuningSpace() { - _ASSERT(*this); - PQTuningSpace ts; - HRESULT hr = (*this)->get_TuningSpace(&ts); - if (FAILED(hr)) { - return PQTuningSpace(); - } - return ts; - } - - LOCATORTYPE Locator() { - _ASSERT(*this); - PQLocator pc; - HRESULT hr = (*this)->get_Locator(&pc); - if (FAILED(hr)) { - return PQLocator().p; - } - return pc.p; - } - HRESULT Locator(LOCATORTYPE& pc) { - _ASSERT(*this); - return (*this)->put_Locator(pc); - } -}; - -typedef TNTuneRequestHelper TNTuneRequest; - -template class TNChannelTuneRequestHelper : public TNTuneRequestHelper { -public: - TNChannelTuneRequestHelper() {} - TNChannelTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper(a) {} - TNChannelTuneRequestHelper(IChannelTuneRequest *p) : TNTuneRequestHelper(p) {} - TNChannelTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper(p) {} - TNChannelTuneRequestHelper(const TNTuneRequestHelper &a) : TNTuneRequestHelper(a) {} - TNChannelTuneRequestHelper(const TNChannelTuneRequestHelper &a) : TNTuneRequestHelper(a) {} - TNChannelTuneRequestHelper& operator=(TNChannelTuneRequestHelper& rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - template TNChannelTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { - TNTuneRequestHelper::operator=(TUNEREQUESTTYPE(rhs)); - return *this; - } - TNChannelTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - TNChannelTuneRequestHelper& operator=(IChannelTuneRequest* rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - TNChannelTuneRequestHelper& operator=(IUnknown* rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - long Channel() { - _ASSERT(*this); - long c; - HRESULT hr = (*this)->get_Channel(&c); - if (FAILED(hr)) { - return -1; - } - return c; - } - HRESULT Channel(long c) { - _ASSERT(*this); - return (*this)->put_Channel(c); - } -}; - -typedef TNChannelTuneRequestHelper TNChannelTuneRequest; - -template class TNATSCChannelTuneRequestHelper : public TNChannelTuneRequestHelper { -public: - TNATSCChannelTuneRequestHelper() {} - TNATSCChannelTuneRequestHelper(const TNTuneRequest &a) : TNChannelTuneRequestHelper(a) {} - TNATSCChannelTuneRequestHelper(IATSCChannelTuneRequest *p) : TNChannelTuneRequestHelper(p) {} - TNATSCChannelTuneRequestHelper(IUnknown *p) : TNChannelTuneRequestHelper(p) {} - TNATSCChannelTuneRequestHelper(const TNChannelTuneRequestHelper &a) : TNChannelTuneRequestHelper(a) {} - TNATSCChannelTuneRequestHelper(const TNATSCChannelTuneRequestHelper &a) : TNChannelTuneRequestHelper(a) {} - TNATSCChannelTuneRequestHelper& operator=(TNATSCChannelTuneRequestHelper& rhs) { - TNChannelTuneRequestHelper::operator=(rhs); - return *this; - } - templateTNATSCChannelTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { - TNChannelTuneRequestHelper::operator=(TR(rhs)); - return *this; - } - TNATSCChannelTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { - TNChannelTuneRequestHelper::operator=(rhs); - return *this; - } - TNATSCChannelTuneRequestHelper& operator=(IATSCChannelTuneRequest *rhs) { - TNChannelTuneRequestHelper::operator=(rhs); - return *this; - } - TNTuneRequestHelper& operator=(IUnknown* rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - long MinorChannel() { - _ASSERT(*this); - long mc; - HRESULT hr = (*this)->get_MinorChannel(&mc); - if (FAILED(hr)) { - return -1; - } - return mc; - } - HRESULT MinorChannel(long mc) { - _ASSERT(*this); - return (*this)->put_MinorChannel(mc); - } -}; -typedef TNATSCChannelTuneRequestHelper TNATSCChannelTuneRequest; - -template class TNDVBTuneRequestHelper : public TNTuneRequestHelper { -public: - TNDVBTuneRequestHelper() {} - TNDVBTuneRequestHelper(const TNTuneRequest &a) : TNTuneRequestHelper(a) {} - TNDVBTuneRequestHelper(IDVBTuneRequest *p) : TNTuneRequestHelper(p) {} - TNDVBTuneRequestHelper(IUnknown *p) : TNTuneRequestHelper(p) {} - TNDVBTuneRequestHelper(const TNTuneRequestHelper &a) : TNTuneRequestHelper(a) {} - TNDVBTuneRequestHelper(const TNDVBTuneRequestHelper &a) : TNTuneRequestHelper(a) {} - TNDVBTuneRequestHelper& operator=(TNDVBTuneRequestHelper& rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - template TNDVBTuneRequestHelper& operator=(TNTuneRequestHelper& rhs) { - TNTuneRequestHelper::operator=(TUNEREQUESTTYPE(rhs)); - return *this; - } - TNDVBTuneRequestHelper& operator=(TUNEREQUESTTYPE& rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - TNDVBTuneRequestHelper& operator=(IDVBTuneRequest* rhs) { - TNTuneRequestHelper::operator=(rhs); - return *this; - } - TNDVBTuneRequestHelper& operator=(IUnknown* rhs) { - TUNEREQUESTTYPE::operator=(rhs); - return *this; - } - long ONID() { - _ASSERT(*this); - long c; - HRESULT hr = (*this)->get_ONID(&c); - if (FAILED(hr)) { - return -1; - } - return c; - } - HRESULT ONID(long c) { - _ASSERT(*this); - return (*this)->put_ONID(c); - } - long TSID() { - _ASSERT(*this); - long c; - HRESULT hr = (*this)->get_TSID(&c); - if (FAILED(hr)) { - return -1; - } - return c; - } - HRESULT TSID(long c) { - _ASSERT(*this); - return (*this)->put_TSID(c); - } - long SID() { - _ASSERT(*this); - long c; - HRESULT hr = (*this)->get_SID(&c); - if (FAILED(hr)) { - return -1; - } - return c; - } - HRESULT SID(long c) { - _ASSERT(*this); - return (*this)->put_SID(c); - } -}; -typedef TNDVBTuneRequestHelper TNDVBTuneRequest; -}; // namespace - -#ifndef NO_DEFAULT_BDATUNINGMODEL_NAMESPACE -using namespace BDATuningModel; -#endif - -#endif -// end of file - tune.h diff --git a/import/DirectX8/include/tuner.h b/import/DirectX8/include/tuner.h deleted file mode 100644 index 12199d040..000000000 --- a/import/DirectX8/include/tuner.h +++ /dev/null @@ -1,21517 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// Separate the updated Windows XP version of this header from the downlevel -// version that shipped with the DirectX 8.0 SDK. Since development -// on BDA technology continued for Windows XP, some changes were made to -// this file in order to improve the interface and functionality. -// -// To maintain compatibility with older applications which rely on the -// DirectX 8.0 versions of these files, the DirectX 8.1 version includes -// both the Windows XP content and the DirectX 8.0 content, which are -// separated by the #if (WINVER >= 0x501) preprocessor directive. -// -// Therefore, if you define WINVER to be 0x501 to specify Windows XP, -// the revised content will be compiled. Otherwise, the original -// DirectX 8.0 content will be used. -// -///////////////////////////////////////////////////////////////////////////// - -#if (WINVER >= 0x501) // Windows XP content - - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for tuner.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __tuner_h__ -#define __tuner_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ITuningSpaces_FWD_DEFINED__ -#define __ITuningSpaces_FWD_DEFINED__ -typedef interface ITuningSpaces ITuningSpaces; -#endif /* __ITuningSpaces_FWD_DEFINED__ */ - - -#ifndef __ITuningSpaceContainer_FWD_DEFINED__ -#define __ITuningSpaceContainer_FWD_DEFINED__ -typedef interface ITuningSpaceContainer ITuningSpaceContainer; -#endif /* __ITuningSpaceContainer_FWD_DEFINED__ */ - - -#ifndef __ITuningSpace_FWD_DEFINED__ -#define __ITuningSpace_FWD_DEFINED__ -typedef interface ITuningSpace ITuningSpace; -#endif /* __ITuningSpace_FWD_DEFINED__ */ - - -#ifndef __IEnumTuningSpaces_FWD_DEFINED__ -#define __IEnumTuningSpaces_FWD_DEFINED__ -typedef interface IEnumTuningSpaces IEnumTuningSpaces; -#endif /* __IEnumTuningSpaces_FWD_DEFINED__ */ - - -#ifndef __IDVBTuningSpace_FWD_DEFINED__ -#define __IDVBTuningSpace_FWD_DEFINED__ -typedef interface IDVBTuningSpace IDVBTuningSpace; -#endif /* __IDVBTuningSpace_FWD_DEFINED__ */ - - -#ifndef __IDVBTuningSpace2_FWD_DEFINED__ -#define __IDVBTuningSpace2_FWD_DEFINED__ -typedef interface IDVBTuningSpace2 IDVBTuningSpace2; -#endif /* __IDVBTuningSpace2_FWD_DEFINED__ */ - - -#ifndef __IDVBSTuningSpace_FWD_DEFINED__ -#define __IDVBSTuningSpace_FWD_DEFINED__ -typedef interface IDVBSTuningSpace IDVBSTuningSpace; -#endif /* __IDVBSTuningSpace_FWD_DEFINED__ */ - - -#ifndef __IAnalogTVTuningSpace_FWD_DEFINED__ -#define __IAnalogTVTuningSpace_FWD_DEFINED__ -typedef interface IAnalogTVTuningSpace IAnalogTVTuningSpace; -#endif /* __IAnalogTVTuningSpace_FWD_DEFINED__ */ - - -#ifndef __IATSCTuningSpace_FWD_DEFINED__ -#define __IATSCTuningSpace_FWD_DEFINED__ -typedef interface IATSCTuningSpace IATSCTuningSpace; -#endif /* __IATSCTuningSpace_FWD_DEFINED__ */ - - -#ifndef __IAnalogRadioTuningSpace_FWD_DEFINED__ -#define __IAnalogRadioTuningSpace_FWD_DEFINED__ -typedef interface IAnalogRadioTuningSpace IAnalogRadioTuningSpace; -#endif /* __IAnalogRadioTuningSpace_FWD_DEFINED__ */ - - -#ifndef __ITuneRequest_FWD_DEFINED__ -#define __ITuneRequest_FWD_DEFINED__ -typedef interface ITuneRequest ITuneRequest; -#endif /* __ITuneRequest_FWD_DEFINED__ */ - - -#ifndef __IChannelTuneRequest_FWD_DEFINED__ -#define __IChannelTuneRequest_FWD_DEFINED__ -typedef interface IChannelTuneRequest IChannelTuneRequest; -#endif /* __IChannelTuneRequest_FWD_DEFINED__ */ - - -#ifndef __IATSCChannelTuneRequest_FWD_DEFINED__ -#define __IATSCChannelTuneRequest_FWD_DEFINED__ -typedef interface IATSCChannelTuneRequest IATSCChannelTuneRequest; -#endif /* __IATSCChannelTuneRequest_FWD_DEFINED__ */ - - -#ifndef __IDVBTuneRequest_FWD_DEFINED__ -#define __IDVBTuneRequest_FWD_DEFINED__ -typedef interface IDVBTuneRequest IDVBTuneRequest; -#endif /* __IDVBTuneRequest_FWD_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequest_FWD_DEFINED__ -#define __IMPEG2TuneRequest_FWD_DEFINED__ -typedef interface IMPEG2TuneRequest IMPEG2TuneRequest; -#endif /* __IMPEG2TuneRequest_FWD_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequestFactory_FWD_DEFINED__ -#define __IMPEG2TuneRequestFactory_FWD_DEFINED__ -typedef interface IMPEG2TuneRequestFactory IMPEG2TuneRequestFactory; -#endif /* __IMPEG2TuneRequestFactory_FWD_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequestSupport_FWD_DEFINED__ -#define __IMPEG2TuneRequestSupport_FWD_DEFINED__ -typedef interface IMPEG2TuneRequestSupport IMPEG2TuneRequestSupport; -#endif /* __IMPEG2TuneRequestSupport_FWD_DEFINED__ */ - - -#ifndef __ITuner_FWD_DEFINED__ -#define __ITuner_FWD_DEFINED__ -typedef interface ITuner ITuner; -#endif /* __ITuner_FWD_DEFINED__ */ - - -#ifndef __IScanningTuner_FWD_DEFINED__ -#define __IScanningTuner_FWD_DEFINED__ -typedef interface IScanningTuner IScanningTuner; -#endif /* __IScanningTuner_FWD_DEFINED__ */ - - -#ifndef __IComponentType_FWD_DEFINED__ -#define __IComponentType_FWD_DEFINED__ -typedef interface IComponentType IComponentType; -#endif /* __IComponentType_FWD_DEFINED__ */ - - -#ifndef __ILanguageComponentType_FWD_DEFINED__ -#define __ILanguageComponentType_FWD_DEFINED__ -typedef interface ILanguageComponentType ILanguageComponentType; -#endif /* __ILanguageComponentType_FWD_DEFINED__ */ - - -#ifndef __IMPEG2ComponentType_FWD_DEFINED__ -#define __IMPEG2ComponentType_FWD_DEFINED__ -typedef interface IMPEG2ComponentType IMPEG2ComponentType; -#endif /* __IMPEG2ComponentType_FWD_DEFINED__ */ - - -#ifndef __IATSCComponentType_FWD_DEFINED__ -#define __IATSCComponentType_FWD_DEFINED__ -typedef interface IATSCComponentType IATSCComponentType; -#endif /* __IATSCComponentType_FWD_DEFINED__ */ - - -#ifndef __IEnumComponentTypes_FWD_DEFINED__ -#define __IEnumComponentTypes_FWD_DEFINED__ -typedef interface IEnumComponentTypes IEnumComponentTypes; -#endif /* __IEnumComponentTypes_FWD_DEFINED__ */ - - -#ifndef __IComponentTypes_FWD_DEFINED__ -#define __IComponentTypes_FWD_DEFINED__ -typedef interface IComponentTypes IComponentTypes; -#endif /* __IComponentTypes_FWD_DEFINED__ */ - - -#ifndef __IComponent_FWD_DEFINED__ -#define __IComponent_FWD_DEFINED__ -typedef interface IComponent IComponent; -#endif /* __IComponent_FWD_DEFINED__ */ - - -#ifndef __IMPEG2Component_FWD_DEFINED__ -#define __IMPEG2Component_FWD_DEFINED__ -typedef interface IMPEG2Component IMPEG2Component; -#endif /* __IMPEG2Component_FWD_DEFINED__ */ - - -#ifndef __IEnumComponents_FWD_DEFINED__ -#define __IEnumComponents_FWD_DEFINED__ -typedef interface IEnumComponents IEnumComponents; -#endif /* __IEnumComponents_FWD_DEFINED__ */ - - -#ifndef __IComponents_FWD_DEFINED__ -#define __IComponents_FWD_DEFINED__ -typedef interface IComponents IComponents; -#endif /* __IComponents_FWD_DEFINED__ */ - - -#ifndef __ILocator_FWD_DEFINED__ -#define __ILocator_FWD_DEFINED__ -typedef interface ILocator ILocator; -#endif /* __ILocator_FWD_DEFINED__ */ - - -#ifndef __IATSCLocator_FWD_DEFINED__ -#define __IATSCLocator_FWD_DEFINED__ -typedef interface IATSCLocator IATSCLocator; -#endif /* __IATSCLocator_FWD_DEFINED__ */ - - -#ifndef __IDVBTLocator_FWD_DEFINED__ -#define __IDVBTLocator_FWD_DEFINED__ -typedef interface IDVBTLocator IDVBTLocator; -#endif /* __IDVBTLocator_FWD_DEFINED__ */ - - -#ifndef __IDVBSLocator_FWD_DEFINED__ -#define __IDVBSLocator_FWD_DEFINED__ -typedef interface IDVBSLocator IDVBSLocator; -#endif /* __IDVBSLocator_FWD_DEFINED__ */ - - -#ifndef __IDVBCLocator_FWD_DEFINED__ -#define __IDVBCLocator_FWD_DEFINED__ -typedef interface IDVBCLocator IDVBCLocator; -#endif /* __IDVBCLocator_FWD_DEFINED__ */ - - -#ifndef __IBroadcastEvent_FWD_DEFINED__ -#define __IBroadcastEvent_FWD_DEFINED__ -typedef interface IBroadcastEvent IBroadcastEvent; -#endif /* __IBroadcastEvent_FWD_DEFINED__ */ - - -#ifndef __SystemTuningSpaces_FWD_DEFINED__ -#define __SystemTuningSpaces_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SystemTuningSpaces SystemTuningSpaces; -#else -typedef struct SystemTuningSpaces SystemTuningSpaces; -#endif /* __cplusplus */ - -#endif /* __SystemTuningSpaces_FWD_DEFINED__ */ - - -#ifndef __TuningSpace_FWD_DEFINED__ -#define __TuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class TuningSpace TuningSpace; -#else -typedef struct TuningSpace TuningSpace; -#endif /* __cplusplus */ - -#endif /* __TuningSpace_FWD_DEFINED__ */ - - -#ifndef __ATSCTuningSpace_FWD_DEFINED__ -#define __ATSCTuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ATSCTuningSpace ATSCTuningSpace; -#else -typedef struct ATSCTuningSpace ATSCTuningSpace; -#endif /* __cplusplus */ - -#endif /* __ATSCTuningSpace_FWD_DEFINED__ */ - - -#ifndef __AnalogRadioTuningSpace_FWD_DEFINED__ -#define __AnalogRadioTuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AnalogRadioTuningSpace AnalogRadioTuningSpace; -#else -typedef struct AnalogRadioTuningSpace AnalogRadioTuningSpace; -#endif /* __cplusplus */ - -#endif /* __AnalogRadioTuningSpace_FWD_DEFINED__ */ - - -#ifndef __AnalogTVTuningSpace_FWD_DEFINED__ -#define __AnalogTVTuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AnalogTVTuningSpace AnalogTVTuningSpace; -#else -typedef struct AnalogTVTuningSpace AnalogTVTuningSpace; -#endif /* __cplusplus */ - -#endif /* __AnalogTVTuningSpace_FWD_DEFINED__ */ - - -#ifndef __DVBTuningSpace_FWD_DEFINED__ -#define __DVBTuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBTuningSpace DVBTuningSpace; -#else -typedef struct DVBTuningSpace DVBTuningSpace; -#endif /* __cplusplus */ - -#endif /* __DVBTuningSpace_FWD_DEFINED__ */ - - -#ifndef __DVBSTuningSpace_FWD_DEFINED__ -#define __DVBSTuningSpace_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBSTuningSpace DVBSTuningSpace; -#else -typedef struct DVBSTuningSpace DVBSTuningSpace; -#endif /* __cplusplus */ - -#endif /* __DVBSTuningSpace_FWD_DEFINED__ */ - - -#ifndef __ComponentTypes_FWD_DEFINED__ -#define __ComponentTypes_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ComponentTypes ComponentTypes; -#else -typedef struct ComponentTypes ComponentTypes; -#endif /* __cplusplus */ - -#endif /* __ComponentTypes_FWD_DEFINED__ */ - - -#ifndef __ComponentType_FWD_DEFINED__ -#define __ComponentType_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ComponentType ComponentType; -#else -typedef struct ComponentType ComponentType; -#endif /* __cplusplus */ - -#endif /* __ComponentType_FWD_DEFINED__ */ - - -#ifndef __LanguageComponentType_FWD_DEFINED__ -#define __LanguageComponentType_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class LanguageComponentType LanguageComponentType; -#else -typedef struct LanguageComponentType LanguageComponentType; -#endif /* __cplusplus */ - -#endif /* __LanguageComponentType_FWD_DEFINED__ */ - - -#ifndef __MPEG2ComponentType_FWD_DEFINED__ -#define __MPEG2ComponentType_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MPEG2ComponentType MPEG2ComponentType; -#else -typedef struct MPEG2ComponentType MPEG2ComponentType; -#endif /* __cplusplus */ - -#endif /* __MPEG2ComponentType_FWD_DEFINED__ */ - - -#ifndef __ATSCComponentType_FWD_DEFINED__ -#define __ATSCComponentType_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ATSCComponentType ATSCComponentType; -#else -typedef struct ATSCComponentType ATSCComponentType; -#endif /* __cplusplus */ - -#endif /* __ATSCComponentType_FWD_DEFINED__ */ - - -#ifndef __Components_FWD_DEFINED__ -#define __Components_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class Components Components; -#else -typedef struct Components Components; -#endif /* __cplusplus */ - -#endif /* __Components_FWD_DEFINED__ */ - - -#ifndef __Component_FWD_DEFINED__ -#define __Component_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class Component Component; -#else -typedef struct Component Component; -#endif /* __cplusplus */ - -#endif /* __Component_FWD_DEFINED__ */ - - -#ifndef __MPEG2Component_FWD_DEFINED__ -#define __MPEG2Component_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MPEG2Component MPEG2Component; -#else -typedef struct MPEG2Component MPEG2Component; -#endif /* __cplusplus */ - -#endif /* __MPEG2Component_FWD_DEFINED__ */ - - -#ifndef __TuneRequest_FWD_DEFINED__ -#define __TuneRequest_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class TuneRequest TuneRequest; -#else -typedef struct TuneRequest TuneRequest; -#endif /* __cplusplus */ - -#endif /* __TuneRequest_FWD_DEFINED__ */ - - -#ifndef __ChannelTuneRequest_FWD_DEFINED__ -#define __ChannelTuneRequest_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ChannelTuneRequest ChannelTuneRequest; -#else -typedef struct ChannelTuneRequest ChannelTuneRequest; -#endif /* __cplusplus */ - -#endif /* __ChannelTuneRequest_FWD_DEFINED__ */ - - -#ifndef __ATSCChannelTuneRequest_FWD_DEFINED__ -#define __ATSCChannelTuneRequest_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ATSCChannelTuneRequest ATSCChannelTuneRequest; -#else -typedef struct ATSCChannelTuneRequest ATSCChannelTuneRequest; -#endif /* __cplusplus */ - -#endif /* __ATSCChannelTuneRequest_FWD_DEFINED__ */ - - -#ifndef __MPEG2TuneRequest_FWD_DEFINED__ -#define __MPEG2TuneRequest_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MPEG2TuneRequest MPEG2TuneRequest; -#else -typedef struct MPEG2TuneRequest MPEG2TuneRequest; -#endif /* __cplusplus */ - -#endif /* __MPEG2TuneRequest_FWD_DEFINED__ */ - - -#ifndef __MPEG2TuneRequestFactory_FWD_DEFINED__ -#define __MPEG2TuneRequestFactory_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MPEG2TuneRequestFactory MPEG2TuneRequestFactory; -#else -typedef struct MPEG2TuneRequestFactory MPEG2TuneRequestFactory; -#endif /* __cplusplus */ - -#endif /* __MPEG2TuneRequestFactory_FWD_DEFINED__ */ - - -#ifndef __Locator_FWD_DEFINED__ -#define __Locator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class Locator Locator; -#else -typedef struct Locator Locator; -#endif /* __cplusplus */ - -#endif /* __Locator_FWD_DEFINED__ */ - - -#ifndef __ATSCLocator_FWD_DEFINED__ -#define __ATSCLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ATSCLocator ATSCLocator; -#else -typedef struct ATSCLocator ATSCLocator; -#endif /* __cplusplus */ - -#endif /* __ATSCLocator_FWD_DEFINED__ */ - - -#ifndef __DVBTLocator_FWD_DEFINED__ -#define __DVBTLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBTLocator DVBTLocator; -#else -typedef struct DVBTLocator DVBTLocator; -#endif /* __cplusplus */ - -#endif /* __DVBTLocator_FWD_DEFINED__ */ - - -#ifndef __DVBSLocator_FWD_DEFINED__ -#define __DVBSLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBSLocator DVBSLocator; -#else -typedef struct DVBSLocator DVBSLocator; -#endif /* __cplusplus */ - -#endif /* __DVBSLocator_FWD_DEFINED__ */ - - -#ifndef __DVBCLocator_FWD_DEFINED__ -#define __DVBCLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBCLocator DVBCLocator; -#else -typedef struct DVBCLocator DVBCLocator; -#endif /* __cplusplus */ - -#endif /* __DVBCLocator_FWD_DEFINED__ */ - - -#ifndef __DVBTuneRequest_FWD_DEFINED__ -#define __DVBTuneRequest_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DVBTuneRequest DVBTuneRequest; -#else -typedef struct DVBTuneRequest DVBTuneRequest; -#endif /* __cplusplus */ - -#endif /* __DVBTuneRequest_FWD_DEFINED__ */ - - -#ifndef __CreatePropBagOnRegKey_FWD_DEFINED__ -#define __CreatePropBagOnRegKey_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class CreatePropBagOnRegKey CreatePropBagOnRegKey; -#else -typedef struct CreatePropBagOnRegKey CreatePropBagOnRegKey; -#endif /* __cplusplus */ - -#endif /* __CreatePropBagOnRegKey_FWD_DEFINED__ */ - - -#ifndef __BroadcastEventService_FWD_DEFINED__ -#define __BroadcastEventService_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class BroadcastEventService BroadcastEventService; -#else -typedef struct BroadcastEventService BroadcastEventService; -#endif /* __cplusplus */ - -#endif /* __BroadcastEventService_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "comcat.h" -#include "strmif.h" -#include "bdatypes.h" -#include "regbag.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_tuner_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1999-2001. -// -//-------------------------------------------------------------------------- -#pragma once -#include - - - - - - - - - - - - - - - - - - - - -enum __MIDL___MIDL_itf_tuner_0000_0001 - { DISPID_TUNER_TS_UNIQUENAME = 1, - DISPID_TUNER_TS_FRIENDLYNAME = 2, - DISPID_TUNER_TS_CLSID = 3, - DISPID_TUNER_TS_NETWORKTYPE = 4, - DISPID_TUNER_TS__NETWORKTYPE = 5, - DISPID_TUNER_TS_CREATETUNEREQUEST = 6, - DISPID_TUNER_TS_ENUMCATEGORYGUIDS = 7, - DISPID_TUNER_TS_ENUMDEVICEMONIKERS = 8, - DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES = 9, - DISPID_TUNER_TS_FREQMAP = 10, - DISPID_TUNER_TS_DEFLOCATOR = 11, - DISPID_TUNER_TS_CLONE = 12, - DISPID_TUNER_TR_TUNINGSPACE = 1, - DISPID_TUNER_TR_COMPONENTS = 2, - DISPID_TUNER_TR_CLONE = 3, - DISPID_TUNER_TR_LOCATOR = 4, - DISPID_TUNER_CT_CATEGORY = 1, - DISPID_TUNER_CT_MEDIAMAJORTYPE = 2, - DISPID_TUNER_CT__MEDIAMAJORTYPE = 3, - DISPID_TUNER_CT_MEDIASUBTYPE = 4, - DISPID_TUNER_CT__MEDIASUBTYPE = 5, - DISPID_TUNER_CT_MEDIAFORMATTYPE = 6, - DISPID_TUNER_CT__MEDIAFORMATTYPE = 7, - DISPID_TUNER_CT_MEDIATYPE = 8, - DISPID_TUNER_CT_CLONE = 9, - DISPID_TUNER_LCT_LANGID = 100, - DISPID_TUNER_MP2CT_TYPE = 200, - DISPID_TUNER_ATSCCT_FLAGS = 300, - DISPID_TUNER_L_CARRFREQ = 1, - DISPID_TUNER_L_INNERFECMETHOD = 2, - DISPID_TUNER_L_INNERFECRATE = 3, - DISPID_TUNER_L_OUTERFECMETHOD = 4, - DISPID_TUNER_L_OUTERFECRATE = 5, - DISPID_TUNER_L_MOD = 6, - DISPID_TUNER_L_SYMRATE = 7, - DISPID_TUNER_L_CLONE = 8, - DISPID_TUNER_L_ATSC_PHYS_CHANNEL = 201, - DISPID_TUNER_L_ATSC_TSID = 202, - DISPID_TUNER_L_DVBT_BANDWIDTH = 301, - DISPID_TUNER_L_DVBT_LPINNERFECMETHOD = 302, - DISPID_TUNER_L_DVBT_LPINNERFECRATE = 303, - DISPID_TUNER_L_DVBT_GUARDINTERVAL = 304, - DISPID_TUNER_L_DVBT_HALPHA = 305, - DISPID_TUNER_L_DVBT_TRANSMISSIONMODE = 306, - DISPID_TUNER_L_DVBT_INUSE = 307, - DISPID_TUNER_L_DVBS_POLARISATION = 401, - DISPID_TUNER_L_DVBS_WEST = 402, - DISPID_TUNER_L_DVBS_ORBITAL = 403, - DISPID_TUNER_L_DVBS_AZIMUTH = 404, - DISPID_TUNER_L_DVBS_ELEVATION = 405, - DISPID_TUNER_C_TYPE = 1, - DISPID_TUNER_C_STATUS = 2, - DISPID_TUNER_C_LANGID = 3, - DISPID_TUNER_C_DESCRIPTION = 4, - DISPID_TUNER_C_CLONE = 5, - DISPID_TUNER_C_MP2_PID = 101, - DISPID_TUNER_C_MP2_PCRPID = 102, - DISPID_TUNER_C_MP2_PROGNO = 103, - DISPID_TUNER_TS_DVB_SYSTEMTYPE = 101, - DISPID_TUNER_TS_DVB2_NETWORK_ID = 102, - DISPID_TUNER_TS_DVBS_LOW_OSC_FREQ = 1001, - DISPID_TUNER_TS_DVBS_HI_OSC_FREQ = 1002, - DISPID_TUNER_TS_DVBS_LNB_SWITCH_FREQ = 1003, - DISPID_TUNER_TS_DVBS_INPUT_RANGE = 1004, - DISPID_TUNER_TS_DVBS_SPECTRAL_INVERSION = 1005, - DISPID_TUNER_TS_AR_MINFREQUENCY = 101, - DISPID_TUNER_TS_AR_MAXFREQUENCY = 102, - DISPID_TUNER_TS_AR_STEP = 103, - DISPID_TUNER_TS_ATV_MINCHANNEL = 101, - DISPID_TUNER_TS_ATV_MAXCHANNEL = 102, - DISPID_TUNER_TS_ATV_INPUTTYPE = 103, - DISPID_TUNER_TS_ATV_COUNTRYCODE = 104, - DISPID_TUNER_TS_ATSC_MINMINORCHANNEL = 201, - DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL = 202, - DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL = 203, - DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL = 204, - DISPID_CHTUNER_ATVAC_CHANNEL = 101, - DISPID_CHTUNER_ATVDC_SYSTEM = 101, - DISPID_CHTUNER_ATVDC_CONTENT = 102, - DISPID_CHTUNER_CTR_CHANNEL = 101, - DISPID_CHTUNER_ACTR_MINOR_CHANNEL = 201, - DISPID_DVBTUNER_DVBC_ATTRIBUTESVALID = 101, - DISPID_DVBTUNER_DVBC_PID = 102, - DISPID_DVBTUNER_DVBC_TAG = 103, - DISPID_DVBTUNER_DVBC_COMPONENTTYPE = 104, - DISPID_DVBTUNER_ONID = 101, - DISPID_DVBTUNER_TSID = 102, - DISPID_DVBTUNER_SID = 103, - DISPID_MP2TUNER_TSID = 101, - DISPID_MP2TUNER_PROGNO = 102, - DISPID_MP2TUNERFACTORY_CREATETUNEREQUEST = 1 - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_tuner_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_tuner_0000_v0_0_s_ifspec; - -#ifndef __ITuningSpaces_INTERFACE_DEFINED__ -#define __ITuningSpaces_INTERFACE_DEFINED__ - -/* interface ITuningSpaces */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_ITuningSpaces; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("901284E4-33FE-4b69-8D63-634A596F3756") - ITuningSpaces : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **NewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **NewEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct ITuningSpacesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpaces * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpaces * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpaces * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpaces * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpaces * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpaces * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - ITuningSpaces * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - ITuningSpaces * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - ITuningSpaces * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][restricted][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EnumTuningSpaces )( - ITuningSpaces * This, - /* [retval][out] */ IEnumTuningSpaces **NewEnum); - - END_INTERFACE - } ITuningSpacesVtbl; - - interface ITuningSpaces - { - CONST_VTBL struct ITuningSpacesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ITuningSpaces_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ITuningSpaces_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ITuningSpaces_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ITuningSpaces_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ITuningSpaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ITuningSpaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ITuningSpaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ITuningSpaces_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - -#define ITuningSpaces_get__NewEnum(This,NewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,NewEnum) - -#define ITuningSpaces_get_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> get_Item(This,varIndex,TuningSpace) - -#define ITuningSpaces_get_EnumTuningSpaces(This,NewEnum) \ - (This)->lpVtbl -> get_EnumTuningSpaces(This,NewEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_Count_Proxy( - ITuningSpaces * This, - /* [retval][out] */ long *Count); - - -void __RPC_STUB ITuningSpaces_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get__NewEnum_Proxy( - ITuningSpaces * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - -void __RPC_STUB ITuningSpaces_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_Item_Proxy( - ITuningSpaces * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - -void __RPC_STUB ITuningSpaces_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_EnumTuningSpaces_Proxy( - ITuningSpaces * This, - /* [retval][out] */ IEnumTuningSpaces **NewEnum); - - -void __RPC_STUB ITuningSpaces_get_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ITuningSpaces_INTERFACE_DEFINED__ */ - - -#ifndef __ITuningSpaceContainer_INTERFACE_DEFINED__ -#define __ITuningSpaceContainer_INTERFACE_DEFINED__ - -/* interface ITuningSpaceContainer */ -/* [unique][helpstring][nonextensible][hidden][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_ITuningSpaceContainer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5B692E84-E2F1-11d2-9493-00C04F72D980") - ITuningSpaceContainer : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **NewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_Item( - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID( - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID( - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TuningSpacesForName( - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindID( - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **ppEnum) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_MaxCount( - /* [retval][out] */ long *MaxCount) = 0; - - virtual /* [helpstring][restricted][hidden][propput] */ HRESULT STDMETHODCALLTYPE put_MaxCount( - /* [in] */ long MaxCount) = 0; - - }; - -#else /* C style interface */ - - typedef struct ITuningSpaceContainerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpaceContainer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpaceContainer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpaceContainer * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpaceContainer * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpaceContainer * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpaceContainer * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpaceContainer * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - ITuningSpaceContainer * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Item )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TuningSpacesForCLSID )( - ITuningSpaceContainer * This, - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *_TuningSpacesForCLSID )( - ITuningSpaceContainer * This, - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TuningSpacesForName )( - ITuningSpaceContainer * This, - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FindID )( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][restricted][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EnumTuningSpaces )( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT Index); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxCount )( - ITuningSpaceContainer * This, - /* [retval][out] */ long *MaxCount); - - /* [helpstring][restricted][hidden][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxCount )( - ITuningSpaceContainer * This, - /* [in] */ long MaxCount); - - END_INTERFACE - } ITuningSpaceContainerVtbl; - - interface ITuningSpaceContainer - { - CONST_VTBL struct ITuningSpaceContainerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ITuningSpaceContainer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ITuningSpaceContainer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ITuningSpaceContainer_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ITuningSpaceContainer_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ITuningSpaceContainer_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ITuningSpaceContainer_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ITuningSpaceContainer_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ITuningSpaceContainer_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - -#define ITuningSpaceContainer_get__NewEnum(This,NewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,NewEnum) - -#define ITuningSpaceContainer_get_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> get_Item(This,varIndex,TuningSpace) - -#define ITuningSpaceContainer_put_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> put_Item(This,varIndex,TuningSpace) - -#define ITuningSpaceContainer_TuningSpacesForCLSID(This,SpaceCLSID,NewColl) \ - (This)->lpVtbl -> TuningSpacesForCLSID(This,SpaceCLSID,NewColl) - -#define ITuningSpaceContainer__TuningSpacesForCLSID(This,SpaceCLSID,NewColl) \ - (This)->lpVtbl -> _TuningSpacesForCLSID(This,SpaceCLSID,NewColl) - -#define ITuningSpaceContainer_TuningSpacesForName(This,Name,NewColl) \ - (This)->lpVtbl -> TuningSpacesForName(This,Name,NewColl) - -#define ITuningSpaceContainer_FindID(This,TuningSpace,ID) \ - (This)->lpVtbl -> FindID(This,TuningSpace,ID) - -#define ITuningSpaceContainer_Add(This,TuningSpace,NewIndex) \ - (This)->lpVtbl -> Add(This,TuningSpace,NewIndex) - -#define ITuningSpaceContainer_get_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> get_EnumTuningSpaces(This,ppEnum) - -#define ITuningSpaceContainer_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - -#define ITuningSpaceContainer_get_MaxCount(This,MaxCount) \ - (This)->lpVtbl -> get_MaxCount(This,MaxCount) - -#define ITuningSpaceContainer_put_MaxCount(This,MaxCount) \ - (This)->lpVtbl -> put_MaxCount(This,MaxCount) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_Count_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ long *Count); - - -void __RPC_STUB ITuningSpaceContainer_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get__NewEnum_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - -void __RPC_STUB ITuningSpaceContainer_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_Item_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - -void __RPC_STUB ITuningSpaceContainer_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_put_Item_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace); - - -void __RPC_STUB ITuningSpaceContainer_put_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_TuningSpacesForCLSID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - -void __RPC_STUB ITuningSpaceContainer_TuningSpacesForCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer__TuningSpacesForCLSID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - -void __RPC_STUB ITuningSpaceContainer__TuningSpacesForCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_TuningSpacesForName_Proxy( - ITuningSpaceContainer * This, - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl); - - -void __RPC_STUB ITuningSpaceContainer_TuningSpacesForName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_FindID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID); - - -void __RPC_STUB ITuningSpaceContainer_FindID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_Add_Proxy( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex); - - -void __RPC_STUB ITuningSpaceContainer_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_EnumTuningSpaces_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - -void __RPC_STUB ITuningSpaceContainer_get_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_Remove_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT Index); - - -void __RPC_STUB ITuningSpaceContainer_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_MaxCount_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ long *MaxCount); - - -void __RPC_STUB ITuningSpaceContainer_get_MaxCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_put_MaxCount_Proxy( - ITuningSpaceContainer * This, - /* [in] */ long MaxCount); - - -void __RPC_STUB ITuningSpaceContainer_put_MaxCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ITuningSpaceContainer_INTERFACE_DEFINED__ */ - - -#ifndef __ITuningSpace_INTERFACE_DEFINED__ -#define __ITuningSpace_INTERFACE_DEFINED__ - -/* interface ITuningSpace */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_ITuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("061C6E30-E622-11d2-9493-00C04F72D980") - ITuningSpace : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_UniqueName( - /* [retval][out] */ BSTR *Name) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_UniqueName( - /* [in] */ BSTR Name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FriendlyName( - /* [retval][out] */ BSTR *Name) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FriendlyName( - /* [in] */ BSTR Name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CLSID( - /* [retval][out] */ BSTR *SpaceCLSID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetworkType( - /* [retval][out] */ BSTR *NetworkTypeGuid) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_NetworkType( - /* [in] */ BSTR NetworkTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__NetworkType( - /* [retval][out] */ GUID *NetworkTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__NetworkType( - /* [in] */ REFCLSID NetworkTypeGuid) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateTuneRequest( - /* [retval][out] */ ITuneRequest **TuneRequest) = 0; - - virtual /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE EnumCategoryGUIDs( - /* [retval][out] */ IEnumGUID **ppEnum) = 0; - - virtual /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE EnumDeviceMonikers( - /* [retval][out] */ IEnumMoniker **ppEnum) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultPreferredComponentTypes( - /* [retval][out] */ IComponentTypes **ComponentTypes) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultPreferredComponentTypes( - /* [in] */ IComponentTypes *NewComponentTypes) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrequencyMapping( - /* [retval][out] */ BSTR *pMapping) = 0; - - virtual /* [restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_FrequencyMapping( - BSTR Mapping) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultLocator( - /* [retval][out] */ ILocator **LocatorVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultLocator( - /* [in] */ ILocator *LocatorVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ITuningSpace **NewTS) = 0; - - }; - -#else /* C style interface */ - - typedef struct ITuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - ITuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - ITuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - ITuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - ITuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - ITuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - ITuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - ITuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - ITuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - ITuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - ITuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - ITuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - ITuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - ITuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - ITuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - ITuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - ITuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - ITuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - END_INTERFACE - } ITuningSpaceVtbl; - - interface ITuningSpace - { - CONST_VTBL struct ITuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ITuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ITuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ITuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ITuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ITuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ITuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ITuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ITuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define ITuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define ITuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define ITuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define ITuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define ITuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define ITuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define ITuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define ITuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define ITuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define ITuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define ITuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define ITuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define ITuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define ITuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define ITuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define ITuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define ITuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define ITuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_UniqueName_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - -void __RPC_STUB ITuningSpace_get_UniqueName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_UniqueName_Proxy( - ITuningSpace * This, - /* [in] */ BSTR Name); - - -void __RPC_STUB ITuningSpace_put_UniqueName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_FriendlyName_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - -void __RPC_STUB ITuningSpace_get_FriendlyName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_FriendlyName_Proxy( - ITuningSpace * This, - /* [in] */ BSTR Name); - - -void __RPC_STUB ITuningSpace_put_FriendlyName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_CLSID_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - -void __RPC_STUB ITuningSpace_get_CLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_NetworkType_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - -void __RPC_STUB ITuningSpace_get_NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_NetworkType_Proxy( - ITuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - -void __RPC_STUB ITuningSpace_put_NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get__NetworkType_Proxy( - ITuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - -void __RPC_STUB ITuningSpace_get__NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put__NetworkType_Proxy( - ITuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - -void __RPC_STUB ITuningSpace_put__NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_CreateTuneRequest_Proxy( - ITuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - -void __RPC_STUB ITuningSpace_CreateTuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_EnumCategoryGUIDs_Proxy( - ITuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - -void __RPC_STUB ITuningSpace_EnumCategoryGUIDs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_EnumDeviceMonikers_Proxy( - ITuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - -void __RPC_STUB ITuningSpace_EnumDeviceMonikers_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_DefaultPreferredComponentTypes_Proxy( - ITuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - -void __RPC_STUB ITuningSpace_get_DefaultPreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_DefaultPreferredComponentTypes_Proxy( - ITuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - -void __RPC_STUB ITuningSpace_put_DefaultPreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_FrequencyMapping_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - -void __RPC_STUB ITuningSpace_get_FrequencyMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_FrequencyMapping_Proxy( - ITuningSpace * This, - BSTR Mapping); - - -void __RPC_STUB ITuningSpace_put_FrequencyMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_DefaultLocator_Proxy( - ITuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - -void __RPC_STUB ITuningSpace_get_DefaultLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_DefaultLocator_Proxy( - ITuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - -void __RPC_STUB ITuningSpace_put_DefaultLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ITuningSpace_Clone_Proxy( - ITuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - -void __RPC_STUB ITuningSpace_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ITuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumTuningSpaces_INTERFACE_DEFINED__ -#define __IEnumTuningSpaces_INTERFACE_DEFINED__ - -/* interface IEnumTuningSpaces */ -/* [unique][uuid][object][restricted][hidden] */ - - -EXTERN_C const IID IID_IEnumTuningSpaces; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8B8EB248-FC2B-11d2-9D8C-00C04F72D980") - IEnumTuningSpaces : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumTuningSpaces **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumTuningSpacesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumTuningSpaces * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumTuningSpaces * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumTuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumTuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumTuningSpaces * This, - /* [out] */ IEnumTuningSpaces **ppEnum); - - END_INTERFACE - } IEnumTuningSpacesVtbl; - - interface IEnumTuningSpaces - { - CONST_VTBL struct IEnumTuningSpacesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumTuningSpaces_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumTuningSpaces_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumTuningSpaces_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumTuningSpaces_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - -#define IEnumTuningSpaces_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - -#define IEnumTuningSpaces_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumTuningSpaces_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Next_Proxy( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched); - - -void __RPC_STUB IEnumTuningSpaces_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Skip_Proxy( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt); - - -void __RPC_STUB IEnumTuningSpaces_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Reset_Proxy( - IEnumTuningSpaces * This); - - -void __RPC_STUB IEnumTuningSpaces_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Clone_Proxy( - IEnumTuningSpaces * This, - /* [out] */ IEnumTuningSpaces **ppEnum); - - -void __RPC_STUB IEnumTuningSpaces_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumTuningSpaces_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBTuningSpace_INTERFACE_DEFINED__ -#define __IDVBTuningSpace_INTERFACE_DEFINED__ - -/* interface IDVBTuningSpace */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBTuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ADA0B268-3B19-4e5b-ACC4-49F852BE13BA") - IDVBTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SystemType( - /* [retval][out] */ DVBSystemType *SysType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SystemType( - /* [in] */ DVBSystemType SysType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IDVBTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IDVBTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IDVBTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IDVBTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IDVBTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IDVBTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IDVBTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IDVBTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IDVBTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IDVBTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IDVBTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IDVBTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IDVBTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SystemType )( - IDVBTuningSpace * This, - /* [retval][out] */ DVBSystemType *SysType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SystemType )( - IDVBTuningSpace * This, - /* [in] */ DVBSystemType SysType); - - END_INTERFACE - } IDVBTuningSpaceVtbl; - - interface IDVBTuningSpace - { - CONST_VTBL struct IDVBTuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IDVBTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IDVBTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IDVBTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IDVBTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IDVBTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IDVBTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IDVBTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IDVBTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IDVBTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IDVBTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IDVBTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IDVBTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IDVBTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IDVBTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IDVBTuningSpace_get_SystemType(This,SysType) \ - (This)->lpVtbl -> get_SystemType(This,SysType) - -#define IDVBTuningSpace_put_SystemType(This,SysType) \ - (This)->lpVtbl -> put_SystemType(This,SysType) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace_get_SystemType_Proxy( - IDVBTuningSpace * This, - /* [retval][out] */ DVBSystemType *SysType); - - -void __RPC_STUB IDVBTuningSpace_get_SystemType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace_put_SystemType_Proxy( - IDVBTuningSpace * This, - /* [in] */ DVBSystemType SysType); - - -void __RPC_STUB IDVBTuningSpace_put_SystemType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBTuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBTuningSpace2_INTERFACE_DEFINED__ -#define __IDVBTuningSpace2_INTERFACE_DEFINED__ - -/* interface IDVBTuningSpace2 */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBTuningSpace2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("843188B4-CE62-43db-966B-8145A094E040") - IDVBTuningSpace2 : public IDVBTuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetworkID( - /* [retval][out] */ long *NetworkID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_NetworkID( - /* [in] */ long NetworkID) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBTuningSpace2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTuningSpace2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTuningSpace2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTuningSpace2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTuningSpace2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTuningSpace2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTuningSpace2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTuningSpace2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IDVBTuningSpace2 * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IDVBTuningSpace2 * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IDVBTuningSpace2 * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IDVBTuningSpace2 * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IDVBTuningSpace2 * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IDVBTuningSpace2 * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IDVBTuningSpace2 * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IDVBTuningSpace2 * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IDVBTuningSpace2 * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IDVBTuningSpace2 * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IDVBTuningSpace2 * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IDVBTuningSpace2 * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IDVBTuningSpace2 * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IDVBTuningSpace2 * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IDVBTuningSpace2 * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IDVBTuningSpace2 * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IDVBTuningSpace2 * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IDVBTuningSpace2 * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTuningSpace2 * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SystemType )( - IDVBTuningSpace2 * This, - /* [retval][out] */ DVBSystemType *SysType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SystemType )( - IDVBTuningSpace2 * This, - /* [in] */ DVBSystemType SysType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkID )( - IDVBTuningSpace2 * This, - /* [retval][out] */ long *NetworkID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkID )( - IDVBTuningSpace2 * This, - /* [in] */ long NetworkID); - - END_INTERFACE - } IDVBTuningSpace2Vtbl; - - interface IDVBTuningSpace2 - { - CONST_VTBL struct IDVBTuningSpace2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBTuningSpace2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBTuningSpace2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBTuningSpace2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBTuningSpace2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBTuningSpace2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBTuningSpace2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBTuningSpace2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBTuningSpace2_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IDVBTuningSpace2_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IDVBTuningSpace2_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IDVBTuningSpace2_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IDVBTuningSpace2_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IDVBTuningSpace2_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace2_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace2_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace2_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IDVBTuningSpace2_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IDVBTuningSpace2_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IDVBTuningSpace2_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IDVBTuningSpace2_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IDVBTuningSpace2_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IDVBTuningSpace2_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IDVBTuningSpace2_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IDVBTuningSpace2_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IDVBTuningSpace2_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IDVBTuningSpace2_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IDVBTuningSpace2_get_SystemType(This,SysType) \ - (This)->lpVtbl -> get_SystemType(This,SysType) - -#define IDVBTuningSpace2_put_SystemType(This,SysType) \ - (This)->lpVtbl -> put_SystemType(This,SysType) - - -#define IDVBTuningSpace2_get_NetworkID(This,NetworkID) \ - (This)->lpVtbl -> get_NetworkID(This,NetworkID) - -#define IDVBTuningSpace2_put_NetworkID(This,NetworkID) \ - (This)->lpVtbl -> put_NetworkID(This,NetworkID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace2_get_NetworkID_Proxy( - IDVBTuningSpace2 * This, - /* [retval][out] */ long *NetworkID); - - -void __RPC_STUB IDVBTuningSpace2_get_NetworkID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace2_put_NetworkID_Proxy( - IDVBTuningSpace2 * This, - /* [in] */ long NetworkID); - - -void __RPC_STUB IDVBTuningSpace2_put_NetworkID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBTuningSpace2_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBSTuningSpace_INTERFACE_DEFINED__ -#define __IDVBSTuningSpace_INTERFACE_DEFINED__ - -/* interface IDVBSTuningSpace */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBSTuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("CDF7BE60-D954-42fd-A972-78971958E470") - IDVBSTuningSpace : public IDVBTuningSpace2 - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LowOscillator( - /* [retval][out] */ long *LowOscillator) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LowOscillator( - /* [in] */ long LowOscillator) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_HighOscillator( - /* [retval][out] */ long *HighOscillator) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_HighOscillator( - /* [in] */ long HighOscillator) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LNBSwitch( - /* [retval][out] */ long *LNBSwitch) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LNBSwitch( - /* [in] */ long LNBSwitch) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InputRange( - /* [retval][out] */ BSTR *InputRange) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InputRange( - /* [in] */ BSTR InputRange) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SpectralInversion( - /* [retval][out] */ SpectralInversion *SpectralInversionVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SpectralInversion( - /* [in] */ SpectralInversion SpectralInversionVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBSTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBSTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBSTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBSTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBSTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBSTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBSTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBSTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IDVBSTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IDVBSTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IDVBSTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IDVBSTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IDVBSTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IDVBSTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IDVBSTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IDVBSTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IDVBSTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IDVBSTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IDVBSTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IDVBSTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IDVBSTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBSTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SystemType )( - IDVBSTuningSpace * This, - /* [retval][out] */ DVBSystemType *SysType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SystemType )( - IDVBSTuningSpace * This, - /* [in] */ DVBSystemType SysType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkID )( - IDVBSTuningSpace * This, - /* [retval][out] */ long *NetworkID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkID )( - IDVBSTuningSpace * This, - /* [in] */ long NetworkID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LowOscillator )( - IDVBSTuningSpace * This, - /* [retval][out] */ long *LowOscillator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LowOscillator )( - IDVBSTuningSpace * This, - /* [in] */ long LowOscillator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_HighOscillator )( - IDVBSTuningSpace * This, - /* [retval][out] */ long *HighOscillator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_HighOscillator )( - IDVBSTuningSpace * This, - /* [in] */ long HighOscillator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LNBSwitch )( - IDVBSTuningSpace * This, - /* [retval][out] */ long *LNBSwitch); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LNBSwitch )( - IDVBSTuningSpace * This, - /* [in] */ long LNBSwitch); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InputRange )( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *InputRange); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InputRange )( - IDVBSTuningSpace * This, - /* [in] */ BSTR InputRange); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SpectralInversion )( - IDVBSTuningSpace * This, - /* [retval][out] */ SpectralInversion *SpectralInversionVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SpectralInversion )( - IDVBSTuningSpace * This, - /* [in] */ SpectralInversion SpectralInversionVal); - - END_INTERFACE - } IDVBSTuningSpaceVtbl; - - interface IDVBSTuningSpace - { - CONST_VTBL struct IDVBSTuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBSTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBSTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBSTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBSTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBSTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBSTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBSTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBSTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IDVBSTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IDVBSTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IDVBSTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IDVBSTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IDVBSTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IDVBSTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IDVBSTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IDVBSTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IDVBSTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IDVBSTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IDVBSTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IDVBSTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IDVBSTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IDVBSTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IDVBSTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IDVBSTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IDVBSTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IDVBSTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IDVBSTuningSpace_get_SystemType(This,SysType) \ - (This)->lpVtbl -> get_SystemType(This,SysType) - -#define IDVBSTuningSpace_put_SystemType(This,SysType) \ - (This)->lpVtbl -> put_SystemType(This,SysType) - - -#define IDVBSTuningSpace_get_NetworkID(This,NetworkID) \ - (This)->lpVtbl -> get_NetworkID(This,NetworkID) - -#define IDVBSTuningSpace_put_NetworkID(This,NetworkID) \ - (This)->lpVtbl -> put_NetworkID(This,NetworkID) - - -#define IDVBSTuningSpace_get_LowOscillator(This,LowOscillator) \ - (This)->lpVtbl -> get_LowOscillator(This,LowOscillator) - -#define IDVBSTuningSpace_put_LowOscillator(This,LowOscillator) \ - (This)->lpVtbl -> put_LowOscillator(This,LowOscillator) - -#define IDVBSTuningSpace_get_HighOscillator(This,HighOscillator) \ - (This)->lpVtbl -> get_HighOscillator(This,HighOscillator) - -#define IDVBSTuningSpace_put_HighOscillator(This,HighOscillator) \ - (This)->lpVtbl -> put_HighOscillator(This,HighOscillator) - -#define IDVBSTuningSpace_get_LNBSwitch(This,LNBSwitch) \ - (This)->lpVtbl -> get_LNBSwitch(This,LNBSwitch) - -#define IDVBSTuningSpace_put_LNBSwitch(This,LNBSwitch) \ - (This)->lpVtbl -> put_LNBSwitch(This,LNBSwitch) - -#define IDVBSTuningSpace_get_InputRange(This,InputRange) \ - (This)->lpVtbl -> get_InputRange(This,InputRange) - -#define IDVBSTuningSpace_put_InputRange(This,InputRange) \ - (This)->lpVtbl -> put_InputRange(This,InputRange) - -#define IDVBSTuningSpace_get_SpectralInversion(This,SpectralInversionVal) \ - (This)->lpVtbl -> get_SpectralInversion(This,SpectralInversionVal) - -#define IDVBSTuningSpace_put_SpectralInversion(This,SpectralInversionVal) \ - (This)->lpVtbl -> put_SpectralInversion(This,SpectralInversionVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_get_LowOscillator_Proxy( - IDVBSTuningSpace * This, - /* [retval][out] */ long *LowOscillator); - - -void __RPC_STUB IDVBSTuningSpace_get_LowOscillator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_put_LowOscillator_Proxy( - IDVBSTuningSpace * This, - /* [in] */ long LowOscillator); - - -void __RPC_STUB IDVBSTuningSpace_put_LowOscillator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_get_HighOscillator_Proxy( - IDVBSTuningSpace * This, - /* [retval][out] */ long *HighOscillator); - - -void __RPC_STUB IDVBSTuningSpace_get_HighOscillator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_put_HighOscillator_Proxy( - IDVBSTuningSpace * This, - /* [in] */ long HighOscillator); - - -void __RPC_STUB IDVBSTuningSpace_put_HighOscillator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_get_LNBSwitch_Proxy( - IDVBSTuningSpace * This, - /* [retval][out] */ long *LNBSwitch); - - -void __RPC_STUB IDVBSTuningSpace_get_LNBSwitch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_put_LNBSwitch_Proxy( - IDVBSTuningSpace * This, - /* [in] */ long LNBSwitch); - - -void __RPC_STUB IDVBSTuningSpace_put_LNBSwitch_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_get_InputRange_Proxy( - IDVBSTuningSpace * This, - /* [retval][out] */ BSTR *InputRange); - - -void __RPC_STUB IDVBSTuningSpace_get_InputRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_put_InputRange_Proxy( - IDVBSTuningSpace * This, - /* [in] */ BSTR InputRange); - - -void __RPC_STUB IDVBSTuningSpace_put_InputRange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_get_SpectralInversion_Proxy( - IDVBSTuningSpace * This, - /* [retval][out] */ SpectralInversion *SpectralInversionVal); - - -void __RPC_STUB IDVBSTuningSpace_get_SpectralInversion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSTuningSpace_put_SpectralInversion_Proxy( - IDVBSTuningSpace * This, - /* [in] */ SpectralInversion SpectralInversionVal); - - -void __RPC_STUB IDVBSTuningSpace_put_SpectralInversion_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBSTuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __IAnalogTVTuningSpace_INTERFACE_DEFINED__ -#define __IAnalogTVTuningSpace_INTERFACE_DEFINED__ - -/* interface IAnalogTVTuningSpace */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IAnalogTVTuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E293C-2595-11d3-B64C-00C04F79498E") - IAnalogTVTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinChannel( - /* [retval][out] */ long *MinChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinChannel( - /* [in] */ long NewMinChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxChannel( - /* [retval][out] */ long *MaxChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxChannel( - /* [in] */ long NewMaxChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InputType( - /* [retval][out] */ TunerInputType *InputTypeVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InputType( - /* [in] */ TunerInputType NewInputTypeVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CountryCode( - /* [retval][out] */ long *CountryCodeVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CountryCode( - /* [in] */ long NewCountryCodeVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAnalogTVTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAnalogTVTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAnalogTVTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAnalogTVTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAnalogTVTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAnalogTVTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAnalogTVTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAnalogTVTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IAnalogTVTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IAnalogTVTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IAnalogTVTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IAnalogTVTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinChannel )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinChannel )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxChannel )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxChannel )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InputType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InputType )( - IAnalogTVTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - END_INTERFACE - } IAnalogTVTuningSpaceVtbl; - - interface IAnalogTVTuningSpace - { - CONST_VTBL struct IAnalogTVTuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAnalogTVTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAnalogTVTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAnalogTVTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAnalogTVTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IAnalogTVTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IAnalogTVTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IAnalogTVTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IAnalogTVTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IAnalogTVTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IAnalogTVTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IAnalogTVTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IAnalogTVTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IAnalogTVTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IAnalogTVTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IAnalogTVTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IAnalogTVTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IAnalogTVTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IAnalogTVTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IAnalogTVTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IAnalogTVTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IAnalogTVTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IAnalogTVTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IAnalogTVTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IAnalogTVTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IAnalogTVTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IAnalogTVTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IAnalogTVTuningSpace_get_MinChannel(This,MinChannelVal) \ - (This)->lpVtbl -> get_MinChannel(This,MinChannelVal) - -#define IAnalogTVTuningSpace_put_MinChannel(This,NewMinChannelVal) \ - (This)->lpVtbl -> put_MinChannel(This,NewMinChannelVal) - -#define IAnalogTVTuningSpace_get_MaxChannel(This,MaxChannelVal) \ - (This)->lpVtbl -> get_MaxChannel(This,MaxChannelVal) - -#define IAnalogTVTuningSpace_put_MaxChannel(This,NewMaxChannelVal) \ - (This)->lpVtbl -> put_MaxChannel(This,NewMaxChannelVal) - -#define IAnalogTVTuningSpace_get_InputType(This,InputTypeVal) \ - (This)->lpVtbl -> get_InputType(This,InputTypeVal) - -#define IAnalogTVTuningSpace_put_InputType(This,NewInputTypeVal) \ - (This)->lpVtbl -> put_InputType(This,NewInputTypeVal) - -#define IAnalogTVTuningSpace_get_CountryCode(This,CountryCodeVal) \ - (This)->lpVtbl -> get_CountryCode(This,CountryCodeVal) - -#define IAnalogTVTuningSpace_put_CountryCode(This,NewCountryCodeVal) \ - (This)->lpVtbl -> put_CountryCode(This,NewCountryCodeVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_MinChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - -void __RPC_STUB IAnalogTVTuningSpace_get_MinChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_MinChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - -void __RPC_STUB IAnalogTVTuningSpace_put_MinChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_MaxChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - -void __RPC_STUB IAnalogTVTuningSpace_get_MaxChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_MaxChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - -void __RPC_STUB IAnalogTVTuningSpace_put_MaxChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_InputType_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - -void __RPC_STUB IAnalogTVTuningSpace_get_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_InputType_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - -void __RPC_STUB IAnalogTVTuningSpace_put_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_CountryCode_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - -void __RPC_STUB IAnalogTVTuningSpace_get_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_CountryCode_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - -void __RPC_STUB IAnalogTVTuningSpace_put_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAnalogTVTuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __IATSCTuningSpace_INTERFACE_DEFINED__ -#define __IATSCTuningSpace_INTERFACE_DEFINED__ - -/* interface IATSCTuningSpace */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IATSCTuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E2-45B6-11d3-B650-00C04F79498E") - IATSCTuningSpace : public IAnalogTVTuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinMinorChannel( - /* [retval][out] */ long *MinMinorChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinMinorChannel( - /* [in] */ long NewMinMinorChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxMinorChannel( - /* [retval][out] */ long *MaxMinorChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxMinorChannel( - /* [in] */ long NewMaxMinorChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinPhysicalChannel( - /* [retval][out] */ long *MinPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinPhysicalChannel( - /* [in] */ long NewMinPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxPhysicalChannel( - /* [retval][out] */ long *MaxPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxPhysicalChannel( - /* [in] */ long NewMaxPhysicalChannelVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IATSCTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IATSCTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IATSCTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IATSCTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IATSCTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IATSCTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IATSCTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IATSCTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IATSCTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IATSCTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IATSCTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IATSCTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IATSCTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IATSCTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InputType )( - IATSCTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InputType )( - IATSCTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IATSCTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IATSCTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinMinorChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinMinorChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinMinorChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinMinorChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxMinorChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxMinorChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxMinorChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxMinorChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinPhysicalChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinPhysicalChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinPhysicalChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinPhysicalChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxPhysicalChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxPhysicalChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxPhysicalChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxPhysicalChannelVal); - - END_INTERFACE - } IATSCTuningSpaceVtbl; - - interface IATSCTuningSpace - { - CONST_VTBL struct IATSCTuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IATSCTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IATSCTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IATSCTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IATSCTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IATSCTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IATSCTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IATSCTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IATSCTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IATSCTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IATSCTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IATSCTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IATSCTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IATSCTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IATSCTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IATSCTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IATSCTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IATSCTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IATSCTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IATSCTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IATSCTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IATSCTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IATSCTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IATSCTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IATSCTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IATSCTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IATSCTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IATSCTuningSpace_get_MinChannel(This,MinChannelVal) \ - (This)->lpVtbl -> get_MinChannel(This,MinChannelVal) - -#define IATSCTuningSpace_put_MinChannel(This,NewMinChannelVal) \ - (This)->lpVtbl -> put_MinChannel(This,NewMinChannelVal) - -#define IATSCTuningSpace_get_MaxChannel(This,MaxChannelVal) \ - (This)->lpVtbl -> get_MaxChannel(This,MaxChannelVal) - -#define IATSCTuningSpace_put_MaxChannel(This,NewMaxChannelVal) \ - (This)->lpVtbl -> put_MaxChannel(This,NewMaxChannelVal) - -#define IATSCTuningSpace_get_InputType(This,InputTypeVal) \ - (This)->lpVtbl -> get_InputType(This,InputTypeVal) - -#define IATSCTuningSpace_put_InputType(This,NewInputTypeVal) \ - (This)->lpVtbl -> put_InputType(This,NewInputTypeVal) - -#define IATSCTuningSpace_get_CountryCode(This,CountryCodeVal) \ - (This)->lpVtbl -> get_CountryCode(This,CountryCodeVal) - -#define IATSCTuningSpace_put_CountryCode(This,NewCountryCodeVal) \ - (This)->lpVtbl -> put_CountryCode(This,NewCountryCodeVal) - - -#define IATSCTuningSpace_get_MinMinorChannel(This,MinMinorChannelVal) \ - (This)->lpVtbl -> get_MinMinorChannel(This,MinMinorChannelVal) - -#define IATSCTuningSpace_put_MinMinorChannel(This,NewMinMinorChannelVal) \ - (This)->lpVtbl -> put_MinMinorChannel(This,NewMinMinorChannelVal) - -#define IATSCTuningSpace_get_MaxMinorChannel(This,MaxMinorChannelVal) \ - (This)->lpVtbl -> get_MaxMinorChannel(This,MaxMinorChannelVal) - -#define IATSCTuningSpace_put_MaxMinorChannel(This,NewMaxMinorChannelVal) \ - (This)->lpVtbl -> put_MaxMinorChannel(This,NewMaxMinorChannelVal) - -#define IATSCTuningSpace_get_MinPhysicalChannel(This,MinPhysicalChannelVal) \ - (This)->lpVtbl -> get_MinPhysicalChannel(This,MinPhysicalChannelVal) - -#define IATSCTuningSpace_put_MinPhysicalChannel(This,NewMinPhysicalChannelVal) \ - (This)->lpVtbl -> put_MinPhysicalChannel(This,NewMinPhysicalChannelVal) - -#define IATSCTuningSpace_get_MaxPhysicalChannel(This,MaxPhysicalChannelVal) \ - (This)->lpVtbl -> get_MaxPhysicalChannel(This,MaxPhysicalChannelVal) - -#define IATSCTuningSpace_put_MaxPhysicalChannel(This,NewMaxPhysicalChannelVal) \ - (This)->lpVtbl -> put_MaxPhysicalChannel(This,NewMaxPhysicalChannelVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MinMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinMinorChannelVal); - - -void __RPC_STUB IATSCTuningSpace_get_MinMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MinMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMinMinorChannelVal); - - -void __RPC_STUB IATSCTuningSpace_put_MinMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MaxMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxMinorChannelVal); - - -void __RPC_STUB IATSCTuningSpace_get_MaxMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MaxMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMaxMinorChannelVal); - - -void __RPC_STUB IATSCTuningSpace_put_MaxMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MinPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinPhysicalChannelVal); - - -void __RPC_STUB IATSCTuningSpace_get_MinPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MinPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMinPhysicalChannelVal); - - -void __RPC_STUB IATSCTuningSpace_put_MinPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MaxPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxPhysicalChannelVal); - - -void __RPC_STUB IATSCTuningSpace_get_MaxPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MaxPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMaxPhysicalChannelVal); - - -void __RPC_STUB IATSCTuningSpace_put_MaxPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IATSCTuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ -#define __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ - -/* interface IAnalogRadioTuningSpace */ -/* [unique][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IAnalogRadioTuningSpace; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E293B-2595-11d3-B64C-00C04F79498E") - IAnalogRadioTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinFrequency( - /* [retval][out] */ long *MinFrequencyVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinFrequency( - /* [in] */ long NewMinFrequencyVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxFrequency( - /* [retval][out] */ long *MaxFrequencyVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxFrequency( - /* [in] */ long NewMaxFrequencyVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Step( - /* [retval][out] */ long *StepVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Step( - /* [in] */ long NewStepVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAnalogRadioTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAnalogRadioTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAnalogRadioTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAnalogRadioTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAnalogRadioTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAnalogRadioTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IAnalogRadioTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IAnalogRadioTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IAnalogRadioTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinFrequency )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MinFrequencyVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinFrequency )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMinFrequencyVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxFrequency )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MaxFrequencyVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxFrequency )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMaxFrequencyVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Step )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *StepVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Step )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewStepVal); - - END_INTERFACE - } IAnalogRadioTuningSpaceVtbl; - - interface IAnalogRadioTuningSpace - { - CONST_VTBL struct IAnalogRadioTuningSpaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAnalogRadioTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAnalogRadioTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAnalogRadioTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAnalogRadioTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IAnalogRadioTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IAnalogRadioTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IAnalogRadioTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IAnalogRadioTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - -#define IAnalogRadioTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - -#define IAnalogRadioTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - -#define IAnalogRadioTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - -#define IAnalogRadioTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - -#define IAnalogRadioTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - -#define IAnalogRadioTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - -#define IAnalogRadioTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - -#define IAnalogRadioTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - -#define IAnalogRadioTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - -#define IAnalogRadioTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - -#define IAnalogRadioTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - -#define IAnalogRadioTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - -#define IAnalogRadioTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - -#define IAnalogRadioTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - -#define IAnalogRadioTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - -#define IAnalogRadioTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - -#define IAnalogRadioTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - -#define IAnalogRadioTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - -#define IAnalogRadioTuningSpace_get_MinFrequency(This,MinFrequencyVal) \ - (This)->lpVtbl -> get_MinFrequency(This,MinFrequencyVal) - -#define IAnalogRadioTuningSpace_put_MinFrequency(This,NewMinFrequencyVal) \ - (This)->lpVtbl -> put_MinFrequency(This,NewMinFrequencyVal) - -#define IAnalogRadioTuningSpace_get_MaxFrequency(This,MaxFrequencyVal) \ - (This)->lpVtbl -> get_MaxFrequency(This,MaxFrequencyVal) - -#define IAnalogRadioTuningSpace_put_MaxFrequency(This,NewMaxFrequencyVal) \ - (This)->lpVtbl -> put_MaxFrequency(This,NewMaxFrequencyVal) - -#define IAnalogRadioTuningSpace_get_Step(This,StepVal) \ - (This)->lpVtbl -> get_Step(This,StepVal) - -#define IAnalogRadioTuningSpace_put_Step(This,NewStepVal) \ - (This)->lpVtbl -> put_Step(This,NewStepVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_MinFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MinFrequencyVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_get_MinFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_MinFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMinFrequencyVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_put_MinFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_MaxFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MaxFrequencyVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_get_MaxFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_MaxFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMaxFrequencyVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_put_MaxFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_Step_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *StepVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_get_Step_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_Step_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewStepVal); - - -void __RPC_STUB IAnalogRadioTuningSpace_put_Step_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ */ - - -#ifndef __ITuneRequest_INTERFACE_DEFINED__ -#define __ITuneRequest_INTERFACE_DEFINED__ - -/* interface ITuneRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_ITuneRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("07DDC146-FC3D-11d2-9D8C-00C04F72D980") - ITuneRequest : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TuningSpace( - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Components( - /* [retval][out] */ IComponents **Components) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ITuneRequest **NewTuneRequest) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Locator( - /* [retval][out] */ ILocator **Locator) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Locator( - /* [in] */ ILocator *Locator) = 0; - - }; - -#else /* C style interface */ - - typedef struct ITuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - ITuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - ITuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ITuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - ITuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - ITuneRequest * This, - /* [in] */ ILocator *Locator); - - END_INTERFACE - } ITuneRequestVtbl; - - interface ITuneRequest - { - CONST_VTBL struct ITuneRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ITuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ITuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ITuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ITuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ITuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ITuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ITuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ITuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define ITuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - -#define ITuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - -#define ITuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - -#define ITuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_TuningSpace_Proxy( - ITuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - -void __RPC_STUB ITuneRequest_get_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_Components_Proxy( - ITuneRequest * This, - /* [retval][out] */ IComponents **Components); - - -void __RPC_STUB ITuneRequest_get_Components_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuneRequest_Clone_Proxy( - ITuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - -void __RPC_STUB ITuneRequest_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_Locator_Proxy( - ITuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - -void __RPC_STUB ITuneRequest_get_Locator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuneRequest_put_Locator_Proxy( - ITuneRequest * This, - /* [in] */ ILocator *Locator); - - -void __RPC_STUB ITuneRequest_put_Locator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ITuneRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IChannelTuneRequest_INTERFACE_DEFINED__ -#define __IChannelTuneRequest_INTERFACE_DEFINED__ - -/* interface IChannelTuneRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IChannelTuneRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E0-45B6-11d3-B650-00C04F79498E") - IChannelTuneRequest : public ITuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Channel( - /* [retval][out] */ long *Channel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Channel( - /* [in] */ long Channel) = 0; - - }; - -#else /* C style interface */ - - typedef struct IChannelTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IChannelTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IChannelTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IChannelTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IChannelTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IChannelTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IChannelTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IChannelTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IChannelTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IChannelTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IChannelTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IChannelTuneRequest * This, - /* [in] */ long Channel); - - END_INTERFACE - } IChannelTuneRequestVtbl; - - interface IChannelTuneRequest - { - CONST_VTBL struct IChannelTuneRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IChannelTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IChannelTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IChannelTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IChannelTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IChannelTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IChannelTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IChannelTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IChannelTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define IChannelTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - -#define IChannelTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - -#define IChannelTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - -#define IChannelTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - -#define IChannelTuneRequest_get_Channel(This,Channel) \ - (This)->lpVtbl -> get_Channel(This,Channel) - -#define IChannelTuneRequest_put_Channel(This,Channel) \ - (This)->lpVtbl -> put_Channel(This,Channel) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IChannelTuneRequest_get_Channel_Proxy( - IChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - -void __RPC_STUB IChannelTuneRequest_get_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IChannelTuneRequest_put_Channel_Proxy( - IChannelTuneRequest * This, - /* [in] */ long Channel); - - -void __RPC_STUB IChannelTuneRequest_put_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IChannelTuneRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IATSCChannelTuneRequest_INTERFACE_DEFINED__ -#define __IATSCChannelTuneRequest_INTERFACE_DEFINED__ - -/* interface IATSCChannelTuneRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IATSCChannelTuneRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E1-45B6-11d3-B650-00C04F79498E") - IATSCChannelTuneRequest : public IChannelTuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinorChannel( - /* [retval][out] */ long *MinorChannel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinorChannel( - /* [in] */ long MinorChannel) = 0; - - }; - -#else /* C style interface */ - - typedef struct IATSCChannelTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCChannelTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCChannelTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCChannelTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCChannelTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCChannelTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IATSCChannelTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IATSCChannelTuneRequest * This, - /* [in] */ long Channel); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinorChannel )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *MinorChannel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinorChannel )( - IATSCChannelTuneRequest * This, - /* [in] */ long MinorChannel); - - END_INTERFACE - } IATSCChannelTuneRequestVtbl; - - interface IATSCChannelTuneRequest - { - CONST_VTBL struct IATSCChannelTuneRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IATSCChannelTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IATSCChannelTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IATSCChannelTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IATSCChannelTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IATSCChannelTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IATSCChannelTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IATSCChannelTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IATSCChannelTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define IATSCChannelTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - -#define IATSCChannelTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - -#define IATSCChannelTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - -#define IATSCChannelTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - -#define IATSCChannelTuneRequest_get_Channel(This,Channel) \ - (This)->lpVtbl -> get_Channel(This,Channel) - -#define IATSCChannelTuneRequest_put_Channel(This,Channel) \ - (This)->lpVtbl -> put_Channel(This,Channel) - - -#define IATSCChannelTuneRequest_get_MinorChannel(This,MinorChannel) \ - (This)->lpVtbl -> get_MinorChannel(This,MinorChannel) - -#define IATSCChannelTuneRequest_put_MinorChannel(This,MinorChannel) \ - (This)->lpVtbl -> put_MinorChannel(This,MinorChannel) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCChannelTuneRequest_get_MinorChannel_Proxy( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *MinorChannel); - - -void __RPC_STUB IATSCChannelTuneRequest_get_MinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCChannelTuneRequest_put_MinorChannel_Proxy( - IATSCChannelTuneRequest * This, - /* [in] */ long MinorChannel); - - -void __RPC_STUB IATSCChannelTuneRequest_put_MinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IATSCChannelTuneRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBTuneRequest_INTERFACE_DEFINED__ -#define __IDVBTuneRequest_INTERFACE_DEFINED__ - -/* interface IDVBTuneRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IDVBTuneRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0D6F567E-A636-42bb-83BA-CE4C1704AFA2") - IDVBTuneRequest : public ITuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ONID( - /* [retval][out] */ long *ONID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ONID( - /* [in] */ long ONID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TSID( - /* [retval][out] */ long *TSID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TSID( - /* [in] */ long TSID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SID( - /* [retval][out] */ long *SID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SID( - /* [in] */ long SID) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IDVBTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IDVBTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IDVBTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IDVBTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ONID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *ONID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ONID )( - IDVBTuneRequest * This, - /* [in] */ long ONID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TSID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *TSID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TSID )( - IDVBTuneRequest * This, - /* [in] */ long TSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *SID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SID )( - IDVBTuneRequest * This, - /* [in] */ long SID); - - END_INTERFACE - } IDVBTuneRequestVtbl; - - interface IDVBTuneRequest - { - CONST_VTBL struct IDVBTuneRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define IDVBTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - -#define IDVBTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - -#define IDVBTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - -#define IDVBTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - -#define IDVBTuneRequest_get_ONID(This,ONID) \ - (This)->lpVtbl -> get_ONID(This,ONID) - -#define IDVBTuneRequest_put_ONID(This,ONID) \ - (This)->lpVtbl -> put_ONID(This,ONID) - -#define IDVBTuneRequest_get_TSID(This,TSID) \ - (This)->lpVtbl -> get_TSID(This,TSID) - -#define IDVBTuneRequest_put_TSID(This,TSID) \ - (This)->lpVtbl -> put_TSID(This,TSID) - -#define IDVBTuneRequest_get_SID(This,SID) \ - (This)->lpVtbl -> get_SID(This,SID) - -#define IDVBTuneRequest_put_SID(This,SID) \ - (This)->lpVtbl -> put_SID(This,SID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_ONID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *ONID); - - -void __RPC_STUB IDVBTuneRequest_get_ONID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_ONID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long ONID); - - -void __RPC_STUB IDVBTuneRequest_put_ONID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_TSID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *TSID); - - -void __RPC_STUB IDVBTuneRequest_get_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_TSID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long TSID); - - -void __RPC_STUB IDVBTuneRequest_put_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_SID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *SID); - - -void __RPC_STUB IDVBTuneRequest_get_SID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_SID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long SID); - - -void __RPC_STUB IDVBTuneRequest_put_SID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBTuneRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequest_INTERFACE_DEFINED__ -#define __IMPEG2TuneRequest_INTERFACE_DEFINED__ - -/* interface IMPEG2TuneRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IMPEG2TuneRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EB7D987F-8A01-42ad-B8AE-574DEEE44D1A") - IMPEG2TuneRequest : public ITuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TSID( - /* [retval][out] */ long *TSID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TSID( - /* [in] */ long TSID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ProgNo( - /* [retval][out] */ long *ProgNo) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ProgNo( - /* [in] */ long ProgNo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2TuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2TuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2TuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2TuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2TuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2TuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2TuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2TuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IMPEG2TuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IMPEG2TuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IMPEG2TuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IMPEG2TuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IMPEG2TuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TSID )( - IMPEG2TuneRequest * This, - /* [retval][out] */ long *TSID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TSID )( - IMPEG2TuneRequest * This, - /* [in] */ long TSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ProgNo )( - IMPEG2TuneRequest * This, - /* [retval][out] */ long *ProgNo); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ProgNo )( - IMPEG2TuneRequest * This, - /* [in] */ long ProgNo); - - END_INTERFACE - } IMPEG2TuneRequestVtbl; - - interface IMPEG2TuneRequest - { - CONST_VTBL struct IMPEG2TuneRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2TuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2TuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2TuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2TuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMPEG2TuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMPEG2TuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMPEG2TuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMPEG2TuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define IMPEG2TuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - -#define IMPEG2TuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - -#define IMPEG2TuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - -#define IMPEG2TuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - -#define IMPEG2TuneRequest_get_TSID(This,TSID) \ - (This)->lpVtbl -> get_TSID(This,TSID) - -#define IMPEG2TuneRequest_put_TSID(This,TSID) \ - (This)->lpVtbl -> put_TSID(This,TSID) - -#define IMPEG2TuneRequest_get_ProgNo(This,ProgNo) \ - (This)->lpVtbl -> get_ProgNo(This,ProgNo) - -#define IMPEG2TuneRequest_put_ProgNo(This,ProgNo) \ - (This)->lpVtbl -> put_ProgNo(This,ProgNo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2TuneRequest_get_TSID_Proxy( - IMPEG2TuneRequest * This, - /* [retval][out] */ long *TSID); - - -void __RPC_STUB IMPEG2TuneRequest_get_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2TuneRequest_put_TSID_Proxy( - IMPEG2TuneRequest * This, - /* [in] */ long TSID); - - -void __RPC_STUB IMPEG2TuneRequest_put_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2TuneRequest_get_ProgNo_Proxy( - IMPEG2TuneRequest * This, - /* [retval][out] */ long *ProgNo); - - -void __RPC_STUB IMPEG2TuneRequest_get_ProgNo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2TuneRequest_put_ProgNo_Proxy( - IMPEG2TuneRequest * This, - /* [in] */ long ProgNo); - - -void __RPC_STUB IMPEG2TuneRequest_put_ProgNo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2TuneRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequestFactory_INTERFACE_DEFINED__ -#define __IMPEG2TuneRequestFactory_INTERFACE_DEFINED__ - -/* interface IMPEG2TuneRequestFactory */ -/* [unique][helpstring][oleautomation][dual][uuid][hidden][nonextensible][object] */ - - -EXTERN_C const IID IID_IMPEG2TuneRequestFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("14E11ABD-EE37-4893-9EA1-6964DE933E39") - IMPEG2TuneRequestFactory : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateTuneRequest( - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ IMPEG2TuneRequest **TuneRequest) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2TuneRequestFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2TuneRequestFactory * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2TuneRequestFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2TuneRequestFactory * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2TuneRequestFactory * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2TuneRequestFactory * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2TuneRequestFactory * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2TuneRequestFactory * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IMPEG2TuneRequestFactory * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ IMPEG2TuneRequest **TuneRequest); - - END_INTERFACE - } IMPEG2TuneRequestFactoryVtbl; - - interface IMPEG2TuneRequestFactory - { - CONST_VTBL struct IMPEG2TuneRequestFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2TuneRequestFactory_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2TuneRequestFactory_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2TuneRequestFactory_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2TuneRequestFactory_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMPEG2TuneRequestFactory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMPEG2TuneRequestFactory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMPEG2TuneRequestFactory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMPEG2TuneRequestFactory_CreateTuneRequest(This,TuningSpace,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuningSpace,TuneRequest) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMPEG2TuneRequestFactory_CreateTuneRequest_Proxy( - IMPEG2TuneRequestFactory * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ IMPEG2TuneRequest **TuneRequest); - - -void __RPC_STUB IMPEG2TuneRequestFactory_CreateTuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2TuneRequestFactory_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2TuneRequestSupport_INTERFACE_DEFINED__ -#define __IMPEG2TuneRequestSupport_INTERFACE_DEFINED__ - -/* interface IMPEG2TuneRequestSupport */ -/* [unique][helpstring][uuid][nonextensible][restricted][hidden][object] */ - - -EXTERN_C const IID IID_IMPEG2TuneRequestSupport; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1B9D5FC3-5BBC-4b6c-BB18-B9D10E3EEEBF") - IMPEG2TuneRequestSupport : public IUnknown - { - public: - }; - -#else /* C style interface */ - - typedef struct IMPEG2TuneRequestSupportVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2TuneRequestSupport * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2TuneRequestSupport * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2TuneRequestSupport * This); - - END_INTERFACE - } IMPEG2TuneRequestSupportVtbl; - - interface IMPEG2TuneRequestSupport - { - CONST_VTBL struct IMPEG2TuneRequestSupportVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2TuneRequestSupport_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2TuneRequestSupport_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2TuneRequestSupport_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IMPEG2TuneRequestSupport_INTERFACE_DEFINED__ */ - - -#ifndef __ITuner_INTERFACE_DEFINED__ -#define __ITuner_INTERFACE_DEFINED__ - -/* interface ITuner */ -/* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_ITuner; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("28C52640-018A-11d3-9D8E-00C04F72D980") - ITuner : public IUnknown - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_TuningSpace( - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_TuningSpace( - /* [in] */ ITuningSpace *TuningSpace) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **ppEnum) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_TuneRequest( - /* [retval][out] */ ITuneRequest **TuneRequest) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_TuneRequest( - /* [in] */ ITuneRequest *TuneRequest) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Validate( - /* [in] */ ITuneRequest *TuneRequest) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PreferredComponentTypes( - /* [retval][out] */ IComponentTypes **ComponentTypes) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_PreferredComponentTypes( - /* [in] */ IComponentTypes *ComponentTypes) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_SignalStrength( - /* [retval][out] */ long *Strength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TriggerSignalEvents( - /* [in] */ long Interval) = 0; - - }; - -#else /* C style interface */ - - typedef struct ITunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuner * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - ITuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - ITuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumTuningSpaces )( - ITuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuneRequest )( - ITuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuneRequest )( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Validate )( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreferredComponentTypes )( - ITuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PreferredComponentTypes )( - ITuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalStrength )( - ITuner * This, - /* [retval][out] */ long *Strength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TriggerSignalEvents )( - ITuner * This, - /* [in] */ long Interval); - - END_INTERFACE - } ITunerVtbl; - - interface ITuner - { - CONST_VTBL struct ITunerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ITuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ITuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ITuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ITuner_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define ITuner_put_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,TuningSpace) - -#define ITuner_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> EnumTuningSpaces(This,ppEnum) - -#define ITuner_get_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> get_TuneRequest(This,TuneRequest) - -#define ITuner_put_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> put_TuneRequest(This,TuneRequest) - -#define ITuner_Validate(This,TuneRequest) \ - (This)->lpVtbl -> Validate(This,TuneRequest) - -#define ITuner_get_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_PreferredComponentTypes(This,ComponentTypes) - -#define ITuner_put_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> put_PreferredComponentTypes(This,ComponentTypes) - -#define ITuner_get_SignalStrength(This,Strength) \ - (This)->lpVtbl -> get_SignalStrength(This,Strength) - -#define ITuner_TriggerSignalEvents(This,Interval) \ - (This)->lpVtbl -> TriggerSignalEvents(This,Interval) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_TuningSpace_Proxy( - ITuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - -void __RPC_STUB ITuner_get_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_TuningSpace_Proxy( - ITuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - -void __RPC_STUB ITuner_put_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE ITuner_EnumTuningSpaces_Proxy( - ITuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - -void __RPC_STUB ITuner_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_TuneRequest_Proxy( - ITuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - -void __RPC_STUB ITuner_get_TuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_TuneRequest_Proxy( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - -void __RPC_STUB ITuner_put_TuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuner_Validate_Proxy( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - -void __RPC_STUB ITuner_Validate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_PreferredComponentTypes_Proxy( - ITuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - -void __RPC_STUB ITuner_get_PreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_PreferredComponentTypes_Proxy( - ITuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - -void __RPC_STUB ITuner_put_PreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_SignalStrength_Proxy( - ITuner * This, - /* [retval][out] */ long *Strength); - - -void __RPC_STUB ITuner_get_SignalStrength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuner_TriggerSignalEvents_Proxy( - ITuner * This, - /* [in] */ long Interval); - - -void __RPC_STUB ITuner_TriggerSignalEvents_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ITuner_INTERFACE_DEFINED__ */ - - -#ifndef __IScanningTuner_INTERFACE_DEFINED__ -#define __IScanningTuner_INTERFACE_DEFINED__ - -/* interface IScanningTuner */ -/* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IScanningTuner; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1DFD0A5C-0284-11d3-9D8E-00C04F72D980") - IScanningTuner : public ITuner - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SeekUp( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SeekDown( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ScanUp( - /* [in] */ long MillisecondsPause) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ScanDown( - /* [in] */ long MillisecondsPause) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AutoProgram( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IScanningTunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IScanningTuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IScanningTuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IScanningTuner * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IScanningTuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - IScanningTuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumTuningSpaces )( - IScanningTuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuneRequest )( - IScanningTuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuneRequest )( - IScanningTuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Validate )( - IScanningTuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreferredComponentTypes )( - IScanningTuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PreferredComponentTypes )( - IScanningTuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalStrength )( - IScanningTuner * This, - /* [retval][out] */ long *Strength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TriggerSignalEvents )( - IScanningTuner * This, - /* [in] */ long Interval); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SeekUp )( - IScanningTuner * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SeekDown )( - IScanningTuner * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ScanUp )( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ScanDown )( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AutoProgram )( - IScanningTuner * This); - - END_INTERFACE - } IScanningTunerVtbl; - - interface IScanningTuner - { - CONST_VTBL struct IScanningTunerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IScanningTuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IScanningTuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IScanningTuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IScanningTuner_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - -#define IScanningTuner_put_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,TuningSpace) - -#define IScanningTuner_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> EnumTuningSpaces(This,ppEnum) - -#define IScanningTuner_get_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> get_TuneRequest(This,TuneRequest) - -#define IScanningTuner_put_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> put_TuneRequest(This,TuneRequest) - -#define IScanningTuner_Validate(This,TuneRequest) \ - (This)->lpVtbl -> Validate(This,TuneRequest) - -#define IScanningTuner_get_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_PreferredComponentTypes(This,ComponentTypes) - -#define IScanningTuner_put_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> put_PreferredComponentTypes(This,ComponentTypes) - -#define IScanningTuner_get_SignalStrength(This,Strength) \ - (This)->lpVtbl -> get_SignalStrength(This,Strength) - -#define IScanningTuner_TriggerSignalEvents(This,Interval) \ - (This)->lpVtbl -> TriggerSignalEvents(This,Interval) - - -#define IScanningTuner_SeekUp(This) \ - (This)->lpVtbl -> SeekUp(This) - -#define IScanningTuner_SeekDown(This) \ - (This)->lpVtbl -> SeekDown(This) - -#define IScanningTuner_ScanUp(This,MillisecondsPause) \ - (This)->lpVtbl -> ScanUp(This,MillisecondsPause) - -#define IScanningTuner_ScanDown(This,MillisecondsPause) \ - (This)->lpVtbl -> ScanDown(This,MillisecondsPause) - -#define IScanningTuner_AutoProgram(This) \ - (This)->lpVtbl -> AutoProgram(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_SeekUp_Proxy( - IScanningTuner * This); - - -void __RPC_STUB IScanningTuner_SeekUp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_SeekDown_Proxy( - IScanningTuner * This); - - -void __RPC_STUB IScanningTuner_SeekDown_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_ScanUp_Proxy( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - -void __RPC_STUB IScanningTuner_ScanUp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_ScanDown_Proxy( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - -void __RPC_STUB IScanningTuner_ScanDown_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_AutoProgram_Proxy( - IScanningTuner * This); - - -void __RPC_STUB IScanningTuner_AutoProgram_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IScanningTuner_INTERFACE_DEFINED__ */ - - -#ifndef __IComponentType_INTERFACE_DEFINED__ -#define __IComponentType_INTERFACE_DEFINED__ - -/* interface IComponentType */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IComponentType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6A340DC0-0311-11d3-9D8E-00C04F72D980") - IComponentType : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Category( - /* [retval][out] */ ComponentCategory *Category) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Category( - /* [in] */ ComponentCategory Category) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaMajorType( - /* [retval][out] */ BSTR *MediaMajorType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaMajorType( - /* [in] */ BSTR MediaMajorType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaMajorType( - /* [retval][out] */ GUID *MediaMajorTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaMajorType( - /* [in] */ REFCLSID MediaMajorTypeGuid) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaSubType( - /* [retval][out] */ BSTR *MediaSubType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaSubType( - /* [in] */ BSTR MediaSubType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaSubType( - /* [retval][out] */ GUID *MediaSubTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaSubType( - /* [in] */ REFCLSID MediaSubTypeGuid) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaFormatType( - /* [retval][out] */ BSTR *MediaFormatType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaFormatType( - /* [in] */ BSTR MediaFormatType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaFormatType( - /* [retval][out] */ GUID *MediaFormatTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaFormatType( - /* [in] */ REFCLSID MediaFormatTypeGuid) = 0; - - virtual /* [helpstring][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaType( - /* [retval][out] */ AM_MEDIA_TYPE *MediaType) = 0; - - virtual /* [helpstring][restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaType( - /* [in] */ AM_MEDIA_TYPE *MediaType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponentType **NewCT) = 0; - - }; - -#else /* C style interface */ - - typedef struct IComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - END_INTERFACE - } IComponentTypeVtbl; - - interface IComponentType - { - CONST_VTBL struct IComponentTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - -#define IComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - -#define IComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - -#define IComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - -#define IComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - -#define IComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - -#define IComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - -#define IComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - -#define IComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - -#define IComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - -#define IComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - -#define IComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - -#define IComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - -#define IComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - -#define IComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - -#define IComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - -#define IComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_Category_Proxy( - IComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - -void __RPC_STUB IComponentType_get_Category_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_Category_Proxy( - IComponentType * This, - /* [in] */ ComponentCategory Category); - - -void __RPC_STUB IComponentType_put_Category_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaMajorType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - -void __RPC_STUB IComponentType_get_MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaMajorType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaMajorType); - - -void __RPC_STUB IComponentType_put_MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaMajorType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - -void __RPC_STUB IComponentType_get__MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaMajorType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - -void __RPC_STUB IComponentType_put__MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaSubType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - -void __RPC_STUB IComponentType_get_MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaSubType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaSubType); - - -void __RPC_STUB IComponentType_put_MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaSubType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - -void __RPC_STUB IComponentType_get__MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaSubType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - -void __RPC_STUB IComponentType_put__MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaFormatType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - -void __RPC_STUB IComponentType_get_MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaFormatType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaFormatType); - - -void __RPC_STUB IComponentType_put_MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaFormatType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - -void __RPC_STUB IComponentType_get__MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaFormatType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - -void __RPC_STUB IComponentType_put__MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaType_Proxy( - IComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - -void __RPC_STUB IComponentType_get_MediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaType_Proxy( - IComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - -void __RPC_STUB IComponentType_put_MediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentType_Clone_Proxy( - IComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - -void __RPC_STUB IComponentType_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IComponentType_INTERFACE_DEFINED__ */ - - -#ifndef __ILanguageComponentType_INTERFACE_DEFINED__ -#define __ILanguageComponentType_INTERFACE_DEFINED__ - -/* interface ILanguageComponentType */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_ILanguageComponentType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B874C8BA-0FA2-11d3-9D8E-00C04F72D980") - ILanguageComponentType : public IComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LangID( - /* [retval][out] */ long *LangID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LangID( - /* [in] */ long LangID) = 0; - - }; - -#else /* C style interface */ - - typedef struct ILanguageComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ILanguageComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ILanguageComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ILanguageComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ILanguageComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ILanguageComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ILanguageComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ILanguageComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - ILanguageComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - ILanguageComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - ILanguageComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - ILanguageComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ILanguageComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - ILanguageComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - ILanguageComponentType * This, - /* [in] */ long LangID); - - END_INTERFACE - } ILanguageComponentTypeVtbl; - - interface ILanguageComponentType - { - CONST_VTBL struct ILanguageComponentTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ILanguageComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ILanguageComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ILanguageComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ILanguageComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ILanguageComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ILanguageComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ILanguageComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ILanguageComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - -#define ILanguageComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - -#define ILanguageComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - -#define ILanguageComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - -#define ILanguageComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - -#define ILanguageComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - -#define ILanguageComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - -#define ILanguageComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - -#define ILanguageComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - -#define ILanguageComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - -#define ILanguageComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - -#define ILanguageComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - -#define ILanguageComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - -#define ILanguageComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - -#define ILanguageComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - -#define ILanguageComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - -#define ILanguageComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - -#define ILanguageComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - -#define ILanguageComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILanguageComponentType_get_LangID_Proxy( - ILanguageComponentType * This, - /* [retval][out] */ long *LangID); - - -void __RPC_STUB ILanguageComponentType_get_LangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILanguageComponentType_put_LangID_Proxy( - ILanguageComponentType * This, - /* [in] */ long LangID); - - -void __RPC_STUB ILanguageComponentType_put_LangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ILanguageComponentType_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2ComponentType_INTERFACE_DEFINED__ -#define __IMPEG2ComponentType_INTERFACE_DEFINED__ - -/* interface IMPEG2ComponentType */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IMPEG2ComponentType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2C073D84-B51C-48c9-AA9F-68971E1F6E38") - IMPEG2ComponentType : public ILanguageComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( - /* [retval][out] */ MPEG2StreamType *MP2StreamType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StreamType( - /* [in] */ MPEG2StreamType MP2StreamType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2ComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2ComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2ComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2ComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2ComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2ComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2ComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2ComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IMPEG2ComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IMPEG2ComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IMPEG2ComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IMPEG2ComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IMPEG2ComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - IMPEG2ComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - IMPEG2ComponentType * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IMPEG2ComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StreamType )( - IMPEG2ComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - END_INTERFACE - } IMPEG2ComponentTypeVtbl; - - interface IMPEG2ComponentType - { - CONST_VTBL struct IMPEG2ComponentTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2ComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2ComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2ComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2ComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMPEG2ComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMPEG2ComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMPEG2ComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMPEG2ComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - -#define IMPEG2ComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - -#define IMPEG2ComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - -#define IMPEG2ComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - -#define IMPEG2ComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - -#define IMPEG2ComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - -#define IMPEG2ComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - -#define IMPEG2ComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - -#define IMPEG2ComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - -#define IMPEG2ComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - -#define IMPEG2ComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - -#define IMPEG2ComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - -#define IMPEG2ComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - -#define IMPEG2ComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - -#define IMPEG2ComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - -#define IMPEG2ComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - -#define IMPEG2ComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - -#define IMPEG2ComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - -#define IMPEG2ComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - - -#define IMPEG2ComponentType_get_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> get_StreamType(This,MP2StreamType) - -#define IMPEG2ComponentType_put_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> put_StreamType(This,MP2StreamType) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2ComponentType_get_StreamType_Proxy( - IMPEG2ComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - -void __RPC_STUB IMPEG2ComponentType_get_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2ComponentType_put_StreamType_Proxy( - IMPEG2ComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - -void __RPC_STUB IMPEG2ComponentType_put_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2ComponentType_INTERFACE_DEFINED__ */ - - -#ifndef __IATSCComponentType_INTERFACE_DEFINED__ -#define __IATSCComponentType_INTERFACE_DEFINED__ - -/* interface IATSCComponentType */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IATSCComponentType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FC189E4D-7BD4-4125-B3B3-3A76A332CC96") - IATSCComponentType : public IMPEG2ComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Flags( - /* [retval][out] */ long *Flags) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Flags( - /* [in] */ long flags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IATSCComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IATSCComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IATSCComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IATSCComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IATSCComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - IATSCComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - IATSCComponentType * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IATSCComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StreamType )( - IATSCComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Flags )( - IATSCComponentType * This, - /* [retval][out] */ long *Flags); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Flags )( - IATSCComponentType * This, - /* [in] */ long flags); - - END_INTERFACE - } IATSCComponentTypeVtbl; - - interface IATSCComponentType - { - CONST_VTBL struct IATSCComponentTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IATSCComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IATSCComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IATSCComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IATSCComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IATSCComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IATSCComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IATSCComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IATSCComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - -#define IATSCComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - -#define IATSCComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - -#define IATSCComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - -#define IATSCComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - -#define IATSCComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - -#define IATSCComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - -#define IATSCComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - -#define IATSCComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - -#define IATSCComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - -#define IATSCComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - -#define IATSCComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - -#define IATSCComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - -#define IATSCComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - -#define IATSCComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - -#define IATSCComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - -#define IATSCComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - -#define IATSCComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - -#define IATSCComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - - -#define IATSCComponentType_get_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> get_StreamType(This,MP2StreamType) - -#define IATSCComponentType_put_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> put_StreamType(This,MP2StreamType) - - -#define IATSCComponentType_get_Flags(This,Flags) \ - (This)->lpVtbl -> get_Flags(This,Flags) - -#define IATSCComponentType_put_Flags(This,flags) \ - (This)->lpVtbl -> put_Flags(This,flags) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCComponentType_get_Flags_Proxy( - IATSCComponentType * This, - /* [retval][out] */ long *Flags); - - -void __RPC_STUB IATSCComponentType_get_Flags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCComponentType_put_Flags_Proxy( - IATSCComponentType * This, - /* [in] */ long flags); - - -void __RPC_STUB IATSCComponentType_put_Flags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IATSCComponentType_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumComponentTypes_INTERFACE_DEFINED__ -#define __IEnumComponentTypes_INTERFACE_DEFINED__ - -/* interface IEnumComponentTypes */ -/* [unique][uuid][object][restricted][hidden] */ - - -EXTERN_C const IID IID_IEnumComponentTypes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8A674B4A-1F63-11d3-B64C-00C04F79498E") - IEnumComponentTypes : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumComponentTypes **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumComponentTypesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumComponentTypes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumComponentTypes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumComponentTypes * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumComponentTypes * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumComponentTypes * This, - /* [out] */ IEnumComponentTypes **ppEnum); - - END_INTERFACE - } IEnumComponentTypesVtbl; - - interface IEnumComponentTypes - { - CONST_VTBL struct IEnumComponentTypesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumComponentTypes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumComponentTypes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumComponentTypes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumComponentTypes_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - -#define IEnumComponentTypes_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - -#define IEnumComponentTypes_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumComponentTypes_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Next_Proxy( - IEnumComponentTypes * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched); - - -void __RPC_STUB IEnumComponentTypes_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Skip_Proxy( - IEnumComponentTypes * This, - /* [in] */ ULONG celt); - - -void __RPC_STUB IEnumComponentTypes_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Reset_Proxy( - IEnumComponentTypes * This); - - -void __RPC_STUB IEnumComponentTypes_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Clone_Proxy( - IEnumComponentTypes * This, - /* [out] */ IEnumComponentTypes **ppEnum); - - -void __RPC_STUB IEnumComponentTypes_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumComponentTypes_INTERFACE_DEFINED__ */ - - -#ifndef __IComponentTypes_INTERFACE_DEFINED__ -#define __IComponentTypes_INTERFACE_DEFINED__ - -/* interface IComponentTypes */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IComponentTypes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0DC13D4A-0313-11d3-9D8E-00C04F72D980") - IComponentTypes : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **ppNewEnum) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumComponentTypes( - /* [retval][out] */ IEnumComponentTypes **ppNewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType) = 0; - - virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_Item( - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponentTypes **NewList) = 0; - - }; - -#else /* C style interface */ - - typedef struct IComponentTypesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponentTypes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponentTypes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponentTypes * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponentTypes * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponentTypes * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponentTypes * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IComponentTypes * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - IComponentTypes * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumComponentTypes )( - IComponentTypes * This, - /* [retval][out] */ IEnumComponentTypes **ppNewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType); - - /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Item )( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - IComponentTypes * This, - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IComponentTypes * This, - /* [in] */ VARIANT Index); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponentTypes * This, - /* [retval][out] */ IComponentTypes **NewList); - - END_INTERFACE - } IComponentTypesVtbl; - - interface IComponentTypes - { - CONST_VTBL struct IComponentTypesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IComponentTypes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IComponentTypes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IComponentTypes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IComponentTypes_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IComponentTypes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IComponentTypes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IComponentTypes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IComponentTypes_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - -#define IComponentTypes_get__NewEnum(This,ppNewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,ppNewEnum) - -#define IComponentTypes_EnumComponentTypes(This,ppNewEnum) \ - (This)->lpVtbl -> EnumComponentTypes(This,ppNewEnum) - -#define IComponentTypes_get_Item(This,Index,ComponentType) \ - (This)->lpVtbl -> get_Item(This,Index,ComponentType) - -#define IComponentTypes_put_Item(This,Index,ComponentType) \ - (This)->lpVtbl -> put_Item(This,Index,ComponentType) - -#define IComponentTypes_Add(This,ComponentType,NewIndex) \ - (This)->lpVtbl -> Add(This,ComponentType,NewIndex) - -#define IComponentTypes_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - -#define IComponentTypes_Clone(This,NewList) \ - (This)->lpVtbl -> Clone(This,NewList) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get_Count_Proxy( - IComponentTypes * This, - /* [retval][out] */ long *Count); - - -void __RPC_STUB IComponentTypes_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get__NewEnum_Proxy( - IComponentTypes * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - -void __RPC_STUB IComponentTypes_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponentTypes_EnumComponentTypes_Proxy( - IComponentTypes * This, - /* [retval][out] */ IEnumComponentTypes **ppNewEnum); - - -void __RPC_STUB IComponentTypes_EnumComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get_Item_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType); - - -void __RPC_STUB IComponentTypes_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_put_Item_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType); - - -void __RPC_STUB IComponentTypes_put_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Add_Proxy( - IComponentTypes * This, - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex); - - -void __RPC_STUB IComponentTypes_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Remove_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index); - - -void __RPC_STUB IComponentTypes_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Clone_Proxy( - IComponentTypes * This, - /* [retval][out] */ IComponentTypes **NewList); - - -void __RPC_STUB IComponentTypes_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IComponentTypes_INTERFACE_DEFINED__ */ - - -#ifndef __IComponent_INTERFACE_DEFINED__ -#define __IComponent_INTERFACE_DEFINED__ - -/* interface IComponent */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IComponent; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1A5576FC-0E19-11d3-9D8E-00C04F72D980") - IComponent : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type( - /* [retval][out] */ IComponentType **CT) = 0; - - virtual /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE put_Type( - /* [in] */ IComponentType *CT) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DescLangID( - /* [retval][out] */ long *LangID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DescLangID( - /* [in] */ long LangID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Status( - /* [retval][out] */ ComponentStatus *Status) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Status( - /* [in] */ ComponentStatus Status) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Description( - /* [retval][out] */ BSTR *Description) = 0; - - virtual /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE put_Description( - /* [in] */ BSTR Description) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponent **NewComponent) = 0; - - }; - -#else /* C style interface */ - - typedef struct IComponentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponent * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponent * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponent * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponent * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponent * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponent * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponent * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( - IComponent * This, - /* [retval][out] */ IComponentType **CT); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( - IComponent * This, - /* [in] */ IComponentType *CT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DescLangID )( - IComponent * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DescLangID )( - IComponent * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( - IComponent * This, - /* [retval][out] */ ComponentStatus *Status); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Status )( - IComponent * This, - /* [in] */ ComponentStatus Status); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )( - IComponent * This, - /* [retval][out] */ BSTR *Description); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Description )( - IComponent * This, - /* [in] */ BSTR Description); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponent * This, - /* [retval][out] */ IComponent **NewComponent); - - END_INTERFACE - } IComponentVtbl; - - interface IComponent - { - CONST_VTBL struct IComponentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IComponent_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IComponent_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IComponent_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IComponent_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IComponent_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IComponent_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IComponent_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IComponent_get_Type(This,CT) \ - (This)->lpVtbl -> get_Type(This,CT) - -#define IComponent_put_Type(This,CT) \ - (This)->lpVtbl -> put_Type(This,CT) - -#define IComponent_get_DescLangID(This,LangID) \ - (This)->lpVtbl -> get_DescLangID(This,LangID) - -#define IComponent_put_DescLangID(This,LangID) \ - (This)->lpVtbl -> put_DescLangID(This,LangID) - -#define IComponent_get_Status(This,Status) \ - (This)->lpVtbl -> get_Status(This,Status) - -#define IComponent_put_Status(This,Status) \ - (This)->lpVtbl -> put_Status(This,Status) - -#define IComponent_get_Description(This,Description) \ - (This)->lpVtbl -> get_Description(This,Description) - -#define IComponent_put_Description(This,Description) \ - (This)->lpVtbl -> put_Description(This,Description) - -#define IComponent_Clone(This,NewComponent) \ - (This)->lpVtbl -> Clone(This,NewComponent) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Type_Proxy( - IComponent * This, - /* [retval][out] */ IComponentType **CT); - - -void __RPC_STUB IComponent_get_Type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponent_put_Type_Proxy( - IComponent * This, - /* [in] */ IComponentType *CT); - - -void __RPC_STUB IComponent_put_Type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_DescLangID_Proxy( - IComponent * This, - /* [retval][out] */ long *LangID); - - -void __RPC_STUB IComponent_get_DescLangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponent_put_DescLangID_Proxy( - IComponent * This, - /* [in] */ long LangID); - - -void __RPC_STUB IComponent_put_DescLangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Status_Proxy( - IComponent * This, - /* [retval][out] */ ComponentStatus *Status); - - -void __RPC_STUB IComponent_get_Status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponent_put_Status_Proxy( - IComponent * This, - /* [in] */ ComponentStatus Status); - - -void __RPC_STUB IComponent_put_Status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Description_Proxy( - IComponent * This, - /* [retval][out] */ BSTR *Description); - - -void __RPC_STUB IComponent_get_Description_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponent_put_Description_Proxy( - IComponent * This, - /* [in] */ BSTR Description); - - -void __RPC_STUB IComponent_put_Description_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponent_Clone_Proxy( - IComponent * This, - /* [retval][out] */ IComponent **NewComponent); - - -void __RPC_STUB IComponent_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IComponent_INTERFACE_DEFINED__ */ - - -#ifndef __IMPEG2Component_INTERFACE_DEFINED__ -#define __IMPEG2Component_INTERFACE_DEFINED__ - -/* interface IMPEG2Component */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IMPEG2Component; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1493E353-1EB6-473c-802D-8E6B8EC9D2A9") - IMPEG2Component : public IComponent - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PID( - /* [retval][out] */ long *PID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PID( - /* [in] */ long PID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PCRPID( - /* [retval][out] */ long *PCRPID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PCRPID( - /* [in] */ long PCRPID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ProgramNumber( - /* [retval][out] */ long *ProgramNumber) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ProgramNumber( - /* [in] */ long ProgramNumber) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMPEG2ComponentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2Component * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2Component * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2Component * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2Component * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2Component * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2Component * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2Component * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( - IMPEG2Component * This, - /* [retval][out] */ IComponentType **CT); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( - IMPEG2Component * This, - /* [in] */ IComponentType *CT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DescLangID )( - IMPEG2Component * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DescLangID )( - IMPEG2Component * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( - IMPEG2Component * This, - /* [retval][out] */ ComponentStatus *Status); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Status )( - IMPEG2Component * This, - /* [in] */ ComponentStatus Status); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )( - IMPEG2Component * This, - /* [retval][out] */ BSTR *Description); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Description )( - IMPEG2Component * This, - /* [in] */ BSTR Description); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IMPEG2Component * This, - /* [retval][out] */ IComponent **NewComponent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PID )( - IMPEG2Component * This, - /* [retval][out] */ long *PID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PID )( - IMPEG2Component * This, - /* [in] */ long PID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PCRPID )( - IMPEG2Component * This, - /* [retval][out] */ long *PCRPID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PCRPID )( - IMPEG2Component * This, - /* [in] */ long PCRPID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ProgramNumber )( - IMPEG2Component * This, - /* [retval][out] */ long *ProgramNumber); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ProgramNumber )( - IMPEG2Component * This, - /* [in] */ long ProgramNumber); - - END_INTERFACE - } IMPEG2ComponentVtbl; - - interface IMPEG2Component - { - CONST_VTBL struct IMPEG2ComponentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMPEG2Component_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMPEG2Component_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMPEG2Component_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMPEG2Component_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMPEG2Component_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMPEG2Component_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMPEG2Component_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMPEG2Component_get_Type(This,CT) \ - (This)->lpVtbl -> get_Type(This,CT) - -#define IMPEG2Component_put_Type(This,CT) \ - (This)->lpVtbl -> put_Type(This,CT) - -#define IMPEG2Component_get_DescLangID(This,LangID) \ - (This)->lpVtbl -> get_DescLangID(This,LangID) - -#define IMPEG2Component_put_DescLangID(This,LangID) \ - (This)->lpVtbl -> put_DescLangID(This,LangID) - -#define IMPEG2Component_get_Status(This,Status) \ - (This)->lpVtbl -> get_Status(This,Status) - -#define IMPEG2Component_put_Status(This,Status) \ - (This)->lpVtbl -> put_Status(This,Status) - -#define IMPEG2Component_get_Description(This,Description) \ - (This)->lpVtbl -> get_Description(This,Description) - -#define IMPEG2Component_put_Description(This,Description) \ - (This)->lpVtbl -> put_Description(This,Description) - -#define IMPEG2Component_Clone(This,NewComponent) \ - (This)->lpVtbl -> Clone(This,NewComponent) - - -#define IMPEG2Component_get_PID(This,PID) \ - (This)->lpVtbl -> get_PID(This,PID) - -#define IMPEG2Component_put_PID(This,PID) \ - (This)->lpVtbl -> put_PID(This,PID) - -#define IMPEG2Component_get_PCRPID(This,PCRPID) \ - (This)->lpVtbl -> get_PCRPID(This,PCRPID) - -#define IMPEG2Component_put_PCRPID(This,PCRPID) \ - (This)->lpVtbl -> put_PCRPID(This,PCRPID) - -#define IMPEG2Component_get_ProgramNumber(This,ProgramNumber) \ - (This)->lpVtbl -> get_ProgramNumber(This,ProgramNumber) - -#define IMPEG2Component_put_ProgramNumber(This,ProgramNumber) \ - (This)->lpVtbl -> put_ProgramNumber(This,ProgramNumber) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_PID_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *PID); - - -void __RPC_STUB IMPEG2Component_get_PID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_PID_Proxy( - IMPEG2Component * This, - /* [in] */ long PID); - - -void __RPC_STUB IMPEG2Component_put_PID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_PCRPID_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *PCRPID); - - -void __RPC_STUB IMPEG2Component_get_PCRPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_PCRPID_Proxy( - IMPEG2Component * This, - /* [in] */ long PCRPID); - - -void __RPC_STUB IMPEG2Component_put_PCRPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_ProgramNumber_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *ProgramNumber); - - -void __RPC_STUB IMPEG2Component_get_ProgramNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_ProgramNumber_Proxy( - IMPEG2Component * This, - /* [in] */ long ProgramNumber); - - -void __RPC_STUB IMPEG2Component_put_ProgramNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMPEG2Component_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumComponents_INTERFACE_DEFINED__ -#define __IEnumComponents_INTERFACE_DEFINED__ - -/* interface IEnumComponents */ -/* [unique][uuid][object][restricted][hidden] */ - - -EXTERN_C const IID IID_IEnumComponents; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E2939-2595-11d3-B64C-00C04F79498E") - IEnumComponents : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumComponents **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumComponentsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumComponents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumComponents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumComponents * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumComponents * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumComponents * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumComponents * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumComponents * This, - /* [out] */ IEnumComponents **ppEnum); - - END_INTERFACE - } IEnumComponentsVtbl; - - interface IEnumComponents - { - CONST_VTBL struct IEnumComponentsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumComponents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IEnumComponents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IEnumComponents_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IEnumComponents_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - -#define IEnumComponents_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - -#define IEnumComponents_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IEnumComponents_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IEnumComponents_Next_Proxy( - IEnumComponents * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched); - - -void __RPC_STUB IEnumComponents_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponents_Skip_Proxy( - IEnumComponents * This, - /* [in] */ ULONG celt); - - -void __RPC_STUB IEnumComponents_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponents_Reset_Proxy( - IEnumComponents * This); - - -void __RPC_STUB IEnumComponents_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IEnumComponents_Clone_Proxy( - IEnumComponents * This, - /* [out] */ IEnumComponents **ppEnum); - - -void __RPC_STUB IEnumComponents_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumComponents_INTERFACE_DEFINED__ */ - - -#ifndef __IComponents_INTERFACE_DEFINED__ -#define __IComponents_INTERFACE_DEFINED__ - -/* interface IComponents */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_IComponents; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FCD01846-0E19-11d3-9D8E-00C04F72D980") - IComponents : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **ppNewEnum) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumComponents( - /* [retval][out] */ IEnumComponents **ppNewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponents **NewList) = 0; - - }; - -#else /* C style interface */ - - typedef struct IComponentsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponents * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponents * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponents * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponents * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IComponents * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - IComponents * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumComponents )( - IComponents * This, - /* [retval][out] */ IEnumComponents **ppNewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - IComponents * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - IComponents * This, - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IComponents * This, - /* [in] */ VARIANT Index); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponents * This, - /* [retval][out] */ IComponents **NewList); - - END_INTERFACE - } IComponentsVtbl; - - interface IComponents - { - CONST_VTBL struct IComponentsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IComponents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IComponents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IComponents_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IComponents_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IComponents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IComponents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IComponents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IComponents_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - -#define IComponents_get__NewEnum(This,ppNewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,ppNewEnum) - -#define IComponents_EnumComponents(This,ppNewEnum) \ - (This)->lpVtbl -> EnumComponents(This,ppNewEnum) - -#define IComponents_get_Item(This,Index,ppComponent) \ - (This)->lpVtbl -> get_Item(This,Index,ppComponent) - -#define IComponents_Add(This,Component,NewIndex) \ - (This)->lpVtbl -> Add(This,Component,NewIndex) - -#define IComponents_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - -#define IComponents_Clone(This,NewList) \ - (This)->lpVtbl -> Clone(This,NewList) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IComponents_get_Count_Proxy( - IComponents * This, - /* [retval][out] */ long *Count); - - -void __RPC_STUB IComponents_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponents_get__NewEnum_Proxy( - IComponents * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - -void __RPC_STUB IComponents_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponents_EnumComponents_Proxy( - IComponents * This, - /* [retval][out] */ IEnumComponents **ppNewEnum); - - -void __RPC_STUB IComponents_EnumComponents_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IComponents_get_Item_Proxy( - IComponents * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent); - - -void __RPC_STUB IComponents_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponents_Add_Proxy( - IComponents * This, - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex); - - -void __RPC_STUB IComponents_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponents_Remove_Proxy( - IComponents * This, - /* [in] */ VARIANT Index); - - -void __RPC_STUB IComponents_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring] */ HRESULT STDMETHODCALLTYPE IComponents_Clone_Proxy( - IComponents * This, - /* [retval][out] */ IComponents **NewList); - - -void __RPC_STUB IComponents_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IComponents_INTERFACE_DEFINED__ */ - - -#ifndef __ILocator_INTERFACE_DEFINED__ -#define __ILocator_INTERFACE_DEFINED__ - -/* interface ILocator */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - -EXTERN_C const IID IID_ILocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("286D7F89-760C-4F89-80C4-66841D2507AA") - ILocator : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CarrierFrequency( - /* [retval][out] */ long *Frequency) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CarrierFrequency( - /* [in] */ long Frequency) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InnerFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InnerFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InnerFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InnerFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OuterFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OuterFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OuterFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OuterFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modulation( - /* [retval][out] */ ModulationType *Modulation) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Modulation( - /* [in] */ ModulationType Modulation) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SymbolRate( - /* [retval][out] */ long *Rate) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SymbolRate( - /* [in] */ long Rate) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ILocator **NewLocator) = 0; - - }; - -#else /* C style interface */ - - typedef struct ILocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ILocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ILocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ILocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ILocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ILocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ILocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ILocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - ILocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - ILocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - ILocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - ILocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - ILocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - ILocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - ILocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - ILocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ILocator * This, - /* [retval][out] */ ILocator **NewLocator); - - END_INTERFACE - } ILocatorVtbl; - - interface ILocator - { - CONST_VTBL struct ILocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ILocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ILocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ILocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ILocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ILocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ILocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ILocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ILocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - -#define ILocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - -#define ILocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - -#define ILocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - -#define ILocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - -#define ILocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - -#define ILocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - -#define ILocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - -#define ILocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - -#define ILocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - -#define ILocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - -#define ILocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - -#define ILocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - -#define ILocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - -#define ILocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_CarrierFrequency_Proxy( - ILocator * This, - /* [retval][out] */ long *Frequency); - - -void __RPC_STUB ILocator_get_CarrierFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_CarrierFrequency_Proxy( - ILocator * This, - /* [in] */ long Frequency); - - -void __RPC_STUB ILocator_put_CarrierFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_InnerFEC_Proxy( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - -void __RPC_STUB ILocator_get_InnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_InnerFEC_Proxy( - ILocator * This, - /* [in] */ FECMethod FEC); - - -void __RPC_STUB ILocator_put_InnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_InnerFECRate_Proxy( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - -void __RPC_STUB ILocator_get_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_InnerFECRate_Proxy( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - -void __RPC_STUB ILocator_put_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_OuterFEC_Proxy( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - -void __RPC_STUB ILocator_get_OuterFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_OuterFEC_Proxy( - ILocator * This, - /* [in] */ FECMethod FEC); - - -void __RPC_STUB ILocator_put_OuterFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_OuterFECRate_Proxy( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - -void __RPC_STUB ILocator_get_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_OuterFECRate_Proxy( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - -void __RPC_STUB ILocator_put_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_Modulation_Proxy( - ILocator * This, - /* [retval][out] */ ModulationType *Modulation); - - -void __RPC_STUB ILocator_get_Modulation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_Modulation_Proxy( - ILocator * This, - /* [in] */ ModulationType Modulation); - - -void __RPC_STUB ILocator_put_Modulation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_SymbolRate_Proxy( - ILocator * This, - /* [retval][out] */ long *Rate); - - -void __RPC_STUB ILocator_get_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_SymbolRate_Proxy( - ILocator * This, - /* [in] */ long Rate); - - -void __RPC_STUB ILocator_put_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ILocator_Clone_Proxy( - ILocator * This, - /* [retval][out] */ ILocator **NewLocator); - - -void __RPC_STUB ILocator_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ILocator_INTERFACE_DEFINED__ */ - - -#ifndef __IATSCLocator_INTERFACE_DEFINED__ -#define __IATSCLocator_INTERFACE_DEFINED__ - -/* interface IATSCLocator */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IATSCLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BF8D986F-8C2B-4131-94D7-4D3D9FCC21EF") - IATSCLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PhysicalChannel( - /* [retval][out] */ long *PhysicalChannel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PhysicalChannel( - /* [in] */ long PhysicalChannel) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TSID( - /* [retval][out] */ long *TSID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TSID( - /* [in] */ long TSID) = 0; - - }; - -#else /* C style interface */ - - typedef struct IATSCLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IATSCLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IATSCLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IATSCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IATSCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IATSCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IATSCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IATSCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IATSCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IATSCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IATSCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IATSCLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IATSCLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IATSCLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IATSCLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PhysicalChannel )( - IATSCLocator * This, - /* [retval][out] */ long *PhysicalChannel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PhysicalChannel )( - IATSCLocator * This, - /* [in] */ long PhysicalChannel); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TSID )( - IATSCLocator * This, - /* [retval][out] */ long *TSID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TSID )( - IATSCLocator * This, - /* [in] */ long TSID); - - END_INTERFACE - } IATSCLocatorVtbl; - - interface IATSCLocator - { - CONST_VTBL struct IATSCLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IATSCLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IATSCLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IATSCLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IATSCLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IATSCLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IATSCLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IATSCLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IATSCLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - -#define IATSCLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - -#define IATSCLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - -#define IATSCLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - -#define IATSCLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - -#define IATSCLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - -#define IATSCLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - -#define IATSCLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - -#define IATSCLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - -#define IATSCLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - -#define IATSCLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - -#define IATSCLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - -#define IATSCLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - -#define IATSCLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - -#define IATSCLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - -#define IATSCLocator_get_PhysicalChannel(This,PhysicalChannel) \ - (This)->lpVtbl -> get_PhysicalChannel(This,PhysicalChannel) - -#define IATSCLocator_put_PhysicalChannel(This,PhysicalChannel) \ - (This)->lpVtbl -> put_PhysicalChannel(This,PhysicalChannel) - -#define IATSCLocator_get_TSID(This,TSID) \ - (This)->lpVtbl -> get_TSID(This,TSID) - -#define IATSCLocator_put_TSID(This,TSID) \ - (This)->lpVtbl -> put_TSID(This,TSID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCLocator_get_PhysicalChannel_Proxy( - IATSCLocator * This, - /* [retval][out] */ long *PhysicalChannel); - - -void __RPC_STUB IATSCLocator_get_PhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCLocator_put_PhysicalChannel_Proxy( - IATSCLocator * This, - /* [in] */ long PhysicalChannel); - - -void __RPC_STUB IATSCLocator_put_PhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCLocator_get_TSID_Proxy( - IATSCLocator * This, - /* [retval][out] */ long *TSID); - - -void __RPC_STUB IATSCLocator_get_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCLocator_put_TSID_Proxy( - IATSCLocator * This, - /* [in] */ long TSID); - - -void __RPC_STUB IATSCLocator_put_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IATSCLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBTLocator_INTERFACE_DEFINED__ -#define __IDVBTLocator_INTERFACE_DEFINED__ - -/* interface IDVBTLocator */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBTLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8664DA16-DDA2-42ac-926A-C18F9127C302") - IDVBTLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bandwidth( - /* [retval][out] */ long *BandWidthVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Bandwidth( - /* [in] */ long BandwidthVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LPInnerFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LPInnerFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LPInnerFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LPInnerFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_HAlpha( - /* [retval][out] */ HierarchyAlpha *Alpha) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_HAlpha( - /* [in] */ HierarchyAlpha Alpha) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Guard( - /* [retval][out] */ GuardInterval *GI) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Guard( - /* [in] */ GuardInterval GI) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Mode( - /* [retval][out] */ TransmissionMode *mode) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Mode( - /* [in] */ TransmissionMode mode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OtherFrequencyInUse( - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OtherFrequencyInUse( - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBTLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBTLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBTLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBTLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBTLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBTLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBTLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Bandwidth )( - IDVBTLocator * This, - /* [retval][out] */ long *BandWidthVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Bandwidth )( - IDVBTLocator * This, - /* [in] */ long BandwidthVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LPInnerFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LPInnerFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LPInnerFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LPInnerFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_HAlpha )( - IDVBTLocator * This, - /* [retval][out] */ HierarchyAlpha *Alpha); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_HAlpha )( - IDVBTLocator * This, - /* [in] */ HierarchyAlpha Alpha); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Guard )( - IDVBTLocator * This, - /* [retval][out] */ GuardInterval *GI); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Guard )( - IDVBTLocator * This, - /* [in] */ GuardInterval GI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IDVBTLocator * This, - /* [retval][out] */ TransmissionMode *mode); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IDVBTLocator * This, - /* [in] */ TransmissionMode mode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OtherFrequencyInUse )( - IDVBTLocator * This, - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OtherFrequencyInUse )( - IDVBTLocator * This, - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal); - - END_INTERFACE - } IDVBTLocatorVtbl; - - interface IDVBTLocator - { - CONST_VTBL struct IDVBTLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBTLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBTLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBTLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBTLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBTLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBTLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBTLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBTLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - -#define IDVBTLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - -#define IDVBTLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - -#define IDVBTLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - -#define IDVBTLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - -#define IDVBTLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - -#define IDVBTLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - -#define IDVBTLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - -#define IDVBTLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - -#define IDVBTLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - -#define IDVBTLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - -#define IDVBTLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - -#define IDVBTLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - -#define IDVBTLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - -#define IDVBTLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - -#define IDVBTLocator_get_Bandwidth(This,BandWidthVal) \ - (This)->lpVtbl -> get_Bandwidth(This,BandWidthVal) - -#define IDVBTLocator_put_Bandwidth(This,BandwidthVal) \ - (This)->lpVtbl -> put_Bandwidth(This,BandwidthVal) - -#define IDVBTLocator_get_LPInnerFEC(This,FEC) \ - (This)->lpVtbl -> get_LPInnerFEC(This,FEC) - -#define IDVBTLocator_put_LPInnerFEC(This,FEC) \ - (This)->lpVtbl -> put_LPInnerFEC(This,FEC) - -#define IDVBTLocator_get_LPInnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_LPInnerFECRate(This,FEC) - -#define IDVBTLocator_put_LPInnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_LPInnerFECRate(This,FEC) - -#define IDVBTLocator_get_HAlpha(This,Alpha) \ - (This)->lpVtbl -> get_HAlpha(This,Alpha) - -#define IDVBTLocator_put_HAlpha(This,Alpha) \ - (This)->lpVtbl -> put_HAlpha(This,Alpha) - -#define IDVBTLocator_get_Guard(This,GI) \ - (This)->lpVtbl -> get_Guard(This,GI) - -#define IDVBTLocator_put_Guard(This,GI) \ - (This)->lpVtbl -> put_Guard(This,GI) - -#define IDVBTLocator_get_Mode(This,mode) \ - (This)->lpVtbl -> get_Mode(This,mode) - -#define IDVBTLocator_put_Mode(This,mode) \ - (This)->lpVtbl -> put_Mode(This,mode) - -#define IDVBTLocator_get_OtherFrequencyInUse(This,OtherFrequencyInUseVal) \ - (This)->lpVtbl -> get_OtherFrequencyInUse(This,OtherFrequencyInUseVal) - -#define IDVBTLocator_put_OtherFrequencyInUse(This,OtherFrequencyInUseVal) \ - (This)->lpVtbl -> put_OtherFrequencyInUse(This,OtherFrequencyInUseVal) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Bandwidth_Proxy( - IDVBTLocator * This, - /* [retval][out] */ long *BandWidthVal); - - -void __RPC_STUB IDVBTLocator_get_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Bandwidth_Proxy( - IDVBTLocator * This, - /* [in] */ long BandwidthVal); - - -void __RPC_STUB IDVBTLocator_put_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_LPInnerFEC_Proxy( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - -void __RPC_STUB IDVBTLocator_get_LPInnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_LPInnerFEC_Proxy( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - -void __RPC_STUB IDVBTLocator_put_LPInnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_LPInnerFECRate_Proxy( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - -void __RPC_STUB IDVBTLocator_get_LPInnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_LPInnerFECRate_Proxy( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - -void __RPC_STUB IDVBTLocator_put_LPInnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_HAlpha_Proxy( - IDVBTLocator * This, - /* [retval][out] */ HierarchyAlpha *Alpha); - - -void __RPC_STUB IDVBTLocator_get_HAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_HAlpha_Proxy( - IDVBTLocator * This, - /* [in] */ HierarchyAlpha Alpha); - - -void __RPC_STUB IDVBTLocator_put_HAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Guard_Proxy( - IDVBTLocator * This, - /* [retval][out] */ GuardInterval *GI); - - -void __RPC_STUB IDVBTLocator_get_Guard_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Guard_Proxy( - IDVBTLocator * This, - /* [in] */ GuardInterval GI); - - -void __RPC_STUB IDVBTLocator_put_Guard_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Mode_Proxy( - IDVBTLocator * This, - /* [retval][out] */ TransmissionMode *mode); - - -void __RPC_STUB IDVBTLocator_get_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Mode_Proxy( - IDVBTLocator * This, - /* [in] */ TransmissionMode mode); - - -void __RPC_STUB IDVBTLocator_put_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_OtherFrequencyInUse_Proxy( - IDVBTLocator * This, - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal); - - -void __RPC_STUB IDVBTLocator_get_OtherFrequencyInUse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_OtherFrequencyInUse_Proxy( - IDVBTLocator * This, - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal); - - -void __RPC_STUB IDVBTLocator_put_OtherFrequencyInUse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBTLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBSLocator_INTERFACE_DEFINED__ -#define __IDVBSLocator_INTERFACE_DEFINED__ - -/* interface IDVBSLocator */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBSLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3D7C353C-0D04-45f1-A742-F97CC1188DC8") - IDVBSLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SignalPolarisation( - /* [retval][out] */ Polarisation *PolarisationVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SignalPolarisation( - /* [in] */ Polarisation PolarisationVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_WestPosition( - /* [retval][out] */ VARIANT_BOOL *WestLongitude) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_WestPosition( - /* [in] */ VARIANT_BOOL WestLongitude) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OrbitalPosition( - /* [retval][out] */ long *longitude) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OrbitalPosition( - /* [in] */ long longitude) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Azimuth( - /* [retval][out] */ long *Azimuth) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Azimuth( - /* [in] */ long Azimuth) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Elevation( - /* [retval][out] */ long *Elevation) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Elevation( - /* [in] */ long Elevation) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDVBSLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBSLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBSLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBSLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBSLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBSLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBSLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBSLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBSLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBSLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBSLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBSLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBSLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBSLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBSLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBSLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBSLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBSLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBSLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBSLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBSLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBSLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBSLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalPolarisation )( - IDVBSLocator * This, - /* [retval][out] */ Polarisation *PolarisationVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SignalPolarisation )( - IDVBSLocator * This, - /* [in] */ Polarisation PolarisationVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_WestPosition )( - IDVBSLocator * This, - /* [retval][out] */ VARIANT_BOOL *WestLongitude); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_WestPosition )( - IDVBSLocator * This, - /* [in] */ VARIANT_BOOL WestLongitude); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OrbitalPosition )( - IDVBSLocator * This, - /* [retval][out] */ long *longitude); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OrbitalPosition )( - IDVBSLocator * This, - /* [in] */ long longitude); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Azimuth )( - IDVBSLocator * This, - /* [retval][out] */ long *Azimuth); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Azimuth )( - IDVBSLocator * This, - /* [in] */ long Azimuth); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Elevation )( - IDVBSLocator * This, - /* [retval][out] */ long *Elevation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Elevation )( - IDVBSLocator * This, - /* [in] */ long Elevation); - - END_INTERFACE - } IDVBSLocatorVtbl; - - interface IDVBSLocator - { - CONST_VTBL struct IDVBSLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBSLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBSLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBSLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBSLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBSLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBSLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBSLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBSLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - -#define IDVBSLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - -#define IDVBSLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - -#define IDVBSLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - -#define IDVBSLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - -#define IDVBSLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - -#define IDVBSLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - -#define IDVBSLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - -#define IDVBSLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - -#define IDVBSLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - -#define IDVBSLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - -#define IDVBSLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - -#define IDVBSLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - -#define IDVBSLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - -#define IDVBSLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - -#define IDVBSLocator_get_SignalPolarisation(This,PolarisationVal) \ - (This)->lpVtbl -> get_SignalPolarisation(This,PolarisationVal) - -#define IDVBSLocator_put_SignalPolarisation(This,PolarisationVal) \ - (This)->lpVtbl -> put_SignalPolarisation(This,PolarisationVal) - -#define IDVBSLocator_get_WestPosition(This,WestLongitude) \ - (This)->lpVtbl -> get_WestPosition(This,WestLongitude) - -#define IDVBSLocator_put_WestPosition(This,WestLongitude) \ - (This)->lpVtbl -> put_WestPosition(This,WestLongitude) - -#define IDVBSLocator_get_OrbitalPosition(This,longitude) \ - (This)->lpVtbl -> get_OrbitalPosition(This,longitude) - -#define IDVBSLocator_put_OrbitalPosition(This,longitude) \ - (This)->lpVtbl -> put_OrbitalPosition(This,longitude) - -#define IDVBSLocator_get_Azimuth(This,Azimuth) \ - (This)->lpVtbl -> get_Azimuth(This,Azimuth) - -#define IDVBSLocator_put_Azimuth(This,Azimuth) \ - (This)->lpVtbl -> put_Azimuth(This,Azimuth) - -#define IDVBSLocator_get_Elevation(This,Elevation) \ - (This)->lpVtbl -> get_Elevation(This,Elevation) - -#define IDVBSLocator_put_Elevation(This,Elevation) \ - (This)->lpVtbl -> put_Elevation(This,Elevation) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_SignalPolarisation_Proxy( - IDVBSLocator * This, - /* [retval][out] */ Polarisation *PolarisationVal); - - -void __RPC_STUB IDVBSLocator_get_SignalPolarisation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_SignalPolarisation_Proxy( - IDVBSLocator * This, - /* [in] */ Polarisation PolarisationVal); - - -void __RPC_STUB IDVBSLocator_put_SignalPolarisation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_WestPosition_Proxy( - IDVBSLocator * This, - /* [retval][out] */ VARIANT_BOOL *WestLongitude); - - -void __RPC_STUB IDVBSLocator_get_WestPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_WestPosition_Proxy( - IDVBSLocator * This, - /* [in] */ VARIANT_BOOL WestLongitude); - - -void __RPC_STUB IDVBSLocator_put_WestPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_OrbitalPosition_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *longitude); - - -void __RPC_STUB IDVBSLocator_get_OrbitalPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_OrbitalPosition_Proxy( - IDVBSLocator * This, - /* [in] */ long longitude); - - -void __RPC_STUB IDVBSLocator_put_OrbitalPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_Azimuth_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *Azimuth); - - -void __RPC_STUB IDVBSLocator_get_Azimuth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_Azimuth_Proxy( - IDVBSLocator * This, - /* [in] */ long Azimuth); - - -void __RPC_STUB IDVBSLocator_put_Azimuth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_Elevation_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *Elevation); - - -void __RPC_STUB IDVBSLocator_get_Elevation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_Elevation_Proxy( - IDVBSLocator * This, - /* [in] */ long Elevation); - - -void __RPC_STUB IDVBSLocator_put_Elevation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDVBSLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IDVBCLocator_INTERFACE_DEFINED__ -#define __IDVBCLocator_INTERFACE_DEFINED__ - -/* interface IDVBCLocator */ -/* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IDVBCLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6E42F36E-1DD2-43c4-9F78-69D25AE39034") - IDVBCLocator : public ILocator - { - public: - }; - -#else /* C style interface */ - - typedef struct IDVBCLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBCLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBCLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBCLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBCLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBCLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBCLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBCLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBCLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBCLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBCLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBCLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBCLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBCLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBCLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - END_INTERFACE - } IDVBCLocatorVtbl; - - interface IDVBCLocator - { - CONST_VTBL struct IDVBCLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDVBCLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IDVBCLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IDVBCLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IDVBCLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IDVBCLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IDVBCLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IDVBCLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IDVBCLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - -#define IDVBCLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - -#define IDVBCLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - -#define IDVBCLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - -#define IDVBCLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - -#define IDVBCLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - -#define IDVBCLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - -#define IDVBCLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - -#define IDVBCLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - -#define IDVBCLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - -#define IDVBCLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - -#define IDVBCLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - -#define IDVBCLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - -#define IDVBCLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - -#define IDVBCLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDVBCLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IBroadcastEvent_INTERFACE_DEFINED__ -#define __IBroadcastEvent_INTERFACE_DEFINED__ - -/* interface IBroadcastEvent */ -/* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - -EXTERN_C const IID IID_IBroadcastEvent; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3B21263F-26E8-489d-AAC4-924F7EFD9511") - IBroadcastEvent : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Fire( - GUID EventID) = 0; - - }; - -#else /* C style interface */ - - typedef struct IBroadcastEventVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IBroadcastEvent * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IBroadcastEvent * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IBroadcastEvent * This); - - HRESULT ( STDMETHODCALLTYPE *Fire )( - IBroadcastEvent * This, - GUID EventID); - - END_INTERFACE - } IBroadcastEventVtbl; - - interface IBroadcastEvent - { - CONST_VTBL struct IBroadcastEventVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IBroadcastEvent_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IBroadcastEvent_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IBroadcastEvent_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IBroadcastEvent_Fire(This,EventID) \ - (This)->lpVtbl -> Fire(This,EventID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IBroadcastEvent_Fire_Proxy( - IBroadcastEvent * This, - GUID EventID); - - -void __RPC_STUB IBroadcastEvent_Fire_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IBroadcastEvent_INTERFACE_DEFINED__ */ - - - -#ifndef __TunerLib_LIBRARY_DEFINED__ -#define __TunerLib_LIBRARY_DEFINED__ - -/* library TunerLib */ -/* [helpstring][version][uuid] */ - -#define SID_SBroadcastEventService CLSID_BroadcastEventService - -EXTERN_C const IID LIBID_TunerLib; - -EXTERN_C const CLSID CLSID_SystemTuningSpaces; - -#ifdef __cplusplus - -class DECLSPEC_UUID("D02AAC50-027E-11d3-9D8E-00C04F72D980") -SystemTuningSpaces; -#endif - -EXTERN_C const CLSID CLSID_TuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("5FFDC5E6-B83A-4b55-B6E8-C69E765FE9DB") -TuningSpace; -#endif - -EXTERN_C const CLSID CLSID_ATSCTuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A2E30750-6C3D-11d3-B653-00C04F79498E") -ATSCTuningSpace; -#endif - -EXTERN_C const CLSID CLSID_AnalogRadioTuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8A674B4C-1F63-11d3-B64C-00C04F79498E") -AnalogRadioTuningSpace; -#endif - -EXTERN_C const CLSID CLSID_AnalogTVTuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8A674B4D-1F63-11d3-B64C-00C04F79498E") -AnalogTVTuningSpace; -#endif - -EXTERN_C const CLSID CLSID_DVBTuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C6B14B32-76AA-4a86-A7AC-5C79AAF58DA7") -DVBTuningSpace; -#endif - -EXTERN_C const CLSID CLSID_DVBSTuningSpace; - -#ifdef __cplusplus - -class DECLSPEC_UUID("B64016F3-C9A2-4066-96F0-BD9563314726") -DVBSTuningSpace; -#endif - -EXTERN_C const CLSID CLSID_ComponentTypes; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A1A2B1C4-0E3A-11d3-9D8E-00C04F72D980") -ComponentTypes; -#endif - -EXTERN_C const CLSID CLSID_ComponentType; - -#ifdef __cplusplus - -class DECLSPEC_UUID("823535A0-0318-11d3-9D8E-00C04F72D980") -ComponentType; -#endif - -EXTERN_C const CLSID CLSID_LanguageComponentType; - -#ifdef __cplusplus - -class DECLSPEC_UUID("1BE49F30-0E1B-11d3-9D8E-00C04F72D980") -LanguageComponentType; -#endif - -EXTERN_C const CLSID CLSID_MPEG2ComponentType; - -#ifdef __cplusplus - -class DECLSPEC_UUID("418008F3-CF67-4668-9628-10DC52BE1D08") -MPEG2ComponentType; -#endif - -EXTERN_C const CLSID CLSID_ATSCComponentType; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A8DCF3D5-0780-4ef4-8A83-2CFFAACB8ACE") -ATSCComponentType; -#endif - -EXTERN_C const CLSID CLSID_Components; - -#ifdef __cplusplus - -class DECLSPEC_UUID("809B6661-94C4-49e6-B6EC-3F0F862215AA") -Components; -#endif - -EXTERN_C const CLSID CLSID_Component; - -#ifdef __cplusplus - -class DECLSPEC_UUID("59DC47A8-116C-11d3-9D8E-00C04F72D980") -Component; -#endif - -EXTERN_C const CLSID CLSID_MPEG2Component; - -#ifdef __cplusplus - -class DECLSPEC_UUID("055CB2D7-2969-45cd-914B-76890722F112") -MPEG2Component; -#endif - -EXTERN_C const CLSID CLSID_TuneRequest; - -#ifdef __cplusplus - -class DECLSPEC_UUID("B46E0D38-AB35-4a06-A137-70576B01B39F") -TuneRequest; -#endif - -EXTERN_C const CLSID CLSID_ChannelTuneRequest; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0369B4E5-45B6-11d3-B650-00C04F79498E") -ChannelTuneRequest; -#endif - -EXTERN_C const CLSID CLSID_ATSCChannelTuneRequest; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0369B4E6-45B6-11d3-B650-00C04F79498E") -ATSCChannelTuneRequest; -#endif - -EXTERN_C const CLSID CLSID_MPEG2TuneRequest; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0955AC62-BF2E-4cba-A2B9-A63F772D46CF") -MPEG2TuneRequest; -#endif - -EXTERN_C const CLSID CLSID_MPEG2TuneRequestFactory; - -#ifdef __cplusplus - -class DECLSPEC_UUID("2C63E4EB-4CEA-41b8-919C-E947EA19A77C") -MPEG2TuneRequestFactory; -#endif - -EXTERN_C const CLSID CLSID_Locator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0888C883-AC4F-4943-B516-2C38D9B34562") -Locator; -#endif - -EXTERN_C const CLSID CLSID_ATSCLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8872FF1B-98FA-4d7a-8D93-C9F1055F85BB") -ATSCLocator; -#endif - -EXTERN_C const CLSID CLSID_DVBTLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("9CD64701-BDF3-4d14-8E03-F12983D86664") -DVBTLocator; -#endif - -EXTERN_C const CLSID CLSID_DVBSLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("1DF7D126-4050-47f0-A7CF-4C4CA9241333") -DVBSLocator; -#endif - -EXTERN_C const CLSID CLSID_DVBCLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C531D9FD-9685-4028-8B68-6E1232079F1E") -DVBCLocator; -#endif - -EXTERN_C const CLSID CLSID_DVBTuneRequest; - -#ifdef __cplusplus - -class DECLSPEC_UUID("15D6504A-5494-499c-886C-973C9E53B9F1") -DVBTuneRequest; -#endif - -EXTERN_C const CLSID CLSID_CreatePropBagOnRegKey; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8A674B49-1F63-11d3-B64C-00C04F79498E") -CreatePropBagOnRegKey; -#endif - -EXTERN_C const CLSID CLSID_BroadcastEventService; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0B3FFB92-0919-4934-9D5B-619C719D0202") -BroadcastEventService; -#endif -#endif /* __TunerLib_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - -unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - - -///////////////////////////////////////////////////////////////////////////// -// -// Windows XP vs. DirectX 8.0 header merge -// -// The following is the original contents of this header from -// the DirectX 8.0 SDK. -// -///////////////////////////////////////////////////////////////////////////// - -#else // DirectX 8.0 content - - - /* File created by MIDL compiler version 6.00.0338 */ - /* Compiler settings for tuner.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() - */ - //@@MIDL_FILE_HEADING( ) - - - /* verify that the version is high enough to compile this file*/ - #ifndef __REQUIRED_RPCNDR_H_VERSION__ - #define __REQUIRED_RPCNDR_H_VERSION__ 440 - #endif - - #include "rpc.h" - #include "rpcndr.h" - - #ifndef __RPCNDR_H_VERSION__ - #error this stub requires an updated version of - #endif // __RPCNDR_H_VERSION__ - - #ifndef COM_NO_WINDOWS_H - #include "windows.h" - #include "ole2.h" - #endif /*COM_NO_WINDOWS_H*/ - - #ifndef __tuner_h__ - #define __tuner_h__ - - #if defined(_MSC_VER) && (_MSC_VER >= 1020) - #pragma once - #endif - - /* Forward Declarations */ - - #ifndef __ITuningSpaces_FWD_DEFINED__ - #define __ITuningSpaces_FWD_DEFINED__ - typedef interface ITuningSpaces ITuningSpaces; - #endif /* __ITuningSpaces_FWD_DEFINED__ */ - - - #ifndef __ITuningSpaceContainer_FWD_DEFINED__ - #define __ITuningSpaceContainer_FWD_DEFINED__ - typedef interface ITuningSpaceContainer ITuningSpaceContainer; - #endif /* __ITuningSpaceContainer_FWD_DEFINED__ */ - - - #ifndef __ITuningSpace_FWD_DEFINED__ - #define __ITuningSpace_FWD_DEFINED__ - typedef interface ITuningSpace ITuningSpace; - #endif /* __ITuningSpace_FWD_DEFINED__ */ - - - #ifndef __IEnumTuningSpaces_FWD_DEFINED__ - #define __IEnumTuningSpaces_FWD_DEFINED__ - typedef interface IEnumTuningSpaces IEnumTuningSpaces; - #endif /* __IEnumTuningSpaces_FWD_DEFINED__ */ - - - #ifndef __IDVBTuningSpace_FWD_DEFINED__ - #define __IDVBTuningSpace_FWD_DEFINED__ - typedef interface IDVBTuningSpace IDVBTuningSpace; - #endif /* __IDVBTuningSpace_FWD_DEFINED__ */ - - - #ifndef __IAnalogTVTuningSpace_FWD_DEFINED__ - #define __IAnalogTVTuningSpace_FWD_DEFINED__ - typedef interface IAnalogTVTuningSpace IAnalogTVTuningSpace; - #endif /* __IAnalogTVTuningSpace_FWD_DEFINED__ */ - - - #ifndef __IATSCTuningSpace_FWD_DEFINED__ - #define __IATSCTuningSpace_FWD_DEFINED__ - typedef interface IATSCTuningSpace IATSCTuningSpace; - #endif /* __IATSCTuningSpace_FWD_DEFINED__ */ - - - #ifndef __IAnalogRadioTuningSpace_FWD_DEFINED__ - #define __IAnalogRadioTuningSpace_FWD_DEFINED__ - typedef interface IAnalogRadioTuningSpace IAnalogRadioTuningSpace; - #endif /* __IAnalogRadioTuningSpace_FWD_DEFINED__ */ - - - #ifndef __ITuneRequest_FWD_DEFINED__ - #define __ITuneRequest_FWD_DEFINED__ - typedef interface ITuneRequest ITuneRequest; - #endif /* __ITuneRequest_FWD_DEFINED__ */ - - - #ifndef __IChannelTuneRequest_FWD_DEFINED__ - #define __IChannelTuneRequest_FWD_DEFINED__ - typedef interface IChannelTuneRequest IChannelTuneRequest; - #endif /* __IChannelTuneRequest_FWD_DEFINED__ */ - - - #ifndef __IATSCChannelTuneRequest_FWD_DEFINED__ - #define __IATSCChannelTuneRequest_FWD_DEFINED__ - typedef interface IATSCChannelTuneRequest IATSCChannelTuneRequest; - #endif /* __IATSCChannelTuneRequest_FWD_DEFINED__ */ - - - #ifndef __IDVBTuneRequest_FWD_DEFINED__ - #define __IDVBTuneRequest_FWD_DEFINED__ - typedef interface IDVBTuneRequest IDVBTuneRequest; - #endif /* __IDVBTuneRequest_FWD_DEFINED__ */ - - - #ifndef __ITuner_FWD_DEFINED__ - #define __ITuner_FWD_DEFINED__ - typedef interface ITuner ITuner; - #endif /* __ITuner_FWD_DEFINED__ */ - - - #ifndef __IScanningTuner_FWD_DEFINED__ - #define __IScanningTuner_FWD_DEFINED__ - typedef interface IScanningTuner IScanningTuner; - #endif /* __IScanningTuner_FWD_DEFINED__ */ - - - #ifndef __ITunerEvents_FWD_DEFINED__ - #define __ITunerEvents_FWD_DEFINED__ - typedef interface ITunerEvents ITunerEvents; - #endif /* __ITunerEvents_FWD_DEFINED__ */ - - - #ifndef __ISignalEvents_FWD_DEFINED__ - #define __ISignalEvents_FWD_DEFINED__ - typedef interface ISignalEvents ISignalEvents; - #endif /* __ISignalEvents_FWD_DEFINED__ */ - - - #ifndef __IComponentType_FWD_DEFINED__ - #define __IComponentType_FWD_DEFINED__ - typedef interface IComponentType IComponentType; - #endif /* __IComponentType_FWD_DEFINED__ */ - - - #ifndef __ILanguageComponentType_FWD_DEFINED__ - #define __ILanguageComponentType_FWD_DEFINED__ - typedef interface ILanguageComponentType ILanguageComponentType; - #endif /* __ILanguageComponentType_FWD_DEFINED__ */ - - - #ifndef __IMPEG2ComponentType_FWD_DEFINED__ - #define __IMPEG2ComponentType_FWD_DEFINED__ - typedef interface IMPEG2ComponentType IMPEG2ComponentType; - #endif /* __IMPEG2ComponentType_FWD_DEFINED__ */ - - - #ifndef __IATSCComponentType_FWD_DEFINED__ - #define __IATSCComponentType_FWD_DEFINED__ - typedef interface IATSCComponentType IATSCComponentType; - #endif /* __IATSCComponentType_FWD_DEFINED__ */ - - - #ifndef __IEnumComponentTypes_FWD_DEFINED__ - #define __IEnumComponentTypes_FWD_DEFINED__ - typedef interface IEnumComponentTypes IEnumComponentTypes; - #endif /* __IEnumComponentTypes_FWD_DEFINED__ */ - - - #ifndef __IComponentTypes_FWD_DEFINED__ - #define __IComponentTypes_FWD_DEFINED__ - typedef interface IComponentTypes IComponentTypes; - #endif /* __IComponentTypes_FWD_DEFINED__ */ - - - #ifndef __IComponent_FWD_DEFINED__ - #define __IComponent_FWD_DEFINED__ - typedef interface IComponent IComponent; - #endif /* __IComponent_FWD_DEFINED__ */ - - - #ifndef __IMPEG2Component_FWD_DEFINED__ - #define __IMPEG2Component_FWD_DEFINED__ - typedef interface IMPEG2Component IMPEG2Component; - #endif /* __IMPEG2Component_FWD_DEFINED__ */ - - - #ifndef __IEnumComponents_FWD_DEFINED__ - #define __IEnumComponents_FWD_DEFINED__ - typedef interface IEnumComponents IEnumComponents; - #endif /* __IEnumComponents_FWD_DEFINED__ */ - - - #ifndef __IComponents_FWD_DEFINED__ - #define __IComponents_FWD_DEFINED__ - typedef interface IComponents IComponents; - #endif /* __IComponents_FWD_DEFINED__ */ - - - #ifndef __ILocator_FWD_DEFINED__ - #define __ILocator_FWD_DEFINED__ - typedef interface ILocator ILocator; - #endif /* __ILocator_FWD_DEFINED__ */ - - - #ifndef __IATSCLocator_FWD_DEFINED__ - #define __IATSCLocator_FWD_DEFINED__ - typedef interface IATSCLocator IATSCLocator; - #endif /* __IATSCLocator_FWD_DEFINED__ */ - - - #ifndef __IDVBTLocator_FWD_DEFINED__ - #define __IDVBTLocator_FWD_DEFINED__ - typedef interface IDVBTLocator IDVBTLocator; - #endif /* __IDVBTLocator_FWD_DEFINED__ */ - - - #ifndef __IDVBSLocator_FWD_DEFINED__ - #define __IDVBSLocator_FWD_DEFINED__ - typedef interface IDVBSLocator IDVBSLocator; - #endif /* __IDVBSLocator_FWD_DEFINED__ */ - - - #ifndef __IDVBCLocator_FWD_DEFINED__ - #define __IDVBCLocator_FWD_DEFINED__ - typedef interface IDVBCLocator IDVBCLocator; - #endif /* __IDVBCLocator_FWD_DEFINED__ */ - - - #ifndef __SystemTuningSpaces_FWD_DEFINED__ - #define __SystemTuningSpaces_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class SystemTuningSpaces SystemTuningSpaces; - #else - typedef struct SystemTuningSpaces SystemTuningSpaces; - #endif /* __cplusplus */ - - #endif /* __SystemTuningSpaces_FWD_DEFINED__ */ - - - #ifndef __TuningSpace_FWD_DEFINED__ - #define __TuningSpace_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class TuningSpace TuningSpace; - #else - typedef struct TuningSpace TuningSpace; - #endif /* __cplusplus */ - - #endif /* __TuningSpace_FWD_DEFINED__ */ - - - #ifndef __ATSCTuningSpace_FWD_DEFINED__ - #define __ATSCTuningSpace_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ATSCTuningSpace ATSCTuningSpace; - #else - typedef struct ATSCTuningSpace ATSCTuningSpace; - #endif /* __cplusplus */ - - #endif /* __ATSCTuningSpace_FWD_DEFINED__ */ - - - #ifndef __AnalogRadioTuningSpace_FWD_DEFINED__ - #define __AnalogRadioTuningSpace_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AnalogRadioTuningSpace AnalogRadioTuningSpace; - #else - typedef struct AnalogRadioTuningSpace AnalogRadioTuningSpace; - #endif /* __cplusplus */ - - #endif /* __AnalogRadioTuningSpace_FWD_DEFINED__ */ - - - #ifndef __AnalogTVTuningSpace_FWD_DEFINED__ - #define __AnalogTVTuningSpace_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class AnalogTVTuningSpace AnalogTVTuningSpace; - #else - typedef struct AnalogTVTuningSpace AnalogTVTuningSpace; - #endif /* __cplusplus */ - - #endif /* __AnalogTVTuningSpace_FWD_DEFINED__ */ - - - #ifndef __DVBTuningSpace_FWD_DEFINED__ - #define __DVBTuningSpace_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DVBTuningSpace DVBTuningSpace; - #else - typedef struct DVBTuningSpace DVBTuningSpace; - #endif /* __cplusplus */ - - #endif /* __DVBTuningSpace_FWD_DEFINED__ */ - - - #ifndef __ComponentTypes_FWD_DEFINED__ - #define __ComponentTypes_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ComponentTypes ComponentTypes; - #else - typedef struct ComponentTypes ComponentTypes; - #endif /* __cplusplus */ - - #endif /* __ComponentTypes_FWD_DEFINED__ */ - - - #ifndef __ComponentType_FWD_DEFINED__ - #define __ComponentType_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ComponentType ComponentType; - #else - typedef struct ComponentType ComponentType; - #endif /* __cplusplus */ - - #endif /* __ComponentType_FWD_DEFINED__ */ - - - #ifndef __LanguageComponentType_FWD_DEFINED__ - #define __LanguageComponentType_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class LanguageComponentType LanguageComponentType; - #else - typedef struct LanguageComponentType LanguageComponentType; - #endif /* __cplusplus */ - - #endif /* __LanguageComponentType_FWD_DEFINED__ */ - - - #ifndef __MPEG2ComponentType_FWD_DEFINED__ - #define __MPEG2ComponentType_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class MPEG2ComponentType MPEG2ComponentType; - #else - typedef struct MPEG2ComponentType MPEG2ComponentType; - #endif /* __cplusplus */ - - #endif /* __MPEG2ComponentType_FWD_DEFINED__ */ - - - #ifndef __ATSCComponentType_FWD_DEFINED__ - #define __ATSCComponentType_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ATSCComponentType ATSCComponentType; - #else - typedef struct ATSCComponentType ATSCComponentType; - #endif /* __cplusplus */ - - #endif /* __ATSCComponentType_FWD_DEFINED__ */ - - - #ifndef __Components_FWD_DEFINED__ - #define __Components_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class Components Components; - #else - typedef struct Components Components; - #endif /* __cplusplus */ - - #endif /* __Components_FWD_DEFINED__ */ - - - #ifndef __Component_FWD_DEFINED__ - #define __Component_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class Component Component; - #else - typedef struct Component Component; - #endif /* __cplusplus */ - - #endif /* __Component_FWD_DEFINED__ */ - - - #ifndef __MPEG2Component_FWD_DEFINED__ - #define __MPEG2Component_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class MPEG2Component MPEG2Component; - #else - typedef struct MPEG2Component MPEG2Component; - #endif /* __cplusplus */ - - #endif /* __MPEG2Component_FWD_DEFINED__ */ - - - #ifndef __TuneRequest_FWD_DEFINED__ - #define __TuneRequest_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class TuneRequest TuneRequest; - #else - typedef struct TuneRequest TuneRequest; - #endif /* __cplusplus */ - - #endif /* __TuneRequest_FWD_DEFINED__ */ - - - #ifndef __ChannelTuneRequest_FWD_DEFINED__ - #define __ChannelTuneRequest_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ChannelTuneRequest ChannelTuneRequest; - #else - typedef struct ChannelTuneRequest ChannelTuneRequest; - #endif /* __cplusplus */ - - #endif /* __ChannelTuneRequest_FWD_DEFINED__ */ - - - #ifndef __ATSCChannelTuneRequest_FWD_DEFINED__ - #define __ATSCChannelTuneRequest_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ATSCChannelTuneRequest ATSCChannelTuneRequest; - #else - typedef struct ATSCChannelTuneRequest ATSCChannelTuneRequest; - #endif /* __cplusplus */ - - #endif /* __ATSCChannelTuneRequest_FWD_DEFINED__ */ - - - #ifndef __Locator_FWD_DEFINED__ - #define __Locator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class Locator Locator; - #else - typedef struct Locator Locator; - #endif /* __cplusplus */ - - #endif /* __Locator_FWD_DEFINED__ */ - - - #ifndef __ATSCLocator_FWD_DEFINED__ - #define __ATSCLocator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class ATSCLocator ATSCLocator; - #else - typedef struct ATSCLocator ATSCLocator; - #endif /* __cplusplus */ - - #endif /* __ATSCLocator_FWD_DEFINED__ */ - - - #ifndef __DVBTLocator_FWD_DEFINED__ - #define __DVBTLocator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DVBTLocator DVBTLocator; - #else - typedef struct DVBTLocator DVBTLocator; - #endif /* __cplusplus */ - - #endif /* __DVBTLocator_FWD_DEFINED__ */ - - - #ifndef __DVBSLocator_FWD_DEFINED__ - #define __DVBSLocator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DVBSLocator DVBSLocator; - #else - typedef struct DVBSLocator DVBSLocator; - #endif /* __cplusplus */ - - #endif /* __DVBSLocator_FWD_DEFINED__ */ - - - #ifndef __DVBCLocator_FWD_DEFINED__ - #define __DVBCLocator_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DVBCLocator DVBCLocator; - #else - typedef struct DVBCLocator DVBCLocator; - #endif /* __cplusplus */ - - #endif /* __DVBCLocator_FWD_DEFINED__ */ - - - #ifndef __DVBTuneRequest_FWD_DEFINED__ - #define __DVBTuneRequest_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class DVBTuneRequest DVBTuneRequest; - #else - typedef struct DVBTuneRequest DVBTuneRequest; - #endif /* __cplusplus */ - - #endif /* __DVBTuneRequest_FWD_DEFINED__ */ - - - #ifndef __CreatePropBagOnRegKey_FWD_DEFINED__ - #define __CreatePropBagOnRegKey_FWD_DEFINED__ - - #ifdef __cplusplus - typedef class CreatePropBagOnRegKey CreatePropBagOnRegKey; - #else - typedef struct CreatePropBagOnRegKey CreatePropBagOnRegKey; - #endif /* __cplusplus */ - - #endif /* __CreatePropBagOnRegKey_FWD_DEFINED__ */ - - - /* header files for imported files */ - #include "oaidl.h" - #include "comcat.h" - #include "strmif.h" - #include "bdatypes.h" - #include "regbag.h" - - #ifdef __cplusplus - extern "C"{ - #endif - - void * __RPC_USER MIDL_user_allocate(size_t); - void __RPC_USER MIDL_user_free( void * ); - - /* interface __MIDL_itf_tuner_0000 */ - /* [local] */ - - //+------------------------------------------------------------------------- - // - // Microsoft Windows - // Copyright (C) Microsoft Corporation, 1999-2001. - // - //-------------------------------------------------------------------------- - #pragma once - #include - - - - - - - - - - - - - - - - - - - - - - enum __MIDL___MIDL_itf_tuner_0000_0001 - { DISPID_TUNER_TS_UNIQUENAME = 1, - DISPID_TUNER_TS_FRIENDLYNAME = 2, - DISPID_TUNER_TS_CLSID = 3, - DISPID_TUNER_TS_NETWORKTYPE = 4, - DISPID_TUNER_TS__NETWORKTYPE = 5, - DISPID_TUNER_TS_CREATETUNEREQUEST = 6, - DISPID_TUNER_TS_ENUMCATEGORYGUIDS = 7, - DISPID_TUNER_TS_ENUMDEVICEMONIKERS = 8, - DISPID_TUNER_TS_DEFAULTPREFERREDCOMPONENTTYPES = 9, - DISPID_TUNER_TS_FREQMAP = 10, - DISPID_TUNER_TS_DEFLOCATOR = 11, - DISPID_TUNER_TS_CLONE = 12, - DISPID_TUNER_TR_TUNINGSPACE = 1, - DISPID_TUNER_TR_COMPONENTS = 2, - DISPID_TUNER_TR_CLONE = 3, - DISPID_TUNER_TR_LOCATOR = 4, - DISPID_TUNER_CT_CATEGORY = 1, - DISPID_TUNER_CT_MEDIAMAJORTYPE = 2, - DISPID_TUNER_CT__MEDIAMAJORTYPE = 3, - DISPID_TUNER_CT_MEDIASUBTYPE = 4, - DISPID_TUNER_CT__MEDIASUBTYPE = 5, - DISPID_TUNER_CT_MEDIAFORMATTYPE = 6, - DISPID_TUNER_CT__MEDIAFORMATTYPE = 7, - DISPID_TUNER_CT_MEDIATYPE = 8, - DISPID_TUNER_CT_CLONE = 9, - DISPID_TUNER_LCT_LANGID = 100, - DISPID_TUNER_MP2CT_TYPE = 200, - DISPID_TUNER_ATSCCT_FLAGS = 300, - DISPID_TUNER_L_CARRFREQ = 1, - DISPID_TUNER_L_INNERFECMETHOD = 2, - DISPID_TUNER_L_INNERFECRATE = 3, - DISPID_TUNER_L_OUTERFECMETHOD = 4, - DISPID_TUNER_L_OUTERFECRATE = 5, - DISPID_TUNER_L_MOD = 6, - DISPID_TUNER_L_SYMRATE = 7, - DISPID_TUNER_L_CLONE = 8, - DISPID_TUNER_L_ATSC_PHYS_CHANNEL = 201, - DISPID_TUNER_L_ATSC_TSID = 202, - DISPID_TUNER_L_DVBT_BANDWIDTH = 301, - DISPID_TUNER_L_DVBT_LPINNERFECMETHOD = 302, - DISPID_TUNER_L_DVBT_LPINNERFECRATE = 303, - DISPID_TUNER_L_DVBT_GUARDINTERVAL = 304, - DISPID_TUNER_L_DVBT_HALPHA = 305, - DISPID_TUNER_L_DVBT_TRANSMISSIONMODE = 306, - DISPID_TUNER_L_DVBT_INUSE = 307, - DISPID_TUNER_L_DVBS_POLARISATION = 401, - DISPID_TUNER_L_DVBS_WEST = 402, - DISPID_TUNER_L_DVBS_ORBITAL = 403, - DISPID_TUNER_L_DVBS_AZIMUTH = 404, - DISPID_TUNER_L_DVBS_ELEVATION = 405, - DISPID_TUNER_C_TYPE = 1, - DISPID_TUNER_C_STATUS = 2, - DISPID_TUNER_C_LANGID = 3, - DISPID_TUNER_C_DESCRIPTION = 4, - DISPID_TUNER_C_CLONE = 5, - DISPID_TUNER_C_MP2_PID = 101, - DISPID_TUNER_C_MP2_PCRPID = 102, - DISPID_TUNER_C_MP2_PROGNO = 103, - DISPID_TUNER_TS_DVB_SYSTEMTYPE = 101, - DISPID_TUNER_TS_AR_MINFREQUENCY = 101, - DISPID_TUNER_TS_AR_MAXFREQUENCY = 102, - DISPID_TUNER_TS_AR_STEP = 103, - DISPID_TUNER_TS_ATV_MINCHANNEL = 101, - DISPID_TUNER_TS_ATV_MAXCHANNEL = 102, - DISPID_TUNER_TS_ATV_INPUTTYPE = 103, - DISPID_TUNER_TS_ATV_COUNTRYCODE = 104, - DISPID_TUNER_TS_ATSC_MINMINORCHANNEL = 201, - DISPID_TUNER_TS_ATSC_MAXMINORCHANNEL = 202, - DISPID_TUNER_TS_ATSC_MINPHYSCHANNEL = 203, - DISPID_TUNER_TS_ATSC_MAXPHYSCHANNEL = 204, - DISPID_CHTUNER_ATVAC_CHANNEL = 101, - DISPID_CHTUNER_ATVDC_SYSTEM = 101, - DISPID_CHTUNER_ATVDC_CONTENT = 102, - DISPID_CHTUNER_CTR_CHANNEL = 101, - DISPID_CHTUNER_ACTR_MINOR_CHANNEL = 201, - DISPID_DVBTUNER_DVBC_ATTRIBUTESVALID = 101, - DISPID_DVBTUNER_DVBC_PID = 102, - DISPID_DVBTUNER_DVBC_TAG = 103, - DISPID_DVBTUNER_DVBC_COMPONENTTYPE = 104, - DISPID_DVBTUNER_ONID = 101, - DISPID_DVBTUNER_TSID = 102, - DISPID_DVBTUNER_SID = 103 - } ; - - - extern RPC_IF_HANDLE __MIDL_itf_tuner_0000_v0_0_c_ifspec; - extern RPC_IF_HANDLE __MIDL_itf_tuner_0000_v0_0_s_ifspec; - - #ifndef __ITuningSpaces_INTERFACE_DEFINED__ - #define __ITuningSpaces_INTERFACE_DEFINED__ - - /* interface ITuningSpaces */ - /* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object] */ - - - EXTERN_C const IID IID_ITuningSpaces; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("901284E4-33FE-4b69-8D63-634A596F3756") - ITuningSpaces : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **NewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **NewEnum) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITuningSpacesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpaces * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpaces * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpaces * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpaces * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpaces * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpaces * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - ITuningSpaces * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - ITuningSpaces * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - ITuningSpaces * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][restricted][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EnumTuningSpaces )( - ITuningSpaces * This, - /* [retval][out] */ IEnumTuningSpaces **NewEnum); - - END_INTERFACE - } ITuningSpacesVtbl; - - interface ITuningSpaces - { - CONST_VTBL struct ITuningSpacesVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITuningSpaces_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITuningSpaces_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITuningSpaces_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITuningSpaces_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ITuningSpaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ITuningSpaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ITuningSpaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ITuningSpaces_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - - #define ITuningSpaces_get__NewEnum(This,NewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,NewEnum) - - #define ITuningSpaces_get_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> get_Item(This,varIndex,TuningSpace) - - #define ITuningSpaces_get_EnumTuningSpaces(This,NewEnum) \ - (This)->lpVtbl -> get_EnumTuningSpaces(This,NewEnum) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_Count_Proxy( - ITuningSpaces * This, - /* [retval][out] */ long *Count); - - - void __RPC_STUB ITuningSpaces_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get__NewEnum_Proxy( - ITuningSpaces * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - - void __RPC_STUB ITuningSpaces_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_Item_Proxy( - ITuningSpaces * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - - void __RPC_STUB ITuningSpaces_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaces_get_EnumTuningSpaces_Proxy( - ITuningSpaces * This, - /* [retval][out] */ IEnumTuningSpaces **NewEnum); - - - void __RPC_STUB ITuningSpaces_get_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITuningSpaces_INTERFACE_DEFINED__ */ - - - #ifndef __ITuningSpaceContainer_INTERFACE_DEFINED__ - #define __ITuningSpaceContainer_INTERFACE_DEFINED__ - - /* interface ITuningSpaceContainer */ - /* [unique][helpstring][nonextensible][hidden][oleautomation][dual][uuid][object] */ - - - EXTERN_C const IID IID_ITuningSpaceContainer; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5B692E84-E2F1-11d2-9493-00C04F72D980") - ITuningSpaceContainer : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **NewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_Item( - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID( - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID( - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TuningSpacesForName( - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindID( - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **ppEnum) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_MaxCount( - /* [retval][out] */ long *MaxCount) = 0; - - virtual /* [helpstring][restricted][hidden][propput] */ HRESULT STDMETHODCALLTYPE put_MaxCount( - /* [in] */ long MaxCount) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITuningSpaceContainerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpaceContainer * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpaceContainer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpaceContainer * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpaceContainer * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpaceContainer * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpaceContainer * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpaceContainer * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - ITuningSpaceContainer * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Item )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TuningSpacesForCLSID )( - ITuningSpaceContainer * This, - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *_TuningSpacesForCLSID )( - ITuningSpaceContainer * This, - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TuningSpacesForName )( - ITuningSpaceContainer * This, - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FindID )( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][restricted][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EnumTuningSpaces )( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - ITuningSpaceContainer * This, - /* [in] */ VARIANT Index); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxCount )( - ITuningSpaceContainer * This, - /* [retval][out] */ long *MaxCount); - - /* [helpstring][restricted][hidden][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxCount )( - ITuningSpaceContainer * This, - /* [in] */ long MaxCount); - - END_INTERFACE - } ITuningSpaceContainerVtbl; - - interface ITuningSpaceContainer - { - CONST_VTBL struct ITuningSpaceContainerVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITuningSpaceContainer_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITuningSpaceContainer_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITuningSpaceContainer_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITuningSpaceContainer_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ITuningSpaceContainer_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ITuningSpaceContainer_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ITuningSpaceContainer_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ITuningSpaceContainer_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - - #define ITuningSpaceContainer_get__NewEnum(This,NewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,NewEnum) - - #define ITuningSpaceContainer_get_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> get_Item(This,varIndex,TuningSpace) - - #define ITuningSpaceContainer_put_Item(This,varIndex,TuningSpace) \ - (This)->lpVtbl -> put_Item(This,varIndex,TuningSpace) - - #define ITuningSpaceContainer_TuningSpacesForCLSID(This,SpaceCLSID,NewColl) \ - (This)->lpVtbl -> TuningSpacesForCLSID(This,SpaceCLSID,NewColl) - - #define ITuningSpaceContainer__TuningSpacesForCLSID(This,SpaceCLSID,NewColl) \ - (This)->lpVtbl -> _TuningSpacesForCLSID(This,SpaceCLSID,NewColl) - - #define ITuningSpaceContainer_TuningSpacesForName(This,Name,NewColl) \ - (This)->lpVtbl -> TuningSpacesForName(This,Name,NewColl) - - #define ITuningSpaceContainer_FindID(This,TuningSpace,ID) \ - (This)->lpVtbl -> FindID(This,TuningSpace,ID) - - #define ITuningSpaceContainer_Add(This,TuningSpace,NewIndex) \ - (This)->lpVtbl -> Add(This,TuningSpace,NewIndex) - - #define ITuningSpaceContainer_get_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> get_EnumTuningSpaces(This,ppEnum) - - #define ITuningSpaceContainer_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - - #define ITuningSpaceContainer_get_MaxCount(This,MaxCount) \ - (This)->lpVtbl -> get_MaxCount(This,MaxCount) - - #define ITuningSpaceContainer_put_MaxCount(This,MaxCount) \ - (This)->lpVtbl -> put_MaxCount(This,MaxCount) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_Count_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ long *Count); - - - void __RPC_STUB ITuningSpaceContainer_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get__NewEnum_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumVARIANT **NewEnum); - - - void __RPC_STUB ITuningSpaceContainer_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_Item_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [retval][out] */ ITuningSpace **TuningSpace); - - - void __RPC_STUB ITuningSpaceContainer_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_put_Item_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT varIndex, - /* [in] */ ITuningSpace *TuningSpace); - - - void __RPC_STUB ITuningSpaceContainer_put_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_TuningSpacesForCLSID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ BSTR SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - - void __RPC_STUB ITuningSpaceContainer_TuningSpacesForCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer__TuningSpacesForCLSID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ REFCLSID SpaceCLSID, - /* [retval][out] */ ITuningSpaces **NewColl); - - - void __RPC_STUB ITuningSpaceContainer__TuningSpacesForCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_TuningSpacesForName_Proxy( - ITuningSpaceContainer * This, - /* [in] */ BSTR Name, - /* [retval][out] */ ITuningSpaces **NewColl); - - - void __RPC_STUB ITuningSpaceContainer_TuningSpacesForName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_FindID_Proxy( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ long *ID); - - - void __RPC_STUB ITuningSpaceContainer_FindID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_Add_Proxy( - ITuningSpaceContainer * This, - /* [in] */ ITuningSpace *TuningSpace, - /* [retval][out] */ VARIANT *NewIndex); - - - void __RPC_STUB ITuningSpaceContainer_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_EnumTuningSpaces_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - - void __RPC_STUB ITuningSpaceContainer_get_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_Remove_Proxy( - ITuningSpaceContainer * This, - /* [in] */ VARIANT Index); - - - void __RPC_STUB ITuningSpaceContainer_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_get_MaxCount_Proxy( - ITuningSpaceContainer * This, - /* [retval][out] */ long *MaxCount); - - - void __RPC_STUB ITuningSpaceContainer_get_MaxCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpaceContainer_put_MaxCount_Proxy( - ITuningSpaceContainer * This, - /* [in] */ long MaxCount); - - - void __RPC_STUB ITuningSpaceContainer_put_MaxCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITuningSpaceContainer_INTERFACE_DEFINED__ */ - - - #ifndef __ITuningSpace_INTERFACE_DEFINED__ - #define __ITuningSpace_INTERFACE_DEFINED__ - - /* interface ITuningSpace */ - /* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object] */ - - - EXTERN_C const IID IID_ITuningSpace; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("061C6E30-E622-11d2-9493-00C04F72D980") - ITuningSpace : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_UniqueName( - /* [retval][out] */ BSTR *Name) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_UniqueName( - /* [in] */ BSTR Name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FriendlyName( - /* [retval][out] */ BSTR *Name) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FriendlyName( - /* [in] */ BSTR Name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CLSID( - /* [retval][out] */ BSTR *SpaceCLSID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetworkType( - /* [retval][out] */ BSTR *NetworkTypeGuid) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_NetworkType( - /* [in] */ BSTR NetworkTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__NetworkType( - /* [retval][out] */ GUID *NetworkTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__NetworkType( - /* [in] */ REFCLSID NetworkTypeGuid) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateTuneRequest( - /* [retval][out] */ ITuneRequest **TuneRequest) = 0; - - virtual /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE EnumCategoryGUIDs( - /* [retval][out] */ IEnumGUID **ppEnum) = 0; - - virtual /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE EnumDeviceMonikers( - /* [retval][out] */ IEnumMoniker **ppEnum) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultPreferredComponentTypes( - /* [retval][out] */ IComponentTypes **ComponentTypes) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultPreferredComponentTypes( - /* [in] */ IComponentTypes *NewComponentTypes) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrequencyMapping( - /* [retval][out] */ BSTR *pMapping) = 0; - - virtual /* [restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_FrequencyMapping( - BSTR Mapping) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultLocator( - /* [retval][out] */ ILocator **LocatorVal) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultLocator( - /* [in] */ ILocator *LocatorVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ITuningSpace **NewTS) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - ITuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - ITuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - ITuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - ITuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - ITuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - ITuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - ITuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - ITuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - ITuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - ITuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - ITuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - ITuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - ITuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - ITuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - ITuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - ITuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - ITuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - END_INTERFACE - } ITuningSpaceVtbl; - - interface ITuningSpace - { - CONST_VTBL struct ITuningSpaceVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ITuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ITuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ITuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ITuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - - #define ITuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - - #define ITuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - - #define ITuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - - #define ITuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - - #define ITuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - - #define ITuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - - #define ITuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - - #define ITuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - - #define ITuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - - #define ITuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - - #define ITuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - - #define ITuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - - #define ITuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - - #define ITuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - - #define ITuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - - #define ITuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - - #define ITuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - - #define ITuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_UniqueName_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - - void __RPC_STUB ITuningSpace_get_UniqueName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_UniqueName_Proxy( - ITuningSpace * This, - /* [in] */ BSTR Name); - - - void __RPC_STUB ITuningSpace_put_UniqueName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_FriendlyName_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *Name); - - - void __RPC_STUB ITuningSpace_get_FriendlyName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_FriendlyName_Proxy( - ITuningSpace * This, - /* [in] */ BSTR Name); - - - void __RPC_STUB ITuningSpace_put_FriendlyName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_CLSID_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - - void __RPC_STUB ITuningSpace_get_CLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_NetworkType_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - - void __RPC_STUB ITuningSpace_get_NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_NetworkType_Proxy( - ITuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - - void __RPC_STUB ITuningSpace_put_NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get__NetworkType_Proxy( - ITuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - - void __RPC_STUB ITuningSpace_get__NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put__NetworkType_Proxy( - ITuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - - void __RPC_STUB ITuningSpace_put__NetworkType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_CreateTuneRequest_Proxy( - ITuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - - void __RPC_STUB ITuningSpace_CreateTuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_EnumCategoryGUIDs_Proxy( - ITuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - - void __RPC_STUB ITuningSpace_EnumCategoryGUIDs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ITuningSpace_EnumDeviceMonikers_Proxy( - ITuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - - void __RPC_STUB ITuningSpace_EnumDeviceMonikers_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_DefaultPreferredComponentTypes_Proxy( - ITuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - - void __RPC_STUB ITuningSpace_get_DefaultPreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_DefaultPreferredComponentTypes_Proxy( - ITuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - - void __RPC_STUB ITuningSpace_put_DefaultPreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_FrequencyMapping_Proxy( - ITuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - - void __RPC_STUB ITuningSpace_get_FrequencyMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_FrequencyMapping_Proxy( - ITuningSpace * This, - BSTR Mapping); - - - void __RPC_STUB ITuningSpace_put_FrequencyMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [id][propget] */ HRESULT STDMETHODCALLTYPE ITuningSpace_get_DefaultLocator_Proxy( - ITuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - - void __RPC_STUB ITuningSpace_get_DefaultLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [id][propput] */ HRESULT STDMETHODCALLTYPE ITuningSpace_put_DefaultLocator_Proxy( - ITuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - - void __RPC_STUB ITuningSpace_put_DefaultLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE ITuningSpace_Clone_Proxy( - ITuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - - void __RPC_STUB ITuningSpace_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITuningSpace_INTERFACE_DEFINED__ */ - - - #ifndef __IEnumTuningSpaces_INTERFACE_DEFINED__ - #define __IEnumTuningSpaces_INTERFACE_DEFINED__ - - /* interface IEnumTuningSpaces */ - /* [unique][uuid][object][restricted][hidden] */ - - - EXTERN_C const IID IID_IEnumTuningSpaces; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8B8EB248-FC2B-11d2-9D8C-00C04F72D980") - IEnumTuningSpaces : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumTuningSpaces **ppEnum) = 0; - - }; - - #else /* C style interface */ - - typedef struct IEnumTuningSpacesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumTuningSpaces * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumTuningSpaces * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumTuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumTuningSpaces * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumTuningSpaces * This, - /* [out] */ IEnumTuningSpaces **ppEnum); - - END_INTERFACE - } IEnumTuningSpacesVtbl; - - interface IEnumTuningSpaces - { - CONST_VTBL struct IEnumTuningSpacesVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IEnumTuningSpaces_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IEnumTuningSpaces_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IEnumTuningSpaces_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IEnumTuningSpaces_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - - #define IEnumTuningSpaces_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - - #define IEnumTuningSpaces_Reset(This) \ - (This)->lpVtbl -> Reset(This) - - #define IEnumTuningSpaces_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Next_Proxy( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ ITuningSpace **rgelt, - /* [out] */ ULONG *pceltFetched); - - - void __RPC_STUB IEnumTuningSpaces_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Skip_Proxy( - IEnumTuningSpaces * This, - /* [in] */ ULONG celt); - - - void __RPC_STUB IEnumTuningSpaces_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Reset_Proxy( - IEnumTuningSpaces * This); - - - void __RPC_STUB IEnumTuningSpaces_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumTuningSpaces_Clone_Proxy( - IEnumTuningSpaces * This, - /* [out] */ IEnumTuningSpaces **ppEnum); - - - void __RPC_STUB IEnumTuningSpaces_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IEnumTuningSpaces_INTERFACE_DEFINED__ */ - - - #ifndef __IDVBTuningSpace_INTERFACE_DEFINED__ - #define __IDVBTuningSpace_INTERFACE_DEFINED__ - - /* interface IDVBTuningSpace */ - /* [unique][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IDVBTuningSpace; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ADA0B268-3B19-4e5b-ACC4-49F852BE13BA") - IDVBTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SystemType( - /* [retval][out] */ DVBSystemType *SysType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SystemType( - /* [in] */ DVBSystemType SysType) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDVBTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IDVBTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IDVBTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IDVBTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IDVBTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IDVBTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IDVBTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IDVBTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IDVBTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IDVBTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IDVBTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IDVBTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IDVBTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IDVBTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IDVBTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SystemType )( - IDVBTuningSpace * This, - /* [retval][out] */ DVBSystemType *SysType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SystemType )( - IDVBTuningSpace * This, - /* [in] */ DVBSystemType SysType); - - END_INTERFACE - } IDVBTuningSpaceVtbl; - - interface IDVBTuningSpace - { - CONST_VTBL struct IDVBTuningSpaceVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDVBTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDVBTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDVBTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDVBTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDVBTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDVBTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDVBTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDVBTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - - #define IDVBTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - - #define IDVBTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - - #define IDVBTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - - #define IDVBTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - - #define IDVBTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - - #define IDVBTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - - #define IDVBTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - - #define IDVBTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - - #define IDVBTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - - #define IDVBTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - - #define IDVBTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - - #define IDVBTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - - #define IDVBTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - - #define IDVBTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - - #define IDVBTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - - #define IDVBTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - - #define IDVBTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - - #define IDVBTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - - #define IDVBTuningSpace_get_SystemType(This,SysType) \ - (This)->lpVtbl -> get_SystemType(This,SysType) - - #define IDVBTuningSpace_put_SystemType(This,SysType) \ - (This)->lpVtbl -> put_SystemType(This,SysType) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace_get_SystemType_Proxy( - IDVBTuningSpace * This, - /* [retval][out] */ DVBSystemType *SysType); - - - void __RPC_STUB IDVBTuningSpace_get_SystemType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuningSpace_put_SystemType_Proxy( - IDVBTuningSpace * This, - /* [in] */ DVBSystemType SysType); - - - void __RPC_STUB IDVBTuningSpace_put_SystemType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDVBTuningSpace_INTERFACE_DEFINED__ */ - - - #ifndef __IAnalogTVTuningSpace_INTERFACE_DEFINED__ - #define __IAnalogTVTuningSpace_INTERFACE_DEFINED__ - - /* interface IAnalogTVTuningSpace */ - /* [unique][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IAnalogTVTuningSpace; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E293C-2595-11d3-B64C-00C04F79498E") - IAnalogTVTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinChannel( - /* [retval][out] */ long *MinChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinChannel( - /* [in] */ long NewMinChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxChannel( - /* [retval][out] */ long *MaxChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxChannel( - /* [in] */ long NewMaxChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InputType( - /* [retval][out] */ TunerInputType *InputTypeVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InputType( - /* [in] */ TunerInputType NewInputTypeVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CountryCode( - /* [retval][out] */ long *CountryCodeVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CountryCode( - /* [in] */ long NewCountryCodeVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAnalogTVTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAnalogTVTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAnalogTVTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAnalogTVTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAnalogTVTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAnalogTVTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAnalogTVTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAnalogTVTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IAnalogTVTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IAnalogTVTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IAnalogTVTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IAnalogTVTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IAnalogTVTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinChannel )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinChannel )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxChannel )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxChannel )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InputType )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InputType )( - IAnalogTVTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IAnalogTVTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - END_INTERFACE - } IAnalogTVTuningSpaceVtbl; - - interface IAnalogTVTuningSpace - { - CONST_VTBL struct IAnalogTVTuningSpaceVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAnalogTVTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAnalogTVTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAnalogTVTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAnalogTVTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IAnalogTVTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IAnalogTVTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IAnalogTVTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IAnalogTVTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - - #define IAnalogTVTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - - #define IAnalogTVTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - - #define IAnalogTVTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - - #define IAnalogTVTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - - #define IAnalogTVTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - - #define IAnalogTVTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - - #define IAnalogTVTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - - #define IAnalogTVTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - - #define IAnalogTVTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - - #define IAnalogTVTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - - #define IAnalogTVTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - - #define IAnalogTVTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - - #define IAnalogTVTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - - #define IAnalogTVTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - - #define IAnalogTVTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - - #define IAnalogTVTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - - #define IAnalogTVTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - - #define IAnalogTVTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - - #define IAnalogTVTuningSpace_get_MinChannel(This,MinChannelVal) \ - (This)->lpVtbl -> get_MinChannel(This,MinChannelVal) - - #define IAnalogTVTuningSpace_put_MinChannel(This,NewMinChannelVal) \ - (This)->lpVtbl -> put_MinChannel(This,NewMinChannelVal) - - #define IAnalogTVTuningSpace_get_MaxChannel(This,MaxChannelVal) \ - (This)->lpVtbl -> get_MaxChannel(This,MaxChannelVal) - - #define IAnalogTVTuningSpace_put_MaxChannel(This,NewMaxChannelVal) \ - (This)->lpVtbl -> put_MaxChannel(This,NewMaxChannelVal) - - #define IAnalogTVTuningSpace_get_InputType(This,InputTypeVal) \ - (This)->lpVtbl -> get_InputType(This,InputTypeVal) - - #define IAnalogTVTuningSpace_put_InputType(This,NewInputTypeVal) \ - (This)->lpVtbl -> put_InputType(This,NewInputTypeVal) - - #define IAnalogTVTuningSpace_get_CountryCode(This,CountryCodeVal) \ - (This)->lpVtbl -> get_CountryCode(This,CountryCodeVal) - - #define IAnalogTVTuningSpace_put_CountryCode(This,NewCountryCodeVal) \ - (This)->lpVtbl -> put_CountryCode(This,NewCountryCodeVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_MinChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - - void __RPC_STUB IAnalogTVTuningSpace_get_MinChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_MinChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - - void __RPC_STUB IAnalogTVTuningSpace_put_MinChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_MaxChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - - void __RPC_STUB IAnalogTVTuningSpace_get_MaxChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_MaxChannel_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - - void __RPC_STUB IAnalogTVTuningSpace_put_MaxChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_InputType_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - - void __RPC_STUB IAnalogTVTuningSpace_get_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_InputType_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - - void __RPC_STUB IAnalogTVTuningSpace_put_InputType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_get_CountryCode_Proxy( - IAnalogTVTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - - void __RPC_STUB IAnalogTVTuningSpace_get_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogTVTuningSpace_put_CountryCode_Proxy( - IAnalogTVTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - - void __RPC_STUB IAnalogTVTuningSpace_put_CountryCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAnalogTVTuningSpace_INTERFACE_DEFINED__ */ - - - #ifndef __IATSCTuningSpace_INTERFACE_DEFINED__ - #define __IATSCTuningSpace_INTERFACE_DEFINED__ - - /* interface IATSCTuningSpace */ - /* [unique][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IATSCTuningSpace; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E2-45B6-11d3-B650-00C04F79498E") - IATSCTuningSpace : public IAnalogTVTuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinMinorChannel( - /* [retval][out] */ long *MinMinorChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinMinorChannel( - /* [in] */ long NewMinMinorChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxMinorChannel( - /* [retval][out] */ long *MaxMinorChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxMinorChannel( - /* [in] */ long NewMaxMinorChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinPhysicalChannel( - /* [retval][out] */ long *MinPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinPhysicalChannel( - /* [in] */ long NewMinPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxPhysicalChannel( - /* [retval][out] */ long *MaxPhysicalChannelVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxPhysicalChannel( - /* [in] */ long NewMaxPhysicalChannelVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IATSCTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IATSCTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IATSCTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IATSCTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IATSCTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IATSCTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IATSCTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IATSCTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IATSCTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IATSCTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IATSCTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IATSCTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IATSCTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IATSCTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IATSCTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InputType )( - IATSCTuningSpace * This, - /* [retval][out] */ TunerInputType *InputTypeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InputType )( - IATSCTuningSpace * This, - /* [in] */ TunerInputType NewInputTypeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CountryCode )( - IATSCTuningSpace * This, - /* [retval][out] */ long *CountryCodeVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CountryCode )( - IATSCTuningSpace * This, - /* [in] */ long NewCountryCodeVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinMinorChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinMinorChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinMinorChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinMinorChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxMinorChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxMinorChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxMinorChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxMinorChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinPhysicalChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinPhysicalChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinPhysicalChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMinPhysicalChannelVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxPhysicalChannel )( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxPhysicalChannelVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxPhysicalChannel )( - IATSCTuningSpace * This, - /* [in] */ long NewMaxPhysicalChannelVal); - - END_INTERFACE - } IATSCTuningSpaceVtbl; - - interface IATSCTuningSpace - { - CONST_VTBL struct IATSCTuningSpaceVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IATSCTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IATSCTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IATSCTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IATSCTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IATSCTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IATSCTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IATSCTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IATSCTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - - #define IATSCTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - - #define IATSCTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - - #define IATSCTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - - #define IATSCTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - - #define IATSCTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - - #define IATSCTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - - #define IATSCTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - - #define IATSCTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - - #define IATSCTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - - #define IATSCTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - - #define IATSCTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - - #define IATSCTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - - #define IATSCTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - - #define IATSCTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - - #define IATSCTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - - #define IATSCTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - - #define IATSCTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - - #define IATSCTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - - #define IATSCTuningSpace_get_MinChannel(This,MinChannelVal) \ - (This)->lpVtbl -> get_MinChannel(This,MinChannelVal) - - #define IATSCTuningSpace_put_MinChannel(This,NewMinChannelVal) \ - (This)->lpVtbl -> put_MinChannel(This,NewMinChannelVal) - - #define IATSCTuningSpace_get_MaxChannel(This,MaxChannelVal) \ - (This)->lpVtbl -> get_MaxChannel(This,MaxChannelVal) - - #define IATSCTuningSpace_put_MaxChannel(This,NewMaxChannelVal) \ - (This)->lpVtbl -> put_MaxChannel(This,NewMaxChannelVal) - - #define IATSCTuningSpace_get_InputType(This,InputTypeVal) \ - (This)->lpVtbl -> get_InputType(This,InputTypeVal) - - #define IATSCTuningSpace_put_InputType(This,NewInputTypeVal) \ - (This)->lpVtbl -> put_InputType(This,NewInputTypeVal) - - #define IATSCTuningSpace_get_CountryCode(This,CountryCodeVal) \ - (This)->lpVtbl -> get_CountryCode(This,CountryCodeVal) - - #define IATSCTuningSpace_put_CountryCode(This,NewCountryCodeVal) \ - (This)->lpVtbl -> put_CountryCode(This,NewCountryCodeVal) - - - #define IATSCTuningSpace_get_MinMinorChannel(This,MinMinorChannelVal) \ - (This)->lpVtbl -> get_MinMinorChannel(This,MinMinorChannelVal) - - #define IATSCTuningSpace_put_MinMinorChannel(This,NewMinMinorChannelVal) \ - (This)->lpVtbl -> put_MinMinorChannel(This,NewMinMinorChannelVal) - - #define IATSCTuningSpace_get_MaxMinorChannel(This,MaxMinorChannelVal) \ - (This)->lpVtbl -> get_MaxMinorChannel(This,MaxMinorChannelVal) - - #define IATSCTuningSpace_put_MaxMinorChannel(This,NewMaxMinorChannelVal) \ - (This)->lpVtbl -> put_MaxMinorChannel(This,NewMaxMinorChannelVal) - - #define IATSCTuningSpace_get_MinPhysicalChannel(This,MinPhysicalChannelVal) \ - (This)->lpVtbl -> get_MinPhysicalChannel(This,MinPhysicalChannelVal) - - #define IATSCTuningSpace_put_MinPhysicalChannel(This,NewMinPhysicalChannelVal) \ - (This)->lpVtbl -> put_MinPhysicalChannel(This,NewMinPhysicalChannelVal) - - #define IATSCTuningSpace_get_MaxPhysicalChannel(This,MaxPhysicalChannelVal) \ - (This)->lpVtbl -> get_MaxPhysicalChannel(This,MaxPhysicalChannelVal) - - #define IATSCTuningSpace_put_MaxPhysicalChannel(This,NewMaxPhysicalChannelVal) \ - (This)->lpVtbl -> put_MaxPhysicalChannel(This,NewMaxPhysicalChannelVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MinMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinMinorChannelVal); - - - void __RPC_STUB IATSCTuningSpace_get_MinMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MinMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMinMinorChannelVal); - - - void __RPC_STUB IATSCTuningSpace_put_MinMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MaxMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxMinorChannelVal); - - - void __RPC_STUB IATSCTuningSpace_get_MaxMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MaxMinorChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMaxMinorChannelVal); - - - void __RPC_STUB IATSCTuningSpace_put_MaxMinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MinPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MinPhysicalChannelVal); - - - void __RPC_STUB IATSCTuningSpace_get_MinPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MinPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMinPhysicalChannelVal); - - - void __RPC_STUB IATSCTuningSpace_put_MinPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_get_MaxPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [retval][out] */ long *MaxPhysicalChannelVal); - - - void __RPC_STUB IATSCTuningSpace_get_MaxPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCTuningSpace_put_MaxPhysicalChannel_Proxy( - IATSCTuningSpace * This, - /* [in] */ long NewMaxPhysicalChannelVal); - - - void __RPC_STUB IATSCTuningSpace_put_MaxPhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IATSCTuningSpace_INTERFACE_DEFINED__ */ - - - #ifndef __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ - #define __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ - - /* interface IAnalogRadioTuningSpace */ - /* [unique][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IAnalogRadioTuningSpace; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E293B-2595-11d3-B64C-00C04F79498E") - IAnalogRadioTuningSpace : public ITuningSpace - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinFrequency( - /* [retval][out] */ long *MinFrequencyVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinFrequency( - /* [in] */ long NewMinFrequencyVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxFrequency( - /* [retval][out] */ long *MaxFrequencyVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxFrequency( - /* [in] */ long NewMaxFrequencyVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Step( - /* [retval][out] */ long *StepVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Step( - /* [in] */ long NewStepVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IAnalogRadioTuningSpaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAnalogRadioTuningSpace * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAnalogRadioTuningSpace * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IAnalogRadioTuningSpace * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IAnalogRadioTuningSpace * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IAnalogRadioTuningSpace * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueName )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_UniqueName )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *Name); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR Name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CLSID )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *SpaceCLSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkType )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *NetworkTypeGuid); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_NetworkType )( - IAnalogRadioTuningSpace * This, - /* [in] */ BSTR NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NetworkType )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ GUID *NetworkTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__NetworkType )( - IAnalogRadioTuningSpace * This, - /* [in] */ REFCLSID NetworkTypeGuid); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateTuneRequest )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumCategoryGUIDs )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IEnumGUID **ppEnum); - - /* [restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceMonikers )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IEnumMoniker **ppEnum); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultPreferredComponentTypes )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultPreferredComponentTypes )( - IAnalogRadioTuningSpace * This, - /* [in] */ IComponentTypes *NewComponentTypes); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrequencyMapping )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ BSTR *pMapping); - - /* [restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FrequencyMapping )( - IAnalogRadioTuningSpace * This, - BSTR Mapping); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultLocator )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ILocator **LocatorVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultLocator )( - IAnalogRadioTuningSpace * This, - /* [in] */ ILocator *LocatorVal); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ ITuningSpace **NewTS); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinFrequency )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MinFrequencyVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinFrequency )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMinFrequencyVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxFrequency )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MaxFrequencyVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxFrequency )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMaxFrequencyVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Step )( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *StepVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Step )( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewStepVal); - - END_INTERFACE - } IAnalogRadioTuningSpaceVtbl; - - interface IAnalogRadioTuningSpace - { - CONST_VTBL struct IAnalogRadioTuningSpaceVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IAnalogRadioTuningSpace_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IAnalogRadioTuningSpace_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IAnalogRadioTuningSpace_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IAnalogRadioTuningSpace_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IAnalogRadioTuningSpace_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IAnalogRadioTuningSpace_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IAnalogRadioTuningSpace_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IAnalogRadioTuningSpace_get_UniqueName(This,Name) \ - (This)->lpVtbl -> get_UniqueName(This,Name) - - #define IAnalogRadioTuningSpace_put_UniqueName(This,Name) \ - (This)->lpVtbl -> put_UniqueName(This,Name) - - #define IAnalogRadioTuningSpace_get_FriendlyName(This,Name) \ - (This)->lpVtbl -> get_FriendlyName(This,Name) - - #define IAnalogRadioTuningSpace_put_FriendlyName(This,Name) \ - (This)->lpVtbl -> put_FriendlyName(This,Name) - - #define IAnalogRadioTuningSpace_get_CLSID(This,SpaceCLSID) \ - (This)->lpVtbl -> get_CLSID(This,SpaceCLSID) - - #define IAnalogRadioTuningSpace_get_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get_NetworkType(This,NetworkTypeGuid) - - #define IAnalogRadioTuningSpace_put_NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put_NetworkType(This,NetworkTypeGuid) - - #define IAnalogRadioTuningSpace_get__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> get__NetworkType(This,NetworkTypeGuid) - - #define IAnalogRadioTuningSpace_put__NetworkType(This,NetworkTypeGuid) \ - (This)->lpVtbl -> put__NetworkType(This,NetworkTypeGuid) - - #define IAnalogRadioTuningSpace_CreateTuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> CreateTuneRequest(This,TuneRequest) - - #define IAnalogRadioTuningSpace_EnumCategoryGUIDs(This,ppEnum) \ - (This)->lpVtbl -> EnumCategoryGUIDs(This,ppEnum) - - #define IAnalogRadioTuningSpace_EnumDeviceMonikers(This,ppEnum) \ - (This)->lpVtbl -> EnumDeviceMonikers(This,ppEnum) - - #define IAnalogRadioTuningSpace_get_DefaultPreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_DefaultPreferredComponentTypes(This,ComponentTypes) - - #define IAnalogRadioTuningSpace_put_DefaultPreferredComponentTypes(This,NewComponentTypes) \ - (This)->lpVtbl -> put_DefaultPreferredComponentTypes(This,NewComponentTypes) - - #define IAnalogRadioTuningSpace_get_FrequencyMapping(This,pMapping) \ - (This)->lpVtbl -> get_FrequencyMapping(This,pMapping) - - #define IAnalogRadioTuningSpace_put_FrequencyMapping(This,Mapping) \ - (This)->lpVtbl -> put_FrequencyMapping(This,Mapping) - - #define IAnalogRadioTuningSpace_get_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> get_DefaultLocator(This,LocatorVal) - - #define IAnalogRadioTuningSpace_put_DefaultLocator(This,LocatorVal) \ - (This)->lpVtbl -> put_DefaultLocator(This,LocatorVal) - - #define IAnalogRadioTuningSpace_Clone(This,NewTS) \ - (This)->lpVtbl -> Clone(This,NewTS) - - - #define IAnalogRadioTuningSpace_get_MinFrequency(This,MinFrequencyVal) \ - (This)->lpVtbl -> get_MinFrequency(This,MinFrequencyVal) - - #define IAnalogRadioTuningSpace_put_MinFrequency(This,NewMinFrequencyVal) \ - (This)->lpVtbl -> put_MinFrequency(This,NewMinFrequencyVal) - - #define IAnalogRadioTuningSpace_get_MaxFrequency(This,MaxFrequencyVal) \ - (This)->lpVtbl -> get_MaxFrequency(This,MaxFrequencyVal) - - #define IAnalogRadioTuningSpace_put_MaxFrequency(This,NewMaxFrequencyVal) \ - (This)->lpVtbl -> put_MaxFrequency(This,NewMaxFrequencyVal) - - #define IAnalogRadioTuningSpace_get_Step(This,StepVal) \ - (This)->lpVtbl -> get_Step(This,StepVal) - - #define IAnalogRadioTuningSpace_put_Step(This,NewStepVal) \ - (This)->lpVtbl -> put_Step(This,NewStepVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_MinFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MinFrequencyVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_get_MinFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_MinFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMinFrequencyVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_put_MinFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_MaxFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *MaxFrequencyVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_get_MaxFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_MaxFrequency_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewMaxFrequencyVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_put_MaxFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_get_Step_Proxy( - IAnalogRadioTuningSpace * This, - /* [retval][out] */ long *StepVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_get_Step_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IAnalogRadioTuningSpace_put_Step_Proxy( - IAnalogRadioTuningSpace * This, - /* [in] */ long NewStepVal); - - - void __RPC_STUB IAnalogRadioTuningSpace_put_Step_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IAnalogRadioTuningSpace_INTERFACE_DEFINED__ */ - - - #ifndef __ITuneRequest_INTERFACE_DEFINED__ - #define __ITuneRequest_INTERFACE_DEFINED__ - - /* interface ITuneRequest */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_ITuneRequest; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("07DDC146-FC3D-11d2-9D8C-00C04F72D980") - ITuneRequest : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TuningSpace( - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Components( - /* [retval][out] */ IComponents **Components) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ITuneRequest **NewTuneRequest) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Locator( - /* [retval][out] */ ILocator **Locator) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Locator( - /* [in] */ ILocator *Locator) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ITuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ITuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ITuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ITuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - ITuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - ITuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ITuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - ITuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - ITuneRequest * This, - /* [in] */ ILocator *Locator); - - END_INTERFACE - } ITuneRequestVtbl; - - interface ITuneRequest - { - CONST_VTBL struct ITuneRequestVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ITuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ITuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ITuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ITuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define ITuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - - #define ITuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - - #define ITuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - - #define ITuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_TuningSpace_Proxy( - ITuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - - void __RPC_STUB ITuneRequest_get_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_Components_Proxy( - ITuneRequest * This, - /* [retval][out] */ IComponents **Components); - - - void __RPC_STUB ITuneRequest_get_Components_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ITuneRequest_Clone_Proxy( - ITuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - - void __RPC_STUB ITuneRequest_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ITuneRequest_get_Locator_Proxy( - ITuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - - void __RPC_STUB ITuneRequest_get_Locator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ITuneRequest_put_Locator_Proxy( - ITuneRequest * This, - /* [in] */ ILocator *Locator); - - - void __RPC_STUB ITuneRequest_put_Locator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITuneRequest_INTERFACE_DEFINED__ */ - - - #ifndef __IChannelTuneRequest_INTERFACE_DEFINED__ - #define __IChannelTuneRequest_INTERFACE_DEFINED__ - - /* interface IChannelTuneRequest */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IChannelTuneRequest; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E0-45B6-11d3-B650-00C04F79498E") - IChannelTuneRequest : public ITuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Channel( - /* [retval][out] */ long *Channel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Channel( - /* [in] */ long Channel) = 0; - - }; - - #else /* C style interface */ - - typedef struct IChannelTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IChannelTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IChannelTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IChannelTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IChannelTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IChannelTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IChannelTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IChannelTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IChannelTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IChannelTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IChannelTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IChannelTuneRequest * This, - /* [in] */ long Channel); - - END_INTERFACE - } IChannelTuneRequestVtbl; - - interface IChannelTuneRequest - { - CONST_VTBL struct IChannelTuneRequestVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IChannelTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IChannelTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IChannelTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IChannelTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IChannelTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IChannelTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IChannelTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IChannelTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define IChannelTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - - #define IChannelTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - - #define IChannelTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - - #define IChannelTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - - #define IChannelTuneRequest_get_Channel(This,Channel) \ - (This)->lpVtbl -> get_Channel(This,Channel) - - #define IChannelTuneRequest_put_Channel(This,Channel) \ - (This)->lpVtbl -> put_Channel(This,Channel) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IChannelTuneRequest_get_Channel_Proxy( - IChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - - void __RPC_STUB IChannelTuneRequest_get_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IChannelTuneRequest_put_Channel_Proxy( - IChannelTuneRequest * This, - /* [in] */ long Channel); - - - void __RPC_STUB IChannelTuneRequest_put_Channel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IChannelTuneRequest_INTERFACE_DEFINED__ */ - - - #ifndef __IATSCChannelTuneRequest_INTERFACE_DEFINED__ - #define __IATSCChannelTuneRequest_INTERFACE_DEFINED__ - - /* interface IATSCChannelTuneRequest */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IATSCChannelTuneRequest; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0369B4E1-45B6-11d3-B650-00C04F79498E") - IATSCChannelTuneRequest : public IChannelTuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinorChannel( - /* [retval][out] */ long *MinorChannel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MinorChannel( - /* [in] */ long MinorChannel) = 0; - - }; - - #else /* C style interface */ - - typedef struct IATSCChannelTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCChannelTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCChannelTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCChannelTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCChannelTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCChannelTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCChannelTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IATSCChannelTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Channel )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *Channel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Channel )( - IATSCChannelTuneRequest * This, - /* [in] */ long Channel); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinorChannel )( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *MinorChannel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MinorChannel )( - IATSCChannelTuneRequest * This, - /* [in] */ long MinorChannel); - - END_INTERFACE - } IATSCChannelTuneRequestVtbl; - - interface IATSCChannelTuneRequest - { - CONST_VTBL struct IATSCChannelTuneRequestVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IATSCChannelTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IATSCChannelTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IATSCChannelTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IATSCChannelTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IATSCChannelTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IATSCChannelTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IATSCChannelTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IATSCChannelTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define IATSCChannelTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - - #define IATSCChannelTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - - #define IATSCChannelTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - - #define IATSCChannelTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - - #define IATSCChannelTuneRequest_get_Channel(This,Channel) \ - (This)->lpVtbl -> get_Channel(This,Channel) - - #define IATSCChannelTuneRequest_put_Channel(This,Channel) \ - (This)->lpVtbl -> put_Channel(This,Channel) - - - #define IATSCChannelTuneRequest_get_MinorChannel(This,MinorChannel) \ - (This)->lpVtbl -> get_MinorChannel(This,MinorChannel) - - #define IATSCChannelTuneRequest_put_MinorChannel(This,MinorChannel) \ - (This)->lpVtbl -> put_MinorChannel(This,MinorChannel) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCChannelTuneRequest_get_MinorChannel_Proxy( - IATSCChannelTuneRequest * This, - /* [retval][out] */ long *MinorChannel); - - - void __RPC_STUB IATSCChannelTuneRequest_get_MinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCChannelTuneRequest_put_MinorChannel_Proxy( - IATSCChannelTuneRequest * This, - /* [in] */ long MinorChannel); - - - void __RPC_STUB IATSCChannelTuneRequest_put_MinorChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IATSCChannelTuneRequest_INTERFACE_DEFINED__ */ - - - #ifndef __IDVBTuneRequest_INTERFACE_DEFINED__ - #define __IDVBTuneRequest_INTERFACE_DEFINED__ - - /* interface IDVBTuneRequest */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IDVBTuneRequest; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0D6F567E-A636-42bb-83BA-CE4C1704AFA2") - IDVBTuneRequest : public ITuneRequest - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ONID( - /* [retval][out] */ long *ONID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ONID( - /* [in] */ long ONID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TSID( - /* [retval][out] */ long *TSID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TSID( - /* [in] */ long TSID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SID( - /* [retval][out] */ long *SID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SID( - /* [in] */ long SID) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDVBTuneRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTuneRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTuneRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTuneRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTuneRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTuneRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTuneRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTuneRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IDVBTuneRequest * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Components )( - IDVBTuneRequest * This, - /* [retval][out] */ IComponents **Components); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTuneRequest * This, - /* [retval][out] */ ITuneRequest **NewTuneRequest); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Locator )( - IDVBTuneRequest * This, - /* [retval][out] */ ILocator **Locator); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Locator )( - IDVBTuneRequest * This, - /* [in] */ ILocator *Locator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ONID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *ONID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ONID )( - IDVBTuneRequest * This, - /* [in] */ long ONID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TSID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *TSID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TSID )( - IDVBTuneRequest * This, - /* [in] */ long TSID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SID )( - IDVBTuneRequest * This, - /* [retval][out] */ long *SID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SID )( - IDVBTuneRequest * This, - /* [in] */ long SID); - - END_INTERFACE - } IDVBTuneRequestVtbl; - - interface IDVBTuneRequest - { - CONST_VTBL struct IDVBTuneRequestVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDVBTuneRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDVBTuneRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDVBTuneRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDVBTuneRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDVBTuneRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDVBTuneRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDVBTuneRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDVBTuneRequest_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define IDVBTuneRequest_get_Components(This,Components) \ - (This)->lpVtbl -> get_Components(This,Components) - - #define IDVBTuneRequest_Clone(This,NewTuneRequest) \ - (This)->lpVtbl -> Clone(This,NewTuneRequest) - - #define IDVBTuneRequest_get_Locator(This,Locator) \ - (This)->lpVtbl -> get_Locator(This,Locator) - - #define IDVBTuneRequest_put_Locator(This,Locator) \ - (This)->lpVtbl -> put_Locator(This,Locator) - - - #define IDVBTuneRequest_get_ONID(This,ONID) \ - (This)->lpVtbl -> get_ONID(This,ONID) - - #define IDVBTuneRequest_put_ONID(This,ONID) \ - (This)->lpVtbl -> put_ONID(This,ONID) - - #define IDVBTuneRequest_get_TSID(This,TSID) \ - (This)->lpVtbl -> get_TSID(This,TSID) - - #define IDVBTuneRequest_put_TSID(This,TSID) \ - (This)->lpVtbl -> put_TSID(This,TSID) - - #define IDVBTuneRequest_get_SID(This,SID) \ - (This)->lpVtbl -> get_SID(This,SID) - - #define IDVBTuneRequest_put_SID(This,SID) \ - (This)->lpVtbl -> put_SID(This,SID) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_ONID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *ONID); - - - void __RPC_STUB IDVBTuneRequest_get_ONID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_ONID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long ONID); - - - void __RPC_STUB IDVBTuneRequest_put_ONID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_TSID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *TSID); - - - void __RPC_STUB IDVBTuneRequest_get_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_TSID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long TSID); - - - void __RPC_STUB IDVBTuneRequest_put_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_get_SID_Proxy( - IDVBTuneRequest * This, - /* [retval][out] */ long *SID); - - - void __RPC_STUB IDVBTuneRequest_get_SID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTuneRequest_put_SID_Proxy( - IDVBTuneRequest * This, - /* [in] */ long SID); - - - void __RPC_STUB IDVBTuneRequest_put_SID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDVBTuneRequest_INTERFACE_DEFINED__ */ - - - #ifndef __ITuner_INTERFACE_DEFINED__ - #define __ITuner_INTERFACE_DEFINED__ - - /* interface ITuner */ - /* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_ITuner; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("28C52640-018A-11d3-9D8E-00C04F72D980") - ITuner : public IUnknown - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_TuningSpace( - /* [retval][out] */ ITuningSpace **TuningSpace) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_TuningSpace( - /* [in] */ ITuningSpace *TuningSpace) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumTuningSpaces( - /* [retval][out] */ IEnumTuningSpaces **ppEnum) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_TuneRequest( - /* [retval][out] */ ITuneRequest **TuneRequest) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_TuneRequest( - /* [in] */ ITuneRequest *TuneRequest) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Validate( - /* [in] */ ITuneRequest *TuneRequest) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PreferredComponentTypes( - /* [retval][out] */ IComponentTypes **ComponentTypes) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_PreferredComponentTypes( - /* [in] */ IComponentTypes *ComponentTypes) = 0; - - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_SignalStrength( - /* [retval][out] */ long *Strength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TriggerSignalEvents( - /* [in] */ long Interval) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITuner * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - ITuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - ITuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumTuningSpaces )( - ITuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuneRequest )( - ITuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuneRequest )( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Validate )( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreferredComponentTypes )( - ITuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PreferredComponentTypes )( - ITuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalStrength )( - ITuner * This, - /* [retval][out] */ long *Strength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TriggerSignalEvents )( - ITuner * This, - /* [in] */ long Interval); - - END_INTERFACE - } ITunerVtbl; - - interface ITuner - { - CONST_VTBL struct ITunerVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITuner_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define ITuner_put_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,TuningSpace) - - #define ITuner_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> EnumTuningSpaces(This,ppEnum) - - #define ITuner_get_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> get_TuneRequest(This,TuneRequest) - - #define ITuner_put_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> put_TuneRequest(This,TuneRequest) - - #define ITuner_Validate(This,TuneRequest) \ - (This)->lpVtbl -> Validate(This,TuneRequest) - - #define ITuner_get_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_PreferredComponentTypes(This,ComponentTypes) - - #define ITuner_put_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> put_PreferredComponentTypes(This,ComponentTypes) - - #define ITuner_get_SignalStrength(This,Strength) \ - (This)->lpVtbl -> get_SignalStrength(This,Strength) - - #define ITuner_TriggerSignalEvents(This,Interval) \ - (This)->lpVtbl -> TriggerSignalEvents(This,Interval) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_TuningSpace_Proxy( - ITuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - - void __RPC_STUB ITuner_get_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_TuningSpace_Proxy( - ITuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - - void __RPC_STUB ITuner_put_TuningSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE ITuner_EnumTuningSpaces_Proxy( - ITuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - - void __RPC_STUB ITuner_EnumTuningSpaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_TuneRequest_Proxy( - ITuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - - void __RPC_STUB ITuner_get_TuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_TuneRequest_Proxy( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - - void __RPC_STUB ITuner_put_TuneRequest_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuner_Validate_Proxy( - ITuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - - void __RPC_STUB ITuner_Validate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_PreferredComponentTypes_Proxy( - ITuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - - void __RPC_STUB ITuner_get_PreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE ITuner_put_PreferredComponentTypes_Proxy( - ITuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - - void __RPC_STUB ITuner_put_PreferredComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE ITuner_get_SignalStrength_Proxy( - ITuner * This, - /* [retval][out] */ long *Strength); - - - void __RPC_STUB ITuner_get_SignalStrength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITuner_TriggerSignalEvents_Proxy( - ITuner * This, - /* [in] */ long Interval); - - - void __RPC_STUB ITuner_TriggerSignalEvents_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITuner_INTERFACE_DEFINED__ */ - - - #ifndef __IScanningTuner_INTERFACE_DEFINED__ - #define __IScanningTuner_INTERFACE_DEFINED__ - - /* interface IScanningTuner */ - /* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IScanningTuner; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1DFD0A5C-0284-11d3-9D8E-00C04F72D980") - IScanningTuner : public ITuner - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SeekUp( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SeekDown( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ScanUp( - /* [in] */ long MillisecondsPause) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ScanDown( - /* [in] */ long MillisecondsPause) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AutoProgram( void) = 0; - - }; - - #else /* C style interface */ - - typedef struct IScanningTunerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IScanningTuner * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IScanningTuner * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IScanningTuner * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuningSpace )( - IScanningTuner * This, - /* [retval][out] */ ITuningSpace **TuningSpace); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuningSpace )( - IScanningTuner * This, - /* [in] */ ITuningSpace *TuningSpace); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumTuningSpaces )( - IScanningTuner * This, - /* [retval][out] */ IEnumTuningSpaces **ppEnum); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TuneRequest )( - IScanningTuner * This, - /* [retval][out] */ ITuneRequest **TuneRequest); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TuneRequest )( - IScanningTuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Validate )( - IScanningTuner * This, - /* [in] */ ITuneRequest *TuneRequest); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreferredComponentTypes )( - IScanningTuner * This, - /* [retval][out] */ IComponentTypes **ComponentTypes); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PreferredComponentTypes )( - IScanningTuner * This, - /* [in] */ IComponentTypes *ComponentTypes); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalStrength )( - IScanningTuner * This, - /* [retval][out] */ long *Strength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TriggerSignalEvents )( - IScanningTuner * This, - /* [in] */ long Interval); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SeekUp )( - IScanningTuner * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SeekDown )( - IScanningTuner * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ScanUp )( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ScanDown )( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AutoProgram )( - IScanningTuner * This); - - END_INTERFACE - } IScanningTunerVtbl; - - interface IScanningTuner - { - CONST_VTBL struct IScanningTunerVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IScanningTuner_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IScanningTuner_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IScanningTuner_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IScanningTuner_get_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> get_TuningSpace(This,TuningSpace) - - #define IScanningTuner_put_TuningSpace(This,TuningSpace) \ - (This)->lpVtbl -> put_TuningSpace(This,TuningSpace) - - #define IScanningTuner_EnumTuningSpaces(This,ppEnum) \ - (This)->lpVtbl -> EnumTuningSpaces(This,ppEnum) - - #define IScanningTuner_get_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> get_TuneRequest(This,TuneRequest) - - #define IScanningTuner_put_TuneRequest(This,TuneRequest) \ - (This)->lpVtbl -> put_TuneRequest(This,TuneRequest) - - #define IScanningTuner_Validate(This,TuneRequest) \ - (This)->lpVtbl -> Validate(This,TuneRequest) - - #define IScanningTuner_get_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> get_PreferredComponentTypes(This,ComponentTypes) - - #define IScanningTuner_put_PreferredComponentTypes(This,ComponentTypes) \ - (This)->lpVtbl -> put_PreferredComponentTypes(This,ComponentTypes) - - #define IScanningTuner_get_SignalStrength(This,Strength) \ - (This)->lpVtbl -> get_SignalStrength(This,Strength) - - #define IScanningTuner_TriggerSignalEvents(This,Interval) \ - (This)->lpVtbl -> TriggerSignalEvents(This,Interval) - - - #define IScanningTuner_SeekUp(This) \ - (This)->lpVtbl -> SeekUp(This) - - #define IScanningTuner_SeekDown(This) \ - (This)->lpVtbl -> SeekDown(This) - - #define IScanningTuner_ScanUp(This,MillisecondsPause) \ - (This)->lpVtbl -> ScanUp(This,MillisecondsPause) - - #define IScanningTuner_ScanDown(This,MillisecondsPause) \ - (This)->lpVtbl -> ScanDown(This,MillisecondsPause) - - #define IScanningTuner_AutoProgram(This) \ - (This)->lpVtbl -> AutoProgram(This) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_SeekUp_Proxy( - IScanningTuner * This); - - - void __RPC_STUB IScanningTuner_SeekUp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_SeekDown_Proxy( - IScanningTuner * This); - - - void __RPC_STUB IScanningTuner_SeekDown_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_ScanUp_Proxy( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - - void __RPC_STUB IScanningTuner_ScanUp_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_ScanDown_Proxy( - IScanningTuner * This, - /* [in] */ long MillisecondsPause); - - - void __RPC_STUB IScanningTuner_ScanDown_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IScanningTuner_AutoProgram_Proxy( - IScanningTuner * This); - - - void __RPC_STUB IScanningTuner_AutoProgram_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IScanningTuner_INTERFACE_DEFINED__ */ - - - #ifndef __ITunerEvents_INTERFACE_DEFINED__ - #define __ITunerEvents_INTERFACE_DEFINED__ - - /* interface ITunerEvents */ - /* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_ITunerEvents; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("68481420-0280-11d3-9D8E-00C04F72D980") - ITunerEvents : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OnTune( - /* [in] */ ITuneRequest **Request, - /* [in] */ long *Strength) = 0; - - }; - - #else /* C style interface */ - - typedef struct ITunerEventsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ITunerEvents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ITunerEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ITunerEvents * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *OnTune )( - ITunerEvents * This, - /* [in] */ ITuneRequest **Request, - /* [in] */ long *Strength); - - END_INTERFACE - } ITunerEventsVtbl; - - interface ITunerEvents - { - CONST_VTBL struct ITunerEventsVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ITunerEvents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ITunerEvents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ITunerEvents_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ITunerEvents_OnTune(This,Request,Strength) \ - (This)->lpVtbl -> OnTune(This,Request,Strength) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ITunerEvents_OnTune_Proxy( - ITunerEvents * This, - /* [in] */ ITuneRequest **Request, - /* [in] */ long *Strength); - - - void __RPC_STUB ITunerEvents_OnTune_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ITunerEvents_INTERFACE_DEFINED__ */ - - - #ifndef __ISignalEvents_INTERFACE_DEFINED__ - #define __ISignalEvents_INTERFACE_DEFINED__ - - /* interface ISignalEvents */ - /* [unique][helpstring][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_ISignalEvents; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("85E2439E-0E23-11d3-9D8E-00C04F72D980") - ISignalEvents : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OnSignal( - /* [out] */ long *Strength) = 0; - - }; - - #else /* C style interface */ - - typedef struct ISignalEventsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISignalEvents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISignalEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISignalEvents * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *OnSignal )( - ISignalEvents * This, - /* [out] */ long *Strength); - - END_INTERFACE - } ISignalEventsVtbl; - - interface ISignalEvents - { - CONST_VTBL struct ISignalEventsVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ISignalEvents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ISignalEvents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ISignalEvents_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ISignalEvents_OnSignal(This,Strength) \ - (This)->lpVtbl -> OnSignal(This,Strength) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISignalEvents_OnSignal_Proxy( - ISignalEvents * This, - /* [out] */ long *Strength); - - - void __RPC_STUB ISignalEvents_OnSignal_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ISignalEvents_INTERFACE_DEFINED__ */ - - - #ifndef __IComponentType_INTERFACE_DEFINED__ - #define __IComponentType_INTERFACE_DEFINED__ - - /* interface IComponentType */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IComponentType; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6A340DC0-0311-11d3-9D8E-00C04F72D980") - IComponentType : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Category( - /* [retval][out] */ ComponentCategory *Category) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Category( - /* [in] */ ComponentCategory Category) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaMajorType( - /* [retval][out] */ BSTR *MediaMajorType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaMajorType( - /* [in] */ BSTR MediaMajorType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaMajorType( - /* [retval][out] */ GUID *MediaMajorTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaMajorType( - /* [in] */ REFCLSID MediaMajorTypeGuid) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaSubType( - /* [retval][out] */ BSTR *MediaSubType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaSubType( - /* [in] */ BSTR MediaSubType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaSubType( - /* [retval][out] */ GUID *MediaSubTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaSubType( - /* [in] */ REFCLSID MediaSubTypeGuid) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaFormatType( - /* [retval][out] */ BSTR *MediaFormatType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaFormatType( - /* [in] */ BSTR MediaFormatType) = 0; - - virtual /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get__MediaFormatType( - /* [retval][out] */ GUID *MediaFormatTypeGuid) = 0; - - virtual /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put__MediaFormatType( - /* [in] */ REFCLSID MediaFormatTypeGuid) = 0; - - virtual /* [helpstring][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_MediaType( - /* [retval][out] */ AM_MEDIA_TYPE *MediaType) = 0; - - virtual /* [helpstring][restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_MediaType( - /* [in] */ AM_MEDIA_TYPE *MediaType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponentType **NewCT) = 0; - - }; - - #else /* C style interface */ - - typedef struct IComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - END_INTERFACE - } IComponentTypeVtbl; - - interface IComponentType - { - CONST_VTBL struct IComponentTypeVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - - #define IComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - - #define IComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - - #define IComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - - #define IComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - - #define IComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - - #define IComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - - #define IComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - - #define IComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - - #define IComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - - #define IComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - - #define IComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - - #define IComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - - #define IComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - - #define IComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - - #define IComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - - #define IComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_Category_Proxy( - IComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - - void __RPC_STUB IComponentType_get_Category_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_Category_Proxy( - IComponentType * This, - /* [in] */ ComponentCategory Category); - - - void __RPC_STUB IComponentType_put_Category_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaMajorType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - - void __RPC_STUB IComponentType_get_MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaMajorType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaMajorType); - - - void __RPC_STUB IComponentType_put_MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaMajorType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - - void __RPC_STUB IComponentType_get__MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaMajorType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - - void __RPC_STUB IComponentType_put__MediaMajorType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaSubType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - - void __RPC_STUB IComponentType_get_MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaSubType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaSubType); - - - void __RPC_STUB IComponentType_put_MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaSubType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - - void __RPC_STUB IComponentType_get__MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaSubType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - - void __RPC_STUB IComponentType_put__MediaSubType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaFormatType_Proxy( - IComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - - void __RPC_STUB IComponentType_get_MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaFormatType_Proxy( - IComponentType * This, - /* [in] */ BSTR MediaFormatType); - - - void __RPC_STUB IComponentType_put_MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get__MediaFormatType_Proxy( - IComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - - void __RPC_STUB IComponentType_get__MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put__MediaFormatType_Proxy( - IComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - - void __RPC_STUB IComponentType_put__MediaFormatType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentType_get_MediaType_Proxy( - IComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - - void __RPC_STUB IComponentType_get_MediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT STDMETHODCALLTYPE IComponentType_put_MediaType_Proxy( - IComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - - void __RPC_STUB IComponentType_put_MediaType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentType_Clone_Proxy( - IComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - - void __RPC_STUB IComponentType_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IComponentType_INTERFACE_DEFINED__ */ - - - #ifndef __ILanguageComponentType_INTERFACE_DEFINED__ - #define __ILanguageComponentType_INTERFACE_DEFINED__ - - /* interface ILanguageComponentType */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_ILanguageComponentType; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B874C8BA-0FA2-11d3-9D8E-00C04F72D980") - ILanguageComponentType : public IComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LangID( - /* [retval][out] */ long *LangID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LangID( - /* [in] */ long LangID) = 0; - - }; - - #else /* C style interface */ - - typedef struct ILanguageComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ILanguageComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ILanguageComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ILanguageComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ILanguageComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ILanguageComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ILanguageComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ILanguageComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - ILanguageComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - ILanguageComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - ILanguageComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - ILanguageComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - ILanguageComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - ILanguageComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - ILanguageComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - ILanguageComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ILanguageComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - ILanguageComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - ILanguageComponentType * This, - /* [in] */ long LangID); - - END_INTERFACE - } ILanguageComponentTypeVtbl; - - interface ILanguageComponentType - { - CONST_VTBL struct ILanguageComponentTypeVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ILanguageComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ILanguageComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ILanguageComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ILanguageComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ILanguageComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ILanguageComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ILanguageComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ILanguageComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - - #define ILanguageComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - - #define ILanguageComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - - #define ILanguageComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - - #define ILanguageComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - - #define ILanguageComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - - #define ILanguageComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - - #define ILanguageComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - - #define ILanguageComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - - #define ILanguageComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - - #define ILanguageComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - - #define ILanguageComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - - #define ILanguageComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - - #define ILanguageComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - - #define ILanguageComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - - #define ILanguageComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - - #define ILanguageComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - - #define ILanguageComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - - #define ILanguageComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILanguageComponentType_get_LangID_Proxy( - ILanguageComponentType * This, - /* [retval][out] */ long *LangID); - - - void __RPC_STUB ILanguageComponentType_get_LangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILanguageComponentType_put_LangID_Proxy( - ILanguageComponentType * This, - /* [in] */ long LangID); - - - void __RPC_STUB ILanguageComponentType_put_LangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ILanguageComponentType_INTERFACE_DEFINED__ */ - - - #ifndef __IMPEG2ComponentType_INTERFACE_DEFINED__ - #define __IMPEG2ComponentType_INTERFACE_DEFINED__ - - /* interface IMPEG2ComponentType */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IMPEG2ComponentType; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2C073D84-B51C-48c9-AA9F-68971E1F6E38") - IMPEG2ComponentType : public ILanguageComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( - /* [retval][out] */ MPEG2StreamType *MP2StreamType) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StreamType( - /* [in] */ MPEG2StreamType MP2StreamType) = 0; - - }; - - #else /* C style interface */ - - typedef struct IMPEG2ComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2ComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2ComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2ComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2ComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2ComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2ComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2ComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IMPEG2ComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IMPEG2ComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IMPEG2ComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IMPEG2ComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IMPEG2ComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IMPEG2ComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IMPEG2ComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IMPEG2ComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IMPEG2ComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - IMPEG2ComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - IMPEG2ComponentType * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IMPEG2ComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StreamType )( - IMPEG2ComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - END_INTERFACE - } IMPEG2ComponentTypeVtbl; - - interface IMPEG2ComponentType - { - CONST_VTBL struct IMPEG2ComponentTypeVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IMPEG2ComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IMPEG2ComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IMPEG2ComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IMPEG2ComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IMPEG2ComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IMPEG2ComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IMPEG2ComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IMPEG2ComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - - #define IMPEG2ComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - - #define IMPEG2ComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - - #define IMPEG2ComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - - #define IMPEG2ComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - - #define IMPEG2ComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - - #define IMPEG2ComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - - #define IMPEG2ComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - - #define IMPEG2ComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - - #define IMPEG2ComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - - #define IMPEG2ComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - - #define IMPEG2ComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - - #define IMPEG2ComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - - #define IMPEG2ComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - - #define IMPEG2ComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - - #define IMPEG2ComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - - #define IMPEG2ComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - - #define IMPEG2ComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - - #define IMPEG2ComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - - - #define IMPEG2ComponentType_get_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> get_StreamType(This,MP2StreamType) - - #define IMPEG2ComponentType_put_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> put_StreamType(This,MP2StreamType) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2ComponentType_get_StreamType_Proxy( - IMPEG2ComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - - void __RPC_STUB IMPEG2ComponentType_get_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2ComponentType_put_StreamType_Proxy( - IMPEG2ComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - - void __RPC_STUB IMPEG2ComponentType_put_StreamType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IMPEG2ComponentType_INTERFACE_DEFINED__ */ - - - #ifndef __IATSCComponentType_INTERFACE_DEFINED__ - #define __IATSCComponentType_INTERFACE_DEFINED__ - - /* interface IATSCComponentType */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IATSCComponentType; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FC189E4D-7BD4-4125-B3B3-3A76A332CC96") - IATSCComponentType : public IMPEG2ComponentType - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Flags( - /* [retval][out] */ long *Flags) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Flags( - /* [in] */ long flags) = 0; - - }; - - #else /* C style interface */ - - typedef struct IATSCComponentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCComponentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCComponentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCComponentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCComponentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCComponentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCComponentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCComponentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Category )( - IATSCComponentType * This, - /* [retval][out] */ ComponentCategory *Category); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Category )( - IATSCComponentType * This, - /* [in] */ ComponentCategory Category); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaMajorType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaMajorType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaMajorType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaMajorType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaMajorType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaMajorTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaMajorType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaMajorTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaSubType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaSubType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaSubType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaSubType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaSubType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaSubTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaSubType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaSubTypeGuid); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaFormatType )( - IATSCComponentType * This, - /* [retval][out] */ BSTR *MediaFormatType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaFormatType )( - IATSCComponentType * This, - /* [in] */ BSTR MediaFormatType); - - /* [restricted][hidden][helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__MediaFormatType )( - IATSCComponentType * This, - /* [retval][out] */ GUID *MediaFormatTypeGuid); - - /* [restricted][hidden][helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put__MediaFormatType )( - IATSCComponentType * This, - /* [in] */ REFCLSID MediaFormatTypeGuid); - - /* [helpstring][restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IATSCComponentType * This, - /* [retval][out] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][restricted][hidden][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IATSCComponentType * This, - /* [in] */ AM_MEDIA_TYPE *MediaType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCComponentType * This, - /* [retval][out] */ IComponentType **NewCT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LangID )( - IATSCComponentType * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LangID )( - IATSCComponentType * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IATSCComponentType * This, - /* [retval][out] */ MPEG2StreamType *MP2StreamType); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StreamType )( - IATSCComponentType * This, - /* [in] */ MPEG2StreamType MP2StreamType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Flags )( - IATSCComponentType * This, - /* [retval][out] */ long *Flags); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Flags )( - IATSCComponentType * This, - /* [in] */ long flags); - - END_INTERFACE - } IATSCComponentTypeVtbl; - - interface IATSCComponentType - { - CONST_VTBL struct IATSCComponentTypeVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IATSCComponentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IATSCComponentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IATSCComponentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IATSCComponentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IATSCComponentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IATSCComponentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IATSCComponentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IATSCComponentType_get_Category(This,Category) \ - (This)->lpVtbl -> get_Category(This,Category) - - #define IATSCComponentType_put_Category(This,Category) \ - (This)->lpVtbl -> put_Category(This,Category) - - #define IATSCComponentType_get_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> get_MediaMajorType(This,MediaMajorType) - - #define IATSCComponentType_put_MediaMajorType(This,MediaMajorType) \ - (This)->lpVtbl -> put_MediaMajorType(This,MediaMajorType) - - #define IATSCComponentType_get__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> get__MediaMajorType(This,MediaMajorTypeGuid) - - #define IATSCComponentType_put__MediaMajorType(This,MediaMajorTypeGuid) \ - (This)->lpVtbl -> put__MediaMajorType(This,MediaMajorTypeGuid) - - #define IATSCComponentType_get_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> get_MediaSubType(This,MediaSubType) - - #define IATSCComponentType_put_MediaSubType(This,MediaSubType) \ - (This)->lpVtbl -> put_MediaSubType(This,MediaSubType) - - #define IATSCComponentType_get__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> get__MediaSubType(This,MediaSubTypeGuid) - - #define IATSCComponentType_put__MediaSubType(This,MediaSubTypeGuid) \ - (This)->lpVtbl -> put__MediaSubType(This,MediaSubTypeGuid) - - #define IATSCComponentType_get_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> get_MediaFormatType(This,MediaFormatType) - - #define IATSCComponentType_put_MediaFormatType(This,MediaFormatType) \ - (This)->lpVtbl -> put_MediaFormatType(This,MediaFormatType) - - #define IATSCComponentType_get__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> get__MediaFormatType(This,MediaFormatTypeGuid) - - #define IATSCComponentType_put__MediaFormatType(This,MediaFormatTypeGuid) \ - (This)->lpVtbl -> put__MediaFormatType(This,MediaFormatTypeGuid) - - #define IATSCComponentType_get_MediaType(This,MediaType) \ - (This)->lpVtbl -> get_MediaType(This,MediaType) - - #define IATSCComponentType_put_MediaType(This,MediaType) \ - (This)->lpVtbl -> put_MediaType(This,MediaType) - - #define IATSCComponentType_Clone(This,NewCT) \ - (This)->lpVtbl -> Clone(This,NewCT) - - - #define IATSCComponentType_get_LangID(This,LangID) \ - (This)->lpVtbl -> get_LangID(This,LangID) - - #define IATSCComponentType_put_LangID(This,LangID) \ - (This)->lpVtbl -> put_LangID(This,LangID) - - - #define IATSCComponentType_get_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> get_StreamType(This,MP2StreamType) - - #define IATSCComponentType_put_StreamType(This,MP2StreamType) \ - (This)->lpVtbl -> put_StreamType(This,MP2StreamType) - - - #define IATSCComponentType_get_Flags(This,Flags) \ - (This)->lpVtbl -> get_Flags(This,Flags) - - #define IATSCComponentType_put_Flags(This,flags) \ - (This)->lpVtbl -> put_Flags(This,flags) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCComponentType_get_Flags_Proxy( - IATSCComponentType * This, - /* [retval][out] */ long *Flags); - - - void __RPC_STUB IATSCComponentType_get_Flags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCComponentType_put_Flags_Proxy( - IATSCComponentType * This, - /* [in] */ long flags); - - - void __RPC_STUB IATSCComponentType_put_Flags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IATSCComponentType_INTERFACE_DEFINED__ */ - - - #ifndef __IEnumComponentTypes_INTERFACE_DEFINED__ - #define __IEnumComponentTypes_INTERFACE_DEFINED__ - - /* interface IEnumComponentTypes */ - /* [unique][uuid][object][restricted][hidden] */ - - - EXTERN_C const IID IID_IEnumComponentTypes; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8A674B4A-1F63-11d3-B64C-00C04F79498E") - IEnumComponentTypes : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumComponentTypes **ppEnum) = 0; - - }; - - #else /* C style interface */ - - typedef struct IEnumComponentTypesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumComponentTypes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumComponentTypes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumComponentTypes * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumComponentTypes * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumComponentTypes * This, - /* [out] */ IEnumComponentTypes **ppEnum); - - END_INTERFACE - } IEnumComponentTypesVtbl; - - interface IEnumComponentTypes - { - CONST_VTBL struct IEnumComponentTypesVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IEnumComponentTypes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IEnumComponentTypes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IEnumComponentTypes_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IEnumComponentTypes_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - - #define IEnumComponentTypes_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - - #define IEnumComponentTypes_Reset(This) \ - (This)->lpVtbl -> Reset(This) - - #define IEnumComponentTypes_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Next_Proxy( - IEnumComponentTypes * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponentType **rgelt, - /* [out] */ ULONG *pceltFetched); - - - void __RPC_STUB IEnumComponentTypes_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Skip_Proxy( - IEnumComponentTypes * This, - /* [in] */ ULONG celt); - - - void __RPC_STUB IEnumComponentTypes_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Reset_Proxy( - IEnumComponentTypes * This); - - - void __RPC_STUB IEnumComponentTypes_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponentTypes_Clone_Proxy( - IEnumComponentTypes * This, - /* [out] */ IEnumComponentTypes **ppEnum); - - - void __RPC_STUB IEnumComponentTypes_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IEnumComponentTypes_INTERFACE_DEFINED__ */ - - - #ifndef __IComponentTypes_INTERFACE_DEFINED__ - #define __IComponentTypes_INTERFACE_DEFINED__ - - /* interface IComponentTypes */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IComponentTypes; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0DC13D4A-0313-11d3-9D8E-00C04F72D980") - IComponentTypes : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **ppNewEnum) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumComponentTypes( - /* [retval][out] */ IEnumComponentTypes **ppNewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType) = 0; - - virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_Item( - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponentTypes **NewList) = 0; - - }; - - #else /* C style interface */ - - typedef struct IComponentTypesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponentTypes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponentTypes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponentTypes * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponentTypes * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponentTypes * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponentTypes * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponentTypes * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IComponentTypes * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - IComponentTypes * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumComponentTypes )( - IComponentTypes * This, - /* [retval][out] */ IEnumComponentTypes **ppNewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType); - - /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Item )( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - IComponentTypes * This, - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IComponentTypes * This, - /* [in] */ VARIANT Index); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponentTypes * This, - /* [retval][out] */ IComponentTypes **NewList); - - END_INTERFACE - } IComponentTypesVtbl; - - interface IComponentTypes - { - CONST_VTBL struct IComponentTypesVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IComponentTypes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IComponentTypes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IComponentTypes_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IComponentTypes_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IComponentTypes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IComponentTypes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IComponentTypes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IComponentTypes_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - - #define IComponentTypes_get__NewEnum(This,ppNewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,ppNewEnum) - - #define IComponentTypes_EnumComponentTypes(This,ppNewEnum) \ - (This)->lpVtbl -> EnumComponentTypes(This,ppNewEnum) - - #define IComponentTypes_get_Item(This,Index,ComponentType) \ - (This)->lpVtbl -> get_Item(This,Index,ComponentType) - - #define IComponentTypes_put_Item(This,Index,ComponentType) \ - (This)->lpVtbl -> put_Item(This,Index,ComponentType) - - #define IComponentTypes_Add(This,ComponentType,NewIndex) \ - (This)->lpVtbl -> Add(This,ComponentType,NewIndex) - - #define IComponentTypes_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - - #define IComponentTypes_Clone(This,NewList) \ - (This)->lpVtbl -> Clone(This,NewList) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get_Count_Proxy( - IComponentTypes * This, - /* [retval][out] */ long *Count); - - - void __RPC_STUB IComponentTypes_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get__NewEnum_Proxy( - IComponentTypes * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - - void __RPC_STUB IComponentTypes_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponentTypes_EnumComponentTypes_Proxy( - IComponentTypes * This, - /* [retval][out] */ IEnumComponentTypes **ppNewEnum); - - - void __RPC_STUB IComponentTypes_EnumComponentTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_get_Item_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponentType **ComponentType); - - - void __RPC_STUB IComponentTypes_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_put_Item_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index, - /* [in] */ IComponentType *ComponentType); - - - void __RPC_STUB IComponentTypes_put_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Add_Proxy( - IComponentTypes * This, - /* [in] */ IComponentType *ComponentType, - /* [retval][out] */ VARIANT *NewIndex); - - - void __RPC_STUB IComponentTypes_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Remove_Proxy( - IComponentTypes * This, - /* [in] */ VARIANT Index); - - - void __RPC_STUB IComponentTypes_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IComponentTypes_Clone_Proxy( - IComponentTypes * This, - /* [retval][out] */ IComponentTypes **NewList); - - - void __RPC_STUB IComponentTypes_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IComponentTypes_INTERFACE_DEFINED__ */ - - - #ifndef __IComponent_INTERFACE_DEFINED__ - #define __IComponent_INTERFACE_DEFINED__ - - /* interface IComponent */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IComponent; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1A5576FC-0E19-11d3-9D8E-00C04F72D980") - IComponent : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type( - /* [retval][out] */ IComponentType **CT) = 0; - - virtual /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE put_Type( - /* [in] */ IComponentType *CT) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DescLangID( - /* [retval][out] */ long *LangID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DescLangID( - /* [in] */ long LangID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Status( - /* [retval][out] */ ComponentStatus *Status) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Status( - /* [in] */ ComponentStatus Status) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Description( - /* [retval][out] */ BSTR *Description) = 0; - - virtual /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE put_Description( - /* [in] */ BSTR Description) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponent **NewComponent) = 0; - - }; - - #else /* C style interface */ - - typedef struct IComponentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponent * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponent * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponent * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponent * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponent * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponent * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponent * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( - IComponent * This, - /* [retval][out] */ IComponentType **CT); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( - IComponent * This, - /* [in] */ IComponentType *CT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DescLangID )( - IComponent * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DescLangID )( - IComponent * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( - IComponent * This, - /* [retval][out] */ ComponentStatus *Status); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Status )( - IComponent * This, - /* [in] */ ComponentStatus Status); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )( - IComponent * This, - /* [retval][out] */ BSTR *Description); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Description )( - IComponent * This, - /* [in] */ BSTR Description); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponent * This, - /* [retval][out] */ IComponent **NewComponent); - - END_INTERFACE - } IComponentVtbl; - - interface IComponent - { - CONST_VTBL struct IComponentVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IComponent_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IComponent_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IComponent_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IComponent_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IComponent_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IComponent_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IComponent_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IComponent_get_Type(This,CT) \ - (This)->lpVtbl -> get_Type(This,CT) - - #define IComponent_put_Type(This,CT) \ - (This)->lpVtbl -> put_Type(This,CT) - - #define IComponent_get_DescLangID(This,LangID) \ - (This)->lpVtbl -> get_DescLangID(This,LangID) - - #define IComponent_put_DescLangID(This,LangID) \ - (This)->lpVtbl -> put_DescLangID(This,LangID) - - #define IComponent_get_Status(This,Status) \ - (This)->lpVtbl -> get_Status(This,Status) - - #define IComponent_put_Status(This,Status) \ - (This)->lpVtbl -> put_Status(This,Status) - - #define IComponent_get_Description(This,Description) \ - (This)->lpVtbl -> get_Description(This,Description) - - #define IComponent_put_Description(This,Description) \ - (This)->lpVtbl -> put_Description(This,Description) - - #define IComponent_Clone(This,NewComponent) \ - (This)->lpVtbl -> Clone(This,NewComponent) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Type_Proxy( - IComponent * This, - /* [retval][out] */ IComponentType **CT); - - - void __RPC_STUB IComponent_get_Type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponent_put_Type_Proxy( - IComponent * This, - /* [in] */ IComponentType *CT); - - - void __RPC_STUB IComponent_put_Type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_DescLangID_Proxy( - IComponent * This, - /* [retval][out] */ long *LangID); - - - void __RPC_STUB IComponent_get_DescLangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponent_put_DescLangID_Proxy( - IComponent * This, - /* [in] */ long LangID); - - - void __RPC_STUB IComponent_put_DescLangID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Status_Proxy( - IComponent * This, - /* [retval][out] */ ComponentStatus *Status); - - - void __RPC_STUB IComponent_get_Status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IComponent_put_Status_Proxy( - IComponent * This, - /* [in] */ ComponentStatus Status); - - - void __RPC_STUB IComponent_put_Status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IComponent_get_Description_Proxy( - IComponent * This, - /* [retval][out] */ BSTR *Description); - - - void __RPC_STUB IComponent_get_Description_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponent_put_Description_Proxy( - IComponent * This, - /* [in] */ BSTR Description); - - - void __RPC_STUB IComponent_put_Description_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponent_Clone_Proxy( - IComponent * This, - /* [retval][out] */ IComponent **NewComponent); - - - void __RPC_STUB IComponent_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IComponent_INTERFACE_DEFINED__ */ - - - #ifndef __IMPEG2Component_INTERFACE_DEFINED__ - #define __IMPEG2Component_INTERFACE_DEFINED__ - - /* interface IMPEG2Component */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IMPEG2Component; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1493E353-1EB6-473c-802D-8E6B8EC9D2A9") - IMPEG2Component : public IComponent - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PID( - /* [retval][out] */ long *PID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PID( - /* [in] */ long PID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PCRPID( - /* [retval][out] */ long *PCRPID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PCRPID( - /* [in] */ long PCRPID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ProgramNumber( - /* [retval][out] */ long *ProgramNumber) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ProgramNumber( - /* [in] */ long ProgramNumber) = 0; - - }; - - #else /* C style interface */ - - typedef struct IMPEG2ComponentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMPEG2Component * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMPEG2Component * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMPEG2Component * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMPEG2Component * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMPEG2Component * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMPEG2Component * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMPEG2Component * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( - IMPEG2Component * This, - /* [retval][out] */ IComponentType **CT); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( - IMPEG2Component * This, - /* [in] */ IComponentType *CT); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DescLangID )( - IMPEG2Component * This, - /* [retval][out] */ long *LangID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DescLangID )( - IMPEG2Component * This, - /* [in] */ long LangID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( - IMPEG2Component * This, - /* [retval][out] */ ComponentStatus *Status); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Status )( - IMPEG2Component * This, - /* [in] */ ComponentStatus Status); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )( - IMPEG2Component * This, - /* [retval][out] */ BSTR *Description); - - /* [helpstring][id][propput][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_Description )( - IMPEG2Component * This, - /* [in] */ BSTR Description); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IMPEG2Component * This, - /* [retval][out] */ IComponent **NewComponent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PID )( - IMPEG2Component * This, - /* [retval][out] */ long *PID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PID )( - IMPEG2Component * This, - /* [in] */ long PID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PCRPID )( - IMPEG2Component * This, - /* [retval][out] */ long *PCRPID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PCRPID )( - IMPEG2Component * This, - /* [in] */ long PCRPID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ProgramNumber )( - IMPEG2Component * This, - /* [retval][out] */ long *ProgramNumber); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ProgramNumber )( - IMPEG2Component * This, - /* [in] */ long ProgramNumber); - - END_INTERFACE - } IMPEG2ComponentVtbl; - - interface IMPEG2Component - { - CONST_VTBL struct IMPEG2ComponentVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IMPEG2Component_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IMPEG2Component_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IMPEG2Component_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IMPEG2Component_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IMPEG2Component_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IMPEG2Component_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IMPEG2Component_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IMPEG2Component_get_Type(This,CT) \ - (This)->lpVtbl -> get_Type(This,CT) - - #define IMPEG2Component_put_Type(This,CT) \ - (This)->lpVtbl -> put_Type(This,CT) - - #define IMPEG2Component_get_DescLangID(This,LangID) \ - (This)->lpVtbl -> get_DescLangID(This,LangID) - - #define IMPEG2Component_put_DescLangID(This,LangID) \ - (This)->lpVtbl -> put_DescLangID(This,LangID) - - #define IMPEG2Component_get_Status(This,Status) \ - (This)->lpVtbl -> get_Status(This,Status) - - #define IMPEG2Component_put_Status(This,Status) \ - (This)->lpVtbl -> put_Status(This,Status) - - #define IMPEG2Component_get_Description(This,Description) \ - (This)->lpVtbl -> get_Description(This,Description) - - #define IMPEG2Component_put_Description(This,Description) \ - (This)->lpVtbl -> put_Description(This,Description) - - #define IMPEG2Component_Clone(This,NewComponent) \ - (This)->lpVtbl -> Clone(This,NewComponent) - - - #define IMPEG2Component_get_PID(This,PID) \ - (This)->lpVtbl -> get_PID(This,PID) - - #define IMPEG2Component_put_PID(This,PID) \ - (This)->lpVtbl -> put_PID(This,PID) - - #define IMPEG2Component_get_PCRPID(This,PCRPID) \ - (This)->lpVtbl -> get_PCRPID(This,PCRPID) - - #define IMPEG2Component_put_PCRPID(This,PCRPID) \ - (This)->lpVtbl -> put_PCRPID(This,PCRPID) - - #define IMPEG2Component_get_ProgramNumber(This,ProgramNumber) \ - (This)->lpVtbl -> get_ProgramNumber(This,ProgramNumber) - - #define IMPEG2Component_put_ProgramNumber(This,ProgramNumber) \ - (This)->lpVtbl -> put_ProgramNumber(This,ProgramNumber) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_PID_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *PID); - - - void __RPC_STUB IMPEG2Component_get_PID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_PID_Proxy( - IMPEG2Component * This, - /* [in] */ long PID); - - - void __RPC_STUB IMPEG2Component_put_PID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_PCRPID_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *PCRPID); - - - void __RPC_STUB IMPEG2Component_get_PCRPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_PCRPID_Proxy( - IMPEG2Component * This, - /* [in] */ long PCRPID); - - - void __RPC_STUB IMPEG2Component_put_PCRPID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_get_ProgramNumber_Proxy( - IMPEG2Component * This, - /* [retval][out] */ long *ProgramNumber); - - - void __RPC_STUB IMPEG2Component_get_ProgramNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMPEG2Component_put_ProgramNumber_Proxy( - IMPEG2Component * This, - /* [in] */ long ProgramNumber); - - - void __RPC_STUB IMPEG2Component_put_ProgramNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IMPEG2Component_INTERFACE_DEFINED__ */ - - - #ifndef __IEnumComponents_INTERFACE_DEFINED__ - #define __IEnumComponents_INTERFACE_DEFINED__ - - /* interface IEnumComponents */ - /* [unique][uuid][object][restricted][hidden] */ - - - EXTERN_C const IID IID_IEnumComponents; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2A6E2939-2595-11d3-B64C-00C04F79498E") - IEnumComponents : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched) = 0; - - virtual HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ IEnumComponents **ppEnum) = 0; - - }; - - #else /* C style interface */ - - typedef struct IEnumComponentsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IEnumComponents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IEnumComponents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IEnumComponents * This); - - HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumComponents * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched); - - HRESULT ( STDMETHODCALLTYPE *Skip )( - IEnumComponents * This, - /* [in] */ ULONG celt); - - HRESULT ( STDMETHODCALLTYPE *Reset )( - IEnumComponents * This); - - HRESULT ( STDMETHODCALLTYPE *Clone )( - IEnumComponents * This, - /* [out] */ IEnumComponents **ppEnum); - - END_INTERFACE - } IEnumComponentsVtbl; - - interface IEnumComponents - { - CONST_VTBL struct IEnumComponentsVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IEnumComponents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IEnumComponents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IEnumComponents_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IEnumComponents_Next(This,celt,rgelt,pceltFetched) \ - (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) - - #define IEnumComponents_Skip(This,celt) \ - (This)->lpVtbl -> Skip(This,celt) - - #define IEnumComponents_Reset(This) \ - (This)->lpVtbl -> Reset(This) - - #define IEnumComponents_Clone(This,ppEnum) \ - (This)->lpVtbl -> Clone(This,ppEnum) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - HRESULT STDMETHODCALLTYPE IEnumComponents_Next_Proxy( - IEnumComponents * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IComponent **rgelt, - /* [out] */ ULONG *pceltFetched); - - - void __RPC_STUB IEnumComponents_Next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponents_Skip_Proxy( - IEnumComponents * This, - /* [in] */ ULONG celt); - - - void __RPC_STUB IEnumComponents_Skip_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponents_Reset_Proxy( - IEnumComponents * This); - - - void __RPC_STUB IEnumComponents_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - HRESULT STDMETHODCALLTYPE IEnumComponents_Clone_Proxy( - IEnumComponents * This, - /* [out] */ IEnumComponents **ppEnum); - - - void __RPC_STUB IEnumComponents_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IEnumComponents_INTERFACE_DEFINED__ */ - - - #ifndef __IComponents_INTERFACE_DEFINED__ - #define __IComponents_INTERFACE_DEFINED__ - - /* interface IComponents */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_IComponents; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("FCD01846-0E19-11d3-9D8E-00C04F72D980") - IComponents : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Count( - /* [retval][out] */ long *Count) = 0; - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( - /* [retval][out] */ IEnumVARIANT **ppNewEnum) = 0; - - virtual /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE EnumComponents( - /* [retval][out] */ IEnumComponents **ppNewEnum) = 0; - - virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Add( - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ IComponents **NewList) = 0; - - }; - - #else /* C style interface */ - - typedef struct IComponentsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IComponents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IComponents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IComponents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IComponents * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IComponents * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IComponents * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IComponents * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( - IComponents * This, - /* [retval][out] */ long *Count); - - /* [restricted][hidden][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( - IComponents * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - /* [helpstring][restricted][hidden] */ HRESULT ( STDMETHODCALLTYPE *EnumComponents )( - IComponents * This, - /* [retval][out] */ IEnumComponents **ppNewEnum); - - /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( - IComponents * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Add )( - IComponents * This, - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IComponents * This, - /* [in] */ VARIANT Index); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IComponents * This, - /* [retval][out] */ IComponents **NewList); - - END_INTERFACE - } IComponentsVtbl; - - interface IComponents - { - CONST_VTBL struct IComponentsVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IComponents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IComponents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IComponents_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IComponents_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IComponents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IComponents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IComponents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IComponents_get_Count(This,Count) \ - (This)->lpVtbl -> get_Count(This,Count) - - #define IComponents_get__NewEnum(This,ppNewEnum) \ - (This)->lpVtbl -> get__NewEnum(This,ppNewEnum) - - #define IComponents_EnumComponents(This,ppNewEnum) \ - (This)->lpVtbl -> EnumComponents(This,ppNewEnum) - - #define IComponents_get_Item(This,Index,ppComponent) \ - (This)->lpVtbl -> get_Item(This,Index,ppComponent) - - #define IComponents_Add(This,Component,NewIndex) \ - (This)->lpVtbl -> Add(This,Component,NewIndex) - - #define IComponents_Remove(This,Index) \ - (This)->lpVtbl -> Remove(This,Index) - - #define IComponents_Clone(This,NewList) \ - (This)->lpVtbl -> Clone(This,NewList) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IComponents_get_Count_Proxy( - IComponents * This, - /* [retval][out] */ long *Count); - - - void __RPC_STUB IComponents_get_Count_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE IComponents_get__NewEnum_Proxy( - IComponents * This, - /* [retval][out] */ IEnumVARIANT **ppNewEnum); - - - void __RPC_STUB IComponents_get__NewEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][restricted][hidden] */ HRESULT STDMETHODCALLTYPE IComponents_EnumComponents_Proxy( - IComponents * This, - /* [retval][out] */ IEnumComponents **ppNewEnum); - - - void __RPC_STUB IComponents_EnumComponents_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE IComponents_get_Item_Proxy( - IComponents * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ IComponent **ppComponent); - - - void __RPC_STUB IComponents_get_Item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponents_Add_Proxy( - IComponents * This, - /* [in] */ IComponent *Component, - /* [retval][out] */ VARIANT *NewIndex); - - - void __RPC_STUB IComponents_Add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IComponents_Remove_Proxy( - IComponents * This, - /* [in] */ VARIANT Index); - - - void __RPC_STUB IComponents_Remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring] */ HRESULT STDMETHODCALLTYPE IComponents_Clone_Proxy( - IComponents * This, - /* [retval][out] */ IComponents **NewList); - - - void __RPC_STUB IComponents_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IComponents_INTERFACE_DEFINED__ */ - - - #ifndef __ILocator_INTERFACE_DEFINED__ - #define __ILocator_INTERFACE_DEFINED__ - - /* interface ILocator */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][object] */ - - - EXTERN_C const IID IID_ILocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("286D7F89-760C-4F89-80C4-66841D2507AA") - ILocator : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CarrierFrequency( - /* [retval][out] */ long *Frequency) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CarrierFrequency( - /* [in] */ long Frequency) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InnerFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InnerFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_InnerFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_InnerFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OuterFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OuterFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OuterFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OuterFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modulation( - /* [retval][out] */ ModulationType *Modulation) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Modulation( - /* [in] */ ModulationType Modulation) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SymbolRate( - /* [retval][out] */ long *Rate) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SymbolRate( - /* [in] */ long Rate) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Clone( - /* [retval][out] */ ILocator **NewLocator) = 0; - - }; - - #else /* C style interface */ - - typedef struct ILocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ILocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ILocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ILocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ILocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ILocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ILocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ILocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - ILocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - ILocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - ILocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - ILocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - ILocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - ILocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - ILocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - ILocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - ILocator * This, - /* [retval][out] */ ILocator **NewLocator); - - END_INTERFACE - } ILocatorVtbl; - - interface ILocator - { - CONST_VTBL struct ILocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define ILocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define ILocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define ILocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define ILocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define ILocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define ILocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define ILocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define ILocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - - #define ILocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - - #define ILocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - - #define ILocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - - #define ILocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - - #define ILocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - - #define ILocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - - #define ILocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - - #define ILocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - - #define ILocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - - #define ILocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - - #define ILocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - - #define ILocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - - #define ILocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - - #define ILocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_CarrierFrequency_Proxy( - ILocator * This, - /* [retval][out] */ long *Frequency); - - - void __RPC_STUB ILocator_get_CarrierFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_CarrierFrequency_Proxy( - ILocator * This, - /* [in] */ long Frequency); - - - void __RPC_STUB ILocator_put_CarrierFrequency_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_InnerFEC_Proxy( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - - void __RPC_STUB ILocator_get_InnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_InnerFEC_Proxy( - ILocator * This, - /* [in] */ FECMethod FEC); - - - void __RPC_STUB ILocator_put_InnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_InnerFECRate_Proxy( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - - void __RPC_STUB ILocator_get_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_InnerFECRate_Proxy( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - - void __RPC_STUB ILocator_put_InnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_OuterFEC_Proxy( - ILocator * This, - /* [retval][out] */ FECMethod *FEC); - - - void __RPC_STUB ILocator_get_OuterFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_OuterFEC_Proxy( - ILocator * This, - /* [in] */ FECMethod FEC); - - - void __RPC_STUB ILocator_put_OuterFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_OuterFECRate_Proxy( - ILocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - - void __RPC_STUB ILocator_get_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_OuterFECRate_Proxy( - ILocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - - void __RPC_STUB ILocator_put_OuterFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_Modulation_Proxy( - ILocator * This, - /* [retval][out] */ ModulationType *Modulation); - - - void __RPC_STUB ILocator_get_Modulation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_Modulation_Proxy( - ILocator * This, - /* [in] */ ModulationType Modulation); - - - void __RPC_STUB ILocator_put_Modulation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ILocator_get_SymbolRate_Proxy( - ILocator * This, - /* [retval][out] */ long *Rate); - - - void __RPC_STUB ILocator_get_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ILocator_put_SymbolRate_Proxy( - ILocator * This, - /* [in] */ long Rate); - - - void __RPC_STUB ILocator_put_SymbolRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ILocator_Clone_Proxy( - ILocator * This, - /* [retval][out] */ ILocator **NewLocator); - - - void __RPC_STUB ILocator_Clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __ILocator_INTERFACE_DEFINED__ */ - - - #ifndef __IATSCLocator_INTERFACE_DEFINED__ - #define __IATSCLocator_INTERFACE_DEFINED__ - - /* interface IATSCLocator */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IATSCLocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BF8D986F-8C2B-4131-94D7-4D3D9FCC21EF") - IATSCLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PhysicalChannel( - /* [retval][out] */ long *PhysicalChannel) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PhysicalChannel( - /* [in] */ long PhysicalChannel) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TSID( - /* [retval][out] */ long *TSID) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TSID( - /* [in] */ long TSID) = 0; - - }; - - #else /* C style interface */ - - typedef struct IATSCLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IATSCLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IATSCLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IATSCLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IATSCLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IATSCLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IATSCLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IATSCLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IATSCLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IATSCLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IATSCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IATSCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IATSCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IATSCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IATSCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IATSCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IATSCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IATSCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IATSCLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IATSCLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IATSCLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IATSCLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IATSCLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PhysicalChannel )( - IATSCLocator * This, - /* [retval][out] */ long *PhysicalChannel); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PhysicalChannel )( - IATSCLocator * This, - /* [in] */ long PhysicalChannel); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TSID )( - IATSCLocator * This, - /* [retval][out] */ long *TSID); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TSID )( - IATSCLocator * This, - /* [in] */ long TSID); - - END_INTERFACE - } IATSCLocatorVtbl; - - interface IATSCLocator - { - CONST_VTBL struct IATSCLocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IATSCLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IATSCLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IATSCLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IATSCLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IATSCLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IATSCLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IATSCLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IATSCLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - - #define IATSCLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - - #define IATSCLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - - #define IATSCLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - - #define IATSCLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - - #define IATSCLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - - #define IATSCLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - - #define IATSCLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - - #define IATSCLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - - #define IATSCLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - - #define IATSCLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - - #define IATSCLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - - #define IATSCLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - - #define IATSCLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - - #define IATSCLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - - #define IATSCLocator_get_PhysicalChannel(This,PhysicalChannel) \ - (This)->lpVtbl -> get_PhysicalChannel(This,PhysicalChannel) - - #define IATSCLocator_put_PhysicalChannel(This,PhysicalChannel) \ - (This)->lpVtbl -> put_PhysicalChannel(This,PhysicalChannel) - - #define IATSCLocator_get_TSID(This,TSID) \ - (This)->lpVtbl -> get_TSID(This,TSID) - - #define IATSCLocator_put_TSID(This,TSID) \ - (This)->lpVtbl -> put_TSID(This,TSID) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCLocator_get_PhysicalChannel_Proxy( - IATSCLocator * This, - /* [retval][out] */ long *PhysicalChannel); - - - void __RPC_STUB IATSCLocator_get_PhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCLocator_put_PhysicalChannel_Proxy( - IATSCLocator * This, - /* [in] */ long PhysicalChannel); - - - void __RPC_STUB IATSCLocator_put_PhysicalChannel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IATSCLocator_get_TSID_Proxy( - IATSCLocator * This, - /* [retval][out] */ long *TSID); - - - void __RPC_STUB IATSCLocator_get_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IATSCLocator_put_TSID_Proxy( - IATSCLocator * This, - /* [in] */ long TSID); - - - void __RPC_STUB IATSCLocator_put_TSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IATSCLocator_INTERFACE_DEFINED__ */ - - - #ifndef __IDVBTLocator_INTERFACE_DEFINED__ - #define __IDVBTLocator_INTERFACE_DEFINED__ - - /* interface IDVBTLocator */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IDVBTLocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8664DA16-DDA2-42ac-926A-C18F9127C302") - IDVBTLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bandwidth( - /* [retval][out] */ long *BandWidthVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Bandwidth( - /* [in] */ long BandwidthVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LPInnerFEC( - /* [retval][out] */ FECMethod *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LPInnerFEC( - /* [in] */ FECMethod FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LPInnerFECRate( - /* [retval][out] */ BinaryConvolutionCodeRate *FEC) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LPInnerFECRate( - /* [in] */ BinaryConvolutionCodeRate FEC) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_HAlpha( - /* [retval][out] */ HierarchyAlpha *Alpha) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_HAlpha( - /* [in] */ HierarchyAlpha Alpha) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Guard( - /* [retval][out] */ GuardInterval *GI) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Guard( - /* [in] */ GuardInterval GI) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Mode( - /* [retval][out] */ TransmissionMode *mode) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Mode( - /* [in] */ TransmissionMode mode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OtherFrequencyInUse( - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OtherFrequencyInUse( - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDVBTLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBTLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBTLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBTLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBTLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBTLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBTLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBTLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBTLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBTLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBTLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBTLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBTLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBTLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBTLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Bandwidth )( - IDVBTLocator * This, - /* [retval][out] */ long *BandWidthVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Bandwidth )( - IDVBTLocator * This, - /* [in] */ long BandwidthVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LPInnerFEC )( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LPInnerFEC )( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LPInnerFECRate )( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LPInnerFECRate )( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_HAlpha )( - IDVBTLocator * This, - /* [retval][out] */ HierarchyAlpha *Alpha); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_HAlpha )( - IDVBTLocator * This, - /* [in] */ HierarchyAlpha Alpha); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Guard )( - IDVBTLocator * This, - /* [retval][out] */ GuardInterval *GI); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Guard )( - IDVBTLocator * This, - /* [in] */ GuardInterval GI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Mode )( - IDVBTLocator * This, - /* [retval][out] */ TransmissionMode *mode); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Mode )( - IDVBTLocator * This, - /* [in] */ TransmissionMode mode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OtherFrequencyInUse )( - IDVBTLocator * This, - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OtherFrequencyInUse )( - IDVBTLocator * This, - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal); - - END_INTERFACE - } IDVBTLocatorVtbl; - - interface IDVBTLocator - { - CONST_VTBL struct IDVBTLocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDVBTLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDVBTLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDVBTLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDVBTLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDVBTLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDVBTLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDVBTLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDVBTLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - - #define IDVBTLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - - #define IDVBTLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - - #define IDVBTLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - - #define IDVBTLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - - #define IDVBTLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - - #define IDVBTLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - - #define IDVBTLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - - #define IDVBTLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - - #define IDVBTLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - - #define IDVBTLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - - #define IDVBTLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - - #define IDVBTLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - - #define IDVBTLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - - #define IDVBTLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - - #define IDVBTLocator_get_Bandwidth(This,BandWidthVal) \ - (This)->lpVtbl -> get_Bandwidth(This,BandWidthVal) - - #define IDVBTLocator_put_Bandwidth(This,BandwidthVal) \ - (This)->lpVtbl -> put_Bandwidth(This,BandwidthVal) - - #define IDVBTLocator_get_LPInnerFEC(This,FEC) \ - (This)->lpVtbl -> get_LPInnerFEC(This,FEC) - - #define IDVBTLocator_put_LPInnerFEC(This,FEC) \ - (This)->lpVtbl -> put_LPInnerFEC(This,FEC) - - #define IDVBTLocator_get_LPInnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_LPInnerFECRate(This,FEC) - - #define IDVBTLocator_put_LPInnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_LPInnerFECRate(This,FEC) - - #define IDVBTLocator_get_HAlpha(This,Alpha) \ - (This)->lpVtbl -> get_HAlpha(This,Alpha) - - #define IDVBTLocator_put_HAlpha(This,Alpha) \ - (This)->lpVtbl -> put_HAlpha(This,Alpha) - - #define IDVBTLocator_get_Guard(This,GI) \ - (This)->lpVtbl -> get_Guard(This,GI) - - #define IDVBTLocator_put_Guard(This,GI) \ - (This)->lpVtbl -> put_Guard(This,GI) - - #define IDVBTLocator_get_Mode(This,mode) \ - (This)->lpVtbl -> get_Mode(This,mode) - - #define IDVBTLocator_put_Mode(This,mode) \ - (This)->lpVtbl -> put_Mode(This,mode) - - #define IDVBTLocator_get_OtherFrequencyInUse(This,OtherFrequencyInUseVal) \ - (This)->lpVtbl -> get_OtherFrequencyInUse(This,OtherFrequencyInUseVal) - - #define IDVBTLocator_put_OtherFrequencyInUse(This,OtherFrequencyInUseVal) \ - (This)->lpVtbl -> put_OtherFrequencyInUse(This,OtherFrequencyInUseVal) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Bandwidth_Proxy( - IDVBTLocator * This, - /* [retval][out] */ long *BandWidthVal); - - - void __RPC_STUB IDVBTLocator_get_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Bandwidth_Proxy( - IDVBTLocator * This, - /* [in] */ long BandwidthVal); - - - void __RPC_STUB IDVBTLocator_put_Bandwidth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_LPInnerFEC_Proxy( - IDVBTLocator * This, - /* [retval][out] */ FECMethod *FEC); - - - void __RPC_STUB IDVBTLocator_get_LPInnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_LPInnerFEC_Proxy( - IDVBTLocator * This, - /* [in] */ FECMethod FEC); - - - void __RPC_STUB IDVBTLocator_put_LPInnerFEC_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_LPInnerFECRate_Proxy( - IDVBTLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - - void __RPC_STUB IDVBTLocator_get_LPInnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_LPInnerFECRate_Proxy( - IDVBTLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - - void __RPC_STUB IDVBTLocator_put_LPInnerFECRate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_HAlpha_Proxy( - IDVBTLocator * This, - /* [retval][out] */ HierarchyAlpha *Alpha); - - - void __RPC_STUB IDVBTLocator_get_HAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_HAlpha_Proxy( - IDVBTLocator * This, - /* [in] */ HierarchyAlpha Alpha); - - - void __RPC_STUB IDVBTLocator_put_HAlpha_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Guard_Proxy( - IDVBTLocator * This, - /* [retval][out] */ GuardInterval *GI); - - - void __RPC_STUB IDVBTLocator_get_Guard_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Guard_Proxy( - IDVBTLocator * This, - /* [in] */ GuardInterval GI); - - - void __RPC_STUB IDVBTLocator_put_Guard_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_Mode_Proxy( - IDVBTLocator * This, - /* [retval][out] */ TransmissionMode *mode); - - - void __RPC_STUB IDVBTLocator_get_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_Mode_Proxy( - IDVBTLocator * This, - /* [in] */ TransmissionMode mode); - - - void __RPC_STUB IDVBTLocator_put_Mode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_get_OtherFrequencyInUse_Proxy( - IDVBTLocator * This, - /* [retval][out] */ VARIANT_BOOL *OtherFrequencyInUseVal); - - - void __RPC_STUB IDVBTLocator_get_OtherFrequencyInUse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBTLocator_put_OtherFrequencyInUse_Proxy( - IDVBTLocator * This, - /* [in] */ VARIANT_BOOL OtherFrequencyInUseVal); - - - void __RPC_STUB IDVBTLocator_put_OtherFrequencyInUse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDVBTLocator_INTERFACE_DEFINED__ */ - - - #ifndef __IDVBSLocator_INTERFACE_DEFINED__ - #define __IDVBSLocator_INTERFACE_DEFINED__ - - /* interface IDVBSLocator */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IDVBSLocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3D7C353C-0D04-45f1-A742-F97CC1188DC8") - IDVBSLocator : public ILocator - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SignalPolarisation( - /* [retval][out] */ Polarisation *PolarisationVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SignalPolarisation( - /* [in] */ Polarisation PolarisationVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_WestPosition( - /* [retval][out] */ VARIANT_BOOL *WestLongitude) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_WestPosition( - /* [in] */ VARIANT_BOOL WestLongitude) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OrbitalPosition( - /* [retval][out] */ long *longitude) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OrbitalPosition( - /* [in] */ long longitude) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Azimuth( - /* [retval][out] */ long *Azimuth) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Azimuth( - /* [in] */ long Azimuth) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Elevation( - /* [retval][out] */ long *Elevation) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Elevation( - /* [in] */ long Elevation) = 0; - - }; - - #else /* C style interface */ - - typedef struct IDVBSLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBSLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBSLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBSLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBSLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBSLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBSLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBSLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBSLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBSLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBSLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBSLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBSLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBSLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBSLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBSLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBSLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBSLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBSLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBSLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBSLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBSLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBSLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SignalPolarisation )( - IDVBSLocator * This, - /* [retval][out] */ Polarisation *PolarisationVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SignalPolarisation )( - IDVBSLocator * This, - /* [in] */ Polarisation PolarisationVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_WestPosition )( - IDVBSLocator * This, - /* [retval][out] */ VARIANT_BOOL *WestLongitude); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_WestPosition )( - IDVBSLocator * This, - /* [in] */ VARIANT_BOOL WestLongitude); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OrbitalPosition )( - IDVBSLocator * This, - /* [retval][out] */ long *longitude); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OrbitalPosition )( - IDVBSLocator * This, - /* [in] */ long longitude); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Azimuth )( - IDVBSLocator * This, - /* [retval][out] */ long *Azimuth); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Azimuth )( - IDVBSLocator * This, - /* [in] */ long Azimuth); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Elevation )( - IDVBSLocator * This, - /* [retval][out] */ long *Elevation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Elevation )( - IDVBSLocator * This, - /* [in] */ long Elevation); - - END_INTERFACE - } IDVBSLocatorVtbl; - - interface IDVBSLocator - { - CONST_VTBL struct IDVBSLocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDVBSLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDVBSLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDVBSLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDVBSLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDVBSLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDVBSLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDVBSLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDVBSLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - - #define IDVBSLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - - #define IDVBSLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - - #define IDVBSLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - - #define IDVBSLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - - #define IDVBSLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - - #define IDVBSLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - - #define IDVBSLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - - #define IDVBSLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - - #define IDVBSLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - - #define IDVBSLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - - #define IDVBSLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - - #define IDVBSLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - - #define IDVBSLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - - #define IDVBSLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - - #define IDVBSLocator_get_SignalPolarisation(This,PolarisationVal) \ - (This)->lpVtbl -> get_SignalPolarisation(This,PolarisationVal) - - #define IDVBSLocator_put_SignalPolarisation(This,PolarisationVal) \ - (This)->lpVtbl -> put_SignalPolarisation(This,PolarisationVal) - - #define IDVBSLocator_get_WestPosition(This,WestLongitude) \ - (This)->lpVtbl -> get_WestPosition(This,WestLongitude) - - #define IDVBSLocator_put_WestPosition(This,WestLongitude) \ - (This)->lpVtbl -> put_WestPosition(This,WestLongitude) - - #define IDVBSLocator_get_OrbitalPosition(This,longitude) \ - (This)->lpVtbl -> get_OrbitalPosition(This,longitude) - - #define IDVBSLocator_put_OrbitalPosition(This,longitude) \ - (This)->lpVtbl -> put_OrbitalPosition(This,longitude) - - #define IDVBSLocator_get_Azimuth(This,Azimuth) \ - (This)->lpVtbl -> get_Azimuth(This,Azimuth) - - #define IDVBSLocator_put_Azimuth(This,Azimuth) \ - (This)->lpVtbl -> put_Azimuth(This,Azimuth) - - #define IDVBSLocator_get_Elevation(This,Elevation) \ - (This)->lpVtbl -> get_Elevation(This,Elevation) - - #define IDVBSLocator_put_Elevation(This,Elevation) \ - (This)->lpVtbl -> put_Elevation(This,Elevation) - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_SignalPolarisation_Proxy( - IDVBSLocator * This, - /* [retval][out] */ Polarisation *PolarisationVal); - - - void __RPC_STUB IDVBSLocator_get_SignalPolarisation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_SignalPolarisation_Proxy( - IDVBSLocator * This, - /* [in] */ Polarisation PolarisationVal); - - - void __RPC_STUB IDVBSLocator_put_SignalPolarisation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_WestPosition_Proxy( - IDVBSLocator * This, - /* [retval][out] */ VARIANT_BOOL *WestLongitude); - - - void __RPC_STUB IDVBSLocator_get_WestPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_WestPosition_Proxy( - IDVBSLocator * This, - /* [in] */ VARIANT_BOOL WestLongitude); - - - void __RPC_STUB IDVBSLocator_put_WestPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_OrbitalPosition_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *longitude); - - - void __RPC_STUB IDVBSLocator_get_OrbitalPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_OrbitalPosition_Proxy( - IDVBSLocator * This, - /* [in] */ long longitude); - - - void __RPC_STUB IDVBSLocator_put_OrbitalPosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_Azimuth_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *Azimuth); - - - void __RPC_STUB IDVBSLocator_get_Azimuth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_Azimuth_Proxy( - IDVBSLocator * This, - /* [in] */ long Azimuth); - - - void __RPC_STUB IDVBSLocator_put_Azimuth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_get_Elevation_Proxy( - IDVBSLocator * This, - /* [retval][out] */ long *Elevation); - - - void __RPC_STUB IDVBSLocator_get_Elevation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDVBSLocator_put_Elevation_Proxy( - IDVBSLocator * This, - /* [in] */ long Elevation); - - - void __RPC_STUB IDVBSLocator_put_Elevation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - - #endif /* __IDVBSLocator_INTERFACE_DEFINED__ */ - - - #ifndef __IDVBCLocator_INTERFACE_DEFINED__ - #define __IDVBCLocator_INTERFACE_DEFINED__ - - /* interface IDVBCLocator */ - /* [unique][helpstring][oleautomation][dual][uuid][nonextensible][hidden][object] */ - - - EXTERN_C const IID IID_IDVBCLocator; - - #if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6E42F36E-1DD2-43c4-9F78-69D25AE39034") - IDVBCLocator : public ILocator - { - public: - }; - - #else /* C style interface */ - - typedef struct IDVBCLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDVBCLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDVBCLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDVBCLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDVBCLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDVBCLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDVBCLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDVBCLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CarrierFrequency )( - IDVBCLocator * This, - /* [retval][out] */ long *Frequency); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CarrierFrequency )( - IDVBCLocator * This, - /* [in] */ long Frequency); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFEC )( - IDVBCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFEC )( - IDVBCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_InnerFECRate )( - IDVBCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_InnerFECRate )( - IDVBCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFEC )( - IDVBCLocator * This, - /* [retval][out] */ FECMethod *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFEC )( - IDVBCLocator * This, - /* [in] */ FECMethod FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OuterFECRate )( - IDVBCLocator * This, - /* [retval][out] */ BinaryConvolutionCodeRate *FEC); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OuterFECRate )( - IDVBCLocator * This, - /* [in] */ BinaryConvolutionCodeRate FEC); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modulation )( - IDVBCLocator * This, - /* [retval][out] */ ModulationType *Modulation); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Modulation )( - IDVBCLocator * This, - /* [in] */ ModulationType Modulation); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SymbolRate )( - IDVBCLocator * This, - /* [retval][out] */ long *Rate); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SymbolRate )( - IDVBCLocator * This, - /* [in] */ long Rate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - IDVBCLocator * This, - /* [retval][out] */ ILocator **NewLocator); - - END_INTERFACE - } IDVBCLocatorVtbl; - - interface IDVBCLocator - { - CONST_VTBL struct IDVBCLocatorVtbl *lpVtbl; - }; - - - - #ifdef COBJMACROS - - - #define IDVBCLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - - #define IDVBCLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - - #define IDVBCLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - - #define IDVBCLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - - #define IDVBCLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - - #define IDVBCLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - - #define IDVBCLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - - #define IDVBCLocator_get_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> get_CarrierFrequency(This,Frequency) - - #define IDVBCLocator_put_CarrierFrequency(This,Frequency) \ - (This)->lpVtbl -> put_CarrierFrequency(This,Frequency) - - #define IDVBCLocator_get_InnerFEC(This,FEC) \ - (This)->lpVtbl -> get_InnerFEC(This,FEC) - - #define IDVBCLocator_put_InnerFEC(This,FEC) \ - (This)->lpVtbl -> put_InnerFEC(This,FEC) - - #define IDVBCLocator_get_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> get_InnerFECRate(This,FEC) - - #define IDVBCLocator_put_InnerFECRate(This,FEC) \ - (This)->lpVtbl -> put_InnerFECRate(This,FEC) - - #define IDVBCLocator_get_OuterFEC(This,FEC) \ - (This)->lpVtbl -> get_OuterFEC(This,FEC) - - #define IDVBCLocator_put_OuterFEC(This,FEC) \ - (This)->lpVtbl -> put_OuterFEC(This,FEC) - - #define IDVBCLocator_get_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> get_OuterFECRate(This,FEC) - - #define IDVBCLocator_put_OuterFECRate(This,FEC) \ - (This)->lpVtbl -> put_OuterFECRate(This,FEC) - - #define IDVBCLocator_get_Modulation(This,Modulation) \ - (This)->lpVtbl -> get_Modulation(This,Modulation) - - #define IDVBCLocator_put_Modulation(This,Modulation) \ - (This)->lpVtbl -> put_Modulation(This,Modulation) - - #define IDVBCLocator_get_SymbolRate(This,Rate) \ - (This)->lpVtbl -> get_SymbolRate(This,Rate) - - #define IDVBCLocator_put_SymbolRate(This,Rate) \ - (This)->lpVtbl -> put_SymbolRate(This,Rate) - - #define IDVBCLocator_Clone(This,NewLocator) \ - (This)->lpVtbl -> Clone(This,NewLocator) - - - #endif /* COBJMACROS */ - - - #endif /* C style interface */ - - - - - #endif /* __IDVBCLocator_INTERFACE_DEFINED__ */ - - - - #ifndef __TunerLib_LIBRARY_DEFINED__ - #define __TunerLib_LIBRARY_DEFINED__ - - /* library TunerLib */ - /* [helpstring][version][uuid] */ - - - EXTERN_C const IID LIBID_TunerLib; - - EXTERN_C const CLSID CLSID_SystemTuningSpaces; - - #ifdef __cplusplus - - class DECLSPEC_UUID("D02AAC50-027E-11d3-9D8E-00C04F72D980") - SystemTuningSpaces; - #endif - - EXTERN_C const CLSID CLSID_TuningSpace; - - #ifdef __cplusplus - - class DECLSPEC_UUID("5FFDC5E6-B83A-4b55-B6E8-C69E765FE9DB") - TuningSpace; - #endif - - EXTERN_C const CLSID CLSID_ATSCTuningSpace; - - #ifdef __cplusplus - - class DECLSPEC_UUID("A2E30750-6C3D-11d3-B653-00C04F79498E") - ATSCTuningSpace; - #endif - - EXTERN_C const CLSID CLSID_AnalogRadioTuningSpace; - - #ifdef __cplusplus - - class DECLSPEC_UUID("8A674B4C-1F63-11d3-B64C-00C04F79498E") - AnalogRadioTuningSpace; - #endif - - EXTERN_C const CLSID CLSID_AnalogTVTuningSpace; - - #ifdef __cplusplus - - class DECLSPEC_UUID("8A674B4D-1F63-11d3-B64C-00C04F79498E") - AnalogTVTuningSpace; - #endif - - EXTERN_C const CLSID CLSID_DVBTuningSpace; - - #ifdef __cplusplus - - class DECLSPEC_UUID("C6B14B32-76AA-4a86-A7AC-5C79AAF58DA7") - DVBTuningSpace; - #endif - - EXTERN_C const CLSID CLSID_ComponentTypes; - - #ifdef __cplusplus - - class DECLSPEC_UUID("A1A2B1C4-0E3A-11d3-9D8E-00C04F72D980") - ComponentTypes; - #endif - - EXTERN_C const CLSID CLSID_ComponentType; - - #ifdef __cplusplus - - class DECLSPEC_UUID("823535A0-0318-11d3-9D8E-00C04F72D980") - ComponentType; - #endif - - EXTERN_C const CLSID CLSID_LanguageComponentType; - - #ifdef __cplusplus - - class DECLSPEC_UUID("1BE49F30-0E1B-11d3-9D8E-00C04F72D980") - LanguageComponentType; - #endif - - EXTERN_C const CLSID CLSID_MPEG2ComponentType; - - #ifdef __cplusplus - - class DECLSPEC_UUID("418008F3-CF67-4668-9628-10DC52BE1D08") - MPEG2ComponentType; - #endif - - EXTERN_C const CLSID CLSID_ATSCComponentType; - - #ifdef __cplusplus - - class DECLSPEC_UUID("A8DCF3D5-0780-4ef4-8A83-2CFFAACB8ACE") - ATSCComponentType; - #endif - - EXTERN_C const CLSID CLSID_Components; - - #ifdef __cplusplus - - class DECLSPEC_UUID("809B6661-94C4-49e6-B6EC-3F0F862215AA") - Components; - #endif - - EXTERN_C const CLSID CLSID_Component; - - #ifdef __cplusplus - - class DECLSPEC_UUID("59DC47A8-116C-11d3-9D8E-00C04F72D980") - Component; - #endif - - EXTERN_C const CLSID CLSID_MPEG2Component; - - #ifdef __cplusplus - - class DECLSPEC_UUID("055CB2D7-2969-45cd-914B-76890722F112") - MPEG2Component; - #endif - - EXTERN_C const CLSID CLSID_TuneRequest; - - #ifdef __cplusplus - - class DECLSPEC_UUID("B46E0D38-AB35-4a06-A137-70576B01B39F") - TuneRequest; - #endif - - EXTERN_C const CLSID CLSID_ChannelTuneRequest; - - #ifdef __cplusplus - - class DECLSPEC_UUID("0369B4E5-45B6-11d3-B650-00C04F79498E") - ChannelTuneRequest; - #endif - - EXTERN_C const CLSID CLSID_ATSCChannelTuneRequest; - - #ifdef __cplusplus - - class DECLSPEC_UUID("0369B4E6-45B6-11d3-B650-00C04F79498E") - ATSCChannelTuneRequest; - #endif - - EXTERN_C const CLSID CLSID_Locator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("0888C883-AC4F-4943-B516-2C38D9B34562") - Locator; - #endif - - EXTERN_C const CLSID CLSID_ATSCLocator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("8872FF1B-98FA-4d7a-8D93-C9F1055F85BB") - ATSCLocator; - #endif - - EXTERN_C const CLSID CLSID_DVBTLocator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("9CD64701-BDF3-4d14-8E03-F12983D86664") - DVBTLocator; - #endif - - EXTERN_C const CLSID CLSID_DVBSLocator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("1DF7D126-4050-47f0-A7CF-4C4CA9241333") - DVBSLocator; - #endif - - EXTERN_C const CLSID CLSID_DVBCLocator; - - #ifdef __cplusplus - - class DECLSPEC_UUID("C531D9FD-9685-4028-8B68-6E1232079F1E") - DVBCLocator; - #endif - - EXTERN_C const CLSID CLSID_DVBTuneRequest; - - #ifdef __cplusplus - - class DECLSPEC_UUID("15D6504A-5494-499c-886C-973C9E53B9F1") - DVBTuneRequest; - #endif - - EXTERN_C const CLSID CLSID_CreatePropBagOnRegKey; - - #ifdef __cplusplus - - class DECLSPEC_UUID("8A674B49-1F63-11d3-B64C-00C04F79498E") - CreatePropBagOnRegKey; - #endif - #endif /* __TunerLib_LIBRARY_DEFINED__ */ - - /* Additional Prototypes for ALL interfaces */ - - unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); - unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); - unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); - void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - - unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); - unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); - unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); - void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - - /* end of Additional Prototypes */ - - #ifdef __cplusplus - } - #endif - - #endif - - -#endif // DirectX 8.0 content \ No newline at end of file diff --git a/import/DirectX8/include/uuids.h b/import/DirectX8/include/uuids.h deleted file mode 100644 index 61bb5799e..000000000 --- a/import/DirectX8/include/uuids.h +++ /dev/null @@ -1,1312 +0,0 @@ -//------------------------------------------------------------------------------ -// File: uuids.h -// -// Desc: Contains the GUIDs for the MediaType type, subtype fields and format -// types for standard media types, and also class IDs for well-known -// components. -// -// Copyright (c) 1992 - 2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -// -// We want to use this list for generating strings for debugging too, -// so we redefine OUR_GUID_ENTRY depending on what we want to do. -// -// It is imperative that all entries in this file are declared using -// OUR_GUID_ENTRY, as that macro might have been defined in advance of -// including this file. See wxdebug.cpp in the -// samples\multimedia\directshow\baseclasses directory. -// - -#ifndef OUR_GUID_ENTRY - #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8); -#endif - - -// -- to allow consistent labeling of Media types and subtypes -- - -#define MEDIATYPE_NULL GUID_NULL -#define MEDIASUBTYPE_NULL GUID_NULL - -// -- Use this subtype if you don't have a use for a subtype for your type -// e436eb8e-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_None -OUR_GUID_ENTRY(MEDIASUBTYPE_None, -0xe436eb8e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - - -// -- major types --- - - -// 73646976-0000-0010-8000-00AA00389B71 'vids' == MEDIATYPE_Video -OUR_GUID_ENTRY(MEDIATYPE_Video, -0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 73647561-0000-0010-8000-00AA00389B71 'auds' == MEDIATYPE_Audio -OUR_GUID_ENTRY(MEDIATYPE_Audio, -0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 73747874-0000-0010-8000-00AA00389B71 'txts' == MEDIATYPE_Text -OUR_GUID_ENTRY(MEDIATYPE_Text, -0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 7364696D-0000-0010-8000-00AA00389B71 'mids' == MEDIATYPE_Midi -OUR_GUID_ENTRY(MEDIATYPE_Midi, -0x7364696D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// e436eb83-524f-11ce-9f53-0020af0ba770 MEDIATYPE_Stream -OUR_GUID_ENTRY(MEDIATYPE_Stream, -0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 73(s)76(v)61(a)69(i)-0000-0010-8000-00AA00389B71 'iavs' == MEDIATYPE_Interleaved -OUR_GUID_ENTRY(MEDIATYPE_Interleaved, -0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 656c6966-0000-0010-8000-00AA00389B71 'file' == MEDIATYPE_File -OUR_GUID_ENTRY(MEDIATYPE_File, -0x656c6966, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 73636d64-0000-0010-8000-00AA00389B71 'scmd' == MEDIATYPE_ScriptCommand -OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand, -0x73636d64, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 670AEA80-3A82-11d0-B79B-00AA003767A7 MEDIATYPE_AUXLine21Data -OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data, -0x670aea80, 0x3a82, 0x11d0, 0xb7, 0x9b, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// F72A76E1-EB0A-11D0-ACE4-0000C0CC16BA MEDIATYPE_VBI -OUR_GUID_ENTRY(MEDIATYPE_VBI, -0xf72a76e1, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// 0482DEE3-7817-11cf-8a03-00aa006ecb65 MEDIATYPE_Timecode -OUR_GUID_ENTRY(MEDIATYPE_Timecode, -0x482dee3, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 74726c6d-0000-0010-8000-00AA00389B71 'lmrt' == MEDIATYPE_LMRT -OUR_GUID_ENTRY(MEDIATYPE_LMRT, -0x74726c6d, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 74726c6d-0000-0010-8000-00AA00389B71 'urls' == MEDIATYPE_URL_STREAM -OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM, -0x736c7275, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// -- sub types --- - -// 4C504C43-0000-0010-8000-00AA00389B71 'CLPL' == MEDIASUBTYPE_CLPL -OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL, -0x4C504C43, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 56595559-0000-0010-8000-00AA00389B71 'YUYV' == MEDIASUBTYPE_YUYV -OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV, -0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 56555949-0000-0010-8000-00AA00389B71 'IYUV' == MEDIASUBTYPE_IYUV -OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV, -0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 39555659-0000-0010-8000-00AA00389B71 'YVU9' == MEDIASUBTYPE_YVU9 -OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9, -0x39555659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 31313459-0000-0010-8000-00AA00389B71 'Y411' == MEDIASUBTYPE_Y411 -OUR_GUID_ENTRY(MEDIASUBTYPE_Y411, -0x31313459, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 50313459-0000-0010-8000-00AA00389B71 'Y41P' == MEDIASUBTYPE_Y41P -OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P, -0x50313459, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 32595559-0000-0010-8000-00AA00389B71 'YUY2' == MEDIASUBTYPE_YUY2 -OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2, -0x32595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 55595659-0000-0010-8000-00AA00389B71 'YVYU' == MEDIASUBTYPE_YVYU -OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU, -0x55595659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 59565955-0000-0010-8000-00AA00389B71 'UYVY' == MEDIASUBTYPE_UYVY -OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY, -0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 31313259-0000-0010-8000-00AA00389B71 'Y211' == MEDIASUBTYPE_Y211 -OUR_GUID_ENTRY(MEDIASUBTYPE_Y211, -0x31313259, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 31313259-0000-0010-8000-00AA00389B71 'YV12' == MEDIASUBTYPE_YV12 -OUR_GUID_ENTRY(MEDIASUBTYPE_YV12, -0x32315659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 524a4c43-0000-0010-8000-00AA00389B71 'CLJR' == MEDIASUBTYPE_CLJR -OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR, -0x524a4c43, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 39304649-0000-0010-8000-00AA00389B71 'IF09' == MEDIASUBTYPE_IF09 -OUR_GUID_ENTRY(MEDIASUBTYPE_IF09, -0x39304649, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 414c5043-0000-0010-8000-00AA00389B71 'CPLA' == MEDIASUBTYPE_CPLA -OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA, -0x414c5043, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 47504A4D-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_MJPG -OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG, -0x47504A4D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 4A4D5654-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_TVMJ -OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ, -0x4A4D5654, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 454B4157-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_WAKE -OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE, -0x454B4157, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 43434643-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_CFCC -OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC, -0x43434643, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 47504A49-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_IJPG -OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG, -0x47504A49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 6D756C50-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_Plum -OUR_GUID_ENTRY(MEDIASUBTYPE_Plum, -0x6D756C50, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// FAST DV-Master -// 53435644-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_DVCS -OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS, -0x53435644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// FAST DV-Master -// 44535644-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_DVSD -OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD, -0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// MIROVideo DV -// 4656444D-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_MDVF -OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF, -0x4656444D, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// e436eb78-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB1 -// e436eb78-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB1 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1, -0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb79-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB4 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4, -0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb7a-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB8 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8, -0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb7b-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB565 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565, -0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb7c-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB555 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555, -0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb7d-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB24 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24, -0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb7e-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_RGB32 -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32, -0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - - -// -// RGB surfaces that contain per pixel alpha values. -// - -// 297C55AF-E209-4cb3-B757-C76D6B9C88A8 MEDIASUBTYPE_ARGB1555 -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555, -0x297c55af, 0xe209, 0x4cb3, 0xb7, 0x57, 0xc7, 0x6d, 0x6b, 0x9c, 0x88, 0xa8) - -// 6E6415E6-5C24-425f-93CD-80102B3D1CCA MEDIASUBTYPE_ARGB4444 -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444, -0x6e6415e6, 0x5c24, 0x425f, 0x93, 0xcd, 0x80, 0x10, 0x2b, 0x3d, 0x1c, 0xca) - -// 773c9ac0-3274-11d0-B724-00aa006c1A01 MEDIASUBTYPE_ARGB32 -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32, -0x773c9ac0, 0x3274, 0x11d0, 0xb7, 0x24, 0x0, 0xaa, 0x0, 0x6c, 0x1a, 0x1 ) - -// 56555941-0000-0010-8000-00AA00389B71 'AYUV' == MEDIASUBTYPE_AYUV -// -// See the DX-VA header and documentation for a description of this format. -// -OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV, -0x56555941, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 34344941-0000-0010-8000-00AA00389B71 'AI44' == MEDIASUBTYPE_AI44 -// -// See the DX-VA header and documentation for a description of this format. -// -OUR_GUID_ENTRY(MEDIASUBTYPE_AI44, -0x34344941, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 34344149-0000-0010-8000-00AA00389B71 'IA44' == MEDIASUBTYPE_IA44 -// -// See the DX-VA header and documentation for a description of this format. -// -OUR_GUID_ENTRY(MEDIASUBTYPE_IA44, -0x34344149, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - - -// -// DirectX7 D3D Render Target media subtypes. -// - -// 32335237-0000-0010-8000-00AA00389B71 '7R32' == MEDIASUBTYPE_RGB32_D3D_DX7_RT -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT, -0x32335237, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 36315237-0000-0010-8000-00AA00389B71 '7R16' == MEDIASUBTYPE_RGB16_D3D_DX7_RT -OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT, -0x36315237, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 38384137-0000-0010-8000-00AA00389B71 '7A88' == MEDIASUBTYPE_ARGB32_D3D_DX7_RT -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT, -0x38384137, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 34344137-0000-0010-8000-00AA00389B71 '7A44' == MEDIASUBTYPE_ARGB4444_D3D_DX7_RT -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT, -0x34344137, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 35314137-0000-0010-8000-00AA00389B71 '7A15' == MEDIASUBTYPE_ARGB1555_D3D_DX7_RT -OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT, -0x35314137, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - - -#define MEDIASUBTYPE_HASALPHA(mt) ( ((mt).subtype == MEDIASUBTYPE_ARGB4444) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB32) || \ - ((mt).subtype == MEDIASUBTYPE_AYUV) || \ - ((mt).subtype == MEDIASUBTYPE_AI44) || \ - ((mt).subtype == MEDIASUBTYPE_IA44) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB1555) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) ) - -#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype == MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_RGB32_D3D_DX7_RT) || \ - ((mt).subtype == MEDIASUBTYPE_RGB16_D3D_DX7_RT)) - - -// e436eb7f-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_Overlay -OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay, -0xe436eb7f, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb80-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEGPacket -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet, -0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb81-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1Payload -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload, -0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 00000050-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_MPEG1AudioPayload -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload, -0x00000050, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71) - -// e436eb82-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1SystemStream -OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream, -0xe436eb82, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// the next consecutive number is assigned to MEDIATYPE_Stream and appears higher up -// e436eb84-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1System -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System, -0xe436eb84, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb85-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1VideoCD -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD, -0xe436eb85, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb86-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1Video -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video, -0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb87-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_MPEG1Audio -OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio, -0xe436eb87, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb88-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_Avi -OUR_GUID_ENTRY(MEDIASUBTYPE_Avi, -0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// {3DB80F90-9412-11d1-ADED-0000F8754B99} MEDIASUBTYPE_Asf -OUR_GUID_ENTRY(MEDIASUBTYPE_Asf, -0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x0, 0x0, 0xf8, 0x75, 0x4b, 0x99) - -// e436eb89-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_QTMovie -OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie, -0xe436eb89, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 617a7072-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_Rpza -OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza, -0x617a7072, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 20636d73-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_Smc -OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc, -0x20636d73, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 20656c72-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_Rle -OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle, -0x20656c72, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 6765706a-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_Jpeg -OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg, -0x6765706a, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// e436eb8a-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_PCMAudio_Obsolete -OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete, -0xe436eb8a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 00000001-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_PCM -OUR_GUID_ENTRY(MEDIASUBTYPE_PCM, -0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71) - -// e436eb8b-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_WAVE -OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE, -0xe436eb8b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb8c-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_AU -OUR_GUID_ENTRY(MEDIASUBTYPE_AU, -0xe436eb8c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436eb8d-524f-11ce-9f53-0020af0ba770 MEDIASUBTYPE_AIFF -OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF, -0xe436eb8d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 64(d)73(s)76(v)64(d)-0000-0010-8000-00AA00389B71 'dvsd' == MEDIASUBTYPE_dvsd -OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd, -0x64737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 64(d)68(h)76(v)64(d)-0000-0010-8000-00AA00389B71 'dvhd' == MEDIASUBTYPE_dvhd -OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd, -0x64687664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 6c(l)73(s)76(v)64(d)-0000-0010-8000-00AA00389B71 'dvsl' == MEDIASUBTYPE_dvsl -OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl, -0x6c737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// 6E8D4A22-310C-11d0-B79A-00AA003767A7 MEDIASUBTYPE_Line21_BytePair -OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair, -0x6e8d4a22, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// 6E8D4A23-310C-11d0-B79A-00AA003767A7 MEDIASUBTYPE_Line21_GOPPacket -OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket, -0x6e8d4a23, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// 6E8D4A24-310C-11d0-B79A-00AA003767A7 MEDIASUBTYPE_Line21_VBIRawData -OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData, -0x6e8d4a24, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// F72A76E3-EB0A-11D0-ACE4-0000C0CC16BA MEDIASUBTYPE_TELETEXT -OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT, -0xf72a76e3, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// derived from WAVE_FORMAT_DRM -// 00000009-0000-0010-8000-00aa00389b71 -OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio, -0x00000009, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// derived from WAVE_FORMAT_IEEE_FLOAT -// 00000003-0000-0010-8000-00aa00389b71 -OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT, -0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// derived from WAVE_FORMAT_DOLBY_AC3_SPDIF -// 00000092-0000-0010-8000-00aa00389b71 -OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF, -0x00000092, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// derived from WAVE_FORMAT_RAW_SPORT -// 00000240-0000-0010-8000-00aa00389b71 -OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT, -0x00000240, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - -// derived from wave format tag 0x241, call it SPDIF_TAG_241h for now -// 00000241-0000-0010-8000-00aa00389b71 -OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h, -0x00000241, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71) - - - -// DirectShow DSS definitions - -// A0AF4F81-E163-11d0-BAD9-00609744111A -OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo, -0xa0af4f81, 0xe163, 0x11d0, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// A0AF4F82-E163-11d0-BAD9-00609744111A -OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio, -0xa0af4f82, 0xe163, 0x11d0, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// 5A9B6A40-1A22-11D1-BAD9-00609744111A -OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo, -0x5a9b6a40, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// 5A9B6A41-1A22-11D1-BAD9-00609744111A -OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI, -0x5a9b6a41, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// BF87B6E0-8C27-11d0-B3F0-00AA003761C5 Capture graph building -OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder, -0xBF87B6E0, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5) - -// BF87B6E1-8C27-11d0-B3F0-00AA003761C5 New Capture graph building -OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2, -0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5) - -// e436ebb0-524f-11ce-9f53-0020af0ba770 Prototype filtergraph -OUR_GUID_ENTRY(CLSID_ProtoFilterGraph, -0xe436ebb0, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436ebb1-524f-11ce-9f53-0020af0ba770 Reference clock -OUR_GUID_ENTRY(CLSID_SystemClock, -0xe436ebb1, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436ebb2-524f-11ce-9f53-0020af0ba770 Filter Mapper -OUR_GUID_ENTRY(CLSID_FilterMapper, -0xe436ebb2, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436ebb3-524f-11ce-9f53-0020af0ba770 Filter Graph -OUR_GUID_ENTRY(CLSID_FilterGraph, -0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e436ebb8-524f-11ce-9f53-0020af0ba770 Filter Graph no thread -OUR_GUID_ENTRY(CLSID_FilterGraphNoThread, -0xe436ebb8, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// e4bbd160-4269-11ce-838d-00aa0055595a MPEG System stream -OUR_GUID_ENTRY(CLSID_MPEG1Doc, -0xe4bbd160, 0x4269, 0x11ce, 0x83, 0x8d, 0x0, 0xaa, 0x0, 0x55, 0x59, 0x5a) - -// 701722e0-8ae3-11ce-a85c-00aa002feab5 MPEG file reader -OUR_GUID_ENTRY(CLSID_FileSource, -0x701722e0, 0x8ae3, 0x11ce, 0xa8, 0x5c, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5) - -// 26C25940-4CA9-11ce-A828-00AA002FEAB5 Takes MPEG1 packets as input -OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer, -0x26c25940, 0x4ca9, 0x11ce, 0xa8, 0x28, 0x0, 0xaa, 0x0, 0x2f, 0xea, 0xb5) - -// 336475d0-942a-11ce-a870-00aa002feab5 MPEG splitter -OUR_GUID_ENTRY(CLSID_MPEG1Splitter, -0x336475d0, 0x942a, 0x11ce, 0xa8, 0x70, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5) - -// feb50740-7bef-11ce-9bd9-0000e202599c MPEG video decoder -OUR_GUID_ENTRY(CLSID_CMpegVideoCodec, -0xfeb50740, 0x7bef, 0x11ce, 0x9b, 0xd9, 0x0, 0x0, 0xe2, 0x2, 0x59, 0x9c) - -// 4a2286e0-7bef-11ce-9bd9-0000e202599c MPEG audio decoder -OUR_GUID_ENTRY(CLSID_CMpegAudioCodec, -0x4a2286e0, 0x7bef, 0x11ce, 0x9b, 0xd9, 0x0, 0x0, 0xe2, 0x2, 0x59, 0x9c) - -// e30629d3-27e5-11ce-875d-00608cb78066 Text renderer -OUR_GUID_ENTRY(CLSID_TextRender, -0xe30629d3, 0x27e5, 0x11ce, 0x87, 0x5d, 0x0, 0x60, 0x8c, 0xb7, 0x80, 0x66) - - - -// {F8388A40-D5BB-11d0-BE5A-0080C706568E} -OUR_GUID_ENTRY(CLSID_InfTee, -0xf8388a40, 0xd5bb, 0x11d0, 0xbe, 0x5a, 0x0, 0x80, 0xc7, 0x6, 0x56, 0x8e) - -// 1b544c20-fd0b-11ce-8c63-00aa0044b51e Avi Stream Splitter -OUR_GUID_ENTRY(CLSID_AviSplitter, -0x1b544c20, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x0, 0xaa, 0x00, 0x44, 0xb5, 0x1e) - -// 1b544c21-fd0b-11ce-8c63-00aa0044b51e Avi File Reader -OUR_GUID_ENTRY(CLSID_AviReader, -0x1b544c21, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x0, 0xaa, 0x00, 0x44, 0xb5, 0x1e) - -// 1b544c22-fd0b-11ce-8c63-00aa0044b51e Vfw 2.0 Capture Driver -OUR_GUID_ENTRY(CLSID_VfwCapture, -0x1b544c22, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x0, 0xaa, 0x00, 0x44, 0xb5, 0x1e) - -OUR_GUID_ENTRY(CLSID_CaptureProperties, -0x1B544c22, 0xFD0B, 0x11ce, 0x8C, 0x63, 0x00, 0xAA, 0x00, 0x44, 0xB5, 0x1F) - -//e436ebb4-524f-11ce-9f53-0020af0ba770 Control Distributor -OUR_GUID_ENTRY(CLSID_FGControl, -0xe436ebb4, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// 44584800-F8EE-11ce-B2D4-00DD01101B85 .MOV reader (old) -OUR_GUID_ENTRY(CLSID_MOVReader, -0x44584800, 0xf8ee, 0x11ce, 0xb2, 0xd4, 0x00, 0xdd, 0x1, 0x10, 0x1b, 0x85) - -// D51BD5A0-7548-11cf-A520-0080C77EF58A QT Splitter -OUR_GUID_ENTRY(CLSID_QuickTimeParser, -0xd51bd5a0, 0x7548, 0x11cf, 0xa5, 0x20, 0x0, 0x80, 0xc7, 0x7e, 0xf5, 0x8a) - -// FDFE9681-74A3-11d0-AFA7-00AA00B67A42 QT Decoder -OUR_GUID_ENTRY(CLSID_QTDec, -0xfdfe9681, 0x74a3, 0x11d0, 0xaf, 0xa7, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// D3588AB0-0781-11ce-B03A-0020AF0BA770 AVIFile-based reader -OUR_GUID_ENTRY(CLSID_AVIDoc, -0xd3588ab0, 0x0781, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0xb, 0xa7, 0x70) - -// 70e102b0-5556-11ce-97c0-00aa0055595a Video renderer -OUR_GUID_ENTRY(CLSID_VideoRenderer, -0x70e102b0, 0x5556, 0x11ce, 0x97, 0xc0, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 1643e180-90f5-11ce-97d5-00aa0055595a Colour space convertor -OUR_GUID_ENTRY(CLSID_Colour, -0x1643e180, 0x90f5, 0x11ce, 0x97, 0xd5, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 1da08500-9edc-11cf-bc10-00aa00ac74f6 VGA 16 color ditherer -OUR_GUID_ENTRY(CLSID_Dither, -0x1da08500, 0x9edc, 0x11cf, 0xbc, 0x10, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6) - -// 07167665-5011-11cf-BF33-00AA0055595A Modex video renderer -OUR_GUID_ENTRY(CLSID_ModexRenderer, -0x7167665, 0x5011, 0x11cf, 0xbf, 0x33, 0x0, 0xaa, 0x0, 0x55, 0x59, 0x5a) - -// e30629d1-27e5-11ce-875d-00608cb78066 Waveout audio renderer -OUR_GUID_ENTRY(CLSID_AudioRender, -0xe30629d1, 0x27e5, 0x11ce, 0x87, 0x5d, 0x0, 0x60, 0x8c, 0xb7, 0x80, 0x66) - -// 05589faf-c356-11ce-bf01-00aa0055595a Audio Renderer Property Page -OUR_GUID_ENTRY(CLSID_AudioProperties, -0x05589faf, 0xc356, 0x11ce, 0xbf, 0x01, 0x0, 0xaa, 0x0, 0x55, 0x59, 0x5a) - -// 79376820-07D0-11cf-A24D-0020AFD79767 DSound audio renderer -OUR_GUID_ENTRY(CLSID_DSoundRender, -0x79376820, 0x07D0, 0x11CF, 0xA2, 0x4D, 0x0, 0x20, 0xAF, 0xD7, 0x97, 0x67) - -// e30629d2-27e5-11ce-875d-00608cb78066 Wavein audio recorder -OUR_GUID_ENTRY(CLSID_AudioRecord, -0xe30629d2, 0x27e5, 0x11ce, 0x87, 0x5d, 0x0, 0x60, 0x8c, 0xb7, 0x80, 0x66) - -// {2CA8CA52-3C3F-11d2-B73D-00C04FB6BD3D} IAMAudioInputMixer property page -OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties, -0x2ca8ca52, 0x3c3f, 0x11d2, 0xb7, 0x3d, 0x0, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d) - -// {CF49D4E0-1115-11ce-B03A-0020AF0BA770} AVI Decoder -OUR_GUID_ENTRY(CLSID_AVIDec, -0xcf49d4e0, 0x1115, 0x11ce, 0xb0, 0x3a, 0x0, 0x20, 0xaf, 0xb, 0xa7, 0x70) - -// {A888DF60-1E90-11cf-AC98-00AA004C0FA9} AVI ICDraw* wrapper -OUR_GUID_ENTRY(CLSID_AVIDraw, -0xa888df60, 0x1e90, 0x11cf, 0xac, 0x98, 0x0, 0xaa, 0x0, 0x4c, 0xf, 0xa9) - -// 6a08cf80-0e18-11cf-a24d-0020afd79767 ACM Wrapper -OUR_GUID_ENTRY(CLSID_ACMWrapper, -0x6a08cf80, 0x0e18, 0x11cf, 0xa2, 0x4d, 0x0, 0x20, 0xaf, 0xd7, 0x97, 0x67) - -// {e436ebb5-524f-11ce-9f53-0020af0ba770} Async File Reader -OUR_GUID_ENTRY(CLSID_AsyncReader, -0xe436ebb5, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// {e436ebb6-524f-11ce-9f53-0020af0ba770} Async URL Reader -OUR_GUID_ENTRY(CLSID_URLReader, -0xe436ebb6, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// {e436ebb7-524f-11ce-9f53-0020af0ba770} IPersistMoniker PID -OUR_GUID_ENTRY(CLSID_PersistMonikerPID, -0xe436ebb7, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70) - -// {5f2759c0-7685-11cf-8b23-00805f6cef60} IAMovie plug-in distributor -OUR_GUID_ENTRY(CLSID_AMovie, -0x5f2759c0, 0x7685, 0x11cf, 0x8b, 0x23, 0x00, 0x80, 0x5f, 0x6c, 0xef, 0x60) - -// {D76E2820-1563-11cf-AC98-00AA004C0FA9} -OUR_GUID_ENTRY(CLSID_AVICo, -0xd76e2820, 0x1563, 0x11cf, 0xac, 0x98, 0x0, 0xaa, 0x0, 0x4c, 0xf, 0xa9) - -// {8596E5F0-0DA5-11d0-BD21-00A0C911CE86} -OUR_GUID_ENTRY(CLSID_FileWriter, -0x8596e5f0, 0xda5, 0x11d0, 0xbd, 0x21, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// {E2510970-F137-11CE-8B67-00AA00A3F1A6} AVI mux filter -OUR_GUID_ENTRY(CLSID_AviDest, -0xe2510970, 0xf137, 0x11ce, 0x8b, 0x67, 0x0, 0xaa, 0x0, 0xa3, 0xf1, 0xa6) - -// {C647B5C0-157C-11d0-BD23-00A0C911CE86} -OUR_GUID_ENTRY(CLSID_AviMuxProptyPage, -0xc647b5c0, 0x157c, 0x11d0, 0xbd, 0x23, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// {0A9AE910-85C0-11d0-BD42-00A0C911CE86} -OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1, -0xa9ae910, 0x85c0, 0x11d0, 0xbd, 0x42, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// {07b65360-c445-11ce-afde-00aa006c14f4} -OUR_GUID_ENTRY(CLSID_AVIMIDIRender, -0x07b65360, 0xc445, 0x11ce, 0xaf, 0xde, 0x00, 0xaa, 0x00, 0x6c, 0x14, 0xf4) - -// {187463A0-5BB7-11d3-ACBE-0080C75E246E} WMSDK-based ASF reader -OUR_GUID_ENTRY(CLSID_WMAsfReader, -0x187463a0, 0x5bb7, 0x11d3, 0xac, 0xbe, 0x0, 0x80, 0xc7, 0x5e, 0x24, 0x6e) - -// {7c23220e-55bb-11d3-8b16-00c04fb6bd3d} WMSDK-based ASF writer -OUR_GUID_ENTRY(CLSID_WMAsfWriter, -0x7c23220e, 0x55bb, 0x11d3, 0x8b, 0x16, 0x0, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d) - -// {afb6c280-2c41-11d3-8a60-0000f81e0e4a} -OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer, -0xafb6c280, 0x2c41, 0x11d3, 0x8a, 0x60, 0x00, 0x00, 0xf8, 0x1e, 0x0e, 0x4a) - -// {3ae86b20-7be8-11d1-abe6-00a0c905f375} -OUR_GUID_ENTRY(CLSID_MMSPLITTER, -0x3ae86b20, 0x7be8, 0x11d1, 0xab, 0xe6, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75) - - -// {B1B77C00-C3E4-11cf-AF79-00AA00B67A42} DV video decoder -OUR_GUID_ENTRY(CLSID_DVVideoCodec, -0xb1b77c00, 0xc3e4, 0x11cf, 0xaf, 0x79, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {13AA3650-BB6F-11d0-AFB9-00AA00B67A42} DV video encoder -OUR_GUID_ENTRY(CLSID_DVVideoEnc, -0x13aa3650, 0xbb6f, 0x11d0, 0xaf, 0xb9, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {4EB31670-9FC6-11cf-AF6E-00AA00B67A42} DV splitter -OUR_GUID_ENTRY(CLSID_DVSplitter, -0x4eb31670, 0x9fc6, 0x11cf, 0xaf, 0x6e, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {129D7E40-C10D-11d0-AFB9-00AA00B67A42} DV muxer -OUR_GUID_ENTRY(CLSID_DVMux, -0x129d7e40, 0xc10d, 0x11d0, 0xaf, 0xb9, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {060AF76C-68DD-11d0-8FC1-00C04FD9189D} -OUR_GUID_ENTRY(CLSID_SeekingPassThru, -0x60af76c, 0x68dd, 0x11d0, 0x8f, 0xc1, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d) - -// 6E8D4A20-310C-11d0-B79A-00AA003767A7 Line21 (CC) Decoder -OUR_GUID_ENTRY(CLSID_Line21Decoder, -0x6e8d4a20, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// E4206432-01A1-4BEE-B3E1-3702C8EDC574 Line21 (CC) Decoder v2 -OUR_GUID_ENTRY(CLSID_Line21Decoder2, -0xe4206432, 0x01a1, 0x4bee, 0xb3, 0xe1, 0x37, 0x02, 0xc8, 0xed, 0xc5, 0x74) - -// {CD8743A1-3736-11d0-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(CLSID_OverlayMixer, -0xcd8743a1, 0x3736, 0x11d0, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {814B9800-1C88-11d1-BAD9-00609744111A} -OUR_GUID_ENTRY(CLSID_VBISurfaces, -0x814b9800, 0x1c88, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// {70BC06E0-5666-11d3-A184-00105AEF9F33} WST Teletext Decoder -OUR_GUID_ENTRY(CLSID_WSTDecoder, -0x70bc06e0, 0x5666, 0x11d3, 0xa1, 0x84, 0x0, 0x10, 0x5a, 0xef, 0x9f, 0x33) - -// {301056D0-6DFF-11d2-9EEB-006008039E37} -OUR_GUID_ENTRY(CLSID_MjpegDec, -0x301056d0, 0x6dff, 0x11d2, 0x9e, 0xeb, 0x0, 0x60, 0x8, 0x3, 0x9e, 0x37) - -// {B80AB0A0-7416-11d2-9EEB-006008039E37} -OUR_GUID_ENTRY(CLSID_MJPGEnc, -0xb80ab0a0, 0x7416, 0x11d2, 0x9e, 0xeb, 0x0, 0x60, 0x8, 0x3, 0x9e, 0x37) - - - -// pnp objects and categories -// 62BE5D10-60EB-11d0-BD3B-00A0C911CE86 ICreateDevEnum -OUR_GUID_ENTRY(CLSID_SystemDeviceEnum, -0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86) - -// 4315D437-5B8C-11d0-BD3B-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_CDeviceMoniker, -0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86) - -// 860BB310-5D01-11d0-BD3B-00A0C911CE86 Video capture category -OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory, -0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86) -OUR_GUID_ENTRY(CLSID_CVidCapClassManager, -0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86) - -// 083863F1-70DE-11d0-BD40-00A0C911CE86 Filter category -OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory, -0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86) -OUR_GUID_ENTRY(CLSID_CQzFilterClassManager, -0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86) - -// 33D9A760-90C8-11d0-BD43-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_VideoCompressorCategory, -0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) -OUR_GUID_ENTRY(CLSID_CIcmCoClassManager, -0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// 33D9A761-90C8-11d0-BD43-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_AudioCompressorCategory, -0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) -OUR_GUID_ENTRY(CLSID_CAcmCoClassManager, -0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// 33D9A762-90C8-11d0-BD43-00A0C911CE86 Audio source cateogry -OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory, -0x33d9a762, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) -OUR_GUID_ENTRY(CLSID_CWaveinClassManager, -0x33d9a762, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// E0F158E1-CB04-11d0-BD4E-00A0C911CE86 Audio renderer category -OUR_GUID_ENTRY(CLSID_AudioRendererCategory, -0xe0f158e1, 0xcb04, 0x11d0, 0xbd, 0x4e, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) -OUR_GUID_ENTRY(CLSID_CWaveOutClassManager, -0xe0f158e1, 0xcb04, 0x11d0, 0xbd, 0x4e, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// 4EFE2452-168A-11d1-BC76-00C04FB9453B Midi renderer category -OUR_GUID_ENTRY(CLSID_MidiRendererCategory, -0x4EfE2452, 0x168A, 0x11d1, 0xBC, 0x76, 0x0, 0xc0, 0x4F, 0xB9, 0x45, 0x3B) -OUR_GUID_ENTRY(CLSID_CMidiOutClassManager, -0x4EfE2452, 0x168A, 0x11d1, 0xBC, 0x76, 0x0, 0xc0, 0x4F, 0xB9, 0x45, 0x3B) - -// CC7BFB41-F175-11d1-A392-00E0291F3959 External Renderers Category -OUR_GUID_ENTRY(CLSID_TransmitCategory, -0xcc7bfb41, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59) - -// CC7BFB46-F175-11d1-A392-00E0291F3959 Device Control Filters -OUR_GUID_ENTRY(CLSID_DeviceControlCategory, -0xcc7bfb46, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59) - -// DA4E3DA0-D07D-11d0-BD50-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_ActiveMovieCategories, -0xda4e3da0, 0xd07d, 0x11d0, 0xbd, 0x50, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// 2721AE20-7E70-11D0-A5D6-28DB04C10000 -OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory, -0x2721AE20, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) - -// CDA42200-BD88-11d0-BD4E-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_FilterMapper2, -0xcda42200, 0xbd88, 0x11d0, 0xbd, 0x4e, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - - -// 1e651cc0-b199-11d0-8212-00c04fc32c45 -OUR_GUID_ENTRY(CLSID_MemoryAllocator, -0x1e651cc0, 0xb199, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45) - -// CDBD8D00-C193-11d0-BD4E-00A0C911CE86 -OUR_GUID_ENTRY(CLSID_MediaPropertyBag, -0xcdbd8d00, 0xc193, 0x11d0, 0xbd, 0x4e, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86) - -// FCC152B7-F372-11d0-8E00-00C04FD7C08B -OUR_GUID_ENTRY(CLSID_DvdGraphBuilder, -0xFCC152B7, 0xF372, 0x11d0, 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B) - -// 9B8C4620-2C1A-11d0-8493-00A02438AD48 -OUR_GUID_ENTRY(CLSID_DVDNavigator, -0x9b8c4620, 0x2c1a, 0x11d0, 0x84, 0x93, 0x0, 0xa0, 0x24, 0x38, 0xad, 0x48) - -// f963c5cf-a659-4a93-9638-caf3cd277d13 -OUR_GUID_ENTRY(CLSID_DVDState, -0xf963c5cf, 0xa659, 0x4a93, 0x96, 0x38, 0xca, 0xf3, 0xcd, 0x27, 0x7d, 0x13) - -// CC58E280-8AA1-11d1-B3F1-00AA003761C5 -OUR_GUID_ENTRY(CLSID_SmartTee, -0xcc58e280, 0x8aa1, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5) - -// -- format types --- - -// 0F6417D6-C318-11D0-A43F-00A0C9223196 FORMAT_None -OUR_GUID_ENTRY(FORMAT_None, -0x0F6417D6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96) - -// 05589f80-c356-11ce-bf01-00aa0055595a FORMAT_VideoInfo -OUR_GUID_ENTRY(FORMAT_VideoInfo, -0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// F72A76A0-EB0A-11d0-ACE4-0000C0CC16BA FORMAT_VideoInfo2 -OUR_GUID_ENTRY(FORMAT_VideoInfo2, -0xf72a76A0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// 05589f81-c356-11ce-bf01-00aa0055595a FORMAT_WaveFormatEx -OUR_GUID_ENTRY(FORMAT_WaveFormatEx, -0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 05589f82-c356-11ce-bf01-00aa0055595a FORMAT_MPEGVideo -OUR_GUID_ENTRY(FORMAT_MPEGVideo, -0x05589f82, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 05589f83-c356-11ce-bf01-00aa0055595a FORMAT_MPEGStreams -OUR_GUID_ENTRY(FORMAT_MPEGStreams, -0x05589f83, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 05589f84-c356-11ce-bf01-00aa0055595a FORMAT_DvInfo, DVINFO -OUR_GUID_ENTRY(FORMAT_DvInfo, -0x05589f84, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - - -// -- Video related GUIDs --- - - -// 944d4c00-dd52-11ce-bf0e-00aa0055595a -OUR_GUID_ENTRY(CLSID_DirectDrawProperties, -0x944d4c00, 0xdd52, 0x11ce, 0xbf, 0x0e, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 59ce6880-acf8-11cf-b56e-0080c7c4b68a -OUR_GUID_ENTRY(CLSID_PerformanceProperties, -0x59ce6880, 0xacf8, 0x11cf, 0xb5, 0x6e, 0x00, 0x80, 0xc7, 0xc4, 0xb6, 0x8a) - -// 418afb70-f8b8-11ce-aac6-0020af0b99a3 -OUR_GUID_ENTRY(CLSID_QualityProperties, -0x418afb70, 0xf8b8, 0x11ce, 0xaa, 0xc6, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3) - -// 61ded640-e912-11ce-a099-00aa00479a58 -OUR_GUID_ENTRY(IID_IBaseVideoMixer, -0x61ded640, 0xe912, 0x11ce, 0xa0, 0x99, 0x00, 0xaa, 0x00, 0x47, 0x9a, 0x58) - -// 36d39eb0-dd75-11ce-bf0e-00aa0055595a -OUR_GUID_ENTRY(IID_IDirectDrawVideo, -0x36d39eb0, 0xdd75, 0x11ce, 0xbf, 0x0e, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// bd0ecb0-f8e2-11ce-aac6-0020af0b99a3 -OUR_GUID_ENTRY(IID_IQualProp, -0x1bd0ecb0, 0xf8e2, 0x11ce, 0xaa, 0xc6, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3) - -// {CE292861-FC88-11d0-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(CLSID_VPObject, -0xce292861, 0xfc88, 0x11d0, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {CE292862-FC88-11d0-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IVPObject, -0xce292862, 0xfc88, 0x11d0, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {25DF12C1-3DE0-11d1-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IVPControl, -0x25df12c1, 0x3de0, 0x11d1, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {814B9801-1C88-11d1-BAD9-00609744111A} -OUR_GUID_ENTRY(CLSID_VPVBIObject, -0x814b9801, 0x1c88, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// {814B9802-1C88-11d1-BAD9-00609744111A} -OUR_GUID_ENTRY(IID_IVPVBIObject, -0x814b9802, 0x1c88, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// {BC29A660-30E3-11d0-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IVPConfig, -0xbc29a660, 0x30e3, 0x11d0, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {C76794A1-D6C5-11d0-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IVPNotify, -0xc76794a1, 0xd6c5, 0x11d0, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {EBF47183-8764-11d1-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IVPNotify2, -0xebf47183, 0x8764, 0x11d1, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - - -// {EC529B00-1A1F-11D1-BAD9-00609744111A} -OUR_GUID_ENTRY(IID_IVPVBIConfig, -0xec529b00, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// {EC529B01-1A1F-11D1-BAD9-00609744111A} -OUR_GUID_ENTRY(IID_IVPVBINotify, -0xec529b01, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a) - -// {593CDDE1-0759-11d1-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IMixerPinConfig, -0x593cdde1, 0x759, 0x11d1, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - -// {EBF47182-8764-11d1-9E69-00C04FD7C15B} -OUR_GUID_ENTRY(IID_IMixerPinConfig2, -0xebf47182, 0x8764, 0x11d1, 0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b) - - -// {FA2AA8F4-8B62-11D0-A520-000000000000) -OUR_GUID_ENTRY(IID_IAMMediaContent, -0xFA2AA8F4, 0x8B62, 0x11D0, 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) - - -// This is a bit awkward. The OLE GUIDs are separated out into a different -// file from the main header files. The header files can then be included -// multiple times and are protected with the following statements, -// -// #ifndef __SOMETHING_DEFINED__ -// #define __SOMETHING_DEFINED__ -// all the header contents -// #endif // __SOMETHING_DEFINED__ -// -// When the actual GUIDs are to be defined (using initguid), the GUID header -// file can then be included to really define them just once. Unfortunately, -// DirectDraw has the GUIDs defined in the main header file. So if the base -// classes bring in ddraw.h to get at the DirectDraw structures and so on, -// nobody would then be able to really include ddraw.h to allocate the GUID -// memory structures because of the aforementioned header file protection. -// Therefore, the DirectDraw GUIDs are defined and really allocated here. - -#ifndef __DDRAW_INCLUDED__ -OUR_GUID_ENTRY(CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35) -OUR_GUID_ENTRY(CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56) -OUR_GUID_ENTRY(IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60) -OUR_GUID_ENTRY(IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56) -OUR_GUID_ENTRY(IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60) -OUR_GUID_ENTRY(IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27) -OUR_GUID_ENTRY(IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB) -OUR_GUID_ENTRY(IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B) -OUR_GUID_ENTRY(IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b) -OUR_GUID_ENTRY(IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60) -OUR_GUID_ENTRY(IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60) -OUR_GUID_ENTRY(IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8) -#endif - -#ifndef __DVP_INCLUDED__ -OUR_GUID_ENTRY(IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60) -#endif - -#ifndef __DDKM_INCLUDED__ -OUR_GUID_ENTRY(IID_IDirectDrawKernel, 0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8) -OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel, 0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8) -#endif - -// 0618aa30-6bc4-11cf-bf36-00aa0055595a -OUR_GUID_ENTRY(CLSID_ModexProperties, -0x0618aa30, 0x6bc4, 0x11cf, 0xbf, 0x36, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// dd1d7110-7836-11cf-bf47-00aa0055595a -OUR_GUID_ENTRY(IID_IFullScreenVideo, -0xdd1d7110, 0x7836, 0x11cf, 0xbf, 0x47, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a) - -// 53479470-f1dd-11cf-bc42-00aa00ac74f6 -OUR_GUID_ENTRY(IID_IFullScreenVideoEx, -0x53479470, 0xf1dd, 0x11cf, 0xbc, 0x42, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6) - -// {101193C0-0BFE-11d0-AF91-00AA00B67A42} DV decoder property -OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage, -0x101193c0, 0xbfe, 0x11d0, 0xaf, 0x91, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {4150F050-BB6F-11d0-AFB9-00AA00B67A42} DV encoder property -OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage, -0x4150f050, 0xbb6f, 0x11d0, 0xaf, 0xb9, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - -// {4DB880E0-C10D-11d0-AFB9-00AA00B67A42} DV Muxer property -OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage, -0x4db880e0, 0xc10d, 0x11d0, 0xaf, 0xb9, 0x0, 0xaa, 0x0, 0xb6, 0x7a, 0x42) - - -// -- Direct Sound Audio related GUID --- - -// 546F4260-D53E-11cf-B3F0-00AA003761C5 -OUR_GUID_ENTRY(IID_IAMDirectSound, -0x546f4260, 0xd53e, 0x11cf, 0xb3, 0xf0, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5) - -// -- MPEG audio decoder properties - -// {b45dd570-3c77-11d1-abe1-00a0c905f375} -OUR_GUID_ENTRY(IID_IMpegAudioDecoder, -0xb45dd570, 0x3c77, 0x11d1, 0xab, 0xe1, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75) - -// --- Line21 Decoder interface GUID --- - -// 6E8D4A21-310C-11d0-B79A-00AA003767A7 IID_IAMLine21Decoder -OUR_GUID_ENTRY(IID_IAMLine21Decoder, -0x6e8d4a21, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7) - -// --- WST Decoder interface GUID --- - -// C056DE21-75C2-11d3-A184-00105AEF9F33 IID_IAMWstDecoder -OUR_GUID_ENTRY(IID_IAMWstDecoder, -0xc056de21, 0x75c2, 0x11d3, 0xa1, 0x84, 0x0, 0x10, 0x5a, 0xef, 0x9f, 0x33) - -// --- WST Decoder Property Page --- - -// 04E27F80-91E4-11d3-A184-00105AEF9F33 WST Decoder Property Page -OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage, -0x4e27f80, 0x91e4, 0x11d3, 0xa1, 0x84, 0x0, 0x10, 0x5a, 0xef, 0x9f, 0x33) - - -// -- Analog video related GUIDs --- - - -// -- format types --- -// 0482DDE0-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(FORMAT_AnalogVideo, -0x482dde0, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - - -// -- major type, Analog Video - -// 0482DDE1-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo, -0x482dde1, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - - -// -- Analog Video subtypes, NTSC - -// 0482DDE2-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M, -0x482dde2, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// -- Analog Video subtypes, PAL - -// 0482DDE5-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B, -0x482dde5, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDE6-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D, -0x482dde6, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDE7-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G, -0x482dde7, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDE8-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H, -0x482dde8, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDE9-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I, -0x482dde9, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDEA-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M, -0x482ddea, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDEB-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N, -0x482ddeb, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDEC-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO, -0x482ddec, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// -- Analog Video subtypes, SECAM - -// 0482DDF0-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B, -0x482ddf0, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF1-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D, -0x482ddf1, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF2-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G, -0x482ddf2, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF3-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H, -0x482ddf3, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF4-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K, -0x482ddf4, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF5-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1, -0x482ddf5, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// 0482DDF6-7817-11cf-8A03-00AA006ECB65 -OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L, -0x482ddf6, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - - -// -- External audio related GUIDs --- - -// -- major types, Analog Audio - -// 0482DEE1-7817-11cf-8a03-00aa006ecb65 -OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio, -0x482dee1, 0x7817, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// -// DirectShow's include file based on ksmedia.h from WDM DDK -// -#include "ksuuids.h" - - -// -- Well-known time format GUIDs --- - - -// 00000000-0000-0000-0000-000000000000 -OUR_GUID_ENTRY(TIME_FORMAT_NONE, -0L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - -// 7b785570-8c82-11cf-bc0c-00aa00ac74f6 -OUR_GUID_ENTRY(TIME_FORMAT_FRAME, -0x7b785570, 0x8c82, 0x11cf, 0xbc, 0xc, 0x0, 0xaa, 0x0, 0xac, 0x74, 0xf6) - -// 7b785571-8c82-11cf-bc0c-00aa00ac74f6 -OUR_GUID_ENTRY(TIME_FORMAT_BYTE, -0x7b785571, 0x8c82, 0x11cf, 0xbc, 0xc, 0x0, 0xaa, 0x0, 0xac, 0x74, 0xf6) - -// 7b785572-8c82-11cf-bc0c-00aa00ac74f6 -OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE, -0x7b785572, 0x8c82, 0x11cf, 0xbc, 0xc, 0x0, 0xaa, 0x0, 0xac, 0x74, 0xf6) - -// 7b785573-8c82-11cf-bc0c-00aa00ac74f6 -OUR_GUID_ENTRY(TIME_FORMAT_FIELD, -0x7b785573, 0x8c82, 0x11cf, 0xbc, 0xc, 0x0, 0xaa, 0x0, 0xac, 0x74, 0xf6) - - -// 7b785574-8c82-11cf-bc0c-00aa00ac74f6 -OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME, -0x7b785574, 0x8c82, 0x11cf, 0xbc, 0xc, 0x0, 0xaa, 0x0, 0xac, 0x74, 0xf6) - - -// for IKsPropertySet - -// 9B00F101-1567-11d1-B3F1-00AA003761C5 -OUR_GUID_ENTRY(AMPROPSETID_Pin, -0x9b00f101, 0x1567, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5) - -// fb6c4281-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE, -0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4282-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW, -0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4283-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN, -0xfb6c4283, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4284-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_VBI, -0xfb6c4284, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4285-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT, -0xfb6c4285, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4286-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_NABTS, -0xfb6c4286, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4287-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_EDS, -0xfb6c4287, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4288-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT, -0xfb6c4288, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c4289-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_CC, -0xfb6c4289, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c428a-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_STILL, -0xfb6c428a, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c428b-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE, -0xfb6c428b, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - -// fb6c428c-0353-11d1-905f-0000c0cc16ba -OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI, -0xfb6c428c, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba) - - -// The following special GUIDS are used by ICaptureGraphBuilder::FindInterface - -// {AC798BE0-98E3-11d1-B3F1-00AA003761C5} -OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY, -0xac798be0, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5) - -// {AC798BE1-98E3-11d1-B3F1-00AA003761C5} -OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY, -0xac798be1, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5) - -// ------------------------------------------------------------------------- -// KSProxy GUIDS -// ------------------------------------------------------------------------- - -// {266EEE41-6C63-11cf-8A03-00AA006ECB65} -OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage, -0x266eee41, 0x6c63, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65) - -// {71F96461-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage, -0x71f96461, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {71F96463-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage, -0x71f96463, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {71F96464-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage, -0x71f96464, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {71F96465-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage, -0x71f96465, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {71F96466-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage, -0x71f96466, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {71F96467-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage, -0x71f96467, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56) - -// {37E92A92-D9AA-11d2-BF84-8EF2B1555AED} Audio Renderer Advanced Property Page -OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties, -0x37e92a92, 0xd9aa, 0x11d2, 0xbf, 0x84, 0x8e, 0xf2, 0xb1, 0x55, 0x5a, 0xed) - - -// ------------------------------------------------------------------------- -// VMR GUIDS -// ------------------------------------------------------------------------- - -// {B87BEB7B-8D29-423f-AE4D-6582C10175AC} -OUR_GUID_ENTRY(CLSID_VideoMixingRenderer, -0xB87BEB7B, 0x8D29, 0x423f, 0xAE, 0x4D, 0x65, 0x82, 0xC1, 0x01, 0x75, 0xAC) - -// {6BC1CFFA-8FC1-4261-AC22-CFB4CC38DB50} -OUR_GUID_ENTRY(CLSID_VideoRendererDefault, -0x6BC1CFFA, 0x8FC1, 0x4261, 0xAC, 0x22, 0xCF, 0xB4, 0xCC, 0x38, 0xDB, 0x50) - -// {99d54f63-1a69-41ae-aa4d-c976eb3f0713} -OUR_GUID_ENTRY(CLSID_AllocPresenter, -0x99d54f63, 0x1a69, 0x41ae, 0xaa, 0x4d, 0xc9, 0x76, 0xeb, 0x3f, 0x07, 0x13) - -// {4444ac9e-242e-471b-a3c7-45dcd46352bc} -OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode, -0x4444ac9e, 0x242e, 0x471b, 0xa3, 0xc7, 0x45, 0xdc, 0xd4, 0x63, 0x52, 0xbc) - -// {6f26a6cd-967b-47fd-874a-7aed2c9d25a2} -OUR_GUID_ENTRY(CLSID_VideoPortManager, -0x6f26a6cd, 0x967b, 0x47fd, 0x87, 0x4a, 0x7a, 0xed, 0x2c, 0x9d, 0x25, 0xa2) - -// ------------------------------------------------------------------------- -// BDA Network Provider GUIDS -// ------------------------------------------------------------------------- - -// {0DAD2FDD-5FD7-11D3-8F50-00C04F7971E2} -OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider, -0x0dad2fdd, 0x5fd7, 0x11d3, 0x8f, 0x50, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe2) - -// {E3444D16-5AC4-4386-88DF-13FD230E1DDA} -OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage, -0xe3444d16, 0x5ac4, 0x4386, 0x88, 0xdf, 0x13, 0xfd, 0x23, 0x0e, 0x1d, 0xda) - -// {FA4B375A-45B4-4d45-8440-263957B11623} -OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider, -0xfa4b375a, 0x45b4, 0x4d45, 0x84, 0x40, 0x26, 0x39, 0x57, 0xb1, 0x16, 0x23) - - -// ------------------------------------------------------------------------- -// TVE Receiver filter guids -// ------------------------------------------------------------------------- - -// The CLSID used by the TVE Receiver filter -// {05500280-FAA5-4DF9-8246-BFC23AC5CEA8} -OUR_GUID_ENTRY(CLSID_DShowTVEFilter, -0x05500280, 0xFAA5, 0x4DF9, 0x82, 0x46, 0xBF, 0xC2, 0x3A, 0xC5, 0xCE, 0xA8) - -// {05500281-FAA5-4DF9-8246-BFC23AC5CEA8} -OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties, -0x05500281, 0xFAA5, 0x4DF9, 0x82, 0x46, 0xBF, 0xC2, 0x3A, 0xC5, 0xCE, 0xA8) - - -// {05500282-FAA5-4DF9-8246-BFC23AC5CEA8} -OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties, -0x05500282, 0xFAA5, 0x4DF9, 0x82, 0x46, 0xBF, 0xC2, 0x3A, 0xC5, 0xCE, 0xA8) - -// {05500283-FAA5-4DF9-8246-BFC23AC5CEA8} -OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties, -0x05500283, 0xFAA5, 0x4DF9, 0x82, 0x46, 0xBF, 0xC2, 0x3A, 0xC5, 0xCE, 0xA8) - -#undef OUR_GUID_ENTRY diff --git a/import/DirectX8/include/vfwmsgs.h b/import/DirectX8/include/vfwmsgs.h deleted file mode 100644 index ea66d121c..000000000 --- a/import/DirectX8/include/vfwmsgs.h +++ /dev/null @@ -1,1325 +0,0 @@ - // no longer used - but might get - // our own facility in the future? - // FacilityNames=(FACILITY_VFW=0x4) - // To add a message: - // - // The MessageId is the number of the message. - // Accepted severities are 'Success' and 'Warning'. - // - // Facility should be FACILITY_ITF (was FACILITY_VFW). - // - // The SymbolicName is the name used in the code to identify the message. - // The text of a message starts the line after 'Language=' and - // ends before a line with only a '.' in column one. -// -// Values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// - - -// -// Define the severity codes -// - - -// -// MessageId: VFW_E_INVALIDMEDIATYPE -// -// MessageText: -// -// An invalid media type was specified.%0 -// -#define VFW_E_INVALIDMEDIATYPE ((HRESULT)0x80040200L) - -// -// MessageId: VFW_E_INVALIDSUBTYPE -// -// MessageText: -// -// An invalid media subtype was specified.%0 -// -#define VFW_E_INVALIDSUBTYPE ((HRESULT)0x80040201L) - -// -// MessageId: VFW_E_NEED_OWNER -// -// MessageText: -// -// This object can only be created as an aggregated object.%0 -// -#define VFW_E_NEED_OWNER ((HRESULT)0x80040202L) - -// -// MessageId: VFW_E_ENUM_OUT_OF_SYNC -// -// MessageText: -// -// The enumerator has become invalid.%0 -// -#define VFW_E_ENUM_OUT_OF_SYNC ((HRESULT)0x80040203L) - -// -// MessageId: VFW_E_ALREADY_CONNECTED -// -// MessageText: -// -// At least one of the pins involved in the operation is already connected.%0 -// -#define VFW_E_ALREADY_CONNECTED ((HRESULT)0x80040204L) - -// -// MessageId: VFW_E_FILTER_ACTIVE -// -// MessageText: -// -// This operation cannot be performed because the filter is active.%0 -// -#define VFW_E_FILTER_ACTIVE ((HRESULT)0x80040205L) - -// -// MessageId: VFW_E_NO_TYPES -// -// MessageText: -// -// One of the specified pins supports no media types.%0 -// -#define VFW_E_NO_TYPES ((HRESULT)0x80040206L) - -// -// MessageId: VFW_E_NO_ACCEPTABLE_TYPES -// -// MessageText: -// -// There is no common media type between these pins.%0 -// -#define VFW_E_NO_ACCEPTABLE_TYPES ((HRESULT)0x80040207L) - -// -// MessageId: VFW_E_INVALID_DIRECTION -// -// MessageText: -// -// Two pins of the same direction cannot be connected together.%0 -// -#define VFW_E_INVALID_DIRECTION ((HRESULT)0x80040208L) - -// -// MessageId: VFW_E_NOT_CONNECTED -// -// MessageText: -// -// The operation cannot be performed because the pins are not connected.%0 -// -#define VFW_E_NOT_CONNECTED ((HRESULT)0x80040209L) - -// -// MessageId: VFW_E_NO_ALLOCATOR -// -// MessageText: -// -// No sample buffer allocator is available.%0 -// -#define VFW_E_NO_ALLOCATOR ((HRESULT)0x8004020AL) - -// -// MessageId: VFW_E_RUNTIME_ERROR -// -// MessageText: -// -// A run-time error occurred.%0 -// -#define VFW_E_RUNTIME_ERROR ((HRESULT)0x8004020BL) - -// -// MessageId: VFW_E_BUFFER_NOTSET -// -// MessageText: -// -// No buffer space has been set.%0 -// -#define VFW_E_BUFFER_NOTSET ((HRESULT)0x8004020CL) - -// -// MessageId: VFW_E_BUFFER_OVERFLOW -// -// MessageText: -// -// The buffer is not big enough.%0 -// -#define VFW_E_BUFFER_OVERFLOW ((HRESULT)0x8004020DL) - -// -// MessageId: VFW_E_BADALIGN -// -// MessageText: -// -// An invalid alignment was specified.%0 -// -#define VFW_E_BADALIGN ((HRESULT)0x8004020EL) - -// -// MessageId: VFW_E_ALREADY_COMMITTED -// -// MessageText: -// -// Cannot change allocated memory while the filter is active.%0 -// -#define VFW_E_ALREADY_COMMITTED ((HRESULT)0x8004020FL) - -// -// MessageId: VFW_E_BUFFERS_OUTSTANDING -// -// MessageText: -// -// One or more buffers are still active.%0 -// -#define VFW_E_BUFFERS_OUTSTANDING ((HRESULT)0x80040210L) - -// -// MessageId: VFW_E_NOT_COMMITTED -// -// MessageText: -// -// Cannot allocate a sample when the allocator is not active.%0 -// -#define VFW_E_NOT_COMMITTED ((HRESULT)0x80040211L) - -// -// MessageId: VFW_E_SIZENOTSET -// -// MessageText: -// -// Cannot allocate memory because no size has been set.%0 -// -#define VFW_E_SIZENOTSET ((HRESULT)0x80040212L) - -// -// MessageId: VFW_E_NO_CLOCK -// -// MessageText: -// -// Cannot lock for synchronization because no clock has been defined.%0 -// -#define VFW_E_NO_CLOCK ((HRESULT)0x80040213L) - -// -// MessageId: VFW_E_NO_SINK -// -// MessageText: -// -// Quality messages could not be sent because no quality sink has been defined.%0 -// -#define VFW_E_NO_SINK ((HRESULT)0x80040214L) - -// -// MessageId: VFW_E_NO_INTERFACE -// -// MessageText: -// -// A required interface has not been implemented.%0 -// -#define VFW_E_NO_INTERFACE ((HRESULT)0x80040215L) - -// -// MessageId: VFW_E_NOT_FOUND -// -// MessageText: -// -// An object or name was not found.%0 -// -#define VFW_E_NOT_FOUND ((HRESULT)0x80040216L) - -// -// MessageId: VFW_E_CANNOT_CONNECT -// -// MessageText: -// -// No combination of intermediate filters could be found to make the connection.%0 -// -#define VFW_E_CANNOT_CONNECT ((HRESULT)0x80040217L) - -// -// MessageId: VFW_E_CANNOT_RENDER -// -// MessageText: -// -// No combination of filters could be found to render the stream.%0 -// -#define VFW_E_CANNOT_RENDER ((HRESULT)0x80040218L) - -// -// MessageId: VFW_E_CHANGING_FORMAT -// -// MessageText: -// -// Could not change formats dynamically.%0 -// -#define VFW_E_CHANGING_FORMAT ((HRESULT)0x80040219L) - -// -// MessageId: VFW_E_NO_COLOR_KEY_SET -// -// MessageText: -// -// No color key has been set.%0 -// -#define VFW_E_NO_COLOR_KEY_SET ((HRESULT)0x8004021AL) - -// -// MessageId: VFW_E_NOT_OVERLAY_CONNECTION -// -// MessageText: -// -// Current pin connection is not using the IOverlay transport.%0 -// -#define VFW_E_NOT_OVERLAY_CONNECTION ((HRESULT)0x8004021BL) - -// -// MessageId: VFW_E_NOT_SAMPLE_CONNECTION -// -// MessageText: -// -// Current pin connection is not using the IMemInputPin transport.%0 -// -#define VFW_E_NOT_SAMPLE_CONNECTION ((HRESULT)0x8004021CL) - -// -// MessageId: VFW_E_PALETTE_SET -// -// MessageText: -// -// Setting a color key would conflict with the palette already set.%0 -// -#define VFW_E_PALETTE_SET ((HRESULT)0x8004021DL) - -// -// MessageId: VFW_E_COLOR_KEY_SET -// -// MessageText: -// -// Setting a palette would conflict with the color key already set.%0 -// -#define VFW_E_COLOR_KEY_SET ((HRESULT)0x8004021EL) - -// -// MessageId: VFW_E_NO_COLOR_KEY_FOUND -// -// MessageText: -// -// No matching color key is available.%0 -// -#define VFW_E_NO_COLOR_KEY_FOUND ((HRESULT)0x8004021FL) - -// -// MessageId: VFW_E_NO_PALETTE_AVAILABLE -// -// MessageText: -// -// No palette is available.%0 -// -#define VFW_E_NO_PALETTE_AVAILABLE ((HRESULT)0x80040220L) - -// -// MessageId: VFW_E_NO_DISPLAY_PALETTE -// -// MessageText: -// -// Display does not use a palette.%0 -// -#define VFW_E_NO_DISPLAY_PALETTE ((HRESULT)0x80040221L) - -// -// MessageId: VFW_E_TOO_MANY_COLORS -// -// MessageText: -// -// Too many colors for the current display settings.%0 -// -#define VFW_E_TOO_MANY_COLORS ((HRESULT)0x80040222L) - -// -// MessageId: VFW_E_STATE_CHANGED -// -// MessageText: -// -// The state changed while waiting to process the sample.%0 -// -#define VFW_E_STATE_CHANGED ((HRESULT)0x80040223L) - -// -// MessageId: VFW_E_NOT_STOPPED -// -// MessageText: -// -// The operation could not be performed because the filter is not stopped.%0 -// -#define VFW_E_NOT_STOPPED ((HRESULT)0x80040224L) - -// -// MessageId: VFW_E_NOT_PAUSED -// -// MessageText: -// -// The operation could not be performed because the filter is not paused.%0 -// -#define VFW_E_NOT_PAUSED ((HRESULT)0x80040225L) - -// -// MessageId: VFW_E_NOT_RUNNING -// -// MessageText: -// -// The operation could not be performed because the filter is not running.%0 -// -#define VFW_E_NOT_RUNNING ((HRESULT)0x80040226L) - -// -// MessageId: VFW_E_WRONG_STATE -// -// MessageText: -// -// The operation could not be performed because the filter is in the wrong state.%0 -// -#define VFW_E_WRONG_STATE ((HRESULT)0x80040227L) - -// -// MessageId: VFW_E_START_TIME_AFTER_END -// -// MessageText: -// -// The sample start time is after the sample end time.%0 -// -#define VFW_E_START_TIME_AFTER_END ((HRESULT)0x80040228L) - -// -// MessageId: VFW_E_INVALID_RECT -// -// MessageText: -// -// The supplied rectangle is invalid.%0 -// -#define VFW_E_INVALID_RECT ((HRESULT)0x80040229L) - -// -// MessageId: VFW_E_TYPE_NOT_ACCEPTED -// -// MessageText: -// -// This pin cannot use the supplied media type.%0 -// -#define VFW_E_TYPE_NOT_ACCEPTED ((HRESULT)0x8004022AL) - -// -// MessageId: VFW_E_SAMPLE_REJECTED -// -// MessageText: -// -// This sample cannot be rendered.%0 -// -#define VFW_E_SAMPLE_REJECTED ((HRESULT)0x8004022BL) - -// -// MessageId: VFW_E_SAMPLE_REJECTED_EOS -// -// MessageText: -// -// This sample cannot be rendered because the end of the stream has been reached.%0 -// -#define VFW_E_SAMPLE_REJECTED_EOS ((HRESULT)0x8004022CL) - -// -// MessageId: VFW_E_DUPLICATE_NAME -// -// MessageText: -// -// An attempt to add a filter with a duplicate name failed.%0 -// -#define VFW_E_DUPLICATE_NAME ((HRESULT)0x8004022DL) - -// -// MessageId: VFW_S_DUPLICATE_NAME -// -// MessageText: -// -// An attempt to add a filter with a duplicate name succeeded with a modified name.%0 -// -#define VFW_S_DUPLICATE_NAME ((HRESULT)0x0004022DL) - -// -// MessageId: VFW_E_TIMEOUT -// -// MessageText: -// -// A time-out has expired.%0 -// -#define VFW_E_TIMEOUT ((HRESULT)0x8004022EL) - -// -// MessageId: VFW_E_INVALID_FILE_FORMAT -// -// MessageText: -// -// The file format is invalid.%0 -// -#define VFW_E_INVALID_FILE_FORMAT ((HRESULT)0x8004022FL) - -// -// MessageId: VFW_E_ENUM_OUT_OF_RANGE -// -// MessageText: -// -// The list has already been exhausted.%0 -// -#define VFW_E_ENUM_OUT_OF_RANGE ((HRESULT)0x80040230L) - -// -// MessageId: VFW_E_CIRCULAR_GRAPH -// -// MessageText: -// -// The filter graph is circular.%0 -// -#define VFW_E_CIRCULAR_GRAPH ((HRESULT)0x80040231L) - -// -// MessageId: VFW_E_NOT_ALLOWED_TO_SAVE -// -// MessageText: -// -// Updates are not allowed in this state.%0 -// -#define VFW_E_NOT_ALLOWED_TO_SAVE ((HRESULT)0x80040232L) - -// -// MessageId: VFW_E_TIME_ALREADY_PASSED -// -// MessageText: -// -// An attempt was made to queue a command for a time in the past.%0 -// -#define VFW_E_TIME_ALREADY_PASSED ((HRESULT)0x80040233L) - -// -// MessageId: VFW_E_ALREADY_CANCELLED -// -// MessageText: -// -// The queued command has already been canceled.%0 -// -#define VFW_E_ALREADY_CANCELLED ((HRESULT)0x80040234L) - -// -// MessageId: VFW_E_CORRUPT_GRAPH_FILE -// -// MessageText: -// -// Cannot render the file because it is corrupt.%0 -// -#define VFW_E_CORRUPT_GRAPH_FILE ((HRESULT)0x80040235L) - -// -// MessageId: VFW_E_ADVISE_ALREADY_SET -// -// MessageText: -// -// An overlay advise link already exists.%0 -// -#define VFW_E_ADVISE_ALREADY_SET ((HRESULT)0x80040236L) - -// -// MessageId: VFW_S_STATE_INTERMEDIATE -// -// MessageText: -// -// The state transition has not completed.%0 -// -#define VFW_S_STATE_INTERMEDIATE ((HRESULT)0x00040237L) - -// -// MessageId: VFW_E_NO_MODEX_AVAILABLE -// -// MessageText: -// -// No full-screen modes are available.%0 -// -#define VFW_E_NO_MODEX_AVAILABLE ((HRESULT)0x80040238L) - -// -// MessageId: VFW_E_NO_ADVISE_SET -// -// MessageText: -// -// This Advise cannot be canceled because it was not successfully set.%0 -// -#define VFW_E_NO_ADVISE_SET ((HRESULT)0x80040239L) - -// -// MessageId: VFW_E_NO_FULLSCREEN -// -// MessageText: -// -// A full-screen mode is not available.%0 -// -#define VFW_E_NO_FULLSCREEN ((HRESULT)0x8004023AL) - -// -// MessageId: VFW_E_IN_FULLSCREEN_MODE -// -// MessageText: -// -// Cannot call IVideoWindow methods while in full-screen mode.%0 -// -#define VFW_E_IN_FULLSCREEN_MODE ((HRESULT)0x8004023BL) - -// -// MessageId: VFW_E_UNKNOWN_FILE_TYPE -// -// MessageText: -// -// The media type of this file is not recognized.%0 -// -#define VFW_E_UNKNOWN_FILE_TYPE ((HRESULT)0x80040240L) - -// -// MessageId: VFW_E_CANNOT_LOAD_SOURCE_FILTER -// -// MessageText: -// -// The source filter for this file could not be loaded.%0 -// -#define VFW_E_CANNOT_LOAD_SOURCE_FILTER ((HRESULT)0x80040241L) - -// -// MessageId: VFW_S_PARTIAL_RENDER -// -// MessageText: -// -// Some of the streams in this movie are in an unsupported format.%0 -// -#define VFW_S_PARTIAL_RENDER ((HRESULT)0x00040242L) - -// -// MessageId: VFW_E_FILE_TOO_SHORT -// -// MessageText: -// -// A file appeared to be incomplete.%0 -// -#define VFW_E_FILE_TOO_SHORT ((HRESULT)0x80040243L) - -// -// MessageId: VFW_E_INVALID_FILE_VERSION -// -// MessageText: -// -// The version number of the file is invalid.%0 -// -#define VFW_E_INVALID_FILE_VERSION ((HRESULT)0x80040244L) - -// -// MessageId: VFW_S_SOME_DATA_IGNORED -// -// MessageText: -// -// The file contained some property settings that were not used.%0 -// -#define VFW_S_SOME_DATA_IGNORED ((HRESULT)0x00040245L) - -// -// MessageId: VFW_S_CONNECTIONS_DEFERRED -// -// MessageText: -// -// Some connections have failed and have been deferred.%0 -// -#define VFW_S_CONNECTIONS_DEFERRED ((HRESULT)0x00040246L) - -// -// MessageId: VFW_E_INVALID_CLSID -// -// MessageText: -// -// This file is corrupt: it contains an invalid class identifier.%0 -// -#define VFW_E_INVALID_CLSID ((HRESULT)0x80040247L) - -// -// MessageId: VFW_E_INVALID_MEDIA_TYPE -// -// MessageText: -// -// This file is corrupt: it contains an invalid media type.%0 -// -#define VFW_E_INVALID_MEDIA_TYPE ((HRESULT)0x80040248L) - - // Message id from WINWarning.H -// -// MessageId: VFW_E_BAD_KEY -// -// MessageText: -// -// A registry entry is corrupt.%0 -// -#define VFW_E_BAD_KEY ((HRESULT)0x800403F2L) - - // Message id from WINWarning.H -// -// MessageId: VFW_S_NO_MORE_ITEMS -// -// MessageText: -// -// The end of the list has been reached.%0 -// -#define VFW_S_NO_MORE_ITEMS ((HRESULT)0x00040103L) - -// -// MessageId: VFW_E_SAMPLE_TIME_NOT_SET -// -// MessageText: -// -// No time stamp has been set for this sample.%0 -// -#define VFW_E_SAMPLE_TIME_NOT_SET ((HRESULT)0x80040249L) - -// -// MessageId: VFW_S_RESOURCE_NOT_NEEDED -// -// MessageText: -// -// The resource specified is no longer needed.%0 -// -#define VFW_S_RESOURCE_NOT_NEEDED ((HRESULT)0x00040250L) - -// -// MessageId: VFW_E_MEDIA_TIME_NOT_SET -// -// MessageText: -// -// No media time stamp has been set for this sample.%0 -// -#define VFW_E_MEDIA_TIME_NOT_SET ((HRESULT)0x80040251L) - -// -// MessageId: VFW_E_NO_TIME_FORMAT_SET -// -// MessageText: -// -// No media time format has been selected.%0 -// -#define VFW_E_NO_TIME_FORMAT_SET ((HRESULT)0x80040252L) - -// -// MessageId: VFW_E_MONO_AUDIO_HW -// -// MessageText: -// -// Cannot change balance because audio device is mono only.%0 -// -#define VFW_E_MONO_AUDIO_HW ((HRESULT)0x80040253L) - -// -// MessageId: VFW_S_MEDIA_TYPE_IGNORED -// -// MessageText: -// -// A connection could not be made with the media type in the persistent graph,%0 -// but has been made with a negotiated media type.%0 -// -#define VFW_S_MEDIA_TYPE_IGNORED ((HRESULT)0x00040254L) - -// -// MessageId: VFW_E_NO_DECOMPRESSOR -// -// MessageText: -// -// Cannot play back the video stream: no suitable decompressor could be found.%0 -// -#define VFW_E_NO_DECOMPRESSOR ((HRESULT)0x80040255L) - -// -// MessageId: VFW_E_NO_AUDIO_HARDWARE -// -// MessageText: -// -// Cannot play back the audio stream: no audio hardware is available, or the hardware is not responding.%0 -// -#define VFW_E_NO_AUDIO_HARDWARE ((HRESULT)0x80040256L) - -// -// MessageId: VFW_S_VIDEO_NOT_RENDERED -// -// MessageText: -// -// Cannot play back the video stream: no suitable decompressor could be found.%0 -// -#define VFW_S_VIDEO_NOT_RENDERED ((HRESULT)0x00040257L) - -// -// MessageId: VFW_S_AUDIO_NOT_RENDERED -// -// MessageText: -// -// Cannot play back the audio stream: no audio hardware is available.%0 -// -#define VFW_S_AUDIO_NOT_RENDERED ((HRESULT)0x00040258L) - -// -// MessageId: VFW_E_RPZA -// -// MessageText: -// -// Cannot play back the video stream: format 'RPZA' is not supported.%0 -// -#define VFW_E_RPZA ((HRESULT)0x80040259L) - -// -// MessageId: VFW_S_RPZA -// -// MessageText: -// -// Cannot play back the video stream: format 'RPZA' is not supported.%0 -// -#define VFW_S_RPZA ((HRESULT)0x0004025AL) - -// -// MessageId: VFW_E_PROCESSOR_NOT_SUITABLE -// -// MessageText: -// -// ActiveMovie cannot play MPEG movies on this processor.%0 -// -#define VFW_E_PROCESSOR_NOT_SUITABLE ((HRESULT)0x8004025BL) - -// -// MessageId: VFW_E_UNSUPPORTED_AUDIO -// -// MessageText: -// -// Cannot play back the audio stream: the audio format is not supported.%0 -// -#define VFW_E_UNSUPPORTED_AUDIO ((HRESULT)0x8004025CL) - -// -// MessageId: VFW_E_UNSUPPORTED_VIDEO -// -// MessageText: -// -// Cannot play back the video stream: the video format is not supported.%0 -// -#define VFW_E_UNSUPPORTED_VIDEO ((HRESULT)0x8004025DL) - -// -// MessageId: VFW_E_MPEG_NOT_CONSTRAINED -// -// MessageText: -// -// ActiveMovie cannot play this video stream because it falls outside the constrained standard.%0 -// -#define VFW_E_MPEG_NOT_CONSTRAINED ((HRESULT)0x8004025EL) - -// -// MessageId: VFW_E_NOT_IN_GRAPH -// -// MessageText: -// -// Cannot perform the requested function on an object that is not in the filter graph.%0 -// -#define VFW_E_NOT_IN_GRAPH ((HRESULT)0x8004025FL) - -// -// MessageId: VFW_S_ESTIMATED -// -// MessageText: -// -// The value returned had to be estimated. It's accuracy can not be guaranteed.%0 -// -#define VFW_S_ESTIMATED ((HRESULT)0x00040260L) - -// -// MessageId: VFW_E_NO_TIME_FORMAT -// -// MessageText: -// -// Cannot get or set time related information on an object that is using a time format of TIME_FORMAT_NONE.%0 -// -#define VFW_E_NO_TIME_FORMAT ((HRESULT)0x80040261L) - -// -// MessageId: VFW_E_READ_ONLY -// -// MessageText: -// -// The connection cannot be made because the stream is read only and the filter alters the data.%0 -// -#define VFW_E_READ_ONLY ((HRESULT)0x80040262L) - -// -// MessageId: VFW_S_RESERVED -// -// MessageText: -// -// This success code is reserved for internal purposes within ActiveMovie.%0 -// -#define VFW_S_RESERVED ((HRESULT)0x00040263L) - -// -// MessageId: VFW_E_BUFFER_UNDERFLOW -// -// MessageText: -// -// The buffer is not full enough.%0 -// -#define VFW_E_BUFFER_UNDERFLOW ((HRESULT)0x80040264L) - -// -// MessageId: VFW_E_UNSUPPORTED_STREAM -// -// MessageText: -// -// Cannot play back the file. The format is not supported.%0 -// -#define VFW_E_UNSUPPORTED_STREAM ((HRESULT)0x80040265L) - -// -// MessageId: VFW_E_NO_TRANSPORT -// -// MessageText: -// -// Pins cannot connect due to not supporting the same transport.%0 -// -#define VFW_E_NO_TRANSPORT ((HRESULT)0x80040266L) - -// -// MessageId: VFW_S_STREAM_OFF -// -// MessageText: -// -// The stream has been turned off.%0 -// -#define VFW_S_STREAM_OFF ((HRESULT)0x00040267L) - -// -// MessageId: VFW_S_CANT_CUE -// -// MessageText: -// -// The graph can't be cued because of lack of or corrupt data.%0 -// -#define VFW_S_CANT_CUE ((HRESULT)0x00040268L) - -// -// MessageId: VFW_E_BAD_VIDEOCD -// -// MessageText: -// -// The Video CD can't be read correctly by the device or is the data is corrupt.%0 -// -#define VFW_E_BAD_VIDEOCD ((HRESULT)0x80040269L) - -// -// MessageId: VFW_S_NO_STOP_TIME -// -// MessageText: -// -// The stop time for the sample was not set.%0 -// -#define VFW_S_NO_STOP_TIME ((HRESULT)0x00040270L) - -// -// MessageId: VFW_E_OUT_OF_VIDEO_MEMORY -// -// MessageText: -// -// There is not enough Video Memory at this display resolution and number of colors. Reducing resolution might help.%0 -// -#define VFW_E_OUT_OF_VIDEO_MEMORY ((HRESULT)0x80040271L) - -// -// MessageId: VFW_E_VP_NEGOTIATION_FAILED -// -// MessageText: -// -// The VideoPort connection negotiation process has failed.%0 -// -#define VFW_E_VP_NEGOTIATION_FAILED ((HRESULT)0x80040272L) - -// -// MessageId: VFW_E_DDRAW_CAPS_NOT_SUITABLE -// -// MessageText: -// -// Either DirectDraw has not been installed or the Video Card capabilities are not suitable. Make sure the display is not in 16 color mode.%0 -// -#define VFW_E_DDRAW_CAPS_NOT_SUITABLE ((HRESULT)0x80040273L) - -// -// MessageId: VFW_E_NO_VP_HARDWARE -// -// MessageText: -// -// No VideoPort hardware is available, or the hardware is not responding.%0 -// -#define VFW_E_NO_VP_HARDWARE ((HRESULT)0x80040274L) - -// -// MessageId: VFW_E_NO_CAPTURE_HARDWARE -// -// MessageText: -// -// No Capture hardware is available, or the hardware is not responding.%0 -// -#define VFW_E_NO_CAPTURE_HARDWARE ((HRESULT)0x80040275L) - -// -// MessageId: VFW_E_DVD_OPERATION_INHIBITED -// -// MessageText: -// -// This User Operation is inhibited by DVD Content at this time.%0 -// -#define VFW_E_DVD_OPERATION_INHIBITED ((HRESULT)0x80040276L) - -// -// MessageId: VFW_E_DVD_INVALIDDOMAIN -// -// MessageText: -// -// This Operation is not permitted in the current domain.%0 -// -#define VFW_E_DVD_INVALIDDOMAIN ((HRESULT)0x80040277L) - -// -// MessageId: VFW_E_DVD_NO_BUTTON -// -// MessageText: -// -// The specified button is invalid or is not present at the current time, or there is no button present at the specified location.%0 -// -#define VFW_E_DVD_NO_BUTTON ((HRESULT)0x80040278L) - -// -// MessageId: VFW_E_DVD_GRAPHNOTREADY -// -// MessageText: -// -// DVD-Video playback graph has not been built yet.%0 -// -#define VFW_E_DVD_GRAPHNOTREADY ((HRESULT)0x80040279L) - -// -// MessageId: VFW_E_DVD_RENDERFAIL -// -// MessageText: -// -// DVD-Video playback graph building failed.%0 -// -#define VFW_E_DVD_RENDERFAIL ((HRESULT)0x8004027AL) - -// -// MessageId: VFW_E_DVD_DECNOTENOUGH -// -// MessageText: -// -// DVD-Video playback graph could not be built due to insufficient decoders.%0 -// -#define VFW_E_DVD_DECNOTENOUGH ((HRESULT)0x8004027BL) - -// -// MessageId: VFW_E_DDRAW_VERSION_NOT_SUITABLE -// -// MessageText: -// -// Version number of DirectDraw not suitable. Make sure to install dx5 or higher version.%0 -// -#define VFW_E_DDRAW_VERSION_NOT_SUITABLE ((HRESULT)0x8004027CL) - -// -// MessageId: VFW_E_COPYPROT_FAILED -// -// MessageText: -// -// Copy protection cannot be enabled. Please make sure any other copy protected content is not being shown now.%0 -// -#define VFW_E_COPYPROT_FAILED ((HRESULT)0x8004027DL) - -// -// MessageId: VFW_S_NOPREVIEWPIN -// -// MessageText: -// -// There was no preview pin available, so the capture pin output is being split to provide both capture and preview.%0 -// -#define VFW_S_NOPREVIEWPIN ((HRESULT)0x0004027EL) - -// -// MessageId: VFW_E_TIME_EXPIRED -// -// MessageText: -// -// This object cannot be used anymore as its time has expired.%0 -// -#define VFW_E_TIME_EXPIRED ((HRESULT)0x8004027FL) - -// -// MessageId: VFW_S_DVD_NON_ONE_SEQUENTIAL -// -// MessageText: -// -// The current title was not a sequential set of chapters (PGC), and the returned timing information might not be continuous.%0 -// -#define VFW_S_DVD_NON_ONE_SEQUENTIAL ((HRESULT)0x00040280L) - -// -// MessageId: VFW_E_DVD_WRONG_SPEED -// -// MessageText: -// -// The operation cannot be performed at the current playback speed.%0 -// -#define VFW_E_DVD_WRONG_SPEED ((HRESULT)0x80040281L) - -// -// MessageId: VFW_E_DVD_MENU_DOES_NOT_EXIST -// -// MessageText: -// -// The specified menu doesn't exist.%0 -// -#define VFW_E_DVD_MENU_DOES_NOT_EXIST ((HRESULT)0x80040282L) - -// -// MessageId: VFW_E_DVD_CMD_CANCELLED -// -// MessageText: -// -// The specified command was either cancelled or no longer exists.%0 -// -#define VFW_E_DVD_CMD_CANCELLED ((HRESULT)0x80040283L) - -// -// MessageId: VFW_E_DVD_STATE_WRONG_VERSION -// -// MessageText: -// -// The data did not contain a recognized version.%0 -// -#define VFW_E_DVD_STATE_WRONG_VERSION ((HRESULT)0x80040284L) - -// -// MessageId: VFW_E_DVD_STATE_CORRUPT -// -// MessageText: -// -// The state data was corrupt.%0 -// -#define VFW_E_DVD_STATE_CORRUPT ((HRESULT)0x80040285L) - -// -// MessageId: VFW_E_DVD_STATE_WRONG_DISC -// -// MessageText: -// -// The state data is from a different disc.%0 -// -#define VFW_E_DVD_STATE_WRONG_DISC ((HRESULT)0x80040286L) - -// -// MessageId: VFW_E_DVD_INCOMPATIBLE_REGION -// -// MessageText: -// -// The region was not compatible with the current drive.%0 -// -#define VFW_E_DVD_INCOMPATIBLE_REGION ((HRESULT)0x80040287L) - -// -// MessageId: VFW_E_DVD_NO_ATTRIBUTES -// -// MessageText: -// -// The requested DVD stream attribute does not exist.%0 -// -#define VFW_E_DVD_NO_ATTRIBUTES ((HRESULT)0x80040288L) - -// -// MessageId: VFW_E_DVD_NO_GOUP_PGC -// -// MessageText: -// -// Currently there is no GoUp (Annex J user function) program chain (PGC).%0 -// -#define VFW_E_DVD_NO_GOUP_PGC ((HRESULT)0x80040289L) - -// -// MessageId: VFW_E_DVD_LOW_PARENTAL_LEVEL -// -// MessageText: -// -// The current parental level was too low.%0 -// -#define VFW_E_DVD_LOW_PARENTAL_LEVEL ((HRESULT)0x8004028AL) - -// -// MessageId: VFW_E_DVD_NOT_IN_KARAOKE_MODE -// -// MessageText: -// -// The current audio is not karaoke content.%0 -// -#define VFW_E_DVD_NOT_IN_KARAOKE_MODE ((HRESULT)0x8004028BL) - -// -// MessageId: VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE -// -// MessageText: -// -// The audio stream did not contain sufficient information to determine the contents of each channel.%0 -// -#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE ((HRESULT)0x0004028CL) - -// -// MessageId: VFW_S_DVD_NOT_ACCURATE -// -// MessageText: -// -// The seek into the movie was not frame accurate.%0 -// -#define VFW_S_DVD_NOT_ACCURATE ((HRESULT)0x0004028DL) - -// -// MessageId: VFW_E_FRAME_STEP_UNSUPPORTED -// -// MessageText: -// -// Frame step is not supported on this configuration.%0 -// -#define VFW_E_FRAME_STEP_UNSUPPORTED ((HRESULT)0x8004028EL) - -// -// MessageId: VFW_E_DVD_STREAM_DISABLED -// -// MessageText: -// -// The specified stream is disabled and cannot be selected.%0 -// -#define VFW_E_DVD_STREAM_DISABLED ((HRESULT)0x8004028FL) - -// -// MessageId: VFW_E_DVD_TITLE_UNKNOWN -// -// MessageText: -// -// The operation depends on the current title number, however the navigator has not yet entered the VTSM or the title domains, -// so the 'current' title index is unknown.%0 -// -#define VFW_E_DVD_TITLE_UNKNOWN ((HRESULT)0x80040290L) - -// -// MessageId: VFW_E_DVD_INVALID_DISC -// -// MessageText: -// -// The specified path does not point to a valid DVD disc.%0 -// -#define VFW_E_DVD_INVALID_DISC ((HRESULT)0x80040291L) - -// -// MessageId: VFW_E_DVD_NO_RESUME_INFORMATION -// -// MessageText: -// -// There is currently no resume information.%0 -// -#define VFW_E_DVD_NO_RESUME_INFORMATION ((HRESULT)0x80040292L) - -// -// MessageId: VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD -// -// MessageText: -// -// This thread has already blocked this output pin. There is no need to call IPinFlowControl::Block() again.%0 -// -#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD ((HRESULT)0x80040293L) - -// -// MessageId: VFW_E_PIN_ALREADY_BLOCKED -// -// MessageText: -// -// IPinFlowControl::Block() has been called on another thread. The current thread cannot make any assumptions about this pin's block state.%0 -// -#define VFW_E_PIN_ALREADY_BLOCKED ((HRESULT)0x80040294L) - -// -// MessageId: VFW_E_CERTIFICATION_FAILURE -// -// MessageText: -// -// An operation failed due to a certification failure.%0 -// -#define VFW_E_CERTIFICATION_FAILURE ((HRESULT)0x80040295L) - -// -// MessageId: VFW_E_VMR_NOT_IN_MIXER_MODE -// -// MessageText: -// -// The VMR has not yet created a mixing component. That is, IVMRFilterConfig::SetNumberofStreams has not yet been called.%0 -// -#define VFW_E_VMR_NOT_IN_MIXER_MODE ((HRESULT)0x80040296L) - -// -// -// E_PROP_SET_UNSUPPORTED and E_PROP_ID_UNSUPPORTED are added here using -// HRESULT_FROM_WIN32() because VC5 doesn't have WinNT's new error codes -// from winerror.h, and because it is more convienent to have them already -// formed as HRESULTs. These should correspond to: -// HRESULT_FROM_WIN32(ERROR_NOT_FOUND) == E_PROP_ID_UNSUPPORTED -// HRESULT_FROM_WIN32(ERROR_SET_NOT_FOUND) == E_PROP_SET_UNSUPPORTED -#if !defined(E_PROP_SET_UNSUPPORTED) -// -// MessageId: E_PROP_SET_UNSUPPORTED -// -// MessageText: -// -// The Specified property set is not supported.%0 -// -#define E_PROP_SET_UNSUPPORTED ((HRESULT)0x80070492L) - -#endif //!defined(E_PROP_SET_UNSUPPORTED) -#if !defined(E_PROP_ID_UNSUPPORTED) -// -// MessageId: E_PROP_ID_UNSUPPORTED -// -// MessageText: -// -// The specified property ID is not supported for the specified property set.%0 -// -#define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490L) - -#endif //!defined(E_PROP_ID_UNSUPPORTED) diff --git a/import/DirectX8/include/videoacc.h b/import/DirectX8/include/videoacc.h deleted file mode 100644 index ff768877e..000000000 --- a/import/DirectX8/include/videoacc.h +++ /dev/null @@ -1,661 +0,0 @@ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0347 */ -/* Compiler settings for videoacc.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __videoacc_h__ -#define __videoacc_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IAMVideoAcceleratorNotify_FWD_DEFINED__ -#define __IAMVideoAcceleratorNotify_FWD_DEFINED__ -typedef interface IAMVideoAcceleratorNotify IAMVideoAcceleratorNotify; -#endif /* __IAMVideoAcceleratorNotify_FWD_DEFINED__ */ - - -#ifndef __IAMVideoAccelerator_FWD_DEFINED__ -#define __IAMVideoAccelerator_FWD_DEFINED__ -typedef interface IAMVideoAccelerator IAMVideoAccelerator; -#endif /* __IAMVideoAccelerator_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_videoacc_0000 */ -/* [local] */ - -// -// The following declarations within the 'if 0' block are dummy typedefs used to make -// the motncomp.idl file build. The actual definitions are contained in ddraw.h and amva.h -// -#if 0 -typedef void *LPVOID; - -typedef void *LPGUID; - -typedef void *LPDIRECTDRAWSURFACE; - -typedef void *LPDDPIXELFORMAT; - -typedef void *LPAMVAInternalMemInfo; - -typedef void AMVAUncompDataInfo; - -typedef void *LPAMVACompBufferInfo; - -typedef void AMVABUFFERINFO; - -typedef void AMVAEndFrameInfo; - -typedef void *LPAMVAUncompBufferInfo; - -typedef void AMVABeginFrameInfo; - -typedef IUnknown *IMediaSample; - -#endif -#include -#include - - -extern RPC_IF_HANDLE __MIDL_itf_videoacc_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_videoacc_0000_v0_0_s_ifspec; - -#ifndef __IAMVideoAcceleratorNotify_INTERFACE_DEFINED__ -#define __IAMVideoAcceleratorNotify_INTERFACE_DEFINED__ - -/* interface IAMVideoAcceleratorNotify */ -/* [unique][helpstring][uuid][object][local] */ - - -EXTERN_C const IID IID_IAMVideoAcceleratorNotify; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("256A6A21-FBAD-11d1-82BF-00A0C9696C8F") - IAMVideoAcceleratorNotify : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetUncompSurfacesInfo( - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPAMVAUncompBufferInfo pUncompBufferInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetUncompSurfacesInfo( - /* [in] */ DWORD dwActualUncompSurfacesAllocated) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCreateVideoAcceleratorData( - /* [in] */ const GUID *pGuid, - /* [out] */ LPDWORD pdwSizeMiscData, - /* [out] */ LPVOID *ppMiscData) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoAcceleratorNotifyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoAcceleratorNotify * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoAcceleratorNotify * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoAcceleratorNotify * This); - - HRESULT ( STDMETHODCALLTYPE *GetUncompSurfacesInfo )( - IAMVideoAcceleratorNotify * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPAMVAUncompBufferInfo pUncompBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *SetUncompSurfacesInfo )( - IAMVideoAcceleratorNotify * This, - /* [in] */ DWORD dwActualUncompSurfacesAllocated); - - HRESULT ( STDMETHODCALLTYPE *GetCreateVideoAcceleratorData )( - IAMVideoAcceleratorNotify * This, - /* [in] */ const GUID *pGuid, - /* [out] */ LPDWORD pdwSizeMiscData, - /* [out] */ LPVOID *ppMiscData); - - END_INTERFACE - } IAMVideoAcceleratorNotifyVtbl; - - interface IAMVideoAcceleratorNotify - { - CONST_VTBL struct IAMVideoAcceleratorNotifyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoAcceleratorNotify_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoAcceleratorNotify_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoAcceleratorNotify_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoAcceleratorNotify_GetUncompSurfacesInfo(This,pGuid,pUncompBufferInfo) \ - (This)->lpVtbl -> GetUncompSurfacesInfo(This,pGuid,pUncompBufferInfo) - -#define IAMVideoAcceleratorNotify_SetUncompSurfacesInfo(This,dwActualUncompSurfacesAllocated) \ - (This)->lpVtbl -> SetUncompSurfacesInfo(This,dwActualUncompSurfacesAllocated) - -#define IAMVideoAcceleratorNotify_GetCreateVideoAcceleratorData(This,pGuid,pdwSizeMiscData,ppMiscData) \ - (This)->lpVtbl -> GetCreateVideoAcceleratorData(This,pGuid,pdwSizeMiscData,ppMiscData) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoAcceleratorNotify_GetUncompSurfacesInfo_Proxy( - IAMVideoAcceleratorNotify * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPAMVAUncompBufferInfo pUncompBufferInfo); - - -void __RPC_STUB IAMVideoAcceleratorNotify_GetUncompSurfacesInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAcceleratorNotify_SetUncompSurfacesInfo_Proxy( - IAMVideoAcceleratorNotify * This, - /* [in] */ DWORD dwActualUncompSurfacesAllocated); - - -void __RPC_STUB IAMVideoAcceleratorNotify_SetUncompSurfacesInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAcceleratorNotify_GetCreateVideoAcceleratorData_Proxy( - IAMVideoAcceleratorNotify * This, - /* [in] */ const GUID *pGuid, - /* [out] */ LPDWORD pdwSizeMiscData, - /* [out] */ LPVOID *ppMiscData); - - -void __RPC_STUB IAMVideoAcceleratorNotify_GetCreateVideoAcceleratorData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoAcceleratorNotify_INTERFACE_DEFINED__ */ - - -#ifndef __IAMVideoAccelerator_INTERFACE_DEFINED__ -#define __IAMVideoAccelerator_INTERFACE_DEFINED__ - -/* interface IAMVideoAccelerator */ -/* [unique][helpstring][uuid][object][local] */ - - -EXTERN_C const IID IID_IAMVideoAccelerator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("256A6A22-FBAD-11d1-82BF-00A0C9696C8F") - IAMVideoAccelerator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetVideoAcceleratorGUIDs( - /* [out][in] */ LPDWORD pdwNumGuidsSupported, - /* [out][in] */ LPGUID pGuidsSupported) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUncompFormatsSupported( - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPDWORD pdwNumFormatsSupported, - /* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInternalMemInfo( - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCompBufferInfo( - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInternalCompBufferInfo( - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE BeginFrame( - /* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndFrame( - /* [in] */ const AMVAEndFrameInfo *pEndFrameInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBuffer( - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ BOOL bReadOnly, - /* [out] */ LPVOID *ppBuffer, - /* [out] */ LONG *lpStride) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReleaseBuffer( - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE Execute( - /* [in] */ DWORD dwFunction, - /* [in] */ LPVOID lpPrivateInputData, - /* [in] */ DWORD cbPrivateInputData, - /* [in] */ LPVOID lpPrivateOutputDat, - /* [in] */ DWORD cbPrivateOutputData, - /* [in] */ DWORD dwNumBuffers, - /* [in] */ const AMVABUFFERINFO *pamvaBufferInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryRenderStatus( - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ DWORD dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE DisplayFrame( - /* [in] */ DWORD dwFlipToIndex, - /* [in] */ IMediaSample *pMediaSample) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMVideoAcceleratorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoAccelerator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoAccelerator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoAccelerator * This); - - HRESULT ( STDMETHODCALLTYPE *GetVideoAcceleratorGUIDs )( - IAMVideoAccelerator * This, - /* [out][in] */ LPDWORD pdwNumGuidsSupported, - /* [out][in] */ LPGUID pGuidsSupported); - - HRESULT ( STDMETHODCALLTYPE *GetUncompFormatsSupported )( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPDWORD pdwNumFormatsSupported, - /* [out][in] */ LPDDPIXELFORMAT pFormatsSupported); - - HRESULT ( STDMETHODCALLTYPE *GetInternalMemInfo )( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo); - - HRESULT ( STDMETHODCALLTYPE *GetCompBufferInfo )( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *GetInternalCompBufferInfo )( - IAMVideoAccelerator * This, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *BeginFrame )( - IAMVideoAccelerator * This, - /* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo); - - HRESULT ( STDMETHODCALLTYPE *EndFrame )( - IAMVideoAccelerator * This, - /* [in] */ const AMVAEndFrameInfo *pEndFrameInfo); - - HRESULT ( STDMETHODCALLTYPE *GetBuffer )( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ BOOL bReadOnly, - /* [out] */ LPVOID *ppBuffer, - /* [out] */ LONG *lpStride); - - HRESULT ( STDMETHODCALLTYPE *ReleaseBuffer )( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex); - - HRESULT ( STDMETHODCALLTYPE *Execute )( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwFunction, - /* [in] */ LPVOID lpPrivateInputData, - /* [in] */ DWORD cbPrivateInputData, - /* [in] */ LPVOID lpPrivateOutputDat, - /* [in] */ DWORD cbPrivateOutputData, - /* [in] */ DWORD dwNumBuffers, - /* [in] */ const AMVABUFFERINFO *pamvaBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *QueryRenderStatus )( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *DisplayFrame )( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwFlipToIndex, - /* [in] */ IMediaSample *pMediaSample); - - END_INTERFACE - } IAMVideoAcceleratorVtbl; - - interface IAMVideoAccelerator - { - CONST_VTBL struct IAMVideoAcceleratorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMVideoAccelerator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IAMVideoAccelerator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IAMVideoAccelerator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IAMVideoAccelerator_GetVideoAcceleratorGUIDs(This,pdwNumGuidsSupported,pGuidsSupported) \ - (This)->lpVtbl -> GetVideoAcceleratorGUIDs(This,pdwNumGuidsSupported,pGuidsSupported) - -#define IAMVideoAccelerator_GetUncompFormatsSupported(This,pGuid,pdwNumFormatsSupported,pFormatsSupported) \ - (This)->lpVtbl -> GetUncompFormatsSupported(This,pGuid,pdwNumFormatsSupported,pFormatsSupported) - -#define IAMVideoAccelerator_GetInternalMemInfo(This,pGuid,pamvaUncompDataInfo,pamvaInternalMemInfo) \ - (This)->lpVtbl -> GetInternalMemInfo(This,pGuid,pamvaUncompDataInfo,pamvaInternalMemInfo) - -#define IAMVideoAccelerator_GetCompBufferInfo(This,pGuid,pamvaUncompDataInfo,pdwNumTypesCompBuffers,pamvaCompBufferInfo) \ - (This)->lpVtbl -> GetCompBufferInfo(This,pGuid,pamvaUncompDataInfo,pdwNumTypesCompBuffers,pamvaCompBufferInfo) - -#define IAMVideoAccelerator_GetInternalCompBufferInfo(This,pdwNumTypesCompBuffers,pamvaCompBufferInfo) \ - (This)->lpVtbl -> GetInternalCompBufferInfo(This,pdwNumTypesCompBuffers,pamvaCompBufferInfo) - -#define IAMVideoAccelerator_BeginFrame(This,amvaBeginFrameInfo) \ - (This)->lpVtbl -> BeginFrame(This,amvaBeginFrameInfo) - -#define IAMVideoAccelerator_EndFrame(This,pEndFrameInfo) \ - (This)->lpVtbl -> EndFrame(This,pEndFrameInfo) - -#define IAMVideoAccelerator_GetBuffer(This,dwTypeIndex,dwBufferIndex,bReadOnly,ppBuffer,lpStride) \ - (This)->lpVtbl -> GetBuffer(This,dwTypeIndex,dwBufferIndex,bReadOnly,ppBuffer,lpStride) - -#define IAMVideoAccelerator_ReleaseBuffer(This,dwTypeIndex,dwBufferIndex) \ - (This)->lpVtbl -> ReleaseBuffer(This,dwTypeIndex,dwBufferIndex) - -#define IAMVideoAccelerator_Execute(This,dwFunction,lpPrivateInputData,cbPrivateInputData,lpPrivateOutputDat,cbPrivateOutputData,dwNumBuffers,pamvaBufferInfo) \ - (This)->lpVtbl -> Execute(This,dwFunction,lpPrivateInputData,cbPrivateInputData,lpPrivateOutputDat,cbPrivateOutputData,dwNumBuffers,pamvaBufferInfo) - -#define IAMVideoAccelerator_QueryRenderStatus(This,dwTypeIndex,dwBufferIndex,dwFlags) \ - (This)->lpVtbl -> QueryRenderStatus(This,dwTypeIndex,dwBufferIndex,dwFlags) - -#define IAMVideoAccelerator_DisplayFrame(This,dwFlipToIndex,pMediaSample) \ - (This)->lpVtbl -> DisplayFrame(This,dwFlipToIndex,pMediaSample) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetVideoAcceleratorGUIDs_Proxy( - IAMVideoAccelerator * This, - /* [out][in] */ LPDWORD pdwNumGuidsSupported, - /* [out][in] */ LPGUID pGuidsSupported); - - -void __RPC_STUB IAMVideoAccelerator_GetVideoAcceleratorGUIDs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetUncompFormatsSupported_Proxy( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPDWORD pdwNumFormatsSupported, - /* [out][in] */ LPDDPIXELFORMAT pFormatsSupported); - - -void __RPC_STUB IAMVideoAccelerator_GetUncompFormatsSupported_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetInternalMemInfo_Proxy( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo); - - -void __RPC_STUB IAMVideoAccelerator_GetInternalMemInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetCompBufferInfo_Proxy( - IAMVideoAccelerator * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - -void __RPC_STUB IAMVideoAccelerator_GetCompBufferInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetInternalCompBufferInfo_Proxy( - IAMVideoAccelerator * This, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - -void __RPC_STUB IAMVideoAccelerator_GetInternalCompBufferInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_BeginFrame_Proxy( - IAMVideoAccelerator * This, - /* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo); - - -void __RPC_STUB IAMVideoAccelerator_BeginFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_EndFrame_Proxy( - IAMVideoAccelerator * This, - /* [in] */ const AMVAEndFrameInfo *pEndFrameInfo); - - -void __RPC_STUB IAMVideoAccelerator_EndFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_GetBuffer_Proxy( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ BOOL bReadOnly, - /* [out] */ LPVOID *ppBuffer, - /* [out] */ LONG *lpStride); - - -void __RPC_STUB IAMVideoAccelerator_GetBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_ReleaseBuffer_Proxy( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex); - - -void __RPC_STUB IAMVideoAccelerator_ReleaseBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_Execute_Proxy( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwFunction, - /* [in] */ LPVOID lpPrivateInputData, - /* [in] */ DWORD cbPrivateInputData, - /* [in] */ LPVOID lpPrivateOutputDat, - /* [in] */ DWORD cbPrivateOutputData, - /* [in] */ DWORD dwNumBuffers, - /* [in] */ const AMVABUFFERINFO *pamvaBufferInfo); - - -void __RPC_STUB IAMVideoAccelerator_Execute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_QueryRenderStatus_Proxy( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ DWORD dwFlags); - - -void __RPC_STUB IAMVideoAccelerator_QueryRenderStatus_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IAMVideoAccelerator_DisplayFrame_Proxy( - IAMVideoAccelerator * This, - /* [in] */ DWORD dwFlipToIndex, - /* [in] */ IMediaSample *pMediaSample); - - -void __RPC_STUB IAMVideoAccelerator_DisplayFrame_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IAMVideoAccelerator_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/import/DirectX8/include/vpconfig.h b/import/DirectX8/include/vpconfig.h deleted file mode 100644 index 776d99f51..000000000 --- a/import/DirectX8/include/vpconfig.h +++ /dev/null @@ -1,135 +0,0 @@ -//------------------------------------------------------------------------------ -// File: VPConfig.h -// -// Desc: An interface exposed by the decoder to help it and the filter -// configuring the videoport to communicate. -// -// Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __IVPConfig__ -#define __IVPConfig__ - -#ifdef __cplusplus -extern "C" { -#endif - -// IVPBaseConfig -DECLARE_INTERFACE_(IVPBaseConfig, IUnknown) -{ -public: - - // gets the various connection information structures (guid, portwidth) - // in an array of structures. If the pointer to the array is NULL, first - // parameter returns the total number of formats supported. - STDMETHOD (GetConnectInfo)(THIS_ - IN OUT LPDWORD pdwNumConnectInfo, - IN OUT LPDDVIDEOPORTCONNECT pddVPConnectInfo - ) PURE; - - // sets the connection entry chosen (0, 1, .. ,(dwNumProposedEntries-1)) - STDMETHOD (SetConnectInfo)(THIS_ - IN DWORD dwChosenEntry - ) PURE; - - // gets various data parameters, includes dimensionnal info - STDMETHOD (GetVPDataInfo)(THIS_ - IN OUT LPAMVPDATAINFO pamvpDataInfo - ) PURE; - - // retrives maximum pixels per second rate expected for a given - // format and a given scaling factor. If decoder does not support - // those scaling factors, then it gives the rate and the nearest - // scaling factors. - STDMETHOD (GetMaxPixelRate)(THIS_ - IN OUT LPAMVPSIZE pamvpSize, - OUT LPDWORD pdwMaxPixelsPerSecond - ) PURE; - - // informs the callee of the videoformats supported by the videoport - STDMETHOD (InformVPInputFormats)(THIS_ - IN DWORD dwNumFormats, - IN LPDDPIXELFORMAT pDDPixelFormats - ) PURE; - - // gets the various formats supported by the decoder in an array - // of structures. If the pointer to the array is NULL, first parameter - // returns the total number of formats supported. - STDMETHOD (GetVideoFormats)(THIS_ - IN OUT LPDWORD pdwNumFormats, - IN OUT LPDDPIXELFORMAT pddPixelFormats - ) PURE; - - // sets the format entry chosen (0, 1, .. ,(dwNumProposedEntries-1)) - STDMETHOD (SetVideoFormat)(THIS_ - IN DWORD dwChosenEntry - ) PURE; - - // asks the decoder to treat even fields like odd fields and visa versa - STDMETHOD (SetInvertPolarity)(THIS_ - ) PURE; - - // the mixer uses this function to determine if the callee wants - // the vpmixer to use its overlay surface and if so to get a pointer to it - STDMETHOD (GetOverlaySurface)(THIS_ - OUT LPDIRECTDRAWSURFACE* ppddOverlaySurface - ) PURE; - - // sets the direct draw kernel handle - STDMETHOD (SetDirectDrawKernelHandle)(THIS_ - IN ULONG_PTR dwDDKernelHandle - ) PURE; - - // sets the video port id - STDMETHOD (SetVideoPortID)(THIS_ - IN DWORD dwVideoPortID - ) PURE; - - // sets the direct draw surface kernel handle - STDMETHOD (SetDDSurfaceKernelHandles)(THIS_ - IN DWORD cHandles, - IN ULONG_PTR *rgDDKernelHandles - ) PURE; - - // Tells driver about surface created on its behalf by ovmixer/vbisurf and - // returned from videoport/ddraw. Should always return NOERROR or E_NOIMPL. - // dwPitch is the pitch of the surface (distance in pixels between the start - // pixels of two consecutive lines of the surface). (dwXOrigin, dwYOrigin) - // are the (X, Y) coordinates of the pixel at which valid data starts. - STDMETHOD (SetSurfaceParameters)(THIS_ - IN DWORD dwPitch, - IN DWORD dwXOrigin, - IN DWORD dwYOrigin - ) PURE; -}; - -// IVPConfig -DECLARE_INTERFACE_(IVPConfig, IVPBaseConfig) -{ -public: - // the mixer uses this function to determine if the callee wants - // the mixer to decimate VIDEO data at its own descrition - STDMETHOD (IsVPDecimationAllowed)(THIS_ - OUT LPBOOL pbIsDecimationAllowed - ) PURE; - - // sets the scaling factors. If decoder does not support these, - // then it sets the values to the nearest factors it can support - STDMETHOD (SetScalingFactors)(THIS_ - IN LPAMVPSIZE pamvpSize - ) PURE; -}; - -// IVPVBIConfig -DECLARE_INTERFACE_(IVPVBIConfig, IVPBaseConfig) -{ -public: -}; - -#ifdef __cplusplus -} -#endif - - -#endif // __IVPConfig__ diff --git a/import/DirectX8/include/vpnotify.h b/import/DirectX8/include/vpnotify.h deleted file mode 100644 index 2e1d1b6b0..000000000 --- a/import/DirectX8/include/vpnotify.h +++ /dev/null @@ -1,92 +0,0 @@ -//------------------------------------------------------------------------------ -// File: VPNotify.h -// -// Desc: -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __IVPNotify__ -#define __IVPNotify__ - -#ifdef __cplusplus -extern "C" { -#endif - -// interface IVPBaseNotify -DECLARE_INTERFACE_(IVPBaseNotify, IUnknown) -{ -public: - // this function initializes the reconnection to the decoder. - STDMETHOD (RenegotiateVPParameters)(THIS_ - ) PURE; - -}; - -// interface IVPNotify -DECLARE_INTERFACE_(IVPNotify, IVPBaseNotify) -{ -public: - // function to set the mode (bob, weave etc) - STDMETHOD (SetDeinterlaceMode)(THIS_ - IN AMVP_MODE mode - ) PURE; - - // function to get the mode (bob, weave etc) - STDMETHOD (GetDeinterlaceMode)(THIS_ - OUT AMVP_MODE *pMode - ) PURE; -}; - -// interface IVPNotify -DECLARE_INTERFACE_(IVPNotify2, IVPNotify) -{ -public: -// function to set the mode (bob, weave etc) - STDMETHOD (SetVPSyncMaster)(THIS_ - IN BOOL bVPSyncMaster - ) PURE; - - // function to get the mode (bob, weave etc) - STDMETHOD (GetVPSyncMaster)(THIS_ - OUT BOOL *pbVPSyncMaster - ) PURE; - - /* - // this function sets the directdraw surface that the mixer is supposed to use. - STDMETHOD (SetDirectDrawSurface)(THIS_ - IN LPDIRECTDRAWSURFACE pDirectDrawSurface - ) PURE; - - // this function gets the directdraw surface that the mixer is using - STDMETHOD (GetDirectDrawSurface)(THIS_ - OUT LPDIRECTDRAWSURFACE *ppDirectDrawSurface - ) PURE; - - // this functions sets the color-controls, if the chip supports it. - STDMETHOD (SetVPColorControls)(THIS_ - IN LPDDCOLORCONTROL pColorControl - ) PURE; - - // this functions also returns the capability of the hardware in the dwFlags - // value of the struct. - STDMETHOD (GetVPColorControls)(THIS_ - OUT LPDDCOLORCONTROL *ppColorControl - ) PURE; - */ -}; - - -// interface IVPVBINotify -DECLARE_INTERFACE_(IVPVBINotify, IVPBaseNotify) -{ -public: -}; - -#ifdef __cplusplus -} -#endif - - -#endif // __IVPNotify__ diff --git a/import/DirectX8/include/vptype.h b/import/DirectX8/include/vptype.h deleted file mode 100644 index b03baae69..000000000 --- a/import/DirectX8/include/vptype.h +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------ -// File: VPType.h -// -// Desc: This file includes all the data structures defined for the IVPConfig -// interface. -// -// Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------ - - -#ifndef __IVPType__ -#define __IVPType__ - -#ifdef __cplusplus -extern "C" { -#endif - - // enum to specify the criterion, which the vpmixer is supposed to use - // in order to select the video format - typedef enum _AMVP_SELECT_FORMAT_BY - { - AMVP_DO_NOT_CARE, - AMVP_BEST_BANDWIDTH, - AMVP_INPUT_SAME_AS_OUTPUT - } AMVP_SELECT_FORMAT_BY; - - // enum to specify the various mode - typedef enum _AMVP_MODE - { - AMVP_MODE_WEAVE, - AMVP_MODE_BOBINTERLEAVED, - AMVP_MODE_BOBNONINTERLEAVED, - AMVP_MODE_SKIPEVEN, - AMVP_MODE_SKIPODD - } AMVP_MODE; - - // struct to specify the width and height. The context could be anything - // such as scaling cropping etc. - typedef struct _AMVPSIZE - { - DWORD dwWidth; // the width - DWORD dwHeight; // the height - } AMVPSIZE, *LPAMVPSIZE; - - // struct to specify the dimensional characteristics of the input stream - typedef struct _AMVPDIMINFO - { - DWORD dwFieldWidth; // Field height of the data - DWORD dwFieldHeight; // Field width of the data - DWORD dwVBIWidth; // Width of the VBI data - DWORD dwVBIHeight; // Height of the VBI data - RECT rcValidRegion; // The vaild rectangle, used for cropping - } AMVPDIMINFO, *LPAMVPDIMINFO; - - // struct to specify the various data specific characteristics of the input stream - typedef struct _AMVPDATAINFO - { - DWORD dwSize; // Size of the struct - DWORD dwMicrosecondsPerField; // Time taken by each field - AMVPDIMINFO amvpDimInfo; // Dimensional Information - DWORD dwPictAspectRatioX; // X dimension of Picture Aspect Ratio - DWORD dwPictAspectRatioY; // Y dimension of Picture Aspect Ratio - BOOL bEnableDoubleClock; // Videoport should enable double clocking - BOOL bEnableVACT; // Videoport should use an external VACT signal - BOOL bDataIsInterlaced; // Indicates that the signal is interlaced - LONG lHalfLinesOdd; // number of halflines in the odd field - BOOL bFieldPolarityInverted; // Device inverts the polarity by default - DWORD dwNumLinesInVREF; // Number of lines of data in VREF - LONG lHalfLinesEven; // number of halflines in the even field - DWORD dwReserved1; // Reserved for future use - } AMVPDATAINFO, *LPAMVPDATAINFO; - - -#ifdef __cplusplus -} -#endif - -#endif // __IVPType__ diff --git a/import/DirectX8/include/xprtdefs.h b/import/DirectX8/include/xprtdefs.h deleted file mode 100644 index eb2a229db..000000000 --- a/import/DirectX8/include/xprtdefs.h +++ /dev/null @@ -1,673 +0,0 @@ -//=========================================================================== -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR -// PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//=========================================================================== -// -// filename XPrtDefs.h (Derived from edevdefs.h) -// -// External Device (like a VCR) control interface parameter and value definitions -// -// Note:new constants added: ED_BASE+800L -> ED_BASE+811L -// -// 1-30-98: -// New constant added for DVCR: ED_BASE+900L -> ED_BASE+1000L -// - -#ifndef __XPRTDEFS__ -#define __XPRTDEFS__ - - -#define ED_BASE 0x1000L - -// this is used to tell the device communications object which -// physical communications port to use. -#define DEV_PORT_SIM 1 -#define DEV_PORT_COM1 2 // standard serial ports -#define DEV_PORT_COM2 3 -#define DEV_PORT_COM3 4 -#define DEV_PORT_COM4 5 -#define DEV_PORT_DIAQ 6 // Diaquest driver -#define DEV_PORT_ARTI 7 // ARTI driver -#define DEV_PORT_1394 8 // IEEE 1394 Bus -#define DEV_PORT_USB 9 // Universal Serial Bus -#define DEV_PORT_MIN DEV_PORT_SIM -#define DEV_PORT_MAX DEV_PORT_USB - - -// IAMExtDevice Capability Items: unless otherwise specified, these items return -// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified: - -#define ED_DEVCAP_CAN_RECORD ED_BASE+1L -#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2L // for multitrack devices: - // switches currently recording tracks off - // and selected non-recording tracks into record -#define ED_DEVCAP_HAS_AUDIO ED_BASE+3L -#define ED_DEVCAP_HAS_VIDEO ED_BASE+4L -#define ED_DEVCAP_USES_FILES ED_BASE+5L -#define ED_DEVCAP_CAN_SAVE ED_BASE+6L - -#define ED_DEVCAP_DEVICE_TYPE ED_BASE+7L // returns one of the following: -#define ED_DEVTYPE_VCR ED_BASE+8L -#define ED_DEVTYPE_LASERDISK ED_BASE+9L -#define ED_DEVTYPE_ATR ED_BASE+10L -#define ED_DEVTYPE_DDR ED_BASE+11L -#define ED_DEVTYPE_ROUTER ED_BASE+12L -#define ED_DEVTYPE_KEYER ED_BASE+13L -#define ED_DEVTYPE_MIXER_VIDEO ED_BASE+14L -#define ED_DEVTYPE_DVE ED_BASE+15L -#define ED_DEVTYPE_WIPEGEN ED_BASE+16L -#define ED_DEVTYPE_MIXER_AUDIO ED_BASE+17L -#define ED_DEVTYPE_CG ED_BASE+18L -#define ED_DEVTYPE_TBC ED_BASE+19L -#define ED_DEVTYPE_TCG ED_BASE+20L -#define ED_DEVTYPE_GPI ED_BASE+21L -#define ED_DEVTYPE_JOYSTICK ED_BASE+22L -#define ED_DEVTYPE_KEYBOARD ED_BASE+23L - -// returns mfr-specific ID from external device. -#define ED_DEVCAP_EXTERNAL_DEVICE_ID ED_BASE+24L - -#define ED_DEVCAP_TIMECODE_READ ED_BASE+25L -#define ED_DEVCAP_TIMECODE_WRITE ED_BASE+26L -// used for seekable non-timecode enabled devices -#define ED_DEVCAP_CTLTRK_READ ED_BASE+27L -// used for seekable non-timecode enabled devices -#define ED_DEVCAP_INDEX_READ ED_BASE+28L - -// returns device preroll time in current time format -#define ED_DEVCAP_PREROLL ED_BASE+29L -// returns device postroll time in current time format -#define ED_DEVCAP_POSTROLL ED_BASE+30L - -// returns indication of devices synchronization accuracy. -#define ED_DEVCAP_SYNC_ACCURACY ED_BASE+31L // returns one of the following: -#define ED_SYNCACC_PRECISE ED_BASE+32L -#define ED_SYNCACC_FRAME ED_BASE+33L -#define ED_SYNCACC_ROUGH ED_BASE+34L - -// returns devices normal framerate. -#define ED_DEVCAP_NORMAL_RATE ED_BASE+35L // returns one of the following: -#define ED_RATE_24 ED_BASE+36L -#define ED_RATE_25 ED_BASE+37L -#define ED_RATE_2997 ED_BASE+38L -#define ED_RATE_30 ED_BASE+39L - -#define ED_DEVCAP_CAN_PREVIEW ED_BASE+40L -#define ED_DEVCAP_CAN_MONITOR_SOURCES ED_BASE+41L - -// indicates implementation allows testing of methods/parameters by -// setting the hi bit of a parm that makes sense - see individual methods -// for details. -#define ED_DEVCAP_CAN_TEST ED_BASE+42L - -// indicates device accepts video as an input. -#define ED_DEVCAP_VIDEO_INPUTS ED_BASE+43L - -// indicates device accepts audio as an input. -#define ED_DEVCAP_AUDIO_INPUTS ED_BASE+44L - -#define ED_DEVCAP_NEEDS_CALIBRATING ED_BASE+45L - -#define ED_DEVCAP_SEEK_TYPE ED_BASE+46L // returns one of the following: -#define ED_SEEK_PERFECT ED_BASE+47L // indicates device can execute seek - // within 1 video frames without signal - // break (like a DDR) -#define ED_SEEK_FAST ED_BASE+48L // indicates device can move pretty quick - // with short break in signal -#define ED_SEEK_SLOW ED_BASE+49L // seeks like a tape transport - -#define ED_POWER_ON ED_BASE+50L -#define ED_POWER_OFF ED_BASE+51L -#define ED_POWER_STANDBY ED_BASE+52L - -#define ED_ACTIVE ED_BASE+53L -#define ED_INACTIVE ED_BASE+54L -#define ED_ALL ED_BASE+55L -#define ED_TEST ED_BASE+56L - -// IAMExtTransport Capability Items: unless otherwise specified, these items return -// OATRUE or OAFALSE. All return values are in pdwValue unless otherwise specified: - -#define ED_TRANSCAP_CAN_EJECT ED_BASE+100L -#define ED_TRANSCAP_CAN_BUMP_PLAY ED_BASE+101L // variable speed for synchronizing -#define ED_TRANSCAP_CAN_PLAY_BACKWARDS ED_BASE+102L // servo locked for use during an edit -#define ED_TRANSCAP_CAN_SET_EE ED_BASE+103L // show devices input on its output -#define ED_TRANSCAP_CAN_SET_PB ED_BASE+104L // show media playback on devices output -#define ED_TRANSCAP_CAN_DELAY_VIDEO_IN ED_BASE+105L // transport can do delayed-in video edits -#define ED_TRANSCAP_CAN_DELAY_VIDEO_OUT ED_BASE+106L // transport can do delayed-out video edits -#define ED_TRANSCAP_CAN_DELAY_AUDIO_IN ED_BASE+107L // transport can do delayed-in audio edits -#define ED_TRANSCAP_CAN_DELAY_AUDIO_OUT ED_BASE+108L // transport can do delayed-out audio edits -#define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109L // max forward speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_FWD_VARIABLE_MIN ED_BASE+800L // min forward speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110L // max reverse speed (multiple of play speed) in - // pdblValue -#define ED_TRANSCAP_REV_VARIABLE_MIN ED_BASE+801L // min reverse speed (multiple of play speed) - // in pdblValue -#define ED_TRANSCAP_FWD_SHUTTLE_MAX ED_BASE+802L // max forward speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_FWD_SHUTTLE_MIN ED_BASE+803L // min forward speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_REV_SHUTTLE_MAX ED_BASE+804L // max reverse speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_REV_SHUTTLE_MIN ED_BASE+805L // min reverse speed in Shuttle mode (multiple - // of play speed) in pdblValue -#define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111L // returns number of audio tracks -#define ED_TRANSCAP_LTC_TRACK ED_BASE+112L // returns track number of LTC timecode track. - // ED_ALL means no dedicated timecode track -#define ED_TRANSCAP_NEEDS_TBC ED_BASE+113L // devices output not stable -#define ED_TRANSCAP_NEEDS_CUEING ED_BASE+114L // device must be cued prior to performing edit -#define ED_TRANSCAP_CAN_INSERT ED_BASE+115L -#define ED_TRANSCAP_CAN_ASSEMBLE ED_BASE+116L -#define ED_TRANSCAP_FIELD_STEP ED_BASE+117L // device responds to Frame Advance command by - // advancing one field -#define ED_TRANSCAP_CLOCK_INC_RATE ED_BASE+118L // VISCA command - keep for compatibility -#define ED_TRANSCAP_CAN_DETECT_LENGTH ED_BASE+119L -#define ED_TRANSCAP_CAN_FREEZE ED_BASE+120L -#define ED_TRANSCAP_HAS_TUNER ED_BASE+121L -#define ED_TRANSCAP_HAS_TIMER ED_BASE+122L -#define ED_TRANSCAP_HAS_CLOCK ED_BASE+123L -#define ED_TRANSCAP_MULTIPLE_EDITS ED_BASE+806L // OATRUE means device/filter can support - // multiple edit events -#define ED_TRANSCAP_IS_MASTER ED_BASE+807L // OATRUE means device is the master clock - // for synchronizing (this sets timecode-to- - // reference clock offset for editing) -#define ED_TRANSCAP_HAS_DT ED_BASE+814L // OATRUE means device has Dynamic Tracking - -// IAMExtTransport Media States -#define ED_MEDIA_SPIN_UP ED_BASE+130L -#define ED_MEDIA_SPIN_DOWN ED_BASE+131L -#define ED_MEDIA_UNLOAD ED_BASE+132L - -// IAMExtTransport Modes -#define ED_MODE_PLAY ED_BASE+200L -#define ED_MODE_STOP ED_BASE+201L -#define ED_MODE_FREEZE ED_BASE+202L // really "pause" -#define ED_MODE_THAW ED_BASE+203L -#define ED_MODE_FF ED_BASE+204L -#define ED_MODE_REW ED_BASE+205L -#define ED_MODE_RECORD ED_BASE+206L -#define ED_MODE_RECORD_STROBE ED_BASE+207L -#define ED_MODE_RECORD_FREEZE ED_BASE+808L // never "put", only "get" -#define ED_MODE_STEP ED_BASE+208L // same as "jog" -#define ED_MODE_STEP_FWD ED_BASE+208L // same as ED_MODE_STEP -#define ED_MODE_STEP_REV ED_BASE+809L -#define ED_MODE_SHUTTLE ED_BASE+209L -#define ED_MODE_EDIT_CUE ED_BASE+210L -#define ED_MODE_VAR_SPEED ED_BASE+211L -#define ED_MODE_PERFORM ED_BASE+212L // returned status only -#define ED_MODE_LINK_ON ED_BASE+280L -#define ED_MODE_LINK_OFF ED_BASE+281L -#define ED_MODE_NOTIFY_ENABLE ED_BASE+810L -#define ED_MODE_NOTIFY_DISABLE ED_BASE+811L -#define ED_MODE_SHOT_SEARCH ED_BASE+812L - -// IAMTimecodeReader/Generator/Display defines -// -// Timecode Generator Mode params and values: -// -#define ED_TCG_TIMECODE_TYPE ED_BASE+400L // can be one of the following: -#define ED_TCG_SMPTE_LTC ED_BASE+401L -#define ED_TCG_SMPTE_VITC ED_BASE+402L -#define ED_TCG_MIDI_QF ED_BASE+403L -#define ED_TCG_MIDI_FULL ED_BASE+404L - -#define ED_TCG_FRAMERATE ED_BASE+405L // can be one of the following: -#define ED_FORMAT_SMPTE_30 ED_BASE+406L -#define ED_FORMAT_SMPTE_30DROP ED_BASE+407L -#define ED_FORMAT_SMPTE_25 ED_BASE+408L -#define ED_FORMAT_SMPTE_24 ED_BASE+409L - -#define ED_TCG_SYNC_SOURCE ED_BASE+410L // can be one of the following: -#define ED_TCG_VIDEO ED_BASE+411L -#define ED_TCG_READER ED_BASE+412L -#define ED_TCG_FREE ED_BASE+413L - -#define ED_TCG_REFERENCE_SOURCE ED_BASE+414L // can have one these values: - // ED_TCG_FREE || ED_TCG_READER - // (for regen/jamsync) - -// TimeCodeReader Mode params and values: -#define ED_TCR_SOURCE ED_BASE+416L // can be one of the following: -// ED_TCG (already defined) -#define ED_TCR_LTC ED_BASE+417L -#define ED_TCR_VITC ED_BASE+418L -#define ED_TCR_CT ED_BASE+419L // Control Track -#define ED_TCR_FTC ED_BASE+420L // File TimeCode - for file-based devices - // that wish they were transports -// ED_MODE_NOTIFY_ENABLE can be OATRUE or OAFALSE (defined in transport mode -// section of this file). -#define ED_TCR_LAST_VALUE ED_BASE+421L // for notification mode - - // successive calls to GetTimecode - // return the last read value -// TimeCode Display Mode params and values: -// -#define ED_TCD_SOURCE ED_BASE+422L // can be one of the following: -#define ED_TCR ED_BASE+423L -#define ED_TCG ED_BASE+424L - -#define ED_TCD_SIZE ED_BASE+425L // can be one of the following: -#define ED_SMALL ED_BASE+426L -#define ED_MED ED_BASE+427L -#define ED_LARGE ED_BASE+428L - -#define ED_TCD_POSITION ED_BASE+429L // can be one of the following: -#define ED_TOP 0x0001 -#define ED_MIDDLE 0x0002 -#define ED_BOTTOM 0x0004 // ord with -#define ED_LEFT 0x0100 -#define ED_CENTER 0x0200 -#define ED_RIGHT 0x0400 - -#define ED_TCD_INTENSITY ED_BASE+436L // can be one of the following: -#define ED_HIGH ED_BASE+437L -#define ED_LOW ED_BASE+438L - -#define ED_TCD_TRANSPARENCY ED_BASE+439L // 0-4, 0 is opaque - -#define ED_TCD_INVERT ED_BASE+440L // OATRUE=black on white - // OAFALSE=white on black -// IAMExtTransport defines -// -// Transport status, params and values -// - -// IAMExtTransport Status items and and values: -#define ED_MODE ED_BASE+500L // see ED_MODE_xxx values above -#define ED_ERROR ED_BASE+501L -#define ED_LOCAL ED_BASE+502L -#define ED_RECORD_INHIBIT ED_BASE+503L -#define ED_SERVO_LOCK ED_BASE+504L -#define ED_MEDIA_PRESENT ED_BASE+505L -#define ED_MEDIA_LENGTH ED_BASE+506L -#define ED_MEDIA_SIZE ED_BASE+507L -#define ED_MEDIA_TRACK_COUNT ED_BASE+508L -#define ED_MEDIA_TRACK_LENGTH ED_BASE+509L -#define ED_MEDIA_SIDE ED_BASE+510L - -#define ED_MEDIA_TYPE ED_BASE+511L // can be one of the following: -#define ED_MEDIA_VHS ED_BASE+512L -#define ED_MEDIA_SVHS ED_BASE+513L -#define ED_MEDIA_HI8 ED_BASE+514L -#define ED_MEDIA_UMATIC ED_BASE+515L -#define ED_MEDIA_DVC ED_BASE+516L -#define ED_MEDIA_1_INCH ED_BASE+517L -#define ED_MEDIA_D1 ED_BASE+518L -#define ED_MEDIA_D2 ED_BASE+519L -#define ED_MEDIA_D3 ED_BASE+520L -#define ED_MEDIA_D5 ED_BASE+521L -#define ED_MEDIA_DBETA ED_BASE+522L -#define ED_MEDIA_BETA ED_BASE+523L -#define ED_MEDIA_8MM ED_BASE+524L -#define ED_MEDIA_DDR ED_BASE+525L -#define ED_MEDIA_SX ED_BASE+813L -#define ED_MEDIA_OTHER ED_BASE+526L -#define ED_MEDIA_CLV ED_BASE+527L -#define ED_MEDIA_CAV ED_BASE+528L -#define ED_MEDIA_POSITION ED_BASE+529L - -#define ED_MEDIA_NEO ED_BASE+531L // Mini digital tape for MPEG2TS signal - -#define ED_LINK_MODE ED_BASE+530L // OATRUE if transport controls - // are linked to graph's RUN, - // STOP, and PAUSE methods - -// IAMExtTransport Basic Parms -#define ED_TRANSBASIC_TIME_FORMAT ED_BASE+540L // can be one of the following: -#define ED_FORMAT_MILLISECONDS ED_BASE+541L -#define ED_FORMAT_FRAMES ED_BASE+542L -#define ED_FORMAT_REFERENCE_TIME ED_BASE+543L - -#define ED_FORMAT_HMSF ED_BASE+547L -#define ED_FORMAT_TMSF ED_BASE+548L - -#define ED_TRANSBASIC_TIME_REFERENCE ED_BASE+549L // can be one of the following: -#define ED_TIMEREF_TIMECODE ED_BASE+550L -#define ED_TIMEREF_CONTROL_TRACK ED_BASE+551L -#define ED_TIMEREF_INDEX ED_BASE+552L - -#define ED_TRANSBASIC_SUPERIMPOSE ED_BASE+553L // enable/disable onscreen display -#define ED_TRANSBASIC_END_STOP_ACTION ED_BASE+554L // can be one of: ED_MODE_STOP | - // ED_MODE_REWIND | ED_MODE_FREEZE -#define ED_TRANSBASIC_RECORD_FORMAT ED_BASE+555L // can be one of the following: -#define ED_RECORD_FORMAT_SP ED_BASE+556L -#define ED_RECORD_FORMAT_LP ED_BASE+557L -#define ED_RECORD_FORMAT_EP ED_BASE+558L - -#define ED_TRANSBASIC_STEP_COUNT ED_BASE+559L -#define ED_TRANSBASIC_STEP_UNIT ED_BASE+560L // can be one of the following: -#define ED_STEP_FIELD ED_BASE+561L -#define ED_STEP_FRAME ED_BASE+562L -#define ED_STEP_3_2 ED_BASE+563L - -#define ED_TRANSBASIC_PREROLL ED_BASE+564L -#define ED_TRANSBASIC_RECPREROLL ED_BASE+565L -#define ED_TRANSBASIC_POSTROLL ED_BASE+566L -#define ED_TRANSBASIC_EDIT_DELAY ED_BASE+567L -#define ED_TRANSBASIC_PLAYTC_DELAY ED_BASE+568L -#define ED_TRANSBASIC_RECTC_DELAY ED_BASE+569L -#define ED_TRANSBASIC_EDIT_FIELD ED_BASE+570L -#define ED_TRANSBASIC_FRAME_SERVO ED_BASE+571L -#define ED_TRANSBASIC_CF_SERVO ED_BASE+572L -#define ED_TRANSBASIC_SERVO_REF ED_BASE+573L // can be one of the following: -#define ED_REF_EXTERNAL ED_BASE+574L -#define ED_REF_INPUT ED_BASE+575L -#define ED_REF_INTERNAL ED_BASE+576L -#define ED_REF_AUTO ED_BASE+577L - -#define ED_TRANSBASIC_WARN_GL ED_BASE+578L -#define ED_TRANSBASIC_SET_TRACKING ED_BASE+579L // can be one of the following: -#define ED_TRACKING_PLUS ED_BASE+580L -#define ED_TRACKING_MINUS ED_BASE+581L -#define ED_TRACKING_RESET ED_BASE+582L - -#define ED_TRANSBASIC_SET_FREEZE_TIMEOUT ED_BASE+583L -#define ED_TRANSBASIC_VOLUME_NAME ED_BASE+584L -#define ED_TRANSBASIC_BALLISTIC_1 ED_BASE+585L // space for proprietary data -#define ED_TRANSBASIC_BALLISTIC_2 ED_BASE+586L -#define ED_TRANSBASIC_BALLISTIC_3 ED_BASE+587L -#define ED_TRANSBASIC_BALLISTIC_4 ED_BASE+588L -#define ED_TRANSBASIC_BALLISTIC_5 ED_BASE+589L -#define ED_TRANSBASIC_BALLISTIC_6 ED_BASE+590L -#define ED_TRANSBASIC_BALLISTIC_7 ED_BASE+591L -#define ED_TRANSBASIC_BALLISTIC_8 ED_BASE+592L -#define ED_TRANSBASIC_BALLISTIC_9 ED_BASE+593L -#define ED_TRANSBASIC_BALLISTIC_10 ED_BASE+594L -#define ED_TRANSBASIC_BALLISTIC_11 ED_BASE+595L -#define ED_TRANSBASIC_BALLISTIC_12 ED_BASE+596L -#define ED_TRANSBASIC_BALLISTIC_13 ED_BASE+597L -#define ED_TRANSBASIC_BALLISTIC_14 ED_BASE+598L -#define ED_TRANSBASIC_BALLISTIC_15 ED_BASE+599L -#define ED_TRANSBASIC_BALLISTIC_16 ED_BASE+600L -#define ED_TRANSBASIC_BALLISTIC_17 ED_BASE+601L -#define ED_TRANSBASIC_BALLISTIC_18 ED_BASE+602L -#define ED_TRANSBASIC_BALLISTIC_19 ED_BASE+603L -#define ED_TRANSBASIC_BALLISTIC_20 ED_BASE+604L - -// consumer VCR items -#define ED_TRANSBASIC_SETCLOCK ED_BASE+605L -#define ED_TRANSBASIC_SET_COUNTER_FORMAT ED_BASE+606L // uses time format flags -#define ED_TRANSBASIC_SET_COUNTER_VALUE ED_BASE+607L - -#define ED_TRANSBASIC_SETTUNER_CH_UP ED_BASE+608L -#define ED_TRANSBASIC_SETTUNER_CH_DN ED_BASE+609L -#define ED_TRANSBASIC_SETTUNER_SK_UP ED_BASE+610L -#define ED_TRANSBASIC_SETTUNER_SK_DN ED_BASE+611L -#define ED_TRANSBASIC_SETTUNER_CH ED_BASE+612L -#define ED_TRANSBASIC_SETTUNER_NUM ED_BASE+613L - -#define ED_TRANSBASIC_SETTIMER_EVENT ED_BASE+614L -#define ED_TRANSBASIC_SETTIMER_STARTDAY ED_BASE+615L -#define ED_TRANSBASIC_SETTIMER_STARTTIME ED_BASE+616L -#define ED_TRANSBASIC_SETTIMER_STOPDAY ED_BASE+617L -#define ED_TRANSBASIC_SETTIMER_STOPTIME ED_BASE+618L - -// IAMExtTransport video parameters -#define ED_TRANSVIDEO_SET_OUTPUT ED_BASE+630L // can be one of the following: -#define ED_E2E ED_BASE+631L -#define ED_PLAYBACK ED_BASE+632L -#define ED_OFF ED_BASE+633L - -#define ED_TRANSVIDEO_SET_SOURCE ED_BASE+634L - -// IAMExtTransport audio parameters -#define ED_TRANSAUDIO_ENABLE_OUTPUT ED_BASE+640L // can be the following: -#define ED_AUDIO_ALL 0x10000000 // or any of the following OR'd together -#define ED_AUDIO_1 0x0000001L -#define ED_AUDIO_2 0x0000002L -#define ED_AUDIO_3 0x0000004L -#define ED_AUDIO_4 0x0000008L -#define ED_AUDIO_5 0x0000010L -#define ED_AUDIO_6 0x0000020L -#define ED_AUDIO_7 0x0000040L -#define ED_AUDIO_8 0x0000080L -#define ED_AUDIO_9 0x0000100L -#define ED_AUDIO_10 0x0000200L -#define ED_AUDIO_11 0x0000400L -#define ED_AUDIO_12 0x0000800L -#define ED_AUDIO_13 0x0001000L -#define ED_AUDIO_14 0x0002000L -#define ED_AUDIO_15 0x0004000L -#define ED_AUDIO_16 0x0008000L -#define ED_AUDIO_17 0x0010000L -#define ED_AUDIO_18 0x0020000L -#define ED_AUDIO_19 0x0040000L -#define ED_AUDIO_20 0x0080000L -#define ED_AUDIO_21 0x0100000L -#define ED_AUDIO_22 0x0200000L -#define ED_AUDIO_23 0x0400000L -#define ED_AUDIO_24 0x0800000L -#define ED_VIDEO 0x2000000L // for Edit props below - -#define ED_TRANSAUDIO_ENABLE_RECORD ED_BASE+642L -#define ED_TRANSAUDIO_ENABLE_SELSYNC ED_BASE+643L -#define ED_TRANSAUDIO_SET_SOURCE ED_BASE+644L -#define ED_TRANSAUDIO_SET_MONITOR ED_BASE+645L - - -// Edit Property Set-related defs - -// The following values reflect (and control) the state of an -// edit property set -#define ED_INVALID ED_BASE+652L -#define ED_EXECUTING ED_BASE+653L -#define ED_REGISTER ED_BASE+654L -#define ED_DELETE ED_BASE+655L - -// Edit property set parameters and values -#define ED_EDIT_HEVENT ED_BASE+656L // event handle to signal event - // completion -#define ED_EDIT_TEST ED_BASE+657L // returns OAFALSE if filter thinks - // edit can be done, OATRUE if not -#define ED_EDIT_IMMEDIATE ED_BASE+658L // OATRUE means start put the - // device into edit mode (editing - // "on the fly") immediately upon - // execution of Mode(ED_MODE_EDIT_CUE) -#define ED_EDIT_MODE ED_BASE+659L -// can be one of the following values: -#define ED_EDIT_MODE_ASSEMBLE ED_BASE+660L -#define ED_EDIT_MODE_INSERT ED_BASE+661L -#define ED_EDIT_MODE_CRASH_RECORD ED_BASE+662L -#define ED_EDIT_MODE_BOOKMARK_TIME ED_BASE+663L // these two are for -#define ED_EDIT_MODE_BOOKMARK_CHAPTER ED_BASE+664L // laserdisks - -#define ED_EDIT_MASTER ED_BASE+666L // OATRUE causes device - // not to synchronize - -#define ED_EDIT_TRACK ED_BASE+667L -// can be one of the following possible OR'd values: -// ED_VIDEO, ED_AUDIO_1 thru ED_AUDIO_24 (or ED_AUDIO_ALL) - -#define ED_EDIT_SRC_INPOINT ED_BASE+668L // in current time format -#define ED_EDIT_SRC_OUTPOINT ED_BASE+669L // in current time format -#define ED_EDIT_REC_INPOINT ED_BASE+670L // in current time format -#define ED_EDIT_REC_OUTPOINT ED_BASE+671L // in current time format - -#define ED_EDIT_REHEARSE_MODE ED_BASE+672L -// can be one of the following possible values: -#define ED_EDIT_BVB ED_BASE+673L // means rehearse the edit with - // "black-video-black" -#define ED_EDIT_VBV ED_BASE+674L -#define ED_EDIT_VVV ED_BASE+675L -#define ED_EDIT_PERFORM ED_BASE+676L // means perform the edit with no - // rehearsal. - -// Set this property to OATRUE to kill the edit if in progress -#define ED_EDIT_ABORT ED_BASE+677L -// how long to wait for edit to complete -#define ED_EDIT_TIMEOUT ED_BASE+678L // in current time format - -// This property causes the device to seek to a point specified by -// ED_EDIT_SEEK_MODE (see below). NOTE: Only one event at a time can seek. -#define ED_EDIT_SEEK ED_BASE+679L // OATRUE means do it now. -#define ED_EDIT_SEEK_MODE ED_BASE+680L -//possible values: -#define ED_EDIT_SEEK_EDIT_IN ED_BASE+681L // seek to edit's inpoint -#define ED_EDIT_SEEK_EDIT_OUT ED_BASE+682L // seek to edit's outpoint -#define ED_EDIT_SEEK_PREROLL ED_BASE+683L // seek to edit's - // inpoint-preroll -#define ED_EDIT_SEEK_PREROLL_CT ED_BASE+684L // seek to preroll point - // using control track (used for tapes with - // discontinuoustimecode before edit point: seek - // to inpoint using timecode, then backup to - // preroll point using control track) -#define ED_EDIT_SEEK_BOOKMARK ED_BASE+685L // seek to bookmark (just like - // timecode search) -// This property is used for multiple-VCR systems where each machine must -// cue to a different location relative to the graph's reference clock. The -// basic idea is that an edit event is setup with an ED_EDIT_OFFSET property -// that tells the VCR what offset to maintain between it's timecode (converted -// to reference clock units) and the reference clock. -#define ED_EDIT_OFFSET ED_BASE+686L // in current time format - -#define ED_EDIT_PREREAD ED_BASE+815L // OATRUE means device supports - // pre-read (recorder can also be - // player - -// -// Some error codes: -// -// device could be in local mode -#define ED_ERR_DEVICE_NOT_READY ED_BASE+700L - - - - - - -// ************************************************** -// -// New constants added for implementation of DVCR -// -// ************************************************** - - -// -// New Device type (a DV has two subunits: camera and VCR) -// -#define ED_DEVTYPE_CAMERA ED_BASE+900L - -#define ED_DEVTYPE_TUNER ED_BASE+901L - -#define ED_DEVTYPE_DVHS ED_BASE+902L - -#define ED_DEVTYPE_UNKNOWN ED_BASE+903L - -// -// Unknownn capability -// Instead of return E_NOTIMPL, or S_OK with OAFALSE, it may return S_OK with _UNKNOWN -// -#define ED_CAPABILITY_UNKNOWN ED_BASE+910L - - -// -// Send RAW extenal device command via Get/SetTransportBasicParameters() -// -#define ED_RAW_EXT_DEV_CMD ED_BASE+920L - - -// -// MEDIUM INFO -// -#define ED_MEDIA_VHSC ED_BASE+925L // New media type -#define ED_MEDIA_UNKNOWN ED_BASE+926L // Unknown media -#define ED_MEDIA_NOT_PRESENT ED_BASE+927L - - -// -// Device Control command that can result in pending state. -// -#define ED_CONTROL_HEVENT_GET ED_BASE+928L // To get a sychronous event handle -#define ED_CONTROL_HEVENT_RELEASE ED_BASE+929L // To release sychronous event handle must match what it got - -#define ED_DEV_REMOVED_HEVENT_GET ED_BASE+960L // To be a notify event and will be signal if device is removed. -#define ED_DEV_REMOVED_HEVENT_RELEASE ED_BASE+961L // Release this event handle - - -// -// TRANSPORT STATE -// -#define ED_NOTIFY_HEVENT_GET ED_BASE+930L // To get a sychronous event handle -#define ED_NOTIFY_HEVENT_RELEASE ED_BASE+931L // To release sychronous event handle must match what it got -#define ED_MODE_CHANGE_NOTIFY ED_BASE+932L // This is asynchronous operation, wait for event. - -#define ED_MODE_PLAY_FASTEST_FWD ED_BASE+933L -#define ED_MODE_PLAY_SLOWEST_FWD ED_BASE+934L -#define ED_MODE_PLAY_FASTEST_REV ED_BASE+935L -#define ED_MODE_PLAY_SLOWEST_REV ED_BASE+936L - -#define ED_MODE_WIND ED_BASE+937L -#define ED_MODE_REW_FASTEST ED_BASE+938L // High speed rewind - -#define ED_MODE_REV_PLAY ED_BASE+939L // x1 speed reverse play - - - -// -// TRANSPOSRTBASIC: input and output signal -// -#define ED_TRANSBASIC_INPUT_SIGNAL ED_BASE+940L -#define ED_TRANSBASIC_OUTPUT_SIGNAL ED_BASE+941L - -#define ED_TRANSBASIC_SIGNAL_525_60_SD ED_BASE+942L -#define ED_TRANSBASIC_SIGNAL_525_60_SDL ED_BASE+943L -#define ED_TRANSBASIC_SIGNAL_625_50_SD ED_BASE+944L -#define ED_TRANSBASIC_SIGNAL_625_50_SDL ED_BASE+945L - -#define ED_TRANSBASIC_SIGNAL_625_60_HD ED_BASE+947L -#define ED_TRANSBASIC_SIGNAL_625_50_HD ED_BASE+948L - -#define ED_TRANSBASIC_SIGNAL_MPEG2TS ED_BASE+946L - -#define ED_TRANSBASIC_SIGNAL_2500_60_MPEG ED_BASE+980L -#define ED_TRANSBASIC_SIGNAL_1250_60_MPEG ED_BASE+981L -#define ED_TRANSBASIC_SIGNAL_0625_60_MPEG ED_BASE+982L - -#define ED_TRANSBASIC_SIGNAL_2500_50_MPEG ED_BASE+985L -#define ED_TRANSBASIC_SIGNAL_1250_50_MPEG ED_BASE+986L -#define ED_TRANSBASIC_SIGNAL_0625_50_MPEG ED_BASE+987L - -#define ED_TRANSBASIC_SIGNAL_UNKNOWN ED_BASE+990L - -// -// TIMECODE/AbsoluteTrackNumber/RealTimeCounter read/seek/write -// -#define ED_DEVCAP_TIMECODE_SEEK ED_BASE+950L - -#define ED_DEVCAP_ATN_READ ED_BASE+951L -#define ED_DEVCAP_ATN_SEEK ED_BASE+952L -#define ED_DEVCAP_ATN_WRITE ED_BASE+953L - -#define ED_DEVCAP_RTC_READ ED_BASE+954L -#define ED_DEVCAP_RTC_SEEK ED_BASE+955L -#define ED_DEVCAP_RTC_WRITE ED_BASE+956L - -// -// Basic parameter -// -#define ED_TIMEREF_ATN ED_BASE+958L - - -// -// GUID used to identify a class driver -// - -#ifndef OUR_GUID_ENTRY - #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8); -#endif - -// 8C0F6AF2-0EDB-44c1-8AEB-59040BD830ED MSTapeDeviceGUID -OUR_GUID_ENTRY(MSTapeDeviceGUID, -0x8C0F6AF2, 0x0EDB, 0x44c1, 0x8A, 0xEB, 0x59, 0x04, 0x0B, 0xD8, 0x30, 0xED) - -#endif // __XPRTDEFS__ - -// eof XPrtDefs.h diff --git a/import/DirectX8/lib/DSETUP.lib b/import/DirectX8/lib/DSETUP.lib deleted file mode 100644 index b809eeb6a..000000000 Binary files a/import/DirectX8/lib/DSETUP.lib and /dev/null differ diff --git a/import/DirectX8/lib/LIBCI.lib b/import/DirectX8/lib/LIBCI.lib deleted file mode 100644 index 43313f105..000000000 Binary files a/import/DirectX8/lib/LIBCI.lib and /dev/null differ diff --git a/import/DirectX8/lib/amstrmid.lib b/import/DirectX8/lib/amstrmid.lib deleted file mode 100644 index 0dd0dee7d..000000000 Binary files a/import/DirectX8/lib/amstrmid.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3d8.lib b/import/DirectX8/lib/d3d8.lib deleted file mode 100644 index 828ed30d3..000000000 Binary files a/import/DirectX8/lib/d3d8.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dx.lib b/import/DirectX8/lib/d3dx.lib deleted file mode 100644 index 58bd072a2..000000000 Binary files a/import/DirectX8/lib/d3dx.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dx8.lib b/import/DirectX8/lib/d3dx8.lib deleted file mode 100644 index 79ffe8e72..000000000 Binary files a/import/DirectX8/lib/d3dx8.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dx8d.lib b/import/DirectX8/lib/d3dx8d.lib deleted file mode 100644 index e8a193475..000000000 Binary files a/import/DirectX8/lib/d3dx8d.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dx8dt.lib b/import/DirectX8/lib/d3dx8dt.lib deleted file mode 100644 index 9976dac9a..000000000 Binary files a/import/DirectX8/lib/d3dx8dt.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dxd.lib b/import/DirectX8/lib/d3dxd.lib deleted file mode 100644 index 752d41908..000000000 Binary files a/import/DirectX8/lib/d3dxd.lib and /dev/null differ diff --git a/import/DirectX8/lib/d3dxof.lib b/import/DirectX8/lib/d3dxof.lib deleted file mode 100644 index c7e517811..000000000 Binary files a/import/DirectX8/lib/d3dxof.lib and /dev/null differ diff --git a/import/DirectX8/lib/ddraw.lib b/import/DirectX8/lib/ddraw.lib deleted file mode 100644 index d7d0583e9..000000000 Binary files a/import/DirectX8/lib/ddraw.lib and /dev/null differ diff --git a/import/DirectX8/lib/dinput.lib b/import/DirectX8/lib/dinput.lib deleted file mode 100644 index 3abb45400..000000000 Binary files a/import/DirectX8/lib/dinput.lib and /dev/null differ diff --git a/import/DirectX8/lib/dmoguids.lib b/import/DirectX8/lib/dmoguids.lib deleted file mode 100644 index 89039a8fe..000000000 Binary files a/import/DirectX8/lib/dmoguids.lib and /dev/null differ diff --git a/import/DirectX8/lib/dplayx.lib b/import/DirectX8/lib/dplayx.lib deleted file mode 100644 index d8e429985..000000000 Binary files a/import/DirectX8/lib/dplayx.lib and /dev/null differ diff --git a/import/DirectX8/lib/dpnaddr.lib b/import/DirectX8/lib/dpnaddr.lib deleted file mode 100644 index 850aa9a61..000000000 Binary files a/import/DirectX8/lib/dpnaddr.lib and /dev/null differ diff --git a/import/DirectX8/lib/dpnet.lib b/import/DirectX8/lib/dpnet.lib deleted file mode 100644 index 73ac2a3aa..000000000 Binary files a/import/DirectX8/lib/dpnet.lib and /dev/null differ diff --git a/import/DirectX8/lib/dpnlobby.lib b/import/DirectX8/lib/dpnlobby.lib deleted file mode 100644 index dfdd2bb36..000000000 Binary files a/import/DirectX8/lib/dpnlobby.lib and /dev/null differ diff --git a/import/DirectX8/lib/dpvoice.lib b/import/DirectX8/lib/dpvoice.lib deleted file mode 100644 index bb3faf254..000000000 Binary files a/import/DirectX8/lib/dpvoice.lib and /dev/null differ diff --git a/import/DirectX8/lib/dxerr8.lib b/import/DirectX8/lib/dxerr8.lib deleted file mode 100644 index 5c329da2d..000000000 Binary files a/import/DirectX8/lib/dxerr8.lib and /dev/null differ diff --git a/import/DirectX8/lib/dxguid.lib b/import/DirectX8/lib/dxguid.lib deleted file mode 100644 index 72553507f..000000000 Binary files a/import/DirectX8/lib/dxguid.lib and /dev/null differ diff --git a/import/DirectX8/lib/dxtrans.lib b/import/DirectX8/lib/dxtrans.lib deleted file mode 100644 index 20a499523..000000000 Binary files a/import/DirectX8/lib/dxtrans.lib and /dev/null differ diff --git a/import/DirectX8/lib/ksproxy.lib b/import/DirectX8/lib/ksproxy.lib deleted file mode 100644 index 47f844fc2..000000000 Binary files a/import/DirectX8/lib/ksproxy.lib and /dev/null differ diff --git a/import/DirectX8/lib/ksuser.lib b/import/DirectX8/lib/ksuser.lib deleted file mode 100644 index 3f826cd7a..000000000 Binary files a/import/DirectX8/lib/ksuser.lib and /dev/null differ diff --git a/import/DirectX8/lib/msdmo.lib b/import/DirectX8/lib/msdmo.lib deleted file mode 100644 index 1714c3318..000000000 Binary files a/import/DirectX8/lib/msdmo.lib and /dev/null differ diff --git a/import/DirectX8/lib/qedit.lib b/import/DirectX8/lib/qedit.lib deleted file mode 100644 index 97bbe51bc..000000000 Binary files a/import/DirectX8/lib/qedit.lib and /dev/null differ diff --git a/import/DirectX8/lib/quartz.lib b/import/DirectX8/lib/quartz.lib deleted file mode 100644 index a4816e018..000000000 Binary files a/import/DirectX8/lib/quartz.lib and /dev/null differ diff --git a/import/DirectX8/lib/strmiids.lib b/import/DirectX8/lib/strmiids.lib deleted file mode 100644 index 0dd0dee7d..000000000 Binary files a/import/DirectX8/lib/strmiids.lib and /dev/null differ diff --git a/import/DirectX8/readme.txt b/import/DirectX8/readme.txt deleted file mode 100644 index eba46e2f7..000000000 --- a/import/DirectX8/readme.txt +++ /dev/null @@ -1 +0,0 @@ -These files were taken from the MechCommander2 Source code distribution and are property of Microsoft Corporation. \ No newline at end of file diff --git a/import/DirectX9/include/DxErr.h b/import/DirectX9/include/DxErr.h index 2bd759119..e69de29bb 100644 --- a/import/DirectX9/include/DxErr.h +++ b/import/DirectX9/include/DxErr.h @@ -1,99 +0,0 @@ -/*==========================================================================; - * - * - * File: dxerr.h - * Content: DirectX Error Library Include File - * - ****************************************************************************/ - -#ifndef _DXERR_H_ -#define _DXERR_H_ - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -// -// DXGetErrorString -// -// Desc: Converts a DirectX HRESULT to a string -// -// Args: HRESULT hr Can be any error code from -// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW -// -// Return: Converted string -// -const char* WINAPI DXGetErrorStringA(__in HRESULT hr); -const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr); - -#ifdef UNICODE -#define DXGetErrorString DXGetErrorStringW -#else -#define DXGetErrorString DXGetErrorStringA -#endif - - -// -// DXGetErrorDescription -// -// Desc: Returns a string description of a DirectX HRESULT -// -// Args: HRESULT hr Can be any error code from -// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW -// -// Return: String description -// -const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr); -const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr); - -#ifdef UNICODE - #define DXGetErrorDescription DXGetErrorDescriptionW -#else - #define DXGetErrorDescription DXGetErrorDescriptionA -#endif - - -// -// DXTrace -// -// Desc: Outputs a formatted error message to the debug stream -// -// Args: CHAR* strFile The current file, typically passed in using the -// __FILE__ macro. -// DWORD dwLine The current line number, typically passed in using the -// __LINE__ macro. -// HRESULT hr An HRESULT that will be traced to the debug stream. -// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) -// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. -// -// Return: The hr that was passed in. -// -HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox ); -HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox ); - -#ifdef UNICODE -#define DXTrace DXTraceW -#else -#define DXTrace DXTraceA -#endif - - -// -// Helper macros -// -#if defined(DEBUG) | defined(_DEBUG) -#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) -#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) -#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) -#else -#define DXTRACE_MSG(str) (0L) -#define DXTRACE_ERR(str,hr) (hr) -#define DXTRACE_ERR_MSGBOX(str,hr) (hr) -#endif - - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif // _DXERR_H_ diff --git a/import/DirectX8/include/dxerr8.h b/import/DirectX9/include/dxerr9.h similarity index 58% rename from import/DirectX8/include/dxerr8.h rename to import/DirectX9/include/dxerr9.h index f79c71f36..3fc6fba30 100644 --- a/import/DirectX8/include/dxerr8.h +++ b/import/DirectX9/include/dxerr9.h @@ -1,55 +1,55 @@ /*==========================================================================; * * - * File: dxerr8.h + * File: dxerr9.h * Content: DirectX Error Library Include File * ****************************************************************************/ -#ifndef _DXERR8_H_ -#define _DXERR8_H_ +#ifndef _DXERR9_H_ +#define _DXERR9_H_ #ifdef __cplusplus extern "C" { #endif //__cplusplus // -// DXGetErrorString8 +// DXGetErrorString9 // -// Desc: Converts a DirectX HRESULT to a string +// Desc: Converts a DirectX 9 or earlier HRESULT to a string // // Args: HRESULT hr Can be any error code from -// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW // // Return: Converted string // -const char* WINAPI DXGetErrorString8A(HRESULT hr); -const WCHAR* WINAPI DXGetErrorString8W(HRESULT hr); +const char* WINAPI DXGetErrorString9A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorString9W(HRESULT hr); #ifdef UNICODE -#define DXGetErrorString8 DXGetErrorString8W +#define DXGetErrorString9 DXGetErrorString9W #else -#define DXGetErrorString8 DXGetErrorString8A +#define DXGetErrorString9 DXGetErrorString9A #endif // -// DXGetErrorDescription8 +// DXGetErrorDescription9 // -// Desc: Returns a string description of a DirectX HRESULT +// Desc: Returns a string description of a DirectX 9 or earlier HRESULT // // Args: HRESULT hr Can be any error code from -// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW // // Return: String description // -const char* WINAPI DXGetErrorDescription8A(HRESULT hr); -const WCHAR* WINAPI DXGetErrorDescription8W(HRESULT hr); +const char* WINAPI DXGetErrorDescription9A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr); #ifdef UNICODE - #define DXGetErrorDescription8 DXGetErrorDescription8W + #define DXGetErrorDescription9 DXGetErrorDescription9W #else - #define DXGetErrorDescription8 DXGetErrorDescription8A + #define DXGetErrorDescription9 DXGetErrorDescription9A #endif @@ -68,8 +68,8 @@ const WCHAR* WINAPI DXGetErrorDescription8W(HRESULT hr); // // Return: The hr that was passed in. // -HRESULT WINAPI DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox ); -HRESULT WINAPI DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox ); #ifdef UNICODE #define DXTrace DXTraceW @@ -83,12 +83,12 @@ HRESULT WINAPI DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, // #if defined(DEBUG) | defined(_DEBUG) #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) -#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) -#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) +#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) +#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) #else #define DXTRACE_MSG(str) (0L) #define DXTRACE_ERR(str,hr) (hr) -#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) +#define DXTRACE_ERR_MSGBOX(str,hr) (hr) #endif @@ -96,5 +96,5 @@ HRESULT WINAPI DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, } #endif //__cplusplus -#endif // _DXERR8_H_ +#endif // _DXERR9_H_ diff --git a/import/DirectX9/lib/DxErr9.lib b/import/DirectX9/lib/DxErr9.lib new file mode 100644 index 000000000..b08af851e Binary files /dev/null and b/import/DirectX9/lib/DxErr9.lib differ diff --git a/import/DirectX9/lib/d3dx9.lib b/import/DirectX9/lib/d3dx9.lib new file mode 100644 index 000000000..b2397bcbd Binary files /dev/null and b/import/DirectX9/lib/d3dx9.lib differ diff --git a/import/OpenXDK/include/xboxkrnl/kernel.h b/import/OpenXDK/include/xboxkrnl/kernel.h index a1c73a9a6..cc1624385 100644 --- a/import/OpenXDK/include/xboxkrnl/kernel.h +++ b/import/OpenXDK/include/xboxkrnl/kernel.h @@ -249,7 +249,7 @@ XBSYSAPI EXPORTNUM(119) BOOLEAN NTAPI KeInsertQueueDpc // ****************************************************************** // * 0x0078 - KeInterruptTime // ****************************************************************** -XBSYSAPI EXPORTNUM(120) PKSYSTEM_TIME KeInterruptTime; +XBSYSAPI EXPORTNUM(120) KSYSTEM_TIME KeInterruptTime; // ****************************************************************** // * 0x0079 - KeIsExecutingDpc() @@ -490,7 +490,7 @@ XBSYSAPI EXPORTNUM(153) BOOLEAN NTAPI KeSynchronizeExecution // ****************************************************************** // * 0x009A - KeSystemTime // ****************************************************************** -XBSYSAPI EXPORTNUM(154) PKSYSTEM_TIME KeSystemTime; +XBSYSAPI EXPORTNUM(154) KSYSTEM_TIME KeSystemTime; // ****************************************************************** // * 0x009B - KeTestAlertThread() diff --git a/import/OpenXDK/include/xboxkrnl/xbox.h b/import/OpenXDK/include/xboxkrnl/xbox.h index 90b09d86e..322b7a6cb 100644 --- a/import/OpenXDK/include/xboxkrnl/xbox.h +++ b/import/OpenXDK/include/xboxkrnl/xbox.h @@ -412,7 +412,43 @@ XBSYSAPI EXPORTNUM(350) ULONG NTAPI XcCryptService IN PVOID pArgs ); -typedef PVOID PCRYPTO_VECTOR; // TODO : Expand +/* Function pointers which point to all the kernel crypto functions. Used by PCRYPTO_VECTOR. */ +typedef VOID(NTAPI *pfXcSHAInit)(PUCHAR pbSHAContext); +typedef VOID(NTAPI *pfXcSHAUpdate)(PUCHAR pbSHAContext, PUCHAR pbInput, ULONG dwInputLength); +typedef VOID(NTAPI *pfXcSHAFinal)(PUCHAR pbSHAContext, PUCHAR pbDigest); +typedef VOID(NTAPI *pfXcRC4Key)(PUCHAR pbKeyStruct, ULONG dwKeyLength, PUCHAR pbKey); +typedef VOID(NTAPI *pfXcRC4Crypt)(PUCHAR pbKeyStruct, ULONG dwInputLength, PUCHAR pbInput); +typedef VOID(NTAPI *pfXcHMAC)(PBYTE pbKeyMaterial, ULONG cbKeyMaterial, PBYTE pbData, ULONG cbData, PBYTE pbData2, ULONG cbData2, PBYTE HmacData); +typedef ULONG(NTAPI *pfXcPKEncPublic)(PUCHAR pbPubKey, PUCHAR pbInput, PUCHAR pbOutput); +typedef ULONG(NTAPI *pfXcPKDecPrivate)(PUCHAR pbPrvKey, PUCHAR pbInput, PUCHAR pbOutput); +typedef ULONG(NTAPI *pfXcPKGetKeyLen)(PUCHAR pbPubKey); +typedef BOOLEAN(NTAPI *pfXcVerifyPKCS1Signature)(PUCHAR pbSig, PUCHAR pbPubKey, PUCHAR pbDigest); +typedef ULONG(NTAPI *pfXcModExp)(LPDWORD pA, LPDWORD pB, LPDWORD pC, LPDWORD pD, ULONG dwN); +typedef VOID(NTAPI *pfXcDESKeyParity)(PUCHAR pbKey, ULONG dwKeyLength); +typedef VOID(NTAPI *pfXcKeyTable)(ULONG dwCipher, PUCHAR pbKeyTable, PUCHAR pbKey); +typedef VOID(NTAPI *pfXcBlockCrypt)(ULONG dwCipher, PUCHAR pbOutput, PUCHAR pbInput, PUCHAR pbKeyTable, ULONG dwOp); +typedef VOID(NTAPI *pfXcBlockCryptCBC)(ULONG dwCipher, ULONG dwInputLength, PUCHAR pbOutput, PUCHAR pbInput, PUCHAR pbKeyTable, ULONG dwOp, PUCHAR pbFeedback); +typedef ULONG(NTAPI *pfXcCryptService)(ULONG dwOp, PVOID pArgs); + +/* Struct which contains all the pointers to the crypto functions */ +typedef struct { + pfXcSHAInit pXcSHAInit; + pfXcSHAUpdate pXcSHAUpdate; + pfXcSHAFinal pXcSHAFinal; + pfXcRC4Key pXcRC4Key; + pfXcRC4Crypt pXcRC4Crypt; + pfXcHMAC pXcHMAC; + pfXcPKEncPublic pXcPKEncPublic; + pfXcPKDecPrivate pXcPKDecPrivate; + pfXcPKGetKeyLen pXcPKGetKeyLen; + pfXcVerifyPKCS1Signature pXcVerifyPKCS1Signature; + pfXcModExp pXcModExp; + pfXcDESKeyParity pXcDESKeyParity; + pfXcKeyTable pXcKeyTable; + pfXcBlockCrypt pXcBlockCrypt; + pfXcBlockCryptCBC pXcBlockCryptCBC; + pfXcCryptService pXcCryptService; +} CRYPTO_VECTOR, *PCRYPTO_VECTOR; // ****************************************************************** // * 0x015F - XcUpdateCrypto() @@ -440,11 +476,14 @@ XBSYSAPI EXPORTNUM(354) XBOX_KEY_DATA XboxAlternateSignatureKeys[ALTERNATE_SIGNA // * 0x0163 - XePublicKeyData // ****************************************************************** XBSYSAPI EXPORTNUM(355) UCHAR XePublicKeyData[284]; +XBSYSAPI EXPORTNUM(355) UCHAR XePublicKeyDataRetail[284]; +XBSYSAPI EXPORTNUM(355) UCHAR XePublicKeyDataChihiroGame[284]; +XBSYSAPI EXPORTNUM(355) UCHAR XePublicKeyDataChihiroBoot[284]; // ****************************************************************** // * 0x0165 - IdexChannelObject // ****************************************************************** -XBSYSAPI EXPORTNUM(357) BYTE IdexChannelObject[0x100]; +XBSYSAPI EXPORTNUM(357) IDE_CHANNEL_OBJECT IdexChannelObject; // ****************************************************************** // * 0x0169 - RtlSnprintf() @@ -525,5 +564,3 @@ XBSYSAPI EXPORTNUM(373) NTSTATUS NTAPI IrtSweep // PROFILING ); #endif - - diff --git a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h index 9386c89e9..6bb308ec4 100644 --- a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h +++ b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h @@ -12,11 +12,6 @@ #ifndef XBOXKRNL_H #define XBOXKRNL_H -#if defined(__cplusplus) -extern "C" -{ -#endif - // ****************************************************************** // * dll import/export // ****************************************************************** @@ -27,19 +22,9 @@ extern "C" // ****************************************************************** // * kernel exports, others either import or link locally // ****************************************************************** -#define XBSYSAPI DECLSPEC_IMPORT - -#ifdef _XBOXKRNL_INTERNAL_ -#undef XBSYSAPI -#define XBSYSAPI DECLSPEC_EXPORT -#define KRNL(API) API -#endif -#ifdef _XBOXKRNL_DEFEXTRN_ -#undef XBSYSAPI #define XBSYSAPI DECLSPEC_EXTERN // The KRNL macro prevents naming collisions #define KRNL(API) KRNL##API -#endif #define RESTRICTED_POINTER //TODO : When #define RESTRICTED_POINTER __restrict @@ -149,6 +134,8 @@ typedef long NTSTATUS; #define NT_SUCCESS(Status) ((NTSTATUS) (Status) >= 0) #define STATUS_SUCCESS ((DWORD )0x00000000L) +#define STATUS_ABANDONED ((DWORD )0x00000080L) +#define STATUS_MUTANT_LIMIT_EXCEEDED ((DWORD )0xC0000191L) #ifndef STATUS_PENDING #define STATUS_PENDING ((DWORD )0x00000103L) #endif @@ -183,6 +170,7 @@ typedef long NTSTATUS; // * Registry value types // ****************************************************************** // Used in ExQueryNonVolatileSetting and ExSaveNonVolatileSetting +#ifndef _WIN32 // Avoid "warning C4005: 'REG_NONE': macro redefinition" (conflicting with winnt.h) #define REG_NONE ( 0 ) // No defined value type. #define REG_SZ ( 1 ) // A null - terminated string. This will be either a Unicode or an ANSI string, depending on whether you use the Unicode or ANSI functions. #define REG_EXPAND_SZ ( 2 ) // A null - terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions. To expand the environment variable references, use the ExpandEnvironmentStrings function. @@ -195,6 +183,7 @@ typedef long NTSTATUS; #define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map #define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description #define REG_RESOURCE_REQUIREMENTS_LIST ( 10 ) +#endif // ****************************************************************** // * calling conventions @@ -352,56 +341,6 @@ typedef struct _LIST_ENTRY } LIST_ENTRY, *PLIST_ENTRY; -// See the links below for the details about the kernel structure LIST_ENTRY and the related functions -// https://www.codeproject.com/Articles/800404/Understanding-LIST-ENTRY-Lists-and-Its-Importance -// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/singly-and-doubly-linked-lists - -#define LIST_ENTRY_DEFINE_HEAD(ListHead) xboxkrnl::LIST_ENTRY (ListHead) = { &(ListHead), &(ListHead) } - -#define LIST_ENTRY_INITIALIZE_HEAD(ListHead) ((ListHead)->Flink = (ListHead)->Blink = (ListHead)) - -#define LIST_ENTRY_INITIALIZE(ListEntry) ((ListEntry)->Flink = (ListEntry)->Blink = nullptr) - -#define LIST_ENTRY_ACCESS_RECORD(address, type, field) \ -((type*)((UCHAR*)(address) - (ULONG)(&((type*)0)->field))) - -#define IS_LIST_EMPTY(ListHead) ((ListHead)->Flink == (ListHead)) - -#define LIST_ENTRY_INSERT_HEAD(ListHead, Entry) {\ -xboxkrnl::PLIST_ENTRY Flink;\ -Flink = (ListHead)->Flink;\ -(Entry)->Flink = Flink;\ -(Entry)->Blink = (ListHead);\ -(Flink)->Blink = Entry;\ -(ListHead)->Flink = Entry;\ -} - -#define LIST_ENTRY_INSERT_TAIL(ListHead, Entry) {\ -xboxkrnl::PLIST_ENTRY Blink;\ -Blink = (ListHead)->Blink;\ -(Entry)->Flink = ListHead;\ -(Entry)->Blink = Blink;\ -(Blink)->Flink = Entry;\ -(ListHead)->Blink = Entry;\ -} - -#define LIST_ENTRY_REMOVE(Entry) {\ -xboxkrnl::PLIST_ENTRY ExFlink;\ -xboxkrnl::PLIST_ENTRY ExBlink;\ -ExFlink = (Entry)->Flink;\ -ExBlink = (Entry)->Blink;\ -(ExFlink)->Blink = ExBlink;\ -(ExBlink)->Flink = ExFlink;\ -} - -#define LIST_ENTRY_REMOVE_AT_HEAD(ListHead) \ -(ListHead)->Flink;\ -LIST_ENTRY_REMOVE((ListHead)->Flink) - -#define REMOVE_HEAD_LIST(ListHead) \ -(ListHead)->Flink;\ -{LIST_ENTRY_REMOVE((ListHead)->Flink)} - // ****************************************************************** // * SLIST_ENTRY // ****************************************************************** @@ -1589,6 +1528,17 @@ typedef struct _KDPC } KDPC, *PKDPC; +// ****************************************************************** +// * DPC queue entry structure +// ****************************************************************** +typedef struct _DPC_QUEUE_ENTRY +{ + PKDPC Dpc; + PKDEFERRED_ROUTINE Routine; + PVOID Context; +} +DPC_QUEUE_ENTRY, *PDPC_QUEUE_ENTRY; + // ****************************************************************** // * KFLOATING_SAVE // ****************************************************************** @@ -1607,14 +1557,17 @@ typedef struct _KFLOATING_SAVE } KFLOATING_SAVE, *PKFLOATING_SAVE; +#define DISPATCHER_OBJECT_TYPE_MASK 0x7 // ****************************************************************** // * KOBJECTS // ****************************************************************** typedef enum _KOBJECTS { + EventSynchronizationObject = 1, MutantObject = 2, QueueObject = 4, SemaphoreObject = 5, + ThreadObject = 6, TimerNotificationObject = 8, TimerSynchronizationObject = 9, ApcObject = 0x12, @@ -1683,12 +1636,17 @@ KINTERRUPT_MODE; // ****************************************************************** // * IRQ (Interrupt ReQuest) Priority Levels // ****************************************************************** -#define PASSIVE_LEVEL 0 -#define APC_LEVEL 1 +#define PASSIVE_LEVEL 0 +#define APC_LEVEL 1 #define DISPATCH_LEVEL 2 -#define PROFILE_LEVEL 26 -#define SYNC_LEVEL 28 -#define HIGH_LEVEL 31 +#define PROFILE_LEVEL 26 +#define CLOCK1_LEVEL 28 +#define CLOCK2_LEVEL 28 +#define SYNC_LEVEL 28 +#define IPI_LEVEL 29 +#define POWER_LEVEL 30 +#define HIGH_LEVEL 31 +#define CLOCK_LEVEL CLOCK2_LEVEL #define DISPATCH_SIZE 22 @@ -1737,7 +1695,7 @@ PS_STATISTICS, *PPS_STATISTICS; // ****************************************************************** typedef struct _RTL_CRITICAL_SECTION { - DWORD Unknown[4]; // 0x00 + DISPATCHER_HEADER Event; // 0x00 LONG LockCount; // 0x10 LONG RecursionCount; // 0x14 HANDLE OwningThread; // 0x18 @@ -1870,11 +1828,9 @@ EXCEPTION_DISPOSITION, *PEXCEPTION_DISPOSITION; // ****************************************************************** // * EXCEPTION_REGISTRATION_RECORD // ****************************************************************** -typedef struct _EXCEPTION_REGISTRATION_RECORD *PEXCEPTION_REGISTRATION_RECORD; // forward - typedef struct _EXCEPTION_REGISTRATION_RECORD { - PEXCEPTION_REGISTRATION_RECORD Next; + struct _EXCEPTION_REGISTRATION_RECORD *Next; // Don't forward declare PEXCEPTION_REGISTRATION_RECORD to avoid conflict with winnt.h PEXCEPTION_DISPOSITION Handler; } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD; @@ -1991,7 +1947,7 @@ typedef struct _KTHREAD /* 0x55/85 */ CHAR WaitMode; /* 0x56/86 */ CHAR WaitNext; /* 0x57/87 */ CHAR WaitReason; - /* 0x58/88 */ PVOID WaitBlockList; + /* 0x58/88 */ PKWAIT_BLOCK WaitBlockList; /* 0x5C/92 */ LIST_ENTRY WaitListEntry; /* 0x64/100 */ ULONG WaitTime; /* 0x68/104 */ ULONG KernelApcDisable; @@ -2612,46 +2568,43 @@ typedef struct _DISK_GEOMETRY { DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; -// This is modeled around the Windows definition -typedef struct _FLOATING_SAVE_AREA { - DWORD ControlWord; - DWORD StatusWord; - DWORD TagWord; - DWORD ErrorOffset; - DWORD ErrorSelector; - DWORD DataOffset; - DWORD DataSelector; - BYTE RegisterArea[80]; - DWORD Cr0NpxState; -} FLOATING_SAVE_AREA; +// From nxdk +#pragma pack(push, 1) +typedef struct _FLOATING_SAVE_AREA +{ + WORD ControlWord; + WORD StatusWord; + WORD TagWord; + WORD ErrorOpcode; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + DWORD MXCsr; + DWORD Reserved2; + BYTE RegisterArea[128]; + BYTE XmmRegisterArea[128]; + BYTE Reserved4[224]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA; +#pragma pack(pop) -// This is modeled around the Windows definition -typedef struct _CONTEXT { - DWORD ContextFlags; - DWORD Dr0; - DWORD Dr1; - DWORD Dr2; - DWORD Dr3; - DWORD Dr6; - DWORD Dr7; - FLOATING_SAVE_AREA FloatSave; - DWORD SegGs; - DWORD SegFs; - DWORD SegEs; - DWORD SegDs; - DWORD Edi; - DWORD Esi; - DWORD Ebx; - DWORD Edx; - DWORD Ecx; - DWORD Eax; - DWORD Ebp; - DWORD Eip; - DWORD SegCs; - DWORD EFlags; - DWORD Esp; - DWORD SegSs; - BYTE ExtendedRegisters[512]; +typedef struct _CONTEXT +{ + DWORD ContextFlags; // 0x00 + FLOATING_SAVE_AREA FloatSave; // 0x04 + DWORD Edi; // 0x208 + DWORD Esi; // 0x20C + DWORD Ebx; // 0x210 + DWORD Edx; // 0x214 + DWORD Ecx; // 0x218 + DWORD Eax; // 0x21C + DWORD Ebp; // 0x220 + DWORD Eip; // 0x224 + DWORD SegCs; // 0x228 + DWORD EFlags; // 0x22C + DWORD Esp; // 0x230 + DWORD SegSs; // 0x234 } CONTEXT, *PCONTEXT; // This is modeled around the Windows definition @@ -2659,6 +2612,45 @@ typedef struct _IO_COMPLETION_BASIC_INFORMATION { LONG Depth; } IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION; +typedef VOID(*PIDE_INTERRUPT_ROUTINE) (void); + +typedef VOID(*PIDE_FINISHIO_ROUTINE) (void); + +typedef BOOLEAN(*PIDE_POLL_RESET_COMPLETE_ROUTINE) (void); + +typedef VOID(*PIDE_TIMEOUT_EXPIRED_ROUTINE) (void); + +typedef VOID(*PIDE_START_PACKET_ROUTINE) ( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp +); + +typedef VOID(*PIDE_START_NEXT_PACKET_ROUTINE) (void); + +typedef struct _IDE_CHANNEL_OBJECT +{ + PIDE_INTERRUPT_ROUTINE InterruptRoutine; + PIDE_FINISHIO_ROUTINE FinishIoRoutine; + PIDE_POLL_RESET_COMPLETE_ROUTINE PollResetCompleteRoutine; + PIDE_TIMEOUT_EXPIRED_ROUTINE TimeoutExpiredRoutine; + PIDE_START_PACKET_ROUTINE StartPacketRoutine; + PIDE_START_NEXT_PACKET_ROUTINE StartNextPacketRoutine; + KIRQL InterruptIrql; + BOOLEAN ExpectingBusMasterInterrupt; + BOOLEAN StartPacketBusy; + BOOLEAN StartPacketRequested; + UCHAR Timeout; + UCHAR IoRetries; + UCHAR MaximumIoRetries; + PIRP CurrentIrp; + KDEVICE_QUEUE DeviceQueue; + ULONG PhysicalRegionDescriptorTablePhysical; + KDPC TimerDpc; + KDPC FinishDpc; + KTIMER Timer; + KINTERRUPT InterruptObject; +} IDE_CHANNEL_OBJECT, *PIDE_CHANNEL_OBJECT; + // ****************************************************************** // * Debug // ****************************************************************** @@ -2714,10 +2706,6 @@ typedef struct _IO_COMPLETION_BASIC_INFORMATION { // ****************************************************************** #include "xbox.h" -#if defined(__cplusplus) -} -#endif - #endif diff --git a/import/SDL2 b/import/SDL2 new file mode 160000 index 000000000..c7b8b49ef --- /dev/null +++ b/import/SDL2 @@ -0,0 +1 @@ +Subproject commit c7b8b49ef8691ac85ad18298468f7e4a616290ed diff --git a/import/XbSymbolDatabase b/import/XbSymbolDatabase index 91f889af4..0f2794cac 160000 --- a/import/XbSymbolDatabase +++ b/import/XbSymbolDatabase @@ -1 +1 @@ -Subproject commit 91f889af47ac8d5650d8bd36da12614e7fc4b44c +Subproject commit 0f2794cac610fad4f1955241ef43e6254fd11205 diff --git a/import/cs_x86 b/import/cs_x86 index 78a78b2ac..7c491b6ef 160000 --- a/import/cs_x86 +++ b/import/cs_x86 @@ -1 +1 @@ -Subproject commit 78a78b2ac200b1f3dc383d2c387dac3f47f4451c +Subproject commit 7c491b6ef7e49c7f35dcdd39f99f1f5943e48e9e diff --git a/import/d3d8to9 b/import/d3d8to9 deleted file mode 160000 index c7236282d..000000000 --- a/import/d3d8to9 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c7236282d5c3f8ee871e26953cfdd2eeebe964cf diff --git a/import/libtomcrypt b/import/libtomcrypt new file mode 160000 index 000000000..7e7eb695d --- /dev/null +++ b/import/libtomcrypt @@ -0,0 +1 @@ +Subproject commit 7e7eb695d581782f04b24dc444cbfde86af59853 diff --git a/import/libtommath b/import/libtommath new file mode 160000 index 000000000..08549ad6b --- /dev/null +++ b/import/libtommath @@ -0,0 +1 @@ +Subproject commit 08549ad6bc8b0cede0b357a9c341c5c6473a9c55 diff --git a/import/simpleini b/import/simpleini new file mode 160000 index 000000000..2af65fcc5 --- /dev/null +++ b/import/simpleini @@ -0,0 +1 @@ +Subproject commit 2af65fcc504f8242752755e836709762ef7ce062 diff --git a/import/subhook b/import/subhook index e562d10d4..29cb47ea7 160000 --- a/import/subhook +++ b/import/subhook @@ -1 +1 @@ -Subproject commit e562d10d4d88f85a8b5475139c68696dfc6bf231 +Subproject commit 29cb47ea7674b36cf2b742c11cf2568add1f47fc diff --git a/import/winpcap/Include/Packet32.h b/import/winpcap/Include/Packet32.h new file mode 100644 index 000000000..64be055d9 --- /dev/null +++ b/import/winpcap/Include/Packet32.h @@ -0,0 +1,359 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2007 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/** @ingroup packetapi + * @{ + */ + +/** @defgroup packet32h Packet.dll definitions and data structures + * Packet32.h contains the data structures and the definitions used by packet.dll. + * The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included + * by the applications that use the functions of this library + * @{ + */ + +#ifndef __PACKET32 +#define __PACKET32 + +#include + +#ifdef HAVE_AIRPCAP_API +#include +#else +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ +typedef struct _AirpcapHandle *PAirpcapHandle; +#endif /* AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ */ +#endif /* HAVE_AIRPCAP_API */ + +#ifdef HAVE_DAG_API +#include +#endif /* HAVE_DAG_API */ + +// Working modes +#define PACKET_MODE_CAPT 0x0 ///< Capture mode +#define PACKET_MODE_STAT 0x1 ///< Statistical mode +#define PACKET_MODE_MON 0x2 ///< Monitoring mode +#define PACKET_MODE_DUMP 0x10 ///< Dump mode +#define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode + + +/// Alignment macro. Defines the alignment size. +#define Packet_ALIGNMENT sizeof(int) +/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. +#define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1)) + +#define NdisMediumNull -1 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumCHDLC -2 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumPPPSerial -3 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumBare80211 -4 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumRadio80211 -5 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumPpi -6 ///< Custom linktype: NDIS doesn't provide an equivalent + +// Loopback behaviour definitions +#define NPF_DISABLE_LOOPBACK 1 ///< Drop the packets sent by the NPF driver +#define NPF_ENABLE_LOOPBACK 2 ///< Capture the packets sent by the NPF driver + +/*! + \brief Network type structure. + + This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed. +*/ +typedef struct NetType +{ + UINT LinkType; ///< The MAC of the current network adapter (see function PacketGetNetType() for more information) + ULONGLONG LinkSpeed; ///< The speed of the network in bits per second +}NetType; + + +//some definitions stolen from libpcap + +#ifndef BPF_MAJOR_VERSION + +/*! + \brief A BPF pseudo-assembly program. + + The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. +*/ +struct bpf_program +{ + UINT bf_len; ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow. + struct bpf_insn *bf_insns; ///< A pointer to the first instruction of the program. +}; + +/*! + \brief A single BPF pseudo-instruction. + + bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver. +*/ +struct bpf_insn +{ + USHORT code; ///< Instruction type and addressing mode. + UCHAR jt; ///< Jump if true + UCHAR jf; ///< Jump if false + int k; ///< Generic field used for various purposes. +}; + +/*! + \brief Structure that contains a couple of statistics values on the current capture. + + It is used by packet.dll to return statistics about a capture session. +*/ +struct bpf_stat +{ + UINT bs_recv; ///< Number of packets that the driver received from the network adapter + ///< from the beginning of the current capture. This value includes the packets + ///< lost by the driver. + UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture. + ///< Basically, a packet is lost when the the buffer of the driver is full. + ///< In this situation the packet cannot be stored and the driver rejects it. + UINT ps_ifdrop; ///< drops by interface. XXX not yet supported + UINT bs_capt; ///< number of packets that pass the filter, find place in the kernel buffer and + ///< thus reach the application. +}; + +/*! + \brief Packet header. + + This structure defines the header associated with every packet delivered to the application. +*/ +struct bpf_hdr +{ + struct timeval bh_tstamp; ///< The timestamp associated with the captured packet. + ///< It is stored in a TimeVal structure. + UINT bh_caplen; ///< Length of captured portion. The captured portion can be different + ///< from the original packet, because it is possible (with a proper filter) + ///< to instruct the driver to capture only a portion of the packets. + UINT bh_datalen; ///< Original length of packet + USHORT bh_hdrlen; ///< Length of bpf header (this struct plus alignment padding). In some cases, + ///< a padding could be added between the end of this structure and the packet + ///< data for performance reasons. This filed can be used to retrieve the actual data + ///< of the packet. +}; + +/*! + \brief Dump packet header. + + This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets(). + It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a + packet in a dump file. This makes straightforward sending WinPcap dump files to the network. +*/ +struct dump_bpf_hdr{ + struct timeval ts; ///< Time stamp of the packet + UINT caplen; ///< Length of captured portion. The captured portion can smaller than the + ///< the original packet, because it is possible (with a proper filter) to + ///< instruct the driver to capture only a portion of the packets. + UINT len; ///< Length of the original packet (off wire). +}; + + +#endif + +struct bpf_stat; + +#define DOSNAMEPREFIX TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices +#define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links +#define NMAX_PACKET 65535 + +/*! + \brief Addresses of a network adapter. + + This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with + an adapter. +*/ +typedef struct npf_if_addr { + struct sockaddr_storage IPAddress; ///< IP address. + struct sockaddr_storage SubnetMask; ///< Netmask for that address. + struct sockaddr_storage Broadcast; ///< Broadcast address. +}npf_if_addr; + + +#define ADAPTER_NAME_LENGTH 256 + 12 ///< Maximum length for the name of an adapter. The value is the same used by the IP Helper API. +#define ADAPTER_DESC_LENGTH 128 ///< Maximum length for the description of an adapter. The value is the same used by the IP Helper API. +#define MAX_MAC_ADDR_LENGTH 8 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API. +#define MAX_NETWORK_ADDRESSES 16 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API. + + +typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API +typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API + +#define INFO_FLAG_NDIS_ADAPTER 0 ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter +#define INFO_FLAG_NDISWAN_ADAPTER 1 ///< Flag for ADAPTER_INFO: this is a NdisWan adapter, and it's managed by WANPACKET +#define INFO_FLAG_DAG_CARD 2 ///< Flag for ADAPTER_INFO: this is a DAG card +#define INFO_FLAG_DAG_FILE 6 ///< Flag for ADAPTER_INFO: this is a DAG file +#define INFO_FLAG_DONT_EXPORT 8 ///< Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones. +#define INFO_FLAG_AIRPCAP_CARD 16 ///< Flag for ADAPTER_INFO: this is an airpcap card +#define INFO_FLAG_NPFIM_DEVICE 32 + +/*! + \brief Describes an opened network adapter. + + This structure is the most important for the functioning of packet.dll, but the great part of its fields + should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters +*/ +typedef struct _ADAPTER { + HANDLE hFile; ///< \internal Handle to an open instance of the NPF driver. + CHAR SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened. + int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated + ///< on the wire. + HANDLE ReadEvent; ///< A notification event associated with the read calls on the adapter. + ///< It can be passed to standard Win32 functions (like WaitForSingleObject + ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some + ///< data. It is particularly useful in GUI applications that need to wait + ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy() + ///< function can be used to define the minimum amount of data in the kernel buffer + ///< that will cause the event to be signalled. + + UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and + ///< ReadEvent will be signaled, also if no packets were captured + CHAR Name[ADAPTER_NAME_LENGTH]; + PWAN_ADAPTER pWanAdapter; + UINT Flags; ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API. + +#ifdef HAVE_AIRPCAP_API + PAirpcapHandle AirpcapAd; +#endif // HAVE_AIRPCAP_API + +#ifdef HAVE_NPFIM_API + void* NpfImHandle; +#endif // HAVE_NPFIM_API + +#ifdef HAVE_DAG_API + dagc_t *pDagCard; ///< Pointer to the dagc API adapter descriptor for this adapter + PCHAR DagBuffer; ///< Pointer to the buffer with the packets that is received from the DAG card + struct timeval DagReadTimeout; ///< Read timeout. The dagc API requires a timeval structure + unsigned DagFcsLen; ///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry + DWORD DagFastProcess; ///< True if the user requests fast capture processing on this card. Higher level applications can use this value to provide a faster but possibly unprecise capture (for example, libpcap doesn't convert the timestamps). +#endif // HAVE_DAG_API +} ADAPTER, *LPADAPTER; + +/*! + \brief Structure that contains a group of packets coming from the driver. + + This structure defines the header associated with every packet delivered to the application. +*/ +typedef struct _PACKET { + HANDLE hEvent; ///< \deprecated Still present for compatibility with old applications. + OVERLAPPED OverLapped; ///< \deprecated Still present for compatibility with old applications. + PVOID Buffer; ///< Buffer with containing the packets. See the PacketReceivePacket() for + ///< details about the organization of the data in this buffer + UINT Length; ///< Length of the buffer + DWORD ulBytesReceived; ///< Number of valid bytes present in the buffer, i.e. amount of data + ///< received by the last call to PacketReceivePacket() + BOOLEAN bIoComplete; ///< \deprecated Still present for compatibility with old applications. +} PACKET, *LPPACKET; + +/*! + \brief Structure containing an OID request. + + It is used by the PacketRequest() function to send an OID to the interface card driver. + It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, + the list of the multicast groups defined on it, and so on. +*/ +struct _PACKET_OID_DATA { + ULONG Oid; ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h + ///< for a complete list of valid codes. + ULONG Length; ///< Length of the data field + UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received + ///< from the adapter. +}; +typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @} + */ + +/* +BOOLEAN QueryWinPcapRegistryStringA(CHAR *SubKeyName, + CHAR *Value, + UINT *pValueLen, + CHAR *DefaultVal); + +BOOLEAN QueryWinPcapRegistryStringW(WCHAR *SubKeyName, + WCHAR *Value, + UINT *pValueLen, + WCHAR *DefaultVal); +*/ + +//--------------------------------------------------------------------------- +// EXPORTED FUNCTIONS +//--------------------------------------------------------------------------- + +PCHAR PacketGetVersion(); +PCHAR PacketGetDriverVersion(); +BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes); +BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites); +BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode); +BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout); +BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp); +BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior); +INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen); +BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s); +BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s); +BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim); +BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type); +LPADAPTER PacketOpenAdapter(PCHAR AdapterName); +BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync); +INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync); +LPPACKET PacketAllocatePacket(void); +VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length); +VOID PacketFreePacket(LPPACKET lpPacket); +BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync); +BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter); +BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize); +BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries); +BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData); +HANDLE PacketGetReadEvent(LPADAPTER AdapterObject); +BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len); +BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks); +BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync); +BOOL PacketStopDriver(); +VOID PacketCloseAdapter(LPADAPTER lpAdapter); +BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength); +BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags); +PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject); + +// +// Used by PacketStartOemEx +// +#define PACKET_START_OEM_NO_NETMON 0x00000001 + +#ifdef __cplusplus +} +#endif + +#endif //__PACKET32 diff --git a/import/winpcap/Include/Win32-Extensions.h b/import/winpcap/Include/Win32-Extensions.h new file mode 100644 index 000000000..ad3be25cf --- /dev/null +++ b/import/winpcap/Include/Win32-Extensions.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __WIN32_EXTENSIONS_H__ +#define __WIN32_EXTENSIONS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Definitions */ + +/*! + \brief A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit(). +*/ +struct pcap_send_queue +{ + u_int maxlen; ///< Maximum size of the the queue, in bytes. This variable contains the size of the buffer field. + u_int len; ///< Current size of the queue, in bytes. + char *buffer; ///< Buffer containing the packets to be sent. +}; + +typedef struct pcap_send_queue pcap_send_queue; + +/*! + \brief This typedef is a support for the pcap_get_airpcap_handle() function +*/ +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ +typedef struct _AirpcapHandle *PAirpcapHandle; +#endif + +#define BPF_MEM_EX_IMM 0xc0 +#define BPF_MEM_EX_IND 0xe0 + +/*used for ST*/ +#define BPF_MEM_EX 0xc0 +#define BPF_TME 0x08 + +#define BPF_LOOKUP 0x90 +#define BPF_EXECUTE 0xa0 +#define BPF_INIT 0xb0 +#define BPF_VALIDATE 0xc0 +#define BPF_SET_ACTIVE 0xd0 +#define BPF_RESET 0xe0 +#define BPF_SET_MEMORY 0x80 +#define BPF_GET_REGISTER_VALUE 0x70 +#define BPF_SET_REGISTER_VALUE 0x60 +#define BPF_SET_WORKING 0x50 +#define BPF_SET_ACTIVE_READ 0x40 +#define BPF_SET_AUTODELETION 0x30 +#define BPF_SEPARATION 0xff + +/* Prototypes */ +pcap_send_queue* pcap_sendqueue_alloc(u_int memsize); + +void pcap_sendqueue_destroy(pcap_send_queue* queue); + +int pcap_sendqueue_queue(pcap_send_queue* queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data); + +u_int pcap_sendqueue_transmit(pcap_t *p, pcap_send_queue* queue, int sync); + +HANDLE pcap_getevent(pcap_t *p); + +struct pcap_stat *pcap_stats_ex(pcap_t *p, int *pcap_stat_size); + +int pcap_setuserbuffer(pcap_t *p, int size); + +int pcap_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks); + +int pcap_live_dump_ended(pcap_t *p, int sync); + +int pcap_offline_filter(struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int pcap_start_oem(char* err_str, int flags); + +PAirpcapHandle pcap_get_airpcap_handle(pcap_t *p); + +#ifdef __cplusplus +} +#endif + +#endif //__WIN32_EXTENSIONS_H__ diff --git a/import/winpcap/Include/bittypes.h b/import/winpcap/Include/bittypes.h new file mode 100644 index 000000000..558a0b5c0 --- /dev/null +++ b/import/winpcap/Include/bittypes.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 1999 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _BITTYPES_H +#define _BITTYPES_H + +#ifndef HAVE_U_INT8_T + +#if SIZEOF_CHAR == 1 +typedef unsigned char u_int8_t; +typedef signed char int8_t; +#elif SIZEOF_INT == 1 +typedef unsigned int u_int8_t; +typedef signed int int8_t; +#else /* XXX */ +#error "there's no appropriate type for u_int8_t" +#endif +#define HAVE_U_INT8_T 1 +#define HAVE_INT8_T 1 + +#endif /* HAVE_U_INT8_T */ + +#ifndef HAVE_U_INT16_T + +#if SIZEOF_SHORT == 2 +typedef unsigned short u_int16_t; +typedef signed short int16_t; +#elif SIZEOF_INT == 2 +typedef unsigned int u_int16_t; +typedef signed int int16_t; +#elif SIZEOF_CHAR == 2 +typedef unsigned char u_int16_t; +typedef signed char int16_t; +#else /* XXX */ +#error "there's no appropriate type for u_int16_t" +#endif +#define HAVE_U_INT16_T 1 +#define HAVE_INT16_T 1 + +#endif /* HAVE_U_INT16_T */ + +#ifndef HAVE_U_INT32_T + +#if SIZEOF_INT == 4 +typedef unsigned int u_int32_t; +typedef signed int int32_t; +#elif SIZEOF_LONG == 4 +typedef unsigned long u_int32_t; +typedef signed long int32_t; +#elif SIZEOF_SHORT == 4 +typedef unsigned short u_int32_t; +typedef signed short int32_t; +#else /* XXX */ +#error "there's no appropriate type for u_int32_t" +#endif +#define HAVE_U_INT32_T 1 +#define HAVE_INT32_T 1 + +#endif /* HAVE_U_INT32_T */ + +#ifndef HAVE_U_INT64_T +#if SIZEOF_LONG_LONG == 8 +typedef unsigned long long u_int64_t; +typedef long long int64_t; +#elif defined(_MSC_EXTENSIONS) +typedef unsigned _int64 u_int64_t; +typedef _int64 int64_t; +#elif SIZEOF_INT == 8 +typedef unsigned int u_int64_t; +#elif SIZEOF_LONG == 8 +typedef unsigned long u_int64_t; +#elif SIZEOF_SHORT == 8 +typedef unsigned short u_int64_t; +#else /* XXX */ +#error "there's no appropriate type for u_int64_t" +#endif + +#endif /* HAVE_U_INT64_T */ + +#ifndef PRId64 +#ifdef _MSC_EXTENSIONS +#define PRId64 "I64d" +#else /* _MSC_EXTENSIONS */ +#define PRId64 "lld" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRId64 */ + +#ifndef PRIo64 +#ifdef _MSC_EXTENSIONS +#define PRIo64 "I64o" +#else /* _MSC_EXTENSIONS */ +#define PRIo64 "llo" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIo64 */ + +#ifndef PRIx64 +#ifdef _MSC_EXTENSIONS +#define PRIx64 "I64x" +#else /* _MSC_EXTENSIONS */ +#define PRIx64 "llx" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIx64 */ + +#ifndef PRIu64 +#ifdef _MSC_EXTENSIONS +#define PRIu64 "I64u" +#else /* _MSC_EXTENSIONS */ +#define PRIu64 "llu" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIu64 */ + +#endif /* _BITTYPES_H */ diff --git a/import/winpcap/Include/ip6_misc.h b/import/winpcap/Include/ip6_misc.h new file mode 100644 index 000000000..562fa6184 --- /dev/null +++ b/import/winpcap/Include/ip6_misc.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) 1993, 1994, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code distributions + * retain the above copyright notice and this paragraph in its entirety, (2) + * distributions including binary code include the above copyright notice and + * this paragraph in its entirety in the documentation or other materials + * provided with the distribution, and (3) all advertising materials mentioning + * features or use of this software display the following acknowledgement: + * ``This product includes software developed by the University of California, + * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of + * the University nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#) $Header: /tcpdump/master/libpcap/Win32/Include/ip6_misc.h,v 1.5 2006-01-22 18:02:18 gianluca Exp $ (LBL) + */ + +/* + * This file contains a collage of declarations for IPv6 from FreeBSD not present in Windows + */ + +#include + +#include + +#ifndef __MINGW32__ +#define IN_MULTICAST(a) IN_CLASSD(a) +#endif + +#define IN_EXPERIMENTAL(a) ((((u_int32_t) (a)) & 0xf0000000) == 0xf0000000) + +#define IN_LOOPBACKNET 127 + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) +/* IPv6 address */ +struct in6_addr + { + union + { + u_int8_t u6_addr8[16]; + u_int16_t u6_addr16[8]; + u_int32_t u6_addr32[4]; + } in6_u; +#define s6_addr in6_u.u6_addr8 +#define s6_addr16 in6_u.u6_addr16 +#define s6_addr32 in6_u.u6_addr32 +#define s6_addr64 in6_u.u6_addr64 + }; + +#define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#endif /* __MINGW32__ */ + + +#if (defined _MSC_VER) || (defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)) +typedef unsigned short sa_family_t; +#endif + + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) + +#define __SOCKADDR_COMMON(sa_prefix) \ + sa_family_t sa_prefix##family + +/* Ditto, for IPv6. */ +struct sockaddr_in6 + { + __SOCKADDR_COMMON (sin6_); + u_int16_t sin6_port; /* Transport layer port # */ + u_int32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + }; + +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \ + (((u_int32_t *) (a))[2] == htonl (0xffff))) + +#define IN6_IS_ADDR_MULTICAST(a) (((u_int8_t *) (a))[0] == 0xff) + +#define IN6_IS_ADDR_LINKLOCAL(a) \ + ((((u_int32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000)) + +#define IN6_IS_ADDR_LOOPBACK(a) \ + (((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \ + ((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1)) +#endif /* __MINGW32__ */ + +#define ip6_vfc ip6_ctlun.ip6_un2_vfc +#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow +#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen +#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt +#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim +#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim + +#define nd_rd_type nd_rd_hdr.icmp6_type +#define nd_rd_code nd_rd_hdr.icmp6_code +#define nd_rd_cksum nd_rd_hdr.icmp6_cksum +#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] + +/* + * IPV6 extension headers + */ +#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ +#define IPPROTO_IPV6 41 /* IPv6 header. */ +#define IPPROTO_ROUTING 43 /* IPv6 routing header */ +#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ +#define IPPROTO_ESP 50 /* encapsulating security payload */ +#define IPPROTO_AH 51 /* authentication header */ +#define IPPROTO_ICMPV6 58 /* ICMPv6 */ +#define IPPROTO_NONE 59 /* IPv6 no next header */ +#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ +#define IPPROTO_PIM 103 /* Protocol Independent Multicast. */ + +#define IPV6_RTHDR_TYPE_0 0 + +/* Option types and related macros */ +#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ +#define IP6OPT_PADN 0x01 /* 00 0 00001 */ +#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ +#define IP6OPT_JUMBO_LEN 6 +#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 */ + +#define IP6OPT_RTALERT_LEN 4 +#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ +#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ +#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ +#define IP6OPT_MINLEN 2 + +#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */ +#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */ +#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */ +#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */ +#define IP6OPT_EID 0x8a /* 10 0 01010 */ + +#define IP6OPT_TYPE(o) ((o) & 0xC0) +#define IP6OPT_TYPE_SKIP 0x00 +#define IP6OPT_TYPE_DISCARD 0x40 +#define IP6OPT_TYPE_FORCEICMP 0x80 +#define IP6OPT_TYPE_ICMP 0xC0 + +#define IP6OPT_MUTABLE 0x20 + + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) +#ifndef EAI_ADDRFAMILY +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + size_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ +}; +#endif +#endif /* __MINGW32__ */ diff --git a/import/winpcap/Include/pcap-bpf.h b/import/winpcap/Include/pcap-bpf.h new file mode 100644 index 000000000..5fe129dbb --- /dev/null +++ b/import/winpcap/Include/pcap-bpf.h @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.50 2007/04/01 21:43:55 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Some applications + * might expect to be able to include . + */ +#include diff --git a/import/winpcap/Include/pcap-namedb.h b/import/winpcap/Include/pcap-namedb.h new file mode 100644 index 000000000..80a2f0040 --- /dev/null +++ b/import/winpcap/Include/pcap-namedb.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1994, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-namedb.h,v 1.13 2006/10/04 18:13:32 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Some applications + * might expect to be able to include . + */ +#include diff --git a/import/winpcap/Include/pcap-stdinc.h b/import/winpcap/Include/pcap-stdinc.h new file mode 100644 index 000000000..7f863fb3d --- /dev/null +++ b/import/winpcap/Include/pcap-stdinc.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL) + */ + +#define SIZEOF_CHAR 1 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#ifndef _MSC_EXTENSIONS +#define SIZEOF_LONG_LONG 8 +#endif + +/* + * Avoids a compiler warning in case this was already defined + * (someone defined _WINSOCKAPI_ when including 'windows.h', in order + * to prevent it from including 'winsock.h') + */ +#ifdef _WINSOCKAPI_ +#undef _WINSOCKAPI_ +#endif +#include + +#include + +#include "bittypes.h" +#include +#include + +#ifndef __MINGW32__ +#include "IP6_misc.h" +#endif + +#define caddr_t char* + +#if _MSC_VER < 1500 +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#define strdup _strdup +#endif + +//#define inline __inline + +#ifdef __MINGW32__ +#include +#else /*__MINGW32__*/ +/* MSVC compiler */ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef _W64 unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + +#ifndef _INTPTR_T_DEFINED +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef _W64 int intptr_t; +#endif +#define _INTPTR_T_DEFINED +#endif + +#endif /*__MINGW32__*/ diff --git a/import/winpcap/Include/pcap.h b/import/winpcap/Include/pcap.h new file mode 100644 index 000000000..935f9494c --- /dev/null +++ b/import/winpcap/Include/pcap.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.59 2006/10/04 18:09:22 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Many applications + * expect to be able to include , and at least some of them + * go through contortions in their configure scripts to try to detect + * OSes that have "helpfully" moved pcap.h to without + * leaving behind a file. + */ +#include diff --git a/import/winpcap/Include/pcap/bluetooth.h b/import/winpcap/Include/pcap/bluetooth.h new file mode 100644 index 000000000..7bf65df03 --- /dev/null +++ b/import/winpcap/Include/pcap/bluetooth.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2006 Paolo Abeni (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * bluetooth data struct + * By Paolo Abeni + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/bluetooth.h,v 1.1 2007/09/22 02:10:17 guy Exp $ + */ + +#ifndef _PCAP_BLUETOOTH_STRUCTS_H__ +#define _PCAP_BLUETOOTH_STRUCTS_H__ + +/* + * Header prepended libpcap to each bluetooth h:4 frame. + * fields are in network byte order + */ +typedef struct _pcap_bluetooth_h4_header { + u_int32_t direction; /* if first bit is set direction is incoming */ +} pcap_bluetooth_h4_header; + + +#endif diff --git a/import/winpcap/Include/pcap/bpf.h b/import/winpcap/Include/pcap/bpf.h new file mode 100644 index 000000000..9f4ca33e3 --- /dev/null +++ b/import/winpcap/Include/pcap/bpf.h @@ -0,0 +1,934 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)bpf.h 7.1 (Berkeley) 5/7/91 + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.8 2008-09-22 20:16:01 guy Exp $ (LBL) + */ + +/* + * This is libpcap's cut-down version of bpf.h; it includes only + * the stuff needed for the code generator and the userland BPF + * interpreter, and the libpcap APIs for setting filters, etc.. + * + * "pcap-bpf.c" will include the native OS version, as it deals with + * the OS's BPF implementation. + * + * XXX - should this all just be moved to "pcap.h"? + */ + +#ifndef BPF_MAJOR_VERSION + +#ifdef __cplusplus +extern "C" { +#endif + +/* BSD style release date */ +#define BPF_RELEASE 199606 + +#ifdef MSDOS /* must be 32-bit */ +typedef long bpf_int32; +typedef unsigned long bpf_u_int32; +#else +typedef int bpf_int32; +typedef u_int bpf_u_int32; +#endif + +/* + * Alignment macros. BPF_WORDALIGN rounds up to the next + * even multiple of BPF_ALIGNMENT. + */ +#ifndef __NetBSD__ +#define BPF_ALIGNMENT sizeof(bpf_int32) +#else +#define BPF_ALIGNMENT sizeof(long) +#endif +#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) + +#define BPF_MAXBUFSIZE 0x8000 +#define BPF_MINBUFSIZE 32 + +/* + * Structure for "pcap_compile()", "pcap_setfilter()", etc.. + */ +struct bpf_program { + u_int bf_len; + struct bpf_insn *bf_insns; +}; + +/* + * Struct return by BIOCVERSION. This represents the version number of + * the filter language described by the instruction encodings below. + * bpf understands a program iff kernel_major == filter_major && + * kernel_minor >= filter_minor, that is, if the value returned by the + * running kernel has the same major number and a minor number equal + * equal to or less than the filter being downloaded. Otherwise, the + * results are undefined, meaning an error may be returned or packets + * may be accepted haphazardly. + * It has nothing to do with the source code version. + */ +struct bpf_version { + u_short bv_major; + u_short bv_minor; +}; +/* Current version number of filter architecture. */ +#define BPF_MAJOR_VERSION 1 +#define BPF_MINOR_VERSION 1 + +/* + * Data-link level type codes. + * + * Do *NOT* add new values to this list without asking + * "tcpdump-workers@lists.tcpdump.org" for a value. Otherwise, you run + * the risk of using a value that's already being used for some other + * purpose, and of having tools that read libpcap-format captures not + * being able to handle captures with your new DLT_ value, with no hope + * that they will ever be changed to do so (as that would destroy their + * ability to read captures using that value for that other purpose). + */ + +/* + * These are the types that are the same on all platforms, and that + * have been defined by for ages. + */ +#define DLT_NULL 0 /* BSD loopback encapsulation */ +#define DLT_EN10MB 1 /* Ethernet (10Mb) */ +#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */ +#define DLT_AX25 3 /* Amateur Radio AX.25 */ +#define DLT_PRONET 4 /* Proteon ProNET Token Ring */ +#define DLT_CHAOS 5 /* Chaos */ +#define DLT_IEEE802 6 /* 802.5 Token Ring */ +#define DLT_ARCNET 7 /* ARCNET, with BSD-style header */ +#define DLT_SLIP 8 /* Serial Line IP */ +#define DLT_PPP 9 /* Point-to-point Protocol */ +#define DLT_FDDI 10 /* FDDI */ + +/* + * These are types that are different on some platforms, and that + * have been defined by for ages. We use #ifdefs to + * detect the BSDs that define them differently from the traditional + * libpcap + * + * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS, + * but I don't know what the right #define is for BSD/OS. + */ +#define DLT_ATM_RFC1483 11 /* LLC-encapsulated ATM */ + +#ifdef __OpenBSD__ +#define DLT_RAW 14 /* raw IP */ +#else +#define DLT_RAW 12 /* raw IP */ +#endif + +/* + * Given that the only OS that currently generates BSD/OS SLIP or PPP + * is, well, BSD/OS, arguably everybody should have chosen its values + * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they + * didn't. So it goes. + */ +#if defined(__NetBSD__) || defined(__FreeBSD__) +#ifndef DLT_SLIP_BSDOS +#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */ +#endif +#else +#define DLT_SLIP_BSDOS 15 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 16 /* BSD/OS Point-to-point Protocol */ +#endif + +/* + * 17 is used for DLT_OLD_PFLOG in OpenBSD; + * OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below. + * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else. + */ + +#define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */ + +/* + * Apparently Redback uses this for its SmartEdge 400/800. I hope + * nobody else decided to use it, too. + */ +#define DLT_REDBACK_SMARTEDGE 32 + +/* + * These values are defined by NetBSD; other platforms should refrain from + * using them for other purposes, so that NetBSD savefiles with link + * types of 50 or 51 can be read as this type on all platforms. + */ +#define DLT_PPP_SERIAL 50 /* PPP over serial with HDLC encapsulation */ +#define DLT_PPP_ETHER 51 /* PPP over Ethernet */ + +/* + * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses + * a link-layer type of 99 for the tcpdump it supplies. The link-layer + * header has 6 bytes of unknown data, something that appears to be an + * Ethernet type, and 36 bytes that appear to be 0 in at least one capture + * I've seen. + */ +#define DLT_SYMANTEC_FIREWALL 99 + +/* + * Values between 100 and 103 are used in capture file headers as + * link-layer types corresponding to DLT_ types that differ + * between platforms; don't use those values for new DLT_ new types. + */ + +/* + * This value was defined by libpcap 0.5; platforms that have defined + * it with a different value should define it here with that value - + * a link type of 104 in a save file will be mapped to DLT_C_HDLC, + * whatever value that happens to be, so programs will correctly + * handle files with that link type regardless of the value of + * DLT_C_HDLC. + * + * The name DLT_C_HDLC was used by BSD/OS; we use that name for source + * compatibility with programs written for BSD/OS. + * + * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well, + * for source compatibility with programs written for libpcap 0.5. + */ +#define DLT_C_HDLC 104 /* Cisco HDLC */ +#define DLT_CHDLC DLT_C_HDLC + +#define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */ + +/* + * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW, + * except when it isn't. (I.e., sometimes it's just raw IP, and + * sometimes it isn't.) We currently handle it as DLT_LINUX_SLL, + * so that we don't have to worry about the link-layer header.) + */ + +/* + * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides + * with other values. + * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header + * (DLCI, etc.). + */ +#define DLT_FRELAY 107 + +/* + * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except + * that the AF_ type in the link-layer header is in network byte order. + * + * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so + * we don't use 12 for it in OSes other than OpenBSD. + */ +#ifdef __OpenBSD__ +#define DLT_LOOP 12 +#else +#define DLT_LOOP 108 +#endif + +/* + * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's + * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other + * than OpenBSD. + */ +#ifdef __OpenBSD__ +#define DLT_ENC 13 +#else +#define DLT_ENC 109 +#endif + +/* + * Values between 110 and 112 are reserved for use in capture file headers + * as link-layer types corresponding to DLT_ types that might differ + * between platforms; don't use those values for new DLT_ types + * other than the corresponding DLT_ types. + */ + +/* + * This is for Linux cooked sockets. + */ +#define DLT_LINUX_SLL 113 + +/* + * Apple LocalTalk hardware. + */ +#define DLT_LTALK 114 + +/* + * Acorn Econet. + */ +#define DLT_ECONET 115 + +/* + * Reserved for use with OpenBSD ipfilter. + */ +#define DLT_IPFILTER 116 + +/* + * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023 + * in SuSE 6.3, so we can't use 17 for it in capture-file headers. + * + * XXX: is there a conflict with DLT_PFSYNC 18 as well? + */ +#ifdef __OpenBSD__ +#define DLT_OLD_PFLOG 17 +#define DLT_PFSYNC 18 +#endif +#define DLT_PFLOG 117 + +/* + * Registered for Cisco-internal use. + */ +#define DLT_CISCO_IOS 118 + +/* + * For 802.11 cards using the Prism II chips, with a link-layer + * header including Prism monitor mode information plus an 802.11 + * header. + */ +#define DLT_PRISM_HEADER 119 + +/* + * Reserved for Aironet 802.11 cards, with an Aironet link-layer header + * (see Doug Ambrisko's FreeBSD patches). + */ +#define DLT_AIRONET_HEADER 120 + +/* + * Reserved for Siemens HiPath HDLC. + */ +#define DLT_HHDLC 121 + +/* + * This is for RFC 2625 IP-over-Fibre Channel. + * + * This is not for use with raw Fibre Channel, where the link-layer + * header starts with a Fibre Channel frame header; it's for IP-over-FC, + * where the link-layer header starts with an RFC 2625 Network_Header + * field. + */ +#define DLT_IP_OVER_FC 122 + +/* + * This is for Full Frontal ATM on Solaris with SunATM, with a + * pseudo-header followed by an AALn PDU. + * + * There may be other forms of Full Frontal ATM on other OSes, + * with different pseudo-headers. + * + * If ATM software returns a pseudo-header with VPI/VCI information + * (and, ideally, packet type information, e.g. signalling, ILMI, + * LANE, LLC-multiplexed traffic, etc.), it should not use + * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump + * and the like don't have to infer the presence or absence of a + * pseudo-header and the form of the pseudo-header. + */ +#define DLT_SUNATM 123 /* Solaris+SunATM */ + +/* + * Reserved as per request from Kent Dahlgren + * for private use. + */ +#define DLT_RIO 124 /* RapidIO */ +#define DLT_PCI_EXP 125 /* PCI Express */ +#define DLT_AURORA 126 /* Xilinx Aurora link layer */ + +/* + * Header for 802.11 plus a number of bits of link-layer information + * including radio information, used by some recent BSD drivers as + * well as the madwifi Atheros driver for Linux. + */ +#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus radiotap radio header */ + +/* + * Reserved for the TZSP encapsulation, as per request from + * Chris Waters + * TZSP is a generic encapsulation for any other link type, + * which includes a means to include meta-information + * with the packet, e.g. signal strength and channel + * for 802.11 packets. + */ +#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */ + +/* + * BSD's ARCNET headers have the source host, destination host, + * and type at the beginning of the packet; that's what's handed + * up to userland via BPF. + * + * Linux's ARCNET headers, however, have a 2-byte offset field + * between the host IDs and the type; that's what's handed up + * to userland via PF_PACKET sockets. + * + * We therefore have to have separate DLT_ values for them. + */ +#define DLT_ARCNET_LINUX 129 /* ARCNET */ + +/* + * Juniper-private data link types, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, etc.. + */ +#define DLT_JUNIPER_MLPPP 130 +#define DLT_JUNIPER_MLFR 131 +#define DLT_JUNIPER_ES 132 +#define DLT_JUNIPER_GGSN 133 +#define DLT_JUNIPER_MFR 134 +#define DLT_JUNIPER_ATM2 135 +#define DLT_JUNIPER_SERVICES 136 +#define DLT_JUNIPER_ATM1 137 + +/* + * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund + * . The header that's presented is an Ethernet-like + * header: + * + * #define FIREWIRE_EUI64_LEN 8 + * struct firewire_header { + * u_char firewire_dhost[FIREWIRE_EUI64_LEN]; + * u_char firewire_shost[FIREWIRE_EUI64_LEN]; + * u_short firewire_type; + * }; + * + * with "firewire_type" being an Ethernet type value, rather than, + * for example, raw GASP frames being handed up. + */ +#define DLT_APPLE_IP_OVER_IEEE1394 138 + +/* + * Various SS7 encapsulations, as per a request from Jeff Morriss + * and subsequent discussions. + */ +#define DLT_MTP2_WITH_PHDR 139 /* pseudo-header with various info, followed by MTP2 */ +#define DLT_MTP2 140 /* MTP2, without pseudo-header */ +#define DLT_MTP3 141 /* MTP3, without pseudo-header or MTP2 */ +#define DLT_SCCP 142 /* SCCP, without pseudo-header or MTP2 or MTP3 */ + +/* + * DOCSIS MAC frames. + */ +#define DLT_DOCSIS 143 + +/* + * Linux-IrDA packets. Protocol defined at http://www.irda.org. + * Those packets include IrLAP headers and above (IrLMP...), but + * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy + * framing can be handled by the hardware and depend on the bitrate. + * This is exactly the format you would get capturing on a Linux-IrDA + * interface (irdaX), but not on a raw serial port. + * Note the capture is done in "Linux-cooked" mode, so each packet include + * a fake packet header (struct sll_header). This is because IrDA packet + * decoding is dependant on the direction of the packet (incomming or + * outgoing). + * When/if other platform implement IrDA capture, we may revisit the + * issue and define a real DLT_IRDA... + * Jean II + */ +#define DLT_LINUX_IRDA 144 + +/* + * Reserved for IBM SP switch and IBM Next Federation switch. + */ +#define DLT_IBM_SP 145 +#define DLT_IBM_SN 146 + +/* + * Reserved for private use. If you have some link-layer header type + * that you want to use within your organization, with the capture files + * using that link-layer header type not ever be sent outside your + * organization, you can use these values. + * + * No libpcap release will use these for any purpose, nor will any + * tcpdump release use them, either. + * + * Do *NOT* use these in capture files that you expect anybody not using + * your private versions of capture-file-reading tools to read; in + * particular, do *NOT* use them in products, otherwise you may find that + * people won't be able to use tcpdump, or snort, or Ethereal, or... to + * read capture files from your firewall/intrusion detection/traffic + * monitoring/etc. appliance, or whatever product uses that DLT_ value, + * and you may also find that the developers of those applications will + * not accept patches to let them read those files. + * + * Also, do not use them if somebody might send you a capture using them + * for *their* private type and tools using them for *your* private type + * would have to read them. + * + * Instead, ask "tcpdump-workers@lists.tcpdump.org" for a new DLT_ value, + * as per the comment above, and use the type you're given. + */ +#define DLT_USER0 147 +#define DLT_USER1 148 +#define DLT_USER2 149 +#define DLT_USER3 150 +#define DLT_USER4 151 +#define DLT_USER5 152 +#define DLT_USER6 153 +#define DLT_USER7 154 +#define DLT_USER8 155 +#define DLT_USER9 156 +#define DLT_USER10 157 +#define DLT_USER11 158 +#define DLT_USER12 159 +#define DLT_USER13 160 +#define DLT_USER14 161 +#define DLT_USER15 162 + +/* + * For future use with 802.11 captures - defined by AbsoluteValue + * Systems to store a number of bits of link-layer information + * including radio information: + * + * http://www.shaftnet.org/~pizza/software/capturefrm.txt + * + * but it might be used by some non-AVS drivers now or in the + * future. + */ +#define DLT_IEEE802_11_RADIO_AVS 163 /* 802.11 plus AVS radio header */ + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, etc.. + */ +#define DLT_JUNIPER_MONITOR 164 + +/* + * Reserved for BACnet MS/TP. + */ +#define DLT_BACNET_MS_TP 165 + +/* + * Another PPP variant as per request from Karsten Keil . + * + * This is used in some OSes to allow a kernel socket filter to distinguish + * between incoming and outgoing packets, on a socket intended to + * supply pppd with outgoing packets so it can do dial-on-demand and + * hangup-on-lack-of-demand; incoming packets are filtered out so they + * don't cause pppd to hold the connection up (you don't want random + * input packets such as port scans, packets from old lost connections, + * etc. to force the connection to stay up). + * + * The first byte of the PPP header (0xff03) is modified to accomodate + * the direction - 0x00 = IN, 0x01 = OUT. + */ +#define DLT_PPP_PPPD 166 + +/* + * Names for backwards compatibility with older versions of some PPP + * software; new software should use DLT_PPP_PPPD. + */ +#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD +#define DLT_LINUX_PPP_WITHDIRECTION DLT_PPP_PPPD + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, cookies, etc.. + */ +#define DLT_JUNIPER_PPPOE 167 +#define DLT_JUNIPER_PPPOE_ATM 168 + +#define DLT_GPRS_LLC 169 /* GPRS LLC */ +#define DLT_GPF_T 170 /* GPF-T (ITU-T G.7041/Y.1303) */ +#define DLT_GPF_F 171 /* GPF-F (ITU-T G.7041/Y.1303) */ + +/* + * Requested by Oolan Zimmer for use in Gcom's T1/E1 line + * monitoring equipment. + */ +#define DLT_GCOM_T1E1 172 +#define DLT_GCOM_SERIAL 173 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_ is used + * for internal communication to Physical Interface Cards (PIC) + */ +#define DLT_JUNIPER_PIC_PEER 174 + +/* + * Link types requested by Gregor Maier of Endace + * Measurement Systems. They add an ERF header (see + * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of + * the link-layer header. + */ +#define DLT_ERF_ETH 175 /* Ethernet */ +#define DLT_ERF_POS 176 /* Packet-over-SONET */ + +/* + * Requested by Daniele Orlandi for raw LAPD + * for vISDN (http://www.orlandi.com/visdn/). Its link-layer header + * includes additional information before the LAPD header, so it's + * not necessarily a generic LAPD header. + */ +#define DLT_LINUX_LAPD 177 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ are used for prepending meta-information + * like interface index, interface name + * before standard Ethernet, PPP, Frelay & C-HDLC Frames + */ +#define DLT_JUNIPER_ETHER 178 +#define DLT_JUNIPER_PPP 179 +#define DLT_JUNIPER_FRELAY 180 +#define DLT_JUNIPER_CHDLC 181 + +/* + * Multi Link Frame Relay (FRF.16) + */ +#define DLT_MFR 182 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for internal communication with a + * voice Adapter Card (PIC) + */ +#define DLT_JUNIPER_VP 183 + +/* + * Arinc 429 frames. + * DLT_ requested by Gianluca Varenni . + * Every frame contains a 32bit A429 label. + * More documentation on Arinc 429 can be found at + * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf + */ +#define DLT_A429 184 + +/* + * Arinc 653 Interpartition Communication messages. + * DLT_ requested by Gianluca Varenni . + * Please refer to the A653-1 standard for more information. + */ +#define DLT_A653_ICM 185 + +/* + * USB packets, beginning with a USB setup header; requested by + * Paolo Abeni . + */ +#define DLT_USB 186 + +/* + * Bluetooth HCI UART transport layer (part H:4); requested by + * Paolo Abeni. + */ +#define DLT_BLUETOOTH_HCI_H4 187 + +/* + * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz + * . + */ +#define DLT_IEEE802_16_MAC_CPS 188 + +/* + * USB packets, beginning with a Linux USB header; requested by + * Paolo Abeni . + */ +#define DLT_USB_LINUX 189 + +/* + * Controller Area Network (CAN) v. 2.0B packets. + * DLT_ requested by Gianluca Varenni . + * Used to dump CAN packets coming from a CAN Vector board. + * More documentation on the CAN v2.0B frames can be found at + * http://www.can-cia.org/downloads/?269 + */ +#define DLT_CAN20B 190 + +/* + * IEEE 802.15.4, with address fields padded, as is done by Linux + * drivers; requested by Juergen Schimmer. + */ +#define DLT_IEEE802_15_4_LINUX 191 + +/* + * Per Packet Information encapsulated packets. + * DLT_ requested by Gianluca Varenni . + */ +#define DLT_PPI 192 + +/* + * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header; + * requested by Charles Clancy. + */ +#define DLT_IEEE802_16_MAC_CPS_RADIO 193 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for internal communication with a + * integrated service module (ISM). + */ +#define DLT_JUNIPER_ISM 194 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing); requested by Mikko Saarnivala . + */ +#define DLT_IEEE802_15_4 195 + +/* + * Various link-layer types, with a pseudo-header, for SITA + * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com). + */ +#define DLT_SITA 196 + +/* + * Various link-layer types, with a pseudo-header, for Endace DAG cards; + * encapsulates Endace ERF records. Requested by Stephen Donnelly + * . + */ +#define DLT_ERF 197 + +/* + * Special header prepended to Ethernet packets when capturing from a + * u10 Networks board. Requested by Phil Mulholland + * . + */ +#define DLT_RAIF1 198 + +/* + * IPMB packet for IPMI, beginning with the I2C slave address, followed + * by the netFn and LUN, etc.. Requested by Chanthy Toeung + * . + */ +#define DLT_IPMB 199 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for capturing data on a secure tunnel interface. + */ +#define DLT_JUNIPER_ST 200 + +/* + * Bluetooth HCI UART transport layer (part H:4), with pseudo-header + * that includes direction information; requested by Paolo Abeni. + */ +#define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201 + +/* + * AX.25 packet with a 1-byte KISS header; see + * + * http://www.ax25.net/kiss.htm + * + * as per Richard Stearn . + */ +#define DLT_AX25_KISS 202 + +/* + * LAPD packets from an ISDN channel, starting with the address field, + * with no pseudo-header. + * Requested by Varuna De Silva . + */ +#define DLT_LAPD 203 + +/* + * Variants of various link-layer headers, with a one-byte direction + * pseudo-header prepended - zero means "received by this host", + * non-zero (any non-zero value) means "sent by this host" - as per + * Will Barker . + */ +#define DLT_PPP_WITH_DIR 204 /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */ +#define DLT_C_HDLC_WITH_DIR 205 /* Cisco HDLC */ +#define DLT_FRELAY_WITH_DIR 206 /* Frame Relay */ +#define DLT_LAPB_WITH_DIR 207 /* LAPB */ + +/* + * 208 is reserved for an as-yet-unspecified proprietary link-layer + * type, as requested by Will Barker. + */ + +/* + * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman + * . + */ +#define DLT_IPMB_LINUX 209 + +/* + * FlexRay automotive bus - http://www.flexray.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_FLEXRAY 210 + +/* + * Media Oriented Systems Transport (MOST) bus for multimedia + * transport - http://www.mostcooperation.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_MOST 211 + +/* + * Local Interconnect Network (LIN) bus for vehicle networks - + * http://www.lin-subbus.org/ - as requested by Hannes Kaelber + * . + */ +#define DLT_LIN 212 + +/* + * X2E-private data link type used for serial line capture, + * as requested by Hannes Kaelber . + */ +#define DLT_X2E_SERIAL 213 + +/* + * X2E-private data link type used for the Xoraya data logger + * family, as requested by Hannes Kaelber . + */ +#define DLT_X2E_XORAYA 214 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing), but with the PHY-level data for non-ASK PHYs (4 octets + * of 0 as preamble, one octet of SFD, one octet of frame length+ + * reserved bit, and then the MAC-layer data, starting with the + * frame control field). + * + * Requested by Max Filippov . + */ +#define DLT_IEEE802_15_4_NONASK_PHY 215 + + +/* + * DLT and savefile link type values are split into a class and + * a member of that class. A class value of 0 indicates a regular + * DLT_/LINKTYPE_ value. + */ +#define DLT_CLASS(x) ((x) & 0x03ff0000) + +/* + * NetBSD-specific generic "raw" link type. The class value indicates + * that this is the generic raw type, and the lower 16 bits are the + * address family we're dealing with. Those values are NetBSD-specific; + * do not assume that they correspond to AF_ values for your operating + * system. + */ +#define DLT_CLASS_NETBSD_RAWAF 0x02240000 +#define DLT_NETBSD_RAWAF(af) (DLT_CLASS_NETBSD_RAWAF | (af)) +#define DLT_NETBSD_RAWAF_AF(x) ((x) & 0x0000ffff) +#define DLT_IS_NETBSD_RAWAF(x) (DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF) + + +/* + * The instruction encodings. + */ +/* instruction classes */ +#define BPF_CLASS(code) ((code) & 0x07) +#define BPF_LD 0x00 +#define BPF_LDX 0x01 +#define BPF_ST 0x02 +#define BPF_STX 0x03 +#define BPF_ALU 0x04 +#define BPF_JMP 0x05 +#define BPF_RET 0x06 +#define BPF_MISC 0x07 + +/* ld/ldx fields */ +#define BPF_SIZE(code) ((code) & 0x18) +#define BPF_W 0x00 +#define BPF_H 0x08 +#define BPF_B 0x10 +#define BPF_MODE(code) ((code) & 0xe0) +#define BPF_IMM 0x00 +#define BPF_ABS 0x20 +#define BPF_IND 0x40 +#define BPF_MEM 0x60 +#define BPF_LEN 0x80 +#define BPF_MSH 0xa0 + +/* alu/jmp fields */ +#define BPF_OP(code) ((code) & 0xf0) +#define BPF_ADD 0x00 +#define BPF_SUB 0x10 +#define BPF_MUL 0x20 +#define BPF_DIV 0x30 +#define BPF_OR 0x40 +#define BPF_AND 0x50 +#define BPF_LSH 0x60 +#define BPF_RSH 0x70 +#define BPF_NEG 0x80 +#define BPF_JA 0x00 +#define BPF_JEQ 0x10 +#define BPF_JGT 0x20 +#define BPF_JGE 0x30 +#define BPF_JSET 0x40 +#define BPF_SRC(code) ((code) & 0x08) +#define BPF_K 0x00 +#define BPF_X 0x08 + +/* ret - BPF_K and BPF_X also apply */ +#define BPF_RVAL(code) ((code) & 0x18) +#define BPF_A 0x10 + +/* misc */ +#define BPF_MISCOP(code) ((code) & 0xf8) +#define BPF_TAX 0x00 +#define BPF_TXA 0x80 + +/* + * The instruction data structure. + */ +struct bpf_insn { + u_short code; + u_char jt; + u_char jf; + bpf_u_int32 k; +}; + +/* + * Macros for insn array initializers. + */ +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } + +#if __STDC__ || defined(__cplusplus) +extern int bpf_validate(const struct bpf_insn *, int); +extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +#else +extern int bpf_validate(); +extern u_int bpf_filter(); +#endif + +/* + * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). + */ +#define BPF_MEMWORDS 16 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/import/winpcap/Include/pcap/namedb.h b/import/winpcap/Include/pcap/namedb.h new file mode 100644 index 000000000..9002c7509 --- /dev/null +++ b/import/winpcap/Include/pcap/namedb.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1994, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/namedb.h,v 1.1 2006/10/04 18:09:22 guy Exp $ (LBL) + */ + +#ifndef lib_pcap_namedb_h +#define lib_pcap_namedb_h + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * As returned by the pcap_next_etherent() + * XXX this stuff doesn't belong in this interface, but this + * library already must do name to address translation, so + * on systems that don't have support for /etc/ethers, we + * export these hooks since they'll + */ +struct pcap_etherent { + u_char addr[6]; + char name[122]; +}; +#ifndef PCAP_ETHERS_FILE +#define PCAP_ETHERS_FILE "/etc/ethers" +#endif +struct pcap_etherent *pcap_next_etherent(FILE *); +u_char *pcap_ether_hostton(const char*); +u_char *pcap_ether_aton(const char *); + +bpf_u_int32 **pcap_nametoaddr(const char *); +#ifdef INET6 +struct addrinfo *pcap_nametoaddrinfo(const char *); +#endif +bpf_u_int32 pcap_nametonetaddr(const char *); + +int pcap_nametoport(const char *, int *, int *); +int pcap_nametoportrange(const char *, int *, int *, int *); +int pcap_nametoproto(const char *); +int pcap_nametoeproto(const char *); +int pcap_nametollc(const char *); +/* + * If a protocol is unknown, PROTO_UNDEF is returned. + * Also, pcap_nametoport() returns the protocol along with the port number. + * If there are ambiguous entried in /etc/services (i.e. domain + * can be either tcp or udp) PROTO_UNDEF is returned. + */ +#define PROTO_UNDEF -1 + +/* XXX move these to pcap-int.h? */ +int __pcap_atodn(const char *, bpf_u_int32 *); +int __pcap_atoin(const char *, bpf_u_int32 *); +u_short __pcap_nametodnaddr(const char *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/import/winpcap/Include/pcap/pcap.h b/import/winpcap/Include/pcap/pcap.h new file mode 100644 index 000000000..ad8fc40ac --- /dev/null +++ b/import/winpcap/Include/pcap/pcap.h @@ -0,0 +1,407 @@ +/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */ +/* + * Copyright (c) 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/pcap.h,v 1.4.2.11 2008-10-06 15:38:39 gianluca Exp $ (LBL) + */ + +#ifndef lib_pcap_pcap_h +#define lib_pcap_pcap_h + +#if defined(WIN32) + #include +#elif defined(MSDOS) + #include + #include /* u_int, u_char etc. */ +#else /* UN*X */ + #include + #include +#endif /* WIN32/MSDOS/UN*X */ + +#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#endif + +#include + +#ifdef HAVE_REMOTE + // We have to define the SOCKET here, although it has been defined in sockutils.h + // This is to avoid the distribution of the 'sockutils.h' file around + // (for example in the WinPcap developer's pack) + #ifndef SOCKET + #ifdef WIN32 + #define SOCKET unsigned int + #else + #define SOCKET int + #endif + #endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PCAP_VERSION_MAJOR 2 +#define PCAP_VERSION_MINOR 4 + +#define PCAP_ERRBUF_SIZE 256 + +/* + * Compatibility for systems that have a bpf.h that + * predates the bpf typedefs for 64-bit support. + */ +#if BPF_RELEASE - 0 < 199406 +typedef int bpf_int32; +typedef u_int bpf_u_int32; +#endif + +typedef struct pcap pcap_t; +typedef struct pcap_dumper pcap_dumper_t; +typedef struct pcap_if pcap_if_t; +typedef struct pcap_addr pcap_addr_t; + +/* + * The first record in the file contains saved values for some + * of the flags used in the printout phases of tcpdump. + * Many fields here are 32 bit ints so compilers won't insert unwanted + * padding; these files need to be interchangeable across architectures. + * + * Do not change the layout of this structure, in any way (this includes + * changes that only affect the length of fields in this structure). + * + * Also, do not change the interpretation of any of the members of this + * structure, in any way (this includes using values other than + * LINKTYPE_ values, as defined in "savefile.c", in the "linktype" + * field). + * + * Instead: + * + * introduce a new structure for the new format, if the layout + * of the structure changed; + * + * send mail to "tcpdump-workers@lists.tcpdump.org", requesting + * a new magic number for your new capture file format, and, when + * you get the new magic number, put it in "savefile.c"; + * + * use that magic number for save files with the changed file + * header; + * + * make the code in "savefile.c" capable of reading files with + * the old file header as well as files with the new file header + * (using the magic number to determine the header format). + * + * Then supply the changes as a patch at + * + * http://sourceforge.net/projects/libpcap/ + * + * so that future versions of libpcap and programs that use it (such as + * tcpdump) will be able to read your new capture file format. + */ +struct pcap_file_header { + bpf_u_int32 magic; + u_short version_major; + u_short version_minor; + bpf_int32 thiszone; /* gmt to local correction */ + bpf_u_int32 sigfigs; /* accuracy of timestamps */ + bpf_u_int32 snaplen; /* max length saved portion of each pkt */ + bpf_u_int32 linktype; /* data link type (LINKTYPE_*) */ +}; + +/* + * Macros for the value returned by pcap_datalink_ext(). + * + * If LT_FCS_LENGTH_PRESENT(x) is true, the LT_FCS_LENGTH(x) macro + * gives the FCS length of packets in the capture. + */ +#define LT_FCS_LENGTH_PRESENT(x) ((x) & 0x04000000) +#define LT_FCS_LENGTH(x) (((x) & 0xF0000000) >> 28) +#define LT_FCS_DATALINK_EXT(x) ((((x) & 0xF) << 28) | 0x04000000) + +typedef enum { + PCAP_D_INOUT = 0, + PCAP_D_IN, + PCAP_D_OUT +} pcap_direction_t; + +/* + * Generic per-packet information, as supplied by libpcap. + * + * The time stamp can and should be a "struct timeval", regardless of + * whether your system supports 32-bit tv_sec in "struct timeval", + * 64-bit tv_sec in "struct timeval", or both if it supports both 32-bit + * and 64-bit applications. The on-disk format of savefiles uses 32-bit + * tv_sec (and tv_usec); this structure is irrelevant to that. 32-bit + * and 64-bit versions of libpcap, even if they're on the same platform, + * should supply the appropriate version of "struct timeval", even if + * that's not what the underlying packet capture mechanism supplies. + */ +struct pcap_pkthdr { + struct timeval ts; /* time stamp */ + bpf_u_int32 caplen; /* length of portion present */ + bpf_u_int32 len; /* length this packet (off wire) */ +}; + +/* + * As returned by the pcap_stats() + */ +struct pcap_stat { + u_int ps_recv; /* number of packets received */ + u_int ps_drop; /* number of packets dropped */ + u_int ps_ifdrop; /* drops by interface XXX not yet supported */ +#ifdef HAVE_REMOTE + u_int ps_capt; /* number of packets that are received by the application; please get rid off the Win32 ifdef */ + u_int ps_sent; /* number of packets sent by the server on the network */ + u_int ps_netdrop; /* number of packets lost on the network */ +#endif /* HAVE_REMOTE */ +}; + +#ifdef MSDOS +/* + * As returned by the pcap_stats_ex() + */ +struct pcap_stat_ex { + u_long rx_packets; /* total packets received */ + u_long tx_packets; /* total packets transmitted */ + u_long rx_bytes; /* total bytes received */ + u_long tx_bytes; /* total bytes transmitted */ + u_long rx_errors; /* bad packets received */ + u_long tx_errors; /* packet transmit problems */ + u_long rx_dropped; /* no space in Rx buffers */ + u_long tx_dropped; /* no space available for Tx */ + u_long multicast; /* multicast packets received */ + u_long collisions; + + /* detailed rx_errors: */ + u_long rx_length_errors; + u_long rx_over_errors; /* receiver ring buff overflow */ + u_long rx_crc_errors; /* recv'd pkt with crc error */ + u_long rx_frame_errors; /* recv'd frame alignment error */ + u_long rx_fifo_errors; /* recv'r fifo overrun */ + u_long rx_missed_errors; /* recv'r missed packet */ + + /* detailed tx_errors */ + u_long tx_aborted_errors; + u_long tx_carrier_errors; + u_long tx_fifo_errors; + u_long tx_heartbeat_errors; + u_long tx_window_errors; + }; +#endif + +/* + * Item in a list of interfaces. + */ +struct pcap_if { + struct pcap_if *next; + char *name; /* name to hand to "pcap_open_live()" */ + char *description; /* textual description of interface, or NULL */ + struct pcap_addr *addresses; + bpf_u_int32 flags; /* PCAP_IF_ interface flags */ +}; + +#define PCAP_IF_LOOPBACK 0x00000001 /* interface is loopback */ + +/* + * Representation of an interface address. + */ +struct pcap_addr { + struct pcap_addr *next; + struct sockaddr *addr; /* address */ + struct sockaddr *netmask; /* netmask for that address */ + struct sockaddr *broadaddr; /* broadcast address for that address */ + struct sockaddr *dstaddr; /* P2P destination address for that address */ +}; + +typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *, + const u_char *); + +/* + * Error codes for the pcap API. + * These will all be negative, so you can check for the success or + * failure of a call that returns these codes by checking for a + * negative value. + */ +#define PCAP_ERROR -1 /* generic error code */ +#define PCAP_ERROR_BREAK -2 /* loop terminated by pcap_breakloop */ +#define PCAP_ERROR_NOT_ACTIVATED -3 /* the capture needs to be activated */ +#define PCAP_ERROR_ACTIVATED -4 /* the operation can't be performed on already activated captures */ +#define PCAP_ERROR_NO_SUCH_DEVICE -5 /* no such device exists */ +#define PCAP_ERROR_RFMON_NOTSUP -6 /* this device doesn't support rfmon (monitor) mode */ +#define PCAP_ERROR_NOT_RFMON -7 /* operation supported only in monitor mode */ +#define PCAP_ERROR_PERM_DENIED -8 /* no permission to open the device */ +#define PCAP_ERROR_IFACE_NOT_UP -9 /* interface isn't up */ + +/* + * Warning codes for the pcap API. + * These will all be positive and non-zero, so they won't look like + * errors. + */ +#define PCAP_WARNING 1 /* generic warning code */ +#define PCAP_WARNING_PROMISC_NOTSUP 2 /* this device doesn't support promiscuous mode */ + +char *pcap_lookupdev(char *); +int pcap_lookupnet(const char *, bpf_u_int32 *, bpf_u_int32 *, char *); + +pcap_t *pcap_create(const char *, char *); +int pcap_set_snaplen(pcap_t *, int); +int pcap_set_promisc(pcap_t *, int); +int pcap_can_set_rfmon(pcap_t *); +int pcap_set_rfmon(pcap_t *, int); +int pcap_set_timeout(pcap_t *, int); +int pcap_set_buffer_size(pcap_t *, int); +int pcap_activate(pcap_t *); + +pcap_t *pcap_open_live(const char *, int, int, int, char *); +pcap_t *pcap_open_dead(int, int); +pcap_t *pcap_open_offline(const char *, char *); +#if defined(WIN32) +pcap_t *pcap_hopen_offline(intptr_t, char *); +#if !defined(LIBPCAP_EXPORTS) +#define pcap_fopen_offline(f,b) \ + pcap_hopen_offline(_get_osfhandle(_fileno(f)), b) +#else /*LIBPCAP_EXPORTS*/ +static pcap_t *pcap_fopen_offline(FILE *, char *); +#endif +#else /*WIN32*/ +pcap_t *pcap_fopen_offline(FILE *, char *); +#endif /*WIN32*/ + +void pcap_close(pcap_t *); +int pcap_loop(pcap_t *, int, pcap_handler, u_char *); +int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *); +const u_char* + pcap_next(pcap_t *, struct pcap_pkthdr *); +int pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **); +void pcap_breakloop(pcap_t *); +int pcap_stats(pcap_t *, struct pcap_stat *); +int pcap_setfilter(pcap_t *, struct bpf_program *); +int pcap_setdirection(pcap_t *, pcap_direction_t); +int pcap_getnonblock(pcap_t *, char *); +int pcap_setnonblock(pcap_t *, int, char *); +int pcap_inject(pcap_t *, const void *, size_t); +int pcap_sendpacket(pcap_t *, const u_char *, int); +const char *pcap_statustostr(int); +const char *pcap_strerror(int); +char *pcap_geterr(pcap_t *); +void pcap_perror(pcap_t *, char *); +int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, + bpf_u_int32); +int pcap_compile_nopcap(int, int, struct bpf_program *, + const char *, int, bpf_u_int32); +void pcap_freecode(struct bpf_program *); +int pcap_offline_filter(struct bpf_program *, const struct pcap_pkthdr *, + const u_char *); +int pcap_datalink(pcap_t *); +int pcap_datalink_ext(pcap_t *); +int pcap_list_datalinks(pcap_t *, int **); +int pcap_set_datalink(pcap_t *, int); +void pcap_free_datalinks(int *); +int pcap_datalink_name_to_val(const char *); +const char *pcap_datalink_val_to_name(int); +const char *pcap_datalink_val_to_description(int); +int pcap_snapshot(pcap_t *); +int pcap_is_swapped(pcap_t *); +int pcap_major_version(pcap_t *); +int pcap_minor_version(pcap_t *); + +/* XXX */ +FILE *pcap_file(pcap_t *); +int pcap_fileno(pcap_t *); + +pcap_dumper_t *pcap_dump_open(pcap_t *, const char *); +pcap_dumper_t *pcap_dump_fopen(pcap_t *, FILE *fp); +FILE *pcap_dump_file(pcap_dumper_t *); +long pcap_dump_ftell(pcap_dumper_t *); +int pcap_dump_flush(pcap_dumper_t *); +void pcap_dump_close(pcap_dumper_t *); +void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *); + +int pcap_findalldevs(pcap_if_t **, char *); +void pcap_freealldevs(pcap_if_t *); + +const char *pcap_lib_version(void); + +/* XXX this guy lives in the bpf tree */ +u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +int bpf_validate(const struct bpf_insn *f, int len); +char *bpf_image(const struct bpf_insn *, int); +void bpf_dump(const struct bpf_program *, int); + +#if defined(WIN32) + +/* + * Win32 definitions + */ + +int pcap_setbuff(pcap_t *p, int dim); +int pcap_setmode(pcap_t *p, int mode); +int pcap_setmintocopy(pcap_t *p, int size); + +#ifdef WPCAP +/* Include file with the wpcap-specific extensions */ +#include +#endif /* WPCAP */ + +#define MODE_CAPT 0 +#define MODE_STAT 1 +#define MODE_MON 2 + +#elif defined(MSDOS) + +/* + * MS-DOS definitions + */ + +int pcap_stats_ex (pcap_t *, struct pcap_stat_ex *); +void pcap_set_wait (pcap_t *p, void (*yield)(void), int wait); +u_long pcap_mac_packets (void); + +#else /* UN*X */ + +/* + * UN*X definitions + */ + +int pcap_get_selectable_fd(pcap_t *); + +#endif /* WIN32/MSDOS/UN*X */ + +#ifdef HAVE_REMOTE +/* Includes most of the public stuff that is needed for the remote capture */ +#include +#endif /* HAVE_REMOTE */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/import/winpcap/Include/pcap/sll.h b/import/winpcap/Include/pcap/sll.h new file mode 100644 index 000000000..e9d5452af --- /dev/null +++ b/import/winpcap/Include/pcap/sll.h @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/sll.h,v 1.2.2.1 2008-05-30 01:36:06 guy Exp $ (LBL) + */ + +/* + * For captures on Linux cooked sockets, we construct a fake header + * that includes: + * + * a 2-byte "packet type" which is one of: + * + * LINUX_SLL_HOST packet was sent to us + * LINUX_SLL_BROADCAST packet was broadcast + * LINUX_SLL_MULTICAST packet was multicast + * LINUX_SLL_OTHERHOST packet was sent to somebody else + * LINUX_SLL_OUTGOING packet was sent *by* us; + * + * a 2-byte Ethernet protocol field; + * + * a 2-byte link-layer type; + * + * a 2-byte link-layer address length; + * + * an 8-byte source link-layer address, whose actual length is + * specified by the previous value. + * + * All fields except for the link-layer address are in network byte order. + * + * DO NOT change the layout of this structure, or change any of the + * LINUX_SLL_ values below. If you must change the link-layer header + * for a "cooked" Linux capture, introduce a new DLT_ type (ask + * "tcpdump-workers@lists.tcpdump.org" for one, so that you don't give it + * a value that collides with a value already being used), and use the + * new header in captures of that type, so that programs that can + * handle DLT_LINUX_SLL captures will continue to handle them correctly + * without any change, and so that capture files with different headers + * can be told apart and programs that read them can dissect the + * packets in them. + */ + +#ifndef lib_pcap_sll_h +#define lib_pcap_sll_h + +/* + * A DLT_LINUX_SLL fake link-layer header. + */ +#define SLL_HDR_LEN 16 /* total header length */ +#define SLL_ADDRLEN 8 /* length of address field */ + +struct sll_header { + u_int16_t sll_pkttype; /* packet type */ + u_int16_t sll_hatype; /* link-layer address type */ + u_int16_t sll_halen; /* link-layer address length */ + u_int8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */ + u_int16_t sll_protocol; /* protocol */ +}; + +/* + * The LINUX_SLL_ values for "sll_pkttype"; these correspond to the + * PACKET_ values on Linux, but are defined here so that they're + * available even on systems other than Linux, and so that they + * don't change even if the PACKET_ values change. + */ +#define LINUX_SLL_HOST 0 +#define LINUX_SLL_BROADCAST 1 +#define LINUX_SLL_MULTICAST 2 +#define LINUX_SLL_OTHERHOST 3 +#define LINUX_SLL_OUTGOING 4 + +/* + * The LINUX_SLL_ values for "sll_protocol"; these correspond to the + * ETH_P_ values on Linux, but are defined here so that they're + * available even on systems other than Linux. We assume, for now, + * that the ETH_P_ values won't change in Linux; if they do, then: + * + * if we don't translate them in "pcap-linux.c", capture files + * won't necessarily be readable if captured on a system that + * defines ETH_P_ values that don't match these values; + * + * if we do translate them in "pcap-linux.c", that makes life + * unpleasant for the BPF code generator, as the values you test + * for in the kernel aren't the values that you test for when + * reading a capture file, so the fixup code run on BPF programs + * handed to the kernel ends up having to do more work. + * + * Add other values here as necessary, for handling packet types that + * might show up on non-Ethernet, non-802.x networks. (Not all the ones + * in the Linux "if_ether.h" will, I suspect, actually show up in + * captures.) + */ +#define LINUX_SLL_P_802_3 0x0001 /* Novell 802.3 frames without 802.2 LLC header */ +#define LINUX_SLL_P_802_2 0x0004 /* 802.2 frames (not D/I/X Ethernet) */ + +#endif diff --git a/import/winpcap/Include/pcap/usb.h b/import/winpcap/Include/pcap/usb.h new file mode 100644 index 000000000..adcd19c05 --- /dev/null +++ b/import/winpcap/Include/pcap/usb.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2006 Paolo Abeni (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Basic USB data struct + * By Paolo Abeni + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/usb.h,v 1.6 2007/09/22 02:06:08 guy Exp $ + */ + +#ifndef _PCAP_USB_STRUCTS_H__ +#define _PCAP_USB_STRUCTS_H__ + +/* + * possible transfer mode + */ +#define URB_TRANSFER_IN 0x80 +#define URB_ISOCHRONOUS 0x0 +#define URB_INTERRUPT 0x1 +#define URB_CONTROL 0x2 +#define URB_BULK 0x3 + +/* + * possible event type + */ +#define URB_SUBMIT 'S' +#define URB_COMPLETE 'C' +#define URB_ERROR 'E' + +/* + * USB setup header as defined in USB specification. + * Appears at the front of each packet in DLT_USB captures. + */ +typedef struct _usb_setup { + u_int8_t bmRequestType; + u_int8_t bRequest; + u_int16_t wValue; + u_int16_t wIndex; + u_int16_t wLength; +} pcap_usb_setup; + + +/* + * Header prepended by linux kernel to each event. + * Appears at the front of each packet in DLT_USB_LINUX captures. + */ +typedef struct _usb_header { + u_int64_t id; + u_int8_t event_type; + u_int8_t transfer_type; + u_int8_t endpoint_number; + u_int8_t device_address; + u_int16_t bus_id; + char setup_flag;/*if !=0 the urb setup header is not present*/ + char data_flag; /*if !=0 no urb data is present*/ + int64_t ts_sec; + int32_t ts_usec; + int32_t status; + u_int32_t urb_len; + u_int32_t data_len; /* amount of urb data really present in this event*/ + pcap_usb_setup setup; +} pcap_usb_header; + + +#endif diff --git a/import/winpcap/Include/pcap/vlan.h b/import/winpcap/Include/pcap/vlan.h new file mode 100644 index 000000000..b0cb7949b --- /dev/null +++ b/import/winpcap/Include/pcap/vlan.h @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/vlan.h,v 1.1.2.2 2008-08-06 07:45:59 guy Exp $ + */ + +#ifndef lib_pcap_vlan_h +#define lib_pcap_vlan_h + +struct vlan_tag { + u_int16_t vlan_tpid; /* ETH_P_8021Q */ + u_int16_t vlan_tci; /* VLAN TCI */ +}; + +#define VLAN_TAG_LEN 4 + +#endif diff --git a/import/winpcap/Include/remote-ext.h b/import/winpcap/Include/remote-ext.h new file mode 100644 index 000000000..35a2fff6c --- /dev/null +++ b/import/winpcap/Include/remote-ext.h @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2002 - 2003 + * NetGroup, Politecnico di Torino (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#ifndef __REMOTE_EXT_H__ +#define __REMOTE_EXT_H__ + + +#ifndef HAVE_REMOTE +#error Please do not include this file directly. Just define HAVE_REMOTE and then include pcap.h +#endif + +// Definition for Microsoft Visual Studio +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + \file remote-ext.h + + The goal of this file it to include most of the new definitions that should be + placed into the pcap.h file. + + It includes all new definitions (structures and functions like pcap_open(). + Some of the functions are not really a remote feature, but, right now, + they are placed here. +*/ + + + +// All this stuff is public +/*! \addtogroup remote_struct + \{ +*/ + + + + +/*! + \brief Defines the maximum buffer size in which address, port, interface names are kept. + + In case the adapter name or such is larger than this value, it is truncated. + This is not used by the user; however it must be aware that an hostname / interface + name longer than this value will be truncated. +*/ +#define PCAP_BUF_SIZE 1024 + + +/*! \addtogroup remote_source_ID + \{ +*/ + + +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a file, i.e. the user want to open a capture from a local file. +*/ +#define PCAP_SRC_FILE 2 +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a local interface, i.e. the user want to open a capture from + a local interface. This does not involve the RPCAP protocol. +*/ +#define PCAP_SRC_IFLOCAL 3 +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a remote interface, i.e. the user want to open a capture from + an interface on a remote host. This does involve the RPCAP protocol. +*/ +#define PCAP_SRC_IFREMOTE 4 + +/*! + \} +*/ + + + +/*! \addtogroup remote_source_string + + The formats allowed by the pcap_open() are the following: + - file://path_and_filename [opens a local file] + - rpcap://devicename [opens the selected device devices available on the local host, without using the RPCAP protocol] + - rpcap://host/devicename [opens the selected device available on a remote host] + - rpcap://host:port/devicename [opens the selected device available on a remote host, using a non-standard port for RPCAP] + - adaptername [to open a local adapter; kept for compability, but it is strongly discouraged] + - (NULL) [to open the first local adapter; kept for compability, but it is strongly discouraged] + + The formats allowed by the pcap_findalldevs_ex() are the following: + - file://folder/ [lists all the files in the given folder] + - rpcap:// [lists all local adapters] + - rpcap://host:port/ [lists the devices available on a remote host] + + Referring to the 'host' and 'port' paramters, they can be either numeric or literal. Since + IPv6 is fully supported, these are the allowed formats: + + - host (literal): e.g. host.foo.bar + - host (numeric IPv4): e.g. 10.11.12.13 + - host (numeric IPv4, IPv6 style): e.g. [10.11.12.13] + - host (numeric IPv6): e.g. [1:2:3::4] + - port: can be either numeric (e.g. '80') or literal (e.g. 'http') + + Here you find some allowed examples: + - rpcap://host.foo.bar/devicename [everything literal, no port number] + - rpcap://host.foo.bar:1234/devicename [everything literal, with port number] + - rpcap://10.11.12.13/devicename [IPv4 numeric, no port number] + - rpcap://10.11.12.13:1234/devicename [IPv4 numeric, with port number] + - rpcap://[10.11.12.13]:1234/devicename [IPv4 numeric with IPv6 format, with port number] + - rpcap://[1:2:3::4]/devicename [IPv6 numeric, no port number] + - rpcap://[1:2:3::4]:1234/devicename [IPv6 numeric, with port number] + - rpcap://[1:2:3::4]:http/devicename [IPv6 numeric, with literal port number] + + \{ +*/ + + +/*! + \brief String that will be used to determine the type of source in use (file, + remote/local interface). + + This string will be prepended to the interface name in order to create a string + that contains all the information required to open the source. + + This string indicates that the user wants to open a capture from a local file. +*/ +#define PCAP_SRC_FILE_STRING "file://" +/*! + \brief String that will be used to determine the type of source in use (file, + remote/local interface). + + This string will be prepended to the interface name in order to create a string + that contains all the information required to open the source. + + This string indicates that the user wants to open a capture from a network interface. + This string does not necessarily involve the use of the RPCAP protocol. If the + interface required resides on the local host, the RPCAP protocol is not involved + and the local functions are used. +*/ +#define PCAP_SRC_IF_STRING "rpcap://" + +/*! + \} +*/ + + + + + +/*! + \addtogroup remote_open_flags + \{ +*/ + +/*! + \brief Defines if the adapter has to go in promiscuous mode. + + It is '1' if you have to open the adapter in promiscuous mode, '0' otherwise. + Note that even if this parameter is false, the interface could well be in promiscuous + mode for some other reason (for example because another capture process with + promiscuous mode enabled is currently using that interface). + On on Linux systems with 2.2 or later kernels (that have the "any" device), this + flag does not work on the "any" device; if an argument of "any" is supplied, + the 'promisc' flag is ignored. +*/ +#define PCAP_OPENFLAG_PROMISCUOUS 1 + +/*! + \brief Defines if the data trasfer (in case of a remote + capture) has to be done with UDP protocol. + + If it is '1' if you want a UDP data connection, '0' if you want + a TCP data connection; control connection is always TCP-based. + A UDP connection is much lighter, but it does not guarantee that all + the captured packets arrive to the client workstation. Moreover, + it could be harmful in case of network congestion. + This flag is meaningless if the source is not a remote interface. + In that case, it is simply ignored. +*/ +#define PCAP_OPENFLAG_DATATX_UDP 2 + + +/*! + \brief Defines if the remote probe will capture its own generated traffic. + + In case the remote probe uses the same interface to capture traffic and to send + data back to the caller, the captured traffic includes the RPCAP traffic as well. + If this flag is turned on, the RPCAP traffic is excluded from the capture, so that + the trace returned back to the collector is does not include this traffic. +*/ +#define PCAP_OPENFLAG_NOCAPTURE_RPCAP 4 + +/*! + \brief Defines if the local adapter will capture its own generated traffic. + + This flag tells the underlying capture driver to drop the packets that were sent by itself. + This is usefult when building applications like bridges, that should ignore the traffic + they just sent. +*/ +#define PCAP_OPENFLAG_NOCAPTURE_LOCAL 8 + +/*! + \brief This flag configures the adapter for maximum responsiveness. + + In presence of a large value for nbytes, WinPcap waits for the arrival of several packets before + copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, + i.e. better performance, which is good for applications like sniffers. If the user sets the + PCAP_OPENFLAG_MAX_RESPONSIVENESS flag, the capture driver will copy the packets as soon as the application + is ready to receive them. This is suggested for real time applications (like, for example, a bridge) + that need the best responsiveness.*/ +#define PCAP_OPENFLAG_MAX_RESPONSIVENESS 16 + +/*! + \} +*/ + + +/*! + \addtogroup remote_samp_methods + \{ +*/ + +/*! + \brief No sampling has to be done on the current capture. + + In this case, no sampling algorithms are applied to the current capture. +*/ +#define PCAP_SAMP_NOSAMP 0 + +/*! + \brief It defines that only 1 out of N packets must be returned to the user. + + In this case, the 'value' field of the 'pcap_samp' structure indicates the + number of packets (minus 1) that must be discarded before one packet got accepted. + In other words, if 'value = 10', the first packet is returned to the caller, while + the following 9 are discarded. +*/ +#define PCAP_SAMP_1_EVERY_N 1 + +/*! + \brief It defines that we have to return 1 packet every N milliseconds. + + In this case, the 'value' field of the 'pcap_samp' structure indicates the 'waiting + time' in milliseconds before one packet got accepted. + In other words, if 'value = 10', the first packet is returned to the caller; the next + returned one will be the first packet that arrives when 10ms have elapsed. +*/ +#define PCAP_SAMP_FIRST_AFTER_N_MS 2 + +/*! + \} +*/ + + +/*! + \addtogroup remote_auth_methods + \{ +*/ + +/*! + \brief It defines the NULL authentication. + + This value has to be used within the 'type' member of the pcap_rmtauth structure. + The 'NULL' authentication has to be equal to 'zero', so that old applications + can just put every field of struct pcap_rmtauth to zero, and it does work. +*/ +#define RPCAP_RMTAUTH_NULL 0 +/*! + \brief It defines the username/password authentication. + + With this type of authentication, the RPCAP protocol will use the username/ + password provided to authenticate the user on the remote machine. If the + authentication is successful (and the user has the right to open network devices) + the RPCAP connection will continue; otherwise it will be dropped. + + This value has to be used within the 'type' member of the pcap_rmtauth structure. +*/ +#define RPCAP_RMTAUTH_PWD 1 + +/*! + \} +*/ + + + + +/*! + + \brief This structure keeps the information needed to autheticate + the user on a remote machine. + + The remote machine can either grant or refuse the access according + to the information provided. + In case the NULL authentication is required, both 'username' and + 'password' can be NULL pointers. + + This structure is meaningless if the source is not a remote interface; + in that case, the functions which requires such a structure can accept + a NULL pointer as well. +*/ +struct pcap_rmtauth +{ + /*! + \brief Type of the authentication required. + + In order to provide maximum flexibility, we can support different types + of authentication based on the value of this 'type' variable. The currently + supported authentication methods are defined into the + \link remote_auth_methods Remote Authentication Methods Section\endlink. + + */ + int type; + /*! + \brief Zero-terminated string containing the username that has to be + used on the remote machine for authentication. + + This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication + and it can be NULL. + */ + char *username; + /*! + \brief Zero-terminated string containing the password that has to be + used on the remote machine for authentication. + + This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication + and it can be NULL. + */ + char *password; +}; + + +/*! + \brief This structure defines the information related to sampling. + + In case the sampling is requested, the capturing device should read + only a subset of the packets coming from the source. The returned packets depend + on the sampling parameters. + + \warning The sampling process is applied after the filtering process. + In other words, packets are filtered first, then the sampling process selects a + subset of the 'filtered' packets and it returns them to the caller. +*/ +struct pcap_samp +{ + /*! + Method used for sampling. Currently, the supported methods are listed in the + \link remote_samp_methods Sampling Methods Section\endlink. + */ + int method; + + /*! + This value depends on the sampling method defined. For its meaning, please check + at the \link remote_samp_methods Sampling Methods Section\endlink. + */ + int value; +}; + + + + +//! Maximum lenght of an host name (needed for the RPCAP active mode) +#define RPCAP_HOSTLIST_SIZE 1024 + + +/*! + \} +*/ // end of public documentation + + +// Exported functions + + + +/** \name New WinPcap functions + + This section lists the new functions that are able to help considerably in writing + WinPcap programs because of their easiness of use. + */ +//\{ +pcap_t *pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf); +int pcap_createsrcstr(char *source, int type, const char *host, const char *port, const char *name, char *errbuf); +int pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf); +int pcap_findalldevs_ex(char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf); +struct pcap_samp *pcap_setsampling(pcap_t *p); + +//\} +// End of new winpcap functions + + + +/** \name Remote Capture functions + */ +//\{ +SOCKET pcap_remoteact_accept(const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf); +int pcap_remoteact_list(char *hostlist, char sep, int size, char *errbuf); +int pcap_remoteact_close(const char *host, char *errbuf); +void pcap_remoteact_cleanup(); +//\} +// End of remote capture functions + +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/import/winpcap/Lib/Packet.lib b/import/winpcap/Lib/Packet.lib new file mode 100644 index 000000000..81618bc8c Binary files /dev/null and b/import/winpcap/Lib/Packet.lib differ diff --git a/import/winpcap/Lib/wpcap.lib b/import/winpcap/Lib/wpcap.lib new file mode 100644 index 000000000..f832e0445 Binary files /dev/null and b/import/winpcap/Lib/wpcap.lib differ diff --git a/import/winpcap/Lib/x64/Packet.lib b/import/winpcap/Lib/x64/Packet.lib new file mode 100644 index 000000000..30c154050 Binary files /dev/null and b/import/winpcap/Lib/x64/Packet.lib differ diff --git a/import/winpcap/Lib/x64/wpcap.lib b/import/winpcap/Lib/x64/wpcap.lib new file mode 100644 index 000000000..d5559f802 Binary files /dev/null and b/import/winpcap/Lib/x64/wpcap.lib differ diff --git a/projects/cxbx/CMakeLists.txt b/projects/cxbx/CMakeLists.txt new file mode 100644 index 000000000..706ba283d --- /dev/null +++ b/projects/cxbx/CMakeLists.txt @@ -0,0 +1,200 @@ +cmake_minimum_required (VERSION 3.12) +project(cxbx) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) + +# Suppress extra stuff from generated solution +set(CMAKE_SUPPRESS_REGENERATION true) + +include_directories( + "${CXBXR_ROOT_DIR}/src" + "${CXBXR_ROOT_DIR}/src/common" + "${CXBXR_ROOT_DIR}/src/common/Win32" + "${CXBXR_ROOT_DIR}/import/OpenXDK/include" + "${CXBXR_ROOT_DIR}/import/distorm/include" + "${CXBXR_ROOT_DIR}/import/glew-2.0.0/include" + "${CXBXR_ROOT_DIR}/import/subhook" + "${CXBXR_ROOT_DIR}/import/DirectX9/include" + "${CXBXR_ROOT_DIR}/import/XbSymbolDatabase" + "${CXBXR_ROOT_DIR}/import/simpleini" + "${CXBXR_ROOT_DIR}/import/libtommath" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers" + "${CXBXR_ROOT_DIR}/import/winpcap/Include" + "${CXBXR_ROOT_DIR}/import/SDL2/include" +) + +link_directories( + "${CXBXR_ROOT_DIR}/import/distorm/lib/Win32" + "${CXBXR_ROOT_DIR}/import/glew-2.0.0/lib/Release/Win32" + "${CXBXR_ROOT_DIR}/import/DirectX9/lib" + "${CXBXR_ROOT_DIR}/import/winpcap/Lib" +) + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + add_compile_definitions( + _CRT_SECURE_NO_WARNINGS + # Windows 7 minimum requirement + _WIN32_WINNT=0x0601 + LTM_DESC + USE_LTM + LTC_NO_TEST + LTC_NO_CIPHERS + LTC_NO_HASHES + LTC_NO_MACS + LTC_NO_PRNGS + LTC_NO_MISC + LTC_NO_PROTOTYPES + ) + + # Reference: https://docs.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-alphabetically + add_compile_options( + # Catch synchronous (C++) exceptions only + # plus assume extern "C" may throw exception + /EHs + # Compile multiple source files by using multiple processes. + /MP + # Enable string pooling (reduce duplicate strings) + /GF + # Enable SSE2 code generation + /arch:SSE2 + ) +endif() + +add_compile_definitions(NOMINMAX + +# Use inline XXHash version +XXH_INLINE_ALL +) + +file (GLOB RESOURCES + + "${CXBXR_ROOT_DIR}/CONTRIBUTORS" + "${CXBXR_ROOT_DIR}/COPYING" + "${CXBXR_ROOT_DIR}/README.md" + "${CXBXR_ROOT_DIR}/resource/.editorconfig" + "${CXBXR_ROOT_DIR}/resource/Cxbx.rc" + "${CXBXR_ROOT_DIR}/resource/Cxbx-R.ico" + "${CXBXR_ROOT_DIR}/resource/Logo.bmp" + "${CXBXR_ROOT_DIR}/resource/Logo-License-CC4.bmp" + "${CXBXR_ROOT_DIR}/src/.editorconfig" +) + +source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX header FILES + ${CXBXR_HEADER_GUIv1} + ${CXBXR_HEADER_COMMON} + ${CXBXR_HEADER_EMU} +) + +source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX source FILES + ${CXBXR_SOURCE_GUIv1} + ${CXBXR_SOURCE_COMMON} + ${CXBXR_SOURCE_EMU} +) + +source_group(TREE ${CXBXR_ROOT_DIR} FILES ${RESOURCES}) + +add_executable(cxbx WIN32 ${RESOURCES} + ${CXBXR_HEADER_GUIv1} + ${CXBXR_HEADER_COMMON} + ${CXBXR_HEADER_EMU} + ${CXBXR_SOURCE_GUIv1} + ${CXBXR_SOURCE_COMMON} + ${CXBXR_SOURCE_EMU} + ${CXBXR_GIT_VERSION_H} +) + +# Link and compile flags +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + + # Reference: https://docs.microsoft.com/en-us/cpp/build/reference/linker-options + set_target_properties(cxbx PROPERTIES + LINK_FLAGS " + /INCREMENTAL:NO + /LARGEADDRESSAWARE + /FIXED + /SAFESEH:NO + /DYNAMICBASE:NO + /BASE:0x10000 + /STACK:65536,65536 + /NODEFAULTLIB:libcmt + /DELAYLOAD:wpcap.dll + " + LINK_FLAGS_RELEASE " + /LTCG + /DEBUG + " + ) + + # Reference: https://docs.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-alphabetically + # /Zi = create a PDB file without affecting optimization + # /Ob2 = Controls inline expansion of functions. + # /Oi = Generate intrinsic functions + # /Ot = In favor of using fast code than small code + # /GL = Whole program optimization + # /GS- = Remove buffer security check + # /Gy = Enable function-level linking + # /Qpar = Enable automatic parallelize loops in the code + + # Set optimization options for release build + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} + /Zi + /Ob2 + /Oi + /Ot + /GL + + /GS- + /Gy + /Qpar + " + ) + + # disable optimization for CxbxKrnl.cpp file + set_source_files_properties( + ${CXBXR_KRNL_CPP} PROPERTIES COMPILE_FLAGS "/Od /GL-" + ) +endif() + +# Windows libraries +set(WINS_LIB + legacy_stdio_definitions + d3d9 + d3dcompiler + dinput8 + dxguid + odbc32 + odbccp32 + Shlwapi + dxerr9 + ws2_32 + dsound + winmm + ddraw + d3dx9 + dbghelp + comctl32 + XINPUT9_1_0 + Iphlpapi + wpcap +) + +target_link_libraries(cxbx + PUBLIC XbSymbolDatabase + subhook + libtomcrypt + SDL2 + + ${WINS_LIB} +) + +if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") + add_dependencies(cxbx cxbxr-debugger) +endif() + +set(CXBXR_GLEW_DLL "${CXBXR_ROOT_DIR}/import/glew-2.0.0/bin/Release/Win32/glew32.dll") + +# Copy glew32.dll to build type's folder after build. +add_custom_command(TARGET cxbx POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CXBXR_GLEW_DLL} $ +) diff --git a/projects/debugger/README.md b/projects/debugger/README.md new file mode 100644 index 000000000..ea256070d --- /dev/null +++ b/projects/debugger/README.md @@ -0,0 +1,2 @@ +Since cmake isn't able to perform virtual folder group from source_group command. +Go to /src/CxbxDebugger directory to find CMakeLists.txt file for any updates if need to. \ No newline at end of file diff --git a/projects/libtom/CMakeLists.txt b/projects/libtom/CMakeLists.txt new file mode 100644 index 000000000..f0b0124ae --- /dev/null +++ b/projects/libtom/CMakeLists.txt @@ -0,0 +1,3 @@ + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/crypt") +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/math") diff --git a/projects/libtom/crypt/CMakeLists.txt b/projects/libtom/crypt/CMakeLists.txt new file mode 100644 index 000000000..086f1ca1e --- /dev/null +++ b/projects/libtom/crypt/CMakeLists.txt @@ -0,0 +1,469 @@ +cmake_minimum_required (VERSION 3.8) +project(libtomcrypt) + +# Suppress extra stuff from generated solution +set(CMAKE_SUPPRESS_REGENERATION true) + +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") + add_compile_definitions( + _CRT_SECURE_NO_WARNINGS + _CRT_NONSTDC_NO_DEPRECATE + ) +endif() + +add_compile_definitions( + LTC_SOURCE + LTC_NO_TEST + LTC_NO_PROTOTYPES +) + +include_directories( + "${CXBXR_ROOT_DIR}/import/libtommath" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers" +) + +file (GLOB HEADERS + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_argchk.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_cfg.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_cipher.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_custom.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_hash.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_mac.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_macros.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_math.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_misc.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_pk.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_pkcs.h" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers/tomcrypt_prng.h" +) + +file (GLOB SOURCES + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/aes/aes.c" +#EXCLUDE "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/aes/aes_tab.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/anubis.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/blowfish.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/camellia.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/cast5.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/des.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/kasumi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/khazad.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/kseed.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/multi2.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/noekeon.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/rc2.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/rc5.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/rc6.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/safer/safer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/safer/saferp.c" +#EXCLUDE "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/safer/safer_tab.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/skipjack.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/twofish/twofish.c" +#EXCLUDE "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/twofish/twofish_tab.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/ciphers/xtea.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_add_aad.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_add_nonce.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_reset.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ccm/ccm_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_add_aad.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/chachapoly/chacha20poly1305_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_addheader.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_decrypt_verify_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_encrypt_authenticate_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/eax/eax_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_add_aad.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_add_iv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_gf_mult.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_mult_h.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_reset.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/gcm/gcm_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_decrypt_verify_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_done_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_done_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_encrypt_authenticate_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_ntz.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_shift_xor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/ocb_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb/s_ocb_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_add_aad.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_last.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_decrypt_verify_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_encrypt_last.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_int_ntz.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_int_xor_blocks.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/encauth/ocb3/ocb3_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/blake2b.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/blake2s.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/chc/chc.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/helper/hash_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/helper/hash_filehandle.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/helper/hash_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/helper/hash_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/md2.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/md4.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/md5.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/rmd128.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/rmd160.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/rmd256.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/rmd320.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha1.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha224.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha256.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha384.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha512.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha512_224.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha2/sha512_256.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha3.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/sha3_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/tiger.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/whirl/whirl.c" +#EXCLUDE "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/hashes/whirl/whirltab.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2bmac.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2bmac_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2bmac_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2bmac_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2bmac_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2smac.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2smac_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2smac_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2smac_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/blake2/blake2smac_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/f9/f9_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/hmac/hmac_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/omac/omac_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pelican/pelican.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pelican/pelican_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pelican/pelican_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_ntz.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_shift_xor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/pmac/pmac_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/poly1305/poly1305.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/poly1305/poly1305_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/poly1305/poly1305_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/poly1305/poly1305_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/poly1305/poly1305_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_file.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_memory.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_memory_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/mac/xcbc/xcbc_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/fp/ltc_ecc_fp_mulmod.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/gmp_desc.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/ltm_desc.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/radix_to_bin.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/rand_bn.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/rand_prime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/math/tfm_desc.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/adler32.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/base64/base64_decode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/base64/base64_encode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/burn_stack.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/compare_testvector.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crc32.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_argchk.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_cipher_descriptor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_cipher_is_valid.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_constants.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_cipher.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_cipher_any.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_cipher_id.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_hash_any.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_hash_id.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_hash_oid.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_find_prng.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_fsa.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_hash_descriptor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_inits.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_ltc_mp_descriptor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_prng_descriptor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_prng_is_valid.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_prng_rng_descriptor.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_all_ciphers.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_all_hashes.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_all_prngs.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_cipher.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_register_prng.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_sizes.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_unregister_cipher.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_unregister_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/crypt/crypt_unregister_prng.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/error_to_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/hkdf/hkdf.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/hkdf/hkdf_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/mem_neq.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/pkcs5/pkcs_5_1.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/pkcs5/pkcs_5_2.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/pkcs5/pkcs_5_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/pk_get_oid.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/misc/zeromem.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cbc/cbc_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/cfb/cfb_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ctr/ctr_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ecb/ecb_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ecb/ecb_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ecb/ecb_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ecb/ecb_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/f8/f8_test_mode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_process.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/lrw/lrw_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_getiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_setiv.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/ofb/ofb_start.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_decrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_encrypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_init.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_mult_x.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/modes/xts/xts_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/bit/der_decode_raw_bit_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/bit/der_encode_raw_bit_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/bit/der_length_bit_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/boolean/der_encode_boolean.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/boolean/der_length_boolean.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/choice/der_decode_choice.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/ia5/der_decode_ia5_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/ia5/der_length_ia5_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/integer/der_decode_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/integer/der_encode_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/integer/der_length_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/object_identifier/der_length_object_identifier.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/octet/der_decode_octet_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/octet/der_encode_octet_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/octet/der_length_octet_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/printable_string/der_decode_printable_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/printable_string/der_encode_printable_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/printable_string/der_length_printable_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_ex.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_ex.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_length_sequence.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_shrink.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/set/der_encode_set.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/set/der_encode_setof.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/short_integer/der_decode_short_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/short_integer/der_encode_short_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/short_integer/der_length_short_integer.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/teletex_string/der_length_teletex_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utctime/der_encode_utctime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utctime/der_length_utctime.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utf8/der_decode_utf8_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utf8/der_encode_utf8_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/asn1/der/utf8/der_length_utf8_string.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_check_pubkey.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_export_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_generate_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_set.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_set_pg_dhparam.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dh/dh_shared_secret.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_decrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_encrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_generate_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_generate_pqg.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_make_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_set.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_set_pqg_dsaparam.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_shared_secret.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_sign_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_verify_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/dsa/dsa_verify_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_ansi_x963_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_ansi_x963_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_decrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_encrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_get_size.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_make_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_shared_secret.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_sign_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_sizes.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ecc_verify_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_is_valid_idx.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_map.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_points.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_decrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_encrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_exptmod.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/katja/katja_make_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_i2osp.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_os2ip.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_export.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_exptmod.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_free.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_get_size.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_import.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_import_x509.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_make_key.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_set.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_sign_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_sign_saltlen_get.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/pk/rsa/rsa_verify_hash.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/chacha20.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/fortuna.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/rc4.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/rng_get_bytes.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/rng_make_prng.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/sober128.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/sprng.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/prngs/yarrow.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_crypt.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_done.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_ivctr32.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_ivctr64.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_keystream.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_setup.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/chacha/chacha_test.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/rc4/rc4_stream.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/rc4/rc4_test.c" +#EXCLUDE "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/sober128/sober128tab.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/sober128/sober128_stream.c" + "${CXBXR_ROOT_DIR}/import/libtomcrypt/src/stream/sober128/sober128_test.c" + +) + +source_group(TREE ${CXBXR_ROOT_DIR}/import/libtomcrypt/src/headers PREFIX header FILES ${HEADERS}) + +source_group(TREE ${CXBXR_ROOT_DIR}/import/libtomcrypt/src PREFIX source FILES ${SOURCES}) + +add_library(libtomcrypt ${HEADERS} ${SOURCES}) + +target_compile_definitions(libtomcrypt PUBLIC LTM_DESC=1) + +target_link_libraries(libtomcrypt + PUBLIC libtommath + + ${WINS_LIB} +) diff --git a/projects/libtom/math/CMakeLists.txt b/projects/libtom/math/CMakeLists.txt new file mode 100644 index 000000000..a212fc9bb --- /dev/null +++ b/projects/libtom/math/CMakeLists.txt @@ -0,0 +1,172 @@ +cmake_minimum_required (VERSION 3.8) +project(libtommath) + +# Suppress extra stuff from generated solution +set(CMAKE_SUPPRESS_REGENERATION true) + +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") + add_compile_definitions( + _CRT_SECURE_NO_WARNINGS + _CRT_NONSTDC_NO_DEPRECATE + ) +endif() + + +include_directories( + "${CXBXR_ROOT_DIR}/import/libtommath" +) + +file (GLOB HEADERS + "${CXBXR_ROOT_DIR}/import/libtommath/tommath.h" + "${CXBXR_ROOT_DIR}/import/libtommath/tommath_class.h" + "${CXBXR_ROOT_DIR}/import/libtommath/tommath_private.h" + "${CXBXR_ROOT_DIR}/import/libtommath/tommath_superclass.h" +) + +file (GLOB SOURCES + "${CXBXR_ROOT_DIR}/import/libtommath/bncore.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_error.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_fast_mp_invmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_fast_mp_montgomery_reduce.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_fast_s_mp_mul_digs.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_fast_s_mp_mul_high_digs.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_fast_s_mp_sqr.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_2expt.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_abs.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_add.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_addmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_add_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_and.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_clamp.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_clear.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_clear_multi.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_cmp.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_cmp_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_cmp_mag.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_cnt_lsb.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_complement.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_copy.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_count_bits.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_div.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_div_2.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_div_2d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_div_3.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_div_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_dr_is_modulus.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_dr_reduce.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_dr_setup.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_exch.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_export.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_exptmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_exptmod_fast.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_expt_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_expt_d_ex.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_exteuclid.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_fread.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_fwrite.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_gcd.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_get_bit.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_get_double.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_get_int.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_get_long.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_get_long_long.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_grow.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_import.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init_copy.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init_multi.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init_set.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init_set_int.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_init_size.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_invmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_invmod_slow.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_is_square.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_jacobi.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_karatsuba_mul.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_karatsuba_sqr.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_kronecker.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_lcm.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_lshd.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mod_2d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mod_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_montgomery_calc_normalization.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_montgomery_reduce.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_montgomery_setup.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mul.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mulmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mul_2.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mul_2d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_mul_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_neg.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_n_root.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_n_root_ex.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_or.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_fermat.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_frobenius_underwood.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_is_divisible.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_is_prime.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_miller_rabin.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_next_prime.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_rabin_miller_trials.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_random_ex.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_prime_strong_lucas_selfridge.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_radix_size.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_radix_smap.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_rand.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_read_radix.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_read_signed_bin.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_read_unsigned_bin.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_2k.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_2k_l.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_2k_setup.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_2k_setup_l.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_is_2k.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_is_2k_l.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_reduce_setup.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_rshd.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_set.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_set_double.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_set_int.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_set_long.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_set_long_long.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_shrink.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_signed_bin_size.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sqr.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sqrmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sqrt.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sqrtmod_prime.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sub.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_submod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_sub_d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_tc_and.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_tc_div_2d.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_tc_or.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_tc_xor.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_toom_mul.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_toom_sqr.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_toradix.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_toradix_n.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_to_signed_bin.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_to_signed_bin_n.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_to_unsigned_bin.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_to_unsigned_bin_n.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_unsigned_bin_size.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_xor.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_mp_zero.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_prime_tab.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_reverse.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_add.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_exptmod.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_mul_digs.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_mul_high_digs.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_sqr.c" + "${CXBXR_ROOT_DIR}/import/libtommath/bn_s_mp_sub.c" +) + +source_group(TREE ${CXBXR_ROOT_DIR}/import/libtommath PREFIX header FILES ${HEADERS}) + +source_group(TREE ${CXBXR_ROOT_DIR}/import/libtommath PREFIX source FILES ${SOURCES}) + +add_library(libtommath ${HEADERS} ${SOURCES}) diff --git a/projects/vsbc/CMakeLists.txt b/projects/vsbc/CMakeLists.txt new file mode 100644 index 000000000..31794561c --- /dev/null +++ b/projects/vsbc/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required (VERSION 3.8) +project(vsbc) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) + +# Suppress extra stuff from generated solution +set(CMAKE_SUPPRESS_REGENERATION true) + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + add_compile_definitions(_CRT_SECURE_NO_WARNINGS + ) +endif() + +add_compile_definitions(CXBXVSBC_EXPORTS +) + +file (GLOB HEADERS + "${CXBXR_ROOT_DIR}/src/vsbc/CxbxVSBC.h" + "${CXBXR_ROOT_DIR}/src/vsbc/DlgVirtualSBCFeedback.h" + "${CXBXR_ROOT_DIR}/src/vsbc/stdafx.h" + "${CXBXR_ROOT_DIR}/src/vsbc/targetver.h" +) + +file (GLOB SOURCES + "${CXBXR_ROOT_DIR}/src/vsbc/CxbxVSBC.cpp" + "${CXBXR_ROOT_DIR}/src/vsbc/DlgVirtualSBCFeedback.cpp" + "${CXBXR_ROOT_DIR}/src/vsbc/dllmain.cpp" + "${CXBXR_ROOT_DIR}/src/vsbc/stdafx.cpp" +) + +source_group(TREE ${CXBXR_ROOT_DIR}/src/vsbc PREFIX header FILES ${HEADERS}) + +source_group(TREE ${CXBXR_ROOT_DIR}/src/vsbc PREFIX source FILES ${SOURCES}) + +add_library(vsbc SHARED ${HEADERS} ${SOURCES}) + +set_target_properties(vsbc PROPERTIES + OUTPUT_NAME CxbxVSBC +) diff --git a/resource/Cxbx.rc b/resource/Cxbx.rc index ca1973cd6..71592116d 100644 --- a/resource/Cxbx.rc +++ b/resource/Cxbx.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "..\src\Cxbx\ResCxbx.h" +#include "..\src\gui\ResCxbx.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -13,10 +13,10 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (United States) resources +// Neutral resources -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #pragma code_page(1252) ///////////////////////////////////////////////////////////////////////////// @@ -27,14 +27,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN - IDD_CONTROLLER_HOST_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 394 - TOPMARGIN, 7 - BOTTOMMARGIN, 112 - END - IDD_VIRTUAL_SBC_FEEDBACK, DIALOG BEGIN LEFTMARGIN, 7 @@ -42,6 +34,46 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 207 END + + IDD_VIDEO_CFG, DIALOG + BEGIN + BOTTOMMARGIN, 121 + END + + IDD_AUDIO_CFG, DIALOG + BEGIN + END + + IDD_NETWORK_CFG, DIALOG + BEGIN + BOTTOMMARGIN, 74 + END + + IDD_EEPROM_CFG, DIALOG + BEGIN + END + + IDD_LOGGING_CFG, DIALOG + BEGIN + VERTGUIDE, 12 + VERTGUIDE, 66 + VERTGUIDE, 121 + VERTGUIDE, 178 + VERTGUIDE, 234 + VERTGUIDE, 246 + BOTTOMMARGIN, 347 + HORZGUIDE, 54 + HORZGUIDE, 69 + HORZGUIDE, 84 + HORZGUIDE, 99 + HORZGUIDE, 114 + HORZGUIDE, 126 + HORZGUIDE, 140 + HORZGUIDE, 155 + HORZGUIDE, 168 + HORZGUIDE, 182 + HORZGUIDE, 195 + END END #endif // APSTUDIO_INVOKED @@ -51,45 +83,104 @@ END // Dialog // -IDD_CONTROLLER_HOST_MAPPING DIALOGEX 0, 0, 401, 119 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Config Xbox Controller to Host Mapping" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 +IDD_INPUT_CFG DIALOGEX 0, 0, 243, 124 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Cxbx-Reloaded : Input Configuration" +FONT 8, "Verdana", 0, 0, 0x1 BEGIN - DEFPUSHBUTTON "Apply",IDC_HOST_APPLY,288,98,50,14 - PUSHBUTTON "Cancel",IDC_HOST_CANCEL,344,98,50,14 - GROUPBOX "Xbox Port 0",IDC_XBOX_PORT_0,7,7,93,83,WS_GROUP,WS_EX_CLIENTEDGE - CONTROL "Not Connected",IDC_HOST_NOTCONNECT_0_0,"Button",BS_AUTORADIOBUTTON,17,19,64,10 - CONTROL "XInput Port 0",IDC_HOST_XINPUT_0_0,"Button",BS_AUTORADIOBUTTON,17,28,59,10 - CONTROL "XInput Port 1",IDC_HOST_XINPUT_0_1,"Button",BS_AUTORADIOBUTTON,17,37,59,10 - CONTROL "XInput Port 2",IDC_HOST_XINPUT_0_2,"Button",BS_AUTORADIOBUTTON,17,46,59,10 - CONTROL "XInput Port 3",IDC_HOST_XINPUT_0_3,"Button",BS_AUTORADIOBUTTON,17,55,59,10 - CONTROL "DirectInput Port 0",IDC_HOST_DINPUT_0_0,"Button",BS_AUTORADIOBUTTON,17,64,73,10 - CONTROL "Virtual SteelBattalion",IDC_HOST_VIRTUAL_SBC_0_0,"Button",BS_AUTORADIOBUTTON,17,74,79,10 - GROUPBOX "Xbox Port 1",IDC_XBOX_PORT_1,104,7,93,83,WS_GROUP,WS_EX_CLIENTEDGE - CONTROL "Not Connected",IDC_HOST_NOTCONNECT_1_0,"Button",BS_AUTORADIOBUTTON,114,20,64,10 - CONTROL "XInput Port 0",IDC_HOST_XINPUT_1_0,"Button",BS_AUTORADIOBUTTON,114,29,59,10 - CONTROL "XInput Port 1",IDC_HOST_XINPUT_1_1,"Button",BS_AUTORADIOBUTTON,114,38,59,10 - CONTROL "XInput Port 2",IDC_HOST_XINPUT_1_2,"Button",BS_AUTORADIOBUTTON,114,47,59,10 - CONTROL "XInput Port 3",IDC_HOST_XINPUT_1_3,"Button",BS_AUTORADIOBUTTON,114,56,59,10 - CONTROL "DirectInput Port 0",IDC_HOST_DINPUT_1_0,"Button",BS_AUTORADIOBUTTON,114,65,73,10 - CONTROL "Virtual SteelBattalion",IDC_HOST_VIRTUAL_SBC_1_0,"Button",BS_AUTORADIOBUTTON,114,75,79,10 - GROUPBOX "Xbox Port 2",IDC_XBOX_PORT_2,201,7,93,83,WS_GROUP,WS_EX_CLIENTEDGE - CONTROL "Not Connected",IDC_HOST_NOTCONNECT_2_0,"Button",BS_AUTORADIOBUTTON,211,21,64,10 - CONTROL "XInput Port 0",IDC_HOST_XINPUT_2_0,"Button",BS_AUTORADIOBUTTON,211,30,59,10 - CONTROL "XInput Port 1",IDC_HOST_XINPUT_2_1,"Button",BS_AUTORADIOBUTTON,211,39,59,10 - CONTROL "XInput Port 2",IDC_HOST_XINPUT_2_2,"Button",BS_AUTORADIOBUTTON,211,48,59,10 - CONTROL "XInput Port 3",IDC_HOST_XINPUT_2_3,"Button",BS_AUTORADIOBUTTON,211,57,59,10 - CONTROL "DirectInput Port 0",IDC_HOST_DINPUT_2_0,"Button",BS_AUTORADIOBUTTON,211,66,73,10 - CONTROL "Virtual SteelBattalion",IDC_HOST_VIRTUAL_SBC_2_0,"Button",BS_AUTORADIOBUTTON,211,75,79,10 - GROUPBOX "Xbox Port 3",IDC_XBOX_PORT_3,298,7,93,83,WS_GROUP,WS_EX_CLIENTEDGE - CONTROL "Not Connected",IDC_HOST_NOTCONNECT_3_0,"Button",BS_AUTORADIOBUTTON,308,21,64,10 - CONTROL "XInput Port 0",IDC_HOST_XINPUT_3_0,"Button",BS_AUTORADIOBUTTON,308,30,59,10 - CONTROL "XInput Port 1",IDC_HOST_XINPUT_3_1,"Button",BS_AUTORADIOBUTTON,308,39,59,10 - CONTROL "XInput Port 2",IDC_HOST_XINPUT_3_2,"Button",BS_AUTORADIOBUTTON,308,48,59,10 - CONTROL "XInput Port 3",IDC_HOST_XINPUT_3_3,"Button",BS_AUTORADIOBUTTON,308,57,59,10 - CONTROL "DirectInput Port 0",IDC_HOST_DINPUT_3_0,"Button",BS_AUTORADIOBUTTON,308,66,73,10 - CONTROL "Virtual SteelBattalion",IDC_HOST_VIRTUAL_SBC_3_0,"Button",BS_AUTORADIOBUTTON,308,75,79,10 + GROUPBOX "Xbox device configuration",IDC_XID_CONFIG,13,10,217,103,WS_GROUP,WS_EX_CLIENTEDGE + COMBOBOX IDC_DEVICE_PORT1,50,25,110,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DEVICE_PORT2,50,46,110,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DEVICE_PORT3,50,67,110,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DEVICE_PORT4,50,88,110,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Configure",IDC_CONFIGURE_PORT1,166,25,50,14,BS_FLAT + PUSHBUTTON "Configure",IDC_CONFIGURE_PORT2,166,46,50,14,BS_FLAT + PUSHBUTTON "Configure",IDC_CONFIGURE_PORT3,166,67,50,14,BS_FLAT + PUSHBUTTON "Configure",IDC_CONFIGURE_PORT4,166,88,50,14,BS_FLAT + LTEXT "Port 1",IDC_STATIC,23,27,20,10 + LTEXT "Port 2",IDC_STATIC,23,48,20,10 + LTEXT "Port 3",IDC_STATIC,23,69,20,10 + LTEXT "Port 4",IDC_STATIC,23,90,20,10 +END + +IDD_XID_DUKE_CFG DIALOGEX 0, 0, 528, 280 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +FONT 8, "Verdana", 0, 0, 0x1 +BEGIN + GROUPBOX "Device",IDC_XID_CONFIG,12,10,175,35,WS_GROUP + COMBOBOX IDC_DEVICE_LIST,21,23,101,15,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Refresh",IDC_REFRESH_DEVICES,128,23,50,14,BS_FLAT + GROUPBOX "Profile",IDC_XID_PROFILE,197,10,320,35,WS_GROUP + COMBOBOX IDC_XID_PROFILE_NAME,207,24,194,10,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Save",IDC_XID_PROFILE_SAVE,405,23,50,14,BS_FLAT + PUSHBUTTON "Delete",IDC_XID_PROFILE_DELETE,459,23,50,14,BS_FLAT + GROUPBOX "Buttons",IDC_XID_BUTTONS,12,65,121,181,WS_GROUP + PUSHBUTTON "",IDC_SET_A,59,75,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_B,59,93,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_X,59,111,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_Y,59,129,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_BLACK,59,147,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_WHITE,59,165,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_BACK,59,183,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_START,59,201,57,14,BS_FLAT + LTEXT "A",IDC_STATIC,28,75,20,14,SS_CENTERIMAGE + LTEXT "B",IDC_STATIC,28,93,20,14,SS_CENTERIMAGE + LTEXT "X",IDC_STATIC,28,111,20,14,SS_CENTERIMAGE + LTEXT "Y",IDC_STATIC,28,129,20,14,SS_CENTERIMAGE + LTEXT "Black",IDC_STATIC,28,147,20,14,SS_CENTERIMAGE + LTEXT "White",IDC_STATIC,28,165,20,14,SS_CENTERIMAGE + LTEXT "Back",IDC_STATIC,28,183,20,14,SS_CENTERIMAGE + LTEXT "Start",IDC_STATIC,28,201,20,14,SS_CENTERIMAGE + GROUPBOX "L Stick",IDC_XID_LSTICK,140,65,121,181,WS_GROUP + PUSHBUTTON "",IDC_SET_LEFT_POSY,187,75,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_LEFT_NEGY,187,93,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_LEFT_NEGX,187,111,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_LEFT_POSX,187,129,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_LTHUMB,187,147,57,14,BS_FLAT + LTEXT "Up",IDC_STATIC,156,75,20,14,SS_CENTERIMAGE + LTEXT "Down",IDC_STATIC,156,93,20,14,SS_CENTERIMAGE + LTEXT "Left",IDC_STATIC,156,111,20,14,SS_CENTERIMAGE + LTEXT "Right",IDC_STATIC,156,129,20,14,SS_CENTERIMAGE + LTEXT "L Click",IDC_STATIC,156,147,27,14,SS_CENTERIMAGE + GROUPBOX "R Stick",IDC_XID_RSTICK,268,65,121,181,WS_GROUP + PUSHBUTTON "",IDC_SET_RIGHT_POSY,315,75,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_RIGHT_NEGY,315,93,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_RIGHT_NEGX,315,111,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_RIGHT_POSX,315,129,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_RTHUMB,315,147,57,14,BS_FLAT + LTEXT "Up",IDC_STATIC,284,75,20,14,SS_CENTERIMAGE + LTEXT "Down",IDC_STATIC,284,93,20,14,SS_CENTERIMAGE + LTEXT "Left",IDC_STATIC,284,111,20,14,SS_CENTERIMAGE + LTEXT "Right",IDC_STATIC,284,129,20,14,SS_CENTERIMAGE + LTEXT "R Click",IDC_STATIC,284,147,27,14,SS_CENTERIMAGE + GROUPBOX "D Pad",IDC_XID_DPAD,396,65,121,88,WS_GROUP + PUSHBUTTON "",IDC_SET_DPAD_UP,443,75,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_DPAD_DOWN,443,93,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_DPAD_LEFT,443,111,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_DPAD_RIGHT,443,129,57,14,BS_FLAT + LTEXT "Up",IDC_STATIC,412,75,20,14,SS_CENTERIMAGE + LTEXT "Down",IDC_STATIC,412,93,20,14,SS_CENTERIMAGE + LTEXT "Left",IDC_STATIC,412,111,20,14,SS_CENTERIMAGE + LTEXT "Right",IDC_STATIC,412,129,20,14,SS_CENTERIMAGE + GROUPBOX "Triggers",IDC_XID_TRIGGERS,396,157,121,52,WS_GROUP + PUSHBUTTON "",IDC_SET_LTRIGGER,443,168,57,14,BS_FLAT + PUSHBUTTON "",IDC_SET_RTRIGGER,443,187,57,14,BS_FLAT + LTEXT "Left",IDC_STATIC,412,168,20,14,SS_CENTERIMAGE + LTEXT "Right",IDC_STATIC,412,187,20,14,SS_CENTERIMAGE + GROUPBOX "Rumble",IDC_XID_RUMBLE,396,212,121,34,WS_GROUP + PUSHBUTTON "",IDC_SET_MOTOR,443,224,57,14,BS_FLAT + LTEXT "Motor",IDC_STATIC,412,224,26,14,SS_CENTERIMAGE + PUSHBUTTON "Default Bindings",IDC_XID_DEFAULT,362,256,69,14,BS_FLAT + PUSHBUTTON "Clear",IDC_XID_CLEAR,443,256,50,14,BS_FLAT +END + +IDD_RUMBLE_CFG DIALOGEX 0, 0, 155, 35 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Rumble Configuration" +FONT 8, "Verdana", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_RUMBLE_LIST,15,11,70,15,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Test",IDC_RUMBLE_TEST,95,11,45,14,BS_FLAT END IDD_VIRTUAL_SBC_FEEDBACK DIALOGEX 0, 0, 1039, 214 @@ -209,46 +300,7 @@ BEGIN CONTROL "",IDC_PB_FILT_CONTROL_SYSTEM,"msctls_progress32",WS_BORDER,169,165,14,10 END -IDD_CONTROLLER_CFG DIALOGEX 0, 0, 343, 137 -STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Cxbx-Reloaded : Controller Configuration" -FONT 8, "Verdana", 0, 0, 0x1 -BEGIN - PUSHBUTTON "X",IDC_SET_X,7,11,50,14,BS_FLAT - PUSHBUTTON "Y",IDC_SET_Y,60,11,50,14,BS_FLAT - PUSHBUTTON "A",IDC_SET_A,113,11,50,14,BS_FLAT - PUSHBUTTON "B",IDC_SET_B,167,11,50,14,BS_FLAT - PUSHBUTTON "White",IDC_SET_WHITE,7,29,50,14,BS_FLAT - PUSHBUTTON "Black",IDC_SET_BLACK,60,29,50,14,BS_FLAT - PUSHBUTTON "Left Trigger",IDC_SET_LTRIGGER,113,29,50,14,BS_FLAT - PUSHBUTTON "Right Trigger",IDC_SET_RTRIGGER,167,29,50,14,BS_FLAT - PUSHBUTTON "DPad Up",IDC_SET_DPAD_UP,6,61,50,14,BS_FLAT - PUSHBUTTON "DPad Down",IDC_SET_DPAD_DOWN,60,61,50,14,BS_FLAT - PUSHBUTTON "DPad Left",IDC_SET_DPAD_LEFT,113,61,50,14,BS_FLAT - PUSHBUTTON "DPad Right",IDC_SET_DPAD_RIGHT,167,61,50,14,BS_FLAT - PUSHBUTTON "Back",IDC_SET_BACK,6,79,50,14,BS_FLAT - PUSHBUTTON "Start",IDC_SET_START,60,79,50,14,BS_FLAT - PUSHBUTTON "Left Thumb",IDC_SET_LTHUMB,113,79,50,14,BS_FLAT - PUSHBUTTON "Right Thumb",IDC_SET_RTHUMB,167,79,50,14,BS_FLAT - PUSHBUTTON "Up",IDC_SET_LEFT_POSY,231,11,50,14,BS_FLAT - PUSHBUTTON "Down",IDC_SET_LEFT_NEGY,284,11,50,14,BS_FLAT - PUSHBUTTON "Left",IDC_SET_LEFT_NEGX,231,29,50,14,BS_FLAT - PUSHBUTTON "Right",IDC_SET_LEFT_POSX,284,29,50,14,BS_FLAT - PUSHBUTTON "Up",IDC_SET_RIGHT_POSY,231,61,50,14,BS_FLAT - PUSHBUTTON "Down",IDC_SET_RIGHT_NEGY,284,61,50,14,BS_FLAT - PUSHBUTTON "Left",IDC_SET_RIGHT_NEGX,231,79,50,14,BS_FLAT - PUSHBUTTON "Right",IDC_SET_RIGHT_POSX,284,79,50,14,BS_FLAT - PUSHBUTTON "&Cancel",IDC_INPUT_CONFIG_CANCEL,231,102,50,14,BS_FLAT - PUSHBUTTON "&Accept",IDC_INPUT_CONFIG_ACCEPT,284,102,51,14,BS_FLAT - GROUPBOX "Analog Buttons",IDC_STATIC,2,1,220,47 - GROUPBOX "Digital Buttons",IDC_STATIC,2,51,220,46 - GROUPBOX "Analog Thumbstick (Left)",IDC_STATIC,226,1,113,47 - GROUPBOX "Analog Thumbstick (Right)",IDC_STATIC,227,51,112,46 - CTEXT "Please choose one of the controller components from above...",IDC_CONFIG_STATUS,2,121,336,12,SS_CENTERIMAGE,WS_EX_STATICEDGE - PUSHBUTTON "Click to configure all input...",IDC_CONFIGURE_ALL,6,102,210,14,BS_FLAT -END - -IDD_VIDEO_CFG DIALOGEX 0, 0, 259, 121 +IDD_VIDEO_CFG DIALOGEX 0, 0, 259, 150 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Cxbx-Reloaded : Video Configuration" FONT 8, "Verdana", 0, 0, 0x1 @@ -256,16 +308,18 @@ BEGIN COMBOBOX IDC_VC_DISPLAY_ADAPTER,76,12,173,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_VC_D3D_DEVICE,76,31,173,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_VC_VIDEO_RESOLUTION,76,49,173,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Use Hardware Video Mode",IDC_CV_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76,71,98,10 - CONTROL "Force VSync",IDC_CV_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,71,65,10 - PUSHBUTTON "Cancel",IDC_VC_CANCEL,146,102,50,14,BS_FLAT - PUSHBUTTON "Accept",IDC_VC_ACCEPT,206,102,50,14,BS_FLAT - GROUPBOX "Direct3D Configuration",IDC_STATIC,4,1,250,98,BS_CENTER + CONTROL "Use Exclusive Fullscreen Mode",IDC_CV_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76,89,112,10 + CONTROL "Force VSync",IDC_CV_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,193,89,58,10 + PUSHBUTTON "Cancel",IDC_VC_CANCEL,146,133,50,14,BS_FLAT + PUSHBUTTON "Accept",IDC_VC_ACCEPT,204,133,50,14,BS_FLAT + GROUPBOX "Direct3D Configuration",IDC_STATIC,4,1,250,130,BS_CENTER LTEXT "Display Adapter:",IDC_STATIC,13,14,57,8,0,WS_EX_RIGHT LTEXT "Direct3D Device:",IDC_STATIC,13,33,57,8,0,WS_EX_RIGHT - LTEXT "Video Resolution:",IDC_STATIC,12,52,58,8,0,WS_EX_RIGHT - LTEXT "Other Options:",IDC_STATIC,21,71,49,8,0,WS_EX_RIGHT - CONTROL "Enable Hardware YUV Overlays",IDC_CV_HARDWAREYUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76,84,123,11 + LTEXT "Display Resolution:",IDC_STATIC,6,52,64,8,0,WS_EX_RIGHT + LTEXT "Other Options:",IDC_STATIC,21,89,49,8,0,WS_EX_RIGHT + CONTROL "Enable Hardware YUV Overlays",IDC_CV_HARDWAREYUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76,102,123,11 + COMBOBOX IDC_VC_RENDER_RESOLUTION,76,68,173,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Render Resolution:",IDC_STATIC,7,70,63,8,0,WS_EX_RIGHT END IDD_AUDIO_CFG DIALOGEX 0, 0, 259, 121 @@ -274,14 +328,29 @@ CAPTION "Cxbx-Reloaded : Audio Configuration" FONT 8, "Verdana", 0, 0, 0x1 BEGIN COMBOBOX IDC_AC_AUDIO_ADAPTER,76,12,173,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Enable PCM",IDC_AC_PCM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,36,54,10 - CONTROL "Enable XADPCM",IDC_AC_XADPCM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,48,69,10 - CONTROL "Enable Unknown Codec",IDC_AC_UNKNOWN_CODEC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,60,93,10 + CONTROL "Enable PCM",IDC_AC_PCM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,34,54,10 + CONTROL "Enable XADPCM",IDC_AC_XADPCM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,133,34,69,10 + CONTROL "Enable Unknown Codec",IDC_AC_UNKNOWN_CODEC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,45,93,10 PUSHBUTTON "Cancel",IDC_AC_CANCEL,146,102,50,14,BS_FLAT PUSHBUTTON "Accept",IDC_AC_ACCEPT,206,102,50,14,BS_FLAT GROUPBOX "DirectSound Configuration",IDC_STATIC,4,1,250,98,BS_CENTER LTEXT "Audio Adapter:",IDC_STATIC,13,14,57,8,0,WS_EX_RIGHT - LTEXT "Other Options:",IDC_STATIC,13,33,57,8,0,WS_EX_RIGHT + LTEXT "Codec Options:",IDC_STATIC,13,34,57,8,0,WS_EX_RIGHT + LTEXT "Other Options:",IDC_STATIC,13,60,57,8,0,WS_EX_RIGHT + CONTROL "Disable mute on unfocus",IDC_AC_MUTE_ON_UNFOCUS_DISABLE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,60,97,10 +END + +IDD_NETWORK_CFG DIALOGEX 0, 0, 404, 76 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Cxbx : Network Configuration" +FONT 8, "Verdana", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Cancel",IDC_AC_CANCEL,285,51,50,14,BS_FLAT + PUSHBUTTON "Accept",IDC_AC_ACCEPT,339,51,50,14,BS_FLAT + GROUPBOX "Network Configuration",-1,4,1,396,69,BS_CENTER + LTEXT "Network Adapter",-1,13,14,57,8,0,WS_EX_RIGHT + COMBOBOX IDC_NETWORK_ADAPTER,14,28,374,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END IDD_EEPROM_CFG DIALOGEX 0, 0, 259, 279 @@ -326,12 +395,107 @@ BEGIN PUSHBUTTON "Reset",IDC_EE_RESET,13,251,40,14,BS_FLAT END +IDD_LOGGING_CFG DIALOGEX 0, 0, 258, 355 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Cxbx-Reloaded : Logging Configuration" +FONT 8, "Verdana", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_EVENT_LV,57,9,50,10,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CTEXT "Event Level",IDC_STATIC,10,11,40,10,0,WS_EX_RIGHT + GROUPBOX "Emulator Event",IDC_CXBXR_EVENTS,12,26,234,186,WS_GROUP,WS_EX_CLIENTEDGE + CONTROL "Enable all",IDC_LOG_ENABLE_GENERAL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,19,39,47,10 + CONTROL "Disable all",IDC_LOG_DISABLE_GENERAL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,71,39,50,10 + CONTROL "Custom",IDC_LOG_CUSTOM_GENERAL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,134,39,41,10 + CONTROL "CXBXR",IDC_LOG_CXBXR,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,27,54,39,10 + CONTROL "XBE",IDC_LOG_XBE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,92,54,29,10 + CONTROL "INIT",IDC_LOG_INIT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,148,54,30,10 + CONTROL "VMEM",IDC_LOG_VMEM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,199,54,35,10 + CONTROL "PMEM",IDC_LOG_PMEM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,32,69,34,10 + CONTROL "GUI",IDC_LOG_GUI,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,92,69,29,10 + CONTROL "EEPR",IDC_LOG_EEPR,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,145,69,33,10 + CONTROL "RSA",IDC_LOG_RSA,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,204,69,30,10 + CONTROL "POOLMEM",IDC_LOG_POOLMEM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,18,84,48,10 + CONTROL "D3D8",IDC_LOG_D3D8,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,87,84,34,10 + CONTROL "D3DST",IDC_LOG_D3DST,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,139,84,39,10 + CONTROL "D3DCVT",IDC_LOG_D3DCVT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,190,84,44,10 + CONTROL "DSOUND",IDC_LOG_DSOUND,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,21,99,45,10 + CONTROL "DSBUFFER",IDC_LOG_DSBUFFER,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,71,99,50,10 + CONTROL "DSSTREAM",IDC_LOG_DSSTREAM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,125,99,53,10 + CONTROL "DS3DCALC",IDC_LOG_DS3DCALC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,181,99,53,10 + CONTROL "XMO",IDC_LOG_XMO,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,35,114,31,10 + CONTROL "XAPI",IDC_LOG_XAPI,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,89,114,32,10 + CONTROL "XACT",IDC_LOG_XACT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,144,114,34,10 + CONTROL "XGRP",IDC_LOG_XGRP,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,200,114,34,10 + CONTROL "XONLINE",IDC_LOG_XONLINE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,21,126,45,10 + CONTROL "FS",IDC_LOG_FS,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,97,126,24,10 + CONTROL "PSHB",IDC_LOG_PSHB,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,144,126,34,10 + CONTROL "PXSH",IDC_LOG_PXSH,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,200,126,34,10 + CONTROL "VTXSH",IDC_LOG_VTXSH,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,28,140,38,10 + CONTROL "VTXB",IDC_LOG_VTXB,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,144,140,34,10 + CONTROL "DINP",IDC_LOG_DINP,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,201,140,33,10 + CONTROL "XINP",IDC_LOG_XINP,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,34,155,32,10 + CONTROL "SDL",IDC_LOG_SDL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,88,155,33,10 + CONTROL "FILE",IDC_LOG_FILE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,148,155,30,10 + CONTROL "X86",IDC_LOG_X86,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,205,155,29,10 + CONTROL "HLE",IDC_LOG_HLE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,38,168,28,10 + CONTROL "NET",IDC_LOG_NET,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,92,168,29,10 + CONTROL "MCPX",IDC_LOG_MCPX,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,143,168,35,10 + CONTROL "NV2A",IDC_LOG_NV2A,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,200,168,34,10 + CONTROL "SMC",IDC_LOG_SMC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,35,182,31,10 + CONTROL "OHCI",IDC_LOG_OHCI,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,87,182,34,10 + CONTROL "USB",IDC_LOG_USB,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,148,182,30,10 + CONTROL "HUB",IDC_LOG_HUB,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,204,182,30,10 + CONTROL "XIDCTRL",IDC_LOG_XIDCTRL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,20,195,46,10 + CONTROL "ADM",IDC_LOG_ADM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,90,195,31,10 + CONTROL "INPSYS",IDC_LOG_INPSYS,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,137,195,41,10 + GROUPBOX "Kernel Event",IDC_KERNEL_EVENTS,12,218,234,110,WS_GROUP,WS_EX_CLIENTEDGE + CONTROL "Enable all",IDC_LOG_ENABLE_KERNEL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,19,232,47,10 + CONTROL "Disable all",IDC_LOG_DISABLE_KERNEL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,71,232,50,10 + CONTROL "Custom",IDC_LOG_CUSTOM_KERNEL,"Button",BS_AUTORADIOBUTTON | BS_LEFTTEXT,134,232,41,10 + CONTROL "KRNL",IDC_LOG_KRNL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,33,247,33,10 + CONTROL "LOG",IDC_LOG_LOG,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,91,247,30,10 + CONTROL "XBOX",IDC_LOG_XBOX,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,141,247,35,10 + CONTROL "XBDM",IDC_LOG_XBDM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,199,247,35,10 + CONTROL "AV",IDC_LOG_AV,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,41,262,25,10 + CONTROL "DBG",IDC_LOG_DBG,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,90,262,31,10 + CONTROL "EX",IDC_LOG_EX,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,150,262,25,10 + CONTROL "FSC",IDC_LOG_FSC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,205,262,29,10 + CONTROL "HAL",IDC_LOG_HAL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,37,277,29,10 + CONTROL "IO",IDC_LOG_IO,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,97,277,24,10 + CONTROL "KD",IDC_LOG_KD,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,149,277,26,10 + CONTROL "KE",IDC_LOG_KE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,209,277,25,10 + CONTROL "KI",IDC_LOG_KI,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,43,292,23,10 + CONTROL "MM",IDC_LOG_MM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,95,292,26,10 + CONTROL "NT",IDC_LOG_NT,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,150,292,25,10 + CONTROL "OB",IDC_LOG_OB,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,208,292,26,10 + CONTROL "PS",IDC_LOG_PS,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,41,308,25,10 + CONTROL "RTL",IDC_LOG_RTL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,93,308,28,10 + CONTROL "XC",IDC_LOG_XC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,149,308,26,10 + CONTROL "XE",IDC_LOG_XE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,209,308,25,10 + PUSHBUTTON "Cancel",IDC_LOG_CANCEL,161,333,40,14,BS_FLAT + PUSHBUTTON "Accept",IDC_LOG_ACCEPT,206,333,40,14,BS_FLAT + CONTROL "VSHCACHE",IDC_LOG_VSHCACHE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,68,140,53,10 +END + +IDD_ABOUT DIALOGEX 0, 0, 310, 177 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Cxbx-Reloaded" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_TAB1,"SysTabControl32",0x0,7,7,296,163 +END + ///////////////////////////////////////////////////////////////////////////// // // AFX_DIALOG_LAYOUT // +IDD_NETWORK_CFG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + IDD_CONTROLLER_HOST_MAPPING AFX_DIALOG_LAYOUT BEGIN 0 @@ -352,6 +516,21 @@ BEGIN 0 END +IDD_LOGGING_CFG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_VIDEO_CFG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_ABOUT AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -371,7 +550,7 @@ IDI_CXBX ICON "Cxbx-R.ico" 1 TEXTINCLUDE BEGIN - "..\\src\\Cxbx\\ResCxbx.h\0" + "..\\src\\gui\\ResCxbx.h\0" END 2 TEXTINCLUDE @@ -410,10 +589,10 @@ BEGIN MENUITEM "&Open Xbe...", ID_FILE_OPEN_XBE,MFT_STRING,MFS_ENABLED MENUITEM "Open D&ashboard...\tF7", ID_FILE_OPEN_DASHBOARD,MFT_STRING,MFS_ENABLED MENUITEM "&Close Xbe", ID_FILE_CLOSE_XBE,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR MENUITEM "&Save Xbe", ID_FILE_SAVEXBEFILE,MFT_STRING,MFS_ENABLED MENUITEM "Save Xbe &As...", ID_FILE_SAVEXBEFILEAS,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR POPUP "&Recent Xbe Files", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "&0 : Recent Placeholder", ID_FILE_RXBE_0,MFT_STRING,MFS_ENABLED @@ -427,7 +606,7 @@ BEGIN MENUITEM "&8 : Recent Placeholder", ID_FILE_RXBE_8,MFT_STRING,MFS_ENABLED MENUITEM "&9 : Recent Placeholder", ID_FILE_RXBE_9,MFT_STRING,MFS_ENABLED END - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR MENUITEM "E&xit", ID_FILE_EXIT,MFT_STRING,MFS_ENABLED END POPUP "&Edit", 65535,MFT_STRING,MFS_ENABLED @@ -442,7 +621,7 @@ BEGIN MENUITEM "&Allow >64 MB", ID_EDIT_PATCH_ALLOW64MB,MFT_STRING,MFS_ENABLED MENUITEM "&Debug Mode", ID_EDIT_PATCH_DEBUGMODE,MFT_STRING,MFS_ENABLED END - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR POPUP "Dump &Xbe Info To...", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "&File...", ID_EDIT_DUMPXBEINFOTO_FILE,MFT_STRING,MFS_ENABLED @@ -464,123 +643,57 @@ BEGIN END POPUP "&Settings", 65535,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "Config Xbox Controller &Mapping", ID_SETTINGS_CONFIG_XBOX_CONTROLLER_MAPPING,MFT_STRING,MFS_ENABLED - MENUITEM "Config DirectInput &Controller...", ID_SETTINGS_CONFIG_CONTROLLER,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR + MENUITEM "Config I&nput...", ID_SETTINGS_CONFIG_INPUT,MFT_STRING,MFS_ENABLED MENUITEM "Config &Video...", ID_SETTINGS_CONFIG_VIDEO,MFT_STRING,MFS_ENABLED MENUITEM "Config &Audio...", ID_SETTINGS_CONFIG_AUDIO,MFT_STRING,MFS_ENABLED + MENUITEM "Config &Network...", ID_SETTINGS_CONFIG_NETWORK,MFT_STRING,MFS_ENABLED MENUITEM "Config &Eeprom...", ID_SETTINGS_CONFIG_EEPROM,MFT_STRING,MFS_ENABLED + MENUITEM "Config &Logging...", ID_SETTINGS_CONFIG_LOGGING,MFT_STRING,MFS_ENABLED POPUP "Config &Data Location...", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "Store in AppData", ID_SETTINGS_CONFIG_DLOCAPPDATA,MFT_STRING,MFS_ENABLED - MENUITEM "Store with Executable", ID_SETTINGS_CONFIG_DLOCCURDIR,MFT_STRING,MFS_ENABLED + MENUITEM "Store with Executable", ID_SETTINGS_CONFIG_DLOCEXECDIR,MFT_STRING,MFS_ENABLED MENUITEM "Custom", ID_SETTINGS_CONFIG_DLOCCUSTOM,MFT_STRING,MFS_ENABLED END - POPUP "&HLE Cache", 65535,MFT_STRING,MFS_ENABLED + POPUP "&Symbol Cache", 65535,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Clear entire HLE Cache", ID_CACHE_CLEARHLECACHE_ALL,MFT_STRING,MFS_ENABLED - MENUITEM "&Rescan title HLE Cache", ID_CACHE_CLEARHLECACHE_CURRENT,MFT_STRING,MFS_ENABLED + MENUITEM "&Clear entire Symbol Cache", ID_CACHE_CLEARHLECACHE_ALL,MFT_STRING,MFS_ENABLED + MENUITEM "&Rescan title Symbol Cache", ID_CACHE_CLEARHLECACHE_CURRENT,MFT_STRING,MFS_ENABLED END - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR POPUP "&LLE (Experimental)", 65535,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "LLE &GPU", ID_EMULATION_LLE_GPU,MFT_STRING,MFS_ENABLED + MENUITEM "LLE &GPU", ID_EMULATION_LLE_GPU,MFT_STRING,MFS_GRAYED END POPUP "Hacks", 65535,MFT_STRING,MFS_ENABLED BEGIN POPUP "Speed Hacks", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "Run Xbox threads on all cores", ID_HACKS_RUNXBOXTHREADSONALLCORES,MFT_STRING,MFS_ENABLED - MENUITEM "Render directly to Host Backbuffer", ID_HACKS_RENDERDIRECTLYTOHOSTBACKBUFFER,MFT_STRING,MFS_ENABLED - MENUITEM "Uncap Framerate", ID_HACKS_UNCAPFRAMERATE,MFT_STRING,MFS_ENABLED END MENUITEM "Disable Pixel Shaders", ID_HACKS_DISABLEPIXELSHADERS,MFT_STRING,MFS_ENABLED MENUITEM "Skip rdtsc patching", ID_HACKS_SKIPRDTSCPATCHING,MFT_STRING,MFS_ENABLED - MENUITEM "Scale Xbox viewport to host (and back)", ID_HACKS_SCALEVIEWPORT,MFT_STRING,MFS_ENABLED END - MENUITEM MFT_SEPARATOR + MENUITEM "Allow Admin Privilege", ID_SETTINGS_ALLOWADMINPRIVILEGE,MFT_STRING,MFS_ENABLED + MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Reset To Defaults", ID_SETTINGS_INITIALIZE,MFT_STRING,MFS_ENABLED END POPUP "E&mulation", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "&Start\tF5", ID_EMULATION_START,MFT_STRING,MFS_ENABLED MENUITEM "Start &Debugger...\tF9", ID_EMULATION_STARTDEBUGGER,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR MENUITEM "S&top\tF6", ID_EMULATION_STOP,MFT_STRING,MFS_ENABLED END POPUP "&Help", 65535,MFT_STRING,MFS_ENABLED BEGIN MENUITEM "&Go To The Official Cxbx Web Site...", ID_HELP_HOMEPAGE,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR + MENUITEM "", -1, MFT_SEPARATOR MENUITEM "&About", ID_HELP_ABOUT,MFT_STRING,MFS_ENABLED END MENUITEM " ", ID_FPS,MFT_STRING | MFT_RIGHTJUSTIFY,MFS_ENABLED MENUITEM " ", ID_LED,MFT_STRING,MFS_ENABLED -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_UEM "Your Xbox requires service.\n\nPlease call Xbox Customer Support.\n\n\nIhre Xbox muss gewartet werden.\n\nBitte den Xbox-Kundendienst anrufen.\n\n\nLa consola Xbox requiere asistencia técnica.\n\nLlame al servicio de soporte al cliente de la Xbox.\n\n\nXbox ha bisogno di manutenzione.\n\nChiamare l'Assistenza Clienti di Xbox.\n\n\nVotre Xbox ne fonctionne pas correctement.\n\nVeuillez contacter le Support à la clientèle Xbox.\n\n\n不具合が生じました。お手数ですが、\n\nXboxカスタマー サポートにお問い合わせください。" -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United Kingdom) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 303 - TOPMARGIN, 7 - BOTTOMMARGIN, 170 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUT DIALOGEX 0, 0, 310, 177 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About Cxbx-Reloaded" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_TAB1,"SysTabControl32",0x0,7,7,296,163 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AFX_DIALOG_LAYOUT -// - -IDD_ABOUT AFX_DIALOG_LAYOUT -BEGIN - 0 + MENUITEM " ", ID_LOG,MFT_STRING,MFS_ENABLED END @@ -593,7 +706,7 @@ IDR_CONTRIBUTORS TXT "..\\CONTRIBUTORS" IDR_COPYING TXT "..\\COPYING" -#endif // English (United Kingdom) resources +#endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// diff --git a/resource/Splash.jpg b/resource/Splash.jpg deleted file mode 100644 index 542891170..000000000 Binary files a/resource/Splash.jpg and /dev/null differ diff --git a/setup.bat b/setup.bat new file mode 100644 index 000000000..ddcfa78b8 --- /dev/null +++ b/setup.bat @@ -0,0 +1,26 @@ +@echo off + +REM CXbx-Reloaded setup script +REM +REM Depends on git, cmake and Visual Studio being installed. + +echo Pulling lastest version from git... +REM git clone --recurse-submodules https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/ +git pull --recurse-submodules + +REM echo Synchronizing submodules... +REM git submodule update --init --recursive + +echo Initializing most recent Visual Studio build environment... +@call "%VS140COMNTOOLS%vsvars32.bat" + +echo Generating solution... +mkdir build +cd build +REM cmake .. -G "Visual Studio 16 2019" -A Win32 +cmake .. -A Win32 + +echo Building solution... +cmake --build . + +echo Done! Enjoy using Cxbx-Reloaded! \ No newline at end of file diff --git a/src/Common/Logging.cpp b/src/Common/Logging.cpp deleted file mode 100644 index ff59547ee..000000000 --- a/src/Common/Logging.cpp +++ /dev/null @@ -1,200 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Logging.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2016 Patrick van Logchem -// * -// * All rights reserved -// * -// ****************************************************************** - -#include // for PULONG - -#include "Logging.h" - -// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration -// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html -thread_local std::string _logThreadPrefix; - -const bool needs_escape(const wint_t _char) -{ - // Escaping is needed for control characters, - // for double quote, and for backslash : - return iswcntrl(_char) || (_char == '"') || (_char == '\\'); -} - -inline void output_char(std::ostream& os, char c) -{ - if (needs_escape((int)c)) - { - switch (c) - { - // Render escaped double quote as \", and escaped backslash as \\ : - case '"': os << "\\\""; break; - case '\\': os << "\\\\"; break; - // See https://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences - case '\a': os << "\\t"; break; - case '\b': os << "\\b"; break; - case '\f': os << "\\f"; break; - case '\n': os << "\\n"; break; - case '\r': os << "\\r"; break; - case '\t': os << "\\t"; break; - case '\v': os << "\\v"; break; - // All other to-escape-characters are rendered as hexadecimal : - default: os << "\\x" << std::setfill('0') << std::setw(2) << std::right << std::hex << std::uppercase << (int)c; - } - } - else - os << c; -} - -inline void output_wchar(std::ostream& os, wchar_t c) -{ - if (needs_escape((wint_t)c)) - { - switch (c) - { - // Render escaped double quote as \", and escaped backslash as \\ : - case '"': os << "\\\""; break; - case '\\': os << "\\\\"; break; - // See https://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences - case '\a': os << "\\t"; break; - case '\b': os << "\\b"; break; - case '\f': os << "\\f"; break; - case '\n': os << "\\n"; break; - case '\r': os << "\\r"; break; - case '\t': os << "\\t"; break; - case '\v': os << "\\v"; break; - // All other to-escape-characters are rendered as hexadecimal : - default: os << "\\x" << std::setfill('0') << std::setw(4) << std::right << std::hex << std::uppercase << (wint_t)c; - } - } - else - os << c; -} - -LOG_SANITIZE_HEADER(hex1, uint8_t) -{ - return os << hexstring8 << (int)container.value; -} - -LOG_SANITIZE_HEADER(hex2, uint16_t) -{ - return os << hexstring16 << (int)container.value; -} - -LOG_SANITIZE_HEADER(hex4, uint32_t) -{ - return os << hexstring32 << (int)container.value; -} - -LOG_SANITIZE_HEADER(sanitized_char, char) -{ - output_char(os, container.value); - return os; -} - -LOG_SANITIZE_HEADER(sanitized_wchar, wchar_t) -{ - output_wchar(os, container.value); - return os; -} - -LOG_SANITIZE_HEADER(sanitized_char_pointer, char *) -{ - char *v = container.value; - - os << "(char *)"; - if (v == nullptr) - return os << "NULL"; - - bool needsEscaping = false; - - while (*v) - if (needs_escape(*v++)) - { - needsEscaping = true; - break; - } - - v = container.value; - os << hexstring32 << (uint32_t)v << " = \""; - if (needsEscaping) - { - while (*v) - output_char(os, *v++); - } - else - os << v; - - return os << "\""; -} - -LOG_SANITIZE_HEADER(sanitized_wchar_pointer, wchar_t *) -{ - wchar_t *v = container.value; - - os << "(wchar *)"; - if (v == nullptr) - return os << "NULL"; - - bool needsEscaping = false; - - while (*v) - if (needs_escape(*v++)) - { - needsEscaping = true; - break; - } - - v = container.value; - os << hexstring32 << (uint32_t)v << " = \""; - if (needsEscaping) - { - while (*v) - output_wchar(os, *v++); - } - else -#if 0 - os << v; // TODO : FIXME - VS2015 doesn''t render this string (instead, it shows a hexadecimal memory address) -#else // For now, render unicode as ANSI (replacing non-printables with '?') - { - while (*v) { - output_char(os, *v <= 0xFF ? (char)*v : '?'); - v++; - } - } -#endif - return os << "\""; -} - -LOGRENDER_HEADER_BY_REF(PVOID) -{ - return os << hex4((uint32_t)value); -} diff --git a/src/Common/Win32/XBAudio.cpp b/src/Common/Win32/XBAudio.cpp deleted file mode 100644 index 31b2df565..000000000 --- a/src/Common/Win32/XBAudio.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Win32->XBAudio.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2017 RadWolfie -// * -// * All rights reserved -// * -// ****************************************************************** -#include "XBAudio.h" - -#include - -// ****************************************************************** -// * func: XBAudio::XBAudio -// ****************************************************************** -XBAudio::XBAudio() : m_bPCM(true), m_bXADPCM(true), m_bUnknownCodec(true) -{ - m_binAudioAdapter = { 0 }; -} - -// ****************************************************************** -// * func: XBAudio::~XBAudio -// ****************************************************************** -XBAudio::~XBAudio() -{ -} - -// ****************************************************************** -// * func: XBAudio::Load -// ****************************************************************** -void XBAudio::Load(const char *szRegistryKey) -{ - // ****************************************************************** - // * Load Configuration from Registry - // ****************************************************************** - { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if(RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - - dwType = REG_DWORD; dwSize = sizeof(m_binAudioAdapter); - RegQueryValueEx(hKey, "AudioAdapter", NULL, &dwType, (PBYTE)&m_binAudioAdapter, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bPCM); - RegQueryValueEx(hKey, "PCM", NULL, &dwType, (PBYTE)&m_bPCM, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bXADPCM); - RegQueryValueEx(hKey, "XADPCM", NULL, &dwType, (PBYTE)&m_bXADPCM, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bUnknownCodec); - RegQueryValueEx(hKey, "UnknownCodec", NULL, &dwType, (PBYTE)&m_bUnknownCodec, &dwSize); - - RegCloseKey(hKey); - } - } -} - -// ****************************************************************** -// * func: XBAudio::Save -// ****************************************************************** -void XBAudio::Save(const char *szRegistryKey) -{ - // ****************************************************************** - // * Save Configuration to Registry - // ****************************************************************** - if (g_SaveOnExit) { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if(RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - - dwType = REG_BINARY; dwSize = sizeof(m_binAudioAdapter); - RegSetValueEx(hKey, "AudioAdapter", 0, dwType, (PBYTE)&m_binAudioAdapter, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bPCM); - RegSetValueEx(hKey, "PCM", 0, dwType, (PBYTE)&m_bPCM, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bXADPCM); - RegSetValueEx(hKey, "XADPCM", 0, dwType, (PBYTE)&m_bXADPCM, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bUnknownCodec); - RegSetValueEx(hKey, "UnknownCodec", 0, dwType, (PBYTE)&m_bUnknownCodec, dwSize); - - RegCloseKey(hKey); - } - } -} diff --git a/src/Common/Win32/XBAudio.h b/src/Common/Win32/XBAudio.h deleted file mode 100644 index d4d28436c..000000000 --- a/src/Common/Win32/XBAudio.h +++ /dev/null @@ -1,93 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Win32->Cxbx->XBAudio.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2017 RadWolfie -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef XBAUDIO_H -#define XBAUDIO_H - -#include "Cxbx.h" -#include "Common/Error.h" -#include "Mutex.h" - -// ****************************************************************** -// * class: XBAudio -// ****************************************************************** -class XBAudio : public Error -{ - public: - // ****************************************************************** - // * Initialization - // ****************************************************************** - XBAudio(); - ~XBAudio(); - - // ****************************************************************** - // * Registry Load/Save - // ****************************************************************** - void Load(const char *szRegistryKey); - void Save(const char *szRegistryKey); - - // ****************************************************************** - // * SetAudioAdapter - // ****************************************************************** - void SetAudioAdapter(GUID binAudioAdapter) { m_binAudioAdapter = binAudioAdapter; } - GUID GetAudioAdapter() const { return m_binAudioAdapter; } - - // ****************************************************************** - // * PCM Toggling - // ****************************************************************** - void SetPCM(BOOL bPCM) { m_bPCM = bPCM; } - BOOL GetPCM() const { return m_bPCM; } - - // ****************************************************************** - // * XADPCM Toggling - // ****************************************************************** - void SetXADPCM(BOOL bXADPCM) { m_bXADPCM = bXADPCM; } - BOOL GetXADPCM() const { return m_bXADPCM; } - - // ****************************************************************** - // * Unknown Codec Toggling - // ****************************************************************** - void SetUnknownCodec(BOOL bUnknownCodec) { m_bUnknownCodec = bUnknownCodec; } - BOOL GetUnknownCodec() const { return m_bUnknownCodec; } - - private: - // ****************************************************************** - // * Configuration - // ****************************************************************** - GUID m_binAudioAdapter; - BOOL m_bPCM; - BOOL m_bXADPCM; - BOOL m_bUnknownCodec; -}; - -#endif diff --git a/src/Common/Win32/XBController.cpp b/src/Common/Win32/XBController.cpp deleted file mode 100644 index 402ae7639..000000000 --- a/src/Common/Win32/XBController.cpp +++ /dev/null @@ -1,1134 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->XBController.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#include "XBController.h" - -#include "CxbxKrnl/EmuShared.h" -#include "CxbxKrnl/EmuXTL.h" - -// This is ridiculous -#define FIELD_OFFSET(type,field) ((ULONG)&(((type *)0)->field)) - -// ****************************************************************** -// * func: XBController::XBController -// ****************************************************************** -XBController::XBController() -{ - m_CurrentState = XBCTRL_STATE_NONE; - - int v=0; - - for(v=0;v=0;v--) - { - // ****************************************************************** - // * Poll the current device - // ****************************************************************** - { - HRESULT hRet = m_InputDevice[v].m_Device->Poll(); - - if(FAILED(hRet)) - { - hRet = m_InputDevice[v].m_Device->Acquire(); - - while(hRet == DIERR_INPUTLOST) - hRet = m_InputDevice[v].m_Device->Acquire(); - } - } - - DWORD dwHow = -1, dwFlags = m_InputDevice[v].m_Flags; - - // ****************************************************************** - // * Detect Joystick Input - // ****************************************************************** - if(m_InputDevice[v].m_Flags & DEVICE_FLAG_JOYSTICK) - { - XTL::DIJOYSTATE JoyState; - - // ****************************************************************** - // * Get Joystick State - // ****************************************************************** - { - HRESULT hRet = m_InputDevice[v].m_Device->GetDeviceState(sizeof(XTL::DIJOYSTATE), &JoyState); - - if(FAILED(hRet)) - continue; - } - - dwFlags = DEVICE_FLAG_JOYSTICK; - - if(abs(JoyState.lX) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lX); - dwFlags |= (JoyState.lX > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else if(abs(JoyState.lY) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lY); - dwFlags |= (JoyState.lY > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else if(abs(JoyState.lZ) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lZ); - dwFlags |= (JoyState.lZ > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else if(abs(JoyState.lRx) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lRx); - dwFlags |= (JoyState.lRx > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else if(abs(JoyState.lRy) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lRy); - dwFlags |= (JoyState.lRy > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else if(abs(JoyState.lRz) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, lRz); - dwFlags |= (JoyState.lRz > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - else - { - for(int b=0;b<2;b++) - { - if(abs(JoyState.rglSlider[b]) > DETECT_SENSITIVITY_JOYSTICK) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, rglSlider[b]); - dwFlags |= (JoyState.rglSlider[b] > 0) ? (DEVICE_FLAG_AXIS | DEVICE_FLAG_POSITIVE) : (DEVICE_FLAG_AXIS | DEVICE_FLAG_NEGATIVE); - } - } - } - - /* temporarily disabled - if(dwHow == -1) - { - for(int b=0;b<4;b++) - { - if(abs(JoyState.rgdwPOV[b]) > DETECT_SENSITIVITY_POV) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, rgdwPOV[b]); - } - } - } - //*/ - - if(dwHow == -1) - { - for(int b=0;b<32;b++) - { - if(JoyState.rgbButtons[b] > DETECT_SENSITIVITY_BUTTON) - { - dwHow = FIELD_OFFSET(XTL::DIJOYSTATE, rgbButtons[b]); - dwFlags |= DEVICE_FLAG_BUTTON; - } - } - } - - // ****************************************************************** - // * Retrieve Object Info - // ****************************************************************** - if(dwHow != -1) - { - const char *szDirection = (dwFlags & DEVICE_FLAG_AXIS) ? (dwFlags & DEVICE_FLAG_POSITIVE) ? "Positive " : "Negative " : ""; - - m_InputDevice[v].m_Device->GetDeviceInfo(&DeviceInstance); - - m_InputDevice[v].m_Device->GetObjectInfo(&ObjectInstance, dwHow, DIPH_BYOFFSET); - - Map(CurConfigObject, DeviceInstance.tszInstanceName, dwHow, dwFlags); - - printf("Cxbx-Reloaded: Detected %s%s on %s%lu\n", szDirection, ObjectInstance.tszName, DeviceInstance.tszInstanceName, ObjectInstance.dwType); - - sprintf(szStatus, "Success: %s Mapped to '%s%s' on '%s'!", m_DeviceNameLookup[CurConfigObject], szDirection, ObjectInstance.tszName, DeviceInstance.tszInstanceName); - - return true; - } - } - // ****************************************************************** - // * Detect Keyboard Input - // ****************************************************************** - else if(m_InputDevice[v].m_Flags & DEVICE_FLAG_KEYBOARD) - { - BYTE KeyState[256]; - - m_InputDevice[v].m_Device->GetDeviceState(256, KeyState); - - dwFlags = DEVICE_FLAG_KEYBOARD; - - // ****************************************************************** - // * Check for Keyboard State Change - // ****************************************************************** - for(int r=0;r<256;r++) - { - if(KeyState[r] != 0) - { - dwHow = r; - break; - } - } - - // ****************************************************************** - // * Check for Success - // ****************************************************************** - if(dwHow != -1) - { - Map(CurConfigObject, "SysKeyboard", dwHow, dwFlags); - - printf("Cxbx-Reloaded: Detected Key %d on SysKeyboard\n", dwHow); - - sprintf(szStatus, "Success: %s Mapped to Key %d on SysKeyboard", m_DeviceNameLookup[CurConfigObject], dwHow); - - return true; - } - } - } - - return false; -} - -// ****************************************************************** -// * func: XBController::ConfigEnd -// ****************************************************************** -void XBController::ConfigEnd() -{ - if(m_CurrentState != XBCTRL_STATE_CONFIG) - { - SetError("Invalid State"); - return; - } - - DInputCleanup(); - - m_CurrentState = XBCTRL_STATE_NONE; - - return; -} - -// ****************************************************************** -// * func: XBController::ListenBegin -// ****************************************************************** -void XBController::ListenBegin(HWND hwnd) -{ - int v=0; - - if(m_CurrentState != XBCTRL_STATE_NONE) - { - SetError("Invalid State"); - return; - } - - m_CurrentState = XBCTRL_STATE_LISTEN; - - DInputInit(hwnd); - - for(v=XBCTRL_MAX_DEVICES-1;v>=m_dwInputDeviceCount;v--) - m_DeviceName[v][0] = '\0'; - - for(v=0;v= m_dwInputDeviceCount) - { - printf("Warning: Device Mapped to %s was not found!\n", m_DeviceNameLookup[v]); - m_ObjectConfig[v].dwDevice = -1; - } - } - - return; -} - -// ****************************************************************** -// * func: XBController::ListenPoll -// ****************************************************************** -void XBController::ListenPoll(XTL::X_XINPUT_STATE *Controller) -{ - if(Controller == NULL) - return; - - XTL::LPDIRECTINPUTDEVICE8 pDevice=NULL; - XTL::LPDIRECTINPUTDEVICE8 pPrevDevice=(XTL::LPDIRECTINPUTDEVICE8)-1; - - HRESULT hRet=0; - DWORD dwFlags=0; - - // ****************************************************************** - // * Default values necessary for axis - // ****************************************************************** - Controller->Gamepad.sThumbLX = 0; - Controller->Gamepad.sThumbLY = 0; - Controller->Gamepad.sThumbRX = 0; - Controller->Gamepad.sThumbRY = 0; - - XTL::DIJOYSTATE JoyState = { 0 }; - BYTE KeyboardState[256] = { 0 }; - XTL::DIMOUSESTATE2 MouseState = { 0 }; - - // ****************************************************************** - // * Poll all devices - // ****************************************************************** - for(int v=0;vPoll(); - if (FAILED(hRet)) { - hRet = pDevice->Acquire(); - while (hRet == DIERR_INPUTLOST) - hRet = pDevice->Acquire(); - } - - if (dwFlags & DEVICE_FLAG_JOYSTICK) { - JoyState = { 0 }; - if (pDevice->GetDeviceState(sizeof(JoyState), &JoyState) != DI_OK) - continue; - } - else if (dwFlags & DEVICE_FLAG_KEYBOARD) { - memset(KeyboardState, 0, sizeof(KeyboardState)); - if (pDevice->GetDeviceState(sizeof(KeyboardState), &KeyboardState) != DI_OK) - continue; - } - else if (dwFlags & DEVICE_FLAG_MOUSE) { - MouseState = { 0 }; - - if (pDevice->GetDeviceState(sizeof(MouseState), &MouseState) != DI_OK) - continue; - } - } - - SHORT wValue = 0; - - // ****************************************************************** - // * Interpret PC Joystick Input - // ****************************************************************** - if(dwFlags & DEVICE_FLAG_JOYSTICK) - { - if(dwFlags & DEVICE_FLAG_AXIS) - { - LONG *pdwAxis = (LONG*)((uint32)&JoyState + dwInfo); - wValue = (SHORT)(*pdwAxis); - - if(dwFlags & DEVICE_FLAG_NEGATIVE) - { - if(wValue < 0) - wValue = abs(wValue+1); - else - wValue = 0; - } - else if(dwFlags & DEVICE_FLAG_POSITIVE) - { - if(wValue < 0) - wValue = 0; - } - } - else if(dwFlags & DEVICE_FLAG_BUTTON) - { - BYTE *pbButton = (BYTE*)((uint32)&JoyState + dwInfo); - - if(*pbButton & 0x80) - wValue = 32767; - else - wValue = 0; - } - } - // ****************************************************************** - // * Interpret PC KeyBoard Input - // ****************************************************************** - else if(dwFlags & DEVICE_FLAG_KEYBOARD) - { - BYTE bKey = KeyboardState[dwInfo]; - - if(bKey & 0x80) - wValue = 32767; - else - wValue = 0; - } - // ****************************************************************** - // * Interpret PC Mouse Input - // ****************************************************************** - else if(dwFlags & DEVICE_FLAG_MOUSE) - { - if(dwFlags & DEVICE_FLAG_MOUSE_CLICK) - { - if(MouseState.rgbButtons[dwInfo] & 0x80) - wValue = 32767; - else - wValue = 0; - } - else if(dwFlags & DEVICE_FLAG_AXIS) - { - static LONG lAccumX = 0; - static LONG lAccumY = 0; - static LONG lAccumZ = 0; - - lAccumX += MouseState.lX * 300; - lAccumY += MouseState.lY * 300; - lAccumZ += MouseState.lZ * 300; - - if(lAccumX > 32767) - lAccumX = 32767; - else if(lAccumX < -32768) - lAccumX = -32768; - - if(lAccumY > 32767) - lAccumY = 32767; - else if(lAccumY < -32768) - lAccumY = -32768; - - if(lAccumZ > 32767) - lAccumZ = 32767; - else if(lAccumZ < -32768) - lAccumZ = -32768; - - if(dwInfo == FIELD_OFFSET(XTL::DIMOUSESTATE, lX)) - wValue = (WORD)lAccumX; - else if(dwInfo == FIELD_OFFSET(XTL::DIMOUSESTATE, lY)) - wValue = (WORD)lAccumY; - else if(dwInfo == FIELD_OFFSET(XTL::DIMOUSESTATE, lZ)) - wValue = (WORD)lAccumZ; - - if(dwFlags & DEVICE_FLAG_NEGATIVE) - { - if(wValue < 0) - wValue = abs(wValue+1); - else - wValue = 0; - } - else if(dwFlags & DEVICE_FLAG_POSITIVE) - { - if(wValue < 0) - wValue = 0; - } - } - } - - // ****************************************************************** - // * Map Xbox Joystick Input - // ****************************************************************** - if(v >= XBCTRL_OBJECT_LTHUMBPOSX && v <= XBCTRL_OBJECT_RTHUMB) - { - switch(v) - { - case XBCTRL_OBJECT_LTHUMBPOSY: - Controller->Gamepad.sThumbLY += wValue; - break; - case XBCTRL_OBJECT_LTHUMBNEGY: - Controller->Gamepad.sThumbLY -= wValue; - break; - case XBCTRL_OBJECT_RTHUMBPOSY: - Controller->Gamepad.sThumbRY += wValue; - break; - case XBCTRL_OBJECT_RTHUMBNEGY: - Controller->Gamepad.sThumbRY -= wValue; - break; - case XBCTRL_OBJECT_LTHUMBPOSX: - Controller->Gamepad.sThumbLX += wValue; - break; - case XBCTRL_OBJECT_LTHUMBNEGX: - Controller->Gamepad.sThumbLX -= wValue; - break; - case XBCTRL_OBJECT_RTHUMBPOSX: - Controller->Gamepad.sThumbRX += wValue; - break; - case XBCTRL_OBJECT_RTHUMBNEGX: - Controller->Gamepad.sThumbRX -= wValue; - break; - case XBCTRL_OBJECT_A: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_A] = (wValue / 128); - break; - case XBCTRL_OBJECT_B: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_B] = (wValue / 128); - break; - case XBCTRL_OBJECT_X: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_X] = (wValue / 128); - break; - case XBCTRL_OBJECT_Y: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_Y] = (wValue / 128); - break; - case XBCTRL_OBJECT_WHITE: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_WHITE] = (wValue / 128); - break; - case XBCTRL_OBJECT_BLACK: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_BLACK] = (wValue / 128); - break; - case XBCTRL_OBJECT_LTRIGGER: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_LEFT_TRIGGER] = (wValue / 128); - break; - case XBCTRL_OBJECT_RTRIGGER: - Controller->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_RIGHT_TRIGGER] = (wValue / 128); - break; - case XBCTRL_OBJECT_DPADUP: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_UP; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_UP; - break; - case XBCTRL_OBJECT_DPADDOWN: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_DOWN; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_DOWN; - break; - case XBCTRL_OBJECT_DPADLEFT: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_LEFT; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_LEFT; - break; - case XBCTRL_OBJECT_DPADRIGHT: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_RIGHT; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_RIGHT; - break; - case XBCTRL_OBJECT_BACK: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_BACK; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_BACK; - break; - case XBCTRL_OBJECT_START: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_START; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_START; - break; - case XBCTRL_OBJECT_LTHUMB: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_LEFT_THUMB; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_LEFT_THUMB; - break; - case XBCTRL_OBJECT_RTHUMB: - if(wValue > 0) - Controller->Gamepad.wButtons |= X_XINPUT_GAMEPAD_RIGHT_THUMB; - else - Controller->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_RIGHT_THUMB; - break; - } - } - } - - return; -} - -// ****************************************************************** -// * func: XBController::ListenEnd -// ****************************************************************** -void XBController::ListenEnd() -{ - if(m_CurrentState != XBCTRL_STATE_LISTEN) - { - SetError("Invalid State"); - return; - } - - DInputCleanup(); - - m_CurrentState = XBCTRL_STATE_NONE; - - return; -} - -// ****************************************************************** -// * func: XBController::DeviceIsUsed -// ****************************************************************** -bool XBController::DeviceIsUsed(const char *szDeviceName) -{ - for(int v=0;vEnumDevices - ( - DI8DEVCLASS_GAMECTRL, - WrapEnumGameCtrlCallback, - this, - DIEDFL_ATTACHEDONLY - ); - - if(m_CurrentState == XBCTRL_STATE_CONFIG || DeviceIsUsed("SysKeyboard")) - { - hRet = m_pDirectInput8->CreateDevice(XTL::GUID_SysKeyboard, &m_InputDevice[m_dwInputDeviceCount].m_Device, NULL); - - if(!FAILED(hRet)) - { - m_InputDevice[m_dwInputDeviceCount].m_Flags = DEVICE_FLAG_KEYBOARD; - - m_InputDevice[m_dwInputDeviceCount++].m_Device->SetDataFormat(&XTL::c_dfDIKeyboard); - } - - if(m_CurrentState == XBCTRL_STATE_LISTEN) - ReorderObjects("SysKeyboard", m_dwInputDeviceCount - 1); - } - - if(m_CurrentState == XBCTRL_STATE_CONFIG || DeviceIsUsed("SysMouse")) - { - hRet = m_pDirectInput8->CreateDevice(XTL::GUID_SysMouse, &m_InputDevice[m_dwInputDeviceCount].m_Device, NULL); - - if(!FAILED(hRet)) - { - m_InputDevice[m_dwInputDeviceCount].m_Flags = DEVICE_FLAG_MOUSE; - - m_InputDevice[m_dwInputDeviceCount++].m_Device->SetDataFormat(&XTL::c_dfDIMouse2); - } - - if(m_CurrentState == XBCTRL_STATE_LISTEN) - ReorderObjects("SysMouse", m_dwInputDeviceCount - 1); - } - } - - // ****************************************************************** - // * Enumerate Controller objects - // ****************************************************************** - for(m_dwCurObject=0;m_dwCurObjectEnumObjects(WrapEnumObjectsCallback, this, DIDFT_ALL); - - // ****************************************************************** - // * Set cooperative level and acquire - // ****************************************************************** - { - for(int v=m_dwInputDeviceCount-1;v>=0;v--) - { - m_InputDevice[v].m_Device->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND); - m_InputDevice[v].m_Device->Acquire(); - - HRESULT hRet = m_InputDevice[v].m_Device->Poll(); - - if(FAILED(hRet)) - { - hRet = m_InputDevice[v].m_Device->Acquire(); - - while(hRet == DIERR_INPUTLOST) - hRet = m_InputDevice[v].m_Device->Acquire(); - - if(hRet != DIERR_INPUTLOST) - break; - } - } - } -} - -// ****************************************************************** -// * func: XBController::DInputCleanup -// ****************************************************************** -void XBController::DInputCleanup() -{ - for(int v=m_dwInputDeviceCount-1;v>=0;v--) - { - m_InputDevice[v].m_Device->Unacquire(); - m_InputDevice[v].m_Device->Release(); - m_InputDevice[v].m_Device = 0; - } - - m_dwInputDeviceCount = 0; - - if(m_pDirectInput8 != 0) - { - m_pDirectInput8->Release(); - m_pDirectInput8 = 0; - } - - return; -} - -// ****************************************************************** -// * func: XBController::Map -// ****************************************************************** -void XBController::Map(XBCtrlObject object, const char *szDeviceName, int dwInfo, int dwFlags) -{ - // Initialize InputMapping instance - m_ObjectConfig[object].dwDevice = Insert(szDeviceName); - m_ObjectConfig[object].dwInfo = dwInfo; - m_ObjectConfig[object].dwFlags = dwFlags; - - // Purge unused device slots - for(int v=0;vtszInstanceName)) - return DIENUM_CONTINUE; - - HRESULT hRet = m_pDirectInput8->CreateDevice(lpddi->guidInstance, &m_InputDevice[m_dwInputDeviceCount].m_Device, NULL); - - if(!FAILED(hRet)) - { - m_InputDevice[m_dwInputDeviceCount].m_Flags = DEVICE_FLAG_JOYSTICK; - - m_InputDevice[m_dwInputDeviceCount++].m_Device->SetDataFormat(&XTL::c_dfDIJoystick); - - if(m_CurrentState == XBCTRL_STATE_LISTEN) - ReorderObjects(lpddi->tszInstanceName, m_dwInputDeviceCount - 1); - } - - return DIENUM_CONTINUE; -} - -// ****************************************************************** -// * func: XBController::EnumObjectsCallback -// ****************************************************************** -BOOL XBController::EnumObjectsCallback(XTL::LPCDIDEVICEOBJECTINSTANCE lpddoi) -{ - if(lpddoi->dwType & DIDFT_AXIS) - { - XTL::DIPROPRANGE diprg; - - diprg.diph.dwSize = sizeof(XTL::DIPROPRANGE); - diprg.diph.dwHeaderSize = sizeof(XTL::DIPROPHEADER); - diprg.diph.dwHow = DIPH_BYID; - diprg.diph.dwObj = lpddoi->dwType; - diprg.lMin = 0 - 32768; - diprg.lMax = 0 + 32767; - - HRESULT hRet = m_InputDevice[m_dwCurObject].m_Device->SetProperty(DIPROP_RANGE, &diprg.diph); - - if(FAILED(hRet)) - { - if(hRet == E_NOTIMPL) - return DIENUM_CONTINUE; - else - return DIENUM_STOP; - } - } - else if(lpddoi->dwType & DIDFT_BUTTON) - { - XTL::DIPROPRANGE diprg; - - diprg.diph.dwSize = sizeof(XTL::DIPROPRANGE); - diprg.diph.dwHeaderSize = sizeof(XTL::DIPROPHEADER); - diprg.diph.dwHow = DIPH_BYID; - diprg.diph.dwObj = lpddoi->dwType; - diprg.lMin = 0; - diprg.lMax = 255; - - HRESULT hRet = m_InputDevice[m_dwCurObject].m_Device->SetProperty(DIPROP_RANGE, &diprg.diph); - - if(FAILED(hRet)) - { - if(hRet == E_NOTIMPL) - return DIENUM_CONTINUE; - else - return DIENUM_STOP; - } - } - - return DIENUM_CONTINUE; -} - -// ****************************************************************** -// * func: WrapEnumGameCtrlCallback -// ****************************************************************** -BOOL CALLBACK WrapEnumGameCtrlCallback(XTL::LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) -{ - XBController *context = (XBController*)pvRef; - - return context->EnumGameCtrlCallback(lpddi); -} - -// ****************************************************************** -// * func: WrapEnumObjectsCallback -// ****************************************************************** -BOOL CALLBACK WrapEnumObjectsCallback(XTL::LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) -{ - XBController *context = (XBController*)pvRef; - - return context->EnumObjectsCallback(lpddoi); -} - -// ****************************************************************** -// * Input Device Name Lookup Table -// ****************************************************************** -const char *XBController::m_DeviceNameLookup[XBCTRL_OBJECT_COUNT] = -{ - // ****************************************************************** - // * Analog Axis - // ****************************************************************** - "LThumbPosX", "LThumbNegX", "LThumbPosY", "LThumbNegY", - "RThumbPosX", "RThumbNegX", "RThumbPosY", "RThumbNegY", - - // ****************************************************************** - // * Analog Buttons - // ****************************************************************** - "A", "B", "X", "Y", "Black", "White", "LTrigger", "RTrigger", - - // ****************************************************************** - // * Digital Buttons - // ****************************************************************** - "DPadUp", "DPadDown", "DPadLeft", "DPadRight", - "Back", "Start", "LThumb", "RThumb", -}; diff --git a/src/Common/Win32/XBController.h b/src/Common/Win32/XBController.h deleted file mode 100644 index 1758effd4..000000000 --- a/src/Common/Win32/XBController.h +++ /dev/null @@ -1,259 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->XBController.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef XBCONTROLLER_H -#define XBCONTROLLER_H - -#include "Cxbx.h" -#include "Common/Error.h" -#include "Mutex.h" - -#include -#include -#include - -#include "CxbxKrnl/EmuXTL.h" - -// ****************************************************************** -// * Xbox Controller Object IDs -// ****************************************************************** -enum XBCtrlObject -{ - // ****************************************************************** - // * Analog Axis - // ****************************************************************** - XBCTRL_OBJECT_LTHUMBPOSX = 0, - XBCTRL_OBJECT_LTHUMBNEGX, - XBCTRL_OBJECT_LTHUMBPOSY, - XBCTRL_OBJECT_LTHUMBNEGY, - XBCTRL_OBJECT_RTHUMBPOSX, - XBCTRL_OBJECT_RTHUMBNEGX, - XBCTRL_OBJECT_RTHUMBPOSY, - XBCTRL_OBJECT_RTHUMBNEGY, - // ****************************************************************** - // * Analog Buttons - // ****************************************************************** - XBCTRL_OBJECT_A, - XBCTRL_OBJECT_B, - XBCTRL_OBJECT_X, - XBCTRL_OBJECT_Y, - XBCTRL_OBJECT_BLACK, - XBCTRL_OBJECT_WHITE, - XBCTRL_OBJECT_LTRIGGER, - XBCTRL_OBJECT_RTRIGGER, - // ****************************************************************** - // * Digital Buttons - // ****************************************************************** - XBCTRL_OBJECT_DPADUP, - XBCTRL_OBJECT_DPADDOWN, - XBCTRL_OBJECT_DPADLEFT, - XBCTRL_OBJECT_DPADRIGHT, - XBCTRL_OBJECT_BACK, - XBCTRL_OBJECT_START, - XBCTRL_OBJECT_LTHUMB, - XBCTRL_OBJECT_RTHUMB, - // ****************************************************************** - // * Total number of components - // ****************************************************************** - XBCTRL_OBJECT_COUNT -}; - -// ****************************************************************** -// * Maximum number of devices allowed -// ****************************************************************** -#define XBCTRL_MAX_DEVICES XBCTRL_OBJECT_COUNT - -// ****************************************************************** -// * Xbox Controller Object Config -// ****************************************************************** -struct XBCtrlObjectCfg -{ - int dwDevice; // offset into m_InputDevice - int dwInfo; // extended information, depending on dwFlags - int dwFlags; // flags explaining the data format -}; - -// ****************************************************************** -// * class: XBController -// ****************************************************************** -class XBController : public Error -{ - public: - // ****************************************************************** - // * Initialization - // ****************************************************************** - XBController(); - ~XBController(); - - // ****************************************************************** - // * Registry Load/Save - // ****************************************************************** - void Load(const char *szRegistryKey); - void Save(const char *szRegistryKey); - - // ****************************************************************** - // * Configuration - // ****************************************************************** - void ConfigBegin(HWND hwnd, XBCtrlObject object); - bool ConfigPoll(char *szStatus); // true if polling detected a change - void ConfigEnd(); - - // ****************************************************************** - // * Listening - // ****************************************************************** - void ListenBegin(HWND hwnd); - void ListenPoll(XTL::X_XINPUT_STATE *Controller); - void ListenEnd(); - - // ****************************************************************** - // * DirectInput Init / Cleanup - // ****************************************************************** - void DInputInit(HWND hwnd); - void DInputCleanup(); - - // ****************************************************************** - // * Check if a device is currently in the configuration - // ****************************************************************** - bool DeviceIsUsed(const char *szDeviceName); - - // ****************************************************************** - // * Input Device Name Lookup Table - // ****************************************************************** - static const char *m_DeviceNameLookup[XBCTRL_OBJECT_COUNT]; - - private: - // ****************************************************************** - // * Object Mapping - // ****************************************************************** - void Map(XBCtrlObject object, const char *szDeviceName, int dwInfo, int dwFlags); - - // ****************************************************************** - // * Find the look-up value for a DeviceName (creating if needed) - // ****************************************************************** - int Insert(const char *szDeviceName); - - // ****************************************************************** - // * Update the object lookup offsets for a device - // ****************************************************************** - void ReorderObjects(const char *szDeviceName, int pos); - - // ****************************************************************** - // * Controller and Objects Enumeration - // ****************************************************************** - BOOL EnumGameCtrlCallback(XTL::LPCDIDEVICEINSTANCE lpddi); - BOOL EnumObjectsCallback(XTL::LPCDIDEVICEOBJECTINSTANCE lpddoi); - - // ****************************************************************** - // * Wrapper Function for Enumeration - // ****************************************************************** - friend BOOL CALLBACK WrapEnumGameCtrlCallback(XTL::LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); - friend BOOL CALLBACK WrapEnumObjectsCallback(XTL::LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef); - - // ****************************************************************** - // * Device Names - // ****************************************************************** - char m_DeviceName[XBCTRL_MAX_DEVICES][260]; - - // ****************************************************************** - // * Object Configuration - // ****************************************************************** - XBCtrlObjectCfg m_ObjectConfig[XBCTRL_OBJECT_COUNT]; - - // ****************************************************************** - // * DirectInput - // ****************************************************************** - XTL::LPDIRECTINPUT8 m_pDirectInput8; - - // ****************************************************************** - // * DirectInput Devices - // ****************************************************************** - struct InputDevice - { - XTL::LPDIRECTINPUTDEVICE8 m_Device; - int m_Flags; - } - m_InputDevice[XBCTRL_MAX_DEVICES]; - - // ****************************************************************** - // * Current State - // ****************************************************************** - enum XBCtrlState m_CurrentState; - - // ****************************************************************** - // * Config State Variables - // ****************************************************************** - LONG lPrevMouseX, lPrevMouseY, lPrevMouseZ; - XBCtrlObject CurConfigObject; - - // ****************************************************************** - // * Etc State Variables - // ****************************************************************** - int m_dwInputDeviceCount; - int m_dwCurObject; - -}; - -// ****************************************************************** -// * Device Flags -// ****************************************************************** -#define DEVICE_FLAG_JOYSTICK (1 << 0) -#define DEVICE_FLAG_KEYBOARD (1 << 1) -#define DEVICE_FLAG_MOUSE (1 << 2) -#define DEVICE_FLAG_AXIS (1 << 3) -#define DEVICE_FLAG_BUTTON (1 << 4) -#define DEVICE_FLAG_POSITIVE (1 << 5) -#define DEVICE_FLAG_NEGATIVE (1 << 6) -#define DEVICE_FLAG_MOUSE_CLICK (1 << 7) -#define DEVICE_FLAG_MOUSE_LX (1 << 8) -#define DEVICE_FLAG_MOUSE_LY (1 << 9) -#define DEVICE_FLAG_MOUSE_LZ (1 << 10) - -// ****************************************************************** -// * Detection Sensitivity -// ****************************************************************** -#define DETECT_SENSITIVITY_JOYSTICK 25000 -#define DETECT_SENSITIVITY_BUTTON 0 -#define DETECT_SENSITIVITY_MOUSE 5 -#define DETECT_SENSITIVITY_POV 50000 - -// ****************************************************************** -// * DirectInput Enumeration Types -// ****************************************************************** -enum XBCtrlState -{ - XBCTRL_STATE_NONE = 0, - XBCTRL_STATE_CONFIG, - XBCTRL_STATE_LISTEN -}; - -#endif diff --git a/src/Common/Win32/XBPortMapping.cpp b/src/Common/Win32/XBPortMapping.cpp deleted file mode 100644 index 27106ac77..000000000 --- a/src/Common/Win32/XBPortMapping.cpp +++ /dev/null @@ -1,200 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Common->XBPortMapping.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "XBPM" - -#undef FIELD_OFFSET // prevent macro redefinition warnings -/* prevent name collisions */ -namespace xboxkrnl -{ - #include -}; - -#include -//#include "CxbxKrnl.h" -//#include "Logging.h" -//#include "Emu.h" -//#include "EmuKrnl.h" // For DefaultLaunchDataPage -//#include "EmuFile.h" -//#include "EmuFS.h" -//#include "EmuShared.h" -//#include "HLEIntercept.h" -//#include "CxbxVSBC/CxbxVSBC.h" -//#include "Windef.h" -//#include - - -DWORD g_XboxPortMapHostType[] = { 1,1,1,1 }; -DWORD g_XboxPortMapHostPort[] = { 0,1,2,3 }; - -// XInputSetState status waiters - -void XBPortMappingLoad(const char *szRegistryKey) -{ - { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if (RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - dwType = REG_DWORD; dwSize = sizeof(DWORD); - LSTATUS result; - result = RegQueryValueEx(hKey, "XboxPort0HostType", NULL, &dwType, (PBYTE)&g_XboxPortMapHostType[0], &dwSize); - if (result != ERROR_SUCCESS) { - //default to use XInput - g_XboxPortMapHostType[0] = 1; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort0HostPort", NULL, &dwType, (PBYTE)&g_XboxPortMapHostPort[0], &dwSize); - if (result != ERROR_SUCCESS) { - g_XboxPortMapHostPort[0] = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort1HostType", NULL, &dwType, (PBYTE)&g_XboxPortMapHostType[1], &dwSize); - if (result != ERROR_SUCCESS) { - //default to use XInput - g_XboxPortMapHostType[1] = 1; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort1HostPort", NULL, &dwType, (PBYTE)&g_XboxPortMapHostPort[1], &dwSize); - if (result != ERROR_SUCCESS) { - g_XboxPortMapHostPort[1] = 1; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort2HostType", NULL, &dwType, (PBYTE)&g_XboxPortMapHostType[2], &dwSize); - if (result != ERROR_SUCCESS) { - //default to use XInput - g_XboxPortMapHostType[2] = 1; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort2HostPort", NULL, &dwType, (PBYTE)&g_XboxPortMapHostPort[2], &dwSize); - if (result != ERROR_SUCCESS) { - g_XboxPortMapHostPort[2] = 2; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort3HostType", NULL, &dwType, (PBYTE)&g_XboxPortMapHostType[3], &dwSize); - if (result != ERROR_SUCCESS) { - //default to use XInput - g_XboxPortMapHostType[3] = 1; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "XboxPort3HostPort", NULL, &dwType, (PBYTE)&g_XboxPortMapHostPort[3], &dwSize); - if (result != ERROR_SUCCESS) { - g_XboxPortMapHostPort[3] = 3; - } - - RegCloseKey(hKey); - } - } -} - -// ****************************************************************** -// * func: Save -// ****************************************************************** -void XBPortMappingSave(const char *szRegistryKey) -{ - // ****************************************************************** - // * Save Configuration to Registry - // ****************************************************************** - //if (g_SaveOnExit) { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if (RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort0HostType", 0, dwType, (PBYTE)&g_XboxPortMapHostType[0], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort0HostPort", 0, dwType, (PBYTE)&g_XboxPortMapHostPort[0], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort1HostType", 0, dwType, (PBYTE)&g_XboxPortMapHostType[1], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort1HostPort", 0, dwType, (PBYTE)&g_XboxPortMapHostPort[1], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort2HostType", 0, dwType, (PBYTE)&g_XboxPortMapHostType[2], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort2HostPort", 0, dwType, (PBYTE)&g_XboxPortMapHostPort[2], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort3HostType", 0, dwType, (PBYTE)&g_XboxPortMapHostType[3], dwSize); - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - RegSetValueEx(hKey, "XboxPort3HostPort", 0, dwType, (PBYTE)&g_XboxPortMapHostPort[3], dwSize); - - - RegCloseKey(hKey); - } - //} -} - -//Set HostType and HostPort setting from global array per xbox port. The setted value will take effect from next time xbe loading. -void SetXboxPortToHostPort(DWORD dwXboxPort, DWORD dwHostType, DWORD dwHostPort) -{ - //set host type and host port in global array per xbox port, will be used when xbe get reloaded. - //only host type and host port can be set in this time. because the xbox DeviceType can only be determined when loading the xbe. - g_XboxPortMapHostType[dwXboxPort] = dwHostType; - g_XboxPortMapHostPort[dwXboxPort] = dwHostPort; -} -//retrieve HostType and HostPort setting from global array per xbox port. -void GetXboxPortToHostPort(DWORD dwXboxPort, DWORD &dwHostType, DWORD &dwHostPort) -{ - //get Host Type and Host Port per xbox port - dwHostType = g_XboxPortMapHostType[dwXboxPort]; - dwHostPort = g_XboxPortMapHostPort[dwXboxPort]; -} - -DWORD GetXboxPortMapHostType(DWORD dwXboxPort) -{ - return g_XboxPortMapHostType[dwXboxPort]; -} - -DWORD GetXboxPortMapHostPort(DWORD dwXboxPort) -{ - return g_XboxPortMapHostPort[dwXboxPort]; -} diff --git a/src/Common/Win32/XBPortMapping.h b/src/Common/Win32/XBPortMapping.h deleted file mode 100644 index ab2e8c059..000000000 --- a/src/Common/Win32/XBPortMapping.h +++ /dev/null @@ -1,55 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Common->XBPortMapping.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef XBPORTMAPPING_H -#define XBPORTMAPPING_H - -#include "../CxbxKrnl/EmuXapi.h" - -extern void SetXboxPortToHostPort(DWORD dwXboxPort, DWORD dwHostType, DWORD dwHostPort); - -extern void GetXboxPortToHostPort(DWORD dwXboxPort, DWORD &dwHostType, DWORD &dwHostPort); - -extern DWORD GetXboxPortMapHostType(DWORD dwXboxPort); - -extern DWORD GetXboxPortMapHostPort(DWORD dwXboxPort); -// ****************************************************************** -// * Load Configuration from Registry -// ****************************************************************** -extern void XBPortMappingLoad(const char *szRegistryKey); - -// ****************************************************************** -// * Save Configuration from Registry -// ****************************************************************** -extern void XBPortMappingSave(const char *szRegistryKey); -#endif diff --git a/src/Common/Win32/XBVideo.cpp b/src/Common/Win32/XBVideo.cpp deleted file mode 100644 index aa5dbcc85..000000000 --- a/src/Common/Win32/XBVideo.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->XBVideo.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#include "XBVideo.h" - -#include - -// ****************************************************************** -// * func: XBVideo::XBVideo -// ****************************************************************** -XBVideo::XBVideo() : m_bVSync(false), m_bFullscreen(false), m_bHardwareYUV(false) -{ - strcpy(m_szVideoResolution, "Automatic (Default)"); -} - -// ****************************************************************** -// * func: XBVideo::~XBVideo -// ****************************************************************** -XBVideo::~XBVideo() -{ -} - -// ****************************************************************** -// * func: XBVideo::Load -// ****************************************************************** -void XBVideo::Load(const char *szRegistryKey) -{ - // ****************************************************************** - // * Load Configuration from Registry - // ****************************************************************** - { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if(RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - dwType = REG_SZ; dwSize = sizeof(m_szVideoResolution); - RegQueryValueEx(hKey, "VideoResolution", NULL, &dwType, (PBYTE)m_szVideoResolution, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_dwDisplayAdapter); - RegQueryValueEx(hKey, "DisplayAdapter", NULL, &dwType, (PBYTE)&m_dwDisplayAdapter, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_dwDirect3DDevice); - RegQueryValueEx(hKey, "Direct3DDevice", NULL, &dwType, (PBYTE)&m_dwDirect3DDevice, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bFullscreen); - RegQueryValueEx(hKey, "Fullscreen", NULL, &dwType, (PBYTE)&m_bFullscreen, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bVSync); - RegQueryValueEx(hKey, "VSync", NULL, &dwType, (PBYTE)&m_bVSync, &dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bHardwareYUV); - RegQueryValueEx(hKey, "HardwareYUV", NULL, &dwType, (PBYTE)&m_bHardwareYUV, &dwSize); - - RegCloseKey(hKey); - } - } -} - -// ****************************************************************** -// * func: XBVideo::Save -// ****************************************************************** -void XBVideo::Save(const char *szRegistryKey) -{ - // ****************************************************************** - // * Save Configuration to Registry - // ****************************************************************** - if (g_SaveOnExit) { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if(RegCreateKeyEx(HKEY_CURRENT_USER, szRegistryKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - dwType = REG_SZ; dwSize = sizeof(m_szVideoResolution); - RegSetValueEx(hKey, "VideoResolution", 0, dwType, (PBYTE)m_szVideoResolution, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_dwDisplayAdapter); - RegSetValueEx(hKey, "DisplayAdapter", 0, dwType, (PBYTE)&m_dwDisplayAdapter, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_dwDirect3DDevice); - RegSetValueEx(hKey, "Direct3DDevice", 0, dwType, (PBYTE)&m_dwDirect3DDevice, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bFullscreen); - RegSetValueEx(hKey, "Fullscreen", 0, dwType, (PBYTE)&m_bFullscreen, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bVSync); - RegSetValueEx(hKey, "VSync", 0, dwType, (PBYTE)&m_bVSync, dwSize); - - dwType = REG_DWORD; dwSize = sizeof(m_bHardwareYUV); - RegSetValueEx(hKey, "HardwareYUV", 0, dwType, (PBYTE)&m_bHardwareYUV, dwSize); - - RegCloseKey(hKey); - } - } -} diff --git a/src/Common/Win32/XBVideo.h b/src/Common/Win32/XBVideo.h deleted file mode 100644 index 43630e44d..000000000 --- a/src/Common/Win32/XBVideo.h +++ /dev/null @@ -1,107 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->XBVideo.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef XBVIDEO_H -#define XBVIDEO_H - -#include "Cxbx.h" -#include "Common/Error.h" -#include "Mutex.h" - -// ****************************************************************** -// * class: XBVideo -// ****************************************************************** -class XBVideo : public Error -{ - public: - // ****************************************************************** - // * Initialization - // ****************************************************************** - XBVideo(); - ~XBVideo(); - - // ****************************************************************** - // * Registry Load/Save - // ****************************************************************** - void Load(const char *szRegistryKey); - void Save(const char *szRegistryKey); - - // ****************************************************************** - // * SetDirect3DDevice - // ****************************************************************** - void SetDirect3DDevice(DWORD dwDirect3DDevice) { m_dwDirect3DDevice = dwDirect3DDevice; } - DWORD GetDirect3DDevice() const { return m_dwDirect3DDevice; } - - // ****************************************************************** - // * SetDisplayAdapter - // ****************************************************************** - void SetDisplayAdapter(DWORD dwDisplayAdapter) { m_dwDisplayAdapter = dwDisplayAdapter; } - DWORD GetDisplayAdapter() const { return m_dwDisplayAdapter; } - - // ****************************************************************** - // * SetVideoResolution - // ****************************************************************** - void SetVideoResolution(const char *szBuffer) { strcpy(m_szVideoResolution, szBuffer); } - const char *GetVideoResolution(){ return m_szVideoResolution; } - - // ****************************************************************** - // * Fullscreen Toggling - // ****************************************************************** - void SetFullscreen(BOOL bFullscreen) { m_bFullscreen = bFullscreen; } - BOOL GetFullscreen() const { return m_bFullscreen; } - - // ****************************************************************** - // * VSync Toggling - // ****************************************************************** - void SetVSync(BOOL bVSync) { m_bVSync = bVSync; } - BOOL GetVSync() const { return m_bVSync; } - - // ****************************************************************** - // * Hardware YUV Toggling - // ****************************************************************** - void SetHardwareYUV(BOOL bHardwareYUV) { m_bHardwareYUV = bHardwareYUV; } - BOOL GetHardwareYUV() const { return m_bHardwareYUV; } - - private: - // ****************************************************************** - // * Configuration - // ****************************************************************** - char m_szVideoResolution[100]; - DWORD m_dwDisplayAdapter; - DWORD m_dwDirect3DDevice; - BOOL m_bVSync; - BOOL m_bFullscreen; - BOOL m_bHardwareYUV; -}; - -#endif diff --git a/src/Common/Xbe.h b/src/Common/Xbe.h deleted file mode 100644 index 88285d2c2..000000000 --- a/src/Common/Xbe.h +++ /dev/null @@ -1,391 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Xbe.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef XBE_H -#define XBE_H - -#include "Common/Error.h" - -#include - - -//#include // For MAX_PATH -// The above leads to 55 compile errors, so until we've sorted out why that happens, declare MAX_PATH ourselves for now : -#define MAX_PATH 260 -#define XPR_IMAGE_WH 128 -#define XPR_IMAGE_DATA_SIZE (XPR_IMAGE_WH * XPR_IMAGE_WH) / 2 -#define XPR_IMAGE_HDR_SIZE 2048 - -// Xbe (Xbox Executable) file object -class Xbe : public Error -{ - public: - // construct via Xbe file - Xbe(const char *x_szFilename, bool bFromGUI); - - // deconstructor - ~Xbe(); - - // find an image by name - void *FindSection(char *zsSectionName); - - // export to Xbe file - void Export(const char *x_szXbeFilename); - - // verify the integrity of the loaded xbe - bool CheckXbeSignature(); - - // import logo bitmap from raw monochrome data - void ImportLogoBitmap(const uint08 x_Gray[100*17]); - - // export logo bitmap to raw monochrome data - void ExportLogoBitmap(uint08 x_Gray[100*17]); - - // purge illegal characters in Windows filenames or other OS's - void PurgeBadChar(std::string& s, const std::string& illegalChars = "\\/:?\"<>|"); - - // Convert game region field to string - const char *GameRegionToString(); - - // Xbe header - #include "AlignPrefix1.h" - struct Header - { - uint32 dwMagic; // 0x0000 - magic number [should be "XBEH"] - uint08 pbDigitalSignature[256]; // 0x0004 - digital signature - uint32 dwBaseAddr; // 0x0104 - base address - uint32 dwSizeofHeaders; // 0x0108 - size of headers - uint32 dwSizeofImage; // 0x010C - size of image - uint32 dwSizeofImageHeader; // 0x0110 - size of image header - uint32 dwTimeDate; // 0x0114 - timedate stamp - uint32 dwCertificateAddr; // 0x0118 - certificate address - uint32 dwSections; // 0x011C - number of sections - uint32 dwSectionHeadersAddr; // 0x0120 - section headers address - - typedef struct - { - uint32 bMountUtilityDrive : 1; // mount utility drive flag - uint32 bFormatUtilityDrive : 1; // format utility drive flag - uint32 bLimit64MB : 1; // limit development kit run time memory to 64mb flag - uint32 bDontSetupHarddisk : 1; // don't setup hard disk flag - uint32 Unused : 4; // unused (or unknown) - uint32 Unused_b1 : 8; // unused (or unknown) - uint32 Unused_b2 : 8; // unused (or unknown) - uint32 Unused_b3 : 8; // unused (or unknown) - } InitFlags; - - union { // 0x0124 - initialization flags - InitFlags dwInitFlags; - uint32 dwInitFlags_value; - }; - - uint32 dwEntryAddr; // 0x0128 - entry point address - uint32 dwTLSAddr; // 0x012C - thread local storage directory address - uint32 dwPeStackCommit; // 0x0130 - size of stack commit - uint32 dwPeHeapReserve; // 0x0134 - size of heap reserve - uint32 dwPeHeapCommit; // 0x0138 - size of heap commit - uint32 dwPeBaseAddr; // 0x013C - original base address - uint32 dwPeSizeofImage; // 0x0140 - size of original image - uint32 dwPeChecksum; // 0x0144 - original checksum - uint32 dwPeTimeDate; // 0x0148 - original timedate stamp - uint32 dwDebugPathnameAddr; // 0x014C - debug pathname address - uint32 dwDebugFilenameAddr; // 0x0150 - debug filename address - uint32 dwDebugUnicodeFilenameAddr; // 0x0154 - debug unicode filename address - uint32 dwKernelImageThunkAddr; // 0x0158 - kernel image thunk address - uint32 dwNonKernelImportDirAddr; // 0x015C - non kernel import directory address - uint32 dwLibraryVersions; // 0x0160 - number of library versions - uint32 dwLibraryVersionsAddr; // 0x0164 - library versions address - uint32 dwKernelLibraryVersionAddr; // 0x0168 - kernel library version address - uint32 dwXAPILibraryVersionAddr; // 0x016C - xapi library version address - uint32 dwLogoBitmapAddr; // 0x0170 - logo bitmap address - uint32 dwSizeofLogoBitmap; // 0x0174 - logo bitmap size - } - #include "AlignPosfix1.h" - m_Header; - - // Xbe header extra byte (used to preserve unknown data) - char *m_HeaderEx; - uint32 m_ExSize; - - // Xbe certificate - #include "AlignPrefix1.h" - struct Certificate - { - uint32 dwSize; // 0x0000 - size of certificate - uint32 dwTimeDate; // 0x0004 - timedate stamp - uint32 dwTitleId; // 0x0008 - title id - wchar_t wszTitleName[40]; // 0x000C - title name (unicode) - uint32 dwAlternateTitleId[0x10]; // 0x005C - alternate title ids - uint32 dwAllowedMedia; // 0x009C - allowed media types - uint32 dwGameRegion; // 0x00A0 - game region - uint32 dwGameRatings; // 0x00A4 - game ratings - uint32 dwDiskNumber; // 0x00A8 - disk number - uint32 dwVersion; // 0x00AC - version - uint08 bzLanKey[16]; // 0x00B0 - lan key - uint08 bzSignatureKey[16]; // 0x00C0 - signature key - // NOT ALL XBEs have these fields! - uint08 bzTitleAlternateSignatureKey[16][16]; // 0x00D0 - alternate signature keys - uint32 dwOriginalCertificateSize; // 0x01D0 - Original Certificate Size? - uint32 dwOnlineService; // 0x01D4 - Online Service ID - uint32 dwSecurityFlags; // 0x01D8 - Extra Security Flags - uint08 bzCodeEncKey[16]; // 0x01DC - Code Encryption Key? - } - #include "AlignPosfix1.h" - m_Certificate; - - // Xbe section header - #include "AlignPrefix1.h" - struct SectionHeader - { - typedef struct - { - uint32 bWritable : 1; // writable flag - uint32 bPreload : 1; // preload flag - uint32 bExecutable : 1; // executable flag - uint32 bInsertedFile : 1; // inserted file flag - uint32 bHeadPageRO : 1; // head page read only flag - uint32 bTailPageRO : 1; // tail page read only flag - uint32 Unused_a1 : 1; // unused (or unknown) - uint32 Unused_a2 : 1; // unused (or unknown) - uint32 Unused_b1 : 8; // unused (or unknown) - uint32 Unused_b2 : 8; // unused (or unknown) - uint32 Unused_b3 : 8; // unused (or unknown) - } _Flags; - - union { - _Flags dwFlags; - uint32 dwFlags_value; - }; - - uint32 dwVirtualAddr; // virtual address - uint32 dwVirtualSize; // virtual size - uint32 dwRawAddr; // file offset to raw data - uint32 dwSizeofRaw; // size of raw data - uint32 dwSectionNameAddr; // section name addr - uint32 dwSectionRefCount; // section reference count - uint32 dwHeadSharedRefCountAddr; // head shared page reference count address - uint32 dwTailSharedRefCountAddr; // tail shared page reference count address - uint08 bzSectionDigest[20]; // section digest - } - #include "AlignPosfix1.h" - *m_SectionHeader; - - // Xbe library versions - #include "AlignPrefix1.h" - struct LibraryVersion - { - char szName[8]; // library name - uint16 wMajorVersion; // major version - uint16 wMinorVersion; // minor version - uint16 wBuildVersion; // build version - - typedef struct - { - uint16 QFEVersion : 13; // QFE Version - uint16 Approved : 2; // Approved? (0:no, 1:possibly, 2:yes) - uint16 bDebugBuild : 1; // Is this a debug build? - } Flags; - - union { - Flags wFlags; - uint16 wFlags_value; - }; - } - #include "AlignPosfix1.h" - *m_LibraryVersion, *m_KernelLibraryVersion, *m_XAPILibraryVersion; - - // Xbe thread local storage - #include "AlignPrefix1.h" - struct TLS - { - uint32 dwDataStartAddr; // raw start address - uint32 dwDataEndAddr; // raw end address - uint32 dwTLSIndexAddr; // tls index address - uint32 dwTLSCallbackAddr; // tls callback address - uint32 dwSizeofZeroFill; // size of zero fill - uint32 dwCharacteristics; // characteristics - } - #include "AlignPosfix1.h" - *m_TLS; - - // Xbe signature header - uint08* m_SignatureHeader; - - // Xbe section names, stored null terminated - char (*m_szSectionName)[10]; - - // Xbe sections - uint08 **m_bzSection; - - // Xbe original path - char m_szPath[MAX_PATH]; - - // Xbe ascii title, translated from certificate title - char m_szAsciiTitle[40]; - - // retrieve thread local storage data address - uint08 *GetTLSData() { if(m_TLS == 0) return 0; else return GetAddr(m_TLS->dwDataStartAddr); } - - // retrieve thread local storage index address - uint32 *GetTLSIndex() { if(m_TLS == 0) return 0; else return (uint32*)GetAddr(m_TLS->dwTLSIndexAddr); } - - // return a modifiable pointer inside this structure that corresponds to a virtual address - uint08 *GetAddr(uint32 x_dwVirtualAddress); - - const wchar_t *GetUnicodeFilenameAddr(); - private: - // constructor initialization - void ConstructorInit(); - - // return a modifiable pointer to logo bitmap data - uint08 *GetLogoBitmap(uint32 x_dwSize); - - - // used to encode/decode logo bitmap data - union LogoRLE - { - struct Eight - { - uint32 bType1 : 1; - uint32 Len : 3; - uint32 Data : 4; - } - m_Eight; - - struct Sixteen - { - uint32 bType1 : 1; - uint32 bType2 : 1; - uint32 Len : 10; - uint32 Data : 4; - } - m_Sixteen; - }; - - public: - // used to decode game logo bitmap data - #include "AlignPrefix1.h" - struct X_D3DResourceLoc - { - uint32 Common; - uint32 Data; - uint32 Lock; - uint32 Format; - uint32 Size; - } - #include "AlignPosfix1.h" - ; - - #include "AlignPrefix1.h" - // XPR structures - - // Purpose: - // The XPR file format allows multiple graphics resources to be pre-defined - // and bundled together into one file. These resources can be copied into - // memory and then immediately used in-place as D3D objects such as textures - // and vertex buffers. The structure below defines the XPR header and the - // unique identifier for this file type. - struct XprHeader - { - uint32 dwXprMagic; // 'XPR0' or 'XPR1' - uint32 dwXprTotalSize; - uint32 dwXprHeaderSize; - } - #include "AlignPosfix1.h" - *m_xprHeader; - - #include "AlignPrefix1.h" - // Layout of SaveImage.xbx saved game image file - // - // File is XPR0 format. Since the XPR will always contain only a single - // 256x256 DXT1 image, we know exactly what the header portion will look like - struct XprImageHeader - { - XprHeader xprHeader; // Standard XPR struct - X_D3DResourceLoc d3dTexture; // Standard D3D texture struct - uint32 dwEndOfHeader; // $FFFFFFFF - } - #include "AlignPosfix1.h" - *m_xprImageHeader; - - - #include "AlignPrefix1.h" - struct XprImage - { - XprImageHeader xprImageHeader; - char strPad[XPR_IMAGE_HDR_SIZE - sizeof(XprImageHeader)]; - unsigned char pBits; - } - #include "AlignPosfix1.h" - *m_xprImage; -}; - -// debug/retail XOR keys -const uint32 XOR_EP_DEBUG = 0x94859D4B; // Entry Point (Debug) -const uint32 XOR_EP_RETAIL = 0xA8FC57AB; // Entry Point (Retail) -const uint32 XOR_KT_DEBUG = 0xEFB1F152; // Kernel Thunk (Debug) -const uint32 XOR_KT_RETAIL = 0x5B6D40B6; // Kernel Thunk (Retail) - -// Sega Chihiro XOR keys -const uint32 XOR_EP_CHIHIRO = 0x40B5C16E; -const uint32 XOR_KT_CHIHIRO = 0x2290059D; - -// game region flags for Xbe certificate -const uint32 XBEIMAGE_GAME_REGION_NA = 0x00000001; -const uint32 XBEIMAGE_GAME_REGION_JAPAN = 0x00000002; -const uint32 XBEIMAGE_GAME_REGION_RESTOFWORLD = 0x00000004; -const uint32 XBEIMAGE_GAME_REGION_MANUFACTURING = 0x80000000; - -// media type flags for Xbe certificate -const uint32 XBEIMAGE_MEDIA_TYPE_HARD_DISK = 0x00000001; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_X2 = 0x00000002; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_CD = 0x00000004; -const uint32 XBEIMAGE_MEDIA_TYPE_CD = 0x00000008; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_5_RO = 0x00000010; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_9_RO = 0x00000020; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_5_RW = 0x00000040; -const uint32 XBEIMAGE_MEDIA_TYPE_DVD_9_RW = 0x00000080; -const uint32 XBEIMAGE_MEDIA_TYPE_DONGLE = 0x00000100; -const uint32 XBEIMAGE_MEDIA_TYPE_MEDIA_BOARD = 0x00000200; -const uint32 XBEIMAGE_MEDIA_TYPE_NONSECURE_HARD_DISK = 0x40000000; -const uint32 XBEIMAGE_MEDIA_TYPE_NONSECURE_MODE = 0x80000000; -const uint32 XBEIMAGE_MEDIA_TYPE_MEDIA_MASK = 0x00FFFFFF; - -// section type flags for Xbe -const uint32 XBEIMAGE_SECTION_WRITEABLE = 0x00000001; -const uint32 XBEIMAGE_SECTION_PRELOAD = 0x00000002; -const uint32 XBEIMAGE_SECTION_EXECUTABLE = 0x00000004; -const uint32 XBEIMAGE_SECTION_INSERTFILE = 0x00000008; -const uint32 XBEIMAGE_SECTION_HEAD_PAGE_READONLY = 0x00000010; -const uint32 XBEIMAGE_SECTION_TAIL_PAGE_READONLY = 0x00000020; -#endif diff --git a/src/Cxbx.h b/src/Cxbx.h index 56b9ad612..e71156937 100644 --- a/src/Cxbx.h +++ b/src/Cxbx.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,37 +25,10 @@ #ifndef CXBX_H #define CXBX_H -#define FUNC_EXPORTS __pragma(comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)) - -/*! \name primitive typedefs */ -/*! \{ */ -typedef signed int sint; -typedef unsigned int uint; -typedef char int8; -typedef char int08; -typedef short int16; -typedef long int32; -typedef unsigned char uint8; -typedef unsigned char uint08; -typedef unsigned short uint16; -typedef unsigned long uint32; -/*! \} */ - -typedef signed char s8; -typedef __int16 s16; -typedef __int32 s32; -typedef __int64 s64; -typedef unsigned char u8; -typedef unsigned __int16 u16; -typedef unsigned __int32 u32; -typedef unsigned __int64 u64; -typedef s8 i8; -typedef s16 i16; -typedef s32 i32; -typedef s64 i64; +#include /*! xbaddr is the type of a physical address */ -typedef u32 xbaddr; +typedef uint32_t xbaddr; /*! xbnullptr is the type of null pointer address*/ #define xbnullptr nullptr @@ -73,12 +37,6 @@ typedef u32 xbaddr; #define xbnull 0 #ifdef _DEBUG -/*! define this to track vertex buffers */ -#define _DEBUG_TRACK_VB -/*! define this to track vertex shaders */ -#define _DEBUG_TRACK_VS -/*! define this to track pixel shaders */ -#define _DEBUG_TRACK_PS /*! define this to track memory allocations */ //#define _DEBUG_ALLOC #endif @@ -86,8 +44,6 @@ typedef u32 xbaddr; #ifdef _DEBUG #define _DEBUG_TRACE 1 #endif -/*! define this to trace warnings */ -#define _DEBUG_WARNINGS /*! define this to trace vertex shader constants */ #define _DEBUG_TRACK_VS_CONST /*! define this to print current configuration at kernel startup */ @@ -129,27 +85,9 @@ extern bool g_bIsRetail; /*! indicates ability to save on exit (needed for settings reset) */ extern bool g_SaveOnExit; -/*! maximum number of threads cxbx can handle */ -#define MAXIMUM_XBOX_THREADS 256 - -/*! runtime DbgPrintf toggle boolean */ +/*! runtime logging toggle boolean */ extern volatile bool g_bPrintfOn; -#ifdef _MSC_VER -#pragma warning(disable : 4477) -#endif - -/*! DbgPrintf enabled if _DEBUG_TRACE is set */ -#ifdef _DEBUG_TRACE - #define DbgPrintf(fmt, ...) { \ - CXBX_CHECK_INTEGRITY(); \ - if(g_bPrintfOn) printf("[0x%.4X] "##fmt, GetCurrentThreadId(), ##__VA_ARGS__); \ - } -#else - inline void null_func(...) { } - #define DbgPrintf null_func -#endif - #if WIN32 #include "Win32\Threads.h" #define CxbxSetThreadName(Name) SetCurrentThreadName(Name) @@ -157,4 +95,6 @@ extern volatile bool g_bPrintfOn; #define CxbxSetThreadName(Name) #endif +#include + #endif diff --git a/src/Cxbx/DlgControllerConfig.cpp b/src/Cxbx/DlgControllerConfig.cpp deleted file mode 100644 index c697873b6..000000000 --- a/src/Cxbx/DlgControllerConfig.cpp +++ /dev/null @@ -1,377 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** - -#include "CxbxKrnl/EmuShared.h" - -#include "DlgControllerConfig.h" -#include "ResCxbx.h" - -#include -#include - -/*! windows dialog procedure */ -static INT_PTR CALLBACK DlgControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -/*! configure input for the specified controller object */ -static VOID ConfigureInput(HWND hWndDlg, HWND hWndButton, XBCtrlObject object); -/*! enable / disable button windows */ -static VOID EnableButtonWindows(HWND hWndDlg, HWND hExclude, BOOL bEnable); - -/*! controller configuration */ -static XBController g_XBController; -/*! changes flag */ -static BOOL g_bHasChanges = FALSE; - -VOID ShowControllerConfig(HWND hwnd) -{ - /*! reset changes flag */ - g_bHasChanges = FALSE; - - /*! retrieve controller configuration */ - g_EmuShared->GetXBController(&g_XBController); - - /*! show dialog box */ - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_CONTROLLER_CFG), hwnd, DlgControllerConfigProc); -} - -INT_PTR CALLBACK DlgControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - { - /*! set window icon */ - SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); - - /*! set default focus to X button */ - SetFocus(GetDlgItem(hWndDlg, IDC_SET_X)); - } - break; - - case WM_CLOSE: - { - /*! if changes have been made, check if the user wants to save them */ - if(g_bHasChanges) - { - int ret = MessageBox(hWndDlg, "Do you wish to apply your changes?", "Cxbx-Reloaded", MB_ICONQUESTION | MB_YESNOCANCEL); - - switch(ret) - { - case IDYES: - PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_ACCEPT, 0); - break; - case IDNO: - PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0); - break; - } - break; - } - - PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0); - } - break; - - case WM_COMMAND: - { - HWND hWndButton = GetDlgItem(hWndDlg, LOWORD(wParam)); - - switch(LOWORD(wParam)) - { - case IDC_INPUT_CONFIG_CANCEL: - EndDialog(hWndDlg, wParam); - break; - - case IDC_INPUT_CONFIG_ACCEPT: - g_EmuShared->SetXBController(&g_XBController); - EndDialog(hWndDlg, wParam); - break; - - case IDC_SET_LEFT_POSY: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTHUMBPOSY); - break; - - case IDC_SET_LEFT_NEGY: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTHUMBNEGY); - break; - - case IDC_SET_LEFT_POSX: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTHUMBPOSX); - break; - - case IDC_SET_LEFT_NEGX: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTHUMBNEGX); - break; - - case IDC_SET_RIGHT_POSY: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTHUMBPOSY); - break; - - case IDC_SET_RIGHT_NEGY: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTHUMBNEGY); - break; - - case IDC_SET_RIGHT_POSX: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTHUMBPOSX); - break; - - case IDC_SET_RIGHT_NEGX: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTHUMBNEGX); - break; - - case IDC_SET_X: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_X); - break; - - case IDC_SET_Y: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_Y); - break; - - case IDC_SET_A: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_A); - break; - - case IDC_SET_B: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_B); - break; - - case IDC_SET_WHITE: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_WHITE); - break; - - case IDC_SET_BLACK: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_BLACK); - break; - - case IDC_SET_LTRIGGER: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTRIGGER); - break; - - case IDC_SET_RTRIGGER: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTRIGGER); - break; - - case IDC_SET_DPAD_UP: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_DPADUP); - break; - - case IDC_SET_DPAD_DOWN: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_DPADDOWN); - break; - - case IDC_SET_DPAD_LEFT: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_DPADLEFT); - break; - - case IDC_SET_DPAD_RIGHT: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_DPADRIGHT); - break; - - case IDC_SET_BACK: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_BACK); - break; - - case IDC_SET_START: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_START); - break; - - case IDC_SET_LTHUMB: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_LTHUMB); - break; - - case IDC_SET_RTHUMB: - ConfigureInput(hWndDlg, hWndButton, XBCTRL_OBJECT_RTHUMB); - break; - - case IDC_CONFIGURE_ALL: - { - int v=0; - - struct _ConfigObj - { - int idcVal; - XBCtrlObject ctrl; - } - configObj[] = - { - { IDC_SET_X, XBCTRL_OBJECT_X }, - { IDC_SET_Y, XBCTRL_OBJECT_Y }, - { IDC_SET_A, XBCTRL_OBJECT_A }, - { IDC_SET_B, XBCTRL_OBJECT_B }, - { IDC_SET_WHITE, XBCTRL_OBJECT_WHITE }, - { IDC_SET_BLACK, XBCTRL_OBJECT_BLACK }, - { IDC_SET_LTRIGGER, XBCTRL_OBJECT_LTRIGGER }, - { IDC_SET_RTRIGGER, XBCTRL_OBJECT_RTRIGGER }, - { IDC_SET_DPAD_UP, XBCTRL_OBJECT_DPADUP }, - { IDC_SET_DPAD_DOWN, XBCTRL_OBJECT_DPADDOWN }, - { IDC_SET_DPAD_LEFT, XBCTRL_OBJECT_DPADLEFT }, - { IDC_SET_DPAD_RIGHT, XBCTRL_OBJECT_DPADRIGHT }, - { IDC_SET_BACK, XBCTRL_OBJECT_BACK }, - { IDC_SET_START, XBCTRL_OBJECT_START }, - { IDC_SET_LTHUMB, XBCTRL_OBJECT_LTHUMB }, - { IDC_SET_RTHUMB, XBCTRL_OBJECT_RTHUMB }, - { IDC_SET_LEFT_POSY, XBCTRL_OBJECT_LTHUMBPOSY }, - { IDC_SET_LEFT_NEGY, XBCTRL_OBJECT_LTHUMBNEGY }, - { IDC_SET_LEFT_NEGX, XBCTRL_OBJECT_LTHUMBNEGX }, - { IDC_SET_LEFT_POSX, XBCTRL_OBJECT_LTHUMBPOSX }, - { IDC_SET_RIGHT_POSY, XBCTRL_OBJECT_RTHUMBPOSY }, - { IDC_SET_RIGHT_NEGY, XBCTRL_OBJECT_RTHUMBNEGY }, - { IDC_SET_RIGHT_NEGX, XBCTRL_OBJECT_RTHUMBNEGX }, - { IDC_SET_RIGHT_POSX, XBCTRL_OBJECT_RTHUMBPOSX }, - }; - - for(v=0;v0;v--) - { - // update the button text every second - if(v%20 == 0) - { - char szBuffer[255]; - - sprintf(szBuffer, "%d", (v+19)/20); - - SetWindowText(hWndButton, szBuffer); - } - - if(g_XBController.HasError()) - { - goto cleanup; - } - - if(g_XBController.ConfigPoll(szNewText)) - { - break; - } - - Sleep(50); - } - - if(g_XBController.HasError()) - { - goto cleanup; - } - else - { - g_XBController.ConfigEnd(); - } - -cleanup: - - /*! enable all buttons */ - EnableButtonWindows(hWndDlg, hWndButton, TRUE); - - /*! update window with status */ - { - if(g_XBController.HasError()) - { - sprintf(szNewText, "%s", g_XBController.GetError().c_str()); - } - - SetWindowText(hWndButton, szOrgText); - - SetWindowText(GetDlgItem(hWndDlg, IDC_CONFIG_STATUS), szNewText); - - MSG Msg; - - while(PeekMessage(&Msg, hWndDlg, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE)); - while(PeekMessage(&Msg, hWndDlg, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)); - - } - - bConfigDone = true; -} - -VOID EnableButtonWindows(HWND hWndDlg, HWND hExclude, BOOL bEnable) -{ - int v=0; - - /*! list of applicable child windows */ - int itemList[] = - { - IDC_SET_X, IDC_SET_Y, IDC_SET_A, IDC_SET_B, - IDC_SET_WHITE, IDC_SET_BLACK, - IDC_SET_LTHUMB, IDC_SET_RTHUMB, - IDC_SET_DPAD_UP, IDC_SET_DPAD_DOWN, IDC_SET_DPAD_LEFT, IDC_SET_DPAD_RIGHT, - IDC_SET_BACK, IDC_SET_START, IDC_SET_LTRIGGER, IDC_SET_RTRIGGER, - IDC_SET_LEFT_POSY, IDC_SET_LEFT_NEGY, IDC_SET_LEFT_NEGX, IDC_SET_LEFT_POSX, - IDC_SET_RIGHT_POSY, IDC_SET_RIGHT_NEGY, IDC_SET_RIGHT_NEGX, IDC_SET_RIGHT_POSX, - IDC_INPUT_CONFIG_CANCEL, IDC_INPUT_CONFIG_ACCEPT, - IDC_CONFIGURE_ALL - }; - - /*! enable / disable all the listed windows */ - for(v=0;vCxbx->DlgControllerConfig.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** - -#include "CxbxKrnl/EmuShared.h" -#include "DlgXboxControllerPortMapping.h" -#include "../Common/Win32/XBPortMapping.h" -#include "Windowsx.h" -#include "ResCxbx.h" - -#include - -/*! windows dialog procedure */ -static INT_PTR CALLBACK DlgXboxControllerPortMappingProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -/*! changes flag */ -static BOOL g_bHasChanges = FALSE; -static WPARAM wXboxToHostTypePORT[4][7] = { - { IDC_HOST_NOTCONNECT_0_0 ,IDC_HOST_XINPUT_0_0,IDC_HOST_XINPUT_0_1,IDC_HOST_XINPUT_0_2,IDC_HOST_XINPUT_0_3,IDC_HOST_DINPUT_0_0,IDC_HOST_VIRTUAL_SBC_0_0 }, - { IDC_HOST_NOTCONNECT_1_0 ,IDC_HOST_XINPUT_1_0,IDC_HOST_XINPUT_1_1,IDC_HOST_XINPUT_1_2,IDC_HOST_XINPUT_1_3,IDC_HOST_DINPUT_1_0,IDC_HOST_VIRTUAL_SBC_1_0 }, - { IDC_HOST_NOTCONNECT_2_0 ,IDC_HOST_XINPUT_2_0,IDC_HOST_XINPUT_2_1,IDC_HOST_XINPUT_2_2,IDC_HOST_XINPUT_2_3,IDC_HOST_DINPUT_2_0,IDC_HOST_VIRTUAL_SBC_2_0 }, - { IDC_HOST_NOTCONNECT_3_0 ,IDC_HOST_XINPUT_3_0,IDC_HOST_XINPUT_3_1,IDC_HOST_XINPUT_3_2,IDC_HOST_XINPUT_3_3,IDC_HOST_DINPUT_3_0,IDC_HOST_VIRTUAL_SBC_3_0 } -}; - -void ShowXboxControllerPortMappingConfig(HWND hwnd) -{ - /*! reset changes flag */ - g_bHasChanges = FALSE; - - /*! show dialog box */ - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_CONTROLLER_HOST_MAPPING), hwnd, DlgXboxControllerPortMappingProc); -} - -INT_PTR CALLBACK DlgXboxControllerPortMappingProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - { - /*! set window icon */ - SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); - //Load saved configuration from registry. - XBPortMappingLoad("Software\\Cxbx-Reloaded\\XboxPortHostMapping");//"Software\\Cxbx-Reloaded\\XboxPortHostMapping" - //Init dialog selections per global array contenst. - XTL::DWORD port = 0; - int index = 0; - XTL::DWORD dwHostType = 1; - XTL::DWORD dwHostPort = 0; - for (port = 0; port < 4; port++) { - GetXboxPortToHostPort(port, dwHostType, dwHostPort); - switch (dwHostType) { - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT: - index = 0; - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT: - index = 1 + dwHostPort; - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT: - index = 5; - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC: - index = 6; - break; - - default: - index = 0; - break; - } - Button_SetCheck(GetDlgItem(hWndDlg, wXboxToHostTypePORT[port][index]), BST_CHECKED); - PostMessage(hWndDlg, WM_COMMAND, wXboxToHostTypePORT[port][index], 0); - } - - - /*! set default focus to X button */ - SetFocus(GetDlgItem(hWndDlg, IDC_HOST_APPLY)); - } - break; - - case WM_CLOSE: - { - /*! if changes have been made, check if the user wants to save them */ - if(g_bHasChanges) - { - int ret = MessageBox(hWndDlg, "Do you wish to apply your changes?", "Cxbx-Reloaded", MB_ICONQUESTION | MB_YESNOCANCEL); - - switch(ret) - { - case IDYES: - PostMessage(hWndDlg, WM_COMMAND, IDC_HOST_APPLY, 0); - break; - case IDNO: - PostMessage(hWndDlg, WM_COMMAND, IDC_HOST_CANCEL, 0); - break; - } - break; - } - - PostMessage(hWndDlg, WM_COMMAND, IDC_INPUT_CONFIG_CANCEL, 0); - } - break; - - case WM_COMMAND: - { - HWND hWndButton = GetDlgItem(hWndDlg, LOWORD(wParam)); - - switch(LOWORD(wParam)) - { - case IDC_HOST_CANCEL: - EndDialog(hWndDlg, wParam); - break; - case IDC_HOST_APPLY: - //save configuration to registry. - XBPortMappingSave("Software\\Cxbx-Reloaded\\XboxPortHostMapping"); - EndDialog(hWndDlg, wParam); - break; - //set host type and host port in global array xbox to host bridge for xbox port 0 - case IDC_HOST_NOTCONNECT_0_0: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_0_0: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_0_1: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 1); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_0_2: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 2); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_0_3: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 3); - g_bHasChanges = TRUE; - break; - case IDC_HOST_DINPUT_0_0: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_VIRTUAL_SBC_0_0: - SetXboxPortToHostPort(0, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC, 0); - g_bHasChanges = TRUE; - break; - //set host type and host port in global array xbox to host bridge for xbox port 1 - case IDC_HOST_NOTCONNECT_1_0: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_1_0: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_1_1: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 1); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_1_2: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 2); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_1_3: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 3); - g_bHasChanges = TRUE; - break; - case IDC_HOST_DINPUT_1_0: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_VIRTUAL_SBC_1_0: - SetXboxPortToHostPort(1, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC, 0); - g_bHasChanges = TRUE; - break; - //set host type and host port in global array xbox to host bridge for xbox port 2 - case IDC_HOST_NOTCONNECT_2_0: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_2_0: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_2_1: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 1); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_2_2: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 2); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_2_3: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 3); - g_bHasChanges = TRUE; - break; - case IDC_HOST_DINPUT_2_0: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_VIRTUAL_SBC_2_0: - SetXboxPortToHostPort(2, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC, 0); - g_bHasChanges = TRUE; - break; - //set host type and host port in global array xbox to host bridge for xbox port 3 - case IDC_HOST_NOTCONNECT_3_0: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_3_0: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_3_1: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 1); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_3_2: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 2); - g_bHasChanges = TRUE; - break; - case IDC_HOST_XINPUT_3_3: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT, 3); - g_bHasChanges = TRUE; - break; - case IDC_HOST_DINPUT_3_0: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT, 0); - g_bHasChanges = TRUE; - break; - case IDC_HOST_VIRTUAL_SBC_3_0: - SetXboxPortToHostPort(3, X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC, 0); - g_bHasChanges = TRUE; - break; - } - } - break; - } - return FALSE; -} diff --git a/src/CxbxDebugger/CMakeLists.txt b/src/CxbxDebugger/CMakeLists.txt new file mode 100644 index 000000000..d002bec2b --- /dev/null +++ b/src/CxbxDebugger/CMakeLists.txt @@ -0,0 +1,130 @@ +cmake_minimum_required (VERSION 3.8) +project(cxbxr-debugger LANGUAGES CSharp) + +# Output all binary files into one folder +if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${cxbxr-debugger_BINARY_DIR}/bin") +endif() + +include(CSharpUtilities) + +# Workaround fix since CMake is using static version "3". +add_compile_options( + /langversion:6 +) + +set(CXBXR_DEBUGGER_SRC_DIR "${CXBXR_ROOT_DIR}/src/CxbxDebugger") + +file (GLOB SOURCES + "${CXBXR_DEBUGGER_SRC_DIR}/App.config" + "${CXBXR_DEBUGGER_SRC_DIR}/Common.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/Debugger.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerCallstack.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerEventInterfaces.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerInstance.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerMessages.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerModule.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerProcess.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerSymbolServer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Debugger/DebuggerThread.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerExtras/CheatTable.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerExtras/CheatTableReader.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerSymbols/DebuggerSymbolProvider.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerSymbols/HLECache/HLECacheFile.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerSymbols/HLECache/HLECacheProvider.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerSymbols/HLECache/Utils/INIReader.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebuggerSymbols/Kernel/KernelSymbolProvider.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/DebugOutputManager.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/FileEventManager.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/FileWatchManager.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.resx" + "${CXBXR_DEBUGGER_SRC_DIR}/PatchManager.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Program.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/AssemblyInfo.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Resources.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Resources.resx" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Settings.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Settings.settings" + "${CXBXR_DEBUGGER_SRC_DIR}/Resources/BreakpointDisable_16x_24.bmp" + "${CXBXR_DEBUGGER_SRC_DIR}/Resources/BreakpointEnable_16x_24.bmp" + "${CXBXR_DEBUGGER_SRC_DIR}/Resources/Pause_16x_24.bmp" + "${CXBXR_DEBUGGER_SRC_DIR}/Resources/Run_16x_24.bmp" + "${CXBXR_DEBUGGER_SRC_DIR}/RicherTextBox.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/ThreadHelpers.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Constants.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/CONTINUE_STATUS.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/CREATE_PROCESS_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/CREATE_THREAD_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/DEBUG_EVENT.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/DEBUG_EVENT_CODE.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/EXCEPTION_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/EXCEPTION_RECORD.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/EXIT_PROCESS_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/EXIT_THREAD_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/LOAD_DLL_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/NativeMethods.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/OUTPUT_DEBUG_STRING_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/RIP_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Debugging/UNLOAD_DLL_DEBUG_INFO.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Handles/NativeMethods.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Interop/SecurityAttributes.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/IO_COUNTERS.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JobInformationLimitFlags.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JobMsgInfoMessages.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JOBOBJECTINFOCLASS.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JOBOBJECT_ASSOCIATE_COMPLETION_PORT.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JOBOBJECT_BASIC_LIMIT_INFORMATION.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/JOBOBJECT_EXTENDED_LIMIT_INFORMATION.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Jobs/NativeMethods.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/LastWin32ErrorException.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/NtStatus.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/NativeEnums.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/NativeMethods.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/NativeStructs.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/ProcessCreationFlags.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/PROCESS_INFORMATION.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/SafeProcessHandle.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/SafeThreadHandle.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Processes/Startupinfo.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/UnicodeString.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Win32/Windows/NativeMethods.cs" +) + +csharp_set_windows_forms_properties( + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Form1.resx" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/AssemblyInfo.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Resources.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Resources.resx" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Settings.Designer.cs" + "${CXBXR_DEBUGGER_SRC_DIR}/Properties/Settings.settings" +) + +set_source_files_properties("${CXBXR_DEBUGGER_SRC_DIR}/Form1.cs" + VS_CSHARP_SubType "Form" +) + +set_source_files_properties("${CXBXR_DEBUGGER_SRC_DIR}/RicherTextBox.cs" + VS_CSHARP_SubType "Component" +) + +source_group(TREE ${CXBXR_ROOT_DIR} FILES ${SOURCES}) + +add_executable(cxbxr-debugger WIN32 ${SOURCES} #Test WIN32 like cxbx does if doesn't need compile option set +) + +set_target_properties(cxbxr-debugger PROPERTIES + VS_DOTNET_REFERENCES + "Microsoft.CSharp;System;System.Core;System.Data;System.Data.DataSetExtensions;System.Deployment;System.Drawing;System.Windows;System.Windows.Forms;System.Xml;System.Xml.Linq;System.Net.Http" + VS_GLOBAL_ApplicationIcon "${CXBXR_ROOT_DIR}/resource/Cxbx-R.ico" + + VS_GLOBAL_ROOTNAMESPACE "CxbxDebugger" + +) + +set_property(TARGET cxbxr-debugger PROPERTY DOTNET_TARGET_FRAMEWORK_VERSION "v4.5") + +target_link_libraries(cxbxr-debugger cs_x86) diff --git a/src/CxbxDebugger/CxbxDebugger.csproj b/src/CxbxDebugger/CxbxDebugger.csproj deleted file mode 100644 index 2a44c7bfe..000000000 --- a/src/CxbxDebugger/CxbxDebugger.csproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Debug - AnyCPU - {4A68E962-3805-4376-99D3-0AC59E9BEE69} - WinExe - Properties - CxbxDebugger - CxbxDebugger - v4.5 - 512 - true - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - ..\..\build\win32\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - ..\..\build\win32\Release\ - TRACE - prompt - 4 - true - - - ..\..\resource\Cxbx-R.ico - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - - - - - Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - {9131b025-5019-4dee-84a3-86d2703a81c0} - cs_x86 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/CxbxDebugger/ThreadHelpers.cs b/src/CxbxDebugger/ThreadHelpers.cs index fc0ac34cd..922974bdd 100644 --- a/src/CxbxDebugger/ThreadHelpers.cs +++ b/src/CxbxDebugger/ThreadHelpers.cs @@ -256,7 +256,7 @@ namespace CxbxDebugger } /// - /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa363082(v=vs.85).aspx + /// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363082(v=vs.85).aspx /// public enum ExceptionCode : uint { diff --git a/src/CxbxDebugger/Win32/Processes/NativeEnums.cs b/src/CxbxDebugger/Win32/Processes/NativeEnums.cs index ab9e7721c..354873395 100644 --- a/src/CxbxDebugger/Win32/Processes/NativeEnums.cs +++ b/src/CxbxDebugger/Win32/Processes/NativeEnums.cs @@ -7,7 +7,7 @@ using System; namespace VsChromium.Core.Win32.Processes { // The target architecture of a given executable image. The various values correspond // to the magic numbers defined by the PE Executable Image File Format. - // http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx + // https://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx public enum MachineType : ushort { Unknown = 0x0, X64 = 0x8664, diff --git a/src/CxbxKrnl/EmuD3D8/PixelShader.h b/src/CxbxKrnl/EmuD3D8/PixelShader.h deleted file mode 100644 index 28a80a604..000000000 --- a/src/CxbxKrnl/EmuD3D8/PixelShader.h +++ /dev/null @@ -1,61 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->PixelShader.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef PIXELSHADER_H -#define PIXELSHADER_H - -#pragma once - -#include "Cxbx.h" - -// dump pixel shader definition to file -void DumpPixelShaderDefToFile( X_D3DPIXELSHADERDEF* pPSDef, const char* pszCode ); -// print relevant contents to the debug console -void PrintPixelShaderDefContents( X_D3DPIXELSHADERDEF* pDSDef ); -// Recompile Xbox PixelShader def -HRESULT EmuRecompilePshDef( X_D3DPIXELSHADERDEF* pPSDef, LPD3DXBUFFER* ppRecompiled ); - -// PatrickvL's Dxbx pixel shader translation -VOID DxbxUpdateActivePixelShader(); // NOPATCH - -// TODO: Remove this once the Render State code has been fully ported from Dxbx/Wip_LessVertexPatching -extern DWORD TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES + 1]; - -#ifdef _DEBUG_TRACK_PS -#define DbgPshPrintf if(g_bPrintfOn) printf -#else -inline void null_func_psh(...) { } -#define DbgPshPrintf XTL::null_func_psh -#endif - -#endif // PIXELSHADER_H diff --git a/src/CxbxKrnl/EmuD3D8/State.cpp b/src/CxbxKrnl/EmuD3D8/State.cpp deleted file mode 100644 index 4856e81d3..000000000 --- a/src/CxbxKrnl/EmuD3D8/State.cpp +++ /dev/null @@ -1,469 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D->State.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuXTL.h" - -// deferred state lookup tables -DWORD *XTL::EmuD3DDeferredRenderState = nullptr; -DWORD *XTL::EmuD3DDeferredTextureState = nullptr; - -extern uint32 g_BuildVersion; - -// ****************************************************************** -// * patch: UpdateDeferredStates -// ****************************************************************** -void XTL::EmuUpdateDeferredStates() -{ - using namespace XTL; - - // Certain D3DRS values need to be checked on each Draw[Indexed]Vertices - if(EmuD3DDeferredRenderState != 0) - { - if(XTL::EmuD3DDeferredRenderState[0] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_FOGENABLE, XTL::EmuD3DDeferredRenderState[0]); - - if(XTL::EmuD3DDeferredRenderState[1] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_FOGTABLEMODE, XTL::EmuD3DDeferredRenderState[1]); - - if(XTL::EmuD3DDeferredRenderState[2] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_FOGSTART, XTL::EmuD3DDeferredRenderState[2]); - - if(XTL::EmuD3DDeferredRenderState[3] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_FOGEND, XTL::EmuD3DDeferredRenderState[3]); - - if(XTL::EmuD3DDeferredRenderState[4] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_FOGDENSITY, XTL::EmuD3DDeferredRenderState[4]); - - if(XTL::EmuD3DDeferredRenderState[5] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_RANGEFOGENABLE, XTL::EmuD3DDeferredRenderState[5]); - - if(XTL::EmuD3DDeferredRenderState[6] != X_D3DRS_UNK) - { - ::DWORD dwConv = 0; - - dwConv |= (XTL::EmuD3DDeferredRenderState[6] & 0x00000010) ? D3DWRAP_U : 0; - dwConv |= (XTL::EmuD3DDeferredRenderState[6] & 0x00001000) ? D3DWRAP_V : 0; - dwConv |= (XTL::EmuD3DDeferredRenderState[6] & 0x00100000) ? D3DWRAP_W : 0; - - g_pD3DDevice->SetRenderState(D3DRS_WRAP0, dwConv); - } - - if(XTL::EmuD3DDeferredRenderState[7] != X_D3DRS_UNK) - { - ::DWORD dwConv = 0; - - dwConv |= (XTL::EmuD3DDeferredRenderState[7] & 0x00000010) ? D3DWRAP_U : 0; - dwConv |= (XTL::EmuD3DDeferredRenderState[7] & 0x00001000) ? D3DWRAP_V : 0; - dwConv |= (XTL::EmuD3DDeferredRenderState[7] & 0x00100000) ? D3DWRAP_W : 0; - - g_pD3DDevice->SetRenderState(D3DRS_WRAP1, dwConv); - } - - if(XTL::EmuD3DDeferredRenderState[10] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_LIGHTING, XTL::EmuD3DDeferredRenderState[10]); - - if(XTL::EmuD3DDeferredRenderState[11] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_SPECULARENABLE, XTL::EmuD3DDeferredRenderState[11]); - - if(XTL::EmuD3DDeferredRenderState[13] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_COLORVERTEX, XTL::EmuD3DDeferredRenderState[13]); - - if(XTL::EmuD3DDeferredRenderState[19] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, XTL::EmuD3DDeferredRenderState[19]); - - if(XTL::EmuD3DDeferredRenderState[20] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, XTL::EmuD3DDeferredRenderState[20]); - - if(XTL::EmuD3DDeferredRenderState[21] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, XTL::EmuD3DDeferredRenderState[21]); - - if(XTL::EmuD3DDeferredRenderState[23] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_AMBIENT, XTL::EmuD3DDeferredRenderState[23]); - - if(XTL::EmuD3DDeferredRenderState[24] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSIZE, XTL::EmuD3DDeferredRenderState[24]); - - if(XTL::EmuD3DDeferredRenderState[25] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSIZE_MIN, XTL::EmuD3DDeferredRenderState[25]); - - if(XTL::EmuD3DDeferredRenderState[26] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, XTL::EmuD3DDeferredRenderState[26]); - - if(XTL::EmuD3DDeferredRenderState[27] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, XTL::EmuD3DDeferredRenderState[27]); - - if(XTL::EmuD3DDeferredRenderState[28] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_A, XTL::EmuD3DDeferredRenderState[28]); - - if(XTL::EmuD3DDeferredRenderState[29] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_B, XTL::EmuD3DDeferredRenderState[29]); - - if(XTL::EmuD3DDeferredRenderState[30] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSCALE_C, XTL::EmuD3DDeferredRenderState[30]); - - if(XTL::EmuD3DDeferredRenderState[31] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_POINTSIZE_MAX, XTL::EmuD3DDeferredRenderState[31]); - -#ifndef CXBX_USE_D3D9 // D3DRS_PATCHSEGMENTS exists in Direct3D 8, but not in 9 !? - if(XTL::EmuD3DDeferredRenderState[33] != X_D3DRS_UNK) - g_pD3DDevice->SetRenderState(D3DRS_PATCHSEGMENTS, XTL::EmuD3DDeferredRenderState[33]); -#endif - - /** To check for unhandled RenderStates - for(int v=0;v<117-82;v++) - { - if(XTL::EmuD3DDeferredRenderState[v] != X_D3DRS_UNK) - { - if(v != 0 && v != 1 && v != 2 && v != 3 && v != 4 && v != 5 && v != 6 && v != 7 - && v != 10 && v != 11 && v != 13 && v != 19 && v != 20 && v != 21 && v != 23 && v != 24 - && v != 25 && v != 26 && v != 27 && v != 28 && v != 29 && v != 30 && v != 31 && v != 33) - EmuWarning("Unhandled RenderState Change @ %d (%d)", v, v + 82); - } - } - //**/ - } - - // For below XDK 3948, the actual D3DTSS flags have different values. - int Adjust1 = (g_BuildVersion <= 3948) ? 12 : 0; - int Adjust2 = (g_BuildVersion <= 3948) ? 10 : 0; - - // Certain D3DTS values need to be checked on each Draw[Indexed]Vertices - if(EmuD3DDeferredTextureState != 0) - { - for(int v=0;v<4;v++) - { - ::DWORD *pCur = &EmuD3DDeferredTextureState[v*32]; - - if(pCur[0+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[0+Adjust2] == 5) - EmuWarning("ClampToEdge is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_ADDRESSU, pCur[0 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ADDRESSU, pCur[0+Adjust2]); -#endif - } - - if(pCur[1+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[1+Adjust2] == 5) - EmuWarning("ClampToEdge is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_ADDRESSV, pCur[1 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ADDRESSV, pCur[1+Adjust2]); -#endif - } - - if(pCur[2+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[2+Adjust2] == 5) - EmuWarning("ClampToEdge is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_ADDRESSW, pCur[2 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ADDRESSW, pCur[2+Adjust2]); -#endif - } - - if(pCur[3+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[3+Adjust2] == 4) - EmuWarning("QuinCunx is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MAGFILTER, pCur[3 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MAGFILTER, pCur[3+Adjust2]); -#endif - } - - if(pCur[4+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[4+Adjust2] == 4) - EmuWarning("QuinCunx is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MINFILTER, pCur[4 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MINFILTER, pCur[4+Adjust2]); -#endif - } - - if(pCur[5+Adjust2] != X_D3DTSS_UNK) - { - if(pCur[5+Adjust2] == 4) - EmuWarning("QuinCunx is unsupported (temporarily)"); - else -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MIPFILTER, pCur[5 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MIPFILTER, pCur[5+Adjust2]); -#endif - } - - if(pCur[6+Adjust2] != X_D3DTSS_UNK) -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MIPMAPLODBIAS, pCur[6 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MIPMAPLODBIAS, pCur[6+Adjust2]); -#endif - - if(pCur[7+Adjust2] != X_D3DTSS_UNK) -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MAXMIPLEVEL, pCur[7 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MAXMIPLEVEL, pCur[7+Adjust2]); -#endif - - if(pCur[8+Adjust2] != X_D3DTSS_UNK) -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_MAXANISOTROPY, pCur[8 + Adjust2]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_MAXANISOTROPY, pCur[8+Adjust2]); -#endif - - if(pCur[12-Adjust1] != X_D3DTSS_UNK) - { - // TODO: This would be better split into it's own function, or a lookup array - switch (pCur[12 - Adjust1]) - { - case X_D3DTOP_DISABLE: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_DISABLE); - break; - case X_D3DTOP_SELECTARG1: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - break; - case X_D3DTOP_SELECTARG2: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_SELECTARG2); - break; - case X_D3DTOP_MODULATE: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATE); - break; - case X_D3DTOP_MODULATE2X: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATE2X); - break; - case X_D3DTOP_MODULATE4X: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATE4X); - break; - case X_D3DTOP_ADD: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_ADD); - break; - case X_D3DTOP_ADDSIGNED: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_ADDSIGNED); - break; - case X_D3DTOP_ADDSIGNED2X: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_ADDSIGNED2X); - break; - case X_D3DTOP_SUBTRACT: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_SUBTRACT); - break; - case X_D3DTOP_ADDSMOOTH: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_ADDSMOOTH); - break; - case X_D3DTOP_BLENDDIFFUSEALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA); - break; - case X_D3DTOP_BLENDCURRENTALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BLENDCURRENTALPHA); - break; - case X_D3DTOP_BLENDTEXTUREALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BLENDTEXTUREALPHA); - break; - case X_D3DTOP_BLENDFACTORALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA); - break; - case X_D3DTOP_BLENDTEXTUREALPHAPM: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BLENDTEXTUREALPHAPM); - break; - case X_D3DTOP_PREMODULATE: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_PREMODULATE); - break; - case X_D3DTOP_MODULATEALPHA_ADDCOLOR: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATEALPHA_ADDCOLOR); - break; - case X_D3DTOP_MODULATECOLOR_ADDALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATECOLOR_ADDALPHA); - break; - case X_D3DTOP_MODULATEINVALPHA_ADDCOLOR: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATEINVALPHA_ADDCOLOR); - break; - case X_D3DTOP_MODULATEINVCOLOR_ADDALPHA: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MODULATEINVCOLOR_ADDALPHA); - break; - case X_D3DTOP_DOTPRODUCT3: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_DOTPRODUCT3); - break; - case X_D3DTOP_MULTIPLYADD: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MULTIPLYADD); - break; - case X_D3DTOP_LERP: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_LERP); - break; - case X_D3DTOP_BUMPENVMAP: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_MULTIPLYADD); - break; - case X_D3DTOP_BUMPENVMAPLUMINANCE: - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLOROP, D3DTOP_BUMPENVMAPLUMINANCE); - break; - default: - EmuWarning("(Temporarily) Unsupported D3DTSS_COLOROP Value (%d)", pCur[12 - Adjust1]); - break; - } - } - - if(pCur[13-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLORARG0, pCur[13-Adjust1]); - - if(pCur[14-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLORARG1, pCur[14-Adjust1]); - - if(pCur[15-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_COLORARG2, pCur[15-Adjust1]); - - // TODO: Use a lookup table, this is not always a 1:1 map (same as D3DTSS_COLOROP) - if(pCur[16-Adjust1] != X_D3DTSS_UNK) - { - if(pCur[16-Adjust1] > 12 && pCur[16-Adjust1] != 14 && pCur[16-Adjust1] != 13) - EmuWarning("(Temporarily) Unsupported D3DTSS_ALPHAOP Value (%d)", pCur[16-Adjust1]); - else - if( pCur[16-Adjust1] == 14 ) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAOP, D3DTOP_BLENDTEXTUREALPHA); - if( pCur[16-Adjust1] == 15 ) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAOP, D3DTOP_BLENDFACTORALPHA); - if( pCur[16-Adjust1] == 13 ) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAOP, D3DTOP_BLENDCURRENTALPHA); - else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAOP, pCur[16-Adjust1]); - } - - if(pCur[17-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAARG0, pCur[17-Adjust1]); - - if(pCur[18-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAARG1, pCur[18-Adjust1]); - - if(pCur[19-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_ALPHAARG2, pCur[19-Adjust1]); - - if(pCur[20-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_RESULTARG, pCur[20-Adjust1]); - - if(pCur[21-Adjust1] != X_D3DTSS_UNK) - g_pD3DDevice->SetTextureStageState(v, D3DTSS_TEXTURETRANSFORMFLAGS, pCur[21-Adjust1]); - - /*if(pCur[29] != X_D3DTSS_UNK) // This is NOT a deferred texture state! -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetSamplerState(v, D3DSAMP_BORDERCOLOR, pCur[29]); -#else - g_pD3DDevice->SetTextureStageState(v, D3DTSS_BORDERCOLOR, pCur[29]); -#endif - */ - - /** To check for unhandled texture stage state changes - for(int r=0;r<32;r++) - { - static const int unchecked[] = - { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 29, 30, 31 - }; - - if(pCur[r] != X_D3DTSS_UNK) - { - bool pass = true; - - for(int q=0;q%d", v, r); - } - } - //**/ - } - - // if point sprites are enabled, copy stage 3 over to 0 - if(EmuD3DDeferredRenderState[26] == TRUE) - { - // pCur = Texture Stage 3 States - ::DWORD *pCur = &EmuD3DDeferredTextureState[2*32]; - - IDirect3DBaseTexture *pTexture; - - // set the point sprites texture - g_pD3DDevice->GetTexture(3, &pTexture); - g_pD3DDevice->SetTexture(0, pTexture); - - // disable all other stages - g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - // in that case we have to copy over the stage by hand - for(int v=0;v<30;v++) - { - if(pCur[v] != X_D3DTSS_UNK) - { - ::DWORD dwValue; - -#ifdef CXBX_USE_D3D9 - // For Direct3D9, everything below X_D3DSAMP_MAXANISOTROPY needs to call GetSamplerState / SetSamplerState : - if (v <= X_D3DTSS_MAXANISOTROPY) { - g_pD3DDevice->GetSamplerState(3, (D3DSAMPLERSTATETYPE)v, &dwValue); - g_pD3DDevice->SetSamplerState(0, (D3DSAMPLERSTATETYPE)v, dwValue); - } - else -#endif - { - g_pD3DDevice->GetTextureStageState(3, (D3DTEXTURESTAGESTATETYPE)v, &dwValue); - g_pD3DDevice->SetTextureStageState(0, (D3DTEXTURESTAGESTATETYPE)v, dwValue); - } - } - } - } - } -} diff --git a/src/CxbxKrnl/EmuD3D8/State.h b/src/CxbxKrnl/EmuD3D8/State.h deleted file mode 100644 index 159f6e294..000000000 --- a/src/CxbxKrnl/EmuD3D8/State.h +++ /dev/null @@ -1,58 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->State.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2004 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef STATE_H -#define STATE_H - -#define X_D3DRS_UNSUPPORTED (X_D3DRS_LAST + 1) - -// XDK version independent renderstate table, containing pointers to the original locations. -extern DWORD *EmuMappedD3DRenderState[X_D3DRS_UNSUPPORTED]; // 1 extra for the unsupported value - -struct X_Stream { - DWORD Stride; - DWORD Offset; - XTL::X_D3DVertexBuffer *pVertexBuffer; -}; - -// EmuD3DDeferredRenderState -extern DWORD *EmuD3DDeferredRenderState; - -// EmuD3DDeferredTextureState -extern DWORD *EmuD3DDeferredTextureState; - -extern void EmuUpdateDeferredStates(); - -extern void CxbxUpdateNativeD3DResources(); - -#endif \ No newline at end of file diff --git a/src/CxbxKrnl/EmuD3D8/VertexShader.cpp b/src/CxbxKrnl/EmuD3D8/VertexShader.cpp deleted file mode 100644 index 5cf956acf..000000000 --- a/src/CxbxKrnl/EmuD3D8/VertexShader.cpp +++ /dev/null @@ -1,2585 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->VertexShader.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2004 Aaron Robinson -// * Kingofc -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#include "CxbxKrnl/CxbxKrnl.h" -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuFS.h" -#include "CxbxKrnl/EmuXTL.h" -#include "CxbxKrnl/EmuD3D8Types.h" // For X_D3DVSDE_* - -#include - -#ifdef CXBX_USE_VS30 -//#define CXBX_USE_VS30 // Separate the port to Vertex Shader model 3.0 from the port to Direct3D9 -#endif - -// **************************************************************************** -// * Vertex shader function recompiler -// **************************************************************************** - -// Local macros -#define VERSION_VS 0xF0 // vs.1.1, not an official value -#define VERSION_XVS 0x20 // Xbox vertex shader -#define VERSION_XVSS 0x73 // Xbox vertex state shader -#define VERSION_XVSW 0x77 // Xbox vertex read/write shader -#define VSH_XBOX_MAX_INSTRUCTION_COUNT 136 // The maximum Xbox shader instruction count -#define VSH_MAX_INTERMEDIATE_COUNT 1024 // The maximum number of intermediate format slots - -#define X_D3DVSD_MASK_TESSUV 0x10000000 -#define X_D3DVSD_MASK_SKIP 0x10000000 // Skips (normally) dwords -#define X_D3DVSD_MASK_SKIPBYTES 0x08000000 // Skips bytes (no, really?!) -#define X_D3DVSD_STREAMTESSMASK (1 << 28) - -typedef enum _VSH_SWIZZLE -{ - SWIZZLE_X = 0, - SWIZZLE_Y, - SWIZZLE_Z, - SWIZZLE_W -} -VSH_SWIZZLE; - -typedef struct DxbxSwizzles { VSH_SWIZZLE s[4]; } DxbxSwizzles; - -typedef DWORD DxbxMask, -*PDxbxMask; - -#define MASK_X 0x001 -#define MASK_Y 0x002 -#define MASK_Z 0x004 -#define MASK_W 0x008 -#define MASK_XYZ MASK_X | MASK_Y | MASK_Z -#define MASK_XYZW MASK_X | MASK_Y | MASK_Z | MASK_W - -// Local types -typedef enum _VSH_FIELD_NAME -{ - FLD_ILU = 0, - FLD_MAC, - FLD_CONST, - FLD_V, - // Input A - FLD_A_NEG, - FLD_A_SWZ_X, - FLD_A_SWZ_Y, - FLD_A_SWZ_Z, - FLD_A_SWZ_W, - FLD_A_R, - FLD_A_MUX, - // Input B - FLD_B_NEG, - FLD_B_SWZ_X, - FLD_B_SWZ_Y, - FLD_B_SWZ_Z, - FLD_B_SWZ_W, - FLD_B_R, - FLD_B_MUX, - // Input C - FLD_C_NEG, - FLD_C_SWZ_X, - FLD_C_SWZ_Y, - FLD_C_SWZ_Z, - FLD_C_SWZ_W, - FLD_C_R_HIGH, - FLD_C_R_LOW, - FLD_C_MUX, - // Output - FLD_OUT_MAC_MASK_X, - FLD_OUT_MAC_MASK_Y, - FLD_OUT_MAC_MASK_Z, - FLD_OUT_MAC_MASK_W, - FLD_OUT_R, - FLD_OUT_ILU_MASK_X, - FLD_OUT_ILU_MASK_Y, - FLD_OUT_ILU_MASK_Z, - FLD_OUT_ILU_MASK_W, - FLD_OUT_O_MASK_X, - FLD_OUT_O_MASK_Y, - FLD_OUT_O_MASK_Z, - FLD_OUT_O_MASK_W, - FLD_OUT_ORB, - FLD_OUT_ADDRESS, - FLD_OUT_MUX, - // Relative addressing - FLD_A0X, - // Final instruction - FLD_FINAL -} -VSH_FIELD_NAME; - -typedef enum _VSH_OREG_NAME -{ - OREG_OPOS, // 0 - OREG_UNUSED1, // 1 - OREG_UNUSED2, // 2 - OREG_OD0, // 3 - OREG_OD1, // 4 - OREG_OFOG, // 5 - OREG_OPTS, // 6 - OREG_OB0, // 7 - OREG_OB1, // 8 - OREG_OT0, // 9 - OREG_OT1, // 10 - OREG_OT2, // 11 - OREG_OT3, // 12 - OREG_UNUSED3, // 13 - OREG_UNUSED4, // 14 - OREG_A0X // 15 - all values of the 4 bits are used -} -VSH_OREG_NAME; - -typedef enum _VSH_OUTPUT_TYPE -{ - OUTPUT_C = 0, - OUTPUT_O -} -VSH_OUTPUT_TYPE; - -typedef enum _VSH_ARGUMENT_TYPE -{ - PARAM_UNKNOWN = 0, - PARAM_R, // Temporary registers - PARAM_V, // Vertex registers - PARAM_C, // Constant registers, set by SetVertexShaderConstant - PARAM_O -} -VSH_ARGUMENT_TYPE; - -typedef VSH_ARGUMENT_TYPE VSH_PARAMETER_TYPE; // Alias, to indicate difference between a parameter and a generic argument - -typedef enum _VSH_OUTPUT_MUX -{ - OMUX_MAC = 0, - OMUX_ILU -} -VSH_OUTPUT_MUX; - -typedef enum _VSH_IMD_OUTPUT_TYPE -{ - IMD_OUTPUT_C, - IMD_OUTPUT_R, - IMD_OUTPUT_O, - IMD_OUTPUT_A0X -} -VSH_IMD_OUTPUT_TYPE; - -// Dxbx note : ILU stands for 'Inverse Logic Unit' opcodes -typedef enum _VSH_ILU -{ - ILU_NOP = 0, - ILU_MOV, - ILU_RCP, - ILU_RCC, - ILU_RSQ, - ILU_EXP, - ILU_LOG, - ILU_LIT // = 7 - all values of the 3 bits are used -} -VSH_ILU; - -// Dxbx note : MAC stands for 'Multiply And Accumulate' opcodes -typedef enum _VSH_MAC -{ - MAC_NOP = 0, - MAC_MOV, - MAC_MUL, - MAC_ADD, - MAC_MAD, - MAC_DP3, - MAC_DPH, - MAC_DP4, - MAC_DST, - MAC_MIN, - MAC_MAX, - MAC_SLT, - MAC_SGE, - MAC_ARL - // ??? 14 - // ??? 15 - 2 values of the 4 bits are undefined -} -VSH_MAC; - -typedef struct _VSH_OPCODE_PARAMS -{ - // Dxbx Note : Since we split up g_OpCodeParams into g_OpCodeParams_ILU and g_OpCodeParams_MAC - // the following two members aren't needed anymore : - // VSH_ILU ILU; - // VSH_MAC MAC; - boolean A; - boolean B; - boolean C; -} -VSH_OPCODE_PARAMS; - -typedef struct _VSH_PARAMETER -{ - VSH_PARAMETER_TYPE ParameterType; // Parameter type, R, V or C - boolean Neg; // TRUE if negated, FALSE if not - VSH_SWIZZLE Swizzle[4]; // The four swizzles - int16 Address; // Register address -} -VSH_PARAMETER; - -typedef struct _VSH_OUTPUT -{ - // Output register - VSH_OUTPUT_MUX OutputMux; // MAC or ILU used as output - VSH_OUTPUT_TYPE OutputType; // C or O - boolean OutputMask[4]; - int16 OutputAddress; - // MAC output R register - boolean MACRMask[4]; - boolean MACRAddress; - // ILU output R register - boolean ILURMask[4]; - boolean ILURAddress; -} -VSH_OUTPUT; - -// The raw, parsed shader instruction (can be many combined [paired] instructions) -typedef struct _VSH_SHADER_INSTRUCTION -{ - VSH_ILU ILU; - VSH_MAC MAC; - VSH_OUTPUT Output; - VSH_PARAMETER A; - VSH_PARAMETER B; - VSH_PARAMETER C; - boolean a0x; -} -VSH_SHADER_INSTRUCTION; - -typedef enum _VSH_IMD_INSTRUCTION_TYPE -{ - IMD_MAC, - IMD_ILU -} -VSH_IMD_INSTRUCTION_TYPE; - -typedef struct _VSH_IMD_OUTPUT -{ - VSH_IMD_OUTPUT_TYPE Type; - boolean Mask[4]; - int16 Address; -} -VSH_IMD_OUTPUT; - -typedef struct _VSH_IMD_PARAMETER -{ - boolean Active; - VSH_PARAMETER Parameter; - // There is only a single address register in Microsoft DirectX 8.0. - // The address register, designated as a0.x, may be used as signed - // integer offset in relative addressing into the constant register file. - // c[a0.x + n] - boolean IndexesWithA0_X; -} -VSH_IMD_PARAMETER; - -typedef struct _VSH_INTERMEDIATE_FORMAT -{ - - boolean IsCombined; - VSH_IMD_INSTRUCTION_TYPE InstructionType; - VSH_MAC MAC; - VSH_ILU ILU; - VSH_IMD_OUTPUT Output; - VSH_IMD_PARAMETER Parameters[3]; -} -VSH_INTERMEDIATE_FORMAT; - -// Used for xvu spec definition -typedef struct _VSH_FIELDMAPPING -{ - VSH_FIELD_NAME FieldName; - uint08 SubToken; - uint08 StartBit; - uint08 BitLength; -} -VSH_FIELDMAPPING; - -typedef struct _VSH_XBOX_SHADER -{ - XTL::VSH_SHADER_HEADER ShaderHeader; - uint16 IntermediateCount; - VSH_INTERMEDIATE_FORMAT Intermediate[VSH_MAX_INTERMEDIATE_COUNT]; -} -VSH_XBOX_SHADER; - -// Local constants -static const VSH_FIELDMAPPING g_FieldMapping[] = -{ - // Field Name DWORD BitPos BitSize - { FLD_ILU, 1, 25, 3 }, - { FLD_MAC, 1, 21, 4 }, - { FLD_CONST, 1, 13, 8 }, - { FLD_V, 1, 9, 4 }, - // Input A - { FLD_A_NEG, 1, 8, 1 }, - { FLD_A_SWZ_X, 1, 6, 2 }, - { FLD_A_SWZ_Y, 1, 4, 2 }, - { FLD_A_SWZ_Z, 1, 2, 2 }, - { FLD_A_SWZ_W, 1, 0, 2 }, - { FLD_A_R, 2, 28, 4 }, - { FLD_A_MUX, 2, 26, 2 }, - // Input B - { FLD_B_NEG, 2, 25, 1 }, - { FLD_B_SWZ_X, 2, 23, 2 }, - { FLD_B_SWZ_Y, 2, 21, 2 }, - { FLD_B_SWZ_Z, 2, 19, 2 }, - { FLD_B_SWZ_W, 2, 17, 2 }, - { FLD_B_R, 2, 13, 4 }, - { FLD_B_MUX, 2, 11, 2 }, - // Input C - { FLD_C_NEG, 2, 10, 1 }, - { FLD_C_SWZ_X, 2, 8, 2 }, - { FLD_C_SWZ_Y, 2, 6, 2 }, - { FLD_C_SWZ_Z, 2, 4, 2 }, - { FLD_C_SWZ_W, 2, 2, 2 }, - { FLD_C_R_HIGH, 2, 0, 2 }, - { FLD_C_R_LOW, 3, 30, 2 }, - { FLD_C_MUX, 3, 28, 2 }, - // Output - { FLD_OUT_MAC_MASK_X, 3, 27, 1 }, - { FLD_OUT_MAC_MASK_Y, 3, 26, 1 }, - { FLD_OUT_MAC_MASK_Z, 3, 25, 1 }, - { FLD_OUT_MAC_MASK_W, 3, 24, 1 }, - { FLD_OUT_R, 3, 20, 4 }, - { FLD_OUT_ILU_MASK_X, 3, 19, 1 }, - { FLD_OUT_ILU_MASK_Y, 3, 18, 1 }, - { FLD_OUT_ILU_MASK_Z, 3, 17, 1 }, - { FLD_OUT_ILU_MASK_W, 3, 16, 1 }, - { FLD_OUT_O_MASK_X, 3, 15, 1 }, - { FLD_OUT_O_MASK_Y, 3, 14, 1 }, - { FLD_OUT_O_MASK_Z, 3, 13, 1 }, - { FLD_OUT_O_MASK_W, 3, 12, 1 }, - { FLD_OUT_ORB, 3, 11, 1 }, - { FLD_OUT_ADDRESS, 3, 3, 8 }, - { FLD_OUT_MUX, 3, 2, 1 }, - // Relative addressing - { FLD_A0X, 3, 1, 1 }, - // Final instruction - { FLD_FINAL, 3, 0, 1 } -}; - -static const VSH_OPCODE_PARAMS g_OpCodeParams_ILU[] = -{ - // ILU OP MAC OP ParamA ParamB ParamC - { /*ILU_NOP, MAC_NOP, */ FALSE, FALSE, FALSE }, // Dxbx note : Unused - { /*ILU_MOV, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_RCP, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_RCC, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_RSQ, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_EXP, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_LOG, MAC_NOP, */ FALSE, FALSE, TRUE }, - { /*ILU_LIT, MAC_NOP, */ FALSE, FALSE, TRUE }, -}; - -static const VSH_OPCODE_PARAMS g_OpCodeParams_MAC[] = -{ - // ILU OP MAC OP ParamA ParamB ParamC - { /*ILU_NOP, MAC_NOP, */ FALSE, FALSE, FALSE }, // Dxbx note : Unused - { /*ILU_NOP, MAC_MOV, */ TRUE, FALSE, FALSE }, - { /*ILU_NOP, MAC_MUL, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_ADD, */ TRUE, FALSE, TRUE }, - { /*ILU_NOP, MAC_MAD, */ TRUE, TRUE, TRUE }, - { /*ILU_NOP, MAC_DP3, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_DPH, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_DP4, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_DST, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_MIN, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_MAX, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_SLT, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_SGE, */ TRUE, TRUE, FALSE }, - { /*ILU_NOP, MAC_ARL, */ TRUE, FALSE, FALSE } -}; - -static const char* MAC_OpCode[] = -{ - "nop", - "mov", - "mul", - "add", - "mad", - "dp3", - "dph", - "dp4", - "dst", - "min", - "max", - "slt", - "sge", - "mov", // really "arl" Dxbx note : Alias for 'mov a0.x' - "???", - "???" -}; - -static const char* ILU_OpCode[] = -{ - "nop", - "mov", - "rcp", - "rcc", - "rsq", - "exp", - "log", - "lit" -}; - -static const char* OReg_Name[] = -{ - "oPos", - "???", - "???", - "oD0", - "oD1", - "oFog", - "oPts", - "oB0", - "oB1", - "oT0", - "oT1", - "oT2", - "oT3", - "???", - "???", - "a0.x" -}; - -/* TODO : map non-FVF Xbox vertex shader handle to CxbxVertexShader (a struct containing a host Xbox vertex shader handle and the original members) -std::unordered_map g_CxbxVertexShaders; - -void CxbxUpdateVertexShader(DWORD XboxVertexShaderHandle) -{ - CxbxVertexShader &VertexShader = g_CxbxVertexShaders[XboxVertexShaderHandle]; -}*/ - -// Dxbx note : This tooling function is never used, but clearly illustrates the relation -// between vertex shader's being passed around, and the actual handle value used on PC. -DWORD VshHandleGetRealHandle(DWORD aHandle) -{ - using namespace XTL; - - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(aHandle); - if (pVertexShader) - { - // assert(pVertexShader); - - return pVertexShader->Handle; - } - else - return aHandle; -} - -static inline int IsInUse(const boolean *pMask) -{ - return (pMask[0] || pMask[1] || pMask[2] || pMask[3]); -} - -static inline boolean HasMACR(VSH_SHADER_INSTRUCTION *pInstruction) -{ - return IsInUse(pInstruction->Output.MACRMask) && pInstruction->MAC != MAC_NOP; -} - -static inline boolean HasMACO(VSH_SHADER_INSTRUCTION *pInstruction) -{ - return IsInUse(pInstruction->Output.OutputMask) && - pInstruction->Output.OutputMux == OMUX_MAC && - pInstruction->MAC != MAC_NOP; -} - -static inline boolean HasMACARL(VSH_SHADER_INSTRUCTION *pInstruction) -{ - return /*!IsInUse(pInstruction->Output.OutputMask) && - pInstruction->Output.OutputMux == OMUX_MAC &&*/ - pInstruction->MAC == MAC_ARL; -} - -static inline boolean HasILUR(VSH_SHADER_INSTRUCTION *pInstruction) -{ - return IsInUse(pInstruction->Output.ILURMask) && pInstruction->ILU != ILU_NOP; -} - -static inline boolean HasILUO(VSH_SHADER_INSTRUCTION *pInstruction) -{ - return IsInUse(pInstruction->Output.OutputMask) && - pInstruction->Output.OutputMux == OMUX_ILU && - pInstruction->ILU != ILU_NOP; -} - -// Retrieves a number of bits in the instruction token -static inline int VshGetFromToken(uint32 *pShaderToken, - uint08 SubToken, - uint08 StartBit, - uint08 BitLength) -{ - return (pShaderToken[SubToken] >> StartBit) & ~(0xFFFFFFFF << BitLength); -} - -// Converts the C register address to disassembly format -static inline int16 ConvertCRegister(const int16 CReg) -{ - return ((((CReg >> 5) & 7) - 3) * 32) + (CReg & 31); -} - -uint08 VshGetField(uint32 *pShaderToken, - VSH_FIELD_NAME FieldName) -{ - return (uint08)(VshGetFromToken(pShaderToken, - g_FieldMapping[FieldName].SubToken, - g_FieldMapping[FieldName].StartBit, - g_FieldMapping[FieldName].BitLength)); -} - -static VSH_OPCODE_PARAMS* VshGetOpCodeParams(VSH_ILU ILU, - VSH_MAC MAC) -{ - if (ILU >= ILU_MOV && ILU <= ILU_LIT) - return (VSH_OPCODE_PARAMS*)&g_OpCodeParams_ILU[ILU]; - else - if (MAC >= MAC_MOV && MAC <= MAC_ARL) - return (VSH_OPCODE_PARAMS*)&g_OpCodeParams_MAC[MAC]; - else - return NULL; -} - -static void VshParseInstruction(uint32 *pShaderToken, - VSH_SHADER_INSTRUCTION *pInstruction) -{ - // First get the instruction(s). - pInstruction->ILU = (VSH_ILU)VshGetField(pShaderToken, FLD_ILU); - pInstruction->MAC = (VSH_MAC)VshGetField(pShaderToken, FLD_MAC); - - // Get parameter A - pInstruction->A.ParameterType = (VSH_PARAMETER_TYPE)VshGetField(pShaderToken, FLD_A_MUX); - switch(pInstruction->A.ParameterType) - { - case PARAM_R: - pInstruction->A.Address = VshGetField(pShaderToken, FLD_A_R); - break; - case PARAM_V: - pInstruction->A.Address = VshGetField(pShaderToken, FLD_V); - break; - case PARAM_C: - pInstruction->A.Address = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST)); - break; - default: - EmuWarning("Invalid instruction, parameter A type unknown %d", pInstruction->A.ParameterType); - return; - } - pInstruction->A.Neg = VshGetField(pShaderToken, FLD_A_NEG); - pInstruction->A.Swizzle[0] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_A_SWZ_X); - pInstruction->A.Swizzle[1] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_A_SWZ_Y); - pInstruction->A.Swizzle[2] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_A_SWZ_Z); - pInstruction->A.Swizzle[3] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_A_SWZ_W); - // Get parameter B - pInstruction->B.ParameterType = (VSH_PARAMETER_TYPE)VshGetField(pShaderToken, FLD_B_MUX); - switch(pInstruction->B.ParameterType) - { - case PARAM_R: - pInstruction->B.Address = VshGetField(pShaderToken, FLD_B_R); - break; - case PARAM_V: - pInstruction->B.Address = VshGetField(pShaderToken, FLD_V); - break; - case PARAM_C: - pInstruction->B.Address = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST)); - break; - default: - DbgVshPrintf("Invalid instruction, parameter B type unknown %d\n", pInstruction->B.ParameterType); - return; - } - pInstruction->B.Neg = VshGetField(pShaderToken, FLD_B_NEG); - pInstruction->B.Swizzle[0] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_B_SWZ_X); - pInstruction->B.Swizzle[1] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_B_SWZ_Y); - pInstruction->B.Swizzle[2] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_B_SWZ_Z); - pInstruction->B.Swizzle[3] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_B_SWZ_W); - // Get parameter C - pInstruction->C.ParameterType = (VSH_PARAMETER_TYPE)VshGetField(pShaderToken, FLD_C_MUX); - switch(pInstruction->C.ParameterType) - { - case PARAM_R: - pInstruction->C.Address = VshGetField(pShaderToken, FLD_C_R_HIGH) << 2 | - VshGetField(pShaderToken, FLD_C_R_LOW); - break; - case PARAM_V: - pInstruction->C.Address = VshGetField(pShaderToken, FLD_V); - break; - case PARAM_C: - pInstruction->C.Address = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST)); - break; - default: - DbgVshPrintf("Invalid instruction, parameter C type unknown %d\n", pInstruction->C.ParameterType); - return; - } - pInstruction->C.Neg = VshGetField(pShaderToken, FLD_C_NEG); - pInstruction->C.Swizzle[0] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_C_SWZ_X); - pInstruction->C.Swizzle[1] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_C_SWZ_Y); - pInstruction->C.Swizzle[2] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_C_SWZ_Z); - pInstruction->C.Swizzle[3] = (VSH_SWIZZLE)VshGetField(pShaderToken, FLD_C_SWZ_W); - // Get output - // Output register - pInstruction->Output.OutputType = (VSH_OUTPUT_TYPE)VshGetField(pShaderToken, FLD_OUT_ORB); - switch(pInstruction->Output.OutputType) - { - case OUTPUT_C: - pInstruction->Output.OutputAddress = ConvertCRegister(VshGetField(pShaderToken, FLD_OUT_ADDRESS)); - break; - case OUTPUT_O: - pInstruction->Output.OutputAddress = VshGetField(pShaderToken, FLD_OUT_ADDRESS) & 0xF; - break; - } - pInstruction->Output.OutputMux = (VSH_OUTPUT_MUX)VshGetField(pShaderToken, FLD_OUT_MUX); - pInstruction->Output.OutputMask[0] = VshGetField(pShaderToken, FLD_OUT_O_MASK_X); - pInstruction->Output.OutputMask[1] = VshGetField(pShaderToken, FLD_OUT_O_MASK_Y); - pInstruction->Output.OutputMask[2] = VshGetField(pShaderToken, FLD_OUT_O_MASK_Z); - pInstruction->Output.OutputMask[3] = VshGetField(pShaderToken, FLD_OUT_O_MASK_W); - // MAC output - pInstruction->Output.MACRMask[0] = VshGetField(pShaderToken, FLD_OUT_MAC_MASK_X); - pInstruction->Output.MACRMask[1] = VshGetField(pShaderToken, FLD_OUT_MAC_MASK_Y); - pInstruction->Output.MACRMask[2] = VshGetField(pShaderToken, FLD_OUT_MAC_MASK_Z); - pInstruction->Output.MACRMask[3] = VshGetField(pShaderToken, FLD_OUT_MAC_MASK_W); - pInstruction->Output.MACRAddress = VshGetField(pShaderToken, FLD_OUT_R); - // ILU output - pInstruction->Output.ILURMask[0] = VshGetField(pShaderToken, FLD_OUT_ILU_MASK_X); - pInstruction->Output.ILURMask[1] = VshGetField(pShaderToken, FLD_OUT_ILU_MASK_Y); - pInstruction->Output.ILURMask[2] = VshGetField(pShaderToken, FLD_OUT_ILU_MASK_Z); - pInstruction->Output.ILURMask[3] = VshGetField(pShaderToken, FLD_OUT_ILU_MASK_W); - pInstruction->Output.ILURAddress = VshGetField(pShaderToken, FLD_OUT_R); - // Finally, get a0.x indirect constant addressing - pInstruction->a0x = VshGetField(pShaderToken, FLD_A0X); -} - -// Print functions -static char *VshGetRegisterName(VSH_PARAMETER_TYPE ParameterType) -{ - switch(ParameterType) - { - case PARAM_R: - return "r"; - case PARAM_V: - return "v"; - case PARAM_C: - return "c"; - case PARAM_O: - return "oPos"; - default: - return "?"; - } -} - -static void VshWriteOutputMask(boolean *OutputMask, - char *pDisassembly, - uint32 *pDisassemblyPos) -{ - if(OutputMask[0] && OutputMask[1] && OutputMask[2] && OutputMask[3]) - { - // All components are there, no need to print the mask - return; - } - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, ".%s%s%s%s", - OutputMask[0] ? "x" : "", - OutputMask[1] ? "y" : "", - OutputMask[2] ? "z" : "", - OutputMask[3] ? "w" : ""); -} - -static void VshWriteParameter(VSH_IMD_PARAMETER *pParameter, - char *pDisassembly, - uint32 *pDisassemblyPos) -{ - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, ", %s%s", - pParameter->Parameter.Neg ? "-" : "", - VshGetRegisterName(pParameter->Parameter.ParameterType)); - if(pParameter->Parameter.ParameterType == PARAM_C && pParameter->IndexesWithA0_X) - { - // Only display the offset if it's not 0. - if(pParameter->Parameter.Address) - { - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, "[a0.x+%d]", pParameter->Parameter.Address); - } - else - { - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, "[a0.x]"); - } - } - else - { - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, "%d", pParameter->Parameter.Address); - } - // Only bother printing the swizzle if it is not .xyzw - if(!(pParameter->Parameter.Swizzle[0] == SWIZZLE_X && - pParameter->Parameter.Swizzle[1] == SWIZZLE_Y && - pParameter->Parameter.Swizzle[2] == SWIZZLE_Z && - pParameter->Parameter.Swizzle[3] == SWIZZLE_W)) - { - int i; - - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, "."); - for (i = 0; i < 4; i++) - { - int j; - char Swizzle = '?'; - switch(pParameter->Parameter.Swizzle[i]) - { - case SWIZZLE_X: - Swizzle = 'x'; - break; - case SWIZZLE_Y: - Swizzle = 'y'; - break; - case SWIZZLE_Z: - Swizzle = 'z'; - break; - case SWIZZLE_W: - Swizzle = 'w'; - break; - } - *pDisassemblyPos += sprintf(pDisassembly + *pDisassemblyPos, "%c", Swizzle); - for (j = i; j < 4; j++) - { - if(pParameter->Parameter.Swizzle[i] != pParameter->Parameter.Swizzle[j]) - { - break; - } - } - if(j == 4) - { - break; - } - } - } -} - -static void VshWriteShader(VSH_XBOX_SHADER *pShader, - char* pDisassembly, - boolean Truncate) -{ - uint32 DisassemblyPos = 0; - switch(pShader->ShaderHeader.Version) - { - case VERSION_VS: -#ifdef CXBX_USE_VS30 - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "vs.3.0\n"); -#else - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "vs.1.1\n"); -#endif - break; - case VERSION_XVS: - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "xvs.1.1\n"); - break; - case VERSION_XVSS: - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "xvss.1.1\n"); - break; - case VERSION_XVSW: - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "xvsw.1.1\n"); - break; - default: - break; - } - for (int i = 0; i < pShader->IntermediateCount && (i < 128 || !Truncate); i++) - { - VSH_INTERMEDIATE_FORMAT *pIntermediate = &pShader->Intermediate[i]; - - if(i == 128) - { - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "; -- Passing the truncation limit --\n"); - } - - // Writing combining sign if neccessary - if(pIntermediate->IsCombined) - { - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "+"); - } - - // Print the op code - if(pIntermediate->InstructionType == IMD_MAC) - { - // Dxbx addition : Safeguard against incorrect MAC opcodes : - if (pIntermediate->MAC > MAC_ARL) - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "??? "); - else - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "%s ", MAC_OpCode[pIntermediate->MAC]); - } - else // IMD_ILU - { - // Dxbx addition : Safeguard against incorrect ILU opcodes : - if (pIntermediate->ILU > ILU_LIT) - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "??? "); - else - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "%s ", ILU_OpCode[pIntermediate->ILU]); - } - - // Print the output parameter - if(pIntermediate->Output.Type == IMD_OUTPUT_A0X) - { - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "a0.x"); - } - else - { - switch(pIntermediate->Output.Type) - { - case IMD_OUTPUT_C: - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "c%d", pIntermediate->Output.Address); - break; - case IMD_OUTPUT_R: - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "r%d", pIntermediate->Output.Address); - break; - case IMD_OUTPUT_O: - // Dxbx addition : Safeguard against incorrect VSH_OREG_NAME values : - if ((int)pIntermediate->Output.Address > OREG_A0X) - ; // don't add anything - else - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "%s", OReg_Name[pIntermediate->Output.Address]); - break; - default: - CxbxKrnlCleanup("Invalid output register in vertex shader!"); - break; - } - VshWriteOutputMask(pIntermediate->Output.Mask, pDisassembly, &DisassemblyPos); - } - // Print the parameters - for (int p = 0; p < 3; p++) - { - VSH_IMD_PARAMETER *pParameter = &pIntermediate->Parameters[p]; - if(pParameter->Active) - { - VshWriteParameter(pParameter, pDisassembly, &DisassemblyPos); - } - } - DisassemblyPos += sprintf(pDisassembly + DisassemblyPos, "\n"); - } - *(pDisassembly + DisassemblyPos) = 0; -} - -static void VshAddParameter(VSH_PARAMETER *pParameter, - boolean a0x, - VSH_IMD_PARAMETER *pIntermediateParameter) -{ - pIntermediateParameter->Parameter = *pParameter; - pIntermediateParameter->Active = TRUE; - pIntermediateParameter->IndexesWithA0_X = a0x; -} - -static void VshAddParameters(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_ILU ILU, - VSH_MAC MAC, - VSH_IMD_PARAMETER *pParameters) -{ - uint08 ParamCount = 0; - VSH_OPCODE_PARAMS* pParams = VshGetOpCodeParams(ILU, MAC); - - // param A - if(pParams->A) - { - VshAddParameter(&pInstruction->A, pInstruction->a0x, &pParameters[ParamCount]); - ParamCount++; - } - - // param B - if(pParams->B) - { - VshAddParameter(&pInstruction->B, pInstruction->a0x, &pParameters[ParamCount]); - ParamCount++; - } - - // param C - if(pParams->C) - { - VshAddParameter(&pInstruction->C, pInstruction->a0x, &pParameters[ParamCount]); - ParamCount++; - } -} - -static void VshVerifyBufferBounds(VSH_XBOX_SHADER *pShader) -{ - if(pShader->IntermediateCount == VSH_MAX_INTERMEDIATE_COUNT) - { - CxbxKrnlCleanup("Shader exceeds conversion buffer!"); - } -} - -static VSH_INTERMEDIATE_FORMAT *VshNewIntermediate(VSH_XBOX_SHADER *pShader) -{ - VshVerifyBufferBounds(pShader); - - ZeroMemory(&pShader->Intermediate[pShader->IntermediateCount], sizeof(VSH_INTERMEDIATE_FORMAT)); - - return &pShader->Intermediate[pShader->IntermediateCount++]; -} - -static void VshInsertIntermediate(VSH_XBOX_SHADER *pShader, - VSH_INTERMEDIATE_FORMAT *pIntermediate, - uint16 Pos) -{ - VshVerifyBufferBounds(pShader); - - for (int i = pShader->IntermediateCount; i >= Pos; i--) - { - pShader->Intermediate[i + 1] = pShader->Intermediate[i]; - } - pShader->Intermediate[Pos] = *pIntermediate; - pShader->IntermediateCount++; -} - -static void VshDeleteIntermediate(VSH_XBOX_SHADER *pShader, - uint16 Pos) -{ - for (int i = Pos; i < (pShader->IntermediateCount - 1); i++) - { - pShader->Intermediate[i] = pShader->Intermediate[i + 1]; - } - pShader->IntermediateCount--; -} - -static boolean VshAddInstructionMAC_R(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader, - boolean IsCombined) -{ - VSH_INTERMEDIATE_FORMAT *pIntermediate; - if(!HasMACR(pInstruction)) - { - return FALSE; - } - - pIntermediate = VshNewIntermediate(pShader); - pIntermediate->IsCombined = IsCombined; - - // Opcode - pIntermediate->InstructionType = IMD_MAC; - pIntermediate->MAC = pInstruction->MAC; - - // Output param - pIntermediate->Output.Type = IMD_OUTPUT_R; - pIntermediate->Output.Address = pInstruction->Output.MACRAddress; - memcpy(pIntermediate->Output.Mask, pInstruction->Output.MACRMask, sizeof(boolean) * 4); - - // Other parameters - VshAddParameters(pInstruction, ILU_NOP, pInstruction->MAC, pIntermediate->Parameters); - - return TRUE; -} - -static boolean VshAddInstructionMAC_O(VSH_SHADER_INSTRUCTION* pInstruction, - VSH_XBOX_SHADER *pShader, - boolean IsCombined) -{ - VSH_INTERMEDIATE_FORMAT *pIntermediate; - if(!HasMACO(pInstruction)) - { - return FALSE; - } - - pIntermediate = VshNewIntermediate(pShader); - pIntermediate->IsCombined = IsCombined; - - // Opcode - pIntermediate->InstructionType = IMD_MAC; - pIntermediate->MAC = pInstruction->MAC; - - // Output param - pIntermediate->Output.Type = pInstruction->Output.OutputType == OUTPUT_C ? IMD_OUTPUT_C : IMD_OUTPUT_O; - pIntermediate->Output.Address = pInstruction->Output.OutputAddress; - memcpy(pIntermediate->Output.Mask, pInstruction->Output.OutputMask, sizeof(boolean) * 4); - - // Other parameters - VshAddParameters(pInstruction, ILU_NOP, pInstruction->MAC, pIntermediate->Parameters); - - return TRUE; -} - -static boolean VshAddInstructionMAC_ARL(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader, - boolean IsCombined) -{ - VSH_INTERMEDIATE_FORMAT *pIntermediate; - if(!HasMACARL(pInstruction)) - { - return FALSE; - } - - pIntermediate = VshNewIntermediate(pShader); - pIntermediate->IsCombined = IsCombined; - - // Opcode - pIntermediate->InstructionType = IMD_MAC; - pIntermediate->MAC = pInstruction->MAC; - - // Output param - pIntermediate->Output.Type = IMD_OUTPUT_A0X; - pIntermediate->Output.Address = pInstruction->Output.OutputAddress; - - // Other parameters - VshAddParameters(pInstruction, ILU_NOP, pInstruction->MAC, pIntermediate->Parameters); - - return TRUE; -} - -/* -// Dxbx addition : Scalar instructions reading from W should read from X instead -boolean DxbxFixupScalarParameter(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader, - VSH_PARAMETER *pParameter) -{ - boolean Result; - int i; - boolean WIsWritten; - - // The DirectX vertex shader language specifies that the exp, log, rcc, rcp, and rsq instructions - // all operate on the "w" component of the input. But the microcode versions of these instructions - // actually operate on the "x" component of the input. - Result = false; - - // Test if this is a scalar instruction : - if (pInstruction->ILU in [ILU_RCP, ILU_RCC, ILU_RSQ, ILU_EXP, ILU_LOG]) - { - // Test if this parameter reads all components, including W (TODO : Or should we fixup any W reading swizzle?) : - if ((pParameter->Swizzle[0] = SWIZZLE_X) - && (pParameter->Swizzle[1] = SWIZZLE_Y) - && (pParameter->Swizzle[2] = SWIZZLE_Z) - && (pParameter->Swizzle[3] = SWIZZLE_W)) - { - // Also test that the .W component is never written to before: - WIsWritten = false; - for (i = 0; i < pShader->IntermediateCount; i++) - { - // Stop when we reached this instruction : - if (&(pShader->Intermediate[i]) == pInstruction) - break; - - // Check if this instruction writes to the .W component of the same input parameter : - if (((pShader->Intermediate[i].Output.Type == IMD_OUTPUT_C) && (pParameter->ParameterType == PARAM_C)) - || ((pShader->Intermediate[i].Output.Type == IMD_OUTPUT_R) && (pParameter->ParameterType == PARAM_R))) - { - WIsWritten = (pShader->Intermediate[i].Output.Address == pParameter->Address) - && ((pShader->Intermediate[i].Output.Mask && MASK_W) > 0); - if (WIsWritten) - break; - } - } - - if (!WIsWritten) - { - // Change the read from W into a read from X (this fixes the XDK VolumeLight sample) : - VshSetSwizzle(pParameter, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X); - DbgVshPrintf("Dxbx fixup on scalar instruction applied; Changed read of uninitialized W into a read of X!\n"); - Result = true; - } - } - } - - return Result; -} -*/ - -static boolean VshAddInstructionILU_R(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader, - boolean IsCombined) -{ - VSH_INTERMEDIATE_FORMAT *pIntermediate; - if(!HasILUR(pInstruction)) - { - return FALSE; - } - -/* TODO - // Dxbx note : Scalar instructions read from C, but use X instead of W, fix that : - DxbxFixupScalarParameter(pInstruction, pShader, &pInstruction.C); -*/ - pIntermediate = VshNewIntermediate(pShader); - pIntermediate->IsCombined = IsCombined; - - // Opcode - pIntermediate->InstructionType = IMD_ILU; - pIntermediate->ILU = pInstruction->ILU; - - // Output param - pIntermediate->Output.Type = IMD_OUTPUT_R; - // If this is a combined instruction, only r1 is allowed (R address should not be used) - pIntermediate->Output.Address = IsCombined ? 1 : pInstruction->Output.ILURAddress; - memcpy(pIntermediate->Output.Mask, pInstruction->Output.ILURMask, sizeof(boolean) * 4); - - // Other parameters - VshAddParameters(pInstruction, pInstruction->ILU, MAC_NOP, pIntermediate->Parameters); - - return TRUE; -} - -static boolean VshAddInstructionILU_O(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader, - boolean IsCombined) -{ - VSH_INTERMEDIATE_FORMAT *pIntermediate; - if(!HasILUO(pInstruction)) - { - return FALSE; - } - - pIntermediate = VshNewIntermediate(pShader); - pIntermediate->IsCombined = IsCombined; - - // Opcode - pIntermediate->InstructionType = IMD_ILU; - pIntermediate->ILU = pInstruction->ILU; - - // Output param - pIntermediate->Output.Type = pInstruction->Output.OutputType == OUTPUT_C ? IMD_OUTPUT_C : IMD_OUTPUT_O; - pIntermediate->Output.Address = pInstruction->Output.OutputAddress; - memcpy(pIntermediate->Output.Mask, pInstruction->Output.OutputMask, sizeof(boolean) * 4); - - // Other parameters - VshAddParameters(pInstruction, pInstruction->ILU, MAC_NOP, pIntermediate->Parameters); - - return TRUE; -} - -static void VshConvertToIntermediate(VSH_SHADER_INSTRUCTION *pInstruction, - VSH_XBOX_SHADER *pShader) -{ - // Five types of instructions: - // MAC - // - // ILU - // - // MAC - // +ILU - // - // MAC - // +MAC - // +ILU - // - // MAC - // +ILU - // +ILU - boolean IsCombined = FALSE; - - if(VshAddInstructionMAC_R(pInstruction, pShader, IsCombined)) - { - if(HasMACO(pInstruction) || - HasILUR(pInstruction) || - HasILUO(pInstruction)) - { - IsCombined = TRUE; - } - } - if(VshAddInstructionMAC_O(pInstruction, pShader, IsCombined)) - { - if(HasILUR(pInstruction) || - HasILUO(pInstruction)) - { - IsCombined = TRUE; - } - } - // Special case, arl (mov a0.x, ...) - if(VshAddInstructionMAC_ARL(pInstruction, pShader, IsCombined)) - { - if(HasILUR(pInstruction) || - HasILUO(pInstruction)) - { - IsCombined = TRUE; - } - } - if(VshAddInstructionILU_R(pInstruction, pShader, IsCombined)) - { - if(HasILUO(pInstruction)) - { - IsCombined = TRUE; - } - } - (void)VshAddInstructionILU_O(pInstruction, pShader, IsCombined); -} - -static inline void VshSetSwizzle(VSH_IMD_PARAMETER *pParameter, - VSH_SWIZZLE x, - VSH_SWIZZLE y, - VSH_SWIZZLE z, - VSH_SWIZZLE w) -{ - pParameter->Parameter.Swizzle[0] = x; - pParameter->Parameter.Swizzle[1] = y; - pParameter->Parameter.Swizzle[2] = z; - pParameter->Parameter.Swizzle[3] = w; -} - -static inline void VshSetOutputMask(VSH_IMD_OUTPUT* pOutput, - boolean MaskX, - boolean MaskY, - boolean MaskZ, - boolean MaskW) -{ - pOutput->Mask[0] = MaskX; - pOutput->Mask[1] = MaskY; - pOutput->Mask[2] = MaskZ; - pOutput->Mask[3] = MaskW; -} -/* - mul oPos.xyz, r12, c-38 - +rcc r1.x, r12.w - - mad oPos.xyz, r12, r1.x, c-37 -*/ -static void VshRemoveScreenSpaceInstructions(VSH_XBOX_SHADER *pShader) -{ - int16 PosC38 = -1; - int deleted = 0; - - for (int i = 0; i < pShader->IntermediateCount; i++) - { - VSH_INTERMEDIATE_FORMAT* pIntermediate = &pShader->Intermediate[i]; - - for (int k = 0; k < 3; k++) - { - if(pIntermediate->Parameters[k].Active) - { - if(pIntermediate->Parameters[k].Parameter.ParameterType == PARAM_C && - !pIntermediate->Parameters[k].IndexesWithA0_X) - { - if(pIntermediate->Parameters[k].Parameter.Address == -37) - { - // Found c-37, remove the instruction - if(k == 2 && - pIntermediate->Parameters[1].Active && - pIntermediate->Parameters[1].Parameter.ParameterType == PARAM_R) - { - DbgVshPrintf("PosC38 = %d i = %d\n", PosC38, i); - for (int j = (i-1); j >= 0; j--) - { - VSH_INTERMEDIATE_FORMAT* pIntermediate1W = &pShader->Intermediate[j]; - // Time to start searching for +rcc r#.x, r12.w - if(pIntermediate1W->InstructionType == IMD_ILU && - pIntermediate1W->ILU == ILU_RCC && - pIntermediate1W->Output.Type == IMD_OUTPUT_R && - pIntermediate1W->Output.Address == - pIntermediate->Parameters[1].Parameter.Address) - { - DbgVshPrintf("Deleted +rcc r1.x, r12.w\n"); - VshDeleteIntermediate(pShader, j); - deleted++; - i--; - //j--; - break; - } - } - } - VshDeleteIntermediate(pShader, i); - deleted++; - i--; - DbgVshPrintf("Deleted mad oPos.xyz, r12, r1.x, c-37\n"); - break; - } - else if(pIntermediate->Parameters[k].Parameter.Address == -38) - { - VshDeleteIntermediate(pShader, i); - PosC38 = i; - deleted++; - i--; - DbgVshPrintf("Deleted mul oPos.xyz, r12, c-38\n"); - } - } - } - } - } - - // If we couldn't find the generic screen space transformation we're - // assuming that the shader writes direct screen coordinates that must be - // normalized. This hack will fail if (a) the shader uses custom screen - // space transformation, (b) reads r10 or r11 after we have written to - // them, or (c) doesn't reserve c-38 and c-37 for scale and offset. - if(deleted != 3) - { - EmuWarning("Applying screen space vertex shader patching hack!"); - for (int i = 0; i < pShader->IntermediateCount; i++) - { - VSH_INTERMEDIATE_FORMAT* pIntermediate = &pShader->Intermediate[i]; - - // Find instructions outputting to oPos. - if( pIntermediate->Output.Type == IMD_OUTPUT_O && - pIntermediate->Output.Address == OREG_OPOS) - { - // Redirect output to r11. - pIntermediate->Output.Type = IMD_OUTPUT_R; - pIntermediate->Output.Address = 11; - - // Scale r11 to r10. (mul r10.[mask], r11, c58) - VSH_INTERMEDIATE_FORMAT MulIntermediate; - MulIntermediate.IsCombined = FALSE; - MulIntermediate.InstructionType = IMD_MAC; - MulIntermediate.MAC = MAC_MUL; - MulIntermediate.Output.Type = IMD_OUTPUT_R; - MulIntermediate.Output.Address = 10; - MulIntermediate.Output.Mask[0] = pIntermediate->Output.Mask[0]; - MulIntermediate.Output.Mask[1] = pIntermediate->Output.Mask[1]; - MulIntermediate.Output.Mask[2] = pIntermediate->Output.Mask[2]; - MulIntermediate.Output.Mask[3] = pIntermediate->Output.Mask[3]; - MulIntermediate.Parameters[0].Active = TRUE; - MulIntermediate.Parameters[0].IndexesWithA0_X = FALSE; - MulIntermediate.Parameters[0].Parameter.ParameterType = PARAM_R; - MulIntermediate.Parameters[0].Parameter.Address = 11; - MulIntermediate.Parameters[0].Parameter.Neg = FALSE; - VshSetSwizzle(&MulIntermediate.Parameters[0], SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - MulIntermediate.Parameters[1].Active = TRUE; - MulIntermediate.Parameters[1].IndexesWithA0_X = FALSE; - MulIntermediate.Parameters[1].Parameter.ParameterType = PARAM_C; - MulIntermediate.Parameters[1].Parameter.Address = ConvertCRegister(58); - MulIntermediate.Parameters[1].Parameter.Neg = FALSE; - VshSetSwizzle(&MulIntermediate.Parameters[1], SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - MulIntermediate.Parameters[2].Active = FALSE; - VshInsertIntermediate(pShader, &MulIntermediate, ++i); - - // Add offset with r10 to oPos (add oPos.[mask], r10, c59) - VSH_INTERMEDIATE_FORMAT AddIntermediate = MulIntermediate; - AddIntermediate.MAC = MAC_ADD; - AddIntermediate.Output.Type = IMD_OUTPUT_O; - AddIntermediate.Output.Address = OREG_OPOS; - AddIntermediate.Parameters[0].Parameter.ParameterType = PARAM_R; - AddIntermediate.Parameters[0].Parameter.Address = 10; - AddIntermediate.Parameters[1].Parameter.Address = ConvertCRegister(59); - VshInsertIntermediate(pShader, &AddIntermediate, ++i); - } - } - } -} - -static void VshRemoveUndeclaredRegisters(VSH_XBOX_SHADER *pShader, bool *pDeclaredRegisters) -{ - for (int i = 0; i < pShader->IntermediateCount; i++) { - VSH_INTERMEDIATE_FORMAT* pIntermediate = &pShader->Intermediate[i]; - for (int p = 0; p < 3; p++) { - // Skip parameters that are either inactive, or not vX registers - if (!pIntermediate->Parameters[p].Active || pIntermediate->Parameters[p].Parameter.ParameterType != PARAM_V) { - continue; - } - - bool used = pDeclaredRegisters[pIntermediate->Parameters[p].Parameter.Address]; - if (!used) { - EmuWarning("Deleting usage of undeclared register v%d", pIntermediate->Parameters[p].Parameter.Address); - VshDeleteIntermediate(pShader, i); - } - } - } -} - -// Converts the intermediate format vertex shader to DirectX 8 format -static boolean VshConvertShader(VSH_XBOX_SHADER *pShader, - boolean bNoReservedConstants, - bool *pDeclaredRegisters -) -{ - boolean RUsage[13] = { FALSE }; - // TODO: What about state shaders and such? - pShader->ShaderHeader.Version = VERSION_VS; - - // Search for the screen space instructions, and remove them - if(!bNoReservedConstants) - { - VshRemoveScreenSpaceInstructions(pShader); - } - - VshRemoveUndeclaredRegisters(pShader, pDeclaredRegisters); - - // TODO: Add routine for compacting r register usage so that at least one is freed (two if dph and r12) - - for (int i = 0; i < pShader->IntermediateCount; i++) - { - VSH_INTERMEDIATE_FORMAT* pIntermediate = &pShader->Intermediate[i]; - // Combining not supported in vs.1.1 - pIntermediate->IsCombined = FALSE; - - /* - if(pIntermediate->Output.Type == IMD_OUTPUT_O && pIntermediate->Output.Address == OREG_OFOG) - { - // The PC shader assembler doesn't like masks on scalar registers - VshSetOutputMask(&pIntermediate->Output, TRUE, TRUE, TRUE, TRUE); - }*/ - - if(pIntermediate->InstructionType == IMD_ILU && pIntermediate->ILU == ILU_RCC) - { - // Convert rcc to rcp - pIntermediate->ILU = ILU_RCP; - } - - if(pIntermediate->Output.Type == IMD_OUTPUT_R) - { - RUsage[pIntermediate->Output.Address] = TRUE; - } - // Make constant registers range from 0 to 192 instead of -96 to 96 - if(pIntermediate->Output.Type == IMD_OUTPUT_C) - { - //if(pIntermediate->Output.Address < 0) - pIntermediate->Output.Address += 96; - } - - for (int j = 0; j < 3; j++) - { - if(pIntermediate->Parameters[j].Active) - { - if(pIntermediate->Parameters[j].Parameter.ParameterType == PARAM_R) - { - RUsage[pIntermediate->Parameters[j].Parameter.Address] = TRUE; - } - // Make constant registers range from 0 to 192 instead of -96 to 96 - if(pIntermediate->Parameters[j].Parameter.ParameterType == PARAM_C) - { - //if(pIntermediate->Parameters[j].Parameter.Address < 0) - pIntermediate->Parameters[j].Parameter.Address += 96; - } - } - } - - if(pIntermediate->InstructionType == IMD_MAC && pIntermediate->MAC == MAC_DPH) - { - // 2010/01/12 - revel8n - attempt to alleviate conversion issues relate to the dph instruction - - // Replace dph with dp3 and add - if(pIntermediate->Output.Type != IMD_OUTPUT_R) - { - // TODO: Complete dph support - EmuWarning("Can't simulate dph for other than output r registers (yet)"); - - // attempt to find unused register... - int outRegister = -1; - for (int j = 11; j >= 0; --j) - { - if(!RUsage[j]) - { - outRegister = j; - break; - } - } - - // return failure if there are no available registers - if (outRegister == -1) - { - return FALSE; - } - - VSH_INTERMEDIATE_FORMAT TmpIntermediate = *pIntermediate; - - // modify the instructions - // the register value is not needed beyond these instructions so setting the usage flag should not be necessary (??) - pIntermediate->MAC = MAC_DP3; - pIntermediate->Output.Type = IMD_OUTPUT_R; - pIntermediate->Output.Address = outRegister; - VshSetOutputMask(&pIntermediate->Output, TRUE, TRUE, TRUE, TRUE); - - TmpIntermediate.MAC = MAC_ADD; - TmpIntermediate.Parameters[0].IndexesWithA0_X = FALSE; - TmpIntermediate.Parameters[0].Parameter.ParameterType = PARAM_R; - TmpIntermediate.Parameters[0].Parameter.Address = outRegister; - TmpIntermediate.Parameters[0].Parameter.Neg = FALSE; - VshSetSwizzle(&TmpIntermediate.Parameters[1], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - // Is this output register a scalar - if (TmpIntermediate.Output.Type == IMD_OUTPUT_O) { - if ((TmpIntermediate.Output.Address == OREG_OFOG) || (TmpIntermediate.Output.Address == OREG_OPTS)) { - // This fixes test case "Namco Museum 50th Anniversary" - // The PC shader assembler doesn't like masks on scalar registers - VshSetOutputMask(&TmpIntermediate.Output, TRUE, TRUE, TRUE, TRUE); - // Make the first source parameter use the w swizzle too - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - } - } - - VshInsertIntermediate(pShader, &TmpIntermediate, i + 1); - } - else - { - VSH_INTERMEDIATE_FORMAT TmpIntermediate = *pIntermediate; - pIntermediate->MAC = MAC_DP3; - TmpIntermediate.MAC = MAC_ADD; - TmpIntermediate.Parameters[0].IndexesWithA0_X = FALSE; - TmpIntermediate.Parameters[0].Parameter.ParameterType = PARAM_R; - TmpIntermediate.Parameters[0].Parameter.Address = TmpIntermediate.Output.Address; - TmpIntermediate.Parameters[0].Parameter.Neg = FALSE; - - int swizzle = (TmpIntermediate.Output.Mask[0]) | (TmpIntermediate.Output.Mask[1] << 1) | (TmpIntermediate.Output.Mask[2] << 2) | (TmpIntermediate.Output.Mask[3] << 3); - switch (swizzle) - { - case 1: - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X); - break; - case 2: - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y); - break; - case 4: - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z); - break; - case 8: - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - break; - case 15: - default: - VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - break; - } - //VshSetSwizzle(&TmpIntermediate.Parameters[0], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - VshSetSwizzle(&TmpIntermediate.Parameters[1], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - //VshSetOutputMask(&TmpIntermediate.Output, FALSE, FALSE, FALSE, TRUE); - VshInsertIntermediate(pShader, &TmpIntermediate, i + 1); - } - i++; - } - } - int16 R12Replacement = -1; - if(RUsage[12]) - { - // Sigh, they absolutely had to use r12, didn't they? - for (int i = 11; i >= 0; i--) - { - if(!RUsage[i]) - { - R12Replacement = i; - break; - } - } - if(R12Replacement == -1) - { - EmuWarning("Vertex shader uses all r registers, including r12; impossible to convert!"); - return FALSE; - } - for (int j = 0; j < pShader->IntermediateCount; j++) - { - VSH_INTERMEDIATE_FORMAT* pIntermediate = &pShader->Intermediate[j]; - if(pIntermediate->Output.Type == IMD_OUTPUT_O && - pIntermediate->Output.Address == OREG_OPOS) - { - // Found instruction writing to oPos - pIntermediate->Output.Type = IMD_OUTPUT_R; - pIntermediate->Output.Address = R12Replacement; - } - - for (int k = 0; k < 3; k++) - { - if(pIntermediate->Parameters[k].Active) - { - if(pIntermediate->Parameters[k].Parameter.ParameterType == PARAM_R && - pIntermediate->Parameters[k].Parameter.Address == 12) - { - // Found a r12 used as a parameter; replace - pIntermediate->Parameters[k].Parameter.Address = R12Replacement; - } - else if(pIntermediate->Parameters[k].Parameter.ParameterType == PARAM_C && - pIntermediate->Parameters[k].Parameter.Address == 58 && - !pIntermediate->Parameters[k].IndexesWithA0_X) - { - // Found c-38, replace it with r12.w - pIntermediate->Parameters[k].Parameter.ParameterType = PARAM_R; - pIntermediate->Parameters[k].Parameter.Address = R12Replacement; - VshSetSwizzle(&pIntermediate->Parameters[k], SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W); - } - } - } - } - // Insert mov oPos, r## in the end - VSH_INTERMEDIATE_FORMAT *pOPosWriteBack = VshNewIntermediate(pShader); - pOPosWriteBack->InstructionType = IMD_ILU; - pOPosWriteBack->ILU = ILU_MOV; - pOPosWriteBack->MAC = MAC_NOP; - pOPosWriteBack->Output.Type = IMD_OUTPUT_O; - pOPosWriteBack->Output.Address = OREG_OPOS; - VshSetOutputMask(&pOPosWriteBack->Output, TRUE, TRUE, TRUE, TRUE); - pOPosWriteBack->Parameters[0].Active = TRUE; - pOPosWriteBack->Parameters[0].Parameter.ParameterType = PARAM_R; - pOPosWriteBack->Parameters[0].Parameter.Address = R12Replacement; - VshSetSwizzle(&pOPosWriteBack->Parameters[0], SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - } - return TRUE; -} - -// **************************************************************************** -// * Vertex shader declaration recompiler -// **************************************************************************** - -typedef struct _CxbxVertexShaderPatch -{ - XTL::CxbxVertexShaderInfo *pVertexShaderInfoToSet; - XTL::CxbxVertexShaderStreamInfo *pCurrentVertexShaderStreamInfo; -} -CxbxVertexShaderPatch; - -// VERTEX SHADER -#define DEF_VSH_END 0xFFFFFFFF -#define DEF_VSH_NOP 0x00000000 - -static DWORD VshGetDeclarationSize(DWORD *pDeclaration) -{ - DWORD Pos = 0; - while (*(pDeclaration + Pos) != DEF_VSH_END) - { - Pos++; - } - return Pos + 1; -} - -#ifndef CXBX_USE_D3D9 -namespace XTL { -typedef DWORD D3DDECLUSAGE; -} -#endif - -#define D3DDECLUSAGE_UNSUPPORTED ((D3DDECLUSAGE)-1) - -XTL::D3DDECLUSAGE Xb2PCRegisterType -( - DWORD VertexRegister, - boolean IsFixedFunction -) -{ - using namespace XTL; - - D3DDECLUSAGE PCRegisterType; -#ifdef CXBX_USE_D3D9 - DWORD PCUsageIndex = 0; -#endif - // For fixed function vertex shaders, print D3DVSDE_*, for custom shaders print numbered registers. - if (IsFixedFunction) { - switch (VertexRegister) - { - case X_D3DVSDE_VERTEX: // -1 - DbgVshPrintf("D3DVSDE_VERTEX /* xbox ext. */"); - PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; - break; - case X_D3DVSDE_POSITION: // 0 - DbgVshPrintf("D3DVSDE_POSITION"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_POSITION; -#else - PCRegisterType = D3DVSDE_POSITION; -#endif - break; - case X_D3DVSDE_BLENDWEIGHT: // 1 - DbgVshPrintf("D3DVSDE_BLENDWEIGHT"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_BLENDWEIGHT; -#else - PCRegisterType = D3DVSDE_BLENDWEIGHT; -#endif - break; - case X_D3DVSDE_NORMAL: // 2 - DbgVshPrintf("D3DVSDE_NORMAL"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_NORMAL; -#else - PCRegisterType = D3DVSDE_NORMAL; -#endif - break; - case X_D3DVSDE_DIFFUSE: // 3 - DbgVshPrintf("D3DVSDE_DIFFUSE"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 0; -#else - PCRegisterType = D3DVSDE_DIFFUSE; -#endif - break; - case X_D3DVSDE_SPECULAR: // 4 - DbgVshPrintf("D3DVSDE_SPECULAR"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 1; -#else - PCRegisterType = D3DVSDE_SPECULAR; -#endif - break; - case X_D3DVSDE_FOG: // 5 -#ifdef CXBX_USE_D3D9 - DbgVshPrintf("D3DVSDE_FOG"); - PCRegisterType = D3DDECLUSAGE_FOG; -#else - DbgVshPrintf("D3DVSDE_FOG /* xbox ext. */"); - PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; -#endif - break; - case X_D3DVSDE_BACKDIFFUSE: // 7 - DbgVshPrintf("D3DVSDE_BACKDIFFUSE /* xbox ext. */"); - PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; - break; - case X_D3DVSDE_BACKSPECULAR: // 8 - DbgVshPrintf("D3DVSDE_BACKSPECULAR /* xbox ext. */"); - PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; - break; - case X_D3DVSDE_TEXCOORD0: // 9 - DbgVshPrintf("D3DVSDE_TEXCOORD0"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 0; -#else - PCRegisterType = D3DVSDE_TEXCOORD0; -#endif - break; - case X_D3DVSDE_TEXCOORD1: // 10 - DbgVshPrintf("D3DVSDE_TEXCOORD1"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 1; -#else - PCRegisterType = D3DVSDE_TEXCOORD1; -#endif - break; - case X_D3DVSDE_TEXCOORD2: // 11 - DbgVshPrintf("D3DVSDE_TEXCOORD2"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 2; -#else - PCRegisterType = D3DVSDE_TEXCOORD2; -#endif - break; - case X_D3DVSDE_TEXCOORD3: // 12 - DbgVshPrintf("D3DVSDE_TEXCOORD3"); -#ifdef CXBX_USE_D3D9 - PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 3; -#else - PCRegisterType = D3DVSDE_TEXCOORD3; -#endif - break; - default: - DbgVshPrintf("%d /* unknown register */", VertexRegister); - PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; - break; - } - } else { - PCRegisterType = (D3DDECLUSAGE)VertexRegister; - DbgVshPrintf("%d", VertexRegister); - } - - return PCRegisterType; -#ifdef CXBX_USE_D3D9 - // TODO : Also return (and use) PCUsageIndex -#endif -} - -static inline DWORD VshGetTokenType(DWORD Token) -{ - return (Token & X_D3DVSD_TOKENTYPEMASK) >> X_D3DVSD_TOKENTYPESHIFT; -} - -static inline DWORD VshGetVertexRegister(DWORD Token) -{ - return (Token & X_D3DVSD_VERTEXREGMASK) >> X_D3DVSD_VERTEXREGSHIFT; -} - -static inline DWORD VshGetVertexRegisterIn(DWORD Token) -{ - return (Token & X_D3DVSD_VERTEXREGINMASK) >> X_D3DVSD_VERTEXREGINSHIFT; -} - -static inline DWORD VshGetVertexStream(DWORD Token) -{ - return (Token & X_D3DVSD_STREAMNUMBERMASK) >> X_D3DVSD_STREAMNUMBERSHIFT; -} - -static void VshConvertToken_NOP( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled -) -{ - // D3DVSD_NOP - if(*pToken != DEF_VSH_NOP) - { - EmuWarning("Token NOP found, but extra parameters are given!"); - } - DbgVshPrintf("\tD3DVSD_NOP(),\n"); -} - -static DWORD VshConvertToken_CONSTMEM( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled -) -{ - using namespace XTL; - - // D3DVSD_CONST - DbgVshPrintf("\tD3DVSD_CONST("); - - DWORD ConstantAddress = (*pToken & X_D3DVSD_CONSTADDRESSMASK) >> X_D3DVSD_CONSTADDRESSSHIFT; - DWORD Count = (*pToken & X_D3DVSD_CONSTCOUNTMASK) >> X_D3DVSD_CONSTCOUNTSHIFT; - DbgVshPrintf("%d, %d),\n", ConstantAddress, Count); - -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = D3DVSD_CONST(ConstantAddress, Count); -#endif - - for (uint i = 0; i < Count; i++) - { - pToken++; - pRecompiled++; - - DbgVshPrintf("\t0x%08X,\n", pToken); -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = *pToken; -#endif - } - - return Count; -} - -static void VshConvertToken_TESSELATOR( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled, - boolean IsFixedFunction -) -{ - using namespace XTL; - - // TODO: Investigate why Xb2PCRegisterType is only used for fixed function vertex shaders - if(*pToken & X_D3DVSD_MASK_TESSUV) - { - XTL::DWORD VertexRegister = VshGetVertexRegister(*pToken); - XTL::DWORD NewVertexRegister = VertexRegister; - - DbgVshPrintf("\tD3DVSD_TESSUV("); - NewVertexRegister = Xb2PCRegisterType(VertexRegister, IsFixedFunction); - DbgVshPrintf("),\n"); - -#ifdef CXBX_USE_D3D9 - // TODO : Expand on the setting of this TESSUV register element : - pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegister); - pRecompiled->UsageIndex = 0; // TODO : Get Index from Xb2PCRegisterType -#else - *pRecompiled = D3DVSD_TESSUV(NewVertexRegister); -#endif - } - // D3DVSD_TESSNORMAL - else - { - XTL::DWORD VertexRegisterIn = VshGetVertexRegisterIn(*pToken); - XTL::DWORD VertexRegisterOut = VshGetVertexRegister(*pToken); - - XTL::DWORD NewVertexRegisterIn = VertexRegisterIn; - XTL::DWORD NewVertexRegisterOut = VertexRegisterOut; - - DbgVshPrintf("\tD3DVSD_TESSNORMAL("); - NewVertexRegisterIn = Xb2PCRegisterType(VertexRegisterIn, IsFixedFunction); - DbgVshPrintf(", "); -#ifdef CXBX_USE_D3D9 - // TODO : Expand on the setting of this TESSNORMAL input register element : - pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegisterIn); - pRecompiled->UsageIndex = 0; // TODO : Get Index from Xb2PCRegisterType -#endif - NewVertexRegisterOut = Xb2PCRegisterType(VertexRegisterOut, IsFixedFunction); - DbgVshPrintf("),\n"); - -#ifdef CXBX_USE_D3D9 - // TODO : Expand on the setting of this TESSNORMAL output register element : - pRecompiled++; - pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegisterOut); - pRecompiled->UsageIndex = 0; // TODO : Get Index from Xb2PCRegisterType -#else - *pRecompiled = D3DVSD_TESSNORMAL(NewVertexRegisterIn, NewVertexRegisterOut); -#endif - } -} - -static void VshEndPreviousStreamPatch(CxbxVertexShaderPatch *pPatchData) -{ - if(pPatchData->pCurrentVertexShaderStreamInfo) { - DbgVshPrintf("\t// NeedPatching: %d\n", pPatchData->pCurrentVertexShaderStreamInfo->NeedPatch); - } -} - -static void VshConvertToken_STREAM( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled, - CxbxVertexShaderPatch *pPatchData -) -{ - using namespace XTL; - - // D3DVSD_STREAM_TESS - if(*pToken & X_D3DVSD_STREAMTESSMASK) - { - DbgVshPrintf("\tD3DVSD_STREAM_TESS(),\n"); - -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = D3DVSD_STREAM_TESS(); -#endif - } - // D3DVSD_STREAM - else - { - VshEndPreviousStreamPatch(pPatchData); - - XTL::DWORD StreamNumber = VshGetVertexStream(*pToken); - - // new stream - pPatchData->pCurrentVertexShaderStreamInfo = &(pPatchData->pVertexShaderInfoToSet->VertexStreams[StreamNumber]); - pPatchData->pCurrentVertexShaderStreamInfo->NeedPatch = FALSE; - pPatchData->pCurrentVertexShaderStreamInfo->HostVertexStride = 0; - pPatchData->pCurrentVertexShaderStreamInfo->NumberOfVertexElements = 0; - - // Dxbx note : Use Dophin(s), FieldRender, MatrixPaletteSkinning and PersistDisplay as a testcase - - DbgVshPrintf("\tD3DVSD_STREAM(%u),\n", StreamNumber); - -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = D3DVSD_STREAM(StreamNumber); -#endif - - pPatchData->pVertexShaderInfoToSet->NumberOfVertexStreams++; - // TODO : Keep a bitmask for all StreamNumber's seen? - } -} - -static void VshConvertToken_STREAMDATA_SKIP( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled -) -{ - using namespace XTL; - - XTL::DWORD SkipCount = (*pToken & X_D3DVSD_SKIPCOUNTMASK) >> X_D3DVSD_SKIPCOUNTSHIFT; - DbgVshPrintf("\tD3DVSD_SKIP(%d),\n", SkipCount); -#ifdef CXBX_USE_D3D9 - // TODO : Expand on the setting of this TESSNORMAL output register element : -#else - // D3DVSD_SKIP is encoded identically on host Direct3D8. - *pRecompiled = D3DVSD_SKIP(SkipCount); -#endif -} - -static void VshConvertToken_STREAMDATA_SKIPBYTES( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled -) -{ - using namespace XTL; - - XTL::DWORD SkipBytesCount = (*pToken & X_D3DVSD_SKIPCOUNTMASK) >> X_D3DVSD_SKIPCOUNTSHIFT; - - DbgVshPrintf("\tD3DVSD_SKIPBYTES(%d), /* xbox ext. */\n", SkipBytesCount); - if (SkipBytesCount % sizeof(XTL::DWORD)) { - EmuWarning("D3DVSD_SKIPBYTES can't be converted to D3DVSD_SKIP, not divisble by 4."); - } - -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = D3DVSD_SKIP(SkipBytesCount / sizeof(XTL::DWORD)); -#endif -} - -static void VshConvertToken_STREAMDATA_REG( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled, - boolean IsFixedFunction, - CxbxVertexShaderPatch *pPatchData -) -{ - using namespace XTL; - -#if CXBX_USE_D3D9 - extern XTL::D3DCAPS g_D3DCaps; -#endif - -#if !CXBX_USE_D3D9 // For simpler support for both Direct3D 8 and 9, use these '9' constants in below '8' code paths too: -#define D3DDECLTYPE_FLOAT1 D3DVSDT_FLOAT1 -#define D3DDECLTYPE_FLOAT2 D3DVSDT_FLOAT2 -#define D3DDECLTYPE_FLOAT3 D3DVSDT_FLOAT3 -#define D3DDECLTYPE_FLOAT4 D3DVSDT_FLOAT4 -#define D3DDECLTYPE_D3DCOLOR D3DVSDT_D3DCOLOR -#define D3DDECLTYPE_SHORT2 D3DVSDT_SHORT2 -#define D3DDECLTYPE_SHORT4 D3DVSDT_SHORT4 -#define D3DDECLTYPE_UNUSED 0xFF -#endif - - XTL::DWORD VertexRegister = VshGetVertexRegister(*pToken); - XTL::DWORD HostVertexRegister; - XTL::BOOL NeedPatching = FALSE; - - DbgVshPrintf("\t\tD3DVSD_REG("); - HostVertexRegister = Xb2PCRegisterType(VertexRegister, IsFixedFunction); - DbgVshPrintf(", "); - - XTL::DWORD XboxVertexElementDataType = (*pToken & X_D3DVSD_DATATYPEMASK) >> X_D3DVSD_DATATYPESHIFT; - XTL::DWORD HostVertexElementDataType = 0; - XTL::DWORD HostVertexElementByteSize = 0; - - switch (XboxVertexElementDataType) - { - case X_D3DVSDT_FLOAT1: // 0x12: - DbgVshPrintf("D3DVSDT_FLOAT1"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT1; - HostVertexElementByteSize = 1 * sizeof(FLOAT); - break; - case X_D3DVSDT_FLOAT2: // 0x22: - DbgVshPrintf("D3DVSDT_FLOAT2"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT2; - HostVertexElementByteSize = 2 * sizeof(FLOAT); - break; - case X_D3DVSDT_FLOAT3: // 0x32: - DbgVshPrintf("D3DVSDT_FLOAT3"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT3; - HostVertexElementByteSize = 3 * sizeof(FLOAT); - break; - case X_D3DVSDT_FLOAT4: // 0x42: - DbgVshPrintf("D3DVSDT_FLOAT4"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT4; - HostVertexElementByteSize = 4 * sizeof(FLOAT); - break; - case X_D3DVSDT_D3DCOLOR: // 0x40: - DbgVshPrintf("D3DVSDT_D3DCOLOR"); - HostVertexElementDataType = D3DDECLTYPE_D3DCOLOR; - HostVertexElementByteSize = 1 * sizeof(D3DCOLOR); - break; - case X_D3DVSDT_SHORT2: // 0x25: - DbgVshPrintf("D3DVSDT_SHORT2"); - HostVertexElementDataType = D3DDECLTYPE_SHORT2; - HostVertexElementByteSize = 2 * sizeof(XTL::SHORT); - break; - case X_D3DVSDT_SHORT4: // 0x45: - DbgVshPrintf("D3DVSDT_SHORT4"); - HostVertexElementDataType = D3DDECLTYPE_SHORT4; - HostVertexElementByteSize = 4 * sizeof(XTL::SHORT); - break; - case X_D3DVSDT_NORMSHORT1: // 0x11: - DbgVshPrintf("D3DVSDT_NORMSHORT1 /* xbox ext. */"); -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { - HostVertexElementDataType = D3DDECLTYPE_SHORT2N; - HostVertexElementByteSize = 2 * sizeof(SHORT); - } - else -#endif - { - HostVertexElementDataType = D3DDECLTYPE_FLOAT1; - HostVertexElementByteSize = 1 * sizeof(FLOAT); - } - NeedPatching = TRUE; - break; - case X_D3DVSDT_NORMSHORT2: // 0x21: -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { - DbgVshPrintf("D3DVSDT_NORMSHORT2"); - HostVertexElementDataType = D3DDECLTYPE_SHORT2N; - HostVertexElementByteSize = 2 * sizeof(SHORT); - // No need for patching in D3D9 - } - else -#endif - { - DbgVshPrintf("D3DVSDT_NORMSHORT2 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT2; - HostVertexElementByteSize = 2 * sizeof(FLOAT); - NeedPatching = TRUE; - } - break; - case X_D3DVSDT_NORMSHORT3: // 0x31: - DbgVshPrintf("D3DVSDT_NORMSHORT3 /* xbox ext. */"); -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { - HostVertexElementDataType = D3DDECLTYPE_SHORT4N; - HostVertexElementByteSize = 4 * sizeof(SHORT); - } - else -#endif - { - HostVertexElementDataType = D3DDECLTYPE_FLOAT3; - HostVertexElementByteSize = 3 * sizeof(FLOAT); - } - NeedPatching = TRUE; - break; - case X_D3DVSDT_NORMSHORT4: // 0x41: -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { - DbgVshPrintf("D3DVSDT_NORMSHORT4"); - HostVertexElementDataType = D3DDECLTYPE_SHORT4N; - HostVertexElementByteSize = 4 * sizeof(SHORT); - // No need for patching in D3D9 - } - else -#endif - { - DbgVshPrintf("D3DVSDT_NORMSHORT4 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT4; - HostVertexElementByteSize = 4 * sizeof(FLOAT); - NeedPatching = TRUE; - } - break; - case X_D3DVSDT_NORMPACKED3: // 0x16: - DbgVshPrintf("D3DVSDT_NORMPACKED3 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT3; - HostVertexElementByteSize = 3 * sizeof(FLOAT); - NeedPatching = TRUE; - break; - case X_D3DVSDT_SHORT1: // 0x15: - DbgVshPrintf("D3DVSDT_SHORT1 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_SHORT2; - HostVertexElementByteSize = 2 * sizeof(XTL::SHORT); - NeedPatching = TRUE; - break; - case X_D3DVSDT_SHORT3: // 0x35: - DbgVshPrintf("D3DVSDT_SHORT3 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_SHORT4; - HostVertexElementByteSize = 4 * sizeof(XTL::SHORT); - NeedPatching = TRUE; - break; - case X_D3DVSDT_PBYTE1: // 0x14: - DbgVshPrintf("D3DVSDT_PBYTE1 /* xbox ext. */"); -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { - HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; - HostVertexElementByteSize = 4 * sizeof(BYTE); - } - else -#endif - { - HostVertexElementDataType = D3DDECLTYPE_FLOAT1; - HostVertexElementByteSize = 1 * sizeof(FLOAT); - } - NeedPatching = TRUE; - break; - case X_D3DVSDT_PBYTE2: // 0x24: - DbgVshPrintf("D3DVSDT_PBYTE2 /* xbox ext. */"); -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { - HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; - HostVertexElementByteSize = 4 * sizeof(BYTE); - } - else -#endif - { - HostVertexElementDataType = D3DDECLTYPE_FLOAT2; - HostVertexElementByteSize = 2 * sizeof(FLOAT); - } - NeedPatching = TRUE; - break; - case X_D3DVSDT_PBYTE3: // 0x34: - DbgVshPrintf("D3DVSDT_PBYTE3 /* xbox ext. */"); -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { - HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; - HostVertexElementByteSize = 4 * sizeof(BYTE); - } - else -#endif - { - HostVertexElementDataType = D3DDECLTYPE_FLOAT3; - HostVertexElementByteSize = 3 * sizeof(FLOAT); - } - NeedPatching = TRUE; - break; - case X_D3DVSDT_PBYTE4: // 0x44: - // Test-case : Panzer -#if CXBX_USE_D3D9 - if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { - DbgVshPrintf("D3DVSDT_PBYTE4"); - HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; - HostVertexElementByteSize = 4 * sizeof(BYTE); - // No need for patching when D3D9 supports D3DDECLTYPE_UBYTE4N - } - else -#endif - { - DbgVshPrintf("D3DVSDT_PBYTE4 /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT4; - HostVertexElementByteSize = 4 * sizeof(FLOAT); - NeedPatching = TRUE; - } - break; - case X_D3DVSDT_FLOAT2H: // 0x72: - DbgVshPrintf("D3DVSDT_FLOAT2H /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_FLOAT4; - HostVertexElementByteSize = 4*sizeof(FLOAT); - NeedPatching = TRUE; - break; - case X_D3DVSDT_NONE: // 0x02: - DbgVshPrintf("D3DVSDT_NONE /* xbox ext. */"); - HostVertexElementDataType = D3DDECLTYPE_UNUSED; - // NeedPatching = TRUE; // TODO : This seems to cause regressions? - break; - default: - DbgVshPrintf("Unknown data type for D3DVSD_REG: 0x%02X\n", XboxVertexElementDataType); - break; - } - - // save patching information - XTL::CxbxVertexShaderStreamElement *pCurrentElement = &(pPatchData->pCurrentVertexShaderStreamInfo->VertexElements[pPatchData->pCurrentVertexShaderStreamInfo->NumberOfVertexElements]); - pCurrentElement->XboxType = XboxVertexElementDataType; - pCurrentElement->HostByteSize = HostVertexElementByteSize; - pPatchData->pCurrentVertexShaderStreamInfo->NumberOfVertexElements++; - pPatchData->pCurrentVertexShaderStreamInfo->NeedPatch |= NeedPatching; - -#ifdef CXBX_USE_D3D9 - // TODO -#else - *pRecompiled = D3DVSD_REG(HostVertexRegister, HostVertexElementDataType); -#endif - - pPatchData->pCurrentVertexShaderStreamInfo->HostVertexStride += HostVertexElementByteSize; - - DbgVshPrintf("),\n"); - - if(HostVertexElementDataType == D3DDECLTYPE_UNUSED) - { - EmuWarning("/* WARNING: Fatal type mismatch, no fitting type! */"); - } -} - -static void VshConvertToken_STREAMDATA( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *pRecompiled, - boolean IsFixedFunction, - CxbxVertexShaderPatch *pPatchData -) -{ - using namespace XTL; - if (*pToken & X_D3DVSD_MASK_SKIP) - { - // For D3D9, use D3DDECLTYPE_UNUSED ? - if (*pToken & X_D3DVSD_MASK_SKIPBYTES) { - VshConvertToken_STREAMDATA_SKIPBYTES(pToken, pRecompiled); - } else { - VshConvertToken_STREAMDATA_SKIP(pToken, pRecompiled); - } - } - else // D3DVSD_REG - { - VshConvertToken_STREAMDATA_REG(pToken, pRecompiled, IsFixedFunction, pPatchData); - } -} - -static DWORD VshRecompileToken( - DWORD *pToken, - XTL::D3DVERTEXELEMENT *&pRecompiled, - boolean IsFixedFunction, - CxbxVertexShaderPatch *pPatchData -) -{ - using namespace XTL; - - XTL::DWORD Step = 1; - - switch(VshGetTokenType(*pToken)) - { - case X_D3DVSD_TOKEN_NOP: - VshConvertToken_NOP(pToken, pRecompiled); - break; - case X_D3DVSD_TOKEN_STREAM: - { - VshConvertToken_STREAM(pToken, pRecompiled, pPatchData); - break; - } - case X_D3DVSD_TOKEN_STREAMDATA: - { - VshConvertToken_STREAMDATA(pToken, pRecompiled, IsFixedFunction, pPatchData); - break; - } - case X_D3DVSD_TOKEN_TESSELLATOR: - { - VshConvertToken_TESSELATOR(pToken, pRecompiled, IsFixedFunction); - break; - } - case X_D3DVSD_TOKEN_CONSTMEM: - { - Step = VshConvertToken_CONSTMEM(pToken, pRecompiled); - break; - } - default: - DbgVshPrintf("Unknown token type: %d\n", VshGetTokenType(*pToken)); - break; - } - - return Step; -} - -DWORD XTL::EmuRecompileVshDeclaration -( - DWORD *pDeclaration, - D3DVERTEXELEMENT **ppRecompiledDeclaration, - DWORD *pDeclarationSize, - boolean IsFixedFunction, - CxbxVertexShaderInfo *pVertexShaderInfo -) -{ - // First of all some info: - // We have to figure out which flags are set and then - // we have to patch their params - - // some token values - // 0xFFFFFFFF - end of the declaration - // 0x00000000 - nop (means that this value is ignored) - - // Calculate size of declaration - DWORD DeclarationSize = VshGetDeclarationSize(pDeclaration); -#ifdef CXBX_USE_D3D9 - // For Direct3D9, we need to reserve at least twice the number of elements, as one token can generate two registers (in and out) : - DeclarationSize *= sizeof(D3DVERTEXELEMENT) * 2; -#else - // For Direct3D8, tokens are the same size as on Xbox (DWORD) and are translated in-place : - DeclarationSize *= sizeof(DWORD); -#endif - D3DVERTEXELEMENT *pRecompiled = (D3DVERTEXELEMENT *)malloc(DeclarationSize); -#ifdef CXBX_USE_D3D9 - memset(pRecompiled, 0, DeclarationSize); -#else - memcpy(pRecompiled, pDeclaration, DeclarationSize); -#endif - uint8_t *pRecompiledBufferOverflow = ((uint8_t*)pRecompiled) + DeclarationSize; - *ppRecompiledDeclaration = pRecompiled; - *pDeclarationSize = DeclarationSize; - - CxbxVertexShaderPatch PatchData = { 0 }; - PatchData.pVertexShaderInfoToSet = pVertexShaderInfo; - - DbgVshPrintf("DWORD dwVSHDecl[] =\n{\n"); - - while (*pDeclaration != DEF_VSH_END) - { - if ((uint8*)pRecompiled >= pRecompiledBufferOverflow) { - DbgVshPrintf("Detected buffer-overflow, breaking out...\n"); - break; - } - - DWORD Step = VshRecompileToken(pDeclaration, pRecompiled, IsFixedFunction, &PatchData); - pDeclaration += Step; -#ifndef CXBX_USE_D3D9 - pRecompiled += Step; -#endif - } - - VshEndPreviousStreamPatch(&PatchData); - DbgVshPrintf("\tD3DVSD_END()\n};\n"); - - DbgVshPrintf("// NbrStreams: %d\n", PatchData.pVertexShaderInfoToSet->NumberOfVertexStreams); - - return D3D_OK; -} - -// recompile xbox vertex shader function -extern HRESULT XTL::EmuRecompileVshFunction -( - DWORD *pFunction, - LPD3DXBUFFER *ppRecompiled, - DWORD *pOriginalSize, - boolean bNoReservedConstants, - boolean *pbUseDeclarationOnly, - DWORD *pRecompiledDeclaration -) -{ - VSH_SHADER_HEADER *pShaderHeader = (VSH_SHADER_HEADER*)pFunction; - DWORD *pToken; - boolean EOI = false; - VSH_XBOX_SHADER *pShader = (VSH_XBOX_SHADER*)calloc(1, sizeof(VSH_XBOX_SHADER)); - LPD3DXBUFFER pErrors = NULL; - HRESULT hRet = 0; - - // Build an array of registers that are declared - // This is used to remove instructions that haven't been declared - // as they cause CreateVertexShader to fail - bool declaredRegisters[13] = { false }; - DWORD* pDeclToken = pRecompiledDeclaration; - do { - DWORD regNum = *pDeclToken & X_D3DVSD_VERTEXREGMASK; - if (regNum > 12) { - // Lego Star Wars hits this - LOG_TEST_CASE("RegNum > 12"); - pDeclToken++; - continue; - } - - declaredRegisters[regNum] = true; - pDeclToken++; - } while (*pDeclToken != X_D3DVSD_END()); - - // TODO: support this situation.. - if(pFunction == NULL) - return E_FAIL; - - *ppRecompiled = NULL; - *pOriginalSize = 0; - *pbUseDeclarationOnly = 0; - - if(!pShader) - { - EmuWarning("Couldn't allocate memory for vertex shader conversion buffer"); - return E_OUTOFMEMORY; - } - pShader->ShaderHeader = *pShaderHeader; - switch(pShaderHeader->Version) - { - case VERSION_XVS: - break; - case VERSION_XVSS: - EmuWarning("Might not support vertex state shaders?"); - hRet = E_FAIL; - break; - case VERSION_XVSW: - EmuWarning("Might not support vertex read/write shaders?"); - hRet = E_FAIL; - break; - default: - EmuWarning("Unknown vertex shader version 0x%02X", pShaderHeader->Version); - hRet = E_FAIL; - break; - } - - if(SUCCEEDED(hRet)) - { - - for (pToken = (DWORD*)((uint08*)pFunction + sizeof(VSH_SHADER_HEADER)); !EOI; pToken += VSH_INSTRUCTION_SIZE) - { - VSH_SHADER_INSTRUCTION Inst; - - VshParseInstruction(pToken, &Inst); - VshConvertToIntermediate(&Inst, pShader); - EOI = (boolean)VshGetField(pToken, FLD_FINAL); - } - - // The size of the shader is - *pOriginalSize = (DWORD)pToken - (DWORD)pFunction; - - // Do not attempt to compile empty shaders - if (pShader->IntermediateCount == 0) { - EmuWarning("Skipped empty Vertex Shader"); - return STATUS_INVALID_PARAMETER; - } - - char* pShaderDisassembly = (char*)malloc(pShader->IntermediateCount * 100); // Should be plenty - DbgVshPrintf("-- Before conversion --\n"); - VshWriteShader(pShader, pShaderDisassembly, FALSE); - DbgVshPrintf("%s", pShaderDisassembly); - DbgVshPrintf("-----------------------\n"); - - VshConvertShader(pShader, bNoReservedConstants, declaredRegisters); - VshWriteShader(pShader, pShaderDisassembly, TRUE); - - DbgVshPrintf("-- After conversion ---\n"); - DbgVshPrintf("%s", pShaderDisassembly); - DbgVshPrintf("-----------------------\n"); - - // HACK: Azurik. Prevent Direct3D from trying to assemble this. - if(!strcmp(pShaderDisassembly, "vs.1.1\n")) - { - EmuWarning("Replacing empty vertex shader with fallback"); - - static const char dummy[] = - "vs.1.1\n" - "dp4 oPos.x, v0, c96\n" - "dp4 oPos.y, v0, c97\n" - "dp4 oPos.z, v0, c98\n" - "dp4 oPos.w, v0, c99\n"; - - hRet = D3DXAssembleShader(dummy, - strlen(dummy), - D3DXASM_SKIPVALIDATION, - NULL, - ppRecompiled, - NULL); - } - else - { - - hRet = D3DXAssembleShader(pShaderDisassembly, - strlen(pShaderDisassembly), - D3DXASM_SKIPVALIDATION, - NULL, - ppRecompiled, - &pErrors); - } - - if (FAILED(hRet)) - { - EmuWarning("Couldn't assemble recompiled vertex shader"); - EmuWarning("%s", pErrors->GetBufferPointer()); - } - - if( pErrors ) - pErrors->Release(); - - free(pShaderDisassembly); - } - - free(pShader); - - return hRet; -} - -extern void XTL::FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader) -{ - pVertexShader->VertexShaderInfo.NumberOfVertexStreams = 0; -} - -// Checks for failed vertex shaders, and shaders that would need patching -boolean VshHandleIsValidShader(DWORD Handle) -{ - //printf( "VS = 0x%.08X\n", Handle ); - - XTL::CxbxVertexShader *pVertexShader = XTL::MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - if (pVertexShader) { - if (pVertexShader->Status != 0) - { - return FALSE; - } - /* - for (uint32 i = 0; i < pVertexShader->VertexShaderInfo.NumberOfVertexStreams; i++) - { - if (pVertexShader->VertexShaderInfo.VertexStreams[i].NeedPatch) - { - // Just for caching purposes - pVertexShader->Status = 0x80000001; - return FALSE; - } - } - */ - } - return TRUE; -} - -extern boolean XTL::IsValidCurrentShader(void) -{ - // Dxbx addition : There's no need to call - // XTL_EmuIDirect3DDevice_GetVertexShader, just check g_CurrentXboxVertexShaderHandle : - return VshHandleIsValidShader(g_CurrentXboxVertexShaderHandle); -} - -XTL::CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD Handle) -{ - XTL::CxbxVertexShader *pVertexShader = XTL::MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - - for (uint32 i = 0; i < pVertexShader->VertexShaderInfo.NumberOfVertexStreams; i++) - { - if (pVertexShader->VertexShaderInfo.VertexStreams[i].NeedPatch) - { - return &pVertexShader->VertexShaderInfo; - } - } - return NULL; -} diff --git a/src/CxbxKrnl/EmuD3D8/VertexShader.h b/src/CxbxKrnl/EmuD3D8/VertexShader.h deleted file mode 100644 index fff149950..000000000 --- a/src/CxbxKrnl/EmuD3D8/VertexShader.h +++ /dev/null @@ -1,104 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->VertexShader.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef VERTEXSHADER_H -#define VERTEXSHADER_H - -#include "Cxbx.h" - -// nv2a microcode header -typedef struct -{ - uint08 Type; - uint08 Version; - uint08 NumInst; - uint08 Unknown0; -} -VSH_SHADER_HEADER; - -#define VSH_INSTRUCTION_SIZE 4 -#define VSH_INSTRUCTION_SIZE_BYTES (VSH_INSTRUCTION_SIZE * sizeof(DWORD)) - -// recompile xbox vertex shader declaration -extern DWORD EmuRecompileVshDeclaration -( - DWORD *pDeclaration, - D3DVERTEXELEMENT **ppRecompiledDeclaration, - DWORD *pDeclarationSize, - boolean IsFixedFunction, - XTL::CxbxVertexShaderInfo *pVertexShaderInfo -); - -// recompile xbox vertex shader function -extern HRESULT EmuRecompileVshFunction -( - DWORD *pFunction, - LPD3DXBUFFER *ppRecompiled, - DWORD *pOriginalSize, - boolean bNoReservedConstants, - boolean *pbUseDeclarationOnly, - DWORD *pRecompiledDeclaration -); - -extern void FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader); - -// Checks for failed vertex shaders, and shaders that would need patching -extern boolean IsValidCurrentShader(void); - -// NOTE: Comparing with 0xFFFF breaks some titles (like Kingdom Under Fire) -// The real Xbox checks the D3DFVF_RESERVED0 flag but we can't do that without -// breaking rendering in many titles: CreateVertexShader needs to be unpatched first. -// Instead, we assume any vertex shaders will be allocated by our memory manager and -// exist above the XBE reserved region, not great, but it'l do for now. -inline boolean VshHandleIsFVF(DWORD Handle) { return (Handle > NULL) && (Handle <= XBE_MAX_VA); } -inline boolean VshHandleIsVertexShader(DWORD Handle) { return (Handle > XBE_MAX_VA) ? TRUE : FALSE; } - -inline CxbxVertexShader *MapXboxVertexShaderHandleToCxbxVertexShader(DWORD Handle) -{ - if (VshHandleIsVertexShader(Handle)) { - X_D3DVertexShader *pD3DVertexShader = (X_D3DVertexShader *)Handle; - //assert(pD3DVertexShader != nullptr); - return (CxbxVertexShader *)(pD3DVertexShader->Handle); - } - - return nullptr; -} - -#ifdef _DEBUG_TRACK_VS -#define DbgVshPrintf if(g_bPrintfOn) printf -#else -inline void null_func_vsh(...) { } -#define DbgVshPrintf XTL::null_func_vsh -#endif - -#endif diff --git a/src/CxbxKrnl/EmuDInput.cpp b/src/CxbxKrnl/EmuDInput.cpp deleted file mode 100644 index c470ef56f..000000000 --- a/src/CxbxKrnl/EmuDInput.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDInput.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "DINP" - -#include "Emu.h" -#include "EmuXTL.h" -#include "EmuShared.h" - -// ****************************************************************** -// * Static Variable(s) -// ****************************************************************** -static XBController g_XBController; - -// ****************************************************************** -// * XTL::EmuDInputInit -// ****************************************************************** -bool XTL::EmuDInputInit() -{ - g_EmuShared->GetXBController(&g_XBController); - - g_XBController.ListenBegin(g_hEmuWindow); - - if(g_XBController.HasError()) - return false; - - return true; -} - -// ****************************************************************** -// * XTL::EmuDInputCleanup -// ****************************************************************** -void XTL::EmuDInputCleanup() -{ - g_XBController.ListenEnd(); -} - -//emulated dwPacketNumber for DirectInput controller -DWORD dwPacketNumber_DirectInput = 0; - -// ****************************************************************** -// * XTL::EmuDInputPoll -// ****************************************************************** -void XTL::EmuDInputPoll(XTL::PX_XINPUT_STATE pXboxController) -{ - g_XBController.ListenPoll(pXboxController); - //increment of emulated PacketNumber and report back to Controller. - dwPacketNumber_DirectInput++; - pXboxController->dwPacketNumber = dwPacketNumber_DirectInput; - - if(g_XBController.HasError()) - MessageBox(NULL, g_XBController.GetError().c_str(), "Cxbx-Reloaded [*UNHANDLED!*]", MB_OK); // TODO: Handle this! - - return; -} diff --git a/src/CxbxKrnl/EmuDInput.h b/src/CxbxKrnl/EmuDInput.h deleted file mode 100644 index 313d39c96..000000000 --- a/src/CxbxKrnl/EmuDInput.h +++ /dev/null @@ -1,55 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDInput.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef EMUDINPUT_H -#define EMUDINPUT_H - -#define DIRECTINPUT_VERSION 0x0800 -#include - -// ****************************************************************** -// * patch: DInputInit -// ****************************************************************** -extern bool EmuDInputInit(); - -// ****************************************************************** -// * patch: DInputCleanup -// ****************************************************************** -extern void EmuDInputCleanup(); - -// ****************************************************************** -// * patch: DInputPoll -// ****************************************************************** -extern void EmuDInputPoll(PX_XINPUT_STATE Controller); - -#endif diff --git a/src/CxbxKrnl/EmuDSound.cpp b/src/CxbxKrnl/EmuDSound.cpp deleted file mode 100755 index 1837ad5c0..000000000 --- a/src/CxbxKrnl/EmuDSound.cpp +++ /dev/null @@ -1,4474 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDSound.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * (c) 2017 blueshogun96 -// * (c) 2017-2018 RadWolfie -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -// prevent name collisions -namespace xboxkrnl { - #include -}; - -#define LOG_PREFIX "DSND" - -#include -#include -#include "CxbxKrnl.h" -#include "Emu.h" -#include "EmuFS.h" -#include "EmuShared.h" -#include "EmuXTL.h" - - -#ifndef _DEBUG_TRACE -//#define _DEBUG_TRACE -#include "Logging.h" -#undef _DEBUG_TRACE -#else -#include "Logging.h" -#endif - -#include -#include -#include -#include - -// Temporary APU Timer Functions -// TODO: Move these to LLE APUDevice once we have one! - -#define APU_TIMER_FREQUENCY 48000 -LARGE_INTEGER APUInitialPerformanceCounter; -double NativeToXboxAPU_FactorForPerformanceFrequency = 0; - -void ResetApuTimer() -{ - // Measure current host performance counter and frequency - QueryPerformanceCounter(&APUInitialPerformanceCounter); - NativeToXboxAPU_FactorForPerformanceFrequency = (double)APU_TIMER_FREQUENCY / APUInitialPerformanceCounter.QuadPart; -} - -uint32_t GetAPUTime() -{ - ::LARGE_INTEGER PerformanceCounter; - QueryPerformanceCounter(&PerformanceCounter); - - // Re-Base on the time DirectSoundCreate was called - PerformanceCounter.QuadPart -= APUInitialPerformanceCounter.QuadPart; - // Apply a delta to make it appear to tick at 48khz - PerformanceCounter.QuadPart = (ULONGLONG)(NativeToXboxAPU_FactorForPerformanceFrequency * PerformanceCounter.QuadPart); - return (DWORD)PerformanceCounter.QuadPart; -} - - -// TODO: Tasks need to do for DirectSound HLE -// * Need create patches -// * Ac97CreateMediaObject (Need OOVPA) -// - WmaCreateDecoder (Need OOVPA, not require) Test case: WMAStream sample -// - WmaCreateDecoderEx (Is just a forward to WmaCreateDecoder, nothing else) -// - WmaCreateInMemoryDecoder (Need OOVPA, not require) Test case: WMAInMemory sample -// - WmaCreateInMemoryDecoderEx (Is just a forward to WmaCreateInMemoryDecoder, nothing else) -// * XWmaDecoderCreateMediaObject (Need OOVPA) -// * Missing CDirectSoundStream patch -// * CDirectSoundStream_Set3DVoiceData (new, undocument) -// * CDirectSoundStream_Use3DVoiceData (new, undocument) -// * IDirectSoundStream_QueryInterface (not require) -// * IDirectSoundStream_QueryInterfaceC (not require) -// * Missing IDirectSound patch -// * IDirectSound_Compact (xbox doesn't use this method and cannot make oovpa for it.) -// * IDirectSound_GetTime (not require) -// * IDirectSound_MapBufferData (undocument) -// * IDirectSound_SetCooperativeLevel (xbox doesn't use this method and cannot make oovpa for it.) -// * IDirectSound_UnmapBufferData (undocument) -// * IDirectSound_QueryInterfaceC (not require) -// * IDirectSound_QueryInterface (not require) -// * Missing IDirectSoundBuffer patch -// * IDirectSoundBuffer_Set3DVoiceData (new, undocument) -// * IDirectSoundBuffer_Use3DVoiceData (new, undocument) -// * IDirectSoundBuffer_QueryInterface (not require) -// * IDirectSoundBuffer_QueryInterfaceC (not require) -// * Ixxxxx_ patch might not be a requirement. -// * IDirectSound3DCalculator_Calculate3D -// * IDirectSound3DCalculator_GetMixBinVolumes -// * IDirectSound3DCalculator_GetPanData -// * IDirectSound3DCalculator_GetVoiceData - -// TODO: Tasks need to do for DirectSound LLE -// * Need to map range of 0x0fe800000 to 0xfe87ffff (?) and 0x0fec00000 to 0xfec00fff (?) - -XTL::X_CMcpxStream::_vtbl XTL::X_CMcpxStream::vtbl = -{ - 0xBEEFC001, // 0x00 - 0xBEEFC002, // 0x04 - 0xBEEFC003, // 0x08 - 0xBEEFC004, // 0x0C - &XTL::EMUPATCH(CMcpxStream_Dummy_0x10),// 0x10 -}; - -XTL::X_CDirectSoundStream::_vtbl XTL::X_CDirectSoundStream::vtbl = -{ - &XTL::EMUPATCH(CDirectSoundStream_AddRef), // 0x00 - &XTL::EMUPATCH(CDirectSoundStream_Release), // 0x04 -/* - STDMETHOD(GetInfo)(THIS_ LPXMEDIAINFO pInfo) PURE; -*/ - &XTL::EMUPATCH(CDirectSoundStream_GetInfo), // 0x08 - &XTL::EMUPATCH(CDirectSoundStream_GetStatus), // 0x0C - &XTL::EMUPATCH(CDirectSoundStream_Process), // 0x10 - &XTL::EMUPATCH(CDirectSoundStream_Discontinuity), // 0x14 - &XTL::EMUPATCH(CDirectSoundStream_Flush), // 0x18 - 0xBEEFB003, // 0x1C - 0xBEEFB004, // 0x20 - 0xBEEFB005, // 0x24 - 0xBEEFB006, // 0x28 - 0xBEEFB007, // 0x2C - 0xBEEFB008, // 0x30 - 0xBEEFB009, // 0x34 - 0xBEEFB00A, // 0x38 -}; - -XTL::X_XFileMediaObject::_vtbl XTL::X_XFileMediaObject::vtbl = -{ - &XTL::EMUPATCH(XFileMediaObject_AddRef), // 0x00 - &XTL::EMUPATCH(XFileMediaObject_Release), // 0x04 - &XTL::EMUPATCH(XFileMediaObject_GetInfo), // 0x08 - &XTL::EMUPATCH(XFileMediaObject_GetStatus), // 0x0C - &XTL::EMUPATCH(XFileMediaObject_Process), // 0x10 - &XTL::EMUPATCH(XFileMediaObject_Discontinuity), // 0x14 - 0xBEEFD007, // 0x18 - &XTL::EMUPATCH(XFileMediaObject_Seek), // 0x1C - 0xBEEFD009, // 0x20 - &XTL::EMUPATCH(XFileMediaObject_DoWork), // 0x24 -}; - -/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value. - And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation, - there is chance of failure which contain value greater than 0. - */ - -// size of DirectSound cache max size -#define X_DIRECTSOUND_CACHE_MAX 0x800 - -#define X_DIRECTSOUND_CACHE_COUNT (g_pDSoundBufferCache.size() + g_pDSoundStreamCache.size()) - -//Currently disabled since below may not be needed since under -6,400 is just silence yet accepting up to -10,000 -// Xbox to PC volume ratio format (-10,000 / -6,400 ) -//#define XBOX_TO_PC_VOLUME_RATIO 1.5625 - -// Xbox maximum synch playback audio -#define DSOUND_MAX_SYNCHPLAYBACK_AUDIO 29 - -#define vector_ds_buffer std::vector -#define vector_ds_stream std::vector - -// Static Variable(s) -XBAudio g_XBAudio = XBAudio(); -extern LPDIRECTSOUND8 g_pDSound8 = nullptr; //This is necessary in order to allow share with EmuDSoundInline.hpp -static LPDIRECTSOUNDBUFFER g_pDSoundPrimaryBuffer = nullptr; -//TODO: RadWolfie - How to implement support if primary does not permit it for DSP usage? -static LPDIRECTSOUNDBUFFER8 g_pDSoundPrimaryBuffer8 = nullptr; -static LPDIRECTSOUND3DLISTENER8 g_pDSoundPrimary3DListener8 = nullptr; -vector_ds_buffer g_pDSoundBufferCache; -vector_ds_stream g_pDSoundStreamCache; -static int g_bDSoundCreateCalled = FALSE; -unsigned int g_iDSoundSynchPlaybackCounter = 0; -// Managed memory xbox audio variables -#define X_DS_SGE_COUNT_MAX 2047 -#define X_DS_SGE_PAGE_MAX (4 * ONE_KB) -#define X_DS_SGE_SIZE_MAX (X_DS_SGE_COUNT_MAX * X_DS_SGE_PAGE_MAX) -DWORD g_dwXbMemAllocated = 0; -DWORD g_dwFree2DBuffers = 0; -DWORD g_dwFree3DBuffers = 0; -std::thread dsound_thread; -static void dsound_thread_worker(LPVOID); - -#define RETURN_RESULT_CHECK(hRet) { \ - static bool bPopupShown = false; if (!bPopupShown && hRet) { bPopupShown = true; \ - printf("Return result report: 0x%08X\nIn %s (%s)\n", hRet, __func__, __FILE__); \ - EmuWarning("An issue has been found. Please report game title and console's output of return result," \ - " function, and file name to https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/485"); } return hRet; } - -#include "EmuDSoundInline.hpp" - -#ifdef __cplusplus -extern "C" { -#endif - -void CxbxInitAudio() -{ - g_EmuShared->GetXBAudio(&g_XBAudio); -} - -#ifdef __cplusplus -} -#endif - -// ****************************************************************** -// * patch: DirectSoundCreate -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreate) -( - LPVOID pguidDeviceId, - OUT LPDIRECTSOUND8* ppDirectSound, - LPUNKNOWN pUnknown) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pguidDeviceId) - LOG_FUNC_ARG_OUT(ppDirectSound) - LOG_FUNC_ARG(pUnknown) - LOG_FUNC_END; - - static bool initialized = false; - - HRESULT hRet = DS_OK; - - if (!initialized) { - InitializeCriticalSection(&g_DSoundCriticalSection); - dsound_thread = std::thread(dsound_thread_worker, nullptr); - } - - enterCriticalSection; - - ResetApuTimer(); - - // Set this flag when this function is called - g_bDSoundCreateCalled = TRUE; - - if (!initialized || g_pDSound8 == nullptr) { - hRet = DirectSoundCreate8(&g_XBAudio.GetAudioAdapter(), &g_pDSound8, NULL); - - LPCSTR dsErrorMsg = nullptr; - - switch (hRet) { - case DS_OK: - // Is not a fatal error. - break; - case DSERR_ALLOCATED: - dsErrorMsg = "Audio adapter is already allocated. Possible fault within Cxbx-Reloaded's emulator." - "\n\nPlease report to respective game compatibility issue."; - break; - case DSERR_INVALIDPARAM: - dsErrorMsg = "DirectSoundCreate8 return invalid parameter." - "\n\nPlease report to respective game compatibility issue."; - break; - case DSERR_NOAGGREGATION: - dsErrorMsg = "Audio adapter does not support aggregation." - "\n\nPlease use different audio adapter."; - break; - case DSERR_NODRIVER: - dsErrorMsg = "Please select a valid audio adapter from Cxbx-Reloaded's config audio dialog." - "\n\nThen try again."; - break; - case DSERR_OUTOFMEMORY: - dsErrorMsg = "Unable to allocate DirectSound subsystem class." - "\n\nPlease close any opened application(s) or restart computer before trying again."; - break; - default: - dsErrorMsg = "DirectSoundCreate8 unknown failed: 0x%08X"; - } - - if (dsErrorMsg != nullptr) { - CxbxKrnlCleanup(dsErrorMsg, hRet); - } - - hRet = g_pDSound8->SetCooperativeLevel(g_hEmuWindow, DSSCL_PRIORITY); - - if (hRet != DS_OK) { - CxbxKrnlCleanup("g_pDSound8->SetCooperativeLevel Failed!"); - } - - // clear sound buffer cache - vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); - for (; ppDSBuffer != g_pDSoundBufferCache.end();) { - while (XTL::EMUPATCH(IDirectSoundBuffer_Release)((*ppDSBuffer)) != 0) {}; - ppDSBuffer = g_pDSoundBufferCache.begin(); - } - g_pDSoundBufferCache.reserve(X_DIRECTSOUND_CACHE_MAX); - - // clear sound stream cache - vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); - for (; ppDSStream != g_pDSoundStreamCache.end();) { - while (XTL::EMUPATCH(CDirectSoundStream_Release)((*ppDSStream)) != 0); - ppDSStream = g_pDSoundStreamCache.begin(); - } - g_pDSoundStreamCache.reserve(X_DIRECTSOUND_CACHE_MAX); - - //Create Primary Buffer in order for Xbox's DirectSound to manage complete control of it. - DSBUFFERDESC bufferDesc = { 0 }; - bufferDesc.dwSize = sizeof(DSBUFFERDESC); - bufferDesc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRL3D; //DSBCAPS_CTRLFX is not supported on primary buffer. - bufferDesc.guid3DAlgorithm = GUID_NULL; - - hRet = g_pDSound8->CreateSoundBuffer(&bufferDesc, &g_pDSoundPrimaryBuffer, nullptr); - - if (hRet != DS_OK) { - CxbxKrnlCleanup("Creating primary buffer for DirectSound Failed!"); - } - - /* Quote from MDSN "For the primary buffer, you must use the - * IDirectSoundBuffer interface; IDirectSoundBuffer8 is not available." - */ - // Return E_NOINTERFACE from QueryInterface method, make sense for g_pDSoundPrimaryBuffer - // But how to set DSBCAPS_CTRLFX on primary buffer or should it be set for all current and future cache buffers? - // We need LPDIRECTSOUNDFXI3DL2REVERB8 / IID_IDirectSoundFXI3DL2Reverb8 or use LPDIRECTSOUNDBUFFER8 / IID_IDirectSoundBuffer8 - - hRet = g_pDSoundPrimaryBuffer->QueryInterface(IID_IDirectSound3DListener8, (LPVOID*)&g_pDSoundPrimary3DListener8); - - if (hRet != DS_OK) { - CxbxKrnlCleanup("Creating primary 3D Listener for DirectSound Failed!"); - } - - initialized = true; - } - - // This way we can be sure that this function returns a valid - // DirectSound8 pointer even if we initialized it elsewhere! - if (ppDirectSound != nullptr) { - *ppDirectSound = g_pDSound8; - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSound_AddRef -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(IDirectSound_AddRef) -( - LPDIRECTSOUND8 pThis) -{ - FUNC_EXPORTS; - - return 1; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG uRet = g_pDSound8->AddRef(); - - leaveCriticalSection; - - return uRet; -} - -// ****************************************************************** -// * patch: IDirectSound_Release -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(IDirectSound_Release) -( - LPDIRECTSOUND8 pThis) -{ - FUNC_EXPORTS; - - return 0; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG uRet = g_pDSound8->Release(); - if (uRet == 0) { - g_bDSoundCreateCalled = false; - g_pDSound8 = NULL; - } - - leaveCriticalSection; - - return uRet; -} - -// ****************************************************************** -// * patch: CDirectSound_GetSpeakerConfig -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSound_GetSpeakerConfig) -( - X_CDirectSound* pThis, - OUT PDWORD pdwSpeakerConfig) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwSpeakerConfig) - LOG_FUNC_END; - - *pdwSpeakerConfig = 0; // STEREO - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_SynchPlayback -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SynchPlayback) -( - LPDIRECTSOUND8 pThis) -{ - FUNC_EXPORTS; - - LOG_FUNC_ONE_ARG(pThis); - - return XTL::EMUPATCH(CDirectSound_SynchPlayback)(pThis); -} - -// ****************************************************************** -// * patch: IDirectSound_DownloadEffectsImage -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_DownloadEffectsImage) -( - LPDIRECTSOUND8 pThis, - LPCVOID pvImageBuffer, - DWORD dwImageSize, - PVOID pImageLoc, // TODO: Use this param - PVOID* ppImageDesc) // TODO: Use this param -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pvImageBuffer) - LOG_FUNC_ARG(dwImageSize) - LOG_FUNC_ARG(pImageLoc) - LOG_FUNC_ARG(ppImageDesc) - LOG_FUNC_END; - - // This function is relative to DSP for Interactive 3-D Audio Level 2 (I3DL2) - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: DirectSoundDoWork -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(DirectSoundDoWork)() -{ - FUNC_EXPORTS; - - if (!g_bDSoundCreateCalled) { - return; - } - - enterCriticalSection; - - LOG_FUNC(); - - xboxkrnl::LARGE_INTEGER getTime; - xboxkrnl::KeQuerySystemTime(&getTime); - - vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); - for (; ppDSBuffer != g_pDSoundBufferCache.end(); ppDSBuffer++) { - if ((*ppDSBuffer)->Host_lock.pLockPtr1 == nullptr || (*ppDSBuffer)->EmuBufferToggle != X_DSB_TOGGLE_DEFAULT) { - continue; - } - XTL::X_CDirectSoundBuffer* pThis = *ppDSBuffer; - // However there's a chance of locked buffers has been set which needs to be unlock. - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - pThis->X_BufferCache, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - - // TODO: Do we need this in async thread loop? - if (pThis->Xb_rtPauseEx != 0 && pThis->Xb_rtPauseEx <= getTime.QuadPart) { - pThis->Xb_rtPauseEx = 0LL; - pThis->EmuFlags ^= DSE_FLAG_PAUSE; - pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - } - } - - // Actually, DirectSoundStream need to process buffer packets here. - vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); - for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { - if ((*ppDSStream)->Host_BufferPacketArray.size() == 0) { - continue; - } - X_CDirectSoundStream* pThis = (*ppDSStream); - // TODO: Do we need this in async thread loop? - if (pThis->Xb_rtPauseEx != 0 && pThis->Xb_rtPauseEx <= getTime.QuadPart) { - pThis->Xb_rtPauseEx = 0LL; - pThis->EmuFlags ^= DSE_FLAG_PAUSE; - // Don't call play here, let DSoundStreamProcess deal with it. - } - if ((pThis->EmuFlags & DSE_FLAG_FLUSH_ASYNC) == 0) { - DSoundStreamProcess(pThis); - } else { - // Confirmed flush packet must be done in DirectSoundDoWork only when title is ready. - if (pThis->Xb_rtFlushEx != 0 && pThis->Xb_rtFlushEx <= getTime.QuadPart) { - pThis->Xb_rtFlushEx = 0LL; - DSoundStreamProcess(pThis); - } - } - } - - leaveCriticalSection; - - return; -} -// For Async process purpose only -static void dsound_thread_worker(LPVOID nullPtr) -{ - while (true) { - SwitchToThread(); - - enterCriticalSection; - - vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); - for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { - if ((*ppDSStream)->Host_BufferPacketArray.size() == 0) { - continue; - } - if (((*ppDSStream)->EmuFlags & DSE_FLAG_FLUSH_ASYNC) > 0 && (*ppDSStream)->Xb_rtFlushEx == 0) { - DSoundStreamProcess((*ppDSStream)); - } - } - - leaveCriticalSection; - } -} - -// Kismet given name for RadWolfie's experiment major issue in the mutt. -#define DirectSuicideWork XTL::EMUPATCH(DirectSoundDoWork) - -// ****************************************************************** -// * patch: IDirectSound_SetOrientation -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetOrientation) -( - LPDIRECTSOUND8 pThis, - FLOAT xFront, - FLOAT yFront, - FLOAT zFront, - FLOAT xTop, - FLOAT yTop, - FLOAT zTop, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(xFront) - LOG_FUNC_ARG(yFront) - LOG_FUNC_ARG(zFront) - LOG_FUNC_ARG(xTop) - LOG_FUNC_ARG(yTop) - LOG_FUNC_ARG(zTop) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - HRESULT hRet = DS_OK; - // TODO: (DSound) Should we do restrictive or passive to return actual result back to titles? - // Test case: Jet Set Radio Future, ? - if (xFront == 0.0f && yFront == 0.0f && zFront == 0.0f) { - printf("WARNING: SetOrientation was called with xFront = 0, yFront = 0, and zFront = 0. Current action is ignore call to PC.\n"); - } - if (xTop == 0.0f && yTop == 0.0f && zTop == 0.0f) { - printf("WARNING: SetOrientation was called with xTop = 0, yTop = 0, and zTop = 0. Current action is ignore call to PC.\n"); - } else { - hRet = g_pDSoundPrimary3DListener8->SetOrientation(xFront, yFront, zFront, xTop, yTop, zTop, dwApply); - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSound_SetDistanceFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetDistanceFactor) -( - LPDIRECTSOUND8 pThis, - FLOAT fDistanceFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fDistanceFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, fDistanceFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSound_SetRolloffFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetRolloffFactor) -( - LPDIRECTSOUND8 pThis, - FLOAT fRolloffFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fRolloffFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetRolloffFactor(g_pDSoundPrimary3DListener8, fRolloffFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSound_SetDopplerFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetDopplerFactor) -( - LPDIRECTSOUND8 pThis, - FLOAT fDopplerFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fDopplerFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, fDopplerFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSound_SetI3DL2Listener -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetI3DL2Listener) -( - LPDIRECTSOUND8 pThis, - X_DSI3DL2LISTENER *pds3dl, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pds3dl) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // This function is relative to DSP, although it needs SetFX from LPDIRECTSOUNDBUFFER8 or LPDIRECTSOUNDFXI3DL2REVERB8 class. - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_SetMixBinHeadroom -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetMixBinHeadroom) -( - LPDIRECTSOUND8 pThis, - DWORD dwMixBinMask, - DWORD dwHeadroom) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwMixBinMask) - LOG_FUNC_ARG(dwHeadroom) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMixBins -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBins) -( - LPDIRECTSOUND8 pThis, - PVOID pMixBins) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pMixBins) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMixBinVolumes_12 -// ****************************************************************** -// This revision API was used in XDK 3911 until API had changed in XDK 4039. -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_12) -( - X_CDirectSoundBuffer* pThis, - DWORD dwMixBinMask, - const LONG* alVolumes) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwMixBinMask) - LOG_FUNC_ARG(alVolumes) - LOG_FUNC_END; - - // NOTE: Use this function for XDK 3911 only because the implementation was changed - // somewhere around the December 2001 (4134) update (or earlier, maybe). - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMixBinVolumes_8 -// ****************************************************************** -// This revision is only used in XDK 4039 and higher. -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_8) -( - X_CDirectSoundBuffer* pThis, - X_LPDSMIXBINS pMixBins) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pMixBins) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetMixBinVolumes_8(pThis->EmuDirectSoundBuffer8, pMixBins, pThis->EmuFlags, pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); -} - -// ****************************************************************** -// * patch: IDirectSound_SetPosition -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetPosition) -( - LPDIRECTSOUND8 pThis, - FLOAT x, - FLOAT y, - FLOAT z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - HRESULT hRet = g_pDSoundPrimary3DListener8->SetPosition(x, y, z, dwApply); - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSound_SetVelocity -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetVelocity) -( - LPDIRECTSOUND8 pThis, - FLOAT x, - FLOAT y, - FLOAT z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - HRESULT hRet = g_pDSoundPrimary3DListener8->SetVelocity(x, y, z, dwApply); - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSound_SetAllParameters -// ****************************************************************** -// NOTE: No conversion requirement for XB to PC. -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetAllParameters) -( - LPDIRECTSOUND8 pThis, - LPCDS3DLISTENER pDS3DListenerParameters, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pDS3DListenerParameters) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - HRESULT hRet = g_pDSoundPrimary3DListener8->SetAllParameters(pDS3DListenerParameters, dwApply); - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: CDirectSound_CommitDeferredSettings -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSound_CommitDeferredSettings) -( - X_CDirectSound* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - HRESULT hRet = g_pDSoundPrimary3DListener8->CommitDeferredSettings(); - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: DirectSoundCreateBuffer -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreateBuffer) -( - X_DSBUFFERDESC* pdsbd, - OUT X_CDirectSoundBuffer** ppBuffer) -{ - FUNC_EXPORTS; - - // Research reveal DirectSound creation check is part of the requirement. - if (!g_pDSound8 && !g_bDSoundCreateCalled) { - HRESULT hRet; - - hRet = XTL::EMUPATCH(DirectSoundCreate)(NULL, &g_pDSound8, NULL); - if (hRet != DS_OK) { - CxbxKrnlCleanup("Unable to initialize DirectSound!"); - } - } - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pdsbd) - LOG_FUNC_ARG_OUT(ppBuffer) - LOG_FUNC_END; - - HRESULT hRet = DS_OK; - - //If out of space, return out of memory. - if (X_DIRECTSOUND_CACHE_COUNT == X_DIRECTSOUND_CACHE_MAX || !DSoundSGEMenAllocCheck(pdsbd->dwBufferBytes)) { - - hRet = DSERR_OUTOFMEMORY; - *ppBuffer = xbnullptr; - } else { - - DSBUFFERDESC DSBufferDesc = { 0 }; - - //TODO: Find out the cause for DSBCAPS_MUTE3DATMAXDISTANCE to have invalid arg. - DWORD dwAcceptableMask = 0x00000010 | 0x00000020 | 0x00000080 | 0x00000100 | 0x00020000 | 0x00040000 /*| 0x00080000*/; - - if (pdsbd->dwFlags & (~dwAcceptableMask)) { - EmuWarning("Use of unsupported pdsbd->dwFlags mask(s) (0x%.08X)", pdsbd->dwFlags & (~dwAcceptableMask)); - } - - // HACK: Hot fix for titles not giving CTRL3D flag. Xbox might accept it, however the host does not. - if ((pdsbd->dwFlags & DSBCAPS_MUTE3DATMAXDISTANCE) > 0 && (pdsbd->dwFlags & DSBCAPS_CTRL3D) == 0) { - pdsbd->dwFlags &= ~DSBCAPS_MUTE3DATMAXDISTANCE; - } - - DSBufferDesc.dwSize = sizeof(DSBUFFERDESC); - DSBufferDesc.dwFlags = (pdsbd->dwFlags & dwAcceptableMask) | DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY; - - // TODO: Garbage Collection - *ppBuffer = new X_CDirectSoundBuffer(); - - DSoundBufferSetDefault((*ppBuffer), 0); - (*ppBuffer)->Host_lock = { 0 }; - - DSoundBufferRegionSetDefault(*ppBuffer); - - // We have to set DSBufferDesc last due to EmuFlags must be either 0 or previously written value to preserve other flags. - GeneratePCMFormat(DSBufferDesc, pdsbd->lpwfxFormat, (*ppBuffer)->EmuFlags, pdsbd->dwBufferBytes, &(*ppBuffer)->X_BufferCache, (*ppBuffer)->X_BufferCacheSize); - (*ppBuffer)->EmuBufferDesc = DSBufferDesc; - - DbgPrintf("EmuDSound: DirectSoundCreateBuffer, *ppBuffer := 0x%08X, bytes := 0x%08X\n", *ppBuffer, (*ppBuffer)->EmuBufferDesc.dwBufferBytes); - - DSoundBufferCreate(&DSBufferDesc, (*ppBuffer)->EmuDirectSoundBuffer8); - if (pdsbd->dwFlags & DSBCAPS_CTRL3D) { - DSound3DBufferCreate((*ppBuffer)->EmuDirectSoundBuffer8, (*ppBuffer)->EmuDirectSound3DBuffer8); - (*ppBuffer)->Xb_dwHeadroom = 0; // Default for 3D - } - - DSoundDebugMuteFlag((*ppBuffer)->X_BufferCacheSize, (*ppBuffer)->EmuFlags); - - // Pre-set volume to enforce silence if one of audio codec is disabled. - HybridDirectSoundBuffer_SetVolume((*ppBuffer)->EmuDirectSoundBuffer8, 0L, (*ppBuffer)->EmuFlags, nullptr, - (*ppBuffer)->Xb_VolumeMixbin, (*ppBuffer)->Xb_dwHeadroom); - - g_pDSoundBufferCache.push_back(*ppBuffer); - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSound_CreateSoundBuffer -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CreateSoundBuffer) -( - LPDIRECTSOUND8 pThis, - X_DSBUFFERDESC* pdsbd, - OUT X_CDirectSoundBuffer** ppBuffer, - LPUNKNOWN pUnkOuter) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pdsbd) - LOG_FUNC_ARG_OUT(ppBuffer) - LOG_FUNC_ARG(pUnkOuter) - LOG_FUNC_END; - - return EMUPATCH(DirectSoundCreateBuffer)(pdsbd, ppBuffer); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetBufferData -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetBufferData) -( - X_CDirectSoundBuffer* pThis, - LPVOID pvBufferData, - DWORD dwBufferBytes) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pvBufferData) - LOG_FUNC_ARG(dwBufferBytes) - LOG_FUNC_END; - - - // Release old buffer if exists, this is needed in order to set lock pointer buffer to nullptr. - if (pThis->Host_lock.pLockPtr1 != nullptr) { - - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - xbnullptr, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - } - - //TODO: Current workaround method since dwBufferBytes do set to zero. Otherwise it will produce lock error message. - if (dwBufferBytes == 0) { - - leaveCriticalSection; - return DS_OK; - } - HRESULT hRet = DSERR_OUTOFMEMORY; - DWORD dwStatus; - - // force wait until buffer is stop playing. - pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); - while ((dwStatus & DSBSTATUS_PLAYING) > 0) { - SwitchToThread(); - pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); - } - - // Allocate memory whenever made request internally - if (pvBufferData == xbnullptr && DSoundSGEMenAllocCheck(dwBufferBytes)) { - - // Confirmed it perform a reset to default. - DSoundBufferRegionSetDefault(pThis); - - GenerateXboxBufferCache(pThis->EmuBufferDesc, pThis->EmuFlags, dwBufferBytes, &pThis->X_BufferCache, pThis->X_BufferCacheSize); - - // Copy if given valid pointer. - memcpy_s(pThis->X_BufferCache, pThis->X_BufferCacheSize, pvBufferData, dwBufferBytes); - - pThis->EmuFlags ^= DSE_FLAG_BUFFER_EXTERNAL; - - DSoundDebugMuteFlag(pThis->X_BufferCacheSize, pThis->EmuFlags); - - // Only perform a resize, for lock emulation purpose. - DSoundBufferResizeSetSize(pThis, hRet, dwBufferBytes); - - } else if (pvBufferData != xbnullptr) { - // Free internal buffer cache if exist - if ((pThis->EmuFlags & DSE_FLAG_BUFFER_EXTERNAL) == 0) { - free(pThis->X_BufferCache); - DSoundSGEMemDealloc(pThis->X_BufferCacheSize); - } - pThis->X_BufferCache = pvBufferData; - pThis->X_BufferCacheSize = dwBufferBytes; - pThis->EmuFlags |= DSE_FLAG_BUFFER_EXTERNAL; - - DSoundDebugMuteFlag(pThis->X_BufferCacheSize, pThis->EmuFlags); - - // Only perform a resize, for lock emulation purpose. - DSoundBufferResizeSetSize(pThis, hRet, dwBufferBytes); - - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetPlayRegion -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPlayRegion) -( - X_CDirectSoundBuffer* pThis, - DWORD dwPlayStart, - DWORD dwPlayLength) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwPlayStart) - LOG_FUNC_ARG(dwPlayLength) - LOG_FUNC_END; - - // TODO: Ensure that 4627 & 4361 are intercepting far enough back - // (otherwise pThis is manipulated!) - - pThis->EmuBufferToggle = X_DSB_TOGGLE_PLAY; - pThis->EmuRegionPlayStartOffset = dwPlayStart; - pThis->EmuRegionPlayLength = dwPlayLength; - - // Confirmed play region do overwrite loop region value. - pThis->EmuRegionLoopStartOffset = 0; - pThis->EmuRegionLoopLength = 0; - - DWORD dwStatus; - pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); - HRESULT hRet; - - if ((dwStatus & DSBSTATUS_PLAYING) > 0) { - if ((dwStatus & DSBSTATUS_LOOPING) == 0) { - pThis->EmuDirectSoundBuffer8->Stop(); - DSoundBufferUpdate(pThis, pThis->EmuPlayFlags, hRet); - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); - pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - } - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Lock -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Lock) -( - X_CDirectSoundBuffer* pThis, - DWORD dwOffset, - DWORD dwBytes, - LPVOID* ppvAudioPtr1, - LPDWORD pdwAudioBytes1, - LPVOID* ppvAudioPtr2, - LPDWORD pdwAudioBytes2, - DWORD dwFlags) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwOffset) - LOG_FUNC_ARG(dwBytes) - LOG_FUNC_ARG(ppvAudioPtr1) - LOG_FUNC_ARG(pdwAudioBytes1) - LOG_FUNC_ARG(ppvAudioPtr2) - LOG_FUNC_ARG(pdwAudioBytes2) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_END; - - HRESULT hRet = D3D_OK; - DWORD pcmSize = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwBytes); - DWORD pcmOffset = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwOffset); - - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - pThis->X_BufferCache, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - - if (ppvAudioPtr2 == xbnullptr) { - hRet = pThis->EmuDirectSoundBuffer8->Lock(pcmOffset, pcmSize, &pThis->Host_lock.pLockPtr1, &pThis->Host_lock.dwLockBytes1, - nullptr, 0, dwFlags); - pThis->Host_lock.pLockPtr2 = nullptr; - } else { - hRet = pThis->EmuDirectSoundBuffer8->Lock(pcmOffset, pcmSize, &pThis->Host_lock.pLockPtr1, &pThis->Host_lock.dwLockBytes1, - &pThis->Host_lock.pLockPtr2, &pThis->Host_lock.dwLockBytes2, dwFlags); - } - - if (hRet != DS_OK) { - CxbxKrnlCleanup("DirectSoundBuffer Lock Failed!"); - } - - // Host lock position - pThis->Host_lock.dwLockOffset = pcmOffset; - pThis->Host_lock.dwLockFlags = dwFlags; - pThis->X_lock.dwLockFlags = dwFlags; - - // Emulate to xbox's lock position - pThis->X_lock.dwLockOffset = dwOffset; - *ppvAudioPtr1 = pThis->X_lock.pLockPtr1 = ((LPBYTE)pThis->X_BufferCache + dwOffset); - *pdwAudioBytes1 = pThis->X_lock.dwLockBytes1 = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, pThis->Host_lock.dwLockBytes1); - if (pThis->Host_lock.pLockPtr2 != nullptr) { - *ppvAudioPtr2 = pThis->X_lock.pLockPtr2 = pThis->X_BufferCache; - *pdwAudioBytes2 = pThis->X_lock.dwLockBytes2 = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, pThis->Host_lock.dwLockBytes2); - } else if (ppvAudioPtr2 != xbnullptr) { - *ppvAudioPtr2 = xbnullptr; - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Unlock -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Unlock) -( - X_CDirectSoundBuffer* pThis, - LPVOID ppvAudioPtr1, - DWORD pdwAudioBytes1, - LPVOID ppvAudioPtr2, - DWORD pdwAudioBytes2 - ) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(ppvAudioPtr1) - LOG_FUNC_ARG(pdwAudioBytes1) - LOG_FUNC_ARG(ppvAudioPtr2) - LOG_FUNC_ARG(pdwAudioBytes2) - LOG_FUNC_END; - - // TODO: Find out why pThis->EmuLockPtr1 is nullptr... (workaround atm is to check if it is not a nullptr.) - if (pThis->X_BufferCache != xbnullptr && pThis->Host_lock.pLockPtr1 != nullptr) { - - memcpy_s((PBYTE)pThis->X_BufferCache + pThis->X_lock.dwLockOffset, - pThis->X_BufferCacheSize - pThis->X_lock.dwLockOffset, - pThis->X_lock.pLockPtr1, - pThis->X_lock.dwLockBytes1); - - if (pThis->Host_lock.pLockPtr2 != nullptr) { - memcpy_s(pThis->X_BufferCache, pThis->X_BufferCacheSize, pThis->X_lock.pLockPtr2, pThis->X_lock.dwLockBytes2); - } - } - - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - pThis->X_BufferCache, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetHeadroom -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetHeadroom) -( - X_CDirectSoundBuffer* pThis, - DWORD dwHeadroom) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwHeadroom) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetHeadroom(pThis->EmuDirectSoundBuffer8, dwHeadroom, pThis->Xb_dwHeadroom, - pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->EmuFlags); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetLoopRegion -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetLoopRegion) -( - X_CDirectSoundBuffer* pThis, - DWORD dwLoopStart, - DWORD dwLoopLength) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwLoopStart) - LOG_FUNC_ARG(dwLoopLength) - LOG_FUNC_END; - - // TODO: Ensure that 4627 & 4361 are intercepting far enough back - // (otherwise pThis is manipulated!) - - pThis->EmuRegionLoopStartOffset = dwLoopStart; - pThis->EmuRegionLoopLength = dwLoopLength; - pThis->EmuBufferToggle = X_DSB_TOGGLE_LOOP; - - DWORD dwStatus; - pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); - HRESULT hRet; - - if ((dwStatus & DSBSTATUS_PLAYING) > 0) { - if ((dwStatus & DSBSTATUS_LOOPING) > 0) { - pThis->EmuDirectSoundBuffer8->Stop(); - DSoundBufferUpdate(pThis, pThis->EmuPlayFlags, hRet); - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); - pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - } - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Release -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Release) -( - X_CDirectSoundBuffer* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG uRet = 0; - - //if (!(pThis->EmuFlags & DSE_FLAG_RECIEVEDATA)) { - uRet = pThis->EmuDirectSoundBuffer8->Release(); - - if (uRet == 0) { - if (pThis->EmuDirectSound3DBuffer8 != nullptr) { - pThis->EmuDirectSound3DBuffer8->Release(); - } - - // remove cache entry - vector_ds_buffer::iterator ppDSBuffer = std::find(g_pDSoundBufferCache.begin(), g_pDSoundBufferCache.end(), pThis); - if (ppDSBuffer != g_pDSoundBufferCache.end()) { - g_pDSoundBufferCache.erase(ppDSBuffer); - } - - if (pThis->EmuBufferDesc.lpwfxFormat != nullptr) { - free(pThis->EmuBufferDesc.lpwfxFormat); - } - if (pThis->X_BufferCache != xbnullptr && (pThis->EmuFlags & DSE_FLAG_BUFFER_EXTERNAL) == 0) { - free(pThis->X_BufferCache); - DSoundSGEMemDealloc(pThis->X_BufferCacheSize); - } - - delete pThis; - } - //} - - leaveCriticalSection; - - return uRet; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetPitch -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPitch) -( - X_CDirectSoundBuffer* pThis, - LONG lPitch) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lPitch) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetPitch(pThis->EmuDirectSoundBuffer8, lPitch); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_GetStatus -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetStatus) -( - X_CDirectSoundBuffer* pThis, - OUT LPDWORD pdwStatus) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwStatus) - LOG_FUNC_END; - - DWORD dwStatusXbox = 0, dwStatusHost; - HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatusHost); - - // Conversion is a requirement to xbox. - if (hRet == DS_OK) { - if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { - dwStatusXbox = X_DSBSTATUS_PAUSED; - } else if ((dwStatusHost & DSBSTATUS_PLAYING) > 0) { - dwStatusXbox = X_DSBSTATUS_PLAYING; - } - if ((dwStatusHost & DSBSTATUS_LOOPING) > 0) { - dwStatusXbox |= X_DSBSTATUS_LOOPING; - } - } - - if (pdwStatus != xbnullptr) { - *pdwStatus = dwStatusXbox; - } else { - hRet = DSERR_INVALIDPARAM; - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetCurrentPosition -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetCurrentPosition) -( - X_CDirectSoundBuffer* pThis, - DWORD dwNewPosition) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwNewPosition) - LOG_FUNC_END; - - dwNewPosition = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwNewPosition); - - // NOTE: TODO: This call *will* (by MSDN) fail on primary buffers! - HRESULT hRet = pThis->EmuDirectSoundBuffer8->SetCurrentPosition(dwNewPosition); - - if (hRet != DS_OK) { - EmuWarning("SetCurrentPosition Failed!"); - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_GetCurrentPosition -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetCurrentPosition) -( - X_CDirectSoundBuffer* pThis, - OUT PDWORD pdwCurrentPlayCursor, - OUT PDWORD pdwCurrentWriteCursor) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwCurrentPlayCursor) - LOG_FUNC_ARG_OUT(pdwCurrentWriteCursor) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_GetCurrentPosition(pThis->EmuDirectSoundBuffer8, pdwCurrentPlayCursor, pdwCurrentWriteCursor, pThis->EmuFlags); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Play -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Play) -( - X_CDirectSoundBuffer* pThis, - DWORD dwReserved1, - DWORD dwReserved2, - DWORD dwFlags) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwReserved1) - LOG_FUNC_ARG(dwReserved2) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_END; - - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - pThis->X_BufferCache, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - - if (dwFlags & ~(X_DSBPLAY_LOOPING | X_DSBPLAY_FROMSTART | X_DSBPLAY_SYNCHPLAYBACK)) { - CxbxKrnlCleanup("Unsupported Playing Flags"); - } - pThis->EmuPlayFlags = dwFlags; - - // rewind buffer - if ((dwFlags & X_DSBPLAY_FROMSTART)) { - - pThis->EmuPlayFlags &= ~X_DSBPLAY_FROMSTART; - } - - HRESULT hRet = DS_OK; - - if ((dwFlags & X_DSBPLAY_SYNCHPLAYBACK) > 0) { - //SynchPlayback flag append should only occur in HybridDirectSoundBuffer_Pause function, nothing else is able to do this. - hRet = DSoundBufferSynchPlaybackFlagAdd(pThis->EmuFlags); - pThis->EmuPlayFlags ^= X_DSBPLAY_SYNCHPLAYBACK; - } - - DSoundBufferUpdate(pThis, dwFlags, hRet); - - if (hRet == DS_OK) { - if (dwFlags & X_DSBPLAY_FROMSTART) { - if (pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0) != DS_OK) { - EmuWarning("Rewinding buffer failed!"); - } - } - if ((pThis->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) == 0) { - hRet = pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - } - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Stop -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Stop) -( - X_CDirectSoundBuffer* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - HRESULT hRet = D3D_OK; - - if (pThis != nullptr) { - // TODO : Test Stop (emulated via Stop + SetCurrentPosition(0)) : - hRet = pThis->EmuDirectSoundBuffer8->Stop(); - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_StopEx -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_StopEx) -( - X_CDirectSoundBuffer* pThis, - REFERENCE_TIME rtTimeStamp, - DWORD dwFlags) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(rtTimeStamp) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_END; - - HRESULT hRet = DS_OK; - - //TODO: RadWolfie - Rayman 3 crash at end of first intro for this issue... - // if only return DS_OK, then it works fine until end of 2nd intro it crashed. - - // Do not allow to process - Xbox reject it. - if (dwFlags > X_DSBSTOPEX_ALL) { - hRet = DSERR_INVALIDPARAM; - - // Only flags can be process here. - } else { - // TODO : Test Stop (emulated via Stop + SetCurrentPosition(0)) : - if (dwFlags == X_DSBSTOPEX_IMMEDIATE) { - hRet = pThis->EmuDirectSoundBuffer8->Stop(); - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); - } else { - bool isLooping; - if ((pThis->EmuPlayFlags & X_DSBPLAY_LOOPING) > 0) { - isLooping = true; - } else { - isLooping = false; - } - if ((dwFlags & X_DSBSTOPEX_ENVELOPE) > 0) { - // TODO: How to mock up "release phase"? - } - if ((dwFlags & X_DSBSTOPEX_RELEASEWAVEFORM) > 0) { - // Release from loop region. - pThis->EmuPlayFlags &= ~X_DSBPLAY_LOOPING; - } - DWORD dwValue, dwStatus; - pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); - - if (pThis->EmuBufferToggle != X_DSB_TOGGLE_DEFAULT) { - - pThis->EmuDirectSoundBuffer8->GetCurrentPosition(nullptr, &dwValue); - hRet = pThis->EmuDirectSoundBuffer8->Stop(); - - DSoundBufferResizeUpdate(pThis, pThis->EmuPlayFlags, hRet, 0, pThis->X_BufferCacheSize); - - dwValue += pThis->EmuRegionPlayStartOffset; - if (isLooping) { - dwValue += pThis->EmuRegionLoopStartOffset; - } - - pThis->EmuBufferToggle = X_DSB_TOGGLE_DEFAULT; - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(dwValue); - } - - if (dwStatus & DSBSTATUS_PLAYING) { - pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - } - } - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetVolume -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetVolume) -( - X_CDirectSoundBuffer* pThis, - LONG lVolume) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lVolume) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetVolume(pThis->EmuDirectSoundBuffer8, lVolume, pThis->EmuFlags, &pThis->Xb_Volume, - pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetFrequency -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFrequency) -( - X_CDirectSoundBuffer* pThis, - DWORD dwFrequency) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwFrequency) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetFrequency(pThis->EmuDirectSoundBuffer8, dwFrequency); -} - -// ****************************************************************** -// * patch: DirectSoundCreateStream -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreateStream) -( - X_DSSTREAMDESC* pdssd, - OUT X_CDirectSoundStream** ppStream) -{ - FUNC_EXPORTS; - - // Research reveal DirectSound creation check is part of the requirement. - if (!g_pDSound8 && !g_bDSoundCreateCalled) { - HRESULT hRet; - - hRet = XTL::EMUPATCH(DirectSoundCreate)(NULL, &g_pDSound8, NULL); - if (hRet != DS_OK) { - CxbxKrnlCleanup("Unable to initialize DirectSound!"); - } - } - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pdssd) - LOG_FUNC_ARG_OUT(ppStream) - LOG_FUNC_END; - - HRESULT hRet = DS_OK; - - //If out of space, return out of memory. - if (X_DIRECTSOUND_CACHE_COUNT == X_DIRECTSOUND_CACHE_MAX) { - - hRet = DSERR_OUTOFMEMORY; - *ppStream = xbnullptr; - } else { - // TODO: Garbage Collection - *ppStream = new X_CDirectSoundStream(); - - DSBUFFERDESC DSBufferDesc = { 0 }; - - - DWORD dwAcceptableMask = 0x00000010; // TODO: Note 0x00040000 is being ignored (DSSTREAMCAPS_LOCDEFER) - - if (pdssd->dwFlags & (~dwAcceptableMask)) { - EmuWarning("Use of unsupported pdssd->dwFlags mask(s) (0x%.08X)", pdssd->dwFlags & (~dwAcceptableMask)); - } - DSBufferDesc.dwSize = sizeof(DSBUFFERDESC); - //DSBufferDesc->dwFlags = (pdssd->dwFlags & dwAcceptableMask) | DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2; - DSBufferDesc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GETCURRENTPOSITION2; //aka DSBCAPS_DEFAULT + control position - - if ((pdssd->dwFlags & DSBCAPS_CTRL3D) > 0) { - DSBufferDesc.dwFlags |= DSBCAPS_CTRL3D; - } else { - DSBufferDesc.dwFlags |= DSBCAPS_CTRLPAN; - } - - DSoundBufferSetDefault((*ppStream), DSBPLAY_LOOPING); - (*ppStream)->Xb_rtFlushEx = 0LL; - - // We have to set DSBufferDesc last due to EmuFlags must be either 0 or previously written value to preserve other flags. - GeneratePCMFormat(DSBufferDesc, pdssd->lpwfxFormat, (*ppStream)->EmuFlags, 0, xbnullptr, (*ppStream)->X_BufferCacheSize); - - // Test case: Star Wars: KotOR has one packet greater than 5 seconds worth. Increasing to 10 seconds works out fine, can increase more if need to. - // Allocate at least 10 second worth of bytes in PCM format. - DSBufferDesc.dwBufferBytes = DSBufferDesc.lpwfxFormat->nAvgBytesPerSec * 10; - (*ppStream)->EmuBufferDesc = DSBufferDesc; - - (*ppStream)->Host_dwTriggerRange = (DSBufferDesc.lpwfxFormat->nSamplesPerSec / DSBufferDesc.lpwfxFormat->wBitsPerSample); - - (*ppStream)->X_MaxAttachedPackets = pdssd->dwMaxAttachedPackets; - (*ppStream)->Host_BufferPacketArray.reserve(pdssd->dwMaxAttachedPackets); - (*ppStream)->Host_dwWriteOffsetNext = 0; - (*ppStream)->Host_isProcessing = false; - (*ppStream)->Xb_lpfnCallback = pdssd->lpfnCallback; - (*ppStream)->Xb_lpvContext = pdssd->lpvContext; - //TODO: Implement mixbin variable support. Or just merge pdssd struct into DS Stream class. - - DbgPrintf("EmuDSound: DirectSoundCreateStream, *ppStream := 0x%.08X\n", *ppStream); - - DSoundBufferCreate(&DSBufferDesc, (*ppStream)->EmuDirectSoundBuffer8); - if (DSBufferDesc.dwFlags & DSBCAPS_CTRL3D) { - DSound3DBufferCreate((*ppStream)->EmuDirectSoundBuffer8, (*ppStream)->EmuDirectSound3DBuffer8); - (*ppStream)->Xb_dwHeadroom = 0; // Default for 3D - } - - DSoundDebugMuteFlag((*ppStream)->EmuBufferDesc.dwBufferBytes, (*ppStream)->EmuFlags); - - // Pre-set volume to enforce silence if one of audio codec is disabled. - HybridDirectSoundBuffer_SetVolume((*ppStream)->EmuDirectSoundBuffer8, 0L, (*ppStream)->EmuFlags, nullptr, - (*ppStream)->Xb_VolumeMixbin, (*ppStream)->Xb_dwHeadroom); - - g_pDSoundStreamCache.push_back(*ppStream); - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSound_CreateSoundStream -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CreateSoundStream) -( - LPDIRECTSOUND8 pThis, - X_DSSTREAMDESC* pdssd, - OUT X_CDirectSoundStream** ppStream, - PVOID pUnknown) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pdssd) - LOG_FUNC_ARG_OUT(ppStream) - LOG_FUNC_ARG(pUnknown) - LOG_FUNC_END; - - return EMUPATCH(DirectSoundCreateStream)(pdssd, ppStream);; -} - -// ****************************************************************** -// * patch: CMcpxStream_Dummy_0x10 -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(CMcpxStream_Dummy_0x10)(DWORD dwDummy1, DWORD dwDummy2) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwDummy1) - LOG_FUNC_ARG(dwDummy2) - LOG_FUNC_END; - - // Causes deadlock in Halo... - // TODO: Verify that this is a Vista related problem (I HATE Vista!) -// EmuWarning("EmuCMcpxStream_Dummy_0x10 is ignored!"); - - leaveCriticalSection; - - return; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetVolume -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetVolume) -( - X_CDirectSoundStream* pThis, - LONG lVolume) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lVolume) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetVolume(pThis->EmuDirectSoundBuffer8, lVolume, pThis->EmuFlags, &pThis->Xb_Volume, - pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetRolloffFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetRolloffFactor) -( - X_CDirectSoundStream* pThis, - FLOAT fRolloffFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fRolloffFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: SetRolloffFactor is only supported for host primary buffer's 3D Listener. - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_AddRef -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(CDirectSoundStream_AddRef) -( - X_CDirectSoundStream* pThis) -{ - FUNC_EXPORTS; - - LOG_FUNC_ONE_ARG(pThis); - - return HybridDirectSoundBuffer_AddRef(pThis->EmuDirectSoundBuffer8); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_Release -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(CDirectSoundStream_Release) -( - X_CDirectSoundStream* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG uRet = 0; - if (pThis != 0 && (pThis->EmuDirectSoundBuffer8 != 0)) { - uRet = pThis->EmuDirectSoundBuffer8->Release(); - - if (uRet == 0) { - if (pThis->EmuDirectSound3DBuffer8 != NULL) { - pThis->EmuDirectSound3DBuffer8->Release(); - } - - // remove cache entry - vector_ds_stream::iterator ppDSStream = std::find(g_pDSoundStreamCache.begin(), g_pDSoundStreamCache.end(), pThis); - if (ppDSStream != g_pDSoundStreamCache.end()) { - g_pDSoundStreamCache.erase(ppDSStream); - } - - for (auto buffer = pThis->Host_BufferPacketArray.begin(); buffer != pThis->Host_BufferPacketArray.end();) { - DSoundStreamClearPacket(buffer, XMP_STATUS_RELEASE_CXBXR, nullptr, nullptr, pThis); - } - - if (pThis->EmuBufferDesc.lpwfxFormat != nullptr) { - free(pThis->EmuBufferDesc.lpwfxFormat); - } - // NOTE: Do not release X_BufferCache! X_BufferCache is using xbox buffer. - - delete pThis; - } - } - - leaveCriticalSection; - - return uRet; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_GetInfo -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetInfo) -( - X_CDirectSoundStream* pThis, - OUT LPXMEDIAINFO pInfo) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pInfo) - LOG_FUNC_END; - - // TODO: A (real) implementation? - EmuWarning("EmuDirectSound_CDirectSoundStream_GetInfo is not yet supported!"); - - if (pInfo) { - pInfo->dwFlags = XMO_STREAMF_FIXED_SAMPLE_SIZE; - pInfo->dwInputSize = 0x40000; - pInfo->dwOutputSize = 0x40000; - pInfo->dwMaxLookahead = 0x4000; - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_GetStatus -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetStatus) -( - X_CDirectSoundStream* pThis, - OUT DWORD* pdwStatus) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwStatus) - LOG_FUNC_END; - - DWORD dwStatusXbox = 0, dwStatusHost; - HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatusHost); - - // Convert host to xbox status flag. - if (hRet == DS_OK) { - DWORD testSize = pThis->Host_BufferPacketArray.size(); - if ((dwStatusHost & DSBSTATUS_PLAYING) > 0) { - dwStatusXbox |= X_DSSSTATUS_PLAYING; - - } else { - - if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { - dwStatusXbox |= X_DSSSTATUS_PAUSED; - - // Set to paused when has packet(s) queued and is not processing. - } else if (pThis->Host_BufferPacketArray.size() != 0 && pThis->Host_isProcessing == false) { - dwStatusXbox |= X_DSSSTATUS_PAUSED; - } - - if (pThis->Host_BufferPacketArray.size() == 0) { - dwStatusXbox |= X_DSSSTATUS_STARVED; - - if ((pThis->EmuFlags & DSE_FLAG_ENVELOPE2) > 0) { - dwStatusXbox |= X_DSSSTATUS_ENVELOPECOMPLETE; - } - } - } - if (pThis->Host_BufferPacketArray.size() != pThis->X_MaxAttachedPackets) { - dwStatusXbox |= X_DSSSTATUS_READY; - } - *pdwStatus = dwStatusXbox; - - } else if (pdwStatus != xbnullptr) { - *pdwStatus = 0; - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_Process -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Process) -( - X_CDirectSoundStream *pThis, - PXMEDIAPACKET pInputBuffer, - PXMEDIAPACKET pOutputBuffer) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pInputBuffer) - LOG_FUNC_ARG(pOutputBuffer) - LOG_FUNC_END; - - // Research data: - // * Max packet size permitted is 0x2000 (or 8,192 decimal) of buffer. - // * Somehow other titles are using more than 0x2000 for max size. Am using a hacky host method for now (see pBuffer_data). - - if (pThis->EmuDirectSoundBuffer8 != nullptr) { - - if (pInputBuffer != xbnullptr) { - - // Add packets from title until it gets full. - if (pThis->Host_BufferPacketArray.size() != pThis->X_MaxAttachedPackets) { - host_voice_packet packet_input; - packet_input.xmp_data = *pInputBuffer; - packet_input.xmp_data.dwMaxSize = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, pInputBuffer->dwMaxSize); - if (packet_input.xmp_data.dwMaxSize == 0) { - packet_input.pBuffer_data = nullptr; - } else { - packet_input.pBuffer_data = malloc(packet_input.xmp_data.dwMaxSize); - DSoundSGEMemAlloc(packet_input.xmp_data.dwMaxSize); - } - packet_input.rangeStart = pThis->Host_dwWriteOffsetNext; - pThis->Host_dwWriteOffsetNext += packet_input.xmp_data.dwMaxSize; - if (pThis->EmuBufferDesc.dwBufferBytes <= pThis->Host_dwWriteOffsetNext) { - pThis->Host_dwWriteOffsetNext -= pThis->EmuBufferDesc.dwBufferBytes; - } - packet_input.isWritten = false; - packet_input.isPlayed = false; - - DSoundBufferOutputXBtoHost(pThis->EmuFlags, pThis->EmuBufferDesc, pInputBuffer->pvBuffer, pInputBuffer->dwMaxSize, packet_input.pBuffer_data, packet_input.xmp_data.dwMaxSize); - pThis->Host_BufferPacketArray.push_back(packet_input); - - if (pInputBuffer->pdwStatus != xbnullptr) { - (*pInputBuffer->pdwStatus) = XMP_STATUS_PENDING; - } - if (pInputBuffer->pdwCompletedSize != xbnullptr) { - (*pInputBuffer->pdwCompletedSize) = 0; - } - if (pThis->Host_isProcessing == false && pThis->Host_BufferPacketArray.size() == 1) { - pThis->EmuDirectSoundBuffer8->SetCurrentPosition(packet_input.rangeStart); - } - // Once full it needs to change status to flushed when cannot hold any more packets. - } else { - if (pInputBuffer->pdwStatus != xbnullptr) { - (*pInputBuffer->pdwStatus) = XMP_STATUS_FLUSHED; - } - } - } - - //TODO: What to do with output buffer audio variable? Need test case or functional source code. - // NOTE: pOutputBuffer is reserved, must be set to NULL from titles. - if (pOutputBuffer != xbnullptr) { - LOG_TEST_CASE("pOutputBuffer is not nullptr, please report title test case to issue tracker. Thanks!"); - } - - } else { - if (pInputBuffer != xbnullptr && pInputBuffer->pdwStatus != xbnullptr) { - (*pInputBuffer->pdwStatus) = XMP_STATUS_SUCCESS; - } - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_Discontinuity -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Discontinuity) -( - X_CDirectSoundStream* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - // NOTE: Perform check if has pending data. if so, stop stream. - // default ret = DSERR_GENERIC - - pThis->EmuDirectSoundBuffer8->Stop(); - pThis->Host_isProcessing = false; - - // NOTE: Must reset flags in discontinuity and rtTimeStamps. - pThis->EmuFlags &= ~(DSE_FLAG_PAUSE | DSE_FLAG_FLUSH_ASYNC | DSE_FLAG_ENVELOPE | DSE_FLAG_ENVELOPE2); - DSoundBufferSynchPlaybackFlagRemove(pThis->EmuFlags); - pThis->Xb_rtFlushEx = 0LL; - pThis->Xb_rtPauseEx = 0LL; - - for (auto buffer = pThis->Host_BufferPacketArray.begin(); buffer != pThis->Host_BufferPacketArray.end();) { - DSoundStreamClearPacket(buffer, XMP_STATUS_FLUSHED, pThis->Xb_lpfnCallback, pThis->Xb_lpvContext, pThis); - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_Flush -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Flush) -( - X_CDirectSoundStream* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - DSoundBufferSynchPlaybackFlagRemove(pThis->EmuFlags); - - // Remove flags only (This is the only place it will remove other than FlushEx perform set/remove the flags.) - pThis->EmuFlags &= ~(DSE_FLAG_FLUSH_ASYNC | DSE_FLAG_ENVELOPE | DSE_FLAG_ENVELOPE2); - pThis->Xb_rtFlushEx = 0LL; - - while (DSoundStreamProcess(pThis)); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSound_SynchPlayback -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSound_SynchPlayback) -( - LPDIRECTSOUND8 pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - //TODO: Test case Rayman 3 - Hoodlum Havoc, Battlestar Galactica, Miami Vice, and ...? - - vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); - for (; ppDSBuffer != g_pDSoundBufferCache.end(); ppDSBuffer++) { - if ((*ppDSBuffer)->X_BufferCache == nullptr) { - continue; - } - - if (((*ppDSBuffer)->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { - DSoundBufferSynchPlaybackFlagRemove((*ppDSBuffer)->EmuFlags); - (*ppDSBuffer)->EmuDirectSoundBuffer8->Play(0, 0, (*ppDSBuffer)->EmuPlayFlags); - } - } - - vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); - for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { - if ((*ppDSStream)->Host_BufferPacketArray.size() == 0) { - continue; - } - if (((*ppDSStream)->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { - DSoundBufferSynchPlaybackFlagRemove((*ppDSStream)->EmuFlags); - DSoundStreamProcess((*ppDSStream)); - } - } - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_Pause -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Pause) -( - X_CDirectSoundStream* pThis, - DWORD dwPause) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwPause) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, - pThis->Host_isProcessing, 0LL, pThis->Xb_rtPauseEx); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetHeadroom -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetHeadroom) -( - X_CDirectSoundStream* pThis, - DWORD dwHeadroom) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwHeadroom) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetHeadroom(pThis->EmuDirectSoundBuffer8, dwHeadroom, pThis->Xb_dwHeadroom, - pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->EmuFlags); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetConeAngles -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeAngles) -( - X_CDirectSoundStream* pThis, - DWORD dwInsideConeAngle, - DWORD dwOutsideConeAngle, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwInsideConeAngle) - LOG_FUNC_ARG(dwOutsideConeAngle) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeAngles(pThis->EmuDirectSound3DBuffer8, dwInsideConeAngle, dwOutsideConeAngle, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetConeOutsideVolume -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeOutsideVolume) -( - X_CDirectSoundStream* pThis, - LONG lConeOutsideVolume, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lConeOutsideVolume) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeOutsideVolume(pThis->EmuDirectSound3DBuffer8, lConeOutsideVolume, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetAllParameters -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetAllParameters) -( - X_CDirectSoundStream* pThis, - X_DS3DBUFFER* pc3DBufferParameters, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pc3DBufferParameters) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetAllParameters(pThis->EmuDirectSound3DBuffer8, pc3DBufferParameters, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMaxDistance -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMaxDistance) -( - X_CDirectSoundStream* pThis, - D3DVALUE flMaxDistance, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flMaxDistance) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMaxDistance(pThis->EmuDirectSound3DBuffer8, flMaxDistance, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMinDistance -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMinDistance) -( - X_CDirectSoundStream* pThis, - D3DVALUE fMinDistance, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fMinDistance) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMinDistance(pThis->EmuDirectSound3DBuffer8, fMinDistance, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetVelocity -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetVelocity) -( - X_CDirectSoundStream* pThis, - D3DVALUE x, - D3DVALUE y, - D3DVALUE z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetVelocity(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetConeOrientation -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeOrientation) -( - X_CDirectSoundStream* pThis, - D3DVALUE x, - D3DVALUE y, - D3DVALUE z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeOrientation(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetPosition -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetPosition) -( - X_CDirectSoundStream* pThis, - D3DVALUE x, - D3DVALUE y, - D3DVALUE z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetPosition(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetFrequency -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFrequency) -( - X_CDirectSoundStream* pThis, - DWORD dwFrequency) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwFrequency) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetFrequency(pThis->EmuDirectSoundBuffer8, dwFrequency); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMixBins -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBins) -( - X_CDirectSoundStream* pThis, - PVOID pMixBins) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pMixBins) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return S_OK; -} - -// s+ -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMaxDistance -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMaxDistance) -( - X_CDirectSoundBuffer* pThis, - FLOAT flMaxDistance, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flMaxDistance) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMaxDistance(pThis->EmuDirectSound3DBuffer8, flMaxDistance, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMinDistance -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMinDistance) -( - X_CDirectSoundBuffer* pThis, - FLOAT flMinDistance, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flMinDistance) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMinDistance(pThis->EmuDirectSound3DBuffer8, flMinDistance, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetRolloffFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffFactor) -( - X_CDirectSoundBuffer* pThis, - FLOAT flRolloffFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flRolloffFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: SetRolloffFactor is only supported for host primary buffer's 3D Listener. - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetDistanceFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetDistanceFactor) -( - X_CDirectSoundBuffer* pThis, - FLOAT flDistanceFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flDistanceFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - leaveCriticalSection; - - return HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, flDistanceFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetConeAngles -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeAngles) -( - X_CDirectSoundBuffer* pThis, - DWORD dwInsideConeAngle, - DWORD dwOutsideConeAngle, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwInsideConeAngle) - LOG_FUNC_ARG(dwOutsideConeAngle) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeAngles(pThis->EmuDirectSound3DBuffer8, dwInsideConeAngle, dwOutsideConeAngle, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetConeOrientation -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeOrientation) -( - X_CDirectSoundBuffer* pThis, - FLOAT x, - FLOAT y, - FLOAT z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeOrientation(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetConeOutsideVolume -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeOutsideVolume) -( - X_CDirectSoundBuffer* pThis, - LONG lConeOutsideVolume, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lConeOutsideVolume) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetConeOutsideVolume(pThis->EmuDirectSound3DBuffer8, lConeOutsideVolume, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetPosition -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPosition) -( - X_CDirectSoundBuffer* pThis, - FLOAT x, - FLOAT y, - FLOAT z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetPosition(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetVelocity -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetVelocity) -( - X_CDirectSoundBuffer* pThis, - FLOAT x, - FLOAT y, - FLOAT z, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(x) - LOG_FUNC_ARG(y) - LOG_FUNC_ARG(z) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetVelocity(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetDopplerFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetDopplerFactor) -( - X_CDirectSoundBuffer* pThis, - FLOAT flDopplerFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flDopplerFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, flDopplerFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetI3DL2Source -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetI3DL2Source) -( - X_CDirectSoundBuffer* pThis, - X_DSI3DL2BUFFER* pds3db, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pds3db) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: SetI3DL2Source is using DSFXI3DL2Reverb structure, aka different interface. - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetMode -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMode) -( - X_CDirectSoundBuffer* pThis, - DWORD dwMode, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwMode) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMode(pThis->EmuDirectSound3DBuffer8, dwMode, dwApply); -} - -// +s -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetFormat -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFormat) -( - X_CDirectSoundBuffer* pThis, - LPCWAVEFORMATEX pwfxFormat) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pwfxFormat) - LOG_FUNC_END; - - HRESULT hRet = HybridDirectSoundBuffer_SetFormat(pThis->EmuDirectSoundBuffer8, pwfxFormat, - pThis->EmuBufferDesc, pThis->EmuFlags, - pThis->EmuPlayFlags, pThis->EmuDirectSound3DBuffer8, - 0, pThis->X_BufferCache, pThis->X_BufferCacheSize); - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: DirectSoundUseFullHRTF -// ****************************************************************** -void WINAPI XTL::EMUPATCH(DirectSoundUseFullHRTF) -( - void) -{ - FUNC_EXPORTS; - - //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. - - LOG_FUNC(); - - LOG_IGNORED(); -} - -// ****************************************************************** -// * patch: DirectSoundUseLightHRTF -// ****************************************************************** -void WINAPI XTL::EMUPATCH(DirectSoundUseLightHRTF) -( - void) -{ - FUNC_EXPORTS; - - //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. - - LOG_FUNC(); - - LOG_IGNORED(); -} - -// ****************************************************************** -// * patch: DirectSoundUseFullHRTF4Channel -// ****************************************************************** -void WINAPI XTL::EMUPATCH(DirectSoundUseFullHRTF4Channel) -( - void) -{ - FUNC_EXPORTS; - - //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. - - LOG_FUNC(); - - LOG_IGNORED(); -} - -// ****************************************************************** -// * patch: DirectSoundUseLightHRTF4Channel -// ****************************************************************** -void WINAPI XTL::EMUPATCH(DirectSoundUseLightHRTF4Channel) -( - void) -{ - FUNC_EXPORTS; - - //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. - - LOG_FUNC(); - - LOG_IGNORED(); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetLFO -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetLFO) //Low Frequency Oscillators -( - LPDIRECTSOUNDBUFFER8 pThis, - LPCDSLFODESC pLFODesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pLFODesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetLFO -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetLFO) -( - X_CDirectSoundStream* pThis, - LPCDSLFODESC pLFODesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pLFODesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: XAudioCreateAdpcmFormat -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XAudioCreateAdpcmFormat) -( - WORD nChannels, - DWORD nSamplesPerSec, - LPXBOXADPCMWAVEFORMAT pwfx) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(nChannels) - LOG_FUNC_ARG(nSamplesPerSec) - LOG_FUNC_ARG(pwfx) - LOG_FUNC_END; - - // Fill out the pwfx structure with the appropriate data - pwfx->wfx.wFormatTag = WAVE_FORMAT_XBOX_ADPCM; - pwfx->wfx.nChannels = nChannels; - pwfx->wfx.nSamplesPerSec = nSamplesPerSec; - pwfx->wfx.nAvgBytesPerSec = (nSamplesPerSec*nChannels * 36) / 64; - pwfx->wfx.nBlockAlign = nChannels * 36; - pwfx->wfx.wBitsPerSample = 4; - pwfx->wfx.cbSize = 2; - pwfx->wSamplesPerBlock = 64; - - leaveCriticalSection; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetRolloffCurve -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffCurve) -( - LPDIRECTSOUNDBUFFER8 pThis, - const FLOAT* pflPoints, - DWORD dwPointCount, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pflPoints) - LOG_FUNC_ARG(dwPointCount) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: Individual 3D buffer function. - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - - -// ****************************************************************** -// * patch: IDirectSound_EnableHeadphones -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_EnableHeadphones) -( - LPDIRECTSOUND8 pThis, - BOOL fEnabled) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(fEnabled) - LOG_FUNC_END; - - //Windows Vista and later does not set speaker configuration from SetSpeakerConfig function. - EmuWarning("EmuIDirectSound_EnableHeadphones ignored"); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_AddRef -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(IDirectSoundBuffer_AddRef) -( - X_CDirectSoundBuffer* pThis) -{ - FUNC_EXPORTS; - - LOG_FUNC_ONE_ARG(pThis); - - return HybridDirectSoundBuffer_AddRef(pThis->EmuDirectSoundBuffer8); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Pause -// ****************************************************************** -// Introduced in XDK 4721 revision. -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Pause) -( - X_CDirectSoundBuffer* pThis, - DWORD dwPause) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwPause) - LOG_FUNC_END; - - DSoundGenericUnlock(pThis->EmuFlags, - pThis->EmuDirectSoundBuffer8, - pThis->EmuBufferDesc, - pThis->Host_lock, - pThis->X_BufferCache, - pThis->X_lock.dwLockOffset, - pThis->X_lock.dwLockBytes1, - pThis->X_lock.dwLockBytes2); - - return HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, - 1, 0LL, pThis->Xb_rtPauseEx); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_PauseEx -// ****************************************************************** -// Introduced in XDK 4721 revision. -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_PauseEx) -( - X_CDirectSoundBuffer *pThis, - REFERENCE_TIME rtTimestamp, - DWORD dwPause) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(rtTimestamp) - LOG_FUNC_ARG(dwPause) - LOG_FUNC_END; - - HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, - 1, rtTimestamp, pThis->Xb_rtPauseEx); - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSound_GetOutputLevels -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetOutputLevels) -( - LPDIRECTSOUND8* pThis, - OUT X_DSOUTPUTLEVELS* pOutputLevels, - BOOL bResetPeakValues) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pOutputLevels) - LOG_FUNC_ARG(bResetPeakValues) - LOG_FUNC_END; - - // TODO: Anything? Either way, I've never seen a game to date use this... - - // NOTE: It ask for access to real time output (require capture device I believe). - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetEG -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetEG) -( - X_CDirectSoundStream* pThis, - LPVOID pEnvelopeDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pEnvelopeDesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_FlushEx -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_FlushEx) -( - X_CDirectSoundStream* pThis, - REFERENCE_TIME rtTimeStamp, - DWORD dwFlags) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(rtTimeStamp) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_END; - - HRESULT hRet = DSERR_INVALIDPARAM; - - // Cannot use rtTimeStamp here, it must be flush. - if (dwFlags == X_DSSFLUSHEX_IMMEDIATE) { - - hRet = XTL::EMUPATCH(CDirectSoundStream_Flush)(pThis); - - // Remaining flags require X_DSSFLUSHEX_ASYNC to be include. - } else if ((dwFlags & X_DSSFLUSHEX_ASYNC) > 0) { - - pThis->EmuFlags |= DSE_FLAG_FLUSH_ASYNC; - pThis->Xb_rtFlushEx = rtTimeStamp; - - // Set or remove flags (This is the only place it will set/remove other than Flush perform remove the flags.) - if ((dwFlags & X_DSSFLUSHEX_ENVELOPE) > 0) { - pThis->EmuFlags |= DSE_FLAG_ENVELOPE; - } else { - pThis->EmuFlags ^= DSE_FLAG_ENVELOPE; - } - if ((dwFlags & X_DSSFLUSHEX_ENVELOPE2) > 0) { - pThis->EmuFlags |= DSE_FLAG_ENVELOPE2; - } else { - pThis->EmuFlags ^= DSE_FLAG_ENVELOPE2; - } - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMode -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMode) -( - X_CDirectSoundStream* pThis, - DWORD dwMode, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwMode) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetMode(pThis->EmuDirectSound3DBuffer8, dwMode, dwApply); -} - -// ****************************************************************** -// * patch: XAudioDownloadEffectsImage -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(XAudioDownloadEffectsImage) -( - LPCSTR pszImageName, - LPVOID pImageLoc, - DWORD dwFlags, - LPVOID* ppImageDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pszImageName) - LOG_FUNC_ARG(pImageLoc) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_ARG(ppImageDesc) - LOG_FUNC_END; - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetFilter -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFilter) -( - LPVOID pThis, - X_DSFILTERDESC* pFilterDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pFilterDesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetFilter -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFilter) -( - X_CDirectSoundStream* pThis, - X_DSFILTERDESC* pFilterDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pFilterDesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - - -// ****************************************************************** -// * patch: IDirectSoundBuffer_PlayEx -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_PlayEx) -( - X_CDirectSoundBuffer* pThis, - REFERENCE_TIME rtTimeStamp, - DWORD dwFlags) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(rtTimeStamp) - LOG_FUNC_ARG(dwFlags) - LOG_FUNC_END; - - //TODO: Need implement support for rtTimeStamp. - if (rtTimeStamp != 0) { - EmuWarning("Not implemented for rtTimeStamp greater than 0 of %08d", rtTimeStamp); - } - - HRESULT hRet = XTL::EMUPATCH(IDirectSoundBuffer_Play)(pThis, NULL, NULL, dwFlags); - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSound_GetCaps -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetCaps) -( - X_CDirectSound* pThis, - OUT X_DSCAPS* pDSCaps) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pDSCaps) - LOG_FUNC_END; - - // Convert PC -> Xbox - if (pDSCaps) { - pDSCaps->dwFreeBufferSGEs = DSoundSGEFreeBuffer(); - // To prevent pass down overflow size. - pDSCaps->dwMemoryAllocated = (X_DS_SGE_SIZE_MAX < g_dwXbMemAllocated ? X_DS_SGE_SIZE_MAX : g_dwXbMemAllocated); - - // TODO: What are the max values for 2D and 3D Buffers? Once discover, then perform real time update in global variable. - pDSCaps->dwFree2DBuffers = (pDSCaps->dwFreeBufferSGEs == 0 ? 0 : 0x200 /* TODO: Replace me to g_dwFree2DBuffers*/ ); - pDSCaps->dwFree3DBuffers = (pDSCaps->dwFreeBufferSGEs == 0 ? 0 : 0x200 /* TODO: Replace me to g_dwFree3DBuffers*/ ); - - DbgPrintf("X_DSCAPS: dwFree2DBuffers = %8X | dwFree3DBuffers = %8X | dwFreeBufferSGEs = %08X | dwMemAlloc = %08X\n", pDSCaps->dwFree2DBuffers, pDSCaps->dwFree3DBuffers, pDSCaps->dwFreeBufferSGEs, pDSCaps->dwMemoryAllocated); - } - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetPitch -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetPitch) -( - X_CDirectSoundStream* pThis, - LONG lPitch) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lPitch) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetPitch(pThis->EmuDirectSoundBuffer8, lPitch); -} - -// ****************************************************************** -// * patch: DirectSoundGetSampleTime -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(DirectSoundGetSampleTime)() -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC(); - - DWORD dwRet = GetAPUTime(); - - leaveCriticalSection; - - return dwRet; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMixBinVolumes_12 -// This revision API was used in XDK 3911 until API had changed in XDK 4039. -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_12) -( - X_CDirectSoundStream* pThis, - DWORD dwMixBinMask, - const LONG* alVolumes) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwMixBinMask) - LOG_FUNC_ARG(alVolumes) - LOG_FUNC_END; - - // NOTE: Use this function for XDK 3911 only because the implementation was changed - // somewhere around the March 2002 (4361) update (or earlier, maybe). - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetMixBinVolumes_8 -// ****************************************************************** -// This revision API is only used in XDK 4039 and higher. -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_8) -( - X_CDirectSoundStream* pThis, - X_LPDSMIXBINS pMixBins) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pMixBins) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetMixBinVolumes_8(pThis->EmuDirectSoundBuffer8, pMixBins, pThis->EmuFlags, pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetI3DL2Source -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetI3DL2Source) -( - X_CDirectSoundStream* pThis, - X_DSI3DL2BUFFER* pds3db, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pds3db) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: SetI3DL2Source is using DSFXI3DL2Reverb structure, aka different interface. - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetAllParameters -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetAllParameters) -( - X_CDirectSoundBuffer* pThis, - X_DS3DBUFFER* pc3DBufferParameters, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pc3DBufferParameters) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DBuffer_SetAllParameters(pThis->EmuDirectSound3DBuffer8, pc3DBufferParameters, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream::SetFormat -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFormat) -( - X_CDirectSoundStream* pThis, - LPCWAVEFORMATEX pwfxFormat) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pwfxFormat) - LOG_FUNC_END; - - pThis->Host_isProcessing = false; - pThis->EmuDirectSoundBuffer8->Stop(); - - for (auto buffer = pThis->Host_BufferPacketArray.begin(); buffer != pThis->Host_BufferPacketArray.end();) { - // TODO: Also need to pass down callback and context as well? - DSoundStreamClearPacket(buffer, XMP_STATUS_FLUSHED, nullptr, nullptr, pThis); - } - - HRESULT hRet = HybridDirectSoundBuffer_SetFormat(pThis->EmuDirectSoundBuffer8, pwfxFormat, pThis->EmuBufferDesc, - pThis->EmuFlags, pThis->EmuPlayFlags, pThis->EmuDirectSound3DBuffer8, - 0, pThis->X_BufferCache, pThis->X_BufferCacheSize); - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetOutputBuffer -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetOutputBuffer) -( - X_CDirectSoundBuffer* pThis, - X_CDirectSoundBuffer* pOutputBuffer) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pOutputBuffer) - LOG_FUNC_END; - - // NOTE: SetOutputBuffer is not possible in PC's DirectSound due to 3D controller requirement on ouput buffer to work simultaneously. - // Test case: MultiPass sample - // Best to emulate this LLE instead of HLE. - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetOutputBuffer -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetOutputBuffer) -( - X_CDirectSoundStream* pThis, - X_CDirectSoundBuffer* pOutputBuffer) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pOutputBuffer) - LOG_FUNC_END; - - // NOTE: SetOutputBuffer is not possible in PC's DirectSound due to 3D controller requirement on ouput buffer to work simultaneously. - // Test case: Red Faction 2 - // Best to emulate this LLE instead of HLE. - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: XFileCreaeMediaObjectEx -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectEx) -( - HANDLE hFile, - OUT void** ppMediaObject) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hFile) - LOG_FUNC_ARG_OUT(ppMediaObject) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return E_FAIL; -} - -// ****************************************************************** -// * patch: XWaveFileCreateMediaObject -// ****************************************************************** -// NOTE: Does not require any patch. -HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObject) -( - LPCSTR pszFileName, - LPCWAVEFORMATEX* ppwfxFormat, - OUT void** ppMediaObject) //XFileMediaObject, include XMediaObject interface -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pszFileName) - LOG_FUNC_ARG(ppwfxFormat) - LOG_FUNC_ARG_OUT(ppMediaObject) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return E_FAIL; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetEG -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetEG) -( - X_CDirectSoundBuffer* pThis, - LPVOID pEnvelopeDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pEnvelopeDesc) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_GetEffectData -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetEffectData) -( - X_CDirectSound* pThis, - DWORD dwEffectIndex, - DWORD dwOffset, - OUT LPVOID pvData, - DWORD dwDataSize) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwEffectIndex) - LOG_FUNC_ARG(dwOffset) - LOG_FUNC_ARG_OUT(pvData) - LOG_FUNC_ARG(dwDataSize) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - /* RadWolfie: Should not allocate memory, xbox xbe is just asking for input data, not allocate then input data... - if (!pvData) { - pvData = malloc(dwDataSize); // TODO : FIXME : Shouldn't this be : *pvData = ... ?!? - }*/ - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_SetNotificationPositions -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetNotificationPositions) -( - X_CDirectSoundBuffer* pThis, - DWORD dwNotifyCount, - LPCDSBPOSITIONNOTIFY paNotifies) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwNotifyCount) - LOG_FUNC_ARG(paNotifies) - LOG_FUNC_END; - - HRESULT hRet = DSERR_INVALIDPARAM; - - // If we have a valid buffer, query a PC IDirectSoundNotify pointer and - // use the paramaters as is since they are directly compatible, then release - // the pointer. Any buffer that uses this *MUST* be created with the - // DSBCAPS_CTRLPOSITIONNOTIFY flag! - - IDirectSoundNotify* pNotify = nullptr; - - if (pThis) { - if (pThis->EmuDirectSoundBuffer8) { - hRet = pThis->EmuDirectSoundBuffer8->QueryInterface(IID_IDirectSoundNotify8, (LPVOID*)&pNotify); - if (hRet == DS_OK) { - hRet = pNotify->SetNotificationPositions(dwNotifyCount, paNotifies); - if (hRet != DS_OK) { - EmuWarning("Could not set notification position(s)!"); - } - - pNotify->Release(); - } else { - EmuWarning("Could not create notification interface!"); - } - } - } - - leaveCriticalSection; - - RETURN_RESULT_CHECK(hRet); -} - -// ****************************************************************** -// * patch: CDirectSoundStream::SetRolloffCurve -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetRolloffCurve) -( - X_CDirectSoundBuffer* pThis, - const FLOAT* pflPoints, - DWORD dwPointCount, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pflPoints) - LOG_FUNC_ARG(dwPointCount) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_SetEffectData -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetEffectData) -( - LPVOID pThis, - DWORD dwEffectIndex, - DWORD dwOffset, - LPCVOID pvData, - DWORD dwDataSize, - DWORD dwApply) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwEffectIndex) - LOG_FUNC_ARG(dwOffset) - LOG_FUNC_ARG(pvData) - LOG_FUNC_ARG(dwDataSize) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - // NOTE: DSP relative function - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_Use3DVoiceData -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Use3DVoiceData) -( - LPVOID pThis, - LPUNKNOWN pUnknown) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pUnknown) - LOG_FUNC_END; - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: XFileCreateMediaObjectAsync -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectAsync) -( - HANDLE hFile, - DWORD dwMaxPackets, - OUT void** ppMediaObject) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hFile) - LOG_FUNC_ARG(dwMaxPackets) - LOG_FUNC_ARG_OUT(ppMediaObject) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - *ppMediaObject = new X_XFileMediaObject(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: XFileMediaObject_Seek -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Seek) -( - X_XFileMediaObject* pThis, - LONG lOffset, - DWORD dwOrigin, - LPDWORD pdwAbsolute) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lOffset) - LOG_FUNC_ARG(dwOrigin) - LOG_FUNC_ARG(pdwAbsolute) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: XFileMediaObject_DoWork -// ****************************************************************** -// NOTE: Does not require a patch. -VOID WINAPI XTL::EMUPATCH(XFileMediaObject_DoWork)(X_XFileMediaObject* pThis) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; -} - -// ****************************************************************** -// * patch: XFileMediaObject_GetStatus -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetStatus) -( - X_XFileMediaObject* pThis, - OUT LPDWORD pdwStatus) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwStatus) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: XFileMediaObject_GetInfo -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetInfo) -( - X_XFileMediaObject* pThis, - OUT XMEDIAINFO* pInfo) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pInfo) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: XFileMediaObject_Process -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Process) -( - X_XFileMediaObject* pThis, - LPXMEDIAPACKET pInputBuffer, - LPXMEDIAPACKET pOutputBuffer) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pInputBuffer) - LOG_FUNC_ARG(pOutputBuffer) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: XFileMediaObject_AddRef -// ****************************************************************** -// NOTE: Does not require a patch. -ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_AddRef) -( - X_XFileMediaObject* pThis) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG Ret = 0; - - if (pThis) { // TODO : this should be an assert() - Ret = ++(pThis->EmuRefCount); - } - - leaveCriticalSection; - - return Ret; -} - -// ****************************************************************** -// * patch: XFileMediaObject_Release -// ****************************************************************** -// NOTE: Does not require a patch. -ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_Release) -( - X_XFileMediaObject* pThis) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - ULONG Ret = 0; - - if (pThis) { // TODO : this should be an assert() - Ret = --(pThis->EmuRefCount); - if (Ret == 0) { - delete pThis; - } - } - - leaveCriticalSection; - - return Ret; -} - -// ****************************************************************** -// * patch: XFileMediaObject_Discontinuity -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Discontinuity) -( - X_XFileMediaObject *pThis) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_GetSpeakerConfig -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetSpeakerConfig) -( - X_CDirectSound* pThis, - OUT LPDWORD* pdwSpeakerConfig) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pdwSpeakerConfig) - LOG_FUNC_END; - - //For now, let's set it to stereo. - *pdwSpeakerConfig = X_DSSPEAKER_STEREO; - - leaveCriticalSection; - - return S_OK; -} - -// ****************************************************************** -// * patch: IDirectSound_CommitDeferredSettings -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CommitDeferredSettings) -( - X_CDirectSound* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - HRESULT hRet = DS_OK; - if (g_pDSoundPrimary3DListener8 != nullptr) { - hRet = g_pDSoundPrimary3DListener8->CommitDeferredSettings(); - } - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: IDirectSound_CommitEffectData -// ****************************************************************** -// This API is used relative with DSP effect. -HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CommitEffectData) -( - X_CDirectSound* pThis) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_ONE_ARG(pThis); - - // NOTE: DSP relative function. - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_PauseEx -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_PauseEx) -( - X_CDirectSoundStream *pThis, - REFERENCE_TIME rtTimestamp, - DWORD dwPause) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(rtTimestamp) - LOG_FUNC_ARG(dwPause) - LOG_FUNC_END; - - // This function wasn't part of the XDK until 4721. (Same as IDirectSoundBuffer_PauseEx?) - // TODO: Implement time stamp feature (a thread maybe?) - - HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, - pThis->Host_isProcessing, rtTimestamp, pThis->Xb_rtPauseEx); - - leaveCriticalSection; - - return hRet; -} - -// ****************************************************************** -// * patch: XFileCreaeMediaObject -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObject) -( - LPCSTR pstrFileName, - DWORD dwDesiredAccess, - DWORD dwShareMode, - DWORD dwCreationDisposition, - DWORD dwFlagsAndAttributes, - OUT void** ppMediaObject) -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pstrFileName) - LOG_FUNC_ARG(dwDesiredAccess) - LOG_FUNC_ARG(dwShareMode) - LOG_FUNC_ARG(dwCreationDisposition) - LOG_FUNC_ARG(dwFlagsAndAttributes) - LOG_FUNC_ARG_OUT(ppMediaObject) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return E_FAIL; -} - -// ****************************************************************** -// * patch: XWaveFileCreateMediaObjectEx -// ****************************************************************** -// NOTE: Does not require a patch. -HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObjectEx) -( - LPCSTR pszFileName, - HANDLE hFile, - OUT void** ppMediaObject) //XWaveFileMediaObject, include XFileMediaObject and XMediaObject interfaces -{ - //FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pszFileName) - LOG_FUNC_ARG(hFile) - LOG_FUNC_ARG_OUT(ppMediaObject) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return E_FAIL; -} - -// ****************************************************************** -// * patch: XAudioSetEffectData -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(XAudioSetEffectData) -( - DWORD dwEffectIndex, - void* pDesc, - void* pRawDesc) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwEffectIndex) - LOG_FUNC_ARG(pDesc) - LOG_FUNC_ARG(pRawDesc) - LOG_FUNC_END; - - LOG_NOT_SUPPORTED(); - - leaveCriticalSection; - - return E_FAIL; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetDistanceFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetDistanceFactor) -( - X_CDirectSoundStream* pThis, - FLOAT flDistanceFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flDistanceFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, flDistanceFactor, dwApply); -} - -// ****************************************************************** -// * patch: CDirectSoundStream_SetDopplerFactor -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetDopplerFactor) -( - X_CDirectSoundStream* pThis, - FLOAT flDopplerFactor, - DWORD dwApply) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(flDopplerFactor) - LOG_FUNC_ARG(dwApply) - LOG_FUNC_END; - - return HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, flDopplerFactor, dwApply); -} - -// ****************************************************************** -// * patch: IDirectSoundBuffer_GetVoiceProperties -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetVoiceProperties) -( - X_CDirectSoundBuffer* pThis, - OUT void* pVoiceProps) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pVoiceProps) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: CDirectSoundStream_GetVoiceProperties -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetVoiceProperties) -( - X_CDirectSoundStream* pThis, - OUT void* pVoiceProps) -{ - FUNC_EXPORTS; - - enterCriticalSection; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(pVoiceProps) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - leaveCriticalSection; - - return DS_OK; -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetVolume -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetVolume) -( - X_CDirectSoundStream* pThis, - LONG lVolume) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lVolume) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetVolume(pThis->EmuDirectSoundBuffer8, lVolume, pThis->EmuFlags, &pThis->Xb_Volume, - pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetPitch -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetPitch) -( - X_CDirectSoundStream* pThis, - LONG lPitch) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(lPitch) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetPitch(pThis->EmuDirectSoundBuffer8, lPitch); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetLFO -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetLFO) -( - X_CDirectSoundStream* pThis, - LPCDSLFODESC pLFODesc) { - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pLFODesc) - LOG_FUNC_END; - - return XTL::EMUPATCH(CDirectSoundStream_SetLFO)(pThis, pLFODesc); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetEG -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetEG) -( - X_CDirectSoundStream* pThis, - LPVOID pEnvelopeDesc) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pEnvelopeDesc) - LOG_FUNC_END; - - return XTL::EMUPATCH(CDirectSoundStream_SetEG)(pThis, pEnvelopeDesc); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetFilter -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetFilter) -( - X_CDirectSoundStream* pThis, - X_DSFILTERDESC* pFilterDesc) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pFilterDesc) - LOG_FUNC_END; - - return XTL::EMUPATCH(CDirectSoundStream_SetFilter)(pThis, pFilterDesc); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetHeadroom -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetHeadroom) -( - X_CDirectSoundStream* pThis, - DWORD dwHeadroom) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwHeadroom) - LOG_FUNC_END; - - return XTL::EMUPATCH(CDirectSoundStream_SetHeadroom)(pThis, dwHeadroom); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetFrequency -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetFrequency) -( - X_CDirectSoundStream* pThis, - DWORD dwFrequency) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(dwFrequency) - LOG_FUNC_END; - - return HybridDirectSoundBuffer_SetFrequency(pThis->EmuDirectSoundBuffer8, dwFrequency); -} - -// ****************************************************************** -// * patch: IDirectSoundStream_SetMixBins -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetMixBins) -( - X_CDirectSoundStream* pThis, - PVOID pMixBins) -{ - FUNC_EXPORTS; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(pMixBins) - LOG_FUNC_END; - - return XTL::EMUPATCH(CDirectSoundStream_SetMixBins)(pThis, pMixBins); -} diff --git a/src/CxbxKrnl/EmuKrnlKi.cpp b/src/CxbxKrnl/EmuKrnlKi.cpp deleted file mode 100644 index 11103eead..000000000 --- a/src/CxbxKrnl/EmuKrnlKi.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->src->CxbxKrnl->EmuKrnlKi.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * (c) 2016 Patrick van Logchem -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "KRNL" - -// prevent name collisions -namespace xboxkrnl -{ -#include // For KeBugCheck, etc. -}; - -#include "Logging.h" // For LOG_FUNC() -#include "EmuKrnlLogging.h" - -//#include "EmuKrnl.h" // For InitializeListHead(), etc. - -xboxkrnl::BOOLEAN KiInsertTimerTable( - IN xboxkrnl::LARGE_INTEGER Interval, - xboxkrnl::ULONGLONG, - IN xboxkrnl::PKTIMER Timer -) -{ - // TODO - return TRUE; -} - -xboxkrnl::BOOLEAN KiInsertTreeTimer( - IN xboxkrnl::PKTIMER Timer, - IN xboxkrnl::LARGE_INTEGER Interval -) -{ - // Is the given time absolute (indicated by a positive number)? - if (Interval.u.HighPart >= 0) { - // Convert absolute time to a time relative to the system time : - xboxkrnl::LARGE_INTEGER SystemTime; - xboxkrnl::KeQuerySystemTime(&SystemTime); - Interval.QuadPart = SystemTime.QuadPart - Interval.QuadPart; - if (Interval.u.HighPart >= 0) { - // If the relative time is already passed, return without inserting : - Timer->Header.Inserted = FALSE; - Timer->Header.SignalState = TRUE; - return FALSE; - } - - Timer->Header.Absolute = TRUE; - } - else - // Negative intervals are relative, not absolute : - Timer->Header.Absolute = FALSE; - - if (Timer->Period == 0) - Timer->Header.SignalState = FALSE; - - Timer->Header.Inserted = TRUE; - return KiInsertTimerTable(Interval, xboxkrnl::KeQueryInterruptTime(), Timer); -} diff --git a/src/CxbxKrnl/EmuRsa.cpp b/src/CxbxKrnl/EmuRsa.cpp deleted file mode 100644 index a118763db..000000000 --- a/src/CxbxKrnl/EmuRsa.cpp +++ /dev/null @@ -1,1637 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->EmuRsa.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2018 ergo720 -// * -// * All rights reserved -// * -// ****************************************************************** - -// Acknowledgment: -// This rsa implementation is directly borrowed from the xbedump tool of XQEMU (GPLv2 license) -// https://github.com/xqemu/xbedump - -#include "EmuRsa.h" -#include "Emu.h" // For EmuWarning -#include -#include - - -/* 2^(16*MAX_SHORTS)-1 will fit into a giant, but take care: -* one usually has squares, etc. of giants involved, and -* every intermediate giant in a calculation must fit into -* this many shorts. Thus, if you want systematically to effect -* arithmetic on B-bit operands, you need MAX_SHORTS > B/8, -* preferably a tad larger than this; e.g. MAX_SHORTS > B/7. -*/ -#define MAX_SHORTS (1<<19) -#define GIANT_INFINITY (-1) -#define FA 0 -#define TR 1 -#define TWOPI (double)(2*3.1415926535897932384626433) -#define TWO16 (double)(65536.0) -#define TWOM16 (double)(0.0000152587890625) -#define SQRTHALF (double)(0.707106781186547524400844362104) - -#define newmin(a,b) ((a)<(b)? (a) : (b)) -/* Size by which to increment the stack used in pushg() and popg(). */ -#define STACK_GROW 16 -/* Error codes */ -#define DIVIDEBYZERO 1 -#define OVFLOW 2 -#define SIGN 3 -#define OVERRANGE 4 -#define AUTO_MUL 0 -#define GRAMMAR_MUL 1 -#define FFT_MUL 2 -#define KARAT_MUL 3 -/* Next, mumber of shorts per operand at which Karatsuba breaks over. */ -#define KARAT_BREAK 40 -/* Next, mumber of shorts per operand at which FFT breaks over. */ -#define FFT_BREAK 200 - - -/* Structure definitions */ -typedef struct -{ - int sign; - unsigned short n[1]; /* number of shorts = abs(sign) */ -} giantstruct; - -typedef giantstruct* giant; - -const unsigned char RSApkcs1paddingtable[3][16] = { - { 0x0F, 0x14,0x04,0x00,0x05,0x1A,0x02,0x03,0x0E,0x2B,0x05,0x06,0x09,0x30,0x21,0x30 }, - { 0x0D, 0x14,0x04,0x1A,0x02,0x03,0x0E,0x2B,0x05,0x06,0x07,0x30,0x1F,0x30,0x00,0x00 }, - { 0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } -}; - - -/* Global variables. */ -int current_max_size = 0, cur_run = 0; -static int stack_glen = 0; -static int cur_stack_elem = 0; -static int cur_stack_size = 0; -static giant* stack; -giant cur_den = NULL, cur_recip = NULL; -int error = 0; -int mulmode = AUTO_MUL; -static double* z = NULL, *z2 = NULL; -int checkFFTerror = 0; -double maxFFTerror; -double* sinCos = NULL; - - -/* Global function declarations */ -giant newgiant(int numshorts); -void gigimport(giant g, unsigned char* buff, int len); -void auxmulg(giant a, giant b); -void normal_subg(giant a, giant b); -void reverse_subg(giant a, giant b); -void normal_addg(giant a, giant b); -void FFTmulg(giant y, giant x); -void FFTsquareg(giant x); -void grammarmulg(giant a, giant b); -void grammarsquareg(giant b); -void karatmulg(giant a, giant b); -void karatsquareg(giant b); -void justg(giant x); -void addsignal(giant x, double* z, int n); -void fftinv_hermitian_to_real(double* z, int n); -void mul_hermitian(double* a, double* b, int n); -void square_hermitian(double* b, int n); -void fft_real_to_hermitian(double* z, int n); -void giant_to_double(giant x, int sizex, double* z, int L); -int lpt(int, int *); -double gfloor(double); -void init_sinCos(int); -double s_sin(int); -double s_cos(int); -void scramble_real(double* x, int n); -// Stack functions -static giant popg(); -static void pushg(int a); -// Math Functions -void powermodg(giant x, giant n, giant z); /* x := x^n (mod z). */ -void modg(giant d, giant n); /* num := num % den, any positive den. */ -void squareg(giant g); /* g *= g. */ -void mulg(giant a, giant b); /* b *= a. */ -int bitval(giant n, int pos); /* Returns the value of the pos bit of n. */ -int bitlen(giant n); /* Returns the bit-length n; e.g. n=7 returns 3. */ -void itog(int n, giant g); /* Integer <-> giant. */ -void gtog(giant src, giant dest); /* Copies one giant to another. */ -void make_recip(giant d, giant r); /* r becomes the steady-state reciprocal 2^(2b)/d, where * b = bit-length of d-1. */ -void modg_via_recip(giant d, giant r, giant n); /* n := n % d, d positive, using stored reciprocal directly. */ -int gcompg(giant a, giant b); /* Returns 1, 0, -1 as a>b, a=b, an, 256); -} - -bool Verifyhash(unsigned char* hash, unsigned char* decryptBuffer, RSA_PUBLIC_KEY key) -{ - unsigned char cmphash[20]; - int a; - int zero_position = 20; - - // Convert Hash to "Big-Endian Format" - for (a = 0;a<20;a++) cmphash[a] = hash[19 - a]; - - // Compare if the Hash Results (first 20 Bytes) are the same - if (memcmp(decryptBuffer, cmphash, 20) != 0) return false; - - unsigned char *pkcspad; - for (int tableIndex = 0; RSApkcs1paddingtable[tableIndex][0] != 0; tableIndex++) { - - pkcspad = (unsigned char*)RSApkcs1paddingtable[tableIndex]; - int difference = memcmp(pkcspad + 1, &decryptBuffer[20], *pkcspad); - - if (!difference) - { - zero_position = *pkcspad + 20; - break; - } - - } - - // Padding checking , xbox does exactly the same - - if (decryptBuffer[zero_position] != 0x00) return false; - - if (decryptBuffer[key.KeyData.ModulusSize] != 0x00) return false; - - if (decryptBuffer[key.KeyData.ModulusSize - 1] != 0x01) return false; - - for (unsigned int i = zero_position + 1; i < (key.KeyData.ModulusSize - 1); i++) { - if (decryptBuffer[i] != 0xff) return false; - } - - return true; -} - -giant newgiant(int numshorts) -{ - int size; - giant thegiant; - - if (numshorts > MAX_SHORTS) { - EmuWarning("Requested giant too big."); - } - if (numshorts <= 0) - numshorts = MAX_SHORTS; - size = numshorts * sizeof(short) + sizeof(int); - thegiant = (giant)malloc(size); - thegiant->sign = 0; - - if (newmin(2 * numshorts, MAX_SHORTS) > current_max_size) - current_max_size = newmin(2 * numshorts, MAX_SHORTS); - - /* If newgiant() is being called for the first time, set the - * size of the stack giants. */ - if (stack_glen == 0) stack_glen = current_max_size; - - return(thegiant); -} - -// ergo720: there's a bug in the original implementation of gigimport that prevents the rsa algorithm from working correctly on Windows (but -// for some reason it works on Ubuntu). This replacement implementation is taken from -// http://xbox-linux-devel.narkive.com/Qw6o31DP/xbedump-fix-for-array-out-of-bounds-access#post1 -// and it has been improved based on JayFoxRox suggestions. See the link below for the details -// https://github.com/xqemu/xbedump/pull/5 -void gigimport(giant g, unsigned char *buff, int len) { - - // copy buffered 'number' into giant's number buffer - memcpy(g->n, buff, len); - - assert((len % 2) == 0); - - g->sign = len / 2; - - assert(g->sign != 0); -} - -void powermodg(giant x, giant n, giant g) -/* x becomes x^n (mod g). */ -{ - int len, pos; - giant scratch2 = popg(); - - gtog(x, scratch2); - itog(1, x); - len = bitlen(n); - pos = 0; - while (1) - { - if (bitval(n, pos++)) - { - mulg(scratch2, x); - modg(g, x); - } - if (pos >= len) - break; - squareg(scratch2); - modg(g, scratch2); - } - pushg(1); -} - -giant popg() -{ - int i; - - if (current_max_size <= 0) current_max_size = MAX_SHORTS; - - if (cur_stack_size == 0) { - /* Initialize the stack if we're just starting out. - * Note that all stack giants will be whatever current_max_size is - * when newgiant() is first called. */ - cur_stack_size = STACK_GROW; - stack = (giant *)malloc(cur_stack_size * sizeof(giant)); - for (i = 0; i < STACK_GROW; i++) - stack[i] = NULL; - if (stack_glen == 0) stack_glen = current_max_size; - } - else if (cur_stack_elem >= cur_stack_size) { - /* Expand the stack if we need to. */ - i = cur_stack_size; - cur_stack_size += STACK_GROW; - stack = (giant *)realloc(stack, cur_stack_size * sizeof(giant)); - for (; i < cur_stack_size; i++) - stack[i] = NULL; - } - else if (cur_stack_elem < cur_stack_size - 2 * STACK_GROW) { - /* Prune the stack if it's too big. Disabled, so the stack can only expand */ - /* cur_stack_size -= STACK_GROW; - for (i = cur_stack_size - STACK_GROW; i < cur_stack_size; i++) - free(stack[i]); - stack = (giant *) realloc (stack,cur_stack_size * sizeof(giant)); */ - } - - /* Malloc our giant. */ - if (stack[cur_stack_elem] == NULL) - stack[cur_stack_elem] = (giant)malloc(stack_glen * sizeof(short) + sizeof(int)); - stack[cur_stack_elem]->sign = 0; - - return(stack[cur_stack_elem++]); -} - -void pushg(int a) -{ - if (a < 0) return; - cur_stack_elem -= a; - if (cur_stack_elem < 0) cur_stack_elem = 0; -} - -void modg(giant d, giant n) -/* n becomes n%d. n is arbitrary, but the denominator d must be positive! */ -{ - if (cur_recip == NULL) { - cur_recip = newgiant(current_max_size); - cur_den = newgiant(current_max_size); - gtog(d, cur_den); - make_recip(d, cur_recip); - } - else if (gcompg(d, cur_den)) { - gtog(d, cur_den); - make_recip(d, cur_recip); - } - modg_via_recip(d, cur_recip, n); -} - -void squareg(giant b) -/* b becomes b^2. */ -{ - auxmulg(b, b); -} - -void mulg(giant a, giant b) -/* b becomes a*b. */ -{ - auxmulg(a, b); -} - -void auxmulg(giant a, giant b) -/* Optimized general multiply, b becomes a*b. Modes are: -* AUTO_MUL: switch according to empirical speed criteria. -* GRAMMAR_MUL: force grammar-school algorithm. -* KARAT_MUL: force Karatsuba divide-conquer method. -* FFT_MUL: force floating point FFT method. */ -{ - float grammartime; - int square = (a == b); - int sizea, sizeb; - - switch (mulmode) - { - case GRAMMAR_MUL: - if (square) grammarsquareg(b); - else grammarmulg(a, b); - break; - case FFT_MUL: - if (square) - FFTsquareg(b); - else - FFTmulg(a, b); - break; - case KARAT_MUL: - if (square) karatsquareg(b); - else karatmulg(a, b); - break; - case AUTO_MUL: - sizea = abs(a->sign); - sizeb = abs(b->sign); - if ((sizea > KARAT_BREAK) && (sizea <= FFT_BREAK) && - (sizeb > KARAT_BREAK) && (sizeb <= FFT_BREAK)) { - if (square) karatsquareg(b); - else karatmulg(a, b); - - } - else { - grammartime = (float)sizea; - grammartime *= (float)sizeb; - if (grammartime < FFT_BREAK * FFT_BREAK) - { - if (square) grammarsquareg(b); - else grammarmulg(a, b); - } - else - { - if (square) FFTsquareg(b); - else FFTmulg(a, b); - } - } - break; - } -} - -int bitval(giant n, int pos) -{ - int i = abs(pos) >> 4, c = 1 << (pos & 15); - - return (((n->n[i]) & c) != 0); -} - -int bitlen(giant n) -{ - int b = 16, c = 1 << 15, w; - - if (isZero(n)) - return(0); - w = n->n[abs(n->sign) - 1]; - while ((w&c) == 0) - { - b--; - c >>= 1; - } - return (16 * (abs(n->sign) - 1) + b); -} - -void itog(int i, giant g) -/* The giant g becomes set to the integer value i. */ -{ - unsigned int j = abs(i); - - if (i == 0) - { - g->sign = 0; - g->n[0] = 0; - return; - } - g->n[0] = (unsigned short)(j & 0xFFFF); - j >>= 16; - if (j) - { - g->n[1] = (unsigned short)j; - g->sign = 2; - } - else - { - g->sign = 1; - } - if (i < 0) - g->sign = -(g->sign); -} - -void gtog(giant srcgiant, giant destgiant) -/* destgiant becomes equal to srcgiant. */ -{ - int numbytes = sizeof(int) + abs(srcgiant->sign) * sizeof(short); - - memcpy((char *)destgiant, (char *)srcgiant, numbytes); -} - -void make_recip(giant d, giant r) -/* r becomes the steady-state reciprocal -* 2^(2b)/d, where b = bit-length of d-1. */ -{ - int b; - giant tmp, tmp2; - - if (isZero(d) || (d->sign < 0)) - { - exit(SIGN); - } - tmp = popg(); - tmp2 = popg(); - itog(1, r); - subg(r, d); - b = bitlen(d); - addg(r, d); - gshiftleft(b, r); - gtog(r, tmp2); - while (1) - { - gtog(r, tmp); - squareg(tmp); - gshiftright(b, tmp); - mulg(d, tmp); - gshiftright(b, tmp); - addg(r, r); - subg(tmp, r); - if (gcompg(r, tmp2) <= 0) - break; - gtog(r, tmp2); - } - itog(1, tmp); - gshiftleft(2 * b, tmp); - gtog(r, tmp2); - mulg(d, tmp2); - subg(tmp2, tmp); - itog(1, tmp2); - while (tmp->sign < 0) - { - subg(tmp2, r); - addg(d, tmp); - } - pushg(2); -} - -void modg_via_recip(giant d, giant r, giant n) -/* This is the fastest mod of the present collection. -* n := n % d, where r is the precalculated -* steady-state reciprocal of d. */ -{ - int s = (bitlen(r) - 1), sign = n->sign; - giant tmp, tmp2; - - if (isZero(d) || (d->sign < 0)) - { - exit(SIGN); - } - - tmp = popg(); - tmp2 = popg(); - - n->sign = abs(n->sign); - while (1) - { - gtog(n, tmp); gshiftright(s - 1, tmp); - mulg(r, tmp); - gshiftright(s + 1, tmp); - mulg(d, tmp); - subg(tmp, n); - if (gcompg(n, d) >= 0) - subg(d, n); - if (gcompg(n, d) < 0) - break; - } - if (sign >= 0) - goto done; - if (isZero(n)) - goto done; - negg(n); - addg(d, n); -done: - pushg(2); - return; -} - -int gcompg(giant a, giant b) -/* Returns -1,0,1 if ab, respectively. */ -{ - int sa = a->sign, j, sb = b->sign, va, vb, sgn; - - if (sa > sb) - return(1); - if (sa < sb) - return(-1); - if (sa < 0) - { - sa = -sa; /* Take absolute value of sa. */ - sgn = -1; - } - else - { - sgn = 1; - } - for (j = sa - 1; j >= 0; j--) - { - va = a->n[j]; - vb = b->n[j]; - if (va > vb) - return(sgn); - if (va < vb) - return(-sgn); - } - return(0); -} - -void subg(giant a, giant b) -/* b := b - a, any signs, any result. */ -{ - int asgn = a->sign, bsgn = b->sign; - - if (asgn == 0) - return; - if (bsgn == 0) - { - gtog(a, b); - negg(b); - return; - } - if ((asgn < 0) != (bsgn < 0)) - { - if (bsgn > 0) - { - negg(a); - normal_addg(a, b); - negg(a); - return; - } - negg(b); - normal_addg(a, b); - negg(b); - return; - } - if (bsgn > 0) - { - if (gcompg(b, a) >= 0) - { - normal_subg(a, b); - return; - } - reverse_subg(a, b); - negg(b); - return; - } - negg(a); - negg(b); - if (gcompg(b, a) >= 0) - { - normal_subg(a, b); - negg(a); - negg(b); - return; - } - reverse_subg(a, b); - negg(a); - return; -} - -void gshiftright(int bits, giant g) -/* shift g right bits bits. Equivalent to g = g/2^bits. */ -{ - register int j, size = abs(g->sign); - register unsigned int carry; - int words = bits >> 4; - int remain = bits & 15, cremain = (16 - remain); - - if (bits == 0) - return; - if (isZero(g)) - return; - if (bits < 0) { - gshiftleft(-bits, g); - return; - } - if (words >= size) { - g->sign = 0; - return; - } - if (remain == 0) { - memmove(g->n, g->n + words, (size - words) * sizeof(short)); - g->sign += (g->sign < 0) ? (words) : (-words); - } - else { - size -= words; - - if (size) - { - for (j = 0;j < size - 1;++j) - { - carry = g->n[j + words + 1] << cremain; - g->n[j] = (unsigned short)((g->n[j + words] >> remain) | carry); - } - g->n[size - 1] = (unsigned short)(g->n[size - 1 + words] >> remain); - } - - if (g->n[size - 1] == 0) - --size; - - if (g->sign > 0) - g->sign = size; - else - g->sign = -size; - } -} - -void gshiftleft(int bits, giant g) -/* shift g left bits bits. Equivalent to g = g*2^bits. */ -{ - int rem = bits & 15, crem = 16 - rem, words = bits >> 4; - int size = abs(g->sign), j, k, sign = gsign(g); - unsigned short carry, dat; - - if (!bits) - return; - if (!size) - return; - if (bits < 0) { - gshiftright(-bits, g); - return; - } - if (size + words + 1 > current_max_size) { - error = OVFLOW; - exit(error); - } - if (rem == 0) { - memmove(g->n + words, g->n, size * sizeof(short)); - for (j = 0; j < words; j++) g->n[j] = 0; - g->sign += (g->sign < 0) ? (-words) : (words); - } - else { - k = size + words; - carry = 0; - for (j = size - 1; j >= 0; j--) { - dat = g->n[j]; - g->n[k--] = (unsigned short)((dat >> crem) | carry); - carry = (unsigned short)(dat << rem); - } - do { - g->n[k--] = carry; - carry = 0; - } while (k >= 0); - - k = size + words; - if (g->n[k] == 0) - --k; - g->sign = sign * (k + 1); - } -} - -void addg(giant a, giant b) -/* b := b + a, any signs any result. */ -{ - int asgn = a->sign, bsgn = b->sign; - - if (asgn == 0) - return; - if (bsgn == 0) - { - gtog(a, b); - return; - } - if ((asgn < 0) == (bsgn < 0)) - { - if (bsgn > 0) - { - normal_addg(a, b); - return; - } - absg(b); - if (a != b) absg(a); - normal_addg(a, b); - negg(b); - if (a != b) negg(a); - return; - } - if (bsgn > 0) - { - negg(a); - if (gcompg(b, a) >= 0) - { - normal_subg(a, b); - negg(a); - return; - } - reverse_subg(a, b); - negg(a); - negg(b); - return; - } - negg(b); - if (gcompg(b, a) < 0) - { - reverse_subg(a, b); - return; - } - normal_subg(a, b); - negg(b); - return; -} - -int isZero(giant thegiant) -/* Returns TR if thegiant == 0. */ -{ - register int count; - int length = abs(thegiant->sign); - register unsigned short * numpointer = thegiant->n; - - if (length) - { - for (count = 0; count < length; ++count, ++numpointer) - { - if (*numpointer != 0) - return(FA); - } - } - return(TR); -} - -void negg(giant g) -/* g becomes -g. */ -{ - g->sign = -g->sign; -} - -void normal_subg(giant a, giant b) -/* b := b - a; requires b, a non-negative and b >= a. */ -{ - int j, size = b->sign; - unsigned int k; - - if (a->sign == 0) - return; - - k = 0; - for (j = 0; j < a->sign; ++j) - { - k += 0xffff - a->n[j] + b->n[j]; - b->n[j] = (unsigned short)(k & 0xffff); - k >>= 16; - } - for (j = a->sign; j < size; ++j) - { - k += 0xffff + b->n[j]; - b->n[j] = (unsigned short)(k & 0xffff); - k >>= 16; - } - - if (b->n[0] == 0xffff) - iaddg(1, b); - else - ++b->n[0]; - - while ((size-- > 0) && (b->n[size] == 0)); - - b->sign = (b->n[size] == 0) ? 0 : size + 1; -} - -void reverse_subg(giant a, giant b) -/* b := a - b; requires b, a non-negative and a >= b. */ -{ - int j, size = a->sign; - unsigned int k; - - k = 0; - for (j = 0; j < b->sign; ++j) - { - k += 0xffff - b->n[j] + a->n[j]; - b->n[j] = (unsigned short)(k & 0xffff); - k >>= 16; - } - for (j = b->sign; j < size; ++j) - { - k += 0xffff + a->n[j]; - b->n[j] = (unsigned short)(k & 0xffff); - k >>= 16; - } - - b->sign = size; /* REC, 21 Apr 1996. */ - if (b->n[0] == 0xffff) - iaddg(1, b); - else - ++b->n[0]; - - while (!b->n[--size]); - - b->sign = size + 1; -} - -void iaddg(int i, giant g) -/* Giant g becomes g + (int)i. */ -{ - int w, j = 0, carry = 0, size = abs(g->sign); - giant tmp; - - if (isZero(g)) - { - itog(i, g); - } - else if (g->sign < 0) { - tmp = popg(); - itog(i, tmp); - addg(tmp, g); - pushg(1); - return; - } - else - { - w = g->n[0] + i; - do - { - g->n[j] = (unsigned short)(w & 65535L); - carry = w >> 16; - w = g->n[++j] + carry; - } while ((carry != 0) && (j < size)); - } - if (carry) - { - ++g->sign; - g->n[size] = (unsigned short)carry; - } -} - -int gsign(giant g) -/* Returns the sign of g. */ -{ - if (isZero(g)) - return(0); - if (g->sign > 0) - return(1); - return(-1); -} - -void absg(giant g) -{ - /* g becomes the absolute value of g. */ - if (g->sign < 0) - g->sign = -g->sign; -} - -void FFTmulg(giant y, giant x) -{ - /* x becomes y*x. */ - int lambda, sizex = abs(x->sign), sizey = abs(y->sign); - int finalsign = gsign(x)*gsign(y); - register int L; - - if ((sizex <= 4) || (sizey <= 4)) - { - grammarmulg(y, x); - return; - } - L = lpt(sizex + sizey, &lambda); - if (!z) z = (double *)malloc(MAX_SHORTS * sizeof(double)); - if (!z2) z2 = (double *)malloc(MAX_SHORTS * sizeof(double)); - - giant_to_double(x, sizex, z, L); - giant_to_double(y, sizey, z2, L); - fft_real_to_hermitian(z, L); - fft_real_to_hermitian(z2, L); - mul_hermitian(z2, z, L); - fftinv_hermitian_to_real(z, L); - addsignal(x, z, L); - x->sign = finalsign * abs(x->sign); -} - -void FFTsquareg(giant x) -{ - int j, size = abs(x->sign); - register int L; - - if (size < 4) - { - grammarmulg(x, x); - return; - } - L = lpt(size + size, &j); - if (!z) z = (double *)malloc(MAX_SHORTS * sizeof(double)); - giant_to_double(x, size, z, L); - fft_real_to_hermitian(z, L); - square_hermitian(z, L); - fftinv_hermitian_to_real(z, L); - addsignal(x, z, L); - x->sign = abs(x->sign); -} - -void grammarmulg(giant a, giant b) -/* b becomes a*b. */ -{ - int i, j; - unsigned int prod, carry = 0; - int asize = abs(a->sign), bsize = abs(b->sign); - unsigned short *aptr, *bptr, *destptr; - unsigned short mult; - giant scratch = popg(); - - for (i = 0; i < asize + bsize; ++i) - { - scratch->n[i] = 0; - } - - bptr = &(b->n[0]); - for (i = 0; i < bsize; ++i) - { - mult = *(bptr++); - if (mult) - { - carry = 0; - aptr = &(a->n[0]); - destptr = &(scratch->n[i]); - for (j = 0; j < asize; ++j) - { - prod = *(aptr++) * mult + *destptr + carry; - *(destptr++) = (unsigned short)(prod & 0xffff); - carry = prod >> 16; - } - *destptr = (unsigned short)carry; - } - } - bsize += asize; - if (!carry) - --bsize; - scratch->sign = gsign(a)*gsign(b)*bsize; - gtog(scratch, b); - pushg(1); -} - -void grammarsquareg(giant a) -/* a := a^2. */ -{ - unsigned int cur_term; - unsigned int prod, carry = 0, temp; - unsigned int asize = abs(a->sign), max = asize * 2 - 1; - unsigned short *ptr = a->n, *ptr1, *ptr2; - giant scratch; - - if (asize == 0) { - itog(0, a); - return; - } - - scratch = popg(); - - asize--; - - temp = *ptr; - temp *= temp; - scratch->n[0] = temp; - carry = temp >> 16; - - for (cur_term = 1; cur_term < max; cur_term++) { - ptr1 = ptr2 = ptr; - if (cur_term <= asize) { - ptr2 += cur_term; - } - else { - ptr1 += cur_term - asize; - ptr2 += asize; - } - prod = carry & 0xFFFF; - carry >>= 16; - while (ptr1 < ptr2) { - temp = *ptr1++ * *ptr2--; - prod += (temp << 1) & 0xFFFF; - carry += (temp >> 15); - } - if (ptr1 == ptr2) { - temp = *ptr1; - temp *= temp; - prod += temp & 0xFFFF; - carry += (temp >> 16); - } - carry += prod >> 16; - scratch->n[cur_term] = (unsigned short)(prod); - } - if (carry) { - scratch->n[cur_term] = carry; - scratch->sign = cur_term + 1; - } - else scratch->sign = cur_term; - - gtog(scratch, a); - pushg(1); -} - -/* Improved Karatsuba routines from A. Powell, improvements by G. Woltman. */ -void karatmulg(giant x, giant y) -/* y becomes x*y. */ -{ - int s = abs(x->sign), t = abs(y->sign), w, bits, - sg = gsign(x)*gsign(y); - giant a, b, c, d, e, f; - - if ((s <= KARAT_BREAK) || (t <= KARAT_BREAK)) { - grammarmulg(x, y); - return; - } - w = (s + t + 2) / 4; bits = 16 * w; - a = popg(); b = popg(); c = popg(); - d = popg(); e = popg(); f = popg(); - gtog(x, a); absg(a); if (w <= s) { a->sign = w; justg(a); } - gtog(x, b); absg(b); - gshiftright(bits, b); - gtog(y, c); absg(c); if (w <= t) { c->sign = w; justg(c); } - gtog(y, d); absg(d); - gshiftright(bits, d); - gtog(a, e); normal_addg(b, e); /* e := (a + b) */ - gtog(c, f); normal_addg(d, f); /* f := (c + d) */ - karatmulg(e, f); /* f := (a + b)(c + d) */ - karatmulg(c, a); /* a := a c */ - karatmulg(d, b); /* b := b d */ - normal_subg(a, f); - /* f := (a + b)(c + d) - a c */ - normal_subg(b, f); - /* f := (a + b)(c + d) - a c - b d */ - gshiftleft(bits, b); - normal_addg(f, b); - gshiftleft(bits, b); - normal_addg(a, b); - gtog(b, y); y->sign *= sg; - pushg(6); - - return; -} - -void karatsquareg(giant x) -/* x becomes x^2. */ -{ - int s = abs(x->sign), w, bits; - giant a, b, c; - - if (s <= KARAT_BREAK) { - grammarsquareg(x); - return; - } - w = (s + 1) / 2; bits = 16 * w; - a = popg(); b = popg(); c = popg(); - gtog(x, a); a->sign = w; justg(a); - gtog(x, b); absg(b); - gshiftright(bits, b); - gtog(a, c); normal_addg(b, c); - karatsquareg(c); - karatsquareg(a); - karatsquareg(b); - normal_subg(b, c); - normal_subg(a, c); - gshiftleft(bits, b); - normal_addg(c, b); - gshiftleft(bits, b); - normal_addg(a, b); - gtog(b, x); - pushg(3); - - return; -} - -void justg(giant x) -{ - int s = x->sign, sg = 1; - - if (s < 0) { - sg = -1; - s = -s; - } - --s; - while (x->n[s] == 0) { - --s; - if (s < 0) break; - } - x->sign = sg * (s + 1); -} - -void normal_addg(giant a, giant b) -/* b := a + b, both a,b assumed non-negative. */ -{ - int carry = 0; - int asize = a->sign, bsize = b->sign; - long k; - int j = 0; - unsigned short *aptr = a->n, *bptr = b->n; - - if (asize < bsize) - { - for (j = 0; j < asize; j++) - { - k = *aptr++ + *bptr + carry; - carry = 0; - if (k >= 65536L) - { - k -= 65536L; - ++carry; - } - *bptr++ = (unsigned short)k; - } - for (j = asize; j < bsize; j++) - { - k = *bptr + carry; - carry = 0; - if (k >= 65536L) - { - k -= 65536L; - ++carry; - } - *bptr++ = (unsigned short)k; - } - } - else - { - for (j = 0; j < bsize; j++) - { - k = *aptr++ + *bptr + carry; - carry = 0; - if (k >= 65536L) - { - k -= 65536L; - ++carry; - } - *bptr++ = (unsigned short)k; - } - for (j = bsize; j < asize; j++) - { - k = *aptr++ + carry; - carry = 0; - if (k >= 65536L) - { - k -= 65536L; - ++carry; - } - *bptr++ = (unsigned short)k; - } - } - if (carry) - { - *bptr = 1; ++j; - } - b->sign = j; -} - -void addsignal(giant x, double* z, int n) -{ - register int j, k, m, car, last; - register double f, g, err; - - maxFFTerror = 0; - last = 0; - for (j = 0;j < n;j++) - { - f = gfloor(z[j] + 0.5); - if (f != 0.0) last = j; - if (checkFFTerror) - { - err = fabs(f - z[j]); - if (err > maxFFTerror) - maxFFTerror = err; - } - z[j] = 0; - k = 0; - do - { - g = gfloor(f*TWOM16); - z[j + k] += f - g * TWO16; - ++k; - f = g; - } while (f != 0.0); - } - car = 0; - for (j = 0;j < last + 1;j++) - { - m = (int)(z[j] + car); - x->n[j] = (unsigned short)(m & 0xffff); - car = (m >> 16); - } - if (car) - x->n[j] = (unsigned short)car; - else - --j; - - while (!(x->n[j])) --j; - - x->sign = j + 1; -} - -void fftinv_hermitian_to_real(double* z, int n) -/* Input is {Re(z^[0]),...,Re(z^[n/2),Im(z^[n/2-1]),...,Im(z^[1]). -* This is a decimation-in-frequency, split-radix algorithm. -*/ -{ - register double cc1, ss1, cc3, ss3; - register int is, id, i0, i1, i2, i3, i4, i5, i6, i7, i8, - a, a3, b, b3, nminus = n - 1, dil, expand; - register double *x, e; - int nn = n >> 1; - double t1, t2, t3, t4, t5; - int n2, n4, n8, i, j; - - init_sinCos(n); - expand = cur_run / n; - x = z - 1; - n2 = n << 1; - while (nn >>= 1) - { - is = 0; - id = n2; - n2 >>= 1; - n4 = n2 >> 2; - n8 = n4 >> 1; - do - { - for (i = is;i < n;i += id) - { - i1 = i + 1; - i2 = i1 + n4; - i3 = i2 + n4; - i4 = i3 + n4; - t1 = x[i1] - x[i3]; - x[i1] += x[i3]; - x[i2] += x[i2]; - x[i3] = t1 - 2.0*x[i4]; - x[i4] = t1 + 2.0*x[i4]; - if (n4 == 1) - continue; - i1 += n8; - i2 += n8; - i3 += n8; - i4 += n8; - t1 = (x[i2] - x[i1])*SQRTHALF; - t2 = (x[i4] + x[i3])*SQRTHALF; - x[i1] += x[i2]; - x[i2] = x[i4] - x[i3]; - x[i3] = -2.0*(t2 + t1); - x[i4] = 2.0*(t1 - t2); - } - is = (id << 1) - n2; - id <<= 2; - } while (is < n - 1); - dil = n / n2; - a = dil; - for (j = 2;j <= n8;j++) - { - a3 = (a + (a << 1))&nminus; - b = a * expand; - b3 = a3 * expand; - cc1 = s_cos(b); - ss1 = s_sin(b); - cc3 = s_cos(b3); - ss3 = s_sin(b3); - a = (a + dil)&nminus; - is = 0; - id = n2 << 1; - do - { - for (i = is;i < n;i += id) - { - i1 = i + j; - i2 = i1 + n4; - i3 = i2 + n4; - i4 = i3 + n4; - i5 = i + n4 - j + 2; - i6 = i5 + n4; - i7 = i6 + n4; - i8 = i7 + n4; - t1 = x[i1] - x[i6]; - x[i1] += x[i6]; - t2 = x[i5] - x[i2]; - x[i5] += x[i2]; - t3 = x[i8] + x[i3]; - x[i6] = x[i8] - x[i3]; - t4 = x[i4] + x[i7]; - x[i2] = x[i4] - x[i7]; - t5 = t1 - t4; - t1 += t4; - t4 = t2 - t3; - t2 += t3; - x[i3] = t5 * cc1 + t4 * ss1; - x[i7] = -t4 * cc1 + t5 * ss1; - x[i4] = t1 * cc3 - t2 * ss3; - x[i8] = t2 * cc3 + t1 * ss3; - } - is = (id << 1) - n2; - id <<= 2; - } while (is < n - 1); - } - } - is = 1; - id = 4; - do - { - for (i0 = is;i0 <= n;i0 += id) - { - i1 = i0 + 1; - e = x[i0]; - x[i0] = e + x[i1]; - x[i1] = e - x[i1]; - } - is = (id << 1) - 1; - id <<= 2; - } while (is < n); - scramble_real(z, n); - e = 1 / (double)n; - for (i = 0;i < n;i++) - { - z[i] *= e; - } -} - -void mul_hermitian(double* a, double* b, int n) -{ - register int k, half = n >> 1; - register double aa, bb, am, bm; - - b[0] *= a[0]; - b[half] *= a[half]; - for (k = 1;k < half;k++) - { - aa = a[k]; - bb = b[k]; - am = a[n - k]; - bm = b[n - k]; - b[k] = aa * bb - am * bm; - b[n - k] = aa * bm + am * bb; - } -} - -void square_hermitian(double* b, int n) -{ - register int k, half = n >> 1; - register double c, d; - - b[0] *= b[0]; - b[half] *= b[half]; - for (k = 1;k < half;k++) - { - c = b[k]; - d = b[n - k]; - b[n - k] = 2.0*c*d; - b[k] = (c + d)*(c - d); - } -} - -void fft_real_to_hermitian(double* z, int n) -/* Output is {Re(z^[0]),...,Re(z^[n/2),Im(z^[n/2-1]),...,Im(z^[1]). -* This is a decimation-in-time, split-radix algorithm. -*/ -{ - register double cc1, ss1, cc3, ss3; - register int is, id, i0, i1, i2, i3, i4, i5, i6, i7, i8, - a, a3, b, b3, nminus = n - 1, dil, expand; - register double *x, e; - int nn = n >> 1; - double t1, t2, t3, t4, t5, t6; - register int n2, n4, n8, i, j; - - init_sinCos(n); - expand = cur_run / n; - scramble_real(z, n); - x = z - 1; /* FORTRAN compatibility. */ - is = 1; - id = 4; - do - { - for (i0 = is;i0 <= n;i0 += id) - { - i1 = i0 + 1; - e = x[i0]; - x[i0] = e + x[i1]; - x[i1] = e - x[i1]; - } - is = (id << 1) - 1; - id <<= 2; - } while (is < n); - - n2 = 2; - while (nn >>= 1) - { - n2 <<= 1; - n4 = n2 >> 2; - n8 = n2 >> 3; - is = 0; - id = n2 << 1; - do - { - for (i = is;i < n;i += id) - { - i1 = i + 1; - i2 = i1 + n4; - i3 = i2 + n4; - i4 = i3 + n4; - t1 = x[i4] + x[i3]; - x[i4] -= x[i3]; - x[i3] = x[i1] - t1; - x[i1] += t1; - if (n4 == 1) - continue; - i1 += n8; - i2 += n8; - i3 += n8; - i4 += n8; - t1 = (x[i3] + x[i4])*SQRTHALF; - t2 = (x[i3] - x[i4])*SQRTHALF; - x[i4] = x[i2] - t1; - x[i3] = -x[i2] - t1; - x[i2] = x[i1] - t2; - x[i1] += t2; - } - is = (id << 1) - n2; - id <<= 2; - } while (is < n); - dil = n / n2; - a = dil; - for (j = 2;j <= n8;j++) - { - a3 = (a + (a << 1))&nminus; - b = a * expand; - b3 = a3 * expand; - cc1 = s_cos(b); - ss1 = s_sin(b); - cc3 = s_cos(b3); - ss3 = s_sin(b3); - a = (a + dil)&nminus; - is = 0; - id = n2 << 1; - do - { - for (i = is;i < n;i += id) - { - i1 = i + j; - i2 = i1 + n4; - i3 = i2 + n4; - i4 = i3 + n4; - i5 = i + n4 - j + 2; - i6 = i5 + n4; - i7 = i6 + n4; - i8 = i7 + n4; - t1 = x[i3] * cc1 + x[i7] * ss1; - t2 = x[i7] * cc1 - x[i3] * ss1; - t3 = x[i4] * cc3 + x[i8] * ss3; - t4 = x[i8] * cc3 - x[i4] * ss3; - t5 = t1 + t3; - t6 = t2 + t4; - t3 = t1 - t3; - t4 = t2 - t4; - t2 = x[i6] + t6; - x[i3] = t6 - x[i6]; - x[i8] = t2; - t2 = x[i2] - t3; - x[i7] = -x[i2] - t3; - x[i4] = t2; - t1 = x[i1] + t5; - x[i6] = x[i1] - t5; - x[i1] = t1; - t1 = x[i5] + t4; - x[i5] -= t4; - x[i2] = t1; - } - is = (id << 1) - n2; - id <<= 2; - } while (is < n); - } - } -} - -void giant_to_double(giant x, int sizex, double* z, int L) -{ - register int j; - - for (j = sizex;j < L;j++) - { - z[j] = 0.0; - } - for (j = 0;j < sizex;j++) - { - z[j] = x->n[j]; - } -} - -int lpt(int n, int* lambda) -/* Returns least power of two greater than n. */ -{ - register int i = 1; - - *lambda = 0; - while (i < n) - { - i <<= 1; - ++(*lambda); - } - return(i); -} - -double gfloor(double f) -{ - return floor(f); -} - -void init_sinCos(int n) -{ - int j; - double e = TWOPI / n; - - if (n <= cur_run) - return; - cur_run = n; - if (sinCos) - free(sinCos); - sinCos = (double *)malloc(sizeof(double)*(1 + (n >> 2))); - for (j = 0;j <= (n >> 2);j++) - { - sinCos[j] = sin(e*j); - } -} - -double s_cos(int n) -{ - int quart = (cur_run >> 2); - - if (n < quart) - return(s_sin(n + quart)); - return(-s_sin(n - quart)); -} - -double s_sin(int n) -{ - int seg = n / (cur_run >> 2); - - switch (seg) - { - case 0: return(sinCos[n]); - case 1: return(sinCos[(cur_run >> 1) - n]); - case 2: return(-sinCos[n - (cur_run >> 1)]); - case 3: return(-sinCos[cur_run - n]); - } - return 0; -} - -void scramble_real(double* x, int n) -{ - register int i, j, k; - register double tmp; - - for (i = 0, j = 0;i < n - 1;i++) - { - if (i < j) - { - tmp = x[j]; - x[j] = x[i]; - x[i] = tmp; - } - k = n / 2; - while (k <= j) - { - j -= k; - k >>= 1; - } - j += k; - } -} diff --git a/src/CxbxKrnl/EmuX86.cpp b/src/CxbxKrnl/EmuX86.cpp deleted file mode 100644 index 6f4605fb4..000000000 --- a/src/CxbxKrnl/EmuX86.cpp +++ /dev/null @@ -1,1140 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuX86.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * (c) 2016 Luke Usher -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "X86 " // Intentional extra space to align on 4 characters - -// Link the library into our project. -#pragma comment(lib, "distorm.lib") - -// Cxbx uses dynamic linking of distorm, which by default chooses for 64 bits offsets : -#define SUPPORT_64BIT_OFFSET - -#include "distorm.h" -#include "mnemonics.h" - -#include "CxbxKrnl.h" -#include "Emu.h" // For EmuWarning -#include "EmuX86.h" -#include "HLEIntercept.h" // for bLLE_GPU - -#include -#include "devices\Xbox.h" // For g_PCIBus - -extern uint32_t GetAPUTime(); - -// -// Read & write handlers handlers for I/O -// - -static int field_pin = 0; - -uint32_t EmuX86_IORead(xbaddr addr, int size) -{ - switch (addr) { - case 0x8008: { // TODO : Move 0x8008 TIMER to a device - if (size == sizeof(uint32_t)) { - // HACK: This is very wrong. - // This timer should count at a specific frequency (3579.545 ticks per ms) - // But this is enough to keep NXDK from hanging for now. - LARGE_INTEGER performanceCount; - QueryPerformanceCounter(&performanceCount); - return static_cast(performanceCount.QuadPart); - } - break; - } - case 0x80C0: { // TODO : Move 0x80C0 TV encoder to a device - if (size == sizeof(uint8_t)) { - // field pin from tv encoder? - field_pin = (field_pin + 1) & 1; - return field_pin << 5; - } - break; - } - } - - // Pass the IO Read to the PCI Bus, this will handle devices with BARs set to IO addresses - uint32_t value = 0; - if (g_PCIBus->IORead(addr, &value, size)) { - return value; - } - - EmuWarning("EmuX86_IORead(0x%08X, %d) [Unhandled]", addr, size); - return 0; -} - -void EmuX86_IOWrite(xbaddr addr, uint32_t value, int size) -{ - // Pass the IO Write to the PCI Bus, this will handle devices with BARs set to IO addresses - if (g_PCIBus->IOWrite(addr, value, size)) { - return; - } - - EmuWarning("EmuX86_IOWrite(0x%08X, 0x%04X, %d) [Unhandled]", addr, value, size); -} - -// -// Read & write handlers for pass-through access to (host committed, virtual) xbox memory -// -// Only allowed to be called outside our EmuException exception handler, -// to prevent recursive exceptions when accessing unallocated memory. -// - -uint32_t EmuX86_Mem_Read(xbaddr addr, int size) -{ - switch (size) { - case sizeof(uint32_t) : - return *(uint32_t*)addr; - case sizeof(uint16_t) : - return *(uint16_t*)addr; - case sizeof(uint8_t) : - return *(uint8_t*)addr; - default: - // UNREACHABLE(size); - return 0; - } -} - -void EmuX86_Mem_Write(xbaddr addr, uint32_t value, int size) -{ - switch (size) { - case sizeof(uint32_t) : - *(uint32_t*)addr = (uint32_t)value; - break; - case sizeof(uint16_t) : - *(uint16_t*)addr = (uint16_t)value; - break; - case sizeof(uint8_t) : - *(uint8_t*)addr = (uint8_t)value; - break; - default: - // UNREACHABLE(size); - return; - } -} - -uint32_t EmuFlash_Read32(xbaddr addr) // TODO : Move to EmuFlash.cpp -{ - uint32_t r; - - switch (addr) { - case 0x78: // ROM_VERSION - r = 0x90; // Luke's hardware revision 1.6 Xbox returns this (also since XboxKrnlVersion is set to 5838) - break; - default: - EmuWarning("Read32 FLASH_ROM (0x%.8X) [Unknown address]", addr); - return -1; - } - - DbgPrintf("X86 : Read32 FLASH_ROM (0x%.8X) = 0x%.8X [HANDLED]\n", addr, r); - return r; -} - -// -// Read & write handlers for memory-mapped hardware devices -// - -uint32_t EmuX86_Read(xbaddr addr, int size) -{ - if ((addr & (size - 1)) != 0) { - EmuWarning("EmuX86_Read(0x%08X, %d) [Unaligned unimplemented]", addr, size); - // LOG_UNIMPLEMENTED(); - return 0; - } - - uint32_t value; - - if (addr >= XBOX_FLASH_ROM_BASE) { // 0xFFF00000 - 0xFFFFFFF - value = EmuFlash_Read32(addr - XBOX_FLASH_ROM_BASE); // TODO : Make flash access size-aware - } else if(addr == 0xFE80200C) { - // TODO: Remove this once we have an LLE APU Device - return GetAPUTime(); - } else { - // Pass the Read to the PCI Bus, this will handle devices with BARs set to MMIO addresses - if (g_PCIBus->MMIORead(addr, &value, size)) { - return value; - } - - if (g_bEmuException) { - EmuWarning("EmuX86_Read(0x%08X, %d) [Unknown address]", addr, size); - value = 0; - } else { - // Outside EmuException, pass the memory-access through to normal memory : - value = EmuX86_Mem_Read(addr, size); - } - - DbgPrintf("X86 : Read(0x%08X, %d) = 0x%08X\n", addr, size, value); - } - - return value; -} - -void EmuX86_Write(xbaddr addr, uint32_t value, int size) -{ - if ((addr & (size - 1)) != 0) { - EmuWarning("EmuX86_Write(0x%08X, 0x%08X, %d) [Unaligned unimplemented]", addr, value, size); - // LOG_UNIMPLEMENTED(); - return; - } - - if (addr >= XBOX_FLASH_ROM_BASE) { // 0xFFF00000 - 0xFFFFFFF - EmuWarning("EmuX86_Write(0x%08X, 0x%08X) [FLASH_ROM]", addr, value); - return; - } - - // Pass the Write to the PCI Bus, this will handle devices with BARs set to MMIO addresses - if (g_PCIBus->MMIOWrite(addr, value, size)) { - return; - } - - if (g_bEmuException) { - EmuWarning("EmuX86_Write(0x%08X, 0x%08X) [Unknown address]", addr, value); - return; - } - - // Outside EmuException, pass the memory-access through to normal memory : - DbgPrintf("X86 : Write(0x%.8X, 0x%.8X, %d)\n", addr, value, size); - EmuX86_Mem_Write(addr, value, size); -} - -int ContextRecordOffsetByRegisterType[/*_RegisterType*/R_DR7 + 1] = { 0 }; - -// Populate ContextRecordOffsetByRegisterType for each distorm::_RegisterType -// supported by the XBox1's Coppermine Pentium III. -// Based on https://maximumcrack.wordpress.com/2011/08/07/fpu-mmx-xmm-and-bbq/ -void EmuX86_InitContextRecordOffsetByRegisterType() -{ - // Unsupported by XBox CPU : R_RAX, R_RCX, R_RDX, R_RBX, R_RSP, R_RBP, R_RSI, R_RDI, R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, - ContextRecordOffsetByRegisterType[R_EAX] = offsetof(CONTEXT, Eax); - ContextRecordOffsetByRegisterType[R_ECX] = offsetof(CONTEXT, Ecx); - ContextRecordOffsetByRegisterType[R_EDX] = offsetof(CONTEXT, Edx); - ContextRecordOffsetByRegisterType[R_EBX] = offsetof(CONTEXT, Ebx); - ContextRecordOffsetByRegisterType[R_ESP] = offsetof(CONTEXT, Esp); - ContextRecordOffsetByRegisterType[R_EBP] = offsetof(CONTEXT, Ebp); - ContextRecordOffsetByRegisterType[R_ESI] = offsetof(CONTEXT, Esi); - ContextRecordOffsetByRegisterType[R_EDI] = offsetof(CONTEXT, Edi); - // Unsupported by XBox CPU : R_R8D, R_R9D, R_R10D, R_R11D, R_R12D, R_R13D, R_R14D, R_R15D, - ContextRecordOffsetByRegisterType[R_AX] = offsetof(CONTEXT, Eax); - ContextRecordOffsetByRegisterType[R_CX] = offsetof(CONTEXT, Ecx); - ContextRecordOffsetByRegisterType[R_DX] = offsetof(CONTEXT, Edx); - ContextRecordOffsetByRegisterType[R_BX] = offsetof(CONTEXT, Ebx); - ContextRecordOffsetByRegisterType[R_SP] = offsetof(CONTEXT, Esp); // ?? - ContextRecordOffsetByRegisterType[R_BP] = offsetof(CONTEXT, Ebp); // ?? - ContextRecordOffsetByRegisterType[R_SI] = offsetof(CONTEXT, Esi); // ?? - ContextRecordOffsetByRegisterType[R_DI] = offsetof(CONTEXT, Edi); // ?? - // Unsupported by XBox CPU : R_R8W, R_R9W, R_R10W, R_R11W, R_R12W, R_R13W, R_R14W, R_R15W, - ContextRecordOffsetByRegisterType[R_AL] = offsetof(CONTEXT, Eax); - ContextRecordOffsetByRegisterType[R_CL] = offsetof(CONTEXT, Ecx); - ContextRecordOffsetByRegisterType[R_DL] = offsetof(CONTEXT, Edx); - ContextRecordOffsetByRegisterType[R_BL] = offsetof(CONTEXT, Ebx); - ContextRecordOffsetByRegisterType[R_AH] = offsetof(CONTEXT, Eax) + 1; - ContextRecordOffsetByRegisterType[R_CH] = offsetof(CONTEXT, Ecx) + 1; - ContextRecordOffsetByRegisterType[R_DH] = offsetof(CONTEXT, Edx) + 1; - ContextRecordOffsetByRegisterType[R_BH] = offsetof(CONTEXT, Ebx) + 1; - // Unsupported by XBox CPU : R_R8B, R_R9B, R_R10B, R_R11B, R_R12B, R_R13B, R_R14B, R_R15B, - ContextRecordOffsetByRegisterType[R_SPL] = offsetof(CONTEXT, Esp); // ?? - ContextRecordOffsetByRegisterType[R_BPL] = offsetof(CONTEXT, Ebp); // ?? - ContextRecordOffsetByRegisterType[R_SIL] = offsetof(CONTEXT, Esi); // ?? - ContextRecordOffsetByRegisterType[R_DIL] = offsetof(CONTEXT, Edi); // ?? - ContextRecordOffsetByRegisterType[R_ES] = offsetof(CONTEXT, SegEs); - ContextRecordOffsetByRegisterType[R_CS] = offsetof(CONTEXT, SegCs); - ContextRecordOffsetByRegisterType[R_SS] = offsetof(CONTEXT, SegSs); - ContextRecordOffsetByRegisterType[R_DS] = offsetof(CONTEXT, SegDs); - ContextRecordOffsetByRegisterType[R_FS] = offsetof(CONTEXT, SegFs); - ContextRecordOffsetByRegisterType[R_GS] = offsetof(CONTEXT, SegGs); - // R_RIP, TODO : Does this also mean EIP and is that enum missing in distorm? https://github.com/gdabah/distorm/issues/110 - // Unsupported by XBox CPU : R_ST0, R_ST1, R_ST2, R_ST3, R_ST4, R_ST5, R_ST6, R_ST7, - ContextRecordOffsetByRegisterType[R_MM0] = offsetof(CONTEXT, ExtendedRegisters[(10 + 0) * 16]); - ContextRecordOffsetByRegisterType[R_MM1] = offsetof(CONTEXT, ExtendedRegisters[(10 + 1) * 16]); - ContextRecordOffsetByRegisterType[R_MM2] = offsetof(CONTEXT, ExtendedRegisters[(10 + 2) * 16]); - ContextRecordOffsetByRegisterType[R_MM3] = offsetof(CONTEXT, ExtendedRegisters[(10 + 3) * 16]); - ContextRecordOffsetByRegisterType[R_MM4] = offsetof(CONTEXT, ExtendedRegisters[(10 + 4) * 16]); - ContextRecordOffsetByRegisterType[R_MM5] = offsetof(CONTEXT, ExtendedRegisters[(10 + 5) * 16]); - ContextRecordOffsetByRegisterType[R_MM6] = offsetof(CONTEXT, ExtendedRegisters[(10 + 6) * 16]); - ContextRecordOffsetByRegisterType[R_MM7] = offsetof(CONTEXT, ExtendedRegisters[(10 + 7) * 16]); - // Unsupported by XBox CPU : R_XMM0, R_XMM1, R_XMM2, R_XMM3, R_XMM4, R_XMM5, R_XMM6, R_XMM7, R_XMM8, R_XMM9, R_XMM10, R_XMM11, R_XMM12, R_XMM13, R_XMM14, R_XMM15, - // Unsupported by XBox CPU : R_YMM0, R_YMM1, R_YMM2, R_YMM3, R_YMM4, R_YMM5, R_YMM6, R_YMM7, R_YMM8, R_YMM9, R_YMM10, R_YMM11, R_YMM12, R_YMM13, R_YMM14, R_YMM15, - // Unsupported by XBox CPU : R_CR0, R_UNUSED0, R_CR2, R_CR3, R_CR4, R_UNUSED1, R_UNUSED2, R_UNUSED3, R_CR8, - ContextRecordOffsetByRegisterType[R_DR0] = offsetof(CONTEXT, Dr0); - ContextRecordOffsetByRegisterType[R_DR1] = offsetof(CONTEXT, Dr1); - ContextRecordOffsetByRegisterType[R_DR2] = offsetof(CONTEXT, Dr2); - ContextRecordOffsetByRegisterType[R_DR3] = offsetof(CONTEXT, Dr3); - // Unsupported by XBox CPU : R_UNUSED4, R_UNUSED5, - ContextRecordOffsetByRegisterType[R_DR6] = offsetof(CONTEXT, Dr6); - ContextRecordOffsetByRegisterType[R_DR7] = offsetof(CONTEXT, Dr7); - - /* struct CONTEXT { // ! markers below, are used in the above offsetof calls - DWORD ContextFlags; - !DWORD Dr0; - !DWORD Dr1; - !DWORD Dr2; - !DWORD Dr3; - !DWORD Dr6; - !DWORD Dr7; - struct _FLOATING_SAVE_AREA { - DWORD ControlWord; - DWORD StatusWord; - DWORD TagWord; - DWORD ErrorOffset; - DWORD ErrorSelector; - DWORD DataOffset; - DWORD DataSelector; - BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; - DWORD Spare0; - } FLOATING_SAVE_AREA FloatSave; - !DWORD SegGs; - !DWORD SegFs; - !DWORD SegEs; - !DWORD SegDs; - !DWORD Edi; - !DWORD Esi; - !DWORD Ebx; - !DWORD Edx; - !DWORD Ecx; - !DWORD Eax; - !DWORD Ebp; - DWORD Eip; - !DWORD SegCs; // MUST BE SANITIZED - DWORD EFlags; // MUST BE SANITIZED - !DWORD Esp; - !DWORD SegSs; - !BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];*/ -} - -inline void * EmuX86_GetRegisterPointer(const LPEXCEPTION_POINTERS e, const uint8_t reg) -{ - int offset = ContextRecordOffsetByRegisterType[reg]; - if (offset > 0) - return (void*)((uintptr_t)(e->ContextRecord) + offset); - - assert(false); - return nullptr; -} - -inline uint32_t EmuX86_GetRegisterValue32(const LPEXCEPTION_POINTERS e, const uint8_t reg) -{ - if (reg != R_NONE) - { - void* regptr = EmuX86_GetRegisterPointer(e, reg); - if (regptr != nullptr) - return *(uint32_t *)regptr; - } - - return 0; -} - -xbaddr EmuX86_Distorm_O_SMEM_Addr(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand) -{ - xbaddr base = EmuX86_GetRegisterValue32(e, info.ops[operand].index); - - return base + (uint32_t)info.disp; -} - -xbaddr EmuX86_Distorm_O_MEM_Addr(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand) -{ - xbaddr base = EmuX86_GetRegisterValue32(e, info.base); - - uint32_t index = EmuX86_GetRegisterValue32(e, info.ops[operand].index); - - if (info.scale >= 2) - return base + (index * info.scale) + (uint32_t)info.disp; - else - return base + index + (uint32_t)info.disp; -} - -typedef struct { - xbaddr addr; - bool is_internal_addr; // If set, addr points to a CPU context (or Distorm immedate value) member (instead of Xbox memory) - int size; // Expressed in bytes, not bits! -} OperandAddress; - -bool EmuX86_Operand_Addr_ForReadOnly(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OperandAddress &opAddr) -{ - opAddr.size = info.ops[operand].size / 8; // Convert size in bits into bytes - switch (info.ops[operand].type) { - case O_NONE: - { - // ignore operand - return false; - } - case O_REG: - opAddr.is_internal_addr = true; - opAddr.addr = (xbaddr)EmuX86_GetRegisterPointer(e, info.ops[operand].index); - return true; - { - } - case O_IMM: - { - opAddr.is_internal_addr = true; - opAddr.addr = (xbaddr)(&info.imm); - return true; - } - case O_IMM1: - { - opAddr.is_internal_addr = true; - opAddr.addr = (xbaddr)(&info.imm.ex.i1); - return true; - } - case O_IMM2: - { - opAddr.is_internal_addr = true; - opAddr.addr = (xbaddr)(&info.imm.ex.i2); - return true; - } - case O_DISP: - { - opAddr.is_internal_addr = false; - // TODO : Does this operand require : opAddr.size = info.dispSize / 8; // ? - opAddr.addr = (xbaddr)info.disp; - return true; - } - case O_SMEM: - { - opAddr.is_internal_addr = false; - // TODO : Does this operand require : opAddr.size = info.dispSize / 8; // ? - opAddr.addr = EmuX86_Distorm_O_SMEM_Addr(e, info, operand); - return true; - } - case O_MEM: - { - opAddr.is_internal_addr = false; - // TODO : Does this operand require : opAddr.size = info.dispSize / 8; // ? - opAddr.addr = EmuX86_Distorm_O_MEM_Addr(e, info, operand); - return true; - } - case O_PC: - { - opAddr.is_internal_addr = false; - opAddr.addr = (xbaddr)INSTRUCTION_GET_TARGET(&info); - return true; - } - case O_PTR: - { - opAddr.is_internal_addr = false; - opAddr.addr = (xbaddr)info.imm.ptr.off; // TODO : What about info.imm.ptr.seg ? - return true; - } - default: - // UNREACHABLE(info.ops[operand].type); - return false; - } - - return false; -} - -bool EmuX86_Operand_Addr_ForReadWrite(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OperandAddress &opAddr) -{ - // Disallow write-access to immediate value adresses - switch (info.ops[operand].type) { - case O_IMM: - case O_IMM1: - case O_IMM2: - EmuWarning("Refused operand write-access to immedate value address!"); - return false; - } - - // Except for the above restriction, writes may access the same operand addresses as reads : - return EmuX86_Operand_Addr_ForReadOnly(e, info, operand, OUT opAddr); -} - -uint32_t EmuX86_Addr_Read(const OperandAddress &opAddr) -{ - assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); - - if (opAddr.is_internal_addr) { - return EmuX86_Mem_Read(opAddr.addr, opAddr.size); - } - else { - return EmuX86_Read(opAddr.addr, opAddr.size); - } -} - -void EmuX86_Addr_Write(const OperandAddress &opAddr, const uint32_t value) -{ - assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); - - if (opAddr.is_internal_addr) { - EmuX86_Mem_Write(opAddr.addr, value, opAddr.size); - } - else { - EmuX86_Write(opAddr.addr, value, opAddr.size); - } -} - -bool EmuX86_Operand_Read(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OUT uint32_t *value) -{ - OperandAddress opAddr; - if (EmuX86_Operand_Addr_ForReadOnly(e, info, operand, OUT opAddr)) { - *value = EmuX86_Addr_Read(opAddr); - return true; - } - - return false; -} - -bool EmuX86_Operand_Write(LPEXCEPTION_POINTERS e, _DInst& info, int operand, uint32_t value) -{ - OperandAddress opAddr; - if (EmuX86_Operand_Addr_ForReadWrite(e, info, operand, OUT opAddr)) { - EmuX86_Addr_Write(opAddr, value); - return true; - } - - return false; -} - -inline void EmuX86_SetFlags(LPEXCEPTION_POINTERS e, DWORD mask, DWORD value) -{ - // By Ron Jeffery, see http://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge - e->ContextRecord->EFlags ^= ((e->ContextRecord->EFlags ^ value) & mask); -} - -#define BIT(flag, bit) ((static_cast((bool)bit)) << (flag)) -#define BITMASK(flag) BIT(flag, 1) - -// TODO : Verify callers compile bool arguments into bit-operations; -// If not, change these arguments back to unsigned int's and use only -// the least significant bit. -inline void EmuX86_SetFlags_OSZAPC -( - LPEXCEPTION_POINTERS e, - const bool OF, - const bool SF, - const bool ZF, - const bool AF, - const bool PF, - const bool CF -) -{ - EmuX86_SetFlags(e, - BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_AF) | BITMASK(EMUX86_EFLAG_PF) | BITMASK(EMUX86_EFLAG_CF), - BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_AF, AF) | BIT(EMUX86_EFLAG_PF, PF) | BIT(EMUX86_EFLAG_CF, CF) - ); -} - -inline void EmuX86_SetFlags_OSZPC -( - LPEXCEPTION_POINTERS e, - const bool OF, - const bool SF, - const bool ZF, - const bool PF, - const bool CF -) -{ - EmuX86_SetFlags(e, - BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_PF) | BITMASK(EMUX86_EFLAG_CF), - BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_PF, PF) | BIT(EMUX86_EFLAG_CF, CF) - ); -} - -inline void EmuX86_SetFlags_OSZAP -( - LPEXCEPTION_POINTERS e, - const bool OF, - const bool SF, - const bool ZF, - const bool AF, - const bool PF -) -{ - EmuX86_SetFlags(e, - BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_AF) | BITMASK(EMUX86_EFLAG_PF), - BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_AF, AF) | BIT(EMUX86_EFLAG_PF, PF) - ); -} - -// EFLAGS Cross-Reference : http://datasheets.chipdb.org/Intel/x86/Intel%20Architecture/EFLAGS.PDF - -// TODO : Review these CPU flag calculations, maybe peek at how MAME or Bochs does this. -// see : https://github.com/mamedev/mame/blob/master/src/devices/cpu/i386/i386priv.h#L301 - -#define BitSize (info.ops[0].size) // Note : Uses 'info' argument of functions using this macro -// TODO : Use templates for these, so 8, 16 and 32 bit versions will compile into efficient bit manipulations -#define OF_Add(r,s,d) (((r ^ s) & (r ^ d)) >> (BitSize-1)) & 1 // Result, Src, Dest -#define OF_Sub(r,s,d) (((d ^ s) & (r ^ d)) >> (BitSize-1)) & 1 // Result, Src, Dest -#define SFCalc(result) (result >> (BitSize-1)) & 1 -#define ZFCalc(result) (result == 0) -#define AFCalc(r,s,d) ((r ^ s ^ d) >> 3) & 1 // Result, Src, Dest -#define PFCalc(result) (0x6996 >> ((result ^ (result >> 4)) & 0xF)) & 1 // See http://graphics.stanford.edu/~seander/bithacks.html#ParityParallel -#define CFCalc(result) (result >> BitSize) & 1 // TODO : Instead of looking at an actual overflow bit, use high bit of (result XOR dest XOR src) -// Flags calculated : Overflow (for addition or subtraction), Sign, Zero, Adjust, Parity and Carry - -// See http://x86.renejeschke.de/ for affected CPU flags per instruction - -// Keep opcode emulations alphabetically ordered : - -bool EmuX86_Opcode_ADD(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // ADD reads value from source : - uint32_t dest = 0; - if (!EmuX86_Operand_Read(e, info, 1, &dest)) - return false; - - // ADD reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - const uint32_t src = EmuX86_Addr_Read(opAddr); - - const uint64_t result = (uint64_t)dest + (uint64_t)src; - - // Write back the result - EmuX86_Addr_Write(opAddr, static_cast(result)); - - // The OF, SF, ZF, AF, CF, and PF flags are set according to the result. - EmuX86_SetFlags_OSZAPC(e, - /*EMUX86_EFLAG_OF*/OF_Add(result, src, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, src, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/CFCalc(result)); - - return true; -} - -bool EmuX86_Opcode_AND(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // Read value from Source and Destination - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 1, &src)) - return false; - - // AND reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - uint32_t dest = EmuX86_Addr_Read(opAddr); - - // AND Destination with src - uint32_t result = dest & src; - - // Write back the result - EmuX86_Addr_Write(opAddr, result); - - // The OF and CF flags are cleared; the SF, ZF, and PF flags are set according to the result. The state of the AF flag is undefined. - EmuX86_SetFlags_OSZPC(e, - /*EMUX86_EFLAG_OF*/0, - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/0); - - return true; -} - -bool EmuX86_Opcode_CMP(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // Read value from Source and Destination - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 1, &src)) - return false; - - uint32_t dest = 0; - if (!EmuX86_Operand_Read(e, info, 0, &dest)) - return false; - - // CMP Destination with src (cmp internally is a discarded subtract) - uint64_t result = (uint64_t)dest - (uint64_t)src; - - // The CF, OF, SF, ZF, AF, and PF flags are set according to the result. - EmuX86_SetFlags_OSZAPC(e, - /*EMUX86_EFLAG_OF*/OF_Sub(result, src, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, src, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/CFCalc(result)); - - return true; -} - -bool EmuX86_Opcode_CMPXCHG(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // Read value from Source and Destination - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 1, &src)) - return false; - - uint32_t dest = 0; - if (!EmuX86_Operand_Read(e, info, 0, &dest)) - return false; - - if (src == dest) { - // Write the source value to the destination operand - if (!EmuX86_Operand_Write(e, info, 0, src)) { - return false; - } - } else { - // Write the dest value to the source operand - if (!EmuX86_Operand_Write(e, info, 1, dest)) { - return false; - } - } - - // Perform arithmatic operation for flag calculation - uint64_t result = (uint64_t)dest - (uint64_t)src; - - // CF, PF, AF, SF, and OF are set according to the result - EmuX86_SetFlags_OSZAPC(e, - /*EMUX86_EFLAG_OF*/OF_Sub(result, src, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, src, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/CFCalc(result)); - - return true; -} - -void EmuX86_Opcode_CPUID(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // This CPUID emulation is based on : - // https://github.com/docbrown/vxb/wiki/Xbox-CPUID-Information - // https://github.com/docbrown/vxb/wiki/Xbox-Hardware-Information and - // http://www.sandpile.org/x86/cpuid.htm - switch (e->ContextRecord->Eax) { // simpler than EmuX86_GetRegisterValue32(e, R_EAX) - case 0: { // CPUID Function 0, return the maximum supported standard level and vendor ID string - // Maximum supported standard level - e->ContextRecord->Eax = 2; - // "GenuineIntel" Intel processor - e->ContextRecord->Ebx = (ULONG)'uneG'; - e->ContextRecord->Edx = (ULONG)'Ieni'; - e->ContextRecord->Ecx = (ULONG)'letn'; - return; - } - case 1: { // CPUID Function 1, Return the processor type / family / model / stepping and feature flags - // Family 6, Model 8, Stepping 10 - e->ContextRecord->Eax = 0x68a; - e->ContextRecord->Ebx = 0; - e->ContextRecord->Ecx = 0; - // Feature Flags - e->ContextRecord->Edx = 0x383F9FF; // FPU, VME, DE, PSE, TSC, MSR, PAE, MCE, CX8, SEP, MTRR, PGE, MCA, CMOV, PAT, PSE36, MMX, FXSR, SSE - return; - } - case 2: { // CPUID Function 2, Return the processor configuration descriptors - // AL : 01 = number of times this level must be queried to obtain all configuration descriptors - // EAX nibble 1 = 01h : code TLB, 4K pages, 4 ways, 32 entries - // EAX nibble 2 = 02h : code TLB, 4M pages, fully, 2 entries - // EAX nibble 3 = 03h : data TLB, 4K pages, 4 ways, 64 entries - e->ContextRecord->Eax = 0x3020101; - // EBX and ECX nibbles = 00h : null descriptor (=unused descriptor) - e->ContextRecord->Ebx = 0; - e->ContextRecord->Ecx = 0; - // EDX nibble 0 = 41h : code and data L2 cache, 128 KB, 4 ways, 32 byte lines - // EDX nibble 1 = 08h : code L1 cache, 16 KB, 4 ways, 32 byte lines - // EDX nibble 2 = 04h : data TLB, 4M pages, 4 ways, 8 entries - // EDX nibble 3 = 0Ch : data L1 cache, 16 KB, 4 ways, 32 byte lines - e->ContextRecord->Edx = 0xC040841; - return; - } - } - - // Note : CPUID instructions never update CPU flags -} - -bool EmuX86_Opcode_DEC(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // DEC reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - uint32_t dest = EmuX86_Addr_Read(opAddr); - - // DEC Destination to src - uint64_t result = (uint64_t)dest - (uint64_t)1; - - // Write result back - EmuX86_Addr_Write(opAddr, static_cast(result)); - - // The CF flag is not affected. The OF, SF, ZF, AF, and PF flags are set according to the result. - EmuX86_SetFlags_OSZAP(e, - /*EMUX86_EFLAG_OF*/OF_Sub(result, 1, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, 1, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result)); - - return true; -} - -bool EmuX86_Opcode_IN(LPEXCEPTION_POINTERS e, _DInst& info) -{ - uint32_t addr; - if (!EmuX86_Operand_Read(e, info, 1, &addr)) - return false; - - // IN does an I/O read on the address, writing the value to the second operand : - uint32_t value = EmuX86_IORead(addr, info.ops[0].size / 8); // Convert size in bits into bytes - - if (!EmuX86_Operand_Write(e, info, 0, value)) { - return false; - } - - // Note : IN instructions never update CPU flags - - return true; -} - -bool EmuX86_Opcode_INC(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // INC reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - uint32_t dest = EmuX86_Addr_Read(opAddr); - - // INC Destination to src - uint64_t result = (uint64_t)dest + (uint64_t)1; - - // Write result back - EmuX86_Addr_Write(opAddr, static_cast(result)); - - // The CF flag is not affected. The OF, SF, ZF, AF, and PF flags are set according to the re - EmuX86_SetFlags_OSZAP(e, - /*EMUX86_EFLAG_OF*/OF_Add(result, 1, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, 1, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result)); - - return true; -} - -bool EmuX86_Opcode_MOV(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // MOV reads value from source : - uint32_t value = 0; - if (!EmuX86_Operand_Read(e, info, 1, &value)) - return false; - - // MOV writes value to destination : - if (!EmuX86_Operand_Write(e, info, 0, value)) - return false; - - // Note : MOV instructions never update CPU flags - - return true; -} - -bool EmuX86_Opcode_MOVSX(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // MOVSX reads value from source : - uint32_t value = 0; - if (!EmuX86_Operand_Read(e, info, 1, &value)) - return false; - - // Do MOVSX sign-extension - switch (info.ops[1].size) { - case 8: - if (value & 0x80) - value |= 0xFFFFFF00; - break; - case 16: - if (value & 0x8000) - value |= 0xFFFF0000; - break; - } - - // MOVSX writes value to destination : - if (!EmuX86_Operand_Write(e, info, 0, value)) - return false; - - // Note : MOVSX instructions never update CPU flags - - return true; -} - -bool EmuX86_Opcode_MOVZX(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // MOVZX reads value from source : - uint32_t value = 0; - if (!EmuX86_Operand_Read(e, info, 1, &value)) - return false; - - // TODO : Implement MOVZX zero-extension! - - // MOVZX writes value to destination : - if (!EmuX86_Operand_Write(e, info, 0, value)) - return false; - - // Note : MOVZX instructions never update CPU flags - - return true; -} - -bool EmuX86_Opcode_OR(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // Read value from Source and Destination - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 1, &src)) - return false; - - // OR reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - uint32_t dest = EmuX86_Addr_Read(opAddr); - - // OR Destination with src - uint32_t result = dest | src; - - // Write back the result - EmuX86_Addr_Write(opAddr, result); - - // The OF and CF flags are cleared; the SF, ZF, and PF flags are set according to the result. The state of the AF flag is undefined. - EmuX86_SetFlags_OSZPC(e, - /*EMUX86_EFLAG_OF*/0, - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/0); - - return true; -} - -bool EmuX86_Opcode_OUT(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // OUT will address the first operand : - uint32_t addr; - if (!EmuX86_Operand_Read(e, info, 0, &addr)) - return false; - - uint32_t value; - if (!EmuX86_Operand_Read(e, info, 1, &value)) - return false; - - // OUT does an I/O write on the address, using the value from the second operand : - EmuX86_IOWrite(addr, value, info.ops[1].size / 8); // Convert size in bits into bytes - - // Note : OUT instructions never update CPU flags - -return true; -} - -bool EmuX86_Opcode_SUB(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // Read value from Source and Destination - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 1, &src)) - return false; - - // SUB reads and writes the same operand : - OperandAddress opAddr; - if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) - return false; - - uint32_t dest = EmuX86_Addr_Read(opAddr); - - // SUB Destination with src - uint64_t result = (uint64_t)dest - (uint64_t)src; - - // Write result back - EmuX86_Addr_Write(opAddr, static_cast(result)); - - // The OF, SF, ZF, AF, PF, and CF flags are set according to the result. - EmuX86_SetFlags_OSZAPC(e, - /*EMUX86_EFLAG_OF*/OF_Sub(result, src, dest), - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_AF*/AFCalc(result, src, dest), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/CFCalc(result)); - - return true; -} - -bool EmuX86_Opcode_TEST(LPEXCEPTION_POINTERS e, _DInst& info) -{ - // TEST reads first value : - uint32_t src = 0; - if (!EmuX86_Operand_Read(e, info, 0, &src)) - return false; - - // TEST reads second value : - uint32_t dest = 0; - if (!EmuX86_Operand_Read(e, info, 1, &dest)) - return false; - - // TEST performs bitwise AND between first and second value : - uint32_t result = src & dest; - - // https://en.wikipedia.org/wiki/TEST_(x86_instruction) - // The OF and CF flags are set to 0. The SF, ZF, and PF flags are set according to the result. The state of the AF flag is undefined. - EmuX86_SetFlags_OSZPC(e, - /*EMUX86_EFLAG_OF*/0, - /*EMUX86_EFLAG_SF*/SFCalc(result), - /*EMUX86_EFLAG_ZF*/ZFCalc(result), - /*EMUX86_EFLAG_PF*/PFCalc(result), - /*EMUX86_EFLAG_CF*/0); - - // result is thrown away - - return true; -} - -bool EmuX86_DecodeOpcode(const uint8_t *Eip, _DInst &info) -{ - unsigned int decodedInstructionsCount = 0; - - _CodeInfo ci; - ci.code = (uint8_t*)Eip; - ci.codeLen = 20; - ci.codeOffset = 0; - ci.dt = (_DecodeType)Decode32Bits; - ci.features = DF_NONE; - - // Checking for DECRES_SUCCESS won't work, since we're passing distorm_decompose - // a codeLen big enough to decode any instruction-length, plus distorm doesn't - // halt cleanly after reaching maxInstructions 1. So instead, just call distorm : - distorm_decompose(&ci, &info, /*maxInstructions=*/1, &decodedInstructionsCount); - // and check if it successfully decoded one instruction : - return (decodedInstructionsCount == 1); -} - -int EmuX86_OpcodeSize(uint8_t *Eip) -{ - _DInst info; - if (EmuX86_DecodeOpcode((uint8_t*)Eip, info)) - return info.size; - - EmuWarning("Error decoding opcode size at 0x%.8X", Eip); - return 1; -} - -bool EmuX86_DecodeException(LPEXCEPTION_POINTERS e) -{ - // Only decode instructions which reside in the loaded Xbe - if (e->ContextRecord->Eip > XBE_MAX_VA || e->ContextRecord->Eip < XBE_IMAGE_BASE) { - return false; - } - - // Decoded instruction information. - // Opcode handler note : - // If an opcode or one of it's operand can't be decoded, that's a clear failure. - // However, if for any reason, an opcode operand cannot be read from or written to, - // that case may be logged, but it shouldn't fail the opcode handler. - _DInst info; - if (!EmuX86_DecodeOpcode((uint8_t*)e->ContextRecord->Eip, OUT info)) { - EmuWarning("Error decoding opcode at 0x%08X", e->ContextRecord->Eip); - return false; - } - - switch (info.opcode) { // Keep these cases alphabetically ordered and condensed - case I_ADD: - if (EmuX86_Opcode_ADD(e, info)) break; - goto opcode_error; - case I_AND: - if (EmuX86_Opcode_AND(e, info)) break; - goto opcode_error; - case I_CMP: - if (EmuX86_Opcode_CMP(e, info)) break; - goto opcode_error; - case I_CMPXCHG: - if (EmuX86_Opcode_CMPXCHG(e, info)) break; - goto opcode_error; - case I_CPUID: - EmuX86_Opcode_CPUID(e, info); - break; - case I_DEC: - if (EmuX86_Opcode_DEC(e, info)) break; - goto opcode_error; - case I_IN: - if (EmuX86_Opcode_IN(e, info)) break; - goto opcode_error; - case I_INC: - if (EmuX86_Opcode_INC(e, info)) break; - goto opcode_error; - case I_INVD: // Flush internal caches; initiate flushing of external caches. - break; // We can safely ignore this - case I_MOV: - if (EmuX86_Opcode_MOV(e, info)) break; - goto opcode_error; - case I_MOVSX: - if (EmuX86_Opcode_MOVSX(e, info)) break; - goto opcode_error; - case I_MOVZX: - if (EmuX86_Opcode_MOVZX(e, info)) break; - goto opcode_error; - case I_OR: - if (EmuX86_Opcode_OR(e, info)) break; - goto opcode_error; - case I_OUT: - if (EmuX86_Opcode_OUT(e, info)) break; - goto opcode_error; - case I_SUB: - if (EmuX86_Opcode_SUB(e, info)) break; - goto opcode_error; - case I_TEST: - if (EmuX86_Opcode_TEST(e, info)) break; - goto opcode_error; - case I_WBINVD: // Write back and flush internal caches; initiate writing-back and flushing of external caches. - break; // We can safely ignore this - case I_WRMSR: - // We do not emulate processor specific registers just yet - // Some titles attempt to manually set the TSC via this instruction - // This needs fixing eventually, but should be acceptible to ignore for now! - // Chase: Hollywood Stunt Driver hits this - EmuWarning("WRMSR instruction ignored"); - break; - default: - EmuWarning("Unhandled instruction : %u", info.opcode); - e->ContextRecord->Eip += info.size; - return false; - } - - // When falling through here, the instruction was handled correctly, - // skip over the instruction and continue execution : - e->ContextRecord->Eip += info.size; - return true; - -opcode_error: - EmuWarning("0x%08X: Error while handling instruction %u", e->ContextRecord->Eip, info.opcode); // TODO : format decodedInstructions[0] - e->ContextRecord->Eip += info.size; - return false; -} - -void EmuX86_Init() -{ - DbgPrintf("X86 : Initializing distorm version %d\n", distorm_version()); - EmuX86_InitContextRecordOffsetByRegisterType(); -} diff --git a/src/CxbxKrnl/EmuXInput.cpp b/src/CxbxKrnl/EmuXInput.cpp deleted file mode 100644 index 17d72e27c..000000000 --- a/src/CxbxKrnl/EmuXInput.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDInput.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "XINP" - -#include "Emu.h" -#include "EmuXTL.h" -#include "EmuShared.h" -#include "EmuXInput.h" - -#include - - -// ****************************************************************** -// * Static Variable(s) -// ****************************************************************** -static XINPUT_STATE g_Controller;//global controller input state for host. -static BOOL g_bXInputInitialized = FALSE; - -// -// -// -DWORD XTL::XInputGamepad_Connected(void) -{ - DWORD dwResult; - DWORD gamepad_connected = 0; - for (DWORD i = 0; i< 4; i++) - { - ZeroMemory(&g_Controller, sizeof(XINPUT_STATE)); - - // query each port for gamepad state - dwResult = XInputGetState(i, &g_Controller); - - //success means gamepad is connected - if (dwResult == ERROR_SUCCESS) - { - gamepad_connected++; - } - } - return gamepad_connected; -} -// ****************************************************************** -// * patch: XInputPCPoll -// ****************************************************************** -void XTL::EmuXInputPCPoll( DWORD dwPort,XTL::PX_XINPUT_STATE pXboxController ) -{ - // - // Get the PC's XInput values - // - - if( XInputGetState( dwPort, &g_Controller ) != ERROR_SUCCESS ) - return; - - //Packet# must be updated to trigger the xbe processing the input state. - pXboxController->dwPacketNumber = g_Controller.dwPacketNumber; - - // - // Now convert those values to Xbox XInput - // - // Analog Sticks - pXboxController->Gamepad.sThumbLX = g_Controller.Gamepad.sThumbLX; - pXboxController->Gamepad.sThumbLY = g_Controller.Gamepad.sThumbLY; - pXboxController->Gamepad.sThumbRX = g_Controller.Gamepad.sThumbRX; - pXboxController->Gamepad.sThumbRY = g_Controller.Gamepad.sThumbRY; - - // Analog Buttons - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_A] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_A) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_B] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_B) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_X] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_X) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_Y] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_Y) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_WHITE] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_BLACK] = (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) ? 255 : 0; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_LEFT_TRIGGER] = g_Controller.Gamepad.bLeftTrigger; - pXboxController->Gamepad.bAnalogButtons[X_XINPUT_GAMEPAD_RIGHT_TRIGGER] = g_Controller.Gamepad.bRightTrigger; - - // Digital Buttons - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_BACK) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_BACK; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_BACK; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_START) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_START; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_START; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_LEFT_THUMB; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_LEFT_THUMB; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_RIGHT_THUMB; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_RIGHT_THUMB; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_UP; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_UP; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_DOWN; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_DOWN; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_LEFT; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_LEFT; - } - - if (g_Controller.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) { - pXboxController->Gamepad.wButtons |= X_XINPUT_GAMEPAD_DPAD_RIGHT; - } else { - pXboxController->Gamepad.wButtons &= ~X_XINPUT_GAMEPAD_DPAD_RIGHT; - } -} - - -// ****************************************************************** -// * Native implementation of XInputSetState -// ****************************************************************** -void XTL::EmuXInputSetState(DWORD dwPort, XTL::PX_XINPUT_FEEDBACK Feedback) -{ - XINPUT_VIBRATION FrameVibration = - { - Feedback->Rumble.wLeftMotorSpeed, - Feedback->Rumble.wRightMotorSpeed - }; - - // - // Set the PC XInput state - - XInputSetState(dwPort, &FrameVibration); -} diff --git a/src/CxbxKrnl/EmuXOnline.cpp b/src/CxbxKrnl/EmuXOnline.cpp deleted file mode 100644 index c4e37d228..000000000 --- a/src/CxbxKrnl/EmuXOnline.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXOnline.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "XONL" - -#include "Emu.h" -#include "Logging.h" -#include "EmuFS.h" -#include "EmuXTL.h" - -/* -// ****************************************************************** -// * patch: WSAStartup -// ****************************************************************** -int WINAPI XTL::EMUPATCH(WSAStartup) -( - WORD wVersionRequested, - WSADATA *lpWSAData -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(wVersionRequested) - LOG_FUNC_ARG(lpWSAData) - LOG_FUNC_END; - - // Prevent this function from failing by requesting a version of Winsock that - // we know for sure is actually supported on Windows. This also fixes one error - // in the 4920 dashboard. - int ret = WSAStartup(MAKEWORD(2,2) /*wVersionRequested, lpWSAData); - - RETURN(ret); -} - -/* -// ****************************************************************** -// * patch: XNetStartup -// ****************************************************************** -INT WINAPI XTL::EMUPATCH(XNetStartup) -( - const PVOID pDummy -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(pDummy); - - // Fake Successfull...hehehe...sucker...hehehehehe - INT ret = 0; - - RETURN(ret); -} - - -// ****************************************************************** -// * patch: This::Emusocket -// ****************************************************************** -SOCKET WINAPI XTL::EMUPATCH(socket) -( - int af, - int type, - int protocol -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(af) - LOG_FUNC_ARG(type) - LOG_FUNC_ARG(protocol) - LOG_FUNC_END; - - SOCKET ret = socket(af, type, protocol); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emuconnect -// ****************************************************************** -int WINAPI XTL::EMUPATCH(connect) -( - SOCKET s, - const struct sockaddr FAR *name, - int namelen -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(name) - LOG_FUNC_ARG(namelen) - LOG_FUNC_END; - - int ret = connect(s, name, namelen); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emusend -// ****************************************************************** -int WINAPI XTL::EMUPATCH(send) -( - SOCKET s, - const char FAR *buf, - int len, - int flags -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(buf) - LOG_FUNC_ARG(len) - LOG_FUNC_ARG(flags) - LOG_FUNC_END; - - int ret = send(s, buf, len, flags); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emurecv -// ****************************************************************** -int WINAPI XTL::EMUPATCH(recv) -( - SOCKET s, - char FAR *buf, - int len, - int flags -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(buf) - LOG_FUNC_ARG(len) - LOG_FUNC_ARG(flags) - LOG_FUNC_END; - - int ret = recv(s, buf, len, flags); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emubind -// ****************************************************************** -int WINAPI XTL::EMUPATCH(bind) -( - SOCKET s, - const struct sockaddr FAR *name, - int namelen -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(name) - LOG_FUNC_ARG(namelen) - LOG_FUNC_END; - - // TODO: Host-To-Network order if necessary (probably not?) - - int ret = bind(s, name, namelen); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emulisten -// ****************************************************************** -int WINAPI XTL::EMUPATCH(listen) -( - SOCKET s, - int backlog -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(backlog) - LOG_FUNC_END; - - // TODO: Host-To-Network order if necessary (probably not?) - - int ret = listen(s, backlog); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: This::Emuioctlsocket -// ****************************************************************** -int WINAPI XTL::EMUPATCH(ioctlsocket) -( - SOCKET s, - long cmd, - u_long FAR *argp -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(s) - LOG_FUNC_ARG(cmd) - LOG_FUNC_ARG(argp) - LOG_FUNC_END; - - int ret = ioctlsocket(s, cmd, argp); - - RETURN(ret); -} -*/ - -// ****************************************************************** -// * patch: XOnlineLaunchNewImage -// ****************************************************************** -HRESULT WINAPI XOnlineLaunchNewImage -( - LPCSTR lpImagePath, - LPVOID pLaunchData -) -{ - LOG_FUNC_BEGIN - LOG_FUNC_ARG(lpImagePath) - LOG_FUNC_ARG(pLaunchData) - LOG_FUNC_END; - - // TODO: Launch another .xbe from Cxbx someday? - - HRESULT ret = E_FAIL; - - RETURN(ret); -} - -/* -// ****************************************************************** -// * patch: XOnlineLogon -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(XOnlineLogon) -( - VOID* pUsers, - DWORD* pdwServiceIDs, - DWORD dwServices, - HANDLE hEvent, - HANDLE pHandle -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pUsers) - LOG_FUNC_ARG(pdwServiceIDs) - LOG_FUNC_ARG(dwServices) - LOG_FUNC_ARG(hEvent) - LOG_FUNC_ARG(pHandle) - LOG_FUNC_END; - - // TODO: What will it take to log on to Xbox Live? - - HRESULT ret = HRESULT(0x80151000L); // XONLINE_E_LOGON_NO_NETWORK_CONNECTION - - RETURN(ret); -} -*/ \ No newline at end of file diff --git a/src/CxbxKrnl/EmuXTL.h b/src/CxbxKrnl/EmuXTL.h deleted file mode 100644 index d9f9de73a..000000000 --- a/src/CxbxKrnl/EmuXTL.h +++ /dev/null @@ -1,62 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXTL.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef EMUXTL_H -#define EMUXTL_H - -#include // Needed for EmuDSound.h file, must be outside of XTL namespace. - -namespace XTL -{ - #include "EmuXapi.h" - #include "EmuD3D8.h" - #include "EmuD3D8\Convert.h" - #include "EmuD3D8\VertexBuffer.h" - #include "EmuD3D8\PushBuffer.h" - #include "EmuD3D8\VertexShader.h" - #include "EmuD3D8\PixelShader.h" - #include "EmuD3D8\State.h" - #include "EmuDInput.h" - #include "EmuDSound.h" - #include "EmuXOnline.h" - #include "EmuXG.h" - #include "EmuXactEng.h" - #include "EmuXInput.h" -} - -extern XTL::IDirect3DDevice *g_pD3DDevice; -extern DWORD g_CurrentXboxVertexShaderHandle; -extern XTL::X_PixelShader* g_D3DActivePixelShader; -extern BOOL g_bIsFauxFullscreen; - -#endif diff --git a/src/CxbxKrnl/EmuXapi.cpp b/src/CxbxKrnl/EmuXapi.cpp deleted file mode 100644 index 75c18e1b4..000000000 --- a/src/CxbxKrnl/EmuXapi.cpp +++ /dev/null @@ -1,1967 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXapi.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -#define LOG_PREFIX "XAPI" - -#undef FIELD_OFFSET // prevent macro redefinition warnings -/* prevent name collisions */ -namespace xboxkrnl -{ - #include -}; - -#include -#include "CxbxKrnl.h" -#include "Logging.h" -#include "Emu.h" -#include "EmuKrnl.h" // For DefaultLaunchDataPage -#include "EmuFile.h" -#include "EmuFS.h" -#include "EmuShared.h" -#include "../Common/Win32/XBPortMapping.h" -#include "HLEIntercept.h" -#include "CxbxVSBC/CxbxVSBC.h" -#include "Windef.h" -#include - -// XInputSetState status waiters -extern XInputSetStateStatus g_pXInputSetStateStatus[XINPUT_SETSTATE_SLOTS] = {0}; - -// XInputOpen handles -extern HANDLE g_hInputHandle[XINPUT_HANDLE_SLOTS] = {0}; - -bool g_bXInputOpenCalled = false; -bool g_bCxbxVSBCLoaded = false; -HINSTANCE g_module; -typedef int (FAR WINAPI *PFARPROC1)(int); -typedef int (FAR WINAPI *PFARPROC2)(UCHAR*); -typedef int (NEAR WINAPI *PNEARPROC1)(int); -typedef int (NEAR WINAPI *PNEARPROC2)(UCHAR*); -typedef int (WINAPI *PPROC)(); - -PFARPROC2 fnCxbxVSBCSetState; -PFARPROC2 fnCxbxVSBCGetState; -PFARPROC1 fnCxbxVSBCOpen; -//typedef DWORD(*fnCxbxVSBCOpen)(HWND); -//typedef DWORD(*fnCxbxVSBCSetState)(UCHAR *); -//typedef DWORD(*fnCxbxVSBCGetState)(UCHAR *); -XTL::PXPP_DEVICE_TYPE gDeviceType_Gamepad = nullptr; - -#include "EmuXTL.h" - - -XTL::X_POLLING_PARAMETERS_HANDLE g_pph[4]; -XTL::X_XINPUT_POLLING_PARAMETERS g_pp[4]; -//for host connected gamepad -DWORD total_xinput_gamepad = 0; -//global bridge for xbox controller to host, 4 elements for 4 ports. -XTL::X_CONTROLLER_HOST_BRIDGE g_XboxControllerHostBridge[4] = {}; -//global xbox xinput device info from interpreting device table. -std::vector g_XboxInputDeviceInfo; - - - -//look for xbox Device info from global info vector, and return the found index. return -1 for not found. -int FindDeviceInfoIndexByXboxType(UCHAR ucType) -{ - size_t i; - for (i = 0; i < g_XboxInputDeviceInfo.size(); i++) { - if (g_XboxInputDeviceInfo[i].ucType == ucType) { - return i; - } - } - return -1; -} - -//look for xbox Device info from global info vector, and return the found index. return -1 for not found. -int FindDeviceInfoIndexByDeviceType(XTL::PXPP_DEVICE_TYPE DeviceType) -{ - size_t i; - for (i = 0; i < g_XboxInputDeviceInfo.size(); i++) { - if (g_XboxInputDeviceInfo[i].DeviceType == DeviceType) { - return i; - } - } - return -1; -} - -//init XboxControllerHostBridge's content, also put interpreted data from device table to it. -//this is called in the end of SetupXboxDeviceTypes(), later we'll move this code to accept user configuration. -void InitXboxControllerHostBridge(void) -{ - //load host type and port configuration from registry. - XBPortMappingLoad("Software\\Cxbx-Reloaded\\XboxPortHostMapping"); - total_xinput_gamepad = XTL::XInputGamepad_Connected(); - - int port; - for (port = 0; port < 4; port++) { - g_XboxControllerHostBridge[port].dwHostType = GetXboxPortMapHostType(port); - g_XboxControllerHostBridge[port].dwHostPort = GetXboxPortMapHostPort(port); - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucType = X_XINPUT_DEVTYPE_GAMEPAD; - switch (GetXboxPortMapHostType(port)) { - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT: - //disconnect to host if the host port of xinput exceeds the total xinput controller connected to host. - if (g_XboxControllerHostBridge[port].dwHostPort >= total_xinput_gamepad) { - g_XboxControllerHostBridge[port].dwHostType = X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT; - printf("InitXboxControllerHostBridge: Host XInput port greater then total xinut controller connected. disconnect xbox port from host!\n"); - } - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT: - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC: - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucType = X_XINPUT_DEVTYPE_STEELBATALION; - break; - default: - break; - } - g_XboxControllerHostBridge[port].dwXboxPort = port; - //xbox device handle set to 0 before being open. - g_XboxControllerHostBridge[port].hXboxDevice = 0; - int index; - //find corresponding XboxDeviceInfo - index=FindDeviceInfoIndexByXboxType(g_XboxControllerHostBridge[port].XboxDeviceInfo.ucType); - if (index == -1) { - printf("XboxControllerHostBridge XboxDeviceInfo.ucType: %d not found in global XboxInputDeviceInfo vector!\n", g_XboxControllerHostBridge[port].XboxDeviceInfo.ucType); - } - //copy XboxDeviceInfo from the global vector. - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucSubType = g_XboxInputDeviceInfo[index].ucSubType; - g_XboxControllerHostBridge[port].XboxDeviceInfo.DeviceType = g_XboxInputDeviceInfo[index].DeviceType; - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucInputStateSize = g_XboxInputDeviceInfo[index].ucInputStateSize; - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucFeedbackSize = g_XboxInputDeviceInfo[index].ucFeedbackSize; - //these two members are not used yet. - g_XboxControllerHostBridge[port].pXboxState = 0; - g_XboxControllerHostBridge[port].pXboxFeedbackHeader = 0; - } -} -void SetupXboxDeviceTypes() -{ - // If we don't yet have the offset to gDeviceType_Gamepad, work it out! - if (gDeviceType_Gamepad == nullptr) { - // First, attempt to find GetTypeInformation - auto typeInformation = g_SymbolAddresses.find("GetTypeInformation"); - if (typeInformation != g_SymbolAddresses.end() && typeInformation->second != xbnull) { - printf("Deriving XDEVICE_TYPE_GAMEPAD from DeviceTable (via GetTypeInformation)\n"); - // Read the offset values of the device table structure from GetTypeInformation - xbaddr deviceTableStartOffset = *(uint32_t*)((uint32_t)typeInformation->second + 0x01); - xbaddr deviceTableEndOffset = *(uint32_t*)((uint32_t)typeInformation->second + 0x09); - - // Calculate the number of device entires in the table - size_t deviceTableEntryCount = (deviceTableEndOffset - deviceTableStartOffset) / sizeof(uint32_t); - - printf("DeviceTableStart: 0x%08X\n", deviceTableStartOffset); - printf("DeviceTableEnd: 0x%08X\n", deviceTableEndOffset); - printf("DeviceTable Entires: %u\n", deviceTableEntryCount); - - // Sanity check: Where all these device offsets within Xbox memory - if ((deviceTableStartOffset >= g_SystemMaxMemory) || (deviceTableEndOffset >= g_SystemMaxMemory)) { - CxbxKrnlCleanup("XAPI DeviceTable Location is outside of Xbox Memory range"); - } - - // Iterate through the table until we find gamepad - XTL::PXID_TYPE_INFORMATION* deviceTable = (XTL::PXID_TYPE_INFORMATION*)(deviceTableStartOffset); - for (unsigned int i = 0; i < deviceTableEntryCount; i++) { - // Skip empty table entries - if (deviceTable[i] == nullptr) { - continue; - } - - printf("----------------------------------------\n"); - printf("DeviceTable[%u]->ucType = %d\n", i, deviceTable[i]->ucType); - printf("DeviceTable[%u]->XppType = 0x%08X (", i, deviceTable[i]->XppType); - - XTL::X_XINPUT_DEVICE_INFO CurrentInfo = {}; - CurrentInfo.ucType = deviceTable[i]->ucType; - CurrentInfo.DeviceType = deviceTable[i]->XppType; - if (deviceTable[i]->pInputStateDesc!=0) { - CurrentInfo.ucInputStateSize = deviceTable[i]->pInputStateDesc->ucSize; - } - if(deviceTable[i]->pFeedbackDesc!=0){ - CurrentInfo.ucFeedbackSize = deviceTable[i]->pFeedbackDesc->ucSize; - } - - switch (deviceTable[i]->ucType) { - case X_XINPUT_DEVTYPE_GAMEPAD: - gDeviceType_Gamepad = deviceTable[i]->XppType; - CurrentInfo.ucSubType = X_XINPUT_DEVSUBTYPE_GC_GAMEPAD; - printf("XDEVICE_TYPE_GAMEPAD)\n"); - break; - case X_XINPUT_DEVTYPE_STEELBATALION: - printf("XDEVICE_TYPE_STEELBATALION)\n"); - CurrentInfo.ucSubType = X_XINPUT_DEVSUBTYPE_GC_GAMEPAD_ALT; - break; - default: - printf("Unknown device type)\n"); - continue; - } - - //store the DeviceInfo in global vector. - g_XboxInputDeviceInfo.push_back(CurrentInfo); - } - } else { - // XDKs without GetTypeInformation have the GamePad address hardcoded in XInputOpen - // Only the earliest XDKs use this code path, and the offset never changed between them - // so this works well for us. - void* XInputOpenAddr = (void*)g_SymbolAddresses["XInputOpen"]; - if (XInputOpenAddr != nullptr) { - printf("XAPI: Deriving XDEVICE_TYPE_GAMEPAD from XInputOpen (0x%08X)\n", XInputOpenAddr); - gDeviceType_Gamepad = *(XTL::PXPP_DEVICE_TYPE*)((uint32_t)XInputOpenAddr + 0x0B); - - //only have one GAMEPAD device type. setup global DeviceInfo vector accordingly. - XTL::X_XINPUT_DEVICE_INFO CurrentInfo = {}; - CurrentInfo.ucType = X_XINPUT_DEVTYPE_GAMEPAD; - CurrentInfo.ucSubType = X_XINPUT_DEVSUBTYPE_GC_GAMEPAD; - CurrentInfo.DeviceType = gDeviceType_Gamepad; - CurrentInfo.ucInputStateSize = sizeof(XTL::X_XINPUT_GAMEPAD); - CurrentInfo.ucFeedbackSize = sizeof(XTL::X_XINPUT_RUMBLE); - //store the DeviceInfo in global vector. - g_XboxInputDeviceInfo.push_back(CurrentInfo); - } - } - - if (gDeviceType_Gamepad == nullptr) { - EmuWarning("XAPI: XDEVICE_TYPE_GAMEPAD was not found"); - return; - } - - printf("XAPI: XDEVICE_TYPE_GAMEPAD Found at 0x%08X\n", gDeviceType_Gamepad); - } -} - -// ****************************************************************** -// * patch: XInitDevices -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XInitDevices) -( - DWORD dwPreallocTypeCount, - PXDEVICE_PREALLOC_TYPE PreallocTypes -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwPreallocTypeCount) - LOG_FUNC_ARG((DWORD)PreallocTypes) - LOG_FUNC_END; - -/* for(int v=0;vdwTitleId == *pTitleId) { - result = true; - break; - } - - pTitleId++; - } - - // We didn't find a known JSRF title id, fallback to checking the title - // This isn't 100% effective, but could work for some versions of JSRF - // Because of this, we log a message to say that the title_id should be added - if (!result) { - char tAsciiTitle[40] = "Unknown"; - setlocale(LC_ALL, "English"); - wcstombs(tAsciiTitle, g_pCertificate->wszTitleName, sizeof(tAsciiTitle)); - - if (_strnicmp(tAsciiTitle, "Jet Set Radio", 13) == 0) { - CxbxPopupMessage(CxbxMsgDlgIcon_Info, "Detected JSRF by name, not title ID, please report that [%08X] should be added to the list", g_pCertificate->dwTitleId); - result = true; - } - } - - if (result) { - EmuWarning("Applying JSRF Hack"); - } - - detected = true; - return result; -} - -bool TitleIsLegoSW() -{ - static bool detected = false; - static bool result = false; - - // Prevent running the check every time this function is called - if (detected) { - return result; - } - - // Array of known Lego Star Wars title IDs, must be 0 terminated - DWORD titleIds[] = { - 0x4553001D, // v1.01 - PAL; v1.02 - NTSC - 0 - }; - - DWORD* pTitleId = &titleIds[0]; - while (*pTitleId != 0) { - if (g_pCertificate->dwTitleId == *pTitleId) { - result = true; - break; - } - - pTitleId++; - } - - if (result) { - EmuWarning("Applying Lego Star Wars Hack"); - } - - detected = true; - return result; -} - -// ****************************************************************** -// * patch: XGetDevices -// * Note: This could be unpatched however, -// * XInitDevices is required to be unpatched first. -// * This in turn requires USB LLE to be implemented, or USBD_Init -// * patched with a stub, so this patch is still enabled for now -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XGetDevices) -( - PXPP_DEVICE_TYPE DeviceType -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(DeviceType); - - UCHAR oldIrql = xboxkrnl::KeRaiseIrqlToDpcLevel(); - - DWORD ret = DeviceType->CurrentConnected; - DeviceType->ChangeConnected = 0; - DeviceType->PreviousConnected = DeviceType->CurrentConnected; - - int index = FindDeviceInfoIndexByDeviceType(DeviceType); - int port; - if (DeviceType->CurrentConnected == 0) { - for (port = 0; port < 4; port++) { - //if the host controller is connected and the xbox DeviceType matches. set the CurrentConnected flag. - if (g_XboxControllerHostBridge[port].XboxDeviceInfo.DeviceType == DeviceType && g_XboxControllerHostBridge[port].dwHostType>0) { - DeviceType->CurrentConnected |= 1 << port; - } - } - } - //the ChangeConnected flag must be set here together with the CurrentConnected flag. - DeviceType->ChangeConnected = DeviceType->CurrentConnected; - - // JSRF Hack: Don't set the ChangeConnected flag. Without this, JSRF hard crashes - // TODO: Why is this still needed? - if (DeviceType == gDeviceType_Gamepad && TitleIsJSRF()) { - DeviceType->ChangeConnected = 0; - } - ret = DeviceType->CurrentConnected; - - xboxkrnl::KfLowerIrql(oldIrql); - - RETURN(ret); -} - -// ****************************************************************** -// * patch: XGetDeviceChanges -// * Note: This could be unpatched however, -// * XInitDevices is required to be unpatched first. -// * This in turn requires USB LLE to be implemented, or USBD_Init -// * patched with a stub, so this patch is still enabled for now -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(XGetDeviceChanges) -( - PXPP_DEVICE_TYPE DeviceType, - PDWORD pdwInsertions, - PDWORD pdwRemovals -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(DeviceType) - LOG_FUNC_ARG(pdwInsertions) - LOG_FUNC_ARG(pdwRemovals) - LOG_FUNC_END; - - BOOL ret = FALSE; - - // If this device type was not previously detected, connect one (or more) - // some titles call XGetDevices first, and the CurrentConnected and ChangeConnected flags are set there. - // note that certain titles such as Otogi need the ChangeConnected to be set to 1 always to enable the input. - int port; - if (DeviceType->CurrentConnected == 0) { - for (port = 0; port < 4; port++) { - //if the host controller is connected and the xbox DeviceType matches. set the CurrentConnected flag. - if (g_XboxControllerHostBridge[port].XboxDeviceInfo.DeviceType == DeviceType && g_XboxControllerHostBridge[port].dwHostType>0) { - DeviceType->CurrentConnected |= 1 << port; - } - } - DeviceType->ChangeConnected = DeviceType->CurrentConnected; - } - - // JSRF Hack: Don't set the ChangeConnected flag. Without this, JSRF hard crashes - if (TitleIsJSRF()) { - DeviceType->ChangeConnected = 0; - } - - if(!DeviceType->ChangeConnected) - { - *pdwInsertions = 0; - *pdwRemovals = 0; - } - else - { - UCHAR oldIrql = xboxkrnl::KeRaiseIrqlToDpcLevel(); - - *pdwInsertions = (DeviceType->CurrentConnected & ~DeviceType->PreviousConnected); - *pdwRemovals = (DeviceType->PreviousConnected & ~DeviceType->CurrentConnected); - ULONG RemoveInsert = DeviceType->ChangeConnected & - DeviceType->CurrentConnected & - DeviceType->PreviousConnected; - *pdwRemovals |= RemoveInsert; - *pdwInsertions |= RemoveInsert; - DeviceType->ChangeConnected = 0; - DeviceType->PreviousConnected = DeviceType->CurrentConnected; - ret = (*pdwInsertions | *pdwRemovals) ? TRUE : FALSE; - - xboxkrnl::KfLowerIrql(oldIrql); - } - - // Lego SW Hack: Require XGetDeviceChanges to return changes all the time, but no removal, only insertions. - // Without this, Lego SW will not response to controller's input. - if (TitleIsLegoSW()) { - *pdwRemovals = 0; - *pdwInsertions = DeviceType->CurrentConnected; - ret = TRUE; - } - - RETURN(ret); -} - -// ****************************************************************** -// * patch: XInputOpen -// ****************************************************************** -HANDLE WINAPI XTL::EMUPATCH(XInputOpen) -( - IN PXPP_DEVICE_TYPE DeviceType, - IN DWORD dwPort, - IN DWORD dwSlot, - IN PX_XINPUT_POLLING_PARAMETERS pPollingParameters OPTIONAL -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(DeviceType) - LOG_FUNC_ARG(dwPort) - LOG_FUNC_ARG(dwSlot) - LOG_FUNC_ARG(pPollingParameters) - LOG_FUNC_END; - - X_POLLING_PARAMETERS_HANDLE *pph = 0; - //OLD_XINPUT - //rever back to return handle for port 0~3, this is for multi controller support. -/* if(dwPort >= 0 && (dwPort <= total_xinput_gamepad)) - { - if(g_hInputHandle[dwPort] == 0) - { - pph = (X_POLLING_PARAMETERS_HANDLE*) &g_pph[dwPort]; // new XB_POLLING_PARAMETERS_HANDLE(); - - if(pPollingParameters != NULL) - { - pph->pPollingParameters = (X_XINPUT_POLLING_PARAMETERS*) &g_pp[dwPort]; // new XINPUT_POLLING_PARAMETERS(); - - memcpy(pph->pPollingParameters, pPollingParameters, sizeof(X_XINPUT_POLLING_PARAMETERS)); - } - else - { - pph->pPollingParameters = NULL; - } - - g_hInputHandle[dwPort] = pph; - } - else - { - pph = (X_POLLING_PARAMETERS_HANDLE*)g_hInputHandle[dwPort]; - - if(pPollingParameters != 0) - { - if(pph->pPollingParameters == 0) - { - pph->pPollingParameters = (X_XINPUT_POLLING_PARAMETERS*) &g_pp[dwPort]; // new XINPUT_POLLING_PARAMETERS(); - } - - memcpy(pph->pPollingParameters, pPollingParameters, sizeof(X_XINPUT_POLLING_PARAMETERS)); - } - else - { - if(pph->pPollingParameters != 0) - { - //delete pph->pPollingParameters; - - pph->pPollingParameters = 0; - } - } - } - - pph->dwPort = dwPort; - } -*/ - g_bXInputOpenCalled = true; - - //RETURN((HANDLE)pph); - //code above are not used at all, in future we might remove them. - if (dwPort >= 0 && dwPort < 4) { - //check if the bridged xbox controller at this port matches the DeviceType, if matches, setup the device handle and return it. - if (g_XboxControllerHostBridge[dwPort].XboxDeviceInfo.DeviceType == DeviceType && g_XboxControllerHostBridge[dwPort].dwHostType!=0) { - //create the dialog for virtual SteelBatallion controller feedback status. - if(g_XboxControllerHostBridge[dwPort].dwHostType==X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC){ - //if DLL not loaded yet, load it. - if (g_bCxbxVSBCLoaded != true) { - - g_module = LoadLibrary(TEXT("CxbxVSBC.dll")); - if (g_module != 0) { - g_bCxbxVSBCLoaded = true; - } - } - if(g_module!=0&& fnCxbxVSBCOpen==0){ - fnCxbxVSBCSetState = (PFARPROC2)GetProcAddress(g_module, "VSBCSetState"); - fnCxbxVSBCGetState = (PFARPROC2)GetProcAddress(g_module, "VSBCGetState"); - fnCxbxVSBCOpen = (PFARPROC1)GetProcAddress(g_module, "VSBCOpen"); - } - - if (fnCxbxVSBCOpen == 0) { - printf("EmuXapi: EmuXInputOpen: GetPRocAddress VSBCOpen failed!\n"); - } - else { - (*fnCxbxVSBCOpen)(X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC); - } - //DWORD dwVXBCOpenResult = CxbxVSBC::MyCxbxVSBC::VSBCOpen(X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC); - - } - g_XboxControllerHostBridge[dwPort].hXboxDevice = &g_XboxControllerHostBridge[dwPort]; - return g_XboxControllerHostBridge[dwPort].hXboxDevice; - } - - } - - return 0; -} - -// ****************************************************************** -// * patch: XInputClose -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XInputClose) -( - IN HANDLE hDevice -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(hDevice); - - X_POLLING_PARAMETERS_HANDLE *pph = (X_POLLING_PARAMETERS_HANDLE*)hDevice; - DWORD dwPort = pph->dwPort; - //NULL out the input handle corresponds to port. - g_hInputHandle[dwPort] = 0; - - if(pph != NULL) - { - int v; - - for(v=0;vpPollingParameters != NULL) - { - delete pph->pPollingParameters; - } - - delete pph; - */ - } - - //above code is not used at all, in future we might remove them. - //reset hXboxDevice handle if it matches the hDevice - int port; - for(port=0;port<4;port++){ - if (g_XboxControllerHostBridge[dwPort].hXboxDevice == hDevice) { - g_XboxControllerHostBridge[dwPort].hXboxDevice=0; - break; - } - } -} - -// ****************************************************************** -// * patch: XInputPoll -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XInputPoll) -( - IN HANDLE hDevice -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(hDevice); - //OLD_XINPUT -/* X_POLLING_PARAMETERS_HANDLE *pph = (X_POLLING_PARAMETERS_HANDLE*)hDevice; - - // - // Poll input - // - - { - int v; - - for(v=0;vHeader.dwStatus != ERROR_SUCCESS) - { - if(pFeedback->Header.hEvent != 0) - { - SetEvent(pFeedback->Header.hEvent); - } - - pFeedback->Header.dwStatus = ERROR_SUCCESS; - } - } - } -*/ - int port; - for (port = 0; port<4; port++) { - if (g_XboxControllerHostBridge[port].hXboxDevice == hDevice) { - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader != 0) { - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader->dwStatus != ERROR_SUCCESS) { - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader->hEvent != 0) - { - SetEvent(g_XboxControllerHostBridge[port].pXboxFeedbackHeader->hEvent); - } - g_XboxControllerHostBridge[port].pXboxFeedbackHeader->dwStatus = ERROR_SUCCESS; - break; - } - } - else { - break; - } - } - } - - - - RETURN(ERROR_SUCCESS); -} - -// ****************************************************************** -// * patch: XInputGetCapabilities -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XInputGetCapabilities) -( - IN HANDLE hDevice, - OUT PX_XINPUT_CAPABILITIES pCapabilities -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hDevice) - LOG_FUNC_ARG_OUT(pCapabilities) - LOG_FUNC_END; - - DWORD ret = ERROR_DEVICE_NOT_CONNECTED; - - X_POLLING_PARAMETERS_HANDLE *pph = (X_POLLING_PARAMETERS_HANDLE*)hDevice; - //OLD_XINPUT -/* if(pph != NULL) - { - DWORD dwPort = pph->dwPort; - //return gamepad capabilities for port 0~3. - if(dwPort >= 0 && dwPort<=total_xinput_gamepad) - { - pCapabilities->SubType = X_XINPUT_DEVSUBTYPE_GC_GAMEPAD; - pCapabilities->In.Gamepad = {}; - pCapabilities->Out.Rumble = {}; - - ret = ERROR_SUCCESS; - } - } -*/ - //above code is not used any more, could be removed. - //find XboxControllerHostBridge per hDevice, and fill the Capabilities Structure per Device Info - int port; - for (port = 0; port < 4; port++) { - if (g_XboxControllerHostBridge[port].hXboxDevice == hDevice) { - pCapabilities->SubType = g_XboxControllerHostBridge[port].XboxDeviceInfo.ucSubType; - //ready to set the In and Out structure in pCapabilities, shall set all bit to 1 for enabling the capabilities. - UCHAR * pCapa = (UCHAR *)(&pCapabilities->In); - - memset( pCapa, - 0xFF, - g_XboxControllerHostBridge[port].XboxDeviceInfo.ucInputStateSize + g_XboxControllerHostBridge[port].XboxDeviceInfo.ucFeedbackSize); - - ret = ERROR_SUCCESS; - break; - } - } - - RETURN(ret); -} - -//variable names correlated to X_SBC_FEEDBACK, mapped to each nibble accordingly. -char * XboxSBCFeedbackNames[] = { - "EmergencyEject", - "CockpitHatch", - "Ignition", - "Start", - "OpenClose", - "MapZoomInOut", - "ModeSelect", - "SubMonitorModeSelect", - "MainMonitorZoomIn", - "MainMonitorZoomOut", - "ForecastShootingSystem", - "Manipulator", - "LineColorChange", - "Washing", - "Extinguisher", - "Chaff", - "TankDetach", - "Override", - "NightScope", - "F1", - "F2", - "F3", - "MainWeaponControl", - "SubWeaponControl", - "MagazineChange", - "Comm1", - "Comm2", - "Comm3", - "Comm4", - "Comm5", - "Unknown", - "GearR", - "GearN", - "Gear1", - "Gear2", - "Gear3", - "Gear4", - "Gear5" -}; - -//keep last SBC_GAMEPAD status, for DIP switch and GearLever -XTL::X_SBC_GAMEPAD XboxSBCGamepad = {}; - -//virtual SteelBatalion controller GetState, using port 0 from XInput and DirectInput to emulate virtual controller. -void EmuSBCGetState(XTL::PX_SBC_GAMEPAD pSBCGamepad, XTL::PX_XINPUT_GAMEPAD pXIGamepad, XTL::PX_XINPUT_GAMEPAD pDIGamepad) -{ - // Now convert those values to SteelBatalion Gamepad - - //restore certain variables such as GerLever and Toggle Switches. - - //restore the kept ucGearLever - pSBCGamepad->ucGearLever = XboxSBCGamepad.ucGearLever; - //we use continues range 7~13, 8 for gear N. - if (pSBCGamepad->ucGearLever < 7 || pSBCGamepad->ucGearLever>13) { - pSBCGamepad->ucGearLever = 8; - } - - //restore Toggle Switches. - pSBCGamepad->wButtons[0] |= (XboxSBCGamepad.wButtons[0] & (X_SBC_GAMEPAD_W0_COCKPITHATCH | X_SBC_GAMEPAD_W0_IGNITION)); - - pSBCGamepad->wButtons[2] |= (XboxSBCGamepad.wButtons[2]&( X_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL - | X_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY - | X_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE - | X_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL - | X_SBC_GAMEPAD_W2_TOGGLEVTLOCATION)); - - - // Analog Sticks - pSBCGamepad->sAimingX = pXIGamepad->sThumbRX;; - pSBCGamepad->sAimingY = pXIGamepad->sThumbRY;; - pSBCGamepad->sRotationLever = 0;//(pXIGamepad->wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) ? 255 : 0; - pSBCGamepad->sSightChangeX = pXIGamepad->sThumbLX;; - pSBCGamepad->sSightChangeY = pXIGamepad->sThumbLY;; - pSBCGamepad->wLeftPedal = ((SHORT)(pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_LEFT_TRIGGER]))<<8; - pSBCGamepad->wMiddlePedal=0;// = (pXIGamepad->wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) ? 255 : 0; - pSBCGamepad->wRightPedal = (SHORT)(pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_RIGHT_TRIGGER])<<8; - pSBCGamepad->ucTunerDial=0;//low nibble - - - // Digital Buttons - if (pXIGamepad->bAnalogButtons [X_XINPUT_GAMEPAD_A]>0) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON; - } - if (pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_B]>0) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_RIGHTJOYFIRE; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_RIGHTJOYFIRE; - } - if (pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_X]>0) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_RIGHTJOYLOCKON; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_RIGHTJOYLOCKON; - } - if (pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_Y]>0) { - pSBCGamepad->wButtons[1] |= X_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE; - } - else { - pSBCGamepad->wButtons[1] &= ~X_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE; - } - - //GearLever 1~5 for gear 1~5, 7~13 for gear R,N,1~5, 15 for gear R. we use the continues range from 7~13 - if (pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_WHITE]>0) {//Left Shouder, Gear Down - if (pSBCGamepad->ucGearLever >7) { - pSBCGamepad->ucGearLever-- ; - } - } - - if (pXIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_BLACK]>0) {//Right Shouder, Gear Up - if (pSBCGamepad->ucGearLever < 13) { - pSBCGamepad->ucGearLever ++; - } - } - //OLD_XINPUT - /* //not used, don't duplicate the handling for same setting of pXIGamepad's members, later one will over write privous one. - if (pXIGamepad->wButtons & X_XINPUT_GAMEPAD_START) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_START; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_START; - } - */ - if (pXIGamepad->wButtons & X_XINPUT_GAMEPAD_LEFT_THUMB) {//Center Sight Change - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE; - } - else { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE; - } - //OLD_XINPUT - /* //not used - if (pXIGamepad->wButtons & X_XINPUT_GAMEPAD_RIGHT_THUMB) { - pSBCGamepad->wButtons |= X_XINPUT_GAMEPAD_RIGHT_THUMB; - } - else { - pSBCGamepad->wButtons &= ~X_XINPUT_GAMEPAD_RIGHT_THUMB; - } - */ - - - //additional input from 2nd input, default using directinput - if (pDIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_A]>0) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_START; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_START; - } - // Iginition is Toggle Switch - if (pDIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_B]>0) { - if (pSBCGamepad->wButtons[0] & X_SBC_GAMEPAD_W0_IGNITION) { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_IGNITION; - } - else { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_IGNITION; - } - } - - if (pDIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_X]>0) { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_EJECT; - } - else { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_EJECT; - } - // CockpitHatch is Toggle Switch - if (pDIGamepad->bAnalogButtons[X_XINPUT_GAMEPAD_Y]>0) { - if (pSBCGamepad->wButtons[0] & X_SBC_GAMEPAD_W0_COCKPITHATCH) { - pSBCGamepad->wButtons[0] &= ~X_SBC_GAMEPAD_W0_COCKPITHATCH; - } - else { - pSBCGamepad->wButtons[0] |= X_SBC_GAMEPAD_W0_COCKPITHATCH; - } - } - - if (pDIGamepad->wButtons & X_XINPUT_GAMEPAD_BACK) {//Toggle Switch ToggleFilterControl - if (pSBCGamepad->wButtons[2] & X_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL) { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL; - } - else { - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL; - } - } - - if (pDIGamepad->wButtons & X_XINPUT_GAMEPAD_DPAD_UP) {//Toggle Switch ToggleOxygenSupply - if (pSBCGamepad->wButtons[2] & X_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY) { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY; - } - else { - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY; - } - } - - if (pDIGamepad->wButtons & X_XINPUT_GAMEPAD_DPAD_DOWN) {//Toggle Switch ToggleBuffreMaterial - if (pSBCGamepad->wButtons[2] & X_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL) { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL; - } - else { - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL; - } - } - - if (pDIGamepad->wButtons & X_XINPUT_GAMEPAD_DPAD_LEFT) {//Toggle Switch ToggleVTLocation - if (pSBCGamepad->wButtons[2] & X_SBC_GAMEPAD_W2_TOGGLEVTLOCATION) { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_TOGGLEVTLOCATION; - } - else { - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_TOGGLEVTLOCATION; - } - } - - if (pDIGamepad->wButtons & X_XINPUT_GAMEPAD_DPAD_RIGHT) {//Toggle Switch ToggleFuelFlowRate - if (pSBCGamepad->wButtons[2] & X_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE) { - pSBCGamepad->wButtons[2] &= ~X_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE; - } - else { - pSBCGamepad->wButtons[2] |= X_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE; - } - } - //reserve the SBCGamepad to keep the status of GearLever and Toggole Switches. - XboxSBCGamepad = *pSBCGamepad; -} -// ****************************************************************** -// * patch: InputGetState -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XInputGetState) -( - IN HANDLE hDevice, - OUT PX_XINPUT_STATE pState -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hDevice) - LOG_FUNC_ARG_OUT(pState) - LOG_FUNC_END; - - DWORD ret = ERROR_INVALID_HANDLE; - //OLD_XINPUT - /* - X_POLLING_PARAMETERS_HANDLE *pph = (X_POLLING_PARAMETERS_HANDLE*)hDevice; - - if(pph != NULL) - { - if(pph->pPollingParameters != NULL) - { - if(pph->pPollingParameters->fAutoPoll == FALSE) - { - // - // TODO: uh.. - // - - EmuWarning("EmuXInputGetState : fAutoPoll == FALSE"); - } - } - - DWORD dwPort = pph->dwPort; - - if((dwPort >= 0) && (dwPort <= total_xinput_gamepad)) - { - DbgPrintf("XAPI: EmuXInputGetState(): dwPort = %d\n", dwPort ); - - //for xinput, we query the state corresponds to port. - if (g_XInputEnabled) { - EmuXInputPCPoll(dwPort,pState); - } else { - EmuDInputPoll(pState); - } - - ret = ERROR_SUCCESS; - } - } - else - EmuWarning("EmuXInputGetState(): pph == NULL!"); - */ - //above code is not used at all, in future we might remove them. - //get input state if hXboxDevice matches hDevice - int port; - for (port = 0; port<4; port++) { - if (g_XboxControllerHostBridge[port].hXboxDevice == hDevice) { - - //for xinput, we query the state corresponds to port. - switch (g_XboxControllerHostBridge[port].dwHostType) { - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT://using XInput - EmuXInputPCPoll(g_XboxControllerHostBridge[port].dwHostPort, pState); - ret = ERROR_SUCCESS; - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT://using directinput - EmuDInputPoll(pState); - ret = ERROR_SUCCESS; - break; - case X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC://using virtual SteelBatalion Controller - //printf("SBC get state!\n"); - XTL::X_XINPUT_STATE InputState0, InputState1; - InputState0 = {}; - InputState1 = {}; - EmuXInputPCPoll(0, &InputState0); - EmuDInputPoll(&InputState1); - pState->dwPacketNumber = InputState0.dwPacketNumber; - EmuSBCGetState(XTL::PX_SBC_GAMEPAD(&pState->Gamepad), &InputState0.Gamepad, &InputState1.Gamepad); - break; - default: - break; - } - - break; - } - } - - RETURN(ret); -} - -// ****************************************************************** -// * patch: InputSetState -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XInputSetState) -( - IN HANDLE hDevice, - IN OUT PX_XINPUT_FEEDBACK pFeedback -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hDevice) - LOG_FUNC_ARG(pFeedback) - LOG_FUNC_END; - - DWORD ret = ERROR_IO_PENDING; - //OLD_XINPUT -/* - X_POLLING_PARAMETERS_HANDLE *pph = (X_POLLING_PARAMETERS_HANDLE*)hDevice; - - if(pph != NULL) - { - int v; - - // - // Check if this device is already being polled - // - - bool found = false; - - for(v=0;vHeader.dwStatus == ERROR_SUCCESS) - { - //If the device was succesfully added to polling before, recycle the request - g_pXInputSetStateStatus[v].pFeedback = pFeedback; - pFeedback->Header.dwStatus = ERROR_IO_PENDING; - } - else { - //Ignore this request as another one is already pending - ret = ERROR_SUCCESS; - } - } - } - - // - // If device was not already slotted, queue it - // - - if(!found) - { - for(v=0;vHeader.dwStatus = ERROR_IO_PENDING; - - break; - } - } - - if(v == XINPUT_SETSTATE_SLOTS) - { - CxbxKrnlCleanup("Ran out of XInputSetStateStatus slots!"); - } - } - - if (g_XInputEnabled) - { - XTL::EmuXInputSetState(pph->dwPort, pFeedback); - } - } - */ - - //above code is not used at all, in future we might remove them. - //reset hXboxDevice handle if it matches the hDevice - int port; - for (port = 0; port<4; port++) { - if (g_XboxControllerHostBridge[port].hXboxDevice == hDevice) { - //if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader == 0) { - g_XboxControllerHostBridge[port].pXboxFeedbackHeader = &pFeedback->Header; - g_XboxControllerHostBridge[port].dwLatency = 0; - pFeedback->Header.dwStatus = ERROR_IO_PENDING; - ret = ERROR_IO_PENDING; - //set XInput State if host type is Xinput. - switch (g_XboxControllerHostBridge[port].dwHostType) { - case 1://using XInput - XTL::EmuXInputSetState(port, pFeedback); - break; - case 2://using directinput - break; - case 0x80://using virtual SteelBatalion Controller - //printf("SBC setstate!\n"); - //EmuXSBCSetState((UCHAR *)&pFeedback->Rumble); - //UpdateVirtualSBCFeedbackDlg((UCHAR *)&pFeedback->Rumble); - //DWORD dwVXBCSetStateResult; - if (g_module != 0 && fnCxbxVSBCSetState == 0) { - fnCxbxVSBCSetState = (PFARPROC2)GetProcAddress(g_module, "VSBCSetState"); - //fnCxbxVSBCGetState = (PFARPROC2)GetProcAddress(g_module, "VSBCGetState"); - //fnCxbxVSBCOpen = (PFARPROC1)GetProcAddress(g_module, "VSBCOpen"); - } - if (fnCxbxVSBCSetState == 0) { - printf("EmuXapi: EmuXInputSetState: GetPRocAddress VSBCSetState failed!\n"); - } - else { - (*fnCxbxVSBCSetState)((UCHAR *)&pFeedback->Rumble); - } - - - //dwVXBCSetStateResult = CxbxVSBC::MyCxbxVSBC::VSBCSetState((UCHAR *)&pFeedback->Rumble); - break; - default: - break; - } - break; - //} - } - } - - RETURN(ret); -} - - -// ****************************************************************** -// * patch: SetThreadPriorityBoost -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(SetThreadPriorityBoost) -( - HANDLE hThread, - BOOL DisablePriorityBoost -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hThread) - LOG_FUNC_ARG(DisablePriorityBoost) - LOG_FUNC_END; - - BOOL bRet = SetThreadPriorityBoost(hThread, DisablePriorityBoost); - - if(bRet == FALSE) - EmuWarning("SetThreadPriorityBoost Failed!"); - - RETURN(bRet); -} - -// ****************************************************************** -// * patch: SetThreadPriority -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(SetThreadPriority) -( - HANDLE hThread, - int nPriority -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hThread) - LOG_FUNC_ARG(nPriority) - LOG_FUNC_END; - - BOOL bRet = SetThreadPriority(hThread, nPriority); - - if(bRet == FALSE) - EmuWarning("SetThreadPriority Failed!"); - - RETURN(bRet); -} - - -// ****************************************************************** -// * patch: GetThreadPriority -// ****************************************************************** -int WINAPI XTL::EMUPATCH(GetThreadPriority) -( - HANDLE hThread -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(hThread); - - int iRet = GetThreadPriority(hThread); - - if(iRet == THREAD_PRIORITY_ERROR_RETURN) - EmuWarning("GetThreadPriority Failed!"); - - RETURN(iRet); -} - -// ****************************************************************** -// * patch: GetExitCodeThread -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(GetExitCodeThread) -( - HANDLE hThread, - LPDWORD lpExitCode -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hThread) - LOG_FUNC_ARG(lpExitCode) - LOG_FUNC_END; - - BOOL bRet = GetExitCodeThread(hThread, lpExitCode); - - RETURN(bRet); -} - -// ****************************************************************** -// * patch: XapiThreadStartup -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XapiThreadStartup) -( - DWORD dwDummy1, - DWORD dwDummy2 -) -{ - //FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwDummy1) - LOG_FUNC_ARG(dwDummy2) - LOG_FUNC_END; - - typedef int (__stdcall *pfDummyFunc)(DWORD dwDummy); - - pfDummyFunc func = (pfDummyFunc)dwDummy1; - - func(dwDummy2); - - // TODO: Call thread notify routines ? - - /* - __asm - { - push dwDummy2 - call dwDummy1 - } - */ - - //_asm int 3; -} - -// ****************************************************************** -// * patch: XRegisterThreadNotifyRoutine -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XRegisterThreadNotifyRoutine) -( - PXTHREAD_NOTIFICATION pThreadNotification, - BOOL fRegister -) -{ - //FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThreadNotification) - LOG_FUNC_ARG(fRegister) - LOG_FUNC_END; - - if(fRegister) - { - // I honestly don't expect this to happen, but if it does... - if(g_iThreadNotificationCount >= 16) - CxbxKrnlCleanup("Too many thread notification routines installed\n"); - - // Find an empty spot in the thread notification array - for(int i = 0; i < 16; i++) - { - // If we find one, then add it to the array, and break the loop so - // that we don't accidently register the same routine twice! - if(g_pfnThreadNotification[i] == NULL) - { - g_pfnThreadNotification[i] = pThreadNotification->pfnNotifyRoutine; - g_iThreadNotificationCount++; - break; - } - } - } - else - { - // Go through each routine and nullify the routine passed in. - for(int i = 0; i < 16; i++) - { - if(pThreadNotification->pfnNotifyRoutine == g_pfnThreadNotification[i]) - { - g_pfnThreadNotification[i] = NULL; - g_iThreadNotificationCount--; - break; - } - } - } -} - -typedef struct { - LPFIBER_START_ROUTINE lpStartRoutine; - LPVOID lpParameter; -} fiber_context_t; - -void WINAPI EmuFiberStartup(fiber_context_t* context) -{ - __try - { - LPFIBER_START_ROUTINE pfStartRoutine = (LPFIBER_START_ROUTINE)context->lpStartRoutine; - pfStartRoutine(context->lpParameter); - } - __except (EmuException(GetExceptionInformation())) - { - EmuWarning("Problem with ExceptionFilter"); - } -} - -// ****************************************************************** -// * patch: CreateFiber -// ****************************************************************** -LPVOID WINAPI XTL::EMUPATCH(CreateFiber) -( - DWORD dwStackSize, - LPFIBER_START_ROUTINE lpStartRoutine, - LPVOID lpParameter -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwStackSize) - LOG_FUNC_ARG((PVOID)lpStartRoutine) - LOG_FUNC_ARG(lpParameter) - LOG_FUNC_END; - - // Create a Fiber Context: This has to be malloced because if it goes out of scope - // between CreateFiber and SwitchToFiber, it will cause a crash - // WARNING: Currently this leaks memory, can be fixed by tracking fibers and freeing them in DeleteFiber - fiber_context_t* context = (fiber_context_t*)malloc(sizeof(fiber_context_t)); - context->lpStartRoutine = lpStartRoutine; - context->lpParameter = lpParameter; - - RETURN(CreateFiber(dwStackSize, (LPFIBER_START_ROUTINE)EmuFiberStartup, context)); -} - -// ****************************************************************** -// * patch: DeleteFiber -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(DeleteFiber) -( - LPVOID lpFiber -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG((DWORD)DeleteFiber); - - DeleteFiber(lpFiber); -} - -// ****************************************************************** -// * patch: SwitchToFiber -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(SwitchToFiber) -( - LPVOID lpFiber -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(lpFiber); - - SwitchToFiber(lpFiber); -} - -// ****************************************************************** -// * patch: ConvertThreadToFiber -// ****************************************************************** -LPVOID WINAPI XTL::EMUPATCH(ConvertThreadToFiber) -( - LPVOID lpParameter -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(lpParameter); - - LPVOID pRet = ConvertThreadToFiber(lpParameter); - - RETURN(pRet); -} - -// ****************************************************************** -// * patch: QueryPerformanceCounter -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(QueryPerformanceCounter) -( - LARGE_INTEGER * lpPerformanceCount -) -{ - FUNC_EXPORTS; - - lpPerformanceCount->QuadPart = xboxkrnl::KeQueryPerformanceCounter(); - return TRUE; -} - -// ****************************************************************** -// * patch: QueueUserAPC -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(QueueUserAPC) -( - PAPCFUNC pfnAPC, - HANDLE hThread, - DWORD dwData -) -{ - //FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG_TYPE(PVOID, pfnAPC) - LOG_FUNC_ARG(hThread) - LOG_FUNC_ARG(dwData) - LOG_FUNC_END; - - DWORD dwRet = 0; - - // If necessary, we can just continue to emulate NtQueueApcThread (0xCE). - // I added this because NtQueueApcThread fails in Metal Slug 3. - - HANDLE hApcThread = NULL; - if(!DuplicateHandle(g_CurrentProcessHandle, hThread, g_CurrentProcessHandle, &hApcThread, THREAD_SET_CONTEXT,FALSE,0)) - EmuWarning("DuplicateHandle failed!"); - - dwRet = QueueUserAPC(pfnAPC, hApcThread, dwData); - if(!dwRet) - EmuWarning("QueueUserAPC failed!"); - - RETURN(dwRet); -} - -#if 0 // Handled by WaitForSingleObject -// ****************************************************************** -// * patch: GetOverlappedResult -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(GetOverlappedResult) -( - HANDLE hFile, - LPOVERLAPPED lpOverlapped, - LPDWORD lpNumberOfBytesTransferred, - BOOL bWait -) -{ - //FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hFile) - LOG_FUNC_ARG(lpOverlapped) - LOG_FUNC_ARG(lpNumberOfBytesTransferred) - LOG_FUNC_ARG(bWait) - LOG_FUNC_END; - - BOOL bRet = GetOverlappedResult( hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait ); - -// if(bWait) -// bRet = TRUE; // Sucker... - - RETURN(bRet); -} -#endif - -// ****************************************************************** -// * patch: XLaunchNewImageA -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XLaunchNewImageA) -( - LPCSTR lpTitlePath, - PLAUNCH_DATA pLaunchData -) -{ - //FUNC_EXPORTS - - // Note : This can be tested using "Innocent tears", - // which relaunches different xbes between scenes; - // One for menus, one for fmvs, etc. - // - // Other titles do this too (like "DOA2 Ultimate", - // and probably "Panzer Dragoon Orta"), but these - // titles don't come this far as-of yet. - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(lpTitlePath) - LOG_FUNC_ARG(pLaunchData) - LOG_FUNC_END; - - // TODO : This patch can be removed once NtOpenSymbolicLinkObject() - // and NtQuerySymbolicLinkObject() work together correctly. - // Also, XLaunchNewImageA() depends on XeImageHeader() and uses - // XWriteTitleInfoAndReboot() and indirectly XWriteTitleInfoNoReboot() - - // Update the kernel's LaunchDataPage : - { - if (xboxkrnl::LaunchDataPage == xbnullptr) - { - PVOID LaunchDataVAddr = xboxkrnl::MmAllocateContiguousMemory(sizeof(xboxkrnl::LAUNCH_DATA_PAGE)); - if (!LaunchDataVAddr) - { - RETURN(STATUS_NO_MEMORY); - } - xboxkrnl::LaunchDataPage = (xboxkrnl::LAUNCH_DATA_PAGE*)LaunchDataVAddr; - } - - xboxkrnl::LaunchDataPage->Header.dwTitleId = g_pCertificate->dwTitleId; - xboxkrnl::LaunchDataPage->Header.dwFlags = 0; // TODO : What to put in here? - xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_TITLE; - - xboxkrnl::MmPersistContiguousMemory((PVOID)xboxkrnl::LaunchDataPage, PAGE_SIZE, TRUE); - - if (pLaunchData != xbnullptr) - // Save the launch data - memcpy(&(xboxkrnl::LaunchDataPage->LaunchData[0]), pLaunchData, sizeof(LAUNCH_DATA)); - - if (lpTitlePath == xbnullptr) - { - // If no path is specified, then the xbe is rebooting to dashboard - char szDashboardPath[MAX_PATH] = { 0 }; - XboxDevice* rootDevice = CxbxDeviceByDevicePath(DeviceHarddisk0Partition2); - if (rootDevice != nullptr) - sprintf(szDashboardPath, "%s\\xboxdash.xbe", rootDevice->HostDevicePath.c_str()); - - if (PathFileExists(szDashboardPath)) - { - MessageBox(CxbxKrnl_hEmuParent, "The title is rebooting to dashboard", "Cxbx-Reloaded", 0); - lpTitlePath = "C:\\xboxdash.xbe"; - xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_FROM_DASHBOARD; - // Other options include LDT_NONE, LDT_FROM_DEBUGGER_CMDLINE and LDT_FROM_UPDATE - } - else - CxbxKrnlCleanup("The xbe rebooted to Dashboard and xboxdash.xbe could not be found"); - } - - strncpy(&(xboxkrnl::LaunchDataPage->Header.szLaunchPath[0]), lpTitlePath, 520); - } - - // Note : While this patch exists, HalReturnToFirmware() calls - // MmPersistContiguousMemory on LaunchDataPage. When this - // patch on XLaunchNewImageA is removed, remove the call to - // MmPersistContiguousMemory from HalReturnToFirmware() too!! - - xboxkrnl::HalReturnToFirmware(xboxkrnl::ReturnFirmwareQuickReboot); - - // If this function succeeds, it doesn't get a chance to return anything. - RETURN(ERROR_GEN_FAILURE); -} - -#if 0 // patch disabled -// ****************************************************************** -// * patch: XGetLaunchInfo -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XGetLaunchInfo) -( - PDWORD pdwLaunchDataType, - PLAUNCH_DATA pLaunchData -) -{ - FUNC_EXPORTS - - // TODO : This patch can be removed once we're sure all XAPI library - // functions indirectly reference our xboxkrnl::LaunchDataPage variable. - // For this, we need a test-case that hits this function, and run that - // with and without this patch enabled. Behavior should be identical. - // When this is verified, this patch can be removed. - LOG_TEST_CASE("Unpatching test needed"); - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pdwLaunchDataType) - LOG_FUNC_ARG(pLaunchData) - LOG_FUNC_END; - - DWORD ret = ERROR_NOT_FOUND; - - if (xboxkrnl::LaunchDataPage != NULL) - { - // Note : Here, CxbxRestoreLaunchDataPage() was already called, - // which has loaded LaunchDataPage from a binary file (if present). - - // A title can pass data only to itself, not another title (unless started from the dashboard, of course) : - if ( (xboxkrnl::LaunchDataPage->Header.dwTitleId == g_pCertificate->dwTitleId) - || (xboxkrnl::LaunchDataPage->Header.dwLaunchDataType == LDT_FROM_DASHBOARD) - || (xboxkrnl::LaunchDataPage->Header.dwLaunchDataType == LDT_FROM_DEBUGGER_CMDLINE)) - { - *pdwLaunchDataType = xboxkrnl::LaunchDataPage->Header.dwLaunchDataType; - memcpy(pLaunchData, &(xboxkrnl::LaunchDataPage->LaunchData[0]), sizeof(LAUNCH_DATA)); - - // Now that LaunchDataPage is retrieved by the emulated software, free it : - MmFreeContiguousMemory(xboxkrnl::LaunchDataPage); - xboxkrnl::LaunchDataPage = NULL; - - ret = ERROR_SUCCESS; - } - } - - RETURN(ret); -} -#endif - -// ****************************************************************** -// * patch: XSetProcessQuantumLength -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(XSetProcessQuantumLength) -( - DWORD dwMilliseconds -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(dwMilliseconds); - - // TODO: Implement? - LOG_IGNORED(); -} - -// ****************************************************************** -// * patch: SignalObjectAndWait -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(SignalObjectAndWait) -( - HANDLE hObjectToSignal, - HANDLE hObjectToWaitOn, - DWORD dwMilliseconds, - BOOL bAlertable -) -{ - FUNC_EXPORTS - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hObjectToSignal) - LOG_FUNC_ARG(hObjectToWaitOn) - LOG_FUNC_ARG(dwMilliseconds) - LOG_FUNC_ARG(bAlertable) - LOG_FUNC_END; - - DWORD dwRet = SignalObjectAndWait( hObjectToSignal, hObjectToWaitOn, dwMilliseconds, bAlertable ); - - RETURN(dwRet); -} - -// ****************************************************************** -// * patch: timeSetEvent -// ****************************************************************** -MMRESULT WINAPI XTL::EMUPATCH(timeSetEvent) -( - UINT uDelay, - UINT uResolution, - LPTIMECALLBACK fptc, - DWORD dwUser, - UINT fuEvent -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(uDelay) - LOG_FUNC_ARG(uResolution) - LOG_FUNC_ARG_TYPE(PVOID, fptc) - LOG_FUNC_ARG(dwUser) - LOG_FUNC_ARG(fuEvent) - LOG_FUNC_END; - - MMRESULT Ret = timeSetEvent( uDelay, uResolution, fptc, (DWORD_PTR) dwUser, fuEvent ); - - RETURN(Ret); -} - -// ****************************************************************** -// * patch: timeKillEvent -// ****************************************************************** -MMRESULT WINAPI XTL::EMUPATCH(timeKillEvent) -( - UINT uTimerID -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(uTimerID); - - MMRESULT Ret = timeKillEvent( uTimerID ); - - RETURN(Ret); -} - -// ****************************************************************** -// * patch: RaiseException -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(RaiseException) -( - DWORD dwExceptionCode, // exception code - DWORD dwExceptionFlags, // continuable exception flag - DWORD nNumberOfArguments, // number of arguments - CONST ULONG_PTR *lpArguments // array of arguments -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwExceptionCode) - LOG_FUNC_ARG(dwExceptionFlags) - LOG_FUNC_ARG(nNumberOfArguments) - LOG_FUNC_ARG(lpArguments) - LOG_FUNC_END; - - // TODO: Implement or not? -// RaiseException(dwExceptionCode, dwExceptionFlags, nNumberOfArguments, (*(ULONG_PTR**) &lpArguments)); - - LOG_UNIMPLEMENTED(); -} - -// ****************************************************************** -// patch: XMountMUA -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XMountMUA) -( - DWORD dwPort, - DWORD dwSlot, - PCHAR pchDrive -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwPort) - LOG_FUNC_ARG(dwSlot) - LOG_FUNC_ARG(pchDrive) - LOG_FUNC_END; - - // TODO: Actually allow memory card emulation? This might make transferring - // game saves a bit easier if the memory card directory was configurable. =] - - RETURN(E_FAIL); -} - -// ****************************************************************** -// * patch: XMountAlternateTitleA -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XMountAlternateTitleA) -( - LPCSTR lpRootPath, - DWORD dwAltTitleId, - PCHAR pchDrive -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(lpRootPath) - LOG_FUNC_ARG(dwAltTitleId) - LOG_FUNC_ARG(pchDrive) - LOG_FUNC_END; - - // TODO: Anything? - LOG_UNIMPLEMENTED(); - - RETURN(ERROR_SUCCESS); -} - -// ****************************************************************** -// * patch: XUnmountAlternateTitleA -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XUnmountAlternateTitleA) -( - CHAR chDrive -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(chDrive); - - LOG_UNIMPLEMENTED(); - - RETURN(ERROR_SUCCESS); -} - -// ****************************************************************** -// * patch: XGetDeviceEnumerationStatus -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XGetDeviceEnumerationStatus)() -{ - FUNC_EXPORTS - - LOG_FUNC(); - - LOG_UNIMPLEMENTED(); - - RETURN(XDEVICE_ENUMERATION_IDLE); -} - -// ****************************************************************** -// * patch: XInputGetDeviceDescription -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XInputGetDeviceDescription) -( - HANDLE hDevice, - PVOID pDescription -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(hDevice) - LOG_FUNC_ARG(pDescription) - LOG_FUNC_END; - - // TODO: Lightgun support? - LOG_UNIMPLEMENTED(); - - RETURN(ERROR_NOT_SUPPORTED); // ERROR_DEVICE_NOT_CONNECTED; -} - -// ****************************************************************** -// * patch: XMountMURootA -// ****************************************************************** -DWORD WINAPI XTL::EMUPATCH(XMountMURootA) -( - DWORD dwPort, - DWORD dwSlot, - PCHAR pchDrive -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(dwPort) - LOG_FUNC_ARG(dwSlot) - LOG_FUNC_ARG(pchDrive) - LOG_FUNC_END; - - // TODO: The params are probably wrong... - LOG_UNIMPLEMENTED(); - - RETURN(ERROR_SUCCESS); -} - -// ****************************************************************** -// * patch: OutputDebugStringA -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(OutputDebugStringA) -( - IN LPCSTR lpOutputString -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(lpOutputString); - printf("OutputDebugStringA: %s\n", lpOutputString); -} diff --git a/src/CxbxKrnl/HLEIntercept.cpp b/src/CxbxKrnl/HLEIntercept.cpp deleted file mode 100644 index 673e4571c..000000000 --- a/src/CxbxKrnl/HLEIntercept.cpp +++ /dev/null @@ -1,847 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->HLEIntercept.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** - -#define LOG_PREFIX "HLE " // Intentional extra space to align on 4 characters - -#include -#include // For std::setfill and std::setw -#include "CxbxKrnl.h" -#include "Emu.h" -#include "EmuFS.h" -#include "EmuXTL.h" -#include "EmuShared.h" -#include "CxbxDebugger.h" -#pragma comment(lib, "XbSymbolDatabase.lib") -#include "../../import/XbSymbolDatabase/XbSymbolDatabase.h" -#include "HLEIntercept.h" -#include "xxhash32.h" -#include -#include - -inline void EmuInstallPatch(std::string FunctionName, xbaddr FunctionAddr, void *Patch); - -#include -#include -#include -#include - -std::map g_SymbolAddresses; -std::unordered_map g_FunctionHooks; -bool g_HLECacheUsed = false; - -// D3D build version -uint32 g_BuildVersion = 0; - -bool bLLE_APU = false; // Set this to true for experimental APU (sound) LLE -bool bLLE_GPU = false; // Set this to true for experimental GPU (graphics) LLE -bool bLLE_JIT = false; // Set this to true for experimental JIT - -void* GetXboxFunctionPointer(std::string functionName) -{ - if (g_FunctionHooks.find(functionName) != g_FunctionHooks.end()) { - return g_FunctionHooks[functionName].GetTrampoline(); - } - - // If we got here, the function wasn't patched, so we can just look it up the HLE cache - // and return the correct offset - auto symbol = g_SymbolAddresses.find(functionName); - if (symbol != g_SymbolAddresses.end()) { - return (void*)symbol->second; - } - - // Finally, if none of the above were matched, return nullptr - return nullptr; -} - -// NOTE: GetDetectedSymbolName do not get to be in XbSymbolDatabase, get symbol string in Cxbx project only. -std::string GetDetectedSymbolName(xbaddr address, int *symbolOffset) -{ - std::string result = ""; - int closestMatch = MAXINT; - - for (auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { - xbaddr symbolAddr = (*it).second; - if (symbolAddr == NULL) - continue; - - if (symbolAddr <= address) - { - int distance = address - symbolAddr; - if (closestMatch > distance) - { - closestMatch = distance; - result = (*it).first; - } - } - } - - if (closestMatch < MAXINT) - { - *symbolOffset = closestMatch; - return result; - } - - *symbolOffset = 0; - return "unknown"; -} - -// NOTE: GetEmuPatchAddr do not get to be in XbSymbolDatabase, perform patch check in Cxbx project only. -void *GetEmuPatchAddr(std::string aFunctionName) -{ - std::string patchName = "XTL::EmuPatch_" + aFunctionName; - void* addr = GetProcAddress(GetModuleHandle(NULL), patchName.c_str()); - return addr; -} - -// NOTE: VerifySymbolAddressAgainstXRef do not get to be in XbSymbolDatabase, perform verification in Cxbx project only. -/* -bool VerifySymbolAddressAgainstXRef(char *SymbolName, xbaddr Address, int XRef) -{ - // Temporary verification - is XREF_D3DTSS_TEXCOORDINDEX derived correctly? - // TODO : Remove this when XREF_D3DTSS_TEXCOORDINDEX derivation is deemed stable - xbaddr XRefAddr = XRefDataBase[XRef]; - if (XRefAddr == Address) - return true; - - if (XRefAddr == XREF_ADDR_DERIVE) { - printf("HLE: XRef #%d derived 0x%.08X -> %s\n", XRef, Address, SymbolName); - XRefDataBase[XRef] = Address; - return true; - } - - // For XREF_D3DTSS_TEXCOORDINDEX, Kabuki Warriors hits this case - CxbxPopupMessage("Verification of %s failed : XREF was 0x%.8X while lookup gave 0x%.8X", SymbolName, XRefAddr, Address); - // For XREF_D3DTSS_TEXCOORDINDEX, Kabuki Warriors hits this case - return false; -}*/ - -// x1nixmzeng: Hack to notify CxbxDebugger of the HLECache file, which is currently a hashed XBE header AND stripped title (see EmuHLEIntercept) -class CxbxDebuggerScopedMessage -{ - std::string& message; - - CxbxDebuggerScopedMessage() = delete; - CxbxDebuggerScopedMessage(const CxbxDebuggerScopedMessage&) = delete; -public: - - CxbxDebuggerScopedMessage(std::string& message_string) - : message(message_string) - { } - - ~CxbxDebuggerScopedMessage() - { - if (CxbxDebugger::CanReport()) - { - CxbxDebugger::ReportHLECacheFile(message.c_str()); - } - } -}; - -void CDECL EmuOutputMessage(xb_output_message mFlag, - const char* message) -{ - switch (mFlag) { - case XB_OUTPUT_MESSAGE_INFO: { - printf("%s\n", message); - break; - } - case XB_OUTPUT_MESSAGE_WARN: { - EmuWarning("%s", message); - break; - } - case XB_OUTPUT_MESSAGE_ERROR: { - CxbxKrnlCleanup("%s", message); - break; - } - case XB_OUTPUT_MESSAGE_DEBUG: - default: { -#ifdef _DEBUG_TRACE - printf("%s\n", message); -#endif - - break; - } - } -} - -void CDECL EmuRegisterSymbol(const char* library_str, - uint32_t library_flag, - const char* symbol_str, - uint32_t func_addr, - uint32_t revision) -{ - // Ignore registered symbol in current database. - uint32_t hasSymbol = g_SymbolAddresses[symbol_str]; - if (hasSymbol != 0) - return; - - // Output some details - std::stringstream output; - output << "HLE: 0x" << std::setfill('0') << std::setw(8) << std::hex << func_addr - << " -> " << symbol_str << " " << std::dec << revision; - -#if 0 // TODO: XbSymbolDatabase - Need to create a structure for patch and stuff. - bool IsXRef = OovpaTable->Oovpa->XRefSaveIndex != XRefNoSaveIndex; - if (IsXRef) { - output << "\t(XREF)"; - - // do we need to save the found address? - OOVPA* Oovpa = OovpaTable->Oovpa; - if (Oovpa->XRefSaveIndex != XRefNoSaveIndex) { - // is the XRef not saved yet? - switch (XRefDataBase[Oovpa->XRefSaveIndex]) { - case XREF_ADDR_NOT_FOUND: - { - EmuWarning("Found OOVPA after first finding nothing?"); - // fallthrough to XREF_ADDR_UNDETERMINED - } - case XREF_ADDR_UNDETERMINED: - { - // save and count the found address - UnResolvedXRefs--; - XRefDataBase[Oovpa->XRefSaveIndex] = pFunc; - break; - } - case XREF_ADDR_DERIVE: - { - EmuWarning("Cannot derive a save index!"); - break; - } - default: - { - if (XRefDataBase[OovpaTable->Oovpa->XRefSaveIndex] != pFunc) { - EmuWarning("Found OOVPA on other address than in XRefDataBase!"); - EmuWarning("%s: %4d - pFunc: %08X, stored: %08X", OovpaTable->szFuncName, Oovpa->XRefSaveIndex, pFunc, XRefDataBase[Oovpa->XRefSaveIndex]); - } - break; - } - } - } - } - - // Retrieve the associated patch, if any is available - void* addr = GetEmuPatchAddr(std::string(OovpaTable->szFuncName)); - - if (addr != nullptr) { - EmuInstallPatch(OovpaTable->szFuncName, pFunc, addr); - output << "\t*PATCHED*"; - } else { - const char* checkDisableStr = nullptr; - size_t getFuncStrLength = strlen(OovpaTable->szFuncName); - - if (getFuncStrLength > 10) { - checkDisableStr = &OovpaTable->szFuncName[getFuncStrLength - 10]; - } - - if (checkDisableStr != nullptr && strcmp(checkDisableStr, "_UNPATCHED") == 0) { - output << "\t*UNPATCHED*"; - - // Mention there's no patch available, if it was to be applied - } else if (!IsXRef) { - output << "\t*NO PATCH AVAILABLE!*"; - } - } -#endif - - // NOTE: Alternate fix, however it will not register symbols just like the original method did. - // We need to create an array for symbol, patch, library type, etc structure. - // Then we can replace checks below into permanent solution. - if (bLLE_APU && ((library_flag & XbSymbolLib_XACTENG) || (library_flag & XbSymbolLib_DSOUND) > 0)) { - // Do nothing if emulating LLE APU - } else if (bLLE_GPU && ((library_flag & XbSymbolLib_XGRAPHC) || (library_flag & XbSymbolLib_D3D8) || (library_flag & XbSymbolLib_D3D8LTCG) > 0)) { - // Do nothing if emulating LLE GPU - } else { - // Or else check if patch exist then patch it. - - // Now that we found the address, store it (regardless if we patch it or not) - g_SymbolAddresses[symbol_str] = func_addr; - - // Retrieve the associated patch, if any is available - void* addr = GetEmuPatchAddr(symbol_str); - - if (addr != nullptr) { - EmuInstallPatch(symbol_str, func_addr, addr); - output << "\t*PATCHED*"; - } - } - output << "\n"; - printf(output.str().c_str()); -} - -// TODO: Move this into a function rather than duplicating from HLE scanning code -void EmuD3D_Init_DeferredStates() -{ - if (g_SymbolAddresses.find("D3DDeferredRenderState") != g_SymbolAddresses.end()) { - XTL::EmuD3DDeferredRenderState = (DWORD*)g_SymbolAddresses["D3DDeferredRenderState"]; - } - if (g_SymbolAddresses.find("D3DDeferredTextureState") != g_SymbolAddresses.end()) { - XTL::EmuD3DDeferredTextureState = (DWORD*)g_SymbolAddresses["D3DDeferredTextureState"]; - } - - if (XTL::EmuD3DDeferredRenderState != nullptr) { - for (int v = 0; v < 44; v++) { - XTL::EmuD3DDeferredRenderState[v] = XTL::X_D3DRS_UNK; - } - } - if (XTL::EmuD3DDeferredTextureState != nullptr) { - for (int s = 0; s < 4; s++) { - for (int v = 0; v < 32; v++) - XTL::EmuD3DDeferredTextureState[v + s * 32] = X_D3DTSS_UNK; - } - } -} - -// Update shared structure with GUI process -void EmuUpdateLLEStatus(uint32_t XbLibScan) -{ - int FlagsLLE; - g_EmuShared->GetFlagsLLE(&FlagsLLE); - - if ((FlagsLLE & LLE_GPU) == false - && !((XbLibScan & XbSymbolLib_D3D8) > 0 - || (XbLibScan & XbSymbolLib_D3D8LTCG) > 0)) { - bLLE_GPU = true; - FlagsLLE ^= LLE_GPU; - EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE GPU."); - } - - if ((FlagsLLE & LLE_APU) == false - && (XbLibScan & XbSymbolLib_DSOUND) == 0) { - bLLE_APU = true; - FlagsLLE ^= LLE_APU; - EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE APU."); - } - g_EmuShared->SetFlagsLLE(&FlagsLLE); -} - -// NOTE: EmuHLEIntercept do not get to be in XbSymbolDatabase, do the intecept in Cxbx project only. -void EmuHLEIntercept(Xbe::Header *pXbeHeader) -{ - // NOTE: Increase this revision number any time we changed something inside Cxbx-Reloaded. - int revisionCache = 5; - - Xbe::LibraryVersion *pLibraryVersion = (Xbe::LibraryVersion*)pXbeHeader->dwLibraryVersionsAddr; - - uint16 xdkVersion = 0; - uint32_t XbLibScan = 0; - - // NOTE: We need to check if title has library header to optimize verification process. - if (pLibraryVersion != nullptr) { - uint32 dwLibraryVersions = pXbeHeader->dwLibraryVersions; - const char* SectionName = nullptr; - Xbe::SectionHeader* pSectionHeaders = (Xbe::SectionHeader*)pXbeHeader->dwSectionHeadersAddr; - - // Get the highest revision build and prefix library to scan. - for (uint32 v = 0; v < dwLibraryVersions; v++) { - uint16 BuildVersion = pLibraryVersion[v].wBuildVersion; - uint16 QFEVersion = pLibraryVersion[v].wFlags.QFEVersion; - - if (xdkVersion < BuildVersion) { - xdkVersion = BuildVersion; - } - XbLibScan |= XbSymbolLibrayToFlag(std::string(pLibraryVersion[v].szName, pLibraryVersion[v].szName + 8).c_str()); - } - - // Since XDK 4039 title does not have library version for DSOUND, let's check section header if it exists or not. - for (unsigned int v = 0; v < pXbeHeader->dwSections; v++) { - SectionName = (const char*)pSectionHeaders[v].dwSectionNameAddr; - if (strncmp(SectionName, Lib_DSOUND, 8) == 0) { - XbLibScan |= XbSymbolLib_DSOUND; - break; - } - } - } - - EmuUpdateLLEStatus(XbLibScan); - int gFlagsLLE; - g_EmuShared->GetFlagsLLE(&gFlagsLLE); - - printf("\n"); - printf("*******************************************************************************\n"); - printf("* Cxbx-Reloaded High Level Emulation database\n"); - printf("*******************************************************************************\n"); - printf("\n"); - - // Make sure the HLE Cache directory exists - std::string cachePath = std::string(szFolder_CxbxReloadedData) + "\\HLECache\\"; - int result = SHCreateDirectoryEx(nullptr, cachePath.c_str(), nullptr); - if ((result != ERROR_SUCCESS) && (result != ERROR_ALREADY_EXISTS)) { - CxbxKrnlCleanup("Couldn't create Cxbx-Reloaded HLECache folder!"); - } - - // Hash the loaded XBE's header, use it as a filename - uint32_t uiHash = XXHash32::hash((void*)&CxbxKrnl_Xbe->m_Header, sizeof(Xbe::Header), 0); - std::stringstream sstream; - char tAsciiTitle[40] = "Unknown"; - setlocale(LC_ALL, "English"); - wcstombs(tAsciiTitle, g_pCertificate->wszTitleName, sizeof(tAsciiTitle)); - std::string szTitleName(tAsciiTitle); - CxbxKrnl_Xbe->PurgeBadChar(szTitleName); - sstream << cachePath << szTitleName << "-" << std::hex << uiHash << ".ini"; - std::string filename = sstream.str(); - - // This will fire when we exit this function scope; either after detecting a previous cache file, or when one is created - CxbxDebuggerScopedMessage hleCacheFilename(filename); - - if (PathFileExists(filename.c_str())) { - printf("Found HLE Cache File: %08X.ini\n", uiHash); - - g_BuildVersion = GetPrivateProfileInt("Libs", "D3D8_BuildVersion", 0, filename.c_str()); - - // Verify the version of the cache file against the HLE Database - const uint32 HLECacheHash = GetPrivateProfileInt("Info", "HLECacheHash", 0, filename.c_str()); - - if (HLECacheHash == XbSymbolLibraryVersion()) { - char buffer[SHRT_MAX] = { 0 }; - char* bufferPtr = buffer; - g_HLECacheUsed = true; - - const uint32 cacheRevision = GetPrivateProfileInt("Info", "revision", 0, filename.c_str()); - const uint32 cacheFlagsLLE = GetPrivateProfileInt("Info", "FlagsLLE", 0, filename.c_str()); - - if (cacheFlagsLLE != gFlagsLLE) { - g_HLECacheUsed = false; - } - else if (cacheRevision != revisionCache) { - g_HLECacheUsed = false; - } - - if (g_HLECacheUsed) { - printf("Using HLE Cache\n"); - - GetPrivateProfileSection("Symbols", buffer, sizeof(buffer), filename.c_str()); - - // Parse the .INI file into the map of symbol addresses - while (strlen(bufferPtr) > 0) { - std::string ini_entry(bufferPtr); - - auto separator = ini_entry.find('='); - std::string key = ini_entry.substr(0, separator); - std::string value = ini_entry.substr(separator + 1, std::string::npos); - uint32_t addr = strtol(value.c_str(), 0, 16); - - g_SymbolAddresses[key] = addr; - bufferPtr += strlen(bufferPtr) + 1; - } - - // Iterate through the map of symbol addresses, calling GetEmuPatchAddr on all functions. - for (auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { - std::string functionName = (*it).first; - xbaddr location = (*it).second; - - std::stringstream output; - output << "HLECache: 0x" << std::setfill('0') << std::setw(8) << std::hex << location - << " -> " << functionName; - void* pFunc = GetEmuPatchAddr(functionName); - if (pFunc != nullptr) { - // skip entries that weren't located at all - if (location == NULL) { - output << "\t(not patched)"; - } - // Prevent patching illegal addresses - else if (location < XBE_IMAGE_BASE) { - output << "\t*ADDRESS TOO LOW!*"; - } else if (location > g_SystemMaxMemory) { - output << "\t*ADDRESS TOO HIGH!*"; - } else { - EmuInstallPatch(functionName, location, pFunc); - output << "\t*PATCHED*"; - } - } else { - if (location != NULL) - output << "\t(no patch)"; - } - - output << "\n"; - printf(output.str().c_str()); - } - - // Fix up Render state and Texture States - if (g_SymbolAddresses.find("D3DDeferredRenderState") == g_SymbolAddresses.end() - || g_SymbolAddresses["D3DDeferredRenderState"] == 0) { - EmuWarning("EmuD3DDeferredRenderState was not found!"); - } - - if (g_SymbolAddresses.find("D3DDeferredTextureState") == g_SymbolAddresses.end() - || g_SymbolAddresses["D3DDeferredTextureState"] == 0) { - EmuWarning("EmuD3DDeferredTextureState was not found!"); - } - - if (g_SymbolAddresses.find("D3DDEVICE") == g_SymbolAddresses.end() - || g_SymbolAddresses["D3DDEVICE"] == 0) { - EmuWarning("D3DDEVICE was not found!"); - } - - EmuD3D_Init_DeferredStates(); - } - } - - // If g_SymbolAddresses didn't get filled, the HLE cache is invalid - if (g_SymbolAddresses.empty()) { - printf("HLE Cache file is outdated and will be regenerated\n"); - g_HLECacheUsed = false; - } - } - - // If the HLE Cache was used, skip symbol searching/patching - if (g_HLECacheUsed) { - return; - } - - // - // initialize Microsoft XDK emulation - // - if(pLibraryVersion != nullptr) { - - printf("HLE: Detected Microsoft XDK application...\n"); - - // TODO: Is this enough for alias? We need to verify it. - if ((XbLibScan & XbSymbolLib_D3D8) > 0 || (XbLibScan & XbSymbolLib_D3D8LTCG) > 0) { - g_BuildVersion = xdkVersion; - } -#if 0 // NOTE: This is a note for what we should do for above. - if (BuildVersion >= 5558 && BuildVersion <= 5659 && QFEVersion > 1) { - EmuWarning("D3D8 version 1.0.%d.%d Title Detected: This game uses an alias version 1.0.5788", BuildVersion, QFEVersion); - BuildVersion = 5788; - } -#endif - -#if 0 // NOTE: This code is currently disabled due to not optimized and require more work to do. - - XbSymbolRegisterLibrary(XbLibScan); - - while (true) { - - size_t SymbolSize = g_SymbolAddresses.size(); - - Xbe::SectionHeader* pSectionHeaders = reinterpret_cast(pXbeHeader->dwSectionHeadersAddr); - Xbe::SectionHeader* pSectionScan = nullptr; - - for (uint32 v = 0; v < pXbeHeader->dwSections; v++) { - - pSectionScan = pSectionHeaders + v; - - XbSymbolScanSection((uint32_t)pXbeHeader, 64 * ONE_MB, (const char*)pSectionScan->dwSectionNameAddr, pSectionScan->dwVirtualAddr, pSectionScan->dwSizeofRaw, xdkVersion, EmuRegisterSymbol); - } - - // If symbols are not adding to array, break the loop. - if (SymbolSize == g_SymbolAddresses.size()) { - break; - } - } -#endif - - XbSymbolSetOutputMessage(EmuOutputMessage); - - XbSymbolScan(pXbeHeader, EmuRegisterSymbol); - - EmuD3D_Init_DeferredStates(); - } - - printf("\n"); - - // Write the HLE Database version string - { - std::string HLECacheHashString = std::to_string(XbSymbolLibraryVersion()); - WritePrivateProfileString("Info", "HLECacheHash", HLECacheHashString.c_str(), filename.c_str()); - } - - - std::stringstream revision; - revision << std::dec << revisionCache; - WritePrivateProfileString("Info", "revision", revision.str().c_str(), filename.c_str()); - - std::stringstream flagsLLE; - flagsLLE << std::dec << gFlagsLLE; - WritePrivateProfileString("Info", "FlagsLLE", flagsLLE.str().c_str(), filename.c_str()); - - // Write the Certificate Details to the cache file - WritePrivateProfileString("Certificate", "Name", tAsciiTitle, filename.c_str()); - WritePrivateProfileString("Certificate", "TitleID", FormatTitleId(g_pCertificate->dwTitleId).c_str(), filename.c_str()); - - std::stringstream titleIdHex; - titleIdHex << std::hex << g_pCertificate->dwTitleId; - WritePrivateProfileString("Certificate", "TitleIDHex", titleIdHex.str().c_str(), filename.c_str()); - - std::stringstream region; - region << std::hex << g_pCertificate->dwGameRegion; - WritePrivateProfileString("Certificate", "Region", region.str().c_str(), filename.c_str()); - - // Write Library Details - for (uint i = 0; i < pXbeHeader->dwLibraryVersions; i++) { - std::string LibraryName(pLibraryVersion[i].szName, pLibraryVersion[i].szName + 8); - std::stringstream buildVersion; - buildVersion << pLibraryVersion[i].wBuildVersion; - - WritePrivateProfileString("Libs", LibraryName.c_str(), buildVersion.str().c_str(), filename.c_str()); - } - - std::stringstream buildVersion; - buildVersion << g_BuildVersion; - WritePrivateProfileString("Libs", "D3D8_BuildVersion", buildVersion.str().c_str(), filename.c_str()); - - // Write the found symbol addresses into the cache file - for(auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { - std::stringstream cacheAddress; - cacheAddress << std::hex << (*it).second; - WritePrivateProfileString("Symbols", (*it).first.c_str(), cacheAddress.str().c_str(), filename.c_str()); - } -} - -// NOTE: EmuInstallPatch do not get to be in XbSymbolDatabase, do the patches in Cxbx project only. -inline void EmuInstallPatch(std::string FunctionName, xbaddr FunctionAddr, void *Patch) -{ - g_FunctionHooks[FunctionName].Install((void*)(FunctionAddr), Patch); -} - -#if 0 // TODO: Need to move this into XbSymbolDatabase for depth verification usage. -#ifdef _DEBUG_TRACE - -struct HLEVerifyContext { - const HLEData *main_data; - OOVPA *oovpa, *against; - const HLEData *against_data; - uint32 main_index, against_index; -}; - -std::string HLEErrorString(const HLEData *data, uint16_t buildVersion, uint32 index) -{ - std::string result = - "OOVPATable " + (std::string)(data->LibSec.library) + "_" + std::to_string(buildVersion) - + "[" + std::to_string(index) + "] " - + (std::string)(data->OovpaTable[index].szFuncName); - - return result; -} - -void HLEError(HLEVerifyContext *context, uint16_t buildVersion, char *format, ...) -{ - std::string output = "HLE Error "; - if (context->main_data != nullptr) { - output += "in " + HLEErrorString(context->main_data, buildVersion, context->main_index); - } - - if (context->against != nullptr && context->against_data != nullptr) { - output += ", comparing against " + HLEErrorString(context->against_data, buildVersion, context->against_index); - } - - // format specific error message - char buffer[200]; - va_list args; - va_start(args, format); - vsprintf(buffer, format, args); - va_end(args); - - output += " : " + (std::string)buffer + (std::string)"\n"; - printf(output.c_str()); -} - -void VerifyHLEDataBaseAgainst(HLEVerifyContext *context); // forward - -void VerifyHLEOOVPA(HLEVerifyContext *context, uint16_t buildVersion, OOVPA *oovpa) -{ - if (context->against == nullptr) { - // TODO : verify XRefSaveIndex and XRef's (how?) - - // verify offsets are in increasing order - uint32 prev_offset; - uint08 dummy_value; - GetOovpaEntry(oovpa, oovpa->XRefCount, prev_offset, dummy_value); - for (int p = oovpa->XRefCount + 1; p < oovpa->Count; p++) { - uint32 curr_offset; - GetOovpaEntry(oovpa, p, curr_offset, dummy_value); - if (!(curr_offset > prev_offset)) { - HLEError(context, buildVersion, "Lovp[%d] : Offset (0x%x) must be larger then previous offset (0x%x)", - p, curr_offset, prev_offset); - } - } - - // find duplicate OOVPA's across all other data-table-oovpa's - context->oovpa = oovpa; - context->against = oovpa; - VerifyHLEDataBaseAgainst(context); - context->against = nullptr; // reset scanning state - return; - } - - // prevent checking an oovpa against itself - if (context->against == oovpa) { - return; - } - - // compare {Offset, Value}-pairs between two OOVPA's - OOVPA *left = context->against, *right = oovpa; - int l = 0, r = 0; - uint32 left_offset, right_offset; - uint08 left_value, right_value; - GetOovpaEntry(left, l, left_offset, left_value); - GetOovpaEntry(right, r, right_offset, right_value); - int unique_offset_left = 0; - int unique_offset_right = 0; - int equal_offset_value = 0; - int equal_offset_different_value = 0; - while (true) { - bool left_next = true; - bool right_next = true; - - if (left_offset < right_offset) { - unique_offset_left++; - right_next = false; - } else if (left_offset > right_offset) { - unique_offset_right++; - left_next = false; - } else if (left_value == right_value) { - equal_offset_value++; - } else { - equal_offset_different_value++; - } - - // increment r before use (in left_next) - if (right_next) { - r++; - } - - if (left_next) { - l++; - if (l >= left->Count) { - unique_offset_right += right->Count - r; - break; - } - - GetOovpaEntry(left, l, left_offset, left_value); - } - - if (right_next) { - if (r >= right->Count) { - unique_offset_left += left->Count - l; - break; - } - - GetOovpaEntry(right, r, right_offset, right_value); - } - } - - // no mismatching values on identical offsets? - if (equal_offset_different_value == 0) { - // enough matching OV-pairs? - if (equal_offset_value > 4) { - // no unique OV-pairs on either side? - if (unique_offset_left + unique_offset_right == 0) { - HLEError(context, buildVersion, "OOVPA's are identical", - unique_offset_left, - unique_offset_right); - } else { - // not too many new OV-pairs on the left side? - if (unique_offset_left < 6) { - // not too many new OV-parirs on the right side? - if (unique_offset_right < 6) { - HLEError(context, buildVersion, "OOVPA's are expanded (left +%d, right +%d)", - unique_offset_left, - unique_offset_right); - } - } - } - } - } -} - -void VerifyHLEDataEntry(HLEVerifyContext *context, const OOVPATable *table, uint32 index) -{ - if (context->against == nullptr) { - context->main_index = index; - } else { - context->against_index = index; - } - - if (context->against == nullptr) { - const char* checkDisableStr = nullptr; - size_t getFuncStrLength = strlen(table[index].szFuncName); - - if (getFuncStrLength > 10) { - checkDisableStr = &table[index].szFuncName[getFuncStrLength - 10]; - } - - if (checkDisableStr != nullptr && strcmp(checkDisableStr, "_UNPATCHED") == 0) { - if (GetEmuPatchAddr((std::string)table[index].szFuncName)) { - HLEError(context, table[index].Version, "OOVPA registration UNPATCHED while a patch exists!"); - } - } else if (table[index].Oovpa->XRefSaveIndex != XRefNoSaveIndex) { - if (GetEmuPatchAddr((std::string)table[index].szFuncName)) { - HLEError(context, table[index].Version, "OOVPA registration XREF while a patch exists!"); - } - } - } - - // verify the OOVPA of this entry - if (table[index].Oovpa != nullptr) { - VerifyHLEOOVPA(context, table[index].Version, table[index].Oovpa); - } -} - -void VerifyHLEData(HLEVerifyContext *context, const HLEData *data) -{ - if (context->against == nullptr) { - context->main_data = data; - } else { - context->against_data = data; - } - - // Don't check a database against itself : - if (context->main_data == context->against_data) { - return; - } - - // verify each entry in this HLEData - for (uint32 e = 0; e < data->OovpaTableCount; e++) { - VerifyHLEDataEntry(context, data->OovpaTable, e); - } -} - -void VerifyHLEDataBaseAgainst(HLEVerifyContext *context) -{ - // verify all HLEData's - for (uint32 d = 0; d < HLEDataBaseCount; d++) { - VerifyHLEData(context, &HLEDataBase[d]); - } -} - -void VerifyHLEDataBase() -{ - HLEVerifyContext context = { 0 }; - VerifyHLEDataBaseAgainst(&context); -} -#endif // _DEBUG_TRACE -#endif diff --git a/src/CxbxKrnl/KernelThunk.cpp b/src/CxbxKrnl/KernelThunk.cpp deleted file mode 100644 index 644003f92..000000000 --- a/src/CxbxKrnl/KernelThunk.cpp +++ /dev/null @@ -1,478 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->KernelThunkTable.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -// prevent name collisions -namespace xboxkrnl -{ - #include -}; - -#include "Cxbx.h" // For CxbxKrnl_KernelThunkTable -#include "CxbxKrnl.h" // For UINT - -#define FUNC(f) f -#define VARIABLE(v) v - -#define DEVKIT // developer kit only functions -#define PROFILING // private kernel profiling functions -// A.k.a. _XBOX_ENABLE_PROFILING - -// kernel thunk table -// Note : Names that collide with other symbols, use the KRNL() macro. -uint32 CxbxKrnl_KernelThunkTable[379] = -{ - (uint32)FUNC(xbnullptr), // 0x0000 (0) "Undefined", this function doesn't exist - (uint32)FUNC(&xboxkrnl::AvGetSavedDataAddress), // 0x0001 (1) - (uint32)FUNC(&xboxkrnl::AvSendTVEncoderOption), // 0x0002 (2) - (uint32)FUNC(&xboxkrnl::AvSetDisplayMode), // 0x0003 (3) - (uint32)FUNC(&xboxkrnl::AvSetSavedDataAddress), // 0x0004 (4) - (uint32)FUNC(&xboxkrnl::DbgBreakPoint), // 0x0005 (5) - (uint32)FUNC(&xboxkrnl::DbgBreakPointWithStatus), // 0x0006 (6) - (uint32)FUNC(&xboxkrnl::DbgLoadImageSymbols), // 0x0007 (7) DEVKIT - (uint32)FUNC(&xboxkrnl::DbgPrint), // 0x0008 (8) - (uint32)FUNC(&xboxkrnl::HalReadSMCTrayState), // 0x0009 (9) - (uint32)FUNC(&xboxkrnl::DbgPrompt), // 0x000A (10) - (uint32)FUNC(&xboxkrnl::DbgUnLoadImageSymbols), // 0x000B (11) DEVKIT - (uint32)FUNC(&xboxkrnl::ExAcquireReadWriteLockExclusive), // 0x000C (12) - (uint32)FUNC(&xboxkrnl::ExAcquireReadWriteLockShared), // 0x000D (13) - (uint32)FUNC(&xboxkrnl::ExAllocatePool), // 0x000E (14) - (uint32)FUNC(&xboxkrnl::ExAllocatePoolWithTag), // 0x000F (15) - (uint32)VARIABLE(&xboxkrnl::ExEventObjectType), // 0x0010 (16) - (uint32)FUNC(&xboxkrnl::ExFreePool), // 0x0011 (17) - (uint32)FUNC(&xboxkrnl::ExInitializeReadWriteLock), // 0x0012 (18) - (uint32)FUNC(&xboxkrnl::ExInterlockedAddLargeInteger), // 0x0013 (19) - (uint32)FUNC(&xboxkrnl::ExInterlockedAddLargeStatistic), // 0x0014 (20) - (uint32)FUNC(&xboxkrnl::ExInterlockedCompareExchange64), // 0x0015 (21) - (uint32)VARIABLE(&xboxkrnl::ExMutantObjectType), // 0x0016 (22) - (uint32)FUNC(&xboxkrnl::ExQueryPoolBlockSize), // 0x0017 (23) - (uint32)FUNC(&xboxkrnl::ExQueryNonVolatileSetting), // 0x0018 (24) - (uint32)FUNC(&xboxkrnl::ExReadWriteRefurbInfo), // 0x0019 (25) - (uint32)FUNC(&xboxkrnl::ExRaiseException), // 0x001A (26) - (uint32)FUNC(&xboxkrnl::ExRaiseStatus), // 0x001B (27) - (uint32)FUNC(&xboxkrnl::ExReleaseReadWriteLock), // 0x001C (28) - (uint32)FUNC(&xboxkrnl::ExSaveNonVolatileSetting), // 0x001D (29) - (uint32)VARIABLE(&xboxkrnl::ExSemaphoreObjectType), // 0x001E (30) - (uint32)VARIABLE(&xboxkrnl::ExTimerObjectType), // 0x001F (31) - (uint32)FUNC(&xboxkrnl::ExfInterlockedInsertHeadList), // 0x0020 (32) - (uint32)FUNC(&xboxkrnl::ExfInterlockedInsertTailList), // 0x0021 (33) - (uint32)FUNC(&xboxkrnl::ExfInterlockedRemoveHeadList), // 0x0022 (34) - (uint32)FUNC(&xboxkrnl::FscGetCacheSize), // 0x0023 (35) - (uint32)FUNC(&xboxkrnl::FscInvalidateIdleBlocks), // 0x0024 (36) - (uint32)FUNC(&xboxkrnl::FscSetCacheSize), // 0x0025 (37) - (uint32)FUNC(&xboxkrnl::HalClearSoftwareInterrupt), // 0x0026 (38) - (uint32)FUNC(&xboxkrnl::HalDisableSystemInterrupt), // 0x0027 (39) - (uint32)VARIABLE(&xboxkrnl::HalDiskCachePartitionCount), // 0x0028 (40) A.k.a. "IdexDiskPartitionPrefixBuffer" - (uint32)VARIABLE(&xboxkrnl::HalDiskModelNumber), // 0x0029 (41) - (uint32)VARIABLE(&xboxkrnl::HalDiskSerialNumber), // 0x002A (42) - (uint32)FUNC(&xboxkrnl::HalEnableSystemInterrupt), // 0x002B (43) - (uint32)FUNC(&xboxkrnl::HalGetInterruptVector), // 0x002C (44) - (uint32)FUNC(&xboxkrnl::HalReadSMBusValue), // 0x002D (45) - (uint32)FUNC(&xboxkrnl::HalReadWritePCISpace), // 0x002E (46) - (uint32)FUNC(&xboxkrnl::HalRegisterShutdownNotification), // 0x002F (47) - (uint32)FUNC(&xboxkrnl::HalRequestSoftwareInterrupt), // 0x0030 (48) - (uint32)FUNC(&xboxkrnl::HalReturnToFirmware), // 0x0031 (49) - (uint32)FUNC(&xboxkrnl::HalWriteSMBusValue), // 0x0032 (50) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedCompareExchange)), // 0x0033 (51) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedDecrement)), // 0x0034 (52) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedIncrement)), // 0x0035 (53) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedExchange)), // 0x0036 (54) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedExchangeAdd)), // 0x0037 (55) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedFlushSList)), // 0x0038 (56) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedPopEntrySList)), // 0x0039 (57) - (uint32)FUNC(&xboxkrnl::KRNL(InterlockedPushEntrySList)), // 0x003A (58) - (uint32)FUNC(&xboxkrnl::IoAllocateIrp), // 0x003B (59) - (uint32)FUNC(&xboxkrnl::IoBuildAsynchronousFsdRequest), // 0x003C (60) - (uint32)FUNC(&xboxkrnl::IoBuildDeviceIoControlRequest), // 0x003D (61) - (uint32)FUNC(&xboxkrnl::IoBuildSynchronousFsdRequest), // 0x003E (62) - (uint32)FUNC(&xboxkrnl::IoCheckShareAccess), // 0x003F (63) - (uint32)VARIABLE(&xboxkrnl::IoCompletionObjectType), // 0x0040 (64) - (uint32)FUNC(&xboxkrnl::IoCreateDevice), // 0x0041 (65) - (uint32)FUNC(&xboxkrnl::IoCreateFile), // 0x0042 (66) - (uint32)FUNC(&xboxkrnl::IoCreateSymbolicLink), // 0x0043 (67) - (uint32)FUNC(&xboxkrnl::IoDeleteDevice), // 0x0044 (68) - (uint32)FUNC(&xboxkrnl::IoDeleteSymbolicLink), // 0x0045 (69) - (uint32)VARIABLE(&xboxkrnl::IoDeviceObjectType), // 0x0046 (70) - (uint32)VARIABLE(&xboxkrnl::IoFileObjectType), // 0x0047 (71) - (uint32)FUNC(&xboxkrnl::IoFreeIrp), // 0x0048 (72) - (uint32)FUNC(&xboxkrnl::IoInitializeIrp), // 0x0049 (73) - (uint32)FUNC(&xboxkrnl::IoInvalidDeviceRequest), // 0x004A (74) - (uint32)FUNC(&xboxkrnl::IoQueryFileInformation), // 0x004B (75) - (uint32)FUNC(&xboxkrnl::IoQueryVolumeInformation), // 0x004C (76) - (uint32)FUNC(&xboxkrnl::IoQueueThreadIrp), // 0x004D (77) - (uint32)FUNC(&xboxkrnl::IoRemoveShareAccess), // 0x004E (78) - (uint32)FUNC(&xboxkrnl::IoSetIoCompletion), // 0x004F (79) - (uint32)FUNC(&xboxkrnl::IoSetShareAccess), // 0x0050 (80) - (uint32)FUNC(&xboxkrnl::IoStartNextPacket), // 0x0051 (81) - (uint32)FUNC(&xboxkrnl::IoStartNextPacketByKey), // 0x0052 (82) - (uint32)FUNC(&xboxkrnl::IoStartPacket), // 0x0053 (83) - (uint32)FUNC(&xboxkrnl::IoSynchronousDeviceIoControlRequest), // 0x0054 (84) - (uint32)FUNC(&xboxkrnl::IoSynchronousFsdRequest), // 0x0055 (85) - (uint32)FUNC(&xboxkrnl::IofCallDriver), // 0x0056 (86) - (uint32)FUNC(&xboxkrnl::IofCompleteRequest), // 0x0057 (87) - (uint32)VARIABLE(&xboxkrnl::KdDebuggerEnabled), // 0x0058 (88) - (uint32)VARIABLE(&xboxkrnl::KdDebuggerNotPresent), // 0x0059 (89) - (uint32)FUNC(&xboxkrnl::IoDismountVolume), // 0x005A (90) - (uint32)FUNC(&xboxkrnl::IoDismountVolumeByName), // 0x005B (91) - (uint32)FUNC(&xboxkrnl::KeAlertResumeThread), // 0x005C (92) - (uint32)FUNC(&xboxkrnl::KeAlertThread), // 0x005D (93) - (uint32)FUNC(&xboxkrnl::KeBoostPriorityThread), // 0x005E (94) - (uint32)FUNC(&xboxkrnl::KeBugCheck), // 0x005F (95) - (uint32)FUNC(&xboxkrnl::KeBugCheckEx), // 0x0060 (96) - (uint32)FUNC(&xboxkrnl::KeCancelTimer), // 0x0061 (97) - (uint32)FUNC(&xboxkrnl::KeConnectInterrupt), // 0x0062 (98) - (uint32)FUNC(&xboxkrnl::KeDelayExecutionThread), // 0x0063 (99) - (uint32)FUNC(&xboxkrnl::KeDisconnectInterrupt), // 0x0064 (100 - (uint32)FUNC(&xboxkrnl::KeEnterCriticalRegion), // 0x0065 (101) - (uint32)VARIABLE(&xboxkrnl::MmGlobalData), // 0x0066 (102) - (uint32)FUNC(&xboxkrnl::KeGetCurrentIrql), // 0x0067 (103) - (uint32)FUNC(&xboxkrnl::KeGetCurrentThread), // 0x0068 (104) - (uint32)FUNC(&xboxkrnl::KeInitializeApc), // 0x0069 (105) - (uint32)FUNC(&xboxkrnl::KeInitializeDeviceQueue), // 0x006A (106) - (uint32)FUNC(&xboxkrnl::KeInitializeDpc), // 0x006B (107) - (uint32)FUNC(&xboxkrnl::KeInitializeEvent), // 0x006C (108) - (uint32)FUNC(&xboxkrnl::KeInitializeInterrupt), // 0x006D (109) - (uint32)FUNC(&xboxkrnl::KeInitializeMutant), // 0x006E (110) - (uint32)FUNC(&xboxkrnl::KeInitializeQueue), // 0x006F (111) - (uint32)FUNC(&xboxkrnl::KeInitializeSemaphore), // 0x0070 (112) - (uint32)FUNC(&xboxkrnl::KeInitializeTimerEx), // 0x0071 (113) - (uint32)FUNC(&xboxkrnl::KeInsertByKeyDeviceQueue), // 0x0072 (114) - (uint32)FUNC(&xboxkrnl::KeInsertDeviceQueue), // 0x0073 (115) - (uint32)FUNC(&xboxkrnl::KeInsertHeadQueue), // 0x0074 (116) - (uint32)FUNC(&xboxkrnl::KeInsertQueue), // 0x0075 (117) - (uint32)FUNC(&xboxkrnl::KeInsertQueueApc), // 0x0076 (118) - (uint32)FUNC(&xboxkrnl::KeInsertQueueDpc), // 0x0077 (119) - (uint32)VARIABLE(0x0078), // 0x0078 (120) KeInterruptTime (Set by ConnectWindowsTimersToThunkTable) - (uint32)FUNC(&xboxkrnl::KeIsExecutingDpc), // 0x0079 (121) - (uint32)FUNC(&xboxkrnl::KeLeaveCriticalRegion), // 0x007A (122) - (uint32)FUNC(&xboxkrnl::KePulseEvent), // 0x007B (123) - (uint32)FUNC(&xboxkrnl::KeQueryBasePriorityThread), // 0x007C (124) - (uint32)FUNC(&xboxkrnl::KeQueryInterruptTime), // 0x007D (125) - (uint32)FUNC(&xboxkrnl::KeQueryPerformanceCounter), // 0x007E (126) - (uint32)FUNC(&xboxkrnl::KeQueryPerformanceFrequency), // 0x007F (127) - (uint32)FUNC(&xboxkrnl::KeQuerySystemTime), // 0x0080 (128) - (uint32)FUNC(&xboxkrnl::KeRaiseIrqlToDpcLevel), // 0x0081 (129) - (uint32)FUNC(&xboxkrnl::KeRaiseIrqlToSynchLevel), // 0x0082 (130) - (uint32)FUNC(&xboxkrnl::KeReleaseMutant), // 0x0083 (131) - (uint32)FUNC(&xboxkrnl::KeReleaseSemaphore), // 0x0084 (132) - (uint32)FUNC(&xboxkrnl::KeRemoveByKeyDeviceQueue), // 0x0085 (133) - (uint32)FUNC(&xboxkrnl::KeRemoveDeviceQueue), // 0x0086 (134) - (uint32)FUNC(&xboxkrnl::KeRemoveEntryDeviceQueue), // 0x0087 (135) - (uint32)FUNC(&xboxkrnl::KeRemoveQueue), // 0x0088 (136) - (uint32)FUNC(&xboxkrnl::KeRemoveQueueDpc), // 0x0089 (137) - (uint32)FUNC(&xboxkrnl::KeResetEvent), // 0x008A (138) - (uint32)FUNC(&xboxkrnl::KeRestoreFloatingPointState), // 0x008B (139) - (uint32)FUNC(&xboxkrnl::KeResumeThread), // 0x008C (140) - (uint32)FUNC(&xboxkrnl::KeRundownQueue), // 0x008D (141) - (uint32)FUNC(&xboxkrnl::KeSaveFloatingPointState), // 0x008E (142) - (uint32)FUNC(&xboxkrnl::KeSetBasePriorityThread), // 0x008F (143) - (uint32)FUNC(&xboxkrnl::KeSetDisableBoostThread), // 0x0090 (144) - (uint32)FUNC(&xboxkrnl::KeSetEvent), // 0x0091 (145) - (uint32)FUNC(&xboxkrnl::KeSetEventBoostPriority), // 0x0092 (146) - (uint32)FUNC(&xboxkrnl::KeSetPriorityProcess), // 0x0093 (147) - (uint32)FUNC(&xboxkrnl::KeSetPriorityThread), // 0x0094 (148) - (uint32)FUNC(&xboxkrnl::KeSetTimer), // 0x0095 (149) - (uint32)FUNC(&xboxkrnl::KeSetTimerEx), // 0x0096 (150) - (uint32)FUNC(&xboxkrnl::KeStallExecutionProcessor), // 0x0097 (151) - (uint32)FUNC(&xboxkrnl::KeSuspendThread), // 0x0098 (152) - (uint32)FUNC(&xboxkrnl::KeSynchronizeExecution), // 0x0099 (153) - (uint32)VARIABLE(0x009A), // 0x009A (154) KeSystemTime (Set by ConnectWindowsTimersToThunkTable) - (uint32)FUNC(&xboxkrnl::KeTestAlertThread), // 0x009B (155) - (uint32)VARIABLE(&xboxkrnl::KeTickCount), // 0x009C (156) - (uint32)VARIABLE(&xboxkrnl::KeTimeIncrement), // 0x009D (157) - (uint32)FUNC(&xboxkrnl::KeWaitForMultipleObjects), // 0x009E (158) - (uint32)FUNC(&xboxkrnl::KeWaitForSingleObject), // 0x009F (159) - (uint32)FUNC(&xboxkrnl::KfRaiseIrql), // 0x00A0 (160) - (uint32)FUNC(&xboxkrnl::KfLowerIrql), // 0x00A1 (161) - (uint32)VARIABLE(&xboxkrnl::KiBugCheckData), // 0x00A2 (162) - (uint32)FUNC(&xboxkrnl::KiUnlockDispatcherDatabase), // 0x00A3 (163) - (uint32)VARIABLE(&xboxkrnl::LaunchDataPage), // 0x00A4 (164) - (uint32)FUNC(&xboxkrnl::MmAllocateContiguousMemory), // 0x00A5 (165) - (uint32)FUNC(&xboxkrnl::MmAllocateContiguousMemoryEx), // 0x00A6 (166) - (uint32)FUNC(&xboxkrnl::MmAllocateSystemMemory), // 0x00A7 (167) - (uint32)FUNC(&xboxkrnl::MmClaimGpuInstanceMemory), // 0x00A8 (168) - (uint32)FUNC(&xboxkrnl::MmCreateKernelStack), // 0x00A9 (169) - (uint32)FUNC(&xboxkrnl::MmDeleteKernelStack), // 0x00AA (170) - (uint32)FUNC(&xboxkrnl::MmFreeContiguousMemory), // 0x00AB (171) - (uint32)FUNC(&xboxkrnl::MmFreeSystemMemory), // 0x00AC (172) - (uint32)FUNC(&xboxkrnl::MmGetPhysicalAddress), // 0x00AD (173) - (uint32)FUNC(&xboxkrnl::MmIsAddressValid), // 0x00AE (174) - (uint32)FUNC(&xboxkrnl::MmLockUnlockBufferPages), // 0x00AF (175) - (uint32)FUNC(&xboxkrnl::MmLockUnlockPhysicalPage), // 0x00B0 (176) - (uint32)FUNC(&xboxkrnl::MmMapIoSpace), // 0x00B1 (177) - (uint32)FUNC(&xboxkrnl::MmPersistContiguousMemory), // 0x00B2 (178) - (uint32)FUNC(&xboxkrnl::MmQueryAddressProtect), // 0x00B3 (179) - (uint32)FUNC(&xboxkrnl::MmQueryAllocationSize), // 0x00B4 (180) - (uint32)FUNC(&xboxkrnl::MmQueryStatistics), // 0x00B5 (181) - (uint32)FUNC(&xboxkrnl::MmSetAddressProtect), // 0x00B6 (182) - (uint32)FUNC(&xboxkrnl::MmUnmapIoSpace), // 0x00B7 (183) - (uint32)FUNC(&xboxkrnl::NtAllocateVirtualMemory), // 0x00B8 (184) - (uint32)FUNC(&xboxkrnl::NtCancelTimer), // 0x00B9 (185) - (uint32)FUNC(&xboxkrnl::NtClearEvent), // 0x00BA (186) - (uint32)FUNC(&xboxkrnl::NtClose), // 0x00BB (187) - (uint32)FUNC(&xboxkrnl::NtCreateDirectoryObject), // 0x00BC (188) - (uint32)FUNC(&xboxkrnl::NtCreateEvent), // 0x00BD (189) - (uint32)FUNC(&xboxkrnl::NtCreateFile), // 0x00BE (190) - (uint32)FUNC(&xboxkrnl::NtCreateIoCompletion), // 0x00BF (191) - (uint32)FUNC(&xboxkrnl::NtCreateMutant), // 0x00C0 (192) - (uint32)FUNC(&xboxkrnl::NtCreateSemaphore), // 0x00C1 (193) - (uint32)FUNC(&xboxkrnl::NtCreateTimer), // 0x00C2 (194) - (uint32)FUNC(&xboxkrnl::NtDeleteFile), // 0x00C3 (195) - (uint32)FUNC(&xboxkrnl::NtDeviceIoControlFile), // 0x00C4 (196) - (uint32)FUNC(&xboxkrnl::NtDuplicateObject), // 0x00C5 (197) - (uint32)FUNC(&xboxkrnl::NtFlushBuffersFile), // 0x00C6 (198) - (uint32)FUNC(&xboxkrnl::NtFreeVirtualMemory), // 0x00C7 (199) - (uint32)FUNC(&xboxkrnl::NtFsControlFile), // 0x00C8 (200) - (uint32)FUNC(&xboxkrnl::NtOpenDirectoryObject), // 0x00C9 (201) - (uint32)FUNC(&xboxkrnl::NtOpenFile), // 0x00CA (202) - (uint32)FUNC(&xboxkrnl::NtOpenSymbolicLinkObject), // 0x00CB (203) - (uint32)FUNC(&xboxkrnl::NtProtectVirtualMemory), // 0x00CC (204) - (uint32)FUNC(&xboxkrnl::NtPulseEvent), // 0x00CD (205) - (uint32)FUNC(&xboxkrnl::NtQueueApcThread), // 0x00CE (206) - (uint32)FUNC(&xboxkrnl::NtQueryDirectoryFile), // 0x00CF (207) - (uint32)FUNC(&xboxkrnl::NtQueryDirectoryObject), // 0x00D0 (208) - (uint32)FUNC(&xboxkrnl::NtQueryEvent), // 0x00D1 (209) - (uint32)FUNC(&xboxkrnl::NtQueryFullAttributesFile), // 0x00D2 (210) - (uint32)FUNC(&xboxkrnl::NtQueryInformationFile), // 0x00D3 (211) - (uint32)FUNC(&xboxkrnl::NtQueryIoCompletion), // 0x00D4 (212) - (uint32)FUNC(&xboxkrnl::NtQueryMutant), // 0x00D5 (213) - (uint32)FUNC(&xboxkrnl::NtQuerySemaphore), // 0x00D6 (214) - (uint32)FUNC(&xboxkrnl::NtQuerySymbolicLinkObject), // 0x00D7 (215) - (uint32)FUNC(&xboxkrnl::NtQueryTimer), // 0x00D8 (216) - (uint32)FUNC(&xboxkrnl::NtQueryVirtualMemory), // 0x00D9 (217) - (uint32)FUNC(&xboxkrnl::NtQueryVolumeInformationFile), // 0x00DA (218) - (uint32)FUNC(&xboxkrnl::NtReadFile), // 0x00DB (219) - (uint32)FUNC(&xboxkrnl::NtReadFileScatter), // 0x00DC (220) - (uint32)FUNC(&xboxkrnl::NtReleaseMutant), // 0x00DD (221) - (uint32)FUNC(&xboxkrnl::NtReleaseSemaphore), // 0x00DE (222) - (uint32)FUNC(&xboxkrnl::NtRemoveIoCompletion), // 0x00DF (223) - (uint32)FUNC(&xboxkrnl::NtResumeThread), // 0x00E0 (224) - (uint32)FUNC(&xboxkrnl::NtSetEvent), // 0x00E1 (225) - (uint32)FUNC(&xboxkrnl::NtSetInformationFile), // 0x00E2 (226) - (uint32)FUNC(&xboxkrnl::NtSetIoCompletion), // 0x00E3 (227) - (uint32)FUNC(&xboxkrnl::NtSetSystemTime), // 0x00E4 (228) - (uint32)FUNC(&xboxkrnl::NtSetTimerEx), // 0x00E5 (229) - (uint32)FUNC(&xboxkrnl::NtSignalAndWaitForSingleObjectEx), // 0x00E6 (230) - (uint32)FUNC(&xboxkrnl::NtSuspendThread), // 0x00E7 (231) - (uint32)FUNC(&xboxkrnl::NtUserIoApcDispatcher), // 0x00E8 (232) - (uint32)FUNC(&xboxkrnl::NtWaitForSingleObject), // 0x00E9 (233) - (uint32)FUNC(&xboxkrnl::NtWaitForSingleObjectEx), // 0x00EA (234) - (uint32)FUNC(&xboxkrnl::NtWaitForMultipleObjectsEx), // 0x00EB (235) - (uint32)FUNC(&xboxkrnl::NtWriteFile), // 0x00EC (236) - (uint32)FUNC(&xboxkrnl::NtWriteFileGather), // 0x00ED (237) - (uint32)FUNC(&xboxkrnl::NtYieldExecution), // 0x00EE (238) - (uint32)FUNC(&xboxkrnl::ObCreateObject), // 0x00EF (239) - (uint32)VARIABLE(&xboxkrnl::ObDirectoryObjectType), // 0x00F0 (240) - (uint32)FUNC(&xboxkrnl::ObInsertObject), // 0x00F1 (241) - (uint32)FUNC(&xboxkrnl::ObMakeTemporaryObject), // 0x00F2 (242) - (uint32)FUNC(&xboxkrnl::ObOpenObjectByName), // 0x00F3 (243) - (uint32)FUNC(&xboxkrnl::ObOpenObjectByPointer), // 0x00F4 (244) - (uint32)VARIABLE(&xboxkrnl::ObpObjectHandleTable), // 0x00F5 (245) - (uint32)FUNC(&xboxkrnl::ObReferenceObjectByHandle), // 0x00F6 (246) - (uint32)FUNC(&xboxkrnl::ObReferenceObjectByName), // 0x00F7 (247) - (uint32)FUNC(&xboxkrnl::ObReferenceObjectByPointer), // 0x00F8 (248) - (uint32)VARIABLE(&xboxkrnl::ObSymbolicLinkObjectType), // 0x00F9 (249) - (uint32)FUNC(&xboxkrnl::ObfDereferenceObject), // 0x00FA (250) - (uint32)FUNC(&xboxkrnl::ObfReferenceObject), // 0x00FB (251) - (uint32)FUNC(&xboxkrnl::PhyGetLinkState), // 0x00FC (252) - (uint32)FUNC(&xboxkrnl::PhyInitialize), // 0x00FD (253) - (uint32)FUNC(&xboxkrnl::PsCreateSystemThread), // 0x00FE (254) - (uint32)FUNC(&xboxkrnl::PsCreateSystemThreadEx), // 0x00FF (255) - (uint32)FUNC(&xboxkrnl::PsQueryStatistics), // 0x0100 (256) - (uint32)FUNC(&xboxkrnl::PsSetCreateThreadNotifyRoutine), // 0x0101 (257) - (uint32)FUNC(&xboxkrnl::PsTerminateSystemThread), // 0x0102 (258) - (uint32)VARIABLE(&xboxkrnl::PsThreadObjectType), // 0x0103 (259) - (uint32)FUNC(&xboxkrnl::RtlAnsiStringToUnicodeString), // 0x0104 (260) - (uint32)FUNC(&xboxkrnl::RtlAppendStringToString), // 0x0105 (261) - (uint32)FUNC(&xboxkrnl::RtlAppendUnicodeStringToString), // 0x0106 (262) - (uint32)FUNC(&xboxkrnl::RtlAppendUnicodeToString), // 0x0107 (263) - (uint32)FUNC(&xboxkrnl::RtlAssert), // 0x0108 (264) - (uint32)FUNC(&xboxkrnl::RtlCaptureContext), // 0x0109 (265) - (uint32)FUNC(&xboxkrnl::RtlCaptureStackBackTrace), // 0x010A (266) - (uint32)FUNC(&xboxkrnl::RtlCharToInteger), // 0x010B (267) - (uint32)FUNC(&xboxkrnl::RtlCompareMemory), // 0x010C (268) - (uint32)FUNC(&xboxkrnl::RtlCompareMemoryUlong), // 0x010D (269) - (uint32)FUNC(&xboxkrnl::RtlCompareString), // 0x010E (270) - (uint32)FUNC(&xboxkrnl::RtlCompareUnicodeString), // 0x010F (271) - (uint32)FUNC(&xboxkrnl::RtlCopyString), // 0x0110 (272) - (uint32)FUNC(&xboxkrnl::RtlCopyUnicodeString), // 0x0111 (273) - (uint32)FUNC(&xboxkrnl::RtlCreateUnicodeString), // 0x0112 (274) - (uint32)FUNC(&xboxkrnl::RtlDowncaseUnicodeChar), // 0x0113 (275) - (uint32)FUNC(&xboxkrnl::RtlDowncaseUnicodeString), // 0x0114 (276) - (uint32)FUNC(&xboxkrnl::RtlEnterCriticalSection), // 0x0115 (277) - (uint32)FUNC(&xboxkrnl::RtlEnterCriticalSectionAndRegion), // 0x0116 (278) - (uint32)FUNC(&xboxkrnl::RtlEqualString), // 0x0117 (279) - (uint32)FUNC(&xboxkrnl::RtlEqualUnicodeString), // 0x0118 (280) - (uint32)FUNC(&xboxkrnl::RtlExtendedIntegerMultiply), // 0x0119 (281) - (uint32)FUNC(&xboxkrnl::RtlExtendedLargeIntegerDivide), // 0x011A (282) - (uint32)FUNC(&xboxkrnl::RtlExtendedMagicDivide), // 0x011B (283) - (uint32)FUNC(&xboxkrnl::RtlFillMemory), // 0x011C (284) - (uint32)FUNC(&xboxkrnl::RtlFillMemoryUlong), // 0x011D (285) - (uint32)FUNC(&xboxkrnl::RtlFreeAnsiString), // 0x011E (286) - (uint32)FUNC(&xboxkrnl::RtlFreeUnicodeString), // 0x011F (287) - (uint32)FUNC(&xboxkrnl::RtlGetCallersAddress), // 0x0120 (288) - (uint32)FUNC(&xboxkrnl::RtlInitAnsiString), // 0x0121 (289) - (uint32)FUNC(&xboxkrnl::RtlInitUnicodeString), // 0x0122 (290) - (uint32)FUNC(&xboxkrnl::RtlInitializeCriticalSection), // 0x0123 (291) - (uint32)FUNC(&xboxkrnl::RtlIntegerToChar), // 0x0124 (292) - (uint32)FUNC(&xboxkrnl::RtlIntegerToUnicodeString), // 0x0125 (293) - (uint32)FUNC(&xboxkrnl::RtlLeaveCriticalSection), // 0x0126 (294) - (uint32)FUNC(&xboxkrnl::RtlLeaveCriticalSectionAndRegion), // 0x0127 (295) - (uint32)FUNC(&xboxkrnl::RtlLowerChar), // 0x0128 (296) - (uint32)FUNC(&xboxkrnl::RtlMapGenericMask), // 0x0129 (297) - (uint32)FUNC(&xboxkrnl::RtlMoveMemory), // 0x012A (298) - (uint32)FUNC(&xboxkrnl::RtlMultiByteToUnicodeN), // 0x012B (299) - (uint32)FUNC(&xboxkrnl::RtlMultiByteToUnicodeSize), // 0x012C (300) - (uint32)FUNC(&xboxkrnl::RtlNtStatusToDosError), // 0x012D (301) - (uint32)FUNC(&xboxkrnl::RtlRaiseException), // 0x012E (302) - (uint32)FUNC(&xboxkrnl::RtlRaiseStatus), // 0x012F (303) - (uint32)FUNC(&xboxkrnl::RtlTimeFieldsToTime), // 0x0130 (304) - (uint32)FUNC(&xboxkrnl::RtlTimeToTimeFields), // 0x0131 (305) - (uint32)FUNC(&xboxkrnl::RtlTryEnterCriticalSection), // 0x0132 (306) - (uint32)FUNC(&xboxkrnl::RtlUlongByteSwap), // 0x0133 (307) - (uint32)FUNC(&xboxkrnl::RtlUnicodeStringToAnsiString), // 0x0134 (308) - (uint32)FUNC(&xboxkrnl::RtlUnicodeStringToInteger), // 0x0135 (309) - (uint32)FUNC(&xboxkrnl::RtlUnicodeToMultiByteN), // 0x0136 (310) - (uint32)FUNC(&xboxkrnl::RtlUnicodeToMultiByteSize), // 0x0137 (311) - (uint32)FUNC(&xboxkrnl::RtlUnwind), // 0x0138 (312) - (uint32)FUNC(&xboxkrnl::RtlUpcaseUnicodeChar), // 0x0139 (313) - (uint32)FUNC(&xboxkrnl::RtlUpcaseUnicodeString), // 0x013A (314) - (uint32)FUNC(&xboxkrnl::RtlUpcaseUnicodeToMultiByteN), // 0x013B (315) - (uint32)FUNC(&xboxkrnl::RtlUpperChar), // 0x013C (316) - (uint32)FUNC(&xboxkrnl::RtlUpperString), // 0x013D (317) - (uint32)FUNC(&xboxkrnl::RtlUshortByteSwap), // 0x013E (318) - (uint32)FUNC(&xboxkrnl::RtlWalkFrameChain), // 0x013F (319) - (uint32)FUNC(&xboxkrnl::RtlZeroMemory), // 0x0140 (320) - (uint32)VARIABLE(&xboxkrnl::XboxEEPROMKey), // 0x0141 (321) - (uint32)VARIABLE(&xboxkrnl::XboxHardwareInfo), // 0x0142 (322) - (uint32)VARIABLE(&xboxkrnl::XboxHDKey), // 0x0143 (323) - (uint32)VARIABLE(&xboxkrnl::XboxKrnlVersion), // 0x0144 (324) - (uint32)VARIABLE(&xboxkrnl::XboxSignatureKey), // 0x0145 (325) - (uint32)VARIABLE(&xboxkrnl::XeImageFileName), // 0x0146 (326) - (uint32)FUNC(&xboxkrnl::XeLoadSection), // 0x0147 (327) - (uint32)FUNC(&xboxkrnl::XeUnloadSection), // 0x0148 (328) - (uint32)FUNC(&xboxkrnl::READ_PORT_BUFFER_UCHAR), // 0x0149 (329) - (uint32)FUNC(&xboxkrnl::READ_PORT_BUFFER_USHORT), // 0x014A (330) - (uint32)FUNC(&xboxkrnl::READ_PORT_BUFFER_ULONG), // 0x014B (331) - (uint32)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_UCHAR), // 0x014C (332) - (uint32)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_USHORT), // 0x014D (333) - (uint32)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_ULONG), // 0x014E (334) - (uint32)FUNC(&xboxkrnl::XcSHAInit), // 0x014F (335) - (uint32)FUNC(&xboxkrnl::XcSHAUpdate), // 0x0150 (336) - (uint32)FUNC(&xboxkrnl::XcSHAFinal), // 0x0151 (337) - (uint32)FUNC(&xboxkrnl::XcRC4Key), // 0x0152 (338) - (uint32)FUNC(&xboxkrnl::XcRC4Crypt), // 0x0153 (339) - (uint32)FUNC(&xboxkrnl::XcHMAC), // 0x0154 (340) - (uint32)FUNC(&xboxkrnl::XcPKEncPublic), // 0x0155 (341) - (uint32)FUNC(&xboxkrnl::XcPKDecPrivate), // 0x0156 (342) - (uint32)FUNC(&xboxkrnl::XcPKGetKeyLen), // 0x0157 (343) - (uint32)FUNC(&xboxkrnl::XcVerifyPKCS1Signature), // 0x0158 (344) - (uint32)FUNC(&xboxkrnl::XcModExp), // 0x0159 (345) - (uint32)FUNC(&xboxkrnl::XcDESKeyParity), // 0x015A (346) - (uint32)FUNC(&xboxkrnl::XcKeyTable), // 0x015B (347) - (uint32)FUNC(&xboxkrnl::XcBlockCrypt), // 0x015C (348) - (uint32)FUNC(&xboxkrnl::XcBlockCryptCBC), // 0x015D (349) - (uint32)FUNC(&xboxkrnl::XcCryptService), // 0x015E (350) - (uint32)FUNC(&xboxkrnl::XcUpdateCrypto), // 0x015F (351) - (uint32)FUNC(&xboxkrnl::RtlRip), // 0x0160 (352) - (uint32)VARIABLE(&xboxkrnl::XboxLANKey), // 0x0161 (353) - (uint32)VARIABLE(&xboxkrnl::XboxAlternateSignatureKeys), // 0x0162 (354) - (uint32)VARIABLE(&xboxkrnl::XePublicKeyData), // 0x0163 (355) - (uint32)VARIABLE(&xboxkrnl::HalBootSMCVideoMode), // 0x0164 (356) - (uint32)VARIABLE(&xboxkrnl::IdexChannelObject), // 0x0165 (357) - (uint32)FUNC(&xboxkrnl::HalIsResetOrShutdownPending), // 0x0166 (358) - (uint32)FUNC(&xboxkrnl::IoMarkIrpMustComplete), // 0x0167 (359) - (uint32)FUNC(&xboxkrnl::HalInitiateShutdown), // 0x0168 (360) - (uint32)FUNC(&xboxkrnl::RtlSnprintf), // 0x0169 (361) - (uint32)FUNC(&xboxkrnl::RtlSprintf), // 0x016A (362) - (uint32)FUNC(&xboxkrnl::RtlVsnprintf), // 0x016B (363) - (uint32)FUNC(&xboxkrnl::RtlVsprintf), // 0x016C (364) - (uint32)FUNC(&xboxkrnl::HalEnableSecureTrayEject), // 0x016D (365) - (uint32)FUNC(&xboxkrnl::HalWriteSMCScratchRegister), // 0x016E (366) - (uint32)FUNC(&xboxkrnl::UnknownAPI367), // 0x016F (367) - (uint32)FUNC(&xboxkrnl::UnknownAPI368), // 0x0170 (368) - (uint32)FUNC(&xboxkrnl::UnknownAPI369), // 0x0171 (369) - (uint32)FUNC(&xboxkrnl::XProfpControl), // 0x0172 (370) PROFILING - (uint32)FUNC(&xboxkrnl::XProfpGetData), // 0x0173 (371) PROFILING - (uint32)FUNC(&xboxkrnl::IrtClientInitFast), // 0x0174 (372) PROFILING - (uint32)FUNC(&xboxkrnl::IrtSweep), // 0x0175 (373) PROFILING - (uint32)FUNC(&xboxkrnl::MmDbgAllocateMemory), // 0x0176 (374) DEVKIT ONLY! - (uint32)FUNC(&xboxkrnl::MmDbgFreeMemory), // 0x0177 (375) DEVKIT ONLY! - (uint32)FUNC(&xboxkrnl::MmDbgQueryAvailablePages), // 0x0178 (376) DEVKIT ONLY! - (uint32)FUNC(&xboxkrnl::MmDbgReleaseAddress), // 0x0179 (377) DEVKIT ONLY! - (uint32)FUNC(&xboxkrnl::MmDbgWriteCheck), // 0x017A (378) DEVKIT ONLY! -}; - -/* prevent name collisions */ -namespace NtDll -{ - #include "EmuNtDll.h" -}; - -// Virtual memory location of KUSER_SHARED_DATA : -// See http://research.microsoft.com/en-us/um/redmond/projects/invisible/src/base/md/i386/sim/_pertest2.c.htm -// and http://research.microsoft.com/en-us/um/redmond/projects/invisible/src/base/md/i386/sim/_glue.c.htm -// and http://processhacker.sourceforge.net/doc/ntexapi_8h_source.html -// and http://forum.sysinternals.com/0x7ffe0000-what-is-in-it_topic10012.html -#define MM_SHARED_USER_DATA_VA 0x7FFE0000 -#define USER_SHARED_DATA ((NtDll::KUSER_SHARED_DATA * const)MM_SHARED_USER_DATA_VA) - -// KUSER_SHARED_DATA Offsets -// See http://native-nt-toolkit.googlecode.com/svn/trunk/ndk/asm.h -// Note : KUSER_SHARED_DATA.TickCountLow seems deprecated -const UINT USER_SHARED_DATA_TICK_COUNT = 0x320; - -// Here we define the addresses of the native Windows timers : -// Source: Dxbx -const xboxkrnl::PKSYSTEM_TIME CxbxNtTickCount = (xboxkrnl::PKSYSTEM_TIME)(MM_SHARED_USER_DATA_VA + USER_SHARED_DATA_TICK_COUNT); - -void ConnectWindowsTimersToThunkTable() -{ - // Couple the xbox thunks for xboxkrnl::KeInterruptTime and xboxkrnl::KeSystemTime - // to their actual counterparts on Windows, this way we won't have to spend any - // time on updating them ourselves, and still get highly accurate timers! - // See http://www.dcl.hpi.uni-potsdam.de/research/WRK/2007/08/getting-os-information-the-kuser_shared_data-structure/ - - // Point Xbox KeInterruptTime to host InterruptTime: - CxbxKrnl_KernelThunkTable[120] = (uint32)&(USER_SHARED_DATA->InterruptTime); - - // Point Xbox KeSystemTime to host SystemTime; If read directly (thus skipping - // KeQuerySystemTime), this value is not adjusted with HostSystemTimeDelta! - CxbxKrnl_KernelThunkTable[154] = (uint32)&(USER_SHARED_DATA->SystemTime); - - // We can't point Xbox KeTickCount to host TickCount, because it - // updates slower on the xbox. See EmuUpdateTickCount(). -} diff --git a/src/CxbxKrnl/xxhash32.h b/src/CxbxKrnl/xxhash32.h deleted file mode 100644 index 290953795..000000000 --- a/src/CxbxKrnl/xxhash32.h +++ /dev/null @@ -1,167 +0,0 @@ -// ////////////////////////////////////////////////////////// -// xxhash32.h -// Copyright (c) 2016 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// -#pragma once -#include // for uint32_t and uint64_t -#include "crc32c.h" -/// XXHash (32 bit), based on Yann Collet's descriptions, see http://cyan4973.github.io/xxHash/ -/** How to use: -uint32_t myseed = 0; -XXHash32 myhash(myseed); -myhash.add(pointerToSomeBytes, numberOfBytes); -myhash.add(pointerToSomeMoreBytes, numberOfMoreBytes); // call add() as often as you like to ... -// and compute hash: -uint32_t result = myhash.hash(); -// or all of the above in one single line: -uint32_t result2 = XXHash32::hash(mypointer, numBytes, myseed); -Note: my code is NOT endian-aware ! -**/ -class XXHash32 -{ -public: - /// create new XXHash (32 bit) - /** @param seed your seed value, even zero is a valid seed and e.g. used by LZ4 **/ - explicit XXHash32(uint32_t seed) - { - state[0] = seed + Prime1 + Prime2; - state[1] = seed + Prime2; - state[2] = seed; - state[3] = seed - Prime1; - bufferSize = 0; - totalLength = 0; - } - /// add a chunk of bytes - /** @param input pointer to a continuous block of data - @param length number of bytes - @return false if parameters are invalid / zero **/ - bool add(const void* input, uint64_t length) - { - // no data ? - if (!input || length == 0) - return false; - totalLength += length; - // byte-wise access - const unsigned char* data = (const unsigned char*)input; - // unprocessed old data plus new data still fit in temporary buffer ? - if (bufferSize + length < MaxBufferSize) - { - // just add new data - while (length-- > 0) - buffer[bufferSize++] = *data++; - return true; - } - // point beyond last byte - const unsigned char* stop = data + length; - const unsigned char* stopBlock = stop - MaxBufferSize; - // some data left from previous update ? - if (bufferSize > 0) - { - // make sure temporary buffer is full (16 bytes) - while (bufferSize < MaxBufferSize) - buffer[bufferSize++] = *data++; - // process these 16 bytes (4x4) - process(buffer, state[0], state[1], state[2], state[3]); - } - // copying state to local variables helps optimizer A LOT - uint32_t s0 = state[0], s1 = state[1], s2 = state[2], s3 = state[3]; - // 16 bytes at once - while (data <= stopBlock) - { - // local variables s0..s3 instead of state[0]..state[3] are much faster - process(data, s0, s1, s2, s3); - data += 16; - } - // copy back - state[0] = s0; state[1] = s1; state[2] = s2; state[3] = s3; - // copy remainder to temporary buffer - bufferSize = stop - data; - for (unsigned int i = 0; i < bufferSize; i++) - buffer[i] = data[i]; - // done - return true; - } - /// get current hash - /** @return 32 bit XXHash **/ - uint32_t hash() const - { - uint32_t result = (uint32_t)totalLength; - // fold 128 bit state into one single 32 bit value - if (totalLength >= MaxBufferSize) - result += rotateLeft(state[0], 1) + - rotateLeft(state[1], 7) + - rotateLeft(state[2], 12) + - rotateLeft(state[3], 18); - else - // internal state wasn't set in add(), therefore original seed is still stored in state2 - result += state[2] + Prime5; - // process remaining bytes in temporary buffer - const unsigned char* data = buffer; - // point beyond last byte - const unsigned char* stop = data + bufferSize; - // at least 4 bytes left ? => eat 4 bytes per step - for (; data + 4 <= stop; data += 4) - result = rotateLeft(result + *(uint32_t*)data * Prime3, 17) * Prime4; - // take care of remaining 0..3 bytes, eat 1 byte per step - while (data != stop) - result = rotateLeft(result + (*data++) * Prime5, 11) * Prime1; - // mix bits - result ^= result >> 15; - result *= Prime2; - result ^= result >> 13; - result *= Prime3; - result ^= result >> 16; - return result; - } - /// combine constructor, add() and hash() in one static function (C style) - /** @param input pointer to a continuous block of data - @param length number of bytes - @param seed your seed value, e.g. zero is a valid seed and used by LZ4 - @return 32 bit XXHash **/ - static uint32_t hash(const void* input, uint64_t length, uint32_t seed) - { - // Some modern CPUs support hardware accellerated CRC32 - // This is significantly faster than xxHash, in some cases, by more than double - // So now we check for this capability and use it if it exists. - // This significantly reduces the impact of hashing on CPUs supporting SSE4.2 - // but also keeps xxHash present as a fast fallback, for those who don't support it - static bool bHardwareCrc32 = crc32c_hw_available(); // Cache the result in a static variable to avoid _cpuid every call - static bool bCrc32Init = false; - if (bHardwareCrc32) { - return crc32c_append(seed, (uint8_t*)input, (size_t)length); - } - - XXHash32 hasher(seed); - hasher.add(input, length); - return hasher.hash(); - } -private: - /// magic constants :-) - static const uint32_t Prime1 = 2654435761U; - static const uint32_t Prime2 = 2246822519U; - static const uint32_t Prime3 = 3266489917U; - static const uint32_t Prime4 = 668265263U; - static const uint32_t Prime5 = 374761393U; - /// temporarily store up to 15 bytes between multiple add() calls - static const uint32_t MaxBufferSize = 15 + 1; - // internal state and temporary buffer - uint32_t state[4]; // state[2] == seed if totalLength < MaxBufferSize - unsigned char buffer[MaxBufferSize]; - unsigned int bufferSize; - uint64_t totalLength; - /// rotate bits, should compile to a single CPU instruction (ROL) - static inline uint32_t rotateLeft(uint32_t x, unsigned char bits) - { - return (x << bits) | (x >> (32 - bits)); - } - /// process a block of 4x4 bytes, this is the main part of the XXHash32 algorithm - static inline void process(const void* data, uint32_t& state0, uint32_t& state1, uint32_t& state2, uint32_t& state3) - { - const uint32_t* block = (const uint32_t*)data; - state0 = rotateLeft(state0 + block[0] * Prime2, 13) * Prime1; - state1 = rotateLeft(state1 + block[1] * Prime2, 13) * Prime1; - state2 = rotateLeft(state2 + block[2] * Prime2, 13) * Prime1; - state3 = rotateLeft(state3 + block[3] * Prime2, 13) * Prime1; - } -}; \ No newline at end of file diff --git a/src/CxbxVersion.cpp b/src/CxbxVersion.cpp new file mode 100644 index 000000000..f3b0be0d3 --- /dev/null +++ b/src/CxbxVersion.cpp @@ -0,0 +1,11 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include "Version.h" +#include "CxbxVersion.h" + +/*! version string dependent on trace flag */ +#ifndef _DEBUG_TRACE +const char* CxbxVersionStr = _GIT_VERSION " (" __DATE__ ")"; +#else +const char* CxbxVersionStr = _GIT_VERSION "-Trace (" __DATE__ ")"; +#endif diff --git a/src/CxbxVersion.h b/src/CxbxVersion.h index 630fcd7b1..17983832b 100644 --- a/src/CxbxVersion.h +++ b/src/CxbxVersion.h @@ -1,10 +1,5 @@ #pragma once -#include "Version.h" +#include "version.h" -/*! version string dependent on trace flag */ -#ifndef _DEBUG_TRACE -#define _CXBX_VERSION _GIT_VERSION " (" __DATE__ ")" -#else -#define _CXBX_VERSION _GIT_VERSION "-Trace (" __DATE__ ")" -#endif \ No newline at end of file +extern const char* CxbxVersionStr; diff --git a/src/Common/CxbxDebugger.cpp b/src/common/CxbxDebugger.cpp similarity index 89% rename from src/Common/CxbxDebugger.cpp rename to src/common/CxbxDebugger.cpp index 76673a685..7719c2b55 100644 --- a/src/Common/CxbxDebugger.cpp +++ b/src/common/CxbxDebugger.cpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Common->CxbxDebugger.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,7 @@ // ****************************************************************** #include "Cxbx.h" -#include "CxbxKrnl/EmuShared.h" +#include "EmuShared.h" #include "CxbxDebugger.h" // Note this implementation uses SEH. See the reference docs for RaiseException: @@ -193,24 +184,24 @@ namespace CxbxDebugger Report.Send(); } - void ReportFileRead(HANDLE hFile, uint Size, u64 Offset) + void ReportFileRead(HANDLE hFile, unsigned int Size, uint64_t Offset) { Internal::ReportHelper Report(Internal::FILE_READ); Report.Add(hFile); Report.Add(Size); - Report.Add(static_cast(Offset)); + Report.Add(static_cast(Offset)); Report.Send(); } - void ReportFileWrite(HANDLE hFile, uint Size, u64 Offset) + void ReportFileWrite(HANDLE hFile, unsigned int Size, uint64_t Offset) { Internal::ReportHelper Report(Internal::FILE_WRITE); Report.Add(hFile); Report.Add(Size); - Report.Add(static_cast(Offset)); + Report.Add(static_cast(Offset)); Report.Send(); } diff --git a/src/Common/CxbxDebugger.h b/src/common/CxbxDebugger.h similarity index 78% rename from src/Common/CxbxDebugger.h rename to src/common/CxbxDebugger.h index 0fe349594..aca7f886c 100644 --- a/src/Common/CxbxDebugger.h +++ b/src/common/CxbxDebugger.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Common->CxbxDebugger.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -50,8 +41,8 @@ namespace CxbxDebugger void ReportKernelPatch(const char* ImportName, DWORD Address); void ReportFileOpened(HANDLE hFile, const wchar_t* Filename, bool Success); - void ReportFileRead(HANDLE hFile, uint Size, u64 Offset); - void ReportFileWrite(HANDLE hFile, uint Size, u64 Offset); + void ReportFileRead(HANDLE hFile, unsigned int Size, uint64_t Offset); + void ReportFileWrite(HANDLE hFile, unsigned int Size, uint64_t Offset); void ReportFileClosed(HANDLE hFile); // Exception helpers: diff --git a/src/Common/EmuEEPROM.cpp b/src/common/EmuEEPROM.cpp similarity index 80% rename from src/Common/EmuEEPROM.cpp rename to src/common/EmuEEPROM.cpp index d12b537cf..6dd2b33df 100644 --- a/src/Common/EmuEEPROM.cpp +++ b/src/common/EmuEEPROM.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Common->EmuEEPROM.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ +#define LOG_PREFIX CXBXR_MODULE::EEPR +#define LOG_PREFIX_INIT CXBXR_MODULE::INIT // prevent name collisions namespace xboxkrnl @@ -43,12 +35,12 @@ namespace xboxkrnl #include // For printf #include // For HANDLE, CreateFile, CreateFileMapping, MapViewOfFile +#include -#include "Cxbx.h" // For DbgPrintf #include "EmuEEPROM.h" // For EEPROMInfo, EEPROMInfos -#include "..\CxbxKrnl\Emu.h" // For EmuWarning +#include "core\kernel\support\Emu.h" // For EmuWarning #include "..\..\src\devices\LED.h" // For SetLEDSequence -#include "..\CxbxKrnl\CxbxKrnl.h" +#include "..\core\kernel\init\CxbxKrnl.h" xboxkrnl::XBOX_EEPROM *EEPROM = nullptr; // Set using CxbxRestoreEEPROM() @@ -64,7 +56,7 @@ const EEPROMInfo* EmuFindEEPROMInfo(xboxkrnl::XC_VALUE_INDEX index) return nullptr; } -// From http://xboxdevwiki.net/EEPROM +// From https://xboxdevwiki.net/EEPROM static void EepromCRC(unsigned char *crc, unsigned char *data, long dataLen) { unsigned char* CRC_Data = (unsigned char *)malloc(dataLen+4); int pos=0; @@ -128,7 +120,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) /* hTemplateFile */nullptr); if (hFileEEPROM == INVALID_HANDLE_VALUE) { - DbgPrintf("INIT: Couldn't create EEPROM.bin file!\n"); + EmuLogEx(LOG_PREFIX_INIT, LOG_LEVEL::DEBUG, "Couldn't create EEPROM.bin file!\n"); return nullptr; } } @@ -146,7 +138,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) /**/nullptr); if (hFileMappingEEPROM == NULL) { - DbgPrintf("INIT: Couldn't create EEPROM.bin file mapping!\n"); + EmuLogEx(LOG_PREFIX_INIT, LOG_LEVEL::DEBUG, "Couldn't create EEPROM.bin file mapping!\n"); return nullptr; } @@ -155,7 +147,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) unsigned int FileSize = len_li.u.LowPart; if (FileSize != 256) { - CxbxKrnlCleanup("CxbxRestoreEEPROM : EEPROM.bin file is not 256 bytes large!\n"); + CxbxKrnlCleanup("%s : EEPROM.bin file is not 256 bytes large!\n", __func__); return nullptr; } @@ -167,7 +159,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) /* dwFileOffsetLow */0, EEPROM_SIZE); if (pEEPROM == nullptr) { - DbgPrintf("INIT: Couldn't map EEPROM.bin into memory!\n"); + EmuLogEx(LOG_PREFIX_INIT, LOG_LEVEL::DEBUG, "Couldn't map EEPROM.bin into memory!\n"); return nullptr; } @@ -183,16 +175,16 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) // This must be done last to include all initialized data in the CRC gen_section_CRCs(pEEPROM); - DbgPrintf("INIT: Initialized default EEPROM\n"); + EmuLogEx(LOG_PREFIX_INIT, LOG_LEVEL::DEBUG, "Initialized default EEPROM\n"); } else { XboxFactoryGameRegion = pEEPROM->EncryptedSettings.GameRegion; - DbgPrintf("INIT: Loaded EEPROM.bin\n"); + EmuLogEx(LOG_PREFIX_INIT, LOG_LEVEL::DEBUG, "Loaded EEPROM.bin\n"); } // Read the HDD (and eventually also the online) keys stored in the eeprom file. Users can input them in the eeprom menu - memcpy(xboxkrnl::XboxHDKey, pEEPROM->EncryptedSettings.HDKey, xboxkrnl::XBOX_KEY_LENGTH); + memcpy(xboxkrnl::XboxHDKey, pEEPROM->EncryptedSettings.HDKey, xboxkrnl::XBOX_KEY_LENGTH); // Verify the checksum of the eeprom header UCHAR Checksum[20] = { 0 }; @@ -200,7 +192,7 @@ xboxkrnl::XBOX_EEPROM *CxbxRestoreEEPROM(char *szFilePath_EEPROM_bin) if (memcmp(Checksum, pEEPROM->EncryptedSettings.Checksum, 20)) { // The checksums do not match. Log this error and flash the LED (red, off, red, off) - EmuWarning("Stored and calculated checksums don't match. Possible eeprom corruption"); + EmuLog(LOG_LEVEL::WARNING, "Stored and calculated checksums don't match. Possible eeprom corruption"); SetLEDSequence(0xA0); } @@ -230,6 +222,34 @@ void EmuEEPROMReset(xboxkrnl::XBOX_EEPROM* eeprom) eeprom->UserSettings.ParentalControlMovies = XC_PC_MAX; // = XC_PRTL_CRTL_MAX eeprom->UserSettings.MiscFlags = 0; // No automatic power down - // TODO: Online Settings + // Online Settings + + // Setup the Serial and Mac Generators + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> serialDis (0, 9); + std::uniform_int_distribution<> macOnlineDis(0, 255); + + // Generate a random serial number + std::string serial = ""; + for (int i = 0; i < 12; i++) { + serial += std::to_string(serialDis(gen)); + } + memset(eeprom->FactorySettings.SerialNumber, 0, 12); + strncpy((char*)eeprom->FactorySettings.SerialNumber, serial.c_str(), 12); + + // Generate a random mac address + eeprom->FactorySettings.EthernetAddr[0] = 0x00; + eeprom->FactorySettings.EthernetAddr[1] = 0x50; + eeprom->FactorySettings.EthernetAddr[2] = 0xF2; + for (int i = 3; i < 6; i++) { + eeprom->FactorySettings.EthernetAddr[i] = macOnlineDis(gen); + } + + // Generate a random Online Key + for (int i = 0; i < 16; i++) { + eeprom->FactorySettings.OnlineKey[i] = macOnlineDis(gen); + } + // TODO: TimeZone Settings } diff --git a/src/Common/EmuEEPROM.h b/src/common/EmuEEPROM.h similarity index 92% rename from src/Common/EmuEEPROM.h rename to src/common/EmuEEPROM.h index 11c5d9b1e..6d46dfbda 100644 --- a/src/Common/EmuEEPROM.h +++ b/src/common/EmuEEPROM.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Common->EmuEEPROM.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -36,11 +27,13 @@ #ifndef EMU_EEPROM_H #define EMU_EEPROM_H -#if defined(__cplusplus) -#pragma once -extern "C" +// prevent name collisions +namespace xboxkrnl { -#endif +#undef _WIN32 // Compile-in REG_DWORD and friends, since we lack a include here +#include // For XC_VALUE_INDEX and XBOX_EEPROM +#define _WIN32 +}; #define EEPROM_SIZE sizeof(xboxkrnl::XBOX_EEPROM) @@ -54,7 +47,7 @@ typedef struct EEPROMInfo { #define XC_END_MARKER (xboxkrnl::XC_VALUE_INDEX)-1 #define EEPROM_INFO_ENTRY(XC, Member, REG_Type) \ - { xboxkrnl::##XC, offsetof(xboxkrnl::XBOX_EEPROM, Member), REG_Type, sizeof(((xboxkrnl::XBOX_EEPROM *)0)->Member) } + { xboxkrnl::XC, offsetof(xboxkrnl::XBOX_EEPROM, Member), REG_Type, sizeof(((xboxkrnl::XBOX_EEPROM *)0)->Member) } static const EEPROMInfo EEPROMInfos[] = { EEPROM_INFO_ENTRY(XC_TIMEZONE_BIAS, UserSettings.TimeZoneBias, REG_DWORD), @@ -164,8 +157,4 @@ extern void EmuEEPROMReset(xboxkrnl::XBOX_EEPROM* eeprom); void gen_section_CRCs(xboxkrnl::XBOX_EEPROM*); -#if defined(__cplusplus) -} -#endif - #endif // EMU_EEPROM_H diff --git a/src/Common/Error.cpp b/src/common/Error.cpp similarity index 81% rename from src/Common/Error.cpp rename to src/common/Error.cpp index a795139ca..2577c019e 100644 --- a/src/Common/Error.cpp +++ b/src/common/Error.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Error.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,7 +25,7 @@ // * // ****************************************************************** -#include "Common/Error.h" +#include "common\Error.h" const std::string& Error::GetError() { diff --git a/src/Common/Error.h b/src/common/Error.h similarity index 81% rename from src/Common/Error.h rename to src/common/Error.h index 428015ec2..440660aa6 100644 --- a/src/Common/Error.h +++ b/src/common/Error.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Error.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/CxbxKrnl/EmuXInput.h b/src/common/IPCHybrid.hpp similarity index 62% rename from src/CxbxKrnl/EmuXInput.h rename to src/common/IPCHybrid.hpp index 852d3d60b..5a249f228 100644 --- a/src/CxbxKrnl/EmuXInput.h +++ b/src/common/IPCHybrid.hpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXInput.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -26,25 +17,41 @@ // * If not, write to the Free Software Foundation, Inc., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * -// * (c) 2002-2003 Aaron Robinson +// * (c) 2018 RadWolfie // * // * All rights reserved // * // ****************************************************************** -#ifndef EMUXINPUT_H -#define EMUXINPUT_H +#ifndef IPC_HYBRID_HPP +#define IPC_HYBRID_HPP -//query the total connected xinput gamepad -DWORD XInputGamepad_Connected(void); +// NOTE: Keep in mind, IPC handling will be temporary until migrate kernel process into a thread. +// Plus using this method will allow support for cross-platform if proper virtualize emulation +// isn't there yet. // ****************************************************************** -// * patch: XInputPCPoll +// For kernel process use only // ****************************************************************** -void EmuXInputPCPoll( DWORD dwPort, XTL::PX_XINPUT_STATE Controller ); + +typedef enum class _IPC_UPDATE_GUI { + LLE_FLAGS = 0 + , XBOX_LED_COLOUR + , LOG_ENABLED + , KRNL_IS_READY +} IPC_UPDATE_GUI; + +void ipc_send_gui_update(IPC_UPDATE_GUI command, const unsigned int value); + // ****************************************************************** -// * Native implementation of XInputSetState +// For GUI process use only // ****************************************************************** -void EmuXInputSetState(DWORD dwPort, XTL::PX_XINPUT_FEEDBACK Feedback); + +typedef enum class _IPC_UPDATE_KERNEL { + CONFIG_LOGGING_SYNC = 0 + , CONFIG_INPUT_SYNC +} IPC_UPDATE_KERNEL; + +void ipc_send_kernel_update(IPC_UPDATE_KERNEL command, const unsigned int value, const unsigned int hwnd); #endif diff --git a/src/common/Logging.cpp b/src/common/Logging.cpp new file mode 100644 index 000000000..f0544762e --- /dev/null +++ b/src/common/Logging.cpp @@ -0,0 +1,391 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2016 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + +#include // for PULONG + +#include "Logging.h" +#include "common\Settings.hpp" +#include "EmuShared.h" + +// For thread_local, see : https://en.cppreference.com/w/cpp/language/storage_duration +// TODO : Use Boost.Format https://www.boost.org/doc/libs/1_53_0/libs/format/index.html +thread_local std::string _logThreadPrefix; + +std::atomic_bool g_EnabledModules[to_underlying(CXBXR_MODULE::MAX)] = { false }; +const char* g_EnumModules2String[to_underlying(CXBXR_MODULE::MAX)] = { + "CXBXR ", + "XBE ", + "INIT ", + "VMEM ", + "PMEM ", + "GUI ", + "EEPR ", + "RSA ", + "POOLMEM ", + "D3D8 ", + "D3DST ", + "D3DCVT ", + "DSOUND ", + "XAPI ", + "XACT ", + "XGRP ", + "XONLINE ", + "FS ", + "PSHB ", + "PXSH ", + "VTXSH ", + "VSHCACHE", + "VTXB ", + "DINP ", + "XINP ", + "SDL ", + "FILE ", + "X86 ", + "HLE ", + "NET ", + "MCPX ", + "NV2A ", + "SMC ", + "OHCI ", + "USB ", + "HUB ", + "XIDCTRL ", + "ADM ", + "INPSYS ", + "DSBUFFER", + "DSSTREAM", + "DS3DCALC", + "XMO ", + "KRNL ", + "LOG ", + "XBOX ", + "XBDM ", + "AV ", + "DBG ", + "EX ", + "FSC ", + "HAL ", + "IO ", + "KD ", + "KE ", + "KI ", + "MM ", + "NT ", + "OB ", + "PS ", + "RTL ", + "XC ", + "XE ", +}; +std::atomic_int g_CurrentLogLevel = to_underlying(LOG_LEVEL::INFO); + +const char log_debug[] = "DEBUG: "; +const char log_info[] = "INFO : "; +const char log_warn[] = "WARN : "; +const char log_error[] = "ERROR: "; +const char log_fatal[] = "FATAL: "; +const char log_unkwn[] = "???? : "; + +// Do not use EmuLogOutput function outside of this file. +void EmuLogOutput(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, va_list argp) +{ + LOG_THREAD_INIT; + + const char* level_str; + switch (level) { + default: + level_str = log_unkwn; + break; + case LOG_LEVEL::DEBUG: + level_str = log_debug; + break; + case LOG_LEVEL::INFO: + level_str = log_info; + break; + case LOG_LEVEL::WARNING: + level_str = log_warn; + break; + case LOG_LEVEL::ERROR2: + level_str = log_error; + break; + case LOG_LEVEL::FATAL: + level_str = log_fatal; + break; + } + + std::cout << _logThreadPrefix << level_str + << g_EnumModules2String[to_underlying(cxbxr_module)]; + + vfprintf(stdout, szWarningMessage, argp); + + fprintf(stdout, "\n"); + + fflush(stdout); +} + +// print out a custom message to the console or kernel debug log file +void NTAPI EmuLogEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...) +{ + if (szWarningMessage == NULL) { + return; + } + + LOG_CHECK_ENABLED_EX(cxbxr_module, level) { + if (g_bPrintfOn) { + + LOG_THREAD_INIT; + + va_list argp; + va_start(argp, szWarningMessage); + + EmuLogOutput(cxbxr_module, level, szWarningMessage, argp); + + va_end(argp); + } + } +} + +void NTAPI EmuLogInit(LOG_LEVEL level, const char *szWarningMessage, ...) +{ + if (szWarningMessage == NULL) { + return; + } + + va_list argp; + va_start(argp, szWarningMessage); + + EmuLogOutput(CXBXR_MODULE::INIT, level, szWarningMessage, argp); + + va_end(argp); +} + +// Set up the logging variables for the GUI process +inline void log_get_settings() +{ + log_set_config(g_Settings->m_core.LogLevel, g_Settings->m_core.LoggedModules); +} + +inline void log_sync_config() +{ + int LogLevel; + unsigned int LoggedModules[NUM_INTEGERS_LOG]; + g_EmuShared->GetLogLv(&LogLevel); + g_EmuShared->GetLogModules(LoggedModules); + log_set_config(LogLevel, LoggedModules); +} + +void log_set_config(int LogLevel, unsigned int* LoggedModules) +{ + g_CurrentLogLevel = LogLevel; + for (unsigned int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) { + if (LoggedModules[index / 32] & (1 << (index % 32))) { + g_EnabledModules[index] = true; + } + else { + g_EnabledModules[index] = false; + } + } +} + +// Generate active log filter output. +void log_generate_active_filter_output(const CXBXR_MODULE cxbxr_module) +{ + LOG_THREAD_INIT; + std::string generic_output_str = _logThreadPrefix + log_info + g_EnumModules2String[to_underlying(cxbxr_module)]; + + std::cout << generic_output_str << "Current log level: " << g_CurrentLogLevel << std::endl; + + generic_output_str.append("Active log filter: "); + for (unsigned int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) { + if (g_EnabledModules[index]) { + std::cout << generic_output_str << g_EnumModules2String[index] << "\n"; + } + } + std::cout << std::flush; +} + +const bool needs_escape(const wint_t _char) +{ + // Escaping is needed for control characters, + // for double quote, and for backslash : + return iswcntrl(_char) || (_char == '"') || (_char == '\\'); +} + +inline void output_char(std::ostream& os, char c) +{ + if (needs_escape((int)c)) + { + switch (c) + { + // Render escaped double quote as \", and escaped backslash as \\ : + case '"': os << "\\\""; break; + case '\\': os << "\\\\"; break; + // See https://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences + case '\a': os << "\\t"; break; + case '\b': os << "\\b"; break; + case '\f': os << "\\f"; break; + case '\n': os << "\\n"; break; + case '\r': os << "\\r"; break; + case '\t': os << "\\t"; break; + case '\v': os << "\\v"; break; + // All other to-escape-characters are rendered as hexadecimal : + default: os << "\\x" << std::setfill('0') << std::setw(2) << std::right << std::hex << std::uppercase << (int)c; + } + } + else + os << c; +} + +inline void output_wchar(std::ostream& os, wchar_t c) +{ + if (needs_escape((wint_t)c)) + { + switch (c) + { + // Render escaped double quote as \", and escaped backslash as \\ : + case '"': os << "\\\""; break; + case '\\': os << "\\\\"; break; + // See https://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences + case '\a': os << "\\t"; break; + case '\b': os << "\\b"; break; + case '\f': os << "\\f"; break; + case '\n': os << "\\n"; break; + case '\r': os << "\\r"; break; + case '\t': os << "\\t"; break; + case '\v': os << "\\v"; break; + // All other to-escape-characters are rendered as hexadecimal : + default: os << "\\x" << std::setfill('0') << std::setw(4) << std::right << std::hex << std::uppercase << (wint_t)c; + } + } + else + os << c; +} + +LOG_SANITIZE_HEADER(hex1, uint8_t) +{ + return os << hexstring8 << (int)container.value; +} + +LOG_SANITIZE_HEADER(hex2, uint16_t) +{ + return os << hexstring16 << (int)container.value; +} + +LOG_SANITIZE_HEADER(hex4, uint32_t) +{ + return os << hexstring32 << (int)container.value; +} + +LOG_SANITIZE_HEADER(sanitized_char, char) +{ + output_char(os, container.value); + return os; +} + +LOG_SANITIZE_HEADER(sanitized_wchar, wchar_t) +{ + output_wchar(os, container.value); + return os; +} + +LOG_SANITIZE_HEADER(sanitized_char_pointer, char *) +{ + char *v = container.value; + + os << "(char *)"; + if (v == nullptr) + return os << "NULL"; + + bool needsEscaping = false; + int max_length = container.max; + while (*v && max_length--) + if (needs_escape(*v++)) + { + needsEscaping = true; + break; + } + + v = container.value; + os << hexstring32 << (uint32_t)v << " = \""; + max_length = container.max; + if (needsEscaping) + { + while (*v && max_length--) + output_char(os, *v++); + } + else { + while (*v && max_length--) { + os << *v++; + } + } + + return os << "\""; +} + +LOG_SANITIZE_HEADER(sanitized_wchar_pointer, wchar_t *) +{ + wchar_t *v = container.value; + + os << "(wchar *)"; + if (v == nullptr) + return os << "NULL"; + + bool needsEscaping = false; + int max_length = container.max; + while (*v && max_length--) + if (needs_escape(*v++)) + { + needsEscaping = true; + break; + } + + v = container.value; + os << hexstring32 << (uint32_t)v << " = \""; + max_length = container.max; + if (needsEscaping) + { + while (*v && max_length--) + output_wchar(os, *v++); + } + else +#if 0 + os << v; // TODO : FIXME - VS2015 doesn''t render this string (instead, it shows a hexadecimal memory address) +#else // For now, render unicode as ANSI (replacing non-printables with '?') + { + while (*v && max_length--) { + output_char(os, *v <= 0xFF ? (char)*v : '?'); + v++; + } + } +#endif + return os << "\""; +} + +LOGRENDER_HEADER_BY_REF(PVOID) +{ + return os << hex4((uint32_t)value); +} diff --git a/src/Common/Logging.h b/src/common/Logging.h similarity index 61% rename from src/Common/Logging.h rename to src/common/Logging.h index 5f5e7bff3..471c1892b 100644 --- a/src/Common/Logging.h +++ b/src/common/Logging.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Logging.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -26,7 +17,8 @@ // * If not, write to the Free Software Foundation, Inc., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * -// * (c) 2016 Patrick van Logchem +// * (c) 2016 Patrick van Logchem +// * (c) 2019 ergo720 // * // * All rights reserved // * @@ -34,20 +26,116 @@ #ifndef _LOGGING_H #define _LOGGING_H -#pragma once - #include // For DWORD #include // For std::stringstream #include // For std::cout -#include // For std::setw -#include "Cxbx.h" // For g_bPrintfOn +#include // For std::setw +#include // For atomic_bool and atomic_uint +#include "common\util\CxbxUtil.h" // For g_bPrintfOn and to_underlying + +// NOTE: using ERROR2 since windows.h imports an ERROR macro which would conflict otherwise +typedef enum class _LOG_LEVEL { + DEBUG = 0, + INFO, + WARNING, + ERROR2, + FATAL, + MAX, +}LOG_LEVEL; +typedef enum class _CXBXR_MODULE: unsigned int { + // general + CXBXR = 0, + XBE, + INIT, + VMEM, + PMEM, + GUI, + EEPR, + RSA, + POOLMEM, + D3D8, + D3DST, + D3DCVT, + DSOUND, + XAPI, + XACT, + XGRP, + XONLINE, + FS, + PSHB, + PXSH, + VTXSH, + VSHCACHE, + VTXB, + DINP, + XINP, + SDL, + FILE, + X86, + HLE, + NET, + MCPX, + NV2A, + SMC, + OHCI, + USB, + HUB, + XIDCTRL, + ADM, + INPSYS, + DSBUFFER, + DSSTREAM, + DS3DCALC, + XMO, + // kernel + KRNL, + LOG, + XBOX, + XBDM, + AV, + DBG, + EX, + FSC, + HAL, + IO, + KD, + KE, + KI, + MM, + NT, + OB, + PS, + RTL, + XC, + XE, + // max + MAX, +}CXBXR_MODULE; + +extern std::atomic_bool g_EnabledModules[to_underlying(CXBXR_MODULE::MAX)]; +extern const char* g_EnumModules2String[to_underlying(CXBXR_MODULE::MAX)]; +extern std::atomic_int g_CurrentLogLevel; + +// print out a log message to the console or kernel debug log file if level is high enough +void NTAPI EmuLogEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...); +void NTAPI EmuLogInit(LOG_LEVEL level, const char *szWarningMessage, ...); + +#define EmuLog(level, fmt, ...) EmuLogEx(LOG_PREFIX, level, fmt, ##__VA_ARGS__) + +extern inline void log_get_settings(); + +extern inline void log_sync_config(); + +void log_set_config(int LogLevel, unsigned int* LoggedModules); + +void log_generate_active_filter_output(const CXBXR_MODULE cxbxr_module); // // __FILENAME__ // -// From http://stackoverflow.com/questions/31050113/how-to-extract-the-source-filename-without-path-and-suffix-at-compile-time +// From https://stackoverflow.com/questions/31050113/how-to-extract-the-source-filename-without-path-and-suffix-at-compile-time constexpr const char* str_end(const char *str) { return *str ? str_end(str + 1) : str; } @@ -82,47 +170,47 @@ extern inline void output_wchar(std::ostream& os, wchar_t c); // By default, sanitization functions simply return the given argument // (type and value) which results in calls to standard output writers. template -inline T _log_sanitize(T value) +inline T _log_sanitize(T value, int ignored_length = 0) { return value; } #if 0 // TODO FIXME : Disabled for now, as this is incorrectly called for INT types too // Convert booleans to strings properly -inline const char * _log_sanitize(BOOL value) +inline const char * _log_sanitize(BOOL value, int ignored_length = 0) { return value ? "TRUE" : "FALSE"; } #endif // Macro to ease declaring a _log_sanitize overload (invokeable via C) for type T -#define LOG_SANITIZE_HEADER(C, T) \ -std::ostream& operator<<( \ - std::ostream& os, \ - const Sane##C& container) \ - -#define LOG_SANITIZE(C, T) \ -struct Sane##C \ -{ \ - T value; \ - Sane##C(T _value) : value(_value) { } \ -}; \ - \ -inline Sane##C C(T value) \ -{ \ - return Sane##C(value); \ -} \ - \ -inline Sane##C _log_sanitize(T value) \ -{ \ - return C(value); \ -} \ - \ -extern LOG_SANITIZE_HEADER(C, T) \ +#define LOG_SANITIZE_HEADER(C, T) \ +std::ostream& operator<<( \ + std::ostream& os, \ + const Sane##C& container) \ +#define LOG_SANITIZE(C, T) \ +struct Sane##C \ +{ \ + T value; \ + int max; \ + Sane##C(T _v, int _m = 80) : value(_v), max(_m) { } \ +}; \ + \ +inline Sane##C C(T value, int max = 80) \ +{ \ + return Sane##C(value, max); \ +} \ + \ +inline Sane##C _log_sanitize(T value, int max = 80) \ +{ \ + return C(value, max); \ +} \ + \ +extern LOG_SANITIZE_HEADER(C, T) \ // Hex output (type safe) -// http://stackoverflow.com/questions/673240/how-do-i-print-an-unsigned-char-as-hex-in-c-using-ostream +// https://stackoverflow.com/questions/673240/how-do-i-print-an-unsigned-char-as-hex-in-c-using-ostream LOG_SANITIZE(hex1, uint8_t); LOG_SANITIZE(hex2, uint16_t); LOG_SANITIZE(hex4, uint32_t); @@ -167,9 +255,17 @@ constexpr const char* remove_emupatch_prefix(const char* str) { #define LOG_PREFIX __FILENAME__ #endif // LOG_PREFIX -// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration -// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html +// For thread_local, see : https://en.cppreference.com/w/cpp/language/storage_duration +// TODO : Use Boost.Format https://www.boost.org/doc/libs/1_53_0/libs/format/index.html extern thread_local std::string _logThreadPrefix; + +// Checks if this log should be printed or not +#define LOG_CHECK_ENABLED_EX(cxbxr_module, level) \ + if (g_EnabledModules[to_underlying(cxbxr_module)] && to_underlying(level) >= g_CurrentLogLevel) + +// Checks if this log should be printed or not +#define LOG_CHECK_ENABLED(level) \ + LOG_CHECK_ENABLED_EX(LOG_PREFIX, level) #define LOG_THREAD_INIT \ if (_logThreadPrefix.length() == 0) { \ @@ -182,12 +278,10 @@ extern thread_local std::string _logThreadPrefix; static thread_local std::string _logFuncPrefix; \ if (_logFuncPrefix.length() == 0) { \ std::stringstream tmp; \ - tmp << LOG_PREFIX << ": " << (func != nullptr ? remove_emupatch_prefix(func) : ""); \ + tmp << g_EnumModules2String[to_underlying(LOG_PREFIX)] << (func != nullptr ? remove_emupatch_prefix(func) : ""); \ _logFuncPrefix = tmp.str(); \ } -#ifdef _DEBUG_TRACE - #define LOG_INIT \ LOG_THREAD_INIT \ LOG_FUNC_INIT(__func__) @@ -202,8 +296,9 @@ extern thread_local std::string _logThreadPrefix; msg << _logThreadPrefix << _logFuncPrefix << "("; #define LOG_FUNC_BEGIN \ - LOG_INIT \ - LOG_FUNC_BEGIN_NO_INIT + LOG_INIT \ + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { \ + LOG_FUNC_BEGIN_NO_INIT // LOG_FUNC_ARG writes output via all available ostream << operator overloads, sanitizing and adding detail where possible #define LOG_FUNC_ARG(arg) \ @@ -222,10 +317,11 @@ extern thread_local std::string _logThreadPrefix; // LOG_FUNC_END closes off function and optional argument logging #define LOG_FUNC_END \ - if (_had_arg) msg << "\n"; \ - msg << ");\n"; \ - std::cout << msg.str(); \ - } } while (0) + if (_had_arg) msg << "\n"; \ + msg << ");\n"; \ + std::cout << msg.str(); \ + } } while (0); \ + } // LOG_FUNC_RESULT logs the function return result #define LOG_FUNC_RESULT(r) \ @@ -237,75 +333,68 @@ extern thread_local std::string _logThreadPrefix; // LOG_FORWARD indicates that an api is implemented by a forward to another API #define LOG_FORWARD(api) \ - LOG_INIT \ - do { if(g_bPrintfOn) { \ - std::cout << _logThreadPrefix << _logFuncPrefix << " forwarding to "#api"...\n"; \ - } } while (0) - -#else // _DEBUG_TRACE - -#define LOG_FINIT -#define LOG_INIT -#define LOG_FUNC_BEGIN_NO_INIT -#define LOG_FUNC_BEGIN -#define LOG_FUNC_ARG(arg) -#define LOG_FUNC_ARG_TYPE(type, arg) -#define LOG_FUNC_ARG_OUT(arg) -#define LOG_FUNC_END -#define LOG_FUNC_RESULT(r) -#define LOG_FUNC_RESULT_TYPE(type, r) -#define LOG_FORWARD(arg) - -#endif // _DEBUG_TRACE + LOG_INIT \ + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { \ + do { if(g_bPrintfOn) { \ + std::cout << _logThreadPrefix << _logFuncPrefix << " forwarding to "#api"...\n"; \ + } } while (0); \ + } // LOG_IGNORED indicates that Cxbx consiously ignores an api #define LOG_IGNORED() \ do { \ static bool b_echoOnce = true; \ - if(g_bPrintfOn && b_echoOnce) { \ - LOG_THREAD_INIT \ - LOG_FUNC_INIT(__func__) \ - std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " ignored!\n"; \ - b_echoOnce = false; \ - } \ - } while(0) + if(g_bPrintfOn && b_echoOnce) { \ + LOG_CHECK_ENABLED(LOG_LEVEL::INFO) { \ + LOG_THREAD_INIT \ + LOG_FUNC_INIT(__func__) \ + std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " ignored!\n"; \ + b_echoOnce = false; \ + } \ + } \ + } while(0) // LOG_UNIMPLEMENTED indicates that Cxbx is missing an implementation of an api #define LOG_UNIMPLEMENTED() \ do { \ static bool b_echoOnce = true; \ - if(g_bPrintfOn && b_echoOnce) { \ - LOG_THREAD_INIT \ - LOG_FUNC_INIT(__func__) \ - std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " unimplemented!\n"; \ - b_echoOnce = false; \ - } \ - } while(0) + if(g_bPrintfOn && b_echoOnce) { \ + LOG_CHECK_ENABLED(LOG_LEVEL::INFO) { \ + LOG_THREAD_INIT \ + LOG_FUNC_INIT(__func__) \ + std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " unimplemented!\n"; \ + b_echoOnce = false; \ + } \ + } \ + } while(0) // LOG_INCOMPLETE indicates that Cxbx is missing part of an implementation of an api #define LOG_INCOMPLETE() \ do { \ static bool b_echoOnce = true; \ - if(g_bPrintfOn && b_echoOnce) { \ - LOG_THREAD_INIT \ - LOG_FUNC_INIT(__func__) \ - std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " incomplete!\n"; \ - b_echoOnce = false; \ - } \ - } while(0) + if(g_bPrintfOn && b_echoOnce) { \ + LOG_CHECK_ENABLED(LOG_LEVEL::INFO) { \ + LOG_THREAD_INIT \ + LOG_FUNC_INIT(__func__) \ + std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " incomplete!\n"; \ + b_echoOnce = false; \ + } \ + } \ + } while(0) // LOG_NOT_SUPPORTED indicates that Cxbx cannot implement (part of) an api #define LOG_NOT_SUPPORTED() \ do { \ static bool b_echoOnce = true; \ - if(g_bPrintfOn && b_echoOnce) { \ - LOG_THREAD_INIT \ - LOG_FUNC_INIT(__func__) \ - std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " not supported!\n"; \ - b_echoOnce = false; \ - } \ - } while(0) - + if(g_bPrintfOn && b_echoOnce) { \ + LOG_CHECK_ENABLED(LOG_LEVEL::INFO) { \ + LOG_THREAD_INIT \ + LOG_FUNC_INIT(__func__) \ + std::cout << _logThreadPrefix << "WARN: " << _logFuncPrefix << " not supported!\n"; \ + b_echoOnce = false; \ + } \ + } \ + } while(0) // // Short hand function logging defines : @@ -324,15 +413,10 @@ extern thread_local std::string _logThreadPrefix; #define LOG_FUNC_ONE_ARG_OUT(arg) LOG_FUNC_BEGIN LOG_FUNC_ARG_OUT(arg) LOG_FUNC_END // RETURN logs the given result and then returns it (so this should appear last in functions) -#define RETURN(r) do { LOG_FUNC_RESULT(r) return r; } while (0) +#define RETURN(r) do { if (g_bPrintfOn) LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { LOG_FUNC_RESULT(r) } return r; } while (0) // RETURN_TYPE logs the given typed result and then returns it (so this should appear last in functions) -#define RETURN_TYPE(type, r) do { LOG_FUNC_RESULT_TYPE(type, r) return r; } while (0) - -#define LOG_ONCE(msg, ...) { static bool bFirstTime = true; if(bFirstTime) { bFirstTime = false; DbgPrintf("TRAC: " ## msg, __VA_ARGS__); } } - -#define LOG_XBOX_CALL(func) DbgPrintf("TRAC: Xbox " ## func ## "() call\n"); -#define LOG_FIRST_XBOX_CALL(func) LOG_ONCE("First Xbox " ## func ## "() call\n"); +#define RETURN_TYPE(type, r) do { if (g_bPrintfOn) LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { LOG_FUNC_RESULT_TYPE(type, r) } return r; } while (0) // // Headers for rendering enums, flags and (pointer-to-)types : @@ -353,30 +437,47 @@ extern thread_local std::string _logThreadPrefix; #define ENUM2STR_HEADER(EnumType) extern TYPE2PCHAR_HEADER(EnumType); LOGRENDER_HEADER_BY_REF(EnumType); #define ENUM2STR_START(EnumType) TYPE2PCHAR_HEADER(EnumType) { switch (value) { #define ENUM2STR_CASE(a) case a: return #a; -// ENUM2STR_CASE_DEF is needed for #define'd symbols -#define ENUM2STR_CASE_DEF(a) case a: return #a; #define ENUM2STR_END(EnumType) default: return "Unknown_"#EnumType; } } #define ENUM2STR_END_and_LOGRENDER(EnumType) ENUM2STR_END(EnumType) LOGRENDER_TYPE(EnumType) // Macro's for Flags-ToString conversions : #define FLAGS2STR_HEADER(FlagType) LOGRENDER_HEADER_BY_REF(FlagType); #define FLAGS2STR_START(FlagType) std::string TYPE2PCHAR(FlagType)(const FlagType &value) { std::stringstream ss; -#define FLAG2STR(f) if (((uint32)value & f) == f) ss << #f << "|"; +#define FLAG2STR(f) if (((uint32_t)value & f) == f) ss << #f << "|"; #define FLAG2STR_MASK(f) ss << #f"=" << (value & f) << "|"; #define FLAGS2STR_END std::string res = ss.str(); if (!res.empty()) res.pop_back(); return res; } #define FLAGS2STR_END_and_LOGRENDER(FlagType) FLAGS2STR_END LOGRENDER_TYPE(FlagType) // Macro's for Struct-member rendering : +#define LOGRENDER_MEMBER_ARRAY_OFFSET(Name, Offset) << LOG_ARG_START << (Name) << "[" << (Offset) << "]: {" #define LOGRENDER_MEMBER_NAME_VALUE(Name, Value) << LOG_ARG_START << (Name) << " : " << (Value) +#define LOGRENDER_MEMBER_NAME_TYPE_PTR(Name, Type, Value) << LOG_ARG_START << (Name) << " : " << hex4((uint32_t)Value) << " -> " << (Type) << "* {" #define LOGRENDER_MEMBER_NAME_TYPE_VALUE(Name, Type, Value) << LOG_ARG_START << (Name) << " : " << (Type)(Value) #define LOGRENDER_MEMBER_NAME(Member) << LOG_ARG_START << "."#Member << " : " #define LOGRENDER_MEMBER(Member) LOGRENDER_MEMBER_NAME_VALUE("."#Member, value.Member) #define LOGRENDER_MEMBER_TYPE(Type, Member) LOGRENDER_MEMBER_NAME(Member) << (Type)value.Member -#define LOGRENDER_MEMBER_SANITIZED(Member, MemberType) LOGRENDER_MEMBER_NAME(Member) << _log_sanitize((MemberType)value.Member) +#define LOGRENDER_MEMBER_SANITIZED(Member, MemberType, Length) LOGRENDER_MEMBER_NAME(Member) << _log_sanitize((MemberType)value.Member, Length) // Macro to ease declaration of two render functions, for type and pointer-to-type : #define LOGRENDER_HEADER(Type) LOGRENDER_HEADER_BY_PTR(Type); LOGRENDER_HEADER_BY_REF(Type); +// Macro's for dynamic array structure rendering : +template +static std::string +LogRenderGenerate_Array(std::string MemberStr, A MemberValue, B Count) { + B counter = 0; + std::ostringstream strGenerator; + while (counter < Count) { + strGenerator LOGRENDER_MEMBER_ARRAY_OFFSET(MemberStr, counter) + << *MemberValue << "}"; + MemberValue++; + counter++; + } + strGenerator << "}"; + return strGenerator.str(); +} +#define LOGRENDER_MEMBER_ARRAY_TYPE(Type, Member, Count) LOGRENDER_MEMBER_NAME_TYPE_PTR("."#Member, #Type, value.Member) << LogRenderGenerate_Array("."#Member, (Type*)value.Member, value.Count) + // Traits to switch ostreams to our preferred rendering of hexadecimal values template std::basic_ostream<_CharT, _Traits>& @@ -404,7 +505,7 @@ hexstring32(std::basic_ostream<_CharT, _Traits>&os) #define LOGRENDER(Type) \ LOGRENDER_HEADER_BY_PTR(Type) \ { \ - os << hexstring32 << (void*)(value); \ + os << hexstring32 << reinterpret_cast(value); \ if (value) \ os << " -> "#Type"* {" << *value << "}"; \ \ @@ -417,6 +518,6 @@ LOGRENDER_HEADER_BY_REF(Type) \ // An example type rendering, for PVOID // -LOGRENDER_HEADER_BY_REF(PVOID); +LOGRENDER_HEADER_BY_REF(PVOID); #endif _LOGGING_H diff --git a/src/Common/ReservedMemory.h b/src/common/ReservedMemory.h similarity index 79% rename from src/Common/ReservedMemory.h rename to src/common/ReservedMemory.h index c84abc4df..4d5f0287b 100644 --- a/src/Common/ReservedMemory.h +++ b/src/common/ReservedMemory.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Common->ReservedMemory.h -// * // * This file is part of the Cxbx project. // * // * Cxbx is free software; you can redistribute it @@ -35,12 +26,11 @@ #define RESERVEDMEMORY_H #if defined(__cplusplus) -#pragma once extern "C" { #endif -#include "CxbxKrnl/EmuShared.h" // For XBE_MAX_VA, XBE_IMAGE_BASE and CXBX_BASE_OF_CODE +#include "EmuShared.h" // For XBE_MAX_VA, XBE_IMAGE_BASE and CXBX_BASE_OF_CODE // The following code reserves virtual addresses from 0x00011000 upwards; #define VM_PLACEHOLDER_SIZE (XBE_MAX_VA - XBE_IMAGE_BASE - CXBX_BASE_OF_CODE) @@ -60,4 +50,4 @@ unsigned char virtual_memory_placeholder[VM_PLACEHOLDER_SIZE]; // = { OPCODE_NOP } #endif -#endif // RESERVEDMEMORY_H \ No newline at end of file +#endif // RESERVEDMEMORY_H diff --git a/src/common/Settings.cpp b/src/common/Settings.cpp new file mode 100644 index 000000000..c759aa774 --- /dev/null +++ b/src/common/Settings.cpp @@ -0,0 +1,836 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 wutno (#/g/punk - Rizon) +// * (c) 2018 RadWolfie +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "Settings.hpp" +#include "core\kernel\support\Emu.h" +#include "EmuShared.h" +#include +#include "common\input\InputManager.h" +#include "common\input\layout_xbox_controller.h" + +// TODO: Implement Qt support when real CPU emulation is available. +#ifndef QT_VERSION // NOTE: Non-Qt will be using current directory for data +#include // For SHGetSpecialFolderPath and CSIDL_APPDATA +#else +static_assert(false, "Please implement support for cross-platform's user profile data."); + +#include // for create directory +#include // for check file existance +#include // for cross-platform's user profile support +#endif + +std::string g_exec_filepath; + +// Individual library version +uint16_t g_LibVersion_D3D8 = 0; +uint16_t g_LibVersion_DSOUND = 0; + +// NOTE: Update settings_version when add/edit/delete setting's structure. +/////////////////////////// +// * History: +// * 2: (RadWolfie), initial version +// * 3: (ergo720), added logging settings +// * 4: (LukeUsher), added network settings +// * 5: (ergo720), added new input gui settings and revision to core +/////////////////////////// +const unsigned int settings_version = 5; + +Settings* g_Settings = nullptr; + +#define szSettings_setup_error "ERROR: Either setup have a problem or do not have write permission to directory." +#define szSettings_init_error "ERROR: Unable to initialize Settings class." +#define szSettings_save_user_option_message "Use Cxbx-Reloaded in Portable Mode?" \ + "\n\nClicking 'Yes' will save your setting in the current directory, rather than your User Profile." + +#define szSettings_settings_file "/settings.ini" +#define szSettings_cxbx_reloaded_directory "/Cxbx-Reloaded" + +static const char* section_gui = "gui"; +static struct { + const char* CxbxDebugMode = "CxbxDebugMode"; + const char* CxbxDebugLogFile = "CxbxDebugLogFile"; + const char* RecentXbeFiles = "RecentXbeFiles"; + const char* DataStorageToggle = "DataStorageToggle"; + const char* DataCustomLocation = "DataCustomLocation"; +} sect_gui_keys; + +static const char* section_core = "core"; +static struct { + const char* Revision = "Revision"; + const char* FlagsLLE = "FlagsLLE"; + const char* KrnlDebugMode = "KrnlDebugMode"; + const char* KrnlDebugLogFile = "KrnlDebugLogFile"; + const char* AllowAdminPrivilege = "AllowAdminPrivilege"; + const char* LoggedModules = "LoggedModules"; + const char* LogLevel = "LogLevel"; +} sect_core_keys; + +static const char* section_video = "video"; +static struct { + const char* VideoResolution = "VideoResolution"; + const char* adapter = "adapter"; + const char* Direct3DDevice = "Direct3DDevice"; + const char* VSync = "VSync"; + const char* FullScreen = "FullScreen"; + const char* HardwareYUV = "HardwareYUV"; + const char* RenderResolution = "RenderResolution"; +} sect_video_keys; + +static const char* section_audio = "audio"; +static struct { + const char* adapter = "adapter"; + const char* adapter_value = "%08X %04X %04X %02X%02X %02X%02X%02X%02X%02X%02X"; + const char* codec_pcm = "PCM"; + const char* codec_xadpcm = "XADPCM"; + const char* codec_unknown = "UnknownCodec"; + const char* mute_on_unfocus = "MuteOnUnfocus"; +} sect_audio_keys; + +static const char* section_network = "network"; +static struct { + const char* adapter_name = "adapter_name"; +} sect_network_keys; + +static const char* section_controller_dinput = "controller-dinput"; +static const char* section_controller_port = "controller-port"; + +static const char* section_input = "input-port-"; +static struct { + const char* type = "Type"; + const char* device = "DeviceName"; + const char* config = "ProfileName"; +} sect_input; + +static const char* section_input_profiles = "input-profile-"; +static struct { + const char* type = "Type"; + const char* config = "ProfileName"; + const char* device = "DeviceName"; + const char* control = "%s"; +} sect_input_profiles; + +static const char* section_hack = "hack"; +static struct { + const char* DisablePixelShaders = "DisablePixelShaders"; + const char* UseAllCores = "UseAllCores"; + const char* SkipRdtscPatching = "SkipRdtscPatching"; +} sect_hack_keys; + +std::string GenerateExecDirectoryStr() +{ + return g_exec_filepath.substr(0, g_exec_filepath.find_last_of("\\/")); +} + +// NOTE: This function will be only have Qt support, std::filesystem doesn't have generic support. +// Plus appending support for each OSes are not worthy to work on. +std::string GenerateUserProfileDirectoryStr() +{ + // ======================================================== + // TODO: Use QT's QDir and QFile classes for cross-platform + // with QStandardPaths::GenericDataLocation for generic User Profile location. + // NOTE: LibRetro compile build will not have user profile option support. + // ======================================================== + char folderOption[MAX_PATH]; + std::string genDirectory; + // TODO: Use QDir and QStandardPaths::GenericDataLocation for get user profile directory to support cross-platform + BOOL bRet = SHGetSpecialFolderPathA(NULL, folderOption, CSIDL_APPDATA, TRUE); // NOTE: Windows only support + if (!bRet) { + return ""; + } + genDirectory = folderOption; + genDirectory.append(szSettings_cxbx_reloaded_directory); + + return genDirectory; +} + +std::string TrimQuoteFromString(const char* data) +{ + // Safeguard before continue on. + if (data == nullptr) { + return ""; + } + + std::string trim_str = data; + size_t len = trim_str.size(); + if (len > 0) { + // New method, in order to support spaces inside DeviceName value. + if (data[0] == '"') { + len--; // Let's decrement since it also can act as offset too. + if (trim_str.at(len) == '"') { + len--; + } + trim_str = trim_str.substr(1, len); + } + // Old method, don't do anything special. + } + return trim_str; +} + +#define AppendQuoteToString(d) "\"" + std::string(d) + "\"" + +bool Settings::Init() +{ + m_si.SetMultiKey(true); + + bool bRet = LoadUserConfig(); + + // Enter setup installer process + if (!bRet) { + + std::string saveFile; +#ifdef RETRO_API_VERSION // TODO: Change me to #ifndef QT_VERSION + // Can only have one option without Qt. + saveFile = GenerateExecDirectoryStr(); + +#else // Only support for Qt compile build. + int iRet = MessageBox(nullptr, szSettings_save_user_option_message, "Cxbx-Reloaded", MB_YESNOCANCEL | MB_ICONQUESTION); + + if (iRet == IDYES) { + saveFile = GenerateExecDirectoryStr(); + m_gui.DataStorageToggle = CXBX_DATA_EXECDIR; + } + else if (iRet == IDNO){ + saveFile = GenerateUserProfileDirectoryStr(); + m_gui.DataStorageToggle = CXBX_DATA_APPDATA; + if (saveFile.size() == 0) { + return false; + } + + // Check if data directory exists. + bRet = std::filesystem::exists(saveFile); + if (!bRet) { + // Then try create data directory. + bRet = std::filesystem::create_directory(saveFile); + if (!bRet) { + // Unable to create a data directory + return false; + } + } + } + else { + return false; + } +#endif + saveFile.append(szSettings_settings_file); + + // Call LoadConfig, this will load the config, applying defaults for any missing fields + bRet = LoadConfig(); + + if (!bRet) { + MessageBox(nullptr, szSettings_setup_error, "Cxbx-Reloaded", MB_OK); + return false; + } + + bRet = Save(saveFile); + } + return bRet; +} + +bool Settings::LoadUserConfig() +{ + std::string fileSearch = GenerateExecDirectoryStr(); + + fileSearch.append(szSettings_settings_file); + + // Check and see if file exists from portable, current, directory. + if (std::filesystem::exists(fileSearch) == false) { + + fileSearch = GenerateUserProfileDirectoryStr(); + if (fileSearch.size() == 0) { + return false; + } + fileSearch.append(szSettings_settings_file); + + // Check if the user profile directory settings file exists. + if (std::filesystem::exists(fileSearch) == false) { + return false; + } + } + + return LoadFile(fileSearch); +} + +bool Settings::LoadFile(std::string file_path) +{ + std::list si_list; + std::list::iterator si_list_iterator; + + SI_Error siError = m_si.LoadFile(file_path.c_str()); + + if (siError != SI_OK) { + return false; + } + m_file_path = file_path; + + return LoadConfig(); +} + +bool Settings::LoadConfig() +{ + bool bRet; + const char* si_data; + int iStatus; + std::list si_list; + std::list::iterator si_list_iterator; + std::string trim_str; + + // ==== GUI Begin =========== + + m_gui.CxbxDebugMode = (DebugMode)m_si.GetLongValue(section_gui, sect_gui_keys.CxbxDebugMode, /*Default=*/DM_NONE); + si_data = m_si.GetValue(section_gui, sect_gui_keys.CxbxDebugLogFile, /*Default=*/nullptr); + // Fallback to null string if value is empty or contain bigger string. + if (si_data == nullptr || std::strlen(si_data) >= MAX_PATH) { + m_gui.szCxbxDebugFile = ""; + } + else { + m_gui.szCxbxDebugFile = si_data; + } + + m_gui.DataStorageToggle = m_si.GetLongValue(section_gui, sect_gui_keys.DataStorageToggle, /*Default=*/m_gui.DataStorageToggle); + si_data = m_si.GetValue(section_gui, sect_gui_keys.DataCustomLocation, /*Default=*/nullptr); + // Fallback to null string if value is empty or contains a bigger string. + if (si_data == nullptr || std::strlen(si_data) >= MAX_PATH) { + m_gui.szCustomLocation = ""; + } + else { + m_gui.szCustomLocation = si_data; + } + + // GUI - Recent xbe file paths + unsigned int index = 0; + unsigned int list_max = std::size(m_gui.szRecentXbeFiles); + bRet = m_si.GetAllValues(section_gui, sect_gui_keys.RecentXbeFiles, si_list);/*Default=empty list*/ + if (bRet) { + si_list_iterator = si_list.begin(); + for (si_list_iterator; si_list_iterator != si_list.end(); si_list_iterator++) { + // Exit loop when the list has reached the limit. + if (index == list_max) { + break; + } + // Do not accept any file path greater or equal to MAX_PATH + if (std::strlen(si_list_iterator->pItem) >= MAX_PATH) { + continue; + } + m_gui.szRecentXbeFiles[index] = si_list_iterator->pItem; + index++; + } + } + // Set all or remaining recent xbe file paths to null string + while (index < list_max) { + m_gui.szRecentXbeFiles[index] = ""; + index++; + } + + // ==== GUI End ============= + + // ==== Core Begin ========== + + m_core.Revision = m_si.GetLongValue(section_core, sect_core_keys.Revision, 4); + m_core.FlagsLLE = m_si.GetLongValue(section_core, sect_core_keys.FlagsLLE, /*Default=*/LLE_NONE); + m_core.KrnlDebugMode = (DebugMode)m_si.GetLongValue(section_core, sect_core_keys.KrnlDebugMode, /*Default=*/DM_NONE); + si_data = m_si.GetValue(section_core, sect_core_keys.KrnlDebugLogFile, /*Default=*/nullptr); + // Fallback to null string if value is empty or contain bigger string. + if (si_data == nullptr || std::strlen(si_data) >= MAX_PATH) { + m_core.szKrnlDebug[0] = '\0'; + } + else { + std::strncpy(m_core.szKrnlDebug, si_data, MAX_PATH); + } + + m_core.allowAdminPrivilege = m_si.GetBoolValue(section_core, sect_core_keys.AllowAdminPrivilege, /*Default=*/false); + + m_core.LogLevel = m_si.GetLongValue(section_core, sect_core_keys.LogLevel, 1); + si_list.clear(); + index = 0; + list_max = std::size(m_core.LoggedModules); + bRet = m_si.GetAllValues(section_core, sect_core_keys.LoggedModules, si_list); + if (bRet) { + si_list_iterator = si_list.begin(); + for (si_list_iterator; si_list_iterator != si_list.end(); si_list_iterator++) { + // Exit loop when the list has reached the limit. + if (index == list_max) { + break; + } + if (std::strncmp(si_list_iterator->pItem, "0x", 2) == 0) { + si_list_iterator->pItem += 2; + } + m_core.LoggedModules[index] = std::strtoul(si_list_iterator->pItem, nullptr, 16); + index++; + } + } + while (index < list_max) { + m_core.LoggedModules[index] = 0; + index++; + } + + // ==== Core End ============ + + // ==== Hack Begin ========== + + m_hacks.DisablePixelShaders = m_si.GetBoolValue(section_hack, sect_hack_keys.DisablePixelShaders, /*Default=*/false); + m_hacks.UseAllCores = m_si.GetBoolValue(section_hack, sect_hack_keys.UseAllCores, /*Default=*/false); + m_hacks.SkipRdtscPatching = m_si.GetBoolValue(section_hack, sect_hack_keys.SkipRdtscPatching, /*Default=*/false); + + // ==== Hack End ============ + + // ==== Video Begin ========= + + // Video - Resolution config + si_data = m_si.GetValue(section_video, sect_video_keys.VideoResolution, /*Default=*/nullptr); + // Fallback to null string if value is empty or contain bigger string. + if (si_data == nullptr || std::strlen(si_data) >= std::size(m_video.szVideoResolution)) { + m_video.szVideoResolution[0] = '\0'; + } + else { + std::strncpy(m_video.szVideoResolution, si_data, std::size(m_video.szVideoResolution)); + } + + m_video.adapter = m_si.GetLongValue(section_video, sect_video_keys.adapter, /*Default=*/0); + m_video.direct3DDevice = m_si.GetLongValue(section_video, sect_video_keys.Direct3DDevice, /*Default=*/0); + m_video.bVSync = m_si.GetBoolValue(section_video, sect_video_keys.VSync, /*Default=*/false); + m_video.bFullScreen = m_si.GetBoolValue(section_video, sect_video_keys.FullScreen, /*Default=*/false); + m_video.bHardwareYUV = m_si.GetBoolValue(section_video, sect_video_keys.HardwareYUV, /*Default=*/false); + m_video.renderScaleFactor = m_si.GetLongValue(section_video, sect_video_keys.RenderResolution, /*Default=*/1); + + // ==== Video End =========== + + // ==== Audio Begin ========= + + // Audio - Adapter config + si_data = m_si.GetValue(section_audio, sect_audio_keys.adapter, /*Default=*/nullptr); + if (si_data == nullptr) { + // Default to primary audio device + m_audio.adapterGUID = { 0 }; + } + else { + iStatus = std::sscanf(si_data, sect_audio_keys.adapter_value, + &m_audio.adapterGUID.Data1, &m_audio.adapterGUID.Data2, &m_audio.adapterGUID.Data3, + &m_audio.adapterGUID.Data4[0], &m_audio.adapterGUID.Data4[1], &m_audio.adapterGUID.Data4[2], &m_audio.adapterGUID.Data4[3], + &m_audio.adapterGUID.Data4[4], &m_audio.adapterGUID.Data4[5], &m_audio.adapterGUID.Data4[6], &m_audio.adapterGUID.Data4[7]); + + // Fallback to primary audio device if file contain invalid value. + if (iStatus != 11 /*= total arguments*/) { + m_audio.adapterGUID = { 0 }; + } + } + + m_audio.codec_pcm = m_si.GetBoolValue(section_audio, sect_audio_keys.codec_pcm, /*Default=*/true, nullptr); + m_audio.codec_xadpcm = m_si.GetBoolValue(section_audio, sect_audio_keys.codec_xadpcm, /*Default=*/true, nullptr); + m_audio.codec_unknown = m_si.GetBoolValue(section_audio, sect_audio_keys.codec_unknown, /*Default=*/true, nullptr); + + m_audio.mute_on_unfocus = m_si.GetBoolValue(section_audio, sect_audio_keys.mute_on_unfocus, /*Default=*/true, nullptr); + + // ==== Audio End =========== + + // ==== Network Begin ======= + + si_data = m_si.GetValue(section_network, sect_network_keys.adapter_name, /*Default=*/nullptr); + // Fallback to null string if value is empty or contains a bigger string. + if (si_data == nullptr || std::strlen(si_data) >= std::size(m_network.adapter_name)) { + m_network.adapter_name[0] = '\0'; + } else { + std::strncpy(m_network.adapter_name, si_data, std::size(m_network.adapter_name)); + } + + // ==== Network End ========= + + // ==== Input Begin ==== + + for (int port_num = 0; port_num < 4; port_num++) { + std::string current_section = std::string(section_input) + std::to_string(port_num); + int ret = m_si.GetLongValue(current_section.c_str(), sect_input.type, -2); + if (ret == -2) { + m_input[port_num].Type = to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID); + continue; + } + m_input[port_num].Type = ret; + m_input[port_num].DeviceName = m_si.GetValue(current_section.c_str(), sect_input.device); + m_input[port_num].ProfileName = TrimQuoteFromString(m_si.GetValue(current_section.c_str(), sect_input.config)); + } + + // ==== Input End ============== + + // ==== Input Profile Begin ==== + std::array, to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)> control_names; + + for (int device = 0; device < to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX); device++) { + if (dev_num_buttons[device] == 0) { + continue; + } + + for (int i = 0; i < dev_num_buttons[device]; i++) { + char control_name[30]; + std::sprintf(control_name, sect_input_profiles.control, button_xbox_ctrl_names[i][0]); + control_names[device].push_back(control_name); + } + } + + // TODO: add the control names of the other devices + + index = 0; + while (true) { + std::string current_section = std::string(section_input_profiles) + std::to_string(index); + if (m_si.GetSectionSize(current_section.c_str()) == -1) { + break; + } + s_input_profiles local_profile; + local_profile.Type = m_si.GetLongValue(current_section.c_str(), sect_input_profiles.type); + local_profile.ProfileName = TrimQuoteFromString(m_si.GetValue(current_section.c_str(), sect_input_profiles.config)); + local_profile.DeviceName = m_si.GetValue(current_section.c_str(), sect_input_profiles.device); + for (int vec_control_index = 0; vec_control_index < dev_num_buttons[local_profile.Type]; vec_control_index++) { + local_profile.ControlList.push_back(m_si.GetValue(current_section.c_str(), + control_names[local_profile.Type][vec_control_index].c_str())); + } + m_input_profiles[local_profile.Type].push_back(std::move(local_profile)); + index++; + } + + // ==== Input Profile End ====== + + // Delete legacy configs from previous revisions + RemoveLegacyConfigs(m_core.Revision); + m_core.Revision = settings_version; + + return true; +} + +bool Settings::Save(std::string file_path) +{ + if (m_file_path.empty() && file_path.empty()) { + return false; + } + + // Minimal need is 25, 0x37 for GUID. + char si_value[64]; + std::string quote_str; + + // ==== GUI Begin =========== + + m_si.SetLongValue(section_gui, sect_gui_keys.CxbxDebugMode, m_gui.CxbxDebugMode, nullptr, true, true); + m_si.SetValue(section_gui, sect_gui_keys.CxbxDebugLogFile, m_gui.szCxbxDebugFile.c_str(), nullptr, true); + m_si.SetLongValue(section_gui, sect_gui_keys.DataStorageToggle, m_gui.DataStorageToggle, nullptr, true, true); + m_si.SetValue(section_gui, sect_gui_keys.DataCustomLocation, m_gui.szCustomLocation.c_str(), nullptr, true); + + // First force overwrite existing value + m_si.SetValue(section_gui, sect_gui_keys.RecentXbeFiles, m_gui.szRecentXbeFiles[0].c_str(), nullptr, true); + // Then append recent xbe file strings + for (unsigned int i = 1; i < 10; i++) { + m_si.SetValue(section_gui, sect_gui_keys.RecentXbeFiles, m_gui.szRecentXbeFiles[i].c_str(), nullptr, false); + } + + // ==== GUI End ============= + + // ==== Core Begin ========== + + m_si.SetLongValue(section_core, sect_core_keys.Revision, m_core.Revision, nullptr, false, true); + m_si.SetLongValue(section_core, sect_core_keys.FlagsLLE, m_core.FlagsLLE, nullptr, true, true); + m_si.SetLongValue(section_core, sect_core_keys.KrnlDebugMode, m_core.KrnlDebugMode, nullptr, true, true); + m_si.SetValue(section_core, sect_core_keys.KrnlDebugLogFile, m_core.szKrnlDebug, nullptr, true); + m_si.SetBoolValue(section_core, sect_core_keys.AllowAdminPrivilege, m_core.allowAdminPrivilege, nullptr, true); + m_si.SetLongValue(section_core, sect_core_keys.LogLevel, m_core.LogLevel, nullptr, false, true); + + std::stringstream stream; + stream << "0x" << std::hex << m_core.LoggedModules[0]; + m_si.SetValue(section_core, sect_core_keys.LoggedModules, stream.str().c_str(), nullptr, true); + for (int i = 1; i < NUM_INTEGERS_LOG; i++) { + stream.str(""); + stream << "0x" << std::hex << m_core.LoggedModules[i]; + m_si.SetValue(section_core, sect_core_keys.LoggedModules, stream.str().c_str(), nullptr, false); + } + + // ==== Core End ============ + + // ==== Video Begin ========= + + m_si.SetValue(section_video, sect_video_keys.VideoResolution, m_video.szVideoResolution, nullptr, true); + + m_si.SetLongValue(section_video, sect_video_keys.adapter, m_video.adapter, nullptr, true, true); + m_si.SetLongValue(section_video, sect_video_keys.Direct3DDevice, m_video.direct3DDevice, nullptr, true, true); + m_si.SetBoolValue(section_video, sect_video_keys.VSync, m_video.bVSync, nullptr, true); + m_si.SetBoolValue(section_video, sect_video_keys.FullScreen, m_video.bFullScreen, nullptr, true); + m_si.SetBoolValue(section_video, sect_video_keys.HardwareYUV, m_video.bHardwareYUV, nullptr, true); + m_si.SetLongValue(section_video, sect_video_keys.RenderResolution, m_video.renderScaleFactor, nullptr, false, true); + // ==== Video End =========== + + // ==== Audio Begin ========= + + // Audio - Adapter config + std::sprintf(si_value, sect_audio_keys.adapter_value, + m_audio.adapterGUID.Data1, m_audio.adapterGUID.Data2, m_audio.adapterGUID.Data3, + m_audio.adapterGUID.Data4[0], m_audio.adapterGUID.Data4[1], m_audio.adapterGUID.Data4[2], m_audio.adapterGUID.Data4[3], + m_audio.adapterGUID.Data4[4], m_audio.adapterGUID.Data4[5], m_audio.adapterGUID.Data4[6], m_audio.adapterGUID.Data4[7]); + + m_si.SetValue(section_audio, sect_audio_keys.adapter, si_value, nullptr, true); + + m_si.SetBoolValue(section_audio, sect_audio_keys.codec_pcm, m_audio.codec_pcm, nullptr, true); + m_si.SetBoolValue(section_audio, sect_audio_keys.codec_xadpcm, m_audio.codec_xadpcm, nullptr, true); + m_si.SetBoolValue(section_audio, sect_audio_keys.codec_unknown, m_audio.codec_unknown, nullptr, true); + m_si.SetBoolValue(section_audio, sect_audio_keys.mute_on_unfocus, m_audio.mute_on_unfocus, nullptr, true); + + // ==== Audio End =========== + + // ==== Network Begin ======= + + m_si.SetValue(section_network, sect_network_keys.adapter_name, m_network.adapter_name, nullptr, true); + + // ==== Network End ========= + + // ==== Input Begin ==== + + for (int port_num = 0; port_num < 4; port_num++) { + std::string current_section = std::string(section_input) + std::to_string(port_num); + std::string quoted_prf_str = m_input[port_num].ProfileName.insert(0, "\""); + quoted_prf_str += "\""; + m_si.SetLongValue(current_section.c_str(), sect_input.type, m_input[port_num].Type, nullptr, false, true); + m_si.SetValue(current_section.c_str(), sect_input.device, m_input[port_num].DeviceName.c_str(), nullptr, true); + m_si.SetValue(current_section.c_str(), sect_input.config, quoted_prf_str.c_str(), nullptr, true); + } + + // ==== Input End ============== + + // ==== Input Profile Begin ==== + + std::array, to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)> control_names; + for (int device = 0; device < to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX); device++) { + if (dev_num_buttons[device] == 0) { + continue; + } + + for (int i = 0; i < dev_num_buttons[device]; i++) { + char control_name[30]; + std::sprintf(control_name, sect_input_profiles.control, button_xbox_ctrl_names[i][0]); + control_names[device].push_back(control_name); + } + } + + // TODO: add the control names of the other devices + + int profile_num = 0; + for (int i = 0; i < to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX); i++) { + size_t vec_size = m_input_profiles[i].size(); + if (vec_size == 0) { + continue; + } + for (unsigned int vec_index = 0; vec_index < vec_size; vec_index++, profile_num++) { + std::string current_section = std::string(section_input_profiles) + std::to_string(profile_num); + std::string quoted_prf_str = m_input_profiles[i][vec_index].ProfileName.insert(0, "\""); + quoted_prf_str += "\""; + m_si.SetLongValue(current_section.c_str(), sect_input_profiles.type, m_input_profiles[i][vec_index].Type, nullptr, false, true); + m_si.SetValue(current_section.c_str(), sect_input_profiles.config, quoted_prf_str.c_str(), nullptr, true); + m_si.SetValue(current_section.c_str(), sect_input_profiles.device, m_input_profiles[i][vec_index].DeviceName.c_str(), nullptr, true); + size_t vec_control_size = m_input_profiles[i][vec_index].ControlList.size(); + if (vec_control_size == 0) { + continue; + } + m_si.SetValue(current_section.c_str(), control_names[i][0].c_str(), m_input_profiles[i][vec_index].ControlList[0].c_str(), nullptr, true); + for (unsigned int vec_control_index = 1; vec_control_index < vec_control_size; vec_control_index++) { + m_si.SetValue(current_section.c_str(), control_names[i][vec_control_index].c_str(), + m_input_profiles[i][vec_index].ControlList[vec_control_index].c_str(), nullptr, true); + } + } + } + while (true) { + std::string current_section = std::string(section_input_profiles) + std::to_string(profile_num); + if (m_si.GetSectionSize(current_section.c_str()) == -1) { + break; + } + m_si.Delete(current_section.c_str(), nullptr, true); + profile_num++; + } + + // ==== Input Profile End ====== + + // ==== Hack Begin ========== + + m_si.SetBoolValue(section_hack, sect_hack_keys.DisablePixelShaders, m_hacks.DisablePixelShaders, nullptr, true); + m_si.SetBoolValue(section_hack, sect_hack_keys.UseAllCores, m_hacks.UseAllCores, nullptr, true); + m_si.SetBoolValue(section_hack, sect_hack_keys.SkipRdtscPatching, m_hacks.SkipRdtscPatching, nullptr, true); + + // ==== Hack End ============ + + SI_Error siError; + if (!file_path.empty()) { + siError = m_si.SaveFile(file_path.c_str(), true); + + if (siError == SI_OK) { + m_file_path = file_path; + } + } + else { + siError = m_si.SaveFile(m_file_path.c_str(), true); + } + + return (siError == SI_OK); +} + +void Settings::Delete() +{ + std::filesystem::remove(m_file_path); +} + +// Universal update to EmuShared from both standalone kernel, and GUI process. +void Settings::SyncToEmulator() +{ + // register Core settings + g_EmuShared->SetCoreSettings(&m_core); + g_EmuShared->SetIsKrnlLogEnabled(m_core.KrnlDebugMode != DebugMode::DM_NONE); + + // register Video settings + g_EmuShared->SetVideoSettings(&m_video); + + // register Audio settings + g_EmuShared->SetAudioSettings(&m_audio); + + // register Network settings + g_EmuShared->SetNetworkSettings(&m_network); + + // register input settings + for (int i = 0; i < 4; i++) { + g_EmuShared->SetInputDevTypeSettings(&m_input[i].Type, i); + if (m_input[i].Type != to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID)) { + g_EmuShared->SetInputDevNameSettings(m_input[i].DeviceName.c_str(), i); + auto it = std::find_if(m_input_profiles[m_input[i].Type].begin(), + m_input_profiles[m_input[i].Type].end(), [this, i](const auto& profile) { + if (profile.ProfileName == m_input[i].ProfileName) { + return true; + } + return false; + }); + if (it != m_input_profiles[m_input[i].Type].end()) { + char controls_name[XBOX_CTRL_NUM_BUTTONS][30]; + for (int index = 0; index < dev_num_buttons[m_input[i].Type]; index++) { + strncpy(controls_name[index], it->ControlList[index].c_str(), 30); + } + g_EmuShared->SetInputBindingsSettings(controls_name, XBOX_CTRL_NUM_BUTTONS, i); + } + } + } + + // register Hacks settings + g_EmuShared->SetHackSettings(&m_hacks); + + // register data location setting + g_EmuShared->SetStorageLocation(GetDataLocation().c_str()); +} + +void verifyDebugFilePath(DebugMode& debug_mode, std::string& file_path) +{ + // Prevent using an incorrect path from the registry if the debug folders have been moved + std::string szDebugPath; + std::string szDebugName; + + if (debug_mode == DM_FILE) { + + if(file_path.size() == 0 || file_path.size() >= MAX_PATH) { + debug_mode = DM_NONE; + } + else { + szDebugName = file_path.substr(file_path.find_last_of("\\/"), std::string::npos); + + if(file_path.size() < szDebugName.size()) { + file_path = ""; + debug_mode = DM_NONE; + } + else { + szDebugPath = file_path.substr(0, file_path.size() - szDebugName.size()); + + if(std::filesystem::exists(szDebugPath) == false) { + file_path = ""; + debug_mode = DM_NONE; + } + } + } + } +} + +void Settings::Verify() +{ + std::string szKrnlDebug = m_core.szKrnlDebug; // Temporary placeholder until m_core.szKrnlDebug is replace to std::string. + + verifyDebugFilePath(m_gui.CxbxDebugMode, m_gui.szCxbxDebugFile); + + verifyDebugFilePath(m_core.KrnlDebugMode, szKrnlDebug); + + // Set to null string once if contain invalid path. + if (m_core.szKrnlDebug[0] != '\0' && szKrnlDebug.size() == 0) { + std::memset(m_core.szKrnlDebug, 0, MAX_PATH); + } +} + +std::string Settings::GetDataLocation() +{ + + // Optimization purpose for not require to re-process when toggle state has not changed. + if (m_current_DataStorageToggle == m_gui.DataStorageToggle) { + return m_current_data_location; + } + + switch (m_gui.DataStorageToggle) { + default: +#ifdef RETRO_API_VERSION // TODO: Change me to #ifndef QT_VERSION + + m_gui.DataStorageToggle = CXBX_DATA_EXECDIR; + +#else // Only support for Qt compile build. + + m_gui.DataStorageToggle = CXBX_DATA_APPDATA; + // If unknown value, default to CXBX_DATA_APPDATA (below, don't use break) + + case CXBX_DATA_APPDATA: + m_current_data_location = GenerateUserProfileDirectoryStr(); + break; +#endif + + case CXBX_DATA_EXECDIR: + m_current_data_location = GenerateExecDirectoryStr(); + break; + + case CXBX_DATA_CUSTOM: + m_current_data_location = m_gui.szCustomLocation; + break; + } + m_current_DataStorageToggle = m_gui.DataStorageToggle; + + return m_current_data_location; +} + +void Settings::RemoveLegacyConfigs(unsigned int CurrentRevision) +{ + switch (CurrentRevision) { + case 2: + case 3: + case 4: + m_si.Delete(section_controller_dinput, nullptr, true); + m_si.Delete(section_controller_port, nullptr, true); + break; + case 5: + default: + break; + } +} diff --git a/src/common/Settings.hpp b/src/common/Settings.hpp new file mode 100644 index 000000000..f46ac389a --- /dev/null +++ b/src/common/Settings.hpp @@ -0,0 +1,174 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2017-2018 RadWolfie +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef SETTINGS_HPP +#define SETTINGS_HPP +#include "Cxbx.h" + +#include "SimpleIni.h" +#include "input\InputDevice.h" +#include "common\util\CxbxUtil.h" +#include +#include + +extern std::string g_exec_filepath; + +// Individual library version +extern uint16_t g_LibVersion_D3D8; +extern uint16_t g_LibVersion_DSOUND; + +#define szSettings_alloc_error "ERROR: Unable to allocate Settings class." + +// Cxbx-Reloaded's data storage location. +typedef enum _CXBX_DATA { + CXBX_DATA_APPDATA = 0, + CXBX_DATA_EXECDIR = 1, + CXBX_DATA_CUSTOM = 2, +} CXBX_DATA; + +// ****************************************************************** +// * Define number of integers required to store logging settings +// ****************************************************************** +#define NUM_INTEGERS_LOG 2 + +enum { + LLE_NONE = 0, + LLE_APU = 1 << 0, + LLE_GPU = 1 << 1, + LLE_JIT = 1 << 2, + LLE_USB = 1 << 3, +}; + +class Settings +{ +public: + bool Init(); + bool LoadUserConfig(); + bool LoadFile(std::string file_path); + bool LoadConfig(); + bool Save(std::string file_path = ""); + void Delete(); + void SyncToEmulator(); + void Verify(); + std::string GetDataLocation(); + + // GUI settings + struct s_gui { + DebugMode CxbxDebugMode; + std::string szCxbxDebugFile; + std::string szRecentXbeFiles[10]; + unsigned int DataStorageToggle; + std::string szCustomLocation = ""; + } m_gui; + + // Core settings + struct s_core { + unsigned int Revision; + unsigned int FlagsLLE; + DebugMode KrnlDebugMode; + char szKrnlDebug[MAX_PATH] = ""; + char szStorageLocation[MAX_PATH] = ""; + bool allowAdminPrivilege; + unsigned int LoggedModules[NUM_INTEGERS_LOG]; + int LogLevel = 1; + bool Reserved2 = 0; + bool Reserved3 = 0; + bool Reserved4 = 0; + int Reserved99[10] = { 0 }; + } m_core; + + // Video settings + struct s_video { + char szVideoResolution[100] = ""; + unsigned int adapter; + unsigned int direct3DDevice; + bool bVSync; + bool bFullScreen; + bool bHardwareYUV; + bool Reserved3; + int renderScaleFactor = 1; + int Reserved99[9] = { 0 }; + } m_video; + + // Audio settings + struct s_audio { + GUID adapterGUID; + bool codec_pcm ; + bool codec_xadpcm; + bool codec_unknown; + bool mute_on_unfocus; + int Reserved99[14] = { 0 }; + } m_audio; + + struct s_input { + int Type; + std::string DeviceName; + std::string ProfileName; + }; + std::array m_input; + + struct s_input_profiles { + int Type; + std::string ProfileName; + std::string DeviceName; + std::vector ControlList; + }; + std::array, to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)> m_input_profiles; + + // Network settings + struct s_network { + char adapter_name[MAX_PATH] = ""; + } m_network; + + // Hack settings + // NOTE: When removing fields, replace them with place-holders + // The size and order of this structure should *not* be allowed to change + // TODO: Fix IPC/Shared Memory so this isn't necessary + struct s_hack { + bool DisablePixelShaders; + bool Reserved2; + bool UseAllCores; + bool SkipRdtscPatching; + bool Reserved3; + bool Reserved4; + bool Reserved7 = 0; + bool Reserved8 = 0; + int Reserved99[8] = { 0 }; + } m_hacks; + +private: + void RemoveLegacyConfigs(unsigned int CurrentRevision); + std::string m_file_path = ""; + CSimpleIniA m_si; + std::string m_current_data_location; + unsigned int m_current_DataStorageToggle = -1; +}; + +// Settings manager +extern Settings* g_Settings; +extern const unsigned int settings_version; + +#endif diff --git a/src/common/Timer.cpp b/src/common/Timer.cpp new file mode 100644 index 000000000..024d6b038 --- /dev/null +++ b/src/common/Timer.cpp @@ -0,0 +1,172 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifdef _WIN32 +#include +#endif +#include +#include +#include +#include "Timer.h" +#include "common\util\CxbxUtil.h" +#include "core\kernel\init\CxbxKrnl.h" +#ifdef __linux__ +#include +#endif + + +// Virtual clocks will probably become useful once LLE CPU is implemented, but for now we don't need them. +// See the QEMUClockType QEMU_CLOCK_VIRTUAL of XQEMU for more info. +#define CLOCK_REALTIME 0 +//#define CLOCK_VIRTUALTIME 1 + + +// Vector storing all the timers created +static std::vector TimerList; +// The frequency of the high resolution clock of the host +uint64_t HostClockFrequency; +// Lock to acquire when accessing TimerList +std::mutex TimerMtx; + + +// Returns the current time of the timer +inline uint64_t GetTime_NS(TimerObject* Timer) +{ +#ifdef _WIN32 + LARGE_INTEGER li; + QueryPerformanceCounter(&li); + uint64_t Ret = Muldiv64(li.QuadPart, SCALE_S_IN_NS, (uint32_t)HostClockFrequency); +#elif __linux__ + static struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + uint64_t Ret = Muldiv64(ts.tv_sec, SCALE_S_IN_NS, 1) + ts.tv_nsec; +#else +#error "Unsupported OS" +#endif + return Ret; +} + +// Calculates the next expire time of the timer +static inline uint64_t GetNextExpireTime(TimerObject* Timer) +{ + return GetTime_NS(Timer) + Timer->ExpireTime_MS.load(); +} + +// Deallocates the memory of the timer +void Timer_Destroy(TimerObject* Timer) +{ + unsigned int index, i; + std::lock_guardlock(TimerMtx); + + index = TimerList.size(); + for (i = 0; i < index; i++) { + if (Timer == TimerList[i]) { + index = i; + } + } + + assert(index != TimerList.size()); + delete Timer; + TimerList.erase(TimerList.begin() + index); +} + +// Thread that runs the timer +void ClockThread(TimerObject* Timer) +{ + uint64_t NewExpireTime; + + if (!Timer->Name.empty()) { + CxbxSetThreadName(Timer->Name.c_str()); + } + if (Timer->CpuAffinity != nullptr) { + InitXboxThread(*Timer->CpuAffinity); + } + NewExpireTime = GetNextExpireTime(Timer); + + while (true) { + if (GetTime_NS(Timer) > NewExpireTime) { + if (Timer->Exit.load()) { + Timer_Destroy(Timer); + return; + } + Timer->Callback(Timer->Opaque); + NewExpireTime = GetNextExpireTime(Timer); + } + Sleep(1); // prevent burning the cpu + } +} + +// Changes the expire time of a timer +void Timer_ChangeExpireTime(TimerObject* Timer, uint64_t Expire_ms) +{ + Timer->ExpireTime_MS.store(Expire_ms); +} + +// Destroys the timer +void Timer_Exit(TimerObject* Timer) +{ + Timer->Exit.store(true); +} + +// Allocates the memory for the timer object +TimerObject* Timer_Create(TimerCB Callback, void* Arg, std::string Name, unsigned long* Affinity) +{ + std::lock_guardlock(TimerMtx); + TimerObject* pTimer = new TimerObject; + pTimer->Type = CLOCK_REALTIME; + pTimer->Callback = Callback; + pTimer->ExpireTime_MS.store(0); + pTimer->Exit.store(false); + pTimer->Opaque = Arg; + Name.empty() ? pTimer->Name = "Unnamed thread" : pTimer->Name = Name; + pTimer->CpuAffinity = Affinity; + TimerList.emplace_back(pTimer); + + return pTimer; +} + +// Starts the timer +// Expire_MS must be expressed in NS +void Timer_Start(TimerObject* Timer, uint64_t Expire_MS) +{ + Timer->ExpireTime_MS.store(Expire_MS); + std::thread(ClockThread, Timer).detach(); +} + +// Retrives the frequency of the high resolution clock of the host +void Timer_Init() +{ +#ifdef _WIN32 + LARGE_INTEGER freq; + QueryPerformanceFrequency(&freq); + HostClockFrequency = freq.QuadPart; +#elif __linux__ + ClockFrequency = 0; +#else +#error "Unsupported OS" +#endif +} diff --git a/src/common/Timer.h b/src/common/Timer.h new file mode 100644 index 000000000..742b66c7d --- /dev/null +++ b/src/common/Timer.h @@ -0,0 +1,66 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef TIMER_H +#define TIMER_H + +#include + +#define SCALE_S_IN_NS 1000000000 +#define SCALE_MS_IN_NS 1000000 +#define SCALE_US_IN_NS 1000 +#define SCALE_NS_IN_NS 1 + +#define SCALE_S_IN_US 1000000 +#define SCALE_MS_IN_US 1000 +#define SCALE_US_IN_US 1 + +/* typedef of the timer object and the callback function */ +typedef void(*TimerCB)(void*); +typedef struct _TimerObject +{ + int Type; // timer type + std::atomic_uint64_t ExpireTime_MS; // when the timer expires (ms) + std::atomic_bool Exit; // indicates that the timer should be destroyed + TimerCB Callback; // function to call when the timer expires + void* Opaque; // opaque argument to pass to the callback + std::string Name; // the name of the timer thread (if any) + unsigned long* CpuAffinity; // the cpu affinity of the timer thread (if any) +} +TimerObject; + +extern uint64_t HostClockFrequency; + +/* Timer exported functions */ +TimerObject* Timer_Create(TimerCB Callback, void* Arg, std::string Name, unsigned long* Affinity); +void Timer_Start(TimerObject* Timer, uint64_t Expire_MS); +void Timer_Exit(TimerObject* Timer); +void Timer_ChangeExpireTime(TimerObject* Timer, uint64_t Expire_ms); +inline uint64_t GetTime_NS(TimerObject* Timer); +void Timer_Init(); + +#endif diff --git a/src/Common/XADPCM.h b/src/common/XADPCM.h similarity index 85% rename from src/Common/XADPCM.h rename to src/common/XADPCM.h index b116ac031..c37d1c76b 100644 --- a/src/Common/XADPCM.h +++ b/src/common/XADPCM.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->XADPCM.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,7 +25,7 @@ #ifndef XBOXADPCM_H #define XBOXADPCM_H -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" /* TXboxAdpcmDecoder 0.1.3 @@ -60,7 +51,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - http://www.gnu.org/licenses/gpl.txt + https://www.gnu.org/licenses/gpl.txt */ #define XBOX_ADPCM_SRCSIZE 36 @@ -76,14 +67,14 @@ typedef struct { - int08 Index; - int16 StepSize; - int16 Predictor; + int8_t Index; + int16_t StepSize; + int16_t Predictor; } TAdpcmState; -const static int16 StepTable[89] = { +const static int16_t StepTable[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, @@ -97,12 +88,12 @@ const static int16 StepTable[89] = { -const static int08 IndexTable[16] = { +const static int8_t IndexTable[16] = { -1, -1, -1, -1, 2, 4, 6, 8, -1, -1, -1, -1, 2, 4, 6, 8 }; -int TXboxAdpcmDecoder_DecodeSample(int Code, TAdpcmState *State) { +static int TXboxAdpcmDecoder_DecodeSample(int Code, TAdpcmState *State) { int Delta, Result; @@ -120,10 +111,10 @@ int TXboxAdpcmDecoder_DecodeSample(int Code, TAdpcmState *State) { return(Result); } -int TXboxAdpcmDecoder_Decode_Memory(uint08 *in, int inlen, uint08 *out, const int FChannels) { +static int TXboxAdpcmDecoder_Decode_Memory(uint8_t *in, int inlen, uint8_t *out, const int FChannels) { TAdpcmState FAdpcmState[2]; - int16 Buffers[2][8]; - uint32 CodeBuf; + int16_t Buffers[2][8]; + uint32_t CodeBuf; int i, j, c, @@ -159,7 +150,7 @@ int TXboxAdpcmDecoder_Decode_Memory(uint08 *in, int inlen, uint08 *out, const in } return(outlen * XBOX_ADPCM_DSTSIZE * FChannels); } -int TXboxAdpcmDecoder_guess_output_size(int SourceSize) { +static int TXboxAdpcmDecoder_guess_output_size(int SourceSize) { return((SourceSize / XBOX_ADPCM_SRCSIZE) * XBOX_ADPCM_DSTSIZE); } diff --git a/src/common/crypto/EmuDes.cpp b/src/common/crypto/EmuDes.cpp new file mode 100644 index 000000000..34aff2655 --- /dev/null +++ b/src/common/crypto/EmuDes.cpp @@ -0,0 +1,687 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: ReactOS (GPLv2) +// https://github.com/reactos/reactos + +/* +* FIPS-46-3 compliant Triple-DES implementation +* +* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved +* SPDX-License-Identifier: GPL-2.0 +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* This file is part of mbed TLS (https://tls.mbed.org) +*/ +/* +* DES, on which TDES is based, was originally designed by Horst Feistel +* at IBM in 1974, and was adopted as a standard by NIST (formerly NBS). +* +* https://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf +*/ + +// Changed from ReactOS: we never swap the subkeys in order to generate a decryption key schedule. Instead, we opt to simply read the subkeys +// in reverse order during a decryption operation. This is necessary because XcKeyTable doesn't provide an "operation" argument, that is, it +// always generates an encryption key schedule. + +// NOTE: this des implementation doesn't produce exactly the same ciphertext produced by the Xbox. I found that the implementation of Eric Young +// used in OpenSSL does instead, but we can't use it since it's under the Apache 2.0 license, which is incompatible with GPLv2. For reference, +// the DES-YOUN.zip package at https://www.schneier.com/books/applied_cryptography/source.html contains a previous version of the same code under +// the GPLv2 but again it doesn't produce the same ciphertext, and modifying it to make it so would make it identical to the OpenSSL code, which +// is probably a violation of the license, so I won't do it. In practice, as long as the code correctly decrypts the ciphertext (which it does), +// I don't think that the Xbox games will care if the ciphertext is not exactly the same as on the Xbox and should work fine offline. The only +// problem with this is that cxbxr will be unable to communicate with a real Xbox on the network (des is used in console-to-console communications) +// because the des key schedule generated on the console will be different and so it will fail to decrypt packets encrypted by cxbxr. + + +#include +#include +#include "EmuDes.h" + +/* +* 32-bit integer manipulation macros (big endian) +*/ +#ifndef GET_UINT32_BE +#define GET_UINT32_BE(n,b,i) \ +{ \ + (n) = ( (uint32_t) (b)[(i) ] << 24 ) \ + | ( (uint32_t) (b)[(i) + 1] << 16 ) \ + | ( (uint32_t) (b)[(i) + 2] << 8 ) \ + | ( (uint32_t) (b)[(i) + 3] ); \ +} +#endif + +#ifndef PUT_UINT32_BE +#define PUT_UINT32_BE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) ); \ +} +#endif + +/* +* Expanded DES S-boxes +*/ +static const uint32_t SB1[64] = +{ + 0x01010400, 0x00000000, 0x00010000, 0x01010404, + 0x01010004, 0x00010404, 0x00000004, 0x00010000, + 0x00000400, 0x01010400, 0x01010404, 0x00000400, + 0x01000404, 0x01010004, 0x01000000, 0x00000004, + 0x00000404, 0x01000400, 0x01000400, 0x00010400, + 0x00010400, 0x01010000, 0x01010000, 0x01000404, + 0x00010004, 0x01000004, 0x01000004, 0x00010004, + 0x00000000, 0x00000404, 0x00010404, 0x01000000, + 0x00010000, 0x01010404, 0x00000004, 0x01010000, + 0x01010400, 0x01000000, 0x01000000, 0x00000400, + 0x01010004, 0x00010000, 0x00010400, 0x01000004, + 0x00000400, 0x00000004, 0x01000404, 0x00010404, + 0x01010404, 0x00010004, 0x01010000, 0x01000404, + 0x01000004, 0x00000404, 0x00010404, 0x01010400, + 0x00000404, 0x01000400, 0x01000400, 0x00000000, + 0x00010004, 0x00010400, 0x00000000, 0x01010004 +}; + +static const uint32_t SB2[64] = +{ + 0x80108020, 0x80008000, 0x00008000, 0x00108020, + 0x00100000, 0x00000020, 0x80100020, 0x80008020, + 0x80000020, 0x80108020, 0x80108000, 0x80000000, + 0x80008000, 0x00100000, 0x00000020, 0x80100020, + 0x00108000, 0x00100020, 0x80008020, 0x00000000, + 0x80000000, 0x00008000, 0x00108020, 0x80100000, + 0x00100020, 0x80000020, 0x00000000, 0x00108000, + 0x00008020, 0x80108000, 0x80100000, 0x00008020, + 0x00000000, 0x00108020, 0x80100020, 0x00100000, + 0x80008020, 0x80100000, 0x80108000, 0x00008000, + 0x80100000, 0x80008000, 0x00000020, 0x80108020, + 0x00108020, 0x00000020, 0x00008000, 0x80000000, + 0x00008020, 0x80108000, 0x00100000, 0x80000020, + 0x00100020, 0x80008020, 0x80000020, 0x00100020, + 0x00108000, 0x00000000, 0x80008000, 0x00008020, + 0x80000000, 0x80100020, 0x80108020, 0x00108000 +}; + +static const uint32_t SB3[64] = +{ + 0x00000208, 0x08020200, 0x00000000, 0x08020008, + 0x08000200, 0x00000000, 0x00020208, 0x08000200, + 0x00020008, 0x08000008, 0x08000008, 0x00020000, + 0x08020208, 0x00020008, 0x08020000, 0x00000208, + 0x08000000, 0x00000008, 0x08020200, 0x00000200, + 0x00020200, 0x08020000, 0x08020008, 0x00020208, + 0x08000208, 0x00020200, 0x00020000, 0x08000208, + 0x00000008, 0x08020208, 0x00000200, 0x08000000, + 0x08020200, 0x08000000, 0x00020008, 0x00000208, + 0x00020000, 0x08020200, 0x08000200, 0x00000000, + 0x00000200, 0x00020008, 0x08020208, 0x08000200, + 0x08000008, 0x00000200, 0x00000000, 0x08020008, + 0x08000208, 0x00020000, 0x08000000, 0x08020208, + 0x00000008, 0x00020208, 0x00020200, 0x08000008, + 0x08020000, 0x08000208, 0x00000208, 0x08020000, + 0x00020208, 0x00000008, 0x08020008, 0x00020200 +}; + +static const uint32_t SB4[64] = +{ + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802080, 0x00800081, 0x00800001, 0x00002001, + 0x00000000, 0x00802000, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00800080, 0x00800001, + 0x00000001, 0x00002000, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002001, 0x00002080, + 0x00800081, 0x00000001, 0x00002080, 0x00800080, + 0x00002000, 0x00802080, 0x00802081, 0x00000081, + 0x00800080, 0x00800001, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00000000, 0x00802000, + 0x00002080, 0x00800080, 0x00800081, 0x00000001, + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802081, 0x00000081, 0x00000001, 0x00002000, + 0x00800001, 0x00002001, 0x00802080, 0x00800081, + 0x00002001, 0x00002080, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002000, 0x00802080 +}; + +static const uint32_t SB5[64] = +{ + 0x00000100, 0x02080100, 0x02080000, 0x42000100, + 0x00080000, 0x00000100, 0x40000000, 0x02080000, + 0x40080100, 0x00080000, 0x02000100, 0x40080100, + 0x42000100, 0x42080000, 0x00080100, 0x40000000, + 0x02000000, 0x40080000, 0x40080000, 0x00000000, + 0x40000100, 0x42080100, 0x42080100, 0x02000100, + 0x42080000, 0x40000100, 0x00000000, 0x42000000, + 0x02080100, 0x02000000, 0x42000000, 0x00080100, + 0x00080000, 0x42000100, 0x00000100, 0x02000000, + 0x40000000, 0x02080000, 0x42000100, 0x40080100, + 0x02000100, 0x40000000, 0x42080000, 0x02080100, + 0x40080100, 0x00000100, 0x02000000, 0x42080000, + 0x42080100, 0x00080100, 0x42000000, 0x42080100, + 0x02080000, 0x00000000, 0x40080000, 0x42000000, + 0x00080100, 0x02000100, 0x40000100, 0x00080000, + 0x00000000, 0x40080000, 0x02080100, 0x40000100 +}; + +static const uint32_t SB6[64] = +{ + 0x20000010, 0x20400000, 0x00004000, 0x20404010, + 0x20400000, 0x00000010, 0x20404010, 0x00400000, + 0x20004000, 0x00404010, 0x00400000, 0x20000010, + 0x00400010, 0x20004000, 0x20000000, 0x00004010, + 0x00000000, 0x00400010, 0x20004010, 0x00004000, + 0x00404000, 0x20004010, 0x00000010, 0x20400010, + 0x20400010, 0x00000000, 0x00404010, 0x20404000, + 0x00004010, 0x00404000, 0x20404000, 0x20000000, + 0x20004000, 0x00000010, 0x20400010, 0x00404000, + 0x20404010, 0x00400000, 0x00004010, 0x20000010, + 0x00400000, 0x20004000, 0x20000000, 0x00004010, + 0x20000010, 0x20404010, 0x00404000, 0x20400000, + 0x00404010, 0x20404000, 0x00000000, 0x20400010, + 0x00000010, 0x00004000, 0x20400000, 0x00404010, + 0x00004000, 0x00400010, 0x20004010, 0x00000000, + 0x20404000, 0x20000000, 0x00400010, 0x20004010 +}; + +static const uint32_t SB7[64] = +{ + 0x00200000, 0x04200002, 0x04000802, 0x00000000, + 0x00000800, 0x04000802, 0x00200802, 0x04200800, + 0x04200802, 0x00200000, 0x00000000, 0x04000002, + 0x00000002, 0x04000000, 0x04200002, 0x00000802, + 0x04000800, 0x00200802, 0x00200002, 0x04000800, + 0x04000002, 0x04200000, 0x04200800, 0x00200002, + 0x04200000, 0x00000800, 0x00000802, 0x04200802, + 0x00200800, 0x00000002, 0x04000000, 0x00200800, + 0x04000000, 0x00200800, 0x00200000, 0x04000802, + 0x04000802, 0x04200002, 0x04200002, 0x00000002, + 0x00200002, 0x04000000, 0x04000800, 0x00200000, + 0x04200800, 0x00000802, 0x00200802, 0x04200800, + 0x00000802, 0x04000002, 0x04200802, 0x04200000, + 0x00200800, 0x00000000, 0x00000002, 0x04200802, + 0x00000000, 0x00200802, 0x04200000, 0x00000800, + 0x04000002, 0x04000800, 0x00000800, 0x00200002 +}; + +static const uint32_t SB8[64] = +{ + 0x10001040, 0x00001000, 0x00040000, 0x10041040, + 0x10000000, 0x10001040, 0x00000040, 0x10000000, + 0x00040040, 0x10040000, 0x10041040, 0x00041000, + 0x10041000, 0x00041040, 0x00001000, 0x00000040, + 0x10040000, 0x10000040, 0x10001000, 0x00001040, + 0x00041000, 0x00040040, 0x10040040, 0x10041000, + 0x00001040, 0x00000000, 0x00000000, 0x10040040, + 0x10000040, 0x10001000, 0x00041040, 0x00040000, + 0x00041040, 0x00040000, 0x10041000, 0x00001000, + 0x00000040, 0x10040040, 0x00001000, 0x00041040, + 0x10001000, 0x00000040, 0x10000040, 0x10040000, + 0x10040040, 0x10000000, 0x00040000, 0x10001040, + 0x00000000, 0x10041040, 0x00040040, 0x10000040, + 0x10040000, 0x10001000, 0x10001040, 0x00000000, + 0x10041040, 0x00041000, 0x00041000, 0x00001040, + 0x00001040, 0x00040040, 0x10000000, 0x10041000 +}; + +/* +* PC1: left and right halves bit-swap +*/ +static const uint32_t LHs[16] = +{ + 0x00000000, 0x00000001, 0x00000100, 0x00000101, + 0x00010000, 0x00010001, 0x00010100, 0x00010101, + 0x01000000, 0x01000001, 0x01000100, 0x01000101, + 0x01010000, 0x01010001, 0x01010100, 0x01010101 +}; + +static const uint32_t RHs[16] = +{ + 0x00000000, 0x01000000, 0x00010000, 0x01010000, + 0x00000100, 0x01000100, 0x00010100, 0x01010100, + 0x00000001, 0x01000001, 0x00010001, 0x01010001, + 0x00000101, 0x01000101, 0x00010101, 0x01010101, +}; + +/* +* Initial Permutation macro +*/ +#define DES_IP(X,Y) \ +{ \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T; \ + X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF; \ +} + +/* +* Final Permutation macro +*/ +#define DES_FP(X,Y) \ +{ \ + X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T; \ + Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF; \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ +} + +/* +* DES round macro +*/ +#define DES_ROUND(X,Y,I) \ +{ \ + T = (SK[I] ^ X); \ + Y ^= SB8[ (T ) & 0x3F ] ^ \ + SB6[ (T >> 8) & 0x3F ] ^ \ + SB4[ (T >> 16) & 0x3F ] ^ \ + SB2[ (T >> 24) & 0x3F ]; \ + \ + T = (SK[I+1] ^ ((X << 28) | (X >> 4))); \ + Y ^= SB7[ (T ) & 0x3F ] ^ \ + SB5[ (T >> 8) & 0x3F ] ^ \ + SB3[ (T >> 16) & 0x3F ] ^ \ + SB1[ (T >> 24) & 0x3F ]; \ +} + +// For each number between 0x0 and 0xF, this tells how many set bits there are +static const unsigned char DESParityTable[] = { 0x00,0x01,0x01,0x02,0x01,0x02,0x02,0x03,0x01,0x02,0x02,0x03,0x02,0x03,0x03,0x04 }; + + +// This function sets the parity on the DES key to be odd +// Test case: Halo, Tenchu, Dashboard, Splinter Cell 1 and 2, ... +void mbedtls_des_key_set_parity(unsigned char* Key, unsigned long KeyLenght) +{ + unsigned long i; + + for (i = 0; i < KeyLenght; i++) + { + if (!((DESParityTable[Key[i] >> 4] + DESParityTable[Key[i] & 0x0F]) % 2)) { + Key[i] = Key[i] ^ 0x01; + } + } +} + +void mbedtls_des_setkey(uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE]) +{ + int i; + uint32_t X, Y, T; + + GET_UINT32_BE(X, key, 0); + GET_UINT32_BE(Y, key, 4); + + /* + * Permuted Choice 1 + */ + T = ((Y >> 4) ^ X) & 0x0F0F0F0F; X ^= T; Y ^= (T << 4); + T = ((Y) ^ X) & 0x10101010; X ^= T; Y ^= (T); + + X = (LHs[(X) & 0xF] << 3) | (LHs[(X >> 8) & 0xF] << 2) + | (LHs[(X >> 16) & 0xF] << 1) | (LHs[(X >> 24) & 0xF]) + | (LHs[(X >> 5) & 0xF] << 7) | (LHs[(X >> 13) & 0xF] << 6) + | (LHs[(X >> 21) & 0xF] << 5) | (LHs[(X >> 29) & 0xF] << 4); + + Y = (RHs[(Y >> 1) & 0xF] << 3) | (RHs[(Y >> 9) & 0xF] << 2) + | (RHs[(Y >> 17) & 0xF] << 1) | (RHs[(Y >> 25) & 0xF]) + | (RHs[(Y >> 4) & 0xF] << 7) | (RHs[(Y >> 12) & 0xF] << 6) + | (RHs[(Y >> 20) & 0xF] << 5) | (RHs[(Y >> 28) & 0xF] << 4); + + X &= 0x0FFFFFFF; + Y &= 0x0FFFFFFF; + + /* + * calculate subkeys + */ + for (i = 0; i < 16; i++) + { + if (i < 2 || i == 8 || i == 15) + { + X = ((X << 1) | (X >> 27)) & 0x0FFFFFFF; + Y = ((Y << 1) | (Y >> 27)) & 0x0FFFFFFF; + } + else + { + X = ((X << 2) | (X >> 26)) & 0x0FFFFFFF; + Y = ((Y << 2) | (Y >> 26)) & 0x0FFFFFFF; + } + + *SK++ = ((X << 4) & 0x24000000) | ((X << 28) & 0x10000000) + | ((X << 14) & 0x08000000) | ((X << 18) & 0x02080000) + | ((X << 6) & 0x01000000) | ((X << 9) & 0x00200000) + | ((X >> 1) & 0x00100000) | ((X << 10) & 0x00040000) + | ((X << 2) & 0x00020000) | ((X >> 10) & 0x00010000) + | ((Y >> 13) & 0x00002000) | ((Y >> 4) & 0x00001000) + | ((Y << 6) & 0x00000800) | ((Y >> 1) & 0x00000400) + | ((Y >> 14) & 0x00000200) | ((Y) & 0x00000100) + | ((Y >> 5) & 0x00000020) | ((Y >> 10) & 0x00000010) + | ((Y >> 3) & 0x00000008) | ((Y >> 18) & 0x00000004) + | ((Y >> 26) & 0x00000002) | ((Y >> 24) & 0x00000001); + + *SK++ = ((X << 15) & 0x20000000) | ((X << 17) & 0x10000000) + | ((X << 10) & 0x08000000) | ((X << 22) & 0x04000000) + | ((X >> 2) & 0x02000000) | ((X << 1) & 0x01000000) + | ((X << 16) & 0x00200000) | ((X << 11) & 0x00100000) + | ((X << 3) & 0x00080000) | ((X >> 6) & 0x00040000) + | ((X << 15) & 0x00020000) | ((X >> 4) & 0x00010000) + | ((Y >> 2) & 0x00002000) | ((Y << 8) & 0x00001000) + | ((Y >> 14) & 0x00000808) | ((Y >> 9) & 0x00000400) + | ((Y) & 0x00000200) | ((Y << 7) & 0x00000100) + | ((Y >> 7) & 0x00000020) | ((Y >> 3) & 0x00000011) + | ((Y << 2) & 0x00000004) | ((Y >> 21) & 0x00000002); + } +} + +/* +* DES key schedule (56-bit, encryption) +*/ +void mbedtls_des_setkey_enc(mbedtls_des_context* ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE]) +{ + mbedtls_des_setkey(ctx->sk, key); +} + +/* +* DES-ECB block encryption/decryption +*/ +void mbedtls_des_crypt_ecb(mbedtls_des_context* ctx, + const unsigned char input[8], + unsigned char output[8], + unsigned long encrypt) +{ + int i; + uint32_t X, Y, T, *SK; + + SK = ctx->sk; + + GET_UINT32_BE(X, input, 0); + GET_UINT32_BE(Y, input, 4); + + DES_IP(X, Y); + + if (encrypt == MBEDTLS_DES_ENCRYPT) { + for (i = 0; i < 32; i += 4) + { + DES_ROUND(Y, X, i + 0); + DES_ROUND(X, Y, i + 2); + } + } + else { + for (i = 30; i > 0; i -= 4) + { + DES_ROUND(Y, X, i - 0); + DES_ROUND(X, Y, i - 2); + } + } + + DES_FP(Y, X); + + PUT_UINT32_BE(Y, output, 0); + PUT_UINT32_BE(X, output, 4); +} + +/* +* DES-CBC buffer encryption/decryption +*/ +int mbedtls_des_crypt_cbc(mbedtls_des_context* ctx, + unsigned long mode, + unsigned long length, + unsigned char iv[8], + const unsigned char* input, + unsigned char* output) +{ + int i, ret, num_des_blocks; + unsigned char temp[8]; + + ret = 0; + num_des_blocks = (length + 7) / 8; + + // The original code of ReactOS correctly checks that the input length is a multiple of a des_block (8 bytes) but the + // kernel doesn't and will encrypt up to block (lenght + 7) / 8. This means that we'll run the risk of reading some + // random bytes after the buffer end and/or touching invalid memory and crash. Because the real kernel does it, we'll + // allow this buggy behaviour for the sake of accuracy. + if (length % 8) { + ret = MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH; + } + + if (mode == MBEDTLS_DES_ENCRYPT) + { + while (num_des_blocks > 0) + { + for (i = 0; i < 8; i++) { + output[i] = (unsigned char)(input[i] ^ iv[i]); + } + + mbedtls_des_crypt_ecb(ctx, output, output, MBEDTLS_DES_ENCRYPT); + memcpy(iv, output, 8); + + input += 8; + output += 8; + num_des_blocks--; + } + } + else /* MBEDTLS_DES_DECRYPT */ + { + while (num_des_blocks > 0) + { + memcpy(temp, input, 8); + mbedtls_des_crypt_ecb(ctx, input, output, MBEDTLS_DES_DECRYPT); + + for (i = 0; i < 8; i++) { + output[i] = (unsigned char)(output[i] ^ iv[i]); + } + + memcpy(iv, temp, 8); + + input += 8; + output += 8; + num_des_blocks--; + } + } + + return ret; +} + +/* +* Triple-DES key schedule (168-bit, encryption) +*/ +void mbedtls_des3_set3key_enc(mbedtls_des3_context* ctx, + const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3]) +{ + mbedtls_des_setkey(ctx->sk, key); + mbedtls_des_setkey(ctx->sk + 32, key + 8); + mbedtls_des_setkey(ctx->sk + 64, key + 16); +} + +/* +* 3DES-ECB buffer encryption +*/ +void mbedtls_des3_encrypt_ecb(mbedtls_des3_context* ctx, + const unsigned char input[8], + unsigned char output[8]) +{ + int i; + uint32_t X, Y, T, *SK; + + SK = ctx->sk; + + GET_UINT32_BE(X, input, 0); + GET_UINT32_BE(Y, input, 4); + + DES_IP(X, Y); + + for (i = 0; i < 32; i += 4) + { + DES_ROUND(Y, X, i + 0); + DES_ROUND(X, Y, i + 2); + } + + for (i = 62; i > 32; i -= 4) + { + DES_ROUND(X, Y, i - 0); + DES_ROUND(Y, X, i - 2); + } + + for (i = 64; i < 96; i += 4) + { + DES_ROUND(Y, X, i + 0); + DES_ROUND(X, Y, i + 2); + } + + DES_FP(Y, X); + + PUT_UINT32_BE(Y, output, 0); + PUT_UINT32_BE(X, output, 4); +} + +/* +* 3DES-ECB buffer decryption +*/ +void mbedtls_des3_decrypt_ecb(mbedtls_des3_context* ctx, + const unsigned char input[8], + unsigned char output[8]) +{ + int i; + uint32_t X, Y, T, *SK; + + SK = ctx->sk; + + GET_UINT32_BE(X, input, 0); + GET_UINT32_BE(Y, input, 4); + + DES_IP(X, Y); + + for (i = 94; i > 64; i -= 4) + { + DES_ROUND(Y, X, i - 0); + DES_ROUND(X, Y, i - 2); + } + + for (i = 32; i < 64; i += 4) + { + DES_ROUND(X, Y, i + 0); + DES_ROUND(Y, X, i + 2); + } + + for (i = 30; i > 0; i -= 4) + { + DES_ROUND(Y, X, i - 0); + DES_ROUND(X, Y, i - 2); + } + + DES_FP(Y, X); + + PUT_UINT32_BE(Y, output, 0); + PUT_UINT32_BE(X, output, 4); +} + +void mbedtls_des3_crypt_ecb(mbedtls_des3_context* ctx, + const unsigned char input[8], + unsigned char output[8], + unsigned long encrypt) +{ + if (encrypt == MBEDTLS_DES_ENCRYPT) { + mbedtls_des3_encrypt_ecb(ctx, input, output); + } + else { + mbedtls_des3_decrypt_ecb(ctx, input, output); + } +} + +/* +* 3DES-CBC buffer encryption/decryption +*/ +int mbedtls_des3_crypt_cbc(mbedtls_des3_context* ctx, + unsigned long mode, + unsigned long length, + unsigned char iv[8], + const unsigned char *input, + unsigned char *output) +{ + int i, ret, num_des_blocks; + unsigned char temp[8]; + + ret = 0; + num_des_blocks = (length + 7) / 8; + + if (length % 8) { + ret = MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH; + } + + if (mode == MBEDTLS_DES_ENCRYPT) + { + while (num_des_blocks > 0) + { + for (i = 0; i < 8; i++) { + output[i] = (unsigned char)(input[i] ^ iv[i]); + } + + mbedtls_des3_encrypt_ecb(ctx, output, output); + memcpy(iv, output, 8); + + input += 8; + output += 8; + num_des_blocks--; + } + } + else /* MBEDTLS_DES_DECRYPT */ + { + while (num_des_blocks > 0) + { + memcpy(temp, input, 8); + mbedtls_des3_decrypt_ecb(ctx, input, output); + + for (i = 0; i < 8; i++) { + output[i] = (unsigned char)(output[i] ^ iv[i]); + } + + memcpy(iv, temp, 8); + + input += 8; + output += 8; + num_des_blocks--; + } + } + + return ret; +} diff --git a/src/common/crypto/EmuDes.h b/src/common/crypto/EmuDes.h new file mode 100644 index 000000000..db7a9c398 --- /dev/null +++ b/src/common/crypto/EmuDes.h @@ -0,0 +1,64 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef EMUDES_H +#define EMUDES_H + +#define MBEDTLS_DES_KEY_SIZE 8 + +#define MBEDTLS_DES_ENCRYPT 1 +#define MBEDTLS_DES_DECRYPT 0 + +#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -0x0032 /**< The data input has an invalid length. */ + +/** +* \brief DES context structure +*/ +typedef struct +{ + uint32_t sk[32]; /*!< DES subkeys */ +} +mbedtls_des_context; + +/** +* \brief Triple-DES context structure +*/ +typedef struct +{ + uint32_t sk[96]; /*!< 3DES subkeys */ +} +mbedtls_des3_context; + +void mbedtls_des_key_set_parity(unsigned char* Key, unsigned long KeyLenght); +void mbedtls_des_setkey_enc(mbedtls_des_context* ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE]); +void mbedtls_des_crypt_ecb(mbedtls_des_context* ctx, const unsigned char input[8], unsigned char output[8], unsigned long encrypt); +int mbedtls_des_crypt_cbc(mbedtls_des_context* ctx, unsigned long mode, unsigned long length, unsigned char iv[8], const unsigned char* input, unsigned char* output); +void mbedtls_des3_set3key_enc(mbedtls_des3_context* ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3]); +void mbedtls_des3_crypt_ecb(mbedtls_des3_context* ctx, const unsigned char input[8], unsigned char output[8], unsigned long encrypt); +int mbedtls_des3_crypt_cbc(mbedtls_des3_context* ctx, unsigned long mode, unsigned long length, unsigned char iv[8], const unsigned char *input, unsigned char *output); + +#endif EMUDES_H diff --git a/src/common/crypto/EmuRsa.cpp b/src/common/crypto/EmuRsa.cpp new file mode 100644 index 000000000..f7b151659 --- /dev/null +++ b/src/common/crypto/EmuRsa.cpp @@ -0,0 +1,196 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * (c) 2019 Jannik Vogel +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: +// verify_hash, RSApkcs1paddingtable and RSA_PUBLIC_KEY are from the +// file xboxlib.c of the xbedump tool (and that file only, GPLv2). +// https://github.com/XboxDev/xbedump/blob/master/xboxlib.c +// mbedtls_swap_endianness is extracted from mbedtls_mpi_read_binary used in the file bignum.h of ReactOS +// https://github.com/reactos/reactos + +// xboxlib.c license +/*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +/** +* \file bignum.h +* +* \brief Multi-precision integer library +* +* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved +* SPDX-License-Identifier: GPL-2.0 +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* This file is part of mbed TLS (https://tls.mbed.org) +*/ + +#define LOG_PREFIX CXBXR_MODULE::RSA + +#include "EmuRsa.h" +#include "core\kernel\support\Emu.h" // For EmuLog +#include "tomcrypt.h" +#include "tommath.h" + +#define CHK_MP_RET(x) do { int ret = (x); if (ret != MP_OKAY) return false; } while(0) + + +const unsigned char RSApkcs1paddingtable[3][16] = { + { 0x0F, 0x14,0x04,0x00,0x05,0x1A,0x02,0x03,0x0E,0x2B,0x05,0x06,0x09,0x30,0x21,0x30 }, + { 0x0D, 0x14,0x04,0x1A,0x02,0x03,0x0E,0x2B,0x05,0x06,0x07,0x30,0x1F,0x30,0x00,0x00 }, + { 0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } +}; + +// Move this to CxbxUtil.h if it's ever needed in other places of the emu as well +void mbedtls_swap_endianness(const unsigned char* in_buf, unsigned char* out_buf, size_t size) +{ + size_t i, j, n; + uint32_t* out_buf_uint = (uint32_t*)out_buf; + + memset(out_buf_uint, 0, size); + + for (n = 0; n < size; n++) + if (in_buf[n] != 0) + break; + + for (i = size, j = 0; i > n; i--, j++) { + out_buf_uint[j / 4] |= ((uint32_t)in_buf[i - 1]) << ((j % 4) << 3); + } +} + +void init_tom_lib() +{ + // NOTE: init_LTM has been deprecated in favor to crypt_mp_init("L"). However, in the latest master branch crypt_mp_init + // is still undefined. + static bool need_init = true; + if (need_init) { + init_LTM(); + need_init = false; + } +} + +bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD, + size_t a_size, size_t b_size, size_t c_size, size_t d_size) +{ + mp_int a, b, c, d; + CHK_MP_RET(mp_init(&a)); + CHK_MP_RET(mp_init(&b)); + CHK_MP_RET(mp_init(&c)); + CHK_MP_RET(mp_init(&d)); + CHK_MP_RET(mp_import(&b, 1, -1, b_size, 0, 0, pB)); + CHK_MP_RET(mp_import(&c, 1, -1, c_size, 0, 0, pC)); + CHK_MP_RET(mp_import(&d, 1, -1, d_size, 0, 0, pD)); + + CHK_MP_RET(mp_exptmod(&b, &c, &d, &a)); + + CHK_MP_RET(mp_export(pA, NULL, -1, a_size, 0, 0, &a)); + + return true; +} + +bool xbox_rsa_public(const unsigned char* in_buf, unsigned char* out_buf, RSA_PUBLIC_KEY key) +{ + rsa_key tom_key; + unsigned char in_buf_be[256] = { 0 }; + unsigned char out_buf_be[256] = { 0 }; + unsigned long out_len = 256; + unsigned char modulus_be[256] = { 0 }; + unsigned char exp_be[4] = { 0 }; + + // We must swap the data since libtom expects the data to be in big endian + mbedtls_swap_endianness (key.KeyData.Modulus, modulus_be, 256); + mbedtls_swap_endianness (key.KeyData.Exponent, exp_be, 4); + mbedtls_swap_endianness (in_buf, in_buf_be, 256); + if (rsa_set_key(modulus_be, 256, exp_be, 4, NULL, 0, &tom_key) != CRYPT_OK) { + EmuLog(LOG_LEVEL::WARNING, "Failed to load rsa key"); + return false; + } + if (rsa_exptmod(in_buf_be, 256, out_buf_be, &out_len, PK_PUBLIC, &tom_key) != CRYPT_OK) { + EmuLog(LOG_LEVEL::WARNING, "rsa_exptmod failed"); + return false; + } + mbedtls_swap_endianness(out_buf_be, out_buf, 256); + return true; +} + +bool verify_hash(const unsigned char* hash, const unsigned char* decryptBuffer, RSA_PUBLIC_KEY key) +{ + unsigned char cmphash[20]; + int a; + int zero_position = 20; + + // Convert Hash to "Big-Endian Format" + for (a = 0;a<20;a++) cmphash[a] = hash[19 - a]; + + // Compare if the Hash Results (first 20 Bytes) are the same + if (memcmp(decryptBuffer, cmphash, 20) != 0) return false; + + unsigned char *pkcspad; + for (int tableIndex = 0; RSApkcs1paddingtable[tableIndex][0] != 0; tableIndex++) { + + pkcspad = (unsigned char*)RSApkcs1paddingtable[tableIndex]; + int difference = memcmp(pkcspad + 1, &decryptBuffer[20], *pkcspad); + + if (!difference) + { + zero_position = *pkcspad + 20; + break; + } + + } + + // Padding checking , xbox does exactly the same + + if (decryptBuffer[zero_position] != 0x00) return false; + + if (decryptBuffer[key.KeyData.ModulusSize] != 0x00) return false; + + if (decryptBuffer[key.KeyData.ModulusSize - 1] != 0x01) return false; + + for (unsigned int i = zero_position + 1; i < (key.KeyData.ModulusSize - 1); i++) { + if (decryptBuffer[i] != 0xff) return false; + } + + return true; +} diff --git a/src/CxbxKrnl/EmuRsa.h b/src/common/crypto/EmuRsa.h similarity index 51% rename from src/CxbxKrnl/EmuRsa.h rename to src/common/crypto/EmuRsa.h index 82f6402ee..2faef42cf 100644 --- a/src/CxbxKrnl/EmuRsa.h +++ b/src/common/crypto/EmuRsa.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->EmuRsa.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -26,7 +17,7 @@ // * If not, write to the Free Software Foundation, Inc., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * -// * (c) 2018 ergo720 +// * (c) 2018-2019 ergo720 // * // * All rights reserved // * @@ -35,28 +26,30 @@ #ifndef EMURSA_H #define EMURSA_H +#include // For size_t + #pragma pack(4) -typedef struct _RSA_PUBLIC_KEY +typedef union _RSA_PUBLIC_KEY { - union - { - unsigned char Default[284]; - struct { - char Magic[4]; // "RSA1" - unsigned int Bloblen; // 264 (Modulus + Exponent + Modulussize) - unsigned char Bitlen[4]; // 2048 - unsigned int ModulusSize; // 255 (bytes in the Modulus) - unsigned char Exponent[4]; - unsigned char Modulus[256]; // Bit endian style - unsigned char Unknown[8]; // ? - }KeyData; - }; + unsigned char Default[284]; + struct { + char Magic[4]; // "RSA1" + unsigned int Bloblen; // 264 (Modulus + Exponent + Modulussize) + unsigned char Bitlen[4]; // 2048 + unsigned int ModulusSize; // 255 (bytes in the Modulus) + unsigned char Exponent[4]; // Public exponent + unsigned char Modulus[256]; // Bit endian style + unsigned char Unknown[8]; // ? + }KeyData; } RSA_PUBLIC_KEY; #pragma pack() -void RSAdecrypt(unsigned char* c_number, unsigned char* cryptbuffer, RSA_PUBLIC_KEY key); -bool Verifyhash(unsigned char* hash, unsigned char* decryptBuffer, RSA_PUBLIC_KEY key); +void init_tom_lib(); +bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD, + size_t a_size, size_t b_size, size_t c_size, size_t d_size); +bool xbox_rsa_public(const unsigned char* in_buf, unsigned char* out_buf, RSA_PUBLIC_KEY key); +bool verify_hash(const unsigned char* hash, const unsigned char* decryptBuffer, RSA_PUBLIC_KEY key); #endif diff --git a/src/CxbxKrnl/EmuSha.cpp b/src/common/crypto/EmuSha.cpp similarity index 95% rename from src/CxbxKrnl/EmuSha.cpp rename to src/common/crypto/EmuSha.cpp index 0734f69d2..caef45264 100644 --- a/src/CxbxKrnl/EmuSha.cpp +++ b/src/common/crypto/EmuSha.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->EmuSha.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -52,7 +43,7 @@ A million repetitions of "a" /* #define LITTLE_ENDIAN * This should be #define'd already, if true. */ /* #define SHA1HANDSOFF * Copies data before messing with it. */ -// Acknowledgment: see above +// Acknowledgment: Steve Reid // https://github.com/clibs/sha1 #define SHA1HANDSOFF diff --git a/src/CxbxKrnl/EmuSha.h b/src/common/crypto/EmuSha.h similarity index 80% rename from src/CxbxKrnl/EmuSha.h rename to src/common/crypto/EmuSha.h index 9398af8a5..de5dd2fe3 100644 --- a/src/CxbxKrnl/EmuSha.h +++ b/src/common/crypto/EmuSha.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->EmuSha.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/CxbxKrnl/LibRc4.cpp b/src/common/crypto/LibRc4.cpp similarity index 100% rename from src/CxbxKrnl/LibRc4.cpp rename to src/common/crypto/LibRc4.cpp diff --git a/src/CxbxKrnl/LibRc4.h b/src/common/crypto/LibRc4.h similarity index 100% rename from src/CxbxKrnl/LibRc4.h rename to src/common/crypto/LibRc4.h diff --git a/src/common/input/Button.cpp b/src/common/input/Button.cpp new file mode 100644 index 000000000..4088a65b6 --- /dev/null +++ b/src/common/input/Button.cpp @@ -0,0 +1,82 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "Button.h" +#include "InputWindow.h" +#include "layout_xbox_controller.h" // TODO: Needs a better fix for custom input device support. +#include "..\..\gui\ResCxbx.h" + + +void Button::EnableButton(bool enable) const +{ + EnableWindow(m_button_hwnd, enable); +} + +void Button::UpdateText(const char* text) const +{ + SendMessage(m_button_hwnd, WM_SETTEXT, 0, reinterpret_cast(text)); +} + +void Button::ClearText() const +{ + SendMessage(m_button_hwnd, WM_SETTEXT, 0, reinterpret_cast("")); +} + +void Button::GetText(char* const text, size_t size) const +{ + SendMessage(m_button_hwnd, WM_GETTEXT, size, reinterpret_cast(text)); +} + +std::string Button::GetName(int api, int idx) const +{ + assert(api == XINPUT_DEFAULT || api == DINPUT_DEFAULT); + return button_xbox_ctrl_names[idx][api]; +} + +LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + switch (uMsg) + { + // Remove the window subclass when this window is destroyed + case WM_NCDESTROY: { + RemoveWindowSubclass(hWnd, ButtonSubclassProc, uIdSubclass); + } + break; + + case WM_RBUTTONDOWN: { + reinterpret_cast(dwRefData)->ClearText(); + g_InputWindow->UpdateProfile(std::string(), BUTTON_CLEAR); + if (reinterpret_cast(dwRefData)->GetId() == IDC_SET_MOTOR) { + g_InputWindow->UpdateProfile(std::string(), RUMBLE_CLEAR); + } + } + break; + + } + + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} diff --git a/src/CxbxKrnl/EmuKrnlKi.h b/src/common/input/Button.h similarity index 51% rename from src/CxbxKrnl/EmuKrnlKi.h rename to src/common/input/Button.h index 47e304dd8..387d2fae0 100644 --- a/src/CxbxKrnl/EmuKrnlKi.h +++ b/src/common/input/Button.h @@ -1,14 +1,7 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->src->CxbxKrnl->EmuKrnlKi.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -26,27 +19,39 @@ // * If not, write to the Free Software Foundation, Inc., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * -// * (c) 2018 Patrick van Logchem +// * (c) 2019 ergo720 // * // * All rights reserved // * // ****************************************************************** + #pragma once -#define KiLockDispatcherDatabase(OldIrql) \ - *(OldIrql) = KeRaiseIrqlToDpcLevel() +#include "windows.h" +#include +#include -#define KiLockApcQueue(Thread, OldIrql) \ - *(OldIrql) = KeRaiseIrqlToSynchLevel() +#define XBOX_CTRL_NUM_BUTTONS 25 -#define KiUnlockApcQueue(Thread, OldIrql) \ - KfLowerIrql((OldIrql)) -#define KiRemoveTreeTimer(Timer) \ - (Timer)->Header.Inserted = FALSE; \ - RemoveEntryList(&(Timer)->TimerListEntry) +/* Represents the gui buttons of the xbox device currently being configured */ +class Button +{ +public: + Button(int id, int index, HWND hwnd) : m_id(id), m_index(index), m_button_hwnd(GetDlgItem(hwnd, m_id)) {}; + void EnableButton(bool enable) const; + void UpdateText(const char* text) const; + void ClearText() const; + void GetText(char* const text, size_t size) const; + std::string GetName(int api, int idx) const; + int GetId() const { return m_id; } + int GetIndex() const { return m_index; } -xboxkrnl::BOOLEAN KiInsertTreeTimer( - IN xboxkrnl::PKTIMER Timer, - IN xboxkrnl::LARGE_INTEGER Interval -); \ No newline at end of file + +private: + int m_id; + int m_index; + HWND m_button_hwnd; +}; + +LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); diff --git a/src/common/input/DInputKeyboardCodes.h b/src/common/input/DInputKeyboardCodes.h new file mode 100644 index 000000000..9caf7c2b2 --- /dev/null +++ b/src/common/input/DInputKeyboardCodes.h @@ -0,0 +1,317 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#ifndef DIK_PREVTRACK +// Not defined by MinGW +#define DIK_PREVTRACK 0x90 +#endif + +{DIK_A, "A"}, { DIK_B, "B" }, { DIK_C, "C" }, { DIK_D, "D" }, { DIK_E, "E" }, { DIK_F, "F" }, { DIK_G, "G" }, +{ DIK_H, "H" }, { DIK_I, "I" }, { DIK_J, "J" }, { DIK_K, "K" }, { DIK_L, "L" }, { DIK_M, "M" }, +{ DIK_N, "N" }, { DIK_O, "O" }, { DIK_P, "P" }, { DIK_Q, "Q" }, { DIK_R, "R" }, { DIK_S, "S" }, +{ DIK_T, "T" }, { DIK_U, "U" }, { DIK_V, "V" }, { DIK_W, "W" }, { DIK_X, "X" }, { DIK_Y, "Y" }, +{ DIK_Z, "Z" }, { DIK_0, "0" }, { DIK_1, "1" }, { DIK_2, "2" }, { DIK_3, "3" }, { DIK_4, "4" }, +{ DIK_5, "5" }, { DIK_6, "6" }, { DIK_7, "7" }, { DIK_8, "8" }, { DIK_9, "9" }, { DIK_UP, "UP" }, +{ DIK_DOWN, "DOWN" }, { DIK_LEFT, "LEFT" }, { DIK_RIGHT, "RIGHT" }, { DIK_ABNT_C1, "ABNT_C1" }, +{ DIK_ABNT_C2, "ABNT_C2" }, { DIK_ADD, "ADD" }, { DIK_APOSTROPHE, "APOSTROPHE" }, { DIK_APPS, "APPS" }, +{ DIK_AT, "AT" }, { DIK_AX, "AX" }, { DIK_BACK, "BACK" }, { DIK_BACKSLASH, "BACKSLASH" }, +{ DIK_CALCULATOR, "CALCULATOR" }, { DIK_CAPITAL, "CAPITAL" }, { DIK_COLON, "COLON" }, +{ DIK_COMMA, "COMMA" }, { DIK_CONVERT, "CONVERT" }, { DIK_DECIMAL, "DECIMAL" }, +{ DIK_DELETE, "DELETE" }, { DIK_DIVIDE, "DIVIDE" }, { DIK_EQUALS, "EQUALS" }, { DIK_ESCAPE, "ESCAPE" }, +{ DIK_F1, "F1" }, { DIK_F2, "F2" }, { DIK_F3, "F3" }, { DIK_F4, "F4" }, { DIK_F5, "F5" }, { DIK_F6, "F6" }, +{ DIK_F7, "F7" }, { DIK_F8, "F8" }, { DIK_F9, "F9" }, { DIK_F10, "F10" }, { DIK_F11, "F11" }, +{ DIK_F12, "F12" }, { DIK_F13, "F13" }, { DIK_F14, "F14" }, { DIK_F15, "F15" }, { DIK_GRAVE, "GRAVE" }, +{ DIK_HOME, "HOME" }, { DIK_END, "END" }, { DIK_INSERT, "INSERT" }, { DIK_KANA, "KANA" }, +{ DIK_KANJI, "KANJI" }, { DIK_MAIL, "MAIL" }, { DIK_MEDIASELECT, "MEDIASELECT" }, +{ DIK_MEDIASTOP, "MEDIASTOP" }, { DIK_MINUS, "MINUS" }, { DIK_MULTIPLY, "MULTIPLY" }, +{ DIK_MUTE, "MUTE" }, { DIK_MYCOMPUTER, "MYCOMPUTER" }, { DIK_NEXTTRACK, "NEXTTRACK" }, +{ DIK_NOCONVERT, "NOCONVERT" }, { DIK_NUMLOCK, "NUMLOCK" }, { DIK_NUMPAD0, "NUMPAD0" }, +{ DIK_NUMPAD1, "NUMPAD1" }, { DIK_NUMPAD2, "NUMPAD2" }, { DIK_NUMPAD3, "NUMPAD3" }, +{ DIK_NUMPAD4, "NUMPAD4" }, { DIK_NUMPAD5, "NUMPAD5" }, { DIK_NUMPAD6, "NUMPAD6" }, +{ DIK_NUMPAD7, "NUMPAD7" }, { DIK_NUMPAD8, "NUMPAD8" }, { DIK_NUMPAD9, "NUMPAD9" }, +{ DIK_NUMPADCOMMA, "NUMPADCOMMA" }, { DIK_NUMPADENTER, "NUMPADENTER" }, +{ DIK_NUMPADEQUALS, "NUMPADEQUALS" }, { DIK_OEM_102, "OEM_102" }, { DIK_PAUSE, "PAUSE" }, +{ DIK_PERIOD, "PERIOD" }, { DIK_PLAYPAUSE, "PLAYPAUSE" }, { DIK_POWER, "POWER" }, +{ DIK_PREVTRACK, "PREVTRACK" }, { DIK_PRIOR, "PRIOR" }, { DIK_NEXT, "NEXT" }, { DIK_RETURN, "RETURN" }, +{ DIK_LBRACKET, "LBRACKET" }, { DIK_RBRACKET, "RBRACKET" }, { DIK_LCONTROL, "LCONTROL" }, +{ DIK_RCONTROL, "RCONTROL" }, { DIK_LMENU, "LMENU" }, { DIK_RMENU, "RMENU" }, { DIK_LSHIFT, "LSHIFT" }, +{ DIK_RSHIFT, "RSHIFT" }, { DIK_LWIN, "LWIN" }, { DIK_RWIN, "RWIN" }, { DIK_SCROLL, "SCROLL" }, +{ DIK_SEMICOLON, "SEMICOLON" }, { DIK_SLASH, "SLASH" }, { DIK_SLEEP, "SLEEP" }, { DIK_SPACE, "SPACE" }, +{ DIK_STOP, "STOP" }, { DIK_SUBTRACT, "SUBTRACT" }, { DIK_SYSRQ, "SYSRQ" }, { DIK_TAB, "TAB" }, +{ DIK_UNDERLINE, "UNDERLINE" }, { DIK_UNLABELED, "UNLABELED" }, { DIK_VOLUMEDOWN, "VOLUMEDOWN" }, +{ DIK_VOLUMEUP, "VOLUMEUP" }, { DIK_WAKE, "WAKE" }, { DIK_WEBBACK, "WEBBACK" }, +{ DIK_WEBFAVORITES, "WEBFAVORITES" }, { DIK_WEBFORWARD, "WEBFORWARD" }, { DIK_WEBHOME, "WEBHOME" }, +{ DIK_WEBREFRESH, "WEBREFRESH" }, { DIK_WEBSEARCH, "WEBSEARCH" }, { DIK_WEBSTOP, "WEBSTOP" }, +{ DIK_YEN, "YEN" }, + +// Sdl keyboard key codes I have prepared when, in the future, we'll use sdl to handle the keyboard +/* +{ "0", SDL_SCANCODE_0 }, +{ "1", SDL_SCANCODE_1 }, +{ "2", SDL_SCANCODE_2 }, +{ "3", SDL_SCANCODE_3 }, +{ "4", SDL_SCANCODE_4 }, +{ "5", SDL_SCANCODE_5 }, +{ "6", SDL_SCANCODE_6 }, +{ "7", SDL_SCANCODE_7 }, +{ "8", SDL_SCANCODE_8 }, +{ "9", SDL_SCANCODE_9 }, +{ "A", SDL_SCANCODE_A }, +{ "AC Back", SDL_SCANCODE_AC_BACK }, +{ "AC Bookmarks", SDL_SCANCODE_AC_BOOKMARKS }, +{ "AC Forward", SDL_SCANCODE_AC_FORWARD }, +{ "AC Home", SDL_SCANCODE_AC_HOME }, +{ "AC Refresh", SDL_SCANCODE_AC_REFRESH }, +{ "AC Search", SDL_SCANCODE_AC_SEARCH }, +{ "AC Stop", SDL_SCANCODE_AC_STOP }, +{ "Again", SDL_SCANCODE_AGAIN }, +{ "AltErase", SDL_SCANCODE_ALTERASE }, +{ "'", SDL_SCANCODE_APOSTROPHE }, +{ "Application", SDL_SCANCODE_APPLICATION }, +{ "AudioMute", SDL_SCANCODE_AUDIOMUTE }, +{ "AudioNext", SDL_SCANCODE_AUDIONEXT }, +{ "AudioPlay", SDL_SCANCODE_AUDIOPLAY }, +{ "AudioPrev", SDL_SCANCODE_AUDIOPREV }, +{ "AudioStop", SDL_SCANCODE_AUDIOSTOP }, +{ "B", SDL_SCANCODE_B }, +{ "\\", SDL_SCANCODE_BACKSLASH }, +{ "Backspace", SDL_SCANCODE_BACKSPACE }, +{ "BrightnessDown", SDL_SCANCODE_BRIGHTNESSDOWN }, +{ "BrightnessUp", SDL_SCANCODE_BRIGHTNESSUP }, +{ "C", SDL_SCANCODE_C }, +{ "Calculator", SDL_SCANCODE_CALCULATOR }, +{ "Cancel", SDL_SCANCODE_CANCEL }, +{ "CapsLock", SDL_SCANCODE_CAPSLOCK }, +{ "Clear", SDL_SCANCODE_CLEAR }, +{ "ClearAgain", SDL_SCANCODE_CLEARAGAIN }, +{ ",", SDL_SCANCODE_COMMA }, +{ "Computer", SDL_SCANCODE_COMPUTER }, +{ "Copy", SDL_SCANCODE_COPY }, +{ "CrSel", SDL_SCANCODE_CRSEL }, +{ "MoneySubUnit", SDL_SCANCODE_CURRENCYSUBUNIT }, +{ "MoneyUnit", SDL_SCANCODE_CURRENCYUNIT }, +{ "Cut", SDL_SCANCODE_CUT }, +{ "D", SDL_SCANCODE_D }, +{ "DecimalSep", SDL_SCANCODE_DECIMALSEPARATOR }, +{ "Delete", SDL_SCANCODE_DELETE }, +{ "DisplaySwitch", SDL_SCANCODE_DISPLAYSWITCH }, +{ "Down", SDL_SCANCODE_DOWN }, +{ "E", SDL_SCANCODE_E }, +{ "Eject", SDL_SCANCODE_EJECT }, +{ "End", SDL_SCANCODE_END }, +{ "=", SDL_SCANCODE_EQUALS }, +{ "Escape", SDL_SCANCODE_ESCAPE }, +{ "Execute", SDL_SCANCODE_EXECUTE }, +{ "ExSel", SDL_SCANCODE_EXSEL }, +{ "F", SDL_SCANCODE_F }, +{ "F1", SDL_SCANCODE_F1 }, +{ "F10", SDL_SCANCODE_F10 }, +{ "F11", SDL_SCANCODE_F11 }, +{ "F12", SDL_SCANCODE_F12 }, +{ "F13", SDL_SCANCODE_F13 }, +{ "F14", SDL_SCANCODE_F14 }, +{ "F15", SDL_SCANCODE_F15 }, +{ "F16", SDL_SCANCODE_F16 }, +{ "F17", SDL_SCANCODE_F17 }, +{ "F18", SDL_SCANCODE_F18 }, +{ "F19", SDL_SCANCODE_F19 }, +{ "F2", SDL_SCANCODE_F2 }, +{ "F20", SDL_SCANCODE_F20 }, +{ "F21", SDL_SCANCODE_F21 }, +{ "F22", SDL_SCANCODE_F22 }, +{ "F23", SDL_SCANCODE_F23 }, +{ "F24", SDL_SCANCODE_F24 }, +{ "F3", SDL_SCANCODE_F3 }, +{ "F4", SDL_SCANCODE_F4 }, +{ "F5", SDL_SCANCODE_F5 }, +{ "F6", SDL_SCANCODE_F6 }, +{ "F7", SDL_SCANCODE_F7 }, +{ "F8", SDL_SCANCODE_F8 }, +{ "F9", SDL_SCANCODE_F9 }, +{ "Find", SDL_SCANCODE_FIND }, +{ "G", SDL_SCANCODE_G }, +{ "`", SDL_SCANCODE_GRAVE }, +{ "H", SDL_SCANCODE_H }, +{ "Help", SDL_SCANCODE_HELP }, +{ "Home", SDL_SCANCODE_HOME }, +{ "I", SDL_SCANCODE_I }, +{ "Insert", SDL_SCANCODE_INSERT }, +{ "J", SDL_SCANCODE_J }, +{ "K", SDL_SCANCODE_K }, +{ "KBDIllumDown", SDL_SCANCODE_KBDILLUMDOWN }, +{ "KBDIllumToggle", SDL_SCANCODE_KBDILLUMTOGGLE }, +{ "KBDIllumUp", SDL_SCANCODE_KBDILLUMUP }, +{ "KP 0", SDL_SCANCODE_KP_0 }, +{ "KP 00", SDL_SCANCODE_KP_00 }, +{ "KP 000", SDL_SCANCODE_KP_000 }, +{ "KP 1", SDL_SCANCODE_KP_1 }, +{ "KP 2", SDL_SCANCODE_KP_2 }, +{ "KP 3", SDL_SCANCODE_KP_3 }, +{ "KP 4", SDL_SCANCODE_KP_4 }, +{ "KP 5", SDL_SCANCODE_KP_5 }, +{ "KP 6", SDL_SCANCODE_KP_6 }, +{ "KP 7", SDL_SCANCODE_KP_7 }, +{ "KP 8", SDL_SCANCODE_KP_8 }, +{ "KP 9", SDL_SCANCODE_KP_9 }, +{ "KP A", SDL_SCANCODE_KP_A }, +{ "KP &", SDL_SCANCODE_KP_AMPERSAND }, +{ "KP @", SDL_SCANCODE_KP_AT }, +{ "KP B", SDL_SCANCODE_KP_B }, +{ "KP Backspace", SDL_SCANCODE_KP_BACKSPACE }, +{ "KP Binary", SDL_SCANCODE_KP_BINARY }, +{ "KP C", SDL_SCANCODE_KP_C }, +{ "KP Clear", SDL_SCANCODE_KP_CLEAR }, +{ "KP ClearEntry", SDL_SCANCODE_KP_CLEARENTRY }, +{ "KP :", SDL_SCANCODE_KP_COLON }, +{ "KP ,", SDL_SCANCODE_KP_COMMA }, +{ "KP D", SDL_SCANCODE_KP_D }, +{ "KP &&", SDL_SCANCODE_KP_DBLAMPERSAND }, +{ "KP ||", SDL_SCANCODE_KP_DBLVERTICALBAR }, +{ "KP Decimal", SDL_SCANCODE_KP_DECIMAL }, +{ "KP /", SDL_SCANCODE_KP_DIVIDE }, +{ "KP E", SDL_SCANCODE_KP_E }, +{ "KP Enter", SDL_SCANCODE_KP_ENTER }, +{ "KP =",SDL_SCANCODE_KP_EQUALS }, +{ "KP = (AS400)", SDL_SCANCODE_KP_EQUALSAS400 }, +{ "KP !", SDL_SCANCODE_KP_EXCLAM }, +{ "KP F", SDL_SCANCODE_KP_F }, +{ "KP >", SDL_SCANCODE_KP_GREATER }, +{ "KP #", SDL_SCANCODE_KP_HASH }, +{ "KP Hex", SDL_SCANCODE_KP_HEXADECIMAL }, +{ "KP {", SDL_SCANCODE_KP_LEFTBRACE }, +{ "KP (", SDL_SCANCODE_KP_LEFTPAREN }, +{ "KP <", SDL_SCANCODE_KP_LESS }, +{ "KP Add", SDL_SCANCODE_KP_MEMADD }, +{ "KP Clear", SDL_SCANCODE_KP_MEMCLEAR }, +{ "KP Divide", SDL_SCANCODE_KP_MEMDIVIDE }, +{ "KP Multiply", SDL_SCANCODE_KP_MEMMULTIPLY }, +{ "KP Recall", SDL_SCANCODE_KP_MEMRECALL }, +{ "KP Store", SDL_SCANCODE_KP_MEMSTORE }, +{ "KP Subtract", SDL_SCANCODE_KP_MEMSUBTRACT }, +{ "KP -", SDL_SCANCODE_KP_MINUS }, +{ "KP *", SDL_SCANCODE_KP_MULTIPLY }, +{ "KP Octal", SDL_SCANCODE_KP_OCTAL }, +{ "KP %", SDL_SCANCODE_KP_PERCENT }, +{ "KP .", SDL_SCANCODE_KP_PERIOD }, +{ "KP +", SDL_SCANCODE_KP_PLUS }, +{ "KP +/-", SDL_SCANCODE_KP_PLUSMINUS }, +{ "KP ^", SDL_SCANCODE_KP_POWER }, +{ "KP }", SDL_SCANCODE_KP_RIGHTBRACE }, +{ "KP )", SDL_SCANCODE_KP_RIGHTPAREN }, +{ "KP Space", SDL_SCANCODE_KP_SPACE }, +{ "KP Tab", SDL_SCANCODE_KP_TAB }, +{ "KP |", SDL_SCANCODE_KP_VERTICALBAR }, +{ "KP XOR", SDL_SCANCODE_KP_XOR }, +{ "L", SDL_SCANCODE_L }, +{ "Left Alt", SDL_SCANCODE_LALT }, +{ "Left Ctrl", SDL_SCANCODE_LCTRL }, +{ "Left", SDL_SCANCODE_LEFT }, +{ "[", SDL_SCANCODE_LEFTBRACKET }, +{ "Left GUI", SDL_SCANCODE_LGUI }, +{ "Left Shift", SDL_SCANCODE_LSHIFT }, +{ "M", SDL_SCANCODE_M }, +{ "Mail", SDL_SCANCODE_MAIL }, +{ "MediaSelect", SDL_SCANCODE_MEDIASELECT }, +{ "Menu", SDL_SCANCODE_MENU }, +{ "-", SDL_SCANCODE_MINUS }, +{ "ModeSwitch", SDL_SCANCODE_MODE }, +{ "Mute", SDL_SCANCODE_MUTE }, +{ "N", SDL_SCANCODE_N }, +{ "Numlock", SDL_SCANCODE_NUMLOCKCLEAR }, +{ "O", SDL_SCANCODE_O }, +{ "Oper", SDL_SCANCODE_OPER }, +{ "Out", SDL_SCANCODE_OUT }, +{ "P", SDL_SCANCODE_P }, +{ "PageDown", SDL_SCANCODE_PAGEDOWN }, +{ "PageUp", SDL_SCANCODE_PAGEUP }, +{ "Paste", SDL_SCANCODE_PASTE }, +{ "Pause", SDL_SCANCODE_PAUSE }, +{ ".", SDL_SCANCODE_PERIOD }, +{ "Power", SDL_SCANCODE_POWER }, +{ "PrintScreen", SDL_SCANCODE_PRINTSCREEN }, +{ "Prior", SDL_SCANCODE_PRIOR }, +{ "Q", SDL_SCANCODE_Q }, +{ "R", SDL_SCANCODE_R }, +{ "Right Alt", SDL_SCANCODE_RALT }, +{ "Right Ctrl", SDL_SCANCODE_RCTRL }, +{ "Return", SDL_SCANCODE_RETURN }, +{ "Return", SDL_SCANCODE_RETURN2 }, +{ "Right GUI", SDL_SCANCODE_RGUI }, +{ "Right", SDL_SCANCODE_RIGHT }, +{ "]", SDL_SCANCODE_RIGHTBRACKET }, +{ "Right Shift", SDL_SCANCODE_RSHIFT }, +{ "S", SDL_SCANCODE_S }, +{ "ScrollLock", SDL_SCANCODE_SCROLLLOCK }, +{ "Select", SDL_SCANCODE_SELECT }, +{ ";", SDL_SCANCODE_SEMICOLON }, +{ "Separator", SDL_SCANCODE_SEPARATOR }, +{ "/", SDL_SCANCODE_SLASH }, +{ "Sleep", SDL_SCANCODE_SLEEP }, +{ "Space", SDL_SCANCODE_SPACE }, +{ "Stop", SDL_SCANCODE_STOP }, +{ "SysReq", SDL_SCANCODE_SYSREQ }, +{ "T", SDL_SCANCODE_T }, +{ "Tab", SDL_SCANCODE_TAB }, +{ "ThousandsSep", SDL_SCANCODE_THOUSANDSSEPARATOR }, +{ "U", SDL_SCANCODE_U }, +{ "Undo", SDL_SCANCODE_UNDO }, +{ "", SDL_SCANCODE_UNKNOWN }, +{ "Up", SDL_SCANCODE_UP }, +{ "V", SDL_SCANCODE_V }, +{ "VolumeDown", SDL_SCANCODE_VOLUMEDOWN }, +{ "VolumeUp", SDL_SCANCODE_VOLUMEUP }, +{ "W", SDL_SCANCODE_W }, +{ "WWW", SDL_SCANCODE_WWW }, +{ "X", SDL_SCANCODE_X }, +{ "Y", SDL_SCANCODE_Y }, +{ "Z", SDL_SCANCODE_Z }, +{ "International1", SDL_SCANCODE_INTERNATIONAL1 }, +{ "International2", SDL_SCANCODE_INTERNATIONAL2 }, +{ "International3", SDL_SCANCODE_INTERNATIONAL3 }, +{ "International4", SDL_SCANCODE_INTERNATIONAL4 }, +{ "International5", SDL_SCANCODE_INTERNATIONAL5 }, +{ "International6", SDL_SCANCODE_INTERNATIONAL6 }, +{ "International7", SDL_SCANCODE_INTERNATIONAL7 }, +{ "International8", SDL_SCANCODE_INTERNATIONAL8 }, +{ "International9", SDL_SCANCODE_INTERNATIONAL9 }, +{ "Lang1", SDL_SCANCODE_LANG1 }, +{ "Lang2", SDL_SCANCODE_LANG2 }, +{ "Lang3", SDL_SCANCODE_LANG3 }, +{ "Lang4", SDL_SCANCODE_LANG4 }, +{ "Lang5", SDL_SCANCODE_LANG5 }, +{ "Lang6", SDL_SCANCODE_LANG6 }, +{ "Lang7", SDL_SCANCODE_LANG7 }, +{ "Lang8", SDL_SCANCODE_LANG8 }, +{ "Lang9", SDL_SCANCODE_LANG9 }, +//{ "Caps Lk", SDL_SCANCODE_LOCKINGCAPSLOCK }, +//{ "Num Lk", SDL_SCANCODE_LOCKINGNUMLOCK }, +//{ "Scr Lk", SDL_SCANCODE_LOCKINGSCROLLLOCK }, +{ "NonUsBacklash", SDL_SCANCODE_NONUSBACKSLASH }, +{ "NonUsHash", SDL_SCANCODE_NONUSHASH }, +*/ diff --git a/src/common/input/DInputKeyboardMouse.cpp b/src/common/input/DInputKeyboardMouse.cpp new file mode 100644 index 000000000..15debc8af --- /dev/null +++ b/src/common/input/DInputKeyboardMouse.cpp @@ -0,0 +1,262 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Copyright 2010 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Derived from DInputKeyboardMouse.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +#define LOG_PREFIX CXBXR_MODULE::DINP + +#include "DInputKeyboardMouse.h" +#include "InputManager.h" +#include "core\kernel\support\Emu.h" + +// Unfortunately, sdl doesn't seem to be able to capture keyboard/mouse input from windows it didn't create (we currently use +// win32 for that). So unless we create sdl windows, we will have to keep dinput around to handle keyboard/mouse input. + +namespace DInput +{ + static const struct kb_keys { + const uint8_t code; + const char* const name; + } + named_keys[] = { +#include "DInputKeyboardCodes.h" + }; + + bool bKbMoEnumerated = false; + + void InitKeyboardMouse(IDirectInput8* idi8) + { + // From Dolphin: "mouse and keyboard are a combined device, to allow shift+click and stuff + // if that's dumb, I will make a VirtualDevice class that just uses ranges of inputs/outputs from + // other devices so there can be a separated Keyboard and mouse, as well as combined KeyboardMouse" + + LPDIRECTINPUTDEVICE8 kb_device = nullptr; + //LPDIRECTINPUTDEVICE8 mo_device = nullptr; + + if (SUCCEEDED(idi8->CreateDevice(GUID_SysKeyboard, &kb_device, nullptr)) && + SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard)) && + SUCCEEDED(kb_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) //&& + //SUCCEEDED(idi8->CreateDevice(GUID_SysMouse, &mo_device, nullptr)) && + //SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)) && + //SUCCEEDED(mo_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) + { + g_InputDeviceManager.AddDevice(std::make_shared(kb_device)); + bKbMoEnumerated = true; + return; + } + + if (kb_device) + kb_device->Release(); +#if 0 + if (mo_device) + mo_device->Release(); +#endif + } + + void PopulateDevices() + { + bKbMoEnumerated = false; + IDirectInput8* idi8; + if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, + (LPVOID*)& idi8, nullptr))) + { + return; + } + + InitKeyboardMouse(idi8); + idi8->Release(); + } + + void GetDeviceChanges() + { + if (bKbMoEnumerated) { + return; + } + PopulateDevices(); + } + + KeyboardMouse::KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device) + : m_kb_device(kb_device)//, m_mo_device(mo_device) + { + m_kb_device->Acquire(); + //m_mo_device->Acquire(); + + memset(&m_state_in, 0, sizeof(m_state_in)); + + // KEYBOARD + // add keys + for (uint8_t i = 0; i < sizeof(named_keys) / sizeof(*named_keys); ++i) { + AddInput(new Key(i, m_state_in.keyboard[named_keys[i].code])); + } +#if 0 + // MOUSE + // get caps + DIDEVCAPS mouse_caps; + memset(&mouse_caps, 0, sizeof(mouse_caps)); + mouse_caps.dwSize = sizeof(mouse_caps); + m_mo_device->GetCapabilities(&mouse_caps); + // mouse buttons + for (unsigned char i = 0; i < mouse_caps.dwButtons; ++i) { + AddInput(new Button(i, m_state_in.mouse.rgbButtons[i])); + } + + // cursor, with a hax for-loop + for (unsigned int i = 0; i < 4; ++i) { + AddInput(new Cursor(!!(i & 2), (&m_state_in.cursor.x)[i / 2], !!(i & 1))); + } +#endif + } + + KeyboardMouse::~KeyboardMouse() + { + // kb + m_kb_device->Unacquire(); + m_kb_device->Release(); +#if 0 + // mouse + m_mo_device->Unacquire(); + m_mo_device->Release(); +#endif + } + + void GetMousePos(ControlState* const x, ControlState* const y) + { + POINT point = { 1, 1 }; + GetCursorPos(&point); + // Get the cursor position relative to the upper left corner of the current window + HWND hwnd = WindowFromPoint(point); + DWORD processId; + GetWindowThreadProcessId(hwnd, &processId); + if (processId == GetCurrentProcessId()) + { + ScreenToClient(hwnd, &point); + + // Get the size of the current window. + RECT rect; + GetClientRect(hwnd, &rect); + // Width and height is the size of the rendering window + unsigned int win_width = rect.right - rect.left; + unsigned int win_height = rect.bottom - rect.top; + + // Return the mouse position as a range from -1 to 1 + *x = (ControlState)point.x / (ControlState)win_width * 2 - 1; + *y = (ControlState)point.y / (ControlState)win_height * 2 - 1; + } + else + { + *x = (ControlState)0; + *y = (ControlState)0; + } + } + + bool KeyboardMouse::UpdateInput() + { + // Update keyboard and mouse button states + HRESULT kb_hr = m_kb_device->GetDeviceState(sizeof(m_state_in.keyboard), &m_state_in.keyboard); + //HRESULT mo_hr = m_mo_device->GetDeviceState(sizeof(m_state_in.mouse), &m_state_in.mouse); + + if (DIERR_INPUTLOST == kb_hr || DIERR_NOTACQUIRED == kb_hr) { + m_kb_device->Acquire(); + } +#if 0 + if (DIERR_INPUTLOST == mo_hr || DIERR_NOTACQUIRED == mo_hr) { + m_mo_device->Acquire(); + } +#endif + if (SUCCEEDED(kb_hr)) //&& SUCCEEDED(mo_hr)) + { +#if 0 + ControlState temp_x, temp_y; + + // Update absolute mouse position + GetMousePos(&m_state_in.cursor.x, &m_state_in.cursor.y); + + // Save current absolute mouse position + temp_x = m_state_in.cursor.x; + temp_y = m_state_in.cursor.y; + + // Update relative mouse motion + m_state_in.cursor.x -= m_state_in.cursor.last_x; + m_state_in.cursor.y -= m_state_in.cursor.last_y; + + // Update previous absolute mouse position + m_state_in.cursor.last_x = temp_x; + m_state_in.cursor.last_y = temp_y; +#endif + return true; + } + return false; + } + + std::string KeyboardMouse::GetDeviceName() const + { + return "Keyboard"; + } + + std::string KeyboardMouse::GetAPI() const + { + return "DInput"; + } + + std::string KeyboardMouse::Key::GetName() const + { + return named_keys[m_index].name; + } + + std::string KeyboardMouse::Button::GetName() const + { + return std::string("Click ") + char('0' + m_index); + } + + std::string KeyboardMouse::Cursor::GetName() const + { + static char tmpstr[] = "Cursor .."; + tmpstr[7] = (char)('X' + m_index); + tmpstr[8] = (m_positive ? '+' : '-'); + return tmpstr; + } + + ControlState KeyboardMouse::Key::GetState() const + { + return (m_key != 0); + } + + ControlState KeyboardMouse::Button::GetState() const + { + return (m_button != 0); + } + + ControlState KeyboardMouse::Cursor::GetState() const + { + return std::max(0.0, ControlState(m_axis) / (m_positive ? 1.0 : -1.0)); + } +} diff --git a/src/common/input/DInputKeyboardMouse.h b/src/common/input/DInputKeyboardMouse.h new file mode 100644 index 000000000..302e82670 --- /dev/null +++ b/src/common/input/DInputKeyboardMouse.h @@ -0,0 +1,105 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#include "InputDevice.h" +#define DIRECTINPUT_VERSION 0x0800 +#include "dinput.h" + + +namespace DInput +{ + extern bool bKbMoEnumerated; + void GetDeviceChanges(); + void PopulateDevices(); + + class KeyboardMouse : public InputDevice + { + public: + KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device); + ~KeyboardMouse(); + std::string GetDeviceName() const override; + std::string GetAPI() const override; + bool UpdateInput() override; + + + private: + class Key : public Input + { + public: + Key(uint8_t index, const BYTE& key) : m_index(index), m_key(key) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + const BYTE& m_key; + const uint8_t m_index; + }; + + class Button : public Input + { + public: + Button(uint8_t index, const BYTE& button) : m_button(button), m_index(index) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + const BYTE& m_button; + const uint8_t m_index; + }; + + class Cursor : public Input + { + public: + Cursor(uint8_t index, const ControlState& axis, const bool positive) + : m_axis(axis), m_index(index), m_positive(positive) {} + std::string GetName() const override; + bool IsDetectable() override { return true; } + ControlState GetState() const override; + + private: + const ControlState& m_axis; + const uint8_t m_index; + const bool m_positive; + }; + + struct State + { + BYTE keyboard[256]; + DIMOUSESTATE2 mouse; + struct + { + ControlState x, y, last_x, last_y; + } cursor; + }; + + const LPDIRECTINPUTDEVICE8 m_kb_device; + //const LPDIRECTINPUTDEVICE8 m_mo_device; + State m_state_in; + }; +} diff --git a/src/common/input/EmuDevice.cpp b/src/common/input/EmuDevice.cpp new file mode 100644 index 000000000..5eab25daa --- /dev/null +++ b/src/common/input/EmuDevice.cpp @@ -0,0 +1,91 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include"Button.h" +#include "InputManager.h" +#include "layout_xbox_controller.h" +#include "..\..\gui\ResCxbx.h" + + +EmuDevice::EmuDevice(int type, HWND hwnd) +{ + switch (type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + m_hwnd = hwnd; + for (int i = 0; i < ARRAY_SIZE(button_xbox_ctrl_id); i++) { + m_buttons.push_back(new Button(button_xbox_ctrl_id[i], i, hwnd)); + + // Install the subclass for the button control + SetWindowSubclass(GetDlgItem(hwnd, button_xbox_ctrl_id[i]), ButtonSubclassProc, 0, reinterpret_cast(m_buttons[i])); + } + } + break; + + default: + break; + } +} + +EmuDevice::~EmuDevice() +{ + for (auto button : m_buttons) { + delete button; + } +} + +Button* EmuDevice::FindButtonById(int id) +{ + auto it = std::find_if(m_buttons.begin(), m_buttons.end(), [&id](const auto button) { + if (button->GetId() == id) { + return true; + } + return false; + }); + assert(it != m_buttons.end()); + return *it; +} + +Button* EmuDevice::FindButtonByIndex(int index) +{ + return m_buttons[index]; +} + +void EmuDevice::BindDefault(int api) +{ + std::for_each(m_buttons.begin(), m_buttons.end(), [&api](const auto button) { + button->UpdateText(button->GetName(api, button->GetIndex()).c_str()); + }); +} + +void EmuDevice::ClearButtons() +{ + std::for_each(m_buttons.begin(), m_buttons.end(), [](const auto button) { + button->ClearText(); + }); +} diff --git a/src/common/input/EmuDevice.h b/src/common/input/EmuDevice.h new file mode 100644 index 000000000..73d825c6c --- /dev/null +++ b/src/common/input/EmuDevice.h @@ -0,0 +1,49 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#include "Button.h" +#include "common\util\CxbxUtil.h" + + +/* Represents the guest device currently being configured in the gui */ +class EmuDevice +{ +public: + EmuDevice(int type, HWND hwnd); + ~EmuDevice(); + Button* FindButtonById(int id); + Button* FindButtonByIndex(int index); + void BindDefault(int api); + void ClearButtons(); + + +private: + std::vector m_buttons; + HWND m_hwnd; +}; diff --git a/src/common/input/InputDevice.cpp b/src/common/input/InputDevice.cpp new file mode 100644 index 000000000..b8184a8a3 --- /dev/null +++ b/src/common/input/InputDevice.cpp @@ -0,0 +1,133 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Partially derived from Device.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +#include "InputDevice.h" +#include "common\util\CxbxUtil.h" +#include + + +std::string GetInputDeviceName(int dev_type) +{ + std::string str; + + switch (dev_type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): { + str = "MS Gamepad Duke"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + str = "MS Gamepad S"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::LIGHT_GUN): { + str = "Light gun"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::STEERING_WHEEL): { + str = "Steering wheel"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::MEMORY_UNIT): { + str = "Memory unit"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::IR_DONGLE): { + str = "IR dongle"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER): { + str = "Steel battalion controller"; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID): + case to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX): { + str = "Invalid"; + } + break; + + default: + str = "Unknown"; + } + + return str; +} + +// Destructor, delete all inputs/outputs on device destruction +InputDevice::~InputDevice() +{ + // delete inputs + for (InputDevice::Input* input : m_Inputs) { + delete input; + } + + // delete outputs + for (InputDevice::Output* output : m_Outputs) { + delete output; + } +} + +void InputDevice::AddInput(Input* const In) +{ + m_Inputs.push_back(In); +} + +void InputDevice::AddOutput(Output* const Out) +{ + m_Outputs.push_back(Out); +} + +std::string InputDevice::GetQualifiedName() const +{ + return this->GetAPI() + "/" + std::to_string(GetId()) + "/" + this->GetDeviceName(); +} + +const std::vector InputDevice::GetIoControls() +{ + std::vector vec; + std::for_each(m_Inputs.begin(), m_Inputs.end(), [&vec](const auto input) { + vec.push_back(dynamic_cast(input)); + }); + std::for_each(m_Outputs.begin(), m_Outputs.end(), [&vec](const auto output) { + vec.push_back(dynamic_cast(output)); + }); + return vec; +} diff --git a/src/common/input/InputDevice.h b/src/common/input/InputDevice.h new file mode 100644 index 000000000..4ff6d4465 --- /dev/null +++ b/src/common/input/InputDevice.h @@ -0,0 +1,185 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef INPUT_DEVICE +#define INPUT_DEVICE + +#include +#include +#include +#include +#include +#include +#include "SDL.h" + +#define PORT_INVALID -1 +#define PORT_1 0 +#define PORT_2 1 +#define PORT_3 2 +#define PORT_4 3 + +#define PORT_INC(port) ((port) + 1) +#define PORT_DEC(port) ((port) - 1) + +#define DIRECTION_IN 0 +#define DIRECTION_OUT 1 + + +typedef double ControlState; + +/* enum indicating the device type to attach to the virtual xbox */ +typedef enum class _XBOX_INPUT_DEVICE : int { + DEVICE_INVALID = -1, + MS_CONTROLLER_DUKE, + MS_CONTROLLER_S, + LIGHT_GUN, + STEERING_WHEEL, + MEMORY_UNIT, + IR_DONGLE, + STEEL_BATTALION_CONTROLLER, + DEVICE_MAX, +} +XBOX_INPUT_DEVICE; + +// Lookup array used to translate a gui port to an xbox usb port and vice versa +extern int Gui2XboxPortArray[4]; + +// Global function used to retrieve the printable name of a xid type +std::string GetInputDeviceName(int dev_type); + +/* Abstract class which represents a host device usable for input/output */ +class InputDevice +{ +public: + virtual ~InputDevice(); + + class IoControl + { + public: + virtual std::string GetName() const = 0; + }; + + class Input : public IoControl + { + public: + virtual ControlState GetState() const = 0; + virtual bool IsDetectable() { return true; } + }; + + class Output : public IoControl + { + public: + virtual void SetState(ControlState StateLeft, ControlState StateRight) = 0; + }; + + // retrieves the vector of input controls + const std::vector& GetInputs() const { return m_Inputs; } + // retrieves the vector of output controls + const std::vector& GetOutputs() const { return m_Outputs; } + // retrieves all the i/o controls of this device + const std::vector GetIoControls(); + // retrieves the full name of the device (API/ID/API-specific name) + std::string GetQualifiedName() const; + // retrieves the API-specific name of the device + virtual std::string GetDeviceName() const = 0; + // retrieves the API used to control this device + virtual std::string GetAPI() const = 0; + // updates the state of the device and checks if its state has changed + virtual bool UpdateInput() = 0; + // retrieves the ID of this device + int GetId() const { return m_ID; } + // retrieves the sdl id or -1 for non-sdl devices + virtual SDL_JoystickID GetId(SDL_JoystickID id) const { return -1; } + // sets the ID of this device + void SetId(int ID) { m_ID = ID; } + // retrieves the port this device is attached to + bool GetPort(int Port) const { return m_XboxPort[Port]; } + // sets the port this device is attached to + void SetPort(int Port, bool Connect) { m_XboxPort[Port] = Connect; } + + +protected: + // adds an input control to the device + void AddInput(Input* const In); + // adds an output control to the device + void AddOutput(Output* const Out); + // indicates that the device has new input data available + bool m_bDirty; + // lock for the bindings map + mutable std::mutex m_BindingsMtx; + +public: + // retrieves the map of input bindings + const std::map GetBindings() const { + std::lock_guard lck(m_BindingsMtx); + return m_Bindings; + } + // sets a pair in the map of the input bindings + void SetBindings(int XButton, IoControl* Control) { + std::lock_guard lck(m_BindingsMtx); + m_Bindings[XButton] = Control; + } + +protected: + class FullAnalogSurface : public Input + { + public: + FullAnalogSurface(Input* Low, Input* High) : m_Low(*Low), m_High(*High) {} + ControlState GetState() const override + { + return (1 + m_High.GetState() - m_Low.GetState()) / 2; + } + + std::string GetName() const override { return m_Low.GetName() + *m_High.GetName().rbegin(); } + + private: + Input& m_Low; + Input& m_High; + }; + + void AddAnalogInputs(Input* Low, Input* High) + { + AddInput(Low); + AddInput(High); + AddInput(new FullAnalogSurface(Low, High)); + AddInput(new FullAnalogSurface(High, Low)); + } + +private: + // arbitrary ID assigned by to the device + int m_ID; + // all the input controls detected and usable on this device + std::vector m_Inputs; + // all the output controls detected and usable on this device + std::vector m_Outputs; + // xbox port(s) this device is attached to + bool m_XboxPort[4] = { false }; + // button bindings to the xbox device buttons + std::map m_Bindings; +}; + +#endif diff --git a/src/common/input/InputManager.cpp b/src/common/input/InputManager.cpp new file mode 100644 index 000000000..013eaae06 --- /dev/null +++ b/src/common/input/InputManager.cpp @@ -0,0 +1,525 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Copyright 2010 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Partially derived from ControllerInterface.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +#define _XBOXKRNL_DEFEXTRN_ +#define LOG_PREFIX CXBXR_MODULE::INPSYS + +// prevent name collisions +namespace xboxkrnl +{ +#include // For PKINTERRUPT, etc. +}; + +#include "SdlJoystick.h" +#include "XInputPad.h" +#include "DInputKeyboardMouse.h" +#include "InputManager.h" +#include "..\devices\usb\XidGamepad.h" +#include "core\kernel\exports\EmuKrnl.h" // For EmuLog +#include "EmuShared.h" +#include "devices\usb\OHCI.h" + +// hle input specific +#include "core\hle\XAPI\Xapi.h" +#include "core\hle\XAPI\XapiCxbxr.h" + +int Gui2XboxPortArray[4] = { + 3, + 4, + 1, + 2 +}; + +int dev_num_buttons[to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)] = { + XBOX_CTRL_NUM_BUTTONS, // MS_CONTROLLER_DUKE + XBOX_CTRL_NUM_BUTTONS, // MS_CONTROLLER_S + 0, + 0, + 0, + 0, + 0, +}; + +extern CXBX_CONTROLLER_HOST_BRIDGE g_XboxControllerHostBridge[4]; // hle xinput + + +InputDeviceManager g_InputDeviceManager; + +void InputDeviceManager::Initialize(bool is_gui) +{ + // Sdl::Init must be called last since it blocks when it succeeds + std::unique_lock lck(m_Mtx); + m_bPendingShutdown = false; + + m_PollingThread = std::thread([this]() { + XInput::Init(m_Mtx); + Sdl::Init(m_Mtx, m_Cv); + }); + + m_Cv.wait(lck, []() { + return (Sdl::SdlInitStatus != Sdl::SDL_NOT_INIT) && + (XInput::XInputInitStatus != XInput::XINPUT_NOT_INIT); + }); + lck.unlock(); + + if (Sdl::SdlInitStatus < 0 || XInput::XInputInitStatus < 0) { + CxbxKrnlCleanup("Failed to initialize input subsystem! Consult debug log for more information"); + } + + RefreshDevices(); + + if (!is_gui) { + UpdateDevices(PORT_1, false); + UpdateDevices(PORT_2, false); + UpdateDevices(PORT_3, false); + UpdateDevices(PORT_4, false); + } +} + +void InputDeviceManager::Shutdown() +{ + // Prevent additional devices from being added during shutdown. + m_bPendingShutdown = true; + + std::lock_guard lk(m_Mtx); + for (const auto& d : m_Devices) + { + // Set outputs to ZERO before destroying device + for (InputDevice::Output* o : d->GetOutputs()) { + o->SetState(0.0, 0.0); + } + } + m_Devices.clear(); + + XInput::DeInit(); + Sdl::DeInit(m_PollingThread); +} + +void InputDeviceManager::AddDevice(std::shared_ptr Device) +{ + // If we are shutting down, ignore this request + if (m_bPendingShutdown) { + return; + } + + std::lock_guard lk(m_Mtx); + // Try to find an ID for this device + int ID = 0; + while (true) + { + const auto it = + std::find_if(m_Devices.begin(), m_Devices.end(), [&Device, &ID](const auto& d) { + return d->GetAPI() == Device->GetAPI() && d->GetDeviceName() == Device->GetDeviceName() && + d->GetId() == ID; + }); + if (it == m_Devices.end()) { // no device with the same name with this ID, so we can use it + break; + } + else { + ID++; + } + } + Device->SetId(ID); + + EmuLog(LOG_LEVEL::INFO, "Added device: %s", Device->GetQualifiedName().c_str()); + m_Devices.emplace_back(std::move(Device)); +} + +void InputDeviceManager::RemoveDevice(std::function Callback) +{ + // If we are shutting down, ignore this request + if (m_bPendingShutdown) { + return; + } + + std::lock_guard lk(m_Mtx); + auto it = std::remove_if(m_Devices.begin(), m_Devices.end(), [&Callback](const auto& Device) { + if (Callback(Device.get())) + { + EmuLog(LOG_LEVEL::INFO, "Removed device: %s", Device->GetQualifiedName().c_str()); + return true; + } + return false; + }); + if (it != m_Devices.end()) { + m_Devices.erase(it, m_Devices.end()); + } +} + +void InputDeviceManager::UpdateDevices(int port, bool ack) +{ + if (port > PORT_4 || port < PORT_1) { + EmuLog(LOG_LEVEL::WARNING, "Invalid port number. The port was %d", PORT_INC(port)); + return; + } + int type; +#if 0 // lle usb + int usb_port = PORT_DEC(Gui2XboxPortArray[port]); +#else + int usb_port = port; +#endif + g_EmuShared->GetInputDevTypeSettings(&type, port); + + // connect + if (type != to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) && + //g_XidDeviceObjArray[usb_port].xid_dev == nullptr) { lle usb + g_XboxControllerHostBridge[usb_port].XboxType == XBOX_INPUT_DEVICE::DEVICE_INVALID) { + ConnectDevice(port, usb_port, type); + } + // disconnect + else if (type == to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) && + //g_XidDeviceObjArray[usb_port].xid_dev != nullptr) { lle usb + g_XboxControllerHostBridge[usb_port].XboxType != XBOX_INPUT_DEVICE::DEVICE_INVALID) { + DisconnectDevice(port, usb_port, ack); + } + // update bindings + else { + auto dev = g_InputDeviceManager.FindDevice(usb_port, 0); + if (dev != nullptr) { + dev->SetPort(usb_port, false); + } + if (type != to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID)) { + BindHostDevice(port, usb_port, type); + } + } +} + +void InputDeviceManager::ConnectDevice(int port, int usb_port, int type) +{ +#if 0 // lle usb + switch (type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): { + if (ConstructHub(usb_port)) { + if (!ConstructXpadDuke(usb_port)) { + DestructHub(usb_port); + return; + } + g_XidDeviceObjArray[usb_port].xid_type = type; + EmuLog(LOG_LEVEL::INFO, "Attached device %s to port %d", GetInputDeviceName(type).c_str(), PORT_INC(port)); + } + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): + case to_underlying(XBOX_INPUT_DEVICE::LIGHT_GUN): + case to_underlying(XBOX_INPUT_DEVICE::STEERING_WHEEL): + case to_underlying(XBOX_INPUT_DEVICE::MEMORY_UNIT): + case to_underlying(XBOX_INPUT_DEVICE::IR_DONGLE): + case to_underlying(XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER): { + EmuLog(LOG_LEVEL::INFO, "%s: device %s is not yet supported", __func__, GetInputDeviceName(type).c_str()); + return; + } + + default: + EmuLog(LOG_LEVEL::WARNING, "Attempted to attach an unknown device type (type was %d)", type); + return; + } +#else + if (!ConstructHleInputDevice(type, port)) { + return; + } + EmuLog(LOG_LEVEL::INFO, "Attached device %s to port %d", GetInputDeviceName(type).c_str(), PORT_INC(port)); +#endif + BindHostDevice(port, usb_port, type); +} + +void InputDeviceManager::DisconnectDevice(int port, int usb_port, bool ack) +{ +#if 0 // lle usb + if (g_XidDeviceObjArray[usb_port].xid_dev != nullptr) { + int type = g_XidDeviceObjArray[usb_port].xid_type; + + switch (type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): { + if (ack) { + assert(g_HubObjArray[usb_port] != nullptr); + DestructHub(usb_port); + DestructXpadDuke(usb_port); + g_HostController->OHCI_SetRemovalFlag(usb_port, false); + EmuLog(LOG_LEVEL::INFO, "Detached device %s from port %d", GetInputDeviceName(type).c_str(), PORT_INC(port)); + } + else { + g_HostController->OHCI_SetRemovalFlag(usb_port, true); + } + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): + case to_underlying(XBOX_INPUT_DEVICE::LIGHT_GUN): + case to_underlying(XBOX_INPUT_DEVICE::STEERING_WHEEL): + case to_underlying(XBOX_INPUT_DEVICE::MEMORY_UNIT): + case to_underlying(XBOX_INPUT_DEVICE::IR_DONGLE): + case to_underlying(XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER): { + EmuLog(LOG_LEVEL::INFO, "%s: device %s is not yet supported", __func__, GetInputDeviceName(type).c_str()); + return; + } + + default: + EmuLog(LOG_LEVEL::WARNING, "Attempted to detach an unknown device type (type was %d)", type); + return; + } +#endif + if (g_XboxControllerHostBridge[port].XboxType != XBOX_INPUT_DEVICE::DEVICE_INVALID) { + if (ack) { + int type = to_underlying(g_XboxControllerHostBridge[port].XboxType); + DestructHleInputDevice(port); + EmuLog(LOG_LEVEL::INFO, "Detached device %s from port %d", GetInputDeviceName(type).c_str(), PORT_INC(port)); + } + else { + g_XboxControllerHostBridge[port].bPendingRemoval = true; + } + auto dev = g_InputDeviceManager.FindDevice(usb_port, 0); + if (dev != nullptr) { + dev->SetPort(usb_port, false); + } + } + else { + EmuLog(LOG_LEVEL::WARNING, "Attempted to detach a device not attached to the emulated machine"); + } +} + +void InputDeviceManager::BindHostDevice(int port, int usb_port, int type) +{ + char dev_name[50]; + char dev_control_names[XBOX_CTRL_NUM_BUTTONS][30]; + + g_EmuShared->GetInputDevNameSettings(dev_name, port); + g_EmuShared->GetInputBindingsSettings(dev_control_names, XBOX_CTRL_NUM_BUTTONS, port); + + auto dev = FindDevice(std::string(dev_name)); + if (dev != nullptr) { + std::vector controls = dev->GetIoControls(); + for (int index = 0; index < dev_num_buttons[type]; index++) { + std::string dev_button(dev_control_names[index]); + auto it = std::find_if(controls.begin(), controls.end(), [&dev_button](const auto control) { + if (control->GetName() == dev_button) { + return true; + } + return false; + }); + dev->SetBindings(index, (it != controls.end()) ? *it : nullptr); + } + dev->SetPort(usb_port, true); + } +} + +bool InputDeviceManager::UpdateXboxPortInput(int usb_port, void* Buffer, int Direction, int xid_type) +{ + assert(Direction == DIRECTION_IN || Direction == DIRECTION_OUT); + assert(xid_type > to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) && + xid_type < to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)); + bool has_changed = false; + + // If somebody else is currently holding the lock, we won't wait and instead report no input changes + if (m_Mtx.try_lock()) { + for (auto dev_ptr : m_Devices) { + if (dev_ptr->GetPort(usb_port)) { + switch (xid_type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + has_changed = UpdateInputXpad(dev_ptr, Buffer, Direction); + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::LIGHT_GUN): + case to_underlying(XBOX_INPUT_DEVICE::STEERING_WHEEL): + case to_underlying(XBOX_INPUT_DEVICE::MEMORY_UNIT): + case to_underlying(XBOX_INPUT_DEVICE::IR_DONGLE): + case to_underlying(XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER): { + EmuLog(LOG_LEVEL::WARNING, "An unsupported device is attached at port %d! The device was %s", + Gui2XboxPortArray[usb_port], GetInputDeviceName(xid_type).c_str()); + } + break; + + default: { + EmuLog(LOG_LEVEL::WARNING, "An unknown device attached at port %d! The type was %s", + Gui2XboxPortArray[usb_port], GetInputDeviceName(xid_type).c_str()); + } + } + } + } + m_Mtx.unlock(); + } + return has_changed; +} + +bool InputDeviceManager::UpdateInputXpad(std::shared_ptr& Device, void* Buffer, int Direction) +{ + std::map bindings = Device->GetBindings(); + assert(bindings.size() == static_cast(dev_num_buttons[to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE)])); + + if (Direction == DIRECTION_IN) { + //XpadInput* in_buf = reinterpret_cast(static_cast(Buffer) + 2); lle usb + XpadInput* in_buf = reinterpret_cast(Buffer); + if (!Device->UpdateInput()) { + return false; + } + + for (int i = 0; i < 8; i++) { + ControlState state = (bindings[i] != nullptr) ? dynamic_cast(bindings[i])->GetState() : 0.0; + if (state) { + in_buf->wButtons |= (1 << i); + } + else { + in_buf->wButtons &= ~(1 << i); + } + } + for (int i = 8, j = 0; i < 16; i++, j++) { + ControlState state = (bindings[i] != nullptr) ? dynamic_cast(bindings[i])->GetState() : 0.0; + in_buf->bAnalogButtons[j] = static_cast(state * 0xFF); + } + + for (int i = 16, j = 0; i < 24; i += 2, j++) { + ControlState state_plus = (bindings[i] != nullptr) ? dynamic_cast(bindings[i])->GetState() : 0.0; + ControlState state_minus = (bindings[i + 1] != nullptr) ? dynamic_cast(bindings[i + 1])->GetState() : 0.0; + ControlState state = state_plus ? state_plus * 0x7FFF : state_minus ? -state_minus * 0x8000 : 0.0; + switch (j) + { + case 0: { + in_buf->sThumbLX = static_cast(state); + } + break; + + case 1: { + in_buf->sThumbLY = static_cast(state); + } + break; + + case 2: { + in_buf->sThumbRX = static_cast(state); + } + break; + + case 3: { + in_buf->sThumbRY = static_cast(state); + } + break; + + default: { + // unreachable + } + } + } + } + else { + if (bindings[24] != nullptr) { + //XpadOutput* out_buf = reinterpret_cast(static_cast(Buffer) + 2); lle usb + XpadOutput* out_buf = reinterpret_cast(Buffer); + dynamic_cast(bindings[24])->SetState(out_buf->left_actuator_strength / static_cast(0xFFFF), + out_buf->right_actuator_strength / static_cast(0xFFFF)); + } + } + return true; +} + +void InputDeviceManager::RefreshDevices() +{ + std::unique_lock lck(m_Mtx); + Sdl::SdlPopulateOK = false; + m_Devices.clear(); + lck.unlock(); + XInput::PopulateDevices(); + DInput::PopulateDevices(); + Sdl::PopulateDevices(); + lck.lock(); + m_Cv.wait(lck, []() { + return Sdl::SdlPopulateOK; + }); +} + +std::vector InputDeviceManager::GetDeviceList() const +{ + std::vector dev_list; + std::lock_guard lck(m_Mtx); + + std::for_each(m_Devices.begin(), m_Devices.end(), [&dev_list](const auto& Device) { + dev_list.push_back(Device->GetQualifiedName()); + }); + + return dev_list; +} + +std::shared_ptr InputDeviceManager::FindDevice(const std::string& QualifiedName) const +{ + std::lock_guard lck(m_Mtx); + + auto it = std::find_if(m_Devices.begin(), m_Devices.end(), [&QualifiedName](const auto& Device) { + return QualifiedName == Device->GetQualifiedName(); + }); + if (it != m_Devices.end()) { + return *it; + } + else { + return nullptr; + } +} + +std::shared_ptr InputDeviceManager::FindDevice(SDL_JoystickID id) const +{ + std::lock_guard lck(m_Mtx); + + auto it = std::find_if(m_Devices.begin(), m_Devices.end(), [id](const auto& Device) { + return id == Device->GetId(id); + }); + if (it != m_Devices.end()) { + return *it; + } + else { + return nullptr; + } +} + +std::shared_ptr InputDeviceManager::FindDevice(int usb_port, int dummy) const +{ + // Ignore dummy, it's just used to overload the function + + if (usb_port == PORT_INVALID) { + return nullptr; + } + + std::lock_guard lck(m_Mtx); + + auto it = std::find_if(m_Devices.begin(), m_Devices.end(), [usb_port](const auto& Device) { + return Device->GetPort(usb_port); + }); + if (it != m_Devices.end()) { + return *it; + } + else { + return nullptr; + } +} diff --git a/src/common/input/InputManager.h b/src/common/input/InputManager.h new file mode 100644 index 000000000..60776d7fe --- /dev/null +++ b/src/common/input/InputManager.h @@ -0,0 +1,115 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef INPUTMANAGER_H_ +#define INPUTMANAGER_H_ + +#include +#include "InputDevice.h" +#include "EmuDevice.h" + +// Prevent a collision with the SetPort provided by Windows +#ifdef WIN32 +#undef SetPort +#endif + +extern int dev_num_buttons[to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)]; + +#pragma pack(1) + +// xpad in/out buffers stripped of the first two bytes +struct XpadInput { + uint16_t wButtons; + uint8_t bAnalogButtons[8]; + int16_t sThumbLX; + int16_t sThumbLY; + int16_t sThumbRX; + int16_t sThumbRY; +}; + +struct XpadOutput { + uint16_t left_actuator_strength; + uint16_t right_actuator_strength; +}; + +#pragma pack() + + +class InputDeviceManager +{ +public: + void Initialize(bool is_gui); + void Shutdown(); + // read/write the input/output from/to the device attached to the supplied xbox port + bool UpdateXboxPortInput(int usb_port, void* Buffer, int Direction, int xid_type); + // add the device to the list of availble devices + void AddDevice(std::shared_ptr Device); + // remove the device from the list of availble devices + void RemoveDevice(std::function Callback); + // update device list + void RefreshDevices(); + // get the name of the devices currently detected + std::vector GetDeviceList() const; + // find device from its gui name + std::shared_ptr FindDevice(const std::string& QualifiedName) const; + // find device from its sdl id + std::shared_ptr FindDevice(SDL_JoystickID id) const; + // find device from its xbox port + std::shared_ptr FindDevice(int usb_port, int dummy) const; + // attach/detach guest devices to the emulated machine + void UpdateDevices(int port, bool ack); + + +private: + // update input for an xbox controller + bool UpdateInputXpad(std::shared_ptr& Device, void* Buffer, int Direction); + // bind a host device to an emulated device + void BindHostDevice(int port, int usb_port, int type); + // connect a device to the emulated machine + void ConnectDevice(int port, int usb_port, int type); + // disconnect a device from the emulated machine + void DisconnectDevice(int port, int usb_port, bool ack); + + // all enumerated devices currently detected and supported + std::vector> m_Devices; + // These serve double duty. They are used to signal errors during the initialization and + // later to signal that sdl has finished to refresh its devices + mutable std::mutex m_Mtx; + std::condition_variable m_Cv; + // input polling thread + std::thread m_PollingThread; + // used to indicate that the manager is shutting down + bool m_bPendingShutdown; +}; + +extern InputDeviceManager g_InputDeviceManager; + +// hle input functions +bool ConstructHleInputDevice(int Type, int Port); +void DestructHleInputDevice(int Port); + +#endif diff --git a/src/common/input/InputWindow.cpp b/src/common/input/InputWindow.cpp new file mode 100644 index 000000000..41b3de712 --- /dev/null +++ b/src/common/input/InputWindow.cpp @@ -0,0 +1,491 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "InputWindow.h" +#include "..\..\gui\ResCxbx.h" +#include "common\IPCHybrid.hpp" +#include "EmuShared.h" +#include + +#define INPUT_TIMEOUT 5000 +#define OUTPUT_TIMEOUT 3000 + + +constexpr ControlState INPUT_DETECT_THRESHOLD = 0.55; // arbitrary number, using what Dolphin uses +InputWindow* g_InputWindow = nullptr; + + +void InputWindow::Initialize(HWND hwnd, int port_num, int dev_type) +{ + // Save window/device specific variables + m_hwnd_window = hwnd; + m_hwnd_device_list = GetDlgItem(m_hwnd_window, IDC_DEVICE_LIST); + m_hwnd_profile_list = GetDlgItem(m_hwnd_window, IDC_XID_PROFILE_NAME); + m_hwnd_default = GetDlgItem(m_hwnd_window, IDC_XID_DEFAULT); + m_dev_type = dev_type; + m_max_num_buttons = dev_num_buttons[dev_type]; + m_port_num = port_num; + m_bHasChanges = false; + m_bIsBinding = false; + + // Set window icon + SetClassLong(m_hwnd_window, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); + + // Set window title + std::string title; + switch (m_dev_type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): { + title += "Xbox Controller Duke at port "; + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + title += "Xbox Controller S at port "; + } + break; + + default: + break; + } + SendMessage(m_hwnd_window, WM_SETTEXT, 0, + reinterpret_cast((title + std::to_string(PORT_INC(m_port_num))).c_str())); + + // Set the maximum profile name lenght the user can enter in the profile combobox + SendMessage(m_hwnd_profile_list, CB_LIMITTEXT, 49, 0); + + // construct emu device + m_DeviceConfig = new EmuDevice(m_dev_type, m_hwnd_window); + + // Enumerate devices + UpdateDeviceList(); + + // Load currently saved profile for this port/device type + LoadDefaultProfile(); + + // Load currently selected host device + UpdateCurrentDevice(); + + // Load rumble binding + char rumble[30]; + m_DeviceConfig->FindButtonByIndex(m_max_num_buttons - 1)->GetText(rumble, sizeof(rumble)); + m_rumble = rumble; + + // Install the subclass for the profile combobox + SetWindowSubclass(GetWindow(m_hwnd_profile_list, GW_CHILD), ProfileNameSubclassProc, 0, 0); +} + +InputWindow::~InputWindow() +{ + delete m_DeviceConfig; + m_DeviceConfig = nullptr; +} + +bool InputWindow::IsProfileSaved() +{ + if (m_bHasChanges) { + int ret = MessageBox(m_hwnd_window, "Current configuration is not saved. Save before closing?", "Cxbx-Reloaded", MB_YESNOCANCEL | MB_ICONWARNING | MB_APPLMODAL); + switch (ret) + { + case IDYES: { + char name[50]; + SendMessage(m_hwnd_profile_list, WM_GETTEXT, sizeof(name), reinterpret_cast(name)); + if (SaveProfile(std::string(name))) { + return true; + } + return false; + } + + case IDNO: { + return true; + } + + case IDCANCEL: + default: { + return false; + } + + } + } + return true; +} + +void InputWindow::UpdateDeviceList() +{ + g_InputDeviceManager.RefreshDevices(); + + // Populate device list + LRESULT num_devices = SendMessage(m_hwnd_device_list, CB_GETCOUNT, 0, 0); + for (int i = 0; i < num_devices; i++) { + SendMessage(m_hwnd_device_list, CB_DELETESTRING, 0, 0); + } + + std::vector dev_list = g_InputDeviceManager.GetDeviceList(); + for (const auto& str : dev_list) { + SendMessage(m_hwnd_device_list, CB_ADDSTRING, 0, reinterpret_cast(str.c_str())); + } + if (!dev_list.empty()) { + SendMessage(m_hwnd_device_list, CB_SETCURSEL, 0, 0); + } + + UpdateCurrentDevice(); +} + +// Copyright 2016 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// DetectInput is derived from InputReference::Detect() in ControlReference.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +InputDevice::Input* InputWindow::DetectInput(InputDevice* const Device, int ms) +{ + using namespace std::chrono; + + // The intent of the initial_states vector is to detect inputs that were pressed already when this function was called. + // Without it, the initial mouse click used to select a gui button is very likely to be registered as valid input and bound + Device->UpdateInput(); // Requirement to get current state than previous state. testcase: enter key / cursor + std::vector::const_iterator i = Device->GetInputs().begin(), + e = Device->GetInputs().end(), b = i, s = e; + std::vector initial_states(Device->GetInputs().size()); + for (std::vector::iterator state = initial_states.begin(); i != e; i++) { + *state++ = ((*i)->GetState() > (1 - INPUT_DETECT_THRESHOLD)); + } + + auto now = system_clock::now(); + auto timeout = now + milliseconds(ms); + + while (now <= timeout) { + Device->UpdateInput(); + std::vector::iterator state = initial_states.begin(); + for (; i != e && s == e; i++, state++) { + if ((*i)->IsDetectable() && (*i)->GetState() > INPUT_DETECT_THRESHOLD) { + if (*state == false) { + // input was not initially pressed or it was but released afterwards + s = i; + break; + } + else if ((*i)->GetState() < (1 - INPUT_DETECT_THRESHOLD)) { + *state = false; + } + } + } + if (s != e && (*s)->GetState() < (1 - INPUT_DETECT_THRESHOLD)) { + return *s; + } + std::this_thread::sleep_for(milliseconds(10)); + now += milliseconds(10); + i = b; + } + + return nullptr; // no input +} + +void InputWindow::BindButton(int ControlID) +{ + // Check if binding thread is still active + // testcase: spacebar and enter keys; without this fix will cause repeat binding result. + if (m_bIsBinding) { + return; + } + + auto dev = g_InputDeviceManager.FindDevice(m_host_dev); + if (dev != nullptr) { + m_bIsBinding = true; + + // Don't block the message processing loop + std::thread([this, dev, ControlID]() { + EnableWindow(m_hwnd_window, FALSE); + char current_text[30]; + Button* xbox_button = m_DeviceConfig->FindButtonById(ControlID); + xbox_button->GetText(current_text, sizeof(current_text)); + xbox_button->UpdateText("..."); + std::future fut = std::async(std::launch::async, &InputWindow::DetectInput, this, dev.get(), INPUT_TIMEOUT); + InputDevice::Input* dev_button = fut.get(); + if (dev_button) { + xbox_button->UpdateText(dev_button->GetName().c_str()); + m_bHasChanges = true; + } + else { + xbox_button->UpdateText(current_text); + } + m_bIsBinding = false; + EnableWindow(m_hwnd_window, TRUE); + }).detach(); + } +} + +void InputWindow::BindDefault() +{ + int api = EnableDefaultButton(); + if (api != -1) { + m_DeviceConfig->BindDefault(api); + m_bHasChanges = true; + } +} + +void InputWindow::ClearBindings() +{ + m_DeviceConfig->ClearButtons(); + m_rumble = std::string(); + m_bHasChanges = true; +} + +int InputWindow::EnableDefaultButton() +{ + if (std::strncmp(m_host_dev.c_str(), "XInput", std::strlen("XInput")) == 0) { + EnableWindow(m_hwnd_default, TRUE); + return XINPUT_DEFAULT; + } + else if (std::strncmp(m_host_dev.c_str(), "DInput", std::strlen("DInput")) == 0) { + EnableWindow(m_hwnd_default, TRUE); + return DINPUT_DEFAULT; + } + else { + EnableWindow(m_hwnd_default, FALSE); + return -1; + } +} + +InputWindow::ProfileIt InputWindow::FindProfile(const std::string& name) +{ + auto it = std::find_if(g_Settings->m_input_profiles[m_dev_type].begin(), + g_Settings->m_input_profiles[m_dev_type].end(), [&name](const auto& profile) { + return profile.ProfileName == name; + }); + return it; +} + +void InputWindow::UpdateProfile(const std::string& name, int command) +{ + switch (command) + { + case PROFILE_LOAD: { + LoadProfile(name); + } + break; + + case PROFILE_SAVE: { + SaveProfile(name); + } + break; + + case PROFILE_DELETE: { + DeleteProfile(name); + } + break; + + case RUMBLE_CLEAR: { + m_rumble = std::string(); + } + break; + + case BUTTON_CLEAR: { + m_bHasChanges = true; + } + break; + + default: + break; + } +} + +void InputWindow::LoadProfile(const std::string& name) +{ + ProfileIt profile = FindProfile(name); + if (profile == g_Settings->m_input_profiles[m_dev_type].end()) { + return; + } + m_host_dev = profile->DeviceName; + EnableDefaultButton(); + LRESULT dev_str_index = SendMessage(m_hwnd_device_list, CB_FINDSTRINGEXACT, 1, reinterpret_cast(m_host_dev.c_str())); + if (dev_str_index == CB_ERR) { + SendMessage(m_hwnd_device_list, CB_ADDSTRING, 0, reinterpret_cast(m_host_dev.c_str())); + } + else { + SendMessage(m_hwnd_device_list, CB_SETCURSEL, dev_str_index, 0); + } + SendMessage(m_hwnd_profile_list, CB_SETCURSEL, SendMessage(m_hwnd_profile_list, CB_FINDSTRINGEXACT, 1, + reinterpret_cast(profile->ProfileName.c_str())), 0); + for (int index = 0; index < m_max_num_buttons; index++) { + m_DeviceConfig->FindButtonByIndex(index)->UpdateText(profile->ControlList[index].c_str()); + } + g_Settings->m_input[m_port_num].DeviceName = profile->DeviceName; + g_Settings->m_input[m_port_num].ProfileName = profile->ProfileName; + m_bHasChanges = false; +} + +bool InputWindow::SaveProfile(const std::string& name) +{ + if (name == std::string()) { + MessageBox(m_hwnd_window, "Cannot save. Profile name must not be empty", "Cxbx-Reloaded", MB_OK | MB_ICONSTOP | MB_APPLMODAL); + return false; + } + if (m_host_dev == std::string()) { + MessageBox(m_hwnd_window, "Cannot save. No input devices detected", "Cxbx-Reloaded", MB_OK | MB_ICONSTOP | MB_APPLMODAL); + return false; + } + OverwriteProfile(name); + Settings::s_input_profiles profile; + profile.Type = m_dev_type; + profile.ProfileName = name; + profile.DeviceName = m_host_dev; + for (int index = 0; index < m_max_num_buttons; index++) { + char dev_button[30]; + m_DeviceConfig->FindButtonByIndex(index)->GetText(dev_button, sizeof(dev_button)); + profile.ControlList.push_back(dev_button); + } + SendMessage(m_hwnd_profile_list, CB_SETCURSEL, SendMessage(m_hwnd_profile_list, CB_ADDSTRING, 0, + reinterpret_cast(profile.ProfileName.c_str())), 0); + g_Settings->m_input[m_port_num].DeviceName = profile.DeviceName; + g_Settings->m_input[m_port_num].ProfileName = profile.ProfileName; + g_Settings->m_input_profiles[m_dev_type].push_back(std::move(profile)); + m_bHasChanges = false; + return true; +} + +void InputWindow::DeleteProfile(const std::string& name) +{ + ProfileIt profile = FindProfile(name); + if (profile == g_Settings->m_input_profiles[m_dev_type].end()) { + return; + } + SendMessage(m_hwnd_profile_list, CB_DELETESTRING, SendMessage(m_hwnd_profile_list, CB_FINDSTRINGEXACT, 1, + reinterpret_cast(profile->ProfileName.c_str())), 0); + if (profile->ProfileName == g_Settings->m_input[m_port_num].ProfileName) { + SendMessage(m_hwnd_profile_list, CB_SETCURSEL, -1, 0); + UpdateCurrentDevice(); + ClearBindings(); + g_Settings->m_input[m_port_num].DeviceName = ""; + g_Settings->m_input[m_port_num].ProfileName = ""; + m_bHasChanges = false; + } + else { + LoadProfile(g_Settings->m_input[m_port_num].ProfileName); + } + g_Settings->m_input_profiles[m_dev_type].erase(profile); +} + +void InputWindow::OverwriteProfile(const std::string& name) +{ + ProfileIt profile = FindProfile(name); + if (profile == g_Settings->m_input_profiles[m_dev_type].end()) { + return; + } + SendMessage(m_hwnd_profile_list, CB_DELETESTRING, SendMessage(m_hwnd_profile_list, CB_FINDSTRINGEXACT, 1, + reinterpret_cast(profile->ProfileName.c_str())), 0); + SendMessage(m_hwnd_profile_list, CB_SETCURSEL, -1, 0); + g_Settings->m_input_profiles[m_dev_type].erase(profile); +} + +void InputWindow::LoadDefaultProfile() +{ + for (unsigned int index = 0; index < g_Settings->m_input_profiles[m_dev_type].size(); index++) { + SendMessage(m_hwnd_profile_list, CB_ADDSTRING, 0, + reinterpret_cast(g_Settings->m_input_profiles[m_dev_type][index].ProfileName.c_str())); + } + LoadProfile(g_Settings->m_input[m_port_num].ProfileName); +} + +void InputWindow::UpdateCurrentDevice() +{ + char device_name[50]; + SendMessage(m_hwnd_device_list, WM_GETTEXT, sizeof(device_name), reinterpret_cast(device_name)); + m_host_dev = device_name; + EnableDefaultButton(); +} + +void InputWindow::InitRumble(HWND hwnd) +{ + m_hwnd_rumble = hwnd; + m_hwnd_rumble_list = GetDlgItem(m_hwnd_rumble, IDC_RUMBLE_LIST); + SendMessage(m_hwnd_rumble_list, CB_ADDSTRING, 0, reinterpret_cast("")); + auto dev = g_InputDeviceManager.FindDevice(m_host_dev); + if (dev != nullptr) { + auto outputs = dev->GetOutputs(); + for (const auto out : outputs) { + SendMessage(m_hwnd_rumble_list, CB_ADDSTRING, 0, reinterpret_cast(out->GetName().c_str())); + } + } + SendMessage(m_hwnd_rumble_list, CB_SETCURSEL, SendMessage(m_hwnd_rumble_list, CB_FINDSTRINGEXACT, 1, + reinterpret_cast(m_rumble.c_str())), 0); +} + +void InputWindow::UpdateRumble(int command) +{ + switch (command) + { + case RUMBLE_SET: { + char rumble[30]; + SendMessage(m_hwnd_rumble_list, WM_GETTEXT, sizeof(rumble), reinterpret_cast(rumble)); + m_rumble = rumble; + } + break; + + case RUMBLE_UPDATE: { + m_DeviceConfig->FindButtonByIndex(m_max_num_buttons - 1)->UpdateText(m_rumble.c_str()); + } + break; + + case RUMBLE_TEST: { + DetectOutput(OUTPUT_TIMEOUT); + } + break; + + default: + break; + } +} + +void InputWindow::DetectOutput(int ms) +{ + if (m_rumble == std::string()) { + return; + } + auto dev = g_InputDeviceManager.FindDevice(m_host_dev); + if (dev != nullptr) { + // Don't block the message processing loop + std::thread([this, dev, ms]() { + EnableWindow(m_hwnd_rumble, FALSE); + SendMessage(m_hwnd_rumble_list, WM_SETTEXT, 0, reinterpret_cast("...")); + auto outputs = dev->GetOutputs(); + for (const auto out : outputs) { + if (out->GetName() == m_rumble) { + out->SetState(1.0, 1.0); + } + } + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); + for (const auto out : outputs) { + if (out->GetName() == m_rumble) { + out->SetState(0.0, 0.0); + } + } + SendMessage(m_hwnd_rumble_list, WM_SETTEXT, 0, reinterpret_cast("Test")); + EnableWindow(m_hwnd_rumble, TRUE); + }).detach(); + } +} diff --git a/src/common/input/InputWindow.h b/src/common/input/InputWindow.h new file mode 100644 index 000000000..c806cb2fa --- /dev/null +++ b/src/common/input/InputWindow.h @@ -0,0 +1,107 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#include "InputManager.h" +#include "common\Settings.hpp" +#include + +#define PROFILE_LOAD 1 +#define PROFILE_SAVE 2 +#define PROFILE_DELETE 3 +#define RUMBLE_SET 4 +#define RUMBLE_UPDATE 5 +#define RUMBLE_TEST 6 +#define RUMBLE_CLEAR 7 +#define BUTTON_CLEAR 8 + +#define XINPUT_DEFAULT 1 +#define DINPUT_DEFAULT 2 + +LRESULT CALLBACK ProfileNameSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); + + +class InputWindow +{ +public: + void Initialize(HWND hwnd, int port_num, int dev_type); + void InitRumble(HWND hwnd); + ~InputWindow(); + void UpdateDeviceList(); + void BindButton(int ControlID); + void BindDefault(); + void ClearBindings(); + void UpdateProfile(const std::string& name, int command); + void UpdateRumble(int command); + void UpdateCurrentDevice(); + bool IsProfileSaved(); + + +private: + typedef std::vector::iterator ProfileIt; + InputDevice::Input* DetectInput(InputDevice* const Device, int ms); + void DetectOutput(int ms); + ProfileIt FindProfile(const std::string& name); + void LoadProfile(const std::string& name); + bool SaveProfile(const std::string& name); + void DeleteProfile(const std::string& name); + void OverwriteProfile(const std::string& name); + void LoadDefaultProfile(); + int EnableDefaultButton(); + + // xbox device under configuration + EmuDevice* m_DeviceConfig; + // handle of the window + HWND m_hwnd_window; + // handle of the device list combobox + HWND m_hwnd_device_list; + // handle of the profile list combobox + HWND m_hwnd_profile_list; + // handle of the rumble window + HWND m_hwnd_rumble; + // handle of the rumble combobox + HWND m_hwnd_rumble_list; + // handle of the default bindings button + HWND m_hwnd_default; + // type of the device + int m_dev_type; + // num of buttons of device under configuration + int m_max_num_buttons; + // xbox port number the host device attaches to (0 - 3) + int m_port_num; + // host device under configuration + std::string m_host_dev; + // currently selected rumble control + std::string m_rumble; + // indicates if the current profile has unsaved changes + bool m_bHasChanges; + // prevent current input attempt to set the previous input at same time + std::atomic m_bIsBinding; +}; + +extern InputWindow* g_InputWindow; diff --git a/src/common/input/SdlJoystick.cpp b/src/common/input/SdlJoystick.cpp new file mode 100644 index 000000000..9122aed22 --- /dev/null +++ b/src/common/input/SdlJoystick.cpp @@ -0,0 +1,532 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Copyright 2010 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Derived from SDL.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +#define LOG_PREFIX CXBXR_MODULE::SDL + +#include +#include +#include "core\kernel\support\Emu.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "SdlJoystick.h" +#include "XInputPad.h" +#include "DInputKeyboardMouse.h" +#include "InputManager.h" + +// These values are those used by Dolphin! +static const uint16_t RUMBLE_PERIOD = 10; +static const uint16_t RUMBLE_LENGTH_MAX = 500; + + +namespace Sdl +{ + uint32_t ExitEvent_t; + uint32_t PopulateEvent_t; + uint32_t UpdateInputEvent_t; + uint32_t DeviceRemoveAck_t; + int SdlInitStatus = SDL_NOT_INIT; + bool SdlPopulateOK = false; + + void Init(std::mutex& Mtx, std::condition_variable& Cv) + { + SDL_Event Event; + uint32_t CustomEvent_t; + std::unique_lock lck(Mtx); + + if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC) < 0) { + EmuLog(LOG_LEVEL::ERROR2, "Failed to initialize SDL subsystem! The error was: %s", SDL_GetError()); + SdlInitStatus = SDL_INIT_ERROR; + lck.unlock(); + Cv.notify_one(); + return; + } + CustomEvent_t = SDL_RegisterEvents(4); + if (CustomEvent_t == (uint32_t)-1) { + SDL_Quit(); + EmuLog(LOG_LEVEL::ERROR2, "Failed to create SDL custom events!"); + SdlInitStatus = SDL_INIT_ERROR; + lck.unlock(); + Cv.notify_one(); + return; + } + ExitEvent_t = CustomEvent_t; + PopulateEvent_t = CustomEvent_t + 1; + UpdateInputEvent_t = CustomEvent_t + 2; + DeviceRemoveAck_t = CustomEvent_t + 3; + + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + + // Drain all joystick add/remove events to avoid creating duplicated + // devices when we call PopulateDevices + while (SDL_PollEvent(&Event)) + { + switch (Event.type) + { + case SDL_JOYDEVICEADDED: { break; } + case SDL_JOYDEVICEREMOVED: { break; } + default: + break; + } + } + SdlInitStatus = SDL_INIT_SUCCESS; + lck.unlock(); + Cv.notify_one(); + + while (SDL_WaitEvent(&Event)) + { + if (Event.type == SDL_JOYDEVICEADDED) { + OpenSdlDevice(Event.jdevice.which); + } + else if (Event.type == SDL_JOYDEVICEREMOVED) { + CloseSdlDevice(Event.jdevice.which); + } + else if (Event.type == SDL_JOYAXISMOTION || + Event.type == SDL_JOYHATMOTION || + Event.type == SDL_JOYBALLMOTION || + Event.type == SDL_JOYBUTTONDOWN || + Event.type == SDL_JOYBUTTONUP) { + SDL_JoystickID id; + switch (Event.type) + { + case SDL_JOYAXISMOTION: + id = Event.jaxis.which; + break; + + case SDL_JOYHATMOTION: + id = Event.jhat.which; + break; + + case SDL_JOYBALLMOTION: + id = Event.jball.which; + break; + + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + id = Event.jbutton.which; + break; + + default: { + // unreachable + } + } + auto dev = g_InputDeviceManager.FindDevice(id); + if (dev != nullptr) { + dynamic_cast(dev.get())->SetDirty(); + } + } + else if (Event.type == PopulateEvent_t) { + for (int i = 0; i < SDL_NumJoysticks(); i++) { + OpenSdlDevice(i); + } + SdlPopulateOK = true; + Cv.notify_one(); + } + else if (Event.type == ExitEvent_t) { + break; + } + else if (Event.type == UpdateInputEvent_t) { + XInput::GetDeviceChanges(); + DInput::GetDeviceChanges(); + g_InputDeviceManager.UpdateDevices(*static_cast(Event.user.data1), false); + delete Event.user.data1; + Event.user.data1 = nullptr; + } + else if (Event.type == DeviceRemoveAck_t) { + g_InputDeviceManager.UpdateDevices(*static_cast(Event.user.data1), true); + delete Event.user.data1; + Event.user.data1 = nullptr; + } + } + + SDL_Quit(); + } + + void DeInit(std::thread& Thr) + { + SdlInitStatus = SDL_NOT_INIT; + if (!Thr.joinable()) { + return; + } + + SDL_Event ExitEvent; + SDL_memset(&ExitEvent, 0, sizeof(SDL_Event)); + ExitEvent.type = ExitEvent_t; + SDL_PushEvent(&ExitEvent); + + Thr.join(); + } + + void OpenSdlDevice(const int Index) + { + SDL_Joystick* pJoystick = SDL_JoystickOpen(Index); + if (pJoystick) { + auto Device = std::make_shared(pJoystick, Index); + if (Device->IsXInput()) { + EmuLog(LOG_LEVEL::INFO, "Rejected joystick %i. It will be handled by XInput", Index); + return; + } + // only add the device if it has some I/O controls + if (!Device->GetInputs().empty() || !Device->GetOutputs().empty()) { + g_InputDeviceManager.AddDevice(std::move(Device)); + } + else { + EmuLog(LOG_LEVEL::INFO, "Rejected joystick %i. No controls detected", Index); + } + } + else { + EmuLog(LOG_LEVEL::ERROR2, "Failed to open joystick %i. The error was %s", Index, SDL_GetError()); + } + } + + void CloseSdlDevice(const int Index) + { + g_InputDeviceManager.RemoveDevice([&Index](const auto& Device) { + const SdlJoystick* joystick = dynamic_cast(Device); + return joystick && SDL_JoystickInstanceID(joystick->GetSDLJoystick()) == Index; + }); + } + + void PopulateDevices() + { + SDL_Event PopulateEvent; + SDL_memset(&PopulateEvent, 0, sizeof(SDL_Event)); + PopulateEvent.type = PopulateEvent_t; + SDL_PushEvent(&PopulateEvent); + } + + SdlJoystick::SdlJoystick(SDL_Joystick* const Joystick, const int Index) + : m_Joystick(Joystick), m_Sdl_ID(SDL_JoystickInstanceID(Joystick)), + m_DeviceName(StripSpaces(SDL_JoystickNameForIndex(Index))), m_bIsXInput(false) + { + uint8_t i; + int NumButtons, NumAxes, NumHats, NumBalls; + std::string lcasename; + + // From Dolphin: + // "really bad HACKS: do not use SDL for an XInput device, + // too many people on the forums pick the SDL device and ask: + // "why don't my 360 gamepad triggers/rumble work correctly?". + // Checking the name is probably good (and hacky) enough, + // but I'll double check with the num of buttons/axes" + // ergo720: also added check for xbox one and generic xinput controllers + lcasename = GetDeviceName(); + std::transform(lcasename.begin(), lcasename.end(), lcasename.begin(), tolower); + NumButtons = SDL_JoystickNumButtons(Joystick); + NumAxes = SDL_JoystickNumAxes(Joystick); + NumHats = SDL_JoystickNumHats(Joystick); + NumBalls = SDL_JoystickNumBalls(Joystick); + + if ((std::string::npos != lcasename.find("xbox 360")) && + (10 == NumButtons) && (5 == NumAxes) && + (1 == NumHats) && (0 == NumBalls)) + { + // this device won't be used + m_bIsXInput = true; + return; + } + /* FIXME: is this correct? */ + else if ((std::string::npos != lcasename.find("xbox one")) && + (10 == NumButtons) && (5 == NumAxes) && + (1 == NumHats) && (0 == NumBalls)) + { + // this device won't be used + m_bIsXInput = true; + return; + } + else if (std::string::npos != lcasename.find("xinput")) + { + // this device won't be used + m_bIsXInput = true; + return; + } + else if (NumButtons > 255 || NumAxes > 255 || + NumHats > 255 || NumBalls > 255) + { + // From Dolphin: + // "This device is invalid, don't use it. + // Some crazy devices (HP webcam 2100) end up as HID devices. + // SDL tries parsing these as joysticks" + return; + } + + // get buttons + for (i = 0; i != NumButtons; ++i) { + AddInput(new Button(i, m_Joystick)); + } + + // get hats + for (i = 0; i != NumHats; ++i) { + // each hat gets 4 input instances associated with it (up down left right) + for (uint8_t d = 0; d != 4; ++d) { + AddInput(new Hat(i, m_Joystick, d)); + } + } + + // get axes + for (i = 0; i != NumAxes; ++i) { + // each axis gets a negative and a positive input instance associated with it + AddAnalogInputs(new Axis(i, m_Joystick, -32768), new Axis(i, m_Joystick, 32767)); + } + + // try to get supported ff effects + m_Haptic = SDL_HapticOpenFromJoystick(m_Joystick); + if (m_Haptic) + { + const unsigned int SupportedEffects = SDL_HapticQuery(m_Haptic); + + // constant effect + if (SupportedEffects & SDL_HAPTIC_CONSTANT) { + AddOutput(new ConstantEffect(m_Haptic)); + } + + // ramp effect + if (SupportedEffects & SDL_HAPTIC_RAMP) { + AddOutput(new RampEffect(m_Haptic)); + } + + // sine effect + if (SupportedEffects & SDL_HAPTIC_SINE) { + AddOutput(new SineEffect(m_Haptic)); + } + + // triangle effect + if (SupportedEffects & SDL_HAPTIC_TRIANGLE) { + AddOutput(new TriangleEffect(m_Haptic)); + } + + // left-right effect + if (SupportedEffects & SDL_HAPTIC_LEFTRIGHT) { + AddOutput(new LeftRightEffect(m_Haptic)); + } + } + else { + EmuLog(LOG_LEVEL::INFO, "Joystick %i doesn't support any haptic effects", Index); + } + + // init dirty flag + m_bDirty = false; + } + + SdlJoystick::~SdlJoystick() + { + if (m_Haptic) + { + // stop/destroy all effects + SDL_HapticStopAll(m_Haptic); + // close haptic first + SDL_HapticClose(m_Haptic); + } + + // close joystick + SDL_JoystickClose(m_Joystick); + } + + std::string SdlJoystick::GetDeviceName() const + { + return m_DeviceName; + } + + std::string SdlJoystick::GetAPI() const + { + return "SDL"; + } + + SDL_Joystick* SdlJoystick::GetSDLJoystick() const + { + return m_Joystick; + } + + SDL_JoystickID SdlJoystick::GetId(SDL_JoystickID id) const + { + // ignore id argument + return m_Sdl_ID; + } + + bool SdlJoystick::UpdateInput() + { + SDL_JoystickUpdate(); + if (m_bDirty) { + m_bDirty = false; + return true; + } + return m_bDirty; + } + + std::string SdlJoystick::ConstantEffect::GetName() const + { + return "Constant"; + } + + std::string SdlJoystick::RampEffect::GetName() const + { + return "Ramp"; + } + + std::string SdlJoystick::SineEffect::GetName() const + { + return "Sine"; + } + + std::string SdlJoystick::TriangleEffect::GetName() const + { + return "Triangle"; + } + + std::string SdlJoystick::LeftRightEffect::GetName() const + { + return "LeftRight"; + } + + std::string SdlJoystick::Button::GetName() const + { + std::ostringstream ss; + ss << "Button " << (int)m_Index; + return ss.str(); + } + + std::string SdlJoystick::Axis::GetName() const + { + std::ostringstream ss; + ss << "Axis " << (int)m_Index << (m_Range < 0 ? '-' : '+'); + return ss.str(); + } + + std::string SdlJoystick::Hat::GetName() const + { + static char tmpstr[] = "Hat . ."; + // From Dolphin: "I don't think more than 10 hats are supported" + tmpstr[4] = (char)('0' + m_Index); + tmpstr[6] = "NESW"[m_Direction]; + return tmpstr; + } + + ControlState SdlJoystick::Button::GetState() const + { + return SDL_JoystickGetButton(m_Js, m_Index); + } + + ControlState SdlJoystick::Axis::GetState() const + { + return std::max(0.0, ControlState(SDL_JoystickGetAxis(m_Js, m_Index)) / m_Range); + } + + ControlState SdlJoystick::Hat::GetState() const + { + return (SDL_JoystickGetHat(m_Js, m_Index) & (1 << m_Direction)) > 0; + } + + void SdlJoystick::HapticEffect::SetState(ControlState StateLeft, ControlState StateRight) + { + memset(&m_Effect, 0, sizeof(m_Effect)); + if (StateLeft || StateRight) + { + SetSDLHapticEffect(StateLeft, StateRight); + } + else + { + // this module uses type==0 to indicate 'off' + m_Effect.type = 0; + } + Update(); + } + + void SdlJoystick::HapticEffect::Update() + { + if (m_ID == -1 && m_Effect.type > 0) + { + m_ID = SDL_HapticNewEffect(m_Haptic, &m_Effect); + if (m_ID > -1) { + SDL_HapticRunEffect(m_Haptic, m_ID, 1); + } + } + else if (m_ID > -1 && m_Effect.type == 0) + { + SDL_HapticStopEffect(m_Haptic, m_ID); + SDL_HapticDestroyEffect(m_Haptic, m_ID); + m_ID = -1; + } + else if (m_ID > -1) + { + SDL_HapticUpdateEffect(m_Haptic, m_ID, &m_Effect); + } + } + + // I'm not really sure if a simple arithmetic mean is enough here, if someone has a better idea they are welcome + // to change the code below + void SdlJoystick::ConstantEffect::SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) + { + m_Effect.type = SDL_HAPTIC_CONSTANT; + m_Effect.constant.length = RUMBLE_LENGTH_MAX; + m_Effect.constant.level = (Sint16)(((StateLeft + StateRight) / 2) * 0x7FFF); + } + + void SdlJoystick::RampEffect::SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) + { + m_Effect.type = SDL_HAPTIC_RAMP; + m_Effect.ramp.length = RUMBLE_LENGTH_MAX; + m_Effect.ramp.start = (Sint16)(((StateLeft + StateRight) / 2) * 0x7FFF); + } + + void SdlJoystick::SineEffect::SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) + { + m_Effect.type = SDL_HAPTIC_SINE; + m_Effect.periodic.period = RUMBLE_PERIOD; + m_Effect.periodic.magnitude = (Sint16)(((StateLeft + StateRight) / 2) * 0x7FFF); + m_Effect.periodic.offset = 0; + m_Effect.periodic.phase = 18000; + m_Effect.periodic.length = RUMBLE_LENGTH_MAX; + m_Effect.periodic.delay = 0; + m_Effect.periodic.attack_length = 0; + } + + void SdlJoystick::TriangleEffect::SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) + { + m_Effect.type = SDL_HAPTIC_TRIANGLE; + m_Effect.periodic.period = RUMBLE_PERIOD; + m_Effect.periodic.magnitude = (Sint16)(((StateLeft + StateRight) / 2) * 0x7FFF); + m_Effect.periodic.offset = 0; + m_Effect.periodic.phase = 18000; + m_Effect.periodic.length = RUMBLE_LENGTH_MAX; + m_Effect.periodic.delay = 0; + m_Effect.periodic.attack_length = 0; + } + + void SdlJoystick::LeftRightEffect::SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) + { + m_Effect.type = SDL_HAPTIC_LEFTRIGHT; + m_Effect.leftright.length = RUMBLE_LENGTH_MAX; + // max ranges tuned to 'feel' similar in magnitude to triangle/sine on xbox360 controller + m_Effect.leftright.large_magnitude = (Uint16)(StateRight * 0x4000); + m_Effect.leftright.small_magnitude = (Uint16)(StateLeft * 0xFFFF); + } +} diff --git a/src/common/input/SdlJoystick.h b/src/common/input/SdlJoystick.h new file mode 100644 index 000000000..9cd646710 --- /dev/null +++ b/src/common/input/SdlJoystick.h @@ -0,0 +1,219 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef SDL_H_ +#define SDL_H_ + +#include "InputDevice.h" +#include +#include + + +namespace Sdl +{ + typedef enum _SDL_INIT_STATUS : int + { + SDL_NOT_INIT = -2, + SDL_INIT_ERROR, + SDL_INIT_SUCCESS, + } + SDL_INIT_STATUS; + + extern uint32_t ExitEvent_t; + extern uint32_t PopulateEvent_t; + extern uint32_t UpdateInputEvent_t; + extern uint32_t DeviceRemoveAck_t; + extern int SdlInitStatus; + extern bool SdlPopulateOK; + + // initialize SDL + void Init(std::mutex& Mtx, std::condition_variable& Cv); + // shutdown SDL + void DeInit(std::thread& Thr); + // open the sdl joystick with the specified index + void OpenSdlDevice(const int Index); + // close the sdl joystick with the specified index + void CloseSdlDevice(const int Index); + // refresh the device list in response to a refresh command from the input GUI + void PopulateDevices(); + + class SdlJoystick : public InputDevice + { + public: + SdlJoystick(SDL_Joystick* const Joystick, const int Index); + ~SdlJoystick(); + // retrieves the name of the device + std::string GetDeviceName() const override; + // returns "SDL" + std::string GetAPI() const override; + // retrieves the joystick identifier used by SDL + SDL_Joystick* GetSDLJoystick() const; + // updates the state of this joystick + bool UpdateInput() override; + // retrieves the sdl id of this device + SDL_JoystickID GetId(SDL_JoystickID id) const override; + // sets dirty flag + void SetDirty() { m_bDirty = true; } + // checks if the device supports xinput + bool IsXInput() const { return m_bIsXInput; } + + private: + class Button : public InputDevice::Input + { + public: + Button(uint8_t Index, SDL_Joystick* Js) : m_Index(Index), m_Js(Js) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + // pointer to the device this button belongs to + SDL_Joystick* const m_Js; + // arbitrary index assigned to this button + const uint8_t m_Index; + }; + + class Hat : public InputDevice::Input + { + public: + Hat(uint8_t Index, SDL_Joystick* Js, uint8_t Direction) : m_Index(Index), m_Js(Js), m_Direction(Direction) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + // pointer to the device this hat button belongs to + SDL_Joystick* const m_Js; + // identifies the direction of the hat button (arbitrary, assigned by us) + const uint8_t m_Direction; + // arbitrary index assigned to this hat button + const uint8_t m_Index; + }; + + class Axis : public InputDevice::Input + { + public: + std::string GetName() const override; + Axis(uint8_t Index, SDL_Joystick* Js, int16_t Range) : m_Index(Index), m_Js(Js), m_Range(Range) {} + ControlState GetState() const override; + + private: + // pointer to the device this axis belongs to + SDL_Joystick* const m_Js; + // max value of this axis + const int16_t m_Range; + // arbitrary index assigned to this axis + const uint8_t m_Index; + }; + + class HapticEffect : public Output + { + public: + HapticEffect(SDL_Haptic* Haptic) : m_Haptic(Haptic), m_ID(-1) {} + ~HapticEffect() + { + m_Effect.type = 0; + Update(); + } + + protected: + void Update(); + virtual void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) = 0; + + // the type of haptic effect + SDL_HapticEffect m_Effect; + // haptic device identifier as assigned by SDL, if available + SDL_Haptic* m_Haptic; + // id of the effect as returned by SDL + int m_ID; + + private: + virtual void SetState(ControlState StateLeft, ControlState StateRight) override final; + }; + + class ConstantEffect : public HapticEffect + { + public: + ConstantEffect(SDL_Haptic* Haptic) : HapticEffect(Haptic) {} + std::string GetName() const override; + + private: + void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) override; + }; + + class RampEffect : public HapticEffect + { + public: + RampEffect(SDL_Haptic* Haptic) : HapticEffect(Haptic) {} + std::string GetName() const override; + + private: + void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) override; + }; + + class SineEffect : public HapticEffect + { + public: + SineEffect(SDL_Haptic* Haptic) : HapticEffect(Haptic) {} + std::string GetName() const override; + + private: + void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) override; + }; + + class TriangleEffect : public HapticEffect + { + public: + TriangleEffect(SDL_Haptic* Haptic) : HapticEffect(Haptic) {} + std::string GetName() const override; + + private: + void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) override; + }; + + class LeftRightEffect : public HapticEffect + { + public: + LeftRightEffect(SDL_Haptic* Haptic) : HapticEffect(Haptic) {} + std::string GetName() const override; + + private: + void SetSDLHapticEffect(ControlState StateLeft, ControlState StateRight) override; + }; + + // the friendly name of the device + std::string m_DeviceName; + // pointer to the device as assigned by SDL + SDL_Joystick* m_Joystick; + // sdl-assigned id to this device + SDL_JoystickID m_Sdl_ID; + // haptic device identifier as assigned by SDL, if available + SDL_Haptic* m_Haptic; + // indicates if the device supports xinput + bool m_bIsXInput; + }; +} + +#endif diff --git a/src/common/input/XInputPad.cpp b/src/common/input/XInputPad.cpp new file mode 100644 index 000000000..8162e342e --- /dev/null +++ b/src/common/input/XInputPad.cpp @@ -0,0 +1,325 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Copyright 2010 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Derived from XInput.cpp of Dolphin emulator +// https://github.com/dolphin-emu/dolphin + +#define LOG_PREFIX CXBXR_MODULE::XINP + +#include "XInputPad.h" +#include "core\kernel\support\Emu.h" +#include "InputManager.h" + +// For MinGW +#ifndef XINPUT_DLL +#define XINPUT_DLL "xinput1_3.dll" +#endif + +#ifndef XINPUT_GAMEPAD_GUIDE +#define XINPUT_GAMEPAD_GUIDE 0x0400 +#endif + +// These are defined in the Xinput.h header supplied by Windows, but because we use _WIN32_WINNT=0x0601, they are greyed out. +// If the init function loads succesfully the 1.3 library version, then XInputGetCapabilities can return these subtypes too. +#ifndef XINPUT_DEVSUBTYPE_FLIGHT_STICK +#define XINPUT_DEVSUBTYPE_UNKNOWN 0x00 +#define XINPUT_DEVSUBTYPE_WHEEL 0x02 +#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 +#define XINPUT_DEVSUBTYPE_FLIGHT_STICK 0x04 +#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 +#define XINPUT_DEVSUBTYPE_GUITAR 0x06 +#define XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE 0x07 +#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 +#define XINPUT_DEVSUBTYPE_GUITAR_BASS 0x0B +#define XINPUT_DEVSUBTYPE_ARCADE_PAD 0x13 +#endif + + +namespace XInput +{ + typedef decltype(&XInputGetCapabilities) XInputGetCapabilities_t; + typedef decltype(&XInputSetState) XInputSetState_t; + typedef decltype(&XInputGetState) XInputGetState_t; + + static HMODULE hXInput = nullptr; + static XInputGetCapabilities_t PXInputGetCapabilities = nullptr; + static XInputSetState_t PXInputSetState = nullptr; + static XInputGetState_t PXInputGetState = nullptr; + + static bool haveGuideButton = false; + int XInputInitStatus = XINPUT_NOT_INIT; + uint8_t DevicesConnected = 0; + + static const struct + { + const char* const name; + const WORD bitmask; + } named_buttons[] = { { "Button A", XINPUT_GAMEPAD_A }, + { "Button B", XINPUT_GAMEPAD_B }, + { "Button X", XINPUT_GAMEPAD_X }, + { "Button Y", XINPUT_GAMEPAD_Y }, + { "Pad N", XINPUT_GAMEPAD_DPAD_UP }, + { "Pad S", XINPUT_GAMEPAD_DPAD_DOWN }, + { "Pad W", XINPUT_GAMEPAD_DPAD_LEFT }, + { "Pad E", XINPUT_GAMEPAD_DPAD_RIGHT }, + { "Start", XINPUT_GAMEPAD_START }, + { "Back", XINPUT_GAMEPAD_BACK }, + { "Shoulder L", XINPUT_GAMEPAD_LEFT_SHOULDER }, + { "Shoulder R", XINPUT_GAMEPAD_RIGHT_SHOULDER }, + { "Guide", XINPUT_GAMEPAD_GUIDE }, + { "Thumb L", XINPUT_GAMEPAD_LEFT_THUMB }, + { "Thumb R", XINPUT_GAMEPAD_RIGHT_THUMB } }; + + static const char* const named_triggers[] = { "Trigger L", "Trigger R" }; + + static const char* const named_axes[] = { "Left X", "Left Y", "Right X", "Right Y" }; + + void Init(std::mutex& Mtx) + { + std::unique_lock lck(Mtx); + + // Because we use _WIN32_WINNT=0x0601, this will load the XInput 9.1.0 library + // The 9.1.0 (Win7) doesn't provide support for the guide button, but the legacy 1.3 does. Unfortunately, it requires + // that the user has installed the June 2010 release of the DirectX SDK to be available. If they didn't, we will default + // to the 9.1.0 instead of failing the initialization + if (std::string(XINPUT_DLL).compare(TEXT("xinput9_1_0.dll")) == 0) { + hXInput = ::LoadLibrary(TEXT("xinput1_3.dll")); + } + if (!hXInput) { + hXInput = ::LoadLibrary(XINPUT_DLL); + if (!hXInput) { + EmuLog(LOG_LEVEL::ERROR2, "Failed to initialize XInput subsystem!"); + XInputInitStatus = XINPUT_INIT_ERROR; + return; + } + } + + PXInputGetCapabilities = + (XInputGetCapabilities_t)::GetProcAddress(hXInput, "XInputGetCapabilities"); + PXInputSetState = (XInputSetState_t)::GetProcAddress(hXInput, "XInputSetState"); + + // Ordinal 100 is the same as XInputGetState, except it doesn't dummy out the guide + // button info. Try loading it and fall back if needed. + PXInputGetState = (XInputGetState_t)::GetProcAddress(hXInput, (LPCSTR)100); + if (PXInputGetState) { + haveGuideButton = true; + } + else { + PXInputGetState = (XInputGetState_t)::GetProcAddress(hXInput, "XInputGetState"); + } + + if (!PXInputGetCapabilities || !PXInputSetState || !PXInputGetState) + { + ::FreeLibrary(hXInput); + hXInput = nullptr; + EmuLog(LOG_LEVEL::ERROR2, "Failed to find XInput functions!"); + XInputInitStatus = XINPUT_INIT_ERROR; + return; + } + XInputInitStatus = XINPUT_INIT_SUCCESS; + } + + void DeInit() + { + XInputInitStatus = XINPUT_NOT_INIT; + if (hXInput) + { + ::FreeLibrary(hXInput); + hXInput = nullptr; + } + } + + void GetDeviceChanges() + { + XINPUT_CAPABILITIES caps; + DWORD ret; + for (uint8_t i = 0, mask = 1; i != 4; ++i, mask <<= 1) { + ret = PXInputGetCapabilities(i, 0, &caps); + if ((ERROR_SUCCESS == ret) && !(DevicesConnected & mask)) { + auto Device = std::make_shared(caps, i); + // only add the device if it has some I/O controls + if (!Device->GetInputs().empty() || !Device->GetOutputs().empty()) { + g_InputDeviceManager.AddDevice(std::move(Device)); + } + else { + EmuLog(LOG_LEVEL::INFO, "Rejected XInput device %i. No controls detected", i); + } + DevicesConnected |= mask; + } + else if ((ERROR_DEVICE_NOT_CONNECTED == ret) && (DevicesConnected & mask)) { + g_InputDeviceManager.RemoveDevice([&i](const auto& Device) { + const XDevice* dev = dynamic_cast(Device); + return dev && (dev->GetXInputDevice() == i); + }); + DevicesConnected &= ~mask; + } + } + } + + void PopulateDevices() + { + DevicesConnected = 0; + GetDeviceChanges(); + } + + XDevice::XDevice(const XINPUT_CAPABILITIES& Capabilities, uint8_t Index) : m_Subtype(Capabilities.SubType), m_Index(Index), + m_dwPacketNumber(0) + { + // XInputGetCaps can be broken on some devices, so we'll just ignore it + // and assume all gamepad + vibration capabilities are supported + + // get supported buttons + for (int i = 0; i != sizeof(named_buttons) / sizeof(*named_buttons); ++i) { + // Only add guide button if we have the 100 ordinal XInputGetState + if (!(named_buttons[i].bitmask & XINPUT_GAMEPAD_GUIDE) || haveGuideButton) { + AddInput(new Button(i, m_state_in.Gamepad.wButtons)); + } + } + + // get supported triggers + for (int i = 0; i != sizeof(named_triggers) / sizeof(*named_triggers); ++i) { + AddInput(new Trigger(i, (&m_state_in.Gamepad.bLeftTrigger)[i], 255)); + } + + // get supported axes + for (int i = 0; i != sizeof(named_axes) / sizeof(*named_axes); ++i) { + const SHORT& ax = (&m_state_in.Gamepad.sThumbLX)[i]; + + // each axis gets a negative and a positive input instance associated with it + AddInput(new Axis(i, ax, -32768)); + AddInput(new Axis(i, ax, 32767)); + } + + // get supported motors + AddOutput(new Motor(this, m_state_out.wLeftMotorSpeed, m_state_out.wRightMotorSpeed, 65535)); + + memset(&m_state_in, 0, sizeof(m_state_in)); + } + + std::string XDevice::GetDeviceName() const + { + switch (m_Subtype) + { + case XINPUT_DEVSUBTYPE_GAMEPAD: + return "Gamepad"; + case XINPUT_DEVSUBTYPE_WHEEL: + return "Wheel"; + case XINPUT_DEVSUBTYPE_ARCADE_STICK: + return "Arcade Stick"; + case XINPUT_DEVSUBTYPE_FLIGHT_STICK: + return "Flight Stick"; + case XINPUT_DEVSUBTYPE_DANCE_PAD: + return "Dance Pad"; + case XINPUT_DEVSUBTYPE_GUITAR: + return "Guitar"; + case XINPUT_DEVSUBTYPE_DRUM_KIT: + return "Drum Kit"; + default: + return "Device"; + } + } + + std::string XDevice::GetAPI() const + { + return "XInput"; + } + + uint8_t XDevice::GetXInputDevice() const + { + return m_Index; + } + + // Update I/O + + bool XDevice::UpdateInput() + { + if (PXInputGetState(m_Index, &m_state_in) != ERROR_SUCCESS) { + return false; + } + DWORD packet_number = m_state_in.dwPacketNumber; + if (packet_number != m_dwPacketNumber) { + m_dwPacketNumber = packet_number; + return true; + } + return false; + } + + void XDevice::UpdateMotors() + { + PXInputSetState(m_Index, &m_state_out); + } + + // GET name/source/id + + std::string XDevice::Button::GetName() const + { + return named_buttons[m_Index].name; + } + + std::string XDevice::Axis::GetName() const + { + return std::string(named_axes[m_Index]) + (m_Range < 0 ? '-' : '+'); + } + + std::string XDevice::Trigger::GetName() const + { + return named_triggers[m_Index]; + } + + std::string XDevice::Motor::GetName() const + { + return "LeftRight"; + } + + // GET / SET STATES + + ControlState XDevice::Button::GetState() const + { + return (m_Buttons & named_buttons[m_Index].bitmask) > 0; + } + + ControlState XDevice::Trigger::GetState() const + { + return ControlState(m_Trigger) / m_Range; + } + + ControlState XDevice::Axis::GetState() const + { + return std::max(0.0, ControlState(m_Axis) / m_Range); + } + + void XDevice::Motor::SetState(ControlState StateLeft, ControlState StateRight) + { + m_MotorLeft = (WORD)(StateLeft * m_Range); + m_MotorRight = (WORD)(StateRight * m_Range); + m_Parent->UpdateMotors(); + } +} diff --git a/src/common/input/XInputPad.h b/src/common/input/XInputPad.h new file mode 100644 index 000000000..f6faae243 --- /dev/null +++ b/src/common/input/XInputPad.h @@ -0,0 +1,144 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#include +#include +#include "InputDevice.h" + + +namespace XInput +{ + typedef enum _XINPUT_INIT_STATUS : int + { + XINPUT_NOT_INIT = -2, + XINPUT_INIT_ERROR, + XINPUT_INIT_SUCCESS, + } + XINPUT_INIT_STATUS; + + extern int XInputInitStatus; + extern uint8_t DevicesConnected; + + // initialize XInput + void Init(std::mutex& Mtx); + // shutdown XInput + void DeInit(); + // refresh the device list in response to a refresh command from the input GUI + void PopulateDevices(); + // update the device list + void GetDeviceChanges(); + + class XDevice : public InputDevice + { + private: + class Button : public InputDevice::Input + { + public: + Button(uint8_t Index, const WORD& Buttons) : m_Buttons(Buttons), m_Index(Index) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + // button state + const WORD& m_Buttons; + // button index + uint8_t m_Index; + }; + + class Axis : public InputDevice::Input + { + public: + Axis(uint8_t Index, const SHORT& Axis, SHORT Range) : m_Index(Index), m_Axis(Axis), m_Range(Range) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + // axis state + const SHORT& m_Axis; + // max value of the axis + const SHORT m_Range; + // axis index + const uint8_t m_Index; + }; + + class Trigger : public InputDevice::Input + { + public: + Trigger(uint8_t Index, const BYTE& Trigger, BYTE Range) + : m_Trigger(Trigger), m_Range(Range), m_Index(Index) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + // trigger state + const BYTE& m_Trigger; + // max value of the trigger + const BYTE m_Range; + // trigger index + const uint8_t m_Index; + }; + + class Motor : public InputDevice::Output + { + public: + Motor(XDevice* Parent, WORD& MotorLeft, WORD& MotorRight, WORD Range) + : m_MotorLeft(MotorLeft), m_MotorRight(MotorRight), m_Range(Range), m_Parent(Parent) {} + std::string GetName() const override; + void SetState(ControlState StateLeft, ControlState StateRight) override; + + private: + // left motor state + WORD& m_MotorLeft; + // right motor state + WORD& m_MotorRight; + // max value of the motor strength + const WORD m_Range; + // parent object of the motor + XDevice* m_Parent; + }; + + public: + bool UpdateInput() override; + + XDevice(const XINPUT_CAPABILITIES& Capabilities, uint8_t Index); + + std::string GetDeviceName() const override; + std::string GetAPI() const override; + uint8_t GetXInputDevice() const; + + void UpdateMotors(); + + private: + XINPUT_STATE m_state_in; + XINPUT_VIBRATION m_state_out{}; + const BYTE m_Subtype; + const uint8_t m_Index; + DWORD m_dwPacketNumber; + }; +} diff --git a/src/common/input/layout_xbox_controller.h b/src/common/input/layout_xbox_controller.h new file mode 100644 index 000000000..5278de997 --- /dev/null +++ b/src/common/input/layout_xbox_controller.h @@ -0,0 +1,88 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#ifndef CXBXR_EMU_EXPORTS +#include "gui/ResCxbx.h" + +static int button_xbox_ctrl_id[XBOX_CTRL_NUM_BUTTONS] = { + IDC_SET_DPAD_UP, + IDC_SET_DPAD_DOWN, + IDC_SET_DPAD_LEFT, + IDC_SET_DPAD_RIGHT, + IDC_SET_START, + IDC_SET_BACK, + IDC_SET_LTHUMB, + IDC_SET_RTHUMB, + IDC_SET_A, + IDC_SET_B, + IDC_SET_X, + IDC_SET_Y, + IDC_SET_BLACK, + IDC_SET_WHITE, + IDC_SET_LTRIGGER, + IDC_SET_RTRIGGER, + IDC_SET_LEFT_POSX, + IDC_SET_LEFT_NEGX, + IDC_SET_LEFT_POSY, + IDC_SET_LEFT_NEGY, + IDC_SET_RIGHT_POSX, + IDC_SET_RIGHT_NEGX, + IDC_SET_RIGHT_POSY, + IDC_SET_RIGHT_NEGY, + IDC_SET_MOTOR, +}; +#endif + +static const char* button_xbox_ctrl_names[XBOX_CTRL_NUM_BUTTONS][3] = { + "D Pad Up", "Pad N", "UP", + "D Pad Down", "Pad S", "DOWN", + "D Pad Left", "Pad W", "LEFT", + "D Pad Right", "Pad E", "RIGHT", + "Start", "Start", "RETURN", + "Back", "Back", "SPACE", + "L Thumb", "Thumb L", "B", + "R Thumb", "Thumb R", "M", + "A", "Button A", "S", + "B", "Button B", "D", + "X", "Button X", "W", + "Y", "Button Y", "E", + "Black", "Shoulder R", "C", + "White", "Shoulder L", "X", + "L Trigger", "Trigger L", "Q", + "R Trigger", "Trigger R", "R", + "Left Axis X+", "Left X+", "H", + "Left Axis X-", "Left X-", "F", + "Left Axis Y+", "Left Y+", "T", + "Left Axis Y-", "Left Y-", "G", + "Right Axis X+", "Right X+", "L", + "Right Axis X-", "Right X-", "J", + "Right Axis Y+", "Right Y+", "I", + "Right Axis Y-", "Right Y-", "K", + "Motor", "LeftRight", "", +}; diff --git a/src/Common/Linux/AlignPosfix1.h b/src/common/linux/AlignPosfix1.h similarity index 77% rename from src/Common/Linux/AlignPosfix1.h rename to src/common/linux/AlignPosfix1.h index 8d77c471b..e7d1b8764 100644 --- a/src/Common/Linux/AlignPosfix1.h +++ b/src/common/linux/AlignPosfix1.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Linux->AlignPosfix1.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Common/Linux/AlignPrefix1.h b/src/common/linux/AlignPrefix1.h similarity index 77% rename from src/Common/Linux/AlignPrefix1.h rename to src/common/linux/AlignPrefix1.h index df42c30ed..1dee381dd 100644 --- a/src/Common/Linux/AlignPrefix1.h +++ b/src/common/linux/AlignPrefix1.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Linux->AlignPrefix1.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/common/util/CPUID.h b/src/common/util/CPUID.h new file mode 100644 index 000000000..b8dbd97e4 --- /dev/null +++ b/src/common/util/CPUID.h @@ -0,0 +1,57 @@ +// https://stackoverflow.com/questions/1666093/cpuid-implementations-in-c + +#ifndef CPUID_H +#define CPUID_H + +#ifdef _WIN32 +#include +#include +#include +typedef unsigned __int32 uint32_t; + +#else +#include +#endif + +class CPUID { + uint32_t regs[4]; + +public: + explicit CPUID(unsigned i) { +#ifdef _WIN32 + __cpuid((int *)regs, (int)i); + +#else + asm volatile + ("cpuid" : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) + : "a" (i), "c" (0)); + // ECX is set to zero for CPUID function 4 +#endif + } + + const std::bitset<32> &EAX() const { return (std::bitset<32> &)regs[0]; } + const std::bitset<32> &EBX() const { return (std::bitset<32> &)regs[1]; } + const std::bitset<32> &ECX() const { return (std::bitset<32> &)regs[2]; } + const std::bitset<32> &EDX() const { return (std::bitset<32> &)regs[3]; } +}; + +class SimdCaps { + +public: + const bool SSE(void) { return f_1.EDX()[25]; } + const bool SSE2(void) { return f_1.EDX()[26]; } + const bool SSE3(void) { return f_1.ECX()[0]; } + const bool SSSE3(void) { return f_1.ECX()[9]; } + const bool SSE41(void) { return f_1.ECX()[19]; } + const bool SSE42(void) { return f_1.ECX()[20]; } + const bool AVX(void) { return f_1.ECX()[1]; } + const bool AVX2(void) { return f_7.EBX()[5]; } + +private: + const CPUID f_1 = CPUID(1); + const CPUID f_7 = CPUID(7); +}; + +static SimdCaps bob; + +#endif // CPUID_H diff --git a/src/common/util/CxbxUtil.cpp b/src/common/util/CxbxUtil.cpp new file mode 100644 index 000000000..09caf894d --- /dev/null +++ b/src/common/util/CxbxUtil.cpp @@ -0,0 +1,272 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: Muldiv64 is from qemu-common.h which doesn't have a license header, iovector functions are from iov.c file. +// Both files were originally taken from XQEMU (GPLv2) +// https://xqemu.com/ + +/* +* Helpers for getting linearized buffers from iov / filling buffers into iovs +* +* Copyright IBM, Corp. 2007, 2008 +* Copyright (C) 2010 Red Hat, Inc. +* +* Author(s): +* Anthony Liguori +* Amit Shah +* Michael Tokarev +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +* +* Contributions after 2012-01-13 are licensed under the terms of the +* GNU GPL, version 2 or (at your option) any later version. +*/ + + +// The intent of this file is to add general functions which are not kernel specific (for those CxbxKrnl.h should be used instead) + +#include // For memcpy +#include "common\util\CxbxUtil.h" +#include "core\kernel\init\CxbxKrnl.h" + +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + + +// Disable a compiler warning relative to uint64_t -> uint32_t conversions in Muldiv64. This function is taken from +// QEMU so it should be safe regardless +#pragma warning(suppress: 4244) +// Compute (a*b)/c with a 96 bit intermediate result +uint64_t Muldiv64(uint64_t a, uint32_t b, uint32_t c) +{ + union { + uint64_t ll; + struct { + uint32_t low, high; + } l; + } u, res; + uint64_t rl, rh; + + u.ll = a; + rl = (uint64_t)u.l.low * (uint64_t)b; + rh = (uint64_t)u.l.high * (uint64_t)b; + rh += (rl >> 32); + res.l.high = rh / c; + res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c; + return res.ll; +} + +void IoVecReset(IOVector* qiov) +{ + assert(qiov->AllocNumber != -1); + + qiov->IoVecNumber = 0; + qiov->Size = 0; +} + +void IoVecAdd(IOVector* qiov, void* base, size_t len) +{ + assert(qiov->AllocNumber != -1); + + if (qiov->IoVecNumber == qiov->AllocNumber) { + qiov->AllocNumber = 2 * qiov->AllocNumber + 1; + qiov->IoVecStruct = static_cast(std::realloc(qiov->IoVecStruct, qiov->AllocNumber * sizeof(IOVector))); + } + qiov->IoVecStruct[qiov->IoVecNumber].Iov_Base = base; + qiov->IoVecStruct[qiov->IoVecNumber].Iov_Len = len; + qiov->Size += len; + ++qiov->IoVecNumber; +} + +// This takes "iov_cnt" of "iov" buffers as input and copies sequentially their contents to the "buf" output buffer. +// "offset" indicates the offset inside "bytes" (total lenght of "iov" buffers) where the copy is going to start. +// "offset" must be less than "bytes" or else the assertion will fail. "done" is the number of bytes actually copied +size_t IoVecTobuffer(const IoVec* iov, const unsigned int iov_cnt, size_t offset, void* buf, size_t bytes) +{ + size_t done; + unsigned int i; + for (i = 0, done = 0; (offset || done < bytes) && i < iov_cnt; i++) { + if (offset < iov[i].Iov_Len) { + size_t len = MIN(iov[i].Iov_Len - offset, bytes - done); + std::memcpy(static_cast(buf) + done, static_cast(iov[i].Iov_Base) + offset, len); + done += len; + offset = 0; + } + else { + offset -= iov[i].Iov_Len; + } + } + assert(offset == 0); + return done; +} + +// This does the opposite of IoVecTobuffer: it takes "buf" as input and copies sequentially its contents to the +// "iov" output buffers. +size_t IoVecFromBuffer(const IoVec* iov, unsigned int iov_cnt, size_t offset, void* buf, size_t bytes) +{ + size_t done; + unsigned int i; + for (i = 0, done = 0; (offset || done < bytes) && i < iov_cnt; i++) { + if (offset < iov[i].Iov_Len) { + size_t len = MIN(iov[i].Iov_Len - offset, bytes - done); + std::memcpy(static_cast(iov[i].Iov_Base) + offset, static_cast(buf) + done, len); + done += len; + offset = 0; + } + else { + offset -= iov[i].Iov_Len; + } + } + assert(offset == 0); + return done; +} + +// Read an array of DWORDs in memory +bool GetDwords(xbaddr Paddr, uint32_t* Buffer, int Number) +{ + for (int i = 0; i < Number; i++, Buffer++, Paddr += sizeof(*Buffer)) { + // dropped little -> big endian conversion from XQEMU + if (Memory_R(reinterpret_cast(Paddr), Buffer, 4)) { + return true; + } + } + return false; +} + +// Write an array of DWORDs in memory +bool WriteDwords(xbaddr Paddr, uint32_t* Buffer, int Number) +{ + for (int i = 0; i < Number; i++, Buffer++, Paddr += sizeof(*Buffer)) { + // dropped big -> little endian conversion from XQEMU + if (Memory_W(reinterpret_cast(Paddr), Buffer, 4)) { + return true; + } + } + return false; +} + +// Read an array of WORDs in memory +bool GetWords(xbaddr Paddr, uint16_t* Buffer, int Number) +{ + for (int i = 0; i < Number; i++, Buffer++, Paddr += sizeof(*Buffer)) { + // dropped little -> big endian conversion from XQEMU + if (Memory_R(reinterpret_cast(Paddr), Buffer, 2)) { + return true; + } + } + return false; +} + +// Write an array of WORDs in memory +bool WriteWords(xbaddr Paddr, uint16_t* Buffer, int Number) +{ + for (int i = 0; i < Number; i++, Buffer++, Paddr += sizeof(*Buffer)) { + // dropped big -> little endian conversion from XQEMU + if (Memory_W(reinterpret_cast(Paddr), Buffer, 2)) { + return true; + } + } + return false; +} + +bool Memory_R(void* Addr, void* Buf, size_t Num) +{ + bool Error = false; + + if (Num != 0) { + if (Addr == nullptr) { + Error = true; + } + else { + std::memcpy(Buf, Addr, Num); + } + } + return Error; +} + +bool Memory_W(void* Addr, void* Buf, size_t Num) +{ + bool Error = false; + + if (Num != 0) { + if (Addr == nullptr) { + Error = true; + } + else { + std::memcpy(Addr, Buf, Num); + } + } + return Error; +} + +bool Memory_RW(void* Addr, void* Buf, size_t Num, bool bIsWrite) +{ + if (bIsWrite) { + return Memory_W(Addr, Buf, Num); + } + else { + return Memory_R(Addr, Buf, Num); + } +} + +// Converts LF to CRLF line endings +void unix2dos(std::string& string) +{ + size_t position = 0; + while (true) { + position = string.find('\n', position); + if (position == std::string::npos) { + break; + } + if (position != 0 && string.compare(position - 1, 2U, "\r\n") == 0) { + position++; + continue; + } + string.insert(position, 1, '\r'); + position += 2; + } +} + +// Copyright 2008 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file of Dolphin at https://github.com/dolphin-emu/dolphin/blob/master/license.txt. + +// Source: StringUtil.cpp of Dolphin emulator +/* Turns " hello " into "hello". Also handles tabs */ +std::string StripSpaces(const std::string& str) +{ + const size_t s = str.find_first_not_of(" \t\r\n"); + + if (str.npos != s) { + return str.substr(s, str.find_last_not_of(" \t\r\n") - s + 1); + } + else { + return ""; + } +} diff --git a/src/common/util/CxbxUtil.h b/src/common/util/CxbxUtil.h new file mode 100644 index 000000000..0da5beda8 --- /dev/null +++ b/src/common/util/CxbxUtil.h @@ -0,0 +1,106 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef CXBXUTIL_H +#define CXBXUTIL_H + +#include "Cxbx.h" +#include +#include +#include +#include + +/* This is a linux struct for vectored I/O. See readv() and writev() */ +struct IoVec +{ + void* Iov_Base; // Starting address + size_t Iov_Len; // Number of bytes to transfer +}; + +struct IOVector +{ + IoVec* IoVecStruct; + int IoVecNumber; // number of I/O buffers supplied + int AllocNumber; // number of IoVec structs currently allocated + size_t Size; // total size of all I/O buffers supplied +}; + +uint64_t Muldiv64(uint64_t a, uint32_t b, uint32_t c); + +void IoVecReset(IOVector* qiov); +void IoVecAdd(IOVector* qiov, void* base, size_t len); +size_t IoVecTobuffer(const IoVec* iov, const unsigned int iov_cnt, size_t offset, void *buf, size_t bytes); +size_t IoVecFromBuffer(const IoVec* iov, unsigned int iov_cnt, size_t offset, void* buf, size_t bytes); + +bool WriteDwords(xbaddr Paddr, uint32_t* Buffer, int Number); +bool GetDwords(xbaddr Paddr, uint32_t* Buffer, int Number); +bool GetWords(xbaddr Paddr, uint16_t* Buffer, int Number); +bool WriteWords(xbaddr Paddr, uint16_t* Buffer, int Number); +bool Memory_R(void* Addr, void* Buf, size_t Num); +bool Memory_W(void* Addr, void* Buf, size_t Num); +bool Memory_RW(void* Addr, void* Buf, size_t Num, bool bIsWrite); + +void unix2dos(std::string& string); +std::string StripSpaces(const std::string& str); + +// Retrieves the underlying integer value of a scoped enumerator. It allows to avoid using static_cast every time +template +constexpr typename std::underlying_type::type to_underlying(E e) noexcept +{ + return static_cast>(e); +} + +#define GET_WORD_LOW(value) (uint8_t)((value) & 0xFF) +#define GET_WORD_HIGH(value) (uint8_t)(((value) >> 8) & 0xFF) + +#ifdef __cplusplus +template struct ArraySizeHelper { char _[N]; }; +template +ArraySizeHelper makeArraySizeHelper(T(&)[N]); +# define ARRAY_SIZE(a) sizeof(makeArraySizeHelper(a)) +#else +// The expression ARRAY_SIZE(a) is a compile-time constant of type +// size_t which represents the number of elements of the given +// array. You should only use ARRAY_SIZE on statically allocated +// arrays. + +#define ARRAY_SIZE(a) \ + ((sizeof(a) / sizeof(*(a))) / \ + static_cast(!(sizeof(a) % sizeof(*(a))))) +#endif + +/*! round dwValue to the nearest multiple of dwMult */ +static uint32_t RoundUp(uint32_t dwValue, uint32_t dwMult) +{ + if(dwMult == 0) { return dwValue; } + + int remainder = dwValue % dwMult; + if (remainder == 0) + return dwValue; + + return dwValue + dwMult - remainder; +} + +#endif diff --git a/src/CxbxKrnl/crc32c.cpp b/src/common/util/crc32c.cpp similarity index 100% rename from src/CxbxKrnl/crc32c.cpp rename to src/common/util/crc32c.cpp diff --git a/src/CxbxKrnl/crc32c.h b/src/common/util/crc32c.h similarity index 100% rename from src/CxbxKrnl/crc32c.h rename to src/common/util/crc32c.h diff --git a/src/CxbxKrnl/gloffscreen/glextensions.cpp b/src/common/util/gloffscreen/glextensions.cpp similarity index 95% rename from src/CxbxKrnl/gloffscreen/glextensions.cpp rename to src/common/util/gloffscreen/glextensions.cpp index 06463fcf4..648f5c132 100644 --- a/src/CxbxKrnl/gloffscreen/glextensions.cpp +++ b/src/common/util/gloffscreen/glextensions.cpp @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #include "gloffscreen.h" #include "glextensions.h" diff --git a/src/CxbxKrnl/gloffscreen/glextensions.h b/src/common/util/gloffscreen/glextensions.h similarity index 95% rename from src/CxbxKrnl/gloffscreen/glextensions.h rename to src/common/util/gloffscreen/glextensions.h index 585b11a5e..32dc9bf26 100644 --- a/src/CxbxKrnl/gloffscreen/glextensions.h +++ b/src/common/util/gloffscreen/glextensions.h @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #ifndef GLEXTEENSIONS_H_ #define GLEXTEENSIONS_H_ diff --git a/src/CxbxKrnl/gloffscreen/gloffscreen.h b/src/common/util/gloffscreen/gloffscreen.h similarity index 100% rename from src/CxbxKrnl/gloffscreen/gloffscreen.h rename to src/common/util/gloffscreen/gloffscreen.h diff --git a/src/CxbxKrnl/gloffscreen/gloffscreen_cgl.c b/src/common/util/gloffscreen/gloffscreen_cgl.c similarity index 100% rename from src/CxbxKrnl/gloffscreen/gloffscreen_cgl.c rename to src/common/util/gloffscreen/gloffscreen_cgl.c diff --git a/src/CxbxKrnl/gloffscreen/gloffscreen_common.cpp b/src/common/util/gloffscreen/gloffscreen_common.cpp similarity index 100% rename from src/CxbxKrnl/gloffscreen/gloffscreen_common.cpp rename to src/common/util/gloffscreen/gloffscreen_common.cpp diff --git a/src/CxbxKrnl/gloffscreen/gloffscreen_glx.c b/src/common/util/gloffscreen/gloffscreen_glx.c similarity index 100% rename from src/CxbxKrnl/gloffscreen/gloffscreen_glx.c rename to src/common/util/gloffscreen/gloffscreen_glx.c diff --git a/src/CxbxKrnl/gloffscreen/gloffscreen_wgl.cpp b/src/common/util/gloffscreen/gloffscreen_wgl.cpp similarity index 99% rename from src/CxbxKrnl/gloffscreen/gloffscreen_wgl.cpp rename to src/common/util/gloffscreen/gloffscreen_wgl.cpp index 9aca243ae..8c8f19b98 100644 --- a/src/CxbxKrnl/gloffscreen/gloffscreen_wgl.cpp +++ b/src/common/util/gloffscreen/gloffscreen_wgl.cpp @@ -80,7 +80,7 @@ static void glo_init(void) { } /* Grab An Instance For Our Window */ - glo.hInstance = GetModuleHandle(NULL); + glo.hInstance = GetModuleHandle(nullptr); glo.hDC = GetDC(g_hEmuWindow); /* Create a pixel format */ diff --git a/src/CxbxKrnl/gloffscreen/wglext.h b/src/common/util/gloffscreen/wglext.h similarity index 100% rename from src/CxbxKrnl/gloffscreen/wglext.h rename to src/common/util/gloffscreen/wglext.h diff --git a/src/common/util/hasher.cpp b/src/common/util/hasher.cpp new file mode 100644 index 000000000..7829d1559 --- /dev/null +++ b/src/common/util/hasher.cpp @@ -0,0 +1,42 @@ +#include "hasher.h" + +#include "xxhash.h" +#include "crc32c.h" +#include + +enum { + HASH_NONE = 0, + HASH_XXH3, + HASH_CRC32C +}; + +static int g_HashAlgorithm = HASH_NONE; + +void InitHasher() +{ + // Detect the best hashing algorithm to use for the host machine + // TODO/Future Improvement: This could be expanded to support even more hash algorithims + // And we could hash a random buffer to calculate the fastest hash to use on a given host + printf("Selecting hash algorithm: "); + if (crc32c_hw_available()) { + printf("CRC32C\n"); + g_HashAlgorithm = HASH_CRC32C; + } else { + printf("XXH3\n"); + g_HashAlgorithm = HASH_XXH3; + } +} + +uint64_t ComputeHash(void* data, size_t len) +{ + if (g_HashAlgorithm == HASH_NONE) { + InitHasher(); + } + + switch (g_HashAlgorithm) { + case HASH_XXH3: return XXH3_64bits(data, len); + case HASH_CRC32C: return crc32c_append(0, (uint8_t*)data, len); + } + + return 0; +} diff --git a/src/common/util/hasher.h b/src/common/util/hasher.h new file mode 100644 index 000000000..5dc817742 --- /dev/null +++ b/src/common/util/hasher.h @@ -0,0 +1,34 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 - Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef _HASHER_H +#define _HASHER_H + +#include + +uint64_t ComputeHash(void* data, size_t len); + +#endif diff --git a/src/common/util/strConverter.hpp b/src/common/util/strConverter.hpp new file mode 100644 index 000000000..3b41ae8ec --- /dev/null +++ b/src/common/util/strConverter.hpp @@ -0,0 +1,62 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#pragma once + +#include +#include +#include + +// Depending on what type of UTF-8 string is input, otherwise will use native by default. +static std::wstring utf8_to_utf16(const char* utf8_string) +{ + wchar_t* tempUTF16 = reinterpret_cast(SDL_iconv_string(/*to:*/"UTF-16", /*from:*/"UTF-8", utf8_string, strlen(utf8_string) + 1)); + std::wstring strUTF16 = tempUTF16; + // Don't forget to free allocated string from SDL library. + SDL_free(tempUTF16); + + return strUTF16; +}; + +// Depending on what type of UTF-16 string is input, otherwise will use native by default. +static std::string utf16_to_ascii(const wchar_t* utf16_string) +{ + char* tempASCII = SDL_iconv_string(/*to:*/"ASCII", /*from:*/"UTF-16", reinterpret_cast(utf16_string), wcslen(utf16_string)*2 + 2); + const std::string strASCII = tempASCII; + // Don't forget to free allocated string from SDL library. + SDL_free(tempASCII); + + return strASCII; +} + +// Enforce to expect little endian UTF-16 string is input. +static std::string utf16le_to_ascii(const wchar_t* utf16le_string) +{ + char* tempASCII = SDL_iconv_string(/*to:*/"ASCII", /*from:*/"UTF-16LE", reinterpret_cast(utf16le_string), wcslen(utf16le_string)*2 + 2); + const std::string strASCII = tempASCII; + // Don't forget to free allocated string from SDL library. + SDL_free(tempASCII); + + return strASCII; +} diff --git a/src/common/util/xxh3.h b/src/common/util/xxh3.h new file mode 100644 index 000000000..9d4ad5999 --- /dev/null +++ b/src/common/util/xxh3.h @@ -0,0 +1,1222 @@ +/* + xxHash - Extremely Fast Hash algorithm + Development source file for `xxh3` + Copyright (C) 2019-present, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + +/* Note : + This file is separated for development purposes. + It will be integrated into `xxhash.c` when development phase is complete. +*/ + +#ifndef XXH3_H +#define XXH3_H + + +/* === Dependencies === */ + +#undef XXH_INLINE_ALL /* in case it's already defined */ +#define XXH_INLINE_ALL +#include "xxhash.h" + +#undef NDEBUG /* avoid redefinition */ +#define NDEBUG /* disable assert (release mode) */ +#include +#ifndef NDEBUG +# define NDEBUG +# define UNDEF_NDEBUG +# include +#endif + + +/* === Compiler specifics === */ + +#if !(defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) /* < C99 */ +# define restrict /* disable */ +#endif + +#if defined(__GNUC__) +# if defined(__AVX2__) +# include +# elif defined(__SSE2__) +# include +# elif defined(__ARM_NEON__) || defined(__ARM_NEON) +# define inline __inline__ /* clang bug */ +# include +# undef inline +# endif +#elif defined(_MSC_VER) +# include +#endif + + + +/* ========================================== + * Vectorization detection + * ========================================== */ +#define XXH_SCALAR 0 +#define XXH_SSE2 1 +#define XXH_AVX2 2 +#define XXH_NEON 3 +#define XXH_VSX 4 + +#ifndef XXH_VECTOR /* can be defined on command line */ +# if defined(__AVX2__) +# define XXH_VECTOR XXH_AVX2 +# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2)) +# define XXH_VECTOR XXH_SSE2 +# elif defined(__GNUC__) /* msvc support maybe later */ \ + && (defined(__ARM_NEON__) || defined(__ARM_NEON)) \ + && defined(__LITTLE_ENDIAN__) /* ARM big endian is a thing */ +# define XXH_VECTOR XXH_NEON +# elif defined(__PPC64__) && defined(__VSX__) && defined(__GNUC__) +# define XXH_VECTOR XXH_VSX +# else +# define XXH_VECTOR XXH_SCALAR +# endif +#endif + +/* control alignment of accumulator, + * for compatibility with fast vector loads */ +#ifndef XXH_ACC_ALIGN +# if XXH_VECTOR == 0 /* scalar */ +# define XXH_ACC_ALIGN 8 +# elif XXH_VECTOR == 1 /* sse2 */ +# define XXH_ACC_ALIGN 16 +# elif XXH_VECTOR == 2 /* avx2 */ +# define XXH_ACC_ALIGN 32 +# elif XXH_VECTOR == 3 /* neon */ +# define XXH_ACC_ALIGN 16 +# elif XXH_VECTOR == 4 /* vsx */ +# define XXH_ACC_ALIGN 16 +# endif +#endif + +/* U64 XXH_mult32to64(U32 a, U64 b) { return (U64)a * (U64)b; } */ +#ifdef _MSC_VER +# include + /* MSVC doesn't do a good job with the mull detection. */ +# define XXH_mult32to64 __emulu +#else +# define XXH_mult32to64(x, y) ((U64)((x) & 0xFFFFFFFF) * (U64)((y) & 0xFFFFFFFF)) +#endif + +/* VSX stuff */ +#if XXH_VECTOR == XXH_VSX +# include +# undef vector +typedef __vector unsigned long long U64x2; +typedef __vector unsigned U32x4; +/* Adapted from https://github.com/google/highwayhash/blob/master/highwayhash/hh_vsx.h. */ +XXH_FORCE_INLINE U64x2 XXH_vsxMultOdd(U32x4 a, U32x4 b) { + U64x2 result; + __asm__("vmulouw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b)); + return result; +} +XXH_FORCE_INLINE U64x2 XXH_vsxMultEven(U32x4 a, U32x4 b) { + U64x2 result; + __asm__("vmuleuw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b)); + return result; +} +#endif + + +/* ========================================== + * XXH3 default settings + * ========================================== */ + +#define XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH_SECRET_SIZE_MIN */ + +#if (XXH_SECRET_DEFAULT_SIZE < XXH_SECRET_SIZE_MIN) +# error "default keyset is not large enough" +#endif + +XXH_ALIGN(64) static const BYTE kSecret[XXH_SECRET_DEFAULT_SIZE] = { + 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c, + 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, + 0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, + 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c, + 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3, + 0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8, + 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d, + 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, + + 0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, + 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e, + 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce, + 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, +}; + + +#if defined(__GNUC__) && defined(__i386__) +/* GCC is stupid and tries to vectorize this. + * This tells GCC that it is wrong. */ +__attribute__((__target__("no-sse"))) +#endif +static U64 +XXH3_mul128_fold64(U64 ll1, U64 ll2) +{ +#if defined(__SIZEOF_INT128__) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128) + + __uint128_t lll = (__uint128_t)ll1 * ll2; + return (U64)lll ^ (U64)(lll >> 64); + +#elif defined(_M_X64) || defined(_M_IA64) + +#ifndef _MSC_VER +# pragma intrinsic(_umul128) +#endif + U64 llhigh; + U64 const lllow = _umul128(ll1, ll2, &llhigh); + return lllow ^ llhigh; + + /* We have to do it out manually on 32-bit. + * This is a modified, unrolled, widened, and optimized version of the + * mulqdu routine from Hacker's Delight. + * + * https://www.hackersdelight.org/hdcodetxt/mulqdu.c.txt + * + * This was modified to use U32->U64 multiplication instead + * of U16->U32, to add the high and low values in the end, + * be endian-independent, and I added a partial assembly + * implementation for ARM. */ + + /* An easy 128-bit folding multiply on ARMv6T2 and ARMv7-A/R can be done with + * the mighty umaal (Unsigned Multiply Accumulate Accumulate Long) which takes 4 cycles + * or less, doing a long multiply and adding two 32-bit integers: + * + * void umaal(U32 *RdLo, U32 *RdHi, U32 Rn, U32 Rm) + * { + * U64 prodAcc = (U64)Rn * (U64)Rm; + * prodAcc += *RdLo; + * prodAcc += *RdHi; + * *RdLo = prodAcc & 0xFFFFFFFF; + * *RdHi = prodAcc >> 32; + * } + * + * This is compared to umlal which adds to a single 64-bit integer: + * + * void umlal(U32 *RdLo, U32 *RdHi, U32 Rn, U32 Rm) + * { + * U64 prodAcc = (U64)Rn * (U64)Rm; + * prodAcc += (*RdLo | ((U64)*RdHi << 32); + * *RdLo = prodAcc & 0xFFFFFFFF; + * *RdHi = prodAcc >> 32; + * } + * + * Getting the compiler to emit them is like pulling teeth, and checking + * for it is annoying because ARMv7-M lacks this instruction. However, it + * is worth it, because this is an otherwise expensive operation. */ + + /* GCC-compatible, ARMv6t2 or ARMv7+, non-M variant, and 32-bit */ +#elif defined(__GNUC__) /* GCC-compatible */ \ + && defined(__ARM_ARCH) && !defined(__aarch64__) && !defined(__arm64__) /* 32-bit ARM */\ + && !defined(__ARM_ARCH_7M__) /* <- Not ARMv7-M vv*/ \ + && !(defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 0 && __TARGET_ARCH_THUMB == 4) \ + && (defined(__ARM_ARCH_6T2__) || __ARM_ARCH > 6) /* ARMv6T2 or later */ + + U32 w[4] = { 0 }; + U32 u[2] = { (U32)(ll1 >> 32), (U32)ll1 }; + U32 v[2] = { (U32)(ll2 >> 32), (U32)ll2 }; + U32 k; + + /* U64 t = (U64)u[1] * (U64)v[1]; + * w[3] = t & 0xFFFFFFFF; + * k = t >> 32; */ + __asm__("umull %0, %1, %2, %3" + : "=r" (w[3]), "=r" (k) + : "r" (u[1]), "r" (v[1])); + + /* t = (U64)u[0] * (U64)v[1] + w[2] + k; + * w[2] = t & 0xFFFFFFFF; + * k = t >> 32; */ + __asm__("umaal %0, %1, %2, %3" + : "+r" (w[2]), "+r" (k) + : "r" (u[0]), "r" (v[1])); + w[1] = k; + k = 0; + + /* t = (U64)u[1] * (U64)v[0] + w[2] + k; + * w[2] = t & 0xFFFFFFFF; + * k = t >> 32; */ + __asm__("umaal %0, %1, %2, %3" + : "+r" (w[2]), "+r" (k) + : "r" (u[1]), "r" (v[0])); + + /* t = (U64)u[0] * (U64)v[0] + w[1] + k; + * w[1] = t & 0xFFFFFFFF; + * k = t >> 32; */ + __asm__("umaal %0, %1, %2, %3" + : "+r" (w[1]), "+r" (k) + : "r" (u[0]), "r" (v[0])); + w[0] = k; + + return (w[1] | ((U64)w[0] << 32)) ^ (w[3] | ((U64)w[2] << 32)); + +#else /* Portable scalar version */ + + /* emulate 64x64->128b multiplication, using four 32x32->64 */ + U32 const h1 = (U32)(ll1 >> 32); + U32 const h2 = (U32)(ll2 >> 32); + U32 const l1 = (U32)ll1; + U32 const l2 = (U32)ll2; + + U64 const llh = XXH_mult32to64(h1, h2); + U64 const llm1 = XXH_mult32to64(l1, h2); + U64 const llm2 = XXH_mult32to64(h1, l2); + U64 const lll = XXH_mult32to64(l1, l2); + + U64 const t = lll + (llm1 << 32); + U64 const carry1 = t < lll; + + U64 const lllow = t + (llm2 << 32); + U64 const carry2 = lllow < t; + U64 const llhigh = llh + (llm1 >> 32) + (llm2 >> 32) + carry1 + carry2; + + return llhigh ^ lllow; + +#endif +} + + +static XXH64_hash_t XXH3_avalanche(U64 h64) +{ + h64 ^= h64 >> 37; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + return h64; +} + + +/* ========================================== + * Short keys + * ========================================== */ + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_len_1to3_64b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(len > 1 && len <= 3); + assert(keyPtr != NULL); + { BYTE const c1 = ((const BYTE*)data)[0]; + BYTE const c2 = ((const BYTE*)data)[len >> 1]; + BYTE const c3 = ((const BYTE*)data)[len - 1]; + U32 const combined = ((U32)c1) + (((U32)c2) << 8) + (((U32)c3) << 16) + (((U32)len) << 24); + U64 const keyed = (U64)combined ^ (XXH_readLE64(keyPtr) + seed); + U64 const mixed = keyed * PRIME64_1; + return XXH3_avalanche(mixed); + } +} + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_len_4to8_64b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(key != NULL); + assert(len >= 4 && len <= 8); + { U32 const in1 = XXH_readLE32(data); + U32 const in2 = XXH_readLE32((const BYTE*)data + len - 4); + U64 const in64 = in1 + ((U64)in2 << 32); + U64 const keyed = in64 ^ (XXH_readLE64(keyPtr) + seed); + U64 const mix64 = len + XXH3_mul128_fold64(keyed, PRIME64_1); + return XXH3_avalanche(mix64); + } +} + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_len_9to16_64b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(key != NULL); + assert(len >= 9 && len <= 16); + { const U64* const key64 = (const U64*) keyPtr; + U64 const ll1 = XXH_readLE64(data) ^ (XXH_readLE64(key64) + seed); + U64 const ll2 = XXH_readLE64((const BYTE*)data + len - 8) ^ (XXH_readLE64(key64+1) - seed); + U64 const acc = len + (ll1 + ll2) + XXH3_mul128_fold64(ll1, ll2); + return XXH3_avalanche(acc); + } +} + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_len_0to16_64b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(len <= 16); + { if (len > 8) return XXH3_len_9to16_64b(data, len, keyPtr, seed); + if (len >= 4) return XXH3_len_4to8_64b(data, len, keyPtr, seed); + if (len) return XXH3_len_1to3_64b(data, len, keyPtr, seed); + return 0; + } +} + + +/* === Long Keys === */ + +#define STRIPE_LEN 64 +#define XXH_SECRET_CONSUME_RATE 8 /* nb of secret bytes consumed at each accumulation */ +#define ACC_NB (STRIPE_LEN / sizeof(U64)) + +XXH_FORCE_INLINE void +XXH3_accumulate_512(void* restrict acc, const void* restrict data, const void* restrict key) +{ +#if (XXH_VECTOR == XXH_AVX2) + + assert(((size_t)acc) & 31 == 0); + { XXH_ALIGN(32) __m256i* const xacc = (__m256i *) acc; + const __m256i* const xdata = (const __m256i *) data; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this type */ + const __m256i* const xkey = (const __m256i *) key; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this type */ + + size_t i; + for (i=0; i < STRIPE_LEN/sizeof(__m256i); i++) { + __m256i const d = _mm256_loadu_si256 (xdata+i); + __m256i const k = _mm256_loadu_si256 (xkey+i); + __m256i const dk = _mm256_xor_si256 (d,k); /* uint32 dk[8] = {d0+k0, d1+k1, d2+k2, d3+k3, ...} */ + __m256i const mul = _mm256_mul_epu32 (dk, _mm256_shuffle_epi32 (dk, 0x31)); /* uint64 mul[4] = {dk0*dk1, dk2*dk3, ...} */ + __m256i const add = _mm256_add_epi64(d, xacc[i]); + xacc[i] = _mm256_add_epi64(mul, add); + } } + +#elif (XXH_VECTOR == XXH_SSE2) + + assert(((size_t)acc) & 15 == 0); + { XXH_ALIGN(16) __m128i* const xacc = (__m128i *) acc; /* presumed */ + const __m128i* const xdata = (const __m128i *) data; /* not really aligned, just for ptr arithmetic, and because _mm_loadu_si128() requires this type */ + const __m128i* const xkey = (const __m128i *) key; /* not really aligned, just for ptr arithmetic, and because _mm_loadu_si128() requires this type */ + + size_t i; + for (i=0; i < STRIPE_LEN/sizeof(__m128i); i++) { + __m128i const d = _mm_loadu_si128 (xdata+i); + __m128i const k = _mm_loadu_si128 (xkey+i); + __m128i const dk = _mm_xor_si128 (d,k); /* uint32 dk[4] = {d0+k0, d1+k1, d2+k2, d3+k3} */ + __m128i const mul = _mm_mul_epu32 (dk, _mm_shuffle_epi32 (dk, 0x31)); /* uint64 mul[2] = {dk0*dk1,dk2*dk3} */ + __m128i const add = _mm_add_epi64(d, xacc[i]); + xacc[i] = _mm_add_epi64(mul, add); + } } + +#elif (XXH_VECTOR == XXH_NEON) + + assert((((size_t)acc) & 15) == 0); + { + XXH_ALIGN(16) uint64x2_t* const xacc = (uint64x2_t *) acc; + /* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */ + uint32_t const* const xdata = (const uint32_t *) data; + uint32_t const* const xkey = (const uint32_t *) key; + + size_t i; + for (i=0; i < STRIPE_LEN / sizeof(uint64x2_t); i++) { +#if !defined(__aarch64__) && !defined(__arm64__) && defined(__GNUC__) /* ARM32-specific hack */ + /* vzip on ARMv7 Clang generates a lot of vmovs (technically vorrs) without this. + * vzip on 32-bit ARM NEON will overwrite the original register, and I think that Clang + * assumes I don't want to destroy it and tries to make a copy. This slows down the code + * a lot. + * aarch64 not only uses an entirely different syntax, but it requires three + * instructions... + * ext v1.16B, v0.16B, #8 // select high bits because aarch64 can't address them directly + * zip1 v3.2s, v0.2s, v1.2s // first zip + * zip2 v2.2s, v0.2s, v1.2s // second zip + * ...to do what ARM does in one: + * vzip.32 d0, d1 // Interleave high and low bits and overwrite. */ + + /* data_vec = xdata[i]; */ + uint32x4_t const data_vec = vld1q_u32(xdata + (i * 4)); + /* key_vec = xkey[i]; */ + uint32x4_t const key_vec = vld1q_u32(xkey + (i * 4)); + /* data_key = data_vec ^ key_vec; */ + uint32x4_t data_key; + /* Add first to prevent register swaps */ + /* xacc[i] += data_vec; */ + xacc[i] = vaddq_u64(xacc[i], vreinterpretq_u64_u32(data_vec)); + + data_key = veorq_u32(data_vec, key_vec); + + /* Here's the magic. We use the quirkiness of vzip to shuffle data_key in place. + * shuffle: data_key[0, 1, 2, 3] = data_key[0, 2, 1, 3] */ + __asm__("vzip.32 %e0, %f0" : "+w" (data_key)); + /* xacc[i] += (uint64x2_t) data_key[0, 1] * (uint64x2_t) data_key[2, 3]; */ + xacc[i] = vmlal_u32(xacc[i], vget_low_u32(data_key), vget_high_u32(data_key)); +#else + /* On aarch64, vshrn/vmovn seems to be equivalent to, if not faster than, the vzip method. */ + + /* data_vec = xdata[i]; */ + uint32x4_t const data_vec = vld1q_u32(xdata + (i * 4)); + /* key_vec = xkey[i]; */ + uint32x4_t const key_vec = vld1q_u32(xkey + (i * 4)); + /* data_key = data_vec ^ key_vec; */ + uint32x4_t const data_key = veorq_u32(data_vec, key_vec); + /* data_key_lo = (uint32x2_t) (data_key & 0xFFFFFFFF); */ + uint32x2_t const data_key_lo = vmovn_u64 (vreinterpretq_u64_u32(data_key)); + /* data_key_hi = (uint32x2_t) (data_key >> 32); */ + uint32x2_t const data_key_hi = vshrn_n_u64 (vreinterpretq_u64_u32(data_key), 32); + /* xacc[i] += data_vec; */ + xacc[i] = vaddq_u64 (xacc[i], vreinterpretq_u64_u32(data_vec)); + /* xacc[i] += (uint64x2_t) data_key_lo * (uint64x2_t) data_key_hi; */ + xacc[i] = vmlal_u32 (xacc[i], data_key_lo, data_key_hi); +#endif + } + } + +#elif XXH_VECTOR == XXH_VSX + U64x2* const xacc = (U64x2*) acc; /* presumed aligned */ + U64x2 const* const xdata = (U64x2 const*) data; /* no alignment restriction */ + U64x2 const* const xkey = (U64x2 const*) key; /* no alignment restriction */ + U64x2 const v32 = { 32, 32 }; + + size_t i; + for (i = 0; i < STRIPE_LEN / sizeof(U64x2); i++) { + /* data_vec = xdata[i]; */ + /* key_vec = xkey[i]; */ +#ifdef __BIG_ENDIAN__ + /* byteswap */ + U64x2 const data_vec = vec_revb(vec_vsx_ld(0, xdata + i)); + /* swap 32-bit words */ + U64x2 const key_vec = vec_rl(vec_vsx_ld(0, xkey + i), v32); +#else + U64x2 const data_vec = vec_vsx_ld(0, xdata + i); + U64x2 const key_vec = vec_vsx_ld(0, xkey + i); +#endif + U64x2 data_key = data_vec ^ key_vec; + /* shuffled = (data_key << 32) | (data_key >> 32); */ + U32x4 shuffled = (U32x4)vec_rl(data_key, v32); + /* product = ((U64x2)data_key & 0xFFFFFFFF) * ((U64x2)shuffled & 0xFFFFFFFF); */ + U64x2 product = XXH_vsxMultOdd((U32x4)data_key, shuffled); + + xacc[i] += product; + xacc[i] += data_vec; + } + +#else /* scalar variant of Accumulator - universal */ + + XXH_ALIGN(32) U64* const xacc = (U64*) acc; /* presumed aligned on 32-bytes boundaries, little hint for the auto-vectorizer */ + const char* const xdata = (const char*) data; /* no alignment restriction */ + const char* const xkey = (const char*) key; /* no alignment restriction */ + size_t i; + assert(((size_t)acc & 31) == 0); + for (i=0; i < ACC_NB; i++) { + U64 const data_val = XXH_readLE64(xdata + 8*i); + U64 const key_val = XXH_readLE64(xkey + 8*i); + U64 const data_key = key_val ^ data_val; + xacc[i] += XXH_mult32to64(data_key & 0xFFFFFFFF, data_key >> 32); + xacc[i] += data_val; + } + +#endif +} + +XXH_FORCE_INLINE void +XXH3_scrambleAcc(void* restrict acc, const void* restrict key) +{ +#if (XXH_VECTOR == XXH_AVX2) + + assert(((size_t)acc) & 31 == 0); + { XXH_ALIGN(32) __m256i* const xacc = (__m256i*) acc; + const __m256i* const xkey = (const __m256i *) key; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this argument type */ + const __m256i k1 = _mm256_set1_epi32((int)PRIME32_1); + + size_t i; + for (i=0; i < STRIPE_LEN/sizeof(__m256i); i++) { + __m256i data = xacc[i]; + __m256i const shifted = _mm256_srli_epi64(data, 47); + data = _mm256_xor_si256(data, shifted); + + { __m256i const k = _mm256_loadu_si256 (xkey+i); + __m256i const dk = _mm256_xor_si256 (data, k); /* U32 dk[4] = {d0+k0, d1+k1, d2+k2, d3+k3} */ + + __m256i const dk1 = _mm256_mul_epu32 (dk, k1); + + __m256i const d2 = _mm256_shuffle_epi32 (dk, 0x31); + __m256i const dk2 = _mm256_mul_epu32 (d2, k1); + __m256i const dk2h= _mm256_slli_epi64 (dk2, 32); + + xacc[i] = _mm256_add_epi64(dk1, dk2h); + } } + } + +#elif (XXH_VECTOR == XXH_SSE2) + + { XXH_ALIGN(16) __m128i* const xacc = (__m128i*) acc; + const __m128i* const xkey = (const __m128i *) key; /* not really aligned, just for ptr arithmetic */ + const __m128i k1 = _mm_set1_epi32((int)PRIME32_1); + + size_t i; + for (i=0; i < STRIPE_LEN/sizeof(__m128i); i++) { + __m128i data = xacc[i]; + __m128i const shifted = _mm_srli_epi64(data, 47); + data = _mm_xor_si128(data, shifted); + + { __m128i const k = _mm_loadu_si128 (xkey+i); + __m128i const dk = _mm_xor_si128 (data,k); + + __m128i const dk1 = _mm_mul_epu32 (dk,k1); + + __m128i const d2 = _mm_shuffle_epi32 (dk, 0x31); + __m128i const dk2 = _mm_mul_epu32 (d2,k1); + __m128i const dk2h= _mm_slli_epi64(dk2, 32); + + xacc[i] = _mm_add_epi64(dk1, dk2h); + } } + } + +#elif (XXH_VECTOR == XXH_NEON) + + assert(((size_t)acc) & 15 == 0); + + { uint64x2_t* const xacc = (uint64x2_t*) acc; + uint32_t const* const xkey = (uint32_t const*) key; + uint32x2_t const prime = vdup_n_u32 (PRIME32_1); + + size_t i; + for (i=0; i < STRIPE_LEN/sizeof(uint64x2_t); i++) { + /* data_vec = xacc[i] ^ (xacc[i] >> 47); */ + uint64x2_t const acc_vec = xacc[i]; + uint64x2_t const shifted = vshrq_n_u64 (acc_vec, 47); + uint64x2_t const data_vec = veorq_u64 (acc_vec, shifted); + + /* key_vec = xkey[i]; */ + uint32x4_t const key_vec = vld1q_u32 (xkey + (i * 4)); + /* data_key = data_vec ^ key_vec; */ + uint32x4_t const data_key = veorq_u32 (vreinterpretq_u32_u64(data_vec), key_vec); + /* shuffled = { data_key[0, 2], data_key[1, 3] }; */ + uint32x2x2_t const shuffled = vzip_u32 (vget_low_u32(data_key), vget_high_u32(data_key)); + + /* data_key *= PRIME32_1 */ + + /* prod_hi = (data_key >> 32) * PRIME32_1; */ + uint64x2_t const prod_hi = vmull_u32 (shuffled.val[1], prime); + /* xacc[i] = prod_hi << 32; */ + xacc[i] = vshlq_n_u64(prod_hi, 32); + /* xacc[i] += (prod_hi & 0xFFFFFFFF) * PRIME32_1; */ + xacc[i] = vmlal_u32(xacc[i], shuffled.val[0], prime); + } } + +#elif (XXH_VECTOR == XXH_VSX) + + U64x2* const xacc = (U64x2*) acc; + const U64x2* const xkey = (const U64x2*) key; + /* constants */ + U64x2 const v32 = { 32, 32 }; + U64x2 const v47 = { 47, 47 }; + U32x4 const prime = { PRIME32_1, PRIME32_1, PRIME32_1, PRIME32_1 }; + size_t i; + + for (i = 0; i < STRIPE_LEN / sizeof(U64x2); i++) { + U64x2 const acc_vec = xacc[i]; + U64x2 const data_vec = acc_vec ^ (acc_vec >> v47); + /* key_vec = xkey[i]; */ +#ifdef __BIG_ENDIAN__ + /* swap 32-bit words */ + U64x2 const key_vec = vec_rl(vec_vsx_ld(0, xkey + i), v32); +#else + U64x2 const key_vec = vec_vsx_ld(0, xkey + i); +#endif + U64x2 const data_key = data_vec ^ key_vec; + + /* data_key *= PRIME32_1 */ + + /* prod_lo = ((U64x2)data_key & 0xFFFFFFFF) * ((U64x2)prime & 0xFFFFFFFF); */ + U64x2 const prod_lo = XXH_vsxMultOdd((U32x4)data_key, prime); + /* prod_hi = ((U64x2)data_key >> 32) * ((U64x2)prime >> 32); */ + U64x2 const prod_hi = XXH_vsxMultEven((U32x4)data_key, prime); + xacc[i] = prod_lo + (prod_hi << v32); + } + +#else /* scalar variant of Scrambler - universal */ + + XXH_ALIGN(32) U64* const xacc = (U64*) acc; /* presumed aligned on 32-bytes boundaries, little hint for the auto-vectorizer */ + const char* const xkey = (const char*) key; /* no alignment restriction */ + int i; + assert((((size_t)acc) & 31) == 0); + + for (i=0; i < (int)ACC_NB; i++) { + U64 const key64 = XXH_readLE64(xkey + 8*i); + U64 acc64 = xacc[i]; + acc64 ^= acc64 >> 47; + acc64 ^= key64; + acc64 *= PRIME32_1; + xacc[i] = acc64; + } + +#endif +} + +/* assumption : nbStripes will not overflow secret size */ +XXH_FORCE_INLINE void +XXH3_accumulate(U64* restrict acc, const void* restrict data, + const void* restrict secret, size_t nbStripes) +{ + size_t n; + /* Clang doesn't unroll this loop without the pragma. Unrolling can be up to 1.4x faster. + * note from @aras-p : this unroll statement is actually detrimental for WASM. + * need to find a detection macro to exclude this case. */ +#if defined(__clang__) && !defined(__OPTIMIZE_SIZE__) && !defined(__ARM_ARCH) +# pragma clang loop unroll(enable) +#endif + for (n = 0; n < nbStripes; n++ ) { + XXH3_accumulate_512(acc, + (const char*)data + n*STRIPE_LEN, + (const char*)secret + n*XXH_SECRET_CONSUME_RATE); + } +} + +/* note : clang auto-vectorizes well in SS2 mode _if_ this function is `static`, + * and doesn't auto-vectorize it at all if it is `FORCE_INLINE`. + * However, it auto-vectorizes better AVX2 if it is `FORCE_INLINE` + * Pretty much every other modes and compilers prefer `FORCE_INLINE`. + */ +#if defined(__clang__) && (XXH_VECTOR==0) && !defined(__AVX2__) +static void +#else +XXH_FORCE_INLINE void +#endif +XXH3_hashLong_internal_loop( U64* restrict acc, + const void* restrict data, size_t len, + const void* restrict secret, size_t secretSize) +{ + size_t const nb_rounds = (secretSize - STRIPE_LEN) / XXH_SECRET_CONSUME_RATE; + size_t const block_len = STRIPE_LEN * nb_rounds; + size_t const nb_blocks = len / block_len; + + size_t n; + + assert(secretSize >= XXH_SECRET_SIZE_MIN); + + for (n = 0; n < nb_blocks; n++) { + XXH3_accumulate(acc, (const char*)data + n*block_len, secret, nb_rounds); + XXH3_scrambleAcc(acc, (const char*)secret + secretSize - STRIPE_LEN); + } + + /* last partial block */ + assert(len > STRIPE_LEN); + { size_t const nbStripes = (len - (block_len * nb_blocks)) / STRIPE_LEN; + assert(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE)); + XXH3_accumulate(acc, (const char*)data + nb_blocks*block_len, secret, nbStripes); + + /* last stripe */ + if (len & (STRIPE_LEN - 1)) { + const void* const p = (const char*)data + len - STRIPE_LEN; +#define XXH_SECRET_LASTACC_START 7 /* do not align on 8, so that secret is different from scrambler */ + XXH3_accumulate_512(acc, p, (const char*)secret + secretSize - STRIPE_LEN - XXH_SECRET_LASTACC_START); + } } +} + +XXH_FORCE_INLINE U64 +XXH3_mix2Accs(const U64* restrict acc, const void* restrict secret) +{ + const U64* const key64 = (const U64*)secret; + return XXH3_mul128_fold64( + acc[0] ^ XXH_readLE64(key64), + acc[1] ^ XXH_readLE64(key64+1) ); +} + +static XXH64_hash_t +XXH3_mergeAccs(const U64* restrict acc, const void* restrict secret, U64 start) +{ + U64 result64 = start; + + result64 += XXH3_mix2Accs(acc+0, (const char*)secret + 0); + result64 += XXH3_mix2Accs(acc+2, (const char*)secret + 16); + result64 += XXH3_mix2Accs(acc+4, (const char*)secret + 32); + result64 += XXH3_mix2Accs(acc+6, (const char*)secret + 48); + + return XXH3_avalanche(result64); +} + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_hashLong_internal(const void* restrict data, size_t len, + const void* restrict secret, size_t secretSize) +{ + XXH_ALIGN(XXH_ACC_ALIGN) U64 acc[ACC_NB] = { PRIME32_3, PRIME64_1, PRIME64_2, PRIME64_3, PRIME64_4, PRIME32_2, PRIME64_5, PRIME32_1 }; + + XXH3_hashLong_internal_loop(acc, data, len, secret, secretSize); + + /* converge into final hash */ + XXH_STATIC_ASSERT(sizeof(acc) == 64); +#define XXH_SECRET_MERGEACCS_START 11 /* do not align on 8, so that secret is different from accumulator */ + assert(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); + return XXH3_mergeAccs(acc, (const char*)secret + XXH_SECRET_MERGEACCS_START, (U64)len * PRIME64_1); +} + + +XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */ +XXH3_hashLong_64b_defaultSecret(const void* restrict data, size_t len) +{ + return XXH3_hashLong_internal(data, len, kSecret, sizeof(kSecret)); +} + +XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */ +XXH3_hashLong_64b_withSecret(const void* restrict data, size_t len, const void* restrict secret, size_t secretSize) +{ + return XXH3_hashLong_internal(data, len, secret, secretSize); +} + + +XXH_FORCE_INLINE void XXH_writeLE64(void* dst, U64 v64) +{ + if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64); + memcpy(dst, &v64, sizeof(v64)); +} + +/* XXH3_initKeySeed() : + * destination `customSecret` is presumed allocated and same size as `kSecret`. + */ +XXH_FORCE_INLINE void XXH3_initKeySeed(void* customSecret, U64 seed64) +{ + char* const dst = (char*)customSecret; + const char* const src = (const char*)kSecret; + int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16; + int i; + + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); + + for (i=0; i < nbRounds; i++) { + XXH_writeLE64(dst + 16*i, XXH_readLE64(src + 16*i) + seed64); + XXH_writeLE64(dst + 16*i + 8, XXH_readLE64(src + 16*i + 8) - seed64); + } +} + + +/* XXH3_hashLong_64b_withSeed() : + * Generate a custom key, + * based on alteration of default kSecret with the seed, + * and then use this key for long mode hashing. + * This operation is decently fast but nonetheless costs a little bit of time. + * Try to avoid it whenever possible (typically when seed==0). + */ +XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */ +XXH3_hashLong_64b_withSeed(const void* data, size_t len, XXH64_hash_t seed) +{ + XXH_ALIGN(8) char secret[XXH_SECRET_DEFAULT_SIZE]; + XXH3_initKeySeed(secret, seed); + return XXH3_hashLong_internal(data, len, secret, sizeof(secret)); +} + + +XXH_FORCE_INLINE U64 XXH3_mix16B(const void* restrict data, const void* restrict key, U64 seed64) +{ + const U64* const key64 = (const U64*)key; + U64 const ll1 = XXH_readLE64(data); + U64 const ll2 = XXH_readLE64((const BYTE*)data+8); + return XXH3_mul128_fold64( + ll1 ^ (XXH_readLE64(key64) + seed64), + ll2 ^ (XXH_readLE64(key64+1) - seed64) ) ; +} + + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_len_17to128_64b(const void* restrict data, size_t len, const void* restrict secret, size_t secretSize, XXH64_hash_t seed) +{ + const BYTE* const p = (const BYTE*)data; + const char* const key = (const char*)secret; + + assert(secretSize >= XXH_SECRET_SIZE_MIN); (void)secretSize; + assert(16 < len && len <= 128); + + { U64 acc = len * PRIME64_1; + if (len > 32) { + if (len > 64) { + if (len > 96) { + acc += XXH3_mix16B(p+48, key+96, seed); + acc += XXH3_mix16B(p+len-64, key+112, seed); + } + acc += XXH3_mix16B(p+32, key+64, seed); + acc += XXH3_mix16B(p+len-48, key+80, seed); + } + acc += XXH3_mix16B(p+16, key+32, seed); + acc += XXH3_mix16B(p+len-32, key+48, seed); + } + acc += XXH3_mix16B(p+0, key+0, seed); + acc += XXH3_mix16B(p+len-16, key+16, seed); + + return XXH3_avalanche(acc); + } +} + + +/* === Public entry point === */ + +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* data, size_t len) +{ + if (len <= 16) return XXH3_len_0to16_64b(data, len, kSecret, 0); + if (len > 128) return XXH3_hashLong_64b_defaultSecret(data, len); + return XXH3_len_17to128_64b(data, len, kSecret, sizeof(kSecret), 0); +} + +XXH_PUBLIC_API XXH64_hash_t +XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize) +{ + assert(secretSize >= XXH_SECRET_SIZE_MIN); + assert(((size_t)secret % 8) == 0); + /* if an action must be taken should `secret` conditions not be respected, + * it should be done here. + * For now, it's a contract pre-condition. + * Adding a check and a branch here would cost performance at every hash */ + if (len <= 16) return XXH3_len_0to16_64b(data, len, secret, 0); + if (len > 128) return XXH3_hashLong_64b_withSecret(data, len, secret, secretSize); + return XXH3_len_17to128_64b(data, len, secret, secretSize, 0); +} + +XXH_PUBLIC_API XXH64_hash_t +XXH3_64bits_withSeed(const void* data, size_t len, XXH64_hash_t seed) +{ + /* note : opened question : would it be faster to + * route to XXH3_64bits_withSecret_internal() + * when `seed == 0` ? + * This would add a branch though. + * Maybe do it into XXH3_hashLong_64b_withSeed() instead, + * since that's where it matters */ + if (len <= 16) return XXH3_len_0to16_64b(data, len, kSecret, seed); + if (len > 128) return XXH3_hashLong_64b_withSeed(data, len, seed); + return XXH3_len_17to128_64b(data, len, kSecret, sizeof(kSecret), seed); +} + +/* === XXH3 streaming === */ + +XXH_PUBLIC_API XXH3_state_t* XXH3_64bits_createState(void) +{ + return (XXH3_state_t*)XXH_malloc(sizeof(XXH3_state_t)); +} + +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_freeState(XXH3_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API void +XXH3_64bits_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state) +{ + memcpy(dst_state, src_state, sizeof(*dst_state)); +} + +static void +XXH3_64bits_reset_internal(XXH3_state_t* statePtr, + XXH64_hash_t seed, + const void* secret, size_t secretSize) +{ + assert(statePtr != NULL); + memset(statePtr, 0, sizeof(*statePtr)); + statePtr->acc[0] = PRIME32_3; + statePtr->acc[1] = PRIME64_1; + statePtr->acc[2] = PRIME64_2; + statePtr->acc[3] = PRIME64_3; + statePtr->acc[4] = PRIME64_4; + statePtr->acc[5] = PRIME32_2; + statePtr->acc[6] = PRIME64_5; + statePtr->acc[7] = PRIME32_1; + statePtr->seed = seed; + assert(secret != NULL); + statePtr->secret = secret; + assert(secretSize >= XXH_SECRET_SIZE_MIN); + statePtr->secretLimit = (XXH32_hash_t)(secretSize - STRIPE_LEN); + statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE; +} + +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset(XXH3_state_t* statePtr) +{ + if (statePtr == NULL) return XXH_ERROR; + XXH3_64bits_reset_internal(statePtr, 0, kSecret, XXH_SECRET_DEFAULT_SIZE); + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize) +{ + if (statePtr == NULL) return XXH_ERROR; + XXH3_64bits_reset_internal(statePtr, 0, secret, secretSize); + if (secret == NULL) return XXH_ERROR; + if (secretSize < XXH_SECRET_SIZE_MIN) return XXH_ERROR; + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed) +{ + if (statePtr == NULL) return XXH_ERROR; + XXH3_64bits_reset_internal(statePtr, seed, kSecret, XXH_SECRET_DEFAULT_SIZE); + XXH3_initKeySeed(statePtr->customSecret, seed); + statePtr->secret = statePtr->customSecret; + return XXH_OK; +} + +static void +XXH3_64bits_consumeStripes( U64* acc, + XXH32_hash_t* nbStripesSoFarPtr, XXH32_hash_t nbStripesPerBlock, + const void* data, size_t totalStripes, + const void* secret, size_t secretLimit) +{ + assert(*nbStripesSoFarPtr < nbStripesPerBlock); + if (nbStripesPerBlock - *nbStripesSoFarPtr <= totalStripes) { + /* need a scrambling operation */ + size_t const nbStripes = nbStripesPerBlock - *nbStripesSoFarPtr; + XXH3_accumulate(acc, data, (const char*)secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, nbStripes); + XXH3_scrambleAcc(acc, (const char*)secret + secretLimit); + XXH3_accumulate(acc, (const char*)data + nbStripes * STRIPE_LEN, secret, totalStripes - nbStripes); + *nbStripesSoFarPtr = (XXH32_hash_t)(totalStripes - nbStripes); + } else { + XXH3_accumulate(acc, data, (const char*)secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, totalStripes); + *nbStripesSoFarPtr += (XXH32_hash_t)totalStripes; + } +} + +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_update(XXH3_state_t* state, const void* input, size_t len) +{ + if (input==NULL) +#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1) + return XXH_OK; +#else + return XXH_ERROR; +#endif + + { const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + + state->totalLen += len; + + if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */ + XXH_memcpy(state->buffer + state->bufferedSize, input, len); + state->bufferedSize += (XXH32_hash_t)len; + return XXH_OK; + } + /* input now > XXH3_INTERNALBUFFER_SIZE */ + + #define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / STRIPE_LEN) + XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % STRIPE_LEN == 0); /* clean multiple */ + + if (state->bufferedSize) { /* some data within internal buffer: fill then consume it */ + size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize; + XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize); + p += loadSize; + XXH3_64bits_consumeStripes(state->acc, + &state->nbStripesSoFar, state->nbStripesPerBlock, + state->buffer, XXH3_INTERNALBUFFER_STRIPES, + state->secret, state->secretLimit); + } + + /* consume input by full buffer quantities */ + if (p+XXH3_INTERNALBUFFER_SIZE <= bEnd) { + const BYTE* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE; + do { + XXH3_64bits_consumeStripes(state->acc, + &state->nbStripesSoFar, state->nbStripesPerBlock, + p, XXH3_INTERNALBUFFER_STRIPES, + state->secret, state->secretLimit); + p += XXH3_INTERNALBUFFER_SIZE; + } while (p<=limit); + } + + if (p < bEnd) { /* some remaining input data : buffer it */ + XXH_memcpy(state->buffer, p, (size_t)(bEnd-p)); + state->bufferedSize = (XXH32_hash_t)(bEnd-p); + } + } + + return XXH_OK; +} + + +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state) +{ + if (state->totalLen > XXH3_INTERNALBUFFER_SIZE) { + XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[ACC_NB]; + memcpy(acc, state->acc, sizeof(acc)); /* digest locally, state remains unaltered, and can continue ingesting more data afterwards */ + if (state->bufferedSize >= STRIPE_LEN) { + size_t const totalNbStripes = state->bufferedSize / STRIPE_LEN; + XXH32_hash_t nbStripesSoFar = state->nbStripesSoFar; + XXH3_64bits_consumeStripes(acc, + &nbStripesSoFar, state->nbStripesPerBlock, + state->buffer, totalNbStripes, + state->secret, state->secretLimit); + if (state->bufferedSize % STRIPE_LEN) { /* one last partial stripe */ + XXH3_accumulate_512(acc, state->buffer + state->bufferedSize - STRIPE_LEN, (const char*)state->secret + state->secretLimit - XXH_SECRET_LASTACC_START); + } + } else { /* bufferedSize < STRIPE_LEN */ + if (state->bufferedSize) { /* one last stripe */ + char lastStripe[STRIPE_LEN]; + size_t const catchupSize = STRIPE_LEN - state->bufferedSize; + memcpy(lastStripe, (const char*)state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); + memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize); + XXH3_accumulate_512(acc, lastStripe, (const char*)state->secret + state->secretLimit - XXH_SECRET_LASTACC_START); + } } + return XXH3_mergeAccs(acc, (const char*)state->secret + XXH_SECRET_MERGEACCS_START, (U64)state->totalLen * PRIME64_1); + } + /* len <= XXH3_INTERNALBUFFER_SIZE : short code */ + if (state->seed) + return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed); + return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen), state->secret, state->secretLimit + STRIPE_LEN); +} + + +/* ========================================== + * XXH3 128 bits (=> XXH128) + * ========================================== */ + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_len_1to3_128b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(len > 0 && len <= 3); + assert(keyPtr != NULL); + { const U32* const key32 = (const U32*) keyPtr; + BYTE const c1 = ((const BYTE*)data)[0]; + BYTE const c2 = ((const BYTE*)data)[len >> 1]; + BYTE const c3 = ((const BYTE*)data)[len - 1]; + U32 const l1 = (U32)(c1) + ((U32)(c2) << 8); + U32 const l2 = (U32)(len) + ((U32)(c3) << 2); + U64 const ll11 = XXH_mult32to64((unsigned int)(l1 + seed + key32[0]), (unsigned int)(l2 + key32[1])); + U64 const ll12 = XXH_mult32to64((unsigned int)(l1 + key32[2]), (unsigned int)(l2 - seed + key32[3])); + XXH128_hash_t const h128 = { XXH3_avalanche(ll11), XXH3_avalanche(ll12) }; + return h128; + } +} + + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_len_4to8_128b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(len >= 4 && len <= 8); + { const U32* const key32 = (const U32*) keyPtr; + U32 const l1 = XXH_readLE32(data) + (U32)seed + key32[0]; + U32 const l2 = XXH_readLE32((const BYTE*)data + len - 4) + (U32)(seed >> 32) + key32[1]; + U64 const acc1 = len + l1 + ((U64)l2 << 32) + XXH_mult32to64(l1, l2); + U64 const acc2 = len*PRIME64_1 + l1*PRIME64_2 + l2*PRIME64_3; + { XXH128_hash_t const h128 = { XXH3_avalanche(acc1), XXH3_avalanche(acc2) }; + return h128; + } + } +} + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_len_9to16_128b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(key != NULL); + assert(len >= 9 && len <= 16); + { const U64* const key64 = (const U64*) keyPtr; + U64 acc1 = PRIME64_1 * ((U64)len + seed); + U64 acc2 = PRIME64_2 * ((U64)len - seed); + U64 const ll1 = XXH_readLE64(data); + U64 const ll2 = XXH_readLE64((const BYTE*)data + len - 8); + acc1 += XXH3_mul128_fold64(ll1 + XXH_readLE64(key64+0), ll2 + XXH_readLE64(key64+1)); + acc2 += XXH3_mul128_fold64(ll1 + XXH_readLE64(key64+2), ll2 + XXH_readLE64(key64+3)); + { XXH128_hash_t const h128 = { XXH3_avalanche(acc1), XXH3_avalanche(acc2) }; + return h128; + } + } +} + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_len_0to16_128b(const void* data, size_t len, XXH64_hash_t seed) +{ + assert(data != NULL); + assert(len <= 16); + { if (len > 8) return XXH3_len_9to16_128b(data, len, kSecret, seed); + if (len >= 4) return XXH3_len_4to8_128b(data, len, kSecret, seed); + if (len) return XXH3_len_1to3_128b(data, len, kSecret, seed); + { XXH128_hash_t const h128 = { seed, (XXH64_hash_t)0 - seed }; + return h128; + } + } +} + +XXH_NO_INLINE XXH128_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */ +XXH3_hashLong_128b(const void* data, size_t len, XXH64_hash_t seed) +{ + XXH_ALIGN(64) U64 acc[ACC_NB] = { seed, PRIME64_1, PRIME64_2, PRIME64_3, PRIME64_4, PRIME64_5, (U64)0 - seed, 0 }; + assert(len > 128); + + XXH3_hashLong_internal_loop(acc, data, len, kSecret, sizeof(kSecret)); + + /* converge into final hash */ + assert(sizeof(acc) == 64); + { U64 const low64 = XXH3_mergeAccs(acc, kSecret, (U64)len * PRIME64_1); + U64 const high64 = XXH3_mergeAccs(acc, kSecret+16, ((U64)len+1) * PRIME64_2); + XXH128_hash_t const h128 = { low64, high64 }; + return h128; + } +} + +XXH_PUBLIC_API XXH128_hash_t +XXH3_128bits_withSeed(const void* data, size_t len, XXH64_hash_t seed) +{ + if (len <= 16) return XXH3_len_0to16_128b(data, len, seed); + + { U64 acc1 = PRIME64_1 * (len + seed); + U64 acc2 = 0; + const BYTE* const p = (const BYTE*)data; + const char* const key = (const char*)kSecret; + if (len > 32) { + if (len > 64) { + if (len > 96) { + if (len > 128) return XXH3_hashLong_128b(data, len, seed); + + acc1 += XXH3_mix16B(p+48, key+96, seed); + acc2 += XXH3_mix16B(p+len-64, key+112, seed); + } + + acc1 += XXH3_mix16B(p+32, key+64, seed); + acc2 += XXH3_mix16B(p+len-48, key+80, seed); + } + + acc1 += XXH3_mix16B(p+16, key+32, seed); + acc2 += XXH3_mix16B(p+len-32, key+48, seed); + } + + acc1 += XXH3_mix16B(p+0, key+0, seed); + acc2 += XXH3_mix16B(p+len-16, key+16, seed); + + { U64 const part1 = acc1 + acc2; + U64 const part2 = (acc1 * PRIME64_3) + (acc2 * PRIME64_4) + ((len - seed) * PRIME64_2); + XXH128_hash_t const h128 = { XXH3_avalanche(part1), (XXH64_hash_t)0 - XXH3_avalanche(part2) }; + return h128; + } + } +} + + +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* data, size_t len) +{ + return XXH3_128bits_withSeed(data, len, 0); +} + + +XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed) +{ + return XXH3_128bits_withSeed(data, len, seed); +} + + +#ifdef UNDEF_NDEBUG +# undef NDEBUG +#endif + +#endif /* XXH3_H */ diff --git a/src/common/util/xxhash.c b/src/common/util/xxhash.c new file mode 100644 index 000000000..00b5aefb3 --- /dev/null +++ b/src/common/util/xxhash.c @@ -0,0 +1,1024 @@ +/* +* xxHash - Fast Hash algorithm +* Copyright (C) 2012-2016, Yann Collet +* +* BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following disclaimer +* in the documentation and/or other materials provided with the +* distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* You can contact the author at : +* - xxHash homepage: http://www.xxhash.com +* - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + + +/* ************************************* +* Tuning parameters +***************************************/ +/*!XXH_FORCE_MEMORY_ACCESS : + * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. + * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. + * The below switch allow to select different access method for improved performance. + * Method 0 (default) : use `memcpy()`. Safe and portable. + * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable). + * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. + * Method 2 : direct access. This method doesn't depend on compiler but violate C standard. + * It can generate buggy code on targets which do not support unaligned memory accesses. + * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6) + * See http://stackoverflow.com/a/32095106/646947 for details. + * Prefer these methods in priority order (0 > 1 > 2) + */ +#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ + || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ + || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) +# define XXH_FORCE_MEMORY_ACCESS 2 +# elif (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \ + (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ + || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ + || defined(__ARM_ARCH_7S__) )) +# define XXH_FORCE_MEMORY_ACCESS 1 +# endif +#endif + +/*!XXH_ACCEPT_NULL_INPUT_POINTER : + * If input pointer is NULL, xxHash default behavior is to dereference it, triggering a segfault. + * When this macro is enabled, xxHash actively checks input for null pointer. + * It it is, result for null input pointers is the same as a null-length input. + */ +#ifndef XXH_ACCEPT_NULL_INPUT_POINTER /* can be defined externally */ +# define XXH_ACCEPT_NULL_INPUT_POINTER 0 +#endif + +/*!XXH_FORCE_ALIGN_CHECK : + * This is a minor performance trick, only useful with lots of very small keys. + * It means : check for aligned/unaligned input. + * The check costs one initial branch per hash; + * set it to 0 when the input is guaranteed to be aligned, + * or when alignment doesn't matter for performance. + */ +#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ +# if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +# define XXH_FORCE_ALIGN_CHECK 0 +# else +# define XXH_FORCE_ALIGN_CHECK 1 +# endif +#endif + + +/* ************************************* +* Includes & Memory related functions +***************************************/ +/*! Modify the local functions below should you wish to use some other memory routines +* for malloc(), free() */ +#include +static void* XXH_malloc(size_t s) { return malloc(s); } +static void XXH_free (void* p) { free(p); } +/*! and for memcpy() */ +#include +static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); } + +#include /* assert */ + +#define XXH_STATIC_LINKING_ONLY +#include "xxhash.h" + + +/* ************************************* +* Compiler Specific Options +***************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# define XXH_FORCE_INLINE static __forceinline +# define XXH_NO_INLINE static __declspec(noinline) +#else +# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# ifdef __GNUC__ +# define XXH_FORCE_INLINE static inline __attribute__((always_inline)) +# define XXH_NO_INLINE static __attribute__((noinline)) +# else +# define XXH_FORCE_INLINE static inline +# define XXH_NO_INLINE static +# endif +# else +# define XXH_FORCE_INLINE static +# define XXH_NO_INLINE static +# endif /* __STDC_VERSION__ */ +#endif + + +/* ************************************* +* Basic Types +***************************************/ +#ifndef MEM_MODULE +# if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; +# else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; +# endif +#endif + + +/* === Memory access === */ + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +typedef union { U32 u32; } __attribute__((packed)) unalign; +static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; } + +#else + +/* portable and safe solution. Generally efficient. + * see : http://stackoverflow.com/a/32095106/646947 + */ +static U32 XXH_read32(const void* memPtr) +{ + U32 val; + memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + + +/* === Endianess === */ +typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; + +/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */ +#ifndef XXH_CPU_LITTLE_ENDIAN +static int XXH_isLittleEndian(void) +{ + const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */ + return one.c[0]; +} +# define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian() +#endif + + + + +/* **************************************** +* Compiler-specific Functions and Macros +******************************************/ +#define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */ +#if defined(_MSC_VER) +# define XXH_rotl32(x,r) _rotl(x,r) +# define XXH_rotl64(x,r) _rotl64(x,r) +#else +# define XXH_rotl32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +# define XXH_rotl64(x,r) (((x) << (r)) | ((x) >> (64 - (r)))) +#endif + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap32 _byteswap_ulong +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap32 __builtin_bswap32 +#else +static U32 XXH_swap32 (U32 x) +{ + return ((x << 24) & 0xff000000 ) | + ((x << 8) & 0x00ff0000 ) | + ((x >> 8) & 0x0000ff00 ) | + ((x >> 24) & 0x000000ff ); +} +#endif + + +/* *************************** +* Memory reads +*****************************/ +typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; + +XXH_FORCE_INLINE U32 XXH_readLE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); +} + +static U32 XXH_readBE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr); +} + +XXH_FORCE_INLINE U32 +XXH_readLE32_align(const void* ptr, XXH_alignment align) +{ + if (align==XXH_unaligned) { + return XXH_readLE32(ptr); + } else { + return XXH_CPU_LITTLE_ENDIAN ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr); + } +} + + +/* ************************************* +* Macros +***************************************/ +#define XXH_STATIC_ASSERT(c) { enum { XXH_sa = 1/(int)(!!(c)) }; } /* use after variable declarations */ +XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } + + +/* ******************************************************************* +* 32-bit hash functions +*********************************************************************/ +static const U32 PRIME32_1 = 2654435761U; /* 0b10011110001101110111100110110001 */ +static const U32 PRIME32_2 = 2246822519U; /* 0b10000101111010111100101001110111 */ +static const U32 PRIME32_3 = 3266489917U; /* 0b11000010101100101010111000111101 */ +static const U32 PRIME32_4 = 668265263U; /* 0b00100111110101001110101100101111 */ +static const U32 PRIME32_5 = 374761393U; /* 0b00010110010101100110011110110001 */ + +static U32 XXH32_round(U32 acc, U32 input) +{ + acc += input * PRIME32_2; + acc = XXH_rotl32(acc, 13); + acc *= PRIME32_1; +#if defined(__GNUC__) && defined(__SSE4_1__) && !defined(XXH_ENABLE_AUTOVECTORIZE) + /* UGLY HACK: + * This inline assembly hack forces acc into a normal register. This is the + * only thing that prevents GCC and Clang from autovectorizing the XXH32 loop + * (pragmas and attributes don't work for some resason) without globally + * disabling SSE4.1. + * + * The reason we want to avoid vectorization is because despite working on + * 4 integers at a time, there are multiple factors slowing XXH32 down on + * SSE4: + * - There's a ridiculous amount of lag from pmulld (10 cycles of latency on newer chips!) + * making it slightly slower to multiply four integers at once compared to four + * integers independently. Even when pmulld was fastest, Sandy/Ivy Bridge, it is + * still not worth it to go into SSE just to multiply unless doing a long operation. + * + * - Four instructions are required to rotate, + * movqda tmp, v // not required with VEX encoding + * pslld tmp, 13 // tmp <<= 13 + * psrld v, 19 // x >>= 19 + * por v, tmp // x |= tmp + * compared to one for scalar: + * roll v, 13 // reliably fast across the board + * shldl v, v, 13 // Sandy Bridge and later prefer this for some reason + * + * - Instruction level parallelism is actually more beneficial here because the + * SIMD actually serializes this operation: While v1 is rotating, v2 can load data, + * while v3 can multiply. SSE forces them to operate together. + * + * How this hack works: + * __asm__("" // Declare an assembly block but don't declare any instructions + * : // However, as an Input/Output Operand, + * "+r" // constrain a read/write operand (+) as a general purpose register (r). + * (acc) // and set acc as the operand + * ); + * + * Because of the 'r', the compiler has promised that seed will be in a + * general purpose register and the '+' says that it will be 'read/write', + * so it has to assume it has changed. It is like volatile without all the + * loads and stores. + * + * Since the argument has to be in a normal register (not an SSE register), + * each time XXH32_round is called, it is impossible to vectorize. */ + __asm__("" : "+r" (acc)); +#endif + return acc; +} + +/* mix all bits */ +static U32 XXH32_avalanche(U32 h32) +{ + h32 ^= h32 >> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + return(h32); +} + +#define XXH_get32bits(p) XXH_readLE32_align(p, align) + +static U32 +XXH32_finalize(U32 h32, const void* ptr, size_t len, XXH_alignment align) + +{ + const BYTE* p = (const BYTE*)ptr; + +#define PROCESS1 \ + h32 += (*p++) * PRIME32_5; \ + h32 = XXH_rotl32(h32, 11) * PRIME32_1 ; + +#define PROCESS4 \ + h32 += XXH_get32bits(p) * PRIME32_3; \ + p+=4; \ + h32 = XXH_rotl32(h32, 17) * PRIME32_4 ; + + switch(len&15) /* or switch(bEnd - p) */ + { + case 12: PROCESS4; + /* fallthrough */ + case 8: PROCESS4; + /* fallthrough */ + case 4: PROCESS4; + return XXH32_avalanche(h32); + + case 13: PROCESS4; + /* fallthrough */ + case 9: PROCESS4; + /* fallthrough */ + case 5: PROCESS4; + PROCESS1; + return XXH32_avalanche(h32); + + case 14: PROCESS4; + /* fallthrough */ + case 10: PROCESS4; + /* fallthrough */ + case 6: PROCESS4; + PROCESS1; + PROCESS1; + return XXH32_avalanche(h32); + + case 15: PROCESS4; + /* fallthrough */ + case 11: PROCESS4; + /* fallthrough */ + case 7: PROCESS4; + /* fallthrough */ + case 3: PROCESS1; + /* fallthrough */ + case 2: PROCESS1; + /* fallthrough */ + case 1: PROCESS1; + /* fallthrough */ + case 0: return XXH32_avalanche(h32); + } + assert(0); + return h32; /* reaching this point is deemed impossible */ +} + +XXH_FORCE_INLINE U32 +XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U32 h32; + +#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1) + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)16; + } +#endif + + if (len>=16) { + const BYTE* const limit = bEnd - 15; + U32 v1 = seed + PRIME32_1 + PRIME32_2; + U32 v2 = seed + PRIME32_2; + U32 v3 = seed + 0; + U32 v4 = seed - PRIME32_1; + + do { + v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4; + v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4; + v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4; + v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4; + } while (p < limit); + + h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); + } else { + h32 = seed + PRIME32_5; + } + + h32 += (U32)len; + + return XXH32_finalize(h32, p, len&15, align); +} + + +XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH32_state_t state; + XXH32_reset(&state, seed); + XXH32_update(&state, input, len); + return XXH32_digest(&state); + +#else + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */ + return XXH32_endian_align(input, len, seed, XXH_aligned); + } } + + return XXH32_endian_align(input, len, seed, XXH_unaligned); +#endif +} + + + +/*====== Hash streaming ======*/ + +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) +{ + return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState) +{ + memcpy(dstState, srcState, sizeof(*dstState)); +} + +XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed) +{ + XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + memset(&state, 0, sizeof(state)); + state.v1 = seed + PRIME32_1 + PRIME32_2; + state.v2 = seed + PRIME32_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME32_1; + /* do not write into reserved, planned to be removed in a future version */ + memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved)); + return XXH_OK; +} + + +XXH_PUBLIC_API XXH_errorcode +XXH32_update(XXH32_state_t* state, const void* input, size_t len) +{ + if (input==NULL) +#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1) + return XXH_OK; +#else + return XXH_ERROR; +#endif + + { const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + + state->total_len_32 += (XXH32_hash_t)len; + state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16)); + + if (state->memsize + len < 16) { /* fill in tmp buffer */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len); + state->memsize += (XXH32_hash_t)len; + return XXH_OK; + } + + if (state->memsize) { /* some data left from previous update */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize); + { const U32* p32 = state->mem32; + state->v1 = XXH32_round(state->v1, XXH_readLE32(p32)); p32++; + state->v2 = XXH32_round(state->v2, XXH_readLE32(p32)); p32++; + state->v3 = XXH32_round(state->v3, XXH_readLE32(p32)); p32++; + state->v4 = XXH32_round(state->v4, XXH_readLE32(p32)); + } + p += 16-state->memsize; + state->memsize = 0; + } + + if (p <= bEnd-16) { + const BYTE* const limit = bEnd - 16; + U32 v1 = state->v1; + U32 v2 = state->v2; + U32 v3 = state->v3; + U32 v4 = state->v4; + + do { + v1 = XXH32_round(v1, XXH_readLE32(p)); p+=4; + v2 = XXH32_round(v2, XXH_readLE32(p)); p+=4; + v3 = XXH32_round(v3, XXH_readLE32(p)); p+=4; + v4 = XXH32_round(v4, XXH_readLE32(p)); p+=4; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + } + + return XXH_OK; +} + + +XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state) +{ + U32 h32; + + if (state->large_len) { + h32 = XXH_rotl32(state->v1, 1) + + XXH_rotl32(state->v2, 7) + + XXH_rotl32(state->v3, 12) + + XXH_rotl32(state->v4, 18); + } else { + h32 = state->v3 /* == seed */ + PRIME32_5; + } + + h32 += state->total_len_32; + + return XXH32_finalize(h32, state->mem32, state->memsize, XXH_aligned); +} + + +/*====== Canonical representation ======*/ + +/*! Default XXH result types are basic unsigned 32 and 64 bits. +* The canonical representation follows human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file or buffer, remaining comparable across different systems. +*/ + +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); + memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) +{ + return XXH_readBE32(src); +} + + +#ifndef XXH_NO_LONG_LONG + +/* ******************************************************************* +* 64-bit hash functions +*********************************************************************/ + +/*====== Memory access ======*/ + +#ifndef MEM_MODULE +# define MEM_MODULE +# if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint64_t U64; +# else + /* if compiler doesn't support unsigned long long, replace by another 64-bit type */ + typedef unsigned long long U64; +# endif +#endif + + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign64; +static U64 XXH_read64(const void* ptr) { return ((const unalign64*)ptr)->u64; } + +#else + +/* portable and safe solution. Generally efficient. + * see : http://stackoverflow.com/a/32095106/646947 + */ + +static U64 XXH_read64(const void* memPtr) +{ + U64 val; + memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap64 _byteswap_uint64 +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap64 __builtin_bswap64 +#else +static U64 XXH_swap64 (U64 x) +{ + return ((x << 56) & 0xff00000000000000ULL) | + ((x << 40) & 0x00ff000000000000ULL) | + ((x << 24) & 0x0000ff0000000000ULL) | + ((x << 8) & 0x000000ff00000000ULL) | + ((x >> 8) & 0x00000000ff000000ULL) | + ((x >> 24) & 0x0000000000ff0000ULL) | + ((x >> 40) & 0x000000000000ff00ULL) | + ((x >> 56) & 0x00000000000000ffULL); +} +#endif + +XXH_FORCE_INLINE U64 XXH_readLE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); +} + +static U64 XXH_readBE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr); +} + +XXH_FORCE_INLINE U64 +XXH_readLE64_align(const void* ptr, XXH_alignment align) +{ + if (align==XXH_unaligned) + return XXH_readLE64(ptr); + else + return XXH_CPU_LITTLE_ENDIAN ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr); +} + + +/*====== xxh64 ======*/ + +static const U64 PRIME64_1 = 11400714785074694791ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111 */ +static const U64 PRIME64_2 = 14029467366897019727ULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111 */ +static const U64 PRIME64_3 = 1609587929392839161ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001 */ +static const U64 PRIME64_4 = 9650029242287828579ULL; /* 0b1000010111101011110010100111011111000010101100101010111001100011 */ +static const U64 PRIME64_5 = 2870177450012600261ULL; /* 0b0010011111010100111010110010111100010110010101100110011111000101 */ + +static U64 XXH64_round(U64 acc, U64 input) +{ + acc += input * PRIME64_2; + acc = XXH_rotl64(acc, 31); + acc *= PRIME64_1; + return acc; +} + +static U64 XXH64_mergeRound(U64 acc, U64 val) +{ + val = XXH64_round(0, val); + acc ^= val; + acc = acc * PRIME64_1 + PRIME64_4; + return acc; +} + +static U64 XXH64_avalanche(U64 h64) +{ + h64 ^= h64 >> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + return h64; +} + + +#define XXH_get64bits(p) XXH_readLE64_align(p, align) + +static U64 +XXH64_finalize(U64 h64, const void* ptr, size_t len, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)ptr; + +#define PROCESS1_64 \ + h64 ^= (*p++) * PRIME64_5; \ + h64 = XXH_rotl64(h64, 11) * PRIME64_1; + +#define PROCESS4_64 \ + h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; \ + p+=4; \ + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + +#define PROCESS8_64 { \ + U64 const k1 = XXH64_round(0, XXH_get64bits(p)); \ + p+=8; \ + h64 ^= k1; \ + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; \ +} + + switch(len&31) { + case 24: PROCESS8_64; + /* fallthrough */ + case 16: PROCESS8_64; + /* fallthrough */ + case 8: PROCESS8_64; + return XXH64_avalanche(h64); + + case 28: PROCESS8_64; + /* fallthrough */ + case 20: PROCESS8_64; + /* fallthrough */ + case 12: PROCESS8_64; + /* fallthrough */ + case 4: PROCESS4_64; + return XXH64_avalanche(h64); + + case 25: PROCESS8_64; + /* fallthrough */ + case 17: PROCESS8_64; + /* fallthrough */ + case 9: PROCESS8_64; + PROCESS1_64; + return XXH64_avalanche(h64); + + case 29: PROCESS8_64; + /* fallthrough */ + case 21: PROCESS8_64; + /* fallthrough */ + case 13: PROCESS8_64; + /* fallthrough */ + case 5: PROCESS4_64; + PROCESS1_64; + return XXH64_avalanche(h64); + + case 26: PROCESS8_64; + /* fallthrough */ + case 18: PROCESS8_64; + /* fallthrough */ + case 10: PROCESS8_64; + PROCESS1_64; + PROCESS1_64; + return XXH64_avalanche(h64); + + case 30: PROCESS8_64; + /* fallthrough */ + case 22: PROCESS8_64; + /* fallthrough */ + case 14: PROCESS8_64; + /* fallthrough */ + case 6: PROCESS4_64; + PROCESS1_64; + PROCESS1_64; + return XXH64_avalanche(h64); + + case 27: PROCESS8_64; + /* fallthrough */ + case 19: PROCESS8_64; + /* fallthrough */ + case 11: PROCESS8_64; + PROCESS1_64; + PROCESS1_64; + PROCESS1_64; + return XXH64_avalanche(h64); + + case 31: PROCESS8_64; + /* fallthrough */ + case 23: PROCESS8_64; + /* fallthrough */ + case 15: PROCESS8_64; + /* fallthrough */ + case 7: PROCESS4_64; + /* fallthrough */ + case 3: PROCESS1_64; + /* fallthrough */ + case 2: PROCESS1_64; + /* fallthrough */ + case 1: PROCESS1_64; + /* fallthrough */ + case 0: return XXH64_avalanche(h64); + } + + /* impossible to reach */ + assert(0); + return 0; /* unreachable, but some compilers complain without it */ +} + +XXH_FORCE_INLINE U64 +XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U64 h64; + +#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1) + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)32; + } +#endif + + if (len>=32) { + const BYTE* const limit = bEnd - 32; + U64 v1 = seed + PRIME64_1 + PRIME64_2; + U64 v2 = seed + PRIME64_2; + U64 v3 = seed + 0; + U64 v4 = seed - PRIME64_1; + + do { + v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8; + v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8; + v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8; + v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8; + } while (p<=limit); + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + + } else { + h64 = seed + PRIME64_5; + } + + h64 += (U64) len; + + return XXH64_finalize(h64, p, len, align); +} + + +XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t len, unsigned long long seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH64_state_t state; + XXH64_reset(&state, seed); + XXH64_update(&state, input, len); + return XXH64_digest(&state); + +#else + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */ + return XXH64_endian_align(input, len, seed, XXH_aligned); + } } + + return XXH64_endian_align(input, len, seed, XXH_unaligned); + +#endif +} + +/*====== Hash Streaming ======*/ + +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) +{ + return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dstState, const XXH64_state_t* srcState) +{ + memcpy(dstState, srcState, sizeof(*dstState)); +} + +XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed) +{ + XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + memset(&state, 0, sizeof(state)); + state.v1 = seed + PRIME64_1 + PRIME64_2; + state.v2 = seed + PRIME64_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME64_1; + /* do not write into reserved, might be removed in a future version */ + memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved)); + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode +XXH64_update (XXH64_state_t* state, const void* input, size_t len) +{ + if (input==NULL) +#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1) + return XXH_OK; +#else + return XXH_ERROR; +#endif + + { const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + + state->total_len += len; + + if (state->memsize + len < 32) { /* fill in tmp buffer */ + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len); + state->memsize += (U32)len; + return XXH_OK; + } + + if (state->memsize) { /* tmp buffer is full */ + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize); + state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0)); + state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1)); + state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2)); + state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3)); + p += 32-state->memsize; + state->memsize = 0; + } + + if (p+32 <= bEnd) { + const BYTE* const limit = bEnd - 32; + U64 v1 = state->v1; + U64 v2 = state->v2; + U64 v3 = state->v3; + U64 v4 = state->v4; + + do { + v1 = XXH64_round(v1, XXH_readLE64(p)); p+=8; + v2 = XXH64_round(v2, XXH_readLE64(p)); p+=8; + v3 = XXH64_round(v3, XXH_readLE64(p)); p+=8; + v4 = XXH64_round(v4, XXH_readLE64(p)); p+=8; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + } + + return XXH_OK; +} + + +XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* state) +{ + U64 h64; + + if (state->total_len >= 32) { + U64 const v1 = state->v1; + U64 const v2 = state->v2; + U64 const v3 = state->v3; + U64 const v4 = state->v4; + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + } else { + h64 = state->v3 /*seed*/ + PRIME64_5; + } + + h64 += (U64) state->total_len; + + return XXH64_finalize(h64, state->mem64, (size_t)state->total_len, XXH_aligned); +} + + +/*====== Canonical representation ======*/ + +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); + memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) +{ + return XXH_readBE64(src); +} + + + +/* ********************************************************************* +* XXH3 +* New generation hash designed for speed on small keys and vectorization +************************************************************************ */ + +#include "xxh3.h" + + +#endif /* XXH_NO_LONG_LONG */ diff --git a/src/common/util/xxhash.h b/src/common/util/xxhash.h new file mode 100644 index 000000000..d01ac4091 --- /dev/null +++ b/src/common/util/xxhash.h @@ -0,0 +1,512 @@ +/* + xxHash - Extremely Fast Hash algorithm + Header File + Copyright (C) 2012-2016, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + +/* Notice extracted from xxHash homepage : + +xxHash is an extremely fast Hash algorithm, running at RAM speed limits. +It also successfully passes all tests from the SMHasher suite. + +Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) + +Name Speed Q.Score Author +xxHash 5.4 GB/s 10 +CrapWow 3.2 GB/s 2 Andrew +MumurHash 3a 2.7 GB/s 10 Austin Appleby +SpookyHash 2.0 GB/s 10 Bob Jenkins +SBox 1.4 GB/s 9 Bret Mulvey +Lookup3 1.2 GB/s 9 Bob Jenkins +SuperFastHash 1.2 GB/s 1 Paul Hsieh +CityHash64 1.05 GB/s 10 Pike & Alakuijala +FNV 0.55 GB/s 5 Fowler, Noll, Vo +CRC32 0.43 GB/s 9 +MD5-32 0.33 GB/s 10 Ronald L. Rivest +SHA1-32 0.28 GB/s 10 + +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. +10 is a perfect score. + +A 64-bit version, named XXH64, is available since r35. +It offers much better speed, but for 64-bit applications only. +Name Speed on 64 bits Speed on 32 bits +XXH64 13.8 GB/s 1.9 GB/s +XXH32 6.8 GB/s 6.0 GB/s +*/ + +#ifndef XXHASH_H_5627135585666179 +#define XXHASH_H_5627135585666179 1 + +#if defined (__cplusplus) +extern "C" { +#endif + + +/* **************************** +* Definitions +******************************/ +#include /* size_t */ +typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + + +/* **************************** + * API modifier + ******************************/ +/** XXH_INLINE_ALL (and XXH_PRIVATE_API) + * This is useful to include xxhash functions in `static` mode + * in order to inline them, and remove their symbol from the public list. + * Inlining can offer dramatic performance improvement on small keys. + * Methodology : + * #define XXH_INLINE_ALL + * #include "xxhash.h" + * `xxhash.c` is automatically included. + * It's not useful to compile and link it as a separate module. + */ +#if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) +# ifndef XXH_STATIC_LINKING_ONLY +# define XXH_STATIC_LINKING_ONLY +# endif +# if defined(__GNUC__) +# define XXH_PUBLIC_API static __inline __attribute__((unused)) +# elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define XXH_PUBLIC_API static inline +# elif defined(_MSC_VER) +# define XXH_PUBLIC_API static __inline +# else + /* this version may generate warnings for unused static functions */ +# define XXH_PUBLIC_API static +# endif +#else +# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) +# ifdef XXH_EXPORT +# define XXH_PUBLIC_API __declspec(dllexport) +# elif XXH_IMPORT +# define XXH_PUBLIC_API __declspec(dllimport) +# endif +# else +# define XXH_PUBLIC_API /* do nothing */ +# endif +#endif /* XXH_INLINE_ALL || XXH_PRIVATE_API */ + +/*! XXH_NAMESPACE, aka Namespace Emulation : + * + * If you want to include _and expose_ xxHash functions from within your own library, + * but also want to avoid symbol collisions with other libraries which may also include xxHash, + * + * you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library + * with the value of XXH_NAMESPACE (therefore, avoid NULL and numeric values). + * + * Note that no change is required within the calling program as long as it includes `xxhash.h` : + * regular symbol name will be automatically translated by this header. + */ +#ifdef XXH_NAMESPACE +# define XXH_CAT(A,B) A##B +# define XXH_NAME2(A,B) XXH_CAT(A,B) +# define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber) +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) +# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) +# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) +# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) +# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) +# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) +# define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState) +# define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash) +# define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical) +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) +# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) +# define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical) +#endif + + +/* ************************************* +* Version +***************************************/ +#define XXH_VERSION_MAJOR 0 +#define XXH_VERSION_MINOR 7 +#define XXH_VERSION_RELEASE 0 +#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) +XXH_PUBLIC_API unsigned XXH_versionNumber (void); + + +/*-********************************************************************** +* 32-bit hash +************************************************************************/ +#if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint32_t XXH32_hash_t; +#else + typedef unsigned int XXH32_hash_t; +#endif + +/*! XXH32() : + Calculate the 32-bit hash of sequence "length" bytes stored at memory address "input". + The memory between input & input+length must be valid (allocated and read-accessible). + "seed" can be used to alter the result predictably. + Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s */ +XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed); + +/*====== Streaming ======*/ +typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed); +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); + +/* + * Streaming functions generate the xxHash of an input provided in multiple segments. + * Note that, for small input, they are slower than single-call functions, due to state management. + * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized. + * + * XXH state must first be allocated, using XXH*_createState() . + * + * Start a new hash by initializing state with a seed, using XXH*_reset(). + * + * Then, feed the hash state by calling XXH*_update() as many times as necessary. + * The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. + * + * Finally, a hash value can be produced anytime, by using XXH*_digest(). + * This function returns the nn-bits hash as an int or long long. + * + * It's still possible to continue inserting input into the hash state after a digest, + * and generate some new hashes later on, by calling again XXH*_digest(). + * + * When done, free XXH state space if it was allocated dynamically. + */ + +/*====== Canonical representation ======*/ + +typedef struct { unsigned char digest[4]; } XXH32_canonical_t; +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash); +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); + +/* Default result type for XXH functions are primitive unsigned 32 and 64 bits. + * The canonical representation uses human-readable write convention, aka big-endian (large digits first). + * These functions allow transformation of hash result into and from its canonical format. + * This way, hash values can be written into a file / memory, and remain comparable on different systems and programs. + */ + + +#ifndef XXH_NO_LONG_LONG +/*-********************************************************************** +* 64-bit hash +************************************************************************/ +#if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# include + typedef uint64_t XXH64_hash_t; +#else + typedef unsigned long long XXH64_hash_t; +#endif + +/*! XXH64() : + Calculate the 64-bit hash of sequence of length "len" stored at memory address "input". + "seed" can be used to alter the result predictably. + This function runs faster on 64-bit systems, but slower on 32-bit systems (see benchmark). +*/ +XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed); + +/*====== Streaming ======*/ +typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); + +/*====== Canonical representation ======*/ +typedef struct { unsigned char digest[8]; } XXH64_canonical_t; +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); + + +#endif /* XXH_NO_LONG_LONG */ + + + +#ifdef XXH_STATIC_LINKING_ONLY + +/* ================================================================================================ + This section contains declarations which are not guaranteed to remain stable. + They may change in future versions, becoming incompatible with a different version of the library. + These declarations should only be used with static linking. + Never use them in association with dynamic linking ! +=================================================================================================== */ + +/* These definitions are only present to allow + * static allocation of XXH state, on stack or in a struct for example. + * Never **ever** use members directly. */ + +struct XXH32_state_s { + XXH32_hash_t total_len_32; + XXH32_hash_t large_len; + XXH32_hash_t v1; + XXH32_hash_t v2; + XXH32_hash_t v3; + XXH32_hash_t v4; + XXH32_hash_t mem32[4]; + XXH32_hash_t memsize; + XXH32_hash_t reserved; /* never read nor write, might be removed in a future version */ +}; /* typedef'd to XXH32_state_t */ + +#ifndef XXH_NO_LONG_LONG /* remove 64-bit support */ +struct XXH64_state_s { + XXH64_hash_t total_len; + XXH64_hash_t v1; + XXH64_hash_t v2; + XXH64_hash_t v3; + XXH64_hash_t v4; + XXH64_hash_t mem64[4]; + XXH32_hash_t memsize; + XXH32_hash_t reserved[2]; /* never read nor write, might be removed in a future version */ +}; /* typedef'd to XXH64_state_t */ +#endif /* XXH_NO_LONG_LONG */ + + +/*-********************************************************************** +* XXH3 +* New experimental hash +************************************************************************/ +#ifndef XXH_NO_LONG_LONG + + +/* ============================================ + * XXH3 is a new hash algorithm, + * featuring vastly improved speed performance + * for both small and large inputs. + * See full speed analysis at : http://fastcompression.blogspot.com/2019/03/presenting-xxh3.html + * In general, expect XXH3 to run about ~2x faster on large inputs, + * and >3x faster on small ones, though exact difference depend on platform. + * + * The algorithm is portable, will generate the same hash on all platforms. + * It benefits greatly from vectorization units, but does not require it. + * + * XXH3 offers 2 variants, _64bits and _128bits. + * When only 64 bits are needed, prefer calling the _64bits variant : + * it reduces the amount of mixing, resulting in faster speed on small inputs. + * It's also generally simpler to manipulate a scalar return type than a struct. + * + * The XXH3 algorithm is still considered experimental. + * Produced results can still change between versions. + * It's possible to use it for ephemeral data, but avoid storing long-term values for later re-use. + * + * The API currently supports one-shot hashing only. + * The full version will include streaming capability, and canonical representation. + * + * There are still a number of opened questions that community can influence during the experimental period. + * I'm trying to list a few of them below, though don't consider this list as complete. + * + * - 128-bits output type : currently defined as a structure of 2 64-bits fields. + * That's because 128-bit values do not exist in C standard. + * Note that it means that, at byte level, result is not identical depending on endianess. + * However, at field level, they are identical on all platforms. + * The canonical representation will solve the issue of identical byte-level representation across platforms, + * which is necessary for serialization. + * Would there be a better representation for a 128-bit hash result ? + * Are the names of the inner 64-bit fields important ? Should they be changed ? + * + * - Canonical representation : for the 64-bit variant, canonical representation is the same as XXH64() (aka big-endian). + * What should it be for the 128-bit variant ? + * Since it's no longer a scalar value, big-endian representation is no longer an obvious choice. + * One possibility : represent it as the concatenation of two 64-bits canonical representation (aka 2x big-endian) + * Another one : represent it in the same order as natural order in the struct for little-endian platforms. + * Less consistent with existing convention for XXH32/XXH64, but may be more natural for little-endian platforms. + * + * - Associated functions for 128-bit hash : simple things, such as checking if 2 hashes are equal, become more difficult with struct. + * Granted, it's not terribly difficult to create a comparator, but it's still a workload. + * Would it be beneficial to declare and define a comparator function for XXH128_hash_t ? + * Are there other operations on XXH128_hash_t which would be desirable ? + * + * - Seed type for 128-bits variant : currently, it's a single 64-bit value, like the 64-bit variant. + * It could be argued that it's more logical to offer a 128-bit seed input parameter for a 128-bit hash. + * Although it's also more difficult to use, since it requires to declare and pass a structure instead of a value. + * It would either replace current choice, or add a new one. + * Farmhash, for example, offers both variants (the 128-bits seed variant is called `doubleSeed`). + * If both 64-bit and 128-bit seeds are possible, which variant should be called XXH128 ? + * + * - Result for len==0 : Currently, the result of hashing a zero-length input is `0`. + * It seems okay as a return value when using all "default" secret and seed (it used to be a request for XXH32/XXH64). + * But is it still fine to return `0` when secret or seed are non-default ? + * Are there use case which would depend on a different hash result when the secret is different ? + */ + +#ifdef XXH_NAMESPACE +# define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits) +# define XXH3_64bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret) +# define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed) + +# define XXH3_64bits_createState XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_createState) +# define XXH3_64bits_freeState XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_freeState) +# define XXH3_64bits_copyState XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_copyState) +# define XXH3_64bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset) +# define XXH3_64bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed) +# define XXH3_64bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret) +# define XXH3_64bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update) +# define XXH3_64bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest) + +# define XXH3_128bits XXH_NAME2(XXH_NAMESPACE, XXH3_128bits) +# define XXH3_128bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed) +# define XXH128 XXH_NAME2(XXH_NAMESPACE, XXH128) +#endif + +/* XXH3_64bits() : + * default 64-bit variant, using default secret and default seed of 0. + * it's also the fastest one. */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* data, size_t len); + +/* XXH3_64bits_withSecret() : + * It's possible to provide any blob of bytes as a "secret" to generate the hash. + * This makes it more difficult for an external actor to prepare an intentional collision. + * The secret *must* be large enough (>= XXH_SECRET_SIZE_MIN). + * It should consist of random bytes. + * Avoid repeating same character, and especially avoid swathes of \0. + * Avoid repeating sequences of bytes within the secret. + * Failure to respect these conditions will result in a bad quality hash. + */ +#define XXH_SECRET_SIZE_MIN 136 +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize); + +/* XXH3_64bits_withSeed() : + * This variant generates on the fly a custom secret, + * based on the default secret, altered using the `seed` value. + * While this operation is decently fast, note that it's not completely free. + * note : seed==0 produces same results as XXH3_64bits() */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, XXH64_hash_t seed); + + +/* streaming 64-bit */ + +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11+ */ +# include +# define XXH_ALIGN(n) alignas(n) +#elif defined(__GNUC__) +# define XXH_ALIGN(n) __attribute__ ((aligned(n))) +#elif defined(_MSC_VER) +# define XXH_ALIGN(n) __declspec(align(n)) +#else +# define XXH_ALIGN(n) /* disabled */ +#endif + +typedef struct XXH3_state_s XXH3_state_t; + +#define XXH3_SECRET_DEFAULT_SIZE 192 /* minimum XXH_SECRET_SIZE_MIN */ +#define XXH3_INTERNALBUFFER_SIZE 128 +struct XXH3_state_s { + XXH_ALIGN(64) XXH64_hash_t acc[8]; + XXH_ALIGN(64) char customSecret[XXH3_SECRET_DEFAULT_SIZE]; /* used to store a custom secret generated from the seed. Makes state larger. Design might change */ + XXH_ALIGN(64) char buffer[XXH3_INTERNALBUFFER_SIZE]; + const void* secret; + XXH32_hash_t bufferedSize; + XXH32_hash_t nbStripesPerBlock; + XXH32_hash_t nbStripesSoFar; + XXH32_hash_t reserved32; + XXH32_hash_t reserved32_2; + XXH32_hash_t secretLimit; + XXH64_hash_t totalLen; + XXH64_hash_t seed; + XXH64_hash_t reserved64; +}; /* typedef'd to XXH3_state_t */ + +/* Streaming requires state maintenance. + * This operation costs memory and cpu. + * As a consequence, streaming is slower than one-shot hashing. + * For better performance, prefer using one-short functions anytime possible. */ + +XXH_PUBLIC_API XXH3_state_t* XXH3_64bits_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_freeState(XXH3_state_t* statePtr); +XXH_PUBLIC_API void XXH3_64bits_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state); + +/* XXH3_64bits_reset() : + * initialize with default parameters. + * result will be equivalent to `XXH3_64bits()` */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH3_state_t* statePtr); +/* XXH3_64bits_reset_withSeed() : + * generate a custom secret from `seed`, and store it into state. + * digest will be equivalent to `XXH3_64bits_withSeed()` */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed); +/* XXH3_64bits_reset_withSecret() : + * `secret` is referenced, and must outlive the hash streaming session. + * secretSize must be >= XXH_SECRET_SIZE_MIN. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize); + +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH3_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* statePtr); + + +/* 128-bit */ + +typedef struct { + XXH64_hash_t low64; + XXH64_hash_t high64; +} XXH128_hash_t; + +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* data, size_t len); +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed(const void* data, size_t len, XXH64_hash_t seed); /* == XXH128() */ +XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed); + + + +#endif /* XXH_NO_LONG_LONG */ + + +/*-********************************************************************** +* XXH_INLINE_ALL +************************************************************************/ +#if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) +# include "xxhash.c" /* include xxhash function bodies as `static`, for inlining */ +#endif + + + +#endif /* XXH_STATIC_LINKING_ONLY */ + + +#if defined (__cplusplus) +} +#endif + +#endif /* XXHASH_H_5627135585666179 */ diff --git a/src/Common/Win32/AlignPosfix1.h b/src/common/win32/AlignPosfix1.h similarity index 74% rename from src/Common/Win32/AlignPosfix1.h rename to src/common/win32/AlignPosfix1.h index 239e3387d..29390d679 100644 --- a/src/Common/Win32/AlignPosfix1.h +++ b/src/common/win32/AlignPosfix1.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->AlignPosfix1.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Common/Win32/AlignPrefix1.h b/src/common/win32/AlignPrefix1.h similarity index 76% rename from src/Common/Win32/AlignPrefix1.h rename to src/common/win32/AlignPrefix1.h index d564022df..d42a9e661 100644 --- a/src/Common/Win32/AlignPrefix1.h +++ b/src/common/win32/AlignPrefix1.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->AlignPrefix1.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Common/Win32/EmuShared.cpp b/src/common/win32/EmuShared.cpp similarity index 78% rename from src/Common/Win32/EmuShared.cpp rename to src/common/win32/EmuShared.cpp index 6868de5a3..a5be36e89 100644 --- a/src/Common/Win32/EmuShared.cpp +++ b/src/common/win32/EmuShared.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuShared.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,11 +24,10 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#include "CxbxKrnl/CxbxKrnl.h" -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuShared.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "EmuShared.h" #undef FIELD_OFFSET // prevent macro redefinition warnings #include @@ -56,7 +46,7 @@ HANDLE hMapObject = NULL; // ****************************************************************** // * func: EmuShared::EmuSharedInit // ****************************************************************** -void EmuShared::Init() +void EmuShared::Init(DWORD guiProcessID) { // ****************************************************************** // * Ensure initialization only occurs once @@ -73,18 +63,20 @@ void EmuShared::Init() // * Create the shared memory "file" // ****************************************************************** { + // NOTE: guiProcessID support is not available due to 2+ emulation is causing problem with graphic screen. + std::string emuSharedStr = "Local\\EmuShared-s" + std::to_string(settings_version);// +"-p" + std::to_string(guiProcessID); hMapObject = CreateFileMapping ( INVALID_HANDLE_VALUE, // Paging file - NULL, // default security attributes + nullptr, // default security attributes PAGE_READWRITE, // read/write access 0, // size: high 32 bits sizeof(EmuShared), // size: low 32 bits - "Local\\EmuShared" // name of map object + emuSharedStr.c_str() // name of map object ); if(hMapObject == NULL) - CxbxKrnlCleanup("Could not map shared memory!"); + CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map shared memory!"); if(GetLastError() == ERROR_ALREADY_EXISTS) bRequireConstruction = false; @@ -104,14 +96,15 @@ void EmuShared::Init() ); if(g_EmuShared == nullptr) - CxbxKrnlCleanup("Could not map view of shared memory!"); + CxbxKrnlCleanupEx(CXBXR_MODULE::INIT, "Could not map view of shared memory!"); } // ****************************************************************** // * Executed only on first initialization of shared memory // ****************************************************************** - if(bRequireConstruction) + if (bRequireConstruction) { g_EmuShared->EmuShared::EmuShared(); + } g_EmuShared->m_RefCount++; } @@ -135,10 +128,23 @@ void EmuShared::Cleanup() // ****************************************************************** EmuShared::EmuShared() { - Load(); m_bDebugging = false; - m_bEmulating = false; + m_bEmulating_status = false; m_bFirstLaunch = false; + + // Reserve space (default to 0) + m_bReserved2 = false; + m_bReserved3 = false; + m_bReserved4 = false; + m_Reserved5 = 0; + m_Reserved6 = 0.0f; + std::memset(m_Reserved7, 0, sizeof(m_Reserved7)); + std::memset(m_Reserved99, 0, sizeof(m_Reserved99)); + std::memset(m_DeviceControlNames, '\0', sizeof(m_DeviceControlNames)); + std::memset(m_DeviceName, '\0', sizeof(m_DeviceName)); + for (auto& i : m_DeviceType) { + i = to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID); + } } // ****************************************************************** @@ -146,19 +152,4 @@ EmuShared::EmuShared() // ****************************************************************** EmuShared::~EmuShared() { - Save(); -} - -void EmuShared::Load() -{ - m_XBController.Load("Software\\Cxbx-Reloaded\\XBController"); - m_XBVideo.Load("Software\\Cxbx-Reloaded\\XBVideo"); - m_XBAudio.Load("Software\\Cxbx-Reloaded\\XBAudio"); -} - -void EmuShared::Save() -{ - m_XBController.Save("Software\\Cxbx-Reloaded\\XBController"); - m_XBVideo.Save("Software\\Cxbx-Reloaded\\XBVideo"); - m_XBAudio.Save("Software\\Cxbx-Reloaded\\XBAudio"); } diff --git a/src/CxbxKrnl/EmuShared.h b/src/common/win32/EmuShared.h similarity index 51% rename from src/CxbxKrnl/EmuShared.h rename to src/common/win32/EmuShared.h index 95a3f29b1..130e48e44 100644 --- a/src/CxbxKrnl/EmuShared.h +++ b/src/common/win32/EmuShared.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuShared.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,25 +25,20 @@ #ifndef EMUSHARED_H #define EMUSHARED_H -#include "Cxbx.h" -#include "Common/Win32/XBController.h" -#include "Common/Win32/XBVideo.h" -#include "Common/Win32/XBAudio.h" +#include "Cxbx.h" +#include "common\Settings.hpp" +#include "Mutex.h" +#include "common\IPCHybrid.hpp" +#include "common\input\Button.h" #include -enum { +typedef enum _XBOX_LED_COLOUR: unsigned char { XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_GREEN, XBOX_LED_COLOUR_RED, XBOX_LED_COLOUR_ORANGE, -}; - -enum { - LLE_APU = 1 << 0, - LLE_GPU = 1 << 1, - LLE_JIT = 1 << 2, -}; +} XBOX_LED_COLOUR; // Kernel boot flags enum { @@ -75,10 +61,7 @@ class EmuShared : public Mutex // ****************************************************************** // * Each process needs to call this to initialize shared memory // ****************************************************************** - static void Init(); - - void Load(); - void Save(); + static void Init(DWORD guiProcessID); // ****************************************************************** // * Each process needs to call this to cleanup shared memory @@ -89,114 +72,143 @@ class EmuShared : public Mutex // * Check if shared memory is used on launch // ****************************************************************** void GetIsFirstLaunch(bool *isFirstLaunch) { Lock(); *isFirstLaunch = m_bFirstLaunch; Unlock(); } - void SetIsFirstLaunch(bool isFirstLaunch) { Lock(); m_bFirstLaunch = isFirstLaunch; Unlock(); } + void SetIsFirstLaunch(const bool isFirstLaunch) { Lock(); m_bFirstLaunch = isFirstLaunch; Unlock(); } // ****************************************************************** // * Check if parent process is emulating title // ****************************************************************** - void GetIsEmulating(bool *isEmulating) { Lock(); *isEmulating = m_bEmulating; Unlock(); } - void SetIsEmulating(bool isEmulating) { Lock(); m_bEmulating = isEmulating; Unlock(); } + void GetIsEmulating(bool *isEmulating) { Lock(); *isEmulating = m_bEmulating_status; Unlock(); } + void SetIsEmulating(const bool isEmulating) { Lock(); m_bEmulating_status = isEmulating; Unlock(); } // ****************************************************************** // * Each child process need to wait until parent process is ready // ****************************************************************** - void GetIsReady(bool *isReady) { Lock(); *isReady = m_bReady; Unlock(); } - void SetIsReady(bool isReady) { Lock(); m_bReady = isReady; Unlock(); } + void GetIsReady(bool *isReady) { Lock(); *isReady = m_bReady_status; Unlock(); } + void SetIsReady(const bool isReady) { Lock(); m_bReady_status = isReady; Unlock(); } // ****************************************************************** // * Check if previous kernel mode process is running. // ****************************************************************** void GetKrnlProcID(unsigned int *krnlProcID) { Lock(); *krnlProcID = m_dwKrnlProcID; Unlock(); } - void SetKrnlProcID(unsigned int krnlProcID) { Lock(); m_dwKrnlProcID = krnlProcID; Unlock(); } + void SetKrnlProcID(const unsigned int krnlProcID) { Lock(); m_dwKrnlProcID = krnlProcID; Unlock(); } + + // ****************************************************************** + // * Xbox Core Accessors + // ****************************************************************** + void GetCoreSettings( Settings::s_core *emulate) { Lock(); *emulate = m_core; Unlock(); } + void SetCoreSettings(const Settings::s_core *emulate) { Lock(); m_core = *emulate; Unlock(); } // ****************************************************************** // * Xbox Video Accessors // ****************************************************************** - void GetXBVideo( XBVideo *video) { Lock(); *video = XBVideo(m_XBVideo); Unlock(); } - void SetXBVideo(const XBVideo *video) { Lock(); m_XBVideo = XBVideo(*video); Unlock(); } + void GetVideoSettings( Settings::s_video *video) { Lock(); *video = m_video; Unlock(); } + void SetVideoSettings(const Settings::s_video *video) { Lock(); m_video = *video; Unlock(); } // ****************************************************************** // * Xbox Audio Accessors // ****************************************************************** - void GetXBAudio( XBAudio *audio) { Lock(); *audio = XBAudio(m_XBAudio); Unlock(); } - void SetXBAudio(const XBAudio *audio) { Lock(); m_XBAudio = XBAudio(*audio); Unlock(); } + void GetAudioSettings( Settings::s_audio *audio) { Lock(); *audio = m_audio; Unlock(); } + void SetAudioSettings(const Settings::s_audio *audio) { Lock(); m_audio = *audio; Unlock(); } + + // ****************************************************************** + // * Xbox Network Accessors + // ****************************************************************** + void GetNetworkSettings(Settings::s_network *network) { Lock(); *network = m_network; Unlock(); } + void SetNetworkSettings(const Settings::s_network *network) { Lock(); m_network = *network; Unlock(); } - // ****************************************************************** - // * Xbox Controller Accessors - // ****************************************************************** - void GetXBController( XBController *ctrl) { Lock(); *ctrl = XBController(m_XBController); Unlock(); } - void SetXBController(const XBController *ctrl) { Lock(); m_XBController = XBController(*ctrl); Unlock(); } - - // ****************************************************************** - // * Xbe Path Accessors - // ****************************************************************** - void GetXbePath( char *path) { Lock(); strcpy(path, m_XbePath); Unlock(); } - void SetXbePath(const char *path) { Lock(); strcpy(m_XbePath, path); Unlock(); } + // ****************************************************************** + // * Input config Accessors + // ****************************************************************** + void GetInputDevTypeSettings(int* type, int port) { Lock(); *type = m_DeviceType[port]; Unlock(); } + void SetInputDevTypeSettings(const int* type, int port) { Lock(); m_DeviceType[port] = *type; Unlock(); } + void GetInputDevNameSettings(char* name, int port) { Lock(); strncpy(name, m_DeviceName[port], 50); Unlock(); } + void SetInputDevNameSettings(const char* name, int port) { Lock(); strncpy(m_DeviceName[port], name, 50); Unlock(); } + void GetInputBindingsSettings(char button_str[][30], int max_num_buttons, int port) + { + assert(max_num_buttons <= XBOX_CTRL_NUM_BUTTONS); + Lock(); + for (int i = 0; i < max_num_buttons; i++) { + strncpy(button_str[i], m_DeviceControlNames[port][i], 30); + } + Unlock(); + } + void SetInputBindingsSettings(const char button_str[][30], int max_num_buttons, int port) + { + assert(max_num_buttons <= XBOX_CTRL_NUM_BUTTONS); + Lock(); + for (int i = 0; i < max_num_buttons; i++) { + strncpy(m_DeviceControlNames[port][i], button_str[i], 30); + } + Unlock(); + } // ****************************************************************** // * LLE Flags Accessors // ****************************************************************** - void GetFlagsLLE( int *flags) { Lock(); *flags = m_FlagsLLE; Unlock(); } - void SetFlagsLLE(const int *flags) { Lock(); m_FlagsLLE = *flags; Unlock(); } + void GetFlagsLLE(unsigned int *flags) { Lock(); *flags = m_core.FlagsLLE; Unlock(); } + void SetFlagsLLE(const unsigned int *flags) { Lock(); m_core.FlagsLLE = *flags; Unlock(); } // ****************************************************************** // * Boot flag Accessors // ****************************************************************** - void GetBootFlags(int *value) { Lock(); *value = m_BootFlags; Unlock(); } - void SetBootFlags(int *value) { Lock(); m_BootFlags = *value; Unlock(); } + void GetBootFlags(int *value) { Lock(); *value = m_BootFlags_status; Unlock(); } + void SetBootFlags(const int *value) { Lock(); m_BootFlags_status = *value; Unlock(); } // ****************************************************************** // * Hack Flag Accessors - // ****************************************************************** - void GetDisablePixelShaders(int* value) { Lock(); *value = m_DisablePixelShaders; Unlock(); } - void SetDisablePixelShaders(int* value) { Lock(); m_DisablePixelShaders = *value; Unlock(); } - void GetUncapFramerate(int* value) { Lock(); *value = m_UncapFramerate; Unlock(); } - void SetUncapFramerate(int* value) { Lock(); m_UncapFramerate = *value; Unlock(); } - void GetUseAllCores(int* value) { Lock(); *value = m_UseAllCores; Unlock(); } - void SetUseAllCores(int* value) { Lock(); m_UseAllCores = *value; Unlock(); } - void GetSkipRdtscPatching(int* value) { Lock(); *value = m_SkipRdtscPatching; Unlock(); } - void SetSkipRdtscPatching(int* value) { Lock(); m_SkipRdtscPatching = *value; Unlock(); } - void GetScaleViewport(int* value) { Lock(); *value = m_ScaleViewport; Unlock(); } - void SetScaleViewport(int* value) { Lock(); m_ScaleViewport = *value; Unlock(); } - void GetDirectHostBackBufferAccess(int* value) { Lock(); *value = m_DirectHostBackBufferAccess; Unlock(); } - void SetDirectHostBackBufferAccess(int* value) { Lock(); m_DirectHostBackBufferAccess = *value; Unlock(); } + // ****************************************************************** + void GetHackSettings(Settings::s_hack *hacks) { Lock(); *hacks = m_hacks; Unlock(); } + void SetHackSettings(Settings::s_hack *hacks) { Lock(); m_hacks = *hacks; Unlock(); } - // ****************************************************************** - // * MSpF/Benchmark values Accessors - // ****************************************************************** - void GetCurrentMSpF(float *value) { Lock(); *value = m_MSpF; Unlock(); } - void SetCurrentMSpF(float *value) { Lock(); m_MSpF = *value; Unlock(); } - - // ****************************************************************** - // * FPS/Benchmark values Accessors - // ****************************************************************** - void GetCurrentFPS(float *value) { Lock(); *value = m_FPS; Unlock(); } - void SetCurrentFPS(float *value) { Lock(); m_FPS = *value; Unlock(); } + void GetDisablePixelShaders(int* value) { Lock(); *value = m_hacks.DisablePixelShaders; Unlock(); } + void SetDisablePixelShaders(const int* value) { Lock(); m_hacks.DisablePixelShaders = *value; Unlock(); } + void GetUseAllCores(int* value) { Lock(); *value = m_hacks.UseAllCores; Unlock(); } + void SetUseAllCores(const int* value) { Lock(); m_hacks.UseAllCores = *value; Unlock(); } + void GetSkipRdtscPatching(int* value) { Lock(); *value = m_hacks.SkipRdtscPatching; Unlock(); } + void SetSkipRdtscPatching(const int* value) { Lock(); m_hacks.SkipRdtscPatching = *value; Unlock(); } + + // ****************************************************************** + // * FPS/Benchmark values Accessors + // ****************************************************************** + void GetCurrentFPS(float *value) { Lock(); *value = m_FPS_status; Unlock(); } + void SetCurrentFPS(const float *value) { Lock(); m_FPS_status = *value; Unlock(); } + + // ****************************************************************** + // * FPS/Benchmark values Accessors + // ****************************************************************** + void GetIsKrnlLogEnabled(bool *value) { Lock(); *value = m_Krnl_Log_enabled; Unlock(); } + void SetIsKrnlLogEnabled(const bool value) { Lock(); m_Krnl_Log_enabled = value; Unlock(); } // ****************************************************************** // * Debugging flag Accessors // ****************************************************************** void GetDebuggingFlag(bool *value) { Lock(); *value = m_bDebugging; Unlock(); } - void SetDebuggingFlag(bool *value) { Lock(); m_bDebugging = *value; Unlock(); } - + void SetDebuggingFlag(const bool *value) { Lock(); m_bDebugging = *value; Unlock(); } + // ****************************************************************** - // * Xbox LED values Accessors + // * Log Level value Accessors // ****************************************************************** - void GetLedSequence(int *value) + void GetLogLv(int *value) { Lock(); *value = m_core.LogLevel; Unlock(); } + void SetLogLv(int *value) { Lock(); m_core.LogLevel = *value; Unlock(); } + + // ****************************************************************** + // * Log modules value Accessors + // ****************************************************************** + void GetLogModules(unsigned int *value) { Lock(); - for (int i = 0; i < 4; ++i) + for (int i = 0; i < NUM_INTEGERS_LOG; ++i) { - value[i] = m_LedSequence[i]; + value[i] = m_core.LoggedModules[i]; } Unlock(); } - void SetLedSequence(int *value) + void SetLogModules(unsigned int *value) { Lock(); - for (int i = 0; i < 4; ++i) + for (int i = 0; i < NUM_INTEGERS_LOG; ++i) { - m_LedSequence[i] = value[i]; + m_core.LoggedModules[i] = value[i]; } Unlock(); } @@ -204,8 +216,8 @@ class EmuShared : public Mutex // ****************************************************************** // * File storage location // ****************************************************************** - void GetStorageLocation(char *path) { Lock(); strcpy(path, m_StorageLocation); Unlock(); } - void SetStorageLocation(char *path) { Lock(); strcpy(m_StorageLocation, path); Unlock(); } + void GetStorageLocation(char *path) { Lock(); strncpy(path, m_core.szStorageLocation, MAX_PATH); Unlock(); } + void SetStorageLocation(const char *path) { Lock(); strncpy(m_core.szStorageLocation, path, MAX_PATH); Unlock(); } // ****************************************************************** // * Reset specific variables to default for kernel mode. @@ -213,9 +225,8 @@ class EmuShared : public Mutex void ResetKrnl() { Lock(); - m_BootFlags = 0; - m_MSpF = 0.0f; - m_FPS = 0.0f; + m_BootFlags_status = 0; + m_FPS_status = 0.0f; Unlock(); } @@ -224,8 +235,9 @@ class EmuShared : public Mutex // ****************************************************************** void Reset() { - Lock(); + Lock(); ResetKrnl(); + m_bEmulating_status = 0; m_dwKrnlProcID = 0; Unlock(); } @@ -240,32 +252,32 @@ class EmuShared : public Mutex // ****************************************************************** // * Shared configuration // ****************************************************************** - XBController m_XBController; - XBVideo m_XBVideo; - XBAudio m_XBAudio; - char m_XbePath[MAX_PATH]; - int m_BootFlags; - int m_FlagsLLE; - int m_Reserved1; - int m_DisablePixelShaders; - int m_UncapFramerate; - int m_UseAllCores; - int m_SkipRdtscPatching; - float m_MSpF; - float m_FPS; - bool m_bReserved1; + int m_BootFlags_status; + unsigned int m_Reserved5; + float m_Reserved6; + float m_FPS_status; // NOTE: If move into ipc_send_gui_update will spam GUI's message system (one message per frame) + bool m_Krnl_Log_enabled; // Is require in order to preserve previous set for support multi-xbe. bool m_bDebugging; - bool m_bReady; - bool m_bEmulating; - int m_LedSequence[4]; - int m_ScaleViewport; - int m_DirectHostBackBufferAccess; - char m_StorageLocation[MAX_PATH]; + bool m_bReady_status; + bool m_bEmulating_status; + int m_Reserved7[4]; bool m_bFirstLaunch; bool m_bReserved2; bool m_bReserved3; bool m_bReserved4; - unsigned int m_dwKrnlProcID; // Only used for kernel mode level. + unsigned int m_dwKrnlProcID; // Only used for kernel mode level. + int m_DeviceType[4]; + char m_DeviceControlNames[4][XBOX_CTRL_NUM_BUTTONS][30]; // macro should be num of buttons of dev with highest num buttons + char m_DeviceName[4][50]; + int m_Reserved99[28]; // Reserve space + + // Settings class in memory should not be tampered by third-party. + // Third-party program should only be allow to edit settings.ini file. + Settings::s_core m_core; + Settings::s_video m_video; + Settings::s_audio m_audio; + Settings::s_network m_network; + Settings::s_hack m_hacks; }; // ****************************************************************** diff --git a/src/common/win32/IPCWindows.cpp b/src/common/win32/IPCWindows.cpp new file mode 100644 index 000000000..1f491b25d --- /dev/null +++ b/src/common/win32/IPCWindows.cpp @@ -0,0 +1,107 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** + +//#define LOG_PREFIX CXBXR_MODULE::? + +#include + +#include "Cxbx.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "gui\ResCxbx.h" + +#include "common\IPCHybrid.hpp" +#include "EmuShared.h" +#include "common\Settings.hpp" +#include "Logging.h" + + +void ipc_send_gui_update(IPC_UPDATE_GUI command, const unsigned int value) +{ + // Don't send if kernel process didn't receive hwnd from GUI process. + if (CxbxKrnl_hEmuParent == nullptr) { + return; + } + + UINT cmdParam; + // Bind requested command before send to GUI process + switch (command) { + case IPC_UPDATE_GUI::LLE_FLAGS: + cmdParam = ID_GUI_STATUS_LLE_FLAGS; + break; + + case IPC_UPDATE_GUI::XBOX_LED_COLOUR: + cmdParam = ID_GUI_STATUS_XBOX_LED_COLOUR; + break; + + case IPC_UPDATE_GUI::LOG_ENABLED: + cmdParam = ID_GUI_STATUS_LOG_ENABLED; + break; + + case IPC_UPDATE_GUI::KRNL_IS_READY: + cmdParam = ID_GUI_STATUS_KRNL_IS_READY; + break; + + default: + cmdParam = 0; + break; + } + + // Verify command parameter is valid + if (cmdParam != 0) { + SendMessage(CxbxKrnl_hEmuParent, WM_PARENTNOTIFY, MAKEWPARAM(WM_COMMAND, cmdParam), value); + } +} + +void ipc_send_kernel_update(IPC_UPDATE_KERNEL command, const unsigned int value, const unsigned int hwnd) +{ + // Don't send if GUI process didn't create kernel process. + if (hwnd == NULL) { + return; + } + + UINT cmdParam; + // Bind requested command before send to kernel process + switch (command) { + case IPC_UPDATE_KERNEL::CONFIG_LOGGING_SYNC: + cmdParam = ID_SYNC_CONFIG_LOGGING; + break; + + case IPC_UPDATE_KERNEL::CONFIG_INPUT_SYNC: + cmdParam = ID_SYNC_CONFIG_INPUT; + break; + + default: + cmdParam = 0; + break; + } + + // Verify command parameter is valid + if (cmdParam != 0) { + SendMessage(reinterpret_cast(hwnd), WM_COMMAND, MAKEWPARAM(cmdParam, 0), value); + } +} + diff --git a/src/Common/Win32/InlineFunc.cpp b/src/common/win32/InlineFunc.cpp similarity index 87% rename from src/Common/Win32/InlineFunc.cpp rename to src/common/win32/InlineFunc.cpp index 54f4add28..bcbaf9885 100644 --- a/src/Common/Win32/InlineFunc.cpp +++ b/src/common/win32/InlineFunc.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Win32->InlineFunc.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -36,7 +27,7 @@ #if defined(_WIN32) || defined(WIN32) -#include "..\..\CxbxKrnl\CxbxKrnl.h" +#include "core\kernel\init\CxbxKrnl.h" // Source: https://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights bool CxbxIsElevated() { diff --git a/src/Common/Win32/Mutex.cpp b/src/common/win32/Mutex.cpp similarity index 89% rename from src/Common/Win32/Mutex.cpp rename to src/common/win32/Mutex.cpp index 5ebcbefea..0d3f20b55 100644 --- a/src/Common/Win32/Mutex.cpp +++ b/src/common/win32/Mutex.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Mutex.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -56,7 +47,7 @@ void Mutex::Lock() while(true) { // Grab the lock, letting us look at the variables -#if (_MSC_VER < 1300) // We are not using VC++.NET +#if defined(_MSC_VER) && (_MSC_VER < 1300) // We are not using VC++.NET while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0)) #else while(InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0)) @@ -107,7 +98,7 @@ void Mutex::Lock() void Mutex::Unlock() { // Grab the lock, letting us look at the variables -#if (_MSC_VER < 1300) // We are not using VC++.NET +#if defined(_MSC_VER) && (_MSC_VER < 1300) // We are not using VC++.NET while(InterlockedCompareExchange((LPVOID*)&m_MutexLock, (LPVOID)1, (LPVOID)0)) #else while (InterlockedCompareExchange((LPLONG)&m_MutexLock, (LONG)1, (LONG)0)) diff --git a/src/Common/Win32/Mutex.h b/src/common/win32/Mutex.h similarity index 80% rename from src/Common/Win32/Mutex.h rename to src/common/win32/Mutex.h index 736e17770..032058fdf 100644 --- a/src/Common/Win32/Mutex.h +++ b/src/common/win32/Mutex.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Mutex.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Common/Win32/Threads.cpp b/src/common/win32/Threads.cpp similarity index 81% rename from src/Common/Win32/Threads.cpp rename to src/common/win32/Threads.cpp index 393787cbb..b74f95cfb 100644 --- a/src/Common/Win32/Threads.cpp +++ b/src/common/win32/Threads.cpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Threads.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -50,6 +41,7 @@ typedef struct tagTHREADNAME_INFO } THREADNAME_INFO; #pragma pack(pop) +#ifdef _MSC_VER void SetThreadName(DWORD dwThreadID, const char* szThreadName) { if (!IsDebuggerPresent()) @@ -60,15 +52,22 @@ void SetThreadName(DWORD dwThreadID, const char* szThreadName) info.szName = szThreadName; info.dwThreadID = dwThreadID; info.dwFlags = 0; -#pragma warning(push) -#pragma warning(disable: 6320 6322) __try { RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); } +#pragma warning(suppress : 6320) // silence /analyze: Exception-filter expression is the constant + // EXCEPTION_EXECUTE_HANDLER. This might mask exceptions that were + // not intended to be handled +#pragma warning(suppress : 6322) // silence /analyze: Empty _except block __except (EXCEPTION_EXECUTE_HANDLER) { } -#pragma warning(pop) } +#else +void SetThreadName(DWORD dwThreadID, const char* szThreadName) +{ + // TODO: Use SetThreadDescription +} +#endif void SetCurrentThreadName(const char* szThreadName) { diff --git a/src/Common/Win32/Threads.h b/src/common/win32/Threads.h similarity index 75% rename from src/Common/Win32/Threads.h rename to src/common/win32/Threads.h index 6b4314d8c..f7402d1d2 100644 --- a/src/Common/Win32/Threads.h +++ b/src/common/win32/Threads.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Threads.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Cxbx/CxbxXbdm.cpp b/src/common/xbdm/CxbxXbdm.cpp similarity index 53% rename from src/Cxbx/CxbxXbdm.cpp rename to src/common/xbdm/CxbxXbdm.cpp index c25878876..79a2be0ac 100644 --- a/src/Cxbx/CxbxXbdm.cpp +++ b/src/common/xbdm/CxbxXbdm.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnl.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,10 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _CXBXKRNL_INTERNAL -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "XBDM" +#define LOG_PREFIX CXBXR_MODULE::XBDM #include #include @@ -131,7 +120,7 @@ namespace xbdm { void DmSendNotificationString(LPCSTR sz) { // Just send this string to Cxbx's debug output : - DbgPrintf("%s\n", sz); + EmuLog(LOG_LEVEL::DEBUG, "%s", sz); } // 0x0025 (37) @@ -208,83 +197,83 @@ namespace xbdm { void DmRegisterCommandProcessorEx() { LOG_FUNC(); LOG_UNIMPLEMENTED(); } } -uint32 Cxbx_LibXbdmThunkTable[1 + 72] = +uint32_t Cxbx_LibXbdmThunkTable[1 + 72] = { #define PANIC(numb) numb #define FUNC(f) f #define VARIABLE(v) v - (uint32)PANIC(0x0000), // 0x0000 (0) NULL - (uint32)FUNC(&xbdm::DmAllocatePool), // 0x0001 (1) - (uint32)FUNC(&xbdm::DmAllocatePoolWithTag), // 0x0002 (2) - (uint32)FUNC(&xbdm::DmCloseCounters), // 0x0003 (3) - (uint32)FUNC(&xbdm::DmCloseLoadedModules), // 0x0004 (4) - (uint32)FUNC(&xbdm::DmCloseModuleSections), // 0x0005 (5) - (uint32)FUNC(&xbdm::DmCloseNotificationSession), // 0x0006 (6) - (uint32)FUNC(&xbdm::DmClosePerformanceCounter), // 0x0007 (7) - (uint32)FUNC(&xbdm::DmContinueThread), // 0x0008 (8) - (uint32)FUNC(&xbdm::DmFreePool), // 0x0009 (9) - (uint32)FUNC(&xbdm::DmGetMemory), // 0x000A (10) - (uint32)FUNC(&xbdm::DmGetModuleLongName), // 0x000B (11) - (uint32)FUNC(&xbdm::DmGetProcAddress), // 0x000C (12) - (uint32)FUNC(&xbdm::DmGetThreadContext), // 0x000D (13) - (uint32)FUNC(&xbdm::DmGetThreadInfo), // 0x000E (14) - (uint32)FUNC(&xbdm::DmGetThreadList), // 0x000F (15) - (uint32)FUNC(&xbdm::DmGetXbeInfo), // 0x0010 (16) - (uint32)FUNC(&xbdm::DmGetXboxName), // 0x0011 (17) - (uint32)FUNC(&xbdm::DmGetXtlData), // 0x0012 (18) - (uint32)FUNC(&xbdm::DmGo), // 0x0013 (19) - (uint32)FUNC(&xbdm::DmHaltThread), // 0x0014 (20) - (uint32)FUNC(&xbdm::DmIsDebuggerPresent), // 0x0015 (21) - (uint32)FUNC(&xbdm::DmIsThreadStopped), // 0x0016 (22) - (uint32)FUNC(&xbdm::DmLoadExtension), // 0x0017 (23) - (uint32)FUNC(&xbdm::DmNotify), // 0x0018 (24) - (uint32)FUNC(&xbdm::DmOpenNotificationSession), // 0x0019 (25) - (uint32)FUNC(&xbdm::DmOpenPerformanceCounter), // 0x001A (26) - (uint32)FUNC(&xbdm::DmQueryPerformanceCounterHandle), // 0x001B (27) - (uint32)FUNC(&xbdm::DmReboot), // 0x001C (28) - (uint32)PANIC(0x001D), // 0x001D (29) - (uint32)FUNC(&xbdm::DmRegisterCommandProcessor), // 0x001E (30) - (uint32)PANIC(0x001F), // 0x001F (31) - (uint32)FUNC(&xbdm::DmRegisterNotificationProcessor), // 0x0020 (32) - (uint32)FUNC(&xbdm::DmRegisterPerformanceCounter), // 0x0021 (33) - (uint32)FUNC(&xbdm::DmRemoveBreakpoint), // 0x0022 (34) - (uint32)FUNC(&xbdm::DmResumeThread), // 0x0023 (35) - (uint32)FUNC(&xbdm::DmSendNotificationString), // 0x0024 (36) - (uint32)FUNC(&xbdm::DmSetBreakpoint), // 0x0025 (37) - (uint32)FUNC(&xbdm::DmSetDataBreakpoint), // 0x0026 (38) - (uint32)FUNC(&xbdm::DmSetInitialBreakpoint), // 0x0027 (39) - (uint32)FUNC(&xbdm::DmSetMemory), // 0x0028 (40) - (uint32)FUNC(&xbdm::DmSetThreadContext), // 0x0029 (41) - (uint32)FUNC(&xbdm::DmSetTitle), // 0x002A (42) - (uint32)FUNC(&xbdm::DmSetXboxName), // 0x002B (43) - (uint32)FUNC(&xbdm::DmStartProfile), // 0x002C (44) - (uint32)FUNC(&xbdm::DmStop), // 0x002D (45) - (uint32)FUNC(&xbdm::DmStopOn), // 0x002E (46) - (uint32)FUNC(&xbdm::DmStopProfile), // 0x002F (47) - (uint32)FUNC(&xbdm::DmSuspendThread), // 0x0030 (48) - (uint32)FUNC(&xbdm::DmThreadUserData), // 0x0031 (49) - (uint32)FUNC(&xbdm::DmUnloadExtension), // 0x0032 (50) - (uint32)FUNC(&xbdm::DmWalkLoadedModules), // 0x0033 (51) - (uint32)FUNC(&xbdm::DmWalkModuleSections), // 0x0034 (52) - (uint32)FUNC(&xbdm::DmWalkPerformanceCounters), // 0x0035 (53) - (uint32)FUNC(&xbdm::PsGetCurrentThreadId), // 0x0036 (54) - (uint32)FUNC(&xbdm::DmEnableGPUCounter), // 0x0037 (55) - (uint32)FUNC(&xbdm::DmIsBreakpoint), // 0x0038 (56) - (uint32)FUNC(&xbdm::DmCloseUserList), // 0x0039 (57) - (uint32)FUNC(&xbdm::DmSetUserAccess), // 0x003A (58) - (uint32)FUNC(&xbdm::DmGetUserAccess), // 0x003B (59) - (uint32)FUNC(&xbdm::DmWalkUserList), // 0x003C (60) - (uint32)FUNC(&xbdm::DmAddUser), // 0x003D (61) - (uint32)FUNC(&xbdm::DmEnableSecurity), // 0x003E (62) - (uint32)FUNC(&xbdm::DmIsSecurityEnabled), // 0x003F (63) - (uint32)FUNC(&xbdm::DmRemoveUser), // 0x0040 (64) - (uint32)FUNC(&xbdm::_CAP_Start_Profiling), // 0x0041 (65) - (uint32)FUNC(&xbdm::_CAP_End_Profiling), // 0x0042 (66) - (uint32)FUNC(&xbdm::DmProfileControl), // 0x0043 (67) - (uint32)FUNC(&xbdm::_penter), // 0x0044 (68) - (uint32)FUNC(&xbdm::_pexit), // 0x0045 (69) - (uint32)FUNC(&xbdm::_CAP_Enter_Function), // 0x0046 (70) - (uint32)FUNC(&xbdm::_CAP_Exit_Function), // 0x0047 (71) - (uint32)FUNC(&xbdm::DmRegisterCommandProcessorEx), // 0x0048 (72) + (uint32_t)PANIC(0x0000), // 0x0000 (0) NULL + (uint32_t)FUNC(&xbdm::DmAllocatePool), // 0x0001 (1) + (uint32_t)FUNC(&xbdm::DmAllocatePoolWithTag), // 0x0002 (2) + (uint32_t)FUNC(&xbdm::DmCloseCounters), // 0x0003 (3) + (uint32_t)FUNC(&xbdm::DmCloseLoadedModules), // 0x0004 (4) + (uint32_t)FUNC(&xbdm::DmCloseModuleSections), // 0x0005 (5) + (uint32_t)FUNC(&xbdm::DmCloseNotificationSession), // 0x0006 (6) + (uint32_t)FUNC(&xbdm::DmClosePerformanceCounter), // 0x0007 (7) + (uint32_t)FUNC(&xbdm::DmContinueThread), // 0x0008 (8) + (uint32_t)FUNC(&xbdm::DmFreePool), // 0x0009 (9) + (uint32_t)FUNC(&xbdm::DmGetMemory), // 0x000A (10) + (uint32_t)FUNC(&xbdm::DmGetModuleLongName), // 0x000B (11) + (uint32_t)FUNC(&xbdm::DmGetProcAddress), // 0x000C (12) + (uint32_t)FUNC(&xbdm::DmGetThreadContext), // 0x000D (13) + (uint32_t)FUNC(&xbdm::DmGetThreadInfo), // 0x000E (14) + (uint32_t)FUNC(&xbdm::DmGetThreadList), // 0x000F (15) + (uint32_t)FUNC(&xbdm::DmGetXbeInfo), // 0x0010 (16) + (uint32_t)FUNC(&xbdm::DmGetXboxName), // 0x0011 (17) + (uint32_t)FUNC(&xbdm::DmGetXtlData), // 0x0012 (18) + (uint32_t)FUNC(&xbdm::DmGo), // 0x0013 (19) + (uint32_t)FUNC(&xbdm::DmHaltThread), // 0x0014 (20) + (uint32_t)FUNC(&xbdm::DmIsDebuggerPresent), // 0x0015 (21) + (uint32_t)FUNC(&xbdm::DmIsThreadStopped), // 0x0016 (22) + (uint32_t)FUNC(&xbdm::DmLoadExtension), // 0x0017 (23) + (uint32_t)FUNC(&xbdm::DmNotify), // 0x0018 (24) + (uint32_t)FUNC(&xbdm::DmOpenNotificationSession), // 0x0019 (25) + (uint32_t)FUNC(&xbdm::DmOpenPerformanceCounter), // 0x001A (26) + (uint32_t)FUNC(&xbdm::DmQueryPerformanceCounterHandle), // 0x001B (27) + (uint32_t)FUNC(&xbdm::DmReboot), // 0x001C (28) + (uint32_t)PANIC(0x001D), // 0x001D (29) + (uint32_t)FUNC(&xbdm::DmRegisterCommandProcessor), // 0x001E (30) + (uint32_t)PANIC(0x001F), // 0x001F (31) + (uint32_t)FUNC(&xbdm::DmRegisterNotificationProcessor), // 0x0020 (32) + (uint32_t)FUNC(&xbdm::DmRegisterPerformanceCounter), // 0x0021 (33) + (uint32_t)FUNC(&xbdm::DmRemoveBreakpoint), // 0x0022 (34) + (uint32_t)FUNC(&xbdm::DmResumeThread), // 0x0023 (35) + (uint32_t)FUNC(&xbdm::DmSendNotificationString), // 0x0024 (36) + (uint32_t)FUNC(&xbdm::DmSetBreakpoint), // 0x0025 (37) + (uint32_t)FUNC(&xbdm::DmSetDataBreakpoint), // 0x0026 (38) + (uint32_t)FUNC(&xbdm::DmSetInitialBreakpoint), // 0x0027 (39) + (uint32_t)FUNC(&xbdm::DmSetMemory), // 0x0028 (40) + (uint32_t)FUNC(&xbdm::DmSetThreadContext), // 0x0029 (41) + (uint32_t)FUNC(&xbdm::DmSetTitle), // 0x002A (42) + (uint32_t)FUNC(&xbdm::DmSetXboxName), // 0x002B (43) + (uint32_t)FUNC(&xbdm::DmStartProfile), // 0x002C (44) + (uint32_t)FUNC(&xbdm::DmStop), // 0x002D (45) + (uint32_t)FUNC(&xbdm::DmStopOn), // 0x002E (46) + (uint32_t)FUNC(&xbdm::DmStopProfile), // 0x002F (47) + (uint32_t)FUNC(&xbdm::DmSuspendThread), // 0x0030 (48) + (uint32_t)FUNC(&xbdm::DmThreadUserData), // 0x0031 (49) + (uint32_t)FUNC(&xbdm::DmUnloadExtension), // 0x0032 (50) + (uint32_t)FUNC(&xbdm::DmWalkLoadedModules), // 0x0033 (51) + (uint32_t)FUNC(&xbdm::DmWalkModuleSections), // 0x0034 (52) + (uint32_t)FUNC(&xbdm::DmWalkPerformanceCounters), // 0x0035 (53) + (uint32_t)FUNC(&xbdm::PsGetCurrentThreadId), // 0x0036 (54) + (uint32_t)FUNC(&xbdm::DmEnableGPUCounter), // 0x0037 (55) + (uint32_t)FUNC(&xbdm::DmIsBreakpoint), // 0x0038 (56) + (uint32_t)FUNC(&xbdm::DmCloseUserList), // 0x0039 (57) + (uint32_t)FUNC(&xbdm::DmSetUserAccess), // 0x003A (58) + (uint32_t)FUNC(&xbdm::DmGetUserAccess), // 0x003B (59) + (uint32_t)FUNC(&xbdm::DmWalkUserList), // 0x003C (60) + (uint32_t)FUNC(&xbdm::DmAddUser), // 0x003D (61) + (uint32_t)FUNC(&xbdm::DmEnableSecurity), // 0x003E (62) + (uint32_t)FUNC(&xbdm::DmIsSecurityEnabled), // 0x003F (63) + (uint32_t)FUNC(&xbdm::DmRemoveUser), // 0x0040 (64) + (uint32_t)FUNC(&xbdm::_CAP_Start_Profiling), // 0x0041 (65) + (uint32_t)FUNC(&xbdm::_CAP_End_Profiling), // 0x0042 (66) + (uint32_t)FUNC(&xbdm::DmProfileControl), // 0x0043 (67) + (uint32_t)FUNC(&xbdm::_penter), // 0x0044 (68) + (uint32_t)FUNC(&xbdm::_pexit), // 0x0045 (69) + (uint32_t)FUNC(&xbdm::_CAP_Enter_Function), // 0x0046 (70) + (uint32_t)FUNC(&xbdm::_CAP_Exit_Function), // 0x0047 (71) + (uint32_t)FUNC(&xbdm::DmRegisterCommandProcessorEx), // 0x0048 (72) }; diff --git a/src/Cxbx/CxbxXbdm.h b/src/common/xbdm/CxbxXbdm.h similarity index 73% rename from src/Cxbx/CxbxXbdm.h rename to src/common/xbdm/CxbxXbdm.h index 9aa49c578..bf8ab44cd 100644 --- a/src/Cxbx/CxbxXbdm.h +++ b/src/common/xbdm/CxbxXbdm.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxXbdm.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,4 +25,4 @@ #pragma once /*! xbdm thunk table */ -extern uint32 Cxbx_LibXbdmThunkTable[1+72]; +extern uint32_t Cxbx_LibXbdmThunkTable[1+72]; diff --git a/src/Common/Xbe.cpp b/src/common/xbe/Xbe.cpp similarity index 72% rename from src/Common/Xbe.cpp rename to src/common/xbe/Xbe.cpp index f430b290a..d5c59c80e 100644 --- a/src/Common/Xbe.cpp +++ b/src/common/xbe/Xbe.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Xbe.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,6 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ // prevent name collisions namespace xboxkrnl @@ -41,17 +31,19 @@ namespace xboxkrnl #include }; -#include "Xbe.h" -#include "CxbxUtil.h" // For RoundUp -#include // filesystem related functions available on C++ 17 +#include "common\xbe\Xbe.h" +#include "common\util\CxbxUtil.h" // For RoundUp +#include // filesystem related functions available on C++ 17 #include // For ctime +#include #include "devices\LED.h" // For LED::Sequence -#include "CxbxKrnl/CxbxKrnl.h" // For CxbxKrnlPrintUEM -#include "CxbxKrnl/EmuShared.h" // Include this to avoid including EmuXapi.h and EmuD3D8.h -#include "CxbxKrnl\EmuSha.h" // For the SHA functions -#include "CxbxKrnl\EmuRsa.h" // For the RSA functions +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlPrintUEM +#include "common\crypto\EmuSha.h" // For the SHA functions +#include "common\crypto\EmuRsa.h" // For the RSA functions +#include "core\hle\XAPI\Xapi.h" // For LDT_FROM_DASHBOARD +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For CxbxInitWindow -namespace fs = std::experimental::filesystem; +namespace fs = std::filesystem; @@ -81,7 +73,7 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) // The dashboard could not be found on partition2. This is a fatal error on the Xbox so we display the UEM. The // error code is different if we have a launch data page - XTL::CxbxInitWindow(false); + CxbxInitWindow(false); ULONG FatalErrorCode = FATAL_ERROR_XBE_DASH_GENERIC; @@ -112,7 +104,7 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) strcpy(m_szPath, x_szFilename); char * c = strrchr(m_szPath, '\\'); - if (c != NULL) + if (c != nullptr) *(++c) = '\0'; } @@ -128,7 +120,7 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) goto cleanup; } - if(m_Header.dwMagic != *(uint32 *)"XBEH") + if(m_Header.dwMagic != *(uint32_t *)"XBEH") { SetFatalError("Invalid magic number in Xbe file"); goto cleanup; @@ -208,7 +200,7 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) m_SectionHeader = new SectionHeader[m_Header.dwSections]; - for(uint32 v=0;v> 4; - uint32 len = 1; + uint32_t len = 1; while(++v<100*17-1 && len < 1024 && color == x_Gray[v] >> 4) len++; @@ -639,7 +581,7 @@ void Xbe::ImportLogoBitmap(const uint08 x_Gray[100*17]) // check if there is room to save this, if not then throw an error { - uint08 *RLE = GetLogoBitmap(LogoSize); + uint8_t *RLE = GetLogoBitmap(LogoSize); if(RLE == 0) { @@ -672,22 +614,22 @@ void Xbe::ImportLogoBitmap(const uint08 x_Gray[100*17]) // * a toss up, but i've choosen a simple bit shift left. // * // ****************************************************************** -void Xbe::ExportLogoBitmap(uint08 x_Gray[100*17]) +void Xbe::ExportLogoBitmap(uint8_t x_Gray[100*17]) { memset(x_Gray, 0, 100*17); - uint32 dwLength = m_Header.dwSizeofLogoBitmap; + uint32_t dwLength = m_Header.dwSizeofLogoBitmap; - uint08 *RLE = GetAddr(m_Header.dwLogoBitmapAddr); + uint8_t *RLE = GetAddr(m_Header.dwLogoBitmapAddr); if(RLE == nullptr || HasError()) return; - uint32 o = 0; + uint32_t o = 0; - for(uint32 v=0;v= VirtAddr) && (x_dwVirtualAddress < (VirtAddr + VirtSize)) ) return &m_bzSection[v][x_dwVirtualAddress - VirtAddr]; @@ -745,10 +687,10 @@ uint08 *Xbe::GetAddr(uint32 x_dwVirtualAddress) } // return a modifiable pointer to logo bitmap data -uint08 *Xbe::GetLogoBitmap(uint32 x_dwSize) +uint8_t *Xbe::GetLogoBitmap(uint32_t x_dwSize) { - uint32 dwOffs = m_Header.dwLogoBitmapAddr - m_Header.dwBaseAddr; - uint32 dwLength = m_Header.dwSizeofLogoBitmap; + uint32_t dwOffs = m_Header.dwLogoBitmapAddr - m_Header.dwBaseAddr; + uint32_t dwLength = m_Header.dwSizeofLogoBitmap; if(dwOffs == 0 || dwLength == 0) return 0; @@ -770,10 +712,9 @@ uint08 *Xbe::GetLogoBitmap(uint32 x_dwSize) return 0; } - void *Xbe::FindSection(char *zsSectionName) { - for (uint32 v = 0; v < m_Header.dwSections; v++) { + for (uint32_t v = 0; v < m_Header.dwSections; v++) { if (strcmp(m_szSectionName[v], zsSectionName) == 0) { if (m_SectionHeader[v].dwVirtualAddr > 0 && m_SectionHeader[v].dwVirtualSize > 0) { return m_bzSection[v]; @@ -781,7 +722,22 @@ void *Xbe::FindSection(char *zsSectionName) } } - return NULL; + return nullptr; +} + +void* Xbe::FindSection(xboxkrnl::PXBEIMAGE_SECTION section) +{ + for (uint32_t v = 0; v < m_Header.dwSections; v++) { + if (m_SectionHeader[v].dwVirtualAddr > 0 && m_SectionHeader[v].dwVirtualSize > 0) { + if (m_SectionHeader[v].dwRawAddr == section->FileAddress && m_SectionHeader[v].dwVirtualAddr == (uint32_t)(section->VirtualAddress) + && m_SectionHeader[v].dwVirtualSize == section->VirtualSize) { + return m_bzSection[v]; + } + } + + } + + return nullptr; } void Xbe::PurgeBadChar(std::string& s, const std::string& illegalChars) @@ -801,7 +757,7 @@ const char *Xbe::GameRegionToString() "DEBUG", "NTSC (DEBUG)", "JAP (DEBUG)", "NTSC+JAP (DEBUG)", "PAL (DEBUG)", "PAL+NTSC (DEBUG)", "PAL+JAP (DEBUG)", "Region Free (DEBUG)" }; - const uint32 all_regions = XBEIMAGE_GAME_REGION_NA | + const uint32_t all_regions = XBEIMAGE_GAME_REGION_NA | XBEIMAGE_GAME_REGION_JAPAN | XBEIMAGE_GAME_REGION_RESTOFWORLD | XBEIMAGE_GAME_REGION_MANUFACTURING; @@ -810,7 +766,7 @@ const char *Xbe::GameRegionToString() return "REGION ERROR"; } - uint8 index = (m_Certificate.dwGameRegion & XBEIMAGE_GAME_REGION_MANUFACTURING) ? 0x8 : 0; + uint8_t index = (m_Certificate.dwGameRegion & XBEIMAGE_GAME_REGION_MANUFACTURING) ? 0x8 : 0; index |= (m_Certificate.dwGameRegion & 0x7); return Region_text[index]; } @@ -822,27 +778,31 @@ const wchar_t *Xbe::GetUnicodeFilenameAddr() bool Xbe::CheckXbeSignature() { - // Workaround for nxdk (and possibly oxdk?): xbe's built with nxdk have the digital signature set to all zeros, which will lead - // to a crash during its decryption in RSAdecrypt. Detect this condition and skip the check if true - { - UCHAR Dummy[256] = { 0 }; - if (memcmp(m_Header.pbDigitalSignature, Dummy, 256) == 0) { - return false; - } - } + init_tom_lib(); DWORD HeaderDigestSize = m_Header.dwSizeofHeaders - (sizeof(m_Header.dwMagic) + sizeof(m_Header.pbDigitalSignature)); UCHAR SHADigest[A_SHA_DIGEST_LEN]; unsigned char crypt_buffer[256]; - RSA_PUBLIC_KEY key; - memcpy(key.Default, (void*)xboxkrnl::XePublicKeyData, 284); - CalcSHA1Hash(SHADigest, m_SignatureHeader, HeaderDigestSize); - RSAdecrypt(m_Header.pbDigitalSignature, crypt_buffer, key); - if (!Verifyhash(SHADigest, crypt_buffer, key)) { - return false; // signature check failed + // Hash against all currently known public keys, if these pass, we can guarantee the Xbe is unmodified + std::array keys = { 0 }; + memcpy(keys[0].Default, (void*)xboxkrnl::XePublicKeyDataRetail, 284); + memcpy(keys[1].Default, (void*)xboxkrnl::XePublicKeyDataChihiroGame, 284); + memcpy(keys[2].Default, (void*)xboxkrnl::XePublicKeyDataChihiroBoot, 284); + // TODO: memcpy(keys[3].Default, (void*)xboxkrnl::XePublicKeyDataDebug, 284); + + for (unsigned int i = 0; i < keys.size(); i++) { + if (xbox_rsa_public(m_Header.pbDigitalSignature, crypt_buffer, keys[i])) { + if (verify_hash(SHADigest, crypt_buffer, keys[i])) { + // Load the successful key into XboxKrnl::XePublicKeyData for application use + memcpy(xboxkrnl::XePublicKeyData, keys[i].Default, 284); + return true; // success + } + } } - return true; // success + // Default to the Retail key if no key matched, just to make sure we don't init in an invalid state + memcpy(xboxkrnl::XePublicKeyData, xboxkrnl::XePublicKeyDataRetail, 284); + return false; // signature check failed } diff --git a/src/common/xbe/Xbe.h b/src/common/xbe/Xbe.h new file mode 100644 index 000000000..a4b59cedd --- /dev/null +++ b/src/common/xbe/Xbe.h @@ -0,0 +1,390 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XBE_H +#define XBE_H + +#include "common\Error.h" + +#include + + +//#include // For MAX_PATH +// The above leads to 55 compile errors, so until we've sorted out why that happens, declare MAX_PATH ourselves for now : +#define MAX_PATH 260 +#define XPR_IMAGE_WH 128 +#define XPR_IMAGE_DATA_SIZE (XPR_IMAGE_WH * XPR_IMAGE_WH) / 2 +#define XPR_IMAGE_HDR_SIZE 2048 + +namespace xboxkrnl +{ + typedef struct _XBE_SECTION XBEIMAGE_SECTION, *PXBEIMAGE_SECTION; +} + +// Xbe (Xbox Executable) file object +class Xbe : public Error +{ + public: + // construct via Xbe file + Xbe(const char *x_szFilename, bool bFromGUI); + + // deconstructor + ~Xbe(); + + // find an section by name + void *FindSection(char *zsSectionName); + + // Find a section by its definition + void* FindSection(xboxkrnl::PXBEIMAGE_SECTION section); + + // export to Xbe file + void Export(const char *x_szXbeFilename); + + // verify the integrity of the loaded xbe + bool CheckXbeSignature(); + + // import logo bitmap from raw monochrome data + void ImportLogoBitmap(const uint8_t x_Gray[100*17]); + + // export logo bitmap to raw monochrome data + void ExportLogoBitmap(uint8_t x_Gray[100*17]); + + // purge illegal characters in Windows filenames or other OS's + void PurgeBadChar(std::string& s, const std::string& illegalChars = "\\/:?\"<>|"); + + // Convert game region field to string + const char *GameRegionToString(); + + // Xbe header + #include "AlignPrefix1.h" + struct Header + { + uint32_t dwMagic; // 0x0000 - magic number [should be "XBEH"] + uint8_t pbDigitalSignature[256]; // 0x0004 - digital signature + uint32_t dwBaseAddr; // 0x0104 - base address + uint32_t dwSizeofHeaders; // 0x0108 - size of headers + uint32_t dwSizeofImage; // 0x010C - size of image + uint32_t dwSizeofImageHeader; // 0x0110 - size of image header + uint32_t dwTimeDate; // 0x0114 - timedate stamp + uint32_t dwCertificateAddr; // 0x0118 - certificate address + uint32_t dwSections; // 0x011C - number of sections + uint32_t dwSectionHeadersAddr; // 0x0120 - section headers address + + typedef struct + { + uint32_t bMountUtilityDrive : 1; // mount utility drive flag + uint32_t bFormatUtilityDrive : 1; // format utility drive flag + uint32_t bLimit64MB : 1; // limit development kit run time memory to 64mb flag + uint32_t bDontSetupHarddisk : 1; // don't setup hard disk flag + uint32_t Unused : 4; // unused (or unknown) + uint32_t Unused_b1 : 8; // unused (or unknown) + uint32_t Unused_b2 : 8; // unused (or unknown) + uint32_t Unused_b3 : 8; // unused (or unknown) + } InitFlags; + + union { // 0x0124 - initialization flags + InitFlags dwInitFlags; + uint32_t dwInitFlags_value; + }; + + uint32_t dwEntryAddr; // 0x0128 - entry point address + uint32_t dwTLSAddr; // 0x012C - thread local storage directory address + uint32_t dwPeStackCommit; // 0x0130 - size of stack commit + uint32_t dwPeHeapReserve; // 0x0134 - size of heap reserve + uint32_t dwPeHeapCommit; // 0x0138 - size of heap commit + uint32_t dwPeBaseAddr; // 0x013C - original base address + uint32_t dwPeSizeofImage; // 0x0140 - size of original image + uint32_t dwPeChecksum; // 0x0144 - original checksum + uint32_t dwPeTimeDate; // 0x0148 - original timedate stamp + uint32_t dwDebugPathnameAddr; // 0x014C - debug pathname address + uint32_t dwDebugFilenameAddr; // 0x0150 - debug filename address + uint32_t dwDebugUnicodeFilenameAddr; // 0x0154 - debug unicode filename address + uint32_t dwKernelImageThunkAddr; // 0x0158 - kernel image thunk address + uint32_t dwNonKernelImportDirAddr; // 0x015C - non kernel import directory address + uint32_t dwLibraryVersions; // 0x0160 - number of library versions + uint32_t dwLibraryVersionsAddr; // 0x0164 - library versions address + uint32_t dwKernelLibraryVersionAddr; // 0x0168 - kernel library version address + uint32_t dwXAPILibraryVersionAddr; // 0x016C - xapi library version address + uint32_t dwLogoBitmapAddr; // 0x0170 - logo bitmap address + uint32_t dwSizeofLogoBitmap; // 0x0174 - logo bitmap size + } + #include "AlignPosfix1.h" + m_Header; + + // Xbe header extra byte (used to preserve unknown data) + char *m_HeaderEx; + uint32_t m_ExSize; + + // Xbe certificate + #include "AlignPrefix1.h" + struct Certificate + { + uint32_t dwSize; // 0x0000 - size of certificate + uint32_t dwTimeDate; // 0x0004 - timedate stamp + uint32_t dwTitleId; // 0x0008 - title id + wchar_t wszTitleName[40]; // 0x000C - title name (unicode) + uint32_t dwAlternateTitleId[0x10]; // 0x005C - alternate title ids + uint32_t dwAllowedMedia; // 0x009C - allowed media types + uint32_t dwGameRegion; // 0x00A0 - game region + uint32_t dwGameRatings; // 0x00A4 - game ratings + uint32_t dwDiskNumber; // 0x00A8 - disk number + uint32_t dwVersion; // 0x00AC - version + uint8_t bzLanKey[16]; // 0x00B0 - lan key + uint8_t bzSignatureKey[16]; // 0x00C0 - signature key + // NOT ALL XBEs have these fields! + uint8_t bzTitleAlternateSignatureKey[16][16]; // 0x00D0 - alternate signature keys + uint32_t dwOriginalCertificateSize; // 0x01D0 - Original Certificate Size? + uint32_t dwOnlineService; // 0x01D4 - Online Service ID + uint32_t dwSecurityFlags; // 0x01D8 - Extra Security Flags + uint8_t bzCodeEncKey[16]; // 0x01DC - Code Encryption Key? + } + #include "AlignPosfix1.h" + m_Certificate; + + // Xbe section header + #include "AlignPrefix1.h" + struct SectionHeader + { + typedef struct + { + uint32_t bWritable : 1; // writable flag + uint32_t bPreload : 1; // preload flag + uint32_t bExecutable : 1; // executable flag + uint32_t bInsertedFile : 1; // inserted file flag + uint32_t bHeadPageRO : 1; // head page read only flag + uint32_t bTailPageRO : 1; // tail page read only flag + uint32_t Unused_a1 : 1; // unused (or unknown) + uint32_t Unused_a2 : 1; // unused (or unknown) + uint32_t Unused_b1 : 8; // unused (or unknown) + uint32_t Unused_b2 : 8; // unused (or unknown) + uint32_t Unused_b3 : 8; // unused (or unknown) + } _Flags; + + union { + _Flags dwFlags; + uint32_t dwFlags_value; + }; + + uint32_t dwVirtualAddr; // virtual address + uint32_t dwVirtualSize; // virtual size + uint32_t dwRawAddr; // file offset to raw data + uint32_t dwSizeofRaw; // size of raw data + uint32_t dwSectionNameAddr; // section name addr + uint32_t dwSectionRefCount; // section reference count + uint32_t dwHeadSharedRefCountAddr; // head shared page reference count address + uint32_t dwTailSharedRefCountAddr; // tail shared page reference count address + uint8_t bzSectionDigest[20]; // section digest + } + #include "AlignPosfix1.h" + *m_SectionHeader; + + // Xbe library versions + #include "AlignPrefix1.h" + struct LibraryVersion + { + char szName[8]; // library name + uint16_t wMajorVersion; // major version + uint16_t wMinorVersion; // minor version + uint16_t wBuildVersion; // build version + + typedef struct + { + uint16_t QFEVersion : 13; // QFE Version + uint16_t Approved : 2; // Approved? (0:no, 1:possibly, 2:yes) + uint16_t bDebugBuild : 1; // Is this a debug build? + } Flags; + + union { + Flags wFlags; + uint16_t wFlags_value; + }; + } + #include "AlignPosfix1.h" + *m_LibraryVersion; + + // Xbe thread local storage + #include "AlignPrefix1.h" + struct TLS + { + uint32_t dwDataStartAddr; // raw start address + uint32_t dwDataEndAddr; // raw end address + uint32_t dwTLSIndexAddr; // tls index address + uint32_t dwTLSCallbackAddr; // tls callback address + uint32_t dwSizeofZeroFill; // size of zero fill + uint32_t dwCharacteristics; // characteristics + } + #include "AlignPosfix1.h" + *m_TLS; + + // Xbe signature header + uint8_t* m_SignatureHeader; + + // Xbe section names, stored null terminated + char (*m_szSectionName)[10]; + + // Xbe sections + uint8_t **m_bzSection; + + // Xbe original path + char m_szPath[MAX_PATH]; + + // Xbe ascii title, translated from certificate title + char m_szAsciiTitle[40]; + + // retrieve thread local storage data address + uint8_t *GetTLSData() { if(m_TLS == 0) return 0; else return GetAddr(m_TLS->dwDataStartAddr); } + + // retrieve thread local storage index address + uint32_t *GetTLSIndex() { if(m_TLS == 0) return 0; else return (uint32_t*)GetAddr(m_TLS->dwTLSIndexAddr); } + + // return a modifiable pointer inside this structure that corresponds to a virtual address + uint8_t *GetAddr(uint32_t x_dwVirtualAddress); + + const wchar_t *GetUnicodeFilenameAddr(); + private: + // constructor initialization + void ConstructorInit(); + + // return a modifiable pointer to logo bitmap data + uint8_t *GetLogoBitmap(uint32_t x_dwSize); + + + // used to encode/decode logo bitmap data + union LogoRLE + { + struct Eight + { + uint32_t bType1 : 1; + uint32_t Len : 3; + uint32_t Data : 4; + } + m_Eight; + + struct Sixteen + { + uint32_t bType1 : 1; + uint32_t bType2 : 1; + uint32_t Len : 10; + uint32_t Data : 4; + } + m_Sixteen; + }; + + public: + // used to decode game logo bitmap data + #include "AlignPrefix1.h" + struct X_D3DResourceLoc + { + uint32_t Common; + uint32_t Data; + uint32_t Lock; + uint32_t Format; + uint32_t Size; + } + #include "AlignPosfix1.h" + ; + + #include "AlignPrefix1.h" + // XPR structures + + // Purpose: + // The XPR file format allows multiple graphics resources to be pre-defined + // and bundled together into one file. These resources can be copied into + // memory and then immediately used in-place as D3D objects such as textures + // and vertex buffers. The structure below defines the XPR header and the + // unique identifier for this file type. + struct XprHeader + { + uint32_t dwXprMagic; // 'XPR0' or 'XPR1' + uint32_t dwXprTotalSize; + uint32_t dwXprHeaderSize; + } + #include "AlignPosfix1.h" + *m_xprHeader; + + #include "AlignPrefix1.h" + // Layout of SaveImage.xbx saved game image file + // + // File is XPR0 format. Since the XPR will always contain only a single + // 256x256 DXT1 image, we know exactly what the header portion will look like + struct XprImageHeader + { + XprHeader xprHeader; // Standard XPR struct + X_D3DResourceLoc d3dTexture; // Standard D3D texture struct + uint32_t dwEndOfHeader; // $FFFFFFFF + } + #include "AlignPosfix1.h" + *m_xprImageHeader; + + + #include "AlignPrefix1.h" + struct XprImage + { + XprImageHeader xprImageHeader; + char strPad[XPR_IMAGE_HDR_SIZE - sizeof(XprImageHeader)]; + unsigned char pBits; + } + #include "AlignPosfix1.h" + *m_xprImage; +}; + +// debug/retail XOR keys +const uint32_t XOR_EP_DEBUG = 0x94859D4B; // Entry Point (Debug) +const uint32_t XOR_EP_RETAIL = 0xA8FC57AB; // Entry Point (Retail) +const uint32_t XOR_KT_DEBUG = 0xEFB1F152; // Kernel Thunk (Debug) +const uint32_t XOR_KT_RETAIL = 0x5B6D40B6; // Kernel Thunk (Retail) + +// Sega Chihiro XOR keys +const uint32_t XOR_EP_CHIHIRO = 0x40B5C16E; +const uint32_t XOR_KT_CHIHIRO = 0x2290059D; + +// game region flags for Xbe certificate +const uint32_t XBEIMAGE_GAME_REGION_NA = 0x00000001; +const uint32_t XBEIMAGE_GAME_REGION_JAPAN = 0x00000002; +const uint32_t XBEIMAGE_GAME_REGION_RESTOFWORLD = 0x00000004; +const uint32_t XBEIMAGE_GAME_REGION_MANUFACTURING = 0x80000000; + +// media type flags for Xbe certificate +const uint32_t XBEIMAGE_MEDIA_TYPE_HARD_DISK = 0x00000001; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_X2 = 0x00000002; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_CD = 0x00000004; +const uint32_t XBEIMAGE_MEDIA_TYPE_CD = 0x00000008; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_5_RO = 0x00000010; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_9_RO = 0x00000020; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_5_RW = 0x00000040; +const uint32_t XBEIMAGE_MEDIA_TYPE_DVD_9_RW = 0x00000080; +const uint32_t XBEIMAGE_MEDIA_TYPE_DONGLE = 0x00000100; +const uint32_t XBEIMAGE_MEDIA_TYPE_MEDIA_BOARD = 0x00000200; +const uint32_t XBEIMAGE_MEDIA_TYPE_NONSECURE_HARD_DISK = 0x40000000; +const uint32_t XBEIMAGE_MEDIA_TYPE_NONSECURE_MODE = 0x80000000; +const uint32_t XBEIMAGE_MEDIA_TYPE_MEDIA_MASK = 0x00FFFFFF; + +// section type flags for Xbe +const uint32_t XBEIMAGE_SECTION_WRITEABLE = 0x00000001; +const uint32_t XBEIMAGE_SECTION_PRELOAD = 0x00000002; +const uint32_t XBEIMAGE_SECTION_EXECUTABLE = 0x00000004; +const uint32_t XBEIMAGE_SECTION_INSERTFILE = 0x00000008; +const uint32_t XBEIMAGE_SECTION_HEAD_PAGE_READONLY = 0x00000010; +const uint32_t XBEIMAGE_SECTION_TAIL_PAGE_READONLY = 0x00000020; +#endif diff --git a/src/Common/XbePrinter.cpp b/src/common/xbe/XbePrinter.cpp similarity index 91% rename from src/Common/XbePrinter.cpp rename to src/common/xbe/XbePrinter.cpp index f5d77f2fb..2d7e6ba62 100644 --- a/src/Common/XbePrinter.cpp +++ b/src/common/xbe/XbePrinter.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->Xbe.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,18 +25,18 @@ // * // ****************************************************************** -#include "XbePrinter.h" -#include "CxbxVersion.h" // For _CXBX_VERSION +#include "common\xbe\XbePrinter.h" +#include "CxbxVersion.h" // For CxbxVersionStr #include // For ctime -#include // For std::codecvt_utf8<> #include // For std::stringstream #include // For std::setfill, std::uppercase, std::hex +#include "common/util/strConverter.hpp" // for utf16le_to_ascii extern std::string FormatTitleId(uint32_t title_id); // Exposed in Emu.cpp // better time -static char *BetterTime(uint32 x_timeDate) +static char *BetterTime(uint32_t x_timeDate) { time_t x_time = x_timeDate; char *x_ctime = ctime(&x_time); @@ -91,29 +82,21 @@ std::string XbePrinter::GenXbeInfo() } std::string XbePrinter::GenHexRow( - uint08 *signature, const uint08 row, const uint08 row_size + uint8_t *signature, const uint8_t row, const uint8_t row_size ) { - const uint16 offset = row * row_size; + const uint16_t offset = row * row_size; std::stringstream text; SSTREAM_SET_HEX(text); - for(uint08 x = 0; x < row_size; x++) { + for(uint8_t x = 0; x < row_size; x++) { text << std::setw(2) << static_cast(signature[offset + x]); } return text.str(); } -// https://stackoverflow.com/questions/4786292/converting-unicode-strings-and-vice-versa -std::string XbePrinter::utf8_to_ascii(const wchar_t* utf8_string) -{ - std::wstring_convert> utf8_to_ascii; - const std::wstring utf8_filename(utf8_string); - return utf8_to_ascii.to_bytes(utf8_filename); -} - std::string XbePrinter::AllowedMediaToString() { - const uint32 dwAllowedMedia = Xbe_certificate->dwAllowedMedia; + const uint32_t dwAllowedMedia = Xbe_certificate->dwAllowedMedia; std::string text = "Media Types:"; if(dwAllowedMedia & XBEIMAGE_MEDIA_TYPE_MEDIA_MASK) { @@ -154,7 +137,7 @@ std::string XbePrinter::AllowedMediaToString() std::string XbePrinter::GameRatingToString() { std::string text; - // Info from: http://xboxdevwiki.net/EEPROM + // Info from: https://xboxdevwiki.net/EEPROM switch(Xbe_certificate->dwGameRatings) { case 0x0: text.append("(RP) Rating Pending"); @@ -187,7 +170,9 @@ std::string XbePrinter::GameRatingToString() std::string XbePrinter::GenDumpHeader() { std::string text; - text.append("XBE information generated by Cxbx-Reloaded (Version " _CXBX_VERSION ")\n\n"); + text.append("XBE information generated by Cxbx-Reloaded (Version "); + text.append(CxbxVersionStr); + text.append(")\n\n"); text.append("Title identified as \""); text.append(Xbe_to_print->m_szAsciiTitle); text.append("\"\n\n"); @@ -208,7 +193,7 @@ std::string XbePrinter::GenXbeHeaderInfo() std::string XbePrinter::GenDigitalSignature() { - const uint08 row_size = 16; + const uint8_t row_size = 16; std::string text; text.append("Digital Signature : "); for(int row = 0; row < 16; row++) { @@ -258,11 +243,11 @@ std::string XbePrinter::GenInitFlags() std::string XbePrinter::GenGeneralHeaderInfo2() { - const uint32 retail_entry_point = Xbe_header->dwEntryAddr ^ XOR_EP_RETAIL; - const uint32 debug_entry_point = Xbe_header->dwEntryAddr ^ XOR_EP_DEBUG; - const uint32 retail_thunk_addr = Xbe_header->dwKernelImageThunkAddr ^ XOR_KT_RETAIL; - const uint32 debug_thunk_addr = Xbe_header->dwKernelImageThunkAddr ^ XOR_KT_DEBUG; - const std::string AsciiFilename = utf8_to_ascii(Xbe_to_print->GetUnicodeFilenameAddr()); + const uint32_t retail_entry_point = Xbe_header->dwEntryAddr ^ XOR_EP_RETAIL; + const uint32_t debug_entry_point = Xbe_header->dwEntryAddr ^ XOR_EP_DEBUG; + const uint32_t retail_thunk_addr = Xbe_header->dwKernelImageThunkAddr ^ XOR_KT_RETAIL; + const uint32_t debug_thunk_addr = Xbe_header->dwKernelImageThunkAddr ^ XOR_KT_DEBUG; + const std::string AsciiFilename = utf16le_to_ascii(Xbe_to_print->GetUnicodeFilenameAddr()); std::stringstream text; SSTREAM_SET_HEX(text); text << "Entry Point : 0x" << std::setw(8) << Xbe_header->dwEntryAddr << " (Retail: 0x" << std::setw(8) << retail_entry_point << ", Debug: 0x" << std::setw(8) << debug_entry_point << ")\n"; @@ -356,8 +341,8 @@ std::string XbePrinter::GenMediaInfo() std::string XbePrinter::GenLANKey() { - const uint08 row = 0; - const uint08 row_size = 16; + const uint8_t row = 0; + const uint8_t row_size = 16; std::string text; text.append("LAN Key : "); text.append(GenHexRow(&(Xbe_certificate->bzLanKey[0]), row, row_size)); @@ -367,8 +352,8 @@ std::string XbePrinter::GenLANKey() std::string XbePrinter::GenSignatureKey() { - const uint08 row = 0; - const uint08 row_size = 16; + const uint8_t row = 0; + const uint8_t row_size = 16; std::string text; text.append("Signature Key : "); text.append(GenHexRow(&(Xbe_certificate->bzSignatureKey[0]), row, row_size)); @@ -378,8 +363,8 @@ std::string XbePrinter::GenSignatureKey() std::string XbePrinter::GenAlternateSignatureKeys() { - const uint08 row = 0; - const uint08 row_size = 16; + const uint8_t row = 0; + const uint8_t row_size = 16; std::string text; text.append("Title Alternate Signature Keys : "); @@ -420,7 +405,7 @@ std::string XbePrinter::GenSectionHeaders() { std::stringstream text; SSTREAM_SET_HEX(text); - for(uint32 v=0; v < Xbe_header->dwSections; v++) { + for(uint32_t v=0; v < Xbe_header->dwSections; v++) { text << "Section Name : 0x" << std::setw(8) << Xbe_to_print->m_SectionHeader[v].dwSectionNameAddr << " (\"" << Xbe_to_print->m_szSectionName[v] << "\")\n"; text << GenSectionFlags(Xbe_to_print->m_SectionHeader[v]); text << "Virtual Address : 0x" << std::setw(8) << Xbe_to_print->m_SectionHeader[v].dwVirtualAddr << "\n"; @@ -482,9 +467,9 @@ std::string XbePrinter::GenLibraryVersions() text << "(This XBE contains no Library Versions)\n\n"; } else { - for(uint32 v = 0; v < Xbe_header->dwLibraryVersions; v++) { + for(uint32_t v = 0; v < Xbe_header->dwLibraryVersions; v++) { char libname[9]; - for(uint32 c=0;c<8;c++) { + for(uint32_t c=0;c<8;c++) { libname[c] = Xbe_to_print->m_LibraryVersion[v].szName[c]; } libname[8] = '\0'; diff --git a/src/Common/XbePrinter.h b/src/common/xbe/XbePrinter.h similarity index 81% rename from src/Common/XbePrinter.h rename to src/common/xbe/XbePrinter.h index dcd25b55a..5d656eeb7 100644 --- a/src/Common/XbePrinter.h +++ b/src/common/xbe/XbePrinter.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Common->XbePrinter.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,8 +25,8 @@ #ifndef XBE_PRINTER_H #define XBE_PRINTER_H -#include "Common/Error.h" -#include "Common/Xbe.h" +#include "common\Error.h" +#include "common\xbe\Xbe.h" #include @@ -52,8 +43,7 @@ class XbePrinter Xbe::Header *Xbe_header; Xbe::Certificate *Xbe_certificate; - std::string GenHexRow(uint08*, const uint08, const uint08); - std::string utf8_to_ascii(const wchar_t*); + std::string GenHexRow(uint8_t*, const uint8_t, const uint8_t); std::string AllowedMediaToString(); std::string GameRatingToString(); diff --git a/src/Common/XDVDFS Tools/buffered_io.cpp b/src/common/xdvdfs-tools/buffered_io.cpp similarity index 97% rename from src/Common/XDVDFS Tools/buffered_io.cpp rename to src/common/xdvdfs-tools/buffered_io.cpp index f0378ff22..11e4037bf 100644 --- a/src/Common/XDVDFS Tools/buffered_io.cpp +++ b/src/common/xdvdfs-tools/buffered_io.cpp @@ -1,6 +1,5 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#define _XBOXKRNL_DEFEXTRN_ // prevent name collisions namespace xboxkrnl @@ -53,7 +52,7 @@ PBYTE GetSectorBuffered( // If something went bad free the slot This->SectorList[index] = 0; This->LockList[index]--; - return NULL; + return nullptr; } This->WriteIndex++; @@ -61,7 +60,7 @@ PBYTE GetSectorBuffered( } // We land here if all entries were locked, and that's BAD ! - return NULL; + return nullptr; } //------------------------------------------------------------------------------ void ReleaseBufferedSector( diff --git a/src/Common/XDVDFS Tools/buffered_io.h b/src/common/xdvdfs-tools/buffered_io.h similarity index 100% rename from src/Common/XDVDFS Tools/buffered_io.h rename to src/common/xdvdfs-tools/buffered_io.h diff --git a/src/Common/XDVDFS Tools/xdvdfs.cpp b/src/common/xdvdfs-tools/xdvdfs.cpp similarity index 99% rename from src/Common/XDVDFS Tools/xdvdfs.cpp rename to src/common/xdvdfs-tools/xdvdfs.cpp index 86a22c40e..f8c65e848 100644 --- a/src/Common/XDVDFS Tools/xdvdfs.cpp +++ b/src/common/xdvdfs-tools/xdvdfs.cpp @@ -1,9 +1,9 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#define _XBOXKRNL_DEFEXTRN_ -#include -#include +#include +#include +#include #include #include "xdvdfs.h" diff --git a/src/Common/XDVDFS Tools/xdvdfs.h b/src/common/xdvdfs-tools/xdvdfs.h similarity index 97% rename from src/Common/XDVDFS Tools/xdvdfs.h rename to src/common/xdvdfs-tools/xdvdfs.h index b0eca57fb..aef1c9b0c 100644 --- a/src/Common/XDVDFS Tools/xdvdfs.h +++ b/src/common/xdvdfs-tools/xdvdfs.h @@ -3,12 +3,6 @@ #ifndef __XDVDFS_H__ #define __XDVDFS_H__ -#ifdef __cplusplus -#pragma once - -extern "C" { -#endif - #include //#include #include "buffered_io.h" @@ -159,8 +153,4 @@ extern DWORD XDVDFS_FileSeek( int Delta, DWORD SeekMode); -#ifdef __cplusplus -} -#endif - -#endif // __XDVDFS_H__ \ No newline at end of file +#endif // __XDVDFS_H__ diff --git a/src/core/hle/D3D8/Direct3D9/CxbxVertexShaderTemplate.hlsl b/src/core/hle/D3D8/Direct3D9/CxbxVertexShaderTemplate.hlsl new file mode 100644 index 000000000..1ba2c39fe --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/CxbxVertexShaderTemplate.hlsl @@ -0,0 +1,326 @@ +// This starts the raw string (comment to get syntax highlighting, UNCOMMENT to compile) : +R"DELIMITER(// Xbox HLSL vertex shader (template populated at runtime) + +struct VS_INPUT +{ + float4 v[16] : TEXCOORD; +}; + +// Output registers +struct VS_OUTPUT +{ + float4 oPos : POSITION; // Homogeneous clip space position + float4 oD0 : COLOR0; // Primary color (front-facing) + float4 oD1 : COLOR1; // Secondary color (front-facing) + float oFog : FOG; // Fog coordinate + float oPts : PSIZE; // Point size + float4 oB0 : TEXCOORD4; // Back-facing primary color + float4 oB1 : TEXCOORD5; // Back-facing secondary color + float4 oT0 : TEXCOORD0; // Texture coordinate set 0 + float4 oT1 : TEXCOORD1; // Texture coordinate set 1 + float4 oT2 : TEXCOORD2; // Texture coordinate set 2 + float4 oT3 : TEXCOORD3; // Texture coordinate set 3 +}; + +#define X_D3DSCM_CORRECTION 96 // Add 96 to arrive at the range 0..191 (instead of -96..95) +#define X_D3DVS_CONSTREG_COUNT 192 + +// Xbox constant registers +uniform float4 C[X_D3DVS_CONSTREG_COUNT] : register(c0); + +// Default values for vertex registers, and whether to use them +uniform float4 vRegisterDefaultValues[16] : register(c192); +uniform float4 vRegisterDefaultFlagsPacked[4] : register(c208); + +uniform float4 xboxViewportScale : register(c212); +uniform float4 xboxViewportOffset : register(c213); + +// Overloaded casts, assuring all inputs are treated as float4 +float4 _tof4(float src) { return float4(src, src, src, src); } +float4 _tof4(float2 src) { return src.xyyy; } +float4 _tof4(float3 src) { return src.xyzz; } +float4 _tof4(float4 src) { return src; } +float4 _ssss(float s) { return float4(s, s, s, s); } // a scalar output replicated across a 4-component vector +#define _scalar(src) _tof4(src).x /* a scalar input */ + +float4 c(int register_number) +{ + // Map Xbox [-96, 95] to Host [0, 191] + // Account for Xbox's negative constant indexes + register_number += X_D3DSCM_CORRECTION; + + // Like Xbox, out-of-range indices are guaranteed to be zero in HLSL + // so no need to bounds check negative numbers + // if (register_number < 0) + // return 0; + + // If the index is too large, set it to -1 so 0 is returned + // Note: returning 0 directly requires many more instructions + if (register_number >= X_D3DVS_CONSTREG_COUNT) // X_D3DVS_CONSTREG_COUNT + register_number = -1; + + return C[register_number]; +} + +// Due to rounding differences with the Xbox (and increased precision on PC?) +// some titles produce values just below the threshold of the next integer. +// We can add a small bias to make sure it's bumped over the threshold +// Test Case: Azurik (divides indexes 755, then scales them back in the vertex shader) +#define BIAS 0.001 +// NOTE : Was 0.0001, unlike xqemu + +// 2.14.1.11 Vertex Program Floating Point Requirements +// The floor operations used by the ARL and EXP instructions must +// operate identically. Specifically, the EXP instruction's floor(t.x) +// intermediate result must exactly match the integer stored in the +// address register by the ARL instruction. +float x_floor(float src) +{ + return floor(src + BIAS); +} + +// http://xboxdevwiki.net/NV2A/Vertex_Shader +// https://www.khronos.org/registry/OpenGL/extensions/NV/NV_vertex_program.txt +// https://www.khronos.org/registry/OpenGL/extensions/NV/NV_vertex_program1_1.txt + +// Functions for MAC ('Multiply And Accumulate') opcodes + +// 2.14.1.10.1 ARL: Address Register Load +// The address register should be floored +#define x_arl(dest, mask, src0) dest.mask = x_floor(_tof4(src0).x).mask + +// 2.14.1.10.2 MOV: Move +#define x_mov(dest, mask, src0) dest.mask = (_tof4(src0)).mask + +// 2.14.1.10.3 MUL: Multiply +#define x_mul(dest, mask, src0, src1) dest.mask = (_tof4(src0) * _tof4(src1)).mask + +// 2.14.1.10.4 ADD: Add +#define x_add(dest, mask, src0, src1) dest.mask = (_tof4(src0) + _tof4(src1)).mask + +// 2.14.1.10.5 MAD: Multiply and Add +#define x_mad(dest, mask, src0, src1, src2) dest.mask = (_tof4(src0) * _tof4(src1) + _tof4(src2)).mask + +// 2.14.1.10.8 DP3: Three-Component Dot Product +#define x_dp3(dest, mask, src0, src1) dest.mask = _ssss(dot(_tof4(src0).xyz, _tof4(src1).xyz)).mask + +// 2.14.1.10.9 DP4: Four-Component Dot Product +#define x_dp4(dest, mask, src0, src1) dest.mask = _ssss(dot(_tof4(src0), _tof4(src1))).mask + +// 2.14.1.10.10 DST: Distance Vector +#define x_dst(dest, mask, src0, src1) dest.mask = dst(_tof4(src0), _tof4(src1)).mask /* equals { dest.x = 1; dest.y = src0.y * src1.y; dest.z = src0.z; dest.w = src1.w; } */ + +// 2.14.1.10.11 MIN: Minimum +#define x_min(dest, mask, src0, src1) dest.mask = min(_tof4(src0), _tof4(src1)).mask + +// 2.14.1.10.12 MAX: Maximum +#define x_max(dest, mask, src0, src1) dest.mask = max(_tof4(src0), _tof4(src1)).mask + +// 2.14.1.10.13 SLT: Set On Less Than +#define x_slt(dest, mask, src0, src1) dest.mask = _slt(_tof4(src0), _tof4(src1)).mask +float4 _slt(float4 src0, float4 src1) +{ + float4 dest; + dest.x = (src0.x < src1.x) ? 1 : 0; + dest.y = (src0.y < src1.y) ? 1 : 0; + dest.z = (src0.z < src1.z) ? 1 : 0; + dest.w = (src0.w < src1.w) ? 1 : 0; + return dest; +} + +// 2.14.1.10.14 SGE: Set On Greater or Equal Than +#define x_sge(dest, mask, src0, src1) dest.mask = _sge(_tof4(src0), _tof4(src1)).mask +float4 _sge(float4 src0, float4 src1) +{ + float4 dest; + dest.x = (src0.x >= src1.x) ? 1 : 0; + dest.y = (src0.y >= src1.y) ? 1 : 0; + dest.z = (src0.z >= src1.z) ? 1 : 0; + dest.w = (src0.w >= src1.w) ? 1 : 0; + return dest; +} + +// 2.14.1.10.18 DPH: Homogeneous Dot Product +#define x_dph(dest, mask, src0, src1) dest.mask = _ssss(_dph(_tof4(src0), _tof4(src1))).mask +float _dph(float4 src0, float4 src1) +{ + return dot(src0.xyz, src1.xyz) + src1.w; +} + +// Xbox ILU Functions + +// 2.14.1.10.6 RCP: Reciprocal +#define x_rcp(dest, mask, src0) dest.mask = _ssss(_rcp(_scalar(src0))).mask +float _rcp(float src) +{ +#if 0 // TODO : Enable + if (src == 1) return 1; + if (src == 0) return 1.#INF; +#endif + return 1/ src; +} + +// 2.14.1.10.7 RSQ: Reciprocal Square Root +#define x_rsq(dest, mask, src0) dest.mask = _ssss(_rsq(_scalar(src0))).mask +float _rsq(float src) +{ + float a = abs(src); +#if 0 // TODO : Enable + if (a == 1) return 1; + if (a == 0) return 1.#INF; +#endif + return rsqrt(a); +} + +// 2.14.1.10.15 EXP: Exponential Base 2 +#define x_expp(dest, mask, src0) dest.mask = _expp(_scalar(src0)).mask +float4 _expp(float src) +{ + float floor_src = x_floor(src); + + float4 dest; + dest.x = exp2(floor_src); + dest.y = src - floor_src; + dest.z = exp2(src); + dest.w = 1; + + return dest; +} + +// 2.14.1.10.16 LOG: Logarithm Base 2 +#define x_logp(dest, mask, src0) dest.mask = _logp(_scalar(src0)).mask +float4 _logp(float src) +{ + float4 dest; +#if 0 // TODO : Enable + float t = abs(src); + if (t != 0) { + if (t == 1.#INF) { + dest.x = 1.#INF; + dest.y = 1; + dest.z = 1.#INF; + } else { +#endif + float exponent; + float mantissa = frexp(src/* + BIAS*/, /*out*/exponent); + float z = log2(src); + dest.x = exponent; + dest.y = mantissa; + dest.z = z; +#if 0 + } + } else { + dest.x = -1.#INF; + dest.y = 1; + dest.z = -1.#INF; + } +#endif + dest.w = 1; + return dest; +} + +// 2.14.1.10.17 LIT: Light Coefficients +#define x_lit(dest, mask, src) dest.mask = _lit(_tof4(src)).mask +float4 _lit(float4 src0) +{ + const float epsilon = 1.0f / 256.0f; + + float diffuse = src0.x; + float blinn = src0.y; + float specPower = clamp(src0.w, -(128 - epsilon), (128 - epsilon)); + + float4 dest; + dest.x = 1; + dest.y = max(0, diffuse); + dest.z = (diffuse > 0) && (blinn > 0) ? pow(blinn, specPower) : 0; + dest.w = 1; + + return dest; +} + +// 2.14.1.10.19 RCC: Reciprocal Clamped +#define x_rcc(dest, mask, src0) dest.mask = _ssss(_rcc(_scalar(src0))).mask +float _rcc(float src) +{ + // Calculate the reciprocal + float r = 1 / src; + + // Clamp + return (r >= 0) + ? clamp(r, 5.42101e-020f, 1.84467e+019f) // the IEEE 32-bit binary values 0x1F800000 and 0x5F800000 + : clamp(r, -1.84467e+019f, -5.42101e-020f); // the IEEE 32-bit binary values 0xDF800000 and 0x9F800000 +} + +float4 reverseScreenspaceTransform(float4 oPos) +{ + // On Xbox, oPos should contain the vertex position in screenspace + // We need to reverse this transformation + // Conventionally, each Xbox Vertex Shader includes instructions like this + // mul oPos.xyz, r12, c-38 + // +rcc r1.x, r12.w + // mad oPos.xyz, r12, r1.x, c-37 + // where c-37 and c-38 are reserved transform values + + oPos.xyz -= xboxViewportOffset.xyz; // reverse offset + oPos.xyz *= oPos.w; // reverse perspective divide + oPos.xyz /= xboxViewportScale.xyz; // reverse scale + + return oPos; +} + +VS_OUTPUT main(const VS_INPUT xIn) +{ + // Output variables + float4 oPos, oD0, oD1, oB0, oB1, oT0, oT1, oT2, oT3; + oPos = oD0 = oD1 = oB0 = oB1 = oT0 = oT1 = oT2 = oT3 = float4(0, 0, 0, 1); // Pre-initialize w component of outputs to 1 + + // Single component outputs + float4 oFog, oPts; // x is write-only on Xbox. Use float4 as some games use incorrect masks + oFog = oPts = 0; + + // Address (index) register + int1 a0 = 0; + + // Temporary registers + float4 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11; + r0 = r1 = r2 = r3 = r4 = r5 = r6 = r7 = r8 = r9 = r10 = r11 = float4(0, 0, 0, 0); + #define r12 oPos // oPos and r12 are two ways of accessing the same register on Xbox + + // Input registers + float4 v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15; + + // Unpack 16 flags from 4 float4 constant registers + float vRegisterDefaultFlags[16] = (float[16])vRegisterDefaultFlagsPacked; + + // Initialize input registers from the vertex buffer data + // Or use the register's default value (which can be changed by the title) + #define init_v(i) v##i = lerp(xIn.v[i], vRegisterDefaultValues[i], vRegisterDefaultFlags[i]); + // Note : unroll manually instead of for-loop, because of the ## concatenation + init_v( 0); init_v( 1); init_v( 2); init_v( 3); + init_v( 4); init_v( 5); init_v( 6); init_v( 7); + init_v( 8); init_v( 9); init_v(10); init_v(11); + init_v(12); init_v(13); init_v(14); init_v(15); + + // Xbox shader program)DELIMITER", /* This terminates the header raw string" // */ + +R"DELIMITER( + + // Copy variables to output struct + VS_OUTPUT xOut; + + xOut.oPos = reverseScreenspaceTransform(oPos); + xOut.oD0 = saturate(oD0); + xOut.oD1 = saturate(oD1); + xOut.oFog = oFog.x; + xOut.oPts = oPts.x; + xOut.oB0 = saturate(oB0); + xOut.oB1 = saturate(oB1); + xOut.oT0 = oT0; + xOut.oT1 = oT1; + xOut.oT2 = oT2; + xOut.oT3 = oT3; + + return xOut; +} + +// End of vertex shader footer)DELIMITER" /* This terminates the footer raw string" // */ diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp similarity index 52% rename from src/CxbxKrnl/EmuD3D8.cpp rename to src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index c36a315d9..09973338b 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,51 +24,172 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#include "xxhash32.h" -#include +#define LOG_PREFIX CXBXR_MODULE::D3D8 -#define LOG_PREFIX "D3D8" +#include "common\util\hasher.h" +#include +#include // prevent name collisions namespace xboxkrnl { - #include + #include }; -#include "CxbxUtil.h" +#include "common\util\CxbxUtil.h" #include "CxbxVersion.h" -#include "CxbxKrnl.h" -#include "Emu.h" -#include "EmuFS.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" #include "EmuShared.h" -#include "DbgConsole.h" -#include "ResourceTracker.h" -#include "VMManager.h" // for g_VMManager -#include "EmuXTL.h" +#include "gui\DbgConsole.h" +#include "core\hle\D3D8\ResourceTracker.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For LPDIRECTDRAWSURFACE7 +#include "core\hle\D3D8\XbVertexBuffer.h" +#include "core\hle\D3D8\XbVertexShader.h" +#include "core\hle\D3D8\XbPixelShader.h" // For DxbxUpdateActivePixelShader +#include "core\hle\D3D8\XbPushBuffer.h" +#include "core\kernel\memory-manager\VMManager.h" // for g_VMManager +#include "core\hle\XAPI\Xapi.h" // For EMUPATCH +#include "core\hle\D3D8\XbConvert.h" #include "Logging.h" -#include "EmuD3D8Logging.h" -#include "HLEIntercept.h" // for bLLE_GPU -#include "Cxbx\\ResCxbx.h" +#include "..\XbD3D8Logging.h" +#include "core\hle\Intercept.hpp" // for bLLE_GPU +#include "devices\video\nv2a.h" // For GET_MASK, NV_PGRAPH_CONTROL_0, PUSH_METHOD +#include "gui\ResCxbx.h" +#include "RenderStates.h" +#include "TextureStates.h" +#include "WalkIndexBuffer.h" +#include "core\kernel\common\strings.hpp" // For uem_str +#include "common\input\SdlJoystick.h" +#include "common/util/strConverter.hpp" // for utf8_to_utf16 +#include "VertexShaderSource.h" #include #include #include #include +#include + +XboxRenderStateConverter XboxRenderStates; +XboxTextureStateConverter XboxTextureStates; // Allow use of time duration literals (making 16ms, etc possible) using namespace std::literals::chrono_literals; // Global(s) HWND g_hEmuWindow = NULL; // rendering window -XTL::IDirect3DDevice *g_pD3DDevice = nullptr; // Direct3D Device -XTL::LPDIRECTDRAWSURFACE7 g_pDDSPrimary = NULL; // DirectDraw7 Primary Surface -XTL::LPDIRECTDRAWCLIPPER g_pDDClipper = nullptr; // DirectDraw7 Clipper -DWORD g_CurrentXboxVertexShaderHandle = 0; -XTL::X_PixelShader* g_D3DActivePixelShader = nullptr; -BOOL g_bIsFauxFullscreen = FALSE; -DWORD g_OverlaySwap = 0; -DWORD g_CurrentFillMode = XTL::D3DFILL_SOLID; // Used to backup/restore the fill mode when WireFrame is enabled +IDirect3DDevice *g_pD3DDevice = nullptr; // Direct3D Device + +// Static Variable(s) +static IDirectDrawSurface7 *g_pDDSPrimary = nullptr; // DirectDraw7 Primary Surface +static IDirectDrawClipper *g_pDDClipper = nullptr; // DirectDraw7 Clipper +static IDirectDraw7 *g_pDD7 = nullptr; // DirectDraw7 +static HMONITOR g_hMonitor = NULL; // Handle to DirectDraw monitor +static GUID g_ddguid = { 0 }; // DirectDraw driver GUID +static DDCAPS g_DriverCaps = { 0 }; + +static bool g_bSupportsFormatSurface[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? +static bool g_bSupportsFormatSurfaceRenderTarget[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? +static bool g_bSupportsFormatSurfaceDepthStencil[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? +static bool g_bSupportsFormatTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support texture format? +static bool g_bSupportsFormatTextureRenderTarget[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support texture format? +static bool g_bSupportsFormatTextureDepthStencil[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support texture format? +static bool g_bSupportsFormatVolumeTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support surface format? +static bool g_bSupportsFormatCubeTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support surface format? +static HBRUSH g_hBgBrush = NULL; // Background Brush +static volatile bool g_bRenderWindowActive = false; +static BOOL g_bIsFauxFullscreen = FALSE; +static DWORD g_OverlaySwap = 0; // Set in D3DDevice_UpdateOverlay +static int g_iWireframe = 0; // wireframe toggle +static bool g_bHack_UnlockFramerate = false; // ignore the xbox presentation interval +static bool g_bHasDepth = false; // Does device have a Depth Buffer? +static bool g_bHasStencil = false; // Does device have a Stencil Buffer? +static DWORD g_dwPrimPerFrame = 0; // Number of primitives within one frame + +static Settings::s_video g_XBVideo; + +// D3D based variables +static IDirect3D *g_pDirect3D = nullptr; + D3DCAPS g_D3DCaps = {}; // Direct3D Caps +static IDirect3DVertexBuffer *g_pDummyBuffer = nullptr; // Dummy buffer, used to set unused stream sources with +static IDirect3DIndexBuffer *g_pClosingLineLoopHostIndexBuffer = nullptr; +static IDirect3DIndexBuffer *g_pQuadToTriangleHostIndexBuffer = nullptr; +static IDirect3DSurface *g_pDefaultHostDepthBufferSurface = nullptr; + +static bool g_bEnableHostQueryVisibilityTest = true; +static std::stack g_HostQueryVisibilityTests; +static std::map g_HostVisibilityTestMap; + +// cached Direct3D state variable(s) +static size_t g_QuadToTriangleHostIndexBuffer_Size = 0; // = NrOfQuadIndices +static INDEX16 *g_pQuadToTriangleIndexData = nullptr; +static size_t g_QuadToTriangleIndexData_Size = 0; // = NrOfQuadIndices + +static CxbxVertexBufferConverter VertexBufferConverter = {}; + +struct { + XTL::X_D3DSurface Surface; + RECT SrcRect; + RECT DstRect; + BOOL EnableColorKey; + D3DCOLOR ColorKey; +} g_OverlayProxy; + +typedef struct { + // Arguments to D3DDevice_InsertCallback : + XTL::X_D3DCALLBACK pCallback; + XTL::X_D3DCALLBACKTYPE Type; + XTL::DWORD Context; +} s_Xbox_Callback; + +static std::queue g_Xbox_CallbackQueue; +static bool g_bHack_DisableHostGPUQueries = false; // TODO : Make configurable +static IDirect3DQuery *g_pHostQueryWaitForIdle = nullptr; +static IDirect3DQuery *g_pHostQueryCallbackEvent = nullptr; + +// Vertex shader symbols, declared in XbVertexShader.cpp : +extern void CxbxImpl_SelectVertexShaderDirect(XTL::X_VERTEXATTRIBUTEFORMAT* pVAF, DWORD Address); +extern void CxbxImpl_SetVertexShaderInput(DWORD Handle, UINT StreamCount, XTL::X_STREAMINPUT* pStreamInputs); + +// Vertex buffer symbols, declared in XbVertexBuffer.cpp +extern void CxbxImpl_SetStreamSource(UINT StreamNumber, XTL::X_D3DVertexBuffer* pStreamData, UINT Stride); + +static std::condition_variable g_VBConditionVariable; // Used in BlockUntilVerticalBlank +static std::mutex g_VBConditionMutex; // Used in BlockUntilVerticalBlank +static DWORD g_VBLastSwap = 0; + +static XTL::DWORD g_Xbox_PresentationInterval_Default = D3DPRESENT_INTERVAL_IMMEDIATE; + XTL::DWORD g_Xbox_PresentationInterval_Override = 0; +static XTL::X_D3DSWAPDATA g_Xbox_SwapData = {0}; // current swap information +static XTL::X_D3DSWAPCALLBACK g_pXbox_SwapCallback = xbnullptr; // Swap/Present callback routine +static XTL::X_D3DVBLANKDATA g_Xbox_VBlankData = {0}; // current vertical blank information +static XTL::X_D3DVBLANKCALLBACK g_pXbox_VerticalBlankCallback = xbnullptr; // Vertical-Blank callback routine + + XTL::X_D3DSurface *g_pXbox_BackBufferSurface = xbnullptr; +static XTL::X_D3DSurface *g_pXbox_DefaultDepthStencilSurface = xbnullptr; + XTL::X_D3DSurface *g_pXbox_RenderTarget = xbnullptr; +static XTL::X_D3DSurface *g_pXbox_DepthStencil = xbnullptr; + + XTL::X_VERTEXSHADERCONSTANTMODE g_Xbox_VertexShaderConstantMode = X_D3DSCM_192CONSTANTS; // Set by D3DDevice_SetShaderConstantMode, TODO : Move to XbVertexShader.cpp +static XTL::DWORD g_Xbox_BaseVertexIndex = 0; // Set by D3DDevice_SetIndices, read by D3DDevice_DrawIndexedVertices : a value that's effectively added to every vertex index (as stored in an index buffer) by multiplying this by vertex stride and added to the vertex buffer start (see BaseVertexIndex in CxbxDrawIndexed) +static XTL::DWORD *g_pXbox_BeginPush_Buffer = xbnullptr; // primary push buffer + + XTL::X_PixelShader* g_pXbox_PixelShader = xbnullptr; +static XTL::PVOID g_pXbox_Palette_Data[XTL::X_D3DTS_STAGECOUNT] = { xbnullptr, xbnullptr, xbnullptr, xbnullptr }; // cached palette pointer +static unsigned g_Xbox_Palette_Size[XTL::X_D3DTS_STAGECOUNT] = { 0 }; // cached palette size + + + XTL::X_D3DBaseTexture *g_pXbox_SetTexture[XTL::X_D3DTS_STAGECOUNT] = {0,0,0,0}; // Set by our D3DDevice_SetTexture and D3DDevice_SwitchTexture patches +static XTL::X_D3DBaseTexture CxbxActiveTextureCopies[XTL::X_D3DTS_STAGECOUNT] = {}; // Set by D3DDevice_SwitchTexture. Cached active texture + +/* Unused : +static XTL::DWORD *g_Xbox_D3DDevice; // TODO: This should be a D3DDevice structure + +static DWORD g_dwVertexShaderUsage = 0; // Unused. If needed, move to XbVertexShader.cpp +*/ + +static XTL::DWORD g_VertexShaderSlots[X_VSH_MAX_INSTRUCTION_COUNT]; + XTL::DWORD g_Xbox_VertexShader_Handle = 0; // Static Function(s) static BOOL WINAPI EmuEnumDisplayDevices(GUID FAR *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hm); @@ -88,117 +200,53 @@ static DWORD WINAPI EmuUpdateTickCount(LPVOID); static inline void EmuVerifyResourceIsRegistered(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iTextureStage, DWORD dwSize); static void UpdateCurrentMSpFAndFPS(); // Used for benchmarking/fps count -// Static Variable(s) -static HMONITOR g_hMonitor = NULL; // Handle to DirectDraw monitor -static bool g_bSupportsFormatSurface[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? -static bool g_bSupportsFormatSurfaceRenderTarget[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? -static bool g_bSupportsFormatSurfaceDepthStencil[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support surface format? -static bool g_bSupportsFormatTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support texture format? -static bool g_bSupportsFormatTextureRenderTarget[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support texture format? -static bool g_bSupportsFormatTextureDepthStencil[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false };// Does device support texture format? -static bool g_bSupportsFormatVolumeTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support surface format? -static bool g_bSupportsFormatCubeTexture[XTL::X_D3DFMT_LIN_R8G8B8A8 + 1] = { false }; // Does device support surface format? -static XTL::LPDIRECTDRAW7 g_pDD7 = NULL; // DirectDraw7 -static XTL::DDCAPS g_DriverCaps = { 0 }; -static HBRUSH g_hBgBrush = NULL; // Background Brush -static volatile bool g_bRenderWindowActive = false; -static XBVideo g_XBVideo; -static XTL::D3DVBLANKCALLBACK g_pVBCallback = NULL; // Vertical-Blank callback routine -static std::condition_variable g_VBConditionVariable; // Used in BlockUntilVerticalBlank -static std::mutex g_VBConditionMutex; // Used in BlockUntilVerticalBlank -static XTL::D3DSWAPCALLBACK g_pSwapCallback = NULL; // Swap/Present callback routine -static XTL::D3DCALLBACK g_pCallback = NULL; // D3DDevice::InsertCallback routine -static XTL::X_D3DCALLBACKTYPE g_CallbackType; // Callback type -static DWORD g_CallbackParam; // Callback param -static bool g_bHasDepth = false; // Does device have a Depth Buffer? -static bool g_bHasStencil = false; // Does device have a Stencil Buffer? -static DWORD g_dwPrimPerFrame = 0; // Number of primitives within one frame - -// primary push buffer -static uint32 g_dwPrimaryPBCount = 0; -static uint32 *g_pPrimaryPB = nullptr; - - -struct { - XTL::X_D3DSurface Surface; - RECT SrcRect; - RECT DstRect; - BOOL EnableColorKey; - XTL::D3DCOLOR ColorKey; -} g_OverlayProxy; - -// D3D based variables -static GUID g_ddguid; // DirectDraw driver GUID -static XTL::IDirect3D *g_pDirect3D = nullptr; -static XTL::D3DCAPS g_D3DCaps = {}; // Direct3D Caps - -// wireframe toggle -static int g_iWireframe = 0; - -// build version -extern uint32 g_BuildVersion; - -typedef uint64_t resource_key_t; - extern void UpdateFPSCounter(); -// current active index buffer -static DWORD g_dwBaseVertexIndex = 0;// current active index buffer base index +#define CXBX_D3DCOMMON_IDENTIFYING_MASK (X_D3DCOMMON_TYPE_MASK | X_D3DCOMMON_D3DCREATED) -// current active vertex stream -static XTL::X_D3DVertexBuffer *g_pVertexBuffer = NULL; // current active vertex buffer -static XTL::IDirect3DVertexBuffer *g_pDummyBuffer = NULL; // Dummy buffer, used to set unused stream sources with -static DWORD g_dwLastSetStream = 0; // The last stream set by D3DDevice::SetStreamSource +typedef struct resource_key_hash { + // All Xbox X_D3DResource structs have these fields : + DWORD Common; // We set this to the CXBX_D3DCOMMON_IDENTIFYING_MASK bits of the source Common field + DWORD Data; // We set this as-is to a copy of the source Data field + // DWORD Lock; // We leave away the source Lock field, since it's entirely volatile (not deterministic) + union { + struct { + // For non-pixel-containers, we set the Xbox resource address for now (TODO : Come up with something better) : + xbaddr ResourceAddr; // We set this as-is + }; + struct { + // For XTL::X_D3DPixelContainer's we also set these fields : + DWORD Format; // We set this as-is + DWORD Size; // We set this as-is + // For X_D3DFMT_P8 paletized pixel-containers, we also set this field : + uint64_t PaletteHash; + }; + }; -// current vertical blank information -static XTL::D3DVBLANKDATA g_VBData = {0}; -static DWORD g_VBLastSwap = 0; + // These operator overloads are required to use resource_key_t in resource_cache_t : + bool operator==(const struct resource_key_hash& other) const + { + return (Common == other.Common) + && (Data == other.Data) + && (Format == other.Format) + && (Size == other.Size) + && (PaletteHash == other.PaletteHash); + // Note : ResourceAddr doesn't need comparison, since it's union'ed with Format,Size,PaletteHash already + } -// current swap information -static XTL::D3DSWAPDATA g_SwapData = {0}; -static DWORD g_SwapLast = 0; - -// cached Direct3D state variable(s) -static XTL::IDirect3DIndexBuffer *pClosingLineLoopIndexBuffer = nullptr; - -static XTL::IDirect3DIndexBuffer *pQuadToTriangleD3DIndexBuffer = nullptr; -static UINT QuadToTriangleD3DIndexBuffer_Size = 0; // = NrOfQuadVertices - -static XTL::INDEX16 *pQuadToTriangleIndexBuffer = nullptr; -static UINT QuadToTriangleIndexBuffer_Size = 0; // = NrOfQuadVertices - -static XTL::X_D3DSurface *g_XboxBackBufferSurface = NULL; -static XTL::X_D3DSurface *g_pXboxRenderTarget = NULL; -static XTL::X_D3DSurface *g_pXboxDepthStencil = NULL; -static bool g_bColorSpaceConvertYuvToRgb = false; -static DWORD g_dwVertexShaderUsage = 0; -static DWORD g_VertexShaderSlots[136]; - -DWORD g_XboxBaseVertexIndex = 0; - - -// Active D3D Vertex Streams (and strides) -XTL::X_D3DVertexBuffer*g_D3DStreams[16]; -UINT g_D3DStreamStrides[16]; - -// cached palette pointer -static PVOID g_pCurrentPalette[TEXTURE_STAGES] = { nullptr, nullptr, nullptr, nullptr }; - -static XTL::X_VERTEXSHADERCONSTANTMODE g_VertexShaderConstantMode = X_D3DSCM_192CONSTANTS; - -// cached Direct3D tiles -XTL::X_D3DTILE XTL::EmuD3DTileCache[0x08] = {0}; - -// cached active texture -XTL::X_D3DBaseTexture *XTL::EmuD3DActiveTexture[TEXTURE_STAGES] = {0,0,0,0}; -XTL::X_D3DBaseTexture CxbxActiveTextureCopies[TEXTURE_STAGES] = {}; + // See https://marknelson.us/posts/2011/09/03/hash-functions-for-c-unordered-containers.html + size_t operator()(const struct resource_key_hash& value) const + { + return (size_t)ComputeHash((void*)&value, sizeof(value)); + } +} resource_key_t; // information passed to the create device proxy thread struct EmuD3D8CreateDeviceProxyData { // Set by EmuD3DInit() XTL::UINT Adapter; - XTL::D3DDEVTYPE DeviceType; + D3DDEVTYPE DeviceType; HWND hFocusWindow; // Set byt EMUPATCH(Direct3D_CreateDevice) XTL::X_D3DPRESENT_PARAMETERS XboxPresentationParameters; @@ -206,40 +254,79 @@ struct EmuD3D8CreateDeviceProxyData volatile bool bCreate; // false : release // Set by EmuCreateDeviceProxy() XTL::DWORD BehaviorFlags; - XTL::D3DPRESENT_PARAMETERS HostPresentationParameters; + D3DPRESENT_PARAMETERS HostPresentationParameters; volatile HRESULT hRet; } g_EmuCDPD = {0}; -#ifdef _DEBUG_TRACE - #define DEBUG_D3DRESULT(hRet, message) \ do { \ - if (FAILED(hRet)) \ - if(g_bPrintfOn) \ - printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \ + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { \ + if (FAILED(hRet)) \ + if(g_bPrintfOn) \ + printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \ + } \ } while (0) -#else +// Declare trampolines +#define XB_TRAMPOLINES(XB_MACRO) \ + XB_MACRO(HRESULT, WINAPI, D3DDevice_CreateVertexShader, (CONST DWORD*, CONST DWORD*, DWORD*, DWORD) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_DeleteVertexShader, (DWORD) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_GetBackBuffer, (INT, D3DBACKBUFFER_TYPE, XTL::X_D3DSurface**) ); \ + XB_MACRO(XTL::X_D3DSurface*, WINAPI, D3DDevice_GetBackBuffer2, (INT) ); \ + XB_MACRO(HRESULT, WINAPI, D3DDevice_GetDepthStencilSurface, (XTL::X_D3DSurface**) ); \ + XB_MACRO(XTL::X_D3DSurface*, WINAPI, D3DDevice_GetDepthStencilSurface2, (VOID) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_GetDisplayMode, (XTL::X_D3DDISPLAYMODE*) ); \ + XB_MACRO(HRESULT, WINAPI, D3DDevice_GetRenderTarget, (XTL::X_D3DSurface**) ); \ + XB_MACRO(XTL::X_D3DSurface*, WINAPI, D3DDevice_GetRenderTarget2, (VOID) ); \ + XB_MACRO(HRESULT, WINAPI, D3DDevice_LightEnable, (DWORD, BOOL) ); \ + /*XB_MACRO(VOID, WINAPI, D3DDevice_LoadVertexShader, (DWORD, DWORD) );*/\ + /*XB_MACRO(VOID, WINAPI, D3DDevice_LoadVertexShaderProgram, (CONST DWORD*, DWORD) );*/\ + /*XB_MACRO(VOID, __stdcall, D3DDevice_LoadVertexShader_0, () );*/\ + /*XB_MACRO(VOID, WINAPI, D3DDevice_LoadVertexShader_4, (DWORD) );*/\ + XB_MACRO(HRESULT, WINAPI, D3DDevice_Reset, (XTL::X_D3DPRESENT_PARAMETERS*) ); \ + /*XB_MACRO(VOID, WINAPI, D3DDevice_SelectVertexShader, (DWORD, DWORD) );*/\ + /*XB_MACRO(VOID, __stdcall, D3DDevice_SelectVertexShader_0, () );*/\ + /*XB_MACRO(VOID, __stdcall, D3DDevice_SelectVertexShader_4, (DWORD) );*/\ + /*XB_MACRO(VOID, WINAPI, D3DDevice_SetGammaRamp, (DWORD, CONST X_D3DGAMMARAMP*) );*/\ + XB_MACRO(VOID, WINAPI, D3DDevice_SetIndices, (XTL::X_D3DIndexBuffer*, UINT) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetIndices_4, (UINT) ); \ + XB_MACRO(HRESULT, WINAPI, D3DDevice_SetLight, (DWORD, CONST XTL::X_D3DLIGHT8*) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetPixelShader, (DWORD) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetPixelShader_0, () ); \ + XB_MACRO(VOID, __fastcall, D3DDevice_SetRenderState_Simple, (DWORD, DWORD) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetRenderTarget, (XTL::X_D3DSurface*, XTL::X_D3DSurface*) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetStreamSource, (UINT, XTL::X_D3DVertexBuffer*, UINT) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetStreamSource_4, (UINT, XTL::X_D3DVertexBuffer*, UINT) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetStreamSource_8, (XTL::X_D3DVertexBuffer*, UINT) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetTexture, (DWORD, XTL::X_D3DBaseTexture*) ); \ + XB_MACRO(VOID, WINAPI, D3DDevice_SetTexture_4, (XTL::X_D3DBaseTexture*) ); \ + /*XB_MACRO(VOID, WINAPI, D3DDevice_SetVertexShader, (DWORD) );*/\ + /*XB_MACRO(VOID, WINAPI, D3DDevice_SetVertexShaderInput, (DWORD, UINT, XTL::X_STREAMINPUT*) );*/\ + XB_MACRO(VOID, WINAPI, D3DDevice_SetViewport, (CONST XTL::X_D3DVIEWPORT8*) ); \ + XB_MACRO(VOID, WINAPI, D3D_DestroyResource, (XTL::X_D3DResource*) ); \ + XB_MACRO(VOID, WINAPI, D3D_DestroyResource__LTCG, (VOID) ); \ + XB_MACRO(HRESULT, WINAPI, Direct3D_CreateDevice, (UINT, D3DDEVTYPE, HWND, DWORD, XTL::X_D3DPRESENT_PARAMETERS*, IDirect3DDevice**) ); \ + XB_MACRO(HRESULT, WINAPI, Direct3D_CreateDevice_16, (UINT, D3DDEVTYPE, HWND, XTL::X_D3DPRESENT_PARAMETERS*) ); \ + XB_MACRO(HRESULT, WINAPI, Direct3D_CreateDevice_4, (XTL::X_D3DPRESENT_PARAMETERS*) ); \ + XB_MACRO(VOID, WINAPI, Lock2DSurface, (XTL::X_D3DPixelContainer*, D3DCUBEMAP_FACES, UINT, D3DLOCKED_RECT*, RECT*, DWORD) ); \ + XB_MACRO(VOID, WINAPI, Lock3DSurface, (XTL::X_D3DPixelContainer*, UINT, D3DLOCKED_BOX*, D3DBOX*, DWORD) ); \ -#define DEBUG_D3DRESULT(hRet, message) \ - do { \ - if (FAILED(hRet)) \ - if(g_bPrintfOn) \ - DbgPrintf("%s : %s D3D error (0x%.08X: %s)\n", __func__, message, hRet, D3DErrorString(hRet)); \ - } while (0) +XB_TRAMPOLINES(XB_trampoline_declare); -#endif +void LookupTrampolines() +{ + XB_TRAMPOLINES(XB_trampoline_lookup); +} -// TODO: This should be a D3DDevice structure -DWORD* g_XboxD3DDevice; +#undef XB_TRAMPOLINES const char *CxbxGetErrorDescription(HRESULT hResult) { // TODO : For D3D9, Use DXGetErrorDescription9(hResult) (requires another DLL though) - // See : http://www.fairyengine.com/articles/dxmultiviews.htm - // and : http://www.gamedev.net/community/forums/showfaq.asp?forum_id=10 - // and : http://www.gamedev.net/community/forums/topic.asp?topic_id=16157 + // See : https://www.fairyengine.com/articles/dxmultiviews.htm + // and : https://web.archive.org/web/20101231193248/https://www.gamedev.net/community/forums/showfaq.asp?forum_id=10 + // and : https://www.gamedev.net/community/forums/topic.asp?topic_id=16157 // But https://blogs.msdn.microsoft.com/chuckw/2012/04/24/wheres-dxerr-lib/ // suggests to use FormatMessage with FORMAT_MESSAGE_FROM_SYSTEM for DirectX errors switch (hResult) @@ -460,10 +547,9 @@ const char *CxbxGetErrorDescription(HRESULT hResult) return nullptr; } + const char *D3DErrorString(HRESULT hResult) { - using namespace XTL; - static char buffer[1024]; buffer[0] = 0; // Reset static buffer! @@ -483,11 +569,11 @@ const char *D3DErrorString(HRESULT hResult) return buffer; } -VOID XTL::CxbxInitWindow(bool bFullInit) +VOID CxbxInitWindow(bool bFullInit) { - g_EmuShared->GetXBVideo(&g_XBVideo); + g_EmuShared->GetVideoSettings(&g_XBVideo); - if(g_XBVideo.GetFullscreen()) + if(g_XBVideo.bFullScreen) CxbxKrnl_hEmuParent = NULL; // create timing thread @@ -495,7 +581,7 @@ VOID XTL::CxbxInitWindow(bool bFullInit) { DWORD dwThreadId; - HANDLE hThread = CreateThread(NULL, NULL, EmuUpdateTickCount, NULL, NULL, &dwThreadId); + HANDLE hThread = CreateThread(nullptr, 0, EmuUpdateTickCount, nullptr, 0, &dwThreadId); // We set the priority of this thread a bit higher, to assure reliable timing : SetThreadPriority(hThread, THREAD_PRIORITY_ABOVE_NORMAL); @@ -506,7 +592,7 @@ VOID XTL::CxbxInitWindow(bool bFullInit) // create vblank handling thread { dwThreadId = 0; - {hThread :=} CreateThread(NULL, 0, EmuThreadHandleVBlank, NULL, 0, &dwThreadId); + {hThread :=} CreateThread(nullptr, 0, EmuThreadHandleVBlank, nullptr, 0, &dwThreadId); } */ // create window message processing thread @@ -515,25 +601,20 @@ VOID XTL::CxbxInitWindow(bool bFullInit) g_bRenderWindowActive = false; - HANDLE hRenderWindowThread = CreateThread(NULL, NULL, EmuRenderWindow, NULL, NULL, &dwThreadId); + HANDLE hRenderWindowThread = CreateThread(nullptr, 0, EmuRenderWindow, nullptr, 0, &dwThreadId); if (hRenderWindowThread == NULL) { char szBuffer[1024] = { 0 }; sprintf(szBuffer, "Creating EmuRenderWindowThread Failed: %08X", GetLastError()); - CxbxPopupMessage(CxbxMsgDlgIcon_Error, szBuffer); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, szBuffer); EmuShared::Cleanup(); ExitProcess(0); } - // Ported from Dxbx : - // If possible, assign this thread to another core than the one that runs Xbox1 code : - if (bFullInit) - SetThreadAffinityMask(hRenderWindowThread, g_CPUOthers); - while(!g_bRenderWindowActive) - SwitchToThread(); + Sleep(0); - SwitchToThread(); + Sleep(0); } SetFocus(g_hEmuWindow); @@ -542,7 +623,7 @@ VOID XTL::CxbxInitWindow(bool bFullInit) void DrawUEM(HWND hWnd) { // Draw the universal error message (UEM) - // See http://xboxdevwiki.net/Fatal_Error + // See https://xboxdevwiki.net/Fatal_Error // Only call this from WM_PAINT message! PAINTSTRUCT ps; @@ -565,18 +646,16 @@ void DrawUEM(HWND hWnd) SetTextColor(hMemDC, RGB(0, 204, 0)); - wchar_t buff[500]; - LoadStringW(GetModuleHandle(NULL), IDS_UEM, buff, sizeof(buff) / sizeof(wchar_t)); - std::wstring wstr(buff); + std::wstring utf16str = utf8_to_utf16(uem_str.c_str()); // Unfortunately, DrawTextW doesn't support vertical alignemnt, so we have to do the calculation // ourselves. See here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/abd89aae-16a0-41c6-8db6-b119ea90b42a/win32-drawtext-how-center-in-vertical-with-new-lines-and-tabs?forum=vclanguage RECT rect = { 0, 0, 640, 480 }; RECT textrect = { 0, 0, 640, 480 }; - DrawTextW(hMemDC, wstr.c_str(), wstr.length(), &textrect, DT_CALCRECT); + DrawTextW(hMemDC, utf16str.c_str(), utf16str.length(), &textrect, DT_CALCRECT); rect.top = (rect.bottom - textrect.bottom) / 2; - DrawTextW(hMemDC, wstr.c_str(), wstr.length(), &rect, DT_CENTER); + DrawTextW(hMemDC, utf16str.c_str(), utf16str.length(), &rect, DT_CENTER); // Draw the Xbox error code @@ -603,27 +682,38 @@ void DrawUEM(HWND hWnd) EndPaint(hWnd, &ps); } -inline DWORD GetXboxCommonResourceType(const XTL::X_D3DResource *pXboxResource) +inline DWORD GetXboxCommonResourceType(const XTL::DWORD XboxResource_Common) { - // Don't pass in unassigned Xbox resources - assert(pXboxResource != NULL); - - DWORD dwCommonType = pXboxResource->Common & X_D3DCOMMON_TYPE_MASK; + DWORD dwCommonType = XboxResource_Common & X_D3DCOMMON_TYPE_MASK; return dwCommonType; } -inline XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::X_D3DPixelContainer *pXboxPixelContainer) +inline DWORD GetXboxCommonResourceType(const XTL::X_D3DResource* pXboxResource) +{ + // Don't pass in unassigned Xbox resources + assert(pXboxResource != xbnullptr); + + return GetXboxCommonResourceType(pXboxResource->Common); +} + +XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::DWORD XboxPixelContainer_Format) +{ + XTL::X_D3DFORMAT d3d_format = (XTL::X_D3DFORMAT)((XboxPixelContainer_Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT); + return d3d_format; +} + +XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::X_D3DPixelContainer *pXboxPixelContainer) { // Don't pass in unassigned Xbox pixel container - assert(pXboxPixelContainer != NULL); + assert(pXboxPixelContainer != xbnullptr); - return (XTL::X_D3DFORMAT)((pXboxPixelContainer->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT); + return GetXboxPixelContainerFormat(pXboxPixelContainer->Format); } inline int GetXboxPixelContainerDimensionCount(const XTL::X_D3DPixelContainer *pXboxPixelContainer) { // Don't pass in unassigned Xbox pixel container - assert(pXboxPixelContainer != NULL); + assert(pXboxPixelContainer != xbnullptr); return (XTL::X_D3DFORMAT)((pXboxPixelContainer->Format & X_D3DFORMAT_DIMENSION_MASK) >> X_D3DFORMAT_DIMENSION_SHIFT); } @@ -694,62 +784,75 @@ inline bool IsResourceTypeGPUReadable(const DWORD ResourceType) return false; } -inline bool IsYuvSurfaceOrTexture(const XTL::X_D3DResource *pXboxResource) +inline bool IsPaletizedTexture(const XTL::DWORD XboxPixelContainer_Format) +{ + return GetXboxPixelContainerFormat(XboxPixelContainer_Format) == XTL::X_D3DFMT_P8; +} + +#if 0 // unused +inline bool IsYuvSurfaceOrTexture(const XTL::X_D3DResource* pXboxResource) { if (GetXboxPixelContainerFormat((XTL::X_D3DPixelContainer *)pXboxResource) == XTL::X_D3DFMT_YUY2) return true; return false; } +#endif +#if 0 // unused inline bool IsXboxResourceLocked(const XTL::X_D3DResource *pXboxResource) { bool result = !!(pXboxResource->Common & X_D3DCOMMON_ISLOCKED); return result; } +#endif +#if 0 // unused inline bool IsXboxResourceD3DCreated(const XTL::X_D3DResource *pXboxResource) { bool result = !!(pXboxResource->Common & X_D3DCOMMON_D3DCREATED); return result; } +#endif void *GetDataFromXboxResource(XTL::X_D3DResource *pXboxResource) { // Don't pass in unassigned Xbox resources - if (pXboxResource == NULL) + if (pXboxResource == xbnullptr) return nullptr; xbaddr pData = pXboxResource->Data; - if (pData == NULL) + if (pData == xbnull) return nullptr; DWORD dwCommonType = GetXboxCommonResourceType(pXboxResource); if (IsResourceTypeGPUReadable(dwCommonType)) pData |= PHYSICAL_MAP_BASE; - return (uint08*)pData; + return (uint8_t*)pData; } typedef struct { - XTL::IDirect3DResource* pHostResource = nullptr; - XTL::X_D3DResource* pXboxResource = nullptr; + IDirect3DResource* pHostResource = nullptr; + XTL::X_D3DResource* pXboxResource = xbnullptr; DWORD dwXboxResourceType = 0; - void* pXboxData = nullptr; + void* pXboxData = xbnullptr; size_t szXboxDataSize = 0; - uint32_t hash = 0; + uint64_t hash = 0; bool forceRehash = false; std::chrono::time_point nextHashTime; std::chrono::milliseconds hashLifeTime = 1ms; std::chrono::time_point lastUpdate; } resource_info_t; -std::unordered_map g_XboxDirect3DResources; +typedef std::unordered_map resource_cache_t; +resource_cache_t g_Cxbx_Cached_Direct3DResources; +resource_cache_t g_Cxbx_Cached_PaletizedTextures; +VertexShaderSource g_VertexShaderSource = VertexShaderSource(); -bool IsResourceAPixelContainer(XTL::X_D3DResource* pXboxResource) +bool IsResourceAPixelContainer(XTL::DWORD XboxResource_Common) { - // assert(pXboxResource); - DWORD Type = GetXboxCommonResourceType(pXboxResource); + DWORD Type = GetXboxCommonResourceType(XboxResource_Common); switch (Type) { case X_D3DCOMMON_TYPE_TEXTURE: @@ -760,21 +863,51 @@ bool IsResourceAPixelContainer(XTL::X_D3DResource* pXboxResource) return false; } -resource_key_t GetHostResourceKey(XTL::X_D3DResource* pXboxResource) +bool IsResourceAPixelContainer(XTL::X_D3DResource* pXboxResource) { - resource_key_t key = 0; + // Don't pass in unassigned Xbox resources + assert(pXboxResource != xbnullptr); + + return IsResourceAPixelContainer(pXboxResource->Common); +} + +resource_cache_t& GetResourceCache(resource_key_t& key) +{ + return IsResourceAPixelContainer(key.Common) && IsPaletizedTexture(key.Format) + ? g_Cxbx_Cached_PaletizedTextures : g_Cxbx_Cached_Direct3DResources; +} + +resource_key_t GetHostResourceKey(XTL::X_D3DResource* pXboxResource, int iTextureStage = -1) +{ + resource_key_t key = {}; if (pXboxResource != xbnullptr) { // Initially, don't base the key on the address of the resource, but on it's uniquely identifying values - key ^= pXboxResource->Data; - key ^= (pXboxResource->Common & X_D3DCOMMON_TYPE_MASK) >> X_D3DCOMMON_TYPE_SHIFT; + key.Data = pXboxResource->Data; + key.Common = pXboxResource->Common & CXBX_D3DCOMMON_IDENTIFYING_MASK; if (IsResourceAPixelContainer(pXboxResource)) { - // Pixel containers have more values they are be identified by: - key ^= ((uint64_t)((XTL::X_D3DPixelContainer *)pXboxResource)->Format) << 24; - key ^= ((uint64_t)((XTL::X_D3DPixelContainer *)pXboxResource)->Size) << 32; - } - else { + // Pixel containers have more values they must be identified by: + auto pPixelContainer = (XTL::X_D3DPixelContainer*)pXboxResource; + key.Format = pPixelContainer->Format; + key.Size = pPixelContainer->Size; + // For paletized textures, include the current palette hash as well + if (IsPaletizedTexture(pPixelContainer->Format)) { + if (iTextureStage < 0) { + // ForceResourceRehash (called by Lock[23]DSurface) could hit this (not knowing the texture-stage) + LOG_TEST_CASE("Unknown texture stage!"); + } else { + assert(iTextureStage < XTL::X_D3DTS_STAGECOUNT); + // Protect for when this gets hit before an actual palette is set + if (g_Xbox_Palette_Size[iTextureStage] > 0) { + // This caters for palette changes (only the active one will be used, + // any intermediate changes have no effect). Obsolete palette texture + // conversions will be pruned from g_Cxbx_Cached_PaletizedTextures + key.PaletteHash = ComputeHash(g_pXbox_Palette_Data[iTextureStage], g_Xbox_Palette_Size[iTextureStage]); + } + } + } + } else { // For other resource types, do include their Xbox resource address (TODO : come up with something better) - key ^= ((uint64_t)pXboxResource) << 32; + key.ResourceAddr = (xbaddr)pXboxResource; } } @@ -784,45 +917,107 @@ resource_key_t GetHostResourceKey(XTL::X_D3DResource* pXboxResource) void FreeHostResource(resource_key_t key) { // Release the host resource and remove it from the list - auto hostResourceIterator = g_XboxDirect3DResources.find(key); - if (hostResourceIterator != g_XboxDirect3DResources.end()) { + auto& ResourceCache = GetResourceCache(key); + auto hostResourceIterator = ResourceCache.find(key); + if (hostResourceIterator != ResourceCache.end()) { if (hostResourceIterator->second.pHostResource) { (hostResourceIterator->second.pHostResource)->Release(); } - g_XboxDirect3DResources.erase(hostResourceIterator); + ResourceCache.erase(hostResourceIterator); + } +} + +void ClearResourceCache(resource_cache_t& ResourceCache) +{ + for (auto& hostResourceIterator : ResourceCache) { + if (hostResourceIterator.second.pHostResource) { + (hostResourceIterator.second.pHostResource)->Release(); + } + } + + ResourceCache.clear(); +} + +void PrunePaletizedTexturesCache() +{ + // TODO : Implement a better cache eviction algorithm (like least-recently used, or just at-random) + // Poor mans cache eviction policy: just clear it once it overflows + if (g_Cxbx_Cached_PaletizedTextures.size() >= 1500) { + ClearResourceCache(g_Cxbx_Cached_PaletizedTextures); } } void ForceResourceRehash(XTL::X_D3DResource* pXboxResource) { - auto key = GetHostResourceKey(pXboxResource); - auto it = g_XboxDirect3DResources.find(key); - if (it != g_XboxDirect3DResources.end() && it->second.pHostResource) { + auto key = GetHostResourceKey(pXboxResource); // Note : iTextureStage is unknown here! + auto& ResourceCache = GetResourceCache(key); + auto it = ResourceCache.find(key); + if (it != ResourceCache.end() && it->second.pHostResource) { it->second.forceRehash = true; } } -XTL::IDirect3DResource *GetHostResource(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0, int iTextureStage = 0) +IDirect3DResource *GetHostResource(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0, int iTextureStage = -1) { - if (pXboxResource == NULL || pXboxResource->Data == NULL) + if (pXboxResource == xbnullptr || pXboxResource->Data == xbnull) return nullptr; EmuVerifyResourceIsRegistered(pXboxResource, D3DUsage, iTextureStage, /*dwSize=*/0); - if (pXboxResource->Lock == X_D3DRESOURCE_LOCK_PALETTE) - return nullptr; - - auto key = GetHostResourceKey(pXboxResource); - auto it = g_XboxDirect3DResources.find(key); - if (it == g_XboxDirect3DResources.end() || !it->second.pHostResource) { - EmuWarning("GetHostResource: Resource not registered or does not have a host counterpart!"); + auto key = GetHostResourceKey(pXboxResource, iTextureStage); + auto& ResourceCache = GetResourceCache(key); + auto it = ResourceCache.find(key); + if (it == ResourceCache.end() || !it->second.pHostResource) { + EmuLog(LOG_LEVEL::WARNING, "GetHostResource: Resource not registered or does not have a host counterpart!"); return nullptr; } return it->second.pHostResource; } +void SetCxbxVertexShader(CxbxVertexShader* pCxbxVertexShader) { + + LOG_INIT + + HRESULT hRet; + + // Get vertex shader if we have a key + auto pHostShader = pCxbxVertexShader->VertexShaderKey + ? g_VertexShaderSource.GetShader(pCxbxVertexShader->VertexShaderKey) + : nullptr; + + // Set vertex shader + hRet = g_pD3DDevice->SetVertexShader(pHostShader); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader"); + + // Set either FVF or the vertex declaration + if (pCxbxVertexShader->HostFVF) + { + // Set the FVF + hRet = g_pD3DDevice->SetFVF(pCxbxVertexShader->HostFVF); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetFVF"); + } + else + { + // Set vertex declaration + hRet = g_pD3DDevice->SetVertexDeclaration(pCxbxVertexShader->pHostVertexDeclaration); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexDeclaration"); + } + + // Set vertex shader constants if necessary + if (pHostShader) { + // Titles can specify default values for registers via calls like SetVertexData4f + // HLSL shaders need to know whether to use vertex data or default vertex shader values + // Any register not in the vertex declaration should be set to the default value + float vertexDefaultFlags[16]; + for (int i = 0; i < 16; i++) { + vertexDefaultFlags[i] = pCxbxVertexShader->VertexShaderInfo.vRegisterInDeclaration[i] ? 0.0f : 1.0f; + } + g_pD3DDevice->SetVertexShaderConstantF(CXBX_D3DVS_CONSTREG_VREGDEFAULTS_FLAG_BASE, vertexDefaultFlags, 4); + } +} + // Forward declaration of CxbxGetPixelContainerMeasures to prevent // polluting the diff too much by reshuffling functions around VOID CxbxGetPixelContainerMeasures @@ -839,10 +1034,8 @@ VOID CxbxGetPixelContainerMeasures size_t GetXboxResourceSize(XTL::X_D3DResource* pXboxResource) { // TODO: Smart size calculation based around format of resource - switch (GetXboxCommonResourceType(pXboxResource)) { - case X_D3DCOMMON_TYPE_SURFACE: - case X_D3DCOMMON_TYPE_TEXTURE: - uint Width, Height, Depth, RowPitch, SlicePitch; + if (IsResourceAPixelContainer(pXboxResource)) { + unsigned int Width, Height, Depth, RowPitch, SlicePitch; // TODO : Accumulate all mipmap levels!!! CxbxGetPixelContainerMeasures( (XTL::X_D3DPixelContainer*)pXboxResource, @@ -855,7 +1048,7 @@ size_t GetXboxResourceSize(XTL::X_D3DResource* pXboxResource) ); return SlicePitch * Depth; - default: + } else { // Fallback to querying the allocation size, if no other calculation was present return xboxkrnl::MmQueryAllocationSize(GetDataFromXboxResource(pXboxResource)); } @@ -864,15 +1057,15 @@ size_t GetXboxResourceSize(XTL::X_D3DResource* pXboxResource) bool HostResourceRequiresUpdate(resource_key_t key, DWORD dwSize) { - auto it = g_XboxDirect3DResources.find(key); - if (it == g_XboxDirect3DResources.end() || !it->second.pXboxResource) { + auto& ResourceCache = GetResourceCache(key); + auto it = ResourceCache.find(key); + if (it == ResourceCache.end() || !it->second.pXboxResource) { return false; } // Currently, we only dynamically update Textures and Surfaces, so if our resource // isn't of these types, do nothing - DWORD type = GetXboxCommonResourceType(it->second.pXboxResource); - if (type != X_D3DCOMMON_TYPE_SURFACE && type != X_D3DCOMMON_TYPE_TEXTURE) { + if (!IsResourceAPixelContainer(it->second.pXboxResource)) { return false; } @@ -891,8 +1084,8 @@ bool HostResourceRequiresUpdate(resource_key_t key, DWORD dwSize) auto now = std::chrono::high_resolution_clock::now(); if (now > it->second.nextHashTime || it->second.forceRehash) { - uint32_t oldHash = it->second.hash; - it->second.hash = XXHash32::hash(it->second.pXboxData, it->second.szXboxDataSize, 0); + uint64_t oldHash = it->second.hash; + it->second.hash = ComputeHash(it->second.pXboxData, it->second.szXboxDataSize); if (it->second.hash != oldHash) { // The data changed, so reset the hash lifetime @@ -916,13 +1109,14 @@ bool HostResourceRequiresUpdate(resource_key_t key, DWORD dwSize) return modified; } -void SetHostResource(XTL::X_D3DResource* pXboxResource, XTL::IDirect3DResource* pHostResource, DWORD dwSize = 0) +void SetHostResource(XTL::X_D3DResource* pXboxResource, IDirect3DResource* pHostResource, int iTextureStage = -1, DWORD dwSize = 0) { - auto key = GetHostResourceKey(pXboxResource); - auto& resourceInfo = g_XboxDirect3DResources[key]; // Implicitely inserts a new entry if not already existing + auto key = GetHostResourceKey(pXboxResource, iTextureStage); + auto& ResourceCache = GetResourceCache(key); + auto& resourceInfo = ResourceCache[key]; // Implicitely inserts a new entry if not already existing if (resourceInfo.pHostResource) { - EmuWarning("SetHostResource: Overwriting an existing host resource"); + EmuLog(LOG_LEVEL::WARNING, "SetHostResource: Overwriting an existing host resource"); } resourceInfo.pHostResource = pHostResource; @@ -930,119 +1124,138 @@ void SetHostResource(XTL::X_D3DResource* pXboxResource, XTL::IDirect3DResource* resourceInfo.dwXboxResourceType = GetXboxCommonResourceType(pXboxResource); resourceInfo.pXboxData = GetDataFromXboxResource(pXboxResource); resourceInfo.szXboxDataSize = dwSize > 0 ? dwSize : GetXboxResourceSize(pXboxResource); - resourceInfo.hash = XXHash32::hash(resourceInfo.pXboxData, resourceInfo.szXboxDataSize, 0); + resourceInfo.hash = ComputeHash(resourceInfo.pXboxData, resourceInfo.szXboxDataSize); resourceInfo.hashLifeTime = 1ms; resourceInfo.lastUpdate = std::chrono::high_resolution_clock::now(); resourceInfo.nextHashTime = resourceInfo.lastUpdate + resourceInfo.hashLifeTime; resourceInfo.forceRehash = false; } -XTL::IDirect3DSurface *GetHostSurface(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0) +IDirect3DSurface *GetHostSurface(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0) { - if (pXboxResource == NULL) + if (pXboxResource == xbnullptr) return nullptr; if (GetXboxCommonResourceType(pXboxResource) != X_D3DCOMMON_TYPE_SURFACE) // Allows breakpoint below assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_SURFACE); - return (XTL::IDirect3DSurface*) GetHostResource(pXboxResource, D3DUsage); + return (IDirect3DSurface*) GetHostResource(pXboxResource, D3DUsage); } -XTL::IDirect3DBaseTexture *GetHostBaseTexture(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0, int iTextureStage = 0) +IDirect3DBaseTexture *GetHostBaseTexture(XTL::X_D3DResource *pXboxResource, DWORD D3DUsage = 0, int iTextureStage = 0) { - if (pXboxResource == NULL) + if (pXboxResource == xbnullptr) return nullptr; if (GetXboxCommonResourceType(pXboxResource) != X_D3DCOMMON_TYPE_TEXTURE) { // Allows breakpoint below - ; // TODO : Log instead of assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); - // Burnout hits this case (retreiving a surface instead of a texture) + // test-case : Burnout and Outrun 2006 hit this case (retrieving a surface instead of a texture) + // TODO : Surfaces can be set in the texture stages, instead of textures - see preparations in CxbxConvertXboxSurfaceToHostTexture + // We'll need to wrap the surface somehow before using it as a texture + LOG_TEST_CASE("GetHostBaseTexture called on a non-texture object"); + return nullptr; + // Note : We'd like to remove the above and do the following instead, + // but we can't yet since that seems to cause a "CreateCubeTexture Failed!" + // regression. The root cause for that seems to stem from the X_D3DRTYPE_SURFACE + // handling in CreateHostResource. + //assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); } - return (XTL::IDirect3DBaseTexture*)GetHostResource(pXboxResource, D3DUsage, iTextureStage); + return (IDirect3DBaseTexture*)GetHostResource(pXboxResource, D3DUsage, iTextureStage); } -XTL::IDirect3DTexture *GetHostTexture(XTL::X_D3DResource *pXboxResource, int iTextureStage = 0) +#if 0 // unused +IDirect3DTexture *GetHostTexture(XTL::X_D3DResource *pXboxResource, int iTextureStage = 0) { - return (XTL::IDirect3DTexture *)GetHostBaseTexture(pXboxResource, 0, iTextureStage); + if (pXboxResource == xbnullptr) + return nullptr; + + return (IDirect3DTexture *)GetHostBaseTexture(pXboxResource, 0, iTextureStage); + + // TODO : Check for 1 face (and 2 dimensions)? +} +#endif + +IDirect3DVolumeTexture *GetHostVolumeTexture(XTL::X_D3DResource *pXboxResource, int iTextureStage = 0) +{ + return (IDirect3DVolumeTexture *)GetHostBaseTexture(pXboxResource, 0, iTextureStage); // TODO : Check for 1 face (and 2 dimensions)? } -XTL::IDirect3DVolumeTexture *GetHostVolumeTexture(XTL::X_D3DResource *pXboxResource, int iTextureStage = 0) +#if 0 // unused +IDirect3DIndexBuffer *GetHostIndexBuffer(XTL::X_D3DResource *pXboxResource) { - return (XTL::IDirect3DVolumeTexture *)GetHostBaseTexture(pXboxResource, 0, iTextureStage); - - // TODO : Check for 1 face (and 2 dimensions)? -} - -XTL::IDirect3DIndexBuffer *GetHostIndexBuffer(XTL::X_D3DResource *pXboxResource) -{ - if (pXboxResource == NULL) + if (pXboxResource == xbnullptr) return nullptr; assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_INDEXBUFFER); - return (XTL::IDirect3DIndexBuffer*)GetHostResource(pXboxResource); + return (IDirect3DIndexBuffer*)GetHostResource(pXboxResource); } +#endif -void SetHostSurface(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DSurface *pHostSurface) +void SetHostSurface(XTL::X_D3DResource *pXboxResource, IDirect3DSurface *pHostSurface, int iTextureStage) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_SURFACE); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostSurface); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostSurface, iTextureStage); } -void SetHostTexture(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DTexture *pHostTexture) +void SetHostTexture(XTL::X_D3DResource *pXboxResource, IDirect3DTexture *pHostTexture, int iTextureStage) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostTexture); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostTexture, iTextureStage); } -void SetHostCubeTexture(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DCubeTexture *pHostCubeTexture) +void SetHostCubeTexture(XTL::X_D3DResource *pXboxResource, IDirect3DCubeTexture *pHostCubeTexture, int iTextureStage) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostCubeTexture); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostCubeTexture, iTextureStage); } -void SetHostVolumeTexture(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DVolumeTexture *pHostVolumeTexture) +void SetHostVolumeTexture(XTL::X_D3DResource *pXboxResource, IDirect3DVolumeTexture *pHostVolumeTexture, int iTextureStage) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostVolumeTexture); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostVolumeTexture, iTextureStage); } -void SetHostVolume(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DVolume *pHostVolume) +void SetHostVolume(XTL::X_D3DResource *pXboxResource, IDirect3DVolume *pHostVolume, int iTextureStage) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_TEXTURE); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostVolume); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostVolume, iTextureStage); } -void SetHostIndexBuffer(XTL::X_D3DResource *pXboxResource, XTL::IDirect3DIndexBuffer *pHostIndexBuffer) +void SetHostIndexBuffer(XTL::X_D3DResource *pXboxResource, IDirect3DIndexBuffer *pHostIndexBuffer) { - assert(pXboxResource != NULL); + assert(pXboxResource != xbnullptr); assert(GetXboxCommonResourceType(pXboxResource) == X_D3DCOMMON_TYPE_INDEXBUFFER); - SetHostResource(pXboxResource, (XTL::IDirect3DResource*)pHostIndexBuffer); + SetHostResource(pXboxResource, (IDirect3DResource*)pHostIndexBuffer); } + int XboxD3DPaletteSizeToBytes(const XTL::X_D3DPALETTESIZE Size) { +/* static int lk[4] = { - 256 * sizeof(XTL::D3DCOLOR), // D3DPALETTE_256 - 128 * sizeof(XTL::D3DCOLOR), // D3DPALETTE_128 - 64 * sizeof(XTL::D3DCOLOR), // D3DPALETTE_64 - 32 * sizeof(XTL::D3DCOLOR) // D3DPALETTE_32 + 256 * sizeof(D3DCOLOR), // D3DPALETTE_256 + 128 * sizeof(D3DCOLOR), // D3DPALETTE_128 + 64 * sizeof(D3DCOLOR), // D3DPALETTE_64 + 32 * sizeof(D3DCOLOR) // D3DPALETTE_32 }; return lk[Size]; +*/ + return (256 * sizeof(D3DCOLOR)) >> (unsigned)Size; } inline XTL::X_D3DPALETTESIZE GetXboxPaletteSize(const XTL::X_D3DPalette *pPalette) @@ -1053,7 +1266,7 @@ inline XTL::X_D3DPALETTESIZE GetXboxPaletteSize(const XTL::X_D3DPalette *pPalett return PaletteSize; } -int GetD3DResourceRefCount(XTL::IDirect3DResource *EmuResource) +int GetD3DResourceRefCount(IDirect3DResource *EmuResource) { if (EmuResource != nullptr) { @@ -1076,7 +1289,7 @@ XTL::X_D3DSurface *EmuNewD3DSurface() } */ -VOID XTL::CxbxSetPixelContainerHeader +VOID CxbxSetPixelContainerHeader ( XTL::X_D3DPixelContainer* pPixelContainer, DWORD Common, @@ -1120,7 +1333,7 @@ VOID XTL::CxbxSetPixelContainerHeader ; } -uint CxbxGetPixelContainerDepth +unsigned int CxbxGetPixelContainerDepth ( XTL::X_D3DPixelContainer *pPixelContainer ) @@ -1133,7 +1346,7 @@ uint CxbxGetPixelContainerDepth return 1; } -uint CxbxGetPixelContainerMipMapLevels +unsigned int CxbxGetPixelContainerMipMapLevels ( XTL::X_D3DPixelContainer *pPixelContainer ) @@ -1162,7 +1375,7 @@ uint32_t GetPixelContainerWidth(XTL::X_D3DPixelContainer *pPixelContainer) return Result; } -uint32_t GetPixelContainerHeigth(XTL::X_D3DPixelContainer *pPixelContainer) +uint32_t GetPixelContainerHeight(XTL::X_D3DPixelContainer *pPixelContainer) { DWORD Size = pPixelContainer->Size; uint32_t Result; @@ -1221,24 +1434,112 @@ VOID CxbxGetPixelContainerMeasures } } +void GetSurfaceFaceAndLevelWithinTexture(XTL::X_D3DSurface* pSurface, XTL::X_D3DBaseTexture* pTexture, UINT& Level, D3DCUBEMAP_FACES& Face) +{ + auto pSurfaceData = (uintptr_t)GetDataFromXboxResource(pSurface); + auto pTextureData = (uintptr_t)GetDataFromXboxResource(pTexture); + + // Fast path: If the data pointers match, this must be the first surface within the texture + if (pSurfaceData == pTextureData) { + Level = 0; + Face = D3DCUBEMAP_FACE_POSITIVE_X; + return; + } + + int numLevels = CxbxGetPixelContainerMipMapLevels(pTexture); + int numFaces = pTexture->Format & X_D3DFORMAT_CUBEMAP ? 6 : 1; + + CxbxGetPixelContainerMipMapLevels(pTexture); + + // First, we need to fetch the dimensions of both the surface and the texture, for use within our calculations + UINT textureWidth, textureHeight, textureDepth, textureRowPitch, textureSlicePitch; + CxbxGetPixelContainerMeasures(pTexture, 0, &textureWidth, &textureHeight, &textureDepth, &textureRowPitch, &textureSlicePitch); + + UINT surfaceWidth, surfaceHeight, surfaceDepth, surfaceRowPitch, surfaceSlicePitch; + CxbxGetPixelContainerMeasures(pSurface, 0, &surfaceWidth, &surfaceHeight, &surfaceDepth, &surfaceRowPitch, &surfaceSlicePitch); + + // Iterate through all faces and levels, until we find a matching pointer + bool isCompressed = EmuXBFormatIsCompressed(GetXboxPixelContainerFormat(pTexture)); + int minSize = (isCompressed) ? 4 : 1; + int cubeFaceOffset = 0; int cubeFaceSize = 0; + auto pData = pTextureData; + + for (int face = D3DCUBEMAP_FACE_POSITIVE_X; face <= numFaces; face++) { + int mipWidth = textureWidth; + int mipHeight = textureHeight; + int mipDepth = textureDepth; + int mipRowPitch = textureRowPitch; + int mipDataOffset = 0; + + for (int level = 0; level < numLevels; level++) { + if (pData == pSurfaceData) { + Level = level; + Face = (D3DCUBEMAP_FACES)face; + return; + } + + // Calculate size of this mipmap level + UINT dwMipSize = mipRowPitch * mipHeight; + if (isCompressed) { + dwMipSize /= 4; + } + + // If this is the first face, set the cube face size + if (face == D3DCUBEMAP_FACE_POSITIVE_X) { + cubeFaceSize = ROUND_UP(textureDepth * dwMipSize, X_D3DTEXTURE_CUBEFACE_ALIGNMENT); + } + + // Move to the next mip-map and calculate dimensions for the next iteration + mipDataOffset += dwMipSize; + + if (mipWidth > minSize) { + mipWidth /= 2; + mipRowPitch /= 2; + } + + if (mipHeight > minSize) { + mipHeight /= 2; + } + + if (mipDepth > 1) { + mipDepth /= 2; + } + } + + // Move to the next face + pData += cubeFaceSize; + } + + LOG_TEST_CASE("Could not find Surface within Texture, falling back to Level = 0, Face = D3DCUBEMAP_FACE_POSITIVE_X"); + Level = 0; + Face = D3DCUBEMAP_FACE_POSITIVE_X; +} + +// Wrapper function to allow calling without passing a face +void GetSurfaceFaceAndLevelWithinTexture(XTL::X_D3DSurface* pSurface, XTL::X_D3DBaseTexture* pBaseTexture, UINT& Level) +{ + D3DCUBEMAP_FACES face; + GetSurfaceFaceAndLevelWithinTexture(pSurface, pBaseTexture, Level, face); +} + bool ConvertD3DTextureToARGBBuffer( XTL::X_D3DFORMAT X_Format, uint8_t *pSrc, int SrcWidth, int SrcHeight, int SrcRowPitch, int SrcSlicePitch, uint8_t *pDst, int DstRowPitch, int DstSlicePitch, - uint uiDepth = 1, + unsigned int uiDepth = 1, int iTextureStage = 0 ) { - const XTL::FormatToARGBRow ConvertRowToARGB = EmuXBFormatComponentConverter(X_Format); + const FormatToARGBRow ConvertRowToARGB = EmuXBFormatComponentConverter(X_Format); if (ConvertRowToARGB == nullptr) return false; // Unhandled conversion uint8_t *unswizleBuffer = nullptr; - if (XTL::EmuXBFormatIsSwizzled(X_Format)) { + if (EmuXBFormatIsSwizzled(X_Format)) { unswizleBuffer = (uint8_t*)malloc(SrcSlicePitch * uiDepth); // TODO : Reuse buffer when performance is important // First we need to unswizzle the texture data - XTL::EmuUnswizzleBox( + EmuUnswizzleBox( pSrc, SrcWidth, SrcHeight, uiDepth, EmuXBFormatBytesPerPixel(X_Format), // Note : use src pitch on dest, because this is an intermediate step : @@ -1250,7 +1551,7 @@ bool ConvertD3DTextureToARGBBuffer( int AdditionalArgument; if (X_Format == XTL::X_D3DFMT_P8) - AdditionalArgument = (int)g_pCurrentPalette[iTextureStage]; + AdditionalArgument = (int)g_pXbox_Palette_Data[iTextureStage]; else AdditionalArgument = DstRowPitch; @@ -1262,7 +1563,7 @@ bool ConvertD3DTextureToARGBBuffer( uint8_t *pSrcSlice = pSrc; uint8_t *pDstSlice = pDst; - for (uint z = 0; z < uiDepth; z++) { + for (unsigned int z = 0; z < uiDepth; z++) { uint8_t *pSrcRow = pSrcSlice; uint8_t *pDstRow = pDstSlice; for (int y = 0; y < SrcHeight; y++) { @@ -1283,20 +1584,20 @@ bool ConvertD3DTextureToARGBBuffer( } // Called by WndMain::LoadGameLogo() to load game logo bitmap -uint8 *XTL::ConvertD3DTextureToARGB( +uint8_t *ConvertD3DTextureToARGB( XTL::X_D3DPixelContainer *pXboxPixelContainer, - uint8 *pSrc, + uint8_t *pSrc, int *pWidth, int *pHeight, int TextureStage // default = 0 ) { // Avoid allocating pDest when ConvertD3DTextureToARGBBuffer will fail anyway XTL::X_D3DFORMAT X_Format = GetXboxPixelContainerFormat(pXboxPixelContainer); - const XTL::FormatToARGBRow ConvertRowToARGB = EmuXBFormatComponentConverter(X_Format); + const FormatToARGBRow ConvertRowToARGB = EmuXBFormatComponentConverter(X_Format); if (ConvertRowToARGB == nullptr) return nullptr; // Unhandled conversion - uint SrcDepth, SrcRowPitch, SrcSlicePitch; + unsigned int SrcDepth, SrcRowPitch, SrcSlicePitch; CxbxGetPixelContainerMeasures( pXboxPixelContainer, 0, // dwMipMapLevel @@ -1312,7 +1613,7 @@ uint8 *XTL::ConvertD3DTextureToARGB( int DstRowPitch = (*pWidth) * sizeof(DWORD); // = sizeof ARGB pixel. TODO : Is this correct? int DstSlicePitch = DstRowPitch * (*pHeight); // TODO : Is this correct? int DstSize = DstSlicePitch * DstDepth; - uint8 *pDst = (uint8 *)malloc(DstSize); + uint8_t *pDst = (uint8_t *)malloc(DstSize); // And convert the source towards that buffer /*ignore result*/ConvertD3DTextureToARGBBuffer( @@ -1327,13 +1628,13 @@ uint8 *XTL::ConvertD3DTextureToARGB( } // Direct3D initialization (called before emulation begins) -VOID XTL::EmuD3DInit() +VOID EmuD3DInit() { // create the create device proxy thread { DWORD dwThreadId; - CreateThread(NULL, NULL, EmuCreateDeviceProxy, NULL, NULL, &dwThreadId); + CreateThread(nullptr, 0, EmuCreateDeviceProxy, nullptr, 0, &dwThreadId); // Ported from Dxbx : // If possible, assign this thread to another core than the one that runs Xbox1 code : SetThreadAffinityMask(&dwThreadId, g_CPUOthers); @@ -1342,8 +1643,8 @@ VOID XTL::EmuD3DInit() // Initialise CreateDevice Proxy Data struct { g_EmuCDPD = {0}; - g_EmuCDPD.Adapter = g_XBVideo.GetDisplayAdapter(); - g_EmuCDPD.DeviceType = (g_XBVideo.GetDirect3DDevice() == 0) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; + g_EmuCDPD.Adapter = g_XBVideo.adapter; + g_EmuCDPD.DeviceType = (g_XBVideo.direct3DDevice == 0) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; g_EmuCDPD.hFocusWindow = g_hEmuWindow; } @@ -1351,7 +1652,7 @@ VOID XTL::EmuD3DInit() { // xbox Direct3DCreate8 returns "1" always, so we need our own ptr g_pDirect3D = Direct3DCreate(D3D_SDK_VERSION); - if(g_pDirect3D == NULL) + if(g_pDirect3D == nullptr) CxbxKrnlCleanup("Could not initialize Direct3D8!"); g_pDirect3D->GetDeviceCaps(g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, &g_D3DCaps); @@ -1361,13 +1662,21 @@ VOID XTL::EmuD3DInit() std::cout << "Host D3DCaps : " << g_D3DCaps << "\n"; std::cout << "----------------------------------------\n"; } + + // AMD compatibility workaround since VS model 3.0 doesn't work as intended with Direct3D9. + { + D3DADAPTER_IDENTIFIER9 adapter_info; + HRESULT status = g_pDirect3D->GetAdapterIdentifier(g_EmuCDPD.Adapter, 0, &adapter_info); + // 1002 and 1022 are vendor ids of AMD gpus + if (status == D3D_OK && (adapter_info.VendorId == 0x1002 || adapter_info.VendorId == 0x1022)) { + g_vs_model = vs_model_2_a; + EmuLogInit(LOG_LEVEL::WARNING, "AMD GPU Detected, falling back to shader model 2.X to prevent missing polygons"); + } + } } // cleanup Direct3D -VOID XTL::EmuD3DCleanup() -{ - XTL::EmuDInputCleanup(); -} +VOID EmuD3DCleanup() {} // enumeration procedure for locating display device GUIDs static BOOL WINAPI EmuEnumDisplayDevices(GUID FAR *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hm) @@ -1397,6 +1706,7 @@ static BOOL WINAPI EmuEnumDisplayDevices(GUID FAR *lpGUID, LPSTR lpDriverDescrip static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) { CxbxSetThreadName("Cxbx Render Window"); + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); // register window class { @@ -1409,12 +1719,12 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) sizeof(WNDCLASSEX), CS_CLASSDC, EmuMsgProc, - 0, 0, GetModuleHandle(NULL), + 0, 0, GetModuleHandle(nullptr), 0, // TODO : LoadIcon(hmodule, ?) LoadCursor(NULL, IDC_ARROW), (HBRUSH)(g_hBgBrush), NULL, "CxbxRender", - NULL + nullptr }; RegisterClassEx(&wc); @@ -1422,15 +1732,31 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) // create the window { - HWND hwndParent = GetDesktopWindow(); - DWORD dwStyle = WS_POPUP; + // Peform selection if running in GUI or kernel mode first. + HWND hwndParent = (!CxbxKrnl_hEmuParent ? GetDesktopWindow() : CxbxKrnl_hEmuParent); + DWORD dwStyle = WS_POPUP; RECT windowRect = { 0 }; - if (!g_XBVideo.GetFullscreen()) { - hwndParent = CxbxKrnl_hEmuParent; - GetWindowRect(hwndParent, &windowRect); - dwStyle = (CxbxKrnl_hEmuParent == 0) ? WS_OVERLAPPEDWINDOW : WS_CHILD; - } + // Obtain the selected resolution from GUI or full desktop screen in kernel mode. + if (!GetWindowRect(hwndParent, &windowRect)) { + // Fall back resolution if failed + windowRect = { 0, 0, 640, 480 }; + } + + // Then perform additional checks if not running in full screen. + if (!g_XBVideo.bFullScreen) { + + // If running as kernel mode, force use the xbox's default resolution. + if (!CxbxKrnl_hEmuParent) { + // Xbox default resolution (standalone window is resizable by the way) + windowRect.right = 640; + windowRect.bottom = 480; + dwStyle = WS_OVERLAPPEDWINDOW; + } + else { + dwStyle = WS_CHILD; + } + } g_hEmuWindow = CreateWindow ( @@ -1440,23 +1766,19 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, - hwndParent, NULL, GetModuleHandle(NULL), NULL + hwndParent, NULL, GetModuleHandle(nullptr), nullptr ); } - ShowWindow(g_hEmuWindow, ((CxbxKrnl_hEmuParent == 0) || g_XBVideo.GetFullscreen()) ? SW_SHOWDEFAULT : SW_SHOWMAXIMIZED); + ShowWindow(g_hEmuWindow, ((CxbxKrnl_hEmuParent == 0) || g_XBVideo.bFullScreen) ? SW_SHOWDEFAULT : SW_SHOWMAXIMIZED); UpdateWindow(g_hEmuWindow); - if(!g_XBVideo.GetFullscreen() && (CxbxKrnl_hEmuParent != NULL)) + if(!g_XBVideo.bFullScreen && (CxbxKrnl_hEmuParent != NULL)) { SetFocus(CxbxKrnl_hEmuParent); } - // initialize direct input - if(!XTL::EmuDInputInit()) - CxbxKrnlCleanup("Could not initialize DirectInput!"); - - DbgPrintf("EmuD3D8: Message-Pump thread is running.\n"); + EmuLog(LOG_LEVEL::DEBUG, "Message-Pump thread is running."); SetFocus(g_hEmuWindow); @@ -1481,7 +1803,7 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) } else { - SwitchToThread(); + Sleep(0); // if we've just switched back to display off, clear buffer & display prompt if(!g_bPrintfOn && lPrintfOn) @@ -1499,7 +1821,7 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) delete dbgConsole; - CxbxKrnlCleanup(NULL); + CxbxKrnlCleanup(nullptr); } return 0; @@ -1508,7 +1830,7 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) // simple helper function void ToggleFauxFullscreen(HWND hWnd) { - if(g_XBVideo.GetFullscreen()) + if(g_XBVideo.bFullScreen) return; static LONG lRestore = 0, lRestoreEx = 0; @@ -1578,6 +1900,34 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar } break; + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case ID_SYNC_CONFIG_LOGGING: + { + // Sync run-time config log settings from GUI process. + log_sync_config(); + log_generate_active_filter_output(CXBXR_MODULE::CXBXR); + } + break; + + case ID_SYNC_CONFIG_INPUT: + { + SDL_Event UpdateInputEvent; + SDL_memset(&UpdateInputEvent, 0, sizeof(SDL_Event)); + UpdateInputEvent.type = Sdl::UpdateInputEvent_t; + UpdateInputEvent.user.data1 = new int(lParam); + SDL_PushEvent(&UpdateInputEvent); + } + break; + + default: + break; + } + } + break; + case WM_SYSKEYDOWN: { if(wParam == VK_RETURN) @@ -1588,6 +1938,16 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar { PostMessage(hWnd, WM_CLOSE, 0, 0); } + // NOTE: Windows does not send F10 key message to WM_KEYDOWN. + // Source: https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-syskeydown + else if(wParam == VK_F10) + { + ToggleFauxFullscreen(hWnd); + } + else + { + return DefWindowProc(hWnd, msg, wParam, lParam); + } } break; @@ -1596,7 +1956,7 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar /*! disable fullscreen if we are set to faux mode, and faux fullscreen is active */ if(wParam == VK_ESCAPE) { - if(g_XBVideo.GetFullscreen()) + if(g_XBVideo.bFullScreen) { SendMessage(hWnd, WM_CLOSE, 0, 0); } @@ -1605,6 +1965,10 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar ToggleFauxFullscreen(hWnd); } } + else if (wParam == VK_F1) + { + VertexBufferConverter.PrintStats(); + } else if (wParam == VK_F6) { // For some unknown reason, F6 isn't handled in WndMain::WndProc @@ -1614,15 +1978,27 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar else if(wParam == VK_F8) { g_bPrintfOn = !g_bPrintfOn; + g_EmuShared->SetIsKrnlLogEnabled(g_bPrintfOn); + LOG_THREAD_INIT; + std::cout << _logThreadPrefix << g_EnumModules2String[to_underlying(CXBXR_MODULE::CXBXR)] << "Enable log is " << g_bPrintfOn << std::endl; + ipc_send_gui_update(IPC_UPDATE_GUI::LOG_ENABLED, static_cast(g_bPrintfOn)); } - else if(wParam == VK_F10) - { - ToggleFauxFullscreen(hWnd); - } + else if (wParam == VK_F9) + { + // Toggle frame-limiting + g_bHack_UnlockFramerate = !g_bHack_UnlockFramerate; + } else if(wParam == VK_F11) { - if(g_iWireframe++ == 2) + if (g_iWireframe++ == 2) { g_iWireframe = 0; + } + + XboxRenderStates.SetWireFrameMode(g_iWireframe); + } + else + { + return DefWindowProc(hWnd, msg, wParam, lParam); } } break; @@ -1644,8 +2020,8 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case SIZE_MINIMIZED: { - if(g_XBVideo.GetFullscreen()) - CxbxKrnlCleanup(NULL); + if(g_XBVideo.bFullScreen) + CxbxKrnlCleanup(nullptr); if(!g_bEmuSuspended) { @@ -1660,6 +2036,7 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_CLOSE: DestroyWindow(hWnd); + CxbxKrnlShutDown(); break; case WM_SETFOCUS: @@ -1673,10 +2050,10 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_SETCURSOR: { - if(g_XBVideo.GetFullscreen() || g_bIsFauxFullscreen) + if(g_XBVideo.bFullScreen || g_bIsFauxFullscreen) { SetCursor(NULL); - return D3D_OK; // = 0 + return S_OK; // = Is not part of D3D8 handling. } return DefWindowProc(hWnd, msg, wParam, lParam); @@ -1687,7 +2064,7 @@ static LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar return DefWindowProc(hWnd, msg, wParam, lParam); } - return D3D_OK; // = 0 + return S_OK; // = Is not part of D3D8 handling. } std::chrono::time_point> GetNextVBlankTime() @@ -1710,7 +2087,7 @@ static DWORD WINAPI EmuUpdateTickCount(LPVOID) // since callbacks come from here InitXboxThread(g_CPUOthers); // avoid Xbox1 core for lowest possible latency - DbgPrintf("EmuD3D8: Timing thread is running.\n"); + EmuLog(LOG_LEVEL::DEBUG, "Timing thread is running."); // current vertical blank count int curvb = 0; @@ -1720,77 +2097,7 @@ static DWORD WINAPI EmuUpdateTickCount(LPVOID) while(true) { - xboxkrnl::KeTickCount = timeGetTime(); SwitchToThread(); - // - // Poll input - // - int port; - for (port = 0; port < 4;port++) { -/* int v; - - for(v=0;vHeader.dwStatus != ERROR_SUCCESS) - { - pFeedback->Header.dwStatus = ERROR_SUCCESS; - - if(pFeedback->Header.hEvent != 0) - { - SetEvent(pFeedback->Header.hEvent); - } - - //Make sure we don't check the pFeedback again, as it could be freed by the game - g_pXInputSetStateStatus[v].pFeedback = 0; - } - } - */ - - //code above is not used, could be removed. - extern XTL::X_CONTROLLER_HOST_BRIDGE g_XboxControllerHostBridge[4]; - if (g_XboxControllerHostBridge[port].hXboxDevice == 0) - continue; - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader == 0) - continue; - DWORD dwLatency = g_XboxControllerHostBridge[port].dwLatency++; - - if (dwLatency < XINPUT_SETSTATE_LATENCY) - continue; - - g_XboxControllerHostBridge[port].dwLatency = 0; - - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader->dwStatus != ERROR_SUCCESS) - { - if (g_XboxControllerHostBridge[port].pXboxFeedbackHeader->hEvent != 0) - { - SetEvent(g_XboxControllerHostBridge[port].pXboxFeedbackHeader->hEvent); - } - - g_XboxControllerHostBridge[port].pXboxFeedbackHeader->dwStatus = ERROR_SUCCESS; - } - - } // If VBlank Interval has passed, trigger VBlank callback // Note: This whole code block can be removed once NV2A interrupts are implemented @@ -1803,39 +2110,37 @@ static DWORD WINAPI EmuUpdateTickCount(LPVOID) // Increment the VBlank Counter and Wake all threads there were waiting for the VBlank to occur std::unique_lock lk(g_VBConditionMutex); - g_VBData.VBlank++; + g_Xbox_VBlankData.VBlank++; g_VBConditionVariable.notify_all(); // TODO: Fixme. This may not be right... - g_SwapData.SwapVBlank = 1; + g_Xbox_SwapData.SwapVBlank = 1; - if(g_pVBCallback != NULL) + if(g_pXbox_VerticalBlankCallback != xbnullptr) { - g_pVBCallback(&g_VBData); + g_pXbox_VerticalBlankCallback(&g_Xbox_VBlankData); } - g_VBData.Swap = 0; + g_Xbox_VBlankData.Swap = 0; // TODO: This can't be accurate... - g_SwapData.TimeUntilSwapVBlank = 0; + g_Xbox_SwapData.TimeUntilSwapVBlank = 0; // TODO: Recalculate this for PAL version if necessary. // Also, we should check the D3DPRESENT_INTERVAL value for accurracy. - // g_SwapData.TimeBetweenSwapVBlanks = 1/60; - g_SwapData.TimeBetweenSwapVBlanks = 0; + // g_Xbox_SwapData.TimeBetweenSwapVBlanks = 1/60; + g_Xbox_SwapData.TimeBetweenSwapVBlanks = 0; } } } -void UpdateDepthStencilFlags(XTL::IDirect3DSurface *pDepthStencilSurface) +void UpdateDepthStencilFlags(IDirect3DSurface *pDepthStencilSurface) { g_bHasDepth = false; g_bHasStencil = false; if (pDepthStencilSurface != nullptr) { - using namespace XTL; // Shouldn't be nescessary - D3DSURFACE_DESC Desc; pDepthStencilSurface->GetDesc(&Desc); @@ -1871,39 +2176,28 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) CxbxSetThreadName("Cxbx CreateDevice Proxy"); - DbgPrintf("EmuD3D8: CreateDevice proxy thread is running.\n"); + EmuLog(LOG_LEVEL::DEBUG, "CreateDevice proxy thread is running."); while(true) { // if we have been signalled, create the device with cached parameters if(g_EmuCDPD.bReady) { - DbgPrintf("EmuD3D8: CreateDevice proxy thread received request.\n"); + EmuLog(LOG_LEVEL::DEBUG, "CreateDevice proxy thread received request."); // only one device should be created at once if (g_pD3DDevice != nullptr) { - DbgPrintf("EmuD3D8: CreateDevice proxy thread releasing old Device.\n"); + EmuLog(LOG_LEVEL::DEBUG, "CreateDevice proxy thread releasing old Device."); g_pD3DDevice->EndScene(); - for (auto &hostResourceIterator : g_XboxDirect3DResources) { - if (hostResourceIterator.second.pHostResource) { - (hostResourceIterator.second.pHostResource)->Release(); - } - } - g_XboxDirect3DResources.clear(); + ClearResourceCache(g_Cxbx_Cached_PaletizedTextures); + ClearResourceCache(g_Cxbx_Cached_Direct3DResources); // TODO: ensure all other resources are cleaned up too g_EmuCDPD.hRet = g_pD3DDevice->Release(); - - // Address DirectX Debug Runtime reported error in _DEBUG builds - // Direct3D8: (ERROR) :Not all objects were freed: the following indicate the types of unfreed objects. - #ifndef _DEBUG - while(g_pD3DDevice->Release() != 0); - #endif - - g_pD3DDevice = nullptr; + g_pD3DDevice = nullptr; // cleanup overlay clipper if (g_pDDClipper != nullptr) { @@ -1925,62 +2219,56 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) } if (g_EmuCDPD.bCreate) { - if(g_EmuCDPD.XboxPresentationParameters.BufferSurfaces[0] != NULL) - EmuWarning("BufferSurfaces[0] : 0x%.08X", g_EmuCDPD.XboxPresentationParameters.BufferSurfaces[0]); + // Apply render scale factor for high-resolution rendering + g_RenderScaleFactor = g_XBVideo.renderScaleFactor; - if(g_EmuCDPD.XboxPresentationParameters.DepthStencilSurface != NULL) - EmuWarning("DepthStencilSurface : 0x%.08X", g_EmuCDPD.XboxPresentationParameters.DepthStencilSurface); + if(g_EmuCDPD.XboxPresentationParameters.BufferSurfaces[0] != xbnullptr) + EmuLog(LOG_LEVEL::WARNING, "BufferSurfaces[0] : 0x%.08X", g_EmuCDPD.XboxPresentationParameters.BufferSurfaces[0]); + + if(g_EmuCDPD.XboxPresentationParameters.DepthStencilSurface != xbnullptr) + EmuLog(LOG_LEVEL::WARNING, "DepthStencilSurface : 0x%.08X", g_EmuCDPD.XboxPresentationParameters.DepthStencilSurface); // Make a binary copy of the Xbox D3DPRESENT_PARAMETERS - memcpy(&g_EmuCDPD.HostPresentationParameters, &(g_EmuCDPD.XboxPresentationParameters), sizeof(XTL::D3DPRESENT_PARAMETERS)); + memcpy(&g_EmuCDPD.HostPresentationParameters, &(g_EmuCDPD.XboxPresentationParameters), sizeof(D3DPRESENT_PARAMETERS)); // make adjustments to parameters to make sense with windows Direct3D { - g_EmuCDPD.HostPresentationParameters.Windowed = !g_XBVideo.GetFullscreen(); + g_EmuCDPD.HostPresentationParameters.Windowed = !g_XBVideo.bFullScreen; - if(g_XBVideo.GetVSync()) -#ifdef CXBX_USE_D3D9 - g_EmuCDPD.HostPresentationParameters.SwapEffect = XTL::D3DSWAPEFFECT_COPY; -#else - g_EmuCDPD.HostPresentationParameters.SwapEffect = XTL::D3DSWAPEFFECT_COPY_VSYNC; -#endif + // TODO: Investigate the best option for this + g_EmuCDPD.HostPresentationParameters.SwapEffect = D3DSWAPEFFECT_COPY; - g_EmuCDPD.HostPresentationParameters.BackBufferFormat = XTL::EmuXB2PC_D3DFormat(g_EmuCDPD.XboxPresentationParameters.BackBufferFormat); - g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat = XTL::EmuXB2PC_D3DFormat(g_EmuCDPD.XboxPresentationParameters.AutoDepthStencilFormat); + g_EmuCDPD.HostPresentationParameters.BackBufferFormat = EmuXB2PC_D3DFormat(g_EmuCDPD.XboxPresentationParameters.BackBufferFormat); + g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat = EmuXB2PC_D3DFormat(g_EmuCDPD.XboxPresentationParameters.AutoDepthStencilFormat); - if(!g_XBVideo.GetVSync() && (g_D3DCaps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) && g_XBVideo.GetFullscreen()) - g_EmuCDPD.HostPresentationParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - else - { - if(g_D3DCaps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE && g_XBVideo.GetFullscreen()) - g_EmuCDPD.HostPresentationParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE; - else - g_EmuCDPD.HostPresentationParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } + g_EmuCDPD.HostPresentationParameters.PresentationInterval = g_XBVideo.bVSync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; + g_Xbox_PresentationInterval_Default = g_EmuCDPD.XboxPresentationParameters.PresentationInterval; // HACK: Disable Tripple Buffering for now... // TODO: Enumerate maximum BackBufferCount if possible. if(g_EmuCDPD.XboxPresentationParameters.BackBufferCount > 1) { - EmuWarning("Limiting BackBufferCount to 1..."); + EmuLog(LOG_LEVEL::WARNING, "Limiting BackBufferCount to 1..."); g_EmuCDPD.HostPresentationParameters.BackBufferCount = 1; } - // We ignore multisampling completely for now + // We disable multisampling on the host backbuffer completely for now // It causes issues with backbuffer locking. - // NOTE: It is possible to fix multisampling by having the host backbuffer normal size, the Xbox backbuffer being multisamples - // and scaling that way, but that can be done as a future PR - g_EmuCDPD.HostPresentationParameters.MultiSampleType = XTL::D3DMULTISAMPLE_NONE; + // NOTE: multisampling is could potentially be implemented by having the host backbuffer normal size + // the Xbox backbuffer being multisampled and scaled during blit + g_EmuCDPD.HostPresentationParameters.MultiSampleType = D3DMULTISAMPLE_NONE; + g_EmuCDPD.HostPresentationParameters.MultiSampleQuality = 0; + /* if(g_EmuCDPD.XboxPresentationParameters.MultiSampleType != 0) { // TODO: Check card for multisampling abilities if(g_EmuCDPD.XboxPresentationParameters.MultiSampleType == XTL::X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_QUINCUNX) // = 0x00001121 = 4385 // Test-case : Galleon - g_EmuCDPD.HostPresentationParameters.MultiSampleType = XTL::D3DMULTISAMPLE_2_SAMPLES; + g_EmuCDPD.HostPresentationParameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; else { // CxbxKrnlCleanup("Unknown MultiSampleType (0x%.08X)", g_EmuCDPD.XboxPresentationParameters.MultiSampleType); - EmuWarning("MultiSampleType 0x%.08X is not supported!", g_EmuCDPD.XboxPresentationParameters.MultiSampleType); - g_EmuCDPD.HostPresentationParameters.MultiSampleType = XTL::D3DMULTISAMPLE_NONE; + EmuLog(LOG_LEVEL::WARNING, "MultiSampleType 0x%.08X is not supported!", g_EmuCDPD.XboxPresentationParameters.MultiSampleType); + g_EmuCDPD.HostPresentationParameters.MultiSampleType = D3DMULTISAMPLE_NONE; } }*/ @@ -1989,18 +2277,18 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) // retrieve resolution from configuration if(g_EmuCDPD.HostPresentationParameters.Windowed) { - const char* resolution = g_XBVideo.GetVideoResolution(); + const char* resolution = g_XBVideo.szVideoResolution; if (2 != sscanf(resolution, "%u x %u", &g_EmuCDPD.HostPresentationParameters.BackBufferWidth, &g_EmuCDPD.HostPresentationParameters.BackBufferHeight)) { - DbgPrintf("EmuCreateDeviceProxy: Couldn't parse resolution : %s.\n", resolution); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Couldn't parse resolution : %s.", resolution); } else { if (g_EmuCDPD.HostPresentationParameters.BackBufferWidth == 640) - DbgPrintf("EmuCreateDeviceProxy: Default width wasn't updated.\n"); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Default width wasn't updated."); if (g_EmuCDPD.HostPresentationParameters.BackBufferWidth == 480) - DbgPrintf("EmuCreateDeviceProxy: Default height wasn't updated.\n"); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Default height wasn't updated."); } - XTL::D3DDISPLAYMODE D3DDisplayMode; + D3DDISPLAYMODE D3DDisplayMode; g_pDirect3D->GetAdapterDisplayMode(g_EmuCDPD.Adapter, &D3DDisplayMode); @@ -2011,60 +2299,78 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) { char szBackBufferFormat[16] = {}; - const char* resolution = g_XBVideo.GetVideoResolution(); + const char* resolution = g_XBVideo.szVideoResolution; if (4 != sscanf(resolution, "%u x %u %*dbit %s (%u hz)", &g_EmuCDPD.HostPresentationParameters.BackBufferWidth, &g_EmuCDPD.HostPresentationParameters.BackBufferHeight, szBackBufferFormat, &g_EmuCDPD.HostPresentationParameters.FullScreen_RefreshRateInHz)) { - DbgPrintf("EmuCreateDeviceProxy: Couldn't parse resolution : %s.\n", resolution); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Couldn't parse resolution : %s.", resolution); } else { if (g_EmuCDPD.HostPresentationParameters.BackBufferWidth == 640) - DbgPrintf("EmuCreateDeviceProxy: Default width wasn't updated.\n"); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Default width wasn't updated."); if (g_EmuCDPD.HostPresentationParameters.BackBufferWidth == 480) - DbgPrintf("EmuCreateDeviceProxy: Default height wasn't updated.\n"); + EmuLog(LOG_LEVEL::DEBUG, "EmuCreateDeviceProxy: Default height wasn't updated."); } if(strcmp(szBackBufferFormat, "x1r5g5b5") == 0) - g_EmuCDPD.HostPresentationParameters.BackBufferFormat = XTL::D3DFMT_X1R5G5B5; + g_EmuCDPD.HostPresentationParameters.BackBufferFormat = D3DFMT_X1R5G5B5; else if(strcmp(szBackBufferFormat, "r5g6r5") == 0) - g_EmuCDPD.HostPresentationParameters.BackBufferFormat = XTL::D3DFMT_R5G6B5; + g_EmuCDPD.HostPresentationParameters.BackBufferFormat = D3DFMT_R5G6B5; else if(strcmp(szBackBufferFormat, "x8r8g8b8") == 0) - g_EmuCDPD.HostPresentationParameters.BackBufferFormat = XTL::D3DFMT_X8R8G8B8; + g_EmuCDPD.HostPresentationParameters.BackBufferFormat = D3DFMT_X8R8G8B8; else if(strcmp(szBackBufferFormat, "a8r8g8b8") == 0) - g_EmuCDPD.HostPresentationParameters.BackBufferFormat = XTL::D3DFMT_A8R8G8B8; + g_EmuCDPD.HostPresentationParameters.BackBufferFormat = D3DFMT_A8R8G8B8; } } // detect vertex processing capabilities - if((g_D3DCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) && g_EmuCDPD.DeviceType == XTL::D3DDEVTYPE_HAL) + if((g_D3DCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) && g_EmuCDPD.DeviceType == D3DDEVTYPE_HAL) { - DbgPrintf("EmuD3D8: Using hardware vertex processing\n"); + EmuLog(LOG_LEVEL::DEBUG, "Using hardware vertex processing"); g_EmuCDPD.BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING; - g_dwVertexShaderUsage = 0; + // Unused : g_dwVertexShaderUsage = 0; } else { - DbgPrintf("EmuD3D8: Using software vertex processing\n"); + EmuLog(LOG_LEVEL::DEBUG, "Using software vertex processing"); g_EmuCDPD.BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING; - g_dwVertexShaderUsage = D3DUSAGE_SOFTWAREPROCESSING; + // Unused : g_dwVertexShaderUsage = D3DUSAGE_SOFTWAREPROCESSING; } // Dxbx addition : Prevent Direct3D from changing the FPU Control word : g_EmuCDPD.BehaviorFlags |= D3DCREATE_FPU_PRESERVE; - // Address debug DirectX runtime warning in _DEBUG builds // Direct3D8: (WARN) :Device that was created without D3DCREATE_MULTITHREADED is being used by a thread other than the creation thread. - #ifdef _DEBUG - g_EmuCDPD.BehaviorFlags |= D3DCREATE_MULTITHREADED; - #endif + g_EmuCDPD.BehaviorFlags |= D3DCREATE_MULTITHREADED; + + // If a depth stencil format is set, enable AutoDepthStencil + if (g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat != 0) { + g_EmuCDPD.HostPresentationParameters.EnableAutoDepthStencil = TRUE; + } + + // If the depth stencil format is unsupported by the host, use a sensible fallback + if (g_pDirect3D->CheckDeviceFormat( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + g_EmuCDPD.HostPresentationParameters.BackBufferFormat, + D3DUSAGE_DEPTHSTENCIL, + D3DRTYPE_SURFACE, + g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat) != D3D_OK) { + g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat = D3DFMT_D24S8; + } // For some reason, D3DFMT_D16_LOCKABLE as the AudoDepthStencil causes CreateDevice to fail... - if (g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat == XTL::D3DFMT_D16_LOCKABLE) { - g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat = XTL::D3DFMT_D16; + if (g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat == D3DFMT_D16_LOCKABLE) { + g_EmuCDPD.HostPresentationParameters.AutoDepthStencilFormat = D3DFMT_D16; + } + + // DirectX9 doesn't support 0 as a swap effect + if (g_EmuCDPD.HostPresentationParameters.SwapEffect == 0) { + g_EmuCDPD.HostPresentationParameters.SwapEffect = D3DSWAPEFFECT_DISCARD; } // redirect to windows Direct3D @@ -2092,50 +2398,50 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) memset(g_bSupportsFormatCubeTexture, false, sizeof(g_bSupportsFormatCubeTexture)); for (int X_Format = XTL::X_D3DFMT_L8; X_Format <= XTL::X_D3DFMT_LIN_R8G8B8A8; X_Format++) { // Only process Xbox formats that are directly mappable to host - if (!XTL::EmuXBFormatRequiresConversionToARGB((XTL::X_D3DFORMAT)X_Format)) { + if (!EmuXBFormatRequiresConversionToARGB((XTL::X_D3DFORMAT)X_Format)) { // Convert the Xbox format into host format (without warning, thanks to the above restriction) - XTL::D3DFORMAT PCFormat = XTL::EmuXB2PC_D3DFormat((XTL::X_D3DFORMAT)X_Format); - if (PCFormat != XTL::D3DFMT_UNKNOWN) { + D3DFORMAT PCFormat = EmuXB2PC_D3DFormat((XTL::X_D3DFORMAT)X_Format); + if (PCFormat != D3DFMT_UNKNOWN) { // Index with Xbox D3DFormat, because host FourCC codes are too big to be used as indices if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, 0, - XTL::D3DRTYPE_SURFACE, PCFormat)) + D3DRTYPE_SURFACE, PCFormat)) g_bSupportsFormatSurface[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, D3DUSAGE_RENDERTARGET, - XTL::D3DRTYPE_SURFACE, PCFormat)) + D3DRTYPE_SURFACE, PCFormat)) g_bSupportsFormatSurfaceRenderTarget[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - XTL::D3DRTYPE_SURFACE, PCFormat)) + D3DRTYPE_SURFACE, PCFormat)) g_bSupportsFormatSurfaceDepthStencil[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, 0, - XTL::D3DRTYPE_TEXTURE, PCFormat)) + D3DRTYPE_TEXTURE, PCFormat)) g_bSupportsFormatTexture[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, D3DUSAGE_RENDERTARGET, - XTL::D3DRTYPE_TEXTURE, PCFormat)) + D3DRTYPE_TEXTURE, PCFormat)) g_bSupportsFormatTextureRenderTarget[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - XTL::D3DRTYPE_TEXTURE, PCFormat)) + D3DRTYPE_TEXTURE, PCFormat)) g_bSupportsFormatTextureDepthStencil[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, 0, - XTL::D3DRTYPE_VOLUMETEXTURE, PCFormat)) + D3DRTYPE_VOLUMETEXTURE, PCFormat)) g_bSupportsFormatVolumeTexture[X_Format] = true; if (D3D_OK == g_pDirect3D->CheckDeviceFormat( g_EmuCDPD.Adapter, g_EmuCDPD.DeviceType, g_EmuCDPD.HostPresentationParameters.BackBufferFormat, 0, - XTL::D3DRTYPE_CUBETEXTURE, PCFormat)) + D3DRTYPE_CUBETEXTURE, PCFormat)) g_bSupportsFormatCubeTexture[X_Format] = true; } } @@ -2147,17 +2453,17 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) HRESULT hRet; // enumerate device guid for this monitor, for directdraw - hRet = XTL::DirectDrawEnumerateExA(EmuEnumDisplayDevices, NULL, DDENUM_ATTACHEDSECONDARYDEVICES); + hRet = DirectDrawEnumerateExA(EmuEnumDisplayDevices, nullptr, DDENUM_ATTACHEDSECONDARYDEVICES); DEBUG_D3DRESULT(hRet, "DirectDrawEnumerateExA"); // create DirectDraw7 { if(FAILED(hRet)) { - hRet = XTL::DirectDrawCreateEx(NULL, (void**)&g_pDD7, XTL::IID_IDirectDraw7, NULL); - DEBUG_D3DRESULT(hRet, "XTL::DirectDrawCreateEx(NULL)"); + hRet = DirectDrawCreateEx(nullptr, (void**)&g_pDD7, IID_IDirectDraw7, nullptr); + DEBUG_D3DRESULT(hRet, "DirectDrawCreateEx(NULL)"); } else { - hRet = XTL::DirectDrawCreateEx(&g_ddguid, (void**)&g_pDD7, XTL::IID_IDirectDraw7, NULL); - DEBUG_D3DRESULT(hRet, "XTL::DirectDrawCreateEx(&g_ddguid)"); + hRet = DirectDrawCreateEx(&g_ddguid, (void**)&g_pDD7, IID_IDirectDraw7, nullptr); + DEBUG_D3DRESULT(hRet, "DirectDrawCreateEx(&g_ddguid)"); } if(FAILED(hRet)) @@ -2183,7 +2489,7 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) g_pDD7->GetFourCCCodes(&dwCodes, lpCodes); for(DWORD v=0;vGetRenderTarget( -#ifdef CXBX_USE_D3D9 0, // RenderTargetIndex -#endif &pCurrentHostRenderTarget); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetRenderTarget"); - // TODO : SetHostResource(BackBuffer[0], pCurrentHostRenderTarget); + // TODO : SetHostSurface(BackBuffer[0], pCurrentHostRenderTarget); */ // update z-stencil surface cache - XTL::IDirect3DSurface *pCurrentHostDepthStencil = nullptr; - g_pD3DDevice->GetDepthStencilSurface(&pCurrentHostDepthStencil); - UpdateDepthStencilFlags(pCurrentHostDepthStencil); - if (pCurrentHostDepthStencil) { - pCurrentHostDepthStencil->Release(); + g_pD3DDevice->GetDepthStencilSurface(&g_pDefaultHostDepthBufferSurface); + UpdateDepthStencilFlags(g_pDefaultHostDepthBufferSurface); + + // Can host driver create event queries? + if (SUCCEEDED(g_pD3DDevice->CreateQuery(D3DQUERYTYPE_EVENT, nullptr))) { + // Is host GPU query creation enabled? + if (!g_bHack_DisableHostGPUQueries) { + // Create a D3D event query to handle "wait-for-idle" with + hRet = g_pD3DDevice->CreateQuery(D3DQUERYTYPE_EVENT, &g_pHostQueryWaitForIdle); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateQuery (wait for idle)"); + + // Create a D3D event query to handle "callback events" with + hRet = g_pD3DDevice->CreateQuery(D3DQUERYTYPE_EVENT, &g_pHostQueryCallbackEvent); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateQuery (callback event)"); + } + } else { + LOG_TEST_CASE("Can't CreateQuery(D3DQUERYTYPE_EVENT) on host!"); + } + + // Can host driver create occlusion queries? + g_bEnableHostQueryVisibilityTest = false; + if (SUCCEEDED(g_pD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, nullptr))) { + // Is host GPU query creation enabled? + if (!g_bHack_DisableHostGPUQueries) { + g_bEnableHostQueryVisibilityTest = true; + } else { + LOG_TEST_CASE("Disabled D3DQUERYTYPE_OCCLUSION on host!"); + } + } else { + LOG_TEST_CASE("Can't CreateQuery(D3DQUERYTYPE_OCCLUSION) on host!"); } hRet = g_pD3DDevice->CreateVertexBuffer ( - 1, 0, 0, XTL::D3DPOOL_MANAGED, + 1, 0, 0, D3DPOOL_MANAGED, &g_pDummyBuffer -#ifdef CXBX_USE_D3D9 , nullptr -#endif ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVertexBuffer"); for(int Streams = 0; Streams < 16; Streams++) { - hRet = g_pD3DDevice->SetStreamSource(Streams, g_pDummyBuffer, -#ifdef CXBX_USE_D3D9 + hRet = g_pD3DDevice->SetStreamSource(Streams, g_pDummyBuffer, 0, // OffsetInBytes -#endif 1); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetStreamSource"); } @@ -2284,6 +2609,9 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) // begin scene hRet = g_pD3DDevice->BeginScene(); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->BeginScene(2nd)"); + + // Set up cache + g_VertexShaderSource.ResetD3DDevice(g_pD3DDevice); } // signal completion @@ -2298,149 +2626,345 @@ static DWORD WINAPI EmuCreateDeviceProxy(LPVOID) // check if a resource has been registered yet (if not, register it) void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iTextureStage, DWORD dwSize); // Forward declartion to prevent restructure of code -static void EmuVerifyResourceIsRegistered(XTL::X_D3DResource *pResource, DWORD D3DUsage = 0, int iTextureStage = 0, DWORD dwSize = 0) +static void EmuVerifyResourceIsRegistered(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iTextureStage, DWORD dwSize) { // Skip resources without data - if (pResource->Data == NULL) + if (pResource->Data == xbnull) return; - auto key = GetHostResourceKey(pResource); - auto it = g_XboxDirect3DResources.find(key); - if (it != g_XboxDirect3DResources.end()) { - // Don't trash RenderTargets - // this fixes an issue where CubeMaps were broken because the surface Set in GetCubeMapSurface - // would be overwritten by the surface created in SetRenderTarget - if (D3DUsage == D3DUSAGE_RENDERTARGET) { - return; + auto key = GetHostResourceKey(pResource, iTextureStage); + auto& ResourceCache = GetResourceCache(key); + auto it = ResourceCache.find(key); + if (it != ResourceCache.end()) { + if (D3DUsage == D3DUSAGE_RENDERTARGET && IsResourceAPixelContainer(pResource) && EmuXBFormatIsRenderTarget(GetXboxPixelContainerFormat((XTL::X_D3DPixelContainer*)pResource))) { + // Render targets have special behavior: We can't trash them on guest modification + // this fixes an issue where CubeMaps were broken because the surface Set in GetCubeMapSurface + // would be overwritten by the surface created in SetRenderTarget + // However, if a non-rendertarget surface is used here, we'll need to recreate it as a render target! + auto hostResource = it->second.pHostResource; + auto xboxSurface = (XTL::X_D3DSurface*)pResource; + auto xboxTexture = (XTL::X_D3DTexture*)pResource; + auto xboxResourceType = GetXboxD3DResourceType(pResource); + + // Determine if the associated host resource is a render target already, if so, do nothing + HRESULT hRet = STATUS_INVALID_PARAMETER; // Default to an error condition, so we can use D3D_OK to check for success + D3DSURFACE_DESC surfaceDesc; + if (xboxResourceType == XTL::X_D3DRTYPE_SURFACE) { + hRet = ((IDirect3DSurface*)hostResource)->GetDesc(&surfaceDesc); + } else if (xboxResourceType == XTL::X_D3DRTYPE_TEXTURE) { + hRet = ((IDirect3DTexture*)hostResource)->GetLevelDesc(0, &surfaceDesc); + } + + // Only continue checking if we were able to get the surface desc, if it failed, we fall-through + // to previous resource management behavior + if (SUCCEEDED(hRet)) { + // If this resource is already created as a render target on the host, simply return + if (surfaceDesc.Usage & D3DUSAGE_RENDERTARGET) { + return; + } + + // The host resource is not a render target, but the Xbox surface is + // We need to re-create it as a render target + switch (xboxResourceType) { + case XTL::X_D3DRTYPE_SURFACE: { + // Free the host surface + FreeHostResource(key); + + // Free the parent texture, if present + XTL::X_D3DTexture* pParentXboxTexture = (pResource) ? (XTL::X_D3DTexture*)xboxSurface->Parent : xbnullptr; + + if (pParentXboxTexture) { + // Re-create the texture with D3DUSAGE_RENDERTARGET, this will automatically create any child-surfaces + FreeHostResource(GetHostResourceKey(pParentXboxTexture, iTextureStage)); + CreateHostResource(pParentXboxTexture, D3DUsage, iTextureStage, dwSize); + } + + // Re-create the surface with D3DUSAGE_RENDERTARGET + CreateHostResource(pResource, D3DUsage, iTextureStage, dwSize); + } break; + case XTL::X_D3DRTYPE_TEXTURE: { + auto xboxTexture = (XTL::X_D3DTexture*)pResource; + + // Free the host texture + FreeHostResource(key); + + // And re-create the texture with D3DUSAGE_RENDERTARGET + CreateHostResource(pResource, D3DUsage, iTextureStage, dwSize); + } break; + default: + LOG_TEST_CASE("Unimplemented rendertarget type"); + } + + return; + } } //check if the same key existed in the HostResource map already. if there is a old pXboxResource in the map with the same key but different resource address, it must be freed first. if (it->second.pXboxResource != pResource) { - //printf("EmuVerifyResourceIsRegistered passed in XboxResource collipse HostResource map!! key : %llX , map pXboxResource : %08X , passed in pResource : %08X \n", key, it->second.pXboxResource, pResource); - FreeHostResource(key); + //printf("EmuVerifyResourceIsRegistered passed in XboxResource collides HostResource map!! key : %llX , map pXboxResource : %08X , passed in pResource : %08X \n", key, it->second.pXboxResource, pResource); } - else - if (!HostResourceRequiresUpdate(key, dwSize)) { - return; + else { + if (!HostResourceRequiresUpdate(key, dwSize)) { + return; + } } FreeHostResource(key); } else { resource_info_t newResource; - g_XboxDirect3DResources[key] = newResource; + ResourceCache[key] = newResource; } CreateHostResource(pResource, D3DUsage, iTextureStage, dwSize); } -typedef struct { - DWORD Hash = 0; - DWORD IndexCount = 0;; - XTL::IDirect3DIndexBuffer* pHostIndexBuffer = nullptr; -} ConvertedIndexBuffer; +// TODO : Move to own file +constexpr UINT QuadToTriangleVertexCount(UINT NrOfQuadVertices) +{ + return (NrOfQuadVertices * VERTICES_PER_TRIANGLE * TRIANGLES_PER_QUAD) / VERTICES_PER_QUAD; +} -std::unordered_map g_ConvertedIndexBuffers; +// TODO : Move to own file (or argument of all users) +bool bUseClockWiseWindingOrder = true; // TODO : Should this be fetched from X_D3DRS_FRONTFACE (or X_D3DRS_CULLMODE)? + +// TODO : Move to own file +// This function convertes quad to triangle indices. +// When pXboxQuadIndexData is set, original quad indices are read from this buffer +// (this use-case is for when an indexed quad draw is to be emulated). +// When pXboxQuadIndexData is null, quad-emulating indices are generated +// (this use-case is for when a non-indexed quad draw is to be emulated). +// The number of indices to generate is specified through uNrOfTriangleIndices. +// Resulting triangle indices are written to pTriangleIndexData, which must +// be pre-allocated to fit the output data. +// (Note, this function is marked 'constexpr' to allow the compiler to optimize +// the case when pXboxQuadIndexData is null) +constexpr void CxbxConvertQuadListToTriangleListIndices( + INDEX16* pXboxQuadIndexData, + unsigned uNrOfTriangleIndices, + INDEX16* pTriangleIndexData) +{ + assert(uNrOfTriangleIndices > 0); + assert(pTriangleIndexData); + + unsigned i = 0; + unsigned j = 0; + while (i + (VERTICES_PER_TRIANGLE * TRIANGLES_PER_QUAD) <= uNrOfTriangleIndices) { + if (bUseClockWiseWindingOrder) { + // ABCD becomes ABC+CDA, so this is triangle 1 : + pTriangleIndexData[i + 0] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 0] : j + 0; // A + pTriangleIndexData[i + 1] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 1] : j + 1; // B + pTriangleIndexData[i + 2] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 2] : j + 2; // C + i += VERTICES_PER_TRIANGLE; + // And this is triangle 2 : + pTriangleIndexData[i + 0] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 2] : j + 2; // C + pTriangleIndexData[i + 1] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 3] : j + 3; // D + pTriangleIndexData[i + 2] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 0] : j + 0; // A + i += VERTICES_PER_TRIANGLE; + } else { + // ABCD becomes ADC+CBA, so this is triangle 1 : + pTriangleIndexData[i + 0] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 0] : j + 0; // A + pTriangleIndexData[i + 1] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 3] : j + 3; // D + pTriangleIndexData[i + 2] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 2] : j + 2; // C + i += VERTICES_PER_TRIANGLE; + // And this is triangle 2 : + pTriangleIndexData[i + 0] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 2] : j + 2; // C + pTriangleIndexData[i + 1] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 1] : j + 1; // B + pTriangleIndexData[i + 2] = pXboxQuadIndexData ? pXboxQuadIndexData[j + 0] : j + 0; // A + i += VERTICES_PER_TRIANGLE; + } + + // Next quad, please : + j += VERTICES_PER_QUAD; + } +} + +// TODO : Move to own file +// Called from EMUPATCH(D3DDevice_DrawIndexedVerticesUP) when PrimitiveType == X_D3DPT_QUADLIST. +// This API receives the number of vertices to draw (VertexCount), the index data that references +// vertices and a single stream of vertex data. The number of vertices to draw indicates the number +// of indices that are going to be fetched. The vertex data is referenced up to the highest index +// number present in the index data. +// To emulate drawing indexed quads, g_pD3DDevice->DrawIndexedPrimitiveUP is called on host, +// whereby the quad indices are converted to triangle indices. This implies for every four +// quad indices, we have to generate (two times three is) six triangle indices. (Note, that +// vertex data undergoes it's own Xbox-to-host conversion, independent from these indices.) +INDEX16* CxbxCreateQuadListToTriangleListIndexData(INDEX16* pXboxQuadIndexData, unsigned QuadVertexCount) +{ + UINT NrOfTriangleIndices = QuadToTriangleVertexCount(QuadVertexCount); + INDEX16* pQuadToTriangleIndexBuffer = (INDEX16*)malloc(NrOfTriangleIndices * sizeof(INDEX16)); + CxbxConvertQuadListToTriangleListIndices(pXboxQuadIndexData, NrOfTriangleIndices, pQuadToTriangleIndexBuffer); + return pQuadToTriangleIndexBuffer; +} + +// TODO : Move to own file +void CxbxReleaseQuadListToTriangleListIndexData(void* pHostIndexData) +{ + free(pHostIndexData); +} + +class ConvertedIndexBuffer { +public: + uint64_t Hash = 0; + DWORD IndexCount = 0; + IDirect3DIndexBuffer* pHostIndexBuffer = nullptr; + INDEX16 LowIndex = 0; + INDEX16 HighIndex = 0; + + ~ConvertedIndexBuffer() + { + if (pHostIndexBuffer != nullptr) { + pHostIndexBuffer->Release(); + } + } +}; + +std::unordered_map g_IndexBufferCache; void CxbxRemoveIndexBuffer(PWORD pData) { // HACK: Never Free } -void CxbxUpdateActiveIndexBuffer +IDirect3DIndexBuffer* CxbxCreateIndexBuffer(unsigned IndexCount) +{ + LOG_INIT; // Allows use of DEBUG_D3DRESULT + + IDirect3DIndexBuffer* Result = nullptr; + + // https://msdn.microsoft.com/en-us/library/windows/desktop/bb147168(v=vs.85).aspx + // "Managing Resources (Direct3D 9)" + // suggests "for resources which change with high frequency" [...] + // "D3DPOOL_DEFAULT along with D3DUSAGE_DYNAMIC should be used." + const D3DPOOL D3DPool = D3DPOOL_DEFAULT; // Was D3DPOOL_MANAGED + // https://msdn.microsoft.com/en-us/library/windows/desktop/bb172625(v=vs.85).aspx + // "Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY may suffer a severe performance penalty." + const DWORD D3DUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY; // Was D3DUSAGE_WRITEONLY + + // Create a new native index buffer of the requested size : + UINT uiIndexBufferSize = IndexCount * sizeof(INDEX16); + HRESULT hRet = g_pD3DDevice->CreateIndexBuffer( + uiIndexBufferSize, // Size of the index buffer, in bytes. + D3DUsage, + /*Format=*/D3DFMT_INDEX16, + D3DPool, + &Result, + nullptr // pSharedHandle + ); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateIndexBuffer"); + if (FAILED(hRet)) { + assert(Result == nullptr); + } + + return Result; +} + +ConvertedIndexBuffer& CxbxUpdateActiveIndexBuffer ( - PWORD pIndexData, - UINT IndexCount + INDEX16* pXboxIndexData, + unsigned XboxIndexCount, + bool bConvertQuadListToTriangleList ) { LOG_INIT; // Allows use of DEBUG_D3DRESULT - // Create a reference to the active buffer - ConvertedIndexBuffer& indexBuffer = g_ConvertedIndexBuffers[pIndexData]; + uint32_t LookupKey = (uint32_t)pXboxIndexData; + unsigned RequiredIndexCount = XboxIndexCount; - // If the size has changed, free the buffer so it will be re-created - if (indexBuffer.pHostIndexBuffer != nullptr && - indexBuffer.IndexCount < IndexCount) { - indexBuffer.pHostIndexBuffer->Release(); - indexBuffer = {}; + if (bConvertQuadListToTriangleList) { + LOG_TEST_CASE("bConvertQuadListToTriangleList"); + RequiredIndexCount = QuadToTriangleVertexCount(XboxIndexCount); + // For now, indicate the quad-to-triangles case using the otherwise + // (due to alignment) always-zero least significant bit : + LookupKey |= 1; + } + + // Poor-mans eviction policy : when exceeding treshold, clear entire cache : + if (g_IndexBufferCache.size() > 256) { + g_IndexBufferCache.clear(); // Note : ConvertedIndexBuffer destructor will release any assigned pHostIndexBuffer + } + + // Create a reference to the active buffer + ConvertedIndexBuffer& CacheEntry = g_IndexBufferCache[LookupKey]; + + // If the current index buffer size is too small, free it, so it'll get re-created + bool bNeedRepopulation = CacheEntry.IndexCount < RequiredIndexCount; + if (bNeedRepopulation) { + if (CacheEntry.pHostIndexBuffer != nullptr) + CacheEntry.pHostIndexBuffer->Release(); + + CacheEntry = {}; } // If we need to create an index buffer, do so. - if (indexBuffer.pHostIndexBuffer == nullptr) { - // https://msdn.microsoft.com/en-us/library/windows/desktop/bb147168(v=vs.85).aspx - // "Managing Resources (Direct3D 9)" - // suggests "for resources which change with high frequency" [...] - // "D3DPOOL_DEFAULT along with D3DUSAGE_DYNAMIC should be used." - const XTL::D3DPOOL D3DPool = XTL::D3DPOOL_DEFAULT; // Was XTL::D3DPOOL_MANAGED - // https://msdn.microsoft.com/en-us/library/windows/desktop/bb172625(v=vs.85).aspx - // "Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY may suffer a severe performance penalty." - const DWORD D3DUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY; // Was D3DUSAGE_WRITEONLY - // Create a new native index buffer of the above determined size : - HRESULT hRet = g_pD3DDevice->CreateIndexBuffer( - IndexCount * 2, - D3DUsage, - XTL::D3DFMT_INDEX16, - D3DPool, - &indexBuffer.pHostIndexBuffer -#ifdef CXBX_USE_D3D9 - , nullptr // pSharedHandle -#endif - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateIndexBuffer"); - - if (FAILED(hRet)) + if (CacheEntry.pHostIndexBuffer == nullptr) { + CacheEntry.pHostIndexBuffer = CxbxCreateIndexBuffer(RequiredIndexCount); + if (!CacheEntry.pHostIndexBuffer) CxbxKrnlCleanup("CxbxUpdateActiveIndexBuffer: IndexBuffer Create Failed!"); } + // TODO : Speeds this up, perhaps by hashing less often, and/or by + // doing two hashes : a small subset regularly, all data less frequently. + uint64_t uiHash = ComputeHash(pXboxIndexData, XboxIndexCount * sizeof(INDEX16)); + // If the data needs updating, do so - uint32_t uiHash = XXHash32::hash(pIndexData, IndexCount * 2, 0); - if (uiHash != indexBuffer.Hash) { + bNeedRepopulation |= (uiHash != CacheEntry.Hash); + if (bNeedRepopulation) { // Update the Index Count and the hash - indexBuffer.IndexCount = IndexCount; - indexBuffer.Hash = uiHash; + CacheEntry.IndexCount = RequiredIndexCount; + CacheEntry.Hash = uiHash; // Update the host index buffer - D3DLockData* pData = nullptr; - indexBuffer.pHostIndexBuffer->Lock(0, 0, &pData, D3DLOCK_DISCARD); - if (pData == nullptr) { + INDEX16* pHostIndexBufferData = nullptr; + HRESULT hRet = CacheEntry.pHostIndexBuffer->Lock(0, /*entire SizeToLock=*/0, (D3DLockData **)&pHostIndexBufferData, D3DLOCK_DISCARD); + DEBUG_D3DRESULT(hRet, "CacheEntry.pHostIndexBuffer->Lock"); + if (pHostIndexBufferData == nullptr) { CxbxKrnlCleanup("CxbxUpdateActiveIndexBuffer: Could not lock index buffer!"); } - DbgPrintf("CxbxUpdateActiveIndexBuffer: Copying %d indices (D3DFMT_INDEX16)\n", IndexCount); - memcpy(pData, pIndexData, IndexCount * sizeof(XTL::INDEX16)); + // Determine highest and lowest index in use : + WalkIndexBuffer(CacheEntry.LowIndex, CacheEntry.HighIndex, pXboxIndexData, XboxIndexCount); + if (bConvertQuadListToTriangleList) { + // Note, that LowIndex and HighIndex won't change due to any quad-to-triangle conversion, + // so it's less work to WalkIndexBuffer over the input instead of the converted index buffer. + EmuLog(LOG_LEVEL::DEBUG, "CxbxUpdateActiveIndexBuffer: Converting quads to %d triangle indices (D3DFMT_INDEX16)", RequiredIndexCount); + CxbxConvertQuadListToTriangleListIndices(pXboxIndexData, RequiredIndexCount, pHostIndexBufferData); + } else { + EmuLog(LOG_LEVEL::DEBUG, "CxbxUpdateActiveIndexBuffer: Copying %d indices (D3DFMT_INDEX16)", XboxIndexCount); + memcpy(pHostIndexBufferData, pXboxIndexData, XboxIndexCount * sizeof(INDEX16)); + } - indexBuffer.pHostIndexBuffer->Unlock(); + CacheEntry.pHostIndexBuffer->Unlock(); } // Activate the new native index buffer : -#ifdef CXBX_USE_D3D9 - HRESULT hRet = g_pD3DDevice->SetIndices(indexBuffer.pHostIndexBuffer); + HRESULT hRet = g_pD3DDevice->SetIndices(CacheEntry.pHostIndexBuffer); // Note : Under Direct3D 9, the BaseVertexIndex argument is moved towards DrawIndexedPrimitive -#else - HRESULT hRet = g_pD3DDevice->SetIndices(indexBuffer.pHostIndexBuffer, g_XboxBaseVertexIndex); -#endif DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetIndices"); if (FAILED(hRet)) CxbxKrnlCleanup("CxbxUpdateActiveIndexBuffer: SetIndices Failed!"); + + return CacheEntry; } -// LTCG specific Direct3D_CreateDevice function... -// This uses a custom calling convention passed unknown parameters -// Test-case: Ninja Gaiden -HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_4) +void Direct3D_CreateDevice_Start ( - X_D3DPRESENT_PARAMETERS *pPresentationParameters + XTL::X_D3DPRESENT_PARAMETERS *pPresentationParameters ) { - FUNC_EXPORTS + if (!XboxRenderStates.Init()) { + CxbxKrnlCleanup("Failed to init XboxRenderStates"); + } - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pPresentationParameters) - LOG_FUNC_END; + if (!XboxTextureStates.Init(&XboxRenderStates)) { + CxbxKrnlCleanup("Failed to init XboxTextureStates"); + } - // HACK: Disable multisampling... See comment in CreateDevice proxy for more info - pPresentationParameters->MultiSampleType = XTL::X_D3DMULTISAMPLE_NONE; + // Disable multisampling for now, this fixes an issue where GTA3 only renders to half-screen + // TODO: Find a better way of fixing this, we cannot just create larger backbuffers as it breaks + // many games, despite working in the dashboard + pPresentationParameters->MultiSampleType = XTL::X_D3DMULTISAMPLE_NONE; // create default device *before* calling Xbox Direct3D_CreateDevice trampline // to avoid hitting EMUPATCH'es that need a valid g_pD3DDevice @@ -2450,7 +2974,7 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_4) Sleep(10); // Cache parameters - memcpy(&(g_EmuCDPD.XboxPresentationParameters), pPresentationParameters, sizeof(X_D3DPRESENT_PARAMETERS)); + memcpy(&(g_EmuCDPD.XboxPresentationParameters), pPresentationParameters, sizeof(XTL::X_D3DPRESENT_PARAMETERS)); // Signal proxy thread (this will trigger EmuCreateDeviceProxy to call CreateDevice) g_EmuCDPD.bCreate = true; @@ -2460,19 +2984,102 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_4) while (g_EmuCDPD.bReady) Sleep(10); } +} + +void Direct3D_CreateDevice_End() +{ +#if 0 // Unused : + // Set g_Xbox_D3DDevice to point to the Xbox D3D Device + auto it = g_SymbolAddresses.find("D3DDEVICE"); + if (it != g_SymbolAddresses.end()) { + g_Xbox_D3DDevice = (DWORD*)it->second; + } +#endif + // If the Xbox version of CreateDevice didn't call SetRenderTarget, we must derive the default backbuffer ourselves + // This works because CreateDevice always sets the current render target to the Xbox Backbuffer + // In later XDKs, it does this inline rather than by calling D3DDevice_SetRenderTarget + // meaning our patch doesn't always get called in these cases. + // We fix the situation by calling the Xbox GetRenderTarget function, which immediately after CreateDevice + // WILL always return the Backbuffer! + // Test Case: Shin Megami Tensei: Nine + if (g_pXbox_BackBufferSurface == xbnullptr || g_pXbox_DefaultDepthStencilSurface == xbnullptr) { + // First, log the test case + LOG_TEST_CASE("Xbox CreateDevice did not call SetRenderTarget"); + } + + if (g_pXbox_BackBufferSurface == xbnullptr) { + if (XB_TRMP(D3DDevice_GetRenderTarget)) { + XB_TRMP(D3DDevice_GetRenderTarget)(&g_pXbox_BackBufferSurface); + } + else if (XB_TRMP(D3DDevice_GetRenderTarget2)) { + g_pXbox_BackBufferSurface = XB_TRMP(D3DDevice_GetRenderTarget2)(); + } + + // At this point, pRenderTarget should now point to a valid render target + // if it still doesn't, we cannot continue without crashing at draw time + if (g_pXbox_BackBufferSurface == xbnullptr) { + CxbxKrnlCleanup("Unable to determine default Xbox backbuffer"); + } + + // We must also call our SetRenderTarget patch to properly setup the host state + // Update only the Back buffer + XTL::EMUPATCH(D3DDevice_SetRenderTarget)(g_pXbox_BackBufferSurface, xbnullptr); + } + + // Now do the same, but for the default depth stencil surface + if (g_pXbox_DefaultDepthStencilSurface == xbnullptr) { + if (XB_TRMP(D3DDevice_GetDepthStencilSurface)) { + XB_TRMP(D3DDevice_GetDepthStencilSurface)(&g_pXbox_DefaultDepthStencilSurface); + } + else if (XB_TRMP(D3DDevice_GetDepthStencilSurface2)) { + g_pXbox_DefaultDepthStencilSurface = XB_TRMP(D3DDevice_GetDepthStencilSurface2)(); + } + + // At this point, g_pXbox_DefaultDepthStencilSurface should now point to a valid depth stencil + // If it doesn't, just log and carry on: Unlike RenderTarget, this situation is not fatal + if (g_pXbox_DefaultDepthStencilSurface == xbnullptr) { + LOG_TEST_CASE("Unable to determine default Xbox depth stencil"); + } else { + // Update only the depth stencil + XTL::EMUPATCH(D3DDevice_SetRenderTarget)(xbnullptr, g_pXbox_DefaultDepthStencilSurface); + } + } +} + +// LTCG specific Direct3D_CreateDevice function... +// This uses a custom calling with parameters passed in eax, ecx and the stack +// Test-case: Ninja Gaiden, Halo 2 +HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_4) +( + X_D3DPRESENT_PARAMETERS *pPresentationParameters +) +{ + DWORD BehaviorFlags; + IDirect3DDevice **ppReturnedDeviceInterface; + + __asm { + mov BehaviorFlags, eax + mov ppReturnedDeviceInterface, ecx + } + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pPresentationParameters) + LOG_FUNC_END; + + Direct3D_CreateDevice_Start(pPresentationParameters); + + HRESULT hRet = 0; // Only then call Xbox CreateDevice function - XB_trampoline(HRESULT, WINAPI, Direct3D_CreateDevice_4, (X_D3DPRESENT_PARAMETERS*)); - HRESULT hRet = XB_Direct3D_CreateDevice_4(pPresentationParameters); - - // Set g_XboxD3DDevice to point to the Xbox D3D Device - xbaddr dwD3DDevice = xbnull; - if (g_SymbolAddresses.find("D3DDEVICE") != g_SymbolAddresses.end()) { - dwD3DDevice = g_SymbolAddresses["D3DDEVICE"]; + __asm { + mov eax, BehaviorFlags + mov ecx, ppReturnedDeviceInterface + push pPresentationParameters + call XB_TRMP(Direct3D_CreateDevice_4) + mov hRet, eax } - if (dwD3DDevice != xbnull) { - g_XboxD3DDevice = *((DWORD**)dwD3DDevice); - } + + Direct3D_CreateDevice_End(); return hRet; } @@ -2488,8 +3095,6 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_16) X_D3DPRESENT_PARAMETERS *pPresentationParameters ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Adapter) LOG_FUNC_ARG(DeviceType) @@ -2497,41 +3102,44 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_16) LOG_FUNC_ARG(pPresentationParameters) LOG_FUNC_END; - // HACK: Disable multisampling... See comment in CreateDevice proxy for more info - pPresentationParameters->MultiSampleType = XTL::X_D3DMULTISAMPLE_NONE; - - // create default device *before* calling Xbox Direct3D_CreateDevice trampline - // to avoid hitting EMUPATCH'es that need a valid g_pD3DDevice - { - // Wait until proxy is done with an existing call (i highly doubt this situation will come up) - while (g_EmuCDPD.bReady) - Sleep(10); - - // Cache parameters - memcpy(&(g_EmuCDPD.XboxPresentationParameters), pPresentationParameters, sizeof(X_D3DPRESENT_PARAMETERS)); - - // Signal proxy thread (this will trigger EmuCreateDeviceProxy to call CreateDevice) - g_EmuCDPD.bCreate = true; - g_EmuCDPD.bReady = true; - - // Wait until host proxy is completed (otherwise, Xbox code could hit patches that need an assigned g_pD3DDevice) - while (g_EmuCDPD.bReady) - Sleep(10); - } + Direct3D_CreateDevice_Start(pPresentationParameters); // Only then call Xbox CreateDevice function - XB_trampoline(HRESULT, WINAPI, Direct3D_CreateDevice_16, (UINT, D3DDEVTYPE, HWND, X_D3DPRESENT_PARAMETERS*)); - HRESULT hRet = XB_Direct3D_CreateDevice_16(Adapter, DeviceType, hFocusWindow, pPresentationParameters); + HRESULT hRet = XB_TRMP(Direct3D_CreateDevice_16)(Adapter, DeviceType, hFocusWindow, pPresentationParameters); - // Set g_XboxD3DDevice to point to the Xbox D3D Device - xbaddr dwD3DDevice = g_SymbolAddresses["D3DDEVICE"]; - if (dwD3DDevice != xbnull) { - g_XboxD3DDevice = *((DWORD**)dwD3DDevice); - } + Direct3D_CreateDevice_End(); return hRet; } +// ****************************************************************** +// * patch: D3DDevice_SetIndices_4 +// LTCG specific D3DDevice_SetIndices function... +// This uses a custom calling convention where parameter is passed in EBX and Stack +// Test Case: Conker +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetIndices_4) +( + UINT BaseVertexIndex +) +{ + X_D3DIndexBuffer *pIndexData; + + __asm { + mov pIndexData, ebx + } + // Cache the base vertex index + g_Xbox_BaseVertexIndex = BaseVertexIndex; + + // Call LTCG-specific trampoline + __asm { + mov ebx, pIndexData + push BaseVertexIndex + call XB_TRMP(D3DDevice_SetIndices_4); + } +} + + // ****************************************************************** // * patch: D3DDevice_SetIndices // ****************************************************************** @@ -2541,18 +3149,15 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetIndices) UINT BaseVertexIndex ) { - FUNC_EXPORTS - - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN LOG_FUNC_ARG(pIndexData) LOG_FUNC_ARG(BaseVertexIndex) LOG_FUNC_END; // Cache the base vertex index then call the Xbox function - g_XboxBaseVertexIndex = BaseVertexIndex; + g_Xbox_BaseVertexIndex = BaseVertexIndex; - XB_trampoline(VOID, WINAPI, D3DDevice_SetIndices, (X_D3DIndexBuffer*, UINT)); - XB_D3DDevice_SetIndices(pIndexData, BaseVertexIndex); + XB_TRMP(D3DDevice_SetIndices)(pIndexData, BaseVertexIndex); } // ****************************************************************** @@ -2568,8 +3173,6 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice) IDirect3DDevice **ppReturnedDeviceInterface ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Adapter) LOG_FUNC_ARG(DeviceType) @@ -2579,48 +3182,60 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice) LOG_FUNC_ARG(ppReturnedDeviceInterface) LOG_FUNC_END; - // HACK: Disable multisampling... See comment in CreateDevice proxy for more info - pPresentationParameters->MultiSampleType = XTL::X_D3DMULTISAMPLE_NONE; - - // create default device *before* calling Xbox Direct3D_CreateDevice trampline - // to avoid hitting EMUPATCH'es that need a valid g_pD3DDevice - { - // Wait until proxy is done with an existing call (i highly doubt this situation will come up) - while (g_EmuCDPD.bReady) - Sleep(10); - - // Cache parameters - memcpy(&(g_EmuCDPD.XboxPresentationParameters), pPresentationParameters, sizeof(X_D3DPRESENT_PARAMETERS)); - - // Signal proxy thread (this will trigger EmuCreateDeviceProxy to call CreateDevice) - g_EmuCDPD.bCreate = true; - g_EmuCDPD.bReady = true; - - // Wait until host proxy is completed (otherwise, Xbox code could hit patches that need an assigned g_pD3DDevice) - while (g_EmuCDPD.bReady) - Sleep(10); - } + Direct3D_CreateDevice_Start(pPresentationParameters); // Only then call Xbox CreateDevice function - XB_trampoline(HRESULT, WINAPI, Direct3D_CreateDevice, (UINT, D3DDEVTYPE, HWND, DWORD, X_D3DPRESENT_PARAMETERS*, IDirect3DDevice**)); - HRESULT hRet = XB_Direct3D_CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); + HRESULT hRet = XB_TRMP(Direct3D_CreateDevice)(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); - // Set g_XboxD3DDevice to point to the Xbox D3D Device - xbaddr dwD3DDevice = g_SymbolAddresses["D3DDEVICE"]; - if (dwD3DDevice != xbnull) { - g_XboxD3DDevice = *((DWORD**)dwD3DDevice); - } + Direct3D_CreateDevice_End(); return hRet; } +// ****************************************************************** +// * patch: D3DDevice_Reset +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(D3DDevice_Reset) +( + X_D3DPRESENT_PARAMETERS* pPresentationParameters +) +{ + LOG_FUNC_ONE_ARG(pPresentationParameters) + + // Unlike the host version of Reset, The Xbox version does not actually reset the entire device + // Instead, it simply re-creates the backbuffer with a new configuration + // Just like CreateDevice, we need to unset the MultiSample flag for now + // This fixes the 'Render to half-screen' issue in some titles (Test Case: Max Payne, Gameplay) + // See Direct3D_CreateDevice_Start for more info + // We should leave the rest of the params as is, and let the Xbox code/surface cache take care of it for us + pPresentationParameters->MultiSampleType = XTL::X_D3DMULTISAMPLE_NONE; + + // Since Reset will call create a new backbuffer surface, we can clear our current association + // NOTE: We don't actually free the Xbox data, the Xbox side will do this for us when we call the trampoline below. + // We must not reset the values to nullptr, since the XDK will re-use the same addresses for the data headers + // (they are members of the Direct3DDevice object). if we overwrite then, the reference to the xbox backbuffer will be lost + // and we'll get a black screen. + FreeHostResource(GetHostResourceKey(g_pXbox_BackBufferSurface)); + FreeHostResource(GetHostResourceKey(g_pXbox_DefaultDepthStencilSurface)); + + // Call the Xbox Reset function to do the rest of the work for us + HRESULT hRet = XB_TRMP(D3DDevice_Reset)(pPresentationParameters); + + // Refresh the current render target and depth stencil, to apply changes made within D3DDevice_Reset + // Some XDKs do this for us, but not all do! + EMUPATCH(D3DDevice_SetRenderTarget)(g_pXbox_RenderTarget, g_pXbox_DepthStencil); + + return hRet; +} + + // ****************************************************************** // * patch: D3DDevice_GetDisplayFieldStatus // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_GetDisplayFieldStatus)(X_D3DFIELD_STATUS *pFieldStatus) { // NOTE: This can be unpatched only when NV2A does it's own VBlank and HLE _Swap function is unpatched - FUNC_EXPORTS + LOG_FUNC_ONE_ARG(pFieldStatus); @@ -2629,26 +3244,23 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetDisplayFieldStatus)(X_D3DFIELD_STATUS *pF // but we don't have an OOVPA for that. Instead, we call the Xbox implementation of // D3DDevice_GetDisplayMode and read the result - // Get a function pointer to the unpatched xbox function D3DDevice_GetDisplayMode - XB_trampoline(VOID, WINAPI, D3DDevice_GetDisplayMode, (X_D3DDISPLAYMODE*)); - X_D3DDISPLAYMODE displayMode; // If we can find the Xbox version of GetDisplayMode, use the real data returned, otherwise // use a sensible default - if (XB_D3DDevice_GetDisplayMode != nullptr) { - XB_D3DDevice_GetDisplayMode(&displayMode); + if (XB_TRMP(D3DDevice_GetDisplayMode) != nullptr) { + XB_TRMP(D3DDevice_GetDisplayMode)(&displayMode); } else { // We don't show a warning because doing so pollutes the kernel debug log as this function gets called every frame displayMode.Flags = X_D3DPRESENTFLAG_INTERLACED; } // Set the VBlank count - pFieldStatus->VBlankCount = g_VBData.VBlank; + pFieldStatus->VBlankCount = g_Xbox_VBlankData.VBlank; // If we are interlaced, return the current field, otherwise, return progressive scan if (displayMode.Flags & X_D3DPRESENTFLAG_INTERLACED) { - pFieldStatus->Field = (g_VBData.VBlank % 2 == 0) ? X_D3DFIELD_ODD : X_D3DFIELD_EVEN; + pFieldStatus->Field = (g_Xbox_VBlankData.VBlank % 2 == 0) ? X_D3DFIELD_ODD : X_D3DFIELD_EVEN; } else { pFieldStatus->Field = X_D3DFIELD_PROGRESSIVE; } @@ -2662,20 +3274,17 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetDisplayFieldStatus)(X_D3DFIELD_STATUS *pF // ****************************************************************** PDWORD WINAPI XTL::EMUPATCH(D3DDevice_BeginPush)(DWORD Count) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Count); - if (g_pPrimaryPB != nullptr) + if (g_pXbox_BeginPush_Buffer != nullptr) { - EmuWarning("D3DDevice_BeginPush called without D3DDevice_EndPush in between?!"); - delete[] g_pPrimaryPB; // prevent a memory leak + EmuLog(LOG_LEVEL::WARNING, "D3DDevice_BeginPush called without D3DDevice_EndPush in between?!"); + delete[] g_pXbox_BeginPush_Buffer; // prevent a memory leak } DWORD *pRet = new DWORD[Count]; - g_dwPrimaryPBCount = Count; - g_pPrimaryPB = pRet; + g_pXbox_BeginPush_Buffer = pRet; return pRet; } @@ -2687,23 +3296,20 @@ PDWORD WINAPI XTL::EMUPATCH(D3DDevice_BeginPush)(DWORD Count) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_BeginPush2)(DWORD Count, DWORD** ppPush) { - FUNC_EXPORTS - - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN LOG_FUNC_ARG(Count) LOG_FUNC_ARG(ppPush) LOG_FUNC_END; - if (g_pPrimaryPB != nullptr) + if (g_pXbox_BeginPush_Buffer != nullptr) { - EmuWarning("D3DDevice_BeginPush2 called without D3DDevice_EndPush in between?!"); - delete[] g_pPrimaryPB; // prevent a memory leak + EmuLog(LOG_LEVEL::WARNING, "D3DDevice_BeginPush2 called without D3DDevice_EndPush in between?!"); + delete[] g_pXbox_BeginPush_Buffer; // prevent a memory leak } DWORD *pRet = new DWORD[Count]; - g_dwPrimaryPBCount = Count; - g_pPrimaryPB = pRet; + g_pXbox_BeginPush_Buffer = pRet; *ppPush=pRet; } @@ -2713,31 +3319,48 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_BeginPush2)(DWORD Count, DWORD** ppPush) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_EndPush)(DWORD *pPush) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pPush); - if (g_pPrimaryPB == nullptr) - EmuWarning("D3DDevice_EndPush called without preceding D3DDevice_BeginPush?!"); + if (g_pXbox_BeginPush_Buffer == nullptr) + EmuLog(LOG_LEVEL::WARNING, "D3DDevice_EndPush called without preceding D3DDevice_BeginPush?!"); else { - EmuExecutePushBufferRaw(g_pPrimaryPB, g_dwPrimaryPBCount * sizeof(DWORD)); + // Note: We don't use the count from BeginPush because that specifies the *maximum* count + // rather than the count actually in the pushbuffer. + EmuExecutePushBufferRaw(g_pXbox_BeginPush_Buffer, (uintptr_t)pPush - (uintptr_t)g_pXbox_BeginPush_Buffer); - delete[] g_pPrimaryPB; - g_pPrimaryPB = nullptr; + delete[] g_pXbox_BeginPush_Buffer; + g_pXbox_BeginPush_Buffer = nullptr; } } // ****************************************************************** // * patch: D3DDevice_BeginVisibilityTest // ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_BeginVisibilityTest)() +HRESULT WINAPI XTL::EMUPATCH(D3DDevice_BeginVisibilityTest)() { - FUNC_EXPORTS - LOG_FUNC(); - LOG_UNIMPLEMENTED(); + if (g_bEnableHostQueryVisibilityTest) { + // Create a D3D occlusion query to handle "visibility test" with + IDirect3DQuery* pHostQueryVisibilityTest = nullptr; + HRESULT hRet = g_pD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &pHostQueryVisibilityTest); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateQuery (visibility test)"); + if (pHostQueryVisibilityTest != nullptr) { + hRet = pHostQueryVisibilityTest->Issue(D3DISSUE_BEGIN); + DEBUG_D3DRESULT(hRet, "g_pHostQueryVisibilityTest->Issue(D3DISSUE_BEGIN)"); + if (SUCCEEDED(hRet)) { + g_HostQueryVisibilityTests.push(pHostQueryVisibilityTest); + } else { + LOG_TEST_CASE("Failed to issue query"); + pHostQueryVisibilityTest->Release(); + } + + pHostQueryVisibilityTest = nullptr; + } + } + + return D3D_OK; } // LTCG specific D3DDevice_EndVisibilityTest function... @@ -2747,8 +3370,6 @@ HRESULT __stdcall XTL::EMUPATCH(D3DDevice_EndVisibilityTest_0) ( ) { - FUNC_EXPORTS; - DWORD Index; __asm { @@ -2766,11 +3387,32 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_EndVisibilityTest) DWORD Index ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Index); - LOG_UNIMPLEMENTED(); + if (g_bEnableHostQueryVisibilityTest) { + // Check that the dedicated storage for the given Index isn't in use + if (g_HostVisibilityTestMap[Index] != nullptr) { + return E_OUTOFMEMORY; + } + + if (g_HostQueryVisibilityTests.empty()) { + return 2088; // visibility test incomplete (a prior BeginVisibilityTest call is needed) + } + + IDirect3DQuery* pHostQueryVisibilityTest = g_HostQueryVisibilityTests.top(); + g_HostQueryVisibilityTests.pop(); + assert(pHostQueryVisibilityTest != nullptr); + + HRESULT hRet = pHostQueryVisibilityTest->Issue(D3DISSUE_END); + DEBUG_D3DRESULT(hRet, "g_pHostQueryVisibilityTest->Issue(D3DISSUE_END)"); + if (hRet == D3D_OK) { + // Associate the result of this call with the given Index + g_HostVisibilityTestMap[Index] = pHostQueryVisibilityTest; + } else { + LOG_TEST_CASE("Failed to issue query"); + pHostQueryVisibilityTest->Release(); + } + } return D3D_OK; } @@ -2780,8 +3422,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_EndVisibilityTest) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_SetBackBufferScale)(FLOAT x, FLOAT y) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(x) LOG_FUNC_ARG(y) @@ -2800,26 +3440,42 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVisibilityTestResult) ULONGLONG *pTimeStamp ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Index) LOG_FUNC_ARG(pResult) LOG_FUNC_ARG(pTimeStamp) LOG_FUNC_END; - // TODO: actually emulate this!? + if (g_bEnableHostQueryVisibilityTest) { + IDirect3DQuery* pHostQueryVisibilityTest = g_HostVisibilityTestMap[Index]; + if (pHostQueryVisibilityTest == nullptr) { + return E_OUTOFMEMORY; + } - if(pResult != 0) - *pResult = 640*480; + // In order to prevent an endless loop if the D3D device becomes lost, we pass + // the D3DGETDATA_FLUSH flag. This tells GetData to return D3DERR_DEVICELOST if + // such a situation occurs, and break out of the loop as a result. + // Note: By Cxbx's design, we cannot do drawing within this while loop in order + // to further prevent any other endless loop situations. + while (S_FALSE == pHostQueryVisibilityTest->GetData(pResult, sizeof(DWORD), D3DGETDATA_FLUSH)); - if(pTimeStamp != 0) - *pTimeStamp = 0; + g_HostVisibilityTestMap[Index] = nullptr; + pHostQueryVisibilityTest->Release(); + } else { + // Fallback to old faked result when there's no host occlusion query : + if (pResult != xbnullptr) { + *pResult = 640 * 480; // TODO : Use actual backbuffer dimensions + } + } - + if (pTimeStamp != xbnullptr) { + LOG_TEST_CASE("requested value for pTimeStamp"); + *pTimeStamp = sizeof(DWORD); // TODO : This should be an incrementing GPU-memory based DWORD-aligned memory address + } return D3D_OK; } + // LTCG specific D3DDevice_LoadVertexShader function... // This uses a custom calling convention where parameter is passed in EAX, ECX // Test-case: Aggressive Inline @@ -2827,8 +3483,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_LoadVertexShader_0) ( ) { - FUNC_EXPORTS; - DWORD Handle; DWORD Address; @@ -2847,30 +3501,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_LoadVertexShader_4) DWORD Address ) { - FUNC_EXPORTS - DWORD Handle; __asm mov Handle, eax; - //LOG_FUNC_BEGIN - // LOG_FUNC_ARG(Handle) - // LOG_FUNC_ARG(Address) - // LOG_FUNC_END; - DbgPrintf("D3DDevice_LoadVertexShader_4(Handle : %d Address : %08x);\n", Handle, Address); - - // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) - // An Xbox VertexShader contains : a 'Vshd' signature, flags, a size, a program (and constants) - // Address is the slot (offset) from which the program must be written onwards (as whole DWORDS) - // D3DDevice_LoadVertexShader pushes the program contained in the Xbox VertexShader struct to the NV2A - if(Address < 136 && VshHandleIsVertexShader(Handle)) - { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - for (DWORD i = Address; i < pVertexShader->Size; i++) - { - // TODO: This seems very fishy - g_VertexShaderSlots[i] = Handle; - } - } + LOG_FORWARD("D3DDevice_LoadVertexShader"); + return EMUPATCH(D3DDevice_LoadVertexShader)(Handle, Address); } // ****************************************************************** @@ -2882,21 +3517,18 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_LoadVertexShader) DWORD Address ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(Address) - LOG_FUNC_END; + LOG_FUNC_END; - // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) - // An Xbox VertexShader contains : a 'Vshd' signature, flags, a size, a program (and constants) + // Handle is always address of an X_D3DVertexShader struct, thus always or-ed with 1 (X_D3DFVF_RESERVED0) // Address is the slot (offset) from which the program must be written onwards (as whole DWORDS) // D3DDevice_LoadVertexShader pushes the program contained in the Xbox VertexShader struct to the NV2A if(Address < 136) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - if (pVertexShader) { - for (DWORD i = Address; i < pVertexShader->Size; i++) { + CxbxVertexShader * pCxbxVertexShader = GetCxbxVertexShader(Handle); + if (pCxbxVertexShader) { + for (DWORD i = Address; i < pCxbxVertexShader->XboxNrAddressSlots; i++) { // TODO: This seems very fishy g_VertexShaderSlots[i] = Handle; } @@ -2911,8 +3543,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SelectVertexShader_0) ( ) { - FUNC_EXPORTS; - DWORD Handle; DWORD Address; @@ -2932,8 +3562,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SelectVertexShader_4) DWORD Address ) { - FUNC_EXPORTS - DWORD Handle; __asm mov Handle, eax; @@ -2949,8 +3577,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SelectVertexShader) DWORD Address ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(Address) @@ -2964,42 +3590,45 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SelectVertexShader) // If Handle is assigned, it becomes the new current Xbox VertexShader, // which resets a bit of state (nv2a execution mode, viewport, ?) // Either way, the given address slot is selected as the start of the current vertex shader program - g_CurrentXboxVertexShaderHandle = Handle; + g_Xbox_VertexShader_Handle = Handle; + + CxbxVertexShader *pCxbxVertexShader = nullptr; + DWORD HostFVF = 0; if(VshHandleIsVertexShader(Handle)) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - hRet = g_pD3DDevice->SetVertexShader(pVertexShader->Handle); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader(VshHandleIsVertexShader)"); + pCxbxVertexShader = GetCxbxVertexShader(Handle); + SetCxbxVertexShader(pCxbxVertexShader); } - else if(Handle == NULL) + else if(Handle == xbnull) { -#ifdef CXBX_USE_D3D9 + HostFVF = D3DFVF_XYZ | D3DFVF_TEX0; + // Clear any vertex shader that may be set hRet = g_pD3DDevice->SetVertexShader(nullptr); - hRet = g_pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_TEX0); -#else - hRet = g_pD3DDevice->SetVertexShader(D3DFVF_XYZ | D3DFVF_TEX0); -#endif - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader(D3DFVF_XYZ | D3DFVF_TEX0)"); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader()"); + // Set the FVF + hRet = g_pD3DDevice->SetFVF(HostFVF); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_TEX0)"); } else if(Address < 136) { - X_D3DVertexShader *pVertexShader = (X_D3DVertexShader*)g_VertexShaderSlots[Address]; + X_D3DVertexShader *pXboxVertexShader = (X_D3DVertexShader*)g_VertexShaderSlots[Address]; - if(pVertexShader != NULL) + if(pXboxVertexShader != nullptr) { - hRet = g_pD3DDevice->SetVertexShader(((CxbxVertexShader *)((X_D3DVertexShader *)g_VertexShaderSlots[Address])->Handle)->Handle); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader(pVertexShader)"); + LOG_TEST_CASE("Assigned g_VertexShaderSlots"); + // Was : pCxbxVertexShader = (CxbxVertexShader *)(pXboxVertexShader->CxbxVertexShaderHandle); + // However, the CxbxVertexShaderHandle union is never set, so could lead to using undefined data! } else { - EmuWarning("g_VertexShaderSlots[%d] = 0", Address); + EmuLog(LOG_LEVEL::WARNING, "g_VertexShaderSlots[%d] = 0", Address); } } if (FAILED(hRet)) { - EmuWarning("We're lying about setting a vertext shader!"); + EmuLog(LOG_LEVEL::WARNING, "We're lying about setting a vertext shader!"); hRet = D3D_OK; } @@ -3014,8 +3643,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetGammaRamp) CONST X_D3DGAMMARAMP *pRamp ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(dwFlags) LOG_FUNC_ARG(pRamp) @@ -3034,9 +3661,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetGammaRamp) #if 0 // TODO : Why is this disabled? g_pD3DDevice->SetGammaRamp( -#ifdef CXBX_USE_D3D9 0, // iSwapChain -#endif dwPCFlags, &PCRamp); #endif } @@ -3049,16 +3674,12 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetGammaRamp) X_D3DGAMMARAMP *pRamp ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pRamp); D3DGAMMARAMP *pGammaRamp = (D3DGAMMARAMP *)malloc(sizeof(D3DGAMMARAMP)); g_pD3DDevice->GetGammaRamp( -#ifdef CXBX_USE_D3D9 0, // iSwapChain -#endif pGammaRamp); for(int v=0;v<256;v++) @@ -3080,8 +3701,6 @@ XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer2) INT BackBuffer ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(BackBuffer); X_D3DSurface* pXboxBackBuffer = nullptr; @@ -3091,7 +3710,7 @@ XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer2) /** unsafe, somehow HRESULT hRet = D3D_OK; - X_D3DSurface *pBackBuffer = EmuNewD3DSurface(); + X_D3DSurface *pXboxBackBuffer = EmuNewD3DSurface(); if(BackBuffer == -1) { static IDirect3DSurface *pCachedPrimarySurface = nullptr; @@ -3099,44 +3718,37 @@ XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer2) if(pCachedPrimarySurface == nullptr) { // create a buffer to return // TODO: Verify the surface is always 640x480 -#ifdef CXBX_USE_D3D9 hRet = g_pD3DDevice->CreateOffscreenPlainSurface(640, 480, D3DFMT_A8R8G8B8, /*D3DPool=* /0, &pCachedPrimarySurface, nullptr); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateOffscreenPlainSurface"); -#else - hRet = g_pD3DDevice->CreateImageSurface(640, 480, D3DFMT_A8R8G8B8, &pCachedPrimarySurface); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateImageSurface"); -#endif } - SetHostSurface(pBackBuffer, pCachedPrimarySurface); + SetHostSurface(pXboxBackBuffer, pCachedPrimarySurface); // No iTextureStage! hRet = g_pD3DDevice->GetFrontBuffer(pCachedPrimarySurface); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetFrontBuffer"); if (FAILED(hRet)) { - EmuWarning("Could not retrieve primary surface, using backbuffer"); - SetHostSurface(pBackBuffer, nullptr); + EmuLog(LOG_LEVEL::WARNING, "Could not retrieve primary surface, using backbuffer"); + SetHostSurface(pXboxBackBuffer, nullptr); // No iTextureStage! pCachedPrimarySurface->Release(); pCachedPrimarySurface = nullptr; BackBuffer = 0; } // Debug: Save this image temporarily - //D3DXSaveSurfaceToFile("C:\\Aaron\\Textures\\FrontBuffer.bmp", D3DXIFF_BMP, GetHostSurface(pBackBuffer), NULL, NULL); + //D3DXSaveSurfaceToFile("C:\\Aaron\\Textures\\FrontBuffer.bmp", D3DXIFF_BMP, GetHostSurface(pXboxBackBuffer), nullptr, nullptr); } if(BackBuffer != -1) { hRet = g_pD3DDevice->GetBackBuffer( -#ifdef CXBX_USE_D3D9 0, // iSwapChain -#endif BackBuffer, D3DBACKBUFFER_TYPE_MONO, &pCachedPrimarySurface); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetBackBuffer"); } //*/ - static X_D3DSurface *pBackBuffer = EmuNewD3DSurface(); - XTL::IDirect3DSurface *pCurrentHostBackBuffer = nullptr; + static X_D3DSurface *pXboxBackBuffer = EmuNewD3DSurface(); + IDirect3DSurface *pCurrentHostBackBuffer = nullptr; STATUS_SUCCESS; @@ -3145,35 +3757,30 @@ XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer2) } HRESULT hRet = g_pD3DDevice->GetBackBuffer( -#ifdef CXBX_USE_D3D9 0, // iSwapChain -#endif BackBuffer, D3DBACKBUFFER_TYPE_MONO, &pCurrentHostBackBuffer); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetBackBuffer"); if (FAILED(hRet)) CxbxKrnlCleanup("Unable to retrieve back buffer"); - SetHostSurface(pBackBuffer, pCurrentHostBackBuffer); + SetHostSurface(pXboxBackBuffer, pCurrentHostBackBuffer); // No iTextureStage! // Increment reference count - pBackBuffer->Common++; // EMUPATCH(D3DResource_AddRef)(pBackBuffer); + pXboxBackBuffer->Common++; // EMUPATCH(D3DResource_AddRef)(pXboxBackBuffer); - return pBackBuffer; + return pXboxBackBuffer; #else // COPY_BACKBUFFER_TO_XBOX_SURFACE // Rather than create a new surface, we should forward to the Xbox version of GetBackBuffer, // This gives us the correct Xbox surface to update. // We get signatures for both backbuffer functions as it changed in later XDKs - XB_trampoline(X_D3DSurface*, WINAPI, D3DDevice_GetBackBuffer2, (INT)); - - XB_trampoline(VOID, WINAPI, D3DDevice_GetBackBuffer, (INT, D3DBACKBUFFER_TYPE, X_D3DSurface**)); // This also updates the reference count, so we don't need to do this ourselves - if (XB_D3DDevice_GetBackBuffer != nullptr) { - XB_D3DDevice_GetBackBuffer(BackBuffer, D3DBACKBUFFER_TYPE_MONO, &pXboxBackBuffer); + if (XB_TRMP(D3DDevice_GetBackBuffer) != nullptr) { + XB_TRMP(D3DDevice_GetBackBuffer)(BackBuffer, D3DBACKBUFFER_TYPE_MONO, &pXboxBackBuffer); } else { - pXboxBackBuffer = XB_D3DDevice_GetBackBuffer2(BackBuffer); + pXboxBackBuffer = XB_TRMP(D3DDevice_GetBackBuffer2)(BackBuffer); } // Now pXboxBackbuffer points to the requested Xbox backbuffer @@ -3181,35 +3788,42 @@ XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer2) CxbxKrnlCleanup("D3DDevice_GetBackBuffer2: Could not get Xbox backbuffer"); } - auto pCopySrcSurface = GetHostSurface(pXboxBackBuffer, D3DUSAGE_RENDERTARGET); - if (pCopySrcSurface == nullptr) { - EmuWarning("Failed to get Host Resource for Xbox Back Buffer"); - return pXboxBackBuffer; + + // HACK: Disabled: Enabling this breaks DOA3 at native res/without hacks+ + // Also likely to effect Other games, but it has no known benefit at this point in time + // There are currently no known games that depend on backbuffer readback on the CPU! +#if 0 + // TODO: Downscale the host surface to the same size as the Xbox surface during copy + // Otherwise, we will overflow memory and crash + // HACK: For now, when using a non-zero scale factor, we can just skip the copy to prevent a crash + if (g_RenderScaleFactor == 1) { + auto pCopySrcSurface = GetHostSurface(pXboxBackBuffer, D3DUSAGE_RENDERTARGET); + if (pCopySrcSurface == nullptr) { + EmuLog(LOG_LEVEL::WARNING, "Failed to get Host Resource for Xbox Back Buffer"); + return pXboxBackBuffer; + } + + D3DLOCKED_RECT copyLockedRect; + HRESULT hRet = pCopySrcSurface->LockRect(©LockedRect, NULL, D3DLOCK_READONLY); + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Could not lock Host Resource for Xbox Back Buffer"); + return pXboxBackBuffer; + } + + D3DSURFACE_DESC copySurfaceDesc; + hRet = pCopySrcSurface->GetDesc(©SurfaceDesc); + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Could not get Xbox Back Buffer Host Surface Desc"); + } + else { + DWORD Size = copyLockedRect.Pitch * copySurfaceDesc.Height; // TODO : What about mipmap levels? (Backbuffer does not support mipmap) + // Finally, do the copy from the converted host resource to the xbox resource + memcpy((void*)GetDataFromXboxResource(pXboxBackBuffer), copyLockedRect.pBits, Size); + } + + pCopySrcSurface->UnlockRect(); } - - D3DLOCKED_RECT copyLockedRect; - HRESULT hRet = pCopySrcSurface->LockRect(©LockedRect, NULL, D3DLOCK_READONLY); - if (hRet != D3D_OK) { - EmuWarning("Could not lock Host Resource for Xbox Back Buffer"); - return pXboxBackBuffer; - } - - D3DSURFACE_DESC copySurfaceDesc; - - hRet = pCopySrcSurface->GetDesc(©SurfaceDesc); - if (hRet != D3D_OK) { - EmuWarning("Could not get Xbox Back Buffer Host Surface Desc"); - } else { -#ifdef CXBX_USE_D3D9 - DWORD Size = copyLockedRect.Pitch * copySurfaceDesc.Height; // TODO : What about mipmap levels? -#else - DWORD Size = copySurfaceDesc.Size; #endif - // Finally, do the copy from the converted host resource to the xbox resource - memcpy((void*)GetDataFromXboxResource(pXboxBackBuffer), copyLockedRect.pBits, Size); - } - - pCopySrcSurface->UnlockRect(); return pXboxBackBuffer; #endif // COPY_BACKBUFFER_TO_XBOX_SURFACE @@ -3225,39 +3839,33 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetBackBuffer) X_D3DSurface **ppBackBuffer ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_GetBackBuffer2"); *ppBackBuffer = EMUPATCH(D3DDevice_GetBackBuffer2)(BackBuffer); } -bool GetHostRenderTargetDimensions(DWORD *pHostWidth, DWORD *pHostHeight) +bool GetHostRenderTargetDimensions(DWORD *pHostWidth, DWORD *pHostHeight, IDirect3DSurface* pHostRenderTarget = nullptr) { - XTL::IDirect3DSurface* pHostRenderTarget = nullptr; + bool shouldRelease = false; + if (pHostRenderTarget == nullptr) { + g_pD3DDevice->GetRenderTarget( + 0, // RenderTargetIndex + &pHostRenderTarget); - g_pD3DDevice->GetRenderTarget( -#ifdef CXBX_USE_D3D9 - 0, // RenderTargetIndex -#endif - &pHostRenderTarget); + shouldRelease = true; + } // The following can only work if we could retrieve a host render target - if (!pHostRenderTarget) + if (!pHostRenderTarget) { return false; + } // Get current host render target dimensions - XTL::D3DSURFACE_DESC HostRenderTarget_Desc; + D3DSURFACE_DESC HostRenderTarget_Desc; pHostRenderTarget->GetDesc(&HostRenderTarget_Desc); - pHostRenderTarget->Release(); - // Emulate field-rendering not by halving the host backbuffer, but by faking - // the host backbuffer to half-height, which results in a correct viewport scale : - if (g_pXboxRenderTarget == g_XboxBackBufferSurface) { - if (g_EmuCDPD.XboxPresentationParameters.Flags & X_D3DPRESENTFLAG_FIELD) { - // Test case : XDK Sample FieldRender - HostRenderTarget_Desc.Height /= 2; - } + if (shouldRelease) { + pHostRenderTarget->Release(); } *pHostWidth = HostRenderTarget_Desc.Width; @@ -3274,6 +3882,156 @@ DWORD ScaleDWORD(DWORD Value, DWORD FromMax, DWORD ToMax) return (DWORD)tmp; } +void ValidateRenderTargetDimensions(DWORD HostRenderTarget_Width, DWORD HostRenderTarget_Height, DWORD XboxRenderTarget_Width, DWORD XboxRenderTarget_Height) +{ + // This operation is often used to change the display resolution without calling SetRenderTarget! + // This works by updating the underlying Width & Height of the Xbox surface, without reallocating the data + // Because of this, we need to validate that the associated host resource still matches the dimensions of the Xbox Render Target + // If not, we must force them to be re-created + // TEST CASE: Chihiro Factory Test Program + DWORD XboxRenderTarget_Width_Scaled = XboxRenderTarget_Width * g_RenderScaleFactor; + DWORD XboxRenderTarget_Height_Scaled = XboxRenderTarget_Height * g_RenderScaleFactor; + if (HostRenderTarget_Width != XboxRenderTarget_Width_Scaled || HostRenderTarget_Height != XboxRenderTarget_Height_Scaled) { + LOG_TEST_CASE("Existing RenderTarget width/height changed"); + + if (g_pXbox_RenderTarget == g_pXbox_BackBufferSurface) { + FreeHostResource(GetHostResourceKey(g_pXbox_RenderTarget)); g_pD3DDevice->SetRenderTarget(0, GetHostSurface(g_pXbox_RenderTarget, D3DUSAGE_RENDERTARGET)); + FreeHostResource(GetHostResourceKey(g_pXbox_DepthStencil)); g_pD3DDevice->SetDepthStencilSurface(GetHostSurface(g_pXbox_DepthStencil, D3DUSAGE_DEPTHSTENCIL)); + } + } +} + +float GetZScaleForSurface(XTL::X_D3DSurface* pSurface) +{ + // If no surface was present, fallback to 1 + if (pSurface == xbnullptr) { + return 1; + } + + auto format = GetXboxPixelContainerFormat(pSurface); + switch (format) { + case XTL::X_D3DFMT_D16: + case XTL::X_D3DFMT_LIN_D16: + return 65535.0f; + + case XTL::X_D3DFMT_D24S8: + case XTL::X_D3DFMT_LIN_D24S8: + return 16777215.0f; + + case XTL::X_D3DFMT_F16: + case XTL::X_D3DFMT_LIN_F16: + return 511.9375f; + + case XTL::X_D3DFMT_F24S8: + case XTL::X_D3DFMT_LIN_F24S8: + // 24bit floating point is close to precision maximum, so a lower value is used + // We can't use a double here since the vertex shader is only at float precision + return 1.0e30f; + } + + // Default to 1 if unknown depth format + LOG_TEST_CASE("GetZScaleForSurface: Unknown Xbox Depth Format"); + return 1; +} + +void GetViewPortOffsetAndScale(float (&vOffset)[4], float(&vScale)[4]) +{ + // Store viewport offset and scale in constant registers + // used in shaders to transform back from screen space (Xbox Shader Output) to Clip space (Host Shader Output) + D3DVIEWPORT ViewPort; + g_pD3DDevice->GetViewport(&ViewPort); + + // Calculate Width/Height scale & offset + float scaleWidth = (2.0f / ViewPort.Width) * g_RenderScaleFactor; + float scaleHeight = (2.0f / ViewPort.Height) * g_RenderScaleFactor; + float offsetWidth = scaleWidth; + float offsetHeight = scaleHeight; + + // Calculate Z scale & offset + float zScale = GetZScaleForSurface(g_pXbox_DepthStencil); + float scaleZ = zScale * (ViewPort.MaxZ - ViewPort.MinZ); + float offsetZ = zScale * ViewPort.MinZ; + + // TODO will we need to do something here to support upscaling? + // TODO remove the code above as required + + // Default scale and offset. + // Multisample state will affect these + float xScale = 1.0f; + float yScale = 1.0f; + float xOffset = 0.5f; + float yOffset = 0.5f; + + // MULTISAMPLE options have offset of 0 + // Various sample sizes have various x and y scales + switch (g_EmuCDPD.XboxPresentationParameters.MultiSampleType) + { + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_QUINCUNX: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_GAUSSIAN: + xOffset = yOffset = 0.0f; + break; + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_HORIZONTAL_LINEAR: + xScale = 2.0f; + break; + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_VERTICAL_LINEAR: + yScale = 2.0f; + break; + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_GAUSSIAN: + xScale = yScale = 2.0f; + break; + case XTL::X_D3DMULTISAMPLE_9_SAMPLES_MULTISAMPLE_GAUSSIAN: + xScale = yScale = 1.5f; + xOffset = yOffset = 0.0f; + break; + case XTL::X_D3DMULTISAMPLE_9_SAMPLES_SUPERSAMPLE_GAUSSIAN: + xScale = yScale = 3.0f; + break; + } + + // Xbox correct values? + xOffset = xOffset + (1.0f / 32.0f); + yOffset = yOffset + (1.0f / 32.0f); + xScale = xScale * ViewPort.Width; + yScale = yScale * ViewPort.Height; + + // HACK: Add a host correction factor to these values + // So that after we reverse the screenspace transformation + // Pre-transformed 2d geometry is in the same space as the 3d geometry...? + + // Offset with a host correction + vOffset[0] = xOffset + (0.5f * (float)ViewPort.Width / (float)g_RenderScaleFactor); + vOffset[1] = yOffset + (0.5f * (float)ViewPort.Height / (float)g_RenderScaleFactor); + vOffset[2] = 0.0f; //offsetZ; + vOffset[3] = 0.0f; + + // Scale with a host correction + vScale[0] = xScale * (1.0f / ( 2.0f * (float)g_RenderScaleFactor)); + vScale[1] = yScale * (1.0f / (-2.0f * (float)g_RenderScaleFactor)); + vScale[2] = scaleZ; // ? + vScale[3] = 1.0f; // ? +} + +void UpdateViewPortOffsetAndScaleConstants() +{ + float vOffset[4], vScale[4]; + GetViewPortOffsetAndScale(vOffset, vScale); + + g_pD3DDevice->SetVertexShaderConstantF(CXBX_D3DVS_VIEWPORT_SCALE_MIRROR, vScale, 1); + g_pD3DDevice->SetVertexShaderConstantF(CXBX_D3DVS_VIEWPORT_OFFSET_MIRROR, vOffset, 1); + + // Store viewport offset and scale in constant registers 58 (c-38) and + // 59 (c-37) used for screen space transformation. + // We only do this if X_D3DSCM_NORESERVEDCONSTANTS is not set, since enabling this flag frees up these registers for shader used + if (g_Xbox_VertexShaderConstantMode != X_D3DSCM_NORESERVEDCONSTANTS) + { + g_pD3DDevice->SetVertexShaderConstantF(X_D3DSCM_RESERVED_CONSTANT_SCALE + X_D3DSCM_CORRECTION, vScale, 1); + g_pD3DDevice->SetVertexShaderConstantF(X_D3DSCM_RESERVED_CONSTANT_OFFSET + X_D3DSCM_CORRECTION, vOffset, 1); + } +} + // ****************************************************************** // * patch: D3DDevice_SetViewport // ****************************************************************** @@ -3282,161 +4040,75 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetViewport) CONST X_D3DVIEWPORT8 *pViewport ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pViewport); + // Always call the Xbox SetViewPort to update D3D Internal State + XB_TRMP(D3DDevice_SetViewport)(pViewport); + + // Host does not support pViewPort = nullptr + if (pViewport == nullptr) { + LOG_TEST_CASE("pViewport = null"); + return; + } + + D3DVIEWPORT XboxViewPort = *pViewport; D3DVIEWPORT HostViewPort = *pViewport; - // Always call the Xbox SetViewPort to update D3D Internal State - XB_trampoline(VOID, WINAPI, D3DDevice_SetViewport, (CONST X_D3DVIEWPORT8 *)); - XB_D3DDevice_SetViewport(pViewport); + if (g_pXbox_RenderTarget) { + // Clip the Xbox Viewport to the render target dimensions + // This is required because during SetRenderTarget, Xbox calls SetViewPort with impossibly large values + DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXbox_RenderTarget); + DWORD XboxRenderTarget_Height = GetPixelContainerHeight(g_pXbox_RenderTarget); - if (g_pXboxRenderTarget) { - // Get current Xbox render target dimensions - DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXboxRenderTarget); - DWORD XboxRenderTarget_Height = GetPixelContainerHeigth(g_pXboxRenderTarget); + DWORD left = std::max((int)pViewport->X, 0); + DWORD top = std::max((int)pViewport->Y, 0); + DWORD right = std::min((int)pViewport->X + (int)pViewport->Width, (int)XboxRenderTarget_Width); + DWORD bottom = std::min((int)pViewport->Y + (int)pViewport->Height, (int)XboxRenderTarget_Height); + DWORD width = right - left; + DWORD height = bottom - top; - // Before any scaling, adjust viewport to stay within render target bounds - DWORD Right = HostViewPort.X + HostViewPort.Width; - if (Right > XboxRenderTarget_Width) { - HostViewPort.Width = XboxRenderTarget_Width - HostViewPort.X; - } + XboxViewPort.X = left; + XboxViewPort.Y = top; + XboxViewPort.Width = width; + XboxViewPort.Height = height; + XboxViewPort.MinZ = pViewport->MinZ; + XboxViewPort.MaxZ = pViewport->MaxZ; - DWORD Bottom = HostViewPort.Y + HostViewPort.Height; - if (Bottom > XboxRenderTarget_Height) { - HostViewPort.Height = XboxRenderTarget_Height - HostViewPort.Y; - } - if (g_ScaleViewport) { - // Get current host render target dimensions - DWORD HostRenderTarget_Width; - DWORD HostRenderTarget_Height; + // Store the updated viewport data ready to pass to host SetViewPort + HostViewPort = XboxViewPort; - if (GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { - // Scale Xbox to host dimensions (avoiding hard-coding 640 x 480) - HostViewPort.X = ScaleDWORD(pViewport->X, XboxRenderTarget_Width, HostRenderTarget_Width); - HostViewPort.Y = ScaleDWORD(pViewport->Y, XboxRenderTarget_Height, HostRenderTarget_Height); - HostViewPort.Width = ScaleDWORD(pViewport->Width, XboxRenderTarget_Width, HostRenderTarget_Width); - HostViewPort.Height = ScaleDWORD(pViewport->Height, XboxRenderTarget_Height, HostRenderTarget_Height); - // TODO : Fix test-case Shenmue 2 (which halves height, leaving the bottom half unused) - HostViewPort.MinZ = pViewport->MinZ; // No need scale Z for now - HostViewPort.MaxZ = pViewport->MaxZ; - } - else { - EmuWarning("GetHostRenderTargetDimensions failed - SetViewport sets Xbox viewport instead!"); - } + DWORD HostRenderTarget_Width = 0, HostRenderTarget_Height = 0; + if (GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { + ValidateRenderTargetDimensions(HostRenderTarget_Width, HostRenderTarget_Height, XboxRenderTarget_Width, XboxRenderTarget_Height); + + // We *must* always scale the viewport to the associated host surface + // Otherwise, we only get partial screen updates, or broken upscaling + // Scale Xbox to host dimensions (avoiding hard-coding 640 x 480) + HostViewPort.X = ScaleDWORD(XboxViewPort.X, XboxRenderTarget_Width, HostRenderTarget_Width); + HostViewPort.Y = ScaleDWORD(XboxViewPort.Y, XboxRenderTarget_Height, HostRenderTarget_Height); + HostViewPort.Width = ScaleDWORD(XboxViewPort.Width, XboxRenderTarget_Width, HostRenderTarget_Width); + HostViewPort.Height = ScaleDWORD(XboxViewPort.Height, XboxRenderTarget_Height, HostRenderTarget_Height); + // TODO : Fix test-case Shenmue 2 (which halves height, leaving the bottom half unused) + HostViewPort.MinZ = XboxViewPort.MinZ; // No need scale Z for now + HostViewPort.MaxZ = XboxViewPort.MaxZ; + } else { + LOG_TEST_CASE("SetViewPort: Unable to fetch host render target dimensions"); } } HRESULT hRet = g_pD3DDevice->SetViewport(&HostViewPort); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetViewport"); + + UpdateViewPortOffsetAndScaleConstants(); } -// LTCG specific D3DDevice_GetViewportOffsetAndScale function... -// This function is still not working so should be investigated... -// This uses a custom calling convention where parameter is passed in EDX, ECX -// Test-case: RalliSport Challenge 2 -VOID __stdcall XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale_0) -( -) -{ - //FUNC_EXPORTS; - - D3DXVECTOR4 *pOffset; - D3DXVECTOR4 *pScale; - - __asm { - mov pScale, ecx - mov pOffset, edx - } - - return EMUPATCH(D3DDevice_GetViewportOffsetAndScale)(pOffset, pScale); -} - -// ****************************************************************** -// * patch: D3DDevice_GetViewportOffsetAndScale -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale) -( - X_D3DXVECTOR4 *pOffset, - X_D3DXVECTOR4 *pScale -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pOffset) - LOG_FUNC_ARG(pScale) - LOG_FUNC_END; - - // LOG_TEST_CASE("D3DDevice_GetViewportOffsetAndScale"); // Get us some test-cases - // Test case : 007: From Russia with Love - // Test case : Army Men?: Sarge's War - // Test case : BeatDown - Fists of Vengeance - // Test case : Big Mutha Truckers - // Test case : Big Mutha Truckers 2 - // Test case : Classified : The Sentinel Crisis - // Test case : Cold Fear - // Test case : Commandos SF - // Test case : Darkwatch - // Test case : Dr.Muto - // Test case : GTA : Vice City - // Test case : Jacked - // Test case : Madagascar - // Test case : Max Payne 2 - // Test case : NBA LIVE 2005 - // Test case : NFS : Underground - // Test case : NFS : Underground 2 - // Test case : PoP : The Sands of Time - // Test case : Prince of Persia : T2T - see #1109 (comment) - // Test case : RPM Tuning - // Test case : Street Racing Syndicate - // Test case : Spongebob - Battle for Bikini Bottom - // Test case : The Incredibles : Rise of the Underminer - // Test case : The SpongeBob SquarePants Movie - // Test case : TMNT(R)2 - // Test case : TMNT(R)3 - -#if 0 - float fScaleX = 1.0f; - float fScaleY = 1.0f; - float fScaleZ = 1.0f; - float fOffsetX = 0.5 + 1.0/32; - float fOffsetY = 0.5 + 1.0/32; - X_D3DVIEWPORT8 Viewport; - - EMUPATCH(D3DDevice_GetViewport)(&Viewport); - - pScale->x = (float)Viewport.Width * 0.5f * fScaleX; - pScale->y = (float)Viewport.Height * -0.5f * fScaleY; - pScale->z = (Viewport.MaxZ - Viewport.MinZ) * fScaleZ; - pScale->w = 0; - - pOffset->x = (float)Viewport.Width * fScaleX * 0.5f + (float)Viewport.X * fScaleX + fOffsetX; - pOffset->y = (float)Viewport.Height * fScaleY * 0.5f + (float)Viewport.Y * fScaleY + fOffsetY; - pOffset->z = Viewport.MinZ * fScaleZ; - pOffset->w = 0; -#else - pScale->x = 1.0f; - pScale->y = 1.0f; - pScale->z = 1.0f; - pScale->w = 1.0f; - - pOffset->x = 0.0f; - pOffset->y = 0.0f; - pOffset->z = 0.0f; - pOffset->w = 0.0f; -#endif -} // LTCG specific D3DDevice_SetShaderConstantMode function... // This uses a custom calling convention where parameter is passed in EAX VOID __stdcall XTL::EMUPATCH(D3DDevice_SetShaderConstantMode_0) ( ) { - FUNC_EXPORTS; - XTL::X_VERTEXSHADERCONSTANTMODE param; __asm { mov param, eax; @@ -3453,11 +4125,9 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetShaderConstantMode) XTL::X_VERTEXSHADERCONSTANTMODE Mode ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Mode); - g_VertexShaderConstantMode = Mode; + g_Xbox_VertexShaderConstantMode = Mode; } // ****************************************************************** @@ -3471,8 +4141,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) DWORD Usage ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pDeclaration) LOG_FUNC_ARG(pFunction) @@ -3480,12 +4148,8 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) LOG_FUNC_ARG_TYPE(X_D3DUSAGE, Usage) LOG_FUNC_END; - if (g_pD3DDevice == nullptr) { - LOG_TEST_CASE("D3DDevice_CreateVertexShader called before Direct3D_CreateDevice"); - // We lie to allow the game to continue for now, but it probably won't work well - return STATUS_SUCCESS; - } - + // First, we must call the Xbox CreateVertexShader function and check for success + // This does the following: // Allocates an Xbox VertexShader struct // Sets reference count to 1 // Puts Usage in VertexShader->Flags @@ -3495,146 +4159,95 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) // Sets other fields // pHandle recieves the addres of the new shader, or-ed with 1 (D3DFVF_RESERVED0) - // create emulated shader struct - X_D3DVertexShader *pD3DVertexShader = (X_D3DVertexShader*)g_VMManager.AllocateZeroed(sizeof(X_D3DVertexShader)); - CxbxVertexShader *pVertexShader = (CxbxVertexShader*)g_VMManager.AllocateZeroed(sizeof(CxbxVertexShader)); + HRESULT hRet = D3D_OK; - // TODO: Intelligently fill out these fields as necessary + if (XB_TRMP(D3DDevice_CreateVertexShader)) { + HRESULT hRet = XB_TRMP(D3DDevice_CreateVertexShader)(pDeclaration, pFunction, pHandle, Usage); + if (FAILED(hRet)) { + LOG_TEST_CASE("D3DDevice_CreateVertexShader trampoline call returned failure"); + RETURN(hRet); + } + } else { + // Due to how our LoadVertexShader patch is implemented, it may call this function without the Xbox version existing + // As a result, we have to build our own vertex shader handle if the trampoline was not found + // We don't do the full steps listed above intentionally so: If this situation is reached, the game + // does not have a CreateVertexShader function, so those actions should not happen anyway! + LOG_TEST_CASE("CreateVertexShader with no trampoline"); + *pHandle = ((DWORD)malloc(sizeof(X_D3DVertexShader)) & D3DFVF_RESERVED0); + } + + if (g_pD3DDevice == nullptr) { + LOG_TEST_CASE("D3DDevice_CreateVertexShader called before Direct3D_CreateDevice"); + // We lie to allow the game to continue for now, but it probably won't work well + return STATUS_SUCCESS; + } // HACK: TODO: support this situation - if(pDeclaration == NULL) - { - *pHandle = NULL; - - - + if(pDeclaration == nullptr) { + LOG_TEST_CASE("Vertex shader without declaration"); + *pHandle = xbnull; return D3D_OK; } - LPD3DXBUFFER pRecompiledBuffer = NULL; - DWORD *pRecompiledDeclaration = NULL; - DWORD *pRecompiledFunction = NULL; - DWORD VertexShaderSize = 0; - DWORD DeclarationSize = 0; - DWORD Handle = 0; + // Now, we can create the host vertex shader + DWORD XboxDeclarationCount = 0; + CxbxVertexShader* pCxbxVertexShader = (CxbxVertexShader*)calloc(1, sizeof(CxbxVertexShader)); + D3DVERTEXELEMENT *pRecompiledDeclaration = nullptr; - HRESULT hRet = XTL::EmuRecompileVshDeclaration((DWORD*)pDeclaration, - &pRecompiledDeclaration, - &DeclarationSize, - pFunction == NULL, - &pVertexShader->VertexShaderInfo); + pRecompiledDeclaration = EmuRecompileVshDeclaration((DWORD*)pDeclaration, + /*bIsFixedFunction=*/pFunction == xbnullptr, + &XboxDeclarationCount, + &pCxbxVertexShader->VertexShaderInfo); - if(SUCCEEDED(hRet) && pFunction) - { - boolean bUseDeclarationOnly = 0; + // Create the vertex declaration + hRet = g_pD3DDevice->CreateVertexDeclaration(pRecompiledDeclaration, &pCxbxVertexShader->pHostVertexDeclaration); + free(pRecompiledDeclaration); - hRet = XTL::EmuRecompileVshFunction((DWORD*)pFunction, - &pRecompiledBuffer, - &VertexShaderSize, - g_VertexShaderConstantMode == X_D3DSCM_NORESERVEDCONSTANTS, - &bUseDeclarationOnly, - pRecompiledDeclaration); - if(SUCCEEDED(hRet)) - { - if(!bUseDeclarationOnly) - pRecompiledFunction = (DWORD*)pRecompiledBuffer->GetBufferPointer(); - else - pRecompiledFunction = NULL; - } - else - { - pRecompiledFunction = NULL; - EmuWarning("Couldn't recompile vertex shader function."); - hRet = D3D_OK; // Try using a fixed function vertex shader instead - } - } + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVertexDeclaration"); - //DbgPrintf("MaxVertexShaderConst = %d\n", g_D3DCaps.MaxVertexShaderConst); + if (FAILED(hRet)) { + // NOTE: This is a fatal error because it ALWAYS triggers a crash within DrawVertices if not set + CxbxKrnlCleanup("Failed to create Vertex Declaration"); + } + g_pD3DDevice->SetVertexDeclaration(pCxbxVertexShader->pHostVertexDeclaration); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexDeclaration"); + + uint64_t vertexShaderKey = 0; + DWORD XboxFunctionSize = 0; + if (SUCCEEDED(hRet) && pFunction) + { + vertexShaderKey = g_VertexShaderSource.CreateShader(pFunction, &XboxFunctionSize); + } + + pCxbxVertexShader->pXboxDeclarationCopy = (DWORD*)malloc(XboxDeclarationCount * sizeof(DWORD)); + memcpy(pCxbxVertexShader->pXboxDeclarationCopy, pDeclaration, XboxDeclarationCount * sizeof(DWORD)); + pCxbxVertexShader->XboxFunctionSize = 0; + pCxbxVertexShader->pXboxFunctionCopy = nullptr; + pCxbxVertexShader->XboxVertexShaderType = X_VST_NORMAL; // TODO : This can vary + pCxbxVertexShader->XboxNrAddressSlots = (XboxFunctionSize - sizeof(X_VSH_SHADER_HEADER)) / X_VSH_INSTRUCTION_SIZE_BYTES; + pCxbxVertexShader->HostFVF = 0; + pCxbxVertexShader->VertexShaderKey = vertexShaderKey; + pCxbxVertexShader->XboxDeclarationCount = XboxDeclarationCount; + // Save the status, to remove things later + // pCxbxVertexShader->XboxStatus = hRet; // Not even used by VshHandleIsValidShader() if(SUCCEEDED(hRet)) { - hRet = g_pD3DDevice->CreateVertexShader - ( - pRecompiledDeclaration, - pRecompiledFunction, - &Handle, - g_dwVertexShaderUsage // TODO: HACK: Xbox has extensions! - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVertexShader"); - - if(pRecompiledBuffer != nullptr) + if(pFunction != xbnullptr) { - pRecompiledBuffer->Release(); - pRecompiledBuffer = nullptr; + pCxbxVertexShader->XboxFunctionSize = XboxFunctionSize; + pCxbxVertexShader->pXboxFunctionCopy = (DWORD*)malloc(XboxFunctionSize); + memcpy(pCxbxVertexShader->pXboxFunctionCopy, pFunction, XboxFunctionSize); } - - //* Fallback to dummy shader. - if(FAILED(hRet)) - { - static const char dummy[] = - "vs.1.1\n" - "dp4 oPos.x, v0, c96\n" - "dp4 oPos.y, v0, c97\n" - "dp4 oPos.z, v0, c98\n" - "dp4 oPos.w, v0, c99\n"; - - EmuWarning("Trying fallback:\n%s", dummy); - hRet = D3DXAssembleShader(dummy, - strlen(dummy), - D3DXASM_SKIPVALIDATION, - NULL, - &pRecompiledBuffer, - NULL); - DEBUG_D3DRESULT(hRet, "D3DXAssembleShader"); - - hRet = g_pD3DDevice->CreateVertexShader - ( - pRecompiledDeclaration, - (DWORD*)pRecompiledBuffer->GetBufferPointer(), - &Handle, - g_dwVertexShaderUsage - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVertexShader(fallback)"); - } - //*/ - } - // Save the status, to remove things later - pVertexShader->Status = hRet; - - free(pRecompiledDeclaration); - - pVertexShader->pDeclaration = (DWORD*)g_VMManager.Allocate(DeclarationSize); - memcpy(pVertexShader->pDeclaration, pDeclaration, DeclarationSize); - - pVertexShader->FunctionSize = 0; - pVertexShader->pFunction = NULL; - pVertexShader->Type = X_VST_NORMAL; - pVertexShader->Size = (VertexShaderSize - sizeof(VSH_SHADER_HEADER)) / VSH_INSTRUCTION_SIZE_BYTES; - pVertexShader->DeclarationSize = DeclarationSize; - - if(SUCCEEDED(hRet)) - { - if(pFunction != NULL) - { - pVertexShader->pFunction = (DWORD*)g_VMManager.Allocate(VertexShaderSize); - memcpy(pVertexShader->pFunction, pFunction, VertexShaderSize); - pVertexShader->FunctionSize = VertexShaderSize; - } - else - { - pVertexShader->pFunction = NULL; - pVertexShader->FunctionSize = 0; - } - pVertexShader->Handle = Handle; } else { - pVertexShader->Handle = D3DFVF_XYZ | D3DFVF_TEX0; + LOG_TEST_CASE("Falling back to FVF shader"); + pCxbxVertexShader->HostFVF = D3DFVF_XYZ | D3DFVF_TEX0; } - pD3DVertexShader->Handle = (DWORD)pVertexShader; - - *pHandle = (DWORD)pD3DVertexShader; // DON'T collide with PHYSICAL_MAP_BASE (see VshHandleIsFVF and VshHandleIsVertexShader) + // Register the host Vertex Shader + SetCxbxVertexShader(*pHandle, pCxbxVertexShader); if(FAILED(hRet)) { @@ -3643,13 +4256,13 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) { char pFileName[30]; static int FailedShaderCount = 0; - VSH_SHADER_HEADER *pHeader = (VSH_SHADER_HEADER*)pFunction; - EmuWarning("Couldn't create vertex shader!"); + X_VSH_SHADER_HEADER *pHeader = (X_VSH_SHADER_HEADER*)pFunction; + EmuLog(LOG_LEVEL::WARNING, "Couldn't create vertex shader!"); sprintf(pFileName, "failed%05d.xvu", FailedShaderCount); FILE *f = fopen(pFileName, "wb"); if(f) { - fwrite(pFunction, sizeof(VSH_SHADER_HEADER) + pHeader->NumInst * 16, 1, f); + fwrite(pFunction, sizeof(X_VSH_SHADER_HEADER) + pHeader->NumInst * 16, 1, f); fclose(f); } FailedShaderCount++; @@ -3658,8 +4271,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) //hRet = D3D_OK; } - - return hRet; } @@ -3670,9 +4281,7 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant_8) ( ) { - FUNC_EXPORTS; - - static uint32 returnAddr; + static uint32_t returnAddr; #ifdef _DEBUG_TRACE __asm add esp, 4 @@ -3698,8 +4307,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant) DWORD ConstantCount ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Register) LOG_FUNC_ARG(pConstantData) @@ -3707,10 +4314,10 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant) LOG_FUNC_END; /*#ifdef _DEBUG_TRACK_VS_CONST - for (uint32 i = 0; i < ConstantCount; i++) + for (uint32_t i = 0; i < ConstantCount; i++) { - printf("SetVertexShaderConstant, c%d (c%d) = { %f, %f, %f, %f }\n", - Register - 96 + i, Register + i, + printf("SetVertexShaderConstant, c%d = { %f, %f, %f, %f }\n", + Register + i, *((float*)pConstantData + 4 * i), *((float*)pConstantData + 4 * i + 1), *((float*)pConstantData + 4 * i + 2), @@ -3718,33 +4325,23 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant) } #endif*/ // _DEBUG_TRACK_VS_CONST - // TODO: HACK: Since Xbox vertex shader constants range from -96 to 96, during conversion - // some shaders need to add 96 to use ranges 0 to 192. This fixes 3911 - 4361 games and XDK - // samples, but breaks Turok. - - if(g_BuildVersion <= 4361) - Register += 96; + // Xbox vertex shader constants range from -96 to 95 + // The host does not support negative, so we adjust to 0..191 + Register += X_D3DSCM_CORRECTION; + if (Register < 0) LOG_TEST_CASE("Register < 0"); + if (Register + ConstantCount > X_D3DVS_CONSTREG_COUNT) LOG_TEST_CASE("Register + ConstantCount > X_D3DVS_CONSTREG_COUNT"); HRESULT hRet; -#ifdef CXBX_USE_D3D9 hRet = g_pD3DDevice->SetVertexShaderConstantF( Register, (float*)pConstantData, ConstantCount ); -#else - hRet = g_pD3DDevice->SetVertexShaderConstant - ( - Register, - pConstantData, - ConstantCount - ); -#endif DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShaderConstant"); if(FAILED(hRet)) { - EmuWarning("We're lying about setting a vertex shader constant!"); + EmuLog(LOG_LEVEL::WARNING, "We're lying about setting a vertex shader constant!"); hRet = D3D_OK; } } @@ -3758,11 +4355,12 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant1) CONST PVOID pConstantData ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexShaderConstant"); - EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register, pConstantData, 1); + // The XDK uses a macro to automatically adjust to 0..191 range + // but D3DDevice_SetVertexShaderConstant expects -96..95 range + // so we adjust before forwarding + EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register - X_D3DSCM_CORRECTION, pConstantData, 1); } // ****************************************************************** @@ -3774,13 +4372,12 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant1Fast) CONST PVOID pConstantData ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexShaderConstant"); - // Redirect to the standard version. - - EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register, pConstantData, 1); + // The XDK uses a macro to automatically adjust to 0..191 range + // but D3DDevice_SetVertexShaderConstant expects -96..95 range + // so we adjust before forwarding + EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register - X_D3DSCM_CORRECTION, pConstantData, 1); } // ****************************************************************** @@ -3792,11 +4389,12 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant4) CONST PVOID pConstantData ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexShaderConstant"); - EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register, pConstantData, 4); + // The XDK uses a macro to automatically adjust to 0..191 range + // but D3DDevice_SetVertexShaderConstant expects -96..95 range + // so we adjust before forwarding + EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register - X_D3DSCM_CORRECTION, pConstantData, 4); } // ****************************************************************** @@ -3809,11 +4407,12 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstantNotInline) DWORD ConstantCount ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexShaderConstant"); - EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register, pConstantData, ConstantCount / 4); + // The XDK uses a macro to automatically adjust to 0..191 range + // but D3DDevice_SetVertexShaderConstant expects -96..95 range + // so we adjust before forwarding + EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register - X_D3DSCM_CORRECTION, pConstantData, ConstantCount / 4); } // ****************************************************************** @@ -3826,17 +4425,14 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetVertexShaderConstantNotInlineFast) DWORD ConstantCount ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexShaderConstant"); - // Redirect to the standard version. - - EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register, pConstantData, ConstantCount / 4); + // The XDK uses a macro to automatically adjust to 0..191 range + // but D3DDevice_SetVertexShaderConstant expects -96..95 range + // so we adjust before forwarding + EMUPATCH(D3DDevice_SetVertexShaderConstant)(Register - X_D3DSCM_CORRECTION, pConstantData, ConstantCount / 4); } -BOOL g_bBadIndexData = FALSE; - // LTCG specific D3DDevice_SetTexture function... // This uses a custom calling convention where parameter is passed in EAX // TODO: XB_trampoline plus Log function is not working due lost parameter in EAX. @@ -3846,8 +4442,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTexture_4) X_D3DBaseTexture *pTexture ) { - FUNC_EXPORTS; - DWORD Stage; __asm mov Stage, eax; @@ -3855,13 +4449,12 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTexture_4) // LOG_FUNC_ARG(Stage) // LOG_FUNC_ARG(pTexture) // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetTexture_4(Stage : %d pTexture : %08x);\n", Stage, pTexture); + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetTexture_4(Stage : %d pTexture : %08x);", Stage, pTexture); // Call the Xbox implementation of this function, to properly handle reference counting for us - //XB_trampoline(VOID, WINAPI, D3DDevice_SetTexture_4, (X_D3DBaseTexture*)); - //XB_D3DDevice_SetTexture_4(pTexture); + //XB_TRMP(D3DDevice_SetTexture_4)(pTexture); - EmuD3DActiveTexture[Stage] = pTexture; + g_pXbox_SetTexture[Stage] = pTexture; } // ****************************************************************** @@ -3873,18 +4466,15 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTexture) X_D3DBaseTexture *pTexture ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Stage) LOG_FUNC_ARG(pTexture) LOG_FUNC_END; // Call the Xbox implementation of this function, to properly handle reference counting for us - XB_trampoline(VOID, WINAPI, D3DDevice_SetTexture, (DWORD, X_D3DBaseTexture*)); - XB_D3DDevice_SetTexture(Stage, pTexture); + XB_TRMP(D3DDevice_SetTexture)(Stage, pTexture); - EmuD3DActiveTexture[Stage] = pTexture; + g_pXbox_SetTexture[Stage] = pTexture; } // ****************************************************************** @@ -3897,19 +4487,17 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SwitchTexture) DWORD Format ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Method) LOG_FUNC_ARG(Data) LOG_FUNC_ARG(Format) LOG_FUNC_END; - DWORD StageLookup[TEXTURE_STAGES] = { 0x00081b00, 0x00081b40, 0x00081b80, 0x00081bc0 }; + DWORD StageLookup[XTL::X_D3DTS_STAGECOUNT] = { 0x00081b00, 0x00081b40, 0x00081b80, 0x00081bc0 }; // This array contains D3DPUSH_ENCODE(NV2A_TX_OFFSET(v), 2) = 2 DWORD's, shifted left PUSH_COUNT_SHIFT (18) left DWORD Stage = -1; - for (int v = 0; v < TEXTURE_STAGES; v++) { + for (int v = 0; v < XTL::X_D3DTS_STAGECOUNT; v++) { if (StageLookup[v] == Method) { Stage = v; break; @@ -3918,11 +4506,11 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SwitchTexture) if (Stage == -1) { LOG_TEST_CASE("D3DDevice_SwitchTexture Unknown Method"); - EmuWarning("Unknown Method (0x%.08X)", Method); + EmuLog(LOG_LEVEL::WARNING, "Unknown Method (0x%.08X)", Method); } else { // Switch Texture updates the data pointer of an active texture using pushbuffer commands - if (EmuD3DActiveTexture[Stage] == xbnullptr) { + if (g_pXbox_SetTexture[Stage] == xbnullptr) { LOG_TEST_CASE("D3DDevice_SwitchTexture without an active texture"); } else { @@ -3948,15 +4536,15 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SwitchTexture) // Test-case : Spider - Man 2 // Update data and format separately, instead of via GetDataFromXboxResource() - CxbxActiveTextureCopies[Stage].Common = EmuD3DActiveTexture[Stage]->Common; + CxbxActiveTextureCopies[Stage].Common = g_pXbox_SetTexture[Stage]->Common; CxbxActiveTextureCopies[Stage].Data = Data; CxbxActiveTextureCopies[Stage].Format = Format; CxbxActiveTextureCopies[Stage].Lock = 0; - CxbxActiveTextureCopies[Stage].Size = EmuD3DActiveTexture[Stage]->Size; + CxbxActiveTextureCopies[Stage].Size = g_pXbox_SetTexture[Stage]->Size; // Use the above modified copy, instead of altering the active Xbox texture - EmuD3DActiveTexture[Stage] = &CxbxActiveTextureCopies[Stage]; - // Note : Since EmuD3DActiveTexture and CxbxActiveTextureCopies are host-managed, + g_pXbox_SetTexture[Stage] = &CxbxActiveTextureCopies[Stage]; + // Note : Since g_pXbox_SetTexture and CxbxActiveTextureCopies are host-managed, // Xbox code should never alter these members (so : no reference counting, etc). // As long as that's guaranteed, this is a safe way to emulate SwitchTexture. // (GetHostResourceKey also avoids using any Xbox texture resource memory address.) @@ -3972,8 +4560,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Begin) X_D3DPRIMITIVETYPE PrimitiveType ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(PrimitiveType); g_InlineVertexBuffer_PrimitiveType = PrimitiveType; @@ -3991,8 +4577,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData2f) FLOAT b ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexData4f"); EMUPATCH(D3DDevice_SetVertexData4f)(Register, a, b, 0.0f, 1.0f); @@ -4011,39 +4595,46 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData2s) SHORT b ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexData4f"); float fa, fb; - switch (Register) { - // Special case: If the input register is a color, don't transform! - // Test case: Halo - case X_D3DVSDE_DIFFUSE: - case X_D3DVSDE_SPECULAR: - case X_D3DVSDE_BACKDIFFUSE: - case X_D3DVSDE_BACKSPECULAR: - fa = a; - fb = b; - break; - default: - fa = a / 32767.0f; - fb = b / 32767.0f; - break; - } + // Test case: Halo + // Note : XQEMU verified that the int16_t arguments + // must be mapped to floats in the range [-32768.0, 32767.0] + // (See https://github.com/xqemu/xqemu/pull/176) + fa = (float)a; + fb = (float)b; EMUPATCH(D3DDevice_SetVertexData4f)(Register, fa, fb, 0.0f, 1.0f); } -DWORD FloatsToDWORD(FLOAT d, FLOAT a, FLOAT b, FLOAT c) -{ - DWORD ca = (FtoDW(d) << 24); - DWORD cr = (FtoDW(a) << 16) & 0x00FF0000; - DWORD cg = (FtoDW(b) << 8) & 0x0000FF00; - DWORD cb = (FtoDW(c) << 0) & 0x000000FF; +extern uint32_t HLE_read_NV2A_pgraph_register(const int reg); // Declared in PushBuffer.cpp +extern void HLE_write_NV2A_vertex_attribute_slot(unsigned slot, uint32_t parameter); // Declared in PushBuffer.cpp +extern uint32_t HLE_read_NV2A_vertex_attribute_slot(unsigned VertexSlot); // Declared in PushBuffer.cpp - return ca | cr | cg | cb; +extern NV2ADevice* g_NV2A; + +// ****************************************************************** +// * patch: D3DDevice_SetVertexData4f_16 +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f_16) +( + FLOAT a, + FLOAT b, + FLOAT c, + FLOAT d +) +{ + // This is an LTCG specific version of SetVertexData4f where the first param is passed in edi + int Register = 0; + __asm{ + mov Register, edi + } + + LOG_FORWARD("D3DDevice_SetVertexData4f"); + + EMUPATCH(D3DDevice_SetVertexData4f)(Register, a, b, c, d); } // ****************************************************************** @@ -4058,8 +4649,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) FLOAT d ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Register) LOG_FUNC_ARG(a) @@ -4068,7 +4657,26 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) LOG_FUNC_ARG(d) LOG_FUNC_END; - HRESULT hRet = D3D_OK; + HRESULT hRet = D3D_OK; + + // Get the vertex shader flags (if any is active) : + uint32_t ActiveVertexAttributeFlags = 0; + if (VshHandleIsVertexShader(g_Xbox_VertexShader_Handle)) { + LOG_TEST_CASE("D3DDevice_SetVertexData4f with active VertexShader"); + X_D3DVertexShader *pXboxVertexShader = VshHandleToXboxVertexShader(g_Xbox_VertexShader_Handle); + if (!(pXboxVertexShader->Flags & 0x10/*=X_VERTEXSHADER_PROGRAM*/)) { + ActiveVertexAttributeFlags = pXboxVertexShader->Flags; + } + + // If we have an active vertex shader, we also write the input to a vertex shader constant + // This allows us to implement Xbox functionality where SetVertexData4f can be used to specify attributes + // not present in the vertex declaration. + // We use range 193 and up to store these values, as Xbox shaders stop at c192! + FLOAT values[] = {a,b,c,d}; + if (Register < 0) LOG_TEST_CASE("Register < 0"); + if (Register >= 16) LOG_TEST_CASE("Register >= 16"); + g_pD3DDevice->SetVertexShaderConstantF(CXBX_D3DVS_CONSTREG_VREGDEFAULTS_BASE + Register, values, 1); + } // Grow g_InlineVertexBuffer_Table to contain at least current, and a potentially next vertex if (g_InlineVertexBuffer_TableLength <= g_InlineVertexBuffer_TableOffset + 1) { @@ -4079,30 +4687,55 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) } g_InlineVertexBuffer_Table = (struct _D3DIVB*)realloc(g_InlineVertexBuffer_Table, sizeof(struct _D3DIVB) * g_InlineVertexBuffer_TableLength); - DbgPrintf("Reallocated g_InlineVertexBuffer_Table to %d entries\n", g_InlineVertexBuffer_TableLength); + EmuLog(LOG_LEVEL::DEBUG, "Reallocated g_InlineVertexBuffer_Table to %d entries", g_InlineVertexBuffer_TableLength); } // Is this the initial call after D3DDevice_Begin() ? if (g_InlineVertexBuffer_FVF == 0) { // Set first vertex to zero (preventing leaks from prior Begin/End calls) g_InlineVertexBuffer_Table[0] = {}; - // Set default diffuse color to white - g_InlineVertexBuffer_Table[0].Diffuse = D3DCOLOR_ARGB(255, 255, 255, 255); - // TODO : Handle D3DUSAGE_PERSISTENTDIFFUSE, D3DUSAGE_PERSISTENTSPECULAR, - // D3DUSAGE_PERSISTENTBACKDIFFUSE, and D3DUSAGE_PERSISTENTBACKSPECULAR + + // Handle persistent vertex attribute flags, by resetting non-persistent colors + // to their default value (and leaving the persistent colors alone - see the + // "Copy all attributes of the previous vertex" comment below) : + static const uint32_t ColorBlack = D3DCOLOR_ARGB(0, 0, 0, 0); + static const uint32_t ColorWhite = D3DCOLOR_ARGB(255, 255, 255, 255); + + // If needed, write default vertex colors to HLE NV2A pgraph : + if (!(ActiveVertexAttributeFlags & X_D3DUSAGE_PERSISTENTDIFFUSE)) { + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_DIFFUSE, ColorWhite); + } + + if (!(ActiveVertexAttributeFlags & X_D3DUSAGE_PERSISTENTSPECULAR)) { + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_SPECULAR, ColorBlack); + } + + if (!(ActiveVertexAttributeFlags & X_D3DUSAGE_PERSISTENTBACKDIFFUSE)) { + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKDIFFUSE, ColorWhite); + } + + if (!(ActiveVertexAttributeFlags & X_D3DUSAGE_PERSISTENTBACKSPECULAR)) { + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKSPECULAR, ColorBlack); + } + + // Read starting vertex colors from HLE NV2A pgraph : + g_InlineVertexBuffer_Table[0].Diffuse = HLE_read_NV2A_vertex_attribute_slot(X_D3DVSDE_DIFFUSE); + g_InlineVertexBuffer_Table[0].Specular = HLE_read_NV2A_vertex_attribute_slot(X_D3DVSDE_SPECULAR); + g_InlineVertexBuffer_Table[0].BackDiffuse = HLE_read_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKDIFFUSE); + g_InlineVertexBuffer_Table[0].BackSpecular = HLE_read_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKSPECULAR); } int o = g_InlineVertexBuffer_TableOffset; - uint FVFPosType = g_InlineVertexBuffer_FVF & D3DFVF_POSITION_MASK; + unsigned int FVFPosType = g_InlineVertexBuffer_FVF & D3DFVF_POSITION_MASK; - switch(Register) - { - case X_D3DVSDE_VERTEX: - case X_D3DVSDE_POSITION: - { + switch(Register) + { + case X_D3DVSDE_VERTEX: + case X_D3DVSDE_POSITION: + { // Note : Setting position signals completion of a vertex - g_InlineVertexBuffer_Table[o].Position.x = a; - g_InlineVertexBuffer_Table[o].Position.y = b; + g_InlineVertexBuffer_Table[o].Position.x = a; + g_InlineVertexBuffer_Table[o].Position.y = b; g_InlineVertexBuffer_Table[o].Position.z = c; g_InlineVertexBuffer_Table[o].Rhw = d; // Was : 1.0f; // Dxbx note : Why set Rhw to 1.0? And why ignore d? @@ -4126,27 +4759,23 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) // These are alright break; default: - EmuWarning("D3DDevice_SetVertexData4f unexpected FVF when selecting D3DFVF_XYZ(RHW) : %x", g_InlineVertexBuffer_FVF); + EmuLog(LOG_LEVEL::WARNING, "D3DDevice_SetVertexData4f unexpected FVF when selecting D3DFVF_XYZ(RHW) : %x", g_InlineVertexBuffer_FVF); // TODO : How to resolve this? } // Start a new vertex g_InlineVertexBuffer_TableOffset++; // Copy all attributes of the previous vertex (if any) to the new vertex - static UINT uiPreviousOffset = ~0; // Can't use 0, as that may be copied too - if (uiPreviousOffset != ~0) { - g_InlineVertexBuffer_Table[g_InlineVertexBuffer_TableOffset] = g_InlineVertexBuffer_Table[uiPreviousOffset]; - } - uiPreviousOffset = g_InlineVertexBuffer_TableOffset; + g_InlineVertexBuffer_Table[g_InlineVertexBuffer_TableOffset] = g_InlineVertexBuffer_Table[o]; break; - } + } case X_D3DVSDE_BLENDWEIGHT: { - g_InlineVertexBuffer_Table[o].Blend[0] = a; - g_InlineVertexBuffer_Table[o].Blend[1] = b; - g_InlineVertexBuffer_Table[o].Blend[2] = c; + g_InlineVertexBuffer_Table[o].Blend[0] = a; + g_InlineVertexBuffer_Table[o].Blend[1] = b; + g_InlineVertexBuffer_Table[o].Blend[2] = c; g_InlineVertexBuffer_Table[o].Blend[3] = d; // TODO: Test the above. // Xbox supports up to 4 blendweights @@ -4161,7 +4790,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) // These are alright break; default: - EmuWarning("D3DDevice_SetVertexData4f unexpected FVF when processing X_D3DVSDE_BLENDWEIGHT : %x", g_InlineVertexBuffer_FVF); + EmuLog(LOG_LEVEL::WARNING, "D3DDevice_SetVertexData4f unexpected FVF when processing X_D3DVSDE_BLENDWEIGHT : %x", g_InlineVertexBuffer_FVF); g_InlineVertexBuffer_FVF &= ~D3DFVF_POSITION_MASK; // for now, remove prior position mask, leading to blending below g_InlineVertexBuffer_FVF |= D3DFVF_XYZB1; // TODO: How to select blendweight D3DFVF_XYZB2 or up? @@ -4169,35 +4798,37 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) } break; - } + } case X_D3DVSDE_NORMAL: - { - g_InlineVertexBuffer_Table[o].Normal.x = a; - g_InlineVertexBuffer_Table[o].Normal.y = b; + { + g_InlineVertexBuffer_Table[o].Normal.x = a; + g_InlineVertexBuffer_Table[o].Normal.y = b; g_InlineVertexBuffer_Table[o].Normal.z = c; - g_InlineVertexBuffer_FVF |= D3DFVF_NORMAL; + g_InlineVertexBuffer_FVF |= D3DFVF_NORMAL; break; - } + } - case X_D3DVSDE_DIFFUSE: - { - g_InlineVertexBuffer_Table[o].Diffuse = D3DCOLOR_COLORVALUE(a, b, c, d); - g_InlineVertexBuffer_FVF |= D3DFVF_DIFFUSE; + case X_D3DVSDE_DIFFUSE: + { + g_InlineVertexBuffer_Table[o].Diffuse = D3DCOLOR_COLORVALUE(a, b, c, d); + g_InlineVertexBuffer_FVF |= D3DFVF_DIFFUSE; + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_DIFFUSE, g_InlineVertexBuffer_Table[o].Diffuse); break; - } + } case X_D3DVSDE_SPECULAR: - { - g_InlineVertexBuffer_Table[o].Specular = D3DCOLOR_COLORVALUE(a, b, c, d); - g_InlineVertexBuffer_FVF |= D3DFVF_SPECULAR; + { + g_InlineVertexBuffer_Table[o].Specular = D3DCOLOR_COLORVALUE(a, b, c, d); + g_InlineVertexBuffer_FVF |= D3DFVF_SPECULAR; + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_SPECULAR, g_InlineVertexBuffer_Table[o].Specular); break; - } + } case X_D3DVSDE_FOG: // Xbox extension { g_InlineVertexBuffer_Table[o].Fog = a; // TODO : What about the other (b, c and d) arguments? - EmuWarning("Host Direct3D8 doesn''t support FVF FOG"); + //EmuLog(LOG_LEVEL::WARNING, "Host Direct3D8 doesn''t support FVF FOG"); break; } @@ -4206,37 +4837,39 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) case X_D3DVSDE_BACKDIFFUSE: // Xbox extension { g_InlineVertexBuffer_Table[o].BackDiffuse = D3DCOLOR_COLORVALUE(a, b, c, d); - EmuWarning("Host Direct3D8 doesn''t support FVF BACKDIFFUSE"); + //EmuLog(LOG_LEVEL::WARNING, "Host Direct3D8 doesn''t support FVF BACKDIFFUSE"); + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKDIFFUSE, g_InlineVertexBuffer_Table[o].BackDiffuse); break; } case X_D3DVSDE_BACKSPECULAR: // Xbox extension { g_InlineVertexBuffer_Table[o].BackSpecular = D3DCOLOR_COLORVALUE(a, b, c, d); - EmuWarning("Host Direct3D8 doesn''t support FVF BACKSPECULAR"); + //EmuLog(LOG_LEVEL::WARNING, "Host Direct3D8 doesn''t support FVF BACKSPECULAR"); + HLE_write_NV2A_vertex_attribute_slot(X_D3DVSDE_BACKSPECULAR, g_InlineVertexBuffer_Table[o].BackSpecular); break; } case X_D3DVSDE_TEXCOORD0: - { - g_InlineVertexBuffer_Table[o].TexCoord[0].x = a; + { + g_InlineVertexBuffer_Table[o].TexCoord[0].x = a; g_InlineVertexBuffer_Table[o].TexCoord[0].y = b; g_InlineVertexBuffer_Table[o].TexCoord[0].z = c; g_InlineVertexBuffer_Table[o].TexCoord[0].w = d; - if ((g_InlineVertexBuffer_FVF & D3DFVF_TEXCOUNT_MASK) < D3DFVF_TEX1) { + if ((g_InlineVertexBuffer_FVF & D3DFVF_TEXCOUNT_MASK) < D3DFVF_TEX1) { // Dxbx fix : Use mask, else the format might get expanded incorrectly : g_InlineVertexBuffer_FVF &= ~D3DFVF_TEXCOUNT_MASK; g_InlineVertexBuffer_FVF |= D3DFVF_TEX1; // Dxbx note : Correct usage of D3DFVF_TEX1 (and the other cases below) // can be tested with "Daphne Xbox" (the Laserdisc Arcade Game Emulator). - } + } break; - } + } case X_D3DVSDE_TEXCOORD1: - { - g_InlineVertexBuffer_Table[o].TexCoord[1].x = a; + { + g_InlineVertexBuffer_Table[o].TexCoord[1].x = a; g_InlineVertexBuffer_Table[o].TexCoord[1].y = b; g_InlineVertexBuffer_Table[o].TexCoord[1].z = c; g_InlineVertexBuffer_Table[o].TexCoord[1].w = d; @@ -4246,11 +4879,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) } break; - } + } case X_D3DVSDE_TEXCOORD2: - { - g_InlineVertexBuffer_Table[o].TexCoord[2].x = a; + { + g_InlineVertexBuffer_Table[o].TexCoord[2].x = a; g_InlineVertexBuffer_Table[o].TexCoord[2].y = b; g_InlineVertexBuffer_Table[o].TexCoord[2].z = c; g_InlineVertexBuffer_Table[o].TexCoord[2].w = d; @@ -4260,11 +4893,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) } break; - } + } case X_D3DVSDE_TEXCOORD3: - { - g_InlineVertexBuffer_Table[o].TexCoord[3].x = a; + { + g_InlineVertexBuffer_Table[o].TexCoord[3].x = a; g_InlineVertexBuffer_Table[o].TexCoord[3].y = b; g_InlineVertexBuffer_Table[o].TexCoord[3].z = c; g_InlineVertexBuffer_Table[o].TexCoord[3].w = d; @@ -4273,12 +4906,12 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4f) g_InlineVertexBuffer_FVF |= D3DFVF_TEX4; } - break; - } + break; + } - default: - EmuWarning("Unknown IVB Register : %d", Register); - } + default: + EmuLog(LOG_LEVEL::WARNING, "Unknown IVB Register : %d", Register); + } } // ****************************************************************** @@ -4293,8 +4926,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4ub) BYTE d ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexData4f"); float fa = a / 255.0f; @@ -4317,31 +4948,18 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexData4s) SHORT d ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexData4f"); float fa, fb, fc, fd; - // Special case: If the input register is a color, don't transform! // Test case: Halo - switch (Register) { - case X_D3DVSDE_DIFFUSE: - case X_D3DVSDE_SPECULAR: - case X_D3DVSDE_BACKDIFFUSE: - case X_D3DVSDE_BACKSPECULAR: - fa = a; - fb = b; - fc = c; - fd = d; - break; - default: - fa = a / 32767.0f; - fb = b / 32767.0f; - fc = c / 32767.0f; - fd = d / 32767.0f; - break; - } + // Note : XQEMU verified that the int16_t arguments + // must be mapped to floats in the range [-32768.0, 32767.0] + // (See https://github.com/xqemu/xqemu/pull/176) + fa = (float)a; + fb = (float)b; + fc = (float)c; + fd = (float)d; EMUPATCH(D3DDevice_SetVertexData4f)(Register, fa, fb, fc, fd); } @@ -4355,16 +4973,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexDataColor) D3DCOLOR Color ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetVertexData4f"); - FLOAT a = ((Color & 0xFF000000) >> 24) / 255.0f; - FLOAT r = ((Color & 0x00FF0000) >> 16) / 255.0f; - FLOAT g = ((Color & 0x0000FF00) >> 8) / 255.0f; - FLOAT b = ((Color & 0x000000FF) >> 0) / 255.0f; + D3DXCOLOR XColor = Color; - EMUPATCH(D3DDevice_SetVertexData4f)(Register, r, g, b, a); + EMUPATCH(D3DDevice_SetVertexData4f)(Register, XColor.r, XColor.g, XColor.b, XColor.a); } // ****************************************************************** @@ -4372,8 +4985,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexDataColor) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_End)() { - FUNC_EXPORTS - LOG_FUNC(); if(g_InlineVertexBuffer_TableOffset > 0) @@ -4393,8 +5004,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_RunPushBuffer) X_D3DFixup *pFixup ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pPushBuffer) LOG_FUNC_ARG(pFixup) @@ -4416,8 +5025,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Clear) DWORD Stencil ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Count) LOG_FUNC_ARG(pRects) @@ -4434,7 +5041,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Clear) if (Flags & X_D3DCLEAR_TARGET) { // TODO: D3DCLEAR_TARGET_A, *R, *G, *B don't exist on windows if ((Flags & X_D3DCLEAR_TARGET) != X_D3DCLEAR_TARGET) - EmuWarning("Unsupported : Partial D3DCLEAR_TARGET flag(s) for D3DDevice_Clear : 0x%.08X", Flags & X_D3DCLEAR_TARGET); + EmuLog(LOG_LEVEL::WARNING, "Unsupported : Partial D3DCLEAR_TARGET flag(s) for D3DDevice_Clear : 0x%.08X", Flags & X_D3DCLEAR_TARGET); HostFlags |= D3DCLEAR_TARGET; } @@ -4444,7 +5051,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Clear) if (g_bHasDepth) HostFlags |= D3DCLEAR_ZBUFFER; else - EmuWarning("Unsupported : D3DCLEAR_ZBUFFER flag for D3DDevice_Clear without ZBuffer"); + EmuLog(LOG_LEVEL::WARNING, "Unsupported : D3DCLEAR_ZBUFFER flag for D3DDevice_Clear without ZBuffer"); } // Only clear depth buffer and stencil if present @@ -4455,31 +5062,115 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Clear) if (g_bHasStencil) HostFlags |= D3DCLEAR_STENCIL; else - EmuWarning("Unsupported : D3DCLEAR_STENCIL flag for D3DDevice_Clear without ZBuffer"); + EmuLog(LOG_LEVEL::WARNING, "Unsupported : D3DCLEAR_STENCIL flag for D3DDevice_Clear without ZBuffer"); } if(Flags & ~(X_D3DCLEAR_TARGET | X_D3DCLEAR_ZBUFFER | X_D3DCLEAR_STENCIL)) - EmuWarning("Unsupported Flag(s) for D3DDevice_Clear : 0x%.08X", Flags & ~(X_D3DCLEAR_TARGET | X_D3DCLEAR_ZBUFFER | X_D3DCLEAR_STENCIL)); + EmuLog(LOG_LEVEL::WARNING, "Unsupported Flag(s) for D3DDevice_Clear : 0x%.08X", Flags & ~(X_D3DCLEAR_TARGET | X_D3DCLEAR_ZBUFFER | X_D3DCLEAR_STENCIL)); } - DWORD dwFillMode; + HRESULT hRet; - if(g_iWireframe == 0) - dwFillMode = g_CurrentFillMode; - else if(g_iWireframe == 1) - dwFillMode = D3DFILL_WIREFRAME; - else - dwFillMode = D3DFILL_POINT; + if (pRects != nullptr) { + // Scale the fill based on our scale factor + D3DRECT rect = *pRects; + rect.x1 *= g_RenderScaleFactor; + rect.x2 *= g_RenderScaleFactor; + rect.y1 *= g_RenderScaleFactor; + rect.y2 *= g_RenderScaleFactor; + hRet = g_pD3DDevice->Clear(Count, &rect, HostFlags, Color, Z, Stencil); + } else { + hRet = g_pD3DDevice->Clear(Count, pRects, HostFlags, Color, Z, Stencil); + } - HRESULT hRet; - - hRet = g_pD3DDevice->SetRenderState(D3DRS_FILLMODE, dwFillMode); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); - - hRet = g_pD3DDevice->Clear(Count, pRects, HostFlags, Color, Z, Stencil); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->Clear"); } + +// ****************************************************************** +// * patch: D3DDevice_CopyRects +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_CopyRects) +( + X_D3DSurface* pSourceSurface, + CONST RECT* pSourceRectsArray, + UINT cRects, + X_D3DSurface* pDestinationSurface, + CONST POINT* pDestPointsArray +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pSourceSurface); + LOG_FUNC_ARG(pSourceRectsArray); + LOG_FUNC_ARG(cRects); + LOG_FUNC_ARG(pDestinationSurface); + LOG_FUNC_ARG(pDestPointsArray); + LOG_FUNC_END; + + // We skip the trampoline to prevent unnecessary work + // As our surfaces remain on the GPU, calling the trampoline would just + // result in a memcpy from an empty Xbox surface to another empty Xbox Surface + D3DSURFACE_DESC SourceDesc, DestinationDesc; + auto pHostSourceSurface = GetHostSurface(pSourceSurface); + auto pHostDestSurface = GetHostSurface(pDestinationSurface); + + if (pHostSourceSurface == nullptr || pHostDestSurface == nullptr) { + // Test Case: DOA2 attempts to copy from an index buffer resource type + // TODO: What should we do here? + LOG_TEST_CASE("D3DDevice-CopyRects: Failed to fetch host surfaces"); + return; + } + + pHostSourceSurface->GetDesc(&SourceDesc); + pHostDestSurface->GetDesc(&DestinationDesc); + + // If the source is a render-target and the destination is not, we need force it to be re-created as one + // This is because StrechRects cannot copy from a Render-Target to a Non-Render Target + // Test Case: Crash Bandicoot: Wrath of Cortex attemps to copy the render-target to a texture + // This fixes an issue on the pause screen where the screenshot of the current scene was not displayed correctly + if ((SourceDesc.Usage & D3DUSAGE_RENDERTARGET) != 0 && (DestinationDesc.Usage & D3DUSAGE_RENDERTARGET) == 0) { + pHostDestSurface = GetHostSurface(pDestinationSurface, D3DUSAGE_RENDERTARGET); + pHostDestSurface->GetDesc(&DestinationDesc); + } + + // If no rectangles were given, default to 1 (entire surface) + if (cRects == 0) { + cRects = 1; + } + + for (UINT i = 0; i < cRects; i++) { + RECT SourceRect, DestRect; + + if (pSourceRectsArray != nullptr) { + SourceRect = pSourceRectsArray[i]; + } else { + SourceRect.left = 0; + SourceRect.right = SourceDesc.Width; + SourceRect.top = 0; + SourceRect.bottom = SourceDesc.Height; + } + + if (pDestPointsArray != nullptr) { + DestRect.left = pDestPointsArray[i].x; + DestRect.right = DestRect.left + (SourceRect.right - SourceRect.left); + DestRect.top = pDestPointsArray[i].y; + DestRect.bottom = DestRect.top + (SourceRect.bottom - SourceRect.top); + } else if (pSourceRectsArray) { + DestRect = SourceRect; + } else { + DestRect.left = 0; + DestRect.right = DestinationDesc.Width; + DestRect.top = 0; + DestRect.bottom = DestinationDesc.Height; + } + + HRESULT hRet = g_pD3DDevice->StretchRect(pHostSourceSurface, &SourceRect, pHostDestSurface, &DestRect, D3DTEXF_NONE); + if (FAILED(hRet)) { + LOG_TEST_CASE("D3DDevice_CopyRects: Failed to copy surface"); + } + } +} + #define CXBX_SWAP_PRESENT_FORWARD (256 + 4 + 1) // = CxbxPresentForwardMarker + D3DSWAP_FINISH + D3DSWAP_COPY // ****************************************************************** @@ -4493,8 +5184,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_Present) PVOID pDummy2 ) { - FUNC_EXPORTS - // LOG_FORWARD("D3DDevice_Swap"); LOG_FUNC_BEGIN LOG_FUNC_ARG(pSourceRect) @@ -4515,8 +5204,6 @@ DWORD XTL::EMUPATCH(D3DDevice_Swap_0) ( ) { - FUNC_EXPORTS; - uint32_t param; __asm { mov param, eax; @@ -4533,55 +5220,47 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) DWORD Flags ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Flags); // TODO: Ensure this flag is always the same across library versions if (Flags != 0 && Flags != CXBX_SWAP_PRESENT_FORWARD) - EmuWarning("XTL::EmuD3DDevice_Swap: Flags != 0"); + EmuLog(LOG_LEVEL::WARNING, "XTL::EmuD3DDevice_Swap: Flags != 0"); // Fetch the host backbuffer - XTL::IDirect3DSurface *pCurrentHostBackBuffer = nullptr; + IDirect3DSurface *pCurrentHostBackBuffer = nullptr; HRESULT hRet = g_pD3DDevice->GetBackBuffer( -#ifdef CXBX_USE_D3D9 0, // iSwapChain -#endif - 0, XTL::D3DBACKBUFFER_TYPE_MONO, &pCurrentHostBackBuffer); + 0, D3DBACKBUFFER_TYPE_MONO, &pCurrentHostBackBuffer); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetBackBuffer - Unable to get backbuffer surface!"); if (hRet == D3D_OK) { assert(pCurrentHostBackBuffer != nullptr); - pCurrentHostBackBuffer->UnlockRect(); // remove any old lock - - // Get backbuffer dimenions; TODO : remember this once, at creation/resize time + // Get backbuffer dimensions; TODO : remember this once, at creation/resize time D3DSURFACE_DESC BackBufferDesc; pCurrentHostBackBuffer->GetDesc(&BackBufferDesc); + + // TODO: Implement a hot-key to change the filter? + // Note: LoadSurfaceFilter Must be D3DTEXF_NONE, D3DTEXF_POINT or D3DTEXF_LINEAR + // Before StretchRects we used D3DX_FILTER_POINT here, but that gave jagged edges in Dashboard. + // Dxbx note : D3DX_FILTER_LINEAR gives a smoother image, but 'bleeds' across borders + // LoadOverlayFilter must be a D3DX filter DWORD value + const D3DTEXTUREFILTERTYPE LoadSurfaceFilter = D3DTEXF_LINEAR; + const DWORD LoadOverlayFilter = D3DX_DEFAULT; + + auto pXboxBackBufferHostSurface = GetHostSurface(g_pXbox_BackBufferSurface, D3DUSAGE_RENDERTARGET); + if (pXboxBackBufferHostSurface) { + // Blit Xbox BackBuffer to host BackBuffer + // TODO: Respect aspect ratio + hRet = g_pD3DDevice->StretchRect( + /* pSourceSurface = */ pXboxBackBufferHostSurface, + /* pSourceRect = */ nullptr, + /* pDestSurface = */ pCurrentHostBackBuffer, + /* pDestRect = */ nullptr, + /* Filter = */ LoadSurfaceFilter + ); - const DWORD LoadSurfaceFilter = D3DX_DEFAULT; // == D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER - // Previously we used D3DX_FILTER_POINT here, but that gave jagged edges in Dashboard. - // Dxbx note : D3DX_FILTER_LINEAR gives a smoother image, but 'bleeds' across borders - - if (!g_DirectHostBackBufferAccess) { - auto pXboxBackBufferHostSurface = GetHostSurface(g_XboxBackBufferSurface); - if (pXboxBackBufferHostSurface) { - // Blit Xbox BackBuffer to host BackBuffer - // TODO: This could be much faster if we used the XboxBackBufferSurface as a texture and blitted with a fullscreen quad - // This way, the scaling/format conversion would be handled by the GPU instead - // If we were using native D3D9, we could just use StretchRects instead, but D3D8 doesn't have that feature! - hRet = D3DXLoadSurfaceFromSurface( - /* pDestSurface = */ pCurrentHostBackBuffer, - /* pDestPalette = */ nullptr, - /* pDestRect = */ nullptr, - /* pSrcSurface = */ pXboxBackBufferHostSurface, - /* pSrcPalette = */ nullptr, - /* pSrcRect = */ nullptr, - /* Filter = */ LoadSurfaceFilter, - /* ColorKey = */ 0); - - if (hRet != D3D_OK) { - EmuWarning("Couldn't blit Xbox BackBuffer to host BackBuffer : %X", hRet); - } + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Couldn't blit Xbox BackBuffer to host BackBuffer : %X", hRet); } } @@ -4594,18 +5273,35 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) // Interpret the Xbox overlay data (depending the color space conversion render state) // as either YUV or RGB format (note that either one must be a 3 bytes per pixel format) - D3DFORMAT PCFormat = g_bColorSpaceConvertYuvToRgb ? D3DFMT_R8G8B8 : D3DFMT_YUY2; + D3DFORMAT PCFormat; + // TODO : Before reading from pgraph, flush all pending push-buffer commands + switch (GET_MASK(HLE_read_NV2A_pgraph_register(NV_PGRAPH_CONTROL_0), NV_PGRAPH_CONTROL_0_CSCONVERT)) { + case 0: // = pass-through + PCFormat = D3DFMT_YUY2; + break; + case 1: // = CRYCB_TO_RGB + PCFormat = D3DFMT_YUY2; // Test-case : Turok (intro movie) + break; + case 2: // = SCRYSCB_TO_RGB + LOG_TEST_CASE("SCRYSCB_TO_RGB"); + PCFormat = D3DFMT_YUY2; + break; + default: + LOG_TEST_CASE("Unrecognized NV_PGRAPH_CONTROL_0_CSCONVERT"); + PCFormat = D3DFMT_YUY2; + break; + } // Blit Xbox overlay to host backbuffer - uint08 *pOverlayData = (uint08*)GetDataFromXboxResource(&g_OverlayProxy.Surface); + uint8_t *pOverlayData = (uint8_t*)GetDataFromXboxResource(&g_OverlayProxy.Surface); UINT OverlayWidth, OverlayHeight, OverlayDepth, OverlayRowPitch, OverlaySlicePitch; CxbxGetPixelContainerMeasures( &g_OverlayProxy.Surface, 0, // dwMipMapLevel &OverlayWidth, &OverlayHeight, &OverlayDepth, &OverlayRowPitch, &OverlaySlicePitch); - RECT EmuSourRect; - RECT EmuDestRect; + RECT EmuSourRect = { 0 }; + RECT EmuDestRect = { 0 }; if (g_OverlayProxy.SrcRect.right > 0) { EmuSourRect = g_OverlayProxy.SrcRect; @@ -4617,9 +5313,24 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) if (g_OverlayProxy.DstRect.right > 0) { // If there's a destination rectangle given, copy that into our local variable : EmuDestRect = g_OverlayProxy.DstRect; + + // Make sure to scale the values based on the difference between the Xbox and Host backbuffer + // We can't use the scale factor here because we are blitting directly to the host backbuffer + // NOT an Xbox surface! + DWORD XboxBackBufferWidth = GetPixelContainerWidth(g_pXbox_BackBufferSurface); + DWORD XboxBackBufferHeight = GetPixelContainerHeight(g_pXbox_BackBufferSurface); + + float xScale = (float)BackBufferDesc.Width / (float)XboxBackBufferWidth; + float yScale = (float)BackBufferDesc.Height / (float)XboxBackBufferHeight; + + EmuDestRect.top = (LONG)(EmuDestRect.top * yScale); + EmuDestRect.left = (LONG)(EmuDestRect.left * xScale); + EmuDestRect.bottom = (LONG)(EmuDestRect.bottom * yScale); + EmuDestRect.right = (LONG)(EmuDestRect.right * xScale); } else { - // Should this be our backbuffer size rather than the actual window size? - GetClientRect(g_hEmuWindow, &EmuDestRect); + // Use backbuffer width/height since that may differ from the Window size + EmuDestRect.right = BackBufferDesc.Width; + EmuDestRect.bottom = BackBufferDesc.Height; } // load the YUY2 into the backbuffer @@ -4638,25 +5349,59 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) } } - // Use D3DXLoadSurfaceFromMemory() to do conversion, stretching and filtering - // avoiding the need for YUY2toARGB() (might become relevant when porting to D3D9 or OpenGL) - // see https://msdn.microsoft.com/en-us/library/windows/desktop/bb172902(v=vs.85).aspx - hRet = D3DXLoadSurfaceFromMemory( - /* pDestSurface = */ pCurrentHostBackBuffer, - /* pDestPalette = */ nullptr, - /* pDestRect = */ &EmuDestRect, - /* pSrcMemory = */ pOverlayData, // Source buffer - /* SrcFormat = */ PCFormat, - /* SrcPitch = */ OverlayRowPitch, - /* pSrcPalette = */ nullptr, - /* pSrcRect = */ &EmuSourRect, // This parameter cannot be NULL - /* Filter = */ LoadSurfaceFilter, - /* ColorKey = */ g_OverlayProxy.EnableColorKey ? g_OverlayProxy.ColorKey : 0); + // Create a temporary surface to hold the overlay + // This is faster than loading directly into the backbuffer because it offloads scaling to the GPU + // Without this, upscaling tanks the frame-rate! + IDirect3DSurface* pTemporaryOverlaySurface; + HRESULT hRet = g_pD3DDevice->CreateOffscreenPlainSurface( + OverlayWidth, + OverlayHeight, + D3DFMT_A8R8G8B8, + D3DPOOL_DEFAULT, + &pTemporaryOverlaySurface, + nullptr + ); - DEBUG_D3DRESULT(hRet, "D3DXLoadSurfaceFromMemory - UpdateOverlay could not convert buffer!\n"); - if (hRet != D3D_OK) { - EmuWarning("Couldn't blit Xbox overlay to host BackBuffer : %X", hRet); - } + if (FAILED(hRet)) { + EmuLog(LOG_LEVEL::WARNING, "Couldn't create temporary overlay surface : %X", hRet); + } else { + RECT doNotScaleRect = { 0, 0, (LONG)OverlayWidth, (LONG)OverlayHeight }; + + // Use D3DXLoadSurfaceFromMemory() to do conversion, we don't stretch at this moment in time + // avoiding the need for YUY2toARGB() (might become relevant when porting to D3D9 or OpenGL) + // see https://msdn.microsoft.com/en-us/library/windows/desktop/bb172902(v=vs.85).aspx + hRet = D3DXLoadSurfaceFromMemory( + /* pDestSurface = */ pTemporaryOverlaySurface, + /* pDestPalette = */ nullptr, + /* pDestRect = */ &doNotScaleRect, + /* pSrcMemory = */ pOverlayData, // Source buffer + /* SrcFormat = */ PCFormat, + /* SrcPitch = */ OverlayRowPitch, + /* pSrcPalette = */ nullptr, + /* pSrcRect = */ &doNotScaleRect, // This parameter cannot be NULL + /* Filter = */ LoadOverlayFilter, + /* ColorKey = */ g_OverlayProxy.EnableColorKey ? g_OverlayProxy.ColorKey : 0); + + DEBUG_D3DRESULT(hRet, "D3DXLoadSurfaceFromMemory - UpdateOverlay could not convert buffer!\n"); + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Couldn't load Xbox overlay to host surface : %X", hRet); + } else { + // TODO: Respect aspect ratio + hRet = g_pD3DDevice->StretchRect( + /* pSourceSurface = */ pTemporaryOverlaySurface, + /* pSourceRect = */ &EmuSourRect, + /* pDestSurface = */ pCurrentHostBackBuffer, + /* pDestRect = */ &EmuDestRect, + /* Filter = */ LoadSurfaceFilter + ); + + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Couldn't load Xbox overlay to host back buffer : %X", hRet); + } + } + + pTemporaryOverlaySurface->Release(); + } } pCurrentHostBackBuffer->Release(); @@ -4669,19 +5414,59 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) hRet = g_pD3DDevice->BeginScene(); - if (!g_UncapFramerate) { - // If the last frame completed faster than the Xbox VBlank period, wait for it - // TODO: Read the frame rate target from the Xbox display mode - // See comments in GetNextVblankTime(); - auto targetDuration = 16.6666666667ms; - while (std::chrono::high_resolution_clock::now() - frameStartTime < targetDuration) { - // We use an empty while loop because actually sleeping is too unstable - // Sleeping causes the frame duration to jitter... - ; - } + // RenderStates need reapplying each frame, but can be re-used between draw calls + // This forces them to be reset + XboxRenderStates.SetDirty(); - frameStartTime = std::chrono::high_resolution_clock::now(); - } + // Check if we need to enable our frame-limiter + DWORD presentationInverval = g_Xbox_PresentationInterval_Override > 0 ? g_Xbox_PresentationInterval_Override : g_Xbox_PresentationInterval_Default; + if ((presentationInverval != D3DPRESENT_INTERVAL_IMMEDIATE) && !g_bHack_UnlockFramerate) { + // If the last frame completed faster than the Xbox target swap rate, wait for it + + auto targetRefreshRate = 60.0f; // TODO: Read from Xbox Display Mode + + // Determine how many 'frames' worth of time we need to wait for + // This allows games that require a locked framerate (eg JSRF) to function correctly + // While allowing titles with an unlocked frame-rate to not be limited + auto multiplier = 1.0f; + switch (presentationInverval) { + case D3DPRESENT_INTERVAL_ONE: + case 0x80000001: // D3DPRESENT_INTERVAL_ONE_OR_IMMEDIATE: + multiplier = 1.0f; + break; + case D3DPRESENT_INTERVAL_TWO: + case 0x80000002: // D3DPRESENT_INTERVAL_TWO_OR_IMMEDIATE: + multiplier = 2.0f; + break; + case D3DPRESENT_INTERVAL_THREE: + multiplier = 3.0f; + break; + case D3DPRESENT_INTERVAL_FOUR: + multiplier = 4.0f; + break; + } + + auto targetDuration = std::chrono::duration(((1000.0f / targetRefreshRate) * multiplier)); + auto targetTimestamp = frameStartTime + targetDuration; + auto actualDuration = std::chrono::duration(std::chrono::high_resolution_clock::now() - frameStartTime); + auto startTimeAjustment = actualDuration - targetDuration; + + // Only enter the wait loop if the frame took too long + if (actualDuration < targetDuration) { + // If we need to wait for a larger amount of time (>= 1 frame at 60FPS), we can just sleep + if (std::chrono::duration_cast(targetTimestamp - std::chrono::high_resolution_clock::now()).count() > 16) { + std::this_thread::sleep_until(targetTimestamp); + } else { + // Otherwise, we fall-through and just keep polling + // This prevents large waits from hogging CPU power, but allows small waits/ to remain precice. + while (std::chrono::high_resolution_clock::now() < targetTimestamp) { + ; + } + } + } + } + + frameStartTime = std::chrono::high_resolution_clock::now(); UpdateFPSCounter(); @@ -4700,25 +5485,25 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) // TODO : Check if this should be done at Swap-not-Present-time too : // not really accurate because you definately dont always present on every vblank - g_VBData.Swap = g_VBData.VBlank; + g_Xbox_VBlankData.Swap = g_Xbox_VBlankData.VBlank; - if (g_VBData.VBlank == g_VBLastSwap + 1) - g_VBData.Flags = 1; // D3DVBLANK_SWAPDONE + if (g_Xbox_VBlankData.VBlank == g_VBLastSwap + 1) + g_Xbox_VBlankData.Flags = 1; // D3DVBLANK_SWAPDONE else { - g_VBData.Flags = 2; // D3DVBLANK_SWAPMISSED - g_SwapData.MissedVBlanks++; + g_Xbox_VBlankData.Flags = 2; // D3DVBLANK_SWAPMISSED + g_Xbox_SwapData.MissedVBlanks++; } } // Handle Swap Callback function { - g_SwapData.Swap++; + g_Xbox_SwapData.Swap++; - if(g_pSwapCallback != NULL) + if(g_pXbox_SwapCallback != xbnullptr) { - g_pSwapCallback(&g_SwapData); + g_pXbox_SwapCallback(&g_Xbox_SwapData); } } @@ -4727,17 +5512,59 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) if (Flags == CXBX_SWAP_PRESENT_FORWARD) // Only do this when forwarded from Present result = D3D_OK; // Present always returns success else - result = g_SwapData.Swap; // Swap returns number of swaps + result = g_Xbox_SwapData.Swap; // Swap returns number of swaps return result; } +bool IsSupportedFormat(XTL::X_D3DFORMAT X_Format, XTL::X_D3DRESOURCETYPE XboxResourceType, DWORD D3DUsage) { + // TODO : Nuance the following, because the Direct3D 8 docs states + // CheckDeviceFormat is needed when D3DUSAGE_RENDERTARGET or + // D3DUSAGE_DYNAMNIC is specified. + // Otherwise, lookup resource type and accompanying 'SupportedFormat' array + bool *pbSupportedFormats = g_bSupportsFormatTexture; + + switch (XboxResourceType) { + case XTL::X_D3DRTYPE_SURFACE: { + if (D3DUsage & D3DUSAGE_RENDERTARGET) { + pbSupportedFormats = g_bSupportsFormatSurfaceRenderTarget; + } else if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { + pbSupportedFormats = g_bSupportsFormatSurfaceDepthStencil; + } else { + pbSupportedFormats = g_bSupportsFormatSurface; + } + break; + } + case XTL::X_D3DRTYPE_VOLUME: { + pbSupportedFormats = g_bSupportsFormatTexture; // TODO : Complete + break; + } + case XTL::X_D3DRTYPE_TEXTURE: { + if (D3DUsage & D3DUSAGE_RENDERTARGET) { + pbSupportedFormats = g_bSupportsFormatTextureRenderTarget; + } else if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { + pbSupportedFormats = g_bSupportsFormatTextureDepthStencil; + } else { + pbSupportedFormats = g_bSupportsFormatTexture; + } + break; + } + case XTL::X_D3DRTYPE_VOLUMETEXTURE: { + pbSupportedFormats = g_bSupportsFormatVolumeTexture; // TODO : Complete + break; + } + case XTL::X_D3DRTYPE_CUBETEXTURE: { + pbSupportedFormats = g_bSupportsFormatCubeTexture; // TODO : Complete + break; + } + } // switch XboxResourceType + + return pbSupportedFormats[X_Format]; +} + // Was patch: IDirect3DResource8_Register void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iTextureStage, DWORD dwSize) { - - // DO NOT FUNC_EXPORTS! - if (pResource == xbnullptr) return; @@ -4758,7 +5585,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_PALETTE: ResourceTypeName = "Palette"; break; case XTL::X_D3DRTYPE_FIXUP: ResourceTypeName = "Fixup"; break; default: - EmuWarning("CreateHostResource :-> Unrecognized Xbox Resource Type 0x%.08X", XboxResourceType); + EmuLog(LOG_LEVEL::WARNING, "CreateHostResource :-> Unrecognized Xbox Resource Type 0x%.08X", XboxResourceType); return; } @@ -4775,7 +5602,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText // TODO: Fix or handle this situation..? LOG_TEST_CASE("CreateHostResource : VirtualAddr == 0"); // This is probably an unallocated resource, mapped into contiguous memory (0x80000000 OR 0xF0000000) - EmuWarning("CreateHostResource :-> %s carries no data - skipping conversion", ResourceTypeName); + EmuLog(LOG_LEVEL::WARNING, "CreateHostResource :-> %s carries no data - skipping conversion", ResourceTypeName); return; } @@ -4786,29 +5613,54 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_SURFACE: { XTL::X_D3DSurface *pXboxSurface = (XTL::X_D3DSurface *)pResource; - XTL::X_D3DTexture *pParentXboxTexture = (pXboxSurface) ? (XTL::X_D3DTexture *)pXboxSurface->Parent : xbnullptr; - if (pParentXboxTexture) { - XTL::IDirect3DBaseTexture *pParentHostBaseTexture = GetHostBaseTexture(pParentXboxTexture, D3DUsage, iTextureStage); + XTL::X_D3DBaseTexture *pParentXboxTexture = (pXboxSurface) ? (XTL::X_D3DBaseTexture*)pXboxSurface->Parent : xbnullptr; + + // Don't init the Parent if the Surface and Surface Parent formats differ + // Happens in some Outrun 2006 SetRenderTarget calls + if (pParentXboxTexture && (pXboxSurface->Format == pParentXboxTexture->Format)) { + // For surfaces with a parent texture, map these to a host texture first + // TODO : Investigate how it's possible (and how we could fix) the case when + // the following call to GetHostBaseTexture would reject non-texture resources, + // which would seem to trigger a "CreateCubeTexture Failed!" regression. + IDirect3DBaseTexture *pParentHostBaseTexture = GetHostBaseTexture(pParentXboxTexture, D3DUsage, iTextureStage); + IDirect3DSurface* pNewHostSurface; switch (pParentHostBaseTexture->GetType()) { - case XTL::D3DRTYPE_VOLUMETEXTURE: { + case D3DRTYPE_VOLUMETEXTURE: { + LOG_TEST_CASE("Using child surface of VolumeTexture"); // TODO break; } - case XTL::D3DRTYPE_CUBETEXTURE: { - // TODO - // test-case : Burnout + case D3DRTYPE_CUBETEXTURE: { + // test-case : Burnout + auto pParentHostTexture = (IDirect3DCubeTexture*)pParentHostBaseTexture; + + D3DCUBEMAP_FACES CubeMapFace = D3DCUBEMAP_FACE_POSITIVE_X; + UINT SurfaceLevel = 0; + GetSurfaceFaceAndLevelWithinTexture(pXboxSurface, pParentXboxTexture, SurfaceLevel, CubeMapFace); + + HRESULT hRet = pParentHostTexture->GetCubeMapSurface(CubeMapFace, SurfaceLevel, &pNewHostSurface); + + DEBUG_D3DRESULT(hRet, "pHostParentTexture->GetCubeMapSurface"); + if (hRet == D3D_OK) { + SetHostSurface(pXboxSurface, pNewHostSurface, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created CubeTexture surface level (Face: %u, Level: %u, pResource: 0x%.08X, pNewHostSurface: 0x%.08X)", + CubeMapFace, SurfaceLevel, pResource, pNewHostSurface); + return; + } + break; } - case XTL::D3DRTYPE_TEXTURE: { - // For surfaces with a parent texture, map these to a host texture first - XTL::IDirect3DTexture *pParentHostTexture = (XTL::IDirect3DTexture *)pParentHostBaseTexture; - UINT SurfaceLevel = 0; // TODO : Derive actual level based on pXboxSurface->Data delta to pParentXboxTexture->Data - XTL::IDirect3DSurface *pNewHostSurface; + case D3DRTYPE_TEXTURE: { + IDirect3DTexture* pParentHostTexture = (IDirect3DTexture*)pParentHostBaseTexture; + + UINT SurfaceLevel = 0; + GetSurfaceFaceAndLevelWithinTexture(pXboxSurface, pParentXboxTexture, SurfaceLevel); HRESULT hRet = pParentHostTexture->GetSurfaceLevel(SurfaceLevel, &pNewHostSurface); + DEBUG_D3DRESULT(hRet, "pHostParentTexture->GetSurfaceLevel"); if (hRet == D3D_OK) { - SetHostSurface(pXboxSurface, pNewHostSurface); - DbgPrintf("CreateHostResource : Successfully created surface level (%u, 0x%.08X, 0x%.08X)\n", + SetHostSurface(pXboxSurface, pNewHostSurface, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created Texture surface level (Level: %u, pResource: 0x%.08X, pNewHostSurface: 0x%.08X)", SurfaceLevel, pResource, pNewHostSurface); return; } @@ -4816,7 +5668,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } } - EmuWarning("Failed getting host surface level - falling through to regular surface creation"); + EmuLog(LOG_LEVEL::WARNING, "Failed getting host surface level - falling through to regular surface creation"); } // fall through } @@ -4826,19 +5678,19 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText XTL::X_D3DVolumeTexture *pParentXboxVolumeTexture = (pXboxVolume) ? (XTL::X_D3DVolumeTexture *)pXboxVolume->Parent : xbnullptr; if (pParentXboxVolumeTexture) { // For volumes with a parent volume texture, map these to a host volume texture first - XTL::IDirect3DVolumeTexture *pParentHostVolumeTexture = GetHostVolumeTexture(pParentXboxVolumeTexture, iTextureStage); + IDirect3DVolumeTexture *pParentHostVolumeTexture = GetHostVolumeTexture(pParentXboxVolumeTexture, iTextureStage); UINT VolumeLevel = 0; // TODO : Derive actual level based on pXboxVolume->Data delta to pParentXboxVolumeTexture->Data - XTL::IDirect3DVolume *pNewHostVolume; + IDirect3DVolume *pNewHostVolume; HRESULT hRet = pParentHostVolumeTexture->GetVolumeLevel(VolumeLevel, &pNewHostVolume); DEBUG_D3DRESULT(hRet, "pParentHostVolumeTexture->GetVolumeLevel"); if (hRet == D3D_OK) { - SetHostVolume(pXboxVolume, pNewHostVolume); - DbgPrintf("CreateHostResource : Successfully created volume level (%u, 0x%.08X, 0x%.08X)\n", + SetHostVolume(pXboxVolume, pNewHostVolume, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created volume level (%u, 0x%.08X, 0x%.08X)", VolumeLevel, pResource, pNewHostVolume); return; } - EmuWarning("Failed getting host volume level - falling through to regular volume creation"); + EmuLog(LOG_LEVEL::WARNING, "Failed getting host volume level - falling through to regular volume creation"); } // fall through } @@ -4847,145 +5699,67 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_CUBETEXTURE: { XTL::X_D3DPixelContainer *pPixelContainer = (XTL::X_D3DPixelContainer*)pResource; XTL::X_D3DFORMAT X_Format = GetXboxPixelContainerFormat(pPixelContainer); - XTL::D3DPOOL D3DPool = XTL::D3DPOOL_MANAGED; // TODO : Nuance D3DPOOL where/when needed - -#if 0 // jackchen : this must be marked out to fix a fading black regression. - // PatrickvL : The following tries to switch over to using dynamic textures, - // since these can always be locked (which is quite helpfull for doing updates). - // Addendum : Alas, this prevents locking anything else but the first mipmap level, - // turning all others black. (Spotted by Cakelancelot and disabled by jackchen) - if (g_D3DCaps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) { - // jackchen : leave either one single line of code will introduce further regresson. - D3DUsage |= D3DUSAGE_DYNAMIC; - } -#endif + D3DPOOL D3DPool = D3DPOOL_DEFAULT; // Was: D3DPOOL_MANAGED TODO : Nuance D3DPOOL where/when needed if (EmuXBFormatIsDepthBuffer(X_Format)) { D3DUsage |= D3DUSAGE_DEPTHSTENCIL; } - else if (pPixelContainer == g_pXboxRenderTarget) { + else if (pPixelContainer == g_pXbox_RenderTarget) { if (EmuXBFormatIsRenderTarget(X_Format)) D3DUsage |= D3DUSAGE_RENDERTARGET; else - EmuWarning("Updating RenderTarget %s with an incompatible format!", ResourceTypeName); + EmuLog(LOG_LEVEL::WARNING, "Updating RenderTarget %s with an incompatible format!", ResourceTypeName); } // Determine the format we'll be using on host D3D - XTL::D3DFORMAT PCFormat; + D3DFORMAT PCFormat; bool bConvertToARGB = false; if (EmuXBFormatRequiresConversionToARGB(X_Format)) { bConvertToARGB = true; - PCFormat = XTL::D3DFMT_A8R8G8B8; + PCFormat = D3DFMT_A8R8G8B8; + + // Unset D3DUSAGE_DEPTHSTENCIL: It's not possible for ARGB textures to be depth stencils + // Fixes CreateTexture error in Virtua Cop 3 (Chihiro) + D3DUsage &= ~D3DUSAGE_DEPTHSTENCIL; } else { - // TODO : Nuance the following, because the Direct3D 8 docs states - // CheckDeviceFormat is needed when D3DUSAGE_RENDERTARGET or - // D3DUSAGE_DYNAMNIC is specified. - - // Otherwise, lookup resource type and accompanying 'SupportedFormat' array - bool *pbSupportedFormats = g_bSupportsFormatTexture; - - switch (XboxResourceType) { - case XTL::X_D3DRTYPE_SURFACE: { - if (D3DUsage & D3DUSAGE_RENDERTARGET) { - pbSupportedFormats = g_bSupportsFormatSurfaceRenderTarget; - } - else if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { - pbSupportedFormats = g_bSupportsFormatSurfaceDepthStencil; - } - else { - pbSupportedFormats = g_bSupportsFormatSurface; - } - break; - } - case XTL::X_D3DRTYPE_VOLUME: { - pbSupportedFormats = g_bSupportsFormatTexture; // TODO : Complete - break; - } - case XTL::X_D3DRTYPE_TEXTURE: { - if (D3DUsage & D3DUSAGE_RENDERTARGET) { - pbSupportedFormats = g_bSupportsFormatTextureRenderTarget; - } - else if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { - pbSupportedFormats = g_bSupportsFormatTextureDepthStencil; - } - else { - pbSupportedFormats = g_bSupportsFormatTexture; - } - break; - } - case XTL::X_D3DRTYPE_VOLUMETEXTURE: { - pbSupportedFormats = g_bSupportsFormatVolumeTexture; // TODO : Complete - break; - } - case XTL::X_D3DRTYPE_CUBETEXTURE: { - pbSupportedFormats = g_bSupportsFormatCubeTexture; // TODO : Complete - break; - } - } // switch XboxResourceType - // Does host CheckDeviceFormat() succeed on this format? - if (pbSupportedFormats[X_Format]) { + if (IsSupportedFormat(X_Format, XboxResourceType, D3DUsage)) { // Then use matching host format PCFormat = EmuXB2PC_D3DFormat(X_Format); // If, and ONLY if this is the default backbuffer, make sure the format matches the host backbuffer - if (pResource == g_XboxBackBufferSurface) { - PCFormat = g_EmuCDPD.HostPresentationParameters.BackBufferFormat;; + if (pResource == g_pXbox_BackBufferSurface) { + PCFormat = g_EmuCDPD.HostPresentationParameters.BackBufferFormat; } } else { - // Otherwise, choose a fallback for the format not supported on host - switch (X_Format) { - case XTL::X_D3DFMT_LIN_D24S8: { // Note : This case could be removed, as the default below can handle it too - EmuWarning("D3DFMT_LIN_D24S8 %s not supported - using D3DFMT_A8R8G8B8!", ResourceTypeName); - // Note : This cannot set bConvertToARGB - we just copy it as-is - PCFormat = XTL::D3DFMT_A8R8G8B8; - break; - } - case XTL::X_D3DFMT_LIN_D16: { - // Test case : Turok (when entering menu) - EmuWarning("D3DFMT_LIN_D16 %s not supported - USING D3DFMT_R5G6B5!", ResourceTypeName); - // Note : This cannot set bConvertToARGB - we just copy it as-is - PCFormat = XTL::D3DFMT_R5G6B5; // TODO : Do something smarter - break; - } - case XTL::X_D3DFMT_X1R5G5B5: { // Note : This case could be removed, as the default below can handle it too - // Test case : JSRF (after loading) - EmuWarning("D3DFMT_X1R5G5B5 %s will be converted to ARGB", ResourceTypeName); + if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { + // If it was a depth stencil, fall back to a known supported depth format + EmuLog(LOG_LEVEL::WARNING, "Xbox %s Format %x will be converted to D3DFMT_D24S8", ResourceTypeName, X_Format); + PCFormat = D3DFMT_D24S8; + } else if (EmuXBFormatCanBeConvertedToARGB(X_Format)) { + EmuLog(LOG_LEVEL::WARNING, "Xbox %s Format %x will be converted to ARGB", ResourceTypeName, X_Format); bConvertToARGB = true; - PCFormat = XTL::D3DFMT_A8R8G8B8; - break; + PCFormat = D3DFMT_A8R8G8B8; + } else { + // Otherwise, use a best matching format + /*CxbxKrnlCleanup*/EmuLog(LOG_LEVEL::WARNING, "Encountered a completely incompatible %s format!", ResourceTypeName); + PCFormat = EmuXB2PC_D3DFormat(X_Format); } - default: - // Can the format be converted to ARGB? - if (EmuXBFormatCanBeConvertedToARGB(X_Format)) { - EmuWarning("Xbox %s Format %x will be converted to ARGB", ResourceTypeName, X_Format); - bConvertToARGB = true; - PCFormat = XTL::D3DFMT_A8R8G8B8; - } - else { - // Otherwise, use a best matching format - /*CxbxKrnlCleanup*/EmuWarning("Encountered a completely incompatible %s format!", ResourceTypeName); - PCFormat = EmuXB2PC_D3DFormat(X_Format); - } - } - - // Avoid using this as a depth-texture (since we're falling back on a RGB format now) - D3DUsage &= ~D3DUSAGE_DEPTHSTENCIL; } } // Update D3DPool accordingly to the active D3DUsage flags if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { - D3DPool = XTL::D3DPOOL_DEFAULT; + D3DPool = D3DPOOL_DEFAULT; } if (D3DUsage & D3DUSAGE_RENDERTARGET) { - D3DPool = XTL::D3DPOOL_DEFAULT; + D3DPool = D3DPOOL_DEFAULT; } if (D3DUsage & D3DUSAGE_DYNAMIC) { - D3DPool = XTL::D3DPOOL_DEFAULT; + D3DPool = D3DPOOL_DEFAULT; } // Interpret Width/Height/BPP @@ -5000,6 +5774,28 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText // Interpret Width/Height/BPP CxbxGetPixelContainerMeasures(pPixelContainer, 0, &dwWidth, &dwHeight, &dwDepth, &dwRowPitch, &dwSlicePitch); + // Each mip-map level is 1/2 the size of the previous level + // D3D9 forbids creation of a texture with more mip-map levels than it is divisible + // EG: A 256x256 texture cannot have more than 8 levels, since that would create a texture smaller than 1x1 + // Because of this, we need to cap dwMipMapLevels when required + if (dwMipMapLevels > 0) { + // Calculate how many mip-map levels it takes to get to a texture of 1 pixels in either dimension + UINT highestMipMapLevel = 1; + UINT width = dwWidth; UINT height = dwHeight; + while (width > 1 || height > 1) { + width /= 2; + height /= 2; + highestMipMapLevel++; + } + + // If the desired mip-map level was higher than the maximum possible, cap it + // Test case: Shin Megami Tensei: Nine + if (dwMipMapLevels > highestMipMapLevel) { + LOG_TEST_CASE("Too many mip-map levels"); + dwMipMapLevels = highestMipMapLevel; + } + } + if (dwDepth != 1) { LOG_TEST_CASE("CreateHostResource : Depth != 1"); } @@ -5009,161 +5805,140 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText if (bCompressed) { if (dwWidth < dwMinSize) { LOG_TEST_CASE("CreateHostResource : dwWidth < dwMinSize"); - EmuWarning("Expanding %s width (%d->%d)", ResourceTypeName, dwWidth, dwMinSize); + EmuLog(LOG_LEVEL::WARNING, "Expanding %s width (%d->%d)", ResourceTypeName, dwWidth, dwMinSize); dwWidth = dwMinSize; } if (dwHeight < dwMinSize) { LOG_TEST_CASE("CreateHostResource : dwHeight < dwMinSize"); - EmuWarning("Expanding %s height (%d->%d)", ResourceTypeName, dwHeight, dwMinSize); + EmuLog(LOG_LEVEL::WARNING, "Expanding %s height (%d->%d)", ResourceTypeName, dwHeight, dwMinSize); dwHeight = dwMinSize; } } - // One of these will be created : - XTL::IDirect3DSurface *pNewHostSurface = nullptr; // for X_D3DRTYPE_SURFACE - XTL::IDirect3DVolume *pNewHostVolume = nullptr; // for X_D3DRTYPE_VOLUME - XTL::IDirect3DTexture *pNewHostTexture = nullptr; // for X_D3DRTYPE_TEXTURE - XTL::IDirect3DVolumeTexture *pNewHostVolumeTexture = nullptr; // for X_D3DRTYPE_VOLUMETEXTURE - XTL::IDirect3DCubeTexture *pNewHostCubeTexture = nullptr; // for X_D3DRTYPE_CUBETEXTURE + // One of these will be created : each also has an intermediate copy to allow UpdateTexture to work + // This means we don't need to lock the GPU resource anymore, so we can use D3DPOOL_DEFAULT to allow Stretch/CopyRects to work! + IDirect3DSurface *pNewHostSurface = nullptr; // for X_D3DRTYPE_SURFACE + IDirect3DVolume *pNewHostVolume = nullptr; // for X_D3DRTYPE_VOLUME + IDirect3DTexture *pNewHostTexture = nullptr; // for X_D3DRTYPE_TEXTURE + IDirect3DTexture *pIntermediateHostTexture = nullptr; + IDirect3DVolumeTexture *pNewHostVolumeTexture = nullptr; // for X_D3DRTYPE_VOLUMETEXTURE + IDirect3DVolumeTexture *pIntermediateHostVolumeTexture = nullptr; + IDirect3DCubeTexture *pNewHostCubeTexture = nullptr; // for X_D3DRTYPE_CUBETEXTURE + IDirect3DCubeTexture *pIntermediateHostCubeTexture = nullptr; + HRESULT hRet; // Create the surface/volume/(volume/cube/)texture switch (XboxResourceType) { case XTL::X_D3DRTYPE_SURFACE: { if (D3DUsage & D3DUSAGE_RENDERTARGET) { - hRet = g_pD3DDevice->CreateRenderTarget(dwWidth, dwHeight, PCFormat, + hRet = g_pD3DDevice->CreateRenderTarget(dwWidth * g_RenderScaleFactor, dwHeight * g_RenderScaleFactor, PCFormat, g_EmuCDPD.HostPresentationParameters.MultiSampleType, -#ifdef CXBX_USE_D3D9 0, // MultisampleQuality -#endif true, // Lockable - &pNewHostSurface -#ifdef CXBX_USE_D3D9 - , nullptr, // pSharedHandle -#endif + &pNewHostSurface, + nullptr // pSharedHandle ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateRenderTarget"); } else if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { - hRet = g_pD3DDevice->CreateDepthStencilSurface(dwWidth, dwHeight, PCFormat, - g_EmuCDPD.HostPresentationParameters.MultiSampleType, -#ifdef CXBX_USE_D3D9 + hRet = g_pD3DDevice->CreateDepthStencilSurface(dwWidth * g_RenderScaleFactor, dwHeight * g_RenderScaleFactor, PCFormat, + g_EmuCDPD.HostPresentationParameters.MultiSampleType, 0, // MultisampleQuality false, // Discard -#endif - &pNewHostSurface -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + &pNewHostSurface, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateDepthStencilSurface"); } else { -#ifdef CXBX_USE_D3D9 - D3DPool = XTL::D3DPOOL_SYSTEMMEM; + D3DPool = D3DPOOL_SYSTEMMEM; hRet = g_pD3DDevice->CreateOffscreenPlainSurface(dwWidth, dwHeight, PCFormat, D3DPool, &pNewHostSurface, nullptr); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateOffscreenPlainSurface"); -#else - hRet = g_pD3DDevice->CreateImageSurface(dwWidth, dwHeight, PCFormat, &pNewHostSurface); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateImageSurface"); -#endif } // First fail, retry with a fallback format // If this succeeds, the surface may not render correctly, but it won't crash if (hRet != D3D_OK) { if (D3DUsage & D3DUSAGE_DEPTHSTENCIL) { - EmuWarning("CreateDepthStencilSurface Failed\n\nError: %s\nDesc: %s", - XTL::DXGetErrorString(hRet), XTL::DXGetErrorDescription(hRet)); + EmuLog(LOG_LEVEL::WARNING, "CreateDepthStencilSurface Failed\n\nError: %s\nDesc: %s", + DXGetErrorString(hRet), DXGetErrorDescription(hRet)); } else { - EmuWarning("CreateImageSurface Failed\n\nError: %s\nDesc: %s", - XTL::DXGetErrorString(hRet), XTL::DXGetErrorDescription(hRet)); + EmuLog(LOG_LEVEL::WARNING, "CreateImageSurface Failed\n\nError: %s\nDesc: %s", + DXGetErrorString(hRet), DXGetErrorDescription(hRet)); } - EmuWarning("Trying Fallback"); -#ifdef CXBX_USE_D3D9 + EmuLog(LOG_LEVEL::WARNING, "Trying Fallback"); hRet = g_pD3DDevice->CreateOffscreenPlainSurface(dwWidth, dwHeight, PCFormat, D3DPool, &pNewHostSurface, nullptr); -#else - hRet = g_pD3DDevice->CreateImageSurface(dwWidth, dwHeight, XTL::D3DFMT_A8R8G8B8, &pNewHostSurface); -#endif } // If the fallback failed, show an error and exit execution. if (hRet != D3D_OK) { // We cannot safely continue in this state. CxbxKrnlCleanup("CreateImageSurface Failed!\n\nError: %s\nDesc: %s", - XTL::DXGetErrorString(hRet), XTL::DXGetErrorDescription(hRet)); + DXGetErrorString(hRet), DXGetErrorDescription(hRet)); } - SetHostSurface(pResource, pNewHostSurface); - DbgPrintf("CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)\n", + SetHostSurface(pResource, pNewHostSurface, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)", ResourceTypeName, pResource, pNewHostSurface); - DbgPrintf("CreateHostResource : Width : %d, Height : %d, Format : %d\n", + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Width : %d, Height : %d, Format : %d", dwWidth, dwHeight, PCFormat); break; } case XTL::X_D3DRTYPE_VOLUME: { LOG_UNIMPLEMENTED(); - // Note : Host D3D can only(?) retrieve a volue like this : + // Note : Host D3D can only(?) retrieve a volume like this : // hRet = pNewHostVolumeTexture->GetVolumeLevel(level, &pNewHostVolume); // So, we need to do this differently - we need to step up to the containing VolumeTexture, // and retrieve and convert all of it's GetVolumeLevel() slices. pNewHostVolume = nullptr; - // SetHostVolume(pResource, pNewHostVolume); - // DbgPrintf("CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)\n", + // SetHostVolume(pResource, pNewHostVolume, iTextureStage); + // EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)", // ResourceTypeName, pResource, pNewHostVolume); break; } case XTL::X_D3DRTYPE_TEXTURE: { -/* TODO : Enabled this if D3DPool is ever anything else but D3DPOOL_MANAGED : -#ifdef CXBX_USE_D3D9 - if (D3DPool == D3DPOOL_DEFAULT) { - if ((D3DUsage & D3DUSAGE_DYNAMIC) == 0) { - if ((D3DUsage & D3DUSAGE_RENDERTARGET) == 0) { - D3DUsage |= D3DUSAGE_DYNAMIC; - } - } - } -#endif -*/ hRet = g_pD3DDevice->CreateTexture(dwWidth, dwHeight, dwMipMapLevels, - D3DUsage, PCFormat, D3DPool, &pNewHostTexture -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + D3DUsage, PCFormat, D3DPool, &pNewHostTexture, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateTexture"); // If the above failed, we might be able to use an ARGB texture instead - if ((hRet != D3D_OK) && (PCFormat != XTL::D3DFMT_A8R8G8B8) && EmuXBFormatCanBeConvertedToARGB(X_Format)) { + if ((hRet != D3D_OK) && (PCFormat != D3DFMT_A8R8G8B8) && EmuXBFormatCanBeConvertedToARGB(X_Format)) { hRet = g_pD3DDevice->CreateTexture(dwWidth, dwHeight, dwMipMapLevels, - D3DUsage, XTL::D3DFMT_A8R8G8B8, D3DPool, &pNewHostTexture -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + D3DUsage, D3DFMT_A8R8G8B8, D3DPool, &pNewHostTexture, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateTexture(D3DFMT_A8R8G8B8)"); if (hRet == D3D_OK) { // Okay, now this works, make sure the texture gets converted bConvertToARGB = true; - PCFormat = XTL::D3DFMT_A8R8G8B8; + PCFormat = D3DFMT_A8R8G8B8; } } + // Now create our intermediate texture for UpdateTexture, but not for render targets or depth stencils + if (hRet == D3D_OK && (D3DUsage & D3DUSAGE_RENDERTARGET) == 0 && (D3DUsage & D3DUSAGE_DEPTHSTENCIL) == 0) { + hRet = g_pD3DDevice->CreateTexture(dwWidth, dwHeight, dwMipMapLevels, + 0, PCFormat, D3DPOOL_SYSTEMMEM, &pIntermediateHostTexture, + nullptr + ); + } + /*if(FAILED(hRet)) { hRet = g_pD3DDevice->CreateTexture ( dwWidth, dwHeight, dwMipMapLevels, D3DUsage, PCFormat, - D3DPOOL_SYSTEMMEM, &pNewHostTexture -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + D3DPOOL_SYSTEMMEM, &pNewHostTexture, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateTexture(D3DPOOL_SYSTEMMEM)"); }*/ @@ -5174,72 +5949,85 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText "Error: 0x%X\nFormat: %d\nDimensions: %dx%d", hRet, PCFormat, dwWidth, dwHeight); } - SetHostTexture(pResource, pNewHostTexture); - DbgPrintf("CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)\n", + SetHostTexture(pResource, pNewHostTexture, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)", ResourceTypeName, pResource, pNewHostTexture); break; } case XTL::X_D3DRTYPE_VOLUMETEXTURE: { hRet = g_pD3DDevice->CreateVolumeTexture(dwWidth, dwHeight, dwDepth, - dwMipMapLevels, D3DUsage, PCFormat, D3DPool, &pNewHostVolumeTexture -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + dwMipMapLevels, D3DUsage, PCFormat, D3DPool, &pNewHostVolumeTexture, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVolumeTexture"); + // Now create our intermediate texture for UpdateTexture, but not for render targets or depth stencils + if (hRet == D3D_OK && (D3DUsage & D3DUSAGE_RENDERTARGET) == 0 && (D3DUsage & D3DUSAGE_DEPTHSTENCIL) == 0) { + hRet = g_pD3DDevice->CreateVolumeTexture(dwWidth, dwHeight, dwDepth, + dwMipMapLevels, 0, PCFormat, D3DPOOL_SYSTEMMEM, &pIntermediateHostVolumeTexture, + nullptr + ); + } + if (hRet != D3D_OK) { CxbxKrnlCleanup("CreateVolumeTexture Failed!\n\nError: %s\nDesc: %s", - XTL::DXGetErrorString(hRet), XTL::DXGetErrorDescription(hRet)); + DXGetErrorString(hRet), DXGetErrorDescription(hRet)); } - SetHostVolumeTexture(pResource, pNewHostVolumeTexture); - DbgPrintf("CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)\n", + SetHostVolumeTexture(pResource, pNewHostVolumeTexture, iTextureStage); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)", ResourceTypeName, pResource, pNewHostVolumeTexture); break; } case XTL::X_D3DRTYPE_CUBETEXTURE: { - DbgPrintf("CreateCubeTexture(%d, %d, 0, %d, D3DPOOL_MANAGED)\n", dwWidth, + EmuLog(LOG_LEVEL::DEBUG, "CreateCubeTexture(%d, %d, 0, %d, D3DPOOL_MANAGED)", dwWidth, dwMipMapLevels, PCFormat); hRet = g_pD3DDevice->CreateCubeTexture(dwWidth, dwMipMapLevels, D3DUsage, - PCFormat, D3DPool, &pNewHostCubeTexture -#ifdef CXBX_USE_D3D9 - , nullptr -#endif + PCFormat, D3DPool, &pNewHostCubeTexture, + nullptr ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateCubeTexture"); + // Now create our intermediate texture for UpdateTexture, but not for render targets or depth stencils + if (hRet == D3D_OK && (D3DUsage & D3DUSAGE_RENDERTARGET) == 0 && (D3DUsage & D3DUSAGE_DEPTHSTENCIL) == 0) { + hRet = g_pD3DDevice->CreateCubeTexture(dwWidth, dwMipMapLevels, 0, + PCFormat, D3DPOOL_SYSTEMMEM, &pIntermediateHostCubeTexture, + nullptr + ); + } + if (hRet != D3D_OK) { CxbxKrnlCleanup("CreateCubeTexture Failed!\n\nError: \nDesc: "/*, DXGetErrorString(hRet), DXGetErrorDescription(hRet)*/); } - SetHostCubeTexture(pResource, pNewHostCubeTexture); - // TODO : Because cube face surfaces can be used as a render-target, - // we should call SetHostSurface() on all 6 faces, so that when Xbox - // code accesses a face, the host counterpart is already registered! - DbgPrintf("CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)\n", + SetHostCubeTexture(pResource, pNewHostCubeTexture, iTextureStage); + // TODO : Cube face surfaces can be used as a render-target, + // so we need to associate host surfaces to each surface of this cube texture + // However, we can't do it here: On Xbox, a new Surface is created on every call to + // GetCubeMapSurface, so it needs to be done at surface conversion time by looking up + // the parent CubeTexture + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %s (0x%.08X, 0x%.08X)", ResourceTypeName, pResource, pNewHostCubeTexture); break; } } // switch XboxResourceType - DWORD D3DLockFlags = D3DLOCK_NOSYSLOCK; + // If this resource is a render target or depth stencil, don't attempt to lock/copy it as it won't work anyway + // In this case, we simply return + if (D3DUsage & D3DUSAGE_RENDERTARGET || D3DUsage & D3DUSAGE_DEPTHSTENCIL) { + return; + } - // D3DLOCK_DISCARD is only valid for D3DUSAGE_DYNAMIC - if (g_D3DCaps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) { - if (D3DUsage & D3DUSAGE_DYNAMIC) { - D3DLockFlags |= D3DLOCK_DISCARD; - } - } + DWORD D3DLockFlags = D3DLOCK_NOSYSLOCK; DWORD dwCubeFaceOffset = 0; DWORD dwCubeFaceSize = 0; - XTL::D3DCUBEMAP_FACES last_face = (bCubemap) ? XTL::D3DCUBEMAP_FACE_NEGATIVE_Z : XTL::D3DCUBEMAP_FACE_POSITIVE_X; - for (int face = XTL::D3DCUBEMAP_FACE_POSITIVE_X; face <= last_face; face++) { + D3DCUBEMAP_FACES last_face = (bCubemap) ? D3DCUBEMAP_FACE_NEGATIVE_Z : D3DCUBEMAP_FACE_POSITIVE_X; + for (int face = D3DCUBEMAP_FACE_POSITIVE_X; face <= last_face; face++) { // As we iterate through mipmap levels, we'll adjust the source resource offset DWORD dwMipOffset = 0; DWORD dwMipWidth = dwWidth; @@ -5248,7 +6036,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText DWORD dwMipRowPitch = dwRowPitch; DWORD dwSrcSlicePitch = dwMipRowPitch * dwMipHeight; // TODO - for (uint mipmap_level = 0; mipmap_level < dwMipMapLevels; mipmap_level++) { + for (unsigned int mipmap_level = 0; mipmap_level < dwMipMapLevels; mipmap_level++) { // Calculate size of this mipmap level DWORD dwMipSize = dwMipRowPitch * dwMipHeight; @@ -5257,8 +6045,8 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } // Lock the host resource - XTL::D3DLOCKED_RECT LockedRect = {}; - XTL::D3DLOCKED_BOX LockedBox = {}; + D3DLOCKED_RECT LockedRect = {}; + D3DLOCKED_BOX LockedBox = {}; switch (XboxResourceType) { case XTL::X_D3DRTYPE_SURFACE: @@ -5268,20 +6056,20 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText hRet = pNewHostVolume->LockBox(&LockedBox, nullptr, D3DLockFlags); break; case XTL::X_D3DRTYPE_TEXTURE: - hRet = pNewHostTexture->LockRect(mipmap_level, &LockedRect, nullptr, D3DLockFlags); + hRet = pIntermediateHostTexture->LockRect(mipmap_level, &LockedRect, nullptr, D3DLockFlags); break; case XTL::X_D3DRTYPE_VOLUMETEXTURE: - hRet = pNewHostVolumeTexture->LockBox(mipmap_level, &LockedBox, nullptr, D3DLockFlags); + hRet = pIntermediateHostVolumeTexture->LockBox(mipmap_level, &LockedBox, nullptr, D3DLockFlags); break; case XTL::X_D3DRTYPE_CUBETEXTURE: - hRet = pNewHostCubeTexture->LockRect((XTL::D3DCUBEMAP_FACES)face, mipmap_level, &LockedRect, nullptr, D3DLockFlags); + hRet = pIntermediateHostCubeTexture->LockRect((D3DCUBEMAP_FACES)face, mipmap_level, &LockedRect, nullptr, D3DLockFlags); break; default: assert(false); } // switch XboxResourceType if (hRet != D3D_OK) { - EmuWarning("Locking host %s failed!", ResourceTypeName); + EmuLog(LOG_LEVEL::WARNING, "Locking host %s failed!", ResourceTypeName); continue; // This often happens on depth-stencil surfaces - let's ignore their copies for now } @@ -5307,7 +6095,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText // Do we need to convert to ARGB? if (bConvertToARGB) { - DbgPrintf("Unsupported texture format, expanding to D3DFMT_A8R8G8B8"); + EmuLog(LOG_LEVEL::DEBUG, "Unsupported texture format, expanding to D3DFMT_A8R8G8B8"); // Convert a row at a time, using a libyuv-like callback approach : if (!ConvertD3DTextureToARGBBuffer( @@ -5321,7 +6109,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } else if (bSwizzled) { // First we need to unswizzle the texture data - XTL::EmuUnswizzleBox( + EmuUnswizzleBox( pSrc, dwMipWidth, dwMipHeight, dwMipDepth, dwBPP, pDst, dwDstRowPitch, dwDstSlicePitch @@ -5339,7 +6127,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText &destRect, pSrc, // Source buffer dwMipPitch, // Source pitch - g_pCurrentPalette, + g_pXbox_Palette_Data, &SrcRect, D3DX_DEFAULT, // D3DX_FILTER_NONE, 0 // No ColorKey? @@ -5367,23 +6155,23 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText hRet = pNewHostVolume->UnlockBox(); break; case XTL::X_D3DRTYPE_TEXTURE: - hRet = pNewHostTexture->UnlockRect(mipmap_level); + hRet = pIntermediateHostTexture->UnlockRect(mipmap_level); break; case XTL::X_D3DRTYPE_VOLUMETEXTURE: - hRet = pNewHostVolumeTexture->UnlockBox(mipmap_level); + hRet = pIntermediateHostVolumeTexture->UnlockBox(mipmap_level); break; case XTL::X_D3DRTYPE_CUBETEXTURE: - hRet = pNewHostCubeTexture->UnlockRect((XTL::D3DCUBEMAP_FACES)face, mipmap_level); + hRet = pIntermediateHostCubeTexture->UnlockRect((D3DCUBEMAP_FACES)face, mipmap_level); break; default: assert(false); } if (hRet != D3D_OK) { - EmuWarning("Unlocking host %s failed!", ResourceTypeName); + EmuLog(LOG_LEVEL::WARNING, "Unlocking host %s failed!", ResourceTypeName); } - if (face == XTL::D3DCUBEMAP_FACE_POSITIVE_X) { + if (face == D3DCUBEMAP_FACE_POSITIVE_X) { dwCubeFaceSize += dwDepth * dwMipSize; } @@ -5403,13 +6191,42 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } } // for mipmap levels - if (face == XTL::D3DCUBEMAP_FACE_POSITIVE_X) { + if (face == D3DCUBEMAP_FACE_POSITIVE_X) { dwCubeFaceSize = ROUND_UP(dwCubeFaceSize, X_D3DTEXTURE_CUBEFACE_ALIGNMENT); } dwCubeFaceOffset += dwCubeFaceSize; } // for cube faces + + // Copy from the intermediate resource to the final host resource + // This is necessary because CopyRects/StretchRects only works on resources in the DEFAULT pool + // But resources in this pool are not lockable: We must use UpdateSurface/UpdateTexture instead! + switch (XboxResourceType) { + case XTL::X_D3DRTYPE_SURFACE: + case XTL::X_D3DRTYPE_VOLUME: + // We didn't use a copy for Surfaces or Volumes + break; + case XTL::X_D3DRTYPE_TEXTURE: + g_pD3DDevice->UpdateTexture(pIntermediateHostTexture, pNewHostTexture); + pIntermediateHostTexture->Release(); + break; + case XTL::X_D3DRTYPE_VOLUMETEXTURE: + g_pD3DDevice->UpdateTexture(pIntermediateHostVolumeTexture, pNewHostVolumeTexture); + pIntermediateHostVolumeTexture->Release(); + break; + case XTL::X_D3DRTYPE_CUBETEXTURE: + g_pD3DDevice->UpdateTexture(pIntermediateHostCubeTexture, pNewHostCubeTexture); + pIntermediateHostCubeTexture->Release(); + break; + default: + assert(false); + } + + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Updating host %s failed!", ResourceTypeName); + } + // Debug resource dumping //#define _DEBUG_DUMP_TEXTURE_REGISTER "D:\\" #ifdef _DEBUG_DUMP_TEXTURE_REGISTER @@ -5421,7 +6238,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_SURFACE: { static int dwDumpSurface = 0; sprintf(szFilePath, _DEBUG_DUMP_TEXTURE_REGISTER "%.03d-Surface%.03d.dds", X_Format, dwDumpSurface++); - D3DXSaveSurfaceToFileA(szFilePath, XTL::D3DXIFF_DDS, pNewHostSurface, NULL, NULL); + D3DXSaveSurfaceToFileA(szFilePath, D3DXIFF_DDS, pNewHostSurface, nullptr, nullptr); break; } case XTL::X_D3DRTYPE_VOLUME: { @@ -5431,7 +6248,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_TEXTURE: { static int dwDumpTexure = 0; sprintf(szFilePath, _DEBUG_DUMP_TEXTURE_REGISTER "%.03d-Texture%.03d.dds", X_Format, dwDumpTexure++); - D3DXSaveTextureToFileA(szFilePath, XTL::D3DXIFF_DDS, pNewHostTexture, NULL); + D3DXSaveTextureToFileA(szFilePath, D3DXIFF_DDS, pNewHostTexture, nullptr); break; } case XTL::X_D3DRTYPE_VOLUMETEXTURE: { @@ -5440,11 +6257,11 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } case XTL::X_D3DRTYPE_CUBETEXTURE: { static int dwDumpCubeTexture = 0; - for (uint face = XTL::D3DCUBEMAP_FACE_POSITIVE_X; face <= XTL::D3DCUBEMAP_FACE_NEGATIVE_Z; face++) { - XTL::IDirect3DSurface8 *pSurface; - if (D3D_OK == pNewHostCubeTexture->GetCubeMapSurface((XTL::D3DCUBEMAP_FACES)face, 0, &pSurface)) { + for (unsigned int face = D3DCUBEMAP_FACE_POSITIVE_X; face <= D3DCUBEMAP_FACE_NEGATIVE_Z; face++) { + IDirect3DSurface *pSurface; + if (D3D_OK == pNewHostCubeTexture->GetCubeMapSurface((D3DCUBEMAP_FACES)face, 0, &pSurface)) { sprintf(szFilePath, _DEBUG_DUMP_TEXTURE_REGISTER "%.03d-CubeTexure%.03d-%d.dds", X_Format, dwDumpCubeTexture, face); - D3DXSaveSurfaceToFileA(szFilePath, XTL::D3DXIFF_DDS, pSurface, NULL, NULL); + D3DXSaveSurfaceToFileA(szFilePath, D3DXIFF_DDS, pSurface, nullptr, nullptr); pSurface->Release(); } } @@ -5469,12 +6286,12 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText dwSize = g_VMManager.QuerySize(VirtualAddr); if (dwSize == 0) { // TODO: once this is known to be working, remove the warning - EmuWarning("Push buffer allocation size unknown"); + EmuLog(LOG_LEVEL::WARNING, "Push buffer allocation size unknown"); pPushBuffer->Lock = X_D3DRESOURCE_LOCK_FLAG_NOSIZE; break; } - DbgPrintf("CreateHostResource : Successfully created %S (0x%.08X, 0x%.08X, 0x%.08X)\n", ResourceTypeName, pResource->Data, pPushBuffer->Size, pPushBuffer->AllocationSize); + EmuLog(LOG_LEVEL::DEBUG, "CreateHostResource : Successfully created %S (0x%.08X, 0x%.08X, 0x%.08X)", ResourceTypeName, pResource->Data, pPushBuffer->Size, pPushBuffer->AllocationSize); break; } @@ -5483,7 +6300,7 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText case XTL::X_D3DRTYPE_FIXUP: { XTL::X_D3DFixup *pFixup = (XTL::X_D3DFixup*)pResource; - EmuWarning("X_D3DRTYPE_FIXUP is not yet supported\n" + EmuLog(LOG_LEVEL::WARNING, "X_D3DRTYPE_FIXUP is not yet supported\n" "0x%.08X (pFixup->Common) \n" "0x%.08X (pFixup->Data) \n" "0x%.08X (pFixup->Lock) \n" @@ -5495,49 +6312,6 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText } // switch XboxResourceType } - -// ****************************************************************** -// * patch: IDirect3DResource8_Release -// ****************************************************************** -ULONG WINAPI XTL::EMUPATCH(D3DResource_Release) -( - X_D3DResource *pThis - ) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pThis); - - // Backup the key now, as the Xbox resource may be wiped out by the following release call! - auto key = GetHostResourceKey(pThis); - - // Call the Xbox version of D3DResource_Release and store the result - XB_trampoline(ULONG, WINAPI, D3DResource_Release, (X_D3DResource*)); - - ULONG uRet = XB_D3DResource_Release(pThis); - - // Was the Xbox resource freed? - if (uRet == 0) { - - // If this was a cached render target or depth surface, clear the cache variable too! - if (pThis == g_pXboxRenderTarget) { - g_pXboxRenderTarget = nullptr; - } - - if (pThis == g_pXboxDepthStencil) { - g_pXboxDepthStencil = nullptr; - } - - if (pThis == g_XboxBackBufferSurface) { - g_XboxBackBufferSurface = nullptr; - } - - // Also release the host copy (if it exists!) - FreeHostResource(key); - } - - return uRet; -} - // ****************************************************************** // * patch: D3DDevice_EnableOverlay // ****************************************************************** @@ -5546,8 +6320,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_EnableOverlay) BOOL Enable ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Enable); // The Xbox D3DDevice_EnableOverlay call merely resets the active @@ -5569,8 +6341,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_UpdateOverlay) D3DCOLOR ColorKey ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pSurface) LOG_FUNC_ARG(SrcRect) @@ -5594,11 +6364,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_UpdateOverlay) g_OverlayProxy.ColorKey = ColorKey; // Update overlay if present was not called since the last call to // EmuD3DDevice_UpdateOverlay. - if (g_OverlaySwap != g_SwapData.Swap - 1) { + if (g_OverlaySwap != g_Xbox_SwapData.Swap - 1) { EMUPATCH(D3DDevice_Swap)(CXBX_SWAP_PRESENT_FORWARD); } - g_OverlaySwap = g_SwapData.Swap; + g_OverlaySwap = g_Xbox_SwapData.Swap; } } @@ -5607,8 +6377,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_UpdateOverlay) // ****************************************************************** BOOL WINAPI XTL::EMUPATCH(D3DDevice_GetOverlayUpdateStatus)() { - FUNC_EXPORTS - LOG_FUNC(); LOG_UNIMPLEMENTED(); @@ -5622,8 +6390,6 @@ BOOL WINAPI XTL::EMUPATCH(D3DDevice_GetOverlayUpdateStatus)() // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_BlockUntilVerticalBlank)() { - FUNC_EXPORTS - LOG_FUNC(); std::unique_lock lk(g_VBConditionMutex); @@ -5635,513 +6401,14 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_BlockUntilVerticalBlank)() // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVerticalBlankCallback) ( - D3DVBLANKCALLBACK pCallback + X_D3DVBLANKCALLBACK pCallback ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pCallback); - g_pVBCallback = pCallback; + g_pXbox_VerticalBlankCallback = pCallback; } -// LTCG specific D3DDevice_SetTextureState_TexCoordIndex function... -// This uses a custom calling convention where parameter is passed in EDI, EAX -// Test-case: Ski Racing 2006 -VOID __stdcall XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex_0) -( -) -{ - FUNC_EXPORTS; - - DWORD Stage; - DWORD Value; - - __asm { - mov Stage, edi - mov Value, eax - } - - return EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex)(Stage, Value); -} - -// This uses a custom calling convention where parameter is passed in ESI -// Test-case: Metal Wolf Chaos -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex_4) -( - DWORD Value -) -{ - FUNC_EXPORTS - - DWORD Stage; - __asm mov Stage, esi; - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Stage) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; - - // TODO: Xbox Direct3D supports sphere mapping OpenGL style. - - // BUG FIX: The lower 16 bits were causing false Unknown TexCoordIndex errors. - // Check for 0x00040000 instead. - - if (Value >= 0x00040000) { - EmuWarning("EmuD3DDevice_SetTextureState_TexCoordIndex: Unknown TexCoordIndex Value (0x%.08X)", Value); - return; - } - - HRESULT hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_TEXCOORDINDEX, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetTextureState_TexCoordIndex -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex) -( - DWORD Stage, - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Stage) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; - - // TODO: Xbox Direct3D supports sphere mapping OpenGL style. - - // BUG FIX: The lower 16 bits were causing false Unknown TexCoordIndex errors. - // Check for 0x00040000 instead. - - if (Value >= 0x00040000) { - EmuWarning("EmuD3DDevice_SetTextureState_TexCoordIndex: Unknown TexCoordIndex Value (0x%.08X)", Value); - return; - } - - HRESULT hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_TEXCOORDINDEX, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_TwoSidedLighting -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_TwoSidedLighting) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_BackFillMode -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_BackFillMode) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - // blueshogun96 12/4/07 - // I haven't had access to Cxbx sources in a few months, great to be back :) - // - // Anyway, since standard Direct3D doesn't support the back fill mode - // operation, this function will be ignored. Things like this make me - // think even more that an OpenGL port wouldn't hurt since OpenGL supports - // nearly all of the missing features that Direct3D lacks. The Xbox's version - // of Direct3D was specifically created to take advantage of certain NVIDIA - // GPU registers and provide more OpenGL-like features IHMO. - LOG_NOT_SUPPORTED(); -} - -// LTCG specific D3DDevice_SetTextureState_BorderColor function... -// This uses a custom calling convention where parameter is passed in EAX, EBX -// Test-case: Metal Wolf Chaos -VOID XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor_0) -( -) -{ - FUNC_EXPORTS; - - DWORD Stage; - DWORD Value; - - __asm { - mov Stage, eax - mov Value, ebx - } - - return EMUPATCH(D3DDevice_SetTextureState_BorderColor)(Stage, Value); -} - -// This uses a custom calling convention where parameter is passed in EAX -// TODO: Log function is not working due lost parameter in EAX. -// Test-case: Murakumo -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor_4) -( - DWORD Value -) -{ - FUNC_EXPORTS - - DWORD Stage; - __asm mov Stage, eax; - - //LOG_FUNC_BEGIN - // LOG_FUNC_ARG(Stage) - // LOG_FUNC_ARG(Value) - // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetTextureState_BorderColor_4(Stage : %d Value : %d);\n", Stage, Value); - - HRESULT hRet; -#ifdef CXBX_USE_D3D9 - hRet = g_pD3DDevice->SetSamplerState(Stage, D3DSAMP_BORDERCOLOR, Value); -#else - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BORDERCOLOR, Value); -#endif - //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetTextureState_BorderColor -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor) -( - DWORD Stage, - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Stage) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; - - HRESULT hRet; -#ifdef CXBX_USE_D3D9 - hRet = g_pD3DDevice->SetSamplerState(Stage, D3DSAMP_BORDERCOLOR, Value); -#else - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BORDERCOLOR, Value); -#endif - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// LTCG specific D3DDevice_SetTextureState_ColorKeyColor function... -// This uses a custom calling convention where parameter is passed in ESI, EBX -// Test-case: Metal Wolf Chaos -VOID XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor_0) -( -) -{ - FUNC_EXPORTS; - - DWORD Stage; - DWORD Value; - - __asm { - mov Stage, esi - mov Value, ebx - } - - return EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor)(Stage, Value); -} - -// This uses a custom calling convention where parameter is passed in EAX -// Test-case: Murakumo -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor_4) -( - DWORD Value -) -{ - FUNC_EXPORTS - - DWORD Stage; - __asm mov Stage, eax; - - return EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor)(Stage, Value); -} - -// ****************************************************************** -// * patch: D3DDevice_SetTextureState_ColorKeyColor -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor) -( - DWORD Stage, - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Stage) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; - - LOG_NOT_SUPPORTED(); -} - -// LTCG specific D3DDevice_SetTextureState_BumpEnv function... -// This uses a custom calling convention where parameter is passed in EAX -// TODO: Log function is not working due lost parameter in EAX. -// Test-case: Metal Wolf Chaos -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BumpEnv_8) -( - X_D3DTEXTURESTAGESTATETYPE Type, - DWORD Value -) -{ - FUNC_EXPORTS; - - DWORD Stage; - __asm mov Stage, eax; - - //LOG_FUNC_BEGIN - // LOG_FUNC_ARG(Stage) - // LOG_FUNC_ARG(Type) - // LOG_FUNC_ARG(Value) - // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetTextureState_BumpEnv_8(Stage : %d Type : %d Value : %d);\n", Stage, Type, Value); - - HRESULT hRet = D3D_OK; - - switch(Type) - { - case 22: // X_D3DTSS_BUMPENVMAT00 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT00, Value); - break; - case 23: // X_D3DTSS_BUMPENVMAT01 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT01, Value); - break; - case 24: // X_D3DTSS_BUMPENVMAT11 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT11, Value); - break; - case 25: // X_D3DTSS_BUMPENVMAT10 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT10, Value); - break; - case 26: // X_D3DTSS_BUMPENVLSCALE - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLSCALE, Value); - break; - } - - //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetTextureState_BumpEnv -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BumpEnv) -( - DWORD Stage, - X_D3DTEXTURESTAGESTATETYPE Type, - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Stage) - LOG_FUNC_ARG(Type) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; - - HRESULT hRet = D3D_OK; - - switch(Type) - { - case 22: // X_D3DTSS_BUMPENVMAT00 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT00, Value); - break; - case 23: // X_D3DTSS_BUMPENVMAT01 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT01, Value); - break; - case 24: // X_D3DTSS_BUMPENVMAT11 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT11, Value); - break; - case 25: // X_D3DTSS_BUMPENVMAT10 - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT10, Value); - break; - case 26: // X_D3DTSS_BUMPENVLSCALE - hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLSCALE, Value); - break; - } - - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_FrontFace -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FrontFace) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_LogicOp -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_LogicOp) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_NormalizeNormals -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_NormalizeNormals) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_TextureFactor -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_TextureFactor) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_TEXTUREFACTOR, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_ZBias -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ZBias) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet; -#ifdef CXBX_USE_D3D9 - FLOAT Biased = static_cast(Value) * -0.000005f; - Value = *reinterpret_cast(&Biased); - hRet = g_pD3DDevice->SetRenderState(D3DRS_DEPTHBIAS, Value); -#else - hRet = g_pD3DDevice->SetRenderState(D3DRS_ZBIAS, Value); -#endif - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_EdgeAntiAlias -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_EdgeAntiAlias) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - -// TODO: Analyze performance and compatibility (undefined behavior on PC with triangles or points) -// HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_EDGEANTIALIAS, Value); -// DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); - - LOG_UNIMPLEMENTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_FillMode -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FillMode) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - DWORD dwFillMode; - - if(Value != 0) - g_CurrentFillMode = EmuXB2PC_D3DFILLMODE(Value); - - if(g_iWireframe == 0) - dwFillMode = g_CurrentFillMode; - else if(g_iWireframe == 1) - dwFillMode = D3DFILL_WIREFRAME; - else - dwFillMode = D3DFILL_POINT; - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_FILLMODE, dwFillMode); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_FogColor -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FogColor) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGCOLOR, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_Dxt1NoiseEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_Dxt1NoiseEnable) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_UNIMPLEMENTED(); -} // ****************************************************************** // * patch: D3DDevice_SetRenderState_Simple @@ -6152,532 +6419,31 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetRenderState_Simple) DWORD Value ) { - FUNC_EXPORTS + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Method) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Method) - LOG_FUNC_ARG(Value) - LOG_FUNC_END; + XB_TRMP(D3DDevice_SetRenderState_Simple)(Method, Value); - // Special Case: Handle PixelShader related Render States - // TODO: Port over EmuMappedD3DRenderState and related code from Dxbx or Wip_LessVertexPatching - // After this, we don't need to do this part anymore - switch (Method & 0x00001FFC) { - case NV2A_RC_IN_ALPHA(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS0] = Value; return; - case NV2A_RC_IN_ALPHA(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS1] = Value; return; - case NV2A_RC_IN_ALPHA(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS2] = Value; return; - case NV2A_RC_IN_ALPHA(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS3] = Value; return; - case NV2A_RC_IN_ALPHA(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS4] = Value; return; - case NV2A_RC_IN_ALPHA(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS5] = Value; return; - case NV2A_RC_IN_ALPHA(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS6] = Value; return; - case NV2A_RC_IN_ALPHA(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAINPUTS7] = Value; return; - case NV2A_RC_FINAL0: TemporaryPixelShaderRenderStates[X_D3DRS_PSFINALCOMBINERINPUTSABCD] = Value; return; - case NV2A_RC_FINAL1: TemporaryPixelShaderRenderStates[X_D3DRS_PSFINALCOMBINERINPUTSEFG] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_0] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_1] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_2] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_3] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_4] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_5] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_6] = Value; return; - case NV2A_RC_CONSTANT_COLOR0(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT0_7] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_0] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_1] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_2] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_3] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_4] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_5] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_6] = Value; return; - case NV2A_RC_CONSTANT_COLOR1(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSCONSTANT1_7] = Value; return; - case NV2A_RC_OUT_ALPHA(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS0] = Value; return; - case NV2A_RC_OUT_ALPHA(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS1] = Value; return; - case NV2A_RC_OUT_ALPHA(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS2] = Value; return; - case NV2A_RC_OUT_ALPHA(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS3] = Value; return; - case NV2A_RC_OUT_ALPHA(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS4] = Value; return; - case NV2A_RC_OUT_ALPHA(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS5] = Value; return; - case NV2A_RC_OUT_ALPHA(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS6] = Value; return; - case NV2A_RC_OUT_ALPHA(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSALPHAOUTPUTS7] = Value; return; - case NV2A_RC_IN_RGB(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS0] = Value; return; - case NV2A_RC_IN_RGB(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS1] = Value; return; - case NV2A_RC_IN_RGB(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS2] = Value; return; - case NV2A_RC_IN_RGB(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS3] = Value; return; - case NV2A_RC_IN_RGB(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS4] = Value; return; - case NV2A_RC_IN_RGB(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS5] = Value; return; - case NV2A_RC_IN_RGB(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS6] = Value; return; - case NV2A_RC_IN_RGB(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBINPUTS7] = Value; return; - case NV2A_TX_SHADER_CULL_MODE: TemporaryPixelShaderRenderStates[X_D3DRS_PSCOMPAREMODE] = Value; return; - case NV2A_RC_COLOR0: TemporaryPixelShaderRenderStates[X_D3DRS_PSFINALCOMBINERCONSTANT0] = Value; return; - case NV2A_RC_COLOR1: TemporaryPixelShaderRenderStates[X_D3DRS_PSFINALCOMBINERCONSTANT1] = Value; return; - case NV2A_RC_OUT_RGB(0): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS0] = Value; return; - case NV2A_RC_OUT_RGB(1): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS1] = Value; return; - case NV2A_RC_OUT_RGB(2): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS2] = Value; return; - case NV2A_RC_OUT_RGB(3): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS3] = Value; return; - case NV2A_RC_OUT_RGB(4): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS4] = Value; return; - case NV2A_RC_OUT_RGB(5): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS5] = Value; return; - case NV2A_RC_OUT_RGB(6): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS6] = Value; return; - case NV2A_RC_OUT_RGB(7): TemporaryPixelShaderRenderStates[X_D3DRS_PSRGBOUTPUTS7] = Value; return; - case NV2A_RC_ENABLE: TemporaryPixelShaderRenderStates[X_D3DRS_PSCOMBINERCOUNT] = Value; return; - case NV2A_NOP: TemporaryPixelShaderRenderStates[X_D3DRS_PS_RESERVED] = Value; return; // Dxbx note : This takes the slot of X_D3DPIXELSHADERDEF.PSTextureModes, set by D3DDevice_SetRenderState_LogicOp? - case NV2A_TX_SHADER_DOTMAPPING: TemporaryPixelShaderRenderStates[X_D3DRS_PSDOTMAPPING] = Value; return; - case NV2A_TX_SHADER_PREVIOUS: TemporaryPixelShaderRenderStates[X_D3DRS_PSINPUTTEXTURE] = Value; return; - } - - // Fallback to non-shader render state handling - int State = -1; - - // Todo: make this faster and more elegant - for (int v = 0; v<174; v++) - { - if (EmuD3DRenderStateSimpleEncoded[v] == Method) - { - State = v; - break; - } - } - - if (State == -1) { - // Attempt to determine renderstate name for unsupported types - std::string name = "Unknown"; - for (int i = 0; i <= X_D3DRS_DONOTCULLUNCOMPRESSED; i++) { - if (DxbxRenderStateInfo[i].M == (Method & 0x00001FFC)) { - name = DxbxRenderStateInfo[i].S; - break; - } - } - - EmuWarning("RenderState_Simple(0x%.08X (%s), 0x%.08X) is unsupported!", Method, name.c_str(), Value); - } - else - { - switch(State) - { - case D3DRS_COLORWRITEENABLE: - { - DWORD OrigValue = Value; - - Value = 0; - - if(OrigValue & (1L<<16)) - Value |= D3DCOLORWRITEENABLE_RED; - if(OrigValue & (1L<<8)) - Value |= D3DCOLORWRITEENABLE_GREEN; - if(OrigValue & (1L<<0)) - Value |= D3DCOLORWRITEENABLE_BLUE; - if(OrigValue & (1L<<24)) - Value |= D3DCOLORWRITEENABLE_ALPHA; - - DbgPrintf("D3DRS_COLORWRITEENABLE := 0x%.08X\n", Value); - } + // Fetch the RenderState conversion info for the given input + int XboxRenderStateIndex = -1; + for (int i = X_D3DRS_FIRST; i <= X_D3DRS_LAST; i++) { + if (GetDxbxRenderStateInfo(i).M == PUSH_METHOD(Method)) { + XboxRenderStateIndex = i; break; - - case D3DRS_SHADEMODE: - Value = EmuXB2PC_D3DSHADEMODE(Value); - DbgPrintf("D3DRS_SHADEMODE := 0x%.08X\n", Value); - break; - - case D3DRS_BLENDOP: - Value = EmuXB2PC_D3DBLENDOP(Value); - DbgPrintf("D3DRS_BLENDOP := 0x%.08X\n", Value); - break; - - case D3DRS_SRCBLEND: - Value = EmuXB2PC_D3DBLEND(Value); - DbgPrintf("D3DRS_SRCBLEND := 0x%.08X\n", Value); - break; - - case D3DRS_DESTBLEND: - Value = EmuXB2PC_D3DBLEND(Value); - DbgPrintf("D3DRS_DESTBLEND := 0x%.08X\n", Value); - break; - - case D3DRS_ZFUNC: - Value = EmuXB2PC_D3DCMPFUNC(Value); - DbgPrintf("D3DRS_ZFUNC := 0x%.08X\n", Value); - break; - - case D3DRS_ALPHAFUNC: - Value = EmuXB2PC_D3DCMPFUNC(Value); - DbgPrintf("D3DRS_ALPHAFUNC := 0x%.08X\n", Value); - break; - - case D3DRS_ALPHATESTENABLE: - DbgPrintf("D3DRS_ALPHATESTENABLE := 0x%.08X\n", Value); - break; - - case D3DRS_ALPHABLENDENABLE: - DbgPrintf("D3DRS_ALPHABLENDENABLE := 0x%.08X\n", Value); - break; - - case D3DRS_ALPHAREF: - DbgPrintf("D3DRS_ALPHAREF := %lf\n", DWtoF(Value)); - break; - - case D3DRS_ZWRITEENABLE: - DbgPrintf("D3DRS_ZWRITEENABLE := 0x%.08X\n", Value); - break; - - case D3DRS_DITHERENABLE: - DbgPrintf("D3DRS_DITHERENABLE := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILZFAIL: - Value = EmuXB2PC_D3DSTENCILOP(Value); - DbgPrintf("D3DRS_STENCILZFAIL := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILPASS: - Value = EmuXB2PC_D3DSTENCILOP(Value); - DbgPrintf("D3DRS_STENCILPASS := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILFUNC: - Value = EmuXB2PC_D3DCMPFUNC(Value); - DbgPrintf("D3DRS_STENCILFUNC := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILREF: - DbgPrintf("D3DRS_STENCILREF := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILMASK: - DbgPrintf("D3DRS_STENCILMASK := 0x%.08X\n", Value); - break; - - case D3DRS_STENCILWRITEMASK: - DbgPrintf("D3DRS_STENCILWRITEMASK := 0x%.08X\n", Value); - break; - - default: - CxbxKrnlCleanup("Unsupported RenderState (0x%.08X)", State); - break; - }; - - // TODO: verify these params as you add support for them! - HRESULT hRet = g_pD3DDevice->SetRenderState((D3DRENDERSTATETYPE)State, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); - } -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_VertexBlend -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_VertexBlend) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - // convert from Xbox direct3d to PC direct3d enumeration - if(Value <= 1) { - Value = Value; - } else if(Value == 3) { - Value = 2; - } else if(Value == 5) { - Value = 3; - } else { - LOG_TEST_CASE("Unsupported D3DVERTEXBLENDFLAGS (%d)", Value); - return; - } - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_VERTEXBLEND, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_PSTextureModes -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_PSTextureModes) -( - DWORD Value -) -{ - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Value); - - XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES] = Value; -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_CullMode -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_CullMode) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - // convert from Xbox D3D to PC D3D enumeration - // TODO: XDK-Specific Tables? So far they are the same - switch(Value) - { - case X_D3DCULL_NONE: - Value = D3DCULL_NONE; - break; - case X_D3DCULL_CW: - Value = D3DCULL_CW; - break; - case X_D3DCULL_CCW: - Value = D3DCULL_CCW; - break; - default: - CxbxKrnlCleanup("EmuD3DDevice_SetRenderState_CullMode: Unknown Cullmode (%d)", Value); + } } - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} + // If we could not map it, log and return + if (XboxRenderStateIndex == -1) { + EmuLog(LOG_LEVEL::WARNING, "RenderState_Simple(0x%.08X (%s), 0x%.08X) could not be found in RenderState table", Method, GetDxbxRenderStateInfo(XboxRenderStateIndex).S, Value); + return; + } -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_LineWidth -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_LineWidth) -( - DWORD Value -) -{ - FUNC_EXPORTS + EmuLog(LOG_LEVEL::DEBUG, "RenderState_Simple: %s = 0x%08X", GetDxbxRenderStateInfo(XboxRenderStateIndex).S, Value); - LOG_FUNC_ONE_ARG(Value); - - // TODO: Convert to PC format?? -// g_pD3DDevice->SetRenderState(D3DRS_LINEPATTERN, Value); - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_StencilFail -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilFail) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILFAIL, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_OcclusionCullEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_OcclusionCullEnable) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_StencilCullEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilCullEnable) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_RopZCmpAlwaysRead -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_RopZCmpAlwaysRead) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_RopZRead -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_RopZRead) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_DoNotCullUncompressed -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_DoNotCullUncompressed) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_ZEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ZEnable) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_ZENABLE, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_StencilEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilEnable) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILENABLE, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_MultiSampleAntiAlias -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleAntiAlias) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_MultiSampleMask -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleMask) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, Value); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_MultiSampleMode -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleMode) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_MultiSampleRenderTargetMode -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleRenderTargetMode) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - LOG_NOT_SUPPORTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_ShadowFunc -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ShadowFunc) -( - DWORD Value -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Value); - - // ShadowFunc reflects the following Xbox-only extension - // - // typedef enum _D3DRENDERSTATETYPE { - // ... - // D3DRS_SHADOWFUNC = 156, // D3DCMPFUNC - // ... - // } D3DRENDERSTATETYPE; - // - // Value is a member of the D3DCMPFUNC enumeration that - // specifies what function to use with a shadow buffer. - // The default value is D3DCMP_NEVER. - - // EmuXB2PC_D3DCMPFUNC(Value); - - // this warning just gets annoying - // LOG_UNIMPLEMENTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_YuvEnable -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_YuvEnable) -( - BOOL Enable -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(Enable); - - g_bColorSpaceConvertYuvToRgb = (Enable != FALSE); + XboxRenderStates.SetXboxRenderState(XboxRenderStateIndex, Value); } // LTCG specific D3DDevice_SetTransform function... @@ -6686,8 +6452,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SetTransform_0) ( ) { - FUNC_EXPORTS; - D3DTRANSFORMSTATETYPE param1; CONST D3DMATRIX *param2; @@ -6708,8 +6472,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTransform) CONST D3DMATRIX *pMatrix ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(State) LOG_FUNC_ARG(pMatrix) @@ -6751,9 +6513,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_MultiplyTransform) CONST D3DMATRIX *pMatrix ) { - FUNC_EXPORTS - - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN LOG_FUNC_ARG(State) LOG_FUNC_ARG(pMatrix) LOG_FUNC_END; @@ -6774,8 +6534,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetTransform) D3DMATRIX *pMatrix ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(State) LOG_FUNC_ARG(pMatrix) @@ -6800,8 +6558,6 @@ VOID WINAPI XTL::EMUPATCH(Lock2DSurface) DWORD Flags ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pPixelContainer) LOG_FUNC_ARG(FaceType) @@ -6813,9 +6569,7 @@ VOID WINAPI XTL::EMUPATCH(Lock2DSurface) // Pass through to the Xbox implementation of this function - XB_trampoline(VOID, WINAPI, Lock2DSurface, (X_D3DPixelContainer*, D3DCUBEMAP_FACES, UINT, D3DLOCKED_RECT*, RECT*, DWORD)); - - XB_Lock2DSurface(pPixelContainer, FaceType, Level, pLockedRect, pRect, Flags); + XB_TRMP(Lock2DSurface)(pPixelContainer, FaceType, Level, pLockedRect, pRect, Flags); // Mark the resource as modified ForceResourceRehash(pPixelContainer); @@ -6834,8 +6588,6 @@ VOID WINAPI XTL::EMUPATCH(Lock3DSurface) DWORD Flags ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pPixelContainer) LOG_FUNC_ARG(Level) @@ -6845,9 +6597,7 @@ VOID WINAPI XTL::EMUPATCH(Lock3DSurface) LOG_FUNC_END; // Pass through to the Xbox implementation of this function - XB_trampoline(VOID, WINAPI, Lock3DSurface, (X_D3DPixelContainer*, UINT, D3DLOCKED_BOX*, D3DBOX*, DWORD)); - - XB_Lock3DSurface(pPixelContainer, Level, pLockedVolume, pBox, Flags); + XB_TRMP(Lock3DSurface)(pPixelContainer, Level, pLockedVolume, pBox, Flags); // Mark the resource as modified ForceResourceRehash(pPixelContainer); @@ -6863,8 +6613,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStreamSource_4) UINT Stride ) { - FUNC_EXPORTS - UINT StreamNumber; X_D3DVertexBuffer *pStreamData; @@ -6878,17 +6626,13 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStreamSource_4) // LOG_FUNC_ARG(pStreamData) // LOG_FUNC_ARG(Stride) // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetStreamSource_4(StreamNumber : %08X pStreamData : %08X Stride : %08X);\n", StreamNumber, pStreamData, Stride); + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetStreamSource_4(StreamNumber : %08X pStreamData : %08X Stride : %08X);", StreamNumber, pStreamData, Stride); - // Forward to Xbox implementation + CxbxImpl_SetStreamSource(StreamNumber, pStreamData, Stride); + + // TODO : Forward to Xbox implementation // This should stop us having to patch GetStreamSource! - //XB_trampoline(VOID, WINAPI, D3DDevice_SetStreamSource_4, (UINT, X_D3DVertexBuffer*, UINT)); - //XB_D3DDevice_SetStreamSource_4(StreamNumber, pStreamData, Stride); - - if (StreamNumber < 16) { - g_D3DStreams[StreamNumber] = pStreamData; - g_D3DStreamStrides[StreamNumber] = Stride; - } + //XB_TRMP(D3DDevice_SetStreamSource_4)(StreamNumber, pStreamData, Stride); } // This uses a custom calling convention where parameter is passed in EAX @@ -6900,8 +6644,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStreamSource_8) UINT Stride ) { - FUNC_EXPORTS - UINT StreamNumber; __asm { @@ -6913,17 +6655,13 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStreamSource_8) // LOG_FUNC_ARG(pStreamData) // LOG_FUNC_ARG(Stride) // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetStreamSource_8(StreamNumber : %08X pStreamData : %08X Stride : %08X);\n", StreamNumber, pStreamData, Stride); + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetStreamSource_8(StreamNumber : %08X pStreamData : %08X Stride : %08X);", StreamNumber, pStreamData, Stride); - // Forward to Xbox implementation + CxbxImpl_SetStreamSource(StreamNumber, pStreamData, Stride); + + // TODO : Forward to Xbox implementation // This should stop us having to patch GetStreamSource! - //XB_trampoline(VOID, WINAPI, D3DDevice_SetStreamSource_8, (X_D3DVertexBuffer*, UINT)); - //XB_D3DDevice_SetStreamSource_8(pStreamData, Stride); - - if (StreamNumber < 16) { - g_D3DStreams[StreamNumber] = pStreamData; - g_D3DStreamStrides[StreamNumber] = Stride; - } + //XB_TRMP(D3DDevice_SetStreamSource_8)(pStreamData, Stride); } // ****************************************************************** @@ -6936,23 +6674,17 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStreamSource) UINT Stride ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(StreamNumber) LOG_FUNC_ARG(pStreamData) LOG_FUNC_ARG(Stride) LOG_FUNC_END; + CxbxImpl_SetStreamSource(StreamNumber, pStreamData, Stride); + // Forward to Xbox implementation // This should stop us having to patch GetStreamSource! - XB_trampoline(VOID, WINAPI, D3DDevice_SetStreamSource, (UINT, X_D3DVertexBuffer*, UINT)); - XB_D3DDevice_SetStreamSource(StreamNumber, pStreamData, Stride); - - if (StreamNumber < 16) { - g_D3DStreams[StreamNumber] = pStreamData; - g_D3DStreamStrides[StreamNumber] = Stride; - } + XB_TRMP(D3DDevice_SetStreamSource)(StreamNumber, pStreamData, Stride); } // ****************************************************************** @@ -6963,8 +6695,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShader) DWORD Handle ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Handle); // Checks if the Handle has bit 0 set - if not, it's a FVF @@ -6978,208 +6708,93 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShader) HRESULT hRet = D3D_OK; - g_CurrentXboxVertexShaderHandle = Handle; + g_Xbox_VertexShader_Handle = Handle; - // Store viewport offset and scale in constant registers 58 (c-38) and - // 59 (c-37) used for screen space transformation. - if(g_VertexShaderConstantMode != X_D3DSCM_NORESERVEDCONSTANTS) - { - D3DVIEWPORT ViewPort; - g_pD3DDevice->GetViewport(&ViewPort); + if (VshHandleIsVertexShader(Handle)) { + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(Handle); + SetCxbxVertexShader(pCxbxVertexShader); - float vScale[] = { (2.0f / ViewPort.Width), (-2.0f / ViewPort.Height), 0.0f, 0.0f }; - static float vOffset[] = { -1.0f, 1.0f, 0.0f, 1.0f }; - -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetVertexShaderConstantF(58, vScale, 1); - g_pD3DDevice->SetVertexShaderConstantF(59, vOffset, 1); -#else - g_pD3DDevice->SetVertexShaderConstant(58, vScale, 1); - g_pD3DDevice->SetVertexShaderConstant(59, vOffset, 1); -#endif - } - - DWORD HostVertexShaderHandle; - if(VshHandleIsVertexShader(Handle)) - { - HostVertexShaderHandle = MapXboxVertexShaderHandleToCxbxVertexShader(Handle)->Handle; - } - else - { - HostVertexShaderHandle = Handle; - - const DWORD AllXboxD3DFVF = 0 - | D3DFVF_XYZ - | D3DFVF_XYZRHW - | D3DFVF_XYZB1 - | D3DFVF_XYZB2 - | D3DFVF_XYZB3 - | D3DFVF_XYZB4 - | D3DFVF_DIFFUSE - | D3DFVF_NORMAL - | D3DFVF_SPECULAR - | D3DFVF_TEXCOUNT_MASK - | D3DFVF_TEXCOORDSIZE1(0) - | D3DFVF_TEXCOORDSIZE2(0) - | D3DFVF_TEXCOORDSIZE3(0) - | D3DFVF_TEXCOORDSIZE4(0) - | D3DFVF_TEXCOORDSIZE1(1) - | D3DFVF_TEXCOORDSIZE2(1) - | D3DFVF_TEXCOORDSIZE3(1) - | D3DFVF_TEXCOORDSIZE4(1) - | D3DFVF_TEXCOORDSIZE1(2) - | D3DFVF_TEXCOORDSIZE2(2) - | D3DFVF_TEXCOORDSIZE3(2) - | D3DFVF_TEXCOORDSIZE4(2) - | D3DFVF_TEXCOORDSIZE1(3) - | D3DFVF_TEXCOORDSIZE2(3) - | D3DFVF_TEXCOORDSIZE3(3) - | D3DFVF_TEXCOORDSIZE4(3) - ; - - if ((HostVertexShaderHandle & D3DFVF_TEXCOUNT_MASK) > D3DFVF_TEX4) { - EmuWarning("EmuD3DDevice_SetVertexShader : FVF contains too many textures! Handle = 0x%.08X", HostVertexShaderHandle); - // Set maximum number of textures (so following code doens't throw a fit) : - HostVertexShaderHandle = (HostVertexShaderHandle & ~D3DFVF_TEXCOUNT_MASK) | D3DFVF_TEX4; - // TODO : Instead of changing the FVF here, strenghthen users against this situation. - } - - if ((HostVertexShaderHandle & ~AllXboxD3DFVF) > 0) { - EmuWarning("EmuD3DDevice_SetVertexShader : FVF contains unknown flags! Handle = 0x%.08X", HostVertexShaderHandle); - // Mask away all bits that aren't valid on Xbox : - HostVertexShaderHandle &= AllXboxD3DFVF; - // TODO : Instead of changing the FVF here, see if (and which) users need to be updated. - } - } - -#ifdef CXBX_USE_D3D9 - hRet = g_pD3DDevice->SetVertexShader(nullptr); - hRet = g_pD3DDevice->SetFVF(HostVertexShaderHandle); -#else - hRet = g_pD3DDevice->SetVertexShader(HostVertexShaderHandle); -#endif - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader"); -} - -// TODO : Move to own file -constexpr UINT QuadToTriangleVertexCount(UINT NrOfQuadVertices) -{ - return (NrOfQuadVertices * VERTICES_PER_TRIANGLE * TRIANGLES_PER_QUAD) / VERTICES_PER_QUAD; -} - -// TODO : Move to own file -bool WindingClockwise = true; -constexpr uint IndicesPerPage = PAGE_SIZE / sizeof(XTL::INDEX16); -constexpr uint InputQuadsPerPage = ((IndicesPerPage * VERTICES_PER_QUAD) / VERTICES_PER_TRIANGLE) / TRIANGLES_PER_QUAD; - -// TODO : Move to own file -XTL::INDEX16 *CxbxAssureQuadListIndexBuffer(UINT NrOfQuadVertices) -{ - if (QuadToTriangleIndexBuffer_Size < NrOfQuadVertices) - { - QuadToTriangleIndexBuffer_Size = RoundUp(NrOfQuadVertices, InputQuadsPerPage); - - UINT NrOfTriangleVertices = QuadToTriangleVertexCount(QuadToTriangleIndexBuffer_Size); - - if (pQuadToTriangleIndexBuffer != nullptr) - free(pQuadToTriangleIndexBuffer); - - pQuadToTriangleIndexBuffer = (XTL::INDEX16 *)malloc(sizeof(XTL::INDEX16) * NrOfTriangleVertices); - - UINT i = 0; - XTL::INDEX16 j = 0; - while (i + 6 < NrOfTriangleVertices) - { - if (WindingClockwise) { - // ABCD becomes ABC+CDA, so this is triangle 1 : - pQuadToTriangleIndexBuffer[i + 0] = j + 0; - pQuadToTriangleIndexBuffer[i + 1] = j + 1; - pQuadToTriangleIndexBuffer[i + 2] = j + 2; - i += VERTICES_PER_TRIANGLE; - - // And this is triangle 2 : - pQuadToTriangleIndexBuffer[i + 0] = j + 2; - pQuadToTriangleIndexBuffer[i + 1] = j + 3; - pQuadToTriangleIndexBuffer[i + 2] = j + 0; - i += VERTICES_PER_TRIANGLE; - } - else - { - // ABCD becomes ADC+CBA, so this is triangle 1 : - pQuadToTriangleIndexBuffer[i + 0] = j + 0; - pQuadToTriangleIndexBuffer[i + 1] = j + 3; - pQuadToTriangleIndexBuffer[i + 2] = j + 2; - i += VERTICES_PER_TRIANGLE; - - // And this is triangle 2 : - pQuadToTriangleIndexBuffer[i + 0] = j + 2; - pQuadToTriangleIndexBuffer[i + 1] = j + 1; - pQuadToTriangleIndexBuffer[i + 2] = j + 0; - i += VERTICES_PER_TRIANGLE; - } - - // Next quad, please : - j += VERTICES_PER_QUAD; - } + } else { + hRet = g_pD3DDevice->SetVertexShader(nullptr); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader"); + hRet = g_pD3DDevice->SetFVF(Handle); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetFVF"); } - return pQuadToTriangleIndexBuffer; + UpdateViewPortOffsetAndScaleConstants(); } // TODO : Move to own file -void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadVertices) +constexpr unsigned int IndicesPerPage = PAGE_SIZE / sizeof(INDEX16); +constexpr unsigned int InputQuadsPerPage = ((IndicesPerPage * VERTICES_PER_QUAD) / VERTICES_PER_TRIANGLE) / TRIANGLES_PER_QUAD; + +// TODO : Move to own file +// Called by CxbxDrawPrimitiveUP (indirectly by D3DDevice_DrawVerticesUP, +// EmuExecutePushBufferRaw and EmuFlushIVB) when PrimitiveType == X_D3DPT_QUADLIST. +// Emulated by calling g_pD3DDevice->DrawIndexedPrimitiveUP with index data that maps +// quads to triangles. This function creates the index buffer that is needed for this; +// For every quad that must be drawn, we generate indices for two triangles. +// Note, that the resulting index data can be re-used for later comparable draw calls +// and only needs to grow when current length doesn't suffices for a larger draw. +INDEX16 *CxbxAssureQuadListIndexData(UINT NrOfQuadIndices) +{ + if (g_QuadToTriangleIndexData_Size < NrOfQuadIndices) + { + g_QuadToTriangleIndexData_Size = RoundUp(NrOfQuadIndices, InputQuadsPerPage); + UINT NrOfTriangleIndices = QuadToTriangleVertexCount(g_QuadToTriangleIndexData_Size); + if (g_pQuadToTriangleIndexData != nullptr) { + free(g_pQuadToTriangleIndexData); + } + + g_pQuadToTriangleIndexData = (INDEX16 *)malloc(NrOfTriangleIndices * sizeof(INDEX16)); + CxbxConvertQuadListToTriangleListIndices(nullptr, NrOfTriangleIndices, g_pQuadToTriangleIndexData); + } + + return g_pQuadToTriangleIndexData; +} + +// TODO : Move to own file +// Makes a D3D IndexBuffer active that contains quadlist-to-trianglelist indices. +// Uses CxbxAssureQuadListIndexData to populate the index buffer with. +// Note, that the resulting index buffer can be re-used for later comparable draw calls +// and only needs to grow when current length doesn't sufficesw for a larger draw. +void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadIndices) { LOG_INIT // Allows use of DEBUG_D3DRESULT HRESULT hRet; - if (QuadToTriangleD3DIndexBuffer_Size < NrOfQuadVertices) + if (g_QuadToTriangleHostIndexBuffer_Size < NrOfQuadIndices) { // Round the number of indices up so we'll allocate whole pages - QuadToTriangleD3DIndexBuffer_Size = RoundUp(NrOfQuadVertices, InputQuadsPerPage); - UINT NrOfTriangleVertices = QuadToTriangleVertexCount(QuadToTriangleD3DIndexBuffer_Size); // 4 > 6 - UINT uiIndexBufferSize = sizeof(XTL::INDEX16) * NrOfTriangleVertices; + g_QuadToTriangleHostIndexBuffer_Size = RoundUp(NrOfQuadIndices, InputQuadsPerPage); + UINT NrOfTriangleIndices = QuadToTriangleVertexCount(g_QuadToTriangleHostIndexBuffer_Size); // 4 > 6 // Create a new native index buffer of the above determined size : - if (pQuadToTriangleD3DIndexBuffer != nullptr) { - pQuadToTriangleD3DIndexBuffer->Release(); - pQuadToTriangleD3DIndexBuffer = nullptr; + if (g_pQuadToTriangleHostIndexBuffer != nullptr) { + g_pQuadToTriangleHostIndexBuffer->Release(); // test-case : XDK PointSprites + g_pQuadToTriangleHostIndexBuffer = nullptr; } - hRet = g_pD3DDevice->CreateIndexBuffer( - uiIndexBufferSize, - D3DUSAGE_WRITEONLY, - XTL::D3DFMT_INDEX16, - XTL::D3DPOOL_MANAGED, - &pQuadToTriangleD3DIndexBuffer -#ifdef CXBX_USE_D3D9 - , nullptr // pSharedHandle -#endif - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateIndexBuffer"); - - if (FAILED(hRet)) + // Create a new native index buffer of the above determined size : + g_pQuadToTriangleHostIndexBuffer = CxbxCreateIndexBuffer(NrOfTriangleIndices); + if (g_pQuadToTriangleHostIndexBuffer == nullptr) CxbxKrnlCleanup("CxbxAssureQuadListD3DIndexBuffer : IndexBuffer Create Failed!"); // Put quadlist-to-triangle-list index mappings into this buffer : - XTL::INDEX16* pIndexBufferData = nullptr; - hRet = pQuadToTriangleD3DIndexBuffer->Lock(0, uiIndexBufferSize, (D3DLockData **)&pIndexBufferData, D3DLOCK_DISCARD); - DEBUG_D3DRESULT(hRet, "pQuadToTriangleD3DIndexBuffer->Lock"); - - if (pIndexBufferData == nullptr) + INDEX16* pHostIndexBufferData = nullptr; + hRet = g_pQuadToTriangleHostIndexBuffer->Lock(0, /*entire SizeToLock=*/0, (D3DLockData **)&pHostIndexBufferData, D3DLOCK_DISCARD); + DEBUG_D3DRESULT(hRet, "g_pQuadToTriangleHostIndexBuffer->Lock"); + if (pHostIndexBufferData == nullptr) CxbxKrnlCleanup("CxbxAssureQuadListD3DIndexBuffer : Could not lock index buffer!"); - memcpy(pIndexBufferData, CxbxAssureQuadListIndexBuffer(NrOfQuadVertices), uiIndexBufferSize); + memcpy(pHostIndexBufferData, CxbxAssureQuadListIndexData(NrOfQuadIndices), NrOfTriangleIndices * sizeof(INDEX16)); - pQuadToTriangleD3DIndexBuffer->Unlock(); + g_pQuadToTriangleHostIndexBuffer->Unlock(); } // Activate the new native index buffer : -#ifdef CXBX_USE_D3D9 - hRet = g_pD3DDevice->SetIndices(pQuadToTriangleD3DIndexBuffer); -#else - hRet = g_pD3DDevice->SetIndices(pQuadToTriangleD3DIndexBuffer, 0); -#endif + hRet = g_pD3DDevice->SetIndices(g_pQuadToTriangleHostIndexBuffer); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetIndices"); if (FAILED(hRet)) @@ -7188,54 +6803,39 @@ void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadVertices) // TODO : Move to own file // Calls SetIndices with a separate index-buffer, that's populated with the supplied indices. -void CxbxDrawIndexedClosingLine(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex) +void CxbxDrawIndexedClosingLine(INDEX16 LowIndex, INDEX16 HighIndex) { LOG_INIT // Allows use of DEBUG_D3DRESULT HRESULT hRet; - const UINT uiIndexBufferSize = sizeof(XTL::INDEX16) * 2; // 4 bytes needed for 2 indices - if (pClosingLineLoopIndexBuffer == nullptr) { - hRet = g_pD3DDevice->CreateIndexBuffer( - uiIndexBufferSize, - D3DUSAGE_WRITEONLY, - XTL::D3DFMT_INDEX16, - XTL::D3DPOOL_DEFAULT, - &pClosingLineLoopIndexBuffer -#ifdef CXBX_USE_D3D9 - , nullptr // pSharedHandle -#endif - ); - if (FAILED(hRet)) - CxbxKrnlCleanup("Unable to create pClosingLineLoopIndexBuffer for D3DPT_LINELOOP emulation"); + if (g_pClosingLineLoopHostIndexBuffer == nullptr) { + g_pClosingLineLoopHostIndexBuffer = CxbxCreateIndexBuffer(VERTICES_PER_LINE); + if (g_pClosingLineLoopHostIndexBuffer == nullptr) + CxbxKrnlCleanup("Unable to create g_pClosingLineLoopHostIndexBuffer for D3DPT_LINELOOP emulation"); } - XTL::INDEX16 *pCxbxClosingLineLoopIndexBufferData = nullptr; - hRet = pClosingLineLoopIndexBuffer->Lock(0, uiIndexBufferSize, (D3DLockData **)(&pCxbxClosingLineLoopIndexBufferData), D3DLOCK_DISCARD); - DEBUG_D3DRESULT(hRet, "pClosingLineLoopIndexBuffer->Lock"); + INDEX16 *pCxbxClosingLineLoopIndexBufferData = nullptr; + hRet = g_pClosingLineLoopHostIndexBuffer->Lock(0, /*entire SizeToLock=*/0, (D3DLockData **)&pCxbxClosingLineLoopIndexBufferData, D3DLOCK_DISCARD); + DEBUG_D3DRESULT(hRet, "g_pClosingLineLoopHostIndexBuffer->Lock"); + // Set the indices for the two VERTICES_PER_LINE : pCxbxClosingLineLoopIndexBufferData[0] = LowIndex; pCxbxClosingLineLoopIndexBufferData[1] = HighIndex; - hRet = pClosingLineLoopIndexBuffer->Unlock(); - DEBUG_D3DRESULT(hRet, "pClosingLineLoopIndexBuffer->Unlock"); + hRet = g_pClosingLineLoopHostIndexBuffer->Unlock(); + DEBUG_D3DRESULT(hRet, "g_pClosingLineLoopHostIndexBuffer->Unlock"); -#ifdef CXBX_USE_D3D9 - hRet = g_pD3DDevice->SetIndices(pClosingLineLoopIndexBuffer); -#else - hRet = g_pD3DDevice->SetIndices(pClosingLineLoopIndexBuffer, g_XboxBaseVertexIndex); -#endif + hRet = g_pD3DDevice->SetIndices(g_pClosingLineLoopHostIndexBuffer); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetIndices"); hRet = g_pD3DDevice->DrawIndexedPrimitive( - XTL::D3DPT_LINELIST, -#ifdef CXBX_USE_D3D9 - g_XboxBaseVertexIndex, -#endif - LowIndex, // minIndex - (HighIndex - LowIndex) + 1, // NumVertexIndices - 0, // startIndex - 1 // primCount + /*PrimitiveType=*/D3DPT_LINELIST, + /*BaseVertexIndex=*/0, // Note : Callers must apply BaseVertexIndex to the LowIndex and HighIndex argument values + /*MinVertexIndex=*/LowIndex, + /*NumVertices=*/VERTICES_PER_LINE, + /*startIndex=*/0, + /*primCount=*/1 ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive(CxbxDrawIndexedClosingLine)"); @@ -7243,150 +6843,138 @@ void CxbxDrawIndexedClosingLine(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex) } // TODO : Move to own file -void CxbxDrawIndexedClosingLineUP(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex, void *pHostVertexStreamZeroData, UINT uiHostVertexStreamZeroStride) +void CxbxDrawIndexedClosingLineUP(INDEX16 LowIndex, INDEX16 HighIndex, void *pHostVertexStreamZeroData, UINT uiHostVertexStreamZeroStride) { LOG_INIT // Allows use of DEBUG_D3DRESULT - XTL::INDEX16 CxbxClosingLineIndices[2] = { LowIndex, HighIndex }; +#if 0 + // Since we can use pHostVertexStreamZeroData here, we can close the line simpler than + // via CxbxDrawIndexedClosingLine, by drawing two indices via DrawIndexedPrimitiveUP. + // (This is simpler because we use just indices and don't need to copy the vertices.) + INDEX16 CxbxClosingLineIndices[2] = { LowIndex, HighIndex }; HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP( - XTL::D3DPT_LINELIST, - LowIndex, // MinVertexIndex - (HighIndex - LowIndex) + 1, // NumVertexIndices, - 1, // PrimitiveCount, - CxbxClosingLineIndices, // pIndexData - XTL::D3DFMT_INDEX16, // IndexDataFormat + /*PrimitiveType=*/D3DPT_LINELIST, + /*MinVertexIndex=*/LowIndex, + /*NumVertices=*/(HighIndex - LowIndex) + 1, + /*PrimitiveCount=*/1, + /*pIndexData=*/CxbxClosingLineIndices, + /*IndexDataFormat=*/D3DFMT_INDEX16, pHostVertexStreamZeroData, uiHostVertexStreamZeroStride ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitiveUP(CxbxDrawIndexedClosingLineUP)"); +#else // TODO : If NumVertices is high, performance might suffer - drawing a copy of the two vertices could be faster + // Since we can use pHostVertexStreamZeroData here, we can close the line simpler than + // via CxbxDrawIndexedClosingLine, by drawing two vertices via DrawPrimitiveUP. + // (This is simpler because we just copy the vertices, and don't need a separate index buffer.) + uint8_t VertexData[512]; assert(512 >= 2 * uiHostVertexStreamZeroStride); + uint8_t *FirstVertex = (uint8_t *)pHostVertexStreamZeroData + (LowIndex * uiHostVertexStreamZeroStride); + uint8_t *SecondVertex = (uint8_t *)pHostVertexStreamZeroData + (HighIndex * uiHostVertexStreamZeroStride); + + memcpy(VertexData, FirstVertex, uiHostVertexStreamZeroStride); + memcpy(VertexData + uiHostVertexStreamZeroStride, SecondVertex, uiHostVertexStreamZeroStride); + + HRESULT hRet = g_pD3DDevice->DrawPrimitiveUP( + /*PrimitiveType=*/D3DPT_LINELIST, + /*PrimitiveCount=*/1, + /*pVertexStreamZeroData=*/VertexData, + uiHostVertexStreamZeroStride + ); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawPrimitiveUP(CxbxDrawIndexedClosingLineUP)"); +#endif g_dwPrimPerFrame++; } -// TODO : Move to own file -//Walk through index buffer -void WalkIndexBuffer(XTL::INDEX16 &LowIndex, XTL::INDEX16 &HighIndex, XTL::INDEX16 *pIndexData, DWORD dwIndexCount) -{ - // Determine highest and lowest index in use - LowIndex = pIndexData[0]; - HighIndex = LowIndex; - for (uint i = 1; i < dwIndexCount; i++) { - XTL::INDEX16 Index = pIndexData[i]; - if (LowIndex > Index) - LowIndex = Index; - if (HighIndex < Index) - HighIndex = Index; - } -} - -// Requires assigned pIndexData +// Requires assigned pXboxIndexData // Called by D3DDevice_DrawIndexedVertices and EmuExecutePushBufferRaw (twice) -void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext) +void CxbxDrawIndexed(CxbxDrawContext &DrawContext) { LOG_INIT // Allows use of DEBUG_D3DRESULT assert(DrawContext.dwStartVertex == 0); - assert(DrawContext.pIndexData != nullptr); + assert(DrawContext.pXboxIndexData != nullptr); + assert(DrawContext.dwVertexCount > 0); // TODO : If this fails, make responsible callers do an early-exit assert(IsValidCurrentShader()); - CxbxUpdateActiveIndexBuffer(DrawContext.pIndexData, DrawContext.dwVertexCount); + bool bConvertQuadListToTriangleList = (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_QUADLIST); + ConvertedIndexBuffer& CacheEntry = CxbxUpdateActiveIndexBuffer(DrawContext.pXboxIndexData, DrawContext.dwVertexCount, bConvertQuadListToTriangleList); + // Note : CxbxUpdateActiveIndexBuffer calls SetIndices - CxbxVertexBufferConverter VertexBufferConverter = {}; - VertexBufferConverter.Apply(&DrawContext); + // Set LowIndex and HighIndex *before* VerticesInBuffer gets derived + DrawContext.LowIndex = CacheEntry.LowIndex; + DrawContext.HighIndex = CacheEntry.HighIndex; - if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) { - UINT uiStartIndex = 0; - int iNumVertices = (int)DrawContext.dwVertexCount; - // Indexed quadlist can be drawn using unpatched indexes via multiple draws of 2 'strip' triangles : - // 4 vertices are just enough for two triangles (a fan starts with 3 vertices for 1 triangle, - // and adds 1 triangle via 1 additional vertex) - // This is slower (because of call-overhead) but doesn't require any index buffer patching. - // Draw 1 quad as a 2 triangles in a fan (which both have the same winding order) : - // Test-cases : XDK samples reaching this case are : DisplacementMap, Ripple - // Test-case : XDK Samples (Billboard, BumpLens, DebugKeyboard, Gamepad, Lensflare, PerfTest?VolumeLight, PointSprites, Tiling, VolumeFog, VolumeSprites, etc) - while (iNumVertices >= VERTICES_PER_QUAD) { - // Determine highest and lowest index in use : - INDEX16 LowIndex; - INDEX16 HighIndex; - WalkIndexBuffer(LowIndex, HighIndex, &(DrawContext.pIndexData[uiStartIndex]), VERTICES_PER_QUAD); + VertexBufferConverter.Apply(&DrawContext); // Sets dwHostPrimitiveCount - // Emulate a quad by drawing each as a fan of 2 triangles - HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive( - D3DPT_TRIANGLEFAN, -#ifdef CXBX_USE_D3D9 - DrawContext.dwIndexBase, -#endif - LowIndex, // minIndex - (HighIndex - LowIndex) + 1, // NumVertices - uiStartIndex, - TRIANGLES_PER_QUAD // primCount = Draw 2 triangles - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive(X_D3DPT_QUADLIST)"); + INT BaseVertexIndex = DrawContext.dwBaseVertexIndex; + UINT primCount = DrawContext.dwHostPrimitiveCount; + if (bConvertQuadListToTriangleList) { + if (DrawContext.dwVertexCount == 4) + LOG_TEST_CASE("X_D3DPT_QUADLIST (single quad)"); // breakpoint location + else + LOG_TEST_CASE("X_D3DPT_QUADLIST"); - uiStartIndex += VERTICES_PER_QUAD; - iNumVertices -= VERTICES_PER_QUAD; - g_dwPrimPerFrame += TRIANGLES_PER_QUAD; - } + if (BaseVertexIndex > 0) + LOG_TEST_CASE("X_D3DPT_QUADLIST (BaseVertexIndex > 0)"); + + // Convert draw arguments from quads to triangles : + // Note : BaseVertexIndex must NOT be mapped through QuadToTriangleVertexCount(BaseVertexIndex)! + primCount *= TRIANGLES_PER_QUAD; } - else { - //Walk through index buffer - // Determine highest and lowest index in use : - INDEX16 LowIndex, HighIndex; - WalkIndexBuffer(LowIndex, HighIndex, &(DrawContext.pIndexData[DrawContext.dwStartVertex]), DrawContext.dwVertexCount); - // Primitives other than X_D3DPT_QUADLIST can be drawn using one DrawIndexedPrimitive call : - HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive( - EmuXB2PC_D3DPrimitiveType(DrawContext.XboxPrimitiveType), -#ifdef CXBX_USE_D3D9 - DrawContext.dwIndexBase, -#endif - /* MinVertexIndex = */LowIndex, - /* NumVertices = */(HighIndex - LowIndex) + 1,//using index vertex span here. // TODO : g_EmuD3DActiveStreamSizes[0], // Note : ATI drivers are especially picky about this - - // NumVertices should be the span of covered vertices in the active vertex buffer (TODO : Is stream 0 correct?) - DrawContext.dwStartVertex, - DrawContext.dwHostPrimitiveCount); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive"); + // See https://docs.microsoft.com/en-us/windows/win32/direct3d9/rendering-from-vertex-and-index-buffers + // for an explanation on the function of the BaseVertexIndex, MinVertexIndex, NumVertices and StartIndex arguments. + HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive( + /* PrimitiveType = */EmuXB2PC_D3DPrimitiveType(DrawContext.XboxPrimitiveType), + BaseVertexIndex, + /* MinVertexIndex = */CacheEntry.LowIndex, + /* NumVertices = */(CacheEntry.HighIndex - CacheEntry.LowIndex) + 1, + /* startIndex = DrawContext.dwStartVertex = */0, + primCount); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive"); - g_dwPrimPerFrame += DrawContext.dwHostPrimitiveCount; - if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) { - // Close line-loops using a final single line, drawn from the end to the start vertex + g_dwPrimPerFrame += primCount; + if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_LINELOOP) { + // Close line-loops using a final single line, drawn from the end to the start vertex + if (BaseVertexIndex == 0) { LOG_TEST_CASE("X_D3DPT_LINELOOP"); - // Read the end and start index from the supplied index data - LowIndex = DrawContext.pIndexData[0]; - HighIndex = DrawContext.pIndexData[DrawContext.dwHostPrimitiveCount]; - // If needed, swap so highest index is higher than lowest (duh) - if (HighIndex < LowIndex) { - HighIndex ^= LowIndex; - LowIndex ^= HighIndex; - HighIndex ^= LowIndex; - } - - // Draw the closing line using a helper function (which will SetIndices) - CxbxDrawIndexedClosingLine(LowIndex, HighIndex); - // NOTE : We don't restore the previously active index buffer + } else { + LOG_TEST_CASE("X_D3DPT_LINELOOP (BaseVertexIndex > 0)"); + // Note : This is to find test-cases for the BaseVertexIndex addition below: } + // Read the end and start index from the supplied index data + INDEX16 LowIndex = BaseVertexIndex + DrawContext.pXboxIndexData[0]; + INDEX16 HighIndex = BaseVertexIndex + DrawContext.pXboxIndexData[DrawContext.dwHostPrimitiveCount]; + // If needed, swap so highest index is higher than lowest (duh) + if (HighIndex < LowIndex) { + std::swap(HighIndex, LowIndex); + } + + // Draw the closing line using a helper function (which will SetIndices) + CxbxDrawIndexedClosingLine(LowIndex, HighIndex); + // NOTE : We don't restore the previously active index buffer } } // TODO : Move to own file // Drawing function specifically for rendering Xbox draw calls supplying a 'User Pointer'. // Called by D3DDevice_DrawVerticesUP, EmuExecutePushBufferRaw and EmuFlushIVB -void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext) +void CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext) { LOG_INIT // Allows use of DEBUG_D3DRESULT assert(DrawContext.dwStartVertex == 0); - assert(DrawContext.pXboxVertexStreamZeroData != NULL); + assert(DrawContext.pXboxVertexStreamZeroData != xbnullptr); assert(DrawContext.uiXboxVertexStreamZeroStride > 0); - assert(DrawContext.dwIndexBase == 0); // No IndexBase under Draw*UP + assert(DrawContext.dwBaseVertexIndex == 0); // No IndexBase under Draw*UP - CxbxVertexBufferConverter VertexBufferConverter = {}; VertexBufferConverter.Apply(&DrawContext); - if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) { - // LOG_TEST_CASE("X_D3DPT_QUADLIST"); // X-Marbles and XDK Sample PlayField hits this case + if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_QUADLIST) { + // LOG_TEST_CASE("X_D3DPT_QUADLIST"); // test-case : X-Marbles and XDK Sample PlayField // Draw quadlists using a single 'quad-to-triangle mapping' index buffer : - INDEX16 *pIndexData = CxbxAssureQuadListIndexBuffer(DrawContext.dwVertexCount); + INDEX16 *pIndexData = CxbxAssureQuadListIndexData(DrawContext.dwVertexCount); // Convert quad vertex-count to triangle vertex count : UINT PrimitiveCount = DrawContext.dwHostPrimitiveCount * TRIANGLES_PER_QUAD; @@ -7395,13 +6983,14 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext) INDEX16 LowIndex = 0; INDEX16 HighIndex = (INDEX16)(DrawContext.dwVertexCount - 1); + // Draw indexed triangles instead of quads HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP( - D3DPT_TRIANGLELIST, // Draw indexed triangles instead of quads - LowIndex, // MinVertexIndex - (HighIndex - LowIndex) + 1, // NumVertexIndices + /*PrimitiveType=*/D3DPT_TRIANGLELIST, + /*MinVertexIndex=*/LowIndex, + /*NumVertexIndices=*/(HighIndex - LowIndex) + 1, PrimitiveCount, pIndexData, - D3DFMT_INDEX16, // IndexDataFormat + /*IndexDataFormat=*/D3DFMT_INDEX16, DrawContext.pHostVertexStreamZeroData, DrawContext.uiHostVertexStreamZeroStride ); @@ -7420,11 +7009,8 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext) DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawPrimitiveUP"); g_dwPrimPerFrame += DrawContext.dwHostPrimitiveCount; - if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) { - // Note : XDK samples reaching this case : DebugKeyboard, Gamepad, Tiling, ShadowBuffer - // Since we can use pHostVertexStreamZeroData here, we can close the line simpler than - // via CxbxDrawIndexedClosingLine, by drawing two indices via DrawIndexedPrimitiveUP. - // (This is simpler because we use just indices and don't need to copy the vertices.) + if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_LINELOOP) { + // test-case : XDK samples reaching this case : DebugKeyboard, Gamepad, Tiling, ShadowBuffer // Close line-loops using a final single line, drawn from the end to the start vertex : CxbxDrawIndexedClosingLineUP( (INDEX16)0, // LowIndex @@ -7436,38 +7022,112 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext) } } +IDirect3DBaseTexture* CxbxConvertXboxSurfaceToHostTexture(XTL::X_D3DBaseTexture* pBaseTexture) +{ + LOG_INIT; + + IDirect3DTexture* pNewHostTexture = nullptr; +#if 0 // TODO : Complete, debug and activate (and then cleanup GetHostBaseTexture) + D3DFORMAT PCFormat = D3DFMT_A8B8G8R8; // TODO : Derive from pBaseTexture + + IDirect3DSurface* pHostSurface = GetHostSurface(pBaseTexture); // TODO : Extend this with a texture channel number too, if surfaces send to SetTexture can be paletized format? + + DWORD dwWidth = GetPixelContainerWidth(pBaseTexture); + DWORD dwHeight = GetPixelContainerHeight(pBaseTexture); + UINT dwMipMapLevels = CxbxGetPixelContainerMipMapLevels(pBaseTexture); + + HRESULT hRet = g_pD3DDevice->CreateTexture(dwWidth, dwHeight, dwMipMapLevels, + /*Usage=*/0, PCFormat, D3DPOOL_SYSTEMMEM, &pNewHostTexture, nullptr); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateTexture (in CxbxConvertXboxSurfaceToHostTexture)"); + if (hRet != D3D_OK) { + CxbxKrnlCleanup("CreateTexture Failed!\n\nError: \nDesc: "/*, + DXGetErrorString(hRet), DXGetErrorDescription(hRet)*/); + } + + IDirect3DSurface* pHostTextureSurface = nullptr; + hRet = pNewHostTexture->GetSurfaceLevel(/*Level=*/0, &pHostTextureSurface); + DEBUG_D3DRESULT(hRet, "pHostBaseTexture->GetSurfaceLevel"); + + if (hRet == D3D_OK) { + hRet = D3DXLoadSurfaceFromSurface(pHostTextureSurface, nullptr, nullptr, pHostSurface, nullptr, nullptr, D3DX_FILTER_NONE, 0x00000000); + DEBUG_D3DRESULT(hRet, "D3DXLoadSurfaceFromSurface"); + pHostTextureSurface->Release(); + } +#endif + return (IDirect3DBaseTexture*)pNewHostTexture; // return it as a base texture +} + void EmuUpdateActiveTextureStages() { LOG_INIT; - for (int i = 0; i < TEXTURE_STAGES; i++) + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { - XTL::X_D3DBaseTexture *pBaseTexture = XTL::EmuD3DActiveTexture[i]; - if (pBaseTexture == nullptr) { - HRESULT hRet = g_pD3DDevice->SetTexture(i, NULL); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTexture"); - continue; + XTL::X_D3DBaseTexture *pBaseTexture = g_pXbox_SetTexture[i]; + IDirect3DBaseTexture *pHostBaseTexture = nullptr; + bool bNeedRelease = false; + + if (pBaseTexture != xbnullptr) { + DWORD Type = GetXboxCommonResourceType(pBaseTexture); + switch (Type) { + case X_D3DCOMMON_TYPE_TEXTURE: + pHostBaseTexture = GetHostBaseTexture(pBaseTexture, /*D3DUsage=*/0, i); + break; + case X_D3DCOMMON_TYPE_SURFACE: + // Surfaces can be set in the texture stages, instead of textures + LOG_TEST_CASE("ActiveTexture set to a surface (non-texture) resource"); // Test cases : Burnout, Outrun 2006 + // We must wrap the surface before using it as a texture + pHostBaseTexture = CxbxConvertXboxSurfaceToHostTexture(pBaseTexture); + // Release this texture (after SetTexture) when we succeeded in creating it : + bNeedRelease = pHostBaseTexture != nullptr; + break; + default: + LOG_TEST_CASE("ActiveTexture set to an unhandled resource type!"); + break; + } } - XTL::IDirect3DTexture *pHostTexture = GetHostTexture(pBaseTexture, i); - - if (pHostTexture != nullptr) { - HRESULT hRet = g_pD3DDevice->SetTexture(i, pHostTexture); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTexture"); + HRESULT hRet = g_pD3DDevice->SetTexture(i, pHostBaseTexture); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTexture"); + if (bNeedRelease) { + pHostBaseTexture->Release(); } } } -void XTL::CxbxUpdateNativeD3DResources() +void CxbxUpdateNativeD3DResources() { - EmuUpdateActiveTextureStages(); + // Before we start, make sure our resource cache stays limited in size + PrunePaletizedTexturesCache(); // TODO : Could we move this to Swap instead? - // If Pixel Shaders are not disabled, process them - if (!g_DisablePixelShaders) { - XTL::DxbxUpdateActivePixelShader(); + EmuUpdateActiveTextureStages(); + + // Some titles set Vertex Shader constants directly via pushbuffers rather than through D3D + // We handle that case by updating any constants that have the dirty flag set on the nv2a. + auto nv2a = g_NV2A->GetDeviceState(); + for(int i = 0; i < X_D3DVS_CONSTREG_COUNT; i++) { + // Skip vOffset and vScale constants, we don't want our values to be overwritten by accident + if (i == X_D3DSCM_RESERVED_CONSTANT_OFFSET_CORRECTED || i == X_D3DSCM_RESERVED_CONSTANT_SCALE_CORRECTED) { + continue; + } + + if (nv2a->pgraph.vsh_constants_dirty[i]) { + g_pD3DDevice->SetVertexShaderConstantF(i, (float*)&nv2a->pgraph.vsh_constants[i][0], 1); + nv2a->pgraph.vsh_constants_dirty[i] = false; + } } - XTL::EmuUpdateDeferredStates(); + // NOTE: Order is important here + // Some Texture States depend on RenderState values (Point Sprites) + // And some Pixel Shaders depend on Texture State values (BumpEnvMat, etc) + XboxRenderStates.Apply(); + XboxTextureStates.Apply(); + + // If Pixel Shaders are not disabled, process them + if (!g_DisablePixelShaders) { + DxbxUpdateActivePixelShader(); + } + /* TODO : Port these : DxbxUpdateActiveVertexShader(); DxbxUpdateActiveTextures(); @@ -7477,43 +7137,176 @@ void XTL::CxbxUpdateNativeD3DResources() */ } +// This function should be called in thight idle-wait loops. +// It's purpose is to lower CPU cost in such a way that the +// caller will still repond quickly, without actually waiting +// or giving up it's time-slice. +// See https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-yieldprocessor +// and https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-pause-intrinsic +inline void CxbxCPUIdleWait() // TODO : Apply wherever applicable +{ + YieldProcessor(); +} + +// This function indicates whether Cxbx can flush host GPU commands. +bool CxbxCanFlushHostGPU() +{ + return (g_pHostQueryWaitForIdle != nullptr); +} + +// Wait until host GPU finished processing it's command queue +bool CxbxFlushHostGPU() +{ + // The following can only work when host GPU queries are available + if (!CxbxCanFlushHostGPU()) { + // If we can't query host GPU, return failure + return false; + } + + // See https://docs.microsoft.com/en-us/windows/win32/direct3d9/queries + // Add an end marker to the command buffer queue. + // This, so that the next GetData will always have at least one + // final query event to flush out, after which GPU will be done. + g_pHostQueryWaitForIdle->Issue(D3DISSUE_END); + + // Empty the command buffer and wait until host GPU is idle. + while (S_FALSE == g_pHostQueryWaitForIdle->GetData(nullptr, 0, D3DGETDATA_FLUSH)) + CxbxCPUIdleWait(); + + // Signal caller that host GPU has been flushed + return true; +} + +// This function mimicks NV2A software callback events. +// Normally, these would be handled by actual push-buffer +// command handling at the point where they where inserted. +// Since our HLE mostly circumvents the NV2A pushbuffer, +// this function has to be called after 'pushing' functions. +void CxbxHandleXboxCallbacks() +{ + // The following can only work when host GPU queries are available + if (g_pHostQueryCallbackEvent != nullptr) { + // Query whether host GPU encountered a callback event already + if (S_FALSE == g_pHostQueryCallbackEvent->GetData(nullptr, 0, 0)) { + // If not, don't handle callbacks + return; + } + } + + // Process inserted callbacks + while (!g_Xbox_CallbackQueue.empty()) { + // Fetch a callback from the FIFO callback queue + s_Xbox_Callback XboxCallback = g_Xbox_CallbackQueue.front(); + g_Xbox_CallbackQueue.pop(); + + // Differentiate between write and read callbacks + if (XboxCallback.Type == XTL::X_D3DCALLBACK_WRITE) { + // Write callbacks should wait until GPU is idle + if (!CxbxFlushHostGPU()) { + // Host GPU can't be flushed. In the old behaviour, we made the callback anyway + // TODO : Should we keep doing that? + } + } else { + assert(XboxCallback.Type == XTL::X_D3DCALLBACK_READ); + // Should we mimick Read callback old behaviour? + if (g_bHack_DisableHostGPUQueries) { + // Note : Previously, we only processed Write, and ignored Read callbacks + continue; + } else { + // New behaviour does place Read callbacks too + } + } + + // Make the callback + XboxCallback.pCallback(XboxCallback.Context); + } +} + +// On Xbox, this function inserts push-buffer commands that +// will trigger the software handler to perform the callback +// when the GPU processes these commands. +// The type X_D3DCALLBACK_WRITE callbacks are prefixed with an +// wait-for-idle command, but otherwise they're identical. +// (Software handlers are triggered on NV2A via NV097_NO_OPERATION) +void CxbxImpl_InsertCallback +( + XTL::X_D3DCALLBACKTYPE Type, + XTL::X_D3DCALLBACK pCallback, + XTL::DWORD Context +) +{ + if (Type > XTL::X_D3DCALLBACK_WRITE) { + LOG_TEST_CASE("Illegal callback type!"); + return; + } + + if (pCallback == xbnullptr) { + LOG_TEST_CASE("pCallback == xbnullptr!"); + return; + } + + // Should we mimick old behaviour? + if (g_bHack_DisableHostGPUQueries) { + // Mimick old behaviour, in which only the final callback event + // was remembered, by emptying the callback queue entirely : + while (!g_Xbox_CallbackQueue.empty()) { + g_Xbox_CallbackQueue.pop(); + } + } + + // Push this callback's arguments into the callback queue : + s_Xbox_Callback XboxCallback = { pCallback, Type, Context }; + g_Xbox_CallbackQueue.push(XboxCallback); // g_Xbox_CallbackQueue.emplace(pCallback, Type, Context); doesn't compile? + + // Does host supports GPU queries? + if (g_pHostQueryCallbackEvent != nullptr) { + // Insert a callback event on host GPU, + // which will be handled by CxbxHandleXboxCallback + g_pHostQueryCallbackEvent->Issue(D3DISSUE_END); + } +} + VOID __declspec(noinline) D3DDevice_SetPixelShaderCommon(DWORD Handle) { - // Update the global pixel shader and Render States - // TODO: Remove all of this as soon as RenderState functions are all unpatched! - // At that point, SetPixelShader could be FULLY unpatched - g_D3DActivePixelShader = (XTL::X_PixelShader*)Handle; + // Cache the active shader handle + g_pXbox_PixelShader = (XTL::X_PixelShader*)Handle; - // Copy the Pixel Shader data to the TemporaryPixelShaderRenderStates array - // This mirrors the fact that unpathed SetPixelShader does the same thing! - if (g_D3DActivePixelShader != nullptr) { - memcpy(&(XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSALPHAINPUTS0]), g_D3DActivePixelShader->pPSDef, sizeof(XTL::X_D3DPIXELSHADERDEF) - 3 * sizeof(DWORD)); - XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES] = g_D3DActivePixelShader->pPSDef->PSTextureModes; - } + // Copy the Pixel Shader data to our RenderState handler + // This mirrors the fact that unpatched SetPixelShader does the same thing! + // This shouldn't be necessary anymore, but shaders still break if we don't do this + if (g_pXbox_PixelShader != nullptr) { + memcpy(XboxRenderStates.GetPixelShaderRenderStatePointer(), g_pXbox_PixelShader->pPSDef, sizeof(XTL::X_D3DPIXELSHADERDEF) - 3 * sizeof(DWORD)); + XboxRenderStates.SetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES, g_pXbox_PixelShader->pPSDef->PSTextureModes); + } } // LTCG specific D3DDevice_SetPixelShader function... // This uses a custom calling convention where parameter is passed in EAX -// TODO: XB_trampoline plus Log function is not working due lost parameter in EAX. // Test-case: Metal Wolf Chaos -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShader_0) +// Test-case: Lord of the Rings: The Third Age +VOID WINAPI D3DDevice_SetPixelShader_0_IMPL ( + DWORD Handle ) { - FUNC_EXPORTS; + LOG_FUNC_ONE_ARG(Handle); - DWORD Handle; - __asm mov Handle, eax; + // Call the Xbox function to make sure D3D structures get set + __asm { + mov eax, Handle + call XB_TRMP(D3DDevice_SetPixelShader_0) + } - //LOG_FUNC_ONE_ARG(Handle); + D3DDevice_SetPixelShaderCommon(Handle); +} - DbgPrintf("D3DDevice_SetPixelShader_0(Handle : %d);\n", Handle); - - // Call the Xbox function to make sure D3D structures get set - //XB_trampoline(VOID, WINAPI, D3DDevice_SetPixelShader_0, ()); - //XB_D3DDevice_SetPixelShader_0(); - - D3DDevice_SetPixelShaderCommon(Handle); +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShader_0)() +{ + __asm { + push eax + call D3DDevice_SetPixelShader_0_IMPL + ret + } } // ****************************************************************** @@ -7524,16 +7317,35 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShader) DWORD Handle ) { - FUNC_EXPORTS LOG_FUNC_ONE_ARG(Handle); // Call the Xbox function to make sure D3D structures get set - XB_trampoline(VOID, WINAPI, D3DDevice_SetPixelShader, (DWORD)); - XB_D3DDevice_SetPixelShader(Handle); + XB_TRMP(D3DDevice_SetPixelShader)(Handle); D3DDevice_SetPixelShaderCommon(Handle); } +// ****************************************************************** +// * patch: D3DDevice_DrawVertices_4 +// LTCG specific D3DDevice_DrawVertices function... +// This uses a custom calling convention where parameter is passed in ECX, EAX and Stack +// Test Case: Conker +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices_4) +( + X_D3DPRIMITIVETYPE PrimitiveType +) +{ + UINT VertexCount; + UINT StartVertex; + + _asm { + mov VertexCount, eax + mov StartVertex, ecx + } + + EMUPATCH(D3DDevice_DrawVertices)(PrimitiveType, StartVertex, VertexCount); +} // ****************************************************************** // * patch: D3DDevice_DrawVertices @@ -7545,8 +7357,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices) UINT VertexCount ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(PrimitiveType) LOG_FUNC_ARG(StartVertex) @@ -7555,7 +7365,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices) // Dxbx Note : In DrawVertices and DrawIndexedVertices, PrimitiveType may not be D3DPT_POLYGON - if (!EmuD3DValidVertexCount(PrimitiveType, VertexCount)) { + if (!IsValidXboxVertexCount(PrimitiveType, VertexCount)) { LOG_TEST_CASE("Invalid VertexCount"); return; } @@ -7569,38 +7379,64 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices) DrawContext.XboxPrimitiveType = PrimitiveType; DrawContext.dwVertexCount = VertexCount; DrawContext.dwStartVertex = StartVertex; - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; - CxbxVertexBufferConverter VertexBufferConverter = {}; + VertexBufferConverter.Apply(&DrawContext); if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) { - // LOG_TEST_CASE("X_D3DPT_QUADLIST"); // ?X-Marbles and XDK Sample (Cartoon, ?maybe PlayField?) hits this case - if (StartVertex > 0) { - LOG_TEST_CASE("X_D3DPT_QUADLIST StartVertex > 0"); + if (StartVertex == 0) { + //LOG_TEST_CASE("X_D3DPT_QUADLIST (StartVertex == 0)"); // disabled, hit too often + // test-case : ?X-Marbles + // test-case XDK Samples : AlphaFog, AntiAlias, BackBufferScale, BeginPush, Cartoon, TrueTypeFont (?maybe PlayField?) + } else { + LOG_TEST_CASE("X_D3DPT_QUADLIST (StartVertex > 0)"); + // https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/1156 + // test-case : All - Star Baseball '03 + // test-case : Army Men Major Malfunction + // test-case : Big Mutha Truckers // test-case : BLiNX: the time sweeper + // test-case : Blood Wake + // test-case : Call of Duty: Finest Hour + // test-case : Flight academy + // test-case : FIFA World Cup 2002 + // test-case : GENMA ONIMUSHA // test-case : Halo - Combat Evolved + // test-case : Harry Potter and the Sorcerer's Stone + // test-case : Heroes of the Pacific + // test-case : Hummer Badlands + // test-case : Knights Of The Temple 2 + // test-case : LakeMasters Bass fishing + // test-case : MetalDungeon + // test-case : NFL Fever 2003 Demo - main menu + // test-case : Night Caster 2 + // test-case : Pinball Hall of Fame + // test-case : Robotech : Battlecry + // test-case : SpiderMan 2 + // test-case : Splinter Cell Demo + // test-case : Stubbs the Zombie + // test-case : Tony Hawk's Pro Skater 2X (main menu entries) // test-case : Worms 3D Special Edition - // test-case : XDK sample Lensflare - DrawContext.dwStartVertex = StartVertex; // Breakpoint location for testing. + // test-case : XDK sample Lensflare (4, for 10 flare-out quads that use a linear texture; rendered incorrectly: https://youtu.be/idwlxHl9nAA?t=439) + DrawContext.dwStartVertex = StartVertex; // Breakpoint location for testing. } // Draw quadlists using a single 'quad-to-triangle mapping' index buffer : // Assure & activate that special index buffer : - CxbxAssureQuadListD3DIndexBuffer(/*NrOfQuadVertices=*/DrawContext.dwVertexCount); - // Convert quad vertex-count & start to triangle vertex count & start : - UINT startIndex = QuadToTriangleVertexCount(DrawContext.dwStartVertex); + CxbxAssureQuadListD3DIndexBuffer(/*NrOfQuadIndices=*/DrawContext.dwVertexCount); + // This API's StartVertex argument is multiplied by vertex stride and added to the start of the vertex buffer; + // BaseVertexIndex offers the same functionality on host : + UINT BaseVertexIndex = DrawContext.dwStartVertex; + // Convert quad vertex count to triangle vertex count : + UINT NumVertices = QuadToTriangleVertexCount(DrawContext.dwVertexCount); + // Convert quad primitive count to triangle primitive count : UINT primCount = DrawContext.dwHostPrimitiveCount * TRIANGLES_PER_QUAD; - // Determine highest and lowest index in use : - INDEX16 LowIndex = pQuadToTriangleIndexBuffer[startIndex]; - INDEX16 HighIndex = LowIndex + (INDEX16)DrawContext.dwVertexCount - 1; - // Emulate a quad by drawing each as a fan of 2 triangles + // See https://docs.microsoft.com/en-us/windows/win32/direct3d9/rendering-from-vertex-and-index-buffers + // for an explanation on the function of the BaseVertexIndex, MinVertexIndex, NumVertices and StartIndex arguments. + // Emulate drawing quads by drawing each quad with two indexed triangles : HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive( - D3DPT_TRIANGLELIST, // Draw indexed triangles instead of quads -#ifdef CXBX_USE_D3D9 - 0, // BaseVertexIndex -#endif - LowIndex, // minIndex - (HighIndex - LowIndex) + 1, // NumVertices, - startIndex, + /*PrimitiveType=*/D3DPT_TRIANGLELIST, + BaseVertexIndex, + /*MinVertexIndex=*/0, + NumVertices, + /*startIndex=*/0, primCount ); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive(X_D3DPT_QUADLIST)"); @@ -7620,6 +7456,8 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices) if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) { // Close line-loops using a final single line, drawn from the end to the start vertex LOG_TEST_CASE("X_D3DPT_LINELOOP"); // TODO : Text-cases needed + + assert(DrawContext.dwBaseVertexIndex == 0); // if this fails, it needs to be added to LowIndex and HighIndex : INDEX16 LowIndex = (INDEX16)DrawContext.dwStartVertex; INDEX16 HighIndex = (INDEX16)(DrawContext.dwStartVertex + DrawContext.dwHostPrimitiveCount); // Draw the closing line using a helper function (which will SetIndices) @@ -7629,13 +7467,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices) } } - // Execute callback procedure - if (g_CallbackType == X_D3DCALLBACK_WRITE) { - if (g_pCallback) { - g_pCallback(g_CallbackParam); - // TODO: Reset pointer? - } - } + CxbxHandleXboxCallbacks(); } // ****************************************************************** @@ -7649,8 +7481,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVerticesUP) UINT VertexStreamZeroStride ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(PrimitiveType) LOG_FUNC_ARG(VertexCount) @@ -7658,7 +7488,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVerticesUP) LOG_FUNC_ARG(VertexStreamZeroStride) LOG_FUNC_END; - if (!EmuD3DValidVertexCount(PrimitiveType, VertexCount)) { + if (!IsValidXboxVertexCount(PrimitiveType, VertexCount)) { LOG_TEST_CASE("Invalid VertexCount"); return; } @@ -7674,18 +7504,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVerticesUP) DrawContext.dwVertexCount = VertexCount; DrawContext.pXboxVertexStreamZeroData = pVertexStreamZeroData; DrawContext.uiXboxVertexStreamZeroStride = VertexStreamZeroStride; - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; CxbxDrawPrimitiveUP(DrawContext); } - // Execute callback procedure - if (g_CallbackType == X_D3DCALLBACK_WRITE) { - if (g_pCallback) { - g_pCallback(g_CallbackParam); - // TODO: Reset pointer? - } - } + CxbxHandleXboxCallbacks(); } // ****************************************************************** @@ -7698,8 +7521,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawIndexedVertices) CONST PWORD pIndexData ) { - FUNC_EXPORTS - // Test-cases : XDK samples (Cartoon, Gamepad) // Note : In gamepad.xbe, the gamepad is drawn by D3DDevice_DrawIndexedVertices // Dxbx Note : In DrawVertices and DrawIndexedVertices, PrimitiveType may not be D3DPT_POLYGON @@ -7710,40 +7531,29 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawIndexedVertices) LOG_FUNC_ARG(pIndexData) LOG_FUNC_END; - if (!EmuD3DValidVertexCount(PrimitiveType, VertexCount)) { + if (!IsValidXboxVertexCount(PrimitiveType, VertexCount)) { LOG_TEST_CASE("Invalid VertexCount"); return; } - // TODO : Call unpatched D3DDevice_SetStateVB(0); + // TODO : Call unpatched D3DDevice_SetStateVB(g_Xbox_BaseVertexIndex); CxbxUpdateNativeD3DResources(); if (IsValidCurrentShader()) { - CxbxUpdateActiveIndexBuffer(pIndexData, VertexCount); - CxbxDrawContext DrawContext = {}; DrawContext.XboxPrimitiveType = PrimitiveType; DrawContext.dwVertexCount = VertexCount; - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; - DrawContext.dwIndexBase = g_XboxBaseVertexIndex; // Used by GetVerticesInBuffer - DrawContext.pIndexData = pIndexData; // Used by GetVerticesInBuffer + DrawContext.dwBaseVertexIndex = g_Xbox_BaseVertexIndex; // Multiplied by vertex stride and added to the vertex buffer start + DrawContext.pXboxIndexData = pIndexData; // Used to derive VerticesInBuffer // Test case JSRF draws all geometry through this function (only sparks are drawn via another method) // using X_D3DPT_TRIANGLELIST and X_D3DPT_TRIANGLESTRIP PrimitiveType CxbxDrawIndexed(DrawContext); } - // Execute callback procedure - if (g_CallbackType == X_D3DCALLBACK_WRITE) { - if (g_pCallback) { - g_pCallback(g_CallbackParam); - // TODO: Reset pointer? - } - } - -//#endif + CxbxHandleXboxCallbacks(); } // ****************************************************************** @@ -7758,8 +7568,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawIndexedVerticesUP) UINT VertexStreamZeroStride ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(PrimitiveType) LOG_FUNC_ARG(VertexCount) @@ -7768,7 +7576,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawIndexedVerticesUP) LOG_FUNC_ARG(VertexStreamZeroStride) LOG_FUNC_END; - if (!EmuD3DValidVertexCount(PrimitiveType, VertexCount)) { + if (!IsValidXboxVertexCount(PrimitiveType, VertexCount)) { LOG_TEST_CASE("Invalid VertexCount"); return; } @@ -7779,120 +7587,77 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawIndexedVerticesUP) if (IsValidCurrentShader()) { CxbxDrawContext DrawContext = {}; + INDEX16* pXboxIndexData = (INDEX16*)pIndexData; DrawContext.XboxPrimitiveType = PrimitiveType; - DrawContext.dwVertexCount = VertexCount; + DrawContext.dwVertexCount = VertexCount; + DrawContext.pXboxIndexData = pXboxIndexData; // Used to derive VerticesInBuffer + // Note : D3DDevice_DrawIndexedVerticesUP does NOT use g_Xbox_BaseVertexIndex, so keep DrawContext.dwBaseVertexIndex at 0! DrawContext.pXboxVertexStreamZeroData = pVertexStreamZeroData; DrawContext.uiXboxVertexStreamZeroStride = VertexStreamZeroStride; - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; - // Don't set DrawContext.pIndexData = (INDEX16*)pIndexData; // Used by GetVerticesInBuffer - CxbxVertexBufferConverter VertexBufferConverter = {}; + // Determine LowIndex and HighIndex *before* VerticesInBuffer gets derived + WalkIndexBuffer(DrawContext.LowIndex, DrawContext.HighIndex, pXboxIndexData, VertexCount); + VertexBufferConverter.Apply(&DrawContext); - if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) { - // Indexed quadlist can be drawn using unpatched indexes via multiple draws of 2 'strip' triangles : - // Those 4 vertices are just enough for two triangles (a fan starts with 3 vertices for 1 triangle, - // and adds 1 triangle via 1 additional vertex) - // This is slower (because of call-overhead) but doesn't require any index buffer patching - // Draw 1 quad as a 2 triangles in a fan (which both have the same winding order) : - // LOG_TEST_CASE("X_D3DPT_QUADLIST"); // Test-case : Buffy: The Vampire Slayer, FastLoad XDK Sample - INDEX16* pWalkIndexData = (INDEX16*)pIndexData; - int iNumVertices = (int)VertexCount; - while (iNumVertices >= VERTICES_PER_QUAD) { - // Determine highest and lowest index in use : - INDEX16 LowIndex; - INDEX16 HighIndex; - WalkIndexBuffer(LowIndex, HighIndex, pWalkIndexData, VERTICES_PER_QUAD); - // Emulate a quad by drawing each as a fan of 2 triangles - HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP( - D3DPT_TRIANGLEFAN, // Draw a triangle-fan instead of a quad - LowIndex, // MinVertexIndex - (HighIndex - LowIndex) + 1, // NumVertexIndices - TRIANGLES_PER_QUAD, // primCount = Draw 2 triangles - pWalkIndexData, - D3DFMT_INDEX16, // IndexDataFormat - DrawContext.pHostVertexStreamZeroData, - DrawContext.uiHostVertexStreamZeroStride - ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitiveUP(X_D3DPT_QUADLIST)"); + INDEX16* pHostIndexData; + UINT PrimitiveCount = DrawContext.dwHostPrimitiveCount; - pWalkIndexData += VERTICES_PER_QUAD; - iNumVertices -= VERTICES_PER_QUAD; + bool bConvertQuadListToTriangleList = (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST); + if (bConvertQuadListToTriangleList) { + LOG_TEST_CASE("X_D3DPT_QUADLIST"); + // Test-case : Buffy: The Vampire Slayer + // Test-case : XDK samples : FastLoad, BackBufferScale, DisplacementMap, Donuts3D, VolumeLight, PersistDisplay, PolynomialTextureMaps, SwapCallback, Tiling, VolumeFog, DebugKeyboard, Gamepad + // Convert draw arguments from quads to triangles : + pHostIndexData = CxbxCreateQuadListToTriangleListIndexData(pXboxIndexData, VertexCount); + PrimitiveCount *= TRIANGLES_PER_QUAD; + // Note, that LowIndex and HighIndex won't change due to this quad-to-triangle conversion, + // so it's less work to WalkIndexBuffer over the input instead of the converted index buffer. + } else { + // LOG_TEST_CASE("DrawIndexedPrimitiveUP"); // Test-case : Burnout, Namco Museum 50th Anniversary + pHostIndexData = pXboxIndexData; + } + + HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP( + /*PrimitiveType=*/EmuXB2PC_D3DPrimitiveType(DrawContext.XboxPrimitiveType), + /*MinVertexIndex=*/DrawContext.LowIndex, + /*NumVertexIndices=*/(DrawContext.HighIndex - DrawContext.LowIndex) + 1, + PrimitiveCount, + pHostIndexData, + /*IndexDataFormat=*/D3DFMT_INDEX16, + DrawContext.pHostVertexStreamZeroData, + DrawContext.uiHostVertexStreamZeroStride + ); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitiveUP"); + + if (bConvertQuadListToTriangleList) { + CxbxReleaseQuadListToTriangleListIndexData(pHostIndexData); + } + + g_dwPrimPerFrame += PrimitiveCount; + if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) { + // Close line-loops using a final single line, drawn from the end to the start vertex + LOG_TEST_CASE("X_D3DPT_LINELOOP"); // TODO : Which titles reach this test-case? + // Read the end and start index from the supplied index data + INDEX16 LowIndex = pXboxIndexData[0]; + INDEX16 HighIndex = pXboxIndexData[DrawContext.dwHostPrimitiveCount]; + // If needed, swap so highest index is higher than lowest (duh) + if (HighIndex < LowIndex) { + std::swap(HighIndex, LowIndex); } - g_dwPrimPerFrame += VertexCount / VERTICES_PER_QUAD * TRIANGLES_PER_QUAD; - } - else { - // Walk through the index buffer - INDEX16 LowIndex, HighIndex; - WalkIndexBuffer(LowIndex, HighIndex, (INDEX16*)pIndexData, DrawContext.dwVertexCount); - - // LOG_TEST_CASE("DrawIndexedPrimitiveUP"); // Test-case : Burnout, Namco Museum 50th Anniversary - HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP( - EmuXB2PC_D3DPrimitiveType(DrawContext.XboxPrimitiveType), - LowIndex, // MinVertexIndex - (HighIndex - LowIndex) + 1, //this shall be Vertex Spans DrawContext.dwVertexCount, // NumVertexIndices - DrawContext.dwHostPrimitiveCount, - pIndexData, - D3DFMT_INDEX16, // IndexDataFormat + // Close line-loops using a final single line, drawn from the end to the start vertex : + CxbxDrawIndexedClosingLineUP( + LowIndex, + HighIndex, DrawContext.pHostVertexStreamZeroData, DrawContext.uiHostVertexStreamZeroStride ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitiveUP"); - - g_dwPrimPerFrame += DrawContext.dwHostPrimitiveCount; - if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) { - // Close line-loops using a final single line, drawn from the end to the start vertex - LOG_TEST_CASE("X_D3DPT_LINELOOP"); // TODO : Which titles reach this case? - // Read the end and start index from the supplied index data - LowIndex = ((INDEX16*)pIndexData)[0]; - HighIndex = ((INDEX16*)pIndexData)[DrawContext.dwHostPrimitiveCount]; - // If needed, swap so highest index is higher than lowest (duh) - if (HighIndex < LowIndex) { - HighIndex ^= LowIndex; - LowIndex ^= HighIndex; - HighIndex ^= LowIndex; - } - - // Close line-loops using a final single line, drawn from the end to the start vertex : - CxbxDrawIndexedClosingLineUP( - LowIndex, - HighIndex, - DrawContext.pHostVertexStreamZeroData, - DrawContext.uiHostVertexStreamZeroStride - ); - } } } - // Execute callback procedure - if (g_CallbackType == X_D3DCALLBACK_WRITE) { - if (g_pCallback) { - g_pCallback(g_CallbackParam); - // TODO: Reset pointer? - } - } -} - -// ****************************************************************** -// * patch: D3DDevice_GetLight -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetLight) -( - DWORD Index, - X_D3DLIGHT8 *pLight -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Index) - LOG_FUNC_ARG(pLight) - LOG_FUNC_END; - - HRESULT hRet = g_pD3DDevice->GetLight(Index, pLight); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetLight"); + CxbxHandleXboxCallbacks(); } // ****************************************************************** @@ -7904,13 +7669,13 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetLight) CONST X_D3DLIGHT8 *pLight ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Index) LOG_FUNC_ARG(pLight) LOG_FUNC_END; + XB_TRMP(D3DDevice_SetLight)(Index, pLight); + HRESULT hRet = g_pD3DDevice->SetLight(Index, pLight); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetLight"); @@ -7925,8 +7690,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetMaterial) CONST X_D3DMATERIAL8 *pMaterial ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pMaterial); HRESULT hRet = g_pD3DDevice->SetMaterial(pMaterial); @@ -7942,109 +7705,19 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_LightEnable) BOOL bEnable ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Index) LOG_FUNC_ARG(bEnable) LOG_FUNC_END; + XB_TRMP(D3DDevice_LightEnable)(Index, bEnable); + HRESULT hRet = g_pD3DDevice->LightEnable(Index, bEnable); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->LightEnable"); return hRet; } -// NOTE: NOT A PATCH -// This is the code common to both GetCubeMapSurface/GetCubeMapSurface2 -HRESULT D3DCubeTexture_GetCubeMapSurfaceCommon -( - XTL::X_D3DCubeTexture* pThis, - XTL::D3DCUBEMAP_FACES FaceType, - XTL::UINT Level, - XTL::X_D3DSurface** ppCubeMapSurface -) -{ - // Now ppCubeMapSurface correctly points to an Xbox surface, while pThis points to an Xbox Cube Texture - // We can use this to tie the host resources for both together, allowing Cube Mapping actually work! - auto pHostCubeTexture = (XTL::IDirect3DCubeTexture*)GetHostResource(pThis, XTL::EmuXBFormatIsRenderTarget(GetXboxPixelContainerFormat(pThis)) ? D3DUSAGE_RENDERTARGET : 0); - XTL::IDirect3DSurface* pHostCubeMapSurface; - XTL::HRESULT hRet = pHostCubeTexture->GetCubeMapSurface(FaceType, Level, &pHostCubeMapSurface); - if (FAILED(hRet)) { - return hRet; - } - - // Tie the Xbox CubeMapSurface and the host CubeMapSurface together - SetHostSurface(*ppCubeMapSurface, pHostCubeMapSurface); - - return hRet; -} - -// ****************************************************************** -// * patch: IDirect3DCubeTexture8_GetCubeMapSurface -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(D3DCubeTexture_GetCubeMapSurface) -( - X_D3DCubeTexture* pThis, - D3DCUBEMAP_FACES FaceType, - UINT Level, - X_D3DSurface** ppCubeMapSurface -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(FaceType) - LOG_FUNC_ARG(Level) - LOG_FUNC_ARG(ppCubeMapSurface) - LOG_FUNC_END; - - // First, we need to fetch the Xbox cubemap surface via a trampoline - HRESULT hRet; - XB_trampoline(HRESULT, WINAPI, D3DCubeTexture_GetCubeMapSurface, (X_D3DCubeTexture*, D3DCUBEMAP_FACES, UINT, X_D3DSurface**)); - hRet = XB_D3DCubeTexture_GetCubeMapSurface(pThis, FaceType, Level, ppCubeMapSurface); - - // If the Xbox call failed, we must fail too - if (FAILED(hRet)) { - RETURN(hRet); - } - - hRet = D3DCubeTexture_GetCubeMapSurfaceCommon(pThis, FaceType, Level, ppCubeMapSurface); - RETURN(hRet); -} - -// ****************************************************************** -// * patch: IDirect3DCubeTexture8_GetCubeMapSurface2 -// ****************************************************************** -XTL::X_D3DSurface* WINAPI XTL::EMUPATCH(D3DCubeTexture_GetCubeMapSurface2) -( - X_D3DCubeTexture* pThis, - D3DCUBEMAP_FACES FaceType, - UINT Level -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(FaceType) - LOG_FUNC_ARG(Level) - LOG_FUNC_END; - - // First, we need to fetch the Xbox cubemap surface via a trampoline - XB_trampoline(X_D3DSurface*, WINAPI, D3DCubeTexture_GetCubeMapSurface2, (X_D3DCubeTexture*, D3DCUBEMAP_FACES, UINT)); - X_D3DSurface* pCubeMapSurface = XB_D3DCubeTexture_GetCubeMapSurface2(pThis, FaceType, Level); - - // If the Xbox call failed, we must fail too - if (pCubeMapSurface == nullptr) { - RETURN(NULL); - } - - D3DCubeTexture_GetCubeMapSurfaceCommon(pThis, FaceType, Level, &pCubeMapSurface); - return pCubeMapSurface; -} - // ****************************************************************** // * patch: D3DDevice_SetRenderTarget // ****************************************************************** @@ -8054,8 +7727,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderTarget) X_D3DSurface *pNewZStencil ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pRenderTarget) LOG_FUNC_ARG(pNewZStencil) @@ -8064,52 +7735,41 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderTarget) IDirect3DSurface *pHostRenderTarget = nullptr; IDirect3DSurface *pHostDepthStencil = nullptr; - XB_trampoline(void, WINAPI, D3DDevice_SetRenderTarget, (X_D3DSurface*, X_D3DSurface*)); - XB_D3DDevice_SetRenderTarget(pRenderTarget, pNewZStencil); + XB_TRMP(D3DDevice_SetRenderTarget)(pRenderTarget, pNewZStencil); // In Xbox titles, CreateDevice calls SetRenderTarget for the back buffer // We can use this to determine the Xbox backbuffer surface for later use! - if (g_XboxBackBufferSurface == xbnullptr) { - g_XboxBackBufferSurface = pRenderTarget; + if (g_pXbox_BackBufferSurface == xbnullptr) { + g_pXbox_BackBufferSurface = pRenderTarget; // TODO : Some titles might render to another backbuffer later on, // if that happens, we might need to skip the first one or two calls? } + if (g_pXbox_DefaultDepthStencilSurface == xbnullptr) { + g_pXbox_DefaultDepthStencilSurface = pNewZStencil; + } + // The current render target is only replaced if it's passed in here non-null if (pRenderTarget != xbnullptr) { - g_pXboxRenderTarget = pRenderTarget; + g_pXbox_RenderTarget = pRenderTarget; } else { // If non is given, use the current Xbox render target - pRenderTarget = g_pXboxRenderTarget; + pRenderTarget = g_pXbox_RenderTarget; // If there's no Xbox render target yet, fallback to the Xbox back buffer if (pRenderTarget == xbnullptr) { LOG_TEST_CASE("SetRenderTarget fallback to backbuffer"); - pRenderTarget = g_XboxBackBufferSurface; + pRenderTarget = g_pXbox_BackBufferSurface; } } pHostRenderTarget = GetHostSurface(pRenderTarget, D3DUSAGE_RENDERTARGET); // The currenct depth stencil is always replaced by whats passed in here (even a null) - g_pXboxDepthStencil = pNewZStencil; - pHostDepthStencil = GetHostSurface(g_pXboxDepthStencil, D3DUSAGE_DEPTHSTENCIL); - - if (g_DirectHostBackBufferAccess && pRenderTarget == g_XboxBackBufferSurface) { - HRESULT hRet = g_pD3DDevice->GetBackBuffer( - #ifdef CXBX_USE_D3D9 - 0, // iSwapChain - #endif - 0, D3DBACKBUFFER_TYPE_MONO, &pHostRenderTarget); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetBackBuffer"); - - if (FAILED(hRet)) { - CxbxKrnlCleanup("Could not get host backbuffer"); - } - } + g_pXbox_DepthStencil = pNewZStencil; + pHostDepthStencil = GetHostSurface(g_pXbox_DepthStencil, D3DUSAGE_DEPTHSTENCIL); HRESULT hRet; -#ifdef CXBX_USE_D3D9 // Mimick Direct3D 8 SetRenderTarget by only setting render target if non-null if (pHostRenderTarget) { hRet = g_pD3DDevice->SetRenderTarget(/*RenderTargetIndex=*/0, pHostRenderTarget); @@ -8122,19 +7782,21 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderTarget) hRet = g_pD3DDevice->SetDepthStencilSurface(pHostDepthStencil); DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetDepthStencilSurface"); -#else - hRet = g_pD3DDevice->SetRenderTarget(pHostRenderTarget, pHostDepthStencil); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderTarget"); -#endif - - if (g_DirectHostBackBufferAccess && pRenderTarget == g_XboxBackBufferSurface) { - pHostRenderTarget->Release(); - } if (SUCCEEDED(hRet)) { // Once we're sure the host depth-stencil is activated... UpdateDepthStencilFlags(pHostDepthStencil); } + + // Validate that our host render target is still the correct size + DWORD HostRenderTarget_Width, HostRenderTarget_Height; + if (GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { + DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXbox_RenderTarget); + DWORD XboxRenderTarget_Height = GetPixelContainerHeight(g_pXbox_RenderTarget); + ValidateRenderTargetDimensions(HostRenderTarget_Width, HostRenderTarget_Height, XboxRenderTarget_Width, XboxRenderTarget_Height); + } + + UpdateViewPortOffsetAndScaleConstants(); } // LTCG specific D3DDevice_SetPalette function... @@ -8144,9 +7806,7 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SetPalette_4) ( ) { - FUNC_EXPORTS; - - static uint32 returnAddr; + static uint32_t returnAddr; #ifdef _DEBUG_TRACE __asm add esp, 4 @@ -8171,8 +7831,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPalette) X_D3DPalette *pPalette ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Stage) LOG_FUNC_ARG(pPalette) @@ -8181,76 +7839,15 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPalette) // g_pD3DDevice9->SetPaletteEntries(Stage?, (PALETTEENTRY*)pPalette->Data); // g_pD3DDevice9->SetCurrentTexturePalette(Stage, Stage); - if (Stage < TEXTURE_STAGES) { - if (g_pCurrentPalette[Stage] != GetDataFromXboxResource(pPalette) && XTL::EmuD3DActiveTexture[Stage] != nullptr) { - // If the palette for a texture has changed, we need to re-convert the texture - FreeHostResource(GetHostResourceKey(XTL::EmuD3DActiveTexture[Stage])); - } - - // Cache palette data and size - g_pCurrentPalette[Stage] = GetDataFromXboxResource(pPalette); + if (Stage >= XTL::X_D3DTS_STAGECOUNT) { + LOG_TEST_CASE("Stage out of bounds"); + } else { + // Note : Actual update of paletized textures (X_D3DFMT_P8) happens in EmuUpdateActiveTextureStages! + g_pXbox_Palette_Data[Stage] = GetDataFromXboxResource(pPalette); + g_Xbox_Palette_Size[Stage] = pPalette ? XboxD3DPaletteSizeToBytes(GetXboxPaletteSize(pPalette)) : 0; } } - -// ****************************************************************** -// * patch: IDirect3DPalette8_Lock -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DPalette_Lock) -( - X_D3DPalette *pThis, - D3DCOLOR **ppColors, - DWORD Flags -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG_OUT(ppColors) - LOG_FUNC_ARG(Flags) - LOG_FUNC_END; - - XB_trampoline(VOID, WINAPI, D3DPalette_Lock, (X_D3DPalette*, D3DCOLOR**, DWORD)); - XB_D3DPalette_Lock(pThis, ppColors, Flags); - - // Check if this palette is in use by a texture stage, and force it to be re-converted if yes - for (int i = 0; i < TEXTURE_STAGES; i++) { - if (EmuD3DActiveTexture[i] != nullptr && g_pCurrentPalette[i] == GetDataFromXboxResource(pThis)) { - FreeHostResource(GetHostResourceKey(EmuD3DActiveTexture[i])); - } - } -} - -// ****************************************************************** -// * patch: IDirect3DPalette8_Lock2 -// ****************************************************************** -XTL::D3DCOLOR * WINAPI XTL::EMUPATCH(D3DPalette_Lock2) -( - X_D3DPalette *pThis, - DWORD Flags -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pThis) - LOG_FUNC_ARG(Flags) - LOG_FUNC_END; - - XB_trampoline(XTL::D3DCOLOR*, WINAPI, D3DPalette_Lock2, (X_D3DPalette*, DWORD)); - XTL::D3DCOLOR* pData = XB_D3DPalette_Lock2(pThis, Flags); - - // Check if this palette is in use by a texture stage, and force it to be re-converted if yes - for (int i = 0; i < TEXTURE_STAGES; i++) { - if (EmuD3DActiveTexture[i] != nullptr && g_pCurrentPalette[i] == GetDataFromXboxResource(pThis)) { - FreeHostResource(GetHostResourceKey(EmuD3DActiveTexture[i])); - } - } - - RETURN(pData); -} - // LTCG specific D3DDevice_SetFlickerFilter function... // This uses a custom calling convention where parameter is passed in ESI // Test-case: Metal Wolf Chaos @@ -8258,8 +7855,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_SetFlickerFilter_0) ( ) { - FUNC_EXPORTS; - DWORD Filter; __asm { @@ -8277,8 +7872,6 @@ void WINAPI XTL::EMUPATCH(D3DDevice_SetFlickerFilter) DWORD Filter ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Filter); LOG_IGNORED(); @@ -8292,37 +7885,11 @@ void WINAPI XTL::EMUPATCH(D3DDevice_SetSoftDisplayFilter) BOOL Enable ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Enable); LOG_IGNORED(); } -// ****************************************************************** -// * patch: D3DDevice_GetVertexShaderSize -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderSize) -( - DWORD Handle, - UINT* pSize -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Handle) - LOG_FUNC_ARG(pSize) - LOG_FUNC_END; - - // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) - - if (pSize) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - *pSize = pVertexShader ? pVertexShader->Size : 0; - } -} - // LTCG specific D3DDevice_DeleteVertexShader function... // This uses a custom calling convention where parameter is passed in EAX // UNTESTED - Need test-case! @@ -8330,8 +7897,6 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_DeleteVertexShader_0) ( ) { - FUNC_EXPORTS; - DWORD Handle; __asm { @@ -8347,39 +7912,43 @@ VOID __stdcall XTL::EMUPATCH(D3DDevice_DeleteVertexShader_0) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_DeleteVertexShader) ( - DWORD Handle + DWORD Handle ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Handle); + XB_TRMP(D3DDevice_DeleteVertexShader)(Handle); + // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) // It's reference count is lowered. If it reaches zero (0), the struct is freed. - DWORD HostVertexShaderHandle = 0; + if (VshHandleIsVertexShader(Handle)) + { + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(Handle); + SetCxbxVertexShader(Handle, nullptr); - if(VshHandleIsVertexShader(Handle)) - { - X_D3DVertexShader *pD3DVertexShader = (X_D3DVertexShader *)(Handle & 0x7FFFFFFF); - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); + if (pCxbxVertexShader->pHostVertexDeclaration) { + HRESULT hRet = pCxbxVertexShader->pHostVertexDeclaration->Release(); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DeleteVertexShader(pHostVertexDeclaration)"); + } - HostVertexShaderHandle = pVertexShader->Handle; - g_VMManager.Deallocate((VAddr)pVertexShader->pDeclaration); + // Release the host vertex shader + g_VertexShaderSource.ReleaseShader(pCxbxVertexShader->VertexShaderKey); - if(pVertexShader->pFunction) - { - g_VMManager.Deallocate((VAddr)pVertexShader->pFunction); - } + if (pCxbxVertexShader->pXboxDeclarationCopy) + { + free(pCxbxVertexShader->pXboxDeclarationCopy); + } - FreeVertexDynamicPatch(pVertexShader); + if (pCxbxVertexShader->pXboxFunctionCopy) + { + free(pCxbxVertexShader->pXboxFunctionCopy); + } - g_VMManager.Deallocate((VAddr)pVertexShader); - g_VMManager.Deallocate((VAddr)pD3DVertexShader); - } + FreeVertexDynamicPatch(pCxbxVertexShader); - HRESULT hRet = g_pD3DDevice->DeleteVertexShader(HostVertexShaderHandle); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DeleteVertexShader"); + free(pCxbxVertexShader); + } } // ****************************************************************** @@ -8391,14 +7960,12 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SelectVertexShaderDirect) DWORD Address ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pVAF) LOG_FUNC_ARG(Address) LOG_FUNC_END; - LOG_UNIMPLEMENTED(); + CxbxImpl_SelectVertexShaderDirect(pVAF, Address); } // ****************************************************************** @@ -8409,13 +7976,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetShaderConstantMode) DWORD *pMode ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pMode); if(pMode) { - *pMode = g_VertexShaderConstantMode; + *pMode = g_Xbox_VertexShaderConstantMode; } } @@ -8427,13 +7992,11 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShader) DWORD *pHandle ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pHandle); if(pHandle) { - (*pHandle) = g_CurrentXboxVertexShaderHandle; + (*pHandle) = g_Xbox_VertexShader_Handle; } } @@ -8447,22 +8010,24 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderConstant) DWORD ConstantCount ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Register) LOG_FUNC_ARG(pConstantData) LOG_FUNC_ARG(ConstantCount) LOG_FUNC_END; - HRESULT hRet = g_pD3DDevice->GetVertexShaderConstant + // Xbox vertex shader constants range from -96 to 95 + // The host does not support negative, so we adjust to 0..191 + Register += X_D3DSCM_CORRECTION; + + HRESULT hRet = g_pD3DDevice->GetVertexShaderConstantF ( - Register + 96, - pConstantData, + Register, + (float*)pConstantData, // TODO : Validate this work correctly under D3D9 ConstantCount ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetVertexShaderConstant"); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetVertexShaderConstant"); } // ****************************************************************** @@ -8475,8 +8040,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShaderInputDirect) X_STREAMINPUT *pStreamInputs ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pVAF) LOG_FUNC_ARG(StreamCount) @@ -8500,8 +8063,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderInput) X_STREAMINPUT *pStreamInputs ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pHandle) LOG_FUNC_ARG(pStreamCount) @@ -8523,24 +8084,25 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetVertexShaderInput) X_STREAMINPUT *pStreamInputs ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(StreamCount) LOG_FUNC_ARG(pStreamInputs) LOG_FUNC_END; - // If Handle is NULL, all VertexShader input state is cleared. + // When this API is in effect, VertexBuffers as set by Xbox SetStreamSource are disregarded, + // instead, the pStreamInputs[].VertexBuffer streams are used. + + // If Handle is NULL, all VertexShader input state is cleared (after which the VertexBuffers as set by SetStreamSource are used once again). + // Otherwise, Handle is the address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) + // The given pStreamInputs are stored in a global array, and the NV2A is programmed to read + // each vertex attribute (as defined in the given VertexShader.VertexAttribute.Slots[]) to read + // the attribute data from the pStreamInputs[slot].VertexBuffer + pStreamInputs[slot].Offset + VertexShader.VertexAttribute.Slots[slot].Offset - - LOG_UNIMPLEMENTED(); - - return; + CxbxImpl_SetVertexShaderInput(Handle, StreamCount, pStreamInputs); } - // ****************************************************************** // * patch: D3DDevice_RunVertexStateShader // ****************************************************************** @@ -8550,13 +8112,14 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_RunVertexStateShader) CONST FLOAT *pData ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Address) LOG_FUNC_ARG(pData) LOG_FUNC_END; + // If pData is assigned, pData[0..3] is pushed towards nv2a transform data registers + // then sends the nv2a a command to launch the vertex shader function located at Address + LOG_UNIMPLEMENTED(); } @@ -8574,19 +8137,15 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_LoadVertexShaderProgram) DWORD Address ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pFunction) LOG_FUNC_ARG(Address) LOG_FUNC_END; - DWORD hCurrentShader = g_CurrentXboxVertexShaderHandle; - // D3DDevice_LoadVertexShaderProgram splits the given function buffer into batch-wise pushes to the NV2A - load_shader_program_key_t shaderCacheKey = ((load_shader_program_key_t)hCurrentShader << 32) | (DWORD)pFunction; - + load_shader_program_key_t shaderCacheKey = ((load_shader_program_key_t)g_Xbox_VertexShader_Handle << 32) | (DWORD)pFunction; + // If the shader key was located in the cache, use the cached shader // TODO: When do we clear the cache? In this approach, shaders are // never freed... @@ -8597,55 +8156,107 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_LoadVertexShaderProgram) return; } - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(hCurrentShader); - if (pVertexShader != nullptr) - { - DWORD hNewShader = 0; + DWORD *pXboxVertexDeclaration = nullptr; - // Save the contents of the existing vertex shader program - DWORD* pDeclaration = (DWORD*) malloc( pVertexShader->DeclarationSize ); - memmove( pDeclaration, pVertexShader->pDeclaration, pVertexShader->DeclarationSize ); + if (VshHandleIsVertexShader(g_Xbox_VertexShader_Handle)) { + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(g_Xbox_VertexShader_Handle); - // Create a new vertex shader with the new - HRESULT hr = EMUPATCH(D3DDevice_CreateVertexShader)( pDeclaration, pFunction, &hNewShader, 0 ); - free(pDeclaration); - if( FAILED( hr ) ) - CxbxKrnlCleanup( "Error creating new vertex shader!" ); + // If we failed to fetch an active pixel shader, log and do nothing + if (pCxbxVertexShader == nullptr) { + LOG_TEST_CASE("D3DDevice_LoadVertexShaderProgram: Failed to locate original shader"); + return; + } - EMUPATCH(D3DDevice_LoadVertexShader)(hNewShader, Address); - EMUPATCH(D3DDevice_SelectVertexShader)(hNewShader, Address); + // Simply retrieve the contents of the existing vertex shader program + pXboxVertexDeclaration = pCxbxVertexShader->pXboxDeclarationCopy; + } else { + // This is an unusual scenario in which an FVF-based shader is being replaced with an actual shader + // But without calling CreateVertexShader: This means we need to parse the current FVF and generate + // our own Xbox-like declaration to use when converting/setting this new shader - g_LoadVertexShaderProgramCache[shaderCacheKey] = hNewShader; + // Define a large enough definition to contain all possible FVF types + // 20 is maximum possible size + DWORD CxbxXboxVertexDeclaration[20] = { 0 }; + int index = 0; - EmuWarning("Vertex Shader Cache Size: %d", g_LoadVertexShaderProgramCache.size()); + // Write the Stream Number (always 0 for FVF) + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_STREAM(0); + + // Write Position + DWORD position = (g_Xbox_VertexShader_Handle & X_D3DFVF_POSITION_MASK); + if (position == X_D3DFVF_XYZRHW) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_POSITION, X_D3DVSDT_FLOAT4); + } else { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_POSITION, X_D3DVSDT_FLOAT3); + } + + // Write Blend Weights + if (position == X_D3DFVF_XYZB1) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_BLENDWEIGHT, X_D3DVSDT_FLOAT1); + } + if (position == X_D3DFVF_XYZB2) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_BLENDWEIGHT, X_D3DVSDT_FLOAT2); + } + if (position == X_D3DFVF_XYZB3) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_BLENDWEIGHT, X_D3DVSDT_FLOAT3); + } + if (position == X_D3DFVF_XYZB4) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_BLENDWEIGHT, X_D3DVSDT_FLOAT4); + } + + // Write Normal, Diffuse, and Specular + if (g_Xbox_VertexShader_Handle & X_D3DFVF_NORMAL) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_NORMAL, X_D3DVSDT_FLOAT3); + } + if (g_Xbox_VertexShader_Handle & X_D3DFVF_DIFFUSE) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_DIFFUSE, X_D3DVSDT_D3DCOLOR); + } + if (g_Xbox_VertexShader_Handle & X_D3DFVF_SPECULAR) { + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_SPECULAR, X_D3DVSDT_D3DCOLOR); + } + + // Write Texture Coordinates + int textureCount = (g_Xbox_VertexShader_Handle & X_D3DFVF_TEXCOUNT_MASK) >> X_D3DFVF_TEXCOUNT_SHIFT; + assert(textureCount <= 4); // Safeguard, since the X_D3DFVF_TEXCOUNT bitfield could contain invalid values (5 up to 15) + for (int i = 0; i < textureCount; i++) { + int numberOfCoordinates = 0; + + if ((g_Xbox_VertexShader_Handle & X_D3DFVF_TEXCOORDSIZE1(i)) == (DWORD)X_D3DFVF_TEXCOORDSIZE1(i)) { + numberOfCoordinates = X_D3DVSDT_FLOAT1; + } + if ((g_Xbox_VertexShader_Handle & X_D3DFVF_TEXCOORDSIZE2(i)) == (DWORD)X_D3DFVF_TEXCOORDSIZE2(i)) { + numberOfCoordinates = X_D3DVSDT_FLOAT2; + } + if ((g_Xbox_VertexShader_Handle & X_D3DFVF_TEXCOORDSIZE3(i)) == (DWORD)X_D3DFVF_TEXCOORDSIZE3(i)) { + numberOfCoordinates = X_D3DVSDT_FLOAT3; + } + if ((g_Xbox_VertexShader_Handle & X_D3DFVF_TEXCOORDSIZE4(i)) == (DWORD)X_D3DFVF_TEXCOORDSIZE4(i)) { + numberOfCoordinates = X_D3DVSDT_FLOAT4; + } + + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_REG(X_D3DVSDE_TEXCOORD0 + i, numberOfCoordinates); + } + + // Write Declaration End + CxbxXboxVertexDeclaration[index++] = X_D3DVSD_END(); + + pXboxVertexDeclaration = CxbxXboxVertexDeclaration; + // Now we can fall through and create a new vertex shader } -} -// ****************************************************************** -// * patch: D3DDevice_GetVertexShaderType -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderType) -( - DWORD Handle, - DWORD *pType -) -{ - FUNC_EXPORTS + // Create a vertex shader with the new vertex program data + DWORD hNewXboxShader = 0; + HRESULT hr = EMUPATCH(D3DDevice_CreateVertexShader)(pXboxVertexDeclaration, pFunction, &hNewXboxShader, 0); - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Handle) - LOG_FUNC_ARG(pType) - LOG_FUNC_END; + if( FAILED( hr ) ) + CxbxKrnlCleanup("Error creating new vertex shader!" ); - // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) - // *pType is set according to flags in the VertexShader struct + EMUPATCH(D3DDevice_LoadVertexShader)(hNewXboxShader, Address); + EMUPATCH(D3DDevice_SelectVertexShader)(hNewXboxShader, Address); - if (pType) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - if (pVertexShader) { - *pType = pVertexShader->Type; - } - } + g_LoadVertexShaderProgramCache[shaderCacheKey] = hNewXboxShader; + + EmuLog(LOG_LEVEL::WARNING, "Vertex Shader Cache Size: %d", g_LoadVertexShaderProgramCache.size()); } // ****************************************************************** @@ -8658,8 +8269,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderDeclaration) DWORD *pSizeOfData ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(pData) @@ -8680,14 +8289,15 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderDeclaration) HRESULT hRet = D3DERR_INVALIDCALL; if (pSizeOfData) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - if (pVertexShader) { - if (*pSizeOfData < pVertexShader->DeclarationSize || !pData) { - *pSizeOfData = pVertexShader->DeclarationSize; + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(Handle); + if (pCxbxVertexShader) { + DWORD sizeOfData = pCxbxVertexShader->XboxDeclarationCount * sizeof(DWORD); + if (*pSizeOfData < sizeOfData || !pData) { + *pSizeOfData = sizeOfData; hRet = !pData ? D3D_OK : D3DERR_MOREDATA; } else { - memcpy(pData, pVertexShader->pDeclaration, pVertexShader->DeclarationSize); + memcpy(pData, pCxbxVertexShader->pXboxDeclarationCopy, pCxbxVertexShader->XboxDeclarationCount * sizeof(DWORD)); hRet = D3D_OK; } } @@ -8706,8 +8316,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderFunction) DWORD *pSizeOfData ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(pData) @@ -8727,14 +8335,14 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderFunction) HRESULT hRet = D3DERR_INVALIDCALL; if(pSizeOfData) { - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(Handle); - if (pVertexShader) { - if (*pSizeOfData < pVertexShader->FunctionSize || !pData) { - *pSizeOfData = pVertexShader->FunctionSize; + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(Handle); + if (pCxbxVertexShader) { + if (*pSizeOfData < pCxbxVertexShader->XboxFunctionSize || !pData) { + *pSizeOfData = pCxbxVertexShader->XboxFunctionSize; hRet = !pData ? D3D_OK : D3DERR_MOREDATA; } else { - memcpy(pData, pVertexShader->pFunction, pVertexShader->FunctionSize); + memcpy(pData, pCxbxVertexShader->pXboxFunctionCopy, pCxbxVertexShader->XboxFunctionSize); hRet = D3D_OK; } } @@ -8753,8 +8361,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetDepthClipPlanes) DWORD Flags ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Near) LOG_FUNC_ARG(Far) @@ -8802,7 +8408,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetDepthClipPlanes) break; default: - EmuWarning("Unknown SetDepthClipPlanes Flags provided");; + EmuLog(LOG_LEVEL::WARNING, "Unknown SetDepthClipPlanes Flags provided"); } // TODO @@ -8817,8 +8423,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetDepthClipPlanes) // ****************************************************************** DWORD WINAPI XTL::EMUPATCH(D3DDevice_InsertFence)() { - FUNC_EXPORTS - LOG_FUNC(); // TODO: Actually implement this @@ -8837,8 +8441,6 @@ BOOL WINAPI XTL::EMUPATCH(D3DDevice_IsFencePending) DWORD Fence ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Fence); // TODO: Implement @@ -8855,8 +8457,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_BlockOnFence) DWORD Fence ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Fence); // TODO: Implement @@ -8871,8 +8471,6 @@ VOID WINAPI XTL::EMUPATCH(D3DResource_BlockUntilNotBusy) X_D3DResource *pThis ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pThis); // TODO: Implement @@ -8888,14 +8486,13 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetScreenSpaceOffset) FLOAT y ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(x) LOG_FUNC_ARG(y) LOG_FUNC_END; - EmuWarning("EmuD3DDevice_SetScreenSpaceOffset ignored"); + // No need to log this, it's safe to ignore. + //EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetScreenSpaceOffset ignored"); } // ****************************************************************** @@ -8908,18 +8505,13 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_InsertCallback) DWORD Context ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Type) LOG_FUNC_ARG(pCallback) LOG_FUNC_ARG(Context) LOG_FUNC_END; - // TODO: Implement - g_pCallback = (D3DCALLBACK) pCallback; - g_CallbackType = Type; - g_CallbackParam = Context; + CxbxImpl_InsertCallback(Type, pCallback, Context); LOG_INCOMPLETE(); } @@ -8934,8 +8526,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_DrawRectPatch) CONST D3DRECTPATCH_INFO *pRectPatchInfo ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(pNumSegs) @@ -8960,8 +8550,6 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_DrawTriPatch) CONST D3DTRIPATCH_INFO* pTriPatchInfo ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Handle) LOG_FUNC_ARG(pNumSegs) @@ -8985,8 +8573,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetProjectionViewportMatrix) D3DXMATRIX *pProjectionViewport ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pProjectionViewport); // blueshogun96 1/25/10 @@ -9041,8 +8627,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetProjectionViewportMatrix) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStateVB)( ULONG Unknown1 ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Unknown1); // TODO: Anything? @@ -9056,8 +8640,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStateVB)( ULONG Unknown1 ) // ****************************************************************** VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStateUP)() { - FUNC_EXPORTS - LOG_FUNC(); LOG_UNIMPLEMENTED(); @@ -9072,8 +8654,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetStateUP)() // ****************************************************************** void WINAPI XTL::EMUPATCH(D3DDevice_SetStipple)( DWORD* pPattern ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pPattern); // We need an OpenGL port... badly @@ -9086,14 +8666,12 @@ void WINAPI XTL::EMUPATCH(D3DDevice_SetStipple)( DWORD* pPattern ) // ****************************************************************** void WINAPI XTL::EMUPATCH(D3DDevice_SetSwapCallback) ( - D3DSWAPCALLBACK pCallback + X_D3DSWAPCALLBACK pCallback ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pCallback); - g_pSwapCallback = pCallback; + g_pXbox_SwapCallback = pCallback; } // ****************************************************************** @@ -9101,8 +8679,6 @@ void WINAPI XTL::EMUPATCH(D3DDevice_SetSwapCallback) // ****************************************************************** HRESULT WINAPI XTL::EMUPATCH(D3DDevice_PersistDisplay)() { - FUNC_EXPORTS - LOG_FUNC(); HRESULT hRet = D3D_OK; @@ -9132,8 +8708,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_PrimeVertexCache) WORD *pIndexData ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(VertexCount) LOG_FUNC_ARG(pIndexData) @@ -9143,27 +8717,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_PrimeVertexCache) LOG_UNIMPLEMENTED(); } -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_SampleAlpha -// ****************************************************************** -HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_SampleAlpha) -( - DWORD dwSampleAlpha -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(dwSampleAlpha); - - // TODO: Implement? - - LOG_UNIMPLEMENTED(); - - - - return D3D_OK; -} - // ****************************************************************** // * patch: D3DDevice_SetModelView // ****************************************************************** @@ -9174,8 +8727,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetModelView) CONST D3DMATRIX *pComposite ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pModelView) LOG_FUNC_ARG(pInverseModelView) @@ -9191,8 +8742,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetModelView) // ****************************************************************** void WINAPI XTL::EMUPATCH(D3DDevice_FlushVertexCache)() { - FUNC_EXPORTS - LOG_FUNC(); LOG_UNIMPLEMENTED(); @@ -9203,8 +8752,6 @@ void WINAPI XTL::EMUPATCH(D3DDevice_FlushVertexCache)() // ****************************************************************** HRESULT WINAPI XTL::EMUPATCH(D3DDevice_GetModelView)(D3DXMATRIX* pModelView) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pModelView); D3DXMATRIX mtxWorld, mtxView; @@ -9226,8 +8773,6 @@ DWORD PushBuffer[64 * 1024 / sizeof(DWORD)]; // ****************************************************************** void WINAPI XTL::EMUPATCH(D3D_SetCommonDebugRegisters)() { - FUNC_EXPORTS - LOG_FUNC(); // NOTE: I added this because I was too lazy to deal with emulating certain render @@ -9242,8 +8787,6 @@ void WINAPI XTL::EMUPATCH(D3D_SetCommonDebugRegisters)() // ****************************************************************** BOOL WINAPI XTL::EMUPATCH(D3DDevice_IsBusy)() { - FUNC_EXPORTS - LOG_FUNC(); // NOTE: This function returns FALSE when the NV2A FIFO is empty/complete, or NV_PGRAPH_STATUS = 0 @@ -9257,8 +8800,6 @@ BOOL WINAPI XTL::EMUPATCH(D3DDevice_IsBusy)() // ****************************************************************** void WINAPI XTL::EMUPATCH(D3D_BlockOnTime)( DWORD Unknown1, int Unknown2 ) { - FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Unknown1) LOG_FUNC_ARG(Unknown2) @@ -9273,6 +8814,76 @@ void WINAPI XTL::EMUPATCH(D3D_BlockOnTime)( DWORD Unknown1, int Unknown2 ) LOG_UNIMPLEMENTED(); } +bool DestroyResource_Common(XTL::X_D3DResource* pResource) +{ + if (pResource == g_pXbox_RenderTarget) { + LOG_TEST_CASE("Skipping Release of active Xbox Render Target"); + return false; + } + + if (pResource == g_pXbox_DepthStencil) { + LOG_TEST_CASE("Skipping Release of active Xbox Depth Stencil"); + return false; + } + + if (pResource == g_pXbox_BackBufferSurface) { + LOG_TEST_CASE("Skipping Release of active Xbox BackBuffer"); + return false; + } + + if (pResource == g_pXbox_DefaultDepthStencilSurface) { + LOG_TEST_CASE("Skipping Release of default Xbox Depth Stencil"); + return false; + } + + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { + if (pResource == g_pXbox_SetTexture[i]) { + // This shouldn't happen, since texture resources that get destroyed, + // shouldn't be set to any stage anymore. + LOG_TEST_CASE("Skipping Release of active Xbox Texture"); + return false; + } + } + + // Release the host copy (if it exists!) + FreeHostResource(GetHostResourceKey(pResource)); + + return true; +} + +// ****************************************************************** +// * patch: D3D_DestroyResource +// ****************************************************************** +void WINAPI XTL::EMUPATCH(D3D_DestroyResource)(X_D3DResource* pResource) +{ + LOG_FUNC_ONE_ARG(pResource); + + if (DestroyResource_Common(pResource)) { + // Call the Xbox version of DestroyResource + XB_TRMP(D3D_DestroyResource)(pResource); + } +} + +// ****************************************************************** +// * patch: D3D_DestroyResource_LTCG +// ****************************************************************** +void WINAPI XTL::EMUPATCH(D3D_DestroyResource__LTCG)() +{ + X_D3DResource* pResource; + __asm { + mov pResource, edi + } + + if (DestroyResource_Common(pResource)) { + // Call the Xbox version of DestroyResource + __asm { + mov edi, pResource + call XB_TRMP(D3D_DestroyResource__LTCG) + } + } +} + + // ****************************************************************** // * patch: D3DDevice_SetRenderTargetFast // ****************************************************************** @@ -9283,8 +8894,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderTargetFast) DWORD Flags ) { - FUNC_EXPORTS - LOG_FORWARD("D3DDevice_SetRenderTarget"); // Redirect to the standard version. @@ -9300,8 +8909,6 @@ void WINAPI XTL::EMUPATCH(D3D_LazySetPointParams) void* Device ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(Device); LOG_UNIMPLEMENTED(); @@ -9315,8 +8922,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetMaterial) X_D3DMATERIAL8* pMaterial ) { - FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pMaterial); HRESULT hRet = D3D_OK; @@ -9329,7 +8934,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetMaterial) if(FAILED(hRet)) { - EmuWarning("We're lying about getting a material!"); + EmuLog(LOG_LEVEL::WARNING, "We're lying about getting a material!"); hRet = D3D_OK; } } @@ -9343,8 +8948,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShaderConstant_4) CONST PVOID pConstantData ) { - FUNC_EXPORTS - DWORD Register; DWORD ConstantCount; @@ -9358,18 +8961,9 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShaderConstant_4) // LOG_FUNC_ARG(pConstantData) // LOG_FUNC_ARG(ConstantCount) // LOG_FUNC_END; - DbgPrintf("D3DDevice_SetPixelShaderConstant_4(Register : %d pConstantData : %08X ConstantCount : %d);\n", Register, pConstantData, ConstantCount); + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetPixelShaderConstant_4(Register : %d pConstantData : %08X ConstantCount : %d);", Register, pConstantData, ConstantCount); - // TODO: This hack is necessary for Vertex Shaders on XDKs prior to 4361, but if this - // causes problems with pixel shaders, feel free to comment out the hack below. - if(g_BuildVersion <= 4361) - Register += 96; - -#ifdef CXBX_USE_D3D9 HRESULT hRet = g_pD3DDevice->SetPixelShaderConstantF -#else - HRESULT hRet = g_pD3DDevice->SetPixelShaderConstant -#endif ( Register, (PixelShaderConstantType*)pConstantData, @@ -9379,7 +8973,7 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShaderConstant_4) if(FAILED(hRet)) { - EmuWarning("We're lying about setting a pixel shader constant!"); + EmuLog(LOG_LEVEL::WARNING, "We're lying about setting a pixel shader constant!"); hRet = D3D_OK; } diff --git a/src/CxbxKrnl/EmuD3D.cpp.unused-patches b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp.unused-patches similarity index 72% rename from src/CxbxKrnl/EmuD3D.cpp.unused-patches rename to src/core/hle/D3D8/Direct3D9/Direct3D9.cpp.unused-patches index 6ac7f1e61..c8ad09dc1 100644 --- a/src/CxbxKrnl/EmuD3D.cpp.unused-patches +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp.unused-patches @@ -2742,6 +2742,840 @@ XTL::X_D3DSurface * WINAPI XTL::EMUPATCH(D3DDevice_GetDepthStencilSurface2)() RETURN(result); } + +// LTCG specific D3DDevice_SetTextureState_TexCoordIndex function... +// This uses a custom calling convention where parameter is passed in EDI, EAX +// Test-case: Ski Racing 2006 +VOID __stdcall XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex_0) +( +) +{ + DWORD Stage; + DWORD Value; + + __asm { + mov Stage, edi + mov Value, eax + } + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + if (Value >= 0x00040000) { + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetTextureState_TexCoordIndex: Unknown TexCoordIndex Value (0x%.08X)", Value); + return; + } + + HRESULT hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_TEXCOORDINDEX, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// This uses a custom calling convention where parameter is passed in ESI +// Test-case: Metal Wolf Chaos +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex_4) +( + DWORD Value +) +{ + DWORD Stage; + __asm mov Stage, esi; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + // TODO: Xbox Direct3D supports sphere mapping OpenGL style. + + // BUG FIX: The lower 16 bits were causing false Unknown TexCoordIndex errors. + // Check for 0x00040000 instead. + + if (Value >= 0x00040000) { + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetTextureState_TexCoordIndex: Unknown TexCoordIndex Value (0x%.08X)", Value); + return; + } + + HRESULT hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_TEXCOORDINDEX, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetTextureState_TexCoordIndex +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_TexCoordIndex) +( + DWORD Stage, + DWORD Value +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + XB_trampoline(VOID, WINAPI, D3DDevice_SetTextureState_TexCoordIndex, (DWORD, DWORD)); + XB_D3DDevice_SetTextureState_TexCoordIndex(Stage, Value); + + // TODO: Xbox Direct3D supports sphere mapping OpenGL style. + + // BUG FIX: The lower 16 bits were causing false Unknown TexCoordIndex errors. + // Check for 0x00040000 instead. + + if (Value >= 0x00040000) { + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetTextureState_TexCoordIndex: Unknown TexCoordIndex Value (0x%.08X)", Value); + return; + } + + HRESULT hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_TEXCOORDINDEX, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_TwoSidedLighting +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_TwoSidedLighting) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_TwoSidedLighting, (DWORD)); + XB_D3DDevice_SetRenderState_TwoSidedLighting(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_BackFillMode +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_BackFillMode) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + // blueshogun96 12/4/07 + // I haven't had access to Cxbx sources in a few months, great to be back :) + // + // Anyway, since standard Direct3D doesn't support the back fill mode + // operation, this function will be ignored. Things like this make me + // think even more that an OpenGL port wouldn't hurt since OpenGL supports + // nearly all of the missing features that Direct3D lacks. The Xbox's version + // of Direct3D was specifically created to take advantage of certain NVIDIA + // GPU registers and provide more OpenGL-like features IHMO. + LOG_NOT_SUPPORTED(); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_BackFillMode, (DWORD)); + XB_D3DDevice_SetRenderState_BackFillMode(Value); +} + +// LTCG specific D3DDevice_SetTextureState_BorderColor function... +// This uses a custom calling convention where parameter is passed in EAX, EBX +// Test-case: Metal Wolf Chaos +VOID XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor_0) +( +) +{ + DWORD Stage; + DWORD Value; + + __asm { + mov Stage, eax + mov Value, ebx + } + + + HRESULT hRet; + hRet = g_pD3DDevice->SetSamplerState(Stage, D3DSAMP_BORDERCOLOR, Value); + //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// This uses a custom calling convention where parameter is passed in EAX +// TODO: Log function is not working due lost parameter in EAX. +// Test-case: Murakumo +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor_4) +( + DWORD Value +) +{ + DWORD Stage; + __asm mov Stage, eax; + + //LOG_FUNC_BEGIN + // LOG_FUNC_ARG(Stage) + // LOG_FUNC_ARG(Value) + // LOG_FUNC_END; + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetTextureState_BorderColor_4(Stage : %d Value : %d);", Stage, Value); + + HRESULT hRet; + hRet = g_pD3DDevice->SetSamplerState(Stage, D3DSAMP_BORDERCOLOR, Value); + //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetTextureState_BorderColor +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BorderColor) +( + DWORD Stage, + DWORD Value +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + XB_trampoline(VOID, WINAPI, D3DDevice_SetTextureState_BorderColor, (DWORD, DWORD)); + XB_D3DDevice_SetTextureState_BorderColor(Stage, Value); + + HRESULT hRet; + hRet = g_pD3DDevice->SetSamplerState(Stage, D3DSAMP_BORDERCOLOR, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// LTCG specific D3DDevice_SetTextureState_ColorKeyColor function... +// This uses a custom calling convention where parameter is passed in ESI, EBX +// Test-case: Metal Wolf Chaos +VOID XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor_0) +( +) +{ + DWORD Stage; + DWORD Value; + + __asm { + mov Stage, esi + mov Value, ebx + } + + LOG_NOT_SUPPORTED(); +} + +// This uses a custom calling convention where parameter is passed in EAX +// Test-case: Murakumo +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor_4) +( + DWORD Value +) +{ + DWORD Stage; + __asm mov Stage, eax; + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetTextureState_ColorKeyColor +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_ColorKeyColor) +( + DWORD Stage, + DWORD Value +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + XB_trampoline(VOID, WINAPI, D3DDevice_SetTextureState_ColorKeyColor, (DWORD, DWORD)); + XB_D3DDevice_SetTextureState_ColorKeyColor(Stage, Value); + + LOG_NOT_SUPPORTED(); +} + +// LTCG specific D3DDevice_SetTextureState_BumpEnv function... +// This uses a custom calling convention where parameter is passed in EAX +// TODO: Log function is not working due lost parameter in EAX. +// Test-case: Metal Wolf Chaos +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BumpEnv_8) +( + X_D3DTEXTURESTAGESTATETYPE Type, + DWORD Value +) +{ + DWORD Stage; + __asm mov Stage, eax; + + //LOG_FUNC_BEGIN + // LOG_FUNC_ARG(Stage) + // LOG_FUNC_ARG(Type) + // LOG_FUNC_ARG(Value) + // LOG_FUNC_END; + EmuLog(LOG_LEVEL::DEBUG, "D3DDevice_SetTextureState_BumpEnv_8(Stage : %d Type : %d Value : %d);", Stage, Type, Value); + + HRESULT hRet = D3D_OK; + + switch(Type) + { + case 22: // X_D3DTSS_BUMPENVMAT00 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT00, Value); + break; + case 23: // X_D3DTSS_BUMPENVMAT01 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT01, Value); + break; + case 24: // X_D3DTSS_BUMPENVMAT11 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT11, Value); + break; + case 25: // X_D3DTSS_BUMPENVMAT10 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT10, Value); + break; + case 26: // X_D3DTSS_BUMPENVLSCALE + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLSCALE, Value); + break; + case 27: // X_D3DTSS_BUMPENVLOFFSET + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLOFFSET, Value); + break; + } + + //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetTextureState_BumpEnv +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetTextureState_BumpEnv) +( + DWORD Stage, + X_D3DTEXTURESTAGESTATETYPE Type, + DWORD Value +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Stage) + LOG_FUNC_ARG(Type) + LOG_FUNC_ARG(Value) + LOG_FUNC_END; + + XB_trampoline(VOID, WINAPI, D3DDevice_SetTextureState_BumpEnv, (DWORD, X_D3DTEXTURESTAGESTATETYPE, DWORD)); + XB_D3DDevice_SetTextureState_BumpEnv(Stage, Type, Value); + + HRESULT hRet = D3D_OK; + + switch(Type) + { + case 22: // X_D3DTSS_BUMPENVMAT00 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT00, Value); + break; + case 23: // X_D3DTSS_BUMPENVMAT01 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT01, Value); + break; + case 24: // X_D3DTSS_BUMPENVMAT11 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT11, Value); + break; + case 25: // X_D3DTSS_BUMPENVMAT10 + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVMAT10, Value); + break; + case 26: // X_D3DTSS_BUMPENVLSCALE + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLSCALE, Value); + break; + case 27: // X_D3DTSS_BUMPENVLOFFSET + hRet = g_pD3DDevice->SetTextureStageState(Stage, D3DTSS_BUMPENVLOFFSET, Value); + break; + } + + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetTextureStageState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_FrontFace +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FrontFace) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_FrontFace, (DWORD)); + XB_D3DDevice_SetRenderState_FrontFace(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_LogicOp +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_LogicOp) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_LogicOp, (DWORD)); + XB_D3DDevice_SetRenderState_LogicOp(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_NormalizeNormals +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_NormalizeNormals) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_NormalizeNormals, (DWORD)); + XB_D3DDevice_SetRenderState_NormalizeNormals(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_TextureFactor +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_TextureFactor) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_TextureFactor, (DWORD)); + XB_D3DDevice_SetRenderState_TextureFactor(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_TEXTUREFACTOR, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_ZBias +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ZBias) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + HRESULT hRet; + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_ZBias, (DWORD)); + XB_D3DDevice_SetRenderState_ZBias(Value); + + FLOAT Biased = static_cast(Value) * -0.000005f; + Value = *reinterpret_cast(&Biased); + + hRet = g_pD3DDevice->SetRenderState(D3DRS_DEPTHBIAS, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_EdgeAntiAlias +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_EdgeAntiAlias) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_EdgeAntiAlias, (DWORD)); + XB_D3DDevice_SetRenderState_EdgeAntiAlias(Value); + + // TODO: Analyze performance and compatibility (undefined behavior on PC with triangles or points) + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_ANTIALIASEDLINEENABLE, Value); // Was D3DRS_EDGEANTIALIAS (no longer exists) + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_FillMode +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FillMode) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_FillMode, (DWORD)); + XB_D3DDevice_SetRenderState_FillMode(Value); + + DWORD dwFillMode; + + if(Value != 0) + g_CurrentFillMode = EmuXB2PC_D3DFILLMODE(Value); + + if(g_iWireframe == 0) + dwFillMode = g_CurrentFillMode; + else if(g_iWireframe == 1) + dwFillMode = D3DFILL_WIREFRAME; + else + dwFillMode = D3DFILL_POINT; + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_FILLMODE, dwFillMode); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_FogColor +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_FogColor) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_FogColor, (DWORD)); + XB_D3DDevice_SetRenderState_FogColor(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGCOLOR, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_Dxt1NoiseEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_Dxt1NoiseEnable) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_Dxt1NoiseEnable, (DWORD)); + XB_D3DDevice_SetRenderState_Dxt1NoiseEnable(Value); + + LOG_UNIMPLEMENTED(); +} + + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_VertexBlend +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_VertexBlend) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_VertexBlend, (DWORD)); + XB_D3DDevice_SetRenderState_VertexBlend(Value); + + // convert from Xbox direct3d to PC direct3d enumeration + if(Value <= 1) { + Value = Value; + } else if(Value == 3) { + Value = 2; + } else if(Value == 5) { + Value = 3; + } else { + LOG_TEST_CASE("Unsupported D3DVERTEXBLENDFLAGS (%d)"); + return; + } + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_VERTEXBLEND, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_PSTextureModes +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_PSTextureModes) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_PSTextureModes, (DWORD)); + XB_D3DDevice_SetRenderState_PSTextureModes(Value); + + TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES] = Value; +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_CullMode +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_CullMode) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_CullMode, (DWORD)); + XB_D3DDevice_SetRenderState_CullMode(Value); + + // convert from Xbox D3D to PC D3D enumeration + // TODO: XDK-Specific Tables? So far they are the same + switch(Value) + { + case X_D3DCULL_NONE: + Value = D3DCULL_NONE; + break; + case X_D3DCULL_CW: + Value = D3DCULL_CW; + break; + case X_D3DCULL_CCW: + Value = D3DCULL_CCW; + break; + default: + CxbxKrnlCleanup("EmuD3DDevice_SetRenderState_CullMode: Unknown Cullmode (%d)", Value); + } + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_LineWidth +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_LineWidth) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_LineWidth, (DWORD)); + XB_D3DDevice_SetRenderState_LineWidth(Value); + + // TODO: Convert to PC format?? +// g_pD3DDevice->SetRenderState(D3DRS_LINEPATTERN, Value); + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_StencilFail +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilFail) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_StencilFail, (DWORD)); + XB_D3DDevice_SetRenderState_StencilFail(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILFAIL, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_OcclusionCullEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_OcclusionCullEnable) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_OcclusionCullEnable, (DWORD)); + XB_D3DDevice_SetRenderState_OcclusionCullEnable(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_StencilCullEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilCullEnable) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_StencilCullEnable, (DWORD)); + XB_D3DDevice_SetRenderState_StencilCullEnable(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_RopZCmpAlwaysRead +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_RopZCmpAlwaysRead) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_RopZCmpAlwaysRead, (DWORD)); + XB_D3DDevice_SetRenderState_RopZCmpAlwaysRead(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_RopZRead +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_RopZRead) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_RopZRead, (DWORD)); + XB_D3DDevice_SetRenderState_RopZRead(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_DoNotCullUncompressed +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_DoNotCullUncompressed) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_DoNotCullUncompressed, (DWORD)); + XB_D3DDevice_SetRenderState_DoNotCullUncompressed(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_ZEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ZEnable) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_ZEnable, (DWORD)); + XB_D3DDevice_SetRenderState_ZEnable(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_ZENABLE, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_StencilEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_StencilEnable) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_StencilEnable, (DWORD)); + XB_D3DDevice_SetRenderState_StencilEnable(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILENABLE, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_MultiSampleAntiAlias +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleAntiAlias) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_MultiSampleAntiAlias, (DWORD)); + XB_D3DDevice_SetRenderState_MultiSampleAntiAlias(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_MultiSampleMask +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleMask) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_MultiSampleMask, (DWORD)); + XB_D3DDevice_SetRenderState_MultiSampleMask(Value); + + HRESULT hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, Value); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetRenderState"); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_MultiSampleMode +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleMode) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_MultiSampleMode, (DWORD)); + XB_D3DDevice_SetRenderState_MultiSampleMode(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_MultiSampleRenderTargetMode +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_MultiSampleRenderTargetMode) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_MultiSampleRenderTargetMode, (DWORD)); + XB_D3DDevice_SetRenderState_MultiSampleRenderTargetMode(Value); + + LOG_NOT_SUPPORTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_ShadowFunc +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_ShadowFunc) +( + DWORD Value +) +{ + LOG_FUNC_ONE_ARG(Value); + + XB_trampoline(VOID, WINAPI, D3DDevice_SetRenderState_ShadowFunc, (DWORD)); + XB_D3DDevice_SetRenderState_ShadowFunc(Value); + + // ShadowFunc reflects the following Xbox-only extension + // + // typedef enum _D3DRENDERSTATETYPE { + // ... + // D3DRS_SHADOWFUNC = 156, // D3DCMPFUNC + // ... + // } D3DRENDERSTATETYPE; + // + // Value is a member of the D3DCMPFUNC enumeration that + // specifies what function to use with a shadow buffer. + // The default value is D3DCMP_NEVER. + + // EmuXB2PC_D3DCMPFUNC(Value); + + // this warning just gets annoying + // LOG_UNIMPLEMENTED(); +} + // ****************************************************************** // * patch: D3DDevice_SetRenderState_Deferred // ****************************************************************** @@ -2811,194 +3645,401 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetRenderState_Deferred) } - -// ****************************************************************** -// * patch: D3DDevice_GetViewport -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewport) -( - X_D3DVIEWPORT8 *pViewport -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(pViewport); - - D3DVIEWPORT HostViewPort; - - HRESULT hRet = g_pD3DDevice->GetViewport(&HostViewPort); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetViewport"); - - if (!g_ScaleViewport) { - *pViewport = HostViewPort; - } - else { - // Note : We cannot return the Xbox viewport as set in EMUPATCH(D3DDevice_SetViewport) - // because various Xbox D3D functions reset the Xbox viewport. Since we call comparable - // functions on host D3D, the host viewport is better suited as a return value; - // We just need to scale the host viewport back to Xbox dimensions - the exact opposite - // operation from the up-scaling that happens in EMUPATCH(D3DDevice_SetViewport). - - // Get current host render target dimensions - DWORD HostRenderTarget_Width; - DWORD HostRenderTarget_Height; - - if (GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { - - // Get current Xbox render target dimensions - DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXboxRenderTarget); - DWORD XboxRenderTarget_Height = GetPixelContainerHeigth(g_pXboxRenderTarget); - - // Scale host back to Xbox dimensions (avoiding hard-coding 640 x 480) - pViewport->X = ScaleDWORD(HostViewPort.X, HostRenderTarget_Width, XboxRenderTarget_Width); - pViewport->Y = ScaleDWORD(HostViewPort.Y, HostRenderTarget_Height, XboxRenderTarget_Height); - pViewport->Width = ScaleDWORD(HostViewPort.Width, HostRenderTarget_Width, XboxRenderTarget_Width); - pViewport->Height = ScaleDWORD(HostViewPort.Height, HostRenderTarget_Height, XboxRenderTarget_Height); - pViewport->MinZ = HostViewPort.MinZ; // No need scale Z for now - pViewport->MaxZ = HostViewPort.MaxZ; - } - else { - *pViewport = HostViewPort; - EmuWarning("GetHostRenderTargetDimensions failed - GetViewport returns host viewport instead!"); - } - } -} - -// ****************************************************************** -// * patch: D3D_BlockOnResource -// ****************************************************************** -void WINAPI XTL::EMUPATCH(D3D_BlockOnResource)( X_D3DResource* pResource ) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(pResource); - - // TODO: Implement - // NOTE: Azurik appears to call this directly from numerous points - LOG_UNIMPLEMENTED(); - -} - - -// ****************************************************************** -// * patch: IDirect3DResource8_IsBusy -// ****************************************************************** -BOOL WINAPI XTL::EMUPATCH(D3DResource_IsBusy) -( - X_D3DResource *pThis -) -{ - FUNC_EXPORTS - - /* too much output - LOG_FUNC_ONE_ARG(pThis); - //*/ - - return FALSE; -} - - -// ****************************************************************** -// * patch: D3DDevice_SetScissors -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetScissors) -( - DWORD Count, - BOOL Exclusive, - CONST D3DRECT *pRects -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(Count) - LOG_FUNC_ARG(Exclusive) - LOG_FUNC_ARG(pRects) - LOG_FUNC_END; - - // TODO: Implement - LOG_UNIMPLEMENTED(); -} - -// ****************************************************************** -// * patch: D3DDevice_GetScissors -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetScissors) -( - DWORD *pCount, - BOOL *pExclusive, - D3DRECT *pRects -) -{ - FUNC_EXPORTS - - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pCount) - LOG_FUNC_ARG(pExclusive) - LOG_FUNC_ARG(pRects) - LOG_FUNC_END; - - // TODO: Save a copy of each scissor rect in case this function is called - // in conjunction with D3DDevice::SetScissors. So far, only Outrun2 uses - // this function. For now, just return the values within the current - // viewport. - - D3DVIEWPORT vp; - - HRESULT hRet = g_pD3DDevice->GetViewport( &vp ); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetViewport"); - - pRects->x1 = pRects->y1 = 0; - pRects->x2 = vp.Width; - pRects->y2 = vp.Height; - - pExclusive[0] = FALSE; -} - - -// ****************************************************************** -// * patch: D3DDevice_SetBackMaterial -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_SetBackMaterial) -( - X_D3DMATERIAL8* pMaterial -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(pMaterial); - - LOG_NOT_SUPPORTED(); -} - - - -// ****************************************************************** -// * patch: D3DDevice_GetBackMaterial -// ****************************************************************** -VOID WINAPI XTL::EMUPATCH(D3DDevice_GetBackMaterial) -( - X_D3DMATERIAL8* pMaterial -) -{ - FUNC_EXPORTS - - LOG_FUNC_ONE_ARG(pMaterial); - - LOG_NOT_SUPPORTED(); - - HRESULT hRet = D3D_OK; - - // TODO: HACK: This is wrong, but better than nothing, right? - if (pMaterial) - { - hRet = g_pD3DDevice->GetMaterial(pMaterial); - DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetMaterial"); - } - - if (FAILED(hRet)) - { - EmuWarning("We're lying about getting a back material!"); - hRet = D3D_OK; - } -} + +// ****************************************************************** +// * patch: D3DDevice_GetViewport +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewport) +( + X_D3DVIEWPORT8 *pViewport +) +{ + FUNC_EXPORTS + + LOG_FUNC_ONE_ARG(pViewport); + + D3DVIEWPORT HostViewPort; + + HRESULT hRet = g_pD3DDevice->GetViewport(&HostViewPort); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetViewport"); + + if (!g_ScaleViewport) { + *pViewport = HostViewPort; + } + else { + // Note : We cannot return the Xbox viewport as set in EMUPATCH(D3DDevice_SetViewport) + // because various Xbox D3D functions reset the Xbox viewport. Since we call comparable + // functions on host D3D, the host viewport is better suited as a return value; + // We just need to scale the host viewport back to Xbox dimensions - the exact opposite + // operation from the up-scaling that happens in EMUPATCH(D3DDevice_SetViewport). + + // Get current host render target dimensions + DWORD HostRenderTarget_Width; + DWORD HostRenderTarget_Height; + + if (GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { + + // Get current Xbox render target dimensions + DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXboxRenderTarget); + DWORD XboxRenderTarget_Height = GetPixelContainerHeigth(g_pXboxRenderTarget); + + // Scale host back to Xbox dimensions (avoiding hard-coding 640 x 480) + pViewport->X = ScaleDWORD(HostViewPort.X, HostRenderTarget_Width, XboxRenderTarget_Width); + pViewport->Y = ScaleDWORD(HostViewPort.Y, HostRenderTarget_Height, XboxRenderTarget_Height); + pViewport->Width = ScaleDWORD(HostViewPort.Width, HostRenderTarget_Width, XboxRenderTarget_Width); + pViewport->Height = ScaleDWORD(HostViewPort.Height, HostRenderTarget_Height, XboxRenderTarget_Height); + pViewport->MinZ = HostViewPort.MinZ; // No need scale Z for now + pViewport->MaxZ = HostViewPort.MaxZ; + } + else { + *pViewport = HostViewPort; + EmuWarning("GetHostRenderTargetDimensions failed - GetViewport returns host viewport instead!"); + } + } +} + +// ****************************************************************** +// * patch: D3D_BlockOnResource +// ****************************************************************** +void WINAPI XTL::EMUPATCH(D3D_BlockOnResource)( X_D3DResource* pResource ) +{ + FUNC_EXPORTS + + LOG_FUNC_ONE_ARG(pResource); + + // TODO: Implement + // NOTE: Azurik appears to call this directly from numerous points + LOG_UNIMPLEMENTED(); + +} + + +// ****************************************************************** +// * patch: IDirect3DResource8_IsBusy +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(D3DResource_IsBusy) +( + X_D3DResource *pThis +) +{ + FUNC_EXPORTS + + /* too much output + LOG_FUNC_ONE_ARG(pThis); + //*/ + + return FALSE; +} + + +// ****************************************************************** +// * patch: D3DDevice_SetScissors +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetScissors) +( + DWORD Count, + BOOL Exclusive, + CONST D3DRECT *pRects +) +{ + FUNC_EXPORTS + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Count) + LOG_FUNC_ARG(Exclusive) + LOG_FUNC_ARG(pRects) + LOG_FUNC_END; + + // TODO: Implement + LOG_UNIMPLEMENTED(); +} + +// ****************************************************************** +// * patch: D3DDevice_GetScissors +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetScissors) +( + DWORD *pCount, + BOOL *pExclusive, + D3DRECT *pRects +) +{ + FUNC_EXPORTS + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pCount) + LOG_FUNC_ARG(pExclusive) + LOG_FUNC_ARG(pRects) + LOG_FUNC_END; + + // TODO: Save a copy of each scissor rect in case this function is called + // in conjunction with D3DDevice::SetScissors. So far, only Outrun2 uses + // this function. For now, just return the values within the current + // viewport. + + D3DVIEWPORT vp; + + HRESULT hRet = g_pD3DDevice->GetViewport( &vp ); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetViewport"); + + pRects->x1 = pRects->y1 = 0; + pRects->x2 = vp.Width; + pRects->y2 = vp.Height; + + pExclusive[0] = FALSE; +} + + +// ****************************************************************** +// * patch: D3DDevice_SetBackMaterial +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetBackMaterial) +( + X_D3DMATERIAL8* pMaterial +) +{ + FUNC_EXPORTS + + LOG_FUNC_ONE_ARG(pMaterial); + + LOG_NOT_SUPPORTED(); +} + + + +// ****************************************************************** +// * patch: D3DDevice_GetBackMaterial +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetBackMaterial) +( + X_D3DMATERIAL8* pMaterial +) +{ + FUNC_EXPORTS + + LOG_FUNC_ONE_ARG(pMaterial); + + LOG_NOT_SUPPORTED(); + + HRESULT hRet = D3D_OK; + + // TODO: HACK: This is wrong, but better than nothing, right? + if (pMaterial) + { + hRet = g_pD3DDevice->GetMaterial(pMaterial); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetMaterial"); + } + + if (FAILED(hRet)) + { + EmuWarning("We're lying about getting a back material!"); + hRet = D3D_OK; + } +} + +// ****************************************************************** +// * patch: D3DDevice_SetRenderState_YuvEnable +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_SetRenderState_YuvEnable) +( + BOOL Enable +) +{ + LOG_FUNC_ONE_ARG(Enable); + + g_bColorSpaceConvertYuvToRgb = (Enable != FALSE); +} + +// ****************************************************************** +// * patch: D3DDevice_GetLight +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetLight) +( + DWORD Index, + X_D3DLIGHT8 *pLight +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Index) + LOG_FUNC_ARG(pLight) + LOG_FUNC_END; + + HRESULT hRet = g_pD3DDevice->GetLight(Index, pLight); + DEBUG_D3DRESULT(hRet, "g_pD3DDevice->GetLight"); +} + +// ****************************************************************** +// * patch: IDirect3DPalette8_Lock +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DPalette_Lock) +( + X_D3DPalette *pThis, + D3DCOLOR **ppColors, + DWORD Flags +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(ppColors) + LOG_FUNC_ARG(Flags) + LOG_FUNC_END; + + XB_trampoline(VOID, WINAPI, D3DPalette_Lock, (X_D3DPalette*, D3DCOLOR**, DWORD)); + XB_D3DPalette_Lock(pThis, ppColors, Flags); + + // Check if this palette is in use by a texture stage, and force it to be re-converted if yes + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { + if (g_pXbox_Texture[i] != nullptr && g_pXbox_Palette[i] == GetDataFromXboxResource(pThis)) { + FreeHostResource(GetHostResourceKey(g_pXbox_Texture[i])); + } + } +} + +// ****************************************************************** +// * patch: IDirect3DPalette8_Lock2 +// ****************************************************************** +D3DCOLOR * WINAPI XTL::EMUPATCH(D3DPalette_Lock2) +( + X_D3DPalette *pThis, + DWORD Flags +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(Flags) + LOG_FUNC_END; + + XB_trampoline(D3DCOLOR*, WINAPI, D3DPalette_Lock2, (X_D3DPalette*, DWORD)); + D3DCOLOR* pData = XB_D3DPalette_Lock2(pThis, Flags); + + // Check if this palette is in use by a texture stage, and force it to be re-converted if yes + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { + if (g_pXbox_Texture[i] != nullptr && g_pXbox_Palette[i] == GetDataFromXboxResource(pThis)) { + FreeHostResource(GetHostResourceKey(g_pXbox_Texture[i])); + } + } + + RETURN(pData); +} + +// ****************************************************************** +// * patch: D3DDevice_GetVertexShaderSize +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderSize) +( + DWORD Handle, + UINT* pSize +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Handle) + LOG_FUNC_ARG(pSize) + LOG_FUNC_END; + + // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) + + if (pSize) { + CxbxVertexShader *pVertexShader = GetCxbxVertexShader(Handle); + *pSize = pVertexShader ? pVertexShader->XboxNrAddressSlots : 0; + } +} + +// ****************************************************************** +// * patch: D3DDevice_GetVertexShaderType +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderType) +( + DWORD Handle, + DWORD *pType +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Handle) + LOG_FUNC_ARG(pType) + LOG_FUNC_END; + + // Handle is always address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) + // *pType is set according to flags in the VertexShader struct + + if (pType) { + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(Handle); + if (pCxbxVertexShader) { + *pType = pCxbxVertexShader->XboxVertexShaderType; + } + } +} + +// LTCG specific D3DDevice_GetViewportOffsetAndScale function... +// This function is still not working so should be investigated... +// This uses a custom calling convention where parameter is passed in EDX, ECX +// Test-case: RalliSport Challenge 2 +VOID __stdcall XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale_0) +( +) +{ + D3DXVECTOR4 *pOffset; + D3DXVECTOR4 *pScale; + + __asm { + mov pScale, ecx + mov pOffset, edx + } + + return EMUPATCH(D3DDevice_GetViewportOffsetAndScale)(pOffset, pScale); +} + +// ****************************************************************** +// * patch: D3DDevice_GetViewportOffsetAndScale +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale) +( + X_D3DXVECTOR4 *pOffset, + X_D3DXVECTOR4 *pScale +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pOffset) + LOG_FUNC_ARG(pScale) + LOG_FUNC_END; + + // LOG_TEST_CASE("D3DDevice_GetViewportOffsetAndScale"); // Get us some test-cases + // Test case : 007: From Russia with Love + // Test case : Army Men?: Sarge's War + // Test case : BeatDown - Fists of Vengeance + // Test case : Big Mutha Truckers + // Test case : Big Mutha Truckers 2 + // Test case : Classified : The Sentinel Crisis + // Test case : Cold Fear + // Test case : Commandos SF + // Test case : Darkwatch + // Test case : Dr.Muto + // Test case : GTA : Vice City + // Test case : Jacked + // Test case : Madagascar + // Test case : Max Payne 2 + // Test case : NBA LIVE 2005 + // Test case : NFS : Underground + // Test case : NFS : Underground 2 + // Test case : PoP : The Sands of Time + // Test case : Prince of Persia : T2T - see #1109 (comment) + // Test case : RPM Tuning + // Test case : Street Racing Syndicate + // Test case : Spongebob - Battle for Bikini Bottom + // Test case : The Incredibles : Rise of the Underminer + // Test case : The SpongeBob SquarePants Movie + // Test case : TMNT(R)2 + // Test case : TMNT(R)3 + + float vOffset[4], vScale[4]; + GetViewPortOffsetAndScale(vOffset, vScale); + + pOffset->x = vOffset[0]; + pOffset->y = vOffset[1]; + pOffset->z = vOffset[2]; + pOffset->w = vOffset[3]; + + pScale->x = vScale[0]; + pScale->y = vScale[1]; + pScale->z = vScale[2]; + pScale->w = vScale[3]; +} diff --git a/src/CxbxKrnl/EmuD3D8.h b/src/core/hle/D3D8/Direct3D9/Direct3D9.h similarity index 97% rename from src/CxbxKrnl/EmuD3D8.h rename to src/core/hle/D3D8/Direct3D9/Direct3D9.h index 952c43098..c00cfe3c2 100644 --- a/src/CxbxKrnl/EmuD3D8.h +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,17 +22,17 @@ // * All rights reserved // * // ****************************************************************** -#ifndef EMUD3D8_H -#define EMUD3D8_H - -#include "EmuD3D8Types.h" -#include "CxbxKrnl.h" -#include "Common/Xbe.h" -#include "Emu.h" - +#ifndef DIRECT3D9_H +#define DIRECT3D9_H + +#include "core\hle\XAPI\Xapi.h" // For EMUPATCH +#include "core\hle\D3D8\XbD3D8Types.h" + #define DIRECTDRAW_VERSION 0x0700 #include +extern void LookupTrampolines(); + // initialize render window extern VOID CxbxInitWindow(bool bFullInit); @@ -57,24 +48,30 @@ extern VOID CxbxSetPixelContainerHeader UINT Pitch ); -extern uint8 *ConvertD3DTextureToARGB( +extern uint8_t *ConvertD3DTextureToARGB( XTL::X_D3DPixelContainer *pXboxPixelContainer, - uint8 *pSrc, + uint8_t *pSrc, int *pWidth, int *pHeight, int TextureStage = 0 -); +); + +void CxbxUpdateNativeD3DResources(); // initialize direct3d extern VOID EmuD3DInit(); // cleanup direct3d extern VOID EmuD3DCleanup(); + +extern IDirect3DDevice *g_pD3DDevice; -// EmuD3DTileCache (8 tiles maximum) -extern X_D3DTILE EmuD3DTileCache[0x08]; +extern DWORD g_Xbox_VertexShader_Handle; + +extern XTL::X_PixelShader *g_pXbox_PixelShader; -// EmuD3DActiveTexture -extern X_D3DBaseTexture *EmuD3DActiveTexture[TEXTURE_STAGES]; +extern XTL::X_D3DBaseTexture *g_pXbox_SetTexture[XTL::X_D3DTS_STAGECOUNT]; + +namespace XTL { // ****************************************************************** // * patch: Direct3D_CreateDevice @@ -166,7 +163,7 @@ VOID WINAPI EMUPATCH(D3DDevice_EndPush)(DWORD *pPush); // ****************************************************************** // * patch: D3DDevice_BeginVisibilityTest // ****************************************************************** -VOID WINAPI EMUPATCH(D3DDevice_BeginVisibilityTest)(); +HRESULT WINAPI EMUPATCH(D3DDevice_BeginVisibilityTest)(); // ****************************************************************** // * patch: D3DDevice_EndVisibilityTest @@ -599,6 +596,14 @@ VOID WINAPI EMUPATCH(D3DDevice_SetIndices) UINT BaseVertexIndex ); +// ****************************************************************** +// * patch: D3DDevice_SetIndices_4 +// ****************************************************************** +VOID WINAPI EMUPATCH(D3DDevice_SetIndices_4) +( + UINT BaseVertexIndex +); + // ****************************************************************** // * patch: D3DDevice_SetTexture // ****************************************************************** @@ -671,6 +676,17 @@ VOID WINAPI EMUPATCH(D3DDevice_SetVertexData4f) FLOAT d ); +// ****************************************************************** +// * patch: D3DDevice_SetVertexData4f_16 +// ****************************************************************** +VOID WINAPI EMUPATCH(D3DDevice_SetVertexData4f_16) +( + FLOAT a, + FLOAT b, + FLOAT c, + FLOAT d +); + // ****************************************************************** // * patch: D3DDevice_SetVertexData4ub // ****************************************************************** @@ -973,7 +989,7 @@ VOID WINAPI EMUPATCH(D3DDevice_BlockUntilVerticalBlank)(); // ****************************************************************** VOID WINAPI EMUPATCH(D3DDevice_SetVerticalBlankCallback) ( - D3DVBLANKCALLBACK pCallback + X_D3DVBLANKCALLBACK pCallback ); // ****************************************************************** @@ -1270,14 +1286,6 @@ VOID WINAPI EMUPATCH(D3DDevice_SetRenderState_ShadowFunc) DWORD Value ); -// ****************************************************************** -// * patch: D3DDevice_SetRenderState_YuvEnable -// ****************************************************************** -VOID WINAPI EMUPATCH(D3DDevice_SetRenderState_YuvEnable) -( - BOOL Enable -); - // ****************************************************************** // * patch: D3DDevice_SetTransform // ****************************************************************** @@ -1376,6 +1384,14 @@ VOID WINAPI EMUPATCH(D3DDevice_DrawVertices) UINT VertexCount ); +// ****************************************************************** +// * patch: D3DDevice_DrawVertices_4 +// ****************************************************************** +VOID WINAPI EMUPATCH(D3DDevice_DrawVertices_4) +( + X_D3DPRIMITIVETYPE PrimitiveType +); + // ****************************************************************** // * patch: D3DDevice_DrawVerticesUP // ****************************************************************** @@ -1881,7 +1897,7 @@ void WINAPI EMUPATCH(D3DDevice_SetStipple)( DWORD* pPattern ); // ****************************************************************** void WINAPI EMUPATCH(D3DDevice_SetSwapCallback) ( - D3DSWAPCALLBACK pCallback + X_D3DSWAPCALLBACK pCallback ); // ****************************************************************** @@ -2021,6 +2037,17 @@ void WINAPI EMUPATCH(D3D_BlockOnTime)( DWORD Unknown1, int Unknown2 ); // ****************************************************************** void WINAPI EMUPATCH(D3D_BlockOnResource)( X_D3DResource* pResource ); +// ****************************************************************** +// * patch: D3D_DestroyResource +// ****************************************************************** +void WINAPI EMUPATCH(D3D_DestroyResource)( X_D3DResource* pResource ); + +// ****************************************************************** +// * patch: D3D_DestroyResource__LTCG +// ****************************************************************** +void WINAPI EMUPATCH(D3D_DestroyResource__LTCG)(); + + // ****************************************************************** // * patch: D3DDevice_GetPushBufferOffset // ****************************************************************** @@ -2098,5 +2125,7 @@ VOID WINAPI EMUPATCH(D3DDevice_GetMaterial) ( X_D3DMATERIAL8* pMaterial ); + +} // end of namespace XTL #endif diff --git a/src/core/hle/D3D8/Direct3D9/RenderStates.cpp b/src/core/hle/D3D8/Direct3D9/RenderStates.cpp new file mode 100644 index 000000000..27ff00bff --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/RenderStates.cpp @@ -0,0 +1,474 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::D3DST + + +#include "RenderStates.h" +#include "Logging.h" +#include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For g_pD3DDevice +#include "core/hle/D3D8/XbConvert.h" + +bool XboxRenderStateConverter::Init() +{ + if (g_SymbolAddresses.find("D3DDeferredRenderState") != g_SymbolAddresses.end()) { + D3D__RenderState = (uint32_t*)g_SymbolAddresses["D3DDeferredRenderState"]; + } else { + return false; + } + + // At this point, D3D__RenderState points to the first Deferred render state + // Do a little magic to verify that it's correct, then count back to determine the + // start offset of the entire structure + VerifyAndFixDeferredRenderStateOffset(); + + // Now use the verified Deferred offset to derive the D3D__RenderState offset + DeriveRenderStateOffsetFromDeferredRenderStateOffset(); + + // Build a mapping of Cxbx Render State indexes to indexes within the current XDK + BuildRenderStateMappingTable(); + + // Set Initial Values + StoreInitialValues(); + + return true; +} + +bool IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo& aRenderStateInfo) +{ + bool bIsRenderStateAvailable = (aRenderStateInfo.V <= g_LibVersion_D3D8); + if (aRenderStateInfo.R > 0) { // Applies to XTL::X_D3DRS_MULTISAMPLETYPE + // Note : X_D3DRS_MULTISAMPLETYPE seems the only render state that got + // removed (from 4039 onwards), so we check that limitation here as well + bIsRenderStateAvailable &= (g_LibVersion_D3D8 < aRenderStateInfo.R); + } + return bIsRenderStateAvailable; +} + +void XboxRenderStateConverter::VerifyAndFixDeferredRenderStateOffset() +{ + DWORD CullModeOffset = g_SymbolAddresses["D3DRS_CULLMODE"]; + // If we found a valid CullMode offset, verify the symbol location + if (CullModeOffset == 0) { + EmuLog(LOG_LEVEL::WARNING, "D3DRS_CULLMODE could not be found. Please update the XbSymbolDatabase submodule"); + return; + } + + // Calculate index of D3DRS_CULLMODE for this XDK. We start counting from the first deferred state (D3DRS_FOGENABLE) + DWORD CullModeIndex = 0; + for (int i = XTL::X_D3DRS_DEFERRED_FIRST; i < XTL::X_D3DRS_CULLMODE; i++) { + auto RenderStateInfo = GetDxbxRenderStateInfo(i); + if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) { + CullModeIndex++; + } + } + + // If the offset was incorrect, calculate the correct offset, log it, and fix it + if ((DWORD)(&D3D__RenderState[CullModeIndex]) != CullModeOffset) { + DWORD CorrectOffset = CullModeOffset - (CullModeIndex * sizeof(DWORD)); + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDeferredRenderState returned by XboxSymbolDatabase (0x%08X) was incorrect. Correcting to be 0x%08X.\nPlease file an issue with the XbSymbolDatabase project", D3D__RenderState, CorrectOffset); + D3D__RenderState = (uint32_t*)CorrectOffset; + } +} + +void XboxRenderStateConverter::DeriveRenderStateOffsetFromDeferredRenderStateOffset() +{ + // When this function is called. D3D__RenderState actually points to the first deferred render state + // (this is X_D3DRS_FOGENABLE). We can count back from this using our RenderStateInfo table to find + // the start of D3D__RenderStates. + + // Count the number of render states (for this XDK) between 0 and the first deferred render state (D3DRS_FOGENABLE) + int FirstDeferredRenderStateOffset = 0; + for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState < XTL::X_D3DRS_DEFERRED_FIRST; RenderState++) { + // if the current renderstate exists in this XDK version, count it + auto RenderStateInfo = GetDxbxRenderStateInfo(RenderState); + if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) { + FirstDeferredRenderStateOffset++; + } + } + + // At this point, FirstDeferredRenderStateOffset should point to the index of D3DRS_FOGENABLE for the given XDK + // This will be correct as long as our table DxbxRenderStateInfo is correct + // We can get the correct 0 offset by using a negative index + D3D__RenderState = &D3D__RenderState[-FirstDeferredRenderStateOffset]; +} + +void XboxRenderStateConverter::BuildRenderStateMappingTable() +{ + EmuLog(LOG_LEVEL::INFO, "Building Cxbx to XDK Render State Mapping Table"); + + XboxRenderStateOffsets.fill(-1); + + int XboxIndex = 0; + for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState <= XTL::X_D3DRS_LAST; RenderState++) { + auto RenderStateInfo = GetDxbxRenderStateInfo(RenderState); + if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) { + XboxRenderStateOffsets[RenderState] = XboxIndex; + EmuLog(LOG_LEVEL::INFO, "%s = %d", RenderStateInfo.S, XboxIndex); + XboxIndex++; + continue; + } + + EmuLog(LOG_LEVEL::INFO, "%s Not Present", RenderStateInfo.S); + } +} + +void XboxRenderStateConverter::SetDirty() +{ + PreviousRenderStateValues.fill(-1); +} + +void* XboxRenderStateConverter::GetPixelShaderRenderStatePointer() +{ + return &D3D__RenderState[XTL::X_D3DRS_PS_FIRST]; +} + +bool XboxRenderStateConverter::XboxRenderStateExists(uint32_t State) +{ + if (XboxRenderStateOffsets[State] >= 0) { + return true; + } + + return false; +} + +bool XboxRenderStateConverter::XboxRenderStateValueChanged(uint32_t State) +{ + if (XboxRenderStateExists(State) && GetXboxRenderState(State) != PreviousRenderStateValues[State]) { + return true; + } + + return false; +} + +void XboxRenderStateConverter::SetXboxRenderState(uint32_t State, uint32_t Value) +{ + if (!XboxRenderStateExists(State)) { + EmuLog(LOG_LEVEL::WARNING, "Attempt to write a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", GetDxbxRenderStateInfo(State).S, g_LibVersion_D3D8); + return; + } + + D3D__RenderState[XboxRenderStateOffsets[State]] = Value; +} + +uint32_t XboxRenderStateConverter::GetXboxRenderState(uint32_t State) +{ + if (!XboxRenderStateExists(State)) { + EmuLog(LOG_LEVEL::WARNING, "Attempt to read a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", GetDxbxRenderStateInfo(State).S, g_LibVersion_D3D8); + return 0; + } + + return D3D__RenderState[XboxRenderStateOffsets[State]]; +} + +void XboxRenderStateConverter::StoreInitialValues() +{ + for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState <= XTL::X_D3DRS_LAST; RenderState++) { + // Skip Render States that don't exist within this XDK + if (!XboxRenderStateExists(RenderState)) { + continue; + } + + PreviousRenderStateValues[RenderState] = GetXboxRenderState(RenderState); + } +} + +void XboxRenderStateConverter::SetWireFrameMode(int wireframe) +{ + WireFrameMode = wireframe; + + // Wireframe mode changed, so we must force the Fill Mode renderstate to dirty + // At next call to Apply, the desired WireFrame mode will be set + PreviousRenderStateValues[XTL::X_D3DRS_FILLMODE] = -1; +} + +void XboxRenderStateConverter::Apply() +{ + // Iterate through each RenderState and set the associated host render state + // We start counting at X_D3DRS_SIMPLE_FIRST, to skip the pixel shader renderstates handled elsewhere + for (unsigned int RenderState = XTL::X_D3DRS_SIMPLE_FIRST; RenderState <= XTL::X_D3DRS_LAST; RenderState++) { + // Skip any renderstate that does not exist in the current XDK, or have not changed since the previous update call + // Also skip PSTextureModes, which is a special case used by Pixel Shaders + if (!XboxRenderStateExists(RenderState) || !XboxRenderStateValueChanged(RenderState) || RenderState == XTL::X_D3DRS_PSTEXTUREMODES) { + continue; + } + + auto Value = GetXboxRenderState(RenderState); + EmuLog(LOG_LEVEL::DEBUG, "XboxRenderStateConverter::Apply(%s, %X)\n", GetDxbxRenderStateInfo(RenderState).S, Value); + + if (RenderState <= XTL::X_D3DRS_SIMPLE_LAST) { + ApplySimpleRenderState(RenderState, Value); + } else if (RenderState <= XTL::X_D3DRS_DEFERRED_LAST) { + ApplyDeferredRenderState(RenderState, Value); + } else if (RenderState <= XTL::X_D3DRS_COMPLEX_LAST) { + ApplyComplexRenderState(RenderState, Value); + } + + PreviousRenderStateValues[RenderState] = Value; + } +} + +void XboxRenderStateConverter::ApplySimpleRenderState(uint32_t State, uint32_t Value) +{ + auto RenderStateInfo = GetDxbxRenderStateInfo(State); + + switch (State) { + case XTL::X_D3DRS_COLORWRITEENABLE: { + DWORD OrigValue = Value; + Value = 0; + + if (OrigValue & (1L << 16)) { + Value |= D3DCOLORWRITEENABLE_RED; + } + + if (OrigValue & (1L << 8)) { + Value |= D3DCOLORWRITEENABLE_GREEN; + } + + if (OrigValue & (1L << 0)) { + Value |= D3DCOLORWRITEENABLE_BLUE; + } + + if (OrigValue & (1L << 24)) { + Value |= D3DCOLORWRITEENABLE_ALPHA; + } + } break; + case XTL::X_D3DRS_SHADEMODE: + Value = EmuXB2PC_D3DSHADEMODE(Value); + break; + case XTL::X_D3DRS_BLENDOP: + Value = EmuXB2PC_D3DBLENDOP(Value); + break; + case XTL::X_D3DRS_SRCBLEND: + case XTL::X_D3DRS_DESTBLEND: + Value = EmuXB2PC_D3DBLEND(Value); + break; + case XTL::X_D3DRS_ZFUNC: + case XTL::X_D3DRS_ALPHAFUNC: + case XTL::X_D3DRS_STENCILFUNC: + Value = EmuXB2PC_D3DCMPFUNC(Value); + break; + case XTL::X_D3DRS_STENCILZFAIL: + case XTL::X_D3DRS_STENCILPASS: + Value = EmuXB2PC_D3DSTENCILOP(Value); + break; + case XTL::X_D3DRS_ALPHATESTENABLE: + if (g_LibVersion_D3D8 == 3925) { + // HACK: Many 3925 have missing polygons when this is true + // Until we find out the true underlying cause, and carry on + // Test Cases: Halo, Silent Hill 2. + LOG_TEST_CASE("Applying 3925 alpha test disable hack"); + Value = false; + } + break; + case XTL::X_D3DRS_ALPHABLENDENABLE: + case XTL::X_D3DRS_BLENDCOLOR: + case XTL::X_D3DRS_ALPHAREF: case XTL::X_D3DRS_ZWRITEENABLE: + case XTL::X_D3DRS_DITHERENABLE: case XTL::X_D3DRS_STENCILREF: + case XTL::X_D3DRS_STENCILMASK: case XTL::X_D3DRS_STENCILWRITEMASK: + // These render states require no conversion, so we simply + // allow SetRenderState to be called with no changes + break; + default: + // Only log missing state if it has a PC counterpart + if (RenderStateInfo.PC != 0) { + EmuLog(LOG_LEVEL::WARNING, "ApplySimpleRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value); + } + return; + } + + // Skip RenderStates that don't have a defined PC counterpart + if (RenderStateInfo.PC == 0) { + return; + } + + g_pD3DDevice->SetRenderState((D3DRENDERSTATETYPE)(RenderStateInfo.PC), Value); +} + +void XboxRenderStateConverter::ApplyDeferredRenderState(uint32_t State, uint32_t Value) +{ + auto RenderStateInfo = GetDxbxRenderStateInfo(State); + + // Convert from Xbox Data Formats to PC + switch (State) { + case XTL::X_D3DRS_FOGSTART: + case XTL::X_D3DRS_FOGEND: { + // HACK: If the fog start/fog-end are negative, make them positive + // This fixes Smashing Drive on non-nvidia hardware + // Cause appears to be non-nvidia drivers clamping values < 0 to 0 + // Resulting in the fog formula becoming (0 - d) / 0, which breaks rendering + // This prevents that scenario for screen-space fog, *hopefully* without breaking eye-based fog also + float fogValue = *(float*)& Value; + if (fogValue < 0.0f) { + LOG_TEST_CASE("FOGSTART/FOGEND below 0"); + fogValue = std::abs(fogValue); + Value = *(DWORD*)& fogValue; + } + } break; + case XTL::X_D3DRS_FOGENABLE: + if (g_LibVersion_D3D8 == 3925) { + // HACK: Many 3925 games only show a black screen if fog is enabled + // Initially, this was thought to be bad offsets, but it has been verified to be correct + // Until we find out the true underlying cause, disable fog and carry on + // Test Cases: Halo, Silent Hill 2. + LOG_TEST_CASE("Applying 3925 fog disable hack"); + Value = false; + } + break; + case XTL::X_D3DRS_FOGTABLEMODE: + case XTL::X_D3DRS_FOGDENSITY: + case XTL::X_D3DRS_RANGEFOGENABLE: + case XTL::X_D3DRS_LIGHTING: + case XTL::X_D3DRS_SPECULARENABLE: + case XTL::X_D3DRS_LOCALVIEWER: + case XTL::X_D3DRS_COLORVERTEX: + case XTL::X_D3DRS_SPECULARMATERIALSOURCE: + case XTL::X_D3DRS_DIFFUSEMATERIALSOURCE: + case XTL::X_D3DRS_AMBIENTMATERIALSOURCE: + case XTL::X_D3DRS_EMISSIVEMATERIALSOURCE: + case XTL::X_D3DRS_AMBIENT: + case XTL::X_D3DRS_POINTSIZE: + case XTL::X_D3DRS_POINTSIZE_MIN: + case XTL::X_D3DRS_POINTSPRITEENABLE: + case XTL::X_D3DRS_POINTSCALEENABLE: + case XTL::X_D3DRS_POINTSCALE_A: + case XTL::X_D3DRS_POINTSCALE_B: + case XTL::X_D3DRS_POINTSCALE_C: + case XTL::X_D3DRS_POINTSIZE_MAX: + case XTL::X_D3DRS_PATCHEDGESTYLE: + case XTL::X_D3DRS_PATCHSEGMENTS: + // These render states require no conversion, so we can use them as-is + break; + case XTL::X_D3DRS_BACKSPECULARMATERIALSOURCE: + case XTL::X_D3DRS_BACKDIFFUSEMATERIALSOURCE: + case XTL::X_D3DRS_BACKAMBIENTMATERIALSOURCE: + case XTL::X_D3DRS_BACKEMISSIVEMATERIALSOURCE: + case XTL::X_D3DRS_BACKAMBIENT: + case XTL::X_D3DRS_SWAPFILTER: + // These states are unsupported by the host and are ignored (for now) + return; + case XTL::X_D3DRS_PRESENTATIONINTERVAL: { + // Store this as an override for our frame limiter + // Games can use this to limit certain scenes to a desired target framerate for a specific scene + // If this value is not set, or is set to 0, the default interval passed to CreateDevice is used + extern DWORD g_Xbox_PresentationInterval_Override; + g_Xbox_PresentationInterval_Override = Value; + } return; + case XTL::X_D3DRS_WRAP0: + case XTL::X_D3DRS_WRAP1: + case XTL::X_D3DRS_WRAP2: + case XTL::X_D3DRS_WRAP3: { + DWORD OldValue = Value; + Value = 0; + + Value |= (OldValue & 0x00000010) ? D3DWRAPCOORD_0 : 0; + Value |= (OldValue & 0x00001000) ? D3DWRAPCOORD_1 : 0; + Value |= (OldValue & 0x00100000) ? D3DWRAPCOORD_2 : 0; + Value |= (OldValue & 0x01000000) ? D3DWRAPCOORD_3 : 0; + } break; + default: + // Only log missing state if it has a PC counterpart + if (RenderStateInfo.PC != 0) { + EmuLog(LOG_LEVEL::WARNING, "ApplyDeferredRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value); + } + return; + } + + // Skip RenderStates that don't have a defined PC counterpart + if (RenderStateInfo.PC == 0) { + return; + } + + g_pD3DDevice->SetRenderState(RenderStateInfo.PC, Value); +} + +void XboxRenderStateConverter::ApplyComplexRenderState(uint32_t State, uint32_t Value) +{ + auto RenderStateInfo = GetDxbxRenderStateInfo(State); + + switch (State) { + case XTL::X_D3DRS_VERTEXBLEND: + // convert from Xbox direct3d to PC direct3d enumeration + if (Value <= 1) { + Value = Value; + } else if (Value == 3) { + Value = 2; + } else if (Value == 5) { + Value = 3; + } else { + LOG_TEST_CASE("Unsupported D3DVERTEXBLENDFLAGS (%d)"); + return; + } + break; + case XTL::X_D3DRS_FILLMODE: + Value = EmuXB2PC_D3DFILLMODE(Value); + + if (WireFrameMode > 0) { + if (WireFrameMode == 1) { + Value = D3DFILL_WIREFRAME; + } else { + Value = D3DFILL_POINT; + } + } + break; + case XTL::X_D3DRS_CULLMODE: + switch (Value) { + case XTL::X_D3DCULL_NONE: Value = D3DCULL_NONE; break; + case XTL::X_D3DCULL_CW: Value = D3DCULL_CW; break; + case XTL::X_D3DCULL_CCW: Value = D3DCULL_CCW;break; + default: LOG_TEST_CASE("EmuD3DDevice_SetRenderState_CullMode: Unknown Cullmode"); + } + break; + case XTL::X_D3DRS_ZBIAS: { + FLOAT Biased = static_cast(Value) * -0.000005f; + Value = *reinterpret_cast(&Biased); + } break; + // These states require no conversions, so can just be passed through to the host directly + case XTL::X_D3DRS_FOGCOLOR: + case XTL::X_D3DRS_NORMALIZENORMALS: + case XTL::X_D3DRS_ZENABLE: + case XTL::X_D3DRS_STENCILENABLE: + case XTL::X_D3DRS_STENCILFAIL: + case XTL::X_D3DRS_TEXTUREFACTOR: + case XTL::X_D3DRS_EDGEANTIALIAS: + case XTL::X_D3DRS_MULTISAMPLEANTIALIAS: + case XTL::X_D3DRS_MULTISAMPLEMASK: + break; + default: + // Only log missing state if it has a PC counterpart + if (RenderStateInfo.PC != 0) { + EmuLog(LOG_LEVEL::WARNING, "ApplyComplexRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value); + } + return; + } + + // Skip RenderStates that don't have a defined PC counterpart + if (RenderStateInfo.PC == 0) { + return; + } + + g_pD3DDevice->SetRenderState(RenderStateInfo.PC, Value); +} diff --git a/src/core/hle/D3D8/Direct3D9/RenderStates.h b/src/core/hle/D3D8/Direct3D9/RenderStates.h new file mode 100644 index 000000000..548772880 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/RenderStates.h @@ -0,0 +1,66 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include +#include +#include "EmuShared.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "core\hle\Intercept.hpp" +#include "core\hle\D3D8\XbD3D8Types.h" + +class XboxRenderStateConverter +{ +public: + bool Init(); + void Apply(); + + void* GetPixelShaderRenderStatePointer(); + + bool XboxRenderStateExists(uint32_t state); + void SetXboxRenderState(uint32_t State, uint32_t Value); + void SetWireFrameMode(int mode); + void SetDirty(); + uint32_t GetXboxRenderState(uint32_t State); +private: + void VerifyAndFixDeferredRenderStateOffset(); + void DeriveRenderStateOffsetFromDeferredRenderStateOffset(); + void StoreInitialValues(); + void BuildRenderStateMappingTable(); + + bool XboxRenderStateValueChanged(uint32_t State); + + void ApplySimpleRenderState(uint32_t State, uint32_t Value); + void ApplyDeferredRenderState(uint32_t State, uint32_t Value); + void ApplyComplexRenderState(uint32_t State, uint32_t Value); + + uint32_t* D3D__RenderState = nullptr; + int WireFrameMode = 0; + // NOTE: RenderStates are 32bit values, but using a 64bit value allows the upper bits to be used as a 'force dirty' flag + std::array PreviousRenderStateValues; + std::array XboxRenderStateOffsets; +}; diff --git a/src/core/hle/D3D8/Direct3D9/TextureStates.cpp b/src/core/hle/D3D8/Direct3D9/TextureStates.cpp new file mode 100644 index 000000000..c6b034c3e --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/TextureStates.cpp @@ -0,0 +1,275 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::D3DST + +#include "TextureStates.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "Logging.h" +#include "EmuShared.h" +#include "core/hle/Intercept.hpp" +#include "RenderStates.h" +#include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For g_pD3DDevice + +typedef struct { + char* S; // String representation. + bool IsSamplerState; // True if the state maps to a Sampler State instead of Texture Stage + DWORD PC; // PC Index +} TextureStateInfo; + +TextureStateInfo CxbxTextureStateInfo[] = { + { "D3DTSS_ADDRESSU", true, D3DSAMP_ADDRESSU }, + { "D3DTSS_ADDRESSV", true, D3DSAMP_ADDRESSV }, + { "D3DTSS_ADDRESSW", true, D3DSAMP_ADDRESSW }, + { "D3DTSS_MAGFILTER", true, D3DSAMP_MAGFILTER }, + { "D3DTSS_MINFILTER", true, D3DSAMP_MINFILTER }, + { "D3DTSS_MIPFILTER", true, D3DSAMP_MIPFILTER }, + { "D3DTSS_MIPMAPLODBIAS", true, D3DSAMP_MIPMAPLODBIAS }, + { "D3DTSS_MAXMIPLEVEL", true, D3DSAMP_MAXMIPLEVEL }, + { "D3DTSS_MAXANISOTROPY", true, D3DSAMP_MAXANISOTROPY }, + { "D3DTSS_COLORKEYOP", false, 0 }, + { "D3DTSS_COLORSIGN", false, 0 }, + { "D3DTSS_ALPHAKILL", false, 0 }, + { "D3DTSS_COLOROP", false, D3DTSS_COLOROP }, + { "D3DTSS_COLORARG0", false, D3DTSS_COLORARG0 }, + { "D3DTSS_COLORARG1", false, D3DTSS_COLORARG1 }, + { "D3DTSS_COLORARG2", false, D3DTSS_COLORARG2 }, + { "D3DTSS_ALPHAOP", false, D3DTSS_ALPHAOP }, + { "D3DTSS_ALPHAARG0", false, D3DTSS_ALPHAARG0 }, + { "D3DTSS_ALPHAARG1", false, D3DTSS_ALPHAARG1 }, + { "D3DTSS_ALPHAARG2", false, D3DTSS_ALPHAARG2 }, + { "D3DTSS_RESULTARG", false, D3DTSS_RESULTARG }, + { "D3DTSS_TEXTURETRANSFORMFLAGS", false, D3DTSS_TEXTURETRANSFORMFLAGS }, + { "D3DTSS_BUMPENVMAT00", false, D3DTSS_BUMPENVMAT00 }, + { "D3DTSS_BUMPENVMAT01", false, D3DTSS_BUMPENVMAT01 }, + { "D3DTSS_BUMPENVMAT11", false, D3DTSS_BUMPENVMAT11 }, + { "D3DTSS_BUMPENVMAT10", false, D3DTSS_BUMPENVMAT10 }, + { "D3DTSS_BUMPENVLSCALE", false, D3DTSS_BUMPENVLSCALE }, + { "D3DTSS_BUMPENVLOFFSET", false, D3DTSS_BUMPENVLOFFSET }, + { "D3DTSS_TEXCOORDINDEX", false, D3DTSS_TEXCOORDINDEX }, + { "D3DTSS_BORDERCOLOR", true, D3DSAMP_BORDERCOLOR }, + { "D3DTSS_COLORKEYCOLOR", false, 0 }, +}; + +bool XboxTextureStateConverter::Init(XboxRenderStateConverter* pState) +{ + // Deferred states start at 0, this menas that D3DDeferredTextureState IS D3D__TextureState + // No further works is required to derive the offset + if (g_SymbolAddresses.find("D3DDeferredTextureState") != g_SymbolAddresses.end()) { + D3D__TextureState = (uint32_t*)g_SymbolAddresses["D3DDeferredTextureState"]; + } else { + return false; + } + + // Build a mapping of Cxbx Texture State indexes to indexes within the current XDK + BuildTextureStateMappingTable(); + + // Store a handle to the Xbox Render State manager + // This is used to check for Point Sprites + pXboxRenderStates = pState; + + return true; +} + +void XboxTextureStateConverter::BuildTextureStateMappingTable() +{ + EmuLog(LOG_LEVEL::INFO, "Building Cxbx to XDK Texture State Mapping Table"); + for (int State = XTL::X_D3DTSS_FIRST; State <= XTL::X_D3DTSS_LAST; State++) { + int index = State; + + // On early XDKs, we need to shuffle the values around a little + // TODO: Verify which XDK version this change occurred at + // Values range 0-9 (D3DTSS_COLOROP to D3DTSS_TEXTURETRANSFORMFLAGS) become 12-21 + // Values 10-21 (D3DTSS_ADDRESSU to D3DTSS_ALPHAKILL) become 0-11 + bool bOldOrder = g_LibVersion_D3D8 <= 3948; // Verfied old order in 3944, new order in 4039 + if (bOldOrder) { + if (State <= 9) { + index += 12; + } else if (State <= 21) { + index -= 10; + } + } + + EmuLog(LOG_LEVEL::INFO, "%s = %d", CxbxTextureStateInfo[State].S, index); + XboxTextureStateOffsets[State] = index; + } +} + +DWORD XboxTextureStateConverter::GetHostTextureOpValue(DWORD Value) +{ + bool bOldOrder = g_LibVersion_D3D8 <= 3948; // Verified old order in 3944, new order in 4039 + switch (Value) { + case XTL::X_D3DTOP_DISABLE: return D3DTOP_DISABLE; + case XTL::X_D3DTOP_SELECTARG1: return D3DTOP_SELECTARG1; + case XTL::X_D3DTOP_SELECTARG2: return D3DTOP_SELECTARG2; + case XTL::X_D3DTOP_MODULATE: return D3DTOP_MODULATE; + case XTL::X_D3DTOP_MODULATE2X: return D3DTOP_MODULATE2X; + case XTL::X_D3DTOP_MODULATE4X: return D3DTOP_MODULATE4X; + case XTL::X_D3DTOP_ADD: return D3DTOP_ADD; + case XTL::X_D3DTOP_ADDSIGNED: return D3DTOP_ADDSIGNED; + case XTL::X_D3DTOP_ADDSIGNED2X: return D3DTOP_ADDSIGNED2X; + case XTL::X_D3DTOP_SUBTRACT: return D3DTOP_SUBTRACT; + case XTL::X_D3DTOP_ADDSMOOTH: return D3DTOP_ADDSMOOTH; + case XTL::X_D3DTOP_BLENDDIFFUSEALPHA: return D3DTOP_BLENDDIFFUSEALPHA; + case 0x0D/*XTL::X_D3DTOP_BLENDCURRENTALPHA */: return bOldOrder ? D3DTOP_BLENDTEXTUREALPHA : D3DTOP_BLENDCURRENTALPHA; + case 0x0E/*XTL::X_D3DTOP_BLENDTEXTUREALPHA */: return bOldOrder ? D3DTOP_BLENDFACTORALPHA : D3DTOP_BLENDTEXTUREALPHA; + case 0x0F/*XTL::X_D3DTOP_BLENDFACTORALPHA */: return bOldOrder ? D3DTOP_BLENDTEXTUREALPHAPM : D3DTOP_BLENDFACTORALPHA; + case 0x10/*XTL::X_D3DTOP_BLENDTEXTUREALPHAPM*/: return bOldOrder ? D3DTOP_BLENDCURRENTALPHA : D3DTOP_BLENDTEXTUREALPHAPM; + case XTL::X_D3DTOP_PREMODULATE: return D3DTOP_PREMODULATE; + case XTL::X_D3DTOP_MODULATEALPHA_ADDCOLOR: return D3DTOP_MODULATEALPHA_ADDCOLOR; + case XTL::X_D3DTOP_MODULATECOLOR_ADDALPHA: return D3DTOP_MODULATECOLOR_ADDALPHA; + case XTL::X_D3DTOP_MODULATEINVALPHA_ADDCOLOR: return D3DTOP_MODULATEINVALPHA_ADDCOLOR; + case XTL::X_D3DTOP_MODULATEINVCOLOR_ADDALPHA: return D3DTOP_MODULATEINVCOLOR_ADDALPHA; + case XTL::X_D3DTOP_DOTPRODUCT3: return D3DTOP_DOTPRODUCT3; + case XTL::X_D3DTOP_MULTIPLYADD: return D3DTOP_MULTIPLYADD; + case XTL::X_D3DTOP_LERP: return D3DTOP_LERP; + case XTL::X_D3DTOP_BUMPENVMAP: return D3DTOP_BUMPENVMAP; + case XTL::X_D3DTOP_BUMPENVMAPLUMINANCE: return D3DTOP_BUMPENVMAPLUMINANCE; + } + + EmuLog(LOG_LEVEL::WARNING, "Unsupported D3DTOP Value (%d)", Value); + return D3DTOP_DISABLE; + +} + +void XboxTextureStateConverter::Apply() +{ + // Iterate through all texture states/stages + + // Track if we need to overwrite state 0 with 3 because of Point Sprites + // The Xbox NV2A uses only Stage 3 for point-sprites, so we emulate this + // by mapping Stage 3 to Stage 0, and disabling all stages > 0 + bool pointSpriteOverride = false; + bool pointSpritesEnabled = pXboxRenderStates->GetXboxRenderState(XTL::X_D3DRS_POINTSPRITEENABLE); + if (pointSpritesEnabled) { + pointSpriteOverride = true; + } + + for (int XboxStage = 0; XboxStage < XTL::X_D3DTS_STAGECOUNT; XboxStage++) { + // If point sprites are enabled, we need to overwrite our existing state 0 with State 3 also + DWORD HostStage = (pointSpriteOverride && XboxStage == 3) ? 0 : XboxStage; + + for (int StateIndex = XTL::X_D3DTSS_FIRST; StateIndex <= XTL::X_D3DTSS_LAST; StateIndex++) { + // Read the value of the current stage/state from the Xbox data structure + DWORD Value = D3D__TextureState[(XboxStage * XTL::X_D3DTS_STAGESIZE) + StateIndex]; + + // Convert the index of the current state to an index that we can use + // This handles the case when XDKs have different state values + DWORD State = XboxTextureStateOffsets[StateIndex]; + + switch (State) { + // These types map 1:1 but have some unsupported values + case XTL::X_D3DTSS_ADDRESSU: case XTL::X_D3DTSS_ADDRESSV: case XTL::X_D3DTSS_ADDRESSW: + if (Value == XTL::X_D3DTADDRESS_CLAMPTOEDGE) { + EmuLog(LOG_LEVEL::WARNING, "D3DTADDRESS_CLAMPTOEDGE is unsupported"); + // D3DTADDRESS_BORDER is the closest host match, CLAMPTOEDGE is identical + // Except it has additional restrictions. + Value = D3DTADDRESS_BORDER; + break; + } + break; + case XTL::X_D3DTSS_MAGFILTER: case XTL::X_D3DTSS_MINFILTER: case XTL::X_D3DTSS_MIPFILTER: + if (Value == XTL::X_D3DTEXF_QUINCUNX) { + EmuLog(LOG_LEVEL::WARNING, "D3DTEXF_QUINCUNX is unsupported"); + // Fallback to D3DTEXF_ANISOTROPIC + Value = D3DTEXF_ANISOTROPIC; + break; + } + break; + case XTL::X_D3DTSS_TEXCOORDINDEX: + switch (Value) { + case 0x00040000: + // This value is TCI_OBJECT on Xbox,which is not supported by the host + // In this case, we reset to 0. + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDevice_SetTextureState_TexCoordIndex: D3DTSS_TCI_OBJECT is unsupported", Value); + Value = 0; + break; + case 0x00050000: + // This value is TCI_SPHERE on Xbox, let's map it to D3DTSS_TCI_SPHEREMAP for the host + Value = D3DTSS_TCI_SPHEREMAP; + break; + } + break; + // These types require value remapping for all supported values + case XTL::X_D3DTSS_COLOROP: case XTL::X_D3DTSS_ALPHAOP: + Value = GetHostTextureOpValue(Value); + break; + // These types require no conversion, so we just pass through as-is + case XTL::X_D3DTSS_COLORARG0: case XTL::X_D3DTSS_COLORARG1: case XTL::X_D3DTSS_COLORARG2: + case XTL::X_D3DTSS_ALPHAARG0: case XTL::X_D3DTSS_ALPHAARG1: case XTL::X_D3DTSS_ALPHAARG2: + case XTL::X_D3DTSS_RESULTARG: case XTL::X_D3DTSS_TEXTURETRANSFORMFLAGS: + case XTL::X_D3DTSS_BUMPENVMAT00: case XTL::X_D3DTSS_BUMPENVMAT01: + case XTL::X_D3DTSS_BUMPENVMAT11: case XTL::X_D3DTSS_BUMPENVMAT10: + case XTL::X_D3DTSS_BUMPENVLSCALE: case XTL::X_D3DTSS_BUMPENVLOFFSET: + case XTL::X_D3DTSS_BORDERCOLOR: case XTL::X_D3DTSS_MIPMAPLODBIAS: + case XTL::X_D3DTSS_MAXMIPLEVEL: case XTL::X_D3DTSS_MAXANISOTROPY: + break; + default: + // Only log missing state if it has a PC counterpart + if (CxbxTextureStateInfo[State].PC != 0) { + EmuLog(LOG_LEVEL::WARNING, "XboxTextureStateConverter::Apply(%s, 0x%.08X) is unimplemented!", CxbxTextureStateInfo[State].S, Value); + } + break; + } + + // Skip Texture States that don't have a defined PC counterpart + if (CxbxTextureStateInfo[State].PC == 0) { + continue; + } + + if (CxbxTextureStateInfo[State].IsSamplerState) { + g_pD3DDevice->SetSamplerState(HostStage, (D3DSAMPLERSTATETYPE)CxbxTextureStateInfo[State].PC, Value); + } else { + g_pD3DDevice->SetTextureStageState(HostStage, (D3DTEXTURESTAGESTATETYPE)CxbxTextureStateInfo[State].PC, Value); + } + } + + // Make sure we only do this once + if (pointSpriteOverride && XboxStage == 3) { + pointSpriteOverride = false; + XboxStage--; + } + } + + if (pointSpritesEnabled) { + IDirect3DBaseTexture* pTexture; + + // set the point sprites texture + g_pD3DDevice->GetTexture(3, &pTexture); + g_pD3DDevice->SetTexture(0, pTexture); + + // Avoid a dangling reference that would lead to a memory leak + if (pTexture != nullptr) + pTexture->Release(); + + // disable all other stages + g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); + g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); + + // no need to actually copy here, since it was handled in the loop above + } +} diff --git a/src/Common/CxbxUtil.h b/src/core/hle/D3D8/Direct3D9/TextureStates.h similarity index 57% rename from src/Common/CxbxUtil.h rename to src/core/hle/D3D8/Direct3D9/TextureStates.h index 389fd160b..a79444bac 100644 --- a/src/Common/CxbxUtil.h +++ b/src/core/hle/D3D8/Direct3D9/TextureStates.h @@ -1,51 +1,49 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef CXBXUTIL_H -#define CXBXUTIL_H - -#include "Cxbx.h" - -/*! round dwValue to the nearest multiple of dwMult */ -static uint32 RoundUp(uint32 dwValue, uint32 dwMult) -{ - if(dwMult == 0) { return dwValue; } - - int remainder = dwValue % dwMult; - if (remainder == 0) - return dwValue; - - return dwValue + dwMult - remainder; -} - -#endif +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include +#include +#include "core\hle\D3D8\XbD3D8Types.h" + +#define CXBX_D3DRS_UNSUPPORTED (XTL::X_D3DRS_LAST + 1) + +class XboxRenderStateConverter; + +class XboxTextureStateConverter +{ +public: + bool Init(XboxRenderStateConverter* state); + void Apply(); + +private: + void BuildTextureStateMappingTable(); + DWORD GetHostTextureOpValue(DWORD XboxTextureOp); + + uint32_t* D3D__TextureState = nullptr; + std::array XboxTextureStateOffsets; + XboxRenderStateConverter* pXboxRenderStates; +}; diff --git a/src/core/hle/D3D8/Direct3D9/VertexShader.cpp b/src/core/hle/D3D8/Direct3D9/VertexShader.cpp new file mode 100644 index 000000000..acbc31b72 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/VertexShader.cpp @@ -0,0 +1,319 @@ +#define LOG_PREFIX CXBXR_MODULE::VTXSH + +#include "VertexShader.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" + +#include + +extern const char* g_vs_model = vs_model_3_0; + +// HLSL generation +void OutputHlsl(std::stringstream& hlsl, VSH_IMD_OUTPUT& dest) +{ + static const char* OReg_Name[/*VSH_OREG_NAME*/] = { + "oPos", + "???", + "???", + "oD0", + "oD1", + "oFog", + "oPts", + "oB0", + "oB1", + "oT0", + "oT1", + "oT2", + "oT3", + "???", + "???", + "a0.x" + }; + + switch (dest.Type) { + case IMD_OUTPUT_C: + // Access the HLSL capital C[] constants array, with the index bias applied : + // TODO : Avoid out-of-bound writes (perhaps writing to a reserved index?) + hlsl << "C[" << dest.Address + X_D3DSCM_CORRECTION << "]"; + LOG_TEST_CASE("Vertex shader writes to constant table"); + break; + case IMD_OUTPUT_R: + hlsl << "r" << dest.Address; + break; + case IMD_OUTPUT_O: + assert(dest.Address < OREG_A0X); + hlsl << OReg_Name[dest.Address]; + break; + case IMD_OUTPUT_A0X: + hlsl << "a0"; + break; + default: + assert(false); + break; + } + + // Write the mask as a separate argument to the opcode defines + // (No space, so that "dest,mask, ..." looks close to "dest.mask, ...") + hlsl << ","; + if (dest.Mask & MASK_X) hlsl << "x"; + if (dest.Mask & MASK_Y) hlsl << "y"; + if (dest.Mask & MASK_Z) hlsl << "z"; + if (dest.Mask & MASK_W) hlsl << "w"; +} + +void ParameterHlsl(std::stringstream& hlsl, VSH_IMD_PARAMETER& param, bool IndexesWithA0_X) +{ + static char* RegisterName[/*VSH_PARAMETER_TYPE*/] = { + "?", // PARAM_UNKNOWN = 0, + "r", // PARAM_R, // Temporary (scRatch) registers + "v", // PARAM_V, // Vertex registers + "c", // PARAM_C, // Constant registers, set by SetVertexShaderConstant + "oPos" // PARAM_O // = 0?? + }; + + if (param.Neg) { + hlsl << "-"; + } + + if (param.ParameterType == PARAM_C) { + // Access constant registers through our HLSL c() function, + // which allows dumping negative indices (like Xbox shaders), + // and which returns zero when out-of-bounds indices are passed in: + if (IndexesWithA0_X) { + if (param.Address == 0) { + hlsl << "c(a0.x)"; // Hide the offset if it's 0 + } + else if (param.Address < 0) { + hlsl << "c(a0.x" << param.Address << ")"; // minus is part of the offset + } + else { + hlsl << "c(a0.x+" << param.Address << ")"; // show addition character + } + } + else { + hlsl << "c(" << param.Address << ")"; + } + } + else { + hlsl << RegisterName[param.ParameterType] << param.Address; + } + + // Write the swizzle if we need to + // Only bother printing the swizzle if it is not the default .xyzw + if (!(param.Swizzle[0] == SWIZZLE_X && + param.Swizzle[1] == SWIZZLE_Y && + param.Swizzle[2] == SWIZZLE_Z && + param.Swizzle[3] == SWIZZLE_W)) { + // We'll try to simplify swizzles if we can + // If all swizzles are the same, we only need to write one out + unsigned swizzles = 1; + + // Otherwise, we need to use the full swizzle + if (param.Swizzle[0] != param.Swizzle[1] || + param.Swizzle[0] != param.Swizzle[2] || + param.Swizzle[0] != param.Swizzle[3]) { + // Note, we can't remove trailing repeats, like in VS asm, + // as it may change the type from float4 to float3, float2 or float1! + swizzles = 4; + } + + hlsl << "."; + for (unsigned i = 0; i < swizzles; i++) { + hlsl << "xyzw"[param.Swizzle[i]]; + } + } +} + +void BuildShader(IntermediateVertexShader* pShader, std::stringstream& hlsl) +{ + // HLSL strings for all MAC opcodes, indexed with VSH_MAC + static std::string VSH_MAC_HLSL[/*VSH_MAC*/] = { + /*MAC_NOP:*/"", + /*MAC_MOV:*/"x_mov", + /*MAC_MUL:*/"x_mul", + /*MAC_ADD:*/"x_add", + /*MAC_MAD:*/"x_mad", + /*MAC_DP3:*/"x_dp3", + /*MAC_DPH:*/"x_dph", + /*MAC_DP4:*/"x_dp4", + /*MAC_DST:*/"x_dst", + /*MAC_MIN:*/"x_min", + /*MAC_MAX:*/"x_max", + /*MAC_SLT:*/"x_slt", + /*MAC_SGE:*/"x_sge", + /*MAC_ARL:*/"x_arl", + "", + "" // VSH_MAC 2 final values of the 4 bits are undefined/unknown TODO : Investigate their effect (if any) and emulate that as well + }; + + // HLSL strings for all ILU opcodes, indexed with VSH_ILU + static std::string VSH_ILU_HLSL[/*VSH_ILU*/] = { + /*ILU_NOP:*/"", + /*ILU_MOV:*/"x_mov", + /*ILU_RCP:*/"x_rcp", + /*ILU_RCC:*/"x_rcc", + /*ILU_RSQ:*/"x_rsq", + /*ILU_EXP:*/"x_expp", + /*ILU_LOG:*/"x_logp", + /*ILU_LIT:*/"x_lit" // = 7 - all values of the 3 bits are used + }; + + for (int i = 0; i < pShader->Instructions.size(); i++) { + VSH_INTERMEDIATE_FORMAT& IntermediateInstruction = pShader->Instructions[i]; + + std::string str; + if (IntermediateInstruction.MAC > MAC_NOP) { + str = VSH_MAC_HLSL[IntermediateInstruction.MAC]; + } + else { + str = VSH_ILU_HLSL[IntermediateInstruction.ILU]; + } + + hlsl << "\n " << str << "("; // opcode + OutputHlsl(hlsl, IntermediateInstruction.Output); + for (unsigned i = 0; i < IntermediateInstruction.ParamCount; i++) { + hlsl << ", "; + ParameterHlsl(hlsl, IntermediateInstruction.Parameters[i], IntermediateInstruction.IndexesWithA0_X); + } + + hlsl << ");"; + } +} + +std::string DebugPrependLineNumbers(std::string shaderString) { + std::stringstream shader(shaderString); + auto debugShader = std::stringstream(); + + int i = 1; + for (std::string line; std::getline(shader, line); ) { + auto lineNumber = std::to_string(i++); + auto paddedLineNumber = lineNumber.insert(0, 3 - lineNumber.size(), ' '); + debugShader << "/* " << paddedLineNumber << " */ " << line << "\n"; + } + + return debugShader.str(); +} + + +extern ShaderType EmuGetShaderInfo(IntermediateVertexShader* pIntermediateShader) { + + if (pIntermediateShader->Instructions.size() == 0) { + // Do not attempt to compile empty shaders + // This is a declaration only shader, so there is no function to compile + return ShaderType::Empty; + } + + switch (pIntermediateShader->Header.Version) { + case VERSION_XVS: + break; + case VERSION_XVSS: + LOG_TEST_CASE("Might not support vertex state shaders?"); + break; + case VERSION_XVSW: + EmuLog(LOG_LEVEL::WARNING, "Might not support vertex read/write shaders?"); + return ShaderType::Unsupported; + default: + EmuLog(LOG_LEVEL::WARNING, "Unknown vertex shader version 0x%02X", pIntermediateShader->Header.Version); + return ShaderType::Unsupported; + } + + return ShaderType::Compilable; +} + +// recompile xbox vertex shader function +extern HRESULT EmuCompileShader +( + IntermediateVertexShader* pIntermediateShader, + ID3DBlob** ppHostShader +) +{ + // TODO include header in vertex shader + //XTL::X_VSH_SHADER_HEADER* pXboxVertexShaderHeader = (XTL::X_VSH_SHADER_HEADER*)pXboxFunction; + ID3DBlob* pErrors = nullptr; + HRESULT hRet = 0; + + // Include HLSL header and footer as raw strings : + static std::string hlsl_template[2] = { + #include "core\hle\D3D8\Direct3D9\CxbxVertexShaderTemplate.hlsl" + }; + + auto hlsl_stream = std::stringstream(); + hlsl_stream << hlsl_template[0]; // Start with the HLSL template header + assert(pIntermediateShader->Instructions.size() > 0); + BuildShader(pIntermediateShader, hlsl_stream); + + hlsl_stream << hlsl_template[1]; // Finish with the HLSL template footer + std::string hlsl_str = hlsl_stream.str(); + + EmuLog(LOG_LEVEL::DEBUG, "--- HLSL conversion ---"); + EmuLog(LOG_LEVEL::DEBUG, DebugPrependLineNumbers(hlsl_str).c_str()); + EmuLog(LOG_LEVEL::DEBUG, "-----------------------"); + + + UINT flags1 = D3DCOMPILE_OPTIMIZATION_LEVEL3 | D3DCOMPILE_AVOID_FLOW_CONTROL; + + hRet = D3DCompile( + hlsl_str.c_str(), + hlsl_str.length(), + nullptr, // pSourceName + nullptr, // pDefines + nullptr, // pInclude // TODO precompile x_* HLSL functions? + "main", // shader entry poiint + g_vs_model, // shader profile + flags1, // flags1 + 0, // flags2 + ppHostShader, // out + &pErrors // ppErrorMsgs out + ); + if (FAILED(hRet)) { + // Attempt to retry in compatibility mode, this allows some vertex-state shaders to compile + // Test Case: Spy vs Spy + flags1 |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; + hRet = D3DCompile( + hlsl_str.c_str(), + hlsl_str.length(), + nullptr, // pSourceName + nullptr, // pDefines + nullptr, // pInclude // TODO precompile x_* HLSL functions? + "main", // shader entry poiint + g_vs_model, // shader profile + flags1, // flags1 + 0, // flags2 + ppHostShader, // out + &pErrors // ppErrorMsgs out + ); + + if (FAILED(hRet)) { + LOG_TEST_CASE("Couldn't assemble recompiled vertex shader"); + //EmuLog(LOG_LEVEL::WARNING, "Couldn't assemble recompiled vertex shader"); + } + } + + // Determine the log level + auto hlslErrorLogLevel = FAILED(hRet) ? LOG_LEVEL::ERROR2 : LOG_LEVEL::DEBUG; + if (pErrors) { + // Log HLSL compiler errors + EmuLog(hlslErrorLogLevel, "%s", (char*)(pErrors->GetBufferPointer())); + pErrors->Release(); + pErrors = nullptr; + } + + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) + if (g_bPrintfOn) + if (!FAILED(hRet)) { + // Log disassembly + hRet = D3DDisassemble( + (*ppHostShader)->GetBufferPointer(), + (*ppHostShader)->GetBufferSize(), + D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS | D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING, + NULL, + &pErrors + ); + if (pErrors) { + EmuLog(hlslErrorLogLevel, "%s", (char*)(pErrors->GetBufferPointer())); + pErrors->Release(); + } + } + + return hRet; +} diff --git a/src/core/hle/D3D8/Direct3D9/VertexShader.h b/src/core/hle/D3D8/Direct3D9/VertexShader.h new file mode 100644 index 000000000..3e02ff0b5 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/VertexShader.h @@ -0,0 +1,25 @@ + +#ifndef DIRECT3D9VERTEXSHADER_H +#define DIRECT3D9VERTEXSHADER_H + +#include "core\hle\D3D8\XbVertexShader.h" + +enum class ShaderType { + Empty = 0, + Compilable, + Unsupported, +}; + +static const char* vs_model_2_a = "vs_2_a"; +static const char* vs_model_3_0 = "vs_3_0"; +extern const char* g_vs_model; + +extern ShaderType EmuGetShaderInfo(IntermediateVertexShader* pIntermediateShader); + +extern HRESULT EmuCompileShader +( + IntermediateVertexShader* pIntermediateShader, + ID3DBlob** ppHostShader +); + +#endif diff --git a/src/core/hle/D3D8/Direct3D9/VertexShaderSource.cpp b/src/core/hle/D3D8/Direct3D9/VertexShaderSource.cpp new file mode 100644 index 000000000..c6aa69170 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/VertexShaderSource.cpp @@ -0,0 +1,172 @@ +#define LOG_PREFIX CXBXR_MODULE::VSHCACHE + +#include "VertexShaderSource.h" + +#include "Logging.h" +#include "util/hasher.h" +#include "core/kernel/support/Emu.h" + +ID3DBlob* AsyncCreateVertexShader(IntermediateVertexShader intermediateShader, ShaderKey key) { + // HACK set thread affinity every call to reduce interference with Xbox main thread + // TODO use a thread pool library for better control over workers + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + + ID3DBlob* pCompiledShader; + + auto hRet = EmuCompileShader( + &intermediateShader, + &pCompiledShader + ); + + EmuLog(LOG_LEVEL::DEBUG, "Finished compiling shader %llx", key); + + return pCompiledShader; +} + +// Find a shader +// Return true if the shader was found + bool VertexShaderSource::_FindShader(ShaderKey key, LazyVertexShader** ppLazyShader) { + auto it = cache.find(key); + if (it == cache.end()) { + // We didn't find anything! Was CreateShader called? + EmuLog(LOG_LEVEL::WARNING, "No vertex shader found for key %llx", key); + return false; + } + + *ppLazyShader = &it->second; + return true; +} + + // Create a new shader + // If the shader was already created, just increase its reference count +ShaderKey VertexShaderSource::CreateShader(const DWORD* pXboxFunction, DWORD *pXboxFunctionSize) { + IntermediateVertexShader intermediateShader; + + // Parse into intermediate format + EmuParseVshFunction((DWORD*)pXboxFunction, + pXboxFunctionSize, + &intermediateShader); + + ShaderKey key = ComputeHash((void*)pXboxFunction, *pXboxFunctionSize); + + // Check if we need to create the shader + auto it = cache.find(key); + if (it != cache.end()) { + EmuLog(LOG_LEVEL::DEBUG, "Vertex shader %llx has been created already", key); + // Increment reference count + it->second.referenceCount++; + EmuLog(LOG_LEVEL::DEBUG, "Incremented ref count for shader %llx (%d)", key, it->second.referenceCount); + return key; + } + + // We're going to create a new shader + auto newShader = LazyVertexShader(); + newShader.referenceCount = 1; + + auto shaderType = EmuGetShaderInfo(&intermediateShader); + + if (shaderType == ShaderType::Compilable) + { + // Start compiling the shader in the background + // TODO proper threading / threadpool. + // We should have some control over the number and priority of threads + EmuLog(LOG_LEVEL::DEBUG, "Creating vertex shader %llx size %d", key, *pXboxFunctionSize); + newShader.compileResult = std::async(std::launch::async, AsyncCreateVertexShader, intermediateShader, key); + } + else { + // We can't do anything with this shader + newShader.isReady = true; + newShader.pHostVertexShader = nullptr; + } + + // Put the shader into the cache + cache[key] = std::move(newShader); + + return key; +} + +// Get a shader using the given key +IDirect3DVertexShader* VertexShaderSource::GetShader(ShaderKey key) +{ + LazyVertexShader* pLazyShader = nullptr; + + // Look for the shader in the cache + if (!_FindShader(key, &pLazyShader)) { + return nullptr; // we didn't find anything + } + + // If the shader is ready, return it + if (pLazyShader->isReady) { + return pLazyShader->pHostVertexShader; + } + + // If there's no D3DDevice set, return nullptr + if (pD3DDevice == nullptr) { + EmuLog(LOG_LEVEL::WARNING, "Can't create shader - no D3D device is set!"); + return nullptr; + } + + // We need to get the compiled HLSL and create a shader from it + ID3DBlob* pCompiledShader = nullptr; + try { + // TODO one day, check is_ready before logging this (non-standard..?) + EmuLog(LOG_LEVEL::DEBUG, "Waiting for shader %llx...", key); + pCompiledShader = pLazyShader->compileResult.get(); + + // Create the shader + auto hRet = pD3DDevice->CreateVertexShader + ( + (DWORD*)pCompiledShader->GetBufferPointer(), + &pLazyShader->pHostVertexShader + ); + + // TODO DEBUG_D3DRESULT(hRet, "g_pD3DDevice->CreateVertexShader"); + if (SUCCEEDED(hRet)) { + EmuLog(LOG_LEVEL::DEBUG, "Created new vertex shader instance for %llx", key); + } + else { + EmuLog(LOG_LEVEL::ERROR2, "Failed creating new vertex shader instance for %llx", key); + } + } + catch (const std::exception & e) { + EmuLog(LOG_LEVEL::ERROR2, "Failed compiling shader %llx: %s", e.what()); + } + + if (pCompiledShader) { + pCompiledShader->Release(); + + // TODO compile the shader at a higher optimization level in a background thread? + } + + // The shader is ready + pLazyShader->isReady = true; + + return pLazyShader->pHostVertexShader; +} + +// Release a shader. Doesn't actually release any resources for now +void VertexShaderSource::ReleaseShader(ShaderKey key) +{ + // For now, don't bother releasing any shaders + LazyVertexShader* pLazyShader; + if (_FindShader(key, &pLazyShader)) { + + if (pLazyShader->referenceCount > 0) { + pLazyShader->referenceCount--; + EmuLog(LOG_LEVEL::DEBUG, "Decremented ref count for shader %llx (%d)", key, pLazyShader->referenceCount); + } + else + { + EmuLog(LOG_LEVEL::DEBUG, "Release called on unreferenced shader %llx", key); + } + } + else { + EmuLog(LOG_LEVEL::WARNING, "Release called on non-existent shader!"); + } +} + +void VertexShaderSource::ResetD3DDevice(IDirect3DDevice* newDevice) +{ + EmuLog(LOG_LEVEL::DEBUG, "Resetting D3D device"); + this->pD3DDevice = newDevice; +} diff --git a/src/core/hle/D3D8/Direct3D9/VertexShaderSource.h b/src/core/hle/D3D8/Direct3D9/VertexShaderSource.h new file mode 100644 index 000000000..c8a7794a6 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/VertexShaderSource.h @@ -0,0 +1,45 @@ + +#ifndef DIRECT3D9SHADERCACHE_H +#define DIRECT3D9SHADERCACHE_H + +#include "VertexShader.h" +#include + +typedef uint64_t ShaderKey; + +// Manages creation and caching of vertex shaders +class VertexShaderSource { + +public: + ShaderKey CreateShader(const DWORD* pXboxFunction, DWORD* pXboxFunctionSize); + IDirect3DVertexShader *GetShader(ShaderKey key); + void ReleaseShader(ShaderKey key); + + void ResetD3DDevice(IDirect3DDevice* pD3DDevice); + + // TODO + // WriteCacheToDisk + // LoadCacheFromDisk + +private: + struct LazyVertexShader { + bool isReady = false; + std::future compileResult; + IDirect3DVertexShader* pHostVertexShader = nullptr; + + // TODO when is it a good idea to releas eshaders? + int referenceCount = 0; + + // TODO persist shaders to disk + // ShaderVersion? + // OptimizationLevel? + }; + + IDirect3DDevice* pD3DDevice; + std::mutex cacheMutex; + std::map cache; + + bool VertexShaderSource::_FindShader(ShaderKey key, LazyVertexShader** ppLazyShader); +}; + +#endif diff --git a/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.cpp b/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.cpp new file mode 100644 index 000000000..1555e1374 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.cpp @@ -0,0 +1,87 @@ +//#include // - MMX +//#include // SSE +//#include // SSE2 +//#include // SSE3 +#include // SSE4.1 +//#include // SSE4.2 +//#include // AVX +#include "common\util\CPUID.h" +#include "WalkIndexBuffer.h" + +// Walk an index buffer to find the minimum and maximum indices + +// Default implementation +void WalkIndexBuffer_NoSIMD(INDEX16 & LowIndex, INDEX16 & HighIndex, INDEX16 * pIndexData, DWORD dwIndexCount) +{ + // Determine highest and lowest index in use + LowIndex = pIndexData[0]; + HighIndex = LowIndex; + for (unsigned int i = 1; i < dwIndexCount; i++) { + INDEX16 Index = pIndexData[i]; + if (LowIndex > Index) + LowIndex = Index; + if (HighIndex < Index) + HighIndex = Index; + } +} + +//SSE 4.1 implementation +void WalkIndexBuffer_SSE41(INDEX16 & LowIndex, INDEX16 & HighIndex, INDEX16 * pIndexData, DWORD dwIndexCount) +{ + // We can fit 8 ushorts into 128 bit SIMD registers + int iterations = dwIndexCount / 8; + DWORD remainder = dwIndexCount % 8; + + // Fallback to basic function if we can't even min / max 2 registers together + if (iterations < 2) { + WalkIndexBuffer_NoSIMD(LowIndex, HighIndex, pIndexData, dwIndexCount); + return; + } + + // Initialize mins and maxes + __m128i *unalignedIndices = (__m128i*) pIndexData; + __m128i min = _mm_set1_epi16((short)(USHRT_MAX)); // cast as set1 only takes signed shorts + __m128i max = _mm_setzero_si128(); + + // Min / max over index data + for (int i = 0; i < iterations; i++) { + __m128i indices = _mm_loadu_si128(&unalignedIndices[i]); + min = _mm_min_epu16(indices, min); + max = _mm_max_epu16(indices, max); + } + + // horizontal min + min = _mm_minpos_epu16(min); + + // horizontal max (no maxpos, we invert and use minpos) + max = _mm_subs_epu16(_mm_set1_epi16((short)(USHRT_MAX)), max); //invert + max = _mm_minpos_epu16(max); + + // Get the min and max out + LowIndex = (INDEX16) _mm_cvtsi128_si32(min); + HighIndex = (INDEX16) USHRT_MAX - _mm_cvtsi128_si32(max); // invert back + + // Compare with the remaining values that didn't fit neatly into the SIMD registers + for (DWORD i = dwIndexCount - remainder; i < dwIndexCount; i++) { + if (pIndexData[i] < LowIndex) + LowIndex = pIndexData[i]; + else if (pIndexData[i] > HighIndex) + HighIndex = pIndexData[i]; + + } +} + +// TODO AVX2, AVX512 implementations + +// Detect SSE support to select real implementation on first call +void(*WalkIndexBuffer)(INDEX16 &, INDEX16 &, INDEX16 *, DWORD) = +[](INDEX16 &LowIndex, INDEX16 &HighIndex, INDEX16 *pIndexData, DWORD dwIndexCount) +{ + SimdCaps supports; + if (supports.SSE41()) + WalkIndexBuffer = WalkIndexBuffer_SSE41; + else + WalkIndexBuffer = WalkIndexBuffer_NoSIMD; + + WalkIndexBuffer(LowIndex, HighIndex, pIndexData, dwIndexCount); +}; diff --git a/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.h b/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.h new file mode 100644 index 000000000..02623eaa9 --- /dev/null +++ b/src/core/hle/D3D8/Direct3D9/WalkIndexBuffer.h @@ -0,0 +1,14 @@ +#ifndef WALKINDEXBUFFER_H +#define WALKINDEXBUFFER_H + +#include "core\kernel\support\Emu.h" + +extern void(*WalkIndexBuffer) +( + INDEX16 &LowIndex, + INDEX16 &HighIndex, + INDEX16 *pIndexData, + DWORD dwIndexCount +); + +#endif diff --git a/src/CxbxKrnl/ResourceTracker.cpp b/src/core/hle/D3D8/ResourceTracker.cpp similarity index 81% rename from src/CxbxKrnl/ResourceTracker.cpp rename to src/core/hle/D3D8/ResourceTracker.cpp index a28c6b9dc..a8a189720 100644 --- a/src/CxbxKrnl/ResourceTracker.cpp +++ b/src/core/hle/D3D8/ResourceTracker.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->ResourceTracker.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,7 @@ // * All rights reserved // * // ****************************************************************** -#include "ResourceTracker.h" +#include "core\hle\D3D8\ResourceTracker.h" // // all of our resource trackers @@ -72,10 +63,10 @@ void ResourceTracker::clear() void ResourceTracker::insert(void *pResource) { - insert((uint32)pResource, pResource); + insert((uint32_t)pResource, pResource); } -void ResourceTracker::insert(uint32 uiKey, void *pResource) +void ResourceTracker::insert(uint32_t uiKey, void *pResource) { this->Lock(); @@ -110,10 +101,10 @@ void ResourceTracker::insert(uint32 uiKey, void *pResource) void ResourceTracker::remove(void *pResource) { - remove((uint32)pResource); + remove((uint32_t)pResource); } -void ResourceTracker::remove(uint32 uiKey) +void ResourceTracker::remove(uint32_t uiKey) { this->Lock(); @@ -159,10 +150,10 @@ void ResourceTracker::remove(uint32 uiKey) bool ResourceTracker::exists(void *pResource) { - return exists((uint32)pResource); + return exists((uint32_t)pResource); } -bool ResourceTracker::exists(uint32 uiKey) +bool ResourceTracker::exists(uint32_t uiKey) { this->Lock(); @@ -186,10 +177,10 @@ bool ResourceTracker::exists(uint32 uiKey) void *ResourceTracker::get(void *pResource) { - return get((uint32)pResource); + return get((uint32_t)pResource); } -void *ResourceTracker::get(uint32 uiKey) +void *ResourceTracker::get(uint32_t uiKey) { RTNode *cur = m_head; @@ -206,9 +197,9 @@ void *ResourceTracker::get(uint32 uiKey) return 0; } -uint32 ResourceTracker::get_count(void) +uint32_t ResourceTracker::get_count(void) { - uint32 uiCount = 0; + uint32_t uiCount = 0; this->Lock(); diff --git a/src/CxbxKrnl/ResourceTracker.h b/src/core/hle/D3D8/ResourceTracker.h similarity index 79% rename from src/CxbxKrnl/ResourceTracker.h rename to src/core/hle/D3D8/ResourceTracker.h index 799bfd833..d279b0501 100644 --- a/src/CxbxKrnl/ResourceTracker.h +++ b/src/core/hle/D3D8/ResourceTracker.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->ResourceTracker.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,7 +26,7 @@ #define RESOURCETRACKER_H #include "Cxbx.h" -#include "Common/Win32/Mutex.h" +#include "common\Win32\Mutex.h" extern class ResourceTracker : public Mutex { @@ -50,28 +41,28 @@ extern class ResourceTracker : public Mutex void insert(void *pResource); // insert a ptr using an explicit key - void insert(uint32 uiKey, void *pResource); + void insert(uint32_t uiKey, void *pResource); // remove a ptr using the pResource pointer as key void remove(void *pResource); // remove a ptr using an explicit key - void remove(uint32 uiKey); + void remove(uint32_t uiKey); // check for existance of ptr using the pResource pointer as key bool exists(void *pResource); // check for existance of an explicit key - bool exists(uint32 uiKey); + bool exists(uint32_t uiKey); // retrieves aresource using the resource ointer as key, explicit locking needed void *get(void *pResource); // retrieves a resource using an explicit key, explicit locking needed - void *get(uint32 uiKey); + void *get(uint32_t uiKey); // retrieves the number of entries in the tracker - uint32 get_count(void); + uint32_t get_count(void); // for traversal struct RTNode *getHead() { return m_head; } @@ -86,7 +77,7 @@ g_PatchedStreamsCache, g_DataToTexture, g_AlignCache; struct RTNode { - uint32 uiKey; + uint32_t uiKey; void *pResource; RTNode *pNext; }; diff --git a/src/CxbxKrnl/EmuD3D8/Convert.cpp b/src/core/hle/D3D8/XbConvert.cpp old mode 100755 new mode 100644 similarity index 61% rename from src/CxbxKrnl/EmuD3D8/Convert.cpp rename to src/core/hle/D3D8/XbConvert.cpp index 45e72742c..63cd0e37e --- a/src/CxbxKrnl/EmuD3D8/Convert.cpp +++ b/src/core/hle/D3D8/XbConvert.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->Convert.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,11 +25,13 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuXTL.h" -#include "Convert.h" +#define LOG_PREFIX CXBXR_MODULE::D3DCVT + +#include "common\Settings.hpp" // for g_LibVersion_D3D8 +#include "core\kernel\support\Emu.h" + +#include "XbConvert.h" // About format color components: // A = alpha, byte : 0 = fully opaque, 255 = fully transparent @@ -79,12 +72,12 @@ enum _ComponentEncoding { // Conversion functions copied from libyuv // See https://chromium.googlesource.com/libyuv/libyuv/+/master/source/row_common.cc -void RGB565ToARGBRow_C(const uint8* src_rgb565, uint8* dst_argb, int width) { +void RGB565ToARGBRow_C(const uint8_t* src_rgb565, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_rgb565[0] & 0x1f; - uint8 g = (src_rgb565[0] >> 5) | ((src_rgb565[1] & 0x07) << 3); - uint8 r = src_rgb565[1] >> 3; + uint8_t b = src_rgb565[0] & 0x1f; + uint8_t g = (src_rgb565[0] >> 5) | ((src_rgb565[1] & 0x07) << 3); + uint8_t r = src_rgb565[1] >> 3; dst_argb[0] = (b << 3) | (b >> 2); dst_argb[1] = (g << 2) | (g >> 4); dst_argb[2] = (r << 3) | (r >> 2); @@ -93,15 +86,15 @@ void RGB565ToARGBRow_C(const uint8* src_rgb565, uint8* dst_argb, int width) { src_rgb565 += 2; } } -void ARGB1555ToARGBRow_C(const uint8* src_argb1555, - uint8* dst_argb, +void ARGB1555ToARGBRow_C(const uint8_t* src_argb1555, + uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_argb1555[0] & 0x1f; - uint8 g = (src_argb1555[0] >> 5) | ((src_argb1555[1] & 0x03) << 3); - uint8 r = (src_argb1555[1] & 0x7c) >> 2; - uint8 a = src_argb1555[1] >> 7; + uint8_t b = src_argb1555[0] & 0x1f; + uint8_t g = (src_argb1555[0] >> 5) | ((src_argb1555[1] & 0x03) << 3); + uint8_t r = (src_argb1555[1] & 0x7c) >> 2; + uint8_t a = src_argb1555[1] >> 7; dst_argb[0] = (b << 3) | (b >> 2); dst_argb[1] = (g << 3) | (g >> 2); dst_argb[2] = (r << 3) | (r >> 2); @@ -110,15 +103,15 @@ void ARGB1555ToARGBRow_C(const uint8* src_argb1555, src_argb1555 += 2; } } -void ARGB4444ToARGBRow_C(const uint8* src_argb4444, - uint8* dst_argb, +void ARGB4444ToARGBRow_C(const uint8_t* src_argb4444, + uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_argb4444[0] & 0x0f; - uint8 g = src_argb4444[0] >> 4; - uint8 r = src_argb4444[1] & 0x0f; - uint8 a = src_argb4444[1] >> 4; + uint8_t b = src_argb4444[0] & 0x0f; + uint8_t g = src_argb4444[0] >> 4; + uint8_t r = src_argb4444[1] & 0x0f; + uint8_t a = src_argb4444[1] >> 4; dst_argb[0] = (b << 4) | b; dst_argb[1] = (g << 4) | g; dst_argb[2] = (r << 4) | r; @@ -129,13 +122,13 @@ void ARGB4444ToARGBRow_C(const uint8* src_argb4444, } // Cxbx color component conversion functions -void X1R5G5B5ToARGBRow_C(const uint8* src_x1r5g5b5, uint8* dst_argb, +void X1R5G5B5ToARGBRow_C(const uint8_t* src_x1r5g5b5, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_x1r5g5b5[0] & 0x1f; - uint8 g = (src_x1r5g5b5[0] >> 5) | ((src_x1r5g5b5[1] & 0x03) << 3); - uint8 r = (src_x1r5g5b5[1] & 0x7c) >> 2; + uint8_t b = src_x1r5g5b5[0] & 0x1f; + uint8_t g = (src_x1r5g5b5[0] >> 5) | ((src_x1r5g5b5[1] & 0x03) << 3); + uint8_t r = (src_x1r5g5b5[1] & 0x7c) >> 2; dst_argb[0] = (b << 3) | (b >> 2); dst_argb[1] = (g << 3) | (g >> 2); dst_argb[2] = (r << 3) | (r >> 2); @@ -145,16 +138,16 @@ void X1R5G5B5ToARGBRow_C(const uint8* src_x1r5g5b5, uint8* dst_argb, } } -void A8R8G8B8ToARGBRow_C(const uint8* src_a8r8g8b8, uint8* dst_argb, int width) { - memcpy(dst_argb, src_a8r8g8b8, width * sizeof(XTL::D3DCOLOR)); // Cxbx pass-through +void A8R8G8B8ToARGBRow_C(const uint8_t* src_a8r8g8b8, uint8_t* dst_argb, int width) { + memcpy(dst_argb, src_a8r8g8b8, width * sizeof(D3DCOLOR)); // Cxbx pass-through } -void X8R8G8B8ToARGBRow_C(const uint8* src_x8r8g8b8, uint8* dst_argb, int width) { +void X8R8G8B8ToARGBRow_C(const uint8_t* src_x8r8g8b8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_x8r8g8b8[0]; - uint8 g = src_x8r8g8b8[1]; - uint8 r = src_x8r8g8b8[2]; + uint8_t b = src_x8r8g8b8[0]; + uint8_t g = src_x8r8g8b8[1]; + uint8_t r = src_x8r8g8b8[2]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = r; @@ -164,11 +157,11 @@ void X8R8G8B8ToARGBRow_C(const uint8* src_x8r8g8b8, uint8* dst_argb, int width) } } -void ____R8B8ToARGBRow_C(const uint8* src_r8b8, uint8* dst_argb, int width) { +void ____R8B8ToARGBRow_C(const uint8_t* src_r8b8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_r8b8[0]; - uint8 r = src_r8b8[1]; + uint8_t b = src_r8b8[0]; + uint8_t r = src_r8b8[1]; dst_argb[0] = b; dst_argb[1] = b; dst_argb[2] = r; @@ -178,11 +171,11 @@ void ____R8B8ToARGBRow_C(const uint8* src_r8b8, uint8* dst_argb, int width) { } } -void ____G8B8ToARGBRow_C(const uint8* src_g8b8, uint8* dst_argb, int width) { +void ____G8B8ToARGBRow_C(const uint8_t* src_g8b8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_g8b8[0]; - uint8 g = src_g8b8[1]; + uint8_t b = src_g8b8[0]; + uint8_t g = src_g8b8[1]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = b; @@ -192,10 +185,10 @@ void ____G8B8ToARGBRow_C(const uint8* src_g8b8, uint8* dst_argb, int width) { } } -void ______A8ToARGBRow_C(const uint8* src_a8, uint8* dst_argb, int width) { +void ______A8ToARGBRow_C(const uint8_t* src_a8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 a = src_a8[0]; + uint8_t a = src_a8[0]; dst_argb[0] = 255u; dst_argb[1] = 255u; dst_argb[2] = 255u; @@ -205,12 +198,12 @@ void ______A8ToARGBRow_C(const uint8* src_a8, uint8* dst_argb, int width) { } } -void __R6G5B5ToARGBRow_C(const uint8* src_r6g5b5, uint8* dst_argb, int width) { +void __R6G5B5ToARGBRow_C(const uint8_t* src_r6g5b5, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_r6g5b5[0] & 0x1f; - uint8 g = (src_r6g5b5[0] >> 5) | ((src_r6g5b5[1] & 0x03) << 3); - uint8 r = src_r6g5b5[1] >> 2; + uint8_t b = src_r6g5b5[0] & 0x1f; + uint8_t g = (src_r6g5b5[0] >> 5) | ((src_r6g5b5[1] & 0x03) << 3); + uint8_t r = src_r6g5b5[1] >> 2; dst_argb[0] = (b << 3) | (b >> 2); dst_argb[1] = (g << 3) | (g >> 2); dst_argb[2] = (r << 2) | (r >> 4); @@ -220,13 +213,13 @@ void __R6G5B5ToARGBRow_C(const uint8* src_r6g5b5, uint8* dst_argb, int width) { } } -void R5G5B5A1ToARGBRow_C(const uint8* src_r5g5b5a1, uint8* dst_argb, int width) { +void R5G5B5A1ToARGBRow_C(const uint8_t* src_r5g5b5a1, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 a = src_r5g5b5a1[0] & 1; - uint8 b = (src_r5g5b5a1[0] & 0x3e) >> 1; - uint8 g = (src_r5g5b5a1[0] >> 6) | ((src_r5g5b5a1[1] & 0x07) << 2); - uint8 r = (src_r5g5b5a1[1] & 0xf8) >> 3; + uint8_t a = src_r5g5b5a1[0] & 1; + uint8_t b = (src_r5g5b5a1[0] & 0x3e) >> 1; + uint8_t g = (src_r5g5b5a1[0] >> 6) | ((src_r5g5b5a1[1] & 0x07) << 2); + uint8_t r = (src_r5g5b5a1[1] & 0xf8) >> 3; dst_argb[0] = (b << 3) | (b >> 2); dst_argb[1] = (g << 3) | (g >> 2); dst_argb[2] = (r << 3) | (r >> 2); @@ -236,13 +229,13 @@ void R5G5B5A1ToARGBRow_C(const uint8* src_r5g5b5a1, uint8* dst_argb, int width) } } -void R4G4B4A4ToARGBRow_C(const uint8* src_r4g4b4a4, uint8* dst_argb, int width) { +void R4G4B4A4ToARGBRow_C(const uint8_t* src_r4g4b4a4, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 a = src_r4g4b4a4[0] & 0x0f; - uint8 b = src_r4g4b4a4[0] >> 4; - uint8 g = src_r4g4b4a4[1] & 0x0f; - uint8 r = src_r4g4b4a4[1] >> 4; + uint8_t a = src_r4g4b4a4[0] & 0x0f; + uint8_t b = src_r4g4b4a4[0] >> 4; + uint8_t g = src_r4g4b4a4[1] & 0x0f; + uint8_t r = src_r4g4b4a4[1] >> 4; dst_argb[0] = (b << 4) | b; dst_argb[1] = (g << 4) | g; dst_argb[2] = (r << 4) | r; @@ -252,13 +245,13 @@ void R4G4B4A4ToARGBRow_C(const uint8* src_r4g4b4a4, uint8* dst_argb, int width) } } -void A8B8G8R8ToARGBRow_C(const uint8* src_a8b8g8r8, uint8* dst_argb, int width) { +void A8B8G8R8ToARGBRow_C(const uint8_t* src_a8b8g8r8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 r = src_a8b8g8r8[0]; - uint8 g = src_a8b8g8r8[1]; - uint8 b = src_a8b8g8r8[3]; - uint8 a = src_a8b8g8r8[4]; + uint8_t r = src_a8b8g8r8[0]; + uint8_t g = src_a8b8g8r8[1]; + uint8_t b = src_a8b8g8r8[3]; + uint8_t a = src_a8b8g8r8[4]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = r; @@ -268,13 +261,13 @@ void A8B8G8R8ToARGBRow_C(const uint8* src_a8b8g8r8, uint8* dst_argb, int width) } } -void B8G8R8A8ToARGBRow_C(const uint8* src_b8g8r8a8, uint8* dst_argb, int width) { +void B8G8R8A8ToARGBRow_C(const uint8_t* src_b8g8r8a8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 a = src_b8g8r8a8[0]; - uint8 r = src_b8g8r8a8[1]; - uint8 g = src_b8g8r8a8[3]; - uint8 b = src_b8g8r8a8[4]; + uint8_t a = src_b8g8r8a8[0]; + uint8_t r = src_b8g8r8a8[1]; + uint8_t g = src_b8g8r8a8[3]; + uint8_t b = src_b8g8r8a8[4]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = r; @@ -284,13 +277,13 @@ void B8G8R8A8ToARGBRow_C(const uint8* src_b8g8r8a8, uint8* dst_argb, int width) } } -void R8G8B8A8ToARGBRow_C(const uint8* src_r8g8b8a8, uint8* dst_argb, int width) { +void R8G8B8A8ToARGBRow_C(const uint8_t* src_r8g8b8a8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 a = src_r8g8b8a8[0]; - uint8 b = src_r8g8b8a8[1]; - uint8 g = src_r8g8b8a8[3]; - uint8 r = src_r8g8b8a8[4]; + uint8_t a = src_r8g8b8a8[0]; + uint8_t b = src_r8g8b8a8[1]; + uint8_t g = src_r8g8b8a8[3]; + uint8_t r = src_r8g8b8a8[4]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = r; @@ -300,10 +293,10 @@ void R8G8B8A8ToARGBRow_C(const uint8* src_r8g8b8a8, uint8* dst_argb, int width) } } -void ______L8ToARGBRow_C(const uint8* src_l8, uint8* dst_argb, int width) { +void ______L8ToARGBRow_C(const uint8_t* src_l8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 l = src_l8[0]; + uint8_t l = src_l8[0]; dst_argb[0] = l; dst_argb[1] = l; dst_argb[2] = l; @@ -313,10 +306,10 @@ void ______L8ToARGBRow_C(const uint8* src_l8, uint8* dst_argb, int width) { } } -void _____AL8ToARGBRow_C(const uint8* src_al8, uint8* dst_argb, int width) { +void _____AL8ToARGBRow_C(const uint8_t* src_al8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 l = src_al8[0]; + uint8_t l = src_al8[0]; dst_argb[0] = l; dst_argb[1] = l; dst_argb[2] = l; @@ -326,11 +319,11 @@ void _____AL8ToARGBRow_C(const uint8* src_al8, uint8* dst_argb, int width) { } } -void _____L16ToARGBRow_C(const uint8* src_l16, uint8* dst_argb, int width) { +void _____L16ToARGBRow_C(const uint8_t* src_l16, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 b = src_l16[0]; - uint8 g = src_l16[1]; + uint8_t b = src_l16[0]; + uint8_t g = src_l16[1]; dst_argb[0] = b; dst_argb[1] = g; dst_argb[2] = 255u; @@ -340,11 +333,11 @@ void _____L16ToARGBRow_C(const uint8* src_l16, uint8* dst_argb, int width) { } } -void ____A8L8ToARGBRow_C(const uint8* src_a8l8, uint8* dst_argb, int width) { +void ____A8L8ToARGBRow_C(const uint8_t* src_a8l8, uint8_t* dst_argb, int width) { int x; for (x = 0; x < width; ++x) { - uint8 l = src_a8l8[0]; - uint8 a = src_a8l8[1]; + uint8_t l = src_a8l8[0]; + uint8_t a = src_a8l8[1]; dst_argb[0] = l; dst_argb[1] = l; dst_argb[2] = l; @@ -364,22 +357,22 @@ typedef struct TRGB32 // DXT1 info (MSDN Block Compression) : https://msdn.microsoft.com/en-us/library/bb694531.aspx // https://msdn.microsoft.com/en-us/library/windows/desktop/bb147243(v=vs.85).aspx -void ____DXT1ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { +void ____DXT1ToARGBRow_C(const uint8_t* data, uint8_t* dst_argb, int width) { int dst_pitch = *(int*)dst_argb; // dirty hack to avoid another argument int x; for (x = 0; x < width; x+=4) { // Read two 16-bit pixels - uint16 color_0 = data[0] | (data[1] << 8); - uint16 color_1 = data[2] | (data[3] << 8); + uint16_t color_0 = data[0] | (data[1] << 8); + uint16_t color_1 = data[2] | (data[3] << 8); // Read 5+6+5 bit color channels - uint8 b0 = color_0 & 0x1f; - uint8 g0 = (color_0 >> 5) & 0x3f; - uint8 r0 = color_0 >> 11; + uint8_t b0 = color_0 & 0x1f; + uint8_t g0 = (color_0 >> 5) & 0x3f; + uint8_t r0 = color_0 >> 11; - uint8 b1 = color_1 & 0x1f; - uint8 g1 = (color_1 >> 5) & 0x3f; - uint8 r1 = color_1 >> 11; + uint8_t b1 = color_1 & 0x1f; + uint8_t g1 = (color_1 >> 5) & 0x3f; + uint8_t r1 = color_1 >> 11; // Build first half of RGB32 color map (converting 5+6+5 to 8+8+8): TRGB32 colormap[4]; @@ -397,22 +390,22 @@ void ____DXT1ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { if (color_0 > color_1) { // Make up new color : 2/3 A + 1/3 B : - colormap[2].B = (uint8)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); - colormap[2].G = (uint8)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); - colormap[2].R = (uint8)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); + colormap[2].B = (uint8_t)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); + colormap[2].G = (uint8_t)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); + colormap[2].R = (uint8_t)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); colormap[2].A = 255u; // Make up new color : 1/3 A + 2/3 B : - colormap[3].B = (uint8)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); - colormap[3].G = (uint8)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); - colormap[3].R = (uint8)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); + colormap[3].B = (uint8_t)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); + colormap[3].G = (uint8_t)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); + colormap[3].R = (uint8_t)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); colormap[3].A = 255u; } else { // Make up one new color : 1/2 A + 1/2 B : - colormap[2].B = (uint8)((colormap[0].B + colormap[1].B + 1) / 2); - colormap[2].G = (uint8)((colormap[0].G + colormap[1].G + 1) / 2); - colormap[2].R = (uint8)((colormap[0].R + colormap[1].R + 1) / 2); + colormap[2].B = (uint8_t)((colormap[0].B + colormap[1].B + 1) / 2); + colormap[2].G = (uint8_t)((colormap[0].G + colormap[1].G + 1) / 2); + colormap[2].R = (uint8_t)((colormap[0].R + colormap[1].R + 1) / 2); colormap[2].A = 255u; colormap[3].B = 0u; @@ -421,10 +414,10 @@ void ____DXT1ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { colormap[3].A = 0u; } - uint8 indices0 = data[4]; - uint8 indices1 = data[5]; - uint8 indices2 = data[6]; - uint8 indices3 = data[7]; + uint8_t indices0 = data[4]; + uint8_t indices1 = data[5]; + uint8_t indices2 = data[6]; + uint8_t indices3 = data[7]; TRGB32 *dst_line0 = (TRGB32*)(dst_argb); TRGB32 *dst_line1 = (TRGB32*)(dst_argb + dst_pitch); @@ -458,32 +451,32 @@ void ____DXT1ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { } // DXT3 info : https://en.wikipedia.org/wiki/S3_Texture_Compression#DXT2_and_DXT3 -void ____DXT3ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { +void ____DXT3ToARGBRow_C(const uint8_t* data, uint8_t* dst_argb, int width) { int dst_pitch = *(int*)dst_argb; // dirty hack to avoid another argument int x; for (x = 0; x < width; x += 4) { // Read 16 pixels of 4-bit alpha channel data - uint8 alpha0 = data[0]; - uint8 alpha1 = data[1]; - uint8 alpha2 = data[2]; - uint8 alpha3 = data[3]; - uint8 alpha4 = data[4]; - uint8 alpha5 = data[5]; - uint8 alpha6 = data[6]; - uint8 alpha7 = data[7]; + uint8_t alpha0 = data[0]; + uint8_t alpha1 = data[1]; + uint8_t alpha2 = data[2]; + uint8_t alpha3 = data[3]; + uint8_t alpha4 = data[4]; + uint8_t alpha5 = data[5]; + uint8_t alpha6 = data[6]; + uint8_t alpha7 = data[7]; // Read two 16-bit pixels - uint16 color_0 = data[8] | (data[9] << 8); - uint16 color_1 = data[10] | (data[11] << 8); + uint16_t color_0 = data[8] | (data[9] << 8); + uint16_t color_1 = data[10] | (data[11] << 8); // Read 5+6+5 bit color channels - uint8 b0 = color_0 & 0x1f; - uint8 g0 = (color_0 >> 5) & 0x3f; - uint8 r0 = color_0 >> 11; + uint8_t b0 = color_0 & 0x1f; + uint8_t g0 = (color_0 >> 5) & 0x3f; + uint8_t r0 = color_0 >> 11; - uint8 b1 = color_1 & 0x1f; - uint8 g1 = (color_1 >> 5) & 0x3f; - uint8 r1 = color_1 >> 11; + uint8_t b1 = color_1 & 0x1f; + uint8_t g1 = (color_1 >> 5) & 0x3f; + uint8_t r1 = color_1 >> 11; // Build first half of RGB32 color map (converting 5+6+5 to 8+8+8): TRGB32 colormap[4]; @@ -497,19 +490,19 @@ void ____DXT3ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { // Build second half of RGB32 color map : // Make up new color : 2/3 A + 1/3 B : - colormap[2].B = (uint8)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); - colormap[2].G = (uint8)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); - colormap[2].R = (uint8)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); + colormap[2].B = (uint8_t)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); + colormap[2].G = (uint8_t)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); + colormap[2].R = (uint8_t)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); // Make up new color : 1/3 A + 2/3 B : - colormap[3].B = (uint8)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); - colormap[3].G = (uint8)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); - colormap[3].R = (uint8)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); + colormap[3].B = (uint8_t)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); + colormap[3].G = (uint8_t)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); + colormap[3].R = (uint8_t)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); // Read 4 bytes worth of 2-bit color indices for 16 pixels - uint8 colori0 = data[12]; - uint8 colori1 = data[13]; - uint8 colori2 = data[14]; - uint8 colori3 = data[15]; + uint8_t colori0 = data[12]; + uint8_t colori1 = data[13]; + uint8_t colori2 = data[14]; + uint8_t colori3 = data[15]; TRGB32 *dst_line0 = (TRGB32*)(dst_argb); TRGB32 *dst_line1 = (TRGB32*)(dst_argb + dst_pitch); @@ -558,12 +551,12 @@ void ____DXT3ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { } // DXT5 info : http://www.matejtomcik.com/Public/KnowHow/DXTDecompression/ -void ____DXT5ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { +void ____DXT5ToARGBRow_C(const uint8_t* data, uint8_t* dst_argb, int width) { int dst_pitch = *(int*)dst_argb; // dirty hack to avoid another argument int x; for (x = 0; x < width; x += 4) { // Read two 8-bit alphas - uint8 alphamap[8]; + uint8_t alphamap[8]; alphamap[0] = data[0]; alphamap[1] = data[1]; @@ -586,25 +579,25 @@ void ____DXT5ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { } // Read 6 bytes worth of 3-bit alpha channal indices for 16 pixels - uint8 alphai0 = data[2]; - uint8 alphai1 = data[3]; - uint8 alphai2 = data[4]; - uint8 alphai3 = data[5]; - uint8 alphai4 = data[6]; - uint8 alphai5 = data[7]; + uint8_t alphai0 = data[2]; + uint8_t alphai1 = data[3]; + uint8_t alphai2 = data[4]; + uint8_t alphai3 = data[5]; + uint8_t alphai4 = data[6]; + uint8_t alphai5 = data[7]; // Read two 16-bit colors - uint16 color_0 = data[8] | (data[9] << 8); - uint16 color_1 = data[10] | (data[11] << 8); + uint16_t color_0 = data[8] | (data[9] << 8); + uint16_t color_1 = data[10] | (data[11] << 8); // Read 5+6+5 bit color channels - uint8 b0 = color_0 & 0x1f; - uint8 g0 = (color_0 >> 5) & 0x3f; - uint8 r0 = color_0 >> 11; + uint8_t b0 = color_0 & 0x1f; + uint8_t g0 = (color_0 >> 5) & 0x3f; + uint8_t r0 = color_0 >> 11; - uint8 b1 = color_1 & 0x1f; - uint8 g1 = (color_1 >> 5) & 0x3f; - uint8 r1 = color_1 >> 11; + uint8_t b1 = color_1 & 0x1f; + uint8_t g1 = (color_1 >> 5) & 0x3f; + uint8_t r1 = color_1 >> 11; // Build first half of RGB32 color map (converting 5+6+5 to 8+8+8): TRGB32 colormap[4]; @@ -618,19 +611,19 @@ void ____DXT5ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { // Build second half of RGB32 color map : // Make up new color : 2/3 A + 1/3 B : - colormap[2].B = (uint8)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); - colormap[2].G = (uint8)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); - colormap[2].R = (uint8)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); + colormap[2].B = (uint8_t)((2 * colormap[0].B + 1 * colormap[1].B + 2) / 3); + colormap[2].G = (uint8_t)((2 * colormap[0].G + 1 * colormap[1].G + 2) / 3); + colormap[2].R = (uint8_t)((2 * colormap[0].R + 1 * colormap[1].R + 2) / 3); // Make up new color : 1/3 A + 2/3 B : - colormap[3].B = (uint8)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); - colormap[3].G = (uint8)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); - colormap[3].R = (uint8)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); + colormap[3].B = (uint8_t)((1 * colormap[0].B + 2 * colormap[1].B + 2) / 3); + colormap[3].G = (uint8_t)((1 * colormap[0].G + 2 * colormap[1].G + 2) / 3); + colormap[3].R = (uint8_t)((1 * colormap[0].R + 2 * colormap[1].R + 2) / 3); // Read 4 bytes worth of 2-bit color indices for 16 pixels - uint8 colori0 = data[12]; - uint8 colori1 = data[13]; - uint8 colori2 = data[14]; - uint8 colori3 = data[15]; + uint8_t colori0 = data[12]; + uint8_t colori1 = data[13]; + uint8_t colori2 = data[14]; + uint8_t colori3 = data[15]; TRGB32 *dst_line0 = (TRGB32*)(dst_argb); TRGB32 *dst_line1 = (TRGB32*)(dst_argb + dst_pitch); @@ -678,34 +671,39 @@ void ____DXT5ToARGBRow_C(const uint8* data, uint8* dst_argb, int width) { } } -void ______P8ToARGBRow_C(const uint8* src_p8, uint8* dst_argb, int width) { +void ______P8ToARGBRow_C(const uint8_t* src_p8, uint8_t* dst_argb, int width) { TRGB32 *pTexturePalette = *(TRGB32 **)dst_argb; // dirty hack to avoid another argument int x; for (x = 0; x < width; ++x) { - uint8 p = src_p8[x]; + uint8_t p = src_p8[x]; TRGB32 color = pTexturePalette[p]; ((TRGB32 *)dst_argb)[x] = color; } } -static __inline int32 clamp0(int32 v) { +static __inline int32_t clamp0(int32_t v) { return ((-(v) >> 31) & (v)); } -static __inline int32 clamp255(int32 v) { +static __inline int32_t clamp255(int32_t v) { return (((255 - (v)) >> 31) | (v)) & 255; } -static __inline uint32 Clamp(int32 val) { +static __inline uint32_t Clamp(int32_t val) { int v = clamp0(val); - return (uint32)(clamp255(v)); + return (uint32_t)(clamp255(v)); } #if defined(_MSC_VER) && !defined(__CLR_VER) #define SIMD_ALIGNED(var) __declspec(align(16)) var #define SIMD_ALIGNED32(var) __declspec(align(64)) var -typedef __declspec(align(32)) int16 lvec16[16]; -typedef __declspec(align(32)) int8 lvec8[32]; +typedef __declspec(align(32)) int16_t lvec16[16]; +typedef __declspec(align(32)) int8_t lvec8[32]; +#elif __GNUC__ +#define SIMD_ALIGNED(var) __attribute__((aligned(16)))var +#define SIMD_ALIGNED32(var) __attribute__((aligned(64))) var +typedef __attribute__((aligned(32))) int16_t lvec16[16]; +typedef __attribute__((aligned(32))) int8_t lvec8[32]; #endif struct YuvConstants { @@ -753,8 +751,8 @@ const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { }; // C reference code that mimics the YUV assembly. -static __inline void YuvPixel(uint8 y, uint8 u, uint8 v, - uint8* b, uint8* g, uint8* r, +static __inline void YuvPixel(uint8_t y, uint8_t u, uint8_t v, + uint8_t* b, uint8_t* g, uint8_t* r, const struct YuvConstants* yuvconstants) { int ub = yuvconstants->kUVToB[0]; int ug = yuvconstants->kUVToG[0]; @@ -765,14 +763,14 @@ static __inline void YuvPixel(uint8 y, uint8 u, uint8 v, int br = yuvconstants->kUVBiasR[0]; int yg = yuvconstants->kYToRgb[0]; - uint32 y1 = (uint32)(y * 0x0101 * yg) >> 16; - *b = (uint8)Clamp((int32)(-(u * ub) + y1 + bb) >> 6); - *g = (uint8)Clamp((int32)(-(u * ug + v * vg) + y1 + bg) >> 6); - *r = (uint8)Clamp((int32)(-(v * vr) + y1 + br) >> 6); + uint32_t y1 = (uint32_t)(y * 0x0101 * yg) >> 16; + *b = (uint8_t)Clamp((int32_t)(-(u * ub) + y1 + bb) >> 6); + *g = (uint8_t)Clamp((int32_t)(-(u * ug + v * vg) + y1 + bg) >> 6); + *r = (uint8_t)Clamp((int32_t)(-(v * vr) + y1 + br) >> 6); } -void ____YUY2ToARGBRow_C(const uint8* src_yuy2, - uint8* rgb_buf, +void ____YUY2ToARGBRow_C(const uint8_t* src_yuy2, + uint8_t* rgb_buf, int width) { const struct YuvConstants* yuvconstants = &kYuvIConstants; // hack to avoid another argument int x; @@ -793,8 +791,8 @@ void ____YUY2ToARGBRow_C(const uint8* src_yuy2, } } -void ____UYVYToARGBRow_C(const uint8* src_uyvy, - uint8* rgb_buf, +void ____UYVYToARGBRow_C(const uint8_t* src_uyvy, + uint8_t* rgb_buf, int width) { const struct YuvConstants* yuvconstants = &kYuvIConstants; // hack to avoid another argument int x; @@ -815,7 +813,7 @@ void ____UYVYToARGBRow_C(const uint8* src_uyvy, } } -static const XTL::FormatToARGBRow ComponentConverters[] = { +static const FormatToARGBRow ComponentConverters[] = { nullptr, // NoCmpnts, ARGB1555ToARGBRow_C, // A1R5G5B5, X1R5G5B5ToARGBRow_C, // X1R5G5B5, // Test : Convert X into 255 @@ -861,7 +859,7 @@ typedef struct _FormatInfo { uint8_t bits_per_pixel; _FormatStorage stored; _ComponentEncoding components; - XTL::D3DFORMAT pc; + D3DFORMAT pc; _FormatUsage usage; char *warning; } FormatInfo; @@ -877,106 +875,82 @@ static const FormatInfo FormatInfos[] = { // in the warning field, so EmuXBFormatRequiresConversionToARGB can return a conversion // to ARGB is needed (which is implemented in EMUPATCH(D3DResource_Register). - /* 0x00 X_D3DFMT_L8 */ { 8, Swzzld, ______L8, XTL::D3DFMT_L8 }, - /* 0x01 X_D3DFMT_AL8 */ { 8, Swzzld, _____AL8, XTL::D3DFMT_L8 , Texture, "X_D3DFMT_AL8 -> D3DFMT_L8" }, - /* 0x02 X_D3DFMT_A1R5G5B5 */ { 16, Swzzld, A1R5G5B5, XTL::D3DFMT_A1R5G5B5 }, - /* 0x03 X_D3DFMT_X1R5G5B5 */ { 16, Swzzld, X1R5G5B5, XTL::D3DFMT_X1R5G5B5 , RenderTarget }, - /* 0x04 X_D3DFMT_A4R4G4B4 */ { 16, Swzzld, A4R4G4B4, XTL::D3DFMT_A4R4G4B4 }, - /* 0x05 X_D3DFMT_R5G6B5 */ { 16, Swzzld, __R5G6B5, XTL::D3DFMT_R5G6B5 , RenderTarget }, - /* 0x06 X_D3DFMT_A8R8G8B8 */ { 32, Swzzld, A8R8G8B8, XTL::D3DFMT_A8R8G8B8 , RenderTarget }, - /* 0x07 X_D3DFMT_X8R8G8B8 */ { 32, Swzzld, X8R8G8B8, XTL::D3DFMT_X8R8G8B8 , RenderTarget }, // Alias : X_D3DFMT_X8L8V8U8 + /* 0x00 X_D3DFMT_L8 */ { 8, Swzzld, ______L8, D3DFMT_L8 }, + /* 0x01 X_D3DFMT_AL8 */ { 8, Swzzld, _____AL8, D3DFMT_L8 , Texture, "X_D3DFMT_AL8 -> D3DFMT_L8" }, + /* 0x02 X_D3DFMT_A1R5G5B5 */ { 16, Swzzld, A1R5G5B5, D3DFMT_A1R5G5B5 }, + /* 0x03 X_D3DFMT_X1R5G5B5 */ { 16, Swzzld, X1R5G5B5, D3DFMT_X1R5G5B5 , RenderTarget }, + /* 0x04 X_D3DFMT_A4R4G4B4 */ { 16, Swzzld, A4R4G4B4, D3DFMT_A4R4G4B4 }, + /* 0x05 X_D3DFMT_R5G6B5 */ { 16, Swzzld, __R5G6B5, D3DFMT_R5G6B5 , RenderTarget }, + /* 0x06 X_D3DFMT_A8R8G8B8 */ { 32, Swzzld, A8R8G8B8, D3DFMT_A8R8G8B8 , RenderTarget }, + /* 0x07 X_D3DFMT_X8R8G8B8 */ { 32, Swzzld, X8R8G8B8, D3DFMT_X8R8G8B8 , RenderTarget }, // Alias : X_D3DFMT_X8L8V8U8 /* 0x08 undefined */ {}, /* 0x09 undefined */ {}, /* 0x0A undefined */ {}, - /* 0x0B X_D3DFMT_P8 */ { 8, Swzzld, ______P8, XTL::D3DFMT_P8 , Texture, "X_D3DFMT_P8 -> D3DFMT_L8" }, // 8-bit palletized - /* 0x0C X_D3DFMT_DXT1 */ { 4, Cmprsd, ____DXT1, XTL::D3DFMT_DXT1 }, // opaque/one-bit alpha // NOTE : DXT1 is half byte per pixel, so divide Size and Pitch calculations by two! + /* 0x0B X_D3DFMT_P8 */ { 8, Swzzld, ______P8, D3DFMT_P8 , Texture, "X_D3DFMT_P8 -> D3DFMT_L8" }, // 8-bit palletized + /* 0x0C X_D3DFMT_DXT1 */ { 4, Cmprsd, ____DXT1, D3DFMT_DXT1 }, // opaque/one-bit alpha // NOTE : DXT1 is half byte per pixel, so divide Size and Pitch calculations by two! /* 0x0D undefined */ {}, - /* 0x0E X_D3DFMT_DXT3 */ { 8, Cmprsd, ____DXT3, XTL::D3DFMT_DXT3 }, // Alias : X_D3DFMT_DXT2 // linear alpha - /* 0x0F X_D3DFMT_DXT5 */ { 8, Cmprsd, ____DXT5, XTL::D3DFMT_DXT5 }, // Alias : X_D3DFMT_DXT4 // interpolated alpha - /* 0x10 X_D3DFMT_LIN_A1R5G5B5 */ { 16, Linear, A1R5G5B5, XTL::D3DFMT_A1R5G5B5 }, - /* 0x11 X_D3DFMT_LIN_R5G6B5 */ { 16, Linear, __R5G6B5, XTL::D3DFMT_R5G6B5 , RenderTarget }, - /* 0x12 X_D3DFMT_LIN_A8R8G8B8 */ { 32, Linear, A8R8G8B8, XTL::D3DFMT_A8R8G8B8 , RenderTarget }, - /* 0x13 X_D3DFMT_LIN_L8 */ { 8, Linear, ______L8, XTL::D3DFMT_L8 , RenderTarget }, + /* 0x0E X_D3DFMT_DXT3 */ { 8, Cmprsd, ____DXT3, D3DFMT_DXT3 }, // Alias : X_D3DFMT_DXT2 // linear alpha + /* 0x0F X_D3DFMT_DXT5 */ { 8, Cmprsd, ____DXT5, D3DFMT_DXT5 }, // Alias : X_D3DFMT_DXT4 // interpolated alpha + /* 0x10 X_D3DFMT_LIN_A1R5G5B5 */ { 16, Linear, A1R5G5B5, D3DFMT_A1R5G5B5 }, + /* 0x11 X_D3DFMT_LIN_R5G6B5 */ { 16, Linear, __R5G6B5, D3DFMT_R5G6B5 , RenderTarget }, + /* 0x12 X_D3DFMT_LIN_A8R8G8B8 */ { 32, Linear, A8R8G8B8, D3DFMT_A8R8G8B8 , RenderTarget }, + /* 0x13 X_D3DFMT_LIN_L8 */ { 8, Linear, ______L8, D3DFMT_L8 , RenderTarget }, /* 0x14 undefined */ {}, /* 0x15 undefined */ {}, - /* 0x16 X_D3DFMT_LIN_R8B8 */ { 16, Linear, ____R8B8, XTL::D3DFMT_R5G6B5 , Texture, "X_D3DFMT_LIN_R8B8 -> D3DFMT_R5G6B5" }, - /* 0x17 X_D3DFMT_LIN_G8B8 */ { 16, Linear, ____G8B8, XTL::D3DFMT_R5G6B5 , RenderTarget, "X_D3DFMT_LIN_G8B8 -> D3DFMT_R5G6B5" }, // Alias : X_D3DFMT_LIN_V8U8 + /* 0x16 X_D3DFMT_LIN_R8B8 */ { 16, Linear, ____R8B8, D3DFMT_R5G6B5 , Texture, "X_D3DFMT_LIN_R8B8 -> D3DFMT_R5G6B5" }, + /* 0x17 X_D3DFMT_LIN_G8B8 */ { 16, Linear, ____G8B8, D3DFMT_R5G6B5 , RenderTarget, "X_D3DFMT_LIN_G8B8 -> D3DFMT_R5G6B5" }, // Alias : X_D3DFMT_LIN_V8U8 /* 0x18 undefined */ {}, - /* 0x19 X_D3DFMT_A8 */ { 8, Swzzld, ______A8, XTL::D3DFMT_A8 }, - /* 0x1A X_D3DFMT_A8L8 */ { 16, Swzzld, ____A8L8, XTL::D3DFMT_A8L8 }, - /* 0x1B X_D3DFMT_LIN_AL8 */ { 8, Linear, _____AL8, XTL::D3DFMT_L8 , Texture, "X_D3DFMT_LIN_AL8 -> D3DFMT_L8" }, - /* 0x1C X_D3DFMT_LIN_X1R5G5B5 */ { 16, Linear, X1R5G5B5, XTL::D3DFMT_X1R5G5B5 , RenderTarget }, - /* 0x1D X_D3DFMT_LIN_A4R4G4B4 */ { 16, Linear, A4R4G4B4, XTL::D3DFMT_A4R4G4B4 }, - /* 0x1E X_D3DFMT_LIN_X8R8G8B8 */ { 32, Linear, X8R8G8B8, XTL::D3DFMT_X8R8G8B8 , RenderTarget }, // Alias : X_D3DFMT_LIN_X8L8V8U8 - /* 0x1F X_D3DFMT_LIN_A8 */ { 8, Linear, ______A8, XTL::D3DFMT_A8 }, - /* 0x20 X_D3DFMT_LIN_A8L8 */ { 16, Linear, ____A8L8, XTL::D3DFMT_A8L8 }, + /* 0x19 X_D3DFMT_A8 */ { 8, Swzzld, ______A8, D3DFMT_A8 }, + /* 0x1A X_D3DFMT_A8L8 */ { 16, Swzzld, ____A8L8, D3DFMT_A8L8 }, + /* 0x1B X_D3DFMT_LIN_AL8 */ { 8, Linear, _____AL8, D3DFMT_L8 , Texture, "X_D3DFMT_LIN_AL8 -> D3DFMT_L8" }, + /* 0x1C X_D3DFMT_LIN_X1R5G5B5 */ { 16, Linear, X1R5G5B5, D3DFMT_X1R5G5B5 , RenderTarget }, + /* 0x1D X_D3DFMT_LIN_A4R4G4B4 */ { 16, Linear, A4R4G4B4, D3DFMT_A4R4G4B4 }, + /* 0x1E X_D3DFMT_LIN_X8R8G8B8 */ { 32, Linear, X8R8G8B8, D3DFMT_X8R8G8B8 , RenderTarget }, // Alias : X_D3DFMT_LIN_X8L8V8U8 + /* 0x1F X_D3DFMT_LIN_A8 */ { 8, Linear, ______A8, D3DFMT_A8 }, + /* 0x20 X_D3DFMT_LIN_A8L8 */ { 16, Linear, ____A8L8, D3DFMT_A8L8 }, /* 0x21 undefined */ {}, /* 0x22 undefined */ {}, /* 0x23 undefined */ {}, - /* 0x24 X_D3DFMT_YUY2 */ { 16, Linear, ____YUY2, XTL::D3DFMT_YUY2 }, - /* 0x25 X_D3DFMT_UYVY */ { 16, Linear, ____UYVY, XTL::D3DFMT_UYVY }, + /* 0x24 X_D3DFMT_YUY2 */ { 16, Linear, ____YUY2, D3DFMT_YUY2 }, + /* 0x25 X_D3DFMT_UYVY */ { 16, Linear, ____UYVY, D3DFMT_UYVY }, /* 0x26 undefined */ {}, - /* 0x27 X_D3DFMT_L6V5U5 */ { 16, Swzzld, __R6G5B5, XTL::D3DFMT_L6V5U5 }, // Alias : X_D3DFMT_R6G5B5 // XQEMU NOTE : This might be signed - /* 0x28 X_D3DFMT_V8U8 */ { 16, Swzzld, ____G8B8, XTL::D3DFMT_V8U8 }, // Alias : X_D3DFMT_G8B8 // XQEMU NOTE : This might be signed - /* 0x29 X_D3DFMT_R8B8 */ { 16, Swzzld, ____R8B8, XTL::D3DFMT_R5G6B5 , Texture, "X_D3DFMT_R8B8 -> D3DFMT_R5G6B5" }, // XQEMU NOTE : This might be signed - /* 0x2A X_D3DFMT_D24S8 */ { 32, Swzzld, NoCmpnts, XTL::D3DFMT_D24S8 , DepthBuffer }, -#ifdef CXBX_USE_D3D9 - /* 0x2B X_D3DFMT_F24S8 */ { 32, Swzzld, NoCmpnts, XTL::D3DFMT_D24FS8 , DepthBuffer }, - /* 0x2C X_D3DFMT_D16 */ { 16, Swzzld, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. - /* 0x2D X_D3DFMT_F16 */ { 16, Swzzld, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer, "X_D3DFMT_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) // TODO : Use D3DFMT_R16F? - /* 0x2E X_D3DFMT_LIN_D24S8 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_D24S8 , DepthBuffer }, - /* 0x2F X_D3DFMT_LIN_F24S8 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_D24FS8 , DepthBuffer }, - /* 0x30 X_D3DFMT_LIN_D16 */ { 16, Linear, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. - /* 0x31 X_D3DFMT_LIN_F16 */ { 16, Linear, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer, "X_D3DFMT_LIN_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) // TODO : Use D3DFMT_R16F? - /* 0x32 X_D3DFMT_L16 */ { 16, Swzzld, _____L16, XTL::D3DFMT_L16 }, - /* 0x33 X_D3DFMT_V16U16 */ { 32, Swzzld, NoCmpnts, XTL::D3DFMT_V16U16 }, + /* 0x27 X_D3DFMT_L6V5U5 */ { 16, Swzzld, __R6G5B5, D3DFMT_L6V5U5 }, // Alias : X_D3DFMT_R6G5B5 // XQEMU NOTE : This might be signed + /* 0x28 X_D3DFMT_V8U8 */ { 16, Swzzld, ____G8B8, D3DFMT_V8U8 }, // Alias : X_D3DFMT_G8B8 // XQEMU NOTE : This might be signed + /* 0x29 X_D3DFMT_R8B8 */ { 16, Swzzld, ____R8B8, D3DFMT_R5G6B5 , Texture, "X_D3DFMT_R8B8 -> D3DFMT_R5G6B5" }, // XQEMU NOTE : This might be signed + /* 0x2A X_D3DFMT_D24S8 */ { 32, Swzzld, NoCmpnts, D3DFMT_D24S8 , DepthBuffer }, + /* 0x2B X_D3DFMT_F24S8 */ { 32, Swzzld, NoCmpnts, D3DFMT_D24FS8 , DepthBuffer }, + /* 0x2C X_D3DFMT_D16 */ { 16, Swzzld, NoCmpnts, D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. + /* 0x2D X_D3DFMT_F16 */ { 16, Swzzld, NoCmpnts, D3DFMT_D16 , DepthBuffer, "X_D3DFMT_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) // TODO : Use D3DFMT_R16F? + /* 0x2E X_D3DFMT_LIN_D24S8 */ { 32, Linear, NoCmpnts, D3DFMT_D24S8 , DepthBuffer }, + /* 0x2F X_D3DFMT_LIN_F24S8 */ { 32, Linear, NoCmpnts, D3DFMT_D24FS8 , DepthBuffer }, + /* 0x30 X_D3DFMT_LIN_D16 */ { 16, Linear, NoCmpnts, D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. + /* 0x31 X_D3DFMT_LIN_F16 */ { 16, Linear, NoCmpnts, D3DFMT_D16 , DepthBuffer, "X_D3DFMT_LIN_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) // TODO : Use D3DFMT_R16F? + /* 0x32 X_D3DFMT_L16 */ { 16, Swzzld, _____L16, D3DFMT_L16 }, + /* 0x33 X_D3DFMT_V16U16 */ { 32, Swzzld, NoCmpnts, D3DFMT_V16U16 }, /* 0x34 undefined */ {}, - /* 0x35 X_D3DFMT_LIN_L16 */ { 16, Linear, _____L16, XTL::D3DFMT_L16 }, - /* 0x36 X_D3DFMT_LIN_V16U16 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_V16U16 }, // Note : Seems ununsed on Xbox - /* 0x37 X_D3DFMT_LIN_L6V5U5 */ { 16, Linear, __R6G5B5, XTL::D3DFMT_L6V5U5 }, // Alias : X_D3DFMT_LIN_R6G5B5 - /* 0x38 X_D3DFMT_R5G5B5A1 */ { 16, Swzzld, R5G5B5A1, XTL::D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, - /* 0x39 X_D3DFMT_R4G4B4A4 */ { 16, Swzzld, R4G4B4A4, XTL::D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, - /* 0x3A X_D3DFMT_Q8W8V8U8 */ { 32, Swzzld, A8B8G8R8, XTL::D3DFMT_Q8W8V8U8 }, // Alias : X_D3DFMT_A8B8G8R8 // Note : D3DFMT_A8B8G8R8=32 D3DFMT_Q8W8V8U8=63 // TODO : Needs testcase. - /* 0x3B X_D3DFMT_B8G8R8A8 */ { 32, Swzzld, B8G8R8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_B8G8R8A8 -> D3DFMT_A8R8G8B8" }, - /* 0x3C X_D3DFMT_R8G8B8A8 */ { 32, Swzzld, R8G8B8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_R8G8B8A8 -> D3DFMT_A8R8G8B8" }, - /* 0x3D X_D3DFMT_LIN_R5G5B5A1 */ { 16, Linear, R5G5B5A1, XTL::D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_LIN_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, - /* 0x3E X_D3DFMT_LIN_R4G4B4A4 */ { 16, Linear, R4G4B4A4, XTL::D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_LIN_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, - /* 0x3F X_D3DFMT_LIN_A8B8G8R8 */ { 32, Linear, A8B8G8R8, XTL::D3DFMT_A8B8G8R8 }, // Note : D3DFMT_A8B8G8R8=32 D3DFMT_Q8W8V8U8=63 // TODO : Needs testcase. -#else // Direct3D8 : - /* 0x2B X_D3DFMT_F24S8 */ { 32, Swzzld, NoCmpnts, XTL::D3DFMT_D24S8 , DepthBuffer, "X_D3DFMT_F24S8 -> D3DFMT_D24S8" }, // HACK : PC doesn't have D3DFMT_F24S8 (Float vs Int) - /* 0x2C X_D3DFMT_D16 */ { 16, Swzzld, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. - /* 0x2D X_D3DFMT_F16 */ { 16, Swzzld, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer, "X_D3DFMT_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) - /* 0x2E X_D3DFMT_LIN_D24S8 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_D24S8 , DepthBuffer }, - /* 0x2F X_D3DFMT_LIN_F24S8 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_D24S8 , DepthBuffer, "X_D3DFMT_LIN_F24S8 -> D3DFMT_D24S8" }, // HACK : PC doesn't have D3DFMT_F24S8 (Float vs Int) - /* 0x30 X_D3DFMT_LIN_D16 */ { 16, Linear, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer }, // Note : X_D3DFMT_D16 is always lockable on Xbox, D3DFMT_D16 on host is not, but D3DFMT_D16_LOCKABLE often fails SetRenderTarget. - /* 0x31 X_D3DFMT_LIN_F16 */ { 16, Linear, NoCmpnts, XTL::D3DFMT_D16 , DepthBuffer, "X_D3DFMT_LIN_F16 -> D3DFMT_D16" }, // HACK : PC doesn't have D3DFMT_F16 (Float vs Int) - /* 0x32 X_D3DFMT_L16 */ { 16, Swzzld, _____L16, XTL::D3DFMT_A8L8 , Texture, "X_D3DFMT_L16 -> D3DFMT_A8L8" }, - /* 0x33 X_D3DFMT_V16U16 */ { 32, Swzzld, NoCmpnts, XTL::D3DFMT_V16U16 }, - /* 0x34 undefined */ {}, - /* 0x35 X_D3DFMT_LIN_L16 */ { 16, Linear, _____L16, XTL::D3DFMT_A8L8 , Texture, "X_D3DFMT_LIN_L16 -> D3DFMT_A8L8" }, - /* 0x36 X_D3DFMT_LIN_V16U16 */ { 32, Linear, NoCmpnts, XTL::D3DFMT_V16U16 }, // Note : Seems ununsed on Xbox - /* 0x37 X_D3DFMT_LIN_L6V5U5 */ { 16, Linear, __R6G5B5, XTL::D3DFMT_L6V5U5 }, // Alias : X_D3DFMT_LIN_R6G5B5 - /* 0x38 X_D3DFMT_R5G5B5A1 */ { 16, Swzzld, R5G5B5A1, XTL::D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, - /* 0x39 X_D3DFMT_R4G4B4A4 */ { 16, Swzzld, R4G4B4A4, XTL::D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, - /* 0x3A X_D3DFMT_Q8W8V8U8 */ { 32, Swzzld, A8B8G8R8, XTL::D3DFMT_Q8W8V8U8 }, // Alias : X_D3DFMT_A8B8G8R8 // TODO : Needs testcase. - /* 0x3B X_D3DFMT_B8G8R8A8 */ { 32, Swzzld, B8G8R8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_B8G8R8A8 -> D3DFMT_A8R8G8B8" }, - /* 0x3C X_D3DFMT_R8G8B8A8 */ { 32, Swzzld, R8G8B8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_R8G8B8A8 -> D3DFMT_A8R8G8B8" }, - /* 0x3D X_D3DFMT_LIN_R5G5B5A1 */ { 16, Linear, R5G5B5A1, XTL::D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_LIN_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, - /* 0x3E X_D3DFMT_LIN_R4G4B4A4 */ { 16, Linear, R4G4B4A4, XTL::D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_LIN_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, - /* 0x3F X_D3DFMT_LIN_A8B8G8R8 */ { 32, Linear, A8B8G8R8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_LIN_A8B8G8R8 -> D3DFMT_A8R8G8B8" }, -#endif - /* 0x40 X_D3DFMT_LIN_B8G8R8A8 */ { 32, Linear, B8G8R8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_LIN_B8G8R8A8 -> D3DFMT_A8R8G8B8" }, - /* 0x41 X_D3DFMT_LIN_R8G8B8A8 */ { 32, Linear, R8G8B8A8, XTL::D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_LIN_R8G8B8A8 -> D3DFMT_A8R8G8B8" }, + /* 0x35 X_D3DFMT_LIN_L16 */ { 16, Linear, _____L16, D3DFMT_L16 }, + /* 0x36 X_D3DFMT_LIN_V16U16 */ { 32, Linear, NoCmpnts, D3DFMT_V16U16 }, // Note : Seems ununsed on Xbox + /* 0x37 X_D3DFMT_LIN_L6V5U5 */ { 16, Linear, __R6G5B5, D3DFMT_L6V5U5 }, // Alias : X_D3DFMT_LIN_R6G5B5 + /* 0x38 X_D3DFMT_R5G5B5A1 */ { 16, Swzzld, R5G5B5A1, D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, + /* 0x39 X_D3DFMT_R4G4B4A4 */ { 16, Swzzld, R4G4B4A4, D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, + /* 0x3A X_D3DFMT_Q8W8V8U8 */ { 32, Swzzld, A8B8G8R8, D3DFMT_Q8W8V8U8 }, // Alias : X_D3DFMT_A8B8G8R8 // Note : D3DFMT_A8B8G8R8=32 D3DFMT_Q8W8V8U8=63 // TODO : Needs testcase. + /* 0x3B X_D3DFMT_B8G8R8A8 */ { 32, Swzzld, B8G8R8A8, D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_B8G8R8A8 -> D3DFMT_A8R8G8B8" }, + /* 0x3C X_D3DFMT_R8G8B8A8 */ { 32, Swzzld, R8G8B8A8, D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_R8G8B8A8 -> D3DFMT_A8R8G8B8" }, + /* 0x3D X_D3DFMT_LIN_R5G5B5A1 */ { 16, Linear, R5G5B5A1, D3DFMT_A1R5G5B5 , Texture, "X_D3DFMT_LIN_R5G5B5A1 -> D3DFMT_A1R5G5B5" }, + /* 0x3E X_D3DFMT_LIN_R4G4B4A4 */ { 16, Linear, R4G4B4A4, D3DFMT_A4R4G4B4 , Texture, "X_D3DFMT_LIN_R4G4B4A4 -> D3DFMT_A4R4G4B4" }, + /* 0x3F X_D3DFMT_LIN_A8B8G8R8 */ { 32, Linear, A8B8G8R8, D3DFMT_A8B8G8R8 }, // Note : D3DFMT_A8B8G8R8=32 D3DFMT_Q8W8V8U8=63 // TODO : Needs testcase. + /* 0x40 X_D3DFMT_LIN_B8G8R8A8 */ { 32, Linear, B8G8R8A8, D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_LIN_B8G8R8A8 -> D3DFMT_A8R8G8B8" }, + /* 0x41 X_D3DFMT_LIN_R8G8B8A8 */ { 32, Linear, R8G8B8A8, D3DFMT_A8R8G8B8 , Texture, "X_D3DFMT_LIN_R8G8B8A8 -> D3DFMT_A8R8G8B8" }, #if 0 /* 0x42 to 0x63 undefined */ {},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}, - /* 0x64 X_D3DFMT_VERTEXDATA */ { 8, Linear, NoCmpnts, XTL::D3DFMT_VERTEXDATA }, - /* 0x65 X_D3DFMT_INDEX16 */ { 16, Linear, NoCmpnts, XTL::D3DFMT_INDEX16 }, // Dxbx addition : X_D3DFMT_INDEX16 is not an Xbox format, but used internally + /* 0x64 X_D3DFMT_VERTEXDATA */ { 8, Linear, NoCmpnts, D3DFMT_VERTEXDATA }, + /* 0x65 X_D3DFMT_INDEX16 */ { 16, Linear, NoCmpnts, D3DFMT_INDEX16 }, // Dxbx addition : X_D3DFMT_INDEX16 is not an Xbox format, but used internally #endif }; -const XTL::FormatToARGBRow XTL::EmuXBFormatComponentConverter(X_D3DFORMAT Format) +const FormatToARGBRow EmuXBFormatComponentConverter(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) if (FormatInfos[Format].components != NoCmpnts) return ComponentConverters[FormatInfos[Format].components]; @@ -984,7 +958,7 @@ const XTL::FormatToARGBRow XTL::EmuXBFormatComponentConverter(X_D3DFORMAT Format } // Is there a converter available from the supplied format to ARGB? -bool XTL::EmuXBFormatCanBeConvertedToARGB(X_D3DFORMAT Format) +bool EmuXBFormatCanBeConvertedToARGB(XTL::X_D3DFORMAT Format) { const FormatToARGBRow info = EmuXBFormatComponentConverter(Format); return (info != nullptr); @@ -992,7 +966,7 @@ bool XTL::EmuXBFormatCanBeConvertedToARGB(X_D3DFORMAT Format) // Returns if convertion to ARGB is required. This is the case when // the format has a warning message and there's a converter present. -bool XTL::EmuXBFormatRequiresConversionToARGB(X_D3DFORMAT Format) +bool EmuXBFormatRequiresConversionToARGB(XTL::X_D3DFORMAT Format) { if (FormatInfos[Format].warning != nullptr) if (EmuXBFormatCanBeConvertedToARGB(Format)) @@ -1001,76 +975,76 @@ bool XTL::EmuXBFormatRequiresConversionToARGB(X_D3DFORMAT Format) return false; } -DWORD XTL::EmuXBFormatBitsPerPixel(X_D3DFORMAT Format) +DWORD EmuXBFormatBitsPerPixel(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) if (FormatInfos[Format].bits_per_pixel > 0) // TODO : Remove this return FormatInfos[Format].bits_per_pixel; return 16; // TODO : 8 } -DWORD XTL::EmuXBFormatBytesPerPixel(X_D3DFORMAT Format) +DWORD EmuXBFormatBytesPerPixel(XTL::X_D3DFORMAT Format) { return ((EmuXBFormatBitsPerPixel(Format) + 4) / 8); } -BOOL XTL::EmuXBFormatIsCompressed(X_D3DFORMAT Format) +BOOL EmuXBFormatIsCompressed(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) return (FormatInfos[Format].stored == Cmprsd); return false; } -BOOL XTL::EmuXBFormatIsLinear(X_D3DFORMAT Format) +BOOL EmuXBFormatIsLinear(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) return (FormatInfos[Format].stored == Linear); - return (Format == X_D3DFMT_VERTEXDATA); // TODO : false; + return (Format == XTL::X_D3DFMT_VERTEXDATA); // TODO : false; } -BOOL XTL::EmuXBFormatIsSwizzled(X_D3DFORMAT Format) +BOOL EmuXBFormatIsSwizzled(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) return (FormatInfos[Format].stored == Swzzld); return false; } -BOOL XTL::EmuXBFormatIsRenderTarget(X_D3DFORMAT Format) +BOOL EmuXBFormatIsRenderTarget(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) return (FormatInfos[Format].usage == RenderTarget); return false; } -BOOL XTL::EmuXBFormatIsDepthBuffer(X_D3DFORMAT Format) +BOOL EmuXBFormatIsDepthBuffer(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8) return (FormatInfos[Format].usage == DepthBuffer); return false; } -XTL::D3DFORMAT XTL::EmuXB2PC_D3DFormat(X_D3DFORMAT Format) +D3DFORMAT EmuXB2PC_D3DFormat(XTL::X_D3DFORMAT Format) { - if (Format <= X_D3DFMT_LIN_R8G8B8A8 && Format != -1 /*X_D3DFMT_UNKNOWN*/) // The last bit prevents crashing (Metal Slug 3) + if (Format <= XTL::X_D3DFMT_LIN_R8G8B8A8 && Format != -1 /*XTL::X_D3DFMT_UNKNOWN*/) // The last bit prevents crashing (Metal Slug 3) { const FormatInfo *info = &FormatInfos[Format]; if (info->warning != nullptr) { - DbgPrintf("EmuXB2PC_D3DFormat %s\n", info->warning); + EmuLog(LOG_LEVEL::DEBUG, "EmuXB2PC_D3DFormat %s", info->warning); } return info->pc; } switch (Format) { - case X_D3DFMT_VERTEXDATA: + case XTL::X_D3DFMT_VERTEXDATA: return D3DFMT_VERTEXDATA; - case ((X_D3DFORMAT)0xffffffff): + case ((XTL::X_D3DFORMAT)0xffffffff): return D3DFMT_UNKNOWN; // TODO -oCXBX: Not sure if this counts as swizzled or not... default: CxbxKrnlCleanup("EmuXB2PC_D3DFormat: Unknown Format (0x%.08X)", Format); @@ -1079,80 +1053,80 @@ XTL::D3DFORMAT XTL::EmuXB2PC_D3DFormat(X_D3DFORMAT Format) return D3DFMT_UNKNOWN; } -XTL::X_D3DFORMAT XTL::EmuPC2XB_D3DFormat(D3DFORMAT Format, bool bPreferLinear) -{ - X_D3DFORMAT result; +XTL::X_D3DFORMAT EmuPC2XB_D3DFormat(D3DFORMAT Format, bool bPreferLinear) +{ + XTL::X_D3DFORMAT result; switch(Format) { case D3DFMT_YUY2: - result = X_D3DFMT_YUY2; + result = XTL::X_D3DFMT_YUY2; break; case D3DFMT_UYVY: - result = X_D3DFMT_UYVY; + result = XTL::X_D3DFMT_UYVY; break; case D3DFMT_R5G6B5: - result = bPreferLinear ? X_D3DFMT_LIN_R5G6B5 : X_D3DFMT_R5G6B5; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_R5G6B5 : XTL::X_D3DFMT_R5G6B5; break; case D3DFMT_D24S8: - result = bPreferLinear ? X_D3DFMT_LIN_D24S8 : X_D3DFMT_D24S8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_D24S8 : XTL::X_D3DFMT_D24S8; break; case D3DFMT_DXT5: - result = X_D3DFMT_DXT5; // Compressed + result = XTL::X_D3DFMT_DXT5; // Compressed break; case D3DFMT_DXT4: - result = X_D3DFMT_DXT4; // Compressed // Same as X_D3DFMT_DXT5 + result = XTL::X_D3DFMT_DXT4; // Compressed // Same as XTL::X_D3DFMT_DXT5 break; case D3DFMT_DXT3: - result = X_D3DFMT_DXT3; // Compressed + result = XTL::X_D3DFMT_DXT3; // Compressed break; case D3DFMT_DXT2: - result = X_D3DFMT_DXT2; // Compressed // Same as X_D3DFMT_DXT3 + result = XTL::X_D3DFMT_DXT2; // Compressed // Same as XTL::X_D3DFMT_DXT3 break; case D3DFMT_DXT1: - result = X_D3DFMT_DXT1; // Compressed + result = XTL::X_D3DFMT_DXT1; // Compressed break; case D3DFMT_A1R5G5B5: - result = bPreferLinear ? X_D3DFMT_LIN_A1R5G5B5 : X_D3DFMT_A1R5G5B5; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_A1R5G5B5 : XTL::X_D3DFMT_A1R5G5B5; break; case D3DFMT_X8R8G8B8: - result = bPreferLinear ? X_D3DFMT_LIN_X8R8G8B8 : X_D3DFMT_X8R8G8B8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_X8R8G8B8 : XTL::X_D3DFMT_X8R8G8B8; break; case D3DFMT_A8R8G8B8: - result = bPreferLinear ? X_D3DFMT_LIN_A8R8G8B8 : X_D3DFMT_A8R8G8B8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_A8R8G8B8 : XTL::X_D3DFMT_A8R8G8B8; break; case D3DFMT_A4R4G4B4: - result = bPreferLinear ? X_D3DFMT_LIN_A4R4G4B4 : X_D3DFMT_A4R4G4B4; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_A4R4G4B4 : XTL::X_D3DFMT_A4R4G4B4; break; case D3DFMT_X1R5G5B5: - result = bPreferLinear ? X_D3DFMT_LIN_X1R5G5B5 : X_D3DFMT_X1R5G5B5; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_X1R5G5B5 : XTL::X_D3DFMT_X1R5G5B5; break; case D3DFMT_A8: - result = bPreferLinear ? X_D3DFMT_LIN_A8 : X_D3DFMT_A8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_A8 : XTL::X_D3DFMT_A8; break; case D3DFMT_L8: - result = bPreferLinear ? X_D3DFMT_LIN_L8 : X_D3DFMT_L8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_L8 : XTL::X_D3DFMT_L8; break; case D3DFMT_D16: - result = bPreferLinear ? X_D3DFMT_LIN_D16 : X_D3DFMT_D16; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_D16 : XTL::X_D3DFMT_D16; break; case D3DFMT_D16_LOCKABLE: - result = X_D3DFMT_D16_LOCKABLE; + result = XTL::X_D3DFMT_D16_LOCKABLE; break; case D3DFMT_UNKNOWN: - result = ((X_D3DFORMAT)0xffffffff); // TODO : return X_D3DFMT_UNKNOWN ? + result = ((XTL::X_D3DFORMAT)0xffffffff); // TODO : return XTL::X_D3DFMT_UNKNOWN ? break; // Dxbx additions : case D3DFMT_L6V5U5: - result = bPreferLinear ? X_D3DFMT_LIN_L6V5U5 : X_D3DFMT_L6V5U5; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_L6V5U5 : XTL::X_D3DFMT_L6V5U5; break; case D3DFMT_V8U8: - result = bPreferLinear ? X_D3DFMT_LIN_V8U8 : X_D3DFMT_V8U8; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_V8U8 : XTL::X_D3DFMT_V8U8; break; case D3DFMT_V16U16: - result = bPreferLinear ? X_D3DFMT_LIN_V16U16 : X_D3DFMT_V16U16; + result = bPreferLinear ? XTL::X_D3DFMT_LIN_V16U16 : XTL::X_D3DFMT_V16U16; break; case D3DFMT_VERTEXDATA: - result = X_D3DFMT_VERTEXDATA; + result = XTL::X_D3DFMT_VERTEXDATA; break; default: CxbxKrnlCleanup("EmuPC2XB_D3DFormat: Unknown Format (%d)", Format); @@ -1161,8 +1135,8 @@ XTL::X_D3DFORMAT XTL::EmuPC2XB_D3DFormat(D3DFORMAT Format, bool bPreferLinear) return result; } -DWORD XTL::EmuXB2PC_D3DLock(DWORD Flags) -{ +DWORD EmuXB2PC_D3DLock(DWORD Flags) +{ DWORD NewFlags = 0; // Need to convert the flags, TODO: fix the xbox extensions @@ -1182,166 +1156,75 @@ DWORD XTL::EmuXB2PC_D3DLock(DWORD Flags) } // convert from xbox to pc multisample formats -XTL::D3DMULTISAMPLE_TYPE XTL::EmuXB2PC_D3DMultiSampleFormat(DWORD Type) +D3DMULTISAMPLE_TYPE EmuXB2PC_D3DMultiSampleFormat(DWORD Type) { D3DMULTISAMPLE_TYPE result; switch (Type & 0xFFFF) { - case X_D3DMULTISAMPLE_NONE: + case XTL::X_D3DMULTISAMPLE_NONE: result = D3DMULTISAMPLE_NONE; break; - case X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_LINEAR: - case X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_QUINCUNX: - case X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_HORIZONTAL_LINEAR: - case X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_VERTICAL_LINEAR: + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_MULTISAMPLE_QUINCUNX: + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_HORIZONTAL_LINEAR: + case XTL::X_D3DMULTISAMPLE_2_SAMPLES_SUPERSAMPLE_VERTICAL_LINEAR: result = D3DMULTISAMPLE_2_SAMPLES; break; - case X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_LINEAR: - case X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_GAUSSIAN: - case X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_LINEAR: - case X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_GAUSSIAN: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_MULTISAMPLE_GAUSSIAN: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_LINEAR: + case XTL::X_D3DMULTISAMPLE_4_SAMPLES_SUPERSAMPLE_GAUSSIAN: result = D3DMULTISAMPLE_4_SAMPLES; break; - case X_D3DMULTISAMPLE_9_SAMPLES_MULTISAMPLE_GAUSSIAN: - case X_D3DMULTISAMPLE_9_SAMPLES_SUPERSAMPLE_GAUSSIAN: + case XTL::X_D3DMULTISAMPLE_9_SAMPLES_MULTISAMPLE_GAUSSIAN: + case XTL::X_D3DMULTISAMPLE_9_SAMPLES_SUPERSAMPLE_GAUSSIAN: result = D3DMULTISAMPLE_9_SAMPLES; break; default: - EmuWarning("Unknown Multisample Type (0x%X)!\x0d\x0a.", Type); + EmuLog(LOG_LEVEL::WARNING, "Unknown Multisample Type (0x%X)!\x0d\x0a.", Type); result = D3DMULTISAMPLE_NONE; } return result; } // lookup table for converting vertex count to primitive count -UINT XTL::EmuD3DVertexToPrimitive[11][2] = -{ +const unsigned g_XboxPrimitiveTypeInfo[11][2] = +{ + // First number is the starting number of vertices the draw requires + // Second number the number of vertices per primitive + // Example : Triangle list, has no starting vertices, and uses 3 vertices for each triangle + // Example : Triangle strip, starts with 2 vertices, and adds 1 for each triangle {0, 0}, // NULL - {1, 0}, // X_D3DPT_POINTLIST - {2, 0}, // X_D3DPT_LINELIST - {1, 1}, // X_D3DPT_LINELOOP - {1, 1}, // X_D3DPT_LINESTRIP - {3, 0}, // X_D3DPT_TRIANGLELIST - {1, 2}, // X_D3DPT_TRIANGLESTRIP - {1, 2}, // X_D3DPT_TRIANGLEFAN - {4, 0}, // X_D3DPT_QUADLIST - {2, 2}, // X_D3DPT_QUADSTRIP - {1, 0}, // X_D3DPT_POLYGON + {0, 1}, // X_D3DPT_POINTLIST + {0, 2}, // X_D3DPT_LINELIST + {1, 1}, // X_D3DPT_LINELOOP + {1, 1}, // X_D3DPT_LINESTRIP + {0, 3}, // X_D3DPT_TRIANGLELIST + {2, 1}, // X_D3DPT_TRIANGLESTRIP + {2, 1}, // X_D3DPT_TRIANGLEFAN + {0, 4}, // X_D3DPT_QUADLIST + {2, 2}, // X_D3DPT_QUADSTRIP + {0, 1}, // X_D3DPT_POLYGON }; // conversion table for xbox->pc primitive types -XTL::D3DPRIMITIVETYPE XTL::EmuPrimitiveTypeLookup[] = +const D3DPRIMITIVETYPE g_XboxPrimitiveTypeToHost[] = { - /* NULL = 0 */ (XTL::D3DPRIMITIVETYPE)0, - /* D3DPT_POINTLIST = 1, */ XTL::D3DPT_POINTLIST, - /* D3DPT_LINELIST = 2, */ XTL::D3DPT_LINELIST, - /* D3DPT_LINELOOP = 3, Xbox */ XTL::D3DPT_LINESTRIP, - /* D3DPT_LINESTRIP = 4, */ XTL::D3DPT_LINESTRIP, - /* D3DPT_TRIANGLELIST = 5, */ XTL::D3DPT_TRIANGLELIST, - /* D3DPT_TRIANGLESTRIP = 6, */ XTL::D3DPT_TRIANGLESTRIP, - /* D3DPT_TRIANGLEFAN = 7, */ XTL::D3DPT_TRIANGLEFAN, - /* D3DPT_QUADLIST = 8, Xbox */ XTL::D3DPT_TRIANGLELIST, - /* D3DPT_QUADSTRIP = 9, Xbox */ XTL::D3DPT_TRIANGLESTRIP, - /* D3DPT_POLYGON = 10, Xbox */ XTL::D3DPT_TRIANGLEFAN, - /* D3DPT_MAX = 11, */ (XTL::D3DPRIMITIVETYPE)11 + /* NULL = 0 */ (D3DPRIMITIVETYPE)0, + /* X_D3DPT_POINTLIST = 1, */ D3DPT_POINTLIST, + /* X_D3DPT_LINELIST = 2, */ D3DPT_LINELIST, + /* X_D3DPT_LINELOOP = 3, Xbox */ D3DPT_LINESTRIP, + /* X_D3DPT_LINESTRIP = 4, */ D3DPT_LINESTRIP, + /* X_D3DPT_TRIANGLELIST = 5, */ D3DPT_TRIANGLELIST, + /* X_D3DPT_TRIANGLESTRIP = 6, */ D3DPT_TRIANGLESTRIP, + /* X_D3DPT_TRIANGLEFAN = 7, */ D3DPT_TRIANGLEFAN, + /* X_D3DPT_QUADLIST = 8, Xbox */ D3DPT_TRIANGLELIST, + /* X_D3DPT_QUADSTRIP = 9, Xbox */ D3DPT_TRIANGLESTRIP, + /* X_D3DPT_POLYGON = 10, Xbox */ D3DPT_TRIANGLEFAN, + /* X_D3DPT_MAX = 11, */ (D3DPRIMITIVETYPE)11 }; -// render state conversion table -CONST DWORD XTL::EmuD3DRenderStateSimpleEncoded[174] = -{ - // WARNING: This lookup table strongly binds us to an SDK with these - // specific #define values for D3DRS_*. Make VERY sure that you have - // the correct lookup values; - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 0 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 2 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 4 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 6 - X_D3DRSSE_UNK, 0x0004037c, // 8 - , D3DRS_SHADEMODE - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 10 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 12 - 0x0004035c, 0x00040300, // 14 - D3DRS_ZWRITEENABLE, D3DRS_ALPHATESTENABLE - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 16 - X_D3DRSSE_UNK, 0x00040344, // 18 - , D3DRS_SRCBLEND - 0x00040348, X_D3DRSSE_UNK, // 20 - D3DRS_DESTBLEND - X_D3DRSSE_UNK, 0x00040354, // 22 - , D3DRS_ZFUNC - 0x00040340, 0x0004033c, // 24 - D3DRS_ALPHAREF, D3DRS_ALPHAFUNC - 0x00040310, 0x00040304, // 26 - D3DRS_DITHERENABLE, D3DRS_ALPHABLENDENABLE - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 28 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 30 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 32 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 34 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 36 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 38 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 40 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 42 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 44 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 46 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 48 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 50 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 52 - 0x00040374, 0x00040378, // 54 - D3DRS_STENCILZFAIL, D3DRS_STENCILPASS - 0x00040364, 0x00040368, // 56 - D3DRS_STENCILFUNC, D3DRS_STENCILREF - 0x0004036c, 0x00040360, // 58 - D3DRS_STENCILMASK, D3DRS_STENCILWRITEMASK - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 60 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 62 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 64 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 66 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 68 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 70 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 72 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 74 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 76 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 78 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 80 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 82 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 84 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 86 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 88 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 90 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 92 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 94 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 96 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 98 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 100 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 102 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 104 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 106 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 108 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 110 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 112 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 114 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 116 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 118 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 120 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 122 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 124 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 126 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 128 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 130 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 132 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 134 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 136 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 138 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 140 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 142 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 144 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 146 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 148 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 150 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 152 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 154 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 156 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 158 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 160 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 162 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 164 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 166 - 0x00040358, X_D3DRSSE_UNK, // 168 - D3DRS_COLORWRITEENABLE - X_D3DRSSE_UNK, 0x00040350, // 170 - X_D3DRSSE_UNK, X_D3DRSSE_UNK, // 172 -}; - -void XTL::EmuUnswizzleBox +void EmuUnswizzleBox ( CONST PVOID pSrcBuff, CONST DWORD dwWidth, @@ -1354,7 +1237,7 @@ void XTL::EmuUnswizzleBox ) // Source : Dxbx { DWORD dwMaskX = 0, dwMaskY = 0, dwMaskZ = 0; - for (uint i=1, j=1; (i < dwWidth) || (i < dwHeight) || (i < dwDepth); i <<= 1) { + for (unsigned int i=1, j=1; (i < dwWidth) || (i < dwHeight) || (i < dwDepth); i <<= 1) { if (i < dwWidth) { dwMaskX |= j; j <<= 1; @@ -1381,14 +1264,14 @@ void XTL::EmuUnswizzleBox const uint8_t *pSrc = (uint8_t *)pSrcBuff; uint8_t *pDestSlice = (uint8_t *)pDstBuff; - for (uint z = 0; z < dwDepth; z++) { + for (unsigned int z = 0; z < dwDepth; z++) { uint8_t *pDestRow = pDestSlice; DWORD dwY = dwStartY; - for (uint y = 0; y < dwHeight; y++) { + for (unsigned int y = 0; y < dwHeight; y++) { DWORD dwYZ = dwY | dwZ; DWORD dwX = dwStartX; - for (uint x = 0; x < dwWidth; x++) { - uint delta = dwX | dwYZ; + for (unsigned int x = 0; x < dwWidth; x++) { + unsigned int delta = dwX | dwYZ; pDestRow[x] = pSrc[delta]; // copy one pixel dwX = (dwX - dwMaskX) & dwMaskX; // step to next pixel in source } @@ -1406,14 +1289,14 @@ void XTL::EmuUnswizzleBox const uint16_t *pSrc = (uint16_t *)pSrcBuff; uint16_t *pDestSlice = (uint16_t *)pDstBuff; - for (uint z = 0; z < dwDepth; z++) { + for (unsigned int z = 0; z < dwDepth; z++) { uint16_t *pDestRow = pDestSlice; DWORD dwY = dwStartY; - for (uint y = 0; y < dwHeight; y++) { + for (unsigned int y = 0; y < dwHeight; y++) { DWORD dwYZ = dwY | dwZ; DWORD dwX = dwStartX; - for (uint x = 0; x < dwWidth; x++) { - uint delta = dwX | dwYZ; + for (unsigned int x = 0; x < dwWidth; x++) { + unsigned int delta = dwX | dwYZ; pDestRow[x] = pSrc[delta]; // copy one pixel dwX = (dwX - dwMaskX) & dwMaskX; // step to next pixel in source } @@ -1431,14 +1314,14 @@ void XTL::EmuUnswizzleBox const uint32_t *pSrc = (uint32_t *)pSrcBuff; uint32_t *pDestSlice = (uint32_t *)pDstBuff; - for (uint z = 0; z < dwDepth; z++) { + for (unsigned int z = 0; z < dwDepth; z++) { uint32_t *pDestRow = pDestSlice; DWORD dwY = dwStartY; - for (uint y = 0; y < dwHeight; y++) { + for (unsigned int y = 0; y < dwHeight; y++) { DWORD dwYZ = dwY | dwZ; DWORD dwX = dwStartX; - for (uint x = 0; x < dwWidth; x++) { - uint delta = dwX | dwYZ; + for (unsigned int x = 0; x < dwWidth; x++) { + unsigned int delta = dwX | dwYZ; pDestRow[x] = pSrc[delta]; // copy one pixel dwX = (dwX - dwMaskX) & dwMaskX; // step to next pixel in source } @@ -1454,13 +1337,18 @@ void XTL::EmuUnswizzleBox } } } // EmuUnswizzleBox NOPATCH - -namespace XTL -{ - + +// Notes : +// * most renderstates were introduced in the (lowest known) XDK version : 3424 +// * additional renderstates were introduced between 3434 and 4627 +// * we MUST list exact versions for each of those, since their inserts impacts mapping! +// * renderstates were finalized in 4627 (so no change after that version) +// * renderstates after D3DRS_MULTISAMPLEMASK have no host mapping, thus no impact +// * D3DRS_MULTISAMPLETYPE seems the only renderstate that got removed (after 3944, before 4039) +// * all renderstates marked 3424 are also verified present in 3944 const RenderStateInfo DxbxRenderStateInfo[] = { - // String Ord Version Type Method Native + // String Ord Version Type Method Native { "D3DRS_PSALPHAINPUTS0" /*= 0*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(0) }, { "D3DRS_PSALPHAINPUTS1" /*= 1*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(1) }, { "D3DRS_PSALPHAINPUTS2" /*= 2*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(2) }, @@ -1537,80 +1425,73 @@ const RenderStateInfo DxbxRenderStateInfo[] = { { "D3DRS_STENCILMASK" /*= 72*/, 3424, xtBYTE, NV2A_STENCIL_FUNC_MASK, D3DRS_STENCILMASK, "BYTE mask value used in stencil test" }, { "D3DRS_STENCILWRITEMASK" /*= 73*/, 3424, xtBYTE, NV2A_STENCIL_MASK, D3DRS_STENCILWRITEMASK, "BYTE write mask applied to values written to stencil buffer" }, { "D3DRS_BLENDOP" /*= 74*/, 3424, xtD3DBLENDOP, NV2A_BLEND_EQUATION, D3DRS_BLENDOP }, -#ifdef CXBX_USE_D3D9 { "D3DRS_BLENDCOLOR" /*= 75*/, 3424, xtD3DCOLOR, NV2A_BLEND_COLOR, D3DRS_BLENDFACTOR, "D3DCOLOR for D3DBLEND_CONSTANTCOLOR" }, // D3D9 D3DRS_BLENDFACTOR : D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR -#else - { "D3DRS_BLENDCOLOR" /*= 75*/, 3424, xtD3DCOLOR, NV2A_BLEND_COLOR, D3DRS_NONE, "D3DCOLOR for D3DBLEND_CONSTANTCOLOR" }, -#endif { "D3DRS_SWATHWIDTH" /*= 76*/, 3424, xtD3DSWATH, NV2A_SWATH_WIDTH }, - { "D3DRS_POLYGONOFFSETZSLOPESCALE" /*= 77*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_FACTOR, D3DRS_NONE, "float Z factor for shadow maps" }, + { "D3DRS_POLYGONOFFSETZSLOPESCALE" /*= 77*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_FACTOR, D3DRS_UNSUPPORTED, "float Z factor for shadow maps" }, { "D3DRS_POLYGONOFFSETZOFFSET" /*= 78*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_UNITS }, { "D3DRS_POINTOFFSETENABLE" /*= 79*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_POINT_ENABLE }, { "D3DRS_WIREFRAMEOFFSETENABLE" /*= 80*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_LINE_ENABLE }, { "D3DRS_SOLIDOFFSETENABLE" /*= 81*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_FILL_ENABLE }, - { "D3DRS_DEPTHCLIPCONTROL" /*= 82*/, 4627, xtD3DDCC, NV2A_DEPTHCLIPCONTROL }, - { "D3DRS_STIPPLEENABLE" /*= 83*/, 4627, xtBOOL, NV2A_POLYGON_STIPPLE_ENABLE }, - { "D3DRS_SIMPLE_UNUSED8" /*= 84*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED7" /*= 85*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED6" /*= 86*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED5" /*= 87*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED4" /*= 88*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED3" /*= 89*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED2" /*= 90*/, 4627, xtDWORD, 0 }, - { "D3DRS_SIMPLE_UNUSED1" /*= 91*/, 4627, xtDWORD, 0 }, + { "D3DRS_DEPTHCLIPCONTROL" /*= 82*/, 4432, xtD3DDCC, NV2A_DEPTHCLIPCONTROL }, // Verified absent in 4361, present in 4432 TODO : Might be introduced around 4400? + { "D3DRS_STIPPLEENABLE" /*= 83*/, 4627, xtBOOL, NV2A_POLYGON_STIPPLE_ENABLE }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED8" /*= 84*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED7" /*= 85*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED6" /*= 86*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED5" /*= 87*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED4" /*= 88*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED3" /*= 89*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED2" /*= 90*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_SIMPLE_UNUSED1" /*= 91*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? // End of "simple" render states, continuing with "deferred" render states : - { "D3DRS_FOGENABLE" /*= 92*/, 3424, xtBOOL, NV2A_FOG_ENABLE, D3DRS_FOGENABLE }, - { "D3DRS_FOGTABLEMODE" /*= 93*/, 3424, xtD3DFOGMODE, NV2A_FOG_MODE, D3DRS_FOGTABLEMODE }, - { "D3DRS_FOGSTART" /*= 94*/, 3424, xtFloat, NV2A_FOG_COORD_DIST, D3DRS_FOGSTART }, - { "D3DRS_FOGEND" /*= 95*/, 3424, xtFloat, NV2A_FOG_MODE, D3DRS_FOGEND }, - { "D3DRS_FOGDENSITY" /*= 96*/, 3424, xtFloat, NV2A_FOG_EQUATION_CONSTANT, D3DRS_FOGDENSITY }, // + NV2A_FOG_EQUATION_LINEAR + NV2A_FOG_EQUATION_QUADRATIC - { "D3DRS_RANGEFOGENABLE" /*= 97*/, 3424, xtBOOL, NV2A_FOG_COORD_DIST, D3DRS_RANGEFOGENABLE }, - { "D3DRS_WRAP0" /*= 98*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(0), D3DRS_WRAP0 }, - { "D3DRS_WRAP1" /*= 99*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(1), D3DRS_WRAP1 }, - { "D3DRS_WRAP2" /*= 100*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(2), D3DRS_WRAP2 }, - { "D3DRS_WRAP3" /*= 101*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(3), D3DRS_WRAP3 }, - { "D3DRS_LIGHTING" /*= 102*/, 3424, xtBOOL, NV2A_LIGHT_MODEL, D3DRS_LIGHTING }, // TODO : Needs push-buffer data conversion - { "D3DRS_SPECULARENABLE" /*= 103*/, 3424, xtBOOL, NV2A_RC_FINAL0, D3DRS_SPECULARENABLE }, - { "D3DRS_LOCALVIEWER" /*= 104*/, 3424, xtBOOL, 0, D3DRS_LOCALVIEWER }, - { "D3DRS_COLORVERTEX" /*= 105*/, 3424, xtBOOL, 0, D3DRS_COLORVERTEX }, - { "D3DRS_BACKSPECULARMATERIALSOURCE" /*= 106*/, 3424, xtD3DMCS, 0 }, // nsp. - { "D3DRS_BACKDIFFUSEMATERIALSOURCE" /*= 107*/, 3424, xtD3DMCS, 0 }, // nsp. - { "D3DRS_BACKAMBIENTMATERIALSOURCE" /*= 108*/, 3424, xtD3DMCS, 0 }, // nsp. - { "D3DRS_BACKEMISSIVEMATERIALSOURCE" /*= 109*/, 3424, xtD3DMCS, 0 }, // nsp. - { "D3DRS_SPECULARMATERIALSOURCE" /*= 110*/, 3424, xtD3DMCS, NV2A_COLOR_MATERIAL, D3DRS_SPECULARMATERIALSOURCE }, - { "D3DRS_DIFFUSEMATERIALSOURCE" /*= 111*/, 3424, xtD3DMCS, 0, D3DRS_DIFFUSEMATERIALSOURCE }, - { "D3DRS_AMBIENTMATERIALSOURCE" /*= 112*/, 3424, xtD3DMCS, 0, D3DRS_AMBIENTMATERIALSOURCE }, - { "D3DRS_EMISSIVEMATERIALSOURCE" /*= 113*/, 3424, xtD3DMCS, 0, D3DRS_EMISSIVEMATERIALSOURCE }, - { "D3DRS_BACKAMBIENT" /*= 114*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R }, // ..NV2A_MATERIAL_FACTOR_BACK_B nsp. Was NV2A_LIGHT_MODEL_BACK_AMBIENT_R - { "D3DRS_AMBIENT" /*= 115*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R, D3DRS_AMBIENT }, // ..NV2A_LIGHT_MODEL_FRONT_AMBIENT_B + NV2A_MATERIAL_FACTOR_FRONT_R..NV2A_MATERIAL_FACTOR_FRONT_A Was NV2A_LIGHT_MODEL_FRONT_AMBIENT_R - { "D3DRS_POINTSIZE" /*= 116*/, 3424, xtFloat, NV2A_POINT_PARAMETER(0), D3DRS_POINTSIZE }, - { "D3DRS_POINTSIZE_MIN" /*= 117*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MIN }, - { "D3DRS_POINTSPRITEENABLE" /*= 118*/, 3424, xtBOOL, NV2A_POINT_SMOOTH_ENABLE, D3DRS_POINTSPRITEENABLE }, - { "D3DRS_POINTSCALEENABLE" /*= 119*/, 3424, xtBOOL, NV2A_POINT_PARAMETERS_ENABLE, D3DRS_POINTSCALEENABLE }, - { "D3DRS_POINTSCALE_A" /*= 120*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_A }, - { "D3DRS_POINTSCALE_B" /*= 121*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_B }, - { "D3DRS_POINTSCALE_C" /*= 122*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_C }, - { "D3DRS_POINTSIZE_MAX" /*= 123*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MAX }, - { "D3DRS_PATCHEDGESTYLE" /*= 124*/, 3424, xtDWORD, 0, D3DRS_PATCHEDGESTYLE }, // D3DPATCHEDGESTYLE? -#ifdef CXBX_USE_D3D9 // D3DRS_PATCHSEGMENTS exists in Direct3D 8, but not in 9 !? - { "D3DRS_PATCHSEGMENTS" /*= 125*/, 3424, xtDWORD, 0 }, // nsp. -#else - { "D3DRS_PATCHSEGMENTS" /*= 125*/, 3424, xtDWORD, 0, D3DRS_PATCHSEGMENTS }, -#endif + // Verified as XDK 3911 Deferred RenderStates (3424 yet to do) + { "D3DRS_FOGENABLE" /*= 92*/, 3424, xtBOOL, NV2A_FOG_ENABLE, D3DRS_FOGENABLE }, // TRUE to enable fog blending + { "D3DRS_FOGTABLEMODE" /*= 93*/, 3424, xtD3DFOGMODE, NV2A_FOG_MODE, D3DRS_FOGTABLEMODE }, // D3DFOGMODE + { "D3DRS_FOGSTART" /*= 94*/, 3424, xtFloat, NV2A_FOG_COORD_DIST, D3DRS_FOGSTART }, // float fog start (for both vertex and pixel fog) + { "D3DRS_FOGEND" /*= 95*/, 3424, xtFloat, NV2A_FOG_MODE, D3DRS_FOGEND }, // float fog end + { "D3DRS_FOGDENSITY" /*= 96*/, 3424, xtFloat, NV2A_FOG_EQUATION_CONSTANT, D3DRS_FOGDENSITY }, // float fog density // + NV2A_FOG_EQUATION_LINEAR + NV2A_FOG_EQUATION_QUADRATIC + { "D3DRS_RANGEFOGENABLE" /*= 97*/, 3424, xtBOOL, NV2A_FOG_COORD_DIST, D3DRS_RANGEFOGENABLE }, // TRUE to enable range-based fog + { "D3DRS_WRAP0" /*= 98*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(0), D3DRS_WRAP0 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 1st texture coord. + { "D3DRS_WRAP1" /*= 99*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(1), D3DRS_WRAP1 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 2nd texture coord. + { "D3DRS_WRAP2" /*= 100*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(2), D3DRS_WRAP2 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 3rd texture coord. + { "D3DRS_WRAP3" /*= 101*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(3), D3DRS_WRAP3 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 4th texture coord. + { "D3DRS_LIGHTING" /*= 102*/, 3424, xtBOOL, NV2A_LIGHT_MODEL, D3DRS_LIGHTING }, // TRUE to enable lighting // TODO : Needs push-buffer data conversion + { "D3DRS_SPECULARENABLE" /*= 103*/, 3424, xtBOOL, NV2A_RC_FINAL0, D3DRS_SPECULARENABLE }, // TRUE to enable specular + { "D3DRS_LOCALVIEWER" /*= 104*/, 3424, xtBOOL, 0, D3DRS_LOCALVIEWER }, // TRUE to enable camera-relative specular highlights + { "D3DRS_COLORVERTEX" /*= 105*/, 3424, xtBOOL, 0, D3DRS_COLORVERTEX }, // TRUE to enable per-vertex color + { "D3DRS_BACKSPECULARMATERIALSOURCE" /*= 106*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp. + { "D3DRS_BACKDIFFUSEMATERIALSOURCE" /*= 107*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp. + { "D3DRS_BACKAMBIENTMATERIALSOURCE" /*= 108*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp. + { "D3DRS_BACKEMISSIVEMATERIALSOURCE" /*= 109*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp. + { "D3DRS_SPECULARMATERIALSOURCE" /*= 110*/, 3424, xtD3DMCS, NV2A_COLOR_MATERIAL, D3DRS_SPECULARMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE + { "D3DRS_DIFFUSEMATERIALSOURCE" /*= 111*/, 3424, xtD3DMCS, 0, D3DRS_DIFFUSEMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE + { "D3DRS_AMBIENTMATERIALSOURCE" /*= 112*/, 3424, xtD3DMCS, 0, D3DRS_AMBIENTMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE + { "D3DRS_EMISSIVEMATERIALSOURCE" /*= 113*/, 3424, xtD3DMCS, 0, D3DRS_EMISSIVEMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE + { "D3DRS_BACKAMBIENT" /*= 114*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R }, // D3DCOLOR (Xbox extension) // ..NV2A_MATERIAL_FACTOR_BACK_B nsp. Was NV2A_LIGHT_MODEL_BACK_AMBIENT_R + { "D3DRS_AMBIENT" /*= 115*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R, D3DRS_AMBIENT }, // D3DCOLOR // ..NV2A_LIGHT_MODEL_FRONT_AMBIENT_B + NV2A_MATERIAL_FACTOR_FRONT_R..NV2A_MATERIAL_FACTOR_FRONT_A Was NV2A_LIGHT_MODEL_FRONT_AMBIENT_R + { "D3DRS_POINTSIZE" /*= 116*/, 3424, xtFloat, NV2A_POINT_PARAMETER(0), D3DRS_POINTSIZE }, // float point size + { "D3DRS_POINTSIZE_MIN" /*= 117*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MIN }, // float point size min threshold + { "D3DRS_POINTSPRITEENABLE" /*= 118*/, 3424, xtBOOL, NV2A_POINT_SMOOTH_ENABLE, D3DRS_POINTSPRITEENABLE }, // TRUE to enable point sprites + { "D3DRS_POINTSCALEENABLE" /*= 119*/, 3424, xtBOOL, NV2A_POINT_PARAMETERS_ENABLE, D3DRS_POINTSCALEENABLE }, // TRUE to enable point size scaling + { "D3DRS_POINTSCALE_A" /*= 120*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_A }, // float point attenuation A value + { "D3DRS_POINTSCALE_B" /*= 121*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_B }, // float point attenuation B value + { "D3DRS_POINTSCALE_C" /*= 122*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_C }, // float point attenuation C value + { "D3DRS_POINTSIZE_MAX" /*= 123*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MAX }, // float point size max threshold + { "D3DRS_PATCHEDGESTYLE" /*= 124*/, 3424, xtDWORD, 0, D3DRS_PATCHEDGESTYLE }, // D3DPATCHEDGESTYLE + { "D3DRS_PATCHSEGMENTS" /*= 125*/, 3424, xtDWORD, 0 }, // DWORD number of segments per edge when drawing patches, nsp (D3DRS_PATCHSEGMENTS exists in Direct3D 8, but not in 9) // TODO -oDxbx : Is X_D3DRS_SWAPFILTER really a xtD3DMULTISAMPLE_TYPE? - { "D3DRS_SWAPFILTER" /*= 126*/, 4361, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_NONE, "D3DTEXF_LINEAR etc. filter to use for Swap" }, // nsp. - { "D3DRS_PRESENTATIONINTERVAL" /*= 127*/, 4627, xtDWORD, 0 }, // nsp. - { "D3DRS_DEFERRED_UNUSED8" /*= 128*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED7" /*= 129*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED6" /*= 130*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED5" /*= 131*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED4" /*= 132*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED3" /*= 133*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED2" /*= 134*/, 4627, xtDWORD, 0 }, - { "D3DRS_DEFERRED_UNUSED1" /*= 135*/, 4627, xtDWORD, 0 }, + { "D3DRS_SWAPFILTER" /*= 126*/, 4039, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_UNSUPPORTED, "D3DTEXF_LINEAR etc. filter to use for Swap" }, // nsp. Verified absent in 3944, present in 4039 TODO : Might be introduced in 4034? + { "D3DRS_PRESENTATIONINTERVAL" /*= 127*/, 4627, xtDWORD, 0 }, // nsp. Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED8" /*= 128*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED7" /*= 129*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED6" /*= 130*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED5" /*= 131*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED4" /*= 132*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED3" /*= 133*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED2" /*= 134*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DEFERRED_UNUSED1" /*= 135*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? // End of "deferred" render states, continuing with "complex" render states : - { "D3DRS_PSTEXTUREMODES" /*= 136*/, 3424, xtDWORD, 0 }, + { "D3DRS_PSTEXTUREMODES" /*= 136*/, 3424, xtDWORD, 0 }, // This is where pPSDef->PSTextureModes is stored (outside the pPSDEF - see DxbxUpdateActivePixelShader) { "D3DRS_VERTEXBLEND" /*= 137*/, 3424, xtD3DVERTEXBLENDFLAGS, NV2A_SKIN_MODE, D3DRS_VERTEXBLEND }, { "D3DRS_FOGCOLOR" /*= 138*/, 3424, xtD3DCOLOR, NV2A_FOG_COLOR, D3DRS_FOGCOLOR }, // SwapRgb { "D3DRS_FILLMODE" /*= 139*/, 3424, xtD3DFILLMODE, NV2A_POLYGON_MODE_FRONT, D3DRS_FILLMODE }, @@ -1623,33 +1504,30 @@ const RenderStateInfo DxbxRenderStateInfo[] = { { "D3DRS_FRONTFACE" /*= 146*/, 3424, xtD3DFRONT, NV2A_FRONT_FACE }, // nsp. { "D3DRS_CULLMODE" /*= 147*/, 3424, xtD3DCULL, NV2A_CULL_FACE, D3DRS_CULLMODE }, { "D3DRS_TEXTUREFACTOR" /*= 148*/, 3424, xtD3DCOLOR, NV2A_RC_CONSTANT_COLOR0(0), D3DRS_TEXTUREFACTOR }, -#ifdef CXBX_USE_D3D9 - { "D3DRS_ZBIAS" /*= 149*/, 3424, xtLONG, 0, D3DRS_DEPTHBIAS }, -#else - { "D3DRS_ZBIAS" /*= 149*/, 3424, xtLONG, 0, D3DRS_ZBIAS }, -#endif + { "D3DRS_ZBIAS" /*= 149*/, 3424, xtLONG, 0, D3DRS_DEPTHBIAS }, // Was D3DRS_ZBIAS { "D3DRS_LOGICOP" /*= 150*/, 3424, xtD3DLOGICOP, NV2A_COLOR_LOGIC_OP_OP }, // nsp. -#ifdef CXBX_USE_D3D9 - { "D3DRS_EDGEANTIALIAS" /*= 151*/, 3424, xtBOOL, NV2A_LINE_SMOOTH_ENABLE, D3DRS_ANTIALIASEDLINEENABLE }, // Dxbx note : No Xbox ext. (according to Direct3D8) ! -#else - { "D3DRS_EDGEANTIALIAS" /*= 151*/, 3424, xtBOOL, NV2A_LINE_SMOOTH_ENABLE, D3DRS_EDGEANTIALIAS }, // Dxbx note : No Xbox ext. (according to Direct3D8) ! -#endif + { "D3DRS_EDGEANTIALIAS" /*= 151*/, 3424, xtBOOL, NV2A_LINE_SMOOTH_ENABLE, D3DRS_ANTIALIASEDLINEENABLE }, // Was D3DRS_EDGEANTIALIAS. Dxbx note : No Xbox ext. (according to Direct3D8) ! { "D3DRS_MULTISAMPLEANTIALIAS" /*= 152*/, 3424, xtBOOL, NV2A_MULTISAMPLE_CONTROL, D3DRS_MULTISAMPLEANTIALIAS }, { "D3DRS_MULTISAMPLEMASK" /*= 153*/, 3424, xtDWORD, NV2A_MULTISAMPLE_CONTROL, D3DRS_MULTISAMPLEMASK }, -// { "D3DRS_MULTISAMPLETYPE" /*= 154*/, 3424, xtD3DMULTISAMPLE_TYPE, 0 }, // [-3911] \_ aliasses D3DMULTISAMPLE_TYPE - { "D3DRS_MULTISAMPLEMODE" /*= 154*/, 4361, xtD3DMULTISAMPLEMODE, 0 }, // [4361+] / D3DMULTISAMPLEMODE for the backbuffer - { "D3DRS_MULTISAMPLERENDERTARGETMODE" /*= 155*/, 4242, xtD3DMULTISAMPLEMODE, NV2A_RT_FORMAT }, - { "D3DRS_SHADOWFUNC" /*= 156*/, 3424, xtD3DCMPFUNC, NV2A_TX_RCOMP }, - { "D3DRS_LINEWIDTH" /*= 157*/, 3424, xtFloat, NV2A_LINE_WIDTH }, - { "D3DRS_SAMPLEALPHA" /*= 158*/, 4627, xtD3DSAMPLEALPHA, 0 }, // TODO : Later than 3424, but earlier then 4627? - { "D3DRS_DXT1NOISEENABLE" /*= 159*/, 3424, xtBOOL, NV2A_CLEAR_DEPTH_VALUE }, - { "D3DRS_YUVENABLE" /*= 160*/, 3911, xtBOOL, NV2A_CONTROL0 }, - { "D3DRS_OCCLUSIONCULLENABLE" /*= 161*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, - { "D3DRS_STENCILCULLENABLE" /*= 162*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, - { "D3DRS_ROPZCMPALWAYSREAD" /*= 163*/, 3911, xtBOOL, 0 }, - { "D3DRS_ROPZREAD" /*= 164*/, 3911, xtBOOL, 0 }, - { "D3DRS_DONOTCULLUNCOMPRESSED" /*= 165*/, 3911, xtBOOL, 0 } + { "D3DRS_MULTISAMPLETYPE" /*= 154*/, 3424, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_UNSUPPORTED, "aliasses D3DMULTISAMPLE_TYPE, removed from 4039 onward", 4039 }, // Verified present in 3944, removed in 4039 TODO : Might be removed in 4034? + { "D3DRS_MULTISAMPLEMODE" /*= 155*/, 4039, xtD3DMULTISAMPLEMODE, 0 }, // D3DMULTISAMPLEMODE for the backbuffer. Verified absent in 3944, present in 4039 TODO : Might be introduced in 4034? + { "D3DRS_MULTISAMPLERENDERTARGETMODE" /*= 156*/, 4034, xtD3DMULTISAMPLEMODE, NV2A_RT_FORMAT }, // Verified absent in 3944, present in 4039. Presence in 4034 is based on test-case : The Simpsons Road Rage + { "D3DRS_SHADOWFUNC" /*= 157*/, 3424, xtD3DCMPFUNC, NV2A_TX_RCOMP }, + { "D3DRS_LINEWIDTH" /*= 158*/, 3424, xtFloat, NV2A_LINE_WIDTH }, + { "D3DRS_SAMPLEALPHA" /*= 159*/, 4627, xtD3DSAMPLEALPHA, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between? + { "D3DRS_DXT1NOISEENABLE" /*= 160*/, 3424, xtBOOL, NV2A_CLEAR_DEPTH_VALUE }, + { "D3DRS_YUVENABLE" /*= 161*/, 3911, xtBOOL, NV2A_CONTROL0 }, // Verified present in 3944 + { "D3DRS_OCCLUSIONCULLENABLE" /*= 162*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, // Verified present in 3944 + { "D3DRS_STENCILCULLENABLE" /*= 163*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, // Verified present in 3944 + { "D3DRS_ROPZCMPALWAYSREAD" /*= 164*/, 3911, xtBOOL, 0 }, // Verified present in 3944 + { "D3DRS_ROPZREAD" /*= 165*/, 3911, xtBOOL, 0 }, // Verified present in 3944 + { "D3DRS_DONOTCULLUNCOMPRESSED" /*= 166*/, 3911, xtBOOL, 0 } // Verified present in 3944 }; + +const RenderStateInfo& GetDxbxRenderStateInfo(int State) +{ + return DxbxRenderStateInfo[State]; +} /*Direct3D8 states unused : D3DRS_LINEPATTERN @@ -1704,8 +1582,6 @@ Direct3D9 states unused : D3DRS_BLENDOPALPHA = 209 // Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ -}; // end of namespace XTL - #if 0 /* Generic swizzle function, usable for both x and y dimensions. When passing x, Max should be 2*height, and Shift should be 0 @@ -1719,7 +1595,7 @@ uint32 Swizzle(uint32 value, uint32 max, uint32 shift) else result = value % max; - // The following is based on http://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN : + // The following is based on https://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN : // --------------------------------11111111111111111111111111111111 result = (result | (result << 8)) & 0x00FF00FF; // 0000000000000000111111111111111100000000000000001111111111111111 result = (result | (result << 4)) & 0x0F0F0F0F; // 0000111100001111000011110000111100001111000011110000111100001111 @@ -1737,8 +1613,6 @@ uint32 Swizzle(uint32 value, uint32 max, uint32 shift) typedef uint16 TRGB16; -using namespace XTL; // for X_D3DFMT_* - // test-case: Frogger, Turok, Crazy Taxi 3 and many more bool WndMain::ReadS3TCFormatIntoBitmap(uint32 format, unsigned char *data, uint32 dataSize, int width, int height, int pitch, void*& bitmap) { @@ -1751,14 +1625,14 @@ bool WndMain::ReadS3TCFormatIntoBitmap(uint32 format, unsigned char *data, uint3 j = k = p = x = y = 0; // sanity checks - if (format != X_D3DFMT_DXT1 && format != X_D3DFMT_DXT3 && format != X_D3DFMT_DXT5) + if (format != XTL::X_D3DFMT_DXT1 && format != XTL::X_D3DFMT_DXT3 && format != XTL::X_D3DFMT_DXT5) return false; if (!(width > 0) || !(height > 0)) return false; while (j < dataSize) { - if (format != X_D3DFMT_DXT1) // Skip X_D3DFMT_DXT3 and X_D3DFMT_DXT5 alpha data (ported from Dxbx) + if (format != XTL::X_D3DFMT_DXT1) // Skip XTL::X_D3DFMT_DXT3 and XTL::X_D3DFMT_DXT5 alpha data (ported from Dxbx) j += 8; // Read two 16-bit pixels @@ -1841,13 +1715,13 @@ bool WndMain::ReadSwizzledFormatIntoBitmap(uint32 format, unsigned char *data, u TRGB32* yscanline; // sanity checks - if (format != X_D3DFMT_A8R8G8B8 && format != X_D3DFMT_X8R8G8B8) + if (format != XTL::X_D3DFMT_A8R8G8B8 && format != XTL::X_D3DFMT_X8R8G8B8) return false; if (!(width > 0) || !(height > 0)) return false; xSwizzle = (uint32*)malloc(sizeof(uint32) * width); - if (xSwizzle == NULL) + if (xSwizzle == nullptr) return false; for (x = 0; x < width; x++) @@ -1879,13 +1753,13 @@ bool WndMain::ReadSwizzled16bitFormatIntoBitmap(uint32 format, unsigned char *da TRGB16* yscanline; // sanity checks - if (format != X_D3DFMT_R5G6B5) + if (format != XTL::X_D3DFMT_R5G6B5) return false; if (!(width > 0) || !(height > 0)) return false; xSwizzle = (uint32*)malloc(sizeof(uint32) * width); - if (xSwizzle == NULL) + if (xSwizzle == nullptr) return false; for (x = 0; x < width; x++) diff --git a/src/CxbxKrnl/EmuD3D8/Convert.h b/src/core/hle/D3D8/XbConvert.h old mode 100755 new mode 100644 similarity index 92% rename from src/CxbxKrnl/EmuD3D8/Convert.h rename to src/core/hle/D3D8/XbConvert.h index 8ce72b2d4..a4fec49f7 --- a/src/CxbxKrnl/EmuD3D8/Convert.h +++ b/src/core/hle/D3D8/XbConvert.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->Convert.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,53 +22,58 @@ // * All rights reserved // * // ****************************************************************** -#ifndef CONVERT_H -#define CONVERT_H +#ifndef XBCONVERT_H +#define XBCONVERT_H -#include "CxbxKrnl.h" +#include "core\kernel\init\CxbxKrnl.h" + +#include "core\hle\D3D8\XbD3D8Types.h" +#define VERTICES_PER_DOT 1 +#define VERTICES_PER_LINE 2 #define VERTICES_PER_TRIANGLE 3 #define VERTICES_PER_QUAD 4 #define TRIANGLES_PER_QUAD 2 +#define LOG_PREFIX_D3DCVT CXBXR_MODULE::D3DCVT + // simple render state encoding lookup table #define X_D3DRSSE_UNK 0x7fffffff -extern CONST DWORD EmuD3DRenderStateSimpleEncoded[174]; -typedef void(*FormatToARGBRow)(const uint8* src, uint8* dst_argb, int width); +typedef void(*FormatToARGBRow)(const uint8_t* src, uint8_t* dst_argb, int width); -extern const FormatToARGBRow EmuXBFormatComponentConverter(X_D3DFORMAT Format); +extern const FormatToARGBRow EmuXBFormatComponentConverter(XTL::X_D3DFORMAT Format); -bool EmuXBFormatCanBeConvertedToARGB(X_D3DFORMAT Format); +bool EmuXBFormatCanBeConvertedToARGB(XTL::X_D3DFORMAT Format); -bool EmuXBFormatRequiresConversionToARGB(X_D3DFORMAT Format); +bool EmuXBFormatRequiresConversionToARGB(XTL::X_D3DFORMAT Format); // how many bits does this format use per pixel? -extern DWORD EmuXBFormatBitsPerPixel(X_D3DFORMAT Format); +extern DWORD EmuXBFormatBitsPerPixel(XTL::X_D3DFORMAT Format); // how many bytes does this format use per pixel? -extern DWORD EmuXBFormatBytesPerPixel(X_D3DFORMAT Format); +extern DWORD EmuXBFormatBytesPerPixel(XTL::X_D3DFORMAT Format); // is this format compressed? -extern BOOL EmuXBFormatIsCompressed(X_D3DFORMAT Format); +extern BOOL EmuXBFormatIsCompressed(XTL::X_D3DFORMAT Format); // is this format linear? -extern BOOL EmuXBFormatIsLinear(X_D3DFORMAT Format); +extern BOOL EmuXBFormatIsLinear(XTL::X_D3DFORMAT Format); // is this format swizzled? -extern BOOL EmuXBFormatIsSwizzled(X_D3DFORMAT Format); +extern BOOL EmuXBFormatIsSwizzled(XTL::X_D3DFORMAT Format); // is this format a valid render target? -extern BOOL EmuXBFormatIsRenderTarget(X_D3DFORMAT Format); +extern BOOL EmuXBFormatIsRenderTarget(XTL::X_D3DFORMAT Format); // is this format a valid depth buffer? -extern BOOL EmuXBFormatIsDepthBuffer(X_D3DFORMAT Format); +extern BOOL EmuXBFormatIsDepthBuffer(XTL::X_D3DFORMAT Format); // convert from xbox to pc color formats -extern D3DFORMAT EmuXB2PC_D3DFormat(X_D3DFORMAT Format); +extern D3DFORMAT EmuXB2PC_D3DFormat(XTL::X_D3DFORMAT Format); // convert from pc to xbox color formats -extern X_D3DFORMAT EmuPC2XB_D3DFormat(D3DFORMAT Format, bool bPreferLinear = true); +extern XTL::X_D3DFORMAT EmuPC2XB_D3DFormat(D3DFORMAT Format, bool bPreferLinear = true); // convert from xbox to pc d3d lock flags extern DWORD EmuXB2PC_D3DLock(DWORD Flags); @@ -94,158 +90,184 @@ else if((uint32)State < 20) else if((uint32)State > 255) State = (D3DTRANSFORMSTATETYPE)(State - 250); else - CxbxKrnlCleanup("Unknown Transform State Type (%d)", State); + CxbxKrnlCleanupEx(LOG_PREFIX_D3DCVT, "Unknown Transform State Type (%d)", State); //*/ // convert from xbox to pc texture transform state types inline D3DTRANSFORMSTATETYPE EmuXB2PC_D3DTS(D3DTRANSFORMSTATETYPE State) -{ - if((uint32)State < 2) - return (D3DTRANSFORMSTATETYPE)(State + 2); - else if((uint32)State < 6) - return (D3DTRANSFORMSTATETYPE)(State + 14); - else if((uint32)State < 10) - return D3DTS_WORLDMATRIX(State-6); - else if((uint32)State == 10) // Max - return (D3DTRANSFORMSTATETYPE)(D3DTS_TEXTURE7 + 1); +{ + // Handle Xbox -> D3D State mapping + switch (State) { + case 0: return (D3DTRANSFORMSTATETYPE)D3DTS_VIEW; + case 1: return (D3DTRANSFORMSTATETYPE)D3DTS_PROJECTION; + case 2: return (D3DTRANSFORMSTATETYPE)D3DTS_TEXTURE0; + case 3: return (D3DTRANSFORMSTATETYPE)D3DTS_TEXTURE1; + case 4: return (D3DTRANSFORMSTATETYPE)D3DTS_TEXTURE2; + case 5: return (D3DTRANSFORMSTATETYPE)D3DTS_TEXTURE3; + case 6: return (D3DTRANSFORMSTATETYPE)D3DTS_WORLD; + case 7: return (D3DTRANSFORMSTATETYPE)D3DTS_WORLD1; + case 8: return (D3DTRANSFORMSTATETYPE)D3DTS_WORLD2; + case 9: return (D3DTRANSFORMSTATETYPE)D3DTS_WORLD3; + } - CxbxKrnlCleanup("Unknown Transform State Type (%d)", State); + // Handle World Matrix offsets + if (State >= 256 && State <= 511) { + return D3DTS_WORLDMATRIX(State - 256); + } - return State; + CxbxKrnlCleanupEx(LOG_PREFIX_D3DCVT, "Unknown Transform State Type (%d)", State); + return (D3DTRANSFORMSTATETYPE)0; } // convert from xbox to pc blend ops -inline D3DBLENDOP EmuXB2PC_D3DBLENDOP(X_D3DBLENDOP Value) +inline D3DBLENDOP EmuXB2PC_D3DBLENDOP(XTL::X_D3DBLENDOP Value) { - switch(Value) + switch(Value) { - case 0x8006: + case 0x8006: return D3DBLENDOP_ADD; + case 0x800a: return D3DBLENDOP_SUBTRACT; + case 0x800b: return D3DBLENDOP_REVSUBTRACT; + case 0x8007: return D3DBLENDOP_MIN; + case 0x8008: return D3DBLENDOP_MAX; + case 0xF006: { + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "D3DBLENDOP_ADDSIGNED is not supported!"); return D3DBLENDOP_ADD; - case 0x800a: - return D3DBLENDOP_SUBTRACT; - case 0x800b: - return D3DBLENDOP_REVSUBTRACT; - case 0x8007: - return D3DBLENDOP_MIN; - case 0x8008: - return D3DBLENDOP_MAX; - case 0xF006: - { - EmuWarning("D3DBLENDOP_ADDSIGNED is not supported!"); - return D3DBLENDOP_ADD; - }; - case 0xF005: - { - EmuWarning("D3DBLENDOP_REVSUBTRACTSIGNED is not supported!"); - return D3DBLENDOP_REVSUBTRACT; - } + }; + case 0xF005: { + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "D3DBLENDOP_REVSUBTRACTSIGNED is not supported!"); + return D3DBLENDOP_REVSUBTRACT; + } } - EmuWarning("Unknown D3DBLENDOP (0x%.08X)", Value); + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown D3DBLENDOP (0x%.08X)", Value); return (D3DBLENDOP)D3DBLENDOP_ADD; } // convert from xbox to pc blend types -inline D3DBLEND EmuXB2PC_D3DBLEND(X_D3DBLEND Value) -{ - if(Value < 2) - return (D3DBLEND)(Value + 1); - else if(Value < 0x309) - return (D3DBLEND)((Value & 0xF) + 3); +inline D3DBLEND EmuXB2PC_D3DBLEND(XTL::X_D3DBLEND Value) +{ + switch (Value) { + case 0x000: return D3DBLEND_ZERO; + case 0x001: return D3DBLEND_ONE; + case 0x300: return D3DBLEND_SRCCOLOR; + case 0x301: return D3DBLEND_INVSRCCOLOR; + case 0x302: return D3DBLEND_SRCALPHA; + case 0x303: return D3DBLEND_INVSRCALPHA; + case 0x304: return D3DBLEND_DESTALPHA; + case 0x305: return D3DBLEND_INVDESTALPHA; + case 0x306: return D3DBLEND_DESTCOLOR; + case 0x307: return D3DBLEND_INVDESTCOLOR; + case 0x308: return D3DBLEND_SRCALPHASAT; + case 0x8001:return D3DBLEND_BLENDFACTOR; // Maps Xbox D3DBLEND_CONSTANTCOLOR + case 0x8002:return D3DBLEND_INVBLENDFACTOR; // Maps Xbox D3DBLEND_INVCONSTANTCOLOR + case 0x8003: EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unsupported Xbox D3DBlend Extension: D3DBLEND_CONSTANTALPHA"); return D3DBLEND_ONE; + case 0x8004: EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unsupported Xbox D3DBlend Extension: D3DBLEND_INVCONSTANTALPHA"); return D3DBLEND_ONE; + } - EmuWarning("Unknown Xbox D3DBLEND Extension (0x%.08X)", Value); + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown Xbox D3DBLEND Extension (0x%.08X)", Value); return D3DBLEND_ONE; } // convert from xbox to pc comparison functions -inline D3DCMPFUNC EmuXB2PC_D3DCMPFUNC(X_D3DCMPFUNC Value) +inline D3DCMPFUNC EmuXB2PC_D3DCMPFUNC(XTL::X_D3DCMPFUNC Value) { - return (D3DCMPFUNC)((Value & 0xF) + 1); + switch (Value) { + case 0x200: return D3DCMP_NEVER; + case 0x201: return D3DCMP_LESS; + case 0x202: return D3DCMP_EQUAL; + case 0x203: return D3DCMP_LESSEQUAL; + case 0x204: return D3DCMP_GREATER; + case 0x205: return D3DCMP_NOTEQUAL; + case 0x206: return D3DCMP_GREATEREQUAL; + case 0x207: return D3DCMP_ALWAYS; + } + + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown Xbox D3DCMPFUNC Extension (0x%.08X)", Value); + return D3DCMP_NEVER; } // convert from xbox to pc fill modes -inline D3DFILLMODE EmuXB2PC_D3DFILLMODE(X_D3DFILLMODE Value) +inline D3DFILLMODE EmuXB2PC_D3DFILLMODE(XTL::X_D3DFILLMODE Value) { - return (D3DFILLMODE)((Value & 0xF) + 1); + switch (Value) { + case 0x1B00: return D3DFILL_POINT; + case 0x1B01: return D3DFILL_WIREFRAME; + case 0x1B02: return D3DFILL_SOLID; + } + + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown Xbox D3DFILLMODE Extension (0x%.08X)", Value); + return D3DFILL_SOLID; } // convert from xbox to pc shade modes -inline D3DSHADEMODE EmuXB2PC_D3DSHADEMODE(X_D3DSHADEMODE Value) +inline D3DSHADEMODE EmuXB2PC_D3DSHADEMODE(XTL::X_D3DSHADEMODE Value) { - return (D3DSHADEMODE)((Value & 0x3) + 1); + switch (Value) { + case 0x1D00: return D3DSHADE_FLAT; + case 0x1D01: return D3DSHADE_GOURAUD; + } + + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown Xbox D3DSHADEMODE Extension (0x%.08X)", Value); + return D3DSHADE_GOURAUD; } // convert from xbox to pc stencilop modes -inline D3DSTENCILOP EmuXB2PC_D3DSTENCILOP(X_D3DSTENCILOP Value) -{ - switch(Value) - { - case 0x1e00: - return D3DSTENCILOP_KEEP; - case 0: - return D3DSTENCILOP_ZERO; - case 0x1e01: - return D3DSTENCILOP_REPLACE; - case 0x1e02: - return D3DSTENCILOP_INCRSAT; - case 0x1e03: - return D3DSTENCILOP_DECRSAT; - case 0x150a: - return D3DSTENCILOP_INVERT; - case 0x8507: - return D3DSTENCILOP_INCR; - case 0x8508: - return D3DSTENCILOP_DECR; +inline D3DSTENCILOP EmuXB2PC_D3DSTENCILOP(XTL::X_D3DSTENCILOP Value) +{ + switch(Value) + { + case 0x1e00: return D3DSTENCILOP_KEEP; + case 0x0000: return D3DSTENCILOP_ZERO; + case 0x1e01: return D3DSTENCILOP_REPLACE; + case 0x1e02: return D3DSTENCILOP_INCRSAT; + case 0x1e03: return D3DSTENCILOP_DECRSAT; + case 0x150a: return D3DSTENCILOP_INVERT; + case 0x8507: return D3DSTENCILOP_INCR; + case 0x8508: return D3DSTENCILOP_DECR; + default: + EmuLogEx(LOG_PREFIX_D3DCVT, LOG_LEVEL::WARNING, "Unknown D3DSTENCILOP (0x%.08X)", Value); + } - default: - CxbxKrnlCleanup("Unknown D3DSTENCILOP (0x%.08X)", Value); - } - - return (D3DSTENCILOP) Value; + return (D3DSTENCILOP) Value; } // table used for vertex->primitive count conversion -extern UINT EmuD3DVertexToPrimitive[X_D3DPT_POLYGON + 1][2]; +extern const UINT g_XboxPrimitiveTypeInfo[XTL::X_D3DPT_POLYGON + 1][2]; + +inline bool IsValidXboxVertexCount(XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType, UINT VertexCount) +{ + assert(XboxPrimitiveType < XTL::X_D3DPT_MAX); -inline bool EmuD3DValidVertexCount(X_D3DPRIMITIVETYPE XboxPrimitiveType, UINT VertexCount) -{ // Are there more vertices than required for setup? - if (VertexCount > EmuD3DVertexToPrimitive[XboxPrimitiveType][1]) + if (VertexCount > g_XboxPrimitiveTypeInfo[XboxPrimitiveType][0]) // Are the additional vertices exact multiples of the required additional vertices per primitive? - if (0 == ((VertexCount - EmuD3DVertexToPrimitive[XboxPrimitiveType][1]) % EmuD3DVertexToPrimitive[XboxPrimitiveType][0])) + if (0 == ((VertexCount - g_XboxPrimitiveTypeInfo[XboxPrimitiveType][0]) % g_XboxPrimitiveTypeInfo[XboxPrimitiveType][1])) return true; return false; } // convert from vertex count to primitive count (Xbox) -inline int EmuD3DVertex2PrimitiveCount(X_D3DPRIMITIVETYPE PrimitiveType, int VertexCount) +inline unsigned ConvertXboxVertexCountToPrimitiveCount(XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType, unsigned VertexCount) { - return (VertexCount - EmuD3DVertexToPrimitive[PrimitiveType][1]) / EmuD3DVertexToPrimitive[PrimitiveType][0]; + assert(XboxPrimitiveType < XTL::X_D3DPT_MAX); + + return (VertexCount - g_XboxPrimitiveTypeInfo[XboxPrimitiveType][0]) / g_XboxPrimitiveTypeInfo[XboxPrimitiveType][1]; } - -// convert from primitive count to vertex count (Xbox) -inline int EmuD3DPrimitive2VertexCount(X_D3DPRIMITIVETYPE PrimitiveType, int PrimitiveCount) -{ - return (PrimitiveCount * EmuD3DVertexToPrimitive[PrimitiveType][0]) + EmuD3DVertexToPrimitive[PrimitiveType][1]; -} - + // conversion table for xbox->pc primitive types -extern D3DPRIMITIVETYPE EmuPrimitiveTypeLookup[]; +extern const D3DPRIMITIVETYPE g_XboxPrimitiveTypeToHost[]; // convert xbox->pc primitive type -inline D3DPRIMITIVETYPE EmuXB2PC_D3DPrimitiveType(X_D3DPRIMITIVETYPE PrimitiveType) +inline D3DPRIMITIVETYPE EmuXB2PC_D3DPrimitiveType(XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType) { - if((DWORD)PrimitiveType == 0x7FFFFFFF) - return D3DPT_FORCE_DWORD; - - return EmuPrimitiveTypeLookup[PrimitiveType]; -} - -inline int EmuD3DIndexCountToVertexCount(X_D3DPRIMITIVETYPE XboxPrimitiveType, int IndexCount) -{ - return IndexCount; + if (XboxPrimitiveType >= XTL::X_D3DPT_MAX) { + LOG_TEST_CASE("XboxPrimitiveType too large"); + return D3DPT_FORCE_DWORD; + } + + return g_XboxPrimitiveTypeToHost[XboxPrimitiveType]; } extern void EmuUnswizzleBox @@ -1785,15 +1807,17 @@ typedef enum _TXBType { typedef struct _RenderStateInfo { char *S; // String representation. WORD V; // The XDK version since which a render state was introduced (using the 5911 declarations as a base). - TXBType T; // The Xbox data type. Defaults to xt_Unknown. - NV2AMETHOD M; // The related push buffer method. Not always a 1-to-1 mapping. Needs push-buffer interpretation & conversion code. - D3DRENDERSTATETYPE PC; // Map XBox to PC render state. Defaults to D3DRS_UNSUPPORTED. - char *N; // XDK notes. Defaults to ''. + TXBType T = xt_Unknown; // The Xbox data type. Defaults to xt_Unknown. + XTL::NV2AMETHOD M; // The related push buffer method. Not always a 1-to-1 mapping. Needs push-buffer interpretation & conversion code. + D3DRENDERSTATETYPE PC = (D3DRENDERSTATETYPE)0; // Map XBox to PC render state + char *N; // XDK notes. Defaults to ''. + WORD R; // The XDK version since which a render state was removed } RenderStateInfo; -#define D3DRS_NONE ((D3DRENDERSTATETYPE)0) +#define D3DRS_UNSUPPORTED ((D3DRENDERSTATETYPE)0) + +extern const RenderStateInfo& GetDxbxRenderStateInfo(int State); -extern const RenderStateInfo DxbxRenderStateInfo[]; #endif diff --git a/src/CxbxKrnl/EmuD3D8Logging.cpp b/src/core/hle/D3D8/XbD3D8Logging.cpp similarity index 92% rename from src/CxbxKrnl/EmuD3D8Logging.cpp rename to src/core/hle/D3D8/XbD3D8Logging.cpp index cff903d99..71529186f 100644 --- a/src/CxbxKrnl/EmuD3D8Logging.cpp +++ b/src/core/hle/D3D8/XbD3D8Logging.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->EmuD3D8Logging.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,14 +24,9 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ #include "Logging.h" -#include "EmuD3D8Logging.h" - -// prevent name collisions -namespace XTL -{ +#include "XbD3D8Logging.h" // // Host D3D LOGRENDER(Type) implementations @@ -69,15 +55,11 @@ ENUM2STR_START(D3DFORMAT) ENUM2STR_CASE(D3DFMT_A8R3G3B2) // = 29, ENUM2STR_CASE(D3DFMT_X4R4G4B4) // = 30, ENUM2STR_CASE(D3DFMT_A2B10G10R10) // = 31, -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_A8B8G8R8) // = 32, ENUM2STR_CASE(D3DFMT_X8B8G8R8) // = 33, -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_G16R16) // = 34, -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_A2R10G10B10) // = 35, ENUM2STR_CASE(D3DFMT_A16B16G16R16) // = 36, -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_A8P8) // = 40, ENUM2STR_CASE(D3DFMT_P8) // = 41, ENUM2STR_CASE(D3DFMT_L8) // = 50, @@ -88,19 +70,11 @@ ENUM2STR_START(D3DFORMAT) ENUM2STR_CASE(D3DFMT_X8L8V8U8) // = 62, ENUM2STR_CASE(D3DFMT_Q8W8V8U8) // = 63, ENUM2STR_CASE(D3DFMT_V16U16) // = 64, -#ifndef CXBX_USE_D3D9 - ENUM2STR_CASE(D3DFMT_W11V11U10) // = 65, -#else // !CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_A2W10V10U10) // = 67, -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_UYVY) // = MAKEFOURCC('U', 'Y', 'V', 'Y'), -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_R8G8_B8G8) // = MAKEFOURCC('R', 'G', 'B', 'G'), -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_YUY2) // = MAKEFOURCC('Y', 'U', 'Y', '2'), -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_G8R8_G8B8) // = MAKEFOURCC('G', 'R', 'G', 'B'), -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_DXT1) // = MAKEFOURCC('D', 'X', 'T', '1'), ENUM2STR_CASE(D3DFMT_DXT2) // = MAKEFOURCC('D', 'X', 'T', '2'), ENUM2STR_CASE(D3DFMT_DXT3) // = MAKEFOURCC('D', 'X', 'T', '3'), @@ -113,7 +87,6 @@ ENUM2STR_START(D3DFORMAT) ENUM2STR_CASE(D3DFMT_D24X8) // = 77, ENUM2STR_CASE(D3DFMT_D24X4S4) // = 79, ENUM2STR_CASE(D3DFMT_D16) // = 80, -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_D32F_LOCKABLE) // = 82, ENUM2STR_CASE(D3DFMT_D24FS8) // = 83, #if !defined(D3D_DISABLE_9EX) @@ -121,11 +94,9 @@ ENUM2STR_START(D3DFORMAT) ENUM2STR_CASE(D3DFMT_S8_LOCKABLE) // = 85, #endif // !D3D_DISABLE_9EX ENUM2STR_CASE(D3DFMT_L16) // = 81, -#endif // CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_VERTEXDATA) // = 100, ENUM2STR_CASE(D3DFMT_INDEX16) // = 101, ENUM2STR_CASE(D3DFMT_INDEX32) // = 102, -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DFMT_Q16W16V16U16) // = 110, ENUM2STR_CASE(D3DFMT_MULTI2_ARGB8) // = MAKEFOURCC('M', 'E', 'T', '1'), ENUM2STR_CASE(D3DFMT_R16F) // = 111, @@ -140,7 +111,6 @@ ENUM2STR_START(D3DFORMAT) ENUM2STR_CASE(D3DFMT_A2B10G10R10_XR_BIAS) // = 119, ENUM2STR_CASE(D3DFMT_BINARYBUFFER) // = 199, #endif // !D3D_DISABLE_9EX -#endif // CXBX_USE_D3D9 ENUM2STR_END_and_LOGRENDER(D3DFORMAT) ENUM2STR_START(D3DPOOL) @@ -154,7 +124,6 @@ ENUM2STR_END_and_LOGRENDER(D3DPOOL) // Host D3D LOGRENDER(Type) implementations // -#ifdef CXBX_USE_D3D9 LOGRENDER(D3DVSHADERCAPS2_0) { return os @@ -186,57 +155,41 @@ FLAGS2STR_START(D3DPS20CAPS) FLAG2STR(D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT) FLAGS2STR_END_and_LOGRENDER(D3DPS20CAPS) -#endif - ENUM2STR_START(D3DDEVTYPE) ENUM2STR_CASE(D3DDEVTYPE_REF) ENUM2STR_CASE(D3DDEVTYPE_SW) ENUM2STR_CASE(D3DDEVTYPE_HAL) -#ifdef CXBX_USE_D3D9 ENUM2STR_CASE(D3DDEVTYPE_NULLREF) -#endif ENUM2STR_END_and_LOGRENDER(D3DDEVTYPE) // Caps FLAGS2STR_START(_D3DCAPS) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DCAPS_OVERLAY) -#endif // CXBX_USE_D3D9 FLAG2STR(D3DCAPS_READ_SCANLINE) FLAGS2STR_END_and_LOGRENDER(_D3DCAPS) // Caps2 FLAGS2STR_START(D3DCAPS2) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DCAPS2_NO2DDURING3DSCENE) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DCAPS2_FULLSCREENGAMMA) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DCAPS2_CANRENDERWINDOWED) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DCAPS2_CANCALIBRATEGAMMA) FLAG2STR(D3DCAPS2_RESERVED) FLAG2STR(D3DCAPS2_CANMANAGERESOURCE) FLAG2STR(D3DCAPS2_DYNAMICTEXTURES) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DCAPS2_CANAUTOGENMIPMAP) #if !defined(D3D_DISABLE_9EX) FLAG2STR(D3DCAPS2_CANSHARERESOURCE) #endif // !D3D_DISABLE_9EX -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DCAPS2) // Caps3 FLAGS2STR_START(D3DCAPS3) FLAG2STR(D3DCAPS3_RESERVED) FLAG2STR(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION) FLAG2STR(D3DCAPS3_COPY_TO_VIDMEM) FLAG2STR(D3DCAPS3_COPY_TO_SYSTEMMEM) FLAG2STR(D3DCAPS3_DXVAHD) FLAG2STR(D3DCAPS3_DXVAHD_LIMITED) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DCAPS3) // PresentationIntervals @@ -282,9 +235,6 @@ FLAGS2STR_END_and_LOGRENDER(D3DDEVCAPS) // PrimitiveMiscCaps FLAGS2STR_START(D3DPMISCCAPS) FLAG2STR(D3DPMISCCAPS_MASKZ) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DPMISCCAPS_LINEPATTERNREP) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DPMISCCAPS_CULLNONE) FLAG2STR(D3DPMISCCAPS_CULLCW) FLAG2STR(D3DPMISCCAPS_CULLCCW) @@ -294,7 +244,6 @@ FLAGS2STR_START(D3DPMISCCAPS) FLAG2STR(D3DPMISCCAPS_TSSARGTEMP) FLAG2STR(D3DPMISCCAPS_BLENDOP) FLAG2STR(D3DPMISCCAPS_NULLREFERENCE) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DPMISCCAPS_INDEPENDENTWRITEMASKS) FLAG2STR(D3DPMISCCAPS_PERSTAGECONSTANT) FLAG2STR(D3DPMISCCAPS_FOGANDSPECULARALPHA) @@ -305,7 +254,6 @@ FLAGS2STR_START(D3DPMISCCAPS) #if !defined(D3D_DISABLE_9EX) FLAG2STR(D3DPMISCCAPS_POSTBLENDSRGBCONVERT) #endif // !D3D_DISABLE_9EX -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DPMISCCAPS) // LineCaps @@ -315,27 +263,16 @@ FLAGS2STR_START(D3DLINECAPS) FLAG2STR(D3DLINECAPS_BLEND) FLAG2STR(D3DLINECAPS_ALPHACMP) FLAG2STR(D3DLINECAPS_FOG) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DLINECAPS_ANTIALIAS) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DLINECAPS) // RasterCaps FLAGS2STR_START(D3DPRASTERCAPS) FLAG2STR(D3DPRASTERCAPS_DITHER) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DPRASTERCAPS_PAT) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DPRASTERCAPS_ZTEST) FLAG2STR(D3DPRASTERCAPS_FOGVERTEX) FLAG2STR(D3DPRASTERCAPS_FOGTABLE) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DPRASTERCAPS_ANTIALIASEDGES) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DPRASTERCAPS_MIPMAPLODBIAS) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DPRASTERCAPS_ZBIAS) -#endif // !CXBX_USE_D3D9 FLAG2STR(D3DPRASTERCAPS_ZBUFFERLESSHSR) FLAG2STR(D3DPRASTERCAPS_FOGRANGE) FLAG2STR(D3DPRASTERCAPS_ANISOTROPY) @@ -343,14 +280,10 @@ FLAGS2STR_START(D3DPRASTERCAPS) FLAG2STR(D3DPRASTERCAPS_WFOG) FLAG2STR(D3DPRASTERCAPS_ZFOG) FLAG2STR(D3DPRASTERCAPS_COLORPERSPECTIVE) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE) -#else // CXBX_USE_D3D9 FLAG2STR(D3DPRASTERCAPS_SCISSORTEST) FLAG2STR(D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) FLAG2STR(D3DPRASTERCAPS_DEPTHBIAS) FLAG2STR(D3DPRASTERCAPS_MULTISAMPLE_TOGGLE) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DPRASTERCAPS) // ZCmpCaps, AlphaCmpCaps @@ -380,13 +313,11 @@ FLAGS2STR_START(D3DPBLENDCAPS) FLAG2STR(D3DPBLENDCAPS_SRCALPHASAT) FLAG2STR(D3DPBLENDCAPS_BOTHSRCALPHA) FLAG2STR(D3DPBLENDCAPS_BOTHINVSRCALPHA) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DPBLENDCAPS_BLENDFACTOR) #if !defined(D3D_DISABLE_9EX) FLAG2STR(D3DPBLENDCAPS_SRCCOLOR2) FLAG2STR(D3DPBLENDCAPS_INVSRCCOLOR2) #endif // !D3D_DISABLE_9EX -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DPBLENDCAPS) // ShadeCaps @@ -414,9 +345,7 @@ FLAGS2STR_START(D3DPTEXTURECAPS) FLAG2STR(D3DPTEXTURECAPS_MIPCUBEMAP) FLAG2STR(D3DPTEXTURECAPS_CUBEMAP_POW2) FLAG2STR(D3DPTEXTURECAPS_VOLUMEMAP_POW2) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DPTEXTURECAPS_NOPROJECTEDBUMPENV) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DPTEXTURECAPS) // TextureFilterCaps, StretchRectFilterCaps (D3D9) @@ -424,27 +353,18 @@ FLAGS2STR_START(D3DPTFILTERCAPS) FLAG2STR(D3DPTFILTERCAPS_MINFPOINT) FLAG2STR(D3DPTFILTERCAPS_MINFLINEAR) FLAG2STR(D3DPTFILTERCAPS_MINFANISOTROPIC) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DPTFILTERCAPS_MINFPYRAMIDALQUAD) FLAG2STR(D3DPTFILTERCAPS_MINFGAUSSIANQUAD) -#endif // CXBX_USE_D3D9 FLAG2STR(D3DPTFILTERCAPS_MIPFPOINT) FLAG2STR(D3DPTFILTERCAPS_MIPFLINEAR) -#ifdef CXBX_USE_D3D9 #if !defined(D3D_DISABLE_9EX) FLAG2STR(D3DPTFILTERCAPS_CONVOLUTIONMONO) #endif // !D3D_DISABLE_9EX -#endif // CXBX_USE_D3D9 FLAG2STR(D3DPTFILTERCAPS_MAGFPOINT) FLAG2STR(D3DPTFILTERCAPS_MAGFLINEAR) FLAG2STR(D3DPTFILTERCAPS_MAGFANISOTROPIC) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD) FLAG2STR(D3DPTFILTERCAPS_MAGFGAUSSIANQUAD) -#else - FLAG2STR(D3DPTFILTERCAPS_MAGFAFLATCUBIC) - FLAG2STR(D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DPTFILTERCAPS) // TextureAddressCaps @@ -467,9 +387,7 @@ FLAGS2STR_START(D3DSTENCILCAPS) FLAG2STR(D3DSTENCILCAPS_INVERT) FLAG2STR(D3DSTENCILCAPS_INCR) FLAG2STR(D3DSTENCILCAPS_DECR) -#ifdef CXBX_USE_D3D9 FLAG2STR(D3DSTENCILCAPS_TWOSIDED) -#endif FLAGS2STR_END_and_LOGRENDER(D3DSTENCILCAPS) // TextureOpCaps @@ -517,15 +435,10 @@ FLAGS2STR_START(D3DVTXPCAPS) FLAG2STR(D3DVTXPCAPS_POSITIONALLIGHTS) FLAG2STR(D3DVTXPCAPS_LOCALVIEWER) FLAG2STR(D3DVTXPCAPS_TWEENING) -#ifndef CXBX_USE_D3D9 - FLAG2STR(D3DVTXPCAPS_NO_VSDT_UBYTE4) -#else // CXBX_USE_D3D9 FLAG2STR(D3DVTXPCAPS_TEXGEN_SPHEREMAP) FLAG2STR(D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER) -#endif // CXBX_USE_D3D9 FLAGS2STR_END_and_LOGRENDER(D3DVTXPCAPS) -#ifdef CXBX_USE_D3D9 // DevCaps2 FLAGS2STR_START(D3DDEVCAPS2) FLAG2STR(D3DDEVCAPS2_STREAMOFFSET) @@ -550,7 +463,6 @@ FLAGS2STR_START(D3DDTCAPS) FLAG2STR(D3DDTCAPS_FLOAT16_2) FLAG2STR(D3DDTCAPS_FLOAT16_4) FLAGS2STR_END_and_LOGRENDER(D3DDTCAPS) -#endif LOGRENDER(D3DCAPS) { @@ -607,9 +519,6 @@ LOGRENDER(D3DCAPS) LOGRENDER_MEMBER(VertexShaderVersion) LOGRENDER_MEMBER(MaxVertexShaderConst) LOGRENDER_MEMBER(PixelShaderVersion) -#ifndef CXBX_USE_D3D9 - LOGRENDER_MEMBER(MaxPixelShaderValue) -#else LOGRENDER_MEMBER(PixelShader1xMaxValue) LOGRENDER_MEMBER_TYPE(D3DDEVCAPS2, DevCaps2) LOGRENDER_MEMBER(MaxNpatchTessellationLevel) @@ -627,7 +536,6 @@ LOGRENDER(D3DCAPS) LOGRENDER_MEMBER(MaxPShaderInstructionsExecuted) LOGRENDER_MEMBER(MaxVertexShader30InstructionSlots) LOGRENDER_MEMBER(MaxPixelShader30InstructionSlots) -#endif ; } @@ -648,6 +556,9 @@ LOGRENDER(RECT) } +// prevent name collisions +namespace XTL { + // // Cxbx D3D LOGRENDER(Type) implementations // @@ -858,4 +769,4 @@ LOGRENDER(X_D3DPixelContainer) LOGRENDER_MEMBER_TYPE(X_D3DRESOURCE_SIZE, Size); } -}; // end of namespace XTL +} // end of namespace XTL diff --git a/src/CxbxKrnl/EmuD3D8Logging.h b/src/core/hle/D3D8/XbD3D8Logging.h similarity index 74% rename from src/CxbxKrnl/EmuD3D8Logging.h rename to src/core/hle/D3D8/XbD3D8Logging.h index 0db47431c..996a3fc23 100644 --- a/src/CxbxKrnl/EmuD3D8Logging.h +++ b/src/core/hle/D3D8/XbD3D8Logging.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->EmuD3D8Logging.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,59 +25,50 @@ #ifndef _EMU_D3D8_LOGGING_H #define _EMU_D3D8_LOGGING_H -#pragma once - -//#include // for std::ostream -//#include "EmuXTL.h" #include "Logging.h" - -namespace XTL -{ -#include "EmuD3D8Types.h" +#include "XbD3D8Types.h" // Additional types, exclusively for logging (not really enums) : -#ifdef CXBX_USE_D3D9 -enum D3DVS20CAPS; -enum D3DPS20CAPS; -#endif // CXBX_USE_D3D9 -enum _D3DCAPS; -enum D3DCAPS2; -enum D3DCAPS3; -enum D3DPRESENT_INTERVAL; -enum D3DCURSORCAPS; -enum D3DDEVCAPS; -enum D3DPMISCCAPS; -enum D3DLINECAPS; -enum D3DPRASTERCAPS; -enum D3DPCMPCAPS; -enum D3DPBLENDCAPS; -enum D3DPSHADECAPS; -enum D3DPTEXTURECAPS; -enum D3DPTFILTERCAPS; -enum D3DPTADDRESSCAPS; -enum D3DSTENCILCAPS; -enum D3DTEXOPCAPS; -enum D3DFVFCAPS; -enum D3DVTXPCAPS; -#ifdef CXBX_USE_D3D9 -enum D3DDEVCAPS2; -enum D3DDTCAPS; -#endif // CXBX_USE_D3D9 +enum D3DVS20CAPS : int; +enum D3DPS20CAPS : int; +enum _D3DCAPS : int; +enum D3DCAPS2 : int; +enum D3DCAPS3 : int; +enum D3DPRESENT_INTERVAL : int; +enum D3DCURSORCAPS : int; +enum D3DDEVCAPS : int; +enum D3DPMISCCAPS : int; +enum D3DLINECAPS : int; +enum D3DPRASTERCAPS : int; +enum D3DPCMPCAPS : int; +enum D3DPBLENDCAPS : int; +enum D3DPSHADECAPS : int; +enum D3DPTEXTURECAPS : int; +enum D3DPTFILTERCAPS : int; +enum D3DPTADDRESSCAPS : int; +enum D3DSTENCILCAPS : int; +enum D3DTEXOPCAPS : int; +enum D3DFVFCAPS : int; +enum D3DVTXPCAPS : int; +enum D3DDEVCAPS2 : int; +enum D3DDTCAPS : int; -enum X_D3DUSAGE; -enum X_D3DCOMMON_TYPE; -enum X_D3DRESOURCE_COMMON; -enum X_D3DRESOURCE_FORMAT; -enum X_D3DRESOURCE_SIZE; +namespace XTL { + +enum X_D3DUSAGE : int; +enum X_D3DCOMMON_TYPE : int; +enum X_D3DRESOURCE_COMMON : int; +enum X_D3DRESOURCE_FORMAT : int; +enum X_D3DRESOURCE_SIZE : int; + +} // end of namespace XTL // // Headers for rendering host D3D enum types : // -#ifdef CXBX_USE_D3D9 FLAGS2STR_HEADER(D3DVS20CAPS) // Not really an enum FLAGS2STR_HEADER(D3DPS20CAPS) // Not really an enum -#endif // CXBX_USE_D3D9 ENUM2STR_HEADER(D3DDEVTYPE) FLAGS2STR_HEADER(_D3DCAPS) // Not really an enum FLAGS2STR_HEADER(D3DCAPS2) // Not really an enum @@ -107,10 +89,8 @@ FLAGS2STR_HEADER(D3DSTENCILCAPS) // Not really an enum FLAGS2STR_HEADER(D3DTEXOPCAPS) // Not really an enum FLAGS2STR_HEADER(D3DFVFCAPS) // Not really an enum FLAGS2STR_HEADER(D3DVTXPCAPS) // Not really an enum -#ifdef CXBX_USE_D3D9 FLAGS2STR_HEADER(D3DDEVCAPS2) // Not really an enum FLAGS2STR_HEADER(D3DDTCAPS) // Not really an enum -#endif // CXBX_USE_D3D9 ENUM2STR_HEADER(D3DCUBEMAP_FACES) ENUM2STR_HEADER(D3DFORMAT) @@ -120,14 +100,14 @@ ENUM2STR_HEADER(D3DPOOL) // Host D3D LOGRENDER_HEADER(Type) declarations // -#ifdef CXBX_USE_D3D9 LOGRENDER_HEADER(D3DVSHADERCAPS2_0) LOGRENDER_HEADER(D3DPSHADERCAPS2_0) -#endif LOGRENDER_HEADER(D3DCAPS) LOGRENDER_HEADER(D3DLOCKED_RECT) LOGRENDER_HEADER(RECT) + +namespace XTL { // // Headers for rendering Xbox D3D enum types : @@ -167,6 +147,6 @@ LOGRENDER_HEADER(X_D3DDISPLAYMODE) LOGRENDER_HEADER(X_D3DResource) LOGRENDER_HEADER(X_D3DPixelContainer) -}; // end of namespace XTL +} // end of namespace XTL -#endif _EMU_D3D8_LOGGING_H \ No newline at end of file +#endif _EMU_D3D8_LOGGING_H diff --git a/src/CxbxKrnl/EmuD3D8Types.h b/src/core/hle/D3D8/XbD3D8Types.h old mode 100755 new mode 100644 similarity index 79% rename from src/CxbxKrnl/EmuD3D8Types.h rename to src/core/hle/D3D8/XbD3D8Types.h index e15bfb728..daf566898 --- a/src/CxbxKrnl/EmuD3D8Types.h +++ b/src/core/hle/D3D8/XbD3D8Types.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8Types.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,12 +22,8 @@ // * All rights reserved // * // ****************************************************************** -#ifndef EMUD3D8TYPES_H -#define EMUD3D8TYPES_H - -//#define CXBX_USE_D3D9 // Declared in the Debug_Direct3D9 build configuration - -#ifdef CXBX_USE_D3D9 +#ifndef XBD3D8TYPES_H +#define XBD3D8TYPES_H #undef UNICODE // make sure dxerr.h DXGetErrorString is aliassed to *A, not *W @@ -48,8 +35,8 @@ #include // for D3DXVECTOR4, etc #include -#include -#pragma comment(lib, "dxerr.lib") // See https://blogs.msdn.microsoft.com/chuckw/2012/04/24/wheres-dxerr-lib/ +#include +//#pragma comment(lib, "dxerr.lib") // See https://blogs.msdn.microsoft.com/chuckw/2012/04/24/wheres-dxerr-lib/ // If the above doesn't compile, install the June 2010 DirectX SDK // from https://www.microsoft.com/en-us/download/details.aspx?id=6812 @@ -66,81 +53,44 @@ #define D3DENUM_NO_WHQL_LEVEL 0 // default in Direct3D 9 // Alias all host Direct3D 9 symbols to generic symbols -#define Direct3DCreate Direct3DCreate9 -#define D3DXAssembleShader D3DXCompileShader +#define DXGetErrorString DXGetErrorString9A +#define DXGetErrorDescription DXGetErrorDescription9A +#define Direct3DCreate Direct3DCreate9 +#define D3DXAssembleShader D3DXAssembleShader #define FullScreen_PresentationInterval PresentationInterval // a field in D3DPRESENT_PARAMETERS -#define D3DLockData void -#define PixelShaderConstantType float +#define D3DLockData void +#define PixelShaderConstantType float -#define D3DADAPTER_IDENTIFIER D3DADAPTER_IDENTIFIER9 -#define D3DCAPS D3DCAPS9 -#define D3DVERTEXELEMENT D3DVERTEXELEMENT9 -#define D3DVIEWPORT D3DVIEWPORT9 +#define D3DADAPTER_IDENTIFIER D3DADAPTER_IDENTIFIER9 +#define D3DCAPS D3DCAPS9 +#define D3DVERTEXELEMENT D3DVERTEXELEMENT9 +#define D3DVIEWPORT D3DVIEWPORT9 -#define IDirect3D IDirect3D9 -#define IDirect3DDevice IDirect3DDevice9 -//#define IDirect3DStateBlock IDirect3DStateBlock9 -//#define IDirect3DVertexDeclaration IDirect3DVertexDeclaration9 -//#define IDirect3DVertexShader IDirect3DVertexShader9 -//#define IDirect3DPixelShader IDirect3DPixelShader9 -#define IDirect3DResource IDirect3DResource9 -#define IDirect3DBaseTexture IDirect3DBaseTexture9 -#define IDirect3DTexture IDirect3DTexture9 -#define IDirect3DVolumeTexture IDirect3DVolumeTexture9 -#define IDirect3DCubeTexture IDirect3DCubeTexture9 -#define IDirect3DVertexBuffer IDirect3DVertexBuffer9 -#define IDirect3DIndexBuffer IDirect3DIndexBuffer9 -#define IDirect3DSurface IDirect3DSurface9 -#define IDirect3DVolume IDirect3DVolume9 -#define IDirect3DSwapChain IDirect3DSwapChain9 -//#define IDirect3DQuery IDirect3DQuery9 +#define IDirect3D IDirect3D9 +#define IDirect3DDevice IDirect3DDevice9 +#define IDirect3DStateBlock IDirect3DStateBlock9 // unused +#define IDirect3DVertexDeclaration IDirect3DVertexDeclaration9 +#define IDirect3DVertexShader IDirect3DVertexShader9 +#define IDirect3DPixelShader IDirect3DPixelShader9 +#define IDirect3DResource IDirect3DResource9 +#define IDirect3DBaseTexture IDirect3DBaseTexture9 +#define IDirect3DTexture IDirect3DTexture9 +#define IDirect3DVolumeTexture IDirect3DVolumeTexture9 +#define IDirect3DCubeTexture IDirect3DCubeTexture9 +#define IDirect3DVertexBuffer IDirect3DVertexBuffer9 +#define IDirect3DIndexBuffer IDirect3DIndexBuffer9 +#define IDirect3DSurface IDirect3DSurface9 +#define IDirect3DVolume IDirect3DVolume9 +#define IDirect3DSwapChain IDirect3DSwapChain9 +#define IDirect3DQuery IDirect3DQuery9 + +namespace XTL { // TODO : Declare these aliasses as Xbox type typedef D3DLIGHT9 X_D3DLIGHT8; typedef D3DMATERIAL9 X_D3DMATERIAL8; typedef D3DVIEWPORT9 X_D3DVIEWPORT8; -#else - -// include direct3d 8x headers -#define DIRECT3D_VERSION 0x0800 -#include -#include // For D3DXVECTOR4, etc -#include -#include // For DXGetErrorString8A, DXGetErrorDescription8A - -// Alias all host Direct3D 8 symbols to generic symbols -#define Direct3DCreate Direct3DCreate8 -#define DXGetErrorString DXGetErrorString8A -#define DXGetErrorDescription DXGetErrorDescription8A -#define D3DLockData BYTE -#define PixelShaderConstantType void - -#define D3DADAPTER_IDENTIFIER D3DADAPTER_IDENTIFIER8 -#define D3DCAPS D3DCAPS8 -#define D3DVERTEXELEMENT DWORD -#define D3DVIEWPORT D3DVIEWPORT8 - -#define IDirect3D IDirect3D8 -#define IDirect3DDevice IDirect3DDevice8 -#define IDirect3DResource IDirect3DResource8 -#define IDirect3DBaseTexture IDirect3DBaseTexture8 -#define IDirect3DTexture IDirect3DTexture8 -#define IDirect3DVolumeTexture IDirect3DVolumeTexture8 -#define IDirect3DCubeTexture IDirect3DCubeTexture8 -#define IDirect3DVertexBuffer IDirect3DVertexBuffer8 -#define IDirect3DIndexBuffer IDirect3DIndexBuffer8 -#define IDirect3DSurface IDirect3DSurface8 -#define IDirect3DVolume IDirect3DVolume8 -#define IDirect3DSwapChain IDirect3DSwapChain8 - -// TODO : Declare these aliasses as Xbox type -typedef D3DLIGHT8 X_D3DLIGHT8; -typedef D3DMATERIAL8 X_D3DMATERIAL8; -typedef D3DVIEWPORT8 X_D3DVIEWPORT8; - -#endif // Direct3d8 - // TODO: fill out these enumeration tables for convienance typedef D3DSWAPEFFECT X_D3DSWAPEFFECT; typedef D3DXVECTOR4 X_D3DXVECTOR4; @@ -152,7 +102,6 @@ typedef DWORD X_D3DMULTISAMPLE_TYPE; typedef DWORD X_D3DSHADEMODE; typedef DWORD X_D3DSTENCILOP; typedef DWORD X_D3DTEXTURESTAGESTATETYPE; -typedef PVOID X_D3DCALLBACK; typedef enum _X_D3DCULL { @@ -194,7 +143,7 @@ typedef enum _X_D3DFORMAT */ // Xbox D3DFORMAT types : - // See http://wiki.beyondunreal.com/Legacy:Texture_Format + // See https://wiki.beyondunreal.com/Legacy:Texture_Format // Swizzled Formats @@ -353,8 +302,6 @@ X_D3DRESOURCETYPE; #define X_D3DTEXTURE_PITCH_ALIGNMENT X_D3D_RENDER_MEMORY_ALIGNMENT #define X_D3DTEXTURE_PITCH_MIN X_D3DTEXTURE_PITCH_ALIGNMENT -#define TEXTURE_STAGES 4 // X_D3DTS_STAGECOUNT - typedef enum _X_D3DSET_DEPTH_CLIP_PLANES_FLAGS { X_D3DSDCP_SET_VERTEXPROGRAM_PLANES = 1, @@ -442,19 +389,6 @@ typedef struct _X_D3DGAMMARAMP } X_D3DGAMMARAMP; -struct X_D3DVertexShader -{ - union - { - DWORD UnknownA; - DWORD Handle; - }; - - DWORD UnknownB; - DWORD Flags; - DWORD UnknownC[0x59]; -}; - typedef struct _X_D3DPIXELSHADERDEF // <- blueshogun 10/1/07 { DWORD PSAlphaInputs[8]; // X_D3DRS_PSALPHAINPUTS0..X_D3DRS_PSALPHAINPUTS7 : Alpha inputs for each stage @@ -489,85 +423,6 @@ typedef struct _X_PixelShader X_D3DPIXELSHADERDEF *pPSDef; } X_PixelShader; -// These structures are used by Cxbx, not by the Xbox!!! -typedef struct _CxbxPixelShader -{ - //IDirect3DPixelShader9* pShader; - //ID3DXConstantTable *pConstantTable; - DWORD Handle; - - BOOL bBumpEnvMap; - - // constants - DWORD PSRealC0[8]; - DWORD PSRealC1[8]; - DWORD PSRealFC0; - DWORD PSRealFC1; - - BOOL bConstantsInitialized; - BOOL bConstantsChanged; - - DWORD dwStatus; - X_D3DPIXELSHADERDEF PSDef; - - DWORD dwStageMap[TEXTURE_STAGES]; - -} -CxbxPixelShader; - -typedef struct _CxbxVertexShaderStreamElement -{ - UINT XboxType; // The stream data types (xbox) - UINT HostByteSize; // The stream data sizes (pc) -} -CxbxVertexShaderStreamElement; - -/* See typedef struct _D3DVERTEXELEMENT9 -{ - WORD Stream; // Stream index - WORD Offset; // Offset in the stream in bytes - BYTE Type; // Data type - BYTE Method; // Processing method - BYTE Usage; // Semantics - BYTE UsageIndex; // Semantic index -} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; -*/ - -typedef struct _CxbxVertexShaderStreamInfo -{ - BOOL NeedPatch; // This is to know whether it's data which must be patched - DWORD HostVertexStride; - DWORD NumberOfVertexElements; // Number of the stream data types - CxbxVertexShaderStreamElement VertexElements[32]; -} -CxbxVertexShaderStreamInfo; - -typedef struct _CxbxVertexShaderInfo -{ - UINT NumberOfVertexStreams; // The number of streams the vertex shader uses - CxbxVertexShaderStreamInfo VertexStreams[16]; -} -CxbxVertexShaderInfo; - -typedef struct _CxbxVertexShader -{ - DWORD Handle; - - // These are the parameters given by the XBE, - // we save them to be able to return them when necessary. - UINT Size; - DWORD *pDeclaration; - DWORD DeclarationSize; - DWORD *pFunction; - DWORD FunctionSize; - DWORD Type; - DWORD Status; - - // Needed for dynamic stream patching - CxbxVertexShaderInfo VertexShaderInfo; -} -CxbxVertexShader; - struct X_D3DResource { DWORD Common; @@ -589,7 +444,7 @@ struct X_D3DResource #define X_D3DCOMMON_INTREFCOUNT_MASK 0x00780000 #define X_D3DCOMMON_INTREFCOUNT_SHIFT 19 #define X_D3DCOMMON_INTREFCOUNT_1 (1 << X_D3DCOMMON_INTREFCOUNT_SHIFT) // Dxbx addition -#define X_D3DCOMMON_VIDEOMEMORY 0x00800000 // Not used. +#define X_D3DCOMMON_VIDEOMEMORY 0x00000000 // Was 0x00800000, but Xbox doesn't have this flag! #define X_D3DCOMMON_D3DCREATED 0x01000000 #define X_D3DCOMMON_ISLOCKED 0x02000010 // Surface is currently locked (potential unswizzle candidate) #define X_D3DCOMMON_UNUSED_MASK 0xFE000000 @@ -601,7 +456,6 @@ struct X_D3DResource // special resource lock flags #define X_D3DRESOURCE_LOCK_FLAG_NOSIZE 0xEFFFFFFF -#define X_D3DRESOURCE_LOCK_PALETTE 0x8000BEEF // Lock flags #define X_D3DLOCK_NOFLUSH 0x00000010 // Xbox extension @@ -769,7 +623,7 @@ typedef struct _D3DVBLANKDATA DWORD Swap; DWORD Flags; } -D3DVBLANKDATA; +X_D3DVBLANKDATA; typedef struct _D3DSWAPDATA { @@ -779,28 +633,28 @@ typedef struct _D3DSWAPDATA DWORD TimeUntilSwapVBlank; DWORD TimeBetweenSwapVBlanks; } -D3DSWAPDATA; +X_D3DSWAPDATA; // D3DVBLANKCALLBACK -typedef void (__cdecl * D3DVBLANKCALLBACK)(D3DVBLANKDATA *pData); +typedef void (__cdecl * X_D3DVBLANKCALLBACK)(X_D3DVBLANKDATA *pData); // D3DSWAPCALLBACK -typedef void (__cdecl * D3DSWAPCALLBACK)(D3DSWAPDATA *pData); +typedef void (__cdecl * X_D3DSWAPCALLBACK)(X_D3DSWAPDATA *pData); // D3DCALLBACK -typedef void (__cdecl * D3DCALLBACK)(DWORD Context); +typedef void (__cdecl * X_D3DCALLBACK)(DWORD Context); // X_D3DRENDERSTATETYPE values typedef enum _X_D3DRENDERSTATETYPE { // Dxbx note : These declarations are from XDK version 5933, the most recent and complete version. // Older versions are slightly different (some members are missing), so we use a mapping table to - // cater for the differences (see DxbxBuildRenderStateMappingTable). This enables to ignore these - // version-differences in the rest of our code (unless it matters somehow); We write via indirection : - // *XTL::EmuMappedD3DRenderState[X_D3DRENDERSTATETYPE] = Value; + // cater for the differences (see XboxRenderStateConverter::BuildRenderStateMappingTable). This enables to ignore these + // version-differences in the rest of our code (unless it matters somehow); We write like this : + // XboxRenderStates.SetXboxRenderState(X_D3DRENDERSTATETYPE, Value); // - // And we read via the same mapping (do note, that missing elements all point to the same dummy) : - // Result = *XTL::EmuMappedD3DRenderState[X_D3DRENDERSTATETYPE]; + // And we read like this (do note, that missing elements all point to the same dummy) : + // Result = XboxRenderStates.GetXboxRenderState(X_D3DRENDERSTATETYPE); // Dxbx note : The PS* render states map 1-on-1 to the X_D3DPIXELSHADERDEF record, // SetPixelShader actually pushes the definition into these render state slots. @@ -883,14 +737,14 @@ typedef enum _X_D3DRENDERSTATETYPE { X_D3DRS_STENCILMASK = 72, // BYTE mask value used in stencil test X_D3DRS_STENCILWRITEMASK = 73, // BYTE write mask applied to values written to stencil buffer X_D3DRS_BLENDOP = 74, // D3DBLENDOP setting - X_D3DRS_BLENDCOLOR = 75, // D3DCOLOR for D3DBLEND_CONSTANTCOLOR (Xbox ext.) + X_D3DRS_BLENDCOLOR = 75, // D3DCOLOR for D3DBLEND_CONSTANTCOLOR X_D3DRS_SWATHWIDTH = 76, // D3DSWATHWIDTH (Xbox ext.) X_D3DRS_POLYGONOFFSETZSLOPESCALE = 77, // float Z factor for shadow maps (Xbox ext.) X_D3DRS_POLYGONOFFSETZOFFSET = 78, // Xbox ext. X_D3DRS_POINTOFFSETENABLE = 79, // Xbox ext. X_D3DRS_WIREFRAMEOFFSETENABLE = 80, // Xbox ext. X_D3DRS_SOLIDOFFSETENABLE = 81, // Xbox ext. - X_D3DRS_DEPTHCLIPCONTROL = 82, // [4627+] Xbox ext. + X_D3DRS_DEPTHCLIPCONTROL = 82, // [4432+] Xbox ext. X_D3DRS_STIPPLEENABLE = 83, // [4627+] Xbox ext. X_D3DRS_SIMPLE_UNUSED8 = 84, // [4627+] X_D3DRS_SIMPLE_UNUSED7 = 85, // [4627+] @@ -935,8 +789,8 @@ typedef enum _X_D3DRENDERSTATETYPE { X_D3DRS_POINTSIZE_MAX = 123, X_D3DRS_PATCHEDGESTYLE = 124, // Dxbx addition X_D3DRS_PATCHSEGMENTS = 125, - X_D3DRS_SWAPFILTER = 126, // [4361+] Xbox ext. nsp. D3DTEXF_LINEAR etc. filter to use for Swap - X_D3DRS_PRESENTATIONINTERVAL = 127, // [4627+] Xbox ext. nsp. + X_D3DRS_SWAPFILTER = 126, // [4039+] Xbox ext. nsp. D3DTEXF_LINEAR etc. filter to use for Swap + X_D3DRS_PRESENTATIONINTERVAL = 127, // [4627+] Xbox ext. nsp. TODO : Use 4361? X_D3DRS_DEFERRED_UNUSED8 = 128, // [4627+] X_D3DRS_DEFERRED_UNUSED7 = 129, // [4627+] X_D3DRS_DEFERRED_UNUSED6 = 130, // [4627+] @@ -960,23 +814,24 @@ typedef enum _X_D3DRENDERSTATETYPE { X_D3DRS_CULLMODE = 147, X_D3DRS_TEXTUREFACTOR = 148, X_D3DRS_ZBIAS = 149, - X_D3DRS_LOGICOP = 150, // Xbox ext. + X_D3DRS_LOGICOP = 150, // Xbox ext. nsp. X_D3DRS_EDGEANTIALIAS = 151, // Dxbx note : No Xbox ext. (according to Direct3D8) ! X_D3DRS_MULTISAMPLEANTIALIAS = 152, X_D3DRS_MULTISAMPLEMASK = 153, - X_D3DRS_MULTISAMPLETYPE = 154, // [-3911] Xbox ext. \_ aliasses D3DMULTISAMPLE_TYPE - X_D3DRS_MULTISAMPLEMODE = 154, // [4361+] Xbox ext. / D3DMULTISAMPLEMODE for the backbuffer - X_D3DRS_MULTISAMPLERENDERTARGETMODE = 155, // [4361+] Xbox ext. - X_D3DRS_SHADOWFUNC = 156, // D3DCMPFUNC (Xbox extension) - X_D3DRS_LINEWIDTH = 157, // Xbox ext. - X_D3DRS_SAMPLEALPHA = 158, // Xbox ext. - X_D3DRS_DXT1NOISEENABLE = 159, // Xbox ext. - X_D3DRS_YUVENABLE = 160, // [3911+] Xbox ext. - X_D3DRS_OCCLUSIONCULLENABLE = 161, // [3911+] Xbox ext. - X_D3DRS_STENCILCULLENABLE = 162, // [3911+] Xbox ext. - X_D3DRS_ROPZCMPALWAYSREAD = 163, // [3911+] Xbox ext. - X_D3DRS_ROPZREAD = 164, // [3911+] Xbox ext. - X_D3DRS_DONOTCULLUNCOMPRESSED = 165, // [3911+] Xbox ext. + X_D3DRS_MULTISAMPLETYPE = 154, // [-4039] Xbox ext. + // Note : X_D3DRS_MULTISAMPLETYPE seems the only one that got removed, but it does need a slot, so the rest is increased by 1 compared to 5933. + X_D3DRS_MULTISAMPLEMODE = 155, // [4361+] Xbox ext. // D3DMULTISAMPLEMODE for the backbuffer + X_D3DRS_MULTISAMPLERENDERTARGETMODE = 156, // [4039+] Xbox ext. + X_D3DRS_SHADOWFUNC = 157, // D3DCMPFUNC (Xbox extension) + X_D3DRS_LINEWIDTH = 158, // Xbox ext. + X_D3DRS_SAMPLEALPHA = 159, // Xbox ext. + X_D3DRS_DXT1NOISEENABLE = 160, // Xbox ext. + X_D3DRS_YUVENABLE = 161, // [3911+] Xbox ext. + X_D3DRS_OCCLUSIONCULLENABLE = 162, // [3911+] Xbox ext. + X_D3DRS_STENCILCULLENABLE = 163, // [3911+] Xbox ext. + X_D3DRS_ROPZCMPALWAYSREAD = 164, // [3911+] Xbox ext. + X_D3DRS_ROPZREAD = 165, // [3911+] Xbox ext. + X_D3DRS_DONOTCULLUNCOMPRESSED = 166, // [3911+] Xbox ext. // End of "complex" render states. X_D3DRS_UNK = 0x7fffffff // deferred render state "unknown" flag } X_D3DRENDERSTATETYPE; @@ -1083,6 +938,9 @@ constexpr DWORD X_D3DTOP_LERP = 24; constexpr DWORD X_D3DTOP_BUMPENVMAP = 25; constexpr DWORD X_D3DTOP_BUMPENVMAPLUMINANCE = 26; +constexpr DWORD X_D3DTOP_FIRST = X_D3DTOP_DISABLE; +constexpr DWORD X_D3DTOP_LAST = X_D3DTOP_BUMPENVMAPLUMINANCE; + // X_D3DTEXTUREADDRESS values : constexpr DWORD X_D3DTADDRESS_WRAP = 1; constexpr DWORD X_D3DTADDRESS_MIRROR = 2; @@ -1090,6 +948,14 @@ constexpr DWORD X_D3DTADDRESS_CLAMP = 3; constexpr DWORD X_D3DTADDRESS_BORDER = 4; constexpr DWORD X_D3DTADDRESS_CLAMPTOEDGE = 5; +// X_D3DTEXTUREFILTERTYPE Values +constexpr DWORD X_D3DTEXF_NONE = 0; +constexpr DWORD X_D3DTEXF_POINT = 1; +constexpr DWORD X_D3DTEXF_LINEAR = 2; +constexpr DWORD X_D3DTEXF_ANISOTROPIC = 3; +constexpr DWORD X_D3DTEXF_QUINCUNX = 4; // Xbox extension +constexpr DWORD X_D3DTEXF_GAUSSIANCUBIC = 5; + // X_D3DCLEAR values : constexpr DWORD X_D3DCLEAR_ZBUFFER = 0x00000001; constexpr DWORD X_D3DCLEAR_STENCIL = 0x00000002; @@ -1111,22 +977,60 @@ constexpr DWORD X_D3DCOLORWRITEENABLE_ALL = 0x01010101; // Xbox ext. typedef DWORD X_VERTEXSHADERCONSTANTMODE; +// Xbox vertex shader constant modes #define X_D3DSCM_96CONSTANTS 0x00 // Enables constants 0..95 #define X_D3DSCM_192CONSTANTS 0x01 // Enables constants -96..-1 on top of 0..95 #define X_D3DSCM_192CONSTANTSANDFIXEDPIPELINE 0x02 // Unsupported? #define X_D3DSCM_NORESERVEDCONSTANTS 0x10 // Do not reserve constant -38 and -37 -#define X_D3DSCM_RESERVED_CONSTANT1 -38 // Becomes 58 after correction, contains Scale v -#define X_D3DSCM_RESERVED_CONSTANT2 -37 // Becomes 59 after correction, contains Offset +#define X_D3DSCM_RESERVED_CONSTANT_SCALE -38 // Becomes 58 after correction, contains Scale v +#define X_D3DSCM_RESERVED_CONSTANT_OFFSET -37 // Becomes 59 after correction, contains Offset -#define X_D3DSCM_CORRECTION 96 // Add 96 to arrive at the range 0..191 (instead of 96..95) -#define X_D3DVS_CONSTREG_COUNT 192 +#define X_D3DSCM_CORRECTION 96 // Add 96 to arrive at the range 0..191 (instead of -96..95) +#define X_D3DVS_CONSTREG_COUNT 192 -// Vertex shader types +// Special Registers, used to pass additional information to the shaders +// TODO co-locate shader workaround constants with shader code +#define CXBX_D3DVS_CONSTREG_VREGDEFAULTS_BASE (X_D3DVS_CONSTREG_COUNT) +#define CXBX_D3DVS_CONSTREG_VREGDEFAULTS_FLAG_BASE (CXBX_D3DVS_CONSTREG_VREGDEFAULTS_BASE + 16) +#define CXBX_D3DVS_VIEWPORT_SCALE_MIRROR (CXBX_D3DVS_CONSTREG_VREGDEFAULTS_FLAG_BASE + 4) +#define CXBX_D3DVS_VIEWPORT_OFFSET_MIRROR (CXBX_D3DVS_VIEWPORT_SCALE_MIRROR + 1) + +#define X_D3DSCM_RESERVED_CONSTANT_SCALE_CORRECTED (X_D3DSCM_RESERVED_CONSTANT_SCALE + X_D3DSCM_CORRECTION) +#define X_D3DSCM_RESERVED_CONSTANT_OFFSET_CORRECTED (X_D3DSCM_RESERVED_CONSTANT_OFFSET + X_D3DSCM_CORRECTION) + +// Xbox vertex declaration token bit masks +#define X_D3DVSD_MASK_TESSUV 0x10000000 +#define X_D3DVSD_MASK_SKIP 0x10000000 // Skips (normally) dwords +#define X_D3DVSD_MASK_SKIPBYTES 0x08000000 // Skips bytes (no, really?!) +#define X_D3DVSD_STREAMTESSMASK (1 << 28) + +// Xbox vertex shader types #define X_VST_NORMAL 1 #define X_VST_READWRITE 2 #define X_VST_STATE 3 +// Xbox vertex shader counts +#define X_VSH_MAX_ATTRIBUTES 16 +#define X_VSH_MAX_STREAMS 16 +#define X_VSH_MAX_INSTRUCTION_COUNT 136 // The maximum Xbox shader instruction count + +// Xbox Vertex Shader versions +#define VERSION_XVS 0x2078 // 'x ' Xbox vertex shader +#define VERSION_XVSS 0x7378 // 'xs' Xbox vertex state shader +#define VERSION_XVSW 0x7778 // 'xw' Xbox vertex read/write shader + +/// nv2a microcode header +typedef struct +{ + uint16_t Version; // See VERSION_XVS* + uint16_t NumInst; +} +X_VSH_SHADER_HEADER; + +#define X_VSH_INSTRUCTION_SIZE 4 +#define X_VSH_INSTRUCTION_SIZE_BYTES (X_VSH_INSTRUCTION_SIZE * sizeof(DWORD)) + // ****************************************************************** // * X_VERTEXSHADERINPUT // ****************************************************************** @@ -1145,7 +1049,8 @@ X_VERTEXSHADERINPUT; // ****************************************************************** typedef struct _X_VERTEXATTRIBUTEFORMAT { - X_VERTEXSHADERINPUT pVertexShaderInput[16]; + // Note : Alignment looks okay even without #pragma pack(1) / #include "AlignPrefix1.h" (and it's closure) + X_VERTEXSHADERINPUT Slots[X_VSH_MAX_ATTRIBUTES]; } X_VERTEXATTRIBUTEFORMAT; @@ -1159,6 +1064,18 @@ typedef struct _X_STREAMINPUT UINT Offset; } X_STREAMINPUT; +struct X_D3DVertexShader +{ + // Note : Debug XBE's have a 'Vshd' DWORD signature prefixing this! + DWORD RefCount; // Based on the observation this member is set to 1 in D3DDevice_CreateVertexShader and decreased in D3DDevice_DeleteVertexShader + DWORD Flags; + DWORD FunctionSize; // ?Also known as ProgramSize? + DWORD TotalSize; // seems to include both the function and ?constants? + DWORD NumberOfDimensionsPerTexture; // Guesswork, since all 4 bytes (for all 4 textures) are most often set to 0 (or 2 when a texture isn't used) and 1, 3 and 4 also occur (and nothing else) + X_VERTEXATTRIBUTEFORMAT VertexAttribute; + DWORD FunctionData[X_VSH_MAX_INSTRUCTION_COUNT]; // probably the binary function data and ?constants? (data continues futher outside this struct, up to TotalSize DWORD's) +}; + // vertex shader input registers for fixed function vertex shader // Name Register number D3DFVF @@ -1179,7 +1096,7 @@ const int X_D3DVSDE_VERTEX = 0xFFFFFFFF; // Xbox extension for Begin/End d //typedef X_D3DVSDE = X_D3DVSDE_POSITION..High(DWORD)-2; // Unique declaration to make overloads possible; - // bit declarations for _Type fields +// bit declarations for _Type fields const int X_D3DVSDT_FLOAT1 = 0x12; // 1D float expanded to (value, 0.0, 0.0, 1.0) const int X_D3DVSDT_FLOAT2 = 0x22; // 2D float expanded to (value, value, 0.0, 1.0) const int X_D3DVSDT_FLOAT3 = 0x32; // 3D float expanded to (value, value, value, 1.0) In double word format this is ARGB, or in byte ordering it would be B, G, R, A. @@ -1189,7 +1106,7 @@ const int X_D3DVSDT_D3DCOLOR = 0x40; // 4D packed unsigned bytes mapped to 0. const int X_D3DVSDT_SHORT2 = 0x25; // 2D signed short expanded to (value, value, 0.0, 1.0) const int X_D3DVSDT_SHORT4 = 0x45; // 4D signed short - // Xbox only declarations : +// Xbox only declarations : const int X_D3DVSDT_NORMSHORT1 = 0x11; // xbox ext. 1D signed, normalized short expanded to (value, 0.0, 0.0, 1.0). Signed, normalized shorts map from -1.0 to 1.0. const int X_D3DVSDT_NORMSHORT2 = 0x21; // xbox ext. 2D signed, normalized short expanded to (value, value, 0.0, 1.0). Signed, normalized shorts map from -1.0 to 1.0. const int X_D3DVSDT_NORMSHORT3 = 0x31; // xbox ext. 3D signed, normalized short expanded to (value, value, value, 1.0). Signed, normalized shorts map from -1.0 to 1.0. @@ -1204,10 +1121,6 @@ const int X_D3DVSDT_PBYTE4 = 0x44; // xbox ext. 4D packed byte expanded to const int X_D3DVSDT_FLOAT2H = 0x72; // xbox ext. 3D float that expands to (value, value, 0.0, value). Useful for projective texture coordinates. const int X_D3DVSDT_NONE = 0x02; // xbox ext. nsp -const int MAX_NBR_STREAMS = 16; - -typedef WORD INDEX16; - typedef enum _X_D3DVSD_TOKENTYPE { X_D3DVSD_TOKEN_NOP = 0, // NOP or extension @@ -1256,8 +1169,54 @@ typedef enum _X_D3DVSD_TOKENTYPE #define X_D3DVSD_EXTINFOSHIFT 0 #define X_D3DVSD_EXTINFOMASK (0xFFFFFF << X_D3DVSD_EXTINFOSHIFT) +#define X_D3DVSD_MAKETOKENTYPE(Type) ((Type << X_D3DVSD_TOKENTYPESHIFT) & X_D3DVSD_TOKENTYPEMASK) + +#define X_D3DVSD_STREAM(Stream) (X_D3DVSD_MAKETOKENTYPE(X_D3DVSD_TOKEN_STREAM) | (Stream)) +#define X_D3DVSD_REG(Reg, Type) (X_D3DVSD_MAKETOKENTYPE(X_D3DVSD_TOKEN_STREAMDATA) | ((Type) << X_D3DVSD_DATATYPESHIFT) | (Reg)) + +#define X_D3DVSD_NOP() 0x00000000 #define X_D3DVSD_END() 0xFFFFFFFF +// FVF Definitions +#define X_D3DFVF_RESERVED0 0x001 +#define X_D3DFVF_XYZ 0x002 +#define X_D3DFVF_XYZRHW 0x004 +#define X_D3DFVF_XYZB1 0x006 +#define X_D3DFVF_XYZB2 0x008 +#define X_D3DFVF_XYZB3 0x00a +#define X_D3DFVF_XYZB4 0x00c +#define X_D3DFVF_POSITION_MASK 0x00E +#define X_D3DFVF_NORMAL 0x010 +#define X_D3DFVF_RESERVED1 0x020 +#define X_D3DFVF_DIFFUSE 0x040 +#define X_D3DFVF_SPECULAR 0x080 +#define X_D3DFVF_TEXCOUNT_MASK 0xf00 +#define X_D3DFVF_TEXCOUNT_SHIFT 8 +#define X_D3DFVF_TEX0 0x000 +#define X_D3DFVF_TEX1 0x100 +#define X_D3DFVF_TEX2 0x200 +#define X_D3DFVF_TEX3 0x300 +#define X_D3DFVF_TEX4 0x400 +#define X_D3DFVF_TEX5 0x500 +#define X_D3DFVF_TEX6 0x600 +#define X_D3DFVF_TEX7 0x700 +#define X_D3DFVF_TEX8 0x800 +#define X_D3DFVF_TEXTUREFORMAT1 0x003 +#define X_D3DFVF_TEXTUREFORMAT2 0x000 +#define X_D3DFVF_TEXTUREFORMAT3 0x001 +#define X_D3DFVF_TEXTUREFORMAT4 0x002 + +#define X_D3DFVF_TEXCOORDSIZE1(Index) (X_D3DFVF_TEXTUREFORMAT1 << (Index * 2 + 16)) +#define X_D3DFVF_TEXCOORDSIZE2(Index) (X_D3DFVF_TEXTUREFORMAT2) +#define X_D3DFVF_TEXCOORDSIZE3(Index) (X_D3DFVF_TEXTUREFORMAT3 << (Index * 2 + 16)) +#define X_D3DFVF_TEXCOORDSIZE4(Index) (X_D3DFVF_TEXTUREFORMAT4 << (Index * 2 + 16)) + typedef DWORD NV2AMETHOD; +// +// Below declarations are used by Cxbx, not by the Xbox!!! +// + +} // end of namespace XTL + #endif diff --git a/src/CxbxKrnl/EmuD3D8/PixelShader.cpp b/src/core/hle/D3D8/XbPixelShader.cpp similarity index 66% rename from src/CxbxKrnl/EmuD3D8/PixelShader.cpp rename to src/core/hle/D3D8/XbPixelShader.cpp index 9818d79c8..22a1c0c3d 100644 --- a/src/CxbxKrnl/EmuD3D8/PixelShader.cpp +++ b/src/core/hle/D3D8/XbPixelShader.cpp @@ -1,6521 +1,8200 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->PixelShader.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 kingofc -// * -// * All rights reserved -// * -// ****************************************************************** -#define _XBOXKRNL_LOCAL_ - -/* - - This is a parser for the Xbox Pixel Shader Format. - - With the help of this parser it is possible to generate - Direct3D pixel shader assembly code. - - TODO: - - fix BumpDemo - (after second recompilation the shader does not work, - can also be something in CxbxKrnl because it looks like no - textures are set. Check cubemap loading from resourcesd!!!) - => seems to work now, the problem is that I don't know - how it must look on a real xbox - - - add reference counting constants which were added as c variables - if they are compiled away (optimization of the command, etc.) - decrement the reference count and when it reaches 0 remove - the constant (to save the num of vars) - - - add _sat feature - * Support as instruction modifier, - if necessary as mov_sat x, y - - - When porting to DirectX 9, expand this to pixel shader model 2.0 or up - - Alternatively, translate to HLSL and let D3DXCompileShader/D3DCompile figure it out -*/ - -// ****************************************************************** -// * prevent name collisions -// ****************************************************************** -//namespace xboxkrnl -//{ -// #include -//}; - -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuFS.h" -#include "CxbxKrnl/EmuXTL.h" - -//#include // X_PSH_COMBINECOUNT - -#include "CxbxKrnl/CxbxKrnl.h" // For CxbxKrnlCleanup() - -typedef uint8_t uint8; // TODO : Remove - -#include // assert() - -#include -#include - -//#include "EmuD3DPixelShader.h" - -/*---------------------------------------------------------------------------*/ -/* Texture configuration - The following members of the D3DPixelShaderDef */ -/* structure define the addressing modes of each of the four texture stages:*/ -/* PSTextureModes */ -/* PSDotMapping */ -/* PSInputTexture */ -/* PSCompareMode */ -/*---------------------------------------------------------------------------*/ - -// ========================================================================================================= -// PSTextureModes -// --------.--------.--------.---xxxxx stage0 -// --------.--------.------xx.xxx----- stage1 -// --------.--------.-xxxxx--.-------- stage2 -// --------.----xxxx.x-------.-------- stage3 - -#define PS_TEXTUREMODES(t0,t1,t2,t3) (((t3)<<15)|((t2)<<10)|((t1)<<5)|(t0)) - -/* -Texture modes: -NONE :stage inactive -PROJECT2D :argb = texture(s/q, t/q) -PROJECT3D :argb = texture(s/q, t/q, r/q) -CUBEMAP :argb = cubemap(s,t,r) -PASSTHRU :argb = s,t,r,q -CLIPPLANE :pixel not drawn if s,t,r, or q < 0. PSCompareMode affects comparison -BUMPENVMAP :argb=texture(s+mat00*src.r+mat01*src.g, - t+mat10*src.r+mat11*src.g) - mat00 set via D3DTSS_BUMPENVMAT00, etc. -BUMPENVMAP_LUM :argb=texture(s+mat00*src.r+mat01*src.g, - t+mat10*src.r+mat11*src.g); - rgb *= (lum_scale*src.b + lum_bias); (a is not affected) - lum_scale set by D3DTSS_BUMPENVLSCALE - lum_bias set by D3DTSS_BUMPENVLOFFSET - mat00 set via D3DTSS_BUMPENVMAT00, etc. -BRDF :argb = texture(eyeSigma, lightSigma, dPhi) - eyeSigma = Sigma of eye vector in spherical coordinates - lightSigma = Sigma of light vector in spherical coordinates - dPhi = Phi of eye - Phi of light -DOT_ST :argb = texture(, (s,t,r).(src.r,src.g,src.b)) -DOT_ZW :frag depth = (/((s,t,r).(src.r,src.g,src.b)) -DOT_RFLCT_DIFF :n = (,(s,t,r).(src.r,src.g,src.b),) - argb = cubemap(n) -DOT_RFLCT_SPEC :n = (,,(s,t,r).(src.r,src.g,src.b)) - r = 2*n*(n.e)/(n.n) - e where e is eye vector built from q coord of each stage - argb = cubemap(r) -DOT_STR_3D :argb=texture((,,(s,t,r).(src.r,src.g,src.b))) -DOT_STR_CUBE :argb=cubemap((,,(s,t,r).(src.r,src.g,src.b))) -DEPENDENT_AR :argb = texture(src.a, src.r) -DEPENDENT_GB :argb = texture(src.g, src.b) -DOTPRODUCT :argb = (s,t,r).(src.r,src.g,src.b) -DOT_RFLCT_SPEC_CONST :n = (,,(s,t,r).(src.r,src.g,src.b)) - r = 2*n*(n.e)/(n.n) - e where e is eye vector set via SetEyeVector() - argb = cubemap(r) -*/ - -enum PS_TEXTUREMODES -{ // valid in stage 0 1 2 3 - PS_TEXTUREMODES_NONE= 0x00L, // * * * * - PS_TEXTUREMODES_PROJECT2D= 0x01L, // * * * * - PS_TEXTUREMODES_PROJECT3D= 0x02L, // * * * * - PS_TEXTUREMODES_CUBEMAP= 0x03L, // * * * * - PS_TEXTUREMODES_PASSTHRU= 0x04L, // * * * * - PS_TEXTUREMODES_CLIPPLANE= 0x05L, // * * * * - PS_TEXTUREMODES_BUMPENVMAP= 0x06L, // - * * * - PS_TEXTUREMODES_BUMPENVMAP_LUM= 0x07L, // - * * * - PS_TEXTUREMODES_BRDF= 0x08L, // - - * * - PS_TEXTUREMODES_DOT_ST= 0x09L, // - - * * - PS_TEXTUREMODES_DOT_ZW= 0x0aL, // - - * * - PS_TEXTUREMODES_DOT_RFLCT_DIFF= 0x0bL, // - - * - - PS_TEXTUREMODES_DOT_RFLCT_SPEC= 0x0cL, // - - - * - PS_TEXTUREMODES_DOT_STR_3D= 0x0dL, // - - - * - PS_TEXTUREMODES_DOT_STR_CUBE= 0x0eL, // - - - * - PS_TEXTUREMODES_DPNDNT_AR= 0x0fL, // - * * * - PS_TEXTUREMODES_DPNDNT_GB= 0x10L, // - * * * - PS_TEXTUREMODES_DOTPRODUCT= 0x11L, // - * * - - PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST= 0x12L, // - - - * - // 0x13-0x1f reserved -}; - -// ========================================================================================================= -// PSDotMapping -// --------.--------.--------.-----xxx // stage1 -// --------.--------.--------.-xxx---- // stage2 -// --------.--------.-----xxx.-------- // stage3 - -#define PS_DOTMAPPING(t0,t1,t2,t3) (((t3)<<8)|((t2)<<4)|(t1)) - -// Mappings: -// ZERO_TO_ONE :rgb->(r,g,b): 0x0=>0.0, 0xff=>1.0 -// MINUS1_TO_1_D3D :rgb->(r,g,b): 0x0=>-128/127, 0x01=>-1.0, 0x80=>0.0, 0xff=>1.0 -// MINUS1_TO_1_GL :rgb->(r,g,b): 0x80=>-1.0, 0x0=>0.0, 0x7f=>1.0 -// MINUS1_TO_1 :rgb->(r,g,b): 0x80=>-128/127, 0x81=>-1.0, 0x0=>0.0, 0x7f=>1.0 -// HILO_1 :HL->(H,L,1.0): 0x0000=>0.0, 0xffff=>1.0 -// HILO_HEMISPHERE :HL->(H,L,sqrt(1-H*H-L*L)): 0x8001=>-1.0, 0x0=>0.0, 0x7fff=>1.0, 0x8000=>-32768/32767 - -enum PS_DOTMAPPING -{ // valid in stage 0 1 2 3 - PS_DOTMAPPING_ZERO_TO_ONE= 0x00L, // - * * * - PS_DOTMAPPING_MINUS1_TO_1_D3D= 0x01L, // - * * * - PS_DOTMAPPING_MINUS1_TO_1_GL= 0x02L, // - * * * - PS_DOTMAPPING_MINUS1_TO_1= 0x03L, // - * * * - PS_DOTMAPPING_HILO_1= 0x04L, // - * * * - // ? 0x05L ? - // ? 0x06L ? - PS_DOTMAPPING_HILO_HEMISPHERE= 0x07L, // - * * * -}; - -// ========================================================================================================= -// PSCompareMode -// --------.--------.--------.----xxxx // stage0 -// --------.--------.--------.xxxx---- // stage1 -// --------.--------.----xxxx.-------- // stage2 -// --------.--------.xxxx----.-------- // stage3 - -#define PS_COMPAREMODE(t0,t1,t2,t3) (((t3)<<12)|((t2)<<8)|((t1)<<4)|(t0)) - -enum PS_COMPAREMODE -{ - PS_COMPAREMODE_S_LT= 0x00L, - PS_COMPAREMODE_S_GE= 0x01L, - - PS_COMPAREMODE_T_LT= 0x00L, - PS_COMPAREMODE_T_GE= 0x02L, - - PS_COMPAREMODE_R_LT= 0x00L, - PS_COMPAREMODE_R_GE= 0x04L, - - PS_COMPAREMODE_Q_LT= 0x00L, - PS_COMPAREMODE_Q_GE= 0x08L, -}; - -// ========================================================================================================= -// PSInputTexture -// --------.-------x.--------.-------- // stage2 -// --------.--xx----.--------.-------- // stage3 -// -// Selects the other texture to use as an input in the following texture modes: -// DOT_ST, DOT_STR_3D, DOT_STR_CUBE, DOT_ZW, DOT_RFLCT_SPEC, -// DOT_RFLCT_DIFF, DPNDNT_AR, DPNDNT_GB, BUMPENVMAP, -// BUMPENVMAP_LUM, DOT_PRODUCT - -#define PS_INPUTTEXTURE(t0,t1,t2,t3) (((t3)<<20)|((t2)<<16)) - - -/*---------------------------------------------------------------------------------*/ -/* Color combiners - The following members of the D3DPixelShaderDef structure */ -/* define the state for the eight stages of color combiners: */ -/* PSCombinerCount - Number of stages */ -/* PSAlphaInputs[8] - Inputs for alpha portion of each stage */ -/* PSRGBInputs[8] - Inputs for RGB portion of each stage */ -/* PSConstant0[8] - Constant 0 for each stage */ -/* PSConstant1[8] - Constant 1 for each stage */ -/* PSFinalCombinerConstant0 - Constant 0 for final combiner */ -/* PSFinalCombinerConstant1 - Constant 1 for final combiner */ -/* PSAlphaOutputs[8] - Outputs for alpha portion of each stage */ -/* PSRGBOutputs[8] - Outputs for RGB portion of each stage */ -/*---------------------------------------------------------------------------------*/ - - -// ========================================================================================================= -// PSCombinerCount -// --------.--------.--------.----xxxx // number of combiners (1-8) -// --------.--------.-------x.-------- // mux bit (0= LSB, 1= MSB) -// --------.--------.---x----.-------- // separate C0 -// --------.-------x.--------.-------- // separate C1 - -#define PS_COMBINERCOUNT(count, flags) (((flags)<<8)|(count)) -// count is 1-8, flags contains one or more values from PS_COMBINERCOUNTFLAGS - -enum PS_COMBINERCOUNTFLAGS -{ - PS_COMBINERCOUNT_MUX_LSB= 0x0000L, // mux on r0.a lsb - PS_COMBINERCOUNT_MUX_MSB= 0x0001L, // mux on r0.a msb - - PS_COMBINERCOUNT_SAME_C0= 0x0000L, // c0 same in each stage - PS_COMBINERCOUNT_UNIQUE_C0= 0x0010L, // c0 unique in each stage - - PS_COMBINERCOUNT_SAME_C1= 0x0000L, // c1 same in each stage - PS_COMBINERCOUNT_UNIQUE_C1= 0x0100L // c1 unique in each stage -}; - -// ========================================================================================================= -// PSRGBInputs[0-7] -// PSAlphaInputs[0-7] -// PSFinalCombinerInputsABCD -// PSFinalCombinerInputsEFG -// --------.--------.--------.----xxxx // D register -// --------.--------.--------.---x---- // D channel (0= RGB/BLUE, 1= ALPHA) -// --------.--------.--------.xxx----- // D input mapping -// --------.--------.----xxxx.-------- // C register -// --------.--------.---x----.-------- // C channel (0= RGB/BLUE, 1= ALPHA) -// --------.--------.xxx-----.-------- // C input mapping -// --------.----xxxx.--------.-------- // B register -// --------.---x----.--------.-------- // B channel (0= RGB/BLUE, 1= ALPHA) -// --------.xxx-----.--------.-------- // B input mapping -// ----xxxx.--------.--------.-------- // A register -// ---x----.--------.--------.-------- // A channel (0= RGB/BLUE, 1= ALPHA) -// xxx-----.--------.--------.-------- // A input mapping - -// examples: -// -// shader.PSRGBInputs[3]= PS_COMBINERINPUTS( -// PS_REGISTER_T0 | PS_INPUTMAPPING_EXPAND_NORMAL | PS_CHANNEL_RGB, -// PS_REGISTER_C0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_ALPHA, -// PS_REGISTER_ZERO, -// PS_REGISTER_ZERO); -// -// shader.PSFinalCombinerInputsABCD= PS_COMBINERINPUTS( -// PS_REGISTER_T0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_ALPHA, -// PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL | PS_CHANNEL_RGB, -// PS_REGISTER_EFPROD | PS_INPUTMAPPING_UNSIGNED_INVERT | PS_CHANNEL_RGB, -// PS_REGISTER_ZERO); -// -// PS_FINALCOMBINERSETTING is set in 4th field of PSFinalCombinerInputsEFG with PS_COMBINERINPUTS -// example: -// -// shader.PSFinalCombinerInputsEFG= PS_COMBINERINPUTS( -// PS_REGISTER_R0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_RGB, -// PS_REGISTER_R1 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_RGB, -// PS_REGISTER_R1 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_BLUE, -// PS_FINALCOMBINERSETTING_CLAMP_SUM | PS_FINALCOMBINERSETTING_COMPLEMENT_R0); - -#define PS_COMBINERINPUTS(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) -// For PSFinalCombinerInputsEFG, -// a,b,c contain a value from PS_REGISTER, PS_CHANNEL, and PS_INPUTMAPPING for input E,F, and G -// d contains values from PS_FINALCOMBINERSETTING -// For all other inputs, -// a,b,c,d each contain a value from PS_REGISTER, PS_CHANNEL, and PS_INPUTMAPPING - -// The input can have the following mappings applied : -// -// PS_INPUTMAPPING_UNSIGNED_IDENTITY : y = max(0,x) = 1*max(0,x) + 0.0 -// PS_INPUTMAPPING_UNSIGNED_INVERT : y = 1 - max(0,x) = -1*max(0,x) + 1.0 -// PS_INPUTMAPPING_EXPAND_NORMAL : y = 2*max(0,x) - 1 = 2*max(0,x) - 1.0 -// PS_INPUTMAPPING_EXPAND_NEGATE : y = 1 - 2*max(0,x) = -2*max(0,x) + 1.0 -// PS_INPUTMAPPING_HALFBIAS_NORMAL : y = max(0,x) - 1/2 = 1*max(0,x) - 0.5 -// PS_INPUTMAPPING_HALFBIAS_NEGATE : y = 1/2 - max(0,x) = -1*max(0,x) + 0.5 -// PS_INPUTMAPPING_SIGNED_IDENTITY : y = x = 1* x + 0.0 -// PS_INPUTMAPPING_SIGNED_NEGATE : y = -x = -1* x + 0.0 -// -// (Note : I don't know for sure if the max() operation mentioned above is indeed what happens, -// as there's no further documentation available on this. Native Direct3D can clamp with the -// '_sat' instruction modifier, but that's not really the same as these Xbox1 input mappings.) -// -// When the input register is PS_ZERO, the above mappings result in the following constants: -// -// PS_REGISTER_NEGATIVE_ONE (PS_INPUTMAPPING_EXPAND_NORMAL on zero) : y = -1.0 -// PS_REGISTER_NEGATIVE_ONE_HALF (PS_INPUTMAPPING_HALFBIAS_NORMAL on zero) : y = -0.5 -// PS_REGISTER_ZERO itself : y = 0.0 -// PS_REGISTER_ONE_HALF (PS_INPUTMAPPING_HALFBIAS_NEGATE on zero) : y = 0.5 -// PS_REGISTER_ONE (PS_INPUTMAPPING_UNSIGNED_INVERT on zero) : y = 1.0 -// (Note : It has no define, but PS_INPUTMAPPING_EXPAND_NEGATE on zero results in ONE too!) - -enum PS_INPUTMAPPING -{ - PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, // max(0,x) OK for final combiner: y = abs(x) - PS_INPUTMAPPING_UNSIGNED_INVERT= 0x20L, // 1 - max(0,x) OK for final combiner: y = 1 - x - PS_INPUTMAPPING_EXPAND_NORMAL= 0x40L, // 2*max(0,x) - 1 invalid for final combiner - PS_INPUTMAPPING_EXPAND_NEGATE= 0x60L, // 1 - 2*max(0,x) invalid for final combiner - PS_INPUTMAPPING_HALFBIAS_NORMAL= 0x80L, // max(0,x) - 1/2 invalid for final combiner - PS_INPUTMAPPING_HALFBIAS_NEGATE= 0xa0L, // 1/2 - max(0,x) invalid for final combiner - PS_INPUTMAPPING_SIGNED_IDENTITY= 0xc0L, // x invalid for final combiner - PS_INPUTMAPPING_SIGNED_NEGATE= 0xe0L, // -x invalid for final combiner -}; - -enum PS_REGISTER -{ - PS_REGISTER_ZERO= 0x00L, // r - PS_REGISTER_DISCARD= 0x00L, // w - PS_REGISTER_C0= 0x01L, // r - PS_REGISTER_C1= 0x02L, // r - PS_REGISTER_FOG= 0x03L, // r - PS_REGISTER_V0= 0x04L, // r/w - PS_REGISTER_V1= 0x05L, // r/w - PS_REGISTER_T0= 0x08L, // r/w - PS_REGISTER_T1= 0x09L, // r/w - PS_REGISTER_T2= 0x0aL, // r/w - PS_REGISTER_T3= 0x0bL, // r/w - PS_REGISTER_R0= 0x0cL, // r/w - PS_REGISTER_R1= 0x0dL, // r/w - PS_REGISTER_V1R0_SUM= 0x0eL, // r - PS_REGISTER_EF_PROD= 0x0fL, // r - - PS_REGISTER_ONE= PS_REGISTER_ZERO | PS_INPUTMAPPING_UNSIGNED_INVERT, // 0x20 OK for final combiner - PS_REGISTER_NEGATIVE_ONE= PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL, // 0x40 invalid for final combiner - PS_REGISTER_ONE_HALF= PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NEGATE, // 0xa0 invalid for final combiner - PS_REGISTER_NEGATIVE_ONE_HALF= PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NORMAL, // 0x80 invalid for final combiner - - PS_REGISTER_CXBX_PROD = PS_REGISTER_ZERO | PS_INPUTMAPPING_SIGNED_IDENTITY, // Cxbx internal use -}; - -// FOG ALPHA is only available in final combiner -// V1R0_SUM and EF_PROD are only available in final combiner (A,B,C,D inputs only) -// V1R0_SUM_ALPHA and EF_PROD_ALPHA are not available -// R0_ALPHA is initialized to T0_ALPHA in stage0 - -enum PS_CHANNEL -{ - PS_CHANNEL_RGB= 0x00, // used as RGB source - PS_CHANNEL_BLUE= 0x00, // used as ALPHA source - PS_CHANNEL_ALPHA= 0x10, // used as RGB or ALPHA source -}; - -constexpr DWORD PS_ChannelMask = (DWORD)PS_CHANNEL_ALPHA; -constexpr DWORD PS_NoChannelMask = (DWORD)(~PS_ChannelMask); -constexpr DWORD PS_AlphaChannelsMask = (DWORD)(PS_ChannelMask | (PS_ChannelMask << 8) | (PS_ChannelMask << 16) | (PS_ChannelMask << 24)); -constexpr DWORD PS_NoChannelsMask = (DWORD)(~PS_AlphaChannelsMask); - -enum PS_FINALCOMBINERSETTING -{ - PS_FINALCOMBINERSETTING_CLAMP_SUM= 0x80, // V1+R0 sum clamped to [0,1] - PS_FINALCOMBINERSETTING_COMPLEMENT_V1= 0x40, // unsigned invert mapping (1 - v1) is used as an input to the sum rather than v1 - PS_FINALCOMBINERSETTING_COMPLEMENT_R0= 0x20, // unsigned invert mapping (1 - r0) is used as an input to the sum rather than r0 -}; - -// ========================================================================================================= -// PSRGBOutputs[0-7] -// PSAlphaOutputs[0-7] -// --------.--------.--------.----xxxx // CD register -// --------.--------.--------.xxxx---- // AB register -// --------.--------.----xxxx.-------- // SUM register -// --------.--------.---x----.-------- // CD output (0= multiply, 1= dot product) -// --------.--------.--x-----.-------- // AB output (0= multiply, 1= dot product) -// --------.--------.-x------.-------- // AB_CD mux/sum select (0= sum, 1= mux) -// --------.------xx.x-------.-------- // Output mapping -// --------.-----x--.--------.-------- // CD blue to alpha -// --------.----x---.--------.-------- // AB blue to alpha - -#define PS_COMBINEROUTPUTS(ab,cd,mux_sum,flags) (((flags)<<12)|((mux_sum)<<8)|((ab)<<4)|(cd)) -// ab,cd,mux_sum contain a value from PS_REGISTER -// flags contains values from PS_COMBINEROUTPUT - -enum PS_COMBINEROUTPUT -{ - PS_COMBINEROUTPUT_IDENTITY= 0x00L, // y = x - PS_COMBINEROUTPUT_BIAS= 0x08L, // y = x - 0.5 - PS_COMBINEROUTPUT_SHIFTLEFT_1= 0x10L, // y = x*2 - PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS= 0x18L, // y = (x - 0.5)*2 - PS_COMBINEROUTPUT_SHIFTLEFT_2= 0x20L, // y = x*4 - // 0x28 ? - PS_COMBINEROUTPUT_SHIFTRIGHT_1= 0x30L, // y = x/2 - // 0x38 ? - - PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA= 0x80L, // RGB only - - PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA= 0x40L, // RGB only - - PS_COMBINEROUTPUT_AB_MULTIPLY= 0x00L, - PS_COMBINEROUTPUT_AB_DOT_PRODUCT= 0x02L, // RGB only - - PS_COMBINEROUTPUT_CD_MULTIPLY= 0x00L, - PS_COMBINEROUTPUT_CD_DOT_PRODUCT= 0x01L, // RGB only - - PS_COMBINEROUTPUT_AB_CD_SUM= 0x00L, // 3rd output is AB+CD - PS_COMBINEROUTPUT_AB_CD_MUX= 0x04L, // 3rd output is MUX(AB,CD) based on R0.a -}; - -// AB_CD register output must be DISCARD if either AB_DOT_PRODUCT or CD_DOT_PRODUCT are set - -// ========================================================================================================= -// PSC0Mapping -// PSC1Mapping -// --------.--------.--------.----xxxx // offset of D3D constant for stage 0 -// --------.--------.--------.xxxx---- // offset of D3D constant for stage 1 -// --------.--------.----xxxx.-------- // offset of D3D constant for stage 2 -// --------.--------.xxxx----.-------- // offset of D3D constant for stage 3 -// --------.----xxxx.--------.-------- // offset of D3D constant for stage 4 -// --------.xxxx----.--------.-------- // offset of D3D constant for stage 5 -// ----xxxx.--------.--------.-------- // offset of D3D constant for stage 6 -// xxxx----.--------.--------.-------- // offset of D3D constant for stage 7 - -#define PS_CONSTANTMAPPING(s0,s1,s2,s3,s4,s5,s6,s7) \ - (((DWORD)(s0)&0xf)<< 0) | (((DWORD)(s1)&0xf)<< 4) | \ - (((DWORD)(s2)&0xf)<< 8) | (((DWORD)(s3)&0xf)<<12) | \ - (((DWORD)(s4)&0xf)<<16) | (((DWORD)(s5)&0xf)<<20) | \ - (((DWORD)(s6)&0xf)<<24) | (((DWORD)(s7)&0xf)<<28) -// s0-s7 contain the offset of the D3D constant that corresponds to the -// c0 or c1 constant in stages 0 through 7. These mappings are only used in -// SetPixelShaderConstant(). - -// ========================================================================================================= -// PSFinalCombinerConstants -// --------.--------.--------.----xxxx // offset of D3D constant for C0 -// --------.--------.--------.xxxx---- // offset of D3D constant for C1 -// --------.--------.-------x.-------- // Adjust texture flag - -#define PS_FINALCOMBINERCONSTANTS(c0,c1,flags) (((DWORD)(flags) << 8) | ((DWORD)(c0)&0xf)<< 0) | (((DWORD)(c1)&0xf)<< 4) -// c0 and c1 contain the offset of the D3D constant that corresponds to the -// constants in the final combiner. These mappings are only used in -// SetPixelShaderConstant(). Flags contains values from PS_GLOBALFLAGS - -enum PS_GLOBALFLAGS -{ - // if this flag is set, the texture mode for each texture stage is adjusted as follows: - // if set texture is a cubemap, - // change PS_TEXTUREMODES_PROJECT2D to PS_TEXTUREMODES_CUBEMAP - // change PS_TEXTUREMODES_PROJECT3D to PS_TEXTUREMODES_CUBEMAP - // change PS_TEXTUREMODES_DOT_STR_3D to PS_TEXTUREMODES_DOT_STR_CUBE - // if set texture is a volume texture, - // change PS_TEXTUREMODES_PROJECT2D to PS_TEXTUREMODES_PROJECT3D - // change PS_TEXTUREMODES_CUBEMAP to PS_TEXTUREMODES_PROJECT3D - // change PS_TEXTUREMODES_DOT_STR_CUBE to PS_TEXTUREMODES_DOT_STR_3D - // if set texture is neither cubemap or volume texture, - // change PS_TEXTUREMODES_PROJECT3D to PS_TEXTUREMODES_PROJECT2D - // change PS_TEXTUREMODES_CUBEMAP to PS_TEXTUREMODES_PROJECT2D - - PS_GLOBALFLAGS_NO_TEXMODE_ADJUST= 0x0000L, // don"t adjust texture modes - PS_GLOBALFLAGS_TEXMODE_ADJUST= 0x0001L, // adjust texture modes according to set texture -}; - -enum PSH_OPCODE -{ - PO_COMMENT, - PO_PS, - PO_DEF, - PO_DCL, // Note : ps.2.0 and up only - PO_TEX, - PO_TEXBEM, - PO_TEXBEML, - PO_TEXBRDF, // Xbox ext. - PO_TEXCOORD, - PO_TEXKILL, - PO_TEXDP3, // Note : ps.1.3 only - PO_TEXDP3TEX, // Note : ps.1.3 only - PO_TEXM3X2TEX, - PO_TEXM3X2DEPTH, // Note : requires ps.1.3 and a preceding texm3x2pad - PO_TEXM3X3DIFF, // Xbox ext. - PO_TEXM3X3VSPEC, - PO_TEXM3X3TEX, // Note : Uses a cube texture - PO_TEXREG2AR, - PO_TEXREG2GB, - PO_TEXM3X2PAD, // Note : Must be combined with texm3x2tex or texm3x2depth - PO_TEXM3X3PAD, - PO_TEXM3X3SPEC, // NOTE : NEEDS 3 ARGUMENTS! - // Direct3D8 arithmetic instructions : - PO_ADD, - PO_CMP, - PO_CND, - PO_DP3, // dp3 d, s1,s2 : d=s0 dot s1 (replicated to all channels, .rgb=color only, .a=color+alpha) - PO_DP4, // dp3 d, s1,s2 : d.r=d.g=d.b=d.a=(s1.r*s2.r)+(s1.g*s2.g)+(s1.b*s2.b)+(s1.a*s2.a) - PO_LRP, - PO_MAD, - PO_MOV, - PO_MUL, - PO_NOP, - PO_SUB, - // Xbox1 opcodes : - PO_XMMA, - PO_XMMC, - PO_XDM, - PO_XDD, - PO_XFC, - PO_XPS, -}; - -const struct { char *mn; int _Out; int _In; char *note; } PSH_OPCODE_DEFS[/*PSH_OPCODE*/] = { - // Pixel shader header opcodes (must be specified in this order) : - {/* PO_COMMENT */ /*mn:*/";", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // - {/* PO_PS */ /*mn:*/"ps", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // Must occur once - {/* PO_DEF */ /*mn:*/"def", /*_Out: */ 1, /*_In: */ 4, /*note:*/"" }, // Output must be a PARAM_C, arguments must be 4 floats [0.00f .. 1.00f] - {/* PO_DCL */ /*mn:*/"dcl", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, // Note : ps.2.0 and up only - {/* PO_TEX */ /*mn:*/"tex", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, - {/* PO_TEXBEM */ /*mn:*/"texbem", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXBEML */ /*mn:*/"texbeml", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXBRDF */ /*mn:*/"texbrdf", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Not supported by Direct3D8 ? - {/* PO_TEXCOORD */ /*mn:*/"texcoord", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, - {/* PO_TEXKILL */ /*mn:*/"texkill", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, - {/* PO_TEXDP3 */ /*mn:*/"texdp3", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXDP3TEX */ /*mn:*/"texdp3tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X2TEX */ /*mn:*/"texm3x2tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X2DEPTH */ /*mn:*/"texm3x2depth", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ requires ps.1.3 and a preceding texm3x2pad - {/* PO_TEXM3X3DIFF */ /*mn:*/"texm3x3diff", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Not supported by Direct3D8 ? - {/* PO_TEXM3X3VSPEC */ /*mn:*/"texm3x3vspec", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X3TEX */ /*mn:*/"texm3x3tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Uses a cube texture - {/* PO_TEXREG2AR */ /*mn:*/"texreg2ar", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXREG2GB */ /*mn:*/"texreg2gb", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X2PAD */ /*mn:*/"texm3x2pad", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X3PAD */ /*mn:*/"texm3x3pad", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, - {/* PO_TEXM3X3SPEC */ /*mn:*/"texm3x3spec", /*_Out: */ 1, /*_In: */ 2, /*note:*/"" }, - // Arithmetic opcodes : - {/* PO_ADD */ /*mn:*/"add", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0+s1" }, - {/* PO_CMP */ /*mn:*/"cmp", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0={s0>=0?s1:s2}" }, - {/* PO_CND */ /*mn:*/"cnd", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0={s0.a>0.5?s1:s2}" }, // 1st input must be "r0.a" - {/* PO_DP3 */ /*mn:*/"dp3", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0 dot3 s1" }, - {/* PO_DP4 */ /*mn:*/"dp4", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0 dot4 s1" }, - {/* PO_LRP */ /*mn:*/"lrp", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0=s0*s1+{1-s0}*s2=s0*{s1-s2}+s2" }, - {/* PO_MAD */ /*mn:*/"mad", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0=s0*s1+s2" }, - {/* PO_MOV */ /*mn:*/"mov", /*_Out: */ 1, /*_In: */ 1, /*note:*/"d0=s0" }, - {/* PO_MUL */ /*mn:*/"mul", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0*s1" }, - {/* PO_NOP */ /*mn:*/"nop", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, - {/* PO_SUB */ /*mn:*/"sub", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0-s1" }, - // Xbox-only {NV2A} opcodes : - {/* PO_XMMA */ /*mn:*/"xmma", /*_Out: */ 3, /*_In: */ 4, /*note:*/"d0=s0*s1, d1=s2*s3, d2={s0*s1}+{s2*s3}" }, - {/* PO_XMMC */ /*mn:*/"xmmc", /*_Out: */ 3, /*_In: */ 4, /*note:*/"d0=s0*s1, d1=s2*s3, d2={r0.a>0.5}?{s0*s1}:{s2*s3}" }, - {/* PO_XDM */ /*mn:*/"xdm", /*_Out: */ 2, /*_In: */ 4, /*note:*/"d0=s0 dot s1, d1=s2*s3" }, - {/* PO_XDD */ /*mn:*/"xdd", /*_Out: */ 2, /*_In: */ 4, /*note:*/"d0=s0 dot s1, d1=s2 dot s3" }, - {/* PO_XFC */ /*mn:*/"xfc", /*_Out: */ 0, /*_In: */ 7, /*note:*/"r0.rgb=s0*s1+{1-s0}*s2+s3, r0.a=s6.a, prod=s4*s5, sum=r0+v1" }, - {/* PO_XPS */ /*mn:*/"xps", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // Must occur once -}; - -enum PSH_ARGUMENT_TYPE -{ - PARAM_VALUE, // Xbox only; Numberic constants used in Xbox-only opcodes - PARAM_DISCARD, // Xbox only; - PARAM_FOG, // Final combiner only; Read-only register fog register - PARAM_V1R0_SUM, // Final combiner only; Read-only register that contains the result of V1+R0 - PARAM_EF_PROD, // Final combiner only; Read-only register that contains the result of final combiner parameters E * F - PARAM_R, // Temporary registers (unassigned except r0.a, which on NV2A is initially set to t0.a) - PARAM_T, // Textures - PARAM_V, // Vertex colors - PARAM_C // Constant registers, set by def opcodes or SetPixelShaderConstant -}; - -const char *PSH_ARGUMENT_TYPE_Str[/*PSH_ARGUMENT_TYPE*/] = { -// Prefix # r/w Input? Output? Note - "", // * r No No Used for numeric constants like -1, 0, 1 - "discard", // * w No Yes Only for xbox opcodes (native opcodes have single output - discards must be removed) - "fog", // 1 r Yes No Only for final combiner parameter - "sum", // 1 r Yes No Only for final combiner parameter - "prod", // 1 r Yes No Only for final combiner parameter - "r", // 2 r/w Yes Yes We fake a few extra registers and resolve them in FixupPixelShader - "t", // 4 r/w Yes Yes D3D9 cannot write to these! - "v", // 2 r Yes Yes - "c" // 16 r Yes No Xbox has 8*c0,c1=16, while PC D3D8 has only 8, we try to reduce that in FixupPixelShader -}; - -constexpr int FakeRegNr_Sum = 2; -constexpr int FakeRegNr_Prod = 3; -constexpr int FakeRegNr_Xmm1 = 4; -constexpr int FakeRegNr_Xmm2 = 5; - -constexpr int XFC_COMBINERSTAGENR = XTL::X_PSH_COMBINECOUNT; // Always call XFC 'stage 9', 1 after the 8th combiner - -constexpr int PSH_XBOX_MAX_C_REGISTER_COUNT = 16; -constexpr int PSH_XBOX_MAX_R_REGISTER_COUNT = 2; -constexpr int PSH_XBOX_MAX_T_REGISTER_COUNT = 4; -constexpr int PSH_XBOX_MAX_V_REGISTER_COUNT = 2; -// Extra constants to support features not present in Native D3D : -constexpr int PSH_XBOX_CONSTANT_FOG = PSH_XBOX_MAX_C_REGISTER_COUNT; // = 16 -constexpr int PSH_XBOX_CONSTANT_FC0 = PSH_XBOX_CONSTANT_FOG + 1; // = 17 -constexpr int PSH_XBOX_CONSTANT_FC1 = PSH_XBOX_CONSTANT_FC0 + 1; // = 18 -constexpr int PSH_XBOX_CONSTANT_MAX = PSH_XBOX_CONSTANT_FC1 + 1; // = 19 - -enum PSH_INST_MODIFIER { - INSMOD_NONE, // y = x - INSMOD_BIAS, // y = x - 0.5 // Xbox only : TODO : Fixup occurrances! - INSMOD_X2, // y = x * 2 - INSMOD_BX2, // y = (x - 0.5) * 2 // Xbox only : TODO : Fixup occurrances! - INSMOD_X4, // y = x * 4 - INSMOD_D2, // y = x * 0.5 - INSMOD_SAT // Xbox doesn"t support this, but has ARGMOD_SATURATE instead -}; - -const char *PSH_INST_MODIFIER_Str[/*PSH_INST_MODIFIER*/] = { - "", - "_bias", - "_x2", - "_bx2", - "_x4", - "_d2", - "_sat" -}; - -// Four argument modifiers (applied in this order) : -// 1: Inversion (invert or negate : "1-" or "-") -// 2: Apply bias ("_bias") -// 3: Apply scale ("_x2", "_bx2", "_x4", or "_d2") -// 4: Apply clamp ("_sat") -enum PSH_ARG_MODIFIER { - ARGMOD_IDENTITY, // y = x - - ARGMOD_INVERT, // y = 1-x -> 0..1 > 1..0 - ARGMOD_NEGATE, // y = -x -> 0..1 > 0..-1 - - ARGMOD_BIAS, // y = x-0.5 -> 0..1 > -0.5..0.5 - - ARGMOD_SCALE_X2, // y = x*2 -> 0..1 > 0..2 - ARGMOD_SCALE_BX2, // y = (x*2)-1 -> 0..1 > -1..1 - ARGMOD_SCALE_X4, // y = x*4 -> 0..1 > 0..4 - ARGMOD_SCALE_D2, // y = x/2 -> 0..1 > 0..0.5 - - ARGMOD_SATURATE, // Xbox - not available in PS1.3 (can be done on output instead) - - ARGMOD_ALPHA_REPLICATE, - ARGMOD_BLUE_REPLICATE // PS1.1-PS1.3 only allow this if destination writemask = .a -}; - -typedef DWORD PSH_ARG_MODIFIERs; // = set of PSH_ARG_MODIFIER; - -const char *PSH_ARG_MODIFIER_Str[/*PSH_ARG_MODIFIER*/] = { - "%s", - - "1-%s", - "-%s", - - "%s_bias", - - "%s_x2", - "%s_bx2", - "%s_x4", - "%s_d2", - - "%s_sat", - - "%s", // .a is added via Mask - "%s" // .b idem -}; - -struct RPSRegisterObject { - bool IsAlpha; - PS_REGISTER Reg; - - void Decode(uint8 Value, bool aIsAlpha); - std::string DecodedToString(); -}; - -struct RPSInputRegister : RPSRegisterObject { - PS_CHANNEL Channel; - PS_INPUTMAPPING InputMapping; - - void Decode(uint8 Value, bool aIsAlpha); - std::string DecodedToString(); -}; - -struct RPSCombinerOutput : RPSRegisterObject { - RPSInputRegister Input1; // Called InputA or InputC (depending if it's inside the AB or CD combiner) - RPSInputRegister Input2; // Called InputC or InputD (depending if it's inside the AB or CD combiner) - bool DotProduct; // False=Multiply, True=DotProduct - bool BlueToAlpha; // False=Alpha-to-Alpha, True=Blue-to-Alpha - - void Decode(uint8 Value, DWORD PSInputs, bool aIsAlpha); -}; - -struct RPSCombinerOutputMuxSum : RPSRegisterObject { - RPSCombinerOutput OutputAB; // Contains InputA and InputB (as Input1 and Input2) - RPSCombinerOutput OutputCD; // Contains InputC and InputD (as Input1 and Input2) -}; - -struct RPSCombinerStageChannel { - RPSCombinerOutputMuxSum OutputSUM; // Contains OutputAB, OutputCD - PS_COMBINEROUTPUT CombinerOutputFlags; - bool AB_CD_SUM; // True=AB+CD, False=MUX(AB;CD) based on R0.a - - void Decode(DWORD PSInputs, DWORD PSOutputs, bool aIsAlpha = false); -}; - -struct RPSCombinerStage { - RPSCombinerStageChannel RGB; - RPSCombinerStageChannel Alpha; -}; - -struct RPSFinalCombiner { - RPSInputRegister InputA; - RPSInputRegister InputB; - RPSInputRegister InputC; - RPSInputRegister InputD; - RPSInputRegister InputE; - RPSInputRegister InputF; - RPSInputRegister InputG; - - PS_FINALCOMBINERSETTING FinalCombinerFlags; - - uint8 FinalCombinerC0Mapping; - uint8 FinalCombinerC1Mapping; - - DWORD dwPS_GLOBALFLAGS; - - void Decode(const DWORD PSFinalCombinerInputsABCD, const DWORD PSFinalCombinerInputsEFG, const DWORD PSFinalCombinerConstants); -}; - -constexpr DWORD MASK_R = 0x001; -constexpr DWORD MASK_G = 0x002; -constexpr DWORD MASK_B = 0x004; -constexpr DWORD MASK_A = 0x008; -constexpr DWORD MASK_RGB = MASK_R | MASK_G | MASK_B; -constexpr DWORD MASK_RGBA = MASK_R | MASK_G | MASK_B | MASK_A; - -enum - TArgumentType { - atInput, atOutput, atFinalCombiner -}; - -typedef struct _PSH_IMD_ARGUMENT { - PSH_ARGUMENT_TYPE Type; // For parameters: R, T, V or C For output : Discard, R, T or V - int16 Address; // Register address - DWORD Mask; - PSH_ARG_MODIFIERs Modifiers; - float Multiplier; - - void SetConstValue(float Value); - float GetConstValue(); - bool UsesRegister(); - bool IsRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress); // overload; - bool IsRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress, DWORD aMask); // overload; - void SetRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress, DWORD aMask); - std::string ToString(); - bool Decode(const DWORD Value, DWORD aMask, TArgumentType ArgumentType); - void Invert(); - void Negate(); -} PSH_IMD_ARGUMENT, -*PPSH_IMD_ARGUMENT; - -//TPSH_IMD_ARGUMENTArray = array[0..(MaxInt div SizeOf(PSH_IMD_ARGUMENT)) - 1] of PSH_IMD_ARGUMENT; -//PPSH_IMD_ARGUMENTs = ^TPSH_IMD_ARGUMENTArray; - -typedef struct _PSH_INTERMEDIATE_FORMAT { - int CombinerStageNr; - bool IsCombined; - PSH_OPCODE Opcode; - std::string CommentString; - PSH_INST_MODIFIER Modifier; - PSH_IMD_ARGUMENT Output[3]; // 3 = xmm* output count - PSH_IMD_ARGUMENT Parameters[7]; // 7 = xfc parameter count - - _PSH_INTERMEDIATE_FORMAT *Initialize(const PSH_OPCODE aOpcode); - std::string ToString(); - bool IsArithmetic(); - void ScaleOutput(float aFactor); - bool ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress); // overload; - bool ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask); // overload; - bool WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress); // overload; - bool WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask); // overload; - void SwapParameter(const int Index1, const int Index2); - void XSwapOutput(); - bool MoveRemovableParametersRight(const int Index1, const int Index2); - bool XMoveNonRegisterOutputsRight(); - void XCopySecondOpcodeToFirst(const PSH_OPCODE aOpcode); - bool Decode(DWORD aCombinerStageNr, DWORD PSInputs, DWORD PSOutputs, DWORD aMask); - bool DecodeFinalCombiner(DWORD aPSFinalCombinerInputsABCD, DWORD aPSFinalCombinerInputsEFG); -} PSH_INTERMEDIATE_FORMAT, -*PPSH_INTERMEDIATE_FORMAT; - -typedef struct _PSH_RECOMPILED_SHADER { - XTL::X_D3DPIXELSHADERDEF PSDef; - std::string NewShaderStr; - DWORD ConvertedHandle; - bool ConstInUse[PSH_XBOX_CONSTANT_MAX]; - int ConstMapping[PSH_XBOX_CONSTANT_MAX]; -} PSH_RECOMPILED_SHADER, -*PPSH_RECOMPILED_SHADER; - -struct PSH_XBOX_SHADER { - uint32 m_PSVersion; // see D3DPS_VERSION - https://msdn.microsoft.com/en-us/library/windows/desktop/bb172592(v=vs.85).aspx - int MaxConstantFloatRegisters; - int MaxTemporaryRegisters; - int MaxSamplerRegisters; // Sampler (Direct3D 9 asm-ps) - int MaxTextureCoordinateRegisters; - int MaxInputColorRegisters; - int PSH_PC_MAX_REGISTER_COUNT; - - // Reserve enough slots for all shaders, so we need space for 2 constants, 4 texture addressing codes and 5 lines per opcode : : - PSH_INTERMEDIATE_FORMAT Intermediate[2 + XTL::X_D3DTS_STAGECOUNT + (XTL::X_PSH_COMBINECOUNT * 5) + 1]; - int IntermediateCount; - - PS_TEXTUREMODES PSTextureModes[XTL::X_D3DTS_STAGECOUNT]; - PS_DOTMAPPING PSDotMapping[XTL::X_D3DTS_STAGECOUNT]; - DWORD PSCompareMode[XTL::X_D3DTS_STAGECOUNT]; - int PSInputTexture[XTL::X_D3DTS_STAGECOUNT]; - - PS_FINALCOMBINERSETTING FinalCombinerFlags; - // Note : The following constants are only needed for PSH_XBOX_SHADER::DecodedToString, - // they are not involved in the actual pixel shader recompilation anymore : - RPSFinalCombiner FinalCombiner; - RPSCombinerStage Combiners[XTL::X_PSH_COMBINECOUNT]; - int NumberOfCombiners; - DWORD CombinerCountFlags; // For PS_COMBINERCOUNTFLAGS - // Read from CombinerCountFlags : - bool CombinerMuxesOnMsb; - bool CombinerHasUniqueC0; - bool CombinerHasUniqueC1; - - void SetPSVersion(const uint32 PSVersion); - - std::string ToString(); - void Log(const char *PhaseStr); - PPSH_INTERMEDIATE_FORMAT NewIntermediate(); - void InsertIntermediate(PPSH_INTERMEDIATE_FORMAT pIntermediate, int Index); - void DeleteIntermediate(int Index); - void DeleteLastIntermediate(); - std::string static OriginalToString(XTL::X_D3DPIXELSHADERDEF *pPSDef); - PSH_RECOMPILED_SHADER Decode(XTL::X_D3DPIXELSHADERDEF *pPSDef); - std::string DecodedToString(XTL::X_D3DPIXELSHADERDEF *pPSDef); - bool _NextIs2D(int Stage); - bool DecodeTextureModes(XTL::X_D3DPIXELSHADERDEF *pPSDef); - bool MoveRemovableParametersRight(); - void ConvertXboxOpcodesToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef); - void _SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, XTL::D3DCOLOR ConstColor); - int _MapConstant(int ConstNr, bool *NativeConstInUse); - int _HandleConst(int XboxConst, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled, bool *NativeConstInUse, bool *EmittedNewConstant); - bool ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled); - bool RemoveUselessWrites(); - bool IsRegisterFreeFromIndexOnwards(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16 aAddress); - void ReplaceRegisterFromIndexOnwards(int aIndex, - PSH_ARGUMENT_TYPE aSrcRegType, int16 aSrcAddress, - PSH_ARGUMENT_TYPE aDstRegType, int16 aDstAddress); - bool ConvertXMMToNative_Except3RdOutput(int i); - void ConvertXPSToNative(int i); - void ConvertXMMAToNative(int i); - void ConvertXMMCToNative(int i); - void ConvertXDMToNative(int i); - void ConvertXDDToNative(int i); - void ConvertXFCToNative(int i); - bool FixConstantModifiers(); - bool CombineInstructions(); - bool RemoveNops(); - bool SimplifyMOV(PPSH_INTERMEDIATE_FORMAT Cur); - bool SimplifyADD(PPSH_INTERMEDIATE_FORMAT Cur); - bool SimplifyMAD(PPSH_INTERMEDIATE_FORMAT Cur); - bool SimplifySUB(PPSH_INTERMEDIATE_FORMAT Cur); - bool SimplifyMUL(PPSH_INTERMEDIATE_FORMAT Cur); - bool SimplifyLRP(PPSH_INTERMEDIATE_FORMAT Cur); - bool FixupPixelShader(); - bool FixInvalidSrcSwizzle(); - bool FixMissingR0a(); - bool FixMissingR1a(); - bool FixCoIssuedOpcodes(); -}; - -/* -* Blueshogun's code (useful for debugging the PixelShader binary format) -*/ - -// PS Texture Modes -char* PS_TextureModesStr[/*PS_TEXTUREMODES*/] = -{ - "PS_TEXTUREMODES_NONE", // 0x00 - "PS_TEXTUREMODES_PROJECT2D", // 0x01 - "PS_TEXTUREMODES_PROJECT3D", // 0x02 - "PS_TEXTUREMODES_CUBEMAP", // 0x03 - "PS_TEXTUREMODES_PASSTHRU", // 0x04 - "PS_TEXTUREMODES_CLIPPLANE", // 0x05 - "PS_TEXTUREMODES_BUMPENVMAP", // 0x06 - "PS_TEXTUREMODES_BUMPENVMAP_LUM", // 0x07 - "PS_TEXTUREMODES_BRDF", // 0x08 - "PS_TEXTUREMODES_DOT_ST", // 0x09 - "PS_TEXTUREMODES_DOT_ZW", // 0x0A - "PS_TEXTUREMODES_DOT_RFLCT_DIFF", // 0x0B - "PS_TEXTUREMODES_DOT_RFLCT_SPEC", // 0x0C - "PS_TEXTUREMODES_DOT_STR_3D", // 0x0D - "PS_TEXTUREMODES_DOT_STR_CUBE", // 0x0E - "PS_TEXTUREMODES_DPNDNT_AR", // 0x0F - "PS_TEXTUREMODES_DPNDNT_GB", // 0x10 - "PS_TEXTUREMODES_DOTPRODUCT", // 0x11 - "PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST", // 0x12 - "???", // 0x13 - "???", // 0x14 - "???", // 0x15 - "???", // 0x16 - "???", // 0x17 - "???", // 0x18 - "???", // 0x19 - "???", // 0x1A - "???", // 0x1B - "???", // 0x1C - "???", // 0x1D - "???", // 0x1E - "???", // 0x1F -}; - -// PS DotMapping -char* PS_DotMappingStr[/*PS_DOTMAPPING*/] = -{ - "PS_DOTMAPPING_ZERO_TO_ONE", // 0x00 - "PS_DOTMAPPING_MINUS1_TO_1_D3D", // 0x01 - "PS_DOTMAPPING_MINUS1_TO_1_GL", // 0x02 - "PS_DOTMAPPING_MINUS1_TO_1", // 0x03 - "PS_DOTMAPPING_HILO_1", // 0x04 - "???", // 0x05 - "???", // 0x06 - "PS_DOTMAPPING_HILO_HEMISPHERE", // 0x07 -}; - -#if 1 // array unusable for bitflags -// PS CompareMode -char* PS_CompareModeStr[/*PS_COMPAREMODE*/] = -{ - "PS_COMPAREMODE_S_LT", // 0x00L - "PS_COMPAREMODE_S_GE", // 0x01L - - "PS_COMPAREMODE_T_LT", // 0x00L - "PS_COMPAREMODE_T_GE", // 0x02L - - "???", - - "PS_COMPAREMODE_R_LT", // 0x00L - "PS_COMPAREMODE_R_GE", // 0x04L - - "???", - "???", - "???", - - "PS_COMPAREMODE_Q_LT", // 0x00L - "PS_COMPAREMODE_Q_GE", // 0x08L -}; -#endif - -#if 1 // array unfit for bitflags -// PS CombinerCountFlags -char* PS_CombinerCountFlagsStr[/*PS_COMBINERCOUNTFLAGS*/] = -{ - "PS_COMBINERCOUNT_MUX_LSB", // 0x0000L, // mux on r0.a lsb - "PS_COMBINERCOUNT_MUX_MSB", // 0x0001L, // mux on r0.a msb - - "PS_COMBINERCOUNT_SAME_C0", // 0x0000L, // c0 same in each stage - "PS_COMBINERCOUNT_UNIQUE_C0", // 0x0010L, // c0 unique in each stage - - "PS_COMBINERCOUNT_SAME_C1", // 0x0000L, // c1 same in each stage - "PS_COMBINERCOUNT_UNIQUE_C1", // 0x0100L // c1 unique in each stage -}; -#endif - -// PS InputMapping -std::string PS_InputMappingStr[/*PS_INPUTMAPPING*/] = -{ - "PS_INPUTMAPPING_UNSIGNED_IDENTITY", // 0x00L, // max(0,x) OK for final combiner: y = abs(x) - "PS_INPUTMAPPING_UNSIGNED_INVERT", // 0x20L, // 1 - max(0,x) OK for final combiner: y = 1 - x - "PS_INPUTMAPPING_EXPAND_NORMAL", // 0x40L, // 2*max(0,x) - 1 invalid for final combiner - "PS_INPUTMAPPING_EXPAND_NEGATE", // 0x60L, // 1 - 2*max(0,x) invalid for final combiner - "PS_INPUTMAPPING_HALFBIAS_NORMAL", // 0x80L, // max(0,x) - 1/2 invalid for final combiner - "PS_INPUTMAPPING_HALFBIAS_NEGATE", // 0xa0L, // 1/2 - max(0,x) invalid for final combiner - "PS_INPUTMAPPING_SIGNED_IDENTITY", // 0xc0L, // x invalid for final combiner - "PS_INPUTMAPPING_SIGNED_NEGATE", // 0xe0L, // -x invalid for final combiner -}; - -// PS Register (note, a few have one space, to line up the output a little) -std::string PS_RegisterStr[/*PS_REGISTER*/] = -{ - "PS_REGISTER_ZERO", // 0x00L, // r - "PS_REGISTER_DISCARD", // 0x00L, // w - "PS_REGISTER_C0 ", // 0x01L, // r - "PS_REGISTER_C1 ", // 0x02L, // r - "PS_REGISTER_FOG", // 0x03L, // r - "PS_REGISTER_V0 ", // 0x04L, // r/w - "PS_REGISTER_V1 ", // 0x05L, // r/w - "??", // 0x06 - "??", // 0x07 - "PS_REGISTER_T0 ", // 0x08L, // r/w - "PS_REGISTER_T1 ", // 0x09L, // r/w - "PS_REGISTER_T2 ", // 0x0aL, // r/w - "PS_REGISTER_T3 ", // 0x0bL, // r/w - "PS_REGISTER_R0 ", // 0x0cL, // r/w - "PS_REGISTER_R1 ", // 0x0dL, // r/w - "PS_REGISTER_V1R0_SUM", // 0x0eL, // r - "PS_REGISTER_EF_PROD", // 0x0fL, // r - - "PS_REGISTER_ONE", // PS_REGISTER_ZERO | PS_INPUTMAPPING_UNSIGNED_INVERT, // OK for final combiner - "PS_REGISTER_NEGATIVE_ONE", // PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL, // invalid for final combiner - "PS_REGISTER_ONE_HALF", // PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NEGATE, // invalid for final combiner - "PS_REGISTER_NEGATIVE_ONE_HALF" // PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NORMAL, // invalid for final combiner -}; - -// PS Channel -char* PS_ChannelStr[/*PS_CHANNEL*/] = -{ - "PS_CHANNEL_RGB", // 0x00, // used as RGB source - "PS_CHANNEL_BLUE", // 0x00, // used as ALPHA source - "PS_CHANNEL_ALPHA", // 0x10, // used as RGB or ALPHA source -}; - -// PS FinalCombinerSetting -char* PS_FinalCombinerSettingStr[/*PS_FINALCOMBINERSETTING*/] = -{ - "PS_FINALCOMBINERSETTING_CLAMP_SUM", // 0x80, // V1+R0 sum clamped to [0,1] - "PS_FINALCOMBINERSETTING_COMPLEMENT_V1", // 0x40, // unsigned invert mapping - "PS_FINALCOMBINERSETTING_COMPLEMENT_R0", // 0x20, // unsigned invert mapping -}; - -// PS CombineOutput -char* PS_CombineOutputStr[/*PS_COMBINEROUTPUT*/] = -{ - "PS_COMBINEROUTPUT_IDENTITY", // 0x00L, // y = x - "PS_COMBINEROUTPUT_BIAS", // 0x08L, // y = x - 0.5 - "PS_COMBINEROUTPUT_SHIFTLEFT_1", // 0x10L, // y = x*2 - "PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS", // 0x18L, // y = (x - 0.5)*2 = x*2 - 1.0 - "PS_COMBINEROUTPUT_SHIFTLEFT_2", // 0x20L, // y = x*4 - "PS_COMBINEROUTPUT_SHIFTRIGHT_1", // 0x30L, // y = x/2 = x*0.5 - - "PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA", // 0x80L, // RGB only - - "PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA", // 0x40L, // RGB only - - "PS_COMBINEROUTPUT_AB_MULTIPLY", // 0x00L, - "PS_COMBINEROUTPUT_AB_DOT_PRODUCT", // 0x02L, // RGB only - - "PS_COMBINEROUTPUT_CD_MULTIPLY", // 0x00L, - "PS_COMBINEROUTPUT_CD_DOT_PRODUCT", // 0x01L, // RGB only - - "PS_COMBINEROUTPUT_AB_CD_SUM", // 0x00L, // 3rd output is AB+CD - "PS_COMBINEROUTPUT_AB_CD_MUX", // 0x04L, // 3rd output is MUX(AB,CD) based on R0.a -}; - -// PS GlobalFlags -char* PS_GlobalFlagsStr[/*PS_GLOBALFLAGS*/] = -{ - "PS_GLOBALFLAGS_NO_TEXMODE_ADJUST", // 0x0000L, // don't adjust texture modes - "PS_GLOBALFLAGS_TEXMODE_ADJUST", // 0x0001L, // adjust texture modes according to set texture -}; - -const int CONST_NEG_ONE = -2; -const int CONST_NEG_HALF = -1; -const int CONST_ZERO = 0; -const int CONST_POS_HALF = 1; // Note : Instead of 0.5 we use 1 (so we can keep using integers) -const int CONST_POS_ONE = 2; - -/// - -std::string PSCombinerOutputFlagsToStr(const DWORD dwFlags, bool aIsAlpha = false) -{ - std::string Result = PS_CombineOutputStr[0 + ((dwFlags & 0x38) >> 3)]; - Result = Result + " | " + PS_CombineOutputStr[8 + ((dwFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) >> 1)]; - Result = Result + " | " + PS_CombineOutputStr[10 + ((dwFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) >> 0)]; - Result = Result + " | " + PS_CombineOutputStr[12 + ((dwFlags & PS_COMBINEROUTPUT_AB_CD_MUX) >> 2)]; - - if (!aIsAlpha) { - if (dwFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) - Result = Result + " | " + PS_CombineOutputStr[6]; - - if (dwFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) - Result = Result + " | " + PS_CombineOutputStr[7]; - } - - return Result; -} - -std::string PSFinalCombinerSettingToStr(const DWORD dwPS_FINALCOMBINERSETTING) -{ - std::string Result = ""; - if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_CLAMP_SUM) - Result = Result + " | " + PS_FinalCombinerSettingStr[0]; - - if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_COMPLEMENT_V1) - Result = Result + " | " + PS_FinalCombinerSettingStr[1]; - - if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_COMPLEMENT_R0) - Result = Result + " | " + PS_FinalCombinerSettingStr[2]; - - if (!Result.empty()) - Result.erase(0, 3); - - return Result; -} - -/* PSH_IMD_ARGUMENT */ - -void PSH_IMD_ARGUMENT::SetConstValue(float Value) -{ - Type = PARAM_VALUE; - Address = CONST_ZERO; - Multiplier = Value; - Modifiers = 0; -} - -float PSH_IMD_ARGUMENT::GetConstValue() -{ - if (Type != PARAM_VALUE) { - // Anything other than a value-parameter returns a value never checked for : - return INFINITY; - } - - float Result = Multiplier; - - // y = 1-x -> 0..1 > 1..0 - if ((Modifiers & (1 << ARGMOD_INVERT)) > 0) Result = 1.0f-Result; - - // y = -x -> 0..1 > 0..-1 - if ((Modifiers & (1 << ARGMOD_NEGATE)) > 0) Result = -Result; - - // y = x-0.5 -> 0..1 > -0.5..0.5 - if ((Modifiers & (1 << ARGMOD_BIAS)) > 0) Result = Result-0.5f; - - // y = x*2 -> 0..1 > 0..2 - if ((Modifiers & (1 << ARGMOD_SCALE_X2)) > 0) Result = Result*2.0f; - - // y = (x*2)-1 -> 0..1 > -1..1 - if ((Modifiers & (1 << ARGMOD_SCALE_BX2)) > 0) Result = (Result*2.0f)-1.0f; - - // y = x*4 -> 0..1 > 0..4 - if ((Modifiers & (1 << ARGMOD_SCALE_X4)) > 0) Result = Result*4.0f; - - // y = x/2 -> 0..1 > 0..0.5 - if ((Modifiers & (1 << ARGMOD_SCALE_D2)) > 0) Result = Result/2.0f; - - return Result; -} // GetConstValue - -bool PSH_IMD_ARGUMENT::UsesRegister() -{ - return (Type > PARAM_DISCARD); -} - -bool PSH_IMD_ARGUMENT::IsRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress) -{ - return (Type == aRegType) - && (Address == aAddress); -} - -bool PSH_IMD_ARGUMENT::IsRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress, DWORD aMask) -{ - return IsRegister(aRegType, aAddress) - // Check the mask itself, but also 'mask-less' : - && (((Mask & aMask) == aMask) || (Mask == 0)); -} - -void PSH_IMD_ARGUMENT::SetRegister(PSH_ARGUMENT_TYPE aRegType, int16 aAddress, DWORD aMask) -{ - Type = aRegType; - Address = aAddress; - Mask = aMask; -} - -std::string PSH_IMD_ARGUMENT::ToString() -{ - std::string Result; - - if (Type == PARAM_VALUE) - { - Result = std::to_string(GetConstValue()); - if (Result.find(".") > 0) - Result = Result + 'f'; - - return Result; - } - - Result = PSH_ARGUMENT_TYPE_Str[Type]; - - if (Type >= PARAM_R) - Result = Result + std::to_string(Address); - - if (UsesRegister()) - { - for (DWORD Modifier = ARGMOD_IDENTITY; Modifier < ARGMOD_BLUE_REPLICATE; Modifier++) - if ((1 << Modifier) & Modifiers) { - char buffer[256]; - Result = std::string(buffer, sprintf(buffer, PSH_ARG_MODIFIER_Str[Modifier], Result.c_str())); - } - - if ((Mask > 0) && (Mask != MASK_RGBA)) - { - Result = Result + '.'; - if ((Mask & MASK_R) > 0) Result = Result + 'r'; - if ((Mask & MASK_G) > 0) Result = Result + 'g'; - if ((Mask & MASK_B) > 0) Result = Result + 'b'; - if ((Mask & MASK_A) > 0) Result = Result + 'a'; - } - } - return Result; -} // ToString - -bool PSH_IMD_ARGUMENT::Decode(const DWORD Value, DWORD aMask, TArgumentType ArgumentType) -{ - PS_REGISTER Reg; - PS_INPUTMAPPING InputMapping; - PS_CHANNEL Channel; - - bool Result = true; - Address = 0; - Mask = aMask; - Modifiers = (1 << ARGMOD_IDENTITY); - Multiplier = 1.0; - - // Determine PS_REGISTER for this argument type : - { - Reg = (PS_REGISTER)(Value & 0xF); - if (ArgumentType == atOutput) - { - // Output arguments may not write to C0 or C1, prevent that : - if ((Reg == PS_REGISTER_C0) || (Reg == PS_REGISTER_C1)) - Reg = PS_REGISTER_CXBX_PROD; // unhandled case - will reach "invalid" else-block - } - else - { - // Input arguments (normal or final combiners) can use the extended PS_REGISTER values : - if (Reg == PS_REGISTER_ZERO) - Reg = (PS_REGISTER)(Value & 0xE0); - - // 'Signed Identity' flag on PS_REGISTER_ZERO has no meaning, treat as zero : - if (Reg == PS_REGISTER_CXBX_PROD) - Reg = PS_REGISTER_ZERO; - - // Prevent decoding final combiner registers outside that mode : - if (ArgumentType != atFinalCombiner) - if ((Reg == PS_REGISTER_FOG) || (Reg == PS_REGISTER_V1R0_SUM) || (Reg == PS_REGISTER_EF_PROD)) - Reg = PS_REGISTER_CXBX_PROD; // unhandled case - will reach "invalid" else-block - } - } - - switch (Reg) { - case PS_REGISTER_ZERO: - { - if (ArgumentType == atOutput) - { - // Mark output arguments as 'discard' and return that fact : - Type = PARAM_DISCARD; - Result = false; - } - else - Type = PARAM_VALUE; - - Address = CONST_ZERO; - Multiplier = 0.0f; - break; - } - case PS_REGISTER_C0: - Type = PARAM_C; - break; - case PS_REGISTER_C1: - { - Type = PARAM_C; - Address = 1; - break; - } - case PS_REGISTER_V0: - Type = PARAM_V; - break; - case PS_REGISTER_V1: - { - Type = PARAM_V; - Address = 1; - break; - } - case PS_REGISTER_T0: - Type = PARAM_T; - break; - case PS_REGISTER_T1: - { - Type = PARAM_T; - Address = 1; - break; - } - case PS_REGISTER_T2: - { - Type = PARAM_T; - Address = 2; - break; - } - case PS_REGISTER_T3: - { - Type = PARAM_T; - Address = 3; - break; - } - case PS_REGISTER_R0: - Type = PARAM_R; - break; - case PS_REGISTER_R1: - { - Type = PARAM_R; - Address = 1; - break; - } - // Registers only available when ArgumentType != atOutput (Reg is capped otherwise) : - case PS_REGISTER_ONE: - { - Type = PARAM_VALUE; - Address = CONST_POS_ONE; - Multiplier = 1.0f; - break; - } - case PS_REGISTER_NEGATIVE_ONE: - { - Type = PARAM_VALUE; - Address = CONST_NEG_ONE; - Multiplier = -1.0f; - break; - } - case PS_REGISTER_ONE_HALF: - { - Type = PARAM_VALUE; - Address = CONST_POS_HALF; - Multiplier = 0.5f; - break; - } - case PS_REGISTER_NEGATIVE_ONE_HALF: - { - Type = PARAM_VALUE; - Address = CONST_NEG_HALF; - Multiplier = -0.5f; - break; - } - // Registers only available when ArgumentType == atFinalCombiner (Reg is capped otherwise) : - case PS_REGISTER_FOG: - Type = PARAM_FOG; - break; - case PS_REGISTER_V1R0_SUM: - Type = PARAM_V1R0_SUM; - break; - case PS_REGISTER_EF_PROD: - Type = PARAM_EF_PROD; - break; - default : - DbgPrintf("INVALID ARGUMENT!\n"); - - Result = false; - } - - // We're done if this decoding is meant for output parameters, - // or when the input is a value-parameter (already read above) : - if ((ArgumentType == atOutput) - || (Type == PARAM_VALUE) ) - return Result; - - // Handle the Channel Designator : - { - Channel = (PS_CHANNEL)(Value & PS_CHANNEL_ALPHA); - if (Channel == PS_CHANNEL_ALPHA) - // Input comes from alpha portion of input register (valid for both RGB and alpha portions) : - Mask = MASK_A; - else // = PS_CHANNEL_BLUE (for Alpha step) = PS_CHANNEL_BLUE (for RGB step) : - if (aMask == MASK_A) - // Input comes from b portion of input register (valid for alpha portion only) : - Mask = MASK_B; // Note : This is not the same as ARGMOD_BLUE_REPLICATE! - else - // Input comes from the RGB portion of the input register (valid for RGB portion only) : - Mask = aMask; // Note : Is already put here, but makes this code clearer - } - - InputMapping = (PS_INPUTMAPPING)(Value & 0xe0); - -// ARGMOD_BIAS, -// -// ARGMOD_SCALE_X2, ARGMOD_SCALE_BX2, ARGMOD_SCALE_X4, ARGMOD_SCALE_D2, -// -// ARGMOD_SATURATE, -// -// ARGMOD_ALPHA_REPLICATE, ARGMOD_BLUE_REPLICATE]; - - switch (InputMapping) { - case PS_INPUTMAPPING_UNSIGNED_IDENTITY: - Modifiers = (1 << ARGMOD_IDENTITY); - break; - case PS_INPUTMAPPING_UNSIGNED_INVERT: - Modifiers = (1 << ARGMOD_INVERT); - break; - case PS_INPUTMAPPING_EXPAND_NORMAL: - { - Modifiers = (1 << ARGMOD_SCALE_BX2); - Multiplier = 2.0f * Multiplier; - break; - } - case PS_INPUTMAPPING_EXPAND_NEGATE: - { - Modifiers = (1 << ARGMOD_NEGATE); - Multiplier = -Multiplier; - break; - } - case PS_INPUTMAPPING_HALFBIAS_NORMAL: - Modifiers = (1 << ARGMOD_BIAS); - break; -// case PS_INPUTMAPPING_HALFBIAS_NEGATE: -// Modifiers = ARGMOD_IDENTITY; ??? -// break; - case PS_INPUTMAPPING_SIGNED_IDENTITY: - Modifiers = (1 << ARGMOD_IDENTITY); - break; - case PS_INPUTMAPPING_SIGNED_NEGATE: - { - Modifiers = (1 << ARGMOD_NEGATE); - Multiplier = -Multiplier; - break; - } - } - return Result; -} // Decode - -void PSH_IMD_ARGUMENT::Invert() -{ - if ((Modifiers & (1 << ARGMOD_INVERT)) == 0) - Modifiers = Modifiers | (1 << ARGMOD_INVERT); - else - Modifiers = Modifiers & ~(1 << ARGMOD_INVERT); -} - -void PSH_IMD_ARGUMENT::Negate() -{ - if ((Modifiers & (1 << ARGMOD_NEGATE)) == 0) - Modifiers = Modifiers | (1 << ARGMOD_NEGATE); - else - Modifiers = Modifiers & ~(1 << ARGMOD_NEGATE); -} - -/* PSH_INTERMEDIATE_FORMAT */ - -_PSH_INTERMEDIATE_FORMAT *PSH_INTERMEDIATE_FORMAT::Initialize(const PSH_OPCODE aOpcode) -{ - int i; - - Opcode = aOpcode; - for (i = 0; i < 3; i++) - Output[i].Multiplier = 1.0f; - for (i = 0; i < 7; i++) - Parameters[i].Multiplier = 1.0f; - - return this; -} - -std::string PSH_INTERMEDIATE_FORMAT::ToString() -{ - std::string Result = {}; - int i; - char SeparatorChar; - - switch (Opcode) { - case PO_COMMENT: - { - Result = "; " + CommentString; - return Result; - } - case PO_PS: { - // 1.1 allows reading from 2 textures (which we use in 'cnd') and reading from the .b (blue) channel - // 1.3 allows the use of texm3x2depth (which can occur sometimes) - // 2.0 allows up to r12, c32, t8 and s16 (requires Direct3D9) - // 3.0 allows up to r32, c224, v10 (instead of t via dcl), s16 and vFace (which can do two-sided lighting) - - // Use supplied pixel shader version (if any is given) - DWORD PSVersion = Parameters[6].Mask; - - // From 2.0 onward, use underscore separators (is this correct?) - SeparatorChar = (PSVersion >= D3DPS_VERSION(2, 0)) ? '_' : '.'; - Result = "ps"; - Result = Result + SeparatorChar + std::to_string(D3DSHADER_VERSION_MAJOR(PSVersion)); - Result = Result + SeparatorChar + std::to_string(D3DSHADER_VERSION_MINOR(PSVersion)); - return Result; - } - case PO_XPS: { - Result = "xps.1.1"; - return Result; - } - } - - if (IsCombined) - Result = "+"; - else - Result = ""; - - Result = Result + PSH_OPCODE_DEFS[Opcode].mn + PSH_INST_MODIFIER_Str[Modifier]; - - // Output a comma-separated list of output registers : - SeparatorChar = ' '; - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) - { - Result = Result + SeparatorChar + Output[i].ToString(); - SeparatorChar = ','; - } - - // If this opcode has both output and input, put a space between them : - if ((PSH_OPCODE_DEFS[Opcode]._Out > 0) && (PSH_OPCODE_DEFS[Opcode]._In > 0)) - { - Result = Result + ","; - SeparatorChar = ' '; - } - - // Output a comma-separated list of parameters : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) - { - Result = Result + SeparatorChar + Parameters[i].ToString(); - SeparatorChar = ','; - } - - if ((!CommentString.empty()) - || (PSH_OPCODE_DEFS[Opcode].note != "")) - Result = Result + " ; " + PSH_OPCODE_DEFS[Opcode].note + " " + CommentString; - - return Result; -} // ToString - -bool PSH_INTERMEDIATE_FORMAT::IsArithmetic() -{ - return (Opcode >= PO_ADD); -} - -void PSH_INTERMEDIATE_FORMAT::ScaleOutput(float aFactor) -{ - assert(aFactor > 0.0f); - - if (aFactor == 1.0f) - return; - - if (aFactor == 0.5f) - { - // Half the output modifier : - switch (Modifier) { - case INSMOD_X4: - Modifier = INSMOD_X2; - break; - case INSMOD_X2: - Modifier = INSMOD_NONE; - break; - case INSMOD_NONE: - Modifier = INSMOD_D2; - break; - } - - return; - } - - if (aFactor == 2.0f) - { - // Double the output modifier : - switch (Modifier) { - case INSMOD_D2: - Modifier = INSMOD_NONE; - break; - case INSMOD_NONE: - Modifier = INSMOD_X2; - break; - case INSMOD_X2: - Modifier = INSMOD_X4; - break; - } - - return; - } -} - -bool PSH_INTERMEDIATE_FORMAT::ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress) // overload; -{ - int i; - bool Result; - - // Check all parameters : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) - { - // Check if one of them reads from the given register : - Result = Parameters[i].IsRegister(aRegType, aAddress); - if (Result) - return true; - } - - return false; -} - -bool PSH_INTERMEDIATE_FORMAT::ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask) // overload; -{ - int i; - bool Result; - - // Check all parameters : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) - { - // Check if one of them reads from the given register : - Result = Parameters[i].IsRegister(aRegType, aAddress, aMask); - if (Result) - return true; - } - - return false; -} - -bool PSH_INTERMEDIATE_FORMAT::WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress) // overload; -{ - int i; - bool Result; - - // Check the output : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) - { - // Check if one of them writes to the given register : - Result = Output[i].IsRegister(aRegType, aAddress); - if (Result) - return true; - } - - return false; -} - -bool PSH_INTERMEDIATE_FORMAT::WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask) // overload; -{ - int i; - bool Result; - - // Check the output : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) - { - // Check if one of them writes to the given register : - Result = Output[i].IsRegister(aRegType, aAddress, aMask); - if (Result) - return true; - } - - return false; -} - -void PSH_INTERMEDIATE_FORMAT::SwapParameter(const int Index1, const int Index2) -// Swaps two parameters. -{ - PSH_IMD_ARGUMENT TmpParameters; - - TmpParameters = Parameters[Index1]; - Parameters[Index1] = Parameters[Index2]; - Parameters[Index2] = TmpParameters; -} - -void PSH_INTERMEDIATE_FORMAT::XSwapOutput() -// Swaps the two outputs, along with their arguments. Applies only to Xbox opcodes. -{ - PSH_IMD_ARGUMENT TmpOutput; - - // Swap output 0 with 1 : - TmpOutput = Output[0]; - Output[0] = Output[1]; - Output[1] = TmpOutput; - - // Swap parameters 0 with 2 and 1 with 3 : - SwapParameter(0, 2); - SwapParameter(1, 3); -} - -bool PSH_INTERMEDIATE_FORMAT::MoveRemovableParametersRight(const int Index1, const int Index2) -// Swaps discarded (and const) parameters to the right position, to ease later conversions. -{ - bool Result = false; - - if ( (!Parameters[Index1].UsesRegister()) - && (Parameters[Index2].UsesRegister())) - { - SwapParameter(Index1, Index2); - Result = true; - } - return Result; -} - -bool PSH_INTERMEDIATE_FORMAT::XMoveNonRegisterOutputsRight() -// Swap discards and constants to the right position, to ease later conversions. Applies only to Xbox opcodes. -{ - bool Result = false; - - // First, check if the left output is discarded, while the second isn't : - if ( (!Output[0].UsesRegister()) - && (Output[1].UsesRegister())) - { - // Swap the outputs, so the discarded version is positioned rightmost : - XSwapOutput(); - Result = true; - } - - // Also try to swap the parameters to the first operation : - if (MoveRemovableParametersRight(0, 1)) - Result = true; - - // Idem for the parameters to second operation : - if (MoveRemovableParametersRight(2, 3)) - Result = true; - return Result; -} - -void PSH_INTERMEDIATE_FORMAT::XCopySecondOpcodeToFirst(const PSH_OPCODE aOpcode) -// Copies second opcode to first position, changing the opcode type on the fly. -{ - Opcode = aOpcode; - Output[0] = Output[1]; - Parameters[0] = Parameters[2]; - Parameters[1] = Parameters[3]; -} - -bool PSH_INTERMEDIATE_FORMAT::Decode(DWORD aCombinerStageNr, DWORD PSInputs, DWORD PSOutputs, DWORD aMask) -{ - DWORD CombinerOutputFlags; - int i; - - bool Result = false; - CombinerStageNr = aCombinerStageNr; - IsCombined = aMask == MASK_A; - - // Decode first two outputs : - if (Output[0].Decode((PSOutputs >> 4) & 0xF, aMask, atOutput)) - Result = true; - if (Output[1].Decode((PSOutputs >> 0) & 0xF, aMask, atOutput)) - Result = true; - - // Get the combiner output flags : - CombinerOutputFlags = (PS_COMBINEROUTPUT)(PSOutputs >> 12); - - // Use that to choose between the four possible operations : - // - xdd (dot/dot/discard) > calculating AB=A.B and CD=C.D - // - xdm (dot/mul/discard) > calculating AB=A.B and CD=C*D - // - xmmc (mul/mul/mux) > calculating AB=A*B and CD=C*D and Mux=AB?CD - // - xmma (mul/mul/sum) > calculating AB=A*B and CD=C*D and Sum=AB+CD - if ((CombinerOutputFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct - { - if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct - Opcode = PO_XDD; - else - Opcode = PO_XDM; - - // Note : All arguments are already in-place for these two opcodes. - - // No 3rd output; Assert that (PSOutputs >> 8) & 0xF == PS_REGISTER_DISCARD ? - } - else - if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct - { - // The first operation is a multiply, but the second is a dot-product; - // There's no opcode for that, but we can reverse the two and still use XDM : - Opcode = PO_XDM; - XSwapOutput(); - - // No 3rd output; Assert that (PSOutputs >> 8) & 0xF == PS_REGISTER_DISCARD ? - } - else - { - if (/*AB_CD_SUM=*/(CombinerOutputFlags & PS_COMBINEROUTPUT_AB_CD_MUX) == 0) // true=AB+CD, false=MUX(AB,CD) based on R0.a - Opcode = PO_XMMA; - else - Opcode = PO_XMMC; - - // This has a 3rd output, set that already : - if (Output[2].Decode((PSOutputs >> 8) & 0xF, aMask, atOutput)) - Result = true; - } - - if (Result) - { - // Handle the Output Mapping : - switch (CombinerOutputFlags & 0x38) { - case PS_COMBINEROUTPUT_BIAS: Modifier = INSMOD_BIAS; break; // TODO : Fixup occurrances! - case PS_COMBINEROUTPUT_SHIFTLEFT_1: Modifier = INSMOD_X2; break; - case PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS: Modifier = INSMOD_BX2; break; // TODO : Fixup occurrances! - case PS_COMBINEROUTPUT_SHIFTLEFT_2: Modifier = INSMOD_X4; break; - case PS_COMBINEROUTPUT_SHIFTRIGHT_1: Modifier = INSMOD_D2; break; - default /*PS_COMBINEROUTPUT_IDENTITY*/: Modifier = INSMOD_NONE; break; - } - - if ((CombinerOutputFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) > 0) // false=Alpha-to-Alpha, true=Blue-to-Alpha - { - // Note : The effect of this flag is not entirely clear - blue to alpha itself is an easy to understand operation, - // but on what output does it operate? AB? or the mux_sum destination register (which doesn't occur when a dot - // operation is executed)? What if AB is discarded, but AB+CD is registered? Also, what happens to the other - // color channels (R,G and A) in that register? The docs seem to imply that AB itself is not changed (as they - // state that the alpha portion is not necessarily discarded), which would mean that only the mux_sum output - // is influenced, but that would imply that this flag has no effect for dot-products (XDD or XDM)... - // And if this is true, how do the blue-to-alpha flags behave if present on both AB and CD? - - // TODO : Rayman does this in some shaders, requires a fixup (as output.b is incorrect and not allowed) - Output[0].Modifiers = Output[0].Modifiers | (1 << ARGMOD_BLUE_REPLICATE); - Output[0].Mask = MASK_B; - // TODO Handle blue-to-alpha flag (only valid for RGB) - // Note : We can't use the '+ ' prefix, as the blue channel is not determined yet! - // Note 2: Pixel shader 1.1-1.3 'blue replicate' on source, uses an alpha destination write mask. - } - - if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) > 0) // false=Alpha-to-Alpha, true=Blue-to-Alpha - { - Output[1].Modifiers = Output[1].Modifiers | (1 << ARGMOD_BLUE_REPLICATE); - Output[1].Mask = MASK_B; - } - - // Decode all four inputs : - for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) - Parameters[i].Decode((PSInputs >> ((3-i) * 8)) & 0xFF, aMask, atInput); - } - return Result; -} // Decode - -bool PSH_INTERMEDIATE_FORMAT::DecodeFinalCombiner(DWORD aPSFinalCombinerInputsABCD, DWORD aPSFinalCombinerInputsEFG) -{ - int i; -// Note : The sign bit is lost upon input to the final combiner! - -// The final combiner performs the following operations : -// -// prod register = E*F // PS_REGISTER_EF_PROD, useable in A,B,C,D,G -// -// rgbout = A*B + (1-A)*C + D // lrp tmp.rgb, A, B, C // Note : tmp can be r0 if [A,B,C,D] * r0 = [] -// // add r0.rgb, tmp.rgb, D.rgb // Otherwise use a writable register from A;B or C -// -// alphaout = G.a // mov r0.a, G.a // Not necessary if G = r0 -// -// (also the final combiner can read PS_REGISTER_V1R0_SUM, which is equal to v1 + r0) -// Normal optimizations apply, like when A = PS_REGISTER_ZERO, all we have left is C + D (add r0.rgb, C.rgb, D.rgb) -// Also, if D = PS_REGISTER_ZERO, the add can be changed into a mov (if the result isn't already in r0.rgb) - - // Note : Previously, XSokoban lost it's font rendering when the final combiner was emitted, - // when disabled, the font reappeared (in various colors). This was because constants where - // not properly set locally. - - Opcode = PO_XFC; - CombinerStageNr = XFC_COMBINERSTAGENR; - - // Decode A,B,C and D : - for (i = 0; i < 4; i++) - Parameters[i].Decode((aPSFinalCombinerInputsABCD >> ((3-i) * 8)) & 0xFF, MASK_RGB/*?*/, atFinalCombiner); - - // Decode E,F and G : - for (i = 0; i < 3; i++) - Parameters[4+i].Decode((aPSFinalCombinerInputsEFG >> ((3-i) * 8)) & 0xFF, MASK_RGB/*?*/, atFinalCombiner); - - return true; -} - -/* PSH_XBOX_SHADER */ - -void PSH_XBOX_SHADER::SetPSVersion(const uint32 PSVersion) -{ - m_PSVersion = PSVersion; - - // Source : https://en.wikipedia.org/wiki/High-Level_Shading_Language#Pixel_shader_comparison - if (m_PSVersion >= D3DPS_VERSION(4, 0)) { - MaxInputColorRegisters = 32; - MaxTemporaryRegisters = 4096; - MaxConstantFloatRegisters = 16*4096; - MaxSamplerRegisters = 16; - MaxTextureCoordinateRegisters = 0; // In shader model 4 and up, Dependent texture limit (T) is unlimited - // Note : Input Registers (v#) are now fully floating point and the Texture Coordinate Registers (t#) have been consolidated into it. - - PSH_PC_MAX_REGISTER_COUNT = 16 * 4096; - } - else if (m_PSVersion >= D3DPS_VERSION(3, 0)) { - // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172920(v=vs.85).aspx - MaxInputColorRegisters = 10; - MaxTemporaryRegisters = 32; - MaxConstantFloatRegisters = 224; - MaxSamplerRegisters = 16; - MaxTextureCoordinateRegisters = 0; // In shader model 3 and up, Dependent texture limit (T) is unlimited - - PSH_PC_MAX_REGISTER_COUNT = 224; - } - else if (m_PSVersion >= D3DPS_VERSION(2, 0)) { - // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172918(v=vs.85).aspx - MaxInputColorRegisters = 2; - MaxTemporaryRegisters = 12; // 12 min/32 max: The number of r# registers is determined by D3DPSHADERCAPS2_0.NumTemps (which ranges from 12 to 32). - MaxConstantFloatRegisters = 32; - MaxSamplerRegisters = 16; - MaxTextureCoordinateRegisters = 8; - - PSH_PC_MAX_REGISTER_COUNT = 32; - } - else if (m_PSVersion >= D3DPS_VERSION(1, 4)) { - // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172917(v=vs.85).aspx - MaxConstantFloatRegisters = 8; - MaxTemporaryRegisters = 6; - MaxTextureCoordinateRegisters = 4; - MaxInputColorRegisters = 2; // 2 in phase 2 - MaxSamplerRegisters = 0; // Not yet in shader model 1 - - PSH_PC_MAX_REGISTER_COUNT = 8; - } - else if (m_PSVersion >= D3DPS_VERSION(1, 3)) { - MaxConstantFloatRegisters = 8; - MaxTemporaryRegisters = 2; - MaxTextureCoordinateRegisters = 4; - MaxInputColorRegisters = 2; - MaxSamplerRegisters = 0; // Not yet in shader model 1 - - PSH_PC_MAX_REGISTER_COUNT = 8; - } - else if (m_PSVersion >= D3DPS_VERSION(1, 2)) { - MaxConstantFloatRegisters = 8; - MaxTemporaryRegisters = 2; - MaxTextureCoordinateRegisters = 4; - MaxInputColorRegisters = 2; - MaxSamplerRegisters = 0; // Not yet in shader model 1 - - PSH_PC_MAX_REGISTER_COUNT = 8; - } - else { - // m_PSVersion >= D3DPS_VERSION(1, 1) - MaxConstantFloatRegisters = 8; - MaxTemporaryRegisters = 2; - MaxTextureCoordinateRegisters = 4; // Some sources say 2? - MaxInputColorRegisters = 2; - MaxSamplerRegisters = 0; // Not yet in shader model 1 - - PSH_PC_MAX_REGISTER_COUNT = 8; - } -} - -std::string PSH_XBOX_SHADER::ToString() -{ - std::string Result; - int i; - - for (i = 0; i < IntermediateCount; i++) - Result = Result + Intermediate[i].ToString() + "\n"; - - return Result; -} - -void PSH_XBOX_SHADER::Log(const char *PhaseStr) -{ - //if (MayLog(lfUnit)) - { - DbgPrintf("New decoding - %s :\n", PhaseStr); - DbgPrintf("%s\n", ToString().c_str()); - } -} - -PPSH_INTERMEDIATE_FORMAT PSH_XBOX_SHADER::NewIntermediate() -{ - PPSH_INTERMEDIATE_FORMAT Result = &Intermediate[IntermediateCount]; - Result->Initialize(PO_COMMENT); - ++IntermediateCount; - return Result; -} - -void PSH_XBOX_SHADER::InsertIntermediate(PPSH_INTERMEDIATE_FORMAT pIntermediate, int Index) -{ - int i; - i = IntermediateCount - 1; - while (i >= Index) - { - Intermediate[i + 1] = Intermediate[i]; - --i; - } - - Intermediate[Index] = *pIntermediate; - ++IntermediateCount; -} - -void PSH_XBOX_SHADER::DeleteIntermediate(int Index) -{ - int i; - for (i = Index; i < IntermediateCount - 1; i++) - Intermediate[i] = Intermediate[i + 1]; - - --IntermediateCount; -} - -void PSH_XBOX_SHADER::DeleteLastIntermediate() -{ - if (IntermediateCount > 0) - DeleteIntermediate(IntermediateCount - 1); -} - -std::string PSH_XBOX_SHADER::OriginalToString(XTL::X_D3DPIXELSHADERDEF *pPSDef) // static -{ - char buffer[4096]; - return std::string(buffer, sprintf(buffer, "PSAphaInputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSFinalCombinerInputsABCD = 0x%.08X\n" - "PSFinalCombinerInputsEFG = 0x%.08X\n" - "PSConstant0[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSConstant1[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSAlphaOutputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSRGBInputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSCompareMode = 0x%.08X\n" - "PSFinalCombinerConstant0 = 0x%.08X\n" - "PSFinalCombinerConstant1 = 0x%.08X\n" - "PSRGBOutputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" - "PSCombinerCount = 0x%.08X\n" - "PSTextureModes = 0x%.08X\n" - "PSDotMapping = 0x%.08X\n" - "PSInputTexture = 0x%.08X\n" - "PSC0Mapping = 0x%.08X\n" - "PSC1Mapping = 0x%.08X\n" - "PSFinalCombinerConstants = 0x%.08X\n", - pPSDef->PSAlphaInputs[0], pPSDef->PSAlphaInputs[1], pPSDef->PSAlphaInputs[2], pPSDef->PSAlphaInputs[3], - pPSDef->PSAlphaInputs[4], pPSDef->PSAlphaInputs[5], pPSDef->PSAlphaInputs[6], pPSDef->PSAlphaInputs[7], - pPSDef->PSFinalCombinerInputsABCD, - pPSDef->PSFinalCombinerInputsEFG, - pPSDef->PSConstant0[0], pPSDef->PSConstant0[1], pPSDef->PSConstant0[2], pPSDef->PSConstant0[3], - pPSDef->PSConstant0[4], pPSDef->PSConstant0[5], pPSDef->PSConstant0[6], pPSDef->PSConstant0[7], - pPSDef->PSConstant1[0], pPSDef->PSConstant1[1], pPSDef->PSConstant1[2], pPSDef->PSConstant1[3], - pPSDef->PSConstant1[4], pPSDef->PSConstant1[5], pPSDef->PSConstant1[6], pPSDef->PSConstant1[7], - pPSDef->PSAlphaOutputs[0], pPSDef->PSAlphaOutputs[1], pPSDef->PSAlphaOutputs[2], pPSDef->PSAlphaOutputs[3], - pPSDef->PSAlphaOutputs[4], pPSDef->PSAlphaOutputs[5], pPSDef->PSAlphaOutputs[6], pPSDef->PSAlphaOutputs[7], - pPSDef->PSRGBInputs[0], pPSDef->PSRGBInputs[1], pPSDef->PSRGBInputs[2], pPSDef->PSRGBInputs[3], - pPSDef->PSRGBInputs[4], pPSDef->PSRGBInputs[5], pPSDef->PSRGBInputs[6], pPSDef->PSRGBInputs[7], - pPSDef->PSCompareMode, - pPSDef->PSFinalCombinerConstant0, - pPSDef->PSFinalCombinerConstant1, - pPSDef->PSRGBOutputs[0], pPSDef->PSRGBOutputs[1], pPSDef->PSRGBOutputs[2], pPSDef->PSRGBOutputs[3], - pPSDef->PSRGBOutputs[4], pPSDef->PSRGBOutputs[5], pPSDef->PSRGBOutputs[6], pPSDef->PSRGBOutputs[7], - pPSDef->PSCombinerCount, - XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES], /* pPSDef->PSTextureModes is stored in a different place than pPSDef*/ - pPSDef->PSDotMapping, - pPSDef->PSInputTexture, - pPSDef->PSC0Mapping, - pPSDef->PSC1Mapping, - pPSDef->PSFinalCombinerConstants)); -} - -PSH_RECOMPILED_SHADER PSH_XBOX_SHADER::Decode(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ - int i; - PSH_RECOMPILED_SHADER Result = {}; - Result.PSDef = *pPSDef; - - /* Azurik likes to create and destroy the same shader every frame! O_o - LogFlags = lfUnit; - if (IsRunning(TITLEID_AZURIK)) - LogFlags = LogFlags | lfExtreme;*/ - - for (i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) - { - PSTextureModes[i] = (PS_TEXTUREMODES)((XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES] >> (i*5)) & 0x1F); - PSCompareMode[i] = (pPSDef->PSCompareMode >> (i*4)) & 0xF; - } - - PSDotMapping[0] = (PS_DOTMAPPING)(0); - PSDotMapping[1] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 0) & 0x7); - PSDotMapping[2] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 4) & 0x7); - PSDotMapping[3] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 8) & 0x7); - - PSInputTexture[0] = -1; // Stage 0 has no predecessors - PSInputTexture[1] = 0; // Stage 1 can only use stage 0 - PSInputTexture[2] = (pPSDef->PSInputTexture >> 16) & 0x1; // Stage 2 can use stage 0 or 1 - PSInputTexture[3] = (pPSDef->PSInputTexture >> 20) & 0x3; // Stage 3 can only use stage 0, 1 or 2 - - NumberOfCombiners = (pPSDef->PSCombinerCount >> 0) & 0xF; - CombinerCountFlags = (pPSDef->PSCombinerCount >> 8); - - CombinerMuxesOnMsb = (CombinerCountFlags & PS_COMBINERCOUNT_MUX_MSB) > 0; - CombinerHasUniqueC0 = (CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C0) > 0; - CombinerHasUniqueC1 = (CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C1) > 0; - - // Backwards compatible decoding (purely for logging) : - { - for (i = 0; i < XTL::X_PSH_COMBINECOUNT; i++) - { - Combiners[i].RGB.Decode(pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i]); - Combiners[i].Alpha.Decode(pPSDef->PSAlphaInputs[i], pPSDef->PSAlphaOutputs[i], /*aIsAlpha=*/true); - } - - FinalCombiner.Decode(pPSDef->PSFinalCombinerInputsABCD, pPSDef->PSFinalCombinerInputsEFG, pPSDef->PSFinalCombinerConstants); - } - - // Use a fluent interface to start with a pixel shader version opcode that knowns the host version - NewIntermediate()->Initialize(PO_XPS)->Parameters[6].Mask = m_PSVersion; - - for (i = 0; i < NumberOfCombiners; i++) - { - // Check that the RGB and Alpha inputs do the same operation : - if ( ((pPSDef->PSRGBInputs[i] & PS_NoChannelsMask) == (pPSDef->PSAlphaInputs[i] & PS_NoChannelsMask)) - // Check if all RGB channels are set to read from PS_CHANNEL_RGB : - && ((pPSDef->PSRGBInputs[i] & PS_AlphaChannelsMask) == 0) - // Check if all Alpha channels are set to read from PS_CHANNEL_ALPHA : - && ((pPSDef->PSAlphaInputs[i] & PS_AlphaChannelsMask) == PS_AlphaChannelsMask) - // Check that RGB and Alpha output to the same register(s) : - && (pPSDef->PSRGBOutputs[i] == pPSDef->PSAlphaOutputs[i])) - { - // In this case, we can convert RGB and Alpha together : - if (!NewIntermediate()->Decode(i, pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i], MASK_RGBA)) - DeleteLastIntermediate(); - } - else - { - // Otherwise, we need to convert RGB and Alpha separately : - if (!NewIntermediate()->Decode(i, pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i], MASK_RGB)) - DeleteLastIntermediate(); - - if (!NewIntermediate()->Decode(i, pPSDef->PSAlphaInputs[i], pPSDef->PSAlphaOutputs[i], MASK_A)) - DeleteLastIntermediate(); - } - } - - if ((pPSDef->PSFinalCombinerInputsABCD > 0) - || (pPSDef->PSFinalCombinerInputsEFG > 0)) { - if (NewIntermediate()->DecodeFinalCombiner(pPSDef->PSFinalCombinerInputsABCD, pPSDef->PSFinalCombinerInputsEFG)) - { - FinalCombinerFlags = (PS_FINALCOMBINERSETTING)((pPSDef->PSFinalCombinerInputsEFG >> 0) & 0xFF); -// dwPS_GLOBALFLAGS = (pPSDef->PSFinalCombinerConstants >> 8) & 0x1; - } - else - DeleteLastIntermediate(); - } - // Dump the contents of the PixelShader def - //if (MayLog(LogFlags)) - // dump pixel shader definition to string - // TODO : Reinstate : XTL_DumpPixelShaderToFile(pPSDef); - - //if (MayLog(LogFlags)) - { - // print relevant contents to the debug console - DbgPrintf("%s\n", DecodedToString(pPSDef).c_str()); - } - - // TODO: - // - Insert tex* and def instructions - - Log("Parse result"); - - if (MoveRemovableParametersRight()) - Log("MoveRemovableParametersRight"); - - if (RemoveNops()) - Log("RemoveNops"); - - while (RemoveUselessWrites()) { - Log("RemoveUselessWrites"); - if (RemoveNops()) - Log("RemoveNops"); - } - - if (ConvertConstantsToNative(pPSDef, /*Recompiled=*/&Result)) - Log("ConvertConstantsToNative"); - - ConvertXboxOpcodesToNative(pPSDef); - Log("ConvertXboxOpcodesToNative"); - - while (RemoveUselessWrites()) { // again - Log("RemoveUselessWrites"); - if (RemoveNops()) - Log("RemoveNops"); - } - - // Resolve all differences : - if (FixupPixelShader()) - Log("FixupPixelShader"); - - // Handle Texture declarations : - if (DecodeTextureModes(pPSDef)) - Log("DecodeTextureModes"); - - if (FixInvalidSrcSwizzle()) - Log("FixInvalidSrcSwizzle"); - - if (FixMissingR0a()) - Log("FixMissingR0a"); - - if (FixMissingR1a()) - Log("FixMissingR1a"); - - if (FixCoIssuedOpcodes()) - Log("FixCoIssuedOpcodes"); - - Log("End result"); - - Result.NewShaderStr = ToString(); - return Result; -} - -std::string PSH_XBOX_SHADER::DecodedToString(XTL::X_D3DPIXELSHADERDEF *pPSDef) -// print relevant contents to the debug console - - #define _AddStr1(aStr) \ - \ - Result = Result + aStr + "\n"; - - #define _AddStr(aStr, ...) \ - {\ - _AddStr1(std::string(buf, sprintf(buf, aStr, __VA_ARGS__))); \ - } -{ - char buf[256]; - int i; - - std::string Result = ""; - // Show the contents to the user - _AddStr1("\n-----PixelShader Definition Contents-----"); - _AddStr1(OriginalToString(pPSDef)); - - if (XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES] > 0) - { - _AddStr1("\nPSTextureModes ->"); // Texture addressing modes - _AddStr("Stage 0: %s", PS_TextureModesStr[PSTextureModes[0]]); - _AddStr("Stage 1: %s", PS_TextureModesStr[PSTextureModes[1]]); - _AddStr("Stage 2: %s", PS_TextureModesStr[PSTextureModes[2]]); - _AddStr("Stage 3: %s", PS_TextureModesStr[PSTextureModes[3]]); - } - - if (pPSDef->PSDotMapping > 0) // Input mapping for dot product modes - { - _AddStr1("\nPSDotMapping ->"); - _AddStr("Stage 1: %s", PS_DotMappingStr[PSDotMapping[1]]); - _AddStr("Stage 2: %s", PS_DotMappingStr[PSDotMapping[2]]); - _AddStr("Stage 3: %s", PS_DotMappingStr[PSDotMapping[3]]); - } - - if (pPSDef->PSCompareMode > 0) // Compare modes for clipplane texture mode - { - _AddStr1("\nPSCompareMode ->"); - _AddStr("Stage 0: %s", PS_CompareModeStr[(PSCompareMode[0] == 0) ? 0 : 1]); - _AddStr("Stage 1: %s", PS_CompareModeStr[(PSCompareMode[1] == 0) ? 2 : 3]); - _AddStr("Stage 2: %s", PS_CompareModeStr[(PSCompareMode[2] == 0) ? 4 : 5]); - _AddStr("Stage 3: %s", PS_CompareModeStr[(PSCompareMode[3] == 0) ? 6 : 7]); - } - - if (pPSDef->PSInputTexture > 0) // Texture source for some texture modes - { - _AddStr1("\nPSInputTexture ->"); - _AddStr("Stage 1: %d", PSInputTexture[1]); - _AddStr("Stage 2: %d", PSInputTexture[2]); - _AddStr("Stage 3: %d", PSInputTexture[3]); - } - - if (pPSDef->PSCombinerCount > 0) // Active combiner count (Stages 0-7) - { - _AddStr1("\nPSCombinerCount ->"); - _AddStr("Combiners: %d", NumberOfCombiners); - _AddStr("Mux: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_MUX_MSB) == 0 ? 0 : 1]); - _AddStr("C0: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C0) == 0 ? 2 : 3]); - _AddStr("C1: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C1) == 0 ? 4 : 5]); - } - - // Dxbx additions from here onwards : - - for (i = 0; i < NumberOfCombiners; i++) // Loop over all combiner stages - { - _AddStr1("\n"); - - _AddStr("PSRGBOutputs[%d] AB: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.DecodedToString().c_str()); - _AddStr("PSRGBOutputs[%d] CD: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.DecodedToString().c_str()); - _AddStr("PSRGBOutputs[%d] SUM: %s", i, Combiners[i].RGB.OutputSUM.DecodedToString().c_str()); - _AddStr("PSRGBOutputs[%d] flags: %s", i, PSCombinerOutputFlagsToStr(Combiners[i].RGB.CombinerOutputFlags, /*aIsAlpha=*/false).c_str()); - - _AddStr1("\n"); - _AddStr("PSRGBInputs[%d] A: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.Input1.DecodedToString().c_str()); - _AddStr("PSRGBInputs[%d] B: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.Input2.DecodedToString().c_str()); - _AddStr("PSRGBInputs[%d] C: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.Input1.DecodedToString().c_str()); - _AddStr("PSRGBInputs[%d] D: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.Input2.DecodedToString().c_str()); - - _AddStr1("\n"); - _AddStr("PSAlphaOutputs[%d] AB: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.DecodedToString().c_str()); - _AddStr("PSAlphaOutputs[%d] CD: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.DecodedToString().c_str()); - _AddStr("PSAlphaOutputs[%d] SUM: %s", i, Combiners[i].Alpha.OutputSUM.DecodedToString().c_str()); - _AddStr("PSAlphaOutputs[%d] flags: %s", i, PSCombinerOutputFlagsToStr(Combiners[i].Alpha.CombinerOutputFlags, /*aIsAlpha=*/true).c_str()); - - _AddStr1("\n"); - _AddStr("PSAlphaInputs[%d] A: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.Input1.DecodedToString().c_str()); - _AddStr("PSAlphaInputs[%d] B: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.Input2.DecodedToString().c_str()); - _AddStr("PSAlphaInputs[%d] C: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.Input1.DecodedToString().c_str()); - _AddStr("PSAlphaInputs[%d] D: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.Input2.DecodedToString().c_str()); - - _AddStr1("\n"); - _AddStr("PSConstant0[%d] : %x", i, pPSDef->PSConstant0[i]); // C0 for each stage - _AddStr("PSConstant1[%d] : %x", i, pPSDef->PSConstant1[i]); // C1 for each stage - } - - if ((pPSDef->PSFinalCombinerInputsABCD > 0) - || (pPSDef->PSFinalCombinerInputsEFG > 0)) // Final combiner inputs - { - _AddStr("\nPSFinalCombinerConstant0 : %x", pPSDef->PSFinalCombinerConstant0); // C0 in final combiner - _AddStr("PSFinalCombinerConstant1 : %x", pPSDef->PSFinalCombinerConstant1); // C1 in final combiner - - _AddStr1("\nPSFinalCombinerInputsABCD ->"); - _AddStr("Input A: %s", FinalCombiner.InputA.DecodedToString().c_str()); - _AddStr("Input B: %s", FinalCombiner.InputB.DecodedToString().c_str()); - _AddStr("Input C: %s", FinalCombiner.InputC.DecodedToString().c_str()); - _AddStr("Input D: %s", FinalCombiner.InputD.DecodedToString().c_str()); - - _AddStr1("\nPSFinalCombinerInputsEFG ->"); - _AddStr("Input E: %s", FinalCombiner.InputE.DecodedToString().c_str()); - _AddStr("Input F: %s", FinalCombiner.InputF.DecodedToString().c_str()); - _AddStr("Input G: %s", FinalCombiner.InputG.DecodedToString().c_str()); - _AddStr("Final combiner setting: %s", PSFinalCombinerSettingToStr((DWORD)(FinalCombiner.FinalCombinerFlags)).c_str()); - - _AddStr1("\nPSFinalCombinerConstants ->"); // Final combiner constant mapping - _AddStr("Offset of D3D constant for (C0: %d", FinalCombiner.FinalCombinerC0Mapping); - _AddStr("Offset of D3D constant for (C1: %d", FinalCombiner.FinalCombinerC1Mapping); - _AddStr("Adjust texture flag: %s", PS_GlobalFlagsStr[PS_GLOBALFLAGS(FinalCombiner.dwPS_GLOBALFLAGS)]); - } - - _AddStr1("\n"); - return Result; -} - - bool _OpcodeMustStayBeforeTextureMode(PSH_OPCODE Opcode, int i) - { - // Before texture modes, only keep the first comment (the one mentioning "xps" got converted into "ps") - if (Opcode == PO_COMMENT) - return (i == 0); - - if (Opcode == PO_PS) - return true; - - if (Opcode == PO_DEF) - return true; - - return false; - } - - bool PSH_XBOX_SHADER::_NextIs2D(int Stage) - { - if (Stage < XTL::X_D3DTS_STAGECOUNT-1) - return (PSTextureModes[Stage + 1] == PS_TEXTUREMODES_DOT_ST) || (PSTextureModes[Stage + 1] == PS_TEXTUREMODES_DOT_ZW); - else - return false; - } - -bool PSH_XBOX_SHADER::DecodeTextureModes(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ - int InsertPos; - PSH_INTERMEDIATE_FORMAT Ins = {}; - int Stage; - - bool Result = false; - - InsertPos = -1; - do { - ++InsertPos; - } while (_OpcodeMustStayBeforeTextureMode(Intermediate[InsertPos].Opcode, InsertPos)); - - if (m_PSVersion >= D3DPS_VERSION(2, 0)) - { - Ins.Initialize(PO_DCL); - for (Stage = 0; Stage < XTL::X_D3DTS_STAGECOUNT; Stage++) - { - if (PSTextureModes[Stage] != PS_TEXTUREMODES_NONE) - { - Ins.Output[0].SetRegister(PARAM_T, Stage, MASK_RGBA); - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - Result = true; - } - } - } - - Ins.Initialize(PO_TEX); - for (Stage = 0; Stage < XTL::X_D3DTS_STAGECOUNT; Stage++) - { - // TODO : Apply conversions when PS_GLOBALFLAGS_TEXMODE_ADJUST is set (but ... how to check the texture type? read D3DRS_PSTEXTUREMODES?) - - // Convert the texture mode to a texture addressing instruction : - switch (PSTextureModes[Stage]) { // input = q,s,t,r (same layout as a,r,g,b, also known as w,x,y,z) - case PS_TEXTUREMODES_PROJECT2D: // argb = texture(r/q, s/q) TODO : Apply the division via D3DTOP_BUMPENVMAP ? - case PS_TEXTUREMODES_PROJECT3D: // argb = texture(r/q, s/q, t/q) Note : 3d textures are sampled using PS_TEXTUREMODES_CUBEMAP - case PS_TEXTUREMODES_CUBEMAP: { // argb = cubemap(r/q, s/q, t/q) - if (m_PSVersion >= D3DPS_VERSION(2, 0)) - continue; - - Ins.Opcode = PO_TEX; - break; - } - case PS_TEXTUREMODES_PASSTHRU: Ins.Opcode = PO_TEXCOORD; break; - case PS_TEXTUREMODES_CLIPPLANE: Ins.Opcode = PO_TEXKILL; break; - case PS_TEXTUREMODES_BUMPENVMAP: Ins.Opcode = PO_TEXBEM; break; - case PS_TEXTUREMODES_BUMPENVMAP_LUM: Ins.Opcode = PO_TEXBEML; break; -// case PS_TEXTUREMODES_BRDF: Ins.Opcode = PO_TEXBRDF; break; // Note : Not supported by Direct3D8 ? - case PS_TEXTUREMODES_DOT_ST: Ins.Opcode = PO_TEXM3X2TEX; break; - case PS_TEXTUREMODES_DOT_ZW: Ins.Opcode = PO_TEXM3X2DEPTH; break; // Note : requires ps.1.3 and a preceding texm3x2pad -// case PS_TEXTUREMODES_DOT_RFLCT_DIFF: Ins.Opcode = PO_TEXM3X3DIFF; break; // Note : Not supported by Direct3D8 ? - case PS_TEXTUREMODES_DOT_RFLCT_SPEC: Ins.Opcode = PO_TEXM3X3VSPEC; break; - case PS_TEXTUREMODES_DOT_STR_3D: Ins.Opcode = PO_TEXM3X3TEX; break; // Note : Uses a 3d texture - case PS_TEXTUREMODES_DOT_STR_CUBE: Ins.Opcode = PO_TEXM3X3TEX; break; // Note : Uses a cube texture - case PS_TEXTUREMODES_DPNDNT_AR: Ins.Opcode = PO_TEXREG2AR; break; - case PS_TEXTUREMODES_DPNDNT_GB: Ins.Opcode = PO_TEXREG2GB; break; - case PS_TEXTUREMODES_DOTPRODUCT: - if (_NextIs2D(Stage)) - Ins.Opcode = PO_TEXM3X2PAD; - else - Ins.Opcode = PO_TEXM3X3PAD; - break; - case PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST: Ins.Opcode = PO_TEXM3X3SPEC; break; // Note : Needs 3 arguments! - default: - continue; - } - - Ins.Output[0].SetRegister(PARAM_T, Stage, 0); - - // For those texture modes that need it, add the source stage as argument : - if (PSH_OPCODE_DEFS[Ins.Opcode]._In >= 1) - { - Ins.Parameters[0].SetRegister(PARAM_T, PSInputTexture[Stage], 0); - - switch (PSDotMapping[Stage]) { - case PS_DOTMAPPING_MINUS1_TO_1_D3D: - Ins.Parameters[0].Modifiers = (1 << ARGMOD_SCALE_BX2); - break; - } - } - - if (PSH_OPCODE_DEFS[Ins.Opcode]._In >= 2) - { - // Add the third argument : - switch (PSTextureModes[Stage]) { - case PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST: - { - Ins.Parameters[1].SetRegister(PARAM_C, 0, 0); - Ins.CommentString = "Dxbx guess"; // TODO : Where do we get the 3rd argument to this? - break; - } - } - } - -// // Warn about unprocessed flag : -// if ((dwPS_GLOBALFLAGS & PS_GLOBALFLAGS_TEXMODE_ADJUST) > 0) -// Ins.CommentString = Ins.CommentString + " PS_GLOBALFLAGS_TEXMODE_ADJUST unhandled!"; - - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - Result = true; - } - return Result; -} - -bool PSH_XBOX_SHADER::MoveRemovableParametersRight() -{ - int i; - - bool Result = false; - - // For all opcodes, try to put constant and discarded arguments in the rightmost slot, to ease following analysis : - i = IntermediateCount; - while (i > 0) - { - --i; - - switch (Intermediate[i].Opcode) { -// case PO_SUB: // 1-x is not the same as x-1, but can still be reduced - see SimplifySUB - case PO_ADD: - case PO_DP3: - case PO_DP4: - case PO_MUL: // All these opcodes have two swappable parameters, so try that : - if (Intermediate[i].MoveRemovableParametersRight(0, 1)) - Result = true; - break; - - case PO_XMMA: - case PO_XMMC: - case PO_XDD: - if (Intermediate[i].XMoveNonRegisterOutputsRight()) - Result = true; - break; - - case PO_XDM: - { - // Parameters may be swapped for both dot and mul, - // but the opcodes themselves may not, as we handle - // both XDM operations separately below : - if (Intermediate[i].MoveRemovableParametersRight(0, 1)) - Result = true; - - if (Intermediate[i].MoveRemovableParametersRight(2, 3)) - Result = true; - break; - } - } - } - return Result; -} // MoveRemovableParametersRight - -//bool PSH_XBOX_SHADER::ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled) - - void PSH_XBOX_SHADER::_SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, XTL::D3DCOLOR ConstColor) - { - XTL::D3DXCOLOR XColor; - - // Colors are defined in RGBA format, and range 0.0 - 1.0 (negative values - // can be obtained by supplying PS_INPUTMAPPING_SIGNED_NEGATE to the combiner - // that reads from these constants). - XColor = ConstColor; - NewIns.Parameters[0].SetConstValue(XColor.r); - NewIns.Parameters[1].SetConstValue(XColor.g); - NewIns.Parameters[2].SetConstValue(XColor.b); - NewIns.Parameters[3].SetConstValue(XColor.a); - } - - // Try to fixup constants above the limit (c7 for PS.1.3) : - int PSH_XBOX_SHADER::_MapConstant(int ConstNr, bool *NativeConstInUse) - { - // 1-to-1 mapping for constants that can be supported native (if not used already) : - if ((ConstNr < MaxConstantFloatRegisters) && (!NativeConstInUse[ConstNr])) - { - return ConstNr; - } - - // Assign not-yet-defined constants bottom-to-up : - int Result = 0; - while (Result < MaxConstantFloatRegisters) - { - if (!NativeConstInUse[Result]) - return Result; - - ++Result; - } - - // Unresolved - fallback to 1st constant : - if (Result >= MaxConstantFloatRegisters) - Result = 0; - - EmuWarning("; Too many constants to emulate, this pixel shader will give unexpected output!"); - return Result; - } - - int PSH_XBOX_SHADER::_HandleConst(int XboxConst, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled, bool *NativeConstInUse, bool *EmittedNewConstant) - { - int NativeConst; - - if (!Recompiled->ConstInUse[XboxConst]) - { - // Determine and remember a new mapping to native : - NativeConst = _MapConstant(XboxConst, NativeConstInUse); - NativeConstInUse[NativeConst] = true; - Recompiled->ConstMapping[XboxConst] = NativeConst; - Recompiled->ConstInUse[XboxConst] = true; - // Make sure we can check this is a new constant (so we can emit a constant declaration - // for any final combiner constants - because those cannot be set via SetPixelShaderConstant) : - *EmittedNewConstant = true; - } - - // Return the (previously) determined mapping : - return Recompiled->ConstMapping[XboxConst]; - } - -bool PSH_XBOX_SHADER::ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled) -{ - int i, j; - PPSH_INTERMEDIATE_FORMAT Cur; - PPSH_IMD_ARGUMENT CurArg; - bool NativeConstInUse[224]; // Note : 224 = highest possible MaxConstantFloatRegisters - int16 OriginalConstantNr; - bool EmittedNewConstant = false; - PSH_INTERMEDIATE_FORMAT NewIns = {}; - - bool Result = false; - - // Note : Recompiled.ConstMapping and Recompiled.ConstInUse[i] are still empty here. - for (i = 0; i < MaxConstantFloatRegisters; i++) - NativeConstInUse[i] = false; - - // Loop over all opcodes to update the constant-indexes (Xbox uses C0 and C1 in each combiner) : - for (i = 0; i < IntermediateCount; i++) - { - // Loop over this opcodes' input arguments : - Cur = &(Intermediate[i]); - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) - { - // Only handle arguments that address a constant register : - CurArg = &(Cur->Parameters[j]); - - // The Fog register is not supported on PC so we convert it to a constant too : - // (But only if the MASK is not solely accessing the alpha-channel - we don't support that) - if (CurArg->Type == PARAM_FOG) - { - if (CurArg->Mask != MASK_A) - { - CurArg->Type = PARAM_C; - CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FOG, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - CurArg->Mask = CurArg->Mask & (!MASK_A); - } - else - { - // Until we can get Alpha fog from the vertex shader somehow, - // set it to a constant value, so these shaders (like appearing - // in Dolphin samples) still compile and give reasonable output : - CurArg->SetConstValue(1.0); - Cur->CommentString = "FOG.a not emulated, using 1."; - } - - continue; - } - - if (CurArg->Type != PARAM_C) - continue; - - // Make sure we can detect new constants (and if it was C0 or C1), - // as we need this for fixing up final combiner constants : - EmittedNewConstant = false; - OriginalConstantNr = CurArg->Address; - - // For each constant being addressed, we find out which Xbox constant it is, - // and map it to a native constant (as far as we have space for them) : - switch (CurArg->Address) { - case 0: // Handle C0 (if present) : - { - // The final combiner has a separate C0 constant : - if (Cur->CombinerStageNr == XFC_COMBINERSTAGENR) - CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FC0, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - else - { - // See if C0 has a unique index per combiner stage : - if (CombinerHasUniqueC0) - // C0 actually ranges from c0 to c7, one for each possible combiner stage (X_D3DRS_PSCONSTANT0_0..X_D3DRS_PSCONSTANT0_7) : - CurArg->Address = _HandleConst(Cur->CombinerStageNr, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - else - // Non-unique just reads the same C0 in every stage : - CurArg->Address = _HandleConst(0, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - } - break; - } - - case 1: // Handle C1 (if present) : - { - // The final combiner has a separate C1 constant : - if (Cur->CombinerStageNr == XFC_COMBINERSTAGENR) - CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FC1, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - else - { - // See if C1 has a unique index per combiner stage : - if (CombinerHasUniqueC1) - // C1 actually ranges from c8 to c15, one for each possible combiner stage (X_D3DRS_PSCONSTANT1_0..X_D3DRS_PSCONSTANT1_7) : - CurArg->Address = _HandleConst(Cur->CombinerStageNr + 8, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - else - // Non-unique just reads the same C1 in every stage : - CurArg->Address = _HandleConst(1, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); - } - break; - } - } // switch - - // New constants solely used for the final combiner must be DEFined separately, - // as there's no other way to set these (SetPixelShaderConstant can only write - // to the 16 slots X_D3DRS_PSCONSTANT1_0..X_D3DRS_PSCONSTANT1_7) : - if ((Cur->CombinerStageNr == XFC_COMBINERSTAGENR) && EmittedNewConstant) - { - // Output a new opcode to define this constant : - NewIns.Initialize(PO_DEF); - NewIns.Output[0].SetRegister(PARAM_C, CurArg->Address, MASK_RGBA); - if (OriginalConstantNr == 0) - _SetColor(NewIns, pPSDef->PSFinalCombinerConstant0); - else - _SetColor(NewIns, pPSDef->PSFinalCombinerConstant1); - - // PO_DEF opcodes go after the initial PO_XPS (which is not yet replaced by PO_COMMENT+PO_PS, - // see ConvertXboxOpcodesToNative calling ConvertXPSToNative for that) - InsertIntermediate(&NewIns, 1); - } - } // for arguments - } // for opcodes - - return Result; -} // ConvertConstantsToNative - -bool PSH_XBOX_SHADER::RemoveUselessWrites() -// Note : Xbox allows writing to V0 (diffuse color) and V1 (specular color), but native ps.1.3 doesn't! -// Some examples of this behaviour can be seen when running RayMan Arena. -{ - int i, j; - PPSH_INTERMEDIATE_FORMAT Cur; - PPSH_IMD_ARGUMENT CurArg; - DWORD RegUsage[/*PSH_ARGUMENT_TYPE*/PARAM_C - PARAM_VALUE + 1][224] = {}; // 224 = highest possible PSH_PC_MAX_REGISTER_COUNT - - // TODO : In Polynomial Texture Maps, one extra opcode could be deleted (sub r1.rgb, v0,v0), why doesn't it? - bool Result = false; - - // Mark only R0 (and discard) as initially 'read', as these may not result in a removal : - RegUsage[PARAM_R][0] = MASK_RGBA; - for (i = 0; i < PSH_PC_MAX_REGISTER_COUNT; i++) - RegUsage[PARAM_DISCARD][i] = MASK_RGBA; - - i = IntermediateCount; - while (i > 0) - { - --i; - Cur = &(Intermediate[i]); - if (!Cur->IsArithmetic()) - continue; - - // Loop over the output arguments : - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) - { - CurArg = &(Cur->Output[j]); - - // Remove useless flag, to ease up later comparisions : - CurArg->Modifiers = CurArg->Modifiers & ~(1 << ARGMOD_IDENTITY); - - // Discard useless writes : - if ( (CurArg->Address < MaxTemporaryRegisters) - && ((RegUsage[CurArg->Type][CurArg->Address] & CurArg->Mask) == 0)) - { - DbgPrintf("; Removed useless assignment to register %s\n", CurArg->ToString().c_str()); - CurArg->Type = PARAM_DISCARD; - Result = true; - } - } - - // Loop over the input arguments : - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) - { - CurArg = &(Cur->Parameters[j]); - // Skip non-register parameters : - if (!CurArg->UsesRegister()) - continue; - - // Remove useless flag, to ease up later comparisions : - CurArg->Modifiers = CurArg->Modifiers & ~(1 << ARGMOD_IDENTITY); - - // Keep track of all register reads, so that we can discard useless writes : - if (CurArg->Address < MaxTemporaryRegisters) - RegUsage[CurArg->Type][CurArg->Address] = RegUsage[CurArg->Type][CurArg->Address] | CurArg->Mask; - } - } - return Result; -} // RemoveUselessWrites - -void PSH_XBOX_SHADER::ConvertXboxOpcodesToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - std::string CommentString; - - // Do a bottom-to-top pass, converting all xbox opcodes into a native set of opcodes : - i = IntermediateCount; - while (i > 0) - { - --i; - Cur = &(Intermediate[i]); - - // Convert all Xbox opcodes into native opcodes : - CommentString = Cur->ToString(); - switch (Cur->Opcode) { - case PO_XPS: ConvertXPSToNative(i); break; - case PO_XMMA: ConvertXMMAToNative(i); break; - case PO_XMMC: ConvertXMMCToNative(i); break; - case PO_XDM: ConvertXDMToNative(i); break; - case PO_XDD: ConvertXDDToNative(i); break; - case PO_XFC: ConvertXFCToNative(i); break; // Can only occur once, as the last instruction - default: - CommentString = ""; break; - } - - if (!CommentString.empty()) { - PSH_INTERMEDIATE_FORMAT NewIns = {}; - NewIns.Initialize(PO_COMMENT)->CommentString = CommentString; - InsertIntermediate(&NewIns, i); - } - } -} // ConvertXboxOpcodesToNative - -void PSH_XBOX_SHADER::ConvertXPSToNative(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - - Cur = &(Intermediate[i]); - Cur->Opcode = PO_PS; -} - -bool PSH_XBOX_SHADER::ConvertXMMToNative_Except3RdOutput(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - int InsertPos; - PSH_INTERMEDIATE_FORMAT Ins = {}; - - bool Result = false; - Cur = &(Intermediate[i]); - InsertPos = i; - - // This block is meant for cases where XMMA/XMMC discards the 3rd output : - if (Cur->Output[2].Type == PARAM_DISCARD) - { - // Mark that this XMMA/XMMC opcode is already handled here : - Result = true; - - // The opcode must unconditionally change into a MUL (or two) : - Cur->Opcode = PO_MUL; - - // Is the second output ignored? - if (Cur->Output[1].Type == PARAM_DISCARD) - { - // If the first output is also ignored : - if (Cur->Output[0].Type == PARAM_DISCARD) - // The complete opcode can already be removed early on : - DeleteIntermediate(i); - else - ;// The first output is just a MUL, it's output (and first two parameters) are already in-place, so we're done - - return Result; - } - ++InsertPos; - - // Create a second MUL opcode for the second result : - Ins = *Cur; - Ins.XCopySecondOpcodeToFirst(PO_MUL); - InsertIntermediate(&Ins, InsertPos); - return Result; - } - - // The third output is needed, but what about the first and second output ? - - if (Cur->Output[0].Type == PARAM_DISCARD) - { - Cur->Output[0].Type = PARAM_R; - Cur->Output[0].Address = FakeRegNr_Xmm1; // 'r4' - } - - if (Cur->Output[1].Type == PARAM_DISCARD) - { - Cur->Output[1].Type = PARAM_R; - Cur->Output[1].Address = FakeRegNr_Xmm2; // 'r5' - } - - // Generate a MUL for the 1st output : - Ins = *Cur; - Ins.Opcode = PO_MUL; - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - - // Generate a MUL for the 2nd output : - Ins = *Cur; - Ins.XCopySecondOpcodeToFirst(PO_MUL); - InsertIntermediate(&Ins, InsertPos); - - // Note : If XMMA or XMMC writes to the third argument, we now have - // the first and second stored already (if they where not ignored). - // IF one (or both) are ignored, the intermediate result might be - // needed, but let XMMA/XMMC figure that out first - the resulting - // opcode(s) will probably require the initial opcode's removal! - return Result; -} // ConvertXMMToNative_Except3RdOutput - -void PSH_XBOX_SHADER::ConvertXMMAToNative(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - - // Handle the generic case of XMM, and check if the 3rd (Add) argument is ignored : - if (!ConvertXMMToNative_Except3RdOutput(i)) - { - // Add needs to be stored, we already have 2 MULs, so change the XMMA into an ADD : - Cur = &(Intermediate[i+2]); - Cur->Opcode = PO_ADD; - Cur->Modifier = INSMOD_NONE; - Cur->Parameters[0] = Cur->Output[0]; - Cur->Parameters[1] = Cur->Output[1]; - Cur->Output[0] = Cur->Output[2]; - } -} - -void PSH_XBOX_SHADER::ConvertXMMCToNative(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - - // Handle the generic case of XMM, and check if the 3rd (Compare) argument is ignored : - if (!ConvertXMMToNative_Except3RdOutput(i)) - { - // Add needs to be stored, we already have 2 MULs, so change the XMMC into an CND : - Cur = &(Intermediate[i+2]); - // TODO : If CombinerMuxesOnMsb is False, we should compare to the LeastSignificantBit of r0.a - but how? - Cur->Opcode = PO_CND; - Cur->Modifier = INSMOD_NONE; - // Begin the input of CND with the required r0.a parameter : - Cur->Parameters[0].SetRegister(PARAM_R, 0, MASK_A); - Cur->Parameters[0].Modifiers = (1 << ARGMOD_IDENTITY); - Cur->Parameters[0].Multiplier = 1.0; - // Follow that with the 2 selection registers : - Cur->Parameters[1] = Cur->Output[0]; - Cur->Parameters[2] = Cur->Output[1]; - // And put the result it in the final register : - Cur->Output[0] = Cur->Output[2]; - } -} - -void PSH_XBOX_SHADER::ConvertXDMToNative(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - PSH_INTERMEDIATE_FORMAT Ins = {}; - - Cur = &(Intermediate[i]); - - // XDM does two operations : - - // a multiply : - if (Cur->Output[1].Type != PARAM_DISCARD) - { - Ins = *Cur; - Ins.XCopySecondOpcodeToFirst(PO_MUL); - InsertIntermediate(&Ins, i+1); - } - - // and a dot product : - if (Cur->Output[0].Type == PARAM_DISCARD) - DeleteIntermediate(i); - else - Cur->Opcode = PO_DP3; -} - -void PSH_XBOX_SHADER::ConvertXDDToNative(int i) -{ - PPSH_INTERMEDIATE_FORMAT Cur; - PSH_INTERMEDIATE_FORMAT Ins = {}; - - Cur = &(Intermediate[i]); - - // XDD does two operations : - - // ...a dot product : - Cur->Opcode = PO_DP3; - - // and another dot product : - if (Cur->Output[1].Type != PARAM_DISCARD) - { - Ins = *Cur; - Ins.XCopySecondOpcodeToFirst(PO_DP3); - InsertIntermediate(&Ins, i+1); - } -} - -void PSH_XBOX_SHADER::ConvertXFCToNative(int i) -{ - PSH_INTERMEDIATE_FORMAT Cur = {}; - int InsertPos; - bool NeedsProd; - bool NeedsSum; - PPSH_IMD_ARGUMENT CurArg; - PSH_INTERMEDIATE_FORMAT Ins = {}; - - // Get a copy of XFC and remove it already, new instructions will replace it : - Cur = Intermediate[i]; - DeleteIntermediate(i); - InsertPos = i; - // 'final combiner - r0 = A*B + (1-A)*C + D'; - - // See if the final combiner uses the prod or sum input parameters : - NeedsProd = false; - NeedsSum = false; - for (i = 0; i < PSH_OPCODE_DEFS[Cur.Opcode]._In; i++) - { - CurArg = &(Cur.Parameters[i]); - - // Check for the three final-combiner-specific argument types : - switch (CurArg->Type) { - case PARAM_V1R0_SUM: - { - // Change SUM into a fake register, which will be resolved later : - CurArg->Type = PARAM_R; - CurArg->Address = FakeRegNr_Sum; // 'r2' - NeedsSum = true; - break; - } - - case PARAM_EF_PROD: - { - // Change PROD into a fake register, which will be resolved later : - CurArg->Type = PARAM_R; - CurArg->Address = FakeRegNr_Prod; // 'r3' - NeedsProd = true; - break; - } - - case PARAM_FOG: - { - // Change FOG into a constant of 1.0, as we can't simulate it otherwise : -// CurArg->SetConstValue(1.0); -// Cur->CommentString = "final combiner - FOG not emulated, using 1."; - break; - } - } - } // for input - - if (NeedsSum) - { - // Add a new opcode that calculates r0*v1 : - Ins.Initialize(PO_MUL); - Ins.Output[0].SetRegister(PARAM_R, FakeRegNr_Sum, MASK_RGBA); // 'r2' - - Ins.Parameters[0].SetRegister(PARAM_R, 0, MASK_RGB); - Ins.Parameters[1].SetRegister(PARAM_V, 1, MASK_RGB); - - // Take the FinalCombinerFlags that influence this result into account : - if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_COMPLEMENT_R0) > 0) - Ins.Parameters[0].Modifiers = (1 << ARGMOD_INVERT); // (1-r0) is used as an input to the sum rather than r0 - if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_COMPLEMENT_V1) > 0) - Ins.Parameters[1].Modifiers = (1 << ARGMOD_INVERT); // (1-v1) is used as an input to the sum rather than v1 - if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_CLAMP_SUM) > 0) - Ins.Modifier = INSMOD_SAT; // V1+R0 sum clamped to [0,1] - - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - DbgPrintf("; Inserted final combiner calculation of V1R0_sum register\n"); - } - - if (NeedsProd) - { - // Add a new opcode that calculates E*F : - Ins.Initialize(PO_MUL); - Ins.Output[0].SetRegister(PARAM_R, FakeRegNr_Prod, MASK_RGBA); // 'r3' - Ins.Parameters[0] = Cur.Parameters[4]; // E - Ins.Parameters[1] = Cur.Parameters[5]; // F - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - DbgPrintf("; Inserted final combiner calculation of EF_prod register\n"); - } - - // The final combiner calculates : r0.rgb=s0*s1 + (1-s0)*s2 + s3 - // Change that into a LRP + ADD, and let the optimizer reduce it; - - // Add a new opcode that calculates r0.rgb=s0*s1 + (1-s0)*s2 via a LRP : - // Set the output to r0.rgb (as r0.a is determined via s6.a) : - - // Watch out! If s3=r0.rgb, then the LRP cannot use r0, but must use r1 as temp! - if (Cur.Parameters[3].IsRegister(PARAM_R, 0, 0)) - Cur.Output[0].SetRegister(PARAM_R, 1, MASK_RGB); - else - Cur.Output[0].SetRegister(PARAM_R, 0, MASK_RGB); - - Ins = Cur; - Ins.Opcode = PO_LRP; - Ins.Modifier = INSMOD_NONE; - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - - // Add a new opcode that calculates r0.rgb=r0.rgb+s3 : - Ins.Opcode = PO_ADD; - Ins.Modifier = Cur.Modifier; - Ins.Output[0] = Cur.Output[0]; // = r0.rgb - Ins.Parameters[0] = Cur.Output[0]; // = r0.rgb - Ins.Parameters[1] = Cur.Parameters[3]; // =s3 from XFC - InsertIntermediate(&Ins, InsertPos); - ++InsertPos; - - // See if s6 is something else than "r0.a" : - if (Cur.Parameters[6].ToString() != "r0.a") - { - // Add a new opcode that moves s6 over to r0.a : - Ins.Initialize(PO_MOV); - Ins.Output[0].SetRegister(PARAM_R, 0, MASK_A); - Ins.Parameters[0] = Cur.Parameters[6]; - InsertIntermediate(&Ins, InsertPos); -// ++InsertPos; - } -} - -bool PSH_XBOX_SHADER::RemoveNops() -{ - int i, j; - PPSH_INTERMEDIATE_FORMAT Cur; - bool HasOutput; - - bool Result = false; - i = IntermediateCount; - while (i > 0) - { - --i; - Cur = &(Intermediate[i]); - - // Skip opcodes that have no output, but should stay anyway : - if (PSH_OPCODE_DEFS[Cur->Opcode]._Out == 0) - if (Cur->Opcode != PO_NOP) - continue; - - // See if this opcode writes to any of it's outputs : - { - HasOutput = false; - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) - if (Cur->Output[j].Type != PARAM_DISCARD) - { - HasOutput = true; - break; - } - - if (!HasOutput) - { - // Remove the opcode (as it doesn't change anything) : - // This applies to PO_NOP and opcodes that discard all their results : - DeleteIntermediate(i); - Result = true; - continue; - } - } - } - return Result; -} - -bool PSH_XBOX_SHADER::IsRegisterFreeFromIndexOnwards(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16 aAddress) -{ - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - - for (i = aIndex; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - // Detect a write or read : - if (Cur->WritesToRegister(aRegType, aAddress) - || Cur->ReadsFromRegister(aRegType, aAddress)) - { - return false; - } - } - - return true; -} - -void PSH_XBOX_SHADER::ReplaceRegisterFromIndexOnwards(int aIndex, - PSH_ARGUMENT_TYPE aSrcRegType, int16 aSrcAddress, - PSH_ARGUMENT_TYPE aDstRegType, int16 aDstAddress) -{ - int i; - int j; - PPSH_INTERMEDIATE_FORMAT Cur; - - for (i = aIndex; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) - if (Cur->Output[j].IsRegister(aSrcRegType, aSrcAddress)) - Cur->Output[j].SetRegister(aDstRegType, aDstAddress, Cur->Output[j].Mask); - - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) - if (Cur->Parameters[j].IsRegister(aSrcRegType, aSrcAddress)) - Cur->Parameters[j].SetRegister(aDstRegType, aDstAddress, Cur->Parameters[j].Mask); - } -} - -bool PSH_XBOX_SHADER::FixConstantModifiers() -{ - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - - bool Result = false; - - // Do a bottom-to-top pass, preventing constant-modifiers via additional MOV's: - i = IntermediateCount; - while (i > 0) - { - --i; - Cur = &(Intermediate[i]); - if (!Cur->IsArithmetic()) - continue; - - if (Cur->Opcode == PO_MOV) - continue; - - // Detect modifiers on constant arguments - for (int p = 0; p < 7; p++) { - if ((Cur->Parameters[p].Type == PARAM_C) - && (Cur->Parameters[p].Modifiers != 0)) { - // Insert a MOV to the destination register, - // so the modifier can be applied on that, - // instead of on this constant argument. - PSH_INTERMEDIATE_FORMAT Ins = {}; - - Ins.Initialize(PO_MOV); - // No need to check if output is a constant - those cannot be assigned to anyway - Ins.Output[0] = Cur->Output[0]; - // Move constant into register - Ins.Parameters[0] = Cur->Parameters[p]; - Cur->Parameters[p] = Ins.Output[0]; - // Apply modifier to register instead of constant - Cur->Parameters[p].Modifiers = Ins.Parameters[0].Modifiers; - Ins.Parameters[0].Modifiers = 0; - Ins.CommentString = "Inserted to avoid constant modifier (applied below on register)"; - InsertIntermediate(&Ins, i); - DbgPrintf("; Used intermediate move to avoid constant modifier\n"); - Result = true; - } - } - } - return Result; -} // FixConstantModifiers - -//bool PSH_XBOX_SHADER::CombineInstructions() - - bool _CanLerp(PPSH_INTERMEDIATE_FORMAT Mul1, PPSH_INTERMEDIATE_FORMAT Mul2, PPSH_INTERMEDIATE_FORMAT AddOpcode, int Left, int Right) - { - PPSH_IMD_ARGUMENT ParamLeft, ParamRight; - - // Check if Left and Right are the same register : - ParamLeft = &(Mul1->Parameters[Left]); - ParamRight = &(Mul2->Parameters[Right]); - if ((ParamLeft->Type != ParamRight->Type) - || (ParamLeft->Address != ParamRight->Address) - || (ParamLeft->Mask != ParamRight->Mask)) - return false; - - // Is the left argument inverted and the right not (or the other way around) ? - if ((ParamLeft->Modifiers & (1 << ARGMOD_INVERT)) != (ParamRight->Modifiers & (1 << ARGMOD_INVERT))) - { - // In that case, already move the arguments over to AddOpcode so we create a LRP : - AddOpcode->Parameters[0] = *ParamLeft; - AddOpcode->Parameters[1] = Mul1->Parameters[1-Left]; - AddOpcode->Parameters[2] = Mul2->Parameters[3-Right]; - return true; - } - return false; - } - - bool _CanMad(int ConstOne, PPSH_INTERMEDIATE_FORMAT Mul1, PPSH_INTERMEDIATE_FORMAT Mul2, PPSH_INTERMEDIATE_FORMAT AddOpcode) - { - // Check if the given parameter is 1 : - bool Result = Mul1->Parameters[ConstOne].GetConstValue() == 1.0; - if (Result) - { - // Put the other 3 parameters int the resulting opcode, so we can make it a MAD : - AddOpcode->Parameters[0] = Mul2->Parameters[0]; - AddOpcode->Parameters[1] = Mul2->Parameters[1]; - AddOpcode->Parameters[2] = Mul1->Parameters[1-ConstOne]; - } - return Result; - } - -bool PSH_XBOX_SHADER::CombineInstructions() -{ - int i; - PPSH_INTERMEDIATE_FORMAT Op0; - PPSH_INTERMEDIATE_FORMAT Op1; - PPSH_INTERMEDIATE_FORMAT Op2; - bool CanOptimize; - int j; - int k; - - bool Result = false; - - i = IntermediateCount - 1; - while (i > 0) - { - --i; - Op0 = &(Intermediate[i+0]); - Op1 = &(Intermediate[i+1]); - Op2 = &(Intermediate[i+2]); - - // Check if there are two consecutive opcodes reading from a fake R register; - // We outputted these ourselves, in order to ease the conversion and profit - // from having generic optimizations in one place : - if ( (Op0->Output[0].Type == PARAM_R) - && (Op0->Output[0].Address >= PSH_XBOX_MAX_R_REGISTER_COUNT) - && (Op1->Output[0].Type == PARAM_R) - && (Op1->Output[0].Address >= PSH_XBOX_MAX_R_REGISTER_COUNT)) - { - // Did we output those from a CND opcode (originally XMMC) ? - if (Op2->Opcode == PO_CND) - { - if ( (Op0->Opcode == PO_MOV) - && (Op1->Opcode == PO_MOV) - && (Op1->Modifier == Op0->Modifier)) - { - Op2->Modifier = Op0->Modifier; - Op2->Parameters[1] = Op0->Parameters[0]; - Op2->Parameters[2] = Op1->Parameters[0]; - DeleteIntermediate(i); - DeleteIntermediate(i); - DbgPrintf("; Changed temporary MUL,MUL,CND via MOV,MOV,CND into a single CND\n"); - Result = true; - continue; - } - } - - // Did we output those from a ADD opcode (originally XMMA) ? - if (Op2->Opcode == PO_ADD) - { - if ( (Op0->Opcode == PO_MUL) - && (Op1->Opcode == PO_MUL) - && (Op1->Modifier == Op0->Modifier)) - { - // Check if we can lerp - we just need the same register on both sides that's inverted on the other : - if (_CanLerp(Op0, Op1, Op2, 0, 2) - || _CanLerp(Op0, Op1, Op2, 1, 2) - || _CanLerp(Op0, Op1, Op2, 0, 3) - || _CanLerp(Op0, Op1, Op2, 1, 3)) - { - // The lerp can be done, and the correct parameters are already set to Op2, - // so all we need to do now, it fixup the rest and remove the two MOV's : - Op2->Opcode = PO_LRP; - Op2->Modifier = Op0->Modifier; - DeleteIntermediate(i); - DeleteIntermediate(i); - DbgPrintf("; Changed temporary MUL,MUL,ADD into a single LRP\n"); - Result = true; - continue; - } - - // Check if we can mad - we just need a constant 1 in one argument : - if (_CanMad(0, Op0, Op1, Op2) - || _CanMad(1, Op0, Op1, Op2) - || _CanMad(0, Op1, Op0, Op2) - || _CanMad(1, Op1, Op0, Op2)) - { - // The mad can be done, and the correct parameters are already set to Op2, - // so all we need to do now, it fixup the rest and remove the two MOV's : - Op2->Opcode = PO_MAD; - Op2->Modifier = Op0->Modifier; - DeleteIntermediate(i); - DeleteIntermediate(i); - DbgPrintf("; Changed temporary MUL,MUL,ADD into a single MAD\n"); - Result = true; - continue; - } - - // No single opcode possible, so change it into a MUL + MAD : - // The first mul may write to the last output register (without a modifier) : - Op0->Modifier = INSMOD_NONE; - Op0->Output[0] = Op2->Output[0]; - // Change the second MUL into a MAD : - Op1->Opcode = PO_MAD; - Op1->Output[0] = Op2->Output[0]; - Op1->Parameters[2] = Op0->Output[0]; - // Remove the trailing ADD : - DeleteIntermediate(i+2); - DbgPrintf("; Changed temporary MUL,MUL,ADD into a MUL,MAD\n"); - Result = true; - continue; - } - - // Was it a MUL,MUL,ADD? - if ( (Op0->Opcode == PO_MUL) - && (Op1->Opcode == PO_MUL) - && (Op0->Parameters[1].GetConstValue() == 1.0) - && (Op1->Parameters[1].GetConstValue() == 1.0)) - { - // Remove the two MOV's and fold their arguments into a MUL : - Op2->Opcode = PO_MUL; - Op2->Parameters[0] = Op0->Parameters[0]; - Op2->Parameters[1] = Op1->Parameters[0]; - DeleteIntermediate(i); - DeleteIntermediate(i); - DbgPrintf("; Changed temporary MUL,MUL,ADD into a MUL\n"); - Result = true; - continue; - } - } - } - - // Do two neighbouring opcodes output to the same register (without a modifier) ? - if ( (Op0->Output[0].ToString() == Op1->Output[0].ToString()) - && (Op0->Modifier == INSMOD_NONE) - && (Op1->Modifier == INSMOD_NONE)) - { - // Is it MUL,ADD ? - if ( (Op0->Opcode == PO_MUL) - && (Op1->Opcode == PO_ADD)) - { - // Is the output of the MUL input to the ADD ? - if ( (Op0->Output[0].Type == Op1->Parameters[0].Type) - && (Op0->Output[0].Address == Op1->Parameters[0].Address) - && (Op0->Output[0].Modifiers == Op1->Parameters[0].Modifiers)) - // Mask and Multiplier are not important here - { - Op0->Opcode = PO_MAD; - Op0->Parameters[2] = Op1->Parameters[1]; - DeleteIntermediate(i+1); - DbgPrintf("; Changed MUL,ADD into a single MAD\n"); - Result = true; - continue; - } - } - } - -/* - // Combinations that can be made if their intermediate result is not read again or overwritten later: - - MOV+ADD > ADD (if MOV.Output[0] was only read by ADD.Parameter[0] or ADD.Parameter[1]) - MOV+SUB > SUB (if MOV.Output[0] was only read by SUB.Parameter[0] or SUB.Parameter[1]) - MOV+MUL > MUL (if MOV.Output[0] was only read by MOV.Parameter[0] or MOV.Parameter[1]) - - MUL+MOV > MUL (if MUL.Output[0] was only read by MOV.Parameter[0]) - MUL+ADD > MAD (if MUL.Output[0] was only read by ADD.Parameter[0] or ADD.Parameter[1]) - MUL+SUB > MAD (if MUL.Output[0] was only read by SUB.Parameter[0] - Do invert MAD.Parameter[2]) -*/ - - // We can remove a MOV entirely if the input is not changed while - // the output is read, up until the output is re-written; We can change all - // these occurances into a read from the input of this MOV instead : - // This fixes some shaders in Turok, that are reduced to 8 instead of 9 opcodes. - if ( (Op0->Opcode == PO_MOV) - && (Op0->Modifier == INSMOD_NONE) - && (Op0->Output[0].Mask == MASK_RGBA)) - { - CanOptimize = false; - j = i + 1; - while (j < IntermediateCount) - { - // Don't optimize if the output is needed for CND or CMP (which must read from r0) : - // This fixes : "(Validation Error) First source for cnd instruction must be 'r0.a'" in Modify Pixel Shader XDK sample. - if ( ((Intermediate[j].Opcode == PO_CND) || (Intermediate[j].Opcode == PO_CMP)) - && (Op0->Output[0].IsRegister(PARAM_R, 0))) - break; - - // TODO : Add other prevention rules here (like too many texture-reads, and other scases) - - // We can optimize if the MOV-output is written to again before the end of the shader : - CanOptimize = true; - if (Intermediate[j].WritesToRegister(Op0->Output[0].Type, Op0->Output[0].Address, MASK_RGBA)) - break; - - CanOptimize = false; - ++j; - } - - if (CanOptimize) - { - // Loop over all instructions in between, and try to replace reads : - CanOptimize = false; - while (j > i) - { - // For Intermediate[j].Parameters, change all occurrances of Op0.Output[0] into Op0.Parameters[0] : - for (k = 0; k < PSH_OPCODE_DEFS[Intermediate[j].Opcode]._In; k++) - if ( (Intermediate[j].Parameters[k].Type == Op0->Output[0].Type) - && (Intermediate[j].Parameters[k].Address == Op0->Output[0].Address)) - { - Intermediate[j].Parameters[k].Type = Op0->Parameters[0].Type; - Intermediate[j].Parameters[k].Address = Op0->Parameters[0].Address; - // Signal that a replacement is actually done : - CanOptimize = true; - } - - --j; - } - - if (CanOptimize) - { - DeleteIntermediate(i); - DbgPrintf("; Moved MOV input into following instructions\n3"); - Result = true; - } - } - } - - // Fix Dolphin : - // mul r3, r0,t0 ; d0=s0*s1 - // mov r0.rgb, r3 ; d0=s0 final combiner - FOG not emulated, using 1. - if ( (Op0->Output[0].Type == PARAM_R) - && (Op0->Output[0].Address >= PSH_XBOX_MAX_R_REGISTER_COUNT) - && (Op1->Parameters[0].Type == PARAM_R) - && (Op1->Parameters[0].Address >= PSH_XBOX_MAX_R_REGISTER_COUNT)) - { - if ( (Op0->Opcode == PO_MUL) - && (Op1->Opcode == PO_MOV)) - { - // > mul r0.rgb, r0,t0 - Op0->Output[0] = Op1->Output[0]; - DeleteIntermediate(i+1); - DbgPrintf("; Changed temporary MUL,MOV into a MUL\n"); - Result = true; - continue; - } - } - - // Fix Crash bandicoot xfc leftover r3 : - if (Op0->Output[0].IsRegister(PARAM_R, FakeRegNr_Prod)) // 'r3' - { - // The final combiner uses r3, try to use r1 instead : - if (IsRegisterFreeFromIndexOnwards(i, PARAM_R, 1)) - { - ReplaceRegisterFromIndexOnwards(i, Op0->Output[0].Type, Op0->Output[0].Address, PARAM_R, 1); - DbgPrintf("; Changed fake register by r1\n"); - Result = true; - continue; - } - } - } // while - return Result; -} // CombineInstructions - -bool PSH_XBOX_SHADER::SimplifyMOV(PPSH_INTERMEDIATE_FORMAT Cur) -{ - bool CanSimplify; - float Factor; - - // NOP-out MOV's that read and write to the same register : - if ( (Cur->Output[0].Type == Cur->Parameters[0].Type) - && (Cur->Output[0].Address == Cur->Parameters[0].Address) - && (Cur->Output[0].Mask == Cur->Parameters[0].Mask)) - { - if (Cur->Output[0].Type == PARAM_VALUE) - CanSimplify = Cur->Output[0].GetConstValue() == Cur->Parameters[0].GetConstValue(); - else - CanSimplify = (Cur->Output[0].Modifiers == Cur->Parameters[0].Modifiers) - && (Cur->Output[0].Multiplier == Cur->Parameters[0].Multiplier); - - if (CanSimplify) - { - Cur->Opcode = PO_NOP; // This nop will be removed in a recursive fixup - DbgPrintf("; Changed MOV into a NOP\n"); - return true; - } - } - - // Does this MOV put a 0 (zero) in the output? - if (Cur->Parameters[0].GetConstValue() == 0.0) - { - // TODO : Find a constant with the value 0, and use that if present. - // Simulate 0 by subtracting a (guaranteed) register from itself : - // Fixup via "sub d0=v0,v0" : - Cur->Opcode = PO_SUB; - Cur->Parameters[0].Type = PARAM_V; - Cur->Parameters[0].Address = 0; - Cur->Parameters[0].Modifiers = 0; - Cur->Parameters[1] = Cur->Parameters[0]; - DbgPrintf("; Changed MOV 0 into a SUB v0,v0\n"); - return true; - } - - // Does this MOV put a constant in the output? - if (Cur->Parameters[0].Type == PARAM_VALUE) - { - // TODO : If there's a constant equal to GetConstValue(), use that. - Factor = Cur->Parameters[0].GetConstValue(); - - // Fixup via a SUB (which can calculate a constant value) : - Cur->Opcode = PO_SUB; - Cur->Parameters[0].Type = PARAM_V; - Cur->Parameters[0].Address = 0; - - if (Factor < 0.0) - { - // Simulate -1 by calculating it via a (guaranteed) register : - // We follow this : (-v0) - (1-v0) = -v0 - 1 + v0 = -1 - Cur->Parameters[0].Modifiers = (1 << ARGMOD_NEGATE); - Cur->Parameters[1] = Cur->Parameters[0]; - Cur->Parameters[1].Modifiers = (1 << ARGMOD_INVERT); - // Go on with a positive factor, to ease the scaling : - Factor = -Factor; - } - else - { - // Simulate 1 by calculating it via a (guaranteed) register : - // We follow this : (1-v0) - (-v0) = (1-v0) + v0 = 1 - Cur->Parameters[0].Modifiers = (1 << ARGMOD_INVERT); - Cur->Parameters[1] = Cur->Parameters[0]; - Cur->Parameters[1].Modifiers = (1 << ARGMOD_NEGATE); - } - - // Try to simulate all factors (0.5, 1.0 and 2.0) using an output modifier : - Cur->ScaleOutput(Factor); - - DbgPrintf("; Changed MOV {const} into a SUB_factor 1-v0,-v0\n"); - return true; - } - return false; -} - -bool PSH_XBOX_SHADER::SimplifyADD(PPSH_INTERMEDIATE_FORMAT Cur) -{ - // Is this an addition of s0+0 ? - if (Cur->Parameters[1].GetConstValue() == 0.0) - { - // Change it into a MOV (the first argument is already in-place) - Cur->Opcode = PO_MOV; - DbgPrintf("; Changed ADD s0,0 into a MOV s0\n"); - return true; - } - return false; -} - -bool PSH_XBOX_SHADER::SimplifyMAD(PPSH_INTERMEDIATE_FORMAT Cur) -{ - // Is this s0*0+s2 ? - if (Cur->Parameters[1].GetConstValue() == 0.0) - { - // Change it into s2 : - Cur->Opcode = PO_MOV; - Cur->Parameters[0] = Cur->Parameters[2]; - DbgPrintf("; Changed MAD s0,0 into a MOV s0\n"); - return true; - } - - // Is this s0*1+s2 ? - if (Cur->Parameters[1].GetConstValue() == 1.0) - { - // Change it into s0+s2 : - Cur->Opcode = PO_ADD; - Cur->Parameters[1] = Cur->Parameters[2]; - DbgPrintf("; Changed MAD s0,1,s2 into a ADD s0,s2\n"); - return true; - } - - // Is this s0*-1+s2 ? - if (Cur->Parameters[1].GetConstValue() == -1.0) - { - // Change it into s2-s0 : - Cur->Opcode = PO_SUB; - Cur->Parameters[1] = Cur->Parameters[0]; - Cur->Parameters[0] = Cur->Parameters[2]; - DbgPrintf("; Changed MAD s0,-1,s2 into a SUB s2,s0\n"); - return true; - } - return false; -} - -bool PSH_XBOX_SHADER::SimplifySUB(PPSH_INTERMEDIATE_FORMAT Cur) -{ - // Is this an subtraction of s0-0 ? - if (Cur->Parameters[1].GetConstValue() == 0.0) - { - // Change it into a MOV (the first argument is already in-place) - Cur->Opcode = PO_MOV; - DbgPrintf("; Changed SUB x, 0 into a MOV x\n"); - return true; - } - return false; -} - -bool PSH_XBOX_SHADER::SimplifyMUL(PPSH_INTERMEDIATE_FORMAT Cur) -{ - // Is the result of this multiplication zero ? - if (Cur->Parameters[1].GetConstValue() == 0.0) - { - // Change it into a MOV (the 0 argument will be resolve in a recursive MOV fixup) : - Cur->Opcode = PO_MOV; - Cur->Parameters[0].SetConstValue(0.0); - DbgPrintf("; Changed MUL s0,0 into a MOV 0\n"); - return true; - } - - // Is this a multiply-by-const ? - if (Cur->Parameters[1].Type == PARAM_VALUE) - { - // Change it into a simple MOV and scale the output instead : - Cur->Opcode = PO_MOV; - Cur->ScaleOutput(Cur->Parameters[1].GetConstValue()); - DbgPrintf("; Changed MUL s0,{const} into a MOV_factor s0\n"); - return true; - } - return false; -} // SimplifyMUL - -bool PSH_XBOX_SHADER::SimplifyLRP(PPSH_INTERMEDIATE_FORMAT Cur) -{ - // LRP calculates : d0=s0*s1+(1-s0)*s2 which can also be read as : d0=s0*(s1-s2)+s2 - - // Is the right part ((1-s0)*s2) zero? - if ((Cur->Parameters[0].GetConstValue() == 1.0) || (Cur->Parameters[2].GetConstValue() == 0.0)) - { - // Change it into a MUL (calculating the left part : s0*s1 : - Cur->Opcode = PO_MUL; - DbgPrintf("; Changed LRP s0,s1,s2 (where (1-s0)*s2=0) into a MUL s0,s1\n"); - return true; - } - - // Is the left part (s0*s1) zero? - if ((Cur->Parameters[0].GetConstValue() == 0.0) || (Cur->Parameters[1].GetConstValue() == 0.0)) - { - // Change it into a MUL (calculating the right part : (1-s0)*s2) : - Cur->Opcode = PO_MUL; - Cur->Parameters[0].Invert(); - Cur->Parameters[1] = Cur->Parameters[2]; - DbgPrintf("; Changed LRP s0,s1,s2 (where s0*s1=0) into a MUL (1-s0),s2\n"); - return true; - } - - // Is it d0=s0*s1+(1-s0)*1 ? - if (Cur->Parameters[2].GetConstValue() == 1.0) - { - // Change it into a d0=s0*s1+(1-s0) - Cur->Opcode = PO_MAD; - Cur->Parameters[2] = Cur->Parameters[0]; - Cur->Parameters[2].Invert(); - DbgPrintf("; Changed LRP s0,s1,1 into a MAD s0,s1,1-s0\n"); - return true; - } - return false; -} // SimplifyLRP - -bool PSH_XBOX_SHADER::FixupPixelShader() -{ - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - - bool Result = RemoveNops(); - - // TODO : Fixup writes to read-only registers (V0, V1) via another free register (if possible) - // TODO : Fixup the usage of non-existent register numbers (like FakeRegNr_Sum and FakeRegNr_Prod) - // TODO : Fixup the usage of the unsupported INSMOD_BIAS and INSMOD_BX2 instruction modifiers - // TODO : Use the INSMOD_SAT instruction modifier instead of the ARGMOD_SATURATE argument modifier - // TODO : Condense constants registers, to avoid the non-existant C8-C15 (requires a mapping in SetPixelShaderConstant too...) - // TODO : Convert numeric arguments (-2, -1, 0, 1, 2) into modifiers on the other argument - // TODO : Complete to port to D3D9 to support all 18 constants (including C8..C15 + FC0+FC1) - - if (MoveRemovableParametersRight()) - Result = true; - - if (FixConstantModifiers()) - Result = true; - - if (CombineInstructions()) - Result = true; - - // Simplify instructions, which can help to compress the result : - i = IntermediateCount; - while (i > 0) - { - --i; - Cur = &(Intermediate[i]); - - switch (Cur->Opcode) { - case PO_MOV: - if (SimplifyMOV(Cur)) - Result = true; - break; - - case PO_ADD: - if (SimplifyADD(Cur)) - Result = true; - break; - - case PO_MAD: - if (SimplifyMAD(Cur)) - Result = true; - break; - - case PO_SUB: - if (SimplifySUB(Cur)) - Result = true; - break; - - case PO_MUL: - if (SimplifyMUL(Cur)) - Result = true; - break; - - case PO_LRP: - if (SimplifyLRP(Cur)) - Result = true; - break; - } // case - } // for - - // If the above code made any alteration, repeat it as some changes require a followup (like MUL>MOV>NOP) : - if (Result) - { - Log("Fixup intermediate result"); - FixupPixelShader(); - } - return Result; -} // FixupPixelShader - -bool PSH_XBOX_SHADER::FixInvalidSrcSwizzle() -{ - int i, j; - PPSH_INTERMEDIATE_FORMAT Cur; - PPSH_IMD_ARGUMENT CurArg; - - bool Result = false; - for (i = 0; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - // Is this an arithmetic opcode? - if (Cur->Opcode > PO_TEX) // TODO : Use IsArithmetic(), which checks >= PO_ADD? - { - // Loop over the input arguments : - for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) - { - CurArg = &(Cur->Parameters[j]); - - // Fix "Invalid src swizzle" : - if (CurArg->Mask == MASK_RGB) - { - CurArg->Mask = MASK_RGBA; - Result = true; - } - } - } - } - return Result; -} - -bool PSH_XBOX_SHADER::FixMissingR0a() -// On the Xbox, the alpha portion of the R0 register is initialized to -// the alpha component of texture 0 if texturing is enabled for texture 0 : -{ - int R0aDefaultInsertPos; - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - PSH_INTERMEDIATE_FORMAT NewIns = {}; - - // Detect a read of r0.a without a write, as we need to insert a "MOV r0.a, t0.a" as default (like the xbox has) : - R0aDefaultInsertPos = -1; - for (i = 0; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - if (!Cur->IsArithmetic()) - continue; - - // Make sure if we insert at all, it'll be after the DEF's : - if (R0aDefaultInsertPos < 0) - R0aDefaultInsertPos = i; - - // First, check if r0.a is read by this opcode : - if (Cur->ReadsFromRegister(PARAM_R, 0, MASK_A)) - { - R0aDefaultInsertPos = i; - break; - } - - // If this opcode writes to r0.a, we're done : - if (Cur->WritesToRegister(PARAM_R, 0, MASK_A)) - return false; - } - - if (R0aDefaultInsertPos >= 0) - { - // Insert a new opcode : MOV r0.a, t0.a - NewIns.Initialize(PO_MOV); - NewIns.Output[0].SetRegister(PARAM_R, 0, MASK_A); - NewIns.Parameters[0] = NewIns.Output[0]; - NewIns.Parameters[0].Type = PARAM_T; - NewIns.CommentString = "Inserted r0.a default"; - InsertIntermediate(&NewIns, R0aDefaultInsertPos); - return true; - } - return false; -} // FixMissingR0a - -bool PSH_XBOX_SHADER::FixMissingR1a() -// On the Xbox, the alpha portion of the R1 register is initialized to -// the alpha component of texture 1 if texturing is enabled for texture 1 : -{ - int R1aDefaultInsertPos; - int i; - PPSH_INTERMEDIATE_FORMAT Cur; - PSH_INTERMEDIATE_FORMAT NewIns = {}; - - // Detect a read of r1.a without a write, as we need to insert a "MOV r1.a, t1.a" as default (like the xbox has) : - R1aDefaultInsertPos = -1; - for (i = 0; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - if (!Cur->IsArithmetic()) - continue; - - // First, check if r1.a is read by this opcode : - if (Cur->ReadsFromRegister(PARAM_R, 1, MASK_A)) - { - // Make sure if we insert at all, it'll be after the DEF's : - if (R1aDefaultInsertPos < 0) - R1aDefaultInsertPos = i; - - R1aDefaultInsertPos = i; - break; - } - - // If this opcode writes to r1.a, we're done : - if (Cur->WritesToRegister(PARAM_R, 1, MASK_A)) - return false; - } - - if (R1aDefaultInsertPos >= 0) - { - // Insert a new opcode : MOV r1.a, t1.a - NewIns.Initialize(PO_MOV); - NewIns.Output[0].SetRegister(PARAM_R, 1, MASK_A); - NewIns.Parameters[0] = NewIns.Output[0]; - NewIns.Parameters[0].Type = PARAM_T; - NewIns.CommentString = "Inserted r1.a default"; - InsertIntermediate(&NewIns, R1aDefaultInsertPos); - return true; - } - - return false; -} // FixMissingR1a - - -bool PSH_XBOX_SHADER::FixCoIssuedOpcodes() -{ - DWORD PrevMask; - PSH_OPCODE PrevOpcode; - int i; - PPSH_INTERMEDIATE_FORMAT Cur; -// int j; - bool NewIsCombined; - - bool Result = false; - -/* - // TODO : Shift independent .a instructions up or down so the alpha write combiner can be used more often : - for (i = 0; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - // Is this an arithmetic opcode? - if (Cur->Opcode > PO_TEX) // TODO : Use IsArithmetic(), which checks >= PO_ADD? - { - // Does this instruction write solely to Alpha? - if (Cur->Output[0].Mask == MASK_A) - { - // Look at prior instructions : - for (j = i - 1; j > 0; j--) - { - // Because "dp3" needs the color/vector pipeline, no color component outputing opcode can be co-issued with it : - if (Intermediate[j].Opcode == PO_DP3) - break; - - // TODO : Test that none of the inputs of 'Cur' are written to (break otherwise) - - // Does a prior instruction skip alpha? - if ((Intermediate[j].Output[0].Mask & MASK_A) == 0) - { - // TODO : Move instruction up to right below j - // Result = true; - // break; - } - } - } - } - } -*/ - - // Update IsCombined flags : - // Start with Alpha, so the first opcode doesn't become a write-combined opcode (which isn't possible) : - PrevMask = MASK_A; - PrevOpcode = PO_COMMENT; - for (i = 0; i < IntermediateCount; i++) - { - Cur = &(Intermediate[i]); - // Is this an arithmetic opcode? - if (Cur->Opcode > PO_TEX) // TODO : Use IsArithmetic(), which checks >= PO_ADD? - { - // Set IsCombined only when previous opcode doesn't write to Alpha, while this opcode writes only to Alpha : - NewIsCombined = (PrevOpcode != PO_DP3) - && ((PrevMask & MASK_A) == 0) - && (Cur->Output[0].Mask == MASK_A); - - if (Cur->IsCombined != NewIsCombined) - { - Cur->IsCombined = NewIsCombined; - Result = true; - } - - PrevMask = Cur->Output[0].Mask; - PrevOpcode = Cur->Opcode; - } - } - return Result; -} - -// TODO : FocusBlur sample needs a zero in 'cnd' opcode - -/* RPSRegisterObject */ - -void RPSRegisterObject::Decode(uint8 Value, bool aIsAlpha) -{ - IsAlpha = aIsAlpha; - Reg = (PS_REGISTER)(Value); -} - -std::string RPSRegisterObject::DecodedToString() -{ - assert((PS_REGISTER_DISCARD <= Reg) && (Reg <= PS_REGISTER_EF_PROD)); - - return PS_RegisterStr[Reg + 1]; -} - -/* RPSInputRegister */ - -void RPSInputRegister::Decode(uint8 Value, bool aIsAlpha) -{ - RPSRegisterObject::Decode(Value & PS_NoChannelMask, aIsAlpha); - - Channel = (PS_CHANNEL)(Value & PS_CHANNEL_ALPHA); - InputMapping = (PS_INPUTMAPPING)(Value & 0xe0); - - // Remove the above flags from the register : - Reg = (PS_REGISTER)(Reg & 0xf); - - // Check if the input Register is ZERO, in which case we want to allow the extended registers : - if (Reg == PS_REGISTER_ZERO) - { - switch (InputMapping) { - case PS_REGISTER_ONE: case PS_REGISTER_NEGATIVE_ONE: case PS_REGISTER_ONE_HALF: case PS_REGISTER_NEGATIVE_ONE_HALF: - // These input mapping have their own register - keep these in 'Reg', so we can check for them : - Reg = (PS_REGISTER)(InputMapping); - break; - - case PS_INPUTMAPPING_EXPAND_NEGATE: - // This case has no separate PS_REGISTER define, but when applied to zero, also results in one : - Reg = PS_REGISTER_ONE; - break; - } - } -} - -std::string RPSInputRegister::DecodedToString() -{ - std::string Result; - std::string InputMappingStr = ""; - switch (Reg) { - case PS_REGISTER_ZERO: - { - Result = PS_RegisterStr[0]; - return Result; - } - case PS_REGISTER_ONE: - Result = PS_RegisterStr[0x11]; - break; - case PS_REGISTER_NEGATIVE_ONE: - Result = PS_RegisterStr[0x12]; - break; - case PS_REGISTER_ONE_HALF: - Result = PS_RegisterStr[0x13]; - break; - case PS_REGISTER_NEGATIVE_ONE_HALF: - Result = PS_RegisterStr[0x14]; - break; - default: - Result = RPSRegisterObject::DecodedToString(); - InputMappingStr = " | " + PS_InputMappingStr[(InputMapping >> 5) & 7]; - } - - // Render the channel as a string : - Result = Result + " | " + PS_ChannelStr[(Channel > 0) ? /*Alpha*/2 : (IsAlpha ? /*Blue*/1 : /*RGB*/0)] + InputMappingStr; - return Result; -} - -/* RPSCombinerOutput */ - -void RPSCombinerOutput::Decode(uint8 Value, DWORD PSInputs, bool aIsAlpha) -{ - RPSRegisterObject::Decode(Value, aIsAlpha); - - // Decode PSAlphaInputs / PSRGBInputs : - Input1.Decode((PSInputs >> 8) & 0xFF, aIsAlpha); - Input2.Decode((PSInputs >> 0) & 0xFF, aIsAlpha); -} - -/* RPSCombinerStageChannel */ - -void RPSCombinerStageChannel::Decode(DWORD PSInputs, DWORD PSOutputs, bool aIsAlpha/* = false*/) -{ - // Get the combiner output flags : - CombinerOutputFlags = (PS_COMBINEROUTPUT)(PSOutputs >> 12); - - // Decompose the combiner output flags : - OutputSUM.OutputAB.DotProduct = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) > 0; // false=Multiply, true=DotProduct - OutputSUM.OutputCD.DotProduct = (CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0; // false=Multiply, true=DotProduct - - if (!aIsAlpha) - { - OutputSUM.OutputAB.BlueToAlpha = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) > 0; // false=Alpha-to-Alpha, true=Blue-to-Alpha - OutputSUM.OutputCD.BlueToAlpha = (CombinerOutputFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) > 0; // false=Alpha-to-Alpha, true=Blue-to-Alpha - } - - // Decode PSAlphaOutputs / PSRGBOutputs and PSAlphaInputs / PSRGBInputs : - OutputSUM.OutputAB.Decode((PSOutputs >> 4) & 0xF, (PSInputs >> 16) & 0xFFFF, aIsAlpha); - OutputSUM.OutputCD.Decode((PSOutputs >> 0) & 0xF, (PSInputs >> 0) & 0xFFFF, aIsAlpha); - OutputSUM.Decode((PSOutputs >> 8) & 0xF, aIsAlpha); - - AB_CD_SUM = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_CD_MUX) == 0; // true=AB+CD, false=MUX(AB,CD) based on R0.a -} - -// Note : On a hardware level, there are only 4 pixel shaders instructions present in the Nvidia NV2A GPU : -// - xdd (dot/dot/discard) > calculating AB=A.B and CD=C.D -// - xdm (dot/mul/discard) > calculating AB=A.B and CD=C*D -// - xmmc (mul/mul/mux) > calculating AB=A*B and CD=C*D and Mux=AB?CD -// - xmma (mul/mul/sum) > calculating AB=A*B and CD=C*D and Sum=AB+CD -// (One of the implications is, that once a dot-product is issued, no Sum or Mux operation is possible.) -// All other instructions (mov, add, sub, mul, lrp, dp3) are compiled into one of these 4 using varying arguments. -// All 4 instruction specify up to three output registers, all of which must be unique (or be discarded). -// -// Apart from the r0,r1 and t0-t3 registers, the NV2A allows writing to the v0,v1 (this conflicts with PS.1.3!) -// -// The precision of registers is also different; On the Xbox, all 4 color components (RGBA) for constant registers -// range from 0.0 to 1.0 (with 8 bits of precision), while all other registers (r, t and v) range from -1.0 to 1.0. -// -// This is different from native PS.1.3 in which constant registers suddenly have a range -1.0 to 1.0, but vertex -// registers (v0 and v1) range from 0.0 to 1.0 instead, and the temporary and texture registers have a range -// from negative 'MaxPixelShaderValue' to positive 'MaxPixelShaderValue', which value must at least be 1.0 -// (but depending on hardware capabilities can be higher). -// -// TODO : Correct emulation should correct these differences; The range of constant-registers must be converted -// from 0.0-1.0 to -1.0-1.0, and vertex-registers must be converted from -1.0..1.0 to 0.0..1.0 (if anything like -// that is at all possible!) -// -// register | Xbox range | Native range | Xbox | Native | -// C0..C8 | 0.0 - 1.0 ! -1.0 - 1.0 | readonly | readonly | -// R0..R1 | -1.0 - 1.0 | -1.0 - 1.0 | writeable | writeable | -// T0..T3 | -1.0 - 1.0 | -1.0 - 1.0 | writeable | writeable | -// V0..V1 | -1.0 - 1.0 ! 0.0 - 1.0 | writeable ! readonly | -// -// "-C0_bias_x2" shifts range from [ 0..1] to [-1..1] -// "-V0_bias_d2" shifts range from [-1..1] to [ 0..1] - -/* RPSFinalCombiner */ - -void RPSFinalCombiner::Decode(const DWORD PSFinalCombinerInputsABCD, const DWORD PSFinalCombinerInputsEFG, const DWORD PSFinalCombinerConstants) -{ - InputA.Decode((PSFinalCombinerInputsABCD >> 24) & 0xFF, /*aIsAlpha=*/false); - InputB.Decode((PSFinalCombinerInputsABCD >> 16) & 0xFF, /*aIsAlpha=*/false); - InputC.Decode((PSFinalCombinerInputsABCD >> 8) & 0xFF, /*aIsAlpha=*/false); - InputD.Decode((PSFinalCombinerInputsABCD >> 0) & 0xFF, /*aIsAlpha=*/false); - - InputE.Decode((PSFinalCombinerInputsEFG >> 24) & 0xFF, /*aIsAlpha=*/false); - InputF.Decode((PSFinalCombinerInputsEFG >> 16) & 0xFF, /*aIsAlpha=*/false); - InputG.Decode((PSFinalCombinerInputsEFG >> 8) & 0xFF, /*aIsAlpha=*/false); - FinalCombinerFlags = (PS_FINALCOMBINERSETTING)((PSFinalCombinerInputsEFG >> 0) & 0xFF); - - FinalCombinerC0Mapping = (PSFinalCombinerConstants >> 0) & 0xF; - FinalCombinerC1Mapping = (PSFinalCombinerConstants >> 4) & 0xF; - dwPS_GLOBALFLAGS = (PSFinalCombinerConstants >> 8) & 0x1; -} - -void XTL_DumpPixelShaderToFile(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ - static int PshNumber = 0; // Keep track of how many pixel shaders we've attempted to convert. - // Don't dump more than 100 shaders, to prevent cluttering the filesystem : - if (PshNumber >= 100) - return; - - char szPSDef[32]; - - sprintf(szPSDef, "PSDef%.03d.txt", PshNumber++); - FILE* out = fopen(szPSDef, "w"); - if (out) - { - fprintf(out, PSH_XBOX_SHADER::OriginalToString(pPSDef).c_str()); - fclose(out); - } -} - -PSH_RECOMPILED_SHADER XTL_EmuRecompilePshDef(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ - uint32 PSVersion = D3DPS_VERSION(1, 3); // Use pixel shader model 1.3 by default - -#if 0 // Once PS.1.4 can be generated, enable this : - extern XTL::D3DCAPS g_D3DCaps; - - PSVersion = g_D3DCaps.PixelShaderVersion; -#endif - // TODO : Make the pixel shader version configurable - - PSH_XBOX_SHADER PSH = {}; - PSH.SetPSVersion(PSVersion); - return PSH.Decode(pPSDef); -} - -// From Dxbx uState.pas : - -PSH_RECOMPILED_SHADER DxbxRecompilePixelShader(XTL::X_D3DPIXELSHADERDEF *pPSDef) -{ -static const - char *szDiffusePixelShader = - "ps.1.0\n" - "tex t0\n" - "mov r0, t0\n"; - std::string ConvertedPixelShaderStr; - DWORD hRet; - XTL::LPD3DXBUFFER pShader; - XTL::LPD3DXBUFFER pErrors; - DWORD *pFunction; - - // Attempt to recompile PixelShader - PSH_RECOMPILED_SHADER Result = XTL_EmuRecompilePshDef(pPSDef); - ConvertedPixelShaderStr = Result.NewShaderStr; - - // assemble the shader - pShader = nullptr; - pErrors = nullptr; - hRet = D3DXAssembleShader( - ConvertedPixelShaderStr.c_str(), - ConvertedPixelShaderStr.length(), -#ifdef CXBX_USE_D3D9 - /*pDefines=*/nullptr, - /*pInclude=*/nullptr, -#endif - /*Flags=*/0, // D3DXASM_DEBUG, -#ifndef CXBX_USE_D3D9 - /*ppConstants=*/NULL, -#endif - /*ppCompiledShader=*/&pShader, - /*ppCompilationErrors*/&pErrors); - - if (hRet != D3D_OK) - { - EmuWarning("Could not create pixel shader"); - EmuWarning(std::string((char*)pErrors->GetBufferPointer(), pErrors->GetBufferSize()).c_str()); - - printf(ConvertedPixelShaderStr.c_str()); - - hRet = D3DXAssembleShader( - szDiffusePixelShader, - strlen(szDiffusePixelShader), -#ifdef CXBX_USE_D3D9 - /*pDefines=*/nullptr, - /*pInclude=*/nullptr, -#endif - /*Flags=*/D3DXASM_SKIPVALIDATION, -#ifndef CXBX_USE_D3D9 - /*ppConstants=*/NULL, -#endif - /*ppCompiledShader=*/&pShader, - /*ppCompilationErrors*/&pErrors); - - if (hRet != D3D_OK) - XTL::CxbxKrnlCleanup("Cannot fall back to the most simple pixel shader!"); - - EmuWarning("We're lying about the creation of a pixel shader!"); - } - - if (pShader) - { - pFunction = (DWORD*)(pShader->GetBufferPointer()); - if (hRet == D3D_OK) { - // redirect to windows d3d - hRet = g_pD3DDevice->CreatePixelShader - ( - pFunction, -#ifdef CXBX_USE_D3D9 - (XTL::IDirect3DPixelShader9**)(&(Result.ConvertedHandle)) //fixme -#else - /*out*/&(Result.ConvertedHandle) -#endif - ); - - if (hRet != D3D_OK) { - extern const char *D3DErrorString(HRESULT hResult); - - printf(D3DErrorString(hRet)); - } - } - - // Dxbx note : We must release pShader here, else we would have a resource leak! - pShader->Release(); - pShader = nullptr; - } - - // Dxbx addition : We release pErrors here (or it would become a resource leak!) - if (pErrors) - { - pErrors->Release(); - pErrors = nullptr; - } - return Result; -} // DxbxRecompilePixelShader - -// TODO : Initialize this : -DWORD *XTL::EmuMappedD3DRenderState[X_D3DRS_UNSUPPORTED]; // 1 extra for the unsupported value - -std::vector g_RecompiledPixelShaders; - -// Temporary... -DWORD XTL::TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSTEXTUREMODES + 1]; - -VOID XTL::DxbxUpdateActivePixelShader() // NOPATCH -{ - XTL::X_D3DPIXELSHADERDEF *pPSDef; - PPSH_RECOMPILED_SHADER RecompiledPixelShader; - DWORD ConvertedPixelShaderHandle; - DWORD CurrentPixelShader; - int i; - DWORD Register_; - XTL::D3DCOLOR dwColor; - XTL::D3DXCOLOR fColor; - - HRESULT Result = D3D_OK; - - // TODO: Is this even right? The first RenderState is PSAlpha, - // The pixel shader is stored in pDevice->m_pPixelShader - // For now, we still patch SetPixelShader and read from there... - //DWORD *XTL_D3D__RenderState = XTL::EmuMappedD3DRenderState[0]; - //pPSDef = (XTL::X_D3DPIXELSHADERDEF*)(XTL_D3D__RenderState); - - // Use the pixel shader stored in TemporaryPixelShaderRenderStates rather than the set handle - // This allows changes made via SetRenderState to actually take effect! - // TODO: Remove this and read directly from XTL_D3D__RenderState when all RenderState and Pixel Shader functions are unpatched - // NOTE: PSTextureModes is in a different location in the X_D3DPIXELSHADERFEF than in Render State mappings - // All other fields are the same. We cast TemporaryPixelShaderRenderStates to a pPSDef for these fields, but - // manually read from TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES) for that one field. - pPSDef = g_D3DActivePixelShader != nullptr ? (XTL::X_D3DPIXELSHADERDEF*)(&TemporaryPixelShaderRenderStates[0]) : nullptr; - - if (pPSDef != nullptr) - { - RecompiledPixelShader = nullptr; - - // Now, see if we already have a shader compiled for this declaration : - for (auto it = g_RecompiledPixelShaders.begin(); it != g_RecompiledPixelShaders.end(); ++it) { - // Only compare parts that form a unique shader (ignore the constants and Direct3D8 run-time fields) : - if ((memcmp(&(it->PSDef.PSAlphaInputs[0]), &(pPSDef->PSAlphaInputs[0]), (8 + 2) * sizeof(DWORD)) == 0) - && (memcmp(&(it->PSDef.PSAlphaOutputs[0]), &(pPSDef->PSAlphaOutputs[0]), (8 + 8 + 3 + 8 + 4) * sizeof(DWORD)) == 0)) { - RecompiledPixelShader = &(*it); - break; - } - } - - // If none was found, recompile this shader and remember it : - if (RecompiledPixelShader == nullptr) { - // Recompile this pixel shader : - g_RecompiledPixelShaders.push_back(DxbxRecompilePixelShader(pPSDef)); - RecompiledPixelShader = &g_RecompiledPixelShaders.back(); - } - - // Switch to the converted pixel shader (if it's any different from our currently active - // pixel shader, to avoid many unnecessary state changes on the local side). - ConvertedPixelShaderHandle = RecompiledPixelShader->ConvertedHandle; - -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->GetPixelShader(/*out*/(IDirect3DPixelShader9**)(&CurrentPixelShader)); -#else - g_pD3DDevice->GetPixelShader(/*out*/&CurrentPixelShader); -#endif - if (CurrentPixelShader != ConvertedPixelShaderHandle) -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetPixelShader((IDirect3DPixelShader9*)ConvertedPixelShaderHandle); -#else - g_pD3DDevice->SetPixelShader(ConvertedPixelShaderHandle); -#endif - - // Note : We set the constants /after/ setting the shader, so that any - // constants in the shader declaration can be overwritten (this will be - // needed for the final combiner constants at least)! - -/* This must be done once we somehow forward the vertex-shader oFog output to the pixel shader FOG input register : - We could use the unused oT4.x to output fog from the vertex shader, and read it with 'texcoord t4' in pixel shader! - // Disable native fog if pixel shader is said to handle it : - if ((RecompiledPixelShader.PSDef.PSFinalCombinerInputsABCD > 0) - || (RecompiledPixelShader.PSDef.PSFinalCombinerInputsEFG > 0)) - { - g_pD3DDevice.SetRenderState(D3DRS_FOGENABLE, BOOL_FALSE); - } -*/ - // Set constants, not based on g_PixelShaderConstants, but based on - // the render state slots containing the pixel shader constants, - // as these could have been updated via SetRenderState or otherwise : - for (i = 0; i < PSH_XBOX_CONSTANT_MAX; i++) - { - if (RecompiledPixelShader->ConstInUse[i]) - { - // Read the color from the corresponding render state slot : - // TODO: These should read from EmuMappedD3DRenderState, but it doesn't exist yet - // The required code needs o be ported from Wip_LessVertexPatching or Dxbx - switch (i) { - case PSH_XBOX_CONSTANT_FOG: - //dwColor = *XTL::EmuMappedD3DRenderState[XTL::X_D3DRS_FOGCOLOR] | 0xFF000000; - // Note : FOG.RGB is correct like this, but FOG.a should be coming - // from the vertex shader (oFog) - however, D3D8 does not forward this... - g_pD3DDevice->GetRenderState(D3DRS_FOGCOLOR, &dwColor); - break; - case PSH_XBOX_CONSTANT_FC0: - //dwColor = *XTL::EmuMappedD3DRenderState[XTL::X_D3DRS_PSFINALCOMBINERCONSTANT0]; - dwColor = TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSFINALCOMBINERCONSTANT0]; - break; - case PSH_XBOX_CONSTANT_FC1: - //dwColor = *XTL::EmuMappedD3DRenderState[XTL::X_D3DRS_PSFINALCOMBINERCONSTANT1]; - dwColor = TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSFINALCOMBINERCONSTANT1]; - break; - default: - //dwColor = *XTL::EmuMappedD3DRenderState[XTL::X_D3DRS_PSCONSTANT0_0 + i]; - dwColor = TemporaryPixelShaderRenderStates[XTL::X_D3DRS_PSCONSTANT0_0 + i]; - break; - } - - // Convert it back to 4 floats : - fColor = dwColor; - // Read the register we can use on PC : - Register_ = RecompiledPixelShader->ConstMapping[i]; - // TODO : Avoid the following setter if it's no different from the previous update (this might speed things up) - // Set the value locally in this register : -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetPixelShaderConstantF -#else - g_pD3DDevice->SetPixelShaderConstant -#endif - ( - Register_, - (PixelShaderConstantType*)(&fColor), - 1 - ); - } - } - } - else - { - ConvertedPixelShaderHandle = 0; -#ifdef CXBX_USE_D3D9 - g_pD3DDevice->SetPixelShader((IDirect3DPixelShader9*)ConvertedPixelShaderHandle); -#else - g_pD3DDevice->SetPixelShader(ConvertedPixelShaderHandle); -#endif - } -} - -// End of Dxbx code - -#define REVEL8N_PIXEL_SHADER_CHANGES - -// help functions -char *pCodeBuffer=NULL; - -void WriteCode(const char *str, ...) -{ - char szBuffer[256]; - va_list argp; - - va_start(argp, str); - vsprintf(szBuffer, str, argp); - va_end(argp); - - //printf("%s", szBuffer); - if(pCodeBuffer) - strcat(pCodeBuffer, szBuffer); -} - -void InsertString(char *szStr, int iOffset, char *szInsert, int iInsertLen, int iRemoveLen); - -inline void HandleInputOutput -( - DWORD dwInput, - DWORD dwOutput, - BOOL bAlpha, - int iCStage, - BOOL bUniqueC0, - BOOL bUniqueC1, - int *iPSC0, - int *iPSC1, - - BOOL bGlobalRGBA, - - BOOL bFinalCombiner -); - -inline void GetRegister -( - WORD wRegister, - char *szRegister, - BOOL bUniqueC0, - BOOL bUniqueC1, - int iCStage, - int *pPSC0, - int *pPSC1 -); - -inline void GetInputMapping(WORD wInputMapping, char *szInputMapping, char *szInputMappingAfter, char *szConst); -inline void GetChannel(WORD wInputChannel, char *szInput, BOOL bAlpha, BOOL bGlobalRGBA); - -inline void GetOutputFlags -( - WORD wOutputFlags, - char *szInstMod, - char *szABOp, - char *szCDOp, - char *szABCDOp, - - BOOL *bAB_BA, - BOOL *bCD_BA, - - BOOL *bShl1Bias, - BOOL *bBias -); - -//inline BOOL CheckOpForMov(char *szOp, char *szInputs1, char *szInput2, char *szRegInput); -inline BOOL OptimizeOperation -( - char *szOp, - char *szOp1, - - char *szOp2, - char *szMod, - - char *szInputAB1, - char *szInputAB2, - - char *szInputCD1, - char *szInputCD2, - - char *szConstRegAB1, - char *szConstRegAB2, - char *szConstRegCD1, - char *szConstRegCD2, - - char *szOutAB, - char *szOutCD, - char *szABCDOutput, - - char *szCommand -); - -inline void ClearConstRegVars(); -inline void CorrectConstToReg(char *szConst, int *pPSC0, int *pPSC1); - -int iPreRunLen=0; - -// This is set to true if an operation tries to read from r0 -// before r0 was written, in that case we do the same as the xbox -// we write the value of t0.a to r0 ;-) -BOOL bR0WAccess=FALSE; -BOOL bR0Written=FALSE; -BOOL bR0AWritten=FALSE; -/* -BOOL bR1WAccess=FALSE; -BOOL bR1AWAccess=FALSE; -BOOL bR1RGBWAccess=FALSE; - -BOOL bR1AWritten=FALSE; -BOOL bR1RGBWritten=FALSE; -BOOL bR1Written=FALSE; -*/ -BOOL bR0AlphaOutput = FALSE; - -BOOL bLastOpRGB = FALSE; - -BOOL bEFProduct = FALSE; -BOOL bV1R0Reg = FALSE; - -#define DEF_VAR_TABLE_LEN 7 -char szVar[][10] = -{ - "r0", - "r1", - "t0", - "t1", - "t2", - "t3", - "t4" -}; - -inline void HandleInputOutput -( - DWORD dwInput, - DWORD dwOutput, - BOOL bAlpha, - int iCStage, - BOOL bUniqueC0, - BOOL bUniqueC1, - int *iPSC0, - int *iPSC1, - - BOOL bGlobalRGBA, - - BOOL bFinalCombiner -) -{ - // INPUTS - if(bFinalCombiner) printf("\npPSD.PSFinalCombinerInputsABCD = PS_COMBINERINPUTS(\n"); - else if(bAlpha) printf("\npPSD.PSAlphaInputs[%d] = PS_COMBINERINPUTS(\n", iCStage); - else printf("\npPSD.PSRGBInputs[%d] = PS_COMBINERINPUTS(\n", iCStage); - - WORD wCombinerInputs[4]; // 0=a, 1=b, 2=c, 3=d - wCombinerInputs[0] = (WORD) ((dwInput>>24) & 0xFF); - wCombinerInputs[1] = (WORD) ((dwInput>>16) & 0xFF); - wCombinerInputs[2] = (WORD) ((dwInput>> 8) & 0xFF); - wCombinerInputs[3] = (WORD) ( dwInput & 0xFF); - - char szInput[4][20] = {0}; - char szConst[4][20] = {0}; - char szInputMapping[4][20] = {0}; - char szInputMappingAfter[4][20] = {0}; - char szChannels[4][5] = {0}; - - // Go through inputs - int i=0; - for(i=0; i<4; i++) - { - szInput[i][0]=0x00; // Fast way to zero a string ;-) - szConst[i][0]=0x00; - szInputMapping[i][0]=0x00; - szInputMappingAfter[i][0]=0x00; - szChannels[i][0]=0x00; - - GetRegister(wCombinerInputs[i] & 0xF, szInput[i], bUniqueC0, bUniqueC1, iCStage, iPSC0, iPSC1); - - if(strcmp(szInput[i], "r0")==0) - { - if(!bR0AWritten) - strcpy(szInput[i], "t0"); - - if(!bR0Written) { - strcpy(szInput[i], "t0"); - //bR0WAccess=TRUE; - } - } - - printf(" | "); - GetInputMapping(wCombinerInputs[i] & 0x1E0, szInputMapping[i], szInputMappingAfter[i], szConst[i]); - printf(" | "); - GetChannel(wCombinerInputs[i] & 0x10, szChannels[i], bAlpha, bGlobalRGBA); - printf(",\n"); - - if((wCombinerInputs[i] & 0xF)==0x00) - szInput[i][0]=0x00; - - // 6928: check this as I doubt whether it works really like that - /*if(strcmp(szInput[i], "r1")==0) - { - // DbgPrintf("channel: %s\n", szChannels[i]); - // Sleep(3000); - - if((strcmp(szChannels[i], ".a")==0) && (!bR1AWritten)) { - bR1AWAccess=TRUE; - - strcpy(szInput[i], " t1"); - } else if((strcmp(szChannels[i], ".rgb")==0) && (!bR1RGBWritten)) { - bR1RGBWAccess=TRUE; - - strcpy(szInput[i], " t1"); - } else if(!bR1Written) { - bR1WAccess=TRUE; - - strcpy(szInput[i], " t1"); - } - - if(bR1AWAccess && bR1RGBWAccess) - bR1WAccess=TRUE; - - //if(bR1AWAccess || bR1RGBWAccess) - // strcpy(szInput[i], "t1"); - }*/ - - //printf("\n*** szInput[%d]: %s\n", i, szInput[i]); - } - - // Input stuff - BOOL bInput[4] = {0, 0, 0, 0}; - if(szInput[0][0]) bInput[0]=TRUE; - if(szInput[1][0]) bInput[1]=TRUE; - if(szInput[2][0]) bInput[2]=TRUE; - if(szInput[3][0]) bInput[3]=TRUE; - -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - // Correct param if a constant is used! - if(!bInput[0]) - CorrectConstToReg(szConst[0], iPSC0, iPSC1); - if(!bInput[1]) - CorrectConstToReg(szConst[1], iPSC0, iPSC1); - if(!bInput[2]) - CorrectConstToReg(szConst[2], iPSC0, iPSC1); - if(!bInput[3]) - CorrectConstToReg(szConst[3], iPSC0, iPSC1); - - bool bEmptyChannel = false; -#endif - - char szCompleteInput[4][20] = {0}; - for(i=0; i<4; i++) - { - strcpy(szCompleteInput[i], szInputMapping[i]); -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - if(bInput[i]) - { -#endif - strcat(szCompleteInput[i], szInput[i]); -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - bEmptyChannel = bEmptyChannel || (szChannels[i][0] == 0); - } - else - strcat(szCompleteInput[i], &szConst[i][4]); -#endif - strcat(szCompleteInput[i], szInputMappingAfter[i]); - strcat(szCompleteInput[i], szChannels[i]); - } - - printf(");\n"); - - if(!bFinalCombiner) - { - // OUTPUTS - if(bAlpha) printf("\npPSD.PSAlphaOutputs[%d] = PS_COMBINEROUTPUTS(\n", iCStage); - else printf("\npPSD.PSRGBOutputs[%d] = PS_COMBINEROUTPUTS(\n", iCStage); - - WORD wCombinerOutputs[3]; // 0=d0 (ab), 1=d1 (cd), 2=d2 (mux_sum) - wCombinerOutputs[0] = (WORD) ((dwOutput>> 4) & 0xF); - wCombinerOutputs[1] = (WORD) ( dwOutput & 0xF); - wCombinerOutputs[2] = (WORD) ((dwOutput>> 8) & 0xF); - WORD wCombinerOutputFlags = (WORD) ((dwOutput>>12) & 0xFF); - - char szOutput[3][10] = {0}; - char szOutputMod[10]="\0"; - - char szABOp[10]="\0"; - char szCDOp[10]="\0"; - char szABCDOp[10]="\0"; - - BOOL bAB_B2A; - BOOL bCD_B2A; - - BOOL bR0Now = FALSE; - BOOL bR0ANow = FALSE; - BOOL bVAccess[3] = {0,0,0}; - - BOOL bOpRGB_Current = FALSE; - BOOL bCurrOpRealAlpha = FALSE; - - // Go through outputs - for(i=0; i<3; i++) - { - szOutput[i][0]=0x00; // Fast way to zero a string ;-) - - GetRegister(wCombinerOutputs[i], szOutput[i], bUniqueC0, bUniqueC1, iCStage, iPSC0, iPSC1); - if(strcmp(szOutput[i], "r0")==0) - { - bR0Now=TRUE; - - // this checks for output to r0.a - if(bGlobalRGBA || (!bGlobalRGBA && bAlpha)) - bR0AlphaOutput=TRUE; - } - - if((strcmp(szOutput[i], "v0")==0) || (strcmp(szOutput[i], "v1")==0)) { bVAccess[i] = TRUE; } - - /*BOOL bR1_Written = FALSE; - if(strcmp(szOutput[i], "r1")==0) - bR1_Written=TRUE;*/ - - // check channel! - if(!bGlobalRGBA && bAlpha) - { - strcat(szOutput[i], ".a"); - bCurrOpRealAlpha = TRUE; - - if(bR0Now) - bR0ANow=TRUE; - - /*if(bR1_Written) - bR1AWritten=TRUE;*/ - } - else if(!bGlobalRGBA && !bAlpha -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - && !bEmptyChannel -#endif - ) - { - strcat(szOutput[i], ".rgb"); - - if(wCombinerOutputs[i]) - bOpRGB_Current = TRUE; - - /*if(bR1_Written) - bR1RGBWritten=TRUE;*/ - } - else - { - /*if(bR1_Written) - bR1Written=TRUE;*/ - - if(bR0Now) - bR0ANow=TRUE; - } - - printf(",\n"); - - if(wCombinerOutputs[i]==0x00) - szOutput[i][0]=0x00; - - //printf("\n*** szOutput[%d]: %s\n", i, szOutput[i]); - } - - BOOL bBias=FALSE; - BOOL bSh1Bias=FALSE; - - GetOutputFlags( - wCombinerOutputFlags, - szOutputMod, - - szABOp, - szCDOp, - szABCDOp, - - &bAB_B2A, - &bCD_B2A, - - &bSh1Bias, - &bBias); - - if(bR0Now) - bR0Written=TRUE; - - if(bR0ANow) - bR0AWritten=TRUE; - - printf(");\n"); - - // Find output for the operations - char szOut[10]="\0"; - char szOut1[10]="\0"; - - //printf("|****| %s |****|\n", szOutput[1]); - - if(szOutput[0][0]) - strcpy(szOut, szOutput[0]); - if(szOutput[1][0]) - strcpy(szOut1, szOutput[1]); - -#ifndef REVEL8N_PIXEL_SHADER_CHANGES - if(szOutput[2][0]) - { - /* - //EmuWarningMsg("THIS IS WRONG, FIX ME!"); - //if(!szOutput[1][0]) - // strcpy(szOut1, szOutput[2]); - DbgPrintf("(!szOutput[0][0] || !szOutput[1][0]) && szOutput[2][0] = TRUE!\n"); - - BOOL bUsable=TRUE; - for(i=2; i<4; i++) - { - if((strcmp(szOutput[2], szInput[i])==0) || (strcmp(szOutput[2], szOut1)==0)) { - bUsable=FALSE; - } - } - if(bUsable && !szOutput[0][0]) - { - - strcpy(szOut, szOutput[2]); - - DbgPrintf("BUsable = TRUE, new output: %s\n", szOut); - - } - else { - printf("!WARNING!: The operation uses the output register also as input!" - "Trying to find a free output register. It is possible that the pixel shader " - "will generate garbage because the new free one contains data used " - "in an other comming operation!\n\n"); - - for(int j=0; j> 24) & 0xFF); - wEFG[1] = (WORD) ((dwOutput >> 16) & 0xFF); - wEFG[2] = (WORD) ((dwOutput >> 8) & 0xFF); - - BOOL bInputEFG[3] = {0, 0, 0}; - char szCompleteInputEFG[3][10]; - - char szInputEFG[3][10]; - char szInputMappingEFG[3][10]; - char szInputMappingAfterEFG[3][10]; - char szConstEFG[3][10]; - - for(i=0; i<3; i++) - { - szInputEFG[i][0]=0x00; - szInputMappingEFG[i][0]=0x00; - szInputMappingAfterEFG[i][0]=0x00; - szConstEFG[i][0]=0x00; - - GetRegister(wEFG[i] & 0xF, szInputEFG[i], bUniqueC0, bUniqueC1, 0, iPSC0, iPSC1); - printf(" | "); - GetInputMapping(wEFG[i] & 0x1E0, szInputMappingEFG[i], szInputMappingAfterEFG[i], szConstEFG[i]); - printf(" | "); - GetChannel(wEFG[i] & 0x10, szInputEFG[i], bAlpha, FALSE); - printf(", \n"); - - strcpy(szCompleteInputEFG[i], szInputMappingEFG[i]); - strcat(szCompleteInputEFG[i], szInputEFG[i]); - strcat(szCompleteInputEFG[i], szInputMappingAfterEFG[i]); - - if(szInputEFG[i][0]) - bInputEFG[i]=TRUE; - else - { - // add that constant as a reg - CorrectConstToReg(szConstEFG[i], iPSC0, iPSC1); - } - } - - if(dwV1R0_EFProd_Flags & 0x20) - printf("PS_FINALCOMBINERSETTINGS_COMPLEMENT_R0"); - else if(dwV1R0_EFProd_Flags & 0x40) - printf("PS_FINALCOMBINERSETTINGS_COMPLEMENT_V1"); - else if(dwV1R0_EFProd_Flags & 0x80) - printf("PS_FINALCOMBINERSETTINGS_CLAMP_SUM"); - else - printf("0"); - - printf(");\n"); - - if (bV1R0Reg) - { - char sMod[10] = {0}; - char sV1[10] = {0}; - char sR0[10] = {0}; - if(dwV1R0_EFProd_Flags & 0x20) - strcpy(sR0, "1-"); - else if(dwV1R0_EFProd_Flags & 0x40) - strcpy(sV1, "1-"); - else if(dwV1R0_EFProd_Flags & 0x80) - strcpy(sMod, "_sat"); - - if (bEFProduct) - { - EmuWarning("EF Product and V1R0 register used at the same time!"); - } - else - { - WriteCode("; (v1 + r0)\nadd%s r0, %sr0, %sv1\n\n", sMod, sR0, sV1); - } - } - - // only we we will use this later in final combiner stuff!! - // all inputs are known now, so check: - if(bEFProduct) { - - // r0 = E * F (E or F must be the r0 calculated before otherwise the stage results - // are lost, problem??? - if(! - ((!bInputEFG[0] && szConstEFG[0][0]=='0') && - (!bInputEFG[1] && szConstEFG[1][0]=='0'))) { - WriteCode(";E * F\nmul r0, %s, %s\n\n", bInputEFG[0] ? szCompleteInputEFG[0] : &szConstEFG[0][4], - bInputEFG[1] ? szCompleteInputEFG[1] : &szConstEFG[1][4]); - } - - } - - // Now the result: - - // What is done by the final combiner: - // final color = s0*s1 + (1-s0)*s2 + s3 - - // lrp r0, s0, s1, s2 - // add r0, r0, s3 - // s0 = szInput[0] - // s1 = szInput[1] - // s2 = szInput[2] - // s3 = szInput[3] - - // Check whether it is a mov r0, r0 - // for example: lrp r0, 1, r0, 0 - // r0 = 1*r0 + (1-1)*r0 + 0 - // --> r0 = r0 - - for(i=0; i<4; i++) - { - if(!bInput[i]) - CorrectConstToReg(szConst[i], iPSC0, iPSC1); - } - - if(!((!bInput[0]) && (szConst[0][0] == '1') && (strncmp(szCompleteInput[1], "r0", 2)==0))) - { - // cases for s2 - // s2 == 0 --> final color = s0*s1 + s3 - if((!bInput[2]) && (szConst[2][0] == '0')) - { - WriteCode("mul r0.rgb, %s, %s\n", - bInput[0] ? szCompleteInput[0] : &szConst[0][4], - bInput[1] ? szCompleteInput[1] : &szConst[1][4]); - } - // s0 == 0 --> final color = s2 + s3 - else if((!bInput[0]) && (szConst[0][0] == '0')) { - // Check whether s2 is r0!!! - if(!(bInput[2] && (strncmp(szCompleteInput[2], "r0", 2)==0))) - WriteCode("mov r0.rgb, %s\n", - bInput[2] ? szCompleteInput[2] : &szConst[2][4]); - } - // s0 == 1 --> final color = s1 + s3 - else if((!bInput[0]) && (szConst[0][0] == '1')) { - // Check whether s1 is r0!!! - if(!(bInput[1] && (strncmp(szCompleteInput[1], "r0", 2)==0))) - WriteCode("mov r0.rgb, %s\n", - bInput[1] ? szCompleteInput[1] : &szConst[1][4]); - } - // no special cases - else if(bInput[2] || bInput[0]) - { - WriteCode("lrp r0.rgb, %s, %s, %s\n", - bInput[0] ? szCompleteInput[0] : &szConst[0][4], - bInput[1] ? szCompleteInput[1] : &szConst[1][4], - bInput[2] ? szCompleteInput[2] : &szConst[2][4]); - } - } - // case for s3 - if(bInput[3] || (szConst[3][0] != '0')) - WriteCode("add r0.rgb, r0, %s\n", bInput[3] ? szCompleteInput[3] : &szConst[3][4]); - - // Alpha ouput (G) - if(bInputEFG[2] && (strncmp(szInputEFG[2], "r0", 2)!=0)) - { - bR0AlphaOutput=TRUE; - - WriteCode("mov r0.a, %s\n", - bInputEFG[2] ? szCompleteInputEFG[2] : &szConstEFG[2][4]); - } - - //else - // WriteCode("mov r0.a, v0.a\n"); - //*/ - //Sleep(3000); - } -} - -inline void GetRegister(WORD wRegister, char *szRegister, BOOL bUniqueC0, BOOL bUniqueC1, int iCStage, int *iPSC0, int *iPSC1) -{ - // Determine register - switch(wRegister) - { - case 0x00: - printf("PS_REGISTER_ZERO"); - break; - case 0x01: // read - printf("PS_REGISTER_C0"); - if(bUniqueC0) - sprintf(szRegister, "c%d", iPSC0[iCStage]); - else - strcpy(szRegister, "c0"); - break; - case 0x02: // read - printf("PS_REGISTER_C1"); - if(bUniqueC0) - sprintf(szRegister, "c%d", iPSC1[iCStage]); - else - strcpy(szRegister, "c1"); - break; - case 0x03: // read - { - printf("PS_REGISTER_FOG"); - - char szOneHalf[40] = "0.5\0"; - CorrectConstToReg(szOneHalf, iPSC0, iPSC1); - - strcpy(szRegister, &szOneHalf[4]); // Unsupported - break; - } - case 0x04: // read/(write ???) - printf("PS_REGISTER_V0"); - strcpy(szRegister, "v0"); - break; - case 0x05: // read/(write ???) - printf("PS_REGISTER_V1"); - strcpy(szRegister, "v1"); - break; - case 0x08: // read/write - printf("PS_REGISTER_T0"); - strcpy(szRegister, "t0"); - //strcpy(szRegister, "r2"); - break; - case 0x09: // read/write - printf("PS_REGISTER_T1"); - strcpy(szRegister, "t1"); - //strcpy(szRegister, "r3"); - break; - case 0x0A: // read/write - printf("PS_REGISTER_T2"); - strcpy(szRegister, "t2"); - //strcpy(szRegister, "r4"); - break; - case 0x0B: // read/write - printf("PS_REGISTER_T3"); - strcpy(szRegister, "t3"); - //strcpy(szRegister, "r5"); - break; - case 0x0C: // read/write - printf("PS_REGISTER_R0"); - strcpy(szRegister, "r0"); - break; - case 0x0D: // read/write - printf("PS_REGISTER_R1"); - strcpy(szRegister, "r1"); - break; - case 0x0E: // read - printf("PS_REGISTER_V1R0_SUM"); - - bV1R0Reg = TRUE; - strcpy(szRegister, "r0"); //"V1R0");//(v1+r0)"); - break; - case 0x0F: - printf("PS_REGISTER_EF_PROD"); - - // we save it in r0 - bEFProduct = TRUE; - strcpy(szRegister, "r0");/* e * f --> combiner input */ - break; - default: - printf("/*Unknown register %d*/", wRegister); - break; - } -} - -inline void GetInputMapping(WORD wInputMapping, char *szInputMapping, char *szInputMappingAfter, char *szConst) -{ - strcpy(szConst, "0"); - switch(wInputMapping) - { - case 0x00: // max(0,x) [ok for final combiner] - printf("PS_INPUTMAPPING_UNSIGNED_IDENTITY"); - break; - case 0x20: // 1 - max(0,x) [ok for final combiner] - printf("PS_INPUTMAPPING_UNSIGNED_INVERT"); - strcpy(szInputMapping, "1-"); - strcpy(szConst, "1"); - break; - case 0x40: // 2*max(0,x) - 1 [invalid for final combiner] - printf("PS_INPUTMAPPING_EXPAND_NORMAL"); - strcpy(szInputMappingAfter, "_bx2"); // right??? - strcpy(szConst, "-1"); - break; - case 0x60: // 1 - 2*max(0,x) [invalid for final combiner] - printf("PS_INPUTMAPPING_EXPAND_NEGATE"); - - strcpy(szInputMapping, "-"); - strcpy(szInputMappingAfter, "_bx2"); - strcpy(szConst, "1"); - break; - case 0x80: // max(0,x) - 1/2 [invalid for final combiner] - printf("PS_INPUTMAPPING_HALFBIAS_NORMAL"); - strcpy(szInputMappingAfter, "_bias"); - - strcpy(szConst, "-0.5"); - break; - case 0xA0: // 1/2 - max(0,x) [invalid for final combiner] - printf("PS_INPUTMAPPING_HALFBIAS_NEGATE"); - - strcpy(szConst, "0.5"); - - // Negate is run last if combined with bias - strcpy(szInputMapping, "-"); - strcpy(szInputMappingAfter, "_bias"); - break; - case 0xC0: // x [invalid for final combiner] - printf("PS_INPUTMAPPING_SIGNED_IDENTITY"); - break; - case 0xE0: // -x [invalid for final combiner] - printf("PS_INPUTMAPPING_SIGNED_NEGATE"); - strcpy(szInputMapping, "-"); - break; - default: - printf("/*Unknown input mapping %d!*/", wInputMapping); - break; - } -} - -inline void GetChannel(WORD wInputChannel, char *szInput, BOOL bAlpha, BOOL bGlobalRGBA) -{ - switch(wInputChannel) - { - case 0x00: - if(bAlpha) { - printf("PS_CHANNEL_BLUE"); - strcat(szInput, ".b"); - } else { - printf("PS_CHANNEL_RGB"); - - //if (!bGlobalRGBA) - // strcat(szInput, ".rgb"); - } - break; - case 0x10: - printf("PS_CHANNEL_ALPHA"); - - // TODO: check this || !bAlpha, it should mean that alpha channel - // is detected in a RGB register, then it must be set also - // if both commands the same are (in that case it has to be RGB!) - if (!bGlobalRGBA || !bAlpha) - strcat(szInput, ".a"); - break; - default: - printf("/*Unknown channel %d!*/", wInputChannel); - break; - } -} - -inline void GetOutputFlags -( - WORD wOutputFlags, - char *szInstMod, - char *szABOp, - char *szCDOp, - char *szABCDOp, - - BOOL *bAB_BA, - BOOL *bCD_BA, - - BOOL *bShl1Bias, - BOOL *bBias -) -{ - // Output mapping - if(wOutputFlags & 0x08) - { - printf("PS_COMBINEROUTPUT_BIAS"); // y = x - 0.5 - //strcpy(szInstMod, "_bias"); - - // Only over this: - // mov y, y_bias - (*bBias)=TRUE; - } - else if(wOutputFlags & 0x10) - { - printf("PS_COMBINEROUTPUT_SHIFTLEFT_1"); // y = x*2 - strcpy(szInstMod, "_x2"); - } - else if(wOutputFlags & 0x18) - { - printf("PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS"); // y = (x - 0.5)*2 - - //strcpy(szInstMod, "_x2"); - // what is missing is a subtraction of 1 - // --> 2 * (x - 0.5) = 2x - 1 - - // But this won't work because we would have to do 2 movs - // to subtract 1 - // Let's do this: mov_x2 y, y_bias - (*bShl1Bias)=TRUE; - } - else if(wOutputFlags & 0x20) - { - printf("PS_COMBINEROUTPUT_SHIFTLEFT_2"); // y = x*4 - strcpy(szInstMod, "_x4"); - } - else if(wOutputFlags & 0x30) - { - printf("PS_COMBINEROUTPUT_SHIFTRIGHT_1"); // y = x/2 - strcpy(szInstMod, "_d2"); - } - else - printf("PS_COMBINEROUTPUT_IDENTITY"); - - printf(" | "); - - // MUX operation - if(wOutputFlags & 0x04) { - printf("PS_COMBINEROUTPUT_AB_CD_MUX"); - strcpy(szABCDOp, "cnd"); - - if((!bR0Written) || (!bR0AWritten)) - bR0WAccess=TRUE; - } - else - { - printf("PS_COMBINEROUTPUT_AB_CD_SUM"); // 3rd output is AB+CD - strcpy(szABCDOp, "add"); - } - - printf(" | "); - - // Function for ab side - if(wOutputFlags & 0x02) - { - printf("PS_COMBINEROUTPUT_AB_DOT_PRODUCT"); // RGB only - strcpy(szABOp, "dp3"); - } else { - printf("PS_COMBINEROUTPUT_AB_MULTIPLY"); - strcpy(szABOp, "mul"); - } - - printf(" | "); - - // Functiomn for cd side - if(wOutputFlags & 0x01) - { - printf("!!!PS_COMBINEROUTPUT_CD_DOT_PRODUCT!!!"); // RGB only - strcpy(szCDOp, "dp3"); - } else { - printf("PS_COMBINEROUTPUT_CD_MULTIPLY"); - strcpy(szCDOp, "mul"); - } - - // Blue to alpha for ab side - if(wOutputFlags & 0x80) { - printf(" | PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA"); // RGB only - (*bAB_BA)=TRUE; - } else (*bAB_BA)=FALSE; - - // Blue to alpha for cd side - if(wOutputFlags & 0x40) { - printf(" | PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA"); // RGB only - (*bCD_BA)=TRUE; - } else (*bCD_BA)=FALSE; -} - -enum OpType -{ - OPTYPE_NOP = -1, - OPTYPE_MOV = 0, - OPTYPE_ADD, - OPTYPE_MUL, - OPTYPE_DP3, - OPTYPE_CND, -}; - -inline BOOL OptimizeOperation -( - char *szOp, - char *szOp1, - - char *szOp2, - char *szMod, - - char *szInputAB1, - char *szInputAB2, - - char *szInputCD1, - char *szInputCD2, - - char *szConstRegAB1, - char *szConstRegAB2, - char *szConstRegCD1, - char *szConstRegCD2, - - char *szOutAB, - char *szOutCD, - char *szABCDOutput, - - char *szCommand) -{ - printf("----------\nszOp: |%s|\nszOp1: |%s|\nszOp2: |%s|\nszMod: |%s|\n" - "szInputAB1: |%s|\nszInputAB2: |%s|\nszInputCD1: |%s|\nszInputCD2: |%s|\n" - "szOutAB: |%s|\nszOutCD: |%s|\nszABCDOutput: |%s|\n", - szOp, szOp1, szOp2, szMod, szInputAB1, szInputAB2, szInputCD1, szInputCD2, - szOutAB, szOutCD, szABCDOutput); - - char szABCDInput[2][10]; - szABCDInput[0][0]=0x00; - szABCDInput[1][0]=0x00; - - szCommand[0]=0x00; - - char *szOps[3]; - szOps[0] = szOp; - szOps[1] = szOp1; - szOps[2] = szOp2; - - char *szInputs[4]; - szInputs[0] = szInputAB1; - szInputs[1] = szInputAB2; - szInputs[2] = szInputCD1; - szInputs[3] = szInputCD2; - - char *szRealInputs[4]; - szRealInputs[0] = szConstRegAB1; - szRealInputs[1] = szConstRegAB2; - szRealInputs[2] = szConstRegCD1; - szRealInputs[3] = szConstRegCD2; - -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - char *szOutputs[3]; - szOutputs[0] = szOutAB; - szOutputs[1] = szOutCD; - szOutputs[2] = szABCDOutput; -#endif - - // TODO: check mov: other operations like lrp - // are ignored because of a shitty mul with 1 - BOOL bMov[3]={0, 0, 0}; - - int i=0; - for(i=0; i<2; i++) - { - //printf("szOps[i]: %s\n", szOps[i]); - //printf("szInputs[i*2+1]: %s\n", szInputs[i*2+1]); - if(strcmp(szOps[i], "mul")==0) - { - // If it is a mul, it can also be only a mov - if(strcmp(szInputs[i*2], "1")==0) { - //strcpy(szABCDInput[i], szInputs[i*2+1]); -#ifndef REVEL8N_PIXEL_SHADER_CHANGES - strcpy(szABCDInput[i], szRealInputs[i*2+1]); -#endif - - strcpy(szOps[i], "mov"); - - strcpy(szInputs[i*2], szInputs[i*2+1]); - strcpy(szRealInputs[i*2], szRealInputs[i*2+1]); - - strcpy(szInputs[i*2+1], ""); - strcpy(szRealInputs[i*2+1], ""); - - bMov[i]=TRUE; - - } else if(strcmp(szInputs[i*2+1], "1")==0) { - //strcpy(szABCDInput[i], szInputs[i*2]); -#ifndef REVEL8N_PIXEL_SHADER_CHANGES - strcpy(szABCDInput[i], szRealInputs[i*2]); -#endif - - strcpy(szOps[i], "mov"); - - strcpy(szInputs[i*2+1], ""); - strcpy(szRealInputs[i*2+1], ""); - - bMov[i]=TRUE; - } - } - } - -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - OpType eOpTypes[3] = {OPTYPE_NOP, OPTYPE_NOP, OPTYPE_NOP}; - for (i = 0; i < 3; ++i) - { - if (strcmp(szOps[i], "mov") == 0) - eOpTypes[i] = OPTYPE_MOV; - else if (strcmp(szOps[i], "add") == 0) - eOpTypes[i] = OPTYPE_ADD; - else if (strcmp(szOps[i], "mul") == 0) - eOpTypes[i] = OPTYPE_MUL; - else if (strcmp(szOps[i], "dp3") == 0) - eOpTypes[i] = OPTYPE_DP3; - else if (strcmp(szOps[i], "cnd") == 0) - eOpTypes[i] = OPTYPE_CND; - else - eOpTypes[i] = OPTYPE_NOP; - } - - bool bHandled = false; - int iOffset = 0; - int iOpCount = 0; - if (szOps[2][0] && szOutputs[2][0] && szOutputs[2][0] != 'v') - { - if (!szOutputs[0][0] && - !szOutputs[1][0]) - { - if (szMod[0]) - { - EmuWarning("Pixel Shader: Destination modifier present!"); - } - switch (eOpTypes[2]) - { - case OPTYPE_ADD: - { - if (eOpTypes[0] == OPTYPE_MOV && - eOpTypes[1] == OPTYPE_MOV) - { - iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", - szMod, szOutputs[2], szRealInputs[0], szRealInputs[2]); - ++iOpCount; - bHandled = true; - } - else if (eOpTypes[0] == OPTYPE_MOV && - eOpTypes[1] == OPTYPE_MUL) - { - iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", - szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szRealInputs[0]); - bHandled = true; - ++iOpCount; - } - else if (eOpTypes[0] == OPTYPE_MUL && - eOpTypes[1] == OPTYPE_MOV) - { - iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", - szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szRealInputs[2]); - bHandled = true; - ++iOpCount; - } - else if (eOpTypes[0] == OPTYPE_MUL && - eOpTypes[1] == OPTYPE_MUL) - { - // nice, mul, mul, add can be converted to lrp - // lrp r0, t0, t1, c2 - // --> r0 = t0 * t1 + (1-t0) * c2 - // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op - // and that is not possible - - for(i=0; i<2; i++) - { - // To match the first option, the first input of the AB/CD op must inverted - BOOL bInvert[2] = {0, 0}; - if((szRealInputs[2*i][0] == '1') && (szRealInputs[2*i][1] == '-')) - //if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) - bInvert[0]=TRUE; - - if((szRealInputs[2*i+1][0] == '1') && (szRealInputs[2*i+1][1] == '-')) - //if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) - bInvert[1]=TRUE; - - //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); - //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); - - if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) - { - char szParam[3][10] = {0}; - char szRealParam0[10] = {0}; - if(bInvert[0]) - { - // copy over the not inverted param - strcpy(szParam[i+1], /*szInputs*/szRealInputs[2*i+1]); - - // and the inverted - strcpy(szParam[0], &szInputs[2*i][2]); - strcpy(szRealParam0, &szRealInputs[2*i][2]); - } - else if(bInvert[1]) - { - // copy over the not inverted param - strcpy(szParam[i+1], /*szInputs*/szRealInputs[2*i]); - - // and the inverted - strcpy(szParam[0], &szInputs[2*i+1][2]); - strcpy(szRealParam0, &szRealInputs[2*i+1][2]); - } - int iOtherOp = i == 0 ? 1 : 0; - - bHandled = true; - if (strcmp(szRealInputs[2*iOtherOp], szRealParam0/*szParam[0]*/)==0) - strcpy(szParam[iOtherOp+1], /*szInputs*/szRealInputs[2*iOtherOp+1]); - else if (strcmp(szRealInputs[2*iOtherOp+1], szRealParam0/*szParam[0]*/)==0) - strcpy(szParam[iOtherOp+1], /*szInputs*/szRealInputs[2*iOtherOp]); - else - bHandled = false; - if (bHandled) - { - // ok, we have it - iOffset += sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", - szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); - ++iOpCount; - break; - } - } - } - - if (!bHandled) - { - iOffset += sprintf(szCommand + iOffset, "mul r1, %s, %s\n", - szRealInputs[0], szRealInputs[1]); - ++iOpCount; - iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, r1\n", - szMod, szOutputs[2], szRealInputs[2], szRealInputs[3]); - ++iOpCount; - - bHandled = true; - } - } - } - break; - case OPTYPE_CND: - { - if (eOpTypes[0] == OPTYPE_MOV && - eOpTypes[1] == OPTYPE_MOV) - { - iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", - szMod, szOutputs[2], szRealInputs[2], szRealInputs[0]); - ++iOpCount; - bHandled = true; - } - else if (eOpTypes[0] == OPTYPE_MUL && - eOpTypes[1] == OPTYPE_MUL) - { - if (szOutputs[2][0] != 'r') - { - EmuWarning("Pixel Shader: Destination not temporary register!"); - } - // ab input - iOffset += sprintf(szCommand + iOffset, "mul%s r1, %s, %s\n", - szMod, szRealInputs[0], szRealInputs[1]); - ++iOpCount; - // cd input - iOffset += sprintf(szCommand + iOffset, "mul%s r0, %s, %s\n", - szMod, szRealInputs[2], szRealInputs[3]); - ++iOpCount; - // abcd output - iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, r0, r1\n", - szMod, szOutputs[2]); - ++iOpCount; - bHandled = true; - } - } - break; - } - if (!bHandled && strcmp(szOps[2], "add") == 0) - { - if ((strcmp(szOps[0], "mov")==0)) - { - if ((strcmp(szOps[1], "mul")==0)) - { - char szParam[10]="\0"; - - if(strcmp(szInputCD1, "-1")==0) - strcpy(szParam, szInputCD2); - else if(strcmp(szInputCD2, "-1")==0) - strcpy(szParam, szInputCD1); - - if(szParam[0] && szConstRegAB1[0] && szABCDOutput[0]) - { - iOffset += sprintf(szCommand, "sub%s %s, %s, %s\n", - szMod, szABCDOutput, szConstRegAB1, szParam); - bHandled = true; - ++iOpCount; - } -// else -// { -// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", -// szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szRealInputs[0]); -// bHandled = true; -// ++iOpCount; -// } - } - } -// else if ((strcmp(szOps[0], "mul")==0)) -// { -// if ((strcmp(szOps[1], "mov")==0)) -// { -// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", -// szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szRealInputs[2]); -// bHandled = true; -// ++iOpCount; -// } -// else if ((strcmp(szOps[1], "mul")==0)) -// { -// // nice, mul, mul, add can be converted to lrp -// // lrp r0, t0, t1, c2 -// // --> r0 = t0 * t1 + (1-t0) * c2 -// // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op -// // and that is not possible -// -// for(i=0; i<2; i++) -// { -// // To match the first option, the first input of the AB/CD op must inverted -// BOOL bInvert[2] = {0, 0}; -// if((szRealInputs[2*i][0] == '1') && (szRealInputs[2*i][1] == '-')) -// //if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) -// bInvert[0]=TRUE; -// -// if((szRealInputs[2*i+1][0] == '1') && (szRealInputs[2*i+1][1] == '-')) -// //if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) -// bInvert[1]=TRUE; -// -// //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); -// //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); -// -// if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) -// { -// char szParam[3][10]; -// char szRealParam0[10]; -// if(bInvert[0]) -// { -// // copy over the not inverted param -// strcpy(szParam[2], /*szInputs*/szRealInputs[2*i+1]); -// -// // and the inverted -// strcpy(szParam[0], &szInputs[2*i][2]); -// strcpy(szRealParam0, &szRealInputs[2*i][2]); -// } -// else if(bInvert[1]) -// { -// // copy over the not inverted param -// strcpy(szParam[2], /*szInputs*/szRealInputs[2*i]); -// -// // and the inverted -// strcpy(szParam[0], &szInputs[2*i+1][2]); -// strcpy(szRealParam0, &szRealInputs[2*i+1][2]); -// } -// int iOtherOp = i == 0 ? 1 : 0; -// -// bHandled = true; -// if (strcmp(szRealInputs[2*iOtherOp], szRealParam0/*szParam[0]*/)==0) -// strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp+1]); -// else if (strcmp(szRealInputs[2*iOtherOp+1], szRealParam0/*szParam[0]*/)==0) -// strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp]); -// else -// bHandled = false; -// if (bHandled) -// { -// // ok, we have it -// iOffset += sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", -// szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); -// ++iOpCount; -// break; -// } -// } -// } -// -// if (!bHandled) -// { -// iOffset += sprintf(szCommand + iOffset, "mul r1, %s, %s\n", -// szRealInputs[0], szRealInputs[1]); -// ++iOpCount; -// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, r1\n", -// szMod, szOutputs[2], szRealInputs[2], szRealInputs[3]); -// ++iOpCount; -// -// bHandled = true; -// } -// } -// } - } - } - } - - if (!bHandled) - { - for (i = 0; i < 2; ++i) - { - if (szOps[i][0] && szOutputs[i][0] && szOutputs[i][0] != 'v') - { - ++iOpCount; - // copy output value to final input - strcpy(szABCDInput[i], szOutputs[i]); - // insert command - iOffset += sprintf(szCommand + iOffset, "%s%s %s, %s\n", szOps[i], szMod, szOutputs[i], szRealInputs[i * 2 + 0]); - - // if there are more parameters... - if (szRealInputs[i * 2 + 1][0]) - { - // backspace of the newline character - --iOffset; - // insert remaining parameters - iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[i * 2 + 1]); - } - bHandled = true; - } - } - -// if (szOutputs[2][0]) -// { -// if(!szOutputs[1][0]) -// strcpy(szOutputs[1], "r0"); -// if(!szOutputs[0][0]) -// strcpy(szOutputs[0], "r1"); -// } - - if (szOps[2][0] && szOutputs[2][0] && szOutputs[2][0] != 'v') - { - switch (eOpTypes[2]) - { - case OPTYPE_ADD: - { - if (szABCDInput[0][0] && - szABCDInput[1][0]) - { - iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", - szMod, szOutputs[2], szABCDInput[0], szABCDInput[1]); - ++iOpCount; - bHandled = true; - } - else if (szABCDInput[0][0] && - !szABCDInput[1][0]) - { - switch (eOpTypes[1]) - { - case OPTYPE_MUL: - { - iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", - szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szABCDInput[0]); - ++iOpCount; - bHandled = true; - } - break; - case OPTYPE_DP3: - { - { - ++iOpCount; - // insert command - iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[1], szMod, szRealInputs[2]); - - // if there are more parameters... - if (szRealInputs[3][0]) - { - // backspace of the newline character - --iOffset; - // insert remaining parameters - iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[3]); - } - } - { - iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, r1\n", - szMod, szOutputs[2], szABCDInput[0]); - ++iOpCount; - bHandled = true; - } - } - break; - default: - break; - } - } - else if (!szABCDInput[0][0] && - szABCDInput[1][0]) - { - switch (eOpTypes[0]) - { - case OPTYPE_MUL: - { - iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", - szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szABCDInput[1]); - ++iOpCount; - bHandled = true; - } - break; - case OPTYPE_DP3: - { - { - ++iOpCount; - // insert command - iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[0], szMod, szRealInputs[0]); - - // if there are more parameters... - if (szRealInputs[1][0]) - { - // backspace of the newline character - --iOffset; - // insert remaining parameters - iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[1]); - } - } - { - iOffset += sprintf(szCommand + iOffset, "add%s %s, r1, %s\n", - szMod, szOutputs[2], szABCDInput[1]); - ++iOpCount; - bHandled = true; - } - } - break; - default: - break; - } - } - } - break; - case OPTYPE_CND: - { - if (szABCDInput[0][0] && - szABCDInput[1][0]) - { - iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", - szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); - ++iOpCount; - bHandled = true; - } - else if (szABCDInput[0][0] && - !szABCDInput[1][0]) - { - { - ++iOpCount; - // insert command - iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[1], szMod, szRealInputs[2]); - - // if there are more parameters... - if (szRealInputs[3][0]) - { - // backspace of the newline character - --iOffset; - // insert remaining parameters - iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[3]); - } - } - { - iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, r1, %s\n", - szMod, szOutputs[2], szABCDInput[0]); - ++iOpCount; - bHandled = true; - } - } - else if (!szABCDInput[0][0] && - szABCDInput[1][0]) - { - { - ++iOpCount; - // insert command - iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[0], szMod, szRealInputs[0]); - - // if there are more parameters... - if (szRealInputs[1][0]) - { - // backspace of the newline character - --iOffset; - // insert remaining parameters - iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[1]); - } - } - { - iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, r1\n", - szMod, szOutputs[2], szABCDInput[1]); - ++iOpCount; - bHandled = true; - } - } - } - break; - } - if (!bHandled) - { - EmuWarning("Unhandled pixel shader instruction!"); - } -// if (strcmp(szOps[2], "add") == 0) -// { -// if (szABCDInput[0][0] && -// szABCDInput[1][0]) -// { -// iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", -// szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); -// ++iOpCount; -// bHandled = true; -// } -// else -// { -// EmuWarning("Unhandled pixel shader instruction!"); -// } -// } -// else if (strcmp(szOps[2], "cnd") == 0) -// { -// if (szABCDInput[0][0] && -// szABCDInput[1][0]) -// { -// iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", -// szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); -// ++iOpCount; -// bHandled = true; -// } -// else -// { -// EmuWarning("Unhandled pixel shader instruction!"); -// } -// } -// else -// { -// EmuWarning("Unhandled pixel shader instruction!"); -// } - } - } - - if(szCommand[0]) - printf("new command:\n%s\n", szCommand); - return (bHandled && (iOpCount == 1)) ? (TRUE) : (FALSE); -#endif - - if( - (strcmp(szOp, "mul")==0) && - (strcmp(szOp1, "mov")==0) && //bMov[1] && - (strcmp(szOp2, "add")==0) && - szABCDOutput[0]) - { - sprintf(szCommand, "mad%s %s, %s, %s, %s\n", - szMod, szABCDOutput, - /*szInput*/szConstRegAB1, - /*szInput*/szConstRegAB2, - /*szInput*/szConstRegCD1 /*because it's a mov now*/); - } - else if( - (strcmp(szOp, "mul")==0) && - (strcmp(szOp1, "mul")==0) && - (strcmp(szOp2, "add")==0) && - szABCDOutput[0]) // TODO: check that strange lrp/ABCDOutput[0]=0 case - { - // nice, mul, mul, add can be converted to lrp - // lrp r0, t0, t1, c2 - // --> r0 = t0 * t1 + (1-t0) * c2 - // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op - // and that is not possible - - for(i=0; i<2; i++) - { - // To match the first option, the first input of the AB/CD op must inverted - BOOL bInvert[2] = {0, 0}; - if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) - bInvert[0]=TRUE; - - if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) - bInvert[1]=TRUE; - - //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); - //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); - - if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) - { - char szParam[3][10]; - char szRealParam0[10]; - if(bInvert[0]) - { - // copy over the not inverted param - strcpy(szParam[2], /*szInputs*/szRealInputs[2*i+1]); - - // and the inverted - strcpy(szParam[0], &szInputs[2*i][2]); - strcpy(szRealParam0, &szRealInputs[2*i][2]); - } - else if(bInvert[1]) - { - // copy over the not inverted param - strcpy(szParam[2], /*szInputs*/szRealInputs[2*i]); - - // and the inverted - strcpy(szParam[0], &szInputs[2*i+1][2]); - strcpy(szRealParam0, &szRealInputs[2*i+1][2]); - } - int iOtherOp = i == 0 ? 1 : 0; - - if(strcmp(szInputs[2*iOtherOp], szParam[0])==0) - strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp+1]); - else - strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp]); - // ok, we have it - sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", - szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); - - break; - } - } - } else if(strcmp(szOp2, "cnd")==0) { -#ifdef REVEL8N_PIXEL_SHADER_CHANGES - iOffset = 0; - i = 0; - for (i = 0; i < 2; ++i) - { - if (strcmp(szOps[i], "mul")==0) - { - strcpy(szABCDInput[i], szOutputs[i]); - iOffset += sprintf(szCommand + iOffset, "mul %s, %s, %s\n", szOutputs[i], szRealInputs[i * 2 + 0], szRealInputs[i * 2 + 1]); - } - } - sprintf(szCommand + iOffset, "cnd%s %s, %s, %s, %s\n", - szMod, szABCDOutput, "r0.a", szABCDInput[1], szABCDInput[0]); -#else - sprintf(szCommand, "cnd%s %s, %s, %s, %s\n", - szMod, szABCDOutput, "r0.a", szABCDInput[1], szABCDInput[0]); -#endif - - bMov[1]=0; - bMov[0]=0; - } else if( - (strcmp(szOp, "mov")==0) && - (strcmp(szOp1, "mul")==0) && - (strcmp(szOp2, "add")==0)) - { - char szParam[10]="\0"; - - if(strcmp(szInputCD1, "-1")==0) - strcpy(szParam, szInputCD2); - else if(strcmp(szInputCD2, "-1")==0) - strcpy(szParam, szInputCD1); - - if(szParam[0] && szConstRegAB1[0] && szABCDOutput[0]) - { - sprintf(szCommand, "sub%s %s, %s, %s\n", - szMod, szABCDOutput, szConstRegAB1, szParam); - } - - } -//do_operation_with_new_input: - - if(bMov[0] && bMov[1] && szABCDOutput[0]) { - sprintf(szCommand, "%s%s %s, %s, %s\n", szOp2, szMod, szABCDOutput, szABCDInput[0], szABCDInput[1]); - } - - if(szCommand[0]) - printf("new command: %s", szCommand); - return TRUE; -} - -float fConstants[20] = {0.0f}; -int iConstants[20] = {0}; -int iConstCount=0; - -inline void ClearConstRegVars() -{ - iConstCount=0; - memset(fConstants, 0x00, 20*sizeof(float)); - memset(iConstants, 0x00, 20*sizeof(int)); -} - -inline void CorrectConstToReg(char *szConst, int *pPSC0, int *pPSC1) -{ - printf("Looking for %s\n", szConst); - float fConst = (float)atof(szConst); - - // check whether we already saved it - int i=0; - for(i=0; iPSAlphaInputs[0], pPSDef->PSAlphaInputs[1], pPSDef->PSAlphaInputs[2], pPSDef->PSAlphaInputs[3], - pPSDef->PSAlphaInputs[4], pPSDef->PSAlphaInputs[5], pPSDef->PSAlphaInputs[6], pPSDef->PSAlphaInputs[7], - pPSDef->PSFinalCombinerInputsABCD, - pPSDef->PSFinalCombinerInputsEFG, - pPSDef->PSConstant0[0], pPSDef->PSConstant0[1], pPSDef->PSConstant0[2], pPSDef->PSConstant0[3], - pPSDef->PSConstant0[4], pPSDef->PSConstant0[5], pPSDef->PSConstant0[6], pPSDef->PSConstant0[7], - pPSDef->PSConstant1[0], pPSDef->PSConstant1[1], pPSDef->PSConstant1[2], pPSDef->PSConstant1[3], - pPSDef->PSConstant1[4], pPSDef->PSConstant1[5], pPSDef->PSConstant1[6], pPSDef->PSConstant1[7], - pPSDef->PSAlphaOutputs[0], pPSDef->PSAlphaOutputs[1], pPSDef->PSAlphaOutputs[2], pPSDef->PSAlphaOutputs[3], - pPSDef->PSAlphaOutputs[4], pPSDef->PSAlphaOutputs[5], pPSDef->PSAlphaOutputs[6], pPSDef->PSAlphaOutputs[7], - pPSDef->PSRGBInputs[0], pPSDef->PSRGBInputs[1], pPSDef->PSRGBInputs[2], pPSDef->PSRGBInputs[3], - pPSDef->PSRGBInputs[4], pPSDef->PSRGBInputs[5], pPSDef->PSRGBInputs[6], pPSDef->PSRGBInputs[7], - pPSDef->PSCompareMode, - pPSDef->PSFinalCombinerConstant0, - pPSDef->PSFinalCombinerConstant1, - pPSDef->PSRGBOutputs[0], pPSDef->PSRGBOutputs[1], pPSDef->PSRGBOutputs[2], pPSDef->PSRGBOutputs[3], - pPSDef->PSRGBOutputs[4], pPSDef->PSRGBOutputs[5], pPSDef->PSRGBOutputs[6], pPSDef->PSRGBOutputs[7], - pPSDef->PSCombinerCount, - TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES], /* pPSDef->PSTextureModes is stored in a different place than pPSDef*/ - pPSDef->PSDotMapping, - pPSDef->PSInputTexture, - pPSDef->PSC0Mapping, - pPSDef->PSC1Mapping, - pPSDef->PSFinalCombinerConstants ); - if (pszCode) - { - fprintf(out, "\n\n%s\n", pszCode); - } - - fclose( out ); - } -} - -// print relevant contents to the debug console -void XTL::PrintPixelShaderDefContents( X_D3DPIXELSHADERDEF* pPSDef ) -{ - // Show the contents to the user - if( pPSDef ) - { - DbgPshPrintf( "\n-----PixelShader Def Contents-----\n" ); - - if(TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES]) - { - DWORD dwPSTexMode0 = ( TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES] >> 0 ) & 0x1F; - DWORD dwPSTexMode1 = ( TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES] >> 5 ) & 0x1F; - DWORD dwPSTexMode2 = ( TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES] >> 10 ) & 0x1F; - DWORD dwPSTexMode3 = ( TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES] >> 15 ) & 0x1F; - - DbgPshPrintf( "PSTextureModes ->\n" ); - DbgPshPrintf( "Stage 0: %s\n", PS_TextureModesStr[dwPSTexMode0] ); - DbgPshPrintf( "Stage 1: %s\n", PS_TextureModesStr[dwPSTexMode1] ); - DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSTexMode2] ); - DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSTexMode3] ); - } - - if( pPSDef->PSDotMapping ) - { - DWORD dwPSDMStage1 = ( pPSDef->PSDotMapping >> 0 ) & 0x7; - DWORD dwPSDMStage2 = ( pPSDef->PSDotMapping >> 4 ) & 0x7; - DWORD dwPSDMStage3 = ( pPSDef->PSDotMapping >> 8 ) & 0x7; - - DbgPshPrintf( "PSDotMapping ->\n" ); - DbgPshPrintf( "Stage 1: %s\n", PS_DotMappingStr[dwPSDMStage1] ); - DbgPshPrintf( "Stage 2: %s\n", PS_DotMappingStr[dwPSDMStage2] ); - DbgPshPrintf( "Stage 3: %s\n", PS_DotMappingStr[dwPSDMStage3] ); - } - - if( pPSDef->PSCompareMode ) - { - DWORD dwPSCMStage0 = ( pPSDef->PSCompareMode >> 0 ) & 0xF; - DWORD dwPSCMStage1 = ( pPSDef->PSCompareMode >> 4 ) & 0xF; - DWORD dwPSCMStage2 = ( pPSDef->PSCompareMode >> 8 ) & 0xF; - DWORD dwPSCMStage3 = ( pPSDef->PSCompareMode >> 12 ) & 0xF; - - DbgPshPrintf( "PSCompareMode ->\n" ); - DbgPshPrintf( "Stage 0: %s\n", PS_TextureModesStr[dwPSCMStage0 == 0 ? 0 : 1] ); - DbgPshPrintf( "Stage 1: %s\n", PS_TextureModesStr[dwPSCMStage1 == 0 ? 2 : 3] ); - DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSCMStage2 == 0 ? 4 : 5] ); - DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSCMStage3 == 0 ? 6 : 7] ); - } - - if( pPSDef->PSInputTexture ) - { - DWORD dwPSITStage2 = ( pPSDef->PSInputTexture >> 16 ) & 0x1; - DWORD dwPSITStage3 = ( pPSDef->PSInputTexture >> 20 ) & 0x3; - - DbgPshPrintf( "PSInputTexture ->\n" ); - DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSITStage2] ); - DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSITStage3] ); - } - - if( pPSDef->PSCombinerCount ) - { - DWORD dwPSCCNumCombiners = ( pPSDef->PSCombinerCount >> 0 ) & 0xF; - DWORD dwPSCCMux = ( pPSDef->PSCombinerCount >> 8 ) & 0x1; - DWORD dwPSCCC0 = ( pPSDef->PSCombinerCount >> 12 ) & 0x1; - DWORD dwPSCCC1 = ( pPSDef->PSCombinerCount >> 16 ) & 0x1; - - DbgPshPrintf( "PSCombinerCount ->\n" ); - DbgPshPrintf( "Combiners: %d\n", dwPSCCNumCombiners ); - DbgPshPrintf( "Mux: %s\n", PS_CombinerCountFlagsStr[dwPSCCMux] ); - DbgPshPrintf( "C0: %s\n", PS_CombinerCountFlagsStr[dwPSCCC0 == 0 ? 2 : 3] ); - DbgPshPrintf( "C1: %s\n", PS_CombinerCountFlagsStr[dwPSCCC1 == 0 ? 4 : 5] ); - } - - /*for( int i = 0; i > 7; i++ ) - { - if( pPSDef->PSRGBInputs[i] ) - {*/ - } -} - -HRESULT XTL::EmuRecompilePshDef( X_D3DPIXELSHADERDEF* pPSDef, LPD3DXBUFFER* ppRecompiled ) -{ - char szPshString[2048]; // I'm sure that's big enough... - - // Dump the contents of the PixelShader def -#ifdef _DEBUG_TRACK_PS -// DumpPixelShaderDefToFile( pPSDef ); - - // Azurik like to create and destroy the same shader every frame! O_o -// PrintPixelShaderDefContents( pPSDef ); -#endif - - // First things first, set the pixel shader version - // TODO: ps.1.1 might be a better idea... - sprintf(szPshString, "%s", "ps.1.0\n"); - - // Handle Texture declarations - // PSTEXTUREModes is stored in a different address in D3D_RenderStates than pPSDef - // So we must read it from the render array instead (pPSDef in this case is a pointer to the RenderState array, NOT the shader itself) - if(TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES] != 0) - { - } - - return S_OK; -} - +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 kingofc +// * +// * All rights reserved +// * +// ****************************************************************** + +/* + + This is a parser for the Xbox Pixel Shader Format. + + With the help of this parser it is possible to generate + Direct3D pixel shader assembly code. + + TODO: + - fix BumpDemo + (after second recompilation the shader does not work, + can also be something in CxbxKrnl because it looks like no + textures are set. Check cubemap loading from resourcesd!!!) + => seems to work now, the problem is that I don't know + how it must look on a real xbox + + - add reference counting constants which were added as c variables + if they are compiled away (optimization of the command, etc.) + decrement the reference count and when it reaches 0 remove + the constant (to save the num of vars) + + - add _sat feature + * Support as instruction modifier, + if necessary as mov_sat x, y + + - When porting to DirectX 9, expand this to pixel shader model 2.0 or up + - Alternatively, translate to HLSL and let D3DXCompileShader/D3DCompile figure it out +*/ + +#define LOG_PREFIX CXBXR_MODULE::PXSH + +#include "core\kernel\support\Emu.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For g_pD3DDevice, g_pXbox_PixelShader +#include "core\hle\D3D8\XbPixelShader.h" + +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup() + +#include // assert() +#include +#include + +#include "Direct3D9\RenderStates.h" +extern XboxRenderStateConverter XboxRenderStates; + +#define DbgPshPrintf \ + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) \ + if(g_bPrintfOn) printf + + +/*---------------------------------------------------------------------------*/ +/* Texture configuration - The following members of the D3DPixelShaderDef */ +/* structure define the addressing modes of each of the four texture stages:*/ +/* PSTextureModes */ +/* PSDotMapping */ +/* PSInputTexture */ +/* PSCompareMode */ +/*---------------------------------------------------------------------------*/ + +// ========================================================================================================= +// PSTextureModes +// --------.--------.--------.---xxxxx stage0 +// --------.--------.------xx.xxx----- stage1 +// --------.--------.-xxxxx--.-------- stage2 +// --------.----xxxx.x-------.-------- stage3 + +#define PS_TEXTUREMODES(t0,t1,t2,t3) (((t3)<<15)|((t2)<<10)|((t1)<<5)|(t0)) + +/* +Texture modes: +NONE :stage inactive +PROJECT2D :argb = texture(s/q, t/q) +PROJECT3D :argb = texture(s/q, t/q, r/q) +CUBEMAP :argb = cubemap(s,t,r) +PASSTHRU :argb = s,t,r,q +CLIPPLANE :pixel not drawn if s,t,r, or q < 0. PSCompareMode affects comparison +BUMPENVMAP :argb=texture(s+mat00*src.r+mat01*src.g, + t+mat10*src.r+mat11*src.g) + mat00 set via D3DTSS_BUMPENVMAT00, etc. +BUMPENVMAP_LUM :argb=texture(s+mat00*src.r+mat01*src.g, + t+mat10*src.r+mat11*src.g); + rgb *= (lum_scale*src.b + lum_bias); (a is not affected) + lum_scale set by D3DTSS_BUMPENVLSCALE + lum_bias set by D3DTSS_BUMPENVLOFFSET + mat00 set via D3DTSS_BUMPENVMAT00, etc. +BRDF :argb = texture(eyeSigma, lightSigma, dPhi) + eyeSigma = Sigma of eye vector in spherical coordinates + lightSigma = Sigma of light vector in spherical coordinates + dPhi = Phi of eye - Phi of light +DOT_ST :argb = texture(, (s,t,r).(src.r,src.g,src.b)) +DOT_ZW :frag depth = (/((s,t,r).(src.r,src.g,src.b)) +DOT_RFLCT_DIFF :n = (,(s,t,r).(src.r,src.g,src.b),) + argb = cubemap(n) +DOT_RFLCT_SPEC :n = (,,(s,t,r).(src.r,src.g,src.b)) + r = 2*n*(n.e)/(n.n) - e where e is eye vector built from q coord of each stage + argb = cubemap(r) +DOT_STR_3D :argb=texture((,,(s,t,r).(src.r,src.g,src.b))) +DOT_STR_CUBE :argb=cubemap((,,(s,t,r).(src.r,src.g,src.b))) +DEPENDENT_AR :argb = texture(src.a, src.r) +DEPENDENT_GB :argb = texture(src.g, src.b) +DOTPRODUCT :argb = (s,t,r).(src.r,src.g,src.b) +DOT_RFLCT_SPEC_CONST :n = (,,(s,t,r).(src.r,src.g,src.b)) + r = 2*n*(n.e)/(n.n) - e where e is eye vector set via SetEyeVector() + argb = cubemap(r) +*/ + +enum PS_TEXTUREMODES +{ // valid in stage 0 1 2 3 + PS_TEXTUREMODES_NONE= 0x00L, // * * * * + PS_TEXTUREMODES_PROJECT2D= 0x01L, // * * * * + PS_TEXTUREMODES_PROJECT3D= 0x02L, // * * * * + PS_TEXTUREMODES_CUBEMAP= 0x03L, // * * * * + PS_TEXTUREMODES_PASSTHRU= 0x04L, // * * * * + PS_TEXTUREMODES_CLIPPLANE= 0x05L, // * * * * + PS_TEXTUREMODES_BUMPENVMAP= 0x06L, // - * * * + PS_TEXTUREMODES_BUMPENVMAP_LUM= 0x07L, // - * * * + PS_TEXTUREMODES_BRDF= 0x08L, // - - * * + PS_TEXTUREMODES_DOT_ST= 0x09L, // - - * * + PS_TEXTUREMODES_DOT_ZW= 0x0aL, // - - * * + PS_TEXTUREMODES_DOT_RFLCT_DIFF= 0x0bL, // - - * - + PS_TEXTUREMODES_DOT_RFLCT_SPEC= 0x0cL, // - - - * + PS_TEXTUREMODES_DOT_STR_3D= 0x0dL, // - - - * + PS_TEXTUREMODES_DOT_STR_CUBE= 0x0eL, // - - - * + PS_TEXTUREMODES_DPNDNT_AR= 0x0fL, // - * * * + PS_TEXTUREMODES_DPNDNT_GB= 0x10L, // - * * * + PS_TEXTUREMODES_DOTPRODUCT= 0x11L, // - * * - + PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST= 0x12L, // - - - * + // 0x13-0x1f reserved +}; + +// ========================================================================================================= +// PSDotMapping +// --------.--------.--------.-----xxx // stage1 +// --------.--------.--------.-xxx---- // stage2 +// --------.--------.-----xxx.-------- // stage3 + +#define PS_DOTMAPPING(t0,t1,t2,t3) (((t3)<<8)|((t2)<<4)|(t1)) + +// Mappings: +// ZERO_TO_ONE :rgb->(r,g,b): 0x0=>0.0, 0xff=>1.0 +// MINUS1_TO_1_D3D :rgb->(r,g,b): 0x0=>-128/127, 0x01=>-1.0, 0x80=>0.0, 0xff=>1.0 +// MINUS1_TO_1_GL :rgb->(r,g,b): 0x80=>-1.0, 0x0=>0.0, 0x7f=>1.0 +// MINUS1_TO_1 :rgb->(r,g,b): 0x80=>-128/127, 0x81=>-1.0, 0x0=>0.0, 0x7f=>1.0 +// HILO_1 :HL->(H,L,1.0): 0x0000=>0.0, 0xffff=>1.0 +// HILO_HEMISPHERE :HL->(H,L,sqrt(1-H*H-L*L)): 0x8001=>-1.0, 0x0=>0.0, 0x7fff=>1.0, 0x8000=>-32768/32767 + +enum PS_DOTMAPPING +{ // valid in stage 0 1 2 3 + PS_DOTMAPPING_ZERO_TO_ONE= 0x00L, // - * * * + PS_DOTMAPPING_MINUS1_TO_1_D3D= 0x01L, // - * * * + PS_DOTMAPPING_MINUS1_TO_1_GL= 0x02L, // - * * * + PS_DOTMAPPING_MINUS1_TO_1= 0x03L, // - * * * + PS_DOTMAPPING_HILO_1= 0x04L, // - * * * + // ? 0x05L ? + // ? 0x06L ? + PS_DOTMAPPING_HILO_HEMISPHERE= 0x07L, // - * * * +}; + +// ========================================================================================================= +// PSCompareMode +// --------.--------.--------.----xxxx // stage0 +// --------.--------.--------.xxxx---- // stage1 +// --------.--------.----xxxx.-------- // stage2 +// --------.--------.xxxx----.-------- // stage3 + +#define PS_COMPAREMODE(t0,t1,t2,t3) (((t3)<<12)|((t2)<<8)|((t1)<<4)|(t0)) + +enum PS_COMPAREMODE +{ + PS_COMPAREMODE_S_LT= 0x00L, + PS_COMPAREMODE_S_GE= 0x01L, + + PS_COMPAREMODE_T_LT= 0x00L, + PS_COMPAREMODE_T_GE= 0x02L, + + PS_COMPAREMODE_R_LT= 0x00L, + PS_COMPAREMODE_R_GE= 0x04L, + + PS_COMPAREMODE_Q_LT= 0x00L, + PS_COMPAREMODE_Q_GE= 0x08L, +}; + +// ========================================================================================================= +// PSInputTexture +// --------.-------x.--------.-------- // stage2 +// --------.--xx----.--------.-------- // stage3 +// +// Selects the other texture to use as an input in the following texture modes: +// DOT_ST, DOT_STR_3D, DOT_STR_CUBE, DOT_ZW, DOT_RFLCT_SPEC, +// DOT_RFLCT_DIFF, DPNDNT_AR, DPNDNT_GB, BUMPENVMAP, +// BUMPENVMAP_LUM, DOT_PRODUCT + +#define PS_INPUTTEXTURE(t0,t1,t2,t3) (((t3)<<20)|((t2)<<16)) + + +/*---------------------------------------------------------------------------------*/ +/* Color combiners - The following members of the D3DPixelShaderDef structure */ +/* define the state for the eight stages of color combiners: */ +/* PSCombinerCount - Number of stages */ +/* PSAlphaInputs[8] - Inputs for alpha portion of each stage */ +/* PSRGBInputs[8] - Inputs for RGB portion of each stage */ +/* PSConstant0[8] - Constant 0 for each stage */ +/* PSConstant1[8] - Constant 1 for each stage */ +/* PSFinalCombinerConstant0 - Constant 0 for final combiner */ +/* PSFinalCombinerConstant1 - Constant 1 for final combiner */ +/* PSAlphaOutputs[8] - Outputs for alpha portion of each stage */ +/* PSRGBOutputs[8] - Outputs for RGB portion of each stage */ +/*---------------------------------------------------------------------------------*/ + + +// ========================================================================================================= +// PSCombinerCount +// --------.--------.--------.----xxxx // number of combiners (1-8) +// --------.--------.-------x.-------- // mux bit (0= LSB, 1= MSB) +// --------.--------.---x----.-------- // separate C0 +// --------.-------x.--------.-------- // separate C1 + +#define PS_COMBINERCOUNT(count, flags) (((flags)<<8)|(count)) +// count is 1-8, flags contains one or more values from PS_COMBINERCOUNTFLAGS + +enum PS_COMBINERCOUNTFLAGS +{ + PS_COMBINERCOUNT_MUX_LSB= 0x0000L, // mux on r0.a lsb + PS_COMBINERCOUNT_MUX_MSB= 0x0001L, // mux on r0.a msb + + PS_COMBINERCOUNT_SAME_C0= 0x0000L, // c0 same in each stage + PS_COMBINERCOUNT_UNIQUE_C0= 0x0010L, // c0 unique in each stage + + PS_COMBINERCOUNT_SAME_C1= 0x0000L, // c1 same in each stage + PS_COMBINERCOUNT_UNIQUE_C1= 0x0100L // c1 unique in each stage +}; + +// ========================================================================================================= +// PSRGBInputs[0-7] +// PSAlphaInputs[0-7] +// PSFinalCombinerInputsABCD +// PSFinalCombinerInputsEFG +// --------.--------.--------.----xxxx // D register +// --------.--------.--------.---x---- // D channel (0= RGB/BLUE, 1= ALPHA) +// --------.--------.--------.xxx----- // D input mapping +// --------.--------.----xxxx.-------- // C register +// --------.--------.---x----.-------- // C channel (0= RGB/BLUE, 1= ALPHA) +// --------.--------.xxx-----.-------- // C input mapping +// --------.----xxxx.--------.-------- // B register +// --------.---x----.--------.-------- // B channel (0= RGB/BLUE, 1= ALPHA) +// --------.xxx-----.--------.-------- // B input mapping +// ----xxxx.--------.--------.-------- // A register +// ---x----.--------.--------.-------- // A channel (0= RGB/BLUE, 1= ALPHA) +// xxx-----.--------.--------.-------- // A input mapping + +// examples: +// +// shader.PSRGBInputs[3]= PS_COMBINERINPUTS( +// PS_REGISTER_T0 | PS_INPUTMAPPING_EXPAND_NORMAL | PS_CHANNEL_RGB, +// PS_REGISTER_C0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_ALPHA, +// PS_REGISTER_ZERO, +// PS_REGISTER_ZERO); +// +// shader.PSFinalCombinerInputsABCD= PS_COMBINERINPUTS( +// PS_REGISTER_T0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_ALPHA, +// PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL | PS_CHANNEL_RGB, +// PS_REGISTER_EFPROD | PS_INPUTMAPPING_UNSIGNED_INVERT | PS_CHANNEL_RGB, +// PS_REGISTER_ZERO); +// +// PS_FINALCOMBINERSETTING is set in 4th field of PSFinalCombinerInputsEFG with PS_COMBINERINPUTS +// example: +// +// shader.PSFinalCombinerInputsEFG= PS_COMBINERINPUTS( +// PS_REGISTER_R0 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_RGB, +// PS_REGISTER_R1 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_RGB, +// PS_REGISTER_R1 | PS_INPUTMAPPING_UNSIGNED_IDENTITY | PS_CHANNEL_BLUE, +// PS_FINALCOMBINERSETTING_CLAMP_SUM | PS_FINALCOMBINERSETTING_COMPLEMENT_R0); + +#define PS_COMBINERINPUTS(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) +// For PSFinalCombinerInputsEFG, +// a,b,c contain a value from PS_REGISTER, PS_CHANNEL, and PS_INPUTMAPPING for input E,F, and G +// d contains values from PS_FINALCOMBINERSETTING +// For all other inputs, +// a,b,c,d each contain a value from PS_REGISTER, PS_CHANNEL, and PS_INPUTMAPPING + +// The input can have the following mappings applied : +// +// PS_INPUTMAPPING_UNSIGNED_IDENTITY : y = max(0,x) = 1*max(0,x) + 0.0 +// PS_INPUTMAPPING_UNSIGNED_INVERT : y = 1 - max(0,x) = -1*max(0,x) + 1.0 +// PS_INPUTMAPPING_EXPAND_NORMAL : y = 2*max(0,x) - 1 = 2*max(0,x) - 1.0 +// PS_INPUTMAPPING_EXPAND_NEGATE : y = 1 - 2*max(0,x) = -2*max(0,x) + 1.0 +// PS_INPUTMAPPING_HALFBIAS_NORMAL : y = max(0,x) - 1/2 = 1*max(0,x) - 0.5 +// PS_INPUTMAPPING_HALFBIAS_NEGATE : y = 1/2 - max(0,x) = -1*max(0,x) + 0.5 +// PS_INPUTMAPPING_SIGNED_IDENTITY : y = x = 1* x + 0.0 +// PS_INPUTMAPPING_SIGNED_NEGATE : y = -x = -1* x + 0.0 +// +// (Note : I don't know for sure if the max() operation mentioned above is indeed what happens, +// as there's no further documentation available on this. Native Direct3D can clamp with the +// '_sat' instruction modifier, but that's not really the same as these Xbox1 input mappings.) +// +// When the input register is PS_ZERO, the above mappings result in the following constants: +// +// PS_REGISTER_NEGATIVE_ONE (PS_INPUTMAPPING_EXPAND_NORMAL on zero) : y = -1.0 +// PS_REGISTER_NEGATIVE_ONE_HALF (PS_INPUTMAPPING_HALFBIAS_NORMAL on zero) : y = -0.5 +// PS_REGISTER_ZERO itself : y = 0.0 +// PS_REGISTER_ONE_HALF (PS_INPUTMAPPING_HALFBIAS_NEGATE on zero) : y = 0.5 +// PS_REGISTER_ONE (PS_INPUTMAPPING_UNSIGNED_INVERT on zero) : y = 1.0 +// (Note : It has no define, but PS_INPUTMAPPING_EXPAND_NEGATE on zero results in ONE too!) + +enum PS_INPUTMAPPING +{ + PS_INPUTMAPPING_UNSIGNED_IDENTITY= 0x00L, // max(0,x) OK for final combiner: y = abs(x) + PS_INPUTMAPPING_UNSIGNED_INVERT= 0x20L, // 1 - max(0,x) OK for final combiner: y = 1 - x + PS_INPUTMAPPING_EXPAND_NORMAL= 0x40L, // 2*max(0,x) - 1 invalid for final combiner + PS_INPUTMAPPING_EXPAND_NEGATE= 0x60L, // 1 - 2*max(0,x) invalid for final combiner + PS_INPUTMAPPING_HALFBIAS_NORMAL= 0x80L, // max(0,x) - 1/2 invalid for final combiner + PS_INPUTMAPPING_HALFBIAS_NEGATE= 0xa0L, // 1/2 - max(0,x) invalid for final combiner + PS_INPUTMAPPING_SIGNED_IDENTITY= 0xc0L, // x invalid for final combiner + PS_INPUTMAPPING_SIGNED_NEGATE= 0xe0L, // -x invalid for final combiner +}; + +enum PS_REGISTER +{ + PS_REGISTER_ZERO= 0x00L, // r + PS_REGISTER_DISCARD= 0x00L, // w + PS_REGISTER_C0= 0x01L, // r + PS_REGISTER_C1= 0x02L, // r + PS_REGISTER_FOG= 0x03L, // r + PS_REGISTER_V0= 0x04L, // r/w + PS_REGISTER_V1= 0x05L, // r/w + PS_REGISTER_T0= 0x08L, // r/w + PS_REGISTER_T1= 0x09L, // r/w + PS_REGISTER_T2= 0x0aL, // r/w + PS_REGISTER_T3= 0x0bL, // r/w + PS_REGISTER_R0= 0x0cL, // r/w + PS_REGISTER_R1= 0x0dL, // r/w + PS_REGISTER_V1R0_SUM= 0x0eL, // r + PS_REGISTER_EF_PROD= 0x0fL, // r + + PS_REGISTER_ONE= PS_REGISTER_ZERO | PS_INPUTMAPPING_UNSIGNED_INVERT, // 0x20 OK for final combiner + PS_REGISTER_NEGATIVE_ONE= PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL, // 0x40 invalid for final combiner + PS_REGISTER_ONE_HALF= PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NEGATE, // 0xa0 invalid for final combiner + PS_REGISTER_NEGATIVE_ONE_HALF= PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NORMAL, // 0x80 invalid for final combiner + + PS_REGISTER_CXBX_PROD = PS_REGISTER_ZERO | PS_INPUTMAPPING_SIGNED_IDENTITY, // Cxbx internal use +}; + +// FOG ALPHA is only available in final combiner +// V1R0_SUM and EF_PROD are only available in final combiner (A,B,C,D inputs only) +// V1R0_SUM_ALPHA and EF_PROD_ALPHA are not available +// R0_ALPHA is initialized to T0_ALPHA in stage0 + +enum PS_CHANNEL +{ + PS_CHANNEL_RGB= 0x00, // used as RGB source + PS_CHANNEL_BLUE= 0x00, // used as ALPHA source + PS_CHANNEL_ALPHA= 0x10, // used as RGB or ALPHA source +}; + +constexpr DWORD PS_ChannelMask = (DWORD)PS_CHANNEL_ALPHA; +constexpr DWORD PS_NoChannelMask = (DWORD)(~PS_ChannelMask); +constexpr DWORD PS_AlphaChannelsMask = (DWORD)(PS_ChannelMask | (PS_ChannelMask << 8) | (PS_ChannelMask << 16) | (PS_ChannelMask << 24)); +constexpr DWORD PS_NoChannelsMask = (DWORD)(~PS_AlphaChannelsMask); + +enum PS_FINALCOMBINERSETTING +{ + PS_FINALCOMBINERSETTING_CLAMP_SUM= 0x80, // V1+R0 sum clamped to [0,1] + PS_FINALCOMBINERSETTING_COMPLEMENT_V1= 0x40, // unsigned invert mapping (1 - v1) is used as an input to the sum rather than v1 + PS_FINALCOMBINERSETTING_COMPLEMENT_R0= 0x20, // unsigned invert mapping (1 - r0) is used as an input to the sum rather than r0 +}; + +// ========================================================================================================= +// PSRGBOutputs[0-7] +// PSAlphaOutputs[0-7] +// --------.--------.--------.----xxxx // CD register +// --------.--------.--------.xxxx---- // AB register +// --------.--------.----xxxx.-------- // SUM register +// --------.--------.---x----.-------- // CD output (0= multiply, 1= dot product) +// --------.--------.--x-----.-------- // AB output (0= multiply, 1= dot product) +// --------.--------.-x------.-------- // AB_CD mux/sum select (0= sum, 1= mux) +// --------.------xx.x-------.-------- // Output mapping +// --------.-----x--.--------.-------- // CD blue to alpha +// --------.----x---.--------.-------- // AB blue to alpha + +#define PS_COMBINEROUTPUTS(ab,cd,mux_sum,flags) (((flags)<<12)|((mux_sum)<<8)|((ab)<<4)|(cd)) +// ab,cd,mux_sum contain a value from PS_REGISTER +// flags contains values from PS_COMBINEROUTPUT + +enum PS_COMBINEROUTPUT +{ + PS_COMBINEROUTPUT_IDENTITY= 0x00L, // y = x + PS_COMBINEROUTPUT_BIAS= 0x08L, // y = x - 0.5 + PS_COMBINEROUTPUT_SHIFTLEFT_1= 0x10L, // y = x*2 + PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS= 0x18L, // y = (x - 0.5)*2 + PS_COMBINEROUTPUT_SHIFTLEFT_2= 0x20L, // y = x*4 + // PS_COMBINEROUTPUT_SHIFTLEFT_2_BIAS= 0x28L, // y = (x - 0.5)*4 + PS_COMBINEROUTPUT_SHIFTRIGHT_1= 0x30L, // y = x/2 + // PS_COMBINEROUTPUT_SHIFTRIGHT_1_BIAS= 0x38L, // y = (x - 0.5)/2 + + PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA= 0x80L, // RGB only + + PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA= 0x40L, // RGB only + + PS_COMBINEROUTPUT_AB_MULTIPLY= 0x00L, + PS_COMBINEROUTPUT_AB_DOT_PRODUCT= 0x02L, // RGB only + + PS_COMBINEROUTPUT_CD_MULTIPLY= 0x00L, + PS_COMBINEROUTPUT_CD_DOT_PRODUCT= 0x01L, // RGB only + + PS_COMBINEROUTPUT_AB_CD_SUM= 0x00L, // 3rd output is AB+CD + PS_COMBINEROUTPUT_AB_CD_MUX= 0x04L, // 3rd output is MUX(AB,CD) based on R0.a +}; + +// AB_CD register output must be DISCARD if either AB_DOT_PRODUCT or CD_DOT_PRODUCT are set + +// ========================================================================================================= +// PSC0Mapping +// PSC1Mapping +// --------.--------.--------.----xxxx // offset of D3D constant for stage 0 +// --------.--------.--------.xxxx---- // offset of D3D constant for stage 1 +// --------.--------.----xxxx.-------- // offset of D3D constant for stage 2 +// --------.--------.xxxx----.-------- // offset of D3D constant for stage 3 +// --------.----xxxx.--------.-------- // offset of D3D constant for stage 4 +// --------.xxxx----.--------.-------- // offset of D3D constant for stage 5 +// ----xxxx.--------.--------.-------- // offset of D3D constant for stage 6 +// xxxx----.--------.--------.-------- // offset of D3D constant for stage 7 + +#define PS_CONSTANTMAPPING(s0,s1,s2,s3,s4,s5,s6,s7) \ + (((DWORD)(s0)&0xf)<< 0) | (((DWORD)(s1)&0xf)<< 4) | \ + (((DWORD)(s2)&0xf)<< 8) | (((DWORD)(s3)&0xf)<<12) | \ + (((DWORD)(s4)&0xf)<<16) | (((DWORD)(s5)&0xf)<<20) | \ + (((DWORD)(s6)&0xf)<<24) | (((DWORD)(s7)&0xf)<<28) +// s0-s7 contain the offset of the D3D constant that corresponds to the +// c0 or c1 constant in stages 0 through 7. These mappings are only used in +// SetPixelShaderConstant(). + +// ========================================================================================================= +// PSFinalCombinerConstants +// --------.--------.--------.----xxxx // offset of D3D constant for C0 +// --------.--------.--------.xxxx---- // offset of D3D constant for C1 +// --------.--------.-------x.-------- // Adjust texture flag + +#define PS_FINALCOMBINERCONSTANTS(c0,c1,flags) (((DWORD)(flags) << 8) | ((DWORD)(c0)&0xf)<< 0) | (((DWORD)(c1)&0xf)<< 4) +// c0 and c1 contain the offset of the D3D constant that corresponds to the +// constants in the final combiner. These mappings are only used in +// SetPixelShaderConstant(). Flags contains values from PS_GLOBALFLAGS + +enum PS_GLOBALFLAGS +{ + // if this flag is set, the texture mode for each texture stage is adjusted as follows: + // if set texture is a cubemap, + // change PS_TEXTUREMODES_PROJECT2D to PS_TEXTUREMODES_CUBEMAP + // change PS_TEXTUREMODES_PROJECT3D to PS_TEXTUREMODES_CUBEMAP + // change PS_TEXTUREMODES_DOT_STR_3D to PS_TEXTUREMODES_DOT_STR_CUBE + // if set texture is a volume texture, + // change PS_TEXTUREMODES_PROJECT2D to PS_TEXTUREMODES_PROJECT3D + // change PS_TEXTUREMODES_CUBEMAP to PS_TEXTUREMODES_PROJECT3D + // change PS_TEXTUREMODES_DOT_STR_CUBE to PS_TEXTUREMODES_DOT_STR_3D + // if set texture is neither cubemap or volume texture, + // change PS_TEXTUREMODES_PROJECT3D to PS_TEXTUREMODES_PROJECT2D + // change PS_TEXTUREMODES_CUBEMAP to PS_TEXTUREMODES_PROJECT2D + + PS_GLOBALFLAGS_NO_TEXMODE_ADJUST= 0x0000L, // don"t adjust texture modes + PS_GLOBALFLAGS_TEXMODE_ADJUST= 0x0001L, // adjust texture modes according to set texture +}; + +enum PSH_OPCODE +{ + PO_COMMENT, + PO_PS, + PO_DEF, + PO_DCL, // Note : ps.2.0 and up only + PO_DCL_2D, // Note : ps.2.0 and up only + PO_DCL_CUBE, // Note : ps.2.0 and up only + PO_DCL_VOLUME, // Note : ps.2.0 and up only + PO_TEX, + PO_TEXLD, // Note : ps.1.4 only + PO_TEXLD2, // Note : ps.2.0 and up only + PO_TEXBEM, + PO_TEXBEML, + PO_TEXBRDF, // Xbox ext. + PO_TEXCOORD, + PO_TEXCRD, // Note: ps.1.4 only + PO_TEXKILL, + PO_TEXREG2AR, + PO_TEXREG2GB, + PO_TEXDP3, // Note : ps.1.3 only + PO_TEXDP3TEX, // Note : ps.1.3 only + PO_TEXM3X2TEX, + PO_TEXM3X2DEPTH, // Note : requires ps.1.3 and a preceding texm3x2pad + PO_TEXM3X3DIFF, // Xbox ext. + PO_TEXM3X3VSPEC, + PO_TEXM3X3TEX, // Note : Uses a cube texture + PO_TEXM3X2PAD, // Note : Must be combined with texm3x2tex or texm3x2depth + PO_TEXM3X3PAD, + PO_TEXM3X3SPEC, // NOTE : NEEDS 3 ARGUMENTS! + // Direct3D8 arithmetic instructions : + PO_ADD, + PO_CMP, + PO_CND, + PO_DP3, // dp3 d, s1,s2 : d=s0 dot s1 (replicated to all channels, .rgb=color only, .a=color+alpha) + PO_DP4, // dp3 d, s1,s2 : d.r=d.g=d.b=d.a=(s1.r*s2.r)+(s1.g*s2.g)+(s1.b*s2.b)+(s1.a*s2.a) + PO_LRP, + PO_MAD, + PO_MOV, + PO_MUL, + PO_NOP, + PO_SUB, + PO_RCP, // Note: ps.2.0 and up only + // Xbox1 opcodes : + PO_XMMA, + PO_XMMC, + PO_XDM, + PO_XDD, + PO_XFC, + PO_XPS, +}; + +const struct { char *mn; int _Out; int _In; char *note; } PSH_OPCODE_DEFS[/*PSH_OPCODE*/] = { + // Pixel shader header opcodes (must be specified in this order) : + {/* PO_COMMENT */ /*mn:*/";", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // + {/* PO_PS */ /*mn:*/"ps", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // Must occur once + {/* PO_DEF */ /*mn:*/"def", /*_Out: */ 1, /*_In: */ 4, /*note:*/"" }, // Output must be a PARAM_C, arguments must be 4 floats [0.00f .. 1.00f] + {/* PO_DCL */ /*mn:*/"dcl", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, // Note : ps.2.0 and up only + {/* PO_DCL_2D */ /*mn:*/"dcl_2d", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, // Note : ps.2.0 and up only + {/* PO_DCL_CUBE */ /*mn:*/"dcl_cube", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, // Note : ps.2.0 and up only + {/* PO_DCL_VOLUME */ /*mn:*/"dcl_volume", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, // Note : ps.2.0 and up only + {/* PO_TEX */ /*mn:*/"tex", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, + {/* PO_TEXLD */ /*mn:*/"texld", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // Note : ps.1.4 and up only + {/* PO_TEXLD2 */ /*mn:*/"texld", /*_Out: */ 1, /*_In: */ 2, /*note:*/"" }, // Note : ps.1.4 and up only + {/* PO_TEXBEM */ /*mn:*/"texbem", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXBEML */ /*mn:*/"texbeml", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXBRDF */ /*mn:*/"texbrdf", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Not supported by Direct3D8 ? + {/* PO_TEXCOORD */ /*mn:*/"texcoord", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, + {/* PO_TEXCRD */ /*mn:*/"texcrd", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // Note: ps.1.4 only + {/* PO_TEXKILL */ /*mn:*/"texkill", /*_Out: */ 1, /*_In: */ 0, /*note:*/"" }, + {/* PO_TEXDP3 */ /*mn:*/"texdp3", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXDP3TEX */ /*mn:*/"texdp3tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X2TEX */ /*mn:*/"texm3x2tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X2DEPTH */ /*mn:*/"texm3x2depth", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ requires ps.1.3 and a preceding texm3x2pad + {/* PO_TEXM3X3DIFF */ /*mn:*/"texm3x3diff", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Not supported by Direct3D8 ? + {/* PO_TEXM3X3VSPEC */ /*mn:*/"texm3x3vspec", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X3TEX */ /*mn:*/"texm3x3tex", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, // /*note: */ Uses a cube texture + {/* PO_TEXREG2AR */ /*mn:*/"texreg2ar", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXREG2GB */ /*mn:*/"texreg2gb", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X2PAD */ /*mn:*/"texm3x2pad", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X3PAD */ /*mn:*/"texm3x3pad", /*_Out: */ 1, /*_In: */ 1, /*note:*/"" }, + {/* PO_TEXM3X3SPEC */ /*mn:*/"texm3x3spec", /*_Out: */ 1, /*_In: */ 2, /*note:*/"" }, + // Arithmetic opcodes : + {/* PO_ADD */ /*mn:*/"add", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0+s1" }, + {/* PO_CMP */ /*mn:*/"cmp", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0={s0>=0?s1:s2}" }, + {/* PO_CND */ /*mn:*/"cnd", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0={s0.a>0.5?s1:s2}" }, // 1st input must be "r0.a" + {/* PO_DP3 */ /*mn:*/"dp3", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0 dot3 s1" }, + {/* PO_DP4 */ /*mn:*/"dp4", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0 dot4 s1" }, + {/* PO_LRP */ /*mn:*/"lrp", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0=s0*s1+{1-s0}*s2=s0*{s1-s2}+s2" }, + {/* PO_MAD */ /*mn:*/"mad", /*_Out: */ 1, /*_In: */ 3, /*note:*/"d0=s0*s1+s2" }, + {/* PO_MOV */ /*mn:*/"mov", /*_Out: */ 1, /*_In: */ 1, /*note:*/"d0=s0" }, + {/* PO_MUL */ /*mn:*/"mul", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0*s1" }, + {/* PO_NOP */ /*mn:*/"nop", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, + {/* PO_SUB */ /*mn:*/"sub", /*_Out: */ 1, /*_In: */ 2, /*note:*/"d0=s0-s1" }, + {/* PO_RCP */ /*mn:*/"rcp", /*_Out: */ 1, /*_In: */ 1, /*note:*/"d0=1/s0" }, // Note: ps.2.0 and up only + // Xbox-only {NV2A} opcodes : + {/* PO_XMMA */ /*mn:*/"xmma", /*_Out: */ 3, /*_In: */ 4, /*note:*/"d0=s0*s1, d1=s2*s3, d2={s0*s1}+{s2*s3}" }, + {/* PO_XMMC */ /*mn:*/"xmmc", /*_Out: */ 3, /*_In: */ 4, /*note:*/"d0=s0*s1, d1=s2*s3, d2={r0.a>0.5}?{s0*s1}:{s2*s3}" }, + {/* PO_XDM */ /*mn:*/"xdm", /*_Out: */ 2, /*_In: */ 4, /*note:*/"d0=s0 dot s1, d1=s2*s3" }, + {/* PO_XDD */ /*mn:*/"xdd", /*_Out: */ 2, /*_In: */ 4, /*note:*/"d0=s0 dot s1, d1=s2 dot s3" }, + {/* PO_XFC */ /*mn:*/"xfc", /*_Out: */ 0, /*_In: */ 7, /*note:*/"r0.rgb=s0*s1+{1-s0}*s2+s3, r0.a=s6.a, prod=s4*s5, sum=r0+v1" }, + {/* PO_XPS */ /*mn:*/"xps", /*_Out: */ 0, /*_In: */ 0, /*note:*/"" }, // Must occur once +}; + +enum PSH_ARGUMENT_TYPE +{ + PARAM_VALUE, // Xbox only; Numberic constants used in Xbox-only opcodes + PARAM_DISCARD, // Xbox only; + PARAM_FOG, // Final combiner only; Read-only register fog register + PARAM_V1R0_SUM, // Final combiner only; Read-only register that contains the result of V1+R0 + PARAM_EF_PROD, // Final combiner only; Read-only register that contains the result of final combiner parameters E * F + PARAM_oDepth, // Output depth register + PARAM_R, // Temporary registers (unassigned except r0.a, which on NV2A is initially set to t0.a) + PARAM_T, // Textures + PARAM_V, // Vertex colors + PARAM_C, // Constant registers, set by def opcodes or SetPixelShaderConstant + PARAM_S, // Sampler registers + PARAM_oC, // Output color registers +}; + +const char *PSH_ARGUMENT_TYPE_Str[/*PSH_ARGUMENT_TYPE*/] = { +// Prefix # r/w Input? Output? Note + "", // * r No No Used for numeric constants like -1, 0, 1 + "discard", // * w No Yes Only for xbox opcodes (native opcodes have single output - discards must be removed) + "fog", // 1 r Yes No Only for final combiner parameter + "sum", // 1 r Yes No Only for final combiner parameter + "prod", // 1 r Yes No Only for final combiner parameter + "oDepth", // + "r", // 2 r/w Yes Yes We fake a few extra registers and resolve them in FixupPixelShader + "t", // 4 r/w Yes Yes D3D9 cannot write to these! + "v", // 2 r Yes Yes + "c", // 16 r Yes No Xbox has 8*c0,c1=16, while PC D3D8 has only 8, we try to reduce that in FixupPixelShader + "s", // 16 - No Yes + "oC", // +}; + +constexpr int XFC_COMBINERSTAGENR = XTL::X_PSH_COMBINECOUNT; // Always call XFC 'stage 9', 1 after the 8th combiner + +constexpr int PSH_XBOX_MAX_C_REGISTER_COUNT = 16; +constexpr int PSH_XBOX_MAX_R_REGISTER_COUNT = 2; +constexpr int PSH_XBOX_MAX_T_REGISTER_COUNT = 4; +constexpr int PSH_XBOX_MAX_V_REGISTER_COUNT = 2; +// Extra constants to support features not present in Native D3D : +constexpr int PSH_XBOX_CONSTANT_FOG = PSH_XBOX_MAX_C_REGISTER_COUNT; // = 16 +constexpr int PSH_XBOX_CONSTANT_FC0 = PSH_XBOX_CONSTANT_FOG + 1; // = 17 +constexpr int PSH_XBOX_CONSTANT_FC1 = PSH_XBOX_CONSTANT_FC0 + 1; // = 18 +constexpr int PSH_XBOX_CONSTANT_MUL0 = PSH_XBOX_CONSTANT_FC1 + 1; // = 19 +constexpr int PSH_XBOX_CONSTANT_MUL1 = PSH_XBOX_CONSTANT_MUL0 + 1; // = 20 +constexpr int PSH_XBOX_CONSTANT_BEM = PSH_XBOX_CONSTANT_MUL1 + 1; // = 21 +constexpr int PSH_XBOX_CONSTANT_LUM = PSH_XBOX_CONSTANT_BEM + 4; // = 25 +constexpr int PSH_XBOX_CONSTANT_MAX = PSH_XBOX_CONSTANT_LUM + 4; // = 29 + +constexpr int FakeRegNr_Sum = PSH_XBOX_MAX_T_REGISTER_COUNT + 0; +constexpr int FakeRegNr_Prod = PSH_XBOX_MAX_T_REGISTER_COUNT + 1; +constexpr int FakeRegNr_Xmm1 = PSH_XBOX_MAX_T_REGISTER_COUNT + 2; +constexpr int FakeRegNr_Xmm2 = PSH_XBOX_MAX_T_REGISTER_COUNT + 3; + +enum PSH_INST_MODIFIER { + INSMOD_NONE, // y = x + INSMOD_BIAS, // y = x - 0.5 // Xbox only : TODO : Fixup occurrances! + INSMOD_X2, // y = x * 2 + INSMOD_BX2, // y = (x - 0.5) * 2 // Xbox only : TODO : Fixup occurrances! + INSMOD_X4, // y = x * 4 + INSMOD_D2, // y = x * 0.5 + INSMOD_SAT, // Xbox doesn"t support this, but has ARGMOD_SATURATE instead + INSMOD_X8, // y = x * 8 // ps 1.4 only + INSMOD_D4, // y = x * 0.25 // ps 1.4 only + INSMOD_D8, // y = x * 0.125 // ps 1.4 only +}; + +const char *PSH_INST_MODIFIER_Str[/*PSH_INST_MODIFIER*/] = { + "", + "_bias", + "_x2", + "_bx2", + "_x4", + "_d2", + "_sat", + "_x8", + "_d4", + "_d8", +}; + +// Four argument modifiers (applied in this order) : +// 1: Inversion (invert or negate : "1-" or "-") +// 2: Apply bias ("_bias") +// 3: Apply scale ("_x2", "_bx2", "_x4", or "_d2") +// 4: Apply clamp ("_sat") +enum PSH_ARG_MODIFIER { + ARGMOD_IDENTITY, // y = x + + ARGMOD_INVERT, // y = 1-x -> 0..1 > 1..0 + ARGMOD_NEGATE, // y = -x -> 0..1 > 0..-1 + + ARGMOD_BIAS, // y = x-0.5 -> 0..1 > -0.5..0.5 + + ARGMOD_SCALE_X2, // y = x*2 -> 0..1 > 0..2 + ARGMOD_SCALE_BX2, // y = (x*2)-1 -> 0..1 > -1..1 + ARGMOD_SCALE_X4, // y = x*4 -> 0..1 > 0..4 + ARGMOD_SCALE_D2, // y = x/2 -> 0..1 > 0..0.5 + + ARGMOD_SATURATE, // Xbox - not available in PS1.3 (can be done on output instead) + + ARGMOD_ALPHA_REPLICATE, + ARGMOD_BLUE_REPLICATE // PS1.1-PS1.3 only allow this if destination writemask = .a +}; + +typedef DWORD PSH_ARG_MODIFIERs; // = set of PSH_ARG_MODIFIER; + +const char *PSH_ARG_MODIFIER_Str[/*PSH_ARG_MODIFIER*/] = { + "%s", + + "1-%s", + "-%s", + + "%s_bias", + + "%s_x2", + "%s_bx2", + "%s_x4", + "%s_d2", + + "%s_sat", + + "%s", // .a is added via Mask + "%s" // .b idem +}; + +struct RPSRegisterObject { + bool IsAlpha; + PS_REGISTER Reg; + + void Decode(uint8_t Value, bool aIsAlpha); + std::string DecodedToString(); +}; + +struct RPSInputRegister : RPSRegisterObject { + PS_CHANNEL Channel; + PS_INPUTMAPPING InputMapping; + + void Decode(uint8_t Value, bool aIsAlpha); + std::string DecodedToString(); +}; + +struct RPSCombinerOutput : RPSRegisterObject { + RPSInputRegister Input1; // Called InputA or InputC (depending if it's inside the AB or CD combiner) + RPSInputRegister Input2; // Called InputC or InputD (depending if it's inside the AB or CD combiner) + bool DotProduct; // False=Multiply, True=DotProduct + bool BlueToAlpha; // False=Alpha-to-Alpha, True=Blue-to-Alpha + + void Decode(uint8_t Value, DWORD PSInputs, bool aIsAlpha); +}; + +struct RPSCombinerOutputMuxSum : RPSRegisterObject { + RPSCombinerOutput OutputAB; // Contains InputA and InputB (as Input1 and Input2) + RPSCombinerOutput OutputCD; // Contains InputC and InputD (as Input1 and Input2) +}; + +struct RPSCombinerStageChannel { + RPSCombinerOutputMuxSum OutputSUM; // Contains OutputAB, OutputCD + PS_COMBINEROUTPUT CombinerOutputFlags; + bool AB_CD_SUM; // True=AB+CD, False=MUX(AB;CD) based on R0.a + + void Decode(DWORD PSInputs, DWORD PSOutputs, bool aIsAlpha = false); +}; + +struct RPSCombinerStage { + RPSCombinerStageChannel RGB; + RPSCombinerStageChannel Alpha; +}; + +struct RPSFinalCombiner { + RPSInputRegister InputA; + RPSInputRegister InputB; + RPSInputRegister InputC; + RPSInputRegister InputD; + RPSInputRegister InputE; + RPSInputRegister InputF; + RPSInputRegister InputG; + + PS_FINALCOMBINERSETTING FinalCombinerFlags; + + uint8_t FinalCombinerC0Mapping; + uint8_t FinalCombinerC1Mapping; + + DWORD dwPS_GLOBALFLAGS; + + void Decode(const DWORD PSFinalCombinerInputsABCD, const DWORD PSFinalCombinerInputsEFG, const DWORD PSFinalCombinerConstants); +}; + +constexpr DWORD MASK_NONE = 0x000; +constexpr DWORD MASK_R = 0x001; +constexpr DWORD MASK_G = 0x002; +constexpr DWORD MASK_B = 0x004; +constexpr DWORD MASK_A = 0x008; +constexpr DWORD MASK_RGB = MASK_R | MASK_G | MASK_B; +constexpr DWORD MASK_RGBA = MASK_R | MASK_G | MASK_B | MASK_A; + +enum + TArgumentType { + atInput, atOutput, atFinalCombiner +}; + +typedef struct _PSH_RECOMPILED_SHADER { + XTL::X_D3DPIXELSHADERDEF PSDef; + std::string NewShaderStr; + DWORD ConvertedHandle; + bool ConstInUse[PSH_XBOX_CONSTANT_MAX]; + int ConstMapping[PSH_XBOX_CONSTANT_MAX]; +} PSH_RECOMPILED_SHADER, +*PPSH_RECOMPILED_SHADER; + +typedef struct _PSH_IMD_ARGUMENT { + PSH_ARGUMENT_TYPE Type; // For parameters: R, T, V or C For output : Discard, R, T or V + int16_t Address; // Register address + DWORD Mask; + PSH_ARG_MODIFIERs Modifiers; + float Multiplier; + + void SetConstValue(float Value); + float GetConstValue(); + bool UsesRegister(); + bool IsRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress); // overload; + bool IsRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress, DWORD aMask); // overload; + void SetRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress, DWORD aMask); + bool HasModifier(PSH_ARG_MODIFIER modifier); + bool SetScaleConstRegister(float factor, const PSH_RECOMPILED_SHADER& pRecompiled); + bool SetScaleBemLumRegister(D3DTEXTURESTAGESTATETYPE factor, int stage, const PSH_RECOMPILED_SHADER& pRecompiled); + std::string ToString(); + bool Decode(const DWORD Value, DWORD aMask, TArgumentType ArgumentType); + void Invert(); + void Negate(); +} PSH_IMD_ARGUMENT, +*PPSH_IMD_ARGUMENT; + +//TPSH_IMD_ARGUMENTArray = array[0..(MaxInt div SizeOf(PSH_IMD_ARGUMENT)) - 1] of PSH_IMD_ARGUMENT; +//PPSH_IMD_ARGUMENTs = ^TPSH_IMD_ARGUMENTArray; + +typedef struct _PSH_INTERMEDIATE_FORMAT { + int CombinerStageNr; + bool IsCombined; + PSH_OPCODE Opcode; + std::string CommentString; + PSH_INST_MODIFIER Modifier; + PSH_IMD_ARGUMENT Output[3]; // 3 = xmm* output count + PSH_IMD_ARGUMENT Parameters[7]; // 7 = xfc parameter count + + _PSH_INTERMEDIATE_FORMAT *Initialize(const PSH_OPCODE aOpcode); + std::string ToString(); + bool IsArithmetic(); + void ScaleOutput(float aFactor); + bool ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress); // overload; + bool ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask); // overload; + bool ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, int& addressCount, int& total); // overload; + bool WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress); // overload; + bool WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask); // overload; + void SwapParameter(const int Index1, const int Index2); + void XSwapOutput(); + bool MoveRemovableParametersRight(const int Index1, const int Index2); + bool XMoveNonRegisterOutputsRight(); + void XCopySecondOpcodeToFirst(const PSH_OPCODE aOpcode); + bool Decode(DWORD aCombinerStageNr, DWORD PSInputs, DWORD PSOutputs, DWORD aMask); + bool DecodeFinalCombiner(DWORD aPSFinalCombinerInputsABCD, DWORD aPSFinalCombinerInputsEFG); +} PSH_INTERMEDIATE_FORMAT, +*PPSH_INTERMEDIATE_FORMAT; + +struct PSH_XBOX_SHADER { + uint32_t m_PSVersion; // see D3DPS_VERSION - https://msdn.microsoft.com/en-us/library/windows/desktop/bb172592(v=vs.85).aspx + int MaxConstantFloatRegisters; + int MaxTemporaryRegisters; + int MaxSamplerRegisters; // Sampler (Direct3D 9 asm-ps) + int MaxTextureCoordinateRegisters; + int MaxInputColorRegisters; + int PSH_PC_MAX_REGISTER_COUNT; + + // Reserve enough slots for all shaders, so we need space for 2 constants, 5 lines per texture addressing codes and 10 lines per opcode : : + PSH_INTERMEDIATE_FORMAT Intermediate[2 + (XTL::X_D3DTS_STAGECOUNT * 5) + (XTL::X_PSH_COMBINECOUNT * 10) + 1]; + int IntermediateCount; + + PS_TEXTUREMODES PSTextureModes[XTL::X_D3DTS_STAGECOUNT]; + PS_DOTMAPPING PSDotMapping[XTL::X_D3DTS_STAGECOUNT]; + DWORD PSCompareMode[XTL::X_D3DTS_STAGECOUNT]; + int PSInputTexture[XTL::X_D3DTS_STAGECOUNT]; + + PS_FINALCOMBINERSETTING FinalCombinerFlags; + // Note : The following constants are only needed for PSH_XBOX_SHADER::DecodedToString, + // they are not involved in the actual pixel shader recompilation anymore : + RPSFinalCombiner FinalCombiner; + RPSCombinerStage Combiners[XTL::X_PSH_COMBINECOUNT]; + int NumberOfCombiners; + DWORD CombinerCountFlags; // For PS_COMBINERCOUNTFLAGS + // Read from CombinerCountFlags : + bool CombinerMuxesOnMsb; + bool CombinerHasUniqueC0; + bool CombinerHasUniqueC1; + + int StartPos; + + PSH_RECOMPILED_SHADER Recompiled = {}; + + void SetPSVersion(const uint32_t PSVersion); + + std::string ToString(); + void Log(const char *PhaseStr); + PPSH_INTERMEDIATE_FORMAT NewIntermediate(); + void InsertIntermediate(PPSH_INTERMEDIATE_FORMAT pIntermediate, int Index); + void DeleteIntermediate(int Index); + void DeleteLastIntermediate(); + std::string static OriginalToString(XTL::X_D3DPIXELSHADERDEF *pPSDef); + void Decode(XTL::X_D3DPIXELSHADERDEF *pPSDef); + PSH_RECOMPILED_SHADER Convert(XTL::X_D3DPIXELSHADERDEF *pPSDef); + std::string DecodedToString(XTL::X_D3DPIXELSHADERDEF *pPSDef); + bool _NextIs2D(int Stage); + bool DecodeTextureModes(XTL::X_D3DPIXELSHADERDEF *pPSDef); + int GetTextureStageModifiers(int Stage); + void InsertTex3x2Instructions(int Stage, int inputStage, std::vector& InsertIns); + void InsertTex3x3Instructions(int Stage, int inputStage, std::vector& InsertIns); + bool InsertTextureModeInstruction(XTL::X_D3DPIXELSHADERDEF *pPSDef, int Stage, PSH_OPCODE opcode, std::vector& InsertIns, int& InsertPos); + bool MoveRemovableParametersRight(); + void ConvertXboxOpcodesToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef); + void _SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, D3DCOLOR ConstColor); + void _SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, D3DCOLORVALUE ConstColor); + int _MapConstant(int ConstNr, bool *NativeConstInUse); + int _HandleConst(int XboxConst, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled, bool *NativeConstInUse, bool *EmittedNewConstant); + bool ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled); + bool RemoveUselessWrites(); + int MaxRegisterCount(PSH_ARGUMENT_TYPE aRegType); + bool IsValidNativeOutputRegister(PSH_ARGUMENT_TYPE aRegType, int index = -1); + int RegisterIsFreeFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress); + int RegisterIsUsedFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress); + int NextFreeRegisterFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int bIndex = -1, int startAddress = 0, int excludeAddress = -1); + bool IsRegisterFreeFromIndexOnwards(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress); + void ReplaceInputRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex = -1); + void ReplaceOutputRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex = -1); + void ReplaceRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex = -1, bool replaceInput = true, bool replaceOutput = true); + bool ConvertXMMToNative_Except3RdOutput(int i); + void ConvertXPSToNative(int i); + void ConvertXMMAToNative(int i); + void ConvertXMMCToNative(int i); + void ConvertXDMToNative(int i); + void ConvertXDDToNative(int i); + void ConvertXFCToNative(int i); + bool FixArgumentModifiers(); + bool CombineInstructions(); + bool RemoveNops(); + bool SimplifyMOV(PPSH_INTERMEDIATE_FORMAT Cur); + bool SimplifyADD(PPSH_INTERMEDIATE_FORMAT Cur); + bool SimplifyMAD(PPSH_INTERMEDIATE_FORMAT Cur, int index); + bool SimplifySUB(PPSH_INTERMEDIATE_FORMAT Cur); + bool SimplifyMUL(PPSH_INTERMEDIATE_FORMAT Cur); + bool SimplifyLRP(PPSH_INTERMEDIATE_FORMAT Cur, int index); + bool FixupCND(PPSH_INTERMEDIATE_FORMAT Cur, int index); + bool FixupPixelShader(); + bool FixInvalidSrcSwizzle(); + bool FixMissingR0a(); + bool FixMissingR1a(); + bool FixCoIssuedOpcodes(); + bool FixInvalidDstRegister(); + bool FixConstantParameters(); + bool FixInstructionModifiers(); + bool FixUninitializedReads(); + bool FixOverusedRegisters(); + bool FinalizeShader(); + + static void GetPSTextureModes(XTL::X_D3DPIXELSHADERDEF* pPSDef, PS_TEXTUREMODES psTextureModes[XTL::X_D3DTS_STAGECOUNT]); + static void GetPSDotMapping(XTL::X_D3DPIXELSHADERDEF* pPSDef, PS_DOTMAPPING psDotMapping[XTL::X_D3DTS_STAGECOUNT]); + static void GetPSCompareModes(XTL::X_D3DPIXELSHADERDEF* pPSDef, DWORD psCompareModes[XTL::X_D3DTS_STAGECOUNT]); + static void GetPSInputTexture(XTL::X_D3DPIXELSHADERDEF* pPSDef, int psInputTexture[XTL::X_D3DTS_STAGECOUNT]); +}; + +/* +* Blueshogun's code (useful for debugging the PixelShader binary format) +*/ + +// PS Texture Modes +char* PS_TextureModesStr[/*PS_TEXTUREMODES*/] = +{ + "PS_TEXTUREMODES_NONE", // 0x00 + "PS_TEXTUREMODES_PROJECT2D", // 0x01 + "PS_TEXTUREMODES_PROJECT3D", // 0x02 + "PS_TEXTUREMODES_CUBEMAP", // 0x03 + "PS_TEXTUREMODES_PASSTHRU", // 0x04 + "PS_TEXTUREMODES_CLIPPLANE", // 0x05 + "PS_TEXTUREMODES_BUMPENVMAP", // 0x06 + "PS_TEXTUREMODES_BUMPENVMAP_LUM", // 0x07 + "PS_TEXTUREMODES_BRDF", // 0x08 + "PS_TEXTUREMODES_DOT_ST", // 0x09 + "PS_TEXTUREMODES_DOT_ZW", // 0x0A + "PS_TEXTUREMODES_DOT_RFLCT_DIFF", // 0x0B + "PS_TEXTUREMODES_DOT_RFLCT_SPEC", // 0x0C + "PS_TEXTUREMODES_DOT_STR_3D", // 0x0D + "PS_TEXTUREMODES_DOT_STR_CUBE", // 0x0E + "PS_TEXTUREMODES_DPNDNT_AR", // 0x0F + "PS_TEXTUREMODES_DPNDNT_GB", // 0x10 + "PS_TEXTUREMODES_DOTPRODUCT", // 0x11 + "PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST", // 0x12 + "???", // 0x13 + "???", // 0x14 + "???", // 0x15 + "???", // 0x16 + "???", // 0x17 + "???", // 0x18 + "???", // 0x19 + "???", // 0x1A + "???", // 0x1B + "???", // 0x1C + "???", // 0x1D + "???", // 0x1E + "???", // 0x1F +}; + +// PS DotMapping +char* PS_DotMappingStr[/*PS_DOTMAPPING*/] = +{ + "PS_DOTMAPPING_ZERO_TO_ONE", // 0x00 + "PS_DOTMAPPING_MINUS1_TO_1_D3D", // 0x01 + "PS_DOTMAPPING_MINUS1_TO_1_GL", // 0x02 + "PS_DOTMAPPING_MINUS1_TO_1", // 0x03 + "PS_DOTMAPPING_HILO_1", // 0x04 + "???", // 0x05 + "???", // 0x06 + "PS_DOTMAPPING_HILO_HEMISPHERE", // 0x07 +}; + +#if 1 // array unusable for bitflags +// PS CompareMode +char* PS_CompareModeStr[/*PS_COMPAREMODE*/] = +{ + "PS_COMPAREMODE_S_LT", // 0x00L + "PS_COMPAREMODE_S_GE", // 0x01L + + "PS_COMPAREMODE_T_LT", // 0x00L + "PS_COMPAREMODE_T_GE", // 0x02L + + "???", + + "PS_COMPAREMODE_R_LT", // 0x00L + "PS_COMPAREMODE_R_GE", // 0x04L + + "???", + "???", + "???", + + "PS_COMPAREMODE_Q_LT", // 0x00L + "PS_COMPAREMODE_Q_GE", // 0x08L +}; +#endif + +#if 1 // array unfit for bitflags +// PS CombinerCountFlags +char* PS_CombinerCountFlagsStr[/*PS_COMBINERCOUNTFLAGS*/] = +{ + "PS_COMBINERCOUNT_MUX_LSB", // 0x0000L, // mux on r0.a lsb + "PS_COMBINERCOUNT_MUX_MSB", // 0x0001L, // mux on r0.a msb + + "PS_COMBINERCOUNT_SAME_C0", // 0x0000L, // c0 same in each stage + "PS_COMBINERCOUNT_UNIQUE_C0", // 0x0010L, // c0 unique in each stage + + "PS_COMBINERCOUNT_SAME_C1", // 0x0000L, // c1 same in each stage + "PS_COMBINERCOUNT_UNIQUE_C1", // 0x0100L // c1 unique in each stage +}; +#endif + +// PS InputMapping +std::string PS_InputMappingStr[/*PS_INPUTMAPPING*/] = +{ + "PS_INPUTMAPPING_UNSIGNED_IDENTITY", // 0x00L, // max(0,x) OK for final combiner: y = abs(x) + "PS_INPUTMAPPING_UNSIGNED_INVERT", // 0x20L, // 1 - max(0,x) OK for final combiner: y = 1 - x + "PS_INPUTMAPPING_EXPAND_NORMAL", // 0x40L, // 2*max(0,x) - 1 invalid for final combiner + "PS_INPUTMAPPING_EXPAND_NEGATE", // 0x60L, // 1 - 2*max(0,x) invalid for final combiner + "PS_INPUTMAPPING_HALFBIAS_NORMAL", // 0x80L, // max(0,x) - 1/2 invalid for final combiner + "PS_INPUTMAPPING_HALFBIAS_NEGATE", // 0xa0L, // 1/2 - max(0,x) invalid for final combiner + "PS_INPUTMAPPING_SIGNED_IDENTITY", // 0xc0L, // x invalid for final combiner + "PS_INPUTMAPPING_SIGNED_NEGATE", // 0xe0L, // -x invalid for final combiner +}; + +// PS Register (note, a few have one space, to line up the output a little) +std::string PS_RegisterStr[/*PS_REGISTER*/] = +{ + "PS_REGISTER_ZERO", // 0x00L, // r + "PS_REGISTER_DISCARD", // 0x00L, // w + "PS_REGISTER_C0 ", // 0x01L, // r + "PS_REGISTER_C1 ", // 0x02L, // r + "PS_REGISTER_FOG", // 0x03L, // r + "PS_REGISTER_V0 ", // 0x04L, // r/w + "PS_REGISTER_V1 ", // 0x05L, // r/w + "??", // 0x06 + "??", // 0x07 + "PS_REGISTER_T0 ", // 0x08L, // r/w + "PS_REGISTER_T1 ", // 0x09L, // r/w + "PS_REGISTER_T2 ", // 0x0aL, // r/w + "PS_REGISTER_T3 ", // 0x0bL, // r/w + "PS_REGISTER_R0 ", // 0x0cL, // r/w + "PS_REGISTER_R1 ", // 0x0dL, // r/w + "PS_REGISTER_V1R0_SUM", // 0x0eL, // r + "PS_REGISTER_EF_PROD", // 0x0fL, // r + + "PS_REGISTER_ONE", // PS_REGISTER_ZERO | PS_INPUTMAPPING_UNSIGNED_INVERT, // OK for final combiner + "PS_REGISTER_NEGATIVE_ONE", // PS_REGISTER_ZERO | PS_INPUTMAPPING_EXPAND_NORMAL, // invalid for final combiner + "PS_REGISTER_ONE_HALF", // PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NEGATE, // invalid for final combiner + "PS_REGISTER_NEGATIVE_ONE_HALF" // PS_REGISTER_ZERO | PS_INPUTMAPPING_HALFBIAS_NORMAL, // invalid for final combiner +}; + +// PS Channel +char* PS_ChannelStr[/*PS_CHANNEL*/] = +{ + "PS_CHANNEL_RGB", // 0x00, // used as RGB source + "PS_CHANNEL_BLUE", // 0x00, // used as ALPHA source + "PS_CHANNEL_ALPHA", // 0x10, // used as RGB or ALPHA source +}; + +// PS FinalCombinerSetting +char* PS_FinalCombinerSettingStr[/*PS_FINALCOMBINERSETTING*/] = +{ + "PS_FINALCOMBINERSETTING_CLAMP_SUM", // 0x80, // V1+R0 sum clamped to [0,1] + "PS_FINALCOMBINERSETTING_COMPLEMENT_V1", // 0x40, // unsigned invert mapping + "PS_FINALCOMBINERSETTING_COMPLEMENT_R0", // 0x20, // unsigned invert mapping +}; + +// PS CombineOutput +char* PS_CombineOutputStr[/*PS_COMBINEROUTPUT*/] = +{ + "PS_COMBINEROUTPUT_IDENTITY", // 0x00L, // y = x + "PS_COMBINEROUTPUT_BIAS", // 0x08L, // y = x - 0.5 + "PS_COMBINEROUTPUT_SHIFTLEFT_1", // 0x10L, // y = x*2 + "PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS", // 0x18L, // y = (x - 0.5)*2 = x*2 - 1.0 + "PS_COMBINEROUTPUT_SHIFTLEFT_2", // 0x20L, // y = x*4 + "PS_COMBINEROUTPUT_SHIFTRIGHT_1", // 0x30L, // y = x/2 = x*0.5 + + "PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA", // 0x80L, // RGB only + + "PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA", // 0x40L, // RGB only + + "PS_COMBINEROUTPUT_AB_MULTIPLY", // 0x00L, + "PS_COMBINEROUTPUT_AB_DOT_PRODUCT", // 0x02L, // RGB only + + "PS_COMBINEROUTPUT_CD_MULTIPLY", // 0x00L, + "PS_COMBINEROUTPUT_CD_DOT_PRODUCT", // 0x01L, // RGB only + + "PS_COMBINEROUTPUT_AB_CD_SUM", // 0x00L, // 3rd output is AB+CD + "PS_COMBINEROUTPUT_AB_CD_MUX", // 0x04L, // 3rd output is MUX(AB,CD) based on R0.a +}; + +// PS GlobalFlags +char* PS_GlobalFlagsStr[/*PS_GLOBALFLAGS*/] = +{ + "PS_GLOBALFLAGS_NO_TEXMODE_ADJUST", // 0x0000L, // don't adjust texture modes + "PS_GLOBALFLAGS_TEXMODE_ADJUST", // 0x0001L, // adjust texture modes according to set texture +}; + +const int CONST_NEG_ONE = -2; +const int CONST_NEG_HALF = -1; +const int CONST_ZERO = 0; +const int CONST_POS_HALF = 1; // Note : Instead of 0.5 we use 1 (so we can keep using integers) +const int CONST_POS_ONE = 2; + +/// + +std::string PSCombinerOutputFlagsToStr(const DWORD dwFlags, bool aIsAlpha = false) +{ + std::string Result = PS_CombineOutputStr[0 + ((dwFlags & 0x38) >> 3)]; + Result = Result + " | " + PS_CombineOutputStr[8 + ((dwFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) >> 1)]; + Result = Result + " | " + PS_CombineOutputStr[10 + ((dwFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) >> 0)]; + Result = Result + " | " + PS_CombineOutputStr[12 + ((dwFlags & PS_COMBINEROUTPUT_AB_CD_MUX) >> 2)]; + + if (!aIsAlpha) { + if (dwFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) + Result = Result + " | " + PS_CombineOutputStr[6]; + + if (dwFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) + Result = Result + " | " + PS_CombineOutputStr[7]; + } + + return Result; +} + +std::string PSFinalCombinerSettingToStr(const DWORD dwPS_FINALCOMBINERSETTING) +{ + std::string Result = ""; + if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_CLAMP_SUM) + Result = Result + " | " + PS_FinalCombinerSettingStr[0]; + + if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_COMPLEMENT_V1) + Result = Result + " | " + PS_FinalCombinerSettingStr[1]; + + if (dwPS_FINALCOMBINERSETTING & PS_FINALCOMBINERSETTING_COMPLEMENT_R0) + Result = Result + " | " + PS_FinalCombinerSettingStr[2]; + + if (!Result.empty()) + Result.erase(0, 3); + + return Result; +} + +/* PSH_IMD_ARGUMENT */ + +void PSH_IMD_ARGUMENT::SetConstValue(float Value) +{ + Type = PARAM_VALUE; + Address = CONST_ZERO; + Multiplier = Value; + Modifiers = 0; +} + +float PSH_IMD_ARGUMENT::GetConstValue() +{ + if (Type != PARAM_VALUE) { + // Anything other than a value-parameter returns a value never checked for : + return INFINITY; + } + + float Result = Multiplier; + + // y = 1-x -> 0..1 > 1..0 + if (HasModifier(ARGMOD_INVERT)) Result = 1.0f-Result; + + // y = -x -> 0..1 > 0..-1 + if (HasModifier(ARGMOD_NEGATE)) Result = -Result; + + // y = x-0.5 -> 0..1 > -0.5..0.5 + if (HasModifier(ARGMOD_BIAS)) Result = Result-0.5f; + + // y = x*2 -> 0..1 > 0..2 + if (HasModifier(ARGMOD_SCALE_X2)) Result = Result*2.0f; + + // y = (x*2)-1 -> 0..1 > -1..1 + if (HasModifier(ARGMOD_SCALE_BX2)) Result = (Result*2.0f)-1.0f; + + // y = x*4 -> 0..1 > 0..4 + if (HasModifier(ARGMOD_SCALE_X4)) Result = Result*4.0f; + + // y = x/2 -> 0..1 > 0..0.5 + if (HasModifier(ARGMOD_SCALE_D2)) Result = Result/2.0f; + + return Result; +} // GetConstValue + +bool PSH_IMD_ARGUMENT::UsesRegister() +{ + return (Type > PARAM_DISCARD); +} + +bool PSH_IMD_ARGUMENT::IsRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress) +{ + return (Type == aRegType) + && (Address == aAddress || aAddress == -1); +} + +bool PSH_IMD_ARGUMENT::IsRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress, DWORD aMask) +{ + return IsRegister(aRegType, aAddress) + // Check the mask itself, but also 'mask-less' : + && (((Mask & aMask) == aMask) || (Mask == 0)); +} + +void PSH_IMD_ARGUMENT::SetRegister(PSH_ARGUMENT_TYPE aRegType, int16_t aAddress, DWORD aMask) +{ + Type = aRegType; + Address = aAddress; + Mask = aMask; +} + +bool PSH_IMD_ARGUMENT::HasModifier(PSH_ARG_MODIFIER modifier) +{ + return (Modifiers & (1 << modifier)) != 0; +} + +bool PSH_IMD_ARGUMENT::SetScaleConstRegister(float factor, const PSH_RECOMPILED_SHADER& pRecompiled) +{ + bool result = false; + + PSH_ARG_MODIFIERs modifiers = 0; + DWORD mask = Mask; + int address = Address; + + const int mappedConstant0 = pRecompiled.ConstMapping[PSH_XBOX_CONSTANT_MUL0]; + const int mappedConstant1 = pRecompiled.ConstMapping[PSH_XBOX_CONSTANT_MUL1]; + + if (factor < 0.0f) + { + factor = -factor; + modifiers = (1 << ARGMOD_NEGATE); + } + + if (factor == 1.0f) + { + address = mappedConstant0; + mask = MASK_R; + result = true; + } + + else if (factor == 2.0f) + { + address = mappedConstant0; + mask = MASK_G; + result = true; + } + + else if (factor == 4.0f) + { + address = mappedConstant0; + mask = MASK_B; + result = true; + } + + else if (factor == 8.0f) + { + address = mappedConstant0; + mask = MASK_A; + result = true; + } + + else if (factor == 0.0f) + { + address = mappedConstant1; + mask = MASK_R; + result = true; + } + + else if (factor == 1.0f / 2.0f) + { + address = mappedConstant1; + mask = MASK_G; + result = true; + } + + else if (factor == 1.0f / 4.0f) + { + address = mappedConstant1; + mask = MASK_B; + result = true; + } + + else if (factor == 1.0f / 8.0f) + { + address = mappedConstant1; + mask = MASK_A; + result = true; + } + + if (result) + { + Type = PARAM_C; + Address = address; + Mask = mask; + Modifiers = modifiers; + Multiplier = 1.0f; + } + + return result; +} + +bool PSH_IMD_ARGUMENT::SetScaleBemLumRegister(D3DTEXTURESTAGESTATETYPE factor, int stage, const PSH_RECOMPILED_SHADER& pRecompiled) +{ + bool result = false; + + PSH_ARG_MODIFIERs modifiers = 0; + DWORD mask = Mask; + int address = Address; + + const int mappedConstant0 = pRecompiled.ConstMapping[PSH_XBOX_CONSTANT_BEM + stage]; + const int mappedConstant1 = pRecompiled.ConstMapping[PSH_XBOX_CONSTANT_LUM + stage]; + + switch (factor) + { + case D3DTSS_BUMPENVMAT00: + { + address = mappedConstant0; + mask = MASK_R; + result = true; + break; + } + case D3DTSS_BUMPENVMAT01: + { + address = mappedConstant0; + mask = MASK_G; + result = true; + break; + } + case D3DTSS_BUMPENVMAT11: + { + address = mappedConstant0; + mask = MASK_B; + result = true; + break; + } + case D3DTSS_BUMPENVMAT10: + { + address = mappedConstant0; + mask = MASK_A; + result = true; + break; + } + case D3DTSS_BUMPENVLSCALE: + { + address = mappedConstant1; + mask = MASK_R; + result = true; + break; + } + case D3DTSS_BUMPENVLOFFSET: + { + address = mappedConstant1; + mask = MASK_G; + result = true; + break; + } + } + + if (result) + { + Type = PARAM_C; + Address = address; + Mask = mask; + Modifiers = modifiers; + Multiplier = 1.0f; + } + + return result; +} + +std::string PSH_IMD_ARGUMENT::ToString() +{ + std::string Result; + + if (Type == PARAM_VALUE) + { + Result = std::to_string(GetConstValue()); + if (Result.find(".") > 0) + Result = Result + 'f'; + + return Result; + } + + Result = PSH_ARGUMENT_TYPE_Str[Type]; + + if (Type >= PARAM_R) + Result = Result + std::to_string(Address); + + if (UsesRegister()) + { + for (DWORD Modifier = ARGMOD_IDENTITY; Modifier < ARGMOD_BLUE_REPLICATE; Modifier++) + if (HasModifier((PSH_ARG_MODIFIER)Modifier)) { + char buffer[256]; + Result = std::string(buffer, sprintf(buffer, PSH_ARG_MODIFIER_Str[Modifier], Result.c_str())); + } + + if ((Mask > 0) && (Mask != MASK_RGBA)) + { + Result = Result + '.'; + if ((Mask & MASK_R) > 0) Result = Result + 'r'; + if ((Mask & MASK_G) > 0) Result = Result + 'g'; + if ((Mask & MASK_B) > 0) Result = Result + 'b'; + if ((Mask & MASK_A) > 0) Result = Result + 'a'; + } + } + return Result; +} // ToString + +bool PSH_IMD_ARGUMENT::Decode(const DWORD Value, DWORD aMask, TArgumentType ArgumentType) +{ + PS_REGISTER Reg; + PS_INPUTMAPPING InputMapping; + PS_CHANNEL Channel; + + bool Result = true; + Address = 0; + Mask = aMask; + Modifiers = (1 << ARGMOD_IDENTITY); + Multiplier = 1.0; + + // Determine PS_REGISTER for this argument type : + { + Reg = (PS_REGISTER)(Value & 0xF); + if (ArgumentType == atOutput) + { + // Output arguments may not write to C0 or C1, prevent that : + if ((Reg == PS_REGISTER_C0) || (Reg == PS_REGISTER_C1)) + Reg = PS_REGISTER_CXBX_PROD; // unhandled case - will reach "invalid" else-block + } + else + { + // Input arguments (normal or final combiners) can use the extended PS_REGISTER values : + if (Reg == PS_REGISTER_ZERO) + Reg = (PS_REGISTER)(Value & 0xE0); + + // 'Signed Identity' flag on PS_REGISTER_ZERO has no meaning, treat as zero : + if (Reg == PS_REGISTER_CXBX_PROD) + Reg = PS_REGISTER_ZERO; + + // Prevent decoding final combiner registers outside that mode : + if (ArgumentType != atFinalCombiner) + if ((Reg == PS_REGISTER_FOG) || (Reg == PS_REGISTER_V1R0_SUM) || (Reg == PS_REGISTER_EF_PROD)) + Reg = PS_REGISTER_CXBX_PROD; // unhandled case - will reach "invalid" else-block + } + } + + switch (Reg) { + case PS_REGISTER_ZERO: + { + if (ArgumentType == atOutput) + { + // Mark output arguments as 'discard' and return that fact : + Type = PARAM_DISCARD; + Result = false; + } + else + Type = PARAM_VALUE; + + Address = CONST_ZERO; + Multiplier = 0.0f; + break; + } + case PS_REGISTER_C0: + Type = PARAM_C; + break; + case PS_REGISTER_C1: + { + Type = PARAM_C; + Address = 1; + break; + } + case PS_REGISTER_V0: + Type = PARAM_V; + break; + case PS_REGISTER_V1: + { + Type = PARAM_V; + Address = 1; + break; + } + case PS_REGISTER_T0: + Type = PARAM_T; + break; + case PS_REGISTER_T1: + { + Type = PARAM_T; + Address = 1; + break; + } + case PS_REGISTER_T2: + { + Type = PARAM_T; + Address = 2; + break; + } + case PS_REGISTER_T3: + { + Type = PARAM_T; + Address = 3; + break; + } + case PS_REGISTER_R0: + Type = PARAM_R; + break; + case PS_REGISTER_R1: + { + Type = PARAM_R; + Address = 1; + break; + } + // Registers only available when ArgumentType != atOutput (Reg is capped otherwise) : + case PS_REGISTER_ONE: + { + Type = PARAM_VALUE; + Address = CONST_POS_ONE; + Multiplier = 1.0f; + break; + } + case PS_REGISTER_NEGATIVE_ONE: + { + Type = PARAM_VALUE; + Address = CONST_NEG_ONE; + Multiplier = -1.0f; + break; + } + case PS_REGISTER_ONE_HALF: + { + Type = PARAM_VALUE; + Address = CONST_POS_HALF; + Multiplier = 0.5f; + break; + } + case PS_REGISTER_NEGATIVE_ONE_HALF: + { + Type = PARAM_VALUE; + Address = CONST_NEG_HALF; + Multiplier = -0.5f; + break; + } + // Registers only available when ArgumentType == atFinalCombiner (Reg is capped otherwise) : + case PS_REGISTER_FOG: + Type = PARAM_FOG; + break; + case PS_REGISTER_V1R0_SUM: + Type = PARAM_V1R0_SUM; + break; + case PS_REGISTER_EF_PROD: + Type = PARAM_EF_PROD; + break; + default : + EmuLog(LOG_LEVEL::DEBUG, "INVALID ARGUMENT!"); + + Result = false; + } + + // We're done if this decoding is meant for output parameters, + // or when the input is a value-parameter (already read above) : + if ((ArgumentType == atOutput) + || (Type == PARAM_VALUE) ) + return Result; + + // Handle the Channel Designator : + { + Channel = (PS_CHANNEL)(Value & PS_CHANNEL_ALPHA); + if (Channel == PS_CHANNEL_ALPHA) + // Input comes from alpha portion of input register (valid for both RGB and alpha portions) : + Mask = MASK_A; + else // = PS_CHANNEL_BLUE (for Alpha step) = PS_CHANNEL_BLUE (for RGB step) : + if (aMask == MASK_A) + // Input comes from b portion of input register (valid for alpha portion only) : + Mask = MASK_B; // Note : This is not the same as ARGMOD_BLUE_REPLICATE! + else + // Input comes from the RGB portion of the input register (valid for RGB portion only) : + Mask = aMask; // Note : Is already put here, but makes this code clearer + } + + InputMapping = (PS_INPUTMAPPING)(Value & 0xe0); + +// ARGMOD_BIAS, +// +// ARGMOD_SCALE_X2, ARGMOD_SCALE_BX2, ARGMOD_SCALE_X4, ARGMOD_SCALE_D2, +// +// ARGMOD_SATURATE, +// +// ARGMOD_ALPHA_REPLICATE, ARGMOD_BLUE_REPLICATE]; + + switch (InputMapping) { + case PS_INPUTMAPPING_UNSIGNED_IDENTITY: + Modifiers = (1 << ARGMOD_IDENTITY); + break; + case PS_INPUTMAPPING_UNSIGNED_INVERT: + Modifiers = (1 << ARGMOD_INVERT); + break; + case PS_INPUTMAPPING_EXPAND_NORMAL: + { + Modifiers = (1 << ARGMOD_SCALE_BX2); + Multiplier = 2.0f * Multiplier; + break; + } + case PS_INPUTMAPPING_EXPAND_NEGATE: + { + Modifiers = (1 << ARGMOD_NEGATE); + Multiplier = -Multiplier; + break; + } + case PS_INPUTMAPPING_HALFBIAS_NORMAL: + Modifiers = (1 << ARGMOD_BIAS); + break; +// case PS_INPUTMAPPING_HALFBIAS_NEGATE: +// Modifiers = (1 << ARGMOD_IDENTITY); ??? +// break; + case PS_INPUTMAPPING_SIGNED_IDENTITY: + Modifiers = (1 << ARGMOD_IDENTITY); + break; + case PS_INPUTMAPPING_SIGNED_NEGATE: + { + Modifiers = (1 << ARGMOD_NEGATE); + Multiplier = -Multiplier; + break; + } + } + return Result; +} // Decode + +void PSH_IMD_ARGUMENT::Invert() +{ + if (!HasModifier(ARGMOD_INVERT)) + Modifiers = Modifiers | (1 << ARGMOD_INVERT); + else + Modifiers = Modifiers & ~(1 << ARGMOD_INVERT); +} + +void PSH_IMD_ARGUMENT::Negate() +{ + if (!HasModifier(ARGMOD_NEGATE)) + Modifiers = Modifiers | (1 << ARGMOD_NEGATE); + else + Modifiers = Modifiers & ~(1 << ARGMOD_NEGATE); +} + +/* PSH_INTERMEDIATE_FORMAT */ + +_PSH_INTERMEDIATE_FORMAT *PSH_INTERMEDIATE_FORMAT::Initialize(const PSH_OPCODE aOpcode) +{ + int i; + + Opcode = aOpcode; + Modifier = INSMOD_NONE; + for (i = 0; i < 3; i++) + { + Output[i] = {}; + Output[i].Multiplier = 1.0f; + } + for (i = 0; i < 7; i++) + { + Parameters[i] = {}; + Parameters[i].Multiplier = 1.0f; + } + + return this; +} + +std::string PSH_INTERMEDIATE_FORMAT::ToString() +{ + std::string Result = {}; + int i; + char SeparatorChar; + + switch (Opcode) { + case PO_COMMENT: + { + Result = "; " + CommentString; + return Result; + } + case PO_PS: { + // 1.1 allows reading from 2 textures (which we use in 'cnd') and reading from the .b (blue) channel + // 1.3 allows the use of texm3x2depth (which can occur sometimes) + // 2.0 allows up to r12, c32, t8 and s16 (requires Direct3D9) + // 3.0 allows up to r32, c224, v10 (instead of t via dcl), s16 and vFace (which can do two-sided lighting) + + // Use supplied pixel shader version (if any is given) + DWORD PSVersion = Parameters[6].Mask; + + Result = "ps_" + std::to_string(D3DSHADER_VERSION_MAJOR(PSVersion)) + + "_" + std::to_string(D3DSHADER_VERSION_MINOR(PSVersion)); + return Result; + } + case PO_XPS: { + Result = "xps.1.1"; + return Result; + } + } + + if (IsCombined) + Result = "+"; + else + Result = ""; + + Result = Result + PSH_OPCODE_DEFS[Opcode].mn + PSH_INST_MODIFIER_Str[Modifier]; + + // Output a comma-separated list of output registers : + SeparatorChar = ' '; + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) + { + Result = Result + SeparatorChar + Output[i].ToString(); + SeparatorChar = ','; + } + + // If this opcode has both output and input, put a space between them : + if ((PSH_OPCODE_DEFS[Opcode]._Out > 0) && (PSH_OPCODE_DEFS[Opcode]._In > 0)) + { + Result = Result + ","; + SeparatorChar = ' '; + } + + // Output a comma-separated list of parameters : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) + { + Result = Result + SeparatorChar + Parameters[i].ToString(); + SeparatorChar = ','; + } + + if ((!CommentString.empty()) + || (PSH_OPCODE_DEFS[Opcode].note != "")) + Result = Result + " ; " + PSH_OPCODE_DEFS[Opcode].note + " " + CommentString; + + return Result; +} // ToString + +bool PSH_INTERMEDIATE_FORMAT::IsArithmetic() +{ + return (Opcode >= PO_ADD); +} + +void PSH_INTERMEDIATE_FORMAT::ScaleOutput(float aFactor) +{ + assert(aFactor > 0.0f); + + if (aFactor == 1.0f) + return; + + if (aFactor == 0.5f) + { + // Half the output modifier : + switch (Modifier) { + case INSMOD_X8: + Modifier = INSMOD_X4; + break; + case INSMOD_X4: + Modifier = INSMOD_X2; + break; + case INSMOD_X2: + Modifier = INSMOD_NONE; + break; + case INSMOD_NONE: + Modifier = INSMOD_D2; + break; + case INSMOD_D2: + Modifier = INSMOD_D4; + break; + case INSMOD_D4: + Modifier = INSMOD_D8; + break; + } + + return; + } + + if (aFactor == 2.0f) + { + // Double the output modifier : + switch (Modifier) { + case INSMOD_D8: + Modifier = INSMOD_D4; + break; + case INSMOD_D4: + Modifier = INSMOD_D2; + break; + case INSMOD_D2: + Modifier = INSMOD_NONE; + break; + case INSMOD_NONE: + Modifier = INSMOD_X2; + break; + case INSMOD_X2: + Modifier = INSMOD_X4; + break; + case INSMOD_X4: + Modifier = INSMOD_X8; + break; + } + + return; + } +} + +bool PSH_INTERMEDIATE_FORMAT::ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress) // overload; +{ + int i; + bool Result; + + // Check all parameters : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) + { + // Check if one of them reads from the given register : + Result = Parameters[i].IsRegister(aRegType, aAddress); + if (Result) + return true; + } + + return false; +} + +bool PSH_INTERMEDIATE_FORMAT::ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask) // overload; +{ + int i; + bool Result; + + // Check all parameters : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) + { + // Check if one of them reads from the given register : + Result = Parameters[i].IsRegister(aRegType, aAddress, aMask); + if (Result) + return true; + } + + return false; +} + +// Used to determine the number of accesses to a register type within an instruction +// For use when determining register access limitations on certain instructions +// addressCount = the number of different registers read of the specified type +// total = the number of accesses to the spcified register type +bool PSH_INTERMEDIATE_FORMAT::ReadsFromRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, int& addressCount, int& total) // overload; +{ + int i; + bool Result; + bool RegisterUsage[256] = { false }; + + addressCount = 0; + total = 0; + + // Check all parameters : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) + { + // Check if one of them reads from the given register : + Result = Parameters[i].IsRegister(aRegType, aAddress, 0); + if (Result) + { + ++total; + if (!RegisterUsage[Parameters[i].Address]) + { + RegisterUsage[Parameters[i].Address] = true; + ++addressCount; + } + } + } + + return total > 0; +} + +bool PSH_INTERMEDIATE_FORMAT::WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress) // overload; +{ + int i; + bool Result; + + // Check the output : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) + { + // Check if one of them writes to the given register : + Result = Output[i].IsRegister(aRegType, aAddress); + if (Result) + return true; + } + + return false; +} + +bool PSH_INTERMEDIATE_FORMAT::WritesToRegister(PSH_ARGUMENT_TYPE aRegType, int aAddress, DWORD aMask) // overload; +{ + int i; + bool Result; + + // Check the output : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._Out; i++) + { + // Check if one of them writes to the given register : + Result = Output[i].IsRegister(aRegType, aAddress, aMask); + if (Result) + return true; + } + + return false; +} + +void PSH_INTERMEDIATE_FORMAT::SwapParameter(const int Index1, const int Index2) +// Swaps two parameters. +{ + PSH_IMD_ARGUMENT TmpParameters; + + TmpParameters = Parameters[Index1]; + Parameters[Index1] = Parameters[Index2]; + Parameters[Index2] = TmpParameters; +} + +void PSH_INTERMEDIATE_FORMAT::XSwapOutput() +// Swaps the two outputs, along with their arguments. Applies only to Xbox opcodes. +{ + PSH_IMD_ARGUMENT TmpOutput; + + // Swap output 0 with 1 : + TmpOutput = Output[0]; + Output[0] = Output[1]; + Output[1] = TmpOutput; + + // Swap parameters 0 with 2 and 1 with 3 : + SwapParameter(0, 2); + SwapParameter(1, 3); +} + +bool PSH_INTERMEDIATE_FORMAT::MoveRemovableParametersRight(const int Index1, const int Index2) +// Swaps discarded (and const) parameters to the right position, to ease later conversions. +{ + bool Result = false; + + if ( (!Parameters[Index1].UsesRegister()) + && (Parameters[Index2].UsesRegister())) + { + SwapParameter(Index1, Index2); + Result = true; + } + return Result; +} + +bool PSH_INTERMEDIATE_FORMAT::XMoveNonRegisterOutputsRight() +// Swap discards and constants to the right position, to ease later conversions. Applies only to Xbox opcodes. +{ + bool Result = false; + + // First, check if the left output is discarded, while the second isn't : + if ( (!Output[0].UsesRegister()) + && (Output[1].UsesRegister())) + { + // Swap the outputs, so the discarded version is positioned rightmost : + XSwapOutput(); + Result = true; + } + + // Also try to swap the parameters to the first operation : + if (MoveRemovableParametersRight(0, 1)) + Result = true; + + // Idem for the parameters to second operation : + if (MoveRemovableParametersRight(2, 3)) + Result = true; + return Result; +} + +void PSH_INTERMEDIATE_FORMAT::XCopySecondOpcodeToFirst(const PSH_OPCODE aOpcode) +// Copies second opcode to first position, changing the opcode type on the fly. +{ + Opcode = aOpcode; + Output[0] = Output[1]; + Parameters[0] = Parameters[2]; + Parameters[1] = Parameters[3]; +} + +bool PSH_INTERMEDIATE_FORMAT::Decode(DWORD aCombinerStageNr, DWORD PSInputs, DWORD PSOutputs, DWORD aMask) +{ + DWORD CombinerOutputFlags; + int i; + + bool Result = false; + CombinerStageNr = aCombinerStageNr; + IsCombined = aMask == MASK_A; + + // Decode first two outputs : + if (Output[0].Decode((PSOutputs >> 4) & 0xF, aMask, atOutput)) + Result = true; + if (Output[1].Decode((PSOutputs >> 0) & 0xF, aMask, atOutput)) + Result = true; + + // Get the combiner output flags : + CombinerOutputFlags = (PS_COMBINEROUTPUT)(PSOutputs >> 12); + + // Use that to choose between the four possible operations : + // - xdd (dot/dot/discard) > calculating AB=A.B and CD=C.D + // - xdm (dot/mul/discard) > calculating AB=A.B and CD=C*D + // - xmmc (mul/mul/mux) > calculating AB=A*B and CD=C*D and Mux=AB?CD + // - xmma (mul/mul/sum) > calculating AB=A*B and CD=C*D and Sum=AB+CD + if ((CombinerOutputFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct + { + if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct + Opcode = PO_XDD; + else + Opcode = PO_XDM; + + // Note : All arguments are already in-place for these two opcodes. + + // No 3rd output; Assert that (PSOutputs >> 8) & 0xF == PS_REGISTER_DISCARD ? + } + else + if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0) // false=Multiply, true=DotProduct + { + // The first operation is a multiply, but the second is a dot-product; + // There's no opcode for that, but we can reverse the two and still use XDM : + Opcode = PO_XDM; + XSwapOutput(); + + // No 3rd output; Assert that (PSOutputs >> 8) & 0xF == PS_REGISTER_DISCARD ? + } + else + { + if (/*AB_CD_SUM=*/(CombinerOutputFlags & PS_COMBINEROUTPUT_AB_CD_MUX) == 0) // true=AB+CD, false=MUX(AB,CD) based on R0.a + Opcode = PO_XMMA; + else + Opcode = PO_XMMC; + + // This has a 3rd output, set that already : + if (Output[2].Decode((PSOutputs >> 8) & 0xF, aMask, atOutput)) + Result = true; + } + + if (Result) + { + // Handle the Output Mapping : + switch (CombinerOutputFlags & 0x38) { + case PS_COMBINEROUTPUT_BIAS: Modifier = INSMOD_BIAS; break; // TODO : Fixup occurrances! + case PS_COMBINEROUTPUT_SHIFTLEFT_1: Modifier = INSMOD_X2; break; + case PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS: Modifier = INSMOD_BX2; break; // TODO : Fixup occurrances! + case PS_COMBINEROUTPUT_SHIFTLEFT_2: Modifier = INSMOD_X4; break; + case PS_COMBINEROUTPUT_SHIFTRIGHT_1: Modifier = INSMOD_D2; break; + default /*PS_COMBINEROUTPUT_IDENTITY*/: Modifier = INSMOD_NONE; break; + } + + if ((CombinerOutputFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) > 0) // false=Alpha-to-Alpha, true=Blue-to-Alpha + { + // Note : The effect of this flag is not entirely clear - blue to alpha itself is an easy to understand operation, + // but on what output does it operate? AB? or the mux_sum destination register (which doesn't occur when a dot + // operation is executed)? What if AB is discarded, but AB+CD is registered? Also, what happens to the other + // color channels (R,G and A) in that register? The docs seem to imply that AB itself is not changed (as they + // state that the alpha portion is not necessarily discarded), which would mean that only the mux_sum output + // is influenced, but that would imply that this flag has no effect for dot-products (XDD or XDM)... + // And if this is true, how do the blue-to-alpha flags behave if present on both AB and CD? + + // TODO : Rayman does this in some shaders, requires a fixup (as output.b is incorrect and not allowed) + Output[0].Modifiers = Output[0].Modifiers | (1 << ARGMOD_BLUE_REPLICATE); + Output[0].Mask = MASK_B; + // TODO Handle blue-to-alpha flag (only valid for RGB) + // Note : We can't use the '+ ' prefix, as the blue channel is not determined yet! + // Note 2: Pixel shader 1.1-1.3 'blue replicate' on source, uses an alpha destination write mask. + } + + if ((CombinerOutputFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) > 0) // false=Alpha-to-Alpha, true=Blue-to-Alpha + { + Output[1].Modifiers = Output[1].Modifiers | (1 << ARGMOD_BLUE_REPLICATE); + Output[1].Mask = MASK_B; + } + + // Decode all four inputs : + for (i = 0; i < PSH_OPCODE_DEFS[Opcode]._In; i++) + Parameters[i].Decode((PSInputs >> ((3-i) * 8)) & 0xFF, aMask, atInput); + } + return Result; +} // Decode + +bool PSH_INTERMEDIATE_FORMAT::DecodeFinalCombiner(DWORD aPSFinalCombinerInputsABCD, DWORD aPSFinalCombinerInputsEFG) +{ + int i; +// Note : The sign bit is lost upon input to the final combiner! + +// The final combiner performs the following operations : +// +// prod register = E*F // PS_REGISTER_EF_PROD, useable in A,B,C,D,G +// +// rgbout = A*B + (1-A)*C + D // lrp tmp.rgb, A, B, C // Note : tmp can be r0 if [A,B,C,D] * r0 = [] +// // add r0.rgb, tmp.rgb, D.rgb // Otherwise use a writable register from A;B or C +// +// alphaout = G.a // mov r0.a, G.a // Not necessary if G = r0 +// +// (also the final combiner can read PS_REGISTER_V1R0_SUM, which is equal to v1 + r0) +// Normal optimizations apply, like when A = PS_REGISTER_ZERO, all we have left is C + D (add r0.rgb, C.rgb, D.rgb) +// Also, if D = PS_REGISTER_ZERO, the add can be changed into a mov (if the result isn't already in r0.rgb) + + // Note : Previously, XSokoban lost it's font rendering when the final combiner was emitted, + // when disabled, the font reappeared (in various colors). This was because constants where + // not properly set locally. + + Opcode = PO_XFC; + CombinerStageNr = XFC_COMBINERSTAGENR; + + // Decode A,B,C and D : + for (i = 0; i < 4; i++) + Parameters[i].Decode((aPSFinalCombinerInputsABCD >> ((3-i) * 8)) & 0xFF, MASK_RGB/*?*/, atFinalCombiner); + + // Decode E,F and G : + for (i = 0; i < 3; i++) + Parameters[4+i].Decode((aPSFinalCombinerInputsEFG >> ((3-i) * 8)) & 0xFF, MASK_RGB/*?*/, atFinalCombiner); + + return true; +} + +/* PSH_XBOX_SHADER */ + +void PSH_XBOX_SHADER::SetPSVersion(const uint32_t PSVersion) +{ + m_PSVersion = PSVersion; + + // Source : https://en.wikipedia.org/wiki/High-Level_Shading_Language#Pixel_shader_comparison + if (m_PSVersion >= D3DPS_VERSION(4, 0)) { + MaxInputColorRegisters = 32; + MaxTemporaryRegisters = 4096; + MaxConstantFloatRegisters = 16*4096; + MaxSamplerRegisters = 16; + MaxTextureCoordinateRegisters = 0; // In shader model 4 and up, Dependent texture limit (T) is unlimited + // Note : Input Registers (v#) are now fully floating point and the Texture Coordinate Registers (t#) have been consolidated into it. + + PSH_PC_MAX_REGISTER_COUNT = 16 * 4096; + } + else if (m_PSVersion >= D3DPS_VERSION(3, 0)) { + // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172920(v=vs.85).aspx + MaxInputColorRegisters = 10; + MaxTemporaryRegisters = 32; + MaxConstantFloatRegisters = 224; + MaxSamplerRegisters = 16; + MaxTextureCoordinateRegisters = 0; // In shader model 3 and up, Dependent texture limit (T) is unlimited + + PSH_PC_MAX_REGISTER_COUNT = 224; + } + else if (m_PSVersion >= D3DPS_VERSION(2, 0)) { + // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172918(v=vs.85).aspx + MaxInputColorRegisters = 2; + MaxTemporaryRegisters = 12; // 12 min/32 max: The number of r# registers is determined by D3DCAPS9.D3DPSHADERCAPS2_0.NumTemps (which ranges from 12 to 32). + MaxConstantFloatRegisters = 32; + MaxSamplerRegisters = 16; + MaxTextureCoordinateRegisters = 8; + + PSH_PC_MAX_REGISTER_COUNT = 32; + } + else + assert(false); // We no longer support less than Direct3D 9 + /* For documentation purposes, keep the below information around : + else if (m_PSVersion >= D3DPS_VERSION(1, 4)) { + // Source https://msdn.microsoft.com/en-us/library/windows/desktop/bb172917(v=vs.85).aspx + MaxConstantFloatRegisters = 8; + MaxTemporaryRegisters = 6; + MaxTextureCoordinateRegisters = 4; + MaxInputColorRegisters = 2; // 2 in phase 2 + MaxSamplerRegisters = 0; // Not yet in shader model 1 + + PSH_PC_MAX_REGISTER_COUNT = 8; + } + else if (m_PSVersion >= D3DPS_VERSION(1, 3)) { + MaxConstantFloatRegisters = 8; + MaxTemporaryRegisters = 2; + MaxTextureCoordinateRegisters = 4; + MaxInputColorRegisters = 2; + MaxSamplerRegisters = 0; // Not yet in shader model 1 + + PSH_PC_MAX_REGISTER_COUNT = 8; + } + else if (m_PSVersion >= D3DPS_VERSION(1, 2)) { + MaxConstantFloatRegisters = 8; + MaxTemporaryRegisters = 2; + MaxTextureCoordinateRegisters = 4; + MaxInputColorRegisters = 2; + MaxSamplerRegisters = 0; // Not yet in shader model 1 + + PSH_PC_MAX_REGISTER_COUNT = 8; + } + else { + // m_PSVersion >= D3DPS_VERSION(1, 1) + MaxConstantFloatRegisters = 8; + MaxTemporaryRegisters = 2; + MaxTextureCoordinateRegisters = 4; // Some sources say 2? + MaxInputColorRegisters = 2; + MaxSamplerRegisters = 0; // Not yet in shader model 1 + + PSH_PC_MAX_REGISTER_COUNT = 8; + } */ +} + +std::string PSH_XBOX_SHADER::ToString() +{ + std::string Result; + int i; + + for (i = 0; i < IntermediateCount; i++) + Result = Result + Intermediate[i].ToString() + "\n"; + + return Result; +} + +void PSH_XBOX_SHADER::Log(const char *PhaseStr) +{ + //if (MayLog(lfUnit)) + { + EmuLog(LOG_LEVEL::DEBUG, "New decoding - %s :", PhaseStr); + EmuLog(LOG_LEVEL::DEBUG, "%s", ToString().c_str()); + } +} + +PPSH_INTERMEDIATE_FORMAT PSH_XBOX_SHADER::NewIntermediate() +{ + PPSH_INTERMEDIATE_FORMAT Result = &Intermediate[IntermediateCount]; + Result->Initialize(PO_COMMENT); + ++IntermediateCount; + return Result; +} + +void PSH_XBOX_SHADER::InsertIntermediate(PPSH_INTERMEDIATE_FORMAT pIntermediate, int Index) +{ + int i; + i = IntermediateCount - 1; + while (i >= Index) + { + Intermediate[i + 1] = Intermediate[i]; + --i; + } + + Intermediate[Index] = *pIntermediate; + ++IntermediateCount; +} + +void PSH_XBOX_SHADER::DeleteIntermediate(int Index) +{ + int i; + for (i = Index; i < IntermediateCount - 1; i++) + Intermediate[i] = Intermediate[i + 1]; + + --IntermediateCount; +} + +void PSH_XBOX_SHADER::DeleteLastIntermediate() +{ + if (IntermediateCount > 0) + DeleteIntermediate(IntermediateCount - 1); +} + +std::string PSH_XBOX_SHADER::OriginalToString(XTL::X_D3DPIXELSHADERDEF *pPSDef) // static +{ + char buffer[4096]; + return std::string(buffer, sprintf(buffer, "PSAphaInputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSFinalCombinerInputsABCD = 0x%.08X\n" + "PSFinalCombinerInputsEFG = 0x%.08X\n" + "PSConstant0[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSConstant1[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSAlphaOutputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSRGBInputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSCompareMode = 0x%.08X\n" + "PSFinalCombinerConstant0 = 0x%.08X\n" + "PSFinalCombinerConstant1 = 0x%.08X\n" + "PSRGBOutputs[8] = 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X 0x%.08X\n" + "PSCombinerCount = 0x%.08X\n" + "PSTextureModes = 0x%.08X\n" + "PSDotMapping = 0x%.08X\n" + "PSInputTexture = 0x%.08X\n" + "PSC0Mapping = 0x%.08X\n" + "PSC1Mapping = 0x%.08X\n" + "PSFinalCombinerConstants = 0x%.08X\n", + pPSDef->PSAlphaInputs[0], pPSDef->PSAlphaInputs[1], pPSDef->PSAlphaInputs[2], pPSDef->PSAlphaInputs[3], + pPSDef->PSAlphaInputs[4], pPSDef->PSAlphaInputs[5], pPSDef->PSAlphaInputs[6], pPSDef->PSAlphaInputs[7], + pPSDef->PSFinalCombinerInputsABCD, + pPSDef->PSFinalCombinerInputsEFG, + pPSDef->PSConstant0[0], pPSDef->PSConstant0[1], pPSDef->PSConstant0[2], pPSDef->PSConstant0[3], + pPSDef->PSConstant0[4], pPSDef->PSConstant0[5], pPSDef->PSConstant0[6], pPSDef->PSConstant0[7], + pPSDef->PSConstant1[0], pPSDef->PSConstant1[1], pPSDef->PSConstant1[2], pPSDef->PSConstant1[3], + pPSDef->PSConstant1[4], pPSDef->PSConstant1[5], pPSDef->PSConstant1[6], pPSDef->PSConstant1[7], + pPSDef->PSAlphaOutputs[0], pPSDef->PSAlphaOutputs[1], pPSDef->PSAlphaOutputs[2], pPSDef->PSAlphaOutputs[3], + pPSDef->PSAlphaOutputs[4], pPSDef->PSAlphaOutputs[5], pPSDef->PSAlphaOutputs[6], pPSDef->PSAlphaOutputs[7], + pPSDef->PSRGBInputs[0], pPSDef->PSRGBInputs[1], pPSDef->PSRGBInputs[2], pPSDef->PSRGBInputs[3], + pPSDef->PSRGBInputs[4], pPSDef->PSRGBInputs[5], pPSDef->PSRGBInputs[6], pPSDef->PSRGBInputs[7], + pPSDef->PSCompareMode, + pPSDef->PSFinalCombinerConstant0, + pPSDef->PSFinalCombinerConstant1, + pPSDef->PSRGBOutputs[0], pPSDef->PSRGBOutputs[1], pPSDef->PSRGBOutputs[2], pPSDef->PSRGBOutputs[3], + pPSDef->PSRGBOutputs[4], pPSDef->PSRGBOutputs[5], pPSDef->PSRGBOutputs[6], pPSDef->PSRGBOutputs[7], + pPSDef->PSCombinerCount, + XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES), /* pPSDef->PSTextureModes is stored in a different place than pPSDef*/ + pPSDef->PSDotMapping, + pPSDef->PSInputTexture, + pPSDef->PSC0Mapping, + pPSDef->PSC1Mapping, + pPSDef->PSFinalCombinerConstants)); +} + +void PSH_XBOX_SHADER::GetPSTextureModes(XTL::X_D3DPIXELSHADERDEF* pPSDef, PS_TEXTUREMODES psTextureModes[XTL::X_D3DTS_STAGECOUNT]) +{ + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) + { + psTextureModes[i] = (PS_TEXTUREMODES)((XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) >> (i * 5)) & 0x1F); + } +} + +void PSH_XBOX_SHADER::GetPSDotMapping(XTL::X_D3DPIXELSHADERDEF* pPSDef, PS_DOTMAPPING psDotMapping[XTL::X_D3DTS_STAGECOUNT]) +{ + psDotMapping[0] = (PS_DOTMAPPING)(0); + psDotMapping[1] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 0) & 0x7); + psDotMapping[2] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 4) & 0x7); + psDotMapping[3] = (PS_DOTMAPPING)((pPSDef->PSDotMapping >> 8) & 0x7); +} + +void PSH_XBOX_SHADER::GetPSCompareModes(XTL::X_D3DPIXELSHADERDEF* pPSDef, DWORD psCompareModes[XTL::X_D3DTS_STAGECOUNT]) +{ + for (int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) + { + psCompareModes[i] = (pPSDef->PSCompareMode >> (i * 4)) & 0xF; + } +} + +void PSH_XBOX_SHADER::GetPSInputTexture(XTL::X_D3DPIXELSHADERDEF* pPSDef, int psInputTexture[XTL::X_D3DTS_STAGECOUNT]) +{ + psInputTexture[0] = -1; // Stage 0 has no predecessors + psInputTexture[1] = 0; // Stage 1 can only use stage 0 + psInputTexture[2] = (pPSDef->PSInputTexture >> 16) & 0x1; // Stage 2 can use stage 0 or 1 + psInputTexture[3] = (pPSDef->PSInputTexture >> 20) & 0x3; // Stage 3 can only use stage 0, 1 or 2 +} + +void PSH_XBOX_SHADER::Decode(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + int i; + + /* Azurik likes to create and destroy the same shader every frame! O_o + LogFlags = lfUnit; + if (IsRunning(TITLEID_AZURIK)) + LogFlags = LogFlags | lfExtreme;*/ + + GetPSTextureModes(pPSDef, PSTextureModes); + GetPSCompareModes(pPSDef, PSCompareMode); + GetPSDotMapping(pPSDef, PSDotMapping); + GetPSInputTexture(pPSDef, PSInputTexture); + + NumberOfCombiners = (pPSDef->PSCombinerCount >> 0) & 0xF; + CombinerCountFlags = (pPSDef->PSCombinerCount >> 8); + + CombinerMuxesOnMsb = (CombinerCountFlags & PS_COMBINERCOUNT_MUX_MSB) > 0; + CombinerHasUniqueC0 = (CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C0) > 0; + CombinerHasUniqueC1 = (CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C1) > 0; + + // Backwards compatible decoding (purely for logging) : + { + for (i = 0; i < XTL::X_PSH_COMBINECOUNT; i++) { + Combiners[i].RGB.Decode(pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i]); + Combiners[i].Alpha.Decode(pPSDef->PSAlphaInputs[i], pPSDef->PSAlphaOutputs[i], /*aIsAlpha=*/true); + } + + FinalCombiner.Decode(pPSDef->PSFinalCombinerInputsABCD, pPSDef->PSFinalCombinerInputsEFG, pPSDef->PSFinalCombinerConstants); + } +} + +PSH_RECOMPILED_SHADER PSH_XBOX_SHADER::Convert(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + int i; + Recompiled = {}; + Recompiled.PSDef = *pPSDef; + + // Use a fluent interface to start with a pixel shader version opcode that knowns the host version + NewIntermediate()->Initialize(PO_XPS)->Parameters[6].Mask = m_PSVersion; + + for (i = 0; i < NumberOfCombiners; i++) + { + // Check that the RGB and Alpha inputs do the same operation : + if ( ((pPSDef->PSRGBInputs[i] & PS_NoChannelsMask) == (pPSDef->PSAlphaInputs[i] & PS_NoChannelsMask)) + // Check if all RGB channels are set to read from PS_CHANNEL_RGB : + && ((pPSDef->PSRGBInputs[i] & PS_AlphaChannelsMask) == 0) + // Check if all Alpha channels are set to read from PS_CHANNEL_ALPHA : + && ((pPSDef->PSAlphaInputs[i] & PS_AlphaChannelsMask) == PS_AlphaChannelsMask) + // Check that RGB and Alpha output to the same register(s) : + && (pPSDef->PSRGBOutputs[i] == pPSDef->PSAlphaOutputs[i])) + { + // In this case, we can convert RGB and Alpha together : + if (!NewIntermediate()->Decode(i, pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i], MASK_RGBA)) + DeleteLastIntermediate(); + } + else + { + // Otherwise, we need to convert RGB and Alpha separately : + if (!NewIntermediate()->Decode(i, pPSDef->PSRGBInputs[i], pPSDef->PSRGBOutputs[i], MASK_RGB)) + DeleteLastIntermediate(); + + if (!NewIntermediate()->Decode(i, pPSDef->PSAlphaInputs[i], pPSDef->PSAlphaOutputs[i], MASK_A)) + DeleteLastIntermediate(); + } + } + + if ((pPSDef->PSFinalCombinerInputsABCD > 0) + || (pPSDef->PSFinalCombinerInputsEFG > 0)) { + if (NewIntermediate()->DecodeFinalCombiner(pPSDef->PSFinalCombinerInputsABCD, pPSDef->PSFinalCombinerInputsEFG)) + { + FinalCombinerFlags = (PS_FINALCOMBINERSETTING)((pPSDef->PSFinalCombinerInputsEFG >> 0) & 0xFF); +// dwPS_GLOBALFLAGS = (pPSDef->PSFinalCombinerConstants >> 8) & 0x1; + } + else + DeleteLastIntermediate(); + } + // Dump the contents of the PixelShader def + //if (MayLog(LogFlags)) + // dump pixel shader definition to string + // TODO : Reinstate : XTL_DumpPixelShaderToFile(pPSDef); + + //if (MayLog(LogFlags)) + { + // print relevant contents to the debug console + EmuLog(LOG_LEVEL::DEBUG, "%s", DecodedToString(pPSDef).c_str()); + } + + // TODO: + // - Insert tex* and def instructions + + Log("Parse result"); + + if (MoveRemovableParametersRight()) + Log("MoveRemovableParametersRight"); + + if (RemoveNops()) + Log("RemoveNops"); + + while (RemoveUselessWrites()) { + Log("RemoveUselessWrites"); + if (RemoveNops()) + Log("RemoveNops"); + } + + if (ConvertConstantsToNative(pPSDef, /*Recompiled=*/&Recompiled)) + Log("ConvertConstantsToNative"); + + // Handle Texture declarations : + if (DecodeTextureModes(pPSDef)) + Log("DecodeTextureModes"); + + ConvertXboxOpcodesToNative(pPSDef); + Log("ConvertXboxOpcodesToNative"); + + while (RemoveUselessWrites()) { // again + Log("RemoveUselessWrites"); + if (RemoveNops()) + Log("RemoveNops"); + } + + // Resolve all differences : + if (FixupPixelShader()) + Log("FixupPixelShader"); + + if (FixInvalidDstRegister()) + Log("FixInvalidDstRegister"); + + if (FixConstantParameters()) + Log("FixConstantParameters"); + + if (FixArgumentModifiers()) + Log("FixArgumentModifiers"); + + if (FixInstructionModifiers()) + Log("FixInstructionModifiers"); + + if (FixInvalidSrcSwizzle()) + Log("FixInvalidSrcSwizzle"); + + if (FixMissingR0a()) + Log("FixMissingR0a"); + + if (FixMissingR1a()) + Log("FixMissingR1a"); + + if (FixCoIssuedOpcodes()) + Log("FixCoIssuedOpcodes"); + + if (FixOverusedRegisters()) + Log("FixOverusedRegisters"); + + if (FixUninitializedReads()) + Log("FixUninitializedReads"); + + if (FinalizeShader()) + Log("FinalizeShader"); + + Log("End result"); + + Recompiled.NewShaderStr = ToString(); + return Recompiled; +} + +std::string PSH_XBOX_SHADER::DecodedToString(XTL::X_D3DPIXELSHADERDEF *pPSDef) +// print relevant contents to the debug console + + #define _AddStr1(aStr) \ + \ + Result = Result + aStr + "\n"; + + #define _AddStr(aStr, ...) \ + {\ + _AddStr1(std::string(buf, sprintf(buf, aStr, __VA_ARGS__))); \ + } +{ + char buf[256]; + int i; + + std::string Result = ""; + // Show the contents to the user + _AddStr1("\n-----PixelShader Definition Contents-----"); + _AddStr1(OriginalToString(pPSDef)); + + if (XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) > 0) + { + _AddStr1("\nPSTextureModes ->"); // Texture addressing modes + _AddStr("Stage 0: %s", PS_TextureModesStr[PSTextureModes[0]]); + _AddStr("Stage 1: %s", PS_TextureModesStr[PSTextureModes[1]]); + _AddStr("Stage 2: %s", PS_TextureModesStr[PSTextureModes[2]]); + _AddStr("Stage 3: %s", PS_TextureModesStr[PSTextureModes[3]]); + } + + if (pPSDef->PSDotMapping > 0) // Input mapping for dot product modes + { + _AddStr1("\nPSDotMapping ->"); + _AddStr("Stage 1: %s", PS_DotMappingStr[PSDotMapping[1]]); + _AddStr("Stage 2: %s", PS_DotMappingStr[PSDotMapping[2]]); + _AddStr("Stage 3: %s", PS_DotMappingStr[PSDotMapping[3]]); + } + + if (pPSDef->PSCompareMode > 0) // Compare modes for clipplane texture mode + { + _AddStr1("\nPSCompareMode ->"); + _AddStr("Stage 0: %s", PS_CompareModeStr[(PSCompareMode[0] == 0) ? 0 : 1]); + _AddStr("Stage 1: %s", PS_CompareModeStr[(PSCompareMode[1] == 0) ? 2 : 3]); + _AddStr("Stage 2: %s", PS_CompareModeStr[(PSCompareMode[2] == 0) ? 4 : 5]); + _AddStr("Stage 3: %s", PS_CompareModeStr[(PSCompareMode[3] == 0) ? 6 : 7]); + } + + if (pPSDef->PSInputTexture > 0) // Texture source for some texture modes + { + _AddStr1("\nPSInputTexture ->"); + _AddStr("Stage 1: %d", PSInputTexture[1]); + _AddStr("Stage 2: %d", PSInputTexture[2]); + _AddStr("Stage 3: %d", PSInputTexture[3]); + } + + if (pPSDef->PSCombinerCount > 0) // Active combiner count (Stages 0-7) + { + _AddStr1("\nPSCombinerCount ->"); + _AddStr("Combiners: %d", NumberOfCombiners); + _AddStr("Mux: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_MUX_MSB) == 0 ? 0 : 1]); + _AddStr("C0: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C0) == 0 ? 2 : 3]); + _AddStr("C1: %s", PS_CombinerCountFlagsStr[(CombinerCountFlags & PS_COMBINERCOUNT_UNIQUE_C1) == 0 ? 4 : 5]); + } + + // Dxbx additions from here onwards : + + for (i = 0; i < NumberOfCombiners; i++) // Loop over all combiner stages + { + _AddStr1("\n"); + + _AddStr("PSRGBOutputs[%d] AB: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.DecodedToString().c_str()); + _AddStr("PSRGBOutputs[%d] CD: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.DecodedToString().c_str()); + _AddStr("PSRGBOutputs[%d] SUM: %s", i, Combiners[i].RGB.OutputSUM.DecodedToString().c_str()); + _AddStr("PSRGBOutputs[%d] flags: %s", i, PSCombinerOutputFlagsToStr(Combiners[i].RGB.CombinerOutputFlags, /*aIsAlpha=*/false).c_str()); + + _AddStr1("\n"); + _AddStr("PSRGBInputs[%d] A: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.Input1.DecodedToString().c_str()); + _AddStr("PSRGBInputs[%d] B: %s", i, Combiners[i].RGB.OutputSUM.OutputAB.Input2.DecodedToString().c_str()); + _AddStr("PSRGBInputs[%d] C: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.Input1.DecodedToString().c_str()); + _AddStr("PSRGBInputs[%d] D: %s", i, Combiners[i].RGB.OutputSUM.OutputCD.Input2.DecodedToString().c_str()); + + _AddStr1("\n"); + _AddStr("PSAlphaOutputs[%d] AB: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.DecodedToString().c_str()); + _AddStr("PSAlphaOutputs[%d] CD: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.DecodedToString().c_str()); + _AddStr("PSAlphaOutputs[%d] SUM: %s", i, Combiners[i].Alpha.OutputSUM.DecodedToString().c_str()); + _AddStr("PSAlphaOutputs[%d] flags: %s", i, PSCombinerOutputFlagsToStr(Combiners[i].Alpha.CombinerOutputFlags, /*aIsAlpha=*/true).c_str()); + + _AddStr1("\n"); + _AddStr("PSAlphaInputs[%d] A: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.Input1.DecodedToString().c_str()); + _AddStr("PSAlphaInputs[%d] B: %s", i, Combiners[i].Alpha.OutputSUM.OutputAB.Input2.DecodedToString().c_str()); + _AddStr("PSAlphaInputs[%d] C: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.Input1.DecodedToString().c_str()); + _AddStr("PSAlphaInputs[%d] D: %s", i, Combiners[i].Alpha.OutputSUM.OutputCD.Input2.DecodedToString().c_str()); + + _AddStr1("\n"); + _AddStr("PSConstant0[%d] : %x", i, pPSDef->PSConstant0[i]); // C0 for each stage + _AddStr("PSConstant1[%d] : %x", i, pPSDef->PSConstant1[i]); // C1 for each stage + } + + if ((pPSDef->PSFinalCombinerInputsABCD > 0) + || (pPSDef->PSFinalCombinerInputsEFG > 0)) // Final combiner inputs + { + _AddStr("\nPSFinalCombinerConstant0 : %x", pPSDef->PSFinalCombinerConstant0); // C0 in final combiner + _AddStr("PSFinalCombinerConstant1 : %x", pPSDef->PSFinalCombinerConstant1); // C1 in final combiner + + _AddStr1("\nPSFinalCombinerInputsABCD ->"); + _AddStr("Input A: %s", FinalCombiner.InputA.DecodedToString().c_str()); + _AddStr("Input B: %s", FinalCombiner.InputB.DecodedToString().c_str()); + _AddStr("Input C: %s", FinalCombiner.InputC.DecodedToString().c_str()); + _AddStr("Input D: %s", FinalCombiner.InputD.DecodedToString().c_str()); + + _AddStr1("\nPSFinalCombinerInputsEFG ->"); + _AddStr("Input E: %s", FinalCombiner.InputE.DecodedToString().c_str()); + _AddStr("Input F: %s", FinalCombiner.InputF.DecodedToString().c_str()); + _AddStr("Input G: %s", FinalCombiner.InputG.DecodedToString().c_str()); + _AddStr("Final combiner setting: %s", PSFinalCombinerSettingToStr((DWORD)(FinalCombiner.FinalCombinerFlags)).c_str()); + + _AddStr1("\nPSFinalCombinerConstants ->"); // Final combiner constant mapping + _AddStr("Offset of D3D constant for (C0: %d", FinalCombiner.FinalCombinerC0Mapping); + _AddStr("Offset of D3D constant for (C1: %d", FinalCombiner.FinalCombinerC1Mapping); + _AddStr("Adjust texture flag: %s", PS_GlobalFlagsStr[PS_GLOBALFLAGS(FinalCombiner.dwPS_GLOBALFLAGS)]); + } + + _AddStr1("\n"); + return Result; +} + + bool _OpcodeMustStayBeforeTextureMode(PSH_OPCODE Opcode, int i) + { + if (Opcode == PO_XPS) + return true; + + // Before texture modes, only keep the first comment (the one mentioning "xps" got converted into "ps") + if (Opcode == PO_COMMENT) + return (i == 0); + + if (Opcode == PO_PS) + return true; + + if (Opcode == PO_DEF) + return true; + + if (Opcode >= PO_DCL && Opcode <= PO_DCL_VOLUME) + return true; + + return false; + } + + bool PSH_XBOX_SHADER::_NextIs2D(int Stage) + { + if (Stage < XTL::X_D3DTS_STAGECOUNT-1) + return (PSTextureModes[Stage + 1] == PS_TEXTUREMODES_DOT_ST) || (PSTextureModes[Stage + 1] == PS_TEXTUREMODES_DOT_ZW); + else + return false; + } + +bool PSH_XBOX_SHADER::DecodeTextureModes(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + int InsertPos; + PSH_INTERMEDIATE_FORMAT Ins = {}; + std::vector InsertIns; + int Stage; + + InsertIns.reserve(32); // arbitrary allotment of instructions + InsertIns.resize(XTL::X_D3DTS_STAGECOUNT); // default initialized to PO_COMMENT instructions + + bool Result = false; + + InsertPos = -1; + do { + ++InsertPos; + } while (_OpcodeMustStayBeforeTextureMode(Intermediate[InsertPos].Opcode, InsertPos)); + + Ins.Initialize(PO_DCL); + for (Stage = 0; Stage < XTL::X_D3DTS_STAGECOUNT; Stage++) + { + if (PSTextureModes[Stage] != PS_TEXTUREMODES_NONE || Stage < PSH_XBOX_MAX_T_REGISTER_COUNT) + { + switch (PSTextureModes[Stage]) + { + case PS_TEXTUREMODES_PROJECT2D: // argb = texture(r/q, s/q) TODO : Apply the division via D3DTOP_BUMPENVMAP ? + case PS_TEXTUREMODES_BUMPENVMAP: + case PS_TEXTUREMODES_BUMPENVMAP_LUM: + case PS_TEXTUREMODES_DOT_ST: + case PS_TEXTUREMODES_DPNDNT_AR: + case PS_TEXTUREMODES_DPNDNT_GB: + { + Ins.Opcode = PO_DCL_2D; + Ins.Output[0].SetRegister(PARAM_S, Stage, MASK_RGBA); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + break; + } + case PS_TEXTUREMODES_PROJECT3D: // argb = texture(r/q, s/q, t/q) Note : 3d textures are sampled using PS_TEXTUREMODES_CUBEMAP + case PS_TEXTUREMODES_BRDF: + case PS_TEXTUREMODES_DOT_STR_3D: + { + Ins.Opcode = PO_DCL_VOLUME; + Ins.Output[0].SetRegister(PARAM_S, Stage, MASK_RGBA); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + break; + } + case PS_TEXTUREMODES_CUBEMAP: // argb = cubemap(r/q, s/q, t/q) + case PS_TEXTUREMODES_DOT_RFLCT_DIFF: + case PS_TEXTUREMODES_DOT_RFLCT_SPEC: + case PS_TEXTUREMODES_DOT_STR_CUBE: + case PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST: + { + Ins.Opcode = PO_DCL_CUBE; + Ins.Output[0].SetRegister(PARAM_S, Stage, MASK_RGBA); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + break; + } + } + + Ins.Opcode = PO_DCL; + Ins.Output[0].SetRegister(PARAM_T, Stage, MASK_RGBA); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + } + } + + for (int j = 0; j < PSH_XBOX_MAX_V_REGISTER_COUNT; ++j) + { + Ins.Opcode = PO_DCL; + Ins.Output[0].SetRegister(PARAM_V, j, MASK_RGBA); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + } + + PSH_OPCODE Opcode; + + Opcode = PO_TEXLD2; + + for (Stage = 0; Stage < XTL::X_D3DTS_STAGECOUNT; Stage++) + { + // TODO : Apply conversions when PS_GLOBALFLAGS_TEXMODE_ADJUST is set (but ... how to check the texture type? read D3DRS_PSTEXTUREMODES?) + + // Convert the texture mode to a texture addressing instruction : + switch (PSTextureModes[Stage]) { // input = q,s,t,r (same layout as a,r,g,b, also known as w,x,y,z) + case PS_TEXTUREMODES_PROJECT2D: // argb = texture(r/q, s/q) TODO : Apply the division via D3DTOP_BUMPENVMAP ? + case PS_TEXTUREMODES_PROJECT3D: // argb = texture(r/q, s/q, t/q) Note : 3d textures are sampled using PS_TEXTUREMODES_CUBEMAP + case PS_TEXTUREMODES_CUBEMAP: { // argb = cubemap(r/q, s/q, t/q) + Opcode = PO_TEXLD2; + + if (m_PSVersion >= D3DPS_VERSION(3, 0)) + continue; + break; + } + case PS_TEXTUREMODES_NONE: + case PS_TEXTUREMODES_PASSTHRU: + Opcode = PO_MOV; + break; + case PS_TEXTUREMODES_CLIPPLANE: Opcode = PO_TEXKILL; break; + case PS_TEXTUREMODES_BUMPENVMAP: Opcode = PO_TEXBEM; break; + case PS_TEXTUREMODES_BUMPENVMAP_LUM: Opcode = PO_TEXBEML; break; + case PS_TEXTUREMODES_BRDF: Opcode = PO_TEXBRDF; break; // Note : Not supported by Direct3D8 ? + case PS_TEXTUREMODES_DOT_ST: Opcode = PO_TEXM3X2TEX; break; + case PS_TEXTUREMODES_DOT_ZW: Opcode = PO_TEXM3X2DEPTH; break; // Note : requires ps.1.3 and a preceding texm3x2pad + case PS_TEXTUREMODES_DOT_RFLCT_DIFF: Opcode = PO_TEXM3X3DIFF; break; // Note : Not supported by Direct3D8 ? + case PS_TEXTUREMODES_DOT_RFLCT_SPEC: Opcode = PO_TEXM3X3VSPEC; break; + case PS_TEXTUREMODES_DOT_STR_3D: Opcode = PO_TEXM3X3TEX; break; // Note : Uses a 3d texture + case PS_TEXTUREMODES_DOT_STR_CUBE: Opcode = PO_TEXM3X3TEX; break; // Note : Uses a cube texture + case PS_TEXTUREMODES_DPNDNT_AR: Opcode = PO_TEXREG2AR; break; + case PS_TEXTUREMODES_DPNDNT_GB: Opcode = PO_TEXREG2GB; break; + case PS_TEXTUREMODES_DOTPRODUCT: + if (_NextIs2D(Stage)) + Opcode = PO_TEXM3X2PAD; + else + Opcode = PO_TEXM3X3PAD; + break; + case PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST: Opcode = PO_TEXM3X3SPEC; break; // Note : Needs 3 arguments! + default: + continue; + } + + InsertTextureModeInstruction(pPSDef, Stage, Opcode, InsertIns, InsertPos); + Result = true; + } + if (Result) + { + for (unsigned i = 0; i < InsertIns.size(); ++i) + { + if (i >= XTL::X_D3DTS_STAGECOUNT || InsertIns[i].Opcode != PO_COMMENT) + { + InsertIntermediate(&InsertIns[i], InsertPos); + ++InsertPos; + } + } + } + StartPos = InsertPos + 1; + return Result; +} + +int PSH_XBOX_SHADER::GetTextureStageModifiers(int Stage) +{ + int modifiers = 0; + switch (PSDotMapping[Stage]) + { + case PS_DOTMAPPING_ZERO_TO_ONE: + break; + case PS_DOTMAPPING_MINUS1_TO_1_D3D: + modifiers = (1 << ARGMOD_SCALE_BX2); + break; + case PS_DOTMAPPING_MINUS1_TO_1_GL: + break; + case PS_DOTMAPPING_MINUS1_TO_1: + break; + case PS_DOTMAPPING_HILO_1: + break; + case PS_DOTMAPPING_HILO_HEMISPHERE: + break; + default: + break; + } + + return modifiers; +} + +void PSH_XBOX_SHADER::InsertTex3x2Instructions(int Stage, int inputStage, std::vector& InsertIns) +{ + PSH_INTERMEDIATE_FORMAT Ins = {}; + + const int modifiers = GetTextureStageModifiers(Stage); + + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage - 1, 0); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, 0); + Ins.Parameters[1].Modifiers = modifiers; + InsertIns.emplace_back(Ins); + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage - 0, 0); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, 0); + Ins.Parameters[1].Modifiers = modifiers; + InsertIns.emplace_back(Ins); +} + +void PSH_XBOX_SHADER::InsertTex3x3Instructions(int Stage, int inputStage, std::vector& InsertIns) +{ + PSH_INTERMEDIATE_FORMAT Ins = {}; + + const int modifiers = GetTextureStageModifiers(Stage); + + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage - 2, 0); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, 0); + Ins.Parameters[1].Modifiers = modifiers; + InsertIns.emplace_back(Ins); + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage - 1, 0); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, 0); + Ins.Parameters[1].Modifiers = modifiers; + InsertIns.emplace_back(Ins); + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_B); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage - 0, 0); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, 0); + Ins.Parameters[1].Modifiers = modifiers; + InsertIns.emplace_back(Ins); +} + +bool PSH_XBOX_SHADER::InsertTextureModeInstruction(XTL::X_D3DPIXELSHADERDEF *pPSDef, int Stage, PSH_OPCODE opcode, std::vector& InsertIns, int& InsertPos) +{ + PSH_INTERMEDIATE_FORMAT Ins = {}; + + bool Result = false; + + PSH_ARGUMENT_TYPE type = PARAM_T; + int inputStage = Stage; + int mask = 0; + + // TODO: Refactor and optimize + // TODO: Update handling to support 1.4? + bool needsInitialization = false; + switch (opcode) + { + case PO_TEXBEM: + case PO_TEXBEML: + { + inputStage = PSInputTexture[Stage]; + + // If the bump-map texture format is X_D3DFMT_X8L8V8U8 or X_D3DFMT_L6V5U5 we need to apply a bias + // This happens because these formats are an alias of unsigned texture formats. + // Fixes an issue with the JSRF boost-dash effect + // NOTE: This assumes that this shader will only ever be used for the input bumpmap texture + // If this causes regressions in other titles, we'll need to be smarter about this + // and include the texture formats in the shader hash, somehow. + bool bias = false; + auto biasModifier = (1 << ARGMOD_SCALE_BX2); + auto pXboxTexture = g_pXbox_SetTexture[inputStage]; + if (pXboxTexture != nullptr) { + extern XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::X_D3DPixelContainer *pXboxPixelContainer); // TODO : Move to XTL-independent header file + + switch (GetXboxPixelContainerFormat(pXboxTexture)) { + case XTL::X_D3DFMT_L6V5U5: { + extern XTL::X_D3DRESOURCETYPE GetXboxD3DResourceType(const XTL::X_D3DResource *pXboxResource); // TODO : Move to XTL-independent header file + extern bool IsSupportedFormat(XTL::X_D3DFORMAT X_Format, XTL::X_D3DRESOURCETYPE XboxResourceType, DWORD D3DUsage); // TODO : Move to XTL-independent header file + + // L6V5U5 format is converted incorrectly if not supported by the device + XTL::X_D3DRESOURCETYPE XboxResourceType = GetXboxD3DResourceType(pXboxTexture); + DWORD D3DUsage = 0; // TODO : Since it's not yet know how to determine D3DUsage in this case, 'hack' it by using no specific D3DUSAGE_* flags. + + bias = !IsSupportedFormat(/*XboxFormat=*/XTL::X_D3DFMT_L6V5U5, XboxResourceType, D3DUsage); + break; + } + case XTL::X_D3DFMT_X8L8V8U8: { + bias = true; + break; + } + } + } + + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetScaleBemLumRegister(D3DTSS_BUMPENVMAT00, Stage, Recompiled); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, MASK_R); + + if (bias) { + Ins.Parameters[1].Modifiers = biasModifier; + } + + Ins.Parameters[2].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, MASK_R); + InsertIns.emplace_back(Ins); + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetScaleBemLumRegister(D3DTSS_BUMPENVMAT10, Stage, Recompiled); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, MASK_G); + if (bias) { + Ins.Parameters[1].Modifiers = biasModifier; + } + Ins.Parameters[2].SetRegister(PARAM_R, 1, MASK_R); + InsertIns.emplace_back(Ins); + // + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetScaleBemLumRegister(D3DTSS_BUMPENVMAT01, Stage, Recompiled); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, MASK_R); + if (bias) { + Ins.Parameters[1].Modifiers = biasModifier; + } + Ins.Parameters[2].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, MASK_G); + InsertIns.emplace_back(Ins); + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetScaleBemLumRegister(D3DTSS_BUMPENVMAT11, Stage, Recompiled); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, MASK_G); + if (bias) { + Ins.Parameters[1].Modifiers = biasModifier; + } + Ins.Parameters[2].SetRegister(PARAM_R, 1, MASK_G); + InsertIns.emplace_back(Ins); + + Ins.CommentString = ""; + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + Ins.Parameters[1].Modifiers = 0; + InsertIns.emplace_back(Ins); + + if (opcode == PO_TEXBEML) + { + // + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_B); + Ins.Parameters[0].SetScaleBemLumRegister(D3DTSS_BUMPENVLSCALE, Stage, Recompiled); + Ins.Parameters[1].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + inputStage, MASK_B); + Ins.Parameters[2].SetScaleBemLumRegister(D3DTSS_BUMPENVLOFFSET, Stage, Recompiled); + InsertIns.emplace_back(Ins); + // + Ins.Initialize(PO_MUL); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[1].SetRegister(PARAM_R, 1, MASK_B); + InsertIns.emplace_back(Ins); + } + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + + break; + } + case PO_TEXBRDF: + inputStage = PSInputTexture[Stage]; + break; + case PO_TEXM3X2TEX: + { + inputStage = PSInputTexture[Stage]; + + InsertTex3x2Instructions(Stage, inputStage, InsertIns); + + Ins.CommentString = ""; + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXM3X3TEX: + { + inputStage = PSInputTexture[Stage]; + + InsertTex3x3Instructions(Stage, inputStage, InsertIns); + + Ins.CommentString = ""; + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXM3X2DEPTH: + { + inputStage = PSInputTexture[Stage]; + + InsertTex3x2Instructions(Stage, inputStage, InsertIns); + + Ins.CommentString = ""; + Ins.Initialize(PO_RCP); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_B); + Ins.Parameters[0].SetRegister(PARAM_R, 1, MASK_G); + InsertIns.emplace_back(Ins); + + Ins.Initialize(PO_MUL); + Ins.Modifier = INSMOD_SAT; + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_B); + Ins.Parameters[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[1].SetRegister(PARAM_R, 1, MASK_B); + InsertIns.emplace_back(Ins); + + Ins.Initialize(PO_CMP); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_B); + Ins.Parameters[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].Modifiers = (1 << ARGMOD_NEGATE); + Ins.Parameters[1].SetScaleConstRegister(1.0, Recompiled); + Ins.Parameters[2].SetRegister(PARAM_R, 1, MASK_B); + InsertIns.emplace_back(Ins); + + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_oDepth, 0, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, MASK_B); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXM3X3DIFF: + { + inputStage = PSInputTexture[Stage]; + + InsertTex3x3Instructions(Stage, inputStage, InsertIns); + + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXM3X3VSPEC: + case PO_TEXM3X3SPEC: + { + inputStage = PSInputTexture[Stage]; + + InsertTex3x3Instructions(Stage, inputStage, InsertIns); + + int baseRegister = PSH_XBOX_MAX_R_REGISTER_COUNT + PSH_XBOX_MAX_T_REGISTER_COUNT; + + // get eye-ray vector + Ins.Initialize(PO_COMMENT); + Ins.CommentString = "; get eye-ray vector"; + InsertIns.emplace_back(Ins); + if (opcode == PO_TEXM3X3VSPEC) + { + // E.x + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 0, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_T, Stage - 2, MASK_A); + InsertIns.emplace_back(Ins); + // E.y + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 0, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_T, Stage - 1, MASK_A); + InsertIns.emplace_back(Ins); + // E.z + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 0, MASK_B); + Ins.Parameters[0].SetRegister(PARAM_T, Stage - 0, MASK_A); + InsertIns.emplace_back(Ins); + // E.w + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 0, MASK_A); + Ins.Parameters[0].SetScaleConstRegister(0.0, Recompiled); + InsertIns.emplace_back(Ins); + } + else + { + // E + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 0, 0); + Ins.Parameters[0].SetRegister(PARAM_C, 0, 0); + InsertIns.emplace_back(Ins); + } + + // compute reflection vector + Ins.Initialize(PO_COMMENT); + Ins.CommentString = "; compute reflection vector"; + InsertIns.emplace_back(Ins); + // N.E + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_R, baseRegister + 0, 0); + InsertIns.emplace_back(Ins); + // 2 * (N.E) + Ins.Initialize(PO_MUL); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[1].SetScaleConstRegister(2.0, Recompiled); + InsertIns.emplace_back(Ins); + // N.N + Ins.Initialize(PO_DP3); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_R, 1, 0); + InsertIns.emplace_back(Ins); + // 1 / (N.N) + Ins.Initialize(PO_RCP); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_R, baseRegister + 1, MASK_G); + InsertIns.emplace_back(Ins); + // 2 * N.E / N.N + Ins.Initialize(PO_MUL); + Ins.Output[0].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[1].SetRegister(PARAM_R, baseRegister + 1, MASK_G); + InsertIns.emplace_back(Ins); + // 2 * N.E / N.N * N - E + Ins.Initialize(PO_MAD); + Ins.Output[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_R, baseRegister + 1, MASK_R); + Ins.Parameters[2].SetRegister(PARAM_R, baseRegister + 0, 0); + Ins.Parameters[2].Modifiers = (1 << ARGMOD_NEGATE); + InsertIns.emplace_back(Ins); + + Ins.CommentString = ""; + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXREG2AR: + { + inputStage = PSInputTexture[Stage]; + + // E.x + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_T, Stage, MASK_A); + InsertIns.emplace_back(Ins); + // E.y + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_T, Stage, MASK_R); + InsertIns.emplace_back(Ins); + + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXREG2GB: + { + inputStage = PSInputTexture[Stage]; + + // E.x + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_R); + Ins.Parameters[0].SetRegister(PARAM_T, Stage, MASK_G); + InsertIns.emplace_back(Ins); + // E.y + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, 1, MASK_G); + Ins.Parameters[0].SetRegister(PARAM_T, Stage, MASK_B); + InsertIns.emplace_back(Ins); + + Ins.Initialize(PO_TEXLD2); + Ins.Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + Ins.Parameters[0].SetRegister(PARAM_R, 1, 0); + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + InsertIns.emplace_back(Ins); + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + case PO_TEXM3X2PAD: + case PO_TEXM3X3PAD: + { + inputStage = PSInputTexture[Stage]; + + opcode = PO_MOV; + inputStage = Stage; + needsInitialization = true; + break; + } + + case PO_TEXLD: + case PO_TEXLD2: + case PO_TEXCRD: + case PO_MOV: + needsInitialization = true; + break; + default: + break; + } + + Ins.Initialize(opcode); + + if (needsInitialization) + { + type = PARAM_R; + + // Insert move instructions in reverse order to prevent overwriting wrong register + // Create instructions to move loaded temporary registers into extra temporary registers + InsertIns[XTL::X_D3DTS_STAGECOUNT - Stage - 1].Initialize(PO_MOV); + InsertIns[XTL::X_D3DTS_STAGECOUNT - Stage - 1].Output[0].SetRegister(PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, 0); + InsertIns[XTL::X_D3DTS_STAGECOUNT - Stage - 1].Parameters[0].SetRegister(PARAM_R, Stage, 0); + + if (Ins.Opcode == PO_TEXCRD) + { + mask = MASK_RGB; + } + else + { + } + + // Replace texture coordinate register usage up until first usage as output + int lastUsed = RegisterIsUsedFromIndexUntil(InsertPos, PARAM_T, Stage); + + if (lastUsed >= 0) + { + ReplaceInputRegisterFromIndexOnwards(InsertPos, PARAM_T, Stage, PARAM_R, PSH_XBOX_MAX_R_REGISTER_COUNT + Stage, lastUsed); + } + } + Ins.Output[0].SetRegister(type, Stage, mask); + + // For those texture modes that need it, add the source stage as argument : + if (PSH_OPCODE_DEFS[Ins.Opcode]._In >= 1) + { + Ins.Parameters[0].SetRegister(PARAM_T, inputStage, 0); + + if (Ins.Opcode >= PO_TEXDP3TEX && Ins.Opcode <= PO_TEXM3X3SPEC) + { + Ins.Parameters[0].Modifiers = GetTextureStageModifiers(Stage); + } + } + + if (PSH_OPCODE_DEFS[Ins.Opcode]._In >= 2) + { + if (Ins.Opcode == PO_TEXLD2) + { + Ins.Parameters[1].SetRegister(PARAM_S, Stage, 0); + } + + // Add the third argument : + switch (PSTextureModes[Stage]) { + case PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST: + { + Ins.Parameters[1].SetRegister(PARAM_C, 0, 0); + Ins.CommentString = "Dxbx guess"; // TODO : Where do we get the 3rd argument to this? + break; + } + } + } + +// // Warn about unprocessed flag : +// if ((dwPS_GLOBALFLAGS & PS_GLOBALFLAGS_TEXMODE_ADJUST) > 0) +// Ins.CommentString = Ins.CommentString + " PS_GLOBALFLAGS_TEXMODE_ADJUST unhandled!"; + + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + Result = true; + + return Result; +} + +bool PSH_XBOX_SHADER::MoveRemovableParametersRight() +{ + int i; + + bool Result = false; + + // For all opcodes, try to put constant and discarded arguments in the rightmost slot, to ease following analysis : + i = IntermediateCount; + while (i > StartPos) + { + --i; + + switch (Intermediate[i].Opcode) { +// case PO_SUB: // 1-x is not the same as x-1, but can still be reduced - see SimplifySUB + case PO_ADD: + case PO_DP3: + case PO_DP4: + case PO_MUL: // All these opcodes have two swappable parameters, so try that : + if (Intermediate[i].MoveRemovableParametersRight(0, 1)) + Result = true; + break; + + case PO_XMMA: + case PO_XMMC: + case PO_XDD: + if (Intermediate[i].XMoveNonRegisterOutputsRight()) + Result = true; + break; + + case PO_XDM: + { + // Parameters may be swapped for both dot and mul, + // but the opcodes themselves may not, as we handle + // both XDM operations separately below : + if (Intermediate[i].MoveRemovableParametersRight(0, 1)) + Result = true; + + if (Intermediate[i].MoveRemovableParametersRight(2, 3)) + Result = true; + break; + } + } + } + return Result; +} // MoveRemovableParametersRight + +//bool PSH_XBOX_SHADER::ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled) + + void PSH_XBOX_SHADER::_SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, D3DCOLOR ConstColor) + { + D3DXCOLOR XColor; + + // Colors are defined in RGBA format, and range 0.0 - 1.0 (negative values + // can be obtained by supplying PS_INPUTMAPPING_SIGNED_NEGATE to the combiner + // that reads from these constants). + XColor = ConstColor; + NewIns.Parameters[0].SetConstValue(XColor.r); + NewIns.Parameters[1].SetConstValue(XColor.g); + NewIns.Parameters[2].SetConstValue(XColor.b); + NewIns.Parameters[3].SetConstValue(XColor.a); + } + + void PSH_XBOX_SHADER::_SetColor(/*var OUT*/PSH_INTERMEDIATE_FORMAT &NewIns, D3DCOLORVALUE ConstColor) + { + NewIns.Parameters[0].SetConstValue(ConstColor.r); + NewIns.Parameters[1].SetConstValue(ConstColor.g); + NewIns.Parameters[2].SetConstValue(ConstColor.b); + NewIns.Parameters[3].SetConstValue(ConstColor.a); + } + + // Try to fixup constants above the limit (c7 for PS.1.3) : + int PSH_XBOX_SHADER::_MapConstant(int ConstNr, bool *NativeConstInUse) + { + // 1-to-1 mapping for constants that can be supported native (if not used already) : + if ((ConstNr < MaxConstantFloatRegisters) && (!NativeConstInUse[ConstNr])) + { + return ConstNr; + } + + // Assign not-yet-defined constants bottom-to-up : + int Result = 0; + while (Result < MaxConstantFloatRegisters) + { + if (!NativeConstInUse[Result]) + return Result; + + ++Result; + } + + // Unresolved - fallback to 1st constant : + if (Result >= MaxConstantFloatRegisters) + Result = 0; + + EmuLog(LOG_LEVEL::WARNING, "; Too many constants to emulate, this pixel shader will give unexpected output!"); + return Result; + } + + int PSH_XBOX_SHADER::_HandleConst(int XboxConst, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled, bool *NativeConstInUse, bool *EmittedNewConstant) + { + int NativeConst; + + if (!Recompiled->ConstInUse[XboxConst]) + { + // Determine and remember a new mapping to native : + NativeConst = _MapConstant(XboxConst, NativeConstInUse); + NativeConstInUse[NativeConst] = true; + Recompiled->ConstMapping[XboxConst] = NativeConst; + Recompiled->ConstInUse[XboxConst] = true; + // Make sure we can check this is a new constant (so we can emit a constant declaration + // for any final combiner constants - because those cannot be set via SetPixelShaderConstant) : + *EmittedNewConstant = true; + } + + // Return the (previously) determined mapping : + return Recompiled->ConstMapping[XboxConst]; + } + +bool PSH_XBOX_SHADER::ConvertConstantsToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef, /*var OUT*/PSH_RECOMPILED_SHADER *Recompiled) +{ + int i, j; + PPSH_INTERMEDIATE_FORMAT Cur; + PPSH_IMD_ARGUMENT CurArg; + bool NativeConstInUse[224]; // Note : 224 = highest possible MaxConstantFloatRegisters + int16_t OriginalConstantNr; + bool EmittedNewConstant = false; + PSH_INTERMEDIATE_FORMAT NewIns = {}; + + bool Result = false; + + // Note : Recompiled.ConstMapping and Recompiled.ConstInUse[i] are still empty here. + for (i = 0; i < MaxConstantFloatRegisters; i++) + NativeConstInUse[i] = false; + + Result = true; + + NewIns.Initialize(PO_DEF); + + // Add constants used to represent common powers of 2 used by instruction and argument modifiers + // Represent constant 0.0 and common powers of 2 divisions + NewIns.Output[0].SetRegister(PARAM_C, _HandleConst(PSH_XBOX_CONSTANT_MUL1, Recompiled, &NativeConstInUse[0], &EmittedNewConstant), MASK_RGBA); + _SetColor(NewIns, { 0.0, 1.0 / 2.0, 1.0 / 4.0, 1.0 / 8.0 }); + InsertIntermediate(&NewIns, 1); + + // Represent common powers of 2 constants, also used as multipliers + NewIns.Output[0].SetRegister(PARAM_C, _HandleConst(PSH_XBOX_CONSTANT_MUL0, Recompiled, &NativeConstInUse[0], &EmittedNewConstant), MASK_RGBA); + _SetColor(NewIns, {1.0, 2.0, 4.0, 8.0}); + InsertIntermediate(&NewIns, 1); + + for (i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) + { + _HandleConst(PSH_XBOX_CONSTANT_BEM + i, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + _HandleConst(PSH_XBOX_CONSTANT_LUM + i, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + } + + // Loop over all opcodes to update the constant-indexes (Xbox uses C0 and C1 in each combiner) : + for (i = 0; i < IntermediateCount; i++) + { + // Loop over this opcodes' input arguments : + Cur = &(Intermediate[i]); + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) + { + // Only handle arguments that address a constant register : + CurArg = &(Cur->Parameters[j]); + + // The Fog register is not supported on PC so we convert it to a constant too : + // (But only if the MASK is not solely accessing the alpha-channel - we don't support that) + if (CurArg->Type == PARAM_FOG) + { + if (CurArg->Mask != MASK_A) + { + CurArg->Type = PARAM_C; + CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FOG, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + CurArg->Mask = CurArg->Mask & (!MASK_A); + } + else + { + // Until we can get Alpha fog from the vertex shader somehow, + // set it to a constant value, so these shaders (like appearing + // in Dolphin samples) still compile and give reasonable output : + CurArg->SetConstValue(1.0); + Cur->CommentString = "FOG.a not emulated, using 1."; + } + + continue; + } + + if (CurArg->Type != PARAM_C) + continue; + + // Make sure we can detect new constants (and if it was C0 or C1), + // as we need this for fixing up final combiner constants : + EmittedNewConstant = false; + OriginalConstantNr = CurArg->Address; + + // For each constant being addressed, we find out which Xbox constant it is, + // and map it to a native constant (as far as we have space for them) : + switch (CurArg->Address) { + case 0: // Handle C0 (if present) : + { + // The final combiner has a separate C0 constant : + if (Cur->CombinerStageNr == XFC_COMBINERSTAGENR) + CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FC0, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + else + { + // See if C0 has a unique index per combiner stage : + if (CombinerHasUniqueC0) + // C0 actually ranges from c0 to c7, one for each possible combiner stage (X_D3DRS_PSCONSTANT0_0..X_D3DRS_PSCONSTANT0_7) : + CurArg->Address = _HandleConst(Cur->CombinerStageNr, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + else + // Non-unique just reads the same C0 in every stage : + CurArg->Address = _HandleConst(0, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + } + break; + } + + case 1: // Handle C1 (if present) : + { + // The final combiner has a separate C1 constant : + if (Cur->CombinerStageNr == XFC_COMBINERSTAGENR) + CurArg->Address = _HandleConst(PSH_XBOX_CONSTANT_FC1, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + else + { + // See if C1 has a unique index per combiner stage : + if (CombinerHasUniqueC1) + // C1 actually ranges from c8 to c15, one for each possible combiner stage (X_D3DRS_PSCONSTANT1_0..X_D3DRS_PSCONSTANT1_7) : + CurArg->Address = _HandleConst(Cur->CombinerStageNr + 8, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + else + // Non-unique just reads the same C1 in every stage : + CurArg->Address = _HandleConst(1, Recompiled, &NativeConstInUse[0], &EmittedNewConstant); + } + break; + } + } // switch + + // New constants solely used for the final combiner must be DEFined separately, + // as there's no other way to set these (SetPixelShaderConstant can only write + // to the 16 slots X_D3DRS_PSCONSTANT1_0..X_D3DRS_PSCONSTANT1_7) : + if ((Cur->CombinerStageNr == XFC_COMBINERSTAGENR) && EmittedNewConstant) + { + // Output a new opcode to define this constant : + NewIns.Initialize(PO_DEF); + NewIns.Output[0].SetRegister(PARAM_C, CurArg->Address, MASK_RGBA); + if (OriginalConstantNr == 0) + _SetColor(NewIns, pPSDef->PSFinalCombinerConstant0); + else + _SetColor(NewIns, pPSDef->PSFinalCombinerConstant1); + + // PO_DEF opcodes go after the initial PO_XPS (which is not yet replaced by PO_COMMENT+PO_PS, + // see ConvertXboxOpcodesToNative calling ConvertXPSToNative for that) + InsertIntermediate(&NewIns, 1); + Result = true; + } + } // for arguments + } // for opcodes + + return Result; +} // ConvertConstantsToNative + +bool PSH_XBOX_SHADER::RemoveUselessWrites() +// Note : Xbox allows writing to V0 (diffuse color) and V1 (specular color), but native ps.1.3 doesn't! +// Some examples of this behaviour can be seen when running RayMan Arena. +{ + int i, j; + PPSH_INTERMEDIATE_FORMAT Cur; + PPSH_IMD_ARGUMENT CurArg; + DWORD RegUsage[/*PSH_ARGUMENT_TYPE*/PARAM_C - PARAM_VALUE + 1][224] = {}; // 224 = highest possible PSH_PC_MAX_REGISTER_COUNT + + // TODO : In Polynomial Texture Maps, one extra opcode could be deleted (sub r1.rgb, v0,v0), why doesn't it? + bool Result = false; + + // Mark only R0 (and discard) as initially 'read', as these may not result in a removal : + RegUsage[PARAM_R][0] = MASK_RGBA; + for (i = 0; i < PSH_PC_MAX_REGISTER_COUNT; i++) + RegUsage[PARAM_DISCARD][i] = MASK_RGBA; + + i = IntermediateCount; + while (i > StartPos) + { + --i; + Cur = &(Intermediate[i]); + if (!Cur->IsArithmetic()) + continue; + + // Loop over the output arguments : + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) + { + CurArg = &(Cur->Output[j]); + + // Remove useless flag, to ease up later comparisions : + CurArg->Modifiers = CurArg->Modifiers & ~(1 << ARGMOD_IDENTITY); + + // Discard useless writes : + if ( (CurArg->Address < MaxTemporaryRegisters) + && ((RegUsage[CurArg->Type][CurArg->Address] & CurArg->Mask) == 0)) + { + EmuLog(LOG_LEVEL::DEBUG, "; Removed useless assignment to register %s", CurArg->ToString().c_str()); + CurArg->Type = PARAM_DISCARD; + Result = true; + } + } + + // Loop over the input arguments : + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) + { + CurArg = &(Cur->Parameters[j]); + // Skip non-register parameters : + if (!CurArg->UsesRegister()) + continue; + + // Remove useless flag, to ease up later comparisions : + CurArg->Modifiers = CurArg->Modifiers & ~(1 << ARGMOD_IDENTITY); + + // Keep track of all register reads, so that we can discard useless writes : + if (CurArg->Address < MaxTemporaryRegisters) + RegUsage[CurArg->Type][CurArg->Address] = RegUsage[CurArg->Type][CurArg->Address] | CurArg->Mask; + } + } + return Result; +} // RemoveUselessWrites + +void PSH_XBOX_SHADER::ConvertXboxOpcodesToNative(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + std::string CommentString; + + // Do a bottom-to-top pass, converting all xbox opcodes into a native set of opcodes : + i = IntermediateCount; + while (i > 0) + { + --i; + Cur = &(Intermediate[i]); + + // Convert all Xbox opcodes into native opcodes : + CommentString = Cur->ToString(); + switch (Cur->Opcode) { + case PO_XPS: ConvertXPSToNative(i); break; + case PO_XMMA: ConvertXMMAToNative(i); break; + case PO_XMMC: ConvertXMMCToNative(i); break; + case PO_XDM: ConvertXDMToNative(i); break; + case PO_XDD: ConvertXDDToNative(i); break; + case PO_XFC: ConvertXFCToNative(i); break; // Can only occur once, as the last instruction + default: + CommentString = ""; break; + } + + if (!CommentString.empty()) { + PSH_INTERMEDIATE_FORMAT NewIns = {}; + NewIns.Initialize(PO_COMMENT)->CommentString = CommentString; + InsertIntermediate(&NewIns, i); + } + } +} // ConvertXboxOpcodesToNative + +void PSH_XBOX_SHADER::ConvertXPSToNative(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + + Cur = &(Intermediate[i]); + Cur->Opcode = PO_PS; +} + +bool PSH_XBOX_SHADER::ConvertXMMToNative_Except3RdOutput(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + int InsertPos; + PSH_INTERMEDIATE_FORMAT Ins = {}; + + bool Result = false; + Cur = &(Intermediate[i]); + InsertPos = i; + + // This block is meant for cases where XMMA/XMMC discards the 3rd output : + if (Cur->Output[2].Type == PARAM_DISCARD) + { + // Mark that this XMMA/XMMC opcode is already handled here : + Result = true; + + // The opcode must unconditionally change into a MUL (or two) : + Cur->Opcode = PO_MUL; + + // Is the second output ignored? + if (Cur->Output[1].Type == PARAM_DISCARD) + { + // If the first output is also ignored : + if (Cur->Output[0].Type == PARAM_DISCARD) + // The complete opcode can already be removed early on : + DeleteIntermediate(i); + else + ;// The first output is just a MUL, it's output (and first two parameters) are already in-place, so we're done + + return Result; + } + ++InsertPos; + + // Create a second MUL opcode for the second result : + Ins = *Cur; + Ins.XCopySecondOpcodeToFirst(PO_MUL); + InsertIntermediate(&Ins, InsertPos); + return Result; + } + + // The third output is needed, but what about the first and second output ? + + if (Cur->Output[0].Type == PARAM_DISCARD) + { + Cur->Output[0].Type = PARAM_T; + Cur->Output[0].Address = FakeRegNr_Xmm1; // 'r4' + } + + if (Cur->Output[1].Type == PARAM_DISCARD) + { + Cur->Output[1].Type = PARAM_T; + Cur->Output[1].Address = FakeRegNr_Xmm2; // 'r5' + } + + // Generate a MUL for the 1st output : + Ins = *Cur; + Ins.Opcode = PO_MUL; + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + + // Generate a MUL for the 2nd output : + Ins = *Cur; + Ins.XCopySecondOpcodeToFirst(PO_MUL); + InsertIntermediate(&Ins, InsertPos); + + // Note : If XMMA or XMMC writes to the third argument, we now have + // the first and second stored already (if they where not ignored). + // IF one (or both) are ignored, the intermediate result might be + // needed, but let XMMA/XMMC figure that out first - the resulting + // opcode(s) will probably require the initial opcode's removal! + return Result; +} // ConvertXMMToNative_Except3RdOutput + +void PSH_XBOX_SHADER::ConvertXMMAToNative(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + + // Handle the generic case of XMM, and check if the 3rd (Add) argument is ignored : + if (!ConvertXMMToNative_Except3RdOutput(i)) + { + // Add needs to be stored, we already have 2 MULs, so change the XMMA into an ADD : + Cur = &(Intermediate[i+2]); + Cur->Opcode = PO_ADD; + Cur->Modifier = INSMOD_NONE; + Cur->Parameters[0] = Cur->Output[0]; + Cur->Parameters[1] = Cur->Output[1]; + Cur->Output[0] = Cur->Output[2]; + } +} + +void PSH_XBOX_SHADER::ConvertXMMCToNative(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + + // Handle the generic case of XMM, and check if the 3rd (Compare) argument is ignored : + if (!ConvertXMMToNative_Except3RdOutput(i)) + { + // Add needs to be stored, we already have 2 MULs, so change the XMMC into an CND : + Cur = &(Intermediate[i+2]); + // TODO : If CombinerMuxesOnMsb is False, we should compare to the LeastSignificantBit of r0.a - but how? + Cur->Opcode = PO_CND; + Cur->Modifier = INSMOD_NONE; + // Begin the input of CND with the required r0.a parameter : + Cur->Parameters[0].SetRegister(PARAM_R, 0, MASK_A); + Cur->Parameters[0].Modifiers = (1 << ARGMOD_IDENTITY); + Cur->Parameters[0].Multiplier = 1.0; + // Follow that with the 2 selection registers : + Cur->Parameters[1] = Cur->Output[0]; + Cur->Parameters[2] = Cur->Output[1]; + // And put the result it in the final register : + Cur->Output[0] = Cur->Output[2]; + } +} + +void PSH_XBOX_SHADER::ConvertXDMToNative(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT Ins = {}; + + Cur = &(Intermediate[i]); + + // XDM does two operations : + + // a multiply : + if (Cur->Output[1].Type != PARAM_DISCARD) + { + Ins = *Cur; + Ins.XCopySecondOpcodeToFirst(PO_MUL); + InsertIntermediate(&Ins, i+1); + } + + // and a dot product : + if (Cur->Output[0].Type == PARAM_DISCARD) + DeleteIntermediate(i); + else + Cur->Opcode = PO_DP3; +} + +void PSH_XBOX_SHADER::ConvertXDDToNative(int i) +{ + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT Ins = {}; + + Cur = &(Intermediate[i]); + + // XDD does two operations : + + // ...a dot product : + Cur->Opcode = PO_DP3; + + // and another dot product : + if (Cur->Output[1].Type != PARAM_DISCARD) + { + Ins = *Cur; + Ins.XCopySecondOpcodeToFirst(PO_DP3); + InsertIntermediate(&Ins, i+1); + } +} + +void PSH_XBOX_SHADER::ConvertXFCToNative(int i) +{ + PSH_INTERMEDIATE_FORMAT Cur = {}; + int InsertPos; + bool NeedsProd; + bool NeedsSum; + PPSH_IMD_ARGUMENT CurArg; + PSH_INTERMEDIATE_FORMAT Ins = {}; + + // Get a copy of XFC and remove it already, new instructions will replace it : + Cur = Intermediate[i]; + DeleteIntermediate(i); + InsertPos = i; + // 'final combiner - r0 = A*B + (1-A)*C + D'; + + // See if the final combiner uses the prod or sum input parameters : + NeedsProd = false; + NeedsSum = false; + for (i = 0; i < PSH_OPCODE_DEFS[Cur.Opcode]._In; i++) + { + CurArg = &(Cur.Parameters[i]); + + // Check for the three final-combiner-specific argument types : + switch (CurArg->Type) { + case PARAM_V1R0_SUM: + { + // Change SUM into a fake register, which will be resolved later : + CurArg->Type = PARAM_T; + CurArg->Address = FakeRegNr_Sum; // 'r2' + NeedsSum = true; + break; + } + + case PARAM_EF_PROD: + { + // Change PROD into a fake register, which will be resolved later : + CurArg->Type = PARAM_T; + CurArg->Address = FakeRegNr_Prod; // 'r3' + NeedsProd = true; + break; + } + + case PARAM_FOG: + { + // Change FOG into a constant of 1.0, as we can't simulate it otherwise : +// CurArg->SetConstValue(1.0); +// Cur->CommentString = "final combiner - FOG not emulated, using 1."; + break; + } + } + } // for input + + if (NeedsSum) + { + // Add a new opcode that calculates r0*v1 : + Ins.Initialize(PO_MUL); + Ins.Output[0].SetRegister(PARAM_T, FakeRegNr_Sum, MASK_RGBA); // 'r2' + + Ins.Parameters[0].SetRegister(PARAM_R, 0, MASK_RGB); + Ins.Parameters[1].SetRegister(PARAM_V, 1, MASK_RGB); + + // Take the FinalCombinerFlags that influence this result into account : + if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_COMPLEMENT_R0) > 0) + Ins.Parameters[0].Modifiers = (1 << ARGMOD_INVERT); // (1-r0) is used as an input to the sum rather than r0 + if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_COMPLEMENT_V1) > 0) + Ins.Parameters[1].Modifiers = (1 << ARGMOD_INVERT); // (1-v1) is used as an input to the sum rather than v1 + if ((FinalCombinerFlags & PS_FINALCOMBINERSETTING_CLAMP_SUM) > 0) + Ins.Modifier = INSMOD_SAT; // V1+R0 sum clamped to [0,1] + + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted final combiner calculation of V1R0_sum register"); + } + + if (NeedsProd) + { + // Add a new opcode that calculates E*F : + Ins.Initialize(PO_MUL); + Ins.Output[0].SetRegister(PARAM_T, FakeRegNr_Prod, MASK_RGBA); // 'r3' + Ins.Parameters[0] = Cur.Parameters[4]; // E + Ins.Parameters[1] = Cur.Parameters[5]; // F + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted final combiner calculation of EF_prod register"); + } + + // The final combiner calculates : r0.rgb=s0*s1 + (1-s0)*s2 + s3 + // Change that into a LRP + ADD, and let the optimizer reduce it; + + // Add a new opcode that calculates r0.rgb=s0*s1 + (1-s0)*s2 via a LRP : + // Set the output to r0.rgb (as r0.a is determined via s6.a) : + + // Watch out! If s3=r0.rgb, then the LRP cannot use r0, but must use r1 as temp! + if (Cur.Parameters[3].IsRegister(PARAM_R, 0, 0)) + Cur.Output[0].SetRegister(PARAM_R, 1, MASK_RGB); + else + Cur.Output[0].SetRegister(PARAM_R, 0, MASK_RGB); + + Ins = Cur; + Ins.Opcode = PO_LRP; + Ins.Modifier = INSMOD_NONE; + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + + // Add a new opcode that calculates r0.rgb=r0.rgb+s3 : + Ins.Opcode = PO_ADD; + Ins.Modifier = Cur.Modifier; + Ins.Output[0] = Cur.Output[0]; // = r0.rgb + Ins.Parameters[0] = Cur.Output[0]; // = r0.rgb + Ins.Parameters[1] = Cur.Parameters[3]; // =s3 from XFC + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + + // See if s6 is something else than "r0.a" : + if (Cur.Parameters[6].ToString() != "r0.a") + { + // Add a new opcode that moves s6 over to r0.a : + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, 0, MASK_A); + Ins.Parameters[0] = Cur.Parameters[6]; + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + } +} + +bool PSH_XBOX_SHADER::RemoveNops() +{ + int i, j; + PPSH_INTERMEDIATE_FORMAT Cur; + bool HasOutput; + + bool Result = false; + i = IntermediateCount; + while (i > StartPos) + { + --i; + Cur = &(Intermediate[i]); + + // Skip opcodes that have no output, but should stay anyway : + if (PSH_OPCODE_DEFS[Cur->Opcode]._Out == 0) + if (Cur->Opcode != PO_NOP) + continue; + + // See if this opcode writes to any of it's outputs : + { + HasOutput = false; + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) + if (Cur->Output[j].Type != PARAM_DISCARD) + { + HasOutput = true; + break; + } + + if (!HasOutput) + { + // Remove the opcode (as it doesn't change anything) : + // This applies to PO_NOP and opcodes that discard all their results : + DeleteIntermediate(i); + Result = true; + continue; + } + } + } + return Result; +} + +int PSH_XBOX_SHADER::MaxRegisterCount(PSH_ARGUMENT_TYPE aRegType) +{ + switch (aRegType) + { + case PARAM_R: + return MaxTemporaryRegisters; + case PARAM_T: + return MaxTextureCoordinateRegisters; + case PARAM_V: + return MaxInputColorRegisters; + case PARAM_C: + return MaxConstantFloatRegisters; + case PARAM_S: + return MaxSamplerRegisters; + } + + return 0; +} + +bool PSH_XBOX_SHADER::IsValidNativeOutputRegister(PSH_ARGUMENT_TYPE aRegType, int index /*= -1*/) +{ + bool valid = (PARAM_R == aRegType) && (MaxRegisterCount(PARAM_R) > index); + + return valid; +} + +int PSH_XBOX_SHADER::RegisterIsFreeFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress) +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + for (i = aIndex; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + // Detect a read : + if (Cur->ReadsFromRegister(aRegType, aAddress)) + { + return -1; + } + // Detect a write : + if (Cur->WritesToRegister(aRegType, aAddress)) + { + break; + } + } + + return i; +} + +int PSH_XBOX_SHADER::RegisterIsUsedFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress) +{ + int result = -1; + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + for (i = aIndex; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + // Detect a read : + if (Cur->ReadsFromRegister(aRegType, aAddress)) + { + result = i; + } + // Detect a write : + if (Cur->WritesToRegister(aRegType, aAddress)) + { + break; + } + } + + return result; +} + +int PSH_XBOX_SHADER::NextFreeRegisterFromIndexUntil(int aIndex, PSH_ARGUMENT_TYPE aRegType, int bIndex /*= -1*/, int startAddress /*= 0*/, int excludeAddress /*= -1*/) +{ + const int registerCount = MaxRegisterCount(aRegType); + + if (bIndex < 0 || bIndex < aIndex) + bIndex = IntermediateCount; + + if (startAddress < 0) + startAddress = 0; + + int i; + + for (i = startAddress; i < registerCount; i++) + { + if (i == excludeAddress) + continue; + + if (RegisterIsFreeFromIndexUntil(aIndex, aRegType, i) >= bIndex) + { + return i; + } + } + + return -1; +} + +bool PSH_XBOX_SHADER::IsRegisterFreeFromIndexOnwards(int aIndex, PSH_ARGUMENT_TYPE aRegType, int16_t aAddress) +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + for (i = aIndex; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + // Detect a write or read : + if (Cur->WritesToRegister(aRegType, aAddress) + || Cur->ReadsFromRegister(aRegType, aAddress)) + { + return false; + } + } + + return true; +} + +void PSH_XBOX_SHADER::ReplaceInputRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex /*= -1*/) +{ + ReplaceRegisterFromIndexOnwards(aIndex, aSrcRegType, aSrcAddress, aDstRegType, aDstAddress, endIndex, true, false); +} + +void PSH_XBOX_SHADER::ReplaceOutputRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex /*= -1*/) +{ + ReplaceRegisterFromIndexOnwards(aIndex, aSrcRegType, aSrcAddress, aDstRegType, aDstAddress, endIndex, false, true); +} + +void PSH_XBOX_SHADER::ReplaceRegisterFromIndexOnwards(int aIndex, + PSH_ARGUMENT_TYPE aSrcRegType, int16_t aSrcAddress, + PSH_ARGUMENT_TYPE aDstRegType, int16_t aDstAddress, int endIndex /*= -1*/, bool replaceInput /*= true*/, bool replaceOutput /*= true*/) +{ + int i; + int j; + PPSH_INTERMEDIATE_FORMAT Cur; + + for (i = aIndex; i < IntermediateCount && (i <= endIndex || endIndex == -1); i++) + { + Cur = &(Intermediate[i]); + + if (replaceOutput) + { + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) + if (Cur->Output[j].IsRegister(aSrcRegType, aSrcAddress)) + Cur->Output[j].SetRegister(aDstRegType, aDstAddress, Cur->Output[j].Mask); + } + + if (replaceInput) + { + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) + if (Cur->Parameters[j].IsRegister(aSrcRegType, aSrcAddress)) + Cur->Parameters[j].SetRegister(aDstRegType, aDstAddress, Cur->Parameters[j].Mask); + } + } +} + +bool PSH_XBOX_SHADER::FixArgumentModifiers() +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + bool Result = false; + + // Do a bottom-to-top pass, preventing constant-modifiers via additional MOV's: + i = IntermediateCount; + while (i > 0) + { + --i; + Cur = &(Intermediate[i]); + if (Cur->Opcode < PO_TEX) // TODO : Check explicitly which instruction types are handled below + continue; + + int InsertPos = i; + // Detect modifiers on constant and arguments + for (int p = 0; p < 7 && p < PSH_OPCODE_DEFS[Cur->Opcode]._In; p++) { + if ((Cur->Parameters[p].Type == PARAM_C || Cur->Parameters[p].UsesRegister()) + && ((Cur->Parameters[p].Modifiers & ~(1 << ARGMOD_NEGATE)) != 0)) { + + PSH_INTERMEDIATE_FORMAT Ins = {}; + PSH_IMD_ARGUMENT Arg = {}; + + Arg = Cur->Parameters[p]; + + int excludeAddress = Cur->Output[0].Type == PARAM_R ? Cur->Output[0].Address : -1; + + PSH_ARGUMENT_TYPE type = PARAM_R; + int address = NextFreeRegisterFromIndexUntil(InsertPos, PARAM_R, InsertPos, 0, excludeAddress); + + if (IsValidNativeOutputRegister(Arg.Type, Arg.Address) && RegisterIsFreeFromIndexUntil(InsertPos + 1, Arg.Type, Arg.Address) > InsertPos) + { + type = Arg.Type; + address = Arg.Address; + } + + for (int modifier = ARGMOD_INVERT; modifier < ARGMOD_SATURATE; ++modifier) + { + Arg = Cur->Parameters[p]; + + if (!Arg.HasModifier((PSH_ARG_MODIFIER)modifier)) + continue; + + bool needInsert = false; + switch ((PSH_ARG_MODIFIER)modifier) + { + case ARGMOD_INVERT: + { + if (Arg.HasModifier(ARGMOD_NEGATE)) + { + Ins.Initialize(PO_SUB); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[1].SetScaleConstRegister(1.0f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'invert' with 'negate' argument modifier (register - 1)"; + ++modifier; + } + else + { + Ins.Initialize(PO_SUB); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[0].SetScaleConstRegister(1.0f, Recompiled); + Ins.Parameters[1] = Cur->Parameters[p]; + Ins.Parameters[1].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'invert' argument modifier (1 - register)"; + } + needInsert = true; + + break; + } + case ARGMOD_NEGATE: + { + // Skip as this modifier is still supported in current shader models + // Included here for completeness + break; + Ins.Initialize(PO_MOV); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = (1 << ARGMOD_NEGATE); + Ins.CommentString = "Inserted to replace 'negate' argument modifier (-register)"; + needInsert = true; + + break; + } + case ARGMOD_BIAS: + { + Ins.Initialize(PO_SUB); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[1].SetScaleConstRegister(0.5f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'bias' argument modifier (register - 0.5)"; + needInsert = true; + + break; + } + case ARGMOD_SCALE_X2: + { + Ins.Initialize(PO_MUL); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[1].SetScaleConstRegister(2.0f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'x2' argument modifier (2 * register)"; + needInsert = true; + + break; + } + case ARGMOD_SCALE_BX2: + { + Ins.Initialize(PO_MAD); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[2].SetScaleConstRegister(-1.0f, Recompiled); + Ins.Parameters[1].SetScaleConstRegister(2.0f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'bx2' argument modifier (2 * register - 1)"; + needInsert = true; + + break; + } + case ARGMOD_SCALE_X4: + { + Ins.Initialize(PO_MUL); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[1].SetScaleConstRegister(4.0f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'x4' argument modifier (4 * register)"; + needInsert = true; + + break; + } + case ARGMOD_SCALE_D2: + { + Ins.Initialize(PO_MUL); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[1].SetScaleConstRegister(0.5f, Recompiled); + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace 'd2' argument modifier (0.5 * register)"; + needInsert = true; + + break; + } + default: + { + Ins.Initialize(PO_MOV); + // No need to check if output is a constant - those cannot be assigned to anyway + Ins.Output[0].SetRegister(type, address, Arg.Mask); + // Move constant into register + Ins.Parameters[0] = Cur->Parameters[p]; + Ins.Parameters[0].Modifiers = 0; + Ins.CommentString = "Inserted to replace argument with modifier"; + needInsert = true; + + break; + } + } + + if (needInsert == true) + { + for (int q = p; q < PSH_OPCODE_DEFS[Cur->Opcode]._In; q++) + { + // overwrite all matching parameters to avoid duplicate instructions + if (Arg.Type == Cur->Parameters[q].Type + && Arg.Address == Cur->Parameters[q].Address + && Arg.Mask == Cur->Parameters[q].Mask + && Arg.Modifiers == Cur->Parameters[q].Modifiers + && Arg.Multiplier == Cur->Parameters[q].Multiplier) + { + Cur->Parameters[q] = Ins.Output[0]; + // Apply modifier to register instead of constant + Cur->Parameters[q].Modifiers = (Arg.Modifiers & (1 << ARGMOD_NEGATE)) | (Arg.Modifiers & (~0 << (modifier + 1))); + } + } + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + ++Cur; + EmuLog(LOG_LEVEL::DEBUG, "; Used intermediate move to avoid argument modifier"); + Result = true; + } + } + } + } + } + return Result; +} // FixArgumentModifiers + +bool PSH_XBOX_SHADER::FixConstantParameters() +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + bool Result = false; + + // Do a bottom-to-top pass, preventing constant-modifiers via additional MOV's: + i = IntermediateCount; + while (i > StartPos) + { + --i; + Cur = &(Intermediate[i]); + + if (!Cur->IsArithmetic()) + continue; + + for (int p = 0; p < PSH_OPCODE_DEFS[Cur->Opcode]._In; ++p) + { + if (Cur->Parameters[p].Type != PARAM_VALUE) + continue; + + if (Cur->Parameters[p].SetScaleConstRegister(Cur->Parameters[p].GetConstValue(), Recompiled)) + { + EmuLog(LOG_LEVEL::DEBUG, "; Replaced constant value with constant register"); + Result = true; + } + } + } + return Result; +} // FixConstantParameters + +bool PSH_XBOX_SHADER::FixInstructionModifiers() +{ + int i; + int InsertPos; + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT Ins = {}; + + bool Result = false; + + // Do a bottom-to-top pass, preventing constant-modifiers via additional MOV's: + i = IntermediateCount; + while (i > StartPos) + { + InsertPos = i; + --i; + Cur = &(Intermediate[i]); + + if (!Cur->IsArithmetic()) + continue; + + bool insert = true; + switch (Cur->Modifier) + { + case INSMOD_BIAS: // y = x - 0.5 // Xbox only : TODO : Fixup occurrances! + { + Ins.Initialize(PO_SUB); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(0.5f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_bias"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_bias"); + break; + } + case INSMOD_X2: // y = x * 2 + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(2.0f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_x2"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_x2"); + break; + } + case INSMOD_BX2: // y = (x - 0.5) * 2 // Xbox only : TODO : Fixup occurrances! + { + Ins.Initialize(PO_MAD); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(2.0f, Recompiled); + Ins.Parameters[2].SetScaleConstRegister(-1.0f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_bx2"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_bx2"); + break; + } + case INSMOD_X4: // y = x * 4 + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(4.0f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_x4"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_x4"); + break; + } + case INSMOD_D2: // y = x * 0.5 + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(0.5f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_d2"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_d2"); + break; + } + case INSMOD_X8: // y = x * 8 // ps 1.4 only + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(8.0f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_x8"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_x8"); + break; + } + case INSMOD_D4: // y = x * 0.25 // ps 1.4 only + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(0.25f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_d4"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_d4"); + break; + } + case INSMOD_D8: // y = x * 0.125 // ps 1.4 only + { + Ins.Initialize(PO_MUL); + Ins.Output[0] = Ins.Parameters[0] = Cur->Output[0]; + Ins.Parameters[1].SetScaleConstRegister(0.125f, Recompiled); + Ins.CommentString = "; Inserted adjustment by constant register for INST_d8"; + EmuLog(LOG_LEVEL::DEBUG, "; Inserted adjustment by constant register for INST_d8"); + break; + } + case INSMOD_SAT: // Xbox doesn"t support this, but has ARGMOD_SATURATE instead + case INSMOD_NONE: // y = x + default: + insert = false; + break; + } + + if (insert) + { + Cur->Modifier = INSMOD_NONE; + InsertIntermediate(&Ins, InsertPos); + Result = true; + } + } + return Result; +} // FixInstructionModifiers + +bool PSH_XBOX_SHADER::FinalizeShader() +{ + PSH_INTERMEDIATE_FORMAT Ins = {}; + + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_oC, 0, MASK_RGBA); + Ins.Parameters[0].SetRegister(PARAM_R, 0, MASK_RGBA); + InsertIntermediate(&Ins, IntermediateCount); + + return true; +} // FinalizeShader + +//bool PSH_XBOX_SHADER::CombineInstructions() + + bool _CanLerp(PPSH_INTERMEDIATE_FORMAT Mul1, PPSH_INTERMEDIATE_FORMAT Mul2, PPSH_INTERMEDIATE_FORMAT AddOpcode, int Left, int Right) + { + PPSH_IMD_ARGUMENT ParamLeft, ParamRight; + + // Check if Left and Right are the same register : + ParamLeft = &(Mul1->Parameters[Left]); + ParamRight = &(Mul2->Parameters[Right]); + if ((ParamLeft->Type != ParamRight->Type) + || (ParamLeft->Address != ParamRight->Address) + || (ParamLeft->Mask != ParamRight->Mask)) + return false; + + // Is the left argument inverted and the right not (or the other way around) ? + if (ParamLeft->HasModifier(ARGMOD_INVERT) != ParamRight->HasModifier(ARGMOD_INVERT)) + { + // In that case, already move the arguments over to AddOpcode so we create a LRP : + AddOpcode->Parameters[0] = *ParamLeft; + AddOpcode->Parameters[1] = Mul1->Parameters[1-Left]; + AddOpcode->Parameters[2] = Mul2->Parameters[3-Right]; + return true; + } + return false; + } + + bool _CanMad(int ConstOne, PPSH_INTERMEDIATE_FORMAT Mul1, PPSH_INTERMEDIATE_FORMAT Mul2, PPSH_INTERMEDIATE_FORMAT AddOpcode) + { + // Check if the given parameter is 1 : + bool Result = Mul1->Parameters[ConstOne].GetConstValue() == 1.0; + if (Result) + { + // Put the other 3 parameters int the resulting opcode, so we can make it a MAD : + AddOpcode->Parameters[0] = Mul2->Parameters[0]; + AddOpcode->Parameters[1] = Mul2->Parameters[1]; + AddOpcode->Parameters[2] = Mul1->Parameters[1-ConstOne]; + } + return Result; + } + +bool PSH_XBOX_SHADER::CombineInstructions() +{ + int i; + PPSH_INTERMEDIATE_FORMAT Op0; + PPSH_INTERMEDIATE_FORMAT Op1; + PPSH_INTERMEDIATE_FORMAT Op2; + bool CanOptimize; + int j; + int k; + + bool Result = false; + + i = IntermediateCount - 1; + while (i > StartPos) + { + --i; + Op0 = &(Intermediate[i+0]); + Op1 = &(Intermediate[i+1]); + Op2 = &(Intermediate[i+2]); + + // Check if there are two consecutive opcodes reading from a fake R register; + // We outputted these ourselves, in order to ease the conversion and profit + // from having generic optimizations in one place : + if ( (Op0->Output[0].Type == PARAM_T) + && (Op0->Output[0].Address >= PSH_XBOX_MAX_T_REGISTER_COUNT) + && (Op1->Output[0].Type == PARAM_T) + && (Op1->Output[0].Address >= PSH_XBOX_MAX_T_REGISTER_COUNT)) + { + // Did we output those from a CND opcode (originally XMMC) ? + if (Op2->Opcode == PO_CND) + { + if ( (Op0->Opcode == PO_MOV) + && (Op1->Opcode == PO_MOV) + && (Op1->Modifier == Op0->Modifier)) + { + Op2->Modifier = Op0->Modifier; + Op2->Parameters[1] = Op0->Parameters[0]; + Op2->Parameters[2] = Op1->Parameters[0]; + DeleteIntermediate(i); + DeleteIntermediate(i); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MUL,CND via MOV,MOV,CND into a single CND"); + Result = true; + continue; + } + } + + // Did we output those from a ADD opcode (originally XMMA) ? + if (Op2->Opcode == PO_ADD) + { + if ( (Op0->Opcode == PO_MUL) + && (Op1->Opcode == PO_MUL) + && (Op1->Modifier == Op0->Modifier)) + { + // Check if we can lerp - we just need the same register on both sides that's inverted on the other : + if (_CanLerp(Op0, Op1, Op2, 0, 2) + || _CanLerp(Op0, Op1, Op2, 1, 2) + || _CanLerp(Op0, Op1, Op2, 0, 3) + || _CanLerp(Op0, Op1, Op2, 1, 3)) + { + // The lerp can be done, and the correct parameters are already set to Op2, + // so all we need to do now, it fixup the rest and remove the two MOV's : + Op2->Opcode = PO_LRP; + Op2->Modifier = Op0->Modifier; + DeleteIntermediate(i); + DeleteIntermediate(i); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MUL,ADD into a single LRP"); + Result = true; + continue; + } + + // Check if we can mad - we just need a constant 1 in one argument : + if (_CanMad(0, Op0, Op1, Op2) + || _CanMad(1, Op0, Op1, Op2) + || _CanMad(0, Op1, Op0, Op2) + || _CanMad(1, Op1, Op0, Op2)) + { + // The mad can be done, and the correct parameters are already set to Op2, + // so all we need to do now, it fixup the rest and remove the two MOV's : + Op2->Opcode = PO_MAD; + Op2->Modifier = Op0->Modifier; + DeleteIntermediate(i); + DeleteIntermediate(i); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MUL,ADD into a single MAD"); + Result = true; + continue; + } + + // No single opcode possible, so change it into a MUL + MAD : + // The first mul may write to the last output register (without a modifier) : + Op0->Modifier = INSMOD_NONE; + Op0->Output[0] = Op2->Output[0]; + // Change the second MUL into a MAD : + Op1->Opcode = PO_MAD; + Op1->Output[0] = Op2->Output[0]; + Op1->Parameters[2] = Op0->Output[0]; + // Remove the trailing ADD : + DeleteIntermediate(i+2); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MUL,ADD into a MUL,MAD"); + Result = true; + continue; + } + + // Was it a MUL,MUL,ADD? + if ( (Op0->Opcode == PO_MUL) + && (Op1->Opcode == PO_MUL) + && (Op0->Parameters[1].GetConstValue() == 1.0) + && (Op1->Parameters[1].GetConstValue() == 1.0)) + { + // Remove the two MOV's and fold their arguments into a MUL : + Op2->Opcode = PO_MUL; + Op2->Parameters[0] = Op0->Parameters[0]; + Op2->Parameters[1] = Op1->Parameters[0]; + DeleteIntermediate(i); + DeleteIntermediate(i); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MUL,ADD into a MUL"); + Result = true; + continue; + } + } + } + + // Do two neighbouring opcodes output to the same register (without a modifier) ? + if ( (Op0->Output[0].ToString() == Op1->Output[0].ToString()) + && (Op0->Modifier == INSMOD_NONE) + && (Op1->Modifier == INSMOD_NONE)) + { + // Is it MUL,ADD ? + if ( (Op0->Opcode == PO_MUL) + && (Op1->Opcode == PO_ADD)) + { + // Is the output of the MUL input to the ADD ? + if ( (Op0->Output[0].Type == Op1->Parameters[0].Type) + && (Op0->Output[0].Address == Op1->Parameters[0].Address) + && (Op0->Output[0].Modifiers == Op1->Parameters[0].Modifiers)) + // Mask and Multiplier are not important here + { + Op0->Opcode = PO_MAD; + Op0->Parameters[2] = Op1->Parameters[1]; + DeleteIntermediate(i+1); + EmuLog(LOG_LEVEL::DEBUG, "; Changed MUL,ADD into a single MAD"); + Result = true; + continue; + } + } + } + +/* + // Combinations that can be made if their intermediate result is not read again or overwritten later: + + MOV+ADD > ADD (if MOV.Output[0] was only read by ADD.Parameter[0] or ADD.Parameter[1]) + MOV+SUB > SUB (if MOV.Output[0] was only read by SUB.Parameter[0] or SUB.Parameter[1]) + MOV+MUL > MUL (if MOV.Output[0] was only read by MOV.Parameter[0] or MOV.Parameter[1]) + + MUL+MOV > MUL (if MUL.Output[0] was only read by MOV.Parameter[0]) + MUL+ADD > MAD (if MUL.Output[0] was only read by ADD.Parameter[0] or ADD.Parameter[1]) + MUL+SUB > MAD (if MUL.Output[0] was only read by SUB.Parameter[0] - Do invert MAD.Parameter[2]) +*/ + + // We can remove a MOV entirely if the input is not changed while + // the output is read, up until the output is re-written; We can change all + // these occurances into a read from the input of this MOV instead : + // This fixes some shaders in Turok, that are reduced to 8 instead of 9 opcodes. + if ( (Op0->Opcode == PO_MOV) + && (Op0->Modifier == INSMOD_NONE) + && (Op0->Output[0].Mask == MASK_RGBA)) + { + CanOptimize = false; + j = i + 1; + while (j < IntermediateCount) + { + // Don't optimize if the output is needed for CND or CMP (which must read from r0) : + // This fixes : "(Validation Error) First source for cnd instruction must be 'r0.a'" in Modify Pixel Shader XDK sample. + if ( ((Intermediate[j].Opcode == PO_CND) || (Intermediate[j].Opcode == PO_CMP)) + && (Op0->Output[0].IsRegister(PARAM_R, 0))) + break; + + // TODO : Add other prevention rules here (like too many texture-reads, and other scases) + + // We can optimize if the MOV-output is written to again before the end of the shader : + CanOptimize = true; + + // ensure this is not "constant with modifier" optimization pattern to prevent infinite loop + for (int p = 0; p < PSH_OPCODE_DEFS[Intermediate[j].Opcode]._In; p++) + { + if ((Op0->Parameters[0].Type == PARAM_C) + && (Intermediate[j].Parameters[p].Type == Op0->Output[0].Type) + && (Intermediate[j].Parameters[p].Address == Op0->Output[0].Address) + && (Intermediate[j].Parameters[p].Modifiers != 0)) + { + CanOptimize = false; + break; + } + }; + + if (Intermediate[j].WritesToRegister(Op0->Output[0].Type, Op0->Output[0].Address, MASK_RGBA)) + break; + + CanOptimize = false; + ++j; + } + + if (CanOptimize) + { + // Loop over all instructions in between, and try to replace reads : + CanOptimize = false; + while (j > i) + { + // For Intermediate[j].Parameters, change all occurrances of Op0.Output[0] into Op0.Parameters[0] : + for (k = 0; k < PSH_OPCODE_DEFS[Intermediate[j].Opcode]._In; k++) + if ( (Intermediate[j].Parameters[k].Type == Op0->Output[0].Type) + && (Intermediate[j].Parameters[k].Address == Op0->Output[0].Address)) + { + Intermediate[j].Parameters[k].Type = Op0->Parameters[0].Type; + Intermediate[j].Parameters[k].Address = Op0->Parameters[0].Address; + // Signal that a replacement is actually done : + CanOptimize = true; + } + + --j; + } + + if (CanOptimize) + { + DeleteIntermediate(i); + EmuLog(LOG_LEVEL::DEBUG, "; Moved MOV input into following instructions"); + Result = true; + } + } + } + + // Fix Dolphin : + // mul r3, r0,t0 ; d0=s0*s1 + // mov r0.rgb, r3 ; d0=s0 final combiner - FOG not emulated, using 1. + if ( (Op0->Output[0].Type == PARAM_T) + && (Op0->Output[0].Address >= PSH_XBOX_MAX_T_REGISTER_COUNT) + && (Op1->Parameters[0].Type == PARAM_T) + && (Op1->Parameters[0].Address >= PSH_XBOX_MAX_T_REGISTER_COUNT)) + { + if ( (Op0->Opcode == PO_MUL) + && (Op1->Opcode == PO_MOV)) + { + // > mul r0.rgb, r0,t0 + Op0->Output[0] = Op1->Output[0]; + DeleteIntermediate(i+1); + EmuLog(LOG_LEVEL::DEBUG, "; Changed temporary MUL,MOV into a MUL"); + Result = true; + continue; + } + } + + // Fix Crash bandicoot xfc leftover r3 : + if (Op0->Output[0].IsRegister(PARAM_T, FakeRegNr_Prod)) // 'r3' + { + // The final combiner uses r3, try to use r1 instead : + if (IsRegisterFreeFromIndexOnwards(i, PARAM_R, 1)) + { + ReplaceRegisterFromIndexOnwards(i, Op0->Output[0].Type, Op0->Output[0].Address, PARAM_R, 1); + EmuLog(LOG_LEVEL::DEBUG, "; Changed fake register by r1"); + Result = true; + continue; + } + } + } // while + return Result; +} // CombineInstructions + +bool PSH_XBOX_SHADER::SimplifyMOV(PPSH_INTERMEDIATE_FORMAT Cur) +{ + bool CanSimplify; + float Factor; + + // NOP-out MOV's that read and write to the same register : + if ( (Cur->Output[0].Type == Cur->Parameters[0].Type) + && (Cur->Output[0].Address == Cur->Parameters[0].Address) + && (Cur->Output[0].Mask == Cur->Parameters[0].Mask)) + { + if (Cur->Output[0].Type == PARAM_VALUE) + CanSimplify = Cur->Output[0].GetConstValue() == Cur->Parameters[0].GetConstValue(); + else + CanSimplify = (Cur->Output[0].Modifiers == Cur->Parameters[0].Modifiers) + && (Cur->Output[0].Multiplier == Cur->Parameters[0].Multiplier); + + if (CanSimplify) + { + Cur->Opcode = PO_NOP; // This nop will be removed in a recursive fixup + EmuLog(LOG_LEVEL::DEBUG, "; Changed MOV into a NOP"); + return true; + } + } + + // Does this MOV put a 0 (zero) in the output? + if (Cur->Parameters[0].GetConstValue() == 0.0) + { + // Attempt to find a constant with the value 0, and use that if present. + if (!Cur->Parameters[0].SetScaleConstRegister(0.0f, Recompiled)) + { + // Simulate 0 by subtracting a (guaranteed) register from itself : + // Fixup via "sub d0=v0,v0" : + Cur->Opcode = PO_SUB; + Cur->Parameters[0].Type = PARAM_V; + Cur->Parameters[0].Address = 0; + Cur->Parameters[0].Modifiers = 0; + Cur->Parameters[1] = Cur->Parameters[0]; + EmuLog(LOG_LEVEL::DEBUG, "; Changed MOV 0 into a SUB v0,v0"); + } + else + { + EmuLog(LOG_LEVEL::DEBUG, "; Changed MOV 0 into a MOV c0"); + } + + return true; + } + + // Does this MOV put a constant in the output? + if (Cur->Parameters[0].Type == PARAM_VALUE) + { + // TODO : If there's a constant equal to GetConstValue(), use that. + Factor = Cur->Parameters[0].GetConstValue(); + + if (!Cur->Parameters[0].SetScaleConstRegister(Factor, Recompiled)) + { + // Fixup via a SUB (which can calculate a constant value) : + Cur->Opcode = PO_SUB; + Cur->Parameters[0].Type = PARAM_V; + Cur->Parameters[0].Address = 0; + + if (Factor < 0.0) + { + // Simulate -1 by calculating it via a (guaranteed) register : + // We follow this : (-v0) - (1-v0) = -v0 - 1 + v0 = -1 + Cur->Parameters[0].Modifiers = (1 << ARGMOD_NEGATE); + Cur->Parameters[1] = Cur->Parameters[0]; + Cur->Parameters[1].Modifiers = (1 << ARGMOD_INVERT); + // Go on with a positive factor, to ease the scaling : + Factor = -Factor; + } + else + { + // Simulate 1 by calculating it via a (guaranteed) register : + // We follow this : (1-v0) - (-v0) = (1-v0) + v0 = 1 + Cur->Parameters[0].Modifiers = (1 << ARGMOD_INVERT); + Cur->Parameters[1] = Cur->Parameters[0]; + Cur->Parameters[1].Modifiers = (1 << ARGMOD_NEGATE); + } + + // Try to simulate all factors (0.5, 1.0 and 2.0) using an output modifier : + Cur->ScaleOutput(Factor); + + EmuLog(LOG_LEVEL::DEBUG, "; Changed MOV {const} into a SUB_factor 1-v0,-v0"); + } + else + { + EmuLog(LOG_LEVEL::DEBUG, "; Changed MOV {const} into a MOV c#"); + } + return true; + } + return false; +} + +bool PSH_XBOX_SHADER::SimplifyADD(PPSH_INTERMEDIATE_FORMAT Cur) +{ + // Is this an addition of s0+0 ? + if (Cur->Parameters[1].GetConstValue() == 0.0) + { + // Change it into a MOV (the first argument is already in-place) + Cur->Opcode = PO_MOV; + EmuLog(LOG_LEVEL::DEBUG, "; Changed ADD s0,0 into a MOV s0"); + return true; + } + return false; +} + +bool PSH_XBOX_SHADER::SimplifyMAD(PPSH_INTERMEDIATE_FORMAT Cur, int index) +{ + // Is this 0*s1+s2 or s0*0+s2 ? + if (Cur->Parameters[0].GetConstValue() == 0.0 + || Cur->Parameters[1].GetConstValue() == 0.0) + { + // Change it into s2 : + Cur->Opcode = PO_MOV; + Cur->Parameters[0] = Cur->Parameters[2]; + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0,0 into a MOV s0"); + return true; + } + + // Is this s0*s1+0 ? + if (Cur->Parameters[2].GetConstValue() == 0.0) + { + // Change it into s0*s1 : + Cur->Opcode = PO_MUL; + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0, s1,0 into a MUL s0, s1"); + return true; + } + + // Is this s0*1+s2 ? + if (Cur->Parameters[1].GetConstValue() == 1.0) + { + // Change it into s0+s2 : + Cur->Opcode = PO_ADD; + Cur->Parameters[1] = Cur->Parameters[2]; + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0,1,s2 into a ADD s0,s2"); + return true; + } + + // Is this s0*-1+s2 ? + if (Cur->Parameters[1].GetConstValue() == -1.0) + { + // Change it into s2-s0 : + Cur->Opcode = PO_SUB; + Cur->Parameters[1] = Cur->Parameters[0]; + Cur->Parameters[0] = Cur->Parameters[2]; + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0,-1,s2 into a SUB s2,s0"); + return true; + } + + PSH_INTERMEDIATE_FORMAT Ins = {}; + + // Is this 0.5*s1+s2 ? + if (Cur->Parameters[0].GetConstValue() == 0.5f && Cur->Parameters[1].UsesRegister()) + { + if (!Cur->Parameters[0].SetScaleConstRegister(0.5f, Recompiled)) + { + // Change it into s2 : + Cur->Opcode = PO_ADD; + Cur->Parameters[0] = Cur->Parameters[1]; + Cur->Parameters[1] = Cur->Parameters[2]; + + Ins.Initialize(PO_MOV); + Ins.Modifier = INSMOD_D2; + Ins.Output[0] = Ins.Parameters[0] = Cur->Parameters[1]; + Ins.CommentString = "; Inserted to perform division by 2"; + InsertIntermediate(&Ins, index); + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD 0.5,s1,s2 into a MOV_d2 s1, s1 ADD s1, s2"); + } + else + { + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD 0.5,s1,s2 into a MAD c#,s1,s2"); + } + return true; + } + + // Is this s0*0.5+s2 ? + if (Cur->Parameters[1].GetConstValue() == 0.5f && Cur->Parameters[0].UsesRegister()) + { + if (!Cur->Parameters[1].SetScaleConstRegister(0.5f, Recompiled)) + { + // Change it into s2 : + Cur->Opcode = PO_ADD; + Cur->Parameters[0] = Cur->Parameters[0]; + Cur->Parameters[1] = Cur->Parameters[2]; + + Ins.Initialize(PO_MOV); + Ins.Modifier = INSMOD_D2; + Ins.Output[0] = Ins.Parameters[0] = Cur->Parameters[0]; + Ins.CommentString = "; Inserted to perform division by 2"; + InsertIntermediate(&Ins, index); + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0,0.5,s2 into a MOV_d2 s0, s0 ADD s0, s2"); + } + else + { + EmuLog(LOG_LEVEL::DEBUG, "; Changed MAD s0,0.5,s2 into a MAD s0,c#,s2"); + } + return true; + } + return false; +} + +bool PSH_XBOX_SHADER::SimplifySUB(PPSH_INTERMEDIATE_FORMAT Cur) +{ + // Is this an subtraction of s0-0 ? + if (Cur->Parameters[1].GetConstValue() == 0.0) + { + // Change it into a MOV (the first argument is already in-place) + Cur->Opcode = PO_MOV; + EmuLog(LOG_LEVEL::DEBUG, "; Changed SUB x, 0 into a MOV x"); + return true; + } + return false; +} + +bool PSH_XBOX_SHADER::SimplifyMUL(PPSH_INTERMEDIATE_FORMAT Cur) +{ + // Is the result of this multiplication zero ? + if (Cur->Parameters[1].GetConstValue() == 0.0) + { + // Change it into a MOV (the 0 argument will be resolve in a recursive MOV fixup) : + Cur->Opcode = PO_MOV; + Cur->Parameters[0].SetConstValue(0.0); + EmuLog(LOG_LEVEL::DEBUG, "; Changed MUL s0,0 into a MOV 0"); + return true; + } + + // Is this a multiply-by-const ? + if (Cur->Parameters[1].Type == PARAM_VALUE) + { + // Change it into a simple MOV and scale the output instead : + Cur->Opcode = PO_MOV; + Cur->ScaleOutput(Cur->Parameters[1].GetConstValue()); + EmuLog(LOG_LEVEL::DEBUG, "; Changed MUL s0,{const} into a MOV_factor s0"); + return true; + } + return false; +} // SimplifyMUL + +bool PSH_XBOX_SHADER::SimplifyLRP(PPSH_INTERMEDIATE_FORMAT Cur, int index) +{ + // LRP calculates : d0=s0*s1+(1-s0)*s2 which can also be read as : d0=s0*(s1-s2)+s2 + + // Is the right part ((1-s0)*s2) zero? + if ((Cur->Parameters[0].GetConstValue() == 1.0) || (Cur->Parameters[2].GetConstValue() == 0.0)) + { + // Change it into a MUL (calculating the left part : s0*s1 : + Cur->Opcode = PO_MUL; + EmuLog(LOG_LEVEL::DEBUG, "; Changed LRP s0,s1,s2 (where (1-s0)*s2=0) into a MUL s0,s1"); + return true; + } + + // Is the left part (s0*s1) zero? + if ((Cur->Parameters[0].GetConstValue() == 0.0) || (Cur->Parameters[1].GetConstValue() == 0.0)) + { + // Change it into a MUL (calculating the right part : (1-s0)*s2) : + Cur->Opcode = PO_MUL; + Cur->Parameters[0].Invert(); + Cur->Parameters[1] = Cur->Parameters[2]; + EmuLog(LOG_LEVEL::DEBUG, "; Changed LRP s0,s1,s2 (where s0*s1=0) into a MUL (1-s0),s2"); + return true; + } + + // Is it d0=s0*s1+(1-s0)*1 ? + if (Cur->Parameters[2].GetConstValue() == 1.0) + { + // Change it into a d0=s0*s1+(1-s0) + Cur->Opcode = PO_MAD; + Cur->Parameters[2] = Cur->Parameters[0]; + Cur->Parameters[2].Invert(); + EmuLog(LOG_LEVEL::DEBUG, "; Changed LRP s0,s1,1 into a MAD s0,s1,1-s0"); + return true; + } + + // Is it d0=s0*(1-s2)+s2 ? + if (Cur->Parameters[1].GetConstValue() == 1.0) + { + // Change it into a d0=s0*(1-s2)+s2 + Cur->Opcode = PO_MAD; + Cur->Parameters[1] = Cur->Parameters[2]; + Cur->Parameters[1].Invert(); + EmuLog(LOG_LEVEL::DEBUG, "; Changed LRP s0,1,s2 into a MAD s0,1-s2,s2"); + return true; + } + + int output = NextFreeRegisterFromIndexUntil(index, PARAM_R, index, 0, Cur->Output[0].Address); + + if (output >= 0) + { + bool insert = false; + for (int p = 0; p < PSH_OPCODE_DEFS[Cur->Opcode]._In; ++p) + { + if (Cur->Output[0].Type == Cur->Parameters[p].Type + && Cur->Output[0].Address == Cur->Parameters[p].Address) + { + insert = true; + Cur->Parameters[p].Address = output; + } + } + if (insert) + { + PSH_INTERMEDIATE_FORMAT Ins = {}; + + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(PARAM_R, output, 0); + Ins.Parameters[0].SetRegister(Cur->Output[0].Type, Cur->Output[0].Address, 0); + Ins.CommentString = "; Inserted to avoid LRP parameters referencing the output register"; + InsertIntermediate(&Ins, index); + EmuLog(LOG_LEVEL::DEBUG, "; Changed LRP s0,1,s2 into a MAD s0,1-s2,s2"); + return true; + } + } + + return false; +} // SimplifyLRP + +bool PSH_XBOX_SHADER::FixupCND(PPSH_INTERMEDIATE_FORMAT Cur, int index) +{ + PSH_INTERMEDIATE_FORMAT Ins = {}; + + // TODO: Look into using predicate register + Cur->Opcode = PO_CMP; + + int output = NextFreeRegisterFromIndexUntil(index, PARAM_R, index); + Ins.Initialize(PO_SUB); + Ins.Output[0].SetRegister(PARAM_R, output, Cur->Parameters[0].Mask); + Ins.Parameters[0] = Cur->Parameters[0]; + Ins.Parameters[1].SetScaleConstRegister(0.5f, Recompiled); + Cur->Parameters[0] = Ins.Output[0]; + Cur->Parameters[0].Modifiers = (1 << ARGMOD_NEGATE); + std::swap(Cur->Parameters[1], Cur->Parameters[2]); + Ins.CommentString = Cur->CommentString = "; Changed CND into SUB CMP"; + InsertIntermediate(&Ins, index); + EmuLog(LOG_LEVEL::DEBUG, "; Changed CND into SUB CMP"); + return true; +} + +bool PSH_XBOX_SHADER::FixupPixelShader() +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + + bool Result = RemoveNops(); + + // TODO : Fixup writes to read-only registers (V0, V1) via another free register (if possible) + // TODO : Fixup the usage of non-existent register numbers (like FakeRegNr_Sum and FakeRegNr_Prod) + // TODO : Fixup the usage of the unsupported INSMOD_BIAS and INSMOD_BX2 instruction modifiers + // TODO : Use the INSMOD_SAT instruction modifier instead of the ARGMOD_SATURATE argument modifier + // TODO : Condense constants registers, to avoid the non-existant C8-C15 (requires a mapping in SetPixelShaderConstant too...) + // TODO : Convert numeric arguments (-2, -1, 0, 1, 2) into modifiers on the other argument + // TODO : Complete to port to D3D9 to support all 18 constants (including C8..C15 + FC0+FC1) + + if (CombineInstructions()) + Result = true; + + if (MoveRemovableParametersRight()) + Result = true; + + // Simplify instructions, which can help to compress the result : + i = IntermediateCount; + while (i > StartPos) + { + --i; + Cur = &(Intermediate[i]); + + switch (Cur->Opcode) { + case PO_MOV: + if (SimplifyMOV(Cur)) + Result = true; + break; + + case PO_ADD: + if (SimplifyADD(Cur)) + Result = true; + break; + + case PO_MAD: + if (SimplifyMAD(Cur, i)) + Result = true; + break; + + case PO_SUB: + if (SimplifySUB(Cur)) + Result = true; + break; + + case PO_MUL: + if (SimplifyMUL(Cur)) + Result = true; + break; + + case PO_LRP: + if (SimplifyLRP(Cur, i)) + Result = true; + break; + + case PO_CND: + if (FixupCND(Cur, i)) + Result = true; + break; + } // case + } // for + + // If the above code made any alteration, repeat it as some changes require a followup (like MUL>MOV>NOP) : + if (Result) + { + Log("Fixup intermediate result"); + FixupPixelShader(); + } + return Result; +} // FixupPixelShader + +bool PSH_XBOX_SHADER::FixInvalidSrcSwizzle() +{ + int i, j; + PPSH_INTERMEDIATE_FORMAT Cur; + PPSH_IMD_ARGUMENT CurArg; + + bool Result = false; + for (i = StartPos; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + if (Cur->IsArithmetic()) + { + // Loop over the input arguments : + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._In; j++) + { + CurArg = &(Cur->Parameters[j]); + + // Fix "Invalid src swizzle" : + if (CurArg->Mask == MASK_RGB) + { + CurArg->Mask = MASK_RGBA; + Result = true; + } + } + } + } + return Result; +} + +bool PSH_XBOX_SHADER::FixMissingR0a() +// On the Xbox, the alpha portion of the R0 register is initialized to +// the alpha component of texture 0 if texturing is enabled for texture 0 : +{ + int R0aDefaultInsertPos; + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT NewIns = {}; + + // Detect a read of r0.a without a write, as we need to insert a "MOV r0.a, t0.a" as default (like the xbox has) : + R0aDefaultInsertPos = -1; + for (i = 0; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + if (Cur->Opcode < PO_TEX) // TODO : Check explicitly which instruction types are handled below + continue; + + // Make sure if we insert at all, it'll be after the DEF's : + if (R0aDefaultInsertPos < 0) + R0aDefaultInsertPos = i; + + // First, check if r0.a is read by this opcode : + if (Cur->ReadsFromRegister(PARAM_R, 0, MASK_A)) + { + R0aDefaultInsertPos = i; + break; + } + + // If this opcode writes to r0.a, we're done : + if (Cur->WritesToRegister(PARAM_R, 0, MASK_A)) + return false; + } + + if (R0aDefaultInsertPos >= 0) + { + // Insert a new opcode : MOV r0.a, t0.a + NewIns.Initialize(PO_MOV); + NewIns.Output[0].SetRegister(PARAM_R, 0, MASK_A); + NewIns.Parameters[0] = NewIns.Output[0]; + NewIns.Parameters[0].Type = PARAM_T; + NewIns.CommentString = "Inserted r0.a default"; + InsertIntermediate(&NewIns, R0aDefaultInsertPos); + return true; + } + return false; +} // FixMissingR0a + +bool PSH_XBOX_SHADER::FixMissingR1a() +// On the Xbox, the alpha portion of the R1 register is initialized to +// the alpha component of texture 1 if texturing is enabled for texture 1 : +{ + int R1aDefaultInsertPos; + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT NewIns = {}; + + // Detect a read of r1.a without a write, as we need to insert a "MOV r1.a, t1.a" as default (like the xbox has) : + R1aDefaultInsertPos = -1; + for (i = 0; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + if (Cur->Opcode < PO_TEX) // TODO : Check explicitly which instruction types are handled below + continue; + + // First, check if r1.a is read by this opcode : + if (Cur->ReadsFromRegister(PARAM_R, 1, MASK_A)) + { + // Make sure if we insert at all, it'll be after the DEF's : + if (R1aDefaultInsertPos < 0) + R1aDefaultInsertPos = i; + + R1aDefaultInsertPos = i; + break; + } + + // If this opcode writes to r1.a, we're done : + if (Cur->WritesToRegister(PARAM_R, 1, MASK_A)) + return false; + } + + if (R1aDefaultInsertPos >= 0) + { + // Insert a new opcode : MOV r1.a, t1.a + NewIns.Initialize(PO_MOV); + NewIns.Output[0].SetRegister(PARAM_R, 1, MASK_A); + NewIns.Parameters[0] = NewIns.Output[0]; + NewIns.Parameters[0].Type = PARAM_T; + NewIns.CommentString = "Inserted r1.a default"; + InsertIntermediate(&NewIns, R1aDefaultInsertPos); + return true; + } + + return false; +} // FixMissingR1a + +bool PSH_XBOX_SHADER::FixUninitializedReads() +// On the Xbox, the alpha portion of the R1 register is initialized to +// the alpha component of texture 1 if texturing is enabled for texture 1 : +{ + int R1aDefaultInsertPos; + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + PSH_INTERMEDIATE_FORMAT NewIns = {}; + bool Result = false; + + int readPositions[32][4] = {}; + int writePositions[32][4] = {}; + int initPositions[32] = {}; + int initMasks[32] = {}; + + // Detect a read of r1.a without a write, as we need to insert a "MOV r1.a, t1.a" as default (like the xbox has) : + R1aDefaultInsertPos = -1; + for (i = 0; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + + for (int j = 0; j < MaxRegisterCount(PARAM_R); ++j) + { + // check reads + if (readPositions[j][0] == 0 && Cur->ReadsFromRegister(PARAM_R, j, MASK_R)) + { + readPositions[j][0] = i; + } + if (readPositions[j][1] == 0 && Cur->ReadsFromRegister(PARAM_R, j, MASK_G)) + { + readPositions[j][1] = i; + } + if (readPositions[j][2] == 0 && Cur->ReadsFromRegister(PARAM_R, j, MASK_B)) + { + readPositions[j][2] = i; + } + if (readPositions[j][3] == 0 && Cur->ReadsFromRegister(PARAM_R, j, MASK_A)) + { + readPositions[j][3] = i; + } + + // check writes + if (writePositions[j][0] == 0 && Cur->WritesToRegister(PARAM_R, j, MASK_R)) + { + writePositions[j][0] = i; + } + if (writePositions[j][1] == 0 && Cur->WritesToRegister(PARAM_R, j, MASK_G)) + { + writePositions[j][1] = i; + } + if (writePositions[j][2] == 0 && Cur->WritesToRegister(PARAM_R, j, MASK_B)) + { + writePositions[j][2] = i; + } + if (writePositions[j][3] == 0 && Cur->WritesToRegister(PARAM_R, j, MASK_A)) + { + writePositions[j][3] = i; + } + } + } + + for (int j = 0; j < MaxRegisterCount(PARAM_R); ++j) + { + int mask = 0; + int pos = IntermediateCount; + for (int i = 0; i < 4; ++i) + { + if (readPositions[j][i] <= writePositions[j][i] && readPositions[j][i] != 0) + { + mask |= (1 << i); + pos = std::min(pos, readPositions[j][i]); + } + } + + initPositions[j] = pos; + initMasks[j] = mask; + } + + NewIns.Initialize(PO_MOV); + NewIns.CommentString = "; Inserted to initialize register"; + for (int j = 0; j < MaxRegisterCount(PARAM_R); ++j) + { + int mask = initMasks[j]; + if (mask) + { + // Insert a new opcode : MOV r#.???, c0.??? + NewIns.Output[0].SetRegister(PARAM_R, j, mask); + NewIns.Parameters[0].SetScaleConstRegister(0.0f, Recompiled); + // r0 and r1 take their alpha from the respective texture coordinate + if (j < PSH_XBOX_MAX_R_REGISTER_COUNT) + { + mask &= MASK_RGB; + } + + InsertIntermediate(&NewIns, std::min(StartPos, initPositions[j])); + Result = true; + } + } + + return Result; +} // FixUninitializedReads + + +bool PSH_XBOX_SHADER::FixCoIssuedOpcodes() +{ + int i; + PPSH_INTERMEDIATE_FORMAT Cur; + bool Result = false; + // Since we're targetting m_PSVersion >= D3DPS_VERSION(2, 0), co-issued instructions are no longer supported, thus reset all IsCombined flags : + for (i = StartPos; i < IntermediateCount; i++) + { + Cur = &(Intermediate[i]); + if (Cur->IsArithmetic()) + { + if (Cur->IsCombined) + { + Cur->IsCombined = false; + Result = true; + } + } + } + return Result; +} + +bool PSH_XBOX_SHADER::FixInvalidDstRegister() +{ + int i, j; + PPSH_INTERMEDIATE_FORMAT Cur; + PPSH_IMD_ARGUMENT CurArg; + + bool Result = false; + for (i = IntermediateCount - 1; i >= StartPos; --i) + { + Cur = &(Intermediate[i]); + // Skip non-arithmetic opcodes + if (!Cur->IsArithmetic()) + continue; + + // Loop over the output arguments : + for (j = 0; j < PSH_OPCODE_DEFS[Cur->Opcode]._Out; j++) + { + CurArg = &(Cur->Output[j]); + + if (IsValidNativeOutputRegister(CurArg->Type, CurArg->Address)) + continue; + + int lastUsed = RegisterIsUsedFromIndexUntil(i + 1, CurArg->Type, CurArg->Address); + + PSH_ARGUMENT_TYPE dstType = PARAM_R; + int dstIndex = -1; + + if (IsValidNativeOutputRegister(PARAM_T)) + { + dstType = PARAM_T; + dstIndex = NextFreeRegisterFromIndexUntil(i + 1, PARAM_T, lastUsed); + } + + if (dstIndex == -1) + { + dstType = PARAM_R; + dstIndex = NextFreeRegisterFromIndexUntil(i + 1, PARAM_R, lastUsed); + } + + if (dstIndex != -1) + { + Result = true; + + if (Cur->ReadsFromRegister(CurArg->Type, CurArg->Address)) + { + if (lastUsed >= 0) ++lastUsed; + + PSH_INTERMEDIATE_FORMAT Ins = {}; + + Ins.Initialize(PO_MOV); + Ins.Output[0].SetRegister(dstType, dstIndex, 0); + Ins.Parameters[0].SetRegister(CurArg->Type, CurArg->Address, 0); + InsertIntermediate(&Ins, i); + ++Cur; + CurArg = &(Cur->Output[j]); + } + + ReplaceInputRegisterFromIndexOnwards(i + 1, CurArg->Type, CurArg->Address, dstType, dstIndex, lastUsed); + + CurArg->Type = dstType; + CurArg->Address = dstIndex; + } + } + } + return Result; +} + +// TODO: Refactor and optimize +bool PSH_XBOX_SHADER::FixOverusedRegisters() +{ + int i; + + bool Result = false; + + PSH_INTERMEDIATE_FORMAT Ins = {}; + Ins.Initialize(PO_MOV); + + // For all opcodes, try to put constant and discarded arguments in the rightmost slot, to ease following analysis : + i = IntermediateCount; + while (i > StartPos) + { + --i; + + int InsertPos = i; + + // Skip this operation on LRP instructions + // This prevents "error X5765: Dest register for LRP cannot be the same as first or third source register" in WWE RAW2 + if (Intermediate[i].Opcode == PO_LRP) { + continue; + } + + // Handle PARAM_C, PARAM_V and PARAM_T (in that order) : + for (int t = PARAM_C; t >= PARAM_T; t--) { + enum PSH_ARGUMENT_TYPE param_t = (enum PSH_ARGUMENT_TYPE)t; + int max_total = (t == PARAM_C) ? 2 : (t == PARAM_V) ? 999 : 1; + int addressCount = 0; + int total = 0; + while (Intermediate[i].ReadsFromRegister(param_t, -1, addressCount, total) && (addressCount > 1 || total > max_total)) + { + for (int p = 0; p < PSH_OPCODE_DEFS[Intermediate[i].Opcode]._In; ++p) + { + if (Intermediate[i].Parameters[p].Type == param_t) + { + int output = NextFreeRegisterFromIndexUntil(i, PARAM_R, i); + + // This inserts a MOV opcode that writes to R, reading from a C, V or T register + Ins.Output[0].SetRegister(PARAM_R, output, 0); + Ins.Parameters[0].SetRegister(Intermediate[i].Parameters[p].Type, Intermediate[i].Parameters[p].Address, 0); + InsertIntermediate(&Ins, InsertPos); + ++InsertPos; + + ReplaceInputRegisterFromIndexOnwards(InsertPos, Intermediate[InsertPos].Parameters[p].Type, Intermediate[InsertPos].Parameters[p].Address, PARAM_R, output, InsertPos); + Result = true; + break; + } + } + } + } + } + return Result; +} // FixOverusedRegisters + +// TODO : FocusBlur sample needs a zero in 'cnd' opcode + +/* RPSRegisterObject */ + +void RPSRegisterObject::Decode(uint8_t Value, bool aIsAlpha) +{ + IsAlpha = aIsAlpha; + Reg = (PS_REGISTER)(Value); +} + +std::string RPSRegisterObject::DecodedToString() +{ + assert((PS_REGISTER_DISCARD <= Reg) && (Reg <= PS_REGISTER_EF_PROD)); + + return PS_RegisterStr[Reg + 1]; +} + +/* RPSInputRegister */ + +void RPSInputRegister::Decode(uint8_t Value, bool aIsAlpha) +{ + RPSRegisterObject::Decode(Value & PS_NoChannelMask, aIsAlpha); + + Channel = (PS_CHANNEL)(Value & PS_CHANNEL_ALPHA); + InputMapping = (PS_INPUTMAPPING)(Value & 0xe0); + + // Remove the above flags from the register : + Reg = (PS_REGISTER)(Reg & 0xf); + + // Check if the input Register is ZERO, in which case we want to allow the extended registers : + if (Reg == PS_REGISTER_ZERO) + { + switch (InputMapping) { + case PS_REGISTER_ONE: case PS_REGISTER_NEGATIVE_ONE: case PS_REGISTER_ONE_HALF: case PS_REGISTER_NEGATIVE_ONE_HALF: + // These input mapping have their own register - keep these in 'Reg', so we can check for them : + Reg = (PS_REGISTER)(InputMapping); + break; + + case PS_INPUTMAPPING_EXPAND_NEGATE: + // This case has no separate PS_REGISTER define, but when applied to zero, also results in one : + Reg = PS_REGISTER_ONE; + break; + } + } +} + +std::string RPSInputRegister::DecodedToString() +{ + std::string Result; + std::string InputMappingStr = ""; + switch (Reg) { + case PS_REGISTER_ZERO: + { + Result = PS_RegisterStr[0]; + return Result; + } + case PS_REGISTER_ONE: + Result = PS_RegisterStr[0x11]; + break; + case PS_REGISTER_NEGATIVE_ONE: + Result = PS_RegisterStr[0x12]; + break; + case PS_REGISTER_ONE_HALF: + Result = PS_RegisterStr[0x13]; + break; + case PS_REGISTER_NEGATIVE_ONE_HALF: + Result = PS_RegisterStr[0x14]; + break; + default: + Result = RPSRegisterObject::DecodedToString(); + InputMappingStr = " | " + PS_InputMappingStr[(InputMapping >> 5) & 7]; + } + + // Render the channel as a string : + Result = Result + " | " + PS_ChannelStr[(Channel > 0) ? /*Alpha*/2 : (IsAlpha ? /*Blue*/1 : /*RGB*/0)] + InputMappingStr; + return Result; +} + +/* RPSCombinerOutput */ + +void RPSCombinerOutput::Decode(uint8_t Value, DWORD PSInputs, bool aIsAlpha) +{ + RPSRegisterObject::Decode(Value, aIsAlpha); + + // Decode PSAlphaInputs / PSRGBInputs : + Input1.Decode((PSInputs >> 8) & 0xFF, aIsAlpha); + Input2.Decode((PSInputs >> 0) & 0xFF, aIsAlpha); +} + +/* RPSCombinerStageChannel */ + +void RPSCombinerStageChannel::Decode(DWORD PSInputs, DWORD PSOutputs, bool aIsAlpha/* = false*/) +{ + // Get the combiner output flags : + CombinerOutputFlags = (PS_COMBINEROUTPUT)(PSOutputs >> 12); + + // Decompose the combiner output flags : + OutputSUM.OutputAB.DotProduct = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_DOT_PRODUCT) > 0; // false=Multiply, true=DotProduct + OutputSUM.OutputCD.DotProduct = (CombinerOutputFlags & PS_COMBINEROUTPUT_CD_DOT_PRODUCT) > 0; // false=Multiply, true=DotProduct + + if (!aIsAlpha) + { + OutputSUM.OutputAB.BlueToAlpha = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA) > 0; // false=Alpha-to-Alpha, true=Blue-to-Alpha + OutputSUM.OutputCD.BlueToAlpha = (CombinerOutputFlags & PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA) > 0; // false=Alpha-to-Alpha, true=Blue-to-Alpha + } + + // Decode PSAlphaOutputs / PSRGBOutputs and PSAlphaInputs / PSRGBInputs : + OutputSUM.OutputAB.Decode((PSOutputs >> 4) & 0xF, (PSInputs >> 16) & 0xFFFF, aIsAlpha); + OutputSUM.OutputCD.Decode((PSOutputs >> 0) & 0xF, (PSInputs >> 0) & 0xFFFF, aIsAlpha); + OutputSUM.Decode((PSOutputs >> 8) & 0xF, aIsAlpha); + + AB_CD_SUM = (CombinerOutputFlags & PS_COMBINEROUTPUT_AB_CD_MUX) == 0; // true=AB+CD, false=MUX(AB,CD) based on R0.a +} + +// Note : On a hardware level, there are only 4 pixel shaders instructions present in the Nvidia NV2A GPU : +// - xdd (dot/dot/discard) > calculating AB=A.B and CD=C.D +// - xdm (dot/mul/discard) > calculating AB=A.B and CD=C*D +// - xmmc (mul/mul/mux) > calculating AB=A*B and CD=C*D and Mux=AB?CD +// - xmma (mul/mul/sum) > calculating AB=A*B and CD=C*D and Sum=AB+CD +// (One of the implications is, that once a dot-product is issued, no Sum or Mux operation is possible.) +// All other instructions (mov, add, sub, mul, lrp, dp3) are compiled into one of these 4 using varying arguments. +// All 4 instruction specify up to three output registers, all of which must be unique (or be discarded). +// +// Apart from the r0,r1 and t0-t3 registers, the NV2A allows writing to the v0,v1 (this conflicts with PS.1.3!) +// +// The precision of registers is also different; On the Xbox, all 4 color components (RGBA) for constant registers +// range from 0.0 to 1.0 (with 8 bits of precision), while all other registers (r, t and v) range from -1.0 to 1.0. +// +// This is different from native PS.1.3 in which constant registers suddenly have a range -1.0 to 1.0, but vertex +// registers (v0 and v1) range from 0.0 to 1.0 instead, and the temporary and texture registers have a range +// from negative 'MaxPixelShaderValue' to positive 'MaxPixelShaderValue', which value must at least be 1.0 +// (but depending on hardware capabilities can be higher). +// +// TODO : Correct emulation should correct these differences; The range of constant-registers must be converted +// from 0.0-1.0 to -1.0-1.0, and vertex-registers must be converted from -1.0..1.0 to 0.0..1.0 (if anything like +// that is at all possible!) +// +// register | Xbox range | Native range | Xbox | Native | +// C0..C8 | 0.0 - 1.0 ! -1.0 - 1.0 | readonly | readonly | +// R0..R1 | -1.0 - 1.0 | -1.0 - 1.0 | writeable | writeable | +// T0..T3 | -1.0 - 1.0 | -1.0 - 1.0 | writeable | writeable | +// V0..V1 | -1.0 - 1.0 ! 0.0 - 1.0 | writeable ! readonly | +// +// "-C0_bias_x2" shifts range from [ 0..1] to [-1..1] +// "-V0_bias_d2" shifts range from [-1..1] to [ 0..1] + +/* RPSFinalCombiner */ + +void RPSFinalCombiner::Decode(const DWORD PSFinalCombinerInputsABCD, const DWORD PSFinalCombinerInputsEFG, const DWORD PSFinalCombinerConstants) +{ + InputA.Decode((PSFinalCombinerInputsABCD >> 24) & 0xFF, /*aIsAlpha=*/false); + InputB.Decode((PSFinalCombinerInputsABCD >> 16) & 0xFF, /*aIsAlpha=*/false); + InputC.Decode((PSFinalCombinerInputsABCD >> 8) & 0xFF, /*aIsAlpha=*/false); + InputD.Decode((PSFinalCombinerInputsABCD >> 0) & 0xFF, /*aIsAlpha=*/false); + + InputE.Decode((PSFinalCombinerInputsEFG >> 24) & 0xFF, /*aIsAlpha=*/false); + InputF.Decode((PSFinalCombinerInputsEFG >> 16) & 0xFF, /*aIsAlpha=*/false); + InputG.Decode((PSFinalCombinerInputsEFG >> 8) & 0xFF, /*aIsAlpha=*/false); + FinalCombinerFlags = (PS_FINALCOMBINERSETTING)((PSFinalCombinerInputsEFG >> 0) & 0xFF); + + FinalCombinerC0Mapping = (PSFinalCombinerConstants >> 0) & 0xF; + FinalCombinerC1Mapping = (PSFinalCombinerConstants >> 4) & 0xF; + dwPS_GLOBALFLAGS = (PSFinalCombinerConstants >> 8) & 0x1; +} + +void XTL_DumpPixelShaderToFile(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + static int PshNumber = 0; // Keep track of how many pixel shaders we've attempted to convert. + // Don't dump more than 100 shaders, to prevent cluttering the filesystem : + if (PshNumber >= 100) + return; + + char szPSDef[32]; + + sprintf(szPSDef, "PSDef%.03d.txt", PshNumber++); + FILE* out = fopen(szPSDef, "w"); + if (out) + { + fprintf(out, PSH_XBOX_SHADER::OriginalToString(pPSDef).c_str()); + fclose(out); + } +} + +PSH_RECOMPILED_SHADER XTL_EmuRecompilePshDef(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ + uint32_t PSVersion = D3DPS_VERSION(2, 0); // Use pixel shader model 2.0 by default + + extern D3DCAPS g_D3DCaps; + + if (g_D3DCaps.PixelShaderVersion > D3DPS_VERSION(3, 0)) { + // TODO : Test PSVersion = D3DPS_VERSION(3, 0); // g_D3DCaps.PixelShaderVersion; + // TODO : Make the pixel shader version configurable + } + + PSH_XBOX_SHADER PSH = {}; + PSH.SetPSVersion(PSVersion); + PSH.Decode(pPSDef); + return PSH.Convert(pPSDef); +} + +// From Dxbx uState.pas : + +PSH_RECOMPILED_SHADER DxbxRecompilePixelShader(XTL::X_D3DPIXELSHADERDEF *pPSDef) +{ +static const + char *szDiffusePixelShader = + "ps_2_x\n" + "dcl_2d s0\n" + "dcl t0.xy\n" + "texld r0, t0, s0\n" + "mov oC0, r0\n"; + std::string ConvertedPixelShaderStr; + DWORD hRet; + LPD3DXBUFFER pShader; + LPD3DXBUFFER pErrors; + DWORD *pFunction; + + // Attempt to recompile PixelShader + PSH_RECOMPILED_SHADER Result = XTL_EmuRecompilePshDef(pPSDef); + ConvertedPixelShaderStr = Result.NewShaderStr; + + // assemble the shader + pShader = nullptr; + pErrors = nullptr; + hRet = D3DXAssembleShader( + ConvertedPixelShaderStr.c_str(), + ConvertedPixelShaderStr.length(), + /*pDefines=*/nullptr, + /*pInclude=*/nullptr, + /*Flags=*/0, // D3DXASM_DEBUG, + /*ppCompiledShader=*/&pShader, + /*ppCompilationErrors*/&pErrors); + + if (hRet != D3D_OK) + { + EmuLog(LOG_LEVEL::WARNING, "Could not create pixel shader"); + EmuLog(LOG_LEVEL::WARNING, std::string((char*)pErrors->GetBufferPointer(), pErrors->GetBufferSize()).c_str()); + + printf(ConvertedPixelShaderStr.c_str()); + + hRet = D3DXAssembleShader( + szDiffusePixelShader, + strlen(szDiffusePixelShader), + /*pDefines=*/nullptr, + /*pInclude=*/nullptr, + /*Flags=*/0, // Was D3DXASM_SKIPVALIDATION, + /*ppCompiledShader=*/&pShader, + /*ppCompilationErrors*/&pErrors); + + if (hRet != D3D_OK) { + EmuLog(LOG_LEVEL::WARNING, "Could not create pixel shader"); + EmuLog(LOG_LEVEL::WARNING, std::string((char*)pErrors->GetBufferPointer(), pErrors->GetBufferSize()).c_str()); + CxbxKrnlCleanup("Cannot fall back to the most simple pixel shader!"); + } + + EmuLog(LOG_LEVEL::WARNING, "We're lying about the creation of a pixel shader!"); + } + + if (pShader) + { + pFunction = (DWORD*)(pShader->GetBufferPointer()); + if (hRet == D3D_OK) { + // redirect to windows d3d + hRet = g_pD3DDevice->CreatePixelShader + ( + pFunction, + (IDirect3DPixelShader**)(&(Result.ConvertedHandle)) //fixme + ); + + if (hRet != D3D_OK) { + extern const char *D3DErrorString(HRESULT hResult); + + printf(D3DErrorString(hRet)); + } + } + + // Dxbx note : We must release pShader here, else we would have a resource leak! + pShader->Release(); + pShader = nullptr; + } + + // Dxbx addition : We release pErrors here (or it would become a resource leak!) + if (pErrors) + { + pErrors->Release(); + pErrors = nullptr; + } + return Result; +} // DxbxRecompilePixelShader + +std::vector g_RecompiledPixelShaders; + +VOID DxbxUpdateActivePixelShader() // NOPATCH +{ + XTL::X_D3DPIXELSHADERDEF *pPSDef; + PPSH_RECOMPILED_SHADER RecompiledPixelShader; + DWORD ConvertedPixelShaderHandle; + DWORD CurrentPixelShader; + int i; + DWORD Register_; + D3DCOLOR dwColor; + D3DXCOLOR fColor; + + HRESULT Result = D3D_OK; + + // The first RenderState is PSAlpha, + // The pixel shader is stored in pDevice->m_pPixelShader + // For now, we still patch SetPixelShader and read from there... + + // Use the pixel shader stored in D3D__RenderState rather than the set handle + // This allows changes made via SetRenderState to actually take effect! + // NOTE: PSTextureModes is in a different location in the X_D3DPIXELSHADERFEF than in Render State mappings + // All other fields are the same. + // We cast D3D__RenderState to a pPSDef for these fields, but + // manually read from D3D__RenderState[X_D3DRS_PSTEXTUREMODES) for that one field. + // See D3DDevice_SetPixelShaderCommon which implements this + + pPSDef = g_pXbox_PixelShader != nullptr ? (XTL::X_D3DPIXELSHADERDEF*)(XboxRenderStates.GetPixelShaderRenderStatePointer()) : nullptr; + + if (pPSDef != nullptr) + { + RecompiledPixelShader = nullptr; + + // Now, see if we already have a shader compiled for this declaration : + for (auto it = g_RecompiledPixelShaders.begin(); it != g_RecompiledPixelShaders.end(); ++it) { + // Only compare parts that form a unique shader (ignore the constants and Direct3D8 run-time fields) : + if ((memcmp(&(it->PSDef.PSAlphaInputs[0]), &(pPSDef->PSAlphaInputs[0]), (8 + 2) * sizeof(DWORD)) == 0) + && (memcmp(&(it->PSDef.PSAlphaOutputs[0]), &(pPSDef->PSAlphaOutputs[0]), (8 + 8 + 3 + 8 + 4) * sizeof(DWORD)) == 0)) { + RecompiledPixelShader = &(*it); + break; + } + } + + // If none was found, recompile this shader and remember it : + if (RecompiledPixelShader == nullptr) { + // Recompile this pixel shader : + g_RecompiledPixelShaders.push_back(DxbxRecompilePixelShader(pPSDef)); + RecompiledPixelShader = &g_RecompiledPixelShaders.back(); + } + + // Switch to the converted pixel shader (if it's any different from our currently active + // pixel shader, to avoid many unnecessary state changes on the local side). + ConvertedPixelShaderHandle = RecompiledPixelShader->ConvertedHandle; + + g_pD3DDevice->GetPixelShader(/*out*/(IDirect3DPixelShader**)(&CurrentPixelShader)); + if (CurrentPixelShader != ConvertedPixelShaderHandle) + g_pD3DDevice->SetPixelShader((IDirect3DPixelShader*)ConvertedPixelShaderHandle); + + // Note : We set the constants /after/ setting the shader, so that any + // constants in the shader declaration can be overwritten (this will be + // needed for the final combiner constants at least)! + + // TODO: Figure out a method to forward the vertex-shader oFog output to the pixel shader FOG input register : + // We could use the unused oT4.x to output fog from the vertex shader, and read it with 'texcoord t4' in pixel shader! + // For now, we still disable native fog if pixel shader is said to handle it, this prevents black screen issues in titles using pixel shader fog. + // NOTE: Disabled: This breaks fog in XDK samples such as DolphinClassic. +#if-0 + if ((RecompiledPixelShader->PSDef.PSFinalCombinerInputsABCD > 0) || (RecompiledPixelShader->PSDef.PSFinalCombinerInputsEFG > 0)) { + g_pD3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); + } +#endif + + //PS_TEXTUREMODES psTextureModes[XTL::X_D3DTS_STAGECOUNT]; + //PSH_XBOX_SHADER::GetPSTextureModes(pPSDef, psTextureModes); + // + //for (i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) + //{ + // switch (psTextureModes[i]) + // { + // case PS_TEXTUREMODES_BUMPENVMAP: + // g_pD3DDevice->SetTextureStageState(i, D3DTSS_COLOROP, D3DTOP_BUMPENVMAP); + // break; + // case PS_TEXTUREMODES_BUMPENVMAP_LUM: + // g_pD3DDevice->SetTextureStageState(i, D3DTSS_COLOROP, D3DTOP_BUMPENVMAPLUMINANCE); + // break; + // default: + // break; + // } + //} + + // Set constants, not based on g_PixelShaderConstants, but based on + // the render state slots containing the pixel shader constants, + // as these could have been updated via SetRenderState or otherwise : + for (i = 0; i < PSH_XBOX_CONSTANT_MAX; i++) + { + if (RecompiledPixelShader->ConstInUse[i]) + { + // Read the color from the corresponding render state slot : + switch (i) { + case PSH_XBOX_CONSTANT_FOG: + // Note : FOG.RGB is correct like this, but FOG.a should be coming + // from the vertex shader (oFog) - however, D3D8 does not forward this... + fColor = dwColor = XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_FOGCOLOR); + break; + case PSH_XBOX_CONSTANT_FC0: + fColor = dwColor = XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSFINALCOMBINERCONSTANT0); + break; + case PSH_XBOX_CONSTANT_FC1: + fColor = dwColor = XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSFINALCOMBINERCONSTANT1); + break; + case PSH_XBOX_CONSTANT_MUL0: + case PSH_XBOX_CONSTANT_MUL1: + continue; + case PSH_XBOX_CONSTANT_BEM + 0: + case PSH_XBOX_CONSTANT_BEM + 1: + case PSH_XBOX_CONSTANT_BEM + 2: + case PSH_XBOX_CONSTANT_BEM + 3: + { + int stage = i - PSH_XBOX_CONSTANT_BEM; + DWORD* value = (DWORD*)&fColor; + + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVMAT00, &value[0]); + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVMAT01, &value[1]); + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVMAT11, &value[2]); + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVMAT10, &value[3]); + break; + } + case PSH_XBOX_CONSTANT_LUM + 0: + case PSH_XBOX_CONSTANT_LUM + 1: + case PSH_XBOX_CONSTANT_LUM + 2: + case PSH_XBOX_CONSTANT_LUM + 3: + { + int stage = i - PSH_XBOX_CONSTANT_LUM; + DWORD* value = (DWORD*)&fColor; + + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVLSCALE, &value[0]); + g_pD3DDevice->GetTextureStageState(stage, D3DTSS_BUMPENVLOFFSET, &value[1]); + value[2] = 0; + value[3] = 0; + break; + } + default: + fColor = dwColor = XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSCONSTANT0_0 + i); + break; + } + + // Convert it back to 4 floats : + //fColor = dwColor; + // Read the register we can use on PC : + Register_ = RecompiledPixelShader->ConstMapping[i]; + // TODO : Avoid the following setter if it's no different from the previous update (this might speed things up) + // Set the value locally in this register : + g_pD3DDevice->SetPixelShaderConstantF + ( + Register_, + (PixelShaderConstantType*)(&fColor), + 1 + ); + } + } + } + else + { + ConvertedPixelShaderHandle = 0; + g_pD3DDevice->SetPixelShader((IDirect3DPixelShader*)ConvertedPixelShaderHandle); + } +} + +// End of Dxbx code + +#define REVEL8N_PIXEL_SHADER_CHANGES + +// help functions +char *pCodeBuffer=nullptr; + +void WriteCode(const char *str, ...) +{ + char szBuffer[256]; + va_list argp; + + va_start(argp, str); + vsprintf(szBuffer, str, argp); + va_end(argp); + + //printf("%s", szBuffer); + if(pCodeBuffer) + strcat(pCodeBuffer, szBuffer); +} + +void InsertString(char *szStr, int iOffset, char *szInsert, int iInsertLen, int iRemoveLen); + +inline void HandleInputOutput +( + DWORD dwInput, + DWORD dwOutput, + BOOL bAlpha, + int iCStage, + BOOL bUniqueC0, + BOOL bUniqueC1, + int *iPSC0, + int *iPSC1, + + BOOL bGlobalRGBA, + + BOOL bFinalCombiner +); + +inline void GetRegister +( + WORD wRegister, + char *szRegister, + BOOL bUniqueC0, + BOOL bUniqueC1, + int iCStage, + int *pPSC0, + int *pPSC1 +); + +inline void GetInputMapping(WORD wInputMapping, char *szInputMapping, char *szInputMappingAfter, char *szConst); +inline void GetChannel(WORD wInputChannel, char *szInput, BOOL bAlpha, BOOL bGlobalRGBA); + +inline void GetOutputFlags +( + WORD wOutputFlags, + char *szInstMod, + char *szABOp, + char *szCDOp, + char *szABCDOp, + + BOOL *bAB_BA, + BOOL *bCD_BA, + + BOOL *bShl1Bias, + BOOL *bBias +); + +//inline BOOL CheckOpForMov(char *szOp, char *szInputs1, char *szInput2, char *szRegInput); +inline BOOL OptimizeOperation +( + char *szOp, + char *szOp1, + + char *szOp2, + char *szMod, + + char *szInputAB1, + char *szInputAB2, + + char *szInputCD1, + char *szInputCD2, + + char *szConstRegAB1, + char *szConstRegAB2, + char *szConstRegCD1, + char *szConstRegCD2, + + char *szOutAB, + char *szOutCD, + char *szABCDOutput, + + char *szCommand +); + +inline void ClearConstRegVars(); +inline void CorrectConstToReg(char *szConst, int *pPSC0, int *pPSC1); + +int iPreRunLen=0; + +// This is set to true if an operation tries to read from r0 +// before r0 was written, in that case we do the same as the xbox +// we write the value of t0.a to r0 ;-) +BOOL bR0WAccess=FALSE; +BOOL bR0Written=FALSE; +BOOL bR0AWritten=FALSE; +/* +BOOL bR1WAccess=FALSE; +BOOL bR1AWAccess=FALSE; +BOOL bR1RGBWAccess=FALSE; + +BOOL bR1AWritten=FALSE; +BOOL bR1RGBWritten=FALSE; +BOOL bR1Written=FALSE; +*/ +BOOL bR0AlphaOutput = FALSE; + +BOOL bLastOpRGB = FALSE; + +BOOL bEFProduct = FALSE; +BOOL bV1R0Reg = FALSE; + +#define DEF_VAR_TABLE_LEN 7 +char szVar[][10] = +{ + "r0", + "r1", + "t0", + "t1", + "t2", + "t3", + "t4" +}; + +inline void HandleInputOutput +( + DWORD dwInput, + DWORD dwOutput, + BOOL bAlpha, + int iCStage, + BOOL bUniqueC0, + BOOL bUniqueC1, + int *iPSC0, + int *iPSC1, + + BOOL bGlobalRGBA, + + BOOL bFinalCombiner +) +{ + // INPUTS + if(bFinalCombiner) printf("\npPSD.PSFinalCombinerInputsABCD = PS_COMBINERINPUTS(\n"); + else if(bAlpha) printf("\npPSD.PSAlphaInputs[%d] = PS_COMBINERINPUTS(\n", iCStage); + else printf("\npPSD.PSRGBInputs[%d] = PS_COMBINERINPUTS(\n", iCStage); + + WORD wCombinerInputs[4]; // 0=a, 1=b, 2=c, 3=d + wCombinerInputs[0] = (WORD) ((dwInput>>24) & 0xFF); + wCombinerInputs[1] = (WORD) ((dwInput>>16) & 0xFF); + wCombinerInputs[2] = (WORD) ((dwInput>> 8) & 0xFF); + wCombinerInputs[3] = (WORD) ( dwInput & 0xFF); + + char szInput[4][20] = {0}; + char szConst[4][20] = {0}; + char szInputMapping[4][20] = {0}; + char szInputMappingAfter[4][20] = {0}; + char szChannels[4][5] = {0}; + + // Go through inputs + int i=0; + for(i=0; i<4; i++) + { + szInput[i][0]=0x00; // Fast way to zero a string ;-) + szConst[i][0]=0x00; + szInputMapping[i][0]=0x00; + szInputMappingAfter[i][0]=0x00; + szChannels[i][0]=0x00; + + GetRegister(wCombinerInputs[i] & 0xF, szInput[i], bUniqueC0, bUniqueC1, iCStage, iPSC0, iPSC1); + + if(strcmp(szInput[i], "r0")==0) + { + if(!bR0AWritten) + strcpy(szInput[i], "t0"); + + if(!bR0Written) { + strcpy(szInput[i], "t0"); + //bR0WAccess=TRUE; + } + } + + printf(" | "); + GetInputMapping(wCombinerInputs[i] & 0x1E0, szInputMapping[i], szInputMappingAfter[i], szConst[i]); + printf(" | "); + GetChannel(wCombinerInputs[i] & 0x10, szChannels[i], bAlpha, bGlobalRGBA); + printf(",\n"); + + if((wCombinerInputs[i] & 0xF)==0x00) + szInput[i][0]=0x00; + + // 6928: check this as I doubt whether it works really like that + /*if(strcmp(szInput[i], "r1")==0) + { + // EmuLog(LOG_LEVEL::DEBUG, "channel: %s", szChannels[i]); + // Sleep(3000); + + if((strcmp(szChannels[i], ".a")==0) && (!bR1AWritten)) { + bR1AWAccess=TRUE; + + strcpy(szInput[i], " t1"); + } else if((strcmp(szChannels[i], ".rgb")==0) && (!bR1RGBWritten)) { + bR1RGBWAccess=TRUE; + + strcpy(szInput[i], " t1"); + } else if(!bR1Written) { + bR1WAccess=TRUE; + + strcpy(szInput[i], " t1"); + } + + if(bR1AWAccess && bR1RGBWAccess) + bR1WAccess=TRUE; + + //if(bR1AWAccess || bR1RGBWAccess) + // strcpy(szInput[i], "t1"); + }*/ + + //printf("\n*** szInput[%d]: %s\n", i, szInput[i]); + } + + // Input stuff + BOOL bInput[4] = {0, 0, 0, 0}; + if(szInput[0][0]) bInput[0]=TRUE; + if(szInput[1][0]) bInput[1]=TRUE; + if(szInput[2][0]) bInput[2]=TRUE; + if(szInput[3][0]) bInput[3]=TRUE; + +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + // Correct param if a constant is used! + if(!bInput[0]) + CorrectConstToReg(szConst[0], iPSC0, iPSC1); + if(!bInput[1]) + CorrectConstToReg(szConst[1], iPSC0, iPSC1); + if(!bInput[2]) + CorrectConstToReg(szConst[2], iPSC0, iPSC1); + if(!bInput[3]) + CorrectConstToReg(szConst[3], iPSC0, iPSC1); + + bool bEmptyChannel = false; +#endif + + char szCompleteInput[4][20] = {0}; + for(i=0; i<4; i++) + { + strcpy(szCompleteInput[i], szInputMapping[i]); +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + if(bInput[i]) + { +#endif + strcat(szCompleteInput[i], szInput[i]); +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + bEmptyChannel = bEmptyChannel || (szChannels[i][0] == 0); + } + else + strcat(szCompleteInput[i], &szConst[i][4]); +#endif + strcat(szCompleteInput[i], szInputMappingAfter[i]); + strcat(szCompleteInput[i], szChannels[i]); + } + + printf(");\n"); + + if(!bFinalCombiner) + { + // OUTPUTS + if(bAlpha) printf("\npPSD.PSAlphaOutputs[%d] = PS_COMBINEROUTPUTS(\n", iCStage); + else printf("\npPSD.PSRGBOutputs[%d] = PS_COMBINEROUTPUTS(\n", iCStage); + + WORD wCombinerOutputs[3]; // 0=d0 (ab), 1=d1 (cd), 2=d2 (mux_sum) + wCombinerOutputs[0] = (WORD) ((dwOutput>> 4) & 0xF); + wCombinerOutputs[1] = (WORD) ( dwOutput & 0xF); + wCombinerOutputs[2] = (WORD) ((dwOutput>> 8) & 0xF); + WORD wCombinerOutputFlags = (WORD) ((dwOutput>>12) & 0xFF); + + char szOutput[3][10] = {0}; + char szOutputMod[10]="\0"; + + char szABOp[10]="\0"; + char szCDOp[10]="\0"; + char szABCDOp[10]="\0"; + + BOOL bAB_B2A; + BOOL bCD_B2A; + + BOOL bR0Now = FALSE; + BOOL bR0ANow = FALSE; + BOOL bVAccess[3] = {0,0,0}; + + BOOL bOpRGB_Current = FALSE; + BOOL bCurrOpRealAlpha = FALSE; + + // Go through outputs + for(i=0; i<3; i++) + { + szOutput[i][0]=0x00; // Fast way to zero a string ;-) + + GetRegister(wCombinerOutputs[i], szOutput[i], bUniqueC0, bUniqueC1, iCStage, iPSC0, iPSC1); + if(strcmp(szOutput[i], "r0")==0) + { + bR0Now=TRUE; + + // this checks for output to r0.a + if(bGlobalRGBA || (!bGlobalRGBA && bAlpha)) + bR0AlphaOutput=TRUE; + } + + if((strcmp(szOutput[i], "v0")==0) || (strcmp(szOutput[i], "v1")==0)) { bVAccess[i] = TRUE; } + + /*BOOL bR1_Written = FALSE; + if(strcmp(szOutput[i], "r1")==0) + bR1_Written=TRUE;*/ + + // check channel! + if(!bGlobalRGBA && bAlpha) + { + strcat(szOutput[i], ".a"); + bCurrOpRealAlpha = TRUE; + + if(bR0Now) + bR0ANow=TRUE; + + /*if(bR1_Written) + bR1AWritten=TRUE;*/ + } + else if(!bGlobalRGBA && !bAlpha +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + && !bEmptyChannel +#endif + ) + { + strcat(szOutput[i], ".rgb"); + + if(wCombinerOutputs[i]) + bOpRGB_Current = TRUE; + + /*if(bR1_Written) + bR1RGBWritten=TRUE;*/ + } + else + { + /*if(bR1_Written) + bR1Written=TRUE;*/ + + if(bR0Now) + bR0ANow=TRUE; + } + + printf(",\n"); + + if(wCombinerOutputs[i]==0x00) + szOutput[i][0]=0x00; + + //printf("\n*** szOutput[%d]: %s\n", i, szOutput[i]); + } + + BOOL bBias=FALSE; + BOOL bSh1Bias=FALSE; + + GetOutputFlags( + wCombinerOutputFlags, + szOutputMod, + + szABOp, + szCDOp, + szABCDOp, + + &bAB_B2A, + &bCD_B2A, + + &bSh1Bias, + &bBias); + + if(bR0Now) + bR0Written=TRUE; + + if(bR0ANow) + bR0AWritten=TRUE; + + printf(");\n"); + + // Find output for the operations + char szOut[10]="\0"; + char szOut1[10]="\0"; + + //printf("|****| %s |****|\n", szOutput[1]); + + if(szOutput[0][0]) + strcpy(szOut, szOutput[0]); + if(szOutput[1][0]) + strcpy(szOut1, szOutput[1]); + +#ifndef REVEL8N_PIXEL_SHADER_CHANGES + if(szOutput[2][0]) + { + /* + //EmuWarningMsg("THIS IS WRONG, FIX ME!"); + //if(!szOutput[1][0]) + // strcpy(szOut1, szOutput[2]); + EmuLog(LOG_LEVEL::DEBUG, "(!szOutput[0][0] || !szOutput[1][0]) && szOutput[2][0] = TRUE!"); + + BOOL bUsable=TRUE; + for(i=2; i<4; i++) + { + if((strcmp(szOutput[2], szInput[i])==0) || (strcmp(szOutput[2], szOut1)==0)) { + bUsable=FALSE; + } + } + if(bUsable && !szOutput[0][0]) + { + + strcpy(szOut, szOutput[2]); + + EmuLog(LOG_LEVEL::DEBUG, "BUsable = TRUE, new output: %s", szOut); + + } + else { + printf("!WARNING!: The operation uses the output register also as input!" + "Trying to find a free output register. It is possible that the pixel shader " + "will generate garbage because the new free one contains data used " + "in an other comming operation!\n\n"); + + for(int j=0; j> 24) & 0xFF); + wEFG[1] = (WORD) ((dwOutput >> 16) & 0xFF); + wEFG[2] = (WORD) ((dwOutput >> 8) & 0xFF); + + BOOL bInputEFG[3] = {0, 0, 0}; + char szCompleteInputEFG[3][10]; + + char szInputEFG[3][10]; + char szInputMappingEFG[3][10]; + char szInputMappingAfterEFG[3][10]; + char szConstEFG[3][10]; + + for(i=0; i<3; i++) + { + szInputEFG[i][0]=0x00; + szInputMappingEFG[i][0]=0x00; + szInputMappingAfterEFG[i][0]=0x00; + szConstEFG[i][0]=0x00; + + GetRegister(wEFG[i] & 0xF, szInputEFG[i], bUniqueC0, bUniqueC1, 0, iPSC0, iPSC1); + printf(" | "); + GetInputMapping(wEFG[i] & 0x1E0, szInputMappingEFG[i], szInputMappingAfterEFG[i], szConstEFG[i]); + printf(" | "); + GetChannel(wEFG[i] & 0x10, szInputEFG[i], bAlpha, FALSE); + printf(", \n"); + + strcpy(szCompleteInputEFG[i], szInputMappingEFG[i]); + strcat(szCompleteInputEFG[i], szInputEFG[i]); + strcat(szCompleteInputEFG[i], szInputMappingAfterEFG[i]); + + if(szInputEFG[i][0]) + bInputEFG[i]=TRUE; + else + { + // add that constant as a reg + CorrectConstToReg(szConstEFG[i], iPSC0, iPSC1); + } + } + + if(dwV1R0_EFProd_Flags & 0x20) + printf("PS_FINALCOMBINERSETTINGS_COMPLEMENT_R0"); + else if(dwV1R0_EFProd_Flags & 0x40) + printf("PS_FINALCOMBINERSETTINGS_COMPLEMENT_V1"); + else if(dwV1R0_EFProd_Flags & 0x80) + printf("PS_FINALCOMBINERSETTINGS_CLAMP_SUM"); + else + printf("0"); + + printf(");\n"); + + if (bV1R0Reg) + { + char sMod[10] = {0}; + char sV1[10] = {0}; + char sR0[10] = {0}; + if(dwV1R0_EFProd_Flags & 0x20) + strcpy(sR0, "1-"); + else if(dwV1R0_EFProd_Flags & 0x40) + strcpy(sV1, "1-"); + else if(dwV1R0_EFProd_Flags & 0x80) + strcpy(sMod, "_sat"); + + if (bEFProduct) + { + EmuLog(LOG_LEVEL::WARNING, "EF Product and V1R0 register used at the same time!"); + } + else + { + WriteCode("; (v1 + r0)\nadd%s r0, %sr0, %sv1\n\n", sMod, sR0, sV1); + } + } + + // only we we will use this later in final combiner stuff!! + // all inputs are known now, so check: + if(bEFProduct) { + + // r0 = E * F (E or F must be the r0 calculated before otherwise the stage results + // are lost, problem??? + if(! + ((!bInputEFG[0] && szConstEFG[0][0]=='0') && + (!bInputEFG[1] && szConstEFG[1][0]=='0'))) { + WriteCode(";E * F\nmul r0, %s, %s\n\n", bInputEFG[0] ? szCompleteInputEFG[0] : &szConstEFG[0][4], + bInputEFG[1] ? szCompleteInputEFG[1] : &szConstEFG[1][4]); + } + + } + + // Now the result: + + // What is done by the final combiner: + // final color = s0*s1 + (1-s0)*s2 + s3 + + // lrp r0, s0, s1, s2 + // add r0, r0, s3 + // s0 = szInput[0] + // s1 = szInput[1] + // s2 = szInput[2] + // s3 = szInput[3] + + // Check whether it is a mov r0, r0 + // for example: lrp r0, 1, r0, 0 + // r0 = 1*r0 + (1-1)*r0 + 0 + // --> r0 = r0 + + for(i=0; i<4; i++) + { + if(!bInput[i]) + CorrectConstToReg(szConst[i], iPSC0, iPSC1); + } + + if(!((!bInput[0]) && (szConst[0][0] == '1') && (strncmp(szCompleteInput[1], "r0", 2)==0))) + { + // cases for s2 + // s2 == 0 --> final color = s0*s1 + s3 + if((!bInput[2]) && (szConst[2][0] == '0')) + { + WriteCode("mul r0.rgb, %s, %s\n", + bInput[0] ? szCompleteInput[0] : &szConst[0][4], + bInput[1] ? szCompleteInput[1] : &szConst[1][4]); + } + // s0 == 0 --> final color = s2 + s3 + else if((!bInput[0]) && (szConst[0][0] == '0')) { + // Check whether s2 is r0!!! + if(!(bInput[2] && (strncmp(szCompleteInput[2], "r0", 2)==0))) + WriteCode("mov r0.rgb, %s\n", + bInput[2] ? szCompleteInput[2] : &szConst[2][4]); + } + // s0 == 1 --> final color = s1 + s3 + else if((!bInput[0]) && (szConst[0][0] == '1')) { + // Check whether s1 is r0!!! + if(!(bInput[1] && (strncmp(szCompleteInput[1], "r0", 2)==0))) + WriteCode("mov r0.rgb, %s\n", + bInput[1] ? szCompleteInput[1] : &szConst[1][4]); + } + // no special cases + else if(bInput[2] || bInput[0]) + { + WriteCode("lrp r0.rgb, %s, %s, %s\n", + bInput[0] ? szCompleteInput[0] : &szConst[0][4], + bInput[1] ? szCompleteInput[1] : &szConst[1][4], + bInput[2] ? szCompleteInput[2] : &szConst[2][4]); + } + } + // case for s3 + if(bInput[3] || (szConst[3][0] != '0')) + WriteCode("add r0.rgb, r0, %s\n", bInput[3] ? szCompleteInput[3] : &szConst[3][4]); + + // Alpha ouput (G) + if(bInputEFG[2] && (strncmp(szInputEFG[2], "r0", 2)!=0)) + { + bR0AlphaOutput=TRUE; + + WriteCode("mov r0.a, %s\n", + bInputEFG[2] ? szCompleteInputEFG[2] : &szConstEFG[2][4]); + } + + //else + // WriteCode("mov r0.a, v0.a\n"); + //*/ + //Sleep(3000); + } +} + +inline void GetRegister(WORD wRegister, char *szRegister, BOOL bUniqueC0, BOOL bUniqueC1, int iCStage, int *iPSC0, int *iPSC1) +{ + // Determine register + switch(wRegister) + { + case 0x00: + printf("PS_REGISTER_ZERO"); + break; + case 0x01: // read + printf("PS_REGISTER_C0"); + if(bUniqueC0) + sprintf(szRegister, "c%d", iPSC0[iCStage]); + else + strcpy(szRegister, "c0"); + break; + case 0x02: // read + printf("PS_REGISTER_C1"); + if(bUniqueC0) + sprintf(szRegister, "c%d", iPSC1[iCStage]); + else + strcpy(szRegister, "c1"); + break; + case 0x03: // read + { + printf("PS_REGISTER_FOG"); + + char szOneHalf[40] = "0.5\0"; + CorrectConstToReg(szOneHalf, iPSC0, iPSC1); + + strcpy(szRegister, &szOneHalf[4]); // Unsupported + break; + } + case 0x04: // read/(write ???) + printf("PS_REGISTER_V0"); + strcpy(szRegister, "v0"); + break; + case 0x05: // read/(write ???) + printf("PS_REGISTER_V1"); + strcpy(szRegister, "v1"); + break; + case 0x08: // read/write + printf("PS_REGISTER_T0"); + strcpy(szRegister, "t0"); + //strcpy(szRegister, "r2"); + break; + case 0x09: // read/write + printf("PS_REGISTER_T1"); + strcpy(szRegister, "t1"); + //strcpy(szRegister, "r3"); + break; + case 0x0A: // read/write + printf("PS_REGISTER_T2"); + strcpy(szRegister, "t2"); + //strcpy(szRegister, "r4"); + break; + case 0x0B: // read/write + printf("PS_REGISTER_T3"); + strcpy(szRegister, "t3"); + //strcpy(szRegister, "r5"); + break; + case 0x0C: // read/write + printf("PS_REGISTER_R0"); + strcpy(szRegister, "r0"); + break; + case 0x0D: // read/write + printf("PS_REGISTER_R1"); + strcpy(szRegister, "r1"); + break; + case 0x0E: // read + printf("PS_REGISTER_V1R0_SUM"); + + bV1R0Reg = TRUE; + strcpy(szRegister, "r0"); //"V1R0");//(v1+r0)"); + break; + case 0x0F: + printf("PS_REGISTER_EF_PROD"); + + // we save it in r0 + bEFProduct = TRUE; + strcpy(szRegister, "r0");/* e * f --> combiner input */ + break; + default: + printf("/*Unknown register %d*/", wRegister); + break; + } +} + +inline void GetInputMapping(WORD wInputMapping, char *szInputMapping, char *szInputMappingAfter, char *szConst) +{ + strcpy(szConst, "0"); + switch(wInputMapping) + { + case 0x00: // max(0,x) [ok for final combiner] + printf("PS_INPUTMAPPING_UNSIGNED_IDENTITY"); + break; + case 0x20: // 1 - max(0,x) [ok for final combiner] + printf("PS_INPUTMAPPING_UNSIGNED_INVERT"); + strcpy(szInputMapping, "1-"); + strcpy(szConst, "1"); + break; + case 0x40: // 2*max(0,x) - 1 [invalid for final combiner] + printf("PS_INPUTMAPPING_EXPAND_NORMAL"); + strcpy(szInputMappingAfter, "_bx2"); // right??? + strcpy(szConst, "-1"); + break; + case 0x60: // 1 - 2*max(0,x) [invalid for final combiner] + printf("PS_INPUTMAPPING_EXPAND_NEGATE"); + + strcpy(szInputMapping, "-"); + strcpy(szInputMappingAfter, "_bx2"); + strcpy(szConst, "1"); + break; + case 0x80: // max(0,x) - 1/2 [invalid for final combiner] + printf("PS_INPUTMAPPING_HALFBIAS_NORMAL"); + strcpy(szInputMappingAfter, "_bias"); + + strcpy(szConst, "-0.5"); + break; + case 0xA0: // 1/2 - max(0,x) [invalid for final combiner] + printf("PS_INPUTMAPPING_HALFBIAS_NEGATE"); + + strcpy(szConst, "0.5"); + + // Negate is run last if combined with bias + strcpy(szInputMapping, "-"); + strcpy(szInputMappingAfter, "_bias"); + break; + case 0xC0: // x [invalid for final combiner] + printf("PS_INPUTMAPPING_SIGNED_IDENTITY"); + break; + case 0xE0: // -x [invalid for final combiner] + printf("PS_INPUTMAPPING_SIGNED_NEGATE"); + strcpy(szInputMapping, "-"); + break; + default: + printf("/*Unknown input mapping %d!*/", wInputMapping); + break; + } +} + +inline void GetChannel(WORD wInputChannel, char *szInput, BOOL bAlpha, BOOL bGlobalRGBA) +{ + switch(wInputChannel) + { + case 0x00: + if(bAlpha) { + printf("PS_CHANNEL_BLUE"); + strcat(szInput, ".b"); + } else { + printf("PS_CHANNEL_RGB"); + + //if (!bGlobalRGBA) + // strcat(szInput, ".rgb"); + } + break; + case 0x10: + printf("PS_CHANNEL_ALPHA"); + + // TODO: check this || !bAlpha, it should mean that alpha channel + // is detected in a RGB register, then it must be set also + // if both commands the same are (in that case it has to be RGB!) + if (!bGlobalRGBA || !bAlpha) + strcat(szInput, ".a"); + break; + default: + printf("/*Unknown channel %d!*/", wInputChannel); + break; + } +} + +inline void GetOutputFlags +( + WORD wOutputFlags, + char *szInstMod, + char *szABOp, + char *szCDOp, + char *szABCDOp, + + BOOL *bAB_BA, + BOOL *bCD_BA, + + BOOL *bShl1Bias, + BOOL *bBias +) +{ + // Output mapping + switch (wOutputFlags & 0x38) { + case PS_COMBINEROUTPUT_BIAS: + { + printf("PS_COMBINEROUTPUT_BIAS"); // y = x - 0.5 + //strcpy(szInstMod, "_bias"); + + // Only over this: + // mov y, y_bias + (*bBias)=TRUE; + break; + } + case PS_COMBINEROUTPUT_SHIFTLEFT_1: // 0x10L + { + printf("PS_COMBINEROUTPUT_SHIFTLEFT_1"); // y = x*2 + strcpy(szInstMod, "_x2"); + break; + } + case PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS: // 0x18L + { + LOG_TEST_CASE("PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS"); + printf("PS_COMBINEROUTPUT_SHIFTLEFT_1_BIAS"); // y = (x - 0.5)*2 + + //strcpy(szInstMod, "_x2"); + // what is missing is a subtraction of 1 + // --> 2 * (x - 0.5) = 2x - 1 + + // But this won't work because we would have to do 2 movs + // to subtract 1 + // Let's do this: mov_x2 y, y_bias + (*bShl1Bias)=TRUE; + break; + } + case PS_COMBINEROUTPUT_SHIFTLEFT_2: // 0x20L + { + LOG_TEST_CASE("PS_COMBINEROUTPUT_SHIFTLEFT_2"); + printf("PS_COMBINEROUTPUT_SHIFTLEFT_2"); // y = x*4 + strcpy(szInstMod, "_x4"); + break; + } + // case PS_COMBINEROUTPUT_SHIFTLEFT_2_BIAS: // 0x28L, // y = (x - 0.5)*4 + case PS_COMBINEROUTPUT_SHIFTRIGHT_1: // 0x30L + { + LOG_TEST_CASE("PS_COMBINEROUTPUT_SHIFTRIGHT_1"); + printf("PS_COMBINEROUTPUT_SHIFTRIGHT_1"); // y = x/2 + strcpy(szInstMod, "_d2"); + break; + } + // case PS_COMBINEROUTPUT_SHIFTRIGHT_1_BIAS: // 0x38L, // y = (x - 0.5)/2 + default: + printf("PS_COMBINEROUTPUT_IDENTITY"); + } + + printf(" | "); + + // MUX operation + if(wOutputFlags & 0x04) { + printf("PS_COMBINEROUTPUT_AB_CD_MUX"); + strcpy(szABCDOp, "cnd"); + + if((!bR0Written) || (!bR0AWritten)) + bR0WAccess=TRUE; + } + else + { + printf("PS_COMBINEROUTPUT_AB_CD_SUM"); // 3rd output is AB+CD + strcpy(szABCDOp, "add"); + } + + printf(" | "); + + // Function for ab side + if(wOutputFlags & 0x02) + { + printf("PS_COMBINEROUTPUT_AB_DOT_PRODUCT"); // RGB only + strcpy(szABOp, "dp3"); + } else { + printf("PS_COMBINEROUTPUT_AB_MULTIPLY"); + strcpy(szABOp, "mul"); + } + + printf(" | "); + + // Functiomn for cd side + if(wOutputFlags & 0x01) + { + printf("!!!PS_COMBINEROUTPUT_CD_DOT_PRODUCT!!!"); // RGB only + strcpy(szCDOp, "dp3"); + } else { + printf("PS_COMBINEROUTPUT_CD_MULTIPLY"); + strcpy(szCDOp, "mul"); + } + + // Blue to alpha for ab side + if(wOutputFlags & 0x80) { + printf(" | PS_COMBINEROUTPUT_AB_BLUE_TO_ALPHA"); // RGB only + (*bAB_BA)=TRUE; + } else (*bAB_BA)=FALSE; + + // Blue to alpha for cd side + if(wOutputFlags & 0x40) { + printf(" | PS_COMBINEROUTPUT_CD_BLUE_TO_ALPHA"); // RGB only + (*bCD_BA)=TRUE; + } else (*bCD_BA)=FALSE; +} + +enum OpType +{ + OPTYPE_NOP = -1, + OPTYPE_MOV = 0, + OPTYPE_ADD, + OPTYPE_MUL, + OPTYPE_DP3, + OPTYPE_CND, +}; + +inline BOOL OptimizeOperation +( + char *szOp, + char *szOp1, + + char *szOp2, + char *szMod, + + char *szInputAB1, + char *szInputAB2, + + char *szInputCD1, + char *szInputCD2, + + char *szConstRegAB1, + char *szConstRegAB2, + char *szConstRegCD1, + char *szConstRegCD2, + + char *szOutAB, + char *szOutCD, + char *szABCDOutput, + + char *szCommand) +{ + printf("----------\nszOp: |%s|\nszOp1: |%s|\nszOp2: |%s|\nszMod: |%s|\n" + "szInputAB1: |%s|\nszInputAB2: |%s|\nszInputCD1: |%s|\nszInputCD2: |%s|\n" + "szOutAB: |%s|\nszOutCD: |%s|\nszABCDOutput: |%s|\n", + szOp, szOp1, szOp2, szMod, szInputAB1, szInputAB2, szInputCD1, szInputCD2, + szOutAB, szOutCD, szABCDOutput); + + char szABCDInput[2][10]; + szABCDInput[0][0]=0x00; + szABCDInput[1][0]=0x00; + + szCommand[0]=0x00; + + char *szOps[3]; + szOps[0] = szOp; + szOps[1] = szOp1; + szOps[2] = szOp2; + + char *szInputs[4]; + szInputs[0] = szInputAB1; + szInputs[1] = szInputAB2; + szInputs[2] = szInputCD1; + szInputs[3] = szInputCD2; + + char *szRealInputs[4]; + szRealInputs[0] = szConstRegAB1; + szRealInputs[1] = szConstRegAB2; + szRealInputs[2] = szConstRegCD1; + szRealInputs[3] = szConstRegCD2; + +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + char *szOutputs[3]; + szOutputs[0] = szOutAB; + szOutputs[1] = szOutCD; + szOutputs[2] = szABCDOutput; +#endif + + // TODO: check mov: other operations like lrp + // are ignored because of a shitty mul with 1 + BOOL bMov[3]={0, 0, 0}; + + int i=0; + for(i=0; i<2; i++) + { + //printf("szOps[i]: %s\n", szOps[i]); + //printf("szInputs[i*2+1]: %s\n", szInputs[i*2+1]); + if(strcmp(szOps[i], "mul")==0) + { + // If it is a mul, it can also be only a mov + if(strcmp(szInputs[i*2], "1")==0) { + //strcpy(szABCDInput[i], szInputs[i*2+1]); +#ifndef REVEL8N_PIXEL_SHADER_CHANGES + strcpy(szABCDInput[i], szRealInputs[i*2+1]); +#endif + + strcpy(szOps[i], "mov"); + + strcpy(szInputs[i*2], szInputs[i*2+1]); + strcpy(szRealInputs[i*2], szRealInputs[i*2+1]); + + strcpy(szInputs[i*2+1], ""); + strcpy(szRealInputs[i*2+1], ""); + + bMov[i]=TRUE; + + } else if(strcmp(szInputs[i*2+1], "1")==0) { + //strcpy(szABCDInput[i], szInputs[i*2]); +#ifndef REVEL8N_PIXEL_SHADER_CHANGES + strcpy(szABCDInput[i], szRealInputs[i*2]); +#endif + + strcpy(szOps[i], "mov"); + + strcpy(szInputs[i*2+1], ""); + strcpy(szRealInputs[i*2+1], ""); + + bMov[i]=TRUE; + } + } + } + +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + OpType eOpTypes[3] = {OPTYPE_NOP, OPTYPE_NOP, OPTYPE_NOP}; + for (i = 0; i < 3; ++i) + { + if (strcmp(szOps[i], "mov") == 0) + eOpTypes[i] = OPTYPE_MOV; + else if (strcmp(szOps[i], "add") == 0) + eOpTypes[i] = OPTYPE_ADD; + else if (strcmp(szOps[i], "mul") == 0) + eOpTypes[i] = OPTYPE_MUL; + else if (strcmp(szOps[i], "dp3") == 0) + eOpTypes[i] = OPTYPE_DP3; + else if (strcmp(szOps[i], "cnd") == 0) + eOpTypes[i] = OPTYPE_CND; + else + eOpTypes[i] = OPTYPE_NOP; + } + + bool bHandled = false; + int iOffset = 0; + int iOpCount = 0; + if (szOps[2][0] && szOutputs[2][0] && szOutputs[2][0] != 'v') + { + if (!szOutputs[0][0] && + !szOutputs[1][0]) + { + if (szMod[0]) + { + EmuLog(LOG_LEVEL::WARNING, "Destination modifier present!"); + } + switch (eOpTypes[2]) + { + case OPTYPE_ADD: + { + if (eOpTypes[0] == OPTYPE_MOV && + eOpTypes[1] == OPTYPE_MOV) + { + iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", + szMod, szOutputs[2], szRealInputs[0], szRealInputs[2]); + ++iOpCount; + bHandled = true; + } + else if (eOpTypes[0] == OPTYPE_MOV && + eOpTypes[1] == OPTYPE_MUL) + { + iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", + szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szRealInputs[0]); + bHandled = true; + ++iOpCount; + } + else if (eOpTypes[0] == OPTYPE_MUL && + eOpTypes[1] == OPTYPE_MOV) + { + iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", + szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szRealInputs[2]); + bHandled = true; + ++iOpCount; + } + else if (eOpTypes[0] == OPTYPE_MUL && + eOpTypes[1] == OPTYPE_MUL) + { + // nice, mul, mul, add can be converted to lrp + // lrp r0, t0, t1, c2 + // --> r0 = t0 * t1 + (1-t0) * c2 + // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op + // and that is not possible + + for(i=0; i<2; i++) + { + // To match the first option, the first input of the AB/CD op must inverted + BOOL bInvert[2] = {0, 0}; + if((szRealInputs[2*i][0] == '1') && (szRealInputs[2*i][1] == '-')) + //if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) + bInvert[0]=TRUE; + + if((szRealInputs[2*i+1][0] == '1') && (szRealInputs[2*i+1][1] == '-')) + //if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) + bInvert[1]=TRUE; + + //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); + //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); + + if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) + { + char szParam[3][10] = {0}; + char szRealParam0[10] = {0}; + if(bInvert[0]) + { + // copy over the not inverted param + strcpy(szParam[i+1], /*szInputs*/szRealInputs[2*i+1]); + + // and the inverted + strcpy(szParam[0], &szInputs[2*i][2]); + strcpy(szRealParam0, &szRealInputs[2*i][2]); + } + else if(bInvert[1]) + { + // copy over the not inverted param + strcpy(szParam[i+1], /*szInputs*/szRealInputs[2*i]); + + // and the inverted + strcpy(szParam[0], &szInputs[2*i+1][2]); + strcpy(szRealParam0, &szRealInputs[2*i+1][2]); + } + int iOtherOp = i == 0 ? 1 : 0; + + bHandled = true; + if (strcmp(szRealInputs[2*iOtherOp], szRealParam0/*szParam[0]*/)==0) + strcpy(szParam[iOtherOp+1], /*szInputs*/szRealInputs[2*iOtherOp+1]); + else if (strcmp(szRealInputs[2*iOtherOp+1], szRealParam0/*szParam[0]*/)==0) + strcpy(szParam[iOtherOp+1], /*szInputs*/szRealInputs[2*iOtherOp]); + else + bHandled = false; + if (bHandled) + { + // ok, we have it + iOffset += sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", + szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); + ++iOpCount; + break; + } + } + } + + if (!bHandled) + { + iOffset += sprintf(szCommand + iOffset, "mul r1, %s, %s\n", + szRealInputs[0], szRealInputs[1]); + ++iOpCount; + iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, r1\n", + szMod, szOutputs[2], szRealInputs[2], szRealInputs[3]); + ++iOpCount; + + bHandled = true; + } + } + } + break; + case OPTYPE_CND: + { + if (eOpTypes[0] == OPTYPE_MOV && + eOpTypes[1] == OPTYPE_MOV) + { + iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", + szMod, szOutputs[2], szRealInputs[2], szRealInputs[0]); + ++iOpCount; + bHandled = true; + } + else if (eOpTypes[0] == OPTYPE_MUL && + eOpTypes[1] == OPTYPE_MUL) + { + if (szOutputs[2][0] != 'r') + { + EmuLog(LOG_LEVEL::WARNING, "Destination not temporary register!"); + } + // ab input + iOffset += sprintf(szCommand + iOffset, "mul%s r1, %s, %s\n", + szMod, szRealInputs[0], szRealInputs[1]); + ++iOpCount; + // cd input + iOffset += sprintf(szCommand + iOffset, "mul%s r0, %s, %s\n", + szMod, szRealInputs[2], szRealInputs[3]); + ++iOpCount; + // abcd output + iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, r0, r1\n", + szMod, szOutputs[2]); + ++iOpCount; + bHandled = true; + } + } + break; + } + if (!bHandled && strcmp(szOps[2], "add") == 0) + { + if ((strcmp(szOps[0], "mov")==0)) + { + if ((strcmp(szOps[1], "mul")==0)) + { + char szParam[10]="\0"; + + if(strcmp(szInputCD1, "-1")==0) + strcpy(szParam, szInputCD2); + else if(strcmp(szInputCD2, "-1")==0) + strcpy(szParam, szInputCD1); + + if(szParam[0] && szConstRegAB1[0] && szABCDOutput[0]) + { + iOffset += sprintf(szCommand, "sub%s %s, %s, %s\n", + szMod, szABCDOutput, szConstRegAB1, szParam); + bHandled = true; + ++iOpCount; + } +// else +// { +// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", +// szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szRealInputs[0]); +// bHandled = true; +// ++iOpCount; +// } + } + } +// else if ((strcmp(szOps[0], "mul")==0)) +// { +// if ((strcmp(szOps[1], "mov")==0)) +// { +// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", +// szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szRealInputs[2]); +// bHandled = true; +// ++iOpCount; +// } +// else if ((strcmp(szOps[1], "mul")==0)) +// { +// // nice, mul, mul, add can be converted to lrp +// // lrp r0, t0, t1, c2 +// // --> r0 = t0 * t1 + (1-t0) * c2 +// // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op +// // and that is not possible +// +// for(i=0; i<2; i++) +// { +// // To match the first option, the first input of the AB/CD op must inverted +// BOOL bInvert[2] = {0, 0}; +// if((szRealInputs[2*i][0] == '1') && (szRealInputs[2*i][1] == '-')) +// //if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) +// bInvert[0]=TRUE; +// +// if((szRealInputs[2*i+1][0] == '1') && (szRealInputs[2*i+1][1] == '-')) +// //if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) +// bInvert[1]=TRUE; +// +// //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); +// //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); +// +// if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) +// { +// char szParam[3][10]; +// char szRealParam0[10]; +// if(bInvert[0]) +// { +// // copy over the not inverted param +// strcpy(szParam[2], /*szInputs*/szRealInputs[2*i+1]); +// +// // and the inverted +// strcpy(szParam[0], &szInputs[2*i][2]); +// strcpy(szRealParam0, &szRealInputs[2*i][2]); +// } +// else if(bInvert[1]) +// { +// // copy over the not inverted param +// strcpy(szParam[2], /*szInputs*/szRealInputs[2*i]); +// +// // and the inverted +// strcpy(szParam[0], &szInputs[2*i+1][2]); +// strcpy(szRealParam0, &szRealInputs[2*i+1][2]); +// } +// int iOtherOp = i == 0 ? 1 : 0; +// +// bHandled = true; +// if (strcmp(szRealInputs[2*iOtherOp], szRealParam0/*szParam[0]*/)==0) +// strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp+1]); +// else if (strcmp(szRealInputs[2*iOtherOp+1], szRealParam0/*szParam[0]*/)==0) +// strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp]); +// else +// bHandled = false; +// if (bHandled) +// { +// // ok, we have it +// iOffset += sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", +// szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); +// ++iOpCount; +// break; +// } +// } +// } +// +// if (!bHandled) +// { +// iOffset += sprintf(szCommand + iOffset, "mul r1, %s, %s\n", +// szRealInputs[0], szRealInputs[1]); +// ++iOpCount; +// iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, r1\n", +// szMod, szOutputs[2], szRealInputs[2], szRealInputs[3]); +// ++iOpCount; +// +// bHandled = true; +// } +// } +// } + } + } + } + + if (!bHandled) + { + for (i = 0; i < 2; ++i) + { + if (szOps[i][0] && szOutputs[i][0] && szOutputs[i][0] != 'v') + { + ++iOpCount; + // copy output value to final input + strcpy(szABCDInput[i], szOutputs[i]); + // insert command + iOffset += sprintf(szCommand + iOffset, "%s%s %s, %s\n", szOps[i], szMod, szOutputs[i], szRealInputs[i * 2 + 0]); + + // if there are more parameters... + if (szRealInputs[i * 2 + 1][0]) + { + // backspace of the newline character + --iOffset; + // insert remaining parameters + iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[i * 2 + 1]); + } + bHandled = true; + } + } + +// if (szOutputs[2][0]) +// { +// if(!szOutputs[1][0]) +// strcpy(szOutputs[1], "r0"); +// if(!szOutputs[0][0]) +// strcpy(szOutputs[0], "r1"); +// } + + if (szOps[2][0] && szOutputs[2][0] && szOutputs[2][0] != 'v') + { + switch (eOpTypes[2]) + { + case OPTYPE_ADD: + { + if (szABCDInput[0][0] && + szABCDInput[1][0]) + { + iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", + szMod, szOutputs[2], szABCDInput[0], szABCDInput[1]); + ++iOpCount; + bHandled = true; + } + else if (szABCDInput[0][0] && + !szABCDInput[1][0]) + { + switch (eOpTypes[1]) + { + case OPTYPE_MUL: + { + iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", + szMod, szOutputs[2], szRealInputs[2], szRealInputs[3], szABCDInput[0]); + ++iOpCount; + bHandled = true; + } + break; + case OPTYPE_DP3: + { + { + ++iOpCount; + // insert command + iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[1], szMod, szRealInputs[2]); + + // if there are more parameters... + if (szRealInputs[3][0]) + { + // backspace of the newline character + --iOffset; + // insert remaining parameters + iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[3]); + } + } + { + iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, r1\n", + szMod, szOutputs[2], szABCDInput[0]); + ++iOpCount; + bHandled = true; + } + } + break; + default: + break; + } + } + else if (!szABCDInput[0][0] && + szABCDInput[1][0]) + { + switch (eOpTypes[0]) + { + case OPTYPE_MUL: + { + iOffset += sprintf(szCommand + iOffset, "mad%s %s, %s, %s, %s\n", + szMod, szOutputs[2], szRealInputs[0], szRealInputs[1], szABCDInput[1]); + ++iOpCount; + bHandled = true; + } + break; + case OPTYPE_DP3: + { + { + ++iOpCount; + // insert command + iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[0], szMod, szRealInputs[0]); + + // if there are more parameters... + if (szRealInputs[1][0]) + { + // backspace of the newline character + --iOffset; + // insert remaining parameters + iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[1]); + } + } + { + iOffset += sprintf(szCommand + iOffset, "add%s %s, r1, %s\n", + szMod, szOutputs[2], szABCDInput[1]); + ++iOpCount; + bHandled = true; + } + } + break; + default: + break; + } + } + } + break; + case OPTYPE_CND: + { + if (szABCDInput[0][0] && + szABCDInput[1][0]) + { + iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", + szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); + ++iOpCount; + bHandled = true; + } + else if (szABCDInput[0][0] && + !szABCDInput[1][0]) + { + { + ++iOpCount; + // insert command + iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[1], szMod, szRealInputs[2]); + + // if there are more parameters... + if (szRealInputs[3][0]) + { + // backspace of the newline character + --iOffset; + // insert remaining parameters + iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[3]); + } + } + { + iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, r1, %s\n", + szMod, szOutputs[2], szABCDInput[0]); + ++iOpCount; + bHandled = true; + } + } + else if (!szABCDInput[0][0] && + szABCDInput[1][0]) + { + { + ++iOpCount; + // insert command + iOffset += sprintf(szCommand + iOffset, "%s%s r1, %s\n", szOps[0], szMod, szRealInputs[0]); + + // if there are more parameters... + if (szRealInputs[1][0]) + { + // backspace of the newline character + --iOffset; + // insert remaining parameters + iOffset += sprintf(szCommand + iOffset, ", %s\n", szRealInputs[1]); + } + } + { + iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, r1\n", + szMod, szOutputs[2], szABCDInput[1]); + ++iOpCount; + bHandled = true; + } + } + } + break; + } + if (!bHandled) + { + EmuLog(LOG_LEVEL::WARNING, "Unhandled pixel shader instruction!"); + } +// if (strcmp(szOps[2], "add") == 0) +// { +// if (szABCDInput[0][0] && +// szABCDInput[1][0]) +// { +// iOffset += sprintf(szCommand + iOffset, "add%s %s, %s, %s\n", +// szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); +// ++iOpCount; +// bHandled = true; +// } +// else +// { +// EmuLog(LOG_LEVEL::WARNING, "Unhandled pixel shader instruction!"); +// } +// } +// else if (strcmp(szOps[2], "cnd") == 0) +// { +// if (szABCDInput[0][0] && +// szABCDInput[1][0]) +// { +// iOffset += sprintf(szCommand + iOffset, "cnd%s %s, r0.a, %s, %s\n", +// szMod, szOutputs[2], szABCDInput[1], szABCDInput[0]); +// ++iOpCount; +// bHandled = true; +// } +// else +// { +// EmuLog(LOG_LEVEL::WARNING, "Unhandled pixel shader instruction!"); +// } +// } +// else +// { +// EmuLog(LOG_LEVEL::WARNING, "Unhandled pixel shader instruction!"); +// } + } + } + + if(szCommand[0]) + printf("new command:\n%s\n", szCommand); + return (bHandled && (iOpCount == 1)) ? (TRUE) : (FALSE); +#endif + + if( + (strcmp(szOp, "mul")==0) && + (strcmp(szOp1, "mov")==0) && //bMov[1] && + (strcmp(szOp2, "add")==0) && + szABCDOutput[0]) + { + sprintf(szCommand, "mad%s %s, %s, %s, %s\n", + szMod, szABCDOutput, + /*szInput*/szConstRegAB1, + /*szInput*/szConstRegAB2, + /*szInput*/szConstRegCD1 /*because it's a mov now*/); + } + else if( + (strcmp(szOp, "mul")==0) && + (strcmp(szOp1, "mul")==0) && + (strcmp(szOp2, "add")==0) && + szABCDOutput[0]) // TODO: check that strange lrp/ABCDOutput[0]=0 case + { + // nice, mul, mul, add can be converted to lrp + // lrp r0, t0, t1, c2 + // --> r0 = t0 * t1 + (1-t0) * c2 + // or r0 = c2 + t0 * (t1 - c2), but that would mean we have to mul in the ABCD op + // and that is not possible + + for(i=0; i<2; i++) + { + // To match the first option, the first input of the AB/CD op must inverted + BOOL bInvert[2] = {0, 0}; + if((szInputs[2*i][0] == '1') && (szInputs[2*i][1] == '-')) + bInvert[0]=TRUE; + + if((szInputs[2*i+1][0] == '1') && (szInputs[2*i+1][1] == '-')) + bInvert[1]=TRUE; + + //printf("szInputs[2*i]: %s\nszInputs[2*i+1]: %s\n", szInputs[2*i], szInputs[2*i+1]); + //printf("bInvert[0]: %d\nbInvert[1]: %d\n", bInvert[0], bInvert[1]); + + if((bInvert[0] || bInvert[1]) && (!(bInvert[0] && bInvert[1]))) + { + char szParam[3][10]; + char szRealParam0[10]; + if(bInvert[0]) + { + // copy over the not inverted param + strcpy(szParam[2], /*szInputs*/szRealInputs[2*i+1]); + + // and the inverted + strcpy(szParam[0], &szInputs[2*i][2]); + strcpy(szRealParam0, &szRealInputs[2*i][2]); + } + else if(bInvert[1]) + { + // copy over the not inverted param + strcpy(szParam[2], /*szInputs*/szRealInputs[2*i]); + + // and the inverted + strcpy(szParam[0], &szInputs[2*i+1][2]); + strcpy(szRealParam0, &szRealInputs[2*i+1][2]); + } + int iOtherOp = i == 0 ? 1 : 0; + + if(strcmp(szInputs[2*iOtherOp], szParam[0])==0) + strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp+1]); + else + strcpy(szParam[1], /*szInputs*/szRealInputs[2*iOtherOp]); + // ok, we have it + sprintf(szCommand, "lrp%s %s, %s, %s, %s\n", + szMod, szABCDOutput, szRealParam0/*szParam[0]*/, szParam[1], szParam[2]); + + break; + } + } + } else if(strcmp(szOp2, "cnd")==0) { +#ifdef REVEL8N_PIXEL_SHADER_CHANGES + iOffset = 0; + i = 0; + for (i = 0; i < 2; ++i) + { + if (strcmp(szOps[i], "mul")==0) + { + strcpy(szABCDInput[i], szOutputs[i]); + iOffset += sprintf(szCommand + iOffset, "mul %s, %s, %s\n", szOutputs[i], szRealInputs[i * 2 + 0], szRealInputs[i * 2 + 1]); + } + } + sprintf(szCommand + iOffset, "cnd%s %s, %s, %s, %s\n", + szMod, szABCDOutput, "r0.a", szABCDInput[1], szABCDInput[0]); +#else + sprintf(szCommand, "cnd%s %s, %s, %s, %s\n", + szMod, szABCDOutput, "r0.a", szABCDInput[1], szABCDInput[0]); +#endif + + bMov[1]=0; + bMov[0]=0; + } else if( + (strcmp(szOp, "mov")==0) && + (strcmp(szOp1, "mul")==0) && + (strcmp(szOp2, "add")==0)) + { + char szParam[10]="\0"; + + if(strcmp(szInputCD1, "-1")==0) + strcpy(szParam, szInputCD2); + else if(strcmp(szInputCD2, "-1")==0) + strcpy(szParam, szInputCD1); + + if(szParam[0] && szConstRegAB1[0] && szABCDOutput[0]) + { + sprintf(szCommand, "sub%s %s, %s, %s\n", + szMod, szABCDOutput, szConstRegAB1, szParam); + } + + } +//do_operation_with_new_input: + + if(bMov[0] && bMov[1] && szABCDOutput[0]) { + sprintf(szCommand, "%s%s %s, %s, %s\n", szOp2, szMod, szABCDOutput, szABCDInput[0], szABCDInput[1]); + } + + if(szCommand[0]) + printf("new command: %s", szCommand); + return TRUE; +} + +float fConstants[20] = {0.0f}; +int iConstants[20] = {0}; +int iConstCount=0; + +inline void ClearConstRegVars() +{ + iConstCount=0; + memset(fConstants, 0x00, 20*sizeof(float)); + memset(iConstants, 0x00, 20*sizeof(int)); +} + +inline void CorrectConstToReg(char *szConst, int *pPSC0, int *pPSC1) +{ + printf("Looking for %s\n", szConst); + float fConst = (float)atof(szConst); + + // check whether we already saved it + int i=0; + for(i=0; iPSAlphaInputs[0], pPSDef->PSAlphaInputs[1], pPSDef->PSAlphaInputs[2], pPSDef->PSAlphaInputs[3], + pPSDef->PSAlphaInputs[4], pPSDef->PSAlphaInputs[5], pPSDef->PSAlphaInputs[6], pPSDef->PSAlphaInputs[7], + pPSDef->PSFinalCombinerInputsABCD, + pPSDef->PSFinalCombinerInputsEFG, + pPSDef->PSConstant0[0], pPSDef->PSConstant0[1], pPSDef->PSConstant0[2], pPSDef->PSConstant0[3], + pPSDef->PSConstant0[4], pPSDef->PSConstant0[5], pPSDef->PSConstant0[6], pPSDef->PSConstant0[7], + pPSDef->PSConstant1[0], pPSDef->PSConstant1[1], pPSDef->PSConstant1[2], pPSDef->PSConstant1[3], + pPSDef->PSConstant1[4], pPSDef->PSConstant1[5], pPSDef->PSConstant1[6], pPSDef->PSConstant1[7], + pPSDef->PSAlphaOutputs[0], pPSDef->PSAlphaOutputs[1], pPSDef->PSAlphaOutputs[2], pPSDef->PSAlphaOutputs[3], + pPSDef->PSAlphaOutputs[4], pPSDef->PSAlphaOutputs[5], pPSDef->PSAlphaOutputs[6], pPSDef->PSAlphaOutputs[7], + pPSDef->PSRGBInputs[0], pPSDef->PSRGBInputs[1], pPSDef->PSRGBInputs[2], pPSDef->PSRGBInputs[3], + pPSDef->PSRGBInputs[4], pPSDef->PSRGBInputs[5], pPSDef->PSRGBInputs[6], pPSDef->PSRGBInputs[7], + pPSDef->PSCompareMode, + pPSDef->PSFinalCombinerConstant0, + pPSDef->PSFinalCombinerConstant1, + pPSDef->PSRGBOutputs[0], pPSDef->PSRGBOutputs[1], pPSDef->PSRGBOutputs[2], pPSDef->PSRGBOutputs[3], + pPSDef->PSRGBOutputs[4], pPSDef->PSRGBOutputs[5], pPSDef->PSRGBOutputs[6], pPSDef->PSRGBOutputs[7], + pPSDef->PSCombinerCount, + XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES), /* pPSDef->PSTextureModes is stored in a different place than pPSDef*/ + pPSDef->PSDotMapping, + pPSDef->PSInputTexture, + pPSDef->PSC0Mapping, + pPSDef->PSC1Mapping, + pPSDef->PSFinalCombinerConstants ); + if (pszCode) + { + fprintf(out, "\n\n%s\n", pszCode); + } + + fclose( out ); + } +} + +// print relevant contents to the debug console +void PrintPixelShaderDefContents(XTL::X_D3DPIXELSHADERDEF* pPSDef ) +{ + // Show the contents to the user + if( pPSDef ) + { + DbgPshPrintf( "\n-----PixelShader Def Contents-----\n" ); + + if(XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES)) + { + DWORD dwPSTexMode0 = (XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) >> 0 ) & 0x1F; + DWORD dwPSTexMode1 = (XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) >> 5 ) & 0x1F; + DWORD dwPSTexMode2 = (XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) >> 10 ) & 0x1F; + DWORD dwPSTexMode3 = (XboxRenderStates.GetXboxRenderState(XTL::X_D3DRS_PSTEXTUREMODES) >> 15 ) & 0x1F; + + DbgPshPrintf( "PSTextureModes ->\n" ); + DbgPshPrintf( "Stage 0: %s\n", PS_TextureModesStr[dwPSTexMode0] ); + DbgPshPrintf( "Stage 1: %s\n", PS_TextureModesStr[dwPSTexMode1] ); + DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSTexMode2] ); + DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSTexMode3] ); + } + + if( pPSDef->PSDotMapping ) + { + DWORD dwPSDMStage1 = ( pPSDef->PSDotMapping >> 0 ) & 0x7; + DWORD dwPSDMStage2 = ( pPSDef->PSDotMapping >> 4 ) & 0x7; + DWORD dwPSDMStage3 = ( pPSDef->PSDotMapping >> 8 ) & 0x7; + + DbgPshPrintf( "PSDotMapping ->\n" ); + DbgPshPrintf( "Stage 1: %s\n", PS_DotMappingStr[dwPSDMStage1] ); + DbgPshPrintf( "Stage 2: %s\n", PS_DotMappingStr[dwPSDMStage2] ); + DbgPshPrintf( "Stage 3: %s\n", PS_DotMappingStr[dwPSDMStage3] ); + } + + if( pPSDef->PSCompareMode ) + { + DWORD dwPSCMStage0 = ( pPSDef->PSCompareMode >> 0 ) & 0xF; + DWORD dwPSCMStage1 = ( pPSDef->PSCompareMode >> 4 ) & 0xF; + DWORD dwPSCMStage2 = ( pPSDef->PSCompareMode >> 8 ) & 0xF; + DWORD dwPSCMStage3 = ( pPSDef->PSCompareMode >> 12 ) & 0xF; + + DbgPshPrintf( "PSCompareMode ->\n" ); + DbgPshPrintf( "Stage 0: %s\n", PS_TextureModesStr[dwPSCMStage0 == 0 ? 0 : 1] ); + DbgPshPrintf( "Stage 1: %s\n", PS_TextureModesStr[dwPSCMStage1 == 0 ? 2 : 3] ); + DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSCMStage2 == 0 ? 4 : 5] ); + DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSCMStage3 == 0 ? 6 : 7] ); + } + + if( pPSDef->PSInputTexture ) + { + DWORD dwPSITStage2 = ( pPSDef->PSInputTexture >> 16 ) & 0x1; + DWORD dwPSITStage3 = ( pPSDef->PSInputTexture >> 20 ) & 0x3; + + DbgPshPrintf( "PSInputTexture ->\n" ); + DbgPshPrintf( "Stage 2: %s\n", PS_TextureModesStr[dwPSITStage2] ); + DbgPshPrintf( "Stage 3: %s\n", PS_TextureModesStr[dwPSITStage3] ); + } + + if( pPSDef->PSCombinerCount ) + { + DWORD dwPSCCNumCombiners = ( pPSDef->PSCombinerCount >> 0 ) & 0xF; + DWORD dwPSCCMux = ( pPSDef->PSCombinerCount >> 8 ) & 0x1; + DWORD dwPSCCC0 = ( pPSDef->PSCombinerCount >> 12 ) & 0x1; + DWORD dwPSCCC1 = ( pPSDef->PSCombinerCount >> 16 ) & 0x1; + + DbgPshPrintf( "PSCombinerCount ->\n" ); + DbgPshPrintf( "Combiners: %d\n", dwPSCCNumCombiners ); + DbgPshPrintf( "Mux: %s\n", PS_CombinerCountFlagsStr[dwPSCCMux] ); + DbgPshPrintf( "C0: %s\n", PS_CombinerCountFlagsStr[dwPSCCC0 == 0 ? 2 : 3] ); + DbgPshPrintf( "C1: %s\n", PS_CombinerCountFlagsStr[dwPSCCC1 == 0 ? 4 : 5] ); + } + + /*for( int i = 0; i > 7; i++ ) + { + if( pPSDef->PSRGBInputs[i] ) + {*/ + } +} diff --git a/src/Cxbx/DlgControllerConfig.h b/src/core/hle/D3D8/XbPixelShader.h similarity index 65% rename from src/Cxbx/DlgControllerConfig.h rename to src/core/hle/D3D8/XbPixelShader.h index 6c47c25d1..856f96f03 100644 --- a/src/Cxbx/DlgControllerConfig.h +++ b/src/core/hle/D3D8/XbPixelShader.h @@ -1,42 +1,40 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.h -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them under the terms of the GNU General Public -// * License as published by the Free Software Foundation; either -// * version 2 of the license, or (at your option) any later version. -// * -// * This program is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// * GNU General Public License for more details. -// * -// * You should have recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** -#ifndef DLGCONTROLLERCONFIG_H -#define DLGCONTROLLERCONFIG_H - -#include - -/*! show controller configuration dialog */ -extern VOID ShowControllerConfig(HWND hwnd); - -#endif +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XBPIXELSHADER_H +#define XBPIXELSHADER_H + +#include "Cxbx.h" + +#include "core\hle\D3D8\XbD3D8Types.h" + +// dump pixel shader definition to file +void DumpPixelShaderDefToFile( XTL::X_D3DPIXELSHADERDEF* pPSDef, const char* pszCode ); +// print relevant contents to the debug console +void PrintPixelShaderDefContents(XTL::X_D3DPIXELSHADERDEF* pDSDef ); + +// PatrickvL's Dxbx pixel shader translation +VOID DxbxUpdateActivePixelShader(); // NOPATCH + +#endif // PIXELSHADER_H diff --git a/src/CxbxKrnl/EmuD3D8/PushBuffer.cpp b/src/core/hle/D3D8/XbPushBuffer.cpp similarity index 62% rename from src/CxbxKrnl/EmuD3D8/PushBuffer.cpp rename to src/core/hle/D3D8/XbPushBuffer.cpp index 3467b93f6..ca91cdc4b 100644 --- a/src/CxbxKrnl/EmuD3D8/PushBuffer.cpp +++ b/src/core/hle/D3D8/XbPushBuffer.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D->PushBuffer.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,25 +24,23 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "PSHB" +#define LOG_PREFIX CXBXR_MODULE::PSHB #include // For assert() -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuXTL.h" -#include "CxbxKrnl/EmuD3D8Types.h" // For X_D3DFORMAT -#include "CxbxKrnl/ResourceTracker.h" -#include "devices/video/nv2a.h" // For PGRAPHState +#include "core\kernel\support\Emu.h" +#include "core\hle\D3D8\XbD3D8Types.h" // For X_D3DFORMAT +#include "core\hle\D3D8\ResourceTracker.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For g_Xbox_VertexShader_Handle +#include "core\hle\D3D8\XbPushBuffer.h" +#include "core\hle\D3D8\XbConvert.h" +#include "devices/video/nv2a.h" // For g_NV2A, PGRAPHState #include "devices/video/nv2a_int.h" // For NV** defines #include "Logging.h" // TODO: Find somewhere to put this that doesn't conflict with XTL:: extern void EmuUpdateActiveTextureStages(); -#ifdef CXBX_USE_D3D9 -extern DWORD g_XboxBaseVertexIndex; -#endif const char *NV2AMethodToString(DWORD dwMethod); // forward @@ -59,7 +48,7 @@ static void DbgDumpMesh(WORD *pIndexData, DWORD dwCount); // Determine the size (in number of floating point texture coordinates) of the texture format (indexed 0 .. 3). // This is the reverse of the D3DFVF_TEXCOORDSIZE[0..3] macros. -int XTL::DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex) +int DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex) { // See D3DFVF_TEXCOORDSIZE1() switch ((dwFVF >> ((aTextureIndex * 2) + 16)) & 3) { @@ -75,7 +64,7 @@ int XTL::DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex) // Dxbx Note: This code appeared in EmuExecutePushBufferRaw and occured // in EmuFlushIVB too, so it's generalize in this single implementation. -UINT XTL::DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures) +UINT DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures) { /* X_D3DFVF_POSITION_MASK = $00E; // Dec /2 #fl @@ -109,11 +98,11 @@ UINT XTL::DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures) } if (dwFVF & D3DFVF_DIFFUSE) { - Result += sizeof(XTL::D3DCOLOR); + Result += sizeof(D3DCOLOR); } if (dwFVF & D3DFVF_SPECULAR) { - Result += sizeof(XTL::D3DCOLOR); + Result += sizeof(D3DCOLOR); } if (bIncludeTextures) { @@ -127,14 +116,14 @@ UINT XTL::DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures) return Result; } -void XTL::EmuExecutePushBuffer +void EmuExecutePushBuffer ( - X_D3DPushBuffer *pPushBuffer, - X_D3DFixup *pFixup + XTL::X_D3DPushBuffer *pPushBuffer, + XTL::X_D3DFixup *pFixup ) { //Check whether Fixup exists or not. - if (pFixup != NULL) { + if (pFixup != xbnullptr) { LOG_TEST_CASE("PushBuffer has fixups"); //Interpret address of PushBuffer Data and Fixup Data UINT8* pPushBufferData = (UINT8*)pPushBuffer->Data; @@ -175,8 +164,6 @@ void XTL::EmuExecutePushBuffer DWORD CxbxGetStrideFromVertexShaderHandle(DWORD dwVertexShader) { - using namespace XTL; - DWORD Stride = 0; if (VshHandleIsVertexShader(dwVertexShader)) { @@ -191,11 +178,11 @@ DWORD CxbxGetStrideFromVertexShaderHandle(DWORD dwVertexShader) // Test-case : SpyHunter 2 [4D57001B] //LOG_TEST_CASE("Non-FVF Vertex Shaders not yet (completely) supported for PushBuffer emulation!"); - CxbxVertexShader *pVertexShader = MapXboxVertexShaderHandleToCxbxVertexShader(dwVertexShader); - if (pVertexShader) { - if (pVertexShader->VertexShaderInfo.NumberOfVertexStreams == 1) { + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(dwVertexShader); + if (pCxbxVertexShader) { + if (pCxbxVertexShader->VertexShaderInfo.NumberOfVertexStreams == 1) { // Note : This assumes that the only stream in use will be stream zero : - Stride = pVertexShader->VertexShaderInfo.VertexStreams[0].HostVertexStride; + Stride = pCxbxVertexShader->VertexShaderInfo.VertexStreams[0].HostVertexStride; } else { LOG_TEST_CASE("Non-FVF Vertex Shaders with multiple streams not supported for PushBuffer emulation!"); @@ -214,274 +201,199 @@ DWORD CxbxGetStrideFromVertexShaderHandle(DWORD dwVertexShader) return Stride; } -PGRAPHState pgraph_state = {}; // global, as inside a function it crashes (during initalization?) +void HLE_draw_arrays(NV2AState *d) +{ + // PGRAPHState *pg = &d->pgraph; -void HLE_pgraph_handle_method( - PGRAPHState *pg, // compatiblity, instead of NV2AState *d, + LOG_TEST_CASE("HLE_draw_arrays"); + + LOG_UNIMPLEMENTED(); // TODO : Implement HLE_draw_arrays +} + +void HLE_draw_inline_buffer(NV2AState *d) +{ + // PGRAPHState *pg = &d->pgraph; + + LOG_TEST_CASE("HLE_draw_inline_buffer"); + + LOG_UNIMPLEMENTED(); // TODO : Implement HLE_draw_inline_buffer +} + +void HLE_draw_inline_array(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + //DWORD vertex data array, + // To be used as a replacement for DrawVerticesUP, the caller needs to set the vertex format using IDirect3DDevice8::SetVertexShader before calling BeginPush. + // All attributes in the vertex format must be padded DWORD multiples, and the vertex attributes must be specified in the canonical FVF ordering + // (position followed by weight, normal, diffuse, and so on). + // retrieve vertex shader + if (g_Xbox_VertexShader_Handle == 0) { + LOG_TEST_CASE("FVF Vertex Shader is null"); + } + // render vertices + else { + DWORD dwVertexStride = CxbxGetStrideFromVertexShaderHandle(g_Xbox_VertexShader_Handle); + if (dwVertexStride > 0) { + UINT VertexCount = (pg->inline_array_length * sizeof(DWORD)) / dwVertexStride; + CxbxDrawContext DrawContext = {}; + + DrawContext.XboxPrimitiveType = (XTL::X_D3DPRIMITIVETYPE)pg->primitive_mode; + DrawContext.dwVertexCount = VertexCount; + DrawContext.pXboxVertexStreamZeroData = pg->inline_array; + DrawContext.uiXboxVertexStreamZeroStride = dwVertexStride; + + CxbxDrawPrimitiveUP(DrawContext); + } + } +} + +void HLE_draw_inline_elements(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + if (IsValidCurrentShader()) { + unsigned int uiIndexCount = pg->inline_elements_length; + CxbxDrawContext DrawContext = {}; + + DrawContext.XboxPrimitiveType = (XTL::X_D3DPRIMITIVETYPE)pg->primitive_mode; + DrawContext.dwVertexCount = uiIndexCount; + DrawContext.pXboxIndexData = d->pgraph.inline_elements; + + CxbxDrawIndexed(DrawContext); + } +} + +DWORD ABGR_to_ARGB(const uint32_t color) +{ + return (color & 0xFF00FF00) | ((color & 0x00FF0000) >> 16) | ((color & 0x000000FF) << 16); +} + +void HLE_draw_state_update(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + CxbxUpdateNativeD3DResources(); + + HRESULT hRet; + +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGENABLE, xtBOOL); // NV2A_FOG_ENABLE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGTABLEMODE, xtD3DFOGMODE); // NV2A_FOG_MODE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGSTART, xtFloat); // NV2A_FOG_COORD_DIST +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGEND, xtFloat); // NV2A_FOG_MODE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGDENSITY, xtFloat); // NV2A_FOG_EQUATION_CONSTANT / NV2A_FOG_EQUATION_LINEAR / NV2A_FOG_EQUATION_QUADRATIC + // NV2A_FOG_PLANE? + // NV2A_SET_LINEAR_FOG_CONST? +// hRet = g_pD3DDevice->SetRenderState(D3DRS_RANGEFOGENABLE, xtBOOL); // NV2A_FOG_COORD_DIST + // Unused : D3DRS_FOGVERTEXMODE + + uint32_t fog_color = pg->regs[NV_PGRAPH_FOGCOLOR]; + hRet = g_pD3DDevice->SetRenderState(D3DRS_FOGCOLOR, ABGR_to_ARGB(fog_color)); // NV2A_FOG_COLOR + +// Hint : see DxbxRenderStateInfo table for all known Xbox states, their data type and NV2A method +// Also, see D3DDevice_SetRenderState_Simple call EmuXB2PC_* conversion functions for some render states + +// hRet = g_pD3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, xtBool); // NV2A_NORMALIZE_ENABLE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_TEXTUREFACTOR, xtD3DCOLOR); // NV2A_RC_CONSTANT_COLOR0(0) NV_PGRAPH_COMBINEFACTOR0 +// hRet = g_pD3DDevice->SetRenderState(D3DRS_DEPTHBIAS, xtFloat); // NV2A_POLYGON_OFFSET_FACTOR, NV2A_POLYGON_OFFSET_UNITS, NV2A_POLYGON_OFFSET_POINT_ENABLE, NV2A_POLYGON_OFFSET_LINE_ENABLE, NV2A_POLYGON_OFFSET_FILL_ENABLE, XB2PC conversion needed +// hRet = g_pD3DDevice->SetRenderState(D3DRS_ANTIALIASEDLINEENABLE, xtBool); // Was D3DRS_EDGEANTIALIAS, corresponds to NV2A_LINE_SMOOTH_ENABLE and NV2A_POLYGON_SMOOTH_ENABLE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_FILLMODE, dwFillMode); // NV2A_POLYGON_MODE_FRONT, EmuXB2PC_* conversion needed +// hRet = g_pD3DDevice->SetRenderState(D3DRS_VERTEXBLEND, Value); // NV2A_SKIN_MODE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, Value); // NV2A_CULL_FACE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILFAIL, Value); // NV2A_STENCIL_OP_FAIL +// hRet = g_pD3DDevice->SetRenderState(D3DRS_ZENABLE, Value); // NV2A_DEPTH_TEST_ENABLE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_STENCILENABLE, Value); // NV2A_STENCIL_ENABLE +// hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, Value); // NV2A_MULTISAMPLE_CONTROL +// hRet = g_pD3DDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, Value); // NV2A_MULTISAMPLE_CONTROL +// hRet = g_pD3DDevice->SetRenderState(D3DRS_WRAP0, dwConv); // NV2A_TX_WRAP(0), EmuXB2PC_* conversion needed +// hRet = g_pD3DDevice->SetRenderState(D3DRS_WRAP1, dwConv); // NV2A_TX_WRAP(1), EmuXB2PC_* conversion needed + +// g_pD3DDevice->SetRenderState(D3DRS_LINEPATTERN, Value); // NV2A_POLYGON_STIPPLE_PATTERN? Seems unused in Xbox + + LOG_INCOMPLETE(); // TODO : Read state from pgraph, convert to D3D +} + +void HLE_draw_clear(NV2AState *d) +{ + // PGRAPHState *pg = &d->pgraph; + + CxbxUpdateNativeD3DResources(); + + LOG_INCOMPLETE(); // TODO : Read state from pgraph, convert to D3D (call EMUPATCH(D3DDevice_Clear)?) +} + +// Import pgraph_draw_* variables, declared in EmuNV2A_PGRAPH.cpp : +extern void(*pgraph_draw_arrays)(NV2AState *d); +extern void(*pgraph_draw_inline_buffer)(NV2AState *d); +extern void(*pgraph_draw_inline_array)(NV2AState *d); +extern void(*pgraph_draw_inline_elements)(NV2AState *d); +extern void(*pgraph_draw_state_update)(NV2AState *d); +extern void(*pgraph_draw_clear)(NV2AState *d); + +void HLE_init_pgraph_plugins() +{ + /* attach HLE Direct3D render plugins */ + pgraph_draw_arrays = HLE_draw_arrays; + pgraph_draw_inline_buffer = HLE_draw_inline_buffer; + pgraph_draw_inline_array = HLE_draw_inline_array; + pgraph_draw_inline_elements = HLE_draw_inline_elements; + pgraph_draw_state_update = HLE_draw_state_update; + pgraph_draw_clear = HLE_draw_clear; +} + +extern void pgraph_handle_method( + NV2AState *d, unsigned int subchannel, unsigned int method, - uint32_t parameter) + uint32_t parameter); + +// LLE NV2A +extern NV2ADevice* g_NV2A; + +uint32_t HLE_read_NV2A_pgraph_register(const int reg) { - using namespace XTL; + NV2AState* dev = g_NV2A->GetDeviceState(); + PGRAPHState *pg = &(dev->pgraph); + return pg->regs[reg]; +} - LOG_INIT // Allows use of DEBUG_D3DRESULT +void HLE_write_NV2A_vertex_attribute_slot(unsigned slot, uint32_t parameter) +{ + // Write value to LLE NV2A device + pgraph_handle_method(g_NV2A->GetDeviceState(), + /*subchannel=*/0, + /*method=*/NV097_SET_VERTEX_DATA4UB + (4 * slot), + parameter); +} - // Skip all commands not intended for channel 0 (3D) - if (subchannel > 0) { - LOG_TEST_CASE("Pushbuffer subchannel > 0"); - return; // For now, don't even attempt to run through - } +uint32_t HLE_read_NV2A_vertex_attribute_slot(unsigned slot) +{ + NV2AState* dev = g_NV2A->GetDeviceState(); + PGRAPHState *pg = &(dev->pgraph); -#if 1 // Temporarily, use this array of 16 bit elements (until HLE drawing uses 32 bit indices, like LLE) - static INDEX16 pg__inline_elements_16[NV2A_MAX_BATCH_LENGTH]; - #define pg__inline_elements pg__inline_elements_16 -#else - #define pg__inline_elements pg->inline_elements -#endif + // See CASE_16(NV097_SET_VERTEX_DATA4UB, 4) in LLE pgraph_handle_method() + VertexAttribute *vertex_attribute = &pg->vertex_attributes[slot]; + // Inverse of D3DDevice_SetVertexDataColor + uint8_t a = uint8_t(vertex_attribute->inline_value[0] * 255.0f); + uint8_t b = uint8_t(vertex_attribute->inline_value[1] * 255.0f); + uint8_t c = uint8_t(vertex_attribute->inline_value[2] * 255.0f); + uint8_t d = uint8_t(vertex_attribute->inline_value[3] * 255.0f); + uint32_t value = a + (b << 8) + (c << 16) + (d << 24); - switch (method) { - - case 0: { - LOG_TEST_CASE("Pushbuffer method == 0"); - break; - } - case NV097_NO_OPERATION: { // 0x00000100, NV2A_NOP, No Operation, followed parameters are no use. this operation triggers DPC which is not implemented in HLE - break; - } - case NV097_SET_DEPTH_FUNC: { // 0x00000354 - // Test-case : Whiplash - SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_ZFUNC, - parameter & 0xF); - break; - } - case NV097_SET_DEPTH_TEST_ENABLE: { // 0x0000030C, NV2A_DEPTH_TEST_ENABLE - // Test-case : Whiplash - SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_ZENABLE, - parameter); - break; - } - case NV097_SET_TRANSFORM_CONSTANT: // 0x00000B80, NV2A_VP_UPLOAD_CONST(0), D3DPUSH_SET_TRANSFORM_CONSTANT - case NV2A_VP_UPLOAD_CONST(1): - case NV2A_VP_UPLOAD_CONST(2): - case NV2A_VP_UPLOAD_CONST(3): { - // Can't use NOINCREMENT_FLAG, parameters is constant matrix, 4X4 matrix has 16 DWORDs, maximum of 32 DWORD writes - //load constant matrix to empty slot - LOG_TEST_CASE("NV2A_VP_UPLOAD_CONST"); - break; - } - case NV097_SET_BEGIN_END: { // 0x000017FC, NV2A_VERTEX_BEGIN_END, D3DPUSH_SET_BEGIN_END, 1 DWORD parameter - if (parameter == 0) { // Parameter == 0 means SetEnd, EndPush() - // Trigger all draws from here - if (pg->draw_arrays_length) { - LOG_TEST_CASE("PushBuffer : Draw Arrays"); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_array_length == 0); - assert(pg->inline_elements_length == 0); - -#if 0 // LLE OpenGL - pgraph_bind_vertex_attributes(d, pg->draw_arrays_max_count, - false, 0); - glMultiDrawArrays(pg->shader_binding->gl_primitive_mode, - pg->gl_draw_arrays_start, - pg->gl_draw_arrays_count, - pg->draw_arrays_length); -#else - // TODO : Implement this -#endif - } - else if (pg->inline_buffer_length) { - LOG_TEST_CASE("PushBuffer : Inline Buffer"); - assert(pg->draw_arrays_length == 0); - assert(pg->inline_array_length == 0); - assert(pg->inline_elements_length == 0); - -#if 0 // LLE OpenGL - for (i = 0; i < NV2A_VERTEXSHADER_ATTRIBUTES; i++) { - VertexAttribute *vertex_attribute = &pg->vertex_attributes[i]; - if (vertex_attribute->inline_buffer) { - glBindBuffer(GL_ARRAY_BUFFER, - vertex_attribute->gl_inline_buffer); - glBufferData(GL_ARRAY_BUFFER, - pg->inline_buffer_length - * sizeof(float) * 4, - vertex_attribute->inline_buffer, - GL_DYNAMIC_DRAW); - /* Clear buffer for next batch */ - g_free(vertex_attribute->inline_buffer); - vertex_attribute->inline_buffer = NULL; - glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, 0, 0); - glEnableVertexAttribArray(i); - } - else { - glDisableVertexAttribArray(i); - glVertexAttrib4fv(i, vertex_attribute->inline_value); - } - } - - glDrawArrays(pg->shader_binding->gl_primitive_mode, - 0, pg->inline_buffer_length); -#else - // TODO : Implement this -#endif - } - else if (pg->inline_array_length) { -// NV2A_GL_DPRINTF(false, "Inline Array"); - assert(pg->draw_arrays_length == 0); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_elements_length == 0); - -#if 0 // LLE OpenGL - unsigned int index_count = pgraph_bind_inline_array(d); - glDrawArrays(pg->shader_binding->gl_primitive_mode, 0, index_count); -#else - //DWORD vertex data array, - //To be used as a replacement for DrawVerticesUP, the caller needs to set the vertex format using IDirect3DDevice8::SetVertexShader before calling BeginPush. All attributes in the vertex format must be padded DWORD multiples, and the vertex attributes must be specified in the canonical FVF ordering (position followed by weight, normal, diffuse, and so on). - // retrieve vertex shader - DWORD dwVertexShader = g_CurrentXboxVertexShaderHandle; - if (dwVertexShader == 0) { - LOG_TEST_CASE("FVF Vertex Shader is null"); - dwVertexShader = -1; - } - - // render vertices - if (dwVertexShader != -1) { - DWORD dwVertexStride = CxbxGetStrideFromVertexShaderHandle(dwVertexShader); - if (dwVertexStride > 0) { - UINT VertexCount = (pg->inline_array_length * sizeof(DWORD)) / dwVertexStride; - CxbxDrawContext DrawContext = {}; - - DrawContext.XboxPrimitiveType = (X_D3DPRIMITIVETYPE)pg->primitive_mode; - DrawContext.dwVertexCount = VertexCount; - DrawContext.pXboxVertexStreamZeroData = pg->inline_array; - DrawContext.uiXboxVertexStreamZeroStride = dwVertexStride; - DrawContext.hVertexShader = dwVertexShader; - - CxbxDrawPrimitiveUP(DrawContext); - } - } -#endif - } - else if (pg->inline_elements_length) { -// NV2A_GL_DPRINTF(false, "Inline Elements"); - assert(pg->draw_arrays_length == 0); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_array_length == 0); - -#if 0 // LLE OpenGL - uint32_t max_element = 0; - uint32_t min_element = (uint32_t)-1; - for (i = 0; iinline_elements_length; i++) { - max_element = MAX(pg->inline_elements[i], max_element); - min_element = MIN(pg->inline_elements[i], min_element); - } - - pgraph_bind_vertex_attributes(d, max_element + 1, false, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pg->gl_element_buffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, - pg->inline_elements_length * 4, - pg->inline_elements, - GL_DYNAMIC_DRAW); - glDrawRangeElements(pg->shader_binding->gl_primitive_mode, - min_element, max_element, - pg->inline_elements_length, - GL_UNSIGNED_INT, - (void*)0); -#else - if (IsValidCurrentShader()) { - unsigned int uiIndexCount = pg->inline_elements_length; - CxbxDrawContext DrawContext = {}; - - DrawContext.XboxPrimitiveType = (X_D3DPRIMITIVETYPE)pg->primitive_mode; - DrawContext.dwVertexCount = EmuD3DIndexCountToVertexCount(DrawContext.XboxPrimitiveType, uiIndexCount); - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; - DrawContext.pIndexData = pg__inline_elements; // Used by GetVerticesInBuffer - - CxbxDrawIndexed(DrawContext); - } -#endif - } - else { - LOG_TEST_CASE("EMPTY NV097_SET_BEGIN_END"); - } - } - else { -// NV2A_GL_DGROUP_BEGIN("NV097_SET_BEGIN_END: 0x%x", parameter); - assert(parameter <= NV097_SET_BEGIN_END_OP_POLYGON); - - pg->primitive_mode = parameter; // Retrieve the D3DPRIMITIVETYPE info in parameter - - CxbxUpdateNativeD3DResources(); - - pg->inline_elements_length = 0; - pg->inline_array_length = 0; - pg->inline_buffer_length = 0; - pg->draw_arrays_length = 0; - pg->draw_arrays_max_count = 0; - } - - break; - } - case NV097_ARRAY_ELEMENT16: { // 0x1800, NV2A_VB_ELEMENT_U16 - //LOG_TEST_CASE("NV2A_VB_ELEMENT_U16"); - // Test-case : Turok (in main menu) - // Test-case : Hunter Redeemer - // Test-case : Otogi (see https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/1113#issuecomment-385593814) - assert(pg->inline_elements_length < NV2A_MAX_BATCH_LENGTH); - pg__inline_elements[ - pg->inline_elements_length++] = parameter & 0xFFFF; - pg__inline_elements[ - pg->inline_elements_length++] = parameter >> 16; - break; - } - case NV097_ARRAY_ELEMENT32: { // 0x1808, NV2A_VB_ELEMENT_U32, Index Array Data - //LOG_TEST_CASE("NV2A_VB_ELEMENT_U32"); - // Test-case : Turok (in main menu) - assert(pg->inline_elements_length < NV2A_MAX_BATCH_LENGTH); - pg__inline_elements[ - pg->inline_elements_length++] = parameter; - break; - } - case NV097_INLINE_ARRAY: { // 0x1818, NV2A_VERTEX_DATA, parameter size= dwCount*DWORD, represent D3DFVF data - assert(pg->inline_array_length < NV2A_MAX_BATCH_LENGTH); - pg->inline_array[ - pg->inline_array_length++] = parameter; - break; - } - case NV097_SET_TRANSFORM_EXECUTION_MODE: { // 0x00001E94, NV2A_ENGINE - // Test-case : Whiplash - SET_MASK(pg->regs[NV_PGRAPH_CSV0_D], NV_PGRAPH_CSV0_D_MODE, - GET_MASK(parameter, - NV097_SET_TRANSFORM_EXECUTION_MODE_MODE)); - SET_MASK(pg->regs[NV_PGRAPH_CSV0_D], NV_PGRAPH_CSV0_D_RANGE_MODE, - GET_MASK(parameter, - NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE)); - break; - } - case NV097_SET_TRANSFORM_PROGRAM_CXT_WRITE_EN: { // 0x00001E98, NV2A_SET_TRANSFORM_PROGRAM_CXT_WRITE_EN - // Test-case : Whiplash - pg->enable_vertex_program_write = parameter; - break; - } - case NV097_SET_TRANSFORM_CONSTANT_LOAD: { // 0x00001EA4, NV2A_VP_UPLOAD_CONST_ID, D3DPUSH_SET_TRANSFORM_CONSTANT_LOAD - // Add 96 to constant index parameter, one parameter=CONSTANT + 96 - // Retrieve transform constant index and add 96 to it. - LOG_TEST_CASE("NV2A_VP_UPLOAD_CONST_ID"); - break; - } - default: { // default case, handling any other unknown methods. - char message[256] = {}; - sprintf(message, "Unhandled PushBuffer Operation : %s (0x%.04X)", NV2AMethodToString(method), method); - LOG_TEST_CASE(message); - break; - } - } // switch + return value; } // For now, skip the cache, but handle the pgraph method directly // Note : Here's where the method gets multiplied by four! -// Note 2 : pg is read from local scope, and ni is unused (same in LLE) +// Note 2 : d is read from local scope, and ni is unused (same in LLE) +// Note 3 : Keep EmuExecutePushBufferRaw skipping all commands not intended for channel 0 (3D) +// Note 4 : Prevent a crash during shutdown when g_NV2A gets deleted #define CACHE_PUSH(subc, mthd, word, ni) \ - HLE_pgraph_handle_method(pg, subc, mthd << 2, word) + if (subc == 0) { \ + if (g_NV2A) { \ + pgraph_handle_method(d, subc, mthd << 2, word); \ + } \ + } typedef union { /* https://envytools.readthedocs.io/en/latest/hw/fifo/dma-pusher.html#the-commands-pre-gf100-format @@ -521,12 +433,14 @@ typedef union { #define COMMAND_WORD_MASK_JUMP_LONG 0xFFFFFFFC /* 2 .. 28 */ } nv_fifo_command; -extern void XTL::EmuExecutePushBufferRaw +extern void EmuExecutePushBufferRaw ( void *pPushData, uint32_t uSizeInBytes ) { + HLE_init_pgraph_plugins(); // TODO : Move to more approriate spot + // Test-case : Azurik (see https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/360) // Test-case : Crash 'n' Burn [45530014] // Test-case : CrimsonSea [4B4F0002] @@ -547,8 +461,10 @@ extern void XTL::EmuExecutePushBufferRaw assert(pPushData); assert(uSizeInBytes >= 4); - // EmuNV2A_PGRAPH immitation - PGRAPHState *pg = &pgraph_state; + // Retrieve NV2AState via the (LLE) NV2A device : + NV2AState *d = g_NV2A->GetDeviceState(); + d->pgraph.regs[NV_PGRAPH_CTX_CONTROL] |= NV_PGRAPH_CTX_CONTROL_CHID; // avoid assert in pgraph_handle_method() + // DMA Pusher state -- see https://envytools.readthedocs.io/en/latest/hw/fifo/dma-pusher.html#pusher-state #if 0 @@ -558,7 +474,7 @@ extern void XTL::EmuExecutePushBufferRaw uint32_t *dma_put; // pushbuffer current end address uint32_t *dma_get; //pushbuffer current read address struct { - NV2AMETHOD mthd; // Current method + XTL::NV2AMETHOD mthd; // Current method uint32_t subc; // :3 = Current subchannel uint32_t mcnt; // :24 = Current method count bool ni; // Current command's NI (non-increasing) flag @@ -717,12 +633,10 @@ extern void XTL::EmuExecutePushBufferRaw const char *NV2AMethodToString(DWORD dwMethod) { - using namespace XTL; // for NV2A symbols - switch (dwMethod) { #define ENUM_RANGED_ToString_N(Name, Method, Pitch, N) \ - case Name(N): return #Name ## "((" #N ")*" #Pitch ## ")"; + case Name(N): return #Name "((" #N ")*" #Pitch ")"; #define ENUM_RANGED_ToString_1(Name, Method, Pitch) \ ENUM_RANGED_ToString_N(Name, Method, Pitch, 0) diff --git a/src/CxbxKrnl/EmuD3D8/PushBuffer.h b/src/core/hle/D3D8/XbPushBuffer.h similarity index 74% rename from src/CxbxKrnl/EmuD3D8/PushBuffer.h rename to src/core/hle/D3D8/XbPushBuffer.h index 367d261c3..ca2ac5111 100644 --- a/src/CxbxKrnl/EmuD3D8/PushBuffer.h +++ b/src/core/hle/D3D8/XbPushBuffer.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->PushBuffer.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,8 +22,10 @@ // * All rights reserved // * // ****************************************************************** -#ifndef PUSHBUFFER_H -#define PUSHBUFFER_H +#ifndef XBPUSHBUFFER_H +#define XBPUSHBUFFER_H + +#include "core/hle/D3D8/XbVertexBuffer.h" // for CxbxDrawContext extern int DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex); extern UINT DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures); @@ -42,8 +35,8 @@ extern void CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext); extern void EmuExecutePushBuffer ( - X_D3DPushBuffer *pPushBuffer, - X_D3DFixup *pFixup + XTL::X_D3DPushBuffer *pPushBuffer, + XTL::X_D3DFixup *pFixup ); extern void EmuExecutePushBufferRaw @@ -52,4 +45,4 @@ extern void EmuExecutePushBufferRaw uint32_t uSizeInBytes ); -#endif \ No newline at end of file +#endif diff --git a/src/core/hle/D3D8/XbState.cpp b/src/core/hle/D3D8/XbState.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/CxbxKrnl/EmuD3D8/VertexBuffer.cpp b/src/core/hle/D3D8/XbVertexBuffer.cpp old mode 100755 new mode 100644 similarity index 53% rename from src/CxbxKrnl/EmuD3D8/VertexBuffer.cpp rename to src/core/hle/D3D8/XbVertexBuffer.cpp index 718781dae..92fc0d9ec --- a/src/CxbxKrnl/EmuD3D8/VertexBuffer.cpp +++ b/src/core/hle/D3D8/XbVertexBuffer.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->VertexBuffer.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,208 +25,102 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ +#define LOG_PREFIX CXBXR_MODULE::VTXB -#include "CxbxKrnl/VMManager.h" -#include "CxbxKrnl/xxhash32.h" // For XXHash32::hash() -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuXTL.h" -#include "CxbxKrnl/ResourceTracker.h" - -// TODO: Find somewhere to put this that doesn't conflict with XTL:: -extern void EmuUpdateActiveTextureStages(); +#include +#include "core\kernel\memory-manager\VMManager.h" +#include "common\util\hasher.h" +#include "core\kernel\support\Emu.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For g_pD3DDevice +#include "core\hle\D3D8\Direct3D9\WalkIndexBuffer.h" // for WalkIndexBuffer +#include "core\hle\D3D8\ResourceTracker.h" +#include "core\hle\D3D8\XbPushBuffer.h" // for DxbxFVF_GetNumberOfTextureCoordinates +#include "core\hle\D3D8\XbVertexBuffer.h" +#include "core\hle\D3D8\XbConvert.h" #include -#include #include #include -#define HASH_SEED 0 - #define MAX_STREAM_NOT_USED_TIME (2 * CLOCKS_PER_SEC) // TODO: Trim the not used time // Inline vertex buffer emulation -extern XTL::X_D3DPRIMITIVETYPE XTL::g_InlineVertexBuffer_PrimitiveType = XTL::X_D3DPT_INVALID; -extern DWORD XTL::g_InlineVertexBuffer_FVF = 0; -extern struct XTL::_D3DIVB *XTL::g_InlineVertexBuffer_Table = nullptr; -extern UINT XTL::g_InlineVertexBuffer_TableLength = 0; -extern UINT XTL::g_InlineVertexBuffer_TableOffset = 0; +extern XTL::X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType = XTL::X_D3DPT_INVALID; +extern DWORD g_InlineVertexBuffer_FVF = 0; +extern struct _D3DIVB *g_InlineVertexBuffer_Table = nullptr; +extern UINT g_InlineVertexBuffer_TableLength = 0; +extern UINT g_InlineVertexBuffer_TableOffset = 0; FLOAT *g_InlineVertexBuffer_pData = nullptr; UINT g_InlineVertexBuffer_DataSize = 0; -extern XTL::X_D3DVertexBuffer *g_pVertexBuffer = NULL; +extern DWORD g_dwPrimPerFrame = 0; -extern DWORD XTL::g_dwPrimPerFrame = 0; -extern XTL::X_D3DVertexBuffer*g_D3DStreams[16]; -extern UINT g_D3DStreamStrides[16]; +// Copy of active Xbox D3D Vertex Streams (and strides), set by [D3DDevice|CxbxImpl]_SetStreamSource* +XTL::X_STREAMINPUT g_Xbox_SetStreamSource[X_VSH_MAX_STREAMS] = { 0 }; // Note : .Offset member is never set (so always 0) + +extern XTL::X_D3DSurface* g_pXbox_RenderTarget; +extern XTL::X_D3DSurface* g_pXbox_BackBufferSurface; void *GetDataFromXboxResource(XTL::X_D3DResource *pXboxResource); +bool GetHostRenderTargetDimensions(DWORD* pHostWidth, DWORD* pHostHeight, IDirect3DSurface* pHostRenderTarget = nullptr); +uint32_t GetPixelContainerWidth(XTL::X_D3DPixelContainer* pPixelContainer); +uint32_t GetPixelContainerHeight(XTL::X_D3DPixelContainer* pPixelContainer); -typedef struct { - XTL::IDirect3DVertexBuffer* pHostVertexBuffer; - size_t uiSize; - std::chrono::time_point lastUsed; -} cached_vertex_buffer_object; - -std::unordered_map g_HostVertexBuffers; - -// This caches Vertex Buffer Objects, but not the containing data -// This prevents unnecessary allocation and releasing of Vertex Buffers when -// we can use an existing just fine. This gives a (slight) performance boost -// Returns true if the existing vertex buffer was trashed/made invalid -bool GetCachedVertexBufferObject(DWORD pXboxDataPtr, DWORD size, XTL::IDirect3DVertexBuffer** pVertexBuffer) -{ - // TODO: If the vertex buffer object cache becomes too large, - // free the least recently used vertex buffers - - auto it = g_HostVertexBuffers.find(pXboxDataPtr); - if (it == g_HostVertexBuffers.end()) { - // Create new vertex buffer and return - cached_vertex_buffer_object newBuffer; - newBuffer.uiSize = size; - newBuffer.lastUsed = std::chrono::high_resolution_clock::now(); - - HRESULT hRet = g_pD3DDevice->CreateVertexBuffer( - size, - D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, - 0, - XTL::D3DPOOL_DEFAULT, - &newBuffer.pHostVertexBuffer -#ifdef CXBX_USE_D3D9 - , nullptr -#endif - ); - if (FAILED(hRet)) { - CxbxKrnlCleanup("Failed to create vertex buffer"); - } - - g_HostVertexBuffers[pXboxDataPtr] = newBuffer; - - *pVertexBuffer = newBuffer.pHostVertexBuffer; - return false; - } - - auto buffer = &it->second; - buffer->lastUsed = std::chrono::high_resolution_clock::now(); - - // Return the existing vertex buffer, if possible - if (size <= buffer->uiSize) { - *pVertexBuffer = buffer->pHostVertexBuffer; - return false; - } - - // If execution reached here, we need to release and re-create the vertex buffer.. - buffer->pHostVertexBuffer->Release(); - buffer->uiSize = size; - HRESULT hRet = g_pD3DDevice->CreateVertexBuffer( - size, - D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, - 0, - XTL::D3DPOOL_DEFAULT, - &buffer->pHostVertexBuffer -#ifdef CXBX_USE_D3D9 - , nullptr -#endif - ); - if (FAILED(hRet)) { - CxbxKrnlCleanup("Failed to create vertex buffer"); - } - - *pVertexBuffer = buffer->pHostVertexBuffer; - return true; -} - -void ActivatePatchedStream -( - XTL::CxbxDrawContext *pDrawContext, - UINT uiStream, - XTL::CxbxPatchedStream *pPatchedStream, - bool bRelease -) +void CxbxPatchedStream::Activate(CxbxDrawContext *pDrawContext, UINT uiStream) const { //LOG_INIT // Allows use of DEBUG_D3DRESULT // Use the cached stream values on the host - if (pPatchedStream->bCacheIsStreamZeroDrawUP) { + if (bCacheIsStreamZeroDrawUP) { // Set the UserPointer variables in the drawing context - pDrawContext->pHostVertexStreamZeroData = pPatchedStream->pCachedHostVertexStreamZeroData; - pDrawContext->uiHostVertexStreamZeroStride = pPatchedStream->uiCachedHostVertexStride; + pDrawContext->pHostVertexStreamZeroData = pCachedHostVertexStreamZeroData; + pDrawContext->uiHostVertexStreamZeroStride = uiCachedHostVertexStride; } else { HRESULT hRet = g_pD3DDevice->SetStreamSource( uiStream, - pPatchedStream->pCachedHostVertexBuffer, -#ifdef CXBX_USE_D3D9 + pCachedHostVertexBuffer, 0, // OffsetInBytes -#endif - pPatchedStream->uiCachedHostVertexStride); + uiCachedHostVertexStride); //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetStreamSource"); if (FAILED(hRet)) { CxbxKrnlCleanup("Failed to set the type patched buffer as the new stream source!\n"); - // TODO : Cartoon hits the above case when the vertex cache size is 0. - } - - // TODO : The following doesn't fix that - find our why and fix it for real - if (bRelease) { - // Always release to prevent leaks when it wasn't read from cache: - pPatchedStream->pCachedHostVertexBuffer->Release(); - // NOTE : Even this doesn't prevent Cartoon breaking : g_pD3DDevice->ResourceManagerDiscardBytes(0); + // TODO : test-case : XDK Cartoon hits the above case when the vertex cache size is 0. } } } -void ReleasePatchedStream(XTL::CxbxPatchedStream *pPatchedStream) +CxbxPatchedStream::CxbxPatchedStream() { - if (pPatchedStream->bCachedHostVertexStreamZeroDataIsAllocated) { - free(pPatchedStream->pCachedHostVertexStreamZeroData); - pPatchedStream->bCachedHostVertexStreamZeroDataIsAllocated = false; - } - pPatchedStream->pCachedHostVertexStreamZeroData = nullptr; - pPatchedStream->pCachedHostVertexBuffer = nullptr; // g_HostVertexBuffers owns these nowadays + isValid = false; } -XTL::CxbxVertexBufferConverter::CxbxVertexBufferConverter() +CxbxPatchedStream::~CxbxPatchedStream() { - this->m_uiNbrStreams = 0; - ZeroMemory(this->m_PatchedStreams, sizeof(CxbxPatchedStream) * MAX_NBR_STREAMS); - this->m_bAllocatedStreamZeroData = false; - this->m_pNewVertexStreamZeroData = NULL; - this->m_pVertexShaderInfo = NULL; + if (bCachedHostVertexStreamZeroDataIsAllocated) { + free(pCachedHostVertexStreamZeroData); + bCachedHostVertexStreamZeroDataIsAllocated = false; + } + + pCachedHostVertexStreamZeroData = nullptr; + + if (pCachedHostVertexBuffer != nullptr) { + pCachedHostVertexBuffer->Release(); + pCachedHostVertexBuffer = nullptr; + } } -XTL::CxbxVertexBufferConverter::~CxbxVertexBufferConverter() +CxbxVertexBufferConverter::CxbxVertexBufferConverter() { - for (int i = 0; i < MAX_NBR_STREAMS; i++) { - ReleasePatchedStream(&m_PatchedStreams[i]); - } -} - -size_t GetVerticesInBuffer(DWORD dwOffset, DWORD dwVertexCount, PWORD pIndexData, DWORD dwIndexBase) -{ - // If we are drawing from an offset, we know that the vertex count must have offset vertices - // before the first drawn vertices - dwVertexCount += dwOffset; - if (pIndexData == nullptr) { - return dwVertexCount; - } - - // We are an indexed draw, so we have to parse the index buffer - // The highest index we see can be used to determine the vertex buffer size - DWORD highestVertexIndex = 0; - for (DWORD i = 0; i < dwVertexCount; i++) { - if (highestVertexIndex < pIndexData[i]) { - highestVertexIndex = pIndexData[i]; - } - } - - return dwIndexBase + highestVertexIndex + 1; + m_uiNbrStreams = 0; + m_pVertexShaderInfo = nullptr; } int CountActiveD3DStreams() { int lastStreamIndex = 0; - for (int i = 0; i < 16; i++) { - if (g_D3DStreams[i] != nullptr) { + for (int i = 0; i < X_VSH_MAX_STREAMS; i++) { + if (g_Xbox_SetStreamSource[i].VertexBuffer != xbnullptr) { lastStreamIndex = i + 1; } } @@ -243,25 +128,30 @@ int CountActiveD3DStreams() return lastStreamIndex; } -XTL::CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD Handle); // forward +CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle); // forward -UINT XTL::CxbxVertexBufferConverter::GetNbrStreams(CxbxDrawContext *pDrawContext) +UINT CxbxVertexBufferConverter::GetNbrStreams(CxbxDrawContext *pDrawContext) { // Draw..Up always have one stream - if (pDrawContext->pXboxVertexStreamZeroData != nullptr) { + if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr) { return 1; } - if(VshHandleIsVertexShader(pDrawContext->hVertexShader)) { - CxbxVertexShaderInfo *pVertexShaderInfo = GetCxbxVertexShaderInfo(pDrawContext->hVertexShader); + if(VshHandleIsVertexShader(g_Xbox_VertexShader_Handle)) { + CxbxVertexShaderInfo *pVertexShaderInfo = GetCxbxVertexShaderInfo(g_Xbox_VertexShader_Handle); if (pVertexShaderInfo) { - return pVertexShaderInfo->NumberOfVertexStreams; + if (pVertexShaderInfo->NumberOfVertexStreams <= X_VSH_MAX_STREAMS) { + return pVertexShaderInfo->NumberOfVertexStreams; + } + + // If we reached here, pVertexShaderInfo was set,but with invalid data + LOG_TEST_CASE("NumberOfVertexStreams > 16"); } return CountActiveD3DStreams(); } - if (pDrawContext->hVertexShader) { + if (g_Xbox_VertexShader_Handle) { return CountActiveD3DStreams(); } @@ -288,40 +178,74 @@ inline FLOAT ByteToFloat(const BYTE value) return ((FLOAT)value) / 255.0f; } -void XTL::CxbxVertexBufferConverter::ConvertStream +CxbxPatchedStream& CxbxVertexBufferConverter::GetPatchedStream(uint64_t key) +{ + // First, attempt to fetch an existing patched stream + auto it = m_PatchedStreams.find(key); + if (it != m_PatchedStreams.end()) { + m_PatchedStreamUsageList.splice(m_PatchedStreamUsageList.begin(), m_PatchedStreamUsageList, it->second); + return *it->second; + } + + // We didn't find an existing patched stream, so we must insert one and get a reference to it + m_PatchedStreamUsageList.push_front({}); + CxbxPatchedStream& stream = m_PatchedStreamUsageList.front(); + + // Insert a reference iterator into the fast lookup map + m_PatchedStreams[key] = m_PatchedStreamUsageList.begin(); + + // If the cache has exceeded it's upper bound, discard the oldest entries in the cache + if (m_PatchedStreams.size() > (m_MaxCacheSize + m_CacheElasticity)) { + while (m_PatchedStreams.size() > m_MaxCacheSize) { + m_PatchedStreams.erase(m_PatchedStreamUsageList.back().uiVertexDataHash); + m_PatchedStreamUsageList.pop_back(); + } + } + + return stream; +} + +void CxbxVertexBufferConverter::PrintStats() +{ + printf("Vertex Buffer Cache Status: \n"); + printf("- Cache Size: %d\n", m_PatchedStreams.size()); + printf("- Hits: %d\n", m_TotalCacheHits); + printf("- Misses: %d\n", m_TotalCacheMisses); +} + +void CxbxVertexBufferConverter::ConvertStream ( CxbxDrawContext *pDrawContext, UINT uiStream ) { -#if CXBX_USE_D3D9 - extern XTL::D3DCAPS g_D3DCaps; -#endif + extern D3DCAPS g_D3DCaps; - bool bVshHandleIsFVF = VshHandleIsFVF(pDrawContext->hVertexShader); - DWORD XboxFVF = bVshHandleIsFVF ? pDrawContext->hVertexShader : 0; + bool bVshHandleIsFVF = VshHandleIsFVF(g_Xbox_VertexShader_Handle); + DWORD XboxFVF = bVshHandleIsFVF ? g_Xbox_VertexShader_Handle : 0; // Texture normalization can only be set for FVF shaders bool bNeedTextureNormalization = false; - struct { int NrTexCoords; bool bTexIsLinear; int Width; int Height; int Depth; } pActivePixelContainer[X_D3DTS_STAGECOUNT] = { 0 }; + struct { int NrTexCoords; bool bTexIsLinear; int Width; int Height; int Depth; } pActivePixelContainer[XTL::X_D3DTS_STAGECOUNT] = { 0 }; if (bVshHandleIsFVF) { DWORD dwTexN = (XboxFVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT; - if (dwTexN > X_D3DTS_STAGECOUNT) { + if (dwTexN > XTL::X_D3DTS_STAGECOUNT) { LOG_TEST_CASE("FVF,dwTexN > X_D3DTS_STAGECOUNT"); } // Check for active linear textures. - //X_D3DBaseTexture *pLinearBaseTexture[X_D3DTS_STAGECOUNT]; - for (uint i = 0; i < X_D3DTS_STAGECOUNT; i++) { + //X_D3DBaseTexture *pLinearBaseTexture[XTL::X_D3DTS_STAGECOUNT]; + for (unsigned int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { // Only normalize coordinates used by the FVF shader : if (i + 1 <= dwTexN) { pActivePixelContainer[i].NrTexCoords = DxbxFVF_GetNumberOfTextureCoordinates(XboxFVF, i); // TODO : Use GetXboxBaseTexture() - X_D3DBaseTexture *pXboxBaseTexture = EmuD3DActiveTexture[i]; + XTL::X_D3DBaseTexture *pXboxBaseTexture = g_pXbox_SetTexture[i]; if (pXboxBaseTexture != xbnullptr) { - // TODO : Use GetXboxPixelContainerFormat - XTL::X_D3DFORMAT XBFormat = (XTL::X_D3DFORMAT)((pXboxBaseTexture->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT); - if (EmuXBFormatIsLinear(XBFormat)) { + extern XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::X_D3DPixelContainer *pXboxPixelContainer); // TODO : Move to XTL-independent header file + + XTL::X_D3DFORMAT XboxFormat = GetXboxPixelContainerFormat(pXboxBaseTexture); + if (EmuXBFormatIsLinear(XboxFormat)) { // This is often hit by the help screen in XDK samples. bNeedTextureNormalization = true; // Remember linearity, width and height : @@ -338,6 +262,11 @@ void XTL::CxbxVertexBufferConverter::ConvertStream CxbxVertexShaderStreamInfo *pVertexShaderStreamInfo = nullptr; if (m_pVertexShaderInfo != nullptr) { + if (uiStream > m_pVertexShaderInfo->NumberOfVertexStreams + 1) { + LOG_TEST_CASE("uiStream > NumberOfVertexStreams"); + return; + } + pVertexShaderStreamInfo = &(m_pVertexShaderInfo->VertexStreams[uiStream]); } @@ -345,12 +274,12 @@ void XTL::CxbxVertexBufferConverter::ConvertStream bool bNeedRHWReset = bVshHandleIsFVF && ((XboxFVF & D3DFVF_POSITION_MASK) == D3DFVF_XYZRHW); bool bNeedStreamCopy = bNeedTextureNormalization || bNeedVertexPatching || bNeedRHWReset; - uint08 *pXboxVertexData; - UINT uiXboxVertexStride; - UINT uiVertexCount; - UINT uiHostVertexStride; - DWORD dwHostVertexDataSize; - uint08 *pHostVertexData; + uint8_t *pXboxVertexData = xbnullptr; + UINT uiXboxVertexStride = 0; + UINT uiVertexCount = 0; + UINT uiHostVertexStride = 0; + DWORD dwHostVertexDataSize = 0; + uint8_t *pHostVertexData = nullptr; IDirect3DVertexBuffer *pNewHostVertexBuffer = nullptr; if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr) { @@ -359,41 +288,29 @@ void XTL::CxbxVertexBufferConverter::ConvertStream CxbxKrnlCleanup("Trying to patch a Draw..UP with more than stream zero!"); } - pXboxVertexData = (uint08 *)pDrawContext->pXboxVertexStreamZeroData; + pXboxVertexData = (uint8_t *)pDrawContext->pXboxVertexStreamZeroData; uiXboxVertexStride = pDrawContext->uiXboxVertexStreamZeroStride; uiVertexCount = pDrawContext->VerticesInBuffer; uiHostVertexStride = (bNeedVertexPatching) ? pVertexShaderStreamInfo->HostVertexStride : uiXboxVertexStride; dwHostVertexDataSize = uiVertexCount * uiHostVertexStride; - if (bNeedStreamCopy) { - pHostVertexData = (uint08*)malloc(dwHostVertexDataSize); - if (pHostVertexData == nullptr) { - CxbxKrnlCleanup("Couldn't allocate the new stream zero buffer"); - } - } - else { - pHostVertexData = pXboxVertexData; - } - } - else { - XTL::X_D3DVertexBuffer *pXboxVertexBuffer = g_D3DStreams[uiStream]; - pXboxVertexData = (uint08*)GetDataFromXboxResource(pXboxVertexBuffer); - if (pXboxVertexData == NULL) { + } else { + XTL::X_D3DVertexBuffer *pXboxVertexBuffer = g_Xbox_SetStreamSource[uiStream].VertexBuffer; + pXboxVertexData = (uint8_t*)GetDataFromXboxResource(pXboxVertexBuffer); + if (pXboxVertexData == xbnullptr) { HRESULT hRet = g_pD3DDevice->SetStreamSource( uiStream, nullptr, -#ifdef CXBX_USE_D3D9 0, // OffsetInBytes -#endif 0); // DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetStreamSource"); if (FAILED(hRet)) { - EmuWarning("g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0)"); + EmuLog(LOG_LEVEL::WARNING, "g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0)"); } return; } - uiXboxVertexStride = g_D3DStreamStrides[uiStream]; + uiXboxVertexStride = g_Xbox_SetStreamSource[uiStream].Stride; // Set a new (exact) vertex count uiVertexCount = pDrawContext->VerticesInBuffer; // Dxbx note : Don't overwrite pDrawContext.dwVertexCount with uiVertexCount, because an indexed draw @@ -402,41 +319,118 @@ void XTL::CxbxVertexBufferConverter::ConvertStream uiHostVertexStride = (bNeedVertexPatching) ? pVertexShaderStreamInfo->HostVertexStride : uiXboxVertexStride; dwHostVertexDataSize = uiVertexCount * uiHostVertexStride; - GetCachedVertexBufferObject(pXboxVertexBuffer->Data, dwHostVertexDataSize, &pNewHostVertexBuffer); - - if (FAILED(pNewHostVertexBuffer->Lock(0, 0, (D3DLockData **)&pHostVertexData, D3DLOCK_DISCARD))) { - CxbxKrnlCleanup("Couldn't lock the new buffer"); - } // Copy stream for patching and caching. bNeedStreamCopy = true; } + + // FAST PATH: If this draw is a zerostream based draw, and does not require patching, we can use it directly + // No need to hash or patch at all in this case! + if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr && !bNeedStreamCopy) { + pHostVertexData = pXboxVertexData; + + CxbxPatchedStream stream; + stream.isValid = true; + stream.XboxPrimitiveType = pDrawContext->XboxPrimitiveType; + stream.uiCachedHostVertexStride = uiHostVertexStride; + stream.bCacheIsStreamZeroDrawUP = true; + stream.pCachedHostVertexStreamZeroData = pHostVertexData; + stream.Activate(pDrawContext, uiStream); + return; + } + + // Now we have enough information to hash the existing resource and find it in our cache! + DWORD xboxVertexDataSize = uiVertexCount * uiXboxVertexStride; + uint64_t vertexDataHash = ComputeHash(pXboxVertexData, xboxVertexDataSize); + uint64_t pVertexShaderSteamInfoHash = 0; + + if (pVertexShaderStreamInfo != nullptr) { + pVertexShaderSteamInfoHash = ComputeHash(pVertexShaderStreamInfo, sizeof(CxbxVertexShaderStreamInfo)); + } + + // Lookup implicity inserts a new entry if not exists, so this always works + CxbxPatchedStream& patchedStream = GetPatchedStream(vertexDataHash); + + // We check a few fields of the patched stream to protect against hash collisions (rare) + // but also to protect against games using the exact same vertex data for different vertex formats (Test Case: Burnout) + if (patchedStream.isValid && // Check that we found a cached stream + patchedStream.uiVertexStreamInformationHash == pVertexShaderSteamInfoHash && // Check that the vertex conversion is valid + patchedStream.uiCachedHostVertexStride == patchedStream.uiCachedHostVertexStride && // Make sure the host stride didn't change + patchedStream.uiCachedXboxVertexStride == uiXboxVertexStride && // Make sure the Xbox Stride didn't change + patchedStream.uiCachedXboxVertexDataSize == xboxVertexDataSize ) { // Make sure the Xbox Data Size also didn't change + m_TotalCacheHits++; + patchedStream.Activate(pDrawContext, uiStream); + return; + } + + m_TotalCacheMisses++; + + // If execution reaches here, the cached vertex buffer was not valid and we must reconvert the data + if (patchedStream.isValid) { + pHostVertexData = (uint8_t*)patchedStream.pCachedHostVertexStreamZeroData; + pNewHostVertexBuffer = patchedStream.pCachedHostVertexBuffer; + + // Free the existing buffers + if (pHostVertexData != nullptr) { + free(pHostVertexData); + pHostVertexData = nullptr; + } else if (pNewHostVertexBuffer != nullptr) { + pNewHostVertexBuffer->Release(); + pNewHostVertexBuffer = nullptr; + } + } + + // Allocate new buffers + if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr) { + pHostVertexData = (uint8_t*)malloc(dwHostVertexDataSize); + + if (pHostVertexData == nullptr) { + CxbxKrnlCleanup("Couldn't allocate the new stream zero buffer"); + } + } else { + HRESULT hRet = g_pD3DDevice->CreateVertexBuffer( + dwHostVertexDataSize, + D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, + 0, + D3DPOOL_DEFAULT, + &pNewHostVertexBuffer, + nullptr + ); + + if (FAILED(hRet)) { + CxbxKrnlCleanup("Failed to create vertex buffer"); + } + } + + // If we need to lock a host vertex buffer, do so now + if (pHostVertexData == nullptr && pNewHostVertexBuffer != nullptr) { + if (FAILED(pNewHostVertexBuffer->Lock(0, 0, (D3DLockData **)&pHostVertexData, D3DLOCK_DISCARD))) { + CxbxKrnlCleanup("Couldn't lock vertex buffer"); + } + } if (bNeedVertexPatching) { // assert(bNeedStreamCopy || "bNeedVertexPatching implies bNeedStreamCopy (but copies via conversions"); - for (uint32 uiVertex = 0; uiVertex < uiVertexCount; uiVertex++) { - uint08 *pXboxVertexAsByte = &pXboxVertexData[uiVertex * uiXboxVertexStride]; - uint08 *pHostVertexAsByte = &pHostVertexData[uiVertex * uiHostVertexStride]; + for (uint32_t uiVertex = 0; uiVertex < uiVertexCount; uiVertex++) { + uint8_t *pXboxVertexAsByte = &pXboxVertexData[uiVertex * uiXboxVertexStride]; + uint8_t *pHostVertexAsByte = &pHostVertexData[uiVertex * uiHostVertexStride]; for (UINT uiElement = 0; uiElement < pVertexShaderStreamInfo->NumberOfVertexElements; uiElement++) { FLOAT *pXboxVertexAsFloat = (FLOAT*)pXboxVertexAsByte; SHORT *pXboxVertexAsShort = (SHORT*)pXboxVertexAsByte; - int XboxElementByteSize = pVertexShaderStreamInfo->VertexElements[uiElement].HostByteSize; + const int XboxElementByteSize = pVertexShaderStreamInfo->VertexElements[uiElement].XboxByteSize; FLOAT *pHostVertexAsFloat = (FLOAT*)pHostVertexAsByte; SHORT *pHostVertexAsShort = (SHORT*)pHostVertexAsByte; // Dxbx note : The following code handles only the D3DVSDT enums that need conversion; // All other cases are catched by the memcpy in the default-block. switch (pVertexShaderStreamInfo->VertexElements[uiElement].XboxType) { - case X_D3DVSDT_NORMSHORT1: { // 0x11: + case XTL::X_D3DVSDT_NORMSHORT1: { // 0x11: // Test-cases : Halo - Combat Evolved - XboxElementByteSize = 1 * sizeof(SHORT); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { // Make it SHORT2N pHostVertexAsShort[0] = pXboxVertexAsShort[0]; pHostVertexAsShort[1] = 0; } else -#endif { // Make it FLOAT1 pHostVertexAsFloat[0] = NormShortToFloat(pXboxVertexAsShort[0]); @@ -444,21 +438,17 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_NORMSHORT2: { // 0x21: + case XTL::X_D3DVSDT_NORMSHORT2: { // 0x21: // Test-cases : Baldur's Gate: Dark Alliance 2, F1 2002, Gun, Halo - Combat Evolved, Scrapland - XboxElementByteSize = 2 * sizeof(SHORT); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { // No need for patching when D3D9 supports D3DDECLTYPE_SHORT2N // TODO : goto default; // ?? - //assert(XboxElementByteSize == 2 * sizeof(SHORT)); //memcpy(pHostVertexAsByte, pXboxVertexAsByte, XboxElementByteSize); // Make it SHORT2N pHostVertexAsShort[0] = pXboxVertexAsShort[0]; pHostVertexAsShort[1] = pXboxVertexAsShort[1]; } else -#endif { // Make it FLOAT2 pHostVertexAsFloat[0] = NormShortToFloat(pXboxVertexAsShort[0]); @@ -466,10 +456,8 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_NORMSHORT3: { // 0x31: + case XTL::X_D3DVSDT_NORMSHORT3: { // 0x31: // Test-cases : Cel Damage, Constantine, Destroy All Humans! - XboxElementByteSize = 3 * sizeof(SHORT); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { // Make it SHORT4N pHostVertexAsShort[0] = pXboxVertexAsShort[0]; @@ -478,7 +466,6 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsShort[3] = 32767; // TODO : verify } else -#endif { // Make it FLOAT3 pHostVertexAsFloat[0] = NormShortToFloat(pXboxVertexAsShort[0]); @@ -487,14 +474,11 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_NORMSHORT4: { // 0x41: + case XTL::X_D3DVSDT_NORMSHORT4: { // 0x41: // Test-cases : Judge Dredd: Dredd vs Death, NHL Hitz 2002, Silent Hill 2, Sneakers, Tony Hawk Pro Skater 4 - XboxElementByteSize = 4 * sizeof(SHORT); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { // No need for patching when D3D9 supports D3DDECLTYPE_SHORT4N // TODO : goto default; // ?? - //assert(XboxElementByteSize == 4 * sizeof(SHORT)); //memcpy(pHostVertexAsByte, pXboxVertexAsByte, XboxElementByteSize); // Make it SHORT4N pHostVertexAsShort[0] = pXboxVertexAsShort[0]; @@ -503,7 +487,6 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsShort[3] = pXboxVertexAsShort[3]; } else -#endif { // Make it FLOAT4 pHostVertexAsFloat[0] = NormShortToFloat(pXboxVertexAsShort[0]); @@ -513,12 +496,11 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_NORMPACKED3: { // 0x16: + case XTL::X_D3DVSDT_NORMPACKED3: { // 0x16: // Test-cases : Dashboard - XboxElementByteSize = 1 * sizeof(int32); // Make it FLOAT3 union { - int32 value; + int32_t value; struct { int x : 11; int y : 11; @@ -526,23 +508,21 @@ void XTL::CxbxVertexBufferConverter::ConvertStream }; } NormPacked3; - NormPacked3.value = ((int32 *)pXboxVertexAsByte)[0]; + NormPacked3.value = ((int32_t*)pXboxVertexAsByte)[0]; pHostVertexAsFloat[0] = PackedIntToFloat(NormPacked3.x, 1023.0f, 1024.f); pHostVertexAsFloat[1] = PackedIntToFloat(NormPacked3.y, 1023.0f, 1024.f); pHostVertexAsFloat[2] = PackedIntToFloat(NormPacked3.z, 511.0f, 512.f); break; } - case X_D3DVSDT_SHORT1: { // 0x15: - XboxElementByteSize = 1 * sizeof(SHORT); + case XTL::X_D3DVSDT_SHORT1: { // 0x15: // Make it SHORT2 and set the second short to 0 pHostVertexAsShort[0] = pXboxVertexAsShort[0]; pHostVertexAsShort[1] = 0; break; } - case X_D3DVSDT_SHORT3: { // 0x35: + case XTL::X_D3DVSDT_SHORT3: { // 0x35: // Test-cases : Turok - XboxElementByteSize = 3 * sizeof(SHORT); // Make it a SHORT4 and set the fourth short to 1 pHostVertexAsShort[0] = pXboxVertexAsShort[0]; pHostVertexAsShort[1] = pXboxVertexAsShort[1]; @@ -550,9 +530,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsShort[3] = 1; // Turok verified (character disappears when this is 32767) break; } - case X_D3DVSDT_PBYTE1: { // 0x14: - XboxElementByteSize = 1 * sizeof(BYTE); -#if CXBX_USE_D3D9 + case XTL::X_D3DVSDT_PBYTE1: { // 0x14: if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { // Make it UBYTE4N pHostVertexAsByte[0] = pXboxVertexAsByte[0]; @@ -561,16 +539,13 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsByte[3] = 255; // TODO : Verify } else -#endif { // Make it FLOAT1 pHostVertexAsFloat[0] = ByteToFloat(pXboxVertexAsByte[0]); } break; } - case X_D3DVSDT_PBYTE2: { // 0x24: - XboxElementByteSize = 2 * sizeof(BYTE); -#if CXBX_USE_D3D9 + case XTL::X_D3DVSDT_PBYTE2: { // 0x24: if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { // Make it UBYTE4N pHostVertexAsByte[0] = pXboxVertexAsByte[0]; @@ -579,7 +554,6 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsByte[3] = 255; // TODO : Verify } else -#endif { // Make it FLOAT2 pHostVertexAsFloat[0] = ByteToFloat(pXboxVertexAsByte[0]); @@ -587,10 +561,8 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_PBYTE3: { // 0x34: + case XTL::X_D3DVSDT_PBYTE3: { // 0x34: // Test-cases : Turok - XboxElementByteSize = 3 * sizeof(BYTE); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { // Make it UBYTE4N pHostVertexAsByte[0] = pXboxVertexAsByte[0]; @@ -599,7 +571,6 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsByte[3] = 255; // TODO : Verify } else -#endif { // Make it FLOAT3 pHostVertexAsFloat[0] = ByteToFloat(pXboxVertexAsByte[0]); @@ -608,14 +579,11 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_PBYTE4: { // 0x44: + case XTL::X_D3DVSDT_PBYTE4: { // 0x44: // Test-case : Jet Set Radio Future - XboxElementByteSize = 4 * sizeof(BYTE); -#if CXBX_USE_D3D9 if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { // No need for patching when D3D9 supports D3DDECLTYPE_UBYTE4N // TODO : goto default; // ?? - //assert(XboxElementByteSize == 4 * sizeof(BYTE)); //memcpy(pHostVertexAsByte, pXboxVertexAsByte, XboxElementByteSize); // Make it UBYTE4N pHostVertexAsByte[0] = pXboxVertexAsByte[0]; @@ -624,7 +592,6 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsByte[3] = pXboxVertexAsByte[3]; } else -#endif { // Make it FLOAT4 pHostVertexAsFloat[0] = ByteToFloat(pXboxVertexAsByte[0]); @@ -634,8 +601,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } break; } - case X_D3DVSDT_FLOAT2H: { // 0x72: - XboxElementByteSize = 3 * sizeof(FLOAT); + case XTL::X_D3DVSDT_FLOAT2H: { // 0x72: // Make it FLOAT4 and set the third float to 0.0 pHostVertexAsFloat[0] = pXboxVertexAsFloat[0]; pHostVertexAsFloat[1] = pXboxVertexAsFloat[1]; @@ -643,9 +609,11 @@ void XTL::CxbxVertexBufferConverter::ConvertStream pHostVertexAsFloat[3] = pXboxVertexAsFloat[2]; break; } - case X_D3DVSDT_NONE: { // 0x02: // Skip it - // Test-case : WWE RAW2 - LOG_TEST_CASE("X_D3DVSDT_NONE"); + case XTL::X_D3DVSDT_NONE: { // 0x02: + // Test-case : WWE RAW2 + // Test-case : PetitCopter + LOG_TEST_CASE("X_D3DVSDT_NONE"); + // No host element data (but Xbox size can be above zero, when used for X_D3DVSD_MASK_SKIP* break; } default: { @@ -677,7 +645,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream // Locate texture coordinate offset in vertex structure. if (bNeedTextureNormalization) { - uiTextureCoordinatesByteOffsetInVertex = XTL::DxbxFVFToVertexSizeInBytes(XboxFVF, /*bIncludeTextures=*/false); + uiTextureCoordinatesByteOffsetInVertex = DxbxFVFToVertexSizeInBytes(XboxFVF, /*bIncludeTextures=*/false); if (bNeedVertexPatching) { LOG_TEST_CASE("Potential xbox vs host texture-offset difference! (bNeedVertexPatching within bNeedTextureNormalization)"); } @@ -685,11 +653,34 @@ void XTL::CxbxVertexBufferConverter::ConvertStream // the uiTextureCoordinatesByteOffsetInVertex on host will match Xbox } - for (uint32 uiVertex = 0; uiVertex < uiVertexCount; uiVertex++) { + // If for some reason the Xbox Render Target is not set, fallback to the backbuffer + if (g_pXbox_RenderTarget == xbnullptr) { + LOG_TEST_CASE("SetRenderTarget fallback to backbuffer"); + g_pXbox_RenderTarget = g_pXbox_BackBufferSurface; + } + + DWORD HostRenderTarget_Width, HostRenderTarget_Height; + DWORD XboxRenderTarget_Width = GetPixelContainerWidth(g_pXbox_RenderTarget); + DWORD XboxRenderTarget_Height = GetPixelContainerHeight(g_pXbox_RenderTarget); + if (!GetHostRenderTargetDimensions(&HostRenderTarget_Width, &HostRenderTarget_Height)) { + HostRenderTarget_Width = XboxRenderTarget_Width; + HostRenderTarget_Height = XboxRenderTarget_Height; + } + + bool bNeedRHWTransform = XboxRenderTarget_Width < HostRenderTarget_Width && XboxRenderTarget_Height < HostRenderTarget_Height; + + for (uint32_t uiVertex = 0; uiVertex < uiVertexCount; uiVertex++) { FLOAT *pVertexDataAsFloat = (FLOAT*)(&pHostVertexData[uiVertex * uiHostVertexStride]); // Handle pre-transformed vertices (which bypass the vertex shader pipeline) if (bNeedRHWReset) { + // We need to transform these vertices only if the host render target was upscaled from the Xbox render target + // Transforming always breaks render to non-upscaled textures: Only surfaces are upscaled, intentionally so + if (bNeedRHWTransform) { + pVertexDataAsFloat[0] *= g_RenderScaleFactor; + pVertexDataAsFloat[1] *= g_RenderScaleFactor; + } + #if 0 // Check Z. TODO : Why reset Z from 0.0 to 1.0 ? (Maybe fog-related?) if (pVertexDataAsFloat[2] == 0.0f) { @@ -709,7 +700,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream // Normalize texture coordinates in FVF stream if needed if (uiTextureCoordinatesByteOffsetInVertex > 0) { // implies bNeedTextureNormalization (using one is more efficient than both) FLOAT *pVertexUVData = (FLOAT*)((uintptr_t)pVertexDataAsFloat + uiTextureCoordinatesByteOffsetInVertex); - for (uint i = 0; i < X_D3DTS_STAGECOUNT; i++) { + for (unsigned int i = 0; i < XTL::X_D3DTS_STAGECOUNT; i++) { if (pActivePixelContainer[i].bTexIsLinear) { switch (pActivePixelContainer[i].NrTexCoords) { case 0: @@ -742,60 +733,68 @@ void XTL::CxbxVertexBufferConverter::ConvertStream } } - CxbxPatchedStream *pPatchedStream = &m_PatchedStreams[uiStream]; - -#if 0 // new - pPatchedStream->pCachedXboxVertexData = pXboxVertexData; // TODO : For hashing & caching purposes -#endif - pPatchedStream->uiCachedXboxVertexStride = uiXboxVertexStride; -#if 0 // new - pPatchedStream->uiCachedXboxVertexDataSize = uiVertexCount * uiXboxVertexStride; // TODO : For hashing & caching purposes -#endif - pPatchedStream->uiCachedHostVertexStride = uiHostVertexStride; - pPatchedStream->bCacheIsStreamZeroDrawUP = (pDrawContext->pXboxVertexStreamZeroData != NULL); - if (pPatchedStream->bCacheIsStreamZeroDrawUP) { - pPatchedStream->pCachedHostVertexStreamZeroData = pHostVertexData; - pPatchedStream->bCachedHostVertexStreamZeroDataIsAllocated = bNeedStreamCopy; - } - else { - // assert(pNewHostVertexBuffer != nullptr); - - pNewHostVertexBuffer->Unlock(); - pPatchedStream->pCachedHostVertexBuffer = pNewHostVertexBuffer; - } - - ActivatePatchedStream(pDrawContext, uiStream, pPatchedStream, - /*Release=*/!bNeedStreamCopy); // Release when it won't get cached -} - -void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext) -{ - if ((pDrawContext->XboxPrimitiveType < X_D3DPT_POINTLIST) || (pDrawContext->XboxPrimitiveType > X_D3DPT_POLYGON)) - CxbxKrnlCleanup("Unknown primitive type: 0x%.02X\n", pDrawContext->XboxPrimitiveType); - - if (VshHandleIsVertexShader(pDrawContext->hVertexShader)) { - m_pVertexShaderInfo = &(MapXboxVertexShaderHandleToCxbxVertexShader(pDrawContext->hVertexShader)->VertexShaderInfo); + patchedStream.isValid = true; + patchedStream.XboxPrimitiveType = pDrawContext->XboxPrimitiveType; + patchedStream.pCachedXboxVertexData = pXboxVertexData; + patchedStream.uiCachedXboxVertexDataSize = xboxVertexDataSize; + patchedStream.uiVertexDataHash = vertexDataHash; + patchedStream.uiVertexStreamInformationHash = pVertexShaderSteamInfoHash; + patchedStream.uiCachedXboxVertexStride = uiXboxVertexStride; + patchedStream.uiCachedHostVertexStride = uiHostVertexStride; + patchedStream.bCacheIsStreamZeroDrawUP = (pDrawContext->pXboxVertexStreamZeroData != xbnullptr); + if (patchedStream.bCacheIsStreamZeroDrawUP) { + patchedStream.pCachedHostVertexStreamZeroData = pHostVertexData; + patchedStream.bCachedHostVertexStreamZeroDataIsAllocated = bNeedStreamCopy; + } else { + // assert(pNewHostVertexBuffer != nullptr); + pNewHostVertexBuffer->Unlock(); + patchedStream.pCachedHostVertexBuffer = pNewHostVertexBuffer; } - pDrawContext->VerticesInBuffer = GetVerticesInBuffer( - pDrawContext->dwStartVertex, - pDrawContext->dwVertexCount, - pDrawContext->pIndexData, - pDrawContext->dwIndexBase - ); + patchedStream.Activate(pDrawContext, uiStream); +} + +void CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext) +{ + if ((pDrawContext->XboxPrimitiveType < XTL::X_D3DPT_POINTLIST) || (pDrawContext->XboxPrimitiveType > XTL::X_D3DPT_POLYGON)) + CxbxKrnlCleanup("Unknown primitive type: 0x%.02X\n", pDrawContext->XboxPrimitiveType); + + m_pVertexShaderInfo = nullptr; + if (VshHandleIsVertexShader(g_Xbox_VertexShader_Handle)) { + m_pVertexShaderInfo = &(GetCxbxVertexShader(g_Xbox_VertexShader_Handle)->VertexShaderInfo); + } + + // If we are drawing from an offset, we know that the vertex count must have + // 'offset' vertices before the first drawn vertices + pDrawContext->VerticesInBuffer = pDrawContext->dwStartVertex + pDrawContext->dwVertexCount; + // When this is an indexed draw, take the index buffer into account + if (pDrawContext->pXboxIndexData) { + // Is the highest index in this buffer not set yet? + if (pDrawContext->HighIndex == 0) { + // TODO : Instead of calling WalkIndexBuffer here, set LowIndex and HighIndex + // in all callers that end up here (since they might be able to avoid the call) + LOG_TEST_CASE("HighIndex == 0"); // TODO : If this is never hit, replace entire block by assert(pDrawContext->HighIndex > 0); + WalkIndexBuffer(pDrawContext->LowIndex, pDrawContext->HighIndex, pDrawContext->pXboxIndexData, pDrawContext->dwVertexCount); + } + // Convert highest index (including the base offset) into a count + DWORD dwHighestVertexCount = pDrawContext->dwBaseVertexIndex + pDrawContext->HighIndex + 1; + // Use the biggest vertex count that can be reached + if (pDrawContext->VerticesInBuffer < dwHighestVertexCount) + pDrawContext->VerticesInBuffer = dwHighestVertexCount; + } // Get the number of streams m_uiNbrStreams = GetNbrStreams(pDrawContext); + if (m_uiNbrStreams > X_VSH_MAX_STREAMS) { + LOG_TEST_CASE("m_uiNbrStreams count > max number of streams"); + m_uiNbrStreams = X_VSH_MAX_STREAMS; + } for(UINT uiStream = 0; uiStream < m_uiNbrStreams; uiStream++) { - // TODO: Check for cached vertex buffer, and use it if possible - ConvertStream(pDrawContext, uiStream); - - // TODO: Cache Vertex Buffer Data } - if (pDrawContext->XboxPrimitiveType == X_D3DPT_QUADSTRIP) { + if (pDrawContext->XboxPrimitiveType == XTL::X_D3DPT_QUADSTRIP) { // Quad strip is just like a triangle strip, but requires two vertices per primitive. // A quadstrip starts with 4 vertices and adds 2 vertices per additional quad. // This is much like a trianglestrip, which starts with 3 vertices and adds @@ -806,12 +805,12 @@ void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext) // handled by d3d : // Test-case : XDK Samples (FocusBlur, MotionBlur, Trees, PaintEffect, PlayField) // No need to set : pDrawContext->XboxPrimitiveType = X_D3DPT_TRIANGLESTRIP; - pDrawContext->dwHostPrimitiveCount = EmuD3DVertex2PrimitiveCount(X_D3DPT_TRIANGLESTRIP, pDrawContext->dwVertexCount); + pDrawContext->dwHostPrimitiveCount = ConvertXboxVertexCountToPrimitiveCount(XTL::X_D3DPT_TRIANGLESTRIP, pDrawContext->dwVertexCount); } else { - pDrawContext->dwHostPrimitiveCount = EmuD3DVertex2PrimitiveCount(pDrawContext->XboxPrimitiveType, pDrawContext->dwVertexCount); + pDrawContext->dwHostPrimitiveCount = ConvertXboxVertexCountToPrimitiveCount(pDrawContext->XboxPrimitiveType, pDrawContext->dwVertexCount); } - if (pDrawContext->XboxPrimitiveType == X_D3DPT_POLYGON) { + if (pDrawContext->XboxPrimitiveType == XTL::X_D3DPT_POLYGON) { // Convex polygon is the same as a triangle fan. // No need to set : pDrawContext->XboxPrimitiveType = X_D3DPT_TRIANGLEFAN; // Test-case : Panzer Dragoon ORTA (when entering in-game) @@ -819,32 +818,32 @@ void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext) } } -VOID XTL::EmuFlushIVB() +VOID EmuFlushIVB() { CxbxUpdateNativeD3DResources(); // Parse IVB table with current FVF shader if possible. - bool bFVF = VshHandleIsFVF(g_CurrentXboxVertexShaderHandle); - DWORD dwCurFVF = (bFVF) ? g_CurrentXboxVertexShaderHandle : g_InlineVertexBuffer_FVF; + bool bFVF = VshHandleIsFVF(g_Xbox_VertexShader_Handle); + DWORD dwCurFVF = (bFVF) ? g_Xbox_VertexShader_Handle : g_InlineVertexBuffer_FVF; - DbgPrintf("g_InlineVertexBuffer_TableOffset := %d\n", g_InlineVertexBuffer_TableOffset); + EmuLog(LOG_LEVEL::DEBUG, "g_InlineVertexBuffer_TableOffset := %d", g_InlineVertexBuffer_TableOffset); // Check the given FVF switch (dwCurFVF & D3DFVF_POSITION_MASK) { case 0: // No position ? if (bFVF) { - EmuWarning("EmuFlushIVB(): g_CurrentXboxVertexShaderHandle isn't a valid FVF - using D3DFVF_XYZRHW instead!"); + EmuLog(LOG_LEVEL::WARNING, "EmuFlushIVB(): g_Xbox_VertexShader_Handle isn't a valid FVF - using D3DFVF_XYZRHW instead!"); dwCurFVF |= D3DFVF_XYZRHW; } else { - EmuWarning("EmuFlushIVB(): using g_InlineVertexBuffer_FVF instead of current FVF!"); + EmuLog(LOG_LEVEL::WARNING, "EmuFlushIVB(): using g_InlineVertexBuffer_FVF instead of current FVF!"); dwCurFVF = g_InlineVertexBuffer_FVF; } break; case D3DFVF_XYZRHW: // D3DFVF_NORMAL isn't allowed in combination with D3DFVF_XYZRHW if (dwCurFVF & D3DFVF_NORMAL) { - EmuWarning("EmuFlushIVB(): Normal encountered while D3DFVF_XYZRHW is given - switching back to D3DFVF_XYZ!"); + EmuLog(LOG_LEVEL::WARNING, "EmuFlushIVB(): Normal encountered while D3DFVF_XYZRHW is given - switching back to D3DFVF_XYZ!"); dwCurFVF &= ~D3DFVF_POSITION_MASK; dwCurFVF |= D3DFVF_XYZ; } @@ -853,9 +852,9 @@ VOID XTL::EmuFlushIVB() DWORD dwPos = dwCurFVF & D3DFVF_POSITION_MASK; DWORD dwTexN = (dwCurFVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT; - size_t TexSize[X_D3DTS_STAGECOUNT]; // Xbox supports up to 4 textures (TEXTURE_STAGES) + size_t TexSize[XTL::X_D3DTS_STAGECOUNT]; // Xbox supports up to 4 textures - for (uint i = 0; i < dwTexN; i++) { + for (unsigned int i = 0; i < dwTexN; i++) { TexSize[i] = DxbxFVF_GetNumberOfTextureCoordinates(dwCurFVF, i); } @@ -873,40 +872,40 @@ VOID XTL::EmuFlushIVB() } FLOAT *pVertexBufferData = g_InlineVertexBuffer_pData; - for(uint v=0;v= 2) { *pVertexBufferData++ = g_InlineVertexBuffer_Table[v].TexCoord[i].y; @@ -952,16 +951,16 @@ VOID XTL::EmuFlushIVB() if (g_bPrintfOn) { switch (TexSize[i]) { - case 1: DbgPrintf("IVB TexCoord%d := {%f}\n", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x); break; - case 2: DbgPrintf("IVB TexCoord%d := {%f, %f}\n", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y); break; - case 3: DbgPrintf("IVB TexCoord%d := {%f, %f, %f}\n", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y, g_InlineVertexBuffer_Table[v].TexCoord[i].z); break; - case 4: DbgPrintf("IVB TexCoord%d := {%f, %f, %f, %f}\n", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y, g_InlineVertexBuffer_Table[v].TexCoord[i].z, g_InlineVertexBuffer_Table[v].TexCoord[i].w); break; + case 1: EmuLog(LOG_LEVEL::DEBUG, "IVB TexCoord%d := {%f}", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x); break; + case 2: EmuLog(LOG_LEVEL::DEBUG, "IVB TexCoord%d := {%f, %f}", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y); break; + case 3: EmuLog(LOG_LEVEL::DEBUG, "IVB TexCoord%d := {%f, %f, %f}", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y, g_InlineVertexBuffer_Table[v].TexCoord[i].z); break; + case 4: EmuLog(LOG_LEVEL::DEBUG, "IVB TexCoord%d := {%f, %f, %f, %f}", i + 1, g_InlineVertexBuffer_Table[v].TexCoord[i].x, g_InlineVertexBuffer_Table[v].TexCoord[i].y, g_InlineVertexBuffer_Table[v].TexCoord[i].z, g_InlineVertexBuffer_Table[v].TexCoord[i].w); break; } } } if (v == 0) { - uint VertexBufferUsage = (uintptr_t)pVertexBufferData - (uintptr_t)g_InlineVertexBuffer_pData; + unsigned int VertexBufferUsage = (uintptr_t)pVertexBufferData - (uintptr_t)g_InlineVertexBuffer_pData; if (VertexBufferUsage != uiStride) { CxbxKrnlCleanup("EmuFlushIVB uses wrong stride!"); } @@ -974,24 +973,31 @@ VOID XTL::EmuFlushIVB() DrawContext.dwVertexCount = g_InlineVertexBuffer_TableOffset; DrawContext.pXboxVertexStreamZeroData = g_InlineVertexBuffer_pData; DrawContext.uiXboxVertexStreamZeroStride = uiStride; - DrawContext.hVertexShader = g_CurrentXboxVertexShaderHandle; HRESULT hRet; if (bFVF) { -#ifdef CXBX_USE_D3D9 g_pD3DDevice->SetVertexShader(nullptr); hRet = g_pD3DDevice->SetFVF(dwCurFVF); -#else - hRet = g_pD3DDevice->SetVertexShader(dwCurFVF); -#endif //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader"); } CxbxDrawPrimitiveUP(DrawContext); if (bFVF) { - hRet = g_pD3DDevice->SetVertexShader(g_CurrentXboxVertexShaderHandle); + hRet = g_pD3DDevice->SetFVF(g_Xbox_VertexShader_Handle); //DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetVertexShader"); } g_InlineVertexBuffer_TableOffset = 0; // Might not be needed (also cleared in D3DDevice_Begin) } + +void CxbxImpl_SetStreamSource(UINT StreamNumber, XTL::X_D3DVertexBuffer* pStreamData, UINT Stride) +{ + if (pStreamData != xbnullptr && Stride == 0) { + LOG_TEST_CASE("CxbxImpl_SetStreamSource : Stream assigned, and stride set to 0 (might be okay)"); + } + + assert(StreamNumber < X_VSH_MAX_STREAMS); + + g_Xbox_SetStreamSource[StreamNumber].VertexBuffer = pStreamData; + g_Xbox_SetStreamSource[StreamNumber].Stride = Stride; +} diff --git a/src/CxbxKrnl/EmuD3D8/VertexBuffer.h b/src/core/hle/D3D8/XbVertexBuffer.h old mode 100755 new mode 100644 similarity index 54% rename from src/CxbxKrnl/EmuD3D8/VertexBuffer.h rename to src/core/hle/D3D8/XbVertexBuffer.h index ab3a89f52..d81224acc --- a/src/CxbxKrnl/EmuD3D8/VertexBuffer.h +++ b/src/core/hle/D3D8/XbVertexBuffer.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->VertexBuffer.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,61 +22,75 @@ // * All rights reserved // * // ****************************************************************** -#ifndef VERTEXBUFFER_H -#define VERTEXBUFFER_H +#ifndef XBVERTEXBUFFER_H +#define XBVERTEXBUFFER_H + +#include +#include #include "Cxbx.h" -//#include // Conflict with io.h -#define MAX_NBR_STREAMS 16 +#include "core\hle\D3D8\XbVertexShader.h" // for CxbxVertexShaderInfo typedef struct _CxbxDrawContext { - IN X_D3DPRIMITIVETYPE XboxPrimitiveType; + IN XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType; IN DWORD dwVertexCount; IN DWORD dwStartVertex; // Only D3DDevice_DrawVertices sets this (potentially higher than default 0) - // The current vertex shader, used to identify the streams - IN DWORD hVertexShader; - IN PWORD pIndexData; - IN DWORD dwIndexBase; - IN size_t VerticesInBuffer; + IN PWORD pXboxIndexData; // Set by D3DDevice_DrawIndexedVertices, D3DDevice_DrawIndexedVerticesUP and HLE_draw_inline_elements + IN DWORD dwBaseVertexIndex; // Set to g_Xbox_BaseVertexIndex in D3DDevice_DrawIndexedVertices + IN INDEX16 LowIndex, HighIndex; // Set when pXboxIndexData is set + IN size_t VerticesInBuffer; // Set by CxbxVertexBufferConverter::Apply // Data if Draw...UP call IN PVOID pXboxVertexStreamZeroData; IN UINT uiXboxVertexStreamZeroStride; // Values to be used on host OUT PVOID pHostVertexStreamZeroData; OUT UINT uiHostVertexStreamZeroStride; - OUT DWORD dwHostPrimitiveCount; + OUT DWORD dwHostPrimitiveCount; // Set by CxbxVertexBufferConverter::Apply } CxbxDrawContext; -typedef struct _CxbxPatchedStream +class CxbxPatchedStream { - UINT uiCachedXboxVertexStride; - UINT uiCachedHostVertexStride; - bool bCacheIsStreamZeroDrawUP; - void *pCachedHostVertexStreamZeroData; - bool bCachedHostVertexStreamZeroDataIsAllocated; - XTL::IDirect3DVertexBuffer *pCachedHostVertexBuffer; -} CxbxPatchedStream; +public: + CxbxPatchedStream(); + ~CxbxPatchedStream(); + void Activate(CxbxDrawContext *pDrawContext, UINT uiStream) const; + bool isValid = false; + XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType = XTL::X_D3DPT_NONE; + PVOID pCachedXboxVertexData = xbnullptr; + UINT uiCachedXboxVertexDataSize = 0; + uint64_t uiVertexDataHash = 0; + uint64_t uiVertexStreamInformationHash = 0; + UINT uiCachedXboxVertexStride = 0; + UINT uiCachedHostVertexStride = 0; + bool bCacheIsStreamZeroDrawUP = false; + void *pCachedHostVertexStreamZeroData = nullptr; + bool bCachedHostVertexStreamZeroDataIsAllocated = false; + IDirect3DVertexBuffer *pCachedHostVertexBuffer = nullptr; +}; class CxbxVertexBufferConverter { public: CxbxVertexBufferConverter(); - ~CxbxVertexBufferConverter(); - void Apply(CxbxDrawContext *pPatchDesc); + void PrintStats(); private: - UINT m_uiNbrStreams; - CxbxPatchedStream m_PatchedStreams[MAX_NBR_STREAMS]; - PVOID m_pNewVertexStreamZeroData; + // Stack tracking + ULONG m_TotalCacheHits = 0; + ULONG m_TotalCacheMisses = 0; - bool m_bAllocatedStreamZeroData; + UINT m_MaxCacheSize = 2000; // Maximum number of entries in the cache + UINT m_CacheElasticity = 200; // Cache is allowed to grow this much more than maximum before being purged to maximum + std::unordered_map::iterator> m_PatchedStreams; // Stores references to patched streams for fast lookup + std::list m_PatchedStreamUsageList; // Linked list of vertex streams, least recently used is last in the list + CxbxPatchedStream& GetPatchedStream(uint64_t); // Fetches (or inserts) a patched stream associated with the given key - XTL::CxbxVertexShaderInfo *m_pVertexShaderInfo; + CxbxVertexShaderInfo *m_pVertexShaderInfo; // Returns the number of streams of a patch UINT GetNbrStreams(CxbxDrawContext *pPatchDesc); @@ -95,21 +100,21 @@ class CxbxVertexBufferConverter }; // inline vertex buffer emulation -extern X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType; +extern XTL::X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType; extern DWORD g_InlineVertexBuffer_FVF; extern struct _D3DIVB { - XTL::D3DXVECTOR3 Position; // X_D3DVSDE_POSITION (*) > D3DFVF_XYZ / D3DFVF_XYZRHW + D3DXVECTOR3 Position; // X_D3DVSDE_POSITION (*) > D3DFVF_XYZ / D3DFVF_XYZRHW FLOAT Rhw; // X_D3DVSDE_VERTEX (*) > D3DFVF_XYZ / D3DFVF_XYZRHW FLOAT Blend[4]; // X_D3DVSDE_BLENDWEIGHT > D3DFVF_XYZB1 (and 3 more up to D3DFVF_XYZB4) - XTL::D3DXVECTOR3 Normal; // X_D3DVSDE_NORMAL > D3DFVF_NORMAL + D3DXVECTOR3 Normal; // X_D3DVSDE_NORMAL > D3DFVF_NORMAL D3DCOLOR Diffuse; // X_D3DVSDE_DIFFUSE > D3DFVF_DIFFUSE D3DCOLOR Specular; // X_D3DVSDE_SPECULAR > D3DFVF_SPECULAR FLOAT Fog; // X_D3DVSDE_FOG > D3DFVF_FOG unavailable; TODO : How to handle? D3DCOLOR BackDiffuse; // X_D3DVSDE_BACKDIFFUSE > D3DFVF_BACKDIFFUSE unavailable; TODO : How to handle? D3DCOLOR BackSpecular; // X_D3DVSDE_BACKSPECULAR > D3DFVF_BACKSPECULAR unavailable; TODO : How to handle? - XTL::D3DXVECTOR4 TexCoord[4]; // X_D3DVSDE_TEXCOORD0 > D3DFVF_TEX1 (and 4 more up to D3DFVF_TEX4) + D3DXVECTOR4 TexCoord[4]; // X_D3DVSDE_TEXCOORD0 > D3DFVF_TEX1 (and 4 more up to D3DFVF_TEX4) // (*) X_D3DVSDE_POSITION and X_D3DVSDE_VERTEX both set Position, but Rhw seems optional, // hence, selection for D3DFVF_XYZ or D3DFVF_XYZRHW is rather fuzzy. We DO know that once @@ -126,4 +131,4 @@ extern VOID EmuUpdateActiveTexture(); extern DWORD g_dwPrimPerFrame; -#endif \ No newline at end of file +#endif diff --git a/src/core/hle/D3D8/XbVertexShader.cpp b/src/core/hle/D3D8/XbVertexShader.cpp new file mode 100644 index 000000000..cc4f0124a --- /dev/null +++ b/src/core/hle/D3D8/XbVertexShader.cpp @@ -0,0 +1,1343 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2004 Aaron Robinson +// * Kingofc +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::VTXSH + +#define _DEBUG_TRACK_VS + +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For g_Xbox_VertexShader_Handle +#include "core\hle\D3D8\XbVertexShader.h" + +#include "XbD3D8Types.h" // For X_D3DVSDE_* +#include +#include +#include +#include + +#define DbgVshPrintf \ + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) \ + if(g_bPrintfOn) printf + +// **************************************************************************** +// * Vertex shader function recompiler +// **************************************************************************** + +class XboxVertexShaderDecoder +{ +private: + // Xbox Vertex SHader microcode types + + enum VSH_OUTPUT_TYPE { + OUTPUT_C = 0, + OUTPUT_O + }; + + enum VSH_OUTPUT_MUX { + OMUX_MAC = 0, + OMUX_ILU + }; + + // Host intermediate vertex shader types + + enum VSH_FIELD_NAME { + FLD_ILU = 0, + FLD_MAC, + FLD_CONST, + FLD_V, + // Input A + FLD_A_NEG, + FLD_A_SWZ_X, + FLD_A_SWZ_Y, + FLD_A_SWZ_Z, + FLD_A_SWZ_W, + FLD_A_R, + FLD_A_MUX, + // Input B + FLD_B_NEG, + FLD_B_SWZ_X, + FLD_B_SWZ_Y, + FLD_B_SWZ_Z, + FLD_B_SWZ_W, + FLD_B_R, + FLD_B_MUX, + // Input C + FLD_C_NEG, + FLD_C_SWZ_X, + FLD_C_SWZ_Y, + FLD_C_SWZ_Z, + FLD_C_SWZ_W, + FLD_C_R_HIGH, + FLD_C_R_LOW, + FLD_C_MUX, + // Output + FLD_OUT_MAC_MASK, + FLD_OUT_R, + FLD_OUT_ILU_MASK, + FLD_OUT_O_MASK, + FLD_OUT_ORB, + FLD_OUT_ADDRESS, + FLD_OUT_MUX, + // Relative addressing + FLD_A0X, + // Final instruction + FLD_FINAL + }; + + // Retrieves a number of bits in the instruction token + static inline uint32_t VshGetFromToken( + uint32_t* pShaderToken, + uint8_t SubToken, + uint8_t StartBit, + uint8_t BitLength) + { + return (pShaderToken[SubToken] >> StartBit) & ~(0xFFFFFFFF << BitLength); + } + + static uint8_t VshGetField( + uint32_t* pShaderToken, + VSH_FIELD_NAME FieldName) + { + // Used for xvu spec definition + static const struct { + uint8_t SubToken; + uint8_t StartBit; + uint8_t BitLength; + } FieldMapping[/*VSH_FIELD_NAME*/] = { + // SubToken BitPos BitSize + { 1, 25, 3 }, // FLD_ILU, + { 1, 21, 4 }, // FLD_MAC, + { 1, 13, 8 }, // FLD_CONST, + { 1, 9, 4 }, // FLD_V, + // Input A + { 1, 8, 1 }, // FLD_A_NEG, + { 1, 6, 2 }, // FLD_A_SWZ_X, + { 1, 4, 2 }, // FLD_A_SWZ_Y, + { 1, 2, 2 }, // FLD_A_SWZ_Z, + { 1, 0, 2 }, // FLD_A_SWZ_W, + { 2, 28, 4 }, // FLD_A_R, + { 2, 26, 2 }, // FLD_A_MUX, + // Input B + { 2, 25, 1 }, // FLD_B_NEG, + { 2, 23, 2 }, // FLD_B_SWZ_X, + { 2, 21, 2 }, // FLD_B_SWZ_Y, + { 2, 19, 2 }, // FLD_B_SWZ_Z, + { 2, 17, 2 }, // FLD_B_SWZ_W, + { 2, 13, 4 }, // FLD_B_R, + { 2, 11, 2 }, // FLD_B_MUX, + // Input C + { 2, 10, 1 }, // FLD_C_NEG, + { 2, 8, 2 }, // FLD_C_SWZ_X, + { 2, 6, 2 }, // FLD_C_SWZ_Y, + { 2, 4, 2 }, // FLD_C_SWZ_Z, + { 2, 2, 2 }, // FLD_C_SWZ_W, + { 2, 0, 2 }, // FLD_C_R_HIGH, + { 3, 30, 2 }, // FLD_C_R_LOW, + { 3, 28, 2 }, // FLD_C_MUX, + // Output + { 3, 24, 4 }, // FLD_OUT_MAC_MASK, + { 3, 20, 4 }, // FLD_OUT_R, + { 3, 16, 4 }, // FLD_OUT_ILU_MASK, + { 3, 12, 4 }, // FLD_OUT_O_MASK, + { 3, 11, 1 }, // FLD_OUT_ORB, + { 3, 3, 8 }, // FLD_OUT_ADDRESS, + { 3, 2, 1 }, // FLD_OUT_MUX, + // Relative addressing + { 3, 1, 1 }, // FLD_A0X, + // Final instruction + { 3, 0, 1 } // FLD_FINAL, + }; + + return (uint8_t)(VshGetFromToken(pShaderToken, + FieldMapping[FieldName].SubToken, + FieldMapping[FieldName].StartBit, + FieldMapping[FieldName].BitLength)); + } + + // Converts the C register address to disassembly format + static inline int16_t ConvertCRegister(const int16_t CReg) + { + return ((((CReg >> 5) & 7) - 3) * 32) + (CReg & 31); + } + + static void VshConvertIntermediateParam(VSH_IMD_PARAMETER& Param, + uint32_t* pShaderToken, + VSH_FIELD_NAME FLD_MUX, + VSH_FIELD_NAME FLD_NEG, + uint16_t R, + uint16_t V, + uint16_t C) + { + Param.ParameterType = (VSH_PARAMETER_TYPE)VshGetField(pShaderToken, FLD_MUX); + switch (Param.ParameterType) { + case PARAM_R: + Param.Address = R; + break; + case PARAM_V: + Param.Address = V; + break; + case PARAM_C: + Param.Address = C; + break; + default: + LOG_TEST_CASE("parameter type unknown"); + } + + int d = FLD_NEG - FLD_A_NEG; + Param.Neg = VshGetField(pShaderToken, (VSH_FIELD_NAME)(d + FLD_A_NEG)) > 0; + Param.Swizzle[0] = (VSH_SWIZZLE)VshGetField(pShaderToken, (VSH_FIELD_NAME)(d + FLD_A_SWZ_X)); + Param.Swizzle[1] = (VSH_SWIZZLE)VshGetField(pShaderToken, (VSH_FIELD_NAME)(d + FLD_A_SWZ_Y)); + Param.Swizzle[2] = (VSH_SWIZZLE)VshGetField(pShaderToken, (VSH_FIELD_NAME)(d + FLD_A_SWZ_Z)); + Param.Swizzle[3] = (VSH_SWIZZLE)VshGetField(pShaderToken, (VSH_FIELD_NAME)(d + FLD_A_SWZ_W)); + } + + void VshAddIntermediateInstruction( + uint32_t* pShaderToken, + IntermediateVertexShader* pShader, + VSH_MAC MAC, + VSH_ILU ILU, + VSH_IMD_OUTPUT_TYPE output_type, + int16_t output_address, + int8_t output_mask) + { + // Is the output mask set? + if (output_mask == 0) { + return; + } + + if (pShader->Instructions.size() >= VSH_MAX_INTERMEDIATE_COUNT) { + CxbxKrnlCleanup("Shader exceeds conversion buffer!"); + } + + VSH_INTERMEDIATE_FORMAT intermediate; + intermediate.MAC = MAC; + intermediate.ILU = ILU; + intermediate.Output.Type = output_type; + intermediate.Output.Address = output_address; + intermediate.Output.Mask = output_mask; + // Get a0.x indirect constant addressing + intermediate.IndexesWithA0_X = VshGetField(pShaderToken, FLD_A0X) > 0; // Applies to PARAM_C parameter reads + + int16_t R; + int16_t V = VshGetField(pShaderToken, FLD_V); + int16_t C = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST)); + intermediate.ParamCount = 0; + if (MAC >= MAC_MOV) { + // Get parameter A + R = VshGetField(pShaderToken, FLD_A_R); + VshConvertIntermediateParam(intermediate.Parameters[intermediate.ParamCount++], pShaderToken, FLD_A_MUX, FLD_A_NEG, R, V, C); + } + + if ((MAC == MAC_MUL) || ((MAC >= MAC_MAD) && (MAC <= MAC_SGE))) { + // Get parameter B + R = VshGetField(pShaderToken, FLD_B_R); + VshConvertIntermediateParam(intermediate.Parameters[intermediate.ParamCount++], pShaderToken, FLD_B_MUX, FLD_B_NEG, R, V, C); + } + + if ((ILU >= ILU_MOV) || (MAC == MAC_ADD) || (MAC == MAC_MAD)) { + // Get parameter C + R = VshGetField(pShaderToken, FLD_C_R_HIGH) << 2 | VshGetField(pShaderToken, FLD_C_R_LOW); + VshConvertIntermediateParam(intermediate.Parameters[intermediate.ParamCount++], pShaderToken, FLD_C_MUX, FLD_C_NEG, R, V, C); + } + + // Add the instruction to the shader + pShader->Instructions.push_back(intermediate); + } + +public: + bool VshConvertToIntermediate(uint32_t* pShaderToken, IntermediateVertexShader* pShader) + { + // First get the instruction(s). + VSH_ILU ILU = (VSH_ILU)VshGetField(pShaderToken, FLD_ILU); + VSH_MAC MAC = (VSH_MAC)VshGetField(pShaderToken, FLD_MAC); + if (MAC > MAC_ARL) LOG_TEST_CASE("Unknown MAC"); + + // Output register + VSH_OUTPUT_MUX OutputMux = (VSH_OUTPUT_MUX)VshGetField(pShaderToken, FLD_OUT_MUX); + int16_t OutputAddress = VshGetField(pShaderToken, FLD_OUT_ADDRESS); + VSH_IMD_OUTPUT_TYPE OutputType; + if ((VSH_OUTPUT_TYPE)VshGetField(pShaderToken, FLD_OUT_ORB) == OUTPUT_C) { + OutputType = IMD_OUTPUT_C; + OutputAddress = ConvertCRegister(OutputAddress); + } else { // OUTPUT_O: + OutputType = IMD_OUTPUT_O; + OutputAddress = OutputAddress & 0xF; + } + + // MAC,ILU output R register + int16_t RAddress = VshGetField(pShaderToken, FLD_OUT_R); + + // Test for paired opcodes + bool bIsPaired = (MAC != MAC_NOP) && (ILU != ILU_NOP); + + // Check if there's a MAC opcode + if (MAC > MAC_NOP && MAC <= MAC_ARL) { + if (bIsPaired && RAddress == 1) { + // Ignore paired MAC opcodes that write to R1 + } else { + if (MAC == MAC_ARL) { + VshAddIntermediateInstruction(pShaderToken, pShader, MAC, ILU_NOP, IMD_OUTPUT_A0X, 0, MASK_X); + } else { + VshAddIntermediateInstruction(pShaderToken, pShader, MAC, ILU_NOP, IMD_OUTPUT_R, RAddress, VshGetField(pShaderToken, FLD_OUT_MAC_MASK)); + } + } + + // Check if we must add a muxed MAC opcode as well + if (OutputMux == OMUX_MAC) { + VshAddIntermediateInstruction(pShaderToken, pShader, MAC, ILU_NOP, OutputType, OutputAddress, VshGetField(pShaderToken, FLD_OUT_O_MASK)); + } + } + + // Check if there's an ILU opcode + if (ILU != ILU_NOP) { + // Paired ILU opcodes will only write to R1 + VshAddIntermediateInstruction(pShaderToken, pShader, MAC_NOP, ILU, IMD_OUTPUT_R, bIsPaired ? 1 : RAddress, VshGetField(pShaderToken, FLD_OUT_ILU_MASK)); + // Check if we must add a muxed ILU opcode as well + if (OutputMux == OMUX_ILU) { + VshAddIntermediateInstruction(pShaderToken, pShader, MAC_NOP, ILU, OutputType, OutputAddress, VshGetField(pShaderToken, FLD_OUT_O_MASK)); + } + } + + return VshGetField(pShaderToken, FLD_FINAL) == 0; + } + +}; + +// **************************************************************************** +// * Vertex shader declaration recompiler +// **************************************************************************** + +extern D3DCAPS g_D3DCaps; + +class XboxVertexDeclarationConverter +{ +protected: + // Internal variables + CxbxVertexShaderInfo* pVertexShaderInfoToSet; + CxbxVertexShaderStreamInfo* pCurrentVertexShaderStreamInfo = nullptr; + bool IsFixedFunction; + D3DVERTEXELEMENT* pRecompiled; + std::array RegVIsPresentInDeclaration; + +public: + // Output + DWORD XboxDeclarationCount; + +private: + #define D3DDECLUSAGE_UNSUPPORTED ((D3DDECLUSAGE)-1) + + static D3DDECLUSAGE Xb2PCRegisterType + ( + DWORD VertexRegister, + BYTE& PCUsageIndex + ) + { + D3DDECLUSAGE PCRegisterType; + PCUsageIndex = 0; + + switch (VertexRegister) + { + case (DWORD)XTL::X_D3DVSDE_VERTEX: // -1 + PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; + break; + case XTL::X_D3DVSDE_POSITION: // 0 + PCRegisterType = D3DDECLUSAGE_POSITION; + break; + case XTL::X_D3DVSDE_BLENDWEIGHT: // 1 + PCRegisterType = D3DDECLUSAGE_BLENDWEIGHT; + break; + case XTL::X_D3DVSDE_NORMAL: // 2 + PCRegisterType = D3DDECLUSAGE_NORMAL; + break; + case XTL::X_D3DVSDE_DIFFUSE: // 3 + PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 0; + break; + case XTL::X_D3DVSDE_SPECULAR: // 4 + PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 1; + break; + case XTL::X_D3DVSDE_FOG: // 5 + PCRegisterType = D3DDECLUSAGE_FOG; + break; + case XTL::X_D3DVSDE_POINTSIZE: // 6 + PCRegisterType = D3DDECLUSAGE_PSIZE; + break; + case XTL::X_D3DVSDE_BACKDIFFUSE: // 7 + PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 2; + break; + case XTL::X_D3DVSDE_BACKSPECULAR: // 8 + PCRegisterType = D3DDECLUSAGE_COLOR; PCUsageIndex = 3; + break; + case XTL::X_D3DVSDE_TEXCOORD0: // 9 + PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 0; + break; + case XTL::X_D3DVSDE_TEXCOORD1: // 10 + PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 1; + break; + case XTL::X_D3DVSDE_TEXCOORD2: // 11 + PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 2; + break; + case XTL::X_D3DVSDE_TEXCOORD3: // 12 + PCRegisterType = D3DDECLUSAGE_TEXCOORD; PCUsageIndex = 3; + break; + default: + PCRegisterType = D3DDECLUSAGE_UNSUPPORTED; + break; + } + + return PCRegisterType; + } + + static char* XboxVertexRegisterAsString(DWORD VertexRegister) + { + switch (VertexRegister) + { + case (DWORD)XTL::X_D3DVSDE_VERTEX: // -1 + return "D3DVSDE_VERTEX /* xbox ext. */"; + case XTL::X_D3DVSDE_POSITION: // 0 + return "D3DVSDE_POSITION"; + case XTL::X_D3DVSDE_BLENDWEIGHT: // 1 + return "D3DVSDE_BLENDWEIGHT"; + case XTL::X_D3DVSDE_NORMAL: // 2 + return "D3DVSDE_NORMAL"; + case XTL::X_D3DVSDE_DIFFUSE: // 3 + return "D3DVSDE_DIFFUSE"; + case XTL::X_D3DVSDE_SPECULAR: // 4 + return "D3DVSDE_SPECULAR"; + case XTL::X_D3DVSDE_FOG: // 5 + return "D3DVSDE_FOG"; + case XTL::X_D3DVSDE_POINTSIZE: // 6 + return "D3DVDSE_POINTSIZE"; + case XTL::X_D3DVSDE_BACKDIFFUSE: // 7 + return "D3DVSDE_BACKDIFFUSE /* xbox ext. */"; + case XTL::X_D3DVSDE_BACKSPECULAR: // 8 + return "D3DVSDE_BACKSPECULAR /* xbox ext. */"; + case XTL::X_D3DVSDE_TEXCOORD0: // 9 + return "D3DVSDE_TEXCOORD0"; + case XTL::X_D3DVSDE_TEXCOORD1: // 10 + return "D3DVSDE_TEXCOORD1"; + case XTL::X_D3DVSDE_TEXCOORD2: // 11 + return "D3DVSDE_TEXCOORD2"; + case XTL::X_D3DVSDE_TEXCOORD3: // 12 + return "D3DVSDE_TEXCOORD3"; + case 13: + return "13 /* unknown register */"; + case 14: + return "14 /* unknown register */"; + case 15: + return "15 /* unknown register */"; + default: + return "16 /* or higher, unknown register */"; + } + } + + // VERTEX SHADER + + static DWORD VshGetDeclarationCount(DWORD *pXboxDeclaration) + { + DWORD Pos = 0; + while (pXboxDeclaration[Pos] != X_D3DVSD_END()) + { + Pos++; + } + + return Pos + 1; + } + + static inline DWORD VshGetTokenType(DWORD XboxToken) + { + return (XboxToken & X_D3DVSD_TOKENTYPEMASK) >> X_D3DVSD_TOKENTYPESHIFT; + } + + static inline WORD VshGetVertexStream(DWORD XboxToken) + { + return (XboxToken & X_D3DVSD_STREAMNUMBERMASK) >> X_D3DVSD_STREAMNUMBERSHIFT; + } + + static inline DWORD VshGetVertexRegister(DWORD XboxToken) + { + DWORD regNum = (XboxToken & X_D3DVSD_VERTEXREGMASK) >> X_D3DVSD_VERTEXREGSHIFT; + return regNum; + } + + static inline DWORD VshGetVertexRegisterIn(DWORD XboxToken) + { + DWORD regNum = (XboxToken & X_D3DVSD_VERTEXREGINMASK) >> X_D3DVSD_VERTEXREGINSHIFT; + return regNum; + } + + void VshDumpXboxDeclaration(DWORD* pXboxDeclaration) + { + DbgVshPrintf("DWORD dwVSHDecl[] =\n{\n"); + unsigned iNumberOfVertexStreams = 0; + bool bStreamNeedsPatching = false; + auto pXboxToken = pXboxDeclaration; + while (*pXboxToken != X_D3DVSD_END()) // X_D3DVSD_TOKEN_END + { + DWORD Step = 1; + + switch (VshGetTokenType(*pXboxToken)) { + case XTL::X_D3DVSD_TOKEN_NOP: { + DbgVshPrintf("\tD3DVSD_NOP(),\n"); + break; + } + case XTL::X_D3DVSD_TOKEN_STREAM: { + if (*pXboxToken & X_D3DVSD_STREAMTESSMASK) { + DbgVshPrintf("\tD3DVSD_STREAM_TESS(),\n"); + } else { + if (iNumberOfVertexStreams > 0) { + DbgVshPrintf("\t// NeedPatching: %d\n", bStreamNeedsPatching); + } + DWORD StreamNumber = VshGetVertexStream(*pXboxToken); + DbgVshPrintf("\tD3DVSD_STREAM(%u),\n", StreamNumber); + iNumberOfVertexStreams++; + bStreamNeedsPatching = false; + } + break; + } + case XTL::X_D3DVSD_TOKEN_STREAMDATA: { + if (*pXboxToken & X_D3DVSD_MASK_SKIP) { + WORD SkipCount = (*pXboxToken & X_D3DVSD_SKIPCOUNTMASK) >> X_D3DVSD_SKIPCOUNTSHIFT; + if (*pXboxToken & X_D3DVSD_MASK_SKIPBYTES) { + DbgVshPrintf("\tD3DVSD_SKIPBYTES(%d), /* xbox ext. */\n", SkipCount); + } else { + DbgVshPrintf("\tD3DVSD_SKIP(%d),\n", SkipCount); + } + } else { + DWORD VertexRegister = VshGetVertexRegister(*pXboxToken); + if (IsFixedFunction) { + DbgVshPrintf("\t\tD3DVSD_REG(%s, ", XboxVertexRegisterAsString(VertexRegister)); + } else { + DbgVshPrintf("\t\tD3DVSD_REG(%d, ", (BYTE)VertexRegister); + } + + DWORD XboxVertexElementDataType = (*pXboxToken & X_D3DVSD_DATATYPEMASK) >> X_D3DVSD_DATATYPESHIFT; + switch (XboxVertexElementDataType) { + case XTL::X_D3DVSDT_FLOAT1: // 0x12: + DbgVshPrintf("D3DVSDT_FLOAT1"); + break; + case XTL::X_D3DVSDT_FLOAT2: // 0x22: + DbgVshPrintf("D3DVSDT_FLOAT2"); + break; + case XTL::X_D3DVSDT_FLOAT3: // 0x32: + DbgVshPrintf("D3DVSDT_FLOAT3"); + break; + case XTL::X_D3DVSDT_FLOAT4: // 0x42: + DbgVshPrintf("D3DVSDT_FLOAT4"); + break; + case XTL::X_D3DVSDT_D3DCOLOR: // 0x40: + DbgVshPrintf("D3DVSDT_D3DCOLOR"); + break; + case XTL::X_D3DVSDT_SHORT2: // 0x25: + DbgVshPrintf("D3DVSDT_SHORT2"); + break; + case XTL::X_D3DVSDT_SHORT4: // 0x45: + DbgVshPrintf("D3DVSDT_SHORT4"); + break; + case XTL::X_D3DVSDT_NORMSHORT1: // 0x11: + DbgVshPrintf("D3DVSDT_NORMSHORT1 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_NORMSHORT2: // 0x21: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { + DbgVshPrintf("D3DVSDT_NORMSHORT2"); + } else { + DbgVshPrintf("D3DVSDT_NORMSHORT2 /* xbox ext. */"); + bStreamNeedsPatching = true; + } + break; + case XTL::X_D3DVSDT_NORMSHORT3: // 0x31: + DbgVshPrintf("D3DVSDT_NORMSHORT3 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_NORMSHORT4: // 0x41: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { + DbgVshPrintf("D3DVSDT_NORMSHORT4"); + // No need for patching in D3D9 + } else { + DbgVshPrintf("D3DVSDT_NORMSHORT4 /* xbox ext. */"); + bStreamNeedsPatching = true; + } + break; + case XTL::X_D3DVSDT_NORMPACKED3: // 0x16: + DbgVshPrintf("D3DVSDT_NORMPACKED3 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_SHORT1: // 0x15: + DbgVshPrintf("D3DVSDT_SHORT1 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_SHORT3: // 0x35: + DbgVshPrintf("D3DVSDT_SHORT3 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_PBYTE1: // 0x14: + DbgVshPrintf("D3DVSDT_PBYTE1 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_PBYTE2: // 0x24: + DbgVshPrintf("D3DVSDT_PBYTE2 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_PBYTE3: // 0x34: + DbgVshPrintf("D3DVSDT_PBYTE3 /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_PBYTE4: // 0x44: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { + DbgVshPrintf("D3DVSDT_PBYTE4"); + } else { + DbgVshPrintf("D3DVSDT_PBYTE4 /* xbox ext. */"); + bStreamNeedsPatching = true; + } + break; + case XTL::X_D3DVSDT_FLOAT2H: // 0x72: + DbgVshPrintf("D3DVSDT_FLOAT2H /* xbox ext. */"); + bStreamNeedsPatching = true; + break; + case XTL::X_D3DVSDT_NONE: // 0x02: + DbgVshPrintf("D3DVSDT_NONE /* xbox ext. */"); + break; + default: + DbgVshPrintf("Unknown data type for D3DVSD_REG: 0x%02X\n", XboxVertexElementDataType); + break; + } + + DbgVshPrintf("),\n"); + }; + break; + } + case XTL::X_D3DVSD_TOKEN_TESSELLATOR: { + DWORD VertexRegisterOut = VshGetVertexRegister(*pXboxToken); + if (*pXboxToken & X_D3DVSD_MASK_TESSUV) { + DbgVshPrintf("\tD3DVSD_TESSUV(%s),\n", XboxVertexRegisterAsString(VertexRegisterOut)); + } else { // D3DVSD_TESSNORMAL + DWORD VertexRegisterIn = VshGetVertexRegisterIn(*pXboxToken); + DbgVshPrintf("\tD3DVSD_TESSNORMAL(%s, %s),\n", + XboxVertexRegisterAsString(VertexRegisterIn), + XboxVertexRegisterAsString(VertexRegisterOut)); + } + break; + } + case XTL::X_D3DVSD_TOKEN_CONSTMEM: { + DWORD ConstantAddress = (*pXboxToken & X_D3DVSD_CONSTADDRESSMASK) >> X_D3DVSD_CONSTADDRESSSHIFT; + DWORD Count = (*pXboxToken & X_D3DVSD_CONSTCOUNTMASK) >> X_D3DVSD_CONSTCOUNTSHIFT; + DbgVshPrintf("\tD3DVSD_CONST(%d, %d),\n", ConstantAddress, Count); + LOG_TEST_CASE("X_D3DVSD_TOKEN_CONSTMEM"); + Step = Count * 4 + 1; + break; + } + case XTL::X_D3DVSD_TOKEN_EXT: { + DWORD ExtInfo = (*pXboxToken & X_D3DVSD_EXTINFOMASK) >> X_D3DVSD_EXTINFOSHIFT; + DWORD Count = (*pXboxToken & X_D3DVSD_EXTCOUNTMASK) >> X_D3DVSD_EXTCOUNTSHIFT; + DbgVshPrintf("\tD3DVSD_EXT(%d, %d),\n", ExtInfo, Count); + LOG_TEST_CASE("X_D3DVSD_TOKEN_EXT"); + Step = Count * 4 + 1; // TODO : Is this correct? + break; + } + default: + DbgVshPrintf("Unknown token type: %d\n", VshGetTokenType(*pXboxToken)); + break; + } + + pXboxToken += Step; + } + + if (iNumberOfVertexStreams > 0) { + DbgVshPrintf("\t// NeedPatching: %d\n", bStreamNeedsPatching); + } + + DbgVshPrintf("\tD3DVSD_END()\n};\n"); + + DbgVshPrintf("// NbrStreams: %d\n", iNumberOfVertexStreams); + } + + static void VshConvertToken_NOP(DWORD *pXboxToken) + { + if(*pXboxToken != X_D3DVSD_NOP()) + { + LOG_TEST_CASE("Token NOP found, but extra parameters are given!"); + } + } + + static DWORD VshConvertToken_CONSTMEM(DWORD *pXboxToken) + { + // DWORD ConstantAddress = (*pXboxToken & X_D3DVSD_CONSTADDRESSMASK) >> X_D3DVSD_CONSTADDRESSSHIFT; + DWORD Count = (*pXboxToken & X_D3DVSD_CONSTCOUNTMASK) >> X_D3DVSD_CONSTCOUNTSHIFT; + LOG_TEST_CASE("CONST"); // TODO : Implement + return Count * 4 + 1; + } + + void VshConvertToken_TESSELATOR(DWORD *pXboxToken) + { + BYTE Index; + + if(*pXboxToken & X_D3DVSD_MASK_TESSUV) + { + DWORD VertexRegister = VshGetVertexRegister(*pXboxToken); + DWORD NewVertexRegister = VertexRegister; + + NewVertexRegister = Xb2PCRegisterType(VertexRegister, Index); + // TODO : Expand on the setting of this TESSUV register element : + pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegister); + pRecompiled->UsageIndex = Index; + } + else // D3DVSD_TESSNORMAL + { + DWORD VertexRegisterIn = VshGetVertexRegisterIn(*pXboxToken); + DWORD VertexRegisterOut = VshGetVertexRegister(*pXboxToken); + + DWORD NewVertexRegisterIn = VertexRegisterIn; + DWORD NewVertexRegisterOut = VertexRegisterOut; + + NewVertexRegisterIn = Xb2PCRegisterType(VertexRegisterIn, Index); + // TODO : Expand on the setting of this TESSNORMAL input register element : + pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegisterIn); + pRecompiled->UsageIndex = Index; + + NewVertexRegisterOut = Xb2PCRegisterType(VertexRegisterOut, Index); + // TODO : Expand on the setting of this TESSNORMAL output register element : + pRecompiled++; + pRecompiled->Usage = D3DDECLUSAGE(NewVertexRegisterOut); + pRecompiled->UsageIndex = Index; + } + } + + void VshConvertToken_STREAM(DWORD *pXboxToken) + { + // D3DVSD_STREAM_TESS + if(*pXboxToken & X_D3DVSD_STREAMTESSMASK) + { + // TODO + } + else // D3DVSD_STREAM + { + DWORD StreamNumber = VshGetVertexStream(*pXboxToken); + + // new stream + pCurrentVertexShaderStreamInfo = &(pVertexShaderInfoToSet->VertexStreams[StreamNumber]); + pCurrentVertexShaderStreamInfo->NeedPatch = FALSE; + pCurrentVertexShaderStreamInfo->DeclPosition = FALSE; + pCurrentVertexShaderStreamInfo->CurrentStreamNumber = 0; + pCurrentVertexShaderStreamInfo->HostVertexStride = 0; + pCurrentVertexShaderStreamInfo->NumberOfVertexElements = 0; + + // Dxbx note : Use Dophin(s), FieldRender, MatrixPaletteSkinning and PersistDisplay as a testcase + + pCurrentVertexShaderStreamInfo->CurrentStreamNumber = VshGetVertexStream(*pXboxToken); + pVertexShaderInfoToSet->NumberOfVertexStreams++; + // TODO : Keep a bitmask for all StreamNumber's seen? + } + } + + void VshConvert_RegisterVertexElement( + UINT XboxVertexElementDataType, + UINT XboxVertexElementByteSize, + UINT HostVertexElementByteSize, + BOOL NeedPatching) + { + CxbxVertexShaderStreamElement* pCurrentElement = &(pCurrentVertexShaderStreamInfo->VertexElements[pCurrentVertexShaderStreamInfo->NumberOfVertexElements]); + pCurrentElement->XboxType = XboxVertexElementDataType; + pCurrentElement->XboxByteSize = XboxVertexElementByteSize; + pCurrentElement->HostByteSize = HostVertexElementByteSize; + pCurrentVertexShaderStreamInfo->NumberOfVertexElements++; + pCurrentVertexShaderStreamInfo->NeedPatch |= NeedPatching; + } + + void VshConvert_SkipBytes(int SkipBytesCount) + { + if (SkipBytesCount % sizeof(DWORD)) { + LOG_TEST_CASE("D3DVSD_SKIPBYTES not divisble by 4!"); + } +#if 0 // Potential optimization, for now disabled for simplicity : + else { + // Skip size is a whole multiple of 4 bytes; + // Is stream patching not needed up until this element? + if (!pCurrentVertexShaderStreamInfo->NeedPatch) { + // Then we can get away with increasing the host stride, + // which avoids otherwise needless vertex buffer patching : + pCurrentVertexShaderStreamInfo->HostVertexStride += SkipBytesCount; + return; + } + } +#endif + + // Register a 'skip' element, so that Xbox data will be skipped + // without increasing host stride - this does require patching : + VshConvert_RegisterVertexElement(XTL::X_D3DVSDT_NONE, SkipBytesCount, /*HostSize=*/0, /*NeedPatching=*/TRUE); + } + + void VshConvertToken_STREAMDATA_SKIP(DWORD *pXboxToken) + { + WORD SkipCount = (*pXboxToken & X_D3DVSD_SKIPCOUNTMASK) >> X_D3DVSD_SKIPCOUNTSHIFT; + VshConvert_SkipBytes(SkipCount * sizeof(DWORD)); + } + + void VshConvertToken_STREAMDATA_SKIPBYTES(DWORD* pXboxToken) + { + WORD SkipBytesCount = (*pXboxToken & X_D3DVSD_SKIPCOUNTMASK) >> X_D3DVSD_SKIPCOUNTSHIFT; + VshConvert_SkipBytes(SkipBytesCount); + } + + void VshConvertToken_STREAMDATA_REG(DWORD *pXboxToken) + { + DWORD VertexRegister = VshGetVertexRegister(*pXboxToken); + BOOL NeedPatching = FALSE; + BYTE Index; + BYTE HostVertexRegisterType; + + if (IsFixedFunction) { + HostVertexRegisterType = Xb2PCRegisterType(VertexRegister, Index); + } else { + // D3DDECLUSAGE_TEXCOORD can be useds for any user-defined data + // We need this because there is no reliable way to detect the real usage + // Xbox has no concept of 'usage types', it only requires a list of attribute register numbers. + // So we treat them all as 'user-defined' with an Index of the Vertex Register Index + // this prevents information loss in shaders due to non-matching dcl types! + HostVertexRegisterType = D3DDECLUSAGE_TEXCOORD; + Index = (BYTE)VertexRegister; + } + + // Add this register to the list of declared registers + RegVIsPresentInDeclaration[VertexRegister] = true; + + DWORD XboxVertexElementDataType = (*pXboxToken & X_D3DVSD_DATATYPEMASK) >> X_D3DVSD_DATATYPESHIFT; + WORD XboxVertexElementByteSize = 0; + BYTE HostVertexElementDataType = 0; + WORD HostVertexElementByteSize = 0; + + switch (XboxVertexElementDataType) + { + case XTL::X_D3DVSDT_FLOAT1: // 0x12: + HostVertexElementDataType = D3DDECLTYPE_FLOAT1; + HostVertexElementByteSize = 1 * sizeof(FLOAT); + break; + case XTL::X_D3DVSDT_FLOAT2: // 0x22: + HostVertexElementDataType = D3DDECLTYPE_FLOAT2; + HostVertexElementByteSize = 2 * sizeof(FLOAT); + break; + case XTL::X_D3DVSDT_FLOAT3: // 0x32: + HostVertexElementDataType = D3DDECLTYPE_FLOAT3; + HostVertexElementByteSize = 3 * sizeof(FLOAT); + break; + case XTL::X_D3DVSDT_FLOAT4: // 0x42: + HostVertexElementDataType = D3DDECLTYPE_FLOAT4; + HostVertexElementByteSize = 4 * sizeof(FLOAT); + break; + case XTL::X_D3DVSDT_D3DCOLOR: // 0x40: + HostVertexElementDataType = D3DDECLTYPE_D3DCOLOR; + HostVertexElementByteSize = 1 * sizeof(D3DCOLOR); + break; + case XTL::X_D3DVSDT_SHORT2: // 0x25: + HostVertexElementDataType = D3DDECLTYPE_SHORT2; + HostVertexElementByteSize = 2 * sizeof(SHORT); + break; + case XTL::X_D3DVSDT_SHORT4: // 0x45: + HostVertexElementDataType = D3DDECLTYPE_SHORT4; + HostVertexElementByteSize = 4 * sizeof(SHORT); + break; + case XTL::X_D3DVSDT_NORMSHORT1: // 0x11: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { + HostVertexElementDataType = D3DDECLTYPE_SHORT2N; + HostVertexElementByteSize = 2 * sizeof(SHORT); + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT1; + HostVertexElementByteSize = 1 * sizeof(FLOAT); + } + XboxVertexElementByteSize = 1 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_NORMSHORT2: // 0x21: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) { + HostVertexElementDataType = D3DDECLTYPE_SHORT2N; + HostVertexElementByteSize = 2 * sizeof(SHORT); + // No need for patching in D3D9 + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT2; + HostVertexElementByteSize = 2 * sizeof(FLOAT); + XboxVertexElementByteSize = 2 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + } + break; + case XTL::X_D3DVSDT_NORMSHORT3: // 0x31: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { + HostVertexElementDataType = D3DDECLTYPE_SHORT4N; + HostVertexElementByteSize = 4 * sizeof(SHORT); + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT3; + HostVertexElementByteSize = 3 * sizeof(FLOAT); + } + XboxVertexElementByteSize = 3 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_NORMSHORT4: // 0x41: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) { + HostVertexElementDataType = D3DDECLTYPE_SHORT4N; + HostVertexElementByteSize = 4 * sizeof(SHORT); + // No need for patching in D3D9 + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT4; + HostVertexElementByteSize = 4 * sizeof(FLOAT); + XboxVertexElementByteSize = 4 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + } + break; + case XTL::X_D3DVSDT_NORMPACKED3: // 0x16: + HostVertexElementDataType = D3DDECLTYPE_FLOAT3; + HostVertexElementByteSize = 3 * sizeof(FLOAT); + XboxVertexElementByteSize = 1 * sizeof(XTL::DWORD); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_SHORT1: // 0x15: + HostVertexElementDataType = D3DDECLTYPE_SHORT2; + HostVertexElementByteSize = 2 * sizeof(SHORT); + XboxVertexElementByteSize = 1 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_SHORT3: // 0x35: + HostVertexElementDataType = D3DDECLTYPE_SHORT4; + HostVertexElementByteSize = 4 * sizeof(SHORT); + XboxVertexElementByteSize = 3 * sizeof(XTL::SHORT); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_PBYTE1: // 0x14: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { + HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; + HostVertexElementByteSize = 4 * sizeof(BYTE); + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT1; + HostVertexElementByteSize = 1 * sizeof(FLOAT); + } + XboxVertexElementByteSize = 1 * sizeof(XTL::BYTE); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_PBYTE2: // 0x24: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { + HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; + HostVertexElementByteSize = 4 * sizeof(BYTE); + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT2; + HostVertexElementByteSize = 2 * sizeof(FLOAT); + } + XboxVertexElementByteSize = 2 * sizeof(XTL::BYTE); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_PBYTE3: // 0x34: + if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { + HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; + HostVertexElementByteSize = 4 * sizeof(BYTE); + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT3; + HostVertexElementByteSize = 3 * sizeof(FLOAT); + } + XboxVertexElementByteSize = 3 * sizeof(XTL::BYTE); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_PBYTE4: // 0x44: + // Test-case : Panzer + if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) { + HostVertexElementDataType = D3DDECLTYPE_UBYTE4N; + HostVertexElementByteSize = 4 * sizeof(BYTE); + // No need for patching when D3D9 supports D3DDECLTYPE_UBYTE4N + } + else + { + HostVertexElementDataType = D3DDECLTYPE_FLOAT4; + HostVertexElementByteSize = 4 * sizeof(FLOAT); + XboxVertexElementByteSize = 4 * sizeof(XTL::BYTE); + NeedPatching = TRUE; + } + break; + case XTL::X_D3DVSDT_FLOAT2H: // 0x72: + HostVertexElementDataType = D3DDECLTYPE_FLOAT4; + HostVertexElementByteSize = 4 * sizeof(FLOAT); + XboxVertexElementByteSize = 3 * sizeof(FLOAT); + NeedPatching = TRUE; + break; + case XTL::X_D3DVSDT_NONE: // 0x02: + // No host element data, so no patching + break; + default: + //LOG_TEST_CASE("Unknown data type for D3DVSD_REG: 0x%02X\n", XboxVertexElementDataType); + break; + } + + // On X_D3DVSDT_NONE skip this token + if (XboxVertexElementDataType == XTL::X_D3DVSDT_NONE) + { + // Xbox elements with X_D3DVSDT_NONE have size zero, so there's no need to register those. + // Note, that for skip tokens, we DO call VshConvert_RegisterVertexElement with a X_D3DVSDT_NONE! + return; + } + + // save patching information + VshConvert_RegisterVertexElement( + XboxVertexElementDataType, + NeedPatching ? XboxVertexElementByteSize : HostVertexElementByteSize, + HostVertexElementByteSize, + NeedPatching); + + pRecompiled->Stream = pCurrentVertexShaderStreamInfo->CurrentStreamNumber; + pRecompiled->Offset = pCurrentVertexShaderStreamInfo->HostVertexStride; + pRecompiled->Type = HostVertexElementDataType; + pRecompiled->Method = D3DDECLMETHOD_DEFAULT; + pRecompiled->Usage = HostVertexRegisterType; + pRecompiled->UsageIndex = Index; + + pRecompiled++; + + pCurrentVertexShaderStreamInfo->HostVertexStride += HostVertexElementByteSize; + } + + void VshConvertToken_STREAMDATA(DWORD *pXboxToken) + { + if (*pXboxToken & X_D3DVSD_MASK_SKIP) + { + // For D3D9, use D3DDECLTYPE_UNUSED ? + if (*pXboxToken & X_D3DVSD_MASK_SKIPBYTES) { + VshConvertToken_STREAMDATA_SKIPBYTES(pXboxToken); + } else { + VshConvertToken_STREAMDATA_SKIP(pXboxToken); + } + } + else // D3DVSD_REG + { + VshConvertToken_STREAMDATA_REG(pXboxToken); + } + } + + DWORD VshRecompileToken(DWORD *pXboxToken) + { + DWORD Step = 1; + + switch(VshGetTokenType(*pXboxToken)) + { + case XTL::X_D3DVSD_TOKEN_NOP: + VshConvertToken_NOP(pXboxToken); + break; + case XTL::X_D3DVSD_TOKEN_STREAM: + { + VshConvertToken_STREAM(pXboxToken); + break; + } + case XTL::X_D3DVSD_TOKEN_STREAMDATA: + { + VshConvertToken_STREAMDATA(pXboxToken); + break; + } + case XTL::X_D3DVSD_TOKEN_TESSELLATOR: + { + VshConvertToken_TESSELATOR(pXboxToken); + break; + } + case XTL::X_D3DVSD_TOKEN_CONSTMEM: + { + Step = VshConvertToken_CONSTMEM(pXboxToken); + break; + } + default: + //LOG_TEST_CASE("Unknown token type: %d\n", VshGetTokenType(*pXboxToken)); + break; + } + + return Step; + } + + static DWORD* RemoveXboxDeclarationRedefinition(DWORD* pXboxDeclaration) + { + // Detect and remove register redefinitions by preprocessing the Xbox Vertex Declaration + // Test Case: King Kong + + // Find the last token + DWORD* pXboxToken = pXboxDeclaration; + while (*pXboxToken != X_D3DVSD_END()){ + pXboxToken++; + } + + // Operate on a copy of the Xbox declaration, rather than messing with the Xbox's memory + auto declarationBytes = sizeof(DWORD) * (pXboxToken - pXboxDeclaration + 1); + auto pXboxDeclarationCopy = (DWORD*)malloc(declarationBytes); + memcpy(pXboxDeclarationCopy, pXboxDeclaration, declarationBytes); + pXboxToken = pXboxDeclarationCopy + (pXboxToken - pXboxDeclaration); // Move to end of the copy + + // Remember if we've seen a given output register + std::bitset<16> seen; + + // We want to keep later definitions, and remove earlier ones + // Scan back from the end of the declaration, and replace redefinitions with nops + while (pXboxToken > pXboxDeclarationCopy) { + auto type = VshGetTokenType(*pXboxToken); + if (type == XTL::X_D3DVSD_TOKEN_STREAMDATA && !(*pXboxToken & X_D3DVSD_MASK_SKIP) || + type == XTL::X_D3DVSD_TOKEN_TESSELLATOR) + { + auto outputRegister = VshGetVertexRegister(*pXboxToken); + if (seen[outputRegister]) + { + // Blank out tokens for mapped registers + *pXboxToken = X_D3DVSD_NOP(); + EmuLog(LOG_LEVEL::DEBUG, "Replacing duplicate definition of register %d with D3DVSD_NOP", outputRegister); + } + else + { + // Mark register as seen + seen[outputRegister] = true; + } + } + + pXboxToken--; + } + + return pXboxDeclarationCopy; + } + +public: + D3DVERTEXELEMENT *Convert(DWORD* pXboxDeclaration, bool bIsFixedFunction, CxbxVertexShaderInfo* pCxbxVertexShaderInfo) + { + // Get a preprocessed copy of the original Xbox Vertex Declaration + auto pXboxVertexDeclarationCopy = RemoveXboxDeclarationRedefinition(pXboxDeclaration); + + pVertexShaderInfoToSet = pCxbxVertexShaderInfo; + + IsFixedFunction = bIsFixedFunction; + + RegVIsPresentInDeclaration.fill(false); + + // First of all some info: + // We have to figure out which flags are set and then + // we have to patch their params + + // some token values + // 0xFFFFFFFF - end of the declaration + // 0x00000000 - nop (means that this value is ignored) + + // Calculate size of declaration + XboxDeclarationCount = VshGetDeclarationCount(pXboxVertexDeclarationCopy); + // For Direct3D9, we need to reserve at least twice the number of elements, as one token can generate two registers (in and out) : + unsigned HostDeclarationSize = XboxDeclarationCount * sizeof(D3DVERTEXELEMENT) * 2; + + D3DVERTEXELEMENT *Result = (D3DVERTEXELEMENT *)calloc(1, HostDeclarationSize); + pRecompiled = Result; + uint8_t *pRecompiledBufferOverflow = ((uint8_t*)pRecompiled) + HostDeclarationSize; + + VshDumpXboxDeclaration(pXboxDeclaration); + + auto pXboxToken = pXboxVertexDeclarationCopy; + while (*pXboxToken != X_D3DVSD_END()) + { + if ((uint8_t*)pRecompiled >= pRecompiledBufferOverflow) { + DbgVshPrintf("Detected buffer-overflow, breaking out...\n"); + break; + } + + DWORD Step = VshRecompileToken(pXboxToken); + pXboxToken += Step; + } + + *pRecompiled = D3DDECL_END(); + + // Ensure valid ordering of the vertex declaration (http://doc.51windows.net/Directx9_SDK/graphics/programmingguide/gettingstarted/vertexdeclaration/vertexdeclaration.htm) + // In particular "All vertex elements for a stream must be consecutive and sorted by offset" + // Test case: King Kong (due to register redefinition) + std::sort(Result, pRecompiled, [] (const auto& x, const auto& y) + { return std::tie(x.Stream, x.Method, x.Offset) < std::tie(y.Stream, y.Method, y.Offset); }); + + // Free the preprocessed declaration copy + free(pXboxVertexDeclarationCopy); + + // Record which registers are in the vertex declaration + for (size_t i = 0; i < RegVIsPresentInDeclaration.size(); i++) { + pCxbxVertexShaderInfo->vRegisterInDeclaration[i] = RegVIsPresentInDeclaration[i]; + } + + return Result; + } +}; + +D3DVERTEXELEMENT *EmuRecompileVshDeclaration +( + DWORD *pXboxDeclaration, + bool bIsFixedFunction, + DWORD *pXboxDeclarationCount, + CxbxVertexShaderInfo *pCxbxVertexShaderInfo +) +{ + XboxVertexDeclarationConverter Converter; + + D3DVERTEXELEMENT* pHostVertexElements = Converter.Convert(pXboxDeclaration, bIsFixedFunction, pCxbxVertexShaderInfo); + + *pXboxDeclarationCount = Converter.XboxDeclarationCount; + + return pHostVertexElements; +} + +extern void FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader) +{ + pVertexShader->VertexShaderInfo.NumberOfVertexStreams = 0; +} + +// Checks for failed vertex shaders, and shaders that would need patching +boolean VshHandleIsValidShader(DWORD XboxVertexShaderHandle) +{ +#if 0 + //printf( "VS = 0x%.08X\n", XboxVertexShaderHandle ); + + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(XboxVertexShaderHandle); + if (pCxbxVertexShader) { + if (pCxbxVertexShader->XboxStatus != 0) + { + return FALSE; + } + /* + for (uint32 i = 0; i < pCxbxVertexShader->VertexShaderInfo.NumberOfVertexStreams; i++) + { + if (pCxbxVertexShader->VertexShaderInfo.VertexStreams[i].NeedPatch) + { + // Just for caching purposes + pCxbxVertexShader->XboxStatus = 0x80000001; + return FALSE; + } + } + */ + } +#endif + return TRUE; +} + +extern boolean IsValidCurrentShader(void) +{ + // Dxbx addition : There's no need to call + // XTL_EmuIDirect3DDevice_GetVertexShader, just check g_Xbox_VertexShader_Handle : + return VshHandleIsValidShader(g_Xbox_VertexShader_Handle); +} + +CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle) +{ + CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(XboxVertexShaderHandle); + + for (uint32_t i = 0; i < pCxbxVertexShader->VertexShaderInfo.NumberOfVertexStreams; i++) + { + if (pCxbxVertexShader->VertexShaderInfo.VertexStreams[i].NeedPatch) + { + return &pCxbxVertexShader->VertexShaderInfo; + } + } + return nullptr; +} + +std::unordered_map g_CxbxVertexShaders; + +CxbxVertexShader* GetCxbxVertexShader(DWORD XboxVertexShaderHandle) +{ + if (VshHandleIsVertexShader(XboxVertexShaderHandle)) { + auto it = g_CxbxVertexShaders.find(XboxVertexShaderHandle); + if (it != g_CxbxVertexShaders.end()) { + return it->second; + } + } + + return nullptr; +} + +void SetCxbxVertexShader(DWORD XboxVertexShaderHandle, CxbxVertexShader* shader) +{ + auto it = g_CxbxVertexShaders.find(XboxVertexShaderHandle); + if (it != g_CxbxVertexShaders.end() && it->second != nullptr && shader != nullptr) { + LOG_TEST_CASE("Overwriting existing Vertex Shader"); + } + + g_CxbxVertexShaders[XboxVertexShaderHandle] = shader; +} + +void CxbxImpl_SetVertexShaderInput +( + DWORD Handle, + UINT StreamCount, + XTL::X_STREAMINPUT* pStreamInputs +) +{ + LOG_INIT + + // If Handle is NULL, all VertexShader input state is cleared. + // Otherwise, Handle is the address of an Xbox VertexShader struct, or-ed with 1 (X_D3DFVF_RESERVED0) + // (Thus, a FVF handle is an invalid argument.) + // + + LOG_UNIMPLEMENTED(); +} + +void CxbxImpl_SelectVertexShaderDirect +( + XTL::X_VERTEXATTRIBUTEFORMAT* pVAF, + DWORD Address +) +{ + LOG_INIT; + + // When pVAF is non-null, this vertex attribute format takes precedence over the the one + LOG_UNIMPLEMENTED(); +} + +// parse xbox vertex shader function into an intermediate format +extern void EmuParseVshFunction +( + DWORD* pXboxFunction, + DWORD* pXboxFunctionSize, + IntermediateVertexShader* pShader +) +{ + uint32_t* pToken; + auto VshDecoder = XboxVertexShaderDecoder(); + + *pXboxFunctionSize = 0; + + // Just copy the header for now + pShader->Header = *(XTL::X_VSH_SHADER_HEADER*)pXboxFunction; + + // Decode the vertex shader program tokens into an intermediate representation + pToken = (uint32_t*)((uintptr_t)pXboxFunction + sizeof(XTL::X_VSH_SHADER_HEADER)); + while (VshDecoder.VshConvertToIntermediate(pToken, pShader)) { + pToken += X_VSH_INSTRUCTION_SIZE; + } + + // The size of the shader is + pToken += X_VSH_INSTRUCTION_SIZE; // always at least one token + *pXboxFunctionSize = (intptr_t)pToken - (intptr_t)pXboxFunction; +} diff --git a/src/core/hle/D3D8/XbVertexShader.h b/src/core/hle/D3D8/XbVertexShader.h new file mode 100644 index 000000000..8e507c034 --- /dev/null +++ b/src/core/hle/D3D8/XbVertexShader.h @@ -0,0 +1,240 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XBVERTEXSHADER_H +#define XBVERTEXSHADER_H + +#include +#include +#include + +#include "core\hle\D3D8\XbD3D8Types.h" // for X_VSH_MAX_ATTRIBUTES + +// Host vertex shader counts +#define VSH_VS11_MAX_INSTRUCTION_COUNT 128 +#define VSH_VS2X_MAX_INSTRUCTION_COUNT 256 +#define VSH_VS30_MAX_INSTRUCTION_COUNT 512 + +#define VSH_MAX_INTERMEDIATE_COUNT (X_VSH_MAX_INSTRUCTION_COUNT * 3) // The maximum number of shader function slots + +typedef struct _CxbxVertexShaderStreamElement +{ + UINT XboxType; // The stream element data types (xbox) + UINT XboxByteSize; // The stream element data sizes (xbox) + UINT HostByteSize; // The stream element data sizes (pc) +} +CxbxVertexShaderStreamElement; + +/* See host typedef struct _D3DVERTEXELEMENT9 +{ + WORD Stream; // Stream index + WORD Offset; // Offset in the stream in bytes + BYTE Type; // Data type + BYTE Method; // Processing method + BYTE Usage; // Semantics + BYTE UsageIndex; // Semantic index +} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; +*/ + +typedef struct _CxbxVertexShaderStreamInfo +{ + BOOL NeedPatch; // This is to know whether it's data which must be patched + BOOL DeclPosition; + WORD HostVertexStride; + DWORD NumberOfVertexElements; // Number of the stream data types + WORD CurrentStreamNumber; + CxbxVertexShaderStreamElement VertexElements[X_VSH_MAX_ATTRIBUTES + 16]; // TODO : Why 16 extra host additions?) +} +CxbxVertexShaderStreamInfo; + +typedef struct _CxbxVertexShaderInfo +{ + UINT NumberOfVertexStreams; // The number of streams the vertex shader uses + CxbxVertexShaderStreamInfo VertexStreams[X_VSH_MAX_STREAMS]; + bool vRegisterInDeclaration[16]; +} +CxbxVertexShaderInfo; + + +typedef struct _CxbxVertexShader +{ + // These are the parameters given by the XBE, + // we save them to be able to return them when necessary. + DWORD* pXboxDeclarationCopy; + DWORD XboxDeclarationCount; // Xbox's number of DWORD-sized X_D3DVSD* tokens + DWORD XboxFunctionSize; + DWORD* pXboxFunctionCopy; + UINT XboxNrAddressSlots; + DWORD XboxVertexShaderType; + // DWORD XboxStatus; // Used by VshHandleIsValidShader() + + // The resulting host variables + DWORD HostFVF; // Flexible Vertex Format (used when there's no host vertex shader) + uint64_t VertexShaderKey; // if nullptr, use SetFVF(HostFVF); + IDirect3DVertexDeclaration* pHostVertexDeclaration; + + // Needed for dynamic stream patching + CxbxVertexShaderInfo VertexShaderInfo; +} +CxbxVertexShader; + +// recompile xbox vertex shader declaration +extern D3DVERTEXELEMENT *EmuRecompileVshDeclaration +( + DWORD *pXboxDeclaration, + bool bIsFixedFunction, + DWORD *pXboxDeclarationCount, + CxbxVertexShaderInfo *pCxbxVertexShaderInfo +); + +// Intermediate vertex shader structures + +enum VSH_OREG_NAME { + OREG_OPOS, // 0 + OREG_UNUSED1, // 1 + OREG_UNUSED2, // 2 + OREG_OD0, // 3 + OREG_OD1, // 4 + OREG_OFOG, // 5 + OREG_OPTS, // 6 + OREG_OB0, // 7 + OREG_OB1, // 8 + OREG_OT0, // 9 + OREG_OT1, // 10 + OREG_OT2, // 11 + OREG_OT3, // 12 + OREG_UNUSED3, // 13 + OREG_UNUSED4, // 14 + OREG_A0X // 15 - all values of the 4 bits are used +}; + +static const int MASK_X = 0x008; +static const int MASK_Y = 0x004; +static const int MASK_Z = 0x002; +static const int MASK_W = 0x001; + +enum VSH_ILU { // Dxbx note : ILU stands for 'Inverse Logic Unit' opcodes + ILU_NOP = 0, + ILU_MOV, + ILU_RCP, + ILU_RCC, + ILU_RSQ, + ILU_EXP, + ILU_LOG, + ILU_LIT // = 7 - all values of the 3 bits are used +}; + +enum VSH_MAC { // Dxbx note : MAC stands for 'Multiply And Accumulate' opcodes + MAC_NOP = 0, + MAC_MOV, + MAC_MUL, + MAC_ADD, + MAC_MAD, + MAC_DP3, + MAC_DPH, + MAC_DP4, + MAC_DST, + MAC_MIN, + MAC_MAX, + MAC_SLT, + MAC_SGE, + MAC_ARL + // ??? 14 + // ??? 15 - 2 values of the 4 bits are undefined +}; + +enum VSH_IMD_OUTPUT_TYPE { + IMD_OUTPUT_C, + IMD_OUTPUT_R, + IMD_OUTPUT_O, + IMD_OUTPUT_A0X +}; + +typedef struct _VSH_IMD_OUTPUT { + VSH_IMD_OUTPUT_TYPE Type; + int16_t Address; + int8_t Mask; +} VSH_IMD_OUTPUT; + +enum VSH_SWIZZLE { + SWIZZLE_X = 0, + SWIZZLE_Y, + SWIZZLE_Z, + SWIZZLE_W +}; + +enum VSH_PARAMETER_TYPE { + PARAM_UNKNOWN = 0, + PARAM_R, // Temporary (scRatch) registers + PARAM_V, // Vertex registers + PARAM_C, // Constant registers, set by SetVertexShaderConstant + PARAM_O // = 0?? +}; + +typedef struct _VSH_IMD_PARAMETER { + VSH_PARAMETER_TYPE ParameterType; // Parameter type, R, V or C + bool Neg; // true if negated, false if not + VSH_SWIZZLE Swizzle[4]; // The four swizzles + int16_t Address; // Register address +} VSH_IMD_PARAMETER; + +typedef struct _VSH_INTERMEDIATE_FORMAT { + VSH_MAC MAC; + VSH_ILU ILU; + VSH_IMD_OUTPUT Output; + unsigned ParamCount; + VSH_IMD_PARAMETER Parameters[3]; + // There is only a single address register in Microsoft DirectX 8.0. + // The address register, designated as a0.x, may be used as signed + // integer offset in relative addressing into the constant register file. + // c[a0.x + n] + bool IndexesWithA0_X; +} VSH_INTERMEDIATE_FORMAT; + +typedef struct _IntermediateVertexShader { + XTL::X_VSH_SHADER_HEADER Header; + std::vector Instructions; +} IntermediateVertexShader; + +// parse xbox vertex shader function into an intermediate format +extern void EmuParseVshFunction +( + DWORD* pXboxFunction, + DWORD* pXboxFunctionSize, + IntermediateVertexShader* pShader +); + +extern void FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader); + +// Checks for failed vertex shaders, and shaders that would need patching +extern boolean IsValidCurrentShader(void); + +inline boolean VshHandleIsVertexShader(DWORD Handle) { return (Handle & X_D3DFVF_RESERVED0) ? TRUE : FALSE; } +inline boolean VshHandleIsFVF(DWORD Handle) { return !VshHandleIsVertexShader(Handle); } +inline XTL::X_D3DVertexShader *VshHandleToXboxVertexShader(DWORD Handle) { return (XTL::X_D3DVertexShader *)(Handle & ~X_D3DFVF_RESERVED0);} + +extern CxbxVertexShader* GetCxbxVertexShader(DWORD XboxVertexShaderHandle); +extern void SetCxbxVertexShader(DWORD XboxVertexShaderHandle, CxbxVertexShader* shader); + +#endif diff --git a/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.cpp b/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.cpp new file mode 100644 index 000000000..e6d6f8b8f --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.cpp @@ -0,0 +1,381 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::DSSTREAM + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + +#include "DirectSoundInline.hpp" +#include "DSStream_PacketManager.hpp" + +static inline void DSStream_Packet_UpdateHostBuffer( + LPDIRECTSOUNDBUFFER8 &pDSBuffer, + DWORD dwOffset, + PVOID pBufferData, + DWORD dwBufferSize + ) +{ + + LPVOID pAudioPtr, pAudioPtr2; + DWORD dwAudioBytes, dwAudioBytes2; + + HRESULT hRet = pDSBuffer->Lock(dwOffset, dwBufferSize, &pAudioPtr, &dwAudioBytes, + &pAudioPtr2, &dwAudioBytes2, 0); + + if (hRet == DS_OK) { + + if (pAudioPtr != nullptr) { + memcpy_s(pAudioPtr, dwAudioBytes, pBufferData, dwAudioBytes); + if (pAudioPtr2 != nullptr) { + memcpy_s(pAudioPtr2, dwAudioBytes2, (PBYTE)pBufferData + dwAudioBytes, dwAudioBytes2); + } + pDSBuffer->Unlock(pAudioPtr, dwAudioBytes, pAudioPtr2, dwAudioBytes2); + } + } +} + +void DSStream_Packet_Clear( + vector_hvp_iterator &buffer, + DWORD status, + XTL::LPFNXMOCALLBACK Xb_lpfnCallback, + LPVOID Xb_lpvContext, + XTL::X_CDirectSoundStream* pThis + ) +{ + + free(buffer->pBuffer_data); + + // Peform release only, don't trigger any events below. + if (status == XMP_STATUS_RELEASE_CXBXR) { + DSoundSGEMemDealloc(buffer->xmp_data.dwMaxSize); + buffer = pThis->Host_BufferPacketArray.erase(buffer); + return; + } + + if (buffer->xmp_data.pdwStatus != xbnullptr) { + (*buffer->xmp_data.pdwStatus) = status; + } + if (buffer->xmp_data.pdwCompletedSize != xbnullptr) { + (*buffer->xmp_data.pdwCompletedSize) = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, buffer->xmp_data.dwMaxSize); + } + DSoundSGEMemDealloc(buffer->xmp_data.dwMaxSize); + + auto unionEventContext = buffer->xmp_data.hCompletionEvent; + buffer = pThis->Host_BufferPacketArray.erase(buffer); + // NOTE: Packet must be erase before call the callback function below. See test case below. + // Test case: Pocketbike Racer + // * (cause audio skipping due to callback function called process then another called to process outside callback (x2) + // It only need to call process once. + + // If a callback is set, only do the callback instead of event handle. + if (Xb_lpfnCallback != xbnullptr) { + Xb_lpfnCallback(Xb_lpvContext, unionEventContext, status); + } else if (unionEventContext != 0) { + BOOL checkHandle = SetEvent(unionEventContext); + if (checkHandle == 0) { + DWORD error = GetLastError(); + EmuLog(LOG_LEVEL::WARNING, "Unable to set event on packet's hCompletionEvent. %8X | error = %8X", unionEventContext, error); + } + } +} + +static inline void DSStream_Packet_UploadPartial( + XTL::X_CDirectSoundStream* pThis, + vector_hvp_iterator &packetCurrent + ) +{ + // Don't write beyond given buffer data, force do nothing. + if (packetCurrent->bufWrittenBytes == packetCurrent->xmp_data.dwMaxSize) { + return; + } + LPWAVEFORMATEX pwfxFormat = pThis->EmuBufferDesc.lpwfxFormat; + + // Write one avg second worth of buffer ahead into host's audio buffer. + if (packetCurrent->bufWrittenBytes <= (packetCurrent->bufPlayed + pwfxFormat->nAvgBytesPerSec)) { + uint32_t bufWriteLength = pwfxFormat->nAvgBytesPerSec; + uint32_t bufferOffset = packetCurrent->bufWrittenBytes; + + if ((bufferOffset + bufWriteLength) > packetCurrent->xmp_data.dwMaxSize) { + bufWriteLength = packetCurrent->xmp_data.dwMaxSize - bufferOffset; + } + packetCurrent->bufWrittenBytes += bufWriteLength; + + DSStream_Packet_UpdateHostBuffer(pThis->EmuDirectSoundBuffer8, packetCurrent->nextWriteOffset, (uint8_t*)packetCurrent->pBuffer_data + bufferOffset, bufWriteLength); + packetCurrent->nextWriteOffset += bufWriteLength; + if (pThis->EmuBufferDesc.dwBufferBytes < packetCurrent->nextWriteOffset) { + packetCurrent->nextWriteOffset -= pThis->EmuBufferDesc.dwBufferBytes; + } + +#if 0 + // Debug area begin + EmuLog(LOG_LEVEL::DEBUG, "upload packet buffer process | pThis = %08X | packetCurrent = %08X", + pThis, packetCurrent._Ptr); + EmuLog(LOG_LEVEL::DEBUG, "nextWriteOffset = %08X | bufPlayed = %08X | bufWrittenIndex = %08X", + packetCurrent->nextWriteOffset, packetCurrent->bufPlayed, packetCurrent->bufWrittenIndex); + EmuLog(LOG_LEVEL::DEBUG, "bufferSize - %08X | dwBufferBytes = %08X | dwLastWritePos = %08X | dwWriteOffsetNext = %08X\n", + packetCurrent->xmp_data.dwMaxSize, pThis->EmuBufferDesc.dwBufferBytes, pThis->Host_dwLastWritePos, pThis->Host_dwWriteOffsetNext); + // Debug area end +#endif + } +} + +static inline void DSStream_Packet_Stop_Internal( + XTL::X_CDirectSoundStream* pThis + ) +{ + pThis->Host_isProcessing = false; + pThis->EmuDirectSoundBuffer8->Stop(); +} + +static inline void DSStream_Packet_Stop( + XTL::X_CDirectSoundStream* pThis + ) +{ + DSStream_Packet_Stop_Internal(pThis); + + if (pThis->Host_BufferPacketArray.size() == 0) { + if ((pThis->EmuFlags & DSE_FLAG_ENVELOPE2) > 0) { + pThis->Xb_Status |= X_DSSSTATUS_ENVELOPECOMPLETE; + } + } + // We need to log this info since some titles may have stop/played audio often in middle of processing (relative to videos). + EmuLog(LOG_LEVEL::INFO, "Stopped: pThis = %08X; Remaining packet(s): %d", + pThis, pThis->Host_BufferPacketArray.size() + ); +} + +static inline void DSStream_Packet_Starved( + XTL::X_CDirectSoundStream* pThis + ) +{ + DSStream_Packet_Stop_Internal(pThis); + pThis->Xb_Status |= X_DSSSTATUS_STARVED | X_DSSSTATUS_PAUSED; + // We need to log this info since some titles may have stop/played audio often in middle of processing (relative to videos). + EmuLog(LOG_LEVEL::INFO, "Starved: pThis = %08X;", + pThis + ); +} + +// Prefill buffer with at least 1 second worth of buffer. See "nAvgBytesPerSec" below for inspection. +static void DSStream_Packet_Prefill( + XTL::X_CDirectSoundStream* pThis, + vector_hvp_iterator packetCurrent + ) +{ + unsigned int streamBufferSize = 0; + + while (packetCurrent != pThis->Host_BufferPacketArray.end()) { + // If buffer had been written, then ignore it. + if (packetCurrent->bufWrittenBytes == 0) { + DSStream_Packet_UploadPartial(pThis, packetCurrent); + } + // Get remaining size left in current packet. + streamBufferSize += (packetCurrent->xmp_data.dwMaxSize - packetCurrent->bufPlayed); + if (streamBufferSize > pThis->EmuBufferDesc.lpwfxFormat->nAvgBytesPerSec) { + break; + } + packetCurrent++; + } +} + +bool DSStream_Packet_Process( + XTL::X_CDirectSoundStream* pThis + ) +{ + + // Do not allow to process if there is no packets. + if (pThis->Host_BufferPacketArray.size() == 0) { + return 0; + } + + // If title want to pause, then don't process the packets. + // If media object is being used as playback synch, then don't process the packets. + if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0 || + (pThis->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { + + vector_hvp_iterator packetCurrent = pThis->Host_BufferPacketArray.begin(); + DSStream_Packet_Prefill(pThis, packetCurrent); + return 0; + } + + if ((pThis->Xb_Status & X_DSSSTATUS_PAUSED) > 0) { + pThis->Xb_Status &= ~X_DSSSTATUS_PAUSED; + } + + if (pThis->Host_isProcessing == false) { + if (!(pThis->EmuFlags & DSE_FLAG_IS_ACTIVATED)) { + pThis->EmuFlags |= DSE_FLAG_IS_ACTIVATED; + } + } + + DWORD dwAudioBytes; + HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwAudioBytes); + if (hRet == DS_OK) { + vector_hvp_iterator packetCurrent = pThis->Host_BufferPacketArray.begin(); + + // NOTE: p1. Do not use play cursor, use write cursor to check ahead since by the time it gets there. The buffer is already played. + // p2. Plus play cursor is not reliable to check, write cursor is reliable as it is update more often. + // Test case proof: Gauntlet Dark Legacy give 256 bytes of data to a per packet during intro FMV. + // TODO: Need a better solution to give actual playtime since beginning of audio do run ahead of time. + DWORD writePos = 0; + hRet = pThis->EmuDirectSoundBuffer8->GetCurrentPosition(nullptr, &writePos); + if (hRet == DS_OK) { + // Disabled do/while loop since xbox thread will be processing as well. + //do { + int bufPlayed = writePos - packetCurrent->lastWritePos; + + // Correct it if buffer was playing and is at beginning. + if (writePos < packetCurrent->lastWritePos) { + bufPlayed = writePos + (pThis->EmuBufferDesc.dwBufferBytes - packetCurrent->lastWritePos); + } + packetCurrent->lastWritePos = writePos; + packetCurrent->bufPlayed += bufPlayed; + + if (packetCurrent->isPlayed == false) { + packetCurrent->isPlayed = true; + } +#if 0 // Extend debug verification + if (pThis->Host_BufferPacketArray.size() == 1) { + EmuLog(LOG_LEVEL::DEBUG, "pThis: %08X; bufPlayed: %08X; bufdesc-bufferBytes: %08X; xmp-maxSize: %08X", + pThis, + bufPlayed, + pThis->EmuBufferDesc.dwBufferBytes, + packetCurrent->xmp_data.dwMaxSize + ); + } +#endif + // if bufPlayed is over dwMaxSize, then re-correct it to return dwMaxSize only. + if (packetCurrent->bufPlayed >= packetCurrent->xmp_data.dwMaxSize) { + bufPlayed = packetCurrent->bufPlayed - packetCurrent->xmp_data.dwMaxSize; + packetCurrent->bufPlayed = packetCurrent->xmp_data.dwMaxSize; + } + // Return current completed size to Xbox's application. + if (packetCurrent->xmp_data.pdwCompletedSize != xbnullptr) { + (*packetCurrent->xmp_data.pdwCompletedSize) = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, packetCurrent->bufPlayed); + } + // Once bufPlayed is equal to dwMaxSize, we know the packet is completed. + if (packetCurrent->bufPlayed == packetCurrent->xmp_data.dwMaxSize) { + + bool isStreamEnd = packetCurrent->isStreamEnd; + DSStream_Packet_Clear(packetCurrent, XMP_STATUS_SUCCESS, pThis->Xb_lpfnCallback, pThis->Xb_lpvContext, pThis); + + if (pThis->Host_BufferPacketArray.size() == 0) { + if (isStreamEnd) { + DSStream_Packet_Stop(pThis); + } + else { + DSStream_Packet_Starved(pThis); + } + return 0; + } +#if 0 // Extend debug verification + EmuLog(LOG_LEVEL::DEBUG, "nextBuffer: %08X; packetCurrent->bufPlayed: %08X; bufPlayed: %08X;\n", + packetCurrent._Ptr, + packetCurrent->bufPlayed, + bufPlayed + ); +#endif + // Is this important or already have it handled by using while statement? + if (packetCurrent->bufWrittenBytes == 0) { + EmuLog(LOG_LEVEL::INFO, "audio gap detected: %08X; packetCurrent->bufPlayed: %08X; bufPlayed: %08X;\n", + &*packetCurrent, + packetCurrent->bufPlayed, + bufPlayed + ); + } + // Since we have later packet ready to be process, let's process it in the loop. + } + // Otherwise, continue upload partial of the packet's data to host if there are any left. + else { + DSStream_Packet_UploadPartial(pThis, packetCurrent); + //break; // Leave loop since there is more buffer haven't been process in the current packet. + } + //} while (true); + + DSStream_Packet_Prefill(pThis, packetCurrent); + } + // Out of packets, let's stop stream's buffer. + if (pThis->Host_BufferPacketArray.size() == 0) { + DSStream_Packet_Starved(pThis); + return 0; + } + } + + // The only place when Host_isProcessing is set to true to start play Host's audio buffer. + if (pThis->Host_isProcessing == false) { + pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + pThis->Host_isProcessing = true; + // Add debug log for verify if Host_isProcessing has set to true. + EmuLog(LOG_LEVEL::DEBUG, "pStream = %08X:Host_isProcessing is set to true.", pThis); + } + return 1; +} + +void DSStream_Packet_FlushEx_Reset( + XTL::X_CDirectSoundStream* pThis + ) +{ + // Remove flags only (This is the only place it will remove other than FlushEx perform set/remove the flags.) + pThis->EmuFlags &= ~(DSE_FLAG_FLUSH_ASYNC | DSE_FLAG_ENVELOPE | DSE_FLAG_ENVELOPE2); + pThis->Xb_rtFlushEx = 0LL; +} + +bool DSStream_Packet_Flush( + XTL::X_CDirectSoundStream* pThis + ) +{ + // If host's audio is still playing then return busy-state until buffer has stop playing. + DWORD dwStatus; + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + if ((dwStatus & DSBSTATUS_PLAYING) > 0) { + // We need to stop the play state + pThis->EmuDirectSoundBuffer8->Stop(); + DSStream_Packet_Process(pThis); + return true; + } + // Once stopped, we can safely flush the packets. + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); + pThis->Host_dwLastWritePos = 0; + pThis->Host_isProcessing = false; + for (auto buffer = pThis->Host_BufferPacketArray.begin(); buffer != pThis->Host_BufferPacketArray.end();) { + DSStream_Packet_Clear(buffer, XMP_STATUS_FLUSHED, pThis->Xb_lpfnCallback, pThis->Xb_lpvContext, pThis); + } + // Clear flags and set status to zero. + DSStream_Packet_FlushEx_Reset(pThis); + pThis->EmuFlags &= ~DSE_FLAG_PAUSE; + pThis->Xb_Status = 0; + return false; +} diff --git a/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.hpp b/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.hpp new file mode 100644 index 000000000..821e218e1 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DSStream_PacketManager.hpp @@ -0,0 +1,44 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#pragma once + +#include + +#include "DirectSound.hpp" + +#define vector_hvp_iterator std::vector::iterator + +extern void DSStream_Packet_Clear( + vector_hvp_iterator &buffer, + DWORD status, + XTL::LPFNXMOCALLBACK Xb_lpfnCallback, + LPVOID Xb_lpvContext, + XTL::X_CDirectSoundStream* pThis); + +extern bool DSStream_Packet_Process(XTL::X_CDirectSoundStream* pThis); + +extern void DSStream_Packet_FlushEx_Reset(XTL::X_CDirectSoundStream* pThis); + +extern bool DSStream_Packet_Flush(XTL::X_CDirectSoundStream* pThis); diff --git a/src/core/hle/DSOUND/DirectSound/DirectSound.cpp b/src/core/hle/DSOUND/DirectSound/DirectSound.cpp new file mode 100644 index 000000000..6e48f193b --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSound.cpp @@ -0,0 +1,956 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2017 blueshogun96 +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::DSOUND + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" // Global variables + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + +#include "DSStream_PacketManager.hpp" + +#include +#include +#include +#include + +#ifndef IID_IDirectSound3DListener8 +#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener +#endif + +// Temporary APU Timer Functions +// TODO: Move these to LLE APUDevice once we have one! + +#define APU_TIMER_FREQUENCY 48000 +LARGE_INTEGER APUInitialPerformanceCounter; +double NativeToXboxAPU_FactorForPerformanceFrequency = 0; + +void ResetApuTimer() +{ + // Measure current host performance counter and frequency + QueryPerformanceCounter(&APUInitialPerformanceCounter); + NativeToXboxAPU_FactorForPerformanceFrequency = (double)APU_TIMER_FREQUENCY / APUInitialPerformanceCounter.QuadPart; +} + +uint32_t GetAPUTime() +{ + ::LARGE_INTEGER PerformanceCounter; + QueryPerformanceCounter(&PerformanceCounter); + + // Re-Base on the time DirectSoundCreate was called + PerformanceCounter.QuadPart -= APUInitialPerformanceCounter.QuadPart; + // Apply a delta to make it appear to tick at 48khz + PerformanceCounter.QuadPart = (ULONGLONG)(NativeToXboxAPU_FactorForPerformanceFrequency * PerformanceCounter.QuadPart); + return (DWORD)PerformanceCounter.QuadPart; +} + + +// TODO: Tasks need to do for DirectSound HLE +// * Need create patches +// * Ac97CreateMediaObject (Need OOVPA) +// - WmaCreateDecoder (Need OOVPA, not require) Test case: WMAStream sample +// - WmaCreateDecoderEx (Is just a forward to WmaCreateDecoder, nothing else) +// - WmaCreateInMemoryDecoder (Need OOVPA, not require) Test case: WMAInMemory sample +// - WmaCreateInMemoryDecoderEx (Is just a forward to WmaCreateInMemoryDecoder, nothing else) +// * XWmaDecoderCreateMediaObject (Need OOVPA) +// * Missing IDirectSound patch +// * IDirectSound_Compact (xbox doesn't use this method and cannot make oovpa for it.) +// * IDirectSound_GetTime (not require) +// * IDirectSound_MapBufferData (undocument) +// * IDirectSound_SetCooperativeLevel (xbox doesn't use this method and cannot make oovpa for it.) +// * IDirectSound_UnmapBufferData (undocument) +// * IDirectSound_QueryInterfaceC (not require) +// * IDirectSound_QueryInterface (not require) + +// TODO: Tasks need to do for DirectSound LLE +// * Need to map range of 0x0fe800000 to 0xfe87ffff (?) and 0x0fec00000 to 0xfec00fff (?) + +/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value. + And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation, + there is chance of failure which contain value greater than 0. + */ + +// Managed memory xbox audio variables +static std::thread dsound_thread; +static void dsound_thread_worker(LPVOID); + +#include "DirectSoundInline.hpp" + +#ifdef __cplusplus +extern "C" { +#endif + +void CxbxInitAudio() +{ + g_EmuShared->GetAudioSettings(&g_XBAudio); +} + +#ifdef __cplusplus +} +#endif + +// ****************************************************************** +// * patch: DirectSoundCreate +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreate) +( + LPVOID pguidDeviceId, + OUT LPDIRECTSOUND8* ppDirectSound, + LPUNKNOWN pUnknown) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pguidDeviceId) + LOG_FUNC_ARG_OUT(ppDirectSound) + LOG_FUNC_ARG(pUnknown) + LOG_FUNC_END; + + static bool initialized = false; + + HRESULT hRet = DS_OK; + + if (!initialized) { + dsound_thread = std::thread(dsound_thread_worker, nullptr); + } + + ResetApuTimer(); + + // Set this flag when this function is called + g_bDSoundCreateCalled = TRUE; + + if (!initialized || g_pDSound8 == nullptr) { + hRet = DirectSoundCreate8(&g_XBAudio.adapterGUID, &g_pDSound8, nullptr); + + LPCSTR dsErrorMsg = nullptr; + + switch (hRet) { + case DS_OK: + // Is not a fatal error. + break; + case DSERR_ALLOCATED: + dsErrorMsg = "Audio adapter is already allocated. Possible fault within Cxbx-Reloaded's emulator." + "\n\nPlease report to respective game compatibility issue."; + break; + case DSERR_INVALIDPARAM: + dsErrorMsg = "DirectSoundCreate8 return invalid parameter." + "\n\nPlease report to respective game compatibility issue."; + break; + case DSERR_NOAGGREGATION: + dsErrorMsg = "Audio adapter does not support aggregation." + "\n\nPlease use different audio adapter."; + break; + case DSERR_NODRIVER: + dsErrorMsg = "Please select a valid audio adapter from Cxbx-Reloaded's config audio dialog." + "\n\nThen try again."; + break; + case DSERR_OUTOFMEMORY: + dsErrorMsg = "Unable to allocate DirectSound subsystem class." + "\n\nPlease close any opened application(s) or restart computer before trying again."; + break; + default: + dsErrorMsg = "DirectSoundCreate8 unknown failed: 0x%08X"; + } + + if (dsErrorMsg != nullptr) { + CxbxKrnlCleanup(dsErrorMsg, hRet); + } + + hRet = g_pDSound8->SetCooperativeLevel(GET_FRONT_WINDOW_HANDLE, DSSCL_PRIORITY); + + if (hRet != DS_OK) { + CxbxKrnlCleanup("g_pDSound8->SetCooperativeLevel Failed!"); + } + + // clear sound buffer cache + vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); + for (; ppDSBuffer != g_pDSoundBufferCache.end();) { + while (XTL::EMUPATCH(IDirectSoundBuffer_Release)((*ppDSBuffer)) != 0) {}; + ppDSBuffer = g_pDSoundBufferCache.begin(); + } + g_pDSoundBufferCache.reserve(X_DIRECTSOUND_CACHE_MAX); + + // clear sound stream cache + vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); + for (; ppDSStream != g_pDSoundStreamCache.end();) { + while (XTL::EMUPATCH(CDirectSoundStream_Release)((*ppDSStream)) != 0); + ppDSStream = g_pDSoundStreamCache.begin(); + } + g_pDSoundStreamCache.reserve(X_DIRECTSOUND_CACHE_MAX); + + //Create Primary Buffer in order for Xbox's DirectSound to manage complete control of it. + DSBUFFERDESC bufferDesc = { 0 }; + bufferDesc.dwSize = sizeof(DSBUFFERDESC); + bufferDesc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRL3D; //DSBCAPS_CTRLFX is not supported on primary buffer. + bufferDesc.guid3DAlgorithm = GUID_NULL; + + hRet = g_pDSound8->CreateSoundBuffer(&bufferDesc, &g_pDSoundPrimaryBuffer, nullptr); + + if (hRet != DS_OK) { + CxbxKrnlCleanup("Creating primary buffer for DirectSound Failed!"); + } + + /* Quote from MDSN "For the primary buffer, you must use the + * IDirectSoundBuffer interface; IDirectSoundBuffer8 is not available." + */ + // Return E_NOINTERFACE from QueryInterface method, make sense for g_pDSoundPrimaryBuffer + // But how to set DSBCAPS_CTRLFX on primary buffer or should it be set for all current and future cache buffers? + // We need LPDIRECTSOUNDFXI3DL2REVERB8 / IID_IDirectSoundFXI3DL2Reverb8 or use LPDIRECTSOUNDBUFFER8 / IID_IDirectSoundBuffer8 + + hRet = g_pDSoundPrimaryBuffer->QueryInterface(IID_IDirectSound3DListener8, (LPVOID*)&g_pDSoundPrimary3DListener8); + + if (hRet != DS_OK) { + CxbxKrnlCleanup("Creating primary 3D Listener for DirectSound Failed!"); + } + + initialized = true; + } + + // This way we can be sure that this function returns a valid + // DirectSound8 pointer even if we initialized it elsewhere! + if (ppDirectSound != nullptr) { + *ppDirectSound = g_pDSound8; + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSound_AddRef +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(IDirectSound_AddRef) +( + LPDIRECTSOUND8 pThis) +{ + return 1; // TODO: Fix me! + + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = g_pDSound8->AddRef(); + + return uRet; +} + +// ****************************************************************** +// * patch: IDirectSound_Release +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(IDirectSound_Release) +( + LPDIRECTSOUND8 pThis) +{ + return 0; // TODO: Fix me! + + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = g_pDSound8->Release(); + if (uRet == 0) { + g_bDSoundCreateCalled = false; + g_pDSound8 = nullptr; + } + + return uRet; +} + +// ****************************************************************** +// * patch: DirectSoundGetSampleTime +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(DirectSoundGetSampleTime)() +{ + DSoundMutexGuardLock; + + LOG_FUNC(); + + DWORD dwRet = GetAPUTime(); + + return dwRet; +} + +// ****************************************************************** +// * patch: DirectSoundUseFullHRTF +// ****************************************************************** +void WINAPI XTL::EMUPATCH(DirectSoundUseFullHRTF) +( + void) +{ + //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. + + LOG_FUNC(); + + LOG_IGNORED(); +} + +// ****************************************************************** +// * patch: DirectSoundUseLightHRTF +// ****************************************************************** +void WINAPI XTL::EMUPATCH(DirectSoundUseLightHRTF) +( + void) +{ + //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. + + LOG_FUNC(); + + LOG_IGNORED(); +} + +// ****************************************************************** +// * patch: DirectSoundUseFullHRTF4Channel +// ****************************************************************** +void WINAPI XTL::EMUPATCH(DirectSoundUseFullHRTF4Channel) +( + void) +{ + //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. + + LOG_FUNC(); + + LOG_IGNORED(); +} + +// ****************************************************************** +// * patch: DirectSoundUseLightHRTF4Channel +// ****************************************************************** +void WINAPI XTL::EMUPATCH(DirectSoundUseLightHRTF4Channel) +( + void) +{ + //NOTE: enter/leave criticalsection is not required! Titles are calling it before DirectSoundCreate. + + LOG_FUNC(); + + LOG_IGNORED(); +} + +// ****************************************************************** +// * patch: DirectSoundDoWork +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(DirectSoundDoWork)() +{ + DSoundMutexGuardLock; + + if (!g_bDSoundCreateCalled) { + return; + } + + LOG_FUNC(); + + xboxkrnl::LARGE_INTEGER getTime; + xboxkrnl::KeQuerySystemTime(&getTime); + + DirectSoundDoWork_Buffer(getTime); + + // Actually, DirectSoundStream need to process buffer packets here. + DirectSoundDoWork_Stream(getTime); + + return; +} +// For Async process purpose only +static void dsound_thread_worker(LPVOID nullPtr) +{ + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + + while (true) { + // Testcase: Gauntlet Dark Legacy, if Sleep(1) then intro videos start to starved often + // unless console is open with logging enabled. This is the cause of stopping intro videos often. + Sleep(300); + // Enforce mutex guard lock only occur inside below bracket for proper compile build. + { + DSoundMutexGuardLock; + + xboxkrnl::LARGE_INTEGER getTime; + xboxkrnl::KeQuerySystemTime(&getTime); + DirectSoundDoWork_Stream(getTime); + } + } +} + +// Kismet given name for RadWolfie's experiment major issue in the mutt. +#define DirectSuicideWork XTL::EMUPATCH(DirectSoundDoWork) + +/* ------------- Sorted relative functions begin ------------------*/ + +// ****************************************************************** +// * patch: CDirectSound_CommitDeferredSettings +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSound_CommitDeferredSettings) +( + X_CDirectSound* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + HRESULT hRet = DS_OK; + if (g_pDSoundPrimary3DListener8 != nullptr) { + hRet = g_pDSoundPrimary3DListener8->CommitDeferredSettings(); + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSound_CommitDeferredSettings +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CommitDeferredSettings) +( + X_CDirectSound* pThis) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSound_CommitDeferredSettings"); + + return XTL::EMUPATCH(CDirectSound_CommitDeferredSettings)(pThis); +} + +// ****************************************************************** +// * patch: IDirectSound_CommitEffectData +// ****************************************************************** +// This API is used relative with DSP effect. +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CommitEffectData) +( + X_CDirectSound* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + // NOTE: DSP relative function. + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_GetEffectData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetEffectData) +( + X_CDirectSound* pThis, + DWORD dwEffectIndex, + DWORD dwOffset, + OUT LPVOID pvData, + DWORD dwDataSize) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwEffectIndex) + LOG_FUNC_ARG(dwOffset) + LOG_FUNC_ARG_OUT(pvData) + LOG_FUNC_ARG(dwDataSize) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + /* RadWolfie: Should not allocate memory, xbox xbe is just asking for input data, not allocate then input data... + if (!pvData) { + pvData = malloc(dwDataSize); // TODO : FIXME : Shouldn't this be : *pvData = ... ?!? + }*/ + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_SetEffectData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetEffectData) +( + LPVOID pThis, + DWORD dwEffectIndex, + DWORD dwOffset, + LPCVOID pvData, + DWORD dwDataSize, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwEffectIndex) + LOG_FUNC_ARG(dwOffset) + LOG_FUNC_ARG(pvData) + LOG_FUNC_ARG(dwDataSize) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_DownloadEffectsImage +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_DownloadEffectsImage) +( + LPDIRECTSOUND8 pThis, + LPCVOID pvImageBuffer, + DWORD dwImageSize, + PVOID pImageLoc, // TODO: Use this param + PVOID* ppImageDesc) // TODO: Use this param +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pvImageBuffer) + LOG_FUNC_ARG(dwImageSize) + LOG_FUNC_ARG(pImageLoc) + LOG_FUNC_ARG(ppImageDesc) + LOG_FUNC_END; + + // This function is relative to DSP for Interactive 3-D Audio Level 2 (I3DL2) + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_EnableHeadphones +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_EnableHeadphones) +( + LPDIRECTSOUND8 pThis, + BOOL fEnabled) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fEnabled) + LOG_FUNC_END; + + //Windows Vista and later does not set speaker configuration from SetSpeakerConfig function. + EmuLog(LOG_LEVEL::WARNING, "EmuIDirectSound_EnableHeadphones ignored"); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_GetCaps +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetCaps) +( + X_CDirectSound* pThis, + OUT X_DSCAPS* pDSCaps) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pDSCaps) + LOG_FUNC_END; + + // Convert PC -> Xbox + if (pDSCaps) { + pDSCaps->dwFreeBufferSGEs = DSoundSGEFreeBuffer(); + // To prevent pass down overflow size. + pDSCaps->dwMemoryAllocated = (XTL_DS_SGE_SIZE_MAX < g_dwXbMemAllocated ? XTL_DS_SGE_SIZE_MAX : g_dwXbMemAllocated); + + // TODO: What are the max values for 2D and 3D Buffers? Once discover, then perform real time update in global variable. + pDSCaps->dwFree2DBuffers = (pDSCaps->dwFreeBufferSGEs == 0 ? 0 : 0x200 /* TODO: Replace me to g_dwFree2DBuffers*/ ); + pDSCaps->dwFree3DBuffers = (pDSCaps->dwFreeBufferSGEs == 0 ? 0 : 0x200 /* TODO: Replace me to g_dwFree3DBuffers*/ ); + + EmuLog(LOG_LEVEL::DEBUG, "X_DSCAPS: dwFree2DBuffers = %8X | dwFree3DBuffers = %8X | dwFreeBufferSGEs = %08X | dwMemAlloc = %08X", pDSCaps->dwFree2DBuffers, pDSCaps->dwFree3DBuffers, pDSCaps->dwFreeBufferSGEs, pDSCaps->dwMemoryAllocated); + } + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_GetOutputLevels +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetOutputLevels) +( + LPDIRECTSOUND8* pThis, + OUT X_DSOUTPUTLEVELS* pOutputLevels, + BOOL bResetPeakValues) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pOutputLevels) + LOG_FUNC_ARG(bResetPeakValues) + LOG_FUNC_END; + + // TODO: Anything? Either way, I've never seen a game to date use this... + + // NOTE: It ask for access to real time output (require capture device I believe). + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: CDirectSound_GetSpeakerConfig +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSound_GetSpeakerConfig) +( + X_CDirectSound* pThis, + OUT PDWORD pdwSpeakerConfig) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwSpeakerConfig) + LOG_FUNC_END; + + // TODO: Fix me! + *pdwSpeakerConfig = 0; // STEREO + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_GetSpeakerConfig +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_GetSpeakerConfig) +( + X_CDirectSound* pThis, + OUT LPDWORD* pdwSpeakerConfig) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwSpeakerConfig) + LOG_FUNC_END; + + //For now, let's set it to stereo. + *pdwSpeakerConfig = X_DSSPEAKER_STEREO; + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_SetAllParameters +// ****************************************************************** +// NOTE: No conversion requirement for XB to PC. +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetAllParameters) +( + LPDIRECTSOUND8 pThis, + LPCDS3DLISTENER pDS3DListenerParameters, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pDS3DListenerParameters) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = g_pDSoundPrimary3DListener8->SetAllParameters(pDS3DListenerParameters, dwApply); + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSound_SetDistanceFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetDistanceFactor) +( + LPDIRECTSOUND8 pThis, + FLOAT fDistanceFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fDistanceFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, fDistanceFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSound_SetDopplerFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetDopplerFactor) +( + LPDIRECTSOUND8 pThis, + FLOAT fDopplerFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fDopplerFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, fDopplerFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSound_SetI3DL2Listener +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetI3DL2Listener) +( + LPDIRECTSOUND8 pThis, + X_DSI3DL2LISTENER *pds3dl, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pds3dl) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // This function is relative to DSP, although it needs SetFX from LPDIRECTSOUNDBUFFER8 or LPDIRECTSOUNDFXI3DL2REVERB8 class. + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_SetMixBinHeadroom +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetMixBinHeadroom) +( + LPDIRECTSOUND8 pThis, + DWORD dwMixBinMask, + DWORD dwHeadroom) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMixBinMask) + LOG_FUNC_ARG(dwHeadroom) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_SetOrientation +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetOrientation) +( + LPDIRECTSOUND8 pThis, + FLOAT xFront, + FLOAT yFront, + FLOAT zFront, + FLOAT xTop, + FLOAT yTop, + FLOAT zTop, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(xFront) + LOG_FUNC_ARG(yFront) + LOG_FUNC_ARG(zFront) + LOG_FUNC_ARG(xTop) + LOG_FUNC_ARG(yTop) + LOG_FUNC_ARG(zTop) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = DS_OK; + // TODO: (DSound) Should we do restrictive or passive to return actual result back to titles? + // Test case: Jet Set Radio Future, ? + if (xFront == 0.0f && yFront == 0.0f && zFront == 0.0f) { + printf("WARNING: SetOrientation was called with xFront = 0, yFront = 0, and zFront = 0. Current action is ignore call to PC.\n"); + } + if (xTop == 0.0f && yTop == 0.0f && zTop == 0.0f) { + printf("WARNING: SetOrientation was called with xTop = 0, yTop = 0, and zTop = 0. Current action is ignore call to PC.\n"); + } else { + hRet = g_pDSoundPrimary3DListener8->SetOrientation(xFront, yFront, zFront, xTop, yTop, zTop, dwApply); + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSound_SetPosition +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetPosition) +( + LPDIRECTSOUND8 pThis, + FLOAT x, + FLOAT y, + FLOAT z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = g_pDSoundPrimary3DListener8->SetPosition(x, y, z, dwApply); + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSound_SetRolloffFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetRolloffFactor) +( + LPDIRECTSOUND8 pThis, + FLOAT fRolloffFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fRolloffFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetRolloffFactor(g_pDSoundPrimary3DListener8, fRolloffFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSound_SynchPlayback +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSound_SynchPlayback) +( + LPDIRECTSOUND8 pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + //TODO: Test case Rayman 3 - Hoodlum Havoc, Battlestar Galactica, Miami Vice, and ...? + + vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); + for (; ppDSBuffer != g_pDSoundBufferCache.end(); ppDSBuffer++) { + if ((*ppDSBuffer)->X_BufferCache == nullptr) { + continue; + } + + if (((*ppDSBuffer)->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { + DSoundBufferSynchPlaybackFlagRemove((*ppDSBuffer)->EmuFlags); + EmuLog(LOG_LEVEL::DEBUG, "SynchPlayback - pDSBuffer: %08X; EmuPlayFlags: %08X", *ppDSBuffer, (*ppDSBuffer)->EmuPlayFlags); + (*ppDSBuffer)->EmuDirectSoundBuffer8->Play(0, 0, (*ppDSBuffer)->EmuPlayFlags); + } + } + + vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); + for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { + if ((*ppDSStream)->Host_BufferPacketArray.size() == 0) { + continue; + } + if (((*ppDSStream)->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { + DSoundBufferSynchPlaybackFlagRemove((*ppDSStream)->EmuFlags); + EmuLog(LOG_LEVEL::DEBUG, "SynchPlayback - pDSStream: %08X; EmuPlayFlags: %08X", *ppDSStream, (*ppDSStream)->EmuPlayFlags); + DSStream_Packet_Process((*ppDSStream)); + } + } + + //EmuLog(LOG_LEVEL::DEBUG, "Buffer started: %u; Stream started: %u", debugSynchBufferCount, debugSynchStreamCount); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSound_SynchPlayback +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SynchPlayback) +( + LPDIRECTSOUND8 pThis) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSound_SynchPlayback"); + + return XTL::EMUPATCH(CDirectSound_SynchPlayback)(pThis); +} + +// ****************************************************************** +// * patch: IDirectSound_SetVelocity +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_SetVelocity) +( + LPDIRECTSOUND8 pThis, + FLOAT x, + FLOAT y, + FLOAT z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = g_pDSoundPrimary3DListener8->SetVelocity(x, y, z, dwApply); + + RETURN_RESULT_CHECK(hRet); +} diff --git a/src/CxbxKrnl/EmuDSound.h b/src/core/hle/DSOUND/DirectSound/DirectSound.hpp old mode 100755 new mode 100644 similarity index 86% rename from src/CxbxKrnl/EmuDSound.h rename to src/core/hle/DSOUND/DirectSound/DirectSound.hpp index 640586d29..e4d87f7ac --- a/src/CxbxKrnl/EmuDSound.h +++ b/src/core/hle/DSOUND/DirectSound/DirectSound.hpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDSound.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -27,19 +18,19 @@ // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * // * (c) 2002-2003 Aaron Robinson -// * (c) 2017-2018 RadWolfie +// * (c) 2017-2020 RadWolfie // * // * All rights reserved // * // ****************************************************************** #ifndef EMUDSOUND_H #define EMUDSOUND_H - -#undef FIELD_OFFSET // prevent macro redefinition warnings - -#include -#include "CxbxKrnl.h" -#include "Emu.h" + +#include "core\kernel\init\CxbxKrnl.h" +#include "core\hle\DSOUND\XbDSoundTypes.h" + +typedef struct IDirectSound3DListener8* LPDIRECTSOUND3DLISTENER8; +typedef struct IDirectSound3DBuffer8* LPDIRECTSOUND3DBUFFER8; #ifdef __cplusplus extern "C" { @@ -51,283 +42,10 @@ void CxbxInitAudio(); } #endif -// EmuIDirectSoundBuffer_Play flags -#define X_DSBPLAY_LOOPING 0x00000001 -#define X_DSBPLAY_FROMSTART 0x00000002 -#define X_DSBPLAY_SYNCHPLAYBACK 0x00000004 +namespace XTL { -// EmuIDirectSoundBuffer_Pause flags -#define X_DSBPAUSE_RESUME 0x00000000 -#define X_DSBPAUSE_PAUSE 0x00000001 -#define X_DSBPAUSE_SYNCHPLAYBACK 0x00000002 - -// EmuIDirectSoundStream_Pause flags -#define X_DSSPAUSE_RESUME 0x00000000 -#define X_DSSPAUSE_PAUSE 0x00000001 -#define X_DSSPAUSE_SYNCHPLAYBACK 0x00000002 -#define X_DSSPAUSE_PAUSENOACTIVATE 0x00000003 - -// EmuIDirectSoundStream_FlushEx flags -#define X_DSSFLUSHEX_IMMEDIATE 0x00000000 -#define X_DSSFLUSHEX_ASYNC 0x00000001 -#define X_DSSFLUSHEX_ENVELOPE 0x00000002 -#define X_DSSFLUSHEX_ENVELOPE2 0x00000004 - -// EmuIDirectSoundStream_GetStatus flags -#define X_DSSSTATUS_READY 0x00000001 -#define X_DSSSTATUS_PLAYING 0x00010000 -#define X_DSSSTATUS_PAUSED 0x00020000 -#define X_DSSSTATUS_STARVED 0x00040000 -#define X_DSSSTATUS_ENVELOPECOMPLETE 0x00080000 - -// EmuIDirectSoundBuffer_GetStatus flags -#define X_DSBSTATUS_PLAYING 0x00000001 -#define X_DSBSTATUS_PAUSED 0x00000002 -#define X_DSBSTATUS_LOOPING 0x00000004 - -// EmuIDirectSoundBuffer_StopEx flags -#define X_DSBSTOPEX_IMMEDIATE 0x00000000 -#define X_DSBSTOPEX_ENVELOPE 0x00000001 -#define X_DSBSTOPEX_RELEASEWAVEFORM 0x00000002 -#define X_DSBSTOPEX_ALL (X_DSBSTOPEX_ENVELOPE | X_DSBSTOPEX_RELEASEWAVEFORM) - -// ****************************************************************** -// * X_DSBUFFERDESC -// ****************************************************************** -struct X_DSBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - LPWAVEFORMATEX lpwfxFormat; - LPVOID lpMixBins; // TODO: Implement - DWORD dwInputMixBin; -}; - -typedef VOID(CALLBACK *LPFNXMOCALLBACK)(LPVOID pStreamContext, LPVOID pPacketContext, DWORD dwStatus); - -// ****************************************************************** -// * X_DSSTREAMDESC -// ****************************************************************** -struct X_DSSTREAMDESC -{ - DWORD dwFlags; - DWORD dwMaxAttachedPackets; - LPWAVEFORMATEX lpwfxFormat; - LPFNXMOCALLBACK lpfnCallback; - LPVOID lpvContext; - PVOID lpMixBins; // TODO: Implement -}; - -// ****************************************************************** -// * REFERENCE_TIME -// ****************************************************************** -typedef LONGLONG REFERENCE_TIME, *PREFERENCE_TIME, *LPREFERENCE_TIME; - -// ****************************************************************** -// * XMEDIAPACKET -// ****************************************************************** -typedef struct _XMEDIAPACKET -{ - LPVOID pvBuffer; - DWORD dwMaxSize; - PDWORD pdwCompletedSize; - PDWORD pdwStatus; - union { - HANDLE hCompletionEvent; - PVOID pContext; - }; - PREFERENCE_TIME prtTimestamp; // Not supported in xbox -} -XMEDIAPACKET, *PXMEDIAPACKET, *LPXMEDIAPACKET; - -#define XMP_STATUS_SUCCESS S_OK -#define XMP_STATUS_PENDING E_PENDING -#define XMP_STATUS_FLUSHED E_ABORT -#define XMP_STATUS_FAILURE E_FAIL -#define XMP_STATUS_RELEASE_CXBXR 0xFFFFFFFF - -// ****************************************************************** -// * XMEDIAINFO -// ****************************************************************** -typedef struct _XMEDIAINFO -{ - DWORD dwFlags; - DWORD dwInputSize; - DWORD dwOutputSize; - DWORD dwMaxLookahead; -} -XMEDIAINFO, *PXEIDIAINFO, *LPXMEDIAINFO; - -// XMEDIAINFO Flags -#define XMO_STREAMF_FIXED_SAMPLE_SIZE 0x00000001 // The object supports only a fixed sample size -#define XMO_STREAMF_FIXED_PACKET_ALIGNMENT 0x00000002 // The object supports only a fixed packet alignment -#define XMO_STREAMF_INPUT_ASYNC 0x00000004 // The object supports receiving input data asynchronously -#define XMO_STREAMF_OUTPUT_ASYNC 0x00000008 // The object supports providing output data asynchronously -#define XMO_STREAMF_IN_PLACE 0x00000010 // The object supports in-place modification of data -#define XMO_STREAMF_MASK 0x0000001F - -// XDSMIXBIN Flags -#define XDSMIXBIN_FRONT_LEFT 0 -#define XDSMIXBIN_FRONT_RIGHT 1 -#define XDSMIXBIN_FRONT_CENTER 2 -#define XDSMIXBIN_LOW_FREQUENCY 3 -#define XDSMIXBIN_BACK_LEFT 4 -#define XDSMIXBIN_BACK_RIGHT 5 -#define XDSMIXBIN_SPEAKERS_MAX 6 // Max count for speakers -// Other flags are used - -// ****************************************************************** -// * X_DSMIXBINVOLUMEPAIR -// ****************************************************************** -typedef struct _XDSMIXBINSVOLUMEPAIR { - DWORD dwMixBin; - LONG lVolume; -} X_DSMIXBINSVOLUMEPAIR, *X_LPDSMIXBINSVOLUMEPAIR; - -// ****************************************************************** -// * X_DSMB -// ****************************************************************** -typedef struct _XDSMIXBINS { - DWORD dwCount; - X_LPDSMIXBINSVOLUMEPAIR lpMixBinVolumePairs; -} X_DSMIXBINS, *X_LPDSMIXBINS; - -// ****************************************************************** -// * X_DSFILTERDESC -// ****************************************************************** -struct X_DSFILTERDESC -{ - DWORD dwMode; - DWORD dwQCoefficient; - DWORD adwCoefficients[4]; -}; - -// X_DSFILTERDESC modes -#define DSFILTER_MODE_BYPASS 0x00000000 // The filter is bypassed -#define DSFILTER_MODE_DLS2 0x00000001 // DLS2 mode -#define DSFILTER_MODE_PARAMEQ 0x00000002 // Parametric equalizer mode -#define DSFILTER_MODE_MULTI 0x00000003 // Multifunction mode - -// ****************************************************************** -// * DSLFODESC -// ****************************************************************** -typedef struct _DSLFODESC -{ - DWORD dwLFO; - DWORD dwDelay; - DWORD dwDelta; - LONG lPitchModulation; - LONG lFilterCutOffRange; - LONG lAmplitudeModulation; -} -DSLFODESC, *LPCDSLFODESC; - -// ****************************************************************** -// * XBOXADPCMWAVEFORMAT -// ****************************************************************** -typedef struct xbox_adpcmwaveformat_tag -{ - WAVEFORMATEX wfx; // WAVEFORMATEX data - WORD wSamplesPerBlock; // Number of samples per encoded block. It must be 64. -} -XBOXADPCMWAVEFORMAT, *PXBOXADPCMWAVEFORMAT, *LPXBOXADPCMWAVEFORMAT; - -typedef const XBOXADPCMWAVEFORMAT *LPCXBOXADPCMWAVEFORMAT; - -// ****************************************************************** -// * X_DSOUTPUTLEVELS -// ****************************************************************** -struct X_DSOUTPUTLEVELS -{ - DWORD dwAnalogLeftTotalPeak; // analog peak - DWORD dwAnalogRightTotalPeak; - DWORD dwAnalogLeftTotalRMS; // analog RMS - DWORD dwAnalogRightTotalRMS; - DWORD dwDigitalFrontLeftPeak; // digital peak levels - DWORD dwDigitalFrontCenterPeak; - DWORD dwDigitalFrontRightPeak; - DWORD dwDigitalBackLeftPeak; - DWORD dwDigitalBackRightPeak; - DWORD dwDigitalLowFrequencyPeak; - DWORD dwDigitalFrontLeftRMS; // digital RMS levels - DWORD dwDigitalFrontCenterRMS; - DWORD dwDigitalFrontRightRMS; - DWORD dwDigitalBackLeftRMS; - DWORD dwDigitalBackRightRMS; - DWORD dwDigitalLowFrequencyRMS; -}; - -// ****************************************************************** -// * X_DSCAPS -// ****************************************************************** -struct X_DSCAPS -{ - DWORD dwFree2DBuffers; - DWORD dwFree3DBuffers; - DWORD dwFreeBufferSGEs; - DWORD dwMemoryAllocated; -}; - -#define X_DSSPEAKER_STEREO 0x00000000 -#define X_DSSPEAKER_MONO 0x00000001 -#define X_DSSPEAKER_SURROUND 0x00000002 -#define X_DSSPEAKER_ENABLE_AC3 0x00010000 -#define X_DSSPEAKER_ENABLE_DTS 0x00020000 - -struct X_DS3DBUFFER { - DWORD dwSize; - D3DXVECTOR3 vPosition; - D3DXVECTOR3 vVelocity; - DWORD dwInsideConeAngle; - DWORD dwOutsideConeAngle; - D3DXVECTOR3 vConeOrientation; - LONG lConeOutsideVolume; - FLOAT flMinDistance; - FLOAT flMaxDistance; - DWORD dwMode; - FLOAT flDistanceFactor; - FLOAT flRolloffFactor; - FLOAT flDopplerFactor; -}; - -struct X_DSI3DL2LISTENER { - LONG lRoom; - LONG lRoomHF; - FLOAT flRoomRolloffFactor; - FLOAT flDecayTime; - FLOAT flDecayHFRatio; - LONG lReflections; - FLOAT flReflectionsDelay; - LONG lReverb; - FLOAT flReverbDelay; - FLOAT flDiffusion; - FLOAT flDensity; - FLOAT flHFReference; -}; - -struct X_DSI3DL2OBSTRUCTION { - LONG lHFLevel; - FLOAT flLFRatio; -}; - -struct X_DSI3DL2OCCLUSION { - LONG lHFLevel; - FLOAT flLFRatio; -}; - -struct X_DSI3DL2BUFFER { - LONG lDirect; - LONG lDirectHF; - LONG lRoom; - LONG lRoomHF; - FLOAT flRoomRolloffFactor; - X_DSI3DL2OBSTRUCTION Obstruction; - X_DSI3DL2OCCLUSION Occlusion; -}; - -typedef struct IDirectSoundStream IDirectSoundStream; -typedef IDirectSoundStream *LPDIRECTSOUNDSTREAM; +#undef FIELD_OFFSET // prevent macro redefinition warnings +#include // TODO: FIXME after global namespace XTL issue is resolved. // ****************************************************************** // * X_CDirectSound @@ -387,12 +105,16 @@ struct X_CDirectSoundBuffer DSoundBuffer_Lock Host_lock; DSoundBuffer_Lock X_lock; REFERENCE_TIME Xb_rtPauseEx; + REFERENCE_TIME Xb_rtStopEx; LONG Xb_Volume; LONG Xb_VolumeMixbin; - DWORD Xb_dwHeadroom; -}; + DWORD Xb_dwHeadroom; + X_DSENVOLOPEDESC Xb_EnvolopeDesc; + X_DSVOICEPROPS Xb_VoiceProperties; + DWORD Xb_Frequency; + DWORD Xb_Flags; +}; -#define WAVE_FORMAT_XBOX_ADPCM 0x0069 //Custom flags (4 bytes support up to 31 shifts,starting from 0) #define DSE_FLAG_PCM (1 << 0) #define DSE_FLAG_XADPCM (1 << 1) @@ -403,6 +125,7 @@ struct X_CDirectSoundBuffer #define DSE_FLAG_ENVELOPE (1 << 13) #define DSE_FLAG_ENVELOPE2 (1 << 14) // NOTE: This flag is a requirement for GetStatus to return X_DSSSTATUS_ENVELOPECOMPLETE value. #define DSE_FLAG_RECIEVEDATA (1 << 20) +#define DSE_FLAG_IS_ACTIVATED (1 << 21) // Only used for DirectSoundStream class, to acknowledge pause's no activate flag. #define DSE_FLAG_DEBUG_MUTE (1 << 30) // Cxbx-R debugging usage only #define DSE_FLAG_BUFFER_EXTERNAL (1 << 31) #define DSE_FLAG_AUDIO_CODECS (DSE_FLAG_PCM | DSE_FLAG_XADPCM | DSE_FLAG_PCM_UNKNOWN) @@ -450,9 +173,12 @@ class X_CMcpxStream struct host_voice_packet { XTL::XMEDIAPACKET xmp_data; PVOID pBuffer_data; - DWORD rangeStart; - bool isWritten; + DWORD nextWriteOffset; + DWORD lastWritePos; + DWORD bufPlayed; + DWORD bufWrittenBytes; bool isPlayed; + bool isStreamEnd; }; // ****************************************************************** @@ -532,7 +258,6 @@ class X_CDirectSoundStream DWORD X_MaxAttachedPackets; std::vector Host_BufferPacketArray; DWORD Host_dwWriteOffsetNext; - DWORD Host_dwTriggerRange; bool Host_isProcessing; LPFNXMOCALLBACK Xb_lpfnCallback; LPVOID Xb_lpvContext; @@ -540,7 +265,13 @@ class X_CDirectSoundStream REFERENCE_TIME Xb_rtPauseEx; LONG Xb_Volume; LONG Xb_VolumeMixbin; - DWORD Xb_dwHeadroom; + DWORD Xb_dwHeadroom; + X_DSENVOLOPEDESC Xb_EnvolopeDesc; + X_DSVOICEPROPS Xb_VoiceProperties; + DWORD Xb_Frequency; + DWORD Host_dwLastWritePos; + DWORD Xb_Flags; + DWORD Xb_Status; }; // ****************************************************************** @@ -618,6 +349,8 @@ class X_XFileMediaObject UINT EmuRefCount; }; +extern "C" { + // ****************************************************************** // * patch: DirectSoundCreate // ****************************************************************** @@ -748,8 +481,8 @@ HRESULT WINAPI EMUPATCH(IDirectSound_SetMixBinHeadroom) // ****************************************************************** HRESULT WINAPI EMUPATCH(IDirectSoundBuffer_SetMixBins) ( - LPDIRECTSOUND8 pThis, - PVOID pMixBins // TODO: fill this out + X_CDirectSoundBuffer* pThis, + DWORD dwMixBinMask ); // ****************************************************************** @@ -1230,7 +963,7 @@ HRESULT WINAPI EMUPATCH(CDirectSoundStream_SetI3DL2Source) HRESULT WINAPI EMUPATCH(CDirectSoundStream_SetMixBins) ( X_CDirectSoundStream* pThis, - PVOID pMixBins + DWORD dwMixBinMask ); // s+ @@ -1410,13 +1143,13 @@ HRESULT WINAPI EMUPATCH(CDirectSoundStream_SetLFO) ); // ****************************************************************** -// * patch: XAudioCreateAdpcmFormat +// * patch: XAudioCreateAdpcmFormat // NOTE: Not require to patch // ****************************************************************** VOID WINAPI EMUPATCH(XAudioCreateAdpcmFormat) ( - WORD nChannels, - DWORD nSamplesPerSec, - LPXBOXADPCMWAVEFORMAT pwfx + WORD nChannels, + DWORD nSamplesPerSec, + OUT LPXBOXADPCMWAVEFORMAT pwfx ); // ****************************************************************** @@ -1491,7 +1224,7 @@ HRESULT WINAPI EMUPATCH(IDirectSound_GetOutputLevels) HRESULT WINAPI EMUPATCH(CDirectSoundStream_SetEG) ( X_CDirectSoundStream* pThis, - LPVOID pEnvelopeDesc + X_DSENVOLOPEDESC* pEnvelopeDesc ); // ****************************************************************** @@ -1657,7 +1390,7 @@ HRESULT WINAPI EMUPATCH(XWaveFileCreateMediaObject) HRESULT WINAPI EMUPATCH(IDirectSoundBuffer_SetEG) ( X_CDirectSoundBuffer* pThis, - LPVOID pEnvelopeDesc + X_DSENVOLOPEDESC* pEnvelopeDesc ); // ****************************************************************** @@ -1865,7 +1598,7 @@ HRESULT WINAPI EMUPATCH(CDirectSoundStream_SetDopplerFactor) HRESULT WINAPI EMUPATCH(IDirectSoundBuffer_GetVoiceProperties) ( X_CDirectSoundBuffer* pThis, - OUT void* pVoiceProps); + OUT X_DSVOICEPROPS* pVoiceProps); // ****************************************************************** // * patch: CDirectSoundStream_GetVoiceProperties @@ -1873,7 +1606,7 @@ HRESULT WINAPI EMUPATCH(IDirectSoundBuffer_GetVoiceProperties) HRESULT WINAPI EMUPATCH(CDirectSoundStream_GetVoiceProperties) ( X_CDirectSoundStream* pThis, - OUT void* pVoiceProps); + OUT X_DSVOICEPROPS* pVoiceProps); // ****************************************************************** // * patch: IDirectSoundStream_SetVolume @@ -1905,7 +1638,7 @@ HRESULT WINAPI EMUPATCH(IDirectSoundStream_SetLFO) HRESULT WINAPI EMUPATCH(IDirectSoundStream_SetEG) ( X_CDirectSoundStream* pThis, - LPVOID pEnvelopeDesc); + X_DSENVOLOPEDESC* pEnvelopeDesc); // ****************************************************************** // * patch: IDirectSoundStream_SetFilter @@ -1937,5 +1670,55 @@ HRESULT WINAPI EMUPATCH(IDirectSoundStream_SetFrequency) HRESULT WINAPI EMUPATCH(IDirectSoundStream_SetMixBins) ( X_CDirectSoundStream* pThis, - PVOID pMixBins); -#endif + DWORD dwMixBinMask); + +// ****************************************************************** +// * patch: CDirectSound3DCalculator_Calculate3D +// ****************************************************************** +VOID WINAPI EMUPATCH(CDirectSound3DCalculator_Calculate3D) +( + DWORD a1, + DWORD a2); + +// ****************************************************************** +// * patch: CDirectSound3DCalculator_GetVoiceData +// ****************************************************************** +VOID WINAPI EMUPATCH(CDirectSound3DCalculator_GetVoiceData) +( + DWORD a1, + DWORD a2, + DWORD a3, + DWORD a4, + DWORD a5); + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Set3DVoiceData +// ****************************************************************** +HRESULT WINAPI EMUPATCH(IDirectSoundBuffer_Set3DVoiceData) +( + X_CDirectSoundBuffer* pThis, + DWORD a2); + +// ****************************************************************** +// * patch: IDirectSoundStream_Set3DVoiceData +// ****************************************************************** +HRESULT WINAPI EMUPATCH(IDirectSoundStream_Set3DVoiceData) +( + X_CDirectSoundStream* pThis, + DWORD a2 +); + +// ****************************************************************** +// * patch: IDirectSoundStrea,_Use3DVoiceData +// ****************************************************************** +HRESULT WINAPI EMUPATCH(IDirectSoundStream_Use3DVoiceData) +( + X_CDirectSoundStream* pThis, + DWORD a2 +); + +} // end of extern "C" + +} // end of namespace XTL + +#endif diff --git a/src/core/hle/DSOUND/DirectSound/DirectSound3DCalculator.cpp b/src/core/hle/DSOUND/DirectSound/DirectSound3DCalculator.cpp new file mode 100644 index 000000000..76d405783 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSound3DCalculator.cpp @@ -0,0 +1,94 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 Luke Usher +// * (c) 2019-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::DS3DCALC + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" // Global variables + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + + +// TODO: Tasks need to do for DirectSound HLE +// * Ixxxxx_ patch might not be a requirement. +// * IDirectSound3DCalculator_GetMixBinVolumes +// * IDirectSound3DCalculator_GetPanData + +#include "DirectSoundInline.hpp" + +/* ------------- Sorted relative functions begin ------------------*/ + +// ****************************************************************** +// * patch: CDirectSound3DCalculator_Calculate3D +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(CDirectSound3DCalculator_Calculate3D) +( + DWORD a1, + DWORD a2 +) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(a1) + LOG_FUNC_ARG(a2) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); +} + +// ****************************************************************** +// * patch: CDirectSound3DCalculator_GetVoiceData +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(CDirectSound3DCalculator_GetVoiceData) +( + DWORD a1, + DWORD a2, + DWORD a3, + DWORD a4, + DWORD a5 +) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(a1) + LOG_FUNC_ARG(a2) + LOG_FUNC_ARG(a3) + LOG_FUNC_ARG(a4) + LOG_FUNC_ARG(a5) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); +} diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundBuffer.cpp b/src/core/hle/DSOUND/DirectSound/DirectSoundBuffer.cpp new file mode 100644 index 000000000..828376920 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundBuffer.cpp @@ -0,0 +1,1627 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2017 blueshogun96 +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::DSBUFFER + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" // Global variables + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + + + +// TODO: Tasks need to do for DirectSound HLE +// * Missing IDirectSoundBuffer patch +// * IDirectSoundBuffer_Set3DVoiceData (new, undocument) +// * IDirectSoundBuffer_Use3DVoiceData (new, undocument) +// * IDirectSoundBuffer_QueryInterface (not require) +// * IDirectSoundBuffer_QueryInterfaceC (not require) + +/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value. + And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation, + there is chance of failure which contain value greater than 0. + */ + +#include "DirectSoundInline.hpp" + +// ****************************************************************** +// * patch: DirectSoundDoWork (buffer) +// ****************************************************************** +void DirectSoundDoWork_Buffer(xboxkrnl::LARGE_INTEGER &time) +{ + + vector_ds_buffer::iterator ppDSBuffer = g_pDSoundBufferCache.begin(); + for (; ppDSBuffer != g_pDSoundBufferCache.end(); ppDSBuffer++) { + if ((*ppDSBuffer)->Host_lock.pLockPtr1 == nullptr || (*ppDSBuffer)->EmuBufferToggle != XTL::X_DSB_TOGGLE_DEFAULT) { + continue; + } + XTL::X_CDirectSoundBuffer* pThis = *ppDSBuffer; + // However there's a chance of locked buffers has been set which needs to be unlock. + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + pThis->X_BufferCache, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + + // TODO: Do we need this in async thread loop? + if (pThis->Xb_rtPauseEx != 0LL && pThis->Xb_rtPauseEx <= time.QuadPart) { + pThis->Xb_rtPauseEx = 0LL; + pThis->EmuFlags &= ~DSE_FLAG_PAUSE; + pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + } + + if (pThis->Xb_rtStopEx != 0LL && pThis->Xb_rtStopEx <= time.QuadPart) { + pThis->Xb_rtStopEx = 0LL; + pThis->EmuDirectSoundBuffer8->Stop(); + } + } +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_AddRef +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(IDirectSoundBuffer_AddRef) +( + X_CDirectSoundBuffer* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = HybridDirectSoundBuffer_AddRef(pThis->EmuDirectSoundBuffer8); + + return uRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Release +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Release) +( + X_CDirectSoundBuffer* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = 0; + + //if (!(pThis->EmuFlags & DSE_FLAG_RECIEVEDATA)) { + uRet = pThis->EmuDirectSoundBuffer8->Release(); + + if (uRet == 0) { + if (pThis->EmuDirectSound3DBuffer8 != nullptr) { + pThis->EmuDirectSound3DBuffer8->Release(); + } + + // remove cache entry + vector_ds_buffer::iterator ppDSBuffer = std::find(g_pDSoundBufferCache.begin(), g_pDSoundBufferCache.end(), pThis); + if (ppDSBuffer != g_pDSoundBufferCache.end()) { + g_pDSoundBufferCache.erase(ppDSBuffer); + } + + if (pThis->EmuBufferDesc.lpwfxFormat != nullptr) { + free(pThis->EmuBufferDesc.lpwfxFormat); + } + if (pThis->X_BufferCache != xbnullptr && (pThis->EmuFlags & DSE_FLAG_BUFFER_EXTERNAL) == 0) { + free(pThis->X_BufferCache); + DSoundSGEMemDealloc(pThis->X_BufferCacheSize); + } + + delete pThis; + } + //} + + RETURN(uRet); +} + +// ****************************************************************** +// * patch: DirectSoundCreateBuffer +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreateBuffer) +( + X_DSBUFFERDESC* pdsbd, + OUT X_CDirectSoundBuffer** ppBuffer) +{ + DSoundMutexGuardLock; + + // Research reveal DirectSound creation check is part of the requirement. + if (!g_pDSound8 && !g_bDSoundCreateCalled) { + HRESULT hRet; + + hRet = XTL::EMUPATCH(DirectSoundCreate)(nullptr, &g_pDSound8, nullptr); + if (hRet != DS_OK) { + CxbxKrnlCleanup("Unable to initialize DirectSound!"); + } + } + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pdsbd) + LOG_FUNC_ARG_OUT(ppBuffer) + LOG_FUNC_END; + + HRESULT hRet = DS_OK; + + //If out of space, return out of memory. + if (X_DIRECTSOUND_CACHE_COUNT == X_DIRECTSOUND_CACHE_MAX || !DSoundSGEMenAllocCheck(pdsbd->dwBufferBytes)) { + + hRet = DSERR_OUTOFMEMORY; + *ppBuffer = xbnullptr; + } else { + + DSBUFFERDESC DSBufferDesc = { 0 }; + + //TODO: Find out the cause for DSBCAPS_MUTE3DATMAXDISTANCE to have invalid arg. + DWORD dwAcceptableMask = 0x00000010 | 0x00000020 | 0x00000080 | 0x00000100 | 0x00020000 | 0x00040000 /*| 0x00080000*/; + + if (pdsbd->dwFlags & (~dwAcceptableMask)) { + EmuLog(LOG_LEVEL::WARNING, "Use of unsupported pdsbd->dwFlags mask(s) (0x%.08X)", pdsbd->dwFlags & (~dwAcceptableMask)); + } + + DSBufferDesc.dwSize = sizeof(DSBUFFERDESC); + DSBufferDesc.dwFlags = (pdsbd->dwFlags & dwAcceptableMask) | DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY | + (g_XBAudio.mute_on_unfocus ? 0 : DSBCAPS_GLOBALFOCUS); + + // HACK: Hot fix for titles not giving CTRL3D flag. Xbox might accept it, however the host does not. + if ((pdsbd->dwFlags & DSBCAPS_MUTE3DATMAXDISTANCE) > 0 && (pdsbd->dwFlags & DSBCAPS_CTRL3D) == 0) { + DSBufferDesc.dwFlags &= ~DSBCAPS_MUTE3DATMAXDISTANCE; + } + + // TODO: Garbage Collection + *ppBuffer = new X_CDirectSoundBuffer(); + + DSoundBufferSetDefault((*ppBuffer), 0, pdsbd->dwFlags); + (*ppBuffer)->Host_lock = { 0 }; + (*ppBuffer)->Xb_rtStopEx = 0LL; + + DSoundBufferRegionSetDefault(*ppBuffer); + + // We have to set DSBufferDesc last due to EmuFlags must be either 0 or previously written value to preserve other flags. + GeneratePCMFormat(DSBufferDesc, pdsbd->lpwfxFormat, pdsbd->dwFlags, (*ppBuffer)->EmuFlags, pdsbd->dwBufferBytes, + &(*ppBuffer)->X_BufferCache, (*ppBuffer)->X_BufferCacheSize, (*ppBuffer)->Xb_VoiceProperties, pdsbd->lpMixBinsOutput); + (*ppBuffer)->EmuBufferDesc = DSBufferDesc; + + EmuLog(LOG_LEVEL::DEBUG, "DirectSoundCreateBuffer, *ppBuffer := 0x%08X, bytes := 0x%08X", *ppBuffer, (*ppBuffer)->EmuBufferDesc.dwBufferBytes); + + hRet = DSoundBufferCreate(&DSBufferDesc, (*ppBuffer)->EmuDirectSoundBuffer8); + if (FAILED(hRet)) { + std::stringstream output; + output << "Xbox:\n" << pdsbd; + output << "\nHost converison:\n" << DSBufferDesc; + EmuLog(LOG_LEVEL::WARNING, output.str().c_str()); + output.str(""); + output << static_cast(hRet); + CxbxKrnlCleanup("DSB: DSoundBufferCreate error: %s", output.str().c_str()); + } + else { + if (pdsbd->dwFlags & DSBCAPS_CTRL3D) { + DSound3DBufferCreate((*ppBuffer)->EmuDirectSoundBuffer8, (*ppBuffer)->EmuDirectSound3DBuffer8); + (*ppBuffer)->Xb_dwHeadroom = 0; // Default for 3D + } + + DSoundDebugMuteFlag((*ppBuffer)->X_BufferCacheSize, (*ppBuffer)->EmuFlags); + + // Pre-set volume to enforce silence if one of audio codec is disabled. + HybridDirectSoundBuffer_SetVolume((*ppBuffer)->EmuDirectSoundBuffer8, 0L, (*ppBuffer)->EmuFlags, nullptr, + (*ppBuffer)->Xb_VolumeMixbin, (*ppBuffer)->Xb_dwHeadroom); + + g_pDSoundBufferCache.push_back(*ppBuffer); + } + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSound_CreateSoundBuffer +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CreateSoundBuffer) +( + LPDIRECTSOUND8 pThis, + X_DSBUFFERDESC* pdsbd, + OUT X_CDirectSoundBuffer** ppBuffer, + LPUNKNOWN pUnkOuter) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("DirectSoundCreateBuffer"); + + HRESULT hRet = EMUPATCH(DirectSoundCreateBuffer)(pdsbd, ppBuffer); + + return hRet; +} + +/* ------------- Sorted relative functions begin ------------------*/ + +// ****************************************************************** +// * patch: IDirectSoundBuffer_GetCurrentPosition +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetCurrentPosition) +( + X_CDirectSoundBuffer* pThis, + OUT PDWORD pdwCurrentPlayCursor, + OUT PDWORD pdwCurrentWriteCursor) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwCurrentPlayCursor) + LOG_FUNC_ARG_OUT(pdwCurrentWriteCursor) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_GetCurrentPosition(pThis->EmuDirectSoundBuffer8, pdwCurrentPlayCursor, pdwCurrentWriteCursor, pThis->EmuFlags); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetCurrentPosition +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetCurrentPosition) +( + X_CDirectSoundBuffer* pThis, + DWORD dwNewPosition) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwNewPosition) + LOG_FUNC_END; + + dwNewPosition = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwNewPosition); + + // NOTE: TODO: This call *will* (by MSDN) fail on primary buffers! + HRESULT hRet = pThis->EmuDirectSoundBuffer8->SetCurrentPosition(dwNewPosition); + + if (hRet != DS_OK) { + EmuLog(LOG_LEVEL::WARNING, "SetCurrentPosition Failed!"); + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_GetStatus +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetStatus) +( + X_CDirectSoundBuffer* pThis, + OUT LPDWORD pdwStatus) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwStatus) + LOG_FUNC_END; + + DWORD dwStatusXbox = 0, dwStatusHost; + HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatusHost); + + // Conversion is a requirement to xbox. + if (hRet == DS_OK) { + if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { + dwStatusXbox = X_DSBSTATUS_PAUSED; + } else if ((dwStatusHost & DSBSTATUS_PLAYING) > 0) { + dwStatusXbox = X_DSBSTATUS_PLAYING; + } + if ((dwStatusHost & DSBSTATUS_LOOPING) > 0) { + dwStatusXbox |= X_DSBSTATUS_LOOPING; + } + } + + if (pdwStatus != xbnullptr) { + *pdwStatus = dwStatusXbox; + } else { + hRet = DSERR_INVALIDPARAM; + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_GetVoiceProperties +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_GetVoiceProperties) +( + X_CDirectSoundBuffer* pThis, + OUT X_DSVOICEPROPS* pVoiceProps) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pVoiceProps) + LOG_FUNC_END; + + if (pVoiceProps == xbnullptr) { + LOG_TEST_CASE("pVoiceProps == xbnullptr"); + RETURN(DS_OK); + } + + HRESULT hRet = HybridDirectSoundBuffer_GetVoiceProperties(pThis->Xb_VoiceProperties, pVoiceProps); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Lock +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Lock) +( + X_CDirectSoundBuffer* pThis, + DWORD dwOffset, + DWORD dwBytes, + LPVOID* ppvAudioPtr1, + LPDWORD pdwAudioBytes1, + LPVOID* ppvAudioPtr2, + LPDWORD pdwAudioBytes2, + DWORD dwFlags) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwOffset) + LOG_FUNC_ARG(dwBytes) + LOG_FUNC_ARG(ppvAudioPtr1) + LOG_FUNC_ARG(pdwAudioBytes1) + LOG_FUNC_ARG(ppvAudioPtr2) + LOG_FUNC_ARG(pdwAudioBytes2) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_END; + + HRESULT hRet = D3D_OK; + DWORD pcmSize = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwBytes); + DWORD pcmOffset = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, dwOffset); + + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + pThis->X_BufferCache, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + + if (ppvAudioPtr2 == xbnullptr) { + hRet = pThis->EmuDirectSoundBuffer8->Lock(pcmOffset, pcmSize, &pThis->Host_lock.pLockPtr1, &pThis->Host_lock.dwLockBytes1, + nullptr, 0, dwFlags); + pThis->Host_lock.pLockPtr2 = nullptr; + } else { + hRet = pThis->EmuDirectSoundBuffer8->Lock(pcmOffset, pcmSize, &pThis->Host_lock.pLockPtr1, &pThis->Host_lock.dwLockBytes1, + &pThis->Host_lock.pLockPtr2, &pThis->Host_lock.dwLockBytes2, dwFlags); + } + + if (hRet != DS_OK) { + CxbxKrnlCleanup("DirectSoundBuffer Lock Failed!"); + } + + // Host lock position + pThis->Host_lock.dwLockOffset = pcmOffset; + pThis->Host_lock.dwLockFlags = dwFlags; + pThis->X_lock.dwLockFlags = dwFlags; + + // Emulate to xbox's lock position + pThis->X_lock.dwLockOffset = dwOffset; + *ppvAudioPtr1 = pThis->X_lock.pLockPtr1 = ((LPBYTE)pThis->X_BufferCache + dwOffset); + *pdwAudioBytes1 = pThis->X_lock.dwLockBytes1 = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, pThis->Host_lock.dwLockBytes1); + if (pThis->Host_lock.pLockPtr2 != nullptr) { + *ppvAudioPtr2 = pThis->X_lock.pLockPtr2 = pThis->X_BufferCache; + *pdwAudioBytes2 = pThis->X_lock.dwLockBytes2 = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, pThis->Host_lock.dwLockBytes2); + } else if (ppvAudioPtr2 != xbnullptr) { + *ppvAudioPtr2 = xbnullptr; + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Unlock +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Unlock) +( + X_CDirectSoundBuffer* pThis, + LPVOID ppvAudioPtr1, + DWORD pdwAudioBytes1, + LPVOID ppvAudioPtr2, + DWORD pdwAudioBytes2 + ) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(ppvAudioPtr1) + LOG_FUNC_ARG(pdwAudioBytes1) + LOG_FUNC_ARG(ppvAudioPtr2) + LOG_FUNC_ARG(pdwAudioBytes2) + LOG_FUNC_END; + + // TODO: Find out why pThis->EmuLockPtr1 is nullptr... (workaround atm is to check if it is not a nullptr.) + if (pThis->X_BufferCache != xbnullptr && pThis->Host_lock.pLockPtr1 != nullptr) { + + memcpy_s((PBYTE)pThis->X_BufferCache + pThis->X_lock.dwLockOffset, + pThis->X_BufferCacheSize - pThis->X_lock.dwLockOffset, + pThis->X_lock.pLockPtr1, + pThis->X_lock.dwLockBytes1); + + if (pThis->Host_lock.pLockPtr2 != nullptr) { + memcpy_s(pThis->X_BufferCache, pThis->X_BufferCacheSize, pThis->X_lock.pLockPtr2, pThis->X_lock.dwLockBytes2); + } + } + + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + pThis->X_BufferCache, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Pause +// ****************************************************************** +// Introduced in XDK 4721 revision. +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Pause) +( + X_CDirectSoundBuffer* pThis, + DWORD dwPause) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwPause) + LOG_FUNC_END; + + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + pThis->X_BufferCache, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + + HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, + 1, 0LL, pThis->Xb_rtPauseEx); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_PauseEx +// ****************************************************************** +// Introduced in XDK 4721 revision. +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_PauseEx) +( + X_CDirectSoundBuffer *pThis, + REFERENCE_TIME rtTimestamp, + DWORD dwPause) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(rtTimestamp) + LOG_FUNC_ARG(dwPause) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, + 1, rtTimestamp, pThis->Xb_rtPauseEx); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Play +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Play) +( + X_CDirectSoundBuffer* pThis, + DWORD dwReserved1, + DWORD dwReserved2, + DWORD dwFlags) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwReserved1) + LOG_FUNC_ARG(dwReserved2) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_END; + + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + pThis->X_BufferCache, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + + if (dwFlags & ~(X_DSBPLAY_LOOPING | X_DSBPLAY_FROMSTART | X_DSBPLAY_SYNCHPLAYBACK)) { + CxbxKrnlCleanup("Unsupported Playing Flags"); + } + pThis->EmuPlayFlags = dwFlags; + + // rewind buffer + if ((dwFlags & X_DSBPLAY_FROMSTART)) { + + pThis->EmuPlayFlags &= ~X_DSBPLAY_FROMSTART; + } + + HRESULT hRet = DS_OK; + + if ((dwFlags & X_DSBPLAY_SYNCHPLAYBACK) > 0) { + //SynchPlayback flag append should only occur in HybridDirectSoundBuffer_Pause function, nothing else is able to do this. + hRet = DSoundBufferSynchPlaybackFlagAdd(pThis->EmuFlags); + pThis->EmuPlayFlags ^= X_DSBPLAY_SYNCHPLAYBACK; + } + + DSoundBufferUpdate(pThis, dwFlags, hRet); + + if (hRet == DS_OK) { + if (dwFlags & X_DSBPLAY_FROMSTART) { + if (pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0) != DS_OK) { + EmuLog(LOG_LEVEL::WARNING, "Rewinding buffer failed!"); + } + } + if ((pThis->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) == 0) { + hRet = pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + } + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_PlayEx +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_PlayEx) +( + X_CDirectSoundBuffer* pThis, + REFERENCE_TIME rtTimeStamp, + DWORD dwFlags) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(rtTimeStamp) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_END; + + //TODO: Need implement support for rtTimeStamp. + if (rtTimeStamp != 0) { + EmuLog(LOG_LEVEL::WARNING, "Not implemented for rtTimeStamp greater than 0 of %08d", rtTimeStamp); + } + + HRESULT hRet = XTL::EMUPATCH(IDirectSoundBuffer_Play)(pThis, xbnull, xbnull, dwFlags); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetAllParameters +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetAllParameters) +( + X_CDirectSoundBuffer* pThis, + X_DS3DBUFFER* pc3DBufferParameters, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pc3DBufferParameters) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetAllParameters(pThis->EmuDirectSound3DBuffer8, pc3DBufferParameters, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetBufferData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetBufferData) +( + X_CDirectSoundBuffer* pThis, + LPVOID pvBufferData, + DWORD dwBufferBytes) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pvBufferData) + LOG_FUNC_ARG(dwBufferBytes) + LOG_FUNC_END; + + + // Release old buffer if exists, this is needed in order to set lock pointer buffer to nullptr. + if (pThis->Host_lock.pLockPtr1 != nullptr) { + + DSoundGenericUnlock(pThis->EmuFlags, + pThis->EmuDirectSoundBuffer8, + pThis->EmuBufferDesc, + pThis->Host_lock, + xbnullptr, + pThis->X_lock.dwLockOffset, + pThis->X_lock.dwLockBytes1, + pThis->X_lock.dwLockBytes2); + } + + //TODO: Current workaround method since dwBufferBytes do set to zero. Otherwise it will produce lock error message. + if (dwBufferBytes == 0) { + + return DS_OK; + } + HRESULT hRet = DSERR_OUTOFMEMORY; + DWORD dwStatus; + + // force wait until buffer is stop playing. + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + while ((dwStatus & DSBSTATUS_PLAYING) > 0) { + SwitchToThread(); + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + } + + // Allocate memory whenever made request internally + if (pvBufferData == xbnullptr && DSoundSGEMenAllocCheck(dwBufferBytes)) { + + // Confirmed it perform a reset to default. + DSoundBufferRegionSetDefault(pThis); + + GenerateXboxBufferCache(pThis->EmuBufferDesc, pThis->EmuFlags, dwBufferBytes, &pThis->X_BufferCache, pThis->X_BufferCacheSize); + + // Copy if given valid pointer. + memcpy_s(pThis->X_BufferCache, pThis->X_BufferCacheSize, pvBufferData, dwBufferBytes); + + pThis->EmuFlags ^= DSE_FLAG_BUFFER_EXTERNAL; + + DSoundDebugMuteFlag(pThis->X_BufferCacheSize, pThis->EmuFlags); + + // Only perform a resize, for lock emulation purpose. + DSoundBufferResizeSetSize(pThis, hRet, dwBufferBytes); + + } else if (pvBufferData != xbnullptr) { + // Free internal buffer cache if exist + if ((pThis->EmuFlags & DSE_FLAG_BUFFER_EXTERNAL) == 0) { + free(pThis->X_BufferCache); + DSoundSGEMemDealloc(pThis->X_BufferCacheSize); + } + pThis->X_BufferCache = pvBufferData; + pThis->X_BufferCacheSize = dwBufferBytes; + pThis->EmuFlags |= DSE_FLAG_BUFFER_EXTERNAL; + + DSoundDebugMuteFlag(pThis->X_BufferCacheSize, pThis->EmuFlags); + + // Only perform a resize, for lock emulation purpose. + DSoundBufferResizeSetSize(pThis, hRet, dwBufferBytes); + + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetConeAngles +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeAngles) +( + X_CDirectSoundBuffer* pThis, + DWORD dwInsideConeAngle, + DWORD dwOutsideConeAngle, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwInsideConeAngle) + LOG_FUNC_ARG(dwOutsideConeAngle) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeAngles(pThis->EmuDirectSound3DBuffer8, dwInsideConeAngle, dwOutsideConeAngle, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetConeOrientation +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeOrientation) +( + X_CDirectSoundBuffer* pThis, + FLOAT x, + FLOAT y, + FLOAT z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeOrientation(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetConeOutsideVolume +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetConeOutsideVolume) +( + X_CDirectSoundBuffer* pThis, + LONG lConeOutsideVolume, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lConeOutsideVolume) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeOutsideVolume(pThis->EmuDirectSound3DBuffer8, lConeOutsideVolume, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetDistanceFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetDistanceFactor) +( + X_CDirectSoundBuffer* pThis, + FLOAT flDistanceFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flDistanceFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, flDistanceFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetDopplerFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetDopplerFactor) +( + X_CDirectSoundBuffer* pThis, + FLOAT flDopplerFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flDopplerFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, flDopplerFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetEG +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetEG) +( + X_CDirectSoundBuffer* pThis, + X_DSENVOLOPEDESC* pEnvelopeDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pEnvelopeDesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + pThis->Xb_EnvolopeDesc = *pEnvelopeDesc; + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetFilter +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFilter) +( + LPVOID pThis, + X_DSFILTERDESC* pFilterDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pFilterDesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// +s +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetFormat +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFormat) +( + X_CDirectSoundBuffer* pThis, + LPCWAVEFORMATEX pwfxFormat) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pwfxFormat) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetFormat(pThis->EmuDirectSoundBuffer8, pwfxFormat, pThis->Xb_Flags, + pThis->EmuBufferDesc, pThis->EmuFlags, + pThis->EmuPlayFlags, pThis->EmuDirectSound3DBuffer8, + 0, pThis->X_BufferCache, pThis->X_BufferCacheSize, + pThis->Xb_VoiceProperties, xbnullptr, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetFrequency +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetFrequency) +( + X_CDirectSoundBuffer* pThis, + DWORD dwFrequency) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwFrequency) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetFrequency(pThis->EmuDirectSoundBuffer8, dwFrequency, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetHeadroom +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetHeadroom) +( + X_CDirectSoundBuffer* pThis, + DWORD dwHeadroom) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwHeadroom) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetHeadroom(pThis->EmuDirectSoundBuffer8, dwHeadroom, pThis->Xb_dwHeadroom, + pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->EmuFlags); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetI3DL2Source +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetI3DL2Source) +( + X_CDirectSoundBuffer* pThis, + X_DSI3DL2BUFFER* pds3db, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pds3db) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: SetI3DL2Source is using DSFXI3DL2Reverb structure, aka different interface. + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetLFO +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetLFO) //Low Frequency Oscillators +( + LPDIRECTSOUNDBUFFER8 pThis, + LPCDSLFODESC pLFODesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pLFODesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetLoopRegion +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetLoopRegion) +( + X_CDirectSoundBuffer* pThis, + DWORD dwLoopStart, + DWORD dwLoopLength) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwLoopStart) + LOG_FUNC_ARG(dwLoopLength) + LOG_FUNC_END; + + // TODO: Ensure that 4627 & 4361 are intercepting far enough back + // (otherwise pThis is manipulated!) + + pThis->EmuRegionLoopStartOffset = dwLoopStart; + pThis->EmuRegionLoopLength = dwLoopLength; + pThis->EmuBufferToggle = X_DSB_TOGGLE_LOOP; + + DWORD dwStatus; + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + HRESULT hRet; + + if ((dwStatus & DSBSTATUS_PLAYING) > 0) { + if ((dwStatus & DSBSTATUS_LOOPING) > 0) { + pThis->EmuDirectSoundBuffer8->Stop(); + DSoundBufferUpdate(pThis, pThis->EmuPlayFlags, hRet); + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); + pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + } + } + + return DS_OK; +} + +// s+ +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMaxDistance +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMaxDistance) +( + X_CDirectSoundBuffer* pThis, + FLOAT flMaxDistance, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flMaxDistance) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMaxDistance(pThis->EmuDirectSound3DBuffer8, flMaxDistance, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMinDistance +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMinDistance) +( + X_CDirectSoundBuffer* pThis, + FLOAT flMinDistance, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flMinDistance) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMinDistance(pThis->EmuDirectSound3DBuffer8, flMinDistance, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMixBins +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBins) +( + X_CDirectSoundBuffer* pThis, + DWORD dwMixBinMask) +{ + DSoundMutexGuardLock; + HRESULT hRet = DS_OK; + X_LPDSMIXBINS pMixBins = reinterpret_cast(dwMixBinMask); + + if (g_LibVersion_DSOUND < 4039) { + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMixBinMask) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + } + else { + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pMixBins) + LOG_FUNC_END; + + hRet = HybridDirectSoundBuffer_SetMixBins(pThis->Xb_VoiceProperties, pMixBins, pThis->EmuBufferDesc.lpwfxFormat, pThis->EmuBufferDesc); + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMixBinVolumes_12 +// ****************************************************************** +// This revision API was used in XDK 3911 until API had changed in XDK 4039. +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_12) +( + X_CDirectSoundBuffer* pThis, + DWORD dwMixBinMask, + const LONG* alVolumes) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMixBinMask) + LOG_FUNC_ARG(alVolumes) + LOG_FUNC_END; + + // NOTE: Use this function for XDK 3911 only because the implementation was changed + // somewhere around the December 2001 (4134) update (or earlier, maybe). + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMixBinVolumes_8 +// ****************************************************************** +// This revision is only used in XDK 4039 and higher. +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_8) +( + X_CDirectSoundBuffer* pThis, + X_LPDSMIXBINS pMixBins) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pMixBins) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetMixBinVolumes_8(pThis->EmuDirectSoundBuffer8, pMixBins, pThis->Xb_VoiceProperties, + pThis->EmuFlags, pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetMode +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetMode) +( + X_CDirectSoundBuffer* pThis, + DWORD dwMode, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMode) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMode(pThis->EmuDirectSound3DBuffer8, dwMode, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetNotificationPositions +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetNotificationPositions) +( + X_CDirectSoundBuffer* pThis, + DWORD dwNotifyCount, + LPCDSBPOSITIONNOTIFY paNotifies) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwNotifyCount) + LOG_FUNC_ARG(paNotifies) + LOG_FUNC_END; + + HRESULT hRet = DSERR_INVALIDPARAM; + + // If we have a valid buffer, query a PC IDirectSoundNotify pointer and + // use the paramaters as is since they are directly compatible, then release + // the pointer. Any buffer that uses this *MUST* be created with the + // DSBCAPS_CTRLPOSITIONNOTIFY flag! + + IDirectSoundNotify* pNotify = nullptr; + + if (pThis) { + if (pThis->EmuDirectSoundBuffer8) { + hRet = pThis->EmuDirectSoundBuffer8->QueryInterface(IID_IDirectSoundNotify8, (LPVOID*)&pNotify); + if (hRet == DS_OK) { + hRet = pNotify->SetNotificationPositions(dwNotifyCount, paNotifies); + if (hRet != DS_OK) { + EmuLog(LOG_LEVEL::WARNING, "Could not set notification position(s)!"); + } + + pNotify->Release(); + } else { + EmuLog(LOG_LEVEL::WARNING, "Could not create notification interface!"); + } + } + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetOutputBuffer +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetOutputBuffer) +( + X_CDirectSoundBuffer* pThis, + X_CDirectSoundBuffer* pOutputBuffer) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pOutputBuffer) + LOG_FUNC_END; + + // NOTE: SetOutputBuffer is not possible in PC's DirectSound due to 3D controller requirement on ouput buffer to work simultaneously. + // Test case: MultiPass sample + // Best to emulate this LLE instead of HLE. + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetPitch +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPitch) +( + X_CDirectSoundBuffer* pThis, + LONG lPitch) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lPitch) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetPitch(pThis->EmuDirectSoundBuffer8, lPitch, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetPlayRegion +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPlayRegion) +( + X_CDirectSoundBuffer* pThis, + DWORD dwPlayStart, + DWORD dwPlayLength) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwPlayStart) + LOG_FUNC_ARG(dwPlayLength) + LOG_FUNC_END; + + // TODO: Ensure that 4627 & 4361 are intercepting far enough back + // (otherwise pThis is manipulated!) + + pThis->EmuBufferToggle = X_DSB_TOGGLE_PLAY; + pThis->EmuRegionPlayStartOffset = dwPlayStart; + pThis->EmuRegionPlayLength = dwPlayLength; + + // Confirmed play region do overwrite loop region value. + pThis->EmuRegionLoopStartOffset = 0; + pThis->EmuRegionLoopLength = 0; + + DWORD dwStatus; + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + HRESULT hRet; + + if ((dwStatus & DSBSTATUS_PLAYING) > 0) { + if ((dwStatus & DSBSTATUS_LOOPING) == 0) { + pThis->EmuDirectSoundBuffer8->Stop(); + DSoundBufferUpdate(pThis, pThis->EmuPlayFlags, hRet); + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); + pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + } + } + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetPosition +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetPosition) +( + X_CDirectSoundBuffer* pThis, + FLOAT x, + FLOAT y, + FLOAT z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetPosition(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetRolloffCurve +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffCurve) +( + LPDIRECTSOUNDBUFFER8 pThis, + const FLOAT* pflPoints, + DWORD dwPointCount, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pflPoints) + LOG_FUNC_ARG(dwPointCount) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: Individual 3D buffer function. + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetRolloffFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffFactor) +( + X_CDirectSoundBuffer* pThis, + FLOAT flRolloffFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flRolloffFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: SetRolloffFactor is only supported for host primary buffer's 3D Listener. + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetVelocity +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetVelocity) +( + X_CDirectSoundBuffer* pThis, + FLOAT x, + FLOAT y, + FLOAT z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetVelocity(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_SetVolume +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetVolume) +( + X_CDirectSoundBuffer* pThis, + LONG lVolume) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lVolume) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetVolume(pThis->EmuDirectSoundBuffer8, lVolume, pThis->EmuFlags, &pThis->Xb_Volume, + pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Stop +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Stop) +( + X_CDirectSoundBuffer* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + HRESULT hRet = D3D_OK; + + if (pThis != nullptr) { + // TODO : Test Stop (emulated via Stop + SetCurrentPosition(0)) : + hRet = pThis->EmuDirectSoundBuffer8->Stop(); + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(0); + } + + RETURN_RESULT_CHECK(hRet); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_StopEx +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_StopEx) +( + X_CDirectSoundBuffer* pThis, + REFERENCE_TIME rtTimeStamp, + DWORD dwFlags) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(rtTimeStamp) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_END; + + HRESULT hRet = DS_OK; + + //TODO: RadWolfie - Rayman 3 crash at end of first intro for this issue... + // if only return DS_OK, then it works fine until end of 2nd intro it crashed. + + // Do not allow to process - Xbox reject it. + if (dwFlags > X_DSBSTOPEX_ALL) { + hRet = DSERR_INVALIDPARAM; + + // Only flags can be process here. + } else { + if (dwFlags == X_DSBSTOPEX_IMMEDIATE) { + hRet = pThis->EmuDirectSoundBuffer8->Stop(); + pThis->Xb_rtStopEx = 0LL; + } + else { + bool isLooping; + if ((pThis->EmuPlayFlags & X_DSBPLAY_LOOPING) > 0) { + isLooping = true; + } + else { + isLooping = false; + } + + if ((dwFlags & X_DSBSTOPEX_ENVELOPE) > 0) { + if (rtTimeStamp == 0LL) { + xboxkrnl::LARGE_INTEGER getTime; + xboxkrnl::KeQuerySystemTime(&getTime); + pThis->Xb_rtStopEx = getTime.QuadPart; + } + else { + pThis->Xb_rtStopEx = rtTimeStamp; + } + pThis->Xb_rtStopEx += (pThis->Xb_EnvolopeDesc.dwRelease * 512) / 48000; + } + else { + pThis->Xb_rtStopEx = rtTimeStamp; + } + + if ((dwFlags & X_DSBSTOPEX_RELEASEWAVEFORM) > 0) { + // Release from loop region. + pThis->EmuPlayFlags &= ~X_DSBPLAY_LOOPING; + } + + DWORD dwValue, dwStatus; + pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatus); + + if (pThis->EmuBufferToggle != X_DSB_TOGGLE_DEFAULT) { + + pThis->EmuDirectSoundBuffer8->GetCurrentPosition(nullptr, &dwValue); + hRet = pThis->EmuDirectSoundBuffer8->Stop(); + + DSoundBufferResizeUpdate(pThis, pThis->EmuPlayFlags, hRet, 0, pThis->X_BufferCacheSize); + + dwValue += pThis->EmuRegionPlayStartOffset; + if (isLooping) { + dwValue += pThis->EmuRegionLoopStartOffset; + } + + pThis->EmuBufferToggle = X_DSB_TOGGLE_DEFAULT; + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(dwValue); + } + + if (dwStatus & DSBSTATUS_PLAYING && rtTimeStamp != 0LL) { + pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); + } + else { + pThis->EmuDirectSoundBuffer8->Stop(); + pThis->Xb_rtStopEx = 0LL; + } + } + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Set3DVoiceData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Set3DVoiceData) +( + X_CDirectSoundBuffer* pThis, + DWORD a2 +) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(a2) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + RETURN(STATUS_SUCCESS); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Use3DVoiceData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Use3DVoiceData) +( + LPVOID pThis, + LPUNKNOWN pUnknown) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pUnknown) + LOG_FUNC_END; + + LOG_NOT_SUPPORTED(); + + return DS_OK; +} diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.cpp b/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.cpp new file mode 100644 index 000000000..a3f2e052f --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.cpp @@ -0,0 +1,55 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" + +Settings::s_audio g_XBAudio = { 0 }; +std::recursive_mutex g_DSoundMutex; + +//Currently disabled since below may not be needed since under -6,400 is just silence yet accepting up to -10,000 +// Xbox to PC volume ratio format (-10,000 / -6,400 ) +//#define XBOX_TO_PC_VOLUME_RATIO 1.5625 + +vector_ds_buffer g_pDSoundBufferCache; +vector_ds_stream g_pDSoundStreamCache; +LPDIRECTSOUND8 g_pDSound8 = nullptr; //This is necessary in order to allow share with EmuDSoundInline.hpp +LPDIRECTSOUNDBUFFER g_pDSoundPrimaryBuffer = nullptr; +//TODO: RadWolfie - How to implement support if primary does not permit it for DSP usage? +LPDIRECTSOUNDBUFFER8 g_pDSoundPrimaryBuffer8 = nullptr; +LPDIRECTSOUND3DLISTENER8 g_pDSoundPrimary3DListener8 = nullptr; +int g_bDSoundCreateCalled = FALSE; +unsigned int g_iDSoundSynchPlaybackCounter = 0; +// Managed memory xbox audio variables +DWORD g_dwXbMemAllocated = 0; +DWORD g_dwFree2DBuffers = 0; +DWORD g_dwFree3DBuffers = 0; diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.hpp b/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.hpp new file mode 100644 index 000000000..5d9acadd7 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.hpp @@ -0,0 +1,76 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#pragma once + +#include + +#include +#include +#include "core/kernel/support/Emu.h" +#include "common/win32/EmuShared.h" +#include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For D3D_OK +#include "core/hle/DSOUND/DirectSound/DirectSound.hpp" +#include "common/Settings.hpp" + +extern Settings::s_audio g_XBAudio; +extern std::recursive_mutex g_DSoundMutex; +#define DSoundMutexGuardLock std::lock_guard guard(g_DSoundMutex) + +//Currently disabled since below may not be needed since under -6,400 is just silence yet accepting up to -10,000 +// Xbox to PC volume ratio format (-10,000 / -6,400 ) +//#define XBOX_TO_PC_VOLUME_RATIO 1.5625 + +// Xbox maximum synch playback audio +#define DSOUND_MAX_SYNCHPLAYBACK_AUDIO 29 + +#define vector_ds_buffer std::vector +#define vector_ds_stream std::vector +extern vector_ds_buffer g_pDSoundBufferCache; +extern vector_ds_stream g_pDSoundStreamCache; +extern LPDIRECTSOUND8 g_pDSound8; //This is necessary in order to allow share with EmuDSoundInline.hpp +extern LPDIRECTSOUNDBUFFER g_pDSoundPrimaryBuffer; +//TODO: RadWolfie - How to implement support if primary does not permit it for DSP usage? +extern LPDIRECTSOUNDBUFFER8 g_pDSoundPrimaryBuffer8; +extern LPDIRECTSOUND3DLISTENER8 g_pDSoundPrimary3DListener8; +extern int g_bDSoundCreateCalled; +extern unsigned int g_iDSoundSynchPlaybackCounter; +// Managed memory xbox audio variables +extern DWORD g_dwXbMemAllocated; +extern DWORD g_dwFree2DBuffers; +extern DWORD g_dwFree3DBuffers; + +// size of DirectSound cache max size +#define X_DIRECTSOUND_CACHE_MAX 0x800 + +#define X_DIRECTSOUND_CACHE_COUNT (g_pDSoundBufferCache.size() + g_pDSoundStreamCache.size()) + +#define RETURN_RESULT_CHECK(hRet) { \ + static bool bPopupShown = false; if (!bPopupShown && hRet) { bPopupShown = true; \ + printf("Return result report: 0x%08X\nIn %s (%s)\n", hRet, __func__, __FILE__); \ + EmuLog(LOG_LEVEL::WARNING, "An issue has been found. Please report game title and console's output of return result," \ + " function, and file name to https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/485"); } return hRet; } + +extern void DirectSoundDoWork_Buffer(xboxkrnl::LARGE_INTEGER& time); +extern void DirectSoundDoWork_Stream(xboxkrnl::LARGE_INTEGER& time); diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/core/hle/DSOUND/DirectSound/DirectSoundInline.hpp similarity index 59% rename from src/CxbxKrnl/EmuDSoundInline.hpp rename to src/core/hle/DSOUND/DirectSound/DirectSoundInline.hpp index 7bcb9c4b5..7435c0575 100644 --- a/src/CxbxKrnl/EmuDSoundInline.hpp +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundInline.hpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuDSoundInline.hpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -28,41 +19,45 @@ // * // * (c) 2002-2003 Aaron Robinson // * (c) 2017 blueshogun96 -// * (c) 2017-2018 RadWolfie +// * (c) 2017-2020 RadWolfie // * // * All rights reserved // * // ****************************************************************** -#ifndef EMUDSOUNDINLINE_H -#define EMUDSOUNDINLINE_H +#pragma once -#include "XADPCM.h" +#include -CRITICAL_SECTION g_DSoundCriticalSection; -#define enterCriticalSection EnterCriticalSection(&g_DSoundCriticalSection) -#define leaveCriticalSection LeaveCriticalSection(&g_DSoundCriticalSection) +#include "common/XADPCM.h" +#include "core/hle/DSOUND/XbDSoundTypes.h" +#include "core/hle/DSOUND/common/windows/WFXformat.hpp" + +#include #define DSoundBufferGetPCMBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_SRCSIZE)) * XBOX_ADPCM_DSTSIZE) : size #define DSoundBufferGetXboxBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_DSTSIZE)) * XBOX_ADPCM_SRCSIZE) : size +typedef struct IDirectSound3DBuffer8* LPDIRECTSOUND3DBUFFER8; +typedef LONGLONG REFERENCE_TIME; + // Memory managed xbox audio function handler -inline DWORD DSoundSGEFreeBuffer() { - int count = (X_DS_SGE_SIZE_MAX - g_dwXbMemAllocated); - count = count / X_DS_SGE_PAGE_MAX; +static inline DWORD DSoundSGEFreeBuffer() { + int count = (XTL_DS_SGE_SIZE_MAX - g_dwXbMemAllocated); + count = count / XTL_DS_SGE_PAGE_MAX; // Check for negative value, we don't need warning as we are allowing overflow one time only. if (count < 0) { return 0; } return (DWORD)count; } -inline void DSoundSGEMemAlloc(DWORD size) { +static inline void DSoundSGEMemAlloc(DWORD size) { g_dwXbMemAllocated += size; } -inline void DSoundSGEMemDealloc(DWORD size) { +static inline void DSoundSGEMemDealloc(DWORD size) { g_dwXbMemAllocated -= size; } -inline bool DSoundSGEMenAllocCheck(DWORD sizeRequest) { - int leftOverSize = X_DS_SGE_SIZE_MAX - (g_dwXbMemAllocated + sizeRequest); +static inline bool DSoundSGEMenAllocCheck(DWORD sizeRequest) { + int leftOverSize = XTL_DS_SGE_SIZE_MAX - (g_dwXbMemAllocated + sizeRequest); // Don't let xbox title to alloc any more. if (leftOverSize < 0) { return false; @@ -72,7 +67,7 @@ inline bool DSoundSGEMenAllocCheck(DWORD sizeRequest) { #if 0 // Debugging controlled audio section for audible only -inline void DSoundDebugMuteFlag(DWORD Xb_bufferBytes, DWORD &EmuFlags) { +static inline void DSoundDebugMuteFlag(DWORD Xb_bufferBytes, DWORD &EmuFlags) { if (Xb_bufferBytes != 0xEA0) { EmuFlags |= DSE_FLAG_DEBUG_MUTE; } else { @@ -83,7 +78,7 @@ inline void DSoundDebugMuteFlag(DWORD Xb_bufferBytes, DWORD &EmuFlags) { #define DSoundDebugMuteFlag #endif -void DSoundBufferOutputXBtoHost(DWORD emuFlags, DSBUFFERDESC &DSBufferDesc, LPVOID pXBaudioPtr, DWORD dwXBAudioBytes, LPVOID pPCaudioPtr, DWORD dwPCMAudioBytes) { +static void DSoundBufferOutputXBtoHost(DWORD emuFlags, DSBUFFERDESC &DSBufferDesc, LPVOID pXBaudioPtr, DWORD dwXBAudioBytes, LPVOID pPCaudioPtr, DWORD dwPCMAudioBytes) { if ((emuFlags & DSE_FLAG_XADPCM) > 0) { TXboxAdpcmDecoder_Decode_Memory((uint8_t*)pXBaudioPtr, dwXBAudioBytes, (uint8_t*)pPCaudioPtr, DSBufferDesc.lpwfxFormat->nChannels); @@ -94,74 +89,7 @@ void DSoundBufferOutputXBtoHost(DWORD emuFlags, DSBUFFERDESC &DSBufferDesc, LPVO } } -// Convert XADPCM to PCM format helper function -inline void XADPCM2PCMFormat(LPWAVEFORMATEX lpwfxFormat) -{ - -#if 0 //For testing purpose if XADPCM to PCM is not accurate. - DbgPrintf("EmuDSound: XADPCM WAVEFORMATEX\n" - "{\n" - " wFormatTag : 0x%.04hX\n" - " nChannels : 0x%.02hd\n" - " nSamplesPerSec : 0x%.08X\n" - " nAvgBytesPerSec : 0x%.08X\n" - " nBlockAlign : 0x%.02hd\n" - " wBitsPerSample : 0x%.04hX\n" - " cbSize : 0x%.04hX\n" - "}\n", - lpwfxFormat->wFormatTag, - lpwfxFormat->nChannels, - lpwfxFormat->nSamplesPerSec, - lpwfxFormat->nAvgBytesPerSec, - lpwfxFormat->nBlockAlign, - lpwfxFormat->wBitsPerSample, - lpwfxFormat->cbSize); -#endif - - lpwfxFormat->wFormatTag = WAVE_FORMAT_PCM; - - //lpwfxFormat.wFormatTag; /* format type */ - //lpwfxFormat.nChannels; /* number of channels (i.e. mono, stereo...) */ NO CHANGE - //lpwfxFormat.nSamplesPerSec; /* sample rate */ NO CHANGE - //lpwfxFormat.nAvgBytesPerSec; /* for buffer estimation */ - //lpwfxFormat.nBlockAlign; /* block size of data */ - //lpwfxFormat.wBitsPerSample; /* number of bits per sample of mono data */ - //lpwfxFormat.cbSize; /* the count in bytes of the size of extra information (after cbSize) */ - - lpwfxFormat->wBitsPerSample = 16; - lpwfxFormat->nBlockAlign = 2 * lpwfxFormat->nChannels; - lpwfxFormat->nAvgBytesPerSec = lpwfxFormat->nSamplesPerSec * lpwfxFormat->nBlockAlign; - lpwfxFormat->cbSize = 0; - //Enable this only if you have Xbox ADPCM Codec installed on your PC, or else it will fail every time. - //This is just to verify format conversion is correct or not. -#if 0 - if (waveOutOpen(NULL, WAVE_MAPPER, lpwfxFormat, NULL, NULL, WAVE_FORMAT_QUERY) != MMSYSERR_NOERROR) { - return DSERR_BADFORMAT; - } -#endif - -#if 0 //For testing purpose if XADPCM to PCM is not accurate. - DbgPrintf("EmuDSound: Converted to PCM WAVEFORMATEX\n" - "{\n" - " wFormatTag : 0x%.04hX\n" - " nChannels : 0x%.02hd\n" - " nSamplesPerSec : 0x%.08X\n" - " nAvgBytesPerSec : 0x%.08X\n" - " nBlockAlign : 0x%.02hd\n" - " wBitsPerSample : 0x%.04hX\n" - " cbSize : 0x%.04hX\n" - "}\n", - lpwfxFormat->wFormatTag, - lpwfxFormat->nChannels, - lpwfxFormat->nSamplesPerSec, - lpwfxFormat->nAvgBytesPerSec, - lpwfxFormat->nBlockAlign, - lpwfxFormat->wBitsPerSample, - lpwfxFormat->cbSize); -#endif -} - -inline void GenerateXboxBufferCache( +static inline void GenerateXboxBufferCache( DSBUFFERDESC &DSBufferDesc, DWORD &dwEmuFlags, DWORD X_BufferSizeRequest, @@ -193,151 +121,197 @@ inline void GenerateXboxBufferCache( } } -inline void GeneratePCMFormat( +static inline void InitVoiceProperties(XTL::X_DSVOICEPROPS& Xb_VoiceProperties) +{ + Xb_VoiceProperties.l3DConeVolume = 0; + Xb_VoiceProperties.l3DDistanceVolume = 0; + Xb_VoiceProperties.l3DDopplerPitch = 0; + Xb_VoiceProperties.lI3DL2DirectVolume = 0; + Xb_VoiceProperties.lI3DL2RoomVolume = 0; + Xb_VoiceProperties.lPitch = -4597; +} + +static inline void GenerateMixBinDefault( + XTL::X_DSVOICEPROPS &Xb_VoiceProperties, + LPCWAVEFORMATEX lpwfxFormat, + XTL::X_LPDSMIXBINS mixbins_output, + bool is3D) +{ + if (g_LibVersion_DSOUND < 4039) { + // Do not apply any update since below 4039 doesn't provide access to get properties. + return; + } + + auto& xb_mixbinArray = Xb_VoiceProperties.MixBinVolumePairs; + unsigned int i; + + // Use custom mixbin if provided. + if (mixbins_output != xbnullptr) { + + Xb_VoiceProperties.dwMixBinCount = mixbins_output->dwCount; + auto& mixbinArray_output = mixbins_output->lpMixBinVolumePairs; + + for (i = 0; i < Xb_VoiceProperties.dwMixBinCount; i++) { + xb_mixbinArray[i].dwMixBin = mixbinArray_output[i].dwMixBin; + xb_mixbinArray[i].lVolume = 0; + } + } + // Otherwise use default setup as instructed by internally. + else { + unsigned int counter = 0; + + + if (is3D) { + + xb_mixbinArray[counter].dwMixBin = 6; + xb_mixbinArray[counter].lVolume = 0; + counter++; + + xb_mixbinArray[counter].dwMixBin = 8; + xb_mixbinArray[counter].lVolume = 0; + counter++; + + xb_mixbinArray[counter].dwMixBin = 7; + xb_mixbinArray[counter].lVolume = 0; + counter++; + + xb_mixbinArray[counter].dwMixBin = 9; + xb_mixbinArray[counter].lVolume = 0; + counter++; + + xb_mixbinArray[counter].dwMixBin = 10; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + else { + // If format is PCM/XADPCM, then use stereo mixbin as default. + if (lpwfxFormat == xbnullptr || lpwfxFormat->wFormatTag != WAVE_FORMAT_EXTENSIBLE) { + counter = 2; + for (i = 0; i < counter; i++) { + xb_mixbinArray[i].dwMixBin = i; + xb_mixbinArray[i].lVolume = 0; + } + } + // Otherwise, the format is extensible and using channel mask as default. + else { + const WAVEFORMATEXTENSIBLE* wfxFormatExtensible = reinterpret_cast(lpwfxFormat); + auto& channelMask = wfxFormatExtensible->dwChannelMask; + + if ((channelMask & SPEAKER_FRONT_LEFT) > 0) { + xb_mixbinArray[counter].dwMixBin = 0; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + + if ((channelMask & SPEAKER_FRONT_RIGHT) > 0) { + xb_mixbinArray[counter].dwMixBin = 1; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + + if ((channelMask & SPEAKER_FRONT_CENTER) > 0) { + xb_mixbinArray[counter].dwMixBin = 2; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + + if ((channelMask & SPEAKER_LOW_FREQUENCY) > 0) { + xb_mixbinArray[counter].dwMixBin = 3; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + + if ((channelMask & SPEAKER_BACK_LEFT) > 0) { + xb_mixbinArray[counter].dwMixBin = 4; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + + if ((channelMask & SPEAKER_BACK_RIGHT) > 0) { + xb_mixbinArray[counter].dwMixBin = 5; + xb_mixbinArray[counter].lVolume = 0; + counter++; + } + } + } + + Xb_VoiceProperties.dwMixBinCount = counter; + } + + // Finally, set the rest as invalid/silent. + for (int i = Xb_VoiceProperties.dwMixBinCount; i < 8; i++) { + xb_mixbinArray[i].dwMixBin = 0xFFFFFFFF; + xb_mixbinArray[i].lVolume = -10000; + } +} + +static inline void GeneratePCMFormat( DSBUFFERDESC &DSBufferDesc, - LPCWAVEFORMATEX lpwfxFormat, + LPCWAVEFORMATEX Xb_lpwfxFormat, + DWORD &Xb_flags, DWORD &dwEmuFlags, DWORD X_BufferSizeRequest, LPVOID* X_BufferCache, - DWORD &X_BufferCacheSize) + DWORD &X_BufferCacheSize, + XTL::X_DSVOICEPROPS& Xb_VoiceProperties, + XTL::X_LPDSMIXBINS mixbins_output) { bool bIsSpecial = false; - DWORD checkAvgBps; + + GenerateMixBinDefault(Xb_VoiceProperties, Xb_lpwfxFormat, mixbins_output, ((DSBufferDesc.dwFlags & DSBCAPS_CTRL3D) > 0)); // convert from Xbox to PC DSound { DSBufferDesc.dwReserved = 0; - if (lpwfxFormat != xbnullptr) { + // Allocate only once, does not need to re-allocate. + if (DSBufferDesc.lpwfxFormat == nullptr) { + // Only allocate extra value for setting extra values later on. WAVEFORMATEXTENSIBLE is the highest size I had seen. + DSBufferDesc.lpwfxFormat = (WAVEFORMATEX*)calloc(1, sizeof(WAVEFORMATEXTENSIBLE)); + } - //TODO: RadWolfie - Need implement support for WAVEFORMATEXTENSIBLE as stated in CDirectSoundStream_SetFormat function note below - // Do we need to convert it? Or just only do the WAVEFORMATEX only? + if (DSBufferDesc.lpwfxFormat == nullptr) { + CxbxKrnlCleanup("Unable to allocate DSBufferDesc.Xb_lpwfxFormat"); + } - // NOTE: pwfxFormat is not always a WAVEFORMATEX structure, it can - // be WAVEFORMATEXTENSIBLE if that's what the programmer(s) wanted - // in the first place, FYI. + if (Xb_lpwfxFormat != xbnullptr) { - // Allocate only once, does not need to re-allocate. - if (DSBufferDesc.lpwfxFormat == nullptr) { - // Only allocate extra value for setting extra values later on. WAVEFORMATEXTENSIBLE is the highest size I had seen. - DSBufferDesc.lpwfxFormat = (WAVEFORMATEX*)calloc(1, sizeof(WAVEFORMATEXTENSIBLE)); + PWAVEFORMATEXTENSIBLE lpwfxFormatHost = reinterpret_cast(DSBufferDesc.lpwfxFormat); + + if (Xb_lpwfxFormat->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { + memcpy(lpwfxFormatHost, Xb_lpwfxFormat, sizeof(WAVEFORMATEX) + Xb_lpwfxFormat->cbSize); } - if (lpwfxFormat->wFormatTag == WAVE_FORMAT_PCM) { - // Test case: Hulk crash due to cbSize is not a valid size. - memcpy(DSBufferDesc.lpwfxFormat, lpwfxFormat, sizeof(WAVEFORMATEX)); - DSBufferDesc.lpwfxFormat->cbSize = 0; // Let's enforce this value to prevent any other exception later on. - } else { - memcpy(DSBufferDesc.lpwfxFormat, lpwfxFormat, sizeof(WAVEFORMATEX) + lpwfxFormat->cbSize); + else { + // Other formats will enforce use WAVEFORMATEX size, we cannot allow corruption sneak into WAVEFORMATEXTENSIBLE's structure. + memcpy(lpwfxFormatHost, Xb_lpwfxFormat, sizeof(WAVEFORMATEX)); + lpwfxFormatHost->Format.cbSize = 0; } dwEmuFlags = dwEmuFlags & ~DSE_FLAG_AUDIO_CODECS; - switch (DSBufferDesc.lpwfxFormat->wFormatTag) { - case WAVE_FORMAT_PCM: + CODEC_FORMAT cf_audio = WFXformat_SyncHostFormat(DSBufferDesc.lpwfxFormat, Xb_lpwfxFormat, X_BufferSizeRequest, Xb_flags); + if (cf_audio == CF_PCM) { dwEmuFlags |= DSE_FLAG_PCM; - - //TODO: Phantasy Star Online Episode I & II made an attempt to use avg byte/second below sample/second requirement. - //In other word, this is a workaround to fix title mistake... - checkAvgBps = lpwfxFormat->nSamplesPerSec * lpwfxFormat->nBlockAlign; - if (lpwfxFormat->nAvgBytesPerSec < checkAvgBps) { - DSBufferDesc.lpwfxFormat->nAvgBytesPerSec = checkAvgBps; - } - break; - case WAVE_FORMAT_XBOX_ADPCM: - dwEmuFlags |= DSE_FLAG_XADPCM; - XADPCM2PCMFormat(DSBufferDesc.lpwfxFormat); - break; - default: - dwEmuFlags |= DSE_FLAG_PCM_UNKNOWN; - break; } + else if (cf_audio == CF_XADPCM) { + dwEmuFlags |= DSE_FLAG_XADPCM; + } + else { + dwEmuFlags |= DSE_FLAG_PCM_UNKNOWN; + } + } else { - bIsSpecial = true; dwEmuFlags |= DSE_FLAG_RECIEVEDATA; - EmuWarning("Creating dummy WAVEFORMATEX (pdsbd->lpwfxFormat = xbnullptr)..."); - - // HACK: This is a special sound buffer, create dummy WAVEFORMATEX data. - // It's supposed to recieve data rather than generate it. Buffers created - // with flags DSBCAPS_MIXIN, DSBCAPS_FXIN, and DSBCAPS_FXIN2 will have no - // WAVEFORMATEX structure by default. - - // TODO: A better response to this scenario if possible. - - DSBufferDesc.lpwfxFormat = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEXTENSIBLE)); - - //memset(pDSBufferDescSpecial->lpwfxFormat, 0, sizeof(WAVEFORMATEX)); - //memset(pDSBufferDescSpecial, 0, sizeof(DSBUFFERDESC)); - - DSBufferDesc.lpwfxFormat->wFormatTag = WAVE_FORMAT_PCM; - DSBufferDesc.lpwfxFormat->nChannels = 2; - DSBufferDesc.lpwfxFormat->nSamplesPerSec = 22050; - DSBufferDesc.lpwfxFormat->nBlockAlign = 4; - DSBufferDesc.lpwfxFormat->nAvgBytesPerSec = DSBufferDesc.lpwfxFormat->nSamplesPerSec * DSBufferDesc.lpwfxFormat->nBlockAlign; - DSBufferDesc.lpwfxFormat->wBitsPerSample = 16; - DSBufferDesc.lpwfxFormat->cbSize = 0; + (void)WFXformat_SyncHostFormat(DSBufferDesc.lpwfxFormat, Xb_lpwfxFormat, X_BufferSizeRequest, Xb_flags); DSBufferDesc.dwFlags = DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY; - DSBufferDesc.dwBufferBytes = 3 * DSBufferDesc.lpwfxFormat->nAvgBytesPerSec; - - // DSBufferDesc.lpwfxFormat = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEX)/*+pdsbd->lpwfxFormat->cbSize*/); - - //// DSBufferDesc.lpwfxFormat->cbSize = sizeof( WAVEFORMATEX ); - // DSBufferDesc.lpwfxFormat->nChannels = 1; - // DSBufferDesc.lpwfxFormat->wFormatTag = WAVE_FORMAT_PCM; - // DSBufferDesc.lpwfxFormat->nSamplesPerSec = 22050; - // DSBufferDesc.lpwfxFormat->nBlockAlign = 4; - // DSBufferDesc.lpwfxFormat->nAvgBytesPerSec = 4 * 22050; - // DSBufferDesc.lpwfxFormat->wBitsPerSample = 16; - - // Give this buffer 3 seconds of data if needed - /*if(pdsbd->dwBufferBytes == 0) { - DSBufferDesc.dwBufferBytes = 3 * DSBufferDesc.lpwfxFormat->nAvgBytesPerSec; - }*/ + DSBufferDesc.dwBufferBytes = 5 * DSBufferDesc.lpwfxFormat->nAvgBytesPerSec; } DSBufferDesc.guid3DAlgorithm = DS3DALG_DEFAULT; } - // TODO: Still a requirement? Need to retest it again. Can't remember which title cause problem or had been resolved. - // sanity check - if (!bIsSpecial) { - if (DSBufferDesc.lpwfxFormat->nBlockAlign != (DSBufferDesc.lpwfxFormat->nChannels*DSBufferDesc.lpwfxFormat->wBitsPerSample) / 8) { - DSBufferDesc.lpwfxFormat->nBlockAlign = (2 * DSBufferDesc.lpwfxFormat->wBitsPerSample) / 8; - DSBufferDesc.lpwfxFormat->nAvgBytesPerSec = DSBufferDesc.lpwfxFormat->nSamplesPerSec * DSBufferDesc.lpwfxFormat->nBlockAlign; - } - } - - if (DSBufferDesc.lpwfxFormat != nullptr) { - - // NOTE: This process check for 2+ channels whenever XADPCM or PCM format from xbox titles input in nChannels. - // Since the host do not support 2+ channels on PCM only format. We must convert/update allocated wfxFormat to EXTENSIBLE - // format which had been allocated enough to update. - if (DSBufferDesc.lpwfxFormat->nChannels > 2 && DSBufferDesc.lpwfxFormat->wFormatTag != WAVE_FORMAT_EXTENSIBLE) { - PWAVEFORMATEXTENSIBLE lpwfxFormatExtensible = (PWAVEFORMATEXTENSIBLE)DSBufferDesc.lpwfxFormat; - lpwfxFormatExtensible->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - lpwfxFormatExtensible->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); - lpwfxFormatExtensible->Samples.wValidBitsPerSample = lpwfxFormatExtensible->Format.wBitsPerSample; - lpwfxFormatExtensible->Samples.wSamplesPerBlock = 0; - lpwfxFormatExtensible->Samples.wReserved = 0; - lpwfxFormatExtensible->dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; - - // Add rear speakers - if (lpwfxFormat->nChannels >= 4) { - lpwfxFormatExtensible->dwChannelMask |= SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; - } - // Add center speaker - if (lpwfxFormat->nChannels >= 5) { - lpwfxFormatExtensible->dwChannelMask |= SPEAKER_FRONT_CENTER; - } - // Add subwoofer mask (pretty sure 3 channels is 2.1, not 3.0 for xbox purpose) - if (lpwfxFormat->nChannels == 6 || lpwfxFormat->nChannels == 3) { - lpwfxFormatExtensible->dwChannelMask |= SPEAKER_LOW_FREQUENCY; - } - lpwfxFormatExtensible->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } - } - if (X_BufferSizeRequest < DSBSIZE_MIN) { X_BufferSizeRequest = DSBSIZE_MIN; } else if (X_BufferSizeRequest > DSBSIZE_MAX) { @@ -353,7 +327,7 @@ inline void GeneratePCMFormat( } } -inline void DSoundGenericUnlock( +static inline void DSoundGenericUnlock( DWORD dwEmuFlags, LPDIRECTSOUNDBUFFER8 pDSBuffer, DSBUFFERDESC &DSBufferDesc, @@ -389,30 +363,27 @@ inline void DSoundGenericUnlock( } // Temporary creation since we need IDIRECTSOUNDBUFFER8, not IDIRECTSOUNDBUFFER class. -inline void DSoundBufferCreate(LPDSBUFFERDESC pDSBufferDesc, LPDIRECTSOUNDBUFFER8 &pDSBuffer) +static inline HRESULT DSoundBufferCreate(LPDSBUFFERDESC pDSBufferDesc, LPDIRECTSOUNDBUFFER8 &pDSBuffer) { LPDIRECTSOUNDBUFFER pTempBuffer; - HRESULT hRetDS = g_pDSound8->CreateSoundBuffer(pDSBufferDesc, &pTempBuffer, NULL); + HRESULT hRetDS = g_pDSound8->CreateSoundBuffer(pDSBufferDesc, &pTempBuffer, nullptr); - if (hRetDS != DS_OK) { - CxbxKrnlCleanup("CreateSoundBuffer error: 0x%08X", hRetDS); - } else { + if (hRetDS == DS_OK) { hRetDS = pTempBuffer->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*)&(pDSBuffer)); pTempBuffer->Release(); - if (hRetDS != DS_OK) { - CxbxKrnlCleanup("Create IDirectSoundBuffer8 error: 0x%08X", hRetDS); - } } + return hRetDS; } -inline void DSound3DBufferCreate(LPDIRECTSOUNDBUFFER8 pDSBuffer, LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer) { + +static inline void DSound3DBufferCreate(LPDIRECTSOUNDBUFFER8 pDSBuffer, LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer) { HRESULT hRetDS3D = pDSBuffer->QueryInterface(IID_IDirectSound3DBuffer, (LPVOID*)&(pDS3DBuffer)); if (hRetDS3D != DS_OK) { - EmuWarning("CreateSound3DBuffer Failed!"); + EmuLog(LOG_LEVEL::WARNING, "CreateSound3DBuffer Failed!"); pDS3DBuffer = nullptr; } } -#define DSoundBufferSetDefault(pThis, dwEmuPlayFlags) \ +#define DSoundBufferSetDefault(pThis, dwEmuPlayFlags, Xb_dwFlags) \ pThis->EmuDirectSoundBuffer8 = nullptr; \ pThis->EmuDirectSound3DBuffer8 = nullptr; \ pThis->X_BufferCache = xbnullptr; \ @@ -422,7 +393,11 @@ inline void DSound3DBufferCreate(LPDIRECTSOUNDBUFFER8 pDSBuffer, LPDIRECTSOUND3D pThis->Xb_rtPauseEx = 0LL; \ pThis->Xb_Volume = 0L; \ pThis->Xb_VolumeMixbin = 0L; \ - pThis->Xb_dwHeadroom = 600; // default for 2D voice + pThis->Xb_dwHeadroom = 600; /* default for 2D voice */ \ + pThis->Xb_EnvolopeDesc = { 0 }; \ + InitVoiceProperties(pThis->Xb_VoiceProperties); /* The rest will initialize in GeneratePCMFormat to GenerateMixBinDefault. */ \ + pThis->Xb_Frequency = XTL_DSXFREQUENCY_ORIGINAL; \ + pThis->Xb_Flags = Xb_dwFlags; //pThis->EmuBufferDesc = { 0 }; // Enable this when become necessary. /* pThis->EmuLockPtr1 = xbnullptr; \ @@ -430,7 +405,7 @@ inline void DSound3DBufferCreate(LPDIRECTSOUNDBUFFER8 pDSBuffer, LPDIRECTSOUND3D pThis->EmuLockPtr2 = xbnullptr; \ pThis->EmuLockBytes2 = 0; \ */ -inline void DSoundBufferRegionSetDefault(XTL::X_CDirectSoundBuffer *pThis) { +static inline void DSoundBufferRegionSetDefault(XTL::X_CDirectSoundBuffer *pThis) { pThis->EmuBufferToggle = XTL::X_DSB_TOGGLE_DEFAULT; pThis->EmuRegionLoopStartOffset = 0; pThis->EmuRegionLoopLength = 0; @@ -439,13 +414,13 @@ inline void DSoundBufferRegionSetDefault(XTL::X_CDirectSoundBuffer *pThis) { } -inline void DSoundBufferTransferSettings( +static inline void DSoundBufferTransferSettings( LPDIRECTSOUNDBUFFER8 &pDSBufferOld, LPDIRECTSOUNDBUFFER8 &pDSBufferNew, LPDIRECTSOUND3DBUFFER8 &pDS3DBufferOld, - LPDIRECTSOUND3DBUFFER8 &pDS3DBufferNew) + LPDIRECTSOUND3DBUFFER8 &pDS3DBufferNew, + DWORD Xb_Frequency) { - DWORD dwFrequency; LONG lVolume, lPan; DS3DBUFFER ds3dBuffer; @@ -453,10 +428,9 @@ inline void DSoundBufferTransferSettings( return; } - pDSBufferOld->GetVolume(&lVolume); - pDSBufferOld->GetFrequency(&dwFrequency); + pDSBufferNew->SetFrequency(Xb_Frequency); - pDSBufferNew->SetFrequency(dwFrequency); + pDSBufferOld->GetVolume(&lVolume); pDSBufferNew->SetVolume(lVolume); if (pDS3DBufferOld != nullptr && pDS3DBufferNew != nullptr) { @@ -469,12 +443,13 @@ inline void DSoundBufferTransferSettings( } } -inline void DSoundBufferReCreate( +static inline void DSoundBufferReCreate( LPDIRECTSOUNDBUFFER8 &pDSBuffer, DSBUFFERDESC &DSBufferDesc, LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer, LPDIRECTSOUNDBUFFER8 &pDSBufferNew, - LPDIRECTSOUND3DBUFFER8 &pDS3DBufferNew) { + LPDIRECTSOUND3DBUFFER8 &pDS3DBufferNew, + DWORD Xb_Frequency) { DSoundBufferCreate(&DSBufferDesc, pDSBufferNew); @@ -483,10 +458,10 @@ inline void DSoundBufferReCreate( DSound3DBufferCreate(pDSBufferNew, pDS3DBufferNew); } - DSoundBufferTransferSettings(pDSBuffer, pDSBufferNew, pDS3DBuffer, pDS3DBufferNew); + DSoundBufferTransferSettings(pDSBuffer, pDSBufferNew, pDS3DBuffer, pDS3DBufferNew, Xb_Frequency); } -inline void DSoundBufferRelease( +static inline void DSoundBufferRelease( LPDIRECTSOUNDBUFFER8 &pDSBuffer, LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer, DWORD &refCount) { @@ -508,7 +483,7 @@ inline void DSoundBufferRelease( } } -inline void DSoundBufferResizeSetSize( +static inline void DSoundBufferResizeSetSize( XTL::X_CDirectSoundBuffer* pThis, HRESULT &hRet, DWORD Xb_dwByteLength) { @@ -533,7 +508,7 @@ inline void DSoundBufferResizeSetSize( LPDIRECTSOUND3DBUFFER8 pDS3DBufferNew = nullptr; DSoundBufferReCreate(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pThis->EmuDirectSound3DBuffer8, - pDSBufferNew, pDS3DBufferNew); + pDSBufferNew, pDS3DBufferNew, pThis->Xb_Frequency); // release old buffer DSoundBufferRelease(pThis->EmuDirectSoundBuffer8, pThis->EmuDirectSound3DBuffer8, refCount); @@ -546,7 +521,7 @@ inline void DSoundBufferResizeSetSize( } } -inline void DSoundBufferResizeUpdate( +static inline void DSoundBufferResizeUpdate( XTL::X_CDirectSoundBuffer* pThis, DWORD dwPlayFlags, HRESULT &hRet, @@ -570,7 +545,7 @@ inline void DSoundBufferResizeUpdate( 0); } -inline void DSoundBufferRegionCurrentLocation( +static inline void DSoundBufferRegionCurrentLocation( XTL::X_CDirectSoundBuffer* pThis, DWORD dwPlayFlags, HRESULT &hRet, @@ -601,7 +576,7 @@ inline void DSoundBufferRegionCurrentLocation( } } -inline void DSoundBufferUpdate( +static inline void DSoundBufferUpdate( XTL::X_CDirectSoundBuffer* pThis, DWORD dwPlayFlags, HRESULT &hRet) { @@ -615,18 +590,19 @@ inline void DSoundBufferUpdate( DSoundBufferResizeUpdate(pThis, dwPlayFlags, hRet, Xb_dwStartOffset, Xb_dwByteLength); } -inline void DSoundBufferReplace( +static inline void DSoundBufferReplace( LPDIRECTSOUNDBUFFER8 &pDSBuffer, DSBUFFERDESC &DSBufferDesc, DWORD PlayFlags, - LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer) + LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer, + DWORD Xb_Frequency) { DWORD refCount, dwPlayCursor, dwStatus; LPDIRECTSOUNDBUFFER8 pDSBufferNew = nullptr; LPDIRECTSOUND3DBUFFER8 pDS3DBufferNew = nullptr; DSoundBufferReCreate(pDSBuffer, DSBufferDesc, pDS3DBuffer, - pDSBufferNew, pDS3DBufferNew); + pDSBufferNew, pDS3DBufferNew, Xb_Frequency); HRESULT hRet = pDSBuffer->GetStatus(&dwStatus); @@ -672,76 +648,8 @@ inline void DSoundBufferReplace( } } -inline void DSoundStreamWriteToBuffer( - LPDIRECTSOUNDBUFFER8 &pDSBuffer, - DWORD dwOffset, - PVOID pBufferData, - DWORD dwBufferSize) { - - LPVOID pAudioPtr, pAudioPtr2; - DWORD dwAudioBytes, dwAudioBytes2; - - HRESULT hRet = pDSBuffer->Lock(dwOffset, dwBufferSize, &pAudioPtr, &dwAudioBytes, - &pAudioPtr2, &dwAudioBytes2, 0); - - if (hRet == DS_OK) { - - if (pAudioPtr != nullptr) { - memcpy_s(pAudioPtr, dwAudioBytes, pBufferData, dwAudioBytes); - if (pAudioPtr2 != nullptr) { - memcpy_s(pAudioPtr2, dwAudioBytes2, (PBYTE)pBufferData + dwAudioBytes, dwAudioBytes2); - } - pDSBuffer->Unlock(pAudioPtr, dwAudioBytes, pAudioPtr2, dwAudioBytes2); - } - } -} - -#define vector_hvp_iterator std::vector::iterator -inline void DSoundStreamClearPacket( - vector_hvp_iterator &buffer, - DWORD status, - XTL::LPFNXMOCALLBACK Xb_lpfnCallback, - LPVOID Xb_lpvContext, - XTL::X_CDirectSoundStream* pThis) { - - free(buffer->pBuffer_data); - - // Peform release only, don't trigger any events below. - if (status == XMP_STATUS_RELEASE_CXBXR) { - DSoundSGEMemDealloc(buffer->xmp_data.dwMaxSize); - buffer = pThis->Host_BufferPacketArray.erase(buffer); - return; - } - - if (buffer->xmp_data.pdwStatus != xbnullptr) { - (*buffer->xmp_data.pdwStatus) = status; - } - if (buffer->xmp_data.pdwCompletedSize != xbnullptr) { - (*buffer->xmp_data.pdwCompletedSize) = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, buffer->xmp_data.dwMaxSize); - } - DSoundSGEMemDealloc(buffer->xmp_data.dwMaxSize); - - auto unionEventContext = buffer->xmp_data.hCompletionEvent; - buffer = pThis->Host_BufferPacketArray.erase(buffer); - // NOTE: Packet must be erase before call the callback function below. See test case below. - // Test case: Pocketbike Racer - // * (cause audio skipping due to callback function called process then another called to process outside callback (x2) - // It only need to call process once. - - // If a callback is set, only do the callback instead of event handle. - if (Xb_lpfnCallback != xbnullptr) { - Xb_lpfnCallback(Xb_lpvContext, unionEventContext, status); - } else if (unionEventContext != 0) { - BOOL checkHandle = SetEvent(unionEventContext); - if (checkHandle == 0) { - DWORD error = GetLastError(); - EmuWarning("DSOUND: Unable to set event on packet's hCompletionEvent. %8X | error = %8X", unionEventContext, error); - } - } -} - // Generic force remove synch playback control flag. -inline void DSoundBufferSynchPlaybackFlagRemove( +static inline void DSoundBufferSynchPlaybackFlagRemove( DWORD &dwEmuFlags ) @@ -755,7 +663,8 @@ inline void DSoundBufferSynchPlaybackFlagRemove( dwEmuFlags ^= DSE_FLAG_SYNCHPLAYBACK_CONTROL; } } -inline HRESULT DSoundBufferSynchPlaybackFlagAdd( + +static inline HRESULT DSoundBufferSynchPlaybackFlagAdd( DWORD &dwEmuFlags ) @@ -771,157 +680,56 @@ inline HRESULT DSoundBufferSynchPlaybackFlagAdd( return DS_OK; } -inline bool DSoundStreamProcess(XTL::X_CDirectSoundStream* pThis) { - - // If title want to pause, then don't process the packets. - if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { - return 0; - } - - // If media object is being used as playback synch, then don't process the packets. - if ((pThis->EmuFlags & DSE_FLAG_SYNCHPLAYBACK_CONTROL) > 0) { - return 0; - } - - // Do not allow to process if there is no packets. - if (pThis->Host_BufferPacketArray.size() == 0) { - return 0; - } - - DWORD dwAudioBytes; - HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwAudioBytes); - if (hRet == DS_OK) { - std::vector::iterator buffer = pThis->Host_BufferPacketArray.begin(); - if (buffer->isWritten == false) { - - prepareNextBufferPacket: - DSoundStreamWriteToBuffer(pThis->EmuDirectSoundBuffer8, buffer->rangeStart, buffer->pBuffer_data, buffer->xmp_data.dwMaxSize); - - // Debug area begin - //printf("DEBUG: next packet process | pThis = %08X | rangeStart = %08d | bufferSize - %08d | dwBufferBytes = %08d | dwWriteOffsetNext = %08d\n", pThis, buffer->rangeStart, buffer->xmp_data.dwMaxSize, pThis->EmuBufferDesc->dwBufferBytes, pThis->Host_dwWriteOffsetNext); - // Debug area end - - if (pThis->Host_isProcessing == false) { - pThis->EmuDirectSoundBuffer8->Play(0, 0, pThis->EmuPlayFlags); - pThis->Host_isProcessing = true; - } - - buffer->isWritten = true; - - } else { - // NOTE: p1. Do not use play cursor, use write cursor to check ahead since by the time it gets there. The buffer is already played. - // p2. Plus play cursor is not reliable to check, write cursor is reliable as it is update more often. - // Test case proof: Gauntlet Dark Legacy give 256 bytes of data to a per packet during intro FMV. - DWORD writePos = 0; - hRet = pThis->EmuDirectSoundBuffer8->GetCurrentPosition(nullptr, &writePos); - if (hRet == DS_OK) { - - int bufPlayed = writePos - buffer->rangeStart; - - // Correct it if buffer was playing and is at beginning. - if (bufPlayed < 0 && (buffer->isPlayed || (writePos + pThis->EmuBufferDesc.dwBufferBytes - buffer->rangeStart) < buffer->xmp_data.dwMaxSize)) { - bufPlayed = pThis->EmuBufferDesc.dwBufferBytes - (bufPlayed * -1); - } - - if (bufPlayed >= 0) { - if (buffer->isPlayed == false) { - buffer->isPlayed = true; - } - if (bufPlayed >= (int)buffer->xmp_data.dwMaxSize) { - - DSoundStreamClearPacket(buffer, XMP_STATUS_SUCCESS, pThis->Xb_lpfnCallback, pThis->Xb_lpvContext, pThis); - - if (pThis->Host_BufferPacketArray.size() == 0) { - goto endOfPacket; - } - if (buffer->isWritten == false) { - goto prepareNextBufferPacket; - } - } - if (buffer->xmp_data.pdwCompletedSize != xbnullptr) { - (*buffer->xmp_data.pdwCompletedSize) = DSoundBufferGetXboxBufferSize(pThis->EmuFlags, bufPlayed); - } - if (pThis->Host_BufferPacketArray.size() > 1) { - if ((buffer + 1)->isWritten == false) { - buffer++; - goto prepareNextBufferPacket; - } - } - } - } - // Out of packets, let's stop it. - if (pThis->Host_BufferPacketArray.size() == 0) { - - endOfPacket: - pThis->Host_isProcessing = false; - pThis->EmuDirectSoundBuffer8->Stop(); - return 0; - } - } - } - return 1; -} - //TODO: RadWolfie - Need to implement DirectSoundBuffer create support. Or not able to do so due to all three classes function differently. //IDirectSound //IDirectSoundStream //IDirectSoundBuffer -/*inline HRESULT HybridDirectSoundBuffer_Create( +/*static inline HRESULT HybridDirectSoundBuffer_Create( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; };*/ -inline ULONG HybridDirectSoundBuffer_AddRef( +static inline ULONG HybridDirectSoundBuffer_AddRef( LPDIRECTSOUNDBUFFER8 pDSBuffer) { - - enterCriticalSection; - ULONG uRet = pDSBuffer->AddRef(); - leaveCriticalSection; - return uRet; } -inline ULONG HybridDirectSoundBuffer_Release( +static inline ULONG HybridDirectSoundBuffer_Release( LPDIRECTSOUNDBUFFER8 pDSBuffer) { - - enterCriticalSection; - ULONG uRet = pDSBuffer->Release(); - leaveCriticalSection; - return uRet; } /* //IDirectSoundStream -inline HRESULT HybridDirectSoundBuffer_Discontinuity( +static inline HRESULT HybridDirectSoundBuffer_Discontinuity( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; } //IDirectSoundStream -inline HRESULT HybridDirectSoundBuffer_Flush( +static inline HRESULT HybridDirectSoundBuffer_Flush( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; } //IDirectSoundStream -inline HRESULT HybridDirectSoundBuffer_FlushEx( +static inline HRESULT HybridDirectSoundBuffer_FlushEx( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; } //IDirectSoundStream -inline HRESULT HybridDirectSoundBuffer_GetInfo( +static inline HRESULT HybridDirectSoundBuffer_GetInfo( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; @@ -929,20 +737,17 @@ inline HRESULT HybridDirectSoundBuffer_GetInfo( // Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_GetCurrentPosition( +static inline HRESULT HybridDirectSoundBuffer_GetCurrentPosition( LPDIRECTSOUNDBUFFER8 pDSBuffer, PDWORD pdwCurrentPlayCursor, PDWORD pdwCurrentWriteCursor, DWORD EmuFlags) { - - enterCriticalSection; - DWORD dwCurrentPlayCursor, dwCurrentWriteCursor; HRESULT hRet = pDSBuffer->GetCurrentPosition(&dwCurrentPlayCursor, &dwCurrentWriteCursor); if (hRet != DS_OK) { - EmuWarning("GetCurrentPosition Failed!"); + EmuLog(LOG_LEVEL::WARNING, "GetCurrentPosition Failed!"); } if (pdwCurrentPlayCursor != xbnullptr) { @@ -952,8 +757,6 @@ inline HRESULT HybridDirectSoundBuffer_GetCurrentPosition( *pdwCurrentWriteCursor = DSoundBufferGetXboxBufferSize(EmuFlags, dwCurrentWriteCursor); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } @@ -961,22 +764,17 @@ inline HRESULT HybridDirectSoundBuffer_GetCurrentPosition( // NOTE: Flags are 100% not compatible, not use Hybrid version //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_GetStatus( +static inline HRESULT HybridDirectSoundBuffer_GetStatus( LPDIRECTSOUNDBUFFER8 pDSBuffer, PDWORD pdwStatus) { - - enterCriticalSection; - HRESULT hRet = pDSBuffer->GetStatus(pdwStatus); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); }*/ /* -inline HRESULT HybridDirectSoundBuffer_GetVoiceProperties( +static inline HRESULT HybridDirectSoundBuffer_GetVoiceProperties( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -984,7 +782,7 @@ inline HRESULT HybridDirectSoundBuffer_GetVoiceProperties( } //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Lock( +static inline HRESULT HybridDirectSoundBuffer_Lock( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -993,7 +791,7 @@ inline HRESULT HybridDirectSoundBuffer_Lock( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Pause( +static inline HRESULT HybridDirectSoundBuffer_Pause( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwPause, DWORD &dwEmuFlags, @@ -1002,9 +800,6 @@ inline HRESULT HybridDirectSoundBuffer_Pause( REFERENCE_TIME rtTimeStamp, REFERENCE_TIME &Xb_rtTimeStamp) { - - enterCriticalSection; - HRESULT hRet = DS_OK; switch (dwPause) { case X_DSSPAUSE_RESUME: @@ -1035,12 +830,10 @@ inline HRESULT HybridDirectSoundBuffer_Pause( break; } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* -inline HRESULT HybridDirectSoundBuffer_PauseEx( +static inline HRESULT HybridDirectSoundBuffer_PauseEx( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -1049,7 +842,7 @@ inline HRESULT HybridDirectSoundBuffer_PauseEx( //Not really require it. //IDirectSoundStream -inline HRESULT HybridDirectSoundBuffer_Process( +static inline HRESULT HybridDirectSoundBuffer_Process( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -1058,7 +851,7 @@ inline HRESULT HybridDirectSoundBuffer_Process( /* PlayEx is now calling to Play function instead of this hybrid function. //Both Play(Ex) only has one function, aka this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Play( +static inline HRESULT HybridDirectSoundBuffer_Play( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD &dwFlags, DWORD &dwEmuFlags) @@ -1070,7 +863,7 @@ inline HRESULT HybridDirectSoundBuffer_Play( // rewind buffer if ((dwFlags & X_DSBPLAY_FROMSTART)) { if (pDSBuffer->SetCurrentPosition(0) != DS_OK) { - EmuWarning("Rewinding buffer failed!"); + EmuLog(LOG_LEVEL::WARNING, "Rewinding buffer failed!"); } dwFlags &= ~X_DSBPLAY_FROMSTART; @@ -1092,7 +885,7 @@ inline HRESULT HybridDirectSoundBuffer_Play( */ /* //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_PlayEx( +static inline HRESULT HybridDirectSoundBuffer_PlayEx( LPDIRECTSOUNDBUFFER8 pDSBuffer, REFERENCE_TIME rtTimeStamp, DWORD dwEmuFlags) @@ -1103,7 +896,7 @@ inline HRESULT HybridDirectSoundBuffer_PlayEx( /* //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Restore( +static inline HRESULT HybridDirectSoundBuffer_Restore( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -1112,13 +905,11 @@ inline HRESULT HybridDirectSoundBuffer_Restore( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetAllParameters( +static inline HRESULT HybridDirectSound3DBuffer_SetAllParameters( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, XTL::X_DS3DBUFFER* pDS3DBufferParams, DWORD dwApply) { - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { @@ -1152,14 +943,12 @@ inline HRESULT HybridDirectSound3DBuffer_SetAllParameters( hRet = g_pDSoundPrimary3DListener8->SetDopplerFactor(pDS3DBufferParams->flDopplerFactor, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetBufferData( +static inline HRESULT HybridDirectSoundBuffer_SetBufferData( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -1168,37 +957,29 @@ inline HRESULT HybridDirectSoundBuffer_SetBufferData( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetConeAngles( +static inline HRESULT HybridDirectSound3DBuffer_SetConeAngles( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetConeAngles(dwInsideConeAngle, dwOutsideConeAngle, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetConeOrientation( +static inline HRESULT HybridDirectSound3DBuffer_SetConeOrientation( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { // TODO: (DSound) Should we do restrictive or passive to return actual result back to titles? @@ -1210,34 +991,27 @@ inline HRESULT HybridDirectSound3DBuffer_SetConeOrientation( } } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetConeOutsideVolume( +static inline HRESULT HybridDirectSound3DBuffer_SetConeOutsideVolume( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, LONG lConeOutsideVolume, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetConeOutsideVolume(lConeOutsideVolume, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetCurrentPosition( +static inline HRESULT HybridDirectSoundBuffer_SetCurrentPosition( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwNewPosition) { @@ -1248,43 +1022,33 @@ inline HRESULT HybridDirectSoundBuffer_SetCurrentPosition( //IDirectSound //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DListener_SetDistanceFactor( +static inline HRESULT HybridDirectSound3DListener_SetDistanceFactor( LPDIRECTSOUND3DLISTENER8 pDS3DListener, FLOAT flDistanceFactor, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = pDS3DListener->SetDistanceFactor(flDistanceFactor, dwApply); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSound //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DListener_SetDopplerFactor( +static inline HRESULT HybridDirectSound3DListener_SetDopplerFactor( LPDIRECTSOUND3DLISTENER8 pDS3DListener, FLOAT flDopplerFactor, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = pDS3DListener->SetDopplerFactor(flDopplerFactor, dwApply); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //TODO: PC DirectSound does not have SetHeadroom method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetEG( +static inline HRESULT HybridDirectSoundBuffer_SetEG( LPDIRECTSOUNDBUFFER8 pDSBuffer, LPVOID pEnvelopeDesc) { @@ -1295,7 +1059,7 @@ inline HRESULT HybridDirectSoundBuffer_SetEG( //TODO: PC DirectSound does not have SetHeadroom method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetFilter( +static inline HRESULT HybridDirectSoundBuffer_SetFilter( LPDIRECTSOUNDBUFFER8 pDSBuffer, XTL::X_DSFILTERDESC* pFilterDesc) { @@ -1305,30 +1069,31 @@ inline HRESULT HybridDirectSoundBuffer_SetFilter( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetFormat( +static inline HRESULT HybridDirectSoundBuffer_SetFormat( LPDIRECTSOUNDBUFFER8 &pDSBuffer, - LPCWAVEFORMATEX pwfxFormat, + LPCWAVEFORMATEX Xb_pwfxFormat, + DWORD Xb_flags, DSBUFFERDESC &BufferDesc, DWORD &dwEmuFlags, DWORD &dwPlayFlags, LPDIRECTSOUND3DBUFFER8 &pDS3DBuffer, bool X_BufferAllocate, LPVOID &X_BufferCache, - DWORD &X_BufferCacheSize) + DWORD &X_BufferCacheSize, + XTL::X_DSVOICEPROPS &Xb_VoiceProperties, + XTL::X_LPDSMIXBINS mixbins_output, + DWORD Xb_Frequency) { - - enterCriticalSection; - pDSBuffer->Stop(); if (X_BufferAllocate) { - GeneratePCMFormat(BufferDesc, pwfxFormat, dwEmuFlags, X_BufferCacheSize, xbnullptr, X_BufferCacheSize); + GeneratePCMFormat(BufferDesc, Xb_pwfxFormat, Xb_flags, dwEmuFlags, X_BufferCacheSize, xbnullptr, X_BufferCacheSize, Xb_VoiceProperties, mixbins_output); // Don't allocate for DS Stream class, it is using straight from the source. } else { - GeneratePCMFormat(BufferDesc, pwfxFormat, dwEmuFlags, 0, xbnullptr, X_BufferCacheSize); + GeneratePCMFormat(BufferDesc, Xb_pwfxFormat, Xb_flags, dwEmuFlags, 0, xbnullptr, X_BufferCacheSize, Xb_VoiceProperties, mixbins_output); } HRESULT hRet = DS_OK; - if (g_pDSoundPrimaryBuffer == pDSBuffer) { + if ((void*)g_pDSoundPrimaryBuffer == (void*)pDSBuffer) { hRet = pDSBuffer->SetFormat(BufferDesc.lpwfxFormat); } else { // DSound Stream only @@ -1336,38 +1101,33 @@ inline HRESULT HybridDirectSoundBuffer_SetFormat( // Allocate at least 5 second worth of bytes in PCM format. BufferDesc.dwBufferBytes = BufferDesc.lpwfxFormat->nAvgBytesPerSec * 5; } - DSoundBufferReplace(pDSBuffer, BufferDesc, dwPlayFlags, pDS3DBuffer); + DSoundBufferReplace(pDSBuffer, BufferDesc, dwPlayFlags, pDS3DBuffer, Xb_Frequency); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetFrequency( +static inline HRESULT HybridDirectSoundBuffer_SetFrequency( LPDIRECTSOUNDBUFFER8 pDSBuffer, - DWORD dwFrequency) + DWORD dwFrequency, + DWORD &Xb_Frequency) { - - enterCriticalSection; - HRESULT hRet = S_OK; + Xb_Frequency = dwFrequency; hRet = pDSBuffer->SetFrequency(dwFrequency); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } -HRESULT HybridDirectSoundBuffer_SetVolume(LPDIRECTSOUNDBUFFER8, LONG, DWORD, LPLONG, LONG, DWORD); +static HRESULT HybridDirectSoundBuffer_SetVolume(LPDIRECTSOUNDBUFFER8, LONG, DWORD, LPLONG, LONG, DWORD); //IDirectSoundStream //IDirectSoundBuffer // NOTE: 0 to 10,000; For initialize value would be 3D default to 0 and 2D default to 600. -inline HRESULT HybridDirectSoundBuffer_SetHeadroom( +static inline HRESULT HybridDirectSoundBuffer_SetHeadroom( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwHeadroom, DWORD &Xb_dwHeadroom, @@ -1375,9 +1135,6 @@ inline HRESULT HybridDirectSoundBuffer_SetHeadroom( LONG Xb_volumeMixbin, DWORD dwEmuFlags) { - - enterCriticalSection; - HRESULT hRet; if (dwHeadroom > 10000) { hRet = DSERR_INVALIDPARAM; @@ -1387,8 +1144,6 @@ inline HRESULT HybridDirectSoundBuffer_SetHeadroom( HybridDirectSoundBuffer_SetVolume(pDSBuffer, Xb_volume, dwEmuFlags, xbnullptr, Xb_volumeMixbin, dwHeadroom); } - leaveCriticalSection; - return DS_OK; } @@ -1396,7 +1151,7 @@ inline HRESULT HybridDirectSoundBuffer_SetHeadroom( //TODO: PC DirectSound does not have SetI3DL2Source method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetI3DL2Source( +static inline HRESULT HybridDirectSoundBuffer_SetI3DL2Source( LPDIRECTSOUNDBUFFER8 pDSBuffer, PVOID pds3db, DWORD dwApply) @@ -1408,7 +1163,7 @@ inline HRESULT HybridDirectSoundBuffer_SetI3DL2Source( //TODO: PC DirectSound does not have SetLFO method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetLFO( +static inline HRESULT HybridDirectSoundBuffer_SetLFO( LPDIRECTSOUNDBUFFER8 pDSBuffer, LPCDSLFODESC pLFODesc) { @@ -1419,7 +1174,7 @@ inline HRESULT HybridDirectSoundBuffer_SetLFO( /* //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetLoopRegion( +static inline HRESULT HybridDirectSoundBuffer_SetLoopRegion( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwLoopStart, DWORD dwLoopLength) @@ -1430,48 +1185,38 @@ inline HRESULT HybridDirectSoundBuffer_SetLoopRegion( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetMaxDistance( +static inline HRESULT HybridDirectSound3DBuffer_SetMaxDistance( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, D3DVALUE flMaxDistance, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetMaxDistance(flMaxDistance, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetMinDistance( +static inline HRESULT HybridDirectSound3DBuffer_SetMinDistance( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, D3DVALUE flMinDistance, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetMinDistance(flMinDistance, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //TODO: PC DirectSound does not have SetMixBins method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetMixBins( +static inline HRESULT HybridDirectSoundBuffer_SetMixBins( LPDIRECTSOUNDBUFFER8 pDSBuffer, PVOID pMixBins) { @@ -1481,16 +1226,15 @@ inline HRESULT HybridDirectSoundBuffer_SetMixBins( //IDirectSoundStream x2 //IDirectSoundBuffer x2 -inline HRESULT HybridDirectSoundBuffer_SetMixBinVolumes_8( +static inline HRESULT HybridDirectSoundBuffer_SetMixBinVolumes_8( LPDIRECTSOUNDBUFFER8 pDSBuffer, XTL::X_LPDSMIXBINS pMixBins, + XTL::X_DSVOICEPROPS& Xb_VoiceProperties, DWORD EmuFlags, LONG Xb_volume, LONG &Xb_volumeMixBin, DWORD Xb_dwHeadroom) { - enterCriticalSection; - HRESULT hRet = DSERR_INVALIDPARAM; if (pMixBins != xbnullptr) { @@ -1499,6 +1243,21 @@ inline HRESULT HybridDirectSoundBuffer_SetMixBinVolumes_8( if (pMixBins->lpMixBinVolumePairs != xbnullptr) { // Let's normalize audio level except for low frequency (subwoofer) for (DWORD i = 0; i < count; i++) { + // Update the mixbin volume only, do not reassign volume pair array. + for (DWORD i = 0; i < count; i++) { + auto& it_in = pMixBins->lpMixBinVolumePairs[i]; + for (DWORD ii = 0; ii < Xb_VoiceProperties.dwMixBinCount; ii++) { + auto& it_internal = Xb_VoiceProperties.MixBinVolumePairs[ii]; + + // Once found a match, set the volume. + // NOTE If titles input duplicate with different volume, + // it will override previous value. + if (it_in.dwMixBin == it_internal.dwMixBin) { + it_internal.lVolume = it_in.lVolume; + } + } + } + #if 0 // This code isn't ideal for DirectSound, since it's not possible to set volume for each speakers. if (pMixBins->lpMixBinVolumePairs[i].dwMixBin != XDSMIXBIN_LOW_FREQUENCY // We only want to focus on speaker volumes, nothing else. @@ -1522,34 +1281,27 @@ inline HRESULT HybridDirectSoundBuffer_SetMixBinVolumes_8( } } - leaveCriticalSection; - return hRet; } //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetMode( +static inline HRESULT HybridDirectSound3DBuffer_SetMode( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, DWORD dwMode, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetMode(dwMode, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetNotificationPositions( +static inline HRESULT HybridDirectSoundBuffer_SetNotificationPositions( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwNotifyCount, LPCDSBPOSITIONNOTIFY paNotifies) @@ -1561,7 +1313,7 @@ inline HRESULT HybridDirectSoundBuffer_SetNotificationPositions( //TODO: PC DirectSound does not have SetOutputBuffer method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetOutputBuffer( +static inline HRESULT HybridDirectSoundBuffer_SetOutputBuffer( LPDIRECTSOUNDBUFFER8 pDSBuffer, X_CDirectSoundBuffer* pOutputBuffer) { @@ -1571,17 +1323,15 @@ inline HRESULT HybridDirectSoundBuffer_SetOutputBuffer( */ //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetPitch( +static inline HRESULT HybridDirectSoundBuffer_SetPitch( LPDIRECTSOUNDBUFFER8 pDSBuffer, - LONG lPitch) + LONG lPitch, + DWORD &Xb_Frequency) { // Convert pitch back to frequency - if (lPitch == 0) { - lPitch = 48000; // NOTE: pitch = 0 is equal to 48 KHz. - } else { - lPitch = static_cast(exp((lPitch / 4096.0f) * log(2)) * 48000.0f); - } + // NOTE: pitch = 0 is equal to 48 KHz. + Xb_Frequency = static_cast(exp((lPitch / 4096.0f) * log(2)) * 48000.0f); /* For research purpose of how to convert frequency to pitch and back to frequency. // Edit hertz variable to see the result. @@ -1596,12 +1346,12 @@ inline HRESULT HybridDirectSoundBuffer_SetPitch( // Convert pitch to hertz hertz = exp((pitch / pitchRatio) * log(2)) * hertzRatio;*/ - RETURN_RESULT_CHECK(pDSBuffer->SetFrequency(lPitch)); + RETURN_RESULT_CHECK(pDSBuffer->SetFrequency(Xb_Frequency)); } /* //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetPlayRegion( +static inline HRESULT HybridDirectSoundBuffer_SetPlayRegion( LPDIRECTSOUNDBUFFER8 pDSBuffer, DWORD dwPlayStart, DWORD dwPlayLength) @@ -1612,30 +1362,25 @@ inline HRESULT HybridDirectSoundBuffer_SetPlayRegion( //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetPosition( +static inline HRESULT HybridDirectSound3DBuffer_SetPosition( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetPosition(x, y, z, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /* //TODO: PC DirectSound does not have SetRolloffCurve method function. //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_SetRolloffCurve( +static inline HRESULT HybridDirectSoundBuffer_SetRolloffCurve( LPDIRECTSOUNDBUFFER8 pDSBuffer, const FLOAT *pflPoints, DWORD dwPointCount, @@ -1648,41 +1393,31 @@ inline HRESULT HybridDirectSoundBuffer_SetRolloffCurve( //IDirectSound //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DListener_SetRolloffFactor( +static inline HRESULT HybridDirectSound3DListener_SetRolloffFactor( LPDIRECTSOUND3DLISTENER8 pDSBuffer, FLOAT fRolloffFactor, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = pDSBuffer->SetRolloffFactor(fRolloffFactor, dwApply); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } //IDirectSound //IDirectSoundStream //IDirectSoundBuffer -inline HRESULT HybridDirectSound3DBuffer_SetVelocity( +static inline HRESULT HybridDirectSound3DBuffer_SetVelocity( LPDIRECTSOUND3DBUFFER8 pDS3DBuffer, FLOAT x, FLOAT y, FLOAT z, DWORD dwApply) { - - enterCriticalSection; - HRESULT hRet = DS_OK; if (pDS3DBuffer != nullptr) { hRet = pDS3DBuffer->SetVelocity(x, y, z, dwApply); } - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } @@ -1690,7 +1425,7 @@ inline HRESULT HybridDirectSound3DBuffer_SetVelocity( //IDirectSoundBuffer // NOTE: real volume = mixbins volume + 3D volume + volume - headroom // 100 millibels (mB) = 1 dB -inline HRESULT HybridDirectSoundBuffer_SetVolume( +static inline HRESULT HybridDirectSoundBuffer_SetVolume( LPDIRECTSOUNDBUFFER8 pDSBuffer, LONG lVolume, DWORD dwEmuFlags, @@ -1698,9 +1433,6 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume( LONG Xb_volumeMixbin, DWORD Xb_dwHeadroom) { - - enterCriticalSection; - // Preserve original volume if (Xb_lpVolume != xbnullptr) { *Xb_lpVolume = lVolume; @@ -1714,22 +1446,22 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume( lVolume += Xb_volumeMixbin - Xb_dwHeadroom; if ((dwEmuFlags & DSE_FLAG_PCM) > 0) { - if (!g_XBAudio.GetPCM()) { + if (!g_XBAudio.codec_pcm) { lVolume = DSBVOLUME_MIN; } } else if ((dwEmuFlags & DSE_FLAG_XADPCM) > 0) { - if (!g_XBAudio.GetXADPCM()) { + if (!g_XBAudio.codec_xadpcm) { lVolume = DSBVOLUME_MIN; } } else if ((dwEmuFlags & DSE_FLAG_PCM_UNKNOWN) > 0) { - if (!g_XBAudio.GetUnknownCodec()) { + if (!g_XBAudio.codec_unknown) { lVolume = DSBVOLUME_MIN; } } if (lVolume <= -6400 && lVolume != DSBVOLUME_MIN) { lVolume = DSBVOLUME_MIN; } else if (lVolume > 0) { - EmuWarning("HybridDirectSoundBuffer_SetVolume has received greater than 0: %ld", lVolume); + EmuLog(LOG_LEVEL::WARNING, "HybridDirectSoundBuffer_SetVolume has received greater than 0: %ld", lVolume); lVolume = 0; } if ((dwEmuFlags & DSE_FLAG_DEBUG_MUTE) > 0) { @@ -1738,14 +1470,12 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume( HRESULT hRet = pDSBuffer->SetVolume(lVolume); - leaveCriticalSection; - RETURN_RESULT_CHECK(hRet); } /*/ //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Stop( +static inline HRESULT HybridDirectSoundBuffer_Stop( LPDIRECTSOUNDBUFFER8 pDSBuffer) { @@ -1754,7 +1484,7 @@ inline HRESULT HybridDirectSoundBuffer_Stop( //Only has one function, this is not a requirement. //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_StopEx( +static inline HRESULT HybridDirectSoundBuffer_StopEx( LPDIRECTSOUNDBUFFER8 pDSBuffer, REFERENCE_TIME rtTimeStamp, DWORD dwEmuFlags) @@ -1764,11 +1494,41 @@ inline HRESULT HybridDirectSoundBuffer_StopEx( } //IDirectSoundBuffer -inline HRESULT HybridDirectSoundBuffer_Unlock( +static inline HRESULT HybridDirectSoundBuffer_Unlock( LPDIRECTSOUNDBUFFER8 pDSBuffer) { return DS_OK; }//*/ -#endif +static inline HRESULT HybridDirectSoundBuffer_GetVoiceProperties( + XTL::X_DSVOICEPROPS& Xb_VoiceProperties, + XTL::X_DSVOICEPROPS* out_VoiceProperties +) +{ + HRESULT ret = DS_OK; + + if (out_VoiceProperties != xbnullptr) { + // Simply copy the data from Xb_VoiceProperties. + *out_VoiceProperties = Xb_VoiceProperties; + } + else { + ret = DSERR_INVALIDPARAM; + } + + return ret; +} + +static inline HRESULT HybridDirectSoundBuffer_SetMixBins( + XTL::X_DSVOICEPROPS& Xb_VoiceProperties, + XTL::X_LPDSMIXBINS in_MixBins, + LPCWAVEFORMATEX pwfxFormat, + DSBUFFERDESC& BufferDesc +) +{ + HRESULT ret = DS_OK; + + GenerateMixBinDefault(Xb_VoiceProperties, pwfxFormat, in_MixBins, ((BufferDesc.dwFlags & DSBCAPS_CTRL3D) > 0)); + + return ret; +} diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.cpp b/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.cpp new file mode 100644 index 000000000..9235839b5 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.cpp @@ -0,0 +1,224 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include +#include "..\XbDSoundTypes.h" + +// For MiNGW +#ifndef DSBCAPS_TRUEPLAYPOSITION +#define DSBCAPS_TRUEPLAYPOSITION 0x00080000 +#endif + +FLAGS2STR_START(DS_BCAPS) + FLAG2STR(DSBCAPS_PRIMARYBUFFER) + FLAG2STR(DSBCAPS_STATIC) + FLAG2STR(DSBCAPS_LOCHARDWARE) + FLAG2STR(DSBCAPS_LOCSOFTWARE) + FLAG2STR(DSBCAPS_CTRL3D) + FLAG2STR(DSBCAPS_CTRLFREQUENCY) + FLAG2STR(DSBCAPS_CTRLPAN) + FLAG2STR(DSBCAPS_CTRLVOLUME) + FLAG2STR(DSBCAPS_CTRLPOSITIONNOTIFY) + FLAG2STR(DSBCAPS_CTRLFX) + FLAG2STR(DSBCAPS_STICKYFOCUS) + FLAG2STR(DSBCAPS_GLOBALFOCUS) + FLAG2STR(DSBCAPS_GETCURRENTPOSITION2) + FLAG2STR(DSBCAPS_MUTE3DATMAXDISTANCE) + FLAG2STR(DSBCAPS_LOCDEFER) + FLAG2STR(DSBCAPS_TRUEPLAYPOSITION) +FLAGS2STR_END_and_LOGRENDER(DS_BCAPS) + +ENUM2STR_START(DS_RESULT) + ENUM2STR_CASE(DS_OK) + ENUM2STR_CASE(DS_NO_VIRTUALIZATION) + ENUM2STR_CASE(DSERR_ALLOCATED) + ENUM2STR_CASE(DSERR_CONTROLUNAVAIL) + ENUM2STR_CASE(DSERR_INVALIDPARAM) + ENUM2STR_CASE(DSERR_INVALIDCALL) + ENUM2STR_CASE(DSERR_GENERIC) + ENUM2STR_CASE(DSERR_PRIOLEVELNEEDED) + ENUM2STR_CASE(DSERR_OUTOFMEMORY) + ENUM2STR_CASE(DSERR_BADFORMAT) + ENUM2STR_CASE(DSERR_UNSUPPORTED) + ENUM2STR_CASE(DSERR_NODRIVER) + ENUM2STR_CASE(DSERR_ALREADYINITIALIZED) + ENUM2STR_CASE(DSERR_NOAGGREGATION) + ENUM2STR_CASE(DSERR_BUFFERLOST) + ENUM2STR_CASE(DSERR_OTHERAPPHASPRIO) + ENUM2STR_CASE(DSERR_UNINITIALIZED) + ENUM2STR_CASE(DSERR_NOINTERFACE) + ENUM2STR_CASE(DSERR_ACCESSDENIED) + ENUM2STR_CASE(DSERR_BUFFERTOOSMALL) + ENUM2STR_CASE(DSERR_DS8_REQUIRED) + ENUM2STR_CASE(DSERR_SENDLOOP) + ENUM2STR_CASE(DSERR_BADSENDBUFFERGUID) + ENUM2STR_CASE(DSERR_OBJECTNOTFOUND) + ENUM2STR_CASE(DSERR_FXUNAVAILABLE) +ENUM2STR_END_and_LOGRENDER(DS_RESULT) + +ENUM2STR_START(WAVEFORMAT_TAG) + ENUM2STR_CASE(0) + ENUM2STR_CASE(WAVE_FORMAT_PCM) + ENUM2STR_CASE(WAVE_FORMAT_ADPCM) + ENUM2STR_CASE(WAVE_FORMAT_XBOX_ADPCM) + ENUM2STR_CASE(WAVE_FORMAT_EXTENSIBLE) +ENUM2STR_END_and_LOGRENDER(WAVEFORMAT_TAG) + +#define WFC_MONO 1 +#define WFC_STEREO 2 +#define WFC_2POINT1 3 +#define WFC_QUAD 4 +#define WFC_5POINT0 5 +#define WFC_5POINT1 6 + +ENUM2STR_START(WAVEFORMAT_CHANNEL) + ENUM2STR_CASE(WFC_MONO) + ENUM2STR_CASE(WFC_STEREO) + ENUM2STR_CASE(WFC_2POINT1) + ENUM2STR_CASE(WFC_QUAD) + ENUM2STR_CASE(WFC_5POINT0) + ENUM2STR_CASE(WFC_5POINT1) +ENUM2STR_END_and_LOGRENDER(WAVEFORMAT_CHANNEL) + +LOGRENDER(WAVEFORMATEX) +{ + return os + LOGRENDER_MEMBER_TYPE(WAVEFORMAT_TAG, wFormatTag) + LOGRENDER_MEMBER_TYPE(WAVEFORMAT_CHANNEL, nChannels) + LOGRENDER_MEMBER(nSamplesPerSec) + LOGRENDER_MEMBER(nAvgBytesPerSec) + LOGRENDER_MEMBER(nBlockAlign) + LOGRENDER_MEMBER(wBitsPerSample) + LOGRENDER_MEMBER(cbSize) + ; +} + +LOGRENDER(GUID) +{ + return os + LOGRENDER_MEMBER(Data1) + LOGRENDER_MEMBER(Data2) + LOGRENDER_MEMBER(Data3) + LOGRENDER_MEMBER(Data4) + ; +} + +LOGRENDER(WAVEFORMATEXTENSIBLE) +{ + if (value.Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) { + return os + LOGRENDER_MEMBER_TYPE(WAVEFORMATEX, Format) + LOGRENDER_MEMBER(Samples.wValidBitsPerSample) + LOGRENDER_MEMBER(dwChannelMask) + LOGRENDER_MEMBER_TYPE(GUID, SubFormat) + ; + } + else { + return os + LOGRENDER_MEMBER_TYPE(WAVEFORMATEX, Format) + ; + } +} + +LOGRENDER(DSBUFFERDESC) +{ + return os + LOGRENDER_MEMBER(dwSize) + LOGRENDER_MEMBER_TYPE(DS_BCAPS, dwFlags) + LOGRENDER_MEMBER(dwBufferBytes) + LOGRENDER_MEMBER(dwReserved) + LOGRENDER_MEMBER_TYPE(LPWAVEFORMATEX, lpwfxFormat) + ; +} + +LOGRENDER(D3DVECTOR) +{ + return os + LOGRENDER_MEMBER(x) + LOGRENDER_MEMBER(y) + LOGRENDER_MEMBER(z) + ; +} + +std::string DirectSoundErrorString(HRESULT hResult) +{ + switch (hResult) { + case DS_OK: + return ""; + case DS_NO_VIRTUALIZATION: + return "The call succeeded, but we had to substitute the 3D algorithm"; + case DSERR_ALLOCATED: + return "The call failed because resources(such as a priority level) were already being used by another caller"; + case DSERR_CONTROLUNAVAIL: + return "The control (vol, pan, etc.) requested by the caller is not available"; + case DSERR_INVALIDPARAM: + return "An invalid parameter was passed to the returning function"; + case DSERR_INVALIDCALL: + return "This call is not valid for the current state of this object"; + case DSERR_GENERIC: + return "An undetermined error occurred inside the DirectSound subsystem"; + case DSERR_PRIOLEVELNEEDED: + return "The caller does not have the priority level required for the function to succeed"; + case DSERR_OUTOFMEMORY: + return "Not enough free memory is available to complete the operation"; + case DSERR_BADFORMAT: + return "The specified WAVE format is not supported"; + case DSERR_UNSUPPORTED: + return "The function called is not supported at this time"; + case DSERR_NODRIVER: + return "No sound driver is available for use"; + case DSERR_ALREADYINITIALIZED: + return "This object is already initialized"; + case DSERR_NOAGGREGATION: + return "This object does not support aggregation"; + case DSERR_BUFFERLOST: + return "The buffer memory has been lost, and must be restored"; + case DSERR_OTHERAPPHASPRIO: + return "Another app has a higher priority level, preventing this call from succeeding"; + case DSERR_UNINITIALIZED: + return "This object has not been initialized"; + case DSERR_NOINTERFACE: + return "The requested COM interface is not available"; + case DSERR_ACCESSDENIED: + return "Access is denied"; + case DSERR_BUFFERTOOSMALL: + return "Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds"; + case DSERR_DS8_REQUIRED: + return "Attempt to use DirectSound 8 functionality on an older DirectSound object"; + case DSERR_SENDLOOP: + return "A circular loop of send effects was detected"; + case DSERR_BADSENDBUFFERGUID: + return "The GUID specified in an audiopath file does not match a valid MIXIN buffer"; + case DSERR_OBJECTNOTFOUND: + return "The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)"; + case DSERR_FXUNAVAILABLE: + return "The effects requested could not be found on the system, or they were found" + "but in the wrong order, or in the wrong hardware/software locations."; + default: + return "Unknown error"; + } +} diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp b/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp new file mode 100644 index 000000000..b6b69ada3 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp @@ -0,0 +1,49 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef DIRECTSOUNDLOGGING_H +#define DIRECTSOUNDLOGGING_H + +#include +#include +#include "Logging.h" + +enum DS_BCAPS : int; +enum DS_RESULT : int; +enum WAVEFORMAT_CHANNEL : int; +enum WAVEFORMAT_TAG : int; +FLAGS2STR_HEADER(DS_BCAPS) +ENUM2STR_HEADER(DS_RESULT) +ENUM2STR_HEADER(WAVEFORMAT_CHANNEL) +ENUM2STR_HEADER(WAVEFORMAT_TAG) + +LOGRENDER_HEADER(GUID) +LOGRENDER_HEADER(WAVEFORMATEX) +LOGRENDER_HEADER(WAVEFORMATEXTENSIBLE) +LOGRENDER_HEADER(DSBUFFERDESC) +LOGRENDER_HEADER(D3DVECTOR) + +std::string DirectSoundErrorString(HRESULT hResult); + +#endif diff --git a/src/core/hle/DSOUND/DirectSound/DirectSoundStream.cpp b/src/core/hle/DSOUND/DirectSound/DirectSoundStream.cpp new file mode 100644 index 000000000..cf5c0e953 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/DirectSoundStream.cpp @@ -0,0 +1,1452 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2017 blueshogun96 +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::DSSTREAM + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" // Global variables + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + +#include "DSStream_PacketManager.hpp" + +// TODO: Tasks need to do for DirectSound HLE +// * Missing CDirectSoundStream patch +// * CDirectSoundStream_Set3DVoiceData (new, undocument) +// * CDirectSoundStream_Use3DVoiceData (new, undocument) +// * IDirectSoundStream_QueryInterface (not require) +// * IDirectSoundStream_QueryInterfaceC (not require) + +XTL::X_CMcpxStream::_vtbl XTL::X_CMcpxStream::vtbl = +{ + 0xBEEFC001, // 0x00 + 0xBEEFC002, // 0x04 + 0xBEEFC003, // 0x08 + 0xBEEFC004, // 0x0C + &XTL::EMUPATCH(CMcpxStream_Dummy_0x10),// 0x10 +}; + +XTL::X_CDirectSoundStream::_vtbl XTL::X_CDirectSoundStream::vtbl = +{ + &XTL::EMUPATCH(CDirectSoundStream_AddRef), // 0x00 + &XTL::EMUPATCH(CDirectSoundStream_Release), // 0x04 +/* + STDMETHOD(GetInfo)(THIS_ LPXMEDIAINFO pInfo) PURE; +*/ + &XTL::EMUPATCH(CDirectSoundStream_GetInfo), // 0x08 + &XTL::EMUPATCH(CDirectSoundStream_GetStatus), // 0x0C + &XTL::EMUPATCH(CDirectSoundStream_Process), // 0x10 + &XTL::EMUPATCH(CDirectSoundStream_Discontinuity), // 0x14 + &XTL::EMUPATCH(CDirectSoundStream_Flush), // 0x18 + 0xBEEFB003, // 0x1C + 0xBEEFB004, // 0x20 + 0xBEEFB005, // 0x24 + 0xBEEFB006, // 0x28 + 0xBEEFB007, // 0x2C + 0xBEEFB008, // 0x30 + 0xBEEFB009, // 0x34 + 0xBEEFB00A, // 0x38 +}; + +/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value. + And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation, + there is chance of failure which contain value greater than 0. + */ + +#include "DirectSoundInline.hpp" + +// ****************************************************************** +// * patch: DirectSoundDoWork (stream) +// ****************************************************************** +void DirectSoundDoWork_Stream(xboxkrnl::LARGE_INTEGER& time) +{ + // Actually, DirectSoundStream need to process buffer packets here. + vector_ds_stream::iterator ppDSStream = g_pDSoundStreamCache.begin(); + for (; ppDSStream != g_pDSoundStreamCache.end(); ppDSStream++) { + if ((*ppDSStream)->Host_BufferPacketArray.size() == 0) { + continue; + } + XTL::X_CDirectSoundStream* pThis = (*ppDSStream); + // TODO: Do we need this in async thread loop? + if (pThis->Xb_rtPauseEx != 0LL && pThis->Xb_rtPauseEx <= time.QuadPart) { + pThis->Xb_rtPauseEx = 0LL; + pThis->EmuFlags &= ~DSE_FLAG_PAUSE; + // Don't call play here, let DSStream_Packet_Process deal with it. + } + // If has flush async requested then verify time has expired to perform flush process. + if ((pThis->EmuFlags & DSE_FLAG_FLUSH_ASYNC) > 0 && pThis->Xb_rtFlushEx <= time.QuadPart) { + if (pThis->Xb_rtFlushEx == 0LL) { + EmuLog(LOG_LEVEL::WARNING, "Attempted to flush without Xb_rtFlushEx set to non-zero"); + } + DSStream_Packet_Flush(pThis); + } else { + DSStream_Packet_Process(pThis); + } + } +} + +// ****************************************************************** +// * patch: CDirectSoundStream_AddRef +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(CDirectSoundStream_AddRef) +( + X_CDirectSoundStream* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = HybridDirectSoundBuffer_AddRef(pThis->EmuDirectSoundBuffer8); + + return uRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_Release +// ****************************************************************** +ULONG WINAPI XTL::EMUPATCH(CDirectSoundStream_Release) +( + X_CDirectSoundStream* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG uRet = 0; + if (pThis != 0 && (pThis->EmuDirectSoundBuffer8 != 0)) { + uRet = pThis->EmuDirectSoundBuffer8->Release(); + + if (uRet == 0) { + if (pThis->EmuDirectSound3DBuffer8 != nullptr) { + pThis->EmuDirectSound3DBuffer8->Release(); + } + + // remove cache entry + vector_ds_stream::iterator ppDSStream = std::find(g_pDSoundStreamCache.begin(), g_pDSoundStreamCache.end(), pThis); + if (ppDSStream != g_pDSoundStreamCache.end()) { + g_pDSoundStreamCache.erase(ppDSStream); + } + + for (auto buffer = pThis->Host_BufferPacketArray.begin(); buffer != pThis->Host_BufferPacketArray.end();) { + DSStream_Packet_Clear(buffer, XMP_STATUS_RELEASE_CXBXR, nullptr, nullptr, pThis); + } + + if (pThis->EmuBufferDesc.lpwfxFormat != nullptr) { + free(pThis->EmuBufferDesc.lpwfxFormat); + } + // NOTE: Do not release X_BufferCache! X_BufferCache is using xbox buffer. + + delete pThis; + } + } + + RETURN(uRet); +} + +// ****************************************************************** +// * patch: DirectSoundCreateStream +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(DirectSoundCreateStream) +( + X_DSSTREAMDESC* pdssd, + OUT X_CDirectSoundStream** ppStream) +{ + DSoundMutexGuardLock; + + // Research reveal DirectSound creation check is part of the requirement. + if (!g_pDSound8 && !g_bDSoundCreateCalled) { + HRESULT hRet; + + hRet = XTL::EMUPATCH(DirectSoundCreate)(nullptr, &g_pDSound8, nullptr); + if (hRet != DS_OK) { + CxbxKrnlCleanup("Unable to initialize DirectSound!"); + } + } + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pdssd) + LOG_FUNC_ARG_OUT(ppStream) + LOG_FUNC_END; + + HRESULT hRet = DS_OK; + + //If out of space, return out of memory. + if (X_DIRECTSOUND_CACHE_COUNT == X_DIRECTSOUND_CACHE_MAX) { + + hRet = DSERR_OUTOFMEMORY; + *ppStream = xbnullptr; + } else { + // TODO: Garbage Collection + *ppStream = new X_CDirectSoundStream(); + + DSBUFFERDESC DSBufferDesc = { 0 }; + + + DWORD dwAcceptableMask = 0x00000010; // TODO: Note 0x00040000 is being ignored (DSSTREAMCAPS_LOCDEFER) + + if (pdssd->dwFlags & (~dwAcceptableMask)) { + EmuLog(LOG_LEVEL::WARNING, "Use of unsupported pdssd->dwFlags mask(s) (0x%.08X)", pdssd->dwFlags & (~dwAcceptableMask)); + } + DSBufferDesc.dwSize = sizeof(DSBUFFERDESC); + //DSBufferDesc->dwFlags = (pdssd->dwFlags & dwAcceptableMask) | DSBCAPS_CTRLVOLUME | DSBCAPS_GETCURRENTPOSITION2; + DSBufferDesc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY | DSBCAPS_GETCURRENTPOSITION2 | //aka DSBCAPS_DEFAULT + control position + (g_XBAudio.mute_on_unfocus ? 0 : DSBCAPS_GLOBALFOCUS); + + if ((pdssd->dwFlags & DSBCAPS_CTRL3D) > 0) { + DSBufferDesc.dwFlags |= DSBCAPS_CTRL3D; + } else { + DSBufferDesc.dwFlags |= DSBCAPS_CTRLPAN; + } + + DSoundBufferSetDefault((*ppStream), DSBPLAY_LOOPING, pdssd->dwFlags); + (*ppStream)->Xb_rtFlushEx = 0LL; + + // We have to set DSBufferDesc last due to EmuFlags must be either 0 or previously written value to preserve other flags. + GeneratePCMFormat(DSBufferDesc, pdssd->lpwfxFormat, pdssd->dwFlags, (*ppStream)->EmuFlags, 0, + xbnullptr, (*ppStream)->X_BufferCacheSize, (*ppStream)->Xb_VoiceProperties, pdssd->lpMixBinsOutput); + + // Test case: Star Wars: KotOR has one packet greater than 5 seconds worth. Increasing to 10 seconds allow stream to work until + // another test case below proven host's buffer size does not matter since packet's size can be greater than host's buffer size. + // Test case: GTA 3 / Vice City, and some other titles has packet's buffer size are bigger than 10 seconds worth of buffer size. + // Allocate at least 5 second worth of bytes in PCM format to allow partial upload packet's buffer. + DSBufferDesc.dwBufferBytes = DSBufferDesc.lpwfxFormat->nAvgBytesPerSec * 5; + (*ppStream)->EmuBufferDesc = DSBufferDesc; + + (*ppStream)->X_MaxAttachedPackets = pdssd->dwMaxAttachedPackets; + (*ppStream)->Host_BufferPacketArray.reserve(pdssd->dwMaxAttachedPackets); + (*ppStream)->Host_dwWriteOffsetNext = 0; + (*ppStream)->Host_dwLastWritePos = 0; + (*ppStream)->Host_isProcessing = false; + (*ppStream)->Xb_lpfnCallback = pdssd->lpfnCallback; + (*ppStream)->Xb_lpvContext = pdssd->lpvContext; + (*ppStream)->Xb_Status = 0; + //TODO: Implement mixbin variable support. Or just merge pdssd struct into DS Stream class. + + EmuLog(LOG_LEVEL::DEBUG, "DirectSoundCreateStream, *ppStream := 0x%.08X", *ppStream); + + hRet = DSoundBufferCreate(&DSBufferDesc, (*ppStream)->EmuDirectSoundBuffer8); + if (FAILED(hRet)) { + std::stringstream output; + output << "Xbox:\n" << pdssd; + output << "\nHost converison:\n" << DSBufferDesc; + EmuLog(LOG_LEVEL::WARNING, output.str().c_str()); + output.str(""); + output << static_cast(hRet); + CxbxKrnlCleanup("DSS: DSoundBufferCreate error: %s", output.str().c_str()); + } + else { + if (DSBufferDesc.dwFlags & DSBCAPS_CTRL3D) { + DSound3DBufferCreate((*ppStream)->EmuDirectSoundBuffer8, (*ppStream)->EmuDirectSound3DBuffer8); + (*ppStream)->Xb_dwHeadroom = 0; // Default for 3D + } + + DSoundDebugMuteFlag((*ppStream)->EmuBufferDesc.dwBufferBytes, (*ppStream)->EmuFlags); + + // Pre-set volume to enforce silence if one of audio codec is disabled. + HybridDirectSoundBuffer_SetVolume((*ppStream)->EmuDirectSoundBuffer8, 0L, (*ppStream)->EmuFlags, nullptr, + (*ppStream)->Xb_VolumeMixbin, (*ppStream)->Xb_dwHeadroom); + + g_pDSoundStreamCache.push_back(*ppStream); + } + } + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSound_CreateSoundStream +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSound_CreateSoundStream) +( + LPDIRECTSOUND8 pThis, + X_DSSTREAMDESC* pdssd, + OUT X_CDirectSoundStream** ppStream, + PVOID pUnknown) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("DirectSoundCreateStream"); + + HRESULT hRet = EMUPATCH(DirectSoundCreateStream)(pdssd, ppStream); + + return hRet; +} + +// ****************************************************************** +// * patch: CMcpxStream_Dummy_0x10 +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(CMcpxStream_Dummy_0x10)(DWORD dwDummy1, DWORD dwDummy2) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwDummy1) + LOG_FUNC_ARG(dwDummy2) + LOG_FUNC_END; + + // Causes deadlock in Halo... + // TODO: Verify that this is a Vista related problem (I HATE Vista!) +// EmuLog(LOG_LEVEL::WARNING, "EmuCMcpxStream_Dummy_0x10 is ignored!"); + + return; +} + +/* ------------- Sorted relative functions begin ------------------*/ + +// ****************************************************************** +// * patch: CDirectSoundStream_Discontinuity +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Discontinuity) +( + X_CDirectSoundStream* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + // default ret = DSERR_GENERIC + + // Perform check if packets exist, then mark the last submited packet as end of stream. + if (!pThis->Host_BufferPacketArray.empty()) { + pThis->Host_BufferPacketArray.back().isStreamEnd = true; + } + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_Flush +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Flush) +( + X_CDirectSoundStream* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + DSoundBufferSynchPlaybackFlagRemove(pThis->EmuFlags); + + while (DSStream_Packet_Flush(pThis)); + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_FlushEx +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_FlushEx) +( + X_CDirectSoundStream* pThis, + REFERENCE_TIME rtTimeStamp, + DWORD dwFlags) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(rtTimeStamp) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_END; + + HRESULT hRet = DSERR_INVALIDPARAM; + // Reset flags here to reprocess dwFlags request. + DSStream_Packet_FlushEx_Reset(pThis); + + // Cannot use rtTimeStamp here, it must be flush. + if (dwFlags == X_DSSFLUSHEX_IMMEDIATE) { + + hRet = XTL::EMUPATCH(CDirectSoundStream_Flush)(pThis); + + } + // Remaining flags require X_DSSFLUSHEX_ASYNC to be include. + else if ((dwFlags & X_DSSFLUSHEX_ASYNC) > 0) { + // If rtTimeStamp is zero'd, then call flush once and allow process flush in worker thread. + if (rtTimeStamp == 0LL) { + bool isBusy = DSStream_Packet_Flush(pThis); + if (!isBusy) { + // testcase: Obscure will crash after new game's video if not call DSStream_Packet_Flush in same thread. + // If flush is not busy, then we don't need worker thread to continue flushing. + return hRet; + } + xboxkrnl::LARGE_INTEGER getTime; + xboxkrnl::KeQuerySystemTime(&getTime); + pThis->Xb_rtFlushEx = getTime.QuadPart; + } + else { + pThis->Xb_rtFlushEx = rtTimeStamp; + } + + pThis->EmuFlags |= DSE_FLAG_FLUSH_ASYNC; + + // Set or remove flags (This is the only place it will set/remove other than flush perform remove the flags.) + if ((dwFlags & X_DSSFLUSHEX_ENVELOPE) > 0) { + pThis->Xb_rtFlushEx += (pThis->Xb_EnvolopeDesc.dwRelease * 512) / 48000; + } + + if ((dwFlags & X_DSSFLUSHEX_ENVELOPE2) > 0) { + pThis->EmuFlags |= DSE_FLAG_ENVELOPE2; + } + else { + pThis->EmuFlags ^= DSE_FLAG_ENVELOPE2; + } + } + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_GetInfo +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetInfo) +( + X_CDirectSoundStream* pThis, + OUT LPXMEDIAINFO pInfo) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pInfo) + LOG_FUNC_END; + + if (pInfo) { + pInfo->dwFlags = XMO_STREAMF_FIXED_SAMPLE_SIZE | XMO_STREAMF_INPUT_ASYNC; + pInfo->dwInputSize = pThis->EmuBufferDesc.lpwfxFormat->nBlockAlign; + pInfo->dwOutputSize = 0; + pInfo->dwMaxLookahead = std::max(static_cast(pThis->EmuBufferDesc.lpwfxFormat->nChannels * static_cast(pThis->EmuBufferDesc.lpwfxFormat->wBitsPerSample) / 8) * 32, static_cast(pThis->EmuBufferDesc.lpwfxFormat->nBlockAlign) * 2); + } + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_GetStatus +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetStatus) +( + X_CDirectSoundStream* pThis, + OUT DWORD* pdwStatus) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwStatus) + LOG_FUNC_END; + + DWORD dwStatusXbox = pThis->Xb_Status, dwStatusHost; + HRESULT hRet = pThis->EmuDirectSoundBuffer8->GetStatus(&dwStatusHost); + + // Convert host to xbox status flag. + if (hRet == DS_OK) { + if (pThis->Host_isProcessing && !(dwStatusXbox & X_DSSSTATUS_PAUSED)) { + dwStatusXbox |= X_DSSSTATUS_PLAYING; + + } + if (pThis->Host_BufferPacketArray.size() != pThis->X_MaxAttachedPackets) { + dwStatusXbox |= X_DSSSTATUS_READY; + } + *pdwStatus = dwStatusXbox; + + } else if (pdwStatus != xbnullptr) { + *pdwStatus = 0; + } + + EmuLog(LOG_LEVEL::DEBUG, "SET dwStatus = %08X; packet array size: %d", + *pdwStatus, pThis->Host_BufferPacketArray.size()); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_GetVoiceProperties +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_GetVoiceProperties) +( + X_CDirectSoundStream* pThis, + OUT X_DSVOICEPROPS* pVoiceProps +) +{ + DSoundMutexGuardLock; + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pVoiceProps) + LOG_FUNC_END; + + if (pVoiceProps == xbnullptr) { + LOG_TEST_CASE("pVoiceProps == xbnullptr"); + RETURN(DS_OK); + } + + HRESULT hRet = HybridDirectSoundBuffer_GetVoiceProperties(pThis->Xb_VoiceProperties, pVoiceProps); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_Pause +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Pause) +( + X_CDirectSoundStream* pThis, + DWORD dwPause) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwPause) + LOG_FUNC_END; + + if (!pThis) { + LOG_TEST_CASE("CDirectSoundStream_Pause called with pThis = nullptr"); + return STATUS_SUCCESS; + } + + HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, + pThis->Host_isProcessing, 0LL, pThis->Xb_rtPauseEx); + + if (dwPause == X_DSSPAUSE_PAUSENOACTIVATE) { + if (pThis->Host_BufferPacketArray.size() == 0 && !(pThis->EmuFlags & DSE_FLAG_IS_ACTIVATED)) { + pThis->EmuFlags |= DSE_FLAG_PAUSE; + } + } + + if ((pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { + pThis->Host_isProcessing = false; + if ((pThis->EmuFlags & DSE_FLAG_IS_ACTIVATED) > 0) { + if (pThis->Host_BufferPacketArray.size() != 0) { + pThis->Xb_Status |= X_DSSSTATUS_PAUSED; + } + } + } + else if (!pThis->Host_isProcessing) { + DSStream_Packet_Process(pThis); + } + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_PauseEx +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_PauseEx) +( + X_CDirectSoundStream *pThis, + REFERENCE_TIME rtTimestamp, + DWORD dwPause) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(rtTimestamp) + LOG_FUNC_ARG(dwPause) + LOG_FUNC_END; + + // This function wasn't part of the XDK until 4721. (Same as IDirectSoundBuffer_PauseEx?) + // TODO: Implement time stamp feature (a thread maybe?) + + HRESULT hRet = HybridDirectSoundBuffer_Pause(pThis->EmuDirectSoundBuffer8, dwPause, pThis->EmuFlags, pThis->EmuPlayFlags, + pThis->Host_isProcessing, rtTimestamp, pThis->Xb_rtPauseEx); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_Process +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Process) +( + X_CDirectSoundStream *pThis, + PXMEDIAPACKET pInputBuffer, + PXMEDIAPACKET pOutputBuffer) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pInputBuffer) + LOG_FUNC_ARG(pOutputBuffer) + LOG_FUNC_END; + + // Research data: + // * Max packet size permitted is 0x2000 (or 8,192 decimal) of buffer. + // * Somehow other titles are using more than 0x2000 for max size. Am using a hacky host method for now (see pBuffer_data). + + if (pThis->EmuDirectSoundBuffer8 != nullptr) { + + if (pInputBuffer != xbnullptr) { + + // Add packets from title until it gets full. + if (pThis->Host_BufferPacketArray.size() != pThis->X_MaxAttachedPackets) { + host_voice_packet packet_input; + packet_input.pBuffer_data = nullptr; + packet_input.xmp_data = *pInputBuffer; + packet_input.xmp_data.dwMaxSize = DSoundBufferGetPCMBufferSize(pThis->EmuFlags, pInputBuffer->dwMaxSize); + if (packet_input.xmp_data.dwMaxSize != 0) { + packet_input.pBuffer_data = malloc(packet_input.xmp_data.dwMaxSize); + DSoundSGEMemAlloc(packet_input.xmp_data.dwMaxSize); + } + packet_input.nextWriteOffset = pThis->Host_dwWriteOffsetNext; + packet_input.lastWritePos = packet_input.nextWriteOffset; + pThis->Host_dwWriteOffsetNext += packet_input.xmp_data.dwMaxSize; + // Packet size may be larger than host's pre-allocated buffer size, loop is a requirement until within range is known. + while (pThis->EmuBufferDesc.dwBufferBytes <= pThis->Host_dwWriteOffsetNext) { + pThis->Host_dwWriteOffsetNext -= pThis->EmuBufferDesc.dwBufferBytes; + } + packet_input.bufWrittenBytes = 0; + packet_input.bufPlayed = 0; + packet_input.isPlayed = false; + packet_input.isStreamEnd = false; + + DSoundBufferOutputXBtoHost(pThis->EmuFlags, pThis->EmuBufferDesc, pInputBuffer->pvBuffer, pInputBuffer->dwMaxSize, packet_input.pBuffer_data, packet_input.xmp_data.dwMaxSize); + + pThis->Host_BufferPacketArray.push_back(packet_input); + + if (pInputBuffer->pdwStatus != xbnullptr) { + (*pInputBuffer->pdwStatus) = XMP_STATUS_PENDING; + } + if (pInputBuffer->pdwCompletedSize != xbnullptr) { + (*pInputBuffer->pdwCompletedSize) = 0; + } + if (pThis->Host_isProcessing == false && pThis->Host_BufferPacketArray.size() == 1) { + pThis->EmuDirectSoundBuffer8->SetCurrentPosition(packet_input.nextWriteOffset); + } + + if ((pThis->Xb_Status & X_DSSSTATUS_STARVED) > 0) { + pThis->Xb_Status &= ~X_DSSSTATUS_STARVED; + } + if ((pThis->EmuFlags & DSE_FLAG_IS_ACTIVATED) > 0 && (pThis->EmuFlags & DSE_FLAG_PAUSE) > 0) { + pThis->Xb_Status |= X_DSSSTATUS_PAUSED; + } + DSStream_Packet_Process(pThis); + // Once full it needs to change status to flushed when cannot hold any more packets. + } else { + if (pInputBuffer->pdwStatus != xbnullptr) { + (*pInputBuffer->pdwStatus) = XMP_STATUS_FAILURE; + } + } + } + + //TODO: What to do with output buffer audio variable? Need test case or functional source code. + // NOTE: pOutputBuffer is reserved, must be set to NULL from titles. + if (pOutputBuffer != xbnullptr) { + LOG_TEST_CASE("pOutputBuffer is not nullptr, please report title test case to issue tracker. Thanks!"); + } + + } else { + if (pInputBuffer != xbnullptr && pInputBuffer->pdwStatus != xbnullptr) { + (*pInputBuffer->pdwStatus) = XMP_STATUS_SUCCESS; + } + } + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetAllParameters +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetAllParameters) +( + X_CDirectSoundStream* pThis, + X_DS3DBUFFER* pc3DBufferParameters, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pc3DBufferParameters) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetAllParameters(pThis->EmuDirectSound3DBuffer8, pc3DBufferParameters, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetConeAngles +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeAngles) +( + X_CDirectSoundStream* pThis, + DWORD dwInsideConeAngle, + DWORD dwOutsideConeAngle, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwInsideConeAngle) + LOG_FUNC_ARG(dwOutsideConeAngle) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeAngles(pThis->EmuDirectSound3DBuffer8, dwInsideConeAngle, dwOutsideConeAngle, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetConeOrientation +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeOrientation) +( + X_CDirectSoundStream* pThis, + D3DVALUE x, + D3DVALUE y, + D3DVALUE z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeOrientation(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetConeOutsideVolume +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetConeOutsideVolume) +( + X_CDirectSoundStream* pThis, + LONG lConeOutsideVolume, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lConeOutsideVolume) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetConeOutsideVolume(pThis->EmuDirectSound3DBuffer8, lConeOutsideVolume, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetDistanceFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetDistanceFactor) +( + X_CDirectSoundStream* pThis, + FLOAT flDistanceFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flDistanceFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDistanceFactor(g_pDSoundPrimary3DListener8, flDistanceFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetDopplerFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetDopplerFactor) +( + X_CDirectSoundStream* pThis, + FLOAT flDopplerFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flDopplerFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DListener_SetDopplerFactor(g_pDSoundPrimary3DListener8, flDopplerFactor, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetEG +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetEG) +( + X_CDirectSoundStream* pThis, + X_DSENVOLOPEDESC* pEnvelopeDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pEnvelopeDesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + pThis->Xb_EnvolopeDesc = *pEnvelopeDesc; + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetEG +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetEG) +( + X_CDirectSoundStream* pThis, + X_DSENVOLOPEDESC* pEnvelopeDesc) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetEG"); + + return XTL::EMUPATCH(CDirectSoundStream_SetEG)(pThis, pEnvelopeDesc); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetFilter +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFilter) +( + X_CDirectSoundStream* pThis, + X_DSFILTERDESC* pFilterDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pFilterDesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetFilter +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetFilter) +( + X_CDirectSoundStream* pThis, + X_DSFILTERDESC* pFilterDesc) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetFilter"); + + return XTL::EMUPATCH(CDirectSoundStream_SetFilter)(pThis, pFilterDesc); +} + +// ****************************************************************** +// * patch: CDirectSoundStream::SetFormat +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFormat) +( + X_CDirectSoundStream* pThis, + LPCWAVEFORMATEX pwfxFormat) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pwfxFormat) + LOG_FUNC_END; + + while (DSStream_Packet_Flush(pThis)); + + HRESULT hRet = HybridDirectSoundBuffer_SetFormat(pThis->EmuDirectSoundBuffer8, pwfxFormat, pThis->Xb_Flags, + pThis->EmuBufferDesc, pThis->EmuFlags, pThis->EmuPlayFlags, + pThis->EmuDirectSound3DBuffer8, 0, pThis->X_BufferCache, + pThis->X_BufferCacheSize, pThis->Xb_VoiceProperties, + xbnullptr, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetFrequency +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetFrequency) +( + X_CDirectSoundStream* pThis, + DWORD dwFrequency) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwFrequency) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetFrequency(pThis->EmuDirectSoundBuffer8, dwFrequency, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetFrequency +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetFrequency) +( + X_CDirectSoundStream* pThis, + DWORD dwFrequency) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetFrequency"); + + return XTL::EMUPATCH(CDirectSoundStream_SetFrequency)(pThis, dwFrequency); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetHeadroom +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetHeadroom) +( + X_CDirectSoundStream* pThis, + DWORD dwHeadroom) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwHeadroom) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetHeadroom(pThis->EmuDirectSoundBuffer8, dwHeadroom, pThis->Xb_dwHeadroom, + pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->EmuFlags); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetHeadroom +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetHeadroom) +( + X_CDirectSoundStream* pThis, + DWORD dwHeadroom) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetHeadroom"); + + return XTL::EMUPATCH(CDirectSoundStream_SetHeadroom)(pThis, dwHeadroom); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetI3DL2Source +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetI3DL2Source) +( + X_CDirectSoundStream* pThis, + X_DSI3DL2BUFFER* pds3db, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pds3db) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: SetI3DL2Source is using DSFXI3DL2Reverb structure, aka different interface. + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetLFO +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetLFO) +( + X_CDirectSoundStream* pThis, + LPCDSLFODESC pLFODesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pLFODesc) + LOG_FUNC_END; + + // NOTE: DSP relative function + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetLFO +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetLFO) +( + X_CDirectSoundStream* pThis, + LPCDSLFODESC pLFODesc) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetLFO"); + + return XTL::EMUPATCH(CDirectSoundStream_SetLFO)(pThis, pLFODesc); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMaxDistance +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMaxDistance) +( + X_CDirectSoundStream* pThis, + D3DVALUE flMaxDistance, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(flMaxDistance) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMaxDistance(pThis->EmuDirectSound3DBuffer8, flMaxDistance, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMinDistance +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMinDistance) +( + X_CDirectSoundStream* pThis, + D3DVALUE fMinDistance, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fMinDistance) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMinDistance(pThis->EmuDirectSound3DBuffer8, fMinDistance, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMixBins +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBins) +( + X_CDirectSoundStream* pThis, + DWORD dwMixBinMask) // Also can be X_LPDSMIXBINS (4039+) +{ + DSoundMutexGuardLock; + HRESULT hRet = DS_OK; + X_LPDSMIXBINS pMixBins = reinterpret_cast(dwMixBinMask); + + if (g_LibVersion_DSOUND < 4039) { + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMixBinMask) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + } + else { + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pMixBins) + LOG_FUNC_END; + + hRet = HybridDirectSoundBuffer_SetMixBins(pThis->Xb_VoiceProperties, pMixBins, pThis->EmuBufferDesc.lpwfxFormat, pThis->EmuBufferDesc); + } + + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetMixBins +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetMixBins) +( + X_CDirectSoundStream* pThis, + DWORD dwMixBinMask) // Also can be X_LPDSMIXBINS (4039+) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetMixBins"); + + return XTL::EMUPATCH(CDirectSoundStream_SetMixBins)(pThis, dwMixBinMask); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMode +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMode) +( + X_CDirectSoundStream* pThis, + DWORD dwMode, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMode) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetMode(pThis->EmuDirectSound3DBuffer8, dwMode, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMixBinVolumes_12 +// This revision API was used in XDK 3911 until API had changed in XDK 4039. +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_12) +( + X_CDirectSoundStream* pThis, + DWORD dwMixBinMask, + const LONG* alVolumes) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(dwMixBinMask) + LOG_FUNC_ARG(alVolumes) + LOG_FUNC_END; + + // NOTE: Use this function for XDK 3911 only because the implementation was changed + // somewhere around the March 2002 (4361) update (or earlier, maybe). + + LOG_UNIMPLEMENTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetMixBinVolumes_8 +// ****************************************************************** +// This revision API is only used in XDK 4039 and higher. +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_8) +( + X_CDirectSoundStream* pThis, + X_LPDSMIXBINS pMixBins) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pMixBins) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetMixBinVolumes_8(pThis->EmuDirectSoundBuffer8, pMixBins, pThis->Xb_VoiceProperties, + pThis->EmuFlags, pThis->Xb_Volume, pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetOutputBuffer +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetOutputBuffer) +( + X_CDirectSoundStream* pThis, + X_CDirectSoundBuffer* pOutputBuffer) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pOutputBuffer) + LOG_FUNC_END; + + // NOTE: SetOutputBuffer is not possible in PC's DirectSound due to 3D controller requirement on ouput buffer to work simultaneously. + // Test case: Red Faction 2 + // Best to emulate this LLE instead of HLE. + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetPitch +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetPitch) +( + X_CDirectSoundStream* pThis, + LONG lPitch) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lPitch) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetPitch(pThis->EmuDirectSoundBuffer8, lPitch, pThis->Xb_Frequency); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetPitch +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetPitch) +( + X_CDirectSoundStream* pThis, + LONG lPitch) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetPitch"); + + return XTL::EMUPATCH(CDirectSoundStream_SetPitch)(pThis, lPitch); +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetPosition +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetPosition) +( + X_CDirectSoundStream* pThis, + D3DVALUE x, + D3DVALUE y, + D3DVALUE z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetPosition(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream::SetRolloffCurve +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetRolloffCurve) +( + X_CDirectSoundBuffer* pThis, + const FLOAT* pflPoints, + DWORD dwPointCount, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pflPoints) + LOG_FUNC_ARG(dwPointCount) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetRolloffFactor +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetRolloffFactor) +( + X_CDirectSoundStream* pThis, + FLOAT fRolloffFactor, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(fRolloffFactor) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + // NOTE: SetRolloffFactor is only supported for host primary buffer's 3D Listener. + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetVelocity +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetVelocity) +( + X_CDirectSoundStream* pThis, + D3DVALUE x, + D3DVALUE y, + D3DVALUE z, + DWORD dwApply) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(x) + LOG_FUNC_ARG(y) + LOG_FUNC_ARG(z) + LOG_FUNC_ARG(dwApply) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSound3DBuffer_SetVelocity(pThis->EmuDirectSound3DBuffer8, x, y, z, dwApply); + + return hRet; +} + +// ****************************************************************** +// * patch: CDirectSoundStream_SetVolume +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_SetVolume) +( + X_CDirectSoundStream* pThis, + LONG lVolume) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lVolume) + LOG_FUNC_END; + + HRESULT hRet = HybridDirectSoundBuffer_SetVolume(pThis->EmuDirectSoundBuffer8, lVolume, pThis->EmuFlags, &pThis->Xb_Volume, + pThis->Xb_VolumeMixbin, pThis->Xb_dwHeadroom); + + return hRet; +} + +// ****************************************************************** +// * patch: IDirectSoundStream_SetVolume +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_SetVolume) +( + X_CDirectSoundStream* pThis, + LONG lVolume +) +{ + DSoundMutexGuardLock; + + LOG_FORWARD("CDirectSoundStream_SetVolume"); + + return XTL::EMUPATCH(CDirectSoundStream_SetVolume)(pThis, lVolume); +} + +// ****************************************************************** +// * patch: IDirectSoundStream_Set3DVoiceData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_Set3DVoiceData) +( + X_CDirectSoundStream* pThis, + DWORD a2 +) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(a2) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + RETURN(STATUS_SUCCESS); +} + +// ****************************************************************** +// * patch: IDirectSoundBuffer_Use3DVoiceData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(IDirectSoundStream_Use3DVoiceData) +( + X_CDirectSoundStream* pThis, + DWORD a2 +) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(a2) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + RETURN(STATUS_SUCCESS); +} diff --git a/src/core/hle/DSOUND/DirectSound/XFileMediaObject.cpp b/src/core/hle/DSOUND/DirectSound/XFileMediaObject.cpp new file mode 100644 index 000000000..170f7b3c2 --- /dev/null +++ b/src/core/hle/DSOUND/DirectSound/XFileMediaObject.cpp @@ -0,0 +1,436 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#define LOG_PREFIX CXBXR_MODULE::XMO + +// prevent name collisions +namespace xboxkrnl { + #include +}; + +#include +#include "DirectSoundGlobal.hpp" // Global variables + +#include "Logging.h" +#include "DirectSoundLogging.hpp" +#include "..\XbDSoundLogging.hpp" + +#include "DirectSoundInline.hpp" + +// TODO: Tasks need to do for DirectSound HLE +// * Need create patches +// * Ac97CreateMediaObject (Need OOVPA) +// - WmaCreateDecoder (Need OOVPA, not require) Test case: WMAStream sample +// - WmaCreateDecoderEx (Is just a forward to WmaCreateDecoder, nothing else) +// - WmaCreateInMemoryDecoder (Need OOVPA, not require) Test case: WMAInMemory sample +// - WmaCreateInMemoryDecoderEx (Is just a forward to WmaCreateInMemoryDecoder, nothing else) +// * XWmaDecoderCreateMediaObject (Need OOVPA) + +XTL::X_XFileMediaObject::_vtbl XTL::X_XFileMediaObject::vtbl = +{ + &XTL::EMUPATCH(XFileMediaObject_AddRef), // 0x00 + &XTL::EMUPATCH(XFileMediaObject_Release), // 0x04 + &XTL::EMUPATCH(XFileMediaObject_GetInfo), // 0x08 + &XTL::EMUPATCH(XFileMediaObject_GetStatus), // 0x0C + &XTL::EMUPATCH(XFileMediaObject_Process), // 0x10 + &XTL::EMUPATCH(XFileMediaObject_Discontinuity), // 0x14 + 0xBEEFD007, // 0x18 + &XTL::EMUPATCH(XFileMediaObject_Seek), // 0x1C + 0xBEEFD009, // 0x20 + &XTL::EMUPATCH(XFileMediaObject_DoWork), // 0x24 +}; + +/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value. + And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation, + there is chance of failure which contain value greater than 0. + */ + +#if 0 // NOTE: Not require to patch +// ****************************************************************** +// * patch: XAudioCreateAdpcmFormat +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XAudioCreateAdpcmFormat) +( + WORD nChannels, + DWORD nSamplesPerSec, + OUT LPXBOXADPCMWAVEFORMAT pwfx) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(nChannels) + LOG_FUNC_ARG(nSamplesPerSec) + LOG_FUNC_ARG_OUT(pwfx) + LOG_FUNC_END; + + // Fill out the pwfx structure with the appropriate data + pwfx->wfx.wFormatTag = WAVE_FORMAT_XBOX_ADPCM; + pwfx->wfx.nChannels = nChannels; + pwfx->wfx.nSamplesPerSec = nSamplesPerSec; + pwfx->wfx.nBlockAlign = nChannels * 36; + pwfx->wfx.nAvgBytesPerSec = (nSamplesPerSec / 64/*Always 64 samples per block*/) * pwfx->wfx.nBlockAlign; + pwfx->wfx.wBitsPerSample = 4; + pwfx->wfx.cbSize = 2; + pwfx->wSamplesPerBlock = 64; +} +#endif + +// ****************************************************************** +// * patch: XAudioDownloadEffectsImage +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(XAudioDownloadEffectsImage) +( + LPCSTR pszImageName, + LPVOID pImageLoc, + DWORD dwFlags, + LPVOID* ppImageDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pszImageName) + LOG_FUNC_ARG(pImageLoc) + LOG_FUNC_ARG(dwFlags) + LOG_FUNC_ARG(ppImageDesc) + LOG_FUNC_END; + + LOG_NOT_SUPPORTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: XAudioSetEffectData +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(XAudioSetEffectData) +( + DWORD dwEffectIndex, + void* pDesc, + void* pRawDesc) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwEffectIndex) + LOG_FUNC_ARG(pDesc) + LOG_FUNC_ARG(pRawDesc) + LOG_FUNC_END; + + LOG_NOT_SUPPORTED(); + + return E_FAIL; +} + +// ****************************************************************** +// * patch: XFileCreaeMediaObject +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObject) +( + LPCSTR pstrFileName, + DWORD dwDesiredAccess, + DWORD dwShareMode, + DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, + OUT void** ppMediaObject) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pstrFileName) + LOG_FUNC_ARG(dwDesiredAccess) + LOG_FUNC_ARG(dwShareMode) + LOG_FUNC_ARG(dwCreationDisposition) + LOG_FUNC_ARG(dwFlagsAndAttributes) + LOG_FUNC_ARG_OUT(ppMediaObject) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return E_FAIL; +} + +// ****************************************************************** +// * patch: XFileCreateMediaObjectAsync +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectAsync) +( + HANDLE hFile, + DWORD dwMaxPackets, + OUT void** ppMediaObject) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hFile) + LOG_FUNC_ARG(dwMaxPackets) + LOG_FUNC_ARG_OUT(ppMediaObject) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + *ppMediaObject = new X_XFileMediaObject(); + + return S_OK; +} + +// ****************************************************************** +// * patch: XFileCreaeMediaObjectEx +// ****************************************************************** +HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectEx) +( + HANDLE hFile, + OUT void** ppMediaObject) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hFile) + LOG_FUNC_ARG_OUT(ppMediaObject) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return E_FAIL; +} + +// ****************************************************************** +// * patch: XWaveFileCreateMediaObject +// ****************************************************************** +// NOTE: Does not require any patch. +HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObject) +( + LPCSTR pszFileName, + LPCWAVEFORMATEX* ppwfxFormat, + OUT void** ppMediaObject) //XFileMediaObject, include XMediaObject interface +{ + // + + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pszFileName) + LOG_FUNC_ARG(ppwfxFormat) + LOG_FUNC_ARG_OUT(ppMediaObject) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return E_FAIL; +} + +// ****************************************************************** +// * patch: XWaveFileCreateMediaObjectEx +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObjectEx) +( + LPCSTR pszFileName, + HANDLE hFile, + OUT void** ppMediaObject) //XWaveFileMediaObject, include XFileMediaObject and XMediaObject interfaces +{ + // + + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pszFileName) + LOG_FUNC_ARG(hFile) + LOG_FUNC_ARG_OUT(ppMediaObject) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return E_FAIL; +} + +// ****************************************************************** +// * patch: XFileMediaObject_Seek +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Seek) +( + X_XFileMediaObject* pThis, + LONG lOffset, + DWORD dwOrigin, + LPDWORD pdwAbsolute) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(lOffset) + LOG_FUNC_ARG(dwOrigin) + LOG_FUNC_ARG(pdwAbsolute) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return S_OK; +} + +// ****************************************************************** +// * patch: XFileMediaObject_DoWork +// ****************************************************************** +// NOTE: Does not require a patch. +VOID WINAPI XTL::EMUPATCH(XFileMediaObject_DoWork)(X_XFileMediaObject* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + LOG_UNIMPLEMENTED(); + +} + +// ****************************************************************** +// * patch: XFileMediaObject_GetStatus +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetStatus) +( + X_XFileMediaObject* pThis, + OUT LPDWORD pdwStatus) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pdwStatus) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: XFileMediaObject_GetInfo +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetInfo) +( + X_XFileMediaObject* pThis, + OUT XMEDIAINFO* pInfo) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG_OUT(pInfo) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: XFileMediaObject_Process +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Process) +( + X_XFileMediaObject* pThis, + LPXMEDIAPACKET pInputBuffer, + LPXMEDIAPACKET pOutputBuffer) +{ + DSoundMutexGuardLock; + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThis) + LOG_FUNC_ARG(pInputBuffer) + LOG_FUNC_ARG(pOutputBuffer) + LOG_FUNC_END; + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + +// ****************************************************************** +// * patch: XFileMediaObject_AddRef +// ****************************************************************** +// NOTE: Does not require a patch. +ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_AddRef) +( + X_XFileMediaObject* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG Ret = 0; + + if (pThis) { // TODO : this should be an assert() + Ret = ++(pThis->EmuRefCount); + } + + return Ret; +} + +// ****************************************************************** +// * patch: XFileMediaObject_Release +// ****************************************************************** +// NOTE: Does not require a patch. +ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_Release) +( + X_XFileMediaObject* pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + ULONG Ret = 0; + + if (pThis) { // TODO : this should be an assert() + Ret = --(pThis->EmuRefCount); + if (Ret == 0) { + delete pThis; + } + } + + return Ret; +} + +// ****************************************************************** +// * patch: XFileMediaObject_Discontinuity +// ****************************************************************** +// NOTE: Does not require a patch. +HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Discontinuity) +( + X_XFileMediaObject *pThis) +{ + DSoundMutexGuardLock; + + LOG_FUNC_ONE_ARG(pThis); + + LOG_UNIMPLEMENTED(); + + return DS_OK; +} + diff --git a/src/core/hle/DSOUND/XbDSoundLogging.cpp b/src/core/hle/DSOUND/XbDSoundLogging.cpp new file mode 100644 index 000000000..fcbf85675 --- /dev/null +++ b/src/core/hle/DSOUND/XbDSoundLogging.cpp @@ -0,0 +1,389 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** + +#include // Temporary placeholder until XbDSoundTypes.h is cross-platform + filled in the blanks +#include "Logging.h" +#include "XbDSoundLogging.hpp" +#include "common/Settings.hpp" + +// For XTL::DSBUFFERDESC and XTL::DSSTREAMDESC temporary usage +extern LOGRENDER_HEADER(WAVEFORMATEX) +extern LOGRENDER_HEADER(D3DVECTOR) + +namespace XTL { + +// DSound class usage +ENUM2STR_START(DSMIXBIN_SPEAKER) + ENUM2STR_CASE(XDSMIXBIN_FRONT_LEFT) + ENUM2STR_CASE(XDSMIXBIN_FRONT_RIGHT) + ENUM2STR_CASE(XDSMIXBIN_FRONT_CENTER) + ENUM2STR_CASE(XDSMIXBIN_LOW_FREQUENCY) + ENUM2STR_CASE(XDSMIXBIN_BACK_LEFT) + ENUM2STR_CASE(XDSMIXBIN_BACK_RIGHT) + //ENUM2STR_CASE(XDSMIXBIN_SPEAKERS_MAX) // NOTE: Only used as a counter. +ENUM2STR_END_and_LOGRENDER(DSMIXBIN_SPEAKER) + +FLAGS2STR_START(DSSPEAKER_FLAG) + FLAG2STR(X_DSSPEAKER_STEREO) + FLAG2STR(X_DSSPEAKER_MONO) + FLAG2STR(X_DSSPEAKER_SURROUND) + FLAG2STR(X_DSSPEAKER_ENABLE_AC3) + FLAG2STR(X_DSSPEAKER_ENABLE_DTS) +FLAGS2STR_END_and_LOGRENDER(DSSPEAKER_FLAG) + +// DSound generic flag/enum +ENUM2STR_START(DSFILTER_MODE) + ENUM2STR_CASE(DSFILTER_MODE_BYPASS) + ENUM2STR_CASE(DSFILTER_MODE_DLS2) + ENUM2STR_CASE(DSFILTER_MODE_PARAMEQ) + ENUM2STR_CASE(DSFILTER_MODE_MULTI) +ENUM2STR_END_and_LOGRENDER(DSFILTER_MODE) + +// DSound Buffer flag/enum +FLAGS2STR_START(DSBCAPS_FLAG) + FLAG2STR(XTL_DSBCAPS_CTRL3D) + FLAG2STR(XTL_DSBCAPS_CTRLFREQUENCY) + FLAG2STR(XTL_DSBCAPS_CTRLVOLUME) + FLAG2STR(XTL_DSBCAPS_CTRLPOSITIONNOTIFY) + FLAG2STR(XTL_DSBCAPS_MIXIN) + FLAG2STR(XTL_DSBCAPS_MUTE3DATMAXDISTANCE) + FLAG2STR(XTL_DSBCAPS_LOCDEFER) + FLAG2STR(XTL_DSBCAPS_FXIN) + FLAG2STR(XTL_DSBCAPS_FXIN2) +FLAGS2STR_END_and_LOGRENDER(DSBCAPS_FLAG) + +FLAGS2STR_START(DSBPAUSE_FLAG) + FLAG2STR(X_DSBPAUSE_RESUME) + FLAG2STR(X_DSBPAUSE_PAUSE) + FLAG2STR(X_DSBPAUSE_SYNCHPLAYBACK) +FLAGS2STR_END_and_LOGRENDER(DSBPAUSE_FLAG) + +FLAGS2STR_START(DSBPLAY_FLAG) + FLAG2STR(X_DSBPLAY_LOOPING) + FLAG2STR(X_DSBPLAY_FROMSTART) + FLAG2STR(X_DSBPLAY_SYNCHPLAYBACK) +FLAGS2STR_END_and_LOGRENDER(DSBPLAY_FLAG) + +FLAGS2STR_START(DSBSTATUS_FLAG) + FLAG2STR(X_DSBSTATUS_PLAYING) + FLAG2STR(X_DSBSTATUS_PAUSED) + FLAG2STR(X_DSBSTATUS_LOOPING) +FLAGS2STR_END_and_LOGRENDER(DSBSTATUS_FLAG) + +FLAGS2STR_START(DSBSTOPEX_FLAG) + FLAG2STR(X_DSBSTOPEX_IMMEDIATE) + FLAG2STR(X_DSBSTOPEX_ENVELOPE) + FLAG2STR(X_DSBSTOPEX_RELEASEWAVEFORM) + //FLAG2STR(X_DSBSTOPEX_ALL) // NOTE: Only a combine of envelope and releasewaveform flags together. +FLAGS2STR_END_and_LOGRENDER(DSBSTOPEX_FLAG) + +// DSound Stream flag/enum +FLAGS2STR_START(DSSCAPS_FLAG) + FLAG2STR(XTL_DSSCAPS_CTRL3D) + FLAG2STR(XTL_DSSCAPS_CTRLFREQUENCY) + FLAG2STR(XTL_DSSCAPS_CTRLVOLUME) + FLAG2STR(XTL_DSSCAPS_MUTE3DATMAXDISTANCE) + FLAG2STR(XTL_DSSCAPS_LOCDEFER) + FLAG2STR(XTL_DSSCAPS_NOMERGE) + FLAG2STR(XTL_DSSCAPS_ACCURATENOTIFY) +FLAGS2STR_END_and_LOGRENDER(DSSCAPS_FLAG) + +FLAGS2STR_START(DSSFLUSHEX_FLAG) + FLAG2STR(X_DSSFLUSHEX_IMMEDIATE) + FLAG2STR(X_DSSFLUSHEX_ASYNC) + FLAG2STR(X_DSSFLUSHEX_ENVELOPE) + FLAG2STR(X_DSSFLUSHEX_ENVELOPE2) +FLAGS2STR_END_and_LOGRENDER(DSSFLUSHEX_FLAG) + +FLAGS2STR_START(DSSPAUSE_FLAG) + FLAG2STR(X_DSSPAUSE_RESUME) + FLAG2STR(X_DSSPAUSE_PAUSE) + FLAG2STR(X_DSSPAUSE_SYNCHPLAYBACK) + FLAG2STR(X_DSSPAUSE_PAUSENOACTIVATE) +FLAGS2STR_END_and_LOGRENDER(DSSPAUSE_FLAG) + +FLAGS2STR_START(DSSSTATUS_FLAG) + FLAG2STR(X_DSSSTATUS_READY) + FLAG2STR(X_DSSSTATUS_PLAYING) + FLAG2STR(X_DSSSTATUS_PAUSED) + FLAG2STR(X_DSSSTATUS_STARVED) + FLAG2STR(X_DSSSTATUS_ENVELOPECOMPLETE) +FLAGS2STR_END_and_LOGRENDER(DSSSTATUS_FLAG) + +// DSound XMedia flag/enum +ENUM2STR_START(XMP_STATUS) + ENUM2STR_CASE(XMP_STATUS_SUCCESS) + ENUM2STR_CASE(XMP_STATUS_PENDING) + ENUM2STR_CASE(XMP_STATUS_FLUSHED) + ENUM2STR_CASE(XMP_STATUS_FAILURE) + ENUM2STR_CASE((int)XMP_STATUS_RELEASE_CXBXR) // NOTE: Custom status for Cxbx-Reloaded. +ENUM2STR_END_and_LOGRENDER(XMP_STATUS) + +FLAGS2STR_START(XMO_STREAMF) + FLAG2STR(XMO_STREAMF_FIXED_SAMPLE_SIZE) + FLAG2STR(XMO_STREAMF_FIXED_PACKET_ALIGNMENT) + FLAG2STR(XMO_STREAMF_INPUT_ASYNC) + FLAG2STR(XMO_STREAMF_OUTPUT_ASYNC) + FLAG2STR(XMO_STREAMF_IN_PLACE) + FLAG2STR(XMO_STREAMF_MASK) +FLAGS2STR_END_and_LOGRENDER(XMO_STREAMF) + +// DSound class usage +LOGRENDER(X_DSCAPS) +{ + return os + LOGRENDER_MEMBER(dwFree2DBuffers) + LOGRENDER_MEMBER(dwFree3DBuffers) + LOGRENDER_MEMBER(dwFreeBufferSGEs) + LOGRENDER_MEMBER(dwMemoryAllocated) + ; +} + +LOGRENDER(X_DSI3DL2LISTENER) +{ + return os + LOGRENDER_MEMBER(lRoom) + LOGRENDER_MEMBER(lRoomHF) + LOGRENDER_MEMBER(flRoomRolloffFactor) + LOGRENDER_MEMBER(flDecayTime) + LOGRENDER_MEMBER(flDecayHFRatio) + LOGRENDER_MEMBER(lReflections) + LOGRENDER_MEMBER(flReflectionsDelay) + LOGRENDER_MEMBER(lReverb) + LOGRENDER_MEMBER(flReverbDelay) + LOGRENDER_MEMBER(flDiffusion) + LOGRENDER_MEMBER(flDensity) + LOGRENDER_MEMBER(flHFReference) + ; +} + +LOGRENDER(X_DSMIXBINS) +{ + return os + LOGRENDER_MEMBER(dwCount) + LOGRENDER_MEMBER_ARRAY_TYPE(X_DSMIXBINVOLUMEPAIR, lpMixBinVolumePairs, dwCount) + ; +} + +LOGRENDER(X_DSMIXBINVOLUMEPAIR) +{ + return os + LOGRENDER_MEMBER(dwMixBin) + LOGRENDER_MEMBER(lVolume) + ; +} + +LOGRENDER(X_DSOUTPUTLEVELS) +{ + return os + LOGRENDER_MEMBER(dwAnalogLeftTotalPeak) + LOGRENDER_MEMBER(dwAnalogRightTotalPeak) + LOGRENDER_MEMBER(dwAnalogLeftTotalRMS) + LOGRENDER_MEMBER(dwAnalogRightTotalRMS) + LOGRENDER_MEMBER(dwDigitalFrontLeftPeak) + LOGRENDER_MEMBER(dwDigitalFrontCenterPeak) + LOGRENDER_MEMBER(dwDigitalFrontRightPeak) + LOGRENDER_MEMBER(dwDigitalBackLeftPeak) + LOGRENDER_MEMBER(dwDigitalBackRightPeak) + LOGRENDER_MEMBER(dwDigitalLowFrequencyPeak) + LOGRENDER_MEMBER(dwDigitalFrontLeftRMS) + LOGRENDER_MEMBER(dwDigitalFrontCenterRMS) + LOGRENDER_MEMBER(dwDigitalFrontRightRMS) + LOGRENDER_MEMBER(dwDigitalBackLeftRMS) + LOGRENDER_MEMBER(dwDigitalBackRightRMS) + LOGRENDER_MEMBER(dwDigitalLowFrequencyRMS) + ; +} + +// DSound generic class usage +LOGRENDER(X_DS3DBUFFER) +{ + return os + LOGRENDER_MEMBER(dwSize) + LOGRENDER_MEMBER_TYPE(D3DVECTOR, vPosition) + LOGRENDER_MEMBER_TYPE(D3DVECTOR, vVelocity) + LOGRENDER_MEMBER(dwInsideConeAngle) + LOGRENDER_MEMBER(dwOutsideConeAngle) + LOGRENDER_MEMBER_TYPE(D3DVECTOR, vConeOrientation) + LOGRENDER_MEMBER(lConeOutsideVolume) + LOGRENDER_MEMBER(flMinDistance) + LOGRENDER_MEMBER(flMaxDistance) + LOGRENDER_MEMBER(dwMode) + LOGRENDER_MEMBER(flDistanceFactor) + LOGRENDER_MEMBER(flRolloffFactor) + LOGRENDER_MEMBER(flDopplerFactor) + ; +} + +LOGRENDER(X_DSENVOLOPEDESC) +{ + return os + LOGRENDER_MEMBER(dwEnvelopGenerator) + LOGRENDER_MEMBER(dwMode) + LOGRENDER_MEMBER(dwDelay) + LOGRENDER_MEMBER(dwAttack) + LOGRENDER_MEMBER(dwHold) + LOGRENDER_MEMBER(dwDecay) + LOGRENDER_MEMBER(dwRelease) + LOGRENDER_MEMBER(dwSustain) + LOGRENDER_MEMBER(lPitchScale) + LOGRENDER_MEMBER(lFilterCutOff) + ; +} + +LOGRENDER(X_DSFILTERDESC) +{ + return os + LOGRENDER_MEMBER_TYPE(DSFILTER_MODE, dwMode) + LOGRENDER_MEMBER(dwQCoefficient) + LOGRENDER_MEMBER(adwCoefficients) + ; +} + +LOGRENDER(X_DSI3DL2BUFFER) +{ + return os + LOGRENDER_MEMBER(lDirect) + LOGRENDER_MEMBER(lDirectHF) + LOGRENDER_MEMBER(lRoom) + LOGRENDER_MEMBER(lRoomHF) + LOGRENDER_MEMBER(flRoomRolloffFactor) + LOGRENDER_MEMBER_TYPE(X_DSI3DL2OBSTRUCTION, Obstruction) + LOGRENDER_MEMBER_TYPE(X_DSI3DL2OCCLUSION, Occlusion) + ; +} + +LOGRENDER(X_DSI3DL2OBSTRUCTION) +{ + return os + LOGRENDER_MEMBER(lHFLevel) + LOGRENDER_MEMBER(flLFRatio) + ; +} + +LOGRENDER(X_DSI3DL2OCCLUSION) +{ + return os + LOGRENDER_MEMBER(lHFLevel) + LOGRENDER_MEMBER(flLFRatio) + ; +} + +LOGRENDER(DSLFODESC) +{ + return os + LOGRENDER_MEMBER(dwLFO) + LOGRENDER_MEMBER(dwDelay) + LOGRENDER_MEMBER(dwDelta) + LOGRENDER_MEMBER(lPitchModulation) + LOGRENDER_MEMBER(lFilterCutOffRange) + LOGRENDER_MEMBER(lAmplitudeModulation) + ; +} + +LOGRENDER(XBOXADPCMWAVEFORMAT) +{ + return os + LOGRENDER_MEMBER_TYPE(WAVEFORMATEX, wfx) + LOGRENDER_MEMBER(wSamplesPerBlock) + ; +} + +// DSound Buffer class usage +LOGRENDER(X_DSBUFFERDESC) +{ + if (g_LibVersion_DSOUND < 4039) { + return os + LOGRENDER_MEMBER(dwSize) + LOGRENDER_MEMBER_TYPE(DSBCAPS_FLAG, dwFlags) + LOGRENDER_MEMBER(dwBufferBytes) + LOGRENDER_MEMBER_TYPE(LPWAVEFORMATEX, lpwfxFormat) + LOGRENDER_MEMBER_TYPE(DWORD, lpMixBinsOutput) + LOGRENDER_MEMBER(dwInputMixBin) + ; + } + else { + return os + LOGRENDER_MEMBER(dwSize) + LOGRENDER_MEMBER_TYPE(DSBCAPS_FLAG, dwFlags) + LOGRENDER_MEMBER(dwBufferBytes) + LOGRENDER_MEMBER_TYPE(LPWAVEFORMATEX, lpwfxFormat) + LOGRENDER_MEMBER(lpMixBinsOutput) + LOGRENDER_MEMBER(dwInputMixBin) + ; + } +} + +// DSound Stream class usage +LOGRENDER(X_DSSTREAMDESC) +{ + if (g_LibVersion_DSOUND < 4039) { + return os + LOGRENDER_MEMBER_TYPE(DSSCAPS_FLAG, dwFlags) + LOGRENDER_MEMBER(dwMaxAttachedPackets) + LOGRENDER_MEMBER_TYPE(LPWAVEFORMATEX, lpwfxFormat) + LOGRENDER_MEMBER_TYPE(void*, lpfnCallback) + LOGRENDER_MEMBER(lpvContext) + LOGRENDER_MEMBER_TYPE(DWORD, lpMixBinsOutput) + ; + } + else { + return os + LOGRENDER_MEMBER_TYPE(DSSCAPS_FLAG, dwFlags) + LOGRENDER_MEMBER(dwMaxAttachedPackets) + LOGRENDER_MEMBER_TYPE(LPWAVEFORMATEX, lpwfxFormat) + LOGRENDER_MEMBER_TYPE(void*, lpfnCallback) + LOGRENDER_MEMBER(lpvContext) + LOGRENDER_MEMBER(lpMixBinsOutput) + ; + } +} + +// DSound XMedia class usage +LOGRENDER(XMEDIAINFO) +{ + return os + LOGRENDER_MEMBER(dwFlags) + LOGRENDER_MEMBER(dwInputSize) + LOGRENDER_MEMBER(dwOutputSize) + LOGRENDER_MEMBER(dwMaxLookahead) + ; +} + +LOGRENDER(XMEDIAPACKET) +{ + return os + LOGRENDER_MEMBER(pvBuffer) + LOGRENDER_MEMBER(dwMaxSize) + LOGRENDER_MEMBER(pdwCompletedSize) + LOGRENDER_MEMBER_TYPE(XMO_STREAMF*, pdwStatus) + // NOTE: hCompletionEvent and pContext are a union. + //LOGRENDER_MEMBER(hCompletionEvent) + //LOGRENDER_MEMBER(pContext) + LOGRENDER_MEMBER(prtTimestamp) + ; +} + +} diff --git a/src/core/hle/DSOUND/XbDSoundLogging.hpp b/src/core/hle/DSOUND/XbDSoundLogging.hpp new file mode 100644 index 000000000..2c771d77d --- /dev/null +++ b/src/core/hle/DSOUND/XbDSoundLogging.hpp @@ -0,0 +1,94 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XBDSOUNDLOGGING_H +#define XBDSOUNDLOGGING_H + +#include "Logging.h" +#include "XbDSoundTypes.h" + +namespace XTL { + +// TODO: Everything, only small portions had been implemented. + +// DSound flag/enum +enum DSMIXBIN_SPEAKER : int; +enum DSSPEAKER_FLAG : int; +// DSound generic flag/enum +enum DSFILTER_MODE : int; +// DSound Buffer flag/enum +enum DSBCAPS_FLAG : int; +enum DSBPAUSE_FLAG : int; +enum DSBPLAY_FLAG : int; +enum DSBSTATUS_FLAG : int; +enum DSBSTOPEX_FLAG : int; +// DSound Stream flag/enum +enum DSSCAPS_FLAG : int; +enum DSSFLUSHEX_FLAG : int; +enum DSSPAUSE_FLAG : int; +enum DSSSTATUS_FLAG : int; +// DSound XMedia flag/enum +enum XMP_STATUS : int; +enum XMO_STREAMF : int; + +// DSound flag/enum +FLAGS2STR_HEADER(DSSPEAKER_FLAG) +// DSound generic flag/enum +ENUM2STR_HEADER(DSFILTER_MODE) +// DSound Buffer flag/enum +FLAGS2STR_HEADER(DSBCAPS_FLAG) +FLAGS2STR_HEADER(DSBPAUSE_FLAG) +FLAGS2STR_HEADER(DSBPLAY_FLAG) +FLAGS2STR_HEADER(DSBSTATUS_FLAG) +FLAGS2STR_HEADER(DSBSTOPEX_FLAG) +// DSound Stream flag/enum +FLAGS2STR_HEADER(DSSCAPS_FLAG) +FLAGS2STR_HEADER(DSSFLUSHEX_FLAG) +FLAGS2STR_HEADER(DSSPAUSE_FLAG) +FLAGS2STR_HEADER(DSSSTATUS_FLAG) + +// DSound class usage +LOGRENDER_HEADER(X_DSCAPS) +LOGRENDER_HEADER(X_DSI3DL2LISTENER) +LOGRENDER_HEADER(X_DSMIXBINS) +LOGRENDER_HEADER(X_DSMIXBINVOLUMEPAIR) +LOGRENDER_HEADER(X_DSOUTPUTLEVELS) +// DSound generic class usage +LOGRENDER_HEADER(X_DS3DBUFFER) +LOGRENDER_HEADER(X_DSENVOLOPEDESC) +LOGRENDER_HEADER(X_DSFILTERDESC) +LOGRENDER_HEADER(X_DSI3DL2BUFFER) +LOGRENDER_HEADER(X_DSI3DL2OBSTRUCTION) +LOGRENDER_HEADER(X_DSI3DL2OCCLUSION) +LOGRENDER_HEADER(DSLFODESC) +LOGRENDER_HEADER(XBOXADPCMWAVEFORMAT) +// DSound Buffer class usage +LOGRENDER_HEADER(X_DSBUFFERDESC) +// DSound Stream class usage +LOGRENDER_HEADER(X_DSSTREAMDESC) +// DSound XMedia class usage +LOGRENDER_HEADER(XMEDIAINFO) +LOGRENDER_HEADER(XMEDIAPACKET) +} +#endif diff --git a/src/core/hle/DSOUND/XbDSoundTypes.h b/src/core/hle/DSOUND/XbDSoundTypes.h new file mode 100644 index 000000000..62ea3a782 --- /dev/null +++ b/src/core/hle/DSOUND/XbDSoundTypes.h @@ -0,0 +1,375 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2017-2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef XBDSOUNDTYPES_H +#define XBDSOUNDTYPES_H + +namespace XTL { + +#include // TODO: FIXME after global namespace XTL issue is resolved. +// TODO: Port PC dsound.h to xbox edition here base on previous research. +// TODO: Also need to use fixed size to able support cross-platform without extra work. +// Such as uint32_t, uint16_t, etc. + +#define WAVE_FORMAT_XBOX_ADPCM 0x0069 + +// Xbox SGE Memory layout +#define XTL_DS_SGE_COUNT_MAX 2047 +#define XTL_DS_SGE_PAGE_MAX (4 * ONE_KB) +#define XTL_DS_SGE_SIZE_MAX (XTL_DS_SGE_COUNT_MAX * XTL_DS_SGE_PAGE_MAX) + +// XDSMIXBIN Flags +#define XDSMIXBIN_FRONT_LEFT 0 +#define XDSMIXBIN_FRONT_RIGHT 1 +#define XDSMIXBIN_FRONT_CENTER 2 +#define XDSMIXBIN_LOW_FREQUENCY 3 +#define XDSMIXBIN_BACK_LEFT 4 +#define XDSMIXBIN_BACK_RIGHT 5 +#define XDSMIXBIN_SPEAKERS_MAX 6 // Max count for speakers +// Other flags are used + +// ****************************************************************** +// * X_DSMIXBINVOLUMEPAIR +// ****************************************************************** +typedef struct _XDSMIXBINVOLUMEPAIR { + DWORD dwMixBin; + LONG lVolume; +} X_DSMIXBINVOLUMEPAIR, *X_LPDSMIXBINVOLUMEPAIR; + +// ****************************************************************** +// * X_DSMIXBINS +// ****************************************************************** +// Revision 2 (4039+) +typedef struct _XDSMIXBINS { + DWORD dwCount; + X_LPDSMIXBINVOLUMEPAIR lpMixBinVolumePairs; +} X_DSMIXBINS, *X_LPDSMIXBINS; + +// EmuIDirectSoundBuffer_Play flags +#define X_DSBPLAY_LOOPING 0x00000001 +#define X_DSBPLAY_FROMSTART 0x00000002 +#define X_DSBPLAY_SYNCHPLAYBACK 0x00000004 + +// EmuIDirectSoundBuffer_Pause flags +#define X_DSBPAUSE_RESUME 0x00000000 +#define X_DSBPAUSE_PAUSE 0x00000001 +#define X_DSBPAUSE_SYNCHPLAYBACK 0x00000002 + +// EmuIDirectSoundStream_Pause flags +#define X_DSSPAUSE_RESUME 0x00000000 +#define X_DSSPAUSE_PAUSE 0x00000001 +#define X_DSSPAUSE_SYNCHPLAYBACK 0x00000002 +#define X_DSSPAUSE_PAUSENOACTIVATE 0x00000003 + +// EmuIDirectSoundStream_FlushEx flags +#define X_DSSFLUSHEX_IMMEDIATE 0x00000000 +#define X_DSSFLUSHEX_ASYNC 0x00000001 +#define X_DSSFLUSHEX_ENVELOPE 0x00000002 +#define X_DSSFLUSHEX_ENVELOPE2 0x00000004 + +// EmuIDirectSoundStream_GetStatus flags +#define X_DSSSTATUS_READY 0x00000001 +#define X_DSSSTATUS_PLAYING 0x00010000 +#define X_DSSSTATUS_PAUSED 0x00020000 +#define X_DSSSTATUS_STARVED 0x00040000 +#define X_DSSSTATUS_ENVELOPECOMPLETE 0x00080000 + +// EmuIDirectSoundBuffer_GetStatus flags +#define X_DSBSTATUS_PLAYING 0x00000001 +#define X_DSBSTATUS_PAUSED 0x00000002 +#define X_DSBSTATUS_LOOPING 0x00000004 + +// EmuIDirectSoundBuffer_StopEx flags +#define X_DSBSTOPEX_IMMEDIATE 0x00000000 +#define X_DSBSTOPEX_ENVELOPE 0x00000001 +#define X_DSBSTOPEX_RELEASEWAVEFORM 0x00000002 +#define X_DSBSTOPEX_ALL (X_DSBSTOPEX_ENVELOPE | X_DSBSTOPEX_RELEASEWAVEFORM) + +// Generic frequency range +#define XTL_DSXFREQUENCY_ORIGINAL 0x00000000 +//#define XTL_DSGFREQUENCY_MIN 0x00000??? +//#define XTL_DSGFREQUENCY_MAX 0x000????? + +#define XTL_DSBCAPS_CTRL3D 0x00000010 +#define XTL_DSBCAPS_CTRLFREQUENCY 0x00000020 +#define XTL_DSBCAPS_CTRLVOLUME 0x00000080 +#define XTL_DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 +#define XTL_DSBCAPS_MIXIN 0x00002000 +#define XTL_DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 +#define XTL_DSBCAPS_LOCDEFER 0x00040000 +#define XTL_DSBCAPS_FXIN 0x00080000 +#define XTL_DSBCAPS_FXIN2 0x00100000 + +// ****************************************************************** +// * X_DSBUFFERDESC +// ****************************************************************** +struct X_DSBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + LPWAVEFORMATEX lpwfxFormat; + X_LPDSMIXBINS lpMixBinsOutput; + DWORD dwInputMixBin; +}; + +// ****************************************************************** +// * X_DSENVELOPEDESC +// ****************************************************************** +struct X_DSENVOLOPEDESC +{ + DWORD dwEnvelopGenerator; + DWORD dwMode; + DWORD dwDelay; + DWORD dwAttack; + DWORD dwHold; + DWORD dwDecay; + DWORD dwRelease; + DWORD dwSustain; + LONG lPitchScale; + LONG lFilterCutOff; +}; + +#define XTL_DSSCAPS_CTRL3D 0x00000010 +#define XTL_DSSCAPS_CTRLFREQUENCY 0x00000020 +#define XTL_DSSCAPS_CTRLVOLUME 0x00000080 +#define XTL_DSSCAPS_MUTE3DATMAXDISTANCE 0x00020000 +#define XTL_DSSCAPS_LOCDEFER 0x00040000 +#define XTL_DSSCAPS_NOMERGE 0x20000000 +#define XTL_DSSCAPS_ACCURATENOTIFY 0x40000000 + +typedef VOID(CALLBACK *LPFNXMOCALLBACK)(LPVOID pStreamContext, LPVOID pPacketContext, DWORD dwStatus); + +// ****************************************************************** +// * X_DSSTREAMDESC +// ****************************************************************** +struct X_DSSTREAMDESC +{ + DWORD dwFlags; + DWORD dwMaxAttachedPackets; + LPWAVEFORMATEX lpwfxFormat; + LPFNXMOCALLBACK lpfnCallback; + LPVOID lpvContext; + X_LPDSMIXBINS lpMixBinsOutput; +}; + +// ****************************************************************** +// * REFERENCE_TIME +// ****************************************************************** +typedef LONGLONG REFERENCE_TIME, *PREFERENCE_TIME, *LPREFERENCE_TIME; + +// ****************************************************************** +// * XMEDIAPACKET +// ****************************************************************** +typedef struct _XMEDIAPACKET +{ + LPVOID pvBuffer; + DWORD dwMaxSize; + PDWORD pdwCompletedSize; + PDWORD pdwStatus; + union { + HANDLE hCompletionEvent; + PVOID pContext; + }; + PREFERENCE_TIME prtTimestamp; // Not supported in xbox +} +XMEDIAPACKET, *PXMEDIAPACKET, *LPXMEDIAPACKET; + +#define XMP_STATUS_SUCCESS S_OK +#define XMP_STATUS_PENDING E_PENDING +#define XMP_STATUS_FLUSHED E_ABORT +#define XMP_STATUS_FAILURE E_FAIL +#define XMP_STATUS_RELEASE_CXBXR 0xFFFFFFFF + +// ****************************************************************** +// * XMEDIAINFO +// ****************************************************************** +typedef struct _XMEDIAINFO +{ + DWORD dwFlags; + DWORD dwInputSize; + DWORD dwOutputSize; + DWORD dwMaxLookahead; +} +XMEDIAINFO, *PXEIDIAINFO, *LPXMEDIAINFO; + +// XMEDIAINFO Flags +#define XMO_STREAMF_FIXED_SAMPLE_SIZE 0x00000001 // The object supports only a fixed sample size +#define XMO_STREAMF_FIXED_PACKET_ALIGNMENT 0x00000002 // The object supports only a fixed packet alignment +#define XMO_STREAMF_INPUT_ASYNC 0x00000004 // The object supports receiving input data asynchronously +#define XMO_STREAMF_OUTPUT_ASYNC 0x00000008 // The object supports providing output data asynchronously +#define XMO_STREAMF_IN_PLACE 0x00000010 // The object supports in-place modification of data +#define XMO_STREAMF_MASK 0x0000001F + +// ****************************************************************** +// * X_DSFILTERDESC +// ****************************************************************** +struct X_DSFILTERDESC +{ + DWORD dwMode; + DWORD dwQCoefficient; + DWORD adwCoefficients[4]; +}; + +// X_DSFILTERDESC modes +#define DSFILTER_MODE_BYPASS 0x00000000 // The filter is bypassed +#define DSFILTER_MODE_DLS2 0x00000001 // DLS2 mode +#define DSFILTER_MODE_PARAMEQ 0x00000002 // Parametric equalizer mode +#define DSFILTER_MODE_MULTI 0x00000003 // Multifunction mode + +// ****************************************************************** +// * DSLFODESC +// ****************************************************************** +typedef struct _DSLFODESC +{ + DWORD dwLFO; + DWORD dwDelay; + DWORD dwDelta; + LONG lPitchModulation; + LONG lFilterCutOffRange; + LONG lAmplitudeModulation; +} +DSLFODESC, *LPCDSLFODESC; + +// ****************************************************************** +// * XBOXADPCMWAVEFORMAT +// ****************************************************************** +typedef struct xbox_adpcmwaveformat_tag +{ + WAVEFORMATEX wfx; // WAVEFORMATEX data + WORD wSamplesPerBlock; // Number of samples per encoded block. It must be 64. +} +XBOXADPCMWAVEFORMAT, *PXBOXADPCMWAVEFORMAT, *LPXBOXADPCMWAVEFORMAT; + +typedef const XBOXADPCMWAVEFORMAT *LPCXBOXADPCMWAVEFORMAT; + +// ****************************************************************** +// * X_DSOUTPUTLEVELS +// ****************************************************************** +struct X_DSOUTPUTLEVELS +{ + DWORD dwAnalogLeftTotalPeak; // analog peak + DWORD dwAnalogRightTotalPeak; + DWORD dwAnalogLeftTotalRMS; // analog RMS + DWORD dwAnalogRightTotalRMS; + DWORD dwDigitalFrontLeftPeak; // digital peak levels + DWORD dwDigitalFrontCenterPeak; + DWORD dwDigitalFrontRightPeak; + DWORD dwDigitalBackLeftPeak; + DWORD dwDigitalBackRightPeak; + DWORD dwDigitalLowFrequencyPeak; + DWORD dwDigitalFrontLeftRMS; // digital RMS levels + DWORD dwDigitalFrontCenterRMS; + DWORD dwDigitalFrontRightRMS; + DWORD dwDigitalBackLeftRMS; + DWORD dwDigitalBackRightRMS; + DWORD dwDigitalLowFrequencyRMS; +}; + +// ****************************************************************** +// * X_DSCAPS +// ****************************************************************** +struct X_DSCAPS +{ + DWORD dwFree2DBuffers; + DWORD dwFree3DBuffers; + DWORD dwFreeBufferSGEs; + DWORD dwMemoryAllocated; +}; + +#define X_DSSPEAKER_STEREO 0x00000000 +#define X_DSSPEAKER_MONO 0x00000001 +#define X_DSSPEAKER_SURROUND 0x00000002 +#define X_DSSPEAKER_ENABLE_AC3 0x00010000 +#define X_DSSPEAKER_ENABLE_DTS 0x00020000 + +struct X_DS3DBUFFER { + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + DWORD dwInsideConeAngle; + DWORD dwOutsideConeAngle; + D3DVECTOR vConeOrientation; + LONG lConeOutsideVolume; + FLOAT flMinDistance; + FLOAT flMaxDistance; + DWORD dwMode; + FLOAT flDistanceFactor; + FLOAT flRolloffFactor; + FLOAT flDopplerFactor; +}; + +struct X_DSI3DL2LISTENER { + LONG lRoom; + LONG lRoomHF; + FLOAT flRoomRolloffFactor; + FLOAT flDecayTime; + FLOAT flDecayHFRatio; + LONG lReflections; + FLOAT flReflectionsDelay; + LONG lReverb; + FLOAT flReverbDelay; + FLOAT flDiffusion; + FLOAT flDensity; + FLOAT flHFReference; +}; + +struct X_DSI3DL2OBSTRUCTION { + LONG lHFLevel; + FLOAT flLFRatio; +}; + +struct X_DSI3DL2OCCLUSION { + LONG lHFLevel; + FLOAT flLFRatio; +}; + +struct X_DSI3DL2BUFFER { + LONG lDirect; + LONG lDirectHF; + LONG lRoom; + LONG lRoomHF; + FLOAT flRoomRolloffFactor; + X_DSI3DL2OBSTRUCTION Obstruction; + X_DSI3DL2OCCLUSION Occlusion; +}; + +typedef struct IDirectSoundStream IDirectSoundStream; +typedef IDirectSoundStream *LPDIRECTSOUNDSTREAM; + +struct X_DSVOICEPROPS { + DWORD dwMixBinCount; + X_DSMIXBINVOLUMEPAIR MixBinVolumePairs[8]; + LONG lPitch; + LONG l3DDistanceVolume; + LONG l3DConeVolume; + LONG l3DDopplerPitch; + LONG lI3DL2DirectVolume; + LONG lI3DL2RoomVolume; +}; + +} // end of namespace XTL + +#endif diff --git a/src/core/hle/DSOUND/common/windows/WFXformat.hpp b/src/core/hle/DSOUND/common/windows/WFXformat.hpp new file mode 100644 index 000000000..9118a996a --- /dev/null +++ b/src/core/hle/DSOUND/common/windows/WFXformat.hpp @@ -0,0 +1,336 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2017-2020 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#pragma once + +#include +#include +#include "core/kernel/init/CxbxKrnl.h" +#include "core/hle/DSOUND/XbDSoundTypes.h" + +#include "Logging.h" +#include "core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp" +#include "core/hle/DSOUND/XbDSoundLogging.hpp" + +// Only use as last resort instead of alternative duplicates (an error occur between keyboard and chair) +static void WFXformat_GeneratePCMFormat( + uint16_t nChannels, + uint32_t nSamplesPerSec, + uint16_t wBitPerSample, + PWAVEFORMATEXTENSIBLE Host_wfxFormat) +{ + Host_wfxFormat->Format.wFormatTag = WAVE_FORMAT_PCM; + Host_wfxFormat->Format.nChannels = nChannels; + Host_wfxFormat->Format.nSamplesPerSec = nSamplesPerSec; + Host_wfxFormat->Format.wBitsPerSample = wBitPerSample; + Host_wfxFormat->Format.nBlockAlign = wBitPerSample / 8 * nChannels; + Host_wfxFormat->Format.nAvgBytesPerSec = nSamplesPerSec * Host_wfxFormat->Format.nBlockAlign; +} + +static void WFXformat_GenerateXADPCMFormat( + uint16_t nChannels, + uint32_t nSamplesPerSec, + PWAVEFORMATEXTENSIBLE Host_pwfxFormat) +{ + Host_pwfxFormat->Format.nChannels = nChannels; + Host_pwfxFormat->Format.nSamplesPerSec = nSamplesPerSec; + Host_pwfxFormat->Format.wBitsPerSample = 4; // Always 4 (even if they're mono or stereo) + Host_pwfxFormat->Format.nBlockAlign = 36 * nChannels; + // nAvgBytesPerSec's equation is confirmed. + Host_pwfxFormat->Format.nAvgBytesPerSec = (nSamplesPerSec / 64/*Always 64 samples per block*/) * Host_pwfxFormat->Format.nBlockAlign; +} + +// Convert XADPCM to PCM format helper function +static void XADPCM2PCMFormat(PWAVEFORMATEXTENSIBLE Host_pwfxFormat) +{ + +#if 0 //For testing purpose if XADPCM to PCM is not accurate. + EmuLog(LOG_LEVEL::DEBUG, + "EmuDSound: XADPCM WAVEFORMATEX\n" + "{\n" + " wFormatTag : 0x%.04hX\n" + " nChannels : 0x%.02hd\n" + " nSamplesPerSec : 0x%.08X\n" + " nAvgBytesPerSec : 0x%.08X\n" + " nBlockAlign : 0x%.02hd\n" + " wBitsPerSample : 0x%.04hX\n" + " cbSize : 0x%.04hX\n" + "}\n", + Host_pwfxFormat->Format.wFormatTag, + Host_pwfxFormat->Format.nChannels, + Host_pwfxFormat->Format.nSamplesPerSec, + Host_pwfxFormat->Format.nAvgBytesPerSec, + Host_pwfxFormat->Format.nBlockAlign, + Host_pwfxFormat->Format.wBitsPerSample, + Host_pwfxFormat->Format.cbSize); +#endif + + //Xb_lpwfxFormat.wFormatTag; /* format type */ + //Xb_lpwfxFormat.nChannels; /* number of channels (i.e. mono, stereo...) */ NO CHANGE + //Xb_lpwfxFormat.nSamplesPerSec; /* sample rate */ NO CHANGE + //Xb_lpwfxFormat.nAvgBytesPerSec; /* for buffer estimation */ + //Xb_lpwfxFormat.nBlockAlign; /* block size of data */ + //Xb_lpwfxFormat.wBitsPerSample; /* number of bits per sample of mono data */ + //Xb_lpwfxFormat.cbSize; /* the count in bytes of the size of extra information (after cbSize) */ + WFXformat_GeneratePCMFormat(Host_pwfxFormat->Format.nChannels, + Host_pwfxFormat->Format.nSamplesPerSec, + 16, + Host_pwfxFormat); + //Enable this only if you have Xbox ADPCM Codec installed on your PC, or else it will fail every time. + //This is just to verify format conversion is correct or not. +#if 0 + if (waveOutOpen(nullptr, WAVE_MAPPER, Xb_lpwfxFormat, NULL, NULL, WAVE_FORMAT_QUERY) != MMSYSERR_NOERROR) { + return DSERR_BADFORMAT; + } +#endif + +#if 0 //For testing purpose if XADPCM to PCM is not accurate. + EmuLog(LOG_LEVEL::DEBUG, + "EmuDSound: Converted to PCM WAVEFORMATEX\n" + "{\n" + " wFormatTag : 0x%.04hX\n" + " nChannels : 0x%.02hd\n" + " nSamplesPerSec : 0x%.08X\n" + " nAvgBytesPerSec : 0x%.08X\n" + " nBlockAlign : 0x%.02hd\n" + " wBitsPerSample : 0x%.04hX\n" + " cbSize : 0x%.04hX\n" + "}\n", + Host_pwfxFormat->Format.wFormatTag, + Host_pwfxFormat->Format.nChannels, + Host_pwfxFormat->Format.nSamplesPerSec, + Host_pwfxFormat->Format.nAvgBytesPerSec, + Host_pwfxFormat->Format.nBlockAlign, + Host_pwfxFormat->Format.wBitsPerSample, + Host_pwfxFormat->Format.cbSize); +#endif +} + +static void WFXformat_SyncPCMFormat( + PWAVEFORMATEXTENSIBLE Host_pwfxFormat) +{ + PWAVEFORMATEX ex_pwfxFormat = &Host_pwfxFormat->Format; + // NOTE: This process check for 2+ channels whenever XADPCM or PCM format from xbox titles input in nChannels. + // Since the host do not support 2+ channels on PCM only format. We must convert/update allocated wfxFormat to EXTENSIBLE + // format which had been allocated enough to update. + if (ex_pwfxFormat->nChannels > 2) { + Host_pwfxFormat->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + Host_pwfxFormat->dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; + Host_pwfxFormat->Samples.wValidBitsPerSample = ex_pwfxFormat->wBitsPerSample; + Host_pwfxFormat->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + Host_pwfxFormat->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + + if (ex_pwfxFormat->nChannels >= 4) { + Host_pwfxFormat->dwChannelMask |= SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; + } + if (ex_pwfxFormat->nChannels == 6) { + Host_pwfxFormat->dwChannelMask |= SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY; + } + } + else { + Host_pwfxFormat->Format.wFormatTag = WAVE_FORMAT_PCM; + // Test case: Hulk crash due to cbSize is not a valid size. + // If Xbox applications didn't enfore cbSize, we'll have to enforce from host side. + // Also, we're enforcing it anyway. + Host_pwfxFormat->Format.cbSize = 0; + } +} + +static void WFXformat_SyncXADPCMFormat( + PWAVEFORMATEXTENSIBLE Host_wfxFormat) +{ + XADPCM2PCMFormat(Host_wfxFormat); + WFXformat_SyncPCMFormat(Host_wfxFormat); +} + +typedef enum _CODEC_FORMAT { + CF_PCM=0, + CF_XADPCM, + CF_UNKNOWN +} CODEC_FORMAT; + +static void WFXformat_SanityFix( + PWAVEFORMATEXTENSIBLE Host_pwfxFormat, + CODEC_FORMAT codec_format, + uint32_t Xb_buffer_request_size, + uint32_t Xb_flags) +{ + WAVEFORMATEXTENSIBLE before_wfxFormat = *Host_pwfxFormat; + bool isNotSanity = false; + uint32_t nSamplesPerSec = Host_pwfxFormat->Format.nSamplesPerSec; + + // Generic enforcement + // If Xbox applications supply invalid total channels, enforce to use either mono or stereo channel + if (Host_pwfxFormat->Format.nChannels == 0 || Host_pwfxFormat->Format.nChannels > 6) { + Host_pwfxFormat->Format.nChannels = 2; + isNotSanity = true; + } + // If nSamplesPerSec is zero'd then use 44.1kHz by default + if (nSamplesPerSec == 0) { + Host_pwfxFormat->Format.nSamplesPerSec = 44100; + isNotSanity = true; + } + + if (Host_pwfxFormat->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) { + if (Host_pwfxFormat->Format.cbSize != sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)) { + Host_pwfxFormat->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + //isNotSanity = true; + } + } + else { + // Test case: Hulk crash due to cbSize is not a valid size. + // If Xbox applications didn't enfore cbSize, we'll have to enforce from host side. + /* NOTE: cbSize is already handled in WFXformat_SyncPCMFormat function as enforcement. + if (Host_pwfxFormat->Format.cbSize != 0) { + Host_pwfxFormat->Format.cbSize = 0; + //isNotSanity = true; + } + */ + } + + // Generic handler + if (codec_format == CF_PCM || codec_format == CF_UNKNOWN) { + // If wBitsPerSample is zero'd then use 16 by default + if (Host_pwfxFormat->Format.wBitsPerSample == 0) { + isNotSanity = true; + } + + // testcase: Phantasy Star Online Episode I & II made an attempt to use avg byte/second below sample/second requirement. + // Defender is another title made an attempt to use avg byte/second way above the sample/second requirement. + // In other word, this is a workaround to fix titles' mistake... + uint32_t checkAvgBps = Host_pwfxFormat->Format.nSamplesPerSec * Host_pwfxFormat->Format.nBlockAlign; + + if (isNotSanity) { + WFXformat_GeneratePCMFormat(Host_pwfxFormat->Format.nChannels, Host_pwfxFormat->Format.nSamplesPerSec, 16, Host_pwfxFormat); + } + else if (Host_pwfxFormat->Format.nAvgBytesPerSec != checkAvgBps) { + Host_pwfxFormat->Format.nAvgBytesPerSec = checkAvgBps; + isNotSanity = true; + } + } + // CF_XADPCM + else if (codec_format == CF_XADPCM) { + // If wBitsPerSample is not equal to 4, then wfx format is not sane. + if (Host_pwfxFormat->Format.wBitsPerSample != 4) { + //Host_pwfxFormat->Format.wBitsPerSample = 4; + isNotSanity = true; + } + + if (isNotSanity) { + WFXformat_GenerateXADPCMFormat(Host_pwfxFormat->Format.nChannels, Host_pwfxFormat->Format.nSamplesPerSec, Host_pwfxFormat); + } + } + + if (isNotSanity) { + std::stringstream before, after; + before << before_wfxFormat; + after << Host_pwfxFormat; + EmuLog(LOG_LEVEL::WARNING, "One or more values were not set properly before: %s\nvs after: %s", before.str().c_str(), after.str().c_str()); + } +} + +static CODEC_FORMAT WFXformat_SyncHostFormat( + void* Host_wfx_ptr, + const void* Xb_wfx_ptr, + uint32_t Xb_buffer_request_size, + uint32_t Xb_flags) +{ + PWAVEFORMATEXTENSIBLE Xb_wfxFormat = (PWAVEFORMATEXTENSIBLE)Xb_wfx_ptr; + PWAVEFORMATEXTENSIBLE Host_wfxFormat = (PWAVEFORMATEXTENSIBLE)Host_wfx_ptr; + CODEC_FORMAT codec_format_ret = CF_PCM; + bool require_validate = true; + + // If no format is provided, then use default. + if (Xb_wfx_ptr == xbnullptr) { + WFXformat_GeneratePCMFormat(2, 44100, 16, Host_wfxFormat); + require_validate = false; + } + // HACK: This is a special sound buffer, create dummy WAVEFORMATEX data. + // It's supposed to recieve data rather than generate it. Buffers created + // with flags DSBCAPS_MIXIN, DSBCAPS_FXIN, and DSBCAPS_FXIN2 will have no + // WAVEFORMATEX structure by default. + else if ((Xb_flags & (XTL_DSBCAPS_MIXIN | XTL_DSBCAPS_FXIN | XTL_DSBCAPS_FXIN2)) > 0) { + EmuLog(LOG_LEVEL::WARNING, "Creating dummy WAVEFORMATEX (pdsbd->Xb_lpwfxFormat = xbnullptr)..."); + WFXformat_GeneratePCMFormat(2, 44100, 16, Host_wfxFormat); + require_validate = false; + } + // Otherwise, let's process given format. + else { + switch (Xb_wfxFormat->Format.wFormatTag) { + case WAVE_FORMAT_PCM: + // No further steps require here. + break; + case WAVE_FORMAT_XBOX_ADPCM: + codec_format_ret = CF_XADPCM; + break; + case WAVE_FORMAT_EXTENSIBLE: + if (Xb_wfxFormat->SubFormat.Data1 = WAVE_FORMAT_PCM) { + // No further steps require here. + } + else if (Xb_wfxFormat->SubFormat.Data1 == WAVE_FORMAT_XBOX_ADPCM) { + codec_format_ret = CF_XADPCM; + } + else { + codec_format_ret = CF_UNKNOWN; + require_validate = false; + std::stringstream oss; + oss << Xb_wfxFormat->SubFormat; + std::string msg = "Please report unknown extensible format : " + oss.str(); + LOG_TEST_CASE(msg.c_str()); + } + break; + // Both 0 and default will use static structure until given a valid one. + case 0: + // NOTE: This is currently a hack for ability to create buffer class with DSBCAPS_LOCDEFER flag. + WFXformat_GeneratePCMFormat(2, 44100, 16, Host_wfxFormat); + require_validate = false; + LOG_TEST_CASE("WAVE_FORMAT_(0) found"); + break; + default: + codec_format_ret = CF_UNKNOWN; + require_validate = false; + EmuLog(LOG_LEVEL::WARNING, "Unknown Xbox format: %08X", Xb_wfxFormat->Format.wFormatTag); + LOG_TEST_CASE("Unknown Xbox format, check your log output"); + break; + } + + if (require_validate) { + // First, perform sanity fix + WFXformat_SanityFix(Host_wfxFormat, codec_format_ret, Xb_buffer_request_size, Xb_flags); + } + + // Then re-convert to Host's PCM format. + if (codec_format_ret == CF_PCM) { + WFXformat_SyncPCMFormat(Host_wfxFormat); + } + else if (codec_format_ret == CF_XADPCM) { + WFXformat_SyncXADPCMFormat(Host_wfxFormat); + } + // Any unknown formats will be using default PCM format. + else { + WFXformat_GeneratePCMFormat(2, 44100, 16, Host_wfxFormat); + } + } + return codec_format_ret; +} diff --git a/src/core/hle/Intercept.cpp b/src/core/hle/Intercept.cpp new file mode 100644 index 000000000..595f13045 --- /dev/null +++ b/src/core/hle/Intercept.cpp @@ -0,0 +1,758 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2016-2018 Luke Usher +// * (c) 2016-2018 Patrick van Logchem +// * (c) 2017-2018 RadWolfie +// * (c) 2017-2018 jarupxx +// * (c) 2018 x1nixmzeng +// * +// * All rights reserved +// * +// ****************************************************************** + +#define LOG_PREFIX CXBXR_MODULE::HLE + +#include +#include // For std::setfill and std::setw + +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "EmuShared.h" +#include "common\CxbxDebugger.h" +#include "Logging.h" +#pragma comment(lib, "XbSymbolDatabase.lib") +#include "..\..\import\XbSymbolDatabase\XbSymbolDatabase.h" +#include "Intercept.hpp" +#include "Patches.hpp" +#include "common\util\hasher.h" + +#include +#include +#include +#include +#include +#include + +static const char* section_info = "Info"; +static struct { + const char* SymbolDatabaseVersionHash = "SymbolDatabaseVersionHash"; +} sect_info_keys; + +static const char* section_certificate = "Certificate"; +static struct { + const char* Name = "Name"; + const char* TitleID = "TitleID"; + const char* TitleIDHex = "TitleIDHex"; + const char* Region = "Region"; +} sect_certificate_keys; + +static const char* section_libs = "Libs"; +static struct { + const char* BuildVersion = "BuildVersion"; +} sect_libs_keys; + +static const char* section_symbols = "Symbols"; + +std::map g_SymbolAddresses; +bool g_SymbolCacheUsed = false; + +bool bLLE_APU = false; // Set this to true for experimental APU (sound) LLE +bool bLLE_GPU = false; // Set this to true for experimental GPU (graphics) LLE +bool bLLE_USB = false; // Set this to true for experimental USB (input) LLE +bool bLLE_JIT = false; // Set this to true for experimental JIT + +void* GetXboxFunctionPointer(std::string functionName) +{ + void* ptr = GetPatchedFunctionTrampoline(functionName); + if (ptr != nullptr) { + return ptr; + } + + // If we got here, the function wasn't patched, so we can just look it up the symbol cache + // and return the correct offset + auto symbol = g_SymbolAddresses.find(functionName); + if (symbol != g_SymbolAddresses.end()) { + return (void*)symbol->second; + } + + // Finally, if none of the above were matched, return nullptr + return nullptr; +} + +// NOTE: GetDetectedSymbolName do not get to be in XbSymbolDatabase, get symbol string in Cxbx project only. +std::string GetDetectedSymbolName(const xbaddr address, int * const symbolOffset) +{ + std::string result = ""; + int closestMatch = MAXINT; + + for (auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { + xbaddr symbolAddr = it->second; + if (symbolAddr == xbnull) + continue; + + if (symbolAddr <= address) + { + int distance = address - symbolAddr; + if (closestMatch > distance) + { + closestMatch = distance; + result = it->first; + } + } + } + + if (closestMatch < MAXINT) + { + *symbolOffset = closestMatch; + return result; + } + + *symbolOffset = 0; + return "unknown"; +} + +// NOTE: VerifySymbolAddressAgainstXRef do not get to be in XbSymbolDatabase, perform verification in Cxbx project only. +/* +bool VerifySymbolAddressAgainstXRef(char *SymbolName, xbaddr Address, int XRef) +{ + // Temporary verification - is XREF_D3DTSS_TEXCOORDINDEX derived correctly? + // TODO : Remove this when XREF_D3DTSS_TEXCOORDINDEX derivation is deemed stable + xbaddr XRefAddr = XRefDataBase[XRef]; + if (XRefAddr == Address) + return true; + + if (XRefAddr == XREF_ADDR_DERIVE) { + printf("HLE: XRef #%d derived 0x%.08X -> %s\n", XRef, Address, SymbolName); + XRefDataBase[XRef] = Address; + return true; + } + + CxbxPopupMessage(LOG_LEVEL::WARNING, CxbxMsgDlgIcon_Warn, + "Verification of %s failed : XREF was 0x%.8X while lookup gave 0x%.8X", SymbolName, XRefAddr, Address); + // test case : Kabuki Warriors (for XREF_D3DTSS_TEXCOORDINDEX) + return false; +}*/ + +// x1nixmzeng: Hack to notify CxbxDebugger of the SymbolCache file, which is currently a hashed XBE header AND stripped title (see EmuHLEIntercept) +class CxbxDebuggerScopedMessage +{ + std::string& message; + + CxbxDebuggerScopedMessage() = delete; + CxbxDebuggerScopedMessage(const CxbxDebuggerScopedMessage&) = delete; +public: + + CxbxDebuggerScopedMessage(std::string& message_string) + : message(message_string) + { } + + ~CxbxDebuggerScopedMessage() + { + if (CxbxDebugger::CanReport()) + { + CxbxDebugger::ReportHLECacheFile(message.c_str()); + } + } +}; + +void CDECL EmuOutputMessage(xb_output_message mFlag, + const char* message) +{ + switch (mFlag) { + case XB_OUTPUT_MESSAGE_INFO: { + printf("%s\n", message); + break; + } + case XB_OUTPUT_MESSAGE_WARN: { + EmuLog(LOG_LEVEL::WARNING, "%s", message); + break; + } + case XB_OUTPUT_MESSAGE_ERROR: { + CxbxKrnlCleanup("%s", message); + break; + } + case XB_OUTPUT_MESSAGE_DEBUG: + default: { +#ifdef _DEBUG_TRACE + printf("%s\n", message); +#endif + + break; + } + } +} + +void CDECL EmuRegisterSymbol(const char* library_str, + uint32_t library_flag, + const char* symbol_str, + uint32_t func_addr, + uint32_t revision) +{ + // Ignore registered symbol in current database. + uint32_t hasSymbol = g_SymbolAddresses[symbol_str]; + if (hasSymbol != 0) + return; + + // Output some details + std::stringstream output; + output << "Symbol: 0x" << std::setfill('0') << std::setw(8) << std::hex << func_addr + << " -> " << symbol_str << " " << std::dec << revision; + +#if 0 // TODO: XbSymbolDatabase - Need to create a structure for patch and stuff. + bool IsXRef = OovpaTable->Oovpa->XRefSaveIndex != XRefNoSaveIndex; + if (IsXRef) { + output << "\t(XREF)"; + + // do we need to save the found address? + OOVPA* Oovpa = OovpaTable->Oovpa; + if (Oovpa->XRefSaveIndex != XRefNoSaveIndex) { + // is the XRef not saved yet? + switch (XRefDataBase[Oovpa->XRefSaveIndex]) { + case XREF_ADDR_NOT_FOUND: + { + EmuLog(LOG_LEVEL::WARNING, "Found OOVPA after first finding nothing?"); + // fallthrough to XREF_ADDR_UNDETERMINED + } + case XREF_ADDR_UNDETERMINED: + { + // save and count the found address + UnResolvedXRefs--; + XRefDataBase[Oovpa->XRefSaveIndex] = pFunc; + break; + } + case XREF_ADDR_DERIVE: + { + EmuLog(LOG_LEVEL::WARNING, "Cannot derive a save index!"); + break; + } + default: + { + if (XRefDataBase[OovpaTable->Oovpa->XRefSaveIndex] != pFunc) { + EmuLog(LOG_LEVEL::WARNING, "Found OOVPA on other address than in XRefDataBase!"); + EmuLog(LOG_LEVEL::WARNING, "%s: %4d - pFunc: %08X, stored: %08X", OovpaTable->szFuncName, Oovpa->XRefSaveIndex, pFunc, XRefDataBase[Oovpa->XRefSaveIndex]); + } + break; + } + } + } + } + + // Retrieve the associated patch, if any is available + void* addr = GetEmuPatchAddr(std::string(OovpaTable->szFuncName)); + + if (addr != nullptr) { + EmuInstallPatch(OovpaTable->szFuncName, pFunc, addr); + output << "\t*PATCHED*"; + } else { + const char* checkDisableStr = nullptr; + size_t getFuncStrLength = strlen(OovpaTable->szFuncName); + + if (getFuncStrLength > 10) { + checkDisableStr = &OovpaTable->szFuncName[getFuncStrLength - 10]; + } + + if (checkDisableStr != nullptr && strcmp(checkDisableStr, "_UNPATCHED") == 0) { + output << "\t*UNPATCHED*"; + + // Mention there's no patch available, if it was to be applied + } else if (!IsXRef) { + output << "\t*NO PATCH AVAILABLE!*"; + } + } +#endif + + output << "\n"; + + g_SymbolAddresses[symbol_str] = func_addr; + printf(output.str().c_str()); +} + +// Update shared structure with GUI process +void EmuUpdateLLEStatus(uint32_t XbLibScan) +{ + unsigned int FlagsLLE; + g_EmuShared->GetFlagsLLE(&FlagsLLE); + + if ((FlagsLLE & LLE_GPU) == false + && !((XbLibScan & XbSymbolLib_D3D8) > 0 + || (XbLibScan & XbSymbolLib_D3D8LTCG) > 0)) { + bLLE_GPU = true; + FlagsLLE ^= LLE_GPU; + EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE GPU."); + } + + if ((FlagsLLE & LLE_APU) == false + && (XbLibScan & XbSymbolLib_DSOUND) == 0) { + bLLE_APU = true; + FlagsLLE ^= LLE_APU; + EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE APU."); + } +#if 0 // Reenable this when LLE USB actually works + if ((FlagsLLE & LLE_USB) == false + && (XbLibScan & XbSymbolLib_XAPILIB) == 0) { + bLLE_USB = true; + FlagsLLE ^= LLE_USB; + EmuOutputMessage(XB_OUTPUT_MESSAGE_INFO, "Fallback to LLE USB."); + } +#endif + ipc_send_gui_update(IPC_UPDATE_GUI::LLE_FLAGS, FlagsLLE); + //return FlagsLLE; +} + +// NOTE: EmuHLEIntercept do not get to be in XbSymbolDatabase, do the intecept in Cxbx project only. +void EmuHLEIntercept(Xbe::Header *pXbeHeader) +{ + Xbe::LibraryVersion *pLibraryVersion = (Xbe::LibraryVersion*)pXbeHeader->dwLibraryVersionsAddr; + + uint16_t xdkVersion = 0; + uint32_t XbLibScan = 0; + + // NOTE: We need to check if title has library header to optimize verification process. + if (pLibraryVersion != nullptr) { + uint32_t dwLibraryVersions = pXbeHeader->dwLibraryVersions; + const char* SectionName = nullptr; + Xbe::SectionHeader* pSectionHeaders = (Xbe::SectionHeader*)pXbeHeader->dwSectionHeadersAddr; + uint32_t XbLibFlag; + + // Get the highest revision build and prefix library to scan. + for (uint32_t v = 0; v < dwLibraryVersions; v++) { + uint16_t BuildVersion, QFEVersion; + BuildVersion = pLibraryVersion[v].wBuildVersion; + QFEVersion = pLibraryVersion[v].wFlags.QFEVersion; + + if (xdkVersion < BuildVersion) { + xdkVersion = BuildVersion; + } + XbLibFlag = XbSymbolDatabase_LibraryToFlag(std::string(pLibraryVersion[v].szName, pLibraryVersion[v].szName + 8).c_str()); + XbLibScan |= XbLibFlag; + + // Keep certain library versions for plugin usage. + if ((XbLibFlag & (XbSymbolLib_D3D8 | XbSymbolLib_D3D8LTCG)) > 0) { + if (g_LibVersion_D3D8 < BuildVersion) { + g_LibVersion_D3D8 = BuildVersion; + } + } + else if ((XbLibFlag & XbSymbolLib_DSOUND) > 0) { + g_LibVersion_DSOUND = BuildVersion; + } + } + + // Since XDK 4039 title does not have library version for DSOUND, let's check section header if it exists or not. + for (unsigned int v = 0; v < pXbeHeader->dwSections; v++) { + SectionName = (const char*)pSectionHeaders[v].dwSectionNameAddr; + if (strncmp(SectionName, Lib_DSOUND, 8) == 0) { + XbLibScan |= XbSymbolLib_DSOUND; + + // If DSOUND version is not set, we need to force set it. + if (g_LibVersion_DSOUND == 0) { + g_LibVersion_DSOUND = xdkVersion; + } + break; + } + } + } + + EmuUpdateLLEStatus(XbLibScan); + + std::cout << "\n" + "*******************************************************************************\n" + "* Cxbx-Reloaded High Level Emulation database\n" + "*******************************************************************************\n" + << std::endl; + + // Make sure the Symbol Cache directory exists + std::string cachePath = std::string(szFolder_CxbxReloadedData) + "\\SymbolCache\\"; + if (!std::filesystem::exists(cachePath) && !std::filesystem::create_directory(cachePath)) { + CxbxKrnlCleanup("Couldn't create Cxbx-Reloaded SymbolCache folder!"); + } + + // Hash the loaded XBE's header, use it as a filename + uint64_t uiHash = ComputeHash((void*)&CxbxKrnl_Xbe->m_Header, sizeof(Xbe::Header)); + std::stringstream sstream; + char tAsciiTitle[40] = "Unknown"; + std::setlocale(LC_ALL, "English"); + std::wcstombs(tAsciiTitle, g_pCertificate->wszTitleName, sizeof(tAsciiTitle)); + std::string szTitleName(tAsciiTitle); + CxbxKrnl_Xbe->PurgeBadChar(szTitleName); + sstream << cachePath << szTitleName << "-" << std::hex << uiHash << ".ini"; + std::string filename = sstream.str(); + + // This will fire when we exit this function scope; either after detecting a previous cache file, or when one is created + CxbxDebuggerScopedMessage symbolCacheFilename(filename); + + CSimpleIniA symbolCacheData; + + if (std::filesystem::exists(filename.c_str())) { + std::printf("Found Symbol Cache File: %08llX.ini\n", uiHash); + + symbolCacheData.LoadFile(filename.c_str()); + + xdkVersion = (uint16_t)symbolCacheData.GetLongValue(section_libs, sect_libs_keys.BuildVersion, /*Default=*/0); + + // Verify the version of the cache file against the Symbol Database version hash + const uint32_t SymbolDatabaseVersionHash = symbolCacheData.GetLongValue(section_info, sect_info_keys.SymbolDatabaseVersionHash, /*Default=*/0); + + if (SymbolDatabaseVersionHash == XbSymbolDatabase_LibraryVersion()) { + g_SymbolCacheUsed = true; + CSimpleIniA::TNamesDepend symbol_names; + + if (g_SymbolCacheUsed) { + std::printf("Using Symbol Cache\n"); + + // Parse the .INI file into the map of symbol addresses + symbolCacheData.GetAllKeys(section_symbols, symbol_names); + for (auto it = symbol_names.begin(); it != symbol_names.end(); ++it) { + g_SymbolAddresses[it->pItem] = symbolCacheData.GetLongValue(section_symbols, it->pItem, /*Default=*/0); + } + + // Iterate through the map of symbol addresses, calling GetEmuPatchAddr on all functions. + for (auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { + std::string functionName = it->first; + xbaddr location = it->second; + + std::stringstream output; + output << "SymbolCache: 0x" << std::setfill('0') << std::setw(8) << std::hex << location + << " -> " << functionName << "\n"; + std::printf(output.str().c_str()); + } + + // Fix up Render state and Texture States + if (g_SymbolAddresses.find("D3DDeferredRenderState") == g_SymbolAddresses.end() + || g_SymbolAddresses["D3DDeferredRenderState"] == 0) { + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDeferredRenderState was not found!"); + } + + if (g_SymbolAddresses.find("D3DDeferredTextureState") == g_SymbolAddresses.end() + || g_SymbolAddresses["D3DDeferredTextureState"] == 0) { + EmuLog(LOG_LEVEL::WARNING, "EmuD3DDeferredTextureState was not found!"); + } + + if (g_SymbolAddresses.find("D3DDEVICE") == g_SymbolAddresses.end() + || g_SymbolAddresses["D3DDEVICE"] == 0) { + EmuLog(LOG_LEVEL::WARNING, "D3DDEVICE was not found!"); + } + } + } + + // If g_SymbolAddresses didn't get filled, then symbol cache is invalid + if (g_SymbolAddresses.empty()) { + std::printf("Symbol Cache file is outdated and will be regenerated\n"); + g_SymbolCacheUsed = false; + } + } + + // If the Symbol Cache was used, go straight to patching, no need to re-scan + if (g_SymbolCacheUsed) { + EmuInstallPatches(); + return; + } + + // + // initialize Microsoft XDK emulation + // + if(pLibraryVersion != nullptr) { + + std::printf("Symbol: Detected Microsoft XDK application...\n"); + +#if 0 // NOTE: This code is currently disabled due to not optimized and require more work to do. + + XbSymbolRegisterLibrary(XbLibScan); + + while (true) { + + size_t SymbolSize = g_SymbolAddresses.size(); + + Xbe::SectionHeader* pSectionHeaders = reinterpret_cast(pXbeHeader->dwSectionHeadersAddr); + Xbe::SectionHeader* pSectionScan = nullptr; + + for (uint32_t v = 0; v < pXbeHeader->dwSections; v++) { + + pSectionScan = pSectionHeaders + v; + + XbSymbolScanSection((uint32_t)pXbeHeader, 64 * ONE_MB, (const char*)pSectionScan->dwSectionNameAddr, pSectionScan->dwVirtualAddr, pSectionScan->dwSizeofRaw, xdkVersion, EmuRegisterSymbol); + } + + // If symbols are not adding to array, break the loop. + if (SymbolSize == g_SymbolAddresses.size()) { + break; + } + } +#endif + + XbSymbolDatabase_SetOutputMessage(EmuOutputMessage); + + XbSymbolScan(pXbeHeader, EmuRegisterSymbol, false); + } + + std::printf("\n"); + + // Perform a reset just in case a cached file data still exist. + symbolCacheData.Reset(); + + // Store Symbol Database version + symbolCacheData.SetLongValue(section_info, sect_info_keys.SymbolDatabaseVersionHash, XbSymbolDatabase_LibraryVersion(), nullptr, /*UseHex =*/false); + + // Store Certificate Details + symbolCacheData.SetValue(section_certificate, sect_certificate_keys.Name, tAsciiTitle); + symbolCacheData.SetValue(section_certificate, sect_certificate_keys.TitleID, FormatTitleId(g_pCertificate->dwTitleId).c_str()); + symbolCacheData.SetLongValue(section_certificate, sect_certificate_keys.TitleIDHex, g_pCertificate->dwTitleId, nullptr, /*UseHex =*/true); + symbolCacheData.SetLongValue(section_certificate, sect_certificate_keys.Region, g_pCertificate->dwGameRegion, nullptr, /*UseHex =*/true); + + // Store Library Details + for (unsigned int i = 0; i < pXbeHeader->dwLibraryVersions; i++) { + std::string LibraryName(pLibraryVersion[i].szName, pLibraryVersion[i].szName + 8); + symbolCacheData.SetLongValue(section_libs, LibraryName.c_str(), pLibraryVersion[i].wBuildVersion, nullptr, /*UseHex =*/false); + } + + symbolCacheData.SetLongValue(section_libs, sect_libs_keys.BuildVersion, xdkVersion, nullptr, /*UseHex =*/false); + + // Store detected symbol addresses + for(auto it = g_SymbolAddresses.begin(); it != g_SymbolAddresses.end(); ++it) { + symbolCacheData.SetLongValue(section_symbols, it->first.c_str(), it->second, nullptr, /*UseHex =*/true); + } + + // Save data to unique symbol cache file + symbolCacheData.SaveFile(filename.c_str()); + + EmuInstallPatches(); +} + + +#if 0 // TODO: Need to move this into XbSymbolDatabase for depth verification usage. +#ifdef _DEBUG_TRACE + +struct HLEVerifyContext { + const HLEData *main_data; + OOVPA *oovpa, *against; + const HLEData *against_data; + uint32_t main_index, against_index; +}; + +std::string HLEErrorString(const HLEData *data, uint16_t buildVersion, uint32_t index) +{ + std::string result = + "OOVPATable " + (std::string)(data->LibSec.library) + "_" + std::to_string(buildVersion) + + "[" + std::to_string(index) + "] " + + (std::string)(data->OovpaTable[index].szFuncName); + + return result; +} + +void HLEError(HLEVerifyContext *context, uint16_t buildVersion, char *format, ...) +{ + std::string output = "HLE Error "; + if (context->main_data != nullptr) { + output += "in " + HLEErrorString(context->main_data, buildVersion, context->main_index); + } + + if (context->against != nullptr && context->against_data != nullptr) { + output += ", comparing against " + HLEErrorString(context->against_data, buildVersion, context->against_index); + } + + // format specific error message + char buffer[200]; + va_list args; + va_start(args, format); + vsprintf(buffer, format, args); + va_end(args); + + output += " : " + (std::string)buffer + (std::string)"\n"; + printf(output.c_str()); +} + +void VerifyHLEDataBaseAgainst(HLEVerifyContext *context); // forward + +void VerifyHLEOOVPA(HLEVerifyContext *context, uint16_t buildVersion, OOVPA *oovpa) +{ + if (context->against == nullptr) { + // TODO : verify XRefSaveIndex and XRef's (how?) + + // verify offsets are in increasing order + uint32_t prev_offset; + uint8_t dummy_value; + GetOovpaEntry(oovpa, oovpa->XRefCount, prev_offset, dummy_value); + for (int p = oovpa->XRefCount + 1; p < oovpa->Count; p++) { + uint32_t curr_offset; + GetOovpaEntry(oovpa, p, curr_offset, dummy_value); + if (!(curr_offset > prev_offset)) { + HLEError(context, buildVersion, "Lovp[%d] : Offset (0x%x) must be larger then previous offset (0x%x)", + p, curr_offset, prev_offset); + } + } + + // find duplicate OOVPA's across all other data-table-oovpa's + context->oovpa = oovpa; + context->against = oovpa; + VerifyHLEDataBaseAgainst(context); + context->against = nullptr; // reset scanning state + return; + } + + // prevent checking an oovpa against itself + if (context->against == oovpa) { + return; + } + + // compare {Offset, Value}-pairs between two OOVPA's + OOVPA *left = context->against, *right = oovpa; + int l = 0, r = 0; + uint32_t left_offset, right_offset; + uint8_t left_value, right_value; + GetOovpaEntry(left, l, left_offset, left_value); + GetOovpaEntry(right, r, right_offset, right_value); + int unique_offset_left = 0; + int unique_offset_right = 0; + int equal_offset_value = 0; + int equal_offset_different_value = 0; + while (true) { + bool left_next = true; + bool right_next = true; + + if (left_offset < right_offset) { + unique_offset_left++; + right_next = false; + } else if (left_offset > right_offset) { + unique_offset_right++; + left_next = false; + } else if (left_value == right_value) { + equal_offset_value++; + } else { + equal_offset_different_value++; + } + + // increment r before use (in left_next) + if (right_next) { + r++; + } + + if (left_next) { + l++; + if (l >= left->Count) { + unique_offset_right += right->Count - r; + break; + } + + GetOovpaEntry(left, l, left_offset, left_value); + } + + if (right_next) { + if (r >= right->Count) { + unique_offset_left += left->Count - l; + break; + } + + GetOovpaEntry(right, r, right_offset, right_value); + } + } + + // no mismatching values on identical offsets? + if (equal_offset_different_value == 0) { + // enough matching OV-pairs? + if (equal_offset_value > 4) { + // no unique OV-pairs on either side? + if (unique_offset_left + unique_offset_right == 0) { + HLEError(context, buildVersion, "OOVPA's are identical", + unique_offset_left, + unique_offset_right); + } else { + // not too many new OV-pairs on the left side? + if (unique_offset_left < 6) { + // not too many new OV-parirs on the right side? + if (unique_offset_right < 6) { + HLEError(context, buildVersion, "OOVPA's are expanded (left +%d, right +%d)", + unique_offset_left, + unique_offset_right); + } + } + } + } + } +} + +void VerifyHLEDataEntry(HLEVerifyContext *context, const OOVPATable *table, uint32_t index) +{ + if (context->against == nullptr) { + context->main_index = index; + } else { + context->against_index = index; + } + + if (context->against == nullptr) { + const char* checkDisableStr = nullptr; + size_t getFuncStrLength = strlen(table[index].szFuncName); + + if (getFuncStrLength > 10) { + checkDisableStr = &table[index].szFuncName[getFuncStrLength - 10]; + } + + if (checkDisableStr != nullptr && strcmp(checkDisableStr, "_UNPATCHED") == 0) { + if (GetEmuPatchAddr((std::string)table[index].szFuncName)) { + HLEError(context, table[index].Version, "OOVPA registration UNPATCHED while a patch exists!"); + } + } else if (table[index].Oovpa->XRefSaveIndex != XRefNoSaveIndex) { + if (GetEmuPatchAddr((std::string)table[index].szFuncName)) { + HLEError(context, table[index].Version, "OOVPA registration XREF while a patch exists!"); + } + } + } + + // verify the OOVPA of this entry + if (table[index].Oovpa != nullptr) { + VerifyHLEOOVPA(context, table[index].Version, table[index].Oovpa); + } +} + +void VerifyHLEData(HLEVerifyContext *context, const HLEData *data) +{ + if (context->against == nullptr) { + context->main_data = data; + } else { + context->against_data = data; + } + + // Don't check a database against itself : + if (context->main_data == context->against_data) { + return; + } + + // verify each entry in this HLEData + for (uint32_t e = 0; e < data->OovpaTableCount; e++) { + VerifyHLEDataEntry(context, data->OovpaTable, e); + } +} + +void VerifyHLEDataBaseAgainst(HLEVerifyContext *context) +{ + // verify all HLEData's + for (uint32_t d = 0; d < HLEDataBaseCount; d++) { + VerifyHLEData(context, &HLEDataBase[d]); + } +} + +void VerifyHLEDataBase() +{ + HLEVerifyContext context = { 0 }; + VerifyHLEDataBaseAgainst(&context); +} +#endif // _DEBUG_TRACE +#endif diff --git a/src/CxbxKrnl/HLEIntercept.h b/src/core/hle/Intercept.hpp similarity index 69% rename from src/CxbxKrnl/HLEIntercept.h rename to src/core/hle/Intercept.hpp index 507a252bf..ec2374624 100644 --- a/src/CxbxKrnl/HLEIntercept.h +++ b/src/core/hle/Intercept.hpp @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->HLEIntercept.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,29 +22,38 @@ // * All rights reserved // * // ****************************************************************** -#ifndef HLEINTERCEPT_H -#define HLEINTERCEPT_H +#ifndef HLEINTERCEPT_HPP +#define HLEINTERCEPT_HPP #include extern bool bLLE_APU; // Set this to true for experimental APU (sound) LLE extern bool bLLE_GPU; // Set this to true for experimental GPU (graphics) LLE +extern bool bLLE_USB; // Set this to true for experimental USB (input) LLE extern bool bLLE_JIT; // Set this to true for experimental JIT extern std::map g_SymbolAddresses; void EmuHLEIntercept(Xbe::Header *XbeHeader); -std::string GetDetectedSymbolName(xbaddr address, int *symbolOffset); +std::string GetDetectedSymbolName(const xbaddr address, int * const symbolOffset); void* GetXboxFunctionPointer(std::string functionName); +#define XB_TYPE(func) XB_TRAMPOLINE_##func##_t +#define XB_NAME(func) XB_TRAMPOLINE_##func##_str +#define XB_TRMP(func) XB_TRAMPOLINE_##func + // Declares an unpatched Xbox function trampoline, callable by name (with a 'XB_' prefix attached) -#define XB_trampoline(ret, conv, name, arguments) \ - typedef ret(conv *XB_##name##_t)arguments; \ - static XB_##name##_t XB_##name = (XB_##name##_t)GetXboxFunctionPointer(#name); +#define XB_trampoline_declare(ret, conv, func, arguments) \ + typedef ret(conv * XB_TYPE(func))arguments; \ + static const std::string XB_NAME(func) = #func; \ + static XB_TYPE(func) XB_TRMP(func) = nullptr + +#define XB_trampoline_lookup(ret, conv, func, arguments) \ + XB_TRMP(func) = (XB_TYPE(func))GetXboxFunctionPointer(XB_NAME(func)) #ifdef _DEBUG_TRACE void VerifyHLEDataBase(); #endif -#endif // HLEINTERCEPT_H +#endif diff --git a/src/core/hle/Patches.cpp b/src/core/hle/Patches.cpp new file mode 100644 index 000000000..119737003 --- /dev/null +++ b/src/core/hle/Patches.cpp @@ -0,0 +1,451 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "core\hle\D3D8\Direct3D9/Direct3D9.h" +#include "core\hle\DSOUND\DirectSound\DirectSound.hpp" +#include "Patches.hpp" +#include "Intercept.hpp" + +#include +#include +#include + +typedef struct { + const void* patchFunc; // Function pointer of the patch in Cxbx-R codebase + const uint32_t flags; // Patch Flags +} xbox_patch_t; + +const uint32_t PATCH_ALWAYS = 1 << 0; +const uint32_t PATCH_HLE_D3D = 1 << 1; +const uint32_t PATCH_HLE_DSOUND = 1 << 2; +const uint32_t PATCH_HLE_OHCI = 1 << 3; +const uint32_t PATCH_IS_FIBER = 1 << 4; + +#define PATCH_ENTRY(Name, Func, Flags) \ + { Name, xbox_patch_t { (void *)&Func, Flags} } + +// Map of Xbox Patch names to Emulator Patches +// A std::string is used as it's possible for a symbol to have multiple names +// This allows for the eventual importing of Dxbx symbol files and even IDA signatures too! +std::map g_PatchTable = { + // Direct3D + PATCH_ENTRY("D3DDevice_Begin", XTL::EMUPATCH(D3DDevice_Begin), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_BeginPush", XTL::EMUPATCH(D3DDevice_BeginPush), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_BeginPush2", XTL::EMUPATCH(D3DDevice_BeginPush2), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_BeginVisibilityTest", XTL::EMUPATCH(D3DDevice_BeginVisibilityTest), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_BlockOnFence", XTL::EMUPATCH(D3DDevice_BlockOnFence), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_BlockUntilVerticalBlank", XTL::EMUPATCH(D3DDevice_BlockUntilVerticalBlank), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_Clear", XTL::EMUPATCH(D3DDevice_Clear), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_CopyRects", XTL::EMUPATCH(D3DDevice_CopyRects), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_CreateVertexShader", XTL::EMUPATCH(D3DDevice_CreateVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DeleteVertexShader", XTL::EMUPATCH(D3DDevice_DeleteVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DeleteVertexShader_0", XTL::EMUPATCH(D3DDevice_DeleteVertexShader_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawIndexedVertices", XTL::EMUPATCH(D3DDevice_DrawIndexedVertices), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawIndexedVerticesUP", XTL::EMUPATCH(D3DDevice_DrawIndexedVerticesUP), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawRectPatch", XTL::EMUPATCH(D3DDevice_DrawRectPatch), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawTriPatch", XTL::EMUPATCH(D3DDevice_DrawTriPatch), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawVertices", XTL::EMUPATCH(D3DDevice_DrawVertices), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawVertices_4", XTL::EMUPATCH(D3DDevice_DrawVertices_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_DrawVerticesUP", XTL::EMUPATCH(D3DDevice_DrawVerticesUP), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_EnableOverlay", XTL::EMUPATCH(D3DDevice_EnableOverlay), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_End", XTL::EMUPATCH(D3DDevice_End), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_EndPush", XTL::EMUPATCH(D3DDevice_EndPush), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_EndVisibilityTest", XTL::EMUPATCH(D3DDevice_EndVisibilityTest), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_EndVisibilityTest_0", XTL::EMUPATCH(D3DDevice_EndVisibilityTest_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_FlushVertexCache", XTL::EMUPATCH(D3DDevice_FlushVertexCache), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetBackBuffer", XTL::EMUPATCH(D3DDevice_GetBackBuffer), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetBackBuffer2", XTL::EMUPATCH(D3DDevice_GetBackBuffer2), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetDisplayFieldStatus", XTL::EMUPATCH(D3DDevice_GetDisplayFieldStatus), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetGammaRamp", XTL::EMUPATCH(D3DDevice_GetGammaRamp), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetMaterial", XTL::EMUPATCH(D3DDevice_GetMaterial), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetModelView", XTL::EMUPATCH(D3DDevice_GetModelView), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetOverlayUpdateStatus", XTL::EMUPATCH(D3DDevice_GetOverlayUpdateStatus), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetProjectionViewportMatrix", XTL::EMUPATCH(D3DDevice_GetProjectionViewportMatrix), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetShaderConstantMode", XTL::EMUPATCH(D3DDevice_GetShaderConstantMode), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetTransform", XTL::EMUPATCH(D3DDevice_GetTransform), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVertexShader", XTL::EMUPATCH(D3DDevice_GetVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVertexShaderConstant", XTL::EMUPATCH(D3DDevice_GetVertexShaderConstant), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVertexShaderDeclaration", XTL::EMUPATCH(D3DDevice_GetVertexShaderDeclaration), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVertexShaderFunction", XTL::EMUPATCH(D3DDevice_GetVertexShaderFunction), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVertexShaderInput", XTL::EMUPATCH(D3DDevice_GetVertexShaderInput), PATCH_HLE_D3D), + //PATCH_ENTRY("D3DDevice_GetVertexShaderSize", XTL::EMUPATCH(D3DDevice_GetVertexShaderSize), PATCH_HLE_D3D), + //PATCH_ENTRY("D3DDevice_GetVertexShaderType", XTL::EMUPATCH(D3DDevice_GetVertexShaderType), PATCH_HLE_D3D), + //PATCH_ENTRY("D3DDevice_GetViewportOffsetAndScale", XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_GetVisibilityTestResult", XTL::EMUPATCH(D3DDevice_GetVisibilityTestResult), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_InsertCallback", XTL::EMUPATCH(D3DDevice_InsertCallback), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_InsertFence", XTL::EMUPATCH(D3DDevice_InsertFence), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_IsBusy", XTL::EMUPATCH(D3DDevice_IsBusy), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_IsFencePending", XTL::EMUPATCH(D3DDevice_IsFencePending), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_LightEnable", XTL::EMUPATCH(D3DDevice_LightEnable), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_LoadVertexShader", XTL::EMUPATCH(D3DDevice_LoadVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_LoadVertexShaderProgram", XTL::EMUPATCH(D3DDevice_LoadVertexShaderProgram), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_LoadVertexShader_0", XTL::EMUPATCH(D3DDevice_LoadVertexShader_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_LoadVertexShader_4", XTL::EMUPATCH(D3DDevice_LoadVertexShader_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_MultiplyTransform", XTL::EMUPATCH(D3DDevice_MultiplyTransform), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_PersistDisplay", XTL::EMUPATCH(D3DDevice_PersistDisplay), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_Present", XTL::EMUPATCH(D3DDevice_Present), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_PrimeVertexCache", XTL::EMUPATCH(D3DDevice_PrimeVertexCache), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_Reset", XTL::EMUPATCH(D3DDevice_Reset), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_RunPushBuffer", XTL::EMUPATCH(D3DDevice_RunPushBuffer), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_RunVertexStateShader", XTL::EMUPATCH(D3DDevice_RunVertexStateShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SelectVertexShader", XTL::EMUPATCH(D3DDevice_SelectVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SelectVertexShaderDirect", XTL::EMUPATCH(D3DDevice_SelectVertexShaderDirect), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SelectVertexShader_0", XTL::EMUPATCH(D3DDevice_SelectVertexShader_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SelectVertexShader_4", XTL::EMUPATCH(D3DDevice_SelectVertexShader_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetBackBufferScale", XTL::EMUPATCH(D3DDevice_SetBackBufferScale), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetDepthClipPlanes", XTL::EMUPATCH(D3DDevice_SetDepthClipPlanes), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetFlickerFilter", XTL::EMUPATCH(D3DDevice_SetFlickerFilter), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetFlickerFilter_0", XTL::EMUPATCH(D3DDevice_SetFlickerFilter_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetGammaRamp", XTL::EMUPATCH(D3DDevice_SetGammaRamp), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetIndices", XTL::EMUPATCH(D3DDevice_SetIndices), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetIndices_4", XTL::EMUPATCH(D3DDevice_SetIndices_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetLight", XTL::EMUPATCH(D3DDevice_SetLight), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetMaterial", XTL::EMUPATCH(D3DDevice_SetMaterial), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetModelView", XTL::EMUPATCH(D3DDevice_SetModelView), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetPalette", XTL::EMUPATCH(D3DDevice_SetPalette), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetPalette_4", XTL::EMUPATCH(D3DDevice_SetPalette_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetPixelShader", XTL::EMUPATCH(D3DDevice_SetPixelShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetPixelShaderConstant_4", XTL::EMUPATCH(D3DDevice_SetPixelShaderConstant_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetPixelShader_0", XTL::EMUPATCH(D3DDevice_SetPixelShader_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetRenderState_Simple", XTL::EMUPATCH(D3DDevice_SetRenderState_Simple), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetRenderTarget", XTL::EMUPATCH(D3DDevice_SetRenderTarget), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetRenderTargetFast", XTL::EMUPATCH(D3DDevice_SetRenderTargetFast), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetScreenSpaceOffset", XTL::EMUPATCH(D3DDevice_SetScreenSpaceOffset), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetShaderConstantMode", XTL::EMUPATCH(D3DDevice_SetShaderConstantMode), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetShaderConstantMode_0", XTL::EMUPATCH(D3DDevice_SetShaderConstantMode_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetSoftDisplayFilter", XTL::EMUPATCH(D3DDevice_SetSoftDisplayFilter), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStateUP", XTL::EMUPATCH(D3DDevice_SetStateUP), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStateVB", XTL::EMUPATCH(D3DDevice_SetStateVB), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStipple", XTL::EMUPATCH(D3DDevice_SetStipple), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStreamSource", XTL::EMUPATCH(D3DDevice_SetStreamSource), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStreamSource_4", XTL::EMUPATCH(D3DDevice_SetStreamSource_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetStreamSource_8", XTL::EMUPATCH(D3DDevice_SetStreamSource_8), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetSwapCallback", XTL::EMUPATCH(D3DDevice_SetSwapCallback), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetTexture", XTL::EMUPATCH(D3DDevice_SetTexture), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetTexture_4", XTL::EMUPATCH(D3DDevice_SetTexture_4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetTransform", XTL::EMUPATCH(D3DDevice_SetTransform), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetTransform_0", XTL::EMUPATCH(D3DDevice_SetTransform_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData2f", XTL::EMUPATCH(D3DDevice_SetVertexData2f), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData2s", XTL::EMUPATCH(D3DDevice_SetVertexData2s), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData4f", XTL::EMUPATCH(D3DDevice_SetVertexData4f), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData4f_16", XTL::EMUPATCH(D3DDevice_SetVertexData4f_16), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData4s", XTL::EMUPATCH(D3DDevice_SetVertexData4s), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexData4ub", XTL::EMUPATCH(D3DDevice_SetVertexData4ub), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexDataColor", XTL::EMUPATCH(D3DDevice_SetVertexDataColor), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShader", XTL::EMUPATCH(D3DDevice_SetVertexShader), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstant", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstant1", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant1), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstant1Fast", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant1Fast), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstant4", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant4), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstantNotInline", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstantNotInline), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstantNotInlineFast", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstantNotInlineFast), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderConstant_8", XTL::EMUPATCH(D3DDevice_SetVertexShaderConstant_8), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderInput", XTL::EMUPATCH(D3DDevice_SetVertexShaderInput), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVertexShaderInputDirect", XTL::EMUPATCH(D3DDevice_SetVertexShaderInputDirect), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetVerticalBlankCallback", XTL::EMUPATCH(D3DDevice_SetVerticalBlankCallback), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SetViewport", XTL::EMUPATCH(D3DDevice_SetViewport), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_Swap", XTL::EMUPATCH(D3DDevice_Swap), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_Swap_0", XTL::EMUPATCH(D3DDevice_Swap_0), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_SwitchTexture", XTL::EMUPATCH(D3DDevice_SwitchTexture), PATCH_HLE_D3D), + PATCH_ENTRY("D3DDevice_UpdateOverlay", XTL::EMUPATCH(D3DDevice_UpdateOverlay), PATCH_HLE_D3D), + PATCH_ENTRY("D3DResource_BlockUntilNotBusy", XTL::EMUPATCH(D3DResource_BlockUntilNotBusy), PATCH_HLE_D3D), + PATCH_ENTRY("D3D_BlockOnTime", XTL::EMUPATCH(D3D_BlockOnTime), PATCH_HLE_D3D), + PATCH_ENTRY("D3D_DestroyResource", XTL::EMUPATCH(D3D_DestroyResource), PATCH_HLE_D3D), + PATCH_ENTRY("D3D_DestroyResource__LTCG", XTL::EMUPATCH(D3D_DestroyResource__LTCG), PATCH_HLE_D3D), + PATCH_ENTRY("D3D_LazySetPointParams", XTL::EMUPATCH(D3D_LazySetPointParams), PATCH_HLE_D3D), + PATCH_ENTRY("D3D_SetCommonDebugRegisters", XTL::EMUPATCH(D3D_SetCommonDebugRegisters), PATCH_HLE_D3D), + PATCH_ENTRY("Direct3D_CreateDevice", XTL::EMUPATCH(Direct3D_CreateDevice), PATCH_HLE_D3D), + PATCH_ENTRY("Direct3D_CreateDevice_16", XTL::EMUPATCH(Direct3D_CreateDevice_16), PATCH_HLE_D3D), + PATCH_ENTRY("Direct3D_CreateDevice_4", XTL::EMUPATCH(Direct3D_CreateDevice_4), PATCH_HLE_D3D), + PATCH_ENTRY("Lock2DSurface", XTL::EMUPATCH(Lock2DSurface), PATCH_HLE_D3D), + PATCH_ENTRY("Lock3DSurface", XTL::EMUPATCH(Lock3DSurface), PATCH_HLE_D3D), + + // DSOUND + PATCH_ENTRY("CDirectSound3DCalculator_Calculate3D", XTL::EMUPATCH(CDirectSound3DCalculator_Calculate3D), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSound3DCalculator_GetVoiceData", XTL::EMUPATCH(CDirectSound3DCalculator_GetVoiceData), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_AddRef", XTL::EMUPATCH(CDirectSoundStream_AddRef), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_Discontinuity", XTL::EMUPATCH(CDirectSoundStream_Discontinuity), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_Flush", XTL::EMUPATCH(CDirectSoundStream_Flush), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_FlushEx", XTL::EMUPATCH(CDirectSoundStream_FlushEx), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_GetInfo", XTL::EMUPATCH(CDirectSoundStream_GetInfo), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_GetStatus", XTL::EMUPATCH(CDirectSoundStream_GetStatus), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_GetVoiceProperties", XTL::EMUPATCH(CDirectSoundStream_GetVoiceProperties), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_Pause", XTL::EMUPATCH(CDirectSoundStream_Pause), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_PauseEx", XTL::EMUPATCH(CDirectSoundStream_PauseEx), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_Process", XTL::EMUPATCH(CDirectSoundStream_Process), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_Release", XTL::EMUPATCH(CDirectSoundStream_Release), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetAllParameters", XTL::EMUPATCH(CDirectSoundStream_SetAllParameters), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetConeAngles", XTL::EMUPATCH(CDirectSoundStream_SetConeAngles), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetConeOrientation", XTL::EMUPATCH(CDirectSoundStream_SetConeOrientation), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetConeOutsideVolume", XTL::EMUPATCH(CDirectSoundStream_SetConeOutsideVolume), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetDistanceFactor", XTL::EMUPATCH(CDirectSoundStream_SetDistanceFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetDopplerFactor", XTL::EMUPATCH(CDirectSoundStream_SetDopplerFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetEG", XTL::EMUPATCH(CDirectSoundStream_SetEG), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetFilter", XTL::EMUPATCH(CDirectSoundStream_SetFilter), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetFormat", XTL::EMUPATCH(CDirectSoundStream_SetFormat), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetFrequency", XTL::EMUPATCH(CDirectSoundStream_SetFrequency), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetHeadroom", XTL::EMUPATCH(CDirectSoundStream_SetHeadroom), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetI3DL2Source", XTL::EMUPATCH(CDirectSoundStream_SetI3DL2Source), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetLFO", XTL::EMUPATCH(CDirectSoundStream_SetLFO), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMaxDistance", XTL::EMUPATCH(CDirectSoundStream_SetMaxDistance), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMinDistance", XTL::EMUPATCH(CDirectSoundStream_SetMinDistance), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMixBinVolumes_12", XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_12), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMixBinVolumes_8", XTL::EMUPATCH(CDirectSoundStream_SetMixBinVolumes_8), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMixBins", XTL::EMUPATCH(CDirectSoundStream_SetMixBins), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetMode", XTL::EMUPATCH(CDirectSoundStream_SetMode), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetOutputBuffer", XTL::EMUPATCH(CDirectSoundStream_SetOutputBuffer), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetPitch", XTL::EMUPATCH(CDirectSoundStream_SetPitch), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetPosition", XTL::EMUPATCH(CDirectSoundStream_SetPosition), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetRolloffCurve", XTL::EMUPATCH(CDirectSoundStream_SetRolloffCurve), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetRolloffFactor", XTL::EMUPATCH(CDirectSoundStream_SetRolloffFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetVelocity", XTL::EMUPATCH(CDirectSoundStream_SetVelocity), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSoundStream_SetVolume", XTL::EMUPATCH(CDirectSoundStream_SetVolume), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSound_CommitDeferredSettings", XTL::EMUPATCH(CDirectSound_CommitDeferredSettings), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSound_GetSpeakerConfig", XTL::EMUPATCH(CDirectSound_GetSpeakerConfig), PATCH_HLE_DSOUND), + PATCH_ENTRY("CDirectSound_SynchPlayback", XTL::EMUPATCH(CDirectSound_SynchPlayback), PATCH_HLE_DSOUND), + PATCH_ENTRY("CMcpxStream_Dummy_0x10", XTL::EMUPATCH(CMcpxStream_Dummy_0x10), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundCreate", XTL::EMUPATCH(DirectSoundCreate), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundCreateBuffer", XTL::EMUPATCH(DirectSoundCreateBuffer), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundCreateStream", XTL::EMUPATCH(DirectSoundCreateStream), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundDoWork", XTL::EMUPATCH(DirectSoundDoWork), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundGetSampleTime", XTL::EMUPATCH(DirectSoundGetSampleTime), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundUseFullHRTF", XTL::EMUPATCH(DirectSoundUseFullHRTF), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundUseFullHRTF4Channel", XTL::EMUPATCH(DirectSoundUseFullHRTF4Channel), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundUseLightHRTF", XTL::EMUPATCH(DirectSoundUseLightHRTF), PATCH_HLE_DSOUND), + PATCH_ENTRY("DirectSoundUseLightHRTF4Channel", XTL::EMUPATCH(DirectSoundUseLightHRTF4Channel), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_AddRef", XTL::EMUPATCH(IDirectSoundBuffer_AddRef), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_GetCurrentPosition", XTL::EMUPATCH(IDirectSoundBuffer_GetCurrentPosition), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_GetStatus", XTL::EMUPATCH(IDirectSoundBuffer_GetStatus), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_GetVoiceProperties", XTL::EMUPATCH(IDirectSoundBuffer_GetVoiceProperties), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Lock", XTL::EMUPATCH(IDirectSoundBuffer_Lock), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Pause", XTL::EMUPATCH(IDirectSoundBuffer_Pause), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_PauseEx", XTL::EMUPATCH(IDirectSoundBuffer_PauseEx), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Play", XTL::EMUPATCH(IDirectSoundBuffer_Play), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_PlayEx", XTL::EMUPATCH(IDirectSoundBuffer_PlayEx), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Release", XTL::EMUPATCH(IDirectSoundBuffer_Release), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Set3DVoiceData ", XTL::EMUPATCH(IDirectSoundBuffer_Set3DVoiceData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetAllParameters", XTL::EMUPATCH(IDirectSoundBuffer_SetAllParameters), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetBufferData", XTL::EMUPATCH(IDirectSoundBuffer_SetBufferData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetConeAngles", XTL::EMUPATCH(IDirectSoundBuffer_SetConeAngles), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetConeOrientation", XTL::EMUPATCH(IDirectSoundBuffer_SetConeOrientation), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetConeOutsideVolume", XTL::EMUPATCH(IDirectSoundBuffer_SetConeOutsideVolume), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetCurrentPosition", XTL::EMUPATCH(IDirectSoundBuffer_SetCurrentPosition), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetDistanceFactor", XTL::EMUPATCH(IDirectSoundBuffer_SetDistanceFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetDopplerFactor", XTL::EMUPATCH(IDirectSoundBuffer_SetDopplerFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetEG", XTL::EMUPATCH(IDirectSoundBuffer_SetEG), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetFilter", XTL::EMUPATCH(IDirectSoundBuffer_SetFilter), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetFormat", XTL::EMUPATCH(IDirectSoundBuffer_SetFormat), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetFrequency", XTL::EMUPATCH(IDirectSoundBuffer_SetFrequency), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetHeadroom", XTL::EMUPATCH(IDirectSoundBuffer_SetHeadroom), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetI3DL2Source", XTL::EMUPATCH(IDirectSoundBuffer_SetI3DL2Source), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetLFO", XTL::EMUPATCH(IDirectSoundBuffer_SetLFO), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetLoopRegion", XTL::EMUPATCH(IDirectSoundBuffer_SetLoopRegion), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMaxDistance", XTL::EMUPATCH(IDirectSoundBuffer_SetMaxDistance), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMinDistance", XTL::EMUPATCH(IDirectSoundBuffer_SetMinDistance), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMixBinVolumes_12", XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_12), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMixBinVolumes_8", XTL::EMUPATCH(IDirectSoundBuffer_SetMixBinVolumes_8), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMixBins", XTL::EMUPATCH(IDirectSoundBuffer_SetMixBins), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetMode", XTL::EMUPATCH(IDirectSoundBuffer_SetMode), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetNotificationPositions", XTL::EMUPATCH(IDirectSoundBuffer_SetNotificationPositions), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetOutputBuffer", XTL::EMUPATCH(IDirectSoundBuffer_SetOutputBuffer), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetPitch", XTL::EMUPATCH(IDirectSoundBuffer_SetPitch), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetPlayRegion", XTL::EMUPATCH(IDirectSoundBuffer_SetPlayRegion), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetPosition", XTL::EMUPATCH(IDirectSoundBuffer_SetPosition), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetRolloffCurve", XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffCurve), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetRolloffFactor", XTL::EMUPATCH(IDirectSoundBuffer_SetRolloffFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetVelocity", XTL::EMUPATCH(IDirectSoundBuffer_SetVelocity), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_SetVolume", XTL::EMUPATCH(IDirectSoundBuffer_SetVolume), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Stop", XTL::EMUPATCH(IDirectSoundBuffer_Stop), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_StopEx", XTL::EMUPATCH(IDirectSoundBuffer_StopEx), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Unlock", XTL::EMUPATCH(IDirectSoundBuffer_Unlock), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundBuffer_Use3DVoiceData", XTL::EMUPATCH(IDirectSoundBuffer_Use3DVoiceData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_Set3DVoiceData ", XTL::EMUPATCH(IDirectSoundStream_Set3DVoiceData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetEG", XTL::EMUPATCH(IDirectSoundStream_SetEG), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetFilter", XTL::EMUPATCH(IDirectSoundStream_SetFilter), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetFrequency", XTL::EMUPATCH(IDirectSoundStream_SetFrequency), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetHeadroom", XTL::EMUPATCH(IDirectSoundStream_SetHeadroom), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetLFO", XTL::EMUPATCH(IDirectSoundStream_SetLFO), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetMixBins", XTL::EMUPATCH(IDirectSoundStream_SetMixBins), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetPitch", XTL::EMUPATCH(IDirectSoundStream_SetPitch), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_SetVolume", XTL::EMUPATCH(IDirectSoundStream_SetVolume), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSoundStream_Use3DVoiceData ", XTL::EMUPATCH(IDirectSoundStream_Use3DVoiceData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_AddRef", XTL::EMUPATCH(IDirectSound_AddRef), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_CommitDeferredSettings", XTL::EMUPATCH(IDirectSound_CommitDeferredSettings), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_CommitEffectData", XTL::EMUPATCH(IDirectSound_CommitEffectData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_CreateSoundBuffer", XTL::EMUPATCH(IDirectSound_CreateSoundBuffer), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_CreateSoundStream", XTL::EMUPATCH(IDirectSound_CreateSoundStream), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_DownloadEffectsImage", XTL::EMUPATCH(IDirectSound_DownloadEffectsImage), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_EnableHeadphones", XTL::EMUPATCH(IDirectSound_EnableHeadphones), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_GetCaps", XTL::EMUPATCH(IDirectSound_GetCaps), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_GetEffectData", XTL::EMUPATCH(IDirectSound_GetEffectData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_GetOutputLevels", XTL::EMUPATCH(IDirectSound_GetOutputLevels), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_GetSpeakerConfig", XTL::EMUPATCH(IDirectSound_GetSpeakerConfig), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_Release", XTL::EMUPATCH(IDirectSound_Release), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetAllParameters", XTL::EMUPATCH(IDirectSound_SetAllParameters), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetDistanceFactor", XTL::EMUPATCH(IDirectSound_SetDistanceFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetDopplerFactor", XTL::EMUPATCH(IDirectSound_SetDopplerFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetEffectData", XTL::EMUPATCH(IDirectSound_SetEffectData), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetI3DL2Listener", XTL::EMUPATCH(IDirectSound_SetI3DL2Listener), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetMixBinHeadroom", XTL::EMUPATCH(IDirectSound_SetMixBinHeadroom), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetOrientation", XTL::EMUPATCH(IDirectSound_SetOrientation), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetPosition", XTL::EMUPATCH(IDirectSound_SetPosition), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetRolloffFactor", XTL::EMUPATCH(IDirectSound_SetRolloffFactor), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SetVelocity", XTL::EMUPATCH(IDirectSound_SetVelocity), PATCH_HLE_DSOUND), + PATCH_ENTRY("IDirectSound_SynchPlayback", XTL::EMUPATCH(IDirectSound_SynchPlayback), PATCH_HLE_DSOUND), + //PATCH_ENTRY("XAudioCreateAdpcmFormat", XTL::EMUPATCH(XAudioCreateAdpcmFormat), PATCH_HLE_DSOUND), // NOTE: Not require to patch + PATCH_ENTRY("XAudioDownloadEffectsImage", XTL::EMUPATCH(XAudioDownloadEffectsImage), PATCH_HLE_DSOUND), + PATCH_ENTRY("XAudioSetEffectData", XTL::EMUPATCH(XAudioSetEffectData), PATCH_HLE_DSOUND), + + // OHCI + PATCH_ENTRY("XGetDeviceChanges", XTL::EMUPATCH(XGetDeviceChanges), PATCH_HLE_OHCI), + PATCH_ENTRY("XGetDeviceEnumerationStatus", XTL::EMUPATCH(XGetDeviceEnumerationStatus), PATCH_HLE_OHCI), + PATCH_ENTRY("XGetDevices", XTL::EMUPATCH(XGetDevices), PATCH_HLE_OHCI), + PATCH_ENTRY("XInitDevices", XTL::EMUPATCH(XInitDevices), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputClose", XTL::EMUPATCH(XInputClose), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputGetCapabilities", XTL::EMUPATCH(XInputGetCapabilities), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputGetDeviceDescription", XTL::EMUPATCH(XInputGetDeviceDescription), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputGetState", XTL::EMUPATCH(XInputGetState), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputOpen", XTL::EMUPATCH(XInputOpen), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputPoll", XTL::EMUPATCH(XInputPoll), PATCH_HLE_OHCI), + PATCH_ENTRY("XInputSetState", XTL::EMUPATCH(XInputSetState), PATCH_HLE_OHCI), + + // XAPI + PATCH_ENTRY("ConvertThreadToFiber", XTL::EMUPATCH(ConvertThreadToFiber), PATCH_IS_FIBER), + PATCH_ENTRY("CreateFiber", XTL::EMUPATCH(CreateFiber), PATCH_IS_FIBER), + PATCH_ENTRY("DeleteFiber", XTL::EMUPATCH(DeleteFiber), PATCH_IS_FIBER), + PATCH_ENTRY("GetExitCodeThread", XTL::EMUPATCH(GetExitCodeThread), PATCH_ALWAYS), + PATCH_ENTRY("GetThreadPriority", XTL::EMUPATCH(GetThreadPriority), PATCH_ALWAYS), + PATCH_ENTRY("OutputDebugStringA", XTL::EMUPATCH(OutputDebugStringA), PATCH_ALWAYS), + PATCH_ENTRY("RaiseException", XTL::EMUPATCH(RaiseException), PATCH_ALWAYS), + PATCH_ENTRY("SetThreadPriority", XTL::EMUPATCH(SetThreadPriority), PATCH_ALWAYS), + PATCH_ENTRY("SetThreadPriorityBoost", XTL::EMUPATCH(SetThreadPriorityBoost), PATCH_ALWAYS), + PATCH_ENTRY("SignalObjectAndWait", XTL::EMUPATCH(SignalObjectAndWait), PATCH_ALWAYS), + PATCH_ENTRY("SwitchToFiber", XTL::EMUPATCH(SwitchToFiber), PATCH_IS_FIBER), + PATCH_ENTRY("XMountMUA", XTL::EMUPATCH(XMountMUA), PATCH_ALWAYS), + PATCH_ENTRY("XMountMURootA", XTL::EMUPATCH(XMountMURootA), PATCH_ALWAYS), + PATCH_ENTRY("XSetProcessQuantumLength", XTL::EMUPATCH(XSetProcessQuantumLength), PATCH_ALWAYS), + PATCH_ENTRY("timeKillEvent", XTL::EMUPATCH(timeKillEvent), PATCH_ALWAYS), + PATCH_ENTRY("timeSetEvent", XTL::EMUPATCH(timeSetEvent), PATCH_ALWAYS), +}; + +std::unordered_map g_FunctionHooks; + +inline bool TitleRequiresUnpatchedFibers() +{ + static bool detected = false; + static bool result = false; + + // Prevent running the check every time this function is called + if (detected) { + return result; + } + + // Array of known games that require the fiber unpatch hack + DWORD titleIds[] = { + 0x46490002, // Futurama PAL + 0x56550008, // Futurama NTSC + 0 + }; + + DWORD* pTitleId = &titleIds[0]; + while (*pTitleId != 0) { + if (g_pCertificate->dwTitleId == *pTitleId) { + result = true; + break; + } + + pTitleId++; + } + + detected = true; + return result; +} + + +// NOTE: EmuInstallPatch do not get to be in XbSymbolDatabase, do the patches in Cxbx project only. +inline void EmuInstallPatch(const std::string FunctionName, const xbaddr FunctionAddr) +{ + auto it = g_PatchTable.find(FunctionName); + if (it == g_PatchTable.end()) { + return; + } + + auto patch = it->second; + + if ((patch.flags & PATCH_HLE_D3D) && bLLE_GPU) { + printf("HLE: %s: Skipped (LLE GPU Enabled)\n", FunctionName.c_str()); + return; + } + + if ((patch.flags & PATCH_HLE_DSOUND) && bLLE_APU) { + printf("HLE: %s: Skipped (LLE APU Enabled)\n", FunctionName.c_str()); + return; + } + + if ((patch.flags & PATCH_HLE_OHCI) && bLLE_USB) { + printf("HLE: %s: Skipped (LLE OHCI Enabled)\n", FunctionName.c_str()); + return; + } + + // HACK: Some titles require unpatched Fibers, otherwise they enter an infinite loop + // while others require patched Fibers, otherwise they outright crash + // This is caused by limitations of Direct Code Execution and Cxbx-R's threading model + if ((patch.flags & PATCH_IS_FIBER) && TitleRequiresUnpatchedFibers()) { + printf("HLE: %s: Skipped (Game requires unpatched Fibers)\n", FunctionName.c_str()); + return; + } + + g_FunctionHooks[FunctionName].Install((void*)(FunctionAddr), (void*)patch.patchFunc); + printf("HLE: %s Patched\n", FunctionName.c_str()); +} + +void EmuInstallPatches() +{ + for (const auto& it : g_SymbolAddresses) { + EmuInstallPatch(it.first, it.second); + } + + LookupTrampolines(); +} + +void* GetPatchedFunctionTrampoline(const std::string functionName) +{ + auto it = g_FunctionHooks.find(functionName); + if (it != g_FunctionHooks.end()) { + auto trampoline = it->second.GetTrampoline(); + if (trampoline == nullptr) { + EmuLogEx(CXBXR_MODULE::HLE, LOG_LEVEL::WARNING, "Failed to get XB_Trampoline for %s", functionName.c_str()); + } + + return trampoline; + } + + return nullptr; +} diff --git a/src/core/hle/Patches.hpp b/src/core/hle/Patches.hpp new file mode 100644 index 000000000..de00cd39b --- /dev/null +++ b/src/core/hle/Patches.hpp @@ -0,0 +1,33 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef HLEPATCHES_HPP +#define HLEPATCHES_HPP + +#include + +void EmuInstallPatches(); +void* GetPatchedFunctionTrampoline(std::string functionName); + +#endif diff --git a/src/CxbxKrnl/EmuXactEng.cpp b/src/core/hle/XACTENG/XactEng.cpp similarity index 93% rename from src/CxbxKrnl/EmuXactEng.cpp rename to src/core/hle/XACTENG/XactEng.cpp index 911ba235d..4e6b8ca5f 100644 --- a/src/CxbxKrnl/EmuXactEng.cpp +++ b/src/core/hle/XACTENG/XactEng.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXactEng.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,9 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "XACT" +#define LOG_PREFIX CXBXR_MODULE::XACT // prevent name collisions namespace xboxkrnl @@ -43,13 +33,12 @@ namespace xboxkrnl #include }; -#include "CxbxKrnl.h" -#include "Logging.h" -#include "Emu.h" -#include "EmuFS.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "common\Logging.h" +#include "core\kernel\support\Emu.h" #include "EmuShared.h" -#include "EmuXTL.h" -#include "VMManager.h" +#include "core\hle\XACTENG\XactEng.h" +#include "core\kernel\memory-manager\VMManager.h" #include #include @@ -73,8 +62,6 @@ HRESULT WINAPI XTL::EMUPATCH(XACTEngineCreate) X_XACTEngine** ppEngine ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pParams) LOG_FUNC_ARG(ppEngine) @@ -94,8 +81,6 @@ HRESULT WINAPI XTL::EMUPATCH(XACTEngineCreate) // ****************************************************************** void WINAPI XTL::EMUPATCH(XACTEngineDoWork)() { - //FUNC_EXPORTS - LOG_FUNC(); // TODO: Anything else required here? @@ -119,8 +104,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_RegisterWaveBank) X_XACTWaveBank** ppWaveBank ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pvData) @@ -145,8 +128,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_RegisterStreamedWaveBank) X_XACTWaveBank** ppWaveBank ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pParams) @@ -171,8 +152,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_CreateSoundBank) X_XACTSoundBank** ppSoundBank ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pvData) @@ -199,8 +178,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_DownloadEffectsImage) LPVOID* ppImageDesc ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pvData) @@ -224,8 +201,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_CreateSoundSource) X_XACTSoundSource** ppSoundSource ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(dwFlags) @@ -246,8 +221,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_EnableHeadphones) BOOL fEnabled ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(fEnabled) @@ -271,8 +244,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_SetListenerOrientation) DWORD dwApply ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(xFront) @@ -299,8 +270,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_SetListenerPosition) DWORD dwApply ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(x) @@ -324,8 +293,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_SetListenerVelocity) DWORD dwApply ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(x) @@ -347,8 +314,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_SetMasterVolume) LONG lVolume ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(wCategory) @@ -366,8 +331,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_CommitDeferredSettings) X_XACTEngine* pThis ) { - //FUNC_EXPORTS - LOG_FUNC_ONE_ARG(pThis); RETURN(S_OK); @@ -383,8 +346,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTSoundBank_GetSoundCueIndexFromFriendlyName) DWORD* pdwSoundCueIndex ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pFriendlyName) @@ -406,8 +367,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTSoundBank_Play) X_XACTSoundCue** ppSoundCue ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(dwSoundCueIndex) @@ -430,8 +389,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTSoundBank_Stop) X_XACTSoundCue* pSoundCue ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(dwSoundCueIndex) @@ -454,8 +411,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTSoundSource_SetPosition) DWORD dwApply ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(x) @@ -479,8 +434,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTSoundSource_SetVelocity) DWORD dwApply ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(x) @@ -501,8 +454,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_RegisterNotification) PCXACT_NOTIFICATION_DESCRIPTION pNotificationDesc ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pNotificationDesc) @@ -521,8 +472,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_GetNotification) LPVOID pNotification ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pNotificationDesc) @@ -544,8 +493,6 @@ HRESULT WINAPI XTL::EMUPATCH(IXACTEngine_UnRegisterWaveBank) X_XACTWaveBank* pWaveBank ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pThis) LOG_FUNC_ARG(pWaveBank) diff --git a/src/CxbxKrnl/EmuXactEng.h b/src/core/hle/XACTENG/XactEng.h similarity index 96% rename from src/CxbxKrnl/EmuXactEng.h rename to src/core/hle/XACTENG/XactEng.h index 63ac302e4..81a4e74c2 100644 --- a/src/CxbxKrnl/EmuXactEng.h +++ b/src/core/hle/XACTENG/XactEng.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXactEng.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,13 +25,15 @@ #ifndef EMUXACTENG_H #define EMUXACTENG_H -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" +#include "core\hle\XAPI\Xapi.h" // For EMUPATCH #undef FIELD_OFFSET // prevent macro redefinition warnings #include #include +namespace XTL { // ****************************************************************** // * XACT Interfaces @@ -352,4 +345,6 @@ HRESULT WINAPI EMUPATCH(IXACTEngine_UnRegisterWaveBank) X_XACTWaveBank* pWaveBank ); -#endif \ No newline at end of file +} // end of namespace XTL + +#endif diff --git a/src/core/hle/XAPI/Xapi.cpp b/src/core/hle/XAPI/Xapi.cpp new file mode 100644 index 000000000..33db5ef03 --- /dev/null +++ b/src/core/hle/XAPI/Xapi.cpp @@ -0,0 +1,1469 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** + +#define LOG_PREFIX CXBXR_MODULE::XAPI + +#undef FIELD_OFFSET // prevent macro redefinition warnings +/* prevent name collisions */ +namespace xboxkrnl +{ + #include +}; + +#include "common\input\SdlJoystick.h" +#include "common\input\InputManager.h" +#include +#include "core\kernel\init\CxbxKrnl.h" +#include "Logging.h" +#include "core\kernel\support\Emu.h" +#include "core\kernel\exports\EmuKrnl.h" // For DefaultLaunchDataPage +#include "core\kernel\support\EmuFile.h" +#include "EmuShared.h" +#include "core\hle\Intercept.hpp" +#include "vsbc\CxbxVSBC.h" +#include "Windef.h" +#include +#include "core\hle\XAPI\Xapi.h" +#include "core\hle\XAPI\XapiCxbxr.h" + +bool g_bCxbxVSBCLoaded = false; +HINSTANCE g_module; +typedef int (FAR WINAPI *PFARPROC1)(int); +typedef int (FAR WINAPI *PFARPROC2)(UCHAR*); +typedef int (NEAR WINAPI *PNEARPROC1)(int); +typedef int (NEAR WINAPI *PNEARPROC2)(UCHAR*); +typedef int (WINAPI *PPROC)(); + +PFARPROC2 fnCxbxVSBCSetState; +PFARPROC2 fnCxbxVSBCGetState; +PFARPROC1 fnCxbxVSBCOpen; +//typedef DWORD(*fnCxbxVSBCOpen)(HWND); +//typedef DWORD(*fnCxbxVSBCSetState)(UCHAR *); +//typedef DWORD(*fnCxbxVSBCGetState)(UCHAR *); +XTL::PXPP_DEVICE_TYPE g_DeviceType_Gamepad = nullptr; + +// Flag is unset after initialize devices is done by simulate LLE USB thread. +std::atomic g_bIsDevicesInitializing = true; +std::atomic g_bIsDevicesEmulating = false; + +//global bridge for xbox controller to host, 4 elements for 4 ports. +CXBX_CONTROLLER_HOST_BRIDGE g_XboxControllerHostBridge[4] = { + { NULL, PORT_INVALID, XBOX_INPUT_DEVICE::DEVICE_INVALID, nullptr, false, false, false, { 0, 0, 0, 0, 0 } }, + { NULL, PORT_INVALID, XBOX_INPUT_DEVICE::DEVICE_INVALID, nullptr, false, false, false, { 0, 0, 0, 0, 0 } }, + { NULL, PORT_INVALID, XBOX_INPUT_DEVICE::DEVICE_INVALID, nullptr, false, false, false, { 0, 0, 0, 0, 0 } }, + { NULL, PORT_INVALID, XBOX_INPUT_DEVICE::DEVICE_INVALID, nullptr, false, false, false, { 0, 0, 0, 0, 0 } }, +}; + + +bool operator==(XTL::PXPP_DEVICE_TYPE XppType, XBOX_INPUT_DEVICE XidType) +{ + switch (XidType) + { + case XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE: + case XBOX_INPUT_DEVICE::MS_CONTROLLER_S: { + if (XppType == g_DeviceType_Gamepad) { + return true; + } + } + break; + + case XBOX_INPUT_DEVICE::LIGHT_GUN: + case XBOX_INPUT_DEVICE::STEERING_WHEEL: + case XBOX_INPUT_DEVICE::MEMORY_UNIT: + case XBOX_INPUT_DEVICE::IR_DONGLE: + case XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER: + default: + break; + } + + return false; +} + +bool operator!=(XTL::PXPP_DEVICE_TYPE XppType, XBOX_INPUT_DEVICE XidType) +{ + return !(XppType == XidType); +} + +bool ConstructHleInputDevice(int Type, int Port) +{ + g_bIsDevicesEmulating = true; + bool ret = true; + + switch (Type) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): { + g_XboxControllerHostBridge[Port].XboxPort = Port; + g_XboxControllerHostBridge[Port].XboxType = XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE; + g_XboxControllerHostBridge[Port].InState = new XpadInput(); + g_XboxControllerHostBridge[Port].bPendingRemoval = false; + g_XboxControllerHostBridge[Port].bSignaled = false; + g_XboxControllerHostBridge[Port].bIoInProgress = false; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucType = XINPUT_DEVTYPE_GAMEPAD; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucSubType = XINPUT_DEVSUBTYPE_GC_GAMEPAD; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucInputStateSize = sizeof(XpadInput); + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucFeedbackSize = sizeof(XpadOutput); + g_XboxControllerHostBridge[Port].XboxDeviceInfo.dwPacketNumber = 0; + } + break; + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + g_XboxControllerHostBridge[Port].XboxPort = Port; + g_XboxControllerHostBridge[Port].XboxType = XBOX_INPUT_DEVICE::MS_CONTROLLER_S; + g_XboxControllerHostBridge[Port].InState = new XpadInput(); + g_XboxControllerHostBridge[Port].bPendingRemoval = false; + g_XboxControllerHostBridge[Port].bSignaled = false; + g_XboxControllerHostBridge[Port].bIoInProgress = false; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucType = XINPUT_DEVTYPE_GAMEPAD; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucSubType = XINPUT_DEVSUBTYPE_GC_GAMEPAD_ALT; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucInputStateSize = sizeof(XpadInput); + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucFeedbackSize = sizeof(XpadOutput); + g_XboxControllerHostBridge[Port].XboxDeviceInfo.dwPacketNumber = 0; + } + break; + case to_underlying(XBOX_INPUT_DEVICE::STEEL_BATTALION_CONTROLLER): { + // TODO + } + break; + + case to_underlying(XBOX_INPUT_DEVICE::LIGHT_GUN): + case to_underlying(XBOX_INPUT_DEVICE::STEERING_WHEEL): + case to_underlying(XBOX_INPUT_DEVICE::MEMORY_UNIT): + case to_underlying(XBOX_INPUT_DEVICE::IR_DONGLE): { + EmuLog(LOG_LEVEL::INFO, "%s: device %s is not yet supported", __func__, GetInputDeviceName(Type).c_str()); + ret = false; + } + break; + + default: + EmuLog(LOG_LEVEL::WARNING, "Attempted to attach an unknown device type (type was %d)", Type); + ret = false; + break; + } + + g_bIsDevicesEmulating = false; + return ret; +} + +void DestructHleInputDevice(int Port) +{ + g_bIsDevicesEmulating = true; + + g_XboxControllerHostBridge[Port].XboxType = XBOX_INPUT_DEVICE::DEVICE_INVALID; + g_XboxControllerHostBridge[Port].XboxPort = PORT_INVALID; + while (g_XboxControllerHostBridge[Port].bIoInProgress) {} + delete g_XboxControllerHostBridge[Port].InState; + g_XboxControllerHostBridge[Port].bPendingRemoval = false; + g_XboxControllerHostBridge[Port].bSignaled = false; + g_XboxControllerHostBridge[Port].bIoInProgress = false; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucType = 0; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucSubType = 0; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucInputStateSize = 0; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucFeedbackSize = 0; + g_XboxControllerHostBridge[Port].XboxDeviceInfo.dwPacketNumber = 0; + + g_bIsDevicesEmulating = false; +} + +void SetupXboxDeviceTypes() +{ + // If we don't yet have the offset to gDeviceType_Gamepad, work it out! + if (g_DeviceType_Gamepad == nullptr) { + // First, attempt to find GetTypeInformation + auto typeInformation = g_SymbolAddresses.find("GetTypeInformation"); + if (typeInformation != g_SymbolAddresses.end() && typeInformation->second != xbnull) { + printf("Deriving XDEVICE_TYPE_GAMEPAD from DeviceTable (via GetTypeInformation)\n"); + // Read the offset values of the device table structure from GetTypeInformation + xbaddr deviceTableStartOffset = *(uint32_t*)((uint32_t)typeInformation->second + 0x01); + xbaddr deviceTableEndOffset = *(uint32_t*)((uint32_t)typeInformation->second + 0x09); + + // Calculate the number of device entires in the table + size_t deviceTableEntryCount = (deviceTableEndOffset - deviceTableStartOffset) / sizeof(uint32_t); + + printf("DeviceTableStart: 0x%08X\n", deviceTableStartOffset); + printf("DeviceTableEnd: 0x%08X\n", deviceTableEndOffset); + printf("DeviceTable Entires: %u\n", deviceTableEntryCount); + + // Sanity check: Where all these device offsets within Xbox memory + if ((deviceTableStartOffset >= g_SystemMaxMemory) || (deviceTableEndOffset >= g_SystemMaxMemory)) { + CxbxKrnlCleanup("DeviceTable Location is outside of Xbox Memory range"); + } + + // Iterate through the table until we find gamepad + XTL::PXID_TYPE_INFORMATION* deviceTable = (XTL::PXID_TYPE_INFORMATION*)(deviceTableStartOffset); + for (unsigned int i = 0; i < deviceTableEntryCount; i++) { + // Skip empty table entries + if (deviceTable[i] == nullptr) { + continue; + } + + printf("----------------------------------------\n"); + printf("DeviceTable[%u]->ucType = %d\n", i, deviceTable[i]->ucType); + printf("DeviceTable[%u]->XppType = 0x%08X (", i, (uintptr_t)deviceTable[i]->XppType); + + switch (deviceTable[i]->ucType) { + case XINPUT_DEVTYPE_GAMEPAD: + g_DeviceType_Gamepad = deviceTable[i]->XppType; + printf("XDEVICE_TYPE_GAMEPAD)\n"); + break; + case XINPUT_DEVTYPE_STEELBATALION: + printf("XDEVICE_TYPE_STEELBATALION)\n"); + break; + default: + printf("Unknown device type)\n"); + continue; + } + } + } else { + // XDKs without GetTypeInformation have the GamePad address hardcoded in XInputOpen + // Only the earliest XDKs use this code path, and the offset never changed between them + // so this works well for us. + void* XInputOpenAddr = (void*)g_SymbolAddresses["XInputOpen"]; + if (XInputOpenAddr != nullptr) { + printf("XAPI: Deriving XDEVICE_TYPE_GAMEPAD from XInputOpen (0x%08X)\n", (uintptr_t)XInputOpenAddr); + g_DeviceType_Gamepad = *(XTL::PXPP_DEVICE_TYPE*)((uint32_t)XInputOpenAddr + 0x0B); + } + } + + if (g_DeviceType_Gamepad == nullptr) { + EmuLog(LOG_LEVEL::WARNING, "XDEVICE_TYPE_GAMEPAD was not found"); + return; + } + + printf("XAPI: XDEVICE_TYPE_GAMEPAD Found at 0x%08X\n", (uintptr_t)g_DeviceType_Gamepad); + } +} + +// ****************************************************************** +// * patch: XInitDevices +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XInitDevices) +( + DWORD dwPreallocTypeCount, + PXDEVICE_PREALLOC_TYPE PreallocTypes +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwPreallocTypeCount) + LOG_FUNC_ARG((DWORD)PreallocTypes) + LOG_FUNC_END; + + // TODO: May need to apply this delay update to LLE USB if modern hardware initialization is faster than og xbox hardware. + // Start initialize delay timer base on og xbox hardware's external thread process to finish initialize devices. + // Test cases: Lego Star Wars - Without delay timer will cause not to call the input polling even after devices are open. + // Panzer Dragoon ORTA - After called and within 500 milliseconds will cause unstable crash for the emulator. + std::thread([]() { + // Set initialize state. + g_bIsDevicesInitializing = true; + // Initialize devices take about less than half a second usually. + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + // Clear initialize state for allow application to see device changes. + g_bIsDevicesInitializing = false; + }).detach(); +} + +// This is called to emulate async for both XGetDevices and XGetDeviceChanges +void UpdateConnectedDeviceState(XTL::PXPP_DEVICE_TYPE DeviceType) { + + // Do not process the queries until initialize delay and device emulating are complete. + if (g_bIsDevicesInitializing || g_bIsDevicesEmulating){ + return; + } + + int Port, PortMask; + for (Port = PORT_1, PortMask = 1; Port <= PORT_4; Port++, PortMask <<= 1) { + if (DeviceType == g_XboxControllerHostBridge[Port].XboxType) { + if (!g_XboxControllerHostBridge[Port].bPendingRemoval) { + DeviceType->CurrentConnected |= PortMask; + } + else { + if (!g_XboxControllerHostBridge[Port].bSignaled) { + g_XboxControllerHostBridge[Port].bSignaled = true; + SDL_Event DeviceRemoveEvent; + SDL_memset(&DeviceRemoveEvent, 0, sizeof(SDL_Event)); + DeviceRemoveEvent.type = Sdl::DeviceRemoveAck_t; + DeviceRemoveEvent.user.data1 = new int(Port); + SDL_PushEvent(&DeviceRemoveEvent); + } + DeviceType->CurrentConnected &= ~PortMask; + } + } + else { + DeviceType->CurrentConnected &= ~PortMask; + } + } + DeviceType->ChangeConnected = DeviceType->PreviousConnected ^ DeviceType->CurrentConnected; +} + +// ****************************************************************** +// * patch: XGetDevices +// * Note: This could be unpatched however, +// * XInitDevices is required to be unpatched first. +// * This in turn requires USB LLE to be implemented, or USBD_Init +// * patched with a stub, so this patch is still enabled for now +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XGetDevices) +( + PXPP_DEVICE_TYPE DeviceType +) +{ + LOG_FUNC_ONE_ARG(DeviceType); + + UpdateConnectedDeviceState(DeviceType); + + UCHAR oldIrql = xboxkrnl::KeRaiseIrqlToDpcLevel(); + + DWORD ret = DeviceType->CurrentConnected; + + DeviceType->ChangeConnected = 0; + DeviceType->PreviousConnected = DeviceType->CurrentConnected; + + xboxkrnl::KfLowerIrql(oldIrql); + + RETURN(ret); +} + +// ****************************************************************** +// * patch: XGetDeviceChanges +// * Note: This could be unpatched however, +// * XInitDevices is required to be unpatched first. +// * This in turn requires USB LLE to be implemented, or USBD_Init +// * patched with a stub, so this patch is still enabled for now +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(XGetDeviceChanges) +( + PXPP_DEVICE_TYPE DeviceType, + PDWORD pdwInsertions, + PDWORD pdwRemovals +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(DeviceType) + LOG_FUNC_ARG(pdwInsertions) + LOG_FUNC_ARG(pdwRemovals) + LOG_FUNC_END; + + UpdateConnectedDeviceState(DeviceType); + + BOOL ret = FALSE; + + + if(!DeviceType->ChangeConnected) + { + *pdwInsertions = 0; + *pdwRemovals = 0; + } + else + { + UCHAR oldIrql = xboxkrnl::KeRaiseIrqlToDpcLevel(); + + // Insertions and removals + *pdwInsertions = (DeviceType->CurrentConnected & ~DeviceType->PreviousConnected); + *pdwRemovals = (DeviceType->PreviousConnected & ~DeviceType->CurrentConnected); + + // Detect devices that were removed and then immediately inserted again + ULONG RemoveInsert = DeviceType->ChangeConnected & + DeviceType->CurrentConnected & + DeviceType->PreviousConnected; + *pdwRemovals |= RemoveInsert; + *pdwInsertions |= RemoveInsert; + + DeviceType->ChangeConnected = 0; + DeviceType->PreviousConnected = DeviceType->CurrentConnected; + ret = (*pdwInsertions | *pdwRemovals) ? TRUE : FALSE; + + xboxkrnl::KfLowerIrql(oldIrql); + } + + RETURN(ret); +} + +// ****************************************************************** +// * patch: XInputOpen +// ****************************************************************** +HANDLE WINAPI XTL::EMUPATCH(XInputOpen) +( + IN PXPP_DEVICE_TYPE DeviceType, + IN DWORD dwPort, + IN DWORD dwSlot, + IN PXINPUT_POLLING_PARAMETERS pPollingParameters OPTIONAL +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(DeviceType) + LOG_FUNC_ARG(dwPort) + LOG_FUNC_ARG(dwSlot) + LOG_FUNC_ARG(pPollingParameters) + LOG_FUNC_END; + + if (dwPort >= PORT_1 && dwPort <= PORT_4) { + if (DeviceType == g_XboxControllerHostBridge[dwPort].XboxType) { +#if 0 // TODO + if(g_XboxControllerHostBridge[dwPort].dwHostType==X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC){ + //if DLL not loaded yet, load it. + if (g_bCxbxVSBCLoaded != true) { + + g_module = LoadLibrary(TEXT("CxbxVSBC.dll")); + if (g_module != 0) { + g_bCxbxVSBCLoaded = true; + } + } + if(g_module!=0&& fnCxbxVSBCOpen==0){ + fnCxbxVSBCSetState = (PFARPROC2)GetProcAddress(g_module, "VSBCSetState"); + fnCxbxVSBCGetState = (PFARPROC2)GetProcAddress(g_module, "VSBCGetState"); + fnCxbxVSBCOpen = (PFARPROC1)GetProcAddress(g_module, "VSBCOpen"); + } + + if (fnCxbxVSBCOpen == 0) { + printf("EmuXapi: EmuXInputOpen: GetPRocAddress VSBCOpen failed!\n"); + } + else { + (*fnCxbxVSBCOpen)(X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC); + } + //DWORD dwVXBCOpenResult = CxbxVSBC::MyCxbxVSBC::VSBCOpen(X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC); + + } +#endif + g_XboxControllerHostBridge[dwPort].hXboxDevice = &g_XboxControllerHostBridge[dwPort]; + RETURN(g_XboxControllerHostBridge[dwPort].hXboxDevice); + } + + } + + RETURN(NULL); +} + +// ****************************************************************** +// * patch: XInputClose +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XInputClose) +( + IN HANDLE hDevice +) +{ + LOG_FUNC_ONE_ARG(hDevice); + + PCXBX_CONTROLLER_HOST_BRIDGE Device = (PCXBX_CONTROLLER_HOST_BRIDGE)hDevice; + int Port = Device->XboxPort; + if (g_XboxControllerHostBridge[Port].hXboxDevice == hDevice) { + Device->hXboxDevice = NULL; + } +} + +// ****************************************************************** +// * patch: XInputPoll +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XInputPoll) +( + IN HANDLE hDevice +) +{ + LOG_FUNC_ONE_ARG(hDevice); + + // Nothing to do + + RETURN(ERROR_SUCCESS); +} + +// ****************************************************************** +// * patch: XInputGetCapabilities +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XInputGetCapabilities) +( + IN HANDLE hDevice, + OUT PXINPUT_CAPABILITIES pCapabilities +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hDevice) + LOG_FUNC_ARG_OUT(pCapabilities) + LOG_FUNC_END; + + DWORD ret = ERROR_DEVICE_NOT_CONNECTED; + PCXBX_CONTROLLER_HOST_BRIDGE Device = (PCXBX_CONTROLLER_HOST_BRIDGE)hDevice; + int Port = Device->XboxPort; + if (g_XboxControllerHostBridge[Port].hXboxDevice == hDevice && !g_XboxControllerHostBridge[Port].bPendingRemoval) { + pCapabilities->SubType = g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucSubType; + UCHAR* pCap = (UCHAR*)(&pCapabilities->In); + memset(pCap, 0xFF, g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucInputStateSize + g_XboxControllerHostBridge[Port].XboxDeviceInfo.ucFeedbackSize); + ret = ERROR_SUCCESS; + } + + RETURN(ret); +} + +//variable names correlated to X_SBC_FEEDBACK, mapped to each nibble accordingly. +char * XboxSBCFeedbackNames[] = { + "EmergencyEject", + "CockpitHatch", + "Ignition", + "Start", + "OpenClose", + "MapZoomInOut", + "ModeSelect", + "SubMonitorModeSelect", + "MainMonitorZoomIn", + "MainMonitorZoomOut", + "ForecastShootingSystem", + "Manipulator", + "LineColorChange", + "Washing", + "Extinguisher", + "Chaff", + "TankDetach", + "Override", + "NightScope", + "F1", + "F2", + "F3", + "MainWeaponControl", + "SubWeaponControl", + "MagazineChange", + "Comm1", + "Comm2", + "Comm3", + "Comm4", + "Comm5", + "Unknown", + "GearR", + "GearN", + "Gear1", + "Gear2", + "Gear3", + "Gear4", + "Gear5" +}; + +//keep last SBC_GAMEPAD status, for DIP switch and GearLever +XTL::X_SBC_GAMEPAD XboxSBCGamepad = {}; + +//virtual SteelBatalion controller GetState, using port 0 from XInput and DirectInput to emulate virtual controller. +void EmuSBCGetState(XTL::PX_SBC_GAMEPAD pSBCGamepad, XTL::PXINPUT_GAMEPAD pXIGamepad, XTL::PXINPUT_GAMEPAD pDIGamepad) +{ + // Now convert those values to SteelBatalion Gamepad + + //restore certain variables such as GerLever and Toggle Switches. + + //restore the kept ucGearLever + pSBCGamepad->ucGearLever = XboxSBCGamepad.ucGearLever; + //we use continues range 7~13, 8 for gear N. + if (pSBCGamepad->ucGearLever < 7 || pSBCGamepad->ucGearLever>13) { + pSBCGamepad->ucGearLever = 8; + } + + //restore Toggle Switches. + pSBCGamepad->wButtons[0] |= (XboxSBCGamepad.wButtons[0] & (CXBX_SBC_GAMEPAD_W0_COCKPITHATCH | CXBX_SBC_GAMEPAD_W0_IGNITION)); + + pSBCGamepad->wButtons[2] |= (XboxSBCGamepad.wButtons[2]&( CXBX_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL + | CXBX_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY + | CXBX_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE + | CXBX_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL + | CXBX_SBC_GAMEPAD_W2_TOGGLEVTLOCATION)); + + + // Analog Sticks + pSBCGamepad->sAimingX = pXIGamepad->sThumbRX; + pSBCGamepad->sAimingY = pXIGamepad->sThumbRY; + pSBCGamepad->sRotationLever = 0;//(pXIGamepad->wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) ? 255 : 0; + pSBCGamepad->sSightChangeX = pXIGamepad->sThumbLX; + pSBCGamepad->sSightChangeY = pXIGamepad->sThumbLY; + pSBCGamepad->wLeftPedal = ((SHORT)(pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_LEFT_TRIGGER]))<<8; + pSBCGamepad->wMiddlePedal=0;// = (pXIGamepad->wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) ? 255 : 0; + pSBCGamepad->wRightPedal = (SHORT)(pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_RIGHT_TRIGGER])<<8; + pSBCGamepad->ucTunerDial=0;//low nibble + + + // Digital Buttons + if (pXIGamepad->bAnalogButtons [CXBX_XINPUT_GAMEPAD_A]>0) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON; + } + if (pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_B]>0) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_RIGHTJOYFIRE; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_RIGHTJOYFIRE; + } + if (pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_X]>0) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_RIGHTJOYLOCKON; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_RIGHTJOYLOCKON; + } + if (pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_Y]>0) { + pSBCGamepad->wButtons[1] |= CXBX_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE; + } + else { + pSBCGamepad->wButtons[1] &= ~CXBX_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE; + } + + //GearLever 1~5 for gear 1~5, 7~13 for gear R,N,1~5, 15 for gear R. we use the continues range from 7~13 + if (pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_WHITE]>0) {//Left Shouder, Gear Down + if (pSBCGamepad->ucGearLever >7) { + pSBCGamepad->ucGearLever-- ; + } + } + + if (pXIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_BLACK]>0) {//Right Shouder, Gear Up + if (pSBCGamepad->ucGearLever < 13) { + pSBCGamepad->ucGearLever ++; + } + } + //OLD_XINPUT + /* //not used, don't duplicate the handling for same setting of pXIGamepad's members, later one will over write privous one. + if (pXIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_START) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_START; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_START; + } + */ + if (pXIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_LEFT_THUMB) {//Center Sight Change + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE; + } + else { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE; + } + //OLD_XINPUT + /* //not used + if (pXIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_RIGHT_THUMB) { + pSBCGamepad->wButtons |= CXBX_XINPUT_GAMEPAD_RIGHT_THUMB; + } + else { + pSBCGamepad->wButtons &= ~CXBX_XINPUT_GAMEPAD_RIGHT_THUMB; + } + */ + + + //additional input from 2nd input, default using directinput + if (pDIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_A]>0) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_START; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_START; + } + // Iginition is Toggle Switch + if (pDIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_B]>0) { + if (pSBCGamepad->wButtons[0] & CXBX_SBC_GAMEPAD_W0_IGNITION) { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_IGNITION; + } + else { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_IGNITION; + } + } + + if (pDIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_X]>0) { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_EJECT; + } + else { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_EJECT; + } + // CockpitHatch is Toggle Switch + if (pDIGamepad->bAnalogButtons[CXBX_XINPUT_GAMEPAD_Y]>0) { + if (pSBCGamepad->wButtons[0] & CXBX_SBC_GAMEPAD_W0_COCKPITHATCH) { + pSBCGamepad->wButtons[0] &= ~CXBX_SBC_GAMEPAD_W0_COCKPITHATCH; + } + else { + pSBCGamepad->wButtons[0] |= CXBX_SBC_GAMEPAD_W0_COCKPITHATCH; + } + } + + if (pDIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_BACK) {//Toggle Switch ToggleFilterControl + if (pSBCGamepad->wButtons[2] & CXBX_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL) { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL; + } + else { + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL; + } + } + + if (pDIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_DPAD_UP) {//Toggle Switch ToggleOxygenSupply + if (pSBCGamepad->wButtons[2] & CXBX_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY) { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY; + } + else { + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY; + } + } + + if (pDIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_DPAD_DOWN) {//Toggle Switch ToggleBuffreMaterial + if (pSBCGamepad->wButtons[2] & CXBX_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL) { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL; + } + else { + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL; + } + } + + if (pDIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_DPAD_LEFT) {//Toggle Switch ToggleVTLocation + if (pSBCGamepad->wButtons[2] & CXBX_SBC_GAMEPAD_W2_TOGGLEVTLOCATION) { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_TOGGLEVTLOCATION; + } + else { + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_TOGGLEVTLOCATION; + } + } + + if (pDIGamepad->wButtons & CXBX_XINPUT_GAMEPAD_DPAD_RIGHT) {//Toggle Switch ToggleFuelFlowRate + if (pSBCGamepad->wButtons[2] & CXBX_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE) { + pSBCGamepad->wButtons[2] &= ~CXBX_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE; + } + else { + pSBCGamepad->wButtons[2] |= CXBX_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE; + } + } + //reserve the SBCGamepad to keep the status of GearLever and Toggole Switches. + XboxSBCGamepad = *pSBCGamepad; +} +// ****************************************************************** +// * patch: XInputGetState +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XInputGetState) +( + IN HANDLE hDevice, + OUT PXINPUT_STATE pState +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hDevice) + LOG_FUNC_ARG_OUT(pState) + LOG_FUNC_END; + + DWORD ret = ERROR_DEVICE_NOT_CONNECTED; + PCXBX_CONTROLLER_HOST_BRIDGE Device = (PCXBX_CONTROLLER_HOST_BRIDGE)hDevice; + int Port = Device->XboxPort; + if (g_XboxControllerHostBridge[Port].hXboxDevice == hDevice) { + if (!g_XboxControllerHostBridge[Port].bPendingRemoval) { + g_XboxControllerHostBridge[Port].bIoInProgress = true; + if (g_InputDeviceManager.UpdateXboxPortInput(Port, g_XboxControllerHostBridge[Port].InState, DIRECTION_IN, to_underlying(g_XboxControllerHostBridge[Port].XboxType))) { + pState->dwPacketNumber = g_XboxControllerHostBridge[Port].XboxDeviceInfo.dwPacketNumber++; + } + memcpy((void*)&pState->Gamepad, g_XboxControllerHostBridge[Port].InState, sizeof(pState->Gamepad)); + g_XboxControllerHostBridge[Port].bIoInProgress = false; + ret = ERROR_SUCCESS; + } + } + + RETURN(ret); +} + +// ****************************************************************** +// * patch: XInputSetState +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XInputSetState) +( + IN HANDLE hDevice, + IN OUT PXINPUT_FEEDBACK pFeedback +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hDevice) + LOG_FUNC_ARG(pFeedback) + LOG_FUNC_END; + + PCXBX_CONTROLLER_HOST_BRIDGE Device = (PCXBX_CONTROLLER_HOST_BRIDGE)hDevice; + int Port = Device->XboxPort; + if (g_XboxControllerHostBridge[Port].hXboxDevice == hDevice && !g_XboxControllerHostBridge[Port].bPendingRemoval) { + pFeedback->Header.dwStatus = ERROR_IO_PENDING; + g_InputDeviceManager.UpdateXboxPortInput(Port, (void*)&pFeedback->Rumble, DIRECTION_OUT, to_underlying(g_XboxControllerHostBridge[Port].XboxType)); + pFeedback->Header.dwStatus = ERROR_SUCCESS; + if (pFeedback->Header.hEvent != NULL && + ObReferenceObjectByHandle(pFeedback->Header.hEvent, &xboxkrnl::ExEventObjectType, (PVOID*)&pFeedback->Header.IoCompletedEvent) == ERROR_SUCCESS) { + KeSetEvent((xboxkrnl::PKEVENT)pFeedback->Header.IoCompletedEvent, NULL, FALSE); + } + } + else { + pFeedback->Header.dwStatus = ERROR_DEVICE_NOT_CONNECTED; + } + + RETURN(pFeedback->Header.dwStatus); +} + + +// ****************************************************************** +// * patch: SetThreadPriorityBoost +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(SetThreadPriorityBoost) +( + HANDLE hThread, + BOOL DisablePriorityBoost +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hThread) + LOG_FUNC_ARG(DisablePriorityBoost) + LOG_FUNC_END; + + BOOL bRet = SetThreadPriorityBoost(hThread, DisablePriorityBoost); + + if(bRet == FALSE) + EmuLog(LOG_LEVEL::WARNING, "SetThreadPriorityBoost Failed!"); + + RETURN(bRet); +} + +// ****************************************************************** +// * patch: SetThreadPriority +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(SetThreadPriority) +( + HANDLE hThread, + int nPriority +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hThread) + LOG_FUNC_ARG(nPriority) + LOG_FUNC_END; + + BOOL bRet = SetThreadPriority(hThread, nPriority); + + if(bRet == FALSE) + EmuLog(LOG_LEVEL::WARNING, "SetThreadPriority Failed!"); + + RETURN(bRet); +} + + +// ****************************************************************** +// * patch: GetThreadPriority +// ****************************************************************** +int WINAPI XTL::EMUPATCH(GetThreadPriority) +( + HANDLE hThread +) +{ + + + LOG_FUNC_ONE_ARG(hThread); + + int iRet = GetThreadPriority(hThread); + + if(iRet == THREAD_PRIORITY_ERROR_RETURN) + EmuLog(LOG_LEVEL::WARNING, "GetThreadPriority Failed!"); + + RETURN(iRet); +} + +// ****************************************************************** +// * patch: GetExitCodeThread +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(GetExitCodeThread) +( + HANDLE hThread, + LPDWORD lpExitCode +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hThread) + LOG_FUNC_ARG(lpExitCode) + LOG_FUNC_END; + + BOOL bRet = GetExitCodeThread(hThread, lpExitCode); + + RETURN(bRet); +} + +// ****************************************************************** +// * patch: XapiThreadStartup +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XapiThreadStartup) +( + DWORD dwDummy1, + DWORD dwDummy2 +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwDummy1) + LOG_FUNC_ARG(dwDummy2) + LOG_FUNC_END; + + typedef int (__stdcall *pfDummyFunc)(DWORD dwDummy); + + pfDummyFunc func = (pfDummyFunc)dwDummy1; + + func(dwDummy2); + + // TODO: Call thread notify routines ? + + /* + __asm + { + push dwDummy2 + call dwDummy1 + } + */ + + //_asm int 3; +} + +// ****************************************************************** +// * patch: XRegisterThreadNotifyRoutine +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XRegisterThreadNotifyRoutine) +( + PXTHREAD_NOTIFICATION pThreadNotification, + BOOL fRegister +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pThreadNotification) + LOG_FUNC_ARG(fRegister) + LOG_FUNC_END; + + if(fRegister) + { + // I honestly don't expect this to happen, but if it does... + if(g_iThreadNotificationCount >= 16) + CxbxKrnlCleanup("Too many thread notification routines installed\n"); + + // Find an empty spot in the thread notification array + for(int i = 0; i < 16; i++) + { + // If we find one, then add it to the array, and break the loop so + // that we don't accidently register the same routine twice! + if(g_pfnThreadNotification[i] == NULL) + { + g_pfnThreadNotification[i] = (PVOID)pThreadNotification->pfnNotifyRoutine; + g_iThreadNotificationCount++; + break; + } + } + } + else + { + // Go through each routine and nullify the routine passed in. + for(int i = 0; i < 16; i++) + { + if(pThreadNotification->pfnNotifyRoutine == g_pfnThreadNotification[i]) + { + g_pfnThreadNotification[i] = NULL; + g_iThreadNotificationCount--; + break; + } + } + } +} + +typedef struct { + LPFIBER_START_ROUTINE lpStartRoutine; + LPVOID lpParameter; +} fiber_context_t; + +void WINAPI EmuFiberStartup(fiber_context_t* context) +{ + __try + { + LPFIBER_START_ROUTINE pfStartRoutine = (LPFIBER_START_ROUTINE)context->lpStartRoutine; + pfStartRoutine(context->lpParameter); + } + __except (EmuException(GetExceptionInformation())) + { + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter"); + } +} + +// ****************************************************************** +// * patch: CreateFiber +// ****************************************************************** +LPVOID WINAPI XTL::EMUPATCH(CreateFiber) +( + DWORD dwStackSize, + LPFIBER_START_ROUTINE lpStartRoutine, + LPVOID lpParameter +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwStackSize) + LOG_FUNC_ARG((PVOID)lpStartRoutine) + LOG_FUNC_ARG(lpParameter) + LOG_FUNC_END; + + // Create a Fiber Context: This has to be malloced because if it goes out of scope + // between CreateFiber and SwitchToFiber, it will cause a crash + // WARNING: Currently this leaks memory, can be fixed by tracking fibers and freeing them in DeleteFiber + fiber_context_t* context = (fiber_context_t*)malloc(sizeof(fiber_context_t)); + context->lpStartRoutine = lpStartRoutine; + context->lpParameter = lpParameter; + + RETURN(CreateFiber(dwStackSize, (LPFIBER_START_ROUTINE)EmuFiberStartup, context)); +} + +// ****************************************************************** +// * patch: DeleteFiber +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(DeleteFiber) +( + LPVOID lpFiber +) +{ + + LOG_FUNC_ONE_ARG((DWORD)DeleteFiber); + + DeleteFiber(lpFiber); +} + +// ****************************************************************** +// * patch: SwitchToFiber +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(SwitchToFiber) +( + LPVOID lpFiber +) +{ + + LOG_FUNC_ONE_ARG(lpFiber); + + SwitchToFiber(lpFiber); +} + +// ****************************************************************** +// * patch: ConvertThreadToFiber +// ****************************************************************** +LPVOID WINAPI XTL::EMUPATCH(ConvertThreadToFiber) +( + LPVOID lpParameter +) +{ + + LOG_FUNC_ONE_ARG(lpParameter); + + LPVOID pRet = ConvertThreadToFiber(lpParameter); + + RETURN(pRet); +} + +// ****************************************************************** +// * patch: QueueUserAPC +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(QueueUserAPC) +( + PAPCFUNC pfnAPC, + HANDLE hThread, + DWORD dwData +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG_TYPE(PVOID, pfnAPC) + LOG_FUNC_ARG(hThread) + LOG_FUNC_ARG(dwData) + LOG_FUNC_END; + + DWORD dwRet = 0; + + // If necessary, we can just continue to emulate NtQueueApcThread (0xCE). + // I added this because NtQueueApcThread fails in Metal Slug 3. + + HANDLE hApcThread = NULL; + if(!DuplicateHandle(g_CurrentProcessHandle, hThread, g_CurrentProcessHandle, &hApcThread, THREAD_SET_CONTEXT,FALSE,0)) + EmuLog(LOG_LEVEL::WARNING, "DuplicateHandle failed!"); + + dwRet = QueueUserAPC(pfnAPC, hApcThread, dwData); + if(!dwRet) + EmuLog(LOG_LEVEL::WARNING, "QueueUserAPC failed!"); + + RETURN(dwRet); +} + +#if 0 // Handled by WaitForSingleObject +// ****************************************************************** +// * patch: GetOverlappedResult +// ****************************************************************** +BOOL WINAPI XTL::EMUPATCH(GetOverlappedResult) +( + HANDLE hFile, + LPOVERLAPPED lpOverlapped, + LPDWORD lpNumberOfBytesTransferred, + BOOL bWait +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hFile) + LOG_FUNC_ARG(lpOverlapped) + LOG_FUNC_ARG(lpNumberOfBytesTransferred) + LOG_FUNC_ARG(bWait) + LOG_FUNC_END; + + BOOL bRet = GetOverlappedResult( hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait ); + +// if(bWait) +// bRet = TRUE; // Sucker... + + RETURN(bRet); +} +#endif + +// ****************************************************************** +// * patch: XLaunchNewImageA +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XLaunchNewImageA) +( + LPCSTR lpTitlePath, + PLAUNCH_DATA pLaunchData +) +{ + // Note : This can be tested using "Innocent tears", + // which relaunches different xbes between scenes; + // One for menus, one for fmvs, etc. + // + // Other titles do this too (like "DOA2 Ultimate", + // and probably "Panzer Dragoon Orta"), but these + // titles don't come this far as-of yet. + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(lpTitlePath) + LOG_FUNC_ARG(pLaunchData) + LOG_FUNC_END; + + // TODO : This patch can be removed once NtOpenSymbolicLinkObject() + // and NtQuerySymbolicLinkObject() work together correctly. + // Also, XLaunchNewImageA() depends on XeImageHeader() and uses + // XWriteTitleInfoAndReboot() and indirectly XWriteTitleInfoNoReboot() + + // Update the kernel's LaunchDataPage : + { + if (xboxkrnl::LaunchDataPage == xbnullptr) + { + PVOID LaunchDataVAddr = xboxkrnl::MmAllocateContiguousMemory(sizeof(xboxkrnl::LAUNCH_DATA_PAGE)); + if (!LaunchDataVAddr) + { + RETURN(STATUS_NO_MEMORY); + } + xboxkrnl::LaunchDataPage = (xboxkrnl::LAUNCH_DATA_PAGE*)LaunchDataVAddr; + } + + xboxkrnl::LaunchDataPage->Header.dwTitleId = g_pCertificate->dwTitleId; + xboxkrnl::LaunchDataPage->Header.dwFlags = 0; // TODO : What to put in here? + xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_TITLE; + + xboxkrnl::MmPersistContiguousMemory((PVOID)xboxkrnl::LaunchDataPage, PAGE_SIZE, TRUE); + + if (pLaunchData != xbnullptr) + // Save the launch data + memcpy(&(xboxkrnl::LaunchDataPage->LaunchData[0]), pLaunchData, sizeof(LAUNCH_DATA)); + + if (lpTitlePath == xbnullptr) + { + // If no path is specified, then the xbe is rebooting to dashboard + char szDashboardPath[MAX_PATH] = { 0 }; + XboxDevice* rootDevice = CxbxDeviceByDevicePath(DeviceHarddisk0Partition2); + if (rootDevice != nullptr) + sprintf(szDashboardPath, "%s\\xboxdash.xbe", rootDevice->HostDevicePath.c_str()); + + if (PathFileExists(szDashboardPath)) + { + MessageBox(CxbxKrnl_hEmuParent, "The title is rebooting to dashboard", "Cxbx-Reloaded", 0); + lpTitlePath = "C:\\xboxdash.xbe"; + xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_FROM_DASHBOARD; + // Other options include LDT_NONE, LDT_FROM_DEBUGGER_CMDLINE and LDT_FROM_UPDATE + } + else + CxbxKrnlCleanup("The xbe rebooted to Dashboard and xboxdash.xbe could not be found"); + } + + strncpy(&(xboxkrnl::LaunchDataPage->Header.szLaunchPath[0]), lpTitlePath, 520); + } + + // Note : While this patch exists, HalReturnToFirmware() calls + // MmPersistContiguousMemory on LaunchDataPage. When this + // patch on XLaunchNewImageA is removed, remove the call to + // MmPersistContiguousMemory from HalReturnToFirmware() too!! + + xboxkrnl::HalReturnToFirmware(xboxkrnl::ReturnFirmwareQuickReboot); + + // If this function succeeds, it doesn't get a chance to return anything. + RETURN(ERROR_GEN_FAILURE); +} + +#if 0 // patch disabled +// ****************************************************************** +// * patch: XGetLaunchInfo +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XGetLaunchInfo) +( + PDWORD pdwLaunchDataType, + PLAUNCH_DATA pLaunchData +) +{ + + + // TODO : This patch can be removed once we're sure all XAPI library + // functions indirectly reference our xboxkrnl::LaunchDataPage variable. + // For this, we need a test-case that hits this function, and run that + // with and without this patch enabled. Behavior should be identical. + // When this is verified, this patch can be removed. + LOG_TEST_CASE("Unpatching test needed"); + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pdwLaunchDataType) + LOG_FUNC_ARG(pLaunchData) + LOG_FUNC_END; + + DWORD ret = ERROR_NOT_FOUND; + + if (xboxkrnl::LaunchDataPage != NULL) + { + // Note : Here, CxbxRestoreLaunchDataPage() was already called, + // which has loaded LaunchDataPage from a binary file (if present). + + // A title can pass data only to itself, not another title (unless started from the dashboard, of course) : + if ( (xboxkrnl::LaunchDataPage->Header.dwTitleId == g_pCertificate->dwTitleId) + || (xboxkrnl::LaunchDataPage->Header.dwLaunchDataType == LDT_FROM_DASHBOARD) + || (xboxkrnl::LaunchDataPage->Header.dwLaunchDataType == LDT_FROM_DEBUGGER_CMDLINE)) + { + *pdwLaunchDataType = xboxkrnl::LaunchDataPage->Header.dwLaunchDataType; + memcpy(pLaunchData, &(xboxkrnl::LaunchDataPage->LaunchData[0]), sizeof(LAUNCH_DATA)); + + // Now that LaunchDataPage is retrieved by the emulated software, free it : + MmFreeContiguousMemory(xboxkrnl::LaunchDataPage); + xboxkrnl::LaunchDataPage = NULL; + + ret = ERROR_SUCCESS; + } + } + + RETURN(ret); +} +#endif + +// ****************************************************************** +// * patch: XSetProcessQuantumLength +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(XSetProcessQuantumLength) +( + DWORD dwMilliseconds +) +{ + + LOG_FUNC_ONE_ARG(dwMilliseconds); + + // TODO: Implement? + LOG_IGNORED(); +} + +// ****************************************************************** +// * patch: SignalObjectAndWait +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(SignalObjectAndWait) +( + HANDLE hObjectToSignal, + HANDLE hObjectToWaitOn, + DWORD dwMilliseconds, + BOOL bAlertable +) +{ + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hObjectToSignal) + LOG_FUNC_ARG(hObjectToWaitOn) + LOG_FUNC_ARG(dwMilliseconds) + LOG_FUNC_ARG(bAlertable) + LOG_FUNC_END; + + DWORD dwRet = SignalObjectAndWait( hObjectToSignal, hObjectToWaitOn, dwMilliseconds, bAlertable ); + + RETURN(dwRet); +} + +// ****************************************************************** +// * patch: timeSetEvent +// ****************************************************************** +MMRESULT WINAPI XTL::EMUPATCH(timeSetEvent) +( + UINT uDelay, + UINT uResolution, + LPTIMECALLBACK fptc, + DWORD dwUser, + UINT fuEvent +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(uDelay) + LOG_FUNC_ARG(uResolution) + LOG_FUNC_ARG_TYPE(PVOID, fptc) + LOG_FUNC_ARG(dwUser) + LOG_FUNC_ARG(fuEvent) + LOG_FUNC_END; + + MMRESULT Ret = timeSetEvent( uDelay, uResolution, fptc, (DWORD_PTR) dwUser, fuEvent ); + + RETURN(Ret); +} + +// ****************************************************************** +// * patch: timeKillEvent +// ****************************************************************** +MMRESULT WINAPI XTL::EMUPATCH(timeKillEvent) +( + UINT uTimerID +) +{ + + + LOG_FUNC_ONE_ARG(uTimerID); + + MMRESULT Ret = timeKillEvent( uTimerID ); + + RETURN(Ret); +} + +// ****************************************************************** +// * patch: RaiseException +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(RaiseException) +( + DWORD dwExceptionCode, // exception code + DWORD dwExceptionFlags, // continuable exception flag + DWORD nNumberOfArguments, // number of arguments + CONST ULONG_PTR *lpArguments // array of arguments +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwExceptionCode) + LOG_FUNC_ARG(dwExceptionFlags) + LOG_FUNC_ARG(nNumberOfArguments) + LOG_FUNC_ARG(lpArguments) + LOG_FUNC_END; + + // TODO: Implement or not? +// RaiseException(dwExceptionCode, dwExceptionFlags, nNumberOfArguments, (*(ULONG_PTR**) &lpArguments)); + + LOG_UNIMPLEMENTED(); +} + +// ****************************************************************** +// patch: XMountMUA +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XMountMUA) +( + DWORD dwPort, + DWORD dwSlot, + PCHAR pchDrive +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwPort) + LOG_FUNC_ARG(dwSlot) + LOG_FUNC_ARG(pchDrive) + LOG_FUNC_END; + + // TODO: Actually allow memory card emulation? This might make transferring + // game saves a bit easier if the memory card directory was configurable. =] + + RETURN(E_FAIL); +} + +// ****************************************************************** +// * patch: XGetDeviceEnumerationStatus +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XGetDeviceEnumerationStatus)() +{ + + + LOG_FUNC(); + + DWORD ret = (g_bIsDevicesInitializing || g_bIsDevicesEmulating) ? XDEVICE_ENUMERATION_BUSY : XDEVICE_ENUMERATION_IDLE; + + RETURN(ret); +} + +// ****************************************************************** +// * patch: XInputGetDeviceDescription +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XInputGetDeviceDescription) +( + HANDLE hDevice, + PVOID pDescription +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(hDevice) + LOG_FUNC_ARG(pDescription) + LOG_FUNC_END; + + // TODO: Lightgun support? + LOG_UNIMPLEMENTED(); + + RETURN(ERROR_NOT_SUPPORTED); // ERROR_DEVICE_NOT_CONNECTED; +} + +// ****************************************************************** +// * patch: XMountMURootA +// ****************************************************************** +DWORD WINAPI XTL::EMUPATCH(XMountMURootA) +( + DWORD dwPort, + DWORD dwSlot, + PCHAR pchDrive +) +{ + + + LOG_FUNC_BEGIN + LOG_FUNC_ARG(dwPort) + LOG_FUNC_ARG(dwSlot) + LOG_FUNC_ARG(pchDrive) + LOG_FUNC_END; + + // TODO: The params are probably wrong... + LOG_UNIMPLEMENTED(); + + RETURN(ERROR_SUCCESS); +} + +// ****************************************************************** +// * patch: OutputDebugStringA +// ****************************************************************** +VOID WINAPI XTL::EMUPATCH(OutputDebugStringA) +( + IN LPCSTR lpOutputString +) +{ + + LOG_FUNC_ONE_ARG(lpOutputString); + printf("OutputDebugStringA: %s\n", lpOutputString); +} diff --git a/src/CxbxKrnl/EmuXapi.h b/src/core/hle/XAPI/Xapi.h similarity index 67% rename from src/CxbxKrnl/EmuXapi.h rename to src/core/hle/XAPI/Xapi.h index ed45edc69..44abb2dd6 100644 --- a/src/CxbxKrnl/EmuXapi.h +++ b/src/core/hle/XAPI/Xapi.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXapi.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,8 +22,10 @@ // * All rights reserved // * // ****************************************************************** -#ifndef EMUXAPI_H -#define EMUXAPI_H +#ifndef XAPI_H +#define XAPI_H + +namespace XTL { // ****************************************************************** // * calling conventions @@ -80,8 +73,7 @@ typedef ACCESS_MASK *PACCESS_MASK; typedef LONG *LONG_PTR; typedef ULONG *ULONG_PTR; typedef INT_PTR *PINT_PTR; -// Workaround for MAXULONG_PTR: in XTL, ULONG_PTR is defined as a pointer type instead of being an integer -static constexpr unsigned int XTL_MAXULONG_PTR = ~((::ULONG_PTR)0); + #ifndef VOID #define VOID void #endif @@ -115,7 +107,7 @@ typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; // ****************************************************************** // * XINPUT_POLLING_PARAMETERS // ****************************************************************** -typedef struct _X_XINPUT_POLLING_PARAMETERS +typedef struct _XINPUT_POLLING_PARAMETERS { BYTE fAutoPoll : 1; BYTE fInterruptOut : 1; @@ -124,18 +116,7 @@ typedef struct _X_XINPUT_POLLING_PARAMETERS BYTE bOutputInterval; BYTE ReservedMBZ2; } -X_XINPUT_POLLING_PARAMETERS, *PX_XINPUT_POLLING_PARAMETERS; - -// ****************************************************************** -// * POLLING_PARAMETERS_HANDLE -// ****************************************************************** -typedef struct _X_POLLING_PARAMETERS_HANDLE -{ - X_XINPUT_POLLING_PARAMETERS *pPollingParameters; - - DWORD dwPort; -} -X_POLLING_PARAMETERS_HANDLE, *PX_POLLING_PARAMETERS_HANDLE; +XINPUT_POLLING_PARAMETERS, *PXINPUT_POLLING_PARAMETERS; // ****************************************************************** // * XPP_DEVICE_TYPE @@ -197,9 +178,9 @@ typedef struct _XDEVICE_PREALLOC_TYPE XDEVICE_PREALLOC_TYPE, *PXDEVICE_PREALLOC_TYPE; // ****************************************************************** -// * XINPUT_GAMEPAD for xbox, xbox's GAMEPAD struc differs from PC's +// * XINPUT_GAMEPAD for xbox, xbox's GAMEPAD struct differs from PC's // ****************************************************************** -typedef struct _X_XINPUT_GAMEPAD +typedef struct _XINPUT_GAMEPAD { WORD wButtons; BYTE bAnalogButtons[8]; @@ -208,7 +189,7 @@ typedef struct _X_XINPUT_GAMEPAD SHORT sThumbRX; SHORT sThumbRY; } -X_XINPUT_GAMEPAD, *PX_XINPUT_GAMEPAD; +XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; // ****************************************************************** // * X_SBC_GAMEPAD for xbox SteelBatalion GAMEPAD struc @@ -228,285 +209,107 @@ typedef struct _X_SBC_GAMEPAD { } X_SBC_GAMEPAD, *PX_SBC_GAMEPAD; -// ****************************************************************** -// * masks for digital buttons of X_SBC_GAMEPAD -// ****************************************************************** - -#define X_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON 0x0001 -#define X_SBC_GAMEPAD_W0_RIGHTJOYFIRE 0x0002 -#define X_SBC_GAMEPAD_W0_RIGHTJOYLOCKON 0x0004 -#define X_SBC_GAMEPAD_W0_EJECT 0x0008 -#define X_SBC_GAMEPAD_W0_COCKPITHATCH 0x0010 -#define X_SBC_GAMEPAD_W0_IGNITION 0x0020 -#define X_SBC_GAMEPAD_W0_START 0x0040 -#define X_SBC_GAMEPAD_W0_MULTIMONOPENCLOSE 0x0080 -#define X_SBC_GAMEPAD_W0_MULTIMONMAPZOOMINOUT 0x0100 -#define X_SBC_GAMEPAD_W0_MULTIMONMODESELECT 0x0200 -#define X_SBC_GAMEPAD_W0_MULTIMONSUBMONITOR 0x0400 -#define X_SBC_GAMEPAD_W0_MAINMONZOOMIN 0x0800 -#define X_SBC_GAMEPAD_W0_MAINMONZOOMOUT 0x1000 -#define X_SBC_GAMEPAD_W0_FUNCTIONFSS 0x2000 -#define X_SBC_GAMEPAD_W0_FUNCTIONMANIPULATOR 0x4000 -#define X_SBC_GAMEPAD_W0_FUNCTIONLINECOLORCHANGE 0x8000 -#define X_SBC_GAMEPAD_W1_WASHING 0x0001 -#define X_SBC_GAMEPAD_W1_EXTINGUISHER 0x0002 -#define X_SBC_GAMEPAD_W1_CHAFF 0x0004 -#define X_SBC_GAMEPAD_W1_FUNCTIONTANKDETACH 0x0008 -#define X_SBC_GAMEPAD_W1_FUNCTIONOVERRIDE 0x0010 -#define X_SBC_GAMEPAD_W1_FUNCTIONNIGHTSCOPE 0x0020 -#define X_SBC_GAMEPAD_W1_FUNCTIONF1 0x0040 -#define X_SBC_GAMEPAD_W1_FUNCTIONF2 0x0080 -#define X_SBC_GAMEPAD_W1_FUNCTIONF3 0x0100 -#define X_SBC_GAMEPAD_W1_WEAPONCONMAIN 0x0200 -#define X_SBC_GAMEPAD_W1_WEAPONCONSUB 0x0400 -#define X_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE 0x0800 -#define X_SBC_GAMEPAD_W1_COMM1 0x1000 -#define X_SBC_GAMEPAD_W1_COMM2 0x2000 -#define X_SBC_GAMEPAD_W1_COMM3 0x4000 -#define X_SBC_GAMEPAD_W1_COMM4 0x8000 -#define X_SBC_GAMEPAD_W2_COMM5 0x0001 -#define X_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE 0x0002 -#define X_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL 0x0004 -#define X_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY 0x0008 -#define X_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE 0x0010 -#define X_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL 0x0020 -#define X_SBC_GAMEPAD_W2_TOGGLEVTLOCATION 0x0040 - -// ****************************************************************** -// * enum for feedback status variables of X_SBC_FEEDBACK, it's a byte array after FeedbackHeader, each variable take 1 nibble, that's half byte. -// ****************************************************************** -#define X_SBC_FEEDBACK_EMERGENCYEJECT 0 -#define X_SBC_FEEDBACK_COCKPITHATCH 1 -#define X_SBC_FEEDBACK_IGNITION 2 -#define X_SBC_FEEDBACK_START 3 -#define X_SBC_FEEDBACK_OPENCLOSE 4 -#define X_SBC_FEEDBACK_MAPZOOMINOUT 5 -#define X_SBC_FEEDBACK_MODESELECT 6 -#define X_SBC_FEEDBACK_SUBMONITORMODESELECT 7 -#define X_SBC_FEEDBACK_MAINMONITORZOOMIN 8 -#define X_SBC_FEEDBACK_MAINMONITORZOOMOUT 9 -#define X_SBC_FEEDBACK_FORECASTSHOOTINGSYSTEM 10 -#define X_SBC_FEEDBACK_MANIPULATOR 11 -#define X_SBC_FEEDBACK_LINECOLORCHANGE 12 -#define X_SBC_FEEDBACK_WASHING 13 -#define X_SBC_FEEDBACK_EXTINGUISHER 14 -#define X_SBC_FEEDBACK_CHAFF 15 -#define X_SBC_FEEDBACK_TANKDETACH 16 -#define X_SBC_FEEDBACK_OVERRIDE 17 -#define X_SBC_FEEDBACK_NIGHTSCOPE 18 -#define X_SBC_FEEDBACK_F1 19 -#define X_SBC_FEEDBACK_F2 20 -#define X_SBC_FEEDBACK_F3 21 -#define X_SBC_FEEDBACK_MAINWEAPONCONTROL 22 -#define X_SBC_FEEDBACK_SUBWEAPONCONTROL 23 -#define X_SBC_FEEDBACK_MAGAZINECHANGE 24 -#define X_SBC_FEEDBACK_COMM1 25 -#define X_SBC_FEEDBACK_COMM2 26 -#define X_SBC_FEEDBACK_COMM3 27 -#define X_SBC_FEEDBACK_COMM4 28 -#define X_SBC_FEEDBACK_COMM5 29 -#define X_SBC_FEEDBACK_UNKNOWN 30 -#define X_SBC_FEEDBACK_GEARR 31 -#define X_SBC_FEEDBACK_GEARN 32 -#define X_SBC_FEEDBACK_GEAR1 33 -#define X_SBC_FEEDBACK_GEAR2 34 -#define X_SBC_FEEDBACK_GEAR3 35 -#define X_SBC_FEEDBACK_GEAR4 36 -#define X_SBC_FEEDBACK_GEAR5 37 - -#define X_SBC_FEEDBACK_MAX 38 - // ****************************************************************** // * XINPUT_RUMBLE // ****************************************************************** -typedef struct _X_XINPUT_RUMBLE +typedef struct _XINPUT_RUMBLE { WORD wLeftMotorSpeed; WORD wRightMotorSpeed; } -X_XINPUT_RUMBLE, *PX_XINPUT_RUMBLE; +XINPUT_RUMBLE, *PXINPUT_RUMBLE; // ****************************************************************** // * XINPUT_CAPABILITIES // ****************************************************************** -typedef struct _X_XINPUT_CAPABILITIES +#include "AlignPrefix1.h" +typedef struct _XINPUT_CAPABILITIES { BYTE SubType; WORD Reserved; union { - X_XINPUT_GAMEPAD Gamepad; + XINPUT_GAMEPAD Gamepad; } In; union { - X_XINPUT_RUMBLE Rumble; + XINPUT_RUMBLE Rumble; } Out; } -X_XINPUT_CAPABILITIES, *PX_XINPUT_CAPABILITIES; +#include "AlignPosfix1.h" +XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; // ****************************************************************** // * Device XBOX Input Device Types // ****************************************************************** // all game controller use 0x01 GAMEPAD device type. then specify the subtype in returned Capabilities when XInputGetCapabilities called. -#define X_XINPUT_DEVTYPE_GAMEPAD 0x01 +#define XINPUT_DEVTYPE_GAMEPAD 0x01 // SteelBatalion controller is the only one with special device type other than 1. -#define X_XINPUT_DEVTYPE_STEELBATALION 0x80 +#define XINPUT_DEVTYPE_STEELBATALION 0x80 // ****************************************************************** // * Device XBOX Input Device SubTypes, for use in XINPUT_CAPABILITIES // ****************************************************************** //general GAMEPAD uses subtype 0x01. -#define X_XINPUT_DEVSUBTYPE_GC_GAMEPAD 0x01 +#define XINPUT_DEVSUBTYPE_GC_GAMEPAD 0x01 //SteelBatallion controller uses subtype 0x02 -#define X_XINPUT_DEVSUBTYPE_GC_GAMEPAD_ALT 0x02 -#define X_XINPUT_DEVSUBTYPE_GC_WHEEL 0x10 -#define X_XINPUT_DEVSUBTYPE_GC_ARCADE_STICK 0x20 -#define X_XINPUT_DEVSUBTYPE_GC_DIGITAL_ARCADE_STICK 0x21 -#define X_XINPUT_DEVSUBTYPE_GC_FLIGHT_STICK 0x30 -#define X_XINPUT_DEVSUBTYPE_GC_SNOWBOARD 0x40 -#define X_XINPUT_DEVSUBTYPE_GC_LIGHTGUN 0x50 -#define X_XINPUT_DEVSUBTYPE_GC_RADIO_FLIGHT_CONTROL 0x60 -#define X_XINPUT_DEVSUBTYPE_GC_FISHING_ROD 0x70 -#define X_XINPUT_DEVSUBTYPE_GC_DANCEPAD 0x80 +#define XINPUT_DEVSUBTYPE_GC_GAMEPAD_ALT 0x02 +#define XINPUT_DEVSUBTYPE_GC_WHEEL 0x10 +#define XINPUT_DEVSUBTYPE_GC_ARCADE_STICK 0x20 +#define XINPUT_DEVSUBTYPE_GC_DIGITAL_ARCADE_STICK 0x21 +#define XINPUT_DEVSUBTYPE_GC_FLIGHT_STICK 0x30 +#define XINPUT_DEVSUBTYPE_GC_SNOWBOARD 0x40 +#define XINPUT_DEVSUBTYPE_GC_LIGHTGUN 0x50 +#define XINPUT_DEVSUBTYPE_GC_RADIO_FLIGHT_CONTROL 0x60 +#define XINPUT_DEVSUBTYPE_GC_FISHING_ROD 0x70 +#define XINPUT_DEVSUBTYPE_GC_DANCEPAD 0x80 // ****************************************************************** // * XINPUT_STATE for xbox, xbox uses different Gamepad struce. // ****************************************************************** -typedef struct _X_XINPUT_STATE +typedef struct _XINPUT_STATE { DWORD dwPacketNumber; union { - X_XINPUT_GAMEPAD Gamepad; + XINPUT_GAMEPAD Gamepad; }; } -X_XINPUT_STATE, *PX_XINPUT_STATE; - -// ****************************************************************** -// * offsets into analog button array -// ****************************************************************** -#define X_XINPUT_GAMEPAD_A 0 -#define X_XINPUT_GAMEPAD_B 1 -#define X_XINPUT_GAMEPAD_X 2 -#define X_XINPUT_GAMEPAD_Y 3 -#define X_XINPUT_GAMEPAD_BLACK 4 -#define X_XINPUT_GAMEPAD_WHITE 5 -#define X_XINPUT_GAMEPAD_LEFT_TRIGGER 6 -#define X_XINPUT_GAMEPAD_RIGHT_TRIGGER 7 - -// ****************************************************************** -// * masks for digital buttons -// ****************************************************************** -#define X_XINPUT_GAMEPAD_DPAD_UP 0x00000001 -#define X_XINPUT_GAMEPAD_DPAD_DOWN 0x00000002 -#define X_XINPUT_GAMEPAD_DPAD_LEFT 0x00000004 -#define X_XINPUT_GAMEPAD_DPAD_RIGHT 0x00000008 -#define X_XINPUT_GAMEPAD_START 0x00000010 -#define X_XINPUT_GAMEPAD_BACK 0x00000020 -#define X_XINPUT_GAMEPAD_LEFT_THUMB 0x00000040 -#define X_XINPUT_GAMEPAD_RIGHT_THUMB 0x00000080 +XINPUT_STATE, *PXINPUT_STATE; // ****************************************************************** // * XINPUT_FEEDBACK_HEADER // ****************************************************************** #include "AlignPrefix1.h" -typedef struct _X_XINPUT_FEEDBACK_HEADER +typedef struct _XINPUT_FEEDBACK_HEADER { - DWORD dwStatus; - HANDLE OPTIONAL hEvent; - BYTE Reserved[58]; + DWORD dwStatus; + HANDLE OPTIONAL hEvent; + BYTE Unknown1[4]; + PVOID IoCompletedEvent; // PKEVENT really + BYTE Unknown2[50]; } #include "AlignPosfix1.h" -X_XINPUT_FEEDBACK_HEADER, *PX_XINPUT_FEEDBACK_HEADER; +XINPUT_FEEDBACK_HEADER, *PXINPUT_FEEDBACK_HEADER; // ****************************************************************** // * XINPUT_FEEDBACK // ****************************************************************** -typedef struct _X_XINPUT_FEEDBACK +typedef struct _XINPUT_FEEDBACK { - X_XINPUT_FEEDBACK_HEADER Header; + XINPUT_FEEDBACK_HEADER Header; union { - X_XINPUT_RUMBLE Rumble; + XINPUT_RUMBLE Rumble; }; } -X_XINPUT_FEEDBACK, *PX_XINPUT_FEEDBACK; - -// ****************************************************************** -// * XINPUT_DEVICE_INFO -// ****************************************************************** - -typedef struct _X_XINPUT_DEVICE_INFO -{ - - UCHAR ucType; //xbox controller type - UCHAR ucSubType; //xbox controller subtype - UCHAR ucInputStateSize; //xbox controller input state size in bytes, not include dwPacketNumber - UCHAR ucFeedbackSize; //xbox controller feedback size in bytes, not include FeedbackHeader - PXPP_DEVICE_TYPE DeviceType; //pointer to DeviceType structure. -} -X_XINPUT_DEVICE_INFO, *PX_XINPUT_DEVICE_INFO; - -#define X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_NOTCONNECT 0x00000000 -#define X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_XINPUT 0x00000001 -#define X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_DINPUT 0x00000002 -#define X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC 0x00000080 - -//this structure is for use of tracking the xbox controllers assigned to 4 ports. -//user can specify the corresponding host input device -//whether it's XInput, directinput, or an virtual custom controller. -// ****************************************************************** -// * X_CONTROLLER_HOST_BRIDGE -// ****************************************************************** -typedef struct _X_CONTROLLER_HOST_BRIDGE -{ - HANDLE hXboxDevice; //xbox device handle to this controller, we use the address of this bridge as the handle, only set after opened. cleared after closed. - DWORD dwXboxPort; //xbox port# for this xbox controller - PX_XINPUT_POLLING_PARAMETERS pXboxXPP; //pointer to xbox polling parameter - DWORD dwHostType; //specify host input corresponding to this controller - //0 not connected, - //1 connect with XInput, - //2 connect with directinput, - //3 or above connect virtual custom controller - DWORD dwHostPort; //port of the host input device being bridged. - //if hostinputtype==1 for using XInput, and hostport==2, - //then bridge to XInput player 3 (port started from 0). - - //members listed below comes from interpreting xbe device table - X_XINPUT_DEVICE_INFO XboxDeviceInfo; - void * pXboxState; //not used currently, keep it just in case - PX_XINPUT_FEEDBACK_HEADER pXboxFeedbackHeader; //pointer to feedback header,keep this in track for IO_PENDING status tracking. - DWORD dwLatency; -} -X_CONTROLLER_HOST_BRIDGE, *PX_CONTROLLER_HOST_BRIDGE; - - -// ****************************************************************** -// * XBGAMEPAD // this structure seems unused at all. anyway, keep it here. -// ****************************************************************** -struct XBGAMEPAD : public X_XINPUT_GAMEPAD -{ - FLOAT fX1; - FLOAT fY1; - FLOAT fX2; - FLOAT fY2; - WORD wLastButtons; - BOOL bLastAnalogButtons[8]; - WORD wPressedButtons; - BOOL bPressedAnalogButtons[8]; - X_XINPUT_RUMBLE Rumble; - X_XINPUT_FEEDBACK Feedback; - X_XINPUT_CAPABILITIES caps; - HANDLE hDevice; - BOOL bInserted; - BOOL bRemoved; -}; +XINPUT_FEEDBACK, *PXINPUT_FEEDBACK; // ****************************************************************** // * RTL_HEAP_PARAMETERS @@ -631,7 +434,7 @@ HANDLE WINAPI EMUPATCH(XInputOpen) IN PXPP_DEVICE_TYPE DeviceType, IN DWORD dwPort, IN DWORD dwSlot, - IN PX_XINPUT_POLLING_PARAMETERS pPollingParameters OPTIONAL + IN PXINPUT_POLLING_PARAMETERS pPollingParameters OPTIONAL ); // ****************************************************************** @@ -656,7 +459,7 @@ DWORD WINAPI EMUPATCH(XInputPoll) DWORD WINAPI EMUPATCH(XInputGetCapabilities) ( IN HANDLE hDevice, - OUT PX_XINPUT_CAPABILITIES pCapabilities + OUT PXINPUT_CAPABILITIES pCapabilities ); // ****************************************************************** @@ -665,7 +468,7 @@ DWORD WINAPI EMUPATCH(XInputGetCapabilities) DWORD WINAPI EMUPATCH(XInputGetState) ( IN HANDLE hDevice, - OUT PX_XINPUT_STATE pState + OUT PXINPUT_STATE pState ); // ****************************************************************** @@ -674,7 +477,7 @@ DWORD WINAPI EMUPATCH(XInputGetState) DWORD WINAPI EMUPATCH(XInputSetState) ( IN HANDLE hDevice, - IN OUT PX_XINPUT_FEEDBACK pFeedback + IN OUT PXINPUT_FEEDBACK pFeedback ); @@ -910,9 +713,9 @@ int WINAPI EMUPATCH(lstrcmpiW) // ****************************************************************** DWORD WINAPI EMUPATCH(XMountMUA) ( - DWORD dwPort, - DWORD dwSlot, - PCHAR pchDrive + DWORD dwPort, + DWORD dwSlot, + PCHAR pchDrive ); // ****************************************************************** @@ -920,25 +723,25 @@ DWORD WINAPI EMUPATCH(XMountMUA) // ****************************************************************** DWORD WINAPI EMUPATCH(XMountMURootA) ( - DWORD dwPort, - DWORD dwSlot, - PCHAR pchDrive + DWORD dwPort, + DWORD dwSlot, + PCHAR pchDrive ); // ****************************************************************** // * patch: XMountAlternateTitleA // ****************************************************************** -DWORD WINAPI EMUPATCH(XMountAlternateTitleA) +/*DWORD WINAPI EMUPATCH(XMountAlternateTitleA) ( - LPCSTR lpRootPath, - DWORD dwAltTitleId, - PCHAR pchDrive -); + LPCSTR lpRootPath, + DWORD dwAltTitleId, + PCHAR pchDrive +);*/ // ****************************************************************** // * patch: XUnmountAlternateTitleA // ****************************************************************** -DWORD WINAPI EMUPATCH(XUnmountAlternateTitleA)(CHAR chDrive); +//DWORD WINAPI EMUPATCH(XUnmountAlternateTitleA)(CHAR chDrive); // ****************************************************************** // * patch: MoveFileA @@ -1039,5 +842,7 @@ DWORD WINAPI EMUPATCH(XCalculateSignatureEnd) ); //*/ // +s + +} // end of namespace XTL #endif diff --git a/src/core/hle/XAPI/XapiCxbxr.h b/src/core/hle/XAPI/XapiCxbxr.h new file mode 100644 index 000000000..4d0b5781e --- /dev/null +++ b/src/core/hle/XAPI/XapiCxbxr.h @@ -0,0 +1,175 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// This file contains Xapi variables which are not part of the Xbox Xapi but are used by Cxbxr. They are prefixed with CXBX_ to further distinguish them. + +#ifndef XAPI_CXBXR_H +#define XAPI_CXBXR_H + +// ****************************************************************** +// * XINPUT_DEVICE_INFO +// ****************************************************************** + +typedef struct _CXBX_XINPUT_DEVICE_INFO +{ + + UCHAR ucType; //xbox controller type + UCHAR ucSubType; //xbox controller subtype + UCHAR ucInputStateSize; //xbox controller input state size in bytes, not include dwPacketNumber + UCHAR ucFeedbackSize; //xbox controller feedback size in bytes, not include FeedbackHeader + DWORD dwPacketNumber; +} +CXBX_XINPUT_DEVICE_INFO, *PCXBX_XINPUT_DEVICE_INFO; + +//this structure is for use of tracking the xbox controllers assigned to 4 ports. +// ****************************************************************** +// * CXBX_CONTROLLER_HOST_BRIDGE +// ****************************************************************** +typedef struct _CXBX_CONTROLLER_HOST_BRIDGE +{ + HANDLE hXboxDevice; //xbox device handle to this device, we use the address of this bridge as the handle, only set after opened. cleared after closed. + int XboxPort; //xbox port# for this xbox controller + XBOX_INPUT_DEVICE XboxType; //xbox device type + void* InState; + bool bPendingRemoval; + bool bSignaled; + bool bIoInProgress; + CXBX_XINPUT_DEVICE_INFO XboxDeviceInfo; +} +CXBX_CONTROLLER_HOST_BRIDGE, *PCXBX_CONTROLLER_HOST_BRIDGE; + +// ****************************************************************** +// * offsets into analog button array +// ****************************************************************** +#define CXBX_XINPUT_GAMEPAD_A 0 +#define CXBX_XINPUT_GAMEPAD_B 1 +#define CXBX_XINPUT_GAMEPAD_X 2 +#define CXBX_XINPUT_GAMEPAD_Y 3 +#define CXBX_XINPUT_GAMEPAD_BLACK 4 +#define CXBX_XINPUT_GAMEPAD_WHITE 5 +#define CXBX_XINPUT_GAMEPAD_LEFT_TRIGGER 6 +#define CXBX_XINPUT_GAMEPAD_RIGHT_TRIGGER 7 + +// ****************************************************************** +// * masks for digital buttons +// ****************************************************************** +#define CXBX_XINPUT_GAMEPAD_DPAD_UP 0x00000001 +#define CXBX_XINPUT_GAMEPAD_DPAD_DOWN 0x00000002 +#define CXBX_XINPUT_GAMEPAD_DPAD_LEFT 0x00000004 +#define CXBX_XINPUT_GAMEPAD_DPAD_RIGHT 0x00000008 +#define CXBX_XINPUT_GAMEPAD_START 0x00000010 +#define CXBX_XINPUT_GAMEPAD_BACK 0x00000020 +#define CXBX_XINPUT_GAMEPAD_LEFT_THUMB 0x00000040 +#define CXBX_XINPUT_GAMEPAD_RIGHT_THUMB 0x00000080 + +// ****************************************************************** +// * masks for digital buttons of X_SBC_GAMEPAD +// ****************************************************************** + +#define CXBX_SBC_GAMEPAD_W0_RIGHTJOYMAINWEAPON 0x0001 +#define CXBX_SBC_GAMEPAD_W0_RIGHTJOYFIRE 0x0002 +#define CXBX_SBC_GAMEPAD_W0_RIGHTJOYLOCKON 0x0004 +#define CXBX_SBC_GAMEPAD_W0_EJECT 0x0008 +#define CXBX_SBC_GAMEPAD_W0_COCKPITHATCH 0x0010 +#define CXBX_SBC_GAMEPAD_W0_IGNITION 0x0020 +#define CXBX_SBC_GAMEPAD_W0_START 0x0040 +#define CXBX_SBC_GAMEPAD_W0_MULTIMONOPENCLOSE 0x0080 +#define CXBX_SBC_GAMEPAD_W0_MULTIMONMAPZOOMINOUT 0x0100 +#define CXBX_SBC_GAMEPAD_W0_MULTIMONMODESELECT 0x0200 +#define CXBX_SBC_GAMEPAD_W0_MULTIMONSUBMONITOR 0x0400 +#define CXBX_SBC_GAMEPAD_W0_MAINMONZOOMIN 0x0800 +#define CXBX_SBC_GAMEPAD_W0_MAINMONZOOMOUT 0x1000 +#define CXBX_SBC_GAMEPAD_W0_FUNCTIONFSS 0x2000 +#define CXBX_SBC_GAMEPAD_W0_FUNCTIONMANIPULATOR 0x4000 +#define CXBX_SBC_GAMEPAD_W0_FUNCTIONLINECOLORCHANGE 0x8000 +#define CXBX_SBC_GAMEPAD_W1_WASHING 0x0001 +#define CXBX_SBC_GAMEPAD_W1_EXTINGUISHER 0x0002 +#define CXBX_SBC_GAMEPAD_W1_CHAFF 0x0004 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONTANKDETACH 0x0008 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONOVERRIDE 0x0010 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONNIGHTSCOPE 0x0020 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONF1 0x0040 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONF2 0x0080 +#define CXBX_SBC_GAMEPAD_W1_FUNCTIONF3 0x0100 +#define CXBX_SBC_GAMEPAD_W1_WEAPONCONMAIN 0x0200 +#define CXBX_SBC_GAMEPAD_W1_WEAPONCONSUB 0x0400 +#define CXBX_SBC_GAMEPAD_W1_WEAPONCONMAGAZINE 0x0800 +#define CXBX_SBC_GAMEPAD_W1_COMM1 0x1000 +#define CXBX_SBC_GAMEPAD_W1_COMM2 0x2000 +#define CXBX_SBC_GAMEPAD_W1_COMM3 0x4000 +#define CXBX_SBC_GAMEPAD_W1_COMM4 0x8000 +#define CXBX_SBC_GAMEPAD_W2_COMM5 0x0001 +#define CXBX_SBC_GAMEPAD_W2_LEFTJOYSIGHTCHANGE 0x0002 +#define CXBX_SBC_GAMEPAD_W2_TOGGLEFILTERCONTROL 0x0004 +#define CXBX_SBC_GAMEPAD_W2_TOGGLEOXYGENSUPPLY 0x0008 +#define CXBX_SBC_GAMEPAD_W2_TOGGLEFUELFLOWRATE 0x0010 +#define CXBX_SBC_GAMEPAD_W2_TOGGLEBUFFREMATERIAL 0x0020 +#define CXBX_SBC_GAMEPAD_W2_TOGGLEVTLOCATION 0x0040 + +// ****************************************************************** +// * enum for feedback status variables of X_SBC_FEEDBACK, it's a byte array after FeedbackHeader, each variable take 1 nibble, that's half byte. +// ****************************************************************** +#define CXBX_SBC_FEEDBACK_EMERGENCYEJECT 0 +#define CXBX_SBC_FEEDBACK_COCKPITHATCH 1 +#define CXBX_SBC_FEEDBACK_IGNITION 2 +#define CXBX_SBC_FEEDBACK_START 3 +#define CXBX_SBC_FEEDBACK_OPENCLOSE 4 +#define CXBX_SBC_FEEDBACK_MAPZOOMINOUT 5 +#define CXBX_SBC_FEEDBACK_MODESELECT 6 +#define CXBX_SBC_FEEDBACK_SUBMONITORMODESELECT 7 +#define CXBX_SBC_FEEDBACK_MAINMONITORZOOMIN 8 +#define CXBX_SBC_FEEDBACK_MAINMONITORZOOMOUT 9 +#define CXBX_SBC_FEEDBACK_FORECASTSHOOTINGSYSTEM 10 +#define CXBX_SBC_FEEDBACK_MANIPULATOR 11 +#define CXBX_SBC_FEEDBACK_LINECOLORCHANGE 12 +#define CXBX_SBC_FEEDBACK_WASHING 13 +#define CXBX_SBC_FEEDBACK_EXTINGUISHER 14 +#define CXBX_SBC_FEEDBACK_CHAFF 15 +#define CXBX_SBC_FEEDBACK_TANKDETACH 16 +#define CXBX_SBC_FEEDBACK_OVERRIDE 17 +#define CXBX_SBC_FEEDBACK_NIGHTSCOPE 18 +#define CXBX_SBC_FEEDBACK_F1 19 +#define CXBX_SBC_FEEDBACK_F2 20 +#define CXBX_SBC_FEEDBACK_F3 21 +#define CXBX_SBC_FEEDBACK_MAINWEAPONCONTROL 22 +#define CXBX_SBC_FEEDBACK_SUBWEAPONCONTROL 23 +#define CXBX_SBC_FEEDBACK_MAGAZINECHANGE 24 +#define CXBX_SBC_FEEDBACK_COMM1 25 +#define CXBX_SBC_FEEDBACK_COMM2 26 +#define CXBX_SBC_FEEDBACK_COMM3 27 +#define CXBX_SBC_FEEDBACK_COMM4 28 +#define CXBX_SBC_FEEDBACK_COMM5 29 +#define CXBX_SBC_FEEDBACK_UNKNOWN 30 +#define CXBX_SBC_FEEDBACK_GEARR 31 +#define CXBX_SBC_FEEDBACK_GEARN 32 +#define CXBX_SBC_FEEDBACK_GEAR1 33 +#define CXBX_SBC_FEEDBACK_GEAR2 34 +#define CXBX_SBC_FEEDBACK_GEAR3 35 +#define CXBX_SBC_FEEDBACK_GEAR4 36 +#define CXBX_SBC_FEEDBACK_GEAR5 37 + +#define CXBX_SBC_FEEDBACK_MAX 38 + +#endif diff --git a/src/CxbxKrnl/EmuXG.cpp b/src/core/hle/XGRAPHIC/XGraphic.cpp similarity index 89% rename from src/CxbxKrnl/EmuXG.cpp rename to src/core/hle/XGRAPHIC/XGraphic.cpp index 59429e427..bc93a099a 100644 --- a/src/CxbxKrnl/EmuXG.cpp +++ b/src/core/hle/XGRAPHIC/XGraphic.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXG.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,18 +24,18 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "XGRP" +#define LOG_PREFIX CXBXR_MODULE::XGRP #undef FIELD_OFFSET // prevent macro redefinition warnings #include -#include "Emu.h" -#include "EmuFS.h" -#include "Logging.h" -#include "EmuXTL.h" -#include "EmuD3D8Logging.h" // for log rendering of X_D3DFORMAT, etc. +#include "core\kernel\support\Emu.h" +#include "common\Logging.h" +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup() +#include "core\hle\XAPI\Xapi.h" // For EMUPATCH +#include "core\hle\D3D8\XbD3D8Logging.h" // for log rendering of X_D3DFORMAT, etc. +#include "core\hle\XGRAPHIC\XGraphic.h" // ****************************************************************** // * patch: XGIsSwizzledFormat @@ -54,7 +45,6 @@ PVOID WINAPI XTL::EMUPATCH(XGIsSwizzledFormat) X_D3DFORMAT Format ) { - //FUNC_EXPORTS LOG_FUNC_ONE_ARG(Format); RETURN(FALSE); @@ -76,7 +66,7 @@ VOID WINAPI XTL::EMUPATCH(XGSwizzleRect) DWORD BytesPerPixel ) { - FUNC_EXPORTS + LOG_FUNC_BEGIN LOG_FUNC_ARG(pSource) LOG_FUNC_ARG(Pitch) @@ -100,8 +90,8 @@ VOID WINAPI XTL::EMUPATCH(XGSwizzleRect) DWORD dwMaxY = Height; DWORD dwChunkSize = Width; - uint08 *pSrc = (uint08*)pSource; - uint08 *pDst = (uint08*)pDest; + uint8_t *pSrc = (uint8_t*)pSource; + uint8_t *pDst = (uint8_t*)pDest; if(pRect != 0) { @@ -139,8 +129,6 @@ VOID WINAPI XTL::EMUPATCH(XGSwizzleBox) DWORD BytesPerPixel ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pSource) LOG_FUNC_ARG(RowPitch) @@ -169,8 +157,8 @@ VOID WINAPI XTL::EMUPATCH(XGSwizzleBox) DWORD dwMaxZ = Depth; DWORD dwChunkSize = Width; - uint08 *pSrc = (uint08*)pSource; - uint08 *pDst = (uint08*)pDest; + uint8_t *pSrc = (uint8_t*)pSource; + uint8_t *pDst = (uint8_t*)pDest; if(pBox != 0) { @@ -201,8 +189,6 @@ HRESULT WINAPI XTL::EMUPATCH(XGWriteSurfaceOrTextureToXPR) BOOL bWriteSurfaceAsTexture ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(pResource) LOG_FUNC_ARG(cPath) @@ -234,8 +220,6 @@ VOID WINAPI XTL::EMUPATCH(XGSetTextureHeader) UINT Pitch ) { - //FUNC_EXPORTS - LOG_FUNC_BEGIN LOG_FUNC_ARG(Width) LOG_FUNC_ARG(Height) @@ -249,10 +233,10 @@ VOID WINAPI XTL::EMUPATCH(XGSetTextureHeader) LOG_FUNC_END; /*if( Data != 0 ) - CxbxKrnlCleanup( "Data != 0 (XGSetTextureHeader)" ); + CxbxKrnlCleanup("Data != 0 (XGSetTextureHeader)" ); if( Pitch != 0 ) - CxbxKrnlCleanup( "Pitch != 0 (XGSetTextureHeader)" );*/ + CxbxKrnlCleanup("Pitch != 0 (XGSetTextureHeader)" );*/ pTexture->Common = X_D3DCOMMON_TYPE_TEXTURE + 1; // Set refcount to 1 pTexture->Data = Data; @@ -297,7 +281,7 @@ VOID WINAPI XTL::EMUPATCH(XGSetTextureHeader) // void **ppFont //) //{ -// FUNC_EXPORTS +// // // LOG_FUNC_BEGIN // LOG_FUNC_ARG(pFontData) diff --git a/src/CxbxKrnl/EmuXG.h b/src/core/hle/XGRAPHIC/XGraphic.h similarity index 89% rename from src/CxbxKrnl/EmuXG.h rename to src/core/hle/XGRAPHIC/XGraphic.h index d9ee7780f..85fd01bc6 100644 --- a/src/CxbxKrnl/EmuXG.h +++ b/src/core/hle/XGRAPHIC/XGraphic.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXG.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,8 +22,12 @@ // * All rights reserved // * // ****************************************************************** -#ifndef EMUXG_H -#define EMUXG_H +#ifndef XGRAPHIC_H +#define XGRAPHIC_H + +#include "core\hle\D3D8\XbD3D8Types.h" + +namespace XTL { typedef struct _XGPOINT3D { @@ -119,5 +114,7 @@ HRESULT WINAPI EMUPATCH(XFONT_OpenBitmapFontFromMemory) unsigned uFontDataSize, void **ppFont ); + +} // end of namespace XTL #endif diff --git a/src/CxbxKrnl/EmuXOnline.h b/src/core/hle/XONLINE/XOnline.h similarity index 80% rename from src/CxbxKrnl/EmuXOnline.h rename to src/core/hle/XONLINE/XOnline.h index b8a6f7447..632dade71 100644 --- a/src/CxbxKrnl/EmuXOnline.h +++ b/src/core/hle/XONLINE/XOnline.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuXOnline.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -31,16 +22,12 @@ // * All rights reserved // * // ****************************************************************** -#ifndef EMUXONLINE_H -#define EMUXONLINE_H +#if 0 // XOnline.h isn't used, but below is still useful documentation. + +#include "core\kernel\support\Emu.h" +#include "core\hle\XAPI\Xapi.h" // For EMUPATCH - -// Flags returned by XNetGetEthernetLinkStatus() -#define XNET_ETHERNET_LINK_ACTIVE 0x01 -#define XNET_ETHERNET_LINK_100MBPS 0x02 -#define XNET_ETHERNET_LINK_10MBPS 0x04 -#define XNET_ETHERNET_LINK_FULL_DUPLEX 0x08 -#define XNET_ETHERNET_LINK_HALF_DUPLEX 0x10 +namespace XTL { // ****************************************************************** // * patch: WSAStartup @@ -136,4 +123,6 @@ int WINAPI EMUPATCH(ioctlsocket) u_long FAR *argp ); +} // end of namespace XTL + #endif diff --git a/src/core/kernel/common/strings.hpp b/src/core/kernel/common/strings.hpp new file mode 100644 index 000000000..6fbca2e1e --- /dev/null +++ b/src/core/kernel/common/strings.hpp @@ -0,0 +1,38 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * (c) 2018-2019 RadWolfie +// * +// * All rights reserved +// * +// ****************************************************************** +#include + +// The file is saved as UTF-8 format, some strings may not output correctly at runtime. +// To work around this, you will need to use std::wstring_convert class +// or any UTF-8 to UTF-16 conversion function. + +// Universal Error Message (UEM) +static std::string uem_str = "Your Xbox requires service.\n\nPlease call Xbox Customer Support.\n" + "\n\nIhre Xbox muss gewartet werden.\n\nBitte den Xbox-Kundendienst anrufen.\n" + "\n\nLa consola Xbox requiere asistencia técnica.\n\nLlame al servicio de soporte al cliente de la Xbox.\n" + "\n\nXbox ha bisogno di manutenzione.\n\nChiamare l'Assistenza Clienti di Xbox.\n" + "\n\nVotre Xbox ne fonctionne pas correctement.\n\nVeuillez contacter le Support à la clientèle Xbox.\n" + "\n\n不具合が生じました。お手数ですが、\n\nXboxカスタマー サポートにお問い合わせください。"; diff --git a/src/CxbxKrnl/EmuKrnl.cpp b/src/core/kernel/exports/EmuKrnl.cpp similarity index 90% rename from src/CxbxKrnl/EmuKrnl.cpp rename to src/core/kernel/exports/EmuKrnl.cpp index 0b2ea1b39..a0d473fe4 100644 --- a/src/CxbxKrnl/EmuKrnl.cpp +++ b/src/core/kernel/exports/EmuKrnl.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnl.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,9 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::KRNL // prevent name collisions namespace xboxkrnl @@ -46,19 +36,17 @@ namespace xboxkrnl #include #include #include -//#include #include "Logging.h" #include "EmuKrnlLogging.h" #include "EmuKrnl.h" // for HalSystemInterrupts #include "EmuKrnlKi.h" // for KiLockDispatcherDatabase -#include "CxbxKrnl.h" -#include "EmuXTL.h" +#include "core\kernel\init\CxbxKrnl.h" // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" + #include "core\kernel\support\EmuNtDll.h" }; // See also : @@ -97,18 +85,26 @@ void InsertTailList(xboxkrnl::PLIST_ENTRY pListHead, xboxkrnl::PLIST_ENTRY pEntr //#define RemoveEntryList(e) do { PLIST_ENTRY f = (e)->Flink, b = (e)->Blink; f->Blink = b; b->Flink = f; (e)->Flink = (e)->Blink = NULL; } while (0) -void RemoveEntryList(xboxkrnl::PLIST_ENTRY pEntry) +// Returns TRUE if the list has become empty after removing the element, FALSE otherwise. +xboxkrnl::BOOLEAN RemoveEntryList(xboxkrnl::PLIST_ENTRY pEntry) { xboxkrnl::PLIST_ENTRY _EX_Flink = pEntry->Flink; xboxkrnl::PLIST_ENTRY _EX_Blink = pEntry->Blink; - if (_EX_Flink != nullptr) { + if (_EX_Blink != nullptr) { _EX_Blink->Flink = _EX_Flink; } if (_EX_Flink != nullptr) { _EX_Flink->Blink = _EX_Blink; } + + if (_EX_Blink != nullptr && _EX_Flink != nullptr) { + return (_EX_Flink == _EX_Blink); + } + // If we reach here then it means we have erroneously been called on a detached element. In this case, + // always report FALSE to avoid possible side effects + return FALSE; } xboxkrnl::PLIST_ENTRY RemoveHeadList(xboxkrnl::PLIST_ENTRY pListHead) @@ -131,7 +127,7 @@ xboxkrnl::PLIST_ENTRY RemoveTailList(xboxkrnl::PLIST_ENTRY pListHead) // * Declaring this in a header causes errors with xboxkrnl // * namespace, so we must declare it within any file that uses it // ****************************************************************** -xboxkrnl::KPCR* KeGetPcr(); +xboxkrnl::KPCR* WINAPI KeGetPcr(); // Interrupts @@ -151,7 +147,7 @@ void RestoreInterruptMode(bool value) g_bInterruptsEnabled = value; } -extern DWORD ExecuteDpcQueue(); +extern void ExecuteDpcQueue(); void KiUnexpectedInterrupt() { @@ -166,7 +162,7 @@ void CallSoftwareInterrupt(const xboxkrnl::KIRQL SoftwareIrql) KiUnexpectedInterrupt(); break; case APC_LEVEL: // = 1 // HalpApcInterrupt - EmuWarning("Unimplemented Software Interrupt (APC)"); // TODO : ExecuteApcQueue(); + EmuLog(LOG_LEVEL::WARNING, "Unimplemented Software Interrupt (APC)"); // TODO : ExecuteApcQueue(); break; case DISPATCH_LEVEL: // = 2 ExecuteDpcQueue(); @@ -181,7 +177,9 @@ void CallSoftwareInterrupt(const xboxkrnl::KIRQL SoftwareIrql) HalSystemInterrupts[SoftwareIrql - 4].Trigger(EmuInterruptList[SoftwareIrql - 4]); } break; - } + } + + HalInterruptRequestRegister ^= (1 << SoftwareIrql); } const DWORD IrqlMasks[] = { @@ -464,45 +462,10 @@ XBSYSAPI EXPORTNUM(163) xboxkrnl::VOID FASTCALL xboxkrnl::KiUnlockDispatcherData KfLowerIrql(OldIrql); } -// ****************************************************************** -// * 0x00FC - PhyGetLinkState() -// ****************************************************************** -XBSYSAPI EXPORTNUM(252) xboxkrnl::DWORD NTAPI xboxkrnl::PhyGetLinkState -( - IN ULONG Mode -) -{ - LOG_FUNC_ONE_ARG(Mode); - - LOG_UNIMPLEMENTED(); - - return 0; // Was XNET_ETHERNET_LINK_ACTIVE | XNET_ETHERNET_LINK_100MBPS | XNET_ETHERNET_LINK_FULL_DUPLEX; -} - -// ****************************************************************** -// * 0x00FD - PhyInitialize() -// ****************************************************************** -XBSYSAPI EXPORTNUM(253) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PhyInitialize -( - IN ULONG forceReset, - IN PVOID Parameter2 -) -{ - LOG_FUNC_BEGIN - LOG_FUNC_ARG(forceReset) - LOG_FUNC_ARG(Parameter2) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); - - RETURN(S_OK); -} - // ****************************************************************** // * 0x0165 - IdexChannelObject // ****************************************************************** -// TODO : Determine size, structure & filling behind IdexChannelObject -XBSYSAPI EXPORTNUM(357) xboxkrnl::BYTE xboxkrnl::IdexChannelObject[0x100] = { }; +XBSYSAPI EXPORTNUM(357) xboxkrnl::IDE_CHANNEL_OBJECT xboxkrnl::IdexChannelObject = { }; // ****************************************************************** // * 0x0169 - RtlSnprintf() @@ -715,4 +678,4 @@ XBSYSAPI EXPORTNUM(373) xboxkrnl::NTSTATUS NTAPI xboxkrnl::IrtSweep // PROFILING LOG_UNIMPLEMENTED(); RETURN(S_OK); -} \ No newline at end of file +} diff --git a/src/CxbxKrnl/EmuKrnl.h b/src/core/kernel/exports/EmuKrnl.h similarity index 85% rename from src/CxbxKrnl/EmuKrnl.h rename to src/core/kernel/exports/EmuKrnl.h index 2a32f9466..391e37ff6 100644 --- a/src/CxbxKrnl/EmuKrnl.h +++ b/src/core/kernel/exports/EmuKrnl.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnl.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,12 +25,12 @@ #ifndef EMUKRNL_H #define EMUKRNL_H -#include "CxbxKrnl.h" -#include "Emu.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" // CONTAINING_RECORD macro // Gets the value of structure member (field - num1),given the type(MYSTRUCT, in this code) and the List_Entry head(temp, in this code) -// See http://stackoverflow.com/questions/8240273/a-portable-way-to-calculate-pointer-to-the-whole-structure-using-pointer-to-a-fi +// See https://stackoverflow.com/questions/8240273/a-portable-way-to-calculate-pointer-to-the-whole-structure-using-pointer-to-a-fi //#define CONTAINING_RECORD(ptr, type, field) \ // (((type) *)((char *)(ptr) - offsetof((type), member))) @@ -52,7 +43,7 @@ void InsertHeadList(xboxkrnl::PLIST_ENTRY pListHead, xboxkrnl::PLIST_ENTRY pEntr void InsertTailList(xboxkrnl::PLIST_ENTRY pListHead, xboxkrnl::PLIST_ENTRY pEntry); //#define RemoveEntryList(e) do { PLIST_ENTRY f = (e)->Flink, b = (e)->Blink; f->Blink = b; b->Flink = f; (e)->Flink = (e)->Blink = NULL; } while (0) -void RemoveEntryList(xboxkrnl::PLIST_ENTRY pEntry); +xboxkrnl::BOOLEAN RemoveEntryList(xboxkrnl::PLIST_ENTRY pEntry); xboxkrnl::PLIST_ENTRY RemoveHeadList(xboxkrnl::PLIST_ENTRY pListHead); xboxkrnl::PLIST_ENTRY RemoveTailList(xboxkrnl::PLIST_ENTRY pListHead); @@ -103,7 +94,7 @@ public: } __except (EmuException(GetExceptionInformation())) { - EmuWarning("Problem with ExceptionFilter!"); + EmuLogEx(CXBXR_MODULE::KRNL, LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); } } private: diff --git a/src/CxbxKrnl/EmuKrnlAv.cpp b/src/core/kernel/exports/EmuKrnlAv.cpp similarity index 78% rename from src/CxbxKrnl/EmuKrnlAv.cpp rename to src/core/kernel/exports/EmuKrnlAv.cpp index 5ce1e5a60..33f69c397 100644 --- a/src/CxbxKrnl/EmuKrnlAv.cpp +++ b/src/core/kernel/exports/EmuKrnlAv.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlAv.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::AV // prevent name collisions namespace xboxkrnl @@ -50,15 +40,17 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { -#include "EmuNtDll.h" +#include "core\kernel\support\EmuNtDll.h" }; -#include "Emu.h" // For EmuWarning() -#include "EmuXTL.h" -#include "EmuX86.h" +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" +#include "devices\x86\EmuX86.h" #include "EmuKrnlAvModes.h" +#include "devices\Xbox.h" // For g_NV2A #include "devices\video\nv2a_int.h" +#include "devices\video\nv2a.h" // For NV2ABlockInfo, EmuNV2A_Block() #ifndef VOID #define VOID void @@ -87,41 +79,60 @@ VOID REG_WR32(VOID* Ptr, xboxkrnl::ULONG Addr, xboxkrnl::ULONG Val) VOID CRTC_WR(VOID* Ptr, xboxkrnl::UCHAR i, xboxkrnl::UCHAR d) { - REG_WR08(Ptr, NV_PRMCIO_CRX__COLOR, i); - REG_WR08(Ptr, NV_PRMCIO_CR__COLOR, d); + static const NV2ABlockInfo* block = EmuNV2A_Block(NV_PRMCIO_CRX__COLOR); + + g_NV2A->BlockWrite(block, NV_PRMCIO_CRX__COLOR, i, sizeof(uint8_t)); + g_NV2A->BlockWrite(block, NV_PRMCIO_CR__COLOR, d, sizeof(uint8_t)); } VOID SRX_WR(VOID *Ptr, xboxkrnl::UCHAR i, xboxkrnl::UCHAR d) - { - REG_WR08(Ptr, NV_PRMVIO_SRX, i); - REG_WR08(Ptr, NV_PRMVIO_SR, (d)); + static const NV2ABlockInfo* block = EmuNV2A_Block(NV_PRMVIO_SRX); + + g_NV2A->BlockWrite(block, NV_PRMVIO_SRX, i, sizeof(uint8_t)); + g_NV2A->BlockWrite(block, NV_PRMVIO_SR, d, sizeof(uint8_t)); } VOID GRX_WR(VOID *Ptr, xboxkrnl::UCHAR i, xboxkrnl::UCHAR d) { - REG_WR08(Ptr, NV_PRMVIO_GRX, i); - REG_WR08(Ptr, NV_PRMVIO_GX, (d)); + static const NV2ABlockInfo* block = EmuNV2A_Block(NV_PRMVIO_GRX); + + g_NV2A->BlockWrite(block, NV_PRMVIO_GRX, i, sizeof(uint8_t)); + g_NV2A->BlockWrite(block, NV_PRMVIO_GX, d, sizeof(uint8_t)); } VOID ARX_WR(VOID *Ptr, xboxkrnl::UCHAR i, xboxkrnl::UCHAR d) { - REG_WR08(Ptr, NV_PRMCIO_ARX, i); - REG_WR08(Ptr, NV_PRMCIO_ARX, (d)); + static const NV2ABlockInfo* block = EmuNV2A_Block(NV_PRMCIO_ARX); + + g_NV2A->BlockWrite(block, NV_PRMCIO_ARX, i, sizeof(uint8_t)); + g_NV2A->BlockWrite(block, NV_PRMCIO_ARX, d, sizeof(uint8_t)); } - - // Global Variable(s) PVOID g_pPersistedData = NULL; ULONG AvpCurrentMode = 0; +ULONG AvSMCVideoModeToAVPack(ULONG VideoMode) +{ + switch (VideoMode) + { + case 0x0: return AV_PACK_SCART; + case 0x1: return AV_PACK_HDTV; + case 0x2: return AV_PACK_VGA; + case 0x3: return AV_PACK_RFU; + case 0x4: return AV_PACK_SVIDEO; + case 0x6: return AV_PACK_STANDARD; + } + + return AV_PACK_NONE; +} + + ULONG AvQueryAvCapabilities() { - // This is the only AV mode we currently emulate, so we can hardcode the return value - // TODO: Once we add the ability to change av pack, read HalSmcVideoMode) and convert it to a AV_PACK_* - ULONG avpack = AV_PACK_HDTV; + ULONG avpack = AvSMCVideoModeToAVPack(xboxkrnl::HalBootSMCVideoMode); ULONG type; ULONG resultSize; @@ -179,7 +190,7 @@ XBSYSAPI EXPORTNUM(2) VOID NTAPI xboxkrnl::AvSendTVEncoderOption OUT ULONG *Result ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(RegisterBase) LOG_FUNC_ARG(Option) LOG_FUNC_ARG(Param) @@ -247,9 +258,6 @@ XBSYSAPI EXPORTNUM(2) VOID NTAPI xboxkrnl::AvSendTVEncoderOption } } -// Cached Display Mode format, used by NV2A to deermine framebuffer format -ULONG g_AvDisplayModeFormat = 0; - // ****************************************************************** // * 0x0003 - AvSetDisplayMode() // ****************************************************************** @@ -263,7 +271,7 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode IN ULONG FrameBuffer ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(RegisterBase) LOG_FUNC_ARG(Step) LOG_FUNC_ARG(Mode) @@ -304,16 +312,11 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode break; } - // HACK: Store D3D format that was set, so we can decode it in nv2a swap - // TODO: Fix this so nv2a state is used to get these values... - g_AvDisplayModeFormat = Format; - Pitch /= 8; - if (AvpCurrentMode == Mode) - { + if (AvpCurrentMode == Mode) { REG_WR32(RegisterBase, NV_PRAMDAC_GENERAL_CONTROL, GeneralControl); - CRTC_WR(RegisterBase, NV_CIO_SR_LOCK_INDEX, NV_CIO_SR_UNLOCK_RW_VALUE); /* crtc lock */ + CRTC_WR(RegisterBase, NV_CIO_SR_LOCK_INDEX /*=0x1c*/, NV_CIO_SR_UNLOCK_RW_VALUE); /* crtc lock */ CRTC_WR(RegisterBase, NV_CIO_CR_OFFSET_INDEX /*=0x13*/, (UCHAR)(Pitch & 0xFF)); /* sets screen pitch */ CRTC_WR(RegisterBase, NV_CIO_CRE_RPC0_INDEX /*=0x19*/, (UCHAR)((Pitch & 0x700) >> 3)); /* repaint control 0 */ CRTC_WR(RegisterBase, NV_CIO_CRE_PIXEL_INDEX /*=0x28*/, 0x80 | CR28Depth); @@ -321,11 +324,12 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode AvSendTVEncoderOption(RegisterBase, AV_OPTION_FLICKER_FILTER, 5, NULL); AvSendTVEncoderOption(RegisterBase, AV_OPTION_ENABLE_LUMA_FILTER, FALSE, NULL); - AvpCurrentMode = Mode; RETURN(STATUS_SUCCESS); } + CRTC_WR(RegisterBase, NV_CIO_CRE_PIXEL_INDEX /*=0x28*/, 0x80 | CR28Depth); + // TODO: Lots of setup/TV encoder configuration // Ignored for now since we don't emulate that stuff yet... @@ -341,9 +345,9 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode } if (Mode & AV_MODE_FLAGS_SCART) { - REG_WR32(RegisterBase, 0x680630, 0); - REG_WR32(RegisterBase, 0x6808C4, 0); - REG_WR32(RegisterBase, 0x68084C, 0); + REG_WR32(RegisterBase, 0x00680630, 0); // NV_RAMDAC + 0x0630 + REG_WR32(RegisterBase, 0x006808C4, 0); // NV_RAMDAC + 0x08C4 + REG_WR32(RegisterBase, 0x0068084C, 0); // NV_RAMDAC + 0x084C } const UCHAR* pByte = AvpSRXRegisters; @@ -371,7 +375,7 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode REG_WR08(RegisterBase, NV_PRMCIO_ARX, 0x20); - CRTC_WR(RegisterBase, 0x11, 0x00); + CRTC_WR(RegisterBase, NV_CIO_CR_VRE_INDEX /*=0x11*/, 0x00); pByte = AvpCRTCRegisters[iCRTC]; pByteMax = pByte + sizeof(AvpCRTCRegisters[0]); @@ -379,15 +383,19 @@ XBSYSAPI EXPORTNUM(3) xboxkrnl::ULONG NTAPI xboxkrnl::AvSetDisplayMode UCHAR Register = AvpCRTCRegisters[0][i]; UCHAR Data = *pByte; - if (Register == 0x13) { + switch (Register) { + case NV_CIO_CR_OFFSET_INDEX /*=0x13*/: Data = (UCHAR)(Pitch & 0xFF); - } else if (Register == 0x19) { + break; + case NV_CIO_CRE_RPC0_INDEX /*=0x19*/: Data |= (UCHAR)((Pitch & 0x700) >> 3); - } else if (Register == 0x25) { + break; + case NV_CIO_CRE_LSR_INDEX /*=0x25*/: Data |= (UCHAR)((Pitch & 0x800) >> 6); + break; } - CRTC_WR(RegisterBase, AvpCRTCRegisters[0][i], Data); + CRTC_WR(RegisterBase, Register, Data); } // TODO: More TV Encoder stuff... diff --git a/src/CxbxKrnl/EmuKrnlAvModes.h b/src/core/kernel/exports/EmuKrnlAvModes.h similarity index 81% rename from src/CxbxKrnl/EmuKrnlAvModes.h rename to src/core/kernel/exports/EmuKrnlAvModes.h index 1765f45b1..8412fb3a0 100644 --- a/src/CxbxKrnl/EmuKrnlAvModes.h +++ b/src/core/kernel/exports/EmuKrnlAvModes.h @@ -1,4 +1,26 @@ #pragma once + +// Mode enum values where: +// +// 0xC0000000 - output mode mask: +// +// 0x00000000 - 480 line SDTV +// 0x40000000 - 525 line SDTV +// 0x80000000 - HDTV +// 0xC0000000 - VGA +// +// 0x10000000 - enable WSS (_16x9) +// 0x20000000 - use SCART output (_RGB) +// +// 0x01000000 - disable DAC A +// 0x02000000 - disable DAC B +// 0x04000000 - disable DAC C +// 0x08000000 - disable DAC D +// +// 0x00FF0000 - register table index +// 0x0000FF00 - CRTC table index +// 0x000000FF - TV table index, based on output mode mask above + #define AV_MODE_TABLE_VERSION 0 #define AV_MODE_OFF 0x00000000 @@ -109,8 +131,8 @@ #define AV_MODE_FLAGS_DACC_DISABLE 0x04000000 #define AV_MODE_FLAGS_DACD_DISABLE 0x08000000 -#define AV_MODE_FLAGS_WSS 0x10000000 -#define AV_MODE_FLAGS_SCART 0x20000000 +#define AV_MODE_FLAGS_WSS 0x10000000 // _16x9 +#define AV_MODE_FLAGS_SCART 0x20000000 // _RGB #define AV_MODE_FLAGS_NTSCJ 0x00000080 #define AV_MODE_OUT_MASK 0xC0000000 @@ -122,25 +144,25 @@ // Register Tables const ULONG AvpRegisters[][26] = { -{ /* offset */ 0x00680898, 0x0068089C, 0x006808C0, 0x006808C4, 0x0068084C, 0x00680630, 0x00680800, 0x00680804, 0x00680808, 0x0068080C, 0x00680810, 0x00680814, 0x00680818, 0x00680820, 0x00680824, 0x00680828, 0x0068082C, 0x00680830, 0x00680834, 0x00680838, 0x00680848, 0x00680680, 0x00680684, 0x00680688, 0x0068068C, 0x00680690 }, /* offset */ -{ /* 1 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x0000027F, 0x000003A7, 0x00000257, 0x000002F3, 0x00000333, 0x00000000, 0x0000027F, 0x10100111, 0x000C6ED0, 0x0000020D, 0x0000009B, 0x0000026C, 0x00000000 }, /* 1 */ -{ /* 2 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x000002CF, 0x000003A7, 0x000002A7, 0x0000031B, 0x0000035B, 0x00000000, 0x000002CF, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* 2 */ -{ /* 3 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F387C, 0x00000271, 0x000000BE, 0x000002F8, 0x00000000 }, /* 3 */ -{ /* 4 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x000002CF, 0x0000035F, 0x000002AF, 0x0000030B, 0x0000034B, 0x00000000, 0x000002CF, 0x10100111, 0x0010D2A4, 0x00000271, 0x000000D2, 0x00000348, 0x00000000 }, /* 4 */ -{ /* 5 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F07A8, 0x00000271, 0x0000009D, 0x00000276, 0x00000000 }, /* 5 */ -{ /* 6 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x000002CF, 0x0000035F, 0x000002AF, 0x0000030B, 0x0000034B, 0x00000000, 0x000002CF, 0x10100111, 0x0010E62C, 0x00000271, 0x000000B1, 0x000002C4, 0x00000000 }, /* 6 */ -{ /* 7 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x0000029F, 0x000002E1, 0x00000320, 0x00000000, 0x000002CF, 0x10100011, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 7 */ -{ /* 8 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x0000029F, 0x000002E1, 0x00000320, 0x00000000, 0x000002CF, 0x10100111, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 8 */ -{ /* 9 */ 0x0AA94000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004FF, 0x00000545, 0x00000595, 0x000000A0, 0x0000045F, 0x10100011, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* 9 */ -{ /* A */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004CF, 0x00000545, 0x00000595, 0x00000000, 0x000004FF, 0x10100011, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* A */ -{ /* B */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004FF, 0x00000545, 0x00000595, 0x00000000, 0x000004FF, 0x10100111, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* B */ -{ /* C */ 0x071AE000, 0x07183800, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043C, 0x0000043C, 0x00000446, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x000007AA, 0x000007AB, 0x00000803, 0x000000F0, 0x0000068F, 0x10133011, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* C */ -{ /* D */ 0x10000000, 0x07183800, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043C, 0x0000043C, 0x00000446, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x00000759, 0x000007AB, 0x00000803, 0x00000000, 0x0000077F, 0x10133011, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* D */ -{ /* E */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043B, 0x0000043B, 0x00000445, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x000007AB, 0x000007AC, 0x00000804, 0x00000000, 0x0000077F, 0x10133111, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* E */ -{ /* F */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x0000027F, 0x000003A7, 0x000002A7, 0x000002F3, 0x00000333, 0x00000000, 0x0000027F, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* F */ -{ /* 10 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x0000027F, 0x0000035F, 0x000002A7, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* 10 */ -{ /* 11 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x000002CF, 0x000002DF, 0x0000031E, 0x00000020, 0x000002AD, 0x10100011, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 11 */ -{ /* 12 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F07A8, 0x00000271, 0x0000009D, 0x00000276, 0x00000000 }, /* 12 */ + { /* offset */ 0x00680898, 0x0068089C, 0x006808C0, 0x006808C4, 0x0068084C, 0x00680630, 0x00680800, 0x00680804, 0x00680808, 0x0068080C, 0x00680810, 0x00680814, 0x00680818, 0x00680820, 0x00680824, 0x00680828, 0x0068082C, 0x00680830, 0x00680834, 0x00680838, 0x00680848, 0x00680680, 0x00680684, 0x00680688, 0x0068068C, 0x00680690 }, /* offset */ + { /* 1 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x0000027F, 0x000003A7, 0x00000257, 0x000002F3, 0x00000333, 0x00000000, 0x0000027F, 0x10100111, 0x000C6ED0, 0x0000020D, 0x0000009B, 0x0000026C, 0x00000000 }, /* 1 */ + { /* 2 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x000002CF, 0x000003A7, 0x000002A7, 0x0000031B, 0x0000035B, 0x00000000, 0x000002CF, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* 2 */ + { /* 3 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F387C, 0x00000271, 0x000000BE, 0x000002F8, 0x00000000 }, /* 3 */ + { /* 4 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x000002CF, 0x0000035F, 0x000002AF, 0x0000030B, 0x0000034B, 0x00000000, 0x000002CF, 0x10100111, 0x0010D2A4, 0x00000271, 0x000000D2, 0x00000348, 0x00000000 }, /* 4 */ + { /* 5 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F07A8, 0x00000271, 0x0000009D, 0x00000276, 0x00000000 }, /* 5 */ + { /* 6 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x000002CF, 0x0000035F, 0x000002AF, 0x0000030B, 0x0000034B, 0x00000000, 0x000002CF, 0x10100111, 0x0010E62C, 0x00000271, 0x000000B1, 0x000002C4, 0x00000000 }, /* 6 */ + { /* 7 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x0000029F, 0x000002E1, 0x00000320, 0x00000000, 0x000002CF, 0x10100011, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 7 */ + { /* 8 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x0000029F, 0x000002E1, 0x00000320, 0x00000000, 0x000002CF, 0x10100111, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 8 */ + { /* 9 */ 0x0AA94000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004FF, 0x00000545, 0x00000595, 0x000000A0, 0x0000045F, 0x10100011, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* 9 */ + { /* A */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004CF, 0x00000545, 0x00000595, 0x00000000, 0x000004FF, 0x10100011, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* A */ + { /* B */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x000002CF, 0x000002ED, 0x000002CF, 0x000002D4, 0x000002D9, 0x00000000, 0x000002CF, 0x000004FF, 0x00000671, 0x000004FF, 0x00000545, 0x00000595, 0x00000000, 0x000004FF, 0x10100111, 0x00000672, 0x00000001, 0x0000014A, 0x00000528, 0x00000001 }, /* B */ + { /* C */ 0x071AE000, 0x07183800, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043C, 0x0000043C, 0x00000446, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x000007AA, 0x000007AB, 0x00000803, 0x000000F0, 0x0000068F, 0x10133011, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* C */ + { /* D */ 0x10000000, 0x07183800, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043C, 0x0000043C, 0x00000446, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x00000759, 0x000007AB, 0x00000803, 0x00000000, 0x0000077F, 0x10133011, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* D */ + { /* E */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000003, 0x00000437, 0x00000464, 0x0000043B, 0x0000043B, 0x00000445, 0x00000000, 0x00000437, 0x0000077F, 0x00000897, 0x000007AB, 0x000007AC, 0x00000804, 0x00000000, 0x0000077F, 0x10133111, 0x00000898, 0x00000001, 0x000001B8, 0x000006E0, 0x00000001 }, /* E */ + { /* F */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F2, 0x000001F4, 0x00000000, 0x000001DF, 0x0000027F, 0x000003A7, 0x000002A7, 0x000002F3, 0x00000333, 0x00000000, 0x0000027F, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* F */ + { /* 10 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001F4, 0x000001F6, 0x00000000, 0x000001DF, 0x0000027F, 0x0000035F, 0x000002A7, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000DF05C, 0x0000020D, 0x000000AE, 0x000002B8, 0x00000000 }, /* 10 */ + { /* 11 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x000001DF, 0x0000020C, 0x000001DF, 0x000001E8, 0x000001EE, 0x00000000, 0x000001DF, 0x000002CF, 0x00000359, 0x000002CF, 0x000002DF, 0x0000031E, 0x00000020, 0x000002AD, 0x10100011, 0x0000035A, 0x00000001, 0x000000AB, 0x000002AE, 0x00000001 }, /* 11 */ + { /* 12 */ 0x10000000, 0x10000000, 0x00000000, 0x40801080, 0x00801080, 0x00000002, 0x0000023F, 0x00000270, 0x0000023F, 0x00000256, 0x00000258, 0x00000000, 0x0000023F, 0x0000027F, 0x0000035F, 0x00000257, 0x000002CF, 0x0000030F, 0x00000000, 0x0000027F, 0x10100111, 0x000F07A8, 0x00000271, 0x0000009D, 0x00000276, 0x00000000 }, /* 12 */ }; const UCHAR AvpSRXRegisters[] = @@ -161,22 +183,22 @@ const UCHAR AvpARXRegisters[] = const UCHAR AvpCRTCRegisters[][34] = { { /* offset */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x20, 0x25, 0x2D, 0x33, 0x39, 0x41 }, /* offset */ -{ /* 1 */ 0x70, 0x4F, 0x4F, 0x94, 0x5D, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 1 */ -{ /* 2 */ 0x70, 0x59, 0x59, 0x94, 0x62, 0xA4, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 2 */ -{ /* 3 */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBB, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 3 */ -{ /* 4 */ 0x67, 0x59, 0x59, 0x8B, 0x5E, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 4 */ -{ /* 5 */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBB, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 5 */ -{ /* 6 */ 0x67, 0x59, 0x59, 0x8B, 0x5E, 0xBF, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 6 */ -{ /* 7 */ 0x59, 0x4F, 0x4F, 0x9D, 0x51, 0x39, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 7 */ -{ /* 8 */ 0x63, 0x59, 0x59, 0x87, 0x5B, 0xA3, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 8 */ -{ /* 9 */ 0x78, 0x4F, 0x4F, 0x9C, 0x57, 0xA1, 0xFC, 0x1F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x09, 0xDF, 0x00, 0x00, 0xDF, 0xFD, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 9 */ -{ /* A */ 0xC8, 0x9F, 0x9F, 0x8C, 0xA7, 0x31, 0xEC, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x09, 0xCF, 0x00, 0x00, 0xCF, 0xED, 0xE3, 0xFF, 0x00, 0x38, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* A */ -{ /* B */ 0x67, 0x4F, 0x4F, 0x8B, 0x54, 0xBF, 0x03, 0x11, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x06, 0xEF, 0x00, 0x00, 0xEF, 0x04, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0x36, 0x00 }, /* B */ -{ /* C */ 0x04, 0xEF, 0xEF, 0x88, 0xF4, 0x3F, 0x2F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x02, 0x1B, 0x00, 0x00, 0x1B, 0x30, 0xE3, 0xFF, 0x00, 0x38, 0x05, 0x80, 0x00, 0x01, 0x11, 0x10, 0x00 }, /* C */ -{ /* D */ 0x70, 0x4F, 0x4F, 0x94, 0x5D, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* D */ -{ /* E */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x00, 0x00, 0x11, 0xFF, 0x00 }, /* E */ -{ /* F */ 0x61, 0x57, 0x57, 0x85, 0x59, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* F */ -{ /* 10 */ 0x67, 0x4F, 0x4F, 0x94, 0x59, 0xBF, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 10 */ + { /* 1 */ 0x70, 0x4F, 0x4F, 0x94, 0x5D, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 1 */ + { /* 2 */ 0x70, 0x59, 0x59, 0x94, 0x62, 0xA4, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 2 */ + { /* 3 */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBB, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 3 */ + { /* 4 */ 0x67, 0x59, 0x59, 0x8B, 0x5E, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 4 */ + { /* 5 */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBB, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 5 */ + { /* 6 */ 0x67, 0x59, 0x59, 0x8B, 0x5E, 0xBF, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 6 */ + { /* 7 */ 0x59, 0x4F, 0x4F, 0x9D, 0x51, 0x39, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 7 */ + { /* 8 */ 0x63, 0x59, 0x59, 0x87, 0x5B, 0xA3, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 8 */ + { /* 9 */ 0x78, 0x4F, 0x4F, 0x9C, 0x57, 0xA1, 0xFC, 0x1F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x09, 0xDF, 0x00, 0x00, 0xDF, 0xFD, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 9 */ + { /* A */ 0xC8, 0x9F, 0x9F, 0x8C, 0xA7, 0x31, 0xEC, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x09, 0xCF, 0x00, 0x00, 0xCF, 0xED, 0xE3, 0xFF, 0x00, 0x38, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* A */ + { /* B */ 0x67, 0x4F, 0x4F, 0x8B, 0x54, 0xBF, 0x03, 0x11, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x06, 0xEF, 0x00, 0x00, 0xEF, 0x04, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0x36, 0x00 }, /* B */ + { /* C */ 0x04, 0xEF, 0xEF, 0x88, 0xF4, 0x3F, 0x2F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x02, 0x1B, 0x00, 0x00, 0x1B, 0x30, 0xE3, 0xFF, 0x00, 0x38, 0x05, 0x80, 0x00, 0x01, 0x11, 0x10, 0x00 }, /* C */ + { /* D */ 0x70, 0x4F, 0x4F, 0x94, 0x5D, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x04, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* D */ + { /* E */ 0x67, 0x4F, 0x4F, 0x8B, 0x59, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x06, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x00, 0x00, 0x11, 0xFF, 0x00 }, /* E */ + { /* F */ 0x61, 0x57, 0x57, 0x85, 0x59, 0xBF, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x0E, 0xDF, 0x00, 0x00, 0xDF, 0x0C, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* F */ + { /* 10 */ 0x67, 0x4F, 0x4F, 0x94, 0x59, 0xBF, 0x6F, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x08, 0x3F, 0x00, 0x00, 0x3F, 0x70, 0xE3, 0xFF, 0x00, 0x3A, 0x05, 0x80, 0x10, 0x00, 0x11, 0xFF, 0x00 }, /* 10 */ }; typedef struct diff --git a/src/CxbxKrnl/EmuKrnlDbg.cpp b/src/core/kernel/exports/EmuKrnlDbg.cpp similarity index 86% rename from src/CxbxKrnl/EmuKrnlDbg.cpp rename to src/core/kernel/exports/EmuKrnlDbg.cpp index 6d1618dce..93fe00477 100644 --- a/src/CxbxKrnl/EmuKrnlDbg.cpp +++ b/src/core/kernel/exports/EmuKrnlDbg.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlDbg.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "DBG " +#define LOG_PREFIX CXBXR_MODULE::DBG // prevent name collisions namespace xboxkrnl @@ -50,11 +40,11 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { -#include "EmuNtDll.h" +#include "core\kernel\support\EmuNtDll.h" }; -#include "Emu.h" // For EmuWarning() +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) // ****************************************************************** // * 0x0005 - DbgBreakPoint() @@ -89,7 +79,7 @@ XBSYSAPI EXPORTNUM(7) xboxkrnl::NTSTATUS NTAPI xboxkrnl::DbgLoadImageSymbols IN ULONG_PTR ProcessId ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(Name) LOG_FUNC_ARG(Base) LOG_FUNC_ARG(ProcessId) @@ -110,7 +100,7 @@ XBSYSAPI EXPORTNUM(8) xboxkrnl::ULONG _cdecl xboxkrnl::DbgPrint PCHAR Format, ... ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(Format) LOG_FUNC_ARG("...") LOG_FUNC_END; @@ -124,7 +114,8 @@ XBSYSAPI EXPORTNUM(8) xboxkrnl::ULONG _cdecl xboxkrnl::DbgPrint vsprintf(szBuffer, Format, argp); va_end(argp); - printf(szBuffer); // Note : missing newlines can occur + // Allow DbgPrint to be disabled + EmuLog(LOG_LEVEL::INFO, "%s", szBuffer); fflush(stdout); } @@ -142,7 +133,7 @@ XBSYSAPI EXPORTNUM(10) xboxkrnl::ULONG NTAPI xboxkrnl::DbgPrompt IN ULONG MaximumResponseLength ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(Prompt) LOG_FUNC_ARG_OUT(Response) LOG_FUNC_ARG(MaximumResponseLength) @@ -166,7 +157,7 @@ XBSYSAPI EXPORTNUM(11) xboxkrnl::VOID NTAPI xboxkrnl::DbgUnLoadImageSymbols IN ULONG_PTR ProcessId ) { - LOG_FUNC_BEGIN + LOG_FUNC_BEGIN; LOG_FUNC_ARG(Name) LOG_FUNC_ARG(Base) LOG_FUNC_ARG(ProcessId) diff --git a/src/CxbxKrnl/EmuKrnlEx.cpp b/src/core/kernel/exports/EmuKrnlEx.cpp similarity index 96% rename from src/CxbxKrnl/EmuKrnlEx.cpp rename to src/core/kernel/exports/EmuKrnlEx.cpp index 7459919cf..46315a2bf 100644 --- a/src/CxbxKrnl/EmuKrnlEx.cpp +++ b/src/core/kernel/exports/EmuKrnlEx.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlEx.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::EX // prevent name collisions namespace xboxkrnl @@ -47,16 +37,16 @@ namespace xboxkrnl #include "Logging.h" // For LOG_FUNC() #include "EmuEEPROM.h" // For EmuFindEEPROMInfo, EEPROM, XboxFactoryGameRegion #include "EmuKrnlLogging.h" -#include "PoolManager.h" +#include "core\kernel\memory-manager\PoolManager.h" // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" // For NtDelayExecution(), etc. + #include "core\kernel\support\EmuNtDll.h" // For NtDelayExecution(), etc. }; -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) #include "EmuKrnl.h" // For InsertHeadList, InsertTailList, RemoveHeadList #include // for std::atomic @@ -145,7 +135,7 @@ static bool eeprom_data_is_valid(xboxkrnl::XC_VALUE_INDEX index) checksum = eeprom_section_checksum(FactorySettings_data, sizeof(EEPROM->FactorySettings)); } else { - EmuWarning("WARNING: Eeprom ValueIndex 0x%X does not have a checksum\n", index); + EmuLog(LOG_LEVEL::WARNING, "Eeprom ValueIndex 0x%X does not have a checksum\n", index); } return checksum == valid_checksum; } @@ -316,7 +306,7 @@ XBSYSAPI EXPORTNUM(20) xboxkrnl::VOID FASTCALL xboxkrnl::ExInterlockedAddLargeSt LOG_FUNC_ARG(Increment) LOG_FUNC_END; - auto &Target = std::atomic(Addend->QuadPart); + std::atomic Target(Addend->QuadPart); Target.fetch_add(Increment); } @@ -337,7 +327,7 @@ XBSYSAPI EXPORTNUM(21) xboxkrnl::LONGLONG FASTCALL xboxkrnl::ExInterlockedCompar LOG_FUNC_ARG(Comparand) LOG_FUNC_END; - auto &Target = std::atomic(*Destination); + std::atomic Target(*Destination); LONGLONG Result = *Comparand; Target.compare_exchange_strong(Result, *Exchange); diff --git a/src/CxbxKrnl/EmuKrnlFs.cpp b/src/core/kernel/exports/EmuKrnlFs.cpp similarity index 86% rename from src/CxbxKrnl/EmuKrnlFs.cpp rename to src/core/kernel/exports/EmuKrnlFs.cpp index 01f16bb2d..5ec1d9938 100644 --- a/src/CxbxKrnl/EmuKrnlFs.cpp +++ b/src/core/kernel/exports/EmuKrnlFs.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlFs.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::FSC // prevent name collisions namespace xboxkrnl @@ -50,10 +40,10 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { -#include "EmuNtDll.h" +#include "core\kernel\support\EmuNtDll.h" }; -#include "Emu.h" // For EmuWarning() +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) #define FSCACHE_MAXIMUM_NUMBER_OF_CACHE_PAGES 2048 diff --git a/src/CxbxKrnl/EmuKrnlHal.cpp b/src/core/kernel/exports/EmuKrnlHal.cpp similarity index 92% rename from src/CxbxKrnl/EmuKrnlHal.cpp rename to src/core/kernel/exports/EmuKrnlHal.cpp index e4d5628ed..2236052bf 100644 --- a/src/CxbxKrnl/EmuKrnlHal.cpp +++ b/src/core/kernel/exports/EmuKrnlHal.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlHal.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::HAL // prevent name collisions namespace xboxkrnl @@ -46,16 +36,18 @@ namespace xboxkrnl #include // For PathRemoveFileSpec() #include "Logging.h" // For LOG_FUNC() +#include "EmuKrnl.h" // For InitializeListHead(), etc. #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" // For CxbxKrnlCleanup, CxbxConvertArgToString, and CxbxExec -#include "Emu.h" // For EmuWarning() +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup, CxbxConvertArgToString, and CxbxExec +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) #include "EmuKrnl.h" -#include "EmuX86.h" // HalReadWritePciSpace needs this +#include "devices\x86\EmuX86.h" // HalReadWritePciSpace needs this #include "EmuShared.h" -#include "EmuFile.h" // For FindNtSymbolicLinkObjectByDriveLetter -#include "Common\EmuEEPROM.h" // For EEPROM +#include "core\kernel\support\EmuFile.h" // For FindNtSymbolicLinkObjectByDriveLetter +#include "common\EmuEEPROM.h" // For EEPROM #include "devices\Xbox.h" // For g_SMBus, SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER #include "devices\SMCDevice.h" // For SMC_COMMAND_SCRATCH +#include "common/util/strConverter.hpp" // for utf16_to_ascii #include // for std::replace #include @@ -69,14 +61,14 @@ uint8_t ResetOrShutdownCommandCode = 0; uint32_t ResetOrShutdownDataValue = 0; // global list of routines executed during a reboot -LIST_ENTRY_DEFINE_HEAD(ShutdownRoutineList); +xboxkrnl::LIST_ENTRY ShutdownRoutineList = { &ShutdownRoutineList , &ShutdownRoutineList }; // see InitializeListHead() // ****************************************************************** // * Declaring this in a header causes errors with xboxkrnl // * namespace, so we must declare it within any file that uses it // ****************************************************************** -xboxkrnl::KPCR* KeGetPcr(); +xboxkrnl::KPCR* WINAPI KeGetPcr(); // ****************************************************************** // * 0x0009 - HalReadSMCTrayState() @@ -239,7 +231,7 @@ XBSYSAPI EXPORTNUM(44) xboxkrnl::ULONG NTAPI xboxkrnl::HalGetInterruptVector *Irql = (KIRQL)VECTOR2IRQL(dwVector); #ifdef _DEBUG_TRACE - DbgPrintf("KRNL: HalGetInterruptVector(): Interrupt vector requested for %d (%s)\n", + EmuLog(LOG_LEVEL::DEBUG, "HalGetInterruptVector(): Interrupt vector requested for %d (%s)", BusInterruptLevel, IRQNames[BusInterruptLevel]); #endif } @@ -396,9 +388,9 @@ XBSYSAPI EXPORTNUM(47) xboxkrnl::VOID NTAPI xboxkrnl::HalRegisterShutdownNotific ListEntry = ShutdownRoutineList.Flink; while (ListEntry != &ShutdownRoutineList) { - if (ShutdownRegistration->Priority > LIST_ENTRY_ACCESS_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry)->Priority) + if (ShutdownRegistration->Priority > CONTAINING_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry)->Priority) { - LIST_ENTRY_INSERT_TAIL(ListEntry, &ShutdownRegistration->ListEntry) + InsertTailList(ListEntry, &ShutdownRegistration->ListEntry); break; } ListEntry = ListEntry->Flink; @@ -406,7 +398,7 @@ XBSYSAPI EXPORTNUM(47) xboxkrnl::VOID NTAPI xboxkrnl::HalRegisterShutdownNotific if (ListEntry == &ShutdownRoutineList) { - LIST_ENTRY_INSERT_TAIL(ListEntry, &ShutdownRegistration->ListEntry) + InsertTailList(ListEntry, &ShutdownRegistration->ListEntry); } } else @@ -414,9 +406,9 @@ XBSYSAPI EXPORTNUM(47) xboxkrnl::VOID NTAPI xboxkrnl::HalRegisterShutdownNotific ListEntry = ShutdownRoutineList.Flink; while (ListEntry != &ShutdownRoutineList) { - if (ShutdownRegistration == LIST_ENTRY_ACCESS_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry)) + if (ShutdownRegistration == CONTAINING_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry)) { - LIST_ENTRY_REMOVE(&ShutdownRegistration->ListEntry) + RemoveEntryList(&ShutdownRegistration->ListEntry); break; } ListEntry = ListEntry->Flink; @@ -509,14 +501,14 @@ XBSYSAPI EXPORTNUM(49) xboxkrnl::VOID DECLSPEC_NORETURN NTAPI xboxkrnl::HalRetur { OldIrql = KeRaiseIrqlToDpcLevel(); - ListEntry = LIST_ENTRY_REMOVE_AT_HEAD(&ShutdownRoutineList) + ListEntry = RemoveHeadList(&ShutdownRoutineList); KfLowerIrql(OldIrql); if (ListEntry == &ShutdownRoutineList) break; - ShutdownRegistration = LIST_ENTRY_ACCESS_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry); + ShutdownRegistration = CONTAINING_RECORD(ListEntry, HAL_SHUTDOWN_REGISTRATION, ListEntry); ShutdownRegistration->NotificationRoutine(ShutdownRegistration); } #endif @@ -539,13 +531,13 @@ XBSYSAPI EXPORTNUM(49) xboxkrnl::VOID DECLSPEC_NORETURN NTAPI xboxkrnl::HalRetur std::string XbePath = TitlePath; // Convert Xbox XBE Path to Windows Path { - HANDLE rootDirectoryHandle; + HANDLE rootDirectoryHandle = nullptr; std::wstring wXbePath; // We pretend to come from NtCreateFile to force symbolic link resolution CxbxConvertFilePath(TitlePath, wXbePath, &rootDirectoryHandle, "NtCreateFile"); // Convert Wide String as returned by above to a string, for XbePath - XbePath = std::wstring_convert>().to_bytes(wXbePath); + XbePath = utf16_to_ascii(wXbePath.c_str()); // If the rootDirectoryHandle is not null, we have a relative path // We need to prepend the path of the root directory to get a full DOS path @@ -575,9 +567,8 @@ XBSYSAPI EXPORTNUM(49) xboxkrnl::VOID DECLSPEC_NORETURN NTAPI xboxkrnl::HalRetur QuickReboot |= BOOT_QUICK_REBOOT; g_EmuShared->SetBootFlags(&QuickReboot); - // Some titles (Xbox Dashboard) use ";" as a final path seperator - // This allows the Xbox Live option on the dashboard to properly launch XOnlinedash.xbe - std::replace(XbePath.begin(), XbePath.end(), ';', '\\'); + // Some titles (Xbox Dashboard and retail/demo discs) use ";" as a current directory path seperator + // This process is handled during initialization. No speical handling here required. std::string szProcArgsBuffer; CxbxConvertArgToString(szProcArgsBuffer, szFilePath_CxbxReloaded_Exe, XbePath.c_str(), CxbxKrnl_hEmuParent, CxbxKrnl_DebugMode, CxbxKrnl_DebugFileName.c_str()); @@ -601,14 +592,11 @@ XBSYSAPI EXPORTNUM(49) xboxkrnl::VOID DECLSPEC_NORETURN NTAPI xboxkrnl::HalRetur xboxkrnl::HalWriteSMBusValue(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, SMC_COMMAND_SCRATCH, 0, SMC_SCRATCH_DISPLAY_FATAL_ERROR); - char szWorkingDirectoy[MAX_PATH]; - g_EmuShared->GetXbePath(szWorkingDirectoy); - std::string szProcArgsBuffer; - CxbxConvertArgToString(szProcArgsBuffer, szFilePath_CxbxReloaded_Exe, szWorkingDirectoy, CxbxKrnl_hEmuParent, CxbxKrnl_DebugMode, CxbxKrnl_DebugFileName.c_str()); + CxbxConvertArgToString(szProcArgsBuffer, szFilePath_CxbxReloaded_Exe, szFilePath_Xbe, CxbxKrnl_hEmuParent, CxbxKrnl_DebugMode, CxbxKrnl_DebugFileName.c_str()); if (!CxbxExec(szProcArgsBuffer, nullptr, false)) { - CxbxKrnlCleanup("Could not launch %s", szWorkingDirectoy); + CxbxKrnlCleanup("Could not launch %s", szFilePath_Xbe); } break; } @@ -791,7 +779,7 @@ XBSYSAPI EXPORTNUM(334) xboxkrnl::VOID NTAPI xboxkrnl::WRITE_PORT_BUFFER_ULONG // ****************************************************************** // * 0x0164 - HalBootSMCVideoMode // ****************************************************************** -// TODO: Verify this! +// TODO: This should be set to whichever AV Pack is read from the SMC at boot time XBSYSAPI EXPORTNUM(356) xboxkrnl::DWORD xboxkrnl::HalBootSMCVideoMode = 1; // TODO : AV_PACK_STANDARD? // ****************************************************************** diff --git a/src/CxbxKrnl/EmuKrnlIo.cpp b/src/core/kernel/exports/EmuKrnlIo.cpp similarity index 96% rename from src/CxbxKrnl/EmuKrnlIo.cpp rename to src/core/kernel/exports/EmuKrnlIo.cpp index 69c084fb4..64732e885 100644 --- a/src/CxbxKrnl/EmuKrnlIo.cpp +++ b/src/core/kernel/exports/EmuKrnlIo.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlIo.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::IO // prevent name collisions namespace xboxkrnl @@ -46,9 +36,9 @@ namespace xboxkrnl #include "Logging.h" // For LOG_FUNC() #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() -#include "EmuFile.h" // For CxbxCreateSymbolicLink(), etc. +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "core\kernel\support\EmuFile.h" // For CxbxCreateSymbolicLink(), etc. #include "CxbxDebugger.h" // ****************************************************************** @@ -303,11 +293,11 @@ XBSYSAPI EXPORTNUM(66) xboxkrnl::NTSTATUS NTAPI xboxkrnl::IoCreateFile if (FAILED(ret)) { - EmuWarning("KRNL: IoCreateFile Failed! (%s)\n", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "IoCreateFile Failed! (%s)\n", NtStatusToString(ret)); } else { - DbgPrintf("KRNL: IoCreateFile = 0x%.8X\n", *FileHandle); + EmuLog(LOG_LEVEL::DEBUG, "IoCreateFile = 0x%.8X", *FileHandle); } RETURN(ret); diff --git a/src/CxbxKrnl/EmuKrnlKd.cpp b/src/core/kernel/exports/EmuKrnlKd.cpp similarity index 81% rename from src/CxbxKrnl/EmuKrnlKd.cpp rename to src/core/kernel/exports/EmuKrnlKd.cpp index 486366a52..f628cd884 100644 --- a/src/CxbxKrnl/EmuKrnlKd.cpp +++ b/src/core/kernel/exports/EmuKrnlKd.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlEx.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,15 +25,16 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::KD // prevent name collisions namespace xboxkrnl { #include // For KdDebuggerEnabled, etc. -}; +}; + +#include "Logging.h" // ****************************************************************** // * 0x0058 - KdDebuggerEnabled diff --git a/src/CxbxKrnl/EmuKrnlKe.cpp b/src/core/kernel/exports/EmuKrnlKe.cpp similarity index 59% rename from src/CxbxKrnl/EmuKrnlKe.cpp rename to src/core/kernel/exports/EmuKrnlKe.cpp index f5605043f..2327e471f 100644 --- a/src/CxbxKrnl/EmuKrnlKe.cpp +++ b/src/core/kernel/exports/EmuKrnlKe.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlKe.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,10 +24,45 @@ // * // * All rights reserved // * -// ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ +// ****************************************************************** + +// Acknowledgment (timer functions): ReactOS (GPLv2) +// https://github.com/reactos/reactos + +// KeSetSystemTime +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/clock.c +* PURPOSE: System Clock Support +* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +// KeInitializeTimerEx, KeSetTimer, KeSetTimerEx, KeCancelTimer +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/timerobj.c +* PURPOSE: Handle Kernel Timers (Kernel-part of Executive Timers) +* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +// COPYING file: +/* +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +ReactOS may be used, runtime linked, and distributed with non-free software +(meaning that such software has no obligations to open-source, or render +free, their non-free code) such as commercial device drivers and commercial +applications. This exception does not alter any other responsibilities of +the licensee under the GPL (meaning that such software must still obey +the GPL for the free ("open-sourced") code that has been integrated into +the said software). +*/ -#define LOG_PREFIX "KRNL" + +#define LOG_PREFIX CXBXR_MODULE::KE // prevent name collisions namespace xboxkrnl @@ -50,14 +76,16 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" // For NtDelayExecution(), etc. + #include "core\kernel\support\EmuNtDll.h" // For NtDelayExecution(), etc. }; -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) #include "EmuKrnl.h" // For InitializeListHead(), etc. -#include "EmuKrnlKi.h" // For KiRemoveTreeTimer(), KiInsertTreeTimer() -#include "EmuFile.h" // For IsEmuHandle(), NtStatusToString() +#include "EmuKrnlKi.h" // For KiRemoveTreeTimer(), KiInsertTreeTimer() +#include "EmuKrnlKe.h" +#include "core\kernel\support\EmuFile.h" // For IsEmuHandle(), NtStatusToString() +#include "Timer.h" #include #include @@ -70,12 +98,9 @@ typedef struct _DpcData { CRITICAL_SECTION Lock; HANDLE DpcEvent; xboxkrnl::LIST_ENTRY DpcQueue; // TODO : Use KeGetCurrentPrcb()->DpcListHead instead - xboxkrnl::LIST_ENTRY TimerQueue; } DpcData; -DpcData g_DpcData = { 0 }; // Note : g_DpcData is initialized in InitDpcAndTimerThread() - -std::map g_KeEventHandles; +DpcData g_DpcData = { 0 }; // Note : g_DpcData is initialized in InitDpcThread() xboxkrnl::ULONGLONG LARGE_INTEGER2ULONGLONG(xboxkrnl::LARGE_INTEGER value) { @@ -84,20 +109,42 @@ xboxkrnl::ULONGLONG LARGE_INTEGER2ULONGLONG(xboxkrnl::LARGE_INTEGER value) return *((PULONGLONG)&value); } +#define TestForAlertPending(Alertable) \ + if (Alertable) { \ + if (Thread->Alerted[WaitMode] != FALSE) { \ + Thread->Alerted[WaitMode] = FALSE; \ + WaitStatus = STATUS_ALERTED; \ + break; \ + } else if ((WaitMode != KernelMode) && \ + (IsListEmpty(&Thread->ApcState.ApcListHead[UserMode])) == FALSE) { \ + Thread->ApcState.UserApcPending = TRUE; \ + WaitStatus = STATUS_USER_APC; \ + break; \ + } else if (Thread->Alerted[KernelMode] != FALSE) { \ + Thread->Alerted[KernelMode] = FALSE; \ + WaitStatus = STATUS_ALERTED; \ + break; \ + } \ + } else if ((WaitMode != KernelMode) && (Thread->ApcState.UserApcPending)) { \ + WaitStatus = STATUS_USER_APC; \ + break; \ + } + + // ****************************************************************** // * KeGetPcr() // * NOTE: This is a macro on the Xbox, however we implement it // * as a function so it can suit our emulated KPCR structure // ****************************************************************** -xboxkrnl::KPCR* KeGetPcr() +xboxkrnl::KPCR* WINAPI KeGetPcr() { xboxkrnl::PKPCR Pcr; // See EmuKeSetPcr() Pcr = (xboxkrnl::PKPCR)__readfsdword(TIB_ArbitraryDataSlot); - + if (Pcr == nullptr) { - EmuWarning("KeGetPCR returned nullptr: Was this called from a non-xbox thread?"); + EmuLog(LOG_LEVEL::WARNING, "KeGetPCR returned nullptr: Was this called from a non-xbox thread?"); // Attempt to salvage the situation by calling InitXboxThread to setup KPCR in place InitXboxThread(g_CPUXbox); Pcr = (xboxkrnl::PKPCR)__readfsdword(TIB_ArbitraryDataSlot); @@ -112,8 +159,115 @@ xboxkrnl::KPCR* KeGetPcr() xboxkrnl::KPRCB *KeGetCurrentPrcb() { return &(KeGetPcr()->PrcbData); +} + +// ****************************************************************** +// * KeSetSystemTime() +// ****************************************************************** +xboxkrnl::VOID NTAPI xboxkrnl::KeSetSystemTime +( + IN xboxkrnl::PLARGE_INTEGER NewTime, + OUT xboxkrnl::PLARGE_INTEGER OldTime +) +{ + KIRQL OldIrql, OldIrql2; + LARGE_INTEGER DeltaTime, HostTime; + PLIST_ENTRY ListHead, NextEntry; + PKTIMER Timer; + LIST_ENTRY TempList, TempList2; + ULONG Hand, i; + + /* Sanity checks */ + assert((NewTime->u.HighPart & 0xF0000000) == 0); + assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); + + /* Lock the dispatcher, and raise IRQL */ + KiTimerLock(); + KiLockDispatcherDatabase(&OldIrql); + OldIrql2 = KfRaiseIrql(HIGH_LEVEL); + + /* Query the system time now */ + KeQuerySystemTime(OldTime); + + /* Surely, we won't set the system time here, but we CAN remember a delta to the host system time */ + HostTime.QuadPart = OldTime->QuadPart - HostSystemTimeDelta.load(); + HostSystemTimeDelta = NewTime->QuadPart - HostTime.QuadPart; + + /* Calculate the difference between the new and the old time */ + DeltaTime.QuadPart = NewTime->QuadPart - OldTime->QuadPart; + + /* Lower IRQL back */ + KfLowerIrql(OldIrql2); + + /* Setup a temporary list of absolute timers */ + InitializeListHead(&TempList); + + /* Loop current timers */ + for (i = 0; i < TIMER_TABLE_SIZE; i++) + { + /* Loop the entries in this table and lock the timers */ + ListHead = &KiTimerTableListHead[i].Entry; + NextEntry = ListHead->Flink; + while (NextEntry != ListHead) + { + /* Get the timer */ + Timer = CONTAINING_RECORD(NextEntry, KTIMER, TimerListEntry); + NextEntry = NextEntry->Flink; + + /* Is it absolute? */ + if (Timer->Header.Absolute) + { + /* Remove it from the timer list */ + KiRemoveEntryTimer(Timer, i); + + /* Insert it into our temporary list */ + InsertTailList(&TempList, &Timer->TimerListEntry); + } + } + } + + /* Setup a temporary list of expired timers */ + InitializeListHead(&TempList2); + + /* Loop absolute timers */ + while (TempList.Flink != &TempList) + { + /* Get the timer */ + Timer = CONTAINING_RECORD(TempList.Flink, KTIMER, TimerListEntry); + RemoveEntryList(&Timer->TimerListEntry); + + /* Update the due time and handle */ + Timer->DueTime.QuadPart -= DeltaTime.QuadPart; + Hand = KiComputeTimerTableIndex(Timer->DueTime.QuadPart); + + /* Lock the timer and re-insert it */ + if (KiInsertTimerTable(Timer, Hand)) + { + /* Remove it from the timer list */ + KiRemoveEntryTimer(Timer, Hand); + + /* Insert it into our temporary list */ + InsertTailList(&TempList2, &Timer->TimerListEntry); + } + } + + /* Process expired timers. This releases the dispatcher and timer locks */ + KiTimerListExpire(&TempList2, OldIrql); } +// ****************************************************************** +// * KeInitializeTimer() +// ****************************************************************** +xboxkrnl::VOID NTAPI xboxkrnl::KeInitializeTimer +( + IN PKTIMER Timer +) +{ + LOG_FORWARD("KeInitializeTimerEx"); + + KeInitializeTimerEx(Timer, NotificationTimer); +} + // Forward KeLowerIrql() to KfLowerIrql() #define KeLowerIrql(NewIrql) \ KfLowerIrql(NewIrql) @@ -122,23 +276,9 @@ xboxkrnl::KPRCB *KeGetCurrentPrcb() #define KeRaiseIrql(NewIrql, OldIrql) \ *(OldIrql) = KfRaiseIrql(NewIrql) -ULONGLONG BootTickCount = 0; - -// The Xbox GetTickCount is measured in milliseconds, just like the native GetTickCount. -// The only difference we'll take into account here, is that the Xbox will probably reboot -// much more often than Windows, so we correct this with a 'BootTickCount' value : -DWORD CxbxXboxGetTickCount() -{ - return (DWORD)(GetTickCount64() - BootTickCount); -} - -DWORD ExecuteDpcQueue() +void ExecuteDpcQueue() { xboxkrnl::PKDPC pkdpc; - DWORD dwWait; - DWORD dwNow; - LONG lWait; - xboxkrnl::PKTIMER pktimer; // While we're working with the DpcQueue, we need to be thread-safe : EnterCriticalSection(&(g_DpcData.Lock)); @@ -160,7 +300,7 @@ DWORD ExecuteDpcQueue() pkdpc->Inserted = FALSE; // Set DpcRoutineActive to support KeIsExecutingDpc: KeGetCurrentPrcb()->DpcRoutineActive = TRUE; // Experimental - DbgPrintf("KRNL: Global DpcQueue, calling DPC at 0x%.8X\n", pkdpc->DeferredRoutine); + EmuLog(LOG_LEVEL::DEBUG, "Global DpcQueue, calling DPC at 0x%.8X", pkdpc->DeferredRoutine); __try { // Call the Deferred Procedure : pkdpc->DeferredRoutine( @@ -170,116 +310,69 @@ DWORD ExecuteDpcQueue() pkdpc->SystemArgument2); } __except (EmuException(GetExceptionInformation())) { - EmuWarning("Problem with ExceptionFilter!"); + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); } KeGetCurrentPrcb()->DpcRoutineActive = FALSE; // Experimental } - dwWait = INFINITE; - if (!IsListEmpty(&(g_DpcData.TimerQueue))) - { - while (true) - { - dwNow = CxbxXboxGetTickCount(); - dwWait = INFINITE; - pktimer = (xboxkrnl::PKTIMER)g_DpcData.TimerQueue.Flink; - pkdpc = nullptr; - while (pktimer != (xboxkrnl::PKTIMER)&(g_DpcData.TimerQueue)) - { - lWait = (LONG)pktimer->DueTime.u.LowPart - dwNow; - if (lWait <= 0) - { - pktimer->DueTime.u.LowPart = pktimer->Period + dwNow; - pkdpc = pktimer->Dpc; - break; // while - } - - if (dwWait > (DWORD)lWait) - dwWait = (DWORD)lWait; - - pktimer = (xboxkrnl::PKTIMER)pktimer->TimerListEntry.Flink; - } - - if (pkdpc == nullptr) - break; // while - - DbgPrintf("KRNL: Global TimerQueue, calling DPC at 0x%.8X\n", pkdpc->DeferredRoutine); - __try { - pkdpc->DeferredRoutine( - pkdpc, - pkdpc->DeferredContext, - pkdpc->SystemArgument1, - pkdpc->SystemArgument2); - } __except (EmuException(GetExceptionInformation())) - { - EmuWarning("Problem with ExceptionFilter!"); - } - } - } - // Assert(g_DpcData._dwThreadId == GetCurrentThreadId()); // Assert(g_DpcData._dwDpcThreadId == g_DpcData._dwThreadId); // g_DpcData._dwDpcThreadId = 0; LeaveCriticalSection(&(g_DpcData.Lock)); - - return dwWait; } -void InitDpcAndTimerThread() +void InitDpcThread() { DWORD dwThreadId = 0; InitializeCriticalSection(&(g_DpcData.Lock)); InitializeListHead(&(g_DpcData.DpcQueue)); - InitializeListHead(&(g_DpcData.TimerQueue)); - - DbgPrintf("INIT: Creating DPC event\n"); + EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Creating DPC event\n"); g_DpcData.DpcEvent = CreateEvent(/*lpEventAttributes=*/nullptr, /*bManualReset=*/FALSE, /*bInitialState=*/FALSE, /*lpName=*/nullptr); } -// Xbox Performance Counter Frequency = 733333333 (CPU Clock) -#define XBOX_PERFORMANCE_FREQUENCY 733333333 -uint64_t NativeToXbox_FactorForPerformanceFrequency; +#define XBOX_TSC_FREQUENCY 733333333 // Xbox Time Stamp Counter Frequency = 733333333 (CPU Clock) +#define XBOX_ACPI_FREQUENCY 3375000 // Xbox ACPI frequency (3.375 mhz) +ULONGLONG NativeToXbox_FactorForRdtsc; +ULONGLONG NativeToXbox_FactorForAcpi; -void ConnectKeInterruptTimeToThunkTable(); // forward - -uint64_t CxbxRdTsc(bool xbox) { +ULONGLONG CxbxGetPerformanceCounter(bool acpi) { LARGE_INTEGER tsc; + ULARGE_INTEGER scaledTsc; + + QueryPerformanceCounter(&tsc); + + scaledTsc.QuadPart = 1000000000; + scaledTsc.QuadPart *= (ULONGLONG)tsc.QuadPart; - QueryPerformanceCounter(&tsc); - - if (xbox && NativeToXbox_FactorForPerformanceFrequency) { - LARGE_INTEGER scaledTsc; - scaledTsc.QuadPart = 1000000000; - scaledTsc.QuadPart *= tsc.QuadPart; - scaledTsc.QuadPart /= NativeToXbox_FactorForPerformanceFrequency; - return (uint64_t)scaledTsc.QuadPart; + if (acpi == false && NativeToXbox_FactorForRdtsc) { + scaledTsc.QuadPart /= NativeToXbox_FactorForRdtsc; + return scaledTsc.QuadPart; + } else if (acpi == true && NativeToXbox_FactorForRdtsc) { + scaledTsc.QuadPart /= NativeToXbox_FactorForAcpi; + return scaledTsc.QuadPart; } return (uint64_t)tsc.QuadPart; } -uint64_t CxbxCalibrateTsc() -{ - LARGE_INTEGER pf; - QueryPerformanceFrequency(&pf); - return pf.QuadPart; -} - void CxbxInitPerformanceCounters() { - LARGE_INTEGER t; - t.QuadPart = 1000000000; - t.QuadPart *= CxbxCalibrateTsc(); - t.QuadPart /= XBOX_PERFORMANCE_FREQUENCY; - NativeToXbox_FactorForPerformanceFrequency = t.QuadPart; + uint64_t t; + t = 1000000000; + t *= HostClockFrequency; + t /= XBOX_TSC_FREQUENCY; + NativeToXbox_FactorForRdtsc = t; + + t = 1000000000; + t *= HostClockFrequency; + t /= XBOX_ACPI_FREQUENCY; + NativeToXbox_FactorForAcpi = t; - ConnectKeInterruptTimeToThunkTable(); - - // Let's initialize the Dpc and timer handling thread too, + // Let's initialize the Dpc handling thread too, // here for now (should be called by our caller) - InitDpcAndTimerThread(); + InitDpcThread(); } // ****************************************************************** @@ -411,16 +504,28 @@ XBSYSAPI EXPORTNUM(96) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeCancelTimer IN PKTIMER Timer ) { - LOG_FUNC_ONE_ARG(Timer); - - BOOLEAN Inserted; - - Inserted = Timer->Header.Inserted; - if (Inserted != FALSE) { - // Do some unlinking if already inserted in the linked list - KiRemoveTreeTimer(Timer); - } - + LOG_FUNC_ONE_ARG(Timer); + + KIRQL OldIrql; + BOOLEAN Inserted; + + assert(Timer); + + /* Lock the Database and Raise IRQL */ + KiTimerLock(); + KiLockDispatcherDatabase(&OldIrql); + + /* Check if it's inserted, and remove it if it is */ + Inserted = Timer->Header.Inserted; + if (Inserted) { + KxRemoveTreeTimer(Timer); + } + + /* Release Dispatcher Lock */ + KiUnlockDispatcherDatabase(OldIrql); + KiTimerUnlock(); + + /* Return the old state */ RETURN(Inserted); } @@ -640,28 +745,20 @@ XBSYSAPI EXPORTNUM(108) xboxkrnl::VOID NTAPI xboxkrnl::KeInitializeEvent LOG_FUNC_ARG(Type) LOG_FUNC_ARG(SignalState) LOG_FUNC_END; + + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, it is already initialized so no need tod o anything + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Event, &flags)) { + return; + } // Setup the Xbox event struct Event->Header.Type = Type; Event->Header.Size = sizeof(KEVENT) / sizeof(LONG); Event->Header.SignalState = SignalState; InitializeListHead(&(Event->Header.WaitListHead)); - - - // Create a Windows event, to be used in KeWaitForObject - // TODO: This doesn't check for events that are already initialized - // This shouldn't happen, except on shoddily coded titles so we - // ignore it for now - HANDLE hostEvent; - if (Type == NotificationEvent) - { - hostEvent = CreateEvent(NULL, TRUE, SignalState, NULL); - } - else { - hostEvent = CreateEvent(NULL, FALSE, SignalState, NULL); - } - - g_KeEventHandles[Event] = hostEvent; } // ****************************************************************** @@ -805,7 +902,9 @@ XBSYSAPI EXPORTNUM(113) xboxkrnl::VOID NTAPI xboxkrnl::KeInitializeTimerEx LOG_FUNC_BEGIN LOG_FUNC_ARG(Timer) LOG_FUNC_ARG(Type) - LOG_FUNC_END; + LOG_FUNC_END; + + assert(Timer); // Initialize header : Timer->Header.Type = Type + TimerNotificationObject; @@ -1009,14 +1108,7 @@ XBSYSAPI EXPORTNUM(121) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeIsExecutingDpc // ****************************************************************** // * 0x0078 - KeInterruptTime // ****************************************************************** -// Dxbx note : This was once a value, but instead we now point to -// the native Windows versions (see ConnectWindowsTimersToThunkTable) : -XBSYSAPI EXPORTNUM(120) xboxkrnl::PKSYSTEM_TIME xboxkrnl::KeInterruptTime = nullptr; // Set by ConnectKeInterruptTimeToThunkTable - -void ConnectKeInterruptTimeToThunkTable() -{ - xboxkrnl::KeInterruptTime = (xboxkrnl::PKSYSTEM_TIME)CxbxKrnl_KernelThunkTable[120]; -} +XBSYSAPI EXPORTNUM(120) xboxkrnl::KSYSTEM_TIME xboxkrnl::KeInterruptTime = { 0, 0, 0 }; // ****************************************************************** // * 0x007A - KeLeaveCriticalRegion() @@ -1052,17 +1144,39 @@ XBSYSAPI EXPORTNUM(123) xboxkrnl::LONG NTAPI xboxkrnl::KePulseEvent LOG_FUNC_ARG(Wait) LOG_FUNC_END; - // Fetch the host event and signal it, if present - if (g_KeEventHandles.find(Event) == g_KeEventHandles.end()) { - EmuWarning("KePulseEvent called on a non-existant event!"); - } - else { - PulseEvent(g_KeEventHandles[Event]); + KIRQL OldIrql; + KiLockDispatcherDatabase(&OldIrql); + + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must call the NtDll function + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Event, &flags)) { + KiUnlockDispatcherDatabase(OldIrql); + return NtDll::NtPulseEvent((HANDLE)Event, nullptr); + } + + LONG OldState = Event->Header.SignalState; + if ((OldState == 0) && (IsListEmpty(&Event->Header.WaitListHead) == FALSE)) { + Event->Header.SignalState = 1; + // TODO: KiWaitTest(Event, Increment); + // For now, we just sleep to give other threads time to wake + // KiWaitTest and related functions require correct thread scheduling to implement first + // This will have to wait until CPU emulation at v1.0 + Sleep(1); } - LOG_UNIMPLEMENTED(); + Event->Header.SignalState = 0; - RETURN(0); + if (Wait != FALSE) { + PRKTHREAD Thread = KeGetCurrentThread(); + Thread->WaitIrql = OldIrql; + Thread->WaitNext = Wait; + } else { + KiUnlockDispatcherDatabase(OldIrql); + } + + RETURN(OldState); } XBSYSAPI EXPORTNUM(124) xboxkrnl::LONG NTAPI xboxkrnl::KeQueryBasePriorityThread @@ -1092,16 +1206,14 @@ XBSYSAPI EXPORTNUM(125) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryInterruptTime while (true) { - // Don't use NtDll::QueryInterruptTime, it's too new (Windows 10) - // Instead, read KeInterruptTime from our kernel thunk table, - // which we coupled to the host InterruptTime in ConnectWindowsTimersToThunkTable: - InterruptTime.u.HighPart = KeInterruptTime->High1Time; - InterruptTime.u.LowPart = KeInterruptTime->LowPart; - // TODO : Should we apply HostSystemTimeDelta to InterruptTime too? + // Don't use NtDll::QueryInterruptTime, it's too new (Windows 10). + // Instead, read KeInterruptTime from our kernel thunk table. + InterruptTime.u.HighPart = KeInterruptTime.High1Time; + InterruptTime.u.LowPart = KeInterruptTime.LowPart; // Read InterruptTime atomically with a spinloop to avoid errors // when High1Time and High2Time differ (during unprocessed overflow in LowPart). - if (InterruptTime.u.HighPart == KeInterruptTime->High2Time) + if (InterruptTime.u.HighPart == KeInterruptTime.High2Time) break; } @@ -1110,19 +1222,15 @@ XBSYSAPI EXPORTNUM(125) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryInterruptTime } // ****************************************************************** -// * 0x007E - KeQueryPerformanceCounter() +// * 0x007E - KeQueryPerformanceCounter() +// NOTE: The KeQueryPerformance* functions run at the ACPI clock +// The XAPI QueryPerformance* functions run at the TSC clock // ****************************************************************** XBSYSAPI EXPORTNUM(126) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryPerformanceCounter(void) { LOG_FUNC(); - ULONGLONG ret; - - //no matter rdtsc is patched or not, we should always return a scaled performance counter here. - DbgPrintf("host tick count : %lu\n", CxbxRdTsc(false)); - ret = CxbxRdTsc(true); - DbgPrintf("emulated tick count : %lu\n", ret); - + ret = CxbxGetPerformanceCounter(/*acpi=*/true); RETURN(ret); } @@ -1132,11 +1240,7 @@ XBSYSAPI EXPORTNUM(126) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryPerformanceCo XBSYSAPI EXPORTNUM(127) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryPerformanceFrequency(void) { LOG_FUNC(); - - // Dxbx note : We return the real Xbox1 frequency here, - // to make subsequent calculations behave the same as on the real Xbox1 : - ULONGLONG ret = XBOX_PERFORMANCE_FREQUENCY; - + ULONGLONG ret = XBOX_ACPI_FREQUENCY; RETURN(ret); } @@ -1149,15 +1253,21 @@ XBSYSAPI EXPORTNUM(128) xboxkrnl::VOID NTAPI xboxkrnl::KeQuerySystemTime ) { LOG_FUNC_ONE_ARG(CurrentTime); + + LARGE_INTEGER SystemTime; - if (CurrentTime != NULL) + while (true) { - LARGE_INTEGER HostSystemTime; - GetSystemTimeAsFileTime((LPFILETIME)&HostSystemTime); // Available since Windows 2000 (NOT on XP!) + SystemTime.u.HighPart = KeSystemTime.High1Time; + SystemTime.u.LowPart = KeSystemTime.LowPart; - // Apply the delta set in xboxkrnl::NtSetSystemTime to get the Xbox system time : - CurrentTime->QuadPart = HostSystemTime.QuadPart + HostSystemTimeDelta.QuadPart; + // Read SystemTime atomically with a spinloop to avoid errors + // when High1Time and High2Time differ (during unprocessed overflow in LowPart). + if (SystemTime.u.HighPart == KeSystemTime.High2Time) + break; } + + *CurrentTime = SystemTime; } // ****************************************************************** @@ -1374,20 +1484,23 @@ XBSYSAPI EXPORTNUM(138) xboxkrnl::LONG NTAPI xboxkrnl::KeResetEvent { LOG_FUNC_ONE_ARG(Event); - // TODO : Untested & incomplete - LONG ret = Event->Header.SignalState; + KIRQL OldIrql; + KiLockDispatcherDatabase(&OldIrql); + + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must call the NtDll function + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Event, &flags)) { + KiUnlockDispatcherDatabase(OldIrql); + return NtDll::NtResetEvent((HANDLE)Event, nullptr); + } + + LONG OldState = Event->Header.SignalState; Event->Header.SignalState = 0; - // Fetch the host event and signal it, if present - if (g_KeEventHandles.find(Event) == g_KeEventHandles.end()) { - EmuWarning("KeResetEvent called on a non-existant event!"); - } - else { - ResetEvent(g_KeEventHandles[Event]); - } - - - return ret; + KiUnlockDispatcherDatabase(OldIrql); + return OldState; } // ****************************************************************** @@ -1516,29 +1629,49 @@ XBSYSAPI EXPORTNUM(145) xboxkrnl::LONG NTAPI xboxkrnl::KeSetEvent LOG_FUNC_ARG(Wait) LOG_FUNC_END; - // TODO : Untested & incomplete - LONG ret = Event->Header.SignalState; - Event->Header.SignalState = TRUE; - - // Fetch the host event and signal it, if present - if (g_KeEventHandles.find(Event) == g_KeEventHandles.end()) { - EmuWarning("KeSetEvent called on a non-existant event. Creating it!"); - // TODO: Find out why some XDKs do not call KeInitializeEvent first - - //We can check the event type from the internal structure, see https://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/kobjects.htm?tx=111 - if ((Event->Header.Type & 0x7F) == 0x01) - { - KeInitializeEvent(Event, NotificationEvent, TRUE); - } - else { - KeInitializeEvent(Event, SynchronizationEvent, TRUE); - } - - } else { - SetEvent(g_KeEventHandles[Event]); + KIRQL OldIrql; + KiLockDispatcherDatabase(&OldIrql); + + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must call the NtDll function + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Event, &flags)) { + KiUnlockDispatcherDatabase(OldIrql); + return NtDll::NtSetEvent((HANDLE)Event, nullptr); } - RETURN(ret); + LONG OldState = Event->Header.SignalState; + if (IsListEmpty(&Event->Header.WaitListHead) != FALSE) { + Event->Header.SignalState = 1; + } else { + PKWAIT_BLOCK WaitBlock = CONTAINING_RECORD(Event->Header.WaitListHead.Flink, KWAIT_BLOCK, WaitListEntry); + if ((Event->Header.Type == NotificationEvent) || + (WaitBlock->WaitType != WaitAny)) { + if (OldState == 0) { + Event->Header.SignalState = 1; + // TODO: KiWaitTest(Event, Increment); + // For now, we just sleep to give other threads time to wake + // See KePulseEvent + Sleep(1); + } + } else { + // TODO: KiUnwaitThread(WaitBlock->Thread, (NTSTATUS)WaitBlock->WaitKey, Increment); + // For now, we just sleep to give other threads time to wake + // See KePulseEvent + Sleep(1); + } + } + + if (Wait != FALSE) { + PRKTHREAD Thread = KeGetCurrentThread(); + Thread->WaitNext = Wait; + Thread->WaitIrql = OldIrql; + } else { + KiUnlockDispatcherDatabase(OldIrql); + } + + RETURN(OldState); } XBSYSAPI EXPORTNUM(146) xboxkrnl::VOID NTAPI xboxkrnl::KeSetEventBoostPriority @@ -1551,8 +1684,35 @@ XBSYSAPI EXPORTNUM(146) xboxkrnl::VOID NTAPI xboxkrnl::KeSetEventBoostPriority LOG_FUNC_ARG(Event) LOG_FUNC_ARG(Thread) LOG_FUNC_END; + KIRQL OldIrql; + KiLockDispatcherDatabase(&OldIrql); + + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must do nothing. Anything else *will* cause crashes + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Event, &flags)) { + KiUnlockDispatcherDatabase(OldIrql); + return; + } - LOG_UNIMPLEMENTED(); + if (IsListEmpty(&Event->Header.WaitListHead) != FALSE) { + Event->Header.SignalState = 1; + } else { + PRKTHREAD WaitThread = CONTAINING_RECORD(Event->Header.WaitListHead.Flink, KWAIT_BLOCK, WaitListEntry)->Thread; + + if (Thread != nullptr) { + *Thread = WaitThread; + } + + WaitThread->Quantum = WaitThread->ApcState.Process->ThreadQuantum; + // TODO: KiUnwaitThread(WaitThread, STATUS_SUCCESS, 1); + // For now, we just sleep to give other threads time to wake + // See KePulseEvent + Sleep(1); + } + + KiUnlockDispatcherDatabase(OldIrql); } XBSYSAPI EXPORTNUM(147) xboxkrnl::KPRIORITY NTAPI xboxkrnl::KeSetPriorityProcess @@ -1623,58 +1783,49 @@ XBSYSAPI EXPORTNUM(150) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeSetTimerEx LOG_FUNC_ARG(DueTime) LOG_FUNC_ARG(Period) LOG_FUNC_ARG(Dpc) - LOG_FUNC_END; + LOG_FUNC_END; - BOOLEAN Inserted; - LARGE_INTEGER Interval; - LARGE_INTEGER SystemTime; - - if (Timer->Header.Type != TimerNotificationObject && Timer->Header.Type != TimerSynchronizationObject) { - CxbxKrnlCleanup("Assertion: '(Timer)->Header.Type == TimerNotificationObject) || ((Timer)->Header.Type == TimerSynchronizationObject)' in KeSetTimerEx()"); - } + BOOLEAN Inserted; + BOOLEAN RequestInterrupt = FALSE; + KIRQL OldIrql; + ULONG Hand; + + assert(Timer); + assert(Timer->Header.Type == TimerNotificationObject || Timer->Header.Type == TimerSynchronizationObject); + + KiTimerLock(); + KiLockDispatcherDatabase(&OldIrql); // Same as KeCancelTimer(Timer) : Inserted = Timer->Header.Inserted; if (Inserted != FALSE) { // Do some unlinking if already inserted in the linked list - KiRemoveTreeTimer(Timer); + KxRemoveTreeTimer(Timer); } - - Timer->Header.SignalState = FALSE; - Timer->Dpc = Dpc; - Timer->Period = Period; - - if (!KiInsertTreeTimer(Timer, DueTime)) { - if (!IsListEmpty(&(Timer->Header.WaitListHead))) { - // KiWaitTest(Timer, 0); - } - - if (Dpc != NULL) { - // Call the Dpc routine if one is specified - KeQuerySystemTime(&SystemTime); - KeInsertQueueDpc(Timer->Dpc, (PVOID)SystemTime.u.LowPart, (PVOID)SystemTime.u.HighPart); - } - - if (Period != 0) { - // Prepare the repetition if Timer is periodic - Interval.QuadPart = (LONGLONG)(-10 * 1000) * Timer->Period; - while (!KiInsertTreeTimer(Timer, Interval)) - ; - } - } -/* Dxbx has this : - EnterCriticalSection(&(g_DpcData.Lock)); - if (Timer->TimerListEntry.Flink == nullptr) - { - Timer->DueTime.QuadPart := (DueTime.QuadPart / -10000) + CxbxXboxGetTickCount(); - Timer->Period = Period; - Timer->Dpc = Dpc; - InsertTailList(&(g_DpcData.TimerQueue), &(Timer->TimerListEntry)); - } - - LeaveCriticalSection(&(g_DpcData.Lock)); - SetEvent(g_DpcData.DpcEvent); -*/ + + /* Set Default Timer Data */ + Timer->Dpc = Dpc; + Timer->Period = Period; + if (!KiComputeDueTime(Timer, DueTime, &Hand)) + { + /* Signal the timer */ + RequestInterrupt = KiSignalTimer(Timer); + + /* Check if we need to do an interrupt */ + if (RequestInterrupt) { + HalRequestSoftwareInterrupt(DISPATCH_LEVEL); + } + } + else + { + /* Insert the timer */ + Timer->Header.SignalState = FALSE; + KxInsertTimer(Timer, Hand); + } + + /* Exit the dispatcher */ + KiUnlockDispatcherDatabase(OldIrql); + KiTimerUnlock(); RETURN(Inserted); } @@ -1738,9 +1889,7 @@ XBSYSAPI EXPORTNUM(153) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeSynchronizeExecution // ****************************************************************** // * 0x009A - KeSystemTime // ****************************************************************** -// Dxbx note : This was once a value, but instead we now point to -// the native Windows versions (see ConnectWindowsTimersToThunkTable) : -// XBSYSAPI EXPORTNUM(154) xboxkrnl::PKSYSTEM_TIME xboxkrnl::KeSystemTime; // Used for KernelThunk[154] +XBSYSAPI EXPORTNUM(154) xboxkrnl::KSYSTEM_TIME xboxkrnl::KeSystemTime = { 0, 0, 0 }; // ****************************************************************** // * 0x009B - KeTestAlertThread() @@ -1764,13 +1913,29 @@ XBSYSAPI EXPORTNUM(155) xboxkrnl::BOOLEAN NTAPI xboxkrnl::KeTestAlertThread // ****************************************************************** XBSYSAPI EXPORTNUM(156) xboxkrnl::DWORD VOLATILE xboxkrnl::KeTickCount = 0; -const xboxkrnl::ULONG CLOCK_TIME_INCREMENT = 0x2710; - // ****************************************************************** // * 0x009D - KeTimeIncrement // ****************************************************************** XBSYSAPI EXPORTNUM(157) xboxkrnl::ULONG xboxkrnl::KeTimeIncrement = CLOCK_TIME_INCREMENT; + +xboxkrnl::PLARGE_INTEGER FASTCALL KiComputeWaitInterval( + IN xboxkrnl::PLARGE_INTEGER OriginalTime, + IN xboxkrnl::PLARGE_INTEGER DueTime, + IN OUT xboxkrnl::PLARGE_INTEGER NewTime +) +{ + if (OriginalTime->QuadPart >= 0) { + return OriginalTime; + + } + else { + NewTime->QuadPart = xboxkrnl::KeQueryInterruptTime(); + NewTime->QuadPart -= DueTime->QuadPart; + return NewTime; + } +} + // ****************************************************************** // * 0x009E - KeWaitForMultipleObjects() // ****************************************************************** @@ -1797,52 +1962,226 @@ XBSYSAPI EXPORTNUM(158) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeWaitForMultipleObje LOG_FUNC_ARG(WaitBlockArray) LOG_FUNC_END; - NTSTATUS ret = STATUS_SUCCESS; + // If the lock is not already held, lock it + PRKTHREAD Thread = KeGetCurrentThread(); + if (Thread->WaitNext) { + Thread->WaitNext = FALSE; + } + else { + KiLockDispatcherDatabase(&Thread->WaitIrql); + } - // Take the input and build two arrays: One of handles created by our kernel and one for not - // Handles created by our kernel need to be forwarded to WaitForMultipleObjects while handles - // created by Windows need to be forwarded to NtDll::KeWaitForMultipleObjects - std::vector nativeObjects; - std::vector ntdllObjects; - - for (uint i = 0; i < Count; i++) { - DbgPrintf("Object: 0x%08X\n", Object[i]); - if (g_KeEventHandles.find((PKEVENT)Object[i]) == g_KeEventHandles.end()) { - ntdllObjects.push_back(Object[i]); - } else { - nativeObjects.push_back(g_KeEventHandles[(PRKEVENT)Object[i]]); + // Wait Loop + // This loop ends + PLARGE_INTEGER OriginalTime = Timeout; + LARGE_INTEGER DueTime, NewTime; + KWAIT_BLOCK StackWaitBlock; + PKWAIT_BLOCK WaitBlock = &StackWaitBlock; + BOOLEAN WaitSatisfied; + NTSTATUS WaitStatus; + PKMUTANT ObjectMutant; + // Hack variable (remove this when the thread scheduler is here) + bool timeout_set = false; + do { + // Check if we need to let an APC run. This should immediately trigger APC interrupt via a call to UnlockDispatcherDatabase + if (Thread->ApcState.KernelApcPending && (Thread->WaitIrql < APC_LEVEL)) { + KiUnlockDispatcherDatabase(Thread->WaitIrql); } + else { + WaitSatisfied = TRUE; + Thread->WaitStatus = STATUS_SUCCESS; + + for (ULONG Index = 0; Index < Count; Index += 1) { + ObjectMutant = (PKMUTANT)Object[Index]; + if (WaitType == WaitAny) { + if (ObjectMutant->Header.Type == MutantObject) { + // If the object is a mutant object and it has been acquired MINGLONG times, raise an exception + // If the mutant is signalled, we can satisfy the wait + if ((ObjectMutant->Header.SignalState > 0) || (Thread == ObjectMutant->OwnerThread)) { + if (ObjectMutant->Header.SignalState != MINLONG) { + KiWaitSatisfyMutant(ObjectMutant, Thread); + WaitStatus = (NTSTATUS)(Thread->WaitStatus); + goto NoWait; + } + else { + KiUnlockDispatcherDatabase(Thread->WaitIrql); + ExRaiseStatus(STATUS_MUTANT_LIMIT_EXCEEDED); + } + } + } + else if (ObjectMutant->Header.SignalState) { + // Otherwise, if the signal state is > 0, we can still just satisfy the wait + KiWaitSatisfyOther(ObjectMutant); + WaitStatus = STATUS_SUCCESS; + goto NoWait; + } + } else { + if (ObjectMutant->Header.Type == MutantObject) { + if ((Thread == ObjectMutant->OwnerThread) && (ObjectMutant->Header.SignalState == MINLONG)) { + KiUnlockDispatcherDatabase(Thread->WaitIrql); + ExRaiseStatus(STATUS_MUTANT_LIMIT_EXCEEDED); + } else if ((ObjectMutant->Header.SignalState <= 0) && (Thread != ObjectMutant->OwnerThread)) { + WaitSatisfied = FALSE; + } + } else if (ObjectMutant->Header.SignalState <= 0) { + WaitSatisfied = FALSE; + } + } + + + // If we reached here, the wait could not be satisfied immediately, so we must setup a WaitBlock + WaitBlock = &WaitBlockArray[Index]; + WaitBlock->Object = ObjectMutant; + WaitBlock->WaitKey = (CSHORT)(Index); + WaitBlock->WaitType = WaitType; + WaitBlock->Thread = Thread; + WaitBlock->NextWaitBlock = &WaitBlockArray[Index + 1]; + } + + // Check if the wait can be satisfied immediately + if ((WaitType == WaitAll) && (WaitSatisfied)) { + WaitBlock->NextWaitBlock = &WaitBlockArray[0]; + KiWaitSatisfyAll(WaitBlock); + WaitStatus = (NTSTATUS)Thread->WaitStatus; + goto NoWait; + } + + TestForAlertPending(Alertable); + + // Handle a Timeout if specified + if (Timeout != nullptr) { + // If the timeout is 0, do not wait + if (!(Timeout->u.LowPart | Timeout->u.HighPart)) { + WaitStatus = (NTSTATUS)(STATUS_TIMEOUT); + goto NoWait; + } + + // Setup a timer for the thread but only once (for now) + if (!timeout_set) { + KiTimerLock(); + PKTIMER Timer = &Thread->Timer; + PKWAIT_BLOCK WaitTimer = &Thread->TimerWaitBlock; + WaitBlock->NextWaitBlock = WaitTimer; + Timer->Header.WaitListHead.Flink = &WaitTimer->WaitListEntry; + Timer->Header.WaitListHead.Blink = &WaitTimer->WaitListEntry; + WaitTimer->NextWaitBlock = WaitBlock; + if (KiInsertTreeTimer(Timer, *Timeout) == FALSE) { + WaitStatus = (NTSTATUS)STATUS_TIMEOUT; + KiTimerUnlock(); + goto NoWait; + } + + // Boring, ensure that we only set the thread timer once. Otherwise, this will cause to insert the same + // thread timer over and over in the timer list, which will prevent KiTimerExpiration from removing these + // duplicated timers and thus it will attempt to endlessly remove the same unremoved timers, causing a deadlock. + // This can be removed once KiSwapThread and the kernel/user APCs are implemented + timeout_set = true; + DueTime.QuadPart = Timer->DueTime.QuadPart; + KiTimerUnlock(); + } + + // KiTimerExpiration has removed the timer but the objects were not signaled, so we have a timeout + // (remove this when the thread scheduler is here) + if (Thread->Timer.Header.Inserted == FALSE) { + WaitStatus = (NTSTATUS)(STATUS_TIMEOUT); + goto NoWait; + } + } + else { + WaitBlock->NextWaitBlock = WaitBlock; + } + + WaitBlock->NextWaitBlock = &WaitBlockArray[0]; + WaitBlock = &WaitBlockArray[0]; + do { + ObjectMutant = (PKMUTANT)WaitBlock->Object; + //InsertTailList(&ObjectMutant->Header.WaitListHead, &WaitBlock->WaitListEntry); + WaitBlock = WaitBlock->NextWaitBlock; + } while (WaitBlock != &WaitBlockArray[0]); + + + /* + TODO: We can't implement this and the return values until we have our own thread scheduler + For now, we'll have to implement waiting here instead of the scheduler. + This code can all be enabled once we have CPU emulation and our own scheduler in v1.0 + */ + + // Insert the WaitBlock + //InsertTailList(&ObjectMutant->Header.WaitListHead, &WaitBlock->WaitListEntry); + + // If the current thread is processing a queue object, wake other treads using the same queue + PRKQUEUE Queue = (PRKQUEUE)Thread->Queue; + if (Queue != NULL) { + // TODO:KiActivateWaiterQueue(Queue); + } + + // Insert the thread into the Wait List + Thread->Alertable = Alertable; + Thread->WaitMode = WaitMode; + Thread->WaitReason = (UCHAR)WaitReason; + Thread->WaitTime = KeTickCount; + //Thread->State = Waiting; + //KiInsertWaitList(WaitMode, Thread); + + //WaitStatus = (NTSTATUS)KiSwapThread(); + + //if (WaitStatus == STATUS_USER_APC) { + // TODO: KiDeliverUserApc(); + //} + + // If the thread was not awakened for an APC, return the Wait Status + //if (WaitStatus != STATUS_KERNEL_APC) { + // return WaitStatus; + //} + + // TODO: Remove this after we have our own scheduler and the above is implemented + Sleep(0); + + // Reduce the timout if necessary + if (Timeout != nullptr) { + Timeout = KiComputeWaitInterval(OriginalTime, &DueTime, &NewTime); + } + } + + // Raise IRQL to DISPATCH_LEVEL and lock the database (only if it's not already at this level) + if (KeGetCurrentIrql() != DISPATCH_LEVEL) { + KiLockDispatcherDatabase(&Thread->WaitIrql); + } + } while (TRUE); + + // NOTE: we don't need to remove the wait blocks for the object and/or the timer because InsertTailList is disabled at + // the moment, which means they are never attached to the object wait list. TimerWaitBlock can also stay attached to the timer wait + // list since KiTimerExpiration disregards it for now. + + // The waiting thead has been alerted, or an APC needs to be delivered + // So unlock the dispatcher database, lower the IRQ and return the status + KiUnlockDispatcherDatabase(Thread->WaitIrql); + if (WaitStatus == STATUS_USER_APC) { + //TODO: KiDeliverUserApc(); } - if (ntdllObjects.size() > 0) { - // TODO : What should we do with the (currently ignored) - // WaitReason, WaitMode, WaitBlockArray? + RETURN(WaitStatus); - // Unused arguments : WaitReason, WaitMode, WaitBlockArray - ret = NtDll::NtWaitForMultipleObjects( - ntdllObjects.size(), - &ntdllObjects[0], - (NtDll::OBJECT_WAIT_TYPE)WaitType, - Alertable, - (NtDll::PLARGE_INTEGER)Timeout); +NoWait: + // The wait was satisfied without actually waiting + // Unlock the database and return the status + //TODO: KiAdjustQuantumThread(Thread); - if (FAILED(ret)) - EmuWarning("KeWaitForMultipleObjects failed! (%s)", NtStatusToString(ret)); - } - - if (nativeObjects.size() > 0) { - ret = NtDll::NtWaitForMultipleObjects( - nativeObjects.size(), - &nativeObjects[0], - (NtDll::OBJECT_WAIT_TYPE)WaitType, - Alertable, - (NtDll::PLARGE_INTEGER)Timeout); - - if (FAILED(ret)) - EmuWarning("KeWaitForMultipleObjects failed! (%s)", NtStatusToString(ret)); + // Don't forget to remove the thread timer if the objects were signaled before the timer expired + // (remove this when the thread scheduler is here) + if (timeout_set && Thread->Timer.Header.Inserted == TRUE) { + KiTimerLock(); + KxRemoveTreeTimer(&Thread->Timer); + KiTimerUnlock(); } - RETURN(ret); + KiUnlockDispatcherDatabase(Thread->WaitIrql); + + if (WaitStatus == STATUS_USER_APC) { + // TODO: KiDeliverUserApc(); + } + + RETURN(WaitStatus); } // ****************************************************************** @@ -1857,16 +2196,195 @@ XBSYSAPI EXPORTNUM(159) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeWaitForSingleObject IN PLARGE_INTEGER Timeout OPTIONAL ) { - LOG_FORWARD("KeWaitForMultipleObjects"); + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Object) + LOG_FUNC_ARG(WaitReason) + LOG_FUNC_ARG(WaitMode) + LOG_FUNC_ARG(Alertable) + LOG_FUNC_ARG(Timeout) + LOG_FUNC_END; - return xboxkrnl::KeWaitForMultipleObjects( - /*Count=*/1, - &Object, - /*WaitType=*/WaitAll, - WaitReason, - WaitMode, - Alertable, - Timeout, - /*WaitBlockArray*/NULL - ); + // If the lock is not already held, lock it + PRKTHREAD Thread = KeGetCurrentThread(); + if (Thread->WaitNext) { + Thread->WaitNext = FALSE; + } + else { + KiLockDispatcherDatabase(&Thread->WaitIrql); + } + + // Wait Loop + // This loop ends + PLARGE_INTEGER OriginalTime = Timeout; + LARGE_INTEGER DueTime, NewTime; + KWAIT_BLOCK StackWaitBlock; + PKWAIT_BLOCK WaitBlock = &StackWaitBlock; + NTSTATUS WaitStatus; + // Hack variable (remove this when the thread scheduler is here) + bool timeout_set = false; + do { + // Check if we need to let an APC run. This should immediately trigger APC interrupt via a call to UnlockDispatcherDatabase + if (Thread->ApcState.KernelApcPending && (Thread->WaitIrql < APC_LEVEL)) { + KiUnlockDispatcherDatabase(Thread->WaitIrql); + } else { + PKMUTANT ObjectMutant = (PKMUTANT)Object; + Thread->WaitStatus = STATUS_SUCCESS; + + if (ObjectMutant->Header.Type == MutantObject) { + // If the object is a mutant object and it has been acquired MINGLONG times, raise an exception + // If the mutant is signalled, we can satisfy the wait + if ((ObjectMutant->Header.SignalState > 0) || (Thread == ObjectMutant->OwnerThread)) { + if (ObjectMutant->Header.SignalState != MINLONG) { + KiWaitSatisfyMutant(ObjectMutant, Thread); + WaitStatus = (NTSTATUS)(Thread->WaitStatus); + goto NoWait; + } + else { + KiUnlockDispatcherDatabase(Thread->WaitIrql); + ExRaiseStatus(STATUS_MUTANT_LIMIT_EXCEEDED); + } + } + } + else if (ObjectMutant->Header.SignalState > 0) { + // Otherwise, if the signal state is > 0, we can still just satisfy the wait + KiWaitSatisfyOther(ObjectMutant); + WaitStatus = STATUS_SUCCESS; + goto NoWait; + } + + // If we reached here, the wait could not be satisfied immediately, so we must setup a WaitBlock + Thread->WaitBlockList = WaitBlock; + WaitBlock->Object = Object; + WaitBlock->WaitKey = (CSHORT)(STATUS_SUCCESS); + WaitBlock->WaitType = WaitAny; + WaitBlock->Thread = Thread; + + TestForAlertPending(Alertable); + + // Handle a Timeout if specified + if (Timeout != nullptr) { + // If the timeout is 0, do not wait + if (!(Timeout->u.LowPart | Timeout->u.HighPart)) { + WaitStatus = (NTSTATUS)(STATUS_TIMEOUT); + goto NoWait; + } + + // Setup a timer for the thread but only once (for now) + if (!timeout_set) { + KiTimerLock(); + PKTIMER Timer = &Thread->Timer; + PKWAIT_BLOCK WaitTimer = &Thread->TimerWaitBlock; + WaitBlock->NextWaitBlock = WaitTimer; + Timer->Header.WaitListHead.Flink = &WaitTimer->WaitListEntry; + Timer->Header.WaitListHead.Blink = &WaitTimer->WaitListEntry; + WaitTimer->NextWaitBlock = WaitBlock; + if (KiInsertTreeTimer(Timer, *Timeout) == FALSE) { + WaitStatus = (NTSTATUS)STATUS_TIMEOUT; + KiTimerUnlock(); + goto NoWait; + } + + // Boring, ensure that we only set the thread timer once. Otherwise, this will cause to insert the same + // thread timer over and over in the timer list, which will prevent KiTimerExpiration from removing these + // duplicated timers and thus it will attempt to endlessly remove the same unremoved timers, causing a deadlock. + // This can be removed once KiSwapThread and the kernel/user APCs are implemented + timeout_set = true; + DueTime.QuadPart = Timer->DueTime.QuadPart; + KiTimerUnlock(); + } + + // KiTimerExpiration has removed the timer but the object was not signaled, so we have a timeout + // (remove this when the thread scheduler is here) + if (Thread->Timer.Header.Inserted == FALSE) { + WaitStatus = (NTSTATUS)(STATUS_TIMEOUT); + goto NoWait; + } + } + else { + WaitBlock->NextWaitBlock = WaitBlock; + } + + /* + TODO: We can't implement this and the return values until we have our own thread scheduler + For now, we'll have to implement waiting here instead of the scheduler. + This code can all be enabled once we have CPU emulation and our own scheduler in v1.0 + */ + + // Insert the WaitBlock + //InsertTailList(&ObjectMutant->Header.WaitListHead, &WaitBlock->WaitListEntry); + + // If the current thread is processing a queue object, wake other treads using the same queue + PRKQUEUE Queue = (PRKQUEUE)Thread->Queue; + if (Queue != NULL) { + // TODO: KiActivateWaiterQueue(Queue); + } + + // Insert the thread into the Wait List + Thread->Alertable = Alertable; + Thread->WaitMode = WaitMode; + Thread->WaitReason = (UCHAR)WaitReason; + Thread->WaitTime = KeTickCount; + // TODO: Thread->State = Waiting; + //KiInsertWaitList(WaitMode, Thread); + + /* + WaitStatus = (NTSTATUS)KiSwapThread(); + + if (WaitStatus == STATUS_USER_APC) { + // TODO: KiDeliverUserApc(); + } + + // If the thread was not awakened for an APC, return the Wait Status + if (WaitStatus != STATUS_KERNEL_APC) { + return WaitStatus; + } */ + + // TODO: Remove this after we have our own scheduler and the above is implemented + Sleep(0); + + // Reduce the timout if necessary + if (Timeout != nullptr) { + Timeout = KiComputeWaitInterval(OriginalTime, &DueTime, &NewTime); + } + } + + // Raise IRQL to DISPATCH_LEVEL and lock the database + if (KeGetCurrentIrql() != DISPATCH_LEVEL) { + KiLockDispatcherDatabase(&Thread->WaitIrql); + } + } while (TRUE); + + // NOTE: we don't need to remove the wait blocks for the object and/or the timer because InsertTailList is disabled at + // the moment, which means they are never attached to the object wait list. TimerWaitBlock can also stay attached to the timer wait + // list since KiTimerExpiration disregards it for now. + + // The waiting thead has been alerted, or an APC needs to be delivered + // So unlock the dispatcher database, lower the IRQ and return the status + KiUnlockDispatcherDatabase(Thread->WaitIrql); + if (WaitStatus == STATUS_USER_APC) { + //TODO: KiDeliverUserApc(); + } + + RETURN(WaitStatus); + +NoWait: + // The wait was satisfied without actually waiting + // Unlock the database and return the status + //TODO: KiAdjustQuantumThread(Thread); + + // Don't forget to remove the thread timer if the object was signaled before the timer expired + // (remove this when the thread scheduler is here) + if (timeout_set && Thread->Timer.Header.Inserted == TRUE) { + KiTimerLock(); + KxRemoveTreeTimer(&Thread->Timer); + KiTimerUnlock(); + } + + KiUnlockDispatcherDatabase(Thread->WaitIrql); + + if (WaitStatus == STATUS_USER_APC) { + // TODO: KiDeliverUserApc(); + } + + RETURN(WaitStatus); } diff --git a/src/core/kernel/exports/EmuKrnlKe.h b/src/core/kernel/exports/EmuKrnlKe.h new file mode 100644 index 000000000..148104c0f --- /dev/null +++ b/src/core/kernel/exports/EmuKrnlKe.h @@ -0,0 +1,40 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +namespace xboxkrnl +{ + VOID NTAPI KeSetSystemTime + ( + IN PLARGE_INTEGER NewTime, + OUT PLARGE_INTEGER OldTime + ); + + VOID NTAPI KeInitializeTimer + ( + IN PKTIMER Timer + ); +} diff --git a/src/core/kernel/exports/EmuKrnlKi.cpp b/src/core/kernel/exports/EmuKrnlKi.cpp new file mode 100644 index 000000000..ef97d4f87 --- /dev/null +++ b/src/core/kernel/exports/EmuKrnlKi.cpp @@ -0,0 +1,902 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2016 Patrick van Logchem +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment (timer functions): ReactOS (GPLv2) +// https://github.com/reactos/reactos + +// KiCheckTimerTable, KiTimerExpiration, KiTimerListExpire +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/dpc.c +* PURPOSE: Deferred Procedure Call (DPC) Support +* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) +* Philip Susi (phreak@iag.net) +* Eric Kohl +*/ + +// KiInsertTreeTimer, KiInsertTimerTable, KiSignalTimer, KiCompleteTimer +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/ke/timerobj.c +* PURPOSE: Handle Kernel Timers (Kernel-part of Executive Timers) +* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +// KiComputeDueTime, KiComputeTimerTableIndex, KxInsertTimer, KxRemoveTreeTimer, KiRemoveEntryTimer +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/include/internal/ke_x.h +* PURPOSE: Internal Inlined Functions for the Kernel +* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +// COPYING file: +/* +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +ReactOS may be used, runtime linked, and distributed with non-free software +(meaning that such software has no obligations to open-source, or render +free, their non-free code) such as commercial device drivers and commercial +applications. This exception does not alter any other responsibilities of +the licensee under the GPL (meaning that such software must still obey +the GPL for the free ("open-sourced") code that has been integrated into +the said software). +*/ + +// Changed from ReactOS: slight changes to the Hand parameter usage + + +#define LOG_PREFIX CXBXR_MODULE::KI + +// prevent name collisions +namespace xboxkrnl +{ +#include // For KeBugCheck, etc. +}; + +#include "Logging.h" // For LOG_FUNC() +#include "EmuKrnl.h" // for the list support functions +#include "EmuKrnlKi.h" + +#define MAX_TIMER_DPCS 16 + +#define ASSERT_TIMER_LOCKED assert(KiTimerMtx.Acquired > 0) + +const xboxkrnl::ULONG CLOCK_TIME_INCREMENT = 0x2710; +xboxkrnl::KDPC KiTimerExpireDpc; +xboxkrnl::KI_TIMER_LOCK KiTimerMtx; +xboxkrnl::KTIMER_TABLE_ENTRY KiTimerTableListHead[TIMER_TABLE_SIZE]; +xboxkrnl::LIST_ENTRY KiWaitInListHead; + + +xboxkrnl::VOID xboxkrnl::KiInitSystem() +{ + unsigned int i; + + InitializeListHead(&KiWaitInListHead); + + KiTimerMtx.Acquired = 0; + KeInitializeDpc(&KiTimerExpireDpc, KiTimerExpiration, NULL); + for (i = 0; i < TIMER_TABLE_SIZE; i++) { + InitializeListHead(&KiTimerTableListHead[i].Entry); + KiTimerTableListHead[i].Time.u.HighPart = 0xFFFFFFFF; + KiTimerTableListHead[i].Time.u.LowPart = 0; + } + + InitializeListHead(&IdexChannelObject.DeviceQueue.DeviceListHead); +} + +xboxkrnl::VOID xboxkrnl::KiTimerLock() +{ + KiTimerMtx.Mtx.lock(); + KiTimerMtx.Acquired++; +} + +xboxkrnl::VOID xboxkrnl::KiTimerUnlock() +{ + KiTimerMtx.Acquired--; + KiTimerMtx.Mtx.unlock(); +} + +xboxkrnl::VOID xboxkrnl::KiClockIsr +( + unsigned int ScalingFactor +) +{ + KIRQL OldIrql; + LARGE_INTEGER InterruptTime; + LARGE_INTEGER HostSystemTime; + ULONG Hand; + DWORD OldKeTickCount; + + OldIrql = KfRaiseIrql(CLOCK_LEVEL); + + // Update the interrupt time + InterruptTime.u.LowPart = KeInterruptTime.LowPart; + InterruptTime.u.HighPart = KeInterruptTime.High1Time; + InterruptTime.QuadPart += (CLOCK_TIME_INCREMENT * ScalingFactor); + KeInterruptTime.High2Time = InterruptTime.u.HighPart; + KeInterruptTime.LowPart = InterruptTime.u.LowPart; + KeInterruptTime.High1Time = InterruptTime.u.HighPart; + + // Update the system time + // NOTE: I'm not sure if we should round down the host system time to the nearest multiple + // of the Xbox clock increment... + GetSystemTimeAsFileTime((LPFILETIME)&HostSystemTime); + HostSystemTime.QuadPart += HostSystemTimeDelta.load(); + KeSystemTime.High2Time = HostSystemTime.u.HighPart; + KeSystemTime.LowPart = HostSystemTime.u.LowPart; + KeSystemTime.High1Time = HostSystemTime.u.HighPart; + + // Update the tick counter + OldKeTickCount = KeTickCount; + KeTickCount += ScalingFactor; + + // Because this function must be fast to continuously update the kernel clocks, if somebody else is currently + // holding the lock, we won't wait and instead skip the check of the timers for this cycle + if (KiTimerMtx.Mtx.try_lock()) { + KiTimerMtx.Acquired++; + // Check if a timer has expired + Hand = OldKeTickCount & (TIMER_TABLE_SIZE - 1); + if (KiTimerTableListHead[Hand].Entry.Flink != &KiTimerTableListHead[Hand].Entry && + (ULONGLONG)InterruptTime.QuadPart >= KiTimerTableListHead[Hand].Time.QuadPart) { + KeInsertQueueDpc(&KiTimerExpireDpc, (PVOID)Hand, 0); + } + KiTimerMtx.Acquired--; + KiTimerMtx.Mtx.unlock(); + } + + KfLowerIrql(OldIrql); +} + +xboxkrnl::VOID NTAPI xboxkrnl::KiCheckTimerTable +( + IN xboxkrnl::ULARGE_INTEGER CurrentTime +) +{ + ULONG i = 0; + PLIST_ENTRY ListHead, NextEntry; + KIRQL OldIrql; + PKTIMER Timer; + + ASSERT_TIMER_LOCKED; + + /* Raise IRQL to high and loop timers */ + OldIrql = KfRaiseIrql(HIGH_LEVEL); + do + { + /* Loop the current list */ + ListHead = &KiTimerTableListHead[i].Entry; + NextEntry = ListHead->Flink; + while (NextEntry != ListHead) + { + /* Get the timer and move to the next one */ + Timer = CONTAINING_RECORD(NextEntry, KTIMER, TimerListEntry); + NextEntry = NextEntry->Flink; + + /* Check if it expired */ + if (Timer->DueTime.QuadPart <= CurrentTime.QuadPart) + { + /* This is bad, breakpoint! */ + EmuLog(LOG_LEVEL::ERROR2, "Invalid timer state!"); + DbgBreakPoint(); + } + } + + /* Move to the next timer */ + i++; + } while (i < TIMER_TABLE_SIZE); + + /* Lower IRQL and return */ + KfLowerIrql(OldIrql); +} + +xboxkrnl::VOID xboxkrnl::KxInsertTimer +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::ULONG Hand +) +{ + ASSERT_TIMER_LOCKED; + + /* Try to insert the timer */ + if (KiInsertTimerTable(Timer, Hand)) + { + /* Complete it */ + KiCompleteTimer(Timer, Hand); + } +} + +xboxkrnl::VOID FASTCALL xboxkrnl::KiCompleteTimer +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::ULONG Hand +) +{ + LIST_ENTRY ListHead; + BOOLEAN RequestInterrupt = FALSE; + + ASSERT_TIMER_LOCKED; + + /* Remove it from the timer list */ + KiRemoveEntryTimer(Timer, Hand); + + /* Link the timer list to our stack */ + ListHead.Flink = &Timer->TimerListEntry; + ListHead.Blink = &Timer->TimerListEntry; + Timer->TimerListEntry.Flink = &ListHead; + Timer->TimerListEntry.Blink = &ListHead; + + /* Signal the timer if it's still on our list */ + if (!IsListEmpty(&ListHead)) { + RequestInterrupt = KiSignalTimer(Timer); + } + + /* Request a DPC if needed */ + if (RequestInterrupt) { + HalRequestSoftwareInterrupt(DISPATCH_LEVEL); + } +} + +xboxkrnl::VOID xboxkrnl::KiRemoveEntryTimer +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::ULONG Hand +) +{ + PKTIMER_TABLE_ENTRY TableEntry; + + ASSERT_TIMER_LOCKED; + + /* Remove the timer from the timer list and check if it's empty */ + if (RemoveEntryList(&Timer->TimerListEntry)) + { + /* Get the respective timer table entry */ + TableEntry = &KiTimerTableListHead[Hand]; + if (&TableEntry->Entry == TableEntry->Entry.Flink) + { + /* Set the entry to an infinite absolute time */ + TableEntry->Time.u.HighPart = 0xFFFFFFFF; + } + } + + /* Clear the list entries so we can tell the timer is gone */ + Timer->TimerListEntry.Flink = NULL; + Timer->TimerListEntry.Blink = NULL; +} + +xboxkrnl::VOID xboxkrnl::KxRemoveTreeTimer +( + IN xboxkrnl::PKTIMER Timer +) +{ + ULONG Hand = KiComputeTimerTableIndex(Timer->DueTime.QuadPart); + PKTIMER_TABLE_ENTRY TimerEntry; + + ASSERT_TIMER_LOCKED; + + /* Set the timer as non-inserted */ + Timer->Header.Inserted = FALSE; + + /* Remove it from the timer list */ + if (RemoveEntryList(&Timer->TimerListEntry)) + { + /* Get the entry and check if it's empty */ + TimerEntry = &KiTimerTableListHead[Hand]; + if (IsListEmpty(&TimerEntry->Entry)) + { + /* Clear the time then */ + TimerEntry->Time.u.HighPart = 0xFFFFFFFF; + } + } +} + +xboxkrnl::BOOLEAN FASTCALL xboxkrnl::KiInsertTimerTable +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::ULONG Hand +) +{ + LARGE_INTEGER InterruptTime; + LONGLONG DueTime = Timer->DueTime.QuadPart; + BOOLEAN Expired = FALSE; + PLIST_ENTRY ListHead, NextEntry; + PKTIMER CurrentTimer; + + EmuLog(LOG_LEVEL::DEBUG, "%s: inserting Timer %p, Hand: %lu", __func__, Timer, Hand); + + ASSERT_TIMER_LOCKED; + + /* Check if the period is zero */ + if (!Timer->Period) { + Timer->Header.SignalState = FALSE; + } + + /* Loop the timer list backwards */ + ListHead = &KiTimerTableListHead[Hand].Entry; + NextEntry = ListHead->Blink; + while (NextEntry != ListHead) + { + /* Get the timer */ + CurrentTimer = CONTAINING_RECORD(NextEntry, KTIMER, TimerListEntry); + + /* Now check if we can fit it before */ + if ((ULONGLONG)DueTime >= CurrentTimer->DueTime.QuadPart) break; + + /* Keep looping */ + NextEntry = NextEntry->Blink; + } + + /* Looped all the list, insert it here and get the interrupt time again */ + InsertHeadList(NextEntry, &Timer->TimerListEntry); + + /* Check if we didn't find it in the list */ + if (NextEntry == ListHead) + { + /* Set the time */ + KiTimerTableListHead[Hand].Time.QuadPart = DueTime; + + /* Make sure it hasn't expired already */ + InterruptTime.QuadPart = KeQueryInterruptTime(); + if (DueTime <= InterruptTime.QuadPart) { + EmuLog(LOG_LEVEL::DEBUG, "Timer %p already expired", Timer); + Expired = TRUE; + } + } + + /* Return expired state */ + return Expired; +} + +xboxkrnl::BOOLEAN FASTCALL xboxkrnl::KiInsertTreeTimer +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::LARGE_INTEGER Interval +) +{ + BOOLEAN Inserted = FALSE; + ULONG Hand = 0; + + ASSERT_TIMER_LOCKED; + + /* Setup the timer's due time */ + if (KiComputeDueTime(Timer, Interval, &Hand)) + { + /* Insert the timer */ + if (KiInsertTimerTable(Timer, Hand)) + { + /* It was already there, remove it */ + KiRemoveEntryTimer(Timer, Hand); + Timer->Header.Inserted = FALSE; + } + else + { + /* Otherwise, we're now inserted */ + Inserted = TRUE; + } + } + + return Inserted; +} + +xboxkrnl::ULONG xboxkrnl::KiComputeTimerTableIndex +( + IN xboxkrnl::ULONGLONG Interval +) +{ + return (Interval / CLOCK_TIME_INCREMENT) & (TIMER_TABLE_SIZE - 1); +} + +xboxkrnl::BOOLEAN xboxkrnl::KiComputeDueTime +( + IN xboxkrnl::PKTIMER Timer, + IN xboxkrnl::LARGE_INTEGER DueTime, + OUT xboxkrnl::PULONG Hand) +{ + LARGE_INTEGER InterruptTime, SystemTime, DifferenceTime; + + ASSERT_TIMER_LOCKED; + + /* Convert to relative time if needed */ + Timer->Header.Absolute = FALSE; + if (DueTime.u.HighPart >= 0) + { + /* Get System Time */ + KeQuerySystemTime(&SystemTime); + + /* Do the conversion */ + DifferenceTime.QuadPart = SystemTime.QuadPart - DueTime.QuadPart; + + /* Make sure it hasn't already expired */ + Timer->Header.Absolute = TRUE; + if (DifferenceTime.u.HighPart >= 0) + { + /* Cancel everything */ + EmuLog(LOG_LEVEL::DEBUG, "Timer %p already expired", Timer); + Timer->Header.SignalState = TRUE; + Timer->DueTime.QuadPart = 0; + *Hand = 0; + return FALSE; + } + + /* Set the time as Absolute */ + DueTime = DifferenceTime; + } + + /* Get the Interrupt Time */ + InterruptTime.QuadPart = KeQueryInterruptTime(); + + /* Recalculate due time */ + Timer->DueTime.QuadPart = InterruptTime.QuadPart - DueTime.QuadPart; + + /* Get the handle */ + *Hand = KiComputeTimerTableIndex(Timer->DueTime.QuadPart); + Timer->Header.Inserted = TRUE; + + return TRUE; +} + +xboxkrnl::BOOLEAN FASTCALL xboxkrnl::KiSignalTimer +( + IN xboxkrnl::PKTIMER Timer +) +{ + BOOLEAN RequestInterrupt = FALSE; + PKDPC Dpc = Timer->Dpc; + ULONG Period = Timer->Period; + LARGE_INTEGER Interval, SystemTime; + + ASSERT_TIMER_LOCKED; + + /* Set default values */ + Timer->Header.Inserted = FALSE; + Timer->Header.SignalState = TRUE; + + /* Check if the timer has waiters */ + if (!IsListEmpty(&Timer->Header.WaitListHead)) + { + /* Check the type of event */ + if (Timer->Header.Type == TimerNotificationObject) + { + /* Unwait the thread */ + // KxUnwaitThread(&Timer->Header, IO_NO_INCREMENT); + } + else + { + /* Otherwise unwait the thread and signal the timer */ + // KxUnwaitThreadForEvent((PKEVENT)Timer, IO_NO_INCREMENT); + } + } + + /* Check if we have a period */ + if (Period) + { + /* Calculate the interval and insert the timer */ + Interval.QuadPart = Int32x32To64(Period, -10000); + while (!KiInsertTreeTimer(Timer, Interval)); + } + + /* Check if we have a DPC */ + if (Dpc) + { + /* Insert it in the queue */ + KeQuerySystemTime(&SystemTime); + KeInsertQueueDpc(Dpc, + ULongToPtr(SystemTime.u.LowPart), + ULongToPtr(SystemTime.u.HighPart)); + RequestInterrupt = TRUE; + } + + /* Return whether we need to request a DPC interrupt or not */ + return RequestInterrupt; +} + +xboxkrnl::VOID NTAPI xboxkrnl::KiTimerExpiration +( + IN xboxkrnl::PKDPC Dpc, + IN xboxkrnl::PVOID DeferredContext, + IN xboxkrnl::PVOID SystemArgument1, + IN xboxkrnl::PVOID SystemArgument2 +) +{ + ULARGE_INTEGER SystemTime, InterruptTime; + LARGE_INTEGER Interval; + LONG Limit, Index, i; + ULONG Timers, ActiveTimers, DpcCalls; + PLIST_ENTRY ListHead, NextEntry; + KIRQL OldIrql; + PKTIMER Timer; + PKDPC TimerDpc; + ULONG Period; + DPC_QUEUE_ENTRY DpcEntry[MAX_TIMER_DPCS]; + + /* Query system and interrupt time */ + KeQuerySystemTime((PLARGE_INTEGER)&SystemTime); + InterruptTime.QuadPart = KeQueryInterruptTime(); + Limit = KeTickCount; + + /* Get the index of the timer and normalize it */ + Index = PtrToLong(SystemArgument1); + if ((Limit - Index) >= TIMER_TABLE_SIZE) + { + /* Normalize it */ + Limit = Index + TIMER_TABLE_SIZE - 1; + } + + /* Setup index and actual limit */ + Index--; + Limit &= (TIMER_TABLE_SIZE - 1); + + /* Setup accounting data */ + DpcCalls = 0; + Timers = 24; + ActiveTimers = 4; + + /* Lock the Database and Raise IRQL */ + KiTimerLock(); + KiLockDispatcherDatabase(&OldIrql); + + /* Start expiration loop */ + do + { + /* Get the current index */ + Index = (Index + 1) & (TIMER_TABLE_SIZE - 1); + + /* Get list pointers and loop the list */ + ListHead = &KiTimerTableListHead[Index].Entry; + while (ListHead != ListHead->Flink) + { + /* Go to the next entry */ + NextEntry = ListHead->Flink; + + /* Get the current timer and check its due time */ + Timers--; + Timer = CONTAINING_RECORD(NextEntry, KTIMER, TimerListEntry); + if ((NextEntry != ListHead) && + (Timer->DueTime.QuadPart <= InterruptTime.QuadPart)) + { + /* It's expired, remove it */ + ActiveTimers--; + KiRemoveEntryTimer(Timer, Index); + + /* Make it non-inserted and signal it */ + Timer->Header.Inserted = FALSE; + Timer->Header.SignalState = 1; + + /* Get the DPC and period */ + TimerDpc = Timer->Dpc; + Period = Timer->Period; + + /* Check if there are any waiters */ + if (!IsListEmpty(&Timer->Header.WaitListHead)) + { + /* Check the type of event */ + if (Timer->Header.Type == TimerNotificationObject) + { + /* Unwait the thread */ + // KxUnwaitThread(&Timer->Header, IO_NO_INCREMENT); + } + else + { + /* Otherwise unwait the thread and signal the timer */ + // KxUnwaitThreadForEvent((PKEVENT)Timer, IO_NO_INCREMENT); + } + } + + /* Check if we have a period */ + if (Period) + { + /* Calculate the interval and insert the timer */ + Interval.QuadPart = Int32x32To64(Period, -10000); + while (!KiInsertTreeTimer(Timer, Interval)); + } + + /* Check if we have a DPC */ + if (TimerDpc) + { + /* Setup the DPC Entry */ + DpcEntry[DpcCalls].Dpc = TimerDpc; + DpcEntry[DpcCalls].Routine = TimerDpc->DeferredRoutine; + DpcEntry[DpcCalls].Context = TimerDpc->DeferredContext; + DpcCalls++; + assert(DpcCalls < MAX_TIMER_DPCS); + } + + /* Check if we're done processing */ + if (!(ActiveTimers) || !(Timers)) + { + /* Release the dispatcher while doing DPCs */ + KiUnlockDispatcherDatabase(DISPATCH_LEVEL); + + /* Start looping all DPC Entries */ + for (i = 0; DpcCalls; DpcCalls--, i++) + { + /* Call the DPC */ + EmuLog(LOG_LEVEL::DEBUG, "%s, calling DPC at 0x%.8X", __func__, DpcEntry[i].Routine); + __try { + // Call the Deferred Procedure : + DpcEntry[i].Routine( + DpcEntry[i].Dpc, + DpcEntry[i].Context, + UlongToPtr(SystemTime.u.LowPart), + UlongToPtr(SystemTime.u.HighPart) + ); + } + __except (EmuException(GetExceptionInformation())) + { + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); + } + } + + /* Reset accounting */ + Timers = 24; + ActiveTimers = 4; + + /* Lock the dispatcher database */ + KiLockDispatcherDatabaseAtDpcLevel(); + } + } + else + { + /* Check if the timer list is empty */ + if (NextEntry != ListHead) + { + /* Sanity check */ + assert(KiTimerTableListHead[Index].Time.QuadPart <= + Timer->DueTime.QuadPart); + + /* Update the time */ + KiTimerTableListHead[Index].Time.QuadPart = + Timer->DueTime.QuadPart; + } + + /* Check if we've scanned all the timers we could */ + if (!Timers) + { + /* Release the dispatcher while doing DPCs */ + KiUnlockDispatcherDatabase(DISPATCH_LEVEL); + + /* Start looping all DPC Entries */ + for (i = 0; DpcCalls; DpcCalls--, i++) + { + /* Call the DPC */ + EmuLog(LOG_LEVEL::DEBUG, "%s, calling DPC at 0x%.8X", __func__, DpcEntry[i].Routine); + __try { + // Call the Deferred Procedure : + DpcEntry[i].Routine( + DpcEntry[i].Dpc, + DpcEntry[i].Context, + UlongToPtr(SystemTime.u.LowPart), + UlongToPtr(SystemTime.u.HighPart) + ); + } + __except (EmuException(GetExceptionInformation())) + { + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); + } + } + + /* Reset accounting */ + Timers = 24; + ActiveTimers = 4; + + /* Lock the dispatcher database */ + KiLockDispatcherDatabaseAtDpcLevel(); + } + + /* Done looping */ + break; + } + } + } while (Index != Limit); + + /* Verify the timer table, on a debug kernel only */ + if (g_bIsDebugKernel) { + KiCheckTimerTable(InterruptTime); + } + + /* Check if we still have DPC entries */ + if (DpcCalls) + { + /* Release the dispatcher while doing DPCs */ + KiUnlockDispatcherDatabase(DISPATCH_LEVEL); + + /* Start looping all DPC Entries */ + for (i = 0; DpcCalls; DpcCalls--, i++) + { + /* Call the DPC */ + EmuLog(LOG_LEVEL::DEBUG, "%s, calling DPC at 0x%.8X", __func__, DpcEntry[i].Routine); + __try { + // Call the Deferred Procedure : + DpcEntry[i].Routine( + DpcEntry[i].Dpc, + DpcEntry[i].Context, + UlongToPtr(SystemTime.u.LowPart), + UlongToPtr(SystemTime.u.HighPart) + ); + } + __except (EmuException(GetExceptionInformation())) + { + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); + } + } + + /* Lower IRQL if we need to */ + if (OldIrql != DISPATCH_LEVEL) { + KfLowerIrql(OldIrql); + } + KiTimerUnlock(); + } + else + { + /* Unlock the dispatcher */ + KiUnlockDispatcherDatabase(OldIrql); + KiTimerUnlock(); + } +} + +xboxkrnl::VOID FASTCALL xboxkrnl::KiTimerListExpire +( + IN xboxkrnl::PLIST_ENTRY ExpiredListHead, + IN xboxkrnl::KIRQL OldIrql +) +{ + ULARGE_INTEGER SystemTime; + LARGE_INTEGER Interval; + LONG i; + ULONG DpcCalls = 0; + PKTIMER Timer; + PKDPC TimerDpc; + ULONG Period; + DPC_QUEUE_ENTRY DpcEntry[MAX_TIMER_DPCS]; + + ASSERT_TIMER_LOCKED; + + /* Query system */ + KeQuerySystemTime((PLARGE_INTEGER)&SystemTime); + + /* Loop expired list */ + while (ExpiredListHead->Flink != ExpiredListHead) + { + /* Get the current timer */ + Timer = CONTAINING_RECORD(ExpiredListHead->Flink, KTIMER, TimerListEntry); + + /* Remove it */ + RemoveEntryList(&Timer->TimerListEntry); + + /* Not inserted */ + Timer->Header.Inserted = FALSE; + + /* Signal it */ + Timer->Header.SignalState = 1; + + /* Get the DPC and period */ + TimerDpc = Timer->Dpc; + Period = Timer->Period; + + /* Check if there's any waiters */ + if (!IsListEmpty(&Timer->Header.WaitListHead)) + { + /* Check the type of event */ + if (Timer->Header.Type == TimerNotificationObject) + { + /* Unwait the thread */ + // KxUnwaitThread(&Timer->Header, IO_NO_INCREMENT); + } + else + { + /* Otherwise unwait the thread and signal the timer */ + // KxUnwaitThreadForEvent((PKEVENT)Timer, IO_NO_INCREMENT); + } + } + + /* Check if we have a period */ + if (Period) + { + /* Calculate the interval and insert the timer */ + Interval.QuadPart = Int32x32To64(Period, -10000); + while (!KiInsertTreeTimer(Timer, Interval)); + } + + /* Check if we have a DPC */ + if (TimerDpc) + { + /* Setup the DPC Entry */ + DpcEntry[DpcCalls].Dpc = TimerDpc; + DpcEntry[DpcCalls].Routine = TimerDpc->DeferredRoutine; + DpcEntry[DpcCalls].Context = TimerDpc->DeferredContext; + DpcCalls++; + assert(DpcCalls < MAX_TIMER_DPCS); + } + } + + /* Check if we still have DPC entries */ + if (DpcCalls) + { + /* Release the dispatcher while doing DPCs */ + KiUnlockDispatcherDatabase(DISPATCH_LEVEL); + + /* Start looping all DPC Entries */ + for (i = 0; DpcCalls; DpcCalls--, i++) + { + /* Call the DPC */ + EmuLog(LOG_LEVEL::DEBUG, "%s, calling DPC at 0x%.8X", __func__, DpcEntry[i].Routine); + __try { + // Call the Deferred Procedure : + DpcEntry[i].Routine( + DpcEntry[i].Dpc, + DpcEntry[i].Context, + UlongToPtr(SystemTime.u.LowPart), + UlongToPtr(SystemTime.u.HighPart) + ); + } + __except (EmuException(GetExceptionInformation())) + { + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); + } + } + + /* Lower IRQL */ + KfLowerIrql(OldIrql); + KiTimerUnlock(); + } + else + { + /* Unlock the dispatcher */ + KiUnlockDispatcherDatabase(OldIrql); + KiTimerUnlock(); + } +} + +xboxkrnl::VOID FASTCALL xboxkrnl::KiWaitSatisfyAll +( + IN xboxkrnl::PKWAIT_BLOCK WaitBlock +) +{ + PKMUTANT Object; + PRKTHREAD Thread; + PKWAIT_BLOCK WaitBlock1; + + WaitBlock1 = WaitBlock; + Thread = WaitBlock1->Thread; + do { + if (WaitBlock1->WaitKey != (CSHORT)STATUS_TIMEOUT) { + Object = (PKMUTANT)WaitBlock1->Object; + KiWaitSatisfyAny(Object, Thread); + } + + WaitBlock1 = WaitBlock1->NextWaitBlock; + } while (WaitBlock1 != WaitBlock); + + return; +} diff --git a/src/core/kernel/exports/EmuKrnlKi.h b/src/core/kernel/exports/EmuKrnlKi.h new file mode 100644 index 000000000..f6e25e869 --- /dev/null +++ b/src/core/kernel/exports/EmuKrnlKi.h @@ -0,0 +1,211 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +#include + +// Workaround to avoid collisions with the VOID provided by Windows and the one of xboxkrnl +#ifdef VOID +#undef VOID +#endif + +// ReactOS uses a size of 512, but disassembling the kernel reveals it to be 32 instead +#define TIMER_TABLE_SIZE 32 + +namespace xboxkrnl +{ + typedef struct _KTIMER_TABLE_ENTRY + { + LIST_ENTRY Entry; + ULARGE_INTEGER Time; + } KTIMER_TABLE_ENTRY, *PKTIMER_TABLE_ENTRY; + + // Actually, this lock isn't required, but because raising the irql to dpc level doesn't really prevent thread switching at the + // moment, we need it for now to prevent concurrent access to the timer table + typedef struct _KI_TIMER_LOCK + { + std::recursive_mutex Mtx; + int Acquired; + } KI_TIMER_LOCK; + + + VOID KiInitSystem(); + + VOID KiTimerLock(); + + VOID KiTimerUnlock(); + + VOID KiClockIsr + ( + IN unsigned int ScalingFactor + ); + + VOID NTAPI KiCheckTimerTable + ( + IN ULARGE_INTEGER CurrentTime + ); + + VOID KxInsertTimer + ( + IN PKTIMER Timer, + IN ULONG Hand + ); + + VOID FASTCALL KiCompleteTimer + ( + IN PKTIMER Timer, + IN ULONG Hand + ); + + VOID KiRemoveEntryTimer + ( + IN PKTIMER Timer, + IN ULONG Hand + ); + + VOID KxRemoveTreeTimer + ( + IN PKTIMER Timer + ); + + BOOLEAN FASTCALL KiInsertTimerTable + ( + IN PKTIMER Timer, + IN ULONG Hand + ); + + BOOLEAN FASTCALL KiInsertTreeTimer + ( + IN PKTIMER Timer, + IN LARGE_INTEGER Interval + ); + + ULONG KiComputeTimerTableIndex + ( + IN ULONGLONG Interval + ); + + BOOLEAN KiComputeDueTime + ( + IN PKTIMER Timer, + IN LARGE_INTEGER DueTime, + OUT PULONG Hand + ); + + BOOLEAN FASTCALL KiSignalTimer + ( + IN PKTIMER Timer + ); + + VOID NTAPI KiTimerExpiration + ( + IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2 + ); + + VOID FASTCALL KiTimerListExpire + ( + IN PLIST_ENTRY ExpiredListHead, + IN KIRQL OldIrql + ); + + VOID FASTCALL KiWaitSatisfyAll + ( + IN PKWAIT_BLOCK WaitBlock + ); +}; + +extern const xboxkrnl::ULONG CLOCK_TIME_INCREMENT; +extern xboxkrnl::LIST_ENTRY KiWaitInListHead; +extern xboxkrnl::KTIMER_TABLE_ENTRY KiTimerTableListHead[TIMER_TABLE_SIZE]; +extern xboxkrnl::KI_TIMER_LOCK KiTimerMtx; + +#define KiLockDispatcherDatabase(OldIrql) \ + *(OldIrql) = KeRaiseIrqlToDpcLevel() + +#define KiLockDispatcherDatabaseAtDpcLevel() \ + KeRaiseIrqlToDpcLevel() + +#define KiLockApcQueue(Thread, OldIrql) \ + *(OldIrql) = KeRaiseIrqlToSynchLevel() + +#define KiUnlockApcQueue(Thread, OldIrql) \ + KfLowerIrql((OldIrql)) + +#define KiInsertWaitList(_WaitMode, _Thread) { \ + PLIST_ENTRY _ListHead; \ + _ListHead = &KiWaitInListHead; \ + InsertTailList(_ListHead, &(_Thread)->WaitListEntry); \ +} + +#define KiWaitSatisfyMutant(_Object_, _Thread_) { \ + (_Object_)->Header.SignalState -= 1; \ + if ((_Object_)->Header.SignalState == 0) { \ + (_Object_)->OwnerThread = (_Thread_); \ + if ((_Object_)->Abandoned == TRUE) { \ + (_Object_)->Abandoned = FALSE; \ + (_Thread_)->WaitStatus = STATUS_ABANDONED; \ + } \ + \ + InsertHeadList((_Thread_)->MutantListHead.Blink, \ + &(_Object_)->MutantListEntry); \ + } \ +} + +#define KiWaitSatisfyOther(_Object_) { \ + if (((_Object_)->Header.Type & DISPATCHER_OBJECT_TYPE_MASK) == EventSynchronizationObject) { \ + (_Object_)->Header.SignalState = 0; \ + \ + } else if ((_Object_)->Header.Type == SemaphoreObject) { \ + (_Object_)->Header.SignalState -= 1; \ + \ + } \ +} + +#define KiWaitSatisfyAny(_Object_, _Thread_) { \ + if (((_Object_)->Header.Type & DISPATCHER_OBJECT_TYPE_MASK) == EventSynchronizationObject) { \ + (_Object_)->Header.SignalState = 0; \ + \ + } else if ((_Object_)->Header.Type == SemaphoreObject) { \ + (_Object_)->Header.SignalState -= 1; \ + \ + } else if ((_Object_)->Header.Type == MutantObject) { \ + (_Object_)->Header.SignalState -= 1; \ + if ((_Object_)->Header.SignalState == 0) { \ + (_Object_)->OwnerThread = (_Thread_); \ + if ((_Object_)->Abandoned == TRUE) { \ + (_Object_)->Abandoned = FALSE; \ + (_Thread_)->WaitStatus = STATUS_ABANDONED; \ + } \ + \ + InsertHeadList((_Thread_)->MutantListHead.Blink, \ + &(_Object_)->MutantListEntry); \ + } \ + } \ +} diff --git a/src/CxbxKrnl/EmuKrnlLogging.cpp b/src/core/kernel/exports/EmuKrnlLogging.cpp similarity index 90% rename from src/CxbxKrnl/EmuKrnlLogging.cpp rename to src/core/kernel/exports/EmuKrnlLogging.cpp index 80aba6e04..22d074213 100644 --- a/src/CxbxKrnl/EmuKrnlLogging.cpp +++ b/src/core/kernel/exports/EmuKrnlLogging.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->EmuKrnlLogging.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,11 +24,9 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::LOG -#ifdef _DEBUG // prevent name collisions namespace xboxkrnl { @@ -45,18 +34,9 @@ namespace xboxkrnl }; -//#include -//#include -//#include -// -//#include // for DWORD -//#include // for std::stringstream -//#include // For std::cout -//#include // For std::setw - #include "Logging.h" #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" +#include "core\kernel\init\CxbxKrnl.h" // prevent name collisions namespace xboxkrnl @@ -123,12 +103,12 @@ ENUM2STR_START(BUS_DATA_TYPE) ENUM2STR_END_and_LOGRENDER(BUS_DATA_TYPE) ENUM2STR_START(CREATE_DISPOSITION) - ENUM2STR_CASE_DEF(FILE_SUPERSEDE) - ENUM2STR_CASE_DEF(FILE_OPEN) - ENUM2STR_CASE_DEF(FILE_CREATE) - ENUM2STR_CASE_DEF(FILE_OPEN_IF) - ENUM2STR_CASE_DEF(FILE_OVERWRITE) - ENUM2STR_CASE_DEF(FILE_OVERWRITE_IF) + ENUM2STR_CASE(FILE_SUPERSEDE) + ENUM2STR_CASE(FILE_OPEN) + ENUM2STR_CASE(FILE_CREATE) + ENUM2STR_CASE(FILE_OPEN_IF) + ENUM2STR_CASE(FILE_OVERWRITE) + ENUM2STR_CASE(FILE_OVERWRITE_IF) // ENUM2STR_CASE_DEF(FILE_MAXIMUM_DISPOSITION) Skip, identical to FILE_OVERWRITE_IF ENUM2STR_END_and_LOGRENDER(CREATE_DISPOSITION) @@ -148,11 +128,10 @@ FLAGS2STR_START(CREATE_OPTION) FLAG2STR(FILE_SEQUENTIAL_ONLY) FLAG2STR(FILE_NO_INTERMEDIATE_BUFFERING) FLAG2STR(FILE_SYNCHRONOUS_IO_ALERT) - FLAG2STR(FILE_SYNCHRONOUS_IO_NONALERT) + FLAG2STR(FILE_SYNCHRONOUS_IO_NONALERT) FLAG2STR(FILE_NON_DIRECTORY_FILE) FLAG2STR(FILE_CREATE_TREE_CONNECTION) FLAG2STR(FILE_COMPLETE_IF_OPLOCKED) - FLAG2STR(FILE_NON_DIRECTORY_FILE) FLAG2STR(FILE_NO_EA_KNOWLEDGE) FLAG2STR(FILE_OPEN_FOR_RECOVERY) FLAG2STR(FILE_RANDOM_ACCESS) @@ -240,12 +219,12 @@ ENUM2STR_START(KINTERRUPT_MODE) ENUM2STR_END_and_LOGRENDER(KINTERRUPT_MODE) ENUM2STR_START(KIRQL_TYPE) - ENUM2STR_CASE_DEF(PASSIVE_LEVEL) - ENUM2STR_CASE_DEF(APC_LEVEL) - ENUM2STR_CASE_DEF(DISPATCH_LEVEL) - ENUM2STR_CASE_DEF(PROFILE_LEVEL) - ENUM2STR_CASE_DEF(SYNC_LEVEL) - ENUM2STR_CASE_DEF(HIGH_LEVEL) + ENUM2STR_CASE(PASSIVE_LEVEL) + ENUM2STR_CASE(APC_LEVEL) + ENUM2STR_CASE(DISPATCH_LEVEL) + ENUM2STR_CASE(PROFILE_LEVEL) + ENUM2STR_CASE(SYNC_LEVEL) + ENUM2STR_CASE(HIGH_LEVEL) ENUM2STR_END_and_LOGRENDER(KIRQL_TYPE) ENUM2STR_START(KWAIT_REASON) @@ -402,7 +381,7 @@ LOGRENDER(LAUNCH_DATA_HEADER) return os LOGRENDER_MEMBER(dwLaunchDataType) LOGRENDER_MEMBER(dwTitleId) - LOGRENDER_MEMBER_SANITIZED(szLaunchPath, char *) + LOGRENDER_MEMBER_SANITIZED(szLaunchPath, char *, /*Length=*/sizeof(value.szLaunchPath) / sizeof(value.szLaunchPath[0])) LOGRENDER_MEMBER(dwFlags); } @@ -410,8 +389,8 @@ LOGRENDER(LAUNCH_DATA_PAGE) { return os LOGRENDER_MEMBER_NAME(Header) << &value.Header - LOGRENDER_MEMBER_SANITIZED(Pad, char *) - LOGRENDER_MEMBER_SANITIZED(LaunchData, char *); + LOGRENDER_MEMBER_SANITIZED(Pad, char *, /*Length=*/sizeof(value.Pad) / sizeof(value.Pad[0])) + LOGRENDER_MEMBER_SANITIZED(LaunchData, char *, /*Length=*/sizeof(value.LaunchData) / sizeof(value.LaunchData[0])); } LOGRENDER(MM_STATISTICS) @@ -442,7 +421,7 @@ LOGRENDER(STRING) return os LOGRENDER_MEMBER(Length) LOGRENDER_MEMBER(MaximumLength) - LOGRENDER_MEMBER_SANITIZED(Buffer, char *); + LOGRENDER_MEMBER_SANITIZED(Buffer, char *, value.Length); } LOGRENDER(UNICODE_STRING) @@ -450,8 +429,7 @@ LOGRENDER(UNICODE_STRING) return os LOGRENDER_MEMBER(Length) LOGRENDER_MEMBER(MaximumLength) - LOGRENDER_MEMBER_SANITIZED(Buffer, wchar_t *); + LOGRENDER_MEMBER_SANITIZED(Buffer, wchar_t *, value.Length); } -}; // end of namespace xboxkrnl; -#endif \ No newline at end of file +}; // end of namespace xboxkrnl; diff --git a/src/CxbxKrnl/EmuKrnlLogging.h b/src/core/kernel/exports/EmuKrnlLogging.h similarity index 89% rename from src/CxbxKrnl/EmuKrnlLogging.h rename to src/core/kernel/exports/EmuKrnlLogging.h index 12b620246..15e291632 100644 --- a/src/CxbxKrnl/EmuKrnlLogging.h +++ b/src/core/kernel/exports/EmuKrnlLogging.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->EmuKrnlLogging.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,20 +25,17 @@ #ifndef _EMU_KERNEL_LOGGING_H #define _EMU_KERNEL_LOGGING_H -#pragma once - // prevent name collisions namespace xboxkrnl { -#include // Additional types, exclusively for logging (not really enums) : -enum ALLOCATION_TYPE; -enum CREATE_DISPOSITION; -enum CREATE_OPTION; -//enum NTSTATUS; -enum KIRQL_TYPE; // fake enum, since KIRQL is an unsigned char, which clashes with BOOLEAN -enum PROTECTION_TYPE; +enum ALLOCATION_TYPE : int; +enum CREATE_DISPOSITION : int; +enum CREATE_OPTION : int; +//enum NTSTATUS : int; +enum KIRQL_TYPE : int; // fake enum, since KIRQL is an unsigned char, which clashes with BOOLEAN +enum PROTECTION_TYPE : int; }; @@ -55,6 +43,17 @@ enum PROTECTION_TYPE; #include // for std::ostream #include "Logging.h" +// MinGW defines these as macros, which cause issues with overloads +#ifdef EXCEPTION_DISPOSITION +#undef EXCEPTION_DISPOSITION +#undef ExceptionContinueExecution +#undef ExceptionContinueSearch +#undef ExceptionNestedException +#undef ExceptionCollidedUnwind +#endif + +#include + // prevent name collisions namespace xboxkrnl { diff --git a/src/CxbxKrnl/EmuKrnlMm.cpp b/src/core/kernel/exports/EmuKrnlMm.cpp similarity index 89% rename from src/CxbxKrnl/EmuKrnlMm.cpp rename to src/core/kernel/exports/EmuKrnlMm.cpp index da54e718f..2aa5fbe39 100644 --- a/src/CxbxKrnl/EmuKrnlMm.cpp +++ b/src/core/kernel/exports/EmuKrnlMm.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlMm.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,9 +26,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::MM // prevent name collisions namespace xboxkrnl @@ -48,16 +38,16 @@ namespace xboxkrnl #include "Logging.h" // For LOG_FUNC() #include "EmuKrnl.h" // For DefaultLaunchDataPage #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() -#include "VMManager.h" +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "core\kernel\memory-manager\VMManager.h" #include "EmuShared.h" #include // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" // For NtAllocateVirtualMemory(), etc. + #include "core\kernel\support\EmuNtDll.h" // For NtAllocateVirtualMemory(), etc. }; // ****************************************************************** @@ -176,6 +166,10 @@ XBSYSAPI EXPORTNUM(169) xboxkrnl::PVOID NTAPI xboxkrnl::MmCreateKernelStack PVOID addr = (PVOID)g_VMManager.AllocateSystemMemory(DebuggerThread ? DebuggerType : StackType, XBOX_PAGE_READWRITE, NumberOfBytes, true); + // Since this is creating a stack (which counts DOWN) we must return the *end* of the address range, not the start + // Test cases: DOA3, Futurama + addr = (PVOID)((uint32_t)addr + NumberOfBytes + PAGE_SIZE); + RETURN(addr); } @@ -193,8 +187,10 @@ XBSYSAPI EXPORTNUM(170) xboxkrnl::VOID NTAPI xboxkrnl::MmDeleteKernelStack LOG_FUNC_ARG(StackLimit) LOG_FUNC_END; + ULONG actualStackSize = ((VAddr)StackBase - (VAddr)StackLimit) + PAGE_SIZE; + g_VMManager.DeallocateSystemMemory(IS_SYSTEM_ADDRESS(StackBase) ? StackType : DebuggerType, - (VAddr)StackBase, (VAddr)StackBase - (VAddr)StackLimit + PAGE_SIZE); + (VAddr)StackBase - (VAddr)actualStackSize, actualStackSize); } // ****************************************************************** @@ -407,7 +403,7 @@ XBSYSAPI EXPORTNUM(181) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmQueryStatistics if (!MemoryStatistics) { - EmuWarning("KNRL: MmQueryStatistics : PMM_STATISTICS MemoryStatistics is nullptr!\n"); + EmuLog(LOG_LEVEL::WARNING, "MmQueryStatistics : PMM_STATISTICS MemoryStatistics is nullptr!\n"); LOG_IGNORED(); RETURN(STATUS_INVALID_PARAMETER); } @@ -416,21 +412,21 @@ XBSYSAPI EXPORTNUM(181) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmQueryStatistics { g_VMManager.MemoryStatistics(MemoryStatistics); - DbgPrintf(" MemoryStatistics->Length = 0x%.08X\n", MemoryStatistics->Length); - DbgPrintf(" MemoryStatistics->TotalPhysicalPages = 0x%.08X\n", MemoryStatistics->TotalPhysicalPages); - DbgPrintf(" MemoryStatistics->AvailablePages = 0x%.08X\n", MemoryStatistics->AvailablePages); - DbgPrintf(" MemoryStatistics->VirtualMemoryBytesCommitted = 0x%.08X\n", MemoryStatistics->VirtualMemoryBytesCommitted); - DbgPrintf(" MemoryStatistics->VirtualMemoryBytesReserved = 0x%.08X\n", MemoryStatistics->VirtualMemoryBytesReserved); - DbgPrintf(" MemoryStatistics->CachePagesCommitted = 0x%.08X\n", MemoryStatistics->CachePagesCommitted); - DbgPrintf(" MemoryStatistics->PoolPagesCommitted = 0x%.08X\n", MemoryStatistics->PoolPagesCommitted); - DbgPrintf(" MemoryStatistics->StackPagesCommitted = 0x%.08X\n", MemoryStatistics->StackPagesCommitted); - DbgPrintf(" MemoryStatistics->ImagePagesCommitted = 0x%.08X\n", MemoryStatistics->ImagePagesCommitted); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->Length = 0x%.08X", MemoryStatistics->Length); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->TotalPhysicalPages = 0x%.08X", MemoryStatistics->TotalPhysicalPages); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->AvailablePages = 0x%.08X", MemoryStatistics->AvailablePages); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->VirtualMemoryBytesCommitted = 0x%.08X", MemoryStatistics->VirtualMemoryBytesCommitted); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->VirtualMemoryBytesReserved = 0x%.08X", MemoryStatistics->VirtualMemoryBytesReserved); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->CachePagesCommitted = 0x%.08X", MemoryStatistics->CachePagesCommitted); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->PoolPagesCommitted = 0x%.08X", MemoryStatistics->PoolPagesCommitted); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->StackPagesCommitted = 0x%.08X", MemoryStatistics->StackPagesCommitted); + EmuLog(LOG_LEVEL::DEBUG, " MemoryStatistics->ImagePagesCommitted = 0x%.08X", MemoryStatistics->ImagePagesCommitted); ret = STATUS_SUCCESS; } else { - EmuWarning("KRNL: MmQueryStatistics with unusual size -> 0x%.8X", MemoryStatistics->Length); + EmuLog(LOG_LEVEL::WARNING, "MmQueryStatistics with unusual size -> 0x%.8X", MemoryStatistics->Length); ret = STATUS_INVALID_PARAMETER; } diff --git a/src/CxbxKrnl/EmuKrnlNt.cpp b/src/core/kernel/exports/EmuKrnlNt.cpp similarity index 87% rename from src/CxbxKrnl/EmuKrnlNt.cpp rename to src/core/kernel/exports/EmuKrnlNt.cpp index 36c5aaf08..f3ed7c211 100644 --- a/src/CxbxKrnl/EmuKrnlNt.cpp +++ b/src/core/kernel/exports/EmuKrnlNt.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlNt.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::NT // prevent name collisions namespace xboxkrnl @@ -50,13 +40,14 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { -#include "EmuNtDll.h" +#include "core\kernel\support\EmuNtDll.h" }; -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() -#include "EmuFile.h" // For EmuNtSymbolicLinkObject, NtStatusToString(), etc. -#include "VMManager.h" // For g_VMManager +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup +#include "core\kernel\exports\EmuKrnlKe.h" +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "core\kernel\support\EmuFile.h" // For EmuNtSymbolicLinkObject, NtStatusToString(), etc. +#include "core\kernel\memory-manager\VMManager.h" // For g_VMManager #include "CxbxDebugger.h" #pragma warning(disable:4005) // Ignore redefined status values @@ -65,9 +56,12 @@ namespace NtDll #include #include +#include // Used to keep track of duplicate handles created by NtQueueApcThread() std::unordered_map g_DuplicateHandles; +// Prevent setting the system time from multiple threads at the same time +std::mutex NtSystemTimeMtx; // ****************************************************************** @@ -117,7 +111,7 @@ XBSYSAPI EXPORTNUM(185) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCancelTimer /*OUT*/CurrentState); if (FAILED(ret)) - EmuWarning("NtCancelTimer failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCancelTimer failed!"); RETURN(ret); } @@ -135,7 +129,7 @@ XBSYSAPI EXPORTNUM(186) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtClearEvent NTSTATUS ret = NtDll::NtClearEvent(EventHandle); if (FAILED(ret)) - EmuWarning("NtClearEvent Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtClearEvent Failed!"); RETURN(ret); } @@ -175,7 +169,7 @@ XBSYSAPI EXPORTNUM(187) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtClose // Delete duplicate threads created by our implementation of NtQueueApcThread() if( GetHandleInformation( g_DuplicateHandles[Handle], &flags ) != 0 ) { - DbgPrintf( "Closing duplicate handle...\n" ); + EmuLog(LOG_LEVEL::DEBUG, "Closing duplicate handle..." ); CloseHandle( g_DuplicateHandles[Handle] ); g_DuplicateHandles.erase(Handle); @@ -218,9 +212,9 @@ XBSYSAPI EXPORTNUM(188) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateDirectoryObje } if (FAILED(ret)) - EmuWarning("NtCreateDirectoryObject Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCreateDirectoryObject Failed!"); else - DbgPrintf("KRNL: NtCreateDirectoryObject DirectoryHandle = 0x%.8X\n", *DirectoryHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateDirectoryObject DirectoryHandle = 0x%.8X", *DirectoryHandle); RETURN(ret); } @@ -283,7 +277,7 @@ XBSYSAPI EXPORTNUM(189) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateEvent if (FAILED(ret)) { - EmuWarning("Trying fallback (without object attributes)...\nError code 0x%X", ret); + EmuLog(LOG_LEVEL::WARNING, "Trying fallback (without object attributes)...\nError code 0x%X", ret); // If it fails, try again but without the object attributes stucture // This fixes Panzer Dragoon games on non-Vista OSes. @@ -295,12 +289,12 @@ XBSYSAPI EXPORTNUM(189) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateEvent InitialState); if(FAILED(ret)) - EmuWarning("NtCreateEvent Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCreateEvent Failed!"); else - DbgPrintf("KRNL: NtCreateEvent EventHandle = 0x%.8X\n", *EventHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateEvent EventHandle = 0x%.8X", *EventHandle); } else - DbgPrintf("KRNL: NtCreateEvent EventHandle = 0x%.8X\n", *EventHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateEvent EventHandle = 0x%.8X", *EventHandle); RETURN(ret); } @@ -413,7 +407,7 @@ XBSYSAPI EXPORTNUM(192) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateMutant if (FAILED(ret)) { - EmuWarning("Trying fallback (without object attributes)...\nError code 0x%X", ret); + EmuLog(LOG_LEVEL::WARNING, "Trying fallback (without object attributes)...\nError code 0x%X", ret); // If it fails, try again but without the object attributes stucture ret = NtDll::NtCreateMutant( @@ -423,12 +417,12 @@ XBSYSAPI EXPORTNUM(192) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateMutant InitialOwner); if(FAILED(ret)) - EmuWarning("NtCreateMutant Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCreateMutant Failed!"); else - DbgPrintf("KRNL: NtCreateMutant MutantHandle = 0x%.8X\n", *MutantHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateMutant MutantHandle = 0x%.8X", *MutantHandle); } else - DbgPrintf("KRNL: NtCreateMutant MutantHandle = 0x%.8X\n", *MutantHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateMutant MutantHandle = 0x%.8X", *MutantHandle); RETURN(ret); } @@ -487,7 +481,7 @@ XBSYSAPI EXPORTNUM(193) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateSemaphore if (FAILED(ret)) { - EmuWarning("Trying fallback (without object attributes)...\nError code 0x%X", ret); + EmuLog(LOG_LEVEL::WARNING, "Trying fallback (without object attributes)...\nError code 0x%X", ret); // If it fails, try again but without the object attributes stucture ret = NtDll::NtCreateSemaphore( @@ -498,12 +492,12 @@ XBSYSAPI EXPORTNUM(193) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateSemaphore MaximumCount); if(FAILED(ret)) - EmuWarning("NtCreateSemaphore failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCreateSemaphore failed!"); else - DbgPrintf("KRNL: NtCreateSemaphore SemaphoreHandle = 0x%.8X\n", *SemaphoreHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateSemaphore SemaphoreHandle = 0x%.8X", *SemaphoreHandle); } else - DbgPrintf("KRNL: NtCreateSemaphore SemaphoreHandle = 0x%.8X\n", *SemaphoreHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateSemaphore SemaphoreHandle = 0x%.8X", *SemaphoreHandle); RETURN(ret); } @@ -561,9 +555,9 @@ XBSYSAPI EXPORTNUM(194) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateTimer ); if (FAILED(ret)) - EmuWarning("NtCreateTimer failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtCreateTimer failed!"); else - DbgPrintf("KRNL: NtCreateTimer TimerHandle = 0x%.8X\n", *TimerHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtCreateTimer TimerHandle = 0x%.8X", *TimerHandle); RETURN(ret); } @@ -591,7 +585,7 @@ XBSYSAPI EXPORTNUM(195) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtDeleteFile } if (FAILED(ret)) - EmuWarning("NtDeleteFile Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtDeleteFile Failed!"); RETURN(ret); } @@ -728,7 +722,7 @@ XBSYSAPI EXPORTNUM(197) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtDuplicateObject } if (ret != STATUS_SUCCESS) - EmuWarning("Object was not duplicated!"); + EmuLog(LOG_LEVEL::WARNING, "Object was not duplicated!"); RETURN(ret); } @@ -904,9 +898,9 @@ XBSYSAPI EXPORTNUM(203) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtOpenSymbolicLinkObj } if (ret != STATUS_SUCCESS) - EmuWarning("NtOpenSymbolicLinkObject failed! (%s)", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtOpenSymbolicLinkObject failed! (%s)", NtStatusToString(ret)); else - DbgPrintf("KRNL: NtOpenSymbolicLinkObject LinkHandle^ = 0x%.8X", *LinkHandle); + EmuLog(LOG_LEVEL::DEBUG, "NtOpenSymbolicLinkObject LinkHandle^ = 0x%.8X", *LinkHandle); RETURN(ret); } @@ -958,7 +952,7 @@ XBSYSAPI EXPORTNUM(205) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtPulseEvent /*OUT*/PreviousState); if (FAILED(ret)) - EmuWarning("NtPulseEvent failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtPulseEvent failed!"); RETURN(ret); } @@ -1004,15 +998,15 @@ XBSYSAPI EXPORTNUM(206) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueueApcThread if( FAILED( ret ) ) { - EmuWarning( "Duplicating handle with THREAD_SET_CONTEXT..." ); + EmuLog(LOG_LEVEL::WARNING, "Duplicating handle with THREAD_SET_CONTEXT..." ); // If we get here, then attempt to duplicate the thread. if(!DuplicateHandle(g_CurrentProcessHandle, ThreadHandle, g_CurrentProcessHandle, &hApcThread, THREAD_SET_CONTEXT,FALSE,0)) - EmuWarning("DuplicateHandle failed!"); + EmuLog(LOG_LEVEL::WARNING, "DuplicateHandle failed!"); else { g_DuplicateHandles[ThreadHandle] = hApcThread; // Save this thread because we'll need to de-reference it later - DbgPrintf( "DuplicateHandle returned 0x%X (ThreadId 0x%.4X)\n", hApcThread, GetThreadId( hApcThread ) ); + EmuLog(LOG_LEVEL::DEBUG, "DuplicateHandle returned 0x%X (ThreadId 0x%.4X)", hApcThread, GetThreadId( hApcThread ) ); } @@ -1025,7 +1019,7 @@ XBSYSAPI EXPORTNUM(206) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueueApcThread } if (FAILED(ret)) { - EmuWarning("NtQueueApcThread failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtQueueApcThread failed!"); CloseHandle( g_DuplicateHandles[ThreadHandle] ); g_DuplicateHandles.erase( ThreadHandle ); } @@ -1182,7 +1176,7 @@ XBSYSAPI EXPORTNUM(209) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryEvent /*ReturnLength=*/nullptr); if (ret != STATUS_SUCCESS) - EmuWarning("NtQueryEvent failed! (%s)", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQueryEvent failed! (%s)", NtStatusToString(ret)); RETURN(ret); } @@ -1219,7 +1213,7 @@ XBSYSAPI EXPORTNUM(210) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryFullAttributes NTToXboxFileInformation(&nativeNetOpenInfo, Attributes, FileNetworkOpenInformation, sizeof(xboxkrnl::FILE_NETWORK_OPEN_INFORMATION)); if (FAILED(ret)) - EmuWarning("NtQueryFullAttributesFile failed! (0x%.08X)", ret); + EmuLog(LOG_LEVEL::WARNING, "NtQueryFullAttributesFile failed! (0x%.08X)", ret); RETURN(ret); } @@ -1281,7 +1275,7 @@ XBSYSAPI EXPORTNUM(211) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryInformationFil free(ntFileInfo); if (FAILED(ret)) - EmuWarning("NtQueryInformationFile failed! (0x%.08X)", ret); + EmuLog(LOG_LEVEL::WARNING, "NtQueryInformationFile failed! (0x%.08X)", ret); // Prioritize the buffer overflow over real return code, // in case the Xbox program decides to follow the same procedure above @@ -1332,7 +1326,7 @@ XBSYSAPI EXPORTNUM(213) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryMutant /*ReturnLength=*/nullptr); if (ret != STATUS_SUCCESS) - EmuWarning("NtQueryMutant failed! (%s)", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQueryMutant failed! (%s)", NtStatusToString(ret)); RETURN(ret); } @@ -1359,7 +1353,7 @@ XBSYSAPI EXPORTNUM(214) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQuerySemaphore /*ReturnLength=*/nullptr); if (ret != STATUS_SUCCESS) - EmuWarning("NtQuerySemaphore failed! (%s)", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQuerySemaphore failed! (%s)", NtStatusToString(ret)); RETURN(ret); } @@ -1397,13 +1391,12 @@ XBSYSAPI EXPORTNUM(215) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQuerySymbolicLinkOb } else { if (LinkTarget != NULL) { - if (LinkTarget->Length > LinkTarget->MaximumLength) - { - ret = STATUS_BUFFER_TOO_SMALL; - LinkTarget->Length = LinkTarget->MaximumLength; + if (LinkTarget->MaximumLength >= symbolicLinkObject->XboxSymbolicLinkPath.length() + sizeof(char)) { + copy_string_to_PSTRING_to(symbolicLinkObject->XboxSymbolicLinkPath, LinkTarget); + } + else { + ret = STATUS_BUFFER_TOO_SMALL; } - - copy_string_to_PSTRING_to(symbolicLinkObject->XboxSymbolicLinkPath, LinkTarget); } if (ReturnedLength != NULL) @@ -1412,7 +1405,7 @@ XBSYSAPI EXPORTNUM(215) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQuerySymbolicLinkOb } } if (ret != STATUS_SUCCESS) - EmuWarning("NtQuerySymbolicLinkObject failed! (%s)", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQuerySymbolicLinkObject failed! (%s)", NtStatusToString(ret)); RETURN(ret); } @@ -1460,7 +1453,7 @@ XBSYSAPI EXPORTNUM(217) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVirtualMemory if (!Buffer) { - EmuWarning("KNRL: NtQueryVirtualMemory : PMEMORY_BASIC_INFORMATION Buffer is nullptr!\n"); + EmuLog(LOG_LEVEL::WARNING, "NtQueryVirtualMemory : PMEMORY_BASIC_INFORMATION Buffer is nullptr!\n"); LOG_IGNORED(); RETURN(STATUS_INVALID_PARAMETER); } @@ -1469,18 +1462,18 @@ XBSYSAPI EXPORTNUM(217) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVirtualMemory if (ret == STATUS_SUCCESS) { - DbgPrintf(" Buffer->AllocationBase = 0x%.08X\n", Buffer->AllocationBase); - DbgPrintf(" Buffer->AllocationProtect = 0x%.08X\n", Buffer->AllocationProtect); - DbgPrintf(" Buffer->BaseAddress = 0x%.08X\n", Buffer->BaseAddress); - DbgPrintf(" Buffer->RegionSize = 0x%.08X\n", Buffer->RegionSize); - DbgPrintf(" Buffer->State = 0x%.08X\n", Buffer->State); - DbgPrintf(" Buffer->Protect = 0x%.08X\n", Buffer->Protect); - DbgPrintf(" Buffer->Type = 0x%.08X\n", Buffer->Type); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->AllocationBase = 0x%.08X", Buffer->AllocationBase); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->AllocationProtect = 0x%.08X", Buffer->AllocationProtect); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->BaseAddress = 0x%.08X", Buffer->BaseAddress); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->RegionSize = 0x%.08X", Buffer->RegionSize); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->State = 0x%.08X", Buffer->State); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->Protect = 0x%.08X", Buffer->Protect); + EmuLog(LOG_LEVEL::DEBUG, " Buffer->Type = 0x%.08X", Buffer->Type); } #if 0 if (FAILED(ret)) { - EmuWarning("NtQueryVirtualMemory failed (%s)!", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQueryVirtualMemory failed (%s)!", NtStatusToString(ret)); // Bugfix for "Forza Motorsport", which iterates over 2 Gb of memory in 64kb chunks, // but fails on this last query. It's not done though, as after this Forza tries to @@ -1499,7 +1492,7 @@ XBSYSAPI EXPORTNUM(217) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVirtualMemory ret = STATUS_SUCCESS; - DbgPrintf("KRNL: NtQueryVirtualMemory: Applied fix for Forza Motorsport!\n"); + EmuLog(LOG_LEVEL::DEBUG, "NtQueryVirtualMemory: Applied fix for Forza Motorsport!"); } } #endif @@ -1605,7 +1598,7 @@ XBSYSAPI EXPORTNUM(218) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVolumeInformat break; default: // For all other types, just do a memcpy and hope for the best! - EmuWarning("NtQueryVolumeInformationFile: Unknown FileInformationClass"); + EmuLog(LOG_LEVEL::WARNING, "NtQueryVolumeInformationFile: Unknown FileInformationClass"); memcpy_s(FileInformation, Length, NativeFileInformation, HostBufferSize); break; } @@ -1614,7 +1607,7 @@ XBSYSAPI EXPORTNUM(218) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVolumeInformat _aligned_free(NativeFileInformation); if (FAILED(ret)) { - EmuWarning("NtQueryVolumeInformationFile failed! (%s)\n", NtStatusToString(ret)); + EmuLog(LOG_LEVEL::WARNING, "NtQueryVolumeInformationFile failed! (%s)\n", NtStatusToString(ret)); } RETURN(ret); @@ -1652,7 +1645,7 @@ XBSYSAPI EXPORTNUM(219) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReadFile if (CxbxDebugger::CanReport()) { - u64 Offset = ~0; + uint64_t Offset = ~0; if (ByteOffset) Offset = ByteOffset->QuadPart; @@ -1662,7 +1655,7 @@ XBSYSAPI EXPORTNUM(219) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReadFile NTSTATUS ret = NtDll::NtReadFile( FileHandle, Event, - ApcRoutine, + (PVOID)ApcRoutine, ApcContext, IoStatusBlock, Buffer, @@ -1671,7 +1664,7 @@ XBSYSAPI EXPORTNUM(219) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReadFile /*Key=*/nullptr); if (FAILED(ret)) { - EmuWarning("NtReadFile Failed! (0x%.08X)", ret); + EmuLog(LOG_LEVEL::WARNING, "NtReadFile Failed! (0x%.08X)", ret); } RETURN(ret); @@ -1726,7 +1719,7 @@ XBSYSAPI EXPORTNUM(221) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReleaseMutant NTSTATUS ret = NtDll::NtReleaseMutant(MutantHandle, PreviousCount); if (FAILED(ret)) - EmuWarning("NtReleaseMutant Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtReleaseMutant Failed!"); RETURN(STATUS_SUCCESS); // TODO : RETURN(ret); } @@ -1753,7 +1746,7 @@ XBSYSAPI EXPORTNUM(222) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtReleaseSemaphore PreviousCount); if (FAILED(ret)) - EmuWarning("NtReleaseSemaphore failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtReleaseSemaphore failed!"); RETURN(ret); } @@ -1827,7 +1820,7 @@ XBSYSAPI EXPORTNUM(225) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetEvent PreviousState); if (FAILED(ret)) - EmuWarning("NtSetEvent Failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtSetEvent Failed!"); RETURN(ret); } @@ -1901,32 +1894,38 @@ XBSYSAPI EXPORTNUM(228) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetSystemTime LOG_FUNC_BEGIN LOG_FUNC_ARG(SystemTime) LOG_FUNC_ARG_OUT(PreviousTime) - LOG_FUNC_END; + LOG_FUNC_END; - NTSTATUS ret = STATUS_SUCCESS; // TODO : Does Xbox returns STATUS_PRIVILEGE_NOT_HELD (supports SeSystemtimePrivlege)? + NTSTATUS ret = STATUS_SUCCESS; + LARGE_INTEGER NewSystemTime, OldSystemTime; + // LARGE_INTEGER LocalTime; + // TIME_FIELDS TimeFields; - if (PreviousTime == NULL && SystemTime == NULL) + if (SystemTime == nullptr) { ret = STATUS_ACCESS_VIOLATION; - else - { - // Surely, we won't set the system time here, but we CAN remember a delta to the host system time; - LARGE_INTEGER HostSystemTime; - GetSystemTimeAsFileTime((LPFILETIME)&HostSystemTime); // Available since Windows 2000 (NOT on XP!) + } + else { + NtSystemTimeMtx.lock(); + NewSystemTime = *SystemTime; + if (NewSystemTime.u.HighPart > 0 && NewSystemTime.u.HighPart <= 0x20000000) { + /* Convert the time and set it in HAL */ + // NOTE: disabled, as this requires emulating the RTC, which we don't yet + // ExSystemTimeToLocalTime(&NewSystemTime, &LocalTime); + // RtlTimeToTimeFields(&LocalTime, &TimeFields); + // HalSetRealTimeClock(&TimeFields); - // Is the previous time requested? - if (PreviousTime != NULL) - // Apply current HostSystemTimeDelta, same as in xboxkrnl::KeQuerySystemTime : - PreviousTime->QuadPart = HostSystemTime.QuadPart + HostSystemTimeDelta.QuadPart; + /* Now set system time */ + KeSetSystemTime(&NewSystemTime, &OldSystemTime); - // Is a new time given? - if (SystemTime != NULL) - { - if (SystemTime->QuadPart > 0) - // Calculate new HostSystemTimeDelta, to be used in xboxkrnl::KeQuerySystemTime : - HostSystemTimeDelta.QuadPart = HostSystemTime.QuadPart - SystemTime->QuadPart; - else - ret = STATUS_INVALID_PARAMETER; + // Is the previous time requested? + if (PreviousTime != nullptr) { + PreviousTime->QuadPart = OldSystemTime.QuadPart; + } } + else { + ret = STATUS_INVALID_PARAMETER; + } + NtSystemTimeMtx.unlock(); } RETURN(ret); @@ -1970,7 +1969,7 @@ XBSYSAPI EXPORTNUM(229) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSetTimerEx /*OUT*/PreviousState); if (FAILED(ret)) - EmuWarning("NtSetTimerEx failed!"); + EmuLog(LOG_LEVEL::WARNING, "NtSetTimerEx failed!"); RETURN(ret); } @@ -2053,7 +2052,7 @@ XBSYSAPI EXPORTNUM(232) xboxkrnl::VOID NTAPI xboxkrnl::NtUserIoApcDispatcher (CompletionRoutine)(dwErrorCode, dwTransferred, lpOverlapped); - DbgPrintf("KRNL: NtUserIoApcDispatcher Completed\n"); + EmuLog(LOG_LEVEL::DEBUG, "NtUserIoApcDispatcher Completed"); } // ****************************************************************** @@ -2066,17 +2065,15 @@ XBSYSAPI EXPORTNUM(233) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWaitForSingleObject IN PLARGE_INTEGER Timeout ) { - LOG_FORWARD("KeWaitForMultipleObjects"); + LOG_FORWARD("NtWaitForMultipleObjectsEx"); - return xboxkrnl::KeWaitForMultipleObjects( + return xboxkrnl::NtWaitForMultipleObjectsEx( /*Count=*/1, &Handle, /*WaitType=*/WaitAll, - /*WaitReason=*/WrUserRequest, /*WaitMode=*/KernelMode, Alertable, - Timeout, - /*WaitBlockArray*/NULL + Timeout ); } @@ -2091,17 +2088,15 @@ XBSYSAPI EXPORTNUM(234) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWaitForSingleObject IN PLARGE_INTEGER Timeout ) { - LOG_FORWARD("KeWaitForMultipleObjects"); + LOG_FORWARD("NtWaitForMultipleObjectsEx"); - return xboxkrnl::KeWaitForMultipleObjects( + return xboxkrnl::NtWaitForMultipleObjectsEx( /*Count=*/1, &Handle, /*WaitType=*/WaitAll, - /*WaitReason=*/WrUserRequest, WaitMode, Alertable, - Timeout, - /*WaitBlockArray*/NULL + Timeout ); } @@ -2118,17 +2113,21 @@ XBSYSAPI EXPORTNUM(235) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWaitForMultipleObje IN PLARGE_INTEGER Timeout ) { - LOG_FORWARD("KeWaitForMultipleObjects"); + LOG_FUNC_BEGIN + LOG_FUNC_ARG(Count) + LOG_FUNC_ARG(Handles) + LOG_FUNC_ARG(WaitType) + LOG_FUNC_ARG(WaitMode) + LOG_FUNC_ARG(Alertable) + LOG_FUNC_ARG(Timeout) + LOG_FUNC_END; - return xboxkrnl::KeWaitForMultipleObjects( + return NtDll::NtWaitForMultipleObjects( Count, Handles, - WaitType, - /*WaitReason=*/WrUserRequest, - WaitMode, + (NtDll::OBJECT_WAIT_TYPE)WaitType, Alertable, - Timeout, - /*WaitBlockArray*/NULL); + (NtDll::PLARGE_INTEGER)Timeout); } // ****************************************************************** @@ -2166,7 +2165,7 @@ XBSYSAPI EXPORTNUM(236) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWriteFile if (CxbxDebugger::CanReport()) { - u64 Offset = ~0; + uint64_t Offset = ~0; if (ByteOffset) Offset = ByteOffset->QuadPart; @@ -2176,7 +2175,7 @@ XBSYSAPI EXPORTNUM(236) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWriteFile NTSTATUS ret = NtDll::NtWriteFile( FileHandle, Event, - ApcRoutine, + (PVOID)ApcRoutine, ApcContext, IoStatusBlock, Buffer, @@ -2185,7 +2184,7 @@ XBSYSAPI EXPORTNUM(236) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtWriteFile /*Key=*/nullptr); if (FAILED(ret)) - EmuWarning("NtWriteFile Failed! (0x%.08X)", ret); + EmuLog(LOG_LEVEL::WARNING, "NtWriteFile Failed! (0x%.08X)", ret); RETURN(ret); } diff --git a/src/CxbxKrnl/EmuKrnlOb.cpp b/src/core/kernel/exports/EmuKrnlOb.cpp similarity index 93% rename from src/CxbxKrnl/EmuKrnlOb.cpp rename to src/core/kernel/exports/EmuKrnlOb.cpp index 4e5799f83..87400d476 100644 --- a/src/CxbxKrnl/EmuKrnlOb.cpp +++ b/src/core/kernel/exports/EmuKrnlOb.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlOb.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::OB // prevent name collisions namespace xboxkrnl @@ -46,10 +36,9 @@ namespace xboxkrnl #include "Logging.h" // For LOG_FUNC() #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" // For CxbxKrnlCleanup -#include "Emu.h" // For EmuWarning() +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup #include "EmuKrnl.h" // For OBJECT_TO_OBJECT_HEADER() -#include "EmuFile.h" // For EmuNtSymbolicLinkObject, NtStatusToString(), etc. +#include "core\kernel\support\EmuFile.h" // For EmuNtSymbolicLinkObject, NtStatusToString(), etc. #include #pragma warning(disable:4005) // Ignore redefined status values @@ -867,6 +856,16 @@ XBSYSAPI EXPORTNUM(246) xboxkrnl::NTSTATUS NTAPI xboxkrnl::ObReferenceObjectByHa status = STATUS_OBJECT_TYPE_MISMATCH; } } else { + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must return the input handle + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation(Handle, &flags)) { + // This was a Windows Handle, so return it. + *ReturnedObject = Handle; + return STATUS_SUCCESS; + } + status = STATUS_INVALID_HANDLE; } } @@ -948,6 +947,14 @@ XBSYSAPI EXPORTNUM(250) xboxkrnl::VOID FASTCALL xboxkrnl::ObfDereferenceObject { LOG_FUNC_ONE_ARG_OUT(Object); + // HACK: Since we forward to NtDll::NtCreateEvent, this *might* be a Windows handle instead of our own + // In this case, we must do nothing, otherwise we'll crash... + // Test Case: Xbox Live Dashboard, Network Test (or any other Xbox Live connection) + DWORD flags = 0; + if (GetHandleInformation((HANDLE)Object, &flags)) { + return; + } + POBJECT_HEADER ObjectHeader = OBJECT_TO_OBJECT_HEADER(Object); if (InterlockedDecrement(&ObjectHeader->PointerCount) == 0) { diff --git a/src/core/kernel/exports/EmuKrnlPhy.cpp b/src/core/kernel/exports/EmuKrnlPhy.cpp new file mode 100644 index 000000000..135d9d76b --- /dev/null +++ b/src/core/kernel/exports/EmuKrnlPhy.cpp @@ -0,0 +1,325 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +// prevent name collisions +namespace xboxkrnl +{ + #include +}; + +#define LOG_PREFIX CXBXR_MODULE::KRNL + +#include +#include +#include + +#include "Logging.h" +#include "EmuKrnlLogging.h" +#include "EmuKrnl.h" // for HalSystemInterrupts +#include "EmuKrnlKi.h" // for KiLockDispatcherDatabase +#include "core/kernel/init/CxbxKrnl.h" +#include "devices/Xbox.h" + +// prevent name collisions +namespace NtDll +{ + #include "core/kernel/support/EmuNtDll.h" +}; + +DWORD PhyInitFlag = 0; +DWORD PhyLinkState = 0; +LONG PhyLockFlag; + +// Flags returned by PhyGetLinkState +#define XNET_ETHERNET_LINK_ACTIVE 0x01 +#define XNET_ETHERNET_LINK_100MBPS 0x02 +#define XNET_ETHERNET_LINK_10MBPS 0x04 +#define XNET_ETHERNET_LINK_FULL_DUPLEX 0x08 +#define XNET_ETHERNET_LINK_HALF_DUPLEX 0x10 + +#define PhyLock() InterlockedCompareExchange(&PhyLockFlag, 1, 0) +#define PhyUnlock() (PhyLockFlag = 0) +#define NETERR(_err) HRESULT_FROM_WIN32(_err) +#define NETERR_OK STATUS_SUCCESS +#define NETERR_HARDWARE 0x801f0001 // hardware not responding + +#define BIT(n) (1u << (n)) +#define MDIOADR_LOCK BIT(15) +#define MDIOADR_WRITE BIT(10) +#define PHY_ADDR 1 +#define MDIOADR_PHYSHIFT 5 +#define MDIOADR_REGSHIFT 0 +#define MIITM_INTERVAL 5 +#define PHYRW_TIMEOUT ((64*2*2*400*MIITM_INTERVAL/1000)*16) +#define MIIREG_CONTROL 0 +#define MIIREG_STATUS 1 +#define MIIREG_ANAR 4 +#define MIIREG_LPANAR 5 +#define MIICONTROL_RESET BIT(15) +#define MIICONTROL_SPEED_SELECTION_BIT1 BIT(13) +#define MIICONTROL_RESTART_AUTO_NEGOTIATION BIT(9) +#define MIICONTROL_SPEED_SELECTION_BIT0 BIT(6) +#define MIISTATUS_100MBS_T4_CAPABLE BIT(15) +#define MIISTATUS_100MBS_X_HALF_DUPLEX_CAPABLE BIT(13) +#define MIISTATUS_10MBS_HALF_DUPLEX_CAPABLE BIT(11) +#define MIISTATUS_100MBS_T2_HALF_DUPLEX_CAPABLE BIT(9) +#define MIISTATUS_AUTO_NEGOTIATION_COMPLETE BIT(5) +#define MIISTATUS_AUTO_NEGOTIATION_CAPABLE BIT(3) +#define MII4_100BASE_T4 BIT(9) +#define MII4_100BASE_T_FULL_DUPLEX BIT(8) +#define MII4_100BASE_T_HALF_DUPLEX BIT(7) +#define MII4_10BASE_T_FULL_DUPLEX BIT(6) +#define MII4_10BASE_T_HALF_DUPLEX BIT(5) +#define MIISTATUS_LINK_IS_UP BIT(2) + +void PhyClearMDIOLOCK() +{ + g_NVNet->MMIOWrite(0, NvRegMIIControl, MDIOADR_LOCK, sizeof(DWORD)); + int timeout = PHYRW_TIMEOUT; + + do { + xboxkrnl::KeStallExecutionProcessor(50); + timeout -= 50; + } while (timeout > 0 && (g_NVNet->MMIORead(0, NvRegMIIControl, sizeof(DWORD)) & MDIOADR_LOCK)); +} + +// NON-Exported Phy Kernel functions +BOOL PhyReadReg(DWORD phyreg, DWORD* val) +{ + DWORD mdioadr; + INT timeout; + + if (g_NVNet->MMIORead(0, NvRegMIIControl, sizeof(DWORD)) & MDIOADR_LOCK) { + PhyClearMDIOLOCK(); + } + + mdioadr = (PHY_ADDR << MDIOADR_PHYSHIFT) | (phyreg << MDIOADR_REGSHIFT); + g_NVNet->MMIOWrite(0, NvRegMIIControl, mdioadr, sizeof(DWORD)); + mdioadr |= MDIOADR_LOCK; + + for (timeout = PHYRW_TIMEOUT; timeout > 0 && (mdioadr & MDIOADR_LOCK); timeout -= 50) { + xboxkrnl::KeStallExecutionProcessor(50); + mdioadr = g_NVNet->MMIORead(0, NvRegMIIControl, sizeof(DWORD)); + } + + *val = g_NVNet->MMIORead(0, NvRegMIIData, sizeof(DWORD)); + + if (mdioadr & MDIOADR_LOCK) { + EmuLog(LOG_LEVEL::WARNING, "PHY read failed: reg %d.\n", phyreg); + return FALSE; + } + + return TRUE; +} + +BOOL PhyWriteReg(DWORD phyreg, DWORD val) +{ + + DWORD mdioadr; + INT timeout; + + if (g_NVNet->MMIORead(0, NvRegMIIControl, sizeof(DWORD)) & MDIOADR_LOCK) { + PhyClearMDIOLOCK(); + } + + g_NVNet->MMIOWrite(0, NvRegMIIData, val, sizeof(DWORD)); + + mdioadr = (PHY_ADDR << MDIOADR_PHYSHIFT) | (phyreg << MDIOADR_REGSHIFT) | MDIOADR_WRITE; + g_NVNet->MMIOWrite(0, NvRegMIIControl, mdioadr, sizeof(DWORD)); + mdioadr |= MDIOADR_LOCK; + + for (timeout = PHYRW_TIMEOUT; timeout > 0 && (mdioadr & MDIOADR_LOCK); timeout -= 50) { + xboxkrnl::KeStallExecutionProcessor(50); + mdioadr = g_NVNet->MMIORead(0, NvRegMIIControl, sizeof(DWORD)); + } + + if (mdioadr & MDIOADR_LOCK) { + EmuLog(LOG_LEVEL::WARNING, "PHY write failed: reg %d.\n", phyreg); + return FALSE; + } + + return TRUE; +} + +DWORD PhyWaitForLinkUp() +{ + DWORD miiStatus = 0; + INT timeout = 1000; + while (timeout-- && !(miiStatus & MIISTATUS_LINK_IS_UP)) { + xboxkrnl::KeStallExecutionProcessor(500); + if (!PhyReadReg(MIIREG_STATUS, &miiStatus)) { + break; + } + } + + return miiStatus; +} + +BOOL PhyUpdateLinkState() +{ + DWORD anar, lpanar, miiStatus, state = 0; + + if (!PhyReadReg(MIIREG_ANAR, &anar) || !PhyReadReg(MIIREG_LPANAR, &lpanar) || !PhyReadReg(MIIREG_STATUS, &miiStatus)) { + return FALSE; + } + + anar &= lpanar; + if (anar & (MII4_100BASE_T_FULL_DUPLEX | MII4_100BASE_T_HALF_DUPLEX)) { + state |= XNET_ETHERNET_LINK_100MBPS; + } else if (anar & (MII4_10BASE_T_FULL_DUPLEX | MII4_10BASE_T_HALF_DUPLEX)) { + state |= XNET_ETHERNET_LINK_10MBPS; + } + + if (anar & (MII4_10BASE_T_FULL_DUPLEX | MII4_100BASE_T_FULL_DUPLEX)) { + state |= XNET_ETHERNET_LINK_FULL_DUPLEX; + } else if (anar & (MII4_10BASE_T_HALF_DUPLEX | MII4_100BASE_T_HALF_DUPLEX)) { + state |= XNET_ETHERNET_LINK_HALF_DUPLEX; + } + + if (miiStatus & MIISTATUS_LINK_IS_UP) { + state |= XNET_ETHERNET_LINK_ACTIVE; + } + + PhyLinkState = state; + + return TRUE; +} + +// ****************************************************************** +// * 0x00FC - PhyGetLinkState() +// ****************************************************************** +XBSYSAPI EXPORTNUM(252) xboxkrnl::DWORD NTAPI xboxkrnl::PhyGetLinkState +( + IN ULONG Mode +) +{ + LOG_FUNC_ONE_ARG(Mode); + + if ((!PhyLinkState || Mode) && PhyLock() == 0) { + PhyUpdateLinkState(); + PhyUnlock(); + } + + RETURN(PhyLinkState); +} + +// ****************************************************************** +// * 0x00FD - PhyInitialize() +// ****************************************************************** +XBSYSAPI EXPORTNUM(253) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PhyInitialize +( + IN ULONG forceReset, + IN PVOID Parameter2 +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(forceReset) + LOG_FUNC_ARG(Parameter2) + LOG_FUNC_END; + + DWORD miiControl, miiStatus; + INT timeout; + NTSTATUS status = NETERR_HARDWARE; + + if (PhyLock() != 0) { + return NETERR(ERROR_BUSY); + } + + if (forceReset) { + PhyInitFlag = 0; + PhyLinkState = 0; + + miiControl = MIICONTROL_RESET; + if (!PhyWriteReg(MIIREG_CONTROL, miiControl)) { + goto err; + } + + timeout = 1000; + while (timeout-- && (miiControl & MIICONTROL_RESET)) { + KeStallExecutionProcessor(500); + if (!PhyReadReg(MIIREG_CONTROL, &miiControl)) { + goto err; + } + } + + if (miiControl & MIICONTROL_RESET) { + goto err; + } + } else if (PhyInitFlag) { + PhyUpdateLinkState(); + status = NETERR_OK; + goto exit; + } + + timeout = 6000; + miiStatus = 0; + while (timeout-- && !(miiStatus & MIISTATUS_AUTO_NEGOTIATION_COMPLETE)) { + KeStallExecutionProcessor(500); + if (!PhyReadReg(MIIREG_STATUS, &miiStatus)) goto err; + } + + if (!PhyReadReg(MIIREG_CONTROL, &miiControl)) { + goto err; + } + + if (miiControl & MIICONTROL_RESTART_AUTO_NEGOTIATION) { + if (miiStatus & (MIISTATUS_100MBS_T4_CAPABLE | MIISTATUS_100MBS_X_HALF_DUPLEX_CAPABLE | MIISTATUS_100MBS_T2_HALF_DUPLEX_CAPABLE)) { + miiControl |= MIICONTROL_SPEED_SELECTION_BIT1; + miiControl &= ~MIICONTROL_SPEED_SELECTION_BIT0; + PhyLinkState |= XNET_ETHERNET_LINK_100MBPS; + } else if (miiStatus & MIISTATUS_10MBS_HALF_DUPLEX_CAPABLE) { + miiControl &= ~MIICONTROL_SPEED_SELECTION_BIT1; + miiControl |= MIICONTROL_SPEED_SELECTION_BIT0; + PhyLinkState |= XNET_ETHERNET_LINK_10MBPS; + } else { + goto err; + } + + PhyLinkState |= XNET_ETHERNET_LINK_HALF_DUPLEX; + PhyWriteReg(MIIREG_CONTROL, miiControl); + miiStatus = PhyWaitForLinkUp(); + + if (miiStatus & MIISTATUS_LINK_IS_UP) { + PhyLinkState |= XNET_ETHERNET_LINK_ACTIVE; + } + } else { + PhyWaitForLinkUp(); + if (!PhyUpdateLinkState()) { + goto err; + } + } + + PhyInitFlag = 1; + status = NETERR_OK; + +exit: + PhyUnlock(); + RETURN(status); +err: + EmuLog(LOG_LEVEL::WARNING, "Ethernet PHY initialization failed.\n"); + goto exit; +} diff --git a/src/CxbxKrnl/EmuKrnlPs.cpp b/src/core/kernel/exports/EmuKrnlPs.cpp similarity index 77% rename from src/CxbxKrnl/EmuKrnlPs.cpp rename to src/core/kernel/exports/EmuKrnlPs.cpp index 0a2114775..b0b4f3cef 100644 --- a/src/CxbxKrnl/EmuKrnlPs.cpp +++ b/src/core/kernel/exports/EmuKrnlPs.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlPs.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,10 +25,9 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" -#include +#define LOG_PREFIX CXBXR_MODULE::PS +#include // prevent name collisions namespace xboxkrnl @@ -45,19 +35,19 @@ namespace xboxkrnl #include // For PsCreateSystemThreadEx, etc. }; -#include // For __beginthreadex(), etc. +#include // For __beginthreadex(), etc. +#include // For _controlfp constants #include "Logging.h" // For LOG_FUNC() #include "EmuKrnlLogging.h" -#include "CxbxKrnl.h" // For CxbxKrnl_TLS -#include "Emu.h" // For EmuWarning() -#include "EmuFS.h" // For EmuGenerateFS -#include "EmuXTL.h" +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnl_TLS +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "core\kernel\support\EmuFS.h" // For EmuGenerateFS // prevent name collisions namespace NtDll { -#include "EmuNtDll.h" +#include "core\kernel\support\EmuNtDll.h" }; #define PSP_MAX_CREATE_THREAD_NOTIFY 16 /* TODO : Should be 8 */ @@ -111,8 +101,6 @@ void InitXboxThread(DWORD_PTR cores) } // PsCreateSystemThread proxy procedure -#pragma warning(push) -#pragma warning(disable: 4731) // disable ebp modification warning // Dxbx Note : The signature of PCSTProxy should conform to System.TThreadFunc ! static unsigned int WINAPI PCSTProxy ( @@ -130,7 +118,7 @@ static unsigned int WINAPI PCSTProxy HANDLE hStartedEvent = iPCSTProxyParam->hStartedEvent; // Once deleted, unable to directly access iPCSTProxyParam in remainder of function. - delete iPCSTProxyParam; + free(iPCSTProxyParam); LOG_PCSTProxy( StartRoutine, @@ -145,61 +133,30 @@ static unsigned int WINAPI PCSTProxy SetEvent(hStartedEvent); - if (StartSuspended == TRUE) - // Suspend right before calling the thread notification routines - SuspendThread(GetCurrentThread()); - - // call thread notification routine(s) - if (g_iThreadNotificationCount != 0) - { - for (int i = 0; i < 16; i++) - { - XTL::XTHREAD_NOTIFY_PROC pfnNotificationRoutine = (XTL::XTHREAD_NOTIFY_PROC)g_pfnThreadNotification[i]; - - // If the routine doesn't exist, don't execute it! - if (pfnNotificationRoutine == NULL) - continue; - - DbgPrintf("KRNL: Calling pfnNotificationRoutine[%d] (0x%.8X)\n", g_iThreadNotificationCount, pfnNotificationRoutine); - - pfnNotificationRoutine(TRUE); - } + if (StartSuspended == TRUE) { + SuspendThread(GetCurrentThread()); } - // use the special calling convention __try - { - // Given the non-standard calling convention (requiring - // the first argument in ebp+4) we need the below __asm. - // - // Otherwise, this call would have looked something like this : - // ((xboxkrnl::PKSYSTEM_ROUTINE)SystemRoutine)( - // (xboxkrnl::PKSTART_ROUTINE)StartRoutine, - // StartContext); - __asm - { - mov esi, SystemRoutine - push StartContext - push StartRoutine - push offset callComplete - lea ebp, [esp - 4] - jmp near esi - } - + { + auto routine = (xboxkrnl::PKSYSTEM_ROUTINE)SystemRoutine; + // Debugging notice : When the below line shows up with an Exception dialog and a + // message like: "Exception thrown at 0x00026190 in cxbx.exe: 0xC0000005: Access + // violation reading location 0xFD001804.", then this is AS-DESIGNED behaviour! + // (To avoid repetitions, uncheck "Break when this exception type is thrown"). + routine(xboxkrnl::PKSTART_ROUTINE(StartRoutine), StartContext); } __except (EmuException(GetExceptionInformation())) { - EmuWarning("Problem with ExceptionFilter!"); + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); } -callComplete: - - // This will also handle thread notification : + // This will also handle thread notification : + LOG_TEST_CASE("Thread returned from SystemRoutine"); xboxkrnl::PsTerminateSystemThread(STATUS_SUCCESS); return 0; // will never be reached } -#pragma warning(pop) // Placeholder system function, instead of XapiThreadStartup void PspSystemThreadStartup @@ -215,7 +172,7 @@ void PspSystemThreadStartup __except (EmuException(GetExceptionInformation())) // TODO : Call PspUnhandledExceptionInSystemThread(GetExceptionInformation()) { - EmuWarning("Problem with ExceptionFilter!"); // TODO : Disable? + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter!"); // TODO : Disable? } xboxkrnl::PsTerminateSystemThread(STATUS_SUCCESS); @@ -296,50 +253,70 @@ XBSYSAPI EXPORTNUM(255) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsCreateSystemThreadE // use default kernel stack size if lesser specified if (KernelStackSize < KERNEL_STACK_SIZE) - KernelStackSize = KERNEL_STACK_SIZE; + KernelStackSize = KERNEL_STACK_SIZE; + + // Double the stack size, this is to account for the overhead HLE patching adds to the stack + KernelStackSize *= 2; // round up to the next page boundary if un-aligned KernelStackSize = RoundUp(KernelStackSize, PAGE_SIZE); - static bool bFirstTime = false; - // create thread, using our special proxy technique { DWORD dwThreadId = 0, dwThreadWait; bool bWait = true; - HANDLE hStartedEvent = CreateEvent(NULL, FALSE, FALSE, TEXT("PCSTProxyEvent")); + HANDLE hStartedEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (hStartedEvent == NULL) { std::string errorMessage = CxbxGetLastErrorString("PsCreateSystemThreadEx could not create PCSTProxyEvent"); CxbxKrnlCleanup(errorMessage.c_str()); } // PCSTProxy is responsible for cleaning up this pointer - ::PCSTProxyParam *iPCSTProxyParam = new ::PCSTProxyParam(); + PCSTProxyParam *iPCSTProxyParam = (PCSTProxyParam*)malloc(sizeof(PCSTProxyParam)); - iPCSTProxyParam->StartRoutine = StartRoutine; + iPCSTProxyParam->StartRoutine = (PVOID)StartRoutine; iPCSTProxyParam->StartContext = StartContext; - iPCSTProxyParam->SystemRoutine = SystemRoutine; // NULL, XapiThreadStartup or unknown? + iPCSTProxyParam->SystemRoutine = (PVOID)SystemRoutine; // NULL, XapiThreadStartup or unknown? iPCSTProxyParam->StartSuspended = CreateSuspended; - iPCSTProxyParam->hStartedEvent = hStartedEvent; + iPCSTProxyParam->hStartedEvent = hStartedEvent; + + /* + // call thread notification routine(s) + if (g_iThreadNotificationCount != 0) + { + for (int i = 0; i < 16; i++) + { + // TODO: This is *very* wrong, ps notification routines are NOT the same as XApi notification routines + // TODO: XAPI notification routines are already handeld by XapiThreadStartup and don't need to be called by us + // TODO: This type of notification routine is PCREATE_THREAD_NOTIFY_ROUTINE, which takes an ETHREAD pointer as well as Thread ID as input + // TODO: This is impossible to support currently, as we do not create or register Xbox ETHREAD objects, so we're better to skip it entirely! + XTL::XTHREAD_NOTIFY_PROC pfnNotificationRoutine = (XTL::XTHREAD_NOTIFY_PROC)g_pfnThreadNotification[i]; - *ThreadHandle = (HANDLE)_beginthreadex(NULL, KernelStackSize, PCSTProxy, iPCSTProxyParam, NULL, (uint*)&dwThreadId); + // If the routine doesn't exist, don't execute it! + if (pfnNotificationRoutine == NULL) + continue; + + EmuLog(LOG_LEVEL::DEBUG, "Calling pfnNotificationRoutine[%d] (0x%.8X)", g_iThreadNotificationCount, pfnNotificationRoutine); + + pfnNotificationRoutine(TRUE); + } + }*/ + + *ThreadHandle = (HANDLE)_beginthreadex(NULL, KernelStackSize, PCSTProxy, iPCSTProxyParam, NULL, (unsigned int*)&dwThreadId); // Note : DO NOT use iPCSTProxyParam anymore, since ownership is transferred to the proxy (which frees it too) - // Give the thread chance to start - Sleep(100); - - EmuWarning("KRNL: Waiting for Xbox proxy thread to start...\n"); + EmuLog(LOG_LEVEL::DEBUG, "Waiting for Xbox proxy thread to start..."); while (bWait) { - dwThreadWait = WaitForSingleObject(hStartedEvent, 300); + dwThreadWait = WaitForSingleObject(hStartedEvent, INFINITE); switch (dwThreadWait) { case WAIT_TIMEOUT: { // The time-out interval elapsed, and the object's state is nonsignaled. - EmuWarning("KRNL: Timeout while waiting for Xbox proxy thread to start...\n"); + EmuLog(LOG_LEVEL::WARNING, "Timeout while waiting for Xbox proxy thread to start...\n"); bWait = false; break; } case WAIT_OBJECT_0: { // The state of the specified object is signaled. - DbgPrintf("KRNL: Xbox proxy thread is started.\n"); + EmuLog(LOG_LEVEL::DEBUG, "Xbox proxy thread is started."); bWait = false; break; } @@ -347,25 +324,29 @@ XBSYSAPI EXPORTNUM(255) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsCreateSystemThreadE if (dwThreadWait == WAIT_FAILED) // The function has failed bWait = false; - std::string ErrorStr = CxbxGetLastErrorString("KRNL: While waiting for Xbox proxy thread to start"); - EmuWarning("%s\n", ErrorStr.c_str()); + std::string ErrorStr = CxbxGetLastErrorString("While waiting for Xbox proxy thread to start"); + EmuLog(LOG_LEVEL::WARNING, "%s\n", ErrorStr.c_str()); break; } } } + // Release the event CloseHandle(hStartedEvent); hStartedEvent = NULL; // Log ThreadID identical to how GetCurrentThreadID() is rendered : - EmuWarning("KRNL: Created Xbox proxy thread. Handle : 0x%X, ThreadId : [0x%.4X]\n", *ThreadHandle, dwThreadId); + EmuLog(LOG_LEVEL::DEBUG, "Created Xbox proxy thread. Handle : 0x%X, ThreadId : [0x%.4X]", *ThreadHandle, dwThreadId); CxbxKrnlRegisterThread(*ThreadHandle); if (ThreadId != NULL) *ThreadId = (xboxkrnl::HANDLE)dwThreadId; - } + } + + SwitchToThread(); + Sleep(10); RETURN(STATUS_SUCCESS); } @@ -418,7 +399,7 @@ XBSYSAPI EXPORTNUM(257) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsSetCreateThreadNoti // that we don't accidently register the same routine twice! if (g_pfnThreadNotification[i] == NULL) { - g_pfnThreadNotification[i] = NotifyRoutine; + g_pfnThreadNotification[i] = (PVOID)NotifyRoutine; g_iThreadNotificationCount++; ret = STATUS_SUCCESS; break; @@ -440,7 +421,8 @@ XBSYSAPI EXPORTNUM(258) xboxkrnl::VOID NTAPI xboxkrnl::PsTerminateSystemThread ) { LOG_FUNC_ONE_ARG(ExitStatus); - + + /* // call thread notification routine(s) if (g_iThreadNotificationCount != 0) { @@ -452,11 +434,11 @@ XBSYSAPI EXPORTNUM(258) xboxkrnl::VOID NTAPI xboxkrnl::PsTerminateSystemThread if (pfnNotificationRoutine == NULL) continue; - DbgPrintf("KRNL: Calling pfnNotificationRoutine[%d] (0x%.8X)\n", g_iThreadNotificationCount, pfnNotificationRoutine); + EmuLog(LOG_LEVEL::DEBUG, "Calling pfnNotificationRoutine[%d] (0x%.8X)", g_iThreadNotificationCount, pfnNotificationRoutine); pfnNotificationRoutine(FALSE); } - } + }*/ _endthreadex(ExitStatus); // ExitThread(ExitStatus); diff --git a/src/CxbxKrnl/EmuKrnlRtl.cpp b/src/core/kernel/exports/EmuKrnlRtl.cpp similarity index 90% rename from src/CxbxKrnl/EmuKrnlRtl.cpp rename to src/core/kernel/exports/EmuKrnlRtl.cpp index 94a367878..a0bf86782 100644 --- a/src/CxbxKrnl/EmuKrnlRtl.cpp +++ b/src/core/kernel/exports/EmuKrnlRtl.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlRtl.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::RTL #define CHECK_ALIGNMENT(size, alignment) (((size) % (alignment)) == 0) // For RtlFillMemoryUlong // prevent name collisions @@ -51,11 +41,11 @@ namespace xboxkrnl // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" + #include "core\kernel\support\EmuNtDll.h" }; -#include "CxbxKrnl.h" // For CxbxKrnlCleanup() -#include "Emu.h" // For EmuWarning() +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup() +#include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) #include #ifdef _WIN32 @@ -63,86 +53,29 @@ namespace NtDll // Prevent errors compiling #undef RtlFillMemory #undef RtlMoveMemory -#undef RtlZeroMemory +#undef RtlZeroMemory +#undef EXCEPTION_NONCONTINUABLE +#undef EXCEPTION_UNWINDING +#undef EXCEPTION_EXIT_UNWIND +#undef EXCEPTION_STACK_INVALID +#undef EXCEPTION_NESTED_CALL +#undef EXCEPTION_TARGET_UNWIND +#undef EXCEPTION_COLLIDED_UNWIND +#undef EXCEPTION_UNWIND -#include // For critical section map -#include // For native CriticalSections - -static std::map critical_sections; - -static void add_critical_section( - xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section, - CRITICAL_SECTION host_crit_section -) -{ - // Key not found - if(critical_sections.find(xbox_crit_section) == critical_sections.end()) { - critical_sections[xbox_crit_section] = host_crit_section; - } - else { - DbgPrintf("Critical Section key %p already exists\n", xbox_crit_section); - } -} - -static CRITICAL_SECTION* find_critical_section( - xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section -) -{ - // Key found - if(critical_sections.find(xbox_crit_section) != critical_sections.end()) { - return &critical_sections[xbox_crit_section]; - } - - return NULL; -} - -static void InitHostCriticalSection(xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section) -{ - CRITICAL_SECTION host_crit_section; - InitializeCriticalSection(&host_crit_section); - add_critical_section(xbox_crit_section, host_crit_section); - //Initalize the host event for the critical section - KeInitializeEvent((xboxkrnl::PRKEVENT)xbox_crit_section, (xboxkrnl::EVENT_TYPE)xboxkrnl::NotificationEvent, FALSE); -} - -static void EnterHostCriticalSection(xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section) -{ - // This is required because it is possible for a game to create a critical - // section without calling RtlInitializeCriticalSection, which means that - // there is no host critical section. This hack allows us to create the - // missing critical section. The real Xbox RtlEnterCriticalSection function - // does not create a critical section if it does not exist. - CRITICAL_SECTION* host_crit_section = find_critical_section(xbox_crit_section); - if(host_crit_section == NULL) { - InitHostCriticalSection(xbox_crit_section); - host_crit_section = find_critical_section(xbox_crit_section); - } - - EnterCriticalSection(host_crit_section); -} - -static void LeaveHostCriticalSection(xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section) -{ - LeaveCriticalSection(find_critical_section(xbox_crit_section)); -} - -static BOOL TryEnterHostCriticalSection(xboxkrnl::PRTL_CRITICAL_SECTION xbox_crit_section) -{ - // This is required because it is possible for a game to create a critical - // section without calling RtlInitializeCriticalSection, which means that - // there is no host critical section. This hack allows us to create the - // missing critical section. The real Xbox RtlEnterCriticalSection function - // does not create a critical section if it does not exist. - CRITICAL_SECTION* host_crit_section = find_critical_section(xbox_crit_section); - if(host_crit_section == NULL) { - InitHostCriticalSection(xbox_crit_section); - host_crit_section = find_critical_section(xbox_crit_section); - } - - return TryEnterCriticalSection(host_crit_section); -} - -#endif // _WIN32 +#endif // _WIN32 + +// Exception record flags +// Source: ReactOS +// NOTE: don't put these in xboxkrnl.h, they will conflict with the macros provided by Windows +#define EXCEPTION_NONCONTINUABLE 0x01 +#define EXCEPTION_UNWINDING 0x02 +#define EXCEPTION_EXIT_UNWIND 0x04 +#define EXCEPTION_STACK_INVALID 0x08 +#define EXCEPTION_NESTED_CALL 0x10 +#define EXCEPTION_TARGET_UNWIND 0x20 +#define EXCEPTION_COLLIDED_UNWIND 0x40 +#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND | EXCEPTION_TARGET_UNWIND | EXCEPTION_COLLIDED_UNWIND) DWORD WINAPI RtlAnsiStringToUnicodeSize(const xboxkrnl::STRING *str) { @@ -246,9 +179,8 @@ XBSYSAPI EXPORTNUM(262) xboxkrnl::NTSTATUS NTAPI xboxkrnl::RtlAppendUnicodeStrin result = STATUS_BUFFER_TOO_SMALL; } else { - CHAR *dstBuf = (CHAR*)(Destination->Buffer + (Destination->Length / sizeof(WCHAR))); - CHAR *srcBuf = (CHAR*)(Source->Buffer); - memmove(dstBuf, srcBuf, srcLen); + WCHAR *dstBuf = (WCHAR*)(Destination->Buffer + (Destination->Length / sizeof(WCHAR))); + memmove(dstBuf, Source->Buffer, srcLen); Destination->Length += srcLen; if (Destination->Length < Destination->MaximumLength) { dstBuf[srcLen / sizeof(WCHAR)] = UNICODE_NULL; @@ -301,24 +233,55 @@ XBSYSAPI EXPORTNUM(264) xboxkrnl::VOID NTAPI xboxkrnl::RtlAssert LOG_FUNC_ARG(FileName) LOG_FUNC_ARG(LineNumber) LOG_FUNC_ARG(Message) - LOG_FUNC_END; - - CxbxPopupMessage(CxbxMsgDlgIcon_Warn, "RtlAssert() raised by emulated program - consult Debug log"); + LOG_FUNC_END; + + std::stringstream ss; + ss << "RtlAssert() raised by emulated program\n" << FileName << ":" << LineNumber << ":" << FailedAssertion ; + if (Message) { + ss << " " << Message; + } + + ss << ")"; + + CxbxPopupMessage(LOG_LEVEL::WARNING, CxbxMsgDlgIcon_Warn, ss.str().c_str()); } // ****************************************************************** // * 0x0109 - RtlCaptureContext() // ****************************************************************** +__declspec(naked) // REQUIRED - No registers can be touched by the compiler or the state will be corrupted. XBSYSAPI EXPORTNUM(265) xboxkrnl::VOID NTAPI xboxkrnl::RtlCaptureContext ( IN PCONTEXT ContextRecord ) { - LOG_FUNC_ONE_ARG(ContextRecord); - // NOTE: this function expects the caller to be __cdecl, or else it fails + __asm { + push ebx + mov ebx, [esp + 8] // ebx = ContextRecord; - LOG_UNIMPLEMENTED(); + mov [ebx + CONTEXT.Eax], eax // ContextRecord->Eax = eax; + mov eax, [esp] // eax = original value of ebx + mov [ebx + CONTEXT.Ebx], eax // ContextRecord->Ebx = original value of ebx + mov [ebx + CONTEXT.Ecx], ecx // ContextRecord->Ecx = ecx; + mov [ebx + CONTEXT.Edx], edx // ContextRecord->Edx = edx; + mov [ebx + CONTEXT.Esi], esi // ContextRecord->Esi = esi; + mov [ebx + CONTEXT.Edi], edi // ContextRecord->Edi = edi; + + mov word ptr [ebx + CONTEXT.SegCs], cs // ContextRecord->SegCs = cs; + mov word ptr [ebx + CONTEXT.SegSs], ss // ContextRecord->SegSs = ss; + pushfd + pop [ebx + CONTEXT.EFlags] // ContextRecord->EFlags = flags; + + mov[ebx + CONTEXT.Ebp], ebp // ContextRecord->Ebp = ebp; + mov eax, [ebp + 4] // eax = return address; + mov [ebx + CONTEXT.Eip], eax // ContextRecord->Eip = return address; + lea eax, [ebp + 8] + mov [ebx + CONTEXT.Esp], eax // ContextRecord->Esp = original esp value; + + pop ebx + ret 4 + } } // ****************************************************************** @@ -732,18 +695,20 @@ XBSYSAPI EXPORTNUM(277) xboxkrnl::VOID NTAPI xboxkrnl::RtlEnterCriticalSection } else { if(CriticalSection->OwningThread != thread) { - NTSTATUS result; - result = KeWaitForSingleObject( - (PVOID)CriticalSection, - (KWAIT_REASON)0, - (KPROCESSOR_MODE)0, - (BOOLEAN)0, - (PLARGE_INTEGER)0 - ); - if(!NT_SUCCESS(result)) - { - CxbxKrnlCleanup("Waiting for event of a critical section returned %lx.", result); - }; + if (CriticalSection->OwningThread != nullptr) { + NTSTATUS result; + result = KeWaitForSingleObject( + (PVOID)CriticalSection, + (KWAIT_REASON)0, + (KPROCESSOR_MODE)0, + (BOOLEAN)0, + (PLARGE_INTEGER)0 + ); + if (!NT_SUCCESS(result)) + { + CxbxKrnlCleanup("Waiting for event of a critical section returned %lx.", result); + }; + } CriticalSection->OwningThread = thread; CriticalSection->RecursionCount = 1; } @@ -751,8 +716,6 @@ XBSYSAPI EXPORTNUM(277) xboxkrnl::VOID NTAPI xboxkrnl::RtlEnterCriticalSection CriticalSection->RecursionCount++; } } - - EnterHostCriticalSection(CriticalSection); } // ****************************************************************** @@ -902,9 +865,9 @@ XBSYSAPI EXPORTNUM(281) xboxkrnl::LARGE_INTEGER NTAPI xboxkrnl::RtlExtendedInteg // ****************************************************************** XBSYSAPI EXPORTNUM(282) xboxkrnl::LARGE_INTEGER NTAPI xboxkrnl::RtlExtendedLargeIntegerDivide ( - IN LARGE_INTEGER Dividend, - IN ULONG Divisor, - IN PULONG Remainder // OUT? OPTIONAL? + IN LARGE_INTEGER Dividend, + IN ULONG Divisor, + IN OUT PULONG Remainder OPTIONAL ) { LOG_FUNC_BEGIN @@ -913,14 +876,32 @@ XBSYSAPI EXPORTNUM(282) xboxkrnl::LARGE_INTEGER NTAPI xboxkrnl::RtlExtendedLarge LOG_FUNC_ARG(Remainder) LOG_FUNC_END; - LARGE_INTEGER ret; + LARGE_INTEGER quotient = Dividend; - if (Remainder) - *Remainder = (ULONG)(Dividend.QuadPart % Divisor); + if (Divisor == 0) { + RtlRaiseStatus(STATUS_INTEGER_DIVIDE_BY_ZERO); + } + else { + ULONG local_remainder = 0; + BOOLEAN carry, remainder_carry; - ret.QuadPart = Dividend.QuadPart / (LONGLONG)Divisor; + // Binary division algorithm reverse engineered from real hardware. + for (uint8_t i = 64; i > 0; i--) { + carry = (quotient.QuadPart >> 63) & 0x1; + remainder_carry = (local_remainder >> 31) & 0x1; + quotient.QuadPart <<= 1; + local_remainder = (local_remainder << 1) | carry; + if (remainder_carry || (local_remainder >= Divisor)) { + quotient.u.LowPart += 1; + local_remainder -= Divisor; + } + } + if (Remainder) { + *Remainder = local_remainder; + } + } - RETURN(ret); + RETURN(quotient); } #define LOWER_32(A) ((A) & 0xffffffff) @@ -1143,17 +1124,10 @@ XBSYSAPI EXPORTNUM(291) xboxkrnl::VOID NTAPI xboxkrnl::RtlInitializeCriticalSect { LOG_FUNC_ONE_ARG(CriticalSection); - CriticalSection->LockCount = -1; - // Sets byte 0 = 1, and byte 2 = 4 of Unknown[0] for some reason - CriticalSection->Unknown[0] = (CriticalSection->Unknown[0] & ~0xFF) | 0x1; - CriticalSection->Unknown[0] = (CriticalSection->Unknown[0] & ~0xFF0000) | 0x40000; - CriticalSection->Unknown[1] = 0; - CriticalSection->Unknown[3] = (DWORD)&CriticalSection->Unknown[2]; - CriticalSection->Unknown[2] = (DWORD)&CriticalSection->Unknown[2]; + KeInitializeEvent((PRKEVENT)&CriticalSection->Event, SynchronizationEvent, FALSE); + CriticalSection->LockCount = -1; CriticalSection->RecursionCount = 0; CriticalSection->OwningThread = 0; - - InitHostCriticalSection(CriticalSection); } // ****************************************************************** @@ -1265,8 +1239,6 @@ XBSYSAPI EXPORTNUM(294) xboxkrnl::VOID NTAPI xboxkrnl::RtlLeaveCriticalSection KeSetEvent((PRKEVENT)CriticalSection, (KPRIORITY)1, (BOOLEAN)0); } } - - LeaveHostCriticalSection(CriticalSection); } // ****************************************************************** @@ -1280,7 +1252,10 @@ XBSYSAPI EXPORTNUM(295) xboxkrnl::VOID NTAPI xboxkrnl::RtlLeaveCriticalSectionAn LOG_FUNC_ONE_ARG(CriticalSection); RtlLeaveCriticalSection(CriticalSection); - KeLeaveCriticalRegion(); + + if (CriticalSection->RecursionCount == 0) { + KeLeaveCriticalRegion(); + } } // ****************************************************************** @@ -1470,7 +1445,7 @@ XBSYSAPI EXPORTNUM(301) xboxkrnl::ULONG NTAPI xboxkrnl::RtlNtStatusToDosError return LOWORD(Status); no_mapping: - DbgPrintf("no mapping for %08x\n", Status); + EmuLog(LOG_LEVEL::DEBUG, "no mapping for %08x", Status); ret = ERROR_MR_MID_NOT_FOUND; */ RETURN(ret); @@ -1531,7 +1506,13 @@ XBSYSAPI EXPORTNUM(303) xboxkrnl::VOID NTAPI xboxkrnl::RtlRaiseStatus { LOG_FUNC_ONE_ARG(Status); - LOG_UNIMPLEMENTED(); + EXCEPTION_RECORD record; + record.ExceptionCode = Status; + record.ExceptionFlags = EXCEPTION_NONCONTINUABLE; + record.ExceptionRecord = NULL; + record.NumberParameters = 0; + + RtlRaiseException(&record); } // ****************************************************************** @@ -1683,8 +1664,7 @@ XBSYSAPI EXPORTNUM(306) xboxkrnl::BOOLEAN NTAPI xboxkrnl::RtlTryEnterCriticalSec } } - // Return the host value until the xbox kernel is fully implemented - RETURN(TryEnterHostCriticalSection(CriticalSection)); + RETURN(ret); } // ****************************************************************** @@ -2154,6 +2134,6 @@ XBSYSAPI EXPORTNUM(352) xboxkrnl::VOID NTAPI xboxkrnl::RtlRip LOG_FUNC_ARG(Message) LOG_FUNC_END; - EmuWarning("RtlRip@%s:\n\nASSERT FAILED:\n%s\n\nDescription:\n%s", + EmuLog(LOG_LEVEL::WARNING, "RtlRip@%s:\n\nASSERT FAILED:\n%s\n\nDescription:\n%s", ApiName, Expression, Message); } diff --git a/src/CxbxKrnl/EmuKrnlXbox.cpp b/src/core/kernel/exports/EmuKrnlXbox.cpp similarity index 90% rename from src/CxbxKrnl/EmuKrnlXbox.cpp rename to src/core/kernel/exports/EmuKrnlXbox.cpp index e9e33fafb..3dc83576f 100644 --- a/src/CxbxKrnl/EmuKrnlXbox.cpp +++ b/src/core/kernel/exports/EmuKrnlXbox.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlXbox.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,15 +25,16 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::XBOX // prevent name collisions namespace xboxkrnl { #include // For XboxEEPROMKey, etc. -}; +}; + +#include "Logging.h" // Certificate Key // Not exported but used to generate per-title keys @@ -102,4 +94,3 @@ XBSYSAPI EXPORTNUM(353) xboxkrnl::XBOX_KEY_DATA xboxkrnl::XboxLANKey = { 0 }; // ****************************************************************** XBSYSAPI EXPORTNUM(354) xboxkrnl::XBOX_KEY_DATA xboxkrnl::XboxAlternateSignatureKeys[ALTERNATE_SIGNATURE_COUNT] = { 0 }; - \ No newline at end of file diff --git a/src/CxbxKrnl/EmuKrnlXc.cpp b/src/core/kernel/exports/EmuKrnlXc.cpp similarity index 56% rename from src/CxbxKrnl/EmuKrnlXc.cpp rename to src/core/kernel/exports/EmuKrnlXc.cpp index 925b2ba25..c1d16b3ec 100644 --- a/src/CxbxKrnl/EmuKrnlXc.cpp +++ b/src/core/kernel/exports/EmuKrnlXc.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlXc.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -29,14 +20,15 @@ // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * // * (c) 2002-2003 Aaron Robinson -// * (c) 2016 Patrick van Logchem +// * (c) 2016 Patrick van Logchem +// * (c) 2019 Jannik Vogel +// * (c) 2018-2019 ergo720 // * // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::XC // prevent name collisions namespace xboxkrnl @@ -46,130 +38,82 @@ namespace xboxkrnl #include "Logging.h" // For LOG_FUNC() #include "EmuKrnlLogging.h" -#include "EmuSha.h" // For A_SHAInit, etc. -#include "LibRc4.h" // For RC4 Functions +#include "common\crypto\EmuSha.h" // For A_SHAInit, etc. +#include "common\crypto\LibRc4.h" // For RC4 Functions +#include "common\crypto\EmuDes.h" // For DES Functions +#include "common\crypto\EmuRSA.h" // For RSA Functions // prevent name collisions namespace NtDll { - #include "EmuNtDll.h" + #include "core\kernel\support\EmuNtDll.h" }; + -// ****************************************************************** -// * 0x014F - XcSHAInit() -// ****************************************************************** -XBSYSAPI EXPORTNUM(335) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAInit +// The following are the default implementations of the crypto functions + +xboxkrnl::VOID NTAPI JumpedSHAInit ( - IN PUCHAR pbSHAContext + xboxkrnl::PUCHAR pbSHAContext ) { - LOG_FUNC_ONE_ARG_TYPE(PBYTE, pbSHAContext); - - // The sha1 context supplied by this function has an extra 24 bytes at the beginning which are unsed by our implementation, + // The sha1 context supplied to this function has an extra 24 bytes at the beginning which are unsed by our implementation, // so we skip them. The same is true for XcSHAUpdate and XcSHAFinal SHA1Init((SHA1_CTX*)(pbSHAContext + 24)); } -// ****************************************************************** -// * 0x0150 - XcSHAUpdate() -// ****************************************************************** -XBSYSAPI EXPORTNUM(336) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAUpdate +xboxkrnl::VOID NTAPI JumpedSHAUpdate ( - PUCHAR pbSHAContext, - PUCHAR pbInput, - ULONG dwInputLength + xboxkrnl::PUCHAR pbSHAContext, + xboxkrnl::PUCHAR pbInput, + xboxkrnl::ULONG dwInputLength ) { - LOG_FUNC_BEGIN - LOG_FUNC_ARG_OUT(pbSHAContext) - LOG_FUNC_ARG_OUT(pbInput) - LOG_FUNC_ARG(dwInputLength) - LOG_FUNC_END; - SHA1Update((SHA1_CTX*)(pbSHAContext + 24), pbInput, dwInputLength); } -// ****************************************************************** -// * 0x0151 - XcSHAFinal() -// ****************************************************************** -XBSYSAPI EXPORTNUM(337) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAFinal +xboxkrnl::VOID NTAPI JumpedSHAFinal ( - IN PUCHAR pbSHAContext, - IN PUCHAR pbDigest + xboxkrnl::PUCHAR pbSHAContext, + xboxkrnl::PUCHAR pbDigest ) { - LOG_FUNC_BEGIN - LOG_FUNC_ARG_TYPE(PBYTE, pbSHAContext) - LOG_FUNC_ARG_TYPE(PBYTE, pbDigest) - LOG_FUNC_END; - SHA1Final(pbDigest, (SHA1_CTX*)(pbSHAContext + 24)); } -// ****************************************************************** -// * 0x0152 - XcRC4Key() -// ****************************************************************** -XBSYSAPI EXPORTNUM(338) xboxkrnl::VOID NTAPI xboxkrnl::XcRC4Key +xboxkrnl::VOID NTAPI JumpedRC4Key ( - IN PUCHAR pbKeyStruct, - IN ULONG dwKeyLength, - IN PUCHAR pbKey + xboxkrnl::PUCHAR pbKeyStruct, + xboxkrnl::ULONG dwKeyLength, + xboxkrnl::PUCHAR pbKey ) { - LOG_FUNC_BEGIN - LOG_FUNC_ARG_TYPE(PBYTE, pbKeyStruct) - LOG_FUNC_ARG(dwKeyLength) - LOG_FUNC_ARG_TYPE(PBYTE, pbKey) - LOG_FUNC_END; - Rc4Initialise((Rc4Context*)pbKeyStruct, pbKey, dwKeyLength, 0); } -// ****************************************************************** -// * 0x0153 - XcRC4Crypt -// ****************************************************************** -XBSYSAPI EXPORTNUM(339) xboxkrnl::VOID NTAPI xboxkrnl::XcRC4Crypt +xboxkrnl::VOID NTAPI JumpedRC4Crypt ( - IN PUCHAR pbKeyStruct, - IN ULONG dwInputLength, - IN PUCHAR pbInput + xboxkrnl::PUCHAR pbKeyStruct, + xboxkrnl::ULONG dwInputLength, + xboxkrnl::PUCHAR pbInput ) { - LOG_FUNC_BEGIN - LOG_FUNC_ARG_TYPE(PBYTE, pbKeyStruct) - LOG_FUNC_ARG(dwInputLength) - LOG_FUNC_ARG_TYPE(PBYTE, pbInput) - LOG_FUNC_END; - Rc4Xor((Rc4Context*)pbKeyStruct, pbInput, pbInput, dwInputLength); } -// ****************************************************************** -// * 0x0154 - XcHMAC() -// ****************************************************************** -XBSYSAPI EXPORTNUM(340) xboxkrnl::VOID NTAPI xboxkrnl::XcHMAC +xboxkrnl::VOID NTAPI JumpedHMAC ( - IN PBYTE pbKeyMaterial, - IN ULONG cbKeyMaterial, - IN PBYTE pbData, - IN ULONG cbData, - IN PBYTE pbData2, - IN ULONG cbData2, - OUT PBYTE HmacData + xboxkrnl::PBYTE pbKeyMaterial, + xboxkrnl::ULONG cbKeyMaterial, + xboxkrnl::PBYTE pbData, + xboxkrnl::ULONG cbData, + xboxkrnl::PBYTE pbData2, + xboxkrnl::ULONG cbData2, + xboxkrnl::PBYTE HmacData ) { - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pbKeyMaterial) - LOG_FUNC_ARG(cbKeyMaterial) - LOG_FUNC_ARG(pbData) - LOG_FUNC_ARG(cbData) - LOG_FUNC_ARG(pbData2) - LOG_FUNC_ARG(cbData2) - LOG_FUNC_ARG_OUT(HmacData) - LOG_FUNC_END; - - if (cbKeyMaterial > 64) { + if (cbKeyMaterial > 64) { cbKeyMaterial = 64; } @@ -199,7 +143,7 @@ XBSYSAPI EXPORTNUM(340) xboxkrnl::VOID NTAPI xboxkrnl::XcHMAC } BYTE Temp[64 + A_SHA_DIGEST_LEN]; - SHA1Final(Temp + 64 , &ShaContext); + SHA1Final(Temp + 64, &ShaContext); RtlCopyMemory(Temp, Pad2, 64); SHA1Init(&ShaContext); @@ -207,6 +151,383 @@ XBSYSAPI EXPORTNUM(340) xboxkrnl::VOID NTAPI xboxkrnl::XcHMAC SHA1Final(HmacData, &ShaContext); } +xboxkrnl::ULONG NTAPI JumpedPKEncPublic +( + xboxkrnl::PUCHAR pbPubKey, + xboxkrnl::PUCHAR pbInput, + xboxkrnl::PUCHAR pbOutput +) +{ + ULONG ret = 0; + + LOG_UNIMPLEMENTED(); + + return ret; +} + +xboxkrnl::ULONG NTAPI JumpedPKDecPrivate +( + xboxkrnl::PUCHAR pbPrvKey, + xboxkrnl::PUCHAR pbInput, + xboxkrnl::PUCHAR pbOutput +) +{ + ULONG ret = 0; + + LOG_UNIMPLEMENTED(); + + return ret; +} + +xboxkrnl::ULONG NTAPI JumpedPKGetKeyLen +( + xboxkrnl::PUCHAR pbPubKey +) +{ + ULONG ret = 0; + + LOG_UNIMPLEMENTED(); + + return ret; +} + +xboxkrnl::BOOLEAN NTAPI JumpedVerifyPKCS1Signature +( + xboxkrnl::PUCHAR pbSig, + xboxkrnl::PUCHAR pbPubKey, + xboxkrnl::PUCHAR pbDigest +) +{ + BOOLEAN ret = TRUE; + + LOG_UNIMPLEMENTED(); + + return ret; +} + +xboxkrnl::ULONG NTAPI JumpedModExp +( + xboxkrnl::LPDWORD pA, + xboxkrnl::LPDWORD pB, + xboxkrnl::LPDWORD pC, + xboxkrnl::LPDWORD pD, + xboxkrnl::ULONG dwN +) +{ + unsigned int len = dwN * 4; + if (xbox_exp_mod((unsigned char*)pA, (const unsigned char*)pB, (const unsigned char*)pC, (const unsigned char*)pD, len, len, len, len)) { + return 1; + } + + return 0; +} + +xboxkrnl::VOID NTAPI JumpedDESKeyParity +( + xboxkrnl::PUCHAR pbKey, + xboxkrnl::ULONG dwKeyLength +) +{ + mbedtls_des_key_set_parity(pbKey, dwKeyLength); +} + +xboxkrnl::VOID NTAPI JumpedKeyTable +( + xboxkrnl::ULONG dwCipher, + xboxkrnl::PUCHAR pbKeyTable, + xboxkrnl::PUCHAR pbKey +) +{ + if (dwCipher) { + mbedtls_des3_set3key_enc((mbedtls_des3_context*)pbKeyTable, pbKey); + } + else { + mbedtls_des_setkey_enc((mbedtls_des_context*)pbKeyTable, pbKey); + } +} + +xboxkrnl::VOID NTAPI JumpedBlockCrypt +( + xboxkrnl::ULONG dwCipher, + xboxkrnl::PUCHAR pbOutput, + xboxkrnl::PUCHAR pbInput, + xboxkrnl::PUCHAR pbKeyTable, + xboxkrnl::ULONG dwOp +) +{ + if (dwCipher) { + mbedtls_des3_crypt_ecb((mbedtls_des3_context*)pbKeyTable, pbInput, pbOutput, dwOp); + } + else { + mbedtls_des_crypt_ecb((mbedtls_des_context*)pbKeyTable, pbInput, pbOutput, dwOp); + } +} + +xboxkrnl::VOID NTAPI JumpedBlockCryptCBC +( + xboxkrnl::ULONG dwCipher, + xboxkrnl::ULONG dwInputLength, + xboxkrnl::PUCHAR pbOutput, + xboxkrnl::PUCHAR pbInput, + xboxkrnl::PUCHAR pbKeyTable, + xboxkrnl::ULONG dwOp, + xboxkrnl::PUCHAR pbFeedback +) +{ + int ret; + + if (dwCipher) { + ret = mbedtls_des3_crypt_cbc((mbedtls_des3_context*)pbKeyTable, dwOp, dwInputLength, pbFeedback, pbInput, pbOutput); + } + else { + ret = mbedtls_des_crypt_cbc((mbedtls_des_context*)pbKeyTable, dwOp, dwInputLength, pbFeedback, pbInput, pbOutput); + } + + if (ret == MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH) { + EmuLog(LOG_LEVEL::DEBUG, "%s: dwInputLength was not a multiple of 8 (it was %lu)", __func__, dwInputLength); + } +} + +xboxkrnl::ULONG NTAPI JumpedCryptService +( + xboxkrnl::ULONG dwOp, + xboxkrnl::PVOID pArgs +) +{ + // This seems to be a dummy function. It just returns zero regardless of the input arguments, which are left unchanged. + + return 0; +} + +/* This struct contains the original crypto functions exposed by the kernel */ +const xboxkrnl::CRYPTO_VECTOR DefaultCryptoStruct = +{ + JumpedSHAInit, + JumpedSHAUpdate, + JumpedSHAFinal, + JumpedRC4Key, + JumpedRC4Crypt, + JumpedHMAC, + JumpedPKEncPublic, + JumpedPKDecPrivate, + JumpedPKGetKeyLen, + JumpedVerifyPKCS1Signature, + JumpedModExp, + JumpedDESKeyParity, + JumpedKeyTable, + JumpedBlockCrypt, + JumpedBlockCryptCBC, + JumpedCryptService +}; + +/* This struct contains the updated crypto functions which can be changed by the title with XcUpdateCrypto */ +xboxkrnl::CRYPTO_VECTOR UpdatedCryptoStruct = DefaultCryptoStruct; + +// ****************************************************************** +// * 0x015F - XcUpdateCrypto() +// ****************************************************************** +XBSYSAPI EXPORTNUM(351) xboxkrnl::VOID NTAPI xboxkrnl::XcUpdateCrypto +( + IN PCRYPTO_VECTOR pNewVector, + OUT PCRYPTO_VECTOR pROMVector OPTIONAL +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pNewVector) + LOG_FUNC_ARG_OUT(pROMVector) + LOG_FUNC_END; + + // This function changes the default crypto function implementations with those supplied by the title (if not NULL) + + if (pNewVector->pXcSHAInit) + { + UpdatedCryptoStruct.pXcSHAInit = pNewVector->pXcSHAInit; + } + if (pNewVector->pXcSHAUpdate) + { + UpdatedCryptoStruct.pXcSHAUpdate = pNewVector->pXcSHAUpdate; + } + if (pNewVector->pXcSHAFinal) + { + UpdatedCryptoStruct.pXcSHAFinal = pNewVector->pXcSHAFinal; + } + if (pNewVector->pXcRC4Key) + { + UpdatedCryptoStruct.pXcRC4Key = pNewVector->pXcRC4Key; + } + if (pNewVector->pXcRC4Crypt) + { + UpdatedCryptoStruct.pXcRC4Crypt = pNewVector->pXcRC4Crypt; + } + if (pNewVector->pXcHMAC) + { + UpdatedCryptoStruct.pXcHMAC = pNewVector->pXcHMAC; + } + if (pNewVector->pXcPKEncPublic) + { + UpdatedCryptoStruct.pXcPKEncPublic = pNewVector->pXcPKEncPublic; + } + if (pNewVector->pXcPKDecPrivate) + { + UpdatedCryptoStruct.pXcPKDecPrivate = pNewVector->pXcPKDecPrivate; + } + if (pNewVector->pXcPKGetKeyLen) + { + UpdatedCryptoStruct.pXcPKGetKeyLen = pNewVector->pXcPKGetKeyLen; + } + if (pNewVector->pXcVerifyPKCS1Signature) + { + UpdatedCryptoStruct.pXcVerifyPKCS1Signature = pNewVector->pXcVerifyPKCS1Signature; + } + if (pNewVector->pXcModExp) + { + UpdatedCryptoStruct.pXcModExp = pNewVector->pXcModExp; + } + if (pNewVector->pXcDESKeyParity) + { + UpdatedCryptoStruct.pXcDESKeyParity = pNewVector->pXcDESKeyParity; + } + if (pNewVector->pXcKeyTable) + { + UpdatedCryptoStruct.pXcKeyTable = pNewVector->pXcKeyTable; + } + if (pNewVector->pXcBlockCrypt) + { + UpdatedCryptoStruct.pXcBlockCrypt = pNewVector->pXcBlockCrypt; + } + if (pNewVector->pXcBlockCryptCBC) + { + UpdatedCryptoStruct.pXcBlockCryptCBC = pNewVector->pXcBlockCryptCBC; + } + if (pNewVector->pXcCryptService) + { + UpdatedCryptoStruct.pXcCryptService = pNewVector->pXcCryptService; + } + + // Return to the title the original implementations if it supplied an out buffer + + if (pROMVector) + { + *pROMVector = DefaultCryptoStruct; + } +} + +// The following functions simply jump to the corresponding registered crypto functions + +// ****************************************************************** +// * 0x014F - XcSHAInit() +// ****************************************************************** +XBSYSAPI EXPORTNUM(335) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAInit +( + IN PUCHAR pbSHAContext +) +{ + LOG_FUNC_ONE_ARG_TYPE(PBYTE, pbSHAContext); + + UpdatedCryptoStruct.pXcSHAInit(pbSHAContext); +} + +// ****************************************************************** +// * 0x0150 - XcSHAUpdate() +// ****************************************************************** +XBSYSAPI EXPORTNUM(336) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAUpdate +( + PUCHAR pbSHAContext, + PUCHAR pbInput, + ULONG dwInputLength +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG_OUT(pbSHAContext) + LOG_FUNC_ARG_OUT(pbInput) + LOG_FUNC_ARG(dwInputLength) + LOG_FUNC_END; + + UpdatedCryptoStruct.pXcSHAUpdate(pbSHAContext, pbInput, dwInputLength); +} + +// ****************************************************************** +// * 0x0151 - XcSHAFinal() +// ****************************************************************** +XBSYSAPI EXPORTNUM(337) xboxkrnl::VOID NTAPI xboxkrnl::XcSHAFinal +( + IN PUCHAR pbSHAContext, + IN PUCHAR pbDigest +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG_TYPE(PBYTE, pbSHAContext) + LOG_FUNC_ARG_TYPE(PBYTE, pbDigest) + LOG_FUNC_END; + + UpdatedCryptoStruct.pXcSHAFinal(pbSHAContext, pbDigest); +} + +// ****************************************************************** +// * 0x0152 - XcRC4Key() +// ****************************************************************** +XBSYSAPI EXPORTNUM(338) xboxkrnl::VOID NTAPI xboxkrnl::XcRC4Key +( + IN PUCHAR pbKeyStruct, + IN ULONG dwKeyLength, + IN PUCHAR pbKey +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG_TYPE(PBYTE, pbKeyStruct) + LOG_FUNC_ARG(dwKeyLength) + LOG_FUNC_ARG_TYPE(PBYTE, pbKey) + LOG_FUNC_END; + + UpdatedCryptoStruct.pXcRC4Key(pbKeyStruct, dwKeyLength, pbKey); +} + +// ****************************************************************** +// * 0x0153 - XcRC4Crypt +// ****************************************************************** +XBSYSAPI EXPORTNUM(339) xboxkrnl::VOID NTAPI xboxkrnl::XcRC4Crypt +( + IN PUCHAR pbKeyStruct, + IN ULONG dwInputLength, + IN PUCHAR pbInput +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG_TYPE(PBYTE, pbKeyStruct) + LOG_FUNC_ARG(dwInputLength) + LOG_FUNC_ARG_TYPE(PBYTE, pbInput) + LOG_FUNC_END; + + UpdatedCryptoStruct.pXcRC4Crypt(pbKeyStruct, dwInputLength, pbInput); +} + +// ****************************************************************** +// * 0x0154 - XcHMAC() +// ****************************************************************** +XBSYSAPI EXPORTNUM(340) xboxkrnl::VOID NTAPI xboxkrnl::XcHMAC +( + IN PBYTE pbKeyMaterial, + IN ULONG cbKeyMaterial, + IN PBYTE pbData, + IN ULONG cbData, + IN PBYTE pbData2, + IN ULONG cbData2, + OUT PBYTE HmacData +) +{ + LOG_FUNC_BEGIN + LOG_FUNC_ARG(pbKeyMaterial) + LOG_FUNC_ARG(cbKeyMaterial) + LOG_FUNC_ARG(pbData) + LOG_FUNC_ARG(cbData) + LOG_FUNC_ARG(pbData2) + LOG_FUNC_ARG(cbData2) + LOG_FUNC_ARG_OUT(HmacData) + LOG_FUNC_END; + + UpdatedCryptoStruct.pXcHMAC(pbKeyMaterial, cbKeyMaterial, pbData, cbData, pbData2, cbData2, HmacData); +} + // ****************************************************************** // * 0x0155 - XcPKEncPublic() // ****************************************************************** @@ -221,11 +542,9 @@ XBSYSAPI EXPORTNUM(341) xboxkrnl::ULONG NTAPI xboxkrnl::XcPKEncPublic LOG_FUNC_ARG_TYPE(PBYTE, pbPubKey) LOG_FUNC_ARG_TYPE(PBYTE, pbInput) LOG_FUNC_ARG_OUT(pbOutput) - LOG_FUNC_END; + LOG_FUNC_END; - ULONG ret = 0; - - LOG_UNIMPLEMENTED(); + ULONG ret = UpdatedCryptoStruct.pXcPKEncPublic(pbPubKey, pbInput, pbOutput); RETURN(ret); } @@ -244,11 +563,9 @@ XBSYSAPI EXPORTNUM(342) xboxkrnl::ULONG NTAPI xboxkrnl::XcPKDecPrivate LOG_FUNC_ARG_TYPE(PBYTE, pbPrvKey) LOG_FUNC_ARG_TYPE(PBYTE, pbInput) LOG_FUNC_ARG_OUT(pbOutput) - LOG_FUNC_END; + LOG_FUNC_END; - ULONG ret = 0; - - LOG_UNIMPLEMENTED(); + ULONG ret = UpdatedCryptoStruct.pXcPKDecPrivate(pbPrvKey, pbInput, pbOutput); RETURN(ret); } @@ -263,9 +580,7 @@ XBSYSAPI EXPORTNUM(343) xboxkrnl::ULONG NTAPI xboxkrnl::XcPKGetKeyLen { LOG_FUNC_ONE_ARG_TYPE(PBYTE, pbPubKey); - ULONG ret = 0; - - LOG_UNIMPLEMENTED(); + ULONG ret = UpdatedCryptoStruct.pXcPKGetKeyLen(pbPubKey); RETURN(ret); } @@ -284,11 +599,9 @@ XBSYSAPI EXPORTNUM(344) xboxkrnl::BOOLEAN NTAPI xboxkrnl::XcVerifyPKCS1Signature LOG_FUNC_ARG_TYPE(PBYTE, pbSig) LOG_FUNC_ARG_TYPE(PBYTE, pbPubKey) LOG_FUNC_ARG_TYPE(PBYTE, pbDigest) - LOG_FUNC_END; + LOG_FUNC_END; - BOOLEAN ret = TRUE; - - LOG_UNIMPLEMENTED(); + BOOLEAN ret = UpdatedCryptoStruct.pXcVerifyPKCS1Signature(pbSig, pbPubKey, pbDigest); RETURN(ret); } @@ -311,11 +624,9 @@ XBSYSAPI EXPORTNUM(345) xboxkrnl::ULONG NTAPI xboxkrnl::XcModExp LOG_FUNC_ARG(pC) LOG_FUNC_ARG(pD) LOG_FUNC_ARG(dwN) - LOG_FUNC_END; + LOG_FUNC_END; - ULONG ret = 0; - - LOG_UNIMPLEMENTED(); + ULONG ret = UpdatedCryptoStruct.pXcModExp(pA, pB, pC, pD, dwN); RETURN(ret); } @@ -332,9 +643,9 @@ XBSYSAPI EXPORTNUM(346) xboxkrnl::VOID NTAPI xboxkrnl::XcDESKeyParity LOG_FUNC_BEGIN LOG_FUNC_ARG_TYPE(PBYTE, pbKey) LOG_FUNC_ARG(dwKeyLength) - LOG_FUNC_END; + LOG_FUNC_END; - LOG_UNIMPLEMENTED(); + UpdatedCryptoStruct.pXcDESKeyParity(pbKey, dwKeyLength); } // ****************************************************************** @@ -351,9 +662,9 @@ XBSYSAPI EXPORTNUM(347) xboxkrnl::VOID NTAPI xboxkrnl::XcKeyTable LOG_FUNC_ARG(dwCipher) LOG_FUNC_ARG_OUT(pbKeyTable) LOG_FUNC_ARG_TYPE(PBYTE, pbKey) - LOG_FUNC_END; + LOG_FUNC_END; - LOG_UNIMPLEMENTED(); + UpdatedCryptoStruct.pXcKeyTable(dwCipher, pbKeyTable, pbKey); } // ****************************************************************** @@ -374,9 +685,9 @@ XBSYSAPI EXPORTNUM(348) xboxkrnl::VOID NTAPI xboxkrnl::XcBlockCrypt LOG_FUNC_ARG_TYPE(PBYTE, pbInput) LOG_FUNC_ARG_TYPE(PBYTE, pbKeyTable) LOG_FUNC_ARG(dwOp) - LOG_FUNC_END; + LOG_FUNC_END; - LOG_UNIMPLEMENTED(); + UpdatedCryptoStruct.pXcBlockCrypt(dwCipher, pbOutput, pbInput, pbKeyTable, dwOp); } // ****************************************************************** @@ -401,9 +712,9 @@ XBSYSAPI EXPORTNUM(349) xboxkrnl::VOID NTAPI xboxkrnl::XcBlockCryptCBC LOG_FUNC_ARG_TYPE(PBYTE, pbKeyTable) LOG_FUNC_ARG(dwOp) LOG_FUNC_ARG_TYPE(PBYTE, pbFeedback) - LOG_FUNC_END; + LOG_FUNC_END; - LOG_UNIMPLEMENTED(); + UpdatedCryptoStruct.pXcBlockCryptCBC(dwCipher, dwInputLength, pbOutput, pbInput, pbKeyTable, dwOp, pbFeedback); } // ****************************************************************** @@ -418,30 +729,9 @@ XBSYSAPI EXPORTNUM(350) xboxkrnl::ULONG NTAPI xboxkrnl::XcCryptService LOG_FUNC_BEGIN LOG_FUNC_ARG(dwOp) LOG_FUNC_ARG(pArgs) - LOG_FUNC_END; + LOG_FUNC_END; - ULONG ret = 0; - - LOG_UNIMPLEMENTED(); + ULONG ret = UpdatedCryptoStruct.pXcCryptService(dwOp, pArgs); RETURN(ret); } - -typedef PVOID PCRYPTO_VECTOR; - -// ****************************************************************** -// * 0x015F - XcUpdateCrypto() -// ****************************************************************** -XBSYSAPI EXPORTNUM(351) xboxkrnl::VOID NTAPI xboxkrnl::XcUpdateCrypto -( - IN PCRYPTO_VECTOR pNewVector, - OUT PCRYPTO_VECTOR pROMVector OPTIONAL -) -{ - LOG_FUNC_BEGIN - LOG_FUNC_ARG(pNewVector) - LOG_FUNC_ARG_OUT(pROMVector) - LOG_FUNC_END; - - LOG_UNIMPLEMENTED(); -} diff --git a/src/CxbxKrnl/EmuKrnlXe.cpp b/src/core/kernel/exports/EmuKrnlXe.cpp similarity index 63% rename from src/CxbxKrnl/EmuKrnlXe.cpp rename to src/core/kernel/exports/EmuKrnlXe.cpp index 9f43aa42b..2f5ea699a 100644 --- a/src/CxbxKrnl/EmuKrnlXe.cpp +++ b/src/core/kernel/exports/EmuKrnlXe.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuKrnlXe.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::XE // prevent name collisions namespace xboxkrnl @@ -44,11 +34,10 @@ namespace xboxkrnl #include // For XeImageFileName, etc. }; -#include "CxbxKrnl.h" // For CxbxKrnl_Xbe +#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnl_Xbe #include "Logging.h" // For LOG_FUNC() #include "EmuKrnlLogging.h" -#include "Emu.h" // For EmuWarning() -#include "VMManager.h" +#include "core\kernel\memory-manager\VMManager.h" // ****************************************************************** // * 0x0146 - XeImageFileName @@ -81,15 +70,10 @@ XBSYSAPI EXPORTNUM(327) xboxkrnl::NTSTATUS NTAPI xboxkrnl::XeLoadSection NTSTATUS ret = STATUS_SUCCESS; - void* sectionData = CxbxKrnl_Xbe->FindSection((char*)std::string(Section->SectionName, 9).c_str()); + void* sectionData = CxbxKrnl_Xbe->FindSection(Section); if (sectionData != nullptr) { // If the reference count was zero, load the section if (Section->SectionReferenceCount == 0) { - // Clear the memory the section requires - memset(Section->VirtualAddress, 0, Section->VirtualSize); - // Copy the section data - memcpy(Section->VirtualAddress, sectionData, Section->FileSize); - // REMARK: Some titles have sections less than PAGE_SIZE, which will cause an overlap with the next section // since both will have the same aligned starting address. // Test case: Dead or Alive 3, section XGRPH has a size of 764 bytes @@ -99,7 +83,15 @@ XBSYSAPI EXPORTNUM(327) xboxkrnl::NTSTATUS NTAPI xboxkrnl::XeLoadSection VAddr BaseAddress = (VAddr)Section->VirtualAddress; size_t SectionSize = (VAddr)Section->VirtualSize; - ret = g_VMManager.XbAllocateVirtualMemory(&BaseAddress, 0, &SectionSize, XBOX_MEM_COMMIT, XBOX_PAGE_EXECUTE_READWRITE); + ret = g_VMManager.XbAllocateVirtualMemory(&BaseAddress, 0, &SectionSize, XBOX_MEM_COMMIT, XBOX_PAGE_EXECUTE_READWRITE); + if (ret != STATUS_SUCCESS) { + RETURN(ret); + } + + // Clear the memory the section requires + memset(Section->VirtualAddress, 0, Section->VirtualSize); + // Copy the section data + memcpy(Section->VirtualAddress, sectionData, Section->FileSize); // Increment the head/tail page reference counters (*Section->HeadReferenceCount)++; @@ -174,9 +166,12 @@ XBSYSAPI EXPORTNUM(328) xboxkrnl::NTSTATUS NTAPI xboxkrnl::XeUnloadSection // ****************************************************************** // * 0x0163 - XePublicKeyData -// ****************************************************************** +// ****************************************************************** +// Define XePublicKeyData: This will be overwritten by the correct key for the given Xbe at runtime +XBSYSAPI EXPORTNUM(355) xboxkrnl::UCHAR xboxkrnl::XePublicKeyData[284] = { 0 }; + // We are allowed to use the real RSA public key since it cannot be used to sign data, only verify it -> it's not secret/private -XBSYSAPI EXPORTNUM(355) xboxkrnl::UCHAR xboxkrnl::XePublicKeyData[284] = { +xboxkrnl::UCHAR xboxkrnl::XePublicKeyDataRetail[284] = { 0x52,0x53,0x41,0x31, 0x08,0x01,0x00,0x00, 0x00,0x08,0x00,0x00, 0xff,0x00,0x00,0x00, 0x01,0x00,0x01,0x00, // Public Modulus "m" @@ -200,3 +195,58 @@ XBSYSAPI EXPORTNUM(355) xboxkrnl::UCHAR xboxkrnl::XePublicKeyData[284] = { 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }; +// Chihiro Game Public Key +xboxkrnl::UCHAR xboxkrnl::XePublicKeyDataChihiroGame[284] = { + 0x52, 0x53, 0x41, 0x31, 0x08, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x9B, 0x83, 0xD4, 0xD5, + 0xDE, 0x16, 0x25, 0x8E, 0xE5, 0x15, 0xF2, 0x18, 0x9D, 0x19, 0x1C, 0xF8, + 0xFE, 0x91, 0xA5, 0x83, 0xAE, 0xA5, 0xA8, 0x95, 0x3F, 0x01, 0xB2, 0xC9, + 0x34, 0xFB, 0xC7, 0x51, 0x2D, 0xAC, 0xFF, 0x38, 0xE6, 0xB6, 0x7B, 0x08, + 0x4A, 0xDF, 0x98, 0xA3, 0xFD, 0x31, 0x81, 0xBF, 0xAA, 0xD1, 0x62, 0x58, + 0xC0, 0x6C, 0x8F, 0x8E, 0xCD, 0x96, 0xCE, 0x6D, 0x03, 0x44, 0x59, 0x93, + 0xCE, 0xEA, 0x8D, 0xF4, 0xD4, 0x6F, 0x6F, 0x34, 0x5D, 0x50, 0xF1, 0xAE, + 0x99, 0x7F, 0x1D, 0x92, 0x15, 0xF3, 0x6B, 0xDB, 0xF9, 0x95, 0x8B, 0x3F, + 0x54, 0xAD, 0x37, 0xB5, 0x4F, 0x0A, 0x58, 0x7B, 0x48, 0xA2, 0x9F, 0x9E, + 0xA3, 0x16, 0xC8, 0xBD, 0x37, 0xDA, 0x9A, 0x37, 0xE6, 0x3F, 0x10, 0x1B, + 0xA8, 0x4F, 0xA3, 0x14, 0xFA, 0xBE, 0x12, 0xFB, 0xD7, 0x19, 0x4C, 0xED, + 0xAD, 0xA2, 0x95, 0x8F, 0x39, 0x8C, 0xC4, 0x69, 0x0F, 0x7D, 0xB8, 0x84, + 0x0A, 0x99, 0x5C, 0x53, 0x2F, 0xDE, 0xF2, 0x1B, 0xC5, 0x1D, 0x4C, 0x43, + 0x3C, 0x97, 0xA7, 0xBA, 0x8F, 0xC3, 0x22, 0x67, 0x39, 0xC2, 0x62, 0x74, + 0x3A, 0x0C, 0xB5, 0x57, 0x01, 0x3A, 0x67, 0xC6, 0xDE, 0x0C, 0x0B, 0xF6, + 0x08, 0x01, 0x64, 0xDB, 0xBD, 0x81, 0xE4, 0xDC, 0x09, 0x2E, 0xD0, 0xF1, + 0xD0, 0xD6, 0x1E, 0xBA, 0x38, 0x36, 0xF4, 0x4A, 0xDD, 0xCA, 0x39, 0xEB, + 0x76, 0xCF, 0x95, 0xDC, 0x48, 0x4C, 0xF2, 0x43, 0x8C, 0xD9, 0x44, 0x26, + 0x7A, 0x9E, 0xEB, 0x99, 0xA3, 0xD8, 0xFB, 0x30, 0xA8, 0x14, 0x42, 0x82, + 0x8D, 0xB4, 0x31, 0xB3, 0x1A, 0xD5, 0x2B, 0xF6, 0x32, 0xBC, 0x62, 0xC0, + 0xFE, 0x81, 0x20, 0x49, 0xE7, 0xF7, 0x58, 0x2F, 0x2D, 0xA6, 0x1B, 0x41, + 0x62, 0xC7, 0xE0, 0x32, 0x02, 0x5D, 0x82, 0xEC, 0xA3, 0xE4, 0x6C, 0x9B, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +// Chihiro bootloader public key (Segaboot) +xboxkrnl::UCHAR xboxkrnl::XePublicKeyDataChihiroBoot[284] = { + 0x52, 0x53, 0x41, 0x31, 0x08, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x6B, 0x7B, 0x38, 0x78, + 0xE3, 0x16, 0x04, 0x88, 0x1D, 0xAF, 0x63, 0x4E, 0x23, 0xDB, 0x10, 0x14, + 0xB4, 0x52, 0x87, 0xEB, 0xE3, 0x37, 0xC2, 0x35, 0x6E, 0x38, 0x08, 0xDC, + 0x07, 0xC5, 0x92, 0x17, 0xC0, 0xBF, 0xDB, 0xF5, 0x9E, 0x72, 0xDB, 0x2F, + 0x98, 0x93, 0x6E, 0x98, 0x5E, 0xD9, 0x69, 0x80, 0x17, 0xFC, 0x0C, 0x72, + 0x2E, 0xE6, 0x75, 0x85, 0x48, 0xEA, 0xBD, 0xDA, 0x6E, 0x82, 0xD9, 0xFB, + 0x10, 0xAA, 0x11, 0xEE, 0xB5, 0xC1, 0xF2, 0x53, 0xD6, 0xF0, 0xD3, 0x4B, + 0xC2, 0x11, 0x4F, 0x8A, 0x18, 0xFB, 0xB7, 0x36, 0xFC, 0xDD, 0xD0, 0xBF, + 0x5C, 0x32, 0x44, 0x40, 0xEB, 0x92, 0x70, 0xA4, 0xEF, 0x3A, 0xAB, 0x78, + 0x66, 0x1A, 0x03, 0x0A, 0x9E, 0xC5, 0x3A, 0xB7, 0x8F, 0xE5, 0xB1, 0x5E, + 0x44, 0x15, 0xBA, 0x42, 0xD9, 0x10, 0x2A, 0x60, 0x93, 0x47, 0x4C, 0x5B, + 0xE1, 0x24, 0x04, 0x1E, 0x5C, 0x95, 0xB2, 0x17, 0x34, 0xD2, 0x37, 0x5F, + 0x85, 0x83, 0x62, 0x8D, 0x6E, 0x90, 0x69, 0x06, 0xB9, 0xFB, 0x7A, 0x24, + 0x8A, 0xE6, 0xCC, 0x77, 0x1E, 0x0A, 0x8C, 0x2B, 0x3B, 0xA2, 0x33, 0x79, + 0x24, 0x8C, 0xD3, 0x88, 0x01, 0x3A, 0x38, 0x7F, 0xF0, 0xAB, 0x9E, 0x2F, + 0x74, 0xCE, 0x50, 0xD1, 0xC2, 0x00, 0x57, 0xD3, 0xA7, 0x09, 0x45, 0x36, + 0xFA, 0xC1, 0xC7, 0x1B, 0x65, 0xAD, 0x98, 0x9C, 0x63, 0xED, 0xBA, 0x99, + 0x9B, 0x07, 0x3E, 0x57, 0xBD, 0xB5, 0x52, 0x44, 0x72, 0x09, 0x43, 0xE0, + 0x5C, 0x35, 0xCC, 0xE4, 0xE0, 0x85, 0x6A, 0x61, 0xAA, 0xF5, 0x0D, 0x1E, + 0xE7, 0x8F, 0xB0, 0xB9, 0xE3, 0xC3, 0x83, 0x10, 0x6C, 0x2F, 0x5D, 0xD4, + 0xAB, 0x2D, 0xAB, 0x4D, 0xCE, 0xC9, 0x7F, 0x52, 0x39, 0x13, 0xED, 0x44, + 0x06, 0x23, 0x2F, 0x62, 0xFF, 0xA1, 0x2B, 0xEE, 0x07, 0x98, 0x7D, 0xBC, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/src/core/kernel/exports/KernelThunk.cpp b/src/core/kernel/exports/KernelThunk.cpp new file mode 100644 index 000000000..25180eb54 --- /dev/null +++ b/src/core/kernel/exports/KernelThunk.cpp @@ -0,0 +1,427 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * +// * All rights reserved +// * +// ****************************************************************** + +// prevent name collisions +namespace xboxkrnl +{ + #include +}; + +#include "Cxbx.h" // For CxbxKrnl_KernelThunkTable +#include "core\kernel\init\CxbxKrnl.h" // For UINT + +#define FUNC(f) f +#define VARIABLE(v) v + +#define DEVKIT // developer kit only functions +#define PROFILING // private kernel profiling functions +// A.k.a. _XBOX_ENABLE_PROFILING + +// kernel thunk table +// Note : Names that collide with other symbols, use the KRNL() macro. +uint32_t CxbxKrnl_KernelThunkTable[379] = +{ + (uint32_t)FUNC(xbnullptr), // 0x0000 (0) "Undefined", this function doesn't exist + (uint32_t)FUNC(&xboxkrnl::AvGetSavedDataAddress), // 0x0001 (1) + (uint32_t)FUNC(&xboxkrnl::AvSendTVEncoderOption), // 0x0002 (2) + (uint32_t)FUNC(&xboxkrnl::AvSetDisplayMode), // 0x0003 (3) + (uint32_t)FUNC(&xboxkrnl::AvSetSavedDataAddress), // 0x0004 (4) + (uint32_t)FUNC(&xboxkrnl::DbgBreakPoint), // 0x0005 (5) + (uint32_t)FUNC(&xboxkrnl::DbgBreakPointWithStatus), // 0x0006 (6) + (uint32_t)FUNC(&xboxkrnl::DbgLoadImageSymbols), // 0x0007 (7) DEVKIT + (uint32_t)FUNC(&xboxkrnl::DbgPrint), // 0x0008 (8) + (uint32_t)FUNC(&xboxkrnl::HalReadSMCTrayState), // 0x0009 (9) + (uint32_t)FUNC(&xboxkrnl::DbgPrompt), // 0x000A (10) + (uint32_t)FUNC(&xboxkrnl::DbgUnLoadImageSymbols), // 0x000B (11) DEVKIT + (uint32_t)FUNC(&xboxkrnl::ExAcquireReadWriteLockExclusive), // 0x000C (12) + (uint32_t)FUNC(&xboxkrnl::ExAcquireReadWriteLockShared), // 0x000D (13) + (uint32_t)FUNC(&xboxkrnl::ExAllocatePool), // 0x000E (14) + (uint32_t)FUNC(&xboxkrnl::ExAllocatePoolWithTag), // 0x000F (15) + (uint32_t)VARIABLE(&xboxkrnl::ExEventObjectType), // 0x0010 (16) + (uint32_t)FUNC(&xboxkrnl::ExFreePool), // 0x0011 (17) + (uint32_t)FUNC(&xboxkrnl::ExInitializeReadWriteLock), // 0x0012 (18) + (uint32_t)FUNC(&xboxkrnl::ExInterlockedAddLargeInteger), // 0x0013 (19) + (uint32_t)FUNC(&xboxkrnl::ExInterlockedAddLargeStatistic), // 0x0014 (20) + (uint32_t)FUNC(&xboxkrnl::ExInterlockedCompareExchange64), // 0x0015 (21) + (uint32_t)VARIABLE(&xboxkrnl::ExMutantObjectType), // 0x0016 (22) + (uint32_t)FUNC(&xboxkrnl::ExQueryPoolBlockSize), // 0x0017 (23) + (uint32_t)FUNC(&xboxkrnl::ExQueryNonVolatileSetting), // 0x0018 (24) + (uint32_t)FUNC(&xboxkrnl::ExReadWriteRefurbInfo), // 0x0019 (25) + (uint32_t)FUNC(&xboxkrnl::ExRaiseException), // 0x001A (26) + (uint32_t)FUNC(&xboxkrnl::ExRaiseStatus), // 0x001B (27) + (uint32_t)FUNC(&xboxkrnl::ExReleaseReadWriteLock), // 0x001C (28) + (uint32_t)FUNC(&xboxkrnl::ExSaveNonVolatileSetting), // 0x001D (29) + (uint32_t)VARIABLE(&xboxkrnl::ExSemaphoreObjectType), // 0x001E (30) + (uint32_t)VARIABLE(&xboxkrnl::ExTimerObjectType), // 0x001F (31) + (uint32_t)FUNC(&xboxkrnl::ExfInterlockedInsertHeadList), // 0x0020 (32) + (uint32_t)FUNC(&xboxkrnl::ExfInterlockedInsertTailList), // 0x0021 (33) + (uint32_t)FUNC(&xboxkrnl::ExfInterlockedRemoveHeadList), // 0x0022 (34) + (uint32_t)FUNC(&xboxkrnl::FscGetCacheSize), // 0x0023 (35) + (uint32_t)FUNC(&xboxkrnl::FscInvalidateIdleBlocks), // 0x0024 (36) + (uint32_t)FUNC(&xboxkrnl::FscSetCacheSize), // 0x0025 (37) + (uint32_t)FUNC(&xboxkrnl::HalClearSoftwareInterrupt), // 0x0026 (38) + (uint32_t)FUNC(&xboxkrnl::HalDisableSystemInterrupt), // 0x0027 (39) + (uint32_t)VARIABLE(&xboxkrnl::HalDiskCachePartitionCount), // 0x0028 (40) A.k.a. "IdexDiskPartitionPrefixBuffer" + (uint32_t)VARIABLE(&xboxkrnl::HalDiskModelNumber), // 0x0029 (41) + (uint32_t)VARIABLE(&xboxkrnl::HalDiskSerialNumber), // 0x002A (42) + (uint32_t)FUNC(&xboxkrnl::HalEnableSystemInterrupt), // 0x002B (43) + (uint32_t)FUNC(&xboxkrnl::HalGetInterruptVector), // 0x002C (44) + (uint32_t)FUNC(&xboxkrnl::HalReadSMBusValue), // 0x002D (45) + (uint32_t)FUNC(&xboxkrnl::HalReadWritePCISpace), // 0x002E (46) + (uint32_t)FUNC(&xboxkrnl::HalRegisterShutdownNotification), // 0x002F (47) + (uint32_t)FUNC(&xboxkrnl::HalRequestSoftwareInterrupt), // 0x0030 (48) + (uint32_t)FUNC(&xboxkrnl::HalReturnToFirmware), // 0x0031 (49) + (uint32_t)FUNC(&xboxkrnl::HalWriteSMBusValue), // 0x0032 (50) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedCompareExchange)), // 0x0033 (51) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedDecrement)), // 0x0034 (52) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedIncrement)), // 0x0035 (53) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedExchange)), // 0x0036 (54) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedExchangeAdd)), // 0x0037 (55) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedFlushSList)), // 0x0038 (56) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedPopEntrySList)), // 0x0039 (57) + (uint32_t)FUNC(&xboxkrnl::KRNL(InterlockedPushEntrySList)), // 0x003A (58) + (uint32_t)FUNC(&xboxkrnl::IoAllocateIrp), // 0x003B (59) + (uint32_t)FUNC(&xboxkrnl::IoBuildAsynchronousFsdRequest), // 0x003C (60) + (uint32_t)FUNC(&xboxkrnl::IoBuildDeviceIoControlRequest), // 0x003D (61) + (uint32_t)FUNC(&xboxkrnl::IoBuildSynchronousFsdRequest), // 0x003E (62) + (uint32_t)FUNC(&xboxkrnl::IoCheckShareAccess), // 0x003F (63) + (uint32_t)VARIABLE(&xboxkrnl::IoCompletionObjectType), // 0x0040 (64) + (uint32_t)FUNC(&xboxkrnl::IoCreateDevice), // 0x0041 (65) + (uint32_t)FUNC(&xboxkrnl::IoCreateFile), // 0x0042 (66) + (uint32_t)FUNC(&xboxkrnl::IoCreateSymbolicLink), // 0x0043 (67) + (uint32_t)FUNC(&xboxkrnl::IoDeleteDevice), // 0x0044 (68) + (uint32_t)FUNC(&xboxkrnl::IoDeleteSymbolicLink), // 0x0045 (69) + (uint32_t)VARIABLE(&xboxkrnl::IoDeviceObjectType), // 0x0046 (70) + (uint32_t)VARIABLE(&xboxkrnl::IoFileObjectType), // 0x0047 (71) + (uint32_t)FUNC(&xboxkrnl::IoFreeIrp), // 0x0048 (72) + (uint32_t)FUNC(&xboxkrnl::IoInitializeIrp), // 0x0049 (73) + (uint32_t)FUNC(&xboxkrnl::IoInvalidDeviceRequest), // 0x004A (74) + (uint32_t)FUNC(&xboxkrnl::IoQueryFileInformation), // 0x004B (75) + (uint32_t)FUNC(&xboxkrnl::IoQueryVolumeInformation), // 0x004C (76) + (uint32_t)FUNC(&xboxkrnl::IoQueueThreadIrp), // 0x004D (77) + (uint32_t)FUNC(&xboxkrnl::IoRemoveShareAccess), // 0x004E (78) + (uint32_t)FUNC(&xboxkrnl::IoSetIoCompletion), // 0x004F (79) + (uint32_t)FUNC(&xboxkrnl::IoSetShareAccess), // 0x0050 (80) + (uint32_t)FUNC(&xboxkrnl::IoStartNextPacket), // 0x0051 (81) + (uint32_t)FUNC(&xboxkrnl::IoStartNextPacketByKey), // 0x0052 (82) + (uint32_t)FUNC(&xboxkrnl::IoStartPacket), // 0x0053 (83) + (uint32_t)FUNC(&xboxkrnl::IoSynchronousDeviceIoControlRequest), // 0x0054 (84) + (uint32_t)FUNC(&xboxkrnl::IoSynchronousFsdRequest), // 0x0055 (85) + (uint32_t)FUNC(&xboxkrnl::IofCallDriver), // 0x0056 (86) + (uint32_t)FUNC(&xboxkrnl::IofCompleteRequest), // 0x0057 (87) + (uint32_t)VARIABLE(&xboxkrnl::KdDebuggerEnabled), // 0x0058 (88) + (uint32_t)VARIABLE(&xboxkrnl::KdDebuggerNotPresent), // 0x0059 (89) + (uint32_t)FUNC(&xboxkrnl::IoDismountVolume), // 0x005A (90) + (uint32_t)FUNC(&xboxkrnl::IoDismountVolumeByName), // 0x005B (91) + (uint32_t)FUNC(&xboxkrnl::KeAlertResumeThread), // 0x005C (92) + (uint32_t)FUNC(&xboxkrnl::KeAlertThread), // 0x005D (93) + (uint32_t)FUNC(&xboxkrnl::KeBoostPriorityThread), // 0x005E (94) + (uint32_t)FUNC(&xboxkrnl::KeBugCheck), // 0x005F (95) + (uint32_t)FUNC(&xboxkrnl::KeBugCheckEx), // 0x0060 (96) + (uint32_t)FUNC(&xboxkrnl::KeCancelTimer), // 0x0061 (97) + (uint32_t)FUNC(&xboxkrnl::KeConnectInterrupt), // 0x0062 (98) + (uint32_t)FUNC(&xboxkrnl::KeDelayExecutionThread), // 0x0063 (99) + (uint32_t)FUNC(&xboxkrnl::KeDisconnectInterrupt), // 0x0064 (100 + (uint32_t)FUNC(&xboxkrnl::KeEnterCriticalRegion), // 0x0065 (101) + (uint32_t)VARIABLE(&xboxkrnl::MmGlobalData), // 0x0066 (102) + (uint32_t)FUNC(&xboxkrnl::KeGetCurrentIrql), // 0x0067 (103) + (uint32_t)FUNC(&xboxkrnl::KeGetCurrentThread), // 0x0068 (104) + (uint32_t)FUNC(&xboxkrnl::KeInitializeApc), // 0x0069 (105) + (uint32_t)FUNC(&xboxkrnl::KeInitializeDeviceQueue), // 0x006A (106) + (uint32_t)FUNC(&xboxkrnl::KeInitializeDpc), // 0x006B (107) + (uint32_t)FUNC(&xboxkrnl::KeInitializeEvent), // 0x006C (108) + (uint32_t)FUNC(&xboxkrnl::KeInitializeInterrupt), // 0x006D (109) + (uint32_t)FUNC(&xboxkrnl::KeInitializeMutant), // 0x006E (110) + (uint32_t)FUNC(&xboxkrnl::KeInitializeQueue), // 0x006F (111) + (uint32_t)FUNC(&xboxkrnl::KeInitializeSemaphore), // 0x0070 (112) + (uint32_t)FUNC(&xboxkrnl::KeInitializeTimerEx), // 0x0071 (113) + (uint32_t)FUNC(&xboxkrnl::KeInsertByKeyDeviceQueue), // 0x0072 (114) + (uint32_t)FUNC(&xboxkrnl::KeInsertDeviceQueue), // 0x0073 (115) + (uint32_t)FUNC(&xboxkrnl::KeInsertHeadQueue), // 0x0074 (116) + (uint32_t)FUNC(&xboxkrnl::KeInsertQueue), // 0x0075 (117) + (uint32_t)FUNC(&xboxkrnl::KeInsertQueueApc), // 0x0076 (118) + (uint32_t)FUNC(&xboxkrnl::KeInsertQueueDpc), // 0x0077 (119) + (uint32_t)VARIABLE(&xboxkrnl::KeInterruptTime), // 0x0078 (120) KeInterruptTime + (uint32_t)FUNC(&xboxkrnl::KeIsExecutingDpc), // 0x0079 (121) + (uint32_t)FUNC(&xboxkrnl::KeLeaveCriticalRegion), // 0x007A (122) + (uint32_t)FUNC(&xboxkrnl::KePulseEvent), // 0x007B (123) + (uint32_t)FUNC(&xboxkrnl::KeQueryBasePriorityThread), // 0x007C (124) + (uint32_t)FUNC(&xboxkrnl::KeQueryInterruptTime), // 0x007D (125) + (uint32_t)FUNC(&xboxkrnl::KeQueryPerformanceCounter), // 0x007E (126) + (uint32_t)FUNC(&xboxkrnl::KeQueryPerformanceFrequency), // 0x007F (127) + (uint32_t)FUNC(&xboxkrnl::KeQuerySystemTime), // 0x0080 (128) + (uint32_t)FUNC(&xboxkrnl::KeRaiseIrqlToDpcLevel), // 0x0081 (129) + (uint32_t)FUNC(&xboxkrnl::KeRaiseIrqlToSynchLevel), // 0x0082 (130) + (uint32_t)FUNC(&xboxkrnl::KeReleaseMutant), // 0x0083 (131) + (uint32_t)FUNC(&xboxkrnl::KeReleaseSemaphore), // 0x0084 (132) + (uint32_t)FUNC(&xboxkrnl::KeRemoveByKeyDeviceQueue), // 0x0085 (133) + (uint32_t)FUNC(&xboxkrnl::KeRemoveDeviceQueue), // 0x0086 (134) + (uint32_t)FUNC(&xboxkrnl::KeRemoveEntryDeviceQueue), // 0x0087 (135) + (uint32_t)FUNC(&xboxkrnl::KeRemoveQueue), // 0x0088 (136) + (uint32_t)FUNC(&xboxkrnl::KeRemoveQueueDpc), // 0x0089 (137) + (uint32_t)FUNC(&xboxkrnl::KeResetEvent), // 0x008A (138) + (uint32_t)FUNC(&xboxkrnl::KeRestoreFloatingPointState), // 0x008B (139) + (uint32_t)FUNC(&xboxkrnl::KeResumeThread), // 0x008C (140) + (uint32_t)FUNC(&xboxkrnl::KeRundownQueue), // 0x008D (141) + (uint32_t)FUNC(&xboxkrnl::KeSaveFloatingPointState), // 0x008E (142) + (uint32_t)FUNC(&xboxkrnl::KeSetBasePriorityThread), // 0x008F (143) + (uint32_t)FUNC(&xboxkrnl::KeSetDisableBoostThread), // 0x0090 (144) + (uint32_t)FUNC(&xboxkrnl::KeSetEvent), // 0x0091 (145) + (uint32_t)FUNC(&xboxkrnl::KeSetEventBoostPriority), // 0x0092 (146) + (uint32_t)FUNC(&xboxkrnl::KeSetPriorityProcess), // 0x0093 (147) + (uint32_t)FUNC(&xboxkrnl::KeSetPriorityThread), // 0x0094 (148) + (uint32_t)FUNC(&xboxkrnl::KeSetTimer), // 0x0095 (149) + (uint32_t)FUNC(&xboxkrnl::KeSetTimerEx), // 0x0096 (150) + (uint32_t)FUNC(&xboxkrnl::KeStallExecutionProcessor), // 0x0097 (151) + (uint32_t)FUNC(&xboxkrnl::KeSuspendThread), // 0x0098 (152) + (uint32_t)FUNC(&xboxkrnl::KeSynchronizeExecution), // 0x0099 (153) + (uint32_t)VARIABLE(&xboxkrnl::KeSystemTime), // 0x009A (154) KeSystemTime + (uint32_t)FUNC(&xboxkrnl::KeTestAlertThread), // 0x009B (155) + (uint32_t)VARIABLE(&xboxkrnl::KeTickCount), // 0x009C (156) + (uint32_t)VARIABLE(&xboxkrnl::KeTimeIncrement), // 0x009D (157) + (uint32_t)FUNC(&xboxkrnl::KeWaitForMultipleObjects), // 0x009E (158) + (uint32_t)FUNC(&xboxkrnl::KeWaitForSingleObject), // 0x009F (159) + (uint32_t)FUNC(&xboxkrnl::KfRaiseIrql), // 0x00A0 (160) + (uint32_t)FUNC(&xboxkrnl::KfLowerIrql), // 0x00A1 (161) + (uint32_t)VARIABLE(&xboxkrnl::KiBugCheckData), // 0x00A2 (162) + (uint32_t)FUNC(&xboxkrnl::KiUnlockDispatcherDatabase), // 0x00A3 (163) + (uint32_t)VARIABLE(&xboxkrnl::LaunchDataPage), // 0x00A4 (164) + (uint32_t)FUNC(&xboxkrnl::MmAllocateContiguousMemory), // 0x00A5 (165) + (uint32_t)FUNC(&xboxkrnl::MmAllocateContiguousMemoryEx), // 0x00A6 (166) + (uint32_t)FUNC(&xboxkrnl::MmAllocateSystemMemory), // 0x00A7 (167) + (uint32_t)FUNC(&xboxkrnl::MmClaimGpuInstanceMemory), // 0x00A8 (168) + (uint32_t)FUNC(&xboxkrnl::MmCreateKernelStack), // 0x00A9 (169) + (uint32_t)FUNC(&xboxkrnl::MmDeleteKernelStack), // 0x00AA (170) + (uint32_t)FUNC(&xboxkrnl::MmFreeContiguousMemory), // 0x00AB (171) + (uint32_t)FUNC(&xboxkrnl::MmFreeSystemMemory), // 0x00AC (172) + (uint32_t)FUNC(&xboxkrnl::MmGetPhysicalAddress), // 0x00AD (173) + (uint32_t)FUNC(&xboxkrnl::MmIsAddressValid), // 0x00AE (174) + (uint32_t)FUNC(&xboxkrnl::MmLockUnlockBufferPages), // 0x00AF (175) + (uint32_t)FUNC(&xboxkrnl::MmLockUnlockPhysicalPage), // 0x00B0 (176) + (uint32_t)FUNC(&xboxkrnl::MmMapIoSpace), // 0x00B1 (177) + (uint32_t)FUNC(&xboxkrnl::MmPersistContiguousMemory), // 0x00B2 (178) + (uint32_t)FUNC(&xboxkrnl::MmQueryAddressProtect), // 0x00B3 (179) + (uint32_t)FUNC(&xboxkrnl::MmQueryAllocationSize), // 0x00B4 (180) + (uint32_t)FUNC(&xboxkrnl::MmQueryStatistics), // 0x00B5 (181) + (uint32_t)FUNC(&xboxkrnl::MmSetAddressProtect), // 0x00B6 (182) + (uint32_t)FUNC(&xboxkrnl::MmUnmapIoSpace), // 0x00B7 (183) + (uint32_t)FUNC(&xboxkrnl::NtAllocateVirtualMemory), // 0x00B8 (184) + (uint32_t)FUNC(&xboxkrnl::NtCancelTimer), // 0x00B9 (185) + (uint32_t)FUNC(&xboxkrnl::NtClearEvent), // 0x00BA (186) + (uint32_t)FUNC(&xboxkrnl::NtClose), // 0x00BB (187) + (uint32_t)FUNC(&xboxkrnl::NtCreateDirectoryObject), // 0x00BC (188) + (uint32_t)FUNC(&xboxkrnl::NtCreateEvent), // 0x00BD (189) + (uint32_t)FUNC(&xboxkrnl::NtCreateFile), // 0x00BE (190) + (uint32_t)FUNC(&xboxkrnl::NtCreateIoCompletion), // 0x00BF (191) + (uint32_t)FUNC(&xboxkrnl::NtCreateMutant), // 0x00C0 (192) + (uint32_t)FUNC(&xboxkrnl::NtCreateSemaphore), // 0x00C1 (193) + (uint32_t)FUNC(&xboxkrnl::NtCreateTimer), // 0x00C2 (194) + (uint32_t)FUNC(&xboxkrnl::NtDeleteFile), // 0x00C3 (195) + (uint32_t)FUNC(&xboxkrnl::NtDeviceIoControlFile), // 0x00C4 (196) + (uint32_t)FUNC(&xboxkrnl::NtDuplicateObject), // 0x00C5 (197) + (uint32_t)FUNC(&xboxkrnl::NtFlushBuffersFile), // 0x00C6 (198) + (uint32_t)FUNC(&xboxkrnl::NtFreeVirtualMemory), // 0x00C7 (199) + (uint32_t)FUNC(&xboxkrnl::NtFsControlFile), // 0x00C8 (200) + (uint32_t)FUNC(&xboxkrnl::NtOpenDirectoryObject), // 0x00C9 (201) + (uint32_t)FUNC(&xboxkrnl::NtOpenFile), // 0x00CA (202) + (uint32_t)FUNC(&xboxkrnl::NtOpenSymbolicLinkObject), // 0x00CB (203) + (uint32_t)FUNC(&xboxkrnl::NtProtectVirtualMemory), // 0x00CC (204) + (uint32_t)FUNC(&xboxkrnl::NtPulseEvent), // 0x00CD (205) + (uint32_t)FUNC(&xboxkrnl::NtQueueApcThread), // 0x00CE (206) + (uint32_t)FUNC(&xboxkrnl::NtQueryDirectoryFile), // 0x00CF (207) + (uint32_t)FUNC(&xboxkrnl::NtQueryDirectoryObject), // 0x00D0 (208) + (uint32_t)FUNC(&xboxkrnl::NtQueryEvent), // 0x00D1 (209) + (uint32_t)FUNC(&xboxkrnl::NtQueryFullAttributesFile), // 0x00D2 (210) + (uint32_t)FUNC(&xboxkrnl::NtQueryInformationFile), // 0x00D3 (211) + (uint32_t)FUNC(&xboxkrnl::NtQueryIoCompletion), // 0x00D4 (212) + (uint32_t)FUNC(&xboxkrnl::NtQueryMutant), // 0x00D5 (213) + (uint32_t)FUNC(&xboxkrnl::NtQuerySemaphore), // 0x00D6 (214) + (uint32_t)FUNC(&xboxkrnl::NtQuerySymbolicLinkObject), // 0x00D7 (215) + (uint32_t)FUNC(&xboxkrnl::NtQueryTimer), // 0x00D8 (216) + (uint32_t)FUNC(&xboxkrnl::NtQueryVirtualMemory), // 0x00D9 (217) + (uint32_t)FUNC(&xboxkrnl::NtQueryVolumeInformationFile), // 0x00DA (218) + (uint32_t)FUNC(&xboxkrnl::NtReadFile), // 0x00DB (219) + (uint32_t)FUNC(&xboxkrnl::NtReadFileScatter), // 0x00DC (220) + (uint32_t)FUNC(&xboxkrnl::NtReleaseMutant), // 0x00DD (221) + (uint32_t)FUNC(&xboxkrnl::NtReleaseSemaphore), // 0x00DE (222) + (uint32_t)FUNC(&xboxkrnl::NtRemoveIoCompletion), // 0x00DF (223) + (uint32_t)FUNC(&xboxkrnl::NtResumeThread), // 0x00E0 (224) + (uint32_t)FUNC(&xboxkrnl::NtSetEvent), // 0x00E1 (225) + (uint32_t)FUNC(&xboxkrnl::NtSetInformationFile), // 0x00E2 (226) + (uint32_t)FUNC(&xboxkrnl::NtSetIoCompletion), // 0x00E3 (227) + (uint32_t)FUNC(&xboxkrnl::NtSetSystemTime), // 0x00E4 (228) + (uint32_t)FUNC(&xboxkrnl::NtSetTimerEx), // 0x00E5 (229) + (uint32_t)FUNC(&xboxkrnl::NtSignalAndWaitForSingleObjectEx), // 0x00E6 (230) + (uint32_t)FUNC(&xboxkrnl::NtSuspendThread), // 0x00E7 (231) + (uint32_t)FUNC(&xboxkrnl::NtUserIoApcDispatcher), // 0x00E8 (232) + (uint32_t)FUNC(&xboxkrnl::NtWaitForSingleObject), // 0x00E9 (233) + (uint32_t)FUNC(&xboxkrnl::NtWaitForSingleObjectEx), // 0x00EA (234) + (uint32_t)FUNC(&xboxkrnl::NtWaitForMultipleObjectsEx), // 0x00EB (235) + (uint32_t)FUNC(&xboxkrnl::NtWriteFile), // 0x00EC (236) + (uint32_t)FUNC(&xboxkrnl::NtWriteFileGather), // 0x00ED (237) + (uint32_t)FUNC(&xboxkrnl::NtYieldExecution), // 0x00EE (238) + (uint32_t)FUNC(&xboxkrnl::ObCreateObject), // 0x00EF (239) + (uint32_t)VARIABLE(&xboxkrnl::ObDirectoryObjectType), // 0x00F0 (240) + (uint32_t)FUNC(&xboxkrnl::ObInsertObject), // 0x00F1 (241) + (uint32_t)FUNC(&xboxkrnl::ObMakeTemporaryObject), // 0x00F2 (242) + (uint32_t)FUNC(&xboxkrnl::ObOpenObjectByName), // 0x00F3 (243) + (uint32_t)FUNC(&xboxkrnl::ObOpenObjectByPointer), // 0x00F4 (244) + (uint32_t)VARIABLE(&xboxkrnl::ObpObjectHandleTable), // 0x00F5 (245) + (uint32_t)FUNC(&xboxkrnl::ObReferenceObjectByHandle), // 0x00F6 (246) + (uint32_t)FUNC(&xboxkrnl::ObReferenceObjectByName), // 0x00F7 (247) + (uint32_t)FUNC(&xboxkrnl::ObReferenceObjectByPointer), // 0x00F8 (248) + (uint32_t)VARIABLE(&xboxkrnl::ObSymbolicLinkObjectType), // 0x00F9 (249) + (uint32_t)FUNC(&xboxkrnl::ObfDereferenceObject), // 0x00FA (250) + (uint32_t)FUNC(&xboxkrnl::ObfReferenceObject), // 0x00FB (251) + (uint32_t)FUNC(&xboxkrnl::PhyGetLinkState), // 0x00FC (252) + (uint32_t)FUNC(&xboxkrnl::PhyInitialize), // 0x00FD (253) + (uint32_t)FUNC(&xboxkrnl::PsCreateSystemThread), // 0x00FE (254) + (uint32_t)FUNC(&xboxkrnl::PsCreateSystemThreadEx), // 0x00FF (255) + (uint32_t)FUNC(&xboxkrnl::PsQueryStatistics), // 0x0100 (256) + (uint32_t)FUNC(&xboxkrnl::PsSetCreateThreadNotifyRoutine), // 0x0101 (257) + (uint32_t)FUNC(&xboxkrnl::PsTerminateSystemThread), // 0x0102 (258) + (uint32_t)VARIABLE(&xboxkrnl::PsThreadObjectType), // 0x0103 (259) + (uint32_t)FUNC(&xboxkrnl::RtlAnsiStringToUnicodeString), // 0x0104 (260) + (uint32_t)FUNC(&xboxkrnl::RtlAppendStringToString), // 0x0105 (261) + (uint32_t)FUNC(&xboxkrnl::RtlAppendUnicodeStringToString), // 0x0106 (262) + (uint32_t)FUNC(&xboxkrnl::RtlAppendUnicodeToString), // 0x0107 (263) + (uint32_t)FUNC(&xboxkrnl::RtlAssert), // 0x0108 (264) + (uint32_t)FUNC(&xboxkrnl::RtlCaptureContext), // 0x0109 (265) + (uint32_t)FUNC(&xboxkrnl::RtlCaptureStackBackTrace), // 0x010A (266) + (uint32_t)FUNC(&xboxkrnl::RtlCharToInteger), // 0x010B (267) + (uint32_t)FUNC(&xboxkrnl::RtlCompareMemory), // 0x010C (268) + (uint32_t)FUNC(&xboxkrnl::RtlCompareMemoryUlong), // 0x010D (269) + (uint32_t)FUNC(&xboxkrnl::RtlCompareString), // 0x010E (270) + (uint32_t)FUNC(&xboxkrnl::RtlCompareUnicodeString), // 0x010F (271) + (uint32_t)FUNC(&xboxkrnl::RtlCopyString), // 0x0110 (272) + (uint32_t)FUNC(&xboxkrnl::RtlCopyUnicodeString), // 0x0111 (273) + (uint32_t)FUNC(&xboxkrnl::RtlCreateUnicodeString), // 0x0112 (274) + (uint32_t)FUNC(&xboxkrnl::RtlDowncaseUnicodeChar), // 0x0113 (275) + (uint32_t)FUNC(&xboxkrnl::RtlDowncaseUnicodeString), // 0x0114 (276) + (uint32_t)FUNC(&xboxkrnl::RtlEnterCriticalSection), // 0x0115 (277) + (uint32_t)FUNC(&xboxkrnl::RtlEnterCriticalSectionAndRegion), // 0x0116 (278) + (uint32_t)FUNC(&xboxkrnl::RtlEqualString), // 0x0117 (279) + (uint32_t)FUNC(&xboxkrnl::RtlEqualUnicodeString), // 0x0118 (280) + (uint32_t)FUNC(&xboxkrnl::RtlExtendedIntegerMultiply), // 0x0119 (281) + (uint32_t)FUNC(&xboxkrnl::RtlExtendedLargeIntegerDivide), // 0x011A (282) + (uint32_t)FUNC(&xboxkrnl::RtlExtendedMagicDivide), // 0x011B (283) + (uint32_t)FUNC(&xboxkrnl::RtlFillMemory), // 0x011C (284) + (uint32_t)FUNC(&xboxkrnl::RtlFillMemoryUlong), // 0x011D (285) + (uint32_t)FUNC(&xboxkrnl::RtlFreeAnsiString), // 0x011E (286) + (uint32_t)FUNC(&xboxkrnl::RtlFreeUnicodeString), // 0x011F (287) + (uint32_t)FUNC(&xboxkrnl::RtlGetCallersAddress), // 0x0120 (288) + (uint32_t)FUNC(&xboxkrnl::RtlInitAnsiString), // 0x0121 (289) + (uint32_t)FUNC(&xboxkrnl::RtlInitUnicodeString), // 0x0122 (290) + (uint32_t)FUNC(&xboxkrnl::RtlInitializeCriticalSection), // 0x0123 (291) + (uint32_t)FUNC(&xboxkrnl::RtlIntegerToChar), // 0x0124 (292) + (uint32_t)FUNC(&xboxkrnl::RtlIntegerToUnicodeString), // 0x0125 (293) + (uint32_t)FUNC(&xboxkrnl::RtlLeaveCriticalSection), // 0x0126 (294) + (uint32_t)FUNC(&xboxkrnl::RtlLeaveCriticalSectionAndRegion), // 0x0127 (295) + (uint32_t)FUNC(&xboxkrnl::RtlLowerChar), // 0x0128 (296) + (uint32_t)FUNC(&xboxkrnl::RtlMapGenericMask), // 0x0129 (297) + (uint32_t)FUNC(&xboxkrnl::RtlMoveMemory), // 0x012A (298) + (uint32_t)FUNC(&xboxkrnl::RtlMultiByteToUnicodeN), // 0x012B (299) + (uint32_t)FUNC(&xboxkrnl::RtlMultiByteToUnicodeSize), // 0x012C (300) + (uint32_t)FUNC(&xboxkrnl::RtlNtStatusToDosError), // 0x012D (301) + (uint32_t)FUNC(&xboxkrnl::RtlRaiseException), // 0x012E (302) + (uint32_t)FUNC(&xboxkrnl::RtlRaiseStatus), // 0x012F (303) + (uint32_t)FUNC(&xboxkrnl::RtlTimeFieldsToTime), // 0x0130 (304) + (uint32_t)FUNC(&xboxkrnl::RtlTimeToTimeFields), // 0x0131 (305) + (uint32_t)FUNC(&xboxkrnl::RtlTryEnterCriticalSection), // 0x0132 (306) + (uint32_t)FUNC(&xboxkrnl::RtlUlongByteSwap), // 0x0133 (307) + (uint32_t)FUNC(&xboxkrnl::RtlUnicodeStringToAnsiString), // 0x0134 (308) + (uint32_t)FUNC(&xboxkrnl::RtlUnicodeStringToInteger), // 0x0135 (309) + (uint32_t)FUNC(&xboxkrnl::RtlUnicodeToMultiByteN), // 0x0136 (310) + (uint32_t)FUNC(&xboxkrnl::RtlUnicodeToMultiByteSize), // 0x0137 (311) + (uint32_t)FUNC(&xboxkrnl::RtlUnwind), // 0x0138 (312) + (uint32_t)FUNC(&xboxkrnl::RtlUpcaseUnicodeChar), // 0x0139 (313) + (uint32_t)FUNC(&xboxkrnl::RtlUpcaseUnicodeString), // 0x013A (314) + (uint32_t)FUNC(&xboxkrnl::RtlUpcaseUnicodeToMultiByteN), // 0x013B (315) + (uint32_t)FUNC(&xboxkrnl::RtlUpperChar), // 0x013C (316) + (uint32_t)FUNC(&xboxkrnl::RtlUpperString), // 0x013D (317) + (uint32_t)FUNC(&xboxkrnl::RtlUshortByteSwap), // 0x013E (318) + (uint32_t)FUNC(&xboxkrnl::RtlWalkFrameChain), // 0x013F (319) + (uint32_t)FUNC(&xboxkrnl::RtlZeroMemory), // 0x0140 (320) + (uint32_t)VARIABLE(&xboxkrnl::XboxEEPROMKey), // 0x0141 (321) + (uint32_t)VARIABLE(&xboxkrnl::XboxHardwareInfo), // 0x0142 (322) + (uint32_t)VARIABLE(&xboxkrnl::XboxHDKey), // 0x0143 (323) + (uint32_t)VARIABLE(&xboxkrnl::XboxKrnlVersion), // 0x0144 (324) + (uint32_t)VARIABLE(&xboxkrnl::XboxSignatureKey), // 0x0145 (325) + (uint32_t)VARIABLE(&xboxkrnl::XeImageFileName), // 0x0146 (326) + (uint32_t)FUNC(&xboxkrnl::XeLoadSection), // 0x0147 (327) + (uint32_t)FUNC(&xboxkrnl::XeUnloadSection), // 0x0148 (328) + (uint32_t)FUNC(&xboxkrnl::READ_PORT_BUFFER_UCHAR), // 0x0149 (329) + (uint32_t)FUNC(&xboxkrnl::READ_PORT_BUFFER_USHORT), // 0x014A (330) + (uint32_t)FUNC(&xboxkrnl::READ_PORT_BUFFER_ULONG), // 0x014B (331) + (uint32_t)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_UCHAR), // 0x014C (332) + (uint32_t)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_USHORT), // 0x014D (333) + (uint32_t)FUNC(&xboxkrnl::WRITE_PORT_BUFFER_ULONG), // 0x014E (334) + (uint32_t)FUNC(&xboxkrnl::XcSHAInit), // 0x014F (335) + (uint32_t)FUNC(&xboxkrnl::XcSHAUpdate), // 0x0150 (336) + (uint32_t)FUNC(&xboxkrnl::XcSHAFinal), // 0x0151 (337) + (uint32_t)FUNC(&xboxkrnl::XcRC4Key), // 0x0152 (338) + (uint32_t)FUNC(&xboxkrnl::XcRC4Crypt), // 0x0153 (339) + (uint32_t)FUNC(&xboxkrnl::XcHMAC), // 0x0154 (340) + (uint32_t)FUNC(&xboxkrnl::XcPKEncPublic), // 0x0155 (341) + (uint32_t)FUNC(&xboxkrnl::XcPKDecPrivate), // 0x0156 (342) + (uint32_t)FUNC(&xboxkrnl::XcPKGetKeyLen), // 0x0157 (343) + (uint32_t)FUNC(&xboxkrnl::XcVerifyPKCS1Signature), // 0x0158 (344) + (uint32_t)FUNC(&xboxkrnl::XcModExp), // 0x0159 (345) + (uint32_t)FUNC(&xboxkrnl::XcDESKeyParity), // 0x015A (346) + (uint32_t)FUNC(&xboxkrnl::XcKeyTable), // 0x015B (347) + (uint32_t)FUNC(&xboxkrnl::XcBlockCrypt), // 0x015C (348) + (uint32_t)FUNC(&xboxkrnl::XcBlockCryptCBC), // 0x015D (349) + (uint32_t)FUNC(&xboxkrnl::XcCryptService), // 0x015E (350) + (uint32_t)FUNC(&xboxkrnl::XcUpdateCrypto), // 0x015F (351) + (uint32_t)FUNC(&xboxkrnl::RtlRip), // 0x0160 (352) + (uint32_t)VARIABLE(&xboxkrnl::XboxLANKey), // 0x0161 (353) + (uint32_t)VARIABLE(&xboxkrnl::XboxAlternateSignatureKeys), // 0x0162 (354) + (uint32_t)VARIABLE(&xboxkrnl::XePublicKeyData), // 0x0163 (355) + (uint32_t)VARIABLE(&xboxkrnl::HalBootSMCVideoMode), // 0x0164 (356) + (uint32_t)VARIABLE(&xboxkrnl::IdexChannelObject), // 0x0165 (357) + (uint32_t)FUNC(&xboxkrnl::HalIsResetOrShutdownPending), // 0x0166 (358) + (uint32_t)FUNC(&xboxkrnl::IoMarkIrpMustComplete), // 0x0167 (359) + (uint32_t)FUNC(&xboxkrnl::HalInitiateShutdown), // 0x0168 (360) + (uint32_t)FUNC(&xboxkrnl::RtlSnprintf), // 0x0169 (361) + (uint32_t)FUNC(&xboxkrnl::RtlSprintf), // 0x016A (362) + (uint32_t)FUNC(&xboxkrnl::RtlVsnprintf), // 0x016B (363) + (uint32_t)FUNC(&xboxkrnl::RtlVsprintf), // 0x016C (364) + (uint32_t)FUNC(&xboxkrnl::HalEnableSecureTrayEject), // 0x016D (365) + (uint32_t)FUNC(&xboxkrnl::HalWriteSMCScratchRegister), // 0x016E (366) + (uint32_t)FUNC(&xboxkrnl::UnknownAPI367), // 0x016F (367) + (uint32_t)FUNC(&xboxkrnl::UnknownAPI368), // 0x0170 (368) + (uint32_t)FUNC(&xboxkrnl::UnknownAPI369), // 0x0171 (369) + (uint32_t)FUNC(&xboxkrnl::XProfpControl), // 0x0172 (370) PROFILING + (uint32_t)FUNC(&xboxkrnl::XProfpGetData), // 0x0173 (371) PROFILING + (uint32_t)FUNC(&xboxkrnl::IrtClientInitFast), // 0x0174 (372) PROFILING + (uint32_t)FUNC(&xboxkrnl::IrtSweep), // 0x0175 (373) PROFILING + (uint32_t)FUNC(&xboxkrnl::MmDbgAllocateMemory), // 0x0176 (374) DEVKIT ONLY! + (uint32_t)FUNC(&xboxkrnl::MmDbgFreeMemory), // 0x0177 (375) DEVKIT ONLY! + (uint32_t)FUNC(&xboxkrnl::MmDbgQueryAvailablePages), // 0x0178 (376) DEVKIT ONLY! + (uint32_t)FUNC(&xboxkrnl::MmDbgReleaseAddress), // 0x0179 (377) DEVKIT ONLY! + (uint32_t)FUNC(&xboxkrnl::MmDbgWriteCheck), // 0x017A (378) DEVKIT ONLY! +}; diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/core/kernel/init/CxbxKrnl.cpp similarity index 67% rename from src/CxbxKrnl/CxbxKrnl.cpp rename to src/core/kernel/init/CxbxKrnl.cpp index d18d7461d..12de0dfd3 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/core/kernel/init/CxbxKrnl.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->CxbxKrnl.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,7 +25,8 @@ // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ +#define LOG_PREFIX CXBXR_MODULE::CXBXR +#define LOG_PREFIX_INIT CXBXR_MODULE::INIT /* prevent name collisions */ namespace xboxkrnl @@ -42,34 +34,37 @@ namespace xboxkrnl #include }; -#include "Cxbx\ResCxbx.h" -#include "CxbxKrnl.h" -#include "Cxbx\CxbxXbdm.h" // For Cxbx_LibXbdmThunkTable +#include "gui\ResCxbx.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "common\xbdm\CxbxXbdm.h" // For Cxbx_LibXbdmThunkTable #include "CxbxVersion.h" -#include "Emu.h" -#include "EmuX86.h" -#include "EmuFile.h" -#include "EmuFS.h" +#include "core\kernel\support\Emu.h" +#include "devices\x86\EmuX86.h" +#include "core\kernel\support\EmuFile.h" +#include "core\kernel\support\EmuFS.h" // EmuInitFS #include "EmuEEPROM.h" // For CxbxRestoreEEPROM, EEPROM, XboxFactoryGameRegion -#include "EmuKrnl.h" +#include "core\kernel\exports\EmuKrnl.h" +#include "core\kernel\exports\EmuKrnlKi.h" #include "EmuShared.h" -#include "HLEIntercept.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For CxbxInitWindow, EmuD3DInit +#include "core\hle\DSOUND\DirectSound\DirectSound.hpp" // For CxbxInitAudio +#include "core\hle\Intercept.hpp" #include "ReservedMemory.h" // For virtual_memory_placeholder -#include "VMManager.h" +#include "core\kernel\memory-manager\VMManager.h" #include "CxbxDebugger.h" -#include "EmuX86.h" -#include #include #include -#include #include // For time() #include // For std::ostringstream #include "devices\EEPROMDevice.h" // For g_EEPROM #include "devices\Xbox.h" // For InitXboxHardware() #include "devices\LED.h" // For LED::Sequence -#include "EmuSha.h" // For the SHA1 functions +#include "devices\SMCDevice.h" // For SMC Access +#include "common\crypto\EmuSha.h" // For the SHA1 functions +#include "Timer.h" // For Timer_Init +#include "common\input\InputManager.h" // For the InputDeviceManager /*! thread local storage */ Xbe::TLS *CxbxKrnl_TLS = NULL; @@ -88,13 +83,14 @@ std::string CxbxKrnl_DebugFileName = ""; Xbe::Certificate *g_pCertificate = NULL; /*! thread handles */ -static HANDLE g_hThreads[MAXIMUM_XBOX_THREADS] = { 0 }; +static std::vector g_hThreads; char szFilePath_CxbxReloaded_Exe[MAX_PATH] = { 0 }; char szFolder_CxbxReloadedData[MAX_PATH] = { 0 }; char szFilePath_EEPROM_bin[MAX_PATH] = { 0 }; char szFilePath_memory_bin[MAX_PATH] = { 0 }; char szFilePath_page_tables[MAX_PATH] = { 0 }; +char szFilePath_Xbe[MAX_PATH*2] = { 0 }; // NOTE: LAUNCH_DATA_HEADER's szLaunchPath is MAX_PATH*2 = 520 std::string CxbxBasePath; HANDLE CxbxBasePathHandle; @@ -106,6 +102,9 @@ bool g_bIsRetail = false; DWORD_PTR g_CPUXbox = 0; DWORD_PTR g_CPUOthers = 0; +// Indicates to disable/enable all interrupts when cli and sti instructions are executed +std::atomic_bool g_bEnableAllInterrupts = true; + // Set by the VMManager during initialization. Exported because it's needed in other parts of the emu size_t g_SystemMaxMemory = 0; @@ -194,7 +193,7 @@ void CxbxLaunchXbe(void(*Entry)()) } __except (EmuException(GetExceptionInformation())) { - EmuWarning("Problem with ExceptionFilter"); + EmuLog(LOG_LEVEL::WARNING, "Problem with ExceptionFilter"); } } @@ -315,7 +314,7 @@ HANDLE CxbxRestoreContiguousMemory(char *szFilePath_memory_bin) /* hTemplateFile */nullptr); if (hFile == INVALID_HANDLE_VALUE) { - CxbxKrnlCleanup("CxbxRestoreContiguousMemory : Couldn't create memory.bin file!\n"); + CxbxKrnlCleanup("%s : Couldn't create memory.bin file!\n", __func__); return nullptr; } } @@ -333,7 +332,7 @@ HANDLE CxbxRestoreContiguousMemory(char *szFilePath_memory_bin) /**/nullptr); if (hFileMapping == NULL) { - CxbxKrnlCleanup("CxbxRestoreContiguousMemory : Couldn't create contiguous memory.bin file mapping!\n"); + CxbxKrnlCleanup("%s : Couldn't create contiguous memory.bin file mapping!\n", __func__); return nullptr; } @@ -342,7 +341,7 @@ HANDLE CxbxRestoreContiguousMemory(char *szFilePath_memory_bin) unsigned int FileSize = len_li.u.LowPart; if (FileSize != CHIHIRO_MEMORY_SIZE) { - CxbxKrnlCleanup("CxbxRestoreContiguousMemory : memory.bin file is not 128 MiB large!\n"); + CxbxKrnlCleanup("%s : memory.bin file is not 128 MiB large!\n", __func__); return nullptr; } @@ -359,24 +358,24 @@ HANDLE CxbxRestoreContiguousMemory(char *szFilePath_memory_bin) if (memory) UnmapViewOfFile(memory); - CxbxKrnlCleanup("CxbxRestoreContiguousMemory: Couldn't map contiguous memory.bin to 0x80000000!"); + CxbxKrnlCleanup("%s: Couldn't map contiguous memory.bin to 0x80000000!", __func__); return nullptr; } - printf("[0x%.4X] INIT: Mapped %d MiB of Xbox contiguous memory at 0x%.8X to 0x%.8X\n", - GetCurrentThreadId(), CONTIGUOUS_MEMORY_CHIHIRO_SIZE / ONE_MB, CONTIGUOUS_MEMORY_BASE, CONTIGUOUS_MEMORY_BASE + CONTIGUOUS_MEMORY_CHIHIRO_SIZE - 1); + EmuLogInit(LOG_LEVEL::INFO, "Mapped %d MiB of Xbox contiguous memory at 0x%.8X to 0x%.8X", + CONTIGUOUS_MEMORY_CHIHIRO_SIZE / ONE_MB, CONTIGUOUS_MEMORY_BASE, CONTIGUOUS_MEMORY_BASE + CONTIGUOUS_MEMORY_CHIHIRO_SIZE - 1); if (NeedsInitialization) { memset(memory, 0, CONTIGUOUS_MEMORY_CHIHIRO_SIZE); - printf("[0x%.4X] INIT: Initialized contiguous memory\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Initialized contiguous memory"); } else - printf("[0x%.4X] INIT: Loaded contiguous memory.bin\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Loaded contiguous memory.bin"); size_t tiledMemorySize = XBOX_WRITE_COMBINED_SIZE; if (g_bIsWine) { - printf("Wine detected: Using 64MB Tiled Memory Size\n"); + EmuLogInit(LOG_LEVEL::INFO, "Wine detected: Using 64MB Tiled Memory Size"); // TODO: Figure out why Wine needs this and Windows doesn't. // Perhaps it's a Wine bug, or perhaps Wine reserves this memory for it's own usage? tiledMemorySize = XBOX_WRITE_COMBINED_SIZE / 2; @@ -396,12 +395,12 @@ HANDLE CxbxRestoreContiguousMemory(char *szFilePath_memory_bin) if (tiled_memory) UnmapViewOfFile(tiled_memory); - CxbxKrnlCleanup("CxbxRestoreContiguousMemory: Couldn't map contiguous memory.bin into tiled memory at 0xF0000000!"); + CxbxKrnlCleanup("%s: Couldn't map contiguous memory.bin into tiled memory at 0xF0000000!", __func__); return nullptr; } - printf("[0x%.4X] INIT: Mapped contiguous memory to Xbox tiled memory at 0x%.8X to 0x%.8X\n", - GetCurrentThreadId(), XBOX_WRITE_COMBINED_BASE, XBOX_WRITE_COMBINED_BASE + tiledMemorySize - 1); + EmuLogInit(LOG_LEVEL::INFO, "Mapped contiguous memory to Xbox tiled memory at 0x%.8X to 0x%.8X", + XBOX_WRITE_COMBINED_BASE, XBOX_WRITE_COMBINED_BASE + tiledMemorySize - 1); return hFileMapping; @@ -431,7 +430,7 @@ HANDLE CxbxRestorePageTablesMemory(char* szFilePath_page_tables) /* hTemplateFile */nullptr); if (hFile == INVALID_HANDLE_VALUE) { - CxbxKrnlCleanup("CxbxRestorePageTablesMemory : Couldn't create PageTables.bin file!\n"); + CxbxKrnlCleanup("%s : Couldn't create PageTables.bin file!\n", __func__); } } @@ -448,7 +447,7 @@ HANDLE CxbxRestorePageTablesMemory(char* szFilePath_page_tables) /**/nullptr); if (hFileMapping == NULL) { - CxbxKrnlCleanup("CxbxRestorePageTablesMemory : Couldn't create PageTables.bin file mapping!\n"); + CxbxKrnlCleanup("%s : Couldn't create PageTables.bin file mapping!\n", __func__); } LARGE_INTEGER len_li; @@ -456,7 +455,7 @@ HANDLE CxbxRestorePageTablesMemory(char* szFilePath_page_tables) unsigned int FileSize = len_li.u.LowPart; if (FileSize != PAGE_TABLES_SIZE) { - CxbxKrnlCleanup("CxbxRestorePageTablesMemory : PageTables.bin file is not 4 MiB large!\n"); + CxbxKrnlCleanup("%s : PageTables.bin file is not 4 MiB large!\n", __func__); } // Map PageTables.bin contents into memory : @@ -472,26 +471,26 @@ HANDLE CxbxRestorePageTablesMemory(char* szFilePath_page_tables) if (memory) UnmapViewOfFile(memory); - CxbxKrnlCleanup("CxbxRestorePageTablesMemory: Couldn't map PageTables.bin to 0xC0000000!"); + CxbxKrnlCleanup("%s: Couldn't map PageTables.bin to 0xC0000000!", __func__); } - printf("[0x%.4X] INIT: Mapped %d MiB of Xbox page tables memory at 0x%.8X to 0x%.8X\n", - GetCurrentThreadId(), 4, PAGE_TABLES_BASE, PAGE_TABLES_END); + EmuLogInit(LOG_LEVEL::INFO, "Mapped %d MiB of Xbox page tables memory at 0x%.8X to 0x%.8X", + 4, PAGE_TABLES_BASE, PAGE_TABLES_END); if (NeedsInitialization) { memset(memory, 0, 4 * ONE_MB); - printf("[0x%.4X] INIT: Initialized page tables memory\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Initialized page tables memory"); } else - printf("[0x%.4X] INIT: Loaded PageTables.bin\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Loaded PageTables.bin"); return hFileMapping; } #pragma optimize("", off) -void CxbxPopupMessage(CxbxMsgDlgIcon icon, const char *message, ...) +void CxbxPopupMessageEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, CxbxMsgDlgIcon icon, const char *message, ...) { char Buffer[1024]; va_list argp; @@ -521,41 +520,15 @@ void CxbxPopupMessage(CxbxMsgDlgIcon icon, const char *message, ...) vsprintf(Buffer, message, argp); va_end(argp); - EmuWarning("Popup : %s\n", Buffer); + EmuLogEx(cxbxr_module, level, "Popup : %s", Buffer); + MessageBox(NULL, Buffer, TEXT("Cxbx-Reloaded"), uType); } void PrintCurrentConfigurationLog() { - // Print environment information - { - // Get Windows Version - DWORD dwVersion = 0; - DWORD dwMajorVersion = 0; - DWORD dwMinorVersion = 0; - DWORD dwBuild = 0; - - // TODO: GetVersion is deprecated but we use it anyway (for now) - // The correct solution is to use GetProductInfo but that function - // requires more logic to parse the response, and I didn't feel - // like building it just yet :P - dwVersion = GetVersion(); - - dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); - dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); - - // Get the build number. - if (dwVersion < 0x80000000) { - dwBuild = (DWORD)(HIWORD(dwVersion)); - } - - printf("------------------------ENVIRONMENT DETAILS-------------------------\n"); - if (g_bIsWine) { - printf("Wine %s\n", wine_get_version()); - printf("Presenting as Windows %d.%d (%d)\n", dwMajorVersion, dwMinorVersion, dwBuild); - } else { - printf("Windows %d.%d (%d)\n", dwMajorVersion, dwMinorVersion, dwBuild); - } + if (g_bIsWine) { + EmuLogInit(LOG_LEVEL::INFO, "Running under Wine Version %s", wine_get_version()); } // HACK: For API TRace.. @@ -563,49 +536,56 @@ void PrintCurrentConfigurationLog() // Print current LLE configuration { - printf("---------------------------- LLE CONFIG ----------------------------\n"); - printf("LLE for APU is %s\n", bLLE_APU ? "enabled" : "disabled"); - printf("LLE for GPU is %s\n", bLLE_GPU ? "enabled" : "disabled"); - printf("LLE for JIT is %s\n", bLLE_JIT ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "---------------------------- LLE CONFIG ----------------------------"); + EmuLogInit(LOG_LEVEL::INFO, "LLE for APU is %s", bLLE_APU ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "LLE for GPU is %s", bLLE_GPU ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "LLE for USB is %s", bLLE_USB ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "LLE for JIT is %s", bLLE_JIT ? "enabled" : "disabled"); } // Print current video configuration (DirectX/HLE) if (!bLLE_GPU) { - XBVideo XBVideoConf; - g_EmuShared->GetXBVideo(&XBVideoConf); + Settings::s_video XBVideoConf; + g_EmuShared->GetVideoSettings(&XBVideoConf); - printf("--------------------------- VIDEO CONFIG ---------------------------\n"); - printf("Direct3D Device: %s\n", XBVideoConf.GetDirect3DDevice() == 0 ? "Direct3D HAL (Hardware Accelerated)" : "Direct3D REF (Software)"); - printf("Video Resolution: %s\n", XBVideoConf.GetVideoResolution()); - printf("Force VSync is %s\n", XBVideoConf.GetVSync() ? "enabled" : "disabled"); - printf("Fullscreen is %s\n", XBVideoConf.GetFullscreen() ? "enabled" : "disabled"); - printf("Hardware YUV is %s\n", XBVideoConf.GetHardwareYUV() ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "--------------------------- VIDEO CONFIG ---------------------------"); + EmuLogInit(LOG_LEVEL::INFO, "Direct3D Device: %s", XBVideoConf.direct3DDevice == 0 ? "Direct3D HAL (Hardware Accelerated)" : "Direct3D REF (Software)"); + EmuLogInit(LOG_LEVEL::INFO, "Video Resolution: %s", XBVideoConf.szVideoResolution); + EmuLogInit(LOG_LEVEL::INFO, "Force VSync is %s", XBVideoConf.bVSync ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "Fullscreen is %s", XBVideoConf.bFullScreen ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "Hardware YUV is %s", XBVideoConf.bHardwareYUV ? "enabled" : "disabled"); } // Print current audio configuration { - XBAudio XBAudioConf; - g_EmuShared->GetXBAudio(&XBAudioConf); + Settings::s_audio XBAudioConf; + g_EmuShared->GetAudioSettings(&XBAudioConf); - printf("--------------------------- AUDIO CONFIG ---------------------------\n"); - printf("Audio Adapter: %s\n", XBAudioConf.GetAudioAdapter().Data1 == 0 ? "Primary Audio Device" : "Secondary Audio Device"); - printf("PCM is %s\n", XBAudioConf.GetPCM() ? "enabled" : "disabled"); - printf("XADPCM is %s\n", XBAudioConf.GetXADPCM() ? "enabled" : "disabled"); - printf("Unknown Codec is %s\n", XBAudioConf.GetUnknownCodec() ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "--------------------------- AUDIO CONFIG ---------------------------"); + EmuLogInit(LOG_LEVEL::INFO, "Audio Adapter: %s", XBAudioConf.adapterGUID.Data1 == 0 ? "Primary Audio Device" : "Secondary Audio Device"); + EmuLogInit(LOG_LEVEL::INFO, "PCM is %s", XBAudioConf.codec_pcm ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "XADPCM is %s", XBAudioConf.codec_xadpcm ? "enabled" : "disabled"); + EmuLogInit(LOG_LEVEL::INFO, "Unknown Codec is %s", XBAudioConf.codec_unknown ? "enabled" : "disabled"); + } + + // Print current network configuration + { + Settings::s_network XBNetworkConf; + g_EmuShared->GetNetworkSettings(&XBNetworkConf); + + EmuLogInit(LOG_LEVEL::INFO, "--------------------------- NETWORK CONFIG -------------------------"); + EmuLogInit(LOG_LEVEL::INFO, "Network Adapter Name: %s", strlen(XBNetworkConf.adapter_name) == 0 ? "Not Configured" : XBNetworkConf.adapter_name); } // Print Enabled Hacks { - printf("--------------------------- HACKS CONFIG ---------------------------\n"); - printf("Disable Pixel Shaders: %s\n", g_DisablePixelShaders == 1 ? "On" : "Off (Default)"); - printf("Uncap Framerate: %s\n", g_UncapFramerate == 1 ? "On" : "Off (Default)"); - printf("Run Xbox threads on all cores: %s\n", g_UseAllCores == 1 ? "On" : "Off (Default)"); - printf("Skip RDTSC Patching: %s\n", g_SkipRdtscPatching == 1 ? "On" : "Off (Default)"); - printf("Scale Xbox to host viewport (and back): %s\n", g_ScaleViewport == 1 ? "On" : "Off (Default)"); - printf("Render directly to Host BackBuffer: %s\n", g_DirectHostBackBufferAccess == 1 ? "On (Default)" : "Off"); + EmuLogInit(LOG_LEVEL::INFO, "--------------------------- HACKS CONFIG ---------------------------"); + EmuLogInit(LOG_LEVEL::INFO, "Disable Pixel Shaders: %s", g_DisablePixelShaders == 1 ? "On" : "Off (Default)"); + EmuLogInit(LOG_LEVEL::INFO, "Run Xbox threads on all cores: %s", g_UseAllCores == 1 ? "On" : "Off (Default)"); + EmuLogInit(LOG_LEVEL::INFO, "Skip RDTSC Patching: %s", g_SkipRdtscPatching == 1 ? "On" : "Off (Default)"); } - printf("------------------------- END OF CONFIG LOG ------------------------\n"); + EmuLogInit(LOG_LEVEL::INFO, "------------------------- END OF CONFIG LOG ------------------------"); } @@ -651,6 +631,7 @@ void TriggerPendingConnectedInterrupts() if (HalSystemInterrupts[i].IsPending() && EmuInterruptList[i] && EmuInterruptList[i]->Connected) { HalSystemInterrupts[i].Trigger(EmuInterruptList[i]); } + SwitchToThread(); } } @@ -666,35 +647,73 @@ static unsigned int WINAPI CxbxKrnlInterruptThread(PVOID param) #endif while (true) { - TriggerPendingConnectedInterrupts(); + if (g_bEnableAllInterrupts) { + TriggerPendingConnectedInterrupts(); + } Sleep(1); } return 0; } +static void CxbxKrnlClockThread(void* pVoid) +{ + LARGE_INTEGER CurrentTicks; + uint64_t Delta; + uint64_t Microseconds; + unsigned int IncrementScaling; + static uint64_t LastTicks = 0; + static uint64_t Error = 0; + static uint64_t UnaccountedMicroseconds = 0; + + // This keeps track of how many us have elapsed between two cycles, so that the xbox clocks are updated + // with the proper increment (instead of blindly adding a single increment at every step) + + if (LastTicks == 0) { + QueryPerformanceCounter(&CurrentTicks); + LastTicks = CurrentTicks.QuadPart; + CurrentTicks.QuadPart = 0; + } + + QueryPerformanceCounter(&CurrentTicks); + Delta = CurrentTicks.QuadPart - LastTicks; + LastTicks = CurrentTicks.QuadPart; + + Error += (Delta * SCALE_S_IN_US); + Microseconds = Error / HostClockFrequency; + Error -= (Microseconds * HostClockFrequency); + + UnaccountedMicroseconds += Microseconds; + IncrementScaling = (unsigned int)(UnaccountedMicroseconds / 1000); // -> 1 ms = 1000us -> time between two xbox clock interrupts + UnaccountedMicroseconds -= (IncrementScaling * 1000); + + xboxkrnl::KiClockIsr(IncrementScaling); +} + std::vector g_RdtscPatches; +#define OPCODE_PATCH_RDTSC 0x90EF // OUT DX, EAX; NOP + bool IsRdtscInstruction(xbaddr addr) { - if (std::find(g_RdtscPatches.begin(), g_RdtscPatches.end(), addr) != g_RdtscPatches.end()) { - return true; - } - - return false; + // First the fastest check - does addr contain exact patch from PatchRdtsc? + // Second check - is addr on the rdtsc patch list? + return (*(uint16_t*)addr == OPCODE_PATCH_RDTSC) + // Note : It's not needed to check for g_SkipRdtscPatching, + // as when that's set, the g_RdtscPatches vector will be empty + // anyway, failing this lookup : + && (std::find(g_RdtscPatches.begin(), g_RdtscPatches.end(), addr) != g_RdtscPatches.end()); } void PatchRdtsc(xbaddr addr) { - uint8_t* opAddr = (uint8_t*)addr; // Patch away rdtsc with an opcode we can intercept // We use a privilaged instruction rather than int 3 for debugging // When using int 3, attached debuggers trap and rdtsc is used often enough // that it makes Cxbx-Reloaded unusable // A privilaged instruction (like OUT) does not suffer from this - printf("INIT: Patching rdtsc opcode at 0x%.8X\n", (DWORD)addr); - opAddr[0] = 0xEF; // OUT DX, EAX - opAddr[1] = 0x90; // NOP + EmuLogInit(LOG_LEVEL::DEBUG, "Patching rdtsc opcode at 0x%.8X", (DWORD)addr); + *(uint16_t*)addr = OPCODE_PATCH_RDTSC; g_RdtscPatches.push_back(addr); } @@ -738,7 +757,7 @@ void PatchRdtscInstructions() DWORD sizeOfImage = CxbxKrnl_XbeHeader->dwSizeofImage; // Iterate through each CODE section - for (uint32 sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { + for (uint32_t sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { if (!CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwFlags.bExecutable) { continue; } @@ -754,7 +773,7 @@ void PatchRdtscInstructions() continue; } - printf("INIT: Searching for rdtsc in section %s\n", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); + EmuLogInit(LOG_LEVEL::INFO, "Searching for rdtsc in section %s", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); xbaddr startAddr = CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwVirtualAddr; //rdtsc is two bytes instruction, it needs at least one opcode byte after it to finish a function, so the endAddr need to substract 3 bytes. xbaddr endAddr = startAddr + CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwSizeofRaw-3; @@ -773,7 +792,7 @@ void PatchRdtscInstructions() { if (*(uint8_t*)(addr - 2) == 0x88 && *(uint8_t*)(addr - 1) == 0x5C) { - printf("Skipped false positive: rdtsc pattern 0x%.2X, @ 0x%.8X\n", next_byte, (DWORD)addr); + EmuLogInit(LOG_LEVEL::INFO, "Skipped false positive: rdtsc pattern 0x%.2X, @ 0x%.8X", next_byte, (DWORD)addr); continue; } @@ -782,7 +801,7 @@ void PatchRdtscInstructions() { if (*(uint8_t*)(addr - 2) == 0x83 && *(uint8_t*)(addr - 1) == 0xE2) { - printf("Skipped false positive: rdtsc pattern 0x%.2X, @ 0x%.8X\n", next_byte, (DWORD)addr); + EmuLogInit(LOG_LEVEL::INFO, "Skipped false positive: rdtsc pattern 0x%.2X, @ 0x%.8X", next_byte, (DWORD)addr); continue; } @@ -797,16 +816,16 @@ void PatchRdtscInstructions() if (i>= sizeof_rdtsc_pattern) { //no pattern matched, keep record for detections we treat as non-rdtsc for future debugging. - printf("Skipped potential rdtsc: Unknown opcode pattern 0x%.2X, @ 0x%.8X\n", next_byte, (DWORD)addr); + EmuLogInit(LOG_LEVEL::INFO, "Skipped potential rdtsc: Unknown opcode pattern 0x%.2X, @ 0x%.8X", next_byte, (DWORD)addr); } } } } - printf("INIT: Done patching rdtsc, total %d rdtsc instructions patched\n", g_RdtscPatches.size()); + EmuLogInit(LOG_LEVEL::INFO, "Done patching rdtsc, total %d rdtsc instructions patched", g_RdtscPatches.size()); } -void MapThunkTable(uint32_t* kt, uint32* pThunkTable) +void MapThunkTable(uint32_t* kt, uint32_t* pThunkTable) { const bool SendDebugReports = (pThunkTable == CxbxKrnl_KernelThunkTable) && CxbxDebugger::CanReport(); @@ -840,7 +859,8 @@ void ImportLibraries(XbeImportEntry *pImportDirectory) MapThunkTable((uint32_t *)pImportDirectory->ThunkAddr, Cxbx_LibXbdmThunkTable); } else { - printf("LOAD : Skipping unrecognized import library : %s\n", LibName.c_str()); + // TODO: replace wprintf to EmuLogInit, how? + wprintf(L"LOAD : Skipping unrecognized import library : %s\n", LibName.c_str()); } pImportDirectory++; @@ -851,26 +871,29 @@ void CxbxKrnlMain(int argc, char* argv[]) { // Skip '/load' switch // Get XBE Name : - std::string xbePath = argv[2]; + std::string xbePath = std::filesystem::absolute(std::filesystem::path(argv[2])).string(); // Get DCHandle : HWND hWnd = 0; - if (argc > 2) { - hWnd = (HWND)StrToInt(argv[3]); + if (argc > 3) { + hWnd = (HWND)std::atoi(argv[3]); } // Get KernelDebugMode : DebugMode DbgMode = DebugMode::DM_NONE; - if (argc > 3) { - DbgMode = (DebugMode)StrToInt(argv[4]); + if (argc > 4) { + DbgMode = (DebugMode)std::atoi(argv[4]); } // Get KernelDebugFileName : std::string DebugFileName = ""; - if (argc > 4) { + if (argc > 5) { DebugFileName = argv[5]; } + int BootFlags; + g_EmuShared->GetBootFlags(&BootFlags); + // debug console allocation (if configured) if (DbgMode == DM_CONSOLE) { @@ -891,10 +914,15 @@ void CxbxKrnlMain(int argc, char* argv[]) else { FreeConsole(); - if (DbgMode == DM_FILE) - freopen(DebugFileName.c_str(), "wt", stdout); - else - { + if (DbgMode == DM_FILE) { + // Peform clean write to kernel log for first boot. Unless multi-xbe boot occur then perform append to existing log. + freopen(DebugFileName.c_str(), ((BootFlags == DebugMode::DM_NONE) ? "wt" : "at"), stdout); + // Append separator for better readability after reboot. + if (BootFlags != DebugMode::DM_NONE) { + std::cout << "\n------REBOOT------REBOOT------REBOOT------REBOOT------REBOOT------\n" << std::endl; + } + } + else { char buffer[16]; if (GetConsoleTitle(buffer, 16) != NULL) freopen("nul", "w", stdout); @@ -906,8 +934,11 @@ void CxbxKrnlMain(int argc, char* argv[]) g_CurrentProcessHandle = GetCurrentProcess(); // OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()); + // Set up the logging variables for the kernel process during initialization. + log_sync_config(); + if (CxbxKrnl_hEmuParent != NULL) { - SendMessage(CxbxKrnl_hEmuParent, WM_PARENTNOTIFY, MAKELONG(WM_USER, ID_KRNL_IS_READY), GetCurrentProcessId()); + ipc_send_gui_update(IPC_UPDATE_GUI::KRNL_IS_READY, static_cast(GetCurrentProcessId())); // Force wait until GUI process is ready do { @@ -923,7 +954,7 @@ void CxbxKrnlMain(int argc, char* argv[]) Sleep(100); } if (!isReady) { - EmuWarning("GUI process is not ready!"); + EmuLog(LOG_LEVEL::WARNING, "GUI process is not ready!"); int mbRet = MessageBox(NULL, "GUI process is not ready, do you wish to retry?", TEXT("Cxbx-Reloaded"), MB_ICONWARNING | MB_RETRYCANCEL | MB_TOPMOST | MB_SETFOREGROUND); if (mbRet == IDRETRY) { @@ -958,8 +989,9 @@ void CxbxKrnlMain(int argc, char* argv[]) CxbxKrnlShutDown(); } - int BootFlags = BOOT_NONE; - g_EmuShared->GetBootFlags(&BootFlags); + bool isLogEnabled; + g_EmuShared->GetIsKrnlLogEnabled(&isLogEnabled); + g_bPrintfOn = isLogEnabled; g_EmuShared->ResetKrnl(); @@ -968,21 +1000,26 @@ void CxbxKrnlMain(int argc, char* argv[]) // Write a header to the log { - printf("[0x%.4X] INIT: Cxbx-Reloaded Version %s\n", GetCurrentThreadId(), _CXBX_VERSION); + EmuLogInit(LOG_LEVEL::INFO, "Cxbx-Reloaded Version %s", CxbxVersionStr); time_t startTime = time(nullptr); struct tm* tm_info = localtime(&startTime); char timeString[26]; strftime(timeString, 26, "%F %T", tm_info); - printf("[0x%.4X] INIT: Log started at %s\n", GetCurrentThreadId(), timeString); + EmuLogInit(LOG_LEVEL::INFO, "Log started at %s", timeString); #ifdef _DEBUG_TRACE - printf("[0x%.4X] INIT: Debug Trace Enabled.\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Debug Trace Enabled."); #else - printf("[0x%.4X] INIT: Debug Trace Disabled.\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Debug Trace Disabled."); #endif } + // Log once, since multi-xbe boot is appending to file instead of overwrite. + if (BootFlags == BOOT_NONE) { + log_generate_active_filter_output(CXBXR_MODULE::INIT); + } + // Detect Wine g_bIsWine = false; HMODULE hNtDll = GetModuleHandle("ntdll.dll"); @@ -1007,14 +1044,14 @@ void CxbxKrnlMain(int argc, char* argv[]) // verify base of code of our executable is 0x00001000 if (ExeNtHeader->OptionalHeader.BaseOfCode != CXBX_BASE_OF_CODE) { - CxbxPopupMessage(CxbxMsgDlgIcon_Error, "Cxbx-Reloaded executuable requires it's base of code to be 0x00001000"); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, "Cxbx-Reloaded executuable requires it's base of code to be 0x00001000"); return; // TODO : Halt(0); } // verify virtual_memory_placeholder is located at 0x00011000 if ((UINT_PTR)(&(virtual_memory_placeholder[0])) != (XBE_IMAGE_BASE + CXBX_BASE_OF_CODE)) { - CxbxPopupMessage(CxbxMsgDlgIcon_Error, "virtual_memory_placeholder is not loaded to base address 0x00011000 (which is a requirement for Xbox emulation)"); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, "virtual_memory_placeholder is not loaded to base address 0x00011000 (which is a requirement for Xbox emulation)"); return; // TODO : Halt(0); } @@ -1055,7 +1092,7 @@ void CxbxKrnlMain(int argc, char* argv[]) EEPROM = CxbxRestoreEEPROM(szFilePath_EEPROM_bin); if (EEPROM == nullptr) { - CxbxPopupMessage(CxbxMsgDlgIcon_Error, "Couldn't init EEPROM!"); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, "Couldn't init EEPROM!"); return; // TODO : Halt(0); } @@ -1065,8 +1102,32 @@ void CxbxKrnlMain(int argc, char* argv[]) // Now we can load and run the XBE : // MapAndRunXBE(XbePath, DCHandle); { - // Load Xbe (this one will reside above WinMain's virtual_memory_placeholder) - g_EmuShared->SetXbePath(xbePath.c_str()); + // NOTE: This is a safety to clean the file path for any malicious file path attempt. + // Might want to move this into a utility function. + size_t n, i; + // Remove useless slashes before and after semicolon. + std::string semicolon_search[] = { "\\;", ";\\", "/;", ";/" }; + std::string semicolon_str = ";"; + for (n = 0, i = 0; i < semicolon_search->size(); i++, n = 0) { + while ((n = xbePath.find(semicolon_search[i], n)) != std::string::npos) { + xbePath.replace(n, semicolon_search[i].size(), semicolon_str); + n += semicolon_str.size(); + } + } + // Remove extra slashes. + std::string slash_search[] = { "\\\\", "//" }; + std::string slash_str = "/"; + for (n = 0, i = 0; i < slash_search->size(); i++, n = 0) { + while ((n = xbePath.find(slash_search[i], n)) != std::string::npos) { + xbePath.replace(n, slash_search[i].size(), slash_str); + n += slash_str.size(); + } + } + + // Once clean up process is done, proceed set to global variable string. + strncpy(szFilePath_Xbe, xbePath.c_str(), MAX_PATH - 1); + std::replace(xbePath.begin(), xbePath.end(), ';', '/'); + // Load Xbe (this one will reside above WinMain's virtual_memory_placeholder) CxbxKrnl_Xbe = new Xbe(xbePath.c_str(), false); // TODO : Instead of using the Xbe class, port Dxbx _ReadXbeBlock() if (CxbxKrnl_Xbe->HasFatalError()) { @@ -1076,15 +1137,15 @@ void CxbxKrnlMain(int argc, char* argv[]) // Check the signature of the xbe if (CxbxKrnl_Xbe->CheckXbeSignature()) { - printf("[0x%X] INIT: Valid xbe signature. Xbe is legit\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Valid xbe signature. Xbe is legit"); } else { - EmuWarning("Invalid xbe signature. Homebrew, tampered or pirated xbe?"); + EmuLogInit(LOG_LEVEL::WARNING, "Invalid xbe signature. Homebrew, tampered or pirated xbe?"); } // Check the integrity of the xbe sections - for (uint32 sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { - uint32 RawSize = CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwSizeofRaw; + for (uint32_t sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { + uint32_t RawSize = CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwSizeofRaw; if (RawSize == 0) { continue; } @@ -1092,10 +1153,10 @@ void CxbxKrnlMain(int argc, char* argv[]) CalcSHA1Hash(SHADigest, CxbxKrnl_Xbe->m_bzSection[sectionIndex], RawSize); if (memcmp(SHADigest, (CxbxKrnl_Xbe->m_SectionHeader)[sectionIndex].bzSectionDigest, A_SHA_DIGEST_LEN) != 0) { - EmuWarning("SHA hash of section %s doesn't match, possible section corruption", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); + EmuLogInit(LOG_LEVEL::WARNING, "SHA hash of section %s doesn't match, possible section corruption", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); } else { - printf("[0x%X] INIT: SHA hash check of section %s successful\n", GetCurrentThreadId(), CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); + EmuLogInit(LOG_LEVEL::INFO, "SHA hash check of section %s successful", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); } } @@ -1107,7 +1168,23 @@ void CxbxKrnlMain(int argc, char* argv[]) g_bIsDebug = (g_XbeType == xtDebug); g_bIsRetail = (g_XbeType == xtRetail); + // Disabled: The media board rom fails to run because it REQUIRES LLE USB, which is not yet enabled. + // Chihiro games can be ran directly for now. + // This just means that you cannot access the Chihiro test menus and related stuff, games should still be okay +#if 0 + // If the Xbe is Chihiro, and we were not launched by SEGABOOT, we need to load SEGABOOT from the Chihiro Media Board rom instead! + // TODO: We also need to store the path of the loaded game, and mount it as the mediaboard filesystem + // TODO: How to we detect who launched us, to prevent a reboot-loop + if (g_bIsChihiro) { + std::string chihiroMediaBoardRom = std::string(szFolder_CxbxReloadedData) + std::string("/EmuDisk/") + MediaBoardRomFile; + if (!std::filesystem::exists(chihiroMediaBoardRom)) { + CxbxKrnlCleanup("Chihiro Media Board ROM (fpr21042_m29w160et.bin) could not be found"); + } + delete CxbxKrnl_Xbe; + CxbxKrnl_Xbe = new Xbe(chihiroMediaBoardRom.c_str(), false); + } +#endif // Initialize the virtual manager g_VMManager.Initialize(hMemoryBin, hPageTables, BootFlags); @@ -1123,11 +1200,11 @@ void CxbxKrnlMain(int argc, char* argv[]) // Load all sections marked as preload using the in-memory copy of the xbe header xboxkrnl::PXBEIMAGE_SECTION sectionHeaders = (xboxkrnl::PXBEIMAGE_SECTION)CxbxKrnl_Xbe->m_Header.dwSectionHeadersAddr; - for (uint32 i = 0; i < CxbxKrnl_Xbe->m_Header.dwSections; i++) { + for (uint32_t i = 0; i < CxbxKrnl_Xbe->m_Header.dwSections; i++) { if ((sectionHeaders[i].Flags & XBEIMAGE_SECTION_PRELOAD) != 0) { NTSTATUS result = xboxkrnl::XeLoadSection(§ionHeaders[i]); if (FAILED(result)) { - CxbxKrnlCleanup("Failed to preload XBE section: %s", CxbxKrnl_Xbe->m_szSectionName[i]); + EmuLogInit(LOG_LEVEL::WARNING, "Failed to preload XBE section: %s", CxbxKrnl_Xbe->m_szSectionName[i]); } } } @@ -1137,10 +1214,27 @@ void CxbxKrnlMain(int argc, char* argv[]) // Restore enough of the executable image headers to keep WinAPI's working : RestoreExeImageHeader(); + + // HACK: Attempt to patch out XBE header reads + // This works by searching for the XBEH signature and replacing it with what appears in host address space instead + // Test case: Half Life 2 + // Iterate through each CODE section + for (uint32_t sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { + if (!CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwFlags.bExecutable) { + continue; + } + + EmuLogInit(LOG_LEVEL::INFO, "Searching for XBEH in section %s", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); + xbaddr startAddr = CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwVirtualAddr; + xbaddr endAddr = startAddr + CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwSizeofRaw; + for (xbaddr addr = startAddr; addr < endAddr; addr++) { + if (*(uint32_t*)addr == 0x48454258) { + EmuLogInit(LOG_LEVEL::INFO, "Patching XBEH at 0x%08X", addr); + *((uint32_t*)addr) = *(uint32_t*)XBE_IMAGE_BASE; + } + } + } } - - // Before readout, make sure our kernel thunk table references the Windows host timer addresses : - ConnectWindowsTimersToThunkTable(); // Decode kernel thunk table address : uint32_t kt = CxbxKrnl_Xbe->m_Header.dwKernelImageThunkAddr; @@ -1202,7 +1296,7 @@ void LoadXboxKeys(std::string path) memcpy(xboxkrnl::XboxCertificateKey, &keys[1], xboxkrnl::XBOX_KEY_LENGTH); } else { - EmuWarning("Keys.bin has an incorrect filesize. Should be %d bytes", xboxkrnl::XBOX_KEY_LENGTH * 2); + EmuLog(LOG_LEVEL::WARNING, "Keys.bin has an incorrect filesize. Should be %d bytes", xboxkrnl::XBOX_KEY_LENGTH * 2); } fclose(fp); @@ -1210,7 +1304,7 @@ void LoadXboxKeys(std::string path) } // If we didn't already exit the function, keys.bin could not be loaded - EmuWarning("Failed to load Keys.bin. Cxbx-Reloaded will be unable to read Save Data from a real Xbox"); + EmuLog(LOG_LEVEL::WARNING, "Failed to load Keys.bin. Cxbx-Reloaded will be unable to read Save Data from a real Xbox"); } __declspec(noreturn) void CxbxKrnlInit @@ -1221,10 +1315,15 @@ __declspec(noreturn) void CxbxKrnlInit DebugMode DbgMode, const char *szDebugFilename, Xbe::Header *pXbeHeader, - uint32 dwXbeHeaderSize, + uint32_t dwXbeHeaderSize, void(*Entry)(), int BootFlags) { + // Set windows timer period to 1ms + // Windows will automatically restore this value back to original on program exit + // But with this, we can replace some busy loops with sleeps. + timeBeginPeriod(1); + // update caches CxbxKrnl_TLS = pTLS; CxbxKrnl_TLSData = pTLSData; @@ -1234,36 +1333,39 @@ __declspec(noreturn) void CxbxKrnlInit // A patch to dwCertificateAddr is a requirement due to Windows TLS is overwriting dwGameRegion data address. // By using unalternated certificate data, it should no longer cause any problem with titles running and Cxbx's log as well. - CxbxKrnl_XbeHeader->dwCertificateAddr = (uint32)&CxbxKrnl_Xbe->m_Certificate; + CxbxKrnl_XbeHeader->dwCertificateAddr = (uint32_t)&CxbxKrnl_Xbe->m_Certificate; g_pCertificate = &CxbxKrnl_Xbe->m_Certificate; + // Initialize timer subsystem + Timer_Init(); // for unicode conversions setlocale(LC_ALL, "English"); + // Initialize time-related variables for the kernel and the timers CxbxInitPerformanceCounters(); #ifdef _DEBUG -// CxbxPopupMessage("Attach a Debugger"); +// CxbxPopupMessage(LOG_LEVEL::INFO, "Attach a Debugger"); // Debug child processes using https://marketplace.visualstudio.com/items?itemName=GreggMiskelly.MicrosoftChildProcessDebuggingPowerTool #endif // debug trace { #ifdef _DEBUG_TRACE - printf("[0x%X] INIT: Debug Trace Enabled.\n", GetCurrentThreadId()); - printf("[0x%X] INIT: CxbxKrnlInit\n" + EmuLogInit(LOG_LEVEL::INFO, "Debug Trace Enabled."); + EmuLogInit(LOG_LEVEL::INFO, "CxbxKrnlInit\n" "(\n" - " hwndParent : 0x%.08X\n" - " pTLSData : 0x%.08X\n" - " pTLS : 0x%.08X\n" - " pLibraryVersion : 0x%.08X\n" + " hwndParent : 0x%.08p\n" + " pTLSData : 0x%.08p\n" + " pTLS : 0x%.08p\n" + " pLibraryVersion : 0x%.08p\n" " DebugConsole : 0x%.08X\n" " DebugFilename : \"%s\"\n" - " pXBEHeader : 0x%.08X\n" - " pXBEHeaderSize : 0x%.08X\n" - " Entry : 0x%.08X\n" - ");\n", - GetCurrentThreadId(), CxbxKrnl_hEmuParent, pTLSData, pTLS, pLibraryVersion, DbgMode, szDebugFilename, pXbeHeader, dwXbeHeaderSize, Entry); + " pXBEHeader : 0x%.08p\n" + " dwXBEHeaderSize : 0x%.08X\n" + " Entry : 0x%.08p\n" + ");", + CxbxKrnl_hEmuParent, pTLSData, pTLS, pLibraryVersion, DbgMode, szDebugFilename, pXbeHeader, dwXbeHeaderSize, Entry); #else - printf("[0x%X] INIT: Debug Trace Disabled.\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Debug Trace Disabled."); #endif } @@ -1284,15 +1386,16 @@ __declspec(noreturn) void CxbxKrnlInit DummyKernel->FileHeader.NumberOfSections = 1; // as long as this doesn't start with "INIT" strncpy_s((PSTR)DummyKernel->SectionHeader.Name, 8, "DONGS", 8); - printf("[0x%.4X] INIT: Initialized dummy kernel image header.\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "Initialized dummy kernel image header."); } - // Read which components need to be LLE'ed : + // Read which components need to be LLE'ed per user request { - int CxbxLLE_Flags; + unsigned int CxbxLLE_Flags; g_EmuShared->GetFlagsLLE(&CxbxLLE_Flags); bLLE_APU = (CxbxLLE_Flags & LLE_APU) > 0; bLLE_GPU = (CxbxLLE_Flags & LLE_GPU) > 0; + //bLLE_USB = (CxbxLLE_Flags & LLE_USB) > 0; // Reenable this when LLE USB actually works bLLE_JIT = (CxbxLLE_Flags & LLE_JIT) > 0; } @@ -1301,16 +1404,10 @@ __declspec(noreturn) void CxbxKrnlInit int HackEnabled = 0; g_EmuShared->GetDisablePixelShaders(&HackEnabled); g_DisablePixelShaders = !!HackEnabled; - g_EmuShared->GetUncapFramerate(&HackEnabled); - g_UncapFramerate = !!HackEnabled; g_EmuShared->GetUseAllCores(&HackEnabled); g_UseAllCores = !!HackEnabled; g_EmuShared->GetSkipRdtscPatching(&HackEnabled); g_SkipRdtscPatching = !!HackEnabled; - g_EmuShared->GetScaleViewport(&HackEnabled); - g_ScaleViewport = !!HackEnabled; - g_EmuShared->GetDirectHostBackBufferAccess(&HackEnabled); - g_DirectHostBackBufferAccess = !!HackEnabled; } #ifdef _DEBUG_PRINT_CURRENT_CONF @@ -1318,19 +1415,32 @@ __declspec(noreturn) void CxbxKrnlInit #endif // Initialize devices : - char szBuffer[MAX_PATH]; + char szBuffer[sizeof(szFilePath_Xbe)]; g_EmuShared->GetStorageLocation(szBuffer); CxbxBasePath = std::string(szBuffer) + "\\EmuDisk\\"; // Determine XBE Path - memset(szBuffer, 0, MAX_PATH); - g_EmuShared->GetXbePath(szBuffer); + strncpy(szBuffer, szFilePath_Xbe, sizeof(szBuffer)-1); + szBuffer[sizeof(szBuffer) - 1] = '\0'; // Safely null terminate at the end. + std::string xbePath(szBuffer); - PathRemoveFileSpec(szBuffer); + std::replace(xbePath.begin(), xbePath.end(), ';', '/'); std::string xbeDirectory(szBuffer); + size_t lastFind = xbeDirectory.find(';'); + // First find if there is a semicolon when dashboard or title disc (such as demo disc) has it. + // Then we must obey the current directory it asked for. + if (lastFind != std::string::npos) { + if (xbeDirectory.find(';', lastFind + 1) != std::string::npos) { + CxbxKrnlCleanupEx(LOG_PREFIX_INIT, "Cannot contain multiple of ; symbol."); + } + xbeDirectory = xbeDirectory.substr(0, lastFind); + } + else { + xbeDirectory = xbeDirectory.substr(0, xbeDirectory.find_last_of("\\/")); + } CxbxBasePathHandle = CreateFile(CxbxBasePath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); - memset(szBuffer, 0, MAX_PATH); + memset(szBuffer, 0, sizeof(szBuffer)); // Games may assume they are running from CdRom : CxbxDefaultXbeDriveIndex = CxbxRegisterDeviceHostPath(DeviceCdrom0, xbeDirectory); // Partition 0 contains configuration data, and is accessed as a native file, instead as a folder : @@ -1346,7 +1456,7 @@ __declspec(noreturn) void CxbxKrnlInit CxbxRegisterDeviceHostPath(DeviceHarddisk0Partition7, CxbxBasePath + "Partition7"); // Create default symbolic links : - DbgPrintf("INIT: Creating default symbolic links.\n"); + EmuLogInit(LOG_LEVEL::DEBUG, "Creating default symbolic links."); { // TODO: DriveD should always point to the Xbe Path // This is the only symbolic link the Xbox Kernel sets, the rest are set by the application, usually via XAPI. @@ -1375,13 +1485,13 @@ __declspec(noreturn) void CxbxKrnlInit xboxkrnl::XeImageFileName.Buffer = (PCHAR)g_VMManager.Allocate(MAX_PATH); sprintf(xboxkrnl::XeImageFileName.Buffer, "%c:\\%s", CxbxDefaultXbeDriveLetter, fileName.c_str()); xboxkrnl::XeImageFileName.Length = (USHORT)strlen(xboxkrnl::XeImageFileName.Buffer); - printf("[0x%.4X] INIT: XeImageFileName = %s\n", GetCurrentThreadId(), xboxkrnl::XeImageFileName.Buffer); + EmuLogInit(LOG_LEVEL::INFO, "XeImageFileName = %s", xboxkrnl::XeImageFileName.Buffer); } // Dump Xbe information { if (CxbxKrnl_Xbe != nullptr) { - printf("[0x%.4X] INIT: Title : %s\n", GetCurrentThreadId(), CxbxKrnl_Xbe->m_szAsciiTitle); + EmuLogInit(LOG_LEVEL::INFO, "Title : %s", CxbxKrnl_Xbe->m_szAsciiTitle); } // Dump Xbe certificate @@ -1389,18 +1499,18 @@ __declspec(noreturn) void CxbxKrnlInit std::stringstream titleIdHex; titleIdHex << std::hex << g_pCertificate->dwTitleId; - printf("[0x%.4X] INIT: XBE TitleID : %s\n", GetCurrentThreadId(), FormatTitleId(g_pCertificate->dwTitleId).c_str()); - printf("[0x%.4X] INIT: XBE TitleID (Hex) : 0x%s\n", GetCurrentThreadId(), titleIdHex.str().c_str()); - printf("[0x%.4X] INIT: XBE Version : 1.%02d\n", GetCurrentThreadId(), g_pCertificate->dwVersion); - printf("[0x%.4X] INIT: XBE TitleName : %ls\n", GetCurrentThreadId(), g_pCertificate->wszTitleName); - printf("[0x%.4X] INIT: XBE Region : %s\n", GetCurrentThreadId(), CxbxKrnl_Xbe->GameRegionToString()); + EmuLogInit(LOG_LEVEL::INFO, "XBE TitleID : %s", FormatTitleId(g_pCertificate->dwTitleId).c_str()); + EmuLogInit(LOG_LEVEL::INFO, "XBE TitleID (Hex) : 0x%s", titleIdHex.str().c_str()); + EmuLogInit(LOG_LEVEL::INFO, "XBE Version : 1.%02d", g_pCertificate->dwVersion); + EmuLogInit(LOG_LEVEL::INFO, "XBE TitleName : %ls", g_pCertificate->wszTitleName); + EmuLogInit(LOG_LEVEL::INFO, "XBE Region : %s", CxbxKrnl_Xbe->GameRegionToString()); } // Dump Xbe library build numbers Xbe::LibraryVersion* libVersionInfo = pLibraryVersion;// (LibraryVersion *)(CxbxKrnl_XbeHeader->dwLibraryVersionsAddr); if (libVersionInfo != NULL) { - for (uint32 v = 0; v < CxbxKrnl_XbeHeader->dwLibraryVersions; v++) { - printf("[0x%.4X] INIT: XBE Library %u : %.8s (version %d)\n", GetCurrentThreadId(), v, libVersionInfo->szName, libVersionInfo->wBuildVersion); + for (uint32_t v = 0; v < CxbxKrnl_XbeHeader->dwLibraryVersions; v++) { + EmuLogInit(LOG_LEVEL::INFO, "XBE Library %u : %.8s (version %d)", v, libVersionInfo->szName, libVersionInfo->wBuildVersion); libVersionInfo++; } } @@ -1410,10 +1520,10 @@ __declspec(noreturn) void CxbxKrnlInit // Make sure the Xbox1 code runs on one core (as the box itself has only 1 CPU, // this will better aproximate the environment with regard to multi-threading) : - DbgPrintf("INIT: Determining CPU affinity.\n"); + EmuLogInit(LOG_LEVEL::DEBUG, "Determining CPU affinity."); { if (!GetProcessAffinityMask(g_CurrentProcessHandle, &g_CPUXbox, &g_CPUOthers)) - CxbxKrnlCleanup("INIT: GetProcessAffinityMask failed."); + CxbxKrnlCleanupEx(LOG_PREFIX_INIT, "GetProcessAffinityMask failed."); // For the other threads, remove one bit from the processor mask: g_CPUOthers = ((g_CPUXbox - 1) & g_CPUXbox); @@ -1429,8 +1539,8 @@ __declspec(noreturn) void CxbxKrnlInit } // initialize graphics - DbgPrintf("INIT: Initializing render window.\n"); - XTL::CxbxInitWindow(true); + EmuLogInit(LOG_LEVEL::DEBUG, "Initializing render window."); + CxbxInitWindow(true); // Now process the boot flags to see if there are any special conditions to handle if (BootFlags & BOOT_EJECT_PENDING) {} // TODO @@ -1445,21 +1555,28 @@ __declspec(noreturn) void CxbxKrnlInit if (BootFlags & BOOT_SKIP_ANIMATION) {} // TODO if (BootFlags & BOOT_RUN_DASHBOARD) {} // TODO - XTL::CxbxInitAudio(); + CxbxInitAudio(); EmuHLEIntercept(pXbeHeader); - SetupXboxDeviceTypes(); + if (!bLLE_USB) { + SetupXboxDeviceTypes(); + } InitXboxHardware(HardwareModel::Revision1_5); // TODO : Make configurable + // Read Xbox video mode from the SMC, store it in HalBootSMCVideoMode + xboxkrnl::HalReadSMBusValue(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, SMC_COMMAND_AV_PACK, FALSE, &xboxkrnl::HalBootSMCVideoMode); + + g_InputDeviceManager.Initialize(false); + // Now the hardware devices exist, couple the EEPROM buffer to it's device g_EEPROM->SetEEPROM((uint8_t*)EEPROM); if (!bLLE_GPU) { - DbgPrintf("INIT: Initializing Direct3D.\n"); - XTL::EmuD3DInit(); + EmuLogInit(LOG_LEVEL::DEBUG, "Initializing Direct3D."); + EmuD3DInit(); } if (CxbxDebugger::CanReport()) @@ -1472,6 +1589,12 @@ __declspec(noreturn) void CxbxKrnlInit // See: https://multimedia.cx/eggs/xbox-sphinx-protocol/ ApplyMediaPatches(); + // Chihiro games require more patches + // The chihiro BIOS does this to bypass XAPI cache init + if (g_bIsChihiro) { + CxbxKrnl_XbeHeader->dwInitFlags.bDontSetupHarddisk = true; + } + if(!g_SkipRdtscPatching) { PatchRdtscInstructions(); @@ -1484,19 +1607,23 @@ __declspec(noreturn) void CxbxKrnlInit InitXboxThread(g_CPUXbox); xboxkrnl::ObInitSystem(); + xboxkrnl::KiInitSystem(); EmuX86_Init(); // Create the interrupt processing thread DWORD dwThreadId; - HANDLE hThread = (HANDLE)_beginthreadex(NULL, NULL, CxbxKrnlInterruptThread, NULL, NULL, (uint*)&dwThreadId); + HANDLE hThread = (HANDLE)_beginthreadex(NULL, NULL, CxbxKrnlInterruptThread, NULL, NULL, (unsigned int*)&dwThreadId); + // Start the kernel clock thread + TimerObject* KernelClockThr = Timer_Create(CxbxKrnlClockThread, nullptr, "Kernel clock thread", &g_CPUOthers); + Timer_Start(KernelClockThr, SCALE_MS_IN_NS); - DbgPrintf("INIT: Calling XBE entry point...\n"); + EmuLogInit(LOG_LEVEL::DEBUG, "Calling XBE entry point..."); CxbxLaunchXbe(Entry); // FIXME: Wait for Cxbx to exit or error fatally Sleep(INFINITE); - DbgPrintf("INIT: XBE entry point returned\n"); + EmuLogInit(LOG_LEVEL::DEBUG, "XBE entry point returned"); fflush(stdout); // EmuShared::Cleanup(); FIXME: commenting this line is a bad workaround for issue #617 (https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/617) @@ -1508,23 +1635,23 @@ void CxbxInitFilePaths() g_EmuShared->GetStorageLocation(szFolder_CxbxReloadedData); // Make sure our data folder exists : - int result = SHCreateDirectoryEx(nullptr, szFolder_CxbxReloadedData, nullptr); - if ((result != ERROR_SUCCESS) && (result != ERROR_ALREADY_EXISTS)) { - CxbxKrnlCleanup("CxbxInitFilePaths : Couldn't create Cxbx-Reloaded AppData folder!"); + bool result = std::filesystem::exists(szFolder_CxbxReloadedData); + if (!result && !std::filesystem::create_directory(szFolder_CxbxReloadedData)) { + CxbxKrnlCleanup("%s : Couldn't create Cxbx-Reloaded's data folder!", __func__); } // Make sure the EmuDisk folder exists std::string emuDisk = std::string(szFolder_CxbxReloadedData) + std::string("\\EmuDisk"); - result = SHCreateDirectoryEx(nullptr, emuDisk.c_str(), nullptr); - if ((result != ERROR_SUCCESS) && (result != ERROR_ALREADY_EXISTS)) { - CxbxKrnlCleanup("CxbxInitFilePaths : Couldn't create Cxbx-Reloaded EmuDisk folder!"); + result = std::filesystem::exists(emuDisk); + if (!result && !std::filesystem::create_directory(emuDisk)) { + CxbxKrnlCleanup("%s : Couldn't create Cxbx-Reloaded EmuDisk folder!", __func__); } snprintf(szFilePath_EEPROM_bin, MAX_PATH, "%s\\EEPROM.bin", szFolder_CxbxReloadedData); snprintf(szFilePath_memory_bin, MAX_PATH, "%s\\memory.bin", szFolder_CxbxReloadedData); snprintf(szFilePath_page_tables, MAX_PATH, "%s\\PageTables.bin", szFolder_CxbxReloadedData); - GetModuleFileName(GetModuleHandle(NULL), szFilePath_CxbxReloaded_Exe, MAX_PATH); + GetModuleFileName(GetModuleHandle(nullptr), szFilePath_CxbxReloaded_Exe, MAX_PATH); } // REMARK: the following is useless, but PatrickvL has asked to keep it for documentation purposes @@ -1538,7 +1665,7 @@ void CxbxInitFilePaths() } };*/ -__declspec(noreturn) void CxbxKrnlCleanup(const char *szErrorMessage, ...) +__declspec(noreturn) void CxbxKrnlCleanupEx(CXBXR_MODULE cxbxr_module, const char *szErrorMessage, ...) { g_bEmuException = true; @@ -1554,10 +1681,10 @@ __declspec(noreturn) void CxbxKrnlCleanup(const char *szErrorMessage, ...) vsprintf(szBuffer2, szErrorMessage, argp); va_end(argp); - CxbxPopupMessage(CxbxMsgDlgIcon_Error, "Received Fatal Message:\n\n* %s\n", szBuffer2); // Will also DbgPrintf + CxbxPopupMessageEx(cxbxr_module, LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, "Received Fatal Message:\n\n* %s\n", szBuffer2); // Will also EmuLogEx } - printf("[0x%.4X] MAIN: Terminating Process\n", GetCurrentThreadId()); + EmuLogInit(LOG_LEVEL::INFO, "MAIN: Terminating Process"); fflush(stdout); // cleanup debug output @@ -1584,25 +1711,11 @@ void CxbxKrnlRegisterThread(HANDLE hThread) } else { auto message = CxbxGetLastErrorString("DuplicateHandle"); - EmuWarning(message.c_str()); + EmuLog(LOG_LEVEL::WARNING, message.c_str()); } } - int v=0; - - for(v=0;vSetBootFlags(&BootFlags); + // NOTE: This causes a hang when exiting while NV2A is processing + // This is okay for now: It won't leak memory or resources since TerminateProcess will free everything + // delete g_NV2A; // TODO : g_pXbox + + // Shutdown the input device manager + g_InputDeviceManager.Shutdown(); + if (CxbxKrnl_hEmuParent != NULL) SendMessage(CxbxKrnl_hEmuParent, WM_PARENTNOTIFY, WM_DESTROY, 0); @@ -1770,11 +1879,11 @@ void CxbxPrintUEMInfo(ULONG ErrorCode) if (it != UEMErrorTable.end()) { std::string ErrorMessage = "Fatal error. " + it->second + ". This error screen will persist indefinitely. Stop the emulation to close it"; - CxbxPopupMessage(CxbxMsgDlgIcon_Error, ErrorMessage.c_str()); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, ErrorMessage.c_str()); } else { - CxbxPopupMessage(CxbxMsgDlgIcon_Error, "Unknown fatal error. This error screen will persist indefinitely. Stop the emulation to close it"); + CxbxPopupMessage(LOG_LEVEL::FATAL, CxbxMsgDlgIcon_Error, "Unknown fatal error. This error screen will persist indefinitely. Stop the emulation to close it"); } } @@ -1813,9 +1922,6 @@ static void UpdateCurrentMSpFAndFPS() { if (g_EmuShared) { static float currentFPSVal = 30; - float currentMSpFVal = (float)(1000.0 / (currentFPSVal == 0 ? 0.001 : currentFPSVal)); - g_EmuShared->SetCurrentMSpF(¤tMSpFVal); - currentFPSVal = (float)(g_Frames*0.5 + currentFPSVal * 0.5); g_EmuShared->SetCurrentFPS(¤tFPSVal); } diff --git a/src/CxbxKrnl/CxbxKrnl.h b/src/core/kernel/init/CxbxKrnl.h similarity index 81% rename from src/CxbxKrnl/CxbxKrnl.h rename to src/core/kernel/init/CxbxKrnl.h index 1b7604026..e5a6d660f 100644 --- a/src/CxbxKrnl/CxbxKrnl.h +++ b/src/core/kernel/init/CxbxKrnl.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->CxbxKrnl.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,7 +26,8 @@ #define CXBXKRNL_H #include "Cxbx.h" -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" +#include "Logging.h" #undef FIELD_OFFSET // prevent macro redefinition warnings #include @@ -104,27 +96,6 @@ extern "C" { #define CONTIGUOUS_MEMORY_CHIHIRO_SIZE (128 * ONE_MB) #define XBOX_PFN_ADDRESS ((XBOX_PFN_DATABASE_PHYSICAL_PAGE << PAGE_SHIFT) + (PCHAR)KSEG0_BASE) #define CHIHIRO_PFN_ADDRESS ((CHIHIRO_PFN_DATABASE_PHYSICAL_PAGE << PAGE_SHIFT) + (PCHAR)KSEG0_BASE) -#define NV2A_MEMORY_BASE 0xFD000000 // See NV2A_ADDR -#define NV2A_MEMORY_SIZE 0x01000000 // See NV2A_SIZE -#define NV2A_PRAMIN_ADDR 0xFD700000 -#define NV2A_PRAMIN_SIZE 0x100000 -#define NV2A_USER_ADDR 0xFD800000 -#define NV2A_USER_SIZE 0x800000 -#define APU_BASE 0xFE800000 -#define APU_SIZE 0x80000 -#define AC97_BASE 0xFEC00000 -#define AC97_SIZE 0x1000 -#define USB0_BASE 0xFED00000 -#define USB0_SIZE 0x1000 -#define USB1_BASE 0xFED08000 -#define USB1_SIZE 0x1000 -#define NVNet_BASE 0xFEF00000 -#define NVNet_SIZE 0x400 -#define BIOS_BASE 0xFF000000 // this takes into account that the bios covers the top 16 MiB of memory -#define BIOS_XBOX_SIZE 0xFFFE00 -#define BIOS_CHIHIRO_SIZE 0x1000000 -#define MCPX_BASE 0xFFFFFE00 -#define MCPX_SIZE 0x200 #define MAX_VIRTUAL_ADDRESS 0xFFFFFFFF /*! base addresses of various components */ @@ -226,20 +197,16 @@ typedef enum _CxbxMsgDlgIcon { } CxbxMsgDlgIcon; -void CxbxPopupMessage(CxbxMsgDlgIcon icon, const char *message, ...); +void CxbxPopupMessageEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, CxbxMsgDlgIcon icon, const char *message, ...); + +#define CxbxPopupMessage(level, icon, fmt, ...) CxbxPopupMessageEx(LOG_PREFIX, level, icon, fmt, ##__VA_ARGS__) -#ifdef _DEBUG #define LOG_TEST_CASE(message) do { static bool bTestCaseLogged = false; \ - if (!bTestCaseLogged) { bTestCaseLogged = true; \ - CxbxPopupMessage(CxbxMsgDlgIcon_Info, "Please report that %s shows the following message:\nLOG_TEST_CASE: %s\nIn %s (%s line %d)", \ - CxbxKrnl_Xbe->m_szAsciiTitle, message, __func__, __FILE__, __LINE__); } } while(0) + if (!bTestCaseLogged) { bTestCaseLogged = true; \ + LOG_CHECK_ENABLED(LOG_LEVEL::INFO) { \ + CxbxPopupMessage(LOG_LEVEL::INFO, CxbxMsgDlgIcon_Info, "Please report that %s shows the following message:\nLOG_TEST_CASE: %s\nIn %s (%s line %d)", \ + CxbxKrnl_Xbe->m_szAsciiTitle, message, __func__, __FILE__, __LINE__); } } } while (0) // was g_pCertificate->wszTitleName -#else -#define LOG_TEST_CASE(message) do { static bool bTestCaseLogged = false; \ - if (!bTestCaseLogged) { bTestCaseLogged = true; \ - printf("LOG_TEST_CASE: %s\nIn %s (%s line %d)", \ - message, __func__, __FILE__, __LINE__); } } while(0) -#endif extern Xbe::Certificate *g_pCertificate; @@ -252,10 +219,12 @@ extern bool g_bIsDebugKernel; void CxbxKrnlMain(int argc, char* argv[]); /*! initialize emulation */ -__declspec(noreturn) void CxbxKrnlInit(void *pTLSData, Xbe::TLS *pTLS, Xbe::LibraryVersion *LibraryVersion, DebugMode DbgMode, const char *szDebugFilename, Xbe::Header *XbeHeader, uint32 XbeHeaderSize, void (*Entry)(), int BootFlags); +__declspec(noreturn) void CxbxKrnlInit(void *pTLSData, Xbe::TLS *pTLS, Xbe::LibraryVersion *LibraryVersion, DebugMode DbgMode, const char *szDebugFilename, Xbe::Header *XbeHeader, uint32_t XbeHeaderSize, void (*Entry)(), int BootFlags); /*! cleanup emulation */ -__declspec(noreturn) void CxbxKrnlCleanup(const char *szErrorMessage, ...); +__declspec(noreturn) void CxbxKrnlCleanupEx(CXBXR_MODULE cxbxr_module, const char *szErrorMessage, ...); + +#define CxbxKrnlCleanup(fmt, ...) CxbxKrnlCleanupEx(LOG_PREFIX, fmt, ##__VA_ARGS__) /*! register a thread handle */ void CxbxKrnlRegisterThread(HANDLE hThread); @@ -288,8 +257,6 @@ void CxbxInitPerformanceCounters(); // Implemented in EmuKrnlKe.cpp void CxbxInitFilePaths(); -void ConnectWindowsTimersToThunkTable(); - /*! Generate a standard arg format string */ void CxbxConvertArgToString(std::string &dest, const char* krnlExe, const char* xbeFile, HWND hwndParent, DebugMode krnlDebug, const char* krnlDebugFile); @@ -298,7 +265,7 @@ bool CxbxExec(std::string &execCommand, HANDLE* hProcess, bool requestHandleProc bool CxbxIsElevated(); /*! kernel thunk table */ -extern uint32 CxbxKrnl_KernelThunkTable[379]; +extern uint32_t CxbxKrnl_KernelThunkTable[379]; extern bool g_bIsWine; @@ -329,6 +296,7 @@ extern std::string CxbxKrnl_DebugFileName; extern char szFilePath_CxbxReloaded_Exe[MAX_PATH]; extern char szFolder_CxbxReloadedData[MAX_PATH]; extern char szFilePath_EEPROM_bin[MAX_PATH]; +extern char szFilePath_Xbe[MAX_PATH*2]; #ifdef __cplusplus } diff --git a/src/CxbxKrnl/PhysicalMemory.cpp b/src/core/kernel/memory-manager/PhysicalMemory.cpp similarity index 85% rename from src/CxbxKrnl/PhysicalMemory.cpp rename to src/core/kernel/memory-manager/PhysicalMemory.cpp index 83a69854c..02c663814 100644 --- a/src/CxbxKrnl/PhysicalMemory.cpp +++ b/src/core/kernel/memory-manager/PhysicalMemory.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->PhysicalMemory.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,11 +26,22 @@ // ****************************************************************** -#define LOG_PREFIX "PMEM" +#define LOG_PREFIX CXBXR_MODULE::PMEM #include "PhysicalMemory.h" +#include "Logging.h" +#include "core\kernel\exports\EmuKrnl.h" // For InitializeListHead(), etc. #include +// See the links below for the details about the kernel structure LIST_ENTRY and the related functions +// https://www.codeproject.com/Articles/800404/Understanding-LIST-ENTRY-Lists-and-Its-Importance +// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/singly-and-doubly-linked-lists +#define LIST_ENTRY_INITIALIZE(ListEntry) ((ListEntry)->Flink = (ListEntry)->Blink = nullptr) + +inline FreeBlock* ListEntryToFreeBlock(xboxkrnl::PLIST_ENTRY pListEntry) +{ + return CONTAINING_RECORD(pListEntry, FreeBlock, ListEntry); +} void PhysicalMemory::InitializePageDirectory() { @@ -89,7 +91,7 @@ void PhysicalMemory::WritePfn(PFN pfn_start, PFN pfn_end, PMMPTE pPte, PageType TempPF.Default = 0; while (pfn_start <= pfn_end) { - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { *XBOX_PFN_ELEMENT(pfn_start) = TempPF; } else { *CHIHIRO_PFN_ELEMENT(pfn_start) = TempPF; } @@ -110,7 +112,7 @@ void PhysicalMemory::WritePfn(PFN pfn_start, PFN pfn_end, PMMPTE pPte, PageType } else { TempPF.PTPageFrame.PtesUsed = 0; } // we are writing a pfn of a PT - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { *XBOX_PFN_ELEMENT(pfn_start) = TempPF; } else { *CHIHIRO_PFN_ELEMENT(pfn_start) = TempPF; } @@ -193,10 +195,10 @@ bool PhysicalMemory::RemoveFree(PFN_COUNT NumberOfPages, PFN* result, PFN_COUNT while (ListEntry != &FreeList) { - if (LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size >= NumberOfPages) // search for a block with enough pages + if (ListEntryToFreeBlock(ListEntry)->size >= NumberOfPages) // search for a block with enough pages { - PfnStart = LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->start; - PfnCount = LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size; + PfnStart = ListEntryToFreeBlock(ListEntry)->start; + PfnCount = ListEntryToFreeBlock(ListEntry)->size; PfnEnd = PfnStart + PfnCount - 1; IntersectionStart = start >= PfnStart ? start : PfnStart; IntersectionEnd = end <= PfnEnd ? end : PfnEnd; @@ -242,10 +244,10 @@ bool PhysicalMemory::RemoveFree(PFN_COUNT NumberOfPages, PFN* result, PFN_COUNT { // delete the entry if there is no free space left - LIST_ENTRY_REMOVE(ListEntry); - delete LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry); + RemoveEntryList(ListEntry); + delete ListEntryToFreeBlock(ListEntry); } - else { LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size = PfnCount; } + else { ListEntryToFreeBlock(ListEntry)->size = PfnCount; } } else { @@ -255,17 +257,17 @@ bool PhysicalMemory::RemoveFree(PFN_COUNT NumberOfPages, PFN* result, PFN_COUNT block->start = IntersectionEnd + 1; block->size = PfnStart + PfnCount - IntersectionEnd - 1; LIST_ENTRY_INITIALIZE(&block->ListEntry); - LIST_ENTRY_INSERT_HEAD(ListEntry, &block->ListEntry); + InsertHeadList(ListEntry, &block->ListEntry); PfnCount = IntersectionEnd - PfnStart - NumberOfPages + 1; if (!PfnCount) { // delete the entry if there is no free space left - LIST_ENTRY_REMOVE(ListEntry); - delete LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry); + RemoveEntryList(ListEntry); + delete ListEntryToFreeBlock(ListEntry); } - else { LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size = PfnCount; } + else { ListEntryToFreeBlock(ListEntry)->size = PfnCount; } } } else @@ -277,7 +279,7 @@ bool PhysicalMemory::RemoveFree(PFN_COUNT NumberOfPages, PFN* result, PFN_COUNT // The free block extends before IntersectionStart PfnCount -= NumberOfPages; - LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size = PfnCount; + ListEntryToFreeBlock(ListEntry)->size = PfnCount; } else { @@ -287,13 +289,13 @@ bool PhysicalMemory::RemoveFree(PFN_COUNT NumberOfPages, PFN* result, PFN_COUNT block->start = IntersectionEnd + 1; block->size = PfnStart + PfnCount - IntersectionEnd - 1; LIST_ENTRY_INITIALIZE(&block->ListEntry); - LIST_ENTRY_INSERT_HEAD(ListEntry, &block->ListEntry); + InsertHeadList(ListEntry, &block->ListEntry); PfnCount = IntersectionEnd - PfnStart - NumberOfPages + 1; - LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size = PfnCount; + ListEntryToFreeBlock(ListEntry)->size = PfnCount; } } - if (g_bIsDebug && (PfnStart + PfnCount >= DEBUGKIT_FIRST_UPPER_HALF_PAGE)) { + if (m_MmLayoutDebug && (PfnStart + PfnCount >= DEBUGKIT_FIRST_UPPER_HALF_PAGE)) { m_DebuggerPagesAvailable -= NumberOfPages; assert(m_DebuggerPagesAvailable <= DEBUGKIT_FIRST_UPPER_HALF_PAGE); } @@ -320,50 +322,50 @@ void PhysicalMemory::InsertFree(PFN start, PFN end) while (true) { - if (LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->start < start || ListEntry == &FreeList) + if (ListEntryToFreeBlock(ListEntry)->start < start || ListEntry == &FreeList) { PFreeBlock block = new FreeBlock; block->start = start; block->size = size; LIST_ENTRY_INITIALIZE(&block->ListEntry); - LIST_ENTRY_INSERT_HEAD(ListEntry, &block->ListEntry); + InsertHeadList(ListEntry, &block->ListEntry); // Ensure that we are not freeing a part of the previous block if (ListEntry != &FreeList) { - assert(LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->start + - LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size - 1 < start); + assert(ListEntryToFreeBlock(ListEntry)->start + + ListEntryToFreeBlock(ListEntry)->size - 1 < start); } ListEntry = ListEntry->Flink; // move to the new created block // Ensure that we are not freeing a part of the next block if (ListEntry->Flink != &FreeList) { - assert(LIST_ENTRY_ACCESS_RECORD(ListEntry->Flink, FreeBlock, ListEntry)->start > end); + assert(ListEntryToFreeBlock(ListEntry->Flink)->start > end); } // Check if merging is possible if (ListEntry->Flink != &FreeList && - start + size == LIST_ENTRY_ACCESS_RECORD(ListEntry->Flink, FreeBlock, ListEntry)->start) + start + size == ListEntryToFreeBlock(ListEntry->Flink)->start) { // Merge forward xboxkrnl::PLIST_ENTRY temp = ListEntry->Flink; - LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size += - LIST_ENTRY_ACCESS_RECORD(temp, FreeBlock, ListEntry)->size; - LIST_ENTRY_REMOVE(temp); - delete LIST_ENTRY_ACCESS_RECORD(temp, FreeBlock, ListEntry); + ListEntryToFreeBlock(ListEntry)->size += + ListEntryToFreeBlock(temp)->size; + RemoveEntryList(temp); + delete ListEntryToFreeBlock(temp); } if (ListEntry->Blink != &FreeList && - LIST_ENTRY_ACCESS_RECORD(ListEntry->Blink, FreeBlock, ListEntry)->start + - LIST_ENTRY_ACCESS_RECORD(ListEntry->Blink, FreeBlock, ListEntry)->size == start) + ListEntryToFreeBlock(ListEntry->Blink)->start + + ListEntryToFreeBlock(ListEntry->Blink)->size == start) { // Merge backward - LIST_ENTRY_ACCESS_RECORD(ListEntry->Blink, FreeBlock, ListEntry)->size += - LIST_ENTRY_ACCESS_RECORD(ListEntry, FreeBlock, ListEntry)->size; - LIST_ENTRY_REMOVE(ListEntry); + ListEntryToFreeBlock(ListEntry->Blink)->size += + ListEntryToFreeBlock(ListEntry)->size; + RemoveEntryList(ListEntry); delete block; } - if (g_bIsDebug && (start >= DEBUGKIT_FIRST_UPPER_HALF_PAGE)) { + if (m_MmLayoutDebug && (start >= DEBUGKIT_FIRST_UPPER_HALF_PAGE)) { m_DebuggerPagesAvailable += size; assert(m_DebuggerPagesAvailable <= DEBUGKIT_FIRST_UPPER_HALF_PAGE); } @@ -552,7 +554,7 @@ DWORD PhysicalMemory::PatchXboxPermissions(DWORD Perms) { // One of XBOX_PAGE_READONLY or XBOX_PAGE_READWRITE must be specified - DbgPrintf("PMEM: PatchXboxPermissions: Memory permissions bug detected\n"); + EmuLog(LOG_LEVEL::DEBUG, "%s: Memory permissions bug detected", __func__); return XBOX_PAGE_EXECUTE_READWRITE; } @@ -573,7 +575,7 @@ DWORD PhysicalMemory::PatchXboxPermissions(DWORD Perms) // If we reach here it means that both XBOX_PAGE_READONLY and XBOX_PAGE_READWRITE were specified, and so the // input is probably invalid - DbgPrintf("PMEM: PatchXboxPermissions: Memory permissions bug detected\n"); + EmuLog(LOG_LEVEL::DEBUG, "%s: Memory permissions bug detected", __func__); return XBOX_PAGE_EXECUTE_READWRITE; } } @@ -639,7 +641,7 @@ DWORD PhysicalMemory::ConvertXboxToWinProtection(DWORD Perms) // If we reach here it means that more than one permission modifier was specified, and so the input is // probably invalid - DbgPrintf("PMEM: ConvertXboxToWinProtection: Memory permissions bug detected\n"); + EmuLog(LOG_LEVEL::DEBUG, "%s: Memory permissions bug detected", __func__); return PAGE_EXECUTE_READWRITE; } } @@ -737,7 +739,7 @@ bool PhysicalMemory::IsMappable(PFN_COUNT PagesRequested, bool bRetailRegion, bo bool ret = false; if (bRetailRegion && m_PhysicalPagesAvailable >= PagesRequested) { ret = true; } if (bDebugRegion && m_DebuggerPagesAvailable >= PagesRequested) { ret = true; } - if (!ret) { EmuWarning(LOG_PREFIX " Out of physical memory!"); } + if (!ret) { EmuLog(LOG_LEVEL::WARNING, "Out of physical memory!"); } return ret; } @@ -750,7 +752,7 @@ PXBOX_PFN PhysicalMemory::GetPfnOfPT(PMMPTE pPte) PMMPTE PointerPde = GetPteAddress(pPte); // PointerPde should have already been written to by AllocatePT assert(PointerPde->Hardware.Valid != 0); - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { PTpfn = XBOX_PFN_ELEMENT(PointerPde->Hardware.PFN); } else { PTpfn = CHIHIRO_PFN_ELEMENT(PointerPde->Hardware.PFN); } diff --git a/src/CxbxKrnl/PhysicalMemory.h b/src/core/kernel/memory-manager/PhysicalMemory.h similarity index 96% rename from src/CxbxKrnl/PhysicalMemory.h rename to src/core/kernel/memory-manager/PhysicalMemory.h index fab8f97f0..8b1706b8f 100644 --- a/src/CxbxKrnl/PhysicalMemory.h +++ b/src/core/kernel/memory-manager/PhysicalMemory.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->PhysicalMemory.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -37,15 +28,14 @@ #ifndef PHYSICAL_MEMORY_H #define PHYSICAL_MEMORY_H -#define _XBOXKRNL_DEFEXTRN_ namespace xboxkrnl { #include }; -#include "Emu.h" -#include "CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "core\kernel\init\CxbxKrnl.h" #include #include @@ -136,7 +126,16 @@ typedef enum _PageType ContiguousType, // Used by MmAllocateContiguousMemoryEx and others DebuggerType, // xbdm-related COUNTtype // The size of the array containing the page usage per type -}PageType; +}PageType; + + +/* enum describing the memory layouts available on the Xbox */ +typedef enum _MmLayout +{ + MmChihiro = 1, + MmDebug, + MmRetail, +}MmLayout; /* Lock count variables for the PFN database */ @@ -230,7 +229,11 @@ class PhysicalMemory // number of allocated bytes for the nv2a instance memory size_t m_NV2AInstanceMemoryBytes = NV2A_INSTANCE_PAGE_COUNT << PAGE_SHIFT; // boolean that indicates that the extra 64 MiB on a devkit can be used for heap/Nt allocations - bool m_bAllowNonDebuggerOnTop64MiB = true; + bool m_bAllowNonDebuggerOnTop64MiB = true; + // the memory layout that the VMManager is emulating + bool m_MmLayoutChihiro = false; + bool m_MmLayoutDebug = false; + bool m_MmLayoutRetail = false; // protected constructor so PhysicalMemory can only be inherited from diff --git a/src/CxbxKrnl/PoolManager.cpp b/src/core/kernel/memory-manager/PoolManager.cpp similarity index 87% rename from src/CxbxKrnl/PoolManager.cpp rename to src/core/kernel/memory-manager/PoolManager.cpp index b3c953988..69b06c4cf 100644 --- a/src/CxbxKrnl/PoolManager.cpp +++ b/src/core/kernel/memory-manager/PoolManager.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->PoolManager.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,10 +25,11 @@ // * // ****************************************************************** -#define LOG_PREFIX "POOLMEM" +#define LOG_PREFIX CXBXR_MODULE::POOLMEM #include "PoolManager.h" #include "Logging.h" +#include "core\kernel\exports\EmuKrnl.h" // For InitializeListHead(), etc. #include @@ -59,7 +51,7 @@ void PoolManager::InitializePool() m_NonPagedPoolDescriptor.TotalBigPages = 0; for (Index = 0; Index < POOL_LIST_HEADS; Index++) { - LIST_ENTRY_INITIALIZE_HEAD(&m_NonPagedPoolDescriptor.ListHeads[Index]); + InitializeListHead(&m_NonPagedPoolDescriptor.ListHeads[Index]); } for (Index = 0; Index < POOL_SMALL_LISTS; Index++) { @@ -70,7 +62,7 @@ void PoolManager::InitializePool() Lookaside->AllocateHits = 0; } - printf(LOG_PREFIX " Pool manager initialized!\n"); + printf("Pool manager initialized!\n"); } VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) @@ -111,7 +103,7 @@ VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) Unlock(); } else { - EmuWarning(LOG_PREFIX " AllocatePool returns nullptr"); + EmuLog(LOG_LEVEL::WARNING, "AllocatePool returns nullptr"); Unlock(); } @@ -156,8 +148,8 @@ VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) do { do { - if (IS_LIST_EMPTY(ListHead) == false) { - Block = REMOVE_HEAD_LIST(ListHead); + if (IsListEmpty(ListHead) == false) { + Block = RemoveHeadList(ListHead); Entry = reinterpret_cast((static_cast(Block) - POOL_OVERHEAD)); assert(Entry->BlockSize >= NeededSize); @@ -189,7 +181,7 @@ VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) SplitEntry->PoolType = 0; Index = SplitEntry->BlockSize; - LIST_ENTRY_INSERT_TAIL(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast((reinterpret_cast(SplitEntry) + InsertTailList(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast((reinterpret_cast(SplitEntry) + POOL_OVERHEAD)))); } @@ -213,7 +205,7 @@ VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) Entry = reinterpret_cast(g_VMManager.AllocateSystemMemory(PoolType, XBOX_PAGE_READWRITE, PAGE_SIZE, false)); if (Entry == nullptr) { - EmuWarning(LOG_PREFIX " AllocatePool returns nullptr"); + EmuLog(LOG_LEVEL::WARNING, "AllocatePool returns nullptr"); Unlock(); RETURN(reinterpret_cast(Entry)); @@ -231,7 +223,7 @@ VAddr PoolManager::AllocatePool(size_t Size, uint32_t Tag) Entry->PreviousSize = 0; ListHead = &PoolDesc->ListHeads[POOL_LIST_HEADS - 1]; - LIST_ENTRY_INSERT_HEAD(ListHead, (reinterpret_cast((reinterpret_cast(Entry) + POOL_OVERHEAD)))); + InsertHeadList(ListHead, (reinterpret_cast((reinterpret_cast(Entry) + POOL_OVERHEAD)))); } while (true); } @@ -296,7 +288,7 @@ void PoolManager::DeallocatePool(VAddr addr) if (PAGE_END(NextEntry) == false) { if (NextEntry->PoolType == 0) { Combined = true; - LIST_ENTRY_REMOVE((reinterpret_cast(reinterpret_cast(NextEntry) + POOL_OVERHEAD))); + RemoveEntryList((reinterpret_cast(reinterpret_cast(NextEntry) + POOL_OVERHEAD))); Entry->BlockSize += NextEntry->BlockSize; } } @@ -305,7 +297,7 @@ void PoolManager::DeallocatePool(VAddr addr) NextEntry = reinterpret_cast(reinterpret_cast(Entry) - Entry->PreviousSize); if (NextEntry->PoolType == 0) { Combined = true; - LIST_ENTRY_REMOVE((reinterpret_cast(reinterpret_cast(NextEntry) + POOL_OVERHEAD))); + RemoveEntryList((reinterpret_cast(reinterpret_cast(NextEntry) + POOL_OVERHEAD))); NextEntry->BlockSize += Entry->BlockSize; Entry = NextEntry; } @@ -327,11 +319,11 @@ void PoolManager::DeallocatePool(VAddr addr) if (PAGE_END(NextEntry) == false) { NextEntry->PreviousSize = Entry->BlockSize; } - LIST_ENTRY_INSERT_TAIL(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast( + InsertTailList(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast( reinterpret_cast(Entry) + POOL_OVERHEAD))); } else { - LIST_ENTRY_INSERT_HEAD(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast( + InsertHeadList(&PoolDesc->ListHeads[Index - 1], (reinterpret_cast( reinterpret_cast(Entry) + POOL_OVERHEAD))); } } diff --git a/src/CxbxKrnl/PoolManager.h b/src/core/kernel/memory-manager/PoolManager.h similarity index 89% rename from src/CxbxKrnl/PoolManager.h rename to src/core/kernel/memory-manager/PoolManager.h index 988f7f2c1..c8e755233 100644 --- a/src/CxbxKrnl/PoolManager.h +++ b/src/core/kernel/memory-manager/PoolManager.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->CxbxKrnl->PoolManager.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -38,7 +29,7 @@ #define POOL_MANAGER_H -#include "VMManager.h" +#include "core\kernel\memory-manager\VMManager.h" #define POOL_BLOCK_SHIFT 5 #define POOL_LIST_HEADS (PAGE_SIZE / (1 << POOL_BLOCK_SHIFT)) // 0x80 diff --git a/src/CxbxKrnl/VMManager.cpp b/src/core/kernel/memory-manager/VMManager.cpp similarity index 86% rename from src/CxbxKrnl/VMManager.cpp rename to src/core/kernel/memory-manager/VMManager.cpp index 843cf13c2..e91c444de 100644 --- a/src/CxbxKrnl/VMManager.cpp +++ b/src/core/kernel/memory-manager/VMManager.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->VMManager.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -36,15 +27,20 @@ // Acknowledgment: // The core logic of the VMManager class is based on the virtual page management code of the citra emulator (GPLv2 license), -// with heavy changes and the addition of real page tables to better suit Cxbx-Reloaded and Xbox emulation. -// Citra website: https://citra-emu.org/ +// with heavy changes and the addition of real page tables to better suit Cxbx-Reloaded and Xbox emulation. +// https://github.com/citra-emu/citra + +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file of Citra at https://github.com/citra-emu/citra/blob/master/license.txt. -#define LOG_PREFIX "VMEM" +#define LOG_PREFIX CXBXR_MODULE::VMEM #include "PoolManager.h" #include "Logging.h" #include "EmuShared.h" +#include "core\kernel\exports\EmuKrnl.h" // For InitializeListHead(), etc. #include @@ -78,31 +74,30 @@ void VMManager::Initialize(HANDLE memory_view, HANDLE pagetables_view, int BootF ConstructMemoryRegion(SYSTEM_MEMORY_BASE, SYSTEM_MEMORY_SIZE, SystemRegion); ConstructMemoryRegion(DEVKIT_MEMORY_BASE, DEVKIT_MEMORY_SIZE, DevkitRegion); + unsigned char PreviousLayout; if ((BootFlags & BOOT_QUICK_REBOOT) != 0) { - UCHAR PreviousXbeType = *(UCHAR*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 9); - if (PreviousXbeType != g_XbeType) - { - // We cannot handle the case where we rebooted to an xbe type different then the previous one we came from, since the RestorePersistentMemory - // expects the memory layout to always be the same between reboots (like it should be). The only legit case is when a chihiro xbe - // reboots to the dashboard, but even then it should actually reboot to a chihiro-specific xbe loader. Another possibility is that - // the xbe has been tampered with: the entry point and the kernel thunk addresses have been xored with a different key to make it - // appear to be of a different type. + // Restore the memory layout we were emulating in the previous session - CxbxKrnlCleanup("Rebooted xbe type doesn't match with the xbe type that performed the reboot. Tampered xbe or rebooting to the \ -dashboard from non-retail xbe?"); - } + PreviousLayout = *(unsigned char*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 9); + m_MmLayoutChihiro = (PreviousLayout == MmChihiro); + m_MmLayoutDebug = (PreviousLayout == MmDebug); + m_MmLayoutRetail = (PreviousLayout == MmRetail); } else { // Save the type of xbe we are emulating in this emulation session. This information will be needed if the current xbe performs // a quick reboot - *(UCHAR*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 9) = g_XbeType; + m_MmLayoutChihiro = (g_XbeType == xtChihiro); + m_MmLayoutDebug = (g_XbeType == xtDebug); + m_MmLayoutRetail = (g_XbeType == xtRetail); + + PreviousLayout = m_MmLayoutChihiro ? MmChihiro : (m_MmLayoutDebug ? MmDebug : MmRetail); } // Set up general memory variables according to the xbe type - if (g_bIsChihiro) + if (m_MmLayoutChihiro) { m_MaxContiguousPfn = CHIHIRO_CONTIGUOUS_MEMORY_LIMIT; g_SystemMaxMemory = CHIHIRO_MEMORY_SIZE; @@ -111,7 +106,7 @@ dashboard from non-retail xbe?"); m_NV2AInstancePage = CHIHIRO_INSTANCE_PHYSICAL_PAGE; m_MemoryRegionArray[ContiguousRegion].RegionMap[CONTIGUOUS_MEMORY_BASE].size = CONTIGUOUS_MEMORY_CHIHIRO_SIZE; } - else if (g_bIsDebug) + else if (m_MmLayoutDebug) { g_SystemMaxMemory = CHIHIRO_MEMORY_SIZE; m_DebuggerPagesAvailable = X64M_PHYSICAL_PAGE; @@ -129,8 +124,8 @@ dashboard from non-retail xbe?"); PFreeBlock block = new FreeBlock; block->start = 0; block->size = m_HighestPage + 1; - LIST_ENTRY_INITIALIZE(&block->ListEntry); - LIST_ENTRY_INSERT_HEAD(ListEntry, &block->ListEntry); + block->ListEntry.Flink = block->ListEntry.Blink = nullptr; // Was LIST_ENTRY_INITIALIZE() + InsertHeadList(ListEntry, &block->ListEntry); // Set up the pfn database if ((BootFlags & BOOT_QUICK_REBOOT) == 0) { @@ -140,6 +135,7 @@ dashboard from non-retail xbe?"); // But right now it persists the whole block". So we also clear the entire mapped memory.bin since we are not quick rebooting xboxkrnl::RtlFillMemoryUlong((void*)CONTIGUOUS_MEMORY_BASE, g_SystemMaxMemory, 0); xboxkrnl::RtlFillMemoryUlong((void*)PAGE_TABLES_BASE, PAGE_TABLES_SIZE, 0); + *(unsigned char*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 9) = PreviousLayout; InitializePfnDatabase(); } else { @@ -154,29 +150,17 @@ dashboard from non-retail xbe?"); // Construct the page directory InitializePageDirectory(); - // We also reserve the remaining region from the reserved xbe image memory up to XBE_MAX_VA since we know it's - // occupied by our memory placeholder and cannot be allocated anyway. We cannot just call XbAllocateVirtualMemory - // since that would result in an increase in the reserved memory usage and also, with XBOX_MEM_RESERVE, the starting - // address will be rounded down to a 64K boundary, which will likely result in an incorrect base address - - if (XBE_MAX_VA - CxbxKrnl_Xbe->m_Header.dwSizeofImage - XBE_IMAGE_BASE > 0) - { - ConstructVMA(XBE_IMAGE_BASE + ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage), - ROUND_DOWN_4K(XBE_MAX_VA - CxbxKrnl_Xbe->m_Header.dwSizeofImage - XBE_IMAGE_BASE), UserRegion, ReservedVma, - false); - } - // Reserve the xbe image memory. Doing this now allows us to avoid calling XbAllocateVirtualMemory later ConstructVMA(XBE_IMAGE_BASE, ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage), UserRegion, ReservedVma, false, XBOX_PAGE_READWRITE); + m_VirtualMemoryBytesReserved += ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage); - - if (g_bIsChihiro) { - printf(LOG_PREFIX " Page table for Chihiro arcade initialized!\n"); + if (m_MmLayoutChihiro) { + printf("Page table for Chihiro arcade initialized!\n"); } - else if (g_bIsDebug) { - printf(LOG_PREFIX " Page table for Debug console initialized!\n"); + else if (m_MmLayoutDebug) { + printf("Page table for Debug console initialized!\n"); } - else { printf(LOG_PREFIX " Page table for Retail console initialized!\n"); } + else { printf("Page table for Retail console initialized!\n"); } } void VMManager::ConstructMemoryRegion(VAddr Start, size_t Size, MemoryRegionType Type) @@ -243,11 +227,11 @@ void VMManager::InitializePfnDatabase() // just a guess of mine, I could be wrong on this... // Construct the pfn's of the pages holding the pfn database - if (g_bIsRetail) { + if (m_MmLayoutRetail) { pfn = XBOX_PFN_DATABASE_PHYSICAL_PAGE; pfn_end = XBOX_PFN_DATABASE_PHYSICAL_PAGE + 16 - 1; } - else if (g_bIsDebug) { + else if (m_MmLayoutDebug) { pfn = XBOX_PFN_DATABASE_PHYSICAL_PAGE; pfn_end = XBOX_PFN_DATABASE_PHYSICAL_PAGE + 32 - 1; } @@ -266,10 +250,10 @@ void VMManager::InitializePfnDatabase() WritePte(PointerPte, EndingPte, TempPte, pfn); ConstructVMA(addr, (pfn_end - pfn + 1) << PAGE_SHIFT, ContiguousRegion, AllocatedVma, false); - if (g_bIsDebug) { m_PhysicalPagesAvailable += 16; m_DebuggerPagesAvailable -= 16; } + if (m_MmLayoutDebug) { m_PhysicalPagesAvailable += 16; m_DebuggerPagesAvailable -= 16; } // Construct the pfn's of the pages holding the nv2a instance memory - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { pfn = XBOX_INSTANCE_PHYSICAL_PAGE; pfn_end = XBOX_INSTANCE_PHYSICAL_PAGE + NV2A_INSTANCE_PAGE_COUNT - 1; } @@ -290,7 +274,7 @@ void VMManager::InitializePfnDatabase() ConstructVMA(addr, NV2A_INSTANCE_PAGE_COUNT << PAGE_SHIFT, ContiguousRegion, AllocatedVma, false); - if (g_bIsDebug) + if (m_MmLayoutDebug) { // Debug kits have two nv2a instance memory, another at the top of the 128 MiB @@ -332,11 +316,11 @@ void VMManager::ReinitializePfnDatabase() // Update the allocation of the pfn database - if (g_bIsRetail) { + if (m_MmLayoutRetail) { pfn = XBOX_PFN_DATABASE_PHYSICAL_PAGE; pfn_end = XBOX_PFN_DATABASE_PHYSICAL_PAGE + 16 - 1; } - else if (g_bIsDebug) { + else if (m_MmLayoutDebug) { pfn = XBOX_PFN_DATABASE_PHYSICAL_PAGE; pfn_end = XBOX_PFN_DATABASE_PHYSICAL_PAGE + 32 - 1; } @@ -345,7 +329,7 @@ void VMManager::ReinitializePfnDatabase() pfn_end = CHIHIRO_PFN_DATABASE_PHYSICAL_PAGE + 32 - 1; } RestorePersistentAllocation((VAddr)CONVERT_PFN_TO_CONTIGUOUS_PHYSICAL(pfn), pfn, pfn_end, UnknownType); - if (g_bIsDebug) { m_PhysicalPagesAvailable += 16; m_DebuggerPagesAvailable -= 16; } + if (m_MmLayoutDebug) { m_PhysicalPagesAvailable += 16; m_DebuggerPagesAvailable -= 16; } { @@ -356,7 +340,7 @@ void VMManager::ReinitializePfnDatabase() // Re-construct the allocation of the nv2a instance memory // NOTE: the entire instance memory is persisted during a quick reboot, however, it doesn't change anything to re-construct it // here since we would just have to move this block of code to a specific vmmanager reboot routine called in HalReturnToFirmware - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { pfn = XBOX_INSTANCE_PHYSICAL_PAGE; pfn_end = XBOX_INSTANCE_PHYSICAL_PAGE + NV2A_INSTANCE_PAGE_COUNT - 1; } @@ -373,7 +357,7 @@ void VMManager::ReinitializePfnDatabase() WritePte(GetPteAddress(addr), GetPteAddress(CONVERT_PFN_TO_CONTIGUOUS_PHYSICAL(pfn_end)), TempPte, pfn); - if (g_bIsDebug) + if (m_MmLayoutDebug) { // Debug kits have two nv2a instance memory, another at the top of the 128 MiB @@ -427,7 +411,7 @@ void VMManager::ConstructVMA(VAddr Start, size_t Size, MemoryRegionType Type, VM { // Already at the beginning of the map, bail out immediately - EmuWarning(LOG_PREFIX " Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); + EmuLog(LOG_LEVEL::WARNING, "Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); m_MemoryRegionArray[Type].LastFree = m_MemoryRegionArray[Type].RegionMap.end(); return; } @@ -449,7 +433,7 @@ void VMManager::ConstructVMA(VAddr Start, size_t Size, MemoryRegionType Type, VM // ergo720: I don't expect this to happen since it would mean we have exhausted the virtual space in the memory region, // but it's just in case it does - EmuWarning(LOG_PREFIX " Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); + EmuLog(LOG_LEVEL::WARNING, "Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); m_MemoryRegionArray[Type].LastFree = m_MemoryRegionArray[Type].RegionMap.end(); @@ -511,7 +495,7 @@ void VMManager::MemoryStatistics(xboxkrnl::PMM_STATISTICS memory_statistics) Lock(); memory_statistics->TotalPhysicalPages = g_SystemMaxMemory >> PAGE_SHIFT; - memory_statistics->AvailablePages = g_bIsDebug && m_bAllowNonDebuggerOnTop64MiB ? + memory_statistics->AvailablePages = m_MmLayoutDebug && m_bAllowNonDebuggerOnTop64MiB ? m_PhysicalPagesAvailable + m_DebuggerPagesAvailable : m_PhysicalPagesAvailable; memory_statistics->VirtualMemoryBytesCommitted = (m_PagesByUsage[VirtualMemoryType] + m_PagesByUsage[ImageType]) << PAGE_SHIFT; @@ -534,7 +518,7 @@ VAddr VMManager::ClaimGpuMemory(size_t Size, size_t* BytesToSkip) // Note that, even though devkits have 128 MiB, there's no need to have a different case for those, since the instance // memory is still located 0x10000 bytes from the top of memory just like retail consoles - if (g_bIsChihiro) + if (m_MmLayoutChihiro) *BytesToSkip = 0; else *BytesToSkip = CONVERT_PFN_TO_CONTIGUOUS_PHYSICAL(X64M_PHYSICAL_PAGE) - @@ -568,7 +552,7 @@ VAddr VMManager::ClaimGpuMemory(size_t Size, size_t* BytesToSkip) InsertFree(pfn, EndingPfn); DestructVMA((VAddr)CONVERT_PFN_TO_CONTIGUOUS_PHYSICAL(pfn), ContiguousRegion, m_NV2AInstanceMemoryBytes - Size); - if (g_bIsDebug) + if (m_MmLayoutDebug) { // Devkits have also another nv2a instance memory at the top of memory, so free also that // 3fe0: nv2a; 3ff0: pfn; 4000 + 3fe0: nv2a; 4000 + 3fe0 + 10: free @@ -586,7 +570,7 @@ VAddr VMManager::ClaimGpuMemory(size_t Size, size_t* BytesToSkip) } m_NV2AInstanceMemoryBytes = Size; - DbgPrintf("VMEM: MmClaimGpuInstanceMemory : Allocated bytes remaining = 0x%.8X\n", m_NV2AInstanceMemoryBytes); + EmuLog(LOG_LEVEL::DEBUG, "MmClaimGpuInstanceMemory : Allocated bytes remaining = 0x%.8X", m_NV2AInstanceMemoryBytes); Unlock(); } @@ -633,12 +617,12 @@ void VMManager::PersistMemory(VAddr addr, size_t Size, bool bPersist) if (bPersist) { *(VAddr*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 4) = addr; - DbgPrintf("KNRL: Persisting LaunchDataPage\n"); + EmuLog(LOG_LEVEL::DEBUG, "Persisting LaunchDataPage"); } else { *(VAddr*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 4) = NULL; - DbgPrintf("KNRL: Forgetting LaunchDataPage\n"); + EmuLog(LOG_LEVEL::DEBUG, "Forgetting LaunchDataPage"); } } else @@ -646,12 +630,12 @@ void VMManager::PersistMemory(VAddr addr, size_t Size, bool bPersist) if (bPersist) { *(VAddr*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 8) = addr; - DbgPrintf("KNRL: Persisting FrameBuffer\n"); + EmuLog(LOG_LEVEL::DEBUG, "Persisting FrameBuffer"); } else { *(VAddr*)(CONTIGUOUS_MEMORY_BASE + PAGE_SIZE - 8) = NULL; - DbgPrintf("KNRL: Forgetting FrameBuffer\n"); + EmuLog(LOG_LEVEL::DEBUG, "Forgetting FrameBuffer"); } } } @@ -668,7 +652,7 @@ void VMManager::RestorePersistentMemory() PMMPTE PointerPte = GetPteAddress(CONTIGUOUS_MEMORY_BASE); PMMPTE EndingPte; - if (g_bIsRetail) { + if (m_MmLayoutRetail) { EndingPte = GetPteAddress(CONTIGUOUS_MEMORY_BASE + CONTIGUOUS_MEMORY_XBOX_SIZE - 1); } else { @@ -696,10 +680,10 @@ void VMManager::RestorePersistentMemory() xboxkrnl::RtlFillMemoryUlong((void*)EndingPte, PAGE_TABLES_END + 1 - (VAddr)EndingPte, 0); // Zero all the entries of the PFN database - if (g_bIsRetail) { + if (m_MmLayoutRetail) { xboxkrnl::RtlFillMemoryUlong((void*)XBOX_PFN_ADDRESS, X64KB, 0); // Xbox: 64 KiB } - else if (g_bIsChihiro) { + else if (m_MmLayoutChihiro) { xboxkrnl::RtlFillMemoryUlong((void*)CHIHIRO_PFN_ADDRESS, X64KB * 2, 0); // Chihiro: 128 KiB } else { @@ -719,7 +703,7 @@ void VMManager::RestorePersistentMemory() RestorePersistentAllocation(LauchDataAddress, GetPteAddress(LauchDataAddress)->Hardware.PFN, GetPteAddress(LauchDataAddress)->Hardware.PFN, ContiguousType); - DbgPrintf("VMEM: Restored LaunchDataPage\n"); + EmuLog(LOG_LEVEL::DEBUG, "Restored LaunchDataPage"); } if (FrameBufferAddress != 0 && IS_PHYSICAL_ADDRESS(FrameBufferAddress)) { @@ -729,7 +713,7 @@ void VMManager::RestorePersistentMemory() RestorePersistentAllocation(FrameBufferAddress, GetPteAddress(FrameBufferAddress)->Hardware.PFN, GetPteAddress(FrameBufferAddress)->Hardware.PFN + (QuerySize(FrameBufferAddress, false) >> PAGE_SHIFT) - 1, ContiguousType); - DbgPrintf("VMEM: Restored FrameBuffer\n"); + EmuLog(LOG_LEVEL::DEBUG, "Restored FrameBuffer"); } } } @@ -758,11 +742,11 @@ VAddr VMManager::Allocate(size_t Size) PteNumber = ROUND_UP_4K(Size) >> PAGE_SHIFT; - if (!IsMappable(PteNumber, true, g_bIsDebug && m_bAllowNonDebuggerOnTop64MiB ? true : false)) { goto Fail; } + if (!IsMappable(PteNumber, true, m_MmLayoutDebug && m_bAllowNonDebuggerOnTop64MiB ? true : false)) { goto Fail; } ConvertXboxToPteProtection(XBOX_PAGE_EXECUTE_READWRITE, &TempPte); - if (RemoveFree(PteNumber, &pfn, 0, 0, g_bIsDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE + if (RemoveFree(PteNumber, &pfn, 0, 0, m_MmLayoutDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE : m_HighestPage)) // MapViewOfFileEx path { MappingRoutine = &VMManager::MapBlockWithMapViewOfFileEx; @@ -813,7 +797,7 @@ VAddr VMManager::Allocate(size_t Size) // With VirtualAlloc we grab one page at a time to avoid fragmentation issues while (PointerPte <= EndingPte) { - RemoveFree(1, &TempPfn, 0, 0, g_bIsDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE + RemoveFree(1, &TempPfn, 0, 0, m_MmLayoutDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE : m_HighestPage); WritePfn(TempPfn, TempPfn, PointerPte, ImageType); WritePte(PointerPte, PointerPte, TempPte, TempPfn); @@ -863,19 +847,24 @@ VAddr VMManager::AllocateSystemMemory(PageType BusyType, DWORD Perms, size_t Siz PMMPTE EndingPte; PFN pfn; PFN EndingPfn; - PFN LowestAcceptablePfn = 0; - PFN HighestAcceptablePfn = XBOX_HIGHEST_PHYSICAL_PAGE; + PFN LowestAcceptablePfn; + PFN HighestAcceptablePfn; PFN_COUNT PteNumber; PFN_COUNT PagesNumber; VAddr addr; MappingFn MappingRoutine; - bool bVAlloc = false; - MemoryRegionType MemoryType = SystemRegion; + bool bVAlloc; + MemoryRegionType MemoryType; // NOTE: AllocateSystemMemory won't allocate a physical page for the guard page (if requested) and just adds an extra // unallocated virtual page in front of the mapped allocation. For this reason we will decommmit later the extra guard page allocated - if (!Size || !ConvertXboxToSystemPteProtection(Perms, &TempPte)) { RETURN(NULL); } + if (!Size || !ConvertXboxToSystemPteProtection(Perms, &TempPte)) { RETURN(NULL); } + + LowestAcceptablePfn = 0; + HighestAcceptablePfn = m_MmLayoutDebug ? XBOX_HIGHEST_PHYSICAL_PAGE : m_HighestPage; + bVAlloc = false; + MemoryType = SystemRegion; Lock(); @@ -1015,13 +1004,13 @@ VAddr VMManager::AllocateContiguous(size_t Size, PAddr LowestAddress, PAddr High HigherPfn = HighestAddress >> PAGE_SHIFT; PfnAlignment = Alignment >> PAGE_SHIFT; - if (!IsMappable(PteNumber, true, false)) { goto Fail; } if (HigherPfn > m_MaxContiguousPfn) { HigherPfn = m_MaxContiguousPfn; } if (LowerPfn > HigherPfn) { LowerPfn = HigherPfn; } if (!PfnAlignment) { PfnAlignment = 1; } Lock(); + if (!IsMappable(PteNumber, true, false)) { goto Fail; } if (!RemoveFree(PteNumber, &pfn, PfnAlignment, LowerPfn, HigherPfn)) { goto Fail; } addr = CONTIGUOUS_MEMORY_BASE + (pfn << PAGE_SHIFT); @@ -1098,7 +1087,10 @@ VAddr VMManager::MapDeviceMemory(PAddr Paddr, size_t Size, DWORD Perms) if (!addr) { goto Fail; } // check if we have to construct the PT's for this allocation - if (!AllocatePT(PteNumber << PAGE_SHIFT, addr)) { goto Fail; } + if (!AllocatePT(PteNumber << PAGE_SHIFT, addr)) { + VirtualFree((void*)addr, 0, MEM_RELEASE); + goto Fail; + } // Finally, write the pte's PointerPte = GetPteAddress(addr); @@ -1129,15 +1121,16 @@ void VMManager::Deallocate(VAddr addr) PFN EndingPfn; PFN_COUNT PteNumber; VMAIter it; + bool bOverflow; assert(CHECK_ALIGNMENT(addr, PAGE_SIZE)); // all starting addresses in the user region are page aligned assert(IS_USER_ADDRESS(addr)); Lock(); - it = CheckExistenceVMA(addr, UserRegion); + it = CheckConflictingVMA(addr, 0, UserRegion, &bOverflow); - if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || it->second.type == FreeVma) + if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || bOverflow) { Unlock(); return; @@ -1170,7 +1163,7 @@ void VMManager::Deallocate(VAddr addr) } WritePte(StartingPte, EndingPte, *StartingPte, 0, true); - DestructVMA(it->first, UserRegion, it->second.size); // does Deallocate ever attempt to decommit only a part of the original allocation? + DestructVMA(it->first, UserRegion, it->second.size); DeallocatePT(PteNumber << PAGE_SHIFT, addr); Unlock(); @@ -1187,15 +1180,16 @@ void VMManager::DeallocateContiguous(VAddr addr) PFN pfn; PFN EndingPfn; VMAIter it; + bool bOverflow; assert(CHECK_ALIGNMENT(addr, PAGE_SIZE)); // all starting addresses in the contiguous region are page aligned assert(IS_PHYSICAL_ADDRESS(addr)); Lock(); - it = CheckExistenceVMA(addr, ContiguousRegion); + it = CheckConflictingVMA(addr, 0, ContiguousRegion, &bOverflow); - if (it == m_MemoryRegionArray[ContiguousRegion].RegionMap.end() || it->second.type == FreeVma) + if (it == m_MemoryRegionArray[ContiguousRegion].RegionMap.end() || bOverflow) { Unlock(); return; @@ -1231,13 +1225,12 @@ PFN_COUNT VMManager::DeallocateSystemMemory(PageType BusyType, VAddr addr, size_ VMAIter it; MemoryRegionType MemoryType = SystemRegion; bool bGuardPageAdded = false; + bool bOverflow; assert(CHECK_ALIGNMENT(addr, PAGE_SIZE)); // all starting addresses in the system region are page aligned Lock(); - // We cannot do the size check because the functions that call this can provide 0 as size, meaning - // that we have to calculate it ourselves if (BusyType == DebuggerType) { assert(IS_DEVKIT_ADDRESS(addr)); @@ -1245,9 +1238,9 @@ PFN_COUNT VMManager::DeallocateSystemMemory(PageType BusyType, VAddr addr, size_ } else { assert(IS_SYSTEM_ADDRESS(addr)); } - it = GetVMAIterator(addr, MemoryType); + it = CheckConflictingVMA(addr, 0, MemoryType, &bOverflow); - if (it == m_MemoryRegionArray[MemoryType].RegionMap.end() || it->second.type == FreeVma) + if (it == m_MemoryRegionArray[MemoryType].RegionMap.end() || bOverflow) { Unlock(); RETURN(NULL); @@ -1312,22 +1305,24 @@ void VMManager::UnmapDeviceMemory(VAddr addr, size_t Size) PMMPTE EndingPte; PFN_COUNT PteNumber; VMAIter it; + bool bOverflow; // The starting address of a device can be unaligned since MapDeviceMemory returns an offset from the aligned // mapped address, so we won't assert the address here Lock(); - it = CheckExistenceVMA(addr, SystemRegion, PAGES_SPANNED(addr, Size) << PAGE_SHIFT); + Size = PAGES_SPANNED(addr, Size) << PAGE_SHIFT; + it = CheckConflictingVMA(addr, Size, SystemRegion, &bOverflow); - if (it == m_MemoryRegionArray[SystemRegion].RegionMap.end() || it->second.type == FreeVma) + if (it == m_MemoryRegionArray[SystemRegion].RegionMap.end() || bOverflow) { Unlock(); return; } StartingPte = GetPteAddress(addr); - EndingPte = StartingPte + (it->second.size >> PAGE_SHIFT) - 1; + EndingPte = StartingPte + (Size >> PAGE_SHIFT) - 1; PteNumber = EndingPte - StartingPte + 1; WritePte(StartingPte, EndingPte, *StartingPte, 0, true); @@ -1359,17 +1354,6 @@ void VMManager::Protect(VAddr addr, size_t Size, DWORD NewPerms) Lock(); - // This routine is allowed to change the protections of only a part of the pages of an allocation, and the supplied - // address doesn't necessarily need to be the starting address of the vma, meaning we can't check the vma existence - // with CheckExistenceVMA - - #ifdef _DEBUG_TRACE - MemoryRegionType MemoryType = IS_PHYSICAL_ADDRESS(addr) ? ContiguousRegion : SystemRegion; - VMAIter it = GetVMAIterator(addr, MemoryType); - assert(it != m_MemoryRegionArray[MemoryType].RegionMap.end() && addr >= it->first && - addr < it->first + it->second.size && it->second.type != FreeVma); - #endif - PointerPte = GetPteAddress(addr); EndingPte = GetPteAddress(addr + Size - 1); @@ -1460,7 +1444,7 @@ size_t VMManager::QuerySize(VAddr addr, bool bCxbxCaller) else if(IS_USER_ADDRESS(addr)) { Type = UserRegion; } else { - DbgPrintf("VMEM: QuerySize: Unknown memory region queried.\n"); + EmuLog(LOG_LEVEL::DEBUG, "QuerySize: Unknown memory region queried."); Unlock(); RETURN(Size); } @@ -1530,7 +1514,7 @@ void VMManager::LockBufferOrSinglePage(PAddr paddr, VAddr addr, size_t Size, boo if (pfn <= m_HighestPage) { - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { PfnEntry = XBOX_PFN_ELEMENT(pfn); } else { PfnEntry = CHIHIRO_PFN_ELEMENT(pfn); } @@ -1546,7 +1530,7 @@ void VMManager::LockBufferOrSinglePage(PAddr paddr, VAddr addr, size_t Size, boo else // lock a single page { pfn = paddr >> PAGE_SHIFT; - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { PfnEntry = XBOX_PFN_ELEMENT(pfn); } else { PfnEntry = CHIHIRO_PFN_ELEMENT(pfn); } @@ -1591,6 +1575,7 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit VMAIter it; bool bDestructVmaOnFailure = false; bool bUpdatePteProtections = false; + bool bOverflow; // Invalid base address if (CapturedBase > HIGHEST_VMA_ADDRESS) { RETURN(STATUS_INVALID_PARAMETER); } @@ -1616,7 +1601,7 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit if (!ConvertXboxToPteProtection(Protect, &TempPte)) { RETURN(STATUS_INVALID_PAGE_PROTECTION); } - DbgPrintf("VMEM: XbAllocateVirtualMemory requested range : 0x%.8X - 0x%.8X\n", CapturedBase, CapturedBase + CapturedSize); + EmuLog(LOG_LEVEL::DEBUG, "%s requested range : 0x%.8X - 0x%.8X", __func__, CapturedBase, CapturedBase + CapturedSize); Lock(); @@ -1654,20 +1639,40 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit } else { - // A base address was specified. We could check with CheckConflictingVMA to see if it's already allocated but even it is free, there - // could still be host allocations in the vma. So we just attempt to map the block and see if it fails or not - AlignedCapturedBase = ROUND_DOWN(CapturedBase, X64KB); AlignedCapturedSize = ROUND_UP_4K(CapturedSize); + it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize, UserRegion, &bOverflow); - if ((VAddr)VirtualAlloc((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_RESERVE, - ConvertXboxToWinProtection(PatchXboxPermissions(Protect)) & ~(PAGE_WRITECOMBINE | PAGE_NOCACHE)) != AlignedCapturedBase) + if (it != m_MemoryRegionArray[UserRegion].RegionMap.end() || bOverflow) { - // Something else is already mapped there, report an error + // Reserved vma or we are overflowing a free vma, report an error status = STATUS_CONFLICTING_ADDRESSES; goto Exit; } + + // Hack: check if the title is attempting to reserve in the region between the reserved xbe image memory up to XBE_MAX_VA. + // Once the memory placeholder is gone, this can be removed. + // Note: this will not work if the title attempts to reserve inside the placeholder with a size that makes the + // allocation exceed the end of the placeholder at XBE_MAX_VA (e.g.: Fable does this!) and it doesn't accept + // any other address but the requested one (e.g.: Project Zero 1 does this!). No title is known to do this, but it's + // teoretically possible... + + if (AlignedCapturedBase < XBE_MAX_VA && AlignedCapturedBase >= ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage) + XBE_IMAGE_BASE + && AlignedCapturedBase + AlignedCapturedSize - 1 < XBE_MAX_VA) + { + // Don't do anything, ConstructVMA will be called below to track the allocation inside the placeholder + } + else { + if ((VAddr)VirtualAlloc((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_RESERVE, + ConvertXboxToWinProtection(PatchXboxPermissions(Protect)) & ~(PAGE_WRITECOMBINE | PAGE_NOCACHE)) != AlignedCapturedBase) + { + // An host allocation is already mapped there, report an error + + status = STATUS_CONFLICTING_ADDRESSES; + goto Exit; + } + } } m_VirtualMemoryBytesReserved += AlignedCapturedSize; @@ -1677,8 +1682,7 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit { // XBOX_MEM_COMMIT was not specified, so we are done with the allocation - DbgPrintf("VMEM: XbAllocateVirtualMemory resulting range : 0x%.8X - 0x%.8X\n", AlignedCapturedBase, - AlignedCapturedBase + AlignedCapturedSize); + EmuLog(LOG_LEVEL::DEBUG, "%s resulting range : 0x%.8X - 0x%.8X", __func__, AlignedCapturedBase, AlignedCapturedBase + AlignedCapturedSize); *addr = AlignedCapturedBase; *Size = AlignedCapturedSize; @@ -1698,11 +1702,11 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit AlignedCapturedBase = ROUND_DOWN_4K(CapturedBase); AlignedCapturedSize = (PAGES_SPANNED(CapturedBase, CapturedSize)) << PAGE_SHIFT; - it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize); + it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize, UserRegion, &bOverflow); - if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || it->second.type != ReservedVma) + if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || bOverflow) { - // The specified region is not completely inside a reserved vma + // The specified region is not completely inside a reserved vma or it's free status = STATUS_CONFLICTING_ADDRESSES; goto Exit; @@ -1734,12 +1738,26 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit PointerPte++; } - if (!IsMappable(PteNumber, true, g_bIsDebug && m_bAllowNonDebuggerOnTop64MiB ? true : false)) + if (!IsMappable(PteNumber, true, m_MmLayoutDebug && m_bAllowNonDebuggerOnTop64MiB ? true : false)) { status = STATUS_NO_MEMORY; goto Exit; } + // Attempt to commit the requested range with VirtualAlloc *before* setting up and reserving the PT + // This allows an early-out in a failure scenario (Test Case: Star Wars Battlefront DVD Demo: LA-018 v1.02) + // We don't commit the requested range if it's within our placeholder, since that was already allocated earlier + if (AlignedCapturedBase >= XBE_MAX_VA) + { + if (!VirtualAlloc((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_COMMIT, + (ConvertXboxToWinProtection(PatchXboxPermissions(Protect))) & ~(PAGE_WRITECOMBINE | PAGE_NOCACHE))) + { + EmuLog(LOG_LEVEL::DEBUG, "%s: VirtualAlloc failed to commit the memory! The error was %d", __func__, GetLastError()); + status = STATUS_NO_MEMORY; + goto Exit; + } + } + // Check if we have to construct the PT's for this allocation if (!AllocatePT(AlignedCapturedSize, AlignedCapturedBase)) @@ -1757,7 +1775,7 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit { if (PointerPte->Default == 0) { - RemoveFree(1, &TempPfn, 0, 0, g_bIsDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE : m_HighestPage); + RemoveFree(1, &TempPfn, 0, 0, m_MmLayoutDebug && !m_bAllowNonDebuggerOnTop64MiB ? XBOX_HIGHEST_PHYSICAL_PAGE : m_HighestPage); WritePfn(TempPfn, TempPfn, PointerPte, BusyType); WritePte(PointerPte, PointerPte, TempPte, TempPfn); } @@ -1765,21 +1783,9 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit PointerPte++; } - // Actually commit the requested range. Because of the check done by CheckConflictingVMA, this call shouldn't fail now but we still - // check to see if it succeeds or not... - - if (AlignedCapturedBase >= XBE_MAX_VA) - { - if (!VirtualAlloc((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_COMMIT, - (ConvertXboxToWinProtection(PatchXboxPermissions(Protect))) & ~(PAGE_WRITECOMBINE | PAGE_NOCACHE))) - { - DbgPrintf("VMEM: XbAllocateVirtualMemory: VirtualAlloc failed to commit the memory! The error was %d\n", GetLastError()); - } - } - // Because VirtualAlloc always zeros the memory for us, XBOX_MEM_NOZERO is still unsupported - if (AllocationType & XBOX_MEM_NOZERO) { DbgPrintf("VMEM: XBOX_MEM_NOZERO flag is not supported!\n"); } + if (AllocationType & XBOX_MEM_NOZERO) { EmuLog(LOG_LEVEL::DEBUG, "XBOX_MEM_NOZERO flag is not supported!"); } // If some pte's were detected to have different permissions in the above check, we need to update those as well @@ -1791,8 +1797,7 @@ xboxkrnl::NTSTATUS VMManager::XbAllocateVirtualMemory(VAddr* addr, ULONG ZeroBit XbVirtualProtect(&TempAddr, &TempSize, &TempProtect); } - DbgPrintf("VMEM: XbAllocateVirtualMemory resulting range : 0x%.8X - 0x%.8X\n", AlignedCapturedBase, - AlignedCapturedBase + AlignedCapturedSize); + EmuLog(LOG_LEVEL::DEBUG, "%s resulting range : 0x%.8X - 0x%.8X", __func__, AlignedCapturedBase, AlignedCapturedBase + AlignedCapturedSize); *addr = AlignedCapturedBase; *Size = AlignedCapturedSize; @@ -1828,6 +1833,7 @@ xboxkrnl::NTSTATUS VMManager::XbFreeVirtualMemory(VAddr* addr, size_t* Size, DWO PFN TempPfn; PageType BusyType; VMAIter it; + bool bOverflow; // Only MEM_DECOMMIT and MEM_RELEASE are valid @@ -1850,19 +1856,19 @@ xboxkrnl::NTSTATUS VMManager::XbFreeVirtualMemory(VAddr* addr, size_t* Size, DWO Lock(); - it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize); + it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize, UserRegion, &bOverflow); - if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || it->second.type != ReservedVma) + if (it == m_MemoryRegionArray[UserRegion].RegionMap.end()) { - // Vma not found, report an error + // Free vma, report an error status = STATUS_MEMORY_NOT_ALLOCATED; goto Exit; } - if (it->first + it->second.size - 1 < AlignedCapturedBase + AlignedCapturedSize - 1) + if (bOverflow) { - // The provided ending adddress spans beyond the end of the vma, report an error + // The provided ending adddress is beyond the end of the vma, report an error status = STATUS_UNABLE_TO_FREE_VM; goto Exit; @@ -1931,7 +1937,7 @@ xboxkrnl::NTSTATUS VMManager::XbFreeVirtualMemory(VAddr* addr, size_t* Size, DWO { TempPfn = PointerPte->Hardware.PFN; InsertFree(TempPfn, TempPfn); - if (g_bIsRetail || g_bIsDebug) { + if (m_MmLayoutRetail || m_MmLayoutDebug) { BusyType = (PageType)(XBOX_PFN_ELEMENT(TempPfn)->Busy.BusyType); } else { BusyType = (PageType)(CHIHIRO_PFN_ELEMENT(TempPfn)->Busy.BusyType); } @@ -1948,9 +1954,12 @@ xboxkrnl::NTSTATUS VMManager::XbFreeVirtualMemory(VAddr* addr, size_t* Size, DWO { // With XBOX_MEM_DECOMMIT DestructVMA is not called and so we have to call VirtualFree ourselves - if (!VirtualFree((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_DECOMMIT)) + if (AlignedCapturedBase >= XBE_MAX_VA) { - DbgPrintf("VMEM: XbFreeVirtualMemory: VirtualFree failed to decommit the memory! The error was %d\n", GetLastError()); + if (!VirtualFree((void*)AlignedCapturedBase, AlignedCapturedSize, MEM_DECOMMIT)) + { + EmuLog(LOG_LEVEL::DEBUG, "%s: VirtualFree failed to decommit the memory! The error was %d", __func__, GetLastError()); + } } } @@ -1985,6 +1994,7 @@ xboxkrnl::NTSTATUS VMManager::XbVirtualProtect(VAddr* addr, size_t* Size, DWORD* MMPTE NewPermsPte; MMPTE OldPermsPte; VMAIter it; + bool bOverflow; // Invalid base address @@ -2003,11 +2013,11 @@ xboxkrnl::NTSTATUS VMManager::XbVirtualProtect(VAddr* addr, size_t* Size, DWORD* Lock(); - it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize); + it = CheckConflictingVMA(AlignedCapturedBase, AlignedCapturedSize, UserRegion, &bOverflow); - if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || it->second.type != ReservedVma) + if (it == m_MemoryRegionArray[UserRegion].RegionMap.end() || bOverflow) { - // Vma not found, report an error + // Free vma or the requested ending address is beyond the vma, report an error status = STATUS_CONFLICTING_ADDRESSES; goto Exit; @@ -2098,15 +2108,16 @@ xboxkrnl::NTSTATUS VMManager::XbVirtualMemoryStatistics(VAddr addr, xboxkrnl::PM { // The memory in the user region is allocated in multiples of 64K, so this means that the last possible vma cannot start beyond // HIGHEST_VMA_ADDRESS. This is true for allocations done by both XbAllocateVirtualMemory and Allocate, which both will be counted. - // The allocations done by the host are invisible here (like they should be) return STATUS_INVALID_PARAMETER; } - // If it's not in the XBE, report actual host allocations - // The game will see allocations it didn't make, but at least it has a chance to + // If it's not in the placeholder, report actual host allocations. The game will see allocations it didn't make, but at least it has a chance to // not try to allocate memory our emulator already occupied. - if (addr > XBE_IMAGE_BASE + ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage)) + // Note1: VirtualQuery will always report the placeholder as committed, even when the VMManager will report it as free, so we need to query it + // ourselves to correctly report committed/free areas in the placeholder. + // Note2: when LLE CPU is implemented, this can be removed. + if (addr >= XBE_MAX_VA) { MEMORY_BASIC_INFORMATION info; if (VirtualQuery((void*)addr, &info, sizeof(info))) @@ -2128,18 +2139,12 @@ xboxkrnl::NTSTATUS VMManager::XbVirtualMemoryStatistics(VAddr addr, xboxkrnl::PM Lock(); // Locate the vma containing the supplied address - it = GetVMAIterator(addr, UserRegion); - // NOTE: we count the first 64K block below 0x10000 and the reserved area in the memory placeholder after the xbe image as free areas - // TODO: should allocations made by Allocate be visible to this function or not? + if (addr < LOWEST_USER_ADDRESS || (it != m_MemoryRegionArray[UserRegion].RegionMap.end() && it->second.type == FreeVma)) { - if (addr < LOWEST_USER_ADDRESS - || (addr >= XBE_IMAGE_BASE + ROUND_UP_4K(CxbxKrnl_Xbe->m_Header.dwSizeofImage) && addr < XBE_MAX_VA) - || (it != m_MemoryRegionArray[UserRegion].RegionMap.end() && it->second.type == FreeVma)) { - - if (addr < LOWEST_USER_ADDRESS) - { + // The address belongs to a free VMA, so we have little to do. + if (addr < LOWEST_USER_ADDRESS) { RegionSize = LOWEST_USER_ADDRESS - ROUND_DOWN_4K(addr); } else { RegionSize = it->first + it->second.size - ROUND_DOWN_4K(addr); } @@ -2283,7 +2288,7 @@ VAddr VMManager::MapMemoryBlock(MappingFn MappingRoutine, MemoryRegionType Type, { // We are already at the beginning of the map, so bail out immediately - EmuWarning(LOG_PREFIX " Failed to map a memory block in the virtual region %d!", Type); + EmuLog(LOG_LEVEL::WARNING, "Failed to map a memory block in the virtual region %d!", Type); return NULL; } @@ -2314,7 +2319,7 @@ VAddr VMManager::MapMemoryBlock(MappingFn MappingRoutine, MemoryRegionType Type, // We have failed to map the block. This is likely because the virtual space is fragmented or there are too many // host allocations in the memory region. Log this error and bail out - EmuWarning(LOG_PREFIX " Failed to map a memory block in the virtual region %d!", Type); + EmuLog(LOG_LEVEL::WARNING, "Failed to map a memory block in the virtual region %d!", Type); return NULL; } @@ -2401,9 +2406,57 @@ PAddr VMManager::TranslateVAddrToPAddr(const VAddr addr) PAddr PAddr; PMMPTE PointerPte; + //MemoryRegionType Type; Lock(); + // ergo720: horrendous hack, this identity maps all allocations done by the VMManager to keep the LLE USB working. + // The problem is that if the user buffer pointed to by the TD is allocated by the VMManager with VirtualAlloc, then + // the physical allocation will not reside in memory.bin and if we tried to access the physical address of it, we + // would access a random page with undefined contents. + // NOTE: Once LLE CPU and MMU are implemented, this can be removed. + + //if (IS_USER_ADDRESS(addr)) { Type = UserRegion; } + //else if (IS_PHYSICAL_ADDRESS(addr)) { Type = ContiguousRegion; } + //else if (IS_SYSTEM_ADDRESS(addr)) { Type = SystemRegion; } + //else if (IS_DEVKIT_ADDRESS(addr)) { Type = DevkitRegion; } + //else { Type = COUNTRegion; } + + if (true/*(addr >= PAGE_TABLES_BASE && addr <= PAGE_TABLES_END) || (Type != COUNTRegion && Type != ContiguousRegion)*/) { + if (IsValidVirtualAddress(addr)) { + EmuLog(LOG_LEVEL::WARNING, "Applying identity mapping hack to allocation at address 0x%X", addr); + Unlock(); + RETURN(addr); + /* + if (Type == UserRegion) { + EmuLog(LOG_LEVEL::WARNING, "Applying identity mapping hack to allocation at address 0x%X", addr); + Unlock(); + RETURN(addr); // committed pages in the user region always use VirtualAlloc + } + else if (Type != COUNTRegion) { + VMAIter it = GetVMAIterator(addr, Type); + if (it != m_MemoryRegionArray[Type].RegionMap.end() && it->second.type != FreeVma && it->second.bFragmented) { + EmuLog(LOG_LEVEL::WARNING, "Applying identity mapping hack to allocation at address 0x%X", addr); + Unlock(); + RETURN(addr); // committed pages in the system-devkit regions can use VirtualAlloc because of fragmentation + } + } + else { + // This is the special case of the page tables region at 0xC0000000. This area doesn't have a memory region assigned to, + // and never uses VirtualAlloc, but it's still affected by the above problem since its physical pages don't come from + // our memory.bin at 0x80000000, so it needs the hack as well. + + EmuLog(LOG_LEVEL::WARNING, "Applying identity mapping hack to allocation at address 0x%X", addr); + Unlock(); + RETURN(addr); + } + */ + } + else { + goto InvalidAddress; + } + } + PointerPte = GetPdeAddress(addr); if (PointerPte->Hardware.Valid == 0) { // invalid pde -> addr is invalid goto InvalidAddress; @@ -2568,46 +2621,32 @@ void VMManager::UpdateMemoryPermissions(VAddr addr, size_t Size, DWORD Perms) DWORD dummy; if (!VirtualProtect((void*)addr, Size, WindowsPerms & ~(PAGE_WRITECOMBINE | PAGE_NOCACHE), &dummy)) { - DbgPrintf("VMEM: VirtualProtect failed. The error code was %d\n", GetLastError()); + EmuLog(LOG_LEVEL::DEBUG, "VirtualProtect failed. The error code was %d", GetLastError()); } } -VMAIter VMManager::CheckExistenceVMA(VAddr addr, MemoryRegionType Type, size_t Size) +VMAIter VMManager::CheckConflictingVMA(VAddr addr, size_t Size, MemoryRegionType Type, bool* bOverflow) { - // Note that this routine expects an aligned size when specified (since all vma's are allocated size aligned to a page - // boundary). The caller should do this. - + *bOverflow = false; VMAIter it = GetVMAIterator(addr, Type); - if (it != m_MemoryRegionArray[Type].RegionMap.end() && it->first == addr) - { - if (Size) - { - if (it->second.size == Size) - { - return it; - } - DbgPrintf("VMEM: Located vma but sizes don't match\n"); - return m_MemoryRegionArray[Type].RegionMap.end(); - } + + if (it == m_MemoryRegionArray[Type].RegionMap.end()) { + // Pretend we are overflowing since an overflow is always an error. Otherwise, end() will be interpreted + // as a found free VMA. + + *bOverflow = true; return it; } - else - { - DbgPrintf("VMEM: Vma not found or doesn't start at the supplied address\n"); - return m_MemoryRegionArray[Type].RegionMap.end(); + + if (Size != 0 && (it->first + it->second.size - 1 < addr + Size - 1)) { + *bOverflow = true; } -} -VMAIter VMManager::CheckConflictingVMA(VAddr addr, size_t Size) -{ - VMAIter it = GetVMAIterator(addr, UserRegion); - - if (it != m_MemoryRegionArray[UserRegion].RegionMap.end() && it->first <= addr && it->second.size >= Size) - { + if (it->second.type != FreeVma) { return it; // conflict } - return m_MemoryRegionArray[UserRegion].RegionMap.end(); // no conflict + return m_MemoryRegionArray[Type].RegionMap.end(); // no conflict } void VMManager::DestructVMA(VAddr addr, MemoryRegionType Type, size_t Size) @@ -2636,7 +2675,7 @@ void VMManager::DestructVMA(VAddr addr, MemoryRegionType Type, size_t Size) if (!ret) { - DbgPrintf("VMEM: Deallocation routine failed with error %d\n", GetLastError()); + EmuLog(LOG_LEVEL::DEBUG, "Deallocation routine failed with error %d", GetLastError()); } } @@ -2662,7 +2701,7 @@ void VMManager::DestructVMA(VAddr addr, MemoryRegionType Type, size_t Size) } else { - DbgPrintf("VMEM: std::prev(CarvedVmaIt) was not free\n"); + EmuLog(LOG_LEVEL::DEBUG, "std::prev(CarvedVmaIt) was not free"); it = CarvedVmaIt; @@ -2690,7 +2729,7 @@ void VMManager::DestructVMA(VAddr addr, MemoryRegionType Type, size_t Size) --it; } - EmuWarning(LOG_PREFIX " Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); + EmuLog(LOG_LEVEL::WARNING, "Can't find any more free space in the memory region %d! Virtual memory exhausted?", Type); m_MemoryRegionArray[Type].LastFree = m_MemoryRegionArray[Type].RegionMap.end(); diff --git a/src/CxbxKrnl/VMManager.h b/src/core/kernel/memory-manager/VMManager.h similarity index 93% rename from src/CxbxKrnl/VMManager.h rename to src/core/kernel/memory-manager/VMManager.h index 5b2c4f6bf..ca03ae0ba 100644 --- a/src/CxbxKrnl/VMManager.h +++ b/src/core/kernel/memory-manager/VMManager.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->VMManager.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -206,8 +197,6 @@ class VMManager : public PhysicalMemory void ConstructVMA(VAddr Start, size_t Size, MemoryRegionType Type, VMAType VmaType, bool bFragFlag, DWORD Perms = XBOX_PAGE_NOACCESS); // destructs a vma void DestructVMA(VAddr addr, MemoryRegionType Type, size_t Size); - // checks if a vma exists at the supplied address. Also checks its size if specified - VMAIter CheckExistenceVMA(VAddr addr, MemoryRegionType Type, size_t Size = 0); // removes a vma block from the mapped memory VMAIter UnmapVMA(VMAIter vma_handle, MemoryRegionType Type); // carves a vma of a specific size at the specified address by splitting free vma's @@ -220,8 +209,8 @@ class VMManager : public PhysicalMemory VMAIter SplitVMA(VMAIter vma_handle, u32 offset_in_vma, MemoryRegionType Type); // merges the specified vma with adjacent ones if possible VMAIter MergeAdjacentVMA(VMAIter vma_handle, MemoryRegionType Type); - // checks if the specified range is completely inside a vma - VMAIter CheckConflictingVMA(VAddr addr, size_t Size); + // checks if the specified range conflicts with another non-free vma + VMAIter CheckConflictingVMA(VAddr addr, size_t Size, MemoryRegionType Type, bool* bOverflow); // changes the access permissions of a block of memory void UpdateMemoryPermissions(VAddr addr, size_t Size, DWORD Perms); // restores persistent memory diff --git a/src/CxbxKrnl/Emu.cpp b/src/core/kernel/support/Emu.cpp similarity index 58% rename from src/CxbxKrnl/Emu.cpp rename to src/core/kernel/support/Emu.cpp index 720b7ee79..33bf662d5 100644 --- a/src/CxbxKrnl/Emu.cpp +++ b/src/core/kernel/support/Emu.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->Emu.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,23 +24,19 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ // prevent name collisions namespace xboxkrnl { - #include + #include }; -#include "CxbxKrnl.h" +#include "core\kernel\init\CxbxKrnl.h" #include "Emu.h" -#include "EmuX86.h" -#include "EmuFS.h" -#include "EmuXTL.h" +#include "devices\x86\EmuX86.h" #include "EmuShared.h" -#include "HLEIntercept.h" +#include "core\hle\Intercept.hpp" #include "CxbxDebugger.h" -#include "Logging.h" #ifdef _DEBUG #include @@ -63,14 +50,14 @@ volatile thread_local bool g_bEmuException = false; volatile bool g_bEmuSuspended = false; volatile bool g_bPrintfOn = true; bool g_DisablePixelShaders = false; -bool g_UncapFramerate = false; bool g_UseAllCores = false; bool g_SkipRdtscPatching = false; -bool g_ScaleViewport = false; -bool g_DirectHostBackBufferAccess = false; +int g_RenderScaleFactor = 1; -// Delta added to host SystemTime, used in xboxkrnl::KeQuerySystemTime and xboxkrnl::NtSetSystemTime -LARGE_INTEGER HostSystemTimeDelta = {}; +// Delta added to host SystemTime, used in KiClockIsr and KeSetSystemTime +// This shouldn't need to be atomic, but because raising the IRQL to high lv in KeSetSystemTime doesn't really stop KiClockIsr from running, +// we need it for now to prevent reading a corrupted value while KeSetSystemTime is in the middle of updating it +std::atomic_int64_t HostSystemTimeDelta(0); // Static Function(s) static int ExitException(LPEXCEPTION_POINTERS e); @@ -84,10 +71,12 @@ std::string FormatTitleId(uint32_t title_id) // EG: MS-001 for 1st tile published by MS, EA-002 for 2nd title by EA, etc // Some special Xbes (Dashboard, XDK Samples) use non-alphanumeric serials // We fall back to Hex for those - char pTitleId1 = (title_id >> 24) & 0xFF; - char pTitleId2 = (title_id >> 16) & 0xFF; + // ergo720: we cannot use isalnum() here because it will treat chars in the range -1 - 255 as valid ascii chars which can + // lead to unicode characters being printed in the title (e.g.: dashboard uses 0xFE and 0xFF) + uint8_t pTitleId1 = (title_id >> 24) & 0xFF; + uint8_t pTitleId2 = (title_id >> 16) & 0xFF; - if (!isalnum(pTitleId1) || !isalnum(pTitleId2)) { + if ((pTitleId1 < 65 || pTitleId1 > 90) || (pTitleId2 < 65 || pTitleId2 > 90)) { // Prefix was non-printable, so we need to print a hex reprentation of the entire title_id ss << std::setfill('0') << std::setw(8) << std::hex << std::uppercase << title_id; return ss.str(); @@ -100,36 +89,6 @@ std::string FormatTitleId(uint32_t title_id) return ss.str(); } -// print out a warning message to the kernel debug log file -#ifdef _DEBUG_WARNINGS -void NTAPI EmuWarning(const char *szWarningMessage, ...) -{ - if (szWarningMessage == NULL) { - return; - } - - if(g_bPrintfOn) { - - va_list argp; - - LOG_THREAD_INIT; - - std::cout << _logThreadPrefix << "WARN: "; - - va_start(argp, szWarningMessage); - - vfprintf(stdout, szWarningMessage, argp); - - va_end(argp); - - fprintf(stdout, "\n"); - - fflush(stdout); - - } -} -#endif - std::string EIPToString(xbaddr EIP) { char buffer[256]; @@ -191,9 +150,17 @@ void EmuExceptionExitProcess() } bool EmuExceptionBreakpointAsk(LPEXCEPTION_POINTERS e) -{ +{ EmuExceptionPrintDebugInformation(e, /*IsBreakpointException=*/true); - + + // We can skip Xbox as long as they are logged so we know about them + // There's no need to prevent emulation, we can just pretend we have a debugger attached and continue + // This is because some games (such as Crash Bandicoot) spam exceptions; + e->ContextRecord->Eip += EmuX86_OpcodeSize((uint8_t*)e->ContextRecord->Eip); // Skip 1 size bytes + return true; + +#if 1 +#else char buffer[256]; sprintf(buffer, "Received Breakpoint Exception (int 3) @ EIP := %s\n" @@ -218,8 +185,9 @@ bool EmuExceptionBreakpointAsk(LPEXCEPTION_POINTERS e) return true; } - return false; -} + return false; +#endif +} void EmuExceptionNonBreakpointUnhandledShow(LPEXCEPTION_POINTERS e) { @@ -239,81 +207,152 @@ void EmuExceptionNonBreakpointUnhandledShow(LPEXCEPTION_POINTERS e) } } -// exception handler -bool IsRdtscInstruction(xbaddr addr); -extern int EmuException(LPEXCEPTION_POINTERS e) +// Returns weither the given address is part of an Xbox managed memory region +bool IsXboxCodeAddress(xbaddr addr) { - g_bEmuException = true; - if (e->ExceptionRecord->ExceptionCode == STATUS_BREAKPOINT) - { + // TODO : Replace the following with a (fast) check weither + // the given address lies in xbox allocated virtual memory, + // for example by g_VMManager.CheckConflictingVMA(addr, 0). + return (addr >= XBE_IMAGE_BASE) && (addr <= XBE_MAX_VA); + // Note : Not IS_USER_ADDRESS(), that would include host DLL code +} + +void genericException(EXCEPTION_POINTERS *e) { + // Try to report this exception to the debugger, which may allow handling of this exception + if (CxbxDebugger::CanReport()) { + bool DebuggerHandled = false; + CxbxDebugger::ReportAndHandleException(e->ExceptionRecord, DebuggerHandled); + if (!DebuggerHandled) { + // Kill the process immediately without the Cxbx notifier + EmuExceptionExitProcess(); + } + + // Bypass exception + } + else { // notify user - if (EmuExceptionBreakpointAsk(e)) - { - // We're allowed to continue : - g_bEmuException = false; - return EXCEPTION_CONTINUE_EXECUTION; - } + EmuExceptionNonBreakpointUnhandledShow(e); } - else - { - // Check if this exception came from rdtsc, but only whe g_PatchCpuFrequency hack is set. - if (e->ExceptionRecord->ExceptionCode == STATUS_PRIVILEGED_INSTRUCTION && !g_SkipRdtscPatching ) - { +} + +static thread_local bool bOverrideException; + +bool IsRdtscInstruction(xbaddr addr); // Implemented in CxbxKrnl.cpp +void EmuX86_Opcode_RDTSC(EXCEPTION_POINTERS *e); // Implemented in EmuX86.cpp +bool lleTryHandleException(EXCEPTION_POINTERS *e) +{ + // Initalize local thread variable + bOverrideException = false; + + // Only handle exceptions which originate from Xbox code + if (!IsXboxCodeAddress(e->ContextRecord->Eip)) { + return false; + } + + // Make sure access-violations reach EmuX86_DecodeException() as soon as possible + if (e->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) { + switch (e->ExceptionRecord->ExceptionCode) { + case STATUS_PRIVILEGED_INSTRUCTION: + // Check if this exception came from rdtsc if (IsRdtscInstruction(e->ContextRecord->Eip)) { - LARGE_INTEGER PerformanceCount; - PerformanceCount.QuadPart = xboxkrnl::KeQueryPerformanceCounter(); - e->ContextRecord->Eax = PerformanceCount.LowPart; - e->ContextRecord->Edx = PerformanceCount.HighPart; - e->ContextRecord->Eip += 2; - g_bEmuException = false; - return EXCEPTION_CONTINUE_EXECUTION; + // If so, use a return value that updates with Xbox frequency; + EmuX86_Opcode_RDTSC(e); + e->ContextRecord->Eip += 2; // Skip OPCODE_PATCH_RDTSC 0xEF 0x90 (OUT DX, EAX; NOP) + return true; } - } - - // Skip past CxbxDebugger-specific exceptions thrown when an unsupported was attached (ie Visual Studio) - if (CxbxDebugger::IsDebuggerException(e->ExceptionRecord->ExceptionCode)) - { - g_bEmuException = false; - return EXCEPTION_CONTINUE_EXECUTION; - } - - // Pass the exception to our X86 implementation, to try and execute the failing instruction - if (EmuX86_DecodeException(e)) - { - // We're allowed to continue : - g_bEmuException = false; - return EXCEPTION_CONTINUE_EXECUTION; - } - - // Try to Report this exception to the debugger, which may allow handling of this exception - if (CxbxDebugger::CanReport()) - { - bool DebuggerHandled = false; - CxbxDebugger::ReportAndHandleException(e->ExceptionRecord, DebuggerHandled); - - if (DebuggerHandled) - { - // Bypass exception - g_bEmuException = false; - return EXCEPTION_CONTINUE_SEARCH; + break; + case STATUS_BREAKPOINT: + // Pass breakpoint down to EmuException since VEH doesn't have call stack viewable. + return false; + default: + // Skip past CxbxDebugger-specific exceptions thrown when an unsupported was attached (ie Visual Studio) + if (CxbxDebugger::IsDebuggerException(e->ExceptionRecord->ExceptionCode)) { + return true; } - else - { - // Kill the process immediately without the Cxbx notifier - EmuExceptionExitProcess(); - } - } - else - { - // notify user - EmuExceptionNonBreakpointUnhandledShow(e); } } + + // Pass the exception to our X86 implementation, to try and execute the failing instruction + if (EmuX86_DecodeException(e)) { + // We're allowed to continue : + return true; + } + + genericException(e); + + // We do not need EmuException to handle it again. + bOverrideException = true; // Unhandled exception : - g_bEmuException = false; - return EXCEPTION_CONTINUE_SEARCH; + return false; } + +// Only for LLE emulation coding (to help performance a little bit better) +LONG NTAPI lleException(EXCEPTION_POINTERS *e) +{ + g_bEmuException = true; + LONG result = lleTryHandleException(e) ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_CONTINUE_SEARCH; + g_bEmuException = false; + return result; +} + +// Only for Cxbx emulation coding (to catch all of last resort exception may occur.) +bool EmuTryHandleException(EXCEPTION_POINTERS *e) +{ + + // Check if lle exception is already called first before emu exception. + if (bOverrideException) { + return false; + } + + if (e->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) { + bool isInt2Dh = *(uint16_t*)(e->ContextRecord->Eip - 2) == 0x2DCD; + + switch (e->ExceptionRecord->ExceptionCode) { + case STATUS_BREAKPOINT: + // First, check if the breakpoint was prefixed with int 0x2dh, if so, it's NOT a breakpoint, but a Debugger Command! + // Note: Because of a Windows quirk, this does NOT work when a debugger is attached, we'll get an UNCATCHABLE breakpoint instead + // But at least this gives us a working implementaton of Xbox DbgPrint when we don't attach a debugger + if (isInt2Dh ){ + e->ContextRecord->Eip += 1; + + // Now perform the command (stored in EAX) + switch (e->ContextRecord->Eax) { + case 1: // DEBUG_PRINT + // In this case, ECX should point to an ANSI String + printf("DEBUG_PRINT: %s\n", ((xboxkrnl::PANSI_STRING)e->ContextRecord->Ecx)->Buffer); + break; + default: + printf("Unhandled Debug Command: int 2Dh, EAX = %d", e->ContextRecord->Eip); + } + + return true; + } + + // Otherwise, let the user choose between continue or break + return EmuExceptionBreakpointAsk(e); + default: + printf("Unhandled Debug Command: int 2Dh, EAX = %d", e->ContextRecord->Eip); + // Skip past CxbxDebugger-specific exceptions thrown when an unsupported was attached (ie Visual Studio) + if (CxbxDebugger::IsDebuggerException(e->ExceptionRecord->ExceptionCode)) { + return true; + } + } + } + + genericException(e); + + // Unhandled exception : + return false; +} + +int EmuException(EXCEPTION_POINTERS *e) +{ + g_bEmuException = true; + LONG result = EmuTryHandleException(e) ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_CONTINUE_SEARCH; + g_bEmuException = false; + return result; +} // exception handle for that tough final exit :) int ExitException(LPEXCEPTION_POINTERS e) @@ -383,9 +422,9 @@ void EmuPrintStackTrace(PCONTEXT ContextRecord) SymGetModuleInfo64(g_CurrentProcessHandle, frame.AddrPC.Offset, &module); if(module.ModuleName) - printf(" %2d: %-8s 0x%.08X", i, module.ModuleName, frame.AddrPC.Offset); + printf(" %2d: %-8s 0x%.08llX", i, module.ModuleName, frame.AddrPC.Offset); else - printf(" %2d: %8c 0x%.08X", i, ' ', frame.AddrPC.Offset); + printf(" %2d: %8c 0x%.08llX", i, ' ', frame.AddrPC.Offset); BYTE symbol[sizeof(SYMBOL_INFO) + SYMBOL_MAXLEN] = { 0 }; std::string symbolName = ""; @@ -412,7 +451,7 @@ void EmuPrintStackTrace(PCONTEXT ContextRecord) } if (!symbolName.empty()) - printf(" %s+0x%.04X\n", symbolName.c_str(), dwDisplacement); + printf(" %s+0x%.04llX\n", symbolName.c_str(), dwDisplacement); else printf("\n"); } diff --git a/src/CxbxKrnl/Emu.h b/src/core/kernel/support/Emu.h similarity index 62% rename from src/CxbxKrnl/Emu.h rename to src/core/kernel/support/Emu.h index e2555d48d..2e3b543a3 100644 --- a/src/CxbxKrnl/Emu.h +++ b/src/core/kernel/support/Emu.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->Emu.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,23 +25,18 @@ #ifndef EMU_H #define EMU_H -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" +#include "Logging.h" #undef FIELD_OFFSET // prevent macro redefinition warnings #include -#include - -// print out a warning message to the kernel debug log file -#ifdef _DEBUG_WARNINGS -void NTAPI EmuWarning(const char *szWarningMessage, ...); -#else -inline void NTAPI EmuWarning(const char *szWarningMessage, ...) { } -#endif +#include std::string FormatTitleId(uint32_t title_id); // exception handler -extern int EmuException(LPEXCEPTION_POINTERS e); +extern LONG NTAPI lleException(EXCEPTION_POINTERS *e); +int EmuException(EXCEPTION_POINTERS *e); // print call stack trace #ifdef _DEBUG @@ -67,7 +53,9 @@ extern void * funcExclude[2048]; // partition emulation directory handles extern HANDLE g_hCurDir; extern CHAR *g_strCurDrive; -extern HWND g_hEmuWindow; +extern HWND g_hEmuWindow; + +#define GET_FRONT_WINDOW_HANDLE ((CxbxKrnl_hEmuParent != nullptr) ? CxbxKrnl_hEmuParent : g_hEmuWindow) // thread notification routine extern PVOID g_pfnThreadNotification[16]; @@ -78,26 +66,8 @@ extern DWORD_PTR g_CPUOthers; extern HANDLE g_CurrentProcessHandle; // Set in CxbxKrnlMain -// Delta added to host SystemTime, used in xboxkrnl::KeQuerySystemTime and xboxkrnl::NtSetSystemTime -extern LARGE_INTEGER HostSystemTimeDelta; - -// NOTE: this is an arbitrary latency -#define XINPUT_SETSTATE_LATENCY 4 -#define XINPUT_SETSTATE_SLOTS 16 - -// XInputSetState status waiters -extern struct XInputSetStateStatus -{ - HANDLE hDevice; - DWORD dwLatency; - PVOID pFeedback; -} -g_pXInputSetStateStatus[XINPUT_SETSTATE_SLOTS]; - -// 4 controllers -#define XINPUT_HANDLE_SLOTS 4 - -extern HANDLE g_hInputHandle[XINPUT_HANDLE_SLOTS]; +// Delta added to host SystemTime, used in KiClockIsr and KeSetSystemTime +extern std::atomic_int64_t HostSystemTimeDelta; typedef struct DUMMY_KERNEL { @@ -107,11 +77,10 @@ typedef struct DUMMY_KERNEL IMAGE_SECTION_HEADER SectionHeader; } *PDUMMY_KERNEL; +typedef WORD INDEX16; extern bool g_DisablePixelShaders; -extern bool g_UncapFramerate; extern bool g_UseAllCores; -extern bool g_SkipRdtscPatching; -extern bool g_ScaleViewport; -extern bool g_DirectHostBackBufferAccess; +extern bool g_SkipRdtscPatching; +extern int g_RenderScaleFactor; #endif diff --git a/src/CxbxKrnl/EmuFS.cpp b/src/core/kernel/support/EmuFS.cpp similarity index 69% rename from src/CxbxKrnl/EmuFS.cpp rename to src/core/kernel/support/EmuFS.cpp index c51088eb8..eae02cf53 100644 --- a/src/CxbxKrnl/EmuFS.cpp +++ b/src/core/kernel/support/EmuFS.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuFS.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,9 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "KRNL" +#define LOG_PREFIX CXBXR_MODULE::FS // prevent name collisions namespace xboxkrnl @@ -43,14 +33,17 @@ namespace xboxkrnl #include }; -#include "EmuKrnl.h" // For InitializeListHead(), etc. -#include "EmuFS.h" -#include "CxbxKrnl.h" -#include "VMManager.h" +#include "core\kernel\exports\EmuKrnl.h" // For InitializeListHead(), etc. +#include "core\kernel\exports\EmuKrnlKe.h" +#include "core\kernel\support\EmuFS.h" // For fs_instruction_t +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\memory-manager\VMManager.h" +#include "Logging.h" #undef FIELD_OFFSET // prevent macro redefinition warnings #include -#include +#include +#include // NT_TIB (Thread Information Block) offsets - see https://www.microsoft.com/msj/archive/S2CE.aspx #define TIB_ExceptionList offsetof(NT_TIB, ExceptionList) // = 0x00/0 @@ -126,7 +119,46 @@ NT_TIB *GetNtTib() } -xboxkrnl::KPCR* KeGetPcr(); +xboxkrnl::KPCR* WINAPI KeGetPcr(); + +uint32_t fs_lock = 0; + +__declspec(naked) void LockFS() +{ + __asm { + // Backup Registers + pushfd + pushad + jmp entry + + // Spin until we can aquire the lock + spinlock : + call SwitchToThread // Give other threads a chance to run if we couldn't get the lock + entry: + mov eax, 1 + xchg eax, fs_lock + test eax, eax + jnz spinlock + + // Restore registers and return + popad + popfd + ret + } +} + +__declspec(naked) void UnlockFS() +{ + __asm { + pushfd + pushad + xor eax, eax + xchg eax, fs_lock + popad + popfd + ret + } +} void EmuKeSetPcr(xboxkrnl::KPCR *Pcr) { @@ -163,7 +195,7 @@ __declspec(naked) void EmuFS_RefreshKPCR() // Backup all registers, call KeGetPcr and then restore all registers // KeGetPcr makes sure a valid KPCR exists for the current thread // and creates it if missing, we backup and restore all registers - // to keep it safe to cal in our patches + // to keep it safe to call in our patches // This function can be later expanded to do nice things // like setup the per-thread KPCR values for us too! __asm { @@ -358,41 +390,47 @@ __declspec(naked) void EmuFS_MovFs00Esp() { // Note : eax must be preserved here, hence the push/pop __asm - { + { + pushfd call EmuFS_RefreshKPCR - push eax - mov eax, fs : [TIB_ArbitraryDataSlot] - mov [eax], esp - pop eax + push eax + mov eax, fs : [TIB_ArbitraryDataSlot] + mov [eax], esp + add [eax], 12 // account for esp changes from pushed registers and return address + pop eax + popfd ret } } __declspec(naked) void EmuFS_PushDwordPtrFs00() { - static uint32 returnAddr; - static uint32 temp; + static uint32_t returnAddr; + static uint32_t temp; __asm { + call LockFS call EmuFS_RefreshKPCR pop returnAddr mov temp, eax mov eax, fs : [TIB_ArbitraryDataSlot] - push dword ptr [eax] + push dword ptr[eax] mov eax, temp push returnAddr + call UnlockFS ret } } __declspec(naked) void EmuFS_PopDwordPtrFs00() { - static uint32 returnAddr; - static uint32 temp; + static uint32_t returnAddr; + static uint32_t temp; __asm { + call LockFS call EmuFS_RefreshKPCR pop returnAddr mov temp, eax @@ -400,6 +438,7 @@ __declspec(naked) void EmuFS_PopDwordPtrFs00() pop dword ptr [eax] mov eax, temp push returnAddr + call UnlockFS ret } } @@ -412,36 +451,35 @@ void EmuInitFS() * The entries must be in order of size, to keep the chance of false positives to a minimum. */ std::vector fsInstructions; - fsInstructions.push_back({ { 0x64, 0x0F, 0xB6, 0x05, 0x24, 0x00, 0x00, 0x00 }, &EmuFS_MovzxEaxBytePtrFs24 });// movzx eax, large byte ptr fs:24 - fsInstructions.push_back({ { 0x64, 0x3B, 0x35, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_CmpEsiFs00 }); // cmp esi, large fs:0 - fsInstructions.push_back({ { 0x64, 0x8B, 0x1D, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovEbxFs00 }); // mov ebx, large fs:0 - fsInstructions.push_back({ { 0x64, 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovEcxFs00 }); // mov ecx, large fs:0 - fsInstructions.push_back({ { 0x64, 0x8B, 0x0D, 0x04, 0x00, 0x00, 0x00 }, &EmuFS_MovEcxFs04 }); // mov ecx, large fs:4 - fsInstructions.push_back({ { 0x64, 0x8B, 0x3D, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovEdiFs00 }); // mov edi, large fs:0 - fsInstructions.push_back({ { 0x64, 0x8B, 0x3D, 0x04, 0x00, 0x00, 0x00 }, &EmuFS_MovEdiFs04 }); // mov edi, large fs:4 - fsInstructions.push_back({ { 0x64, 0x8B, 0x35, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovEsiFs00 }); // mov esi, large fs:0 - fsInstructions.push_back({ { 0x64, 0x89, 0x1D, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovFs00Ebx }); // mov large fs:0, ebx - fsInstructions.push_back({ { 0x64, 0x89, 0x0D, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovFs00Ecx }); // mov large fs:0, ecx - fsInstructions.push_back({ { 0x64, 0x89, 0x25, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovFs00Esp }); // mov large fs:0, esp - fsInstructions.push_back({ { 0x64, 0x8F, 0x05, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_PopDwordPtrFs00 }); // pop large dword ptr fs:0 - fsInstructions.push_back({ { 0x64, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_PushDwordPtrFs00 }); // push large dword ptr fs:0 - fsInstructions.push_back({ { 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovEaxFs00 }); // mov eax, large fs:0 - fsInstructions.push_back({ { 0x64, 0xA1, 0x20, 0x00, 0x00, 0x00 }, &EmuFS_MovEaxFs20 }); // mov eax, large fs:20 - fsInstructions.push_back({ { 0x64, 0xA1, 0x28, 0x00, 0x00, 0x00 }, &EmuFS_MovEaxFs28 }); // mov eax, large fs:28 - fsInstructions.push_back({ { 0x64, 0xA1, 0x58, 0x00, 0x00, 0x00 }, &EmuFS_MovEaxFs58 }); // mov eax, large fs:58 - fsInstructions.push_back({ { 0x64, 0xA3, 0x00, 0x00, 0x00, 0x00 }, &EmuFS_MovFs00Eax }); // mov large fs:0, eax - - DbgPrintf("INIT: Patching FS Register Accesses\n"); + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x0F, 0xB6, 0x05, 0x24, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovzxEaxBytePtrFs24 });// movzx eax, large byte ptr fs:24 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x3B, 0x35, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_CmpEsiFs00 }); // cmp esi, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x1D, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEbxFs00 }); // mov ebx, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEcxFs00 }); // mov ecx, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x0D, 0x04, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEcxFs04 }); // mov ecx, large fs:4 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x3D, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEdiFs00 }); // mov edi, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x3D, 0x04, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEdiFs04 }); // mov edi, large fs:4 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8B, 0x35, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEsiFs00 }); // mov esi, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x89, 0x1D, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovFs00Ebx }); // mov large fs:0, ebx + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x89, 0x0D, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovFs00Ecx }); // mov large fs:0, ecx + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x89, 0x25, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovFs00Esp }); // mov large fs:0, esp + fsInstructions.push_back(fs_instruction_t { { 0x64, 0x8F, 0x05, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_PopDwordPtrFs00 }); // pop large dword ptr fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xFF, 0x35, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_PushDwordPtrFs00 }); // push large dword ptr fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEaxFs00 }); // mov eax, large fs:0 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xA1, 0x20, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEaxFs20 }); // mov eax, large fs:20 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xA1, 0x28, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEaxFs28 }); // mov eax, large fs:28 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xA1, 0x58, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovEaxFs58 }); // mov eax, large fs:58 + fsInstructions.push_back(fs_instruction_t { { 0x64, 0xA3, 0x00, 0x00, 0x00, 0x00 }, (void*)&EmuFS_MovFs00Eax }); // mov large fs:0, eax + EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Patching FS Register Accesses\n"); DWORD sizeOfImage = CxbxKrnl_XbeHeader->dwSizeofImage; long numberOfInstructions = fsInstructions.size(); // Iterate through each CODE section - for (uint32 sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { + for (uint32_t sectionIndex = 0; sectionIndex < CxbxKrnl_Xbe->m_Header.dwSections; sectionIndex++) { if (!CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwFlags.bExecutable) { continue; } - DbgPrintf("INIT: Searching for FS Instruction in section %s\n", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); + EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Searching for FS Instruction in section %s\n", CxbxKrnl_Xbe->m_szSectionName[sectionIndex]); xbaddr startAddr = CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwVirtualAddr; xbaddr endAddr = startAddr + CxbxKrnl_Xbe->m_SectionHeader[sectionIndex].dwSizeofRaw; for (xbaddr addr = startAddr; addr < endAddr; addr++) @@ -458,11 +496,11 @@ void EmuInitFS() if (memcmp((void*)addr, &fsInstructions[i].data[0], sizeOfData) == 0) { - DbgPrintf("INIT: Patching FS Instruction at 0x%.8X\n", addr); + EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Patching FS Instruction at 0x%.8X\n", addr); // Write Call opcode - *(uint08*)addr = OPCODE_CALL_E8; - *(uint32*)(addr + 1) = (uint32)fsInstructions[i].functionPtr - addr - 5; + *(uint8_t*)addr = OPCODE_CALL_E8; + *(uint32_t*)(addr + 1) = (uint32_t)fsInstructions[i].functionPtr - addr - 5; // Fill the remaining bytes with nop instructions int remaining_bytes = fsInstructions[i].data.size() - 5; @@ -474,7 +512,7 @@ void EmuInitFS() } } - DbgPrintf("INIT: Done patching FS Register Accesses\n"); + EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Done patching FS Register Accesses\n"); } // generate fs segment selector @@ -486,8 +524,8 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData) if (pTLS != nullptr) { // copy global TLS to the current thread { - uint32 dwCopySize = 0; - uint32 dwZeroSize = pTLS->dwSizeofZeroFill; + uint32_t dwCopySize = 0; + uint32_t dwZeroSize = pTLS->dwSizeofZeroFill; if (pTLSData != NULL) { // Make sure the TLS Start and End addresses are within Xbox virtual memory @@ -500,29 +538,30 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData) } /* + HACK: extra safety padding 0x100 */ - pNewTLS = (void*)g_VMManager.AllocateZeroed(dwCopySize + dwZeroSize + 0x100); - + pNewTLS = (void*)g_VMManager.AllocateZeroed(dwCopySize + dwZeroSize + 0x100 + 0xC); + /* Skip the first 12 bytes so that TLSData will be 16 byte aligned (addr returned by AllocateZeroed is 4K aligned) */ + pNewTLS = (uint8_t*)pNewTLS + 12; if (dwCopySize > 0) { - memcpy(pNewTLS, pTLSData, dwCopySize); + memcpy((uint8_t*)pNewTLS + 4, pTLSData, dwCopySize); } #ifdef _DEBUG_TRACE // dump raw TLS data if (pNewTLS == nullptr) { - DbgPrintf("KRNL: TLS Non-Existant (OK)\n"); + EmuLog(LOG_LEVEL::DEBUG, "TLS Non-Existant (OK)"); } else { - DbgPrintf("KRNL: TLS Data Dump...\n"); + EmuLog(LOG_LEVEL::DEBUG, "TLS Data Dump..."); if (g_bPrintfOn) { - for (uint32 v = 0; v < dwCopySize; v++) {// Note : Don't dump dwZeroSize + for (uint32_t v = 4; v < dwCopySize + 4; v++) {// Note : Don't dump dwZeroSize - uint08 *bByte = (uint08*)pNewTLS + v; + uint8_t *bByte = (uint8_t*)pNewTLS + v; if (v % 0x10 == 0) { - DbgPrintf("KRNL: 0x%.8X:", (xbaddr)bByte); + EmuLog(LOG_LEVEL::DEBUG, "0x%.8X:", (xbaddr)bByte); } - // Note : Use printf instead of DbgPrintf here, which prefixes with GetCurrentThreadId() : + // Note : Use printf instead of EmuLog here, which prefixes with GetCurrentThreadId() : printf(" %.2X", *bByte); } @@ -534,7 +573,9 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData) // prepare TLS { - *(xbaddr*)pTLS->dwTLSIndexAddr = xbnull; + if (pTLS->dwTLSIndexAddr != 0) { + *(xbaddr*)pTLS->dwTLSIndexAddr = xbnull; + } // dword @ pTLSData := pTLSData if (pNewTLS != nullptr) @@ -564,7 +605,12 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData) // Fixup the TIB self pointer : NewPcr->NtTib.Self = XbTib; // Set the stack base - TODO : Verify this, doesn't look right? - NewPcr->NtTib.StackBase = pNewTLS; + NewPcr->NtTib.StackBase = pNewTLS; + + // Write the Xbox stack base to the Host, allows ConvertThreadToFiber to work correctly + // Test case: DOA3 + __writefsdword(TIB_StackBase, (DWORD)NewPcr->NtTib.StackBase); + __writefsdword(TIB_StackLimit, (DWORD)NewPcr->NtTib.StackLimit); } // Set flat address of this PCR @@ -589,11 +635,24 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData) EThread->Tcb.TlsData = pNewTLS; EThread->UniqueThread = GetCurrentThreadId(); // Set PrcbData.CurrentThread - Prcb->CurrentThread = (xboxkrnl::KTHREAD*)EThread; + Prcb->CurrentThread = (xboxkrnl::KTHREAD*)EThread; + // Initialize the thread header and its wait list + Prcb->CurrentThread->Header.Type = xboxkrnl::ThreadObject; + Prcb->CurrentThread->Header.Size = sizeof(xboxkrnl::KTHREAD) / sizeof(xboxkrnl::LONG); + InitializeListHead(&Prcb->CurrentThread->Header.WaitListHead); + // Also initialize the timer associated with the thread + xboxkrnl::KeInitializeTimer(&Prcb->CurrentThread->Timer); + xboxkrnl::PKWAIT_BLOCK WaitBlock = &Prcb->CurrentThread->TimerWaitBlock; + WaitBlock->Object = &Prcb->CurrentThread->Timer; + WaitBlock->WaitKey = (xboxkrnl::CSHORT)STATUS_TIMEOUT; + WaitBlock->WaitType = xboxkrnl::WaitAny; + WaitBlock->Thread = Prcb->CurrentThread; + WaitBlock->WaitListEntry.Flink = &Prcb->CurrentThread->Timer.Header.WaitListHead; + WaitBlock->WaitListEntry.Blink = &Prcb->CurrentThread->Timer.Header.WaitListHead; } // Make the KPCR struct available to KeGetPcr() EmuKeSetPcr(NewPcr); - DbgPrintf("KRNL: Installed KPCR in TIB_ArbitraryDataSlot (with pTLS = 0x%.8X)\n", pTLS); + EmuLog(LOG_LEVEL::DEBUG, "Installed KPCR in TIB_ArbitraryDataSlot (with pTLS = 0x%.8X)", pTLS); } diff --git a/src/CxbxKrnl/EmuFS.h b/src/core/kernel/support/EmuFS.h similarity index 76% rename from src/CxbxKrnl/EmuFS.h rename to src/core/kernel/support/EmuFS.h index d6dc17659..aadd7483d 100644 --- a/src/CxbxKrnl/EmuFS.h +++ b/src/core/kernel/support/EmuFS.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuFS.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,7 +26,7 @@ #define EMUFS_H #include -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" #undef FIELD_OFFSET // prevent macro redefinition warnings #include @@ -47,8 +38,8 @@ extern void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData); typedef struct { - std::vector data; + std::vector data; void* functionPtr; }fs_instruction_t; -#endif \ No newline at end of file +#endif diff --git a/src/CxbxKrnl/EmuFile.cpp b/src/core/kernel/support/EmuFile.cpp similarity index 92% rename from src/CxbxKrnl/EmuFile.cpp rename to src/core/kernel/support/EmuFile.cpp index f900af9bb..9a69ff75b 100644 --- a/src/CxbxKrnl/EmuFile.cpp +++ b/src/core/kernel/support/EmuFile.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuFile.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,9 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "FILE" +#define LOG_PREFIX CXBXR_MODULE::FILE #include "EmuFile.h" #include @@ -47,12 +37,11 @@ #pragma warning(disable:4005) // Ignore redefined status values #include #pragma warning(default:4005) -#include "CxbxKrnl.h" -#include "VMManager.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\memory-manager\VMManager.h" +#include "Logging.h" -#include - -//#include "Logging.h" // For hex4() +#include // Default Xbox Partition Table #define PE_PARTFLAGS_IN_USE 0x80000000 @@ -93,7 +82,7 @@ void CxbxCreatePartitionHeaderFile(std::string filename, bool partition0 = false { HANDLE hf = CreateFile(filename.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); if (!hf) { - CxbxKrnlCleanup("CxbxCreatePartitionHeaderFile Failed\nUnable to create file: %s (%s)", filename); + CxbxKrnlCleanup("CxbxCreatePartitionHeaderFile Failed\nUnable to create file: %s (%s)", filename.c_str()); return; } @@ -180,7 +169,7 @@ void CxbxFormatPartitionByHandle(HANDLE hFile) // Sanity check, make sure we are actually deleting something within the Cxbx-Reloaded folder if (partitionPath.find("Cxbx-Reloaded") == std::string::npos) { - EmuWarning("Attempting to format a path that is not within a Cxbx-Reloaded data folder... Ignoring!\n"); + EmuLog(LOG_LEVEL::WARNING, "Attempting to format a path that is not within a Cxbx-Reloaded data folder... Ignoring!\n"); return; } @@ -189,25 +178,27 @@ void CxbxFormatPartitionByHandle(HANDLE hFile) // Previously, we deleted and re-created the folder, but that caused permission issues for some users try { - for (auto& directoryEntry : std::experimental::filesystem::recursive_directory_iterator(partitionPath)) { - std::experimental::filesystem::remove_all(directoryEntry); + for (auto& directoryEntry : std::filesystem::recursive_directory_iterator(partitionPath)) { + std::filesystem::remove_all(directoryEntry); } } - catch (std::experimental::filesystem::filesystem_error fsException) + catch (std::filesystem::filesystem_error fsException) { - printf("std::experimental::filesystem failed with message: %s\n", fsException.what()); + printf("std::filesystem failed with message: %s\n", fsException.what()); } printf("Formatted EmuDisk Partition%d\n", CxbxGetPartitionNumberFromHandle(hFile)); } +const std::string MediaBoardRomFile = "Chihiro\\fpr21042_m29w160et.bin"; const std::string DrivePrefix = "\\??\\"; const std::string DriveSerial = DrivePrefix + "serial:"; const std::string DriveCdRom0 = DrivePrefix + "CdRom0:"; // CD-ROM device -const std::string DriveMbfs = DrivePrefix + "mbfs:"; // media board's file system area device -const std::string DriveMbcom = DrivePrefix + "mbcom:"; // media board's communication area device -const std::string DriveMbrom = DrivePrefix + "mbrom:"; // media board's boot ROM device +const std::string DriveMbfs = "mbfs:"; // media board's file system area device +const std::string DriveMbcom = "mbcom:"; // media board's communication area device +const std::string DriveMbrom0 = "mbrom0:"; // media board's boot ROM device (first image) +const std::string DriveMbrom1 = "mbrom1:"; // media board's boot ROM device (second image) const std::string DriveA = DrivePrefix + "A:"; // A: could be CDROM const std::string DriveC = DrivePrefix + "C:"; // C: is HDD0 const std::string DriveD = DrivePrefix + "D:"; // D: is DVD Player @@ -296,7 +287,7 @@ EmuNtObject* EmuNtObject::NtDuplicateObject(DWORD Options) bool IsEmuHandle(HANDLE Handle) { - return ((uint32)Handle > 0x80000000) && ((uint32)Handle < 0xFFFFFFFE); + return ((uint32_t)Handle > 0x80000000) && ((uint32_t)Handle < 0xFFFFFFFE); } EmuHandle* HandleToEmuHandle(HANDLE Handle) @@ -318,7 +309,7 @@ std::wstring string_to_wstring(std::string const & src) std::wstring PUNICODE_STRING_to_wstring(NtDll::PUNICODE_STRING const & src) { - return std::wstring(src->Buffer, src->Length / sizeof(NtDll::WCHAR)); +return std::wstring(src->Buffer, src->Length / sizeof(NtDll::WCHAR)); } std::string PSTRING_to_string(xboxkrnl::PSTRING const & src) @@ -333,19 +324,19 @@ void copy_string_to_PSTRING_to(std::string const & src, const xboxkrnl::PSTRING } void replace_all(std::string& str, const std::string& from, const std::string& to) { - if(from.empty()) - return; - size_t start_pos = 0; - while((start_pos = str.find(from, start_pos)) != std::string::npos) { - str.replace(start_pos, from.length(), to); - start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' - } + if (from.empty()) + return; + size_t start_pos = 0; + while ((start_pos = str.find(from, start_pos)) != std::string::npos) { + str.replace(start_pos, from.length(), to); + start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' + } } NTSTATUS CxbxConvertFilePath( - std::string RelativeXboxPath, - OUT std::wstring &RelativeHostPath, - OUT NtDll::HANDLE *RootDirectory, + std::string RelativeXboxPath, + OUT std::wstring &RelativeHostPath, + IN OUT NtDll::HANDLE *RootDirectory, std::string aFileAPIName, bool partitionHeader) { @@ -354,14 +345,19 @@ NTSTATUS CxbxConvertFilePath( std::string XboxFullPath; std::string HostPath; EmuNtSymbolicLinkObject* NtSymbolicLinkObject = NULL; - + // Always trim '\??\' off : if (RelativePath.compare(0, DrivePrefix.length(), DrivePrefix.c_str()) == 0) RelativePath.erase(0, 4); // Check if we where called from a File-handling API : if (!aFileAPIName.empty()) { - if (!partitionHeader) { + if (RelativePath.compare(DriveMbrom0) == 0 || RelativePath.compare(DriveMbrom1) == 0) { + *RootDirectory = CxbxBasePathHandle; + HostPath = CxbxBasePath; + RelativePath = MediaBoardRomFile; + } + else if (!partitionHeader) { // Check if the path starts with a volume indicator : if ((RelativePath.length() >= 2) && (RelativePath[1] == ':')) { // Look up the symbolic link information using the drive letter : @@ -371,20 +367,22 @@ NTSTATUS CxbxConvertFilePath( // If the remaining path starts with a ':', remove it (to prevent errors) : if ((RelativePath.length() > 0) && (RelativePath[0] == ':')) RelativePath.erase(0, 1); // xbmp needs this, as it accesses 'e::\' - } else if (RelativePath[0] == '$') { + } + else if (RelativePath[0] == '$') { if (RelativePath.compare(0, 5, "$HOME") == 0) // "xbmp" needs this { NtSymbolicLinkObject = FindNtSymbolicLinkObjectByRootHandle(g_hCurDir); RelativePath.erase(0, 5); // Remove '$HOME' - } else + } + else CxbxKrnlCleanup(("Unsupported path macro : " + OriginalPath).c_str()); } // Check if the path starts with a relative path indicator : - else if (RelativePath[0] == '.') // "4x4 Evo 2" needs this - { + else if (RelativePath[0] == '.') {// "4x4 Evo 2" needs this NtSymbolicLinkObject = FindNtSymbolicLinkObjectByRootHandle(g_hCurDir); RelativePath.erase(0, 1); // Remove the '.' - } else { + } + else { // TODO : How should we handle accesses to the serial: (?semi-)volume? if (RelativePath.compare(0, 7, "serial:") == 0) return STATUS_UNRECOGNIZED_VOLUME; @@ -394,7 +392,6 @@ NTSTATUS CxbxConvertFilePath( // Fixup RelativePath path here if (NtSymbolicLinkObject != NULL) RelativePath.erase(0, NtSymbolicLinkObject->XboxSymbolicLinkPath.length()); // Remove '\Device\Harddisk0\Partition2' - // else TODO : Turok requests 'gamedata.dat' without a preceding path, we probably need 'CurrentDir'-functionality } if (NtSymbolicLinkObject == NULL) { @@ -406,10 +403,33 @@ NTSTATUS CxbxConvertFilePath( // And set Root to the folder containing the partition-folders : *RootDirectory = CxbxBasePathHandle; HostPath = CxbxBasePath; - } else { - // Finally, Assume relative to Xbe path + } + // NOTE: RootDirectory cannot be ignored. + // Any special handling for it should be done below. + else if (*RootDirectory == nullptr) { + // Assume relative to Xbe path NtSymbolicLinkObject = FindNtSymbolicLinkObjectByRootHandle(g_hCurDir); } + else if (*RootDirectory == (NtDll::HANDLE)-3) { + // This is a special handle that tells the API that this is a DOS device + // We can safely remove it and forward to the Xbe directory. + // Test case GTA3 + NtSymbolicLinkObject = FindNtSymbolicLinkObjectByRootHandle(g_hCurDir); + } + else if (*RootDirectory == (NtDll::HANDLE)-4) { + // NOTE: A handle of -4 on the Xbox signifies the path should be in the BaseNamedObjects namespace. + // This handle doesn't exist on Windows, so we prefix the name instead. (note from LukeUsher) + // Handle special root directory constants + *RootDirectory = NULL; + + if (OriginalPath.size() == 0){ + RelativePath = "\\BaseNamedObjects"; + } else { + RelativePath = "\\BaseNamedObjects\\" + OriginalPath; + } + } + // else {} // NOTE: Allow RootDirectory handle to take control of relative path. + // Test-case: Turok Evolution } if (NtSymbolicLinkObject != NULL) { @@ -438,13 +458,13 @@ NTSTATUS CxbxConvertFilePath( replace_all( RelativePath, "\\\\", "\\" ); if (g_bPrintfOn) { - DbgPrintf("FILE: %s Corrected path...\n", aFileAPIName.c_str()); - printf(" Org:\"%s\"\n", OriginalPath.c_str()); + EmuLog(LOG_LEVEL::DEBUG, "%s Corrected path...", aFileAPIName.c_str()); + EmuLog(LOG_LEVEL::DEBUG, " Org:\"%s\"", OriginalPath.c_str()); if (_strnicmp(HostPath.c_str(), CxbxBasePath.c_str(), CxbxBasePath.length()) == 0) { - printf(" New:\"$CxbxPath\\%s%s\"\n", (HostPath.substr(CxbxBasePath.length(), std::string::npos)).c_str(), RelativePath.c_str()); + EmuLog(LOG_LEVEL::DEBUG, " New:\"$CxbxPath\\%s%s\"", (HostPath.substr(CxbxBasePath.length(), std::string::npos)).c_str(), RelativePath.c_str()); } else - printf(" New:\"$XbePath\\%s\"\n", RelativePath.c_str()); + EmuLog(LOG_LEVEL::DEBUG, " New:\"$XbePath\\%s\"", RelativePath.c_str()); } } else @@ -481,28 +501,18 @@ NTSTATUS CxbxObjectAttributesToNT( std::wstring RelativeHostPath; NtDll::HANDLE RootDirectory = ObjectAttributes->RootDirectory; - // Handle special root directory constants - if (RootDirectory == (NtDll::HANDLE)-4) { - RootDirectory = NULL; - - if (ObjectName.size() == 0){ - ObjectName = "\\BaseNamedObjects"; - } else { - ObjectName = "\\BaseNamedObjects\\" + ObjectName; + // Is there a filename API given? + if (aFileAPIName.size() > 0) { + // Then interpret the ObjectName as a filename, and update it to host relative : + NTSTATUS result = CxbxConvertFilePath(ObjectName, /*OUT*/RelativeHostPath, /*IN OUT*/&RootDirectory, aFileAPIName, partitionHeader); + if (FAILED(result)) { + return result; } } - - // Is there a filename API given? - if (aFileAPIName.size() > 0) - { - // Then interpret the ObjectName as a filename, and update it to host relative : - NTSTATUS result = CxbxConvertFilePath(ObjectName, /*OUT*/RelativeHostPath, /*OUT*/&RootDirectory, aFileAPIName, partitionHeader); - if (FAILED(result)) - return result; - } - else + else { // When not called from a file-handling API, just convert the ObjectName to a wide string : RelativeHostPath = string_to_wstring(ObjectName); + } // Copy the wide string to the unicode string wcscpy_s(nativeObjectAttributes.wszObjectName, RelativeHostPath.c_str()); @@ -653,7 +663,7 @@ NTSTATUS EmuNtSymbolicLinkObject::Init(std::string aSymbolicLinkName, std::strin else { NtSymbolicLinkObjects[DriveLetter - 'A'] = this; - DbgPrintf("FILE: Linked \"%s\" to \"%s\" (residing at \"%s\")\n", aSymbolicLinkName.c_str(), aFullPath.c_str(), HostSymbolicLinkPath.c_str()); + EmuLog(LOG_LEVEL::DEBUG, "Linked \"%s\" to \"%s\" (residing at \"%s\")", aSymbolicLinkName.c_str(), aFullPath.c_str(), HostSymbolicLinkPath.c_str()); } } } @@ -746,8 +756,8 @@ NtDll::FILE_LINK_INFORMATION * _XboxToNTLinkInfo(xboxkrnl::FILE_LINK_INFORMATION // Convert the path from Xbox to native std::string originalFileName(xboxLinkInfo->FileName, xboxLinkInfo->FileNameLength); std::wstring convertedFileName; - NtDll::HANDLE RootDirectory; - NTSTATUS res = CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*OUT*/&RootDirectory, "NtSetInformationFile"); + NtDll::HANDLE RootDirectory = nullptr; + NTSTATUS res = CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*IN OUT*/&RootDirectory, "NtSetInformationFile"); // TODO : handle if(FAILED(res)) // Build the native FILE_LINK_INFORMATION struct @@ -766,8 +776,8 @@ NtDll::FILE_RENAME_INFORMATION * _XboxToNTRenameInfo(xboxkrnl::FILE_RENAME_INFOR // Convert the path from Xbox to native std::string originalFileName(xboxRenameInfo->FileName.Buffer, xboxRenameInfo->FileName.Length); std::wstring convertedFileName; - NtDll::HANDLE RootDirectory; - NTSTATUS res = CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*OUT*/&RootDirectory, "NtSetInformationFile"); + NtDll::HANDLE RootDirectory = nullptr; + NTSTATUS res = CxbxConvertFilePath(originalFileName, /*OUT*/convertedFileName, /*IN OUT*/&RootDirectory, "NtSetInformationFile"); // TODO : handle if(FAILED(res)) // Build the native FILE_RENAME_INFORMATION struct diff --git a/src/CxbxKrnl/EmuFile.h b/src/core/kernel/support/EmuFile.h similarity index 93% rename from src/CxbxKrnl/EmuFile.h rename to src/core/kernel/support/EmuFile.h index 2089059d0..757968372 100644 --- a/src/CxbxKrnl/EmuFile.h +++ b/src/core/kernel/support/EmuFile.h @@ -1,13 +1,4 @@ // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuFile.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -59,6 +50,7 @@ namespace NtDll // TODO : Move to a better suited file //std::ostream& operator<<(std::ostream& os, const NtDll::NTSTATUS& value); +extern const std::string MediaBoardRomFile; extern const std::string DrivePrefix; extern const std::string DriveSerial; extern const std::string DriveCdRom0; @@ -166,7 +158,7 @@ struct NativeObjectAttributes { }; NTSTATUS CxbxObjectAttributesToNT(xboxkrnl::POBJECT_ATTRIBUTES ObjectAttributes, NativeObjectAttributes& nativeObjectAttributes, std::string aFileAPIName = "", bool partitionHeader = false); -NTSTATUS CxbxConvertFilePath(std::string RelativeXboxPath, OUT std::wstring &RelativeHostPath, OUT NtDll::HANDLE *RootDirectory, std::string aFileAPIName = "", bool partitionHeader = false); +NTSTATUS CxbxConvertFilePath(std::string RelativeXboxPath, OUT std::wstring &RelativeHostPath, IN OUT NtDll::HANDLE *RootDirectory, std::string aFileAPIName = "", bool partitionHeader = false); // ****************************************************************** // * Wrapper of a handle object @@ -257,9 +249,9 @@ void _CxbxPVOIDDeleter(PVOID *ptr); #define SMART_PVOID(var, value, orig) \ PVOID var = value; \ std::shared_ptr __var_shared_ptr; \ - if (NULL == var) \ + if (nullptr == var) \ { \ - __var_shared_ptr = NULL; \ + __var_shared_ptr = nullptr; \ var = orig; \ } \ else \ diff --git a/src/CxbxKrnl/EmuNtDll.cpp b/src/core/kernel/support/EmuNtDll.cpp similarity index 92% rename from src/CxbxKrnl/EmuNtDll.cpp rename to src/core/kernel/support/EmuNtDll.cpp index f82278087..0da77ab2b 100644 --- a/src/CxbxKrnl/EmuNtDll.cpp +++ b/src/core/kernel/support/EmuNtDll.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuNtDll.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,6 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ #include @@ -95,7 +85,8 @@ IMPORT(NtQueueApcThread); IMPORT(NtReadFile); IMPORT(NtReleaseMutant); IMPORT(NtReleaseSemaphore); -IMPORT(NtResumeThread); +IMPORT(NtResumeThread); +IMPORT(NtResetEvent); IMPORT(NtSetEvent); IMPORT(NtSetInformationFile); IMPORT(NtSetLdtEntries); diff --git a/src/CxbxKrnl/EmuNtDll.h b/src/core/kernel/support/EmuNtDll.h similarity index 99% rename from src/CxbxKrnl/EmuNtDll.h rename to src/core/kernel/support/EmuNtDll.h index 9a7a11cc1..04093329e 100644 --- a/src/CxbxKrnl/EmuNtDll.h +++ b/src/core/kernel/support/EmuNtDll.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuNtDll.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,11 +25,6 @@ #ifndef EMUNTDLL_H #define EMUNTDLL_H -#if defined(__cplusplus) -extern "C" -{ -#endif - #include // winnt ntndis // ****************************************************************** @@ -818,7 +804,7 @@ typedef struct _KUSER_SHARED_DATA } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA; // This is only the top of the actual definition. For the complete version, -// see http://processhacker.sourceforge.net/doc/ntexapi_8h_source.html +// see https://processhacker.sourceforge.io/doc/ntexapi_8h_source.html // ****************************************************************** // * GENERIC_MAPPING @@ -1482,6 +1468,15 @@ typedef NTSTATUS(NTAPI *FPTR_NtPulseEvent) IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL ); + +// ****************************************************************** +// * NtResetEvent +// ****************************************************************** +typedef NTSTATUS(NTAPI *FPTR_NtResetEvent) +( + IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL +); // ****************************************************************** // * NtCreateMutant @@ -1954,7 +1949,8 @@ EXTERN(NtQueryVolumeInformationFile); EXTERN(NtQueueApcThread); EXTERN(NtReadFile); EXTERN(NtReleaseMutant); -EXTERN(NtReleaseSemaphore); +EXTERN(NtReleaseSemaphore); +EXTERN(NtResetEvent); EXTERN(NtResumeThread); EXTERN(NtSetEvent); EXTERN(NtSetInformationFile); @@ -2017,10 +2013,6 @@ EXTERN(RtlUpcaseUnicodeChar); EXTERN(RtlUpcaseUnicodeString); EXTERN(RtlUpcaseUnicodeToMultiByteN); EXTERN(RtlUpperString); -EXTERN(RtlUshortByteSwap); - -#if defined(__cplusplus) -} -#endif +EXTERN(RtlUshortByteSwap); #endif diff --git a/src/devices/ADM1032Device.cpp b/src/devices/ADM1032Device.cpp index 3b53ae0a4..766314e0c 100644 --- a/src/devices/ADM1032Device.cpp +++ b/src/devices/ADM1032Device.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->ADM1032Device.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,9 +25,10 @@ // * // ****************************************************************** -#include "ADM1032Device.h" -#include "..\CxbxKrnl\Emu.h" // For EmuWarning +#define LOG_PREFIX CXBXR_MODULE::ADM +#include "ADM1032Device.h" +#include "core\kernel\support\Emu.h" // For EmuLog void ADM1032Device::Init() { @@ -51,7 +43,7 @@ uint8_t ADM1032Device::ReadByte(uint8_t command) if (command == 0x0) { return m_MBTemperature; } else if(command == 0x1) { return m_CPUTemperature; } - EmuWarning("Unknown read command sent to the temperature sensor. The command was %d", command); + EmuLog(LOG_LEVEL::WARNING, "Unknown read command sent to the temperature sensor. The command was %d", command); return 0; } diff --git a/src/devices/ADM1032Device.h b/src/devices/ADM1032Device.h index 9d2f074dc..0560971e4 100644 --- a/src/devices/ADM1032Device.h +++ b/src/devices/ADM1032Device.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->ADM1032Device.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/devices/EEPROMDevice.cpp b/src/devices/EEPROMDevice.cpp index bb38e7b5f..bd9f05bf5 100644 --- a/src/devices/EEPROMDevice.cpp +++ b/src/devices/EEPROMDevice.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->CxbxKrnl->EEPROMDevice.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/devices/EEPROMDevice.h b/src/devices/EEPROMDevice.h index 4ce613067..ccc6c0de5 100644 --- a/src/devices/EEPROMDevice.h +++ b/src/devices/EEPROMDevice.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->CxbxKrnl->EEPROMDevice.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/devices/EmuNVNet.cpp b/src/devices/EmuNVNet.cpp index 2dff00f47..571567ca3 100644 --- a/src/devices/EmuNVNet.cpp +++ b/src/devices/EmuNVNet.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuNVNet.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -38,156 +29,25 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "NET " // Intentional extra space to align on 4 characters +#define LOG_PREFIX CXBXR_MODULE::NET // prevent name collisions - namespace xboxkrnl { #include // For PKINTERRUPT, etc. }; -#include "CxbxKrnl\CxbxKrnl.h" -#include "CxbxKrnl\Emu.h" -#include "CxbxKrnl\EmuKrnl.h" - +#include +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "core\kernel\exports\EmuKrnl.h" +#include "EmuShared.h" +#include "devices\Xbox.h" #include "EmuNVNet.h" - -// NVNET Register Definitions -// Taken from XQEMU -enum { - NvRegIrqStatus = 0x000, -# define NVREG_IRQSTAT_BIT1 0x002 -# define NVREG_IRQSTAT_BIT4 0x010 -# define NVREG_IRQSTAT_MIIEVENT 0x040 -# define NVREG_IRQSTAT_MASK 0x1ff - NvRegIrqMask = 0x004, -# define NVREG_IRQ_RX 0x0002 -# define NVREG_IRQ_RX_NOBUF 0x0004 -# define NVREG_IRQ_TX_ERR 0x0008 -# define NVREG_IRQ_TX2 0x0010 -# define NVREG_IRQ_TIMER 0x0020 -# define NVREG_IRQ_LINK 0x0040 -# define NVREG_IRQ_TX1 0x0100 -# define NVREG_IRQMASK_WANTED_1 0x005f -# define NVREG_IRQMASK_WANTED_2 0x0147 -# define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|\ - NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|\ - NVREG_IRQ_TX1)) - NvRegUnknownSetupReg6 = 0x008, -# define NVREG_UNKSETUP6_VAL 3 - /* - * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic - * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms - */ - NvRegPollingInterval = 0x00c, -# define NVREG_POLL_DEFAULT 970 - NvRegMisc1 = 0x080, -# define NVREG_MISC1_HD 0x02 -# define NVREG_MISC1_FORCE 0x3b0f3c - NvRegTransmitterControl = 0x084, -# define NVREG_XMITCTL_START 0x01 - NvRegTransmitterStatus = 0x088, -# define NVREG_XMITSTAT_BUSY 0x01 - NvRegPacketFilterFlags = 0x8c, -# define NVREG_PFF_ALWAYS 0x7F0008 -# define NVREG_PFF_PROMISC 0x80 -# define NVREG_PFF_MYADDR 0x20 - NvRegOffloadConfig = 0x90, -# define NVREG_OFFLOAD_HOMEPHY 0x601 -# define NVREG_OFFLOAD_NORMAL 0x5ee - NvRegReceiverControl = 0x094, -# define NVREG_RCVCTL_START 0x01 - NvRegReceiverStatus = 0x98, -# define NVREG_RCVSTAT_BUSY 0x01 - NvRegRandomSeed = 0x9c, -# define NVREG_RNDSEED_MASK 0x00ff -# define NVREG_RNDSEED_FORCE 0x7f00 - NvRegUnknownSetupReg1 = 0xA0, -# define NVREG_UNKSETUP1_VAL 0x16070f - NvRegUnknownSetupReg2 = 0xA4, -# define NVREG_UNKSETUP2_VAL 0x16 - NvRegMacAddrA = 0xA8, - NvRegMacAddrB = 0xAC, - NvRegMulticastAddrA = 0xB0, -# define NVREG_MCASTADDRA_FORCE 0x01 - NvRegMulticastAddrB = 0xB4, - NvRegMulticastMaskA = 0xB8, - NvRegMulticastMaskB = 0xBC, - NvRegTxRingPhysAddr = 0x100, - NvRegRxRingPhysAddr = 0x104, - NvRegRingSizes = 0x108, -# define NVREG_RINGSZ_TXSHIFT 0 -# define NVREG_RINGSZ_RXSHIFT 16 - NvRegUnknownTransmitterReg = 0x10c, - NvRegLinkSpeed = 0x110, -# define NVREG_LINKSPEED_FORCE 0x10000 -# define NVREG_LINKSPEED_10 10 -# define NVREG_LINKSPEED_100 100 -# define NVREG_LINKSPEED_1000 1000 - NvRegUnknownSetupReg5 = 0x130, -# define NVREG_UNKSETUP5_BIT31 (1<<31) - NvRegUnknownSetupReg3 = 0x134, -# define NVREG_UNKSETUP3_VAL1 0x200010 - NvRegUnknownSetupReg8 = 0x13C, -# define NVREG_UNKSETUP8_VAL1 0x300010 - NvRegUnknownSetupReg7 = 0x140, -# define NVREG_UNKSETUP7_VAL 0x300010 - NvRegTxRxControl = 0x144, -# define NVREG_TXRXCTL_KICK 0x0001 -# define NVREG_TXRXCTL_BIT1 0x0002 -# define NVREG_TXRXCTL_BIT2 0x0004 -# define NVREG_TXRXCTL_IDLE 0x0008 -# define NVREG_TXRXCTL_RESET 0x0010 - NvRegMIIStatus = 0x180, -# define NVREG_MIISTAT_ERROR 0x0001 -# define NVREG_MIISTAT_LINKCHANGE 0x0008 -# define NVREG_MIISTAT_MASK 0x000f -# define NVREG_MIISTAT_MASK2 0x000f - NvRegUnknownSetupReg4 = 0x184, -# define NVREG_UNKSETUP4_VAL 8 - NvRegAdapterControl = 0x188, -# define NVREG_ADAPTCTL_START 0x02 -# define NVREG_ADAPTCTL_LINKUP 0x04 -# define NVREG_ADAPTCTL_PHYVALID 0x4000 -# define NVREG_ADAPTCTL_RUNNING 0x100000 -# define NVREG_ADAPTCTL_PHYSHIFT 24 - NvRegMIISpeed = 0x18c, -# define NVREG_MIISPEED_BIT8 (1<<8) -# define NVREG_MIIDELAY 5 - NvRegMIIControl = 0x190, -# define NVREG_MIICTL_INUSE 0x10000 -# define NVREG_MIICTL_WRITE 0x08000 -# define NVREG_MIICTL_ADDRSHIFT 5 - NvRegMIIData = 0x194, - NvRegWakeUpFlags = 0x200, -# define NVREG_WAKEUPFLAGS_VAL 0x7770 -# define NVREG_WAKEUPFLAGS_BUSYSHIFT 24 -# define NVREG_WAKEUPFLAGS_ENABLESHIFT 16 -# define NVREG_WAKEUPFLAGS_D3SHIFT 12 -# define NVREG_WAKEUPFLAGS_D2SHIFT 8 -# define NVREG_WAKEUPFLAGS_D1SHIFT 4 -# define NVREG_WAKEUPFLAGS_D0SHIFT 0 -# define NVREG_WAKEUPFLAGS_ACCEPT_MAGPAT 0x01 -# define NVREG_WAKEUPFLAGS_ACCEPT_WAKEUPPAT 0x02 -# define NVREG_WAKEUPFLAGS_ACCEPT_LINKCHANGE 0x04 - NvRegPatternCRC = 0x204, - NvRegPatternMask = 0x208, - NvRegPowerCap = 0x268, -# define NVREG_POWERCAP_D3SUPP (1<<30) -# define NVREG_POWERCAP_D2SUPP (1<<26) -# define NVREG_POWERCAP_D1SUPP (1<<25) - NvRegPowerState = 0x26c, -# define NVREG_POWERSTATE_POWEREDUP 0x8000 -# define NVREG_POWERSTATE_VALID 0x0100 -# define NVREG_POWERSTATE_MASK 0x0003 -# define NVREG_POWERSTATE_D0 0x0000 -# define NVREG_POWERSTATE_D1 0x0001 -# define NVREG_POWERSTATE_D2 0x0002 -# define NVREG_POWERSTATE_D3 0x0003 -}; +#include +#include +#include #define IOPORT_SIZE 0x8 #define MMIO_SIZE 0x400 @@ -281,7 +141,7 @@ enum { * Primary State Structure ******************************************************************************/ -struct NvNetState { +typedef struct NvNetState { uint8_t regs[MMIO_SIZE / 4]; uint32_t phy_regs[6]; uint8_t tx_ring_index; @@ -291,7 +151,9 @@ struct NvNetState { uint8_t txrx_dma_buf[RX_ALLOC_BUFSIZE]; FILE *packet_dump_file; char *packet_dump_path; -} NvNetState; +} NvNetState_t; + +NvNetState_t NvNetState; struct RingDesc { uint32_t packet_buffer; @@ -393,7 +255,7 @@ void EmuNVNet_UpdateIRQ() { if (EmuNVNet_GetRegister(NvRegIrqMask, 4) && EmuNVNet_GetRegister(NvRegIrqStatus, 4)) { - DbgPrintf("EmuNVNet: Asserting IRQ\n"); + EmuLog(LOG_LEVEL::DEBUG, "Asserting IRQ"); HalSystemInterrupts[4].Assert(true); } else { HalSystemInterrupts[4].Assert(false); @@ -412,7 +274,7 @@ int EmuNVNet_MiiReadWrite(uint64_t val) reg = mii_ctl & ((1 << NVREG_MIICTL_ADDRSHIFT) - 1); write = mii_ctl & NVREG_MIICTL_WRITE; - DbgPrintf("nvnet mii %s: phy 0x%x %s [0x%x]\n", write ? "write" : "read", phy_addr, EmuNVNet_GetMiiRegisterName(reg), reg); + EmuLog(LOG_LEVEL::DEBUG, "nvnet mii %s: phy 0x%x %s [0x%x]", write ? "write" : "read", phy_addr, EmuNVNet_GetMiiRegisterName(reg), reg); if (phy_addr != 1) { return -1; @@ -443,7 +305,7 @@ int EmuNVNet_MiiReadWrite(uint64_t val) uint32_t EmuNVNet_Read(xbaddr addr, int size) { - DbgPrintf("NET : Read%d: %s (0x%.8X)\n", size, EmuNVNet_GetRegisterName(addr), addr); + EmuLog(LOG_LEVEL::DEBUG, "Read%d: %s (0x%.8X)", size * 8, EmuNVNet_GetRegisterName(addr), addr); switch (addr) { case NvRegMIIData: @@ -457,6 +319,114 @@ uint32_t EmuNVNet_Read(xbaddr addr, int size) return EmuNVNet_GetRegister(addr,size); } +void EmuNVNet_DMAPacketFromGuest() +{ + struct RingDesc desc; + bool is_last_packet; + bool packet_sent = false; + + NvNetState_t* s = &NvNetState; + + for (int i = 0; i < s->tx_ring_size; i++) { + /* Read ring descriptor */ + s->tx_ring_index %= s->tx_ring_size; + xbaddr tx_ring_addr = EmuNVNet_GetRegister(NvRegTxRingPhysAddr, 4); + tx_ring_addr += s->tx_ring_index * sizeof(desc); + + memcpy(&desc, (void*)(tx_ring_addr | CONTIGUOUS_MEMORY_BASE), sizeof(desc)); + + EmuLog(LOG_LEVEL::DEBUG, "Looking at ring desc %d (%llx): " + "\n Buffer: 0x%x " + "\n Length: 0x%x " + "\n Flags: 0x%x ", + s->tx_ring_index, tx_ring_addr, desc.packet_buffer, desc.length, desc.flags); + + s->tx_ring_index += 1; + + if (!(desc.flags & NV_TX_VALID)) { + continue; + } + + /* Transfer packet from guest memory */ + EmuLog(LOG_LEVEL::DEBUG, "Sending packet..."); + + memcpy(s->txrx_dma_buf, (void*)(desc.packet_buffer | CONTIGUOUS_MEMORY_BASE), desc.length + 1); + g_NVNet->PCAPSend(s->txrx_dma_buf, desc.length + 1); + + packet_sent = true; + + /* Update descriptor */ + is_last_packet = desc.flags & NV_TX_LASTPACKET; + desc.flags &= ~(NV_TX_VALID | NV_TX_RETRYERROR | NV_TX_DEFERRED | NV_TX_CARRIERLOST | NV_TX_LATECOLLISION | NV_TX_UNDERFLOW | NV_TX_ERROR); + desc.length = desc.length + 5; + + memcpy((void*)(tx_ring_addr | CONTIGUOUS_MEMORY_BASE), &desc, sizeof(desc)); + + if (is_last_packet) { + EmuLog(LOG_LEVEL::DEBUG, " -- Last packet"); + break; + } + } + + if (packet_sent) { + /* Trigger interrupt */ + EmuLog(LOG_LEVEL::DEBUG, "Triggering interrupt"); + EmuNVNet_SetRegister(NvRegIrqStatus, NVREG_IRQSTAT_BIT4, 4); + EmuNVNet_UpdateIRQ(); + } +} + +bool EmuNVNet_DMAPacketToGuest(void* packet, size_t size) +{ + struct RingDesc desc; + + NvNetState_t* s = &NvNetState; + + for (int i = 0; i < s->rx_ring_size; i++) { + /* Read current ring descriptor */ + s->rx_ring_index %= s->rx_ring_size; + xbaddr rx_ring_addr = EmuNVNet_GetRegister(NvRegRxRingPhysAddr, 4); + rx_ring_addr += s->rx_ring_index * sizeof(desc); + + memcpy(&desc, (void*)(rx_ring_addr | CONTIGUOUS_MEMORY_BASE), sizeof(desc)); + + EmuLog(LOG_LEVEL::DEBUG, "Looking at ring descriptor %d (0x%llx): " + "\n Buffer: 0x%x " + "\n Length: 0x%x " + "\n Flags: 0x%x ", + s->rx_ring_index, rx_ring_addr, desc.packet_buffer, desc.length, desc.flags); + + s->rx_ring_index += 1; + + if (!(desc.flags & NV_RX_AVAIL) || !(desc.length >= size)) { + continue; + } + + /* Transfer packet from device to memory */ + EmuLog(LOG_LEVEL::DEBUG, "Transferring packet, size 0x%zx, to memory at 0x%x", size, desc.packet_buffer); + memcpy((void*)(desc.packet_buffer | CONTIGUOUS_MEMORY_BASE), packet, size); + + /* Update descriptor indicating the packet is waiting */ + desc.length = (uint16_t)size; + desc.flags = NV_RX_BIT4 | NV_RX_DESCRIPTORVALID; + memcpy((void*)(rx_ring_addr | CONTIGUOUS_MEMORY_BASE), &desc, sizeof(desc)); + EmuLog(LOG_LEVEL::DEBUG, "Updated ring descriptor: " + "\n Length: 0x%x " + "\n Flags: 0x%x ", + desc.flags, desc.length); + + /* Trigger interrupt */ + EmuLog(LOG_LEVEL::DEBUG, "Triggering interrupt"); + EmuNVNet_SetRegister(NvRegIrqStatus, NVREG_IRQSTAT_BIT1, 4); + EmuNVNet_UpdateIRQ(); + return true; + } + + /* Could not find free buffer, or packet too large. */ + EmuLog(LOG_LEVEL::DEBUG, "Could not find free buffer!"); + return false; +} + void EmuNVNet_Write(xbaddr addr, uint32_t value, int size) { switch (addr) { @@ -470,9 +440,8 @@ void EmuNVNet_Write(xbaddr addr, uint32_t value, int size) break; case NvRegTxRxControl: if (value == NVREG_TXRXCTL_KICK) { - DbgPrintf("NvRegTxRxControl = NVREG_TXRXCTL_KICK!\n"); - EmuWarning("TODO: nvnet_dma_packet_from_guest"); - // nvnet_dma_packet_from_guest(s); + EmuLog(LOG_LEVEL::DEBUG, "NvRegTxRxControl = NVREG_TXRXCTL_KICK!"); + EmuNVNet_DMAPacketFromGuest(); } if (value & NVREG_TXRXCTL_BIT2) { @@ -507,7 +476,20 @@ void EmuNVNet_Write(xbaddr addr, uint32_t value, int size) break; } - DbgPrintf("NET : Write%d: %s (0x%.8X) = 0x%.8X\n", size, EmuNVNet_GetRegisterName(addr), addr, value); + EmuLog(LOG_LEVEL::DEBUG, "Write%d: %s (0x%.8X) = 0x%.8X", size * 8, EmuNVNet_GetRegisterName(addr), addr, value); +} + +std::thread NVNetRecvThread; +static void NVNetRecvThreadProc(NvNetState_t *s) +{ + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + uint8_t packet[65536]; + while (true) { + int size = g_NVNet->PCAPReceive(packet, 65536); + if (size > 0) { + EmuNVNet_DMAPacketToGuest(packet, size); + } + } } /* NVNetDevice */ @@ -520,7 +502,7 @@ void NVNetDevice::Init() // Register Memory bar : r.Raw.type = PCI_BAR_TYPE_MEMORY; - r.Memory.address = NVNET_ADDR >> 4; + r.Memory.address = NVNET_BASE >> 4; RegisterBAR(0, NVNET_SIZE, r.value); // Register IO bar : @@ -530,12 +512,59 @@ void NVNetDevice::Init() m_DeviceId = 0x01C3; m_VendorId = PCI_VENDOR_ID_NVIDIA; + + memset(NvNetState.regs, 0, sizeof(NvNetState.regs)); + NvNetState.rx_ring_index = 0; + NvNetState.rx_ring_size = 0; + NvNetState.tx_ring_index = 0; + NvNetState.tx_ring_size = 0; + + // Fetch Host Network Device + Settings::s_network networkSettings; + g_EmuShared->GetNetworkSettings(&networkSettings); + m_HostAdapterName = networkSettings.adapter_name; + + // Get Mac Address + if (!GetMacAddress(m_HostAdapterName, m_HostMacAddress.bytes)) { + EmuLog(LOG_LEVEL::WARNING, "Failed to initialize network adapter."); + return; + }; + + PCAPInit(); + NVNetRecvThread = std::thread(NVNetRecvThreadProc, &NvNetState); } void NVNetDevice::Reset() { } +bool NVNetDevice::GetMacAddress(std::string adapterName, void* pMAC) +{ + IP_ADAPTER_INFO AdapterInfo[128]; + PIP_ADAPTER_INFO pAdapterInfo; + ULONG dwBufferLength = sizeof(AdapterInfo); + + DWORD dwStatus = GetAdaptersInfo(AdapterInfo, &dwBufferLength); + if (dwStatus != ERROR_SUCCESS) { + return false; + } + + pAdapterInfo = AdapterInfo; + + // Find the specified adapter + do { + if (strcmp(pAdapterInfo->AdapterName, adapterName.c_str()) == 0) { + memcpy(pMAC, pAdapterInfo->Address, 6); + return true; + } + + pAdapterInfo = pAdapterInfo->Next; + + } while (pAdapterInfo); + + return false; +} + uint32_t NVNetDevice::IORead(int barIndex, uint32_t port, unsigned size) { if (barIndex != 1) { @@ -554,12 +583,12 @@ void NVNetDevice::IOWrite(int barIndex, uint32_t port, uint32_t value, unsigned } uint32_t NVNetDevice::MMIORead(int barIndex, uint32_t addr, unsigned size) -{ +{ if (barIndex != 0) { return 0; } - return EmuNVNet_Read(addr, size * 8); // For now, forward + return EmuNVNet_Read(addr, size); // For now, forward } void NVNetDevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) @@ -568,5 +597,129 @@ void NVNetDevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigne return; } - EmuNVNet_Write(addr, value, size * 8); // For now, forward + EmuNVNet_Write(addr, value, size); // For now, forward + + // Cache guest MAC address for packet filter + if (addr == NvRegMacAddrA) { + m_GuestMacAddress.bytes[0] = NvNetState.regs[NvRegMacAddrA + 0]; + m_GuestMacAddress.bytes[1] = NvNetState.regs[NvRegMacAddrA + 1]; + m_GuestMacAddress.bytes[2] = NvNetState.regs[NvRegMacAddrA + 2]; + m_GuestMacAddress.bytes[3] = NvNetState.regs[NvRegMacAddrA + 3]; + } + else if (addr == NvRegMacAddrB) { + m_GuestMacAddress.bytes[4] = NvNetState.regs[NvRegMacAddrB + 0]; + m_GuestMacAddress.bytes[5] = NvNetState.regs[NvRegMacAddrB + 1]; + } +} + +bool NVNetDevice::PCAPInit() +{ + char errorBuffer[PCAP_ERRBUF_SIZE]; + + // Open the desired network adapter + __try { + char buffer[MAX_PATH]; + snprintf(buffer, MAX_PATH, "\\Device\\NPF_%s", m_HostAdapterName.c_str()); + m_AdapterHandle = pcap_open_live(buffer, + 65536, // Capture entire packet + 1, // Use promiscuous mode + 1, // Read Timeout + errorBuffer + ); + } __except(EXCEPTION_EXECUTE_HANDLER) { + m_AdapterHandle = nullptr; + snprintf(errorBuffer, PCAP_ERRBUF_SIZE, "Could not initialize pcap"); + } + + if (m_AdapterHandle == nullptr) { + EmuLog(LOG_LEVEL::WARNING, "Unable to open Network Adapter:\n%s\nNetworking will be disabled", errorBuffer); + return false; + } + + if (pcap_setnonblock((pcap_t*)m_AdapterHandle, 1, errorBuffer) == -1) { + EmuLog(LOG_LEVEL::WARNING, "PCAP: Failed to set non-blocking mode"); + } + + m_PCAPRunning = true; + return true; +} + +void PrintRawPayload(void* buffer, size_t length) +{ + uint8_t* startAddr = (uint8_t*)buffer; + + printf("----Payload----\n"); + for (uint8_t* addr = startAddr; addr < (startAddr + length); addr += 16) { + printf("%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\t|\t%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", + addr[0x0], addr[0x1], addr[0x2], addr[0x3], addr[0x4], addr[0x5], addr[0x6], addr[0x7], + addr[0x8], addr[0x9], addr[0xA], addr[0xB], addr[0xC], addr[0xD3], addr[0xE], addr[0xF], + addr[0x0], addr[0x1], addr[0x2], addr[0x3], addr[0x4], addr[0x5], addr[0x6], addr[0x7], + addr[0x8], addr[0x9], addr[0xA], addr[0xB], addr[0xC], addr[0xD3], addr[0xE], addr[0xF] + ); + } +} + +void PrintPacket(void* buffer, size_t length) +{ + ethernet_header* header = (ethernet_header*)buffer; + printf("----Ethernet Frame----\n"); + printf("Src: %02X:%02X:%02X:%02X:%02X:%02X\n", header->src.bytes[0], header->src.bytes[1], header->src.bytes[2], header->src.bytes[3], header->src.bytes[4], header->src.bytes[5]); + printf("Dst: %02X:%02X:%02X:%02X:%02X:%02X\n", header->dst.bytes[0], header->dst.bytes[1], header->dst.bytes[2], header->dst.bytes[3], header->dst.bytes[4], header->dst.bytes[5]); + printf("EtherType: %04X\n", ntohs(header->protocol)); + + void* payloadPtr = (void*)((uint8_t*)buffer + sizeof(ethernet_header)); + size_t payloadLength = length - sizeof(ethernet_header); + + // TODO: If we support the EtherType, decode it, otherwise, just dump the raw payload + //switch (ntohs(header->protocol)) + { + // default: + PrintRawPayload(payloadPtr, payloadLength); + } +} + +bool NVNetDevice::PCAPSend(void* packet, size_t length) +{ + if (!m_PCAPRunning) { + return false; + } + + ethernet_header* header = (ethernet_header*)packet; + + // TODO: Optional + // PrintPacket(packet, length); + + // Forward broadcast packets direct to the host PC, as well as over the network + if (memcmp(header->dst.bytes, m_BroadcastMacAddress.bytes, 6) == 0) { + static char pack[65536]; + memcpy(pack, packet, length); + ethernet_header* _header = (ethernet_header*)pack; + _header->dst = m_HostMacAddress; + pcap_sendpacket((pcap_t*)m_AdapterHandle, (uint8_t*)pack, length); + } + + return pcap_sendpacket((pcap_t*)m_AdapterHandle, (uint8_t*)packet, length); +} + +size_t NVNetDevice::PCAPReceive(void* packet, size_t max_length) +{ + if (!m_PCAPRunning) { + return -1; + } + + struct pcap_pkthdr *header; + const uint8_t *pkt_data; + + if (int res = pcap_next_ex((pcap_t*)m_AdapterHandle, &header, &pkt_data) > 0) { + // Only forward packets that are broadcast or specifically for Cxbx-R's MAC + ethernet_header* e_header = (ethernet_header*)pkt_data; + if (memcmp(e_header->dst.bytes, m_GuestMacAddress.bytes, 6) == 0 || memcmp(e_header->dst.bytes, m_BroadcastMacAddress.bytes, 6) == 0) { + memcpy(packet, pkt_data, header->len); + return header->len; + } + + return -1; + } + + return -1; } diff --git a/src/devices/EmuNVNet.h b/src/devices/EmuNVNet.h index be80a8473..956ca30d4 100644 --- a/src/devices/EmuNVNet.h +++ b/src/devices/EmuNVNet.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuNVNet.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -32,11 +23,187 @@ // * // ****************************************************************** #pragma once + +#include #include "PCIDevice.h" // For PCIDevice -#define NVNET_ADDR 0xFEF00000 -#define NVNET_SIZE 0x00000400 +// NVNET Register Definitions +// Taken from XQEMU +enum { + NvRegIrqStatus = 0x000, +# define NVREG_IRQSTAT_BIT1 0x002 +# define NVREG_IRQSTAT_BIT4 0x010 +# define NVREG_IRQSTAT_MIIEVENT 0x040 +# define NVREG_IRQSTAT_MASK 0x1ff + NvRegIrqMask = 0x004, +# define NVREG_IRQ_RX 0x0002 +# define NVREG_IRQ_RX_NOBUF 0x0004 +# define NVREG_IRQ_TX_ERR 0x0008 +# define NVREG_IRQ_TX2 0x0010 +# define NVREG_IRQ_TIMER 0x0020 +# define NVREG_IRQ_LINK 0x0040 +# define NVREG_IRQ_TX1 0x0100 +# define NVREG_IRQMASK_WANTED_1 0x005f +# define NVREG_IRQMASK_WANTED_2 0x0147 +# define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|\ + NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|\ + NVREG_IRQ_TX1)) + NvRegUnknownSetupReg6 = 0x008, +# define NVREG_UNKSETUP6_VAL 3 + /* + * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic + * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms + */ + NvRegPollingInterval = 0x00c, +# define NVREG_POLL_DEFAULT 970 + NvRegMisc1 = 0x080, +# define NVREG_MISC1_HD 0x02 +# define NVREG_MISC1_FORCE 0x3b0f3c + NvRegTransmitterControl = 0x084, +# define NVREG_XMITCTL_START 0x01 + NvRegTransmitterStatus = 0x088, +# define NVREG_XMITSTAT_BUSY 0x01 + NvRegPacketFilterFlags = 0x8c, +# define NVREG_PFF_ALWAYS 0x7F0008 +# define NVREG_PFF_PROMISC 0x80 +# define NVREG_PFF_MYADDR 0x20 + NvRegOffloadConfig = 0x90, +# define NVREG_OFFLOAD_HOMEPHY 0x601 +# define NVREG_OFFLOAD_NORMAL 0x5ee + NvRegReceiverControl = 0x094, +# define NVREG_RCVCTL_START 0x01 + NvRegReceiverStatus = 0x98, +# define NVREG_RCVSTAT_BUSY 0x01 + NvRegRandomSeed = 0x9c, +# define NVREG_RNDSEED_MASK 0x00ff +# define NVREG_RNDSEED_FORCE 0x7f00 + NvRegUnknownSetupReg1 = 0xA0, +# define NVREG_UNKSETUP1_VAL 0x16070f + NvRegUnknownSetupReg2 = 0xA4, +# define NVREG_UNKSETUP2_VAL 0x16 + NvRegMacAddrA = 0xA8, + NvRegMacAddrB = 0xAC, + NvRegMulticastAddrA = 0xB0, +# define NVREG_MCASTADDRA_FORCE 0x01 + NvRegMulticastAddrB = 0xB4, + NvRegMulticastMaskA = 0xB8, + NvRegMulticastMaskB = 0xBC, + NvRegTxRingPhysAddr = 0x100, + NvRegRxRingPhysAddr = 0x104, + NvRegRingSizes = 0x108, +# define NVREG_RINGSZ_TXSHIFT 0 +# define NVREG_RINGSZ_RXSHIFT 16 + NvRegUnknownTransmitterReg = 0x10c, + NvRegLinkSpeed = 0x110, +# define NVREG_LINKSPEED_FORCE 0x10000 +# define NVREG_LINKSPEED_10 10 +# define NVREG_LINKSPEED_100 100 +# define NVREG_LINKSPEED_1000 1000 + NvRegUnknownSetupReg5 = 0x130, +# define NVREG_UNKSETUP5_BIT31 (1<<31) + NvRegUnknownSetupReg3 = 0x134, +# define NVREG_UNKSETUP3_VAL1 0x200010 + NvRegUnknownSetupReg8 = 0x13C, +# define NVREG_UNKSETUP8_VAL1 0x300010 + NvRegUnknownSetupReg7 = 0x140, +# define NVREG_UNKSETUP7_VAL 0x300010 + NvRegTxRxControl = 0x144, +# define NVREG_TXRXCTL_KICK 0x0001 +# define NVREG_TXRXCTL_BIT1 0x0002 +# define NVREG_TXRXCTL_BIT2 0x0004 +# define NVREG_TXRXCTL_IDLE 0x0008 +# define NVREG_TXRXCTL_RESET 0x0010 + NvRegMIIStatus = 0x180, +# define NVREG_MIISTAT_ERROR 0x0001 +# define NVREG_MIISTAT_LINKCHANGE 0x0008 +# define NVREG_MIISTAT_MASK 0x000f +# define NVREG_MIISTAT_MASK2 0x000f + NvRegUnknownSetupReg4 = 0x184, +# define NVREG_UNKSETUP4_VAL 8 + NvRegAdapterControl = 0x188, +# define NVREG_ADAPTCTL_START 0x02 +# define NVREG_ADAPTCTL_LINKUP 0x04 +# define NVREG_ADAPTCTL_PHYVALID 0x4000 +# define NVREG_ADAPTCTL_RUNNING 0x100000 +# define NVREG_ADAPTCTL_PHYSHIFT 24 + NvRegMIISpeed = 0x18c, +# define NVREG_MIISPEED_BIT8 (1<<8) +# define NVREG_MIIDELAY 5 + NvRegMIIControl = 0x190, +# define NVREG_MIICTL_INUSE 0x10000 +# define NVREG_MIICTL_WRITE 0x08000 +# define NVREG_MIICTL_ADDRSHIFT 5 + NvRegMIIData = 0x194, + NvRegWakeUpFlags = 0x200, +# define NVREG_WAKEUPFLAGS_VAL 0x7770 +# define NVREG_WAKEUPFLAGS_BUSYSHIFT 24 +# define NVREG_WAKEUPFLAGS_ENABLESHIFT 16 +# define NVREG_WAKEUPFLAGS_D3SHIFT 12 +# define NVREG_WAKEUPFLAGS_D2SHIFT 8 +# define NVREG_WAKEUPFLAGS_D1SHIFT 4 +# define NVREG_WAKEUPFLAGS_D0SHIFT 0 +# define NVREG_WAKEUPFLAGS_ACCEPT_MAGPAT 0x01 +# define NVREG_WAKEUPFLAGS_ACCEPT_WAKEUPPAT 0x02 +# define NVREG_WAKEUPFLAGS_ACCEPT_LINKCHANGE 0x04 + NvRegPatternCRC = 0x204, + NvRegPatternMask = 0x208, + NvRegPowerCap = 0x268, +# define NVREG_POWERCAP_D3SUPP (1<<30) +# define NVREG_POWERCAP_D2SUPP (1<<26) +# define NVREG_POWERCAP_D1SUPP (1<<25) + NvRegPowerState = 0x26c, +# define NVREG_POWERSTATE_POWEREDUP 0x8000 +# define NVREG_POWERSTATE_VALID 0x0100 +# define NVREG_POWERSTATE_MASK 0x0003 +# define NVREG_POWERSTATE_D0 0x0000 +# define NVREG_POWERSTATE_D1 0x0001 +# define NVREG_POWERSTATE_D2 0x0002 +# define NVREG_POWERSTATE_D3 0x0003 +}; + +typedef struct _ip_address +{ + uint8_t bytes[4]; +} ip_address; + +typedef struct _mac_address +{ + uint8_t bytes[6]; +} mac_address; + +typedef struct _ethernet_header +{ + mac_address dst; + mac_address src; + uint16_t protocol; +} ethernet_header; + +typedef struct _arp_packet +{ + uint16_t hw_type; + uint16_t protocol; + uint8_t h_addr_len; + uint8_t p_addr_len; + uint16_t operation; + mac_address h_src; + ip_address p_src; + mac_address h_dst; + ip_address p_dst; +} arp_packet; + +typedef struct _ip_header { + uint8_t ver_hlen; /* version << 4 | header length >> 2 */ + uint8_t type; /* type of service */ + uint16_t len; /* total length */ + uint16_t id; /* identification */ + uint16_t offset; /* fragment offset field */ + uint8_t ttl; /* time to live */ + uint8_t proto; /* protocol */ + uint16_t hdr_csum; /* checksum */ + ip_address src; /* source and dest address */ + ip_address dst; +} ip_header; class NVNetDevice : public PCIDevice { public: @@ -47,4 +214,18 @@ public: void IOWrite(int barIndex, uint32_t port, uint32_t value, unsigned size); uint32_t MMIORead(int barIndex, uint32_t addr, unsigned size); void MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size); + + __declspec(noinline) bool PCAPSend(void* packet, size_t length); + size_t PCAPReceive(void* packet, size_t max_length); +private: + bool PCAPInit(); + bool GetMacAddress(std::string adapterName, void* pMAC); + + bool m_PCAPRunning = false; + + void* m_AdapterHandle = nullptr; + std::string m_HostAdapterName; + mac_address m_HostMacAddress; + mac_address m_GuestMacAddress = { 0x00, 0x50, 0xF2, 0x00, 0x00, 0x34 }; + mac_address m_BroadcastMacAddress = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; }; diff --git a/src/devices/LED.h b/src/devices/LED.h index 16273a58a..8ff96e87c 100644 --- a/src/devices/LED.h +++ b/src/devices/LED.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->CxbxKrnl->LED.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -37,7 +28,7 @@ namespace LED { - // See http://xboxdevwiki.net/PIC#The_LED + // See https://xboxdevwiki.net/PIC#The_LED namespace Phase0 { enum { Off = 0, Red = 1 << 7, Green = 1 << 3, Orange = Red | Green }; }; namespace Phase1 { enum { Off = 0, Red = 1 << 6, Green = 1 << 2, Orange = Red | Green }; }; namespace Phase2 { enum { Off = 0, Red = 1 << 5, Green = 1 << 1, Orange = Red | Green }; }; diff --git a/src/devices/MCPXDevice.cpp b/src/devices/MCPXDevice.cpp index ec0ff9264..44d226fff 100644 --- a/src/devices/MCPXDevice.cpp +++ b/src/devices/MCPXDevice.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->video->MCPXDevice.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,12 +24,12 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "MCPX" +#define LOG_PREFIX CXBXR_MODULE::MCPX -#include "MCPXDevice.h" +#include "MCPXDevice.h" +#include "Logging.h" /* MCPXDevice */ diff --git a/src/devices/MCPXDevice.h b/src/devices/MCPXDevice.h index 73a42c375..0531b39f2 100644 --- a/src/devices/MCPXDevice.h +++ b/src/devices/MCPXDevice.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->video->MCPXDevice.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/devices/PCIBus.cpp b/src/devices/PCIBus.cpp index da222ac4f..a8ace9630 100644 --- a/src/devices/PCIBus.cpp +++ b/src/devices/PCIBus.cpp @@ -1,7 +1,34 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #include "PCIBus.h" #include -void PCIBus::ConnectDevice(uint32_t deviceId, PCIDevice *pDevice) +void PCIBus::ConnectDevice(uint32_t deviceId, PCIDevice *pDevice) { if (m_Devices.find(deviceId) != m_Devices.end()) { printf("PCIBus: Attempting to connect two devices to the same device address\n"); @@ -125,4 +152,4 @@ void PCIBus::Reset() for (auto it = m_Devices.begin(); it != m_Devices.end(); ++it) { it->second->Reset(); } -} \ No newline at end of file +} diff --git a/src/devices/PCIBus.h b/src/devices/PCIBus.h index 29dc9b6cf..f49070393 100644 --- a/src/devices/PCIBus.h +++ b/src/devices/PCIBus.h @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #ifndef _PCIMANAGER_H_ #define _PCIMANAGER_H_ @@ -48,4 +75,4 @@ private: PCIConfigAddressRegister m_configAddressRegister; }; -#endif \ No newline at end of file +#endif diff --git a/src/devices/PCIDevice.cpp b/src/devices/PCIDevice.cpp index c2195dff3..cd057364b 100644 --- a/src/devices/PCIDevice.cpp +++ b/src/devices/PCIDevice.cpp @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #include "PCIDevice.h" bool PCIDevice::GetIOBar(uint32_t port, PCIBar* bar) diff --git a/src/devices/PCIDevice.h b/src/devices/PCIDevice.h index 270338d05..0c642d863 100644 --- a/src/devices/PCIDevice.h +++ b/src/devices/PCIDevice.h @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #ifndef _PCIDEVICE_H_ #define _PCIDEVICE_H_ @@ -18,6 +45,28 @@ #define PCI_VENDOR_ID_NVIDIA 0x10DE +// MMIO addresses and sizes for the various xbox devices +#define NV2A_ADDR 0xFD000000 +#define NV2A_SIZE 0x01000000 +#define NV2A_PRAMIN_ADDR 0xFD700000 +#define NV2A_PRAMIN_SIZE 0x100000 +#define NV2A_USER_ADDR 0xFD800000 +#define NV2A_USER_SIZE 0x800000 +#define APU_BASE 0xFE800000 +#define APU_SIZE 0x80000 +#define AC97_BASE 0xFEC00000 +#define AC97_SIZE 0x1000 +#define USB0_BASE 0xFED00000 +#define USB1_BASE 0xFED08000 // alpha kits only +#define USB_SIZE 0x1000 +#define NVNET_BASE 0xFEF00000 +#define NVNET_SIZE 0x400 +#define BIOS_BASE 0xFF000000 // this takes into account that the bios covers the top 16 MiB of memory +#define BIOS_XBOX_SIZE 0xFFFE00 +#define BIOS_CHIHIRO_SIZE 0x1000000 +#define MCPX_BASE 0xFFFFFE00 +#define MCPX_SIZE 0x200 + class PCIDevice; typedef struct @@ -92,4 +141,4 @@ private: */ }; -#endif \ No newline at end of file +#endif diff --git a/src/devices/SMBus.cpp b/src/devices/SMBus.cpp index 90b13a268..7826d9001 100644 --- a/src/devices/SMBus.cpp +++ b/src/devices/SMBus.cpp @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #include #include "SMBus.h" @@ -218,4 +245,4 @@ uint32_t SMBus::MMIORead(int barIndex, uint32_t addr, unsigned size) void SMBus::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) { -} \ No newline at end of file +} diff --git a/src/devices/SMBus.h b/src/devices/SMBus.h index e78995de1..506264883 100644 --- a/src/devices/SMBus.h +++ b/src/devices/SMBus.h @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #ifndef _SMBUS_H_ #define _SMBUS_H_ @@ -78,4 +105,4 @@ class SMBus : public PCIDevice { std::map m_Devices; }; -#endif \ No newline at end of file +#endif diff --git a/src/devices/SMCDevice.cpp b/src/devices/SMCDevice.cpp index 651469c4d..278aad931 100644 --- a/src/devices/SMCDevice.cpp +++ b/src/devices/SMCDevice.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->CxbxKrnl->SMCDevice.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,8 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ + +#define LOG_PREFIX CXBXR_MODULE::SMC /* prevent name collisions */ namespace xboxkrnl @@ -41,8 +33,8 @@ namespace xboxkrnl #include // For xbox.h:AV_PACK_HDTV }; -#include "CxbxKrnl\CxbxKrnl.h" -#include "CxbxKrnl\EmuShared.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "EmuShared.h" #include "SMCDevice.h" // For SMCDevice #include "ADM1032Device.h" // For ADM1032Device @@ -50,32 +42,35 @@ namespace xboxkrnl void SetLEDSequence(LED::Sequence aLEDSequence) { - // See http://xboxdevwiki.net/PIC#The_LED - DbgPrintf("SMC : SetLEDSequence : %u\n", (byte)aLEDSequence); + // See https://xboxdevwiki.net/PIC#The_LED + EmuLog(LOG_LEVEL::DEBUG, "SetLEDSequence : %u", (byte)aLEDSequence); - int LedSequence[4] = { XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF }; + union { + UINT LedSequenceBlock; + UCHAR LedSequence[4] = { XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF }; + }; LedSequence[0] = ((aLEDSequence >> 6) & 2) | ((aLEDSequence >> 3) & 1); LedSequence[1] = ((aLEDSequence >> 5) & 2) | ((aLEDSequence >> 2) & 1); LedSequence[2] = ((aLEDSequence >> 4) & 2) | ((aLEDSequence >> 1) & 1); LedSequence[3] = ((aLEDSequence >> 3) & 2) | ((aLEDSequence >> 0) & 1); - g_EmuShared->SetLedSequence(LedSequence); + ipc_send_gui_update(IPC_UPDATE_GUI::XBOX_LED_COLOUR, LedSequenceBlock); } /* SMCDevice */ -SMCDevice::SMCDevice(SCMRevision revision) +SMCDevice::SMCDevice(SCMRevision revision, uint8_t av_pack) { - m_revision = revision; + m_revision = revision; + buffer[SMC_COMMAND_AV_PACK] = av_pack; } void SMCDevice::Init() { m_PICVersionStringIndex = 0; - buffer[SMC_COMMAND_AV_PACK] = AV_PACK_HDTV; // see http://xboxdevwiki.net/PIC#The_AV_Pack buffer[SMC_COMMAND_LED_SEQUENCE] = LED::GREEN; - buffer[SMC_COMMAND_SCRATCH] = 0; // http://xboxdevwiki.net/PIC#Scratch_register_values + buffer[SMC_COMMAND_SCRATCH] = 0; // https://xboxdevwiki.net/PIC#Scratch_register_values } void SMCDevice::Reset() @@ -97,12 +92,12 @@ uint8_t SMCDevice::ReadByte(uint8_t command) { switch (command) { case SMC_COMMAND_VERSION: // 0x01 PIC version string - // See http://xboxdevwiki.net/PIC#PIC_version_string + // See https://xboxdevwiki.net/PIC#PIC_version_string switch (m_revision) { - case SCMRevision::P01: buffer[0] = "P01"[m_PICVersionStringIndex]; break; - case SCMRevision::P2L: buffer[0] = "P05"[m_PICVersionStringIndex]; break; // ?? - case SCMRevision::D01: buffer[0] = "DXB"[m_PICVersionStringIndex]; break; - case SCMRevision::D05: buffer[0] = "D05"[m_PICVersionStringIndex]; break; // ?? + case SCMRevision::P01: buffer[1] = "P01"[m_PICVersionStringIndex]; break; + case SCMRevision::P2L: buffer[1] = "P05"[m_PICVersionStringIndex]; break; // ?? + case SCMRevision::D01: buffer[1] = "DXB"[m_PICVersionStringIndex]; break; + case SCMRevision::D05: buffer[1] = "D05"[m_PICVersionStringIndex]; break; // ?? // default: UNREACHABLE(m_revision); } @@ -125,7 +120,7 @@ uint8_t SMCDevice::ReadByte(uint8_t command) case SMC_COMMAND_CHALLENGE_1E: // random number for boot challenge case SMC_COMMAND_CHALLENGE_1F: // random number for boot challenge if (m_revision == SCMRevision::D01) - // See http://xboxdevwiki.net/PIC#PIC_Challenge_.28regs_0x1C.7E0x21.29 + // See https://xboxdevwiki.net/PIC#PIC_Challenge_.28regs_0x1C.7E0x21.29 return 0; break; @@ -158,7 +153,7 @@ void SMCDevice::WriteByte(uint8_t command, uint8_t value) m_PICVersionStringIndex = 0; return; case SMC_COMMAND_RESET: //0x02 reset and power off control - // See http://xboxdevwiki.net/PIC#Reset_and_Power_Off + // See https://xboxdevwiki.net/PIC#Reset_and_Power_Off switch (value) { case SMC_RESET_ASSERT_RESET: return; // TODO case SMC_RESET_ASSERT_POWERCYCLE: return; // TODO @@ -189,7 +184,7 @@ void SMCDevice::WriteByte(uint8_t command, uint8_t value) //case 0x19: // reset on eject(0 = enable; 1 = disable) //case 0x1A: // interrupt enable(write 0x01 to enable; can't disable once enabled) case SMC_COMMAND_SCRATCH: //0x1B scratch register for the original kernel - // See http://xboxdevwiki.net/PIC#Scratch_register_values + // See https://xboxdevwiki.net/PIC#Scratch_register_values switch (value) { case SMC_SCRATCH_TRAY_EJECT_PENDING: return; // TODO case SMC_SCRATCH_DISPLAY_FATAL_ERROR: diff --git a/src/devices/SMCDevice.h b/src/devices/SMCDevice.h index d896bd3ef..085e504bc 100644 --- a/src/devices/SMCDevice.h +++ b/src/devices/SMCDevice.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->CxbxKrnl->SMCDevice.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -41,8 +32,8 @@ // PIC16LC63A-04/SO // (M) 0123857 // -// Producer : http://www.microchip.com/wwwproducts/en/en010145 -// Datasheet : http://ww1.microchip.com/downloads/en/DeviceDoc/30605D.pdf +// Producer : https://www.microchip.com/wwwproducts/en/en010145 +// Datasheet : https://ww1.microchip.com/downloads/en/DeviceDoc/30605D.pdf // NOTE : Instead of calling this device by it's real name ("PIC16LC63A-04/SO"), // we've decided to call this device "SMC", since we don't implement @@ -51,7 +42,7 @@ // Reading: -// From https://web.archive.org/web/20100617022549/http://www.xbox-linux.org/wiki/PIC : +// From https://web.archive.org/web/20100617022549/https://www.xbox-linux.org/wiki/PIC : // Command Description #define SMC_COMMAND_VERSION 0x01 // PIC version string //0x03 tray state @@ -101,7 +92,7 @@ #define SMC_SCRATCH_DASHBOARD_BOOT 0x08 typedef enum { - // http://xboxdevwiki.net/System_Management_Controller + // https://xboxdevwiki.net/System_Management_Controller P01, P2L, D01, // Seen in a debug kit @@ -111,7 +102,7 @@ typedef enum { class SMCDevice : public SMDevice { public: // constructor - SMCDevice(SCMRevision revision); + SMCDevice(SCMRevision revision, uint8_t av_pack); // SMDevice functions void Init(); diff --git a/src/devices/SMDevice.cpp b/src/devices/SMDevice.cpp index b86a33e8d..178a5052e 100644 --- a/src/devices/SMDevice.cpp +++ b/src/devices/SMDevice.cpp @@ -1,2 +1,29 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #include "SMDevice.h" diff --git a/src/devices/SMDevice.h b/src/devices/SMDevice.h index 70cb77294..3cabd0225 100644 --- a/src/devices/SMDevice.h +++ b/src/devices/SMDevice.h @@ -1,3 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #ifndef _SMDEVICE_H_ #define _SMDEVICE_H_ diff --git a/src/devices/Xbox.cpp b/src/devices/Xbox.cpp index 8f1688def..ae8d275b5 100644 --- a/src/devices/Xbox.cpp +++ b/src/devices/Xbox.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->Xbox.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -33,7 +24,10 @@ // * All rights reserved // * // ****************************************************************** -#include "Xbox.h" // For HardwareModel + +#include "Xbox.h" // For HardwareModel +#include "common\xbe\Xbe.h" // Without this HLEIntercept complains about some undefined xbe variables +#include "core\hle\Intercept.hpp" PCIBus* g_PCIBus; SMBus* g_SMBus; @@ -43,6 +37,7 @@ EEPROMDevice* g_EEPROM; NVNetDevice* g_NVNet; NV2ADevice* g_NV2A; ADM1032Device* g_ADM1032; +USBDevice* g_USB0; MCPXRevision MCPXRevisionFromHardwareModel(HardwareModel hardwareModel) { @@ -56,7 +51,7 @@ MCPXRevision MCPXRevisionFromHardwareModel(HardwareModel hardwareModel) case Revision1_6: return MCPXRevision::MCPX_X3; case DebugKit: - // EmuWarning("Guessing MCPXVersion"); + // EmuLog(LOG_LEVEL::WARNING, "Guessing MCPXVersion"); return MCPXRevision::MCPX_X2; default: // UNREACHABLE(hardwareModel); @@ -75,7 +70,7 @@ SCMRevision SCMRevisionFromHardwareModel(HardwareModel hardwareModel) case Revision1_4: case Revision1_5: case Revision1_6: - // EmuWarning("Guessing SCMRevision"); + // EmuLog(LOG_LEVEL::WARNING, "Guessing SCMRevision"); return SCMRevision::P2L; // Assumption; Our SCM returns PIC version string "P05" case DebugKit: return SCMRevision::D01; // Our SCM returns PIC version string "DXB" @@ -121,12 +116,18 @@ void InitXboxHardware(HardwareModel hardwareModel) g_SMBus = new SMBus(); // Create devices - g_MCPX = new MCPXDevice(mcpx_revision); - g_SMC = new SMCDevice(smc_revision); + g_MCPX = new MCPXDevice(mcpx_revision); + + g_SMC = new SMCDevice(smc_revision, g_bIsChihiro ? 6 : 1); // 6 = AV_PACK_STANDARD, 1 = AV_PACK_HDTV. Chihiro doesn't support HDTV! + // SMC uses different AV_PACK values than the Kernel + // See https://xboxdevwiki.net/PIC#The_AV_Pack g_EEPROM = new EEPROMDevice(); g_NVNet = new NVNetDevice(); g_NV2A = new NV2ADevice(); - g_ADM1032 = new ADM1032Device(); + g_ADM1032 = new ADM1032Device(); + if (bLLE_USB) { + g_USB0 = new USBDevice(); + } // Connect devices to SM bus g_SMBus->ConnectDevice(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, g_SMC); // W 0x20 R 0x21 @@ -154,11 +155,19 @@ void InitXboxHardware(HardwareModel hardwareModel) //g_PCIBus->ConnectDevice(PCI_DEVID(0, PCI_DEVFN(4, 1)), g_MCPX); // MCPX device ID = 0x0808 ? //g_PCIBus->ConnectDevice(PCI_DEVID(0, PCI_DEVFN(5, 0)), g_NVAPU); //g_PCIBus->ConnectDevice(PCI_DEVID(0, PCI_DEVFN(6, 0)), g_AC97); - g_PCIBus->ConnectDevice(PCI_DEVID(1, PCI_DEVFN(0, 0)), g_NV2A); + g_PCIBus->ConnectDevice(PCI_DEVID(1, PCI_DEVFN(0, 0)), g_NV2A); + if (bLLE_USB) { + // ergo720: according to some research done by LukeUsher, only Xbox Alpha Kits have a two HCs configuration. This seems to also be confirmed by the xboxdevwiki, + // which states that it has a xircom PGPCI2(OPTI 82C861) 2 USB port PCI card -> 2 ports, not 4. Finally, I disassembled various xbe's and discovered that the number + // of ports per HC is hardcoded as 4 in the driver instead of being detected at runtime by reading the HcRhDescriptorA register and so a game would have to be + // recompiled to support 2 HCs, which further confirms the point. Because we are not going to emulate an Alpha Kit, we can simply ignore the USB1 device. + + g_PCIBus->ConnectDevice(PCI_DEVID(0, PCI_DEVFN(2, 0)), g_USB0); + } // TODO : Handle other SMBUS Addresses, like PIC_ADDRESS, XCALIBUR_ADDRESS // Resources : http://pablot.com/misc/fancontroller.cpp // https://github.com/JayFoxRox/Chihiro-Launcher/blob/master/hook.h // https://github.com/docbrown/vxb/wiki/Xbox-Hardware-Information - // https://web.archive.org/web/20100617022549/http://www.xbox-linux.org/wiki/PIC + // https://web.archive.org/web/20100617022549/https://www.xbox-linux.org/wiki/PIC } diff --git a/src/devices/Xbox.h b/src/devices/Xbox.h index 634f1ace9..7121fad5c 100644 --- a/src/devices/Xbox.h +++ b/src/devices/Xbox.h @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->Xbox.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -43,6 +34,7 @@ #include "EmuNVNet.h" // For NVNetDevice #include "ADM1032Device.h" // For ADM1032 #include "devices\video\nv2a.h" // For NV2ADevice +#include "Usb\USBDevice.h" // For USBDevice #define SMBUS_ADDRESS_MCPX 0x10 // = Write; Read = 0x11 #define SMBUS_ADDRESS_TV_ENCODER 0x88 // = Write; Read = 0x89 @@ -65,7 +57,7 @@ typedef enum { } HardwareModel; typedef enum { // TODO : Move to it's own file - // http://xboxdevwiki.net/Hardware_Revisions#Video_encoder + // https://xboxdevwiki.net/Hardware_Revisions#Video_encoder Conexant, Focus, XCalibur @@ -78,5 +70,6 @@ extern SMCDevice* g_SMC; extern EEPROMDevice* g_EEPROM; extern NVNetDevice* g_NVNet; extern NV2ADevice* g_NV2A; +extern USBDevice* g_USB0; -extern void InitXboxHardware(HardwareModel hardwareModel); \ No newline at end of file +extern void InitXboxHardware(HardwareModel hardwareModel); diff --git a/src/devices/audio/AC97Device.cpp b/src/devices/audio/AC97Device.cpp new file mode 100644 index 000000000..bfd6d8a8e --- /dev/null +++ b/src/devices/audio/AC97Device.cpp @@ -0,0 +1,68 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include + +#include "AC97Device.h" + +void AC97Device::Init() +{ + PCIBarRegister r; + r.Raw.type = PCI_BAR_TYPE_MEMORY; + r.Memory.address = AC97_BASE >> 4; + RegisterBAR(0, AC97_SIZE, r.value); + + m_DeviceId = 0x01B1; + m_VendorId = PCI_VENDOR_ID_NVIDIA; +} + +void AC97Device::Reset() +{ + +} + +uint32_t AC97Device::IORead(int barIndex, uint32_t addr, unsigned size) +{ + printf("AC97Device: Unimplemented IORead %X\n", addr); + return 0; +} + +void AC97Device::IOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) +{ + printf("AC97Device: Unimplemented IOWrite %X\n", addr); +} + +uint32_t AC97Device::MMIORead(int barIndex, uint32_t addr, unsigned size) +{ + printf("AC97Device: Unimplemented MMIORead %X\n", addr); + return 0; +} + +void AC97Device::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) +{ + printf("AC97Device: Unimplemented MMIOWrite %X\n", addr); +} diff --git a/src/Cxbx/DlgXboxControllerPortMapping.h b/src/devices/audio/AC97Device.h similarity index 58% rename from src/Cxbx/DlgXboxControllerPortMapping.h rename to src/devices/audio/AC97Device.h index de49f216e..db3303663 100644 --- a/src/Cxbx/DlgXboxControllerPortMapping.h +++ b/src/devices/audio/AC97Device.h @@ -1,14 +1,7 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -26,17 +19,30 @@ // * If not, write to the Free Software Foundation, Inc., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * -// * (c) 2002-2003 Aaron Robinson +// * (c) 2018 Luke Usher // * // * All rights reserved // * // ****************************************************************** -#ifndef DLGXBOXCONTROLLERPORTMAPPING_H -#define DLGXBOXCONTROLLERPORTMAPPING_H -#include +#ifndef _AC97_H_ +#define _AC97_H_ -/*! show controller configuration dialog */ -extern VOID ShowXboxControllerPortMappingConfig(HWND hwnd); +#include "../PCIDevice.h" +class AC97Device : public PCIDevice { + public: + using PCIDevice::PCIDevice; + + // PCI Functions + void Init(); + void Reset(); + + uint32_t IORead(int barIndex, uint32_t addr, unsigned size = sizeof(uint8_t)); + void IOWrite(int barIndex, uint32_t addr, uint32_t data, unsigned size = sizeof(uint8_t)); + + uint32_t MMIORead(int barIndex, uint32_t addr, unsigned size); + void MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size); + private: +}; #endif diff --git a/src/devices/audio/APUDevice.cpp b/src/devices/audio/APUDevice.cpp new file mode 100644 index 000000000..4f67a7667 --- /dev/null +++ b/src/devices/audio/APUDevice.cpp @@ -0,0 +1,161 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include + +#include "APUDevice.h" + +extern uint32_t GetAPUTime(); + +// TODO: Everything :P +// TODO: Audio Processing/Thread + +#define APU_VP_BASE 0x20000 +#define APU_VP_SIZE 0x10000 + +#define APU_GP_BASE 0x30000 +#define APU_GP_SIZE 0x10000 + +#define APU_EP_BASE 0x50000 +#define APU_EP_SIZE 0x10000 + +void APUDevice::Init() +{ + PCIBarRegister r; + r.Raw.type = PCI_BAR_TYPE_IO; + r.IO.address = 0xD000 >> 4; + RegisterBAR(0, 256, r.value); + + r.Raw.type = PCI_BAR_TYPE_IO; + r.IO.address = 0xD200 >> 4; + RegisterBAR(0, 128, r.value); + + r.Raw.type = PCI_BAR_TYPE_MEMORY; + r.Memory.address = APU_BASE >> 4; + RegisterBAR(2, APU_SIZE, r.value); + + m_DeviceId = 0x01B0; + m_VendorId = PCI_VENDOR_ID_NVIDIA; +} + +void APUDevice::Reset() +{ + +} + +uint32_t APUDevice::IORead(int barIndex, uint32_t addr, unsigned size) +{ + printf("APUDevice: Unimplemented IORead %X\n", addr); + return 0; +} + +void APUDevice::IOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) +{ + printf("APUDevice: Unimplemented IOWrite %X\n", addr); +} + +uint32_t APUDevice::MMIORead(int barIndex, uint32_t addr, unsigned size) +{ + if (addr >= APU_VP_BASE && addr < APU_VP_BASE + APU_VP_SIZE) { + return VPRead(addr - APU_VP_BASE, size); + } + + if (addr >= APU_GP_BASE && addr < APU_GP_BASE + APU_GP_SIZE) { + return GPRead(addr - APU_GP_BASE, size); + } + + if (addr >= APU_EP_BASE && addr < APU_EP_BASE + APU_EP_SIZE) { + return EPRead(addr - APU_EP_BASE, size); + } + + switch (addr) { + case 0x200C: return GetAPUTime(); + } + + printf("APUDevice: Unimplemented MMIORead %X\n", addr); + return 0; +} + +void APUDevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) +{ + if (addr >= APU_VP_BASE && addr < APU_VP_BASE + APU_VP_SIZE) { + VPWrite(addr - APU_VP_BASE, value, size); + return; + } + + if (addr >= APU_GP_BASE && addr < APU_GP_BASE + APU_GP_SIZE) { + GPWrite(addr - APU_GP_BASE, value, size); + return; + } + + if (addr >= APU_EP_BASE && addr < APU_EP_BASE + APU_EP_SIZE) { + EPWrite(addr - APU_EP_BASE, value, size); + return; + } + + printf("APUDevice: Unimplemented MMIOWrite %X\n", addr); +} + + +uint32_t APUDevice::GPRead(uint32_t addr, unsigned size) +{ + printf("APUDevice: Unimplemented GP MMIORead %X\n", addr); + return 0; +} + +void APUDevice::GPWrite(uint32_t addr, uint32_t value, unsigned size) +{ + printf("APUDevice: Unimplemented GP MMIOWrite %X\n", addr); +} + + +uint32_t APUDevice::VPRead(uint32_t addr, unsigned size) +{ + switch (addr) { + case 0x10: return 0x80; // HACK: Pretend the FIFO is always empty, bypasses hangs when APU isn't fully implemented + } + + printf("APUDevice: Unimplemented VP MMIORead %X\n", addr); + return 0; +} + +void APUDevice::VPWrite(uint32_t addr, uint32_t value, unsigned size) +{ + printf("APUDevice: Unimplemented VP MMIOWrite %X\n", addr); +} + + +uint32_t APUDevice::EPRead(uint32_t addr, unsigned size) +{ + printf("APUDevice: Unimplemented EP MMIORead %X\n", addr); + return 0; +} + +void APUDevice::EPWrite(uint32_t addr, uint32_t value, unsigned size) +{ + printf("APUDevice: Unimplemented EP MMIOWrite %X\n", addr); +} diff --git a/src/devices/audio/APUDevice.h b/src/devices/audio/APUDevice.h new file mode 100644 index 000000000..ae272726b --- /dev/null +++ b/src/devices/audio/APUDevice.h @@ -0,0 +1,54 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef _APU_H_ +#define _APU_H_ + +#include "../PCIDevice.h" +class APUDevice : public PCIDevice { +public: + using PCIDevice::PCIDevice; + + // PCI Functions + void Init(); + void Reset(); + + uint32_t IORead(int barIndex, uint32_t addr, unsigned size = sizeof(uint8_t)); + void IOWrite(int barIndex, uint32_t addr, uint32_t data, unsigned size = sizeof(uint8_t)); + + uint32_t MMIORead(int barIndex, uint32_t addr, unsigned size); + void MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size); +private: + uint32_t GPRead(uint32_t addr, unsigned size); + void GPWrite(uint32_t addr, uint32_t value, unsigned size); + uint32_t EPRead(uint32_t addr, unsigned size); + void EPWrite(uint32_t addr, uint32_t value, unsigned size); + uint32_t VPRead(uint32_t addr, unsigned size); + void VPWrite(uint32_t addr, uint32_t value, unsigned size); +}; + +#endif diff --git a/src/devices/usb/Hub.cpp b/src/devices/usb/Hub.cpp new file mode 100644 index 000000000..97f0865ed --- /dev/null +++ b/src/devices/usb/Hub.cpp @@ -0,0 +1,728 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: QEMU hub device emulation as used in XQEMU (GPLv2) +// https://xqemu.com/ + +/* +* QEMU USB HUB emulation +* +* Copyright (c) 2005 Fabrice Bellard +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + + +#define LOG_PREFIX CXBXR_MODULE::HUB + +// prevent name collisions +namespace xboxkrnl +{ + #include // For PKINTERRUPT, etc. +}; + +#include // For memcpy +#include "OHCI.h" +#include "Hub.h" +#include "core\kernel\exports\EmuKrnl.h" // For EmuLog +#include "Logging.h" + +#define NUM_PORTS 8 + +#define PORT_STAT_CONNECTION 0x0001 +#define PORT_STAT_ENABLE 0x0002 +#define PORT_STAT_SUSPEND 0x0004 +#define PORT_STAT_OVERCURRENT 0x0008 +#define PORT_STAT_RESET 0x0010 +#define PORT_STAT_POWER 0x0100 +#define PORT_STAT_LOW_SPEED 0x0200 + +#define PORT_STAT_C_CONNECTION 0x0001 +#define PORT_STAT_C_ENABLE 0x0002 +#define PORT_STAT_C_SUSPEND 0x0004 +#define PORT_STAT_C_OVERCURRENT 0x0008 +#define PORT_STAT_C_RESET 0x0010 + +#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) +#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE) +#define GetHubDescriptor (0xA000 | USB_REQ_GET_DESCRIPTOR) +#define GetHubStatus (0xA000 | USB_REQ_GET_STATUS) +#define GetPortStatus (0xA300 | USB_REQ_GET_STATUS) +#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE) +#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE) + +#define PORT_CONNECTION 0 +#define PORT_ENABLE 1 +#define PORT_SUSPEND 2 +#define PORT_OVERCURRENT 3 +#define PORT_RESET 4 +#define PORT_POWER 8 +#define PORT_LOWSPEED 9 +#define PORT_C_CONNECTION 16 +#define PORT_C_ENABLE 17 +#define PORT_C_SUSPEND 18 +#define PORT_C_OVERCURRENT 19 +#define PORT_C_RESET 20 + + +// To avoid including Xbox.h +extern USBDevice* g_USB0; + +Hub* g_HubObjArray[4] = { nullptr }; + + +struct USBHubPort { + USBPort port; // downstream port status + uint16_t wPortStatus; // Port Status Field, in accordance with the standard + uint16_t wPortChange; // Port Change Field, in accordance with the standard +}; + +struct USBHubState { + XboxDeviceState dev; // hub device status + USBEndpoint* intr; // interrupt endpoint of the hub + USBHubPort ports[NUM_PORTS]; // downstream ports of the hub +}; + +static const USBDescEndpoint desc_endp_hub = { + USB_DIR_IN | 0x01, // bEndpointAddress; + USB_ENDPOINT_XFER_INT, // bmAttributes; + 1 + (NUM_PORTS + 7) / 8, // wMaxPacketSize; + 0xFF, // bInterval; + 0, // bRefresh; + 0, // bSynchAddress + 0, // is_audio + nullptr // extra +}; + +static const USBDescIface desc_iface_hub = { + 0, // bInterfaceNumber; + 0, // bAlternateSetting; + 1, // bNumEndpoints; + USB_CLASS_HUB, // bInterfaceClass; + 0, // bInterfaceSubClass + 0, // bInterfaceProtocol + 0, // iInterface + 0, // ndesc + nullptr, // descs + &desc_endp_hub +}; + +static const USBDescConfig desc_config_hub = { + 1, // bNumInterfaces + 1, // bConfigurationValue + 0, // iConfiguration + 0xE0, // bmAttributes + 0, // bMaxPower + 1, // nif + &desc_iface_hub +}; + +static const USBDescDevice desc_device_hub = { + 0x0110, // bcdUSB + USB_CLASS_HUB, // bDeviceClass + 0, // bDeviceSubClass + 0, // bDeviceProtocol + 8, // bMaxPacketSize0 + 1, // bNumConfigurations + &desc_config_hub +}; + +static const USBDesc desc_hub = { + { + 0x0409, // idVendor + 0x55AA, // idProduct + 0x0101, // bcdDevice + STR_MANUFACTURER, // iManufacturer + STR_PRODUCT, // iProduct + STR_SERIALNUMBER // iSerialNumber + }, + &desc_device_hub +}; + +// Class-specific hub descriptor. Remember to update DeviceRemovable and PortPwrCtrlMask if you change NUM_PORTS since their values depend on +// the number of downstream ports available on the hub! Also note that this descriptor cannot be put in the descs member of the interface descriptor +// because then this descriptor will be retrieved during a standard GetDescriptor request instead of the hub-specific GetHubDescriptor request +static const uint8_t HubDescriptor[] = +{ + 0x0A, // u8 bDescLength; 10 bytes + 0x29, // u8 bDescriptorType; Hub-descriptor + NUM_PORTS, // u8 bNbrPorts; 0x08 + 0x0A, // u16 wHubCharacteristics; (individual port over-current protection, no power switching) + 0x00, + 0x01, // u8 bPwrOn2pwrGood; 2 ms + 0x00, // u8 bHubContrCurrent; 0 mA + 0x00, // u16 DeviceRemovable; all devices are removable + 0x00, + 0xFF, // u8 PortPwrCtrlMask; all 1's for compatibility reasons +}; + +int Hub::Init(int port) +{ + if (port > 4 || port < 1) { return -1; }; + + XboxDeviceState* dev = ClassInitFn(); + int rc = UsbHubClaimPort(dev, port); + if (rc != 0) { + m_UsbDev->m_HostController->m_FrameTimeMutex.unlock(); + return rc; + } + m_UsbDev->USB_EpInit(dev); + m_UsbDev->USB_DeviceInit(dev); + m_UsbDev->USB_DeviceAttach(dev); + + m_UsbDev->m_HostController->m_FrameTimeMutex.unlock(); + + return 0; +} + +XboxDeviceState* Hub::ClassInitFn() +{ + m_pPeripheralFuncStruct = new USBDeviceClass(); + m_HubState = new USBHubState(); + XboxDeviceState* dev = &m_HubState->dev; + + dev->ProductDesc = "Cxbx-Reloaded USB Hub"; + QLIST_INIT(&dev->Strings); + dev->klass = m_pPeripheralFuncStruct; + + { + using namespace std::placeholders; + + m_pPeripheralFuncStruct->init = std::bind(&Hub::UsbHub_Initfn, this, _1); + m_pPeripheralFuncStruct->find_device = std::bind(&Hub::UsbHub_FindDevice, this, _1, _2); + m_pPeripheralFuncStruct->handle_reset = std::bind(&Hub::UsbHub_HandleReset, this); + m_pPeripheralFuncStruct->handle_control = std::bind(&Hub::UsbHub_HandleControl, this, _1, _2, _3, _4, _5, _6, _7); + m_pPeripheralFuncStruct->handle_data = std::bind(&Hub::UsbHub_HandleData, this, _1, _2); + m_pPeripheralFuncStruct->handle_destroy = std::bind(&Hub::UsbHub_HandleDestroy, this); + m_pPeripheralFuncStruct->product_desc = dev->ProductDesc.c_str(); + m_pPeripheralFuncStruct->usb_desc = &desc_hub; + } + + return dev; +} + +int Hub::UsbHubClaimPort(XboxDeviceState* dev, int port) +{ + int i; + std::vector::iterator it; + + assert(dev->Port == nullptr); + + m_UsbDev = g_USB0; + it = m_UsbDev->m_FreePorts.end(); + i = 0; + + m_UsbDev->m_HostController->m_FrameTimeMutex.lock(); + + for (auto usb_port : m_UsbDev->m_FreePorts) { + if (usb_port->Path == std::to_string(port)) { + it = m_UsbDev->m_FreePorts.begin() + i; + break; + } + i++; + } + if (it == m_UsbDev->m_FreePorts.end()) { + EmuLog(LOG_LEVEL::WARNING, "Port requested %d not found (in use?)", port); + return -1; + } + dev->Port = *it; + (*it)->Dev = dev; + m_UsbDev->m_FreePorts.erase(it); + + return 0; +} + +void Hub::UsbHubReleasePort(XboxDeviceState* dev) +{ + USBPort* port = dev->Port; + + assert(port != nullptr); + + port->Dev = nullptr; + dev->Port = nullptr; +} + +int Hub::UsbHub_Initfn(XboxDeviceState* dev) +{ + USBHubPort* port; + USBPortOps* ops; + int i; + + m_UsbDev->USB_CreateSerial(dev, std::string("314159")); + m_UsbDev->USBDesc_SetString(dev, STR_MANUFACTURER, std::string("Cxbx-Reloaded")); + m_UsbDev->USBDesc_SetString(dev, STR_PRODUCT, std::string("Cxbx-Reloaded USB Hub")); + m_UsbDev->USBDesc_Init(dev); + m_HubState->intr = m_UsbDev->USB_GetEP(dev, USB_TOKEN_IN, 1); + + ops = new USBPortOps(); + { + using namespace std::placeholders; + + ops->attach = std::bind(&Hub::UsbHub_Attach, this, _1); + ops->detach = std::bind(&Hub::UsbHub_Detach, this, _1); + ops->child_detach = std::bind(&Hub::UsbHub_ChildDetach, this, _1); + ops->wakeup = std::bind(&Hub::UsbHub_Wakeup, this, _1); + ops->complete = std::bind(&Hub::UsbHub_Complete, this, _1, _2); + } + + for (i = 0; i < NUM_PORTS; i++) { + port = &m_HubState->ports[i]; + m_UsbDev->USB_RegisterPort(&port->port, i, USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL, ops); + m_UsbDev->USB_PortLocation(&port->port, dev->Port, i + 1); + } + UsbHub_HandleReset(); + return 0; +} + +XboxDeviceState* Hub::UsbHub_FindDevice(XboxDeviceState* dev, uint8_t addr) +{ + USBHubPort* port; + XboxDeviceState* downstream; + + for (int i = 0; i < NUM_PORTS; i++) { + port = &m_HubState->ports[i]; + if (!(port->wPortStatus & PORT_STAT_ENABLE)) { + continue; + } + downstream = m_UsbDev->USB_FindDevice(&port->port, addr); + if (downstream != nullptr) { + return downstream; + } + } + return nullptr; +} + +void Hub::UsbHub_HandleReset() +{ + USBHubPort* port; + + for (int i = 0; i < NUM_PORTS; i++) { + port = m_HubState->ports + i; + port->wPortStatus = PORT_STAT_POWER; + port->wPortChange = 0; + if (port->port.Dev && port->port.Dev->Attached) { + port->wPortStatus |= PORT_STAT_CONNECTION; + port->wPortChange |= PORT_STAT_C_CONNECTION; + if (port->port.Dev->Speed == USB_SPEED_LOW) { + port->wPortStatus |= PORT_STAT_LOW_SPEED; + } + } + } +} + +void Hub::UsbHub_HandleControl(XboxDeviceState* dev, USBPacket* p, + int request, int value, int index, int length, uint8_t* data) +{ + int ret; + + ret = m_UsbDev->USBDesc_HandleControl(dev, p, request, value, index, length, data); + if (ret >= 0) { + return; + } + + switch (request) { + case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: { + // clear ep halt and bEndpointAddress of hub is 0x81 + if (value == 0 && index != 0x81) { + goto fail; + } + break; + } + + case GetHubStatus: { + // From the USB 1.1 standard: "This request returns the current hub status and the states that have changed since the + // previous acknowledgment. The first word of data contains wHubStatus. The second word of data contains wHubChange" + // We always report that the local power supply is good and that currently there is no over-power condition + data[0] = 0; + data[1] = 0; + data[2] = 0; + data[3] = 0; + p->ActualLength = 4; + break; + } + + case GetPortStatus: { + // From the USB 1.1 standard: "This request returns the current port status and the current value of the port status change bits. + // The first word of data contains wPortStatus. The second word of data contains wPortChange" + unsigned int n = index - 1; + USBHubPort* port; + if (n >= NUM_PORTS) { + goto fail; + } + port = &m_HubState->ports[n]; + EmuLog(LOG_LEVEL::DEBUG, "GetPortStatus -> Address 0x%X, wIndex %d, wPortStatus %d, wPortChange %d", + m_HubState->dev.Addr, index, port->wPortStatus, port->wPortChange); + data[0] = port->wPortStatus & 0xFF; + data[1] = port->wPortStatus >> 8; + data[2] = port->wPortChange & 0xFF; + data[3] = port->wPortChange >> 8; + p->ActualLength = 4; + break; + } + + case SetHubFeature: + case ClearHubFeature: { + if (value != 0 && value != 1) { + goto fail; + } + break; + } + + case SetPortFeature: { + // From the USB 1.1 standard: "This request sets a value reported in the port status. Features that can be set with this request are + // PORT_RESET, PORT_SUSPEND and PORT_POWER; others features are not required to be set by this request" + unsigned int n = index - 1; + USBHubPort* port; + XboxDeviceState* dev; + + EmuLog(LOG_LEVEL::DEBUG, "SetPortFeature -> Address 0x%X, wIndex %d, Feature %s", + m_HubState->dev.Addr, index, GetFeatureName(value).c_str()); + + if (n >= NUM_PORTS) { + goto fail; + } + port = &m_HubState->ports[n]; + dev = port->port.Dev; + switch (value) { + case PORT_SUSPEND: { + port->wPortStatus |= PORT_STAT_SUSPEND; + break; + } + + case PORT_RESET: { + if (dev && dev->Attached) { + m_UsbDev->USB_DeviceReset(dev); + port->wPortChange |= PORT_STAT_C_RESET; + port->wPortStatus |= PORT_STAT_ENABLE; + m_UsbDev->USB_Wakeup(m_HubState->intr); + } + break; + } + + case PORT_POWER: + break; + + default: + goto fail; + } + break; + } + + case ClearPortFeature: { + // From USB 1.1 the standard: "This request resets a value reported in the port status" + unsigned int n = index - 1; + USBHubPort *port; + + EmuLog(LOG_LEVEL::DEBUG, "ClearPortFeature -> Address 0x%X, wIndex %d, Feature %s", + m_HubState->dev.Addr, index, GetFeatureName(value).c_str()); + + if (n >= NUM_PORTS) { + goto fail; + } + port = &m_HubState->ports[n]; + switch (value) { + case PORT_ENABLE: { + port->wPortStatus &= ~PORT_STAT_ENABLE; + break; + } + + case PORT_C_ENABLE: { + port->wPortChange &= ~PORT_STAT_C_ENABLE; + break; + } + + case PORT_SUSPEND: { + port->wPortStatus &= ~PORT_STAT_SUSPEND; + break; + } + + case PORT_C_SUSPEND: { + port->wPortChange &= ~PORT_STAT_C_SUSPEND; + break; + } + + case PORT_C_CONNECTION: { + port->wPortChange &= ~PORT_STAT_C_CONNECTION; + break; + } + + case PORT_C_OVERCURRENT: { + port->wPortChange &= ~PORT_STAT_C_OVERCURRENT; + break; + } + + case PORT_C_RESET: { + port->wPortChange &= ~PORT_STAT_C_RESET; + break; + } + + default: + goto fail; + } + break; + } + + case GetHubDescriptor: { + std::memcpy(data, HubDescriptor, sizeof(HubDescriptor)); + p->ActualLength = sizeof(HubDescriptor); + break; + } + + default: + fail: + p->Status = USB_RET_STALL; + break; + } +} + +void Hub::UsbHub_HandleData(XboxDeviceState* dev, USBPacket* p) +{ + switch (p->Pid) { + case USB_TOKEN_IN: { + if (p->Endpoint->Num == 1) { + USBHubPort* port; + unsigned int status; + uint8_t buf[4]; + size_t i, n; + status = 0; + for (i = 0; i < NUM_PORTS; i++) { + port = &m_HubState->ports[i]; + if (port->wPortChange) { + status |= (1 << (i + 1)); + } + } + if (status != 0) { + n = (NUM_PORTS + 1 + 7) / 8; + if (p->IoVec.Size == 1) { // FreeBSD workaround + n = 1; + } + else if (n > p->IoVec.Size) { + p->Status = USB_RET_BABBLE; + return; + } + EmuLog(LOG_LEVEL::DEBUG, "Address 0x%X, Status %d", m_HubState->dev.Addr, status); + for (i = 0; i < n; i++) { + buf[i] = status >> (8 * i); + } + m_UsbDev->USB_PacketCopy(p, buf, n); + } + else { + p->Status = USB_RET_NAK; // usb11 11.13.1 + } + } + else { + goto fail; + } + break; + } + + case USB_TOKEN_OUT: + default: + fail: + p->Status = USB_RET_STALL; + break; + } +} + +void Hub::UsbHub_HandleDestroy() +{ + // Inform upstream that the hub is detached and gone + m_UsbDev->USB_DeviceDetach(&m_HubState->dev); + m_UsbDev->m_FreePorts.push_back(m_HubState->dev.Port); + + for (int i = 0; i < NUM_PORTS; i++) { + if (m_HubState->ports[i].port.Dev) { + // Also destroy attached downstream device + m_HubState->ports[i].port.Dev->klass->handle_destroy(); + } + else { + m_UsbDev->USB_UnregisterPort(&m_HubState->ports[i].port); + } + } + UsbHubReleasePort(&m_HubState->dev); + HubCleanUp(); +} + +void Hub::UsbHub_Attach(USBPort* port1) +{ + USBHubPort* port = &m_HubState->ports[port1->PortIndex]; + + port->wPortStatus |= PORT_STAT_CONNECTION; + port->wPortChange |= PORT_STAT_C_CONNECTION; + if (port->port.Dev->Speed == USB_SPEED_LOW) { + port->wPortStatus |= PORT_STAT_LOW_SPEED; + } + else { + port->wPortStatus &= ~PORT_STAT_LOW_SPEED; + } + m_UsbDev->USB_Wakeup(m_HubState->intr); +} + +void Hub::UsbHub_Detach(USBPort* port1) +{ + USBHubPort* port = &m_HubState->ports[port1->PortIndex]; + + m_UsbDev->USB_Wakeup(m_HubState->intr); + + // Let upstream know the device on this port is gone + m_HubState->dev.Port->Operations->child_detach(port1->Dev); + + port->wPortStatus &= ~PORT_STAT_CONNECTION; + port->wPortChange |= PORT_STAT_C_CONNECTION; + if (port->wPortStatus & PORT_STAT_ENABLE) { + port->wPortStatus &= ~PORT_STAT_ENABLE; + port->wPortChange |= PORT_STAT_C_ENABLE; + } + m_UsbDev->USB_Wakeup(m_HubState->intr); +} + +void Hub::UsbHub_ChildDetach(XboxDeviceState* child) +{ + // Pass along to upstream + m_HubState->dev.Port->Operations->child_detach(child); +} + +void Hub::UsbHub_Wakeup(USBPort* port1) +{ + USBHubPort* port = &m_HubState->ports[port1->PortIndex]; + + if (port->wPortStatus & PORT_STAT_SUSPEND) { + port->wPortChange |= PORT_STAT_C_SUSPEND; + m_UsbDev->USB_Wakeup(m_HubState->intr); + } +} + +void Hub::UsbHub_Complete(USBPort* port, USBPacket* packet) +{ + // Just pass it along to upstream + m_HubState->dev.Port->Operations->complete(m_HubState->dev.Port, packet); +} + +std::string Hub::GetFeatureName(int feature) +{ + std::string str; + + switch (feature) { + case PORT_CONNECTION: { + str = "connection"; + break; + } + + case PORT_ENABLE: { + str = "enable"; + break; + } + + case PORT_SUSPEND: { + str = "suspend"; + break; + } + + case PORT_OVERCURRENT: { + str = "overcurrent"; + break; + } + + case PORT_RESET: { + str = "reset"; + break; + } + + case PORT_POWER: { + str = "power"; + break; + } + + case PORT_LOWSPEED: { + str = "lowspeed"; + break; + } + + case PORT_C_CONNECTION: { + str = "change_connection"; + break; + } + + case PORT_C_ENABLE: { + str = "change_enable"; + break; + } + + case PORT_C_SUSPEND: { + str = "change_suspend"; + break; + } + + case PORT_C_OVERCURRENT: { + str = "change_overcurrent"; + break; + } + + case PORT_C_RESET: { + str = "change_reset"; + break; + } + + default: + str = "?"; + break; + } + + return str; +} + +void Hub::HubCleanUp() +{ + delete m_pPeripheralFuncStruct; + delete m_HubState->ports[0].port.Operations; + delete m_HubState; + m_pPeripheralFuncStruct = nullptr; + m_HubState = nullptr; +} + +void Hub::HubDestroy() +{ + m_UsbDev->m_HostController->m_FrameTimeMutex.lock(); + m_pPeripheralFuncStruct->handle_destroy(); + m_UsbDev->m_HostController->m_FrameTimeMutex.unlock(); +} diff --git a/src/devices/usb/Hub.h b/src/devices/usb/Hub.h new file mode 100644 index 000000000..c3f6bc69b --- /dev/null +++ b/src/devices/usb/Hub.h @@ -0,0 +1,84 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef HUB_H_ +#define HUB_H_ + +#include "UsbDevice.h" + + +struct USBHubState; // forward declare + + +/* Class which implements a usb hub */ +class Hub +{ + public: + // usb device this hub is attached to + USBDevice* m_UsbDev = nullptr; + + // initialize this hub + int Init(int port); + // start hub destruction + void HubDestroy(); + + + private: + // hub state + USBHubState* m_HubState = nullptr; + // hub class functions + USBDeviceClass* m_pPeripheralFuncStruct = nullptr; + + // initialize various member variables/functions + XboxDeviceState* ClassInitFn(); + // see USBDeviceClass for comments about these functions + int UsbHub_Initfn(XboxDeviceState* dev); + XboxDeviceState* UsbHub_FindDevice(XboxDeviceState* dev, uint8_t addr); + void UsbHub_HandleReset(); + void UsbHub_HandleControl(XboxDeviceState* dev, USBPacket* p, + int request, int value, int index, int length, uint8_t* data); + void UsbHub_HandleData(XboxDeviceState* dev, USBPacket* p); + void UsbHub_HandleDestroy(); + // see USBPortOps struct for info + void UsbHub_Attach(USBPort* port1); + void UsbHub_Detach(USBPort* port1); + void UsbHub_ChildDetach(XboxDeviceState* child); + void UsbHub_Wakeup(USBPort* port1); + void UsbHub_Complete(USBPort* port, USBPacket* packet); + // reserve a usb port for this hub + int UsbHubClaimPort(XboxDeviceState* dev, int port); + // free the usb port used by this hub + void UsbHubReleasePort(XboxDeviceState* dev); + // retieve the name of the feature of the usb request + std::string GetFeatureName(int feature); + // destroy hub resources + void HubCleanUp(); +}; + +extern Hub* g_HubObjArray[4]; + +#endif diff --git a/src/devices/usb/OHCI.cpp b/src/devices/usb/OHCI.cpp new file mode 100644 index 000000000..4b8a40526 --- /dev/null +++ b/src/devices/usb/OHCI.cpp @@ -0,0 +1,1838 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: QEMU ohci subsystem as used in XQEMU (GPLv2) +// https://xqemu.com/ + +/* +* QEMU USB OHCI Emulation +* Copyright (c) 2004 Gianni Tedesco +* Copyright (c) 2006 CodeSourcery +* Copyright (c) 2006 Openedhand Ltd. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see . +*/ + + +#define LOG_PREFIX CXBXR_MODULE::OHCI + +/* prevent name collisions */ +namespace xboxkrnl +{ + #include +}; + +#include "OHCI.h" +#include "core\kernel\exports\EmuKrnl.h" // For HalSystemInterrupt +#include "common\util\CxbxUtil.h" +#include "Logging.h" + +static const char* OHCI_RegNames[] = { + "HcRevision", + "HcControl", + "HcCommandStatus", + "HcInterruptStatus", + "HcInterruptEnable", + "HcInterruptDisable", + "HcHCCA", + "HcPeriodCurrentED", + "HcControlHeadED", + "HcControlCurrentED", + "HcBulkHeadED", + "HcBulkCurrentED", + "HcDoneHead", + "HcFmInterval", + "HcFmRemaining", + "HcFmNumber", + "HcPeriodicStart", + "HcLSThreshold", + "HcRhDescriptorA", + "HcRhDescriptorB", + "HcRhStatus", + "HcRhPortStatus[0]", + "HcRhPortStatus[1]", + "HcRhPortStatus[2]", + "HcRhPortStatus[3]" +}; + +/* Define these two if you want to dump usb packets and OHCI registers */ +//#define DEBUG_ISOCH +//#define DEBUG_PACKET +//#define DEBUG_OHCI_REG + +#ifdef DEBUG_OHCI_REG +#define DUMP_REG_R(reg_val) EmuLog(LOG_LEVEL::DEBUG, "%s, R, reg_val: 0x%X", OHCI_RegNames[Addr >> 2], reg_val) +#define DUMP_REG_W(reg_val, val) EmuLog(LOG_LEVEL::DEBUG, "%s, W, reg_val: 0x%X, val: 0x%X", OHCI_RegNames[Addr >> 2], reg_val, val) +#define DUMP_REG_RO(reg_val, val) EmuLog(LOG_LEVEL::DEBUG, "%s, RO, reg_val: 0x%X, val: 0x%X", OHCI_RegNames[Addr >> 2], reg_val, val) +#else +#define DUMP_REG_R(reg_val) +#define DUMP_REG_W(reg_val, val) +#define DUMP_REG_RO(reg_val, val) +#endif + +/* These macros are used to access the bits of the various registers */ +// HcControl +#define OHCI_CTL_CBSR ((1<<0)|(1<<1)) // ControlBulkServiceRatio +#define OHCI_CTL_PLE (1<<2) // PeriodicListEnable +#define OHCI_CTL_IE (1<<3) // IsochronousEnable +#define OHCI_CTL_CLE (1<<4) // ControlListEnable +#define OHCI_CTL_BLE (1<<5) // BulkListEnable +#define OHCI_CTL_HCFS ((1<<6)|(1<<7)) // HostControllerFunctionalState +#define OHCI_CTL_IR (1<<8) // InterruptRouting +#define OHCI_CTL_RWC (1<<9) // RemoteWakeupConnected +#define OHCI_CTL_RWE (1<<10) // RemoteWakeupEnable +// HcCommandStatus +#define OHCI_STATUS_HCR (1<<0) // HostControllerReset +#define OHCI_STATUS_CLF (1<<1) // ControlListFilled +#define OHCI_STATUS_BLF (1<<2) // BulkListFilled +#define OHCI_STATUS_OCR (1<<3) // OwnershipChangeRequest +#define OHCI_STATUS_SOC ((1<<6)|(1<<7)) // SchedulingOverrunCount +// HcInterruptStatus +#define OHCI_INTR_SO (1<<0) // SchedulingOverrun +#define OHCI_INTR_WD (1<<1) // WritebackDoneHead +#define OHCI_INTR_SF (1<<2) // StartofFrame +#define OHCI_INTR_RD (1<<3) // ResumeDetected +#define OHCI_INTR_UE (1<<4) // UnrecoverableError +#define OHCI_INTR_FNO (1<<5) // FrameNumberOverflow +#define OHCI_INTR_RHSC (1<<6) // RootHubStatusChange +#define OHCI_INTR_OC (1<<30) // OwnershipChange +// HcInterruptEnable, HcInterruptDisable +#define OHCI_INTR_MIE (1<<31) // MasterInterruptEnable +// HcHCCA +#define OHCI_HCCA_MASK 0xFFFFFF00 // HCCA mask +// HcFmInterval +#define OHCI_FMI_FI 0x00003FFF // FrameInterval +#define OHCI_FMI_FIT 0x80000000 // FrameIntervalToggle +// HcFmRemaining +#define OHCI_FMR_FR 0x00003FFF // FrameRemaining +#define OHCI_FMR_FRT 0x80000000 // FrameRemainingToggle +// LSThreshold +#define OHCI_LS_THRESH 0x628 // LSThreshold +// HcRhDescriptorA +#define OHCI_RHA_RW_MASK 0x00000000 // Mask of supported features +#define OHCI_RHA_PSM (1<<8) // PowerSwitchingMode +#define OHCI_RHA_NPS (1<<9) // NoPowerSwitching +#define OHCI_RHA_DT (1<<10) // DeviceType +#define OHCI_RHA_OCPM (1<<11) // OverCurrentProtectionMode +#define OHCI_RHA_NOCP (1<<12) // NoOverCurrentProtection +// HcRhStatus +#define OHCI_RHS_LPS (1<<0) // LocalPowerStatus +#define OHCI_RHS_OCI (1<<1) // OverCurrentIndicator +#define OHCI_RHS_DRWE (1<<15) // DeviceRemoteWakeupEnable +#define OHCI_RHS_LPSC (1<<16) // LocalPowerStatusChange +#define OHCI_RHS_OCIC (1<<17) // OverCurrentIndicatorChange +#define OHCI_RHS_CRWE (1<<31) // ClearRemoteWakeupEnable +// HcRhPortStatus +#define OHCI_PORT_CCS (1<<0) // CurrentConnectStatus +#define OHCI_PORT_PES (1<<1) // PortEnableStatus +#define OHCI_PORT_PSS (1<<2) // PortSuspendStatus +#define OHCI_PORT_POCI (1<<3) // PortOverCurrentIndicator +#define OHCI_PORT_PRS (1<<4) // PortResetStatus +#define OHCI_PORT_PPS (1<<8) // PortPowerStatus +#define OHCI_PORT_LSDA (1<<9) // LowSpeedDeviceAttached +#define OHCI_PORT_CSC (1<<16) // ConnectStatusChange +#define OHCI_PORT_PESC (1<<17) // PortEnableStatusChange +#define OHCI_PORT_PSSC (1<<18) // PortSuspendStatusChange +#define OHCI_PORT_OCIC (1<<19) // PortOverCurrentIndicatorChange +#define OHCI_PORT_PRSC (1<<20) // PortResetStatusChange +#define OHCI_PORT_WTC (OHCI_PORT_CSC|OHCI_PORT_PESC|OHCI_PORT_PSSC \ + |OHCI_PORT_OCIC|OHCI_PORT_PRSC) + +/* Bitfields for the first word of an ED */ +#define OHCI_ED_FA_SHIFT 0 +#define OHCI_ED_FA_MASK (0x7F<> OHCI_##field##_SHIFT) + +#define OHCI_SET_BM(val, field, newval) do { \ + val &= ~OHCI_##field##_MASK; \ + val |= ((newval) << OHCI_##field##_SHIFT) & OHCI_##field##_MASK; \ + } while(0) + +/* Indicates the direction of data flow as specified by the TD */ +#define OHCI_TD_DIR_SETUP 0x0 // to endpoint +#define OHCI_TD_DIR_OUT 0x1 // to endpoint +#define OHCI_TD_DIR_IN 0x2 // from endpoint +#define OHCI_TD_DIR_RESERVED 0x3 + +#define OHCI_CC_NOERROR 0x0 +#define OHCI_CC_CRC 0x1 +#define OHCI_CC_BITSTUFFING 0x2 +#define OHCI_CC_DATATOGGLEMISMATCH 0x3 +#define OHCI_CC_STALL 0x4 +#define OHCI_CC_DEVICENOTRESPONDING 0x5 +#define OHCI_CC_PIDCHECKFAILURE 0x6 +#define OHCI_CC_UNDEXPETEDPID 0x7 +#define OHCI_CC_DATAOVERRUN 0x8 +#define OHCI_CC_DATAUNDERRUN 0x9 +#define OHCI_CC_BUFFEROVERRUN 0xC +#define OHCI_CC_BUFFERUNDERRUN 0xD + +#define USB_HZ 12000000 + +#define USUB(a, b) ((int16_t)((uint16_t)(a) - (uint16_t)(b))) + +#define OHCI_PAGE_MASK 0xFFFFF000 +#define OHCI_OFFSET_MASK 0xFFF + + +OHCI::OHCI(USBDevice* UsbObj) +{ + int offset = 0; + USBPortOps* ops; + + m_UsbDevice = UsbObj; + ops = new USBPortOps(); + { + using namespace std::placeholders; + + ops->attach = std::bind(&OHCI::OHCI_Attach, this, _1); + ops->detach = std::bind(&OHCI::OHCI_Detach, this, _1); + ops->child_detach = std::bind(&OHCI::OHCI_ChildDetach, this, _1); + ops->wakeup = std::bind(&OHCI::OHCI_Wakeup, this, _1); + ops->complete = std::bind(&OHCI::OHCI_AsyncCompletePacket, this, _1, _2); + } + + for (int i = 0; i < 4; i++) { + m_UsbDevice->USB_RegisterPort(&m_Registers.RhPort[i].UsbPort, i, USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL, ops); + } + OHCI_PacketInit(&m_UsbPacket); + + m_UsbFrameTime = 1000000ULL; // 1 ms expressed in ns + m_TicksPerUsbTick = 1000000000ULL / USB_HZ; // 83 + + // Do a hardware reset + OHCI_StateReset(); +} + +void OHCI::OHCI_FrameBoundaryWrapper(void* pVoid) +{ + static_cast(pVoid)->OHCI_FrameBoundaryWorker(); +} + +void OHCI::OHCI_FrameBoundaryWorker() +{ + OHCI_HCCA hcca; + + m_FrameTimeMutex.lock(); + + if (OHCI_ReadHCCA(m_Registers.HcHCCA, &hcca)) { + EmuLog(LOG_LEVEL::WARNING, "HCCA read error at physical address 0x%X", m_Registers.HcHCCA); + OHCI_FatalError(); + m_FrameTimeMutex.unlock(); + return; + } + + // Process all the lists at the end of the frame + if (m_Registers.HcControl & OHCI_CTL_PLE) { + // From the OHCI standard: "The head pointer used for a particular frame is determined by using the last 5 bits of the + // Frame Counter as an offset into the interrupt array within the HCCA." + int n = m_Registers.HcFmNumber & 0x1F; + OHCI_ServiceEDlist(hcca.HccaInterrruptTable[n], 0); // dropped little -> big endian conversion from QEMU + } + + // Cancel all pending packets if either of the lists has been disabled + if (m_OldHcControl & (~m_Registers.HcControl) & (OHCI_CTL_BLE | OHCI_CTL_CLE)) { + if (m_AsyncTD) { + m_UsbDevice->USB_CancelPacket(&m_UsbPacket); + m_AsyncTD = xbnull; + } + OHCI_StopEndpoints(); + } + m_OldHcControl = m_Registers.HcControl; + OHCI_ProcessLists(0); + + // Stop if UnrecoverableError happened or OHCI_SOF will crash + if (m_Registers.HcInterruptStatus & OHCI_INTR_UE) { + m_FrameTimeMutex.unlock(); + return; + } + + // From the OHCI standard: "This bit is loaded from the FrameIntervalToggle field of + // HcFmInterval whenever FrameRemaining reaches 0." + m_Registers.HcFmRemaining = (m_Registers.HcFmInterval & OHCI_FMI_FIT) == 0 ? + m_Registers.HcFmRemaining & ~OHCI_FMR_FRT : m_Registers.HcFmRemaining | OHCI_FMR_FRT; + + // Increment frame number + m_Registers.HcFmNumber = (m_Registers.HcFmNumber + 1) & 0xFFFF; // prevent overflow + hcca.HccaFrameNumber = m_Registers.HcFmNumber; // dropped big -> little endian conversion from QEMU + + if (m_DoneCount == 0 && !(m_Registers.HcInterruptStatus & OHCI_INTR_WD)) { + if (!m_Registers.HcDoneHead) { + // From the OHCI standard: "This is set to zero whenever HC writes the content of this + // register to HCCA. It also sets the WritebackDoneHead of HcInterruptStatus." + CxbxKrnlCleanup("HcDoneHead is zero but WritebackDoneHead interrupt is not set!\n"); + } + + if (m_Registers.HcInterrupt & m_Registers.HcInterruptStatus) { + // From the OHCI standard: "The least significant bit of this entry is set to 1 to indicate whether an + // unmasked HcInterruptStatus was set when HccaDoneHead was written." It's tecnically incorrect to + // do this to HcDoneHead instead of HccaDoneHead however it doesn't matter since HcDoneHead is + // zeroed below + m_Registers.HcDoneHead |= 1; + } + + hcca.HccaDoneHead = m_Registers.HcDoneHead; // dropped big -> little endian conversion from QEMU + m_Registers.HcDoneHead = 0; + m_DoneCount = 7; + OHCI_SetInterrupt(OHCI_INTR_WD); + } + + if (m_DoneCount != 7 && m_DoneCount != 0) { + // decrease Done Queue counter + m_DoneCount--; + } + + // Do SOF stuff here + OHCI_SOF(false); + + // Writeback HCCA + if (OHCI_WriteHCCA(m_Registers.HcHCCA, &hcca)) { + EmuLog(LOG_LEVEL::ERROR2, "HCCA write error at physical address 0x%X", m_Registers.HcHCCA); + OHCI_FatalError(); + } + + m_FrameTimeMutex.unlock(); +} + +void OHCI::OHCI_FatalError() +{ + // According to the standard, an OHCI will stop operating, and set itself into error state + // (which can be queried by MMIO). Instead of calling directly CxbxKrnlCleanup, we let the + // HCD know the problem so that it can try to solve it + + OHCI_SetInterrupt(OHCI_INTR_UE); + OHCI_BusStop(); + EmuLog(LOG_LEVEL::ERROR2, "An unrecoverable error has occoured!\n"); +} + +bool OHCI::OHCI_ReadHCCA(xbaddr Paddr, OHCI_HCCA* Hcca) +{ + return Memory_R(reinterpret_cast(Paddr), Hcca, sizeof(OHCI_HCCA)); +} + +bool OHCI::OHCI_WriteHCCA(xbaddr Paddr, OHCI_HCCA* Hcca) +{ + // We need to calculate the offset of the HccaFrameNumber member to avoid overwriting HccaInterrruptTable + size_t OffsetOfFrameNumber = offsetof(OHCI_HCCA, HccaFrameNumber); + return Memory_W(reinterpret_cast(Paddr + OffsetOfFrameNumber), reinterpret_cast(Hcca) + OffsetOfFrameNumber, 8); +} + +bool OHCI::OHCI_ReadED(xbaddr Paddr, OHCI_ED* Ed) +{ + return GetDwords(Paddr, reinterpret_cast(Ed), sizeof(*Ed) >> 2); // ED is 16 bytes large +} + +bool OHCI::OHCI_WriteED(xbaddr Paddr, OHCI_ED* Ed) +{ + // According to the standard, only the HeadP field is writable by the HC, so we'll write just that + size_t OffsetOfHeadP = offsetof(OHCI_ED, HeadP); + return WriteDwords(Paddr + OffsetOfHeadP, reinterpret_cast(reinterpret_cast(Ed) + OffsetOfHeadP), 1); +} + +bool OHCI::OHCI_ReadTD(xbaddr Paddr, OHCI_TD* Td) +{ + return GetDwords(Paddr, reinterpret_cast(Td), sizeof(*Td) >> 2); // TD is 16 bytes large +} + +bool OHCI::OHCI_WriteTD(xbaddr Paddr, OHCI_TD* Td) +{ + return WriteDwords(Paddr, reinterpret_cast(Td), sizeof(*Td) >> 2); +} + +bool OHCI::OHCI_ReadIsoTD(xbaddr Paddr, OHCI_ISO_TD* td) +{ + return GetDwords(Paddr, reinterpret_cast(td), 4) || GetWords(Paddr + 16, td->Offset, 8); +} + +bool OHCI::OHCI_WriteIsoTD(xbaddr Paddr, OHCI_ISO_TD* td) +{ + return WriteDwords(Paddr, reinterpret_cast(td), 4) || WriteWords(Paddr + 16, td->Offset, 8); +} + +bool OHCI::OHCI_CopyTDBuffer(OHCI_TD* Td, uint8_t* Buffer, int Length, bool bIsWrite) +{ + uint32_t ptr; + int n; + + // Figure out if we are crossing a 4K page boundary + ptr = Td->CurrentBufferPointer; + n = 0x1000 - (ptr & 0xFFF); + if (n > Length) { + n = Length; + } + + if (Memory_RW(reinterpret_cast(ptr), Buffer, n, bIsWrite)) { + return true; // error + } + if (n == Length) { + return false; // no bytes left to copy + } + + // From the OHCI standard: "If during the data transfer the buffer address contained in the HCfs working copy of + // CurrentBufferPointer crosses a 4K boundary, the upper 20 bits of BufferEnd are copied to the + // working value of CurrentBufferPointer causing the next buffer address to be the 0th byte in the + // same 4K page that contains the last byte of the buffer." + ptr = Td->BufferEnd & ~0xFFFu; + Buffer += n; + if (Memory_RW(reinterpret_cast(ptr), Buffer, Length - n, bIsWrite)) { + return true; // error + } + return false; +} + +bool OHCI::OHCI_CopyIsoTDBuffer(uint32_t start_addr, uint32_t end_addr, uint8_t* Buffer, int Length, bool bIsWrite) +{ + uint32_t ptr; + int n; + + ptr = start_addr; + n = 0x1000 - (ptr & 0xFFF); + if (n > Length) { + n = Length; + } + + if (Memory_RW(reinterpret_cast(ptr), Buffer, n, bIsWrite)) { + return true; // error + } + if (n == Length) { + return false; // no bytes left to copy + } + ptr = end_addr & ~0xFFFu; + Buffer += n; + if (Memory_RW(reinterpret_cast(ptr), Buffer, Length - n, bIsWrite)) { + return true; // error + } + return false; +} + +int OHCI::OHCI_ServiceEDlist(xbaddr Head, int Completion) +{ + OHCI_ED ed; + xbaddr next_ed; + xbaddr current; + int active; + + active = 0; + + if (Head == xbnull) { + // no ED here, nothing to do + return 0; + } + + for (current = Head; current; current = next_ed) { + if (OHCI_ReadED(current, &ed)) { + EmuLog(LOG_LEVEL::ERROR2, "ED read error at physical address 0x%X", current); + OHCI_FatalError(); + return 0; + } + + // From the OHCI standard "An Endpoint Descriptor (ED) is a 16-byte, memory resident structure that must be aligned to a + // 16-byte boundary." + next_ed = ed.NextED & OHCI_DPTR_MASK; + + if ((ed.HeadP & OHCI_ED_H) || (ed.Flags & OHCI_ED_K)) { // halted or skip + // Cancel pending packets for ED that have been paused + xbaddr addr = ed.HeadP & OHCI_DPTR_MASK; + if (m_AsyncTD && addr == m_AsyncTD) { + m_UsbDevice->USB_CancelPacket(&m_UsbPacket); + m_AsyncTD = xbnull; + m_UsbDevice->USB_DeviceEPstopped(m_UsbPacket.Endpoint->Dev, m_UsbPacket.Endpoint); + } + continue; + } + + while ((ed.HeadP & OHCI_DPTR_MASK) != ed.TailP) { // a TD is available to be processed +#ifdef DEBUG_PACKET + printf("ED @ 0x%.8x fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u " + "h=%u c=%u\n head=0x%.8x tailp=0x%.8x next=0x%.8x\n", current, + OHCI_BM(ed.Flags, ED_FA), OHCI_BM(ed.Flags, ED_EN), + OHCI_BM(ed.Flags, ED_D), (ed.Flags & OHCI_ED_S) != 0, + (ed.Flags & OHCI_ED_K) != 0, (ed.Flags & OHCI_ED_F) != 0, + OHCI_BM(ed.Flags, ED_MPS), (ed.HeadP & OHCI_ED_H) != 0, + (ed.HeadP & OHCI_ED_C) != 0, ed.HeadP & OHCI_DPTR_MASK, + ed.TailP & OHCI_DPTR_MASK, ed.NextED & OHCI_DPTR_MASK); +#endif + active = 1; + + if ((ed.Flags & OHCI_ED_F) == 0) { + // Handle control, interrupt or bulk endpoints + if (OHCI_ServiceTD(&ed)) { + break; + } + } + else { + // Handle isochronous endpoints + if (OHCI_ServiceIsoTD(&ed, Completion)) { + break; + } + } + } + + // Writeback ED + if (OHCI_WriteED(current, &ed)) { + OHCI_FatalError(); + return 0; + } + } + + return active; +} + +int OHCI::OHCI_ServiceTD(OHCI_ED* Ed) +{ + int direction; + size_t length = 0, packetlen = 0; +#ifdef DEBUG_PACKET + const char *str = nullptr; +#endif + int pid; + int ret; + int i; + XboxDeviceState* dev; + USBEndpoint* ep; + OHCI_TD td; + xbaddr addr; + int flag_r; + int completion; + + addr = Ed->HeadP & OHCI_DPTR_MASK; + // See if this TD has already been submitted to the device + completion = (addr == m_AsyncTD); + if (completion && !m_AsyncComplete) { + EmuLog(LOG_LEVEL::DEBUG, "Skipping async TD"); + return 1; + } + if (OHCI_ReadTD(addr, &td)) { + EmuLog(LOG_LEVEL::ERROR2, "TD read error at physical address 0x%X", addr); + OHCI_FatalError(); + return 0; + } + + // From the OHCI standard: "This 2-bit field indicates the direction of data flow and the PID + // to be used for the token. This field is only relevant to the HC if the D field in the ED + // was set to 00b or 11b indicating that the PID determination is deferred to the TD." + direction = OHCI_BM(Ed->Flags, ED_D); + switch (direction) { + case OHCI_TD_DIR_OUT: + case OHCI_TD_DIR_IN: + // Same value + break; + default: + direction = OHCI_BM(td.Flags, TD_DP); + } + + // Info: Each USB transaction consists of a + // 1. Token Packet, (Header defining what it expects to follow). + // 2. Optional Data Packet, (Containing the payload). + // 3. Status Packet, (Used to acknowledge transactions and to provide a means of error correction). + + // There are three types of token packets: + // In - Informs the USB device that the host wishes to read information. + // Out - Informs the USB device that the host wishes to send information. + // Setup - Used to begin control transfers. + + switch (direction) { + case OHCI_TD_DIR_IN: +#ifdef DEBUG_PACKET + str = "in"; +#endif + pid = USB_TOKEN_IN; + break; + case OHCI_TD_DIR_OUT: +#ifdef DEBUG_PACKET + str = "out"; +#endif + pid = USB_TOKEN_OUT; + break; + case OHCI_TD_DIR_SETUP: +#ifdef DEBUG_PACKET + str = "setup"; +#endif + pid = USB_TOKEN_SETUP; + break; + default: + EmuLog(LOG_LEVEL::WARNING, "bad direction"); + return 1; + } + + // Check if this TD has a buffer of user data to transfer + if (td.CurrentBufferPointer && td.BufferEnd) { + if ((td.CurrentBufferPointer & 0xFFFFF000) != (td.BufferEnd & 0xFFFFF000)) { + // the buffer crosses a 4K page boundary + length = (td.BufferEnd & 0xFFF) + 0x1001 - (td.CurrentBufferPointer & 0xFFF); + } + else { + // the buffer is within a single page + length = (td.BufferEnd - td.CurrentBufferPointer) + 1; + } + + packetlen = length; + if (length && direction != OHCI_TD_DIR_IN) { + // The endpoint may not allow us to transfer it all now + packetlen = (Ed->Flags & OHCI_ED_MPS_MASK) >> OHCI_ED_MPS_SHIFT; + if (packetlen > length) { + packetlen = length; + } + if (!completion) { + if (OHCI_CopyTDBuffer(&td, m_UsbBuffer, packetlen, false)) { + OHCI_FatalError(); + } + } + } + } + + flag_r = (td.Flags & OHCI_TD_R) != 0; +#ifdef DEBUG_PACKET + printf(" TD @ 0x%.8X %lld of %lld bytes %s r=%d cbp=0x%.8X be=0x%.8X\n", + addr, (int64_t)packetlen, (int64_t)length, str, flag_r, td.CurrentBufferPointer, td.BufferEnd); + + if (packetlen > 0 && direction != OHCI_TD_DIR_IN) { + printf(" data:"); + for (i = 0; i < packetlen; i++) { + printf(" %.2x", m_UsbBuffer[i]); + } + printf("\n"); + } +#endif + if (completion) { + m_AsyncTD = 0; + m_AsyncComplete = 0; + } + else { + if (m_AsyncTD) { + // From QEMU: "??? The hardware should allow one active packet per endpoint. + // We only allow one active packet per controller. This should be sufficient + // as long as devices respond in a timely manner." + EmuLog(LOG_LEVEL::DEBUG, "too many pending packets"); + return 1; + } + dev = OHCI_FindDevice(OHCI_BM(Ed->Flags, ED_FA)); + ep = m_UsbDevice->USB_GetEP(dev, pid, OHCI_BM(Ed->Flags, ED_EN)); + m_UsbDevice->USB_PacketSetup(&m_UsbPacket, pid, ep, addr, !flag_r, OHCI_BM(td.Flags, TD_DI) == 0); + m_UsbDevice->USB_PacketAddBuffer(&m_UsbPacket, m_UsbBuffer, packetlen); + m_UsbDevice->USB_HandlePacket(dev, &m_UsbPacket); +#ifdef DEBUG_PACKET + printf("status=%d\n", m_UsbPacket.Status); +#endif + if (m_UsbPacket.Status == USB_RET_ASYNC) { + m_UsbDevice->USB_DeviceFlushEPqueue(dev, ep); + m_AsyncTD = addr; + return 1; + } + } + if (m_UsbPacket.Status == USB_RET_SUCCESS) { + ret = m_UsbPacket.ActualLength; + } + else { + ret = m_UsbPacket.Status; + } + + if (ret >= 0) { + if (direction == OHCI_TD_DIR_IN) { + if (OHCI_CopyTDBuffer(&td, m_UsbBuffer, ret, true)) { + OHCI_FatalError(); + } +#ifdef DEBUG_PACKET + printf(" data:"); + for (i = 0; i < ret; i++) { + printf(" %.2X", m_UsbBuffer[i]); + } + printf("\n"); +#endif + } + else { + ret = packetlen; + } + } + + if (ret >= 0) { + if ((td.CurrentBufferPointer & 0xFFF) + ret > 0xFFF) { + td.CurrentBufferPointer = (td.BufferEnd & ~0xFFF) + ((td.CurrentBufferPointer + ret) & 0xFFF); + } + else { + td.CurrentBufferPointer += ret; + } + } + + // Writeback + if (ret == packetlen || (direction == OHCI_TD_DIR_IN && ret >= 0 && flag_r)) { + // Transmission succeeded + if (ret == length) { + td.CurrentBufferPointer = 0; + } + td.Flags |= OHCI_TD_T1; + td.Flags ^= OHCI_TD_T0; + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_NOERROR); + OHCI_SET_BM(td.Flags, TD_EC, 0); + + if ((direction != OHCI_TD_DIR_IN) && (ret != length)) { + // Partial packet transfer: TD not ready to retire yet + goto exit_no_retire; + } + + // Setting ED_C is part of the TD retirement process + Ed->HeadP &= ~OHCI_ED_C; + if (td.Flags & OHCI_TD_T0) + Ed->HeadP |= OHCI_ED_C; + } + else { + if (ret >= 0) { + EmuLog(LOG_LEVEL::DEBUG, "Underrun"); + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_DATAUNDERRUN); + } + else { + switch (ret) { + case USB_RET_IOERROR: + case USB_RET_NODEV: + EmuLog(LOG_LEVEL::DEBUG, "Received DEV ERROR"); + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_DEVICENOTRESPONDING); + break; + case USB_RET_NAK: + EmuLog(LOG_LEVEL::DEBUG, "Received NAK"); + return 1; + case USB_RET_STALL: + EmuLog(LOG_LEVEL::DEBUG, "Received STALL"); + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_STALL); + break; + case USB_RET_BABBLE: + EmuLog(LOG_LEVEL::DEBUG, "Received BABBLE"); + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_DATAOVERRUN); + break; + default: + EmuLog(LOG_LEVEL::DEBUG, "Bad device response %d", ret); + OHCI_SET_BM(td.Flags, TD_CC, OHCI_CC_UNDEXPETEDPID); + OHCI_SET_BM(td.Flags, TD_EC, 3); + } + } + Ed->HeadP |= OHCI_ED_H; + } + + // Retire this TD + Ed->HeadP &= ~OHCI_DPTR_MASK; + Ed->HeadP |= td.NextTD & OHCI_DPTR_MASK; + td.NextTD = m_Registers.HcDoneHead; + m_Registers.HcDoneHead = addr; + i = OHCI_BM(td.Flags, TD_DI); + if (i < m_DoneCount) { + m_DoneCount = i; + } + if (OHCI_BM(td.Flags, TD_CC) != OHCI_CC_NOERROR) { + m_DoneCount = 0; + } + +exit_no_retire: + if (OHCI_WriteTD(addr, &td)) { + OHCI_FatalError(); + return 1; + } + return OHCI_BM(td.Flags, TD_CC) != OHCI_CC_NOERROR; +} + +XboxDeviceState* OHCI::OHCI_FindDevice(uint8_t Addr) +{ + XboxDeviceState* dev; + int i; + + for (i = 0; i < 4; i++) { + if ((m_Registers.RhPort[i].HcRhPortStatus & OHCI_PORT_PES) == 0) { + continue; // port is disabled + } + dev = m_UsbDevice->USB_FindDevice(&m_Registers.RhPort[i].UsbPort, Addr); + if (dev != nullptr) { + return dev; // return found device + } + } + + return nullptr; +} + +void OHCI::OHCI_StateReset() +{ + // The usb state can be USB_Suspend if it is a software reset, and USB_Reset if it is a hardware + // reset or cold boot + + OHCI_BusStop(); + m_OldHcControl = 0; + + // Reset all registers + m_Registers.HcRevision = 0x10; + m_Registers.HcControl = 0; + m_Registers.HcCommandStatus = 0; + m_Registers.HcInterruptStatus = 0; + m_Registers.HcInterrupt = OHCI_INTR_MIE; // enable interrupts + + m_Registers.HcHCCA = 0; + m_Registers.HcPeriodCurrentED = 0; + m_Registers.HcControlHeadED = m_Registers.HcControlCurrentED = 0; + m_Registers.HcBulkHeadED = m_Registers.HcBulkCurrentED = 0; + m_Registers.HcDoneHead = 0; + + m_Registers.HcFmInterval = 0; + m_Registers.HcFmInterval |= (0x2778 << 16); // TBD according to the standard, using what QEMU sets (FSLargestDataPacket) + m_Registers.HcFmInterval |= 0x2EDF; // bit-time of a frame. 1 frame = 1 ms (FrameInterval) + m_Registers.HcFmRemaining = 0; + m_Registers.HcFmNumber = 0; + m_Registers.HcPeriodicStart = 0; + m_Registers.HcLSThreshold = OHCI_LS_THRESH; + + m_Registers.HcRhDescriptorA = OHCI_RHA_NOCP | OHCI_RHA_NPS | 4; // The xbox lacks the hw to switch off the power on the ports and has 4 ports per HC + m_Registers.HcRhDescriptorB = 0; // The attached devices are removable and use PowerSwitchingMode to control the power on the ports + m_Registers.HcRhStatus = 0; + + m_DoneCount = 7; + + for (int i = 0; i < 4; i++) + { + OHCIPort* Port = &m_Registers.RhPort[i]; + Port->HcRhPortStatus = 0; + if (Port->UsbPort.Dev && Port->UsbPort.Dev->Attached) { + m_UsbDevice->USB_PortReset(&Port->UsbPort); + } + } + if (m_AsyncTD) { + m_UsbDevice->USB_CancelPacket(&m_UsbPacket); + m_AsyncTD = xbnull; + } + + OHCI_StopEndpoints(); + + EmuLog(LOG_LEVEL::DEBUG, "Reset event."); +} + +void OHCI::OHCI_BusStart() +{ + // Create the EOF timer. + m_pEOFtimer = Timer_Create(OHCI_FrameBoundaryWrapper, this, "", nullptr); + + EmuLog(LOG_LEVEL::DEBUG, "Operational event"); + + // SOF event + OHCI_SOF(true); +} + +void OHCI::OHCI_BusStop() +{ + if (m_pEOFtimer) { + // Delete existing EOF timer + Timer_Exit(m_pEOFtimer); + } + m_pEOFtimer = nullptr; +} + +void OHCI::OHCI_SOF(bool bCreate) +{ + // set current SOF time + m_SOFtime = GetTime_NS(m_pEOFtimer); + + // make timer expire at SOF + 1 ms from now + if (bCreate) { + Timer_Start(m_pEOFtimer, m_UsbFrameTime); + } + + OHCI_SetInterrupt(OHCI_INTR_SF); +} + +void OHCI::OHCI_ChangeState(uint32_t Value) +{ + uint32_t OldState = m_Registers.HcControl & OHCI_CTL_HCFS; + m_Registers.HcControl = Value; + uint32_t NewState = m_Registers.HcControl & OHCI_CTL_HCFS; + + // no state change + if (OldState == NewState) { + return; + } + + switch (NewState) + { + case Operational: + OHCI_BusStart(); + break; + + case Suspend: + OHCI_BusStop(); + EmuLog(LOG_LEVEL::DEBUG, "Suspend event"); + break; + + case Resume: + EmuLog(LOG_LEVEL::DEBUG, "Resume event"); + break; + + case Reset: + OHCI_StateReset(); + break; + + default: + EmuLog(LOG_LEVEL::WARNING, "Unknown USB mode!"); + } +} + +void OHCI::OHCI_PacketInit(USBPacket* packet) +{ + IOVector* vec = &packet->IoVec; + vec->IoVecStruct = new IoVec; + vec->IoVecNumber = 0; + vec->AllocNumber = 1; + vec->Size = 0; +} + +uint32_t OHCI::OHCI_ReadRegister(xbaddr Addr) +{ + uint32_t ret = 0xFFFFFFFF; + + if (Addr & 3) { + // The standard allows only aligned reads to the registers + EmuLog(LOG_LEVEL::DEBUG, "Unaligned read. Ignoring."); + return ret; + } + else { + switch (Addr >> 2) // read the register + { + case 0: // HcRevision + ret = m_Registers.HcRevision; + DUMP_REG_R(ret); + break; + + case 1: // HcControl + ret = m_Registers.HcControl; + DUMP_REG_R(ret); + break; + + case 2: // HcCommandStatus + ret = m_Registers.HcCommandStatus; + DUMP_REG_R(ret); + break; + + case 3: // HcInterruptStatus + ret = m_Registers.HcInterruptStatus; + DUMP_REG_R(ret); + break; + + case 4: // HcInterruptEnable + case 5: // HcInterruptDisable + ret = m_Registers.HcInterrupt; + DUMP_REG_R(ret); + break; + + case 6: // HcHCCA + ret = m_Registers.HcHCCA; + DUMP_REG_R(ret); + break; + + case 7: // HcPeriodCurrentED + ret = m_Registers.HcPeriodCurrentED; + DUMP_REG_R(ret); + break; + + case 8: // HcControlHeadED + ret = m_Registers.HcControlHeadED; + DUMP_REG_R(ret); + break; + + case 9: // HcControlCurrentED + ret = m_Registers.HcControlCurrentED; + DUMP_REG_R(ret); + break; + + case 10: // HcBulkHeadED + ret = m_Registers.HcBulkHeadED; + DUMP_REG_R(ret); + break; + + case 11: // HcBulkCurrentED + ret = m_Registers.HcBulkCurrentED; + DUMP_REG_R(ret); + break; + + case 12: // HcDoneHead + ret = m_Registers.HcDoneHead; + DUMP_REG_R(ret); + break; + + case 13: // HcFmInterval + ret = m_Registers.HcFmInterval; + DUMP_REG_R(ret); + break; + + case 14: // HcFmRemaining + ret = OHCI_GetFrameRemaining(); + DUMP_REG_R(ret); + break; + + case 15: // HcFmNumber + ret = m_Registers.HcFmNumber; + DUMP_REG_R(ret); + break; + + case 16: // HcPeriodicStart + ret = m_Registers.HcPeriodicStart; + DUMP_REG_R(ret); + break; + + case 17: // HcLSThreshold + ret = m_Registers.HcLSThreshold; + DUMP_REG_R(ret); + break; + + case 18: // HcRhDescriptorA + ret = m_Registers.HcRhDescriptorA; + DUMP_REG_R(ret); + break; + + case 19: // HcRhDescriptorB + ret = m_Registers.HcRhDescriptorB; + DUMP_REG_R(ret); + break; + + case 20: // HcRhStatus + ret = m_Registers.HcRhStatus; + DUMP_REG_R(ret); + break; + + // Always report that the port power is on since the Xbox cannot switch off the electrical current to it + case 21: // RhPort 0 + ret = m_Registers.RhPort[0].HcRhPortStatus | OHCI_PORT_PPS; + DUMP_REG_R(ret); + break; + + case 22: // RhPort 1 + ret = m_Registers.RhPort[1].HcRhPortStatus | OHCI_PORT_PPS; + DUMP_REG_R(ret); + break; + + case 23: // RhPort 2 + ret = m_Registers.RhPort[2].HcRhPortStatus | OHCI_PORT_PPS; + DUMP_REG_R(ret); + break; + + case 24: // RhPort 3 + ret = m_Registers.RhPort[3].HcRhPortStatus | OHCI_PORT_PPS; + DUMP_REG_R(ret); + break; + + default: + EmuLog(LOG_LEVEL::WARNING, "Read register operation with bad offset %u. Ignoring.", Addr >> 2); + } + return ret; + } +} + +void OHCI::OHCI_WriteRegister(xbaddr Addr, uint32_t Value) +{ + if (Addr & 3) { + // The standard allows only aligned writes to the registers + EmuLog(LOG_LEVEL::DEBUG, "Unaligned write. Ignoring."); + return; + } + else { + switch (Addr >> 2) + { + case 0: // HcRevision + // This register is read-only + DUMP_REG_RO(m_Registers.HcRevision, Value); + break; + + case 1: // HcControl + OHCI_ChangeState(Value); + DUMP_REG_W(m_Registers.HcControl, Value); + break; + + case 2: // HcCommandStatus + { + // SOC is read-only + Value &= ~OHCI_STATUS_SOC; + + // From the OHCI standard: "The Host Controller must ensure that bits written as 1 become set + // in the register while bits written as 0 remain unchanged in the register." + m_Registers.HcCommandStatus |= Value; + + if (m_Registers.HcCommandStatus & OHCI_STATUS_HCR) { + // Do a hardware reset + OHCI_StateReset(); + } + DUMP_REG_W(m_Registers.HcCommandStatus, Value); + } + break; + + case 3: // HcInterruptStatus + m_Registers.HcInterruptStatus &= ~Value; + OHCI_UpdateInterrupt(); + DUMP_REG_W(m_Registers.HcInterruptStatus, Value); + break; + + case 4: // HcInterruptEnable + m_Registers.HcInterrupt |= Value; + OHCI_UpdateInterrupt(); + DUMP_REG_W(m_Registers.HcInterrupt, Value); + break; + + case 5: // HcInterruptDisable + m_Registers.HcInterrupt &= ~Value; + OHCI_UpdateInterrupt(); + DUMP_REG_W(m_Registers.HcInterrupt, Value); + break; + + case 6: // HcHCCA + // The standard says the minimum alignment is 256 bytes and so bits 0 through 7 are always zero + m_Registers.HcHCCA = Value & OHCI_HCCA_MASK; + DUMP_REG_W(m_Registers.HcHCCA, Value); + break; + + case 7: // HcPeriodCurrentED + // This register is read-only + DUMP_REG_RO(m_Registers.HcPeriodCurrentED, Value); + break; + + case 8: // HcControlHeadED + m_Registers.HcControlHeadED = Value & OHCI_DPTR_MASK; + DUMP_REG_W(m_Registers.HcControlHeadED, Value); + break; + + case 9: // HcControlCurrentED + m_Registers.HcControlCurrentED = Value & OHCI_DPTR_MASK; + DUMP_REG_W(m_Registers.HcControlCurrentED, Value); + break; + + case 10: // HcBulkHeadED + m_Registers.HcBulkHeadED = Value & OHCI_DPTR_MASK; + DUMP_REG_W(m_Registers.HcBulkHeadED, Value); + break; + + case 11: // HcBulkCurrentED + m_Registers.HcBulkCurrentED = Value & OHCI_DPTR_MASK; + DUMP_REG_W(m_Registers.HcBulkCurrentED, Value); + break; + + case 12: // HcDoneHead + // This register is read-only + DUMP_REG_RO(m_Registers.HcDoneHead, Value); + break; + + case 13: // HcFmInterval + { + if ((Value & OHCI_FMI_FI) != (m_Registers.HcFmInterval & OHCI_FMI_FI)) { + EmuLog(LOG_LEVEL::DEBUG, "Changing frame interval duration. New value is %u", Value & OHCI_FMI_FI); + } + m_Registers.HcFmInterval = Value & ~0xC000; + DUMP_REG_W(m_Registers.HcFmInterval, Value); + } + break; + + case 14: // HcFmRemaining + // This register is read-only + DUMP_REG_RO(m_Registers.HcFmRemaining, Value); + break; + + case 15: // HcFmNumber + // This register is read-only + DUMP_REG_RO(m_Registers.HcFmNumber, Value); + break; + + case 16: // HcPeriodicStart + m_Registers.HcPeriodicStart = Value & 0x3FFF; + DUMP_REG_W(m_Registers.HcPeriodicStart, Value); + break; + + case 17: // HcLSThreshold + m_Registers.HcLSThreshold = Value & 0xFFF; + DUMP_REG_W(m_Registers.HcLSThreshold, Value); + break; + + case 18: // HcRhDescriptorA + m_Registers.HcRhDescriptorA &= ~OHCI_RHA_RW_MASK; + m_Registers.HcRhDescriptorA |= Value & OHCI_RHA_RW_MASK; // ?? + DUMP_REG_W(m_Registers.HcRhDescriptorA, Value); + break; + + case 19: // HcRhDescriptorB + // Don't do anything, the attached devices are all removable and PowerSwitchingMode is always 0 + break; + + case 20: // HcRhStatus + OHCI_SetHubStatus(Value); + DUMP_REG_W(m_Registers.HcRhStatus, Value); + break; + + case 21: // RhPort 0 + OHCI_PortSetStatus(0, Value); + DUMP_REG_W(m_Registers.RhPort[0].HcRhPortStatus, Value); + break; + + case 22: // RhPort 1 + OHCI_PortSetStatus(1, Value); + DUMP_REG_W(m_Registers.RhPort[1].HcRhPortStatus, Value); + break; + + case 23: // RhPort 2 + OHCI_PortSetStatus(2, Value); + DUMP_REG_W(m_Registers.RhPort[2].HcRhPortStatus, Value); + break; + + case 24: // RhPort 3 + OHCI_PortSetStatus(3, Value); + DUMP_REG_W(m_Registers.RhPort[3].HcRhPortStatus, Value); + break; + + default: + EmuLog(LOG_LEVEL::WARNING, "Write register operation with bad offset %u. Ignoring.", Addr >> 2); + } + } +} + +void OHCI::OHCI_UpdateInterrupt() +{ + if ((m_Registers.HcInterrupt & OHCI_INTR_MIE) && (m_Registers.HcInterruptStatus & m_Registers.HcInterrupt)) { + HalSystemInterrupts[1].Assert(false); + HalSystemInterrupts[1].Assert(true); + } +} + +void OHCI::OHCI_SetInterrupt(uint32_t Value) +{ + m_Registers.HcInterruptStatus |= Value; + OHCI_UpdateInterrupt(); +} + +uint32_t OHCI::OHCI_GetFrameRemaining() +{ + uint16_t frame; + uint64_t ticks; + + if ((m_Registers.HcControl & OHCI_CTL_HCFS) != Operational) { + return m_Registers.HcFmRemaining & OHCI_FMR_FRT; + } + + // Being in USB operational state guarantees that m_pEOFtimer and m_SOFtime were set already + ticks = GetTime_NS(m_pEOFtimer) - m_SOFtime; + + // Avoid Muldiv64 if possible + if (ticks >= m_UsbFrameTime) { + return m_Registers.HcFmRemaining & OHCI_FMR_FRT; + } + + ticks = Muldiv64(1, (uint32_t)ticks, (uint32_t)m_TicksPerUsbTick); + frame = static_cast((m_Registers.HcFmInterval & OHCI_FMI_FI) - ticks); + + return (m_Registers.HcFmRemaining & OHCI_FMR_FRT) | frame; +} + +void OHCI::OHCI_StopEndpoints() +{ + XboxDeviceState* dev; + int i, j; + + for (i = 0; i < 4; i++) { + dev = m_Registers.RhPort[i].UsbPort.Dev; + if (dev && dev->Attached) { + m_UsbDevice->USB_DeviceEPstopped(dev, &dev->EP_ctl); + for (j = 0; j < USB_MAX_ENDPOINTS; j++) { + m_UsbDevice->USB_DeviceEPstopped(dev, &dev->EP_in[j]); + m_UsbDevice->USB_DeviceEPstopped(dev, &dev->EP_out[j]); + } + } + } +} + +void OHCI::OHCI_SetHubStatus(uint32_t Value) +{ + uint32_t old_state; + + old_state = m_Registers.HcRhStatus; + + // write 1 to clear OCIC + if (Value & OHCI_RHS_OCIC) { + m_Registers.HcRhStatus &= ~OHCI_RHS_OCIC; + } + + if (Value & OHCI_RHS_LPS) { + int i; + + for (i = 0; i < 4; i++) { + OHCI_PortPower(i, 0); + } + EmuLog(LOG_LEVEL::DEBUG, "powered down all ports"); + } + + if (Value & OHCI_RHS_LPSC) { + int i; + + for (i = 0; i < 4; i++) { + OHCI_PortPower(i, 1); + } + EmuLog(LOG_LEVEL::DEBUG, "powered up all ports"); + } + + if (Value & OHCI_RHS_DRWE) { + m_Registers.HcRhStatus |= OHCI_RHS_DRWE; + } + + if (Value & OHCI_RHS_CRWE) { + m_Registers.HcRhStatus &= ~OHCI_RHS_DRWE; + } + + if (old_state != m_Registers.HcRhStatus) { + OHCI_SetInterrupt(OHCI_INTR_RHSC); + } +} + +void OHCI::OHCI_PortPower(int i, int p) +{ + if (p) { + m_Registers.RhPort[i].HcRhPortStatus |= OHCI_PORT_PPS; + } + else { + m_Registers.RhPort[i].HcRhPortStatus &= ~(OHCI_PORT_PPS | + OHCI_PORT_CCS | + OHCI_PORT_PSS | + OHCI_PORT_PRS); + } +} + +void OHCI::OHCI_PortSetStatus(int PortNum, uint32_t Value) +{ + uint32_t old_state; + OHCIPort* port; + + port = &m_Registers.RhPort[PortNum]; + old_state = port->HcRhPortStatus; + + // Write to clear CSC, PESC, PSSC, OCIC, PRSC + if (Value & OHCI_PORT_WTC) { + port->HcRhPortStatus &= ~(Value & OHCI_PORT_WTC); + } + + if (Value & OHCI_PORT_CCS) { + port->HcRhPortStatus &= ~OHCI_PORT_PES; + } + + OHCI_PortSetIfConnected(PortNum, Value & OHCI_PORT_PES); + + if (OHCI_PortSetIfConnected(PortNum, Value & OHCI_PORT_PSS)) { + EmuLog(LOG_LEVEL::DEBUG, "port %d: SUSPEND", PortNum); + } + + if (OHCI_PortSetIfConnected(PortNum, Value & OHCI_PORT_PRS)) { + EmuLog(LOG_LEVEL::DEBUG, "port %d: RESET", PortNum); + m_UsbDevice->USB_DeviceReset(port->UsbPort.Dev); + port->HcRhPortStatus &= ~OHCI_PORT_PRS; + // ??? Should this also set OHCI_PORT_PESC + port->HcRhPortStatus |= OHCI_PORT_PES | OHCI_PORT_PRSC; + } + + // Invert order here to ensure in ambiguous case, device is powered up... + if (Value & OHCI_PORT_LSDA) { + OHCI_PortPower(PortNum, 0); + } + + if (Value & OHCI_PORT_PPS) { + OHCI_PortPower(PortNum, 1); + } + + if (old_state != port->HcRhPortStatus) { + OHCI_SetInterrupt(OHCI_INTR_RHSC); + } +} + +int OHCI::OHCI_PortSetIfConnected(int i, uint32_t Value) +{ + int ret = 1; + + // writing a 0 has no effect + if (Value == 0) { + return 0; + } + + // If CurrentConnectStatus is cleared we set ConnectStatusChange + if (!(m_Registers.RhPort[i].HcRhPortStatus & OHCI_PORT_CCS)) { + m_Registers.RhPort[i].HcRhPortStatus |= OHCI_PORT_CSC; + if (m_Registers.HcRhStatus & OHCI_RHS_DRWE) { + // from QEMU: TODO, CSC is a wakeup event + } + return 0; + } + + if (m_Registers.RhPort[i].HcRhPortStatus & Value) { + ret = 0; + } + + // set the bit + m_Registers.RhPort[i].HcRhPortStatus |= Value; + + return ret; +} + +void OHCI::OHCI_Detach(USBPort* Port) +{ + OHCIPort* port = &m_Registers.RhPort[Port->PortIndex]; + uint32_t old_state = port->HcRhPortStatus; + + OHCI_AsyncCancelDevice(Port->Dev); + + // set connect status + if (port->HcRhPortStatus & OHCI_PORT_CCS) { + port->HcRhPortStatus &= ~OHCI_PORT_CCS; + port->HcRhPortStatus |= OHCI_PORT_CSC; + } + + // disable port + if (port->HcRhPortStatus & OHCI_PORT_PES) { + port->HcRhPortStatus &= ~OHCI_PORT_PES; + port->HcRhPortStatus |= OHCI_PORT_PESC; + } + + EmuLog(LOG_LEVEL::DEBUG, "Detached port %d", Port->PortIndex); + + if (old_state != port->HcRhPortStatus) { + OHCI_SetInterrupt(OHCI_INTR_RHSC); + } +} + +void OHCI::OHCI_Attach(USBPort* Port) +{ + OHCIPort* port = &m_Registers.RhPort[Port->PortIndex]; + uint32_t old_state = port->HcRhPortStatus; + + // set connect status + port->HcRhPortStatus |= OHCI_PORT_CCS | OHCI_PORT_CSC; + + // update speed + if (port->UsbPort.Dev->Speed == USB_SPEED_LOW) { + port->HcRhPortStatus |= OHCI_PORT_LSDA; + } + else { + port->HcRhPortStatus &= ~OHCI_PORT_LSDA; + } + + // notify of remote-wakeup + if ((m_Registers.HcControl & OHCI_CTL_HCFS) == Suspend) { + OHCI_SetInterrupt(OHCI_INTR_RD); + } + + EmuLog(LOG_LEVEL::DEBUG, "Attached port %d", Port->PortIndex); + + if (old_state != port->HcRhPortStatus) { + OHCI_SetInterrupt(OHCI_INTR_RHSC); + } +} + +void OHCI::OHCI_ChildDetach(XboxDeviceState* child) +{ + OHCI_AsyncCancelDevice(child); +} + +void OHCI::OHCI_Wakeup(USBPort* port1) +{ + OHCIPort* port = &m_Registers.RhPort[port1->PortIndex]; + uint32_t intr = 0; + if (port->HcRhPortStatus & OHCI_PORT_PSS) { + EmuLog(LOG_LEVEL::DEBUG, "port %d: wakeup", port1->PortIndex); + port->HcRhPortStatus |= OHCI_PORT_PSSC; + port->HcRhPortStatus &= ~OHCI_PORT_PSS; + intr = OHCI_INTR_RHSC; + } + // Note that the controller can be suspended even if this port is not + if ((m_Registers.HcControl & OHCI_CTL_HCFS) == Suspend) { + EmuLog(LOG_LEVEL::DEBUG, "remote-wakeup: SUSPEND->RESUME"); + // From the OHCI standard: "The only interrupts possible in the USBSUSPEND state are ResumeDetected (the + // Host Controller will have changed the HostControllerFunctionalState to the USBRESUME state) + // and OwnershipChange." + m_Registers.HcControl &= ~OHCI_CTL_HCFS; + m_Registers.HcControl |= Resume; + intr = OHCI_INTR_RD; + } + OHCI_SetInterrupt(intr); +} + +void OHCI::OHCI_AsyncCompletePacket(USBPort* port, USBPacket* packet) +{ +#ifdef DEBUG_PACKET + printf("Async packet complete\n"); +#endif + m_AsyncComplete = 1; + OHCI_ProcessLists(1); +} + +void OHCI::OHCI_AsyncCancelDevice(XboxDeviceState* dev) +{ + if (m_AsyncTD && + m_UsbDevice->USB_IsPacketInflight(&m_UsbPacket) && + m_UsbPacket.Endpoint->Dev == dev) { + m_UsbDevice->USB_CancelPacket(&m_UsbPacket); + m_AsyncTD = xbnull; + } +} + +void OHCI::OHCI_ProcessLists(int completion) +{ + // Only process the control list if it is enabled (HcControl) and has available TD's (HcCommandStatus) + if ((m_Registers.HcControl & OHCI_CTL_CLE) && (m_Registers.HcCommandStatus & OHCI_STATUS_CLF)) { + if (m_Registers.HcControlCurrentED && m_Registers.HcControlCurrentED != m_Registers.HcControlHeadED) { + EmuLog(LOG_LEVEL::DEBUG, "head 0x%X, current 0x%X", m_Registers.HcControlHeadED, m_Registers.HcControlCurrentED); + } + if (!OHCI_ServiceEDlist(m_Registers.HcControlHeadED, completion)) { + m_Registers.HcControlCurrentED = 0; + m_Registers.HcCommandStatus &= ~OHCI_STATUS_CLF; + } + } + + // Only process the bulk list if it is enabled (HcControl) and has available TD's (HcCommandStatus) + if ((m_Registers.HcControl & OHCI_CTL_BLE) && (m_Registers.HcCommandStatus & OHCI_STATUS_BLF)) { + if (!OHCI_ServiceEDlist(m_Registers.HcBulkHeadED, completion)) { + m_Registers.HcBulkCurrentED = 0; + m_Registers.HcCommandStatus &= ~OHCI_STATUS_BLF; + } + } +} + +int OHCI::OHCI_ServiceIsoTD(OHCI_ED* ed, int completion) +{ + int dir; + int len = 0; +#ifdef DEBUG_ISOCH + const char* str = nullptr; +#endif + int pid; + int ret; + int i; + XboxDeviceState* dev; + USBEndpoint* ep; + OHCI_ISO_TD iso_td; + uint32_t addr; + uint16_t starting_frame; + int16_t relative_frame_number; + int frame_count; + uint32_t start_offset, next_offset, end_offset = 0; + uint32_t start_addr, end_addr; + + addr = ed->HeadP & OHCI_DPTR_MASK; + + if (OHCI_ReadIsoTD(addr, &iso_td)) { + EmuLog(LOG_LEVEL::ERROR2, "ISO_TD read error at physical address 0x%X", addr); + OHCI_FatalError(); + return 0; + } + + starting_frame = OHCI_BM(iso_td.Flags, TD_SF); + frame_count = OHCI_BM(iso_td.Flags, TD_FC); + // From the OHCI standard: "The Host Controller does an unsigned subtraction of StartingFrame from the 16 bits of + // HcFmNumber to arrive at a signed value for a relative frame number (frame R)." + relative_frame_number = USUB(m_Registers.HcFmNumber & 0xFFFF, starting_frame); + +#ifdef DEBUG_ISOCH + printf("--- ISO_TD ED head 0x%.8X tailp 0x%.8X\n" + "0x%.8X 0x%.8X 0x%.8X 0x%.8X\n" + "0x%.8X 0x%.8X 0x%.8X 0x%.8X\n" + "0x%.8X 0x%.8X 0x%.8X 0x%.8X\n" + "frame_number 0x%.8X starting_frame 0x%.8X\n" + "frame_count 0x%.8X relative %d\n" + "di 0x%.8X cc 0x%.8X\n", + ed->HeadP & OHCI_DPTR_MASK, ed->TailP & OHCI_DPTR_MASK, + iso_td.Flags, iso_td.BufferPage0, iso_td.NextTD, iso_td.BufferEnd, + iso_td.Offset[0], iso_td.Offset[1], iso_td.Offset[2], iso_td.Offset[3], + iso_td.Offset[4], iso_td.Offset[5], iso_td.Offset[6], iso_td.Offset[7], + m_Registers.HcFmNumber, starting_frame, + frame_count, relative_frame_number, + OHCI_BM(iso_td.Flags, TD_DI), OHCI_BM(iso_td.Flags, TD_CC)); +#endif + + if (relative_frame_number < 0) { + // From the OHCI standard: "If the relative frame number is negative, then the current frame is earlier than the 0th frame + // of the Isochronous TD and the Host Controller advances to the next ED." + EmuLog(LOG_LEVEL::DEBUG, "ISO_TD R=%d < 0", relative_frame_number); + return 1; + } + else if (relative_frame_number > frame_count) { + // From the OHCI standard: "If the relative frame number is greater than + // FrameCount, then the Isochronous TD has expired and a error condition exists." + EmuLog(LOG_LEVEL::DEBUG, "ISO_TD R=%d > FC=%d", relative_frame_number, frame_count); + OHCI_SET_BM(iso_td.Flags, TD_CC, OHCI_CC_DATAOVERRUN); + ed->HeadP &= ~OHCI_DPTR_MASK; + ed->HeadP |= (iso_td.NextTD & OHCI_DPTR_MASK); + iso_td.NextTD = m_Registers.HcDoneHead; + m_Registers.HcDoneHead = addr; + i = OHCI_BM(iso_td.Flags, TD_DI); + if (i < m_DoneCount) { + m_DoneCount = i; + } + if (OHCI_WriteIsoTD(addr, &iso_td)) { + OHCI_FatalError(); + return 1; + } + return 0; + } + + // From the OHCI standard: "If the relative frame number is between 0 and FrameCount, then the Host Controller issues + // a token to the endpoint and attempts a data transfer using the buffer described by the Isochronous TD." + + dir = OHCI_BM(ed->Flags, ED_D); + switch (dir) { + case OHCI_TD_DIR_IN: +#ifdef DEBUG_ISOCH + str = "in"; +#endif + pid = USB_TOKEN_IN; + break; + case OHCI_TD_DIR_OUT: +#ifdef DEBUG_ISOCH + str = "out"; +#endif + pid = USB_TOKEN_OUT; + break; + case OHCI_TD_DIR_SETUP: +#ifdef DEBUG_ISOCH + str = "setup"; +#endif + pid = USB_TOKEN_SETUP; + break; + default: + EmuLog(LOG_LEVEL::WARNING, "Bad direction %d", dir); + return 1; + } + + if (!iso_td.BufferPage0 || !iso_td.BufferEnd) { + EmuLog(LOG_LEVEL::DEBUG, "ISO_TD bp 0x%.8X be 0x%.8X", iso_td.BufferPage0, iso_td.BufferEnd); + return 1; + } + + start_offset = iso_td.Offset[relative_frame_number]; + next_offset = iso_td.Offset[relative_frame_number + 1]; + + // From the OHCI standard: "If the Host Controller supports checking of the Offsets, if either Offset[R] or Offset[R+1] does + // not have a ConditionCode of NOT ACCESSED or if the Offset[R + 1] is not greater than or equal to Offset[R], then + // an Unrecoverable Error is indicated." + // ergo720: I have a doubt here: according to the standard, the error condition is set if ConditionCode (bits 12-15 of + // Offset[R(+1)] is not 111x (= NOT ACCESSED), however the check below is only triggered if the bits are all zeros + // (= NO ERROR). So, if, for example, these bits are 1100 (= BUFFER OVERRUN), the check won't be triggered when actually + // it should be + + if (!(OHCI_BM(start_offset, TD_PSW_CC) & 0xE) || + ((relative_frame_number < frame_count) && + !(OHCI_BM(next_offset, TD_PSW_CC) & 0xE))) { + EmuLog(LOG_LEVEL::DEBUG, "ISO_TD cc != not accessed 0x%.8x 0x%.8x", start_offset, next_offset); + return 1; + } + + if ((relative_frame_number < frame_count) && (start_offset > next_offset)) { + printf("ISO_TD start_offset=0x%.8x > next_offset=0x%.8x\n", start_offset, next_offset); + return 1; + } + + // From the OHCI standard: "Bit 12 of offset R then selects the upper 20 bits of the physical address + // as either BufferPage0 when bit 12 = 0 or the upper 20 bits of BufferEnd when bit 12 = 1." + + if ((start_offset & 0x1000) == 0) { + start_addr = (iso_td.BufferPage0 & OHCI_PAGE_MASK) | + (start_offset & OHCI_OFFSET_MASK); + } + else { + start_addr = (iso_td.BufferEnd & OHCI_PAGE_MASK) | + (start_offset & OHCI_OFFSET_MASK); + } + + // From the OHCI standard: "If the data packet is not the last in an Isochronous TD (R not equal to FrameCount), + // then the ending address of the buffer is found by using Offset[R + 1] - 1. This value is then used to create a + // physical address in the same manner as the Offset[R] was used to create the starting physical address." + + if (relative_frame_number < frame_count) { + end_offset = next_offset - 1; + if ((end_offset & 0x1000) == 0) { + end_addr = (iso_td.BufferPage0 & OHCI_PAGE_MASK) | + (end_offset & OHCI_OFFSET_MASK); + } + else { + end_addr = (iso_td.BufferEnd & OHCI_PAGE_MASK) | + (end_offset & OHCI_OFFSET_MASK); + } + } + else { + // From the OHCI standard: "If, however, the data packet is the last in an Isochronous TD(R = FrameCount), + // then the value of BufferEnd is the address of the last byte in the buffer." + end_addr = iso_td.BufferEnd; + } + + if ((start_addr & OHCI_PAGE_MASK) != (end_addr & OHCI_PAGE_MASK)) { + len = (end_addr & OHCI_OFFSET_MASK) + 0x1001 + - (start_addr & OHCI_OFFSET_MASK); + } + else { + len = end_addr - start_addr + 1; + } + + if (len && dir != OHCI_TD_DIR_IN) { + if (OHCI_CopyIsoTDBuffer(start_addr, end_addr, m_UsbBuffer, len, false)) { + OHCI_FatalError(); + return 1; + } + } + + if (!completion) { + bool int_req = relative_frame_number == frame_count && OHCI_BM(iso_td.Flags, TD_DI) == 0; + dev = OHCI_FindDevice(OHCI_BM(ed->Flags, ED_FA)); + ep = m_UsbDevice->USB_GetEP(dev, pid, OHCI_BM(ed->Flags, ED_EN)); + m_UsbDevice->USB_PacketSetup(&m_UsbPacket, pid, ep, addr, false, int_req); + m_UsbDevice->USB_PacketAddBuffer(&m_UsbPacket, m_UsbBuffer, len); + m_UsbDevice->USB_HandlePacket(dev, &m_UsbPacket); + if (m_UsbPacket.Status == USB_RET_ASYNC) { + m_UsbDevice->USB_DeviceFlushEPqueue(dev, ep); + return 1; + } + } + if (m_UsbPacket.Status == USB_RET_SUCCESS) { + ret = m_UsbPacket.ActualLength; + } + else { + ret = m_UsbPacket.Status; + } + +#ifdef DEBUG_ISOCH + printf("so 0x%.8X eo 0x%.8X\nsa 0x%.8X ea 0x%.8X\ndir %s len %zu ret %d\n", + start_offset, end_offset, start_addr, end_addr, str, len, ret); +#endif + + // From the OHCI standard: "After each data packet transfer, the Rth Offset is replaced with a value that indicates the status of + // the data packet transfer.The upper 4 bits of the value are the ConditionCode for the transfer and the lower 12 bits + // represent the size of the transfer.Together, these two fields constitute the Packet Status Word(PacketStatusWord)." + + // Writeback + if (dir == OHCI_TD_DIR_IN && ret >= 0 && ret <= len) { + // IN transfer succeeded + if (OHCI_CopyIsoTDBuffer(start_addr, end_addr, m_UsbBuffer, ret, true)) { + OHCI_FatalError(); + return 1; + } + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_NOERROR); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_SIZE, ret); + } + else if (dir == OHCI_TD_DIR_OUT && ret == len) { + // OUT transfer succeeded + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_NOERROR); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_SIZE, 0); + } + else { + // Handle the error condition + if (ret > static_cast(len)) { // Sequence Error + EmuLog(LOG_LEVEL::DEBUG, "DataOverrun %d > %zu", ret, len); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_DATAOVERRUN); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_SIZE, len); + } + else if (ret >= 0) { // Sequence Error + EmuLog(LOG_LEVEL::DEBUG, "DataUnderrun %d", ret); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_DATAUNDERRUN); + } + else { + switch (ret) { + case USB_RET_IOERROR: // Transmission Errors + case USB_RET_NODEV: + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_DEVICENOTRESPONDING); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_SIZE, 0); + break; + case USB_RET_NAK: // NAK and STALL + case USB_RET_STALL: + EmuLog(LOG_LEVEL::DEBUG, "got NAK/STALL %d", ret); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_STALL); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_SIZE, 0); + break; + default: // Unknown Error + EmuLog(LOG_LEVEL::DEBUG, "Bad device response %d", ret); + OHCI_SET_BM(iso_td.Offset[relative_frame_number], TD_PSW_CC, OHCI_CC_UNDEXPETEDPID); + break; + } + } + } + + if (relative_frame_number == frame_count) { + // Last data packet of ISO TD - retire the TD to the Done Queue + OHCI_SET_BM(iso_td.Flags, TD_CC, OHCI_CC_NOERROR); + ed->HeadP &= ~OHCI_DPTR_MASK; + ed->HeadP |= (iso_td.NextTD & OHCI_DPTR_MASK); + iso_td.NextTD = m_Registers.HcDoneHead; + m_Registers.HcDoneHead = addr; + i = OHCI_BM(iso_td.Flags, TD_DI); + if (i < m_DoneCount) { + m_DoneCount = i; + } + } + if (OHCI_WriteIsoTD(addr, &iso_td)) { + OHCI_FatalError(); + } + return 1; +} diff --git a/src/devices/usb/OHCI.h b/src/devices/usb/OHCI.h new file mode 100644 index 000000000..a7ab20eb8 --- /dev/null +++ b/src/devices/usb/OHCI.h @@ -0,0 +1,251 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef OHCI_H_ +#define OHCI_H_ + +#include +#include "USBDevice.h" +#include "Timer.h" + + +// Abbreviations used: +// OHCI: Open Host Controller Interface; the standard used on the Xbox to comunicate with the usb devices +// HC: Host Controller; the hardware which interfaces with the usb device and the usb driver +// HCD: Host Controller Driver; software which talks to the HC, it's linked in the xbe +// SOF: start of frame; the beginning of a USB-defined frame +// EOF: end of frame; the end of a USB-defined frame +// ED: endpoint descriptor; a memory structure used by the HC to communicate with an endpoint +// TD: transfer descriptor; a memory structure used by the HC to transfer a block of data to/from a device endpoint +// HCCA: Host Controller Communications Area; shared memory between the HC and HCD + + +/* endpoint descriptor */ +struct OHCI_ED { + uint32_t Flags; + uint32_t TailP; + uint32_t HeadP; + uint32_t NextED; +}; + +/* general transfer descriptor */ +struct OHCI_TD { + uint32_t Flags; + uint32_t CurrentBufferPointer; + uint32_t NextTD; + uint32_t BufferEnd; +}; + +/* Isochronous transfer descriptor */ +struct OHCI_ISO_TD { + uint32_t Flags; + uint32_t BufferPage0; + uint32_t NextTD; + uint32_t BufferEnd; + uint16_t Offset[8]; +}; + +/* enum indicating the current HC state */ +typedef enum _OHCI_State +{ + Reset = 0x00, + Resume = 0x40, + Operational = 0x80, + Suspend = 0xC0, +} +OHCI_State; + +/* Host Controller Communications Area */ +struct OHCI_HCCA +{ + uint32_t HccaInterrruptTable[32]; + uint16_t HccaFrameNumber, HccaPad1; + uint32_t HccaDoneHead; +}; + +/* Small struct used to hold the HcRhPortStatus register and the usb port status */ +struct OHCIPort +{ + USBPort UsbPort; + uint32_t HcRhPortStatus; +}; + +/* All these registers are well documented in the OHCI standard */ +struct OHCI_Registers +{ + // Control and Status partition + uint32_t HcRevision; + uint32_t HcControl; + uint32_t HcCommandStatus; + uint32_t HcInterruptStatus; + // HcInterruptEnable/Disable are the same so we can merge them together + uint32_t HcInterrupt; + + // Memory Pointer partition + uint32_t HcHCCA; + uint32_t HcPeriodCurrentED; + uint32_t HcControlHeadED; + uint32_t HcControlCurrentED; + uint32_t HcBulkHeadED; + uint32_t HcBulkCurrentED; + uint32_t HcDoneHead; + + // Frame Counter partition + uint32_t HcFmInterval; + uint32_t HcFmRemaining; + uint32_t HcFmNumber; + uint32_t HcPeriodicStart; + uint32_t HcLSThreshold; + + // Root Hub partition + uint32_t HcRhDescriptorA; + uint32_t HcRhDescriptorB; + uint32_t HcRhStatus; + OHCIPort RhPort[4]; // 4 ports per HC +}; + + +/* OHCI class representing the state of the HC */ +class OHCI +{ + public: + // Indicates that the timer thread is accessing the OHCI object. Necessary because the input thread from the + // InputDeviceManager will access us when it needs to create or destroy a device + std::mutex m_FrameTimeMutex; + + // constructor + OHCI(USBDevice* UsbObj); + // destructor + ~OHCI() {} + // read a register + uint32_t OHCI_ReadRegister(xbaddr Addr); + // write a register + void OHCI_WriteRegister(xbaddr Addr, uint32_t Value); + + + private: + // pointer to g_USB0 + USBDevice* m_UsbDevice = nullptr; + // all the registers available in the OHCI standard + OHCI_Registers m_Registers; + // end-of-frame timer + TimerObject* m_pEOFtimer = nullptr; + // time at which a SOF was sent + uint64_t m_SOFtime; + // the duration of a usb frame + uint64_t m_UsbFrameTime; + // ticks per usb tick + uint64_t m_TicksPerUsbTick; + // pending usb packet to process + USBPacket m_UsbPacket = {}; + // temporary buffer that holds the user data to transfer in a packet + uint8_t m_UsbBuffer[8192] = {}; + // the value of HcControl in the previous frame + uint32_t m_OldHcControl; + // Done Queue Interrupt Counter + int m_DoneCount; + // the address of the pending TD + xbaddr m_AsyncTD = xbnull; + // indicates if there is a pending asynchronous packet to process + int m_AsyncComplete = 0; + + // EOF callback wrapper + static void OHCI_FrameBoundaryWrapper(void* pVoid); + // EOF callback function + void OHCI_FrameBoundaryWorker(); + // inform the HCD that we got a problem here... + void OHCI_FatalError(); + // initialize packet struct + void OHCI_PacketInit(USBPacket* packet); + // change usb state mode + void OHCI_ChangeState(uint32_t Value); + // switch the HC to the reset state + void OHCI_StateReset(); + // start sending SOF tokens across the usb bus + void OHCI_BusStart(); + // stop sending SOF tokens across the usb bus + void OHCI_BusStop(); + // generate a SOF event, and start a timer for EOF + void OHCI_SOF(bool bCreate); + // change interrupt status + void OHCI_UpdateInterrupt(); + // fire an interrupt + void OHCI_SetInterrupt(uint32_t Value); + // calculate frame time remaining + uint32_t OHCI_GetFrameRemaining(); + // halt the endpoints of the device + void OHCI_StopEndpoints(); + // set root hub status + void OHCI_SetHubStatus(uint32_t Value); + // update power related bits in HcRhPortStatus + void OHCI_PortPower(int i, int p); + // set root hub port status + void OHCI_PortSetStatus(int PortNum, uint32_t Value); + // set a flag in a port status register but only set it if the port is connected, + // if not set ConnectStatusChange flag; if flag is enabled return 1 + int OHCI_PortSetIfConnected(int i, uint32_t Value); + // read the HCCA structure in memory + bool OHCI_ReadHCCA(xbaddr Paddr, OHCI_HCCA* Hcca); + // write the HCCA structure in memory + bool OHCI_WriteHCCA(xbaddr Paddr, OHCI_HCCA* Hcca); + // read an ED in memory + bool OHCI_ReadED(xbaddr Paddr, OHCI_ED* Ed); + // write an ED in memory + bool OHCI_WriteED(xbaddr Paddr, OHCI_ED* Ed); + // read an TD in memory + bool OHCI_ReadTD(xbaddr Paddr, OHCI_TD* Td); + // write a TD in memory + bool OHCI_WriteTD(xbaddr Paddr, OHCI_TD* Td); + // read an iso TD in memory + bool OHCI_ReadIsoTD(xbaddr Paddr, OHCI_ISO_TD* td); + // write an iso TD in memory + bool OHCI_WriteIsoTD(xbaddr Paddr, OHCI_ISO_TD* td); + // read/write the user buffer pointed to by a TD from/to main memory + bool OHCI_CopyTDBuffer(OHCI_TD* Td, uint8_t* Buffer, int Length, bool bIsWrite); + // read/write the user buffer pointed to by a ISO TD from/to main memory + bool OHCI_CopyIsoTDBuffer(uint32_t start_addr, uint32_t end_addr, uint8_t* Buffer, int Length, bool bIsWrite); + // process an ED list. Returns nonzero if active TD was found + int OHCI_ServiceEDlist(xbaddr Head, int Completion); + // process a TD. Returns nonzero to terminate processing of this endpoint + int OHCI_ServiceTD(OHCI_ED* Ed); + // process an isochronous TD + int OHCI_ServiceIsoTD(OHCI_ED* ed, int completion); + // find the usb device with the supplied address + XboxDeviceState* OHCI_FindDevice(uint8_t Addr); + // cancel a packet when a device is removed + void OHCI_AsyncCancelDevice(XboxDeviceState* dev); + // Process Control and Bulk lists + void OHCI_ProcessLists(int completion); + // see USBPortOps struct for info + void OHCI_Attach(USBPort* Port); + void OHCI_Detach(USBPort* Port); + void OHCI_ChildDetach(XboxDeviceState* child); + void OHCI_Wakeup(USBPort* port1); + void OHCI_AsyncCompletePacket(USBPort* port, USBPacket* packet); +}; + +#endif diff --git a/src/devices/usb/USBDevice.cpp b/src/devices/usb/USBDevice.cpp new file mode 100644 index 000000000..cb3371894 --- /dev/null +++ b/src/devices/usb/USBDevice.cpp @@ -0,0 +1,1256 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: QEMU usb subsystem as used in XQEMU (GPLv2) +// https://xqemu.com/ + +/* +* QEMU USB emulation +* +* Copyright (c) 2005 Fabrice Bellard +* +* 2008 Generic packet handler rewrite by Max Krasnyansky +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + + +#define LOG_PREFIX CXBXR_MODULE::USB + +// prevent name collisions +namespace xboxkrnl +{ + #include // For PKINTERRUPT, etc. +}; + +#include +#include "USBDevice.h" +#include "OHCI.h" +#include "core\kernel\exports\EmuKrnl.h" // For EmuLog +#include "common\util\CxbxUtil.h" +#include "Logging.h" + +#define SETUP_STATE_IDLE 0 +#define SETUP_STATE_SETUP 1 +#define SETUP_STATE_DATA 2 +#define SETUP_STATE_ACK 3 + + +void USBDevice::Init() +{ + PCIBarRegister r; + + // Register Memory bar : + r.Raw.type = PCI_BAR_TYPE_MEMORY; + r.Memory.address = USB0_BASE >> 4; + RegisterBAR(0, USB_SIZE, r.value); + + // Taken from https://github.com/docbrown/vxb/wiki/Xbox-Hardware-Information + m_DeviceId = 0x01C2; + m_VendorId = PCI_VENDOR_ID_NVIDIA; + + m_HostController = new OHCI(this); + m_PciPath = "pci.0:02.0"; +} + +uint32_t USBDevice::MMIORead(int barIndex, uint32_t addr, unsigned size) +{ + // barIndex must be zero since we created the USB devices with a zero index in Init() + assert(barIndex == 0); + + // read the register of the HC + return m_HostController->OHCI_ReadRegister(addr); +} + +void USBDevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) +{ + // barIndex must be zero since we created the USB devices with a zero index in Init() + assert(barIndex == 0); + + // write the register of the HC + m_HostController->OHCI_WriteRegister(addr, value); +} + +void USBDevice::USB_RegisterPort(USBPort* Port, int Index, int SpeedMask, USBPortOps* Ops) +{ + Port->PortIndex = Index; + Port->SpeedMask = SpeedMask; + Port->Operations = Ops; + Port->Dev = nullptr; + USB_PortLocation(Port, nullptr, Index + 1); + m_FreePorts.push_back(Port); +} + +void USBDevice::USB_UnregisterPort(USBPort* Port) +{ + auto it = std::find(m_FreePorts.begin(), m_FreePorts.end(), Port); + assert(it != m_FreePorts.end()); + m_FreePorts.erase(it); +} + +void USBDevice::USB_PortReset(USBPort* Port) +{ + XboxDeviceState* dev = Port->Dev; + + assert(dev != nullptr); + USB_Detach(Port); + USB_Attach(Port); + USB_DeviceReset(dev); +} + +void USBDevice::USB_Attach(USBPort* Port) +{ + XboxDeviceState* dev = Port->Dev; + + assert(dev != nullptr); + assert(dev->Attached); + assert(dev->State == USB_STATE_NOTATTACHED); + Port->Operations->attach(Port); + dev->State = USB_STATE_ATTACHED; + USB_DeviceHandleAttach(dev); +} + +void USBDevice::USB_Detach(USBPort* Port) +{ + XboxDeviceState* dev = Port->Dev; + + assert(dev != nullptr); + assert(dev->State != USB_STATE_NOTATTACHED); + Port->Operations->detach(Port); + dev->State = USB_STATE_NOTATTACHED; +} + +void USBDevice::USB_Wakeup(USBEndpoint* ep) +{ + XboxDeviceState* dev = ep->Dev; + + if (dev->RemoteWakeup && dev->Port && dev->Port->Operations->wakeup) { + dev->Port->Operations->wakeup(dev->Port); + } +} + +void USBDevice::USB_DeviceReset(XboxDeviceState* dev) +{ + if (dev == nullptr || !dev->Attached) { + return; + } + + dev->RemoteWakeup = 0; + dev->Addr = 0; + dev->State = USB_STATE_DEFAULT; + USB_DeviceHandleReset(dev); +} + +XboxDeviceState* USBDevice::USB_FindDevice(USBPort* Port, uint8_t Addr) +{ + XboxDeviceState* dev = Port->Dev; + + if (dev == nullptr || !dev->Attached || dev->State != USB_STATE_DEFAULT) { + return nullptr; + } + if (dev->Addr == Addr) { + return dev; + } + + return USB_DeviceFindDevice(dev, Addr); +} + +USBEndpoint* USBDevice::USB_GetEP(XboxDeviceState* Dev, int Pid, int Ep) +{ + USBEndpoint* eps; + + if (Dev == nullptr) { + return nullptr; + } + eps = (Pid == USB_TOKEN_IN) ? Dev->EP_in : Dev->EP_out; + if (Ep == 0) { + return &Dev->EP_ctl; // EndpointNumber zero represents the default control endpoint + } + assert(Pid == USB_TOKEN_IN || Pid == USB_TOKEN_OUT); + assert(Ep > 0 && Ep <= USB_MAX_ENDPOINTS); + + return eps + Ep - 1; +} + +void USBDevice::USB_PacketSetup(USBPacket* p, int Pid, USBEndpoint* Ep, uint64_t Id, + bool ShortNotOK, bool IntReq) +{ + assert(!USB_IsPacketInflight(p)); + assert(p->IoVec.IoVecStruct != nullptr); + p->Id = Id; + p->Pid = Pid; + p->Endpoint = Ep; + p->Status = USB_RET_SUCCESS; + p->ActualLength = 0; + p->ShortNotOK = ShortNotOK; + p->IntReq = IntReq; + IoVecReset(&p->IoVec); + p->State = USB_PACKET_SETUP; +} + +bool USBDevice::USB_IsPacketInflight(USBPacket* p) +{ + return (p->State == USB_PACKET_QUEUED || p->State == USB_PACKET_ASYNC); +} + +void USBDevice::USB_PacketAddBuffer(USBPacket* p, void* ptr, size_t len) +{ + IoVecAdd(&p->IoVec, ptr, len); +} + +void USBDevice::USB_HandlePacket(XboxDeviceState* dev, USBPacket* p) +{ + if (dev == nullptr) { + p->Status = USB_RET_NODEV; + return; + } + assert(dev == p->Endpoint->Dev); + assert(dev->State == USB_STATE_DEFAULT); + USB_PacketCheckState(p, USB_PACKET_SETUP); + assert(p->Endpoint != nullptr); + + // Submitting a new packet clears halt + if (p->Endpoint->Halted) { + assert(QTAILQ_EMPTY(&p->Endpoint->Queue)); + p->Endpoint->Halted = false; + } + + if (QTAILQ_EMPTY(&p->Endpoint->Queue)) { + USB_ProcessOne(p); + if (p->Status == USB_RET_ASYNC) { + // hcd drivers cannot handle async for isoc + assert(p->Endpoint->Type != USB_ENDPOINT_XFER_ISOC); + // using async for interrupt packets breaks migration + assert(p->Endpoint->Type != USB_ENDPOINT_XFER_INT); + p->State = USB_PACKET_ASYNC; + QTAILQ_INSERT_TAIL(&p->Endpoint->Queue, p, Queue); + } + else if (p->Status == USB_RET_ADD_TO_QUEUE) { + USB_QueueOne(p); + } + else { + // When pipelining is enabled usb-devices must always return async, + // otherwise packets can complete out of order! + assert(QTAILQ_EMPTY(&p->Endpoint->Queue)); + if (p->Status != USB_RET_NAK) { + p->State = USB_PACKET_COMPLETE; + } + } + } + else { + USB_QueueOne(p); + } +} + +void USBDevice::USB_QueueOne(USBPacket* p) +{ + p->State = USB_PACKET_QUEUED; + QTAILQ_INSERT_TAIL(&p->Endpoint->Queue, p, Queue); + p->Status = USB_RET_ASYNC; +} + +void USBDevice::USB_PacketCheckState(USBPacket* p, USBPacketState expected) +{ + if (p->State == expected) { + return; + } + + EmuLog(LOG_LEVEL::WARNING, "Packet state check failed!"); + assert(0); +} + +void USBDevice::USB_ProcessOne(USBPacket* p) +{ + XboxDeviceState* dev = p->Endpoint->Dev; + + // Handlers expect status to be initialized to USB_RET_SUCCESS, but it + // can be USB_RET_NAK here from a previous usb_process_one() call, + // or USB_RET_ASYNC from going through usb_queue_one(). + p->Status = USB_RET_SUCCESS; + + if (p->Endpoint->Num == 0) { + // Info: All devices must support endpoint zero. This is the endpoint which receives all of the devices control + // and status requests during enumeration and throughout the duration while the device is operational on the bus + switch (p->Pid) { + case USB_TOKEN_SETUP: { + USB_DoTokenSetup(dev, p); + break; + } + + case USB_TOKEN_IN: { + DoTokenIn(dev, p); + break; + } + + case USB_TOKEN_OUT: { + DoTokenOut(dev, p); + break; + } + + default: + p->Status = USB_RET_STALL; + } + } + else { + // data pipe + USB_DeviceHandleData(dev, p); + } +} + +void USBDevice::USB_DoTokenSetup(XboxDeviceState* s, USBPacket* p) +{ + int request, value, index; + + // From the USB 1.1 standard "Every Setup packet has eight bytes." + if (p->IoVec.Size != 8) { + p->Status = USB_RET_STALL; + return; + } + + // Info: name, offset, size, info (sizes are in bytes) + // bmRequestType, 1, 1, determines the direction of the request, type of request and designated recipient + // bRequest, 1, 1, determines the request being made + // wValue, 2, 2, it is used to pass a parameter to the device, specific to the request + // wIndex, 4, 2, often used in requests to specify an endpoint or an interface + // wLength, 6, 2, number of bytes to transfer if there is a data phase + // The wValue and wIndex fields allow parameters to be passed with the request + + USB_PacketCopy(p, s->SetupBuffer, p->IoVec.Size); + p->ActualLength = 0; + s->SetupLength = (s->SetupBuffer[7] << 8) | s->SetupBuffer[6]; + s->SetupIndex = 0; + + request = (s->SetupBuffer[0] << 8) | s->SetupBuffer[1]; + value = (s->SetupBuffer[3] << 8) | s->SetupBuffer[2]; + index = (s->SetupBuffer[5] << 8) | s->SetupBuffer[4]; + + if (s->SetupBuffer[0] & USB_DIR_IN) { + USB_DeviceHandleControl(s, p, request, value, index, s->SetupLength, s->DataBuffer); + if (p->Status == USB_RET_ASYNC) { + s->SetupState = SETUP_STATE_SETUP; + } + if (p->Status != USB_RET_SUCCESS) { + return; + } + if (p->ActualLength < s->SetupLength) { + s->SetupLength = p->ActualLength; + } + s->SetupState = SETUP_STATE_DATA; + } + else { + if (s->SetupLength > sizeof(s->DataBuffer)) { + EmuLog(LOG_LEVEL::DEBUG, "CTRL buffer too small (%d > %zu)", s->SetupLength, sizeof(s->DataBuffer)); + p->Status = USB_RET_STALL; + return; + } + if (s->SetupLength == 0) { + s->SetupState = SETUP_STATE_ACK; + } + else { + s->SetupState = SETUP_STATE_DATA; + } + } + + p->ActualLength = 8; +} + +void USBDevice::DoTokenIn(XboxDeviceState* s, USBPacket* p) +{ + int request, value, index; + + assert(p->Endpoint->Num == 0); + + request = (s->SetupBuffer[0] << 8) | s->SetupBuffer[1]; + value = (s->SetupBuffer[3] << 8) | s->SetupBuffer[2]; + index = (s->SetupBuffer[5] << 8) | s->SetupBuffer[4]; + + switch (s->SetupState) { + case SETUP_STATE_ACK: + if (!(s->SetupBuffer[0] & USB_DIR_IN)) { + USB_DeviceHandleControl(s, p, request, value, index, s->SetupLength, s->DataBuffer); + if (p->Status == USB_RET_ASYNC) { + return; + } + s->SetupState = SETUP_STATE_IDLE; + p->ActualLength = 0; + } + break; + + case SETUP_STATE_DATA: + if (s->SetupBuffer[0] & USB_DIR_IN) { + size_t len = s->SetupLength - s->SetupIndex; + if (len > p->IoVec.Size) { + len = p->IoVec.Size; + } + USB_PacketCopy(p, s->DataBuffer + s->SetupIndex, len); + s->SetupIndex += len; + if (s->SetupIndex >= s->SetupLength) { + s->SetupState = SETUP_STATE_ACK; + } + return; + } + s->SetupState = SETUP_STATE_IDLE; + p->Status = USB_RET_STALL; + break; + + default: + p->Status = USB_RET_STALL; + } +} + +void USBDevice::DoTokenOut(XboxDeviceState* s, USBPacket* p) +{ + assert(p->Endpoint->Num == 0); + + switch (s->SetupState) { + case SETUP_STATE_ACK: + if (s->SetupBuffer[0] & USB_DIR_IN) { + s->SetupState = SETUP_STATE_IDLE; + // transfer OK + } + else { + // ignore additional output + } + break; + + case SETUP_STATE_DATA: + if (!(s->SetupBuffer[0] & USB_DIR_IN)) { + size_t len = s->SetupLength - s->SetupIndex; + if (len > p->IoVec.Size) { + len = p->IoVec.Size; + } + USB_PacketCopy(p, s->DataBuffer + s->SetupIndex, len); + s->SetupIndex += len; + if (s->SetupIndex >= s->SetupLength) { + s->SetupState = SETUP_STATE_ACK; + } + return; + } + s->SetupState = SETUP_STATE_IDLE; + p->Status = USB_RET_STALL; + break; + + default: + p->Status = USB_RET_STALL; + } +} + +void USBDevice::USB_PacketCopy(USBPacket* p, void* ptr, size_t bytes) +{ + IOVector* iov = &p->IoVec; + + assert(p->ActualLength >= 0); + assert(p->ActualLength + bytes <= iov->Size); + switch (p->Pid) { + case USB_TOKEN_SETUP: + case USB_TOKEN_OUT: + IoVecTobuffer(iov->IoVecStruct, iov->IoVecNumber, p->ActualLength, ptr, bytes); + break; + case USB_TOKEN_IN: + IoVecFromBuffer(iov->IoVecStruct, iov->IoVecNumber, p->ActualLength, ptr, bytes); + break; + default: + CxbxKrnlCleanup("%s has an invalid pid: %x\n", __func__, p->Pid); + } + p->ActualLength += bytes; +} + +int USBDevice::USB_DeviceInit(XboxDeviceState* dev) +{ + USBDeviceClass* klass = dev->klass; + if (klass->init) { + return klass->init(dev); + } + + return 0; +} + +XboxDeviceState* USBDevice::USB_DeviceFindDevice(XboxDeviceState* dev, uint8_t Addr) +{ + USBDeviceClass* klass = dev->klass; + if (klass->find_device) { + return klass->find_device(dev, Addr); + } + + return nullptr; +} + +void USBDevice::USB_DeviceCancelPacket(XboxDeviceState* dev, USBPacket* p) +{ + USBDeviceClass* klass = dev->klass; + if (klass->cancel_packet) { + klass->cancel_packet(dev, p); + } +} + +void USBDevice::USB_DeviceHandleDestroy(XboxDeviceState* dev) +{ + USBDeviceClass* klass = dev->klass; + if (klass->handle_destroy) { + klass->handle_destroy(); + } +} + +void USBDevice::USB_DeviceHandleAttach(XboxDeviceState* dev) +{ + USBDeviceClass* klass = dev->klass; + if (klass->handle_attach) { + klass->handle_attach(dev); + } +} + +void USBDevice::USB_DeviceHandleReset(XboxDeviceState* dev) +{ + USBDeviceClass* klass = dev->klass; + if (klass->handle_reset) { + klass->handle_reset(dev); + } +} + +void USBDevice::USB_DeviceHandleControl(XboxDeviceState* dev, USBPacket* p, int request, int value, int index, int length, uint8_t* data) +{ + USBDeviceClass* klass = dev->klass; + if (klass->handle_control) { + klass->handle_control(dev, p, request, value, index, length, data); + } +} + +void USBDevice::USB_DeviceHandleData(XboxDeviceState* dev, USBPacket* p) +{ + USBDeviceClass* klass = dev->klass; + if (klass->handle_data) { + klass->handle_data(dev, p); + } +} + +void USBDevice::USB_DeviceSetInterface(XboxDeviceState* dev, int iface, int alt_old, int alt_new) +{ + USBDeviceClass* klass = dev->klass; + if (klass->set_interface) { + klass->set_interface(dev, iface, alt_old, alt_new); + } +} + +void USBDevice::USB_DeviceFlushEPqueue(XboxDeviceState* dev, USBEndpoint* ep) +{ + USBDeviceClass *klass = dev->klass; + if (klass->flush_ep_queue) { + klass->flush_ep_queue(dev, ep); + } +} + +void USBDevice::USB_DeviceEPstopped(XboxDeviceState* dev, USBEndpoint* EP) +{ + USBDeviceClass* klass = dev->klass; + if (klass->ep_stopped) { + klass->ep_stopped(dev, EP); + } +} + +void USBDevice::USB_CancelPacket(USBPacket* p) +{ + bool callback = (p->State == USB_PACKET_ASYNC); + assert(USB_IsPacketInflight(p)); + p->State = USB_PACKET_CANCELED; + QTAILQ_REMOVE(&p->Endpoint->Queue, p, Queue); + if (callback) { + USB_DeviceCancelPacket(p->Endpoint->Dev, p); + } +} + +void USBDevice::USB_EPsetType(XboxDeviceState* dev, int pid, int ep, uint8_t type) +{ + USBEndpoint* uep = USB_GetEP(dev, pid, ep); + uep->Type = type; +} + +void USBDevice::USB_EPsetIfnum(XboxDeviceState* dev, int pid, int ep, uint8_t ifnum) +{ + USBEndpoint* uep = USB_GetEP(dev, pid, ep); + uep->IfNum = ifnum; +} + +void USBDevice::USB_EPsetMaxPacketSize(XboxDeviceState* dev, int pid, int ep, uint16_t raw) +{ + USBEndpoint* uep = USB_GetEP(dev, pid, ep); + + // Dropped from QEMU the calculation max_packet_size = size * microframes since that's only true + // for high speed (usb 2.0) devices + + uep->MaxPacketSize = raw & 0x7FF; +} + +void USBDevice::USB_PortLocation(USBPort* downstream, USBPort* upstream, int portnr) +{ + if (upstream) { + downstream->Path = upstream->Path + '.' + std::to_string(portnr); + } + else { + downstream->Path = std::to_string(portnr); + } +} + +void USBDevice::USB_DeviceAttach(XboxDeviceState* dev) +{ + USBPort* port = dev->Port; + + assert(port != nullptr); + assert(!dev->Attached); + + dev->Attached++; + USB_Attach(port); +} + +void USBDevice::USB_DeviceDetach(XboxDeviceState* dev) +{ + USBPort* port = dev->Port; + + assert(port != nullptr); + assert(dev->Attached); + + USB_Detach(port); + dev->Attached--; +} + +void USBDevice::USB_EpInit(XboxDeviceState* dev) +{ + USB_EpReset(dev); + QTAILQ_INIT(&dev->EP_ctl.Queue); + for (int ep = 0; ep < USB_MAX_ENDPOINTS; ep++) { + QTAILQ_INIT(&dev->EP_in[ep].Queue); + QTAILQ_INIT(&dev->EP_out[ep].Queue); + } +} + +void USBDevice::USB_EpReset(XboxDeviceState* dev) +{ + dev->EP_ctl.Num = 0; + dev->EP_ctl.Type = USB_ENDPOINT_XFER_CONTROL; + dev->EP_ctl.IfNum = 0; + dev->EP_ctl.MaxPacketSize = 64; + dev->EP_ctl.Dev = dev; + for (int ep = 0; ep < USB_MAX_ENDPOINTS; ep++) { + dev->EP_in[ep].Num = ep + 1; + dev->EP_out[ep].Num = ep + 1; + dev->EP_in[ep].Type = USB_ENDPOINT_XFER_INVALID; + dev->EP_out[ep].Type = USB_ENDPOINT_XFER_INVALID; + dev->EP_in[ep].IfNum = USB_INTERFACE_INVALID; + dev->EP_out[ep].IfNum = USB_INTERFACE_INVALID; + dev->EP_in[ep].MaxPacketSize = 0; + dev->EP_out[ep].MaxPacketSize = 0; + dev->EP_in[ep].Dev = dev; + dev->EP_out[ep].Dev = dev; + } +} + +/* +* From QEMU: +* This function creates a serial number for a usb device. +* The serial number should: +* (a) Be unique within the emulator. +* (b) Be constant, so you don't get a new one each +* time the guest is started. +* So we are using the physical location to generate a serial number +* from it. It has three pieces: First a fixed, device-specific +* prefix. Second the device path of the host controller (which is +* the pci address in most cases). Third the physical port path. +* Results in serial numbers like this: "314159-0000:00:1d.7-3". +*/ +void USBDevice::USB_CreateSerial(XboxDeviceState* dev, std::string&& str) +{ + const USBDesc* desc = USBDesc_GetUsbDeviceDesc(dev); + int index = desc->id.iSerialNumber; + + assert(index != 0 && str.empty() == false); + str += '-'; + str += m_PciPath; + str += ('-' + dev->Port->Path); + + USBDesc_SetString(dev, index, std::move(str)); +} + +const USBDesc* USBDevice::USBDesc_GetUsbDeviceDesc(XboxDeviceState* dev) +{ + USBDeviceClass* klass = dev->klass; + if (dev->UsbDesc) { + return dev->UsbDesc; + } + return klass->usb_desc; +} + +void USBDevice::USBDesc_Init(XboxDeviceState* dev) +{ + const USBDesc* desc = USBDesc_GetUsbDeviceDesc(dev); + + assert(desc != nullptr); + dev->Speed = USB_SPEED_FULL; + dev->SpeedMask = 0; + if (desc->full) { + dev->SpeedMask |= USB_SPEED_MASK_FULL; + } + USBDesc_SetDefaults(dev); +} + +void USBDevice::USBDesc_SetDefaults(XboxDeviceState* dev) +{ + const USBDesc *desc = USBDesc_GetUsbDeviceDesc(dev); + + assert(desc != nullptr); + switch (dev->Speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: { + dev->Device = desc->full; + break; + } + default: + EmuLog(LOG_LEVEL::WARNING, "Unknown speed parameter %d set in %s", dev->Speed, dev->ProductDesc.c_str()); + } + USBDesc_SetConfig(dev, 0); +} + +int USBDevice::USBDesc_SetConfig(XboxDeviceState* dev, int value) +{ + int i; + + if (value == 0) { // default configuration + dev->Configuration = 0; + dev->NumInterfaces = 0; + dev->Config = nullptr; + } + else { + for (i = 0; i < dev->Device->bNumConfigurations; i++) { // select the configuration specified + if (dev->Device->confs[i].bConfigurationValue == value) { + dev->Configuration = value; + dev->NumInterfaces = dev->Device->confs[i].bNumInterfaces; + dev->Config = dev->Device->confs + i; + assert(dev->NumInterfaces <= USB_MAX_INTERFACES); + } + } + if (i < dev->Device->bNumConfigurations) { + return -1; + } + } + + for (i = 0; i < dev->NumInterfaces; i++) { // setup all interfaces for the selected configuration + USBDesc_SetInterface(dev, i, 0); + } + for (; i < USB_MAX_INTERFACES; i++) { // null the remaining interfaces + dev->AltSetting[i] = 0; + dev->Ifaces[i] = nullptr; + } + + return 0; +} + +int USBDevice::USBDesc_SetInterface(XboxDeviceState* dev, int index, int value) +{ + const USBDescIface* iface; + int old; + + iface = USBDesc_FindInterface(dev, index, value); + if (iface == nullptr) { + return -1; + } + + old = dev->AltSetting[index]; + dev->AltSetting[index] = value; + dev->Ifaces[index] = iface; + USBDesc_EpInit(dev); + + if (old != value) { + USB_DeviceSetInterface(dev, index, old, value); + } + return 0; +} + +const USBDescIface* USBDevice::USBDesc_FindInterface(XboxDeviceState* dev, int nif, int alt) +{ + const USBDescIface* iface; + int i; + + if (!dev->Config) { // no configuration descriptor here, nothing to search + return nullptr; + } + for (i = 0; i < dev->Config->nif; i++) { // find the desired interface + iface = &dev->Config->ifs[i]; + if (iface->bInterfaceNumber == nif && + iface->bAlternateSetting == alt) { + return iface; + } + } + return nullptr; // not found +} + +void USBDevice::USBDesc_EpInit(XboxDeviceState* dev) +{ + const USBDescIface *iface; + int i, e, pid, ep; + + USB_EpInit(dev); // reset endpoints + for (i = 0; i < dev->NumInterfaces; i++) { + iface = dev->Ifaces[i]; + if (iface == nullptr) { + continue; + } + for (e = 0; e < iface->bNumEndpoints; e++) { + // From the USB 1.1 standard: + // "bEndpointAddress: + // Bit 3...0: The endpoint number + // Bit 6...4: Reserved, reset to zero + // Bit 7: Direction -> 0 = OUT endpoint, 1 = IN endpoint + // bmAttributes: + // Bit 1..0: Transfer Type + // 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. All other bits are reserved" + pid = (iface->eps[e].bEndpointAddress & USB_DIR_IN) ? USB_TOKEN_IN : USB_TOKEN_OUT; + ep = iface->eps[e].bEndpointAddress & 0xF; + USB_EPsetType(dev, pid, ep, iface->eps[e].bmAttributes & 0x03); + USB_EPsetIfnum(dev, pid, ep, iface->bInterfaceNumber); + USB_EPsetMaxPacketSize(dev, pid, ep, iface->eps[e].wMaxPacketSize); + } + } +} + +int USBDevice::USBDesc_HandleControl(XboxDeviceState* dev, USBPacket *p, + int request, int value, int index, int length, uint8_t* data) +{ + const USBDesc* desc = USBDesc_GetUsbDeviceDesc(dev); + int ret = -1; + + assert(desc != nullptr); + switch (request) { + case DeviceOutRequest | USB_REQ_SET_ADDRESS: { + // From the USB 1.1 standard: "This request sets the device address for all future device accesses. + // The wValue field specifies the device address to use for all subsequent accesses" + dev->Addr = value; + EmuLog(LOG_LEVEL::DEBUG, "Address 0x%X set for device %s", dev->Addr, dev->ProductDesc.c_str()); + ret = 0; + break; + } + + case DeviceRequest | USB_REQ_GET_DESCRIPTOR: { + // From the USB 1.1 standard: "This request returns the specified descriptor if the descriptor exists. + // The wValue field specifies the descriptor type in the high byte and the descriptor index in the low byte. + // The wIndex field specifies the Language ID for string descriptors or is reset to zero for other descriptors" + ret = USBDesc_HandleStandardGetDescriptor(dev, p, value, data, length); + break; + } + + case DeviceRequest | USB_REQ_GET_CONFIGURATION: { + // From the USB 1.1 standard: "This request returns the current device configuration value. + // If the returned value is zero, the device is not configured" + data[0] = dev->Config ? dev->Config->bConfigurationValue : 0; + p->ActualLength = 1; + ret = 0; + break; + } + + case DeviceOutRequest | USB_REQ_SET_CONFIGURATION: { + // From the USB 1.1 standard: "This request sets the device configuration. The lower byte of the wValue field specifies the desired configuration. + // This configuration value must be zero or match a configuration value from a configuration descriptor" + ret = USBDesc_SetConfig(dev, value); + EmuLog(LOG_LEVEL::DEBUG, "Received standard SetConfiguration() request for device at address 0x%X. Configuration selected is %d and returned %d", + dev->Addr, value, ret); + break; + } + + case DeviceRequest | USB_REQ_GET_STATUS: { + // From the USB 1.1 standard: "This request returns the status for the specified recipient. The Recipient bits of the bmRequestType field + // specify the desired recipient. The data returned is the current status of the specified recipient." + // From QEMU: + /* Default state: Device behavior when this request is received while + * the device is in the Default state is not specified. + * We return the same value that a configured device would return if + * it used the first configuration. */ + const USBDescConfig* config = dev->Config ? dev->Config : &dev->Device->confs[0]; + data[0] = 0; + if (config->bmAttributes & 0x40) { + data[0] |= 1 << USB_DEVICE_SELF_POWERED; + } + if (dev->RemoteWakeup) { + data[0] |= 1 << USB_DEVICE_REMOTE_WAKEUP; + } + data[1] = 0x00; + p->ActualLength = 2; + ret = 0; + break; + } + + case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: { + // From the USB 1.1 standard: "This request is used to clear or disable a specific feature. + // Feature selector values in wValue must be appropriate to the recipient" + if (value == USB_DEVICE_REMOTE_WAKEUP) { + dev->RemoteWakeup = 0; + ret = 0; + } + EmuLog(LOG_LEVEL::DEBUG, "Received standard ClearFeature() request for device at address 0x%X. Feature selected is %d and returned %d", + dev->Addr, value, ret); + break; + } + + case DeviceOutRequest | USB_REQ_SET_FEATURE: { + // From the USB 1.1 standard: "This request is used to set or enable a specific feature. + // Feature selector values in wValue must be appropriate to the recipient" + if (value == USB_DEVICE_REMOTE_WAKEUP) { + dev->RemoteWakeup = 1; + ret = 0; + } + EmuLog(LOG_LEVEL::DEBUG, "Received standard SetFeature() request for device at address 0x%X. Feature selected is %d and returned %d", + dev->Addr, value, ret); + break; + } + + case InterfaceRequest | USB_REQ_GET_INTERFACE: { + // From the USB 1.1 standard: "This request returns the selected alternate setting for the specified interface. + // wValue = Zero; wIndex = Interface" + if (index < 0 || index >= dev->NumInterfaces) { + break; + } + data[0] = dev->AltSetting[index]; + p->ActualLength = 1; + ret = 0; + break; + } + + case InterfaceOutRequest | USB_REQ_SET_INTERFACE: { + // From the USB 1.1 standard: "This request allows the host to select an alternate setting for the specified interface" + // wValue = Alternative Setting; wIndex = Interface + ret = USBDesc_SetInterface(dev, index, value); + EmuLog(LOG_LEVEL::DEBUG, "Received standard SetInterface() request for device at address 0x%X. Interface selected is %d, Alternative Setting is %d and returned %d", dev->Addr, index, value, ret); + break; + } + + default: + break; + } + return ret; +} + +int USBDevice::USBDesc_HandleStandardGetDescriptor(XboxDeviceState* dev, USBPacket* p, + int value, uint8_t* dest, size_t len) +{ + const USBDesc* desc = USBDesc_GetUsbDeviceDesc(dev); + uint8_t buf[256]; + uint8_t type = value >> 8; // recover descriptor type from wValue + uint8_t index = value & 0xFF; // recover descriptor index from wValue + int ret = -1; + int flags = 0; + + // Dropped from QEMU bcdUSB check for usb 3.0 devices + + // From the USB 1.1 standard: "The standard request to a device supports three types of descriptors: DEVICE, CONFIGURATION, and STRING." + + switch (type) { + case USB_DT_DEVICE: { + ret = USB_ReadDeviceDesc(&desc->id, dev->Device, buf, sizeof(buf)); + EmuLog(LOG_LEVEL::DEBUG, "Read operation of device descriptor of device 0x%X returns %d", dev->Addr, ret); + break; + } + + case USB_DT_CONFIG: { + if (index < dev->Device->bNumConfigurations) { + ret = USB_ReadConfigurationDesc(dev->Device->confs + index, flags, buf, sizeof(buf)); + } + EmuLog(LOG_LEVEL::DEBUG, "Read operation of configuration descriptor %d of device 0x%X returns %d", index, dev->Addr, ret); + break; + } + + case USB_DT_STRING: { + ret = USB_ReadStringDesc(dev, index, buf, sizeof(buf)); + EmuLog(LOG_LEVEL::DEBUG, "Read operation of string descriptor %d of device 0x%X returns %d", index, dev->Addr, ret); + break; + } + + // Dropped from QEMU descriptor types USB_DT_DEVICE_QUALIFIER (6), USB_DT_OTHER_SPEED_CONFIG (7) -> usb 2.0 only and reserved in usb 3.0, + // USB_DT_BOS (15) and USB_DT_DEBUG (10) -> usb 3.0 only + + default: + EmuLog(LOG_LEVEL::WARNING, "%s has a device address %d of unknown type %d (len %zd)", __func__, dev->Addr, type, len); + break; + } + + if (ret > 0) { + if ((size_t)ret > len) { + ret = len; + } + std::memcpy(dest, buf, ret); + p->ActualLength = ret; + ret = 0; + } + return ret; +} + +int USBDevice::USB_ReadDeviceDesc(const USBDescID* id, const USBDescDevice* dev, uint8_t* dest, size_t len) +{ + uint8_t bLength = 0x12; // a device descriptor is 18 bytes large + USBDescriptor* d = reinterpret_cast(dest); + + if (len < bLength) { + return -1; + } + + d->bLength = bLength; + d->bDescriptorType = USB_DT_DEVICE; + + d->u.device.bcdUSB_lo = GET_WORD_LOW(dev->bcdUSB); + d->u.device.bcdUSB_hi = GET_WORD_HIGH(dev->bcdUSB); + d->u.device.bDeviceClass = dev->bDeviceClass; + d->u.device.bDeviceSubClass = dev->bDeviceSubClass; + d->u.device.bDeviceProtocol = dev->bDeviceProtocol; + d->u.device.bMaxPacketSize0 = dev->bMaxPacketSize0; + + d->u.device.idVendor_lo = GET_WORD_LOW(id->idVendor); + d->u.device.idVendor_hi = GET_WORD_HIGH(id->idVendor); + d->u.device.idProduct_lo = GET_WORD_LOW(id->idProduct); + d->u.device.idProduct_hi = GET_WORD_HIGH(id->idProduct); + d->u.device.bcdDevice_lo = GET_WORD_LOW(id->bcdDevice); + d->u.device.bcdDevice_hi = GET_WORD_HIGH(id->bcdDevice); + d->u.device.iManufacturer = id->iManufacturer; + d->u.device.iProduct = id->iProduct; + d->u.device.iSerialNumber = id->iSerialNumber; + + d->u.device.bNumConfigurations = dev->bNumConfigurations; + + return bLength; +} + +int USBDevice::USB_ReadConfigurationDesc(const USBDescConfig* conf, int flags, uint8_t* dest, size_t len) +{ + uint8_t bLength = 0x09; // a configuration descriptor is 9 bytes large + uint16_t wTotalLength = 0; + USBDescriptor* d = reinterpret_cast(dest); + int i, rc; + + if (len < bLength) { + return -1; + } + + // From the USB 1.1 standard: "A request for a configuration descriptor returns the configuration descriptor, all interface + // descriptors, and endpoint descriptors for all of the interfaces in a single request." + + d->bLength = bLength; + d->bDescriptorType = USB_DT_CONFIG; + + d->u.config.bNumInterfaces = conf->bNumInterfaces; + d->u.config.bConfigurationValue = conf->bConfigurationValue; + d->u.config.iConfiguration = conf->iConfiguration; + d->u.config.bmAttributes = conf->bmAttributes; + d->u.config.bMaxPower = conf->bMaxPower; + wTotalLength += bLength; + + for (i = 0; i < conf->nif; i++) { + rc = USB_ReadInterfaceDesc(conf->ifs + i, flags, dest + wTotalLength, len - wTotalLength); + if (rc < 0) { + return rc; + } + wTotalLength += rc; + } + + d->u.config.wTotalLength_lo = GET_WORD_LOW(wTotalLength); + d->u.config.wTotalLength_hi = GET_WORD_HIGH(wTotalLength); + return wTotalLength; +} + +int USBDevice::USB_ReadInterfaceDesc(const USBDescIface* iface, int flags, uint8_t* dest, size_t len) +{ + uint8_t bLength = 0x09; // an interface descriptor is 9 bytes large + int i, rc, pos = 0; + USBDescriptor* d = reinterpret_cast(dest); + + if (len < bLength) { + return -1; + } + + // From the USB 1.1 standard: "The first interface descriptor follows the configuration descriptor. + // The endpoint descriptors for the first interface follow the first interface descriptor. + // If there are additional interfaces, their interface descriptor and endpoint descriptors + // follow the first interfaces endpoint descriptors. Class-specific and/or vendor-specific + // descriptors follow the standard descriptors they extend or modify." + + d->bLength = bLength; + d->bDescriptorType = USB_DT_INTERFACE; + + d->u.iface.bInterfaceNumber = iface->bInterfaceNumber; + d->u.iface.bAlternateSetting = iface->bAlternateSetting; + d->u.iface.bNumEndpoints = iface->bNumEndpoints; + d->u.iface.bInterfaceClass = iface->bInterfaceClass; + d->u.iface.bInterfaceSubClass = iface->bInterfaceSubClass; + d->u.iface.bInterfaceProtocol = iface->bInterfaceProtocol; + d->u.iface.iInterface = iface->iInterface; + pos += bLength; + + for (i = 0; i < iface->ndesc; i++) { + rc = USB_ReadOtherDesc(iface->descs + i, dest + pos, len - pos); + if (rc < 0) { + return rc; + } + pos += rc; + } + + for (i = 0; i < iface->bNumEndpoints; i++) { + rc = USB_ReadEndpointDesc(iface->eps + i, flags, dest + pos, len - pos); + if (rc < 0) { + return rc; + } + pos += rc; + } + + return pos; +} + +size_t USBDevice::USB_ReadOtherDesc(const USBDescOther* desc, uint8_t* dest, size_t len) +{ + size_t bLength = desc->length ? desc->length : desc->data[0]; + + if (len < bLength) { + return -1; + } + + std::memcpy(dest, desc->data, bLength); + return bLength; +} + +int USBDevice::USB_ReadEndpointDesc(const USBDescEndpoint* ep, int flags, uint8_t* dest, size_t len) +{ + size_t bLength = ep->is_audio ? 0x09 : 0x07; // an endpoint descriptor is 7 bytes large (or 9 if it is an audio device) + size_t extralen = ep->extra ? ep->extra[0] : 0; + USBDescriptor* d = reinterpret_cast(dest); + + if (len < bLength + extralen) { + return -1; + } + + d->bLength = static_cast(bLength); + d->bDescriptorType = USB_DT_ENDPOINT; + + d->u.endpoint.bEndpointAddress = ep->bEndpointAddress; + d->u.endpoint.bmAttributes = ep->bmAttributes; + d->u.endpoint.wMaxPacketSize_lo = GET_WORD_LOW(ep->wMaxPacketSize); + d->u.endpoint.wMaxPacketSize_hi = GET_WORD_HIGH(ep->wMaxPacketSize); + d->u.endpoint.bInterval = ep->bInterval; + if (ep->is_audio) { + d->u.endpoint.bRefresh = ep->bRefresh; + d->u.endpoint.bSynchAddress = ep->bSynchAddress; + } + + // Dropped from QEMU the reading of the SuperSpeed Endpoint Companion descriptors since those are usb 3.0 specific + + if (ep->extra) { + std::memcpy(dest + bLength, ep->extra, extralen); + } + + return bLength + extralen; +} + +int USBDevice::USB_ReadStringDesc(XboxDeviceState* dev, int index, uint8_t* dest, size_t len) +{ + size_t bLength, i; + unsigned int pos; + const char* str; + + if (len < 4) { + return -1; + } + + // From the USB 1.1 standard: "String index zero for all languages returns a string descriptor + // that contains an array of two-byte LANGID codes supported by the device" + + if (index == 0) { + /* language ids */ + dest[0] = 4; + dest[1] = USB_DT_STRING; + dest[2] = 0x09; + dest[3] = 0x04; // we only support English (United States) + return 4; + } + + str = USBDesc_GetString(dev, index); + if (str == nullptr) { + return 0; + } + + // From the USB 1.1 standard: "The UNICODE string descriptor is not NULL-terminated. The string length is + // computed by subtracting two from the value of the first byte of the descriptor" + + bLength = std::strlen(str) * 2 + 2; + dest[0] = bLength & 0xFF; + dest[1] = USB_DT_STRING; + i = 0; pos = 2; + while (pos + 1 < bLength && pos + 1 < len) { + dest[pos++] = str[i++]; + dest[pos++] = 0; + } + return pos; +} + +void USBDevice::USBDesc_SetString(XboxDeviceState* dev, int index, std::string&& str) +{ + USBDescString* s; + + QLIST_FOREACH(s, &dev->Strings, next) { + if (s->index == index) { + break; + } + } + + if (s == nullptr) { + s = new USBDescString(); + s->index = index; + QLIST_INSERT_HEAD(&dev->Strings, s, next); + } + + s->str = str; +} + +const char* USBDevice::USBDesc_GetString(XboxDeviceState* dev, int index) +{ + USBDescString* s; + + QLIST_FOREACH(s, &dev->Strings, next) { + if (s->index == index) { + return s->str.c_str(); + } + } + + return nullptr; +} + diff --git a/src/devices/usb/USBDevice.h b/src/devices/usb/USBDevice.h new file mode 100644 index 000000000..30d826e52 --- /dev/null +++ b/src/devices/usb/USBDevice.h @@ -0,0 +1,187 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef USBDEVICE_H_ +#define USBDEVICE_H_ + +#include "..\PCIDevice.h" +#include "UsbCommon.h" +#include + + +// Forward declare OHCI class for m_HostController pointer +class OHCI; + +/* Helper class which provides various functionality to both OHCI and usb device classes */ +class USBDevice : public PCIDevice { + public: + // constructor + USBDevice() {} + // destructor + ~USBDevice() {} + + // PCI Device functions + void Init(); + void Reset() {} + + uint32_t IORead(int barIndex, uint32_t port, unsigned size) { return 0; } + void IOWrite(int barIndex, uint32_t port, uint32_t value, unsigned size) {} + uint32_t MMIORead(int barIndex, uint32_t addr, unsigned size); + void MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size); + + + // USBDevice-specific functions/variables + // pointer to the host controller this device refers to + OHCI* m_HostController; + // PCI path of this usb device + const char* m_PciPath; + // free usb ports on this device (hubs included) + std::vector m_FreePorts; + + // register a port with the HC + void USB_RegisterPort(USBPort* Port, int Index, int SpeedMask, USBPortOps* Ops); + // free a port with the HC + void USB_UnregisterPort(USBPort* Port); + // reset a usb port + void USB_PortReset(USBPort* Port); + // update device status during an attach + void USB_DeviceAttach(XboxDeviceState* dev); + // update device status during an detach + void USB_DeviceDetach(XboxDeviceState* dev); + // update port status when a device is attached + void USB_Attach(USBPort* Port); + // update port status when a device is detached + void USB_Detach(USBPort* Port); + // update port status when a device is detached + void USB_Wakeup(USBEndpoint* ep); + // reset a device + void USB_DeviceReset(XboxDeviceState* Dev); + // find the device connected to the supplied port and address + XboxDeviceState* USB_FindDevice(USBPort* Port, uint8_t Addr); + // find the requested endpoint in the supplied device + USBEndpoint* USB_GetEP(XboxDeviceState* Dev, int Pid, int Ep); + // setup a packet for transfer + void USB_PacketSetup(USBPacket* p, int Pid, USBEndpoint* Ep, uint64_t Id, + bool ShortNotOK, bool IntReq); + // check if the state of the packet is queued or async + bool USB_IsPacketInflight(USBPacket* p); + // append the user buffer to the packet + void USB_PacketAddBuffer(USBPacket* p, void* ptr, size_t len); + // transfer and process the packet + void USB_HandlePacket(XboxDeviceState* dev, USBPacket* p); + // check if the packet has the expected state and assert if not + void USB_PacketCheckState(USBPacket* p, USBPacketState expected); + // process the packet + void USB_ProcessOne(USBPacket* p); + // process a setup token + void USB_DoTokenSetup(XboxDeviceState* s, USBPacket* p); + // process an input token + void DoTokenIn(XboxDeviceState* s, USBPacket* p); + // process an output token + void DoTokenOut(XboxDeviceState* s, USBPacket* p); + // copy the packet data to the buffer pointed to by ptr + void USB_PacketCopy(USBPacket* p, void* ptr, size_t bytes); + // Cancel an active packet. The packed must have been deferred by + // returning USB_RET_ASYNC from handle_packet, and not yet completed + void USB_CancelPacket(USBPacket* p); + // queue a packet to an endpoint + void USB_QueueOne(USBPacket* p); + // call usb class init function + int USB_DeviceInit(XboxDeviceState* dev); + // call usb class find_device function + XboxDeviceState* USB_DeviceFindDevice(XboxDeviceState* Dev, uint8_t Addr); + // call usb class cancel_packet function + void USB_DeviceCancelPacket(XboxDeviceState* dev, USBPacket* p); + // call usb class handle_destroy function + void USB_DeviceHandleDestroy(XboxDeviceState* dev); + // call usb class handle_attach function + void USB_DeviceHandleAttach(XboxDeviceState* dev); + // call usb class handle_reset function + void USB_DeviceHandleReset(XboxDeviceState* dev); + // call usb class handle_control function + void USB_DeviceHandleControl(XboxDeviceState* dev, USBPacket* p, int request, int value, int index, int length, uint8_t* data); + // call usb class handle_data function + void USB_DeviceHandleData(XboxDeviceState* dev, USBPacket* p); + // call usb class set_interface function + void USB_DeviceSetInterface(XboxDeviceState* dev, int iface, int alt_old, int alt_new); + // call usb class flush_ep_queue function + void USB_DeviceFlushEPqueue(XboxDeviceState* dev, USBEndpoint* ep); + // call usb class ep_stopped function + void USB_DeviceEPstopped(XboxDeviceState* Dev, USBEndpoint* Ep); + // set the type of the endpoint + void USB_EPsetType(XboxDeviceState* dev, int pid, int ep, uint8_t type); + // set the interface number of the endpoint + void USB_EPsetIfnum(XboxDeviceState* dev, int pid, int ep, uint8_t ifnum); + // set the maximum packet size parameter of the endpoint + void USB_EPsetMaxPacketSize(XboxDeviceState* dev, int pid, int ep, uint16_t raw); + // assign port numbers (also for hubs) + void USB_PortLocation(USBPort* downstream, USBPort* upstream, int portnr); + // initialize the endpoints of this peripheral + void USB_EpInit(XboxDeviceState* dev); + // reset all endpoints of this peripheral + void USB_EpReset(XboxDeviceState* dev); + // create a serial number for the device + void USB_CreateSerial(XboxDeviceState* dev, std::string&& str); + // start descriptors initialization + void USBDesc_Init(XboxDeviceState* dev); + // get device descriptor + const USBDesc* USBDesc_GetUsbDeviceDesc(XboxDeviceState* dev); + // set the descriptors to use for this device + void USBDesc_SetDefaults(XboxDeviceState* dev); + // set the configuration to use + int USBDesc_SetConfig(XboxDeviceState* dev, int value); + // set the interface to use + int USBDesc_SetInterface(XboxDeviceState* dev, int index, int value); + // find the interface to use + const USBDescIface* USBDesc_FindInterface(XboxDeviceState* dev, int nif, int alt); + // setup endpoints and their descriptors + void USBDesc_EpInit(XboxDeviceState* dev); + // handle standard control request + int USBDesc_HandleControl(XboxDeviceState *dev, USBPacket *p, + int request, int value, int index, int length, uint8_t *data); + // handle standard GetDescriptor() request + int USBDesc_HandleStandardGetDescriptor(XboxDeviceState* dev, USBPacket* p, + int value, uint8_t* dest, size_t len); + // return the binary rapresentation of a device descriptor + int USB_ReadDeviceDesc(const USBDescID* id, const USBDescDevice* dev, uint8_t* dest, size_t len); + // return the binary rapresentation of configuration descriptors + int USB_ReadConfigurationDesc(const USBDescConfig* conf, int flags, uint8_t* dest, size_t len); + // return the binary rapresentation of interface descriptors + int USB_ReadInterfaceDesc(const USBDescIface* iface, int flags, uint8_t* dest, size_t len); + // return the binary rapresentation of class-specific descriptors + size_t USB_ReadOtherDesc(const USBDescOther* desc, uint8_t* dest, size_t len); + // return the binary rapresentation of endpoint descriptors + int USB_ReadEndpointDesc(const USBDescEndpoint* ep, int flags, uint8_t* dest, size_t len); + // return the binary rapresentation of string descriptors + int USB_ReadStringDesc(XboxDeviceState* dev, int index, uint8_t* dest, size_t len); + // set a string in the string descriptor with the supplied index + void USBDesc_SetString(XboxDeviceState* dev, int index, std::string&& str); + // get a string in the string descriptor with the supplied index + const char* USBDesc_GetString(XboxDeviceState* dev, int index); +}; + +#endif diff --git a/src/devices/usb/UsbCommon.h b/src/devices/usb/UsbCommon.h new file mode 100644 index 000000000..5f802caa6 --- /dev/null +++ b/src/devices/usb/UsbCommon.h @@ -0,0 +1,465 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: some these functions are from the QEMU usb api used in XQEMU (GPLv2) +// https://xqemu.com/ + +/* +* QEMU USB API +* +* Copyright (c) 2005 Fabrice Bellard +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +#ifndef USBCOMMON_H_ +#define USBCOMMON_H_ + +#include "common\util\CxbxUtil.h" +#include "..\devices\video\queue.h" +#include + +#define USB_MAX_ENDPOINTS 15 +#define USB_MAX_INTERFACES 16 + +#define USB_STATE_NOTATTACHED 0 +#define USB_STATE_ATTACHED 1 +#define USB_STATE_DEFAULT 2 + +#define USB_CLASS_HUB 9 + +#define USB_ENDPOINT_XFER_CONTROL 0 +#define USB_ENDPOINT_XFER_ISOC 1 +#define USB_ENDPOINT_XFER_BULK 2 +#define USB_ENDPOINT_XFER_INT 3 +#define USB_ENDPOINT_XFER_INVALID 255 + +#define USB_INTERFACE_INVALID 255 + +#define USB_DIR_OUT 0 +#define USB_DIR_IN 0x80 + +#define USB_TOKEN_SETUP 0x2D +#define USB_TOKEN_IN 0x69 // device -> host +#define USB_TOKEN_OUT 0xE1 // host -> device + +#define USB_SPEED_LOW 0 +#define USB_SPEED_FULL 1 + +#define USB_DEVICE_SELF_POWERED 0 +#define USB_DEVICE_REMOTE_WAKEUP 1 + +#define USB_TYPE_MASK (0x03 << 5) +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_MASK 0x1F +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +#define DeviceRequest ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8) +#define DeviceOutRequest ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8) +#define VendorDeviceRequest ((USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_DEVICE)<<8) +#define VendorDeviceOutRequest ((USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_DEVICE)<<8) + +#define InterfaceRequest \ + ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8) +#define InterfaceOutRequest \ + ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8) +#define ClassInterfaceRequest \ + ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE)<<8) +#define ClassInterfaceOutRequest \ + ((USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE)<<8) +#define VendorInterfaceRequest \ + ((USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_INTERFACE)<<8) +#define VendorInterfaceOutRequest \ + ((USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE)<<8) + +#define EndpointRequest ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_ENDPOINT)<<8) +#define EndpointOutRequest \ + ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_ENDPOINT)<<8) + +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +#define USB_REQ_SET_FEATURE 0x03 +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_RET_SUCCESS (0) +#define USB_RET_NODEV (-1) +#define USB_RET_NAK (-2) +#define USB_RET_STALL (-3) +#define USB_RET_BABBLE (-4) +#define USB_RET_IOERROR (-5) +#define USB_RET_ASYNC (-6) +#define USB_RET_ADD_TO_QUEUE (-7) +#define USB_RET_REMOVE_FROM_QUEUE (-8) + + +typedef enum _USB_SPEED +{ + USB_SPEED_MASK_LOW = 1 << 0, + USB_SPEED_MASK_FULL = 1 << 1, +} +USB_SPEED; + +typedef enum USBPacketState { + USB_PACKET_UNDEFINED = 0, + USB_PACKET_SETUP, + USB_PACKET_QUEUED, + USB_PACKET_ASYNC, + USB_PACKET_COMPLETE, + USB_PACKET_CANCELED, +} +USBPacketState; + +/* same as Linux kernel root hubs */ +typedef enum { + STR_MANUFACTURER = 1, + STR_PRODUCT, + STR_SERIALNUMBER, +} +STRING_DESC_INDEX; + +// Forward declarations +struct USBPacket; +struct XboxDeviceState; +struct USBPortOps; + +/* String descriptor */ +struct USBDescString { + uint8_t index; // index of this string descriptor + std::string str; // the string of this string descriptor + QLIST_ENTRY(USBDescString) next; +}; + +// Device-specific class descriptors, if any. No idea if some Xbox devices use this but, if not, this can be removed +struct USBDescOther { + uint8_t length; + const uint8_t* data; +}; + +/* Endpoint descriptor */ +struct USBDescEndpoint { + uint8_t bEndpointAddress; // the address of the endpoint on the USB device described by this descriptor + uint8_t bmAttributes; // this field describes the endpoint's attributes when it is configured using the bConfigurationValue + uint16_t wMaxPacketSize; // maximum packet size this endpoint is capable of sending or receiving when this configuration is selected + uint8_t bInterval; // interval for polling endpoint for data transfers, expressed in milliseconds. + uint8_t bRefresh; // for audio devices only: the rate at which synchronization feedback is provided + uint8_t bSynchAddress; // for audio devices only: the address of the synchronization endpoint + + uint8_t is_audio; // has bRefresh + bSynchAddress + uint8_t* extra; // class-specific descriptors (if any) associated with this endpoint + + // Dropped from QEMU the parameters bMaxBurst, bmAttributes_super and wBytesPerInterval because those are only defined for + // superspeed (usb 3.0) devices in the superspeed endpoint companion +}; + +/* Interface descriptor */ +struct USBDescIface { + uint8_t bInterfaceNumber; // number of interface + uint8_t bAlternateSetting; // value used to select the alternate setting for the interface identified by bInterfaceNumber + uint8_t bNumEndpoints; // number of endpoints used by this interface (excluding endpoint zero) + uint8_t bInterfaceClass; // class code (assigned by the USB) + uint8_t bInterfaceSubClass; // subclass code (assigned by the USB) + uint8_t bInterfaceProtocol; // protocol code (assigned by the USB) + uint8_t iInterface; // index of string descriptor describing this interface + + uint8_t ndesc; // number of device-specific class descriptors (if any) + USBDescOther* descs; // pointer to the extra class descriptors + const USBDescEndpoint* eps; // endpoints supported by this interface +}; + +/* +* ergo720: I removed the Interface Association Descriptor (IAD) since, at the time of this writing (2018), the xboxdevwiki documents that all +* known xid devices don't use them and also, according to the corresponding standard, IAD applies to usb revision 2.0 while the xbox uses +* usb revision 1.1 so it shouldn't support them either. If this turns out to be incorrect, then IAD support will have to be added +*/ + +/* Configuration descriptor */ +struct USBDescConfig { + uint8_t bNumInterfaces; // number of interfaces supported by this configuration + uint8_t bConfigurationValue; // value to use as an argument to the SetConfiguration() request to select this configuration + uint8_t iConfiguration; // index of string descriptor describing this configuration + uint8_t bmAttributes; // configuration characteristics + uint8_t bMaxPower; // maximum power consumption of the USB device in this configuration expressed in 2mA units + uint8_t nif; // number of interfaces (again) + const USBDescIface* ifs; // interfaces supported by this configuration +}; + +/* Device descriptor part 1 */ +struct USBDescDevice { + uint16_t bcdUSB; // USB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H) + uint8_t bDeviceClass; // class code (assigned by the USB) + uint8_t bDeviceSubClass; // subclass code (assigned by the USB) + uint8_t bDeviceProtocol; // protocol code (assigned by the USB) + uint8_t bMaxPacketSize0; // maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid) + uint8_t bNumConfigurations; // number of possible configurations + const USBDescConfig* confs; // configurations supported by this device +}; + +/* Device descriptor part 2 */ +struct USBDescID { + uint16_t idVendor; // vendor ID (assigned by the USB) + uint16_t idProduct; // product ID (assigned by the manufacturer) + uint16_t bcdDevice; // device release number in binary-coded decimal + uint8_t iManufacturer; // index of string descriptor describing manufacturer + uint8_t iProduct; // index of string descriptor describing product + uint8_t iSerialNumber; // index of string descriptor describing the devices serial number +}; + +/* Global USB Descriptor struct */ +struct USBDesc { + USBDescID id; // id-specific info of the device descriptor + const USBDescDevice* full; // remaining fields of the device descriptor +}; + +#pragma pack(1) + +// Binary representation of the descriptors +// Dropped from QEMU usb 2.0 and 3.0 only descriptors +struct USBDescriptor { + uint8_t bLength; + uint8_t bDescriptorType; + union { + struct { + uint8_t bcdUSB_lo; + uint8_t bcdUSB_hi; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint8_t idVendor_lo; + uint8_t idVendor_hi; + uint8_t idProduct_lo; + uint8_t idProduct_hi; + uint8_t bcdDevice_lo; + uint8_t bcdDevice_hi; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; + } device; // device descriptor + struct { + uint8_t wTotalLength_lo; + uint8_t wTotalLength_hi; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t bMaxPower; + } config; // configuration descriptor + struct { + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; + } iface; // interface descriptor + struct { + uint8_t bEndpointAddress; + uint8_t bmAttributes; + uint8_t wMaxPacketSize_lo; + uint8_t wMaxPacketSize_hi; + uint8_t bInterval; + uint8_t bRefresh; // only audio ep + uint8_t bSynchAddress; // only audio ep + } endpoint; // endpoint descriptor + } u; +}; + +#pragma pack() + +/* USB endpoint */ +struct USBEndpoint { + uint8_t Num; // endpoint number + uint8_t Type; // the type of this endpoint + uint8_t IfNum; // interface number this endpoint belongs to + int MaxPacketSize; // maximum packet size supported by this endpoint + bool Halted; // indicates that the endpoint is halted + XboxDeviceState* Dev; // device this endpoint belongs to + QTAILQ_HEAD(, USBPacket) Queue; // queue of packets to this endpoint +}; + +/* Struct describing the status of a usb port */ +struct USBPort { + XboxDeviceState* Dev; // usb device (if present) + USBPortOps* Operations; // functions to call when a port event happens + int SpeedMask; // usb speeds supported + std::string Path; // the number of the port + 1, used to create a serial number for this device + int PortIndex; // internal port index +}; + +/* Struct which stores general functions/variables regarding the peripheral */ +struct USBDeviceClass { + std::function init; + + // Walk (enabled) downstream ports, check for a matching device. + // Only hubs implement this. + std::function find_device; + + // Called when a packet is canceled. + std::function cancel_packet; + + // Called when device is destroyed. + std::function handle_destroy; + + // Attach the device + std::function handle_attach; + + // Reset the device + std::function handle_reset; + + // Process control request. + // Called from handle_packet(). + // Status gets stored in p->status, and if p->status == USB_RET_SUCCESS + // then the number of bytes transferred is stored in p->actual_length + std::function handle_control; + + // Process data transfers (both BULK and ISOC). + // Called from handle_packet(). + // Status gets stored in p->status, and if p->status == USB_RET_SUCCESS + // then the number of bytes transferred is stored in p->actual_length + std::function handle_data; + + std::function set_interface; + + // Called when the hcd is done queuing packets for an endpoint, only + // necessary for devices which can return USB_RET_ADD_TO_QUEUE. + std::function flush_ep_queue; + + // Called by the hcd to let the device know the queue for an endpoint + // has been unlinked / stopped. Optional may be NULL. + std::function ep_stopped; + + const char* product_desc; // friendly name of the device + const USBDesc* usb_desc; // device descriptor +}; + +/* definition of an Xbox usb device */ +struct XboxDeviceState { + USBPort* Port; // usb port struct of this device + int PortPath; // port index to which this device is attached to + USBDeviceClass* klass; // usb class struct of this device + + int Speed; // actual speed of the connected device + int SpeedMask; // supported speeds, not in info because it may be variable (hostdevs) + uint8_t Addr; // device function address + std::string ProductDesc; // the friendly name of this device + int Attached; // device is attached + + int32_t State; // current state of device + uint8_t SetupBuffer[8]; // setup packet buffer - 8 bytes (control transfers only) + uint8_t DataBuffer[4096]; // buffer where to write the data requested during usb requests + int32_t RemoteWakeup; // wakeup flag + int32_t SetupState; // result of a control transfer processing operation + int32_t SetupLength; // this field specifies the length of the data transferred during the second phase of the control transfer + int32_t SetupIndex; // index of the parameter in a setup token? + + USBEndpoint EP_ctl; // control endpoint + USBEndpoint EP_in[USB_MAX_ENDPOINTS]; // device endpoint (input direction) + USBEndpoint EP_out[USB_MAX_ENDPOINTS]; // device endpoint (output direction) + + QLIST_HEAD(, USBDescString) Strings; // strings of the string descriptors + const USBDesc* UsbDesc; // Overrides class usb_desc if not nullptr + const USBDescDevice* Device; // device descriptor part 1 + + int Configuration; // number of the selected configuration descriptor + int NumInterfaces; // number of available interface descriptors + int AltSetting[USB_MAX_INTERFACES]; // alternate setting numbers for the current interface + const USBDescConfig* Config; // configuration in use + const USBDescIface* Ifaces[USB_MAX_INTERFACES]; // interface in use +}; + +/* Structure used to hold information about an active USB packet */ +struct USBPacket { + int Pid; // Packet ID (used to identify the type of packet that is being processed) + uint32_t Id; // Paddr of the TD for this packet + USBEndpoint* Endpoint; // endpoint this packet is transferred to + IOVector IoVec; // used to perform vectored I/O + bool ShortNotOK; // the bufferRounding mode of the TD for this packet + bool IntReq; // whether or not to generate an interrupt for this packet (DelayInterrupt of the TD is zero) + int Status; // USB_RET_* status code + int ActualLength; // number of bytes actually written to DataBuffer + // Internal use by the USB layer + USBPacketState State; + QTAILQ_ENTRY(USBPacket) Queue; +}; + +struct USBPortOps { + std::function attach; + std::function detach; + /* + * This gets called when a device downstream from the device attached to + * the port (attached through a hub) gets detached. + */ + std::function child_detach; + std::function wakeup; + /* + * Note that port->dev will be different then the device from which + * the packet originated when a hub is involved. + */ + std::function complete; +}; + +#endif diff --git a/src/devices/usb/XidGamepad.cpp b/src/devices/usb/XidGamepad.cpp new file mode 100644 index 000000000..22997f4fb --- /dev/null +++ b/src/devices/usb/XidGamepad.cpp @@ -0,0 +1,564 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +// Acknowledgment: XQEMU xid emulation (GPLv2) +// https://xqemu.com/ + +/* +* QEMU USB XID Devices +* +* Copyright (c) 2013 espes +* Copyright (c) 2017 Jannik Vogel +* Copyright (c) 2018 Matt Borgerson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see . +*/ + + +#define LOG_PREFIX CXBXR_MODULE::XIDCTRL + +// prevent name collisions +namespace xboxkrnl +{ + #include // For PKINTERRUPT, etc. +}; + +#include +#include "XidGamepad.h" +#include "USBDevice.h" +#include "common\input\InputManager.h" +#include "common\input\SdlJoystick.h" +#include "OHCI.h" +#include "core\kernel\exports\EmuKrnl.h" +#include "Logging.h" + +#define USB_CLASS_XID 0x58 +#define USB_DT_XID 0x42 + +#define HID_GET_REPORT 0x01 +#define HID_SET_REPORT 0x09 +#define XID_GET_CAPABILITIES 0x01 + + +// To avoid including Xbox.h +extern USBDevice* g_USB0; + +XidGamepad* g_XidControllerObjArray[4]; + +#pragma pack(1) + +/* Class-specific xid descriptor */ +struct XIDDesc { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdXid; + uint8_t bType; + uint8_t bSubType; + uint8_t bMaxInputReportSize; + uint8_t bMaxOutputReportSize; + uint16_t wAlternateProductIds[4]; +}; + +/* Struct used by the Get_Report request -> button's state */ +struct XIDGamepadReport { + uint8_t bReportId; + uint8_t bLength; + uint16_t wButtons; // all non-analog buttons + uint8_t bAnalogButtons[8]; // X, Y, A, B, white, black, left/right trigger + int16_t sThumbLX; // analog stick, left X + int16_t sThumbLY; // analog stick, left Y + int16_t sThumbRX; // analog stick, right X + int16_t sThumbRY; // analog stick, right Y +}; + +/* Struct used by the Set_Report request -> vibration strenght */ +struct XIDGamepadOutputReport { + uint8_t report_id; // From XQEMU: FIXME: is this correct? + uint8_t length; + uint16_t left_actuator_strength; // strenght of left vibration motor + uint16_t right_actuator_strength; // strenght of right vibration motor +}; + +#pragma pack() + +struct USBXIDState { + XboxDeviceState dev; // gamepad device status + USBEndpoint* intr; // interrupt endpoint of the gamepad + + const XIDDesc* xid_desc; // xid-specific descriptor + + XIDGamepadReport in_state; // Get_Report struct + XIDGamepadReport in_state_capabilities; // Get_Capabilities struct (in) + XIDGamepadOutputReport out_state; // Set_Report struct + XIDGamepadOutputReport out_state_capabilities; // Get_Capabilities struct (out) +}; + +static const USBDescEndpoint desc_endp_xbox_gamepad[2] = { + { + USB_DIR_IN | 0x02, // bEndpointAddress; + USB_ENDPOINT_XFER_INT, // bmAttributes; + 0x20, // wMaxPacketSize; + 4, // bInterval; + 0, // bRefresh; + 0, // bSynchAddress + 0, // is_audio + nullptr // extra + }, + { + USB_DIR_OUT | 0x02, + USB_ENDPOINT_XFER_INT, + 0x20, + 4, + 0, + 0, + 0, + nullptr + } +}; + +static const USBDescIface desc_iface_xbox_gamepad = { + 0, // bInterfaceNumber; + 0, // bAlternateSetting; + 2, // bNumEndpoints; + USB_CLASS_XID, // bInterfaceClass; + 0x42, // bInterfaceSubClass + 0x00, // bInterfaceProtocol + 0, // iInterface + 0, // ndesc + nullptr, // descs + desc_endp_xbox_gamepad +}; + +static const USBDescConfig desc_config_xbox_gamepad = { + 1, // bNumInterfaces + 1, // bConfigurationValue + 0, // iConfiguration + 0x80, // bmAttributes + 50, // bMaxPower + 1, // nif + &desc_iface_xbox_gamepad +}; + +static const USBDescDevice desc_device_xbox_gamepad = { + 0x0110, // bcdUSB + 0, // bDeviceClass + 0, // bDeviceSubClass + 0, // bDeviceProtocol + 0x40, // bMaxPacketSize0 + 1, // bNumConfigurations + &desc_config_xbox_gamepad +}; + +static const USBDesc desc_xbox_gamepad = { + { + 0x045E, // idVendor + 0x0202, // idProduct + 0x0100, // bcdDevice + STR_MANUFACTURER, // iManufacturer + STR_PRODUCT, // iProduct + STR_SERIALNUMBER // iSerialNumber + }, + &desc_device_xbox_gamepad +}; + +static const XIDDesc desc_xid_xbox_gamepad = { + 0x10, // bLength + USB_DT_XID, // bDescriptorType + 0x100, // bcdXid + 1, // bType + 1, // bSubType + 20, // bMaxInputReportSize + 6, // bMaxOutputReportSize + { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF } // wAlternateProductIds +}; + +int XidGamepad::Init(int port) +{ + if (port > 4 || port < 1) { return -1; } + + XboxDeviceState* dev = ClassInitFn(); + int rc = UsbXidClaimPort(dev, port); + if (rc != 0) { + m_UsbDev->m_HostController->m_FrameTimeMutex.unlock(); + return rc; + } + m_UsbDev->USB_EpInit(dev); + m_UsbDev->USB_DeviceInit(dev); + m_UsbDev->USB_DeviceAttach(dev); + + m_UsbDev->m_HostController->m_FrameTimeMutex.unlock(); + + return 0; +} + +XboxDeviceState* XidGamepad::ClassInitFn() +{ + m_pPeripheralFuncStruct = new USBDeviceClass(); + m_XidState = new USBXIDState(); + XboxDeviceState* dev = &m_XidState->dev; + + dev->ProductDesc = "Microsoft Xbox Controller"; + QLIST_INIT(&dev->Strings); + dev->klass = m_pPeripheralFuncStruct; + + { + using namespace std::placeholders; + + m_pPeripheralFuncStruct->init = std::bind(&XidGamepad::UsbXid_Initfn, this, _1); + m_pPeripheralFuncStruct->handle_reset = std::bind(&XidGamepad::UsbXid_HandleReset, this); + m_pPeripheralFuncStruct->handle_control = std::bind(&XidGamepad::UsbXid_HandleControl, this, _1, _2, _3, _4, _5, _6, _7); + m_pPeripheralFuncStruct->handle_data = std::bind(&XidGamepad::UsbXid_HandleData, this, _1, _2); + m_pPeripheralFuncStruct->handle_destroy = std::bind(&XidGamepad::UsbXid_HandleDestroy, this); + m_pPeripheralFuncStruct->handle_attach = std::bind(&XidGamepad::UsbXid_Attach, this, _1); + m_pPeripheralFuncStruct->product_desc = dev->ProductDesc.c_str(); + m_pPeripheralFuncStruct->usb_desc = &desc_xbox_gamepad; + } + + return dev; +} + +int XidGamepad::UsbXidClaimPort(XboxDeviceState* dev, int port) +{ + int i; + std::vector::iterator it; + + assert(dev->Port == nullptr); + + m_UsbDev = g_USB0; + it = m_UsbDev->m_FreePorts.end(); + i = 0; + + m_UsbDev->m_HostController->m_FrameTimeMutex.lock(); + + for (auto usb_port : m_UsbDev->m_FreePorts) { + if (usb_port->Path == (std::to_string(port) + ".2")) { + it = m_UsbDev->m_FreePorts.begin() + i; + break; + } + i++; + } + if (it == m_UsbDev->m_FreePorts.end()) { + EmuLog(LOG_LEVEL::WARNING, "Port requested %d.2 not found (in use?)", port); + return -1; + } + + m_Port = port; + dev->Port = *it; + (*it)->Dev = dev; + m_UsbDev->m_FreePorts.erase(it); + + return 0; +} + +void XidGamepad::UsbXidReleasePort(XboxDeviceState* dev) +{ + USBPort* port = dev->Port; + + assert(port != nullptr); + + port->Dev = nullptr; + dev->Port = nullptr; +} + +int XidGamepad::UsbXid_Initfn(XboxDeviceState* dev) +{ + m_UsbDev->USB_CreateSerial(dev, std::string("1")); + m_UsbDev->USBDesc_SetString(dev, STR_MANUFACTURER, std::string("Cxbx-Reloaded")); + m_UsbDev->USBDesc_SetString(dev, STR_PRODUCT, std::string("Microsoft Gamepad")); + m_UsbDev->USBDesc_Init(dev); + m_XidState->intr = m_UsbDev->USB_GetEP(dev, USB_TOKEN_IN, 2); + + m_XidState->in_state.bLength = sizeof(m_XidState->in_state); + m_XidState->in_state.bReportId = 0; + m_XidState->out_state.length = sizeof(m_XidState->out_state); + m_XidState->out_state.report_id = 0; + + std::memset(&m_XidState->in_state_capabilities, 0xFF, sizeof(m_XidState->in_state_capabilities)); + m_XidState->in_state_capabilities.bLength = sizeof(m_XidState->in_state_capabilities); + m_XidState->in_state_capabilities.bReportId = 0; + + std::memset(&m_XidState->out_state_capabilities, 0xFF, sizeof(m_XidState->out_state_capabilities)); + m_XidState->out_state_capabilities.length = sizeof(m_XidState->out_state_capabilities); + m_XidState->out_state_capabilities.report_id = 0; + + m_XidState->xid_desc = &desc_xid_xbox_gamepad; + + return 0; +} + +void XidGamepad::UsbXid_HandleDestroy() +{ + UsbXidReleasePort(&m_XidState->dev); + XpadCleanUp(); +} + +void XidGamepad::UsbXid_Attach(XboxDeviceState* dev) +{ + if ((dev->Port->SpeedMask & USB_SPEED_MASK_FULL)) { + dev->Speed = USB_SPEED_FULL; + } + else { + return; + } + m_UsbDev->USBDesc_SetDefaults(dev); +} + +void XidGamepad::UsbXid_HandleReset() +{ + EmuLog(LOG_LEVEL::DEBUG, "Reset event"); +} + +void XidGamepad::UsbXid_HandleControl(XboxDeviceState* dev, USBPacket* p, + int request, int value, int index, int length, uint8_t* data) +{ + int ret = m_UsbDev->USBDesc_HandleControl(dev, p, request, value, index, length, data); + if (ret >= 0) { + EmuLog(LOG_LEVEL::DEBUG, "Handled by USBDesc_HandleControl, ret is %d", ret); + return; + } + + switch (request) { + // HID-specific requests + case ClassInterfaceRequest | HID_GET_REPORT: { + // From the HID standard: "The Get_Report request allows the host to receive a report via the Control pipe. + // The wValue field specifies the Report Type in the high byte and the Report ID in the low byte. Set Report ID + // to 0 (zero) if Report IDs are not used. 01 = input, 02 = output, 03 = feature, 04-FF = reserved" + EmuLog(LOG_LEVEL::DEBUG, "GET_REPORT xpad request 0x%X", value); + // JayFoxRox's analysis: "This 0x0100 case is for input. + // This is the case where the Xbox wants to read input data from the controller. + // Confirmed with a real Duke controller : + // If the buffer provided by the Xbox is too small, the controller will cut the transfer when the buffer is full (actual_length is patched). + // If the buffer is too large the controller will STALL instead. + // If the buffer has the correct length the full input data is transferred." + if (value == 0x0100) { + if (length <= m_XidState->in_state.bLength) { +#if 0 // Reenable this when LLE USB actually works + SDL2Devices* controller = g_InputDeviceManager->FindDeviceFromXboxPort(m_Port); + if (controller != nullptr) { + controller->ReadButtonState(&m_XidState->in_state.wButtons, m_XidState->in_state.bAnalogButtons, + &m_XidState->in_state.sThumbLX, &m_XidState->in_state.sThumbLY, &m_XidState->in_state.sThumbRX, + &m_XidState->in_state.sThumbRY); + } + else { + // ergo720: this shouldn't really happen. If it does, it either means that m_Port is wrong or there's a bug + // in the InputDeviceManager + p->Status = USB_RET_STALL; + assert(0); + } +#endif + std::memcpy(data, &m_XidState->in_state, m_XidState->in_state.bLength); + p->ActualLength = length; + } + else { + p->Status = USB_RET_STALL; + } + } + else { + p->Status = USB_RET_STALL; + } + break; + } + + case ClassInterfaceOutRequest | HID_SET_REPORT: { + // From the HID standard: "The Set_Report request allows the host to send a report to the device, possibly + // setting the state of input, output, or feature controls. The meaning of the request fields for the Set_Report + // request is the same as for the Get_Report request, however the data direction is reversed and the Report + // Data is sent from host to device." + EmuLog(LOG_LEVEL::DEBUG, "SET_REPORT xpad request 0x%X", value); + // JayFoxRox's analysis: "The 0x0200 case below is for output. + // This is the case where the Xbox wants to write rumble data to the controller. + // To my knowledge : + // If the buffer provided by the Xbox is too small the transfer will STALL. + // If the buffer is too large the transfer will STALL. + // If the buffer has the correct length the full output data is transferred." + if (value == 0x0200) { + if (length == m_XidState->out_state.length) { + // Read length, then the entire packet + std::memcpy(&m_XidState->out_state, data, sizeof(m_XidState->out_state)); + /* FIXME: This should also be a STALL */ + assert(m_XidState->out_state.length == sizeof(m_XidState->out_state)); + + p->ActualLength = length; + } + else { + p->Status = USB_RET_STALL; + } + UpdateForceFeedback(); + } + else { + p->Status = USB_RET_STALL; + assert(0); + } + break; + } + + // XID-specific requests + case VendorInterfaceRequest | USB_REQ_GET_DESCRIPTOR: { + EmuLog(LOG_LEVEL::DEBUG, "GET_DESCRIPTOR xpad request 0x%x", value); + if (value == 0x4200) { + assert(m_XidState->xid_desc->bLength <= length); + std::memcpy(data, m_XidState->xid_desc, m_XidState->xid_desc->bLength); + p->ActualLength = m_XidState->xid_desc->bLength; + } + else { + p->Status = USB_RET_STALL; + assert(0); + } + break; + } + + case VendorInterfaceRequest | XID_GET_CAPABILITIES: { + EmuLog(LOG_LEVEL::DEBUG, "XID_GET_CAPABILITIES xpad request 0x%x", value); + if (value == 0x0100) { + if (length > m_XidState->in_state_capabilities.bLength) { + length = m_XidState->in_state_capabilities.bLength; + } + std::memcpy(data, &m_XidState->in_state_capabilities, length); + p->ActualLength = length; + } + else if (value == 0x0200) { + if (length > m_XidState->out_state_capabilities.length) { + length = m_XidState->out_state_capabilities.length; + } + std::memcpy(data, &m_XidState->out_state_capabilities, length); + p->ActualLength = length; + } + else { + p->Status = USB_RET_STALL; + assert(0); + } + break; + } + + case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE) << 8) | USB_REQ_GET_DESCRIPTOR: { + /* FIXME: ! */ + EmuLog(LOG_LEVEL::DEBUG, "Unknown xpad request 0x%X: value = 0x%X", request, value); + std::memset(data, 0x00, length); + //FIXME: Intended for the hub: usbd_get_hub_descriptor, UT_READ_CLASS?! + p->Status = USB_RET_STALL; + //assert(false); + break; + } + + case ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT) << 8) | USB_REQ_CLEAR_FEATURE: { + /* FIXME: ! */ + EmuLog(LOG_LEVEL::DEBUG, "Unknown xpad request 0x%X: value = 0x%X", request, value); + std::memset(data, 0x00, length); + p->Status = USB_RET_STALL; + break; + } + + default: + EmuLog(LOG_LEVEL::DEBUG, "USB stalled on request 0x%X value 0x%X", request, value); + p->Status = USB_RET_STALL; + assert(0); + break; + } +} + +void XidGamepad::UsbXid_HandleData(XboxDeviceState* dev, USBPacket* p) +{ + switch (p->Pid) { + case USB_TOKEN_IN: { + if (p->Endpoint->Num == 2) { +#if 0 // Reenable this when LLE USB actually works + SDL2Devices* controller = g_InputDeviceManager->FindDeviceFromXboxPort(m_Port); + if (controller != nullptr) { + bool ret; + ret = controller->ReadButtonState(&m_XidState->in_state.wButtons, m_XidState->in_state.bAnalogButtons, + &m_XidState->in_state.sThumbLX, &m_XidState->in_state.sThumbLY, &m_XidState->in_state.sThumbRX, + &m_XidState->in_state.sThumbRY); + if (ret) { + m_UsbDev->USB_PacketCopy(p, &m_XidState->in_state, m_XidState->in_state.bLength); + } + else { +#endif + p->Status = USB_RET_NAK; + } +#if 0 // Reenable this when LLE USB actually works + } + else { + p->Status = USB_RET_STALL; + assert(0); + } + } + else { + assert(0); + } +#endif + break; + } + + case USB_TOKEN_OUT: { + if (p->Endpoint->Num == 2) { + m_UsbDev->USB_PacketCopy(p, &m_XidState->out_state, m_XidState->out_state.length); + UpdateForceFeedback(); + } + else { + assert(0); + } + break; + } + + default: + p->Status = USB_RET_STALL; + assert(0); + break; + } +} + +void XidGamepad::XpadCleanUp() +{ + delete m_pPeripheralFuncStruct; + delete m_XidState; + m_pPeripheralFuncStruct = nullptr; + m_XidState = nullptr; +} + +void XidGamepad::UpdateForceFeedback() +{ + // JayFoxRox's remarks: "Xbox -> XID packets were not tested + // The handling of output packets / force feedback was not checked." + // For the above reason we don't implement vibration support for now since the current + // implementation is untested and could potentially contain errors + + /* FIXME: Check actuator endianess */ + EmuLog(LOG_LEVEL::DEBUG, "Set rumble power to left: 0x%X and right: 0x%X", + m_XidState->out_state.left_actuator_strength, + m_XidState->out_state.right_actuator_strength); +} diff --git a/src/devices/usb/XidGamepad.h b/src/devices/usb/XidGamepad.h new file mode 100644 index 000000000..ea8f5750d --- /dev/null +++ b/src/devices/usb/XidGamepad.h @@ -0,0 +1,77 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef XIDGAMEPAD_H_ +#define XIDGAMEPAD_H_ + +#include "Hub.h" + + +struct USBXIDState; // forward declare + +/* Class which implements an xbox gamepad */ +class XidGamepad +{ + public: + // initialize this peripheral + int Init(int port); + // destroy gamepad resources + void XpadCleanUp(); + + + private: + // usb device this gamepad is attached to through the hub + USBDevice* m_UsbDev = nullptr; + // gamepad state + USBXIDState* m_XidState = nullptr; + // gamepad class functions + USBDeviceClass* m_pPeripheralFuncStruct = nullptr; + // xbox port this gamepad is attached to + int m_Port = 0; + + // initialize various member variables/functions + XboxDeviceState* ClassInitFn(); + // reserve a usb port for this gamepad + int UsbXidClaimPort(XboxDeviceState* dev, int port); + // free the usb port used by this gamepad + void UsbXidReleasePort(XboxDeviceState* dev); + // see USBDeviceClass for comments about these functions + int UsbXid_Initfn(XboxDeviceState* dev); + void UsbXid_HandleDestroy(); + void UsbXid_Attach(XboxDeviceState* dev); + void UsbXid_HandleReset(); + void UsbXid_HandleControl(XboxDeviceState* dev, USBPacket* p, + int request, int value, int index, int length, uint8_t* data); + void UsbXid_HandleData(XboxDeviceState* dev, USBPacket* p); + // this should update the vibration strenght of the real controller this gamepad represents. + // It doesn't do anything at the moment + void UpdateForceFeedback(); +}; + +extern XidGamepad* g_XidControllerObjArray[4]; + +#endif diff --git a/src/devices/video/EmuNV2A_DEBUG.cpp b/src/devices/video/EmuNV2A_DEBUG.cpp index 91975d428..79cbaaa6a 100644 --- a/src/devices/video/EmuNV2A_DEBUG.cpp +++ b/src/devices/video/EmuNV2A_DEBUG.cpp @@ -1,11 +1,46 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/tree/master/hw/xbox/nv2a/nv2a_debug.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + #define DEBUG_START(DEV) \ -const char *DebugNV_##DEV##(xbaddr addr) \ +const char *DebugNV_##DEV(xbaddr addr) \ { \ switch (addr) { #define DEBUG_CASE(a) \ case a: return #a; #define DEBUG_CASE_EX(a, c) \ - case a: return #a##c; + case a: return #a c; #define DEBUG_END(DEV) \ default: \ return "Unknown " #DEV " Address"; \ @@ -93,6 +128,8 @@ DEBUG_START(PFIFO) DEBUG_CASE(NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW); DEBUG_CASE(NV_PFIFO_CACHE1_DMA_RSVD_SHADOW); DEBUG_CASE(NV_PFIFO_CACHE1_DMA_DATA_SHADOW); + DEBUG_CASE(NV_PFIFO_CACHE1_METHOD); + DEBUG_CASE(NV_PFIFO_CACHE1_DATA); DEBUG_END(PFIFO) // TODO: Remove disabled warning once case are add to PRMA switch. @@ -281,6 +318,12 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_CTX_SWITCH2); DEBUG_CASE(NV_PGRAPH_CTX_SWITCH3); DEBUG_CASE(NV_PGRAPH_CTX_SWITCH4); + DEBUG_CASE(NV_PGRAPH_CTX_SWITCH5); + DEBUG_CASE(NV_PGRAPH_CTX_CACHE1); + DEBUG_CASE(NV_PGRAPH_CTX_CACHE2); + DEBUG_CASE(NV_PGRAPH_CTX_CACHE3); + DEBUG_CASE(NV_PGRAPH_CTX_CACHE4); + DEBUG_CASE(NV_PGRAPH_CTX_CACHE5); DEBUG_CASE(NV_PGRAPH_STATUS); DEBUG_CASE(NV_PGRAPH_TRAPPED_ADDR); DEBUG_CASE(NV_PGRAPH_TRAPPED_DATA_LOW); @@ -337,6 +380,7 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_ZCOMP_OFFSET); DEBUG_CASE(NV_PGRAPH_FBCFG0); DEBUG_CASE(NV_PGRAPH_FBCFG1); + DEBUG_CASE(NV_PGRAPH_PATT_COLOR0); DEBUG_CASE(NV_PGRAPH_DEBUG_6); DEBUG_CASE(NV_PGRAPH_DEBUG_7); DEBUG_CASE(NV_PGRAPH_DEBUG_10); @@ -345,6 +389,7 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_CSV1_B); DEBUG_CASE(NV_PGRAPH_CSV1_A); DEBUG_CASE(NV_PGRAPH_CHEOPS_OFFSET); + DEBUG_CASE(NV_PGRAPH_DMA_STATE); DEBUG_CASE(NV_PGRAPH_BLEND); DEBUG_CASE(NV_PGRAPH_BLENDCOLOR); DEBUG_CASE(NV_PGRAPH_BORDERCOLOR0); @@ -366,6 +411,7 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_COMBINESPECFOG0); DEBUG_CASE(NV_PGRAPH_COMBINESPECFOG1); DEBUG_CASE(NV_PGRAPH_CONTROL_0); + DEBUG_CASE(NV_PGRAPH_CONTROL_1); DEBUG_CASE(NV_PGRAPH_CONTROL_2); DEBUG_CASE(NV_PGRAPH_CONTROL_3); DEBUG_CASE(NV_PGRAPH_FOGCOLOR); @@ -375,6 +421,7 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_SHADERCLIPMODE); DEBUG_CASE(NV_PGRAPH_SHADERCTL); DEBUG_CASE(NV_PGRAPH_SHADERPROG); + DEBUG_CASE(NV_PGRAPH_SEMAPHOREOFFSET); DEBUG_CASE(NV_PGRAPH_SHADOWZSLOPETHRESHOLD); DEBUG_CASE(NV_PGRAPH_SPECFOGFACTOR0); DEBUG_CASE(NV_PGRAPH_SPECFOGFACTOR1); @@ -412,6 +459,22 @@ DEBUG_START(PGRAPH) DEBUG_CASE(NV_PGRAPH_TEXPALETTE1); DEBUG_CASE(NV_PGRAPH_TEXPALETTE2); DEBUG_CASE(NV_PGRAPH_TEXPALETTE3); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX0); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX1); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX2); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX3); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX4); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX5); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX6); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPX7); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY0); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY1); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY2); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY3); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY4); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY5); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY6); + DEBUG_CASE(NV_PGRAPH_WINDOWCLIPY7); DEBUG_CASE(NV_PGRAPH_ZSTENCILCLEARVALUE); DEBUG_CASE(NV_PGRAPH_ZCLIPMIN); DEBUG_CASE(NV_PGRAPH_ZOFFSETBIAS); diff --git a/src/devices/video/EmuNV2A_PBUS.cpp b/src/devices/video/EmuNV2A_PBUS.cpp index a30fc2099..037858e9f 100644 --- a/src/devices/video/EmuNV2A_PBUS.cpp +++ b/src/devices/video/EmuNV2A_PBUS.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/tree/master/hw/xbox/nv2a/nv2a_pbus.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + /* PBUS - bus control */ DEVICE_READ32(PBUS) { diff --git a/src/devices/video/EmuNV2A_PCOUNTER.cpp b/src/devices/video/EmuNV2A_PCOUNTER.cpp index eb541cf20..b38fef2e5 100644 --- a/src/devices/video/EmuNV2A_PCOUNTER.cpp +++ b/src/devices/video/EmuNV2A_PCOUNTER.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PCOUNTER switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PCOUNTER) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PCRTC.cpp b/src/devices/video/EmuNV2A_PCRTC.cpp index 353412f62..67c986976 100644 --- a/src/devices/video/EmuNV2A_PCRTC.cpp +++ b/src/devices/video/EmuNV2A_PCRTC.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/tree/master/hw/xbox/nv2a/nv2a_pcrtc.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + DEVICE_READ32(PCRTC) { DEVICE_READ32_SWITCH() { @@ -11,6 +46,32 @@ DEVICE_READ32(PCRTC) case NV_PCRTC_START: result = d->pcrtc.start; break; + case NV_PCRTC_RASTER: { + // Test case: Alter Echo + // Hack: Alternate between 0, mid-frame, and end-of-frame, this is enough to satisfy any title + // that waits for VBlank using D3DDevice_GetRasterStatus, but not harm performance as much as + // the previous implementation + + static int stage = 0; + + switch (stage) { + case 0: + result = 0; + break; + case 1: + result = NV2ADevice::GetFrameHeight(d) / 2; + break; + case 2: + result = NV2ADevice::GetFrameHeight(d) + 1; + break; + } + + stage++; + + if (stage > 2) { + stage = 0; + } + } break; default: result = 0; //DEVICE_READ32_REG(pcrtc); // Was : DEBUG_READ32_UNHANDLED(PCRTC); diff --git a/src/devices/video/EmuNV2A_PFB.cpp b/src/devices/video/EmuNV2A_PFB.cpp index ed2f35581..292ce3f08 100644 --- a/src/devices/video/EmuNV2A_PFB.cpp +++ b/src/devices/video/EmuNV2A_PFB.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pfb.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + DEVICE_READ32(PFB) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PFIFO.cpp b/src/devices/video/EmuNV2A_PFIFO.cpp index 54476d251..aa09e17c4 100644 --- a/src/devices/video/EmuNV2A_PFIFO.cpp +++ b/src/devices/video/EmuNV2A_PFIFO.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pfifo.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + typedef struct RAMHTEntry { uint32_t handle; xbaddr instance; @@ -6,14 +41,13 @@ typedef struct RAMHTEntry { bool valid; } RAMHTEntry; -static void pfifo_run_pusher(NV2AState *d); // forward declaration -int pfifo_puller_thread(NV2AState *d); -static uint32_t ramht_hash(NV2AState *d, uint32_t handle); static RAMHTEntry ramht_lookup(NV2AState *d, uint32_t handle); // forward declaration /* PFIFO - MMIO and DMA FIFO submission to PGRAPH and VPE */ DEVICE_READ32(PFIFO) { + qemu_mutex_lock(&d->pfifo.pfifo_lock); + DEVICE_READ32_SWITCH() { case NV_PFIFO_RAMHT: result = 0x03000100; // = NV_PFIFO_RAMHT_SIZE_4K | NV_PFIFO_RAMHT_BASE_ADDRESS(NumberOfPaddingBytes >> 12) | NV_PFIFO_RAMHT_SEARCH_128 @@ -30,94 +64,19 @@ DEVICE_READ32(PFIFO) case NV_PFIFO_RUNOUT_STATUS: result = NV_PFIFO_RUNOUT_STATUS_LOW_MARK; /* low mark empty */ break; - case NV_PFIFO_CACHE1_PUSH0: - result = d->pfifo.cache1.push_enabled; - break; - case NV_PFIFO_CACHE1_PUSH1: - SET_MASK(result, NV_PFIFO_CACHE1_PUSH1_CHID, d->pfifo.cache1.channel_id); - SET_MASK(result, NV_PFIFO_CACHE1_PUSH1_MODE, d->pfifo.cache1.mode); - break; - case NV_PFIFO_CACHE1_STATUS: { - qemu_mutex_lock(&d->pfifo.cache1.cache_lock); - - if (d->pfifo.cache1.cache.empty()) { - result |= NV_PFIFO_CACHE1_STATUS_LOW_MARK; /* low mark empty */ - } - - qemu_mutex_unlock(&d->pfifo.cache1.cache_lock); - break; - } - case NV_PFIFO_CACHE1_DMA_PUSH: - SET_MASK(result, NV_PFIFO_CACHE1_DMA_PUSH_ACCESS, - d->pfifo.cache1.dma_push_enabled); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_PUSH_STATUS, - d->pfifo.cache1.dma_push_suspended); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_PUSH_BUFFER, 1); /* buffer emoty */ - break; - case NV_PFIFO_CACHE1_DMA_STATE: - SET_MASK(result, NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE, - d->pfifo.cache1.method_nonincreasing); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_STATE_METHOD, - d->pfifo.cache1.method >> 2); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL, - d->pfifo.cache1.subchannel); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT, - d->pfifo.cache1.method_count); - SET_MASK(result, NV_PFIFO_CACHE1_DMA_STATE_ERROR, - d->pfifo.cache1.error); - break; - case NV_PFIFO_CACHE1_DMA_INSTANCE: - SET_MASK(result, NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MASK, - d->pfifo.cache1.dma_instance >> 4); - break; - case NV_PFIFO_CACHE1_DMA_PUT: - result = d->user.channel_control[d->pfifo.cache1.channel_id].dma_put; - break; - case NV_PFIFO_CACHE1_DMA_GET: - result = d->user.channel_control[d->pfifo.cache1.channel_id].dma_get; - break; - case NV_PFIFO_CACHE1_DMA_SUBROUTINE: - result = d->pfifo.cache1.subroutine_return - | (xbaddr)d->pfifo.cache1.subroutine_active; - break; - case NV_PFIFO_CACHE1_PULL0: { - qemu_mutex_lock(&d->pfifo.cache1.cache_lock); - result = d->pfifo.cache1.pull_enabled; - qemu_mutex_unlock(&d->pfifo.cache1.cache_lock); - break; - } - case NV_PFIFO_CACHE1_ENGINE: { - qemu_mutex_lock(&d->pfifo.cache1.cache_lock); - - for (int i = 0; i < NV2A_NUM_SUBCHANNELS; i++) { - result |= d->pfifo.cache1.bound_engines[i] << (i * 2); - } - qemu_mutex_unlock(&d->pfifo.cache1.cache_lock); - break; - } - case NV_PFIFO_CACHE1_DMA_DCOUNT: - result = d->pfifo.cache1.dcount; - break; - case NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW: - result = d->pfifo.cache1.get_jmp_shadow; - break; - case NV_PFIFO_CACHE1_DMA_RSVD_SHADOW: - result = d->pfifo.cache1.rsvd_shadow; - break; - case NV_PFIFO_CACHE1_DMA_DATA_SHADOW: - result = d->pfifo.cache1.data_shadow; - break; default: DEVICE_READ32_REG(pfifo); // Was : DEBUG_READ32_UNHANDLED(PFIFO); break; } + qemu_mutex_unlock(&d->pfifo.pfifo_lock); + DEVICE_READ32_END(PFIFO); } DEVICE_WRITE32(PFIFO) { - int i; + qemu_mutex_lock(&d->pfifo.pfifo_lock); switch(addr) { case NV_PFIFO_INTR_0: @@ -128,350 +87,385 @@ DEVICE_WRITE32(PFIFO) d->pfifo.enabled_interrupts = value; update_irq(d); break; - case NV_PFIFO_CACHE1_PUSH0: - d->pfifo.cache1.push_enabled = value & NV_PFIFO_CACHE1_PUSH0_ACCESS; - break; - case NV_PFIFO_CACHE1_PUSH1: - d->pfifo.cache1.channel_id = GET_MASK(value, NV_PFIFO_CACHE1_PUSH1_CHID); - d->pfifo.cache1.mode = (FifoMode)GET_MASK(value, NV_PFIFO_CACHE1_PUSH1_MODE); - assert(d->pfifo.cache1.channel_id < NV2A_NUM_CHANNELS); - break; - case NV_PFIFO_CACHE1_DMA_PUSH: - d->pfifo.cache1.dma_push_enabled = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_PUSH_ACCESS); - if (d->pfifo.cache1.dma_push_suspended - && !GET_MASK(value, NV_PFIFO_CACHE1_DMA_PUSH_STATUS)) { - d->pfifo.cache1.dma_push_suspended = false; - pfifo_run_pusher(d); - } - d->pfifo.cache1.dma_push_suspended = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_PUSH_STATUS); - break; - case NV_PFIFO_CACHE1_DMA_STATE: - d->pfifo.cache1.method_nonincreasing = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE); - d->pfifo.cache1.method = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_STATE_METHOD) << 2; - d->pfifo.cache1.subchannel = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL); - d->pfifo.cache1.method_count = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT); - d->pfifo.cache1.error = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_STATE_ERROR); - break; - case NV_PFIFO_CACHE1_DMA_INSTANCE: - d->pfifo.cache1.dma_instance = - GET_MASK(value, NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MASK) << 4; - break; - case NV_PFIFO_CACHE1_DMA_PUT: - d->user.channel_control[d->pfifo.cache1.channel_id].dma_put = value; - break; - case NV_PFIFO_CACHE1_DMA_GET: - d->user.channel_control[d->pfifo.cache1.channel_id].dma_get = value; - break; - case NV_PFIFO_CACHE1_DMA_SUBROUTINE: - d->pfifo.cache1.subroutine_return = - (value & NV_PFIFO_CACHE1_DMA_SUBROUTINE_RETURN_OFFSET); - d->pfifo.cache1.subroutine_active = - (value & NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE); - break; - case NV_PFIFO_CACHE1_PULL0: { - qemu_mutex_lock(&d->pfifo.cache1.cache_lock); - - if ((value & NV_PFIFO_CACHE1_PULL0_ACCESS) - && !d->pfifo.cache1.pull_enabled) { - d->pfifo.cache1.pull_enabled = true; - - /* the puller thread should wake up */ - qemu_cond_signal(&d->pfifo.cache1.cache_cond); - } - else if (!(value & NV_PFIFO_CACHE1_PULL0_ACCESS) - && d->pfifo.cache1.pull_enabled) { - d->pfifo.cache1.pull_enabled = false; - } - - qemu_mutex_unlock(&d->pfifo.cache1.cache_lock); - break; - } - case NV_PFIFO_CACHE1_ENGINE: { - qemu_mutex_lock(&d->pfifo.cache1.cache_lock); - - for (i = 0; i < NV2A_NUM_SUBCHANNELS; i++) { - d->pfifo.cache1.bound_engines[i] = (FIFOEngine)((value >> (i * 2)) & 3); - } - - qemu_mutex_unlock(&d->pfifo.cache1.cache_lock); - break; - } - case NV_PFIFO_CACHE1_DMA_DCOUNT: - d->pfifo.cache1.dcount = - (value & NV_PFIFO_CACHE1_DMA_DCOUNT_VALUE); - break; - case NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW: - d->pfifo.cache1.get_jmp_shadow = - (value & NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW_OFFSET); - break; - case NV_PFIFO_CACHE1_DMA_RSVD_SHADOW: - d->pfifo.cache1.rsvd_shadow = value; - break; - case NV_PFIFO_CACHE1_DMA_DATA_SHADOW: - d->pfifo.cache1.data_shadow = value; - break; default: DEVICE_WRITE32_REG(pfifo); // Was : DEBUG_WRITE32_UNHANDLED(PFIFO); break; } + qemu_cond_broadcast(&d->pfifo.pusher_cond); + qemu_cond_broadcast(&d->pfifo.puller_cond); + + qemu_mutex_unlock(&d->pfifo.pfifo_lock); + DEVICE_WRITE32_END(PFIFO); } +static void pfifo_run_puller(NV2AState *d) +{ + uint32_t *pull0 = &d->pfifo.regs[NV_PFIFO_CACHE1_PULL0]; + uint32_t *pull1 = &d->pfifo.regs[NV_PFIFO_CACHE1_PULL1]; + uint32_t *engine_reg = &d->pfifo.regs[NV_PFIFO_CACHE1_ENGINE]; -/* pusher should be fine to run from a mimo handler -* whenever's it's convenient */ -static void pfifo_run_pusher(NV2AState *d) { - uint8_t channel_id; - ChannelControl *control; - Cache1State *state; - CacheEntry *command; - uint8_t *dma; - xbaddr dma_len; - uint32_t word; + uint32_t *status = &d->pfifo.regs[NV_PFIFO_CACHE1_STATUS]; + uint32_t *get_reg = &d->pfifo.regs[NV_PFIFO_CACHE1_GET]; + uint32_t *put_reg = &d->pfifo.regs[NV_PFIFO_CACHE1_PUT]; - /* TODO: How is cache1 selected? */ - state = &d->pfifo.cache1; - channel_id = state->channel_id; - control = &d->user.channel_control[channel_id]; + // TODO + // CacheEntry working_cache[NV2A_CACHE1_SIZE]; + // int working_cache_size = 0; + // pull everything into our own queue - if (!state->push_enabled) - return; + // TODO think more about locking + + while (true) { + if (!GET_MASK(*pull0, NV_PFIFO_CACHE1_PULL0_ACCESS)) return; + + /* empty cache1 */ + if (*status & NV_PFIFO_CACHE1_STATUS_LOW_MARK) break; + + uint32_t get = *get_reg; + uint32_t put = *put_reg; + + assert(get < 128*4 && (get % 4) == 0); + uint32_t method_entry = d->pfifo.regs[NV_PFIFO_CACHE1_METHOD + get*2]; + uint32_t parameter = d->pfifo.regs[NV_PFIFO_CACHE1_DATA + get*2]; + + uint32_t new_get = (get+4) & 0x1fc; + *get_reg = new_get; + + if (new_get == put) { + // set low mark + *status |= NV_PFIFO_CACHE1_STATUS_LOW_MARK; + } + if (*status & NV_PFIFO_CACHE1_STATUS_HIGH_MARK) { + // unset high mark + *status &= ~NV_PFIFO_CACHE1_STATUS_HIGH_MARK; + // signal pusher + qemu_cond_signal(&d->pfifo.pusher_cond); + } - /* only handling DMA for now... */ + uint32_t method = method_entry & 0x1FFC; + uint32_t subchannel = GET_MASK(method_entry, NV_PFIFO_CACHE1_METHOD_SUBCHANNEL); - /* Channel running DMA */ - uint32_t channel_modes = d->pfifo.regs[NV_PFIFO_MODE]; - assert(channel_modes & (1 << channel_id)); - assert(state->mode == FIFO_DMA); + // NV2A_DPRINTF("pull %d 0x%08X 0x%08X - subch %d\n", get/4, method_entry, parameter, subchannel); - if (!state->dma_push_enabled) - return; - if (state->dma_push_suspended) - return; + if (method == 0) { + RAMHTEntry entry = ramht_lookup(d, parameter); + assert(entry.valid); - /* We're running so there should be no pending errors... */ - assert(state->error == NV_PFIFO_CACHE1_DMA_STATE_ERROR_NONE); + // assert(entry.channel_id == state->channel_id); - dma = (uint8_t*)nv_dma_map(d, state->dma_instance, &dma_len); + assert(entry.engine == ENGINE_GRAPHICS); - NV2A_DPRINTF("DMA pusher: max 0x%08X, 0x%08X - 0x%08X\n", - dma_len, control->dma_get, control->dma_put); - /* based on the convenient pseudocode in envytools */ - while (control->dma_get != control->dma_put) { - if (control->dma_get >= dma_len) { + /* the engine is bound to the subchannel */ + assert(subchannel < 8); + SET_MASK(*engine_reg, 3 << (4*subchannel), entry.engine); + SET_MASK(*pull1, NV_PFIFO_CACHE1_PULL1_ENGINE, entry.engine); + // NV2A_DPRINTF("engine_reg1 %d 0x%08X\n", subchannel, *engine_reg); - state->error = NV_PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION; - break; - } - word = ldl_le_p((uint32_t*)(dma + control->dma_get)); - control->dma_get += 4; + // TODO: this is fucked + qemu_mutex_lock(&d->pgraph.pgraph_lock); + //make pgraph busy + qemu_mutex_unlock(&d->pfifo.pfifo_lock); - if (state->method_count) { - /* data word of methods command */ - state->data_shadow = word; + pgraph_switch_context(d, entry.channel_id); + pgraph_wait_fifo_access(d); + pgraph_handle_method(d, subchannel, 0, entry.instance); - command = (CacheEntry*)g_malloc0(sizeof(CacheEntry)); - command->method = state->method; - command->subchannel = state->subchannel; - command->nonincreasing = state->method_nonincreasing; - command->parameter = word; + // make pgraph not busy + qemu_mutex_unlock(&d->pgraph.pgraph_lock); + qemu_mutex_lock(&d->pfifo.pfifo_lock); - qemu_mutex_lock(&state->cache_lock); - state->cache.push(command); - qemu_cond_signal(&state->cache_cond); - qemu_mutex_unlock(&state->cache_lock); + } else if (method >= 0x100) { + // method passed to engine - if (!state->method_nonincreasing) { - state->method += 4; - } - state->method_count--; - state->dcount++; - } else { - /* no command active - this is the first word of a new one */ - state->rsvd_shadow = word; - /* match all forms */ - if ((word & 0xe0000003) == 0x20000000) { - /* old jump */ - state->get_jmp_shadow = control->dma_get; - control->dma_get = word & 0x1fffffff; - NV2A_DPRINTF("pb OLD_JMP 0x%08X\n", control->dma_get); - } else if ((word & 3) == 1) { - /* jump */ - state->get_jmp_shadow = control->dma_get; - control->dma_get = word & 0xfffffffc; - NV2A_DPRINTF("pb JMP 0x%08X\n", control->dma_get); - } else if ((word & 3) == 2) { - /* call */ - if (state->subroutine_active) { - state->error = NV_PFIFO_CACHE1_DMA_STATE_ERROR_CALL; - break; - } - state->subroutine_return = control->dma_get; - state->subroutine_active = true; - control->dma_get = word & 0xfffffffc; - NV2A_DPRINTF("pb CALL 0x%08X\n", control->dma_get); - } else if (word == 0x00020000) { - /* return */ - if (!state->subroutine_active) { - state->error = NV_PFIFO_CACHE1_DMA_STATE_ERROR_RETURN; - break; - } - control->dma_get = state->subroutine_return; - state->subroutine_active = false; - NV2A_DPRINTF("pb RET 0x%08X\n", control->dma_get); - } else if ((word & 0xe0030003) == 0) { - /* increasing methods */ - state->method = word & 0x1fff; - state->subchannel = (word >> 13) & 7; - state->method_count = (word >> 18) & 0x7ff; - state->method_nonincreasing = false; - state->dcount = 0; - } else if ((word & 0xe0030003) == 0x40000000) { - /* non-increasing methods */ - state->method = word & 0x1fff; - state->subchannel = (word >> 13) & 7; - state->method_count = (word >> 18) & 0x7ff; - state->method_nonincreasing = true; - state->dcount = 0; - } else { - NV2A_DPRINTF("pb reserved cmd 0x%08X - 0x%08X\n", - control->dma_get, word); - state->error = NV_PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD; - break; - } - } - } + /* methods that take objects. + * TODO: Check this range is correct for the nv2a */ + if (method >= 0x180 && method < 0x200) { + //qemu_mutex_lock_iothread(); + RAMHTEntry entry = ramht_lookup(d, parameter); + assert(entry.valid); + // assert(entry.channel_id == state->channel_id); + parameter = entry.instance; + //qemu_mutex_unlock_iothread(); + } - NV2A_DPRINTF("DMA pusher done: max 0x%08X, 0x%08X - 0x%08X\n", - dma_len, control->dma_get, control->dma_put); + enum FIFOEngine engine = (enum FIFOEngine)GET_MASK(*engine_reg, 3 << (4*subchannel)); + // NV2A_DPRINTF("engine_reg2 %d 0x%08X\n", subchannel, *engine_reg); + assert(engine == ENGINE_GRAPHICS); + SET_MASK(*pull1, NV_PFIFO_CACHE1_PULL1_ENGINE, engine); - if (state->error) { - NV2A_DPRINTF("pb error: %d\n", state->error); - assert(false); + // TODO: this is fucked + qemu_mutex_lock(&d->pgraph.pgraph_lock); + //make pgraph busy + qemu_mutex_unlock(&d->pfifo.pfifo_lock); - state->dma_push_suspended = true; + pgraph_wait_fifo_access(d); + pgraph_handle_method(d, subchannel, method, parameter); - d->pfifo.pending_interrupts |= NV_PFIFO_INTR_0_DMA_PUSHER; - update_irq(d); - } + // make pgraph not busy + qemu_mutex_unlock(&d->pgraph.pgraph_lock); + qemu_mutex_lock(&d->pfifo.pfifo_lock); + } else { + assert(false); + } + + } } int pfifo_puller_thread(NV2AState *d) { - CxbxSetThreadName("Cxbx NV2A FIFO"); + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + CxbxSetThreadName("Cxbx NV2A FIFO puller"); - Cache1State *state = &(d->pfifo.cache1); + glo_set_current(d->pgraph.gl_context); - glo_set_current(d->pgraph.gl_context); + qemu_mutex_lock(&d->pfifo.pfifo_lock); + while (true) { + pfifo_run_puller(d); + qemu_cond_wait(&d->pfifo.puller_cond, &d->pfifo.pfifo_lock); - while (true) { - qemu_mutex_lock(&state->cache_lock); + if (d->exiting) { + break; + } + } + qemu_mutex_unlock(&d->pfifo.pfifo_lock); - while (state->cache.empty() || !state->pull_enabled) { - qemu_cond_wait(&state->cache_cond, &state->cache_lock); + glo_set_current(NULL); // Cxbx addition - if (d->exiting) { - qemu_mutex_unlock(&state->cache_lock); - glo_set_current(NULL); - return 0; - } - } + return NULL; +} - // Copy cache to working_cache - while (!state->cache.empty()) { - state->working_cache.push(state->cache.front()); - state->cache.pop(); - } +static void pfifo_run_pusher(NV2AState *d) +{ + uint32_t *push0 = &d->pfifo.regs[NV_PFIFO_CACHE1_PUSH0]; + uint32_t *push1 = &d->pfifo.regs[NV_PFIFO_CACHE1_PUSH1]; + uint32_t *dma_subroutine = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_SUBROUTINE]; + uint32_t *dma_state = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_STATE]; + uint32_t *dma_push = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_PUSH]; + uint32_t *dma_get = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET]; + uint32_t *dma_put = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_PUT]; + uint32_t *dma_dcount = &d->pfifo.regs[NV_PFIFO_CACHE1_DMA_DCOUNT]; - qemu_mutex_unlock(&state->cache_lock); + uint32_t *status = &d->pfifo.regs[NV_PFIFO_CACHE1_STATUS]; + uint32_t *get_reg = &d->pfifo.regs[NV_PFIFO_CACHE1_GET]; + uint32_t *put_reg = &d->pfifo.regs[NV_PFIFO_CACHE1_PUT]; - qemu_mutex_lock(&d->pgraph.lock); + if (!GET_MASK(*push0, NV_PFIFO_CACHE1_PUSH0_ACCESS)) return; + if (!GET_MASK(*dma_push, NV_PFIFO_CACHE1_DMA_PUSH_ACCESS)) return; - while (!state->working_cache.empty()) { - CacheEntry* command = state->working_cache.front(); - state->working_cache.pop(); + /* suspended */ + if (GET_MASK(*dma_push, NV_PFIFO_CACHE1_DMA_PUSH_STATUS)) return; - if (command->method == 0) { - // qemu_mutex_lock_iothread(); - RAMHTEntry entry = ramht_lookup(d, command->parameter); - assert(entry.valid); + // TODO: should we become busy here?? + // NV_PFIFO_CACHE1_DMA_PUSH_STATE _BUSY - assert(entry.channel_id == state->channel_id); - // qemu_mutex_unlock_iothread(); + unsigned int channel_id = GET_MASK(*push1, + NV_PFIFO_CACHE1_PUSH1_CHID); - switch (entry.engine) { - case ENGINE_GRAPHICS: - pgraph_switch_context(d, entry.channel_id); - pgraph_wait_fifo_access(d); - pgraph_handle_method(d, command->subchannel, 0, entry.instance); - break; - default: - assert(false); - break; - } - /* the engine is bound to the subchannel */ - qemu_mutex_lock(&state->cache_lock); - state->bound_engines[command->subchannel] = entry.engine; - state->last_engine = entry.engine; - qemu_mutex_unlock(&state->cache_lock); - } - else if (command->method >= 0x100) { - /* method passed to engine */ + /* Channel running DMA */ + uint32_t channel_modes = d->pfifo.regs[NV_PFIFO_MODE]; + assert(channel_modes & (1 << channel_id)); - uint32_t parameter = command->parameter; + assert(GET_MASK(*push1, NV_PFIFO_CACHE1_PUSH1_MODE) + == NV_PFIFO_CACHE1_PUSH1_MODE_DMA); - /* methods that take objects. - * TODO: Check this range is correct for the nv2a */ - if (command->method >= 0x180 && command->method < 0x200) { - //qemu_mutex_lock_iothread(); - RAMHTEntry entry = ramht_lookup(d, parameter); - assert(entry.valid); - assert(entry.channel_id == state->channel_id); - parameter = entry.instance; - //qemu_mutex_unlock_iothread(); - } + /* We're running so there should be no pending errors... */ + assert(GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR) + == NV_PFIFO_CACHE1_DMA_STATE_ERROR_NONE); - // state->cache_lock.lock(); - enum FIFOEngine engine = state->bound_engines[command->subchannel]; - // state->cache_lock.unlock(); + hwaddr dma_instance = + GET_MASK(d->pfifo.regs[NV_PFIFO_CACHE1_DMA_INSTANCE], + NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MASK) << 4; // TODO : Use NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MOVE? - switch (engine) { - case ENGINE_GRAPHICS: - pgraph_wait_fifo_access(d); - pgraph_handle_method(d, command->subchannel, - command->method, parameter); - break; - default: - // TODO: FIx this - // assert(false); - break; - } + hwaddr dma_len; + uint8_t *dma = (uint8_t*)nv_dma_map(d, dma_instance, &dma_len); - // state->cache_lock.lock(); - state->last_engine = state->bound_engines[command->subchannel]; - // state->cache_lock.unlock(); - } - else - NV2A_DPRINTF("FIFO: Unknown Method - 0x%08X\n", - command->method); + /* based on the convenient pseudocode in envytools */ + while (true) { + uint32_t dma_get_v = *dma_get; + uint32_t dma_put_v = *dma_put; + if (dma_get_v == dma_put_v) break; + if (dma_get_v >= dma_len) { + assert(false); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR, + NV_PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION); + break; + } - g_free(command); - } + uint32_t word = ldl_le_p((uint32_t*)(dma + dma_get_v)); + dma_get_v += 4; - qemu_mutex_unlock(&d->pgraph.lock); - } + uint32_t method_type = + GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE); + uint32_t method_subchannel = + GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL); + uint32_t method = + GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD) << 2; + uint32_t method_count = + GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT); + + uint32_t subroutine_state = + GET_MASK(*dma_subroutine, NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE); + + if (method_count) { + /* full */ + if (*status & NV_PFIFO_CACHE1_STATUS_HIGH_MARK) return; + + + /* data word of methods command */ + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_DATA_SHADOW] = word; + + uint32_t put = *put_reg; + uint32_t get = *get_reg; + + assert((method & 3) == 0); + uint32_t method_entry = 0; + SET_MASK(method_entry, NV_PFIFO_CACHE1_METHOD_ADDRESS, method >> 2); + SET_MASK(method_entry, NV_PFIFO_CACHE1_METHOD_TYPE, method_type); + SET_MASK(method_entry, NV_PFIFO_CACHE1_METHOD_SUBCHANNEL, method_subchannel); + + // NV2A_DPRINTF("push %d 0x%08X 0x%08X - subch %d\n", put/4, method_entry, word, method_subchannel); + + assert(put < 128*4 && (put%4) == 0); + d->pfifo.regs[NV_PFIFO_CACHE1_METHOD + put*2] = method_entry; + d->pfifo.regs[NV_PFIFO_CACHE1_DATA + put*2] = word; + + uint32_t new_put = (put+4) & 0x1fc; + *put_reg = new_put; + if (new_put == get) { + // set high mark + *status |= NV_PFIFO_CACHE1_STATUS_HIGH_MARK; + } + if (*status & NV_PFIFO_CACHE1_STATUS_LOW_MARK) { + // unset low mark + *status &= ~NV_PFIFO_CACHE1_STATUS_LOW_MARK; + // signal puller + qemu_cond_signal(&d->pfifo.puller_cond); + } + + if (method_type == NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_INC) { + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD, + (method + 4) >> 2); + } + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT, + method_count - 1); + (*dma_dcount)++; + } else { + /* no command active - this is the first word of a new one */ + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_RSVD_SHADOW] = word; + + /* match all forms */ + if ((word & 0xe0000003) == 0x20000000) { + /* old jump */ + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW] = + dma_get_v; + dma_get_v = word & 0x1fffffff; + NV2A_DPRINTF("pb OLD_JMP 0x%08X\n", dma_get_v); + } else if ((word & 3) == 1) { + /* jump */ + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW] = + dma_get_v; + dma_get_v = word & 0xfffffffc; + NV2A_DPRINTF("pb JMP 0x%08X\n", dma_get_v); + } else if ((word & 3) == 2) { + /* call */ + if (subroutine_state) { + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR, + NV_PFIFO_CACHE1_DMA_STATE_ERROR_CALL); + break; + } else { + *dma_subroutine = dma_get_v; + SET_MASK(*dma_subroutine, + NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE, 1); + dma_get_v = word & 0xfffffffc; + NV2A_DPRINTF("pb CALL 0x%08X\n", dma_get_v); + } + } else if (word == 0x00020000) { + /* return */ + if (!subroutine_state) { + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR, + NV_PFIFO_CACHE1_DMA_STATE_ERROR_RETURN); + // break; + } else { + dma_get_v = *dma_subroutine & 0xfffffffc; + SET_MASK(*dma_subroutine, + NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE, 0); + NV2A_DPRINTF("pb RET 0x%08X\n", dma_get_v); + } + } else if ((word & 0xe0030003) == 0) { + /* increasing methods */ + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD, + (word & 0x1fff) >> 2 ); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL, + (word >> 13) & 7); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT, + (word >> 18) & 0x7ff); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE, + NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_INC); + *dma_dcount = 0; + } else if ((word & 0xe0030003) == 0x40000000) { + /* non-increasing methods */ + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD, + (word & 0x1fff) >> 2 ); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL, + (word >> 13) & 7); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT, + (word >> 18) & 0x7ff); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE, + NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_NON_INC); + *dma_dcount = 0; + } else { + NV2A_DPRINTF("pb reserved cmd 0x%08X - 0x%08X\n", + dma_get_v, word); + SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR, + NV_PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD); + // break; + assert(false); + } + } + + *dma_get = dma_get_v; + + if (GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR)) { + break; + } + } + + // NV2A_DPRINTF("DMA pusher done: max 0x%08X, 0x%08X - 0x%08X\n", + // dma_len, control->dma_get, control->dma_put); + + uint32_t error = GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR); + if (error) { + NV2A_DPRINTF("pb error: %d\n", error); + assert(false); + + SET_MASK(*dma_push, NV_PFIFO_CACHE1_DMA_PUSH_STATUS, 1); /* suspended */ + + // d->pfifo.pending_interrupts |= NV_PFIFO_INTR_0_DMA_PUSHER; + // update_irq(d); + } +} + +int pfifo_pusher_thread(NV2AState *d) +{ + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); + CxbxSetThreadName("Cxbx NV2A FIFO pusher"); + + qemu_mutex_lock(&d->pfifo.pfifo_lock); + while (true) { + pfifo_run_pusher(d); + qemu_cond_wait(&d->pfifo.pusher_cond, &d->pfifo.pfifo_lock); + + if (d->exiting) { + break; + } + } + qemu_mutex_unlock(&d->pfifo.pfifo_lock); return 0; } @@ -492,7 +486,10 @@ static uint32_t ramht_hash(NV2AState *d, uint32_t handle) hash ^= (handle & ((1 << bits) - 1)); handle >>= bits; } - hash ^= d->pfifo.cache1.channel_id << (bits - 4); + + unsigned int channel_id = GET_MASK(d->pfifo.regs[NV_PFIFO_CACHE1_PUSH1], + NV_PFIFO_CACHE1_PUSH1_CHID); + hash ^= channel_id << (bits - 4); return hash; } @@ -502,7 +499,7 @@ static RAMHTEntry ramht_lookup(NV2AState *d, uint32_t handle) uint32_t hash = ramht_hash(d, handle); assert(hash * 8 < ramht_size(d)); - uint32_t ramht_address = + xbaddr ramht_address = GET_MASK(d->pfifo.regs[NV_PFIFO_RAMHT], NV_PFIFO_RAMHT_BASE_ADDRESS_MASK) << 12; diff --git a/src/devices/video/EmuNV2A_PGRAPH.cpp b/src/devices/video/EmuNV2A_PGRAPH.cpp index f0b993352..c8df89c70 100644 --- a/src/devices/video/EmuNV2A_PGRAPH.cpp +++ b/src/devices/video/EmuNV2A_PGRAPH.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pgraph.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + // FIXME #define qemu_mutex_lock_iothread() #define qemu_mutex_unlock_iothread() @@ -125,35 +160,54 @@ static const GLenum pgraph_stencil_op_map[] = { GL_DECR_WRAP, }; +enum FormatEncoding { + linear = 0, + swizzled, // for all NV097_SET_TEXTURE_FORMAT_*_SZ_* + compressed // for all NV097_SET_TEXTURE_FORMAT_*_DXT* +}; + typedef struct ColorFormatInfo { - unsigned int bytes_per_pixel; - bool linear; + unsigned int bytes_per_pixel; // Derived from the total number of channel bits + FormatEncoding encoding; GLint gl_internal_format; - GLenum gl_format; + GLenum gl_format; // == 0 for compressed formats GLenum gl_type; - GLenum gl_swizzle_mask[4]; + GLint *gl_swizzle_mask; // == nullptr when gl_internal_format, gl_format and gl_type are sufficient } ColorFormatInfo; +// Resulting gl_internal_format, gl_format and gl_type values, for formats handled by convert_texture_data() +#define GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV + +static GLint gl_swizzle_mask_0RG1[4] = { GL_ZERO, GL_RED, GL_GREEN, GL_ONE }; +static GLint gl_swizzle_mask_111R[4] = { GL_ONE, GL_ONE, GL_ONE, GL_RED }; +static GLint gl_swizzle_mask_ARGB[4] = { GL_ALPHA, GL_RED, GL_GREEN, GL_BLUE }; +static GLint gl_swizzle_mask_BGRA[4] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA }; +static GLint gl_swizzle_mask_GGGR[4] = { GL_GREEN, GL_GREEN, GL_GREEN, GL_RED }; +static GLint gl_swizzle_mask_R0G1[4] = { GL_RED, GL_ZERO, GL_GREEN, GL_ONE }; +static GLint gl_swizzle_mask_RRR1[4] = { GL_RED, GL_RED, GL_RED, GL_ONE }; +static GLint gl_swizzle_mask_RRRG[4] = { GL_RED, GL_RED, GL_RED, GL_GREEN }; +static GLint gl_swizzle_mask_RRRR[4] = { GL_RED, GL_RED, GL_RED, GL_RED }; + // Note : Avoid designated initializers to facilitate C++ builds static const ColorFormatInfo kelvin_color_format_map[256] = { //0x00 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y8] = - {1, false, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_RED, GL_RED, GL_RED, GL_ONE}}, + {1, swizzled, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_RRR1}, //0x01 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_AY8] = - {1, false, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_RED, GL_RED, GL_RED, GL_RED}}, + {1, swizzled, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_RRRR}, //0x02 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A1R5G5B5] = - {2, false, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, + {2, swizzled, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, //0x03 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X1R5G5B5] = - {2, false, GL_RGB5, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, + {2, swizzled, GL_RGB5, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, //0x04 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A4R4G4B4] = - {2, false, GL_RGBA4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, + {2, swizzled, GL_RGBA4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, //0x05 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R5G6B5] = - {2, false, GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, + {2, swizzled, GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, //0x06 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8R8G8B8] = - {4, false, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, + {4, swizzled, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, //0x07 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X8R8G8B8] = - {4, false, GL_RGB8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, + {4, swizzled, GL_RGB8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, //0x08 [?] = {}, //0x09 [?] = @@ -162,133 +216,140 @@ static const ColorFormatInfo kelvin_color_format_map[256] = { {}, /* paletted texture */ - //0x0B [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8] = - {1, false, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, + //0x0B [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8] = // See convert_texture_data + {1, swizzled, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, //0x0C [NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT1_A1R5G5B5] = - {4, false, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0, GL_RGBA}, + {4, compressed, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0, GL_RGBA}, //0x0D [?] = {}, //0x0E [NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT23_A8R8G8B8] = - {4, false, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0, GL_RGBA}, + {4, compressed, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0, GL_RGBA}, //0x0F [NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT45_A8R8G8B8] = - {4, false, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0, GL_RGBA}, + {4, compressed, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0, GL_RGBA}, //0x10 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A1R5G5B5] = - {2, true, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, + {2, linear, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, //0x11 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G6B5] = - {2, true, GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, + {2, linear, GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, //0x12 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8R8G8B8] = - {4, true, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, + {4, linear, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, //0x13 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y8] = - {1, true, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_RED, GL_RED, GL_RED, GL_ONE}}, - //0x14 [?] = - {}, - //0x15 [?] = - {}, - //0x16 [?] = - {}, - //0x17 [?] = - {}, - //0x18 [?] = - {}, + {1, linear, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_RRR1}, + //0x14 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_SY8] = + {1, linear, GL_R8_SNORM, GL_RED, GL_BYTE, + gl_swizzle_mask_RRR1}, // TODO : Verify + //0x15 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X7SY9] = // See convert_texture_data FIXME + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify + //0x16 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R8B8] = + {2, linear, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_R0G1}, // TODO : Verify + //0x17 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_G8B8] = + {2, linear, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_0RG1}, // TODO : Verify + //0x18 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_SG8SB8] = + {2, linear, GL_RG8_SNORM, GL_RG, GL_BYTE, + gl_swizzle_mask_0RG1}, // TODO : Verify //0x19 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8] = - {1, false, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_ONE, GL_ONE, GL_ONE, GL_RED}}, + {1, swizzled, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_111R}, //0x1A [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8Y8] = - {2, false, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, - {GL_GREEN, GL_GREEN, GL_GREEN, GL_RED}}, + {2, swizzled, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_GGGR}, //0x1B [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_AY8] = - {1, true, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_RED, GL_RED, GL_RED, GL_RED}}, + {1, linear, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_RRRR}, //0x1C [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X1R5G5B5] = - {2, true, GL_RGB5, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, + {2, linear, GL_RGB5, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, //0x1D [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A4R4G4B4] = - {2, false, GL_RGBA4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, + {2, linear, GL_RGBA4, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV}, // TODO : Verify this is truely linear //0x1E [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X8R8G8B8] = - {4, true, GL_RGB8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, + {4, linear, GL_RGB8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, //0x1F [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8] = - {1, true, GL_R8, GL_RED, GL_UNSIGNED_BYTE, - {GL_ONE, GL_ONE, GL_ONE, GL_RED}}, + {1, linear, GL_R8, GL_RED, GL_UNSIGNED_BYTE, + gl_swizzle_mask_111R}, //0x20 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8Y8] = - {2, true, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, - {GL_GREEN, GL_GREEN, GL_GREEN, GL_RED}}, + {2, linear, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_GGGR}, //0x21 [?] = {}, //0x22 [?] = {}, //0x23 [?] = {}, - //0x24 [NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8] = - { 2, true, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV }, // TODO: format conversion - //0x25 [?] = - {}, - //0x26 [?] = - {}, + //0x24 [NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8] = // See convert_texture_data calling ____UYVYToARGBRow_C + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify + //0x25 [NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_YB8CR8YA8CB8] = // See convert_texture_data calling ____YUY2ToARGBRow_C + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify + //0x26 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8CR8CB8Y8] = // See convert_texture_data FIXME + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify - //0x27 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5] = - {2, false, GL_RGB8_SNORM, GL_RGB, GL_BYTE}, /* FIXME: This might be signed */ + //0x27 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5] = // See convert_texture_data calling __R6G5B5ToARGBRow_C + {2, swizzled, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify //0x28 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_G8B8] = - {2, false, GL_RG8_SNORM, GL_RG, GL_BYTE, /* FIXME: This might be signed */ - {GL_ZERO, GL_RED, GL_GREEN, GL_ONE}}, + {2, swizzled, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_0RG1}, //0x29 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8B8] = - {2, false, GL_RG8_SNORM, GL_RG, GL_BYTE, /* FIXME: This might be signed */ - {GL_RED, GL_ZERO, GL_GREEN, GL_ONE}}, - //0x2A [?] = - {}, - //0x2B [?] = - {}, - //0x2C [?] = - {}, - //0x2D [?] = - {}, + {2, swizzled, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, + gl_swizzle_mask_R0G1}, + //0x2A [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FIXED] = + {4, swizzled, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, // TODO : Verify + //0x2B [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FLOAT] = + {4, swizzled, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV}, // TODO : Verify + //0x2C [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FIXED] = + {2, swizzled, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, // TODO : Verify + //0x2D [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FLOAT] = + {2, swizzled, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_FLOAT}, // TODO : Verify /* TODO: format conversion */ //0x2E [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_X8_Y24_FIXED] = - {4, true, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, + {4, linear, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, //0x2F [?] = {}, //0x30 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FIXED] = - {2, true, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, - //0x31 [?] = - {}, - //0x32 [?] = - {}, - //0x33 [?] = - {}, - //0x34 [?] = - {}, + {2, linear, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, + //0x31 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FLOAT] = + {2, linear, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_FLOAT}, // TODO : Verify + //0x32 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y16] = + {2, swizzled, GL_R16, GL_RED, GL_UNSIGNED_SHORT, // TODO : Verify + gl_swizzle_mask_RRR1}, + //0x33 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_YB16YA16] = + {4, swizzled, GL_RG16, GL_RG, GL_UNSIGNED_SHORT, // TODO : Verify + gl_swizzle_mask_RRRG}, + //0x34 [NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_A4V6YB6A4U6YA6] = // TODO : handle in convert_texture_data + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify //0x35 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16] = - {2, true, GL_R16, GL_RED, GL_UNSIGNED_SHORT, - {GL_RED, GL_RED, GL_RED, GL_ONE}}, - //0x36 [?] = - {}, - //0x37 [?] = - {}, - //0x38 [?] = - {}, - //0x39 [?] = - {}, + {2, linear, GL_R16, GL_RED, GL_UNSIGNED_SHORT, + gl_swizzle_mask_RRR1}, + //0x36 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_YB16YA16] = + {4, linear, GL_RG16, GL_RG, GL_UNSIGNED_SHORT, // TODO : Verify + gl_swizzle_mask_RRRG}, + //0x37 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R6G5B5] = // See convert_texture_data calling __R6G5B5ToARGBRow_C + {2, linear, GL_CONVERT_TEXTURE_DATA_RESULTING_FORMAT}, // TODO : Verify + //0x38 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R5G5B5A1] = + {2, swizzled, GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1}, // TODO : Verify + //0x39 [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R4G4B4A4] = + {2, swizzled, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4}, // TODO : Verify //0x3A [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8B8G8R8] = - {4, false, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, - //0x3B [?] = - {}, + {4, swizzled, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // TODO : Verify + //0x3B [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_B8G8R8A8] = + {4, swizzled, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8}, // TODO : Verify //0x3C [NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8G8B8A8] = - {4, false, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8}, - //0x3D [?] = - {}, - //0x3E [?] = - {}, + {4, swizzled, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8}, + //0x3D [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G5B5A1] = + {2, linear, GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1}, // TODO : Verify + //0x3E [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R4G4B4A4] = + {2, linear, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4}, // TODO : Verify //0x3F [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8B8G8R8] = - {4, true, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, + {4, linear, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV}, // TODO : Verify //0x40 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_B8G8R8A8] = - {4, true, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8}, + {4, linear, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8}, // TODO : Verify //0x41 [NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R8G8B8A8] = - {4, true, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8}, + {4, linear, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8}, // TODO : Verify }; typedef struct SurfaceColorFormatInfo { @@ -319,9 +380,9 @@ static const SurfaceColorFormatInfo kelvin_surface_color_format_map[16] = { //0x08 [NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8] = {4, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, //0x09 [NV097_SET_SURFACE_FORMAT_COLOR_LE_B8] = - {}, // TODO : {1, GL_R8, GL_R8, GL_UNSIGNED_BYTE}, // PatrickvL guesstimate + {}, // TODO : {1, GL_R8, GL_RED, GL_UNSIGNED_BYTE}, // PatrickvL guesstimate //0x0A [NV097_SET_SURFACE_FORMAT_COLOR_LE_G8B8] = - {}, + {}, // TODO : {2, GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, // PatrickvL guesstimate //0x0B [?] = {}, //0x0C [?] = @@ -334,10 +395,16 @@ static const SurfaceColorFormatInfo kelvin_surface_color_format_map[16] = { {} }; -static void pgraph_switch_context(NV2AState *d, unsigned int channel_id); -static void pgraph_set_context_user(NV2AState *d, uint32_t value); -static void pgraph_wait_fifo_access(NV2AState *d); -static void pgraph_handle_method(NV2AState *d, unsigned int subchannel, unsigned int method, uint32_t parameter); +void (*pgraph_draw_arrays)(NV2AState *d); +void (*pgraph_draw_inline_buffer)(NV2AState *d); +void (*pgraph_draw_inline_array)(NV2AState *d); +void (*pgraph_draw_inline_elements)(NV2AState *d); +void (*pgraph_draw_state_update)(NV2AState *d); +void (*pgraph_draw_clear)(NV2AState *d); + +//static void pgraph_set_context_user(NV2AState *d, uint32_t value); +void pgraph_handle_method(NV2AState *d, unsigned int subchannel, unsigned int method, uint32_t parameter); +static void pgraph_log_method(unsigned int subchannel, unsigned int graphics_class, unsigned int method, uint32_t parameter); static void pgraph_allocate_inline_buffer_vertices(PGRAPHState *pg, unsigned int attr); static void pgraph_finish_inline_buffer_vertex(PGRAPHState *pg); static void pgraph_update_shader_constants(PGRAPHState *pg, ShaderBinding *binding, bool binding_changed, bool vertex_program, bool fixed_function); @@ -355,14 +422,10 @@ static void pgraph_update_memory_buffer(NV2AState *d, hwaddr addr, hwaddr size, static void pgraph_bind_vertex_attributes(NV2AState *d, unsigned int num_elements, bool inline_data, unsigned int inline_stride); static unsigned int pgraph_bind_inline_array(NV2AState *d); -static void load_graphics_object(NV2AState *d, hwaddr instance_address, GraphicsObject *obj); -static GraphicsObject* lookup_graphics_object(PGRAPHState *s, hwaddr instance_address); static float convert_f16_to_float(uint16_t f16); static float convert_f24_to_float(uint32_t f24); -static uint8_t cliptobyte(int x); -static void convert_yuy2_to_rgb(const uint8_t *line, unsigned int ix, uint8_t *r, uint8_t *g, uint8_t* b); -static uint8_t* convert_texture_data(const TextureShape s, const uint8_t *data, const uint8_t *palette_data, unsigned int width, unsigned int height, unsigned int depth, unsigned int row_pitch, unsigned int slice_pitch); -static void upload_gl_texture(GLenum gl_target, const TextureShape s, const uint8_t *texture_data, const uint8_t *palette_data); +static uint8_t* convert_texture_data(const unsigned int color_format, const uint8_t *data, const uint8_t *palette_data, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int row_pitch, const unsigned int slice_pitch); +static int upload_gl_texture(GLenum gl_target, const TextureShape s, const uint8_t *texture_data, const uint8_t *palette_data); static TextureBinding* generate_texture(const TextureShape s, const uint8_t *texture_data, const uint8_t *palette_data); static guint texture_key_hash(gconstpointer key); static gboolean texture_key_equal(gconstpointer a, gconstpointer b); @@ -374,14 +437,13 @@ static gboolean shader_equal(gconstpointer a, gconstpointer b); static unsigned int kelvin_map_stencil_op(uint32_t parameter); static unsigned int kelvin_map_polygon_mode(uint32_t parameter); static unsigned int kelvin_map_texgen(uint32_t parameter, unsigned int channel); -static void pgraph_log_method(unsigned int subchannel, unsigned int graphics_class, unsigned int method, uint32_t parameter); static uint64_t fnv_hash(const uint8_t *data, size_t len); static uint64_t fast_hash(const uint8_t *data, size_t len, unsigned int samples); /* PGRAPH - accelerated 2d/3d drawing engine */ DEVICE_READ32(PGRAPH) { - qemu_mutex_lock(&d->pgraph.lock); + qemu_mutex_lock(&d->pgraph.pgraph_lock); DEVICE_READ32_SWITCH() { case NV_PGRAPH_INTR: @@ -390,60 +452,22 @@ DEVICE_READ32(PGRAPH) case NV_PGRAPH_INTR_EN: result = d->pgraph.enabled_interrupts; break; - case NV_PGRAPH_NSOURCE: - result = d->pgraph.notify_source; - break; - case NV_PGRAPH_CTX_USER: - SET_MASK(result, NV_PGRAPH_CTX_USER_CHANNEL_3D, - d->pgraph.context[d->pgraph.channel_id].channel_3d); - SET_MASK(result, NV_PGRAPH_CTX_USER_CHANNEL_3D_VALID, 1); - SET_MASK(result, NV_PGRAPH_CTX_USER_SUBCH, - d->pgraph.context[d->pgraph.channel_id].subchannel << 13); - SET_MASK(result, NV_PGRAPH_CTX_USER_CHID, d->pgraph.channel_id); - break; - case NV_PGRAPH_TRAPPED_ADDR: - SET_MASK(result, NV_PGRAPH_TRAPPED_ADDR_CHID, d->pgraph.trapped_channel_id); - SET_MASK(result, NV_PGRAPH_TRAPPED_ADDR_SUBCH, d->pgraph.trapped_subchannel); - SET_MASK(result, NV_PGRAPH_TRAPPED_ADDR_MTHD, d->pgraph.trapped_method); - break; - case NV_PGRAPH_TRAPPED_DATA_LOW: - result = d->pgraph.trapped_data[0]; - break; - case NV_PGRAPH_FIFO: - SET_MASK(result, NV_PGRAPH_FIFO_ACCESS, d->pgraph.fifo_access); - break; - case NV_PGRAPH_CHANNEL_CTX_TABLE: - result = d->pgraph.context_table >> 4; - break; - case NV_PGRAPH_CHANNEL_CTX_POINTER: - result = d->pgraph.context_address >> 4; - break; default: DEVICE_READ32_REG(pgraph); // Was : DEBUG_READ32_UNHANDLED(PGRAPH); } - qemu_mutex_unlock(&d->pgraph.lock); + qemu_mutex_unlock(&d->pgraph.pgraph_lock); // reg_log_read(NV_PGRAPH, addr, r); DEVICE_READ32_END(PGRAPH); } -static void pgraph_set_context_user(NV2AState *d, uint32_t value) -{ - d->pgraph.channel_id = (value & NV_PGRAPH_CTX_USER_CHID) >> 24; - - d->pgraph.context[d->pgraph.channel_id].channel_3d = - GET_MASK(value, NV_PGRAPH_CTX_USER_CHANNEL_3D); - d->pgraph.context[d->pgraph.channel_id].subchannel = - GET_MASK(value, NV_PGRAPH_CTX_USER_SUBCH); -} - DEVICE_WRITE32(PGRAPH) { // reg_log_write(NV_PGRAPH, addr, val); - qemu_mutex_lock(&d->pgraph.lock); + qemu_mutex_lock(&d->pgraph.pgraph_lock); switch (addr) { case NV_PGRAPH_INTR: @@ -453,12 +477,6 @@ DEVICE_WRITE32(PGRAPH) case NV_PGRAPH_INTR_EN: d->pgraph.enabled_interrupts = value; break; - case NV_PGRAPH_CTX_CONTROL: - d->pgraph.channel_valid = (value & NV_PGRAPH_CTX_CONTROL_CHID); - break; - case NV_PGRAPH_CTX_USER: - pgraph_set_context_user(d, value); - break; case NV_PGRAPH_INCREMENT: if (value & NV_PGRAPH_INCREMENT_READ_3D) { SET_MASK(d->pgraph.regs[NV_PGRAPH_SURFACE], @@ -470,88 +488,635 @@ DEVICE_WRITE32(PGRAPH) qemu_cond_broadcast(&d->pgraph.flip_3d); } break; - case NV_PGRAPH_FIFO: - d->pgraph.fifo_access = GET_MASK(value, NV_PGRAPH_FIFO_ACCESS); - qemu_cond_broadcast(&d->pgraph.fifo_access_cond); - break; - case NV_PGRAPH_CHANNEL_CTX_TABLE: - d->pgraph.context_table = - (value & NV_PGRAPH_CHANNEL_CTX_TABLE_INST) << 4; - break; - case NV_PGRAPH_CHANNEL_CTX_POINTER: - d->pgraph.context_address = - (value & NV_PGRAPH_CHANNEL_CTX_POINTER_INST) << 4; - break; - case NV_PGRAPH_CHANNEL_CTX_TRIGGER: + case NV_PGRAPH_CHANNEL_CTX_TRIGGER: { + xbaddr context_address = + GET_MASK(d->pgraph.regs[NV_PGRAPH_CHANNEL_CTX_POINTER], NV_PGRAPH_CHANNEL_CTX_POINTER_INST) << 4; if (value & NV_PGRAPH_CHANNEL_CTX_TRIGGER_READ_IN) { - NV2A_DPRINTF("PGRAPH: read channel %d context from %" HWADDR_PRIx "\n", - d->pgraph.channel_id, d->pgraph.context_address); + unsigned pgraph_channel_id = + GET_MASK(d->pgraph.regs[NV_PGRAPH_CTX_USER], NV_PGRAPH_CTX_USER_CHID); - uint8_t *context_ptr = d->pramin.ramin_ptr + d->pgraph.context_address; + NV2A_DPRINTF("PGRAPH: read channel %d context from %" HWADDR_PRIx "\n", + pgraph_channel_id, context_address); + + uint8_t *context_ptr = d->pramin.ramin_ptr + context_address; uint32_t context_user = ldl_le_p((uint32_t*)context_ptr); - NV2A_DPRINTF(" - CTX_USER = 0x%x\n", context_user); + NV2A_DPRINTF(" - CTX_USER = 0x%08X\n", context_user); - - pgraph_set_context_user(d, context_user); + d->pgraph.regs[NV_PGRAPH_CTX_USER] = context_user; + // pgraph_set_context_user(d, context_user); } if (value & NV_PGRAPH_CHANNEL_CTX_TRIGGER_WRITE_OUT) { /* do stuff ... */ } break; + } default: DEVICE_WRITE32_REG(pgraph); // Was : DEBUG_WRITE32_UNHANDLED(PGRAPH); break; } - qemu_mutex_unlock(&d->pgraph.lock); + // events + switch (addr) { + case NV_PGRAPH_FIFO: + qemu_cond_broadcast(&d->pgraph.fifo_access_cond); + break; + } + + qemu_mutex_unlock(&d->pgraph.pgraph_lock); DEVICE_WRITE32_END(PGRAPH); } -static void pgraph_handle_method(NV2AState *d, +void OpenGL_draw_end(NV2AState *d); // forward declaration + +void OpenGL_draw_arrays(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + assert(pg->shader_binding); + + pgraph_bind_vertex_attributes(d, pg->draw_arrays_max_count, + false, 0); + glMultiDrawArrays(pg->shader_binding->gl_primitive_mode, + pg->gl_draw_arrays_start, + pg->gl_draw_arrays_count, + pg->draw_arrays_length); + + OpenGL_draw_end(d); +} + +void OpenGL_draw_inline_buffer(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + assert(pg->shader_binding); + + for (unsigned int i = 0; i < NV2A_VERTEXSHADER_ATTRIBUTES; i++) { + VertexAttribute *vertex_attribute = &pg->vertex_attributes[i]; + + if (vertex_attribute->inline_buffer) { + + glBindBuffer(GL_ARRAY_BUFFER, + vertex_attribute->gl_inline_buffer); + glBufferData(GL_ARRAY_BUFFER, + pg->inline_buffer_length + * sizeof(float) * 4, + vertex_attribute->inline_buffer, + GL_DYNAMIC_DRAW); + + /* Clear buffer for next batch */ + g_free(vertex_attribute->inline_buffer); + vertex_attribute->inline_buffer = NULL; + + glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, 0, 0); + glEnableVertexAttribArray(i); + } + else { + glDisableVertexAttribArray(i); + glVertexAttrib4fv(i, vertex_attribute->inline_value); + } + } + + glDrawArrays(pg->shader_binding->gl_primitive_mode, + 0, pg->inline_buffer_length); + + OpenGL_draw_end(d); +} + +void OpenGL_draw_inline_array(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + assert(pg->shader_binding); + + unsigned int index_count = pgraph_bind_inline_array(d); + glDrawArrays(pg->shader_binding->gl_primitive_mode, + 0, index_count); + + OpenGL_draw_end(d); +} + +void OpenGL_draw_inline_elements(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + assert(pg->shader_binding); + + uint32_t max_element = 0; + uint32_t min_element = (uint32_t)-1; + for (unsigned int i = 0; i < pg->inline_elements_length; i++) { + max_element = MAX(pg->inline_elements[i], max_element); + min_element = MIN(pg->inline_elements[i], min_element); + } + pgraph_bind_vertex_attributes(d, max_element + 1, false, 0); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pg->gl_element_buffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, + pg->inline_elements_length * sizeof(pg->inline_elements[0]), + pg->inline_elements, + GL_DYNAMIC_DRAW); + + glDrawRangeElements(pg->shader_binding->gl_primitive_mode, + min_element, max_element, + pg->inline_elements_length, + GL_UNSIGNED_SHORT, // Cxbx-Reloaded TODO : Restore GL_UNSIGNED_INT once HLE_draw_inline_elements can draw using uint32_t + (void*)0); + + OpenGL_draw_end(d); +} + +void OpenGL_draw_state_update(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + + NV2A_GL_DGROUP_BEGIN("NV097_SET_BEGIN_END: 0x%x", pg->primitive_mode); + + uint32_t control_0 = pg->regs[NV_PGRAPH_CONTROL_0]; + uint32_t control_1 = pg->regs[NV_PGRAPH_CONTROL_1]; + + bool depth_test = control_0 + & NV_PGRAPH_CONTROL_0_ZENABLE; + bool stencil_test = control_1 + & NV_PGRAPH_CONTROL_1_STENCIL_TEST_ENABLE; + + pgraph_update_surface(d, true, true, depth_test || stencil_test); + + bool alpha = control_0 & NV_PGRAPH_CONTROL_0_ALPHA_WRITE_ENABLE; + bool red = control_0 & NV_PGRAPH_CONTROL_0_RED_WRITE_ENABLE; + bool green = control_0 & NV_PGRAPH_CONTROL_0_GREEN_WRITE_ENABLE; + bool blue = control_0 & NV_PGRAPH_CONTROL_0_BLUE_WRITE_ENABLE; + glColorMask(red, green, blue, alpha); + glDepthMask(!!(control_0 & NV_PGRAPH_CONTROL_0_ZWRITEENABLE)); + glStencilMask(GET_MASK(control_1, + NV_PGRAPH_CONTROL_1_STENCIL_MASK_WRITE)); + + uint32_t blend = pg->regs[NV_PGRAPH_BLEND]; + if (blend & NV_PGRAPH_BLEND_EN) { + glEnable(GL_BLEND); + uint32_t sfactor = GET_MASK(blend, + NV_PGRAPH_BLEND_SFACTOR); + uint32_t dfactor = GET_MASK(blend, + NV_PGRAPH_BLEND_DFACTOR); + assert(sfactor < ARRAY_SIZE(pgraph_blend_factor_map)); + assert(dfactor < ARRAY_SIZE(pgraph_blend_factor_map)); + glBlendFunc(pgraph_blend_factor_map[sfactor], + pgraph_blend_factor_map[dfactor]); + + uint32_t equation = GET_MASK(blend, + NV_PGRAPH_BLEND_EQN); + assert(equation < ARRAY_SIZE(pgraph_blend_equation_map)); + glBlendEquation(pgraph_blend_equation_map[equation]); + + uint32_t blend_color = pg->regs[NV_PGRAPH_BLENDCOLOR]; + glBlendColor(((blend_color >> 16) & 0xFF) / 255.0f, /* red */ + ((blend_color >> 8) & 0xFF) / 255.0f, /* green */ + (blend_color & 0xFF) / 255.0f, /* blue */ + ((blend_color >> 24) & 0xFF) / 255.0f);/* alpha */ + } + else { + glDisable(GL_BLEND); + } + + /* Face culling */ + uint32_t setupraster = pg->regs[NV_PGRAPH_SETUPRASTER]; + if (setupraster + & NV_PGRAPH_SETUPRASTER_CULLENABLE) { + uint32_t cull_face = GET_MASK(setupraster, + NV_PGRAPH_SETUPRASTER_CULLCTRL); + assert(cull_face < ARRAY_SIZE(pgraph_cull_face_map)); + glCullFace(pgraph_cull_face_map[cull_face]); + glEnable(GL_CULL_FACE); + } + else { + glDisable(GL_CULL_FACE); + } + + /* Front-face select */ + glFrontFace(setupraster + & NV_PGRAPH_SETUPRASTER_FRONTFACE + ? GL_CCW : GL_CW); + + /* Polygon offset */ + /* FIXME: GL implementation-specific, maybe do this in VS? */ + if (setupraster & + NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE) { + glEnable(GL_POLYGON_OFFSET_FILL); + } + else { + glDisable(GL_POLYGON_OFFSET_FILL); + } + if (setupraster & + NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE) { + glEnable(GL_POLYGON_OFFSET_LINE); + } + else { + glDisable(GL_POLYGON_OFFSET_LINE); + } + if (setupraster & + NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE) { + glEnable(GL_POLYGON_OFFSET_POINT); + } + else { + glDisable(GL_POLYGON_OFFSET_POINT); + } + if (setupraster & + (NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE | + NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE | + NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE)) { + GLfloat zfactor = *(float*)&pg->regs[NV_PGRAPH_ZOFFSETFACTOR]; + GLfloat zbias = *(float*)&pg->regs[NV_PGRAPH_ZOFFSETBIAS]; + glPolygonOffset(zfactor, zbias); + } + + /* Depth testing */ + if (depth_test) { + glEnable(GL_DEPTH_TEST); + + uint32_t depth_func = GET_MASK(control_0, + NV_PGRAPH_CONTROL_0_ZFUNC); + assert(depth_func < ARRAY_SIZE(pgraph_depth_func_map)); + glDepthFunc(pgraph_depth_func_map[depth_func]); + } + else { + glDisable(GL_DEPTH_TEST); + } + + if (stencil_test) { + glEnable(GL_STENCIL_TEST); + + uint32_t stencil_func = GET_MASK(control_1, + NV_PGRAPH_CONTROL_1_STENCIL_FUNC); + uint32_t stencil_ref = GET_MASK(control_1, + NV_PGRAPH_CONTROL_1_STENCIL_REF); + uint32_t func_mask = GET_MASK(control_1, + NV_PGRAPH_CONTROL_1_STENCIL_MASK_READ); + uint32_t control2 = pg->regs[NV_PGRAPH_CONTROL_2]; + uint32_t op_fail = GET_MASK(control2, + NV_PGRAPH_CONTROL_2_STENCIL_OP_FAIL); + uint32_t op_zfail = GET_MASK(control2, + NV_PGRAPH_CONTROL_2_STENCIL_OP_ZFAIL); + uint32_t op_zpass = GET_MASK(control2, + NV_PGRAPH_CONTROL_2_STENCIL_OP_ZPASS); + + assert(stencil_func < ARRAY_SIZE(pgraph_stencil_func_map)); + assert(op_fail < ARRAY_SIZE(pgraph_stencil_op_map)); + assert(op_zfail < ARRAY_SIZE(pgraph_stencil_op_map)); + assert(op_zpass < ARRAY_SIZE(pgraph_stencil_op_map)); + + glStencilFunc( + pgraph_stencil_func_map[stencil_func], + stencil_ref, + func_mask); + + glStencilOp( + pgraph_stencil_op_map[op_fail], + pgraph_stencil_op_map[op_zfail], + pgraph_stencil_op_map[op_zpass]); + + } + else { + glDisable(GL_STENCIL_TEST); + } + + /* Dither */ + /* FIXME: GL implementation dependent */ + if (control_0 & + NV_PGRAPH_CONTROL_0_DITHERENABLE) { + glEnable(GL_DITHER); + } + else { + glDisable(GL_DITHER); + } + + pgraph_bind_shaders(pg); + pgraph_bind_textures(d); + + //glDisableVertexAttribArray(NV2A_VERTEX_ATTR_DIFFUSE); + //glVertexAttrib4f(NV2A_VERTEX_ATTR_DIFFUSE, 1.0f, 1.0f, 1.0f, 1.0f); + + unsigned int width, height; + pgraph_get_surface_dimensions(pg, &width, &height); + pgraph_apply_anti_aliasing_factor(pg, &width, &height); + glViewport(0, 0, width, height); + + /* Visibility testing */ + if (pg->zpass_pixel_count_enable) { + GLuint gl_query; + glGenQueries(1, &gl_query); + pg->gl_zpass_pixel_count_query_count++; + pg->gl_zpass_pixel_count_queries = (GLuint*)g_realloc( + pg->gl_zpass_pixel_count_queries, + sizeof(GLuint) * pg->gl_zpass_pixel_count_query_count); + pg->gl_zpass_pixel_count_queries[ + pg->gl_zpass_pixel_count_query_count - 1] = gl_query; + glBeginQuery(GL_SAMPLES_PASSED, gl_query); + } +} + +void OpenGL_draw_end(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + + /* End of visibility testing */ + if (pg->zpass_pixel_count_enable) { + glEndQuery(GL_SAMPLES_PASSED); + } + + NV2A_GL_DGROUP_END(); +} + +void OpenGL_draw_clear(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + + assert(pg->opengl_enabled); + + NV2A_DPRINTF("---------PRE CLEAR ------\n"); + GLbitfield gl_mask = 0; + + bool write_color = (pg->clear_surface & NV097_CLEAR_SURFACE_COLOR); + bool write_zeta = + (pg->clear_surface & (NV097_CLEAR_SURFACE_Z | NV097_CLEAR_SURFACE_STENCIL)); + + if (write_zeta) { + uint32_t clear_zstencil = + d->pgraph.regs[NV_PGRAPH_ZSTENCILCLEARVALUE]; + GLint gl_clear_stencil; + GLfloat gl_clear_depth; + + /* FIXME: Put these in some lookup table */ + const float f16_max = 511.9375f; + /* FIXME: 7 bits of mantissa unused. maybe use full buffer? */ + const float f24_max = 3.4027977E38f; + + switch (pg->surface_shape.zeta_format) { + case NV097_SET_SURFACE_FORMAT_ZETA_Z16: { + if (pg->clear_surface & NV097_CLEAR_SURFACE_Z) { + gl_mask |= GL_DEPTH_BUFFER_BIT; + uint16_t z = clear_zstencil & 0xFFFF; + if (pg->surface_shape.z_format) { + gl_clear_depth = convert_f16_to_float(z) / f16_max; + assert(false); /* FIXME: Untested */ + } + else { + gl_clear_depth = z / (float)0xFFFF; + } + } + break; + } + case NV097_SET_SURFACE_FORMAT_ZETA_Z24S8: { + if (pg->clear_surface & NV097_CLEAR_SURFACE_STENCIL) { + gl_mask |= GL_STENCIL_BUFFER_BIT; + gl_clear_stencil = clear_zstencil & 0xFF; + } + if (pg->clear_surface & NV097_CLEAR_SURFACE_Z) { + gl_mask |= GL_DEPTH_BUFFER_BIT; + uint32_t z = clear_zstencil >> 8; + if (pg->surface_shape.z_format) { + gl_clear_depth = convert_f24_to_float(z) / f24_max; + assert(false); /* FIXME: Untested */ + } + else { + gl_clear_depth = z / (float)0xFFFFFF; + } + } + break; + } + default: + fprintf(stderr, "Unknown zeta surface format: 0x%x\n", pg->surface_shape.zeta_format); + assert(false); + break; + } + + if (gl_mask & GL_DEPTH_BUFFER_BIT) { + glDepthMask(GL_TRUE); + glClearDepth(gl_clear_depth); + } + + if (gl_mask & GL_STENCIL_BUFFER_BIT) { + glStencilMask(0xff); + glClearStencil(gl_clear_stencil); + } + } + + if (write_color) { + gl_mask |= GL_COLOR_BUFFER_BIT; + glColorMask((pg->clear_surface & NV097_CLEAR_SURFACE_R) + ? GL_TRUE : GL_FALSE, + (pg->clear_surface & NV097_CLEAR_SURFACE_G) + ? GL_TRUE : GL_FALSE, + (pg->clear_surface & NV097_CLEAR_SURFACE_B) + ? GL_TRUE : GL_FALSE, + (pg->clear_surface & NV097_CLEAR_SURFACE_A) + ? GL_TRUE : GL_FALSE); + uint32_t clear_color = d->pgraph.regs[NV_PGRAPH_COLORCLEARVALUE]; + + /* Handle RGB */ + GLfloat red, green, blue; + switch (pg->surface_shape.color_format) { + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_Z1R5G5B5: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_O1R5G5B5: + red = ((clear_color >> 10) & 0x1F) / 31.0f; + green = ((clear_color >> 5) & 0x1F) / 31.0f; + blue = (clear_color & 0x1F) / 31.0f; + assert(false); /* Untested */ + break; + case NV097_SET_SURFACE_FORMAT_COLOR_LE_R5G6B5: + red = ((clear_color >> 11) & 0x1F) / 31.0f; + green = ((clear_color >> 5) & 0x3F) / 63.0f; + blue = (clear_color & 0x1F) / 31.0f; + break; + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_Z8R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_O8R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8: + red = ((clear_color >> 16) & 0xFF) / 255.0f; + green = ((clear_color >> 8) & 0xFF) / 255.0f; + blue = (clear_color & 0xFF) / 255.0f; + break; + case NV097_SET_SURFACE_FORMAT_COLOR_LE_B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_G8B8: + /* Xbox D3D doesn't support clearing those */ + default: + red = 1.0f; + green = 0.0f; + blue = 1.0f; + fprintf(stderr, "CLEAR_SURFACE for color_format 0x%x unsupported", + pg->surface_shape.color_format); + assert(false); + break; + } + + /* Handle alpha */ + GLfloat alpha; + switch (pg->surface_shape.color_format) { + /* FIXME: CLEAR_SURFACE seems to work like memset, so maybe we + * also have to clear non-alpha bits with alpha value? + * As GL doesn't own those pixels we'd have to do this on + * our own in xbox memory. + */ + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8: + alpha = ((clear_color >> 24) & 0x7F) / 127.0f; + assert(false); /* Untested */ + break; + case NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8: + alpha = ((clear_color >> 24) & 0xFF) / 255.0f; + break; + default: + alpha = 1.0f; + break; + } + + glClearColor(red, green, blue, alpha); + } + + if (gl_mask) { + pgraph_update_surface(d, true, write_color, write_zeta); + + glEnable(GL_SCISSOR_TEST); + + unsigned int xmin = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTX], + NV_PGRAPH_CLEARRECTX_XMIN); + unsigned int xmax = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTX], + NV_PGRAPH_CLEARRECTX_XMAX); + unsigned int ymin = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTY], + NV_PGRAPH_CLEARRECTY_YMIN); + unsigned int ymax = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTY], + NV_PGRAPH_CLEARRECTY_YMAX); + + unsigned int scissor_x = xmin; + unsigned int scissor_y = pg->surface_shape.clip_height - ymax - 1; + + unsigned int scissor_width = xmax - xmin + 1; + unsigned int scissor_height = ymax - ymin + 1; + + pgraph_apply_anti_aliasing_factor(pg, &scissor_x, &scissor_y); + pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height); + + /* FIXME: Should this really be inverted instead of ymin? */ + glScissor(scissor_x, scissor_y, scissor_width, scissor_height); + + /* FIXME: Respect window clip?!?! */ + + NV2A_DPRINTF("------------------CLEAR 0x%x %d,%d - %d,%d %x---------------\n", + parameter, xmin, ymin, xmax, ymax, d->pgraph.regs[NV_PGRAPH_COLORCLEARVALUE]); + + /* Dither */ + /* FIXME: Maybe also disable it here? + GL implementation dependent */ + if (pg->regs[NV_PGRAPH_CONTROL_0] & + NV_PGRAPH_CONTROL_0_DITHERENABLE) { + glEnable(GL_DITHER); + } + else { + glDisable(GL_DITHER); + } + + glClear(gl_mask); + + glDisable(GL_SCISSOR_TEST); + } + + pgraph_set_surface_dirty(pg, write_color, write_zeta); +} + +void OpenGL_init_pgraph_plugins() +{ + pgraph_draw_arrays = OpenGL_draw_arrays; + pgraph_draw_inline_buffer = OpenGL_draw_inline_buffer; + pgraph_draw_inline_array = OpenGL_draw_inline_array; + pgraph_draw_inline_elements = OpenGL_draw_inline_elements; + pgraph_draw_state_update = OpenGL_draw_state_update; + pgraph_draw_clear = OpenGL_draw_clear; +} + +void pgraph_handle_method(NV2AState *d, unsigned int subchannel, unsigned int method, uint32_t parameter) { unsigned int i; - - GraphicsSubchannel *subchannel_data; - GraphicsObject *object; - unsigned int slot; PGRAPHState *pg = &d->pgraph; - assert(pg->channel_valid); - subchannel_data = &pg->subchannel_data[subchannel]; - object = &subchannel_data->object; + bool channel_valid = + d->pgraph.regs[NV_PGRAPH_CTX_CONTROL] & NV_PGRAPH_CTX_CONTROL_CHID; + assert(channel_valid); - ContextSurfaces2DState *context_surfaces_2d - = &object->data.context_surfaces_2d; - ImageBlitState *image_blit = &object->data.image_blit; - KelvinState *kelvin = &object->data.kelvin; + unsigned channel_id = GET_MASK(pg->regs[NV_PGRAPH_CTX_USER], NV_PGRAPH_CTX_USER_CHID); + ContextSurfaces2DState *context_surfaces_2d = &pg->context_surfaces_2d; + ImageBlitState *image_blit = &pg->image_blit; + KelvinState *kelvin = &pg->kelvin; - // Logging is slow.. disable for now.. - //pgraph_log_method(subchannel, object->graphics_class, method, parameter); + assert(subchannel < 8); if (method == NV_SET_OBJECT) { - subchannel_data->object_instance = parameter; + assert(parameter < d->pramin.ramin_size); + uint8_t *obj_ptr = d->pramin.ramin_ptr + parameter; - //qemu_mutex_lock_iothread(); - load_graphics_object(d, parameter, object); - //qemu_mutex_unlock_iothread(); - return; - } + uint32_t ctx_1 = ldl_le_p((uint32_t*)obj_ptr); + uint32_t ctx_2 = ldl_le_p((uint32_t*)(obj_ptr+4)); + uint32_t ctx_3 = ldl_le_p((uint32_t*)(obj_ptr+8)); + uint32_t ctx_4 = ldl_le_p((uint32_t*)(obj_ptr+12)); + uint32_t ctx_5 = parameter; + + pg->regs[NV_PGRAPH_CTX_CACHE1 + subchannel * 4] = ctx_1; + pg->regs[NV_PGRAPH_CTX_CACHE2 + subchannel * 4] = ctx_2; + pg->regs[NV_PGRAPH_CTX_CACHE3 + subchannel * 4] = ctx_3; + pg->regs[NV_PGRAPH_CTX_CACHE4 + subchannel * 4] = ctx_4; + pg->regs[NV_PGRAPH_CTX_CACHE5 + subchannel * 4] = ctx_5; + } + + // is this right? + pg->regs[NV_PGRAPH_CTX_SWITCH1] = pg->regs[NV_PGRAPH_CTX_CACHE1 + subchannel * 4]; + pg->regs[NV_PGRAPH_CTX_SWITCH2] = pg->regs[NV_PGRAPH_CTX_CACHE2 + subchannel * 4]; + pg->regs[NV_PGRAPH_CTX_SWITCH3] = pg->regs[NV_PGRAPH_CTX_CACHE3 + subchannel * 4]; + pg->regs[NV_PGRAPH_CTX_SWITCH4] = pg->regs[NV_PGRAPH_CTX_CACHE4 + subchannel * 4]; + pg->regs[NV_PGRAPH_CTX_SWITCH5] = pg->regs[NV_PGRAPH_CTX_CACHE5 + subchannel * 4]; + + uint32_t graphics_class = GET_MASK(pg->regs[NV_PGRAPH_CTX_SWITCH1], + NV_PGRAPH_CTX_SWITCH1_GRCLASS); + + // Logging is slow.. disable for now.. + //pgraph_log_method(subchannel, graphics_class, method, parameter); + + if (subchannel != 0) { + // catches context switching issues on xbox d3d + assert(graphics_class != 0x97); + } /* ugly switch for now */ - switch (object->graphics_class) { + switch (graphics_class) { - case NV_CONTEXT_SURFACES_2D: { + case NV_CONTEXT_PATTERN: { switch (method) { + case NV044_SET_MONOCHROME_COLOR0: + pg->regs[NV_PGRAPH_PATT_COLOR0] = parameter; + break; + } + + break; + } + + case NV_CONTEXT_SURFACES_2D: { + switch (method) { + case NV062_SET_OBJECT: + context_surfaces_2d->object_instance = parameter; + break; case NV062_SET_CONTEXT_DMA_IMAGE_SOURCE: context_surfaces_2d->dma_image_source = parameter; break; @@ -572,7 +1137,7 @@ static void pgraph_handle_method(NV2AState *d, context_surfaces_2d->dest_offset = parameter & 0x07FFFFFF; break; default: - EmuWarning("NV2A: Unknown NV_CONTEXT_SURFACES_2D Method: 0x%08X\n", method); + EmuLog(LOG_LEVEL::WARNING, "Unknown NV_CONTEXT_SURFACES_2D Method: 0x%08X", method); } break; @@ -580,6 +1145,9 @@ static void pgraph_handle_method(NV2AState *d, case NV_IMAGE_BLIT: { switch (method) { + case NV09F_SET_OBJECT: + image_blit->object_instance = parameter; + break; case NV09F_SET_CONTEXT_SURFACES: image_blit->context_surfaces = parameter; break; @@ -603,14 +1171,9 @@ static void pgraph_handle_method(NV2AState *d, NV2A_GL_DPRINTF(true, "NV09F_SET_OPERATION_SRCCOPY"); - GraphicsObject *context_surfaces_obj = - lookup_graphics_object(pg, image_blit->context_surfaces); - assert(context_surfaces_obj); - assert(context_surfaces_obj->graphics_class - == NV_CONTEXT_SURFACES_2D); - - ContextSurfaces2DState *context_surfaces = - &context_surfaces_obj->data.context_surfaces_2d; + ContextSurfaces2DState *context_surfaces = context_surfaces_2d; + assert(context_surfaces->object_instance + == image_blit->context_surfaces); unsigned int bytes_per_pixel; switch (context_surfaces->color_format) { @@ -665,13 +1228,17 @@ static void pgraph_handle_method(NV2AState *d, break; default: - EmuWarning("NV2A: Unknown NV_IMAGE_BLIT Method: 0x%08X\n", method); + EmuLog(LOG_LEVEL::WARNING, "Unknown NV_IMAGE_BLIT Method: 0x%08X", method); } break; } case NV_KELVIN_PRIMITIVE: { switch (method) { + case NV097_SET_OBJECT: + kelvin->object_instance = parameter; + break; + case NV097_NO_OPERATION: /* The bios uses nop as a software method call - * it seems to expect a notify interrupt if the parameter isn't 0. @@ -682,31 +1249,30 @@ static void pgraph_handle_method(NV2AState *d, if (parameter != 0) { assert(!(pg->pending_interrupts & NV_PGRAPH_INTR_ERROR)); - - pg->trapped_channel_id = pg->channel_id; - pg->trapped_subchannel = subchannel; - pg->trapped_method = method; - pg->trapped_data[0] = parameter; - pg->notify_source = NV_PGRAPH_NSOURCE_NOTIFICATION; /* TODO: check this */ + SET_MASK(pg->regs[NV_PGRAPH_TRAPPED_ADDR], + NV_PGRAPH_TRAPPED_ADDR_CHID, channel_id); + SET_MASK(pg->regs[NV_PGRAPH_TRAPPED_ADDR], + NV_PGRAPH_TRAPPED_ADDR_SUBCH, subchannel); + SET_MASK(pg->regs[NV_PGRAPH_TRAPPED_ADDR], + NV_PGRAPH_TRAPPED_ADDR_MTHD, method); + pg->regs[NV_PGRAPH_TRAPPED_DATA_LOW] = parameter; + pg->regs[NV_PGRAPH_NSOURCE] = NV_PGRAPH_NSOURCE_NOTIFICATION; /* TODO: check this */ pg->pending_interrupts |= NV_PGRAPH_INTR_ERROR; - qemu_mutex_unlock(&d->pgraph.lock); + qemu_mutex_unlock(&pg->pgraph_lock); qemu_mutex_lock_iothread(); update_irq(d); - - qemu_mutex_lock(&d->pgraph.lock); + qemu_mutex_lock(&pg->pgraph_lock); qemu_mutex_unlock_iothread(); while (pg->pending_interrupts & NV_PGRAPH_INTR_ERROR) { - qemu_cond_wait(&d->pgraph.interrupt_cond, &d->pgraph.lock); + qemu_cond_wait(&pg->interrupt_cond, &pg->pgraph_lock); } } break; case NV097_WAIT_FOR_IDLE: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); break; @@ -723,7 +1289,6 @@ static void pgraph_handle_method(NV2AState *d, parameter); break; case NV097_FLIP_INCREMENT_WRITE: { - lockGL(pg); NV2A_DPRINTF("flip increment write %d -> ", GET_MASK(pg->regs[NV_PGRAPH_SURFACE], NV_PGRAPH_SURFACE_WRITE_3D)); @@ -742,13 +1307,10 @@ static void pgraph_handle_method(NV2AState *d, glFrameTerminatorGREMEDY(); } #endif // __APPLE__ - unlockGL(pg); break; } case NV097_FLIP_STALL: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); // TODO: Fix this (why does it hang?) @@ -773,7 +1335,7 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_SET_CONTEXT_DMA_NOTIFIES: - kelvin->dma_notifies = parameter; + pg->dma_notifies = parameter; break; case NV097_SET_CONTEXT_DMA_A: pg->dma_a = parameter; @@ -782,13 +1344,11 @@ static void pgraph_handle_method(NV2AState *d, pg->dma_b = parameter; break; case NV097_SET_CONTEXT_DMA_STATE: - kelvin->dma_state = parameter; + pg->dma_state = parameter; break; case NV097_SET_CONTEXT_DMA_COLOR: /* try to get any straggling draws in before the surface's changed :/ */ - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->dma_color = parameter; break; @@ -802,16 +1362,14 @@ static void pgraph_handle_method(NV2AState *d, pg->dma_vertex_b = parameter; break; case NV097_SET_CONTEXT_DMA_SEMAPHORE: - kelvin->dma_semaphore = parameter; + pg->dma_semaphore = parameter; break; case NV097_SET_CONTEXT_DMA_REPORT: pg->dma_report = parameter; break; case NV097_SET_SURFACE_CLIP_HORIZONTAL: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_shape.clip_x = GET_MASK(parameter, NV097_SET_SURFACE_CLIP_HORIZONTAL_X); @@ -819,9 +1377,7 @@ static void pgraph_handle_method(NV2AState *d, GET_MASK(parameter, NV097_SET_SURFACE_CLIP_HORIZONTAL_WIDTH); break; case NV097_SET_SURFACE_CLIP_VERTICAL: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_shape.clip_y = GET_MASK(parameter, NV097_SET_SURFACE_CLIP_VERTICAL_Y); @@ -829,9 +1385,7 @@ static void pgraph_handle_method(NV2AState *d, GET_MASK(parameter, NV097_SET_SURFACE_CLIP_VERTICAL_HEIGHT); break; case NV097_SET_SURFACE_FORMAT: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_shape.color_format = GET_MASK(parameter, NV097_SET_SURFACE_FORMAT_COLOR); @@ -847,9 +1401,7 @@ static void pgraph_handle_method(NV2AState *d, GET_MASK(parameter, NV097_SET_SURFACE_FORMAT_HEIGHT); break; case NV097_SET_SURFACE_PITCH: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_color.pitch = GET_MASK(parameter, NV097_SET_SURFACE_PITCH_COLOR); @@ -857,16 +1409,12 @@ static void pgraph_handle_method(NV2AState *d, GET_MASK(parameter, NV097_SET_SURFACE_PITCH_ZETA); break; case NV097_SET_SURFACE_COLOR_OFFSET: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_color.offset = parameter; break; case NV097_SET_SURFACE_ZETA_OFFSET: - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); pg->surface_zeta.offset = parameter; break; @@ -889,9 +1437,7 @@ static void pgraph_handle_method(NV2AState *d, pg->regs[NV_PGRAPH_TEXADDRESS0 + slot * 4] = parameter; break; case NV097_SET_CONTROL0: { - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); bool stencil_write_enable = parameter & NV097_SET_CONTROL0_STENCIL_WRITE_ENABLE; @@ -908,6 +1454,12 @@ static void pgraph_handle_method(NV2AState *d, SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_Z_PERSPECTIVE_ENABLE, z_perspective); + + int color_space_convert = + GET_MASK(parameter, NV097_SET_CONTROL0_COLOR_SPACE_CONVERT); + SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], + NV_PGRAPH_CONTROL_0_CSCONVERT, + color_space_convert); break; } @@ -976,6 +1528,18 @@ static void pgraph_handle_method(NV2AState *d, SET_MASK(pg->regs[NV_PGRAPH_FOGCOLOR], NV_PGRAPH_FOGCOLOR_BLUE, blue); break; } + case NV097_SET_WINDOW_CLIP_TYPE: + SET_MASK(pg->regs[NV_PGRAPH_SETUPRASTER], + NV_PGRAPH_SETUPRASTER_WINDOWCLIPTYPE, parameter); + break; + CASE_8(NV097_SET_WINDOW_CLIP_HORIZONTAL, 4): + slot = (method - NV097_SET_WINDOW_CLIP_HORIZONTAL) / 4; + pg->regs[NV_PGRAPH_WINDOWCLIPX0 + slot * 4] = parameter; + break; + CASE_8(NV097_SET_WINDOW_CLIP_VERTICAL, 4): + slot = (method - NV097_SET_WINDOW_CLIP_VERTICAL) / 4; + pg->regs[NV_PGRAPH_WINDOWCLIPY0 + slot * 4] = parameter; + break; case NV097_SET_ALPHA_TEST_ENABLE: SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_ALPHATESTENABLE, parameter); @@ -989,6 +1553,7 @@ static void pgraph_handle_method(NV2AState *d, parameter); break; case NV097_SET_DEPTH_TEST_ENABLE: + // Test-case : Whiplash SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_ZENABLE, parameter); break; @@ -1145,6 +1710,7 @@ static void pgraph_handle_method(NV2AState *d, } case NV097_SET_DEPTH_FUNC: + // Test-case : Whiplash SET_MASK(pg->regs[NV_PGRAPH_CONTROL_0], NV_PGRAPH_CONTROL_0_ZFUNC, parameter & 0xF); break; @@ -1488,8 +2054,7 @@ static void pgraph_handle_method(NV2AState *d, } /* Handles NV097_SET_BACK_LIGHT_* */ - CASE_78(NV097_SET_BACK_LIGHT_AMBIENT_COLOR, 4): { - // NV097_SET_BACK_LIGHT_SPECULAR_COLOR 0x00000C18 - 0x00000C00 + 0x1C8 = 0x1E0; /4= 78d + CASE_128(NV097_SET_BACK_LIGHT_AMBIENT_COLOR, 4): { slot = (method - NV097_SET_BACK_LIGHT_AMBIENT_COLOR) / 4; unsigned int part = NV097_SET_BACK_LIGHT_AMBIENT_COLOR / 4 + slot % 16; slot /= 16; /* [Light index] */ @@ -1517,8 +2082,7 @@ static void pgraph_handle_method(NV2AState *d, break; } /* Handles all the light source props except for NV097_SET_BACK_LIGHT_* */ - CASE_253(NV097_SET_LIGHT_AMBIENT_COLOR, 4): { - // NV097_SET_LIGHT_LOCAL_ATTENUATION 0x00001068 - 0x00001000 + 0x38C = 0x3F4; /4= 253d + CASE_256(NV097_SET_LIGHT_AMBIENT_COLOR, 4): { slot = (method - NV097_SET_LIGHT_AMBIENT_COLOR) / 4; unsigned int part = NV097_SET_LIGHT_AMBIENT_COLOR / 4 + slot % 32; slot /= 32; /* [Light index] */ @@ -1613,7 +2177,7 @@ static void pgraph_handle_method(NV2AState *d, vertex_attribute->gl_normalize = GL_TRUE; vertex_attribute->size = 1; assert(vertex_attribute->count == 4); - // http://www.opengl.org/registry/specs/ARB/vertex_array_bgra.txt + // https://www.opengl.org/registry/specs/ARB/vertex_array_bgra.txt vertex_attribute->gl_count = GL_BGRA; vertex_attribute->needs_conversion = false; break; @@ -1672,11 +2236,12 @@ static void pgraph_handle_method(NV2AState *d, slot = (method - NV097_SET_VERTEX_DATA_ARRAY_OFFSET) / 4; - VertexAttribute *vertex_attribute = &pg->vertex_attributes[slot]; + pg->vertex_attributes[slot].dma_select = + parameter & 0x80000000; + pg->vertex_attributes[slot].offset = + parameter & 0x7fffffff; - vertex_attribute->dma_select = parameter & 0x80000000; - vertex_attribute->offset = parameter & 0x7fffffff; - vertex_attribute->converted_elements = 0; + pg->vertex_attributes[slot].converted_elements = 0; break; } @@ -1692,7 +2257,6 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_CLEAR_REPORT_VALUE: - lockGL(pg); /* FIXME: Does this have a value in parameter? Also does this (also?) modify * the report memory block? @@ -1706,7 +2270,6 @@ static void pgraph_handle_method(NV2AState *d, } pg->zpass_pixel_count_result = 0; - unlockGL(pg); break; case NV097_SET_ZPASS_PIXEL_COUNT_ENABLE: @@ -1714,8 +2277,6 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_GET_REPORT: { - lockGL(pg); - /* FIXME: This was first intended to be watchpoint-based. However, * qemu / kvm only supports virtual-address watchpoints. * This'll do for now, but accuracy and performance with other @@ -1757,7 +2318,6 @@ static void pgraph_handle_method(NV2AState *d, stl_le_p((uint32_t*)&report_data[12], done); } - unlockGL(pg); break; } @@ -1768,307 +2328,82 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_SET_BEGIN_END: { - lockGL(pg); - uint32_t control_0 = pg->regs[NV_PGRAPH_CONTROL_0]; uint32_t control_1 = pg->regs[NV_PGRAPH_CONTROL_1]; bool depth_test = control_0 & NV_PGRAPH_CONTROL_0_ZENABLE; bool stencil_test = control_1 - & NV_PGRAPH_CONTROL_1_STENCIL_TEST_ENABLE; + & NV_PGRAPH_CONTROL_1_STENCIL_TEST_ENABLE; - if (pg->opengl_enabled) { - if (parameter == NV097_SET_BEGIN_END_OP_END) { + if (parameter == NV097_SET_BEGIN_END_OP_END) { - assert(pg->shader_binding); + if (pg->draw_arrays_length) { - if (pg->draw_arrays_length) { + NV2A_GL_DPRINTF(false, "Draw Arrays"); - NV2A_GL_DPRINTF(false, "Draw Arrays"); + assert(pg->inline_buffer_length == 0); + assert(pg->inline_array_length == 0); + assert(pg->inline_elements_length == 0); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_array_length == 0); - assert(pg->inline_elements_length == 0); - - pgraph_bind_vertex_attributes(d, pg->draw_arrays_max_count, - false, 0); - glMultiDrawArrays(pg->shader_binding->gl_primitive_mode, - pg->gl_draw_arrays_start, - pg->gl_draw_arrays_count, - pg->draw_arrays_length); - } else if (pg->inline_buffer_length) { - - NV2A_GL_DPRINTF(false, "Inline Buffer"); - - assert(pg->draw_arrays_length == 0); - assert(pg->inline_array_length == 0); - assert(pg->inline_elements_length == 0); - - for (i = 0; i < NV2A_VERTEXSHADER_ATTRIBUTES; i++) { - VertexAttribute *vertex_attribute = &pg->vertex_attributes[i]; - - if (vertex_attribute->inline_buffer) { - - glBindBuffer(GL_ARRAY_BUFFER, - vertex_attribute->gl_inline_buffer); - glBufferData(GL_ARRAY_BUFFER, - pg->inline_buffer_length - * sizeof(float) * 4, - vertex_attribute->inline_buffer, - GL_DYNAMIC_DRAW); - - /* Clear buffer for next batch */ - g_free(vertex_attribute->inline_buffer); - vertex_attribute->inline_buffer = NULL; - - glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, 0, 0); - glEnableVertexAttribArray(i); - } else { - glDisableVertexAttribArray(i); - - glVertexAttrib4fv(i, vertex_attribute->inline_value); - } - - } - - glDrawArrays(pg->shader_binding->gl_primitive_mode, - 0, pg->inline_buffer_length); - } else if (pg->inline_array_length) { - - NV2A_GL_DPRINTF(false, "Inline Array"); - - assert(pg->draw_arrays_length == 0); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_elements_length == 0); - - unsigned int index_count = pgraph_bind_inline_array(d); - glDrawArrays(pg->shader_binding->gl_primitive_mode, - 0, index_count); - } else if (pg->inline_elements_length) { - - NV2A_GL_DPRINTF(false, "Inline Elements"); - - assert(pg->draw_arrays_length == 0); - assert(pg->inline_buffer_length == 0); - assert(pg->inline_array_length == 0); - - uint32_t max_element = 0; - uint32_t min_element = (uint32_t)-1; - for (i=0; iinline_elements_length; i++) { - max_element = MAX(pg->inline_elements[i], max_element); - min_element = MIN(pg->inline_elements[i], min_element); - } - - pgraph_bind_vertex_attributes(d, max_element+1, false, 0); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pg->gl_element_buffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, - pg->inline_elements_length*4, - pg->inline_elements, - GL_DYNAMIC_DRAW); - - glDrawRangeElements(pg->shader_binding->gl_primitive_mode, - min_element, max_element, - pg->inline_elements_length, - GL_UNSIGNED_INT, - (void*)0); - - } else { - NV2A_GL_DPRINTF(true, "EMPTY NV097_SET_BEGIN_END"); - assert(false); + if (pgraph_draw_arrays != nullptr) { + pgraph_draw_arrays(d); } + } else if (pg->inline_buffer_length) { - /* End of visibility testing */ - if (pg->zpass_pixel_count_enable) { - glEndQuery(GL_SAMPLES_PASSED); + NV2A_GL_DPRINTF(false, "Inline Buffer"); + + assert(pg->draw_arrays_length == 0); + assert(pg->inline_array_length == 0); + assert(pg->inline_elements_length == 0); + + if (pgraph_draw_inline_buffer != nullptr) { + pgraph_draw_inline_buffer(d); } + } else if (pg->inline_array_length) { - NV2A_GL_DGROUP_END(); + NV2A_GL_DPRINTF(false, "Inline Array"); + + assert(pg->draw_arrays_length == 0); + assert(pg->inline_buffer_length == 0); + assert(pg->inline_elements_length == 0); + + if (pgraph_draw_inline_array != nullptr) { + pgraph_draw_inline_array(d); + } + } else if (pg->inline_elements_length) { + + NV2A_GL_DPRINTF(false, "Inline Elements"); + + assert(pg->draw_arrays_length == 0); + assert(pg->inline_buffer_length == 0); + assert(pg->inline_array_length == 0); + + if (pgraph_draw_inline_elements != nullptr) { + pgraph_draw_inline_elements(d); + } } else { - NV2A_GL_DGROUP_BEGIN("NV097_SET_BEGIN_END: 0x%x", parameter); - assert(parameter <= NV097_SET_BEGIN_END_OP_POLYGON); - - pgraph_update_surface(d, true, true, depth_test || stencil_test); - - pg->primitive_mode = parameter; - - bool alpha = control_0 & NV_PGRAPH_CONTROL_0_ALPHA_WRITE_ENABLE; - bool red = control_0 & NV_PGRAPH_CONTROL_0_RED_WRITE_ENABLE; - bool green = control_0 & NV_PGRAPH_CONTROL_0_GREEN_WRITE_ENABLE; - bool blue = control_0 & NV_PGRAPH_CONTROL_0_BLUE_WRITE_ENABLE; - glColorMask(red, green, blue, alpha); - glDepthMask(!!(control_0 & NV_PGRAPH_CONTROL_0_ZWRITEENABLE)); - glStencilMask(GET_MASK(control_1, - NV_PGRAPH_CONTROL_1_STENCIL_MASK_WRITE)); - - uint32_t blend = pg->regs[NV_PGRAPH_BLEND]; - if (blend & NV_PGRAPH_BLEND_EN) { - glEnable(GL_BLEND); - uint32_t sfactor = GET_MASK(blend, - NV_PGRAPH_BLEND_SFACTOR); - uint32_t dfactor = GET_MASK(blend, - NV_PGRAPH_BLEND_DFACTOR); - assert(sfactor < ARRAY_SIZE(pgraph_blend_factor_map)); - assert(dfactor < ARRAY_SIZE(pgraph_blend_factor_map)); - glBlendFunc(pgraph_blend_factor_map[sfactor], - pgraph_blend_factor_map[dfactor]); - - uint32_t equation = GET_MASK(blend, - NV_PGRAPH_BLEND_EQN); - assert(equation < ARRAY_SIZE(pgraph_blend_equation_map)); - glBlendEquation(pgraph_blend_equation_map[equation]); - - uint32_t blend_color = pg->regs[NV_PGRAPH_BLENDCOLOR]; - glBlendColor( ((blend_color >> 16) & 0xFF) / 255.0f, /* red */ - ((blend_color >> 8) & 0xFF) / 255.0f, /* green */ - (blend_color & 0xFF) / 255.0f, /* blue */ - ((blend_color >> 24) & 0xFF) / 255.0f);/* alpha */ - } else { - glDisable(GL_BLEND); - } - - /* Face culling */ - uint32_t setupraster = pg->regs[NV_PGRAPH_SETUPRASTER]; - if (setupraster - & NV_PGRAPH_SETUPRASTER_CULLENABLE) { - uint32_t cull_face = GET_MASK(setupraster, - NV_PGRAPH_SETUPRASTER_CULLCTRL); - assert(cull_face < ARRAY_SIZE(pgraph_cull_face_map)); - glCullFace(pgraph_cull_face_map[cull_face]); - glEnable(GL_CULL_FACE); - } else { - glDisable(GL_CULL_FACE); - } - - /* Front-face select */ - glFrontFace(setupraster - & NV_PGRAPH_SETUPRASTER_FRONTFACE - ? GL_CCW : GL_CW); - - /* Polygon offset */ - /* FIXME: GL implementation-specific, maybe do this in VS? */ - if (setupraster & - NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE) { - glEnable(GL_POLYGON_OFFSET_FILL); - } else { - glDisable(GL_POLYGON_OFFSET_FILL); - } - if (setupraster & - NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE) { - glEnable(GL_POLYGON_OFFSET_LINE); - } else { - glDisable(GL_POLYGON_OFFSET_LINE); - } - if (setupraster & - NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE) { - glEnable(GL_POLYGON_OFFSET_POINT); - } else { - glDisable(GL_POLYGON_OFFSET_POINT); - } - if (setupraster & - (NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE | - NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE | - NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE)) { - GLfloat zfactor = *(float*)&pg->regs[NV_PGRAPH_ZOFFSETFACTOR]; - GLfloat zbias = *(float*)&pg->regs[NV_PGRAPH_ZOFFSETBIAS]; - glPolygonOffset(zfactor, zbias); - } - - /* Depth testing */ - if (depth_test) { - glEnable(GL_DEPTH_TEST); - - uint32_t depth_func = GET_MASK(control_0, - NV_PGRAPH_CONTROL_0_ZFUNC); - assert(depth_func < ARRAY_SIZE(pgraph_depth_func_map)); - glDepthFunc(pgraph_depth_func_map[depth_func]); - } else { - glDisable(GL_DEPTH_TEST); - } - - if (stencil_test) { - glEnable(GL_STENCIL_TEST); - - uint32_t stencil_func = GET_MASK(control_1, - NV_PGRAPH_CONTROL_1_STENCIL_FUNC); - uint32_t stencil_ref = GET_MASK(control_1, - NV_PGRAPH_CONTROL_1_STENCIL_REF); - uint32_t func_mask = GET_MASK(control_1, - NV_PGRAPH_CONTROL_1_STENCIL_MASK_READ); - uint32_t control2 = pg->regs[NV_PGRAPH_CONTROL_2]; - uint32_t op_fail = GET_MASK(control2, - NV_PGRAPH_CONTROL_2_STENCIL_OP_FAIL); - uint32_t op_zfail = GET_MASK(control2, - NV_PGRAPH_CONTROL_2_STENCIL_OP_ZFAIL); - uint32_t op_zpass = GET_MASK(control2, - NV_PGRAPH_CONTROL_2_STENCIL_OP_ZPASS); - - assert(stencil_func < ARRAY_SIZE(pgraph_stencil_func_map)); - assert(op_fail < ARRAY_SIZE(pgraph_stencil_op_map)); - assert(op_zfail < ARRAY_SIZE(pgraph_stencil_op_map)); - assert(op_zpass < ARRAY_SIZE(pgraph_stencil_op_map)); - - glStencilFunc( - pgraph_stencil_func_map[stencil_func], - stencil_ref, - func_mask); - - glStencilOp( - pgraph_stencil_op_map[op_fail], - pgraph_stencil_op_map[op_zfail], - pgraph_stencil_op_map[op_zpass]); - - } else { - glDisable(GL_STENCIL_TEST); - } - - /* Dither */ - /* FIXME: GL implementation dependent */ - if (control_0 & - NV_PGRAPH_CONTROL_0_DITHERENABLE) { - glEnable(GL_DITHER); - } else { - glDisable(GL_DITHER); - } - - pgraph_bind_shaders(pg); - pgraph_bind_textures(d); - - //glDisableVertexAttribArray(NV2A_VERTEX_ATTR_DIFFUSE); - //glVertexAttrib4f(NV2A_VERTEX_ATTR_DIFFUSE, 1.0f, 1.0f, 1.0f, 1.0f); - - - unsigned int width, height; - pgraph_get_surface_dimensions(pg, &width, &height); - pgraph_apply_anti_aliasing_factor(pg, &width, &height); - glViewport(0, 0, width, height); - - pg->inline_elements_length = 0; - pg->inline_array_length = 0; - pg->inline_buffer_length = 0; - pg->draw_arrays_length = 0; - pg->draw_arrays_max_count = 0; - - /* Visibility testing */ - if (pg->zpass_pixel_count_enable) { - GLuint gl_query; - glGenQueries(1, &gl_query); - pg->gl_zpass_pixel_count_query_count++; - pg->gl_zpass_pixel_count_queries = (GLuint*)g_realloc( - pg->gl_zpass_pixel_count_queries, - sizeof(GLuint) * pg->gl_zpass_pixel_count_query_count); - pg->gl_zpass_pixel_count_queries[ - pg->gl_zpass_pixel_count_query_count - 1] = gl_query; - glBeginQuery(GL_SAMPLES_PASSED, gl_query); - } - + NV2A_GL_DPRINTF(true, "EMPTY NV097_SET_BEGIN_END"); + assert(false); } + } else { + + assert(parameter <= NV097_SET_BEGIN_END_OP_POLYGON); + + pg->primitive_mode = parameter; + + if (pgraph_draw_state_update != nullptr) { + pgraph_draw_state_update(d); + } + + pg->inline_elements_length = 0; + pg->inline_array_length = 0; + pg->inline_buffer_length = 0; + pg->draw_arrays_length = 0; + pg->draw_arrays_max_count = 0; } pgraph_set_surface_dirty(pg, true, depth_test || stencil_test); - - unlockGL(pg); break; } CASE_4(NV097_SET_TEXTURE_OFFSET, 64): @@ -2176,6 +2511,10 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_ARRAY_ELEMENT16: + //LOG_TEST_CASE("NV2A_VB_ELEMENT_U16"); + // Test-case : Turok (in main menu) + // Test-case : Hunter Redeemer + // Test-case : Otogi (see https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/1113#issuecomment-385593814) assert(pg->inline_elements_length < NV2A_MAX_BATCH_LENGTH); pg->inline_elements[ pg->inline_elements_length++] = parameter & 0xFFFF; @@ -2183,6 +2522,8 @@ static void pgraph_handle_method(NV2AState *d, pg->inline_elements_length++] = parameter >> 16; break; case NV097_ARRAY_ELEMENT32: + //LOG_TEST_CASE("NV2A_VB_ELEMENT_U32"); + // Test-case : Turok (in main menu) assert(pg->inline_elements_length < NV2A_MAX_BATCH_LENGTH); pg->inline_elements[ pg->inline_elements_length++] = parameter; @@ -2302,25 +2643,25 @@ static void pgraph_handle_method(NV2AState *d, break; } case NV097_SET_SEMAPHORE_OFFSET: - kelvin->semaphore_offset = parameter; + pg->regs[NV_PGRAPH_SEMAPHOREOFFSET] = parameter; break; case NV097_BACK_END_WRITE_SEMAPHORE_RELEASE: { - lockGL(pg); pgraph_update_surface(d, false, true, true); - unlockGL(pg); - //qemu_mutex_unlock(&d->pg->pgraph_lock); + //qemu_mutex_unlock(&pg->pgraph_lock); //qemu_mutex_lock_iothread(); + uint32_t semaphore_offset = pg->regs[NV_PGRAPH_SEMAPHOREOFFSET]; + xbaddr semaphore_dma_len; - uint8_t *semaphore_data = (uint8_t*)nv_dma_map(d, kelvin->dma_semaphore, + uint8_t *semaphore_data = (uint8_t*)nv_dma_map(d, pg->dma_semaphore, &semaphore_dma_len); - assert(kelvin->semaphore_offset < semaphore_dma_len); - semaphore_data += kelvin->semaphore_offset; + assert(semaphore_offset < semaphore_dma_len); + semaphore_data += semaphore_offset; stl_le_p((uint32_t*)semaphore_data, parameter); - //qemu_mutex_lock(&d->pg->pgraph_lock); + //qemu_mutex_lock(&pg->pgraph_lock); //qemu_mutex_unlock_iothread(); break; @@ -2334,182 +2675,10 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_CLEAR_SURFACE: { - lockGL(pg); - NV2A_DPRINTF("---------PRE CLEAR ------\n"); - GLbitfield gl_mask = 0; - - bool write_color = (parameter & NV097_CLEAR_SURFACE_COLOR); - bool write_zeta = - (parameter & (NV097_CLEAR_SURFACE_Z | NV097_CLEAR_SURFACE_STENCIL)); - if (pg->opengl_enabled) { - - if (write_zeta) { - uint32_t clear_zstencil = - d->pgraph.regs[NV_PGRAPH_ZSTENCILCLEARVALUE]; - GLint gl_clear_stencil; - GLfloat gl_clear_depth; - - /* FIXME: Put these in some lookup table */ - const float f16_max = 511.9375f; - /* FIXME: 7 bits of mantissa unused. maybe use full buffer? */ - const float f24_max = 3.4027977E38f; - - switch(pg->surface_shape.zeta_format) { - case NV097_SET_SURFACE_FORMAT_ZETA_Z16: { - uint16_t z = clear_zstencil & 0xFFFF; - /* FIXME: Remove bit for stencil clear? */ - if (pg->surface_shape.z_format) { - gl_clear_depth = convert_f16_to_float(z) / f16_max; - assert(false); /* FIXME: Untested */ - } else { - gl_clear_depth = z / (float)0xFFFF; - } - break; - } - case NV097_SET_SURFACE_FORMAT_ZETA_Z24S8: { - gl_clear_stencil = clear_zstencil & 0xFF; - uint32_t z = clear_zstencil >> 8; - if (pg->surface_shape.z_format) { - gl_clear_depth = convert_f24_to_float(z) / f24_max; - assert(false); /* FIXME: Untested */ - } else { - gl_clear_depth = z / (float)0xFFFFFF; - } - break; - } - default: - fprintf(stderr, "Unknown zeta surface format: 0x%x\n", pg->surface_shape.zeta_format); - assert(false); - break; - } - if (parameter & NV097_CLEAR_SURFACE_Z) { - gl_mask |= GL_DEPTH_BUFFER_BIT; - glDepthMask(GL_TRUE); - glClearDepth(gl_clear_depth); - } - if (parameter & NV097_CLEAR_SURFACE_STENCIL) { - gl_mask |= GL_STENCIL_BUFFER_BIT; - glStencilMask(0xff); - glClearStencil(gl_clear_stencil); - } - } - if (write_color) { - gl_mask |= GL_COLOR_BUFFER_BIT; - glColorMask((parameter & NV097_CLEAR_SURFACE_R) - ? GL_TRUE : GL_FALSE, - (parameter & NV097_CLEAR_SURFACE_G) - ? GL_TRUE : GL_FALSE, - (parameter & NV097_CLEAR_SURFACE_B) - ? GL_TRUE : GL_FALSE, - (parameter & NV097_CLEAR_SURFACE_A) - ? GL_TRUE : GL_FALSE); - uint32_t clear_color = d->pgraph.regs[NV_PGRAPH_COLORCLEARVALUE]; - - /* Handle RGB */ - GLfloat red, green, blue; - switch(pg->surface_shape.color_format) { - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_Z1R5G5B5: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_O1R5G5B5: - red = ((clear_color >> 10) & 0x1F) / 31.0f; - green = ((clear_color >> 5) & 0x1F) / 31.0f; - blue = (clear_color & 0x1F) / 31.0f; - assert(false); /* Untested */ - break; - case NV097_SET_SURFACE_FORMAT_COLOR_LE_R5G6B5: - red = ((clear_color >> 11) & 0x1F) / 31.0f; - green = ((clear_color >> 5) & 0x3F) / 63.0f; - blue = (clear_color & 0x1F) / 31.0f; - break; - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_Z8R8G8B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_O8R8G8B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8: - red = ((clear_color >> 16) & 0xFF) / 255.0f; - green = ((clear_color >> 8) & 0xFF) / 255.0f; - blue = (clear_color & 0xFF) / 255.0f; - break; - case NV097_SET_SURFACE_FORMAT_COLOR_LE_B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_G8B8: - /* Xbox D3D doesn't support clearing those */ - default: - red = 1.0f; - green = 0.0f; - blue = 1.0f; - fprintf(stderr, "CLEAR_SURFACE for color_format 0x%x unsupported", - pg->surface_shape.color_format); - assert(false); - break; - } - - /* Handle alpha */ - GLfloat alpha; - switch(pg->surface_shape.color_format) { - /* FIXME: CLEAR_SURFACE seems to work like memset, so maybe we - * also have to clear non-alpha bits with alpha value? - * As GL doesn't own those pixels we'd have to do this on - * our own in xbox memory. - */ - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8: - case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8: - alpha = ((clear_color >> 24) & 0x7F) / 127.0f; - assert(false); /* Untested */ - break; - case NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8: - alpha = ((clear_color >> 24) & 0xFF) / 255.0f; - break; - default: - alpha = 1.0f; - break; - } - - glClearColor(red, green, blue, alpha); - } - pgraph_update_surface(d, true, write_color, write_zeta); - - glEnable(GL_SCISSOR_TEST); - - unsigned int xmin = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTX], - NV_PGRAPH_CLEARRECTX_XMIN); - unsigned int xmax = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTX], - NV_PGRAPH_CLEARRECTX_XMAX); - unsigned int ymin = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTY], - NV_PGRAPH_CLEARRECTY_YMIN); - unsigned int ymax = GET_MASK(pg->regs[NV_PGRAPH_CLEARRECTY], - NV_PGRAPH_CLEARRECTY_YMAX); - - unsigned int scissor_x = xmin; - unsigned int scissor_y = pg->surface_shape.clip_height - ymax - 1; - - unsigned int scissor_width = xmax - xmin + 1; - unsigned int scissor_height = ymax - ymin + 1; - - pgraph_apply_anti_aliasing_factor(pg, &scissor_x, &scissor_y); - pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height); - - /* FIXME: Should this really be inverted instead of ymin? */ - glScissor(scissor_x, scissor_y, scissor_width, scissor_height); - - NV2A_DPRINTF("------------------CLEAR 0x%x %d,%d - %d,%d %x---------------\n", - parameter, xmin, ymin, xmax, ymax, d->pgraph.regs[NV_PGRAPH_COLORCLEARVALUE]); - - /* Dither */ - /* FIXME: Maybe also disable it here? + GL implementation dependent */ - if (pg->regs[NV_PGRAPH_CONTROL_0] & - NV_PGRAPH_CONTROL_0_DITHERENABLE) { - glEnable(GL_DITHER); - } else { - glDisable(GL_DITHER); - } - - glClear(gl_mask); - - glDisable(GL_SCISSOR_TEST); + pg->clear_surface = parameter; + if (pgraph_draw_clear != nullptr) { + pgraph_draw_clear(d); } - - pgraph_set_surface_dirty(pg, write_color, write_zeta); - - unlockGL(pg); break; } @@ -2552,6 +2721,7 @@ static void pgraph_handle_method(NV2AState *d, break; case NV097_SET_TRANSFORM_EXECUTION_MODE: + // Test-case : Whiplash SET_MASK(pg->regs[NV_PGRAPH_CSV0_D], NV_PGRAPH_CSV0_D_MODE, GET_MASK(parameter, NV097_SET_TRANSFORM_EXECUTION_MODE_MODE)); @@ -2560,6 +2730,7 @@ static void pgraph_handle_method(NV2AState *d, NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE)); break; case NV097_SET_TRANSFORM_PROGRAM_CXT_WRITE_EN: + // Test-case : Whiplash pg->enable_vertex_program_write = parameter; break; case NV097_SET_TRANSFORM_PROGRAM_LOAD: @@ -2585,15 +2756,15 @@ static void pgraph_handle_method(NV2AState *d, break; default: NV2A_GL_DPRINTF(true, " unhandled (0x%02x 0x%08x)", - object->graphics_class, method); + graphics_class, method); break; } break; } default: - NV2A_GL_DPRINTF(true, "Unknown Graphics Class/Method 0x%08X/0x%08X\n", - object->graphics_class, method); + NV2A_GL_DPRINTF(true, "Unknown Graphics Class/Method 0x%08X/0x%08X", + graphics_class, method); break; } @@ -2601,35 +2772,39 @@ static void pgraph_handle_method(NV2AState *d, static void pgraph_switch_context(NV2AState *d, unsigned int channel_id) { - bool valid; - + bool channel_valid = + d->pgraph.regs[NV_PGRAPH_CTX_CONTROL] & NV_PGRAPH_CTX_CONTROL_CHID; + unsigned pgraph_channel_id = GET_MASK(d->pgraph.regs[NV_PGRAPH_CTX_USER], NV_PGRAPH_CTX_USER_CHID); // Cxbx Note : This isn't present in xqemu / OpenXbox : d->pgraph.pgraph_lock.lock(); - valid = d->pgraph.channel_valid && d->pgraph.channel_id == channel_id; + bool valid = channel_valid && pgraph_channel_id == channel_id; if (!valid) { - d->pgraph.trapped_channel_id = channel_id; - } - // Cxbx Note : This isn't present in xqemu / OpenXbox : d->pgraph.pgraph_lock.unlock(); + SET_MASK(d->pgraph.regs[NV_PGRAPH_TRAPPED_ADDR], + NV_PGRAPH_TRAPPED_ADDR_CHID, channel_id); - if (!valid) { - NV2A_DPRINTF("puller needs to switch to ch %d\n", channel_id); + NV2A_DPRINTF("pgraph switching to ch %d\n", channel_id); - qemu_mutex_unlock(&d->pgraph.lock); + /* TODO: hardware context switching */ + assert(!(d->pgraph.regs[NV_PGRAPH_DEBUG_3] + & NV_PGRAPH_DEBUG_3_HW_CONTEXT_SWITCH)); + + qemu_mutex_unlock(&d->pgraph.pgraph_lock); qemu_mutex_lock_iothread(); - d->pgraph.pending_interrupts |= NV_PGRAPH_INTR_CONTEXT_SWITCH; + d->pgraph.pending_interrupts |= NV_PGRAPH_INTR_CONTEXT_SWITCH; // TODO : Should this be done before unlocking pgraph_lock? update_irq(d); - qemu_mutex_lock(&d->pgraph.lock); + qemu_mutex_lock(&d->pgraph.pgraph_lock); qemu_mutex_unlock_iothread(); + // wait for the interrupt to be serviced while (d->pgraph.pending_interrupts & NV_PGRAPH_INTR_CONTEXT_SWITCH) { - qemu_cond_wait(&d->pgraph.interrupt_cond, &d->pgraph.lock); + qemu_cond_wait(&d->pgraph.interrupt_cond, &d->pgraph.pgraph_lock); } } } static void pgraph_wait_fifo_access(NV2AState *d) { - while (!d->pgraph.fifo_access) { - qemu_cond_wait(&d->pgraph.fifo_access_cond, &d->pgraph.lock); + while (!(d->pgraph.regs[NV_PGRAPH_FIFO] & NV_PGRAPH_FIFO_ACCESS)) { + qemu_cond_wait(&d->pgraph.fifo_access_cond, &d->pgraph.pgraph_lock); } } @@ -2647,29 +2822,28 @@ static void pgraph_log_method(unsigned int subchannel, subchannel, last, method_name, count); } if (method != 0x1800) { - const char* method_name = NV2AMethodToString(method); - unsigned int nmethod = 0; - switch (graphics_class) { - case NV_KELVIN_PRIMITIVE: - nmethod = method | (0x5c << 16); - break; - case NV_CONTEXT_SURFACES_2D: - nmethod = method | (0x6d << 16); - break; - default: - break; - } - /* - if (nmethod != 0 && nmethod < ARRAY_SIZE(nv2a_method_names)) { - method_name = nv2a_method_names[nmethod]; - }*/ - if (method_name) { - NV2A_DPRINTF("d->pgraph method (%d): %s (0x%x)\n", - subchannel, method_name, parameter); - } else { - NV2A_DPRINTF("d->pgraph method (%d): 0x%x -> 0x%04x (0x%x)\n", + // const char* method_name = NV2AMethodToString(method); + // unsigned int nmethod = 0; + // switch (graphics_class) { + // case NV_KELVIN_PRIMITIVE: + // nmethod = method | (0x5c << 16); + // break; + // case NV_CONTEXT_SURFACES_2D: + // nmethod = method | (0x6d << 16); + // break; + // case NV_CONTEXT_PATTERN: + // nmethod = method | (0x68 << 16); + // break; + // default: + // break; + // } + // if (method_name) { + // NV2A_DPRINTF("d->pgraph method (%d): %s (0x%x)\n", + // subchannel, method_name, parameter); + // } else { + NV2A_DPRINTF("pgraph method (%d): 0x%08X -> 0x%04x (0x%x)\n", subchannel, graphics_class, method, parameter); - } + // } } if (method == last) { count++; } @@ -2722,8 +2896,7 @@ void pgraph_init(NV2AState *d) PGRAPHState *pg = &d->pgraph; - qemu_mutex_init(&pg->lock); - qemu_mutex_init(&pg->gl_lock); + qemu_mutex_init(&pg->pgraph_lock); qemu_cond_init(&pg->interrupt_cond); qemu_cond_init(&pg->fifo_access_cond); qemu_cond_init(&pg->flip_3d); @@ -2731,9 +2904,10 @@ void pgraph_init(NV2AState *d) if (!(pg->opengl_enabled)) return; - /* fire up opengl */ + /* attach OpenGL render plugins */ + OpenGL_init_pgraph_plugins(); - lockGL(pg); + /* fire up opengl */ pg->gl_context = glo_context_create(); assert(pg->gl_context); @@ -2810,14 +2984,18 @@ void pgraph_init(NV2AState *d) // assert(glGetError() == GL_NO_ERROR); - unlockGL(&d->pgraph); + glo_set_current(NULL); } void pgraph_destroy(PGRAPHState *pg) { - if (pg->opengl_enabled) { - lockGL(pg); + qemu_mutex_destroy(&pg->pgraph_lock); + qemu_cond_destroy(&pg->interrupt_cond); + qemu_cond_destroy(&pg->fifo_access_cond); + qemu_cond_destroy(&pg->flip_3d); + + if (pg->opengl_enabled) { glo_set_current(pg->gl_context); if (pg->gl_color_buffer) { @@ -2834,8 +3012,6 @@ void pgraph_destroy(PGRAPHState *pg) glo_set_current(NULL); glo_context_destroy(pg->gl_context); - - unlockGL(pg); } } @@ -3052,6 +3228,8 @@ static void pgraph_bind_shaders(PGRAPHState *pg) ShaderState state; /* register combiner stuff */ + state.psh.window_clip_exclusive = pg->regs[NV_PGRAPH_SETUPRASTER] + & NV_PGRAPH_SETUPRASTER_WINDOWCLIPTYPE, state.psh.combiner_control = pg->regs[NV_PGRAPH_COMBINECTL]; state.psh.shader_stage_program = pg->regs[NV_PGRAPH_SHADERPROG]; state.psh.other_stage_input = pg->regs[NV_PGRAPH_SHADERCTL]; @@ -3147,6 +3325,45 @@ static void pgraph_bind_shaders(PGRAPHState *pg) } } + /* Window clip + * + * Optimization note: very quickly check to ignore any repeated or zero-size + * clipping regions. Note that if region number 7 is valid, but the rest are + * not, we will still add all of them. Clip regions seem to be typically + * front-loaded (meaning the first one or two regions are populated, and the + * following are zeroed-out), so let's avoid adding any more complicated + * masking or copying logic here for now unless we discover a valid case. + */ + assert(!state.psh.window_clip_exclusive); /* FIXME: Untested */ + state.psh.window_clip_count = 0; + uint32_t last_x = 0, last_y = 0; + + for (i = 0; i < 8; i++) { + const uint32_t x = pg->regs[NV_PGRAPH_WINDOWCLIPX0 + i * 4]; + const uint32_t y = pg->regs[NV_PGRAPH_WINDOWCLIPY0 + i * 4]; + const uint32_t x_min = GET_MASK(x, NV_PGRAPH_WINDOWCLIPX0_XMIN); + const uint32_t x_max = GET_MASK(x, NV_PGRAPH_WINDOWCLIPX0_XMAX); + const uint32_t y_min = GET_MASK(y, NV_PGRAPH_WINDOWCLIPY0_YMIN); + const uint32_t y_max = GET_MASK(y, NV_PGRAPH_WINDOWCLIPY0_YMAX); + + /* Check for zero width or height clipping region */ + if ((x_min == x_max) || (y_min == y_max)) { + continue; + } + + /* Check for in-order duplicate regions */ + if ((x == last_x) && (y == last_y)) { + continue; + } + + NV2A_DPRINTF("Clipping Region %d: min=(%d, %d) max=(%d, %d)\n", + i, x_min, y_min, x_max, y_max); + + state.psh.window_clip_count = i + 1; + last_x = x; + last_y = y; + } + for (i = 0; i < 8; i++) { state.psh.rgb_inputs[i] = pg->regs[NV_PGRAPH_COMBINECOLORI0 + i * 4]; state.psh.rgb_outputs[i] = pg->regs[NV_PGRAPH_COMBINECOLORO0 + i * 4]; @@ -3164,7 +3381,7 @@ static void pgraph_bind_shaders(PGRAPHState *pg) GET_MASK(pg->regs[NV_PGRAPH_TEXFMT0 + i*4], NV_PGRAPH_TEXFMT0_COLOR); - if (enabled && kelvin_color_format_map[color_format].linear) { + if (enabled && kelvin_color_format_map[color_format].encoding == linear) { state.psh.rect_tex[i] = true; } @@ -3198,6 +3415,33 @@ static void pgraph_bind_shaders(PGRAPHState *pg) glUseProgram(pg->shader_binding->gl_program); + /* Clipping regions */ + for (i = 0; i < state.psh.window_clip_count; i++) { + if (pg->shader_binding->clip_region_loc[i] == -1) { + continue; + } + + uint32_t x = pg->regs[NV_PGRAPH_WINDOWCLIPX0 + i * 4]; + GLuint x_min = GET_MASK(x, NV_PGRAPH_WINDOWCLIPX0_XMIN); + GLuint x_max = GET_MASK(x, NV_PGRAPH_WINDOWCLIPX0_XMAX); + + /* Adjust y-coordinates for the OpenGL viewport: translate coordinates + * to have the origin at the bottom-left of the surface (as opposed to + * top-left), and flip y-min and y-max accordingly. + */ + uint32_t y = pg->regs[NV_PGRAPH_WINDOWCLIPY0 + i * 4]; + GLuint y_min = (pg->surface_shape.clip_height - 1) - + GET_MASK(y, NV_PGRAPH_WINDOWCLIPY0_YMAX); + GLuint y_max = (pg->surface_shape.clip_height - 1) - + GET_MASK(y, NV_PGRAPH_WINDOWCLIPY0_YMIN); + + pgraph_apply_anti_aliasing_factor(pg, &x_min, &y_min); + pgraph_apply_anti_aliasing_factor(pg, &x_max, &y_max); + + glUniform4i(pg->shader_binding->clip_region_loc[i], + x_min, y_min, x_max, y_max); + } + pgraph_update_shader_constants(pg, pg->shader_binding, binding_changed, vertex_program, fixed_function); @@ -3254,7 +3498,8 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) { hwaddr dma_address; GLuint *gl_buffer; unsigned int bytes_per_pixel; - GLenum gl_internal_format, gl_format, gl_type, gl_attachment; + GLint gl_internal_format; + GLenum gl_format, gl_type, gl_attachment; if (color) { surface = &pg->surface_color; @@ -3425,7 +3670,7 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) { } surface->buffer_dirty = false; - +#ifdef DEBUG_NV2A uint8_t *out = data + surface->offset + 64; NV2A_DPRINTF("upload_surface %s 0x%" HWADDR_PRIx " - 0x%" HWADDR_PRIx ", " "(0x%" HWADDR_PRIx " - 0x%" HWADDR_PRIx ", " @@ -3439,7 +3684,7 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) { pg->surface_shape.clip_height, surface->pitch, out[0], out[1], out[2], out[3]); - +#endif } if (!upload && surface->draw_dirty) { @@ -3475,6 +3720,7 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) { surface->draw_dirty = false; surface->write_enabled_cache = false; +#ifdef DEBUG_NV2A uint8_t *out = data + surface->offset + 64; NV2A_DPRINTF("read_surface %s 0x%" HWADDR_PRIx " - 0x%" HWADDR_PRIx ", " "(0x%" HWADDR_PRIx " - 0x%" HWADDR_PRIx ", " @@ -3487,7 +3733,7 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) { pg->surface_shape.clip_width, pg->surface_shape.clip_height, surface->pitch, out[0], out[1], out[2], out[3]); - +#endif } if (swizzle) { @@ -3605,9 +3851,10 @@ static void pgraph_bind_textures(NV2AState *d) unsigned int rect_height = GET_MASK(pg->regs[NV_PGRAPH_TEXIMAGERECT0 + i*4], NV_PGRAPH_TEXIMAGERECT0_HEIGHT); - +#ifdef DEBUG_NV2A unsigned int lod_bias = GET_MASK(filter, NV_PGRAPH_TEXFILTER0_MIPMAP_LOD_BIAS); +#endif unsigned int min_filter = GET_MASK(filter, NV_PGRAPH_TEXFILTER0_MIN); unsigned int mag_filter = GET_MASK(filter, NV_PGRAPH_TEXFILTER0_MAG); @@ -3658,9 +3905,9 @@ static void pgraph_bind_textures(NV2AState *d) continue; } - NV2A_DPRINTF(" texture %d is format 0x%x, (r %d, %d or %d, %d, %d; %d%s)," + NV2A_DPRINTF(" texture %d is format 0x%x, off 0x%x (r %d, %d or %d, %d, %d; %d%s)," " filter %x %x, levels %d-%d %d bias %d\n", - i, color_format, + i, color_format, offset, rect_width, rect_height, 1 << log_width, 1 << log_height, 1 << log_depth, pitch, @@ -3678,7 +3925,7 @@ static void pgraph_bind_textures(NV2AState *d) } unsigned int width, height, depth; - if (f.linear) { + if (f.encoding == linear) { assert(dimensionality == 2); width = rect_width; height = rect_height; @@ -3690,7 +3937,7 @@ static void pgraph_bind_textures(NV2AState *d) /* FIXME: What about 3D mipmaps? */ levels = MIN(levels, max_mipmap_level + 1); - if (f.gl_format != 0) { + if (f.encoding == swizzled) { /* Discard mipmap levels that would be smaller than 1x1. * FIXME: Is this actually needed? * @@ -3756,7 +4003,7 @@ static void pgraph_bind_textures(NV2AState *d) NV2A_DPRINTF(" - 0x%tx\n", texture_data - d->vram_ptr); size_t length = 0; - if (f.linear) { + if (f.encoding == linear) { assert(cubemap == false); assert(dimensionality == 2); length = height * pitch; @@ -3764,7 +4011,7 @@ static void pgraph_bind_textures(NV2AState *d) if (dimensionality >= 2) { unsigned int w = width, h = height; unsigned int level; - if (f.gl_format != 0) { + if (f.encoding == swizzled) { for (level = 0; level < levels; level++) { w = MAX(w, 1); h = MAX(h, 1); length += w * h * f.bytes_per_pixel; @@ -3832,8 +4079,8 @@ static void pgraph_bind_textures(NV2AState *d) glBindTexture(binding->gl_target, binding->gl_texture); - if (f.linear) { - /* somtimes games try to set mipmap min filters on linear textures. + if (f.encoding == linear) { + /* sometimes games try to set mipmap min filters on linear textures. * this could indicate a bug... */ switch (min_filter) { case NV_PGRAPH_TEXFILTER0_MIN_BOX_NEARESTLOD: @@ -4102,44 +4349,6 @@ static unsigned int pgraph_bind_inline_array(NV2AState *d) return index_count; } -static void load_graphics_object(NV2AState *d, hwaddr instance_address, - GraphicsObject *obj) -{ - uint8_t *obj_ptr; - uint32_t switch1, switch2, switch3; - - assert(instance_address < d->pramin.ramin_size); - - obj_ptr = d->pramin.ramin_ptr + instance_address; - - switch1 = ldl_le_p((uint32_t*)obj_ptr); - switch2 = ldl_le_p((uint32_t*)(obj_ptr + 4)); - switch3 = ldl_le_p((uint32_t*)(obj_ptr + 8)); - - obj->graphics_class = switch1 & NV_PGRAPH_CTX_SWITCH1_GRCLASS; - - /* init graphics object */ - switch (obj->graphics_class) { - case NV_KELVIN_PRIMITIVE: - // kelvin->vertex_attributes[NV2A_VERTEX_ATTR_DIFFUSE].inline_value = 0xFFFFFFF; - break; - default: - break; - } -} - -static GraphicsObject* lookup_graphics_object(PGRAPHState *s, - hwaddr instance_address) -{ - int i; - for (i = 0; isubchannel_data[i].object_instance == instance_address) { - return &s->subchannel_data[i].object; - } - } - return NULL; -} - /* 16 bit to [0.0, F16_MAX = 511.9375] */ static float convert_f16_to_float(uint16_t f16) { if (f16 == 0x0000) { return 0.0f; } @@ -4156,94 +4365,100 @@ static float convert_f24_to_float(uint32_t f24) { return *(float*)&i; } -static uint8_t cliptobyte(int x) -{ - return (uint8_t)((x < 0) ? 0 : ((x > 255) ? 255 : x)); -} +extern void __R6G5B5ToARGBRow_C(const uint8_t* src_r6g5b5, uint8_t* dst_argb, int width); +extern void ____YUY2ToARGBRow_C(const uint8_t* src_yuy2, uint8_t* rgb_buf, int width); +extern void ____UYVYToARGBRow_C(const uint8_t* src_uyvy, uint8_t* rgb_buf, int width); -static void convert_yuy2_to_rgb(const uint8_t *line, unsigned int ix, - uint8_t *r, uint8_t *g, uint8_t* b) { - int c, d, e; - c = (int)line[ix * 2] - 16; - if (ix % 2) { - d = (int)line[ix * 2 - 1] - 128; - e = (int)line[ix * 2 + 1] - 128; - } else { - d = (int)line[ix * 2 + 1] - 128; - e = (int)line[ix * 2 + 3] - 128; - } - *r = cliptobyte((298 * c + 409 * e + 128) >> 8); - *g = cliptobyte((298 * c - 100 * d - 208 * e + 128) >> 8); - *b = cliptobyte((298 * c + 516 * d + 128) >> 8); -} +/* 'converted_format' indicates the format that results when convert_texture_data() returns non-NULL converted_data. */ +static const int converted_format = NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8R8G8B8; -static uint8_t* convert_texture_data(const TextureShape s, +static uint8_t* convert_texture_data(const unsigned int color_format, const uint8_t *data, const uint8_t *palette_data, - unsigned int width, - unsigned int height, - unsigned int depth, - unsigned int row_pitch, - unsigned int slice_pitch) + const unsigned int width, + const unsigned int height, + const unsigned int depth, + const unsigned int row_pitch, + const unsigned int slice_pitch) { - if (s.color_format == NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8) { - assert(depth == 1); /* FIXME */ - uint8_t* converted_data = (uint8_t*)g_malloc(width * height * 4); + // Note : Unswizzle is already done when entering here + switch (color_format) { + case NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8: { + // Test-case : WWE RAW2 + assert(depth == 1); /* FIXME */ + uint8_t* converted_data = (uint8_t*)g_malloc(width * height * 4); unsigned int x, y; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - uint8_t index = data[y * row_pitch + x]; - uint32_t color = *(uint32_t*)(palette_data + index * 4); - *(uint32_t*)(converted_data + y * width * 4 + x * 4) = color; - } - } - return converted_data; - } else if (s.color_format - == NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8) { - assert(depth == 1); /* FIXME */ - uint8_t* converted_data = (uint8_t*)g_malloc(width * height * 4); - unsigned int x, y; - for (y = 0; y < height; y++) { - const uint8_t* line = &data[y * s.width * 2]; - for (x = 0; x < width; x++) { - uint8_t* pixel = &converted_data[(y * s.width + x) * 4]; - /* FIXME: Actually needs uyvy? */ - convert_yuy2_to_rgb(line, x, &pixel[0], &pixel[1], &pixel[2]); - pixel[3] = 255; - } - } - return converted_data; - } else if (s.color_format - == NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5) { - assert(depth == 1); /* FIXME */ - uint8_t *converted_data = (uint8_t*)g_malloc(width * height * 3); - unsigned int x, y; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - uint16_t rgb655 = *(uint16_t*)(data + y * row_pitch + x * 2); - int8_t *pixel = (int8_t*)&converted_data[(y * width + x) * 3]; - /* Maps 5 bit G and B signed value range to 8 bit - * signed values. R is probably unsigned. - */ - rgb655 ^= (1 << 9) | (1 << 4); - pixel[0] = ((rgb655 & 0xFC00) >> 10) * 0x7F / 0x3F; - pixel[1] = ((rgb655 & 0x03E0) >> 5) * 0xFF / 0x1F - 0x80; - pixel[2] = (rgb655 & 0x001F) * 0xFF / 0x1F - 0x80; - } - } - return converted_data; - } else { + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + uint8_t index = data[y * row_pitch + x]; + uint32_t color = *(uint32_t*)(palette_data + index * 4); + *(uint32_t*)(converted_data + y * width * 4 + x * 4) = color; + } + } + return converted_data; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X7SY9: { + assert(false); /* FIXME */ + return NULL; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8: { + // Test-case : WWE RAW2 + assert(depth == 1); /* FIXME */ + uint8_t* converted_data = (uint8_t*)g_malloc(width * height * 4); + unsigned int y; + for (y = 0; y < height; y++) { + const uint8_t* line = &data[y * width * 2]; + uint8_t* pixel = &converted_data[(y * width) * 4]; + ____YUY2ToARGBRow_C(line, pixel, width); + // Note : LC_IMAGE_CR8YB8CB8YA8 suggests UYVY format, + // but for an unknown reason, the actual encoding is YUY2 + } + return converted_data; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_YB8CR8YA8CB8: { + assert(depth == 1); /* FIXME */ + uint8_t* converted_data = (uint8_t*)g_malloc(width * height * 4); + unsigned int y; + for (y = 0; y < height; y++) { + const uint8_t* line = &data[y * width * 2]; + uint8_t* pixel = &converted_data[(y * width) * 4]; + ____UYVYToARGBRow_C(line, pixel, width); // TODO : Validate LC_IMAGE_YB8CR8YA8CB8 indeed requires ____UYVYToARGBRow_C() + } + return converted_data; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_A4V6YB6A4U6YA6: { + assert(false); /* FIXME */ + return NULL; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8CR8CB8Y8: { + assert(false); /* FIXME */ + return NULL; + } + case NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5: + case NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R6G5B5: { + assert(depth == 1); /* FIXME */ + uint8_t *converted_data = (uint8_t*)g_malloc(width * height * 4); + unsigned int y; + for (y = 0; y < height; y++) { + uint16_t rgb655 = *(uint16_t*)(data + y * row_pitch); + int8_t *pixel = (int8_t*)&converted_data[(y * width) * 4]; + __R6G5B5ToARGBRow_C((const uint8_t*)rgb655, (uint8_t*)pixel, width); + } + return converted_data; + } + default: return NULL; } } -static void upload_gl_texture(GLenum gl_target, +/* returns the format of the output, either identical to the input format, or the converted format - see converted_format */ +static int upload_gl_texture(GLenum gl_target, const TextureShape s, const uint8_t *texture_data, const uint8_t *palette_data) { //assert(pg->opengl_enabled); - + int resulting_format = s.color_format; ColorFormatInfo f = kelvin_color_format_map[s.color_format]; switch(gl_target) { @@ -4256,19 +4471,30 @@ static void upload_gl_texture(GLenum gl_target, glPixelStorei(GL_UNPACK_ROW_LENGTH, s.pitch / f.bytes_per_pixel); - uint8_t *converted = convert_texture_data(s, texture_data, + uint8_t *unswizzled = NULL; + if (f.encoding == swizzled) { // TODO : Verify this works correctly + unswizzled = (uint8_t*)g_malloc(s.height * s.pitch); + unswizzle_rect(texture_data, s.width, s.height, + unswizzled, s.pitch, f.bytes_per_pixel); + } + uint8_t *converted = convert_texture_data(s.color_format, unswizzled ? unswizzled : texture_data, palette_data, s.width, s.height, 1, s.pitch, 0); - glTexImage2D(gl_target, 0, f.gl_internal_format, + resulting_format = converted ? converted_format : s.color_format; + ColorFormatInfo cf = kelvin_color_format_map[resulting_format]; + glTexImage2D(gl_target, 0, cf.gl_internal_format, s.width, s.height, 0, - f.gl_format, f.gl_type, - converted ? converted : texture_data); + cf.gl_format, cf.gl_type, + converted ? converted : unswizzled ? unswizzled : texture_data); if (converted) { g_free(converted); } + if (unswizzled) { + g_free(unswizzled); + } glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); break; @@ -4285,7 +4511,7 @@ static void upload_gl_texture(GLenum gl_target, unsigned int level; for (level = 0; level < s.levels; level++) { - if (f.gl_format == 0) { /* compressed */ + if (f.encoding == compressed) { width = MAX(width, 4); height = MAX(height, 4); @@ -4307,26 +4533,33 @@ static void upload_gl_texture(GLenum gl_target, width = MAX(width, 1); height = MAX(height, 1); unsigned int pitch = width * f.bytes_per_pixel; - uint8_t *unswizzled = (uint8_t*)g_malloc(height * pitch); - unswizzle_rect(texture_data, width, height, - unswizzled, pitch, f.bytes_per_pixel); + uint8_t *unswizzled = NULL; + if (f.encoding == swizzled) { + unswizzled = (uint8_t*)g_malloc(height * pitch); + unswizzle_rect(texture_data, width, height, + unswizzled, pitch, f.bytes_per_pixel); + } - uint8_t *converted = convert_texture_data(s, unswizzled, + uint8_t *converted = convert_texture_data(s.color_format, unswizzled ? unswizzled : texture_data, palette_data, width, height, 1, pitch, 0); - glTexImage2D(gl_target, level, f.gl_internal_format, + resulting_format = converted ? converted_format : s.color_format; + ColorFormatInfo cf = kelvin_color_format_map[resulting_format]; + glTexImage2D(gl_target, level, cf.gl_internal_format, width, height, 0, - f.gl_format, f.gl_type, - converted ? converted : unswizzled); + cf.gl_format, cf.gl_type, + converted ? converted : unswizzled ? unswizzled : texture_data); if (converted) { g_free(converted); } - g_free(unswizzled); + if (unswizzled) { + g_free(unswizzled); + } - texture_data += width * height * f.bytes_per_pixel; + texture_data += pitch * height; } width /= 2; @@ -4339,32 +4572,35 @@ static void upload_gl_texture(GLenum gl_target, unsigned int width = s.width, height = s.height, depth = s.depth; - assert(f.gl_format != 0); /* FIXME: compressed not supported yet */ - assert(f.linear == false); - unsigned int level; for (level = 0; level < s.levels; level++) { unsigned int row_pitch = width * f.bytes_per_pixel; unsigned int slice_pitch = row_pitch * height; - uint8_t *unswizzled = (uint8_t*)g_malloc(slice_pitch * depth); - unswizzle_box(texture_data, width, height, depth, unswizzled, - row_pitch, slice_pitch, f.bytes_per_pixel); - - uint8_t *converted = convert_texture_data(s, unswizzled, + uint8_t *unswizzled = NULL; + if (f.encoding == swizzled) { + unswizzled = (uint8_t*)g_malloc(slice_pitch * depth); + unswizzle_box(texture_data, width, height, depth, unswizzled, + row_pitch, slice_pitch, f.bytes_per_pixel); + } + uint8_t *converted = convert_texture_data(s.color_format, unswizzled ? unswizzled : texture_data, palette_data, width, height, depth, row_pitch, slice_pitch); - glTexImage3D(gl_target, level, f.gl_internal_format, + resulting_format = converted ? converted_format : s.color_format; + ColorFormatInfo cf = kelvin_color_format_map[resulting_format]; + glTexImage3D(gl_target, level, cf.gl_internal_format, width, height, depth, 0, - f.gl_format, f.gl_type, - converted ? converted : unswizzled); + cf.gl_format, cf.gl_type, + converted ? converted : unswizzled ? unswizzled : texture_data); if (converted) { g_free(converted); } - g_free(unswizzled); + if (unswizzled) { + g_free(unswizzled); + } texture_data += width * height * depth * f.bytes_per_pixel; @@ -4378,6 +4614,7 @@ static void upload_gl_texture(GLenum gl_target, assert(false); break; } + return resulting_format; } static TextureBinding* generate_texture(const TextureShape s, @@ -4394,11 +4631,11 @@ static TextureBinding* generate_texture(const TextureShape s, GLenum gl_target; if (s.cubemap) { - assert(f.linear == false); + assert(f.encoding != linear); assert(s.dimensionality == 2); gl_target = GL_TEXTURE_CUBE_MAP; } else { - if (f.linear) { + if (f.encoding == linear) { /* FIXME : Include compressed too? (!= swizzled) */ /* linear textures use unnormalised texcoords. * GL_TEXTURE_RECTANGLE_ARB conveniently also does, but * does not allow repeat and mirror wrap modes. @@ -4425,10 +4662,24 @@ static TextureBinding* generate_texture(const TextureShape s, NV2A_GL_DLABEL(GL_TEXTURE, gl_texture, "format: 0x%02X%s, %d dimensions%s, width: %d, height: %d, depth: %d", - s.color_format, f.linear ? "" : " (SZ)", + s.color_format, (f.encoding == linear) ? "" : (f.encoding == swizzled) ? " (SZ)" : " (DXT)", // compressed s.dimensionality, s.cubemap ? " (Cubemap)" : "", s.width, s.height, s.depth); + /* Linear textures don't support mipmapping */ + if (f.encoding != linear) { + glTexParameteri(gl_target, GL_TEXTURE_BASE_LEVEL, + s.min_mipmap_level); + glTexParameteri(gl_target, GL_TEXTURE_MAX_LEVEL, + s.levels - 1); + } + + /* Set this before calling upload_gl_texture() to prevent potential conversions */ + if (f.gl_swizzle_mask) { + glTexParameteriv(gl_target, GL_TEXTURE_SWIZZLE_RGBA, + f.gl_swizzle_mask); + } + if (gl_target == GL_TEXTURE_CUBE_MAP) { size_t length = 0; @@ -4457,20 +4708,6 @@ static TextureBinding* generate_texture(const TextureShape s, upload_gl_texture(gl_target, s, texture_data, palette_data); } - /* Linear textures don't support mipmapping */ - if (!f.linear) { - glTexParameteri(gl_target, GL_TEXTURE_BASE_LEVEL, - s.min_mipmap_level); - glTexParameteri(gl_target, GL_TEXTURE_MAX_LEVEL, - s.levels - 1); - } - - if (f.gl_swizzle_mask[0] != 0 || f.gl_swizzle_mask[1] != 0 - || f.gl_swizzle_mask[2] != 0 || f.gl_swizzle_mask[3] != 0) { - glTexParameteriv(gl_target, GL_TEXTURE_SWIZZLE_RGBA, - (const GLint *)f.gl_swizzle_mask); - } - TextureBinding* ret = (TextureBinding *)g_malloc(sizeof(TextureBinding)); ret->gl_target = gl_target; ret->gl_texture = gl_texture; diff --git a/src/devices/video/EmuNV2A_PMC.cpp b/src/devices/video/EmuNV2A_PMC.cpp index 4b8719b2f..535996aae 100644 --- a/src/devices/video/EmuNV2A_PMC.cpp +++ b/src/devices/video/EmuNV2A_PMC.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pmc.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + /* PMC - card master control */ DEVICE_READ32(PMC) { diff --git a/src/devices/video/EmuNV2A_PRAMDAC.cpp b/src/devices/video/EmuNV2A_PRAMDAC.cpp index 2cd190d6c..768811e3a 100644 --- a/src/devices/video/EmuNV2A_PRAMDAC.cpp +++ b/src/devices/video/EmuNV2A_PRAMDAC.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pramdac.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + DEVICE_READ32(PRAMDAC) { DEVICE_READ32_SWITCH() { @@ -58,7 +93,7 @@ DEVICE_WRITE32(PRAMDAC) break; default: - //DEVICE_WRITE32_REG(pramdac); // Was : DEBUG_WRITE32_UNHANDLED(PRAMDAC); + DEVICE_WRITE32_REG(pramdac); // Was : DEBUG_WRITE32_UNHANDLED(PRAMDAC); break; } diff --git a/src/devices/video/EmuNV2A_PRAMIN.cpp b/src/devices/video/EmuNV2A_PRAMIN.cpp index 533be20ec..da7c0ba73 100644 --- a/src/devices/video/EmuNV2A_PRAMIN.cpp +++ b/src/devices/video/EmuNV2A_PRAMIN.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + DEVICE_READ32(PRAMIN) { uint32_t result = *((uint32_t*)(d->pramin.ramin_ptr + addr)); diff --git a/src/devices/video/EmuNV2A_PRMA.cpp b/src/devices/video/EmuNV2A_PRMA.cpp index 7f21a4ee2..062f95011 100644 --- a/src/devices/video/EmuNV2A_PRMA.cpp +++ b/src/devices/video/EmuNV2A_PRMA.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PRMA switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PRMA) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PRMCIO.cpp b/src/devices/video/EmuNV2A_PRMCIO.cpp index 6283cf19b..0496f9169 100644 --- a/src/devices/video/EmuNV2A_PRMCIO.cpp +++ b/src/devices/video/EmuNV2A_PRMCIO.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_prmcio.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + DEVICE_READ32(PRMCIO) { // vga_ioport_read : @@ -14,7 +49,7 @@ DEVICE_READ32(PRMCIO) break; default: DEBUG_READ32_UNHANDLED(PRMCIO); - printf("vga: UNHANDLED ADDR %s\n", addr); + printf("vga: UNHANDLED ADDR %x\n", addr); break; } @@ -52,14 +87,14 @@ DEVICE_WRITE32(PRMCIO) if (d->prmcio.cr_index == VGA_CRTC_OVERFLOW) { d->prmcio.cr[VGA_CRTC_OVERFLOW] = (d->prmcio.cr[VGA_CRTC_OVERFLOW] & ~0x10) | (value & 0x10); - EmuWarning("TODO: vbe_update_vgaregs"); + EmuLog(LOG_LEVEL::WARNING, "TODO: vbe_update_vgaregs"); //vbe_update_vgaregs(); } return; } d->prmcio.cr[d->prmcio.cr_index] = value; - EmuWarning("TODO: vbe_update_vgaregs"); + EmuLog(LOG_LEVEL::WARNING, "TODO: vbe_update_vgaregs"); //vbe_update_vgaregs(); switch (d->prmcio.cr_index) { @@ -71,7 +106,7 @@ DEVICE_WRITE32(PRMCIO) case VGA_CRTC_V_SYNC_END: case VGA_CRTC_MODE: // TODO: s->update_retrace_info(s); - EmuWarning("TODO: update_retrace_info"); + EmuLog(LOG_LEVEL::WARNING, "TODO: update_retrace_info"); break; } break; diff --git a/src/devices/video/EmuNV2A_PRMDIO.cpp b/src/devices/video/EmuNV2A_PRMDIO.cpp index 21e9447f8..8b1c40775 100644 --- a/src/devices/video/EmuNV2A_PRMDIO.cpp +++ b/src/devices/video/EmuNV2A_PRMDIO.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PRMDIO switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PRMDIO) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PRMFB.cpp b/src/devices/video/EmuNV2A_PRMFB.cpp index 176328a1f..c73069c81 100644 --- a/src/devices/video/EmuNV2A_PRMFB.cpp +++ b/src/devices/video/EmuNV2A_PRMFB.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PRMFB switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PRMFB) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PRMVIO.cpp b/src/devices/video/EmuNV2A_PRMVIO.cpp index f9f2b0b90..56bab7ff8 100644 --- a/src/devices/video/EmuNV2A_PRMVIO.cpp +++ b/src/devices/video/EmuNV2A_PRMVIO.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_prmvio.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PRMVIO switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PRMVIO) { // vga_ioport_read diff --git a/src/devices/video/EmuNV2A_PSTRAPS.cpp b/src/devices/video/EmuNV2A_PSTRAPS.cpp index cd50beb69..e8f4ff289 100644 --- a/src/devices/video/EmuNV2A_PSTRAPS.cpp +++ b/src/devices/video/EmuNV2A_PSTRAPS.cpp @@ -1,3 +1,37 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PSTRAPS switch. #pragma warning(push) diff --git a/src/devices/video/EmuNV2A_PTIMER.cpp b/src/devices/video/EmuNV2A_PTIMER.cpp index d338bcf7a..073e653b7 100644 --- a/src/devices/video/EmuNV2A_PTIMER.cpp +++ b/src/devices/video/EmuNV2A_PTIMER.cpp @@ -1,21 +1,41 @@ -static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) -{ - union { - uint64_t ll; - struct { - uint32_t low, high; - } l; - } u, res; - uint64_t rl, rh; +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_ptimer.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** - u.ll = a; - rl = (uint64_t)u.l.low * (uint64_t)b; - rh = (uint64_t)u.l.high * (uint64_t)b; - rh += (rl >> 32); - res.l.high = (uint32_t)(rh / c); - res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c; - return res.ll; -} +#include "common\util\CxbxUtil.h" + +#define NANOSECONDS_PER_SECOND 1000000000 /* PTIMER - time measurement and time-based alarms */ static uint64_t ptimer_get_clock(NV2AState * d) @@ -23,9 +43,11 @@ static uint64_t ptimer_get_clock(NV2AState * d) // Get time in nanoseconds uint64_t time = std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); - return muldiv64(time, - uint32_t(d->pramdac.core_clock_freq * d->ptimer.numerator), - CLOCKS_PER_SEC * d->ptimer.denominator); + return Muldiv64(Muldiv64(time, + (uint32_t)d->pramdac.core_clock_freq, // TODO : Research how this can be updated to accept uint64_t + NANOSECONDS_PER_SECOND), // Was CLOCKS_PER_SEC + d->ptimer.denominator, + d->ptimer.numerator); } DEVICE_READ32(PTIMER) diff --git a/src/devices/video/EmuNV2A_PTV.cpp b/src/devices/video/EmuNV2A_PTV.cpp index bb4e66b75..669ffbc86 100644 --- a/src/devices/video/EmuNV2A_PTV.cpp +++ b/src/devices/video/EmuNV2A_PTV.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PTV switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PTV) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_PVIDEO.cpp b/src/devices/video/EmuNV2A_PVIDEO.cpp index d66cd5c09..0dabf2fad 100644 --- a/src/devices/video/EmuNV2A_PVIDEO.cpp +++ b/src/devices/video/EmuNV2A_PVIDEO.cpp @@ -1,3 +1,38 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_pvideo.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + static void pvideo_vga_invalidate(NV2AState *d) { int y1 = GET_MASK(d->pvideo.regs[NV_PVIDEO_POINT_OUT(0)], diff --git a/src/devices/video/EmuNV2A_PVPE.cpp b/src/devices/video/EmuNV2A_PVPE.cpp index a336c94d7..da47222e0 100644 --- a/src/devices/video/EmuNV2A_PVPE.cpp +++ b/src/devices/video/EmuNV2A_PVPE.cpp @@ -1,7 +1,42 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_stubs.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** // TODO: Remove disabled warning once case are add to PVPE switch. #pragma warning(push) #pragma warning(disable: 4065) + DEVICE_READ32(PVPE) { DEVICE_READ32_SWITCH() { diff --git a/src/devices/video/EmuNV2A_USER.cpp b/src/devices/video/EmuNV2A_USER.cpp index 140d66a00..18b4ccae2 100644 --- a/src/devices/video/EmuNV2A_USER.cpp +++ b/src/devices/video/EmuNV2A_USER.cpp @@ -1,34 +1,81 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a_user.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson +// * +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem +// * +// * All rights reserved +// * +// ****************************************************************** + /* USER - PFIFO MMIO and DMA submission area */ DEVICE_READ32(USER) { unsigned int channel_id = addr >> 16; assert(channel_id < NV2A_NUM_CHANNELS); - ChannelControl *control = &d->user.channel_control[channel_id]; + qemu_mutex_lock(&d->pfifo.pfifo_lock); uint32_t channel_modes = d->pfifo.regs[NV_PFIFO_MODE]; - /* PIO Mode */ - if (!channel_modes & (1 << channel_id)) { + uint32_t result = 0; + if (channel_modes & (1 << channel_id)) { + /* DMA Mode */ + + unsigned int cur_channel_id = + GET_MASK(d->pfifo.regs[NV_PFIFO_CACHE1_PUSH1], + NV_PFIFO_CACHE1_PUSH1_CHID); + + if (channel_id == cur_channel_id) { + switch(addr & 0xFFFF) { // Was DEVICE_READ32_SWITCH() + case NV_USER_DMA_PUT: + result = d->pfifo.regs[NV_PFIFO_CACHE1_DMA_PUT]; + break; + case NV_USER_DMA_GET: + result = d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET]; + break; + case NV_USER_REF: + result = d->pfifo.regs[NV_PFIFO_CACHE1_REF]; + break; + default: + DEBUG_READ32_UNHANDLED(USER); + break; + } + } else { + /* ramfc */ + assert(false); + } + } else { + /* PIO Mode */ assert(false); } - /* DMA Mode */ - addr &= 0xFFFF; - DEVICE_READ32_SWITCH() { - case NV_USER_DMA_PUT: - result = control->dma_put; - break; - case NV_USER_DMA_GET: - result = control->dma_get; - break; - case NV_USER_REF: - result = control->ref; - break; - default: - DEBUG_READ32_UNHANDLED(USER); - break; - } + qemu_mutex_unlock(&d->pfifo.pfifo_lock); DEVICE_READ32_END(USER); } @@ -38,33 +85,44 @@ DEVICE_WRITE32(USER) unsigned int channel_id = addr >> 16; assert(channel_id < NV2A_NUM_CHANNELS); - ChannelControl *control = &d->user.channel_control[channel_id]; + qemu_mutex_lock(&d->pfifo.pfifo_lock); uint32_t channel_modes = d->pfifo.regs[NV_PFIFO_MODE]; if (channel_modes & (1 << channel_id)) { /* DMA Mode */ - switch (addr & 0xFFFF) { - case NV_USER_DMA_PUT: - control->dma_put = value; + unsigned int cur_channel_id = + GET_MASK(d->pfifo.regs[NV_PFIFO_CACHE1_PUSH1], + NV_PFIFO_CACHE1_PUSH1_CHID); - if (d->pfifo.cache1.push_enabled) { - pfifo_run_pusher(d); + if (channel_id == cur_channel_id) { + switch (addr & 0xFFFF) { + case NV_USER_DMA_PUT: + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_PUT] = value; + break; + case NV_USER_DMA_GET: + d->pfifo.regs[NV_PFIFO_CACHE1_DMA_GET] = value; + break; + case NV_USER_REF: + d->pfifo.regs[NV_PFIFO_CACHE1_REF] = value; + break; + default: + assert(false); + break; } - break; - case NV_USER_DMA_GET: - control->dma_get = value; - break; - case NV_USER_REF: - control->ref = value; - break; - default: - DEBUG_WRITE32_UNHANDLED(USER); - break; + + // kick pfifo + qemu_cond_broadcast(&d->pfifo.pusher_cond); + qemu_cond_broadcast(&d->pfifo.puller_cond); + } else { + /* ramfc */ + assert(false); } } else { /* PIO Mode */ assert(false); } + qemu_mutex_unlock(&d->pfifo.pfifo_lock); + DEVICE_WRITE32_END(USER); } diff --git a/src/devices/video/nv2a.cpp b/src/devices/video/nv2a.cpp index 501ca33b9..56600d7ff 100644 --- a/src/devices/video/nv2a.cpp +++ b/src/devices/video/nv2a.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->video->nv2a.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -30,25 +21,26 @@ // * // * (c) 2002-2003 Aaron Robinson // * -// * nv2a.cpp is heavily based on code from XQEMU -// * Copyright(c) 2012 espes -// * Copyright(c) 2015 Jannik Vogel -// * https://github.com/espes/xqemu/blob/xbox/hw/xbox/nv2a.c +// * This file is heavily based on code from XQEMU +// * https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a/nv2a.c +// * Copyright (c) 2012 espes +// * Copyright (c) 2015 Jannik Vogel +// * Copyright (c) 2018 Matt Borgerson // * -// * (c) 2016-2018 Luke Usher -// * (c) 2017-2018 Patrick van Logchem +// * Contributions for Cxbx-Reloaded +// * Copyright (c) 2017-2018 Luke Usher +// * Copyright (c) 2018 Patrick van Logchem // * // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#define LOG_PREFIX "NV2A" +#define LOG_PREFIX CXBXR_MODULE::NV2A // prevent name collisions namespace xboxkrnl { -#include // For PKINTERRUPT, etc. +#include // For PKINTERRUPT, etc. }; #ifdef _MSC_VER // Check if MS Visual C compiler @@ -61,12 +53,11 @@ namespace xboxkrnl #include // For uint32_t #include // For __beginthreadex(), etc. -#include "CxbxKrnl\CxbxKrnl.h" // For XBOX_MEMORY_SIZE, DWORD, etc -#include "CxbxKrnl\Emu.h" -#include "CxbxKrnl\EmuFS.h" -#include "CxbxKrnl\EmuKrnl.h" -#include "CxbxKrnl\HLEIntercept.h" -#include "CxbxKrnl\EmuKrnlAvModes.h" +#include "core\kernel\init\CxbxKrnl.h" // For XBOX_MEMORY_SIZE, DWORD, etc +#include "core\kernel\support\Emu.h" +#include "core\kernel\exports\EmuKrnl.h" +#include "core\hle\Intercept.hpp" +#include "Logging.h" #include "vga.h" #include "nv2a.h" // For NV2AState @@ -97,8 +88,11 @@ struct _GError gchar *message; }; -#include "CxbxKrnl/gloffscreen/glextensions.h" // for glextensions_init +#include "common\util\gloffscreen\glextensions.h" // for glextensions_init +GLuint create_gl_shader(GLenum gl_shader_type, + const char *code, + const char *name); // forward to nv2a_shaders.cpp static void update_irq(NV2AState *d) { @@ -164,11 +158,11 @@ static void update_irq(NV2AState *d) #include "EmuNV2A_DEBUG.cpp" -#define DEBUG_READ32(DEV) DbgPrintf("X86 : Rd32 NV2A " #DEV "(0x%08X) = 0x%08X [Handled %s]\n", addr, result, DebugNV_##DEV##(addr)) -#define DEBUG_READ32_UNHANDLED(DEV) { DbgPrintf("X86 : Rd32 NV2A " #DEV "(0x%08X) = 0x%08X [Unhandled %s]\n", addr, result, DebugNV_##DEV##(addr)); return result; } +#define DEBUG_READ32(DEV) EmuLog(LOG_LEVEL::DEBUG, "Rd32 NV2A " #DEV "(0x%08X) = 0x%08X [Handled %s]", addr, result, DebugNV_##DEV(addr)) +#define DEBUG_READ32_UNHANDLED(DEV) { EmuLog(LOG_LEVEL::DEBUG, "Rd32 NV2A " #DEV "(0x%08X) = 0x%08X [Unhandled %s]", addr, result, DebugNV_##DEV(addr)); return result; } -#define DEBUG_WRITE32(DEV) DbgPrintf("X86 : Wr32 NV2A " #DEV "(0x%08X, 0x%08X) [Handled %s]\n", addr, value, DebugNV_##DEV##(addr)) -#define DEBUG_WRITE32_UNHANDLED(DEV) { DbgPrintf("X86 : Wr32 NV2A " #DEV "(0x%08X, 0x%08X) [Unhandled %s]\n", addr, value, DebugNV_##DEV##(addr)); return; } +#define DEBUG_WRITE32(DEV) EmuLog(LOG_LEVEL::DEBUG, "Wr32 NV2A " #DEV "(0x%08X, 0x%08X) [Handled %s]", addr, value, DebugNV_##DEV(addr)) +#define DEBUG_WRITE32_UNHANDLED(DEV) { EmuLog(LOG_LEVEL::DEBUG, "Wr32 NV2A " #DEV "(0x%08X, 0x%08X) [Unhandled %s]", addr, value, DebugNV_##DEV(addr)); return; } #define DEVICE_READ32(DEV) uint32_t EmuNV2A_##DEV##_Read32(NV2AState *d, xbaddr addr) #define DEVICE_READ32_SWITCH() uint32_t result = 0; switch (addr) @@ -330,72 +324,24 @@ const NV2ABlockInfo* EmuNV2A_Block(xbaddr addr) std::thread vblank_thread; extern std::chrono::time_point> GetNextVBlankTime(); -extern ULONG AvpCurrentMode; // Current AV Mode -extern ULONG g_AvDisplayModeFormat; // Current AV FrameBuffer Format - -void AvDisplayModeFormatToGL(ULONG displayModeFormat, GLenum* internalFormat, GLenum* format, GLenum* type) +void _check_gl_reset() { -#define D3DFMT_LIN_A1R5G5B5 0x00000010 -#define D3DFMT_LIN_X1R5G5B5 0x0000001C -#define D3DFMT_LIN_R5G6B5 0x00000011 -#define D3DFMT_LIN_A8R8G8B8 0x00000012 -#define D3DFMT_LIN_X8R8G8B8 0x0000001E - - switch (displayModeFormat) { - case D3DFMT_LIN_A1R5G5B5: - *internalFormat = GL_RGB5_A1; - *format = GL_BGRA; - *type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case D3DFMT_LIN_X1R5G5B5: - *internalFormat = GL_RGB5; - *format = GL_BGRA; - *type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case D3DFMT_LIN_R5G6B5: - *internalFormat = GL_RGB; - *format = GL_RGB; - *type = GL_UNSIGNED_SHORT_5_6_5; - break; - case D3DFMT_LIN_X8R8G8B8: - *internalFormat = GL_RGB8; - *format = GL_BGRA; - *type = GL_UNSIGNED_INT_8_8_8_8_REV; - break; - case D3DFMT_LIN_A8R8G8B8: - *internalFormat = GL_RGBA8; - *format = GL_BGRA; - *type = GL_UNSIGNED_INT_8_8_8_8_REV; - break; - default: - *internalFormat = GL_RGBA; - *format = GL_RGBA; - *type = GL_UNSIGNED_INT_8_8_8_8_REV; - } -} - -void AvGetFormatSize(ULONG mode, int* width, int* height) -{ - // Iterate through the display mode table until we find a matching mode - for (unsigned int i = 0; i < g_DisplayModeCount; i++) { - if (g_DisplayModes[i].DisplayMode == mode) { - *width = g_DisplayModes[i].Width; - *height = g_DisplayModes[i].Height; + while (true) { + GLenum err = glGetError(); + if (err == GL_NO_ERROR) + return; + if (err == 0) return; - } } - - // if we couldn't find a valid mode, fallback to 640x480 - *width = 640; - *height = 480; } void _check_gl_error(const char *file, int line) { - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { + while (true) { + GLenum err = glGetError(); char *error; switch (err) { + case GL_NO_ERROR: return; case GL_INVALID_ENUM: error = "GL_INVALID_ENUM"; break; case GL_INVALID_VALUE: error = "GL_INVALID_VALUE"; break; case GL_INVALID_OPERATION: error = "GL_INVALID_OPERATION"; break; @@ -405,7 +351,7 @@ void _check_gl_error(const char *file, int line) case GL_INVALID_FRAMEBUFFER_OPERATION: error = "GL_INVALID_FRAMEBUFFER_OPERATION"; break; //case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: error = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT"; break; case GL_CONTEXT_LOST: error = "GL_CONTEXT_LOST"; break; - default: error = nullptr; + default: error = "(unknown)"; break; } printf("OpenGL error 0x%.8X %s\n", err, error); @@ -413,9 +359,28 @@ void _check_gl_error(const char *file, int line) } } +#ifdef DEBUG_NV2A_GL +#define GL_RESET() _check_gl_reset() #define GL_CHECK() _check_gl_error(__FILE__,__LINE__) +#else +#define GL_RESET() +#define GL_CHECK() +#endif -static GLint yuyv_tex_loc = -1; +enum { + SAMP_TEXCOORD = 0, +}; + +enum { + FRAG_COLOR = 0, +}; + +enum { + ATTR_POSITION = 0, + ATTR_TEXCOORD = 4, +}; + +static GLint m_overlay_gl_uniform_location_texture = -1; GLuint Get_YUV_to_RGB_shader_program() { @@ -426,138 +391,359 @@ GLuint Get_YUV_to_RGB_shader_program() // to https://github.com/kolyvan/kxmovie/blob/master/kxmovie/KxMovieGLView.m // and https://www.opengl.org/discussion_boards/archive/index.php/t-169186.html // and https://gist.github.com/roxlu/9329339 + // https://github.com/g-truc/ogl-samples/blob/master/data/gl-330/texture-2d.vert static const char *OPENGL_SHADER_YUV[2] = { /* vertex shader */ - "#version 330 core\n" - "layout(location = 0) in vec3 vertexPosition_modelspace;\n" - "layout(location = 1) in vec2 vertexUV;\n" - "out vec2 v_tex_coord;\n" - "void main() {\n" - " gl_Position = vec4(vertexPosition_modelspace,1);\n" - " v_tex_coord = vertexUV;\n" - "}\n", - /* fragment shader */ - "#version 330 core\n" - "in vec2 v_tex_coord;\n" - "uniform sampler2D yuyv_tex;\n" - "out vec4 out_rgba;\n" - "// YUV offset \n" - "const vec3 offset = vec3(-0.0627451017, -0.501960814, -0.501960814);\n" - "// RGB coefficients \n" - "const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n" - "const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n" - "const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n" - "void main(void)\n" - "{\n" - " // Fetch 4:2:2 YUYV macropixel \n" - " vec4 yuyv = texture2D(yuyv_tex, v_tex_coord);\n" - " // Now r-g-b-a is actually y1-u-y2-v \n" - " float u = yuyv.g;\n" - " float v = yuyv.a;\n" - " vec3 yuv;\n" - " // Convert texture coordinate into texture x position \n" - " ivec2 texture_size = textureSize(yuyv_tex, 0);\n" - " float texture_x = v_tex_coord.x * texture_size.x;\n" - " // Depending on fragment x position choose y1-u-v or y2-u-v \n" - " if (mod(texture_x, 1.0) >= 0.5) { // left half \n" - " float y1 = yuyv.r;\n" - " yuv = vec3(y1, u, v);\n" - " } else { // right half \n" - " float y2 = yuyv.b;\n" - " yuv = vec3(y2, u, v);\n" - " }\n" - " // Do the color transform \n" - " yuv += offset;\n" - " out_rgba.r = dot(yuv, Rcoeff);\n" - " out_rgba.g = dot(yuv, Gcoeff);\n" - " out_rgba.b = dot(yuv, Bcoeff);\n" - " out_rgba.a = 1.0;\n" - "}\n" + "#version 330 core \n" + "#define ATTR_POSITION 0 \n" + "#define ATTR_TEXCOORD 4 \n" + " \n" + "precision highp float; \n" + "precision highp int; \n" + "layout(std140, column_major) uniform; \n" + " \n" + "layout(location = ATTR_POSITION) in vec2 Position; \n" + "layout(location = ATTR_TEXCOORD) in vec2 Texcoord; \n" + " \n" + "out block \n" + "{ \n" + " vec2 Texcoord; \n" + "} Out; \n" + " \n" + "void main() \n" + "{ \n" + " Out.Texcoord = Texcoord; \n" + " gl_Position = vec4(Position, 0.0, 1.0); \n" + "} \n" + , /* fragment shader */ + // https://github.com/g-truc/ogl-samples/blob/master/data/gl-330/texture-2d.frag + "#version 330 core \n" + "#define FRAG_COLOR 0 \n" + " \n" + "precision highp float; \n" + "precision highp int; \n" + "layout(std140, column_major) uniform; \n" + " \n" + "uniform sampler2D tex_yuyv; \n" + " \n" + "in block \n" + "{ \n" + " vec2 Texcoord; \n" + "} In; \n" + " \n" + "layout(location = FRAG_COLOR, index = 0) out vec4 Color; \n" + " \n" + "// YUV offset \n" + "const vec3 offset = vec3(-0.0627451017, -0.501960814, -0.501960814); \n" + "// RGB coefficients \n" + "const vec3 Rcoeff = vec3(1.164, 0.000, 1.596); \n" + "const vec3 Gcoeff = vec3(1.164, -0.391, -0.813); \n" + "const vec3 Bcoeff = vec3(1.164, 2.018, 0.000); \n" + "void main(void) \n" + "{ \n" + " // Fetch 4:2:2 YUYV macropixel \n" + " vec4 yuyv = texture2D(tex_yuyv, In.Texcoord); \n" + " // Now r-g-b-a is actually y1-u-y2-v \n" + " float u = yuyv.g; \n" + " float v = yuyv.a; \n" + " vec3 yuv; \n" + " // Convert texture coordinate into texture x position \n" + " ivec2 texture_size = textureSize(tex_yuyv, 0); \n" + " float texture_x = In.Texcoord.x * texture_size.x; \n" + " // Depending on fragment x position choose y1-u-v or y2-u-v \n" + " if (mod(texture_x, 1.0) < 0.5) { // left half \n" + " float y1 = yuyv.r; \n" + " yuv = vec3(y1, u, v); \n" + " } else { // right half \n" + " float y2 = yuyv.b; \n" + " yuv = vec3(y2, u, v); \n" + " } \n" + " // Do the color transform \n" + " yuv += offset; \n" + " Color.r = dot(yuv, Rcoeff); \n" + " Color.g = dot(yuv, Gcoeff); \n" + " Color.b = dot(yuv, Bcoeff); \n" + " Color.a = 1.0; \n" + "} \n" }; // Bind shader - static GLuint shader_program_yuv_to_rgb = -1; - if (shader_program_yuv_to_rgb == -1) { - shader_program_yuv_to_rgb = glCreateProgram(); // glCreateProgramObjectARB() + static GLuint shader_program_name_yuv_to_rgb = -1; + if (shader_program_name_yuv_to_rgb == -1) { + // Compile vertex shader + GLuint vertex_shader_name = create_gl_shader(GL_VERTEX_SHADER, OPENGL_SHADER_YUV[0], "YUV>RGB Vertex shader"); + GL_CHECK(); + // Compile fragment shader + GLuint fragment_shader_name = create_gl_shader(GL_FRAGMENT_SHADER, OPENGL_SHADER_YUV[1], "YUV>RGB Fragment shader"); GL_CHECK(); - GLuint vertex_shader = create_gl_shader(GL_VERTEX_SHADER, OPENGL_SHADER_YUV[0], "YUV>RGB Vertex shader"); + shader_program_name_yuv_to_rgb = glCreateProgram(); GL_CHECK(); - GLuint fragment_shader = create_gl_shader(GL_FRAGMENT_SHADER, OPENGL_SHADER_YUV[1], "YUV>RGB Fragment shader"); + // Link vertex and fragment shaders + glAttachShader(shader_program_name_yuv_to_rgb, vertex_shader_name); GL_CHECK(); - glAttachShader(shader_program_yuv_to_rgb, vertex_shader); // glAttachObjectARB + glAttachShader(shader_program_name_yuv_to_rgb, fragment_shader_name); GL_CHECK(); - glAttachShader(shader_program_yuv_to_rgb, fragment_shader); // glAttachObjectARB + glBindAttribLocation(shader_program_name_yuv_to_rgb, ATTR_POSITION, "Position"); GL_CHECK(); - - glLinkProgram(shader_program_yuv_to_rgb); + glBindAttribLocation(shader_program_name_yuv_to_rgb, ATTR_TEXCOORD, "Texcoord"); + GL_CHECK(); + glBindFragDataLocation(shader_program_name_yuv_to_rgb, FRAG_COLOR, "Color"); + GL_CHECK(); + glLinkProgram(shader_program_name_yuv_to_rgb); GL_CHECK(); /* Check it linked */ GLint linked = 0; - glGetProgramiv(shader_program_yuv_to_rgb, GL_LINK_STATUS, &linked); + glGetProgramiv(shader_program_name_yuv_to_rgb, GL_LINK_STATUS, &linked); GL_CHECK(); if (!linked) { GLchar log[2048]; - glGetProgramInfoLog(shader_program_yuv_to_rgb, 2048, NULL, log); + glGetProgramInfoLog(shader_program_name_yuv_to_rgb, 2048, NULL, log); fprintf(stderr, "nv2a: shader linking failed: %s\n", log); abort(); } - yuyv_tex_loc = glGetUniformLocation(shader_program_yuv_to_rgb, "yuyv_tex"); + m_overlay_gl_uniform_location_texture = glGetUniformLocation(shader_program_name_yuv_to_rgb, "tex_yuyv"); GL_CHECK(); - assert(yuyv_tex_loc >= 0); + assert(m_overlay_gl_uniform_location_texture >= 0); } - return shader_program_yuv_to_rgb; + return shader_program_name_yuv_to_rgb; } -extern void UpdateFPSCounter(); -void NV2ADevice::UpdateHostDisplay(NV2AState *d) +GLuint m_framebuffer_gl_uniform_location_texture = -1; + +GLuint GetFramebufferShaderProgram() { - if (!d->pgraph.opengl_enabled) { - return; - } + static const char *gl_framebuffer_shader_src[2] = { + /* vertex shader */ + "#version 330 core \n" + "#define ATTR_POSITION 0 \n" + "#define ATTR_TEXCOORD 4 \n" + " \n" + "precision highp float; \n" + "precision highp int; \n" + "layout(std140, column_major) uniform; \n" + " \n" + "layout(location = ATTR_POSITION) in vec2 Position; \n" + "layout(location = ATTR_TEXCOORD) in vec2 Texcoord; \n" + " \n" + "out block \n" + "{ \n" + " vec2 Texcoord; \n" + "} Out; \n" + " \n" + "void main(void) \n" + "{ \n" + " Out.Texcoord = Texcoord; \n" + " gl_Position = vec4(Position, 0.0, 1.0); \n" + "} \n" + , /* fragment shader */ + "#version 330 core \n" + "#define FRAG_COLOR 0 \n" + " \n" + "precision highp float; \n" + "precision highp int; \n" + "layout(std140, column_major) uniform; \n" + " \n" + "uniform sampler2D tex; \n" + " \n" + "in block \n" + "{ \n" + " vec2 Texcoord; \n" + "} In; \n" + " \n" + "layout(location = FRAG_COLOR, index = 0) out vec4 Color; \n" + " \n" + "void main() \n" + "{ \n" + " Color = texture2D(tex, In.Texcoord); \n" + "} \n" + }; - lockGL(&d->pgraph); + // Bind shader + static GLuint m_framebuffer_gl_shader_program = -1; + if (m_framebuffer_gl_shader_program == -1) { + // Compile vertex shader + GLuint vertex_shader = create_gl_shader(GL_VERTEX_SHADER, gl_framebuffer_shader_src[0], "Framebuffer vertex shader"); + GL_CHECK(); + // Compile fragment shader + GLuint fragment_shader = create_gl_shader(GL_FRAGMENT_SHADER, gl_framebuffer_shader_src[1], "Framebuffer fragment shader"); + GL_CHECK(); - NV2A_GL_DGROUP_BEGIN("VGA Frame"); + m_framebuffer_gl_shader_program = glCreateProgram(); + GL_CHECK(); + // Link vertex and fragment shaders + glAttachShader(m_framebuffer_gl_shader_program, vertex_shader); + GL_CHECK(); + glAttachShader(m_framebuffer_gl_shader_program, fragment_shader); + GL_CHECK(); + glBindAttribLocation(m_framebuffer_gl_shader_program, ATTR_POSITION, "Position"); + GL_CHECK(); + glBindAttribLocation(m_framebuffer_gl_shader_program, ATTR_TEXCOORD, "Texcoord"); + GL_CHECK(); + glBindFragDataLocation(m_framebuffer_gl_shader_program, FRAG_COLOR, "Color"); + GL_CHECK(); + glLinkProgram(m_framebuffer_gl_shader_program); + GL_CHECK(); - static ULONG PreviousAvDisplayModeFormat = 0; - static GLenum gl_frame_internal_format = GL_RGBA; - static GLenum gl_frame_format = GL_RGBA; - static GLenum gl_frame_type = GL_UNSIGNED_INT_8_8_8_8; - static GLsizei frame_width = 640; - static GLsizei frame_height = 480; - static GLuint frame_texture = -1; - - // Convert AV Format to OpenGl format details & destroy the texture if format changed.. - // This is required for titles that use a non ARGB framebuffer, such was Beats of Rage - if (PreviousAvDisplayModeFormat != g_AvDisplayModeFormat) { - AvDisplayModeFormatToGL(g_AvDisplayModeFormat, &gl_frame_internal_format, &gl_frame_format, &gl_frame_type); - AvGetFormatSize(AvpCurrentMode, &frame_width, &frame_height); - if (frame_texture != -1) { - glDeleteTextures(1, &frame_texture); - frame_texture = -1; + /* Check it linked */ + GLint linked = 0; + glGetProgramiv(m_framebuffer_gl_shader_program, GL_LINK_STATUS, &linked); + GL_CHECK(); + if (!linked) { + GLchar log[2048]; + glGetProgramInfoLog(m_framebuffer_gl_shader_program, 2048, NULL, log); + fprintf(stderr, "nv2a: shader linking failed: %s\n", log); + abort(); } - PreviousAvDisplayModeFormat = g_AvDisplayModeFormat; + m_framebuffer_gl_uniform_location_texture = glGetUniformLocation(m_framebuffer_gl_shader_program, "tex"); + GL_CHECK(); + assert(m_framebuffer_gl_uniform_location_texture >= 0); } - glGetError(); // reset GL_CHECK + return m_framebuffer_gl_shader_program; +} - // If we need to create a new texture, do so, otherwise, update the existing - hwaddr frame_pixels = /*CONTIGUOUS_MEMORY_BASE=*/0x80000000 | d->pcrtc.start; // NV_PCRTC_START - if (frame_texture == -1) { - glGenTextures(1, &frame_texture); - glBindTexture(GL_TEXTURE_2D, frame_texture); - glTexImage2D(GL_TEXTURE_2D, 0, gl_frame_internal_format, frame_width, frame_height, 0, gl_frame_format, gl_frame_type, (void*)frame_pixels); - } else { - glBindTexture(GL_TEXTURE_2D, frame_texture); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, frame_width, frame_height, gl_frame_format, gl_frame_type, (void*)frame_pixels); +static int display_mode_format = 0; +static int frame_pixel_bytes = 1; + +static GLenum frame_gl_internal_format = GL_RGBA8; +static GLenum frame_gl_format = GL_BGRA; +static GLenum frame_gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; +static GLuint frame_gl_texture = 0; + +static GLsizei frame_width = 640; +static GLsizei frame_height = 480; + +void cxbx_gl_update_displaymode(NV2AState *d) { + static GLenum old_frame_gl_internal_format = GL_RGBA8; + static GLenum old_frame_gl_format = GL_BGRA; + static GLenum old_frame_gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; + static GLsizei old_frame_width = 640; + static GLsizei old_frame_height = 480; + + // Derive display mode and bytes per pixel from actual hardware register contents: + // This is required for titles that use a non ARGB framebuffer, such as Beats of Rage + bool alt_mode = d->pramdac.regs[NV_PRAMDAC_GENERAL_CONTROL & (NV_PRAMDAC_SIZE - 1)] + & NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; + switch (d->prmcio.cr[NV_CIO_CRE_PIXEL_INDEX] & 0x03) { + case 1: // 8bpp + assert(false); // TODO : Verify this + frame_pixel_bytes = 1; + break; + case 2: // 15 or 16 bpp + if (alt_mode) { + // Test case : Arctic Thunder + display_mode_format = NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G6B5; + } + else { + display_mode_format = NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X1R5G5B5; + } + + frame_pixel_bytes = 2; + break; + case 0: // VGA; Fall through + case 3: // 24 or 32 bpp + if (alt_mode) { + // Test-case : WWE RAW2 + display_mode_format = NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X8R8G8B8; + } + else { + // Test-case : XDK sample DolphinClassic (after VGA fall-through) + display_mode_format = NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8R8G8B8; + } + + frame_pixel_bytes = 4; + break; } - glBindTexture(GL_TEXTURE_2D, 0); + // Convert displau format to OpenGl format details + frame_gl_internal_format = kelvin_color_format_map[display_mode_format].gl_internal_format; + frame_gl_format = kelvin_color_format_map[display_mode_format].gl_format; + frame_gl_type = kelvin_color_format_map[display_mode_format].gl_type; + + frame_width = NV2ADevice::GetFrameWidth(d); + frame_height = NV2ADevice::GetFrameHeight(d); + + // Detect changes in framebuffer dimensions + if (old_frame_gl_internal_format != frame_gl_internal_format + || old_frame_gl_format != frame_gl_format + || old_frame_gl_type != frame_gl_type + || old_frame_width != frame_width + || old_frame_height != frame_height) { + old_frame_gl_internal_format = frame_gl_internal_format; + old_frame_gl_format = frame_gl_format; + old_frame_gl_type = frame_gl_type; + old_frame_width = frame_width; + old_frame_height = frame_height; + if (frame_gl_texture) { + // Destroy the texture if format changed + // Test case : XDK sample DolphinClassic + glDeleteTextures(1, &frame_gl_texture); + frame_gl_texture = 0; + } + } +} + +void cxbx_gl_render_framebuffer(NV2AState *d) +{ + // Update the frame texture + uint8_t* frame_pixels = (uint8_t*)(/*CONTIGUOUS_MEMORY_BASE=*/0x80000000 | d->pcrtc.start); // NV_PCRTC_START + uint8_t* palette_data = xbnullptr; // Note : Framebuffer formats aren't paletized + + TextureShape s; + s.cubemap = false; // Note : Unused in upload_gl_texture GL_TEXTURE_2D path + s.dimensionality = 2; // Note : Unused in upload_gl_texture GL_TEXTURE_2D path + s.color_format = display_mode_format; + s.levels = 1; + s.width = frame_width; + s.height = frame_height; + s.depth = 0; // Note : Unused in upload_gl_texture GL_TEXTURE_2D path + s.min_mipmap_level = 0; + s.max_mipmap_level = 0; + s.pitch = 0; // Note : Unused in upload_gl_texture GL_TEXTURE_2D path + + // If we need to create a (new) texture, do so + if (!frame_gl_texture) { + glGenTextures(1, &frame_gl_texture); + GL_CHECK(); + glBindTexture(GL_TEXTURE_2D, frame_gl_texture); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GL_CHECK(); + glTexImage2D(GL_TEXTURE_2D, /*level=*/0, frame_gl_internal_format, frame_width, frame_height, /*border=*/0, frame_gl_format, frame_gl_type, NULL); + GL_CHECK(); + } + else { + glBindTexture(GL_TEXTURE_2D, frame_gl_texture); + GL_CHECK(); + } + + int rf = upload_gl_texture(GL_TEXTURE_2D, + s, + frame_pixels, + palette_data); + GL_CHECK(); + + // Note : It'd be less code to use generate_texture(), except that puts linear formats + // into GL_TEXTURE_RECTANGLE, while we need GL_TEXTURE_2D here. So instead, handle the + // difference here by separately setting the resulting format's RGBA swizzle: + ColorFormatInfo cfi = kelvin_color_format_map[rf]; + if (cfi.gl_swizzle_mask) { + glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, cfi.gl_swizzle_mask); + } + +#define BLIT_FRAMEBUFFER +#ifdef BLIT_FRAMEBUFFER // If we need to create an OpenGL framebuffer, do so static GLuint framebuffer = -1; if (framebuffer == -1) { @@ -565,108 +751,205 @@ void NV2ADevice::UpdateHostDisplay(NV2AState *d) GL_CHECK(); } - // Note : The following is modelled partially after pgraph_update_surface() - // TODO : pgraph_update_surface() also unswizzles - should we too? - // Target the actual framebuffer glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); -#ifdef DEBUG - // If the screen turns purple, glBlitFramebuffer below failed +#endif + +#ifdef DEBUG_NV2A_GL + // If the screen turns purple, glDrawArrays/glBlitFramebuffer below failed glClearColor(1.0f, 0.0f, 1.0f, 1.0f); GL_CHECK(); glClear(GL_COLOR_BUFFER_BIT); GL_CHECK(); #endif +#ifdef BLIT_FRAMEBUFFER // Copy frame texture to an internal frame buffer glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer); - glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, frame_texture, 0); + glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, frame_gl_texture, /*level=*/0); // Blit the active internal 'read' frame buffer to the actual 'draw' framebuffer static const GLenum filter = GL_NEAREST; - // TODO: Use window size/actual framebuffer size rather than hard coding 640x480 // Note : dstY0 and dstY1 are swapped so the screen doesn't appear upside down - glBlitFramebuffer(0, 0, frame_width, frame_height, 0, 480, 640, 0, GL_COLOR_BUFFER_BIT, filter); + glBlitFramebuffer(0, 0, frame_width, frame_height, 0, frame_height, frame_width, 0, GL_COLOR_BUFFER_BIT, filter); // Detach internal framebuffer glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); +#else + // Draw frame texture to host frame buffer + glUseProgram(GetFramebufferShaderProgram()); + GL_CHECK(); + glUniform1i(m_framebuffer_gl_uniform_location_texture, SAMP_TEXCOORD); + GL_CHECK(); - // NV2A supports 2 video overlays - for (int v = 0; v < 2; v++) { - uint32_t video_buffer_use = (v == 0) ? NV_PVIDEO_BUFFER_0_USE : NV_PVIDEO_BUFFER_1_USE; - if (!(d->pvideo.regs[NV_PVIDEO_BUFFER] & video_buffer_use)) { - continue; - } + static const GLfloat vertices[] = { + // x y s t + -1.0f, -1.0f, 0.0f, 1.0f, // BL + 1.0f, -1.0f, 1.0f, 1.0f, // BR + 1.0f, 1.0f, 1.0f, 0.0f, // TR + -1.0f, 1.0f, 0.0f, 0.0f, // TL + }; - // Get overlay measures (from xqemu nv2a_overlay_draw_line) : - uint32_t overlay_offset_high_26 = d->pvideo.regs[NV_PVIDEO_OFFSET(v)]; - uint32_t overlay_offset_lower_6 = d->pvideo.regs[NV_PVIDEO_POINT_IN(v)] >> 3; - uint32_t overlay_size_in = d->pvideo.regs[NV_PVIDEO_SIZE_IN(v)]; - uint32_t overlay_color_key = d->pvideo.regs[NV_PVIDEO_COLOR_KEY(v)]; - uint32_t overlay_format = d->pvideo.regs[NV_PVIDEO_FORMAT(v)]; + // Populate vertex buffer + static GLuint m_framebuffer_gl_vertex_buffer_object = -1; + if (m_framebuffer_gl_vertex_buffer_object == -1) { + glGenBuffers(1, &m_framebuffer_gl_vertex_buffer_object); + GL_CHECK(); + } + + glBindBuffer(GL_ARRAY_BUFFER, m_framebuffer_gl_vertex_buffer_object); + GL_CHECK(); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_DYNAMIC_DRAW); + GL_CHECK(); + // Bind vertex position attribute + glVertexAttribPointer( + /*index=*/ATTR_POSITION, + /*size=vec*/2, + /*type=*/GL_FLOAT, + /*normalized?=*/GL_FALSE, + /*stride=*/4 * sizeof(GLfloat), + /*array buffer offset=*/(void*)0 + ); + GL_CHECK(); + glEnableVertexAttribArray(ATTR_POSITION); + GL_CHECK(); + // Bind vertex texture coordinate attribute + glVertexAttribPointer( + /*index=*/ATTR_TEXCOORD, + /*size=vec*/2, + /*type=*/GL_FLOAT, + /*normalized?=*/GL_FALSE, + /*stride=*/4 * sizeof(GLfloat), + /*array buffer offset=*/(void*)(2 * sizeof(GLfloat)) + ); + GL_CHECK(); + glEnableVertexAttribArray(ATTR_TEXCOORD); + GL_CHECK(); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + GL_CHECK(); +#endif +} + +void pvideo_init(NV2AState *d) +{ + //qemu_cond_init(&d->pvideo.interrupt_cond); +} + +void pvideo_destroy(NV2AState *d) +{ + if (d->pvideo.overlays[0].gl_texture) { + glDeleteTextures(1, &d->pvideo.overlays[0].gl_texture); + d->pvideo.overlays[0].gl_texture = 0; + } + + if (d->pvideo.overlays[1].gl_texture) { + glDeleteTextures(1, &d->pvideo.overlays[1].gl_texture); + d->pvideo.overlays[1].gl_texture = 0; + } + + //qemu_cond_destroy(&d->pvideo.interrupt_cond); +} + +void cxbx_gl_parse_overlay(NV2AState *d, int v) +{ + OverlayState &overlay = d->pvideo.overlays[v]; + + uint32_t video_buffer_use = (v == 0) ? NV_PVIDEO_BUFFER_0_USE : NV_PVIDEO_BUFFER_1_USE; + overlay.video_buffer_use = d->pvideo.regs[NV_PVIDEO_BUFFER] & video_buffer_use; + + // Get overlay measures (from xqemu nv2a_overlay_draw_line) : + uint32_t overlay_offset_high_26 = d->pvideo.regs[NV_PVIDEO_OFFSET(v)]; + uint32_t overlay_offset_lower_6 = d->pvideo.regs[NV_PVIDEO_POINT_IN(v)] >> 3; + uint32_t overlay_size_in = d->pvideo.regs[NV_PVIDEO_SIZE_IN(v)]; + uint32_t overlay_color_key = d->pvideo.regs[NV_PVIDEO_COLOR_KEY(v)]; + uint32_t overlay_format = d->pvideo.regs[NV_PVIDEO_FORMAT(v)]; #ifdef DEBUG - // Check a few assumptions - hwaddr overlay_base = d->pvideo.regs[NV_PVIDEO_BASE(v)]; - hwaddr overlay_limit = d->pvideo.regs[NV_PVIDEO_LIMIT(v)]; - assert(overlay_base == 0); - assert(overlay_limit == (128 * ONE_MB) - 1); // = CONTIGUOUS_MEMORY_CHIHIRO_SIZE - 1 - assert(GET_MASK(overlay_format, NV_PVIDEO_FORMAT_COLOR) == NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8); + // Check a few assumptions + overlay.base = d->pvideo.regs[NV_PVIDEO_BASE(v)]; + overlay.limit = d->pvideo.regs[NV_PVIDEO_LIMIT(v)]; + assert(overlay.base == 0); + assert(overlay.limit == (128 * ONE_MB) - 1); // = CONTIGUOUS_MEMORY_CHIHIRO_SIZE - 1 + assert(GET_MASK(overlay_format, NV_PVIDEO_FORMAT_COLOR) == NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8); + #endif - // Derive actual attributes - int overlay_pitch = overlay_format & NV_PVIDEO_FORMAT_PITCH; - bool overlay_is_transparent = GET_MASK(overlay_format, NV_PVIDEO_FORMAT_DISPLAY); - hwaddr overlay_offset = overlay_offset_high_26 | overlay_offset_lower_6; - uint32_t overlay_size_in_height_width = overlay_size_in - (overlay_offset_lower_6 >> 1); - uint32_t overlay_in_height = overlay_size_in_height_width >> 16; - uint32_t overlay_in_width = overlay_size_in_height_width & 0xFFFF; + // Derive actual attributes + overlay.pitch = overlay_format & NV_PVIDEO_FORMAT_PITCH; + overlay.is_transparent = overlay_format & NV_PVIDEO_FORMAT_DISPLAY; + overlay.offset = overlay_offset_high_26 | overlay_offset_lower_6; - int overlay_out_x = GET_MASK(d->pvideo.regs[NV_PVIDEO_POINT_OUT(v)], NV_PVIDEO_POINT_OUT_X); - int overlay_out_y = GET_MASK(d->pvideo.regs[NV_PVIDEO_POINT_OUT(v)], NV_PVIDEO_POINT_OUT_Y); - int overlay_out_width = GET_MASK(d->pvideo.regs[NV_PVIDEO_SIZE_OUT(v)], NV_PVIDEO_SIZE_OUT_WIDTH); - int overlay_out_height = GET_MASK(d->pvideo.regs[NV_PVIDEO_SIZE_OUT(v)], NV_PVIDEO_SIZE_OUT_HEIGHT); + uint32_t overlay_size_in_height_width = overlay_size_in - (overlay_offset_lower_6 >> 1); + overlay.in_height = overlay_size_in_height_width >> 16; + overlay.in_width = overlay_size_in_height_width & 0xFFFF; - // If we need to create a new overlay texture, do so, otherwise, update the existing - static GLuint overlay_texture = -1; + overlay.out_x = GET_MASK(d->pvideo.regs[NV_PVIDEO_POINT_OUT(v)], NV_PVIDEO_POINT_OUT_X); + overlay.out_y = GET_MASK(d->pvideo.regs[NV_PVIDEO_POINT_OUT(v)], NV_PVIDEO_POINT_OUT_Y); + overlay.out_width = GET_MASK(d->pvideo.regs[NV_PVIDEO_SIZE_OUT(v)], NV_PVIDEO_SIZE_OUT_WIDTH); + overlay.out_height = GET_MASK(d->pvideo.regs[NV_PVIDEO_SIZE_OUT(v)], NV_PVIDEO_SIZE_OUT_HEIGHT); - // Detect changes in overlay dimensions - static int static_overlay_in_width = 0; - static int static_overlay_in_height = 0; - static int static_overlay_pitch = 0; - if (static_overlay_in_width != overlay_in_width - || static_overlay_in_height != overlay_in_height - || static_overlay_pitch != overlay_pitch) { - static_overlay_in_width = overlay_in_width; - static_overlay_in_height = overlay_in_height; - static_overlay_pitch = overlay_pitch; - if (overlay_texture != -1) { - glDeleteTextures(1, &overlay_texture); - overlay_texture = -1; - } + // Detect changes in overlay dimensions + if (overlay.old_in_width != overlay.in_width + || overlay.old_in_height != overlay.in_height + || overlay.old_pitch != overlay.pitch) { + overlay.old_in_width = overlay.in_width; + overlay.old_in_height = overlay.in_height; + overlay.old_pitch = overlay.pitch; + if (overlay.gl_texture) { + glDeleteTextures(1, &overlay.gl_texture); + overlay.gl_texture = 0; + } + } + + overlay.covers_framebuffer = overlay.video_buffer_use + && (!overlay.is_transparent) + && (overlay.out_x == 0) + && (overlay.out_y == 0) + && (overlay.out_width == frame_width) + && (overlay.out_height == frame_height); +} + +void cxbx_gl_render_overlays(NV2AState *d) +{ + static const GLenum overlay_gl_internal_format = GL_RGBA8; + static const GLenum overlay_gl_format = GL_BGRA; + static const GLenum overlay_gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; + + for (int v = 0; v < 2; v++) { + OverlayState &overlay = d->pvideo.overlays[v]; + if (!overlay.video_buffer_use) { + continue; } // TODO : Speed this up using 2 PixelBufferObjects (and use asynchronous DMA transfer)? - // Render using texture #0 - glActiveTexture(GL_TEXTURE0); - - static const GLenum gl_overlay_internal_format = GL_RGBA8; - static const GLenum gl_overlay_format = GL_BGRA; - static const GLenum gl_overlay_type = GL_UNSIGNED_BYTE; - - hwaddr overlay_pixels = /*CONTIGUOUS_MEMORY_BASE=*/0x80000000 | overlay_offset; - if (overlay_texture == -1) { - glGenTextures(1, &overlay_texture); - - glBindTexture(GL_TEXTURE_2D, overlay_texture); - glTexImage2D(GL_TEXTURE_2D, 0, gl_overlay_internal_format, overlay_pitch / 4, overlay_in_height, 0, gl_overlay_format, gl_overlay_type, (void*)overlay_pixels); + // If we need to create a (new) overlay texture, do so + if (!overlay.gl_texture) { + glGenTextures(1, &overlay.gl_texture); + GL_CHECK(); + glBindTexture(GL_TEXTURE_2D, overlay.gl_texture); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + GL_CHECK(); + // Don't average YUYV samples when resizing + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + GL_CHECK(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + GL_CHECK(); + // Note : YUYV formats are sampled using BGRA in OPENGL_SHADER_YUV[1] fragment shader + glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, gl_swizzle_mask_BGRA); + GL_CHECK(); + glTexImage2D(GL_TEXTURE_2D, /*level=*/0, overlay_gl_internal_format, overlay.pitch / 4, overlay.in_height, /*border=*/0, overlay_gl_format, overlay_gl_type, NULL); + GL_CHECK(); } else { - glBindTexture(GL_TEXTURE_2D, overlay_texture); // update the YUV video texturing unit - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, overlay_pitch / 4, overlay_in_height, gl_overlay_format, gl_overlay_type, (void*)overlay_pixels); + glBindTexture(GL_TEXTURE_2D, overlay.gl_texture); + GL_CHECK(); } - // Don't average YUYV samples when resizing - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // Update the YUV video texture + hwaddr overlay_pixels = /*CONTIGUOUS_MEMORY_BASE=*/0x80000000 | overlay.offset; + glTexSubImage2D(GL_TEXTURE_2D, /*level=*/0, /*xoffset=*/0, /*yoffset=*/0, overlay.pitch / 4, overlay.in_height, overlay_gl_format, overlay_gl_type, (void*)overlay_pixels); + GL_CHECK(); // Note : we cannot convert overlay_offset into actual top/left coordinate, so assume (0,0) static const int overlay_in_s = 0; @@ -675,26 +958,23 @@ void NV2ADevice::UpdateHostDisplay(NV2AState *d) // Determine source and destination coordinates, with that draw the overlay over the framebuffer GLint srcX0 = overlay_in_s; GLint srcY0 = overlay_in_t; - GLint srcX1 = overlay_in_width; - GLint srcY1 = overlay_in_height; - GLint dstX0 = overlay_out_x; - GLint dstY0 = overlay_out_y; - GLint dstX1 = overlay_out_width; - GLint dstY1 = overlay_out_height; + GLint srcX1 = overlay.in_width; + GLint srcY1 = overlay.in_height; + GLint dstX0 = overlay.out_x; + GLint dstY0 = overlay.out_y; + GLint dstX1 = overlay.out_width; + GLint dstY1 = overlay.out_height; // Detect some special cases, for later finetuning - if (overlay_in_s != 0 || overlay_in_t != 0 || overlay_out_x != 0 || overlay_out_y != 0 || overlay_out_width != 640 || overlay_out_height != 480) { + if (overlay_in_s != 0 || overlay_in_t != 0 || !overlay.covers_framebuffer) { LOG_TEST_CASE("Non-standard overlay dimensions"); } - // Flip Y to prevent upside down rendering - GLint tmp = dstY0; dstY0 = dstY1; dstY1 = tmp; - // Convert UV coordinates to [0.0, 1.0] - GLfloat srcX0f = (GLfloat)srcX0 / overlay_in_width; - GLfloat srcX1f = (GLfloat)srcX1 / overlay_in_width; - GLfloat srcY0f = (GLfloat)srcY0 / overlay_in_height; - GLfloat srcY1f = (GLfloat)srcY1 / overlay_in_height; + GLfloat srcX0f = (GLfloat)srcX0 / overlay.in_width; + GLfloat srcX1f = (GLfloat)srcX1 / overlay.in_width; + GLfloat srcY0f = (GLfloat)srcY0 / overlay.in_height; + GLfloat srcY1f = (GLfloat)srcY1 / overlay.in_height; // Convert screen coordinates to [-1.0, 1.0] GLfloat dstX0f = (GLfloat)((dstX0 / frame_width) * 2.0f) - 1.0f; @@ -702,73 +982,119 @@ void NV2ADevice::UpdateHostDisplay(NV2AState *d) GLfloat dstY0f = (GLfloat)((dstY0 / frame_height) * 2.0f) - 1.0f; GLfloat dstY1f = (GLfloat)((dstY1 / frame_height) * 2.0f) - 1.0f; - glDisable(GL_CULL_FACE); - glUseProgram(Get_YUV_to_RGB_shader_program()); + GL_CHECK(); // Attach texture #0 to the shader sampler location - glUniform1i(yuyv_tex_loc, 0); + glUniform1i(m_overlay_gl_uniform_location_texture, SAMP_TEXCOORD); + GL_CHECK(); - // Feed screen coordinates through a vertex buffer object - const GLfloat vertex_buffer_data[] = { - dstX0f, dstY0f, 0.0f, - dstX1f, dstY0f, 0.0f, - dstX1f, dstY1f, 0.0f, - dstX0f, dstY1f, 0.0f, + // Flip Y to prevent upside down rendering + std::swap(srcY0f, srcY1f); + + // Feed screen and texture coordinates through a vertex buffer object + const GLfloat overlay_vertex_buffer_data[] = { + dstX0f, dstY0f, srcX0f, srcY0f, + dstX1f, dstY0f, srcX1f, srcY0f, + dstX1f, dstY1f, srcX1f, srcY1f, + dstX0f, dstY1f, srcX0f, srcY1f, }; - static GLuint vertexbuffer = -1; - if (vertexbuffer == -1) { - glGenBuffers(1, &vertexbuffer); - } - glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_buffer_data), vertex_buffer_data, GL_STREAM_DRAW); - glVertexAttribPointer( - 0, // layout(location = 0) in the vertex shader. - 3, // size = vec3 - GL_FLOAT, // type - GL_FALSE, // normalized? - 0, // stride - (void*)0 // array buffer offset - ); - glEnableVertexAttribArray(0); - // Feed texture coordinates through another vertex buffer object - const GLfloat uv_buffer_data[] = { - srcX0f, srcY0f, - srcX1f, srcY0f, - srcX1f, srcY1f, - srcX0f, srcY1f, - }; - static GLuint uvbuffer = -1; - if (uvbuffer == -1) { - glGenBuffers(1, &uvbuffer); + static GLuint overlay_gl_vertex_buffer_object = -1; + if (overlay_gl_vertex_buffer_object == -1) { + glGenBuffers(1, &overlay_gl_vertex_buffer_object); + GL_CHECK(); } - glBindBuffer(GL_ARRAY_BUFFER, uvbuffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(uv_buffer_data), uv_buffer_data, GL_STREAM_DRAW); - glVertexAttribPointer( - 1, // layout(location = 1) in the vertex shader. - 2, // size = vec2 - GL_FLOAT, // type - GL_FALSE, // normalized? - 0, // stride - (void*)0 // array buffer offset - ); - glEnableVertexAttribArray(1); + glBindBuffer(GL_ARRAY_BUFFER, overlay_gl_vertex_buffer_object); + GL_CHECK(); + glBufferData(GL_ARRAY_BUFFER, sizeof(overlay_vertex_buffer_data), overlay_vertex_buffer_data, GL_DYNAMIC_DRAW); + GL_CHECK(); + // Bind vertex position attribute + glVertexAttribPointer( + /*index=*/ATTR_POSITION, + /*size=vec*/2, + /*type=*/GL_FLOAT, + /*normalized?=*/GL_FALSE, + /*stride=*/4 * sizeof(GLfloat), + /*array buffer offset=*/(void*)0 + ); + GL_CHECK(); + glEnableVertexAttribArray(ATTR_POSITION); + GL_CHECK(); + // Bind vertex texture coordinate attribute + glVertexAttribPointer( + /*index=*/ATTR_TEXCOORD, + /*size=vec*/2, + /*type=*/GL_FLOAT, + /*normalized?=*/GL_FALSE, + /*stride=*/4 * sizeof(GLfloat), + /*array buffer offset=*/(void*)(2 * sizeof(GLfloat)) + ); + GL_CHECK(); + glEnableVertexAttribArray(ATTR_TEXCOORD); + GL_CHECK(); // Finally! Draw the dang overlay... glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + GL_CHECK(); + } +} - glUseProgram(0); +extern void UpdateFPSCounter(); +void NV2ADevice::UpdateHostDisplay(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + if (!pg->opengl_enabled) { + return; } - // We currently don't double buffer, so no need to call swap... - glo_swap(d->pgraph.gl_context); + NV2A_GL_DGROUP_BEGIN("VGA Frame"); - // Restore previous framebuffer - glBindFramebuffer(GL_FRAMEBUFFER, d->pgraph.gl_framebuffer); + glo_set_current(pg->gl_context); + + cxbx_gl_update_displaymode(d); + + for (int v = 0; v < 2; v++) { + cxbx_gl_parse_overlay(d, v); + } + + GL_RESET(); + + // Target the host framebuffer + glBindFramebuffer(GL_FRAMEBUFFER, 0); // NOTE : If disabled, overlays don't show?! + GL_CHECK(); + glDisable(GL_CULL_FACE); + GL_CHECK(); + // Render using texture #0 + glActiveTexture(GL_TEXTURE0); + GL_CHECK(); + + // Is either overlay fullscreen ? + if (d->pvideo.overlays[0].covers_framebuffer + || d->pvideo.overlays[1].covers_framebuffer) { + // Then the framebuffer won't be visible anyway, so doesn't have to be rendered + } else { + cxbx_gl_render_framebuffer(d); + } + + cxbx_gl_render_overlays(d); + + // Unbind everything we've used + glUseProgram(0); + GL_CHECK(); + glBindBuffer(GL_ARRAY_BUFFER, 0);//pg->gl_memory_buffer); + GL_CHECK(); + glBindTexture(GL_TEXTURE_2D, 0);//pg->gl_color_buffer); + GL_CHECK(); + // Restore xbox framebuffer + glBindFramebuffer(GL_FRAMEBUFFER, pg->gl_framebuffer); + GL_CHECK(); + + glo_swap(pg->gl_context); NV2A_GL_DGROUP_END(); - unlockGL(&d->pgraph); + +// glo_set_current(NULL); UpdateFPSCounter(); } @@ -776,10 +1102,11 @@ void NV2ADevice::UpdateHostDisplay(NV2AState *d) // TODO: Fix this properly static void nv2a_vblank_thread(NV2AState *d) { + SetThreadAffinityMask(GetCurrentThread(), g_CPUOthers); CxbxSetThreadName("Cxbx NV2A VBLANK"); auto nextVBlankTime = GetNextVBlankTime(); - while (true) { + while (!d->exiting) { // Handle VBlank if (std::chrono::steady_clock::now() > nextVBlankTime) { d->pcrtc.pending_interrupts |= NV_PCRTC_INTR_0_VBLANK; @@ -790,6 +1117,8 @@ static void nv2a_vblank_thread(NV2AState *d) // But it causes crashes on AMD hardware for reasons currently unknown... //NV2ADevice::UpdateHostDisplay(d); } + + Sleep(1); } } @@ -807,7 +1136,7 @@ void CxbxReserveNV2AMemory(NV2AState *d) MEM_RESERVE, // Don't allocate actual physical storage in memory PAGE_NOACCESS); // Any access must result in an access violation exception (handled in EmuException/EmuX86_DecodeException) if (memory == NULL) { - EmuWarning("Couldn't reserve NV2A memory, continuing assuming we'll receive (and handle) access violation exceptions anyway..."); + EmuLog(LOG_LEVEL::WARNING, "Couldn't reserve NV2A memory, continuing assuming we'll receive (and handle) access violation exceptions anyway..."); return; } @@ -823,11 +1152,11 @@ void CxbxReserveNV2AMemory(NV2AState *d) MEM_COMMIT, // No MEM_RESERVE | PAGE_READWRITE); if (d->pramin.ramin_ptr == NULL) { - EmuWarning("Couldn't allocate NV2A PRAMIN memory"); + EmuLog(LOG_LEVEL::WARNING, "Couldn't allocate NV2A PRAMIN memory"); return; } - printf("[0x%.4X] INIT: Allocated %d MiB of Xbox NV2A PRAMIN memory at 0x%.8X to 0x%.8X\n", + printf("[0x%.4X] INIT: Allocated %d MiB of Xbox NV2A PRAMIN memory at 0x%.8p to 0x%.8p\n", GetCurrentThreadId(), d->pramin.ramin_size / ONE_MB, d->pramin.ramin_ptr, d->pramin.ramin_ptr + d->pramin.ramin_size - 1); } @@ -841,6 +1170,7 @@ NV2ADevice::NV2ADevice() NV2ADevice::~NV2ADevice() { + Reset(); // TODO : Review this delete m_nv2a_state; } @@ -877,22 +1207,45 @@ void NV2ADevice::Init() d->pramdac.video_clock_coeff = 0x0003C20D; /* 25182Khz...? */ // Setup the conditions/mutexes - qemu_mutex_init(&d->pfifo.cache1.cache_lock); - qemu_cond_init(&d->pfifo.cache1.cache_cond); - qemu_cond_init(&d->pvideo.interrupt_cond); -// d->pfifo.puller_thread = std::thread(pfifo_puller_thread, d); - pgraph_init(m_nv2a_state); + pgraph_init(d); - // Only spawn VBlank thread when LLE is enabled - if (bLLE_GPU) { - vblank_thread = std::thread(nv2a_vblank_thread, d); + // Only init PVIDEO when LLE is enabled + if (d->pgraph.opengl_enabled) { + pvideo_init(d); } + vblank_thread = std::thread(nv2a_vblank_thread, d); + + qemu_mutex_init(&d->pfifo.pfifo_lock); + qemu_cond_init(&d->pfifo.puller_cond); + qemu_cond_init(&d->pfifo.pusher_cond); + + d->pfifo.regs[NV_PFIFO_CACHE1_STATUS] |= NV_PFIFO_CACHE1_STATUS_LOW_MARK; + + /* fire up puller */ d->pfifo.puller_thread = std::thread(pfifo_puller_thread, d); + /* fire up pusher */ + d->pfifo.pusher_thread = std::thread(pfifo_pusher_thread, d); } void NV2ADevice::Reset() { + NV2AState *d = m_nv2a_state; // glue + if (!d) return; + + d->exiting = true; + + qemu_cond_broadcast(&d->pfifo.puller_cond); + qemu_cond_broadcast(&d->pfifo.pusher_cond); + d->pfifo.puller_thread.join(); + d->pfifo.pusher_thread.join(); + qemu_mutex_destroy(&d->pfifo.pfifo_lock); // Cbxbx addition + if (d->pgraph.opengl_enabled) { + vblank_thread.join(); + pvideo_destroy(d); + } + + pgraph_destroy(&d->pgraph); } uint32_t NV2ADevice::IORead(int barIndex, uint32_t port, unsigned size) @@ -904,27 +1257,34 @@ void NV2ADevice::IOWrite(int barIndex, uint32_t port, uint32_t value, unsigned s { } +uint32_t NV2ADevice::BlockRead(const NV2ABlockInfo* block, uint32_t addr, unsigned size) +{ + switch (size) { + case sizeof(uint8_t) : + return block->ops.read(m_nv2a_state, addr - block->offset) & 0xFF; + case sizeof(uint16_t) : + assert((addr & 1) == 0); // TODO : What if this fails? + + return block->ops.read(m_nv2a_state, addr - block->offset) & 0xFFFF; + case sizeof(uint32_t) : + assert((addr & 3) == 0); // TODO : What if this fails? + + return block->ops.read(m_nv2a_state, addr - block->offset); + default: + assert(false); + + return 0; + } +} + uint32_t NV2ADevice::MMIORead(int barIndex, uint32_t addr, unsigned size) { - switch (barIndex) { case 0: { // Access NV2A regardless weither HLE is disabled or not (ignoring bLLE_GPU) const NV2ABlockInfo* block = EmuNV2A_Block(addr); - if (block != nullptr) { - switch (size) { - case sizeof(uint8_t) : - return block->ops.read(m_nv2a_state, addr - block->offset) & 0xFF; - case sizeof(uint16_t) : - assert((addr & 1) == 0); // TODO : What if this fails? - - return block->ops.read(m_nv2a_state, addr - block->offset) & 0xFFFF; - case sizeof(uint32_t) : - assert((addr & 3) == 0); // TODO : What if this fails? - - return block->ops.read(m_nv2a_state, addr - block->offset); - } + return BlockRead(block, addr, size); } break; } @@ -934,10 +1294,53 @@ uint32_t NV2ADevice::MMIORead(int barIndex, uint32_t addr, unsigned size) } } - EmuWarning("NV2ADevice::MMIORead: Unhandled barIndex %d, addr %08X, size %d", barIndex, addr, size); + EmuLog(LOG_LEVEL::WARNING, "NV2ADevice::MMIORead: Unhandled barIndex %d, addr %08X, size %d", barIndex, addr, size); return 0; } +void NV2ADevice::BlockWrite(const NV2ABlockInfo* block, uint32_t addr, uint32_t value, unsigned size) +{ + switch (size) { + case sizeof(uint8_t) : { +#if 0 + xbaddr aligned_addr; + uint32_t aligned_value; + int shift; + uint32_t mask; + + aligned_addr = addr & ~3; + aligned_value = block->ops.read(m_nv2a_state, aligned_addr - block->offset); + shift = (addr & 3) * 8; + mask = 0xFF << shift; + block->ops.write(m_nv2a_state, aligned_addr - block->offset, (aligned_value & ~mask) | (value << shift)); +#else + block->ops.write(m_nv2a_state, addr - block->offset, value); +#endif + return; + } + case sizeof(uint16_t) : { + assert((addr & 1) == 0); // TODO : What if this fails? + + xbaddr aligned_addr; + uint32_t aligned_value; + int shift; + uint32_t mask; + + aligned_addr = addr & ~3; + aligned_value = block->ops.read(m_nv2a_state, aligned_addr - block->offset); + shift = (addr & 2) * 16; + mask = 0xFFFF << shift; + block->ops.write(m_nv2a_state, aligned_addr - block->offset, (aligned_value & ~mask) | (value << shift)); + return; + } + case sizeof(uint32_t) : + assert((addr & 3) == 0); // TODO : What if this fails? + + block->ops.write(m_nv2a_state, addr - block->offset, value); + return; + } +} + void NV2ADevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size) { switch (barIndex) { @@ -946,37 +1349,11 @@ void NV2ADevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned const NV2ABlockInfo* block = EmuNV2A_Block(addr); if (block != nullptr) { - xbaddr aligned_addr; - uint32_t aligned_value; - int shift; - uint32_t mask; - - switch (size) { - case sizeof(uint8_t) : - aligned_addr = addr & ~3; - aligned_value = block->ops.read(m_nv2a_state, aligned_addr - block->offset); - shift = (addr & 3) * 8; - mask = 0xFF << shift; - block->ops.write(m_nv2a_state, aligned_addr - block->offset, (aligned_value & ~mask) | (value << shift)); - return; - case sizeof(uint16_t) : - assert((addr & 1) == 0); // TODO : What if this fails? - - aligned_addr = addr & ~3; - aligned_value = block->ops.read(m_nv2a_state, aligned_addr - block->offset); - shift = (addr & 2) * 16; - mask = 0xFFFF << shift; - block->ops.write(m_nv2a_state, aligned_addr - block->offset, (aligned_value & ~mask) | (value << shift)); - return; - case sizeof(uint32_t) : - assert((addr & 3) == 0); // TODO : What if this fails? - - block->ops.write(m_nv2a_state, addr - block->offset, value); - return; - } + BlockWrite(block, addr, value, size); + return; } - break; + break; } case 1: { // TODO : access physical memory @@ -984,5 +1361,31 @@ void NV2ADevice::MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned } } - EmuWarning("NV2ADevice::MMIOWrite: Unhandled barIndex %d, addr %08X, value %08X, size %d", barIndex, addr, value, size); + EmuLog(LOG_LEVEL::WARNING, "NV2ADevice::MMIOWrite: Unhandled barIndex %d, addr %08X, value %08X, size %d", barIndex, addr, value, size); +} + +int NV2ADevice::GetFrameHeight(NV2AState* d) +{ + // Derive frame_height from hardware registers + int height = ((int)d->prmcio.cr[NV_CIO_CR_VDE_INDEX]) + | (((int)d->prmcio.cr[NV_CIO_CR_OVL_INDEX] & 0x02) >> 1 << 8) + | (((int)d->prmcio.cr[NV_CIO_CR_OVL_INDEX] & 0x40) >> 6 << 9) + | (((int)d->prmcio.cr[NV_CIO_CRE_LSR_INDEX] & 0x02) >> 1 << 10); + + return height++; +} + +int NV2ADevice::GetFrameWidth(NV2AState* d) +{ + // Test case : Arctic Thunder, sets a 16 bit framebuffer (R5G6B5) not via + // AvSetDisplayMode(), but via VGA control register writes, which implies + // that it's format argument cannot be used to determine the framebuffer + // width. Instead, read the framebuffer width from the VGA control registers : + int width = ((int)d->prmcio.cr[NV_CIO_CR_OFFSET_INDEX]) + | (0x700 & ((int)d->prmcio.cr[NV_CIO_CRE_RPC0_INDEX] << 3)) + | (0x800 & ((int)d->prmcio.cr[NV_CIO_CRE_LSR_INDEX] << 6)); + width *= 8; + width /= frame_pixel_bytes; + + return width; } diff --git a/src/devices/video/nv2a.h b/src/devices/video/nv2a.h index 52c3009c5..8551e3466 100644 --- a/src/devices/video/nv2a.h +++ b/src/devices/video/nv2a.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * src->devices->video->nv2a.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,555 +25,11 @@ // ****************************************************************** #pragma once -#undef USE_SHADER_CACHE - -#ifdef USE_SHADER_CACHE -#include "glib_compat.h" // For GHashTable, g_hash_table_new, g_hash_table_lookup, g_hash_table_insert -#endif - -#include "Cxbx.h" // For xbaddr #include "devices\PCIDevice.h" // For PCIDevice -#include -#include - -#include - -#include "swizzle.h" -#include "nv2a_int.h" -#include "nv2a_debug.h" // For HWADDR_PRIx, NV2A_DPRINTF, NV2A_GL_DPRINTF, etc. -#include "CxbxKrnl/gloffscreen/gloffscreen.h" -#include "qemu-thread.h" // For qemu_mutex, etc -#include "nv2a_shaders.h" // For ShaderBinding - -#define NV2A_ADDR 0xFD000000 -#define NV2A_SIZE 0x01000000 - -#define NV_PMC_SIZE 0x001000 -#define _NV_PFIFO_SIZE 0x002000 // Underscore prefix to prevent clash with NV_PFIFO_SIZE -#define NV_PVIDEO_SIZE 0x001000 -#define NV_PTIMER_SIZE 0x001000 -#define NV_PFB_SIZE 0x001000 -#define NV_PGRAPH_SIZE 0x002000 -#define NV_PCRTC_SIZE 0x001000 -#define NV_PRAMDAC_SIZE 0x001000 - -typedef xbaddr hwaddr; // Compatibility; Cxbx uses xbaddr, xqemu and OpenXbox use hwaddr -typedef uint32_t value_t; // Compatibility; Cxbx values are uint32_t (xqemu and OpenXbox use uint64_t) - -#ifdef __cplusplus -template struct ArraySizeHelper { char _[N]; }; -template -ArraySizeHelper makeArraySizeHelper(T(&)[N]); -# define ARRAY_SIZE(a) sizeof(makeArraySizeHelper(a)) -#else -// The expression ARRAY_SIZE(a) is a compile-time constant of type -// size_t which represents the number of elements of the given -// array. You should only use ARRAY_SIZE on statically allocated -// arrays. - -#define ARRAY_SIZE(a) \ - ((sizeof(a) / sizeof(*(a))) / \ - static_cast(!(sizeof(a) % sizeof(*(a))))) -#endif - -#define VSH_TOKEN_SIZE 4 // Compatibility; TODO : Move this to nv2a_vsh.h -#define MAX(a,b) ((a)>(b) ? (a) : (b)) // Compatibility -#define MIN(a,b) ((a)<(b) ? (a) : (b)) // Compatibility - -#define g_free(x) free(x) // Compatibility -#define g_malloc(x) malloc(x) // Compatibility -#define g_malloc0(x) calloc(1, x) // Compatibility -#define g_realloc(x, y) realloc(x, y) // Compatibility - -#undef USE_TEXTURE_CACHE - -#if __cplusplus >= 201402L -# define NV2A_CONSTEXPR constexpr -#else -# define NV2A_CONSTEXPR static -#endif - -// GCC implementation of FFS -static int ffs(register int valu) -{ - register int bit; - - if (valu == 0) - return 0; - - for (bit = 1; !(valu & 1); bit++) - valu >>= 1; - - return bit; -} - -#define GET_MASK(v, mask) (((v) & (mask)) >> (ffs(mask)-1)) - -#define SET_MASK(v, mask, val) \ - do { \ - (v) &= ~(mask); \ - (v) |= ((val) << (ffs(mask)-1)) & (mask); \ - } while (0) - -// Power-of-two CASE statements -#define CASE_1(v, step) case (v) -#define CASE_2(v, step) CASE_1(v, step) : CASE_1(v + (step) * 1, step) -#define CASE_4(v, step) CASE_2(v, step) : CASE_2(v + (step) * 2, step) -#define CASE_8(v, step) CASE_4(v, step) : CASE_4(v + (step) * 4, step) -#define CASE_16(v, step) CASE_8(v, step) : CASE_8(v + (step) * 8, step) -#define CASE_32(v, step) CASE_16(v, step) : CASE_16(v + (step) * 16, step) -#define CASE_64(v, step) CASE_32(v, step) : CASE_32(v + (step) * 32, step) -#define CASE_128(v, step) CASE_64(v, step) : CASE_64(v + (step) * 64, step) - -// Non-power-of-two CASE statements -#define CASE_3(v, step) CASE_2(v, step) : CASE_1(v + (step) * 2, step) -#define CASE_12(v, step) CASE_8(v, step) : CASE_4(v + (step) * 8, step) -#define CASE_13(v, step) CASE_8(v, step) : CASE_3(v + (step) * 8, step) -#define CASE_28(v, step) CASE_16(v, step) : CASE_12(v + (step) * 16, step) -#define CASE_29(v, step) CASE_16(v, step) : CASE_13(v + (step) * 16, step) -#define CASE_61(v, step) CASE_32(v, step) : CASE_29(v + (step) * 32, step) -#define CASE_78(v, step) CASE_64(v, step) : CASE_12(v + (step) * 64, step) -#define CASE_125(v, step) CASE_64(v, step) : CASE_61(v + (step) * 64, step) -#define CASE_132(v, step) CASE_128(v, step) : CASE_4(v + (step) * 128, step) -#define CASE_253(v, step) CASE_128(v, step) : CASE_125(v + (step) * 128, step) - -#define NV2A_DEVICE(obj) \ - OBJECT_CHECK(NV2AState, (obj), "nv2a") - -//void reg_log_read(int block, hwaddr addr, uint64_t val); -//void reg_log_write(int block, hwaddr addr, uint64_t val); - -enum FifoMode { - FIFO_PIO = 0, - FIFO_DMA = 1, -}; - -enum FIFOEngine { - ENGINE_SOFTWARE = 0, - ENGINE_GRAPHICS = 1, - ENGINE_DVD = 2, -}; - -typedef struct DMAObject { - unsigned int dma_class; - unsigned int dma_target; - xbaddr address; - xbaddr limit; -} DMAObject; - -typedef struct VertexAttribute { - bool dma_select; - xbaddr offset; - - /* inline arrays are packed in order? - * Need to pass the offset to converted attributes */ - unsigned int inline_array_offset; - - float inline_value[4]; - - unsigned int format; - unsigned int size; /* size of the data type */ - unsigned int count; /* number of components */ - uint32_t stride; - - bool needs_conversion; - uint8_t *converted_buffer; - unsigned int converted_elements; - unsigned int converted_size; - unsigned int converted_count; - - float *inline_buffer; - - GLint gl_count; - GLenum gl_type; - GLboolean gl_normalize; - - GLuint gl_converted_buffer; - GLuint gl_inline_buffer; -} VertexAttribute; - -typedef struct Surface { - bool draw_dirty; - bool buffer_dirty; - bool write_enabled_cache; - unsigned int pitch; - - xbaddr offset; -} Surface; - -typedef struct SurfaceShape { - unsigned int z_format; - unsigned int color_format; - unsigned int zeta_format; - unsigned int log_width, log_height; - unsigned int clip_x, clip_y; - unsigned int clip_width, clip_height; - unsigned int anti_aliasing; -} SurfaceShape; - -typedef struct TextureShape { - bool cubemap; - unsigned int dimensionality; - unsigned int color_format; - unsigned int levels; - unsigned int width, height, depth; - - unsigned int min_mipmap_level, max_mipmap_level; - unsigned int pitch; -} TextureShape; - -typedef struct TextureKey { - TextureShape state; - uint64_t data_hash; - uint8_t* texture_data; - uint8_t* palette_data; -} TextureKey; - -typedef struct TextureBinding { - GLenum gl_target; - GLuint gl_texture; - unsigned int refcnt; -} TextureBinding; - -typedef struct KelvinState { - xbaddr dma_notifies; - xbaddr dma_state; - xbaddr dma_semaphore; - unsigned int semaphore_offset; -} KelvinState; - -typedef struct ContextSurfaces2DState { - xbaddr dma_image_source; - xbaddr dma_image_dest; - unsigned int color_format; - unsigned int source_pitch, dest_pitch; - xbaddr source_offset, dest_offset; - -} ContextSurfaces2DState; - -typedef struct ImageBlitState { - xbaddr context_surfaces; - unsigned int operation; - unsigned int in_x, in_y; - unsigned int out_x, out_y; - unsigned int width, height; - -} ImageBlitState; - -typedef struct GraphicsObject { - uint8_t graphics_class; - union { - ContextSurfaces2DState context_surfaces_2d; - - ImageBlitState image_blit; - - KelvinState kelvin; - } data; -} GraphicsObject; - -typedef struct GraphicsSubchannel { - xbaddr object_instance; - GraphicsObject object; - uint32_t object_cache[5]; -} GraphicsSubchannel; - -typedef struct GraphicsContext { - bool channel_3d; - unsigned int subchannel; -} GraphicsContext; - - -typedef struct PGRAPHState { - bool opengl_enabled; // == bLLE_GPU - QemuMutex lock; - - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - QemuCond interrupt_cond; - - xbaddr context_table; - xbaddr context_address; - - - unsigned int trapped_method; - unsigned int trapped_subchannel; - unsigned int trapped_channel_id; - uint32_t trapped_data[2]; - uint32_t notify_source; - - bool fifo_access; - QemuCond fifo_access_cond; - - QemuCond flip_3d; - - unsigned int channel_id; - bool channel_valid; - GraphicsContext context[NV2A_NUM_CHANNELS]; - - xbaddr dma_color, dma_zeta; - Surface surface_color, surface_zeta; - unsigned int surface_type; - SurfaceShape surface_shape; - SurfaceShape last_surface_shape; - - xbaddr dma_a, dma_b; -#ifdef USE_TEXTURE_CACHE - GLruCache *texture_cache; -#endif - bool texture_dirty[NV2A_MAX_TEXTURES]; - TextureBinding *texture_binding[NV2A_MAX_TEXTURES]; - -#ifdef USE_SHADER_CACHE - GHashTable *shader_cache; -#endif - ShaderBinding *shader_binding; - - bool texture_matrix_enable[NV2A_MAX_TEXTURES]; - - /* FIXME: Move to NV_PGRAPH_BUMPMAT... */ - float bump_env_matrix[NV2A_MAX_TEXTURES - 1][4]; /* 3 allowed stages with 2x2 matrix each */ - - GloContext *gl_context; - QemuMutex gl_lock; - - GLuint gl_framebuffer; - GLuint gl_color_buffer, gl_zeta_buffer; - GraphicsSubchannel subchannel_data[NV2A_NUM_SUBCHANNELS]; - - xbaddr dma_report; - xbaddr report_offset; - bool zpass_pixel_count_enable; - unsigned int zpass_pixel_count_result; - unsigned int gl_zpass_pixel_count_query_count; - GLuint* gl_zpass_pixel_count_queries; - - xbaddr dma_vertex_a, dma_vertex_b; - - unsigned int primitive_mode; - - bool enable_vertex_program_write; - - uint32_t program_data[NV2A_MAX_TRANSFORM_PROGRAM_LENGTH][VSH_TOKEN_SIZE]; - - uint32_t vsh_constants[NV2A_VERTEXSHADER_CONSTANTS][4]; - bool vsh_constants_dirty[NV2A_VERTEXSHADER_CONSTANTS]; - - /* lighting constant arrays */ - uint32_t ltctxa[NV2A_LTCTXA_COUNT][4]; - bool ltctxa_dirty[NV2A_LTCTXA_COUNT]; - uint32_t ltctxb[NV2A_LTCTXB_COUNT][4]; - bool ltctxb_dirty[NV2A_LTCTXB_COUNT]; - uint32_t ltc1[NV2A_LTC1_COUNT][4]; - bool ltc1_dirty[NV2A_LTC1_COUNT]; - - // should figure out where these are in lighting context - float light_infinite_half_vector[NV2A_MAX_LIGHTS][3]; - float light_infinite_direction[NV2A_MAX_LIGHTS][3]; - float light_local_position[NV2A_MAX_LIGHTS][3]; - float light_local_attenuation[NV2A_MAX_LIGHTS][3]; - - VertexAttribute vertex_attributes[NV2A_VERTEXSHADER_ATTRIBUTES]; - - unsigned int inline_array_length; - uint32_t inline_array[NV2A_MAX_BATCH_LENGTH]; - GLuint gl_inline_array_buffer; - - unsigned int inline_elements_length; - uint32_t inline_elements[NV2A_MAX_BATCH_LENGTH]; - - unsigned int inline_buffer_length; - - unsigned int draw_arrays_length; - unsigned int draw_arrays_max_count; - - /* FIXME: Unknown size, possibly endless, 1000 will do for now */ - GLint gl_draw_arrays_start[1000]; - GLsizei gl_draw_arrays_count[1000]; - - GLuint gl_element_buffer; - GLuint gl_memory_buffer; - GLuint gl_vertex_array; - - uint32_t regs[NV_PGRAPH_SIZE]; // TODO : union -} PGRAPHState; - -#define lockGL(x) lockGL_(x, __LINE__) -static void lockGL_(PGRAPHState* pg, unsigned int line) { - //printf("Locking from line %d\n", line); - qemu_mutex_lock(&pg->gl_lock); - glo_set_current(pg->gl_context); -} - -#define unlockGL(x) unlockGL_(x, __LINE__) -static void unlockGL_(PGRAPHState* pg, unsigned int line) { - //printf("Unlocking from line %d\n", line); - glo_set_current(NULL); - qemu_mutex_unlock(&pg->gl_lock); -} - -typedef struct CacheEntry { - //QSIMPLEQ_ENTRY(CacheEntry) entry; - unsigned int method : 14; - unsigned int subchannel : 3; - bool nonincreasing; - uint32_t parameter; -} CacheEntry; - -typedef struct Cache1State { - unsigned int channel_id; - FifoMode mode; - - /* Pusher state */ - bool push_enabled; - bool dma_push_enabled; - bool dma_push_suspended; - xbaddr dma_instance; - - bool method_nonincreasing; - unsigned int method : 14; - unsigned int subchannel : 3; - unsigned int method_count : 24; - uint32_t dcount; - - bool subroutine_active; - xbaddr subroutine_return; - xbaddr get_jmp_shadow; - uint32_t rsvd_shadow; - uint32_t data_shadow; - uint32_t error; - - bool pull_enabled; - enum FIFOEngine bound_engines[NV2A_NUM_SUBCHANNELS]; - enum FIFOEngine last_engine; - - /* The actual command queue */ - QemuMutex cache_lock; - QemuCond cache_cond; - std::queue cache; - std::queue working_cache; -} Cache1State; - -typedef struct ChannelControl { - xbaddr dma_put; - xbaddr dma_get; - uint32_t ref; -} ChannelControl; - -typedef struct NV2AState { - // PCIDevice dev; - // qemu_irq irq; - bool exiting; - bool enable_overlay = false; - - // VGACommonState vga; - // GraphicHwOps hw_ops; - // QEMUTimer *vblank_timer; - - // MemoryRegion *vram; - // MemoryRegion vram_pci; - uint8_t *vram_ptr; - size_t vram_size; - // MemoryRegion ramin; - struct { - uint8_t *ramin_ptr; - size_t ramin_size; - } pramin; - - // MemoryRegion mmio; - // MemoryRegion block_mmio[NV_NUM_BLOCKS]; - - struct { - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - uint32_t regs[NV_PMC_SIZE]; // Not in xqemu/openxbox? TODO : union - } pmc; - - struct { - std::thread puller_thread; - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - Cache1State cache1; - uint32_t regs[_NV_PFIFO_SIZE]; // TODO : union - } pfifo; - - struct { - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - QemuCond interrupt_cond; - uint32_t regs[NV_PVIDEO_SIZE]; // TODO : union - } pvideo; - - struct { - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - uint32_t numerator; - uint32_t denominator; - uint32_t alarm_time; - uint32_t regs[NV_PTIMER_SIZE]; // Not in xqemu/openxbox? TODO : union - } ptimer; - - struct { - uint32_t regs[NV_PFB_SIZE]; // TODO : union - } pfb; - - struct PGRAPHState pgraph; - - struct { - uint32_t pending_interrupts; - uint32_t enabled_interrupts; - hwaddr start; - uint32_t regs[NV_PCRTC_SIZE]; // Not in xqemu/openxbox? TODO : union - } pcrtc; - - struct { - uint32_t core_clock_coeff; - uint64_t core_clock_freq; - uint32_t memory_clock_coeff; - uint32_t video_clock_coeff; - uint32_t regs[NV_PRAMDAC_SIZE]; // Not in xqemu/openxbox? TODO : union - } pramdac; - - struct { - ChannelControl channel_control[NV2A_NUM_CHANNELS]; - } user; - - // PRMCIO (Actually the VGA controller) - struct { - uint8_t cr_index; - uint8_t cr[256]; /* CRT registers */ - } prmcio; // Not in xqemu/openxbox? -} NV2AState; - -typedef value_t(*read_func)(NV2AState *d, hwaddr addr); //, unsigned int size); -typedef void(*write_func)(NV2AState *d, hwaddr addr, value_t val); //, unsigned int size); - -typedef struct { - read_func read; - write_func write; -} MemoryRegionOps; - -typedef struct NV2ABlockInfo { - const char* name; - hwaddr offset; - uint64_t size; - MemoryRegionOps ops; -} NV2ABlockInfo; - -#if 0 -// Valid after PCI init : -#define NV20_REG_BASE_KERNEL 0xFD000000 - -typedef volatile DWORD *PPUSH; - -typedef struct { - DWORD Ignored[0x10]; - PPUSH Put; // On Xbox1, this field is only written to by the CPU (the GPU uses this as a trigger to start executing from the given address) - PPUSH Get; // On Xbox1, this field is only read from by the CPU (the GPU reflects in here where it is/stopped executing) - PPUSH Reference; // TODO : xbaddr / void* / DWORD ? - DWORD Ignored2[0x7ED]; -} Nv2AControlDma; +#include "nv2a_int.h" // For NV2AState +// NV2A Push buffer command masks #define PUSH_TYPE_MASK 0x00000002 // 2 bits #define PUSH_TYPE_SHIFT 0 #define PUSH_TYPE_METHOD 0 // method @@ -617,21 +64,25 @@ typedef struct { #define PUSH_SUBCH_MAX (PUSH_SUBCH_MASK >> PUSH_SUBCH_SHIFT) // = 7 #define PUSH_COUNT_MAX (PUSH_COUNT_MASK >> PUSH_COUNT_SHIFT) // = 2047 -// Decode push buffer conmmand (inverse of D3DPUSH_ENCODE) -inline void D3DPUSH_DECODE(const DWORD dwPushCommand, DWORD &dwMethod, DWORD &dwSubCh, DWORD &dwCount) +// Decode push buffer command (inverse of D3DPUSH_ENCODE) +inline void D3DPUSH_DECODE(const DWORD dwPushCommand, DWORD & dwMethod, DWORD & dwSubCh, DWORD & dwCount) { dwMethod = PUSH_METHOD(dwPushCommand); dwSubCh = PUSH_SUBCH(dwPushCommand); dwCount = PUSH_COUNT(dwPushCommand); } -#endif + +typedef struct NV2ABlockInfo { + const char* name; + hwaddr offset; + uint64_t size; + MemoryRegionOps ops; +} NV2ABlockInfo; + +const NV2ABlockInfo* EmuNV2A_Block(xbaddr addr); void CxbxReserveNV2AMemory(NV2AState *d); -GLuint create_gl_shader(GLenum gl_shader_type, - const char *code, - const char *name); // forward to nv2a_shaders.cpp - class NV2ADevice : public PCIDevice { public: // constructor @@ -643,12 +94,20 @@ public: void Init(); void Reset(); + // State Getter: Used for HLE reading of device state + NV2AState* GetDeviceState() { return m_nv2a_state; }; + uint32_t IORead(int barIndex, uint32_t port, unsigned size); void IOWrite(int barIndex, uint32_t port, uint32_t value, unsigned size); + uint32_t BlockRead(const NV2ABlockInfo* block, uint32_t addr, unsigned size); uint32_t MMIORead(int barIndex, uint32_t addr, unsigned size); + void BlockWrite(const NV2ABlockInfo* block, uint32_t addr, uint32_t value, unsigned size); void MMIOWrite(int barIndex, uint32_t addr, uint32_t value, unsigned size); static void UpdateHostDisplay(NV2AState *d); + + static int GetFrameWidth(NV2AState *d); + static int GetFrameHeight(NV2AState *d); private: NV2AState *m_nv2a_state; }; diff --git a/src/devices/video/nv2a_debug.cpp b/src/devices/video/nv2a_debug.cpp index 44d7ceb8b..9a0368f19 100644 --- a/src/devices/video/nv2a_debug.cpp +++ b/src/devices/video/nv2a_debug.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #include "nv2a_debug.h" @@ -23,6 +23,7 @@ #ifdef DEBUG_NV2A_GL #include +#include #include #include diff --git a/src/devices/video/nv2a_debug.h b/src/devices/video/nv2a_debug.h index d0bfcd868..32319698b 100644 --- a/src/devices/video/nv2a_debug.h +++ b/src/devices/video/nv2a_debug.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #ifndef HW_NV2A_DEBUG_H @@ -25,9 +25,6 @@ // Enable for NV2A Debug logging (Warning: Slow!) // #define DEBUG_NV2A -#include "CxbxKrnl/gloffscreen/gloffscreen.h" -#include "CxbxKrnl/gloffscreen/glextensions.h" - #ifdef DEBUG_NV2A # define NV2A_DPRINTF(format, ...) printf("[0x????] NV2A: " format, ## __VA_ARGS__) #else @@ -39,6 +36,9 @@ #ifdef DEBUG_NV2A_GL #include +#include "CxbxKrnl/gloffscreen/gloffscreen.h" +#include "CxbxKrnl/gloffscreen/glextensions.h" + void gl_debug_message(bool cc, const char *fmt, ...); void gl_debug_group_begin(const char *fmt, ...); void gl_debug_group_end(void); diff --git a/src/devices/video/nv2a_int.h b/src/devices/video/nv2a_int.h index 7df0b0e08..41dbdf5cc 100644 --- a/src/devices/video/nv2a_int.h +++ b/src/devices/video/nv2a_int.h @@ -1,9 +1,10 @@ -// Source : https://github.com/espes/xqemu/blob/xbox/hw/xbox/nv2a_int.h +// Source : https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a_int.h /* * QEMU Geforce NV2A internal definitions * * Copyright (c) 2012 espes * Copyright (c) 2015 Jannik Vogel + * Copyright (c) 2018 Matt Borgerson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,1734 +17,451 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ -#define NV_NUM_BLOCKS 21 -#define NV_PMC 0 /* card master control */ -#define NV_PBUS 1 /* bus control */ -#define NV_PFIFO 2 /* MMIO and DMA FIFO submission to PGRAPH and VPE */ -#define NV_PFIFO_CACHE 3 -#define NV_PRMA 4 /* access to BAR0/BAR1 from real mode */ -#define NV_PVIDEO 5 /* video overlay */ -#define NV_PTIMER 6 /* time measurement and time-based alarms */ -#define NV_PCOUNTER 7 /* performance monitoring counters */ -#define NV_PVPE 8 /* MPEG2 decoding engine */ -#define NV_PTV 9 /* TV encoder */ -#define NV_PRMFB 10 /* aliases VGA memory window */ -#define NV_PRMVIO 11 /* aliases VGA sequencer and graphics controller registers */ -#define NV_PFB 12 /* memory interface */ -#define NV_PSTRAPS 13 /* straps readout / override */ -#define NV_PGRAPH 14 /* accelerated 2d/3d drawing engine */ -#define NV_PCRTC 15 /* more CRTC controls */ -#define NV_PRMCIO 16 /* aliases VGA CRTC and attribute controller registers */ -#define NV_PRAMDAC 17 /* RAMDAC, cursor, and PLL control */ -#define NV_PRMDIO 18 /* aliases VGA palette registers */ -#define NV_PRAMIN 19 /* RAMIN access */ -#define NV_USER 20 /* PFIFO MMIO and DMA submission area */ +#ifndef HW_NV2A_INT_H +#define HW_NV2A_INT_H -#define NV_PMC_BOOT_0 0x00000000 -#define NV_PMC_BOOT_1 0x00000004 -#define NV_PMC_INTR_0 0x00000100 -# define NV_PMC_INTR_0_PFIFO (1 << 8) -# define NV_PMC_INTR_0_PGRAPH (1 << 12) -# define NV_PMC_INTR_0_PVIDEO (1 << 16) -# define NV_PMC_INTR_0_PTIMER (1 << 20) -# define NV_PMC_INTR_0_PCRTC (1 << 24) -# define NV_PMC_INTR_0_PCRTC2 (1 << 25) -# define NV_PMC_INTR_0_PBUS (1 << 28) -# define NV_PMC_INTR_0_SOFTWARE (1 << 31) -#define NV_PMC_INTR_EN_0 0x00000140 -# define NV_PMC_INTR_EN_0_HARDWARE 1 -# define NV_PMC_INTR_EN_0_SOFTWARE 2 -#define NV_PMC_ENABLE 0x00000200 -# define NV_PMC_ENABLE_PFIFO (1 << 8) -# define NV_PMC_ENABLE_PGRAPH (1 << 12) -# define NV_PMC_ENABLE_PFB (1 << 20) -# define NV_PMC_ENABLE_PCRTC (1 << 24) -# define NV_PMC_ENABLE_PCRTC2 (1 << 25) -# define NV_PMC_ENABLE_PVIDEO (1 << 28) +#undef USE_SHADER_CACHE + +#include +#include +#include + +#include "Cxbx.h" // For xbaddr + +#include "qemu-thread.h" // For qemu_mutex, etc + +#ifdef USE_SHADER_CACHE +#include "glib_compat.h" // For GHashTable, g_hash_table_new, g_hash_table_lookup, g_hash_table_insert +#endif +#include "common\util\gloffscreen\gloffscreen.h" // For GloContext, etc + +#include "swizzle.h" + +#include "nv2a_debug.h" // For HWADDR_PRIx, NV2A_DPRINTF, NV2A_GL_DPRINTF, etc. +#include "nv2a_shaders.h" // For ShaderBinding, etc +#include "nv2a_regs.h" // For NV2A_MAX_TEXTURES, etc -#define NV_PBUS_FBIO_RAM 0x00000218 -# define NV_PBUS_FBIO_RAM_TYPE 0x00000100 -# define NV_PBUS_FBIO_RAM_TYPE_DDR (0 << 8) -# define NV_PBUS_FBIO_RAM_TYPE_SDR (1 << 8) -/* These map approximately to the pci registers */ -#define NV_PBUS_PCI_NV_0 0x00000800 -# define NV_PBUS_PCI_NV_0_VENDOR_ID 0x0000FFFF -# define NV_CONFIG_PCI_NV_0_DEVICE_ID 0xFFFF0000 -#define NV_PBUS_PCI_NV_1 0x00000804 -#define NV_PBUS_PCI_NV_2 0x00000808 -# define NV_PBUS_PCI_NV_2_REVISION_ID 0x000000FF -# define NV_PBUS_PCI_NV_2_CLASS_CODE 0xFFFFFF00 -#define NV_PBUS_PCI_NV_3 0x0000080C -#define NV_PBUS_PCI_NV_4 0x00000810 -#define NV_PBUS_PCI_NV_5 0x00000814 -#define NV_PBUS_PCI_NV_6 0x00000818 -#define NV_PBUS_PCI_NV_7 0x0000081C -#define NV_PBUS_PCI_NV_11 0x0000082C -#define NV_PBUS_PCI_NV_12 0x00000830 -#define NV_PBUS_PCI_NV_13 0x00000834 -#define NV_PBUS_PCI_NV_14 0x00000838 -#define NV_PBUS_PCI_NV_15 0x0000083C -#define NV_PBUS_PCI_NV_16 0x00000840 -#define NV_PBUS_PCI_NV_17 0x00000844 -#define NV_PBUS_PCI_NV_18 0x00000848 -#define NV_PBUS_PCI_NV_19 0x0000084C -#define NV_PBUS_PCI_NV_20 0x00000850 -#define NV_PBUS_PCI_NV_21 0x00000854 -#define NV_PBUS_PCI_NV_22 0x00000858 -#define NV_PBUS_PCI_NV_23 0x0000085C -#define NV_PBUS_PCI_NV_24 0x00000860 -#define NV_PBUS_PCI_NV_25 0x00000864 -#define NV_PBUS_PCI_NV_26 0x00000868 +typedef xbaddr hwaddr; // Compatibility; Cxbx uses xbaddr, xqemu and OpenXbox use hwaddr +typedef uint32_t value_t; // Compatibility; Cxbx values are uint32_t (xqemu and OpenXbox use uint64_t) +#define NV_PMC_SIZE 0x001000 +#define _NV_PFIFO_SIZE 0x002000 // Underscore prefix to prevent clash with NV_PFIFO_SIZE +#define NV_PVIDEO_SIZE 0x001000 +#define NV_PTIMER_SIZE 0x001000 +#define NV_PFB_SIZE 0x001000 +#define NV_PGRAPH_SIZE 0x002000 +#define NV_PCRTC_SIZE 0x001000 +#define NV_PRAMDAC_SIZE 0x001000 -#define NV_PFIFO_DELAY_0 0x00000040 -#define NV_PFIFO_DMA_TIMESLICE 0x00000044 -#define NV_PFIFO_TIMESLICE 0x0000004C -#define NV_PFIFO_INTR_0 0x00000100 -# define NV_PFIFO_INTR_0_CACHE_ERROR (1 << 0) -# define NV_PFIFO_INTR_0_RUNOUT (1 << 4) -# define NV_PFIFO_INTR_0_RUNOUT_OVERFLOW (1 << 8) -# define NV_PFIFO_INTR_0_DMA_PUSHER (1 << 12) -# define NV_PFIFO_INTR_0_DMA_PT (1 << 16) -# define NV_PFIFO_INTR_0_SEMAPHORE (1 << 20) -# define NV_PFIFO_INTR_0_ACQUIRE_TIMEOUT (1 << 24) -#define NV_PFIFO_INTR_EN_0 0x00000140 -# define NV_PFIFO_INTR_EN_0_CACHE_ERROR (1 << 0) -# define NV_PFIFO_INTR_EN_0_RUNOUT (1 << 4) -# define NV_PFIFO_INTR_EN_0_RUNOUT_OVERFLOW (1 << 8) -# define NV_PFIFO_INTR_EN_0_DMA_PUSHER (1 << 12) -# define NV_PFIFO_INTR_EN_0_DMA_PT (1 << 16) -# define NV_PFIFO_INTR_EN_0_SEMAPHORE (1 << 20) -# define NV_PFIFO_INTR_EN_0_ACQUIRE_TIMEOUT (1 << 24) -#define NV_PFIFO_RAMHT 0x00000210 -//# define NV_PFIFO_RAMHT_BASE_ADDRESS 0x000001F0 -# define NV_PFIFO_RAMHT_BASE_ADDRESS_MASK 0x000001F0 -# define NV_PFIFO_RAMHT_BASE_ADDRESS_SHIFT 4 -# define NV_PFIFO_RAMHT_BASE_ADDRESS_MOVE 12 -//# define NV_PFIFO_RAMHT_SIZE 0x00030000 -# define NV_PFIFO_RAMHT_SIZE_MASK 0x00030000 -# define NV_PFIFO_RAMHT_SIZE_SHIFT 16 -# define NV_PFIFO_RAMHT_SIZE_4K 0 -# define NV_PFIFO_RAMHT_SIZE_8K 1 -# define NV_PFIFO_RAMHT_SIZE_16K 2 -# define NV_PFIFO_RAMHT_SIZE_32K 3 -//# define NV_PFIFO_RAMHT_SEARCH 0x03000000 -# define NV_PFIFO_RAMHT_SEARCH_MASK 0x03000000 -# define NV_PFIFO_RAMHT_SEARCH_SHIFT 24 -# define NV_PFIFO_RAMHT_SEARCH_16 0 -# define NV_PFIFO_RAMHT_SEARCH_32 1 -# define NV_PFIFO_RAMHT_SEARCH_64 2 -# define NV_PFIFO_RAMHT_SEARCH_128 3 -#define NV_PFIFO_RAMFC 0x00000214 -//# define NV_PFIFO_RAMFC_BASE_ADDRESS1 0x000001FC -# define NV_PFIFO_RAMFC_BASE_ADDRESS1_MASK 0x000001FC -# define NV_PFIFO_RAMFC_BASE_ADDRESS1_SHIFT 2 -# define NV_PFIFO_RAMFC_BASE_ADDRESS1_MOVE 10 -//# define NV_PFIFO_RAMFC_SIZE 0x00010000 -# define NV_PFIFO_RAMFC_SIZE_MASK 0x00010000 -# define NV_PFIFO_RAMFC_SIZE_1K 0x00000000 -# define NV_PFIFO_RAMFC_SIZE_2K 0x00010000 -//# define NV_PFIFO_RAMFC_BASE_ADDRESS2 0x00FE0000 -# define NV_PFIFO_RAMFC_BASE_ADDRESS2_MASK 0x00FE0000 -# define NV_PFIFO_RAMFC_BASE_ADDRESS2_SHIFT 17 -# define NV_PFIFO_RAMFC_BASE_ADDRESS2_MOVE 10 -#define NV_PFIFO_RAMRO 0x00000218 -# define NV_PFIFO_RAMRO_BASE_ADDRESS 0x000001FE -# define NV_PFIFO_RAMRO_SIZE 0x00010000 -#define NV_PFIFO_RUNOUT_STATUS 0x00000400 -# define NV_PFIFO_RUNOUT_STATUS_RANOUT (1 << 0) -# define NV_PFIFO_RUNOUT_STATUS_LOW_MARK (1 << 4) -# define NV_PFIFO_RUNOUT_STATUS_HIGH_MARK (1 << 8) -#define NV_PFIFO_RUNOUT_PUT_ADDRESS 0x00000410 -#define NV_PFIFO_RUNOUT_GET_ADDRESS 0x00000420 -#define NV_PFIFO_CACHES 0x00000500 -#define NV_PFIFO_MODE 0x00000504 -#define NV_PFIFO_DMA 0x00000508 -#define NV_PFIFO_SIZE 0x0000050C -#define NV_PFIFO_CACHE0_PUSH0 0x00001000 -#define NV_PFIFO_CACHE0_PULL0 0x00001050 -#define NV_PFIFO_CACHE0_HASH 0x00001058 -#define NV_PFIFO_CACHE1_PUSH0 0x00001200 -# define NV_PFIFO_CACHE1_PUSH0_ACCESS (1 << 0) -#define NV_PFIFO_CACHE1_PUSH1 0x00001204 -# define NV_PFIFO_CACHE1_PUSH1_CHID 0x0000001F -# define NV_PFIFO_CACHE1_PUSH1_MODE 0x00000100 -#define NV_PFIFO_CACHE1_PUT 0x00001210 -#define NV_PFIFO_CACHE1_STATUS 0x00001214 -# define NV_PFIFO_CACHE1_STATUS_LOW_MARK (1 << 4) -# define NV_PFIFO_CACHE1_STATUS_HIGH_MARK (1 << 8) -#define NV_PFIFO_CACHE1_DMA_PUSH 0x00001220 -# define NV_PFIFO_CACHE1_DMA_PUSH_ACCESS (1 << 0) -# define NV_PFIFO_CACHE1_DMA_PUSH_STATE (1 << 4) -# define NV_PFIFO_CACHE1_DMA_PUSH_BUFFER (1 << 8) -# define NV_PFIFO_CACHE1_DMA_PUSH_STATUS (1 << 12) -# define NV_PFIFO_CACHE1_DMA_PUSH_ACQUIRE (1 << 16) -#define NV_PFIFO_CACHE1_DMA_FETCH 0x00001224 -# define NV_PFIFO_CACHE1_DMA_FETCH_TRIG 0x000000F8 -# define NV_PFIFO_CACHE1_DMA_FETCH_SIZE 0x0000E000 -# define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS 0x001F0000 -#define NV_PFIFO_CACHE1_DMA_STATE 0x00001228 -# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE (1 << 0) -# define NV_PFIFO_CACHE1_DMA_STATE_METHOD 0x00001FFC -# define NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL 0x0000E000 -# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT 0x1FFC0000 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR 0xE0000000 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_NONE 0 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_CALL 1 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_NON_CACHE 2 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_RETURN 3 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD 4 -# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION 6 -#define NV_PFIFO_CACHE1_DMA_INSTANCE 0x0000122C -//# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS 0x0000FFFF -# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MASK 0x0000FFFF -# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_SHIFT 0 -# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MOVE 4 -#define NV_PFIFO_CACHE1_DMA_CTL 0x00001230 -#define NV_PFIFO_CACHE1_DMA_PUT 0x00001240 -#define NV_PFIFO_CACHE1_DMA_GET 0x00001244 -#define NV_PFIFO_CACHE1_REF 0x00001248 -#define NV_PFIFO_CACHE1_DMA_SUBROUTINE 0x0000124C -# define NV_PFIFO_CACHE1_DMA_SUBROUTINE_RETURN_OFFSET 0x1FFFFFFC -# define NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE (1 << 0) -#define NV_PFIFO_CACHE1_PULL0 0x00001250 -# define NV_PFIFO_CACHE1_PULL0_ACCESS (1 << 0) -#define NV_PFIFO_CACHE1_PULL1 0x00001254 -#define NV_PFIFO_CACHE1_HASH 0x00001258 -#define NV_PFIFO_CACHE1_ACQUIRE_0 0x00001260 -#define NV_PFIFO_CACHE1_ACQUIRE_1 0x00001264 -#define NV_PFIFO_CACHE1_ACQUIRE_2 0x00001268 -#define NV_PFIFO_CACHE1_SEMAPHORE 0x0000126C -#define NV_PFIFO_CACHE1_GET 0x00001270 -#define NV_PFIFO_CACHE1_ENGINE 0x00001280 -#define NV_PFIFO_CACHE1_DMA_DCOUNT 0x000012A0 -# define NV_PFIFO_CACHE1_DMA_DCOUNT_VALUE 0x00001FFC -#define NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW 0x000012A4 -# define NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW_OFFSET 0x1FFFFFFC -#define NV_PFIFO_CACHE1_DMA_RSVD_SHADOW 0x000012A8 -#define NV_PFIFO_CACHE1_DMA_DATA_SHADOW 0x000012AC +#define VSH_TOKEN_SIZE 4 // Compatibility; TODO : Move this to nv2a_vsh.h +#define MAX(a,b) ((a)>(b) ? (a) : (b)) // Compatibility +#define MIN(a,b) ((a)<(b) ? (a) : (b)) // Compatibility +#define g_free(x) free(x) // Compatibility +#define g_malloc(x) malloc(x) // Compatibility +#define g_malloc0(x) calloc(1, x) // Compatibility +#define g_realloc(x, y) realloc(x, y) // Compatibility -#define NV_PGRAPH_DEBUG_0 0x00000080 -#define NV_PGRAPH_DEBUG_1 0x00000084 -#define NV_PGRAPH_DEBUG_3 0x0000008C -#define NV_PGRAPH_DEBUG_4 0x00000090 -#define NV_PGRAPH_DEBUG_5 0x00000094 -#define NV_PGRAPH_DEBUG_8 0x00000098 -#define NV_PGRAPH_DEBUG_9 0x0000009C -#define NV_PGRAPH_INTR 0x00000100 -# define NV_PGRAPH_INTR_NOTIFY (1 << 0) -# define NV_PGRAPH_INTR_MISSING_HW (1 << 4) -# define NV_PGRAPH_INTR_TLB_PRESENT_DMA_R (1 << 6) -# define NV_PGRAPH_INTR_TLB_PRESENT_DMA_W (1 << 7) -# define NV_PGRAPH_INTR_TLB_PRESENT_TEX_A (1 << 8) -# define NV_PGRAPH_INTR_TLB_PRESENT_TEX_B (1 << 9) -# define NV_PGRAPH_INTR_TLB_PRESENT_VTX (1 << 10) -# define NV_PGRAPH_INTR_CONTEXT_SWITCH (1 << 12) -# define NV_PGRAPH_INTR_STATE3D (1 << 13) -# define NV_PGRAPH_INTR_BUFFER_NOTIFY (1 << 16) -# define NV_PGRAPH_INTR_ERROR (1 << 20) -# define NV_PGRAPH_INTR_SINGLE_STEP (1 << 24) -#define NV_PGRAPH_NSOURCE 0x00000108 -# define NV_PGRAPH_NSOURCE_NOTIFICATION (1 << 0) -#define NV_PGRAPH_INTR_EN 0x00000140 -# define NV_PGRAPH_INTR_EN_NOTIFY (1 << 0) -# define NV_PGRAPH_INTR_EN_MISSING_HW (1 << 4) -# define NV_PGRAPH_INTR_EN_TLB_PRESENT_DMA_R (1 << 6) -# define NV_PGRAPH_INTR_EN_TLB_PRESENT_DMA_W (1 << 7) -# define NV_PGRAPH_INTR_EN_TLB_PRESENT_TEX_A (1 << 8) -# define NV_PGRAPH_INTR_EN_TLB_PRESENT_TEX_B (1 << 9) -# define NV_PGRAPH_INTR_EN_TLB_PRESENT_VTX (1 << 10) -# define NV_PGRAPH_INTR_EN_CONTEXT_SWITCH (1 << 12) -# define NV_PGRAPH_INTR_EN_STATE3D (1 << 13) -# define NV_PGRAPH_INTR_EN_BUFFER_NOTIFY (1 << 16) -# define NV_PGRAPH_INTR_EN_ERROR (1 << 20) -# define NV_PGRAPH_INTR_EN_SINGLE_STEP (1 << 24) -#define NV_PGRAPH_CTX_CONTROL 0x00000144 -# define NV_PGRAPH_CTX_CONTROL_MINIMUM_TIME 0x00000003 -# define NV_PGRAPH_CTX_CONTROL_TIME (1 << 8) -# define NV_PGRAPH_CTX_CONTROL_CHID (1 << 16) -# define NV_PGRAPH_CTX_CONTROL_CHANGE (1 << 20) -# define NV_PGRAPH_CTX_CONTROL_SWITCHING (1 << 24) -# define NV_PGRAPH_CTX_CONTROL_DEVICE (1 << 28) -#define NV_PGRAPH_CTX_USER 0x00000148 -# define NV_PGRAPH_CTX_USER_CHANNEL_3D (1 << 0) -# define NV_PGRAPH_CTX_USER_CHANNEL_3D_VALID (1 << 4) -# define NV_PGRAPH_CTX_USER_SUBCH 0x0000E000 -# define NV_PGRAPH_CTX_USER_CHID 0x1F000000 -# define NV_PGRAPH_CTX_USER_SINGLE_STEP (1 << 31) -#define NV_PGRAPH_CTX_SWITCH1 0x0000014C -# define NV_PGRAPH_CTX_SWITCH1_GRCLASS 0x000000FF -# define NV_PGRAPH_CTX_SWITCH1_CHROMA_KEY (1 << 12) -# define NV_PGRAPH_CTX_SWITCH1_SWIZZLE (1 << 14) -# define NV_PGRAPH_CTX_SWITCH1_PATCH_CONFIG 0x00038000 -# define NV_PGRAPH_CTX_SWITCH1_SYNCHRONIZE (1 << 18) -# define NV_PGRAPH_CTX_SWITCH1_ENDIAN_MODE (1 << 19) -# define NV_PGRAPH_CTX_SWITCH1_CLASS_TYPE (1 << 22) -# define NV_PGRAPH_CTX_SWITCH1_SINGLE_STEP (1 << 23) -# define NV_PGRAPH_CTX_SWITCH1_PATCH_STATUS (1 << 24) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_SURFACE0 (1 << 25) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_SURFACE1 (1 << 26) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_PATTERN (1 << 27) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_ROP (1 << 28) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_BETA1 (1 << 29) -# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_BETA4 (1 << 30) -# define NV_PGRAPH_CTX_SWITCH1_VOLATILE_RESET (1 << 31) -#define NV_PGRAPH_CTX_SWITCH2 0x00000150 -#define NV_PGRAPH_CTX_SWITCH3 0x00000154 -#define NV_PGRAPH_CTX_SWITCH4 0x00000158 -#define NV_PGRAPH_STATUS 0x00000700 -#define NV_PGRAPH_TRAPPED_ADDR 0x00000704 -# define NV_PGRAPH_TRAPPED_ADDR_MTHD 0x00001FFF -# define NV_PGRAPH_TRAPPED_ADDR_SUBCH 0x00070000 -# define NV_PGRAPH_TRAPPED_ADDR_CHID 0x01F00000 -# define NV_PGRAPH_TRAPPED_ADDR_DHV 0x10000000 -#define NV_PGRAPH_TRAPPED_DATA_LOW 0x00000708 -#define NV_PGRAPH_SURFACE 0x00000710 -# define NV_PGRAPH_SURFACE_WRITE_3D 0x00700000 -# define NV_PGRAPH_SURFACE_READ_3D 0x07000000 -# define NV_PGRAPH_SURFACE_MODULO_3D 0x70000000 -#define NV_PGRAPH_INCREMENT 0x0000071C -# define NV_PGRAPH_INCREMENT_READ_BLIT (1 << 0) -# define NV_PGRAPH_INCREMENT_READ_3D (1 << 1) -#define NV_PGRAPH_FIFO 0x00000720 -# define NV_PGRAPH_FIFO_ACCESS (1 << 0) -#define NV_PGRAPH_RDI_INDEX 0x00000750 -#define NV_PGRAPH_RDI_DATA 0x00000754 -#define NV_PGRAPH_FFINTFC_ST2 0x00000764 -#define NV_PGRAPH_CHANNEL_CTX_TABLE 0x00000780 -# define NV_PGRAPH_CHANNEL_CTX_TABLE_INST 0x0000FFFF -#define NV_PGRAPH_CHANNEL_CTX_POINTER 0x00000784 -# define NV_PGRAPH_CHANNEL_CTX_POINTER_INST 0x0000FFFF -#define NV_PGRAPH_CHANNEL_CTX_TRIGGER 0x00000788 -# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_READ_IN (1 << 0) -# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_WRITE_OUT (1 << 1) -#define NV_PGRAPH_DEBUG_2 0x00000880 -#define NV_PGRAPH_TTILE(i) 0x00000900 + (i * 0x10) -#define NV_PGRAPH_TLIMIT(i) 0x00000904 + (i * 0x10) -#define NV_PGRAPH_TSIZE(i) 0x00000908 + (i * 0x10) -#define NV_PGRAPH_TSTATUS(i) 0x0000090C + (i * 0x10) -#define NV_PGRAPH_ZCOMP(i) 0x00000980 + (i * 4) -#define NV_PGRAPH_ZCOMP_OFFSET 0x000009A0 -#define NV_PGRAPH_FBCFG0 0x000009A4 -#define NV_PGRAPH_FBCFG1 0x000009A8 -#define NV_PGRAPH_DEBUG_6 0x00000B80 -#define NV_PGRAPH_DEBUG_7 0x00000B84 -#define NV_PGRAPH_DEBUG_10 0x00000B88 -#define NV_PGRAPH_CSV0_D 0x00000FB4 -# define NV_PGRAPH_CSV0_D_LIGHTS 0x0000FFFF -# define NV_PGRAPH_CSV0_D_LIGHT0 0x00000003 -# define NV_PGRAPH_CSV0_D_LIGHT0_OFF 0 -# define NV_PGRAPH_CSV0_D_LIGHT0_INFINITE 1 -# define NV_PGRAPH_CSV0_D_LIGHT0_LOCAL 2 -# define NV_PGRAPH_CSV0_D_LIGHT0_SPOT 3 -# define NV_PGRAPH_CSV0_D_RANGE_MODE (1 << 18) -# define NV_PGRAPH_CSV0_D_FOGENABLE (1 << 19) -# define NV_PGRAPH_CSV0_D_TEXGEN_REF (1 << 20) -# define NV_PGRAPH_CSV0_D_TEXGEN_REF_LOCAL_VIEWER 0 -# define NV_PGRAPH_CSV0_D_TEXGEN_REF_INFINITE_VIEWER 1 -# define NV_PGRAPH_CSV0_D_FOG_MODE (1 << 21) -# define NV_PGRAPH_CSV0_D_FOG_MODE_LINEAR 0 -# define NV_PGRAPH_CSV0_D_FOG_MODE_EXP 1 -# define NV_PGRAPH_CSV0_D_FOGGENMODE 0x01C00000 -# define NV_PGRAPH_CSV0_D_FOGGENMODE_SPEC_ALPHA 0 -# define NV_PGRAPH_CSV0_D_FOGGENMODE_RADIAL 1 -# define NV_PGRAPH_CSV0_D_FOGGENMODE_PLANAR 2 -# define NV_PGRAPH_CSV0_D_FOGGENMODE_ABS_PLANAR 3 -# define NV_PGRAPH_CSV0_D_FOGGENMODE_FOG_X 4 -# define NV_PGRAPH_CSV0_D_MODE 0xC0000000 -# define NV_PGRAPH_CSV0_D_SKIN 0x1C000000 -# define NV_PGRAPH_CSV0_D_SKIN_OFF 0 -# define NV_PGRAPH_CSV0_D_SKIN_2G 1 -# define NV_PGRAPH_CSV0_D_SKIN_2 2 -# define NV_PGRAPH_CSV0_D_SKIN_3G 3 -# define NV_PGRAPH_CSV0_D_SKIN_3 4 -# define NV_PGRAPH_CSV0_D_SKIN_4G 5 -# define NV_PGRAPH_CSV0_D_SKIN_4 6 -#define NV_PGRAPH_CSV0_C 0x00000FB8 -# define NV_PGRAPH_CSV0_C_CHEOPS_PROGRAM_START 0x0000FF00 -# define NV_PGRAPH_CSV0_C_NORMALIZATION_ENABLE (1 << 27) -# define NV_PGRAPH_CSV0_C_LIGHTING (1 << 31) -#define NV_PGRAPH_CSV1_B 0x00000FBC -#define NV_PGRAPH_CSV1_A 0x00000FC0 -# define NV_PGRAPH_CSV1_A_T0_ENABLE (1 << 0) -# define NV_PGRAPH_CSV1_A_T0_MODE (1 << 1) -# define NV_PGRAPH_CSV1_A_T0_TEXTURE (1 << 2) -# define NV_PGRAPH_CSV1_A_T0_TEXTURE_2D 0 -# define NV_PGRAPH_CSV1_A_T0_TEXTURE_3D 1 -# define NV_PGRAPH_CSV1_A_T0_S 0x00000070 -# define NV_PGRAPH_CSV1_A_T0_S_DISABLE 0 -# define NV_PGRAPH_CSV1_A_T0_S_NORMAL_MAP 4 -# define NV_PGRAPH_CSV1_A_T0_S_REFLECTION_MAP 5 -# define NV_PGRAPH_CSV1_A_T0_S_EYE_LINEAR 1 -# define NV_PGRAPH_CSV1_A_T0_S_OBJECT_LINEAR 2 -# define NV_PGRAPH_CSV1_A_T0_S_SPHERE_MAP 3 -# define NV_PGRAPH_CSV1_A_T0_T 0x00000380 -# define NV_PGRAPH_CSV1_A_T0_R 0x00001C00 -# define NV_PGRAPH_CSV1_A_T0_Q 0x0000E000 -# define NV_PGRAPH_CSV1_A_T1_ENABLE (1 << 16) -# define NV_PGRAPH_CSV1_A_T1_MODE (1 << 17) -# define NV_PGRAPH_CSV1_A_T1_TEXTURE (1 << 18) -# define NV_PGRAPH_CSV1_A_T1_S 0x00700000 -# define NV_PGRAPH_CSV1_A_T1_T 0x03800000 -# define NV_PGRAPH_CSV1_A_T1_R 0x1C000000 -# define NV_PGRAPH_CSV1_A_T1_Q 0xE0000000 -#define NV_PGRAPH_CHEOPS_OFFSET 0x00000FC4 -# define NV_PGRAPH_CHEOPS_OFFSET_PROG_LD_PTR 0x000000FF -# define NV_PGRAPH_CHEOPS_OFFSET_CONST_LD_PTR 0x0000FF00 -#define NV_PGRAPH_BLEND 0x00001804 -# define NV_PGRAPH_BLEND_EQN 0x00000007 -# define NV_PGRAPH_BLEND_EN (1 << 3) -# define NV_PGRAPH_BLEND_SFACTOR 0x000000F0 -# define NV_PGRAPH_BLEND_SFACTOR_ZERO 0 -# define NV_PGRAPH_BLEND_SFACTOR_ONE 1 -# define NV_PGRAPH_BLEND_SFACTOR_SRC_COLOR 2 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_SRC_COLOR 3 -# define NV_PGRAPH_BLEND_SFACTOR_SRC_ALPHA 4 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_SRC_ALPHA 5 -# define NV_PGRAPH_BLEND_SFACTOR_DST_ALPHA 6 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_DST_ALPHA 7 -# define NV_PGRAPH_BLEND_SFACTOR_DST_COLOR 8 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_DST_COLOR 9 -# define NV_PGRAPH_BLEND_SFACTOR_SRC_ALPHA_SATURATE 10 -# define NV_PGRAPH_BLEND_SFACTOR_CONSTANT_COLOR 12 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_CONSTANT_COLOR 13 -# define NV_PGRAPH_BLEND_SFACTOR_CONSTANT_ALPHA 14 -# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_CONSTANT_ALPHA 15 -# define NV_PGRAPH_BLEND_DFACTOR 0x00000F00 -# define NV_PGRAPH_BLEND_DFACTOR_ZERO 0 -# define NV_PGRAPH_BLEND_DFACTOR_ONE 1 -# define NV_PGRAPH_BLEND_DFACTOR_SRC_COLOR 2 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_SRC_COLOR 3 -# define NV_PGRAPH_BLEND_DFACTOR_SRC_ALPHA 4 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_SRC_ALPHA 5 -# define NV_PGRAPH_BLEND_DFACTOR_DST_ALPHA 6 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_DST_ALPHA 7 -# define NV_PGRAPH_BLEND_DFACTOR_DST_COLOR 8 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_DST_COLOR 9 -# define NV_PGRAPH_BLEND_DFACTOR_SRC_ALPHA_SATURATE 10 -# define NV_PGRAPH_BLEND_DFACTOR_CONSTANT_COLOR 12 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_CONSTANT_COLOR 13 -# define NV_PGRAPH_BLEND_DFACTOR_CONSTANT_ALPHA 14 -# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_CONSTANT_ALPHA 15 -# define NV_PGRAPH_BLEND_LOGICOP_ENABLE (1 << 16) -# define NV_PGRAPH_BLEND_LOGICOP 0x0000F000 -#define NV_PGRAPH_BLENDCOLOR 0x00001808 -#define NV_PGRAPH_BORDERCOLOR0 0x0000180C -#define NV_PGRAPH_BORDERCOLOR1 0x00001810 -#define NV_PGRAPH_BORDERCOLOR2 0x00001814 -#define NV_PGRAPH_BORDERCOLOR3 0x00001818 -#define NV_PGRAPH_BUMPOFFSET1 0x0000184C -#define NV_PGRAPH_BUMPSCALE1 0x00001858 -#define NV_PGRAPH_CLEARRECTX 0x00001864 -# define NV_PGRAPH_CLEARRECTX_XMIN 0x00000FFF -# define NV_PGRAPH_CLEARRECTX_XMAX 0x0FFF0000 -#define NV_PGRAPH_CLEARRECTY 0x00001868 -# define NV_PGRAPH_CLEARRECTY_YMIN 0x00000FFF -# define NV_PGRAPH_CLEARRECTY_YMAX 0x0FFF0000 -#define NV_PGRAPH_COLORCLEARVALUE 0x0000186C -#define NV_PGRAPH_COMBINEFACTOR0 0x00001880 -#define NV_PGRAPH_COMBINEFACTOR1 0x000018A0 -#define NV_PGRAPH_COMBINEALPHAI0 0x000018C0 -#define NV_PGRAPH_COMBINEALPHAO0 0x000018E0 -#define NV_PGRAPH_COMBINECOLORI0 0x00001900 -#define NV_PGRAPH_COMBINECOLORO0 0x00001920 -#define NV_PGRAPH_COMBINECTL 0x00001940 -#define NV_PGRAPH_COMBINESPECFOG0 0x00001944 -#define NV_PGRAPH_COMBINESPECFOG1 0x00001948 -#define NV_PGRAPH_CONTROL_0 0x0000194C -# define NV_PGRAPH_CONTROL_0_ALPHAREF 0x000000FF -# define NV_PGRAPH_CONTROL_0_ALPHAFUNC 0x00000F00 -# define NV_PGRAPH_CONTROL_0_ALPHATESTENABLE (1 << 12) -# define NV_PGRAPH_CONTROL_0_ZENABLE (1 << 14) -# define NV_PGRAPH_CONTROL_0_ZFUNC 0x000F0000 -# define NV_PGRAPH_CONTROL_0_ZFUNC_NEVER 0 -# define NV_PGRAPH_CONTROL_0_ZFUNC_LESS 1 -# define NV_PGRAPH_CONTROL_0_ZFUNC_EQUAL 2 -# define NV_PGRAPH_CONTROL_0_ZFUNC_LEQUAL 3 -# define NV_PGRAPH_CONTROL_0_ZFUNC_GREATER 4 -# define NV_PGRAPH_CONTROL_0_ZFUNC_NOTEQUAL 5 -# define NV_PGRAPH_CONTROL_0_ZFUNC_GEQUAL 6 -# define NV_PGRAPH_CONTROL_0_ZFUNC_ALWAYS 7 -# define NV_PGRAPH_CONTROL_0_DITHERENABLE (1 << 22) -# define NV_PGRAPH_CONTROL_0_Z_PERSPECTIVE_ENABLE (1 << 23) -# define NV_PGRAPH_CONTROL_0_ZWRITEENABLE (1 << 24) -# define NV_PGRAPH_CONTROL_0_STENCIL_WRITE_ENABLE (1 << 25) -# define NV_PGRAPH_CONTROL_0_ALPHA_WRITE_ENABLE (1 << 26) -# define NV_PGRAPH_CONTROL_0_RED_WRITE_ENABLE (1 << 27) -# define NV_PGRAPH_CONTROL_0_GREEN_WRITE_ENABLE (1 << 28) -# define NV_PGRAPH_CONTROL_0_BLUE_WRITE_ENABLE (1 << 29) -#define NV_PGRAPH_CONTROL_1 0x00001950 -# define NV_PGRAPH_CONTROL_1_STENCIL_TEST_ENABLE (1 << 0) -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC 0x000000F0 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_NEVER 0 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_LESS 1 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_EQUAL 2 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_LEQUAL 3 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_GREATER 4 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_NOTEQUAL 5 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_GEQUAL 6 -# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_ALWAYS 7 -# define NV_PGRAPH_CONTROL_1_STENCIL_REF 0x0000FF00 -# define NV_PGRAPH_CONTROL_1_STENCIL_MASK_READ 0x00FF0000 -# define NV_PGRAPH_CONTROL_1_STENCIL_MASK_WRITE 0xFF000000 -#define NV_PGRAPH_CONTROL_2 0x00001954 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_FAIL 0x0000000F -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_ZFAIL 0x000000F0 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_ZPASS 0x00000F00 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_KEEP 1 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_ZERO 2 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_REPLACE 3 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INCRSAT 4 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_DECRSAT 5 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INVERT 6 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INCR 7 -# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_DECR 8 -#define NV_PGRAPH_CONTROL_3 0x00001958 -# define NV_PGRAPH_CONTROL_3_FOGENABLE (1 << 8) -# define NV_PGRAPH_CONTROL_3_FOG_MODE 0x00070000 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_LINEAR 0 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP 1 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP2 3 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP_ABS 5 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP2_ABS 7 -# define NV_PGRAPH_CONTROL_3_FOG_MODE_LINEAR_ABS 4 -#define NV_PGRAPH_FOGCOLOR 0x00001980 -# define NV_PGRAPH_FOGCOLOR_RED 0x00FF0000 -# define NV_PGRAPH_FOGCOLOR_GREEN 0x0000FF00 -# define NV_PGRAPH_FOGCOLOR_BLUE 0x000000FF -# define NV_PGRAPH_FOGCOLOR_ALPHA 0xFF000000 -#define NV_PGRAPH_FOGPARAM0 0x00001984 -#define NV_PGRAPH_FOGPARAM1 0x00001988 -#define NV_PGRAPH_SETUPRASTER 0x00001990 -# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE 0x00000003 -# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_FILL 0 -# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_POINT 1 -# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_LINE 2 -# define NV_PGRAPH_SETUPRASTER_BACKFACEMODE 0x0000000C -# define NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE (1 << 6) -# define NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE (1 << 7) -# define NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE (1 << 8) -# define NV_PGRAPH_SETUPRASTER_CULLCTRL 0x00600000 -# define NV_PGRAPH_SETUPRASTER_CULLCTRL_FRONT 1 -# define NV_PGRAPH_SETUPRASTER_CULLCTRL_BACK 2 -# define NV_PGRAPH_SETUPRASTER_CULLCTRL_FRONT_AND_BACK 3 -# define NV_PGRAPH_SETUPRASTER_FRONTFACE (1 << 23) -# define NV_PGRAPH_SETUPRASTER_CULLENABLE (1 << 28) -# define NV_PGRAPH_SETUPRASTER_Z_FORMAT (1 << 29) -#define NV_PGRAPH_SHADERCLIPMODE 0x00001994 -#define NV_PGRAPH_SHADERCTL 0x00001998 -#define NV_PGRAPH_SHADERPROG 0x0000199C -#define NV_PGRAPH_SHADOWZSLOPETHRESHOLD 0x000019A8 -#define NV_PGRAPH_SPECFOGFACTOR0 0x000019AC -#define NV_PGRAPH_SPECFOGFACTOR1 0x000019B0 -#define NV_PGRAPH_TEXADDRESS0 0x000019BC -# define NV_PGRAPH_TEXADDRESS0_ADDRU 0x00000007 -# define NV_PGRAPH_TEXADDRESS0_ADDRU_WRAP 1 -# define NV_PGRAPH_TEXADDRESS0_ADDRU_MIRROR 2 -# define NV_PGRAPH_TEXADDRESS0_ADDRU_CLAMP_TO_EDGE 3 -# define NV_PGRAPH_TEXADDRESS0_ADDRU_BORDER 4 -# define NV_PGRAPH_TEXADDRESS0_ADDRU_CLAMP_OGL 5 -# define NV_PGRAPH_TEXADDRESS0_WRAP_U (1 << 4) -# define NV_PGRAPH_TEXADDRESS0_ADDRV 0x00000700 -# define NV_PGRAPH_TEXADDRESS0_WRAP_V (1 << 12) -# define NV_PGRAPH_TEXADDRESS0_ADDRP 0x00070000 -# define NV_PGRAPH_TEXADDRESS0_WRAP_P (1 << 20) -# define NV_PGRAPH_TEXADDRESS0_WRAP_Q (1 << 24) -#define NV_PGRAPH_TEXADDRESS1 0x000019C0 -#define NV_PGRAPH_TEXADDRESS2 0x000019C4 -#define NV_PGRAPH_TEXADDRESS3 0x000019C8 -#define NV_PGRAPH_TEXCTL0_0 0x000019CC -# define NV_PGRAPH_TEXCTL0_0_ALPHAKILLEN (1 << 2) -# define NV_PGRAPH_TEXCTL0_0_MAX_LOD_CLAMP 0x0003FFC0 -# define NV_PGRAPH_TEXCTL0_0_MIN_LOD_CLAMP 0x3FFC0000 -# define NV_PGRAPH_TEXCTL0_0_ENABLE (1 << 30) -#define NV_PGRAPH_TEXCTL0_1 0x000019D0 -#define NV_PGRAPH_TEXCTL0_2 0x000019D4 -#define NV_PGRAPH_TEXCTL0_3 0x000019D8 -#define NV_PGRAPH_TEXCTL1_0 0x000019DC -# define NV_PGRAPH_TEXCTL1_0_IMAGE_PITCH 0xFFFF0000 -#define NV_PGRAPH_TEXCTL1_1 0x000019E0 -#define NV_PGRAPH_TEXCTL1_2 0x000019E4 -#define NV_PGRAPH_TEXCTL1_3 0x000019E8 -#define NV_PGRAPH_TEXCTL2_0 0x000019EC -#define NV_PGRAPH_TEXCTL2_1 0x000019F0 -#define NV_PGRAPH_TEXFILTER0 0x000019F4 -# define NV_PGRAPH_TEXFILTER0_MIPMAP_LOD_BIAS 0x00001FFF -# define NV_PGRAPH_TEXFILTER0_MIN 0x003F0000 -# define NV_PGRAPH_TEXFILTER0_MIN_BOX_LOD0 1 -# define NV_PGRAPH_TEXFILTER0_MIN_TENT_LOD0 2 -# define NV_PGRAPH_TEXFILTER0_MIN_BOX_NEARESTLOD 3 -# define NV_PGRAPH_TEXFILTER0_MIN_TENT_NEARESTLOD 4 -# define NV_PGRAPH_TEXFILTER0_MIN_BOX_TENT_LOD 5 -# define NV_PGRAPH_TEXFILTER0_MIN_TENT_TENT_LOD 6 -# define NV_PGRAPH_TEXFILTER0_MIN_CONVOLUTION_2D_LOD0 7 -# define NV_PGRAPH_TEXFILTER0_MAG 0x0F000000 -# define NV_PGRAPH_TEXFILTER0_ASIGNED (1 << 28) -# define NV_PGRAPH_TEXFILTER0_RSIGNED (1 << 29) -# define NV_PGRAPH_TEXFILTER0_GSIGNED (1 << 30) -# define NV_PGRAPH_TEXFILTER0_BSIGNED (1 << 31) -#define NV_PGRAPH_TEXFILTER1 0x000019F8 -#define NV_PGRAPH_TEXFILTER2 0x000019FC -#define NV_PGRAPH_TEXFILTER3 0x00001A00 -#define NV_PGRAPH_TEXFMT0 0x00001A04 -# define NV_PGRAPH_TEXFMT0_CONTEXT_DMA (1 << 1) -# define NV_PGRAPH_TEXFMT0_CUBEMAPENABLE (1 << 2) -# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE (1 << 3) -# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE_TEXTURE 0 -# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE_COLOR 1 -# define NV_PGRAPH_TEXFMT0_DIMENSIONALITY 0x000000C0 -# define NV_PGRAPH_TEXFMT0_COLOR 0x00007F00 -# define NV_PGRAPH_TEXFMT0_MIPMAP_LEVELS 0x000F0000 -# define NV_PGRAPH_TEXFMT0_BASE_SIZE_U 0x00F00000 -# define NV_PGRAPH_TEXFMT0_BASE_SIZE_V 0x0F000000 -# define NV_PGRAPH_TEXFMT0_BASE_SIZE_P 0xF0000000 -#define NV_PGRAPH_TEXFMT1 0x00001A08 -#define NV_PGRAPH_TEXFMT2 0x00001A0C -#define NV_PGRAPH_TEXFMT3 0x00001A10 -#define NV_PGRAPH_TEXIMAGERECT0 0x00001A14 -# define NV_PGRAPH_TEXIMAGERECT0_WIDTH 0x1FFF0000 -# define NV_PGRAPH_TEXIMAGERECT0_HEIGHT 0x00001FFF -#define NV_PGRAPH_TEXIMAGERECT1 0x00001A18 -#define NV_PGRAPH_TEXIMAGERECT2 0x00001A1C -#define NV_PGRAPH_TEXIMAGERECT3 0x00001A20 -#define NV_PGRAPH_TEXOFFSET0 0x00001A24 -#define NV_PGRAPH_TEXOFFSET1 0x00001A28 -#define NV_PGRAPH_TEXOFFSET2 0x00001A2C -#define NV_PGRAPH_TEXOFFSET3 0x00001A30 -#define NV_PGRAPH_TEXPALETTE0 0x00001A34 -# define NV_PGRAPH_TEXPALETTE0_CONTEXT_DMA (1 << 0) -# define NV_PGRAPH_TEXPALETTE0_LENGTH 0x0000000C -# define NV_PGRAPH_TEXPALETTE0_LENGTH_256 0 -# define NV_PGRAPH_TEXPALETTE0_LENGTH_128 1 -# define NV_PGRAPH_TEXPALETTE0_LENGTH_64 2 -# define NV_PGRAPH_TEXPALETTE0_LENGTH_32 3 -# define NV_PGRAPH_TEXPALETTE0_OFFSET 0xFFFFFFC0 -#define NV_PGRAPH_TEXPALETTE1 0x00001A38 -#define NV_PGRAPH_TEXPALETTE2 0x00001A3C -#define NV_PGRAPH_TEXPALETTE3 0x00001A40 -#define NV_PGRAPH_ZSTENCILCLEARVALUE 0x00001A88 -#define NV_PGRAPH_ZCLIPMIN 0x00001A90 -#define NV_PGRAPH_ZOFFSETBIAS 0x00001AA4 -#define NV_PGRAPH_ZOFFSETFACTOR 0x00001AA8 -#define NV_PGRAPH_EYEVEC0 0x00001AAC -#define NV_PGRAPH_EYEVEC1 0x00001AB0 -#define NV_PGRAPH_EYEVEC2 0x00001AB4 -#define NV_PGRAPH_ZCLIPMAX 0x00001ABC +#undef USE_TEXTURE_CACHE +#if __cplusplus >= 201402L +# define NV2A_CONSTEXPR constexpr +#else +# define NV2A_CONSTEXPR static +#endif -#define NV_PCRTC_INTR_0 0x00000100 -# define NV_PCRTC_INTR_0_VBLANK (1 << 0) -#define NV_PCRTC_INTR_EN_0 0x00000140 -# define NV_PCRTC_INTR_EN_0_VBLANK (1 << 0) -#define NV_PCRTC_START 0x00000800 -#define NV_PCRTC_CONFIG 0x00000804 +// GCC implementation of FFS +static int ffs(int valu) +{ + int bit; + if (valu == 0) + return 0; -#define NV_PVIDEO_DEBUG_2 0x00000088 -#define NV_PVIDEO_DEBUG_3 0x0000008C -#define NV_PVIDEO_INTR 0x00000100 -# define NV_PVIDEO_INTR_BUFFER_0 (1 << 0) -# define NV_PVIDEO_INTR_BUFFER_1 (1 << 4) -#define NV_PVIDEO_INTR_EN 0x00000140 -# define NV_PVIDEO_INTR_EN_BUFFER_0 (1 << 0) -# define NV_PVIDEO_INTR_EN_BUFFER_1 (1 << 4) -#define NV_PVIDEO_BUFFER 0x00000700 -# define NV_PVIDEO_BUFFER_0_USE (1 << 0) -# define NV_PVIDEO_BUFFER_1_USE (1 << 4) -#define NV_PVIDEO_STOP 0x00000704 -#define NV_PVIDEO_BASE(i) 0x00000900 + (i * 4) -#define NV_PVIDEO_LIMIT(i) 0x00000908 + (i * 4) -#define NV_PVIDEO_LUMINANCE(i) 0x00000910 + (i * 4) -#define NV_PVIDEO_CHROMINANCE(i) 0x00000918 + (i * 4) -#define NV_PVIDEO_OFFSET(i) 0x00000920 + (i * 4) -#define NV_PVIDEO_SIZE_IN(i) 0x00000928 + (i * 4) -# define NV_PVIDEO_SIZE_IN_WIDTH 0x000007FF -# define NV_PVIDEO_SIZE_IN_HEIGHT 0x07FF0000 -#define NV_PVIDEO_POINT_IN(i) 0x00000930 + (i * 4) -# define NV_PVIDEO_POINT_IN_S 0x00007FFF -# define NV_PVIDEO_POINT_IN_T 0xFFFE0000 -#define NV_PVIDEO_DS_DX(i) 0x00000938 + (i * 4) -#define NV_PVIDEO_DT_DY(i) 0x00000940 + (i * 4) -#define NV_PVIDEO_POINT_OUT(i) 0x00000948 + (i * 4) -# define NV_PVIDEO_POINT_OUT_X 0x00000FFF -# define NV_PVIDEO_POINT_OUT_Y 0x0FFF0000 -#define NV_PVIDEO_SIZE_OUT(i) 0x00000950 + (i * 4) -# define NV_PVIDEO_SIZE_OUT_WIDTH 0x00000FFF -# define NV_PVIDEO_SIZE_OUT_HEIGHT 0x0FFF0000 -#define NV_PVIDEO_FORMAT(i) 0x00000958 + (i * 4) -# define NV_PVIDEO_FORMAT_PITCH 0x00001FFF -# define NV_PVIDEO_FORMAT_COLOR 0x00030000 -# define NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8 1 -# define NV_PVIDEO_FORMAT_DISPLAY (1 << 20) -#define NV_PVIDEO_COLOR_KEY(i) 0x00000b00 + (i * 4) + for (bit = 1; !(valu & 1); bit++) + valu >>= 1; + return bit; +} -#define NV_PTIMER_INTR_0 0x00000100 -# define NV_PTIMER_INTR_0_ALARM (1 << 0) -#define NV_PTIMER_INTR_EN_0 0x00000140 -# define NV_PTIMER_INTR_EN_0_ALARM (1 << 0) -#define NV_PTIMER_NUMERATOR 0x00000200 -#define NV_PTIMER_DENOMINATOR 0x00000210 -#define NV_PTIMER_TIME_0 0x00000400 -#define NV_PTIMER_TIME_1 0x00000410 -#define NV_PTIMER_ALARM_0 0x00000420 +#define GET_MASK(v, mask) (((v) & (mask)) >> (ffs(mask)-1)) -#define NV_PRMVIO_MISC__WRITE 0x000c03c2 -#define NV_PRMVIO_SRX 0x000c03c4 -#define NV_PRMVIO_SR 0x000c03c5 -# define NV_VIO_SR_RESET_INDEX 0x00 -# define NV_VIO_SR_CLOCK_INDEX 0x01 -# define NV_VIO_SR_PLANE_MASK_INDEX 0x02 -# define NV_VIO_SR_CHAR_MAP_INDEX 0x03 -# define NV_VIO_SR_MEM_MODE_INDEX 0x04 -#define NV_PRMVIO_MISC__READ 0x000c03cc -#define NV_PRMVIO_GRX 0x000c03ce -#define NV_PRMVIO_GX 0x000c03cf -# define NV_VIO_GX_SR_INDEX 0x00 -# define NV_VIO_GX_SREN_INDEX 0x01 -# define NV_VIO_GX_CCOMP_INDEX 0x02 -# define NV_VIO_GX_ROP_INDEX 0x03 -# define NV_VIO_GX_READ_MAP_INDEX 0x04 -# define NV_VIO_GX_MODE_INDEX 0x05 -# define NV_VIO_GX_MISC_INDEX 0x06 -# define NV_VIO_GX_DONT_CARE_INDEX 0x07 -# define NV_VIO_GX_BIT_MASK_INDEX 0x08 +#define SET_MASK(v, mask, val) \ + do { \ + const unsigned int __val = (val); \ + const unsigned int __mask = (mask); \ + (v) &= ~(__mask); \ + (v) |= ((__val) << (ffs(__mask) - 1)) & (__mask); \ + } while (0) -#define NV_PFB_DEBUG_0 0x00000080 -#define NV_PFB_CFG0 0x00000200 -# define NV_PFB_CFG0_PART 0x00000003 -#define NV_PFB_CFG1 0x00000204 -#define NV_PFB_CSTATUS 0x0000020C -#define NV_PFB_REFCTRL 0x00000210 -#define NV_PFB_NVM 0x00000214 // NV_PFB_NVM_MODE_DISABLE -#define NV_PFB_PIN 0x00000218 -#define NV_PFB_PAD 0x0000021C -#define NV_PFB_TIMING0 0x00000220 -#define NV_PFB_TIMING1 0x00000224 -#define NV_PFB_TIMING2 0x00000228 -#define NV_PFB_TILE(i) 0x00000240 + (i * 0x10) -#define NV_PFB_TLIMIT(i) 0x00000244 + (i * 0x10) -#define NV_PFB_TSIZE(i) 0x00000248 + (i * 0x10) -#define NV_PFB_TSTATUS(i) 0x0000024C + (i * 0x10) -#define NV_PFB_MRS 0x000002C0 -#define NV_PFB_EMRS 0x000002C4 -#define NV_PFB_MRS_EXT 0x000002C8 -#define NV_PFB_EMRS_EXT 0x000002CC -#define NV_PFB_REF 0x000002D0 -#define NV_PFB_PRE 0x000002D4 -#define NV_PFB_ZCOMP(i) 0x00000300 + (i * 4) -#define NV_PFB_ZCOMP_OFFSET 0x00000324 -#define NV_PFB_ARB_PREDIVIDER 0x00000328 -#define NV_PFB_ARB_TIMEOUT 0x0000032C -#define NV_PFB_ARB_XFER_REM 0x00000334 -#define NV_PFB_ARB_DIFF_BANK 0x00000338 -#define NV_PFB_CLOSE_PAGE0 0x00000340 -#define NV_PFB_CLOSE_PAGE1 0x00000344 -#define NV_PFB_CLOSE_PAGE2 0x00000348 -#define NV_PFB_BPARB 0x0000034C -#define NV_PFB_CMDQ0 0x00000350 -#define NV_PFB_CMDQ1 0x00000354 -#define NV_PFB_ILL_INSTR 0x00000360 -#define NV_PFB_RT 0x00000400 -#define NV_PFB_AUTOCLOSE 0x00000404 -#define NV_PFB_WBC 0x00000410 -# define NV_PFB_WBC_FLUSH (1 << 16) -#define NV_PFB_CMDQ_PRT 0x00000418 -#define NV_PFB_CPU_RRQ 0x00000420 -#define NV_PFB_BYPASS 0x00000424 +// Power-of-two CASE statements +#define CASE_1(v, step) case (v) +#define CASE_2(v, step) CASE_1(v, step) : CASE_1(v + (step) * 1, step) +#define CASE_4(v, step) CASE_2(v, step) : CASE_2(v + (step) * 2, step) +#define CASE_8(v, step) CASE_4(v, step) : CASE_4(v + (step) * 4, step) +#define CASE_16(v, step) CASE_8(v, step) : CASE_8(v + (step) * 8, step) +#define CASE_32(v, step) CASE_16(v, step) : CASE_16(v + (step) * 16, step) +#define CASE_64(v, step) CASE_32(v, step) : CASE_32(v + (step) * 32, step) +#define CASE_128(v, step) CASE_64(v, step) : CASE_64(v + (step) * 64, step) +#define CASE_256(v, step) CASE_128(v, step) : CASE_128(v + (step) * 128, step) -#define NV_PRAMIN_DMA_CLASS(i) 0x00000000 + (i * 0x10) -#define NV_PRAMIN_DMA_LIMIT(i) 0x00000004 + (i * 0x10) -#define NV_PRAMIN_DMA_START(i) 0x00000008 + (i * 0x10) -#define NV_PRAMIN_DMA_ADDRESS(i) 0x0000000C + (i * 0x10) +// Non-power-of-two CASE statements +#define CASE_3(v, step) CASE_2(v, step) : CASE_1(v + (step) * 2, step) -#define NV_PRAMDAC_NVPLL_COEFF 0x00000500 -# define NV_PRAMDAC_NVPLL_COEFF_MDIV 0x000000FF -# define NV_PRAMDAC_NVPLL_COEFF_NDIV 0x0000FF00 -# define NV_PRAMDAC_NVPLL_COEFF_PDIV 0x00070000 -#define NV_PRAMDAC_MPLL_COEFF 0x00000504 -# define NV_PRAMDAC_MPLL_COEFF_MDIV 0x000000FF -# define NV_PRAMDAC_MPLL_COEFF_NDIV 0x0000FF00 -# define NV_PRAMDAC_MPLL_COEFF_PDIV 0x00070000 -#define NV_PRAMDAC_VPLL_COEFF 0x00000508 -# define NV_PRAMDAC_VPLL_COEFF_MDIV 0x000000FF -# define NV_PRAMDAC_VPLL_COEFF_NDIV 0x0000FF00 -# define NV_PRAMDAC_VPLL_COEFF_PDIV 0x00070000 -#define NV_PRAMDAC_PLL_TEST_COUNTER 0x00000514 -# define NV_PRAMDAC_PLL_TEST_COUNTER_NOOFIPCLKS 0x000003FF -# define NV_PRAMDAC_PLL_TEST_COUNTER_VALUE 0x0000FFFF -# define NV_PRAMDAC_PLL_TEST_COUNTER_ENABLE (1 << 16) -# define NV_PRAMDAC_PLL_TEST_COUNTER_RESET (1 << 20) -# define NV_PRAMDAC_PLL_TEST_COUNTER_SOURCE 0x03000000 -# define NV_PRAMDAC_PLL_TEST_COUNTER_VPLL2_LOCK (1 << 27) -# define NV_PRAMDAC_PLL_TEST_COUNTER_PDIV_RST (1 << 28) -# define NV_PRAMDAC_PLL_TEST_COUNTER_NVPLL_LOCK (1 << 29) -# define NV_PRAMDAC_PLL_TEST_COUNTER_MPLL_LOCK (1 << 30) -# define NV_PRAMDAC_PLL_TEST_COUNTER_VPLL_LOCK (1 << 31) -#define NV_PRAMDAC_GENERAL_CONTROL 0x00680600 -# define NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON (3 << 4) -# define NV_PRAMDAC_GENERAL_CONTROL_VGA_STATE_SEL (1 << 8) -# define NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL (1 << 12) -# define NV_PRAMDAC_GENERAL_CONTROL_TERMINATION_75OHM (2 << 16) -# define NV_PRAMDAC_GENERAL_CONTROL_BPC_8BITS (1 << 20) -# define NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG (2 << 28) +#define NV2A_DEVICE(obj) \ + OBJECT_CHECK(NV2AState, (obj), "nv2a") -#define NV_PRMCIO_ARX 0x006013c0 -#define NV_PRMCIO_AR__WRITE 0x006013c0 -#define NV_PRMCIO_AR__READ 0x006013c1 -# define NV_CIO_AR_MODE_INDEX 0x10 -# define NV_CIO_AR_OSCAN_INDEX 0x11 -# define NV_CIO_AR_PLANE_INDEX 0x12 -# define NV_CIO_AR_HPP_INDEX 0x13 -# define NV_CIO_AR_CSEL_INDEX 0x14 -#define NV_PRMCIO_INP0 0x006013c2 -#define NV_PRMCIO_CRX__COLOR 0x006013d4 -#define NV_PRMCIO_CR__COLOR 0x006013d5 -/* Standard VGA CRTC registers */ -# define NV_CIO_CR_HDT_INDEX 0x00 /* horizontal display total */ -# define NV_CIO_CR_HDE_INDEX 0x01 /* horizontal display end */ -# define NV_CIO_CR_HBS_INDEX 0x02 /* horizontal blanking start */ -# define NV_CIO_CR_HBE_INDEX 0x03 /* horizontal blanking end */ -# define NV_CIO_CR_HBE_4_0 4:0 -# define NV_CIO_CR_HRS_INDEX 0x04 /* horizontal retrace start */ -# define NV_CIO_CR_HRE_INDEX 0x05 /* horizontal retrace end */ -# define NV_CIO_CR_HRE_4_0 4:0 -# define NV_CIO_CR_HRE_HBE_5 7:7 -# define NV_CIO_CR_VDT_INDEX 0x06 /* vertical display total */ -# define NV_CIO_CR_OVL_INDEX 0x07 /* overflow bits */ -# define NV_CIO_CR_OVL_VDT_8 0:0 -# define NV_CIO_CR_OVL_VDE_8 1:1 -# define NV_CIO_CR_OVL_VRS_8 2:2 -# define NV_CIO_CR_OVL_VBS_8 3:3 -# define NV_CIO_CR_OVL_VDT_9 5:5 -# define NV_CIO_CR_OVL_VDE_9 6:6 -# define NV_CIO_CR_OVL_VRS_9 7:7 -# define NV_CIO_CR_RSAL_INDEX 0x08 /* normally "preset row scan" */ -# define NV_CIO_CR_CELL_HT_INDEX 0x09 /* cell height?! normally "max scan line" */ -# define NV_CIO_CR_CELL_HT_VBS_9 5:5 -# define NV_CIO_CR_CELL_HT_SCANDBL 7:7 -# define NV_CIO_CR_CURS_ST_INDEX 0x0a /* cursor start */ -# define NV_CIO_CR_CURS_END_INDEX 0x0b /* cursor end */ -# define NV_CIO_CR_SA_HI_INDEX 0x0c /* screen start address high */ -# define NV_CIO_CR_SA_LO_INDEX 0x0d /* screen start address low */ -# define NV_CIO_CR_TCOFF_HI_INDEX 0x0e /* cursor offset high */ -# define NV_CIO_CR_TCOFF_LO_INDEX 0x0f /* cursor offset low */ -# define NV_CIO_CR_VRS_INDEX 0x10 /* vertical retrace start */ -# define NV_CIO_CR_VRE_INDEX 0x11 /* vertical retrace end */ -# define NV_CIO_CR_VRE_3_0 3:0 -# define NV_CIO_CR_VDE_INDEX 0x12 /* vertical display end */ -# define NV_CIO_CR_OFFSET_INDEX 0x13 /* sets screen pitch */ -# define NV_CIO_CR_ULINE_INDEX 0x14 /* underline location */ -# define NV_CIO_CR_VBS_INDEX 0x15 /* vertical blank start */ -# define NV_CIO_CR_VBE_INDEX 0x16 /* vertical blank end */ -# define NV_CIO_CR_MODE_INDEX 0x17 /* crtc mode control */ -# define NV_CIO_CR_LCOMP_INDEX 0x18 /* line compare */ -/* Extended VGA CRTC registers */ -# define NV_CIO_CRE_RPC0_INDEX 0x19 /* repaint control 0 */ -# define NV_CIO_CRE_RPC0_OFFSET_10_8 7:5 -# define NV_CIO_CRE_RPC1_INDEX 0x1a /* repaint control 1 */ -# define NV_CIO_CRE_RPC1_LARGE 2:2 -# define NV_CIO_CRE_FF_INDEX 0x1b /* fifo control */ -# define NV_CIO_CRE_ENH_INDEX 0x1c /* enhanced? */ -# define NV_CIO_SR_LOCK_INDEX 0x1f /* crtc lock */ -# define NV_CIO_SR_UNLOCK_RW_VALUE 0x57 -# define NV_CIO_SR_LOCK_VALUE 0x99 -# define NV_CIO_CRE_FFLWM__INDEX 0x20 /* fifo low water mark */ -# define NV_CIO_CRE_21 0x21 /* vga shadow crtc lock */ -# define NV_CIO_CRE_LSR_INDEX 0x25 /* ? */ -# define NV_CIO_CRE_LSR_VDT_10 0:0 -# define NV_CIO_CRE_LSR_VDE_10 1:1 -# define NV_CIO_CRE_LSR_VRS_10 2:2 -# define NV_CIO_CRE_LSR_VBS_10 3:3 -# define NV_CIO_CRE_LSR_HBE_6 4:4 -# define NV_CIO_CR_ARX_INDEX 0x26 /* attribute index -- ro copy of 0x60.3c0 */ -# define NV_CIO_CRE_CHIP_ID_INDEX 0x27 /* chip revision */ -# define NV_CIO_CRE_PIXEL_INDEX 0x28 -# define NV_CIO_CRE_PIXEL_FORMAT 1:0 -# define NV_CIO_CRE_HEB__INDEX 0x2d /* horizontal extra bits? */ -# define NV_CIO_CRE_HEB_HDT_8 0:0 -# define NV_CIO_CRE_HEB_HDE_8 1:1 -# define NV_CIO_CRE_HEB_HBS_8 2:2 -# define NV_CIO_CRE_HEB_HRS_8 3:3 -# define NV_CIO_CRE_HEB_ILC_8 4:4 -# define NV_CIO_CRE_2E 0x2e /* some scratch or dummy reg to force writes to sink in */ -# define NV_CIO_CRE_HCUR_ADDR2_INDEX 0x2f /* cursor */ -# define NV_CIO_CRE_HCUR_ADDR0_INDEX 0x30 /* pixmap */ -# define NV_CIO_CRE_HCUR_ADDR0_ADR 6:0 -# define NV_CIO_CRE_HCUR_ASI 7:7 -# define NV_CIO_CRE_HCUR_ADDR1_INDEX 0x31 /* address */ -# define NV_CIO_CRE_HCUR_ADDR1_ENABLE 0:0 -# define NV_CIO_CRE_HCUR_ADDR1_CUR_DBL 1:1 -# define NV_CIO_CRE_HCUR_ADDR1_ADR 7:2 -# define NV_CIO_CRE_LCD__INDEX 0x33 -# define NV_CIO_CRE_LCD_LCD_SELECT 0:0 -# define NV_CIO_CRE_DDC0_STATUS__INDEX 0x36 -# define NV_CIO_CRE_DDC0_WR__INDEX 0x37 -# define NV_CIO_CRE_ILACE__INDEX 0x39 /* interlace */ -# define NV_CIO_CRE_SCRATCH3__INDEX 0x3b -# define NV_CIO_CRE_SCRATCH4__INDEX 0x3c -# define NV_CIO_CRE_DDC_STATUS__INDEX 0x3e -# define NV_CIO_CRE_DDC_WR__INDEX 0x3f -# define NV_CIO_CRE_EBR_INDEX 0x41 /* extra bits ? (vertical) */ -# define NV_CIO_CRE_EBR_VDT_11 0:0 -# define NV_CIO_CRE_EBR_VDE_11 2:2 -# define NV_CIO_CRE_EBR_VRS_11 4:4 -# define NV_CIO_CRE_EBR_VBS_11 6:6 -# define NV_CIO_CRE_43 0x43 -# define NV_CIO_CRE_44 0x44 /* head control */ -# define NV_CIO_CRE_CSB 0x45 /* colour saturation boost */ -# define NV_CIO_CRE_RCR 0x46 -# define NV_CIO_CRE_RCR_ENDIAN_BIG 7:7 -# define NV_CIO_CRE_47 0x47 /* extended fifo lwm, used on nv30+ */ -# define NV_CIO_CRE_49 0x49 -# define NV_CIO_CRE_4B 0x4b /* given patterns in 0x[2-3][a-c] regs, probably scratch 6 */ -# define NV_CIO_CRE_TVOUT_LATENCY 0x52 -# define NV_CIO_CRE_53 0x53 /* `fp_htiming' according to Haiku */ -# define NV_CIO_CRE_54 0x54 /* `fp_vtiming' according to Haiku */ -# define NV_CIO_CRE_57 0x57 /* index reg for cr58 */ -# define NV_CIO_CRE_58 0x58 /* data reg for cr57 */ -# define NV_CIO_CRE_59 0x59 /* related to on/off-chip-ness of digital outputs */ -# define NV_CIO_CRE_5B 0x5B /* newer colour saturation reg */ -# define NV_CIO_CRE_85 0x85 -# define NV_CIO_CRE_86 0x86 -#define NV_PRMCIO_INP0__COLOR 0x006013da +//void reg_log_read(int block, hwaddr addr, uint64_t val); +//void reg_log_write(int block, hwaddr addr, uint64_t val); -#define NV_USER_DMA_PUT 0x40 -#define NV_USER_DMA_GET 0x44 -#define NV_USER_REF 0x48 +enum FIFOEngine { + ENGINE_SOFTWARE = 0, + ENGINE_GRAPHICS = 1, + ENGINE_DVD = 2, +}; +typedef struct DMAObject { + unsigned int dma_class; + unsigned int dma_target; + xbaddr address; + xbaddr limit; +} DMAObject; +typedef struct VertexAttribute { + bool dma_select; + xbaddr offset; -/* DMA objects */ -#define NV_DMA_FROM_MEMORY_CLASS 0x02 -#define NV_DMA_TO_MEMORY_CLASS 0x03 -#define NV_DMA_IN_MEMORY_CLASS 0x3d + /* inline arrays are packed in order? + * Need to pass the offset to converted attributes */ + unsigned int inline_array_offset; -#define NV_DMA_CLASS 0x00000FFF -#define NV_DMA_PAGE_TABLE (1 << 12) -#define NV_DMA_PAGE_ENTRY (1 << 13) -#define NV_DMA_FLAGS_ACCESS (1 << 14) -#define NV_DMA_FLAGS_MAPPING_COHERENCY (1 << 15) -#define NV_DMA_TARGET 0x00030000 -# define NV_DMA_TARGET_NVM 0x00000000 -# define NV_DMA_TARGET_NVM_TILED 0x00010000 -# define NV_DMA_TARGET_PCI 0x00020000 -# define NV_DMA_TARGET_AGP 0x00030000 -#define NV_DMA_ADJUST 0xFFF00000 + float inline_value[4]; -#define NV_DMA_ADDRESS 0xFFFFF000 + unsigned int format; + unsigned int size; /* size of the data type */ + unsigned int count; /* number of components */ + uint32_t stride; + bool needs_conversion; + uint8_t *converted_buffer; + unsigned int converted_elements; + unsigned int converted_size; + unsigned int converted_count; -#define NV_RAMHT_HANDLE 0xFFFFFFFF -#define NV_RAMHT_INSTANCE 0x0000FFFF -#define NV_RAMHT_ENGINE 0x00030000 -# define NV_RAMHT_ENGINE_SW 0x00000000 -# define NV_RAMHT_ENGINE_GRAPHICS 0x00010000 -# define NV_RAMHT_ENGINE_DVD 0x00020000 -#define NV_RAMHT_CHID 0x1F000000 -#define NV_RAMHT_STATUS 0x80000000 + float *inline_buffer; + GLint gl_count; + GLenum gl_type; + GLboolean gl_normalize; + GLuint gl_converted_buffer; + GLuint gl_inline_buffer; +} VertexAttribute; -/* graphic classes and methods */ -#define NV_SET_OBJECT 0x00000000 +typedef struct Surface { + bool draw_dirty; + bool buffer_dirty; + bool write_enabled_cache; + unsigned int pitch; + xbaddr offset; +} Surface; -#define NV_CONTEXT_SURFACES_2D 0x0062 -# define NV062_SET_CONTEXT_DMA_IMAGE_SOURCE 0x00000184 -# define NV062_SET_CONTEXT_DMA_IMAGE_DESTIN 0x00000188 -# define NV062_SET_COLOR_FORMAT 0x00000300 -# define NV062_SET_COLOR_FORMAT_LE_Y8 0x01 -# define NV062_SET_COLOR_FORMAT_LE_R5G6B5 0x04 -# define NV062_SET_COLOR_FORMAT_LE_A8R8G8B8 0x0A -# define NV062_SET_PITCH 0x00000304 -# define NV062_SET_OFFSET_SOURCE 0x00000308 -# define NV062_SET_OFFSET_DESTIN 0x0000030C +typedef struct SurfaceShape { + unsigned int z_format; + unsigned int color_format; + unsigned int zeta_format; + unsigned int log_width, log_height; + unsigned int clip_x, clip_y; + unsigned int clip_width, clip_height; + unsigned int anti_aliasing; +} SurfaceShape; -#define NV_IMAGE_BLIT 0x009F -# define NV09F_SET_CONTEXT_SURFACES 0x0000019C -# define NV09F_SET_OPERATION 0x000002FC -# define NV09F_SET_OPERATION_SRCCOPY 3 -# define NV09F_CONTROL_POINT_IN 0x00000300 -# define NV09F_CONTROL_POINT_OUT 0x00000304 -# define NV09F_SIZE 0x00000308 +typedef struct TextureShape { + bool cubemap; + unsigned int dimensionality; + unsigned int color_format; + unsigned int levels; + unsigned int width, height, depth; + unsigned int min_mipmap_level, max_mipmap_level; + unsigned int pitch; +} TextureShape; -#define NV_KELVIN_PRIMITIVE 0x0097 -# define NV097_NO_OPERATION 0x00000100 -# define NV097_WAIT_FOR_IDLE 0x00000110 -# define NV097_SET_FLIP_READ 0x00000120 -# define NV097_SET_FLIP_WRITE 0x00000124 -# define NV097_SET_FLIP_MODULO 0x00000128 -# define NV097_FLIP_INCREMENT_WRITE 0x0000012C -# define NV097_FLIP_STALL 0x00000130 -# define NV097_SET_CONTEXT_DMA_NOTIFIES 0x00000180 -# define NV097_SET_CONTEXT_DMA_A 0x00000184 -# define NV097_SET_CONTEXT_DMA_B 0x00000188 -# define NV097_SET_CONTEXT_DMA_STATE 0x00000190 -# define NV097_SET_CONTEXT_DMA_COLOR 0x00000194 -# define NV097_SET_CONTEXT_DMA_ZETA 0x00000198 -# define NV097_SET_CONTEXT_DMA_VERTEX_A 0x0000019C -# define NV097_SET_CONTEXT_DMA_VERTEX_B 0x000001A0 -# define NV097_SET_CONTEXT_DMA_SEMAPHORE 0x000001A4 -# define NV097_SET_CONTEXT_DMA_REPORT 0x000001A8 -# define NV097_SET_SURFACE_CLIP_HORIZONTAL 0x00000200 -# define NV097_SET_SURFACE_CLIP_HORIZONTAL_X 0x0000FFFF -# define NV097_SET_SURFACE_CLIP_HORIZONTAL_WIDTH 0xFFFF0000 -# define NV097_SET_SURFACE_CLIP_VERTICAL 0x00000204 -# define NV097_SET_SURFACE_CLIP_VERTICAL_Y 0x0000FFFF -# define NV097_SET_SURFACE_CLIP_VERTICAL_HEIGHT 0xFFFF0000 -# define NV097_SET_SURFACE_FORMAT 0x00000208 -# define NV097_SET_SURFACE_FORMAT_COLOR 0x0000000F -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_Z1R5G5B5 0x01 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_O1R5G5B5 0x02 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_R5G6B5 0x03 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_Z8R8G8B8 0x04 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_O8R8G8B8 0x05 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8 0x06 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8 0x07 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8 0x08 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_B8 0x09 -# define NV097_SET_SURFACE_FORMAT_COLOR_LE_G8B8 0x0A -# define NV097_SET_SURFACE_FORMAT_ZETA 0x000000F0 -# define NV097_SET_SURFACE_FORMAT_ZETA_Z16 1 -# define NV097_SET_SURFACE_FORMAT_ZETA_Z24S8 2 -# define NV097_SET_SURFACE_FORMAT_TYPE 0x00000F00 -# define NV097_SET_SURFACE_FORMAT_TYPE_PITCH 0x1 -# define NV097_SET_SURFACE_FORMAT_TYPE_SWIZZLE 0x2 -# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING 0x0000F000 -# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_CENTER_1 0 -# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_CENTER_CORNER_2 1 -# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_SQUARE_OFFSET_4 2 -# define NV097_SET_SURFACE_FORMAT_WIDTH 0x00FF0000 -# define NV097_SET_SURFACE_FORMAT_HEIGHT 0xFF000000 -# define NV097_SET_SURFACE_PITCH 0x0000020C -# define NV097_SET_SURFACE_PITCH_COLOR 0x0000FFFF -# define NV097_SET_SURFACE_PITCH_ZETA 0xFFFF0000 -# define NV097_SET_SURFACE_COLOR_OFFSET 0x00000210 -# define NV097_SET_SURFACE_ZETA_OFFSET 0x00000214 -# define NV097_SET_COMBINER_ALPHA_ICW 0x00000260 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP 0xE0000000 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_UNSIGNED_IDENTITY 0 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_UNSIGNED_INVERT 1 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_EXPAND_NORMAL 2 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_EXPAND_NEGATE 3 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_HALFBIAS_NORMAL 4 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_HALFBIAS_NEGATE 5 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_SIGNED_IDENTITY 6 -# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_SIGNED_NEGATE 7 -# define NV097_SET_COMBINER_ALPHA_ICW_A_ALPHA (1<<28) -# define NV097_SET_COMBINER_ALPHA_ICW_A_SOURCE 0x0F000000 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP 0x00E00000 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_UNSIGNED_IDENTITY 0 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_UNSIGNED_INVERT 1 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_EXPAND_NORMAL 2 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_EXPAND_NEGATE 3 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_HALFBIAS_NORMAL 4 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_HALFBIAS_NEGATE 5 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_SIGNED_IDENTITY 6 -# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_SIGNED_NEGATE 7 -# define NV097_SET_COMBINER_ALPHA_ICW_B_ALPHA (1<<20) -# define NV097_SET_COMBINER_ALPHA_ICW_B_SOURCE 0x000F0000 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP 0x0000E000 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_UNSIGNED_IDENTITY 0 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_UNSIGNED_INVERT 1 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_EXPAND_NORMAL 2 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_EXPAND_NEGATE 3 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_HALFBIAS_NORMAL 4 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_HALFBIAS_NEGATE 5 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_SIGNED_IDENTITY 6 -# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_SIGNED_NEGATE 7 -# define NV097_SET_COMBINER_ALPHA_ICW_C_ALPHA (1<<12) -# define NV097_SET_COMBINER_ALPHA_ICW_C_SOURCE 0x00000F00 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP 0x000000E0 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_UNSIGNED_IDENTITY 0 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_UNSIGNED_INVERT 1 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_EXPAND_NORMAL 2 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_EXPAND_NEGATE 3 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_HALFBIAS_NORMAL 4 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_HALFBIAS_NEGATE 5 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_SIGNED_IDENTITY 6 -# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_SIGNED_NEGATE 7 -# define NV097_SET_COMBINER_ALPHA_ICW_D_ALPHA (1<<4) -# define NV097_SET_COMBINER_ALPHA_ICW_D_SOURCE 0x0000000F -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0 0x00000288 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_INVERSE 0xE0000000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_ALPHA (1<<28) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE 0x0F000000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE_REG_SPECLIT 0xE -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE_REG_EF_PROD 0xF -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_INVERSE 0x00E00000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_ALPHA (1<<20) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE 0x000F0000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE_REG_SPECLIT 0xE -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE_REG_EF_PROD 0xF -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_INVERSE 0x0000E000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_ALPHA (1<<12) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE 0x00000F00 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE_REG_SPECLIT 0xE -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE_REG_EF_PROD 0xF -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_INVERSE 0x000000E0 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_ALPHA (1<<4) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE 0x0000000F -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE_REG_SPECLIT 0xE -# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE_REG_EF_PROD 0xF -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1 0x0000028C -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_INVERSE 0xE0000000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_ALPHA (1<<28) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_SOURCE 0x0F000000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_INVERSE 0x00E00000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_ALPHA (1<<20) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_SOURCE 0x000F0000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_INVERSE 0x0000E000 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_ALPHA (1<<12) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_SOURCE 0x00000F00 -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_CLAMP (1<<7) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_ADD_INVERT_R5 (1<<6) -# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_ADD_INVERT_R12 0x0000003F -# define NV097_SET_CONTROL0 0x00000290 -# define NV097_SET_CONTROL0_STENCIL_WRITE_ENABLE (1 << 0) -# define NV097_SET_CONTROL0_Z_FORMAT (1 << 12) -# define NV097_SET_CONTROL0_Z_PERSPECTIVE_ENABLE (1 << 16) -# define NV097_SET_FOG_MODE 0x0000029C -# define NV097_SET_FOG_MODE_V_LINEAR 0x2601 -# define NV097_SET_FOG_MODE_V_EXP 0x800 -# define NV097_SET_FOG_MODE_V_EXP2 0x801 -# define NV097_SET_FOG_MODE_V_EXP_ABS 0x802 -# define NV097_SET_FOG_MODE_V_EXP2_ABS 0x803 -# define NV097_SET_FOG_MODE_V_LINEAR_ABS 0x804 -# define NV097_SET_FOG_GEN_MODE 0x000002A0 -# define NV097_SET_FOG_GEN_MODE_V_SPEC_ALPHA 0 -# define NV097_SET_FOG_GEN_MODE_V_RADIAL 1 -# define NV097_SET_FOG_GEN_MODE_V_PLANAR 2 -# define NV097_SET_FOG_GEN_MODE_V_ABS_PLANAR 3 -# define NV097_SET_FOG_GEN_MODE_V_FOG_X 6 -# define NV097_SET_FOG_ENABLE 0x000002A4 -# define NV097_SET_FOG_COLOR 0x000002A8 -# define NV097_SET_FOG_COLOR_RED 0x000000FF -# define NV097_SET_FOG_COLOR_GREEN 0x0000FF00 -# define NV097_SET_FOG_COLOR_BLUE 0x00FF0000 -# define NV097_SET_FOG_COLOR_ALPHA 0xFF000000 -# define NV097_SET_ALPHA_TEST_ENABLE 0x00000300 -# define NV097_SET_BLEND_ENABLE 0x00000304 -# define NV097_SET_CULL_FACE_ENABLE 0x00000308 -# define NV097_SET_DEPTH_TEST_ENABLE 0x0000030C -# define NV097_SET_DITHER_ENABLE 0x00000310 -# define NV097_SET_LIGHTING_ENABLE 0x00000314 -# define NV097_SET_SKIN_MODE 0x00000328 -# define NV097_SET_SKIN_MODE_OFF 0 -# define NV097_SET_SKIN_MODE_2G 1 -# define NV097_SET_SKIN_MODE_2 2 -# define NV097_SET_SKIN_MODE_3G 3 -# define NV097_SET_SKIN_MODE_3 4 -# define NV097_SET_SKIN_MODE_4G 5 -# define NV097_SET_SKIN_MODE_4 6 -# define NV097_SET_STENCIL_TEST_ENABLE 0x0000032C -# define NV097_SET_POLY_OFFSET_POINT_ENABLE 0x00000330 -# define NV097_SET_POLY_OFFSET_LINE_ENABLE 0x00000334 -# define NV097_SET_POLY_OFFSET_FILL_ENABLE 0x00000338 -# define NV097_SET_ALPHA_FUNC 0x0000033C -# define NV097_SET_ALPHA_REF 0x00000340 -# define NV097_SET_BLEND_FUNC_SFACTOR 0x00000344 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ZERO 0x0000 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE 0x0001 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_COLOR 0x0300 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_SRC_COLOR 0x0301 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_ALPHA 0x0302 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_SRC_ALPHA 0x0303 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_DST_ALPHA 0x0304 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_DST_ALPHA 0x0305 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_DST_COLOR 0x0306 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_DST_COLOR 0x0307 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_ALPHA_SATURATE 0x0308 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_CONSTANT_COLOR 0x8001 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_CONSTANT_COLOR 0x8002 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_CONSTANT_ALPHA 0x8003 -# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_CONSTANT_ALPHA 0x8004 -# define NV097_SET_BLEND_FUNC_DFACTOR 0x00000348 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ZERO 0x0000 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE 0x0001 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_COLOR 0x0300 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_SRC_COLOR 0x0301 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_ALPHA 0x0302 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_SRC_ALPHA 0x0303 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_DST_ALPHA 0x0304 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_DST_ALPHA 0x0305 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_DST_COLOR 0x0306 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_DST_COLOR 0x0307 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_ALPHA_SATURATE 0x0308 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_CONSTANT_COLOR 0x8001 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_CONSTANT_COLOR 0x8002 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_CONSTANT_ALPHA 0x8003 -# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_CONSTANT_ALPHA 0x8004 -# define NV097_SET_BLEND_COLOR 0x0000034C -# define NV097_SET_BLEND_EQUATION 0x00000350 -# define NV097_SET_BLEND_EQUATION_V_FUNC_SUBTRACT 0x800A -# define NV097_SET_BLEND_EQUATION_V_FUNC_REVERSE_SUBTRACT 0x800B -# define NV097_SET_BLEND_EQUATION_V_FUNC_ADD 0x8006 -# define NV097_SET_BLEND_EQUATION_V_MIN 0x8007 -# define NV097_SET_BLEND_EQUATION_V_MAX 0x8008 -# define NV097_SET_BLEND_EQUATION_V_FUNC_REVERSE_SUBTRACT_SIGNED 0xF005 -# define NV097_SET_BLEND_EQUATION_V_FUNC_ADD_SIGNED 0xF006 -# define NV097_SET_DEPTH_FUNC 0x00000354 -# define NV097_SET_COLOR_MASK 0x00000358 -# define NV097_SET_COLOR_MASK_BLUE_WRITE_ENABLE (1 << 0) -# define NV097_SET_COLOR_MASK_GREEN_WRITE_ENABLE (1 << 8) -# define NV097_SET_COLOR_MASK_RED_WRITE_ENABLE (1 << 16) -# define NV097_SET_COLOR_MASK_ALPHA_WRITE_ENABLE (1 << 24) -# define NV097_SET_DEPTH_MASK 0x0000035C -# define NV097_SET_STENCIL_MASK 0x00000360 -# define NV097_SET_STENCIL_FUNC 0x00000364 -# define NV097_SET_STENCIL_FUNC_REF 0x00000368 -# define NV097_SET_STENCIL_FUNC_MASK 0x0000036C -# define NV097_SET_STENCIL_OP_FAIL 0x00000370 -# define NV097_SET_STENCIL_OP_ZFAIL 0x00000374 -# define NV097_SET_STENCIL_OP_ZPASS 0x00000378 -# define NV097_SET_STENCIL_OP_V_KEEP 0x1E00 -# define NV097_SET_STENCIL_OP_V_ZERO 0x0000 -# define NV097_SET_STENCIL_OP_V_REPLACE 0x1E01 -# define NV097_SET_STENCIL_OP_V_INCRSAT 0x1E02 -# define NV097_SET_STENCIL_OP_V_DECRSAT 0x1E03 -# define NV097_SET_STENCIL_OP_V_INVERT 0x150A -# define NV097_SET_STENCIL_OP_V_INCR 0x8507 -# define NV097_SET_STENCIL_OP_V_DECR 0x8508 -# define NV097_SET_POLYGON_OFFSET_SCALE_FACTOR 0x00000384 -# define NV097_SET_POLYGON_OFFSET_BIAS 0x00000388 -# define NV097_SET_FRONT_POLYGON_MODE 0x0000038C -# define NV097_SET_FRONT_POLYGON_MODE_V_POINT 0x1B00 -# define NV097_SET_FRONT_POLYGON_MODE_V_LINE 0x1B01 -# define NV097_SET_FRONT_POLYGON_MODE_V_FILL 0x1B02 -# define NV097_SET_BACK_POLYGON_MODE 0x00000390 -# define NV097_SET_CLIP_MIN 0x00000394 -# define NV097_SET_CLIP_MAX 0x00000398 -# define NV097_SET_CULL_FACE 0x0000039C -# define NV097_SET_CULL_FACE_V_FRONT 0x404 -# define NV097_SET_CULL_FACE_V_BACK 0x405 -# define NV097_SET_CULL_FACE_V_FRONT_AND_BACK 0x408 -# define NV097_SET_FRONT_FACE 0x000003A0 -# define NV097_SET_FRONT_FACE_V_CW 0x900 -# define NV097_SET_FRONT_FACE_V_CCW 0x901 -# define NV097_SET_NORMALIZATION_ENABLE 0x000003A4 -# define NV097_SET_LIGHT_ENABLE_MASK 0x000003BC -# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_OFF 0 -# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_INFINITE 1 -# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_LOCAL 2 -# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_SPOT 3 -# define NV097_SET_TEXGEN_S 0x000003C0 -# define NV097_SET_TEXGEN_S_DISABLE 0x0000 -# define NV097_SET_TEXGEN_S_EYE_LINEAR 0x2400 -# define NV097_SET_TEXGEN_S_OBJECT_LINEAR 0x2401 -# define NV097_SET_TEXGEN_S_SPHERE_MAP 0x2402 -# define NV097_SET_TEXGEN_S_REFLECTION_MAP 0x8512 -# define NV097_SET_TEXGEN_S_NORMAL_MAP 0x8511 -# define NV097_SET_TEXGEN_T 0x000003C4 -# define NV097_SET_TEXGEN_R 0x000003C8 -# define NV097_SET_TEXGEN_Q 0x000003CC -# define NV097_SET_TEXTURE_MATRIX_ENABLE 0x00000420 -# define NV097_SET_PROJECTION_MATRIX 0x00000440 -# define NV097_SET_MODEL_VIEW_MATRIX 0x00000480 -# define NV097_SET_INVERSE_MODEL_VIEW_MATRIX 0x00000580 -# define NV097_SET_COMPOSITE_MATRIX 0x00000680 -# define NV097_SET_TEXTURE_MATRIX 0x000006C0 -# define NV097_SET_TEXGEN_PLANE_S 0x00000840 -# define NV097_SET_TEXGEN_PLANE_T 0x00000850 -# define NV097_SET_TEXGEN_PLANE_R 0x00000860 -# define NV097_SET_TEXGEN_PLANE_Q 0x00000870 -# define NV097_SET_FOG_PARAMS 0x000009C0 -# define NV097_SET_TEXGEN_VIEW_MODEL 0x000009CC -# define NV097_SET_TEXGEN_VIEW_MODEL_LOCAL_VIEWER 0 -# define NV097_SET_TEXGEN_VIEW_MODEL_INFINITE_VIEWER 1 -# define NV097_SET_FOG_PLANE 0x000009D0 -# define NV097_SET_FLAT_SHADE_OP 0x000009FC -# define NV097_SET_SCENE_AMBIENT_COLOR 0x00000A10 -# define NV097_SET_VIEWPORT_OFFSET 0x00000A20 -# define NV097_SET_EYE_POSITION 0x00000A50 -# define NV097_SET_COMBINER_FACTOR0 0x00000A60 -# define NV097_SET_COMBINER_FACTOR1 0x00000A80 -# define NV097_SET_COMBINER_ALPHA_OCW 0x00000AA0 -# define NV097_SET_COMBINER_ALPHA_OCW_OP 0xFFFF8000 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_NOSHIFT 0 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_NOSHIFT_BIAS 1 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY1 2 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY1_BIAS 3 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY2 4 -# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTRIGHTBY1 6 -# define NV097_SET_COMBINER_ALPHA_OCW_MUX_ENABLE (1<<14) -# define NV097_SET_COMBINER_ALPHA_OCW_SUM_DST 0x00000F00 -# define NV097_SET_COMBINER_ALPHA_OCW_AB_DST 0x000000F0 -# define NV097_SET_COMBINER_ALPHA_OCW_CD_DST 0x0000000F -# define NV097_SET_COMBINER_COLOR_ICW 0x00000AC0 -# define NV097_SET_COMBINER_COLOR_ICW_A_MAP 0xE0000000 -# define NV097_SET_COMBINER_COLOR_ICW_A_ALPHA (1<<28) -# define NV097_SET_COMBINER_COLOR_ICW_A_SOURCE 0x0F000000 -# define NV097_SET_COMBINER_COLOR_ICW_B_MAP 0x00E00000 -# define NV097_SET_COMBINER_COLOR_ICW_B_ALPHA (1<<20) -# define NV097_SET_COMBINER_COLOR_ICW_B_SOURCE 0x000F0000 -# define NV097_SET_COMBINER_COLOR_ICW_C_MAP 0x0000E000 -# define NV097_SET_COMBINER_COLOR_ICW_C_ALPHA (1<<12) -# define NV097_SET_COMBINER_COLOR_ICW_C_SOURCE 0x00000F00 -# define NV097_SET_COMBINER_COLOR_ICW_D_MAP 0x000000E0 -# define NV097_SET_COMBINER_COLOR_ICW_D_ALPHA (1<<4) -# define NV097_SET_COMBINER_COLOR_ICW_D_SOURCE 0x0000000F -# define NV097_SET_VIEWPORT_SCALE 0x00000AF0 -# define NV097_SET_TRANSFORM_PROGRAM 0x00000B00 -# define NV097_SET_TRANSFORM_CONSTANT 0x00000B80 -# define NV097_SET_BACK_LIGHT_AMBIENT_COLOR 0x00000C00 -# define NV097_SET_BACK_LIGHT_DIFFUSE_COLOR 0x00000C0C -# define NV097_SET_BACK_LIGHT_SPECULAR_COLOR 0x00000C18 -# define NV097_SET_LIGHT_AMBIENT_COLOR 0x00001000 -# define NV097_SET_LIGHT_DIFFUSE_COLOR 0x0000100C -# define NV097_SET_LIGHT_SPECULAR_COLOR 0x00001018 -# define NV097_SET_LIGHT_LOCAL_RANGE 0x00001024 -# define NV097_SET_LIGHT_INFINITE_HALF_VECTOR 0x00001028 -# define NV097_SET_LIGHT_INFINITE_DIRECTION 0x00001034 -# define NV097_SET_LIGHT_SPOT_FALLOFF 0x00001040 -# define NV097_SET_LIGHT_SPOT_DIRECTION 0x0000104C -# define NV097_SET_LIGHT_LOCAL_POSITION 0x0000105C -# define NV097_SET_LIGHT_LOCAL_ATTENUATION 0x00001068 -# define NV097_SET_VERTEX3F 0x00001500 -# define NV097_SET_VERTEX4F 0x00001518 -# define NV097_SET_VERTEX_DATA_ARRAY_OFFSET 0x00001720 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT 0x00001760 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE 0x0000000F -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_UB_D3D 0 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_S1 1 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_F 2 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_UB_OGL 4 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_S32K 5 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_CMP 6 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_SIZE 0x000000F0 -# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_STRIDE 0xFFFFFF00 -# define NV097_SET_LOGIC_OP_ENABLE 0x000017BC -# define NV097_SET_LOGIC_OP 0x000017C0 -# define NV097_CLEAR_REPORT_VALUE 0x000017C8 -# define NV097_CLEAR_REPORT_VALUE_TYPE 0xFFFFFFFF -# define NV097_CLEAR_REPORT_VALUE_TYPE_ZPASS_PIXEL_CNT 1 -# define NV097_SET_ZPASS_PIXEL_COUNT_ENABLE 0x000017CC -# define NV097_GET_REPORT 0x000017D0 -# define NV097_GET_REPORT_OFFSET 0x00FFFFFF -# define NV097_GET_REPORT_TYPE 0xFF000000 -# define NV097_GET_REPORT_TYPE_ZPASS_PIXEL_CNT 1 -# define NV097_SET_EYE_DIRECTION 0x000017E0 -# define NV097_SET_SHADER_CLIP_PLANE_MODE 0x000017F8 -# define NV097_SET_BEGIN_END 0x000017FC -# define NV097_SET_BEGIN_END_OP_END 0x00 -# define NV097_SET_BEGIN_END_OP_POINTS 0x01 -# define NV097_SET_BEGIN_END_OP_LINES 0x02 -# define NV097_SET_BEGIN_END_OP_LINE_LOOP 0x03 -# define NV097_SET_BEGIN_END_OP_LINE_STRIP 0x04 -# define NV097_SET_BEGIN_END_OP_TRIANGLES 0x05 -# define NV097_SET_BEGIN_END_OP_TRIANGLE_STRIP 0x06 -# define NV097_SET_BEGIN_END_OP_TRIANGLE_FAN 0x07 -# define NV097_SET_BEGIN_END_OP_QUADS 0x08 -# define NV097_SET_BEGIN_END_OP_QUAD_STRIP 0x09 -# define NV097_SET_BEGIN_END_OP_POLYGON 0x0A -# define NV097_ARRAY_ELEMENT16 0x00001800 -# define NV097_ARRAY_ELEMENT32 0x00001808 -# define NV097_DRAW_ARRAYS 0x00001810 -# define NV097_DRAW_ARRAYS_COUNT 0xFF000000 -# define NV097_DRAW_ARRAYS_START_INDEX 0x00FFFFFF -# define NV097_INLINE_ARRAY 0x00001818 -# define NV097_SET_EYE_VECTOR 0x0000181C -# define NV097_SET_VERTEX_DATA2F_M 0x00001880 -# define NV097_SET_VERTEX_DATA2S 0x00001900 -# define NV097_SET_VERTEX_DATA4UB 0x00001940 -# define NV097_SET_VERTEX_DATA4S_M 0x00001980 -# define NV097_SET_VERTEX_DATA4F_M 0x00001A00 -# define NV097_SET_TEXTURE_OFFSET 0x00001B00 -# define NV097_SET_TEXTURE_FORMAT 0x00001B04 -# define NV097_SET_TEXTURE_FORMAT_CONTEXT_DMA 0x00000003 -# define NV097_SET_TEXTURE_FORMAT_CUBEMAP_ENABLE (1 << 2) -# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE (1 << 3) -# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE_TEXTURE 0 -# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE_COLOR 1 -# define NV097_SET_TEXTURE_FORMAT_DIMENSIONALITY 0x000000F0 -# define NV097_SET_TEXTURE_FORMAT_COLOR 0x0000FF00 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y8 0x00 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_AY8 0x01 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A1R5G5B5 0x02 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X1R5G5B5 0x03 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A4R4G4B4 0x04 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R5G6B5 0x05 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8R8G8B8 0x06 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X8R8G8B8 0x07 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8 0x0B -# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT1_A1R5G5B5 0x0C -# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT23_A8R8G8B8 0x0E -# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT45_A8R8G8B8 0x0F -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A1R5G5B5 0x10 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G6B5 0x11 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8R8G8B8 0x12 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y8 0x13 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8 0x19 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8Y8 0x1A -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_AY8 0x1B -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X1R5G5B5 0x1C -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A4R4G4B4 0x1D -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X8R8G8B8 0x1E -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8 0x1F -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8Y8 0x20 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8 0x24 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5 0x27 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_G8B8 0x28 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8B8 0x29 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_X8_Y24_FIXED 0x2E -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FIXED 0x30 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16 0x35 -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8B8G8R8 0x3A -# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8G8B8A8 0x3C -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8B8G8R8 0x3F -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_B8G8R8A8 0x40 -# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R8G8B8A8 0x41 -# define NV097_SET_TEXTURE_FORMAT_MIPMAP_LEVELS 0x000F0000 -# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_U 0x00F00000 -# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_V 0x0F000000 -# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_P 0xF0000000 -# define NV097_SET_TEXTURE_ADDRESS 0x00001B08 -# define NV097_SET_TEXTURE_CONTROL0 0x00001B0C -# define NV097_SET_TEXTURE_CONTROL0_ENABLE (1 << 30) -# define NV097_SET_TEXTURE_CONTROL0_MIN_LOD_CLAMP 0x3FFC0000 -# define NV097_SET_TEXTURE_CONTROL0_MAX_LOD_CLAMP 0x0003FFC0 -# define NV097_SET_TEXTURE_CONTROL1 0x00001B10 -# define NV097_SET_TEXTURE_CONTROL1_IMAGE_PITCH 0xFFFF0000 -# define NV097_SET_TEXTURE_FILTER 0x00001B14 -# define NV097_SET_TEXTURE_FILTER_MIPMAP_LOD_BIAS 0x00001FFF -# define NV097_SET_TEXTURE_FILTER_MIN 0x00FF0000 -# define NV097_SET_TEXTURE_FILTER_MAG 0x0F000000 -# define NV097_SET_TEXTURE_FILTER_ASIGNED (1 << 28) -# define NV097_SET_TEXTURE_FILTER_RSIGNED (1 << 29) -# define NV097_SET_TEXTURE_FILTER_GSIGNED (1 << 30) -# define NV097_SET_TEXTURE_FILTER_BSIGNED (1 << 31) -# define NV097_SET_TEXTURE_IMAGE_RECT 0x00001B1C -# define NV097_SET_TEXTURE_IMAGE_RECT_WIDTH 0xFFFF0000 -# define NV097_SET_TEXTURE_IMAGE_RECT_HEIGHT 0x0000FFFF -# define NV097_SET_TEXTURE_PALETTE 0x00001B20 -# define NV097_SET_TEXTURE_PALETTE_CONTEXT_DMA (1 << 0) -# define NV097_SET_TEXTURE_PALETTE_LENGTH 0x0000000C -# define NV097_SET_TEXTURE_PALETTE_LENGTH_256 0 -# define NV097_SET_TEXTURE_PALETTE_LENGTH_128 1 -# define NV097_SET_TEXTURE_PALETTE_LENGTH_64 2 -# define NV097_SET_TEXTURE_PALETTE_LENGTH_32 3 -# define NV097_SET_TEXTURE_PALETTE_OFFSET 0xFFFFFFC0 -# define NV097_SET_TEXTURE_BORDER_COLOR 0x00001B24 -# define NV097_SET_TEXTURE_SET_BUMP_ENV_MAT 0x00001B28 -# define NV097_SET_TEXTURE_SET_BUMP_ENV_SCALE 0x00001B38 -# define NV097_SET_TEXTURE_SET_BUMP_ENV_OFFSET 0x00001B3C -# define NV097_SET_SEMAPHORE_OFFSET 0x00001D6C -# define NV097_BACK_END_WRITE_SEMAPHORE_RELEASE 0x00001D70 -# define NV097_SET_ZMIN_MAX_CONTROL 0x00001D78 -# define NV097_SET_COMPRESS_ZBUFFER_EN 0x00001D80 -# define NV097_SET_ZSTENCIL_CLEAR_VALUE 0x00001D8C -# define NV097_SET_COLOR_CLEAR_VALUE 0x00001D90 -# define NV097_CLEAR_SURFACE 0x00001D94 -# define NV097_CLEAR_SURFACE_Z (1 << 0) -# define NV097_CLEAR_SURFACE_STENCIL (1 << 1) -# define NV097_CLEAR_SURFACE_COLOR 0x000000F0 -# define NV097_CLEAR_SURFACE_R (1 << 4) -# define NV097_CLEAR_SURFACE_G (1 << 5) -# define NV097_CLEAR_SURFACE_B (1 << 6) -# define NV097_CLEAR_SURFACE_A (1 << 7) -# define NV097_SET_CLEAR_RECT_HORIZONTAL 0x00001D98 -# define NV097_SET_CLEAR_RECT_VERTICAL 0x00001D9C -# define NV097_SET_SPECULAR_FOG_FACTOR 0x00001E20 -# define NV097_SET_COMBINER_COLOR_OCW 0x00001E40 -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB 0xFFF80000 -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB_DISABLE 0 -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB_AB_DST_ENABLE 1 -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD (1<<18) -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD_DISABLE 0 -# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD_CD_DST_ENABLE 1 -# define NV097_SET_COMBINER_COLOR_OCW_OP 0x00038000 -# define NV097_SET_COMBINER_COLOR_OCW_OP_NOSHIFT 0 -# define NV097_SET_COMBINER_COLOR_OCW_OP_NOSHIFT_BIAS 1 -# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY1 2 -# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY1_BIAS 3 -# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY2 4 -# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTRIGHTBY1 6 -# define NV097_SET_COMBINER_COLOR_OCW_MUX_ENABLE (1 << 14) -# define NV097_SET_COMBINER_COLOR_OCW_AB_DOT_ENABLE (1 << 13) -# define NV097_SET_COMBINER_COLOR_OCW_CD_DOT_ENABLE (1<<12) -# define NV097_SET_COMBINER_COLOR_OCW_SUM_DST 0x00000F00 -# define NV097_SET_COMBINER_COLOR_OCW_AB_DST 0x000000F0 -# define NV097_SET_COMBINER_COLOR_OCW_CD_DST 0x0000000F -# define NV097_SET_COMBINER_CONTROL 0x00001E60 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT 0x000000FF -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_ONE 1 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_TWO 2 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_THREE 3 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_FOUR 4 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_FIVE 5 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_SIX 6 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_SEVEN 7 -# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_EIGHT 8 -# define NV097_SET_COMBINER_CONTROL_MUX_SELECT 0x00000F00 -# define NV097_SET_COMBINER_CONTROL_MUX_SELECT_LSB 0 -# define NV097_SET_COMBINER_CONTROL_MUX_SELECT_MSB 1 -# define NV097_SET_COMBINER_CONTROL_FACTOR0 0x0000F000 -# define NV097_SET_COMBINER_CONTROL_FACTOR0_SAME_FACTOR_ALL 0 -# define NV097_SET_COMBINER_CONTROL_FACTOR0_EACH_STAGE 1 -# define NV097_SET_COMBINER_CONTROL_FACTOR1 0xFFFF0000 -# define NV097_SET_COMBINER_CONTROL_FACTOR1_SAME_FACTOR_ALL 0 -# define NV097_SET_COMBINER_CONTROL_FACTOR1_EACH_STAGE 1 -# define NV097_SET_SHADOW_ZSLOPE_THRESHOLD 0x00001E68 -# define NV097_SET_SHADER_STAGE_PROGRAM 0x00001E70 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0 0x0000001F -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_PROGRAM_NONE 0 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_2D_PROJECTIVE 1 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_3D_PROJECTIVE 2 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_CUBE_MAP 3 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_PASS_THROUGH 4 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_CLIP_PLANE 5 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1 0x000003E0 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_PROGRAM_NONE 0x00 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_2D_PROJECTIVE 0x01 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_3D_PROJECTIVE 0x02 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_CUBE_MAP 0x03 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_PASS_THROUGH 0x04 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_CLIP_PLANE 0x05 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_BUMPENVMAP 0x06 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_BUMPENVMAP_LUMINANCE 0x07 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DEPENDENT_AR 0x0F -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DEPENDENT_GB 0x10 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DOT_PRODUCT 0x11 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2 0x00007C00 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_PROGRAM_NONE 0x00 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_2D_PROJECTIVE 0x01 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_3D_PROJECTIVE 0x02 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_CUBE_MAP 0x03 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_PASS_THROUGH 0x04 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_CLIP_PLANE 0x05 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BUMPENVMAP 0x06 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BUMPENVMAP_LUMINANCE 0x07 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BRDF 0x08 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_ST 0x09 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_ZW 0x0A -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_REFLECT_DIFFUSE 0x0B -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DEPENDENT_AR 0x0F -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DEPENDENT_GB 0x10 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_PRODUCT 0x11 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3 0x000F8000 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_PROGRAM_NONE 0x00 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_2D_PROJECTIVE 0x01 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_3D_PROJECTIVE 0x02 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_CUBE_MAP 0x03 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_PASS_THROUGH 0x04 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_CLIP_PLANE 0x05 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BUMPENVMAP 0x06 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BUMPENVMAP_LUMINANCE 0x07 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BRDF 0x08 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_ST 0x09 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_ZW 0x0A -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_REFLECT_SPECULAR 0x0C -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_STR_3D 0x0D -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_STR_CUBE 0x0E -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DEPENDENT_AR 0x0F -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DEPENDENT_GB 0x10 -# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_REFLECT_SPECULAR_CONST 0x12 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT 0x00001E78 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE1 0x0000FFFF -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE1_INSTAGE_0 0 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2 0x000F0000 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2_INSTAGE_0 0 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2_INSTAGE_1 1 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3 0x00F00000 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_0 0 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_1 1 -# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_2 2 -# define NV097_SET_TRANSFORM_DATA 0x00001E80 -# define NV097_LAUNCH_TRANSFORM_PROGRAM 0x00001E90 -# define NV097_SET_TRANSFORM_EXECUTION_MODE 0x00001E94 -# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE 0x00000003 -# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE_FIXED 0 -# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE_PROGRAM 2 -# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE 0xFFFFFFFC -# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE_USER 0 -# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE_PRIV 1 -# define NV097_SET_TRANSFORM_PROGRAM_CXT_WRITE_EN 0x00001E98 -# define NV097_SET_TRANSFORM_PROGRAM_LOAD 0x00001E9C -# define NV097_SET_TRANSFORM_PROGRAM_START 0x00001EA0 -# define NV097_SET_TRANSFORM_CONSTANT_LOAD 0x00001EA4 +typedef struct TextureKey { + TextureShape state; + uint64_t data_hash; + uint8_t* texture_data; + uint8_t* palette_data; +} TextureKey; -/* vertex processing (cheops) context layout */ -#define NV_IGRAPH_XF_XFCTX_CMAT0 0x00 -#define NV_IGRAPH_XF_XFCTX_PMAT0 0x04 -#define NV_IGRAPH_XF_XFCTX_MMAT0 0x08 -#define NV_IGRAPH_XF_XFCTX_IMMAT0 0x0c -#define NV_IGRAPH_XF_XFCTX_MMAT1 0x10 -#define NV_IGRAPH_XF_XFCTX_IMMAT1 0x14 -#define NV_IGRAPH_XF_XFCTX_MMAT2 0x18 -#define NV_IGRAPH_XF_XFCTX_IMMAT2 0x1c -#define NV_IGRAPH_XF_XFCTX_MMAT3 0x20 -#define NV_IGRAPH_XF_XFCTX_IMMAT3 0x24 -#define NV_IGRAPH_XF_XFCTX_LIT0 0x28 -#define NV_IGRAPH_XF_XFCTX_LIT1 0x29 -#define NV_IGRAPH_XF_XFCTX_LIT2 0x2a -#define NV_IGRAPH_XF_XFCTX_LIT3 0x2b -#define NV_IGRAPH_XF_XFCTX_LIT4 0x2c -#define NV_IGRAPH_XF_XFCTX_LIT5 0x2d -#define NV_IGRAPH_XF_XFCTX_LIT6 0x2e -#define NV_IGRAPH_XF_XFCTX_LIT7 0x2f -#define NV_IGRAPH_XF_XFCTX_SPOT0 0x30 -#define NV_IGRAPH_XF_XFCTX_SPOT1 0x31 -#define NV_IGRAPH_XF_XFCTX_SPOT2 0x32 -#define NV_IGRAPH_XF_XFCTX_SPOT3 0x33 -#define NV_IGRAPH_XF_XFCTX_SPOT4 0x34 -#define NV_IGRAPH_XF_XFCTX_SPOT5 0x35 -#define NV_IGRAPH_XF_XFCTX_SPOT6 0x36 -#define NV_IGRAPH_XF_XFCTX_SPOT7 0x37 -#define NV_IGRAPH_XF_XFCTX_EYEP 0x38 -#define NV_IGRAPH_XF_XFCTX_FOG 0x39 -#define NV_IGRAPH_XF_XFCTX_VPSCL 0x3a -#define NV_IGRAPH_XF_XFCTX_VPOFF 0x3b -#define NV_IGRAPH_XF_XFCTX_CONS0 0x3c -#define NV_IGRAPH_XF_XFCTX_CONS1 0x3d -#define NV_IGRAPH_XF_XFCTX_CONS2 0x3e -#define NV_IGRAPH_XF_XFCTX_CONS3 0x3f -#define NV_IGRAPH_XF_XFCTX_TG0MAT 0x40 -#define NV_IGRAPH_XF_XFCTX_T0MAT 0x44 -#define NV_IGRAPH_XF_XFCTX_TG1MAT 0x48 -#define NV_IGRAPH_XF_XFCTX_T1MAT 0x4c -#define NV_IGRAPH_XF_XFCTX_TG2MAT 0x50 -#define NV_IGRAPH_XF_XFCTX_T2MAT 0x54 -#define NV_IGRAPH_XF_XFCTX_TG3MAT 0x58 -#define NV_IGRAPH_XF_XFCTX_T3MAT 0x5c -#define NV_IGRAPH_XF_XFCTX_PRSPACE 0x60 +typedef struct TextureBinding { + GLenum gl_target; + GLuint gl_texture; + unsigned int refcnt; +} TextureBinding; -/* lighting (zoser) context layout */ -#define NV_IGRAPH_XF_LTCTXA_L0_K 0x00 -#define NV_IGRAPH_XF_LTCTXA_L0_SPT 0x01 -#define NV_IGRAPH_XF_LTCTXA_L1_K 0x02 -#define NV_IGRAPH_XF_LTCTXA_L1_SPT 0x03 -#define NV_IGRAPH_XF_LTCTXA_L2_K 0x04 -#define NV_IGRAPH_XF_LTCTXA_L2_SPT 0x05 -#define NV_IGRAPH_XF_LTCTXA_L3_K 0x06 -#define NV_IGRAPH_XF_LTCTXA_L3_SPT 0x07 -#define NV_IGRAPH_XF_LTCTXA_L4_K 0x08 -#define NV_IGRAPH_XF_LTCTXA_L4_SPT 0x09 -#define NV_IGRAPH_XF_LTCTXA_L5_K 0x0a -#define NV_IGRAPH_XF_LTCTXA_L5_SPT 0x0b -#define NV_IGRAPH_XF_LTCTXA_L6_K 0x0c -#define NV_IGRAPH_XF_LTCTXA_L6_SPT 0x0d -#define NV_IGRAPH_XF_LTCTXA_L7_K 0x0e -#define NV_IGRAPH_XF_LTCTXA_L7_SPT 0x0f -#define NV_IGRAPH_XF_LTCTXA_EYED 0x10 -#define NV_IGRAPH_XF_LTCTXA_FR_AMB 0x11 -#define NV_IGRAPH_XF_LTCTXA_BR_AMB 0x12 -#define NV_IGRAPH_XF_LTCTXA_CM_COL 0x13 -#define NV_IGRAPH_XF_LTCTXA_BCM_COL 0x14 -#define NV_IGRAPH_XF_LTCTXA_FOG_K 0x15 -#define NV_IGRAPH_XF_LTCTXA_ZERO 0x16 -#define NV_IGRAPH_XF_LTCTXA_PT0 0x17 -#define NV_IGRAPH_XF_LTCTXA_FOGLIN 0x18 +typedef struct KelvinState { + xbaddr object_instance; +} KelvinState; -#define NV_IGRAPH_XF_LTCTXB_L0_AMB 0x00 -#define NV_IGRAPH_XF_LTCTXB_L0_DIF 0x01 -#define NV_IGRAPH_XF_LTCTXB_L0_SPC 0x02 -#define NV_IGRAPH_XF_LTCTXB_L0_BAMB 0x03 -#define NV_IGRAPH_XF_LTCTXB_L0_BDIF 0x04 -#define NV_IGRAPH_XF_LTCTXB_L0_BSPC 0x05 -#define NV_IGRAPH_XF_LTCTXB_L1_AMB 0x06 -#define NV_IGRAPH_XF_LTCTXB_L1_DIF 0x07 -#define NV_IGRAPH_XF_LTCTXB_L1_SPC 0x08 -#define NV_IGRAPH_XF_LTCTXB_L1_BAMB 0x09 -#define NV_IGRAPH_XF_LTCTXB_L1_BDIF 0x0a -#define NV_IGRAPH_XF_LTCTXB_L1_BSPC 0x0b -#define NV_IGRAPH_XF_LTCTXB_L2_AMB 0x0c -#define NV_IGRAPH_XF_LTCTXB_L2_DIF 0x0d -#define NV_IGRAPH_XF_LTCTXB_L2_SPC 0x0e -#define NV_IGRAPH_XF_LTCTXB_L2_BAMB 0x0f -#define NV_IGRAPH_XF_LTCTXB_L2_BDIF 0x10 -#define NV_IGRAPH_XF_LTCTXB_L2_BSPC 0x11 -#define NV_IGRAPH_XF_LTCTXB_L3_AMB 0x12 -#define NV_IGRAPH_XF_LTCTXB_L3_DIF 0x13 -#define NV_IGRAPH_XF_LTCTXB_L3_SPC 0x14 -#define NV_IGRAPH_XF_LTCTXB_L3_BAMB 0x15 -#define NV_IGRAPH_XF_LTCTXB_L3_BDIF 0x16 -#define NV_IGRAPH_XF_LTCTXB_L3_BSPC 0x17 -#define NV_IGRAPH_XF_LTCTXB_L4_AMB 0x18 -#define NV_IGRAPH_XF_LTCTXB_L4_DIF 0x19 -#define NV_IGRAPH_XF_LTCTXB_L4_SPC 0x1a -#define NV_IGRAPH_XF_LTCTXB_L4_BAMB 0x1b -#define NV_IGRAPH_XF_LTCTXB_L4_BDIF 0x1c -#define NV_IGRAPH_XF_LTCTXB_L4_BSPC 0x1d -#define NV_IGRAPH_XF_LTCTXB_L5_AMB 0x1e -#define NV_IGRAPH_XF_LTCTXB_L5_DIF 0x1f -#define NV_IGRAPH_XF_LTCTXB_L5_SPC 0x20 -#define NV_IGRAPH_XF_LTCTXB_L5_BAMB 0x21 -#define NV_IGRAPH_XF_LTCTXB_L5_BDIF 0x22 -#define NV_IGRAPH_XF_LTCTXB_L5_BSPC 0x23 -#define NV_IGRAPH_XF_LTCTXB_L6_AMB 0x24 -#define NV_IGRAPH_XF_LTCTXB_L6_DIF 0x25 -#define NV_IGRAPH_XF_LTCTXB_L6_SPC 0x26 -#define NV_IGRAPH_XF_LTCTXB_L6_BAMB 0x27 -#define NV_IGRAPH_XF_LTCTXB_L6_BDIF 0x28 -#define NV_IGRAPH_XF_LTCTXB_L6_BSPC 0x29 -#define NV_IGRAPH_XF_LTCTXB_L7_AMB 0x2a -#define NV_IGRAPH_XF_LTCTXB_L7_DIF 0x2b -#define NV_IGRAPH_XF_LTCTXB_L7_SPC 0x2c -#define NV_IGRAPH_XF_LTCTXB_L7_BAMB 0x2d -#define NV_IGRAPH_XF_LTCTXB_L7_BDIF 0x2e -#define NV_IGRAPH_XF_LTCTXB_L7_BSPC 0x2f -#define NV_IGRAPH_XF_LTCTXB_PT1 0x30 -#define NV_IGRAPH_XF_LTCTXB_ONE 0x31 -#define NV_IGRAPH_XF_LTCTXB_VPOFFSET 0x32 +typedef struct ContextSurfaces2DState { + xbaddr object_instance; + xbaddr dma_image_source; + xbaddr dma_image_dest; + unsigned int color_format; + unsigned int source_pitch, dest_pitch; + xbaddr source_offset, dest_offset; +} ContextSurfaces2DState; -#define NV_IGRAPH_XF_LTC1_ZERO1 0x00 -#define NV_IGRAPH_XF_LTC1_l0 0x01 -#define NV_IGRAPH_XF_LTC1_Bl0 0x02 -#define NV_IGRAPH_XF_LTC1_PP 0x03 -#define NV_IGRAPH_XF_LTC1_r0 0x04 -#define NV_IGRAPH_XF_LTC1_r1 0x05 -#define NV_IGRAPH_XF_LTC1_r2 0x06 -#define NV_IGRAPH_XF_LTC1_r3 0x07 -#define NV_IGRAPH_XF_LTC1_r4 0x08 -#define NV_IGRAPH_XF_LTC1_r5 0x09 -#define NV_IGRAPH_XF_LTC1_r6 0x0a -#define NV_IGRAPH_XF_LTC1_r7 0x0b -#define NV_IGRAPH_XF_LTC1_L0 0x0c -#define NV_IGRAPH_XF_LTC1_L1 0x0d -#define NV_IGRAPH_XF_LTC1_L2 0x0e -#define NV_IGRAPH_XF_LTC1_L3 0x0f -#define NV_IGRAPH_XF_LTC1_L4 0x10 -#define NV_IGRAPH_XF_LTC1_L5 0x11 -#define NV_IGRAPH_XF_LTC1_L6 0x12 -#define NV_IGRAPH_XF_LTC1_L7 0x13 +typedef struct ImageBlitState { + xbaddr object_instance; + xbaddr context_surfaces; + unsigned int operation; + unsigned int in_x, in_y; + unsigned int out_x, out_y; + unsigned int width, height; +} ImageBlitState; +typedef struct PGRAPHState { + bool opengl_enabled; // == bLLE_GPU + QemuMutex pgraph_lock; -#define NV2A_VERTEX_ATTR_POSITION 0 -#define NV2A_VERTEX_ATTR_WEIGHT 1 -#define NV2A_VERTEX_ATTR_NORMAL 2 -#define NV2A_VERTEX_ATTR_DIFFUSE 3 -#define NV2A_VERTEX_ATTR_SPECULAR 4 -#define NV2A_VERTEX_ATTR_FOG 5 -#define NV2A_VERTEX_ATTR_POINT_SIZE 6 -#define NV2A_VERTEX_ATTR_BACK_DIFFUSE 7 -#define NV2A_VERTEX_ATTR_BACK_SPECULAR 8 -#define NV2A_VERTEX_ATTR_TEXTURE0 9 -#define NV2A_VERTEX_ATTR_TEXTURE1 10 -#define NV2A_VERTEX_ATTR_TEXTURE2 11 -#define NV2A_VERTEX_ATTR_TEXTURE3 12 -#define NV2A_VERTEX_ATTR_RESERVED1 13 -#define NV2A_VERTEX_ATTR_RESERVED2 14 -#define NV2A_VERTEX_ATTR_RESERVED3 15 + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + QemuCond interrupt_cond; -#define NV2A_CRYSTAL_FREQ 13500000 -#define NV2A_NUM_CHANNELS 32 -#define NV2A_NUM_SUBCHANNELS 8 + /* subchannels state we're not sure the location of... */ + ContextSurfaces2DState context_surfaces_2d; + ImageBlitState image_blit; + KelvinState kelvin; -#define NV2A_MAX_BATCH_LENGTH 0x1FFFF -#define NV2A_VERTEXSHADER_ATTRIBUTES 16 -#define NV2A_MAX_TEXTURES 4 + QemuCond fifo_access_cond; + QemuCond flip_3d; -#define NV2A_MAX_TRANSFORM_PROGRAM_LENGTH 136 -#define NV2A_VERTEXSHADER_CONSTANTS 192 -#define NV2A_MAX_LIGHTS 8 + xbaddr dma_color, dma_zeta; + Surface surface_color, surface_zeta; + unsigned int surface_type; + SurfaceShape surface_shape; + SurfaceShape last_surface_shape; -#define NV2A_LTCTXA_COUNT 26 -#define NV2A_LTCTXB_COUNT 52 -#define NV2A_LTC1_COUNT 20 + xbaddr dma_a, dma_b; +#ifdef USE_TEXTURE_CACHE + GLruCache *texture_cache; +#endif + bool texture_dirty[NV2A_MAX_TEXTURES]; + TextureBinding *texture_binding[NV2A_MAX_TEXTURES]; + +#ifdef USE_SHADER_CACHE + GHashTable *shader_cache; +#endif + ShaderBinding *shader_binding; + + bool texture_matrix_enable[NV2A_MAX_TEXTURES]; + + /* FIXME: Move to NV_PGRAPH_BUMPMAT... */ + float bump_env_matrix[NV2A_MAX_TEXTURES - 1][4]; /* 3 allowed stages with 2x2 matrix each */ + + GloContext *gl_context; + GLuint gl_framebuffer; + GLuint gl_color_buffer, gl_zeta_buffer; + + xbaddr dma_state; + xbaddr dma_notifies; + xbaddr dma_semaphore; + + xbaddr dma_report; + xbaddr report_offset; + bool zpass_pixel_count_enable; + unsigned int zpass_pixel_count_result; + unsigned int gl_zpass_pixel_count_query_count; + GLuint* gl_zpass_pixel_count_queries; + + xbaddr dma_vertex_a, dma_vertex_b; + + unsigned int primitive_mode; + + unsigned int clear_surface; + + bool enable_vertex_program_write; + + uint32_t program_data[NV2A_MAX_TRANSFORM_PROGRAM_LENGTH][VSH_TOKEN_SIZE]; + + uint32_t vsh_constants[NV2A_VERTEXSHADER_CONSTANTS][4]; + bool vsh_constants_dirty[NV2A_VERTEXSHADER_CONSTANTS]; + + /* lighting constant arrays */ + uint32_t ltctxa[NV2A_LTCTXA_COUNT][4]; + bool ltctxa_dirty[NV2A_LTCTXA_COUNT]; + uint32_t ltctxb[NV2A_LTCTXB_COUNT][4]; + bool ltctxb_dirty[NV2A_LTCTXB_COUNT]; + uint32_t ltc1[NV2A_LTC1_COUNT][4]; + bool ltc1_dirty[NV2A_LTC1_COUNT]; + + // should figure out where these are in lighting context + float light_infinite_half_vector[NV2A_MAX_LIGHTS][3]; + float light_infinite_direction[NV2A_MAX_LIGHTS][3]; + float light_local_position[NV2A_MAX_LIGHTS][3]; + float light_local_attenuation[NV2A_MAX_LIGHTS][3]; + + VertexAttribute vertex_attributes[NV2A_VERTEXSHADER_ATTRIBUTES]; + + unsigned int inline_array_length; + uint32_t inline_array[NV2A_MAX_BATCH_LENGTH]; + GLuint gl_inline_array_buffer; + + unsigned int inline_elements_length; + uint16_t inline_elements[NV2A_MAX_BATCH_LENGTH]; // Cxbx-Reloaded TODO : Restore uint32_t once HLE_draw_inline_elements can using that + + unsigned int inline_buffer_length; + + unsigned int draw_arrays_length; + unsigned int draw_arrays_max_count; + + /* FIXME: Unknown size, possibly endless, 1000 will do for now */ + GLint gl_draw_arrays_start[1000]; + GLsizei gl_draw_arrays_count[1000]; + + GLuint gl_element_buffer; + GLuint gl_memory_buffer; + GLuint gl_vertex_array; + + uint32_t regs[NV_PGRAPH_SIZE]; // TODO : union +} PGRAPHState; + +typedef struct OverlayState { + bool video_buffer_use; + int pitch; + bool is_transparent; +#ifdef DEBUG + hwaddr base; + hwaddr limit; +#endif + hwaddr offset; + uint32_t in_height; + uint32_t in_width; + int out_x; + int out_y; + int out_width; + int out_height; + + bool covers_framebuffer; + int old_in_width; + int old_in_height; + int old_pitch; + GLuint gl_texture; +} OverlayState; + +typedef struct NV2AState { + // PCIDevice dev; + // qemu_irq irq; + bool exiting; + bool enable_overlay = false; + + // VGACommonState vga; + // GraphicHwOps hw_ops; + // QEMUTimer *vblank_timer; + + // MemoryRegion *vram; + // MemoryRegion vram_pci; + uint8_t *vram_ptr; + size_t vram_size; + // MemoryRegion ramin; + struct { + uint8_t *ramin_ptr; + size_t ramin_size; + } pramin; + + // MemoryRegion mmio; + // MemoryRegion block_mmio[NV_NUM_BLOCKS]; + + struct { + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + uint32_t regs[NV_PMC_SIZE]; // Not in xqemu/openxbox? TODO : union + } pmc; + + struct { + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + uint32_t regs[_NV_PFIFO_SIZE]; // TODO : union + QemuMutex pfifo_lock; + std::thread puller_thread; + QemuCond puller_cond; + std::thread pusher_thread; + QemuCond pusher_cond; + } pfifo; + + struct { + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + //QemuCond interrupt_cond; // pvideo.interrupt_cond not used (yet) + OverlayState overlays[2]; // NV2A supports 2 video overlays + uint32_t regs[NV_PVIDEO_SIZE]; // TODO : union + } pvideo; + + struct { + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + uint32_t numerator; + uint32_t denominator; + uint32_t alarm_time; + uint32_t regs[NV_PTIMER_SIZE]; // Not in xqemu/openxbox? TODO : union + } ptimer; + + struct { + uint32_t regs[NV_PFB_SIZE]; // TODO : union + } pfb; + + struct PGRAPHState pgraph; + + struct { + uint32_t pending_interrupts; + uint32_t enabled_interrupts; + hwaddr start; + uint32_t regs[NV_PCRTC_SIZE]; // Not in xqemu/openxbox? TODO : union + } pcrtc; + + struct { + uint32_t core_clock_coeff; + uint64_t core_clock_freq; + uint32_t memory_clock_coeff; + uint32_t video_clock_coeff; + uint32_t regs[NV_PRAMDAC_SIZE]; // Not in xqemu/openxbox? TODO : union + } pramdac; + + // PRMCIO (Actually the VGA controller) + struct { + uint8_t cr_index; + uint8_t cr[256]; /* CRT registers */ + } prmcio; // Not in xqemu/openxbox? +} NV2AState; + +typedef value_t(*read_func)(NV2AState *d, hwaddr addr); //, unsigned int size); +typedef void(*write_func)(NV2AState *d, hwaddr addr, value_t val); //, unsigned int size); + +typedef struct { + read_func read; + write_func write; +} MemoryRegionOps; + +#if 0 +// Valid after PCI init : +#define NV20_REG_BASE_KERNEL 0xFD000000 + +typedef volatile DWORD *PPUSH; + +typedef struct { + DWORD Ignored[0x10]; + PPUSH Put; // On Xbox1, this field is only written to by the CPU (the GPU uses this as a trigger to start executing from the given address) + PPUSH Get; // On Xbox1, this field is only read from by the CPU (the GPU reflects in here where it is/stopped executing) + PPUSH Reference; // TODO : xbaddr / void* / DWORD ? + DWORD Ignored2[0x7ED]; +} Nv2AControlDma; +#endif + +#endif diff --git a/src/devices/video/nv2a_psh.cpp b/src/devices/video/nv2a_psh.cpp index ef48257ba..55ce810bf 100644 --- a/src/devices/video/nv2a_psh.cpp +++ b/src/devices/video/nv2a_psh.cpp @@ -22,7 +22,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #include @@ -338,7 +338,7 @@ static QString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool switch (in.mod) { case PS_INPUTMAPPING_SIGNED_IDENTITY: case PS_INPUTMAPPING_UNSIGNED_IDENTITY: - QINCREF(reg); + qobject_ref(reg); res = reg; break; case PS_INPUTMAPPING_UNSIGNED_INVERT: @@ -364,7 +364,7 @@ static QString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool break; } - QDECREF(reg); + qobject_unref(reg); return res; } @@ -374,7 +374,7 @@ static QString* get_output(QString *reg, int mapping) QString *res; switch (mapping) { case PS_COMBINEROUTPUT_IDENTITY: - QINCREF(reg); + qobject_ref(reg); res = reg; break; case PS_COMBINEROUTPUT_BIAS: @@ -442,8 +442,8 @@ static void add_stage_code(struct PixelShader *ps, qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n", qstring_get_str(ab_dest), write_mask, caster, qstring_get_str(ab_mapping)); } else { - QDECREF(ab_dest); - QINCREF(ab_mapping); + qobject_unref(ab_dest); + qobject_ref(ab_mapping); ab_dest = ab_mapping; } @@ -451,8 +451,8 @@ static void add_stage_code(struct PixelShader *ps, qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n", qstring_get_str(cd_dest), write_mask, caster, qstring_get_str(cd_mapping)); } else { - QDECREF(cd_dest); - QINCREF(cd_mapping); + qobject_unref(cd_dest); + qobject_ref(cd_mapping); cd_dest = cd_mapping; } @@ -479,19 +479,19 @@ static void add_stage_code(struct PixelShader *ps, qstring_get_str(sum_dest), write_mask, caster, qstring_get_str(sum_mapping)); } - QDECREF(a); - QDECREF(b); - QDECREF(c); - QDECREF(d); - QDECREF(ab); - QDECREF(cd); - QDECREF(ab_mapping); - QDECREF(cd_mapping); - QDECREF(ab_dest); - QDECREF(cd_dest); - QDECREF(sum_dest); - QDECREF(sum); - QDECREF(sum_mapping); + qobject_unref(a); + qobject_unref(b); + qobject_unref(c); + qobject_unref(d); + qobject_unref(ab); + qobject_unref(cd); + qobject_unref(ab_mapping); + qobject_unref(cd_mapping); + qobject_unref(ab_dest); + qobject_unref(cd_dest); + qobject_unref(sum_dest); + qobject_unref(sum); + qobject_unref(sum_mapping); } // Add code for the final combiner stage @@ -513,14 +513,14 @@ static void add_final_stage_code(struct PixelShader *ps, struct FCInputInfo fina /* FIXME: Is .x correctly here? */ qstring_append_fmt(ps->code, "r0.a = vec3(%s).x;\n", qstring_get_str(g)); - QDECREF(a); - QDECREF(b); - QDECREF(c); - QDECREF(d); - QDECREF(g); + qobject_unref(a); + qobject_unref(b); + qobject_unref(c); + qobject_unref(d); + qobject_unref(g); - QDECREF(ps->varE); - QDECREF(ps->varF); + qobject_unref(ps->varE); + qobject_unref(ps->varF); ps->varE = ps->varF = NULL; } @@ -539,6 +539,42 @@ static QString* psh_convert(struct PixelShader *ps) qstring_append(preflight, "\n"); qstring_append(preflight, "uniform vec4 fogColor;\n"); + /* Window Clipping */ + QString *clip = qstring_new(); + if (ps->state.window_clip_count != 0) { + qstring_append_fmt(preflight, "uniform ivec4 clipRegion[%d];\n", + ps->state.window_clip_count); + qstring_append_fmt(clip, "/* Window-clip (%s) */\n", + ps->state.window_clip_exclusive ? + "Exclusive" : "Inclusive"); + if (!ps->state.window_clip_exclusive) { + qstring_append(clip, "bool clipContained = false;\n"); + } + qstring_append_fmt(clip, "for (int i = 0; i < %d; i++) {\n", + ps->state.window_clip_count); + qstring_append(clip, " bvec4 clipTest = bvec4(lessThan(gl_FragCoord.xy, clipRegion[i].xy),\n" + " greaterThan(gl_FragCoord.xy, clipRegion[i].zw));\n" + " if (!any(clipTest)) {\n"); + if (ps->state.window_clip_exclusive) { + /* Pixel in clip region = exclude by discarding */ + qstring_append(clip, " discard;\n"); + assert(false); /* Untested */ + } else { + /* Pixel in clip region = mark pixel as contained and leave */ + qstring_append(clip, " clipContained = true;\n" + " break;\n"); + } + qstring_append(clip, " }\n" + "}\n"); + /* Check for inclusive window clip */ + if (!ps->state.window_clip_exclusive) { + qstring_append(clip, "if (!clipContained) { discard; }\n"); + } + } else if (ps->state.window_clip_exclusive) { + /* Clip everything */ + qstring_append(clip, "discard;\n"); + } + /* calculate perspective-correct inputs */ QString *vars = qstring_new(); qstring_append(vars, "vec4 pD0 = vtx.D0 / vtx.inv_w;\n"); @@ -746,14 +782,15 @@ static QString* psh_convert(struct PixelShader *ps) qstring_append(final, "#version 330\n\n"); qstring_append(final, qstring_get_str(preflight)); qstring_append(final, "void main() {\n"); + qstring_append(final, qstring_get_str(clip)); qstring_append(final, qstring_get_str(vars)); qstring_append(final, qstring_get_str(ps->code)); qstring_append(final, "fragColor = r0;\n"); qstring_append(final, "}\n"); - QDECREF(preflight); - QDECREF(vars); - QDECREF(ps->code); + qobject_unref(preflight); + qobject_unref(vars); + qobject_unref(ps->code); return final; } diff --git a/src/devices/video/nv2a_psh.h b/src/devices/video/nv2a_psh.h index 2be7eaa50..b1b3036c2 100644 --- a/src/devices/video/nv2a_psh.h +++ b/src/devices/video/nv2a_psh.h @@ -13,7 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see + * License along with this library; if not, see * * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. @@ -52,6 +52,9 @@ typedef struct PshState { bool alpha_test; enum PshAlphaFunc alpha_func; + + bool window_clip_exclusive; + unsigned int window_clip_count; } PshState; QString *psh_translate(const PshState state); diff --git a/src/devices/video/nv2a_regs.h b/src/devices/video/nv2a_regs.h new file mode 100644 index 000000000..f34561ed4 --- /dev/null +++ b/src/devices/video/nv2a_regs.h @@ -0,0 +1,1833 @@ +// Source : https://github.com/xqemu/xqemu/blob/master/hw/xbox/nv2a_regs.h +/* + * QEMU Geforce NV2A register definitions + * + * Copyright (c) 2012 espes + * Copyright (c) 2015 Jannik Vogel + * Copyright (c) 2018 Matt Borgerson + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 or + * (at your option) version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef HW_NV2A_REGS_H +#define HW_NV2A_REGS_H + +#define NV_NUM_BLOCKS 21 +#define NV_PMC 0 /* card master control */ +#define NV_PBUS 1 /* bus control */ +#define NV_PFIFO 2 /* MMIO and DMA FIFO submission to PGRAPH and VPE */ +#define NV_PFIFO_CACHE 3 +#define NV_PRMA 4 /* access to BAR0/BAR1 from real mode */ +#define NV_PVIDEO 5 /* video overlay */ +#define NV_PTIMER 6 /* time measurement and time-based alarms */ +#define NV_PCOUNTER 7 /* performance monitoring counters */ +#define NV_PVPE 8 /* MPEG2 decoding engine */ +#define NV_PTV 9 /* TV encoder */ +#define NV_PRMFB 10 /* aliases VGA memory window */ +#define NV_PRMVIO 11 /* aliases VGA sequencer and graphics controller registers */ +#define NV_PFB 12 /* memory interface */ +#define NV_PSTRAPS 13 /* straps readout / override */ +#define NV_PGRAPH 14 /* accelerated 2d/3d drawing engine */ +#define NV_PCRTC 15 /* more CRTC controls */ +#define NV_PRMCIO 16 /* aliases VGA CRTC and attribute controller registers */ +#define NV_PRAMDAC 17 /* RAMDAC, cursor, and PLL control */ +#define NV_PRMDIO 18 /* aliases VGA palette registers */ +#define NV_PRAMIN 19 /* RAMIN access */ +#define NV_USER 20 /* PFIFO MMIO and DMA submission area */ + +#define NV_PMC_BOOT_0 0x00000000 +#define NV_PMC_BOOT_1 0x00000004 +#define NV_PMC_INTR_0 0x00000100 +# define NV_PMC_INTR_0_PFIFO (1 << 8) +# define NV_PMC_INTR_0_PGRAPH (1 << 12) +# define NV_PMC_INTR_0_PVIDEO (1 << 16) +# define NV_PMC_INTR_0_PTIMER (1 << 20) +# define NV_PMC_INTR_0_PCRTC (1 << 24) +# define NV_PMC_INTR_0_PCRTC2 (1 << 25) +# define NV_PMC_INTR_0_PBUS (1 << 28) +# define NV_PMC_INTR_0_SOFTWARE (1 << 31) +#define NV_PMC_INTR_EN_0 0x00000140 +# define NV_PMC_INTR_EN_0_HARDWARE 1 +# define NV_PMC_INTR_EN_0_SOFTWARE 2 +#define NV_PMC_ENABLE 0x00000200 +# define NV_PMC_ENABLE_PFIFO (1 << 8) +# define NV_PMC_ENABLE_PGRAPH (1 << 12) +# define NV_PMC_ENABLE_PFB (1 << 20) +# define NV_PMC_ENABLE_PCRTC (1 << 24) +# define NV_PMC_ENABLE_PCRTC2 (1 << 25) +# define NV_PMC_ENABLE_PVIDEO (1 << 28) + + +#define NV_PBUS_FBIO_RAM 0x00000218 +# define NV_PBUS_FBIO_RAM_TYPE 0x00000100 +# define NV_PBUS_FBIO_RAM_TYPE_DDR (0 << 8) +# define NV_PBUS_FBIO_RAM_TYPE_SDR (1 << 8) +/* These map approximately to the pci registers */ +#define NV_PBUS_PCI_NV_0 0x00000800 +# define NV_PBUS_PCI_NV_0_VENDOR_ID 0x0000FFFF +# define NV_CONFIG_PCI_NV_0_DEVICE_ID 0xFFFF0000 +#define NV_PBUS_PCI_NV_1 0x00000804 +#define NV_PBUS_PCI_NV_2 0x00000808 +# define NV_PBUS_PCI_NV_2_REVISION_ID 0x000000FF +# define NV_PBUS_PCI_NV_2_CLASS_CODE 0xFFFFFF00 +#define NV_PBUS_PCI_NV_3 0x0000080C +#define NV_PBUS_PCI_NV_4 0x00000810 +#define NV_PBUS_PCI_NV_5 0x00000814 +#define NV_PBUS_PCI_NV_6 0x00000818 +#define NV_PBUS_PCI_NV_7 0x0000081C +#define NV_PBUS_PCI_NV_11 0x0000082C +#define NV_PBUS_PCI_NV_12 0x00000830 +#define NV_PBUS_PCI_NV_13 0x00000834 +#define NV_PBUS_PCI_NV_14 0x00000838 +#define NV_PBUS_PCI_NV_15 0x0000083C +#define NV_PBUS_PCI_NV_16 0x00000840 +#define NV_PBUS_PCI_NV_17 0x00000844 +#define NV_PBUS_PCI_NV_18 0x00000848 +#define NV_PBUS_PCI_NV_19 0x0000084C +#define NV_PBUS_PCI_NV_20 0x00000850 +#define NV_PBUS_PCI_NV_21 0x00000854 +#define NV_PBUS_PCI_NV_22 0x00000858 +#define NV_PBUS_PCI_NV_23 0x0000085C +#define NV_PBUS_PCI_NV_24 0x00000860 +#define NV_PBUS_PCI_NV_25 0x00000864 +#define NV_PBUS_PCI_NV_26 0x00000868 + + +#define NV_PFIFO_DELAY_0 0x00000040 +#define NV_PFIFO_DMA_TIMESLICE 0x00000044 +#define NV_PFIFO_TIMESLICE 0x0000004C +#define NV_PFIFO_INTR_0 0x00000100 +# define NV_PFIFO_INTR_0_CACHE_ERROR (1 << 0) +# define NV_PFIFO_INTR_0_RUNOUT (1 << 4) +# define NV_PFIFO_INTR_0_RUNOUT_OVERFLOW (1 << 8) +# define NV_PFIFO_INTR_0_DMA_PUSHER (1 << 12) +# define NV_PFIFO_INTR_0_DMA_PT (1 << 16) +# define NV_PFIFO_INTR_0_SEMAPHORE (1 << 20) +# define NV_PFIFO_INTR_0_ACQUIRE_TIMEOUT (1 << 24) +#define NV_PFIFO_INTR_EN_0 0x00000140 +# define NV_PFIFO_INTR_EN_0_CACHE_ERROR (1 << 0) +# define NV_PFIFO_INTR_EN_0_RUNOUT (1 << 4) +# define NV_PFIFO_INTR_EN_0_RUNOUT_OVERFLOW (1 << 8) +# define NV_PFIFO_INTR_EN_0_DMA_PUSHER (1 << 12) +# define NV_PFIFO_INTR_EN_0_DMA_PT (1 << 16) +# define NV_PFIFO_INTR_EN_0_SEMAPHORE (1 << 20) +# define NV_PFIFO_INTR_EN_0_ACQUIRE_TIMEOUT (1 << 24) +#define NV_PFIFO_RAMHT 0x00000210 +//# define NV_PFIFO_RAMHT_BASE_ADDRESS 0x000001F0 +# define NV_PFIFO_RAMHT_BASE_ADDRESS_MASK 0x000001F0 +# define NV_PFIFO_RAMHT_BASE_ADDRESS_SHIFT 4 +# define NV_PFIFO_RAMHT_BASE_ADDRESS_MOVE 12 +//# define NV_PFIFO_RAMHT_SIZE 0x00030000 +# define NV_PFIFO_RAMHT_SIZE_MASK 0x00030000 +# define NV_PFIFO_RAMHT_SIZE_SHIFT 16 +# define NV_PFIFO_RAMHT_SIZE_4K 0 +# define NV_PFIFO_RAMHT_SIZE_8K 1 +# define NV_PFIFO_RAMHT_SIZE_16K 2 +# define NV_PFIFO_RAMHT_SIZE_32K 3 +//# define NV_PFIFO_RAMHT_SEARCH 0x03000000 +# define NV_PFIFO_RAMHT_SEARCH_MASK 0x03000000 +# define NV_PFIFO_RAMHT_SEARCH_SHIFT 24 +# define NV_PFIFO_RAMHT_SEARCH_16 0 +# define NV_PFIFO_RAMHT_SEARCH_32 1 +# define NV_PFIFO_RAMHT_SEARCH_64 2 +# define NV_PFIFO_RAMHT_SEARCH_128 3 +#define NV_PFIFO_RAMFC 0x00000214 +//# define NV_PFIFO_RAMFC_BASE_ADDRESS1 0x000001FC +# define NV_PFIFO_RAMFC_BASE_ADDRESS1_MASK 0x000001FC +# define NV_PFIFO_RAMFC_BASE_ADDRESS1_SHIFT 2 +# define NV_PFIFO_RAMFC_BASE_ADDRESS1_MOVE 10 +//# define NV_PFIFO_RAMFC_SIZE 0x00010000 +# define NV_PFIFO_RAMFC_SIZE_MASK 0x00010000 +# define NV_PFIFO_RAMFC_SIZE_1K 0x00000000 +# define NV_PFIFO_RAMFC_SIZE_2K 0x00010000 +//# define NV_PFIFO_RAMFC_BASE_ADDRESS2 0x00FE0000 +# define NV_PFIFO_RAMFC_BASE_ADDRESS2_MASK 0x00FE0000 +# define NV_PFIFO_RAMFC_BASE_ADDRESS2_SHIFT 17 +# define NV_PFIFO_RAMFC_BASE_ADDRESS2_MOVE 10 +#define NV_PFIFO_RAMRO 0x00000218 +# define NV_PFIFO_RAMRO_BASE_ADDRESS 0x000001FE +# define NV_PFIFO_RAMRO_SIZE 0x00010000 +#define NV_PFIFO_RUNOUT_STATUS 0x00000400 +# define NV_PFIFO_RUNOUT_STATUS_RANOUT (1 << 0) +# define NV_PFIFO_RUNOUT_STATUS_LOW_MARK (1 << 4) +# define NV_PFIFO_RUNOUT_STATUS_HIGH_MARK (1 << 8) +#define NV_PFIFO_RUNOUT_PUT_ADDRESS 0x00000410 +#define NV_PFIFO_RUNOUT_GET_ADDRESS 0x00000420 +#define NV_PFIFO_CACHES 0x00000500 +#define NV_PFIFO_MODE 0x00000504 +#define NV_PFIFO_DMA 0x00000508 +#define NV_PFIFO_SIZE 0x0000050C +#define NV_PFIFO_CACHE0_PUSH0 0x00001000 +#define NV_PFIFO_CACHE0_PULL0 0x00001050 +#define NV_PFIFO_CACHE0_HASH 0x00001058 +#define NV_PFIFO_CACHE1_PUSH0 0x00001200 +# define NV_PFIFO_CACHE1_PUSH0_ACCESS (1 << 0) +#define NV_PFIFO_CACHE1_PUSH1 0x00001204 +# define NV_PFIFO_CACHE1_PUSH1_CHID 0x0000001F +# define NV_PFIFO_CACHE1_PUSH1_MODE 0x00000100 +# define NV_PFIFO_CACHE1_PUSH1_MODE_PIO 0 +# define NV_PFIFO_CACHE1_PUSH1_MODE_DMA 1 +#define NV_PFIFO_CACHE1_PUT 0x00001210 +#define NV_PFIFO_CACHE1_STATUS 0x00001214 +# define NV_PFIFO_CACHE1_STATUS_LOW_MARK (1 << 4) +# define NV_PFIFO_CACHE1_STATUS_HIGH_MARK (1 << 8) +#define NV_PFIFO_CACHE1_DMA_PUSH 0x00001220 +# define NV_PFIFO_CACHE1_DMA_PUSH_ACCESS (1 << 0) +# define NV_PFIFO_CACHE1_DMA_PUSH_STATE (1 << 4) +# define NV_PFIFO_CACHE1_DMA_PUSH_BUFFER (1 << 8) +# define NV_PFIFO_CACHE1_DMA_PUSH_STATUS (1 << 12) +# define NV_PFIFO_CACHE1_DMA_PUSH_ACQUIRE (1 << 16) +#define NV_PFIFO_CACHE1_DMA_FETCH 0x00001224 +# define NV_PFIFO_CACHE1_DMA_FETCH_TRIG 0x000000F8 +# define NV_PFIFO_CACHE1_DMA_FETCH_SIZE 0x0000E000 +# define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS 0x001F0000 +#define NV_PFIFO_CACHE1_DMA_STATE 0x00001228 +# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE (1 << 0) +# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_INC 0 +# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_NON_INC 1 +# define NV_PFIFO_CACHE1_DMA_STATE_METHOD 0x00001FFC +# define NV_PFIFO_CACHE1_DMA_STATE_SUBCHANNEL 0x0000E000 +# define NV_PFIFO_CACHE1_DMA_STATE_METHOD_COUNT 0x1FFC0000 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR 0xE0000000 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_NONE 0 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_CALL 1 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_NON_CACHE 2 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_RETURN 3 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD 4 +# define NV_PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION 6 +#define NV_PFIFO_CACHE1_DMA_INSTANCE 0x0000122C +//# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS 0x0000FFFF +# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MASK 0x0000FFFF +# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_SHIFT 0 +# define NV_PFIFO_CACHE1_DMA_INSTANCE_ADDRESS_MOVE 4 +#define NV_PFIFO_CACHE1_DMA_CTL 0x00001230 +#define NV_PFIFO_CACHE1_DMA_PUT 0x00001240 +#define NV_PFIFO_CACHE1_DMA_GET 0x00001244 +#define NV_PFIFO_CACHE1_REF 0x00001248 +#define NV_PFIFO_CACHE1_DMA_SUBROUTINE 0x0000124C +# define NV_PFIFO_CACHE1_DMA_SUBROUTINE_RETURN_OFFSET 0x1FFFFFFC +# define NV_PFIFO_CACHE1_DMA_SUBROUTINE_STATE (1 << 0) +#define NV_PFIFO_CACHE1_PULL0 0x00001250 +# define NV_PFIFO_CACHE1_PULL0_ACCESS (1 << 0) +#define NV_PFIFO_CACHE1_PULL1 0x00001254 +# define NV_PFIFO_CACHE1_PULL1_ENGINE 0x00000003 +#define NV_PFIFO_CACHE1_HASH 0x00001258 +#define NV_PFIFO_CACHE1_ACQUIRE_0 0x00001260 +#define NV_PFIFO_CACHE1_ACQUIRE_1 0x00001264 +#define NV_PFIFO_CACHE1_ACQUIRE_2 0x00001268 +#define NV_PFIFO_CACHE1_SEMAPHORE 0x0000126C +#define NV_PFIFO_CACHE1_GET 0x00001270 +#define NV_PFIFO_CACHE1_ENGINE 0x00001280 +#define NV_PFIFO_CACHE1_DMA_DCOUNT 0x000012A0 +# define NV_PFIFO_CACHE1_DMA_DCOUNT_VALUE 0x00001FFC +#define NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW 0x000012A4 +# define NV_PFIFO_CACHE1_DMA_GET_JMP_SHADOW_OFFSET 0x1FFFFFFC +#define NV_PFIFO_CACHE1_DMA_RSVD_SHADOW 0x000012A8 +#define NV_PFIFO_CACHE1_DMA_DATA_SHADOW 0x000012AC +#define NV_PFIFO_CACHE1_METHOD 0x00001800 +# define NV_PFIFO_CACHE1_METHOD_TYPE (1 << 0) +# define NV_PFIFO_CACHE1_METHOD_ADDRESS 0x00001FFC +# define NV_PFIFO_CACHE1_METHOD_SUBCHANNEL 0x0000E000 +#define NV_PFIFO_CACHE1_DATA 0x00001804 + + +#define NV_PGRAPH_DEBUG_0 0x00000080 +#define NV_PGRAPH_DEBUG_1 0x00000084 +#define NV_PGRAPH_DEBUG_3 0x0000008C +# define NV_PGRAPH_DEBUG_3_HW_CONTEXT_SWITCH (1 << 2) +#define NV_PGRAPH_DEBUG_4 0x00000090 +#define NV_PGRAPH_DEBUG_5 0x00000094 +#define NV_PGRAPH_DEBUG_8 0x00000098 +#define NV_PGRAPH_DEBUG_9 0x0000009C +#define NV_PGRAPH_INTR 0x00000100 +# define NV_PGRAPH_INTR_NOTIFY (1 << 0) +# define NV_PGRAPH_INTR_MISSING_HW (1 << 4) +# define NV_PGRAPH_INTR_TLB_PRESENT_DMA_R (1 << 6) +# define NV_PGRAPH_INTR_TLB_PRESENT_DMA_W (1 << 7) +# define NV_PGRAPH_INTR_TLB_PRESENT_TEX_A (1 << 8) +# define NV_PGRAPH_INTR_TLB_PRESENT_TEX_B (1 << 9) +# define NV_PGRAPH_INTR_TLB_PRESENT_VTX (1 << 10) +# define NV_PGRAPH_INTR_CONTEXT_SWITCH (1 << 12) +# define NV_PGRAPH_INTR_STATE3D (1 << 13) +# define NV_PGRAPH_INTR_BUFFER_NOTIFY (1 << 16) +# define NV_PGRAPH_INTR_ERROR (1 << 20) +# define NV_PGRAPH_INTR_SINGLE_STEP (1 << 24) +#define NV_PGRAPH_NSOURCE 0x00000108 +# define NV_PGRAPH_NSOURCE_NOTIFICATION (1 << 0) +#define NV_PGRAPH_INTR_EN 0x00000140 +# define NV_PGRAPH_INTR_EN_NOTIFY (1 << 0) +# define NV_PGRAPH_INTR_EN_MISSING_HW (1 << 4) +# define NV_PGRAPH_INTR_EN_TLB_PRESENT_DMA_R (1 << 6) +# define NV_PGRAPH_INTR_EN_TLB_PRESENT_DMA_W (1 << 7) +# define NV_PGRAPH_INTR_EN_TLB_PRESENT_TEX_A (1 << 8) +# define NV_PGRAPH_INTR_EN_TLB_PRESENT_TEX_B (1 << 9) +# define NV_PGRAPH_INTR_EN_TLB_PRESENT_VTX (1 << 10) +# define NV_PGRAPH_INTR_EN_CONTEXT_SWITCH (1 << 12) +# define NV_PGRAPH_INTR_EN_STATE3D (1 << 13) +# define NV_PGRAPH_INTR_EN_BUFFER_NOTIFY (1 << 16) +# define NV_PGRAPH_INTR_EN_ERROR (1 << 20) +# define NV_PGRAPH_INTR_EN_SINGLE_STEP (1 << 24) +#define NV_PGRAPH_CTX_CONTROL 0x00000144 +# define NV_PGRAPH_CTX_CONTROL_MINIMUM_TIME 0x00000003 +# define NV_PGRAPH_CTX_CONTROL_TIME (1 << 8) +# define NV_PGRAPH_CTX_CONTROL_CHID (1 << 16) +# define NV_PGRAPH_CTX_CONTROL_CHANGE (1 << 20) +# define NV_PGRAPH_CTX_CONTROL_SWITCHING (1 << 24) +# define NV_PGRAPH_CTX_CONTROL_DEVICE (1 << 28) +#define NV_PGRAPH_CTX_USER 0x00000148 +# define NV_PGRAPH_CTX_USER_CHANNEL_3D (1 << 0) +# define NV_PGRAPH_CTX_USER_CHANNEL_3D_VALID (1 << 4) +# define NV_PGRAPH_CTX_USER_SUBCH 0x0000E000 +# define NV_PGRAPH_CTX_USER_CHID 0x1F000000 +# define NV_PGRAPH_CTX_USER_SINGLE_STEP (1 << 31) +#define NV_PGRAPH_CTX_SWITCH1 0x0000014C +# define NV_PGRAPH_CTX_SWITCH1_GRCLASS 0x000000FF +# define NV_PGRAPH_CTX_SWITCH1_CHROMA_KEY (1 << 12) +# define NV_PGRAPH_CTX_SWITCH1_SWIZZLE (1 << 14) +# define NV_PGRAPH_CTX_SWITCH1_PATCH_CONFIG 0x00038000 +# define NV_PGRAPH_CTX_SWITCH1_SYNCHRONIZE (1 << 18) +# define NV_PGRAPH_CTX_SWITCH1_ENDIAN_MODE (1 << 19) +# define NV_PGRAPH_CTX_SWITCH1_CLASS_TYPE (1 << 22) +# define NV_PGRAPH_CTX_SWITCH1_SINGLE_STEP (1 << 23) +# define NV_PGRAPH_CTX_SWITCH1_PATCH_STATUS (1 << 24) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_SURFACE0 (1 << 25) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_SURFACE1 (1 << 26) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_PATTERN (1 << 27) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_ROP (1 << 28) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_BETA1 (1 << 29) +# define NV_PGRAPH_CTX_SWITCH1_CONTEXT_BETA4 (1 << 30) +# define NV_PGRAPH_CTX_SWITCH1_VOLATILE_RESET (1 << 31) +#define NV_PGRAPH_CTX_SWITCH2 0x00000150 +#define NV_PGRAPH_CTX_SWITCH3 0x00000154 +#define NV_PGRAPH_CTX_SWITCH4 0x00000158 +# define NV_PGRAPH_CTX_SWITCH4_USER_INSTANCE 0x0000FFFF +#define NV_PGRAPH_CTX_SWITCH5 0x0000015C +#define NV_PGRAPH_CTX_CACHE1 0x00000160 +#define NV_PGRAPH_CTX_CACHE2 0x00000180 +#define NV_PGRAPH_CTX_CACHE3 0x000001A0 +#define NV_PGRAPH_CTX_CACHE4 0x000001C0 +#define NV_PGRAPH_CTX_CACHE5 0x000001E0 +#define NV_PGRAPH_STATUS 0x00000700 +#define NV_PGRAPH_TRAPPED_ADDR 0x00000704 +# define NV_PGRAPH_TRAPPED_ADDR_MTHD 0x00001FFF +# define NV_PGRAPH_TRAPPED_ADDR_SUBCH 0x00070000 +# define NV_PGRAPH_TRAPPED_ADDR_CHID 0x01F00000 +# define NV_PGRAPH_TRAPPED_ADDR_DHV 0x10000000 +#define NV_PGRAPH_TRAPPED_DATA_LOW 0x00000708 +#define NV_PGRAPH_SURFACE 0x00000710 +# define NV_PGRAPH_SURFACE_WRITE_3D 0x00700000 +# define NV_PGRAPH_SURFACE_READ_3D 0x07000000 +# define NV_PGRAPH_SURFACE_MODULO_3D 0x70000000 +#define NV_PGRAPH_INCREMENT 0x0000071C +# define NV_PGRAPH_INCREMENT_READ_BLIT (1 << 0) +# define NV_PGRAPH_INCREMENT_READ_3D (1 << 1) +#define NV_PGRAPH_FIFO 0x00000720 +# define NV_PGRAPH_FIFO_ACCESS (1 << 0) +#define NV_PGRAPH_RDI_INDEX 0x00000750 +#define NV_PGRAPH_RDI_DATA 0x00000754 +#define NV_PGRAPH_FFINTFC_ST2 0x00000764 +#define NV_PGRAPH_CHANNEL_CTX_TABLE 0x00000780 +# define NV_PGRAPH_CHANNEL_CTX_TABLE_INST 0x0000FFFF +#define NV_PGRAPH_CHANNEL_CTX_POINTER 0x00000784 +# define NV_PGRAPH_CHANNEL_CTX_POINTER_INST 0x0000FFFF +#define NV_PGRAPH_CHANNEL_CTX_TRIGGER 0x00000788 +# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_READ_IN (1 << 0) +# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_WRITE_OUT (1 << 1) +#define NV_PGRAPH_DEBUG_2 0x00000880 +#define NV_PGRAPH_TTILE(i) 0x00000900 + (i * 0x10) +#define NV_PGRAPH_TLIMIT(i) 0x00000904 + (i * 0x10) +#define NV_PGRAPH_TSIZE(i) 0x00000908 + (i * 0x10) +#define NV_PGRAPH_TSTATUS(i) 0x0000090C + (i * 0x10) +#define NV_PGRAPH_ZCOMP(i) 0x00000980 + (i * 4) +#define NV_PGRAPH_ZCOMP_OFFSET 0x000009A0 +#define NV_PGRAPH_FBCFG0 0x000009A4 +#define NV_PGRAPH_FBCFG1 0x000009A8 +#define NV_PGRAPH_PATT_COLOR0 0x00000B10 +#define NV_PGRAPH_DEBUG_6 0x00000B80 +#define NV_PGRAPH_DEBUG_7 0x00000B84 +#define NV_PGRAPH_DEBUG_10 0x00000B88 +#define NV_PGRAPH_CSV0_D 0x00000FB4 +# define NV_PGRAPH_CSV0_D_LIGHTS 0x0000FFFF +# define NV_PGRAPH_CSV0_D_LIGHT0 0x00000003 +# define NV_PGRAPH_CSV0_D_LIGHT0_OFF 0 +# define NV_PGRAPH_CSV0_D_LIGHT0_INFINITE 1 +# define NV_PGRAPH_CSV0_D_LIGHT0_LOCAL 2 +# define NV_PGRAPH_CSV0_D_LIGHT0_SPOT 3 +# define NV_PGRAPH_CSV0_D_RANGE_MODE (1 << 18) +# define NV_PGRAPH_CSV0_D_FOGENABLE (1 << 19) +# define NV_PGRAPH_CSV0_D_TEXGEN_REF (1 << 20) +# define NV_PGRAPH_CSV0_D_TEXGEN_REF_LOCAL_VIEWER 0 +# define NV_PGRAPH_CSV0_D_TEXGEN_REF_INFINITE_VIEWER 1 +# define NV_PGRAPH_CSV0_D_FOG_MODE (1 << 21) +# define NV_PGRAPH_CSV0_D_FOG_MODE_LINEAR 0 +# define NV_PGRAPH_CSV0_D_FOG_MODE_EXP 1 +# define NV_PGRAPH_CSV0_D_FOGGENMODE 0x01C00000 +# define NV_PGRAPH_CSV0_D_FOGGENMODE_SPEC_ALPHA 0 +# define NV_PGRAPH_CSV0_D_FOGGENMODE_RADIAL 1 +# define NV_PGRAPH_CSV0_D_FOGGENMODE_PLANAR 2 +# define NV_PGRAPH_CSV0_D_FOGGENMODE_ABS_PLANAR 3 +# define NV_PGRAPH_CSV0_D_FOGGENMODE_FOG_X 4 +# define NV_PGRAPH_CSV0_D_MODE 0xC0000000 +# define NV_PGRAPH_CSV0_D_SKIN 0x1C000000 +# define NV_PGRAPH_CSV0_D_SKIN_OFF 0 +# define NV_PGRAPH_CSV0_D_SKIN_2G 1 +# define NV_PGRAPH_CSV0_D_SKIN_2 2 +# define NV_PGRAPH_CSV0_D_SKIN_3G 3 +# define NV_PGRAPH_CSV0_D_SKIN_3 4 +# define NV_PGRAPH_CSV0_D_SKIN_4G 5 +# define NV_PGRAPH_CSV0_D_SKIN_4 6 +#define NV_PGRAPH_CSV0_C 0x00000FB8 +# define NV_PGRAPH_CSV0_C_CHEOPS_PROGRAM_START 0x0000FF00 +# define NV_PGRAPH_CSV0_C_NORMALIZATION_ENABLE (1 << 27) +# define NV_PGRAPH_CSV0_C_LIGHTING (1 << 31) +#define NV_PGRAPH_CSV1_B 0x00000FBC +#define NV_PGRAPH_CSV1_A 0x00000FC0 +# define NV_PGRAPH_CSV1_A_T0_ENABLE (1 << 0) +# define NV_PGRAPH_CSV1_A_T0_MODE (1 << 1) +# define NV_PGRAPH_CSV1_A_T0_TEXTURE (1 << 2) +# define NV_PGRAPH_CSV1_A_T0_TEXTURE_2D 0 +# define NV_PGRAPH_CSV1_A_T0_TEXTURE_3D 1 +# define NV_PGRAPH_CSV1_A_T0_S 0x00000070 +# define NV_PGRAPH_CSV1_A_T0_S_DISABLE 0 +# define NV_PGRAPH_CSV1_A_T0_S_NORMAL_MAP 4 +# define NV_PGRAPH_CSV1_A_T0_S_REFLECTION_MAP 5 +# define NV_PGRAPH_CSV1_A_T0_S_EYE_LINEAR 1 +# define NV_PGRAPH_CSV1_A_T0_S_OBJECT_LINEAR 2 +# define NV_PGRAPH_CSV1_A_T0_S_SPHERE_MAP 3 +# define NV_PGRAPH_CSV1_A_T0_T 0x00000380 +# define NV_PGRAPH_CSV1_A_T0_R 0x00001C00 +# define NV_PGRAPH_CSV1_A_T0_Q 0x0000E000 +# define NV_PGRAPH_CSV1_A_T1_ENABLE (1 << 16) +# define NV_PGRAPH_CSV1_A_T1_MODE (1 << 17) +# define NV_PGRAPH_CSV1_A_T1_TEXTURE (1 << 18) +# define NV_PGRAPH_CSV1_A_T1_S 0x00700000 +# define NV_PGRAPH_CSV1_A_T1_T 0x03800000 +# define NV_PGRAPH_CSV1_A_T1_R 0x1C000000 +# define NV_PGRAPH_CSV1_A_T1_Q 0xE0000000 +#define NV_PGRAPH_CHEOPS_OFFSET 0x00000FC4 +# define NV_PGRAPH_CHEOPS_OFFSET_PROG_LD_PTR 0x000000FF +# define NV_PGRAPH_CHEOPS_OFFSET_CONST_LD_PTR 0x0000FF00 +#define NV_PGRAPH_DMA_STATE 0x00001034 +#define NV_PGRAPH_BLEND 0x00001804 +# define NV_PGRAPH_BLEND_EQN 0x00000007 +# define NV_PGRAPH_BLEND_EN (1 << 3) +# define NV_PGRAPH_BLEND_SFACTOR 0x000000F0 +# define NV_PGRAPH_BLEND_SFACTOR_ZERO 0 +# define NV_PGRAPH_BLEND_SFACTOR_ONE 1 +# define NV_PGRAPH_BLEND_SFACTOR_SRC_COLOR 2 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_SRC_COLOR 3 +# define NV_PGRAPH_BLEND_SFACTOR_SRC_ALPHA 4 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_SRC_ALPHA 5 +# define NV_PGRAPH_BLEND_SFACTOR_DST_ALPHA 6 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_DST_ALPHA 7 +# define NV_PGRAPH_BLEND_SFACTOR_DST_COLOR 8 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_DST_COLOR 9 +# define NV_PGRAPH_BLEND_SFACTOR_SRC_ALPHA_SATURATE 10 +# define NV_PGRAPH_BLEND_SFACTOR_CONSTANT_COLOR 12 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_CONSTANT_COLOR 13 +# define NV_PGRAPH_BLEND_SFACTOR_CONSTANT_ALPHA 14 +# define NV_PGRAPH_BLEND_SFACTOR_ONE_MINUS_CONSTANT_ALPHA 15 +# define NV_PGRAPH_BLEND_DFACTOR 0x00000F00 +# define NV_PGRAPH_BLEND_DFACTOR_ZERO 0 +# define NV_PGRAPH_BLEND_DFACTOR_ONE 1 +# define NV_PGRAPH_BLEND_DFACTOR_SRC_COLOR 2 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_SRC_COLOR 3 +# define NV_PGRAPH_BLEND_DFACTOR_SRC_ALPHA 4 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_SRC_ALPHA 5 +# define NV_PGRAPH_BLEND_DFACTOR_DST_ALPHA 6 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_DST_ALPHA 7 +# define NV_PGRAPH_BLEND_DFACTOR_DST_COLOR 8 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_DST_COLOR 9 +# define NV_PGRAPH_BLEND_DFACTOR_SRC_ALPHA_SATURATE 10 +# define NV_PGRAPH_BLEND_DFACTOR_CONSTANT_COLOR 12 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_CONSTANT_COLOR 13 +# define NV_PGRAPH_BLEND_DFACTOR_CONSTANT_ALPHA 14 +# define NV_PGRAPH_BLEND_DFACTOR_ONE_MINUS_CONSTANT_ALPHA 15 +# define NV_PGRAPH_BLEND_LOGICOP_ENABLE (1 << 16) +# define NV_PGRAPH_BLEND_LOGICOP 0x0000F000 +#define NV_PGRAPH_BLENDCOLOR 0x00001808 +#define NV_PGRAPH_BORDERCOLOR0 0x0000180C +#define NV_PGRAPH_BORDERCOLOR1 0x00001810 +#define NV_PGRAPH_BORDERCOLOR2 0x00001814 +#define NV_PGRAPH_BORDERCOLOR3 0x00001818 +#define NV_PGRAPH_BUMPOFFSET1 0x0000184C +#define NV_PGRAPH_BUMPSCALE1 0x00001858 +#define NV_PGRAPH_CLEARRECTX 0x00001864 +# define NV_PGRAPH_CLEARRECTX_XMIN 0x00000FFF +# define NV_PGRAPH_CLEARRECTX_XMAX 0x0FFF0000 +#define NV_PGRAPH_CLEARRECTY 0x00001868 +# define NV_PGRAPH_CLEARRECTY_YMIN 0x00000FFF +# define NV_PGRAPH_CLEARRECTY_YMAX 0x0FFF0000 +#define NV_PGRAPH_COLORCLEARVALUE 0x0000186C +#define NV_PGRAPH_COMBINEFACTOR0 0x00001880 +#define NV_PGRAPH_COMBINEFACTOR1 0x000018A0 +#define NV_PGRAPH_COMBINEALPHAI0 0x000018C0 +#define NV_PGRAPH_COMBINEALPHAO0 0x000018E0 +#define NV_PGRAPH_COMBINECOLORI0 0x00001900 +#define NV_PGRAPH_COMBINECOLORO0 0x00001920 +#define NV_PGRAPH_COMBINECTL 0x00001940 +#define NV_PGRAPH_COMBINESPECFOG0 0x00001944 +#define NV_PGRAPH_COMBINESPECFOG1 0x00001948 +#define NV_PGRAPH_CONTROL_0 0x0000194C +# define NV_PGRAPH_CONTROL_0_ALPHAREF 0x000000FF +# define NV_PGRAPH_CONTROL_0_ALPHAFUNC 0x00000F00 +# define NV_PGRAPH_CONTROL_0_ALPHATESTENABLE (1 << 12) +# define NV_PGRAPH_CONTROL_0_ZENABLE (1 << 14) +# define NV_PGRAPH_CONTROL_0_ZFUNC 0x000F0000 +# define NV_PGRAPH_CONTROL_0_ZFUNC_NEVER 0 +# define NV_PGRAPH_CONTROL_0_ZFUNC_LESS 1 +# define NV_PGRAPH_CONTROL_0_ZFUNC_EQUAL 2 +# define NV_PGRAPH_CONTROL_0_ZFUNC_LEQUAL 3 +# define NV_PGRAPH_CONTROL_0_ZFUNC_GREATER 4 +# define NV_PGRAPH_CONTROL_0_ZFUNC_NOTEQUAL 5 +# define NV_PGRAPH_CONTROL_0_ZFUNC_GEQUAL 6 +# define NV_PGRAPH_CONTROL_0_ZFUNC_ALWAYS 7 +# define NV_PGRAPH_CONTROL_0_DITHERENABLE (1 << 22) +# define NV_PGRAPH_CONTROL_0_Z_PERSPECTIVE_ENABLE (1 << 23) +# define NV_PGRAPH_CONTROL_0_ZWRITEENABLE (1 << 24) +# define NV_PGRAPH_CONTROL_0_STENCIL_WRITE_ENABLE (1 << 25) +# define NV_PGRAPH_CONTROL_0_ALPHA_WRITE_ENABLE (1 << 26) +# define NV_PGRAPH_CONTROL_0_RED_WRITE_ENABLE (1 << 27) +# define NV_PGRAPH_CONTROL_0_GREEN_WRITE_ENABLE (1 << 28) +# define NV_PGRAPH_CONTROL_0_BLUE_WRITE_ENABLE (1 << 29) +# define NV_PGRAPH_CONTROL_0_CSCONVERT (3 << 30) +#define NV_PGRAPH_CONTROL_1 0x00001950 +# define NV_PGRAPH_CONTROL_1_STENCIL_TEST_ENABLE (1 << 0) +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC 0x000000F0 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_NEVER 0 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_LESS 1 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_EQUAL 2 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_LEQUAL 3 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_GREATER 4 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_NOTEQUAL 5 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_GEQUAL 6 +# define NV_PGRAPH_CONTROL_1_STENCIL_FUNC_ALWAYS 7 +# define NV_PGRAPH_CONTROL_1_STENCIL_REF 0x0000FF00 +# define NV_PGRAPH_CONTROL_1_STENCIL_MASK_READ 0x00FF0000 +# define NV_PGRAPH_CONTROL_1_STENCIL_MASK_WRITE 0xFF000000 +#define NV_PGRAPH_CONTROL_2 0x00001954 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_FAIL 0x0000000F +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_ZFAIL 0x000000F0 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_ZPASS 0x00000F00 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_KEEP 1 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_ZERO 2 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_REPLACE 3 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INCRSAT 4 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_DECRSAT 5 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INVERT 6 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_INCR 7 +# define NV_PGRAPH_CONTROL_2_STENCIL_OP_V_DECR 8 +#define NV_PGRAPH_CONTROL_3 0x00001958 +# define NV_PGRAPH_CONTROL_3_FOGENABLE (1 << 8) +# define NV_PGRAPH_CONTROL_3_FOG_MODE 0x00070000 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_LINEAR 0 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP 1 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP2 3 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP_ABS 5 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_EXP2_ABS 7 +# define NV_PGRAPH_CONTROL_3_FOG_MODE_LINEAR_ABS 4 +#define NV_PGRAPH_FOGCOLOR 0x00001980 +# define NV_PGRAPH_FOGCOLOR_RED 0x00FF0000 +# define NV_PGRAPH_FOGCOLOR_GREEN 0x0000FF00 +# define NV_PGRAPH_FOGCOLOR_BLUE 0x000000FF +# define NV_PGRAPH_FOGCOLOR_ALPHA 0xFF000000 +#define NV_PGRAPH_FOGPARAM0 0x00001984 +#define NV_PGRAPH_FOGPARAM1 0x00001988 +#define NV_PGRAPH_SETUPRASTER 0x00001990 +# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE 0x00000003 +# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_FILL 0 +# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_POINT 1 +# define NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_LINE 2 +# define NV_PGRAPH_SETUPRASTER_BACKFACEMODE 0x0000000C +# define NV_PGRAPH_SETUPRASTER_POFFSETPOINTENABLE (1 << 6) +# define NV_PGRAPH_SETUPRASTER_POFFSETLINEENABLE (1 << 7) +# define NV_PGRAPH_SETUPRASTER_POFFSETFILLENABLE (1 << 8) +# define NV_PGRAPH_SETUPRASTER_CULLCTRL 0x00600000 +# define NV_PGRAPH_SETUPRASTER_CULLCTRL_FRONT 1 +# define NV_PGRAPH_SETUPRASTER_CULLCTRL_BACK 2 +# define NV_PGRAPH_SETUPRASTER_CULLCTRL_FRONT_AND_BACK 3 +# define NV_PGRAPH_SETUPRASTER_FRONTFACE (1 << 23) +# define NV_PGRAPH_SETUPRASTER_CULLENABLE (1 << 28) +# define NV_PGRAPH_SETUPRASTER_Z_FORMAT (1 << 29) +# define NV_PGRAPH_SETUPRASTER_WINDOWCLIPTYPE (1 << 31) +#define NV_PGRAPH_SHADERCLIPMODE 0x00001994 +#define NV_PGRAPH_SHADERCTL 0x00001998 +#define NV_PGRAPH_SHADERPROG 0x0000199C +#define NV_PGRAPH_SEMAPHOREOFFSET 0x000019A0 +#define NV_PGRAPH_SHADOWZSLOPETHRESHOLD 0x000019A8 +#define NV_PGRAPH_SPECFOGFACTOR0 0x000019AC +#define NV_PGRAPH_SPECFOGFACTOR1 0x000019B0 +#define NV_PGRAPH_TEXADDRESS0 0x000019BC +# define NV_PGRAPH_TEXADDRESS0_ADDRU 0x00000007 +# define NV_PGRAPH_TEXADDRESS0_ADDRU_WRAP 1 +# define NV_PGRAPH_TEXADDRESS0_ADDRU_MIRROR 2 +# define NV_PGRAPH_TEXADDRESS0_ADDRU_CLAMP_TO_EDGE 3 +# define NV_PGRAPH_TEXADDRESS0_ADDRU_BORDER 4 +# define NV_PGRAPH_TEXADDRESS0_ADDRU_CLAMP_OGL 5 +# define NV_PGRAPH_TEXADDRESS0_WRAP_U (1 << 4) +# define NV_PGRAPH_TEXADDRESS0_ADDRV 0x00000700 +# define NV_PGRAPH_TEXADDRESS0_WRAP_V (1 << 12) +# define NV_PGRAPH_TEXADDRESS0_ADDRP 0x00070000 +# define NV_PGRAPH_TEXADDRESS0_WRAP_P (1 << 20) +# define NV_PGRAPH_TEXADDRESS0_WRAP_Q (1 << 24) +#define NV_PGRAPH_TEXADDRESS1 0x000019C0 +#define NV_PGRAPH_TEXADDRESS2 0x000019C4 +#define NV_PGRAPH_TEXADDRESS3 0x000019C8 +#define NV_PGRAPH_TEXCTL0_0 0x000019CC +# define NV_PGRAPH_TEXCTL0_0_ALPHAKILLEN (1 << 2) +# define NV_PGRAPH_TEXCTL0_0_MAX_LOD_CLAMP 0x0003FFC0 +# define NV_PGRAPH_TEXCTL0_0_MIN_LOD_CLAMP 0x3FFC0000 +# define NV_PGRAPH_TEXCTL0_0_ENABLE (1 << 30) +#define NV_PGRAPH_TEXCTL0_1 0x000019D0 +#define NV_PGRAPH_TEXCTL0_2 0x000019D4 +#define NV_PGRAPH_TEXCTL0_3 0x000019D8 +#define NV_PGRAPH_TEXCTL1_0 0x000019DC +# define NV_PGRAPH_TEXCTL1_0_IMAGE_PITCH 0xFFFF0000 +#define NV_PGRAPH_TEXCTL1_1 0x000019E0 +#define NV_PGRAPH_TEXCTL1_2 0x000019E4 +#define NV_PGRAPH_TEXCTL1_3 0x000019E8 +#define NV_PGRAPH_TEXCTL2_0 0x000019EC +#define NV_PGRAPH_TEXCTL2_1 0x000019F0 +#define NV_PGRAPH_TEXFILTER0 0x000019F4 +# define NV_PGRAPH_TEXFILTER0_MIPMAP_LOD_BIAS 0x00001FFF +# define NV_PGRAPH_TEXFILTER0_MIN 0x003F0000 +# define NV_PGRAPH_TEXFILTER0_MIN_BOX_LOD0 1 +# define NV_PGRAPH_TEXFILTER0_MIN_TENT_LOD0 2 +# define NV_PGRAPH_TEXFILTER0_MIN_BOX_NEARESTLOD 3 +# define NV_PGRAPH_TEXFILTER0_MIN_TENT_NEARESTLOD 4 +# define NV_PGRAPH_TEXFILTER0_MIN_BOX_TENT_LOD 5 +# define NV_PGRAPH_TEXFILTER0_MIN_TENT_TENT_LOD 6 +# define NV_PGRAPH_TEXFILTER0_MIN_CONVOLUTION_2D_LOD0 7 +# define NV_PGRAPH_TEXFILTER0_MAG 0x0F000000 +# define NV_PGRAPH_TEXFILTER0_ASIGNED (1 << 28) +# define NV_PGRAPH_TEXFILTER0_RSIGNED (1 << 29) +# define NV_PGRAPH_TEXFILTER0_GSIGNED (1 << 30) +# define NV_PGRAPH_TEXFILTER0_BSIGNED (1 << 31) +#define NV_PGRAPH_TEXFILTER1 0x000019F8 +#define NV_PGRAPH_TEXFILTER2 0x000019FC +#define NV_PGRAPH_TEXFILTER3 0x00001A00 +#define NV_PGRAPH_TEXFMT0 0x00001A04 +# define NV_PGRAPH_TEXFMT0_CONTEXT_DMA (1 << 1) +# define NV_PGRAPH_TEXFMT0_CUBEMAPENABLE (1 << 2) +# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE (1 << 3) +# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE_TEXTURE 0 +# define NV_PGRAPH_TEXFMT0_BORDER_SOURCE_COLOR 1 +# define NV_PGRAPH_TEXFMT0_DIMENSIONALITY 0x000000C0 +# define NV_PGRAPH_TEXFMT0_COLOR 0x00007F00 +# define NV_PGRAPH_TEXFMT0_MIPMAP_LEVELS 0x000F0000 +# define NV_PGRAPH_TEXFMT0_BASE_SIZE_U 0x00F00000 +# define NV_PGRAPH_TEXFMT0_BASE_SIZE_V 0x0F000000 +# define NV_PGRAPH_TEXFMT0_BASE_SIZE_P 0xF0000000 +#define NV_PGRAPH_TEXFMT1 0x00001A08 +#define NV_PGRAPH_TEXFMT2 0x00001A0C +#define NV_PGRAPH_TEXFMT3 0x00001A10 +#define NV_PGRAPH_TEXIMAGERECT0 0x00001A14 +# define NV_PGRAPH_TEXIMAGERECT0_WIDTH 0x1FFF0000 +# define NV_PGRAPH_TEXIMAGERECT0_HEIGHT 0x00001FFF +#define NV_PGRAPH_TEXIMAGERECT1 0x00001A18 +#define NV_PGRAPH_TEXIMAGERECT2 0x00001A1C +#define NV_PGRAPH_TEXIMAGERECT3 0x00001A20 +#define NV_PGRAPH_TEXOFFSET0 0x00001A24 +#define NV_PGRAPH_TEXOFFSET1 0x00001A28 +#define NV_PGRAPH_TEXOFFSET2 0x00001A2C +#define NV_PGRAPH_TEXOFFSET3 0x00001A30 +#define NV_PGRAPH_TEXPALETTE0 0x00001A34 +# define NV_PGRAPH_TEXPALETTE0_CONTEXT_DMA (1 << 0) +# define NV_PGRAPH_TEXPALETTE0_LENGTH 0x0000000C +# define NV_PGRAPH_TEXPALETTE0_LENGTH_256 0 +# define NV_PGRAPH_TEXPALETTE0_LENGTH_128 1 +# define NV_PGRAPH_TEXPALETTE0_LENGTH_64 2 +# define NV_PGRAPH_TEXPALETTE0_LENGTH_32 3 +# define NV_PGRAPH_TEXPALETTE0_OFFSET 0xFFFFFFC0 +#define NV_PGRAPH_TEXPALETTE1 0x00001A38 +#define NV_PGRAPH_TEXPALETTE2 0x00001A3C +#define NV_PGRAPH_TEXPALETTE3 0x00001A40 +#define NV_PGRAPH_WINDOWCLIPX0 0x00001A44 +# define NV_PGRAPH_WINDOWCLIPX0_XMIN 0x00000FFF +# define NV_PGRAPH_WINDOWCLIPX0_XMAX 0x0FFF0000 +#define NV_PGRAPH_WINDOWCLIPX1 0x00001A48 +#define NV_PGRAPH_WINDOWCLIPX2 0x00001A4C +#define NV_PGRAPH_WINDOWCLIPX3 0x00001A50 +#define NV_PGRAPH_WINDOWCLIPX4 0x00001A54 +#define NV_PGRAPH_WINDOWCLIPX5 0x00001A58 +#define NV_PGRAPH_WINDOWCLIPX6 0x00001A5C +#define NV_PGRAPH_WINDOWCLIPX7 0x00001A60 +#define NV_PGRAPH_WINDOWCLIPY0 0x00001A64 +# define NV_PGRAPH_WINDOWCLIPY0_YMIN 0x00000FFF +# define NV_PGRAPH_WINDOWCLIPY0_YMAX 0x0FFF0000 +#define NV_PGRAPH_WINDOWCLIPY1 0x00001A68 +#define NV_PGRAPH_WINDOWCLIPY2 0x00001A6C +#define NV_PGRAPH_WINDOWCLIPY3 0x00001A70 +#define NV_PGRAPH_WINDOWCLIPY4 0x00001A74 +#define NV_PGRAPH_WINDOWCLIPY5 0x00001A78 +#define NV_PGRAPH_WINDOWCLIPY6 0x00001A7C +#define NV_PGRAPH_WINDOWCLIPY7 0x00001A80 +#define NV_PGRAPH_ZSTENCILCLEARVALUE 0x00001A88 +#define NV_PGRAPH_ZCLIPMIN 0x00001A90 +#define NV_PGRAPH_ZOFFSETBIAS 0x00001AA4 +#define NV_PGRAPH_ZOFFSETFACTOR 0x00001AA8 +#define NV_PGRAPH_EYEVEC0 0x00001AAC +#define NV_PGRAPH_EYEVEC1 0x00001AB0 +#define NV_PGRAPH_EYEVEC2 0x00001AB4 +#define NV_PGRAPH_ZCLIPMAX 0x00001ABC + + +#define NV_PCRTC_INTR_0 0x00000100 +# define NV_PCRTC_INTR_0_VBLANK (1 << 0) +#define NV_PCRTC_INTR_EN_0 0x00000140 +# define NV_PCRTC_INTR_EN_0_VBLANK (1 << 0) +#define NV_PCRTC_START 0x00000800 +#define NV_PCRTC_CONFIG 0x00000804 +#define NV_PCRTC_RASTER 0x00000808 + +#define NV_PVIDEO_DEBUG_2 0x00000088 +#define NV_PVIDEO_DEBUG_3 0x0000008C +#define NV_PVIDEO_INTR 0x00000100 +# define NV_PVIDEO_INTR_BUFFER_0 (1 << 0) +# define NV_PVIDEO_INTR_BUFFER_1 (1 << 4) +#define NV_PVIDEO_INTR_EN 0x00000140 +# define NV_PVIDEO_INTR_EN_BUFFER_0 (1 << 0) +# define NV_PVIDEO_INTR_EN_BUFFER_1 (1 << 4) +#define NV_PVIDEO_BUFFER 0x00000700 +# define NV_PVIDEO_BUFFER_0_USE (1 << 0) +# define NV_PVIDEO_BUFFER_1_USE (1 << 4) +#define NV_PVIDEO_STOP 0x00000704 +#define NV_PVIDEO_BASE(i) 0x00000900 + (i * 4) +#define NV_PVIDEO_LIMIT(i) 0x00000908 + (i * 4) +#define NV_PVIDEO_LUMINANCE(i) 0x00000910 + (i * 4) +#define NV_PVIDEO_CHROMINANCE(i) 0x00000918 + (i * 4) +#define NV_PVIDEO_OFFSET(i) 0x00000920 + (i * 4) +#define NV_PVIDEO_SIZE_IN(i) 0x00000928 + (i * 4) +# define NV_PVIDEO_SIZE_IN_WIDTH 0x000007FF +# define NV_PVIDEO_SIZE_IN_HEIGHT 0x07FF0000 +#define NV_PVIDEO_POINT_IN(i) 0x00000930 + (i * 4) +# define NV_PVIDEO_POINT_IN_S 0x00007FFF +# define NV_PVIDEO_POINT_IN_T 0xFFFE0000 +#define NV_PVIDEO_DS_DX(i) 0x00000938 + (i * 4) +#define NV_PVIDEO_DT_DY(i) 0x00000940 + (i * 4) +#define NV_PVIDEO_POINT_OUT(i) 0x00000948 + (i * 4) +# define NV_PVIDEO_POINT_OUT_X 0x00000FFF +# define NV_PVIDEO_POINT_OUT_Y 0x0FFF0000 +#define NV_PVIDEO_SIZE_OUT(i) 0x00000950 + (i * 4) +# define NV_PVIDEO_SIZE_OUT_WIDTH 0x00000FFF +# define NV_PVIDEO_SIZE_OUT_HEIGHT 0x0FFF0000 +#define NV_PVIDEO_FORMAT(i) 0x00000958 + (i * 4) +# define NV_PVIDEO_FORMAT_PITCH 0x00001FFF +# define NV_PVIDEO_FORMAT_COLOR 0x00030000 +# define NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8 1 +# define NV_PVIDEO_FORMAT_DISPLAY (1 << 20) +#define NV_PVIDEO_COLOR_KEY(i) 0x00000b00 + (i * 4) + + +#define NV_PTIMER_INTR_0 0x00000100 +# define NV_PTIMER_INTR_0_ALARM (1 << 0) +#define NV_PTIMER_INTR_EN_0 0x00000140 +# define NV_PTIMER_INTR_EN_0_ALARM (1 << 0) +#define NV_PTIMER_NUMERATOR 0x00000200 +#define NV_PTIMER_DENOMINATOR 0x00000210 +#define NV_PTIMER_TIME_0 0x00000400 +#define NV_PTIMER_TIME_1 0x00000410 +#define NV_PTIMER_ALARM_0 0x00000420 + +#define NV_PRMVIO_MISC__WRITE 0x000c03c2 +#define NV_PRMVIO_SRX 0x000c03c4 +#define NV_PRMVIO_SR 0x000c03c5 +# define NV_VIO_SR_RESET_INDEX 0x00 +# define NV_VIO_SR_CLOCK_INDEX 0x01 +# define NV_VIO_SR_PLANE_MASK_INDEX 0x02 +# define NV_VIO_SR_CHAR_MAP_INDEX 0x03 +# define NV_VIO_SR_MEM_MODE_INDEX 0x04 +#define NV_PRMVIO_MISC__READ 0x000c03cc +#define NV_PRMVIO_GRX 0x000c03ce +#define NV_PRMVIO_GX 0x000c03cf +# define NV_VIO_GX_SR_INDEX 0x00 +# define NV_VIO_GX_SREN_INDEX 0x01 +# define NV_VIO_GX_CCOMP_INDEX 0x02 +# define NV_VIO_GX_ROP_INDEX 0x03 +# define NV_VIO_GX_READ_MAP_INDEX 0x04 +# define NV_VIO_GX_MODE_INDEX 0x05 +# define NV_VIO_GX_MISC_INDEX 0x06 +# define NV_VIO_GX_DONT_CARE_INDEX 0x07 +# define NV_VIO_GX_BIT_MASK_INDEX 0x08 + +#define NV_PFB_DEBUG_0 0x00000080 +#define NV_PFB_CFG0 0x00000200 +# define NV_PFB_CFG0_PART 0x00000003 +#define NV_PFB_CFG1 0x00000204 +#define NV_PFB_CSTATUS 0x0000020C +#define NV_PFB_REFCTRL 0x00000210 +#define NV_PFB_NVM 0x00000214 // NV_PFB_NVM_MODE_DISABLE +#define NV_PFB_PIN 0x00000218 +#define NV_PFB_PAD 0x0000021C +#define NV_PFB_TIMING0 0x00000220 +#define NV_PFB_TIMING1 0x00000224 +#define NV_PFB_TIMING2 0x00000228 +#define NV_PFB_TILE(i) 0x00000240 + (i * 0x10) +#define NV_PFB_TLIMIT(i) 0x00000244 + (i * 0x10) +#define NV_PFB_TSIZE(i) 0x00000248 + (i * 0x10) +#define NV_PFB_TSTATUS(i) 0x0000024C + (i * 0x10) +#define NV_PFB_MRS 0x000002C0 +#define NV_PFB_EMRS 0x000002C4 +#define NV_PFB_MRS_EXT 0x000002C8 +#define NV_PFB_EMRS_EXT 0x000002CC +#define NV_PFB_REF 0x000002D0 +#define NV_PFB_PRE 0x000002D4 +#define NV_PFB_ZCOMP(i) 0x00000300 + (i * 4) +#define NV_PFB_ZCOMP_OFFSET 0x00000324 +#define NV_PFB_ARB_PREDIVIDER 0x00000328 +#define NV_PFB_ARB_TIMEOUT 0x0000032C +#define NV_PFB_ARB_XFER_REM 0x00000334 +#define NV_PFB_ARB_DIFF_BANK 0x00000338 +#define NV_PFB_CLOSE_PAGE0 0x00000340 +#define NV_PFB_CLOSE_PAGE1 0x00000344 +#define NV_PFB_CLOSE_PAGE2 0x00000348 +#define NV_PFB_BPARB 0x0000034C +#define NV_PFB_CMDQ0 0x00000350 +#define NV_PFB_CMDQ1 0x00000354 +#define NV_PFB_ILL_INSTR 0x00000360 +#define NV_PFB_RT 0x00000400 +#define NV_PFB_AUTOCLOSE 0x00000404 +#define NV_PFB_WBC 0x00000410 +# define NV_PFB_WBC_FLUSH (1 << 16) +#define NV_PFB_CMDQ_PRT 0x00000418 +#define NV_PFB_CPU_RRQ 0x00000420 +#define NV_PFB_BYPASS 0x00000424 + +#define NV_PRAMIN_DMA_CLASS(i) 0x00000000 + (i * 0x10) +#define NV_PRAMIN_DMA_LIMIT(i) 0x00000004 + (i * 0x10) +#define NV_PRAMIN_DMA_START(i) 0x00000008 + (i * 0x10) +#define NV_PRAMIN_DMA_ADDRESS(i) 0x0000000C + (i * 0x10) + +#define NV_PRAMDAC_NVPLL_COEFF 0x00000500 +# define NV_PRAMDAC_NVPLL_COEFF_MDIV 0x000000FF +# define NV_PRAMDAC_NVPLL_COEFF_NDIV 0x0000FF00 +# define NV_PRAMDAC_NVPLL_COEFF_PDIV 0x00070000 +#define NV_PRAMDAC_MPLL_COEFF 0x00000504 +# define NV_PRAMDAC_MPLL_COEFF_MDIV 0x000000FF +# define NV_PRAMDAC_MPLL_COEFF_NDIV 0x0000FF00 +# define NV_PRAMDAC_MPLL_COEFF_PDIV 0x00070000 +#define NV_PRAMDAC_VPLL_COEFF 0x00000508 +# define NV_PRAMDAC_VPLL_COEFF_MDIV 0x000000FF +# define NV_PRAMDAC_VPLL_COEFF_NDIV 0x0000FF00 +# define NV_PRAMDAC_VPLL_COEFF_PDIV 0x00070000 +#define NV_PRAMDAC_PLL_TEST_COUNTER 0x00000514 +# define NV_PRAMDAC_PLL_TEST_COUNTER_NOOFIPCLKS 0x000003FF +# define NV_PRAMDAC_PLL_TEST_COUNTER_VALUE 0x0000FFFF +# define NV_PRAMDAC_PLL_TEST_COUNTER_ENABLE (1 << 16) +# define NV_PRAMDAC_PLL_TEST_COUNTER_RESET (1 << 20) +# define NV_PRAMDAC_PLL_TEST_COUNTER_SOURCE 0x03000000 +# define NV_PRAMDAC_PLL_TEST_COUNTER_VPLL2_LOCK (1 << 27) +# define NV_PRAMDAC_PLL_TEST_COUNTER_PDIV_RST (1 << 28) +# define NV_PRAMDAC_PLL_TEST_COUNTER_NVPLL_LOCK (1 << 29) +# define NV_PRAMDAC_PLL_TEST_COUNTER_MPLL_LOCK (1 << 30) +# define NV_PRAMDAC_PLL_TEST_COUNTER_VPLL_LOCK (1 << 31) +#define NV_PRAMDAC_GENERAL_CONTROL 0x00680600 +# define NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON (3 << 4) +# define NV_PRAMDAC_GENERAL_CONTROL_VGA_STATE_SEL (1 << 8) +# define NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL (1 << 12) +# define NV_PRAMDAC_GENERAL_CONTROL_TERMINATION_75OHM (2 << 16) +# define NV_PRAMDAC_GENERAL_CONTROL_BPC_8BITS (1 << 20) +# define NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG (2 << 28) + +#define NV_PRMCIO_ARX 0x006013c0 +#define NV_PRMCIO_AR__WRITE 0x006013c0 +#define NV_PRMCIO_AR__READ 0x006013c1 +# define NV_CIO_AR_MODE_INDEX 0x10 +# define NV_CIO_AR_OSCAN_INDEX 0x11 +# define NV_CIO_AR_PLANE_INDEX 0x12 +# define NV_CIO_AR_HPP_INDEX 0x13 +# define NV_CIO_AR_CSEL_INDEX 0x14 +#define NV_PRMCIO_INP0 0x006013c2 +#define NV_PRMCIO_CRX__COLOR 0x006013d4 +#define NV_PRMCIO_CR__COLOR 0x006013d5 +/* Standard VGA CRTC registers */ +# define NV_CIO_CR_HDT_INDEX 0x00 /* horizontal display total */ +# define NV_CIO_CR_HDE_INDEX 0x01 /* horizontal display end */ +# define NV_CIO_CR_HBS_INDEX 0x02 /* horizontal blanking start */ +# define NV_CIO_CR_HBE_INDEX 0x03 /* horizontal blanking end */ +# define NV_CIO_CR_HBE_4_0 4:0 +# define NV_CIO_CR_HRS_INDEX 0x04 /* horizontal retrace start */ +# define NV_CIO_CR_HRE_INDEX 0x05 /* horizontal retrace end */ +# define NV_CIO_CR_HRE_4_0 4:0 +# define NV_CIO_CR_HRE_HBE_5 7:7 +# define NV_CIO_CR_VDT_INDEX 0x06 /* vertical display total */ +# define NV_CIO_CR_OVL_INDEX 0x07 /* overflow bits */ +# define NV_CIO_CR_OVL_VDT_8 0:0 +# define NV_CIO_CR_OVL_VDE_8 1:1 +# define NV_CIO_CR_OVL_VRS_8 2:2 +# define NV_CIO_CR_OVL_VBS_8 3:3 +# define NV_CIO_CR_OVL_VDT_9 5:5 +# define NV_CIO_CR_OVL_VDE_9 6:6 +# define NV_CIO_CR_OVL_VRS_9 7:7 +# define NV_CIO_CR_RSAL_INDEX 0x08 /* normally "preset row scan" */ +# define NV_CIO_CR_CELL_HT_INDEX 0x09 /* cell height?! normally "max scan line" */ +# define NV_CIO_CR_CELL_HT_VBS_9 5:5 +# define NV_CIO_CR_CELL_HT_SCANDBL 7:7 +# define NV_CIO_CR_CURS_ST_INDEX 0x0a /* cursor start */ +# define NV_CIO_CR_CURS_END_INDEX 0x0b /* cursor end */ +# define NV_CIO_CR_SA_HI_INDEX 0x0c /* screen start address high */ +# define NV_CIO_CR_SA_LO_INDEX 0x0d /* screen start address low */ +# define NV_CIO_CR_TCOFF_HI_INDEX 0x0e /* cursor offset high */ +# define NV_CIO_CR_TCOFF_LO_INDEX 0x0f /* cursor offset low */ +# define NV_CIO_CR_VRS_INDEX 0x10 /* vertical retrace start */ +# define NV_CIO_CR_VRE_INDEX 0x11 /* vertical retrace end */ +# define NV_CIO_CR_VRE_3_0 3:0 +# define NV_CIO_CR_VDE_INDEX 0x12 /* vertical display end */ +# define NV_CIO_CR_OFFSET_INDEX 0x13 /* sets screen pitch */ +# define NV_CIO_CR_ULINE_INDEX 0x14 /* underline location */ +# define NV_CIO_CR_VBS_INDEX 0x15 /* vertical blank start */ +# define NV_CIO_CR_VBE_INDEX 0x16 /* vertical blank end */ +# define NV_CIO_CR_MODE_INDEX 0x17 /* crtc mode control */ +# define NV_CIO_CR_LCOMP_INDEX 0x18 /* line compare */ +/* Extended VGA CRTC registers */ +# define NV_CIO_CRE_RPC0_INDEX 0x19 /* repaint control 0 */ +# define NV_CIO_CRE_RPC0_OFFSET_10_8 7:5 +# define NV_CIO_CRE_RPC1_INDEX 0x1a /* repaint control 1 */ +# define NV_CIO_CRE_RPC1_LARGE 2:2 +# define NV_CIO_CRE_FF_INDEX 0x1b /* fifo control */ +# define NV_CIO_CRE_ENH_INDEX 0x1c /* enhanced? */ +# define NV_CIO_SR_LOCK_INDEX 0x1f /* crtc lock */ +# define NV_CIO_SR_UNLOCK_RW_VALUE 0x57 +# define NV_CIO_SR_LOCK_VALUE 0x99 +# define NV_CIO_CRE_FFLWM__INDEX 0x20 /* fifo low water mark */ +# define NV_CIO_CRE_21 0x21 /* vga shadow crtc lock */ +# define NV_CIO_CRE_LSR_INDEX 0x25 /* ? */ +# define NV_CIO_CRE_LSR_VDT_10 0:0 +# define NV_CIO_CRE_LSR_VDE_10 1:1 +# define NV_CIO_CRE_LSR_VRS_10 2:2 +# define NV_CIO_CRE_LSR_VBS_10 3:3 +# define NV_CIO_CRE_LSR_HBE_6 4:4 +# define NV_CIO_CR_ARX_INDEX 0x26 /* attribute index -- ro copy of 0x60.3c0 */ +# define NV_CIO_CRE_CHIP_ID_INDEX 0x27 /* chip revision */ +# define NV_CIO_CRE_PIXEL_INDEX 0x28 +# define NV_CIO_CRE_PIXEL_FORMAT 1:0 +# define NV_CIO_CRE_HEB__INDEX 0x2d /* horizontal extra bits? */ +# define NV_CIO_CRE_HEB_HDT_8 0:0 +# define NV_CIO_CRE_HEB_HDE_8 1:1 +# define NV_CIO_CRE_HEB_HBS_8 2:2 +# define NV_CIO_CRE_HEB_HRS_8 3:3 +# define NV_CIO_CRE_HEB_ILC_8 4:4 +# define NV_CIO_CRE_2E 0x2e /* some scratch or dummy reg to force writes to sink in */ +# define NV_CIO_CRE_HCUR_ADDR2_INDEX 0x2f /* cursor */ +# define NV_CIO_CRE_HCUR_ADDR0_INDEX 0x30 /* pixmap */ +# define NV_CIO_CRE_HCUR_ADDR0_ADR 6:0 +# define NV_CIO_CRE_HCUR_ASI 7:7 +# define NV_CIO_CRE_HCUR_ADDR1_INDEX 0x31 /* address */ +# define NV_CIO_CRE_HCUR_ADDR1_ENABLE 0:0 +# define NV_CIO_CRE_HCUR_ADDR1_CUR_DBL 1:1 +# define NV_CIO_CRE_HCUR_ADDR1_ADR 7:2 +# define NV_CIO_CRE_LCD__INDEX 0x33 +# define NV_CIO_CRE_LCD_LCD_SELECT 0:0 +# define NV_CIO_CRE_DDC0_STATUS__INDEX 0x36 +# define NV_CIO_CRE_DDC0_WR__INDEX 0x37 +# define NV_CIO_CRE_ILACE__INDEX 0x39 /* interlace */ +# define NV_CIO_CRE_SCRATCH3__INDEX 0x3b +# define NV_CIO_CRE_SCRATCH4__INDEX 0x3c +# define NV_CIO_CRE_DDC_STATUS__INDEX 0x3e +# define NV_CIO_CRE_DDC_WR__INDEX 0x3f +# define NV_CIO_CRE_EBR_INDEX 0x41 /* extra bits ? (vertical) */ +# define NV_CIO_CRE_EBR_VDT_11 0:0 +# define NV_CIO_CRE_EBR_VDE_11 2:2 +# define NV_CIO_CRE_EBR_VRS_11 4:4 +# define NV_CIO_CRE_EBR_VBS_11 6:6 +# define NV_CIO_CRE_43 0x43 +# define NV_CIO_CRE_44 0x44 /* head control */ +# define NV_CIO_CRE_CSB 0x45 /* colour saturation boost */ +# define NV_CIO_CRE_RCR 0x46 +# define NV_CIO_CRE_RCR_ENDIAN_BIG 7:7 +# define NV_CIO_CRE_47 0x47 /* extended fifo lwm, used on nv30+ */ +# define NV_CIO_CRE_49 0x49 +# define NV_CIO_CRE_4B 0x4b /* given patterns in 0x[2-3][a-c] regs, probably scratch 6 */ +# define NV_CIO_CRE_TVOUT_LATENCY 0x52 +# define NV_CIO_CRE_53 0x53 /* `fp_htiming' according to Haiku */ +# define NV_CIO_CRE_54 0x54 /* `fp_vtiming' according to Haiku */ +# define NV_CIO_CRE_57 0x57 /* index reg for cr58 */ +# define NV_CIO_CRE_58 0x58 /* data reg for cr57 */ +# define NV_CIO_CRE_59 0x59 /* related to on/off-chip-ness of digital outputs */ +# define NV_CIO_CRE_5B 0x5B /* newer colour saturation reg */ +# define NV_CIO_CRE_85 0x85 +# define NV_CIO_CRE_86 0x86 +#define NV_PRMCIO_INP0__COLOR 0x006013da + +#define NV_USER_DMA_PUT 0x40 +#define NV_USER_DMA_GET 0x44 +#define NV_USER_REF 0x48 + + + +/* DMA objects */ +#define NV_DMA_FROM_MEMORY_CLASS 0x02 +#define NV_DMA_TO_MEMORY_CLASS 0x03 +#define NV_DMA_IN_MEMORY_CLASS 0x3d + +#define NV_DMA_CLASS 0x00000FFF +#define NV_DMA_PAGE_TABLE (1 << 12) +#define NV_DMA_PAGE_ENTRY (1 << 13) +#define NV_DMA_FLAGS_ACCESS (1 << 14) +#define NV_DMA_FLAGS_MAPPING_COHERENCY (1 << 15) +#define NV_DMA_TARGET 0x00030000 +# define NV_DMA_TARGET_NVM 0x00000000 +# define NV_DMA_TARGET_NVM_TILED 0x00010000 +# define NV_DMA_TARGET_PCI 0x00020000 +# define NV_DMA_TARGET_AGP 0x00030000 +#define NV_DMA_ADJUST 0xFFF00000 + +#define NV_DMA_ADDRESS 0xFFFFF000 + + +#define NV_RAMHT_HANDLE 0xFFFFFFFF +#define NV_RAMHT_INSTANCE 0x0000FFFF +#define NV_RAMHT_ENGINE 0x00030000 +# define NV_RAMHT_ENGINE_SW 0x00000000 +# define NV_RAMHT_ENGINE_GRAPHICS 0x00010000 +# define NV_RAMHT_ENGINE_DVD 0x00020000 +#define NV_RAMHT_CHID 0x1F000000 +#define NV_RAMHT_STATUS 0x80000000 + + + +/* graphic classes and methods */ +#define NV_SET_OBJECT 0x00000000 + +#define NV_MEMORY_TO_MEMORY_FORMAT 0x0039 + +#define NV_CONTEXT_PATTERN 0x0044 +# define NV044_SET_MONOCHROME_COLOR0 0x00000310 + +#define NV_CONTEXT_SURFACES_2D 0x0062 +# define NV062_SET_OBJECT 0x00000000 +# define NV062_SET_CONTEXT_DMA_IMAGE_SOURCE 0x00000184 +# define NV062_SET_CONTEXT_DMA_IMAGE_DESTIN 0x00000188 +# define NV062_SET_COLOR_FORMAT 0x00000300 +# define NV062_SET_COLOR_FORMAT_LE_Y8 0x01 +# define NV062_SET_COLOR_FORMAT_LE_R5G6B5 0x04 +# define NV062_SET_COLOR_FORMAT_LE_A8R8G8B8 0x0A +# define NV062_SET_PITCH 0x00000304 +# define NV062_SET_OFFSET_SOURCE 0x00000308 +# define NV062_SET_OFFSET_DESTIN 0x0000030C + +#define NV_IMAGE_BLIT 0x009F +# define NV09F_SET_OBJECT 0x00000000 +# define NV09F_SET_CONTEXT_SURFACES 0x0000019C +# define NV09F_SET_OPERATION 0x000002FC +# define NV09F_SET_OPERATION_SRCCOPY 3 +# define NV09F_CONTROL_POINT_IN 0x00000300 +# define NV09F_CONTROL_POINT_OUT 0x00000304 +# define NV09F_SIZE 0x00000308 + + +#define NV_KELVIN_PRIMITIVE 0x0097 +# define NV097_SET_OBJECT 0x00000000 +# define NV097_NO_OPERATION 0x00000100 +# define NV097_WAIT_FOR_IDLE 0x00000110 +# define NV097_SET_FLIP_READ 0x00000120 +# define NV097_SET_FLIP_WRITE 0x00000124 +# define NV097_SET_FLIP_MODULO 0x00000128 +# define NV097_FLIP_INCREMENT_WRITE 0x0000012C +# define NV097_FLIP_STALL 0x00000130 +# define NV097_SET_CONTEXT_DMA_NOTIFIES 0x00000180 +# define NV097_SET_CONTEXT_DMA_A 0x00000184 +# define NV097_SET_CONTEXT_DMA_B 0x00000188 +# define NV097_SET_CONTEXT_DMA_STATE 0x00000190 +# define NV097_SET_CONTEXT_DMA_COLOR 0x00000194 +# define NV097_SET_CONTEXT_DMA_ZETA 0x00000198 +# define NV097_SET_CONTEXT_DMA_VERTEX_A 0x0000019C +# define NV097_SET_CONTEXT_DMA_VERTEX_B 0x000001A0 +# define NV097_SET_CONTEXT_DMA_SEMAPHORE 0x000001A4 +# define NV097_SET_CONTEXT_DMA_REPORT 0x000001A8 +# define NV097_SET_SURFACE_CLIP_HORIZONTAL 0x00000200 +# define NV097_SET_SURFACE_CLIP_HORIZONTAL_X 0x0000FFFF +# define NV097_SET_SURFACE_CLIP_HORIZONTAL_WIDTH 0xFFFF0000 +# define NV097_SET_SURFACE_CLIP_VERTICAL 0x00000204 +# define NV097_SET_SURFACE_CLIP_VERTICAL_Y 0x0000FFFF +# define NV097_SET_SURFACE_CLIP_VERTICAL_HEIGHT 0xFFFF0000 +# define NV097_SET_SURFACE_FORMAT 0x00000208 +# define NV097_SET_SURFACE_FORMAT_COLOR 0x0000000F +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_Z1R5G5B5 0x01 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_O1R5G5B5 0x02 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_R5G6B5 0x03 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_Z8R8G8B8 0x04 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_O8R8G8B8 0x05 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_Z1A7R8G8B8 0x06 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_X1A7R8G8B8_O1A7R8G8B8 0x07 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8 0x08 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_B8 0x09 +# define NV097_SET_SURFACE_FORMAT_COLOR_LE_G8B8 0x0A +# define NV097_SET_SURFACE_FORMAT_ZETA 0x000000F0 +# define NV097_SET_SURFACE_FORMAT_ZETA_Z16 1 +# define NV097_SET_SURFACE_FORMAT_ZETA_Z24S8 2 +# define NV097_SET_SURFACE_FORMAT_TYPE 0x00000F00 +# define NV097_SET_SURFACE_FORMAT_TYPE_PITCH 0x1 +# define NV097_SET_SURFACE_FORMAT_TYPE_SWIZZLE 0x2 +# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING 0x0000F000 +# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_CENTER_1 0 +# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_CENTER_CORNER_2 1 +# define NV097_SET_SURFACE_FORMAT_ANTI_ALIASING_SQUARE_OFFSET_4 2 +# define NV097_SET_SURFACE_FORMAT_WIDTH 0x00FF0000 +# define NV097_SET_SURFACE_FORMAT_HEIGHT 0xFF000000 +# define NV097_SET_SURFACE_PITCH 0x0000020C +# define NV097_SET_SURFACE_PITCH_COLOR 0x0000FFFF +# define NV097_SET_SURFACE_PITCH_ZETA 0xFFFF0000 +# define NV097_SET_SURFACE_COLOR_OFFSET 0x00000210 +# define NV097_SET_SURFACE_ZETA_OFFSET 0x00000214 +# define NV097_SET_COMBINER_ALPHA_ICW 0x00000260 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP 0xE0000000 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_UNSIGNED_IDENTITY 0 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_UNSIGNED_INVERT 1 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_EXPAND_NORMAL 2 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_EXPAND_NEGATE 3 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_HALFBIAS_NORMAL 4 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_HALFBIAS_NEGATE 5 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_SIGNED_IDENTITY 6 +# define NV097_SET_COMBINER_ALPHA_ICW_A_MAP_SIGNED_NEGATE 7 +# define NV097_SET_COMBINER_ALPHA_ICW_A_ALPHA (1<<28) +# define NV097_SET_COMBINER_ALPHA_ICW_A_SOURCE 0x0F000000 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP 0x00E00000 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_UNSIGNED_IDENTITY 0 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_UNSIGNED_INVERT 1 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_EXPAND_NORMAL 2 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_EXPAND_NEGATE 3 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_HALFBIAS_NORMAL 4 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_HALFBIAS_NEGATE 5 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_SIGNED_IDENTITY 6 +# define NV097_SET_COMBINER_ALPHA_ICW_B_MAP_SIGNED_NEGATE 7 +# define NV097_SET_COMBINER_ALPHA_ICW_B_ALPHA (1<<20) +# define NV097_SET_COMBINER_ALPHA_ICW_B_SOURCE 0x000F0000 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP 0x0000E000 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_UNSIGNED_IDENTITY 0 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_UNSIGNED_INVERT 1 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_EXPAND_NORMAL 2 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_EXPAND_NEGATE 3 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_HALFBIAS_NORMAL 4 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_HALFBIAS_NEGATE 5 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_SIGNED_IDENTITY 6 +# define NV097_SET_COMBINER_ALPHA_ICW_C_MAP_SIGNED_NEGATE 7 +# define NV097_SET_COMBINER_ALPHA_ICW_C_ALPHA (1<<12) +# define NV097_SET_COMBINER_ALPHA_ICW_C_SOURCE 0x00000F00 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP 0x000000E0 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_UNSIGNED_IDENTITY 0 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_UNSIGNED_INVERT 1 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_EXPAND_NORMAL 2 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_EXPAND_NEGATE 3 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_HALFBIAS_NORMAL 4 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_HALFBIAS_NEGATE 5 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_SIGNED_IDENTITY 6 +# define NV097_SET_COMBINER_ALPHA_ICW_D_MAP_SIGNED_NEGATE 7 +# define NV097_SET_COMBINER_ALPHA_ICW_D_ALPHA (1<<4) +# define NV097_SET_COMBINER_ALPHA_ICW_D_SOURCE 0x0000000F +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0 0x00000288 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_INVERSE 0xE0000000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_ALPHA (1<<28) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE 0x0F000000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE_REG_SPECLIT 0xE +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_A_SOURCE_REG_EF_PROD 0xF +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_INVERSE 0x00E00000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_ALPHA (1<<20) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE 0x000F0000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE_REG_SPECLIT 0xE +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_B_SOURCE_REG_EF_PROD 0xF +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_INVERSE 0x0000E000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_ALPHA (1<<12) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE 0x00000F00 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE_REG_SPECLIT 0xE +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_C_SOURCE_REG_EF_PROD 0xF +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_INVERSE 0x000000E0 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_ALPHA (1<<4) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE 0x0000000F +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE_REG_SPECLIT 0xE +# define NV097_SET_COMBINER_SPECULAR_FOG_CW0_D_SOURCE_REG_EF_PROD 0xF +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1 0x0000028C +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_INVERSE 0xE0000000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_ALPHA (1<<28) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_E_SOURCE 0x0F000000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_INVERSE 0x00E00000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_ALPHA (1<<20) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_F_SOURCE 0x000F0000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_INVERSE 0x0000E000 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_ALPHA (1<<12) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_G_SOURCE 0x00000F00 +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_CLAMP (1<<7) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_ADD_INVERT_R5 (1<<6) +# define NV097_SET_COMBINER_SPECULAR_FOG_CW1_SPECULAR_ADD_INVERT_R12 0x0000003F +# define NV097_SET_CONTROL0 0x00000290 +# define NV097_SET_CONTROL0_STENCIL_WRITE_ENABLE (1 << 0) +# define NV097_SET_CONTROL0_Z_FORMAT (1 << 12) +# define NV097_SET_CONTROL0_Z_PERSPECTIVE_ENABLE (1 << 16) +# define NV097_SET_CONTROL0_COLOR_SPACE_CONVERT (0xF << 28) +# define NV097_SET_FOG_MODE 0x0000029C +# define NV097_SET_FOG_MODE_V_LINEAR 0x2601 +# define NV097_SET_FOG_MODE_V_EXP 0x800 +# define NV097_SET_FOG_MODE_V_EXP2 0x801 +# define NV097_SET_FOG_MODE_V_EXP_ABS 0x802 +# define NV097_SET_FOG_MODE_V_EXP2_ABS 0x803 +# define NV097_SET_FOG_MODE_V_LINEAR_ABS 0x804 +# define NV097_SET_FOG_GEN_MODE 0x000002A0 +# define NV097_SET_FOG_GEN_MODE_V_SPEC_ALPHA 0 +# define NV097_SET_FOG_GEN_MODE_V_RADIAL 1 +# define NV097_SET_FOG_GEN_MODE_V_PLANAR 2 +# define NV097_SET_FOG_GEN_MODE_V_ABS_PLANAR 3 +# define NV097_SET_FOG_GEN_MODE_V_FOG_X 6 +# define NV097_SET_FOG_ENABLE 0x000002A4 +# define NV097_SET_FOG_COLOR 0x000002A8 +# define NV097_SET_FOG_COLOR_RED 0x000000FF +# define NV097_SET_FOG_COLOR_GREEN 0x0000FF00 +# define NV097_SET_FOG_COLOR_BLUE 0x00FF0000 +# define NV097_SET_FOG_COLOR_ALPHA 0xFF000000 +# define NV097_SET_WINDOW_CLIP_TYPE 0x000002B4 +# define NV097_SET_WINDOW_CLIP_HORIZONTAL 0x000002C0 +# define NV097_SET_WINDOW_CLIP_HORIZONTAL_XMIN 0x00000FFF +# define NV097_SET_WINDOW_CLIP_HORIZONTAL_XMAX 0x0FFF0000 +# define NV097_SET_WINDOW_CLIP_VERTICAL 0x000002E0 +# define NV097_SET_ALPHA_TEST_ENABLE 0x00000300 +# define NV097_SET_BLEND_ENABLE 0x00000304 +# define NV097_SET_CULL_FACE_ENABLE 0x00000308 +# define NV097_SET_DEPTH_TEST_ENABLE 0x0000030C +# define NV097_SET_DITHER_ENABLE 0x00000310 +# define NV097_SET_LIGHTING_ENABLE 0x00000314 +# define NV097_SET_SKIN_MODE 0x00000328 +# define NV097_SET_SKIN_MODE_OFF 0 +# define NV097_SET_SKIN_MODE_2G 1 +# define NV097_SET_SKIN_MODE_2 2 +# define NV097_SET_SKIN_MODE_3G 3 +# define NV097_SET_SKIN_MODE_3 4 +# define NV097_SET_SKIN_MODE_4G 5 +# define NV097_SET_SKIN_MODE_4 6 +# define NV097_SET_STENCIL_TEST_ENABLE 0x0000032C +# define NV097_SET_POLY_OFFSET_POINT_ENABLE 0x00000330 +# define NV097_SET_POLY_OFFSET_LINE_ENABLE 0x00000334 +# define NV097_SET_POLY_OFFSET_FILL_ENABLE 0x00000338 +# define NV097_SET_ALPHA_FUNC 0x0000033C +# define NV097_SET_ALPHA_REF 0x00000340 +# define NV097_SET_BLEND_FUNC_SFACTOR 0x00000344 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ZERO 0x0000 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE 0x0001 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_COLOR 0x0300 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_SRC_COLOR 0x0301 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_ALPHA 0x0302 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_SRC_ALPHA 0x0303 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_DST_ALPHA 0x0304 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_DST_ALPHA 0x0305 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_DST_COLOR 0x0306 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_DST_COLOR 0x0307 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_SRC_ALPHA_SATURATE 0x0308 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_CONSTANT_COLOR 0x8001 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_CONSTANT_COLOR 0x8002 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_CONSTANT_ALPHA 0x8003 +# define NV097_SET_BLEND_FUNC_SFACTOR_V_ONE_MINUS_CONSTANT_ALPHA 0x8004 +# define NV097_SET_BLEND_FUNC_DFACTOR 0x00000348 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ZERO 0x0000 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE 0x0001 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_COLOR 0x0300 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_SRC_COLOR 0x0301 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_ALPHA 0x0302 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_SRC_ALPHA 0x0303 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_DST_ALPHA 0x0304 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_DST_ALPHA 0x0305 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_DST_COLOR 0x0306 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_DST_COLOR 0x0307 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_SRC_ALPHA_SATURATE 0x0308 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_CONSTANT_COLOR 0x8001 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_CONSTANT_COLOR 0x8002 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_CONSTANT_ALPHA 0x8003 +# define NV097_SET_BLEND_FUNC_DFACTOR_V_ONE_MINUS_CONSTANT_ALPHA 0x8004 +# define NV097_SET_BLEND_COLOR 0x0000034C +# define NV097_SET_BLEND_EQUATION 0x00000350 +# define NV097_SET_BLEND_EQUATION_V_FUNC_SUBTRACT 0x800A +# define NV097_SET_BLEND_EQUATION_V_FUNC_REVERSE_SUBTRACT 0x800B +# define NV097_SET_BLEND_EQUATION_V_FUNC_ADD 0x8006 +# define NV097_SET_BLEND_EQUATION_V_MIN 0x8007 +# define NV097_SET_BLEND_EQUATION_V_MAX 0x8008 +# define NV097_SET_BLEND_EQUATION_V_FUNC_REVERSE_SUBTRACT_SIGNED 0xF005 +# define NV097_SET_BLEND_EQUATION_V_FUNC_ADD_SIGNED 0xF006 +# define NV097_SET_DEPTH_FUNC 0x00000354 +# define NV097_SET_COLOR_MASK 0x00000358 +# define NV097_SET_COLOR_MASK_BLUE_WRITE_ENABLE (1 << 0) +# define NV097_SET_COLOR_MASK_GREEN_WRITE_ENABLE (1 << 8) +# define NV097_SET_COLOR_MASK_RED_WRITE_ENABLE (1 << 16) +# define NV097_SET_COLOR_MASK_ALPHA_WRITE_ENABLE (1 << 24) +# define NV097_SET_DEPTH_MASK 0x0000035C +# define NV097_SET_STENCIL_MASK 0x00000360 +# define NV097_SET_STENCIL_FUNC 0x00000364 +# define NV097_SET_STENCIL_FUNC_REF 0x00000368 +# define NV097_SET_STENCIL_FUNC_MASK 0x0000036C +# define NV097_SET_STENCIL_OP_FAIL 0x00000370 +# define NV097_SET_STENCIL_OP_ZFAIL 0x00000374 +# define NV097_SET_STENCIL_OP_ZPASS 0x00000378 +# define NV097_SET_STENCIL_OP_V_KEEP 0x1E00 +# define NV097_SET_STENCIL_OP_V_ZERO 0x0000 +# define NV097_SET_STENCIL_OP_V_REPLACE 0x1E01 +# define NV097_SET_STENCIL_OP_V_INCRSAT 0x1E02 +# define NV097_SET_STENCIL_OP_V_DECRSAT 0x1E03 +# define NV097_SET_STENCIL_OP_V_INVERT 0x150A +# define NV097_SET_STENCIL_OP_V_INCR 0x8507 +# define NV097_SET_STENCIL_OP_V_DECR 0x8508 +# define NV097_SET_POLYGON_OFFSET_SCALE_FACTOR 0x00000384 +# define NV097_SET_POLYGON_OFFSET_BIAS 0x00000388 +# define NV097_SET_FRONT_POLYGON_MODE 0x0000038C +# define NV097_SET_FRONT_POLYGON_MODE_V_POINT 0x1B00 +# define NV097_SET_FRONT_POLYGON_MODE_V_LINE 0x1B01 +# define NV097_SET_FRONT_POLYGON_MODE_V_FILL 0x1B02 +# define NV097_SET_BACK_POLYGON_MODE 0x00000390 +# define NV097_SET_CLIP_MIN 0x00000394 +# define NV097_SET_CLIP_MAX 0x00000398 +# define NV097_SET_CULL_FACE 0x0000039C +# define NV097_SET_CULL_FACE_V_FRONT 0x404 +# define NV097_SET_CULL_FACE_V_BACK 0x405 +# define NV097_SET_CULL_FACE_V_FRONT_AND_BACK 0x408 +# define NV097_SET_FRONT_FACE 0x000003A0 +# define NV097_SET_FRONT_FACE_V_CW 0x900 +# define NV097_SET_FRONT_FACE_V_CCW 0x901 +# define NV097_SET_NORMALIZATION_ENABLE 0x000003A4 +# define NV097_SET_LIGHT_ENABLE_MASK 0x000003BC +# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_OFF 0 +# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_INFINITE 1 +# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_LOCAL 2 +# define NV097_SET_LIGHT_ENABLE_MASK_LIGHT0_SPOT 3 +# define NV097_SET_TEXGEN_S 0x000003C0 +# define NV097_SET_TEXGEN_S_DISABLE 0x0000 +# define NV097_SET_TEXGEN_S_EYE_LINEAR 0x2400 +# define NV097_SET_TEXGEN_S_OBJECT_LINEAR 0x2401 +# define NV097_SET_TEXGEN_S_SPHERE_MAP 0x2402 +# define NV097_SET_TEXGEN_S_REFLECTION_MAP 0x8512 +# define NV097_SET_TEXGEN_S_NORMAL_MAP 0x8511 +# define NV097_SET_TEXGEN_T 0x000003C4 +# define NV097_SET_TEXGEN_R 0x000003C8 +# define NV097_SET_TEXGEN_Q 0x000003CC +# define NV097_SET_TEXTURE_MATRIX_ENABLE 0x00000420 +# define NV097_SET_PROJECTION_MATRIX 0x00000440 +# define NV097_SET_MODEL_VIEW_MATRIX 0x00000480 +# define NV097_SET_INVERSE_MODEL_VIEW_MATRIX 0x00000580 +# define NV097_SET_COMPOSITE_MATRIX 0x00000680 +# define NV097_SET_TEXTURE_MATRIX 0x000006C0 +# define NV097_SET_TEXGEN_PLANE_S 0x00000840 +# define NV097_SET_TEXGEN_PLANE_T 0x00000850 +# define NV097_SET_TEXGEN_PLANE_R 0x00000860 +# define NV097_SET_TEXGEN_PLANE_Q 0x00000870 +# define NV097_SET_FOG_PARAMS 0x000009C0 +# define NV097_SET_TEXGEN_VIEW_MODEL 0x000009CC +# define NV097_SET_TEXGEN_VIEW_MODEL_LOCAL_VIEWER 0 +# define NV097_SET_TEXGEN_VIEW_MODEL_INFINITE_VIEWER 1 +# define NV097_SET_FOG_PLANE 0x000009D0 +# define NV097_SET_FLAT_SHADE_OP 0x000009FC +# define NV097_SET_SCENE_AMBIENT_COLOR 0x00000A10 +# define NV097_SET_VIEWPORT_OFFSET 0x00000A20 +# define NV097_SET_EYE_POSITION 0x00000A50 +# define NV097_SET_COMBINER_FACTOR0 0x00000A60 +# define NV097_SET_COMBINER_FACTOR1 0x00000A80 +# define NV097_SET_COMBINER_ALPHA_OCW 0x00000AA0 +# define NV097_SET_COMBINER_ALPHA_OCW_OP 0xFFFF8000 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_NOSHIFT 0 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_NOSHIFT_BIAS 1 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY1 2 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY1_BIAS 3 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTLEFTBY2 4 +# define NV097_SET_COMBINER_ALPHA_OCW_OP_SHIFTRIGHTBY1 6 +# define NV097_SET_COMBINER_ALPHA_OCW_MUX_ENABLE (1<<14) +# define NV097_SET_COMBINER_ALPHA_OCW_SUM_DST 0x00000F00 +# define NV097_SET_COMBINER_ALPHA_OCW_AB_DST 0x000000F0 +# define NV097_SET_COMBINER_ALPHA_OCW_CD_DST 0x0000000F +# define NV097_SET_COMBINER_COLOR_ICW 0x00000AC0 +# define NV097_SET_COMBINER_COLOR_ICW_A_MAP 0xE0000000 +# define NV097_SET_COMBINER_COLOR_ICW_A_ALPHA (1<<28) +# define NV097_SET_COMBINER_COLOR_ICW_A_SOURCE 0x0F000000 +# define NV097_SET_COMBINER_COLOR_ICW_B_MAP 0x00E00000 +# define NV097_SET_COMBINER_COLOR_ICW_B_ALPHA (1<<20) +# define NV097_SET_COMBINER_COLOR_ICW_B_SOURCE 0x000F0000 +# define NV097_SET_COMBINER_COLOR_ICW_C_MAP 0x0000E000 +# define NV097_SET_COMBINER_COLOR_ICW_C_ALPHA (1<<12) +# define NV097_SET_COMBINER_COLOR_ICW_C_SOURCE 0x00000F00 +# define NV097_SET_COMBINER_COLOR_ICW_D_MAP 0x000000E0 +# define NV097_SET_COMBINER_COLOR_ICW_D_ALPHA (1<<4) +# define NV097_SET_COMBINER_COLOR_ICW_D_SOURCE 0x0000000F +# define NV097_SET_VIEWPORT_SCALE 0x00000AF0 +# define NV097_SET_TRANSFORM_PROGRAM 0x00000B00 +# define NV097_SET_TRANSFORM_CONSTANT 0x00000B80 +# define NV097_SET_BACK_LIGHT_AMBIENT_COLOR 0x00000C00 +# define NV097_SET_BACK_LIGHT_DIFFUSE_COLOR 0x00000C0C +# define NV097_SET_BACK_LIGHT_SPECULAR_COLOR 0x00000C18 +# define NV097_SET_LIGHT_AMBIENT_COLOR 0x00001000 +# define NV097_SET_LIGHT_DIFFUSE_COLOR 0x0000100C +# define NV097_SET_LIGHT_SPECULAR_COLOR 0x00001018 +# define NV097_SET_LIGHT_LOCAL_RANGE 0x00001024 +# define NV097_SET_LIGHT_INFINITE_HALF_VECTOR 0x00001028 +# define NV097_SET_LIGHT_INFINITE_DIRECTION 0x00001034 +# define NV097_SET_LIGHT_SPOT_FALLOFF 0x00001040 +# define NV097_SET_LIGHT_SPOT_DIRECTION 0x0000104C +# define NV097_SET_LIGHT_LOCAL_POSITION 0x0000105C +# define NV097_SET_LIGHT_LOCAL_ATTENUATION 0x00001068 +# define NV097_SET_VERTEX3F 0x00001500 +# define NV097_SET_VERTEX4F 0x00001518 +# define NV097_SET_VERTEX_DATA_ARRAY_OFFSET 0x00001720 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT 0x00001760 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE 0x0000000F +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_UB_D3D 0 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_S1 1 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_F 2 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_UB_OGL 4 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_S32K 5 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE_CMP 6 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_SIZE 0x000000F0 +# define NV097_SET_VERTEX_DATA_ARRAY_FORMAT_STRIDE 0xFFFFFF00 +# define NV097_SET_LOGIC_OP_ENABLE 0x000017BC +# define NV097_SET_LOGIC_OP 0x000017C0 +# define NV097_CLEAR_REPORT_VALUE 0x000017C8 +# define NV097_CLEAR_REPORT_VALUE_TYPE 0xFFFFFFFF +# define NV097_CLEAR_REPORT_VALUE_TYPE_ZPASS_PIXEL_CNT 1 +# define NV097_SET_ZPASS_PIXEL_COUNT_ENABLE 0x000017CC +# define NV097_GET_REPORT 0x000017D0 +# define NV097_GET_REPORT_OFFSET 0x00FFFFFF +# define NV097_GET_REPORT_TYPE 0xFF000000 +# define NV097_GET_REPORT_TYPE_ZPASS_PIXEL_CNT 1 +# define NV097_SET_EYE_DIRECTION 0x000017E0 +# define NV097_SET_SHADER_CLIP_PLANE_MODE 0x000017F8 +# define NV097_SET_BEGIN_END 0x000017FC +# define NV097_SET_BEGIN_END_OP_END 0x00 +# define NV097_SET_BEGIN_END_OP_POINTS 0x01 +# define NV097_SET_BEGIN_END_OP_LINES 0x02 +# define NV097_SET_BEGIN_END_OP_LINE_LOOP 0x03 +# define NV097_SET_BEGIN_END_OP_LINE_STRIP 0x04 +# define NV097_SET_BEGIN_END_OP_TRIANGLES 0x05 +# define NV097_SET_BEGIN_END_OP_TRIANGLE_STRIP 0x06 +# define NV097_SET_BEGIN_END_OP_TRIANGLE_FAN 0x07 +# define NV097_SET_BEGIN_END_OP_QUADS 0x08 +# define NV097_SET_BEGIN_END_OP_QUAD_STRIP 0x09 +# define NV097_SET_BEGIN_END_OP_POLYGON 0x0A +# define NV097_ARRAY_ELEMENT16 0x00001800 +# define NV097_ARRAY_ELEMENT32 0x00001808 +# define NV097_DRAW_ARRAYS 0x00001810 +# define NV097_DRAW_ARRAYS_COUNT 0xFF000000 +# define NV097_DRAW_ARRAYS_START_INDEX 0x00FFFFFF +# define NV097_INLINE_ARRAY 0x00001818 +# define NV097_SET_EYE_VECTOR 0x0000181C +# define NV097_SET_VERTEX_DATA2F_M 0x00001880 +# define NV097_SET_VERTEX_DATA2S 0x00001900 +# define NV097_SET_VERTEX_DATA4UB 0x00001940 +# define NV097_SET_VERTEX_DATA4S_M 0x00001980 +# define NV097_SET_VERTEX_DATA4F_M 0x00001A00 +# define NV097_SET_TEXTURE_OFFSET 0x00001B00 +# define NV097_SET_TEXTURE_FORMAT 0x00001B04 +# define NV097_SET_TEXTURE_FORMAT_CONTEXT_DMA 0x00000003 +# define NV097_SET_TEXTURE_FORMAT_CUBEMAP_ENABLE (1 << 2) +# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE (1 << 3) +# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE_TEXTURE 0 +# define NV097_SET_TEXTURE_FORMAT_BORDER_SOURCE_COLOR 1 +# define NV097_SET_TEXTURE_FORMAT_DIMENSIONALITY 0x000000F0 +# define NV097_SET_TEXTURE_FORMAT_COLOR 0x0000FF00 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y8 0x00 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_AY8 0x01 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A1R5G5B5 0x02 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X1R5G5B5 0x03 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A4R4G4B4 0x04 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R5G6B5 0x05 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8R8G8B8 0x06 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_X8R8G8B8 0x07 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8 0x0B +# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT1_A1R5G5B5 0x0C +# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT23_A8R8G8B8 0x0E +# define NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT45_A8R8G8B8 0x0F +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A1R5G5B5 0x10 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G6B5 0x11 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8R8G8B8 0x12 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y8 0x13 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_SY8 0x14 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X7SY9 0x15 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R8B8 0x16 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_G8B8 0x17 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_SG8SB8 0x18 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8 0x19 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8Y8 0x1A +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_AY8 0x1B +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X1R5G5B5 0x1C +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A4R4G4B4 0x1D +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_X8R8G8B8 0x1E +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8 0x1F +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8Y8 0x20 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_CR8YB8CB8YA8 0x24 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_YB8CR8YA8CB8 0x25 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8CR8CB8Y8 0x26 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R6G5B5 0x27 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_G8B8 0x28 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8B8 0x29 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FIXED 0x2A +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FLOAT 0x2B +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FIXED 0x2C +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FLOAT 0x2D +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_X8_Y24_FIXED 0x2E +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FIXED 0x30 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FLOAT 0x31 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y16 0x32 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_YB16YA16 0x33 // was NV097_SET_TEXTURE_FORMAT_COLOR_SZ_YB_16_YA_16 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LC_IMAGE_A4V6YB6A4U6YA6 0x34 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16 0x35 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_YB16YA16 0x36 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R6G5B5 0x37 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R5G5B5A1 0x38 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R4G4B4A4 0x39 +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_A8B8G8R8 0x3A +# define NV097_SET_TEXTURE_FORMAT_COLOR_SZ_R8G8B8A8 0x3C +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R5G5B5A1 0x3D +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R4G4B4A4 0x3E +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8B8G8R8 0x3F +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_B8G8R8A8 0x40 +# define NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_R8G8B8A8 0x41 +# define NV097_SET_TEXTURE_FORMAT_MIPMAP_LEVELS 0x000F0000 +# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_U 0x00F00000 +# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_V 0x0F000000 +# define NV097_SET_TEXTURE_FORMAT_BASE_SIZE_P 0xF0000000 +# define NV097_SET_TEXTURE_ADDRESS 0x00001B08 +# define NV097_SET_TEXTURE_CONTROL0 0x00001B0C +# define NV097_SET_TEXTURE_CONTROL0_ENABLE (1 << 30) +# define NV097_SET_TEXTURE_CONTROL0_MIN_LOD_CLAMP 0x3FFC0000 +# define NV097_SET_TEXTURE_CONTROL0_MAX_LOD_CLAMP 0x0003FFC0 +# define NV097_SET_TEXTURE_CONTROL1 0x00001B10 +# define NV097_SET_TEXTURE_CONTROL1_IMAGE_PITCH 0xFFFF0000 +# define NV097_SET_TEXTURE_FILTER 0x00001B14 +# define NV097_SET_TEXTURE_FILTER_MIPMAP_LOD_BIAS 0x00001FFF +# define NV097_SET_TEXTURE_FILTER_MIN 0x00FF0000 +# define NV097_SET_TEXTURE_FILTER_MAG 0x0F000000 +# define NV097_SET_TEXTURE_FILTER_ASIGNED (1 << 28) +# define NV097_SET_TEXTURE_FILTER_RSIGNED (1 << 29) +# define NV097_SET_TEXTURE_FILTER_GSIGNED (1 << 30) +# define NV097_SET_TEXTURE_FILTER_BSIGNED (1 << 31) +# define NV097_SET_TEXTURE_IMAGE_RECT 0x00001B1C +# define NV097_SET_TEXTURE_IMAGE_RECT_WIDTH 0xFFFF0000 +# define NV097_SET_TEXTURE_IMAGE_RECT_HEIGHT 0x0000FFFF +# define NV097_SET_TEXTURE_PALETTE 0x00001B20 +# define NV097_SET_TEXTURE_PALETTE_CONTEXT_DMA (1 << 0) +# define NV097_SET_TEXTURE_PALETTE_LENGTH 0x0000000C +# define NV097_SET_TEXTURE_PALETTE_LENGTH_256 0 +# define NV097_SET_TEXTURE_PALETTE_LENGTH_128 1 +# define NV097_SET_TEXTURE_PALETTE_LENGTH_64 2 +# define NV097_SET_TEXTURE_PALETTE_LENGTH_32 3 +# define NV097_SET_TEXTURE_PALETTE_OFFSET 0xFFFFFFC0 +# define NV097_SET_TEXTURE_BORDER_COLOR 0x00001B24 +# define NV097_SET_TEXTURE_SET_BUMP_ENV_MAT 0x00001B28 +# define NV097_SET_TEXTURE_SET_BUMP_ENV_SCALE 0x00001B38 +# define NV097_SET_TEXTURE_SET_BUMP_ENV_OFFSET 0x00001B3C +# define NV097_SET_SEMAPHORE_OFFSET 0x00001D6C +# define NV097_BACK_END_WRITE_SEMAPHORE_RELEASE 0x00001D70 +# define NV097_SET_ZMIN_MAX_CONTROL 0x00001D78 +# define NV097_SET_COMPRESS_ZBUFFER_EN 0x00001D80 +# define NV097_SET_ZSTENCIL_CLEAR_VALUE 0x00001D8C +# define NV097_SET_COLOR_CLEAR_VALUE 0x00001D90 +# define NV097_CLEAR_SURFACE 0x00001D94 +# define NV097_CLEAR_SURFACE_Z (1 << 0) +# define NV097_CLEAR_SURFACE_STENCIL (1 << 1) +# define NV097_CLEAR_SURFACE_COLOR 0x000000F0 +# define NV097_CLEAR_SURFACE_R (1 << 4) +# define NV097_CLEAR_SURFACE_G (1 << 5) +# define NV097_CLEAR_SURFACE_B (1 << 6) +# define NV097_CLEAR_SURFACE_A (1 << 7) +# define NV097_SET_CLEAR_RECT_HORIZONTAL 0x00001D98 +# define NV097_SET_CLEAR_RECT_VERTICAL 0x00001D9C +# define NV097_SET_SPECULAR_FOG_FACTOR 0x00001E20 +# define NV097_SET_COMBINER_COLOR_OCW 0x00001E40 +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB 0xFFF80000 +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB_DISABLE 0 +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_AB_AB_DST_ENABLE 1 +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD (1<<18) +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD_DISABLE 0 +# define NV097_SET_COMBINER_COLOR_OCW_BLUETOALPHA_CD_CD_DST_ENABLE 1 +# define NV097_SET_COMBINER_COLOR_OCW_OP 0x00038000 +# define NV097_SET_COMBINER_COLOR_OCW_OP_NOSHIFT 0 +# define NV097_SET_COMBINER_COLOR_OCW_OP_NOSHIFT_BIAS 1 +# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY1 2 +# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY1_BIAS 3 +# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTLEFTBY2 4 +# define NV097_SET_COMBINER_COLOR_OCW_OP_SHIFTRIGHTBY1 6 +# define NV097_SET_COMBINER_COLOR_OCW_MUX_ENABLE (1 << 14) +# define NV097_SET_COMBINER_COLOR_OCW_AB_DOT_ENABLE (1 << 13) +# define NV097_SET_COMBINER_COLOR_OCW_CD_DOT_ENABLE (1<<12) +# define NV097_SET_COMBINER_COLOR_OCW_SUM_DST 0x00000F00 +# define NV097_SET_COMBINER_COLOR_OCW_AB_DST 0x000000F0 +# define NV097_SET_COMBINER_COLOR_OCW_CD_DST 0x0000000F +# define NV097_SET_COMBINER_CONTROL 0x00001E60 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT 0x000000FF +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_ONE 1 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_TWO 2 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_THREE 3 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_FOUR 4 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_FIVE 5 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_SIX 6 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_SEVEN 7 +# define NV097_SET_COMBINER_CONTROL_ITERATION_COUNT_EIGHT 8 +# define NV097_SET_COMBINER_CONTROL_MUX_SELECT 0x00000F00 +# define NV097_SET_COMBINER_CONTROL_MUX_SELECT_LSB 0 +# define NV097_SET_COMBINER_CONTROL_MUX_SELECT_MSB 1 +# define NV097_SET_COMBINER_CONTROL_FACTOR0 0x0000F000 +# define NV097_SET_COMBINER_CONTROL_FACTOR0_SAME_FACTOR_ALL 0 +# define NV097_SET_COMBINER_CONTROL_FACTOR0_EACH_STAGE 1 +# define NV097_SET_COMBINER_CONTROL_FACTOR1 0xFFFF0000 +# define NV097_SET_COMBINER_CONTROL_FACTOR1_SAME_FACTOR_ALL 0 +# define NV097_SET_COMBINER_CONTROL_FACTOR1_EACH_STAGE 1 +# define NV097_SET_SHADOW_ZSLOPE_THRESHOLD 0x00001E68 +# define NV097_SET_SHADER_STAGE_PROGRAM 0x00001E70 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0 0x0000001F +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_PROGRAM_NONE 0 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_2D_PROJECTIVE 1 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_3D_PROJECTIVE 2 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_CUBE_MAP 3 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_PASS_THROUGH 4 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE0_CLIP_PLANE 5 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1 0x000003E0 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_PROGRAM_NONE 0x00 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_2D_PROJECTIVE 0x01 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_3D_PROJECTIVE 0x02 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_CUBE_MAP 0x03 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_PASS_THROUGH 0x04 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_CLIP_PLANE 0x05 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_BUMPENVMAP 0x06 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_BUMPENVMAP_LUMINANCE 0x07 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DEPENDENT_AR 0x0F +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DEPENDENT_GB 0x10 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_DOT_PRODUCT 0x11 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2 0x00007C00 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_PROGRAM_NONE 0x00 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_2D_PROJECTIVE 0x01 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_3D_PROJECTIVE 0x02 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_CUBE_MAP 0x03 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_PASS_THROUGH 0x04 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_CLIP_PLANE 0x05 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BUMPENVMAP 0x06 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BUMPENVMAP_LUMINANCE 0x07 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_BRDF 0x08 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_ST 0x09 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_ZW 0x0A +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_REFLECT_DIFFUSE 0x0B +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DEPENDENT_AR 0x0F +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DEPENDENT_GB 0x10 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE2_DOT_PRODUCT 0x11 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3 0x000F8000 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_PROGRAM_NONE 0x00 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_2D_PROJECTIVE 0x01 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_3D_PROJECTIVE 0x02 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_CUBE_MAP 0x03 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_PASS_THROUGH 0x04 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_CLIP_PLANE 0x05 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BUMPENVMAP 0x06 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BUMPENVMAP_LUMINANCE 0x07 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_BRDF 0x08 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_ST 0x09 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_ZW 0x0A +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_REFLECT_SPECULAR 0x0C +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_STR_3D 0x0D +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_STR_CUBE 0x0E +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DEPENDENT_AR 0x0F +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DEPENDENT_GB 0x10 +# define NV097_SET_SHADER_STAGE_PROGRAM_STAGE3_DOT_REFLECT_SPECULAR_CONST 0x12 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT 0x00001E78 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE1 0x0000FFFF +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE1_INSTAGE_0 0 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2 0x000F0000 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2_INSTAGE_0 0 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE2_INSTAGE_1 1 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3 0x00F00000 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_0 0 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_1 1 +# define NV097_SET_SHADER_OTHER_STAGE_INPUT_STAGE3_INSTAGE_2 2 +# define NV097_SET_TRANSFORM_DATA 0x00001E80 +# define NV097_LAUNCH_TRANSFORM_PROGRAM 0x00001E90 +# define NV097_SET_TRANSFORM_EXECUTION_MODE 0x00001E94 +# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE 0x00000003 +# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE_FIXED 0 +# define NV097_SET_TRANSFORM_EXECUTION_MODE_MODE_PROGRAM 2 +# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE 0xFFFFFFFC +# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE_USER 0 +# define NV097_SET_TRANSFORM_EXECUTION_MODE_RANGE_MODE_PRIV 1 +# define NV097_SET_TRANSFORM_PROGRAM_CXT_WRITE_EN 0x00001E98 +# define NV097_SET_TRANSFORM_PROGRAM_LOAD 0x00001E9C +# define NV097_SET_TRANSFORM_PROGRAM_START 0x00001EA0 +# define NV097_SET_TRANSFORM_CONSTANT_LOAD 0x00001EA4 + +/* vertex processing (cheops) context layout */ +#define NV_IGRAPH_XF_XFCTX_CMAT0 0x00 +#define NV_IGRAPH_XF_XFCTX_PMAT0 0x04 +#define NV_IGRAPH_XF_XFCTX_MMAT0 0x08 +#define NV_IGRAPH_XF_XFCTX_IMMAT0 0x0c +#define NV_IGRAPH_XF_XFCTX_MMAT1 0x10 +#define NV_IGRAPH_XF_XFCTX_IMMAT1 0x14 +#define NV_IGRAPH_XF_XFCTX_MMAT2 0x18 +#define NV_IGRAPH_XF_XFCTX_IMMAT2 0x1c +#define NV_IGRAPH_XF_XFCTX_MMAT3 0x20 +#define NV_IGRAPH_XF_XFCTX_IMMAT3 0x24 +#define NV_IGRAPH_XF_XFCTX_LIT0 0x28 +#define NV_IGRAPH_XF_XFCTX_LIT1 0x29 +#define NV_IGRAPH_XF_XFCTX_LIT2 0x2a +#define NV_IGRAPH_XF_XFCTX_LIT3 0x2b +#define NV_IGRAPH_XF_XFCTX_LIT4 0x2c +#define NV_IGRAPH_XF_XFCTX_LIT5 0x2d +#define NV_IGRAPH_XF_XFCTX_LIT6 0x2e +#define NV_IGRAPH_XF_XFCTX_LIT7 0x2f +#define NV_IGRAPH_XF_XFCTX_SPOT0 0x30 +#define NV_IGRAPH_XF_XFCTX_SPOT1 0x31 +#define NV_IGRAPH_XF_XFCTX_SPOT2 0x32 +#define NV_IGRAPH_XF_XFCTX_SPOT3 0x33 +#define NV_IGRAPH_XF_XFCTX_SPOT4 0x34 +#define NV_IGRAPH_XF_XFCTX_SPOT5 0x35 +#define NV_IGRAPH_XF_XFCTX_SPOT6 0x36 +#define NV_IGRAPH_XF_XFCTX_SPOT7 0x37 +#define NV_IGRAPH_XF_XFCTX_EYEP 0x38 +#define NV_IGRAPH_XF_XFCTX_FOG 0x39 +#define NV_IGRAPH_XF_XFCTX_VPSCL 0x3a +#define NV_IGRAPH_XF_XFCTX_VPOFF 0x3b +#define NV_IGRAPH_XF_XFCTX_CONS0 0x3c +#define NV_IGRAPH_XF_XFCTX_CONS1 0x3d +#define NV_IGRAPH_XF_XFCTX_CONS2 0x3e +#define NV_IGRAPH_XF_XFCTX_CONS3 0x3f +#define NV_IGRAPH_XF_XFCTX_TG0MAT 0x40 +#define NV_IGRAPH_XF_XFCTX_T0MAT 0x44 +#define NV_IGRAPH_XF_XFCTX_TG1MAT 0x48 +#define NV_IGRAPH_XF_XFCTX_T1MAT 0x4c +#define NV_IGRAPH_XF_XFCTX_TG2MAT 0x50 +#define NV_IGRAPH_XF_XFCTX_T2MAT 0x54 +#define NV_IGRAPH_XF_XFCTX_TG3MAT 0x58 +#define NV_IGRAPH_XF_XFCTX_T3MAT 0x5c +#define NV_IGRAPH_XF_XFCTX_PRSPACE 0x60 + +/* lighting (zoser) context layout */ +#define NV_IGRAPH_XF_LTCTXA_L0_K 0x00 +#define NV_IGRAPH_XF_LTCTXA_L0_SPT 0x01 +#define NV_IGRAPH_XF_LTCTXA_L1_K 0x02 +#define NV_IGRAPH_XF_LTCTXA_L1_SPT 0x03 +#define NV_IGRAPH_XF_LTCTXA_L2_K 0x04 +#define NV_IGRAPH_XF_LTCTXA_L2_SPT 0x05 +#define NV_IGRAPH_XF_LTCTXA_L3_K 0x06 +#define NV_IGRAPH_XF_LTCTXA_L3_SPT 0x07 +#define NV_IGRAPH_XF_LTCTXA_L4_K 0x08 +#define NV_IGRAPH_XF_LTCTXA_L4_SPT 0x09 +#define NV_IGRAPH_XF_LTCTXA_L5_K 0x0a +#define NV_IGRAPH_XF_LTCTXA_L5_SPT 0x0b +#define NV_IGRAPH_XF_LTCTXA_L6_K 0x0c +#define NV_IGRAPH_XF_LTCTXA_L6_SPT 0x0d +#define NV_IGRAPH_XF_LTCTXA_L7_K 0x0e +#define NV_IGRAPH_XF_LTCTXA_L7_SPT 0x0f +#define NV_IGRAPH_XF_LTCTXA_EYED 0x10 +#define NV_IGRAPH_XF_LTCTXA_FR_AMB 0x11 +#define NV_IGRAPH_XF_LTCTXA_BR_AMB 0x12 +#define NV_IGRAPH_XF_LTCTXA_CM_COL 0x13 +#define NV_IGRAPH_XF_LTCTXA_BCM_COL 0x14 +#define NV_IGRAPH_XF_LTCTXA_FOG_K 0x15 +#define NV_IGRAPH_XF_LTCTXA_ZERO 0x16 +#define NV_IGRAPH_XF_LTCTXA_PT0 0x17 +#define NV_IGRAPH_XF_LTCTXA_FOGLIN 0x18 + +#define NV_IGRAPH_XF_LTCTXB_L0_AMB 0x00 +#define NV_IGRAPH_XF_LTCTXB_L0_DIF 0x01 +#define NV_IGRAPH_XF_LTCTXB_L0_SPC 0x02 +#define NV_IGRAPH_XF_LTCTXB_L0_BAMB 0x03 +#define NV_IGRAPH_XF_LTCTXB_L0_BDIF 0x04 +#define NV_IGRAPH_XF_LTCTXB_L0_BSPC 0x05 +#define NV_IGRAPH_XF_LTCTXB_L1_AMB 0x06 +#define NV_IGRAPH_XF_LTCTXB_L1_DIF 0x07 +#define NV_IGRAPH_XF_LTCTXB_L1_SPC 0x08 +#define NV_IGRAPH_XF_LTCTXB_L1_BAMB 0x09 +#define NV_IGRAPH_XF_LTCTXB_L1_BDIF 0x0a +#define NV_IGRAPH_XF_LTCTXB_L1_BSPC 0x0b +#define NV_IGRAPH_XF_LTCTXB_L2_AMB 0x0c +#define NV_IGRAPH_XF_LTCTXB_L2_DIF 0x0d +#define NV_IGRAPH_XF_LTCTXB_L2_SPC 0x0e +#define NV_IGRAPH_XF_LTCTXB_L2_BAMB 0x0f +#define NV_IGRAPH_XF_LTCTXB_L2_BDIF 0x10 +#define NV_IGRAPH_XF_LTCTXB_L2_BSPC 0x11 +#define NV_IGRAPH_XF_LTCTXB_L3_AMB 0x12 +#define NV_IGRAPH_XF_LTCTXB_L3_DIF 0x13 +#define NV_IGRAPH_XF_LTCTXB_L3_SPC 0x14 +#define NV_IGRAPH_XF_LTCTXB_L3_BAMB 0x15 +#define NV_IGRAPH_XF_LTCTXB_L3_BDIF 0x16 +#define NV_IGRAPH_XF_LTCTXB_L3_BSPC 0x17 +#define NV_IGRAPH_XF_LTCTXB_L4_AMB 0x18 +#define NV_IGRAPH_XF_LTCTXB_L4_DIF 0x19 +#define NV_IGRAPH_XF_LTCTXB_L4_SPC 0x1a +#define NV_IGRAPH_XF_LTCTXB_L4_BAMB 0x1b +#define NV_IGRAPH_XF_LTCTXB_L4_BDIF 0x1c +#define NV_IGRAPH_XF_LTCTXB_L4_BSPC 0x1d +#define NV_IGRAPH_XF_LTCTXB_L5_AMB 0x1e +#define NV_IGRAPH_XF_LTCTXB_L5_DIF 0x1f +#define NV_IGRAPH_XF_LTCTXB_L5_SPC 0x20 +#define NV_IGRAPH_XF_LTCTXB_L5_BAMB 0x21 +#define NV_IGRAPH_XF_LTCTXB_L5_BDIF 0x22 +#define NV_IGRAPH_XF_LTCTXB_L5_BSPC 0x23 +#define NV_IGRAPH_XF_LTCTXB_L6_AMB 0x24 +#define NV_IGRAPH_XF_LTCTXB_L6_DIF 0x25 +#define NV_IGRAPH_XF_LTCTXB_L6_SPC 0x26 +#define NV_IGRAPH_XF_LTCTXB_L6_BAMB 0x27 +#define NV_IGRAPH_XF_LTCTXB_L6_BDIF 0x28 +#define NV_IGRAPH_XF_LTCTXB_L6_BSPC 0x29 +#define NV_IGRAPH_XF_LTCTXB_L7_AMB 0x2a +#define NV_IGRAPH_XF_LTCTXB_L7_DIF 0x2b +#define NV_IGRAPH_XF_LTCTXB_L7_SPC 0x2c +#define NV_IGRAPH_XF_LTCTXB_L7_BAMB 0x2d +#define NV_IGRAPH_XF_LTCTXB_L7_BDIF 0x2e +#define NV_IGRAPH_XF_LTCTXB_L7_BSPC 0x2f +#define NV_IGRAPH_XF_LTCTXB_PT1 0x30 +#define NV_IGRAPH_XF_LTCTXB_ONE 0x31 +#define NV_IGRAPH_XF_LTCTXB_VPOFFSET 0x32 + +#define NV_IGRAPH_XF_LTC1_ZERO1 0x00 +#define NV_IGRAPH_XF_LTC1_l0 0x01 +#define NV_IGRAPH_XF_LTC1_Bl0 0x02 +#define NV_IGRAPH_XF_LTC1_PP 0x03 +#define NV_IGRAPH_XF_LTC1_r0 0x04 +#define NV_IGRAPH_XF_LTC1_r1 0x05 +#define NV_IGRAPH_XF_LTC1_r2 0x06 +#define NV_IGRAPH_XF_LTC1_r3 0x07 +#define NV_IGRAPH_XF_LTC1_r4 0x08 +#define NV_IGRAPH_XF_LTC1_r5 0x09 +#define NV_IGRAPH_XF_LTC1_r6 0x0a +#define NV_IGRAPH_XF_LTC1_r7 0x0b +#define NV_IGRAPH_XF_LTC1_L0 0x0c +#define NV_IGRAPH_XF_LTC1_L1 0x0d +#define NV_IGRAPH_XF_LTC1_L2 0x0e +#define NV_IGRAPH_XF_LTC1_L3 0x0f +#define NV_IGRAPH_XF_LTC1_L4 0x10 +#define NV_IGRAPH_XF_LTC1_L5 0x11 +#define NV_IGRAPH_XF_LTC1_L6 0x12 +#define NV_IGRAPH_XF_LTC1_L7 0x13 + + +#define NV2A_VERTEX_ATTR_POSITION 0 +#define NV2A_VERTEX_ATTR_WEIGHT 1 +#define NV2A_VERTEX_ATTR_NORMAL 2 +#define NV2A_VERTEX_ATTR_DIFFUSE 3 +#define NV2A_VERTEX_ATTR_SPECULAR 4 +#define NV2A_VERTEX_ATTR_FOG 5 +#define NV2A_VERTEX_ATTR_POINT_SIZE 6 +#define NV2A_VERTEX_ATTR_BACK_DIFFUSE 7 +#define NV2A_VERTEX_ATTR_BACK_SPECULAR 8 +#define NV2A_VERTEX_ATTR_TEXTURE0 9 +#define NV2A_VERTEX_ATTR_TEXTURE1 10 +#define NV2A_VERTEX_ATTR_TEXTURE2 11 +#define NV2A_VERTEX_ATTR_TEXTURE3 12 +#define NV2A_VERTEX_ATTR_RESERVED1 13 +#define NV2A_VERTEX_ATTR_RESERVED2 14 +#define NV2A_VERTEX_ATTR_RESERVED3 15 + +#define NV2A_CRYSTAL_FREQ 16666666 // Was 13500000 +#define NV2A_NUM_CHANNELS 32 +#define NV2A_NUM_SUBCHANNELS 8 +#define NV2A_CACHE1_SIZE 128 + +#define NV2A_MAX_BATCH_LENGTH 0x1FFFF +#define NV2A_VERTEXSHADER_ATTRIBUTES 16 +#define NV2A_MAX_TEXTURES 4 + +#define NV2A_MAX_TRANSFORM_PROGRAM_LENGTH 136 +#define NV2A_VERTEXSHADER_CONSTANTS 192 +#define NV2A_MAX_LIGHTS 8 + +#define NV2A_LTCTXA_COUNT 26 +#define NV2A_LTCTXB_COUNT 52 +#define NV2A_LTC1_COUNT 20 + +#endif diff --git a/src/devices/video/nv2a_shaders.cpp b/src/devices/video/nv2a_shaders.cpp index 0186b7f62..ed0d710e2 100644 --- a/src/devices/video/nv2a_shaders.cpp +++ b/src/devices/video/nv2a_shaders.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ //#include "qemu-common.h" @@ -759,7 +759,7 @@ STRUCT_VERTEX_DATA); /* Return combined header + source */ qstring_append(header, qstring_get_str(body)); - QDECREF(body); + qobject_unref(body); return header; } @@ -775,7 +775,7 @@ STRUCT_VERTEX_DATA); NV2A_DPRINTF("compile new %s, code:\n%s\n", name, code); GLuint shader = glCreateShader(gl_shader_type); - glShaderSource(shader, 1, &code, 0); + glShaderSource(shader, 1, &code, NULL); glCompileShader(shader); /* Check it compiled */ @@ -824,7 +824,7 @@ ShaderBinding* generate_shaders(const ShaderState state) "geometry shader"); glAttachShader(program, geometry_shader); - QDECREF(geometry_shader_code); + qobject_unref(geometry_shader_code); vtx_prefix = 'v'; } else { @@ -838,7 +838,7 @@ ShaderBinding* generate_shaders(const ShaderState state) qstring_get_str(vertex_shader_code), "vertex shader"); glAttachShader(program, vertex_shader); - QDECREF(vertex_shader_code); + qobject_unref(vertex_shader_code); /* Bind attributes for vertices */ @@ -859,7 +859,7 @@ ShaderBinding* generate_shaders(const ShaderState state) "fragment shader"); glAttachShader(program, fragment_shader); - QDECREF(fragment_shader_code); + qobject_unref(fragment_shader_code); /* link the program */ @@ -952,6 +952,10 @@ ShaderBinding* generate_shaders(const ShaderState state) snprintf(tmp, sizeof(tmp), "lightLocalAttenuation%d", i); ret->light_local_attenuation_loc[i] = glGetUniformLocation(program, tmp); } + for (i = 0; i < 8; i++) { + snprintf(tmp, sizeof(tmp), "clipRegion[%d]", i); + ret->clip_region_loc[i] = glGetUniformLocation(program, tmp); + } return ret; } diff --git a/src/devices/video/nv2a_shaders.h b/src/devices/video/nv2a_shaders.h index 7a6146dc7..f64edc569 100644 --- a/src/devices/video/nv2a_shaders.h +++ b/src/devices/video/nv2a_shaders.h @@ -15,19 +15,18 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #ifndef HW_NV2A_SHADERS_H #define HW_NV2A_SHADERS_H #include "qstring.h" -#include "CxbxKrnl/gloffscreen/gloffscreen.h" +#include "common\util\gloffscreen\gloffscreen.h" // For GLenum, etc #include "nv2a_vsh.h" #include "nv2a_psh.h" -#include "nv2a_int.h" - +#include "nv2a_regs.h" enum ShaderPrimitiveMode { PRIM_TYPE_NONE, @@ -108,6 +107,7 @@ typedef struct ShaderBinding { GLint light_local_position_loc[NV2A_MAX_LIGHTS]; GLint light_local_attenuation_loc[NV2A_MAX_LIGHTS]; + GLint clip_region_loc[8]; } ShaderBinding; ShaderBinding* generate_shaders(const ShaderState state); diff --git a/src/devices/video/nv2a_shaders_common.h b/src/devices/video/nv2a_shaders_common.h index c8e1a962f..6bec94aab 100644 --- a/src/devices/video/nv2a_shaders_common.h +++ b/src/devices/video/nv2a_shaders_common.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #ifndef HW_NV2A_SHADERS_COMMON_H diff --git a/src/devices/video/nv2a_vsh.cpp b/src/devices/video/nv2a_vsh.cpp index 38b9af830..dc554969b 100644 --- a/src/devices/video/nv2a_vsh.cpp +++ b/src/devices/video/nv2a_vsh.cpp @@ -22,7 +22,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, see . + * along with this program; if not, see . */ #include @@ -373,7 +373,7 @@ static QString* decode_opcode_input(const uint32_t *shader_token, /* swizzle bits are next to the neg bit */ QString *swizzle_str = decode_swizzle(shader_token, (VshFieldName)((int)neg_field+1)); qstring_append(ret_str, qstring_get_str(swizzle_str)); - QDECREF(swizzle_str); + qobject_unref(swizzle_str); } return ret_str; @@ -463,7 +463,7 @@ static QString* decode_token(const uint32_t *shader_token) vsh_get_field(shader_token, FLD_A_R)); qstring_append(inputs_mac, ", "); qstring_append(inputs_mac, qstring_get_str(input_a)); - QDECREF(input_a); + qobject_unref(input_a); } if (mac_opcode_params[mac].B) { QString *input_b = @@ -473,7 +473,7 @@ static QString* decode_token(const uint32_t *shader_token) vsh_get_field(shader_token, FLD_B_R)); qstring_append(inputs_mac, ", "); qstring_append(inputs_mac, qstring_get_str(input_b)); - QDECREF(input_b); + qobject_unref(input_b); } if (mac_opcode_params[mac].C) { qstring_append(inputs_mac, ", "); @@ -486,7 +486,7 @@ static QString* decode_token(const uint32_t *shader_token) vsh_get_field(shader_token, FLD_OUT_MAC_MASK), mac_opcode[mac], qstring_get_str(inputs_mac)); - QDECREF(inputs_mac); + qobject_unref(inputs_mac); } else { ret = qstring_new(); } @@ -507,11 +507,11 @@ static QString* decode_token(const uint32_t *shader_token) qstring_append(ret, qstring_get_str(ilu_op)); - QDECREF(inputs_c); - QDECREF(ilu_op); + qobject_unref(inputs_c); + qobject_unref(ilu_op); } - QDECREF(input_c); + qobject_unref(input_c); return ret; } @@ -536,7 +536,7 @@ static const char* vsh_header = "\n" /* See: - * http://msdn.microsoft.com/en-us/library/windows/desktop/bb174703%28v=vs.85%29.aspx + * https://msdn.microsoft.com/en-us/library/windows/desktop/bb174703%28v=vs.85%29.aspx * https://www.opengl.org/registry/specs/NV/vertex_program1_1.txt */ "\n" @@ -625,7 +625,16 @@ static const char* vsh_header = "#define ARL(dest, src) dest = _ARL(_in(src).x)\n" "int _ARL(float src)\n" "{\n" - " return int(floor(src));\n" + " /* Xbox GPU does specify rounding, OpenGL doesn't; so we need a bias.\n" + " * Example: We probably want to floor 16.99.. to 17, not 16.\n" + " * Source of error (why we get 16.99.. instead of 17.0) is typically\n" + " * vertex-attributes being normalized from a byte value to float:\n" + " * 17 / 255 = 0.06666.. so is this 0.06667 (ceil) or 0.06666 (floor)?\n" + " * Which value we get depends on the host GPU.\n" + " * If we multiply these rounded values by 255 later, we get:\n" + " * 17.00 (ARL result = 17) or 16.99 (ARL result = 16).\n" + " * We assume the intend was to get 17, so we add our bias to fix it. */\n" + " return int(floor(src + 0.001));\n" "}\n" "\n" "#define SGE(dest, mask, src0, src1) dest.mask = _SGE(_in(src0), _in(src1)).mask\n" @@ -663,13 +672,25 @@ static const char* vsh_header = "#define EXP(dest, mask, src) dest.mask = _EXP(_in(src).x).mask\n" "vec4 _EXP(float src)\n" "{\n" - " return vec4(exp2(src));\n" + " vec4 result;\n" + " result.x = exp2(floor(src));\n" + " result.y = src - floor(src);\n" + " result.z = exp2(src);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LOG(dest, mask, src) dest.mask = _LOG(_in(src).x).mask\n" "vec4 _LOG(float src)\n" "{\n" - " return vec4(log2(src));\n" + " float tmp = abs(src);\n" + " if (tmp == 0.0) { return vec4(-INFINITY, 1.0f, -INFINITY, 1.0f); }\n" + " vec4 result;\n" + " result.x = floor(log2(tmp));\n" + " result.y = tmp / exp2(floor(log2(tmp)));\n" + " result.z = log2(tmp);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LIT(dest, mask, src) dest.mask = _LIT(_in(src)).mask\n" @@ -711,7 +732,7 @@ void vsh_translate(uint16_t version, qstring_append(body, "\n"); qstring_append(body, qstring_get_str(token_str)); qstring_append(body, "\n"); - QDECREF(token_str); + qobject_unref(token_str); if (vsh_get_field(cur_token, FLD_FINAL)) { has_final = true; diff --git a/src/devices/video/nv2a_vsh.h b/src/devices/video/nv2a_vsh.h index 5a40bfe34..b891c1160 100644 --- a/src/devices/video/nv2a_vsh.h +++ b/src/devices/video/nv2a_vsh.h @@ -13,7 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see + * License along with this library; if not, see * * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. diff --git a/src/devices/video/qemu-thread.h b/src/devices/video/qemu-thread.h index 4b78cff47..c8748fc73 100644 --- a/src/devices/video/qemu-thread.h +++ b/src/devices/video/qemu-thread.h @@ -1,3 +1,24 @@ +/* +* QEMU Geforce NV2A threads +* +* Copyright (c) 2012 espes +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2 as published by the Free Software Foundation. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see +* +* Contributions after 2012-01-13 are licensed under the terms of the +* GNU GPL, version 2 or (at your option) any later version. +*/ + #ifndef __QEMU_THREAD_H #define __QEMU_THREAD_H 1 diff --git a/src/devices/video/qstring.h b/src/devices/video/qstring.h index a97c7db39..ccf01bd2d 100644 --- a/src/devices/video/qstring.h +++ b/src/devices/video/qstring.h @@ -37,7 +37,7 @@ static QString* qstring_from_fmt(std::string fmt, ...) { #define qstring_append_fmt(gs, fmt, ...) gs->append(*(std::string*)(qstring_from_fmt(fmt, ##__VA_ARGS__))) #define qstring_get_length(gs) gs->size() -#define QDECREF(X) // FIXME: Mostly free, but needs to be reviewed case-by-case -#define QINCREF(X) // FIXME: Tricky! +#define qobject_unref(X) // FIXME: Mostly free, but needs to be reviewed case-by-case +#define qobject_ref(X) // FIXME: Tricky! #endif diff --git a/src/devices/video/swizzle.cpp b/src/devices/video/swizzle.cpp index 813e467ec..8dd89bb06 100644 --- a/src/devices/video/swizzle.cpp +++ b/src/devices/video/swizzle.cpp @@ -15,7 +15,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see + * License along with this library; if not, see * * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. diff --git a/src/devices/video/swizzle.h b/src/devices/video/swizzle.h index 6491cdb23..4a806fb32 100644 --- a/src/devices/video/swizzle.h +++ b/src/devices/video/swizzle.h @@ -14,7 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see + * License along with this library; if not, see * * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. diff --git a/src/devices/x86/EmuX86.cpp b/src/devices/x86/EmuX86.cpp new file mode 100644 index 000000000..cf7ec8f64 --- /dev/null +++ b/src/devices/x86/EmuX86.cpp @@ -0,0 +1,3317 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2002-2003 Aaron Robinson +// * (c) 2016-2018 Luke Usher +// * (c) 2016-2018 Patrick van Logchem +// * All rights reserved +// * +// ****************************************************************** + +#define LOG_PREFIX CXBXR_MODULE::X86 + +// Link the library into our project. +#pragma comment(lib, "distorm.lib") + +// Cxbx uses dynamic linking of distorm, which by default chooses for 64 bits offsets : +#define SUPPORT_64BIT_OFFSET + +#include "distorm.h" +#include "mnemonics.h" + +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" // For EmuLog +#include "devices\x86\EmuX86.h" +#include "core\hle\Intercept.hpp" // for bLLE_GPU + +#include +#include "devices\Xbox.h" // For g_PCIBus +#include +#include +#include "Logging.h" + +extern uint32_t GetAPUTime(); +extern std::atomic_bool g_bEnableAllInterrupts; + +// +// Read & write handlers handlers for I/O +// + +static int field_pin = 0; + +uint32_t EmuX86_IORead(xbaddr addr, int size) +{ + switch (addr) { + case 0x8008: { // TODO : Move 0x8008 TIMER to a device + if (size == sizeof(uint32_t)) { + // HACK: This is very wrong. + // This timer should count at a specific frequency (3579.545 ticks per ms) + // But this is enough to keep NXDK from hanging for now. + LARGE_INTEGER performanceCount; + QueryPerformanceCounter(&performanceCount); + return static_cast(performanceCount.QuadPart); + } + break; + } + case 0x80C0: { // TODO : Move 0x80C0 TV encoder to a device + if (size == sizeof(uint8_t)) { + // field pin from tv encoder? + field_pin = (field_pin + 1) & 1; + return field_pin << 5; + } + break; + } + } + + // Pass the IO Read to the PCI Bus, this will handle devices with BARs set to IO addresses + uint32_t value = 0; + if (g_PCIBus->IORead(addr, &value, size)) { + return value; + } + + EmuLog(LOG_LEVEL::WARNING, "EmuX86_IORead(0x%08X, %d) [Unhandled]", addr, size); + return 0; +} + +void EmuX86_IOWrite(xbaddr addr, uint32_t value, int size) +{ + // Pass the IO Write to the PCI Bus, this will handle devices with BARs set to IO addresses + if (g_PCIBus->IOWrite(addr, value, size)) { + return; + } + + EmuLog(LOG_LEVEL::WARNING, "EmuX86_IOWrite(0x%08X, 0x%04X, %d) [Unhandled]", addr, value, size); +} + +// +// Read & write handlers for pass-through access to (host committed, virtual) xbox memory +// +// Only allowed to be called outside our EmuException exception handler, +// to prevent recursive exceptions when accessing unallocated memory. +// + +uint32_t EmuX86_Mem_Read(xbaddr addr, int size) +{ + __try { + + switch (size) { + case sizeof(uint32_t) : + return *(uint32_t*)addr; + case sizeof(uint16_t) : + return *(uint16_t*)addr; + case sizeof(uint8_t) : + return *(uint8_t*)addr; + default: + // UNREACHABLE(size); + assert(false); + return 0; + } + } + __except (true) { // TODO : EXCEPTION_EXECUTE_HANDLER instead of true? + EmuLog(LOG_LEVEL::WARNING, "EmuX86_Mem_Read Failed (0x%08X, %d)", addr, size); + return 0; + } +} + +void EmuX86_Mem_Write(xbaddr addr, uint32_t value, int size) +{ + __try { + switch (size) { + case sizeof(uint32_t) : + *(uint32_t*)addr = (uint32_t)value; + break; + case sizeof(uint16_t) : + *(uint16_t*)addr = (uint16_t)value; + break; + case sizeof(uint8_t) : + *(uint8_t*)addr = (uint8_t)value; + break; + default: + // UNREACHABLE(size); + assert(false); + return; + } + } + __except (true) { // TODO : EXCEPTION_EXECUTE_HANDLER instead of true? + EmuLog(LOG_LEVEL::WARNING, "EmuX86_Mem_Write Failed (0x%08X, 0x%08X, %d)", addr, value, size); + } +} + +uint32_t EmuFlash_Read32(xbaddr addr) // TODO : Move to EmuFlash.cpp +{ + uint32_t r; + + switch (addr) { + case 0x78: // ROM_VERSION + r = 0x90; // Luke's hardware revision 1.6 Xbox returns this (also since XboxKrnlVersion is set to 5838) + break; + default: + EmuLog(LOG_LEVEL::WARNING, "Read32 FLASH_ROM (0x%.8X) [Unknown address]", addr); + return -1; + } + + EmuLog(LOG_LEVEL::DEBUG, "Read32 FLASH_ROM (0x%.8X) = 0x%.8X [HANDLED]", addr, r); + return r; +} + +// +// Read & write handlers for memory-mapped hardware devices +// + +uint32_t EmuX86_Read(xbaddr addr, int size) +{ + if ((addr & (size - 1)) != 0) { + EmuLog(LOG_LEVEL::WARNING, "EmuX86_Read(0x%08X, %d) [Unaligned unimplemented]", addr, size); + // LOG_UNIMPLEMENTED(); + return 0; + } + + uint32_t value; + + if (addr >= XBOX_FLASH_ROM_BASE) { // 0xFFF00000 - 0xFFFFFFF + value = EmuFlash_Read32(addr - XBOX_FLASH_ROM_BASE); // TODO : Make flash access size-aware + } else if(addr == 0xFE80200C) { + // TODO: Remove this once we have an LLE APU Device + return GetAPUTime(); + } else { + // Pass the Read to the PCI Bus, this will handle devices with BARs set to MMIO addresses + if (g_PCIBus->MMIORead(addr, &value, size)) { + return value; + } + + //pass the memory-access through to normal memory : + value = EmuX86_Mem_Read(addr, size); + + EmuLog(LOG_LEVEL::DEBUG, "Read(0x%08X, %d) = 0x%08X", addr, size, value); + } + + return value; +} + +void EmuX86_Write(xbaddr addr, uint32_t value, int size) +{ + if ((addr & (size - 1)) != 0) { + EmuLog(LOG_LEVEL::WARNING, "EmuX86_Write(0x%08X, 0x%08X, %d) [Unaligned unimplemented]", addr, value, size); + // LOG_UNIMPLEMENTED(); + return; + } + + if (addr >= XBOX_FLASH_ROM_BASE) { // 0xFFF00000 - 0xFFFFFFF + EmuLog(LOG_LEVEL::WARNING, "EmuX86_Write(0x%08X, 0x%08X) [FLASH_ROM]", addr, value); + return; + } + + // Pass the Write to the PCI Bus, this will handle devices with BARs set to MMIO addresses + if (g_PCIBus->MMIOWrite(addr, value, size)) { + return; + } + + // Pass the memory-access through to normal memory : + EmuLog(LOG_LEVEL::DEBUG, "Write(0x%.8X, 0x%.8X, %d)", addr, value, size); + EmuX86_Mem_Write(addr, value, size); +} + +int ContextRecordOffsetByRegisterType[/*_RegisterType*/R_DR7 + 1] = { 0 }; + +// Populate ContextRecordOffsetByRegisterType for each distorm::_RegisterType +// supported by the XBox1's Coppermine Pentium III. +// Based on https://maximumcrack.wordpress.com/2011/08/07/fpu-mmx-xmm-and-bbq/ +void EmuX86_InitContextRecordOffsetByRegisterType() +{ + // Unsupported by XBox CPU : R_RAX, R_RCX, R_RDX, R_RBX, R_RSP, R_RBP, R_RSI, R_RDI, R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, + ContextRecordOffsetByRegisterType[R_EAX] = offsetof(CONTEXT, Eax); + ContextRecordOffsetByRegisterType[R_ECX] = offsetof(CONTEXT, Ecx); + ContextRecordOffsetByRegisterType[R_EDX] = offsetof(CONTEXT, Edx); + ContextRecordOffsetByRegisterType[R_EBX] = offsetof(CONTEXT, Ebx); + ContextRecordOffsetByRegisterType[R_ESP] = offsetof(CONTEXT, Esp); + ContextRecordOffsetByRegisterType[R_EBP] = offsetof(CONTEXT, Ebp); + ContextRecordOffsetByRegisterType[R_ESI] = offsetof(CONTEXT, Esi); + ContextRecordOffsetByRegisterType[R_EDI] = offsetof(CONTEXT, Edi); + // Unsupported by XBox CPU : R_R8D, R_R9D, R_R10D, R_R11D, R_R12D, R_R13D, R_R14D, R_R15D, + ContextRecordOffsetByRegisterType[R_AX] = offsetof(CONTEXT, Eax); + ContextRecordOffsetByRegisterType[R_CX] = offsetof(CONTEXT, Ecx); + ContextRecordOffsetByRegisterType[R_DX] = offsetof(CONTEXT, Edx); + ContextRecordOffsetByRegisterType[R_BX] = offsetof(CONTEXT, Ebx); + ContextRecordOffsetByRegisterType[R_SP] = offsetof(CONTEXT, Esp); // ?? + ContextRecordOffsetByRegisterType[R_BP] = offsetof(CONTEXT, Ebp); // ?? + ContextRecordOffsetByRegisterType[R_SI] = offsetof(CONTEXT, Esi); // ?? + ContextRecordOffsetByRegisterType[R_DI] = offsetof(CONTEXT, Edi); // ?? + // Unsupported by XBox CPU : R_R8W, R_R9W, R_R10W, R_R11W, R_R12W, R_R13W, R_R14W, R_R15W, + ContextRecordOffsetByRegisterType[R_AL] = offsetof(CONTEXT, Eax); + ContextRecordOffsetByRegisterType[R_CL] = offsetof(CONTEXT, Ecx); + ContextRecordOffsetByRegisterType[R_DL] = offsetof(CONTEXT, Edx); + ContextRecordOffsetByRegisterType[R_BL] = offsetof(CONTEXT, Ebx); + ContextRecordOffsetByRegisterType[R_AH] = offsetof(CONTEXT, Eax) + 1; + ContextRecordOffsetByRegisterType[R_CH] = offsetof(CONTEXT, Ecx) + 1; + ContextRecordOffsetByRegisterType[R_DH] = offsetof(CONTEXT, Edx) + 1; + ContextRecordOffsetByRegisterType[R_BH] = offsetof(CONTEXT, Ebx) + 1; + // Unsupported by XBox CPU : R_R8B, R_R9B, R_R10B, R_R11B, R_R12B, R_R13B, R_R14B, R_R15B, + ContextRecordOffsetByRegisterType[R_SPL] = offsetof(CONTEXT, Esp); // ?? + ContextRecordOffsetByRegisterType[R_BPL] = offsetof(CONTEXT, Ebp); // ?? + ContextRecordOffsetByRegisterType[R_SIL] = offsetof(CONTEXT, Esi); // ?? + ContextRecordOffsetByRegisterType[R_DIL] = offsetof(CONTEXT, Edi); // ?? + ContextRecordOffsetByRegisterType[R_ES] = offsetof(CONTEXT, SegEs); + ContextRecordOffsetByRegisterType[R_CS] = offsetof(CONTEXT, SegCs); + ContextRecordOffsetByRegisterType[R_SS] = offsetof(CONTEXT, SegSs); + ContextRecordOffsetByRegisterType[R_DS] = offsetof(CONTEXT, SegDs); + ContextRecordOffsetByRegisterType[R_FS] = offsetof(CONTEXT, SegFs); + ContextRecordOffsetByRegisterType[R_GS] = offsetof(CONTEXT, SegGs); + // R_RIP, TODO : Does this also mean EIP and is that enum missing in distorm? https://github.com/gdabah/distorm/issues/110 + // Unsupported by XBox CPU : R_ST0, R_ST1, R_ST2, R_ST3, R_ST4, R_ST5, R_ST6, R_ST7, + ContextRecordOffsetByRegisterType[R_MM0] = offsetof(CONTEXT, ExtendedRegisters[(10 + 0) * 16]); + ContextRecordOffsetByRegisterType[R_MM1] = offsetof(CONTEXT, ExtendedRegisters[(10 + 1) * 16]); + ContextRecordOffsetByRegisterType[R_MM2] = offsetof(CONTEXT, ExtendedRegisters[(10 + 2) * 16]); + ContextRecordOffsetByRegisterType[R_MM3] = offsetof(CONTEXT, ExtendedRegisters[(10 + 3) * 16]); + ContextRecordOffsetByRegisterType[R_MM4] = offsetof(CONTEXT, ExtendedRegisters[(10 + 4) * 16]); + ContextRecordOffsetByRegisterType[R_MM5] = offsetof(CONTEXT, ExtendedRegisters[(10 + 5) * 16]); + ContextRecordOffsetByRegisterType[R_MM6] = offsetof(CONTEXT, ExtendedRegisters[(10 + 6) * 16]); + ContextRecordOffsetByRegisterType[R_MM7] = offsetof(CONTEXT, ExtendedRegisters[(10 + 7) * 16]); + // Unsupported by XBox CPU : R_XMM0, R_XMM1, R_XMM2, R_XMM3, R_XMM4, R_XMM5, R_XMM6, R_XMM7, R_XMM8, R_XMM9, R_XMM10, R_XMM11, R_XMM12, R_XMM13, R_XMM14, R_XMM15, + // Unsupported by XBox CPU : R_YMM0, R_YMM1, R_YMM2, R_YMM3, R_YMM4, R_YMM5, R_YMM6, R_YMM7, R_YMM8, R_YMM9, R_YMM10, R_YMM11, R_YMM12, R_YMM13, R_YMM14, R_YMM15, + // Unsupported by XBox CPU : R_UNUSED0, R_CR0, R_CR2, R_CR3, R_CR4, R_UNUSED1, R_UNUSED2, R_UNUSED3, R_CR8, + ContextRecordOffsetByRegisterType[R_DR0] = offsetof(CONTEXT, Dr0); + ContextRecordOffsetByRegisterType[R_DR1] = offsetof(CONTEXT, Dr1); + ContextRecordOffsetByRegisterType[R_DR2] = offsetof(CONTEXT, Dr2); + ContextRecordOffsetByRegisterType[R_DR3] = offsetof(CONTEXT, Dr3); + // Unsupported by XBox CPU : R_UNUSED4, R_UNUSED5, + ContextRecordOffsetByRegisterType[R_DR6] = offsetof(CONTEXT, Dr6); + ContextRecordOffsetByRegisterType[R_DR7] = offsetof(CONTEXT, Dr7); + + /* struct CONTEXT { // ! markers below, are used in the above offsetof calls + DWORD ContextFlags; + !DWORD Dr0; + !DWORD Dr1; + !DWORD Dr2; + !DWORD Dr3; + !DWORD Dr6; + !DWORD Dr7; + struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; + DWORD Spare0; + } FLOATING_SAVE_AREA FloatSave; + !DWORD SegGs; + !DWORD SegFs; + !DWORD SegEs; + !DWORD SegDs; + !DWORD Edi; + !DWORD Esi; + !DWORD Ebx; + !DWORD Edx; + !DWORD Ecx; + !DWORD Eax; + !DWORD Ebp; + DWORD Eip; + !DWORD SegCs; // MUST BE SANITIZED + DWORD EFlags; // MUST BE SANITIZED + !DWORD Esp; + !DWORD SegSs; + !BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];*/ +} + +std::map g_MemoryBackedRegisters; + +void EmuX86_InitMemoryBackedRegisters() +{ + g_MemoryBackedRegisters[R_CR0] = 0; + g_MemoryBackedRegisters[R_CR2] = 0; + g_MemoryBackedRegisters[R_CR3] = 0; + g_MemoryBackedRegisters[R_CR4] = 0; +} + +inline void * EmuX86_GetRegisterPointer(const LPEXCEPTION_POINTERS e, const uint8_t reg) +{ + int offset = ContextRecordOffsetByRegisterType[reg]; + if (offset > 0) { + return (void*)((uintptr_t)(e->ContextRecord) + offset); + } + + // Xbox titles use some registers thatare not accessible in user mode + // They are also not available in the Context/Exception Record, so we can't map them + // Instead, we store the values in a key->value map. + auto it = g_MemoryBackedRegisters.find(reg); + if (it != g_MemoryBackedRegisters.end()) { + return &it->second; + } + + assert(false); + return nullptr; +} + +int EmuX86_DistormRegSize(const uint8_t reg) +{ + switch (reg) { + case R_RAX: return 8; case R_RCX: return 8; case R_RDX: return 8; case R_RBX: return 8; case R_RSP: return 8; case R_RBP: return 8; case R_RSI: return 8; case R_RDI: return 8; case R_R8: return 8; case R_R9: return 8; case R_R10: return 8; case R_R11: return 8; case R_R12: return 8; case R_R13: return 8; case R_R14: return 8; case R_R15: return 8; + case R_EAX: return 4; case R_ECX: return 4; case R_EDX: return 4; case R_EBX: return 4; case R_ESP: return 4; case R_EBP: return 4; case R_ESI: return 4; case R_EDI: return 4; case R_R8D: return 4; case R_R9D: return 4; case R_R10D: return 4; case R_R11D: return 4; case R_R12D: return 4; case R_R13D: return 4; case R_R14D: return 4; case R_R15D: return 4; + case R_AX: return 2; case R_CX: return 2; case R_DX: return 2; case R_BX: return 2; case R_SP: return 2; case R_BP: return 2; case R_SI: return 2; case R_DI: return 2; case R_R8W: return 2; case R_R9W: return 2; case R_R10W: return 2; case R_R11W: return 2; case R_R12W: return 2; case R_R13W: return 2; case R_R14W: return 2; case R_R15W: return 2; + case R_AL: return 1; case R_CL: return 1; case R_DL: return 1; case R_BL: return 1; case R_AH: return 1; case R_CH: return 1; case R_DH: return 1; case R_BH: return 1; case R_R8B: return 1; case R_R9B: return 1; case R_R10B: return 1; case R_R11B: return 1; case R_R12B: return 1; case R_R13B: return 1; case R_R14B: return 1; case R_R15B: return 1; + case R_SPL: return 1; case R_BPL: return 1; case R_SIL: return 1; case R_DIL: return 1; + case R_ES: return 2; case R_CS: return 2; case R_SS: return 2; case R_DS: return 2; case R_FS: return 2; case R_GS: return 2; + case R_RIP: return 8; + case R_ST0: return 10; case R_ST1: return 10; case R_ST2: return 10; case R_ST3: return 10; case R_ST4: return 10; case R_ST5: return 10; case R_ST6: return 10; case R_ST7: return 10; + case R_MM0: return 10; case R_MM1: return 10; case R_MM2: return 10; case R_MM3: return 10; case R_MM4: return 10; case R_MM5: return 10; case R_MM6: return 10; case R_MM7: return 10; + case R_XMM0: return 16; case R_XMM1: return 16; case R_XMM2: return 16; case R_XMM3: return 16; case R_XMM4: return 16; case R_XMM5: return 16; case R_XMM6: return 16; case R_XMM7: return 16; case R_XMM8: return 16; case R_XMM9: return 16; case R_XMM10: return 16; case R_XMM11: return 16; case R_XMM12: return 16; case R_XMM13: return 16; case R_XMM14: return 16; case R_XMM15: return 16; + case R_YMM0: return 16; case R_YMM1: return 16; case R_YMM2: return 16; case R_YMM3: return 16; case R_YMM4: return 16; case R_YMM5: return 16; case R_YMM6: return 16; case R_YMM7: return 16; case R_YMM8: return 16; case R_YMM9: return 16; case R_YMM10: return 16; case R_YMM11: return 16; case R_YMM12: return 16; case R_YMM13: return 16; case R_YMM14: return 16; case R_YMM15: return 16; + case R_CR0: return 4; case R_UNUSED0: return 0; case R_CR2: return 4; case R_CR3: return 4; case R_CR4: return 4; case R_UNUSED1: return 0; case R_UNUSED2: return 0; case R_UNUSED3: return 0; case R_CR8: return 4; + case R_DR0: return 4; case R_DR1: return 4; case R_DR2: return 4; case R_DR3: return 4; case R_UNUSED4: return 0; case R_UNUSED5: return 0; case R_DR6: return 4; case R_DR7: return 4; + default: assert(false); return 0; + } +} + +inline uint32_t EmuX86_GetRegisterValue32(const LPEXCEPTION_POINTERS e, const uint8_t reg) +{ + if (reg != R_NONE) { + assert(EmuX86_DistormRegSize(reg) == sizeof(uint32_t)); + + void* regptr = EmuX86_GetRegisterPointer(e, reg); + if (regptr != nullptr) + return *(uint32_t *)regptr; + + assert(false); + } + + return 0; +} + +uint32_t EmuX86_Distorm_read_disp(const _DInst& info) +{ +#ifdef _DEBUG + // Assert disp is set according to expectations : + switch (info.dispSize) { + case 0: + assert(info.disp == 0); // Assume dispSize==0 implies disp==0 + break; + case 8: + if (info.disp & 0x80) { + assert((info.disp & 0xFFFFFF80) == 0xFFFFFF80); // Assume 8 bit disp is sign-extended to 32 bit + } + else { + assert(info.disp < 0x80); // Assume positive signed 8 bit never reaches 0x80 + } + break; + case 16: + if (info.disp & 0x8000) { + assert((info.disp & 0xFFFF8000) == 0xFFFF8000); // Assume 16 bit disp is sign-extended to 32 bit + } + else { + assert(info.disp < 0x8000); // Assume positive signed 16 bit never reaches 0x8000 + } + break; + case 32: + break; // No checks for 32 bit + default: + assert(false); // Assume dispSize is either 0, 8, 16 or 32 + break; + } +#endif + return (uint32_t)info.disp; +} + +typedef struct { + xbaddr addr = 0; + bool is_internal_addr = false; // If set, addr points to a CPU context (or Distorm immedate value) member (instead of Xbox memory) + int size = 0; // Expressed in bytes, not bits! +} OperandAddress; + +bool EmuX86_Operand_Addr_ForReadOnly(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OperandAddress &opAddr) +{ + opAddr.size = info.ops[operand].size / 8; // Convert size in bits into bytes + switch (info.ops[operand].type) { + case O_NONE: // operand is to be ignored. + { + assert(opAddr.size == 0); + + // Ignore O_NONE operand + return false; + } + case O_REG: // index holds global register index. + { + assert(opAddr.size == EmuX86_DistormRegSize(info.ops[operand].index)); + + opAddr.is_internal_addr = true; + opAddr.addr = (xbaddr)EmuX86_GetRegisterPointer(e, info.ops[operand].index); + return true; + } + case O_IMM: // instruction.imm. + { + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); + + opAddr.is_internal_addr = true; + opAddr.addr = (xbaddr)(&info.imm); + return true; + } + case O_IMM1: // instruction.imm.ex.i1. + { + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); + + opAddr.is_internal_addr = true; + opAddr.addr = (xbaddr)(&info.imm.ex.i1); + return true; + } + case O_IMM2: // instruction.imm.ex.i2. + { + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); + + opAddr.is_internal_addr = true; + opAddr.addr = (xbaddr)(&info.imm.ex.i2); + return true; + } + case O_DISP: // memory dereference with displacement only, instruction.disp. + { + // Disabled as software is expected to hit this situaton, eg: + // TEST byte ptr DS:[FEF00098h],1 + //assert(opAddr.size == sizeof(uint32_t)); + + opAddr.is_internal_addr = false; + opAddr.addr = EmuX86_Distorm_read_disp(info); + return true; + } + case O_SMEM: // simple memory dereference with optional displacement(a single register memory dereference). + { + assert(opAddr.size == 0 || opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); // TODO : How to handle size == 0 further on? + + opAddr.is_internal_addr = false; + opAddr.addr = EmuX86_GetRegisterValue32(e, info.ops[operand].index) + + EmuX86_Distorm_read_disp(info); + return true; + } + case O_MEM: // complex memory dereference(optional fields : s / i / b / disp). + { + assert(opAddr.size == 0 || opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); // TODO : How to handle size == 0 further on? + assert(info.scale < 3 || info.scale == 4 || info.scale == 8); // Assume scale is either 0, 1, 2, 4 or 8 + + uint32_t index = EmuX86_GetRegisterValue32(e, info.ops[operand].index); + if (info.scale >= 2) + index *= info.scale; + + opAddr.is_internal_addr = false; + opAddr.addr = EmuX86_GetRegisterValue32(e, info.base) // Note : Returns 0 when base == R_NONE + + index + + EmuX86_Distorm_read_disp(info); + + return true; + } + case O_PC: // the relative address of a branch instruction(instruction.imm.addr). + { + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint32_t)); + + opAddr.is_internal_addr = false; + opAddr.addr = (xbaddr)e->ContextRecord->Eip + (xbaddr)INSTRUCTION_GET_TARGET(&info); + return true; + } + case O_PTR: // the absolute target address of a far branch instruction(instruction.imm.ptr.seg / off). + { + assert(opAddr.size == 0); + + opAddr.is_internal_addr = false; + opAddr.addr = (xbaddr)info.imm.ptr.off; // TODO : Needs test-case. What about info.imm.ptr.seg ? + return true; + } + default: + // UNREACHABLE(info.ops[operand].type); + assert(false); + return false; + } + + assert(false); + return false; +} + +bool EmuX86_Operand_Addr_ForReadWrite(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OperandAddress &opAddr) +{ + // Disallow write-access to immediate value adresses + switch (info.ops[operand].type) { + case O_IMM: + case O_IMM1: + case O_IMM2: + EmuLog(LOG_LEVEL::WARNING, "Refused operand write-access to immedate value address!"); + assert(false); + return false; + } + + // Except for the above restriction, writes may access the same operand addresses as reads : + return EmuX86_Operand_Addr_ForReadOnly(e, info, operand, OUT opAddr); +} + +uint32_t EmuX86_Addr_Read(const OperandAddress &opAddr) +{ + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); + + if (opAddr.is_internal_addr) { + return EmuX86_Mem_Read(opAddr.addr, opAddr.size); + } + else { + return EmuX86_Read(opAddr.addr, opAddr.size); + } +} + +void EmuX86_Addr_Write(const OperandAddress &opAddr, const uint32_t value) +{ + assert(opAddr.size == sizeof(uint8_t) || opAddr.size == sizeof(uint16_t) || opAddr.size == sizeof(uint32_t)); + + if (opAddr.is_internal_addr) { + EmuX86_Mem_Write(opAddr.addr, value, opAddr.size); + } + else { + EmuX86_Write(opAddr.addr, value, opAddr.size); + } +} + +bool EmuX86_Operand_Read(const LPEXCEPTION_POINTERS e, const _DInst& info, const int operand, OUT uint32_t *value) +{ + OperandAddress opAddr; + if (EmuX86_Operand_Addr_ForReadOnly(e, info, operand, OUT opAddr)) { + *value = EmuX86_Addr_Read(opAddr); + return true; + } + + return false; +} + +bool EmuX86_Operand_Write(LPEXCEPTION_POINTERS e, _DInst& info, int operand, uint32_t value) +{ + OperandAddress opAddr; + if (EmuX86_Operand_Addr_ForReadWrite(e, info, operand, OUT opAddr)) { + EmuX86_Addr_Write(opAddr, value); + return true; + } + + return false; +} + +inline void EmuX86_SetFlags(LPEXCEPTION_POINTERS e, DWORD mask, DWORD value) +{ + // By Ron Jeffery, see https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge + e->ContextRecord->EFlags ^= ((e->ContextRecord->EFlags ^ value) & mask); +} + +#define BIT(flag, bit) ((static_cast((bool)bit)) << (flag)) +#define BITMASK(flag) BIT(flag, 1) + +// TODO : Verify callers compile bool arguments into bit-operations; +// If not, change these arguments back to unsigned int's and use only +// the least significant bit. +inline void EmuX86_SetFlags_OSZAPC +( + LPEXCEPTION_POINTERS e, + const bool OF, + const bool SF, + const bool ZF, + const bool AF, + const bool PF, + const bool CF +) +{ + EmuX86_SetFlags(e, + BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_AF) | BITMASK(EMUX86_EFLAG_PF) | BITMASK(EMUX86_EFLAG_CF), + BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_AF, AF) | BIT(EMUX86_EFLAG_PF, PF) | BIT(EMUX86_EFLAG_CF, CF) + ); +} + +inline void EmuX86_SetFlags_OSZPC +( + LPEXCEPTION_POINTERS e, + const bool OF, + const bool SF, + const bool ZF, + const bool PF, + const bool CF +) +{ + EmuX86_SetFlags(e, + BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_PF) | BITMASK(EMUX86_EFLAG_CF), + BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_PF, PF) | BIT(EMUX86_EFLAG_CF, CF) + ); +} + +inline void EmuX86_SetFlags_OSZAP +( + LPEXCEPTION_POINTERS e, + const bool OF, + const bool SF, + const bool ZF, + const bool AF, + const bool PF +) +{ + EmuX86_SetFlags(e, + BITMASK(EMUX86_EFLAG_OF) | BITMASK(EMUX86_EFLAG_SF) | BITMASK(EMUX86_EFLAG_ZF) | BITMASK(EMUX86_EFLAG_AF) | BITMASK(EMUX86_EFLAG_PF), + BIT(EMUX86_EFLAG_OF, OF) | BIT(EMUX86_EFLAG_SF, SF) | BIT(EMUX86_EFLAG_ZF, ZF) | BIT(EMUX86_EFLAG_AF, AF) | BIT(EMUX86_EFLAG_PF, PF) + ); +} + +inline bool EmuX86_HasFlag(LPEXCEPTION_POINTERS e, DWORD flag) +{ + return (e->ContextRecord->EFlags & flag); +} + +inline bool EmuX86_HasFlag_AF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_AF)); +} + +inline bool EmuX86_HasFlag_CF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_CF)); +} + +inline bool EmuX86_HasFlag_OF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_OF)); +} + +inline bool EmuX86_HasFlag_PF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_PF)); +} + +inline bool EmuX86_HasFlag_SF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_SF)); +} + +inline bool EmuX86_HasFlag_ZF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_ZF)); +} + +inline bool EmuX86_HasFlag_DF(LPEXCEPTION_POINTERS e) +{ + return EmuX86_HasFlag(e, BITMASK(EMUX86_EFLAG_DF)); +} + +// EFLAGS Cross-Reference : http://datasheets.chipdb.org/Intel/x86/Intel%20Architecture/EFLAGS.PDF + +// TODO : Review these CPU flag calculations, maybe peek at how MAME or Bochs does this. +// see : https://github.com/mamedev/mame/blob/master/src/devices/cpu/i386/i386priv.h#L301 + +#define BitSize (info.ops[0].size) // Note : Uses 'info' argument of functions using this macro +// TODO : Use templates for these, so 8, 16 and 32 bit versions will compile into efficient bit manipulations +#define OF_Add(r,s,d) (((r ^ s) & (r ^ d)) >> (BitSize-1)) & 1 // Result, Src, Dest +#define OF_Sub(r,s,d) (((d ^ s) & (r ^ d)) >> (BitSize-1)) & 1 // Result, Src, Dest +#define SFCalc(result) (result >> (BitSize-1)) & 1 +#define ZFCalc(result) (result == 0) +#define AFCalc(r,s,d) ((r ^ s ^ d) >> 3) & 1 // Result, Src, Dest +#define PFCalc(result) (0x6996 >> ((result ^ (result >> 4)) & 0xF)) & 1 // See https://graphics.stanford.edu/~seander/bithacks.html#ParityParallel +#define CFCalc(result) (result >> BitSize) & 1 // TODO : Instead of looking at an actual overflow bit, use high bit of (result XOR dest XOR src) +// Flags calculated : Overflow (for addition or subtraction), Sign, Zero, Adjust, Parity and Carry + +// See https://x86.renejeschke.de/ for affected CPU flags per instruction + +void SignExtend32(uint32_t& dest, size_t from) +{ + int32_t signExtended = 0; + switch (from) { + case 8: + signExtended = (int8_t)dest; + break; + case 16: + signExtended = (int16_t)dest; + break; + default: + assert(false); + break; + } + +#if 0 + if ((uint32_t)signExtended != dest) { + DebugBreak(); + } +#endif + + dest = (uint32_t)signExtended; +} + +// Keep opcode emulations alphabetically ordered : + +bool EmuX86_Opcode_ADD(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // ADD reads value from source : + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // ADD reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + add eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + return true; +} + +bool EmuX86_Opcode_AND(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // AND reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + and eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + return true; +} + +void EmuX86_Opcode_CDQ(LPEXCEPTION_POINTERS e, _DInst& info) +{ + e->ContextRecord->Edx = (e->ContextRecord->Eax & 0x80000000) ? 0xFFFFFFFF : 0; +} + +void EmuX86_Opcode_CLI() +{ + g_bEnableAllInterrupts = false; +} + +bool EmuX86_Opcode_CMP(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + uint32_t dest = 0; + if (!EmuX86_Operand_Read(e, info, 0, &dest)) + return false; + + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + cmp eax, src // perform the operation, this updates eflags for us! + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + return true; +} + +bool EmuX86_Opcode_CMPXCHG(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + uint32_t dest = 0; + if (!EmuX86_Operand_Read(e, info, 0, &dest)) + return false; + + uint32_t mask; + switch (info.ops[0].size) { + case 8: mask = 0xFF; break; // TODO : Needs test-case + case 16: mask = 0xFFFF; break; // TODO : Needs test-case + case 32: mask = 0xFFFFFFFF; break; + default: assert(false); break; + } + + uint32_t eaxVal = e->ContextRecord->Eax; + if ((eaxVal & mask) == (dest & mask)) { + // Write the source value to the destination operand + if (!EmuX86_Operand_Write(e, info, 0, src)) { + return false; + } + } else { + // Write the destination operand to eax + e->ContextRecord->Eax = (e->ContextRecord->Eax & ~mask) | (dest & mask); + } + + // Perform arithmatic operation for flag calculation + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, eaxVal + cmp eax, dest // perform the operation, this updates eflags for us! + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + return true; +} + +void EmuX86_Opcode_CPUID(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // This CPUID emulation is based on : + // https://github.com/docbrown/vxb/wiki/Xbox-CPUID-Information + // https://github.com/docbrown/vxb/wiki/Xbox-Hardware-Information and + // http://www.sandpile.org/x86/cpuid.htm + switch (e->ContextRecord->Eax) { // simpler than EmuX86_GetRegisterValue32(e, R_EAX) + case 0: { // CPUID Function 0, return the maximum supported standard level and vendor ID string + // Maximum supported standard level + e->ContextRecord->Eax = 2; + // "GenuineIntel" Intel processor + e->ContextRecord->Ebx = (ULONG)'uneG'; + e->ContextRecord->Edx = (ULONG)'Ieni'; + e->ContextRecord->Ecx = (ULONG)'letn'; + return; + } + case 1: { // CPUID Function 1, Return the processor type / family / model / stepping and feature flags + // Family 6, Model 8, Stepping 10 + e->ContextRecord->Eax = 0x68a; + e->ContextRecord->Ebx = 0; + e->ContextRecord->Ecx = 0; + // Feature Flags + e->ContextRecord->Edx = 0x383F9FF; // FPU, VME, DE, PSE, TSC, MSR, PAE, MCE, CX8, SEP, MTRR, PGE, MCA, CMOV, PAT, PSE36, MMX, FXSR, SSE + return; + } + case 2: { // CPUID Function 2, Return the processor configuration descriptors + // AL : 01 = number of times this level must be queried to obtain all configuration descriptors + // EAX nibble 1 = 01h : code TLB, 4K pages, 4 ways, 32 entries + // EAX nibble 2 = 02h : code TLB, 4M pages, fully, 2 entries + // EAX nibble 3 = 03h : data TLB, 4K pages, 4 ways, 64 entries + e->ContextRecord->Eax = 0x3020101; + // EBX and ECX nibbles = 00h : null descriptor (=unused descriptor) + e->ContextRecord->Ebx = 0; + e->ContextRecord->Ecx = 0; + // EDX nibble 0 = 41h : code and data L2 cache, 128 KB, 4 ways, 32 byte lines + // EDX nibble 1 = 08h : code L1 cache, 16 KB, 4 ways, 32 byte lines + // EDX nibble 2 = 04h : data TLB, 4M pages, 4 ways, 8 entries + // EDX nibble 3 = 0Ch : data L1 cache, 16 KB, 4 ways, 32 byte lines + e->ContextRecord->Edx = 0xC040841; + return; + } + } + + // Note : CPUID instructions never update CPU flags +} + +bool EmuX86_Opcode_DEC(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // DEC reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + dec eax // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +bool EmuX86_Opcode_IN(LPEXCEPTION_POINTERS e, _DInst& info) +{ + uint32_t addr; + if (!EmuX86_Operand_Read(e, info, 1, &addr)) + return false; + + // IN does an I/O read on the address, writing the value to the second operand : + uint32_t value = EmuX86_IORead(addr, info.ops[0].size / 8); // Convert size in bits into bytes + + if (!EmuX86_Operand_Write(e, info, 0, value)) { + return false; + } + + // Note : IN instructions never update CPU flags + + return true; +} + +bool EmuX86_Opcode_INC(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // INC reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + inc eax // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +bool EmuX86_Opcode_JMP(LPEXCEPTION_POINTERS e, _DInst& info) +{ + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadOnly(e, info, 0, OUT opAddr)) + assert(false); + + e->ContextRecord->Eip = opAddr.addr; + return true; +} + +// Jump if condition is met +// https://c9x.me/x86/html/file_module_x86_id_146.html +// Returns true if branch was taken +bool EmuX86_Opcode_Jcc(LPEXCEPTION_POINTERS e, _DInst& info, bool condition) +{ + if (condition) + return EmuX86_Opcode_JMP(e, info); + + return false; +} + +bool EmuX86_Opcode_LEA(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // LEA reads effective address from source operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadOnly(e, info, 1, OUT opAddr)) + return false; + + uint32_t value = opAddr.addr; + + // LEA writes value to destination : + if (!EmuX86_Operand_Write(e, info, 0, value)) + return false; + + // Note : LEA instructions never update CPU flags + + return true; +} + +bool EmuX86_Opcode_MOV(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // MOV reads value from source : + uint32_t value = 0; + if (!EmuX86_Operand_Read(e, info, 1, &value)) + return false; + + // MOV writes value to destination : + if (!EmuX86_Operand_Write(e, info, 0, value)) + return false; + + // Note : MOV instructions never update CPU flags + + return true; +} + +bool EmuX86_Opcode_MOVSX(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // MOVSX reads value from source : + uint32_t value = 0; + if (!EmuX86_Operand_Read(e, info, 1, &value)) + return false; + + // Do MOVSX sign-extension + switch (info.ops[1].size) { + case 8: + if (value & 0x80) + value |= 0xFFFFFF00; + break; + case 16: + if (value & 0x8000) + value |= 0xFFFF0000; + break; + } + + // MOVSX writes value to destination : + if (!EmuX86_Operand_Write(e, info, 0, value)) + return false; + + // Note : MOVSX instructions never update CPU flags + + return true; +} + +bool EmuX86_Opcode_MOVZX(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // MOVZX reads value from source : + uint32_t value = 0; + + if (!EmuX86_Operand_Read(e, info, 1, &value)) + return false; + + // MOVZX zero-extension is implemented implicitly + assert(value <= 0xFFFF); // Assume input never exceeds a 16 bit value + + // MOVZX writes value to destination : + if (!EmuX86_Operand_Write(e, info, 0, value)) + return false; + + // Note : MOVZX instructions never update CPU flags + + return true; +} + +bool EmuX86_Opcode_NEG(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // NEG reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + uint32_t src = dest; + + // NEG Destination + uint32_t result = 0-dest; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + // The OF, SF, ZF, AF, CF, and PF flags are set according to the result. + EmuX86_SetFlags_OSZAPC(e, + /*EMUX86_EFLAG_OF*/OF_Sub(result, src, dest), + /*EMUX86_EFLAG_SF*/SFCalc(result), + /*EMUX86_EFLAG_ZF*/ZFCalc(result), + /*EMUX86_EFLAG_AF*/AFCalc(result, src, dest), + /*EMUX86_EFLAG_PF*/PFCalc(result), + /*EMUX86_EFLAG_CF*/(dest != 0)); + + return true; +} + +bool EmuX86_Opcode_NOT(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // NOT reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + not eax // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + // Flags are not effected + + return true; +} + +bool EmuX86_Opcode_OR(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // OR reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + or eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + return true; +} + +bool EmuX86_Opcode_OUT(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // OUT will address the first operand : + uint32_t addr; + if (!EmuX86_Operand_Read(e, info, 0, &addr)) + return false; + + uint32_t value; + if (!EmuX86_Operand_Read(e, info, 1, &value)) + return false; + + // OUT does an I/O write on the address, using the value from the second operand : + EmuX86_IOWrite(addr, value, info.ops[1].size / 8); // Convert size in bits into bytes + + // Note : OUT instructions never update CPU flags + + return true; +} + +// https://c9x.me/x86/html/file_module_x86_id_248.html +bool EmuX86_Opcode_POP(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Recognize POP ESP (which increments BEFORE reading from stack) : + bool bAccessesESP = (info.ops[0].type == O_REG) && (info.ops[0].index == R_ESP); + uint32_t value; + + if (bAccessesESP) { + e->ContextRecord->Esp += sizeof(uint32_t); + value = EmuX86_Mem_Read(e->ContextRecord->Esp, sizeof(uint32_t)); + } + else { + value = EmuX86_Mem_Read(e->ContextRecord->Esp, sizeof(uint32_t)); + e->ContextRecord->Esp += sizeof(uint32_t); + } + + if (!EmuX86_Operand_Write(e, info, 0, value)) + return false; + + return true; +} + +bool EmuX86_Opcode_PUSH(LPEXCEPTION_POINTERS e, _DInst& info) +{ + uint32_t value; + if (!EmuX86_Operand_Read(e, info, 0, &value)) + return false; + + e->ContextRecord->Esp -= sizeof(uint32_t); + EmuX86_Mem_Write(e->ContextRecord->Esp, value, sizeof(uint32_t)); + return true; +} + +ULONGLONG CxbxGetPerformanceCounter(bool acpi); // implemented in EmuKrnlKe.cpp +void EmuX86_Opcode_RDTSC(LPEXCEPTION_POINTERS e) +{ + // We use CxbxGetPerformanceCounter. KeQueryPerformanceCounter is a differnet frequency and cannot be used! + ULARGE_INTEGER PerformanceCount; + PerformanceCount.QuadPart = CxbxGetPerformanceCounter(/*acpi*/false); + e->ContextRecord->Eax = PerformanceCount.LowPart; + e->ContextRecord->Edx = PerformanceCount.HighPart; +} + +bool EmuX86_Opcode_SAR(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // SAR reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + uint8_t byteSrc = src; + + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + mov cl, byteSrc + sar eax, cl // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +bool EmuX86_Opcode_SBB(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // SBB reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + sbb eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +// Set Byte on Condition +// https://c9x.me/x86/html/file_module_x86_id_288.html +inline bool EmuX86_Opcode_SETcc(LPEXCEPTION_POINTERS e, _DInst& info, bool condition) +{ + uint8_t value = (condition) ? 1 : 0; + + return EmuX86_Operand_Write(e, info, 0, value); +} + +bool EmuX86_Opcode_SHL(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // SHL reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + uint8_t byteSrc = src; + + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + mov cl, byteSrc + shl eax, cl // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +bool EmuX86_Opcode_SHR(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // SHR reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + uint8_t byteSrc = src; + + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + mov cl, byteSrc + shr eax, cl // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +void EmuX86_Opcode_STI() +{ + g_bEnableAllInterrupts = true; +} + +bool EmuX86_Opcode_STOS(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read a value from src + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // Write the value to dest + if (!EmuX86_Operand_Write(e, info, 0, src)) { + return false; + } + + // Determine increment/decrement size + uint8_t size = info.ops[1].size / 8; + + // Increment/decrement ESI and EDI based on the current set flags + if (EmuX86_HasFlag_DF(e)) { + e->ContextRecord->Esi -= size; + e->ContextRecord->Edi -= size; + } + else { + e->ContextRecord->Esi += size; + e->ContextRecord->Edi += size; + } + + return true; +} + +bool EmuX86_Opcode_SUB(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // SUB reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + sub eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write result back + EmuX86_Addr_Write(opAddr, static_cast(result)); + + return true; +} + +bool EmuX86_Opcode_TEST(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // TEST reads first value : + uint32_t dest = 0; + if (!EmuX86_Operand_Read(e, info, 0, &dest)) + return false; + + // TEST reads second value : + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + test eax, src // perform the operation, this updates eflags for us! + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + return true; +} + +bool EmuX86_Opcode_XOR(LPEXCEPTION_POINTERS e, _DInst& info) +{ + // Read value from Source and Destination + uint32_t src = 0; + if (!EmuX86_Operand_Read(e, info, 1, &src)) + return false; + + // XOR reads and writes the same operand : + OperandAddress opAddr; + if (!EmuX86_Operand_Addr_ForReadWrite(e, info, 0, OUT opAddr)) + return false; + + uint32_t dest = EmuX86_Addr_Read(opAddr); + + if (info.ops[0].size > info.ops[1].size) { + SignExtend32(src, info.ops[1].size); + } + + uint32_t result = 0; + uint32_t eflags = e->ContextRecord->EFlags; + __asm { + push eflags // push context eflags on the stack + popfd // pop context eflags into host eflags + mov eax, dest + xor eax, src // perform the operation, this updates eflags for us! + mov result, eax + pushfd // push the updated host flags onto the stack + pop eflags // pop the updated host flags back into our eflags register + } + + // Write back the flags + e->ContextRecord->EFlags = eflags; + + // Write back the result + EmuX86_Addr_Write(opAddr, result); + + + return true; +} + +bool EmuX86_DecodeOpcode(const uint8_t *Eip, _DInst &info) +{ + unsigned int decodedInstructionsCount = 0; + + _CodeInfo ci; + ci.code = (uint8_t*)Eip; + ci.codeLen = 20; + ci.codeOffset = 0; + ci.dt = (_DecodeType)Decode32Bits; + ci.features = DF_NONE; + + // Checking for DECRES_SUCCESS won't work, since we're passing distorm_decompose + // a codeLen big enough to decode any instruction-length, plus distorm doesn't + // halt cleanly after reaching maxInstructions 1. So instead, just call distorm : + distorm_decompose(&ci, &info, /*maxInstructions=*/1, &decodedInstructionsCount); + // and check if it successfully decoded one instruction : + return (decodedInstructionsCount == 1); +} + +const char *Distorm_RegStrings[/*_RegisterType*/] = { + "RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", + "EAX", "ECX", "EDX", "EBX", "ESP", "EBP", "ESI", "EDI", "R8D", "R9D", "R10D", "R11D", "R12D", "R13D", "R14D", "R15D", + "AX", "CX", "DX", "BX", "SP", "BP", "SI", "DI", "R8W", "R9W", "R10W", "R11W", "R12W", "R13W", "R14W", "R15W", + "AL", "CL", "DL", "BL", "AH", "CH", "DH", "BH", "R8B", "R9B", "R10B", "R11B", "R12B", "R13B", "R14B", "R15B", + "SPL", "BPL", "SIL", "DIL", + "ES", "CS", "SS", "DS", "FS", "GS", + "RIP", + "ST0", "ST1", "ST2", "ST3", "ST4", "ST5", "ST6", "ST7", + "MM0", "MM1", "MM2", "MM3", "MM4", "MM5", "MM6", "MM7", + "XMM0", "XMM1", "XMM2", "XMM3", "XMM4", "XMM5", "XMM6", "XMM7", "XMM8", "XMM9", "XMM10", "XMM11", "XMM12", "XMM13", "XMM14", "XMM15", + "YMM0", "YMM1", "YMM2", "YMM3", "YMM4", "YMM5", "YMM6", "YMM7", "YMM8", "YMM9", "YMM10", "YMM11", "YMM12", "YMM13", "YMM14", "YMM15", + "CR0", "UNUSED0", "CR2", "CR3", "CR4", "UNUSED1", "UNUSED2", "UNUSED3", "CR8", + "DR0", "DR1", "DR2", "DR3", "UNUSED4", "UNUSED5", "DR6", "DR7", +}; + +char *Distorm_OpcodeString(const int opcode) +{ + // Note : Distorm's GET_MNEMONIC_NAME() doesn't link somehow... + switch (opcode) { + case I_AAA: return "AAA"; + case I_AAD: return "AAD"; + case I_AAM: return "AAM"; + case I_AAS: return "AAS"; + case I_ADC: return "ADC"; + case I_ADD: return "ADD"; + case I_ADDPD: return "ADDPD"; + case I_ADDPS: return "ADDPS"; + case I_ADDSD: return "ADDSD"; + case I_ADDSS: return "ADDSS"; + case I_ADDSUBPD: return "ADDSUBPD"; + case I_ADDSUBPS: return "ADDSUBPS"; + case I_AESDEC: return "AESDEC"; + case I_AESDECLAST: return "AESDECLAST"; + case I_AESENC: return "AESENC"; + case I_AESENCLAST: return "AESENCLAST"; + case I_AESIMC: return "AESIMC"; + case I_AESKEYGENASSIST: return "AESKEYGENASSIST"; + case I_AND: return "AND"; + case I_ANDNPD: return "ANDNPD"; + case I_ANDNPS: return "ANDNPS"; + case I_ANDPD: return "ANDPD"; + case I_ANDPS: return "ANDPS"; + case I_ARPL: return "ARPL"; + case I_BLENDPD: return "BLENDPD"; + case I_BLENDPS: return "BLENDPS"; + case I_BLENDVPD: return "BLENDVPD"; + case I_BLENDVPS: return "BLENDVPS"; + case I_BOUND: return "BOUND"; + case I_BSF: return "BSF"; + case I_BSR: return "BSR"; + case I_BSWAP: return "BSWAP"; + case I_BT: return "BT"; + case I_BTC: return "BTC"; + case I_BTR: return "BTR"; + case I_BTS: return "BTS"; + case I_CALL: return "CALL"; + case I_CALL_FAR: return "CALL_FAR"; + case I_CBW: return "CBW"; + case I_CDQ: return "CDQ"; + case I_CDQE: return "CDQE"; + case I_CLC: return "CLC"; + case I_CLD: return "CLD"; + case I_CLFLUSH: return "CLFLUSH"; + case I_CLGI: return "CLGI"; + case I_CLI: return "CLI"; + case I_CLTS: return "CLTS"; + case I_CMC: return "CMC"; + case I_CMOVA: return "CMOVA"; + case I_CMOVAE: return "CMOVAE"; + case I_CMOVB: return "CMOVB"; + case I_CMOVBE: return "CMOVBE"; + case I_CMOVG: return "CMOVG"; + case I_CMOVGE: return "CMOVGE"; + case I_CMOVL: return "CMOVL"; + case I_CMOVLE: return "CMOVLE"; + case I_CMOVNO: return "CMOVNO"; + case I_CMOVNP: return "CMOVNP"; + case I_CMOVNS: return "CMOVNS"; + case I_CMOVNZ: return "CMOVNZ"; + case I_CMOVO: return "CMOVO"; + case I_CMOVP: return "CMOVP"; + case I_CMOVS: return "CMOVS"; + case I_CMOVZ: return "CMOVZ"; + case I_CMP: return "CMP"; + case I_CMPEQPD: return "CMPEQPD"; + case I_CMPEQPS: return "CMPEQPS"; + case I_CMPEQSD: return "CMPEQSD"; + case I_CMPEQSS: return "CMPEQSS"; + case I_CMPLEPD: return "CMPLEPD"; + case I_CMPLEPS: return "CMPLEPS"; + case I_CMPLESD: return "CMPLESD"; + case I_CMPLESS: return "CMPLESS"; + case I_CMPLTPD: return "CMPLTPD"; + case I_CMPLTPS: return "CMPLTPS"; + case I_CMPLTSD: return "CMPLTSD"; + case I_CMPLTSS: return "CMPLTSS"; + case I_CMPNEQPD: return "CMPNEQPD"; + case I_CMPNEQPS: return "CMPNEQPS"; + case I_CMPNEQSD: return "CMPNEQSD"; + case I_CMPNEQSS: return "CMPNEQSS"; + case I_CMPNLEPD: return "CMPNLEPD"; + case I_CMPNLEPS: return "CMPNLEPS"; + case I_CMPNLESD: return "CMPNLESD"; + case I_CMPNLESS: return "CMPNLESS"; + case I_CMPNLTPD: return "CMPNLTPD"; + case I_CMPNLTPS: return "CMPNLTPS"; + case I_CMPNLTSD: return "CMPNLTSD"; + case I_CMPNLTSS: return "CMPNLTSS"; + case I_CMPORDPD: return "CMPORDPD"; + case I_CMPORDPS: return "CMPORDPS"; + case I_CMPORDSD: return "CMPORDSD"; + case I_CMPORDSS: return "CMPORDSS"; + case I_CMPS: return "CMPS"; + case I_CMPUNORDPD: return "CMPUNORDPD"; + case I_CMPUNORDPS: return "CMPUNORDPS"; + case I_CMPUNORDSD: return "CMPUNORDSD"; + case I_CMPUNORDSS: return "CMPUNORDSS"; + case I_CMPXCHG: return "CMPXCHG"; + case I_CMPXCHG16B: return "CMPXCHG16B"; + case I_CMPXCHG8B: return "CMPXCHG8B"; + case I_COMISD: return "COMISD"; + case I_COMISS: return "COMISS"; + case I_CPUID: return "CPUID"; + case I_CQO: return "CQO"; + case I_CRC32: return "CRC32"; + case I_CVTDQ2PD: return "CVTDQ2PD"; + case I_CVTDQ2PS: return "CVTDQ2PS"; + case I_CVTPD2DQ: return "CVTPD2DQ"; + case I_CVTPD2PI: return "CVTPD2PI"; + case I_CVTPD2PS: return "CVTPD2PS"; + case I_CVTPH2PS: return "CVTPH2PS"; + case I_CVTPI2PD: return "CVTPI2PD"; + case I_CVTPI2PS: return "CVTPI2PS"; + case I_CVTPS2DQ: return "CVTPS2DQ"; + case I_CVTPS2PD: return "CVTPS2PD"; + case I_CVTPS2PH: return "CVTPS2PH"; + case I_CVTPS2PI: return "CVTPS2PI"; + case I_CVTSD2SI: return "CVTSD2SI"; + case I_CVTSD2SS: return "CVTSD2SS"; + case I_CVTSI2SD: return "CVTSI2SD"; + case I_CVTSI2SS: return "CVTSI2SS"; + case I_CVTSS2SD: return "CVTSS2SD"; + case I_CVTSS2SI: return "CVTSS2SI"; + case I_CVTTPD2DQ: return "CVTTPD2DQ"; + case I_CVTTPD2PI: return "CVTTPD2PI"; + case I_CVTTPS2DQ: return "CVTTPS2DQ"; + case I_CVTTPS2PI: return "CVTTPS2PI"; + case I_CVTTSD2SI: return "CVTTSD2SI"; + case I_CVTTSS2SI: return "CVTTSS2SI"; + case I_CWD: return "CWD"; + case I_CWDE: return "CWDE"; + case I_DAA: return "DAA"; + case I_DAS: return "DAS"; + case I_DEC: return "DEC"; + case I_DIV: return "DIV"; + case I_DIVPD: return "DIVPD"; + case I_DIVPS: return "DIVPS"; + case I_DIVSD: return "DIVSD"; + case I_DIVSS: return "DIVSS"; + case I_DPPD: return "DPPD"; + case I_DPPS: return "DPPS"; + case I_EMMS: return "EMMS"; + case I_ENTER: return "ENTER"; + case I_EXTRACTPS: return "EXTRACTPS"; + case I_EXTRQ: return "EXTRQ"; + case I_F2XM1: return "F2XM1"; + case I_FABS: return "FABS"; + case I_FADD: return "FADD"; + case I_FADDP: return "FADDP"; + case I_FBLD: return "FBLD"; + case I_FBSTP: return "FBSTP"; + case I_FCHS: return "FCHS"; + case I_FCLEX: return "FCLEX"; + case I_FCMOVB: return "FCMOVB"; + case I_FCMOVBE: return "FCMOVBE"; + case I_FCMOVE: return "FCMOVE"; + case I_FCMOVNB: return "FCMOVNB"; + case I_FCMOVNBE: return "FCMOVNBE"; + case I_FCMOVNE: return "FCMOVNE"; + case I_FCMOVNU: return "FCMOVNU"; + case I_FCMOVU: return "FCMOVU"; + case I_FCOM: return "FCOM"; + case I_FCOMI: return "FCOMI"; + case I_FCOMIP: return "FCOMIP"; + case I_FCOMP: return "FCOMP"; + case I_FCOMPP: return "FCOMPP"; + case I_FCOS: return "FCOS"; + case I_FDECSTP: return "FDECSTP"; + case I_FDIV: return "FDIV"; + case I_FDIVP: return "FDIVP"; + case I_FDIVR: return "FDIVR"; + case I_FDIVRP: return "FDIVRP"; + case I_FEDISI: return "FEDISI"; + case I_FEMMS: return "FEMMS"; + case I_FENI: return "FENI"; + case I_FFREE: return "FFREE"; + case I_FIADD: return "FIADD"; + case I_FICOM: return "FICOM"; + case I_FICOMP: return "FICOMP"; + case I_FIDIV: return "FIDIV"; + case I_FIDIVR: return "FIDIVR"; + case I_FILD: return "FILD"; + case I_FIMUL: return "FIMUL"; + case I_FINCSTP: return "FINCSTP"; + case I_FINIT: return "FINIT"; + case I_FIST: return "FIST"; + case I_FISTP: return "FISTP"; + case I_FISTTP: return "FISTTP"; + case I_FISUB: return "FISUB"; + case I_FISUBR: return "FISUBR"; + case I_FLD: return "FLD"; + case I_FLD1: return "FLD1"; + case I_FLDCW: return "FLDCW"; + case I_FLDENV: return "FLDENV"; + case I_FLDL2E: return "FLDL2E"; + case I_FLDL2T: return "FLDL2T"; + case I_FLDLG2: return "FLDLG2"; + case I_FLDLN2: return "FLDLN2"; + case I_FLDPI: return "FLDPI"; + case I_FLDZ: return "FLDZ"; + case I_FMUL: return "FMUL"; + case I_FMULP: return "FMULP"; + case I_FNCLEX: return "FNCLEX"; + case I_FNINIT: return "FNINIT"; + case I_FNOP: return "FNOP"; + case I_FNSAVE: return "FNSAVE"; + case I_FNSTCW: return "FNSTCW"; + case I_FNSTENV: return "FNSTENV"; + case I_FNSTSW: return "FNSTSW"; + case I_FPATAN: return "FPATAN"; + case I_FPREM: return "FPREM"; + case I_FPREM1: return "FPREM1"; + case I_FPTAN: return "FPTAN"; + case I_FRNDINT: return "FRNDINT"; + case I_FRSTOR: return "FRSTOR"; + case I_FSAVE: return "FSAVE"; + case I_FSCALE: return "FSCALE"; + case I_FSETPM: return "FSETPM"; + case I_FSIN: return "FSIN"; + case I_FSINCOS: return "FSINCOS"; + case I_FSQRT: return "FSQRT"; + case I_FST: return "FST"; + case I_FSTCW: return "FSTCW"; + case I_FSTENV: return "FSTENV"; + case I_FSTP: return "FSTP"; + case I_FSTSW: return "FSTSW"; + case I_FSUB: return "FSUB"; + case I_FSUBP: return "FSUBP"; + case I_FSUBR: return "FSUBR"; + case I_FSUBRP: return "FSUBRP"; + case I_FTST: return "FTST"; + case I_FUCOM: return "FUCOM"; + case I_FUCOMI: return "FUCOMI"; + case I_FUCOMIP: return "FUCOMIP"; + case I_FUCOMP: return "FUCOMP"; + case I_FUCOMPP: return "FUCOMPP"; + case I_FXAM: return "FXAM"; + case I_FXCH: return "FXCH"; + case I_FXRSTOR: return "FXRSTOR"; + case I_FXRSTOR64: return "FXRSTOR64"; + case I_FXSAVE: return "FXSAVE"; + case I_FXSAVE64: return "FXSAVE64"; + case I_FXTRACT: return "FXTRACT"; + case I_FYL2X: return "FYL2X"; + case I_FYL2XP1: return "FYL2XP1"; + case I_GETSEC: return "GETSEC"; + case I_HADDPD: return "HADDPD"; + case I_HADDPS: return "HADDPS"; + case I_HLT: return "HLT"; + case I_HSUBPD: return "HSUBPD"; + case I_HSUBPS: return "HSUBPS"; + case I_IDIV: return "IDIV"; + case I_IMUL: return "IMUL"; + case I_IN: return "IN"; + case I_INC: return "INC"; + case I_INS: return "INS"; + case I_INSERTPS: return "INSERTPS"; + case I_INSERTQ: return "INSERTQ"; + case I_INT: return "INT"; + case I_INT1: return "INT1"; + case I_INTO: return "INTO"; + case I_INT_3: return "INT_3"; + case I_INVD: return "INVD"; + case I_INVEPT: return "INVEPT"; + case I_INVLPG: return "INVLPG"; + case I_INVLPGA: return "INVLPGA"; + case I_INVPCID: return "INVPCID"; + case I_INVVPID: return "INVVPID"; + case I_IRET: return "IRET"; + case I_JA: return "JA"; + case I_JAE: return "JAE"; + case I_JB: return "JB"; + case I_JBE: return "JBE"; + case I_JCXZ: return "JCXZ"; + case I_JECXZ: return "JECXZ"; + case I_JG: return "JG"; + case I_JGE: return "JGE"; + case I_JL: return "JL"; + case I_JLE: return "JLE"; + case I_JMP: return "JMP"; + case I_JMP_FAR: return "JMP_FAR"; + case I_JNO: return "JNO"; + case I_JNP: return "JNP"; + case I_JNS: return "JNS"; + case I_JNZ: return "JNZ"; + case I_JO: return "JO"; + case I_JP: return "JP"; + case I_JRCXZ: return "JRCXZ"; + case I_JS: return "JS"; + case I_JZ: return "JZ"; + case I_LAHF: return "LAHF"; + case I_LAR: return "LAR"; + case I_LDDQU: return "LDDQU"; + case I_LDMXCSR: return "LDMXCSR"; + case I_LDS: return "LDS"; + case I_LEA: return "LEA"; + case I_LEAVE: return "LEAVE"; + case I_LES: return "LES"; + case I_LFENCE: return "LFENCE"; + case I_LFS: return "LFS"; + case I_LGDT: return "LGDT"; + case I_LGS: return "LGS"; + case I_LIDT: return "LIDT"; + case I_LLDT: return "LLDT"; + case I_LMSW: return "LMSW"; + case I_LODS: return "LODS"; + case I_LOOP: return "LOOP"; + case I_LOOPNZ: return "LOOPNZ"; + case I_LOOPZ: return "LOOPZ"; + case I_LSL: return "LSL"; + case I_LSS: return "LSS"; + case I_LTR: return "LTR"; + case I_LZCNT: return "LZCNT"; + case I_MASKMOVDQU: return "MASKMOVDQU"; + case I_MASKMOVQ: return "MASKMOVQ"; + case I_MAXPD: return "MAXPD"; + case I_MAXPS: return "MAXPS"; + case I_MAXSD: return "MAXSD"; + case I_MAXSS: return "MAXSS"; + case I_MFENCE: return "MFENCE"; + case I_MINPD: return "MINPD"; + case I_MINPS: return "MINPS"; + case I_MINSD: return "MINSD"; + case I_MINSS: return "MINSS"; + case I_MONITOR: return "MONITOR"; + case I_MOV: return "MOV"; + case I_MOVAPD: return "MOVAPD"; + case I_MOVAPS: return "MOVAPS"; + case I_MOVBE: return "MOVBE"; + case I_MOVD: return "MOVD"; + case I_MOVDDUP: return "MOVDDUP"; + case I_MOVDQ2Q: return "MOVDQ2Q"; + case I_MOVDQA: return "MOVDQA"; + case I_MOVDQU: return "MOVDQU"; + case I_MOVHLPS: return "MOVHLPS"; + case I_MOVHPD: return "MOVHPD"; + case I_MOVHPS: return "MOVHPS"; + case I_MOVLHPS: return "MOVLHPS"; + case I_MOVLPD: return "MOVLPD"; + case I_MOVLPS: return "MOVLPS"; + case I_MOVMSKPD: return "MOVMSKPD"; + case I_MOVMSKPS: return "MOVMSKPS"; + case I_MOVNTDQ: return "MOVNTDQ"; + case I_MOVNTDQA: return "MOVNTDQA"; + case I_MOVNTI: return "MOVNTI"; + case I_MOVNTPD: return "MOVNTPD"; + case I_MOVNTPS: return "MOVNTPS"; + case I_MOVNTQ: return "MOVNTQ"; + case I_MOVNTSD: return "MOVNTSD"; + case I_MOVNTSS: return "MOVNTSS"; + case I_MOVQ: return "MOVQ"; + case I_MOVQ2DQ: return "MOVQ2DQ"; + case I_MOVS: return "MOVS"; + case I_MOVSD: return "MOVSD"; + case I_MOVSHDUP: return "MOVSHDUP"; + case I_MOVSLDUP: return "MOVSLDUP"; + case I_MOVSS: return "MOVSS"; + case I_MOVSX: return "MOVSX"; + case I_MOVSXD: return "MOVSXD"; + case I_MOVUPD: return "MOVUPD"; + case I_MOVUPS: return "MOVUPS"; + case I_MOVZX: return "MOVZX"; + case I_MPSADBW: return "MPSADBW"; + case I_MUL: return "MUL"; + case I_MULPD: return "MULPD"; + case I_MULPS: return "MULPS"; + case I_MULSD: return "MULSD"; + case I_MULSS: return "MULSS"; + case I_MWAIT: return "MWAIT"; + case I_NEG: return "NEG"; + case I_NOP: return "NOP"; + case I_NOT: return "NOT"; + case I_OR: return "OR"; + case I_ORPD: return "ORPD"; + case I_ORPS: return "ORPS"; + case I_OUT: return "OUT"; + case I_OUTS: return "OUTS"; + case I_PABSB: return "PABSB"; + case I_PABSD: return "PABSD"; + case I_PABSW: return "PABSW"; + case I_PACKSSDW: return "PACKSSDW"; + case I_PACKSSWB: return "PACKSSWB"; + case I_PACKUSDW: return "PACKUSDW"; + case I_PACKUSWB: return "PACKUSWB"; + case I_PADDB: return "PADDB"; + case I_PADDD: return "PADDD"; + case I_PADDQ: return "PADDQ"; + case I_PADDSB: return "PADDSB"; + case I_PADDSW: return "PADDSW"; + case I_PADDUSB: return "PADDUSB"; + case I_PADDUSW: return "PADDUSW"; + case I_PADDW: return "PADDW"; + case I_PALIGNR: return "PALIGNR"; + case I_PAND: return "PAND"; + case I_PANDN: return "PANDN"; + case I_PAUSE: return "PAUSE"; + case I_PAVGB: return "PAVGB"; + case I_PAVGUSB: return "PAVGUSB"; + case I_PAVGW: return "PAVGW"; + case I_PBLENDVB: return "PBLENDVB"; + case I_PBLENDW: return "PBLENDW"; + case I_PCLMULQDQ: return "PCLMULQDQ"; + case I_PCMPEQB: return "PCMPEQB"; + case I_PCMPEQD: return "PCMPEQD"; + case I_PCMPEQQ: return "PCMPEQQ"; + case I_PCMPEQW: return "PCMPEQW"; + case I_PCMPESTRI: return "PCMPESTRI"; + case I_PCMPESTRM: return "PCMPESTRM"; + case I_PCMPGTB: return "PCMPGTB"; + case I_PCMPGTD: return "PCMPGTD"; + case I_PCMPGTQ: return "PCMPGTQ"; + case I_PCMPGTW: return "PCMPGTW"; + case I_PCMPISTRI: return "PCMPISTRI"; + case I_PCMPISTRM: return "PCMPISTRM"; + case I_PEXTRB: return "PEXTRB"; + case I_PEXTRD: return "PEXTRD"; + case I_PEXTRQ: return "PEXTRQ"; + case I_PEXTRW: return "PEXTRW"; + case I_PF2ID: return "PF2ID"; + case I_PF2IW: return "PF2IW"; + case I_PFACC: return "PFACC"; + case I_PFADD: return "PFADD"; + case I_PFCMPEQ: return "PFCMPEQ"; + case I_PFCMPGE: return "PFCMPGE"; + case I_PFCMPGT: return "PFCMPGT"; + case I_PFMAX: return "PFMAX"; + case I_PFMIN: return "PFMIN"; + case I_PFMUL: return "PFMUL"; + case I_PFNACC: return "PFNACC"; + case I_PFPNACC: return "PFPNACC"; + case I_PFRCP: return "PFRCP"; + case I_PFRCPIT1: return "PFRCPIT1"; + case I_PFRCPIT2: return "PFRCPIT2"; + case I_PFRSQIT1: return "PFRSQIT1"; + case I_PFRSQRT: return "PFRSQRT"; + case I_PFSUB: return "PFSUB"; + case I_PFSUBR: return "PFSUBR"; + case I_PHADDD: return "PHADDD"; + case I_PHADDSW: return "PHADDSW"; + case I_PHADDW: return "PHADDW"; + case I_PHMINPOSUW: return "PHMINPOSUW"; + case I_PHSUBD: return "PHSUBD"; + case I_PHSUBSW: return "PHSUBSW"; + case I_PHSUBW: return "PHSUBW"; + case I_PI2FD: return "PI2FD"; + case I_PI2FW: return "PI2FW"; + case I_PINSRB: return "PINSRB"; + case I_PINSRD: return "PINSRD"; + case I_PINSRQ: return "PINSRQ"; + case I_PINSRW: return "PINSRW"; + case I_PMADDUBSW: return "PMADDUBSW"; + case I_PMADDWD: return "PMADDWD"; + case I_PMAXSB: return "PMAXSB"; + case I_PMAXSD: return "PMAXSD"; + case I_PMAXSW: return "PMAXSW"; + case I_PMAXUB: return "PMAXUB"; + case I_PMAXUD: return "PMAXUD"; + case I_PMAXUW: return "PMAXUW"; + case I_PMINSB: return "PMINSB"; + case I_PMINSD: return "PMINSD"; + case I_PMINSW: return "PMINSW"; + case I_PMINUB: return "PMINUB"; + case I_PMINUD: return "PMINUD"; + case I_PMINUW: return "PMINUW"; + case I_PMOVMSKB: return "PMOVMSKB"; + case I_PMOVSXBD: return "PMOVSXBD"; + case I_PMOVSXBQ: return "PMOVSXBQ"; + case I_PMOVSXBW: return "PMOVSXBW"; + case I_PMOVSXDQ: return "PMOVSXDQ"; + case I_PMOVSXWD: return "PMOVSXWD"; + case I_PMOVSXWQ: return "PMOVSXWQ"; + case I_PMOVZXBD: return "PMOVZXBD"; + case I_PMOVZXBQ: return "PMOVZXBQ"; + case I_PMOVZXBW: return "PMOVZXBW"; + case I_PMOVZXDQ: return "PMOVZXDQ"; + case I_PMOVZXWD: return "PMOVZXWD"; + case I_PMOVZXWQ: return "PMOVZXWQ"; + case I_PMULDQ: return "PMULDQ"; + case I_PMULHRSW: return "PMULHRSW"; + case I_PMULHRW: return "PMULHRW"; + case I_PMULHUW: return "PMULHUW"; + case I_PMULHW: return "PMULHW"; + case I_PMULLD: return "PMULLD"; + case I_PMULLW: return "PMULLW"; + case I_PMULUDQ: return "PMULUDQ"; + case I_POP: return "POP"; + case I_POPA: return "POPA"; + case I_POPCNT: return "POPCNT"; + case I_POPF: return "POPF"; + case I_POR: return "POR"; + case I_PREFETCH: return "PREFETCH"; + case I_PREFETCHNTA: return "PREFETCHNTA"; + case I_PREFETCHT0: return "PREFETCHT0"; + case I_PREFETCHT1: return "PREFETCHT1"; + case I_PREFETCHT2: return "PREFETCHT2"; + case I_PREFETCHW: return "PREFETCHW"; + case I_PSADBW: return "PSADBW"; + case I_PSHUFB: return "PSHUFB"; + case I_PSHUFD: return "PSHUFD"; + case I_PSHUFHW: return "PSHUFHW"; + case I_PSHUFLW: return "PSHUFLW"; + case I_PSHUFW: return "PSHUFW"; + case I_PSIGNB: return "PSIGNB"; + case I_PSIGND: return "PSIGND"; + case I_PSIGNW: return "PSIGNW"; + case I_PSLLD: return "PSLLD"; + case I_PSLLDQ: return "PSLLDQ"; + case I_PSLLQ: return "PSLLQ"; + case I_PSLLW: return "PSLLW"; + case I_PSRAD: return "PSRAD"; + case I_PSRAW: return "PSRAW"; + case I_PSRLD: return "PSRLD"; + case I_PSRLDQ: return "PSRLDQ"; + case I_PSRLQ: return "PSRLQ"; + case I_PSRLW: return "PSRLW"; + case I_PSUBB: return "PSUBB"; + case I_PSUBD: return "PSUBD"; + case I_PSUBQ: return "PSUBQ"; + case I_PSUBSB: return "PSUBSB"; + case I_PSUBSW: return "PSUBSW"; + case I_PSUBUSB: return "PSUBUSB"; + case I_PSUBUSW: return "PSUBUSW"; + case I_PSUBW: return "PSUBW"; + case I_PSWAPD: return "PSWAPD"; + case I_PTEST: return "PTEST"; + case I_PUNPCKHBW: return "PUNPCKHBW"; + case I_PUNPCKHDQ: return "PUNPCKHDQ"; + case I_PUNPCKHQDQ: return "PUNPCKHQDQ"; + case I_PUNPCKHWD: return "PUNPCKHWD"; + case I_PUNPCKLBW: return "PUNPCKLBW"; + case I_PUNPCKLDQ: return "PUNPCKLDQ"; + case I_PUNPCKLQDQ: return "PUNPCKLQDQ"; + case I_PUNPCKLWD: return "PUNPCKLWD"; + case I_PUSH: return "PUSH"; + case I_PUSHA: return "PUSHA"; + case I_PUSHF: return "PUSHF"; + case I_PXOR: return "PXOR"; + case I_RCL: return "RCL"; + case I_RCPPS: return "RCPPS"; + case I_RCPSS: return "RCPSS"; + case I_RCR: return "RCR"; + case I_RDFSBASE: return "RDFSBASE"; + case I_RDGSBASE: return "RDGSBASE"; + case I_RDMSR: return "RDMSR"; + case I_RDPMC: return "RDPMC"; + case I_RDRAND: return "RDRAND"; + case I_RDTSC: return "RDTSC"; + case I_RDTSCP: return "RDTSCP"; + case I_RET: return "RET"; + case I_RETF: return "RETF"; + case I_ROL: return "ROL"; + case I_ROR: return "ROR"; + case I_ROUNDPD: return "ROUNDPD"; + case I_ROUNDPS: return "ROUNDPS"; + case I_ROUNDSD: return "ROUNDSD"; + case I_ROUNDSS: return "ROUNDSS"; + case I_RSM: return "RSM"; + case I_RSQRTPS: return "RSQRTPS"; + case I_RSQRTSS: return "RSQRTSS"; + case I_SAHF: return "SAHF"; + case I_SAL: return "SAL"; + case I_SALC: return "SALC"; + case I_SAR: return "SAR"; + case I_SBB: return "SBB"; + case I_SCAS: return "SCAS"; + case I_SETA: return "SETA"; + case I_SETAE: return "SETAE"; + case I_SETB: return "SETB"; + case I_SETBE: return "SETBE"; + case I_SETG: return "SETG"; + case I_SETGE: return "SETGE"; + case I_SETL: return "SETL"; + case I_SETLE: return "SETLE"; + case I_SETNO: return "SETNO"; + case I_SETNP: return "SETNP"; + case I_SETNS: return "SETNS"; + case I_SETNZ: return "SETNZ"; + case I_SETO: return "SETO"; + case I_SETP: return "SETP"; + case I_SETS: return "SETS"; + case I_SETZ: return "SETZ"; + case I_SFENCE: return "SFENCE"; + case I_SGDT: return "SGDT"; + case I_SHL: return "SHL"; + case I_SHLD: return "SHLD"; + case I_SHR: return "SHR"; + case I_SHRD: return "SHRD"; + case I_SHUFPD: return "SHUFPD"; + case I_SHUFPS: return "SHUFPS"; + case I_SIDT: return "SIDT"; + case I_SKINIT: return "SKINIT"; + case I_SLDT: return "SLDT"; + case I_SMSW: return "SMSW"; + case I_SQRTPD: return "SQRTPD"; + case I_SQRTPS: return "SQRTPS"; + case I_SQRTSD: return "SQRTSD"; + case I_SQRTSS: return "SQRTSS"; + case I_STC: return "STC"; + case I_STD: return "STD"; + case I_STGI: return "STGI"; + case I_STI: return "STI"; + case I_STMXCSR: return "STMXCSR"; + case I_STOS: return "STOS"; + case I_STR: return "STR"; + case I_SUB: return "SUB"; + case I_SUBPD: return "SUBPD"; + case I_SUBPS: return "SUBPS"; + case I_SUBSD: return "SUBSD"; + case I_SUBSS: return "SUBSS"; + case I_SWAPGS: return "SWAPGS"; + case I_SYSCALL: return "SYSCALL"; + case I_SYSENTER: return "SYSENTER"; + case I_SYSEXIT: return "SYSEXIT"; + case I_SYSRET: return "SYSRET"; + case I_TEST: return "TEST"; + case I_TZCNT: return "TZCNT"; + case I_UCOMISD: return "UCOMISD"; + case I_UCOMISS: return "UCOMISS"; + case I_UD2: return "UD2"; + case I_UNDEFINED: return "UNDEFINED"; + case I_UNPCKHPD: return "UNPCKHPD"; + case I_UNPCKHPS: return "UNPCKHPS"; + case I_UNPCKLPD: return "UNPCKLPD"; + case I_UNPCKLPS: return "UNPCKLPS"; + case I_VADDPD: return "VADDPD"; + case I_VADDPS: return "VADDPS"; + case I_VADDSD: return "VADDSD"; + case I_VADDSS: return "VADDSS"; + case I_VADDSUBPD: return "VADDSUBPD"; + case I_VADDSUBPS: return "VADDSUBPS"; + case I_VAESDEC: return "VAESDEC"; + case I_VAESDECLAST: return "VAESDECLAST"; + case I_VAESENC: return "VAESENC"; + case I_VAESENCLAST: return "VAESENCLAST"; + case I_VAESIMC: return "VAESIMC"; + case I_VAESKEYGENASSIST: return "VAESKEYGENASSIST"; + case I_VANDNPD: return "VANDNPD"; + case I_VANDNPS: return "VANDNPS"; + case I_VANDPD: return "VANDPD"; + case I_VANDPS: return "VANDPS"; + case I_VBLENDPD: return "VBLENDPD"; + case I_VBLENDPS: return "VBLENDPS"; + case I_VBLENDVPD: return "VBLENDVPD"; + case I_VBLENDVPS: return "VBLENDVPS"; + case I_VBROADCASTF128: return "VBROADCASTF128"; + case I_VBROADCASTSD: return "VBROADCASTSD"; + case I_VBROADCASTSS: return "VBROADCASTSS"; + case I_VCMPEQPD: return "VCMPEQPD"; + case I_VCMPEQPS: return "VCMPEQPS"; + case I_VCMPEQSD: return "VCMPEQSD"; + case I_VCMPEQSS: return "VCMPEQSS"; + case I_VCMPEQ_OSPD: return "VCMPEQ_OSPD"; + case I_VCMPEQ_OSPS: return "VCMPEQ_OSPS"; + case I_VCMPEQ_OSSD: return "VCMPEQ_OSSD"; + case I_VCMPEQ_OSSS: return "VCMPEQ_OSSS"; + case I_VCMPEQ_UQPD: return "VCMPEQ_UQPD"; + case I_VCMPEQ_UQPS: return "VCMPEQ_UQPS"; + case I_VCMPEQ_UQSD: return "VCMPEQ_UQSD"; + case I_VCMPEQ_UQSS: return "VCMPEQ_UQSS"; + case I_VCMPEQ_USPD: return "VCMPEQ_USPD"; + case I_VCMPEQ_USPS: return "VCMPEQ_USPS"; + case I_VCMPEQ_USSD: return "VCMPEQ_USSD"; + case I_VCMPEQ_USSS: return "VCMPEQ_USSS"; + case I_VCMPFALSEPD: return "VCMPFALSEPD"; + case I_VCMPFALSEPS: return "VCMPFALSEPS"; + case I_VCMPFALSESD: return "VCMPFALSESD"; + case I_VCMPFALSESS: return "VCMPFALSESS"; + case I_VCMPFALSE_OSPD: return "VCMPFALSE_OSPD"; + case I_VCMPFALSE_OSPS: return "VCMPFALSE_OSPS"; + case I_VCMPFALSE_OSSD: return "VCMPFALSE_OSSD"; + case I_VCMPFALSE_OSSS: return "VCMPFALSE_OSSS"; + case I_VCMPGEPD: return "VCMPGEPD"; + case I_VCMPGEPS: return "VCMPGEPS"; + case I_VCMPGESD: return "VCMPGESD"; + case I_VCMPGESS: return "VCMPGESS"; + case I_VCMPGE_OQPD: return "VCMPGE_OQPD"; + case I_VCMPGE_OQPS: return "VCMPGE_OQPS"; + case I_VCMPGE_OQSD: return "VCMPGE_OQSD"; + case I_VCMPGE_OQSS: return "VCMPGE_OQSS"; + case I_VCMPGTPD: return "VCMPGTPD"; + case I_VCMPGTPS: return "VCMPGTPS"; + case I_VCMPGTSD: return "VCMPGTSD"; + case I_VCMPGTSS: return "VCMPGTSS"; + case I_VCMPGT_OQPD: return "VCMPGT_OQPD"; + case I_VCMPGT_OQPS: return "VCMPGT_OQPS"; + case I_VCMPGT_OQSD: return "VCMPGT_OQSD"; + case I_VCMPGT_OQSS: return "VCMPGT_OQSS"; + case I_VCMPLEPD: return "VCMPLEPD"; + case I_VCMPLEPS: return "VCMPLEPS"; + case I_VCMPLESD: return "VCMPLESD"; + case I_VCMPLESS: return "VCMPLESS"; + case I_VCMPLE_OQPD: return "VCMPLE_OQPD"; + case I_VCMPLE_OQPS: return "VCMPLE_OQPS"; + case I_VCMPLE_OQSD: return "VCMPLE_OQSD"; + case I_VCMPLE_OQSS: return "VCMPLE_OQSS"; + case I_VCMPLTPD: return "VCMPLTPD"; + case I_VCMPLTPS: return "VCMPLTPS"; + case I_VCMPLTSD: return "VCMPLTSD"; + case I_VCMPLTSS: return "VCMPLTSS"; + case I_VCMPLT_OQPD: return "VCMPLT_OQPD"; + case I_VCMPLT_OQPS: return "VCMPLT_OQPS"; + case I_VCMPLT_OQSD: return "VCMPLT_OQSD"; + case I_VCMPLT_OQSS: return "VCMPLT_OQSS"; + case I_VCMPNEQPD: return "VCMPNEQPD"; + case I_VCMPNEQPS: return "VCMPNEQPS"; + case I_VCMPNEQSD: return "VCMPNEQSD"; + case I_VCMPNEQSS: return "VCMPNEQSS"; + case I_VCMPNEQ_OQPD: return "VCMPNEQ_OQPD"; + case I_VCMPNEQ_OQPS: return "VCMPNEQ_OQPS"; + case I_VCMPNEQ_OQSD: return "VCMPNEQ_OQSD"; + case I_VCMPNEQ_OQSS: return "VCMPNEQ_OQSS"; + case I_VCMPNEQ_OSPD: return "VCMPNEQ_OSPD"; + case I_VCMPNEQ_OSPS: return "VCMPNEQ_OSPS"; + case I_VCMPNEQ_OSSD: return "VCMPNEQ_OSSD"; + case I_VCMPNEQ_OSSS: return "VCMPNEQ_OSSS"; + case I_VCMPNEQ_USPD: return "VCMPNEQ_USPD"; + case I_VCMPNEQ_USPS: return "VCMPNEQ_USPS"; + case I_VCMPNEQ_USSD: return "VCMPNEQ_USSD"; + case I_VCMPNEQ_USSS: return "VCMPNEQ_USSS"; + case I_VCMPNGEPD: return "VCMPNGEPD"; + case I_VCMPNGEPS: return "VCMPNGEPS"; + case I_VCMPNGESD: return "VCMPNGESD"; + case I_VCMPNGESS: return "VCMPNGESS"; + case I_VCMPNGE_UQPD: return "VCMPNGE_UQPD"; + case I_VCMPNGE_UQPS: return "VCMPNGE_UQPS"; + case I_VCMPNGE_UQSD: return "VCMPNGE_UQSD"; + case I_VCMPNGE_UQSS: return "VCMPNGE_UQSS"; + case I_VCMPNGTPD: return "VCMPNGTPD"; + case I_VCMPNGTPS: return "VCMPNGTPS"; + case I_VCMPNGTSD: return "VCMPNGTSD"; + case I_VCMPNGTSS: return "VCMPNGTSS"; + case I_VCMPNGT_UQPD: return "VCMPNGT_UQPD"; + case I_VCMPNGT_UQPS: return "VCMPNGT_UQPS"; + case I_VCMPNGT_UQSD: return "VCMPNGT_UQSD"; + case I_VCMPNGT_UQSS: return "VCMPNGT_UQSS"; + case I_VCMPNLEPD: return "VCMPNLEPD"; + case I_VCMPNLEPS: return "VCMPNLEPS"; + case I_VCMPNLESD: return "VCMPNLESD"; + case I_VCMPNLESS: return "VCMPNLESS"; + case I_VCMPNLE_UQPD: return "VCMPNLE_UQPD"; + case I_VCMPNLE_UQPS: return "VCMPNLE_UQPS"; + case I_VCMPNLE_UQSD: return "VCMPNLE_UQSD"; + case I_VCMPNLE_UQSS: return "VCMPNLE_UQSS"; + case I_VCMPNLTPD: return "VCMPNLTPD"; + case I_VCMPNLTPS: return "VCMPNLTPS"; + case I_VCMPNLTSD: return "VCMPNLTSD"; + case I_VCMPNLTSS: return "VCMPNLTSS"; + case I_VCMPNLT_UQPD: return "VCMPNLT_UQPD"; + case I_VCMPNLT_UQPS: return "VCMPNLT_UQPS"; + case I_VCMPNLT_UQSD: return "VCMPNLT_UQSD"; + case I_VCMPNLT_UQSS: return "VCMPNLT_UQSS"; + case I_VCMPORDPD: return "VCMPORDPD"; + case I_VCMPORDPS: return "VCMPORDPS"; + case I_VCMPORDSD: return "VCMPORDSD"; + case I_VCMPORDSS: return "VCMPORDSS"; + case I_VCMPORD_SPD: return "VCMPORD_SPD"; + case I_VCMPORD_SPS: return "VCMPORD_SPS"; + case I_VCMPORD_SSD: return "VCMPORD_SSD"; + case I_VCMPORD_SSS: return "VCMPORD_SSS"; + case I_VCMPTRUEPD: return "VCMPTRUEPD"; + case I_VCMPTRUEPS: return "VCMPTRUEPS"; + case I_VCMPTRUESD: return "VCMPTRUESD"; + case I_VCMPTRUESS: return "VCMPTRUESS"; + case I_VCMPTRUE_USPD: return "VCMPTRUE_USPD"; + case I_VCMPTRUE_USPS: return "VCMPTRUE_USPS"; + case I_VCMPTRUE_USSD: return "VCMPTRUE_USSD"; + case I_VCMPTRUE_USSS: return "VCMPTRUE_USSS"; + case I_VCMPUNORDPD: return "VCMPUNORDPD"; + case I_VCMPUNORDPS: return "VCMPUNORDPS"; + case I_VCMPUNORDSD: return "VCMPUNORDSD"; + case I_VCMPUNORDSS: return "VCMPUNORDSS"; + case I_VCMPUNORD_SPD: return "VCMPUNORD_SPD"; + case I_VCMPUNORD_SPS: return "VCMPUNORD_SPS"; + case I_VCMPUNORD_SSD: return "VCMPUNORD_SSD"; + case I_VCMPUNORD_SSS: return "VCMPUNORD_SSS"; + case I_VCOMISD: return "VCOMISD"; + case I_VCOMISS: return "VCOMISS"; + case I_VCVTDQ2PD: return "VCVTDQ2PD"; + case I_VCVTDQ2PS: return "VCVTDQ2PS"; + case I_VCVTPD2DQ: return "VCVTPD2DQ"; + case I_VCVTPD2PS: return "VCVTPD2PS"; + case I_VCVTPS2DQ: return "VCVTPS2DQ"; + case I_VCVTPS2PD: return "VCVTPS2PD"; + case I_VCVTSD2SI: return "VCVTSD2SI"; + case I_VCVTSD2SS: return "VCVTSD2SS"; + case I_VCVTSI2SD: return "VCVTSI2SD"; + case I_VCVTSI2SS: return "VCVTSI2SS"; + case I_VCVTSS2SD: return "VCVTSS2SD"; + case I_VCVTSS2SI: return "VCVTSS2SI"; + case I_VCVTTPD2DQ: return "VCVTTPD2DQ"; + case I_VCVTTPS2DQ: return "VCVTTPS2DQ"; + case I_VCVTTSD2SI: return "VCVTTSD2SI"; + case I_VCVTTSS2SI: return "VCVTTSS2SI"; + case I_VDIVPD: return "VDIVPD"; + case I_VDIVPS: return "VDIVPS"; + case I_VDIVSD: return "VDIVSD"; + case I_VDIVSS: return "VDIVSS"; + case I_VDPPD: return "VDPPD"; + case I_VDPPS: return "VDPPS"; + case I_VERR: return "VERR"; + case I_VERW: return "VERW"; + case I_VEXTRACTF128: return "VEXTRACTF128"; + case I_VEXTRACTPS: return "VEXTRACTPS"; + case I_VFMADD132PD: return "VFMADD132PD"; + case I_VFMADD132PS: return "VFMADD132PS"; + case I_VFMADD132SD: return "VFMADD132SD"; + case I_VFMADD132SS: return "VFMADD132SS"; + case I_VFMADD213PD: return "VFMADD213PD"; + case I_VFMADD213PS: return "VFMADD213PS"; + case I_VFMADD213SD: return "VFMADD213SD"; + case I_VFMADD213SS: return "VFMADD213SS"; + case I_VFMADD231PD: return "VFMADD231PD"; + case I_VFMADD231PS: return "VFMADD231PS"; + case I_VFMADD231SD: return "VFMADD231SD"; + case I_VFMADD231SS: return "VFMADD231SS"; + case I_VFMADDSUB132PD: return "VFMADDSUB132PD"; + case I_VFMADDSUB132PS: return "VFMADDSUB132PS"; + case I_VFMADDSUB213PD: return "VFMADDSUB213PD"; + case I_VFMADDSUB213PS: return "VFMADDSUB213PS"; + case I_VFMADDSUB231PD: return "VFMADDSUB231PD"; + case I_VFMADDSUB231PS: return "VFMADDSUB231PS"; + case I_VFMSUB132PD: return "VFMSUB132PD"; + case I_VFMSUB132PS: return "VFMSUB132PS"; + case I_VFMSUB132SD: return "VFMSUB132SD"; + case I_VFMSUB132SS: return "VFMSUB132SS"; + case I_VFMSUB213PD: return "VFMSUB213PD"; + case I_VFMSUB213PS: return "VFMSUB213PS"; + case I_VFMSUB213SD: return "VFMSUB213SD"; + case I_VFMSUB213SS: return "VFMSUB213SS"; + case I_VFMSUB231PD: return "VFMSUB231PD"; + case I_VFMSUB231PS: return "VFMSUB231PS"; + case I_VFMSUB231SD: return "VFMSUB231SD"; + case I_VFMSUB231SS: return "VFMSUB231SS"; + case I_VFMSUBADD132PD: return "VFMSUBADD132PD"; + case I_VFMSUBADD132PS: return "VFMSUBADD132PS"; + case I_VFMSUBADD213PD: return "VFMSUBADD213PD"; + case I_VFMSUBADD213PS: return "VFMSUBADD213PS"; + case I_VFMSUBADD231PD: return "VFMSUBADD231PD"; + case I_VFMSUBADD231PS: return "VFMSUBADD231PS"; + case I_VFNMADD132PD: return "VFNMADD132PD"; + case I_VFNMADD132PS: return "VFNMADD132PS"; + case I_VFNMADD132SD: return "VFNMADD132SD"; + case I_VFNMADD132SS: return "VFNMADD132SS"; + case I_VFNMADD213PD: return "VFNMADD213PD"; + case I_VFNMADD213PS: return "VFNMADD213PS"; + case I_VFNMADD213SD: return "VFNMADD213SD"; + case I_VFNMADD213SS: return "VFNMADD213SS"; + case I_VFNMADD231PD: return "VFNMADD231PD"; + case I_VFNMADD231PS: return "VFNMADD231PS"; + case I_VFNMADD231SD: return "VFNMADD231SD"; + case I_VFNMADD231SS: return "VFNMADD231SS"; + case I_VFNMSUB132PD: return "VFNMSUB132PD"; + case I_VFNMSUB132PS: return "VFNMSUB132PS"; + case I_VFNMSUB132SD: return "VFNMSUB132SD"; + case I_VFNMSUB132SS: return "VFNMSUB132SS"; + case I_VFNMSUB213PD: return "VFNMSUB213PD"; + case I_VFNMSUB213PS: return "VFNMSUB213PS"; + case I_VFNMSUB213SD: return "VFNMSUB213SD"; + case I_VFNMSUB213SS: return "VFNMSUB213SS"; + case I_VFNMSUB231PD: return "VFNMSUB231PD"; + case I_VFNMSUB231PS: return "VFNMSUB231PS"; + case I_VFNMSUB231SD: return "VFNMSUB231SD"; + case I_VFNMSUB231SS: return "VFNMSUB231SS"; + case I_VHADDPD: return "VHADDPD"; + case I_VHADDPS: return "VHADDPS"; + case I_VHSUBPD: return "VHSUBPD"; + case I_VHSUBPS: return "VHSUBPS"; + case I_VINSERTF128: return "VINSERTF128"; + case I_VINSERTPS: return "VINSERTPS"; + case I_VLDDQU: return "VLDDQU"; + case I_VLDMXCSR: return "VLDMXCSR"; + case I_VMASKMOVDQU: return "VMASKMOVDQU"; + case I_VMASKMOVPD: return "VMASKMOVPD"; + case I_VMASKMOVPS: return "VMASKMOVPS"; + case I_VMAXPD: return "VMAXPD"; + case I_VMAXPS: return "VMAXPS"; + case I_VMAXSD: return "VMAXSD"; + case I_VMAXSS: return "VMAXSS"; + case I_VMCALL: return "VMCALL"; + case I_VMCLEAR: return "VMCLEAR"; + case I_VMFUNC: return "VMFUNC"; + case I_VMINPD: return "VMINPD"; + case I_VMINPS: return "VMINPS"; + case I_VMINSD: return "VMINSD"; + case I_VMINSS: return "VMINSS"; + case I_VMLAUNCH: return "VMLAUNCH"; + case I_VMLOAD: return "VMLOAD"; + case I_VMMCALL: return "VMMCALL"; + case I_VMOVAPD: return "VMOVAPD"; + case I_VMOVAPS: return "VMOVAPS"; + case I_VMOVD: return "VMOVD"; + case I_VMOVDDUP: return "VMOVDDUP"; + case I_VMOVDQA: return "VMOVDQA"; + case I_VMOVDQU: return "VMOVDQU"; + case I_VMOVHLPS: return "VMOVHLPS"; + case I_VMOVHPD: return "VMOVHPD"; + case I_VMOVHPS: return "VMOVHPS"; + case I_VMOVLHPS: return "VMOVLHPS"; + case I_VMOVLPD: return "VMOVLPD"; + case I_VMOVLPS: return "VMOVLPS"; + case I_VMOVMSKPD: return "VMOVMSKPD"; + case I_VMOVMSKPS: return "VMOVMSKPS"; + case I_VMOVNTDQ: return "VMOVNTDQ"; + case I_VMOVNTDQA: return "VMOVNTDQA"; + case I_VMOVNTPD: return "VMOVNTPD"; + case I_VMOVNTPS: return "VMOVNTPS"; + case I_VMOVQ: return "VMOVQ"; + case I_VMOVSD: return "VMOVSD"; + case I_VMOVSHDUP: return "VMOVSHDUP"; + case I_VMOVSLDUP: return "VMOVSLDUP"; + case I_VMOVSS: return "VMOVSS"; + case I_VMOVUPD: return "VMOVUPD"; + case I_VMOVUPS: return "VMOVUPS"; + case I_VMPSADBW: return "VMPSADBW"; + case I_VMPTRLD: return "VMPTRLD"; + case I_VMPTRST: return "VMPTRST"; + case I_VMREAD: return "VMREAD"; + case I_VMRESUME: return "VMRESUME"; + case I_VMRUN: return "VMRUN"; + case I_VMSAVE: return "VMSAVE"; + case I_VMULPD: return "VMULPD"; + case I_VMULPS: return "VMULPS"; + case I_VMULSD: return "VMULSD"; + case I_VMULSS: return "VMULSS"; + case I_VMWRITE: return "VMWRITE"; + case I_VMXOFF: return "VMXOFF"; + case I_VMXON: return "VMXON"; + case I_VORPD: return "VORPD"; + case I_VORPS: return "VORPS"; + case I_VPABSB: return "VPABSB"; + case I_VPABSD: return "VPABSD"; + case I_VPABSW: return "VPABSW"; + case I_VPACKSSDW: return "VPACKSSDW"; + case I_VPACKSSWB: return "VPACKSSWB"; + case I_VPACKUSDW: return "VPACKUSDW"; + case I_VPACKUSWB: return "VPACKUSWB"; + case I_VPADDB: return "VPADDB"; + case I_VPADDD: return "VPADDD"; + case I_VPADDQ: return "VPADDQ"; + case I_VPADDSB: return "VPADDSB"; + case I_VPADDSW: return "VPADDSW"; + case I_VPADDUSW: return "VPADDUSW"; + case I_VPADDW: return "VPADDW"; + case I_VPALIGNR: return "VPALIGNR"; + case I_VPAND: return "VPAND"; + case I_VPANDN: return "VPANDN"; + case I_VPAVGB: return "VPAVGB"; + case I_VPAVGW: return "VPAVGW"; + case I_VPBLENDVB: return "VPBLENDVB"; + case I_VPBLENDW: return "VPBLENDW"; + case I_VPCLMULQDQ: return "VPCLMULQDQ"; + case I_VPCMPEQB: return "VPCMPEQB"; + case I_VPCMPEQD: return "VPCMPEQD"; + case I_VPCMPEQQ: return "VPCMPEQQ"; + case I_VPCMPEQW: return "VPCMPEQW"; + case I_VPCMPESTRI: return "VPCMPESTRI"; + case I_VPCMPESTRM: return "VPCMPESTRM"; + case I_VPCMPGTB: return "VPCMPGTB"; + case I_VPCMPGTD: return "VPCMPGTD"; + case I_VPCMPGTQ: return "VPCMPGTQ"; + case I_VPCMPGTW: return "VPCMPGTW"; + case I_VPCMPISTRI: return "VPCMPISTRI"; + case I_VPCMPISTRM: return "VPCMPISTRM"; + case I_VPERM2F128: return "VPERM2F128"; + case I_VPERMILPD: return "VPERMILPD"; + case I_VPERMILPS: return "VPERMILPS"; + case I_VPEXTRB: return "VPEXTRB"; + case I_VPEXTRD: return "VPEXTRD"; + case I_VPEXTRQ: return "VPEXTRQ"; + case I_VPEXTRW: return "VPEXTRW"; + case I_VPHADDD: return "VPHADDD"; + case I_VPHADDSW: return "VPHADDSW"; + case I_VPHADDW: return "VPHADDW"; + case I_VPHMINPOSUW: return "VPHMINPOSUW"; + case I_VPHSUBD: return "VPHSUBD"; + case I_VPHSUBSW: return "VPHSUBSW"; + case I_VPHSUBW: return "VPHSUBW"; + case I_VPINSRB: return "VPINSRB"; + case I_VPINSRD: return "VPINSRD"; + case I_VPINSRQ: return "VPINSRQ"; + case I_VPINSRW: return "VPINSRW"; + case I_VPMADDUBSW: return "VPMADDUBSW"; + case I_VPMADDWD: return "VPMADDWD"; + case I_VPMAXSB: return "VPMAXSB"; + case I_VPMAXSD: return "VPMAXSD"; + case I_VPMAXSW: return "VPMAXSW"; + case I_VPMAXUB: return "VPMAXUB"; + case I_VPMAXUD: return "VPMAXUD"; + case I_VPMAXUW: return "VPMAXUW"; + case I_VPMINSB: return "VPMINSB"; + case I_VPMINSD: return "VPMINSD"; + case I_VPMINSW: return "VPMINSW"; + case I_VPMINUB: return "VPMINUB"; + case I_VPMINUD: return "VPMINUD"; + case I_VPMINUW: return "VPMINUW"; + case I_VPMOVMSKB: return "VPMOVMSKB"; + case I_VPMOVSXBD: return "VPMOVSXBD"; + case I_VPMOVSXBQ: return "VPMOVSXBQ"; + case I_VPMOVSXBW: return "VPMOVSXBW"; + case I_VPMOVSXDQ: return "VPMOVSXDQ"; + case I_VPMOVSXWD: return "VPMOVSXWD"; + case I_VPMOVSXWQ: return "VPMOVSXWQ"; + case I_VPMOVZXBD: return "VPMOVZXBD"; + case I_VPMOVZXBQ: return "VPMOVZXBQ"; + case I_VPMOVZXBW: return "VPMOVZXBW"; + case I_VPMOVZXDQ: return "VPMOVZXDQ"; + case I_VPMOVZXWD: return "VPMOVZXWD"; + case I_VPMOVZXWQ: return "VPMOVZXWQ"; + case I_VPMULDQ: return "VPMULDQ"; + case I_VPMULHRSW: return "VPMULHRSW"; + case I_VPMULHUW: return "VPMULHUW"; + case I_VPMULHW: return "VPMULHW"; + case I_VPMULLD: return "VPMULLD"; + case I_VPMULLW: return "VPMULLW"; + case I_VPMULUDQ: return "VPMULUDQ"; + case I_VPOR: return "VPOR"; + case I_VPSADBW: return "VPSADBW"; + case I_VPSHUFB: return "VPSHUFB"; + case I_VPSHUFD: return "VPSHUFD"; + case I_VPSHUFHW: return "VPSHUFHW"; + case I_VPSHUFLW: return "VPSHUFLW"; + case I_VPSIGNB: return "VPSIGNB"; + case I_VPSIGND: return "VPSIGND"; + case I_VPSIGNW: return "VPSIGNW"; + case I_VPSLLD: return "VPSLLD"; + case I_VPSLLDQ: return "VPSLLDQ"; + case I_VPSLLQ: return "VPSLLQ"; + case I_VPSLLW: return "VPSLLW"; + case I_VPSRAD: return "VPSRAD"; + case I_VPSRAW: return "VPSRAW"; + case I_VPSRLD: return "VPSRLD"; + case I_VPSRLDQ: return "VPSRLDQ"; + case I_VPSRLQ: return "VPSRLQ"; + case I_VPSRLW: return "VPSRLW"; + case I_VPSUBB: return "VPSUBB"; + case I_VPSUBD: return "VPSUBD"; + case I_VPSUBQ: return "VPSUBQ"; + case I_VPSUBSB: return "VPSUBSB"; + case I_VPSUBSW: return "VPSUBSW"; + case I_VPSUBUSB: return "VPSUBUSB"; + case I_VPSUBUSW: return "VPSUBUSW"; + case I_VPSUBW: return "VPSUBW"; + case I_VPTEST: return "VPTEST"; + case I_VPUNPCKHBW: return "VPUNPCKHBW"; + case I_VPUNPCKHDQ: return "VPUNPCKHDQ"; + case I_VPUNPCKHQDQ: return "VPUNPCKHQDQ"; + case I_VPUNPCKHWD: return "VPUNPCKHWD"; + case I_VPUNPCKLBW: return "VPUNPCKLBW"; + case I_VPUNPCKLDQ: return "VPUNPCKLDQ"; + case I_VPUNPCKLQDQ: return "VPUNPCKLQDQ"; + case I_VPUNPCKLWD: return "VPUNPCKLWD"; + case I_VPXOR: return "VPXOR"; + case I_VRCPPS: return "VRCPPS"; + case I_VRCPSS: return "VRCPSS"; + case I_VROUNDPD: return "VROUNDPD"; + case I_VROUNDPS: return "VROUNDPS"; + case I_VROUNDSD: return "VROUNDSD"; + case I_VROUNDSS: return "VROUNDSS"; + case I_VRSQRTPS: return "VRSQRTPS"; + case I_VRSQRTSS: return "VRSQRTSS"; + case I_VSHUFPD: return "VSHUFPD"; + case I_VSHUFPS: return "VSHUFPS"; + case I_VSQRTPD: return "VSQRTPD"; + case I_VSQRTPS: return "VSQRTPS"; + case I_VSQRTSD: return "VSQRTSD"; + case I_VSQRTSS: return "VSQRTSS"; + case I_VSTMXCSR: return "VSTMXCSR"; + case I_VSUBPD: return "VSUBPD"; + case I_VSUBPS: return "VSUBPS"; + case I_VSUBSD: return "VSUBSD"; + case I_VSUBSS: return "VSUBSS"; + case I_VTESTPD: return "VTESTPD"; + case I_VTESTPS: return "VTESTPS"; + case I_VUCOMISD: return "VUCOMISD"; + case I_VUCOMISS: return "VUCOMISS"; + case I_VUNPCKHPD: return "VUNPCKHPD"; + case I_VUNPCKHPS: return "VUNPCKHPS"; + case I_VUNPCKLPD: return "VUNPCKLPD"; + case I_VUNPCKLPS: return "VUNPCKLPS"; + case I_VXORPD: return "VXORPD"; + case I_VXORPS: return "VXORPS"; + case I_VZEROALL: return "VZEROALL"; + case I_VZEROUPPER: return "VZEROUPPER"; + case I_WAIT: return "WAIT"; + case I_WBINVD: return "WBINVD"; + case I_WRFSBASE: return "WRFSBASE"; + case I_WRGSBASE: return "WRGSBASE"; + case I_WRMSR: return "WRMSR"; + case I_XABORT: return "XABORT"; + case I_XADD: return "XADD"; + case I_XBEGIN: return "XBEGIN"; + case I_XCHG: return "XCHG"; + case I_XEND: return "XEND"; + case I_XGETBV: return "XGETBV"; + case I_XLAT: return "XLAT"; + case I_XOR: return "XOR"; + case I_XORPD: return "XORPD"; + case I_XORPS: return "XORPS"; + case I_XRSTOR: return "XRSTOR"; + case I_XRSTOR64: return "XRSTOR64"; + case I_XSAVE: return "XSAVE"; + case I_XSAVE64: return "XSAVE64"; + case I_XSAVEOPT: return "XSAVEOPT"; + case I_XSAVEOPT64: return "XSAVEOPT64"; + case I_XSETBV: return "XSETBV"; + default: assert(false); return "???"; + } +} + +void output_value(std::stringstream &output, int nibbles, uint32_t value) +{ + if (value < 0xA) + // Show 0 upto 9 as 1 decimal digit + output << std::setw(1) << value; + else + output << std::setfill('0') << std::setw(nibbles) << std::right << value << 'h'; +} + +void output_value_disp(std::stringstream &output, _DInst &info) +{ + uint32_t value = EmuX86_Distorm_read_disp(info); + if (value != 0) { + int nibbles = info.dispSize / 4; + assert(nibbles == 2 || nibbles == 4 || nibbles == 8); + if ((int32_t)value < 0) { + output << '-'; + output_value(output, nibbles, value); + } + else { + output << '+'; + output_value(output, nibbles, value); + } + } +} + +void output_segment(std::stringstream &output, _DInst &info) +{ + if (SEGMENT_GET(info.segment) != R_NONE) + output << Distorm_RegStrings[SEGMENT_GET(info.segment)] << ":"; +} + +void EmuX86_DistormLogInstruction(const uint8_t *Eip, _DInst &info) +{ + std::stringstream output; + + output << "Disassembly : " + << std::setfill('0') << std::setw(8) << std::right << std::hex << std::uppercase << (xbaddr)Eip; + for (int b = 0; b < MAX(7, info.size); b++) { + if (b < info.size) + //output << " " << std::setfill('0') << std::setw(2) << std::right << std::hex << ((uint8_t)0+Eip[b]); // add 2 hex nibbles, not chars + output << " " << std::setw(2) << ((uint8_t)0+Eip[b]); // add 2 hex nibbles, not chars + else + output << " "; + } + + output << std::setfill(' ') << std::left << std::setw(1) << " "; + if (info.flags & FLAG_LOCK) + output << "LOCK "; + + if (info.flags & FLAG_REPNZ) + output << "REPNZ "; + + if (info.flags & FLAG_REP) { + switch (info.opcode) { + case I_CMPS: + case I_SCAS: + output << "REPZ "; + break; + default: + output << "REP "; + } + } + + output << std::setw(11) << Distorm_OpcodeString(info.opcode); + for (int o = 0; o < 4 && info.ops[o].type != O_NONE; o++) { + // Convert size in bits to (hexadecimal) nibble count and a size-indicator string + int nr_nibbles; + std::string size_str; + + switch (info.ops[o].size) { + case 0: nr_nibbles = 8; size_str = ""; break; + case 8: nr_nibbles = 2; size_str = "byte ptr "; break; + case 16: nr_nibbles = 4; size_str = "word ptr "; break; + case 32: nr_nibbles = 8; size_str = "dword ptr "; break; + default: assert(false); + } + + // Output register/operand separator + output << std::setfill(' ') << std::setw(1) << std::right << ((o == 0) ? " " : ","); + // Render operand to output + switch (info.ops[o].type) { + case O_REG: + output << Distorm_RegStrings[info.ops[o].index]; + break; + case O_IMM: + output_value(output, nr_nibbles, info.imm.dword); + break; + case O_IMM1: // TODO : Needs test-case + output_value(output, nr_nibbles, info.imm.ex.i1); + break; + case O_IMM2: // TODO : Needs test-case + output_value(output, nr_nibbles, info.imm.ex.i2); + break; + case O_DISP: + output << size_str; + output_segment(output, info); // Was << "ds:", so no check on default + output << "["; + output_value(output, info.dispSize > 0 ? info.dispSize / 4 : 8, EmuX86_Distorm_read_disp(info)); + output << "]"; + break; + case O_SMEM: + output << size_str << "["; + if (!SEGMENT_IS_DEFAULT(info.segment)) + output_segment(output, info); + output << Distorm_RegStrings[info.ops[o].index]; + output_value_disp(output, info); + output << "]"; + break; + case O_MEM: + output << size_str << "["; + if (!SEGMENT_IS_DEFAULT(info.segment)) + output_segment(output, info); + if (info.base != R_NONE) + output << Distorm_RegStrings[info.base] << "+"; + output << Distorm_RegStrings[info.ops[o].index]; + if (info.scale >= 2) { + output << "*"; + output_value(output, 1/*nibble*/, info.scale); + } + output_value_disp(output, info); + output << "]"; + break; + case O_PC: + output_value(output, 8, (xbaddr)Eip + (xbaddr)INSTRUCTION_GET_TARGET(&info)); + break; + case O_PTR: // TODO : Needs test-case + output << "+" << std::setfill('0') << info.imm.ptr.seg << "/"; + output_value(output, nr_nibbles, info.imm.ptr.off); + break; + default: + assert(false); + output << "?"; + break; + } + } + + if (FLAG_GET_PRIVILEGED(info.flags)) + output << " // Privileged ring 0 instruction"; + +/* +#define FLAG_LOCK (1 << 0) // The instruction locks memory access. +#define FLAG_REPNZ (1 << 1) // The instruction is prefixed with a REPNZ. +#define FLAG_REP (1 << 2) // The instruction is prefixed with a REP, this can be a REPZ, it depends on the specific instruction. +#define FLAG_HINT_TAKEN (1 << 3) // Indicates there is a hint taken for Jcc instructions only. +#define FLAG_HINT_NOT_TAKEN (1 << 4) // Indicates there is a hint non-taken for Jcc instructions only. +#define FLAG_IMM_SIGNED (1 << 5) // The Imm value is signed extended (E.G in 64 bit decoding mode, a 32 bit imm is usually sign extended into 64 bit imm). +#define FLAG_DST_WR (1 << 6) // The destination operand is writable. +#define FLAG_GET_OPSIZE(flags) (((flags) >> 8) & 3) +#define FLAG_GET_ADDRSIZE(flags) (((flags) >> 10) & 3) +#define FLAG_GET_PREFIX(flags) ((flags) & 7) // To get the LOCK/REPNZ/REP prefixes. +*/ + + EmuLog(LOG_LEVEL::DEBUG, output.str().c_str()); +} + +int EmuX86_OpcodeSize(uint8_t *Eip) +{ + _DInst info; + if (EmuX86_DecodeOpcode((uint8_t*)Eip, info)) + return info.size; + + EmuLog(LOG_LEVEL::WARNING, "Error decoding opcode size at 0x%.8X", Eip); + return 1; +} + +bool EmuX86_DecodeException(LPEXCEPTION_POINTERS e) +{ + // Decoded instruction information. + // Opcode handler note : + // If an opcode or one of it's operand can't be decoded, that's a clear failure. + // However, if for any reason, an opcode operand cannot be read from or written to, + // that case may be logged, but it shouldn't fail the opcode handler. + _DInst info; + DWORD StartingEip = e->ContextRecord->Eip; + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { + EmuLog(LOG_LEVEL::DEBUG, "Starting instruction emulation from 0x%08X", e->ContextRecord->Eip); + } + + // Execute op-codes until we hit an unhandled instruction, or an error occurs + //while (true) + // TODO: Find where the weird memory addresses come from when using the above case + // There is obviously something wrong with one or more of our instruction implementations + // For now, we only execute one instruction at a time... + for (int x=0;x<1;x++) + { + if (!EmuX86_DecodeOpcode((uint8_t*)e->ContextRecord->Eip, info)) { + EmuLog(LOG_LEVEL::WARNING, "Error decoding opcode at 0x%08X", e->ContextRecord->Eip); + assert(false); + return false; + } + + LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { + EmuX86_DistormLogInstruction((uint8_t*)e->ContextRecord->Eip, info); + } + + switch (info.opcode) { // Keep these cases alphabetically ordered and condensed + case I_ADD: + if (EmuX86_Opcode_ADD(e, info)) break; + goto opcode_error; + case I_AND: + if (EmuX86_Opcode_AND(e, info)) break; + goto opcode_error; + case I_CALL: + // RET and CALL always signify the end of a code block + return true; + case I_CDQ: // = 250 : Convert Doubleword to Quadword + EmuX86_Opcode_CDQ(e, info); + break; + case I_CLI: { // = 502 : Disable all interrupts + EmuX86_Opcode_CLI(); + break; + } + case I_CMP: + if (EmuX86_Opcode_CMP(e, info)) break; + goto opcode_error; + case I_CMPXCHG: + if (EmuX86_Opcode_CMPXCHG(e, info)) break; + goto opcode_error; + case I_CPUID: + EmuX86_Opcode_CPUID(e, info); + break; + case I_DEC: + if (EmuX86_Opcode_DEC(e, info)) break; + goto opcode_error; +#if 0 // TODO : Implement EmuX86_Opcode_IMUL and enable this : + case I_IMUL: { // = 117 : Signed Multiply + if (EmuX86_Opcode_IMUL(e, info)) break; + goto opcode_error; + } +#endif + case I_IN: + if (EmuX86_Opcode_IN(e, info)) break; + goto opcode_error; + case I_INC: + if (EmuX86_Opcode_INC(e, info)) break; + goto opcode_error; + case I_INVD: // = 555 : Flush internal caches; initiate flushing of external caches. + break; // Privileged Level (Ring 0) Instruction. Causes a priviledge instruction exception - We can safely ignore this + case I_INVLPG: { // = 1727 + // This instruction invalidates the TLB entry specified with the source operand. Since we don't emulate + // the TLB yet, we can safely ignore this. Test case: Fable. + break; + } + case I_JA: { // = 166 : Jump if above (CF=0 and ZF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_CF(e) && !EmuX86_HasFlag_ZF(e))) { + continue; + } + break; + } + case I_JAE: { // = 147 : Jump if above or equal (CF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_CF(e))) { + continue; + } + break; + } + case I_JB: { // = 143 : Jump if below (CF=1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_CF(e))) { + continue; + } + break; + } + case I_JBE: { // = 161 : Jump if below or equal (CF=1 or ZF=1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_CF(e) || EmuX86_HasFlag_ZF(e))) { + continue; + } + break; + } + case I_JCXZ: { // = 427 : Jump if CX register is 0. + if (EmuX86_Opcode_Jcc(e, info, ((e->ContextRecord->Ecx & 0xFF) == 0))) { + continue; + } + break; + } + case I_JECXZ: { // = 433 : Jump if ECX register is 0. + if (EmuX86_Opcode_Jcc(e, info, e->ContextRecord->Ecx == 0)) { + continue; + } + break; + } + case I_JG: { // = 202 : Jump if greater (ZF=0 and SF=OF). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_ZF(e) && (EmuX86_HasFlag_SF(e) == EmuX86_HasFlag_OF(e)))) { + continue; + } + break; + } + case I_JGE: { // = 192 : Jump if greater or equal (SF=OF). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_SF(e) == EmuX86_HasFlag_OF(e))) { + continue; + } + break; + } + case I_JL: { // = 188 : Jump if less (SF<>OF). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_SF(e) != EmuX86_HasFlag_OF(e))) { + continue; + } + break; + } + case I_JLE: { // = 197 : Jump if less or equal (ZF=1 or SF<>OF). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_ZF(e) || (EmuX86_HasFlag_SF(e) != EmuX86_HasFlag_OF(e)))) { + continue; + } + break; + } + case I_JMP: // = 462 : Jump + case I_JMP_FAR: { // = 467 : Jump + if (EmuX86_Opcode_JMP(e, info)) { + continue; + } + break; + } + case I_JNO: { // = 138 : Jump if not overflow (OF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_OF(e))) { + continue; + } + break; + } + case I_JNP: { // = 183 : Jump if not parity (PF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_PF(e))) { + continue; + } + break; + } + case I_JNS: { // = 174 : Jump if not sign (SF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_SF(e))) { + continue; + } + break; + } + case I_JNZ: { // = 156 : Jump if not zero (ZF=0). + if (EmuX86_Opcode_Jcc(e, info, !EmuX86_HasFlag_ZF(e))) { + continue; + } + break; + } + case I_JO: { // = 134 : Jump if overflow (OF=1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_OF(e))) { + continue; + } + break; + } + case I_JP: { // = 179 : Jump if parity (PF=1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_PF(e))) { + continue; + } + break; + } + case I_JS: { // = 170 : Jump if sign (SF=1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_SF(e))) { + continue; + } + break; + } + case I_JZ: { // = 152 : Jump if zero (ZF = 1). + if (EmuX86_Opcode_Jcc(e, info, EmuX86_HasFlag_ZF(e))) { + continue; + } + break; + } + case I_LEA: { // = 223 : Load Effective Address + if (EmuX86_Opcode_LEA(e, info)) break; + goto opcode_error; + } + case I_LEAVE: + // LEAVE often precedes RET - end of a code block + return true; + case I_LFENCE: { // = 4287 : Serializes load operations. + __asm { lfence }; // emulate as-is (doesn't cause exceptions) + break; + } + case I_MFENCE: { // = 4313 : Serializes load and store operations. + __asm { mfence }; // emulate as-is (doesn't cause exceptions) + break; + } + case I_MOV: + if (EmuX86_Opcode_MOV(e, info)) break; + goto opcode_error; + case I_MOVSX: + if (EmuX86_Opcode_MOVSX(e, info)) break; + goto opcode_error; + case I_MOVZX: + if (EmuX86_Opcode_MOVZX(e, info)) break; + goto opcode_error; + case I_NEG: + if (EmuX86_Opcode_NEG(e, info)) break; + goto opcode_error; + case I_NOP: + break; + case I_NOT: + if (EmuX86_Opcode_NOT(e, info)) break; + goto opcode_error; + case I_OR: + if (EmuX86_Opcode_OR(e, info)) break; + goto opcode_error; + case I_OUT: + if (EmuX86_Opcode_OUT(e, info)) break; + goto opcode_error; + case I_POP: { // = 22 : Pop a Value from the Stack + if (EmuX86_Opcode_POP(e, info)) break; + goto opcode_error; + } + case I_PUSH: { // = 16 : Push Word or Doubleword Onto the Stack + if (EmuX86_Opcode_PUSH(e, info)) break; + goto opcode_error; + } + // TODO : case I_RDPMC: // = 607 : Read Performance-Monitoring Counters; Privileged Level (Ring 0) Instruction. Causes a priviledge instruction exception + case I_RDTSC: // = 593 : Read Time-Stamp Counter + EmuX86_Opcode_RDTSC(e); + break; + case I_RET: + // RET and CALL always signify the end of a code block + return true; + case I_SAR: // = 1002 : Shift arithmetic right + EmuX86_Opcode_SAR(e, info); + break; + case I_SBB: + if (EmuX86_Opcode_SBB(e, info)) break; + goto opcode_error; + case I_SETA: { // Set byte if above (CF=0 and ZF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_CF(e) && !EmuX86_HasFlag_ZF(e))) break; + goto opcode_error; + } + case I_SETAE: { // Set byte if above or equal (CF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_CF(e))) break; + goto opcode_error; + } + case I_SETB: { // Set byte if below (CF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_CF(e))) break; + goto opcode_error; + } + case I_SETBE: { // Set byte if below or equal (CF=1 or ZF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_CF(e) || EmuX86_HasFlag_ZF(e))) break; + goto opcode_error; + } + case I_SETG: { // Set byte if greater (ZF=0 and SF=OF). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_ZF(e) && (EmuX86_HasFlag_SF(e) == EmuX86_HasFlag_OF(e)))) break; + goto opcode_error; + } + case I_SETGE: { // Set byte if greater or equal (SF=OF). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_SF(e) == EmuX86_HasFlag_OF(e))) break; + goto opcode_error; + } + case I_SETL: { // Set byte if less (SF<>OF). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_SF(e) != EmuX86_HasFlag_OF(e))) break; + goto opcode_error; + } + case I_SETLE: { // Set byte if less or equal (ZF=1 or SF<>OF). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_ZF(e) || (EmuX86_HasFlag_SF(e) != EmuX86_HasFlag_OF(e)))) break; + goto opcode_error; + } + case I_SETNO: { // Set byte if not overflow (OF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_OF(e))) break; + goto opcode_error; + } + case I_SETNP: { // Set byte if not parity (PF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_PF(e))) break; + goto opcode_error; + } + case I_SETNS: { // Set byte if not sign (SF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_SF(e))) break; + goto opcode_error; + } + case I_SETNZ: { // Set byte if not zero (ZF=0). + if (EmuX86_Opcode_SETcc(e, info, !EmuX86_HasFlag_ZF(e))) break; + goto opcode_error; + } + case I_SETO: { // Set byte if overflow (OF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_OF(e))) break; + goto opcode_error; + } + case I_SETP: { // Set byte if parity (PF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_PF(e))) break; + goto opcode_error; + } + case I_SETS: { // Set byte if sign (SF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_SF(e))) break; + goto opcode_error; + } + case I_SETZ: { // Set byte if zero (ZF=1). + if (EmuX86_Opcode_SETcc(e, info, EmuX86_HasFlag_ZF(e))) break; + goto opcode_error; + } + case I_SFENCE: { // = 4343 : Serializes store operations. + __asm { sfence }; // emulate as-is (doesn't cause exceptions) + break; + } + case I_SHL: + if (EmuX86_Opcode_SHL(e, info)) break; + goto opcode_error; + case I_SHR: + if (EmuX86_Opcode_SHR(e, info)) break; + goto opcode_error; + case I_STI: { + // Enable all interrupts + EmuX86_Opcode_STI(); + break; + } + case I_STOS: { + // Handle REP prefix (if set, repeat ECX times) + int counter = 1; + if (FLAG_GET_PREFIX(info.flags) == FLAG_REP) { + counter = e->ContextRecord->Ecx; + // Make sure ECX is zero when the loop ends + e->ContextRecord->Ecx = 0; + } + + while (counter != 0) { + if (EmuX86_Opcode_STOS(e, info)) { + counter--; + continue; + } + + goto opcode_error; + } + break; + } + case I_SUB: + if (EmuX86_Opcode_SUB(e, info)) break; + goto opcode_error; + case I_TEST: + if (EmuX86_Opcode_TEST(e, info)) break; + goto opcode_error; + case I_WBINVD: // Write back and flush internal caches; initiate writing-back and flushing of external caches. + break; // Privileged Level (Ring 0) Instruction. Causes a priviledge instruction exception - We can safely ignore this + case I_WRMSR: + // We do not emulate processor specific registers just yet + // Some titles attempt to manually set the TSC via this instruction + // This needs fixing eventually, but should be acceptible to ignore for now! + // test-case : Chase: Hollywood Stunt Driver + EmuLog(LOG_LEVEL::WARNING, "WRMSR instruction ignored"); + break; + case I_XOR: + if (EmuX86_Opcode_XOR(e, info)) break; + goto opcode_error; + default: + EmuLog(LOG_LEVEL::DEBUG, "Unhandled instruction : %s (%u)", Distorm_OpcodeString(info.opcode), info.opcode); + // HACK: If we hit an unhandled instruction, log and skip it + e->ContextRecord->Eip += info.size; + return true; + } // switch info.opcode + + e->ContextRecord->Eip += info.size; + } // while true + + return true; + +opcode_error: + EmuLog(LOG_LEVEL::WARNING, "0x%08X: Error while handling instruction %s (%u)", e->ContextRecord->Eip, Distorm_OpcodeString(info.opcode), info.opcode); + assert(false); + return false; +} + +void EmuX86_Init() +{ + EmuLog(LOG_LEVEL::DEBUG, "Initializing distorm version %d", distorm_version()); + + AddVectoredExceptionHandler(/*FirstHandler=*/ULONG(true), lleException); + + EmuX86_InitContextRecordOffsetByRegisterType(); + EmuX86_InitMemoryBackedRegisters(); +} diff --git a/src/CxbxKrnl/EmuX86.h b/src/devices/x86/EmuX86.h similarity index 84% rename from src/CxbxKrnl/EmuX86.h rename to src/devices/x86/EmuX86.h index 6b2423c5a..0390e0c34 100644 --- a/src/CxbxKrnl/EmuX86.h +++ b/src/devices/x86/EmuX86.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuX86.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/CxbxKrnl/DbgConsole.cpp b/src/gui/DbgConsole.cpp similarity index 71% rename from src/CxbxKrnl/DbgConsole.cpp rename to src/gui/DbgConsole.cpp index 34c34ce85..a7d3937d4 100644 --- a/src/CxbxKrnl/DbgConsole.cpp +++ b/src/gui/DbgConsole.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->DbgConsole.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,13 +25,11 @@ // * All rights reserved // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ -#include "CxbxKrnl.h" -#include "Emu.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" #include "DbgConsole.h" -#include "ResourceTracker.h" -#include "EmuXTL.h" +#include "core\hle\D3D8\ResourceTracker.h" #include @@ -110,7 +99,6 @@ void DbgConsole::Reset() m_szInput[0] = '\0'; } -#if defined(_DEBUG_TRACK_VB) typedef enum _ETAction { ETA_ENABLE = 0, @@ -170,7 +158,6 @@ static void EnableTracker(ResourceTracker &trackTotal, ResourceTracker &tracker, return; } -#endif void DbgConsole::ParseCommand() { @@ -193,12 +180,12 @@ void DbgConsole::ParseCommand() printf("CxbxDbg: Quit/Exit [Q] : Stop Emulation\n"); printf("CxbxDbg: Trace [T] : Toggle Debug Trace\n"); - #ifdef _DEBUG_TRACK_VB - printf("CxbxDbg: ListVB [LVB] : List Active Vertex Buffers\n"); - printf("CxbxDbg: DisableVB [DVB #] : Disable Active Vertex Buffer(s)\n"); - printf("CxbxDbg: EnableVB [EVB #] : Enable Active Vertex Buffer(s)\n"); - printf("CxbxDbg: DumpStreamCache [DSC] : Dumps the patched streams cache\n"); - #endif + LOG_CHECK_ENABLED_EX(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) { + printf("CxbxDbg: ListVB [LVB] : List Active Vertex Buffers\n"); + printf("CxbxDbg: DisableVB [DVB #] : Disable Active Vertex Buffer(s)\n"); + printf("CxbxDbg: EnableVB [EVB #] : Enable Active Vertex Buffer(s)\n"); + printf("CxbxDbg: DumpStreamCache [DSC] : Dumps the patched streams cache\n"); + } #ifdef _DEBUG_ALLOC printf("CxbxDbg: DumpMem [DMEM] : Dump the heap allocation tracking table\n"); @@ -212,72 +199,76 @@ void DbgConsole::ParseCommand() else if(_stricmp(szCmd, "q") == 0 || _stricmp(szCmd, "quit") == 0 || _stricmp(szCmd, "exit") == 0) { printf("CxbxDbg: Goodbye...\n"); - CxbxKrnlCleanup(NULL); + CxbxKrnlCleanupEx(CXBXR_MODULE::GUI, NULL); } else if(_stricmp(szCmd, "t") == 0 || _stricmp(szCmd, "trace") == 0) { g_bPrintfOn = !g_bPrintfOn; printf("CxbxDbg: Trace is now %s\n", g_bPrintfOn ? "ON" : "OFF"); } - #ifdef _DEBUG_TRACK_VB else if(_stricmp(szCmd, "lvb") == 0 || _stricmp(szCmd, "ListVB") == 0) - { - int v=0; + { + LOG_CHECK_ENABLED_EX(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) { + int v = 0; - g_VBTrackTotal.Lock(); + g_VBTrackTotal.Lock(); - RTNode *cur = g_VBTrackTotal.getHead(); + RTNode *cur = g_VBTrackTotal.getHead(); - while(cur != NULL && cur->pNext != NULL) - { - bool enabled = g_VBTrackDisable.exists(cur->pResource); + while (cur != NULL && cur->pNext != NULL) + { + bool enabled = g_VBTrackDisable.exists(cur->pResource); - printf("CxbxDbg: %.2d : 0x%p (%s)\n", v++, cur->pResource, enabled ? "enabled" : "disabled"); + printf("CxbxDbg: %.2d : 0x%p (%s)\n", v++, cur->pResource, enabled ? "enabled" : "disabled"); - cur = cur->pNext; - } + cur = cur->pNext; + } - g_VBTrackTotal.Unlock(); + g_VBTrackTotal.Unlock(); + } } else if(_stricmp(szCmd, "dvb") == 0 || _stricmp(szCmd, "DisableVB") == 0) - { - int n=0, m=0; + { + LOG_CHECK_ENABLED_EX(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) { + int n = 0, m = 0; - int c = sscanf(m_szInput, "%*s %d-%d", &n, &m); + int c = sscanf(m_szInput, "%*s %d-%d", &n, &m); - if(c == 1) - { - EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_DISABLE); - } - else if(c == 2) - { - EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_DISABLE); - } - else - { - printf("CxbxDbg: Syntax Incorrect (dvb #)\n"); - } + if (c == 1) + { + EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_DISABLE); + } + else if (c == 2) + { + EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_DISABLE); + } + else + { + printf("CxbxDbg: Syntax Incorrect (dvb #)\n"); + } + } } else if(_stricmp(szCmd, "evb") == 0 || _stricmp(szCmd, "EnableVB") == 0) - { - int n=0, m=0; + { + LOG_CHECK_ENABLED_EX(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) { + int n = 0, m = 0; - int c = sscanf(m_szInput, "%*s %d-%d", &n, &m); + int c = sscanf(m_szInput, "%*s %d-%d", &n, &m); - if(c == 1) - { - EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_ENABLE); - } - else if(c == 2) - { - EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_ENABLE); - } - else - { - printf("CxbxDbg: Syntax Incorrect (dvb #)\n"); - } + if (c == 1) + { + EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_ENABLE); + } + else if (c == 2) + { + EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_ENABLE); + } + else + { + printf("CxbxDbg: Syntax Incorrect (dvb #)\n"); + } + } } - #endif #ifdef _DEBUG_ALLOC else if(_stricmp(szCmd, "dmem") == 0 || _stricmp(szCmd, "DumpMem") == 0) { diff --git a/src/CxbxKrnl/DbgConsole.h b/src/gui/DbgConsole.h similarity index 78% rename from src/CxbxKrnl/DbgConsole.h rename to src/gui/DbgConsole.h index 90e0379f8..6e4bf985b 100644 --- a/src/CxbxKrnl/DbgConsole.h +++ b/src/gui/DbgConsole.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->CxbxKrnl->EmuD3D8->VertexShader.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -55,7 +46,7 @@ class DbgConsole private: // keyboard buffer char m_szInput[1024]; - uint m_cur; + unsigned int m_cur; }; #endif diff --git a/src/Cxbx/DlgAbout.cpp b/src/gui/DlgAbout.cpp similarity index 72% rename from src/Cxbx/DlgAbout.cpp rename to src/gui/DlgAbout.cpp index e9260b1e5..e8f9d572a 100644 --- a/src/Cxbx/DlgAbout.cpp +++ b/src/gui/DlgAbout.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgAbout.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,11 +25,12 @@ // * // ****************************************************************** -#include "CxbxKrnl/EmuShared.h" +#include "EmuShared.h" #include "CxbxVersion.h" #include "DlgAbout.h" #include "ResCxbx.h" +#include "common\util\CxbxUtil.h" #include #include @@ -47,7 +39,7 @@ // Array of tab pane handles std::vector aboutTabPanes; // Current (active) tab pane index -uint aboutCurrentTab = 0; +unsigned int aboutCurrentTab = 0; /*! windows dialog procedure */ static INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -55,7 +47,7 @@ static INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPA VOID ShowAboutDialog(HWND hwnd) { /*! show dialog box */ - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hwnd, DlgAboutProc); + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_ABOUT), hwnd, DlgAboutProc); } INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -66,7 +58,7 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { // Set the dialog icon HICON hIcon = (HICON)LoadImageW( - GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDI_CXBX), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_DEFAULTSIZE + GetModuleHandleW(nullptr), MAKEINTRESOURCEW(IDI_CXBX), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_DEFAULTSIZE ); SendMessageW(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon); @@ -86,16 +78,21 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa // Get tab pane dimensions RECT tabRect; GetClientRect(GetDlgItem(hWndDlg, IDC_TAB1), &tabRect); - SendMessage(GetDlgItem(hWndDlg, IDC_TAB1), TCM_ADJUSTRECT, FALSE, (LPARAM)&tabRect); + SendMessage(GetDlgItem(hWndDlg, IDC_TAB1), TCM_ADJUSTRECT, FALSE, (LPARAM)&tabRect); // Tab Pane 1 + char TabPane1Message[270]; + sprintf(TabPane1Message, "\nCxbx-Reloaded\nVersion %s\n The Cxbx-Reloaded Team" + "\nThis software comes with ABSOLUTELY NO WARRANTY." + "\nThis is free software, and you are welcome to redistribute it" + "\nunder certain conditions; See our website for details.", CxbxVersionStr); HWND tab = CreateWindowEx - (NULL, "STATIC", "\nCxbx-Reloaded\nVersion " _CXBX_VERSION "\n The Cxbx-Reloaded Team", + (NULL, "STATIC", TabPane1Message, WS_CHILD | WS_VISIBLE, tabRect.left + 10, tabRect.top + 10, tabRect.right - tabRect.left, tabRect.bottom - tabRect.top, GetDlgItem(hWndDlg, IDC_TAB1), (HMENU)1, - GetModuleHandle(NULL), NULL + GetModuleHandle(nullptr), nullptr ); SendMessage(tab, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE); @@ -103,22 +100,24 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa aboutTabPanes.push_back(tab); // Tab Pane 2 - HRSRC rContributors = FindResource(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_CONTRIBUTORS), "TXT"); + HRSRC rContributors = FindResource(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDR_CONTRIBUTORS), "TXT"); std::string contributors = "\n"; contributors += std::string( - (char*)LockResource(LoadResource(GetModuleHandle(NULL), rContributors)), - SizeofResource(GetModuleHandle(NULL), rContributors) + (char*)LockResource(LoadResource(GetModuleHandle(nullptr), rContributors)), + SizeofResource(GetModuleHandle(nullptr), rContributors) ); + unix2dos(contributors); + tab = CreateWindowEx( - NULL, "EDIT", contributors.c_str(), + 0, "EDIT", contributors.c_str(), WS_CHILD | WS_VSCROLL |ES_MULTILINE | ES_READONLY, tabRect.left + 10, tabRect.top + 10, tabRect.right - tabRect.left, tabRect.bottom - tabRect.top, GetDlgItem(hWndDlg, IDC_TAB1), (HMENU)1, - GetModuleHandle(NULL), NULL + GetModuleHandle(nullptr), nullptr ); SendMessage(tab, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE); @@ -126,22 +125,24 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa aboutTabPanes.push_back(tab); // Tab Pane 3 - HRSRC rCopying = FindResource(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_COPYING), "TXT"); + HRSRC rCopying = FindResource(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDR_COPYING), "TXT"); std::string copying = "\n"; copying += std::string( - (char*)LockResource(LoadResource(GetModuleHandle(NULL), rCopying)), - SizeofResource(GetModuleHandle(NULL), rCopying) + (char*)LockResource(LoadResource(GetModuleHandle(nullptr), rCopying)), + SizeofResource(GetModuleHandle(nullptr), rCopying) ); + unix2dos(copying); + tab = CreateWindowEx( - NULL, "EDIT", copying.c_str(), + 0, "EDIT", copying.c_str(), WS_CHILD | WS_VSCROLL | ES_MULTILINE | ES_READONLY, tabRect.left + 10, tabRect.top + 10, tabRect.right - tabRect.left, tabRect.bottom - tabRect.top, GetDlgItem(hWndDlg, IDC_TAB1), (HMENU)1, - GetModuleHandle(NULL), NULL + GetModuleHandle(nullptr), nullptr ); SendMessage(tab, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE); @@ -149,7 +150,8 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa aboutTabPanes.push_back(tab); aboutCurrentTab = 0; - UpdateWindow(hWndDlg); + UpdateWindow(hWndDlg); + } break; @@ -179,7 +181,7 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa case WM_NOTIFY: { - uint index = SendMessage(GetDlgItem(hWndDlg, IDC_TAB1), TCM_GETCURSEL, 0, 0); + unsigned int index = SendMessage(GetDlgItem(hWndDlg, IDC_TAB1), TCM_GETCURSEL, 0, 0); // Do nothing if the tab hasnt been changed, or if we try to load a non existant tab if (index == aboutCurrentTab || index >= aboutTabPanes.size()) { @@ -187,7 +189,9 @@ INT_PTR CALLBACK DlgAboutProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa } // Show the selected tab pane - ShowWindow(aboutTabPanes[aboutCurrentTab], SW_HIDE); ShowWindow(aboutTabPanes[index], SW_SHOW); + ShowWindow(aboutTabPanes[aboutCurrentTab], SW_HIDE); + ShowWindow(aboutTabPanes[index], SW_SHOW); + aboutCurrentTab = index; } break; diff --git a/src/Cxbx/DlgAbout.h b/src/gui/DlgAbout.h similarity index 76% rename from src/Cxbx/DlgAbout.h rename to src/gui/DlgAbout.h index b5df459aa..b47633e10 100644 --- a/src/Cxbx/DlgAbout.h +++ b/src/gui/DlgAbout.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->DlgAbout.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Cxbx/DlgAudioConfig.cpp b/src/gui/DlgAudioConfig.cpp similarity index 82% rename from src/Cxbx/DlgAudioConfig.cpp rename to src/gui/DlgAudioConfig.cpp index 0509ef627..1cc4a98ff 100644 --- a/src/Cxbx/DlgAudioConfig.cpp +++ b/src/gui/DlgAudioConfig.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgAudioConfig.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,7 +25,7 @@ // * // ****************************************************************** -#include "CxbxKrnl/EmuShared.h" +#include "common\Settings.hpp" // for g_Settings #include "DlgAudioConfig.h" #include "ResCxbx.h" @@ -49,7 +40,7 @@ static BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrv static VOID RefreshAudioAdapter(); /*! audio configuration */ -static XBAudio g_XBAudio; +static Settings::s_audio g_XBAudio; /*! changes flag */ static BOOL g_bHasChanges = FALSE; /*! handle to audio adapter list window */ @@ -61,10 +52,10 @@ VOID ShowAudioConfig(HWND hwnd) g_bHasChanges = FALSE; /*! retrieve audio configuration */ - g_EmuShared->GetXBAudio(&g_XBAudio); + g_XBAudio = g_Settings->m_audio; /*! show dialog box */ - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_AUDIO_CFG), hwnd, DlgAudioConfigProc); + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_AUDIO_CFG), hwnd, DlgAudioConfigProc); } BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext) @@ -82,7 +73,7 @@ BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, L binGUID = { 0 }; } - GUID curGUID = g_XBAudio.GetAudioAdapter(); + GUID curGUID = g_XBAudio.adapterGUID; /*! activate configured audio adapter */ if (curGUID == binGUID) { @@ -101,14 +92,14 @@ INT_PTR CALLBACK DlgAudioConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR g_hAudioAdapter = GetDlgItem(hWndDlg, IDC_AC_AUDIO_ADAPTER); /*! set window icon */ - SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); /*! enumerate audio adapters */ { SendMessage(g_hAudioAdapter, CB_RESETCONTENT, 0, 0); - XTL::DirectSoundEnumerate(&DSEnumProc, NULL); + DirectSoundEnumerate(&DSEnumProc, nullptr); } /*! refresh UI based on currently selected audio adapter */ @@ -116,11 +107,13 @@ INT_PTR CALLBACK DlgAudioConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR /*! check appropriate options */ { - SendMessage(GetDlgItem(hWndDlg, IDC_AC_PCM), BM_SETCHECK, (WPARAM)g_XBAudio.GetPCM(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_AC_PCM), BM_SETCHECK, (WPARAM)g_XBAudio.codec_pcm, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_AC_XADPCM), BM_SETCHECK, (WPARAM)g_XBAudio.GetXADPCM(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_AC_XADPCM), BM_SETCHECK, (WPARAM)g_XBAudio.codec_xadpcm, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_AC_UNKNOWN_CODEC), BM_SETCHECK, (WPARAM)g_XBAudio.GetUnknownCodec(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_AC_UNKNOWN_CODEC), BM_SETCHECK, (WPARAM)g_XBAudio.codec_unknown, 0); + + SendMessage(GetDlgItem(hWndDlg, IDC_AC_MUTE_ON_UNFOCUS_DISABLE), BM_SETCHECK, (WPARAM)g_XBAudio.mute_on_unfocus==0, 0); } } break; @@ -163,21 +156,25 @@ INT_PTR CALLBACK DlgAudioConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR /*! save PCM/XADPCM/UnknownCodec options */ { - LRESULT lRet = SendMessage(GetDlgItem(hWndDlg, IDC_AC_PCM), BM_GETCHECK, 0, 0); + LRESULT lRet = SendMessage(GetDlgItem(hWndDlg, IDC_AC_PCM), BM_GETCHECK, 0, 0); - g_XBAudio.SetPCM(lRet == BST_CHECKED); + g_XBAudio.codec_pcm = (lRet == BST_CHECKED); lRet = SendMessage(GetDlgItem(hWndDlg, IDC_AC_XADPCM), BM_GETCHECK, 0, 0); - g_XBAudio.SetXADPCM(lRet == BST_CHECKED); + g_XBAudio.codec_xadpcm = (lRet == BST_CHECKED); lRet = SendMessage(GetDlgItem(hWndDlg, IDC_AC_UNKNOWN_CODEC), BM_GETCHECK, 0, 0); - g_XBAudio.SetUnknownCodec(lRet == BST_CHECKED); + g_XBAudio.codec_unknown = (lRet == BST_CHECKED); + + lRet = SendMessage(GetDlgItem(hWndDlg, IDC_AC_MUTE_ON_UNFOCUS_DISABLE), BM_GETCHECK, 0, 0); + + g_XBAudio.mute_on_unfocus = (lRet != BST_CHECKED); } /*! save audio configuration */ - g_EmuShared->SetXBAudio(&g_XBAudio); + g_Settings->m_audio = g_XBAudio; EndDialog(hWndDlg, wParam); } @@ -203,7 +200,7 @@ VOID RefreshAudioAdapter() { /*! save configured audio adapter */ { - GUID oldGUID = g_XBAudio.GetAudioAdapter(); + GUID oldGUID = g_XBAudio.adapterGUID; DWORD dwAudioAdapter = (DWORD)SendMessage(g_hAudioAdapter, CB_GETCURSEL, 0, 0); @@ -222,13 +219,13 @@ VOID RefreshAudioAdapter() if(binGUID != oldGUID) { g_bHasChanges = TRUE; - g_XBAudio.SetAudioAdapter(binGUID); + g_XBAudio.adapterGUID = binGUID; } // Force save default audio device if selected audio device is invalid. if (pGUID == (LPGUID)CB_ERR) { SendMessage(g_hAudioAdapter, CB_SETCURSEL, 0, 0); - g_EmuShared->SetXBAudio(&g_XBAudio); + g_Settings->m_audio = g_XBAudio; MessageBox(nullptr, "Your selected audio adapter is invalid,\n" "reverting to default audio adapter.", "Cxbx-Reloaded", MB_OK | MB_ICONEXCLAMATION); } diff --git a/src/Cxbx/DlgAudioConfig.h b/src/gui/DlgAudioConfig.h similarity index 76% rename from src/Cxbx/DlgAudioConfig.h rename to src/gui/DlgAudioConfig.h index ff12b1447..12df31402 100644 --- a/src/Cxbx/DlgAudioConfig.h +++ b/src/gui/DlgAudioConfig.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgAudioConfig.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/gui/DlgDukeControllerConfig.cpp b/src/gui/DlgDukeControllerConfig.cpp new file mode 100644 index 000000000..13ae0fe7c --- /dev/null +++ b/src/gui/DlgDukeControllerConfig.cpp @@ -0,0 +1,247 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "Windows.h" +#include "ResCxbx.h" +#include "input\InputWindow.h" +#include "gui\DlgInputConfig.h" + + +static INT_PTR CALLBACK DlgRumbleConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +INT_PTR CALLBACK DlgXidControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + int port_num = lParam & 0xFF; + int dev_type = (lParam & 0xFF00) >> 8; + + // Ensure that port_num is a valid xbox port + assert(port_num >= PORT_1 && port_num <= PORT_4); + + // Ensure that the controller type is valid + assert(dev_type == to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE) || + dev_type == to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S)); + + g_InputWindow = new InputWindow; + g_InputWindow->Initialize(hWndDlg, port_num, dev_type); + } + break; + + case WM_CLOSE: + { + if (g_InputWindow->IsProfileSaved()) { + delete g_InputWindow; + g_InputWindow = nullptr; + EndDialog(hWndDlg, wParam); + } + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_DEVICE_LIST: { + if (HIWORD(wParam) == CBN_SELCHANGE) { + g_InputWindow->UpdateCurrentDevice(); + } + } + break; + + case IDC_XID_PROFILE_NAME: { + if (HIWORD(wParam) == CBN_SELCHANGE) { + char name[50]; + HWND hwnd = GetDlgItem(hWndDlg, IDC_XID_PROFILE_NAME); + LRESULT str_idx = SendMessage(hwnd, CB_GETCURSEL, 0, 0); + if (str_idx != CB_ERR) { + SendMessage(hwnd, CB_GETLBTEXT, str_idx, reinterpret_cast(name)); + g_InputWindow->UpdateProfile(std::string(name), PROFILE_LOAD); + } + } + } + break; + + case IDC_XID_PROFILE_SAVE: + case IDC_XID_PROFILE_DELETE: { + if (HIWORD(wParam) == BN_CLICKED) { + char name[50]; + SendMessage(GetDlgItem(hWndDlg, IDC_XID_PROFILE_NAME), WM_GETTEXT, + sizeof(name), reinterpret_cast(name)); + g_InputWindow->UpdateProfile(std::string(name), (LOWORD(wParam) == IDC_XID_PROFILE_SAVE) ? PROFILE_SAVE : PROFILE_DELETE); + } + } + break; + + case IDC_XID_DEFAULT: { + if (HIWORD(wParam) == BN_CLICKED) { + g_InputWindow->BindDefault(); + } + } + break; + + case IDC_XID_CLEAR: { + if (HIWORD(wParam) == BN_CLICKED) { + if (MessageBox(hWndDlg, "Remove all button bindings. Ok?", "Cxbx-Reloaded", MB_OKCANCEL | MB_ICONINFORMATION | MB_APPLMODAL) == IDOK) { + g_InputWindow->ClearBindings(); + } + } + } + break; + + case IDC_REFRESH_DEVICES: { + if (HIWORD(wParam) == BN_CLICKED) { + g_InputWindow->UpdateDeviceList(); + } + } + break; + + case IDC_SET_X: + case IDC_SET_Y: + case IDC_SET_A: + case IDC_SET_B: + case IDC_SET_WHITE: + case IDC_SET_BLACK: + case IDC_SET_LTRIGGER: + case IDC_SET_RTRIGGER: + case IDC_SET_LTHUMB: + case IDC_SET_RTHUMB: + case IDC_SET_START: + case IDC_SET_BACK: + case IDC_SET_DPAD_LEFT: + case IDC_SET_DPAD_RIGHT: + case IDC_SET_DPAD_UP: + case IDC_SET_DPAD_DOWN: + case IDC_SET_LEFT_POSY: + case IDC_SET_LEFT_NEGX: + case IDC_SET_LEFT_NEGY: + case IDC_SET_LEFT_POSX: + case IDC_SET_RIGHT_POSY: + case IDC_SET_RIGHT_NEGY: + case IDC_SET_RIGHT_NEGX: + case IDC_SET_RIGHT_POSX: { + if (HIWORD(wParam) == BN_CLICKED) { + g_InputWindow->BindButton(LOWORD(wParam)); + } + } + break; + + case IDC_SET_MOTOR: { + if (HIWORD(wParam) == BN_CLICKED) { + // Show rumble dialog box + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_RUMBLE_CFG), hWndDlg, DlgRumbleConfigProc); + g_InputWindow->UpdateRumble(RUMBLE_UPDATE); + } + } + break; + } + } + break; + } + return FALSE; +} + +INT_PTR CALLBACK DlgRumbleConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + g_InputWindow->InitRumble(hWndDlg); + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_RUMBLE_LIST: { + g_InputWindow->UpdateRumble(RUMBLE_SET); + } + break; + + case IDC_RUMBLE_TEST: { + g_InputWindow->UpdateRumble(RUMBLE_TEST); + } + break; + } + } + break; + + case WM_CLOSE: + { + EndDialog(hWndDlg, wParam); + } + break; + } + return FALSE; +} + +LRESULT CALLBACK ProfileNameSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + switch (uMsg) + { + // Remove the window subclass when this window is destroyed + case WM_NCDESTROY: { + RemoveWindowSubclass(hWnd, ProfileNameSubclassProc, uIdSubclass); + } + break; + + // Override the default system behaviour and process WM_CHAR messages ourselves + case WM_GETDLGCODE: { + if (lParam) { + LPMSG lpmsg = reinterpret_cast(lParam); + if (lpmsg->message == WM_CHAR) { + return DLGC_WANTCHARS; + } + } + } + break; + + case WM_CHAR: + { + // Make sure that we only allow printable ascii characters and some special keys to delete characters + if (!((wParam >= ' ' && wParam <= '~') + || wParam == VK_CANCEL + || wParam == VK_CLEAR + || wParam == VK_DELETE + || wParam == VK_BACK)) + { + return FALSE; + } + } + break; + + // Don't allow pasting operations, they can be used to bypass the filtering done in WM_CHAR + case WM_PASTE: + return FALSE; + } + + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} diff --git a/src/gui/DlgDukeControllerConfig.h b/src/gui/DlgDukeControllerConfig.h new file mode 100644 index 000000000..f1208f818 --- /dev/null +++ b/src/gui/DlgDukeControllerConfig.h @@ -0,0 +1,30 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#pragma once + +INT_PTR CALLBACK DlgXidControllerConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/src/Cxbx/DlgEepromConfig.cpp b/src/gui/DlgEepromConfig.cpp similarity index 57% rename from src/Cxbx/DlgEepromConfig.cpp rename to src/gui/DlgEepromConfig.cpp index 292d68cf1..1f7964881 100644 --- a/src/Cxbx/DlgEepromConfig.cpp +++ b/src/gui/DlgEepromConfig.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgEepromConfig.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,17 +25,10 @@ // * // ****************************************************************** -#define _XBOXKRNL_DEFEXTRN_ - -// prevent name collisions -namespace xboxkrnl -{ - #include // For XC_VALUE_INDEX and XBOX_EEPROM -}; - -#include +#include +#include // For memcpy #include "EmuEEPROM.h" // For EEPROMInfo, EEPROMInfos -#include "CxbxKrnl\CxbxKrnl.h" +#include "core\kernel\init\CxbxKrnl.h" #include "DlgEepromConfig.h" #include "ResCxbx.h" #include @@ -112,18 +96,9 @@ void WriteEepromInMemory(HWND hDlg) // Serial number { - char Buffer[25]; + char Buffer[13]; SendMessage(GetDlgItem(hDlg, IDC_EE_SERIAL_NUMBER), WM_GETTEXT, 25, reinterpret_cast(Buffer)); - std::string hex(Buffer); - size_t len = hex.length(); - std::string ByteSequence; - for (unsigned int i = 0; i < len; i += 2) - { - std::string byte = hex.substr(i, 2); - char chr = static_cast(stol(byte, nullptr, 16)); - ByteSequence.push_back(chr); - } - std::memcpy(&pEEPROM_GUI->FactorySettings.SerialNumber, ByteSequence.c_str(), 12); + std::memcpy(&pEEPROM_GUI->FactorySettings.SerialNumber, Buffer, 12); } // Ethernet address @@ -239,7 +214,206 @@ void ShowEepromConfig(HWND hwnd) } // Show dialog box - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_EEPROM_CFG), hwnd, DlgEepromConfigProc); + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_EEPROM_CFG), hwnd, DlgEepromConfigProc); +} + +static void RefreshEepromDialog(HWND hWndDlg) +{ + int offset; + int starting_offset; + HWND hHandle; + uint32_t value; + + // Set window icon + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); + + // Initialize the values of the drop-down lists + offset = 0; + hHandle = GetDlgItem(hWndDlg, IDC_EE_XBOX_REGION); + for (auto i : { "North America" , "Japan" ,"Rest of the world", "Manufacturing" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->EncryptedSettings.GameRegion; + starting_offset = offset - 4; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_AVREGION); + for (auto i : { "NTSC-M, 60Hz" , "NTSC-J, 60Hz", "PAL, 50Hz" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->FactorySettings.AVRegion; + starting_offset = offset - 3; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_LANGUAGE); + for (auto i : { "English", "Japanese", "German", "French", "Spanish", "Italian", "Korean", "Chinese", "Portuguese" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.Language; + starting_offset = offset - 9; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + // The available AV settings depend on the current AV region so we must read those beforehand + hHandle = GetDlgItem(hWndDlg, IDC_EE_AVSETTINGS); + for (auto i : { "Normal", "Widescreen", "Letterbox" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.VideoFlags; + value &= ~(AV_FLAGS_60Hz | AV_FLAGS_HDTV_480p | AV_FLAGS_HDTV_720p | AV_FLAGS_HDTV_1080i); + starting_offset = offset - 3; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + if (pEEPROM_GUI->FactorySettings.AVRegion == (AV_FLAGS_50Hz | AV_STANDARD_PAL_I)) { + // Enable PAL 60Hz since the console is set to the PAL region + EnableWindow(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), TRUE); + EnableWindow(GetDlgItem(hWndDlg, IDC_EE_480P), FALSE); + EnableWindow(GetDlgItem(hWndDlg, IDC_EE_720P), FALSE); + EnableWindow(GetDlgItem(hWndDlg, IDC_EE_1080I), FALSE); + if (pEEPROM_GUI->UserSettings.VideoFlags & AV_FLAGS_60Hz) { + SendMessage(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), BM_SETCHECK, BST_CHECKED, 0); + } + } + else { + // Enable 480p, 720p and 1080i since the console is set to the NTSC region + uint32_t value = pEEPROM_GUI->UserSettings.VideoFlags; + if (value & AV_FLAGS_HDTV_480p) { + SendMessage(GetDlgItem(hWndDlg, IDC_EE_480P), BM_SETCHECK, BST_CHECKED, 0); + } + if (value & AV_FLAGS_HDTV_720p) { + SendMessage(GetDlgItem(hWndDlg, IDC_EE_720P), BM_SETCHECK, BST_CHECKED, 0); + } + if (value & AV_FLAGS_HDTV_1080i) { + SendMessage(GetDlgItem(hWndDlg, IDC_EE_1080I), BM_SETCHECK, BST_CHECKED, 0); + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_AUDIOSETTINGS); + for (auto i : { "Stereo", "Stereo, Dolby AC3", "Stereo, DTS", "Stereo, Dolby AC3, DTS", "Mono", "Mono, Dolby AC3", "Mono, DTS", + "Mono, Dolby AC3, DTS", "Dolby Surround", "Dolby Surround, Dolby AC3", "Dolby Surround, DTS", "Dolby Surround, Dolby AC3, DTS" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.AudioFlags; + starting_offset = offset - 12; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_GAME_PRTL_CRTL); + for (auto i : { "Rating pending", "Adults only", "Mature", "Teen", "Everyone", "Kids to adults", "Early childhood" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.ParentalControlGames; + starting_offset = offset - 7; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_MOVIE_PRTL_CRTL); + for (auto i : { "Max", "NC-17", "A", "5", "PG-13", "PG", "2", "G" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.ParentalControlMovies; + starting_offset = offset - 8; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + hHandle = GetDlgItem(hWndDlg, IDC_EE_DVDREGION); + for (auto i : { "Free", "USA, Canada", "Japan, Europe, Middle East, ...", "Southeast Asia, S. Korea, ...", "Latin America, Oceania", + "Africa, Russia, N. Korea, ...", "China", "Reserved for future use", "International venues" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); + offset++; + } + value = pEEPROM_GUI->UserSettings.DvdRegion; + starting_offset = offset - 9; + for (int i = starting_offset; i < offset; i++) { + if (value == ComboboxArray[i]) { + SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); + break; + } + } + + // Install the subclass procedure and display the current values of the parameters in the edit controls + { + int ByteLimit[] = { 8, 16, 12, 6, 16, 4 }; + uint8_t* Buffer[6]; + HWND hEditControlArray[6]; + int j = 0; + for (auto i : { IDC_EE_CONFOUNDER, IDC_EE_HDDKEY, IDC_EE_SERIAL_NUMBER, IDC_EE_MAC_ADDRESS, IDC_EE_ONLINE_KEY, IDC_EE_PRTL_PASS }) { + hEditControlArray[j] = GetDlgItem(hWndDlg, i); + Buffer[j] = new uint8_t[ByteLimit[j]]; + SetWindowSubclass(hEditControlArray[j], ControlSubclassProc, i, 0); + SendMessage(hEditControlArray[j], EM_SETLIMITTEXT, (i == IDC_EE_SERIAL_NUMBER ? ByteLimit[j] : ByteLimit[j] * 2), 0); + j++; + } + j = 0; + std::memcpy(Buffer[0], &pEEPROM_GUI->EncryptedSettings.Confounder, ByteLimit[0]); + std::memcpy(Buffer[1], &pEEPROM_GUI->EncryptedSettings.HDKey, ByteLimit[1]); + std::memcpy(Buffer[2], &pEEPROM_GUI->FactorySettings.SerialNumber, ByteLimit[2]); + std::memcpy(Buffer[3], &pEEPROM_GUI->FactorySettings.EthernetAddr, ByteLimit[3]); + std::memcpy(Buffer[4], &pEEPROM_GUI->FactorySettings.OnlineKey, ByteLimit[4]); + std::memcpy(Buffer[5], &pEEPROM_GUI->UserSettings.ParentalControlPassword, ByteLimit[5]); + for (auto i : Buffer) { + char* CharBuffer = new char[ByteLimit[j] * 2 + 1]; + for (int z = 0, y = 0; z < ByteLimit[j]; z++) { + // Special case for Serial Number: This field is textual + if (hEditControlArray[j] == GetDlgItem(hWndDlg, IDC_EE_SERIAL_NUMBER)) { + std::sprintf(&CharBuffer[y], "%c", i[z]); + y += 1; + } else { + std::sprintf(&CharBuffer[y], "%02X", i[z]); + y += 2; + } + } + SendMessage(hEditControlArray[j], WM_SETTEXT, 0, reinterpret_cast(CharBuffer)); + delete[] CharBuffer; CharBuffer = nullptr; + delete[] Buffer[j]; Buffer[j] = nullptr; + j++; + } + } } INT_PTR CALLBACK DlgEepromConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -248,195 +422,7 @@ INT_PTR CALLBACK DlgEepromConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPA { case WM_INITDIALOG: { - int offset; - int starting_offset; - HWND hHandle; - uint32_t value; - - // Set window icon - SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); - - // Initialize the values of the drop-down lists - offset = 0; - hHandle = GetDlgItem(hWndDlg, IDC_EE_XBOX_REGION); - for (auto i : { "North America" , "Japan" ,"Rest of the world", "Manufacturing" }) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->EncryptedSettings.GameRegion; - starting_offset = offset - 4; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_AVREGION); - for (auto i : { "NTSC-M, 60Hz" , "NTSC-J, 60Hz", "PAL, 50Hz" }) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->FactorySettings.AVRegion; - starting_offset = offset - 3; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_LANGUAGE); - for (auto i : { "English", "Japanese", "German", "French", "Spanish", "Italian", "Korean", "Chinese", "Portuguese" }) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.Language; - starting_offset = offset - 9; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - // The available AV settings depend on the current AV region so we must read those beforehand - hHandle = GetDlgItem(hWndDlg, IDC_EE_AVSETTINGS); - for (auto i : { "Normal", "Widescreen", "Letterbox" }) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.VideoFlags; - value &= ~(AV_FLAGS_60Hz | AV_FLAGS_HDTV_480p | AV_FLAGS_HDTV_720p | AV_FLAGS_HDTV_1080i); - starting_offset = offset - 3; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - if (pEEPROM_GUI->FactorySettings.AVRegion == (AV_FLAGS_50Hz | AV_STANDARD_PAL_I)) { - // Enable PAL 60Hz since the console is set to the PAL region - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), TRUE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_480P), FALSE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_720P), FALSE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_1080I), FALSE); - if (pEEPROM_GUI->UserSettings.VideoFlags & AV_FLAGS_60Hz) { - SendMessage(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), BM_SETCHECK, BST_CHECKED, 0); - } - } - else { - // Enable 480p, 720p and 1080i since the console is set to the NTSC region - uint32_t value = pEEPROM_GUI->UserSettings.VideoFlags; - if (value & AV_FLAGS_HDTV_480p) { - SendMessage(GetDlgItem(hWndDlg, IDC_EE_480P), BM_SETCHECK, BST_CHECKED, 0); - } - if (value & AV_FLAGS_HDTV_720p) { - SendMessage(GetDlgItem(hWndDlg, IDC_EE_720P), BM_SETCHECK, BST_CHECKED, 0); - } - if (value & AV_FLAGS_HDTV_1080i) { - SendMessage(GetDlgItem(hWndDlg, IDC_EE_1080I), BM_SETCHECK, BST_CHECKED, 0); - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_AUDIOSETTINGS); - for (auto i : {"Stereo", "Stereo, Dolby AC3", "Stereo, DTS", "Stereo, Dolby AC3, DTS", "Mono", "Mono, Dolby AC3", "Mono, DTS", - "Mono, Dolby AC3, DTS", "Dolby Surround", "Dolby Surround, Dolby AC3", "Dolby Surround, DTS", "Dolby Surround, Dolby AC3, DTS"}) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.AudioFlags; - starting_offset = offset - 12; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_GAME_PRTL_CRTL); - for (auto i : {"Rating pending", "Adults only", "Mature", "Teen", "Everyone", "Kids to adults", "Early childhood"}) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.ParentalControlGames; - starting_offset = offset - 7; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_MOVIE_PRTL_CRTL); - for (auto i : {"Max", "NC-17", "A", "5", "PG-13", "PG", "2", "G"}) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.ParentalControlMovies; - starting_offset = offset - 8; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - hHandle = GetDlgItem(hWndDlg, IDC_EE_DVDREGION); - for (auto i : {"Free", "USA, Canada", "Japan, Europe, Middle East, ...", "Southeast Asia, S. Korea, ...", "Latin America, Oceania", - "Africa, Russia, N. Korea, ...", "China", "Reserved for future use", "International venues"}) { - LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); - SendMessage(hHandle, CB_SETITEMDATA, index, ComboboxArray[offset]); - offset++; - } - value = pEEPROM_GUI->UserSettings.DvdRegion; - starting_offset = offset - 9; - for (int i = starting_offset; i < offset; i++) { - if (value == ComboboxArray[i]) { - SendMessage(hHandle, CB_SETCURSEL, i - starting_offset, 0); - break; - } - } - - // Install the subclass procedure and display the current values of the parameters in the edit controls - { - int ByteLimit[] = { 8, 16, 12, 6, 16, 4 }; - uint8_t* Buffer[6]; - HWND hEditControlArray[6]; - int j = 0; - for (auto i : { IDC_EE_CONFOUNDER, IDC_EE_HDDKEY, IDC_EE_SERIAL_NUMBER, IDC_EE_MAC_ADDRESS, IDC_EE_ONLINE_KEY, IDC_EE_PRTL_PASS }) { - hEditControlArray[j] = GetDlgItem(hWndDlg, i); - Buffer[j] = new uint8_t[ByteLimit[j]]; - SetWindowSubclass(hEditControlArray[j], ControlSubclassProc, 0, 0); - SendMessage(hEditControlArray[j], EM_SETLIMITTEXT, ByteLimit[j] * 2, 0); - j++; - } - j = 0; - std::memcpy(Buffer[0], &pEEPROM_GUI->EncryptedSettings.Confounder, ByteLimit[0]); - std::memcpy(Buffer[1], &pEEPROM_GUI->EncryptedSettings.HDKey, ByteLimit[1]); - std::memcpy(Buffer[2], &pEEPROM_GUI->FactorySettings.SerialNumber, ByteLimit[2]); - std::memcpy(Buffer[3], &pEEPROM_GUI->FactorySettings.EthernetAddr, ByteLimit[3]); - std::memcpy(Buffer[4], &pEEPROM_GUI->FactorySettings.OnlineKey, ByteLimit[4]); - std::memcpy(Buffer[5], &pEEPROM_GUI->UserSettings.ParentalControlPassword, ByteLimit[5]); - for (auto i : Buffer) { - char* CharBuffer = new char[ByteLimit[j] * 2 + 1]; - for (int z = 0, y = 0; z < ByteLimit[j]; z++) { - std::sprintf(&CharBuffer[y], "%02X", i[z]); - y += 2; - } - SendMessage(hEditControlArray[j], WM_SETTEXT, 0, reinterpret_cast(CharBuffer)); - delete[] CharBuffer; CharBuffer = nullptr; - delete[] Buffer[j]; Buffer[j] = nullptr; - j++; - } - } + RefreshEepromDialog(hWndDlg); // Reset changes flag g_bHasChanges = false; } @@ -483,25 +469,7 @@ INT_PTR CALLBACK DlgEepromConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPA std::memset(pEEPROM_GUI, 0, EEPROM_SIZE); EmuEEPROMReset(pEEPROM_GUI); - char* DefaultStringsArray[] = { "0000000000000000", "00000000000000000000000000000000", "000000000000000000000000", - "000000000000", "00000000000000000000000000000000", "00000000" }; - int j = 0; - for (auto i : { IDC_EE_CONFOUNDER, IDC_EE_HDDKEY, IDC_EE_SERIAL_NUMBER, IDC_EE_MAC_ADDRESS, IDC_EE_ONLINE_KEY, IDC_EE_PRTL_PASS }) { - SendMessage(GetDlgItem(hWndDlg, i), WM_SETTEXT, 0, reinterpret_cast(DefaultStringsArray[j])); - j++; - } - for (auto i : { IDC_EE_XBOX_REGION, IDC_EE_AVREGION, IDC_EE_LANGUAGE, IDC_EE_AVSETTINGS, IDC_EE_AUDIOSETTINGS, IDC_EE_GAME_PRTL_CRTL, - IDC_EE_MOVIE_PRTL_CRTL, IDC_EE_DVDREGION }) { - SendMessage(GetDlgItem(hWndDlg, i), CB_SETCURSEL, 0, 0); - } - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), FALSE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_480P), TRUE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_720P), TRUE); - EnableWindow(GetDlgItem(hWndDlg, IDC_EE_1080I), TRUE); - SendMessage(GetDlgItem(hWndDlg, IDC_EE_PAL60HZ), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_EE_480P), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_EE_720P), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_EE_1080I), BM_SETCHECK, BST_UNCHECKED, 0); + RefreshEepromDialog(hWndDlg); } break; @@ -608,7 +576,20 @@ LRESULT CALLBACK ControlSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, break; case WM_CHAR: - { + { + // Serial Number field is numeric, stored as ASCII text + if (uIdSubclass == IDC_EE_SERIAL_NUMBER) { + if (!((wParam >= '0' && wParam <= '9') + || wParam == VK_CANCEL + || wParam == VK_CLEAR + || wParam == VK_DELETE + || wParam == VK_BACK)) + { + return FALSE; + } + break; + } + // Make sure we only allow hex numbers and some special keys to delete characters if (!((wParam >= '0' && wParam <= '9') || wParam == 'a' diff --git a/src/Cxbx/DlgEepromConfig.h b/src/gui/DlgEepromConfig.h similarity index 75% rename from src/Cxbx/DlgEepromConfig.h rename to src/gui/DlgEepromConfig.h index f8e091295..ef70664a4 100644 --- a/src/Cxbx/DlgEepromConfig.h +++ b/src/gui/DlgEepromConfig.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgEepromConfig.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/gui/DlgInputConfig.cpp b/src/gui/DlgInputConfig.cpp new file mode 100644 index 000000000..dc340e10b --- /dev/null +++ b/src/gui/DlgInputConfig.cpp @@ -0,0 +1,198 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "windows.h" +#include "DlgDukeControllerConfig.h" +#include "ResCxbx.h" +#include "input\InputManager.h" +#include "Logging.h" +#include "Settings.hpp" +#include "common\IPCHybrid.hpp" +#include "EmuShared.h" + + +// Windows dialog procedure for the input menu +static INT_PTR CALLBACK DlgInputConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +HWND g_ChildWnd = NULL; + + +void SyncInputSettings(int port_num, int dev_type) +{ + if (g_ChildWnd) { + // Sync updated input to kernel process to use run-time settings. + g_EmuShared->SetInputDevTypeSettings(&g_Settings->m_input[port_num].Type, port_num); + + if (dev_type != to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID)) { + std::string dev_name = g_Settings->m_input[port_num].DeviceName; + std::string profile_name = g_Settings->m_input[port_num].ProfileName; + + g_EmuShared->SetInputDevNameSettings(dev_name.c_str(), port_num); + auto it = std::find_if(g_Settings->m_input_profiles[dev_type].begin(), + g_Settings->m_input_profiles[dev_type].end(), [&profile_name](const auto& profile) { + if (profile.ProfileName == profile_name) { + return true; + } + return false; + }); + if (it != g_Settings->m_input_profiles[dev_type].end()) { + char controls_name[XBOX_CTRL_NUM_BUTTONS][30]; + for (int index = 0; index < dev_num_buttons[dev_type]; index++) { + strncpy(controls_name[index], it->ControlList[index].c_str(), 30); + } + g_EmuShared->SetInputBindingsSettings(controls_name, XBOX_CTRL_NUM_BUTTONS, port_num); + } + } +#if 0 // lle usb + ipc_send_kernel_update(IPC_UPDATE_KERNEL::CONFIG_INPUT_SYNC, PORT_DEC(Gui2XboxPortArray[port_num]), + reinterpret_cast(g_ChildWnd)); +#else + ipc_send_kernel_update(IPC_UPDATE_KERNEL::CONFIG_INPUT_SYNC, port_num, reinterpret_cast(g_ChildWnd)); +#endif + } +} + +void ShowInputConfig(HWND hwnd, HWND ChildWnd) +{ + g_InputDeviceManager.Initialize(true); + g_ChildWnd = ChildWnd; + + // Show dialog box + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_INPUT_CFG), hwnd, DlgInputConfigProc); +} + +INT_PTR CALLBACK DlgInputConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hHandle; + + // Set window icon + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); + + for (int i = 0, j = 0; i != 4; i++) { + hHandle = GetDlgItem(hWndDlg, IDC_DEVICE_PORT1 + i); + for (auto str : { "None", "MS Controller Duke", "MS Controller S" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(str)); + SendMessage(hHandle, CB_SETITEMDATA, index, + to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) + j); + if (g_Settings->m_input[i].Type == to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) + j) { + SendMessage(hHandle, CB_SETCURSEL, index, 0); + if (g_Settings->m_input[i].Type == to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID)) { + EnableWindow(GetDlgItem(hWndDlg, IDC_CONFIGURE_PORT1 + i), FALSE); + } + } + j++; + } + j = 0; + } + } + break; + + case WM_CLOSE: + { + g_InputDeviceManager.Shutdown(); + g_ChildWnd = NULL; + EndDialog(hWndDlg, wParam); + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_CONFIGURE_PORT1: + case IDC_CONFIGURE_PORT2: + case IDC_CONFIGURE_PORT3: + case IDC_CONFIGURE_PORT4: { + if (HIWORD(wParam) == BN_CLICKED) { + int port = + LOWORD(wParam) == IDC_CONFIGURE_PORT1 ? 0 : + LOWORD(wParam) == IDC_CONFIGURE_PORT2 ? 1 : + LOWORD(wParam) == IDC_CONFIGURE_PORT3 ? 2 : + LOWORD(wParam) == IDC_CONFIGURE_PORT4 ? 3 : + -1; + assert(port != -1); + HWND hHandle = GetDlgItem(hWndDlg, IDC_DEVICE_PORT1 + port); + int DeviceType = SendMessage(hHandle, CB_GETITEMDATA, SendMessage(hHandle, CB_GETCURSEL, 0, 0), 0); + switch (DeviceType) + { + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_DUKE): + case to_underlying(XBOX_INPUT_DEVICE::MS_CONTROLLER_S): { + DialogBoxParam(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_XID_DUKE_CFG), hWndDlg, DlgXidControllerConfigProc, + (DeviceType << 8) | port); + } + break; + + default: + break; + } + assert(DeviceType > to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID) && + DeviceType < to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)); + + // Also inform the kernel process if it exists + SyncInputSettings(port, DeviceType); + } + } + break; + + case IDC_DEVICE_PORT1: + case IDC_DEVICE_PORT2: + case IDC_DEVICE_PORT3: + case IDC_DEVICE_PORT4: + { + if (HIWORD(wParam) == CBN_SELCHANGE) { + LRESULT dev_type = SendMessage(GetDlgItem(hWndDlg, LOWORD(wParam)), CB_GETITEMDATA, + SendMessage(GetDlgItem(hWndDlg, LOWORD(wParam)), CB_GETCURSEL, 0, 0), 0); + int port = + LOWORD(wParam) == IDC_DEVICE_PORT1 ? 0 : + LOWORD(wParam) == IDC_DEVICE_PORT2 ? 1 : + LOWORD(wParam) == IDC_DEVICE_PORT3 ? 2 : + LOWORD(wParam) == IDC_DEVICE_PORT4 ? 3 : + -1; + assert(port != -1); + if (dev_type == to_underlying(XBOX_INPUT_DEVICE::DEVICE_INVALID)) { + EnableWindow(GetDlgItem(hWndDlg, IDC_CONFIGURE_PORT1 + port), FALSE); + } + else { + EnableWindow(GetDlgItem(hWndDlg, IDC_CONFIGURE_PORT1 + port), TRUE); + } + + g_Settings->m_input[port].Type = dev_type; + + // Also inform the kernel process if it exists + SyncInputSettings(port, dev_type); + } + } + break; + } + } + break; + } + return FALSE; +} diff --git a/src/gui/DlgInputConfig.h b/src/gui/DlgInputConfig.h new file mode 100644 index 000000000..a21b2f57d --- /dev/null +++ b/src/gui/DlgInputConfig.h @@ -0,0 +1,34 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef DLGINPUTCONFIG_H +#define DLGINPUTCONFIG_H + +VOID ShowInputConfig(HWND hwnd, HWND ChildWnd); +extern HWND g_ChildWnd; + +#endif diff --git a/src/gui/DlgLoggingConfig.cpp b/src/gui/DlgLoggingConfig.cpp new file mode 100644 index 000000000..679c31d54 --- /dev/null +++ b/src/gui/DlgLoggingConfig.cpp @@ -0,0 +1,405 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018-2019 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#include "Logging.h" +#include "EmuShared.h" +#include "DlgLoggingConfig.h" +#include "ResCxbx.h" +#include "common\IPCHybrid.hpp" + + +static bool g_bHasChanges = false; +static HWND g_ChildWnd = NULL; +INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +static int g_DlgIndexes[] = { + // General + IDC_LOG_CXBXR, + IDC_LOG_XBE, + IDC_LOG_INIT, + IDC_LOG_VMEM, + IDC_LOG_PMEM, + IDC_LOG_GUI, + IDC_LOG_EEPR, + IDC_LOG_RSA, + IDC_LOG_POOLMEM, + IDC_LOG_D3D8, + IDC_LOG_D3DST, + IDC_LOG_D3DCVT, + IDC_LOG_DSOUND, + IDC_LOG_XAPI, + IDC_LOG_XACT, + IDC_LOG_XGRP, + IDC_LOG_XONLINE, + IDC_LOG_FS, + IDC_LOG_PSHB, + IDC_LOG_PXSH, + IDC_LOG_VTXSH, + IDC_LOG_VSHCACHE, + IDC_LOG_VTXB, + IDC_LOG_DINP, + IDC_LOG_XINP, + IDC_LOG_SDL, + IDC_LOG_FILE, + IDC_LOG_X86, + IDC_LOG_HLE, + IDC_LOG_NET, + IDC_LOG_MCPX, + IDC_LOG_NV2A, + IDC_LOG_SMC, + IDC_LOG_OHCI, + IDC_LOG_USB, + IDC_LOG_HUB, + IDC_LOG_XIDCTRL, + IDC_LOG_ADM, + IDC_LOG_INPSYS, + IDC_LOG_DSBUFFER, + IDC_LOG_DSSTREAM, + IDC_LOG_DS3DCALC, + IDC_LOG_XMO, + // Kernel + IDC_LOG_KRNL, + IDC_LOG_LOG, + IDC_LOG_XBOX, + IDC_LOG_XBDM, + IDC_LOG_AV, + IDC_LOG_DBG, + IDC_LOG_EX, + IDC_LOG_FSC, + IDC_LOG_HAL, + IDC_LOG_IO, + IDC_LOG_KD, + IDC_LOG_KE, + IDC_LOG_KI, + IDC_LOG_MM, + IDC_LOG_NT, + IDC_LOG_OB, + IDC_LOG_PS, + IDC_LOG_RTL, + IDC_LOG_XC, + IDC_LOG_XE +}; + + +VOID ShowLoggingConfig(HWND hwnd, HWND ChildWnd) +{ + g_ChildWnd = ChildWnd; + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_LOGGING_CFG), hwnd, DlgLogConfigProc); +} + +INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + unsigned int index; + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hHandle; + int counter; + int TempLevel; + unsigned int LoggedModules[NUM_INTEGERS_LOG]; + int LogLevel; + + // Set window icon + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); + + LoggedModules[0] = g_Settings->m_core.LoggedModules[0]; + LoggedModules[1] = g_Settings->m_core.LoggedModules[1]; + LogLevel = g_Settings->m_core.LogLevel; + + hHandle = GetDlgItem(hWndDlg, IDC_EVENT_LV); + TempLevel = to_underlying(LOG_LEVEL::DEBUG); + for (auto i : { "Debug" , "Info" ,"Warning", "Error", "Fatal" }) { + LRESULT index = SendMessage(hHandle, CB_ADDSTRING, 0, reinterpret_cast(i)); + SendMessage(hHandle, CB_SETITEMDATA, index, TempLevel); + TempLevel++; + } + TempLevel = to_underlying(LOG_LEVEL::DEBUG); + for (; TempLevel < to_underlying(LOG_LEVEL::MAX); TempLevel++) { + if (TempLevel == LogLevel) { + SendMessage(hHandle, CB_SETCURSEL, TempLevel, 0); + break; + } + } + + counter = 0; + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); index++) { + if (LoggedModules[index / 32] & (1 << (index % 32))) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_CHECKED, 0); + counter++; + } + else { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_UNCHECKED, 0); + } + } + + if (counter == to_underlying(CXBXR_MODULE::KRNL)) { + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_ENABLE_GENERAL), BM_SETCHECK, BST_CHECKED, 0); + } + else if (counter == 0) { + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_DISABLE_GENERAL), BM_SETCHECK, BST_CHECKED, 0); + } + else { + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_CUSTOM_GENERAL), BM_SETCHECK, BST_CHECKED, 0); + } + + counter = 0; + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); index++) { + if (LoggedModules[index / 32] & (1 << (index % 32))) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_CHECKED, 0); + counter++; + } + else { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_UNCHECKED, 0); + } + } + + if (counter == (to_underlying(CXBXR_MODULE::MAX) - to_underlying(CXBXR_MODULE::KRNL))) { + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_ENABLE_KERNEL), BM_SETCHECK, BST_CHECKED, 0); + } + else if (counter == 0) { + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_DISABLE_KERNEL), BM_SETCHECK, BST_CHECKED, 0); + } + else { + SendMessage(GetDlgItem(hWndDlg, IDC_LOG_CUSTOM_KERNEL), BM_SETCHECK, BST_CHECKED, 0); + } + + // Reset changes flag + g_bHasChanges = false; + } + break; + + case WM_CLOSE: + { + PostMessage(hWndDlg, WM_COMMAND, IDC_LOG_CANCEL, 0); + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_LOG_CANCEL: + { + g_ChildWnd = NULL; + EndDialog(hWndDlg, wParam); + } + break; + + case IDC_LOG_ACCEPT: + { + if (g_bHasChanges) { + unsigned int LoggedModules[NUM_INTEGERS_LOG] = { 0 }; + HWND hControl = GetDlgItem(hWndDlg, IDC_EVENT_LV); + int LogLevel = SendMessage(hControl, CB_GETITEMDATA, SendMessage(hControl, CB_GETCURSEL, 0, 0), 0); + + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) { + if (SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_GETCHECK, 0, 0) == BST_CHECKED) { + LoggedModules[index / 32] |= (1 << (index % 32)); + } + } + + g_Settings->m_core.LoggedModules[0] = LoggedModules[0]; + g_Settings->m_core.LoggedModules[1] = LoggedModules[1]; + g_Settings->m_core.LogLevel = LogLevel; + + // Update the logging variables for the GUI process + log_set_config(LogLevel, LoggedModules); + log_generate_active_filter_output(CXBXR_MODULE::GUI); + + // Also inform the kernel process if it exists + if (g_ChildWnd) { + // Sync updated log to kernel process to use run-time settings. + g_EmuShared->SetLogLv(&LogLevel); + g_EmuShared->SetLogModules(LoggedModules); + ipc_send_kernel_update(IPC_UPDATE_KERNEL::CONFIG_LOGGING_SYNC, 0, reinterpret_cast(g_ChildWnd)); + } + } + PostMessage(hWndDlg, WM_COMMAND, IDC_LOG_CANCEL, 0); + } + break; + + case IDC_EVENT_LV: + if (HIWORD(wParam) == CBN_SELCHANGE) { + g_bHasChanges = true; + } + break; + + case IDC_LOG_ENABLE_GENERAL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); + index++) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_DISABLE_GENERAL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); + index++) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_ENABLE_KERNEL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); + index++) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_DISABLE_KERNEL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); + index++) { + SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_SETCHECK, BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_CUSTOM_GENERAL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::KRNL); + index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), TRUE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_CUSTOM_KERNEL: { + if (HIWORD(wParam) == BN_CLICKED) { + for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); + index++) { + EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), TRUE); + } + g_bHasChanges = true; + } + } + break; + + case IDC_LOG_CXBXR: + case IDC_LOG_XBE: + case IDC_LOG_INIT: + case IDC_LOG_VMEM: + case IDC_LOG_PMEM: + case IDC_LOG_GUI: + case IDC_LOG_EEPR: + case IDC_LOG_RSA: + case IDC_LOG_POOLMEM: + case IDC_LOG_D3D8: + case IDC_LOG_D3DST: + case IDC_LOG_D3DCVT: + case IDC_LOG_DSOUND: + case IDC_LOG_DSBUFFER: + case IDC_LOG_DSSTREAM: + case IDC_LOG_DS3DCALC: + case IDC_LOG_XMO: + case IDC_LOG_XAPI: + case IDC_LOG_XACT: + case IDC_LOG_XGRP: + case IDC_LOG_XONLINE: + case IDC_LOG_FS: + case IDC_LOG_PSHB: + case IDC_LOG_PXSH: + case IDC_LOG_VTXSH: + case IDC_LOG_VSHCACHE: + case IDC_LOG_VTXB: + case IDC_LOG_DINP: + case IDC_LOG_XINP: + case IDC_LOG_SDL: + case IDC_LOG_FILE: + case IDC_LOG_X86: + case IDC_LOG_HLE: + case IDC_LOG_NET: + case IDC_LOG_MCPX: + case IDC_LOG_NV2A: + case IDC_LOG_SMC: + case IDC_LOG_OHCI: + case IDC_LOG_USB: + case IDC_LOG_HUB: + case IDC_LOG_XIDCTRL: + case IDC_LOG_ADM: + case IDC_LOG_INPSYS: + case IDC_LOG_KRNL: + case IDC_LOG_LOG: + case IDC_LOG_XBOX: + case IDC_LOG_XBDM: + case IDC_LOG_AV: + case IDC_LOG_DBG: + case IDC_LOG_EX: + case IDC_LOG_FSC: + case IDC_LOG_HAL: + case IDC_LOG_IO: + case IDC_LOG_KD: + case IDC_LOG_KE: + case IDC_LOG_KI: + case IDC_LOG_MM: + case IDC_LOG_NT: + case IDC_LOG_OB: + case IDC_LOG_PS: + case IDC_LOG_RTL: + case IDC_LOG_XC: + case IDC_LOG_XE: + if (HIWORD(wParam) == BN_CLICKED) { + g_bHasChanges = true; + } + break; + } + } + break; + + } + return FALSE; +} diff --git a/src/gui/DlgLoggingConfig.h b/src/gui/DlgLoggingConfig.h new file mode 100644 index 000000000..8870292ec --- /dev/null +++ b/src/gui/DlgLoggingConfig.h @@ -0,0 +1,31 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 ergo720 +// * +// * All rights reserved +// * +// ****************************************************************** + +#ifndef DLGLOGGINGCONFIG_H +#define DLGLOGGINGCONFIG_H + +VOID ShowLoggingConfig(HWND hwnd, HWND ChildWnd); + +#endif diff --git a/src/gui/DlgNetworkConfig.cpp b/src/gui/DlgNetworkConfig.cpp new file mode 100644 index 000000000..680cf1b9f --- /dev/null +++ b/src/gui/DlgNetworkConfig.cpp @@ -0,0 +1,126 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** + +#include +#include "EmuShared.h" + +#include "DlgNetworkConfig.h" +#include "ResCxbx.h" + +#include + +/*! handle to network adapter list window */ +static HWND g_hNetworkAdapters = nullptr; +static Settings::s_network g_XBNetwork; + +/*! windows dialog procedure */ +static INT_PTR CALLBACK DlgNetworkConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +VOID ShowNetworkConfig(HWND hwnd) +{ + g_XBNetwork = g_Settings->m_network; + /*! show dialog box */ + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_NETWORK_CFG), hwnd, DlgNetworkConfigProc); +} + +VOID FetchNetworkInterfaces(HWND hwnd) +{ + static IP_ADAPTER_INFO AdapterInfo[128]; + static PIP_ADAPTER_INFO pAdapterInfo; + ULONG dwBufferLength = sizeof(AdapterInfo); + + DWORD dwStatus = GetAdaptersInfo(AdapterInfo, &dwBufferLength); + if (dwStatus != ERROR_SUCCESS) { + return; + } + + pAdapterInfo = AdapterInfo; + + LRESULT counter = SendMessage(g_hNetworkAdapters, CB_ADDSTRING, 0, (LPARAM)"Disabled"); + SendMessage(g_hNetworkAdapters, CB_SETITEMDATA, counter, (LPARAM)""); + SendMessage(g_hNetworkAdapters, CB_SETCURSEL, counter, 0); + + do { + counter = SendMessage(g_hNetworkAdapters, CB_ADDSTRING, 0, (LPARAM)pAdapterInfo->Description); + SendMessage(g_hNetworkAdapters, CB_SETITEMDATA, counter, (LPARAM)pAdapterInfo->AdapterName); + + if (strcmp(g_XBNetwork.adapter_name, pAdapterInfo->AdapterName) == 0) { + SendMessage(g_hNetworkAdapters, CB_SETCURSEL, counter, 0); + } + + pAdapterInfo = pAdapterInfo->Next; + + } while (pAdapterInfo); +} + +INT_PTR CALLBACK DlgNetworkConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + { + g_hNetworkAdapters = GetDlgItem(hWndDlg, IDC_NETWORK_ADAPTER); + + /*! set window icon */ + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); + + SendMessage(g_hNetworkAdapters, CB_RESETCONTENT, 0, 0); + FetchNetworkInterfaces(hWndDlg); + } + break; + + case WM_CLOSE: + { + PostMessage(hWndDlg, WM_COMMAND, IDC_AC_CANCEL, 0); + } + break; + + case WM_COMMAND: + { + HWND hWndButton = GetDlgItem(hWndDlg, LOWORD(wParam)); + + switch(LOWORD(wParam)) + { + case IDC_AC_CANCEL: + EndDialog(hWndDlg, wParam); + break; + + case IDC_AC_ACCEPT: + HWND hNetworkAdapter = GetDlgItem(hWndDlg, IDC_NETWORK_ADAPTER); + LRESULT lRet = SendMessage(hNetworkAdapter, CB_GETCURSEL, 0, 0); + char* deviceName = nullptr; + deviceName = (char*)SendMessage(hNetworkAdapter, CB_GETITEMDATA, (WPARAM)lRet, NULL); + strncpy(g_XBNetwork.adapter_name, deviceName, std::size(g_XBNetwork.adapter_name)); + g_Settings->m_network = g_XBNetwork; + EndDialog(hWndDlg, wParam); + break; + } + } + break; + } + return FALSE; +} diff --git a/src/gui/DlgNetworkConfig.h b/src/gui/DlgNetworkConfig.h new file mode 100644 index 000000000..1b25aae2b --- /dev/null +++ b/src/gui/DlgNetworkConfig.h @@ -0,0 +1,33 @@ +// ****************************************************************** +// * +// * This file is part of the Cxbx project. +// * +// * Cxbx and Cxbe are free software; you can redistribute them +// * and/or modify them under the terms of the GNU General Public +// * License as published by the Free Software Foundation; either +// * version 2 of the license, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have recieved a copy of the GNU General Public License +// * along with this program; see the file COPYING. +// * If not, write to the Free Software Foundation, Inc., +// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. +// * +// * (c) 2018 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#ifndef DLGNETWORKCONFIG_H +#define DLGNETWORKCONFIG_H + +#include + +/*! show network configuration dialog */ +extern VOID ShowNetworkConfig(HWND hwnd); + +#endif diff --git a/src/Cxbx/DlgVideoConfig.cpp b/src/gui/DlgVideoConfig.cpp similarity index 69% rename from src/Cxbx/DlgVideoConfig.cpp rename to src/gui/DlgVideoConfig.cpp index 8cb7d8093..fefb0d18e 100644 --- a/src/Cxbx/DlgVideoConfig.cpp +++ b/src/gui/DlgVideoConfig.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgVideoConfig.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,12 +25,15 @@ // * // ****************************************************************** -#include "CxbxKrnl/EmuShared.h" +// Without this, you'll get a ton of errors from the std library for some unknown reason... +#include "Logging.h" + +#include "common\Settings.hpp" // for g_Settings #include "DlgVideoConfig.h" #include "ResCxbx.h" -#include "CxbxKrnl/EmuD3D8Types.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For IDirect3D /*! windows dialog procedure */ static INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -47,11 +41,13 @@ static INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wPara static VOID RefreshDisplayAdapter(); /*! refresh UI based on selected device */ static VOID RefreshDirect3DDevice(); +/*! refrehs UI based on selected Render Resolution */ +static VOID RefreshRenderResolution(); /*! direct3d instance */ -static XTL::IDirect3D *g_pDirect3D = 0; +static IDirect3D *g_pDirect3D = nullptr; /*! video configuration */ -static XBVideo g_XBVideo; +static Settings::s_video g_XBVideo; /*! changes flag */ static BOOL g_bHasChanges = FALSE; /*! number of adapters */ @@ -62,6 +58,10 @@ static HWND g_hDisplayAdapter = NULL; static HWND g_hDirect3DDevice = NULL; /*! handle to video resolution list window */ static HWND g_hVideoResolution = NULL; +/*! handle to scale factor window*/ +static HWND g_hRenderResolution = NULL; + +#pragma optimize("", off) VOID ShowVideoConfig(HWND hwnd) { @@ -69,11 +69,11 @@ VOID ShowVideoConfig(HWND hwnd) g_bHasChanges = FALSE; /*! retrieve video configuration */ - g_EmuShared->GetXBVideo(&g_XBVideo); + g_XBVideo = g_Settings->m_video; /*! initialize direct3d */ { - g_pDirect3D = XTL::Direct3DCreate(D3D_SDK_VERSION); + g_pDirect3D = Direct3DCreate(D3D_SDK_VERSION); if(g_pDirect3D == 0) { goto cleanup; } @@ -81,7 +81,7 @@ VOID ShowVideoConfig(HWND hwnd) } /*! show dialog box */ - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_VIDEO_CFG), hwnd, DlgVideoConfigProc); + DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_VIDEO_CFG), hwnd, DlgVideoConfigProc); cleanup: @@ -104,17 +104,18 @@ INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR g_hDisplayAdapter = GetDlgItem(hWndDlg, IDC_VC_DISPLAY_ADAPTER); g_hDirect3DDevice = GetDlgItem(hWndDlg, IDC_VC_D3D_DEVICE); g_hVideoResolution = GetDlgItem(hWndDlg, IDC_VC_VIDEO_RESOLUTION); + g_hRenderResolution = GetDlgItem(hWndDlg, IDC_VC_RENDER_RESOLUTION); /*! set window icon */ - SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); + SetClassLong(hWndDlg, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); /*! enumerate display adapters */ { SendMessage(g_hDisplayAdapter, CB_RESETCONTENT, 0, 0); - for(uint32 v=0;vGetAdapterIdentifier(v, D3DENUM_NO_WHQL_LEVEL, &adapterIdentifier); SendMessage(g_hDisplayAdapter, CB_ADDSTRING, 0, (LPARAM)adapterIdentifier.Description); @@ -122,18 +123,33 @@ INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR } /*! activate configured display adapter */ - SendMessage(g_hDisplayAdapter, CB_SETCURSEL, g_XBVideo.GetDisplayAdapter(), 0); + SendMessage(g_hDisplayAdapter, CB_SETCURSEL, g_XBVideo.adapter, 0); /*! refresh UI based on currently selected display adapter */ RefreshDisplayAdapter(); + + /*! generate list of render scale factors */ + { + DWORD dwRenderResolution = g_XBVideo.renderScaleFactor; + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"1x (Native)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"2x (1280x960)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"3x (1920x1440)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"4x (2560x1920)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"5x (3200x2400)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"6x (3840x2880)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"7x (4480x3360)"); + SendMessage(g_hRenderResolution, CB_ADDSTRING, 0, (LPARAM)"8x (5120x3840)"); + SendMessage(g_hRenderResolution, CB_SETCURSEL, dwRenderResolution - 1, 0); + } + /*! check appropriate options */ { - SendMessage(GetDlgItem(hWndDlg, IDC_CV_FULLSCREEN), BM_SETCHECK, (WPARAM)g_XBVideo.GetFullscreen(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_CV_FULLSCREEN), BM_SETCHECK, (WPARAM)g_XBVideo.bFullScreen, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_CV_VSYNC), BM_SETCHECK, (WPARAM)g_XBVideo.GetVSync(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_CV_VSYNC), BM_SETCHECK, (WPARAM)g_XBVideo.bVSync, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_CV_HARDWAREYUV), BM_SETCHECK, (WPARAM)g_XBVideo.GetHardwareYUV(), 0); + SendMessage(GetDlgItem(hWndDlg, IDC_CV_HARDWAREYUV), BM_SETCHECK, (WPARAM)g_XBVideo.bHardwareYUV, 0); } } break; @@ -183,26 +199,36 @@ INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR lRet = SendMessage(hVideoResolution, CB_GETLBTEXT, (WPARAM)lRet, (LPARAM)szBuffer); - g_XBVideo.SetVideoResolution(szBuffer); + strncpy(g_XBVideo.szVideoResolution, szBuffer, std::size(g_XBVideo.szVideoResolution)); + + // For prevent buffer overflow whenever copy string from another location. + g_XBVideo.szVideoResolution[std::size(g_XBVideo.szVideoResolution)-1] = '\0'; } + /*! save render resolution configuration */ + { + HWND hRenderResolution = GetDlgItem(hWndDlg, IDC_VC_RENDER_RESOLUTION); + LRESULT lRet = SendMessage(hRenderResolution, CB_GETCURSEL, 0, 0) + 1; + g_XBVideo.renderScaleFactor = lRet; + } + /*! save fullscreen/vsync/YUV options */ { LRESULT lRet = SendMessage(GetDlgItem(hWndDlg, IDC_CV_FULLSCREEN), BM_GETCHECK, 0, 0); - g_XBVideo.SetFullscreen(lRet == BST_CHECKED); + g_XBVideo.bFullScreen = (lRet == BST_CHECKED); lRet = SendMessage(GetDlgItem(hWndDlg, IDC_CV_VSYNC), BM_GETCHECK, 0, 0); - g_XBVideo.SetVSync(lRet == BST_CHECKED); + g_XBVideo.bVSync = (lRet == BST_CHECKED); lRet = SendMessage(GetDlgItem(hWndDlg, IDC_CV_HARDWAREYUV), BM_GETCHECK, 0, 0); - g_XBVideo.SetHardwareYUV(lRet == BST_CHECKED); + g_XBVideo.bHardwareYUV = (lRet == BST_CHECKED); } /*! save video configuration */ - g_EmuShared->SetXBVideo(&g_XBVideo); + g_Settings->m_video = g_XBVideo; EndDialog(hWndDlg, wParam); } @@ -227,6 +253,15 @@ INT_PTR CALLBACK DlgVideoConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPAR } } break; + + case IDC_VC_RENDER_RESOLUTION: + { + if (HIWORD(wParam) == CBN_SELCHANGE) + { + RefreshRenderResolution(); + break; + } + } } } break; @@ -238,7 +273,7 @@ VOID RefreshDisplayAdapter() { /*! save configured display adapter */ { - DWORD dwOld = g_XBVideo.GetDisplayAdapter(); + DWORD dwOld = g_XBVideo.adapter; DWORD dwDisplayAdapter = (DWORD)SendMessage(g_hDisplayAdapter, CB_GETCURSEL, 0, 0); @@ -246,14 +281,14 @@ VOID RefreshDisplayAdapter() { g_bHasChanges = TRUE; - g_XBVideo.SetDisplayAdapter(dwDisplayAdapter); + g_XBVideo.adapter = dwDisplayAdapter; } } /*! generate list of device types */ { /*! device types */ - static const XTL::D3DDEVTYPE devType[2] = { XTL::D3DDEVTYPE_HAL, XTL::D3DDEVTYPE_REF }; + static const D3DDEVTYPE devType[2] = { D3DDEVTYPE_HAL, D3DDEVTYPE_REF }; /*! human readable device types */ static const char *szDevType[2] = { "Direct3D HAL (Hardware Accelerated)", "Direct3D REF (Software)" }; @@ -262,12 +297,12 @@ VOID RefreshDisplayAdapter() SendMessage(g_hDirect3DDevice, CB_RESETCONTENT, 0, 0); /*! step through devices types */ - for(uint32 d=0;d<2;d++) + for(uint32_t d=0;d<2;d++) { - XTL::D3DCAPS Caps; + D3DCAPS Caps; /*! verify device is available */ - if(g_pDirect3D->GetDeviceCaps(g_XBVideo.GetDisplayAdapter(), devType[d], &Caps) == D3D_OK) + if(g_pDirect3D->GetDeviceCaps(g_XBVideo.adapter, devType[d], &Caps) == D3D_OK) { /*! add device to list */ SendMessage(g_hDirect3DDevice, CB_ADDSTRING, 0, (LPARAM)szDevType[d]); @@ -276,7 +311,7 @@ VOID RefreshDisplayAdapter() } /*! activate configured device */ - SendMessage(g_hDirect3DDevice, CB_SETCURSEL, g_XBVideo.GetDirect3DDevice(), 0); + SendMessage(g_hDirect3DDevice, CB_SETCURSEL, g_XBVideo.direct3DDevice, 0); /*! refresh based on new device selection */ RefreshDirect3DDevice(); @@ -290,7 +325,7 @@ VOID RefreshDirect3DDevice() /*! save configured device */ { - DWORD dwOld = g_XBVideo.GetDirect3DDevice(); + DWORD dwOld = g_XBVideo.direct3DDevice; DWORD dwDirect3DDevice = SendMessage(g_hDirect3DDevice, CB_GETCURSEL, 0, 0); @@ -298,7 +333,7 @@ VOID RefreshDirect3DDevice() { g_bHasChanges = TRUE; - g_XBVideo.SetDirect3DDevice(dwDirect3DDevice); + g_XBVideo.direct3DDevice = dwDirect3DDevice; } } @@ -309,43 +344,39 @@ VOID RefreshDirect3DDevice() /*! enumerate display modes */ { - uint32 dwAdapterModeCount = g_pDirect3D->GetAdapterModeCount( - g_XBVideo.GetDisplayAdapter() -#ifdef CXBX_USE_D3D9 - , XTL::D3DFMT_X8R8G8B8 -#endif + uint32_t dwAdapterModeCount = g_pDirect3D->GetAdapterModeCount( + g_XBVideo.adapter + , D3DFMT_X8R8G8B8 ); SendMessage(g_hVideoResolution, CB_ADDSTRING, 0, (LPARAM)"Automatic (Default)"); /*! enumerate through available adapter modes */ - for(uint32 v=0;vEnumAdapterModes( - g_XBVideo.GetDisplayAdapter(), -#ifdef CXBX_USE_D3D9 - XTL::D3DFMT_X8R8G8B8, -#endif + g_XBVideo.adapter, + D3DFMT_X8R8G8B8, v, &displayMode ); switch(displayMode.Format) { - case XTL::D3DFMT_X1R5G5B5: + case D3DFMT_X1R5G5B5: szFormat = "16bit x1r5g5b5"; break; - case XTL::D3DFMT_R5G6B5: + case D3DFMT_R5G6B5: szFormat = "16bit r5g6r5"; break; - case XTL::D3DFMT_X8R8G8B8: + case D3DFMT_X8R8G8B8: szFormat = "32bit x8r8g8b8"; break; - case XTL::D3DFMT_A8R8G8B8: + case D3DFMT_A8R8G8B8: szFormat = "32bit a8r8g8b8"; break; default: @@ -367,7 +398,7 @@ VOID RefreshDirect3DDevice() } /*! if current mode is the configured video resolution, activate it in the list */ - if(strcmp(szBuffer, g_XBVideo.GetVideoResolution()) == 0) + if(strcmp(szBuffer, g_XBVideo.szVideoResolution) == 0) { dwVideoResolution = v+1; } @@ -376,10 +407,25 @@ VOID RefreshDirect3DDevice() } } } - } - /*! activate configured display mode */ - SendMessage(g_hVideoResolution, CB_SETCURSEL, dwVideoResolution, 0); + + SendMessage(g_hVideoResolution, CB_SETCURSEL, dwVideoResolution, 0); + } return; } + +VOID RefreshRenderResolution() +{ + /*! save configured render resolution */ + { + DWORD dwOld = g_XBVideo.renderScaleFactor; + DWORD dwRenderScaleFactor = (DWORD)(SendMessage(g_hRenderResolution, CB_GETCURSEL, 0, 0) + 1); + + if (dwRenderScaleFactor != dwOld) + { + g_bHasChanges = TRUE; + g_XBVideo.renderScaleFactor = dwRenderScaleFactor; + } + } +} diff --git a/src/Cxbx/DlgVideoConfig.h b/src/gui/DlgVideoConfig.h similarity index 76% rename from src/Cxbx/DlgVideoConfig.h rename to src/gui/DlgVideoConfig.h index 41e426e3c..0a06cad9d 100644 --- a/src/Cxbx/DlgVideoConfig.h +++ b/src/gui/DlgVideoConfig.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->DlgVideoConfig.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Cxbx/DlgVirtualSBCFeedback.cpp b/src/gui/DlgVirtualSBCFeedback.cpp similarity index 96% rename from src/Cxbx/DlgVirtualSBCFeedback.cpp rename to src/gui/DlgVirtualSBCFeedback.cpp index 91110672d..93782ee2d 100644 --- a/src/Cxbx/DlgVirtualSBCFeedback.cpp +++ b/src/gui/DlgVirtualSBCFeedback.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,7 +26,6 @@ // ****************************************************************** #include "stdafx.h" -//#include "CxbxKrnl/EmuShared.h" #include "DlgVirtualSBCFeedback.h" #include "CxbxKrnl/EmuXapi.h" #include "Winuser.h" diff --git a/src/Cxbx/ResCxbx.h b/src/gui/ResCxbx.h similarity index 64% rename from src/Cxbx/ResCxbx.h rename to src/gui/ResCxbx.h index 949c28729..9ee9ebc0c 100644 --- a/src/Cxbx/ResCxbx.h +++ b/src/gui/ResCxbx.h @@ -1,13 +1,14 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by c:\Users\Aaron\source\repos\cxbx-reloaded2\resource\Cxbx.rc +// Used by C:\Users\anonymous\Documents\xbox\Cxbx-Reloaded\resource\Cxbx.rc // #define IDI_CXBX 101 #define IDB_SPLASH 102 #define IDR_MAINMENU 103 #define IDB_LOGO 106 #define IDB_ABOUT 108 -#define IDD_CONTROLLER_CFG 111 +#define IDD_INPUT_CFG 111 +#define IDD_LOGGING_CFG 112 #define IDD_VIDEO_CFG 113 #define IDD_AUDIO_CFG 114 #define IDD_EEPROM_CFG 115 @@ -16,9 +17,82 @@ #define IDD_ABOUT 119 #define IDR_CONTRIBUTORS 121 #define IDR_COPYING 122 -#define IDS_UEM 123 -#define IDD_CONTROLLER_HOST_MAPPING 131 #define IDD_VIRTUAL_SBC_FEEDBACK 133 +#define IDD_XID_DUKE_CFG 134 +#define IDD_RUMBLE_CFG 135 +#define IDD_NETWORK_CFG 136 +#define IDC_LOG_CANCEL 892 +#define IDC_LOG_ACCEPT 893 +#define IDC_LOG_ENABLE_GENERAL 894 +#define IDC_LOG_DISABLE_GENERAL 895 +#define IDC_LOG_ENABLE_KERNEL 896 +#define IDC_LOG_DISABLE_KERNEL 897 +#define IDC_LOG_CUSTOM_GENERAL 898 +#define IDC_LOG_CUSTOM_KERNEL 899 +#define IDC_LOG_CXBXR 900 +#define IDC_LOG_XBE 901 +#define IDC_LOG_INIT 902 +#define IDC_LOG_VMEM 903 +#define IDC_LOG_PMEM 904 +#define IDC_LOG_GUI 905 +#define IDC_LOG_EEPR 906 +#define IDC_LOG_RSA 907 +#define IDC_LOG_POOLMEM 908 +#define IDC_LOG_D3D8 909 +#define IDC_LOG_D3DST 910 +#define IDC_LOG_D3DCVT 911 +#define IDC_LOG_DSOUND 912 +#define IDC_LOG_XAPI 913 +#define IDC_LOG_XACT 914 +#define IDC_LOG_XGRP 915 +#define IDC_LOG_XONLINE 916 +#define IDC_LOG_FS 917 +#define IDC_LOG_PSHB 918 +#define IDC_LOG_PXSH 919 +#define IDC_LOG_VTXSH 920 +#define IDC_LOG_VTXB 921 +#define IDC_LOG_DINP 922 +#define IDC_LOG_XINP 923 +#define IDC_LOG_SDL 924 +#define IDC_LOG_FILE 925 +#define IDC_LOG_X86 926 +#define IDC_LOG_HLE 927 +#define IDC_LOG_NET 928 +#define IDC_LOG_MCPX 929 +#define IDC_LOG_NV2A 930 +#define IDC_LOG_SMC 931 +#define IDC_LOG_OHCI 932 +#define IDC_LOG_USB 933 +#define IDC_LOG_HUB 934 +#define IDC_LOG_XIDCTRL 935 +#define IDC_LOG_ADM 936 +#define IDC_LOG_KRNL 937 +#define IDC_LOG_LOG 938 +#define IDC_LOG_XBOX 939 +#define IDC_LOG_XBDM 940 +#define IDC_LOG_AV 941 +#define IDC_LOG_DBG 942 +#define IDC_LOG_EX 943 +#define IDC_LOG_FSC 944 +#define IDC_LOG_HAL 945 +#define IDC_LOG_IO 946 +#define IDC_LOG_KD 947 +#define IDC_LOG_KE 948 +#define IDC_LOG_KI 949 +#define IDC_LOG_MM 950 +#define IDC_LOG_NT 951 +#define IDC_LOG_OB 952 +#define IDC_LOG_PS 953 +#define IDC_LOG_RTL 954 +#define IDC_LOG_XC 955 +#define IDC_LOG_XE 956 +#define IDC_LOG_INPSYS 957 +#define IDC_LOG_DSBUFFER 958 +#define IDC_LOG_DSSTREAM 959 +#define IDC_LOG_DS3DCALC 960 +#define IDC_LOG_XMO 961 +#define IDC_LOG_VSHCACHE 962 +#define IDC_SET_MOTOR 999 #define IDC_SET_X 1000 #define IDC_SET_Y 1001 #define IDC_SET_A 1002 @@ -72,6 +146,7 @@ #define IDC_BTN_COM1 1050 #define IDC_VC_VIDEO_RESOLUTION 1051 #define IDC_BTN_COM2 1052 +#define IDC_VC_RENDER_RESOLUTION 1052 #define IDC_BTN_COM3 1053 #define IDC_BTN_COM4 1054 #define IDC_CV_HARDWAREYUV 1055 @@ -115,41 +190,15 @@ #define IDC_EE_480P 1093 #define IDC_EE_720P 1094 #define IDC_EE_1080I 1095 -#define ID_KRNL_IS_READY 1096 +#define ID_GUI_STATUS_KRNL_IS_READY 1096 +#define ID_GUI_STATUS_LLE_FLAGS 1097 +#define ID_GUI_STATUS_XBOX_LED_COLOUR 1098 +#define ID_GUI_STATUS_LOG_ENABLED 1099 +#define IDC_AC_MUTE_ON_UNFOCUS_DISABLE 1100 #define IDC_XBOX_PORT_0 1158 -#define IDC_HOST_NOTCONNECT_0_0 1159 -#define IDC_HOST_XINPUT_0_0 1160 -#define IDC_HOST_XINPUT_0_1 1161 -#define IDC_HOST_XINPUT_0_2 1162 -#define IDC_HOST_XINPUT_0_3 1163 -#define IDC_HOST_DINPUT_0_0 1164 -#define IDC_HOST_VIRTUAL_SBC_0_0 1165 #define IDC_XBOX_PORT_1 1166 -#define IDC_HOST_NOTCONNECT_1_0 1167 -#define IDC_HOST_XINPUT_1_0 1168 -#define IDC_HOST_XINPUT_1_1 1169 -#define IDC_HOST_XINPUT_1_2 1170 -#define IDC_HOST_XINPUT_1_3 1171 -#define IDC_HOST_DINPUT_1_0 1172 -#define IDC_HOST_VIRTUAL_SBC_1_0 1173 #define IDC_XBOX_PORT_2 1174 -#define IDC_HOST_NOTCONNECT_2_0 1175 -#define IDC_HOST_XINPUT_2_0 1176 -#define IDC_HOST_XINPUT_2_1 1177 -#define IDC_HOST_XINPUT_2_2 1178 -#define IDC_HOST_XINPUT_2_3 1179 -#define IDC_HOST_DINPUT_2_0 1180 -#define IDC_HOST_VIRTUAL_SBC_2_0 1181 #define IDC_XBOX_PORT_3 1182 -#define IDC_HOST_NOTCONNECT_3_0 1183 -#define IDC_HOST_XINPUT_3_0 1184 -#define IDC_HOST_XINPUT_3_1 1185 -#define IDC_HOST_XINPUT_3_2 1186 -#define IDC_HOST_XINPUT_3_3 1187 -#define IDC_HOST_DINPUT_3_0 1188 -#define IDC_HOST_VIRTUAL_SBC_3_0 1189 -#define IDC_HOST_APPLY 1190 -#define IDC_HOST_CANCEL 1191 #define IDC_LEFTBLOCK 1200 #define IDC_LEFTBLOCK2 1201 #define IDC_RIGHTBLOCK 1202 @@ -224,6 +273,36 @@ #define IDC_PB_BUFFER_MATERIAL 1270 #define IDC_PB_VT_LOCATION_MEASUREMENT4 1271 #define IDC_PB_FILT_CONTROL_SYSTEM 1272 +#define IDC_EVENT_LV 1273 +#define IDC_CXBXR_EVENTS 1274 +#define IDC_KERNEL_EVENTS 1275 +#define IDC_XID_CONFIG 1276 +#define IDC_DEVICE_PORT1 1277 +#define IDC_DEVICE_PORT2 1278 +#define IDC_DEVICE_PORT3 1279 +#define IDC_DEVICE_PORT4 1280 +#define IDC_CONFIGURE_PORT1 1281 +#define IDC_CONFIGURE_PORT2 1282 +#define IDC_CONFIGURE_PORT3 1283 +#define IDC_CONFIGURE_PORT4 1284 +#define IDC_DEVICE_LIST 1285 +#define IDC_REFRESH_DEVICES 1286 +#define IDC_XID_DEFAULT 1287 +#define IDC_XID_PROFILE 1288 +#define IDC_XID_PROFILE_NAME 1289 +#define IDC_XID_PROFILE_SAVE 1291 +#define IDC_XID_PROFILE_DELETE 1292 +#define IDC_XID_BUTTONS 1293 +#define IDC_XID_LSTICK 1294 +#define IDC_XID_RSTICK 1295 +#define IDC_XID_DPAD 1296 +#define IDC_XID_TRIGGERS 1297 +#define IDC_XID_RUMBLE 1298 +#define IDC_XID_OPTIONS 1299 +#define IDC_XID_CLEAR 1300 +#define IDC_RUMBLE_LIST 1301 +#define IDC_RUMBLE_TEST 1302 +#define IDC_NETWORK_ADAPTER 1303 #define ID_FILE_EXIT 40005 #define ID_HELP_ABOUT 40008 #define ID_EMULATION_START 40009 @@ -244,7 +323,7 @@ #define ID_EMULATION_LLE_APU 40039 #define ID_EMULATION_LLE_GPU 40040 #define ID_EMULATION_LLE_JIT 40041 -#define ID_SETTINGS_CONFIG_CONTROLLER 40046 +#define ID_SETTINGS_CONFIG_INPUT 40046 #define ID_SETTINGS_CONFIG_VIDEO 40047 #define ID_SETTINGS_CONFIG_AUDIO 40048 #define ID_SETTINGS_CONFIG_EEPROM 40049 @@ -270,25 +349,27 @@ #define ID_SETTINGS_INITIALIZE 40091 #define ID_EMULATION_STARTDEBUGGER 40092 #define ID_FPS 40096 -#define ID_HACKS_UNCAPFRAMERATE 40097 #define ID_HACKS_RUNXBOXTHREADSONALLCORES 40098 #define ID_HACKS_SKIPRDTSCPATCHING 40099 -#define ID_HACKS_SCALEVIEWPORT 40100 -#define ID_SETTINGS_CONFIG_XBOX_CONTROLLER_MAPPING 40101 -#define ID_HACKS_RENDERDIRECTLYTOHOSTBACKBUFFER 40102 #define ID_HACKS_SPEEDHACKS 40103 #define ID_SETTINGS_CONFIG_DLOCCUSTOM 40104 #define ID_SETTINGS_CONFIG_DLOCAPPDATA 40105 -#define ID_SETTINGS_CONFIG_DLOCCURDIR 40106 +#define ID_SETTINGS_CONFIG_DLOCEXECDIR 40106 +#define ID_SETTINGS_ALLOWADMINPRIVILEGE 40107 +#define ID_SETTINGS_CONFIG_LOGGING 40108 +#define ID_SYNC_CONFIG_LOGGING 40109 +#define ID_LOG 40110 +#define ID_SETTINGS_CONFIG_NETWORK 40111 +#define ID_SYNC_CONFIG_INPUT 40112 #define IDC_STATIC -1 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 135 -#define _APS_NEXT_COMMAND_VALUE 40107 -#define _APS_NEXT_CONTROL_VALUE 1256 -#define _APS_NEXT_SYMED_VALUE 104 +#define _APS_NEXT_RESOURCE_VALUE 136 +#define _APS_NEXT_COMMAND_VALUE 40113 +#define _APS_NEXT_CONTROL_VALUE 1278 +#define _APS_NEXT_SYMED_VALUE 109 #endif #endif diff --git a/src/Cxbx/WinMain.cpp b/src/gui/WinMain.cpp similarity index 59% rename from src/Cxbx/WinMain.cpp rename to src/gui/WinMain.cpp index 8c976e7a7..1c2efb2d8 100644 --- a/src/Cxbx/WinMain.cpp +++ b/src/gui/WinMain.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->WinMain.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -36,9 +27,10 @@ #include "WndMain.h" -#include "CxbxKrnl/CxbxKrnl.h" -#include "CxbxKrnl/Emu.h" -#include "CxbxKrnl/EmuShared.h" +#include "core\kernel\init\CxbxKrnl.h" +#include "core\kernel\support\Emu.h" +#include "EmuShared.h" +#include "common\Settings.hpp" #include // Enable Visual Styles @@ -68,26 +60,69 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if ((UINT_PTR)GetModuleHandle(nullptr) != CXBX_BASE_ADDR) { /*! CXBX_BASE_ADDR is defined as 0x00010000, which is the base address of - the Cxbx.exe host executable. + the Cxbx.exe host executable. Set in Cxbx Project options, Linker, Advanced, Base Address */ MessageBox(NULL, "Cxbx.exe is not loaded to base address 0x00010000 (which is a requirement for Xbox emulation)", "Cxbx-Reloaded", MB_OK | MB_ICONERROR); return EXIT_FAILURE; } + bool bRet, bKernel; + HWND hWnd = nullptr; + DWORD guiProcessID = 0; + + // TODO: Convert ALL __argc & __argv to use main(int argc, char** argv) method. + if (__argc >= 2 && std::strcmp(__argv[1], "/load") == 0 && std::strlen(__argv[2]) > 0) { + bKernel = true; + + // Perform check if command line contain gui's hWnd value. + if (__argc > 3) { + hWnd = (HWND)std::stoi(__argv[3], nullptr, 10); + + hWnd = IsWindow(hWnd) ? hWnd : nullptr; + if (hWnd != nullptr) { + // We don't need thread ID from window handle. + GetWindowThreadProcessId(hWnd, &guiProcessID); + } + } + } + else { + bKernel = false; + guiProcessID = GetCurrentProcessId(); + } + g_exec_filepath = __argv[0]; // NOTE: Workaround solution until simulated "main" function is made. + /*! initialize shared memory */ - EmuShared::Init(); + EmuShared::Init(guiProcessID); bool bFirstLaunch; g_EmuShared->GetIsFirstLaunch(&bFirstLaunch); /* check if process is launch with elevated access then prompt for continue on or not. */ if (!bFirstLaunch) { + + g_Settings = new Settings(); + + if (g_Settings == nullptr) { + MessageBox(nullptr, szSettings_alloc_error, "Cxbx-Reloaded", MB_OK); + EmuShared::Cleanup(); + return EXIT_FAILURE; + } + + bRet = g_Settings->Init(); + if (!bRet) { + EmuShared::Cleanup(); + return EXIT_FAILURE; + } + + log_get_settings(); + bool bElevated = CxbxIsElevated(); - if (bElevated && !bFirstLaunch) { + + if (bElevated && !g_Settings->m_core.allowAdminPrivilege) { int ret = MessageBox(NULL, "Cxbx-Reloaded has detected that it has been launched with Administrator rights.\n" - "\nThis is dangerous, as a maliciously modified Xbox titles could take control of your system.\n" - "\nAre you sure you want to continue?", "Cxbx-Reloaded", MB_YESNO | MB_ICONWARNING); + "\nThis is dangerous, as a maliciously modified Xbox titles could take control of your system.\n" + "\nAre you sure you want to continue?", "Cxbx-Reloaded", MB_YESNO | MB_ICONWARNING); if (ret != IDYES) { EmuShared::Cleanup(); return EXIT_FAILURE; @@ -96,7 +131,28 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine g_EmuShared->SetIsFirstLaunch(true); } - if (__argc >= 2 && strcmp(__argv[1], "/load") == 0 && strlen(__argv[2]) > 0) { + if (bKernel) { + + // NOTE: This is designated for standalone kernel mode launch without GUI + if (g_Settings != nullptr) { + + // Reset to default + g_EmuShared->Reset(); + + g_Settings->Verify(); + g_Settings->SyncToEmulator(); + + // We don't need to keep Settings open plus allow emulator to use unused memory. + delete g_Settings; + g_Settings = nullptr; + + // Perform identical to what GUI will do to certain EmuShared's variable before launch. + g_EmuShared->SetIsEmulating(true); + + // NOTE: This setting the ready status is optional. Internal kernel process is checking if GUI is running. + // Except if enforce check, then we need to re-set ready status every time for non-GUI. + //g_EmuShared->SetIsReady(true); + } /* Initialize Cxbx File Paths */ CxbxInitFilePaths(); @@ -105,6 +161,28 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine return EXIT_SUCCESS; } + // If 2nd GUI executable is launched, load settings file for GUI for editable support. + if (g_Settings == nullptr) { + g_Settings = new Settings(); + + if (g_Settings == nullptr) { + MessageBox(nullptr, szSettings_alloc_error, "Cxbx-Reloaded", MB_OK); + EmuShared::Cleanup(); + return EXIT_FAILURE; + } + + bRet = g_Settings->Init(); + if (!bRet) { + EmuShared::Cleanup(); + return EXIT_FAILURE; + } + + log_get_settings(); + } + + // Possible optional output for GUI + log_generate_active_filter_output(CXBXR_MODULE::INIT); + INITCOMMONCONTROLSEX icc; icc.dwSize = sizeof(icc); icc.dwICC = ICC_WIN95_CLASSES; @@ -125,7 +203,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine /*! optionally open xbe and start emulation, if command line parameter was specified */ if(__argc > 1 && false == MainWindow->HasError()) { - MainWindow->OpenXbe(__argv[1]); + MainWindow->OpenXbe(std::filesystem::absolute(std::filesystem::path(__argv[1])).string().c_str()); MainWindow->StartEmulation(MainWindow->GetHwnd()); } diff --git a/src/Cxbx/Wnd.cpp b/src/gui/Wnd.cpp similarity index 91% rename from src/Cxbx/Wnd.cpp rename to src/gui/Wnd.cpp index d7118cb85..24186788b 100644 --- a/src/Cxbx/Wnd.cpp +++ b/src/gui/Wnd.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->Wnd.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -81,7 +72,7 @@ bool Wnd::ProcessMessages() wnd_class.style = m_clsstyle; wnd_class.hIcon = 0; // TODO : LoadIcon(hmodule, ?) wnd_class.hCursor = LoadCursor(NULL, IDC_ARROW); - wnd_class.lpszMenuName = NULL; + wnd_class.lpszMenuName = nullptr; wnd_class.cbClsExtra = 0; wnd_class.cbWndExtra = 0; wnd_class.hbrBackground = m_background; @@ -90,9 +81,9 @@ bool Wnd::ProcessMessages() m_hwnd = CreateWindowEx ( - NULL, + 0, m_classname, - m_wndname, + m_wndname.c_str(), m_wndstyle, m_x, m_y, diff --git a/src/Cxbx/Wnd.h b/src/gui/Wnd.h similarity index 89% rename from src/Cxbx/Wnd.h rename to src/gui/Wnd.h index 6c7d3d152..40b33c1ec 100644 --- a/src/Cxbx/Wnd.h +++ b/src/gui/Wnd.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->Wnd.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -34,7 +25,7 @@ #ifndef WND_H #define WND_H -#include "Common/Error.h" +#include "common\Error.h" #include @@ -93,7 +84,7 @@ public: // ****************************************************************** ATOM m_class; const char *m_classname; - const char *m_wndname; + std::string m_wndname; UINT m_clsstyle; DWORD m_wndstyle; int m_x, m_y, m_w, m_h; diff --git a/src/Cxbx/WndMain.cpp b/src/gui/WndMain.cpp similarity index 64% rename from src/Cxbx/WndMain.cpp rename to src/gui/WndMain.cpp index d91807d3a..76cfe91bf 100644 --- a/src/Cxbx/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->WndMain.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -29,20 +20,31 @@ // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * // * (c) 2002-2003 Aaron Robinson +// * (c) 2017-2018 RadWolfie +// * (c) 2018 wutno (#/g/punk - Rizon) // * // * All rights reserved // * // ****************************************************************** + +#define LOG_PREFIX CXBXR_MODULE::GUI + +#include "Logging.h" #include "WndMain.h" #include "DlgAbout.h" -#include "DlgControllerConfig.h" +#include "DlgInputConfig.h" #include "DlgVideoConfig.h" #include "DlgAudioConfig.h" +#include "DlgNetworkConfig.h" #include "DlgEepromConfig.h" -#include "DlgXboxControllerPortMapping.h" -#include "Common/XbePrinter.h" // For DumpInformation -#include "CxbxKrnl/EmuShared.h" -#include "..\CxbxKrnl\CxbxKrnl.h" // For CxbxConvertArgToString and CxbxExec +#include "DlgLoggingConfig.h" +#include "common\xbe\XbePrinter.h" // For DumpInformation +#include "EmuShared.h" +#include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For CxbxSetPixelContainerHeader +#include "core\hle\D3D8\XbConvert.h" // For EmuPC2XB_D3DFormat +#include "common\Settings.hpp" + +#include "core\kernel\init\CxbxKrnl.h" // For CxbxConvertArgToString and CxbxExec #include "ResCxbx.h" #include "CxbxVersion.h" #include "Shlwapi.h" @@ -56,7 +58,8 @@ #include // for std::stringstream #include #include -#include "CxbxKrnl/xxhash32.h" // for XXHash32::hash +#include // for _O_TEXT +#include "common\util\hasher.h" #define XBOX_LED_FLASH_PERIOD 176 // if you know a more accurate value, put it here @@ -65,9 +68,9 @@ static int splashLogoWidth, splashLogoHeight; bool g_SaveOnExit = true; -void ClearHLECache(char sStorageLocation[MAX_PATH]) +void ClearSymbolCache(const char sStorageLocation[MAX_PATH]) { - std::string cacheDir = std::string(sStorageLocation) + "\\HLECache\\"; + std::string cacheDir = std::string(sStorageLocation) + "\\SymbolCache\\"; std::string fullpath = cacheDir + "*.ini"; WIN32_FIND_DATA data; @@ -79,7 +82,7 @@ void ClearHLECache(char sStorageLocation[MAX_PATH]) if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { fullpath = cacheDir + data.cFileName; - if (!DeleteFile(fullpath.c_str())) { + if (!std::filesystem::remove(fullpath)) { break; } } @@ -93,17 +96,13 @@ void ClearHLECache(char sStorageLocation[MAX_PATH]) printf("Cleared HLE Cache\n"); } -void WndMain::InitializeSettings() { - HKEY hKey; - if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Cxbx-Reloaded", 0, KEY_ENUMERATE_SUB_KEYS | DELETE | KEY_QUERY_VALUE | KEY_SET_VALUE, &hKey) == ERROR_SUCCESS) { - RegDeleteTree(hKey, NULL); - RegCloseKey(hKey); - - g_SaveOnExit = false; - } +void WndMain::InitializeSettings() +{ + g_Settings->Delete(); + g_SaveOnExit = false; } -#define TIMERID_FPS 0 +#define TIMERID_ACTIVE_EMULATION 0 #define TIMERID_LED 1 void WndMain::ResizeWindow(HWND hwnd, bool bForGUI) @@ -116,12 +115,12 @@ void WndMain::ResizeWindow(HWND hwnd, bool bForGUI) m_h = 480; if (!bForGUI) { // For emulation, get the configured window dimensions - XBVideo XBVideoConf; - g_EmuShared->GetXBVideo(&XBVideoConf); + Settings::s_video XBVideoConf; + g_EmuShared->GetVideoSettings(&XBVideoConf); - const char* resolution = XBVideoConf.GetVideoResolution(); + const char* resolution = XBVideoConf.szVideoResolution; if (2 != sscanf(resolution, "%d x %d", &m_w, &m_h)) { - DbgPrintf("Couldn't parse resolution : %s.\n", resolution); + EmuLog(LOG_LEVEL::DEBUG, "Couldn't parse resolution : %s.", resolution); } } @@ -160,307 +159,49 @@ void WndMain::ResizeWindow(HWND hwnd, bool bForGUI) } WndMain::WndMain(HINSTANCE x_hInstance) : - Wnd(x_hInstance), - m_bCreated(false), - m_Xbe(nullptr), - m_bXbeChanged(false), - m_bIsStarted(false), - m_hwndChild(nullptr), - m_KrnlDebug(DM_NONE), - m_CxbxDebug(DM_NONE), - m_FlagsLLE(0), - m_StorageToggle(CXBX_DATA_APPDATA), - m_StorageLocation(""), - m_dwRecentXbe(0), - m_hDebuggerProc(nullptr), - m_hDebuggerMonitorThread(), - m_prevWindowLoc({ -1, -1 }) + Wnd(x_hInstance) + , m_bCreated(false) + , m_Xbe(nullptr) + , m_bXbeChanged(false) + , m_bIsStarted(false) + , m_hwndChild(nullptr) + , m_hDebuggerProc(nullptr) + , m_hDebuggerMonitorThread() + , m_prevWindowLoc({ -1, -1 }) + , m_LogKrnl_status(false) { - // initialize members - { - m_classname = "WndMain"; - m_wndname = "Cxbx-Reloaded " _CXBX_VERSION; + // initialize members + { + m_classname = "WndMain"; + m_wndname = "Cxbx-Reloaded " + std::string(CxbxVersionStr); + } - m_XbeFilename = (char*)calloc(1, MAX_PATH); + // load configuration from settings file + { + // NOTE: Settings has already been initalized/load from file before WndMain constructed. - m_CxbxDebugFilename = (char*)calloc(1, MAX_PATH); - m_KrnlDebugFilename = (char*)calloc(1, MAX_PATH); + g_Settings->Verify(); - for(int v=0;vSetStorageLocation(g_Settings->GetDataLocation().c_str()); - // load configuration from registry - { - DWORD dwDisposition, dwType, dwSize; - HKEY hKey; - - if(RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Cxbx-Reloaded", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) - { - LONG result = ERROR_SUCCESS; - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "LLEFLAGS", NULL, &dwType, (PBYTE)&m_FlagsLLE, &dwSize); - if (result != ERROR_SUCCESS) { - m_FlagsLLE = 0; + unsigned int i = 0; + do { + if (g_Settings->m_gui.szRecentXbeFiles[i].size() == 0) { + break; } + i++; + } while (i < RECENT_XBE_LIST_MAX); - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackDisablePixelShaders", NULL, &dwType, (PBYTE)&m_DisablePixelShaders, &dwSize); - if (result != ERROR_SUCCESS) { - m_DisablePixelShaders = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackUncapFrameRate", NULL, &dwType, (PBYTE)&m_UncapFramerate, &dwSize); - if (result != ERROR_SUCCESS) { - m_UncapFramerate = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackUseAllCores", NULL, &dwType, (PBYTE)&m_UseAllCores, &dwSize); - if (result != ERROR_SUCCESS) { - m_UseAllCores = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackSkipRdtscPatching", NULL, &dwType, (PBYTE)&m_SkipRdtscPatching, &dwSize); - if (result != ERROR_SUCCESS) { - m_SkipRdtscPatching = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackScaleViewport", NULL, &dwType, (PBYTE)&m_ScaleViewport, &dwSize); - if (result != ERROR_SUCCESS) { - m_ScaleViewport = 0; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "HackDirectBackBufferAccess", NULL, &dwType, (PBYTE)&m_DirectHostBackBufferAccess, &dwSize); - if (result != ERROR_SUCCESS) { - m_DirectHostBackBufferAccess = 1; - } - - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "CxbxDebug", NULL, &dwType, (PBYTE)&m_CxbxDebug, &dwSize); - if (result != ERROR_SUCCESS) { - m_CxbxDebug = DebugMode::DM_NONE; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "KrnlDebug", NULL, &dwType, (PBYTE)&m_KrnlDebug, &dwSize); - if (result != ERROR_SUCCESS) { - m_KrnlDebug = DebugMode::DM_NONE; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "RecentXbe", NULL, &dwType, (PBYTE)&m_dwRecentXbe, &dwSize); - if (result != ERROR_SUCCESS) { - m_dwRecentXbe = 0; - } - - dwType = REG_SZ; dwSize = MAX_PATH; ULONG lErrCodeCxbxDebugFilename; - lErrCodeCxbxDebugFilename = RegQueryValueEx(hKey, "CxbxDebugFilename", NULL, &dwType, (PBYTE)m_CxbxDebugFilename, &dwSize); - if (lErrCodeCxbxDebugFilename != ERROR_SUCCESS) { - m_CxbxDebugFilename[0] = '\0'; - } - - dwType = REG_SZ; dwSize = MAX_PATH; LONG lErrCodeKrnlDebugFilename; - lErrCodeKrnlDebugFilename = RegQueryValueEx(hKey, "KrnlDebugFilename", NULL, &dwType, (PBYTE)m_KrnlDebugFilename, &dwSize); - if (lErrCodeKrnlDebugFilename != ERROR_SUCCESS) { - m_KrnlDebugFilename[0] = '\0'; - } - - dwType = REG_DWORD; dwSize = sizeof(DWORD); - result = RegQueryValueEx(hKey, "DataStorageToggle", NULL, &dwType, (PBYTE)&m_StorageToggle, &dwSize); - if (result != ERROR_SUCCESS) { - m_StorageToggle = CXBX_DATA_APPDATA; - } - - switch (m_StorageToggle) { - case CXBX_DATA_APPDATA: - default: - SHGetSpecialFolderPath(NULL, m_StorageLocation, CSIDL_APPDATA, TRUE); - m_StorageToggle = CXBX_DATA_APPDATA; - strncat(m_StorageLocation, "\\Cxbx-Reloaded", MAX_PATH); - break; - - case CXBX_DATA_CURDIR: - GetCurrentDirectory(MAX_PATH, m_StorageLocation); - break; - - case CXBX_DATA_CUSTOM: - dwType = REG_SZ; dwSize = MAX_PATH; - result = RegQueryValueEx(hKey, "DataStorageLocation", NULL, &dwType, (PBYTE)&m_StorageLocation, &dwSize); - if (result != ERROR_SUCCESS) { - SHGetSpecialFolderPath(NULL, m_StorageLocation, CSIDL_APPDATA, TRUE); - strncat(m_StorageLocation, "\\Cxbx-Reloaded", MAX_PATH); - } - break; - } - // NOTE: This is a requirement for pre-verification from GUI. Used in CxbxInitFilePaths function. - g_EmuShared->SetStorageLocation(m_StorageLocation); - - // Prevent using an incorrect path from the registry if the debug folders have been moved - if (m_CxbxDebug == DM_FILE) - { - if(lErrCodeCxbxDebugFilename == ERROR_FILE_NOT_FOUND || strlen(m_CxbxDebugFilename) == 0) - { - m_CxbxDebug = DM_NONE; - } - else - { - char *CxbxDebugPath = (char*)calloc(1, MAX_PATH); - char *CxbxDebugName = (char*)calloc(1, MAX_PATH); - - strcpy(CxbxDebugName, strrchr(m_CxbxDebugFilename, '\\')); - - if(strlen(m_CxbxDebugFilename) < strlen(CxbxDebugName)) - { - memset((char*)m_CxbxDebugFilename, '\0', MAX_PATH); - m_CxbxDebug = DM_NONE; - } - else - { - strncpy(CxbxDebugPath, m_CxbxDebugFilename, strlen(m_CxbxDebugFilename) - strlen(CxbxDebugName)); - if(PathFileExists((LPCSTR)CxbxDebugPath) == FALSE) - { - memset((char*)m_CxbxDebugFilename, '\0', MAX_PATH); - m_CxbxDebug = DM_NONE; - } - } - free(CxbxDebugPath); - free(CxbxDebugName); - } - } - - if (m_KrnlDebug == DM_FILE) - { - if(lErrCodeKrnlDebugFilename == ERROR_FILE_NOT_FOUND || strlen(m_KrnlDebugFilename) == 0) - { - m_KrnlDebug = DM_NONE; - } - else - { - char *KrnlDebugPath = (char*)calloc(1, MAX_PATH); - char *KrnlDebugName = (char*)calloc(1, MAX_PATH); - - strcpy(KrnlDebugName, strrchr(m_KrnlDebugFilename, '\\')); - - if(strlen(m_KrnlDebugFilename) < strlen(KrnlDebugName)) - { - memset((char*)m_KrnlDebugFilename, '\0', MAX_PATH); - m_KrnlDebug = DM_NONE; - } - else - { - strncpy(KrnlDebugPath, m_KrnlDebugFilename, strlen(m_KrnlDebugFilename) - strlen(KrnlDebugName)); - if(PathFileExists((LPCSTR)KrnlDebugPath) == FALSE) - { - memset((char*)m_KrnlDebugFilename, '\0', MAX_PATH); - m_KrnlDebug = DM_NONE; - } - } - free(KrnlDebugPath); - free(KrnlDebugName); - } - } - - int v=0; - - for(v=0;vSave(); } // Close opened debugger monitor if there is one @@ -469,11 +210,7 @@ WndMain::~WndMain() // cleanup allocations { delete m_Xbe; - - free(m_XbeFilename); - - free(m_CxbxDebugFilename); - free(m_KrnlDebugFilename); + delete g_Settings; } } @@ -525,7 +262,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP m_SplashDC = CreateCompatibleDC(hDC); m_LogoDC = CreateCompatibleDC(hDC); - + m_OrigBmp = (HBITMAP)SelectObject(m_SplashDC, m_SplashBmp); m_OrigLogo = (HBITMAP)SelectObject(m_LogoDC, m_LogoBmp); @@ -535,7 +272,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ReleaseDC(hwnd, hDC); } - SetClassLong(hwnd, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_CXBX))); + SetClassLong(hwnd, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); DragAcceptFiles(hwnd, TRUE); // Allow Drag and Drop if Cxbx is run with elevated privileges on Windows Vista and above @@ -548,22 +285,22 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP } break; - // NOTE: WM_PARENTNOTIFY was triggered by kernel process' graphic window creation. - case WM_PARENTNOTIFY: - { - switch(LOWORD(wParam)) - { - case WM_CREATE: - { + // NOTE: WM_PARENTNOTIFY was triggered by kernel process' graphic window creation. + case WM_PARENTNOTIFY: + { + switch(LOWORD(wParam)) + { + case WM_CREATE: + { if (m_hwndChild == NULL) { - float fps = 0.0f; - float mspf = 0.0f; - int LedSequence[4] = { XBOX_LED_COLOUR_GREEN, XBOX_LED_COLOUR_GREEN, XBOX_LED_COLOUR_GREEN, XBOX_LED_COLOUR_GREEN }; - g_EmuShared->SetCurrentMSpF(&mspf); - g_EmuShared->SetCurrentFPS(&fps); - g_EmuShared->SetLedSequence(LedSequence); - SetTimer(hwnd, TIMERID_FPS, 1000, (TIMERPROC)NULL); - SetTimer(hwnd, TIMERID_LED, XBOX_LED_FLASH_PERIOD, (TIMERPROC)NULL); + m_FPS_status = 0.0f; + m_MSpF_status = 0.0f; + m_LedSeq_status_block = (XBOX_LED_COLOUR_GREEN << 24) | + (XBOX_LED_COLOUR_GREEN << 16) | + (XBOX_LED_COLOUR_GREEN << 8) | + (XBOX_LED_COLOUR_GREEN); + SetTimer(hwnd, TIMERID_ACTIVE_EMULATION, 1000, (TIMERPROC)nullptr); + SetTimer(hwnd, TIMERID_LED, XBOX_LED_FLASH_PERIOD, (TIMERPROC)nullptr); m_hwndChild = GetWindow(hwnd, GW_CHILD); UpdateCaption(); RefreshMenus(); @@ -571,39 +308,50 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP else { m_hwndChild = GetWindow(hwnd, GW_CHILD); } - } - break; + } + break; - case WM_DESTROY: - { + case WM_DESTROY: + { // (HWND)HIWORD(wParam) seems to be NULL, so we can't compare to m_hwndChild if (m_hwndChild != NULL) { // Let's hope this signal originated from the only child window - KillTimer(hwnd, TIMERID_FPS); + KillTimer(hwnd, TIMERID_ACTIVE_EMULATION); KillTimer(hwnd, TIMERID_LED); m_hwndChild = NULL; StopEmulation(); DrawLedBitmap(hwnd, true); } - } - break; + } + case WM_COMMAND: + { + switch (HIWORD(wParam)) { + case ID_GUI_STATUS_LLE_FLAGS: + m_FlagsLLE_status = static_cast(lParam); + break; + + case ID_GUI_STATUS_XBOX_LED_COLOUR: + m_LedSeq_status_block = static_cast(lParam); + break; + + case ID_GUI_STATUS_LOG_ENABLED: + m_LogKrnl_status = static_cast(lParam); + UpdateLogStatus(); + break; - case WM_USER: { - switch(HIWORD(wParam)) { // NOTE: If anything need to set before kernel process start do anything, do it here. - case ID_KRNL_IS_READY: { + case ID_GUI_STATUS_KRNL_IS_READY: { Crash_Manager_Data* pCMD = (Crash_Manager_Data*)malloc(sizeof(Crash_Manager_Data)); pCMD->pWndMain = this; pCMD->dwChildProcID = lParam; // lParam is process ID. std::thread(CrashMonitorWrapper, pCMD).detach(); - g_EmuShared->SetFlagsLLE(&m_FlagsLLE); g_EmuShared->SetIsEmulating(true); // NOTE: Putting in here raise to low or medium risk due to debugger will launch itself. (Current workaround) g_EmuShared->SetIsReady(true); break; } } - break; } + break; } }; break; // added per PVS suggestion. @@ -612,9 +360,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { switch (wParam) { - case TIMERID_FPS: + case TIMERID_ACTIVE_EMULATION: { - UpdateCaption(); + RefreshAllStatus(); } break; @@ -633,8 +381,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { SendMessage(m_hwndChild, uMsg, wParam, lParam); } + else + { + return DefWindowProc(hwnd, uMsg, wParam, lParam); + } }; - break; // added per PVS suggestion. + break; // added per PVS suggestion. case WM_PAINT: { @@ -718,47 +470,59 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { case VK_F5: { - // Try to open the most recent Xbe if none is opened yet : - if (m_Xbe == nullptr) - OpenMRU(0); + // Start emulation normally + if (!m_bIsStarted) { + // Try to open the most recent Xbe if none is opened yet : + if (m_Xbe == nullptr) + OpenMRU(0); - if (m_Xbe != nullptr) - if (!m_bIsStarted) + if (m_Xbe != nullptr) StartEmulation(hwnd); + + break; + } + // fall through } - break; case VK_F6: { - if(m_bIsStarted) - StopEmulation(); + // Stop emulation + if (m_bIsStarted) + { + StopEmulation(); + break; + } + // fall through } - break; case VK_F7: { - // Try to open the dashboard xbe if none is opened yet : + // Open the dashboard xbe if (!m_bIsStarted) { if (m_Xbe != nullptr) { CloseXbe(); } OpenDashboard(); + break; } + // fall through } - break; case VK_F9: { - // Try to open the most recent Xbe if none is opened yet : + // Start emulation with the debugger if (!m_bIsStarted) { + // Try to open the most recent Xbe if none is opened yet if (m_Xbe == nullptr) OpenMRU(0); if (m_Xbe != nullptr) StartEmulation(hwnd, debuggerOn); + + break; } + // fall through } - break; default: { @@ -766,6 +530,10 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { SendMessage(m_hwndChild, uMsg, wParam, lParam); } + else + { + DefWindowProc(hwnd, uMsg, wParam, lParam); + } } } } @@ -797,9 +565,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; if (GetOpenFileName(&ofn) == TRUE) @@ -866,9 +634,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "bmp"; ofn.lpstrTitle = "Export Logo Bitmap"; ofn.Flags = OFN_PATHMUSTEXIST; @@ -884,7 +652,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP // export logo bitmap { - uint08 i_gray[100 * 17]; + uint8_t i_gray[100 * 17]; m_Xbe->ExportLogoBitmap(i_gray); @@ -896,7 +664,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { BITMAPFILEHEADER bmfh; - bmfh.bfType = *(uint16*)"BM"; + bmfh.bfType = *(uint16_t*)"BM"; bmfh.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) - sizeof(RGBQUAD) + (100 * 17) * sizeof(RGBTRIPLE) + 2; bmfh.bfReserved1 = 0; bmfh.bfReserved2 = 0; @@ -928,7 +696,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { RGBTRIPLE bmp_data[100 * 17]; - for (uint32 v = 0; v < 100 * 17; v++) + for (uint32_t v = 0; v < 100 * 17; v++) { bmp_data[v].rgbtRed = i_gray[v]; bmp_data[v].rgbtGreen = i_gray[v]; @@ -940,7 +708,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP // write bitmap padding { - uint16 pad = 0; + uint16_t pad = 0; fwrite(&pad, 2, 1, LogoBitmap); } @@ -977,9 +745,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "bmp"; ofn.lpstrTitle = "Import Logo Bitmap"; ofn.Flags = OFN_PATHMUSTEXIST; @@ -988,7 +756,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { // import logo bitmap { - uint08 i_gray[100 * 17]; + uint8_t i_gray[100 * 17]; // read bitmap file { @@ -1003,7 +771,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP fread(&bmfh, sizeof(bmfh), 1, logo); - if (bmfh.bfType != *(uint16*)"BM") + if (bmfh.bfType != *(uint16_t*)"BM") bmp_err = "Invalid bitmap file...\n\nonly allows 24 bit bitmaps (100 by 17 pixels) with row order swapped"; else if (bmfh.bfSize != sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) - sizeof(RGBQUAD) + (100 * 17) * sizeof(RGBTRIPLE) + 2) bmp_err = "Invalid bitmap file...\n\nonly allows 24 bit bitmaps (100 by 17 pixels) with row order swapped"; @@ -1027,7 +795,7 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP fread(bmp_data, 100 * 17 * sizeof(RGBTRIPLE), 1, logo); - for (uint32 c = 0; c < 100 * 17; c++) + for (uint32_t c = 0; c < 100 * 17; c++) i_gray[c] = (char)(((float)bmp_data[c].rgbtRed + (float)bmp_data[c].rgbtGreen + (float)bmp_data[c].rgbtBlue) / 3.0); } @@ -1098,8 +866,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP if ((m_Xbe->m_Header.dwEntryAddr ^ XOR_EP_RETAIL) > 0x01000000) { // we're in debug mode, so switch over to retail - uint32 ep = m_Xbe->m_Header.dwEntryAddr ^ XOR_EP_RETAIL; // decode from debug mode - uint32 kt = m_Xbe->m_Header.dwKernelImageThunkAddr ^ XOR_KT_DEBUG; // decode from debug mode + uint32_t ep = m_Xbe->m_Header.dwEntryAddr ^ XOR_EP_RETAIL; // decode from debug mode + uint32_t kt = m_Xbe->m_Header.dwKernelImageThunkAddr ^ XOR_KT_DEBUG; // decode from debug mode m_Xbe->m_Header.dwEntryAddr = ep ^ XOR_EP_DEBUG; // encode to retail mode m_Xbe->m_Header.dwKernelImageThunkAddr = kt ^ XOR_KT_RETAIL; // encode to retail mode @@ -1107,8 +875,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP else { // we're in retail mode, so switch to debug - uint32 ep = m_Xbe->m_Header.dwEntryAddr ^ XOR_EP_DEBUG; // decode from retail mode - uint32 kt = m_Xbe->m_Header.dwKernelImageThunkAddr ^ XOR_KT_RETAIL; // decode from retail mode + uint32_t ep = m_Xbe->m_Header.dwEntryAddr ^ XOR_EP_DEBUG; // decode from retail mode + uint32_t kt = m_Xbe->m_Header.dwKernelImageThunkAddr ^ XOR_KT_RETAIL; // decode from retail mode m_Xbe->m_Header.dwEntryAddr = ep ^ XOR_EP_RETAIL; // encode to debug mode m_Xbe->m_Header.dwKernelImageThunkAddr = kt ^ XOR_KT_DEBUG; // encode to debug mode @@ -1137,9 +905,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "txt"; ofn.Flags = OFN_PATHMUSTEXIST; @@ -1192,12 +960,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP } break; - case ID_SETTINGS_CONFIG_XBOX_CONTROLLER_MAPPING: - ShowXboxControllerPortMappingConfig(hwnd); - break; - - case ID_SETTINGS_CONFIG_CONTROLLER: - ShowControllerConfig(hwnd); + case ID_SETTINGS_CONFIG_INPUT: + ShowInputConfig(hwnd, m_hwndChild); break; case ID_SETTINGS_CONFIG_VIDEO: @@ -1208,6 +972,10 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ShowAudioConfig(hwnd); break; + case ID_SETTINGS_CONFIG_NETWORK: + ShowNetworkConfig(hwnd); + break; + case ID_SETTINGS_CONFIG_EEPROM: { if (m_bIsStarted) { @@ -1220,23 +988,29 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP } break; + case ID_SETTINGS_CONFIG_LOGGING: + { + ShowLoggingConfig(hwnd, m_hwndChild); + } + break; + case ID_SETTINGS_CONFIG_DLOCCUSTOM: { char szDir[MAX_PATH]; BROWSEINFO bInfo; bInfo.hwndOwner = NULL; - bInfo.pidlRoot = NULL; + bInfo.pidlRoot = nullptr; bInfo.pszDisplayName = szDir; bInfo.lpszTitle = "Please, select a folder"; bInfo.ulFlags = BIF_NEWDIALOGSTYLE, BIF_EDITBOX, BIF_VALIDATE; - bInfo.lpfn = NULL; + bInfo.lpfn = nullptr; bInfo.lParam = 0; bInfo.iImage = -1; LPITEMIDLIST lpItem = SHBrowseForFolder(&bInfo); - if (lpItem != NULL) + if (lpItem != nullptr) { SHGetPathFromIDList(lpItem, szDir); @@ -1264,8 +1038,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP break; } - m_StorageToggle = CXBX_DATA_CUSTOM; - strncpy(m_StorageLocation, szDirTemp.c_str(), MAX_PATH); + g_Settings->m_gui.DataStorageToggle = CXBX_DATA_CUSTOM; + g_Settings->m_gui.szCustomLocation = szDirTemp; RefreshMenus(); } } @@ -1273,46 +1047,39 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_SETTINGS_CONFIG_DLOCAPPDATA: { - char szDir[MAX_PATH]; - - SHGetSpecialFolderPath(NULL, szDir, CSIDL_APPDATA, TRUE); - m_StorageToggle = CXBX_DATA_APPDATA; - strncpy(m_StorageLocation, szDir, MAX_PATH); - strncat(m_StorageLocation, "\\Cxbx-Reloaded", MAX_PATH); + g_Settings->m_gui.DataStorageToggle = CXBX_DATA_APPDATA; RefreshMenus(); } break; - case ID_SETTINGS_CONFIG_DLOCCURDIR: + case ID_SETTINGS_CONFIG_DLOCEXECDIR: { - - GetCurrentDirectory(MAX_PATH, m_StorageLocation); - m_StorageToggle = CXBX_DATA_CURDIR; + g_Settings->m_gui.DataStorageToggle = CXBX_DATA_EXECDIR; RefreshMenus(); } break; case ID_CACHE_CLEARHLECACHE_ALL: { - ClearHLECache(m_StorageLocation); - MessageBox(m_hwnd, "The entire HLE Cache has been cleared.", "Cxbx-Reloaded", MB_OK); + ClearSymbolCache(g_Settings->GetDataLocation().c_str()); + MessageBox(m_hwnd, "The entire Symbol Cache has been cleared.", "Cxbx-Reloaded", MB_OK); } break; case ID_CACHE_CLEARHLECACHE_CURRENT: { - std::string cacheDir = std::string(m_StorageLocation) + "\\HLECache\\"; + std::string cacheDir = g_Settings->GetDataLocation() + "\\SymbolCache\\"; // Hash the loaded XBE's header, use it as a filename - uint32_t uiHash = XXHash32::hash((void*)&m_Xbe->m_Header, sizeof(Xbe::Header), 0); + uint64_t uiHash = ComputeHash((void*)&m_Xbe->m_Header, sizeof(Xbe::Header)); std::stringstream sstream; std::string szTitleName(m_Xbe->m_szAsciiTitle); m_Xbe->PurgeBadChar(szTitleName); sstream << cacheDir << szTitleName << "-" << std::hex << uiHash << ".ini"; std::string fullpath = sstream.str(); - if (DeleteFile(fullpath.c_str())) { - MessageBox(m_hwnd, "This title's HLE Cache entry has been cleared.", "Cxbx-Reloaded", MB_OK); + if (std::filesystem::remove(fullpath)) { + MessageBox(m_hwnd, "This title's Symbol Cache entry has been cleared.", "Cxbx-Reloaded", MB_OK); } } break; @@ -1332,11 +1099,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE: { - if (m_KrnlDebug == DM_NONE || m_KrnlDebug == DM_FILE) - m_KrnlDebug = DM_CONSOLE; - else - m_KrnlDebug = DM_NONE; - + if (g_Settings->m_core.KrnlDebugMode == DM_NONE || g_Settings->m_core.KrnlDebugMode == DM_FILE) { + g_Settings->m_core.KrnlDebugMode = DM_CONSOLE; + } + else { + g_Settings->m_core.KrnlDebugMode = DM_NONE; + } MessageBox(m_hwnd, "This will not take effect until the next time emulation is started.\n", "Cxbx-Reloaded", MB_OK); RefreshMenus(); @@ -1347,9 +1115,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_EMULATION_DEBUGOUTPUTKERNEL_FILE: { - if (m_KrnlDebug == DM_FILE) - { - m_KrnlDebug = DM_NONE; + if (g_Settings->m_core.KrnlDebugMode == DM_FILE) { + g_Settings->m_core.KrnlDebugMode = DM_NONE; RefreshMenus(); @@ -1367,9 +1134,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "txt"; ofn.Flags = OFN_PATHMUSTEXIST; @@ -1377,9 +1144,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { MessageBox(m_hwnd, "This will not take effect until emulation is (re)started.\n", "Cxbx-Reloaded", MB_OK); - strncpy(m_KrnlDebugFilename, ofn.lpstrFile, MAX_PATH - 1); + strncpy(g_Settings->m_core.szKrnlDebug, ofn.lpstrFile, MAX_PATH - 1); - m_KrnlDebug = DM_FILE; + g_Settings->m_core.KrnlDebugMode = DM_FILE; RefreshMenus(); @@ -1391,11 +1158,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE: { - if (m_CxbxDebug == DM_NONE || m_CxbxDebug == DM_FILE) - m_CxbxDebug = DM_CONSOLE; - else - m_CxbxDebug = DM_NONE; - + if (g_Settings->m_gui.CxbxDebugMode == DM_NONE || g_Settings->m_gui.CxbxDebugMode == DM_FILE) { + g_Settings->m_gui.CxbxDebugMode = DM_CONSOLE; + } + else { + g_Settings->m_gui.CxbxDebugMode = DM_NONE; + } RefreshMenus(); UpdateDebugConsoles(); @@ -1404,9 +1172,9 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_EMULATION_DEBUGOUTPUTGUI_FILE: { - if (m_CxbxDebug == DM_FILE) + if (g_Settings->m_gui.CxbxDebugMode == DM_FILE) { - m_CxbxDebug = DM_NONE; + g_Settings->m_gui.CxbxDebugMode = DM_NONE; RefreshMenus(); @@ -1424,17 +1192,17 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "txt"; ofn.Flags = OFN_PATHMUSTEXIST; if (GetSaveFileName(&ofn) != FALSE) { - strncpy(m_CxbxDebugFilename, ofn.lpstrFile, MAX_PATH - 1); + g_Settings->m_gui.szCxbxDebugFile = ofn.lpstrFile; - m_CxbxDebug = DM_FILE; + g_Settings->m_gui.CxbxDebugMode = DM_FILE; RefreshMenus(); @@ -1447,25 +1215,32 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case ID_EMULATION_LLE_JIT: { - m_FlagsLLE = m_FlagsLLE ^ LLE_JIT; + g_Settings->m_core.FlagsLLE = g_Settings->m_core.FlagsLLE ^ LLE_JIT; RefreshMenus(); } break; case ID_EMULATION_LLE_APU: { - m_FlagsLLE = m_FlagsLLE ^ LLE_APU; + g_Settings->m_core.FlagsLLE = g_Settings->m_core.FlagsLLE ^ LLE_APU; RefreshMenus(); } break; case ID_EMULATION_LLE_GPU: { - m_FlagsLLE = m_FlagsLLE ^ LLE_GPU; + g_Settings->m_core.FlagsLLE = g_Settings->m_core.FlagsLLE ^ LLE_GPU; RefreshMenus(); } break; - +#if 0 // Reenable this when LLE USB actually works + case ID_EMULATION_LLE_USB: + { + g_Settings->m_core.FlagsLLE = g_Settings->m_core.FlagsLLE ^ LLE_USB; + RefreshMenus(); + } + break; +#endif case ID_EMULATION_START: if (m_Xbe != nullptr) { @@ -1485,32 +1260,29 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP break; case ID_HACKS_DISABLEPIXELSHADERS: - m_DisablePixelShaders = !m_DisablePixelShaders; - RefreshMenus(); - break; - - case ID_HACKS_UNCAPFRAMERATE: - m_UncapFramerate = !m_UncapFramerate; + g_Settings->m_hacks.DisablePixelShaders = !g_Settings->m_hacks.DisablePixelShaders; RefreshMenus(); break; case ID_HACKS_RUNXBOXTHREADSONALLCORES: - m_UseAllCores = !m_UseAllCores; + if (g_Settings->m_hacks.UseAllCores == false) { + int ret = MessageBox(hwnd, "Activating this hack will make the emulator more likely to crash and/or hang. \ +Please do not report issues with games while this hack is active. Are you sure you want to turn it on?", "Cxbx-Reloaded", MB_YESNO | MB_ICONWARNING | MB_APPLMODAL); + if (ret == IDNO) { + break; + } + } + g_Settings->m_hacks.UseAllCores = !g_Settings->m_hacks.UseAllCores; RefreshMenus(); break; case ID_HACKS_SKIPRDTSCPATCHING: - m_SkipRdtscPatching = !m_SkipRdtscPatching; + g_Settings->m_hacks.SkipRdtscPatching = !g_Settings->m_hacks.SkipRdtscPatching; RefreshMenus(); break; - case ID_HACKS_SCALEVIEWPORT: - m_ScaleViewport = !m_ScaleViewport; - RefreshMenus(); - break; - - case ID_HACKS_RENDERDIRECTLYTOHOSTBACKBUFFER: - m_DirectHostBackBufferAccess = !m_DirectHostBackBufferAccess; + case ID_SETTINGS_ALLOWADMINPRIVILEGE: + g_Settings->m_core.allowAdminPrivilege = !g_Settings->m_core.allowAdminPrivilege; RefreshMenus(); break; @@ -1521,13 +1293,22 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP break; case ID_HELP_HOMEPAGE: - ShellExecute(NULL, "open", "https://github.com/Cxbx-Reloaded/Cxbx-Reloaded", NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, "open", "https://github.com/Cxbx-Reloaded/Cxbx-Reloaded", nullptr, nullptr, SW_SHOWNORMAL); break; + } break; } + case WM_MOVE: + { + // Redraw the window on move, prevents corrupt background image that happens + // when windows doesn't call the WM_DRAW event when the window is moved too quickly. + RedrawWindow(hwnd, nullptr, NULL, RDW_INVALIDATE); + break; + } + case WM_CLOSE: { if(m_Xbe != nullptr) @@ -1606,11 +1387,11 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP // suggest a file name void WndMain::SuggestFilename(const char *x_orig_filename, char *x_filename, char x_extension[4]) { - if(strrchr(x_orig_filename, '\\') != NULL) + if(strrchr(x_orig_filename, '\\') != nullptr) { strcpy(x_filename, x_orig_filename); char *loc = strrchr(x_filename, '.'); - if (loc != NULL) + if (loc != nullptr) strncpy(loc, &x_extension[0], 4); } } @@ -1633,7 +1414,7 @@ void WndMain::XbeLoaded() // load logo bitmap void WndMain::LoadLogo() { - uint08 i_gray[100*17]; + uint8_t i_gray[100*17]; m_Xbe->ExportLogoBitmap(i_gray); @@ -1649,17 +1430,17 @@ void WndMain::LoadLogo() return; } - uint32 v=0; - for(uint32 y=0;y<17;y++) + uint32_t v=0; + for(uint32_t y=0;y<17;y++) { - for(uint32 x=0;x<100;x++) + for(uint32_t x=0;x<100;x++) { SetPixel(m_LogoDC, x, y, RGB(i_gray[v], i_gray[v], i_gray[v])); v++; } } - RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE); + RedrawWindow(m_hwnd, nullptr, NULL, RDW_INVALIDATE); } // TODO : Move these types to a more appropriate place @@ -1697,63 +1478,63 @@ typedef struct { void WndMain::LoadGameLogo() { // Export Game Logo bitmap (XTIMAG or XSIMAG) - uint8 *pSection = (uint8 *)m_Xbe->FindSection("$$XTIMAGE"); // Check for XTIMAGE + uint8_t *pSection = (uint8_t *)m_Xbe->FindSection("$$XTIMAGE"); // Check for XTIMAGE if (!pSection) { - pSection = (uint8 *)m_Xbe->FindSection("$$XSIMAGE"); // if XTIMAGE isn't present, check for XSIMAGE (smaller) + pSection = (uint8_t *)m_Xbe->FindSection("$$XSIMAGE"); // if XTIMAGE isn't present, check for XSIMAGE (smaller) if (!pSection) { return; } } gameLogoWidth = 0; - gameLogoHeight = 0; + gameLogoHeight = 0; - uint8 *ImageData = NULL; + uint8_t *ImageData = nullptr; XTL::X_D3DPixelContainer XboxPixelContainer = {}; XTL::X_D3DPixelContainer *pXboxPixelContainer = &XboxPixelContainer; switch (*(DWORD*)pSection) { case MAKEFOURCC('D', 'D', 'S', ' '): { DDS_HEADER *pDDSHeader = (DDS_HEADER *)(pSection + sizeof(DWORD)); - XTL::D3DFORMAT Format = XTL::D3DFMT_UNKNOWN; + D3DFORMAT Format = D3DFMT_UNKNOWN; if (pDDSHeader->ddspf.dwFlags & DDPF_FOURCC) { switch (pDDSHeader->ddspf.dwFourCC) { - case MAKEFOURCC('D', 'X', 'T', '1'): Format = XTL::D3DFMT_DXT1; break; - case MAKEFOURCC('D', 'X', 'T', '3'): Format = XTL::D3DFMT_DXT3; break; - case MAKEFOURCC('D', 'X', 'T', '5'): Format = XTL::D3DFMT_DXT5; break; + case MAKEFOURCC('D', 'X', 'T', '1'): Format = D3DFMT_DXT1; break; + case MAKEFOURCC('D', 'X', 'T', '3'): Format = D3DFMT_DXT3; break; + case MAKEFOURCC('D', 'X', 'T', '5'): Format = D3DFMT_DXT5; break; } } else { // TODO : Determine D3D format based on pDDSHeader->ddspf.dwABitMask, .dwRBitMask, .dwGBitMask and .dwBBitMask } - if (Format == XTL::D3DFMT_UNKNOWN) + if (Format == D3DFMT_UNKNOWN) return; - ImageData = (uint8 *)(pSection + sizeof(DWORD) + pDDSHeader->dwSize); + ImageData = (uint8_t *)(pSection + sizeof(DWORD) + pDDSHeader->dwSize); //gameLogoHeight = pDDSHeader->dwHeight; //gameLogoWidth = pDDSHeader->dwWidth; - + // TODO : Use PixelCopy code here to decode. For now, fake it : - XTL::CxbxSetPixelContainerHeader(&XboxPixelContainer, + CxbxSetPixelContainerHeader(&XboxPixelContainer, 0, // Common - could be X_D3DCOMMON_TYPE_TEXTURE - (XTL::UINT)pDDSHeader->dwWidth, - (XTL::UINT)pDDSHeader->dwHeight, + (UINT)pDDSHeader->dwWidth, + (UINT)pDDSHeader->dwHeight, 1, - XTL::EmuPC2XB_D3DFormat(Format), + EmuPC2XB_D3DFormat(Format), 2, - (XTL::UINT)pDDSHeader->dwPitchOrLinearSize); + (UINT)pDDSHeader->dwPitchOrLinearSize); break; } case MAKEFOURCC('X', 'P', 'R', '0'): case MAKEFOURCC('X', 'P', 'R', '1'): { struct Xbe::XprHeader *pXprHeader = (struct Xbe::XprHeader*)pSection; - uint SizeOfResourceHeaders = pXprHeader->dwXprHeaderSize - sizeof(Xbe::XprHeader); - uint SizeOfResourceData = pXprHeader->dwXprTotalSize - pXprHeader->dwXprHeaderSize; + unsigned int SizeOfResourceHeaders = pXprHeader->dwXprHeaderSize - sizeof(Xbe::XprHeader); + unsigned int SizeOfResourceData = pXprHeader->dwXprTotalSize - pXprHeader->dwXprHeaderSize; - uint8 *ResourceHeaders = pSection + sizeof(Xbe::XprHeader); - uint8 *ResourceData = ResourceHeaders + SizeOfResourceHeaders; + uint8_t *ResourceHeaders = pSection + sizeof(Xbe::XprHeader); + uint8_t *ResourceData = ResourceHeaders + SizeOfResourceHeaders; pXboxPixelContainer = (XTL::X_D3DPixelContainer*)ResourceHeaders; ImageData = ResourceData; @@ -1765,7 +1546,7 @@ void WndMain::LoadGameLogo() } } - void *bitmapData = XTL::ConvertD3DTextureToARGB(pXboxPixelContainer, ImageData, &gameLogoWidth, &gameLogoHeight); + void *bitmapData = ConvertD3DTextureToARGB(pXboxPixelContainer, ImageData, &gameLogoWidth, &gameLogoHeight); if (!bitmapData) return; @@ -1794,7 +1575,7 @@ void WndMain::LoadGameLogo() m_GameLogoDC = CreateCompatibleDC(hDC); m_OrigGameLogo = (HBITMAP)SelectObject(m_GameLogoDC, m_GameLogoBMP); - RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE); + RedrawWindow(m_hwnd, nullptr, NULL, RDW_INVALIDATE); if (hDC != NULL) ReleaseDC(m_hwnd, hDC); @@ -1881,37 +1662,40 @@ void WndMain::RefreshMenus() HMENU emul_debg = GetSubMenu(view_menu, 0); HMENU emul_krnl = GetSubMenu(view_menu, 1); - if (m_KrnlDebug == DM_CONSOLE) - { - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_CHECKED); - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_UNCHECKED); - } - else if (m_KrnlDebug == DM_FILE) - { - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_UNCHECKED); - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_CHECKED); - } - else - { - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_UNCHECKED); - CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_UNCHECKED); + switch (g_Settings->m_core.KrnlDebugMode) { + case DM_CONSOLE: + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_CHECKED); + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_UNCHECKED); + break; + + case DM_FILE: + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_UNCHECKED); + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_CHECKED); + break; + + default: + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_CONSOLE, MF_UNCHECKED); + CheckMenuItem(emul_krnl, ID_EMULATION_DEBUGOUTPUTKERNEL_FILE, MF_UNCHECKED); + break; } - if (m_CxbxDebug == DM_CONSOLE) - { - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_CHECKED); - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_UNCHECKED); - } - else if (m_CxbxDebug == DM_FILE) - { - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_UNCHECKED); - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_CHECKED); - } - else - { - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_UNCHECKED); - CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_UNCHECKED); + switch (g_Settings->m_gui.CxbxDebugMode) { + case DM_CONSOLE: + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_CHECKED); + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_UNCHECKED); + break; + + case DM_FILE: + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_UNCHECKED); + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_CHECKED); + break; + + default: + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_CONSOLE, MF_UNCHECKED); + CheckMenuItem(emul_debg, ID_EMULATION_DEBUGOUTPUTGUI_FILE, MF_UNCHECKED); + break; } + UpdateLogStatus(); } // settings menu @@ -1921,52 +1705,49 @@ void WndMain::RefreshMenus() // enable/disable clear current hle cache EnableMenuItem(settings_menu, ID_CACHE_CLEARHLECACHE_CURRENT, MF_BYCOMMAND | MF_WhenXbeLoadedNotRunning); - UINT chk_flag = (m_FlagsLLE & LLE_JIT) ? MF_CHECKED : MF_UNCHECKED; + UINT chk_flag = (g_Settings->m_core.FlagsLLE & LLE_JIT) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_EMULATION_LLE_JIT, chk_flag); - chk_flag = (m_FlagsLLE & LLE_APU) ? MF_CHECKED : MF_UNCHECKED; + chk_flag = (g_Settings->m_core.FlagsLLE & LLE_APU) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_EMULATION_LLE_APU, chk_flag); - chk_flag = (m_FlagsLLE & LLE_GPU) ? MF_CHECKED : MF_UNCHECKED; + chk_flag = (g_Settings->m_core.FlagsLLE & LLE_GPU) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_EMULATION_LLE_GPU, chk_flag); - chk_flag = (m_DisablePixelShaders) ? MF_CHECKED : MF_UNCHECKED; + //chk_flag = (g_Settings->m_core.FlagsLLE & LLE_USB) ? MF_CHECKED : MF_UNCHECKED; // Reenable this when LLE USB actually works + //CheckMenuItem(settings_menu, ID_EMULATION_LLE_USB, chk_flag); + + chk_flag = (g_Settings->m_hacks.DisablePixelShaders) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_HACKS_DISABLEPIXELSHADERS, chk_flag); - chk_flag = (m_UncapFramerate) ? MF_CHECKED : MF_UNCHECKED; - CheckMenuItem(settings_menu, ID_HACKS_UNCAPFRAMERATE, chk_flag); - - chk_flag = (m_UseAllCores) ? MF_CHECKED : MF_UNCHECKED; + chk_flag = (g_Settings->m_hacks.UseAllCores) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_HACKS_RUNXBOXTHREADSONALLCORES, chk_flag); - chk_flag = (m_SkipRdtscPatching) ? MF_CHECKED : MF_UNCHECKED; + chk_flag = (g_Settings->m_hacks.SkipRdtscPatching) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_HACKS_SKIPRDTSCPATCHING, chk_flag); - - chk_flag = (m_ScaleViewport) ? MF_CHECKED : MF_UNCHECKED; - CheckMenuItem(settings_menu, ID_HACKS_SCALEVIEWPORT, chk_flag); - chk_flag = (m_DirectHostBackBufferAccess) ? MF_CHECKED : MF_UNCHECKED; - CheckMenuItem(settings_menu, ID_HACKS_RENDERDIRECTLYTOHOSTBACKBUFFER, chk_flag); - - //bad - switch (m_StorageToggle) - { + switch (g_Settings->m_gui.DataStorageToggle) { case CXBX_DATA_APPDATA: CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCAPPDATA, MF_CHECKED); - CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCURDIR, MF_UNCHECKED); + CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCEXECDIR, MF_UNCHECKED); CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCUSTOM, MF_UNCHECKED); break; - case CXBX_DATA_CURDIR: + + case CXBX_DATA_EXECDIR: CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCAPPDATA, MF_UNCHECKED); - CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCURDIR, MF_CHECKED); + CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCEXECDIR, MF_CHECKED); CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCUSTOM, MF_UNCHECKED); break; + case CXBX_DATA_CUSTOM: CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCAPPDATA, MF_UNCHECKED); - CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCURDIR, MF_UNCHECKED); + CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCEXECDIR, MF_UNCHECKED); CheckMenuItem(settings_menu, ID_SETTINGS_CONFIG_DLOCCUSTOM, MF_CHECKED); break; } + + chk_flag = (g_Settings->m_core.allowAdminPrivilege) ? MF_CHECKED : MF_UNCHECKED; + CheckMenuItem(settings_menu, ID_SETTINGS_ALLOWADMINPRIVILEGE, chk_flag); } // emulation menu @@ -1983,43 +1764,71 @@ void WndMain::RefreshMenus() EnableMenuItem(emul_menu, ID_EMULATION_STOP, MF_BYCOMMAND | MF_WhenXbeLoadedAndRunning); } } + // NOTE: Must force draw menu bar since sometime status doesn't show the new change. + DrawMenuBar(m_hwnd); } // update debug consoles void WndMain::UpdateDebugConsoles() { - if(m_CxbxDebug == DM_CONSOLE) - { - if(AllocConsole()) - { - freopen("CONOUT$", "wt", stdout); +#ifdef _WINDOWS_ + HANDLE stdHandle = GetStdHandle(STD_OUTPUT_HANDLE); +#endif + switch (g_Settings->m_gui.CxbxDebugMode) { + case DM_CONSOLE: + if (AllocConsole()) { + std::freopen("CONOUT$", "wt", stdout); - SetConsoleTitle("Cxbx-Reloaded : Debug Console"); + SetConsoleTitle("Cxbx-Reloaded : Debug Console"); - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); + SetConsoleTextAttribute(stdHandle, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); - printf("%s", "WndMain: Debug console allocated.\n"); + std::printf("%s", "WndMain: Debug console allocated.\n"); - SetForegroundWindow(m_hwnd); - } - } - else if(m_CxbxDebug == DM_FILE) - { - FreeConsole(); + SetForegroundWindow(m_hwnd); + } + break; - freopen(m_CxbxDebugFilename, "wt", stdout); + case DM_FILE: - printf("%s", "WndMain: Debug console allocated.\n"); - } - else - { - FreeConsole(); + std::freopen(g_Settings->m_gui.szCxbxDebugFile.c_str(), "wt", stdout); + FreeConsole(); - char buffer[16]; + std::printf("%s", "WndMain: Debug console allocated.\n"); + break; - if(GetConsoleTitle(buffer, 16) != NULL) - freopen("nul", "w", stdout); - } + default: + + if (GetConsoleWindow() != NULL) { + std::fclose(stdout); + FreeConsole(); + } + std::freopen("nul", "w", stdout); + + break; + } + + // NOTE: This is a Windows fix for ability to get std::cout to output onto console/file. + // Not sure if linux/unix is affected too. +#ifdef _WINDOWS_ + if (stdHandle != INVALID_HANDLE_VALUE) { + int fileDesc = _open_osfhandle((intptr_t)stdHandle, _O_TEXT); + + if (fileDesc != -1) { + FILE* file = _fdopen(fileDesc, "wt"); + + if (file != nullptr) { + int dup2Result = _dup2(_fileno(file), _fileno(stdout)); + if (dup2Result == 0) { + std::setvbuf(stdout, nullptr, _IONBF, 0); + } + std::fclose(file); + } + } + } + std::wcout.clear(); + std::cout.clear(); +#endif } // update recent files menu @@ -2053,7 +1862,7 @@ void WndMain::UpdateRecentFiles() // NOTE: Resource defines ID_FILE_RXBE_0 through ID_FILE_RXBE_9 must be in order for(int v=0;vm_gui.szRecentXbeFiles[v].c_str()); AppendMenu(RXbeMenu, MF_STRING, ID_FILE_RXBE_0 + v, szBuffer); } } @@ -2065,7 +1874,7 @@ void WndMain::UpdateCaption() { char AsciiTitle[MAX_PATH]; - int i = sprintf(AsciiTitle, "Cxbx-Reloaded %s", _CXBX_VERSION); + int i = sprintf(AsciiTitle, "Cxbx-Reloaded %s", CxbxVersionStr); if (m_Xbe != nullptr) { if (m_bIsStarted) { i += sprintf(AsciiTitle + i, " : Emulating "); @@ -2076,34 +1885,75 @@ void WndMain::UpdateCaption() i += sprintf(AsciiTitle + i, "%s v1.%02d (%s)", FormatTitleId(m_Xbe->m_Certificate.dwTitleId).c_str(), m_Xbe->m_Certificate.dwVersion, m_Xbe->m_szAsciiTitle); - // Append FPS menu text - HMENU hMenu = GetMenu(m_hwnd); - MENUITEMINFO mii; - mii.cbSize = sizeof mii; - mii.fMask = MIIM_STRING; - char sMenu[32]; - mii.dwTypeData = &sMenu[0]; + UpdateFpsStatus(); + UpdateLogStatus(); - if (m_bIsStarted) { - if (g_EmuShared != NULL) { - float currentFPSVal = 0; - float currentMSpFVal = 0; - g_EmuShared->GetCurrentFPS(¤tFPSVal); - g_EmuShared->GetCurrentMSpF(¤tMSpFVal); - sprintf(sMenu, "FPS: %.2f MS / F : %.2f", currentFPSVal, currentMSpFVal); - } - } - else { - // Hide FPS if we're not currently emulating - sprintf(sMenu, " "); - } - - SetMenuItemInfo(hMenu, ID_FPS, FALSE, &mii); } SetWindowText(m_hwnd, AsciiTitle); } +void WndMain::UpdateFpsStatus() +{ + // Append FPS menu text + HMENU hMenu = GetMenu(m_hwnd); + MENUITEMINFO mii; + mii.cbSize = sizeof mii; + mii.fMask = MIIM_STRING; + char sMenu[32]; + mii.dwTypeData = &sMenu[0]; + + if (m_bIsStarted) { + if (g_EmuShared != nullptr) { + g_EmuShared->GetCurrentFPS(&m_FPS_status); + + if (m_FPS_status == 0.0f) { + m_MSpF_status = 0.0f; + } + else { + m_MSpF_status = (float)(1000.0 / m_FPS_status); + } + std::sprintf(sMenu, "FPS: %.2f MS / F : %.2f", m_FPS_status, m_MSpF_status); + } + } + else { + // Hide FPS if we're not currently emulating + std::sprintf(sMenu, " "); + } + + SetMenuItemInfo(hMenu, ID_FPS, FALSE, &mii); +} + +void WndMain::UpdateLogStatus() +{ + // Append FPS menu text + char sMenu[32]; + HMENU hMenu = GetMenu(m_hwnd); + MENUITEMINFO mii; + mii.cbSize = sizeof mii; + mii.fMask = MIIM_STRING; + mii.dwTypeData = &sMenu[0]; + + std::strcpy(sMenu, "LOG:"); + + if (g_Settings->m_gui.CxbxDebugMode != DebugMode::DM_NONE) { + std::strcat(sMenu, "G"); + } + + if (m_bIsStarted && m_LogKrnl_status) { + std::strcat(sMenu, "K"); + } + + SetMenuItemInfo(hMenu, ID_LOG, FALSE, &mii); +} + +void WndMain::RefreshAllStatus() +{ + UpdateFpsStatus(); + UpdateLogStatus(); + DrawMenuBar(m_hwnd); +} + // open an xbe file void WndMain::OpenXbe(const char *x_filename) { @@ -2127,7 +1977,7 @@ void WndMain::OpenXbe(const char *x_filename) delete m_Xbe; m_Xbe = nullptr; - RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE); + RedrawWindow(m_hwnd, nullptr, NULL, RDW_INVALIDATE); MessageBox(m_hwnd, ErrorMessage.c_str(), "Cxbx-Reloaded", MB_ICONSTOP | MB_OK); @@ -2135,64 +1985,66 @@ void WndMain::OpenXbe(const char *x_filename) return; } - + + if (!g_Settings->m_core.allowAdminPrivilege && !m_Xbe->CheckXbeSignature()) + { + int ret = MessageBox(m_hwnd, "XBE signature check failed!\n" + "\nThis is dangerous, as maliciously modified Xbox titles could take control of your system.\n" + "\nAre you sure you want to continue?", "Cxbx-Reloaded", MB_ICONEXCLAMATION | MB_YESNO); + if (ret != IDYES) + { + delete m_Xbe; m_Xbe = nullptr; + + RedrawWindow(m_hwnd, nullptr, NULL, RDW_INVALIDATE); + + UpdateCaption(); + + return; + } + } + // save this xbe to the list of recent xbe files - if(m_XbeFilename[0] != '\0') - { + if(m_XbeFilename[0] != '\0') { bool found = false; // if this filename already exists, temporarily remove it - for(int c=0, r=0;cm_gui.szRecentXbeFiles[c].c_str(), m_XbeFilename) == 0) { found = true; r++; } - if(r != c) - { - if(m_szRecentXbe[r] == 0 || r > m_dwRecentXbe - 1) - { - free(m_szRecentXbe[c]); - m_szRecentXbe[c] = 0; + if(r != c) { + if(g_Settings->m_gui.szRecentXbeFiles[r].c_str() == 0 || r > m_dwRecentXbe - 1) { + g_Settings->m_gui.szRecentXbeFiles[c] = ""; } - else - { - strncpy(m_szRecentXbe[c], m_szRecentXbe[r], MAX_PATH-1); + else { + g_Settings->m_gui.szRecentXbeFiles[c] = g_Settings->m_gui.szRecentXbeFiles[r]; } } } - if(found) + if (found) { m_dwRecentXbe--; + } // move all items down one, removing the last one if necessary - for(int v=RECENT_XBE_SIZE-1;v>0;v--) - { - if(m_szRecentXbe[v-1] == 0) - { - free(m_szRecentXbe[v]); - m_szRecentXbe[v] = 0; + for (int v = RECENT_XBE_LIST_MAX - 1;v > 0; v--) { + + if(g_Settings->m_gui.szRecentXbeFiles[v-1].size() == 0) { + g_Settings->m_gui.szRecentXbeFiles[v] = ""; } - else - { - if(m_szRecentXbe[v] == 0) - m_szRecentXbe[v] = (char*)calloc(1, MAX_PATH); - strncpy(m_szRecentXbe[v], m_szRecentXbe[v-1], MAX_PATH-1); + else { + g_Settings->m_gui.szRecentXbeFiles[v] = g_Settings->m_gui.szRecentXbeFiles[v - 1]; } } // add new item as first index - { - if(m_szRecentXbe[0] == 0) - m_szRecentXbe[0] = (char*)calloc(1, MAX_PATH); + g_Settings->m_gui.szRecentXbeFiles[0] = m_XbeFilename; - strcpy(m_szRecentXbe[0], m_XbeFilename); - } - - if(m_dwRecentXbe < RECENT_XBE_SIZE) + if (m_dwRecentXbe < RECENT_XBE_LIST_MAX) { m_dwRecentXbe++; + } } UpdateRecentFiles(); @@ -2229,10 +2081,10 @@ void WndMain::CloseXbe() // clear logo bitmap { - uint32 v=0; - for(uint32 y=0;y<17;y++) + uint32_t v=0; + for(uint32_t y=0;y<17;y++) { - for(uint32 x=0;x<100;x++) + for(uint32_t x=0;x<100;x++) { SetPixel(m_LogoDC, x, y, RGB(0, 0, 0)); v++; @@ -2245,7 +2097,7 @@ void WndMain::CloseXbe() DeleteObject(m_GameLogoDC); DeleteObject(m_GameLogoBMP); - RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE); + RedrawWindow(m_hwnd, nullptr, NULL, RDW_INVALIDATE); } void WndMain::OpenMRU(int mru) @@ -2258,7 +2110,7 @@ void WndMain::OpenMRU(int mru) GetMenuString(rxbe_menu, ID_FILE_RXBE_0 + mru, szBuffer, 269, MF_BYCOMMAND); - char *szFilename = (char*)((uint32)szBuffer + 5); // +5 skips over "&%d : " prefix (see UpdateRecentFiles) + char *szFilename = (char*)((uint32_t)szBuffer + 5); // +5 skips over "&%d : " prefix (see UpdateRecentFiles) OpenXbe(szFilename); } @@ -2266,7 +2118,7 @@ void WndMain::OpenMRU(int mru) // Open the dashboard xbe if found void WndMain::OpenDashboard() { - std::string DashboardPath = std::string(m_StorageLocation) + std::string("\\EmuDisk\\Partition2\\xboxdash.xbe"); + std::string DashboardPath = g_Settings->GetDataLocation() + std::string("\\EmuDisk\\Partition2\\xboxdash.xbe"); OpenXbe(DashboardPath.c_str()); } @@ -2316,9 +2168,9 @@ void WndMain::SaveXbeAs() ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.lpstrDefExt = "xbe"; ofn.Flags = OFN_PATHMUSTEXIST; @@ -2339,25 +2191,15 @@ void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState / return; } - // Reset to default - g_EmuShared->Reset(); + // Reset to default + g_EmuShared->Reset(); + m_FPS_status = 0.0f; + m_MSpF_status = 0.0f; + m_FlagsLLE_status = g_Settings->m_core.FlagsLLE; + m_LogKrnl_status = g_Settings->m_core.KrnlDebugMode != DebugMode::DM_NONE; - // register xbe path with emulator process - g_EmuShared->SetXbePath(m_Xbe->m_szPath); - - // register LLE flags with emulator process - g_EmuShared->SetFlagsLLE(&m_FlagsLLE); - - // register Hacks with emulator process - g_EmuShared->SetDisablePixelShaders(&m_DisablePixelShaders); - g_EmuShared->SetUncapFramerate(&m_UncapFramerate); - g_EmuShared->SetUseAllCores(&m_UseAllCores); - g_EmuShared->SetSkipRdtscPatching(&m_SkipRdtscPatching); - g_EmuShared->SetScaleViewport(&m_ScaleViewport); - g_EmuShared->SetDirectHostBackBufferAccess(&m_DirectHostBackBufferAccess); - - // register storage location with emulator process - g_EmuShared->SetStorageLocation(m_StorageLocation); + // register all emulator settings to kernel process + g_Settings->SyncToEmulator(); // Preserve previous GUI window location. HWND hOwner = GetParent(m_hwnd); @@ -2369,28 +2211,25 @@ void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState / m_prevWindowLoc.x = curWindowPos.left - m_prevWindowLoc.x; m_prevWindowLoc.y = curWindowPos.top - m_prevWindowLoc.y; - if (m_ScaleViewport) { - // Set the window size to emulation dimensions - // Note : Doing this here assures the emulation process will use - // the configured dimensions (because if done inside the emulation - // process, that doesn't resize correctly sometimes) - // TODO : Instead of doing the resize before launch, move it - // towards CreateDevice emulation, using Xbox-requested dimensions - // (and fix the issue of incorrect resizing) - ResizeWindow(m_hwnd, /*bForGUI*/false); - } + // Set the window size to emulation dimensions (The configured 'display' resolution) + // Note : Doing this here assures the emulation process will use + // the configured dimensions (because if done inside the emulation + // process, that doesn't resize correctly sometimes) + // We always resize, as we no longer tie host resolution to Xbox resolution + // 'Higher Resolution' rendering is handled as a scale factor. + ResizeWindow(m_hwnd, /*bForGUI*/false); // shell exe { char szExeFileName[MAX_PATH]; - GetModuleFileName(GetModuleHandle(NULL), szExeFileName, MAX_PATH); + GetModuleFileName(GetModuleHandle(nullptr), szExeFileName, MAX_PATH); bool AttachLocalDebugger = (LocalDebuggerState == debuggerOn); g_EmuShared->SetDebuggingFlag(&AttachLocalDebugger); std::string szProcArgsBuffer; - XTL::CxbxConvertArgToString(szProcArgsBuffer, szExeFileName, m_XbeFilename, hwndParent, m_KrnlDebug, m_KrnlDebugFilename); + CxbxConvertArgToString(szProcArgsBuffer, szExeFileName, m_XbeFilename, hwndParent, g_Settings->m_core.KrnlDebugMode, g_Settings->m_core.szKrnlDebug); if (AttachLocalDebugger) { @@ -2398,9 +2237,9 @@ void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState / DebuggerMonitorClose(); // TODO: Set a configuration variable for this. For now it will be within the same folder as Cxbx.exe - std::string szProcDbgArgsBuffer = "CxbxDebugger.exe " + szProcArgsBuffer; + std::string szProcDbgArgsBuffer = "cxbxr-debugger.exe " + szProcArgsBuffer; - if (!XTL::CxbxExec(szProcDbgArgsBuffer, &m_hDebuggerProc, true)) { + if (!CxbxExec(szProcDbgArgsBuffer, &m_hDebuggerProc, true)) { MessageBox(m_hwnd, "Failed to start emulation with the debugger.\n\nYou will need to build CxbxDebugger manually.", "Cxbx-Reloaded", MB_ICONSTOP | MB_OK); printf("WndMain: %s debugger shell failed.\n", m_Xbe->m_szAsciiTitle); @@ -2413,7 +2252,7 @@ void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState / } else { - if (!XTL::CxbxExec(szProcArgsBuffer, nullptr, false)) { + if (!CxbxExec(szProcArgsBuffer, nullptr, false)) { MessageBox(m_hwnd, "Emulation failed.\n\n If this message repeats, the Xbe is not supported.", "Cxbx-Reloaded", MB_ICONSTOP | MB_OK); printf("WndMain: %s shell failed.\n", m_Xbe->m_szAsciiTitle); @@ -2441,18 +2280,14 @@ void WndMain::StopEmulation() UpdateCaption(); RefreshMenus(); - int iScaleView = FALSE; - g_EmuShared->GetScaleViewport(&iScaleView); - if (iScaleView != 0) { - // Set the window size back to it's GUI dimensions - ResizeWindow(m_hwnd, /*bForGUI=*/true); - } + // Set the window size back to it's GUI dimensions + ResizeWindow(m_hwnd, /*bForGUI=*/true); g_EmuShared->SetIsEmulating(false); } // wrapper function to call CrashMonitor -DWORD WINAPI WndMain::CrashMonitorWrapper(LPVOID lpParam) +DWORD WndMain::CrashMonitorWrapper(LPVOID lpParam) { CxbxSetThreadName("Cxbx Crash Monitor"); @@ -2501,7 +2336,7 @@ void WndMain::CrashMonitor(DWORD dwChildProcID) // Crash clean up. - KillTimer(m_hwnd, TIMERID_FPS); + KillTimer(m_hwnd, TIMERID_ACTIVE_EMULATION); KillTimer(m_hwnd, TIMERID_LED); m_hwndChild = NULL; m_bIsStarted = false; @@ -2512,7 +2347,7 @@ void WndMain::CrashMonitor(DWORD dwChildProcID) } // monitor for Debugger to close then set as "available" (For limit to 1 debugger per Cxbx GUI.) -DWORD WINAPI WndMain::DebuggerMonitor(LPVOID lpVoid) +DWORD WndMain::DebuggerMonitor(LPVOID lpVoid) { CxbxSetThreadName("Cxbx Debugger Monitor"); WndMain* pThis = static_cast(lpVoid); @@ -2536,7 +2371,6 @@ DWORD WINAPI WndMain::DebuggerMonitor(LPVOID lpVoid) } void WndMain::DebuggerMonitorClose() { - if (m_hDebuggerProc != nullptr) { HANDLE hDebuggerProcTemp = m_hDebuggerProc; std::thread hDebuggerMonitorThreadTemp = std::thread(std::move(m_hDebuggerMonitorThread)); @@ -2572,28 +2406,27 @@ void WndMain::DrawLedBitmap(HWND hwnd, bool bdefault) sprintf(flagString, " "); } else { // draw colored bitmap - int LedSequence[4] = { XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF, XBOX_LED_COLOUR_OFF }; static int LedSequenceOffset = 0; - int FlagsLLE = 0; - - g_EmuShared->GetLedSequence(LedSequence); + unsigned int FlagsLLE = 0; // Select active color and cycle through all 4 phases in the sequence - ActiveLEDColor = LedSequence[LedSequenceOffset & 3]; + ActiveLEDColor = m_LedSeq_status[LedSequenceOffset & 3]; ++LedSequenceOffset; - g_EmuShared->GetFlagsLLE(&FlagsLLE); // Set LLE flags string based on selected LLE flags - if (FlagsLLE & LLE_APU) { + if (m_FlagsLLE_status & LLE_APU) { strcat(flagString, "A"); } - if (FlagsLLE & LLE_GPU) { + if (m_FlagsLLE_status & LLE_GPU) { strcat(flagString, "G"); } - if (FlagsLLE & LLE_JIT) { + if (m_FlagsLLE_status & LLE_USB) { + strcat(flagString, "U"); + } + if (m_FlagsLLE_status & LLE_JIT) { strcat(flagString, "J"); } - if (FlagsLLE == 0) { + if (m_FlagsLLE_status == 0) { sprintf(flagString, "HLE"); } } diff --git a/src/Cxbx/WndMain.h b/src/gui/WndMain.h similarity index 80% rename from src/Cxbx/WndMain.h rename to src/gui/WndMain.h index 2b3522d6e..6fa7a5a0c 100644 --- a/src/Cxbx/WndMain.h +++ b/src/gui/WndMain.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->WndMain.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,21 +26,14 @@ #define WNDMAIN_H #include "Wnd.h" -#include "Common/Xbe.h" +#include "common\xbe\Xbe.h" #include // ****************************************************************** // * constants // ****************************************************************** -#define RECENT_XBE_SIZE 10 - -// Cxbx-Reloaded's data storage location. -typedef enum _CXBX_DATA { - CXBX_DATA_APPDATA = 0, - CXBX_DATA_CURDIR = 1, - CXBX_DATA_CUSTOM = 2, -} CXBX_DATA; +#define RECENT_XBE_LIST_MAX 10 typedef struct _Crash_Manager_Data { LPVOID pWndMain; @@ -140,11 +124,14 @@ class WndMain : public Wnd // * update title bar caption with xbe name and FPS/MSF // ****************************************************************** void UpdateCaption(); + void RefreshAllStatus(); + void UpdateFpsStatus(); + void UpdateLogStatus(); // ****************************************************************** // * crash monitoring wrapper function // ****************************************************************** - static DWORD WINAPI CrashMonitorWrapper(LPVOID lpParam); + static DWORD CrashMonitorWrapper(LPVOID lpParam); // ****************************************************************** // * crash monitoring function thread @@ -154,7 +141,7 @@ class WndMain : public Wnd // ****************************************************************** // * Debugger monitoring function thread // ****************************************************************** - static DWORD WINAPI DebuggerMonitor(LPVOID lpVoid); + static DWORD DebuggerMonitor(LPVOID lpVoid); // ****************************************************************** // * Close debugger monitoring function @@ -205,7 +192,7 @@ class WndMain : public Wnd // ****************************************************************** // * cached filenames // ****************************************************************** - char *m_XbeFilename; + char m_XbeFilename[MAX_PATH]; // ****************************************************************** // * cached window, process, and thread handle @@ -218,55 +205,28 @@ class WndMain : public Wnd // * Recent Xbe files // ****************************************************************** int m_dwRecentXbe; - char *m_szRecentXbe[RECENT_XBE_SIZE]; // ****************************************************************** // * is this window fully initialized? // ****************************************************************** - bool m_bCreated; - - // ****************************************************************** - // * current debug mode type - // ****************************************************************** - DebugMode m_CxbxDebug; - DebugMode m_KrnlDebug; - - // ****************************************************************** - // * LLE flags - // ****************************************************************** - int m_FlagsLLE; - - // ****************************************************************** - // * XInput Enabled Flag - // ****************************************************************** - int m_XInputEnabled; - - // ****************************************************************** - // * Hack Flags - // ****************************************************************** - int m_DisablePixelShaders; - int m_UncapFramerate; - int m_UseAllCores; - int m_SkipRdtscPatching; - int m_ScaleViewport; - int m_DirectHostBackBufferAccess; - - // ****************************************************************** - // * debug output filenames - // ****************************************************************** - char *m_CxbxDebugFilename; - char *m_KrnlDebugFilename; - - // ****************************************************************** - // * Storage location - // ****************************************************************** - CXBX_DATA m_StorageToggle; - char m_StorageLocation[MAX_PATH]; + bool m_bCreated; // ****************************************************************** // * Previous GUI window location (before start emulation) // ****************************************************************** - POINT m_prevWindowLoc; + POINT m_prevWindowLoc; + + // ****************************************************************** + // * Kernel process status + // ****************************************************************** + float m_FPS_status; + float m_MSpF_status; + union { + UINT m_LedSeq_status_block; + UCHAR m_LedSeq_status[4]; + }; + UINT m_FlagsLLE_status; + bool m_LogKrnl_status; }; #endif diff --git a/src/Cxbx/WndSBCFeedback.cpp b/src/gui/WndSBCFeedback.cpp similarity index 93% rename from src/Cxbx/WndSBCFeedback.cpp rename to src/gui/WndSBCFeedback.cpp index 561fea82e..aa03fb919 100644 --- a/src/Cxbx/WndSBCFeedback.cpp +++ b/src/gui/WndSBCFeedback.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->WndSBCFeedback.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/Cxbx/WndSBCFeedback.h b/src/gui/WndSBCFeedback.h similarity index 91% rename from src/Cxbx/WndSBCFeedback.h rename to src/gui/WndSBCFeedback.h index d5e2d4e72..c44c2b3f1 100644 --- a/src/Cxbx/WndSBCFeedback.h +++ b/src/gui/WndSBCFeedback.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Win32->Cxbx->WndSBCFeedback.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/version.h.in b/src/version.h.in new file mode 100644 index 000000000..ea81b51d4 --- /dev/null +++ b/src/version.h.in @@ -0,0 +1,3 @@ +#pragma once + +#cmakedefine _GIT_VERSION "@_GIT_VERSION@" diff --git a/src/CxbxVSBC/CxbxVSBC.cpp b/src/vsbc/CxbxVSBC.cpp similarity index 97% rename from src/CxbxVSBC/CxbxVSBC.cpp rename to src/vsbc/CxbxVSBC.cpp index 5730249f4..86ff30a14 100644 --- a/src/CxbxVSBC/CxbxVSBC.cpp +++ b/src/vsbc/CxbxVSBC.cpp @@ -8,7 +8,6 @@ // #include "CxbxVSBC.h" -//#include "../CxbxKrnl/EmuXapi.h" #include #include "DlgVirtualSBCFeedback.h" diff --git a/src/CxbxVSBC/CxbxVSBC.h b/src/vsbc/CxbxVSBC.h similarity index 95% rename from src/CxbxVSBC/CxbxVSBC.h rename to src/vsbc/CxbxVSBC.h index 359f42c81..962869fa6 100644 --- a/src/CxbxVSBC/CxbxVSBC.h +++ b/src/vsbc/CxbxVSBC.h @@ -1,10 +1,11 @@ +#pragma once + #ifdef CXBXVSBC_EXPORTS #define CXBXVSBC_API __declspec(dllexport) #else #define CXBXVSBC_API __declspec(dllimport) -#endif#pragma once -//#include -//#include "../CxbxKrnl/EmuXapi.h" +#endif + #ifndef X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC #define X_XONTROLLER_HOST_BRIDGE_HOSTTYPE_VIRTUAL_SBC 0x80 #endif diff --git a/src/CxbxVSBC/DlgVirtualSBCFeedback.cpp b/src/vsbc/DlgVirtualSBCFeedback.cpp similarity index 93% rename from src/CxbxVSBC/DlgVirtualSBCFeedback.cpp rename to src/vsbc/DlgVirtualSBCFeedback.cpp index bfb5e4d13..62085737f 100644 --- a/src/CxbxVSBC/DlgVirtualSBCFeedback.cpp +++ b/src/vsbc/DlgVirtualSBCFeedback.cpp @@ -2,15 +2,6 @@ // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.cpp -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them @@ -35,13 +26,11 @@ // ****************************************************************** #include "stdafx.h" -//#include "CxbxKrnl/EmuShared.h" #include "DlgVirtualSBCFeedback.h" -//#include "../CxbxKrnl/EmuXapi.h" #include "Winuser.h" #include "Windowsx.h" #include "Commctrl.h" -#include "../Cxbx/ResCxbx.h" +#include "../gui/ResCxbx.h" #include diff --git a/src/CxbxVSBC/DlgVirtualSBCFeedback.h b/src/vsbc/DlgVirtualSBCFeedback.h similarity index 78% rename from src/CxbxVSBC/DlgVirtualSBCFeedback.h rename to src/vsbc/DlgVirtualSBCFeedback.h index a37295f19..a61396169 100644 --- a/src/CxbxVSBC/DlgVirtualSBCFeedback.h +++ b/src/vsbc/DlgVirtualSBCFeedback.h @@ -1,14 +1,5 @@ // ****************************************************************** // * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Cxbx->DlgControllerConfig.h -// * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them diff --git a/src/CxbxVSBC/dllmain.cpp b/src/vsbc/dllmain.cpp similarity index 100% rename from src/CxbxVSBC/dllmain.cpp rename to src/vsbc/dllmain.cpp diff --git a/src/CxbxVSBC/stdafx.cpp b/src/vsbc/stdafx.cpp similarity index 100% rename from src/CxbxVSBC/stdafx.cpp rename to src/vsbc/stdafx.cpp diff --git a/src/CxbxVSBC/stdafx.h b/src/vsbc/stdafx.h similarity index 100% rename from src/CxbxVSBC/stdafx.h rename to src/vsbc/stdafx.h diff --git a/src/CxbxVSBC/targetver.h b/src/vsbc/targetver.h similarity index 100% rename from src/CxbxVSBC/targetver.h rename to src/vsbc/targetver.h